Pārlūkot izejas kodu

保存销售加loading

cxmo 1 gadu atpakaļ
vecāks
revīzija
44e80e4a5a

+ 7 - 2
src/views/custom_manage/overseasList/components/selectSaleDialog.vue

@@ -9,7 +9,7 @@
         v-dialogDrag
         center
     >
-        <div class="dialog-content-wrap" v-loading="dialogLoading">
+        <div class="dialog-content-wrap" v-loading="dialogLoading" :element-loading-text="loadingText">
             <el-cascader v-model="sales" 
                 ref="saleCascader"
                 placeholder="请选择销售"
@@ -36,7 +36,7 @@
         </div>
         <div class="btn-wrap">
             <el-button type="primary" plain @click="$emit('close')">取消</el-button>
-            <el-button type="primary" @click="choosedSales">确认</el-button>
+            <el-button type="primary" @click="choosedSales" :disabled="dialogLoading">确认</el-button>
         </div>
     </el-dialog>
 </template>
@@ -62,12 +62,15 @@ export default {
             saleCascaderKey:0,
             AllSalesArr:[],
             dialogLoading:false,
+            loadingText:''
         };
     },
     watch:{
         isSelectSaleShow(newval){
             if(newval){
                 this.getSalesList()
+            }else{
+                this.loadingText = ''
             }
         }
     },
@@ -126,6 +129,8 @@ export default {
                 }
             })
             AddSellerIdArr = Array.from(new Set([...AddSellerIdArr,...tempSales]))
+            this.loadingText = '保存销售中...'
+            this.dialogLoading = true
             this.$emit('saveSales',{AddSellerIdArr,DelSellerIdArr,sales:this.selectList})
         }
     },

+ 2 - 0
src/views/custom_manage/overseasList/overseasCustomList.vue

@@ -157,6 +157,7 @@
         </div>
         <!-- 选择销售弹窗 -->
         <SelectSaleDialog 
+            ref="selectDialog"
             :isSelectSaleShow="isSelectSaleShow"
             :selectedSalesArr="salesArr"
             @close="isSelectSaleShow=false"
@@ -285,6 +286,7 @@ export default {
             overseasCustomInterence.saveSelectedSales({
                 AddSellerIdArr,DelSellerIdArr
             }).then(res=>{
+                this.$refs.selectDialog&&(this.$refs.selectDialog.dialogLoading = false)
                 if(res.Ret!==200) return
                 this.$message.success("选择销售成功")
                 this.tableParams = {