LAPTOP-FO2T5SIU\35838 7 miesięcy temu
rodzic
commit
3f1cc0b7c4

+ 5 - 3
src/views/customerManagement/numberManagement/addCustomer.vue

@@ -1,6 +1,6 @@
 <template>
   <div>
-    <el-form ref="form" v-loading="addLoading" :model="form" style="width: 100%;padding: 5px" :rules="rules">
+    <el-form ref="form" :model="form" style="width: 100%;padding: 5px" :rules="rules">
       <el-row>
         <el-col style="padding-bottom: 10px">
           <span class="card_title">基本信息</span>
@@ -120,7 +120,7 @@
     </el-form>
     <div style="text-align: right">
       <el-button @click="cancel">取 消</el-button>
-      <el-button v-if="!isView" type="primary" @click="confirmSubmit()">提 交</el-button>
+      <el-button v-if="!isView" :loading="addLoading" type="primary" @click="confirmSubmit()">提 交</el-button>
     </div>
 
   </div>
@@ -218,6 +218,7 @@ export default {
             const _this = this
             this.$refs.form.validate(valid => {
                 if (valid) {
+                    _this.addLoading = true
                     let soaUrl = 'add'
                     if (_this.form.id) {
                         soaUrl = 'edit'
@@ -228,7 +229,6 @@ export default {
                         buyerJson: JSON.stringify(_this.form.dynamicItem)
                     }
                     const postData = Object.assign({}, _this.form, extraData)
-                    console.log('postData', postData)
                     this.baseRequest(soaUrl, postData).then(res => {
                         if (res.data.code == '200') {
                             _this.$message({
@@ -242,11 +242,13 @@ export default {
                                 type: 'warning'
                             })
                         }
+                        _this.addLoading = false
                     }).catch(err => {
                         _this.$message({
                             message: err,
                             type: 'warning'
                         })
+                        _this.addLoading = false
                     })
                 } else {
                     console.log('error submit!!')

+ 6 - 2
src/views/parkAssets/parkBuild/index.vue

@@ -259,7 +259,7 @@
       </el-form>
       <div slot="footer">
         <el-button @click="dialogVisible = false">取 消</el-button>
-        <el-button type="primary" @click="confirmSubmit()">确 定</el-button>
+        <el-button type="primary" :loading="loadingFlag" @click="confirmSubmit()">确 定</el-button>
       </div>
     </el-dialog>
 
@@ -349,7 +349,8 @@ export default {
             importType: '',
             importTitle: '',
             uploadTitle: [],
-            isView: false
+            isView: false,
+            loadingFlag: false
 
         }
     },
@@ -457,6 +458,7 @@ export default {
             this.$refs.buildForm.validate(valid => {
                 if (valid) {
                     const _this = this
+                    _this.loadingFlag = true
                     const extraData = {}
                     const postData = Object.assign({}, _this.buildForm, extraData)
                     // 父级
@@ -499,11 +501,13 @@ export default {
                                 type: 'success'
                             })
                         }
+                        _this.loadingFlag = false
                     }).catch((err) => {
                         this.$message({
                             message: err,
                             type: 'error'
                         })
+                        _this.loadingFlag = false
                     })
                 }
             })

+ 4 - 12
src/views/parkAssets/parkRoom/index.vue

@@ -440,7 +440,7 @@
       </el-form>
       <div slot="footer">
         <el-button @click="dialogChose">取 消</el-button>
-        <el-button type="primary" @click="confirmSubmit()">确 定</el-button>
+        <el-button :loading="loadingFlag" type="primary" @click="confirmSubmit()">确 定</el-button>
       </div>
     </el-dialog>
 
@@ -648,7 +648,6 @@ export default {
             this.houseTypeOption = []
             this.dialogVisible = true
             this.dialogTitle = '编辑房间'
-            this.loadingFlag = true
         },
         handleView: function(val) {
             this.isView = true
@@ -671,24 +670,17 @@ export default {
         },
 
         confirmSubmit: function() {
+            const _this = this
             this.$refs.houseForm.validate(valid => {
                 if (valid) {
+                    _this.loadingFlag = true
                     const ids = this.houseForm.findids
                     if (ids != null && ids != [] && ids != '') {
                         this.houseForm.groupId = ids[0]
                         this.houseForm.discId = ids[1]
                         this.houseForm.buildId = ids[2]
                     }
-                    // let houseTypePicture = ''
-                    // this.fileList.forEach(v => {
-                    //     if (houseTypePicture) {
-                    //         houseTypePicture = houseTypePicture + ',' + v.id
-                    //     } else {
-                    //         houseTypePicture = v.id
-                    //     }
-                    // })
                     const extraData = {
-                        // houseTypePicture: houseTypePicture
                     }
                     const postData = Object.assign({}, this.houseForm, extraData)
                     this.baseRequest(this.urlStr, postData).then((res) => {
@@ -700,6 +692,7 @@ export default {
                             message: '提交成功',
                             type: 'success'
                         })
+                        _this.loadingFlag = false
                     }).catch(() => {
                     })
                 }
@@ -797,7 +790,6 @@ export default {
                                 }
                             }
                         }
-                        _this.loadingFlag = false
                     })
                     .catch(() => {})
             }