|
@@ -15,10 +15,12 @@
|
15
|
15
|
</el-select> -->
|
16
|
16
|
</div>
|
17
|
17
|
<div class="form-item">
|
18
|
|
- <span class="lable">数据源ID</span>
|
19
|
|
- <el-input v-model="form.user_action_set_id" size="small" placeholder="请输入数据源ID" clearable />
|
|
18
|
+ <span class="lable">投放账号</span>
|
|
19
|
+ <el-select v-model="form.account_id" size="small" placeholder="请选择投放账号" clearable filterable>
|
|
20
|
+ <el-option v-for="item in adqOptions" :key="item.account_id" :label="item.account_id" :value="item.account_id" />
|
|
21
|
+ </el-select>
|
20
|
22
|
</div>
|
21
|
|
- <div class="form-tips">可传空,此时会将原来设置的数据源置空</div>
|
|
23
|
+ <div class="form-tips">可传空,此时会将原来设置的投放账号置空</div>
|
22
|
24
|
</div>
|
23
|
25
|
<div slot="footer" class="dialog-footer">
|
24
|
26
|
<el-button size="mini" @click="handleCancel">取 消</el-button>
|
|
@@ -45,7 +47,7 @@ export default {
|
45
|
47
|
userInfo: {
|
46
|
48
|
type: Object,
|
47
|
49
|
default: () => ({
|
48
|
|
- user_action_set_id: '',
|
|
50
|
+ account_id: '',
|
49
|
51
|
user_id: '',
|
50
|
52
|
})
|
51
|
53
|
},
|
|
@@ -54,26 +56,44 @@ export default {
|
54
|
56
|
return {
|
55
|
57
|
loading: false,
|
56
|
58
|
typeOptions: Object.freeze(typeOptions),
|
|
59
|
+ adqOptions: [], // ADQ投放账号选项
|
57
|
60
|
form: {
|
58
|
|
- user_action_set_id: '',
|
|
61
|
+ account_id: '',
|
59
|
62
|
user_id: '',
|
60
|
63
|
}
|
61
|
64
|
}
|
62
|
65
|
},
|
63
|
66
|
watch: {
|
64
|
|
- // 弹框展示时获取表单数据
|
65
|
67
|
dialogVisible(isShow) {
|
66
|
|
- isShow && this.handleGetFormData()
|
|
68
|
+ if (isShow) {
|
|
69
|
+ // 获取ADQ投放账号选项列表
|
|
70
|
+ this.handleGetAdqOptions()
|
|
71
|
+ // 获取表单数据
|
|
72
|
+ this.handleGetFormData()
|
|
73
|
+ }
|
67
|
74
|
},
|
68
|
75
|
},
|
69
|
76
|
methods: {
|
|
77
|
+ // 获取ADQ账号选项列表
|
|
78
|
+ async handleGetAdqOptions() {
|
|
79
|
+ const { data: res = {} } = await this.$axios.get(this.URL.BASEURL + this.URL.adqAccount_list, {
|
|
80
|
+ params: {
|
|
81
|
+ is_select: 1
|
|
82
|
+ }
|
|
83
|
+ })
|
|
84
|
+ if (res && res.errno == 0) {
|
|
85
|
+ this.adqOptions = res.rst
|
|
86
|
+ } else if (res.errno != 4002) {
|
|
87
|
+ this.$message.warning(res.err)
|
|
88
|
+ }
|
|
89
|
+ },
|
70
|
90
|
async handleConfirm() {
|
71
|
91
|
try {
|
72
|
92
|
// 表单校验
|
73
|
93
|
await this.handleFormValidate()
|
74
|
94
|
const params = { ...this.form }
|
75
|
95
|
this.loading = true
|
76
|
|
- const { data: res = {} } = await this.$axios.post(`${this.URL.BASEURL}${this.URL.bindUserActionSetId}`, params)
|
|
96
|
+ const { data: res = {} } = await this.$axios.post(`${this.URL.BASEURL}${this.URL.manage_bindUserAdqAccountId}`, { ...params })
|
77
|
97
|
if (res && res.errno == 0) {
|
78
|
98
|
this.$message.success('操作成功')
|
79
|
99
|
this.handleClearFormData()
|
|
@@ -94,8 +114,8 @@ export default {
|
94
|
114
|
// 执行表单校验
|
95
|
115
|
handleFormValidate() {
|
96
|
116
|
return new Promise((resolve, reject) => {
|
97
|
|
- // if (!this.form.user_action_set_id) {
|
98
|
|
- // this.$message.warning('请输入数据源ID')
|
|
117
|
+ // if (!this.form.account_id) {
|
|
118
|
+ // this.$message.warning('请选择投放账号')
|
99
|
119
|
// reject('表单校验未通过')
|
100
|
120
|
// } else {
|
101
|
121
|
// resolve('表单校验通过')
|
|
@@ -107,13 +127,13 @@ export default {
|
107
|
127
|
},
|
108
|
128
|
// 获取弹框表单数据
|
109
|
129
|
handleGetFormData() {
|
110
|
|
- const { user_action_set_id = '', user_id = '' } = this.userInfo
|
111
|
|
- this.form.user_action_set_id = user_action_set_id
|
|
130
|
+ const { account_id = '', user_id = '' } = this.userInfo
|
|
131
|
+ this.form.account_id = account_id || ''
|
112
|
132
|
this.form.user_id = user_id
|
113
|
133
|
},
|
114
|
134
|
// 清空弹框表单数据
|
115
|
135
|
handleClearFormData() {
|
116
|
|
- this.form.user_action_set_id = ''
|
|
136
|
+ this.form.account_id = ''
|
117
|
137
|
this.form.user_id = ''
|
118
|
138
|
},
|
119
|
139
|
},
|