Преглед на файлове

feat: 客服许可 - 分配许可 - 接口联调

zhengxy преди 2 години
родител
ревизия
56539b66f3

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

@@ -380,6 +380,7 @@ var api = {
380 380
 
381 381
 
382 382
   member_licenseCount: "/api/license/count", // 成员管理 - 查询企微待分配许可数
383
+  member_activeAccount: "/api/license/activeAccount", // 成员管理 - 分配许可
383 384
 
384 385
 };
385 386
 

+ 20 - 16
project/src/components/manage/memberComp/assignDialog.vue

@@ -43,7 +43,8 @@ export default {
43 43
     return {
44 44
       loading: false,
45 45
       form: {
46
-        user_id: '',
46
+        corpid: '',
47
+        userid: '',
47 48
       }
48 49
     }
49 50
   },
@@ -59,28 +60,31 @@ export default {
59 60
     // 获取弹框表单数据
60 61
     handleGetFormData() {
61 62
       const { user_id = '' } = this.userInfo
62
-      this.form.user_id = user_id
63
+      this.form.userid = user_id
63 64
     },
64 65
     // 清空弹框表单数据
65 66
     handleClearFormData() {
66
-      this.form.user_id = ''
67
+      this.form.userid = ''
67 68
     },
68
-
69 69
     async handleConfirm() {
70 70
       try {
71
-        this.$emit('confirm') // mock
72 71
         // 表单校验
73
-        // await this.handleFormValidate()
74
-        // const params = { ...this.form }
75
-        // this.loading = true
76
-        // const { data: res = {} } = await this.$axios.post(`${this.URL.BASEURL}${this.URL.manage_bindUserAdqAccountId}`, { ...params })
77
-        // if (res && res.errno == 0) {
78
-        //   this.$message.success('操作成功')
79
-        //   this.handleClearFormData()
80
-        //   this.$emit('confirm')
81
-        // } else if (res.errno != 4002) {
82
-        //   this.$message.warning(res.err || '操作失败')
83
-        // }
72
+        await this.handleFormValidate()
73
+        const url = `${this.URL.BASEURL}${this.URL.member_activeAccount}`
74
+        const params = {
75
+          ...this.form,
76
+          corpid: this.$localSelfStore.getLocal('defaultCorp') && this.$localSelfStore.getLocal('defaultCorp') != 'undefined' ? JSON.parse(this.$localSelfStore.getLocal('defaultCorp')).corpid : '',
77
+        }
78
+        this.loading = true
79
+        const { data: res = {} } = await this.$axios.get(url, { params })
80
+        if (res && res.errno == 0) {
81
+          this.$message.success('操作成功')
82
+          this.handleClearFormData()
83
+          this.$emit('confirm')
84
+        } else if (res.errno != 4002) {
85
+          this.$message.warning(res.err || '操作失败')
86
+          this.handleCancel()
87
+        }
84 88
       } catch (error) {
85 89
         console.log('error => ', error)
86 90
       } finally {

+ 10 - 10
project/src/components/manage/memberManage.vue

@@ -25,7 +25,8 @@
25 25
           <div class="totalCustom">
26 26
             <i class="el-icon-user-solid" /> 共<span>{{total}}</span>个成员
27 27
           </div>
28
-          <div class="totalCustom ml-20">
28
+          <!-- mock -->
29
+          <div v-if="isAdmin" class="totalCustom ml-20">
29 30
             待分配许可<span>{{ waitForAssignNum }}</span>
30 31
             <el-tooltip class="disinblock" popper-class="member-tooltip">
31 32
               <div slot="content">
@@ -38,8 +39,8 @@
38 39
           </div>
39 40
         </template>
40 41
       </div>
41
-
42
-      <batchAssign ref="batchAssign" :waitForAssignNum="waitForAssignNum" @change="onChangeBatchAssign" />
42
+      <!-- mock -->
43
+      <batchAssign v-if="isAdmin" ref="batchAssign" :waitForAssignNum="waitForAssignNum" @change="onChangeBatchAssign" />
43 44
     </div>
44 45
 
45 46
     <div style="display: flex;">
@@ -127,7 +128,8 @@
127 128
             <template slot-scope="scope">
128 129
               <span class="c-00B38A pointer" @click="detailEvent(scope.row)">详情</span>
129 130
               <span class="c-00B38A pointer ml-3" @click="onClickInfoBind(scope.row)">信息绑定</span>
130
-              <template>
131
+              <!-- mock -->
132
+              <template v-if="isAdmin">
131 133
                 <span v-if="scope.row.is_active == 1" class="c-00B38A pointer ml-3" @click="onClickTransfer(scope.row)">转移许可</span>
132 134
                 <span v-else class="c-00B38A pointer ml-3" @click="onClickAssign(scope.row)">分配许可</span>
133 135
               </template>
@@ -307,6 +309,10 @@ export default {
307 309
     isShowCustomerData() {
308 310
       return this.user_ids && this.user_ids.length
309 311
     },
312
+    // mock
313
+    isAdmin() {
314
+      return this.$cookie.getCookie('isSuperManage') == 1
315
+    }
310 316
   },
311 317
   created () {
312 318
     this.height = document.documentElement.clientHeight - 200 > 400 ? document.documentElement.clientHeight - 200 : 400
@@ -363,11 +369,6 @@ export default {
363 369
         var res = res.data
364 370
         this.loading = false
365 371
         if (res && res.errno == 0) {
366
-
367
-          if (res.rst.data[0]) { // mock
368
-            res.rst.data[0].is_active = 1
369
-          }
370
-
371 372
           this.tableData = res.rst.data;
372 373
           // this.tableData.forEach(item=>{
373 374
           //   item.visible = false
@@ -471,7 +472,6 @@ export default {
471 472
           const { data: res = {} } = await this.$axios.get(url, { params })
472 473
           if (res && res.errno == 0) {
473 474
             this.waitForAssignNum = res.rst.count
474
-            this.waitForAssignNum = parseInt(Math.random() * 20) // mock
475 475
             resolve(this.waitForAssignNum)
476 476
           } else if (res.errno != 4002) {
477 477
             this.$message.warning(res.err)