|
|
@@ -113,8 +113,8 @@
|
|
|
<el-form-item label="善行少年编号" prop="uniqueNo">
|
|
|
<el-input v-model="form.uniqueNo" placeholder="请输入"></el-input>
|
|
|
</el-form-item>
|
|
|
- <el-form-item label="渠道方" prop="channelId">
|
|
|
- <el-select v-model="form.channelId" placeholder="请选择" style="width: 100%;">
|
|
|
+ <el-form-item label="渠道方" prop="channelIds">
|
|
|
+ <el-select v-model="form.channelIds" multiple placeholder="请选择(可多选)" style="width: 100%;">
|
|
|
<el-option v-for="item in channelOptions" :key="item.id" :label="item.channelName" :value="item.id"></el-option>
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
@@ -177,7 +177,7 @@ export default {
|
|
|
id: '',
|
|
|
nickName: '',
|
|
|
uniqueNo: '',
|
|
|
- channelId: '',
|
|
|
+ channelIds: [],
|
|
|
realName: '',
|
|
|
welfareName: '',
|
|
|
welfareSlogan: '',
|
|
|
@@ -193,8 +193,8 @@ export default {
|
|
|
uniqueNo: [
|
|
|
{ required: true, message: '请输入善行少年编号', trigger: 'blur' }
|
|
|
],
|
|
|
- channelId: [
|
|
|
- { required: true, message: '请选择渠道方', trigger: 'change' }
|
|
|
+ channelIds: [
|
|
|
+ { required: true, type: 'array', min: 1, message: '请至少选择一个渠道方', trigger: 'change' }
|
|
|
],
|
|
|
realName: [
|
|
|
{ required: true, message: '请输入姓名', trigger: 'blur' }
|
|
|
@@ -251,6 +251,9 @@ export default {
|
|
|
this.form.totalInvoicedAmount = res.data.totalInvoicedAmount || 0
|
|
|
this.form.welfareCount = res.data.welfareCount || 0
|
|
|
this.form.userLevel = res.data.userLevel || 1
|
|
|
+ // channelIds 字符串转数组(用于多选回显)
|
|
|
+ const ids = res.data.channelIds
|
|
|
+ this.form.channelIds = ids ? ids.split(',').map(id => Number(id.trim())).filter(Boolean) : []
|
|
|
|
|
|
this.userInfo = JSON.parse(JSON.stringify(res.data))
|
|
|
this.userInfo.phoneCopy = this.userInfo.phone
|
|
|
@@ -281,7 +284,8 @@ export default {
|
|
|
submitForm () {
|
|
|
this.$refs['memberRef'].validate((valid) => {
|
|
|
if (valid) {
|
|
|
- this.$http.put('/core/app/user', this.form).then(({ data: res }) => {
|
|
|
+ const payload = { ...this.form, channelIds: this.form.channelIds.join(',') }
|
|
|
+ this.$http.put('/core/app/user', payload).then(({ data: res }) => {
|
|
|
if (res.code === 0) {
|
|
|
this.$message.success('保存成功!')
|
|
|
this.show = false
|
|
|
@@ -301,7 +305,7 @@ export default {
|
|
|
id: '',
|
|
|
nickName: '',
|
|
|
uniqueNo: '',
|
|
|
- channelId: '',
|
|
|
+ channelIds: [],
|
|
|
xxx: '',
|
|
|
welfareName: '',
|
|
|
welfareSlogan: '',
|