|
|
@@ -43,7 +43,6 @@
|
|
|
import { approveTaskWithVariables } from '@/api/bpm/task';
|
|
|
import { jsBomNotPass, batchUpdate } from '@/api/bpm/components/bomApprover';
|
|
|
|
|
|
-
|
|
|
// 流程实例的详情页,可用于审批
|
|
|
export default {
|
|
|
name: '',
|
|
|
@@ -73,11 +72,25 @@
|
|
|
created() {},
|
|
|
methods: {
|
|
|
async handleAudit(status) {
|
|
|
-
|
|
|
this._approveTaskWithVariables(status);
|
|
|
},
|
|
|
async _approveTaskWithVariables(status) {
|
|
|
if (status == 1) {
|
|
|
+ if (
|
|
|
+ this.taskDefinitionKey == 'Activity_021lrxj' ||
|
|
|
+ this.taskDefinitionKey == 'Activity_1q7btlc'
|
|
|
+ ) {
|
|
|
+ let LL = await this.getTableValue();
|
|
|
+ let bol = LL.every((m) => m.supplierId);
|
|
|
+
|
|
|
+ if (!bol) {
|
|
|
+ this.$message.error('请选择供应商!');
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
approveTaskWithVariables({
|
|
|
businessId: this.businessId,
|
|
|
id: this.taskId,
|
|
|
@@ -85,8 +98,7 @@
|
|
|
variables: { pass: true }
|
|
|
}).then((res) => {
|
|
|
if (res.data.code != '-1') {
|
|
|
-
|
|
|
- this.updateDate()
|
|
|
+ this.updateDate();
|
|
|
|
|
|
this.$emit('handleAudit', {
|
|
|
status,
|
|
|
@@ -115,16 +127,29 @@
|
|
|
*
|
|
|
* @returns {Promise<void>}
|
|
|
*/
|
|
|
- async updateDate() {
|
|
|
+ async updateDate() {
|
|
|
let LL = await this.getTableValue();
|
|
|
- let _LL = LL.map((m) => {
|
|
|
- return {
|
|
|
- id: m.id,
|
|
|
- materielDesignation: m.materielDesignation
|
|
|
- };
|
|
|
- });
|
|
|
- if (_LL.length > 0) {
|
|
|
- batchUpdate(_LL).then(() => {});
|
|
|
+
|
|
|
+ if (this.taskDefinitionKey == 'Activity_0uypakw') {
|
|
|
+ let _LL = LL.map((m) => {
|
|
|
+ return {
|
|
|
+ id: m.id,
|
|
|
+ materielDesignation: m.materielDesignation
|
|
|
+ };
|
|
|
+ });
|
|
|
+ if (_LL.length > 0) {
|
|
|
+ batchUpdate(_LL).then(() => {});
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ let _LL = LL.map((m) => {
|
|
|
+ return {
|
|
|
+ id: m.id,
|
|
|
+ supplierId: m.supplierId
|
|
|
+ };
|
|
|
+ });
|
|
|
+ if (_LL.length > 0) {
|
|
|
+ batchUpdate(_LL).then(() => {});
|
|
|
+ }
|
|
|
}
|
|
|
},
|
|
|
|