Explorar el Código

feat(审批流程): 库存调拨审批增加loading

liujt hace 6 meses
padre
commit
92815945eb
Se han modificado 1 ficheros con 10 adiciones y 2 borrados
  1. 10 2
      src/views/bpm/handleTask/components/allocate/submit.vue

+ 10 - 2
src/views/bpm/handleTask/components/allocate/submit.vue

@@ -1,5 +1,5 @@
 <template>
-  <el-col :span="16" :offset="6">
+  <el-col :span="16" :offset="6" v-loading="isSaveLoading">
     <el-form label-width="100px" ref="formRef" :model="form">
       <el-form-item
         label="审批建议"
@@ -24,6 +24,7 @@
         type="success"
         size="mini"
         @click="handleAudit(1)"
+        :loading="isSaveLoading"
         >通过
       </el-button>
 
@@ -32,6 +33,7 @@
         type="danger"
         size="mini"
         @click="handleAudit(0)"
+        :loading="isSaveLoading"
         >驳回
       </el-button>
     </div>
@@ -43,7 +45,8 @@
   export default {
     data() {
       return {
-        form: {}
+        form: {},
+        isSaveLoading: false
       };
     },
     props: {
@@ -72,6 +75,7 @@
       async _approveTaskWithVariables(status) {
         console.log(status);
         console.log(this.taskDefinitionKey);
+        this.isSaveLoading = true;
         // return
         if (status == 1) {
           if (this.taskDefinitionKey === 'storage') {
@@ -83,6 +87,7 @@
                 variables: { pass: true }
               };
               const data = await approveTaskWithVariables(params);
+              this.isSaveLoading = false;
               if (data.data.code != '-1') {
                 this.$emit('handleAudit', {
                   status,
@@ -97,6 +102,7 @@
               variables: { pass: true }
             };
             const data = await approveTaskWithVariables(params);
+            this.isSaveLoading = false;
             if (data.data.code != '-1') {
               this.$emit('handleAudit', {
                 status,
@@ -112,6 +118,7 @@
               reason: this.form.reason,
               taskId: this.taskId
             });
+            this.isSaveLoading = false;
             if (data.data.code != '-1') {
               this.$emit('handleAudit', {
                 status,
@@ -125,6 +132,7 @@
               variables: { pass: false }
             };
             const data = await approveTaskWithVariables(params);
+            this.isSaveLoading = false;
             if (data.data.code != '-1') {
               this.$emit('handleAudit', {
                 status,