|
@@ -62,14 +62,16 @@
|
62
|
62
|
</div>
|
63
|
63
|
</div>
|
64
|
64
|
<div class="user-wrap" v-if="account.user_list && account.user_list.length">
|
65
|
|
- <el-tag
|
66
|
|
- v-for="(user, userIdx) in account.user_list"
|
67
|
|
- class="user-item-wrap"
|
68
|
|
- :key="user.user_id"
|
69
|
|
- :closable="!isDetail"
|
70
|
|
- @close="onCloseUserTag(userIdx, accountIdx)">
|
71
|
|
- {{ user.name }}
|
72
|
|
- </el-tag>
|
|
65
|
+ <span v-for="(user, userIdx) in account.user_list" class="user-item-wrap">
|
|
66
|
+ <el-tag
|
|
67
|
+ :key="user.user_id"
|
|
68
|
+ :type="(isDetail && handleGetUserTagType(user.status).type) || ''"
|
|
69
|
+ :closable="!isDetail"
|
|
70
|
+ @close="onCloseUserTag(userIdx, accountIdx)">
|
|
71
|
+ {{ user.name }}
|
|
72
|
+ <span v-if="isDetail">({{ handleGetUserTagType(user.status).desc }})</span>
|
|
73
|
+ </el-tag>
|
|
74
|
+ </span>
|
73
|
75
|
</div>
|
74
|
76
|
</div>
|
75
|
77
|
</div>
|
|
@@ -179,12 +181,22 @@ export default {
|
179
|
181
|
await this.$nextTick()
|
180
|
182
|
this.onChangeUserIdRes(account_list[aIdx].user_id_res, a.corpid, aIdx)
|
181
|
183
|
})
|
|
184
|
+ this.handleGetUserDetailByReslist(list)
|
182
|
185
|
}
|
183
|
186
|
},
|
|
187
|
+ async handleGetUserDetailByReslist(list) {
|
|
188
|
+ await this.$nextTick()
|
|
189
|
+ this.form.account_list.forEach(corp => {
|
|
190
|
+ corp.user_list.forEach(user => {
|
|
191
|
+ const crtUser = list.find(l => l.user_id === user.user_id)
|
|
192
|
+ this.$set(user, 'status', crtUser.status)
|
|
193
|
+ })
|
|
194
|
+ });
|
|
195
|
+ },
|
184
|
196
|
async handleGetAllList () {
|
185
|
197
|
const url = `${this.URL.BASEURL}${this.URL.warn_djuserList}`
|
186
|
198
|
const params = {
|
187
|
|
- is_active: 1,
|
|
199
|
+ is_active: this.isDetail ? '' : 1,
|
188
|
200
|
sys_group_id: this.$cookie.getCookie('isSuperManage') == 1 ? sessionStorage.getItem('company_session_defaultCorp_level_1').toString() : '',
|
189
|
201
|
}
|
190
|
202
|
const { data: res = {} } = await this.$axios.get(url, { params })
|
|
@@ -220,17 +232,29 @@ export default {
|
220
|
232
|
this.form.account_list[accountIdx].user_id_res = user_id_res
|
221
|
233
|
this.form.account_list[accountIdx].user_list = this.handleGetUserListByUseridres(user_id_res, corpid)
|
222
|
234
|
},
|
|
235
|
+ handleGetUserTagType(status) {
|
|
236
|
+ const statusTypeMap = new Map([
|
|
237
|
+ [-1, {type: 'danger', desc: '续期失败'}],
|
|
238
|
+ [0, {type: 'warning', desc: '待支付'}],
|
|
239
|
+ [1, {type: '', desc: '已支付'}],
|
|
240
|
+ [2, {type: 'info', desc: '已取消'}],
|
|
241
|
+ ])
|
|
242
|
+ return statusTypeMap.get(status) || { type: '', desc: '' }
|
|
243
|
+ },
|
223
|
244
|
onCloseUserTag(userIdx, accountIdx) {
|
224
|
245
|
this.form.account_list[accountIdx].user_list.splice(userIdx, 1)
|
225
|
246
|
this.form.account_list[accountIdx].user_id_res = this.form.account_list[accountIdx].user_list.map(user => user.user_id)
|
226
|
247
|
},
|
227
|
248
|
async onClickDeleteCorp(idx) {
|
228
|
249
|
try {
|
229
|
|
- await this.$confirm('确定清空当前已选的客服账号吗?', '提示', {
|
230
|
|
- confirmButtonText: '确定',
|
231
|
|
- cancelButtonText: '取消',
|
232
|
|
- type: 'warning'
|
233
|
|
- })
|
|
250
|
+ const isSelected = this.form.account_list[idx].user_id_res.length
|
|
251
|
+ if (isSelected) {
|
|
252
|
+ await this.$confirm('确定清空当前已选的客服账号吗?', '提示', {
|
|
253
|
+ confirmButtonText: '确定',
|
|
254
|
+ cancelButtonText: '取消',
|
|
255
|
+ type: 'warning'
|
|
256
|
+ })
|
|
257
|
+ }
|
234
|
258
|
this.form.account_list.splice(idx, 1)
|
235
|
259
|
this.handleInitCorpOptionsStatus()
|
236
|
260
|
} catch (error) {
|
|
@@ -404,8 +428,20 @@ export default {
|
404
|
428
|
background-color: rgb(247, 247, 247);
|
405
|
429
|
margin-top: 10px;
|
406
|
430
|
padding: 10px 10px 0 10px;
|
|
431
|
+ display: flex;
|
|
432
|
+ align-items: center;
|
|
433
|
+ flex-wrap: wrap;
|
407
|
434
|
.user-item-wrap {
|
408
|
|
- margin: 0 10px 10px 0;
|
|
435
|
+ position: relative;
|
|
436
|
+ margin: 0 14px 10px 0;
|
|
437
|
+ .err-icon {
|
|
438
|
+ position: absolute;
|
|
439
|
+ top: -5px;
|
|
440
|
+ right: -5px;
|
|
441
|
+ color: #c1c1c1;
|
|
442
|
+ font-size: 15px;
|
|
443
|
+ font-weight: 500;
|
|
444
|
+ }
|
409
|
445
|
}
|
410
|
446
|
}
|
411
|
447
|
}
|