Commit cdedf378 by 李伟康

提交

1 parent 7ee80b94
...@@ -215,14 +215,13 @@ export default { ...@@ -215,14 +215,13 @@ export default {
}, },
methods: { methods: {
change (id) { change (id) {
this.configForm.activityId = '' this.clearActivity()
this.configForm.activityType = ''
this.configForm.merchantName = '' this.configForm.merchantName = ''
this.activityObj = this.$options.data.call(this).activityObj this.activityObj = this.$options.data.call(this).activityObj
if (id) { if (id) {
this.configForm.merchantName = this.merchantObj.data.find(e => e.confId == id).confName this.configForm.merchantName = this.merchantObj.data.find(e => e.confId == id).confName
this.getActivityList() this.getActivityList()
}else this.activityObj.flag = true } else this.activityObj.flag = true
}, },
formRef () { formRef () {
return this.$refs.formRef.$refs.formRef return this.$refs.formRef.$refs.formRef
...@@ -251,8 +250,7 @@ export default { ...@@ -251,8 +250,7 @@ export default {
if (this.tabsObj.index == index) return if (this.tabsObj.index == index) return
if (!merchantId) return this.$message.error('请选择所属渠道') if (!merchantId) return this.$message.error('请选择所属渠道')
this.tabsObj.index = index this.tabsObj.index = index
this.configForm.activityId = '' this.clearActivity()
this.configForm.activityType = ''
this.activityObj = this.$options.data.call(this).activityObj this.activityObj = this.$options.data.call(this).activityObj
this.getActivityList() this.getActivityList()
}, },
...@@ -276,22 +274,26 @@ export default { ...@@ -276,22 +274,26 @@ export default {
if (index == 2) { if (index == 2) {
data = [...this.activityObj.data, ...res.list] data = [...this.activityObj.data, ...res.list]
this.activityObj.total = res.total this.activityObj.total = res.total
} }
this.activityObj.data = data this.setActivityData(data)
this.activityObj.loading = false
this.activityObj.flag = true
} catch (error) { } catch (error) {
this.activityObj.data = [] this.setActivityData()
this.activityObj.loading = false
this.activityObj.flag = true
} }
}, },
setActivityData (data = []) {
this.activityObj.data = data
this.activityObj.loading = false
this.activityObj.flag = true
},
choose (e) { choose (e) {
const { index } = this.tabsObj const { index } = this.tabsObj
this.configForm.activityId = e this.configForm.activityId = e
this.configForm.activityType = e ? index == 0 ? 1 : index : '' this.configForm.activityType = e ? index == 0 ? 1 : index : ''
} },
clearActivity(){
this.configForm.activityId = ''
this.configForm.activityType = ''
},
}, },
} }
......
...@@ -72,6 +72,7 @@ ...@@ -72,6 +72,7 @@
v-model="configForm.userInfoField" v-model="configForm.userInfoField"
placeholder="请选择" placeholder="请选择"
style="width:432px" style="width:432px"
clearable
> >
<el-option <el-option
v-for="item in userInfoFieldList" v-for="item in userInfoFieldList"
...@@ -89,6 +90,7 @@ ...@@ -89,6 +90,7 @@
:key="index" :key="index"
v-model="userInfoFields[index]" v-model="userInfoFields[index]"
placeholder="请选择" placeholder="请选择"
clearable
> >
<el-option <el-option
v-for="item in userInfoFieldList" v-for="item in userInfoFieldList"
...@@ -292,13 +294,12 @@ export default { ...@@ -292,13 +294,12 @@ export default {
selectValue: '', selectValue: '',
cascaderValue: '' cascaderValue: ''
} }
if (type != 3) { if (type != 3) this.configForm[inputKeyObject[type]] = String(data.option)
this.configForm[inputKeyObject[type]] = String(data.option) else this.configForm.maxLength = data.option
if (userInfoField) { if (userInfoField) {
if (type == 5) this.userInfoFields = userInfoField.split('/').map(e => e ? Number(e) : '') if (type == 5) this.userInfoFields = userInfoField.split('/').map(e => e ? Number(e) : '')
else this.configForm.userInfoField = Number(userInfoField) else this.configForm.userInfoField = Number(userInfoField)
} }
} else this.configForm.maxLength = data.option
} }
} }
}, },
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!