Browse Source

优化弹框和点击范围

liuxiaona 2 years ago
parent
commit
553bd529b3

+ 40 - 4
project/src/components/assembly/tagGroup.vue

@@ -5,7 +5,7 @@
5 5
     :append-to-body="true"
6 6
     class="addLable_dialog"
7 7
     width="40%">
8
-    <div class="groupCon">
8
+    <div class="groupCon" v-loading="loading">
9 9
       <div class="group_item">
10 10
         <div class="lable">标签组名称:</div>
11 11
         <div class="opaArea">
@@ -57,8 +57,8 @@
57 57
       <div class="flex">
58 58
         <div class="f14 c-00B38A pointer" @click="deleTagGroup()" v-if="source == 'edit'">删除该标签组</div>
59 59
         <div class="lMarauto">
60
-          <el-button size="mini" @click="lableGroup = false">取 消</el-button>
61
-          <el-button size="mini" type="primary" @click="source == 'add' ? addTagGroup() : editTagGroup()">确 定</el-button>
60
+          <el-button :disabled="loading" size="mini" @click="lableGroup = false">取 消</el-button>
61
+          <el-button :disabled="loading" size="mini" type="primary" @click="source == 'add' ? addTagGroup() : editTagGroup()">确 定</el-button>
62 62
         </div>
63 63
       </div>
64 64
     </div>
@@ -72,6 +72,7 @@ export default {
72 72
   data(){
73 73
     return{
74 74
       lableGroup:false,
75
+      loading:false,
75 76
       groupName:'',
76 77
       groupId:'',
77 78
       moreLable:[{tag_id:0,tag_name:''}],//添加标签组时,新增标签的数据列表,传给后台
@@ -84,6 +85,7 @@ export default {
84 85
         cancelButtonText: '取消',
85 86
         type: 'warning'
86 87
       }).then(() => {
88
+        this.loading = true
87 89
         this.$axios.post(this.URL.BASEURL + this.URL.dele_tag_group, {
88 90
           group_id: this.groupId
89 91
         }).then((res) => {
@@ -96,6 +98,13 @@ export default {
96 98
             message: res.err,
97 99
             type: "warning"
98 100
           })
101
+          this.loading = false
102
+        }).catch(err=>{
103
+          this.$message({
104
+            message: '服务故障,请稍候再试',
105
+            type: "warning"
106
+          })
107
+          this.loading = false
99 108
         })
100 109
       })
101 110
     },
@@ -107,17 +116,24 @@ export default {
107 116
         })
108 117
         return false
109 118
       }
119
+      let tagFlag=false
110 120
       this.moreLable.forEach(m=>{
111 121
         if(m.tag_name==''){
112 122
           this.$message({
113 123
             message: '标签名称不能为空',
114 124
             type: "warning"
115 125
           })
126
+          tagFlag = true
116 127
           return false
117 128
         }
118 129
       })
130
+      if(tagFlag){
131
+        return false
132
+      }
133
+      this.loading = true
119 134
       this.$axios.post(this.URL.BASEURL + this.URL.edit_tag_group, {
120 135
         group_name: this.groupName,
136
+        // group_id: this.groupId,
121 137
         tag_list:this.moreLable
122 138
       }).then((res) => {
123 139
         var res = res.data
@@ -129,9 +145,16 @@ export default {
129 145
           message: res.err,
130 146
           type: "warning"
131 147
         })
148
+        this.loading = false
149
+      }).catch(err=>{
150
+        this.$message({
151
+          message: '服务故障,请稍候再试',
152
+          type: "warning"
153
+        })
154
+        this.loading = false
132 155
       })
133 156
     },
134
-    addTagGroup(){
157
+    addTagGroup(){ //
135 158
       if(this.groupName==''){
136 159
         this.$message({
137 160
           message: '标签组名称不能为空',
@@ -139,15 +162,21 @@ export default {
139 162
         })
140 163
         return false
141 164
       }
165
+      let tagFlag=false
142 166
       this.moreLable.forEach(m=>{
143 167
         if(m.tag_name==''){
144 168
           this.$message({
145 169
             message: '标签名称不能为空',
146 170
             type: "warning"
147 171
           })
172
+          tagFlag = true
148 173
           return false
149 174
         }
150 175
       })
176
+      if(tagFlag){
177
+        return false
178
+      }
179
+      this.loading = true
151 180
       this.$axios.post(this.URL.BASEURL + this.URL.add_tag_group, {
152 181
         group_name: this.groupName,
153 182
         tag_list:this.moreLable
@@ -161,6 +190,13 @@ export default {
161 190
           message: res.err,
162 191
           type: "warning"
163 192
         })
193
+        this.loading = false
194
+      }).catch(err=>{
195
+        this.$message({
196
+          message: '服务故障,请稍候再试',
197
+          type: "warning"
198
+        })
199
+        this.loading = false
164 200
       })
165 201
     },
166 202
     // 上移

+ 12 - 14
project/src/components/detials/index.vue

@@ -72,13 +72,12 @@
72 72
     </div>
73 73
 
74 74
     <el-dialog
75
-      v-loading="dialogLoading"
76 75
       title="选择企业标签"
77 76
       :visible.sync="comLableShow"
78 77
       :append-to-body="true"
79 78
       class="addLable_dialog"
80 79
       width="30%">
81
-      <div class="addLableBox">
80
+      <div class="addLableBox" v-loading="dialogLoading">
82 81
         <!--后台说先不做-->
83 82
         <template v-if="false">
84 83
           <div class="add" @click="iptshow = true,addLableVal = ''">+ 添加</div>
@@ -102,8 +101,8 @@
102 101
           +新建标签组
103 102
         </div>
104 103
         <div>
105
-          <el-button size="mini" @click="comLableShow = false">取 消</el-button>
106
-          <el-button size="mini" type="primary" @click="edit_tag">确 定</el-button>
104
+          <el-button :disabled="dialogLoading" size="mini" @click="comLableShow = false">取 消</el-button>
105
+          <el-button :disabled="dialogLoading" size="mini" type="primary" @click="edit_tag">确 定</el-button>
107 106
         </div>
108 107
       </div>
109 108
     </el-dialog>
@@ -218,12 +217,6 @@ export default {
218 217
     order,
219 218
   },
220 219
   methods:{
221
-    onPerson(){
222
-
223
-    },
224
-    nextPerson(){
225
-
226
-    },
227 220
     edit_tag(){//选择企业标签框的确定
228 221
       // this.comLableShow = true
229 222
       this.dialogLoading = true
@@ -245,8 +238,9 @@ export default {
245 238
         this.dialogLoading = false
246 239
       })
247 240
     },
248
-    init_tag(){
241
+    init_tag(){//点击企业标签编辑,初始化标签列表
249 242
       this.comLableShow = true
243
+      this.dialogLoading = true
250 244
       this.$axios.get(this.URL.BASEURL + this.URL.tag_detial_list,{
251 245
         params:{
252 246
           customer_id:this.rowProp.customer_id,
@@ -255,7 +249,6 @@ export default {
255 249
       }).then((res)=>{
256 250
         res=res.data
257 251
         this.lableArr = res.rst
258
-
259 252
         this.lableArr_checked=[]
260 253
         res.rst.forEach(l=>{
261 254
           l.tag_list.forEach(t=>{
@@ -264,8 +257,13 @@ export default {
264 257
             }
265 258
           })
266 259
         })
267
-        console.log(this.lableArr_checked,' this.lableArr_checked');
268
-
260
+        this.dialogLoading = false
261
+      }).catch(err=>{
262
+        this.$message({
263
+          message: '服务故障,请稍候再试',
264
+          type: "warning"
265
+        })
266
+        this.dialogLoading = false
269 267
       })
270 268
     },
271 269
     init(){

+ 3 - 3
project/src/components/manage/memberManage.vue

@@ -17,9 +17,9 @@
17 17
           部门信息
18 18
         </div>
19 19
         <div>
20
-          <div v-for="c in depart_List" :key="c.department_id" class="tMar20 flex-align-center">
21
-            <i class="el-icon-success c-00B38A f16 rMar7 pointer" v-if="checkVals.indexOf(c.department_id)>-1" @click="checkDepartId(c.department_id)"></i>
22
-            <i class="el-icon-circle rMar7 pointer" @click="checkDepartId(c.department_id)" v-else></i>
20
+          <div v-for="c in depart_List" :key="c.department_id" class="tMar20 flex-align-center pointer" @click="checkDepartId(c.department_id)">
21
+            <i class="el-icon-success c-00B38A f16 rMar7" v-if="checkVals.indexOf(c.department_id)>-1" ></i>
22
+            <i class="el-icon-circle rMar7" v-else></i>
23 23
             {{c.department_id}}
24 24
           </div>
25 25
         </div>