Browse Source

fix: 保存/提交增加loading

zh 2 years ago
parent
commit
4b1e351cb4

+ 21 - 4
src/views/sales_policy/policy_list.vue

@@ -249,6 +249,25 @@ export default {
         },
         {
           adminUserId: null,
+          colName: 'specification2',
+          enumMap: '{}',
+          frontCode: '',
+          hide: false,
+          isCopy: false,
+          isQuery: true,
+          isShow: false,
+          isTotal: false,
+          jname: 'specification2',
+          label: '已作废机型',
+          multiple: false,
+          pk: false,
+          sortNum: 0,
+          tbName: '',
+          type: 'input',
+          noUse: true
+        },
+        {
+          adminUserId: null,
           colName: 'customer_id',
           enumMap: '{}',
           frontCode: 'CUSTOMER',
@@ -385,7 +404,7 @@ export default {
               ''
             )}
 
-            {row.examineStatus == 'OK' ? (
+            {(
               <el-popconfirm
                 onOnConfirm={async() => {
                   this.handleClone(row)
@@ -396,9 +415,7 @@ export default {
                   克隆
                 </el-button>
               </el-popconfirm>
-            ) : (
-              ''
-            )}
+            ) }
 
             {row.examineStatus != 'OK' ? (
               <el-popconfirm

+ 7 - 2
src/views/supply/engin/components/engin_form.vue

@@ -323,7 +323,7 @@
 
     <div class="page-footer">
       <div class="footer">
-        <el-button type="primary" @click="clickSubmitForm(1)">保 存</el-button>
+        <el-button type="primary" :loading="btnLoading" @click="clickSubmitForm(1)">保 存</el-button>
         <!--        <el-button type="primary" @click="clickSubmitForm(2)">提交审核</el-button>-->
         <el-popconfirm title="确定关闭吗?" style="margin-left: 10px" @onConfirm="goBack">
           <el-button slot="reference">返回列表</el-button>
@@ -523,7 +523,7 @@ export default {
         { value: '医院医疗', label: '医院医疗' },
         { value: '其他', label: '其他' }
       ],
-
+      btnLoading: false,
       typeList: [],
       salesTypeList: [],
       salesmanList: [],
@@ -904,6 +904,7 @@ export default {
     },
 
     clickSubmitForm(type) {
+      this.btnLoading = true
       this.$refs.mainForm.validate(valid => {
         if (valid) {
           for (let i = 0; i < this.goodsList.length; i++) {
@@ -962,6 +963,8 @@ export default {
             if (this.listItem) {
               params.enginInfoId = this.listItem.enginInfoId
               editEngin(params).then(res => {
+                this.btnLoading = false
+
                 this.$successMsg('编辑成功')
                 this.goBack()
               })
@@ -971,6 +974,8 @@ export default {
               params.customerId = this.mainForm.jxsId
               addEngin(params).then(res => {
                 this.$successMsg('保存成功')
+                this.btnLoading = false
+
                 this.goBack()
               })
             }

+ 7 - 2
src/views/supply/policy/components/retail_form.vue

@@ -317,7 +317,7 @@
 
     <div class="page-footer">
       <div class="footer" :class="classObj">
-        <el-button type="primary" @click="clickSubmitForm">保 存</el-button>
+        <el-button type="primary" :loading="btnLoading" @click="clickSubmitForm">保 存</el-button>
         <el-popconfirm title="确定关闭吗?" style="margin-left: 10px" @onConfirm="goBack">
           <el-button slot="reference">返回列表</el-button>
         </el-popconfirm>
@@ -795,7 +795,8 @@ export default {
       remark: '',
       commercialType: false,
       correspondName: '',
-      correspondId: ''
+      correspondId: '',
+      btnLoading: false
     }
   },
 
@@ -1893,6 +1894,7 @@ export default {
     },
     // 保存
     clickSubmitForm() {
+      this.btnLoading = true
       this.$refs.mainForm.validate(valid => {
         if (valid) {
           // let mainName =
@@ -1934,6 +1936,7 @@ export default {
             params.id = this.listItem.id
             editData(params).then(res => {
               this.$successMsg('编辑成功')
+              this.btnLoading = false
               this.goBack()
             })
           } else {
@@ -1944,6 +1947,8 @@ export default {
             })
             addData(params).then(res => {
               this.$successMsg('添加成功')
+              this.btnLoading = false
+
               this.goBack()
             })
           }

+ 7 - 2
src/views/supply/retail/components/retail_form.vue

@@ -322,7 +322,7 @@
 
     <div class="page-footer">
       <div class="footer">
-        <el-button type="primary" @click="clickSubmitForm">保 存</el-button>
+        <el-button type="primary" :loading="btnLoading" @click="clickSubmitForm">保 存</el-button>
         <el-popconfirm title="确定关闭吗?" style="margin-left: 10px" @onConfirm="goBack">
           <el-button slot="reference">返回列表</el-button>
         </el-popconfirm>
@@ -601,7 +601,7 @@ export default {
         // ],
       },
       goodsList: [],
-
+      btnLoading: false,
       warehouseList: [],
       warehouseValue: '',
       isShowDialog: false,
@@ -1088,6 +1088,7 @@ export default {
 
     // 保存
     clickSubmitForm() {
+      this.btnLoading = true
       this.$refs.mainForm.validate(valid => {
         if (valid) {
           for (let i = 0; i < this.goodsList.length; i++) {
@@ -1135,11 +1136,15 @@ export default {
             params.id = this.listItem.id
             editData(params).then(res => {
               this.$successMsg('编辑成功')
+              this.btnLoading = false
+
               this.goBack()
             })
           } else {
             addData(params).then(res => {
               this.$successMsg('添加成功')
+              this.btnLoading = false
+
               this.goBack()
             })
           }