yusheng 10 месяцев назад
Родитель
Сommit
4b7a568274

+ 19 - 4
src/views/bpm/handleTask/components/saleOrder/entrustedReceive/submit.vue

@@ -28,7 +28,6 @@
       </el-form-item>
       <el-form-item
         label="审批建议"
-
         style="margin-bottom: 20px"
         :rules="{
           required: true,
@@ -69,7 +68,7 @@
         icon="el-icon-circle-close"
         type="danger"
         size="mini"
-        @click="handleAudit(0)"
+        @click="rejectTask(0)"
         v-if="!['starter'].includes(taskDefinitionKey)"
         >驳回
       </el-button>
@@ -119,7 +118,7 @@
   // import outin from '@/api/warehouseManagement/outin';
   import storageApi from '@/api/warehouseManagement';
   import { cancel } from '@/api/bpm/components/saleManage/entrustedReceive';
-  import {approveTaskWithVariables, rejectTask} from '@/api/bpm/task';
+  import { approveTaskWithVariables, rejectTask } from '@/api/bpm/task';
   import { getWarehouseListByIds } from '@/api/bpm/components/saleManage/saleorder';
 
   // 流程实例的详情页,可用于审批
@@ -194,7 +193,23 @@
       handleBackList() {
         this.$emit('handleBackList');
       },
-
+      rejectTask(status) {
+        let variables = {
+          pass: !!status,
+        };
+        rejectTask({
+          id: this.taskId,
+          reason: this.form.reason,
+          variables
+        }).then((res) => {
+          if (res.data.code != '-1') {
+            this.$emit('handleAudit', {
+              status,
+              title: status === 0 ? '驳回' : ''
+            });
+          }
+        });
+      },
       async handleAudit(status) {
         let storemanIds = '';
         let permissionType = this.tabOptions.find(