Ver código fonte

fix: 增加 finally回调

zh 2 anos atrás
pai
commit
fe46cba437

+ 7 - 7
src/views/sales_policy/components/LinitVisible.vue

@@ -1,6 +1,6 @@
 <template>
   <el-dialog
-    title="经销商上限"
+    :title=" !operationType ? '经销商上限':'经销商提货上限'"
     :visible.sync="linitVisible"
     width="60%"
     :show-close="false"
@@ -315,7 +315,7 @@ export default {
                 <el-input
                   type='number'
                   value={row.orderNums}
-                  disabled={this.linitType === 'edit'}
+                  disabled={true}
                   onInput={e => (row.orderNums = e)}
                   placeholder='请输入'
                   size='mini'
@@ -338,7 +338,7 @@ export default {
                   type='number'
                   value={row.examineOrderNums}
                   onInput={e => (row.examineOrderNums = e)}
-                  disabled={this.linitType === 'edit'}
+                  disabled={true}
                   placeholder='请输入'
                   size='mini'
                   clearable
@@ -361,10 +361,10 @@ export default {
           policyId: this.policyId,
           customerName: '',
           customerNumber: '',
-          examineOrderNums: null,
+          examineOrderNums: 0,
           materialName: '',
           materialNumber: '',
-          orderNums: null,
+          orderNums: 0,
           policyType: '',
           specification: ''
         })
@@ -380,8 +380,8 @@ export default {
           policyId: this.policyId,
           customerName: '',
           customerNumber: '',
-          examineOrderNums: null,
-          orderNums: null,
+          examineOrderNums: 0,
+          orderNums: 0,
           policyType: '',
           specification: ''
         })

+ 11 - 3
src/views/supply/engin/components/commerce_form.vue

@@ -393,7 +393,7 @@
     <div class="page-footer">
       <div class="footer">
         <!-- <el-button type="primary" @click="clickSubmitForm(1)">保 存</el-button> -->
-        <el-button type="primary" @click="clickSubmitForm(2)">提交审核</el-button>
+        <el-button type="primary" :loading="btnLoading" @click="clickSubmitForm(2)">提交审核</el-button>
         <el-popconfirm title="确定关闭吗?" style="margin-left: 10px" @onConfirm="goBack">
           <el-button slot="reference">返回列表</el-button>
         </el-popconfirm>
@@ -583,7 +583,8 @@ export default {
       flag: false,
       isFirst: false,
       salesmanList: [],
-      isPlanOrder: ''
+      isPlanOrder: '',
+      btnLoading: false
     }
   },
 
@@ -1034,6 +1035,7 @@ export default {
 
     // 保存 / 提交审核
     clickSubmitForm(type) {
+      this.btnLoading = true
       this.$refs.mainForm.validate(valid => {
         if (valid) {
           if (this.goodsList.length < 1) {
@@ -1108,6 +1110,8 @@ export default {
                 this.$successMsg('编辑成功')
                 this.goBack()
 
+              }).finally(() => {
+                this.btnLoading = false
               })
             } else {
               params.customerNumber = this.mainForm.jxsNum
@@ -1117,6 +1121,8 @@ export default {
                 this.$successMsg('新增成功')
                 this.goBack()
 
+              }).finally(() => {
+                this.btnLoading = false
               })
             }
           } else if (type === 2) {
@@ -1127,7 +1133,9 @@ export default {
               this.$successMsg('提交审核成功')
               this.goBack()
 
-            })
+            }).finally(() => {
+                this.btnLoading = false
+              })
           }
         }
       })

+ 6 - 4
src/views/supply/engin/components/engin_form.vue

@@ -963,10 +963,10 @@ export default {
             if (this.listItem) {
               params.enginInfoId = this.listItem.enginInfoId
               editEngin(params).then(res => {
-                this.btnLoading = false
-
                 this.$successMsg('编辑成功')
                 this.goBack()
+              }).finally(() => {
+                this.btnLoading = false
               })
             } else {
               params.customerNumber = this.mainForm.jxsNum
@@ -974,9 +974,9 @@ export default {
               params.customerId = this.mainForm.jxsId
               addEngin(params).then(res => {
                 this.$successMsg('保存成功')
-                this.btnLoading = false
-
                 this.goBack()
+              }).finally(() => {
+                this.btnLoading = false
               })
             }
           } else {
@@ -990,6 +990,8 @@ export default {
             submitEngin(params).then(res => {
               this.$successMsg('提交审核成功')
               this.goBack()
+            }).finally(() => {
+              this.btnLoading = false
             })
           }
         }

+ 4 - 0
src/views/supply/policy/components/retail_form.vue

@@ -1940,6 +1940,8 @@ export default {
               this.$successMsg('编辑成功')
               this.btnLoading = false
               this.goBack()
+            }).finally(() => {
+              this.btnLoading = false
             })
           } else {
             console.log('添加成功', this.policyConditionId)
@@ -1952,6 +1954,8 @@ export default {
               this.btnLoading = false
 
               this.goBack()
+            }).finally(() => {
+              this.btnLoading = false
             })
           }
         }

+ 4 - 0
src/views/supply/retail/components/retail_form.vue

@@ -1141,6 +1141,8 @@ export default {
               this.btnLoading = false
 
               this.goBack()
+            }).finally(() => {
+              this.btnLoading = false
             })
           } else {
             addData(params).then(res => {
@@ -1148,6 +1150,8 @@ export default {
               this.btnLoading = false
 
               this.goBack()
+            }).finally(() => {
+              this.btnLoading = false
             })
           }
         }