ソースを参照

fix:发票审批防抖

liujt 2 週間 前
コミット
f37ea4175c

+ 7 - 0
src/views/bpm/handleTask/components/financialManage/invoiceManage/submit.vue

@@ -23,6 +23,7 @@
         type="success"
         size="mini"
         v-click-once
+        :loading="loading"
         @click="handleAudit(1)"
         >通过
       </el-button>
@@ -31,6 +32,7 @@
         type="danger"
         size="mini"
         v-click-once
+        :loading="loading"
         @click="_approveTaskWithVariables(0)"
         >驳回
       </el-button>
@@ -77,6 +79,7 @@
           technicianId: '',
           reason: '同意'
         },
+        loading: false,
         tabOptions: [
           { key: 'starter', permissionType: 'update', name: '发起人申请' },
           {
@@ -113,18 +116,22 @@
         let variables = {
           pass: !!status
         };
+        this.loading = true;
         let API = !!status ? approveTaskWithVariables : rejectTask;
         API({
           id: this.taskId,
           reason: this.form.reason,
           variables
         }).then((res) => {
+          this.loading = false;
           if (res.data.code != '-1') {
             this.$emit('handleAudit', {
               status,
               title: status === 0 ? '驳回' : ''
             });
           }
+        }).finally(() => {
+          this.loading = false;
         });
       },