ysy 1 rok temu
rodzic
commit
840554fda0

+ 2 - 2
src/views/bpm/handleTask/components/bomApproverJSYY/detailDialog.vue

@@ -86,8 +86,8 @@
           "
         >
           <el-option
-            v-for="item in gysList"
-            :key="item.id"
+            v-for="(item,index) in gysList"
+            :key="item.id + index"
             :value="item.id"
             :label="item.name"
           ></el-option>

+ 38 - 13
src/views/bpm/handleTask/components/bomApproverJSYY/submit.vue

@@ -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(() => {});
+          }
         }
       },
 

+ 1 - 1
src/views/bpm/handleTask/components/bomApproverJSdevice/detailDialog.vue

@@ -86,7 +86,7 @@
         >
           <el-option
             v-for="item in gysList"
-            :key="item.id"
+           :key="item.id + index"  
             :value="item.id"
             :label="item.name"
           ></el-option>

+ 22 - 9
src/views/bpm/handleTask/components/bomApproverJSdevice/submit.vue

@@ -111,16 +111,29 @@
         }
       },
 
-      async  updateDate() {
+      async updateDate() {
         let LL = await this.getTableValue();
-        let _LL = LL.map((m) => {
-          return {
-            id: m.id,
-            supplierId: m.supplierId
-          };
-        });
-        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(() => {});
+          }
         }
       },