|
|
@@ -4,7 +4,7 @@
|
|
4
|
4
|
<el-card shadow="never" class="search-card">
|
|
5
|
5
|
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="80px">
|
|
6
|
6
|
<el-form-item label="关键词" prop="keyword">
|
|
7
|
|
- <el-input v-model="queryParams.keyword" placeholder="店铺/商户/经营账号" clearable style="width: 220px" @keyup.enter.native="handleQuery" />
|
|
|
7
|
+ <el-input v-model="queryParams.keyword" placeholder="店铺/商户/主账号" clearable style="width: 220px" @keyup.enter.native="handleQuery" />
|
|
8
|
8
|
</el-form-item>
|
|
9
|
9
|
<el-form-item label="店铺状态" prop="shopStatus">
|
|
10
|
10
|
<el-select v-model="queryParams.shopStatus" placeholder="全部" clearable style="width: 120px">
|
|
|
@@ -47,15 +47,20 @@
|
|
47
|
47
|
<el-tag v-else type="info" size="small">停业</el-tag>
|
|
48
|
48
|
</template>
|
|
49
|
49
|
</el-table-column>
|
|
50
|
|
- <el-table-column label="经营账号" align="center" min-width="160">
|
|
|
50
|
+ <el-table-column label="评分" align="center" prop="rating" width="80">
|
|
|
51
|
+ <template slot-scope="scope">
|
|
|
52
|
+ <span>{{ formatRating(scope.row.rating) }}</span>
|
|
|
53
|
+ </template>
|
|
|
54
|
+ </el-table-column>
|
|
|
55
|
+ <el-table-column label="主账号" align="center" min-width="160">
|
|
51
|
56
|
<template slot-scope="scope">
|
|
52
|
57
|
<span>{{ scope.row.accountAdminName || '—' }} / {{ scope.row.accountLoginName || '—' }}</span>
|
|
53
|
58
|
</template>
|
|
54
|
59
|
</el-table-column>
|
|
55
|
|
- <el-table-column label="操作" align="center" width="220" fixed="right">
|
|
|
60
|
+ <el-table-column label="操作" align="center" width="240" fixed="right">
|
|
56
|
61
|
<template slot-scope="scope">
|
|
57
|
62
|
<el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)" v-hasPermi="['agri:shop:edit']">编辑</el-button>
|
|
58
|
|
- <el-button size="mini" type="text" icon="el-icon-user" @click="handleAccount(scope.row)" v-hasPermi="['agri:shop:account']">账号管理</el-button>
|
|
|
63
|
+ <el-button size="mini" type="text" icon="el-icon-user" @click="handleAccount(scope.row)" v-hasPermi="['agri:shop:account']">更换主账号</el-button>
|
|
59
|
64
|
<el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)" v-hasPermi="['agri:shop:remove']">删除</el-button>
|
|
60
|
65
|
</template>
|
|
61
|
66
|
</el-table-column>
|
|
|
@@ -84,16 +89,16 @@
|
|
84
|
89
|
<el-option v-for="item in merchantOptions" :key="item.merchantId" :label="item.merchantName || item.unitName" :value="item.merchantId" />
|
|
85
|
90
|
</el-select>
|
|
86
|
91
|
</el-form-item>
|
|
87
|
|
- <el-form-item v-if="!form.shopId && merchantAccountHint" label="经营账号">
|
|
|
92
|
+ <el-form-item v-if="!form.shopId && merchantAccountHint" label="主账号">
|
|
88
|
93
|
<span class="readonly-text">{{ merchantAccountHint }}</span>
|
|
89
|
|
- <div class="form-tip">经营账号由商户入驻时绑定,开店沿用该账号</div>
|
|
|
94
|
+ <div class="form-tip">主账号由商户入驻时绑定,开店沿用该账号</div>
|
|
90
|
95
|
</el-form-item>
|
|
91
|
96
|
<el-form-item v-else-if="form.shopId" label="所属商户">
|
|
92
|
97
|
<span class="readonly-text">{{ form.merchantName || '—' }}</span>
|
|
93
|
98
|
</el-form-item>
|
|
94
|
|
- <el-form-item v-if="form.shopId" label="经营账号">
|
|
|
99
|
+ <el-form-item v-if="form.shopId" label="主账号">
|
|
95
|
100
|
<span class="readonly-text">{{ form.accountAdminName || '—' }} / {{ form.accountLoginName || '—' }}</span>
|
|
96
|
|
- <div class="form-tip">如需修改请使用「账号管理」</div>
|
|
|
101
|
+ <div class="form-tip">如需修改请使用「更换主账号」</div>
|
|
97
|
102
|
</el-form-item>
|
|
98
|
103
|
<el-form-item v-if="!form.shopId" label="店铺状态" prop="shopStatus">
|
|
99
|
104
|
<el-radio-group v-model="form.shopStatus">
|
|
|
@@ -116,34 +121,63 @@
|
|
116
|
121
|
</div>
|
|
117
|
122
|
</el-dialog>
|
|
118
|
123
|
|
|
119
|
|
- <!-- 店铺账号管理弹窗 -->
|
|
120
|
|
- <el-dialog title="店铺账号管理" :visible.sync="accountOpen" width="560px" append-to-body>
|
|
121
|
|
- <el-form ref="accountForm" :model="accountForm" :rules="accountRules" label-width="100px">
|
|
122
|
|
- <el-alert v-if="accountForm.shops && accountForm.shops.length" type="info" :closable="false" class="mb12">
|
|
123
|
|
- 修改后将同步至该商户下全部店铺(共 {{ accountForm.shops.length }} 家)
|
|
124
|
|
- </el-alert>
|
|
125
|
|
- <div v-if="accountForm.shops && accountForm.shops.length" class="shop-tags mb12">
|
|
126
|
|
- <el-tag v-for="item in accountForm.shops" :key="item.shopId" size="small" class="shop-tag" :type="item.shopStatus === '0' ? 'success' : 'info'">
|
|
127
|
|
- {{ item.shopName }}
|
|
128
|
|
- </el-tag>
|
|
129
|
|
- </div>
|
|
130
|
|
- <el-form-item label="登录名" prop="loginNameRaw">
|
|
131
|
|
- <el-input
|
|
132
|
|
- v-model="accountForm.loginNameRaw"
|
|
133
|
|
- :placeholder="accountForm.loginNameMasked ? ('当前 ' + accountForm.loginNameMasked + ',修改请填完整手机号') : '11位手机号'"
|
|
134
|
|
- maxlength="11"
|
|
135
|
|
- />
|
|
136
|
|
- <div class="form-tip">登录名须为 11 位手机号,修改后将同步至该商户下全部店铺</div>
|
|
|
124
|
+ <!-- 更换主账号弹窗(v1.4:换绑管理员/会员,不改登录名密码) -->
|
|
|
125
|
+ <el-dialog title="更换主账号" :visible.sync="accountOpen" width="600px" append-to-body @close="resetAccountForm">
|
|
|
126
|
+ <el-form ref="accountForm" :model="accountForm" :rules="accountRules" label-width="110px">
|
|
|
127
|
+ <el-alert type="warning" :closable="false" class="mb12" title="更换后将同步至该商户下全部店铺" />
|
|
|
128
|
+ <el-form-item label="当前主账号">
|
|
|
129
|
+ <span class="readonly-text">{{ accountForm.adminName || '—' }} / {{ accountForm.loginName || '—' }}</span>
|
|
|
130
|
+ </el-form-item>
|
|
|
131
|
+ <el-form-item v-if="accountForm.shops && accountForm.shops.length" label="下属店铺">
|
|
|
132
|
+ <div class="shop-tags">
|
|
|
133
|
+ <el-tag
|
|
|
134
|
+ v-for="item in accountForm.shops"
|
|
|
135
|
+ :key="item.shopId"
|
|
|
136
|
+ size="small"
|
|
|
137
|
+ class="shop-tag"
|
|
|
138
|
+ :type="item.shopStatus === '0' ? 'success' : 'info'"
|
|
|
139
|
+ >
|
|
|
140
|
+ {{ item.shopName }}({{ item.shopStatus === '0' ? '开业' : '停业' }})
|
|
|
141
|
+ </el-tag>
|
|
|
142
|
+ </div>
|
|
|
143
|
+ </el-form-item>
|
|
|
144
|
+ <el-form-item label="绑定方式" prop="bindType">
|
|
|
145
|
+ <el-radio-group v-model="accountForm.bindType" @change="handleAccountBindTypeChange">
|
|
|
146
|
+ <el-radio label="SYS_USER">平台管理员</el-radio>
|
|
|
147
|
+ <el-radio label="MEMBER">会员</el-radio>
|
|
|
148
|
+ </el-radio-group>
|
|
137
|
149
|
</el-form-item>
|
|
138
|
|
- <el-form-item label="管理员姓名" prop="adminName">
|
|
139
|
|
- <el-input v-model="accountForm.adminName" placeholder="管理员姓名" maxlength="64" />
|
|
|
150
|
+ <el-form-item v-if="accountForm.bindType === 'SYS_USER'" label="选择管理员" prop="bindUserId">
|
|
|
151
|
+ <el-select
|
|
|
152
|
+ v-model="accountForm.bindUserId"
|
|
|
153
|
+ filterable
|
|
|
154
|
+ remote
|
|
|
155
|
+ reserve-keyword
|
|
|
156
|
+ placeholder="输入用户名/手机号搜索"
|
|
|
157
|
+ :remote-method="searchAdminUser"
|
|
|
158
|
+ :loading="bindSearchLoading"
|
|
|
159
|
+ style="width: 100%"
|
|
|
160
|
+ >
|
|
|
161
|
+ <el-option v-for="item in adminUserList" :key="item.userId" :label="formatAdminOption(item)" :value="item.userId" />
|
|
|
162
|
+ </el-select>
|
|
140
|
163
|
</el-form-item>
|
|
141
|
|
- <el-form-item label="重置密码" prop="password">
|
|
142
|
|
- <el-input v-model="accountForm.password" type="password" placeholder="留空则不修改" maxlength="20" show-password />
|
|
|
164
|
+ <el-form-item v-if="accountForm.bindType === 'MEMBER'" label="选择会员" prop="bindMemberId">
|
|
|
165
|
+ <el-select
|
|
|
166
|
+ v-model="accountForm.bindMemberId"
|
|
|
167
|
+ filterable
|
|
|
168
|
+ remote
|
|
|
169
|
+ reserve-keyword
|
|
|
170
|
+ placeholder="输入会员名称/手机号搜索"
|
|
|
171
|
+ :remote-method="searchMember"
|
|
|
172
|
+ :loading="bindSearchLoading"
|
|
|
173
|
+ style="width: 100%"
|
|
|
174
|
+ >
|
|
|
175
|
+ <el-option v-for="item in memberList" :key="item.memberId" :label="formatMemberOption(item)" :value="item.memberId" />
|
|
|
176
|
+ </el-select>
|
|
143
|
177
|
</el-form-item>
|
|
144
|
178
|
</el-form>
|
|
145
|
179
|
<div slot="footer">
|
|
146
|
|
- <el-button type="primary" @click="submitAccount">保 存</el-button>
|
|
|
180
|
+ <el-button type="primary" @click="submitAccount">确 定</el-button>
|
|
147
|
181
|
<el-button @click="accountOpen = false">取 消</el-button>
|
|
148
|
182
|
</div>
|
|
149
|
183
|
</el-dialog>
|
|
|
@@ -152,7 +186,7 @@
|
|
152
|
186
|
|
|
153
|
187
|
<script>
|
|
154
|
188
|
import { listShop, getShop, addShop, updateShop, delShop, deleteShopCheck, getShopAccount, updateShopAccount } from "@/api/agri/shop"
|
|
155
|
|
-import { selectMerchantList, openShopCheck } from "@/api/agri/merchant"
|
|
|
189
|
+import { selectMerchantList, openShopCheck, adminUserOptions, memberOptions } from "@/api/agri/merchant"
|
|
156
|
190
|
|
|
157
|
191
|
export default {
|
|
158
|
192
|
name: "AgriShop",
|
|
|
@@ -169,18 +203,6 @@ export default {
|
|
169
|
203
|
}
|
|
170
|
204
|
callback()
|
|
171
|
205
|
}
|
|
172
|
|
- /** 经营账号登录名:11 位手机号(v1.3) */
|
|
173
|
|
- const validateLoginName = (rule, value, callback) => {
|
|
174
|
|
- if (!value) {
|
|
175
|
|
- callback(new Error("请输入登录名"))
|
|
176
|
|
- return
|
|
177
|
|
- }
|
|
178
|
|
- if (!/^1[3-9]\d{9}$/.test(value)) {
|
|
179
|
|
- callback(new Error("登录名须为11位手机号"))
|
|
180
|
|
- return
|
|
181
|
|
- }
|
|
182
|
|
- callback()
|
|
183
|
|
- }
|
|
184
|
206
|
return {
|
|
185
|
207
|
loading: true,
|
|
186
|
208
|
showSearch: true,
|
|
|
@@ -194,7 +216,9 @@ export default {
|
|
194
|
216
|
merchantAccountOk: false,
|
|
195
|
217
|
currentMerchantId: null,
|
|
196
|
218
|
originalShopStatus: "0",
|
|
197
|
|
- originalLoginName: "",
|
|
|
219
|
+ bindSearchLoading: false,
|
|
|
220
|
+ adminUserList: [],
|
|
|
221
|
+ memberList: [],
|
|
198
|
222
|
queryParams: {
|
|
199
|
223
|
pageNum: 1,
|
|
200
|
224
|
pageSize: 10,
|
|
|
@@ -204,18 +228,34 @@ export default {
|
|
204
|
228
|
},
|
|
205
|
229
|
form: {},
|
|
206
|
230
|
accountForm: {},
|
|
|
231
|
+ accountRules: {
|
|
|
232
|
+ bindType: [{ required: true, message: "请选择绑定方式", trigger: "change" }],
|
|
|
233
|
+ bindUserId: [{
|
|
|
234
|
+ validator: (rule, value, callback) => {
|
|
|
235
|
+ if (this.accountForm.bindType === "SYS_USER" && !value) {
|
|
|
236
|
+ callback(new Error("请选择平台管理员"))
|
|
|
237
|
+ return
|
|
|
238
|
+ }
|
|
|
239
|
+ callback()
|
|
|
240
|
+ },
|
|
|
241
|
+ trigger: "change"
|
|
|
242
|
+ }],
|
|
|
243
|
+ bindMemberId: [{
|
|
|
244
|
+ validator: (rule, value, callback) => {
|
|
|
245
|
+ if (this.accountForm.bindType === "MEMBER" && !value) {
|
|
|
246
|
+ callback(new Error("请选择会员"))
|
|
|
247
|
+ return
|
|
|
248
|
+ }
|
|
|
249
|
+ callback()
|
|
|
250
|
+ },
|
|
|
251
|
+ trigger: "change"
|
|
|
252
|
+ }]
|
|
|
253
|
+ },
|
|
207
|
254
|
rules: {
|
|
208
|
255
|
shopName: [{ required: true, message: "请输入店铺名称", trigger: "blur" }],
|
|
209
|
256
|
shopAvatar: [{ required: true, message: "请上传店铺头像", trigger: "change" }],
|
|
210
|
257
|
shopPhone: [{ validator: validateShopPhone, trigger: "blur" }],
|
|
211
|
258
|
merchantId: [{ required: true, message: "请选择商户", trigger: "change" }]
|
|
212
|
|
- },
|
|
213
|
|
- accountRules: {
|
|
214
|
|
- loginNameRaw: [
|
|
215
|
|
- { required: true, message: "请输入登录名", trigger: "blur" },
|
|
216
|
|
- { validator: validateLoginName, trigger: "blur" }
|
|
217
|
|
- ],
|
|
218
|
|
- adminName: [{ required: true, message: "请输入管理员姓名", trigger: "blur" }]
|
|
219
|
259
|
}
|
|
220
|
260
|
}
|
|
221
|
261
|
},
|
|
|
@@ -228,6 +268,17 @@ export default {
|
|
228
|
268
|
this.loadMerchantOptions()
|
|
229
|
269
|
},
|
|
230
|
270
|
methods: {
|
|
|
271
|
+ /** 评分展示:无评价 —,有评价保留两位小数 */
|
|
|
272
|
+ formatRating(rating) {
|
|
|
273
|
+ if (rating == null || rating === "") {
|
|
|
274
|
+ return "—"
|
|
|
275
|
+ }
|
|
|
276
|
+ const num = Number(rating)
|
|
|
277
|
+ if (Number.isNaN(num)) {
|
|
|
278
|
+ return "—"
|
|
|
279
|
+ }
|
|
|
280
|
+ return num.toFixed(2)
|
|
|
281
|
+ },
|
|
231
|
282
|
/** 查询店铺列表 */
|
|
232
|
283
|
getList() {
|
|
233
|
284
|
this.loading = true
|
|
|
@@ -311,7 +362,7 @@ export default {
|
|
311
|
362
|
getShopAccount(merchantId).then(res => {
|
|
312
|
363
|
const data = res.data || {}
|
|
313
|
364
|
if (!data.loginName && !data.adminName) {
|
|
314
|
|
- this.$modal.msgWarning("该商户尚未配置经营账号,请先在商户管理中完成入驻绑定")
|
|
|
365
|
+ this.$modal.msgWarning("该商户尚未配置主账号,请先在商户管理中完成入驻绑定")
|
|
315
|
366
|
this.form.merchantId = undefined
|
|
316
|
367
|
return
|
|
317
|
368
|
}
|
|
|
@@ -370,7 +421,7 @@ export default {
|
|
370
|
421
|
this.doUpdateShop()
|
|
371
|
422
|
} else {
|
|
372
|
423
|
if (!this.merchantAccountOk) {
|
|
373
|
|
- this.$modal.msgWarning("请先选择已绑定经营账号的商户")
|
|
|
424
|
+ this.$modal.msgWarning("请先选择已绑定主账号的商户")
|
|
374
|
425
|
return
|
|
375
|
426
|
}
|
|
376
|
427
|
addShop(this.buildAddPayload()).then(() => {
|
|
|
@@ -395,49 +446,113 @@ export default {
|
|
395
|
446
|
this.getList()
|
|
396
|
447
|
})
|
|
397
|
448
|
},
|
|
398
|
|
- /** 打开账号管理 */
|
|
|
449
|
+ /** 重置更换主账号表单 */
|
|
|
450
|
+ resetAccountForm() {
|
|
|
451
|
+ this.accountForm = {}
|
|
|
452
|
+ this.adminUserList = []
|
|
|
453
|
+ this.memberList = []
|
|
|
454
|
+ if (this.$refs.accountForm) {
|
|
|
455
|
+ this.$refs.accountForm.clearValidate()
|
|
|
456
|
+ }
|
|
|
457
|
+ },
|
|
|
458
|
+ /** 打开更换主账号 */
|
|
399
|
459
|
handleAccount(row) {
|
|
400
|
460
|
this.currentMerchantId = row.merchantId
|
|
401
|
461
|
getShopAccount(row.merchantId).then(response => {
|
|
402
|
462
|
const data = response.data || {}
|
|
403
|
|
- const loginRaw = data.loginNameRaw || ""
|
|
404
|
|
- this.originalLoginName = loginRaw
|
|
405
|
463
|
this.accountForm = {
|
|
406
|
|
- loginNameRaw: loginRaw,
|
|
407
|
|
- loginNameMasked: data.loginName || "",
|
|
|
464
|
+ accountId: data.accountId,
|
|
408
|
465
|
adminName: data.adminName,
|
|
409
|
|
- password: undefined,
|
|
410
|
|
- shops: data.shops || []
|
|
|
466
|
+ loginName: data.loginName,
|
|
|
467
|
+ shops: data.shops || [],
|
|
|
468
|
+ bindType: "SYS_USER",
|
|
|
469
|
+ bindUserId: undefined,
|
|
|
470
|
+ bindMemberId: undefined
|
|
411
|
471
|
}
|
|
|
472
|
+ this.adminUserList = []
|
|
|
473
|
+ this.memberList = []
|
|
412
|
474
|
this.accountOpen = true
|
|
413
|
475
|
})
|
|
414
|
476
|
},
|
|
415
|
|
- /** 保存账号(改登录名需 confirm) */
|
|
416
|
|
- submitAccount(confirm) {
|
|
|
477
|
+ /** 切换绑定方式时清空已选账号 */
|
|
|
478
|
+ handleAccountBindTypeChange() {
|
|
|
479
|
+ this.accountForm.bindUserId = undefined
|
|
|
480
|
+ this.accountForm.bindMemberId = undefined
|
|
|
481
|
+ this.adminUserList = []
|
|
|
482
|
+ this.memberList = []
|
|
|
483
|
+ this.$nextTick(() => {
|
|
|
484
|
+ if (this.$refs.accountForm) {
|
|
|
485
|
+ this.$refs.accountForm.clearValidate(["bindUserId", "bindMemberId"])
|
|
|
486
|
+ }
|
|
|
487
|
+ })
|
|
|
488
|
+ },
|
|
|
489
|
+ /** 管理员下拉展示 */
|
|
|
490
|
+ formatAdminOption(item) {
|
|
|
491
|
+ const parts = [item.userName, item.nickName].filter(Boolean)
|
|
|
492
|
+ if (item.phonenumber) {
|
|
|
493
|
+ parts.push(item.phonenumber)
|
|
|
494
|
+ }
|
|
|
495
|
+ return parts.join(" / ")
|
|
|
496
|
+ },
|
|
|
497
|
+ /** 会员下拉展示 */
|
|
|
498
|
+ formatMemberOption(item) {
|
|
|
499
|
+ const parts = [item.memberCode, item.nickName].filter(Boolean)
|
|
|
500
|
+ if (item.mobile) {
|
|
|
501
|
+ parts.push(item.mobile)
|
|
|
502
|
+ }
|
|
|
503
|
+ return parts.join(" / ")
|
|
|
504
|
+ },
|
|
|
505
|
+ /** 远程搜索平台管理员 */
|
|
|
506
|
+ searchAdminUser(keyword) {
|
|
|
507
|
+ if (!keyword || String(keyword).trim().length < 1) {
|
|
|
508
|
+ this.adminUserList = []
|
|
|
509
|
+ return
|
|
|
510
|
+ }
|
|
|
511
|
+ this.bindSearchLoading = true
|
|
|
512
|
+ adminUserOptions(keyword).then(response => {
|
|
|
513
|
+ this.adminUserList = response.data || []
|
|
|
514
|
+ this.bindSearchLoading = false
|
|
|
515
|
+ }).catch(() => {
|
|
|
516
|
+ this.bindSearchLoading = false
|
|
|
517
|
+ })
|
|
|
518
|
+ },
|
|
|
519
|
+ /** 远程搜索会员 */
|
|
|
520
|
+ searchMember(keyword) {
|
|
|
521
|
+ if (!keyword || String(keyword).trim().length < 1) {
|
|
|
522
|
+ this.memberList = []
|
|
|
523
|
+ return
|
|
|
524
|
+ }
|
|
|
525
|
+ this.bindSearchLoading = true
|
|
|
526
|
+ memberOptions(keyword).then(response => {
|
|
|
527
|
+ this.memberList = response.data || []
|
|
|
528
|
+ this.bindSearchLoading = false
|
|
|
529
|
+ }).catch(() => {
|
|
|
530
|
+ this.bindSearchLoading = false
|
|
|
531
|
+ })
|
|
|
532
|
+ },
|
|
|
533
|
+ /** 提交更换主账号(换绑 account_id,不改 sys_user 资料) */
|
|
|
534
|
+ submitAccount() {
|
|
417
|
535
|
this.$refs["accountForm"].validate(valid => {
|
|
418
|
536
|
if (!valid) {
|
|
419
|
537
|
return
|
|
420
|
538
|
}
|
|
421
|
|
- const payload = {
|
|
422
|
|
- loginName: this.accountForm.loginNameRaw,
|
|
423
|
|
- adminName: this.accountForm.adminName,
|
|
424
|
|
- password: this.accountForm.password || null
|
|
425
|
|
- }
|
|
426
|
|
- // 改登录名时走两步 confirm(v1.3);未改登录名则不传 confirm
|
|
427
|
|
- if (this.accountForm.loginNameRaw !== this.originalLoginName) {
|
|
428
|
|
- payload.confirm = confirm === true
|
|
429
|
|
- }
|
|
430
|
|
- updateShopAccount(this.currentMerchantId, payload).then(response => {
|
|
431
|
|
- if (response.data && response.data.needConfirm) {
|
|
432
|
|
- this.$modal.confirm(response.data.confirmMessage || "将同步至该商户下全部店铺,是否继续?").then(() => {
|
|
433
|
|
- this.submitAccount(true)
|
|
434
|
|
- }).catch(() => {})
|
|
|
539
|
+ const payload = { bindType: this.accountForm.bindType }
|
|
|
540
|
+ if (payload.bindType === "SYS_USER") {
|
|
|
541
|
+ if (this.accountForm.bindUserId === this.accountForm.accountId) {
|
|
|
542
|
+ this.$modal.msgWarning("所选账号与当前主账号相同")
|
|
435
|
543
|
return
|
|
436
|
544
|
}
|
|
437
|
|
- this.$modal.msgSuccess("保存成功")
|
|
|
545
|
+ payload.bindUserId = this.accountForm.bindUserId
|
|
|
546
|
+ } else {
|
|
|
547
|
+ payload.bindMemberId = this.accountForm.bindMemberId
|
|
|
548
|
+ }
|
|
|
549
|
+ this.$modal.confirm("更换后将同步至该商户下全部店铺,是否继续?").then(() => {
|
|
|
550
|
+ return updateShopAccount(this.currentMerchantId, payload)
|
|
|
551
|
+ }).then(() => {
|
|
|
552
|
+ this.$modal.msgSuccess("更换成功")
|
|
438
|
553
|
this.accountOpen = false
|
|
439
|
554
|
this.getList()
|
|
440
|
|
- })
|
|
|
555
|
+ }).catch(() => {})
|
|
441
|
556
|
})
|
|
442
|
557
|
},
|
|
443
|
558
|
/** 删除店铺(先预检再确认) */
|
|
|
@@ -449,7 +564,7 @@ export default {
|
|
449
|
564
|
this.$modal.msgWarning(reasons || "当前店铺不满足删除条件")
|
|
450
|
565
|
return
|
|
451
|
566
|
}
|
|
452
|
|
- this.$modal.confirm("删除后不可恢复,是否继续?").then(() => {
|
|
|
567
|
+ this.$modal.confirm("删除后店铺不可恢复经营,是否继续?").then(() => {
|
|
453
|
568
|
return delShop(row.shopId)
|
|
454
|
569
|
}).then(() => {
|
|
455
|
570
|
this.$modal.msgSuccess("删除成功")
|
|
|
@@ -477,7 +592,7 @@ export default {
|
|
477
|
592
|
margin-bottom: 12px;
|
|
478
|
593
|
}
|
|
479
|
594
|
.shop-tags {
|
|
480
|
|
- padding-left: 100px;
|
|
|
595
|
+ line-height: 1.8;
|
|
481
|
596
|
}
|
|
482
|
597
|
.shop-tag {
|
|
483
|
598
|
margin-right: 8px;
|