Bladeren bron

1.企微员工界面增加ai客服上线下线功能

jzp 1 dag geleden
bovenliggende
commit
d4614cd966
3 gewijzigde bestanden met toevoegingen van 76 en 2 verwijderingen
  1. 10 0
      src/api/qw/user.js
  2. 34 1
      src/views/qw/user/index.vue
  3. 32 1
      src/views/qw/user/myIndex.vue

+ 10 - 0
src/api/qw/user.js

@@ -417,3 +417,13 @@ export function companyQwUserlist(params) {
     params: params
   })
 }
+
+/**
+ * 修改ai客服上下线
+ */
+export function updateFastGptRoleStatusById(id) {
+  return request({
+    url: '/qw/user/updateFastGptRoleStatusById/' + id,
+    method: 'get'
+  })
+}

+ 34 - 1
src/views/qw/user/index.vue

@@ -343,6 +343,24 @@
             v-if="scope.row.fastGptRoleName!=null"
             @click="relieveFastGptRole(scope.row)"
           >解绑AI客服</el-button>
+          <el-button
+            size="mini"
+            type="text"
+            icon="el-icon-unlock"
+            plain
+            v-hasPermi="['qw:user:aiStatus']"
+            v-if="scope.row.aiStatus == 0 && projectFrom === 'sxjz'"
+            @click="updateFastGptRoleStatus(scope.row)"
+          >Ai客服下线</el-button>
+          <el-button
+            size="mini"
+            type="text"
+            icon="el-icon-unlock"
+            plain
+            v-hasPermi="['qw:user:aiStatus']"
+            v-if="scope.row.aiStatus == 1 && projectFrom === 'sxjz'"
+            @click="updateFastGptRoleStatus(scope.row)"
+          >Ai客服上线</el-button>
         </template>
       </el-table-column>
     </el-table>
@@ -568,7 +586,8 @@ import {
   outLoginQwIpad,
   changeVideoStatus,
   handleAllocateRemoteHost,
-  qwBindCloudHost, qwUnbindCloudHost, handleAuthAppKey, handleInputAuthAppKey, selectCloudAP, staffListUser, exportStaff
+  qwBindCloudHost, qwUnbindCloudHost, handleAuthAppKey,
+  handleInputAuthAppKey, selectCloudAP, staffListUser, exportStaff,updateFastGptRoleStatusById
 } from '../../../api/qw/user'
 import fastGptRole from "@/views/fastGpt/fastGptRole/fastGptRole";
 import { treeselect } from "@/api/qw/qwDept";
@@ -590,6 +609,7 @@ export default {
         id:null,
         newIp:null,
       },
+      projectFrom:process.env.VUE_APP_PROJECT_FROM,
       authorizeKeyOpen:false,
       authorizeKeyFrom:{
         id:null,
@@ -1214,6 +1234,19 @@ export default {
       })
 
     },
+
+    updateFastGptRoleStatus(row) {
+      this.$confirm('是否修改该销售的AI客服?', "警告", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "warning"
+      }).then(function () {
+        return updateFastGptRoleStatusById(row.id);
+      }).then(() => {
+        this.getList();
+        this.msgSuccess("修改成功");
+      })
+    },
     /** 搜索按钮操作 */
     handleQuery() {
       this.queryParams.pageNum = 1;

+ 32 - 1
src/views/qw/user/myIndex.vue

@@ -339,6 +339,24 @@
             v-if="scope.row.fastGptRoleName!=null"
             @click="relieveFastGptRole(scope.row)"
           >解绑AI客服</el-button>
+          <el-button
+            size="mini"
+            type="text"
+            icon="el-icon-unlock"
+            plain
+            v-hasPermi="['qw:user:myAiStatus']"
+            v-if="scope.row.aiStatus == 0 && projectFrom === 'sxjz'"
+            @click="updateFastGptRoleStatus(scope.row)"
+          >Ai客服下线</el-button>
+          <el-button
+            size="mini"
+            type="text"
+            icon="el-icon-unlock"
+            plain
+            v-hasPermi="['qw:user:myAiStatus']"
+            v-if="scope.row.aiStatus == 1 && projectFrom === 'sxjz'"
+            @click="updateFastGptRoleStatus(scope.row)"
+          >Ai客服上线</el-button>
         </template>
       </el-table-column>
     </el-table>
@@ -571,7 +589,7 @@ import {
   selectCloudAP,
   staffListUser,
   exportStaff,
-  myStaffListUser
+  myStaffListUser,updateFastGptRoleStatusById
 } from '../../../api/qw/user'
 import fastGptRole from "@/views/fastGpt/fastGptRole/fastGptRole";
 
@@ -589,6 +607,7 @@ export default {
         id:null,
         newIp:null,
       },
+      projectFrom:process.env.VUE_APP_PROJECT_FROM,
       authorizeKeyOpen:false,
       authorizeKeyFrom:{
         id:null,
@@ -1091,6 +1110,18 @@ export default {
         this.getList();
       })
     },
+    updateFastGptRoleStatus(row) {
+      this.$confirm('是否修改该销售的AI客服?', "警告", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "warning"
+      }).then(function () {
+        return updateFastGptRoleStatusById(row.id);
+      }).then(() => {
+        this.getList();
+        this.msgSuccess("修改成功");
+      })
+    },
 
     handleBindCloudHost(val) {