Browse Source

feat: 企微助手 - 成员管理 - 信息绑定(修改为绑定投放账号)

zhengxy 2 years ago
parent
commit
2206b4537a

+ 2 - 1
project/src/assets/config/interface_api.js

@@ -22,7 +22,6 @@ var api = {
22 22
   logout: "/api/loginOut",
23 23
   userList: "/api/user/userList",
24 24
   memberList: "/api/user/users",
25
-  bindUserActionSetId: "/api/user/bindUserActionSetId",
26 25
   addWayList: "/api/customer/addWayList",
27 26
   tagList: "/api/tag/tagList",
28 27
   addTag: "/api/tag/addTag",
@@ -248,6 +247,8 @@ var api = {
248 247
   chatGroup_condition: "/api/chatGroup/condition",
249 248
   chatGroup_memberList: "/api/chatGroup/memberList",
250 249
 
250
+  manage_bindUserAdqAccountId: "/api/user/bindUserAdqAccountId",
251
+  adqAccount_list: "/api/pitcher/adqAccountList",
251 252
 };
252 253
 
253 254
 export { api };

+ 33 - 13
project/src/components/manage/dialog/memberInfoBind.vue

@@ -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
   },

+ 21 - 5
project/src/components/manage/memberManage.vue

@@ -60,9 +60,9 @@
60 60
               <span>{{ getOrderTypeDesc(row.order_type) }}</span>
61 61
             </template>
62 62
           </el-table-column>
63
-          <el-table-column label="数据源ID" align="center">
63
+          <el-table-column label="ADQ投放账号ID" align="center">
64 64
             <template slot-scope="{row}">
65
-              <span>{{ row.user_action_set_id || '-' }}</span>
65
+              <span>{{ row.account_id || '-' }}</span>
66 66
             </template>
67 67
           </el-table-column>
68 68
           <el-table-column label="操作" align="center" min-width="80">
@@ -256,9 +256,25 @@ export default {
256 256
       this.init(1, this.keyword)
257 257
     },
258 258
 
259
-    onClickInfoBind({ user_id = '', user_action_set_id = '' }) {
260
-      this.currentBindInfo = { user_id, user_action_set_id }
261
-      this.infoBindDialogVisible = true
259
+    async onClickInfoBind({ name = '', user_id = '', account_id = '' }) {
260
+      try {
261
+        if (account_id) {
262
+          const h = this.$createElement
263
+          await this.$confirm('', {
264
+            message:h('div',null, [
265
+              h('span', { style:'color: #32B38A;' }, `${name}`),
266
+              h('span', null, '已经关联投放账号,是否确认修改?')
267
+            ]),
268
+            confirmButtonText: '确定',
269
+            cancelButtonText: '取消',
270
+            type: 'warning',
271
+          })
272
+        }
273
+        this.currentBindInfo = { user_id, account_id }
274
+        this.infoBindDialogVisible = true
275
+      } catch (error) {
276
+        console.log(error)
277
+      }
262 278
     },
263 279
     // 执行信息绑定 => 取消
264 280
     handleInfoBindCancel() {