|
@@ -117,6 +117,15 @@ export default {
|
117
|
117
|
// 监听点击切换"状态"
|
118
|
118
|
async onClickStatus(row) {
|
119
|
119
|
try {
|
|
120
|
+
|
|
121
|
+ if (row.status == 0) { // 设置启用时 => 校验绑定状态 => 提示
|
|
122
|
+ const { bind_status = false, msg } = await this.handleGetBindStatus()
|
|
123
|
+ if (bind_status) { // 已绑定 => 提示先解绑
|
|
124
|
+ this.$message.warning(msg)
|
|
125
|
+ return false
|
|
126
|
+ }
|
|
127
|
+ }
|
|
128
|
+
|
120
|
129
|
await this.$confirm(`确定${row.status == 0 ? '启用' : '禁用'}当前推广计划吗?`, `推广计划(${row.pid})`, {
|
121
|
130
|
confirmButtonText: '确定',
|
122
|
131
|
cancelButtonText: '取消',
|
|
@@ -149,8 +158,13 @@ export default {
|
149
|
158
|
|
150
|
159
|
|
151
|
160
|
// 监听点击“绑定推广计划”
|
152
|
|
- onClickBindPid() {
|
153
|
|
- this.bindPidDialogVisible = true
|
|
161
|
+ async onClickBindPid() {
|
|
162
|
+ const { bind_status = false, msg } = await this.handleGetBindStatus()
|
|
163
|
+ if (bind_status) { // 已绑定 => 提示先解绑
|
|
164
|
+ this.$message.warning(msg)
|
|
165
|
+ } else {
|
|
166
|
+ this.bindPidDialogVisible = true
|
|
167
|
+ }
|
154
|
168
|
},
|
155
|
169
|
onConfirmBindPid() {
|
156
|
170
|
this.bindPidDialogVisible = false
|
|
@@ -160,6 +174,26 @@ export default {
|
160
|
174
|
onCancelBindPid() {
|
161
|
175
|
this.bindPidDialogVisible = false
|
162
|
176
|
},
|
|
177
|
+ async handleGetBindStatus() {
|
|
178
|
+ try {
|
|
179
|
+ const url = `${this.URL.BASEURL}${this.URL.adqAccount_checkBindType}`
|
|
180
|
+ const params = {
|
|
181
|
+ sys_group_id: this.sys_group_id,
|
|
182
|
+ account_id: this.account_id,
|
|
183
|
+ type: 2,
|
|
184
|
+ }
|
|
185
|
+ const { data: res = {} } = await this.$axios.get(url, { params })
|
|
186
|
+ if (res && res.errno == 0) {
|
|
187
|
+ return Promise.resolve({...res.rst})
|
|
188
|
+ } else if (res.error != 4002) {
|
|
189
|
+ this.$message.warning(res.err)
|
|
190
|
+ return Promise.reject(res.err)
|
|
191
|
+ }
|
|
192
|
+ } catch (error) {
|
|
193
|
+ console.log(error)
|
|
194
|
+ return Promise.reject(error)
|
|
195
|
+ }
|
|
196
|
+ },
|
163
|
197
|
}
|
164
|
198
|
}
|
165
|
199
|
</script>
|