Browse Source

feat: 企微数据 - adq授权 - 绑定企微以及数据源ID接口联调

zhengxy 2 years ago
parent
commit
dcd3fff448

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

@@ -252,6 +252,7 @@ var api = {
252 252
   adqAccount_adqBindPitcher: "/api/pitcher/adqBindPitcher",
253 253
   adqAccount_adqPitcherIndex: "/api/pitcher/adqPitcherIndex",
254 254
   adqAccount_adqEditPitcher: "/api/pitcher/adqEditPitcher",
255
+  adqAccount_adqBindUserActionSetId: "/api/pitcher/adqBindUserActionSetId",
255 256
 };
256 257
 
257 258
 export { api };

+ 20 - 26
project/src/components/dataBoard/adqAccount/accountReportConf.vue

@@ -10,10 +10,10 @@
10 10
         <div class="name"><em>*</em>关联企微:</div>
11 11
         <self-channel title="" width="250px" type='corpIdList' :afferent_value='corpid' @channelDefine="(val)=>{corpid = val;}"></self-channel>
12 12
       </div>
13
-      <div class="itemBox">
13
+      <!-- <div class="itemBox">
14 14
         <div class="name">渠道编号:</div>
15 15
         <el-input placeholder="请输入渠道编号" style="width:250px" v-model.trim="channel" size="small" clearable></el-input>
16
-      </div>
16
+      </div> -->
17 17
     </div>
18 18
     <div slot="footer" class="dialog-footer">
19 19
       <el-button size="mini" @click="$emit('returnReportRule')">取 消</el-button>
@@ -30,23 +30,19 @@ export default {
30 30
   },
31 31
   data () {
32 32
     return {
33
-      corpid: '',
34
-      user_id: '',
35
-      time: [],
36 33
       loading: false,
34
+      corpid: '',
37 35
       user_action_set_id: '',
38
-      channel: ''
39 36
     }
40 37
   },
41 38
   created () {
42
-    if (this.editData && this.editData.wechat_account_id) {
39
+    if (this.editData && this.editData.account_id) {
43 40
       this.corpid = this.editData.corp_id ? this.editData.corp_id : '';
44 41
       this.user_action_set_id = this.editData.user_action_set_id ? this.editData.user_action_set_id : '';
45
-      this.channel = this.editData.channel ? this.editData.channel : '';
46 42
     }
47 43
   },
48 44
   methods: {
49
-    submitEvent () {
45
+    async submitEvent () {
50 46
       if (this.user_action_set_id == '') {
51 47
         this.$message({
52 48
           message: '请输入数据源ID',
@@ -61,28 +57,26 @@ export default {
61 57
         })
62 58
         return
63 59
       }
64
-      this.loading = true
65
-      let axios_api = this.URL.pitcher_setAccountReportConf
66
-      let params = {
67
-        user_action_set_id: this.user_action_set_id,
68
-        corpid: this.corpid,
69
-        app_id: this.editData.wechat_account_id,
70
-        channel: this.channel
71
-      }
72
-      this.$axios.post(this.URL.BASEURL + axios_api, params).then((res) => {
73
-        var res = res.data
74
-        this.loading = false
60
+
61
+      try {
62
+        const params = {
63
+          account_id: this.editData.account_id,
64
+          user_action_set_id: this.user_action_set_id,
65
+          corpid: this.corpid,
66
+        }
67
+        this.loading = true
68
+        const { data: res = {} } = await this.$axios.post(`${this.URL.BASEURL}${this.URL.adqAccount_adqBindUserActionSetId}`, params)
75 69
         if (res && res.errno == 0) {
70
+          this.$message.success('操作成功')
76 71
           this.$emit('returnReportRule', 'update')
77 72
         } else if (res.errno != 4002) {
78
-          this.$message({
79
-            message: res.err,
80
-            type: "warning"
81
-          })
73
+          this.$message.warning(res.err)
82 74
         }
83
-      }).catch((err) => {
75
+      } catch (error) {
76
+        console.log('error => ', error)
77
+      } finally {
84 78
         this.loading = false
85
-      });
79
+      }
86 80
     }
87 81
   }
88 82
 }

+ 2 - 2
project/src/components/dataBoard/adqAccount/list.vue

@@ -11,7 +11,7 @@
11 11
             <el-button type="primary" plain size="mini" @click="clearSelect">清空选中</el-button>
12 12
           </div>
13 13
         </div>
14
-        <div class="c-FF604D f14 lMar28">重要提示:ADQ账号完成后请及时编辑渠道编号、数据源ID与企微主体</div>
14
+        <div class="c-FF604D f14 lMar28">重要提示:ADQ账号完成后请及时编辑数据源ID与企微主体</div>
15 15
       </div>
16 16
       <div class="flex">
17 17
         <el-popover placement="bottom" width="600" trigger="click">
@@ -91,7 +91,7 @@
91 91
       <reportRule :app_ids='app_ids' :editData='editData' v-if="reportRuleFlag" @returnReportRule="returnAddPitcher"></reportRule>
92 92
     </el-dialog>
93 93
     <!-- ADQ账号绑定数据源及企微 -->
94
-    <el-dialog :title="`${editData.account_name} - 编辑`" :visible.sync="accountReportConfFlag" :append-to-body="true" width="400px">
94
+    <el-dialog :title="`${editData.account_id} - 编辑`" :visible.sync="accountReportConfFlag" :append-to-body="true" width="400px">
95 95
       <accountReportConf :editData='editData' v-if="accountReportConfFlag" @returnReportRule="returnAddPitcher"></accountReportConf>
96 96
     </el-dialog>
97 97