Selaa lähdekoodia

fix(bpm): 优化出库审批校验逻辑

仅库管节点校验部门及领料人,移除强制审批意见填写
yusheng 5 päivää sitten
vanhempi
commit
f5a1cce1bc

+ 22 - 19
src/views/bpm/handleTask/components/selectedCollectionOutbound/submit.vue

@@ -107,9 +107,16 @@
         this._approveTaskWithVariables(status);
       },
       async handleAudit(status) {
-        let data = await this.getTableValue();
-        let storageData = data.returnStorageData;
-        if (!!status) {
+        // if (!!status) {
+
+        // }
+        // if (!this.form.reason && !!status) {
+        //   this.$message.error('请输入审批意见');
+        //   return false;
+        // }
+        if (this.taskDefinitionKey === 'storeman' && !!status) {
+          let data = await this.getTableValue();
+          let storageData = data.returnStorageData;
           if (!storageData?.extInfo?.verifyDeptCode) {
             this.$message.error('请选择部门');
             return false;
@@ -118,12 +125,6 @@
             this.$message.error('请选择领料人');
             return false;
           }
-        }
-        if (!this.form.reason && !!status) {
-          this.$message.error('请输入审批意见');
-          return false;
-        }
-        if (this.taskDefinitionKey === 'storeman' && !!status) {
           // 入库来源isSkip 0-正常  1-外部(外部跳过内部审核流程)
           storageData.isSkip = 1;
           this.isLoading = true;
@@ -175,16 +176,18 @@
           id: this.taskId,
           reason: this.form.reason,
           variables
-        }).then((res) => {
-          if (res.data.code != '-1') {
-            this.$emit('handleAudit', {
-              status,
-              title: status === 0 ? '驳回' : ''
-            });
-          }
-        }).finally(() => {
-          this.isLoading = false;
-        });
+        })
+          .then((res) => {
+            if (res.data.code != '-1') {
+              this.$emit('handleAudit', {
+                status,
+                title: status === 0 ? '驳回' : ''
+              });
+            }
+          })
+          .finally(() => {
+            this.isLoading = false;
+          });
       },
       //更多
       handleCommand(command) {