Parcourir la source

Merge remote-tracking branch 'origin/master' into Payment-Configuration

yfh il y a 1 jour
Parent
commit
df473ab6b1

+ 26 - 0
.env.prod-shdn

@@ -0,0 +1,26 @@
+# 页面标题
+VUE_APP_TITLE =淄博德宁健康科技有限责任公司SCRM销售端
+# 公司名称
+VUE_APP_COMPANY_NAME =淄博德宁健康科技有限责任公司
+# ICP备案号
+VUE_APP_ICP_RECORD =鲁ICP备2024100689号-2
+# ICP网站访问地址
+VUE_APP_ICP_URL =https://beian.miit.gov.cn
+# 网站LOG
+VUE_APP_LOG_URL =@/assets/logo/jnlzjk.png
+
+# 生产环境配置
+ENV = 'production'
+
+# FS管理系统/开发环境
+VUE_APP_BASE_API = '/prod-api'
+
+
+#默认 1、会员 2、企微
+VUE_APP_COURSE_DEFAULT = 2
+
+#项目所属
+VUE_APP_PROJECT_FROM=shdn
+
+# 路由懒加载
+VUE_CLI_BABEL_TRANSPILE_MODULES = true

+ 2 - 1
package.json

@@ -55,6 +55,7 @@
     "build:prod-yxj": "vue-cli-service build --mode prod-yxj",
     "build:prod-bjzm": "vue-cli-service build --mode prod-bjzm",
     "build:prod-gzzdy": "vue-cli-service build --mode prod-gzzdy",
+    "build:prod-shdn": "vue-cli-service build --mode prod-shdn",
     "preview": "node build/index.js --preview",
     "lint": "eslint --ext .js,.vue src",
     "test:unit": "jest --clearCache && vue-cli-service test:unit",
@@ -154,9 +155,9 @@
     "husky": "1.3.1",
     "lint-staged": "8.1.5",
     "mockjs": "1.0.1-beta3",
-    "node-sass": "4.14.1",
     "plop": "2.3.0",
     "runjs": "4.3.2",
+    "sass": "^1.97.1",
     "sass-loader": "8.0.2",
     "script-ext-html-webpack-plugin": "2.1.3",
     "script-loader": "0.7.2",

+ 56 - 0
src/api/company/companyAccount.js

@@ -68,3 +68,59 @@ export function exportCompanyAccount(query) {
     params: query
   })
 }
+// 导出个微账号
+export function getWxQrCode(query) {
+  return request({
+    url: '/company/companyWx/getWxQrCode',
+    method: 'get',
+    params: query
+  })
+}
+
+// 导出个微账号
+export function getLoginStatus(query) {
+  return request({
+    url: '/company/companyWx/getLoginStatus',
+    method: 'get',
+    params: query
+  })
+}
+// 导出个微账号
+export function bindService(query) {
+  return request({
+    url: '/company/companyWx/bindService',
+    method: 'get',
+    params: query
+  })
+}
+// 导出个微账号
+export function wakeUpLogin(query) {
+  return request({
+    url: '/company/companyWx/wakeUpLogin',
+    method: 'get',
+    params: query
+  })
+}
+// 导出个微账号
+export function updateWxInfo(query) {
+  return request({
+    url: '/company/companyWx/updateWxInfo',
+    method: 'get',
+    params: query
+  })
+}
+// 导出个微账号
+export function wxLoginOut(query) {
+  return request({
+    url: '/company/companyWx/wxLoginOut',
+    method: 'get',
+    params: query
+  })
+}
+export function syncWx(query) {
+  return request({
+    url: '/company/companyWx/syncWx',
+    method: 'get',
+    params: query
+  })
+}

+ 9 - 0
src/api/company/companyVoiceRobotic.js

@@ -116,3 +116,12 @@ export function wxList(params) {
     params
   })
 }
+
+
+export function taskRun(params) {
+  return request({
+    url: 'company/companyVoiceRobotic/taskRun',
+    method: 'get',
+    params
+  })
+}

+ 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'
+  })
+}

+ 17 - 0
src/api/user/fsUser.js

@@ -27,6 +27,14 @@ export function getUser(userId) {
   })
 }
 
+// 项目会员信息
+export function getMemberUser(id) {
+  return request({
+    url: '/user/fsUser/member/' + id,
+    method: 'get'
+  })
+}
+
 // 新增用户
 export function addUser(data) {
   return request({
@@ -45,6 +53,15 @@ export function updateUser(data) {
   })
 }
 
+// 修改用户
+export function updateMemberUser(data) {
+  return request({
+    url: '/user/fsUser/member',
+    method: 'put',
+    data: data
+  })
+}
+
 // 删除用户
 export function delUser(userId) {
   return request({

+ 2 - 3
src/components/HeaderSearch/index.vue

@@ -166,8 +166,7 @@ export default {
     border-radius: 0;
     display: inline-block;
     vertical-align: middle;
-
-    /deep/ .el-input__inner {
+    .el-input__inner {
       border-radius: 0;
       border: 0;
       padding-left: 0;
@@ -176,7 +175,7 @@ export default {
       border-bottom: 1px solid #d9d9d9;
       vertical-align: middle;
     }
-  }
+}
 
   &.show {
     .header-search-select {

+ 23 - 0
src/views/adv/promotionAccount/index.vue

@@ -225,6 +225,14 @@
                 clearable
               />
             </el-form-item>
+            <el-form-item v-if="form.advertiserId == 10001" label="百度账户用户名" prop="extendedField" class="slide-fade">
+              <el-input 
+                v-model="form.extendedField" 
+                placeholder="请输入百度账户用户名"
+                prefix-icon="el-icon-connection"
+                clearable
+              />
+            </el-form-item>
           </template>
         </div>
       </el-form>
@@ -286,6 +294,15 @@ export default {
         10005: 'https://probe.bjmantis.net/msp/prmt/help/api/VIVO.pdf',
         10006: 'https://probe.bjmantis.net/msp/prmt/help/api/AIQIYI.pdf'
       },
+      // 回调地址映射
+      callbackUrlUrls: {
+        10001: 'https://ad.scrm.ylrzcloud.com/callBack/baidu/getAuthCode',
+        10002: 'https://ad.scrm.ylrzcloud.com/callBack/oceanEngine/getAuthCode',
+        10003: 'https://ad.scrm.ylrzcloud.com/callBack/tencent/getAuthCode',
+        10004: 'https://ad.scrm.ylrzcloud.com/callBack/oppo/getAuthCode',
+        10005: 'https://ad.scrm.ylrzcloud.com/callBack/vivo/getAuthCode',
+        10006: 'https://ad.scrm.ylrzcloud.com/callBack/iqiyi/getAuthCode'
+      },
       // 表单校验
       rules: {
         promotionType: [
@@ -420,6 +437,8 @@ export default {
       this.reset();
       this.isEdit = true;
       const id = row.id || this.ids[0];
+      // 修改时也需要加载广告商列表以确保 el-select 能正确回显名称而非 ID
+      this.getAdvertiserOptions();
       getPromotionAccount(id).then(response => {
         this.form = response.data;
         this.open = true;
@@ -472,6 +491,10 @@ export default {
         if (advertiser) {
           this.form.advertiserName = advertiser.advertiserName;
         }
+        // 新增时给回调地址给个默认值
+        if (!this.isEdit) {
+          this.form.callbackUrl = this.callbackUrlUrls[advertiserId] || "";
+        }
       }
     },
     /** 打开API帮助文档 */

+ 98 - 19
src/views/adv/site/index.vue

@@ -506,14 +506,17 @@
           </div>
         </el-form-item>
         <el-form-item label="二维码">
-          <div id="qrcode" class="qrcode-container"></div>
-          <el-button 
-            type="primary" 
-            size="small"
-            icon="el-icon-download"
-            @click="downloadQrcode"
-            style="margin-top: 10px;"
-          >下载</el-button>
+          <div class="qrcode-wrapper">
+            <div id="qrcode" class="qrcode-container"></div>
+            <div class="qrcode-action">
+              <el-button 
+                type="primary" 
+                size="small"
+                icon="el-icon-download"
+                @click="downloadQrcode"
+              >下载二维码</el-button>
+            </div>
+          </div>
         </el-form-item>
       </el-form>
       <div slot="footer" class="dialog-footer">
@@ -647,6 +650,12 @@ export default {
             }, 
             trigger: "change" 
           }
+        ],
+        allocationRule: [
+          { required: true, message: "请选择企微分配规则", trigger: "change" }
+        ],
+        allocationRuleId: [
+          { required: true, message: "请选择具体的分配汇总规则", trigger: "change" }
         ]
       }
     };
@@ -885,18 +894,43 @@ export default {
         this.msgError('投放链接为空');
         return;
       }
-      navigator.clipboard.writeText(this.launchUrl).then(() => {
-        this.msgSuccess('复制成功');
-      }).catch(() => {
-        // 平台不支持新API,改成传统方法
+      
+      // 优先使用 Clipboard API
+      if (navigator.clipboard && navigator.clipboard.writeText) {
+        navigator.clipboard.writeText(this.launchUrl).then(() => {
+          this.msgSuccess('复制成功');
+        }).catch(err => {
+          console.error('Clipboard API 复制失败:', err);
+          this.fallbackCopyText(this.launchUrl);
+        });
+      } else {
+        // 环境不支持,使用传统方法
+        this.fallbackCopyText(this.launchUrl);
+      }
+    },
+    /** 传统复制方法 (Fallback) */
+    fallbackCopyText(text) {
+      try {
         const textarea = document.createElement('textarea');
-        textarea.value = this.launchUrl;
+        textarea.value = text;
+        // 确保 textarea 不可见且不影响布局
+        textarea.style.position = 'fixed';
+        textarea.style.left = '-9999px';
+        textarea.style.top = '0';
         document.body.appendChild(textarea);
         textarea.select();
-        document.execCommand('copy');
+        const successful = document.execCommand('copy');
         document.body.removeChild(textarea);
-        this.msgSuccess('复制成功');
-      });
+        
+        if (successful) {
+          this.msgSuccess('复制成功');
+        } else {
+          this.msgError('复制失败,请手动选择复制');
+        }
+      } catch (err) {
+        console.error('传统复制方法异常:', err);
+        this.msgError('复制异常');
+      }
     },
     /** 下载二维码 */
     downloadQrcode() {
@@ -1617,20 +1651,65 @@ export default {
   display: flex;
   gap: 10px;
   align-items: center;
+  background: #f8f9fa;
+  padding: 8px;
+  border-radius: 8px;
+  border: 1px solid #eef0f2;
   
   .url-input {
     flex: 1;
+    ::v-deep .el-input__inner {
+      background: transparent;
+      border-color: transparent;
+      font-family: monospace;
+      font-size: 13px;
+      color: #764ba2;
+    }
   }
 }
 
+.qrcode-wrapper {
+  display: flex;
+  flex-direction: column;
+  align-items: center;
+  justify-content: center;
+  padding: 10px 0;
+  width: 100%;
+}
+
 .qrcode-container {
+  background: #fff;
+  padding: 15px;
+  border-radius: 12px;
+  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
+  border: 1px solid #f0f0f0;
+  margin-bottom: 15px;
   display: flex;
   justify-content: center;
-  padding: 20px 0;
+  align-items: center;
+  transition: all 0.3s ease;
+  
+  &:hover {
+    transform: translateY(-5px);
+    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
+  }
   
   canvas {
-    border: 1px solid #e0e0e0;
-    border-radius: 4px;
+    display: block;
+    max-width: 100%;
+  }
+}
+
+.qrcode-action {
+  .el-button {
+    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
+    border: none;
+    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
+    
+    &:hover {
+      transform: translateY(-2px);
+      box-shadow: 0 6px 15px rgba(102, 126, 234, 0.4);
+    }
   }
 }
 </style>

+ 7 - 0
src/views/company/companyClient/index.vue

@@ -47,6 +47,7 @@
       <el-form-item label="是否添加" prop="isAdd">
         <el-select v-model="queryParams.isAdd" clearable>
           <el-option label="否" :value="0"/>
+          <el-option label="待通过" :value="2"/>
           <el-option label="是" :value="1"/>
         </el-select>
       </el-form-item>
@@ -107,9 +108,15 @@
       <el-table-column label="个微昵称" align="center" prop="nickName"/>
       <el-table-column label="手机号" align="center" prop="phone"/>
       <el-table-column label="话术" align="center" prop="dialogName"/>
+      <el-table-column label="客户意向度" align="center">
+        <template slot-scope="scope">
+          <el-tag v-for="item in levelList" v-if="scope.row.intention == item.dictValue">{{item.dictLabel}}</el-tag>
+        </template>
+      </el-table-column>
       <el-table-column label="是否添加" align="center" prop="isAdd">
         <template slot-scope="scope">
           <el-tag type="danger" v-if="scope.row.isAdd == 0">否</el-tag>
+          <el-tag type="warning" v-if="scope.row.isAdd == 2">待通过</el-tag>
           <el-tag type="success" v-if="scope.row.isAdd == 1">是</el-tag>
         </template>
       </el-table-column>

+ 1 - 1
src/views/company/companyRecharge/doRecharge.vue

@@ -228,7 +228,7 @@ export default {
   .radio-img{
     margin-right: 10px;
   }
-  /deep/.el-radio{
+  .el-radio{
     display: flex;
     align-items: center;
     .el-radio__label{

+ 4 - 1
src/views/company/companyUser/index.vue

@@ -1423,7 +1423,10 @@ export default {
     handleDelete(row) {
 
       // 确保 userIds 始终是数组
-      const userIds = row.userId ? [row.userId] : this.ids;
+      let userIds = row.userId || this.ids;
+      if (!Array.isArray(userIds)) {
+        userIds = [userIds];
+      }
 
       // 筛选出 userType 为 '00' 的 userId
       const excludedUserIds = this.userList

+ 5 - 5
src/views/company/companyVoicePackageOrder/buy.vue

@@ -61,7 +61,7 @@
 <script>
 import { getVoicePackagelist, buy} from "@/api/company/companyVoicePackageOrder";
 import { getCompanyInfo,getCompanyVoice } from "@/api/company/company";
- 
+
 export default {
   name: "CompanyRecharge",
   data() {
@@ -79,7 +79,7 @@ export default {
       },
       // 表单校验
       rules: {
-        
+
          packageId: [
           { required: true, message: "套餐不能为空", trigger: "blur" },
         ],
@@ -137,7 +137,7 @@ export default {
     width:200px;
     margin: 0px 10px;
     cursor: pointer;
-    
+
   }
   .active{
     border: 1px solid #13c2c2;;
@@ -151,7 +151,7 @@ export default {
 .radio{
   display: flex;
   align-items: center;
-   
+
 
 }
 .radio-item{
@@ -159,7 +159,7 @@ export default {
   .radio-img{
     margin-right: 10px;
   }
-  /deep/.el-radio{
+  .el-radio{
     display: flex;
     align-items: center;
     .el-radio__label{

+ 814 - 0
src/views/company/companyVoiceRobotic/index-old.vue

@@ -0,0 +1,814 @@
+<template>
+  <div class="app-container">
+    <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
+      <el-form-item label="任务名称" prop="name">
+        <el-input
+          v-model="queryParams.name"
+          placeholder="请输入任务名称"
+          clearable
+          size="small"
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
+      <el-form-item label="机器人" prop="robot">
+        <el-select v-model="queryParams.robot" filterable clearable>
+          <el-option v-for="item in robotList" :label="item.name + '('+item.num+')'" :value="item.id"/>
+        </el-select>
+      </el-form-item>
+      <el-form-item label="话术" prop="dialogId">
+        <el-select v-model="queryParams.dialogId" filterable clearable>
+          <el-option v-for="item in dialogList" :label="item.name" :value="item.id"/>
+        </el-select>
+      </el-form-item>
+      <el-form-item>
+        <el-button type="cyan" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
+        <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
+      </el-form-item>
+    </el-form>
+
+    <el-row :gutter="10" class="mb8">
+      <el-col :span="1.5">
+        <el-button
+          type="primary"
+          icon="el-icon-plus"
+          size="mini"
+          @click="handleAdd"
+          v-hasPermi="['system:companyVoiceRobotic:add']"
+        >新增
+        </el-button>
+      </el-col>
+      <el-col :span="1.5">
+        <el-button
+          type="success"
+          icon="el-icon-edit"
+          size="mini"
+          :disabled="single"
+          @click="handleUpdate"
+          v-hasPermi="['system:companyVoiceRobotic:edit']"
+        >修改
+        </el-button>
+      </el-col>
+      <el-col :span="1.5">
+        <el-button
+          type="danger"
+          icon="el-icon-delete"
+          size="mini"
+          :disabled="multiple"
+          @click="handleDelete"
+          v-hasPermi="['system:companyVoiceRobotic:remove']"
+        >删除
+        </el-button>
+      </el-col>
+      <el-col :span="1.5">
+        <el-button
+          type="warning"
+          icon="el-icon-download"
+          size="mini"
+          @click="handleExport"
+          v-hasPermi="['system:companyVoiceRobotic:export']"
+        >导出
+        </el-button>
+      </el-col>
+      <el-col :span="1.5">
+        <el-button
+          type="success"
+          icon="el-icon-refresh"
+          size="mini"
+          @click="updateStatusFun"
+          v-hasPermi="['system:companyVoiceRobotic:list']"
+        >更新状态
+        </el-button>
+      </el-col>
+      <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
+    </el-row>
+
+    <el-table v-loading="loading" :data="roboticList" @selection-change="handleSelectionChange">
+      <el-table-column type="selection" width="55" align="center"/>
+      <el-table-column label="ID" align="center" prop="id"/>
+      <el-table-column label="任务名称" align="center" prop="name"/>
+      <el-table-column label="三方名称" align="center" prop="taskName"/>
+      <el-table-column label="三方ID" align="center" prop="taskId"/>
+      <el-table-column label="机器人" align="center" prop="robot">
+        <template slot-scope="scope">
+          <p v-for="(item, index) in robotList" v-if="scope.row.robot && scope.row.robot == item.id">{{ item.name }}</p>
+        </template>
+      </el-table-column>
+      <el-table-column label="话术" align="center" prop="dialogId">
+        <template slot-scope="scope">
+          <p v-for="(item, index) in dialogList" v-if="scope.row.dialogId && scope.row.dialogId == item.id">
+            {{ item.name }}</p>
+        </template>
+      </el-table-column>
+      <el-table-column label="加微方式" align="center" prop="dialogId">
+        <template slot-scope="scope">
+          <el-tag v-if="scope.row.addType == 0">平均</el-tag>
+          <el-tag v-if="scope.row.addType == 1">意向</el-tag>
+        </template>
+      </el-table-column>
+      <el-table-column label="工作日" align="center" prop="weekDay1">
+        <template slot-scope="scope">
+          <el-tag v-for="(item, index) in weekList"
+                  v-if="scope.row.weekDay1 && scope.row.weekDay1.indexOf(item.value) != -1">{{ item.label }}
+          </el-tag>
+        </template>
+      </el-table-column>
+      <el-table-column label="开始时间" align="center" prop="startTime1"/>
+      <el-table-column label="结束时间" align="center" prop="endTime1"/>
+      <el-table-column label="未分配数量" align="center">
+        <template slot-scope="scope">
+          <el-tag :type="Number(scope.row.num) > 0 ?'danger' : ''">{{scope.row.num}}个</el-tag>
+        </template>
+      </el-table-column>
+      <el-table-column label="当前状态" align="center">
+        <template slot-scope="scope">
+          <div v-loading="loadingStatus">
+            <p v-if="statusObj.hasOwnProperty(scope.row.taskId)">
+              <el-tag v-if="statusObj[scope.row.taskId].runningStatus == 0">未启动</el-tag>
+              <el-tag v-if="statusObj[scope.row.taskId].runningStatus == 1">运行中</el-tag>
+              <el-tag v-if="statusObj[scope.row.taskId].runningStatus == 2">已暂停</el-tag>
+              <el-tag v-if="statusObj[scope.row.taskId].runningStatus == 3">已停止</el-tag>
+            </p>
+            <p v-if="!statusObj.hasOwnProperty(scope.row.taskId)">
+              <el-tag>空</el-tag>
+            </p>
+          </div>
+        </template>
+      </el-table-column>
+      <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
+        <template slot-scope="scope">
+          <el-button
+            size="mini"
+            type="text"
+            @click="calleesOpen(scope.row.id)"
+            v-hasPermi="['system:companyVoiceRobotic:list']"
+          >客户列表
+          </el-button>
+          <el-button
+            size="mini"
+            type="text"
+            @click="wxOpen(scope.row.id)"
+            v-hasPermi="['system:companyVoiceRobotic:list']"
+          >加微统计
+          </el-button>
+          <el-button
+            size="mini"
+            type="text"
+            v-if="statusObj.hasOwnProperty(scope.row.taskId) && (statusObj[scope.row.taskId].runningStatus == 0 || statusObj[scope.row.taskId].runningStatus == 3)"
+            @click="startRoboticFun(scope.row.taskId)"
+            v-hasPermi="['system:companyVoiceRobotic:list']"
+          >启动任务
+          </el-button>
+          <el-button
+            size="mini"
+            type="text"
+            v-if="statusObj.hasOwnProperty(scope.row.taskId) && (statusObj[scope.row.taskId].runningStatus == 1 || statusObj[scope.row.taskId].runningStatus == 2)"
+            @click="stopRoboticFun(scope.row.taskId)"
+            v-hasPermi="['system:companyVoiceRobotic:list']"
+          >停止任务
+          </el-button>
+          <el-button
+            size="mini"
+            type="text"
+            @click="addRoboticFun(scope.row)"
+            v-hasPermi="['system:companyVoiceRobotic:edit']"
+          >追加个微
+          </el-button>
+          <el-button
+            size="mini"
+            type="text"
+            icon="el-icon-delete"
+            @click="handleDelete(scope.row)"
+            v-hasPermi="['system:companyVoiceRobotic:remove']"
+          >删除
+          </el-button>
+        </template>
+      </el-table-column>
+    </el-table>
+
+    <pagination
+      v-show="total>0"
+      :total="total"
+      :page.sync="queryParams.pageNum"
+      :limit.sync="queryParams.pageSize"
+      @pagination="getList"
+    />
+
+    <!-- 添加或修改机器人外呼任务对话框 -->
+    <el-drawer size="75%" :title="title" :visible.sync="open" width="500px" append-to-body>
+      <div class="app-container">
+        <el-form ref="form" :model="form" :rules="rules" label-width="100px">
+          <el-form-item label="任务名称" prop="name">
+            <el-input v-model="form.name" placeholder="请输入任务名称"/>
+          </el-form-item>
+          <el-form-item label="机器人" prop="robot">
+            <el-select v-model="form.robot" filterable>
+              <el-option v-for="item in robotList" :label="item.name + '('+item.num+')'" :value="item.id"/>
+            </el-select>
+          </el-form-item>
+          <el-form-item label="话术" prop="dialogId">
+            <el-select v-model="form.dialogId" filterable>
+              <el-option v-for="item in dialogList" :label="item.name" :value="item.id"/>
+            </el-select>
+          </el-form-item>
+          <el-form-item label="拨打客户" prop="userIds">
+            <el-button @click="openSelect">选择客户({{ form.userIds ? form.userIds.length : 0 }})</el-button>
+          </el-form-item>
+          <el-form-item label="加微方式" prop="addType">
+            <el-radio v-model="form.addType" :label="0">平均</el-radio>
+            <el-radio v-model="form.addType" :label="1">意向</el-radio>
+          </el-form-item>
+          <el-form-item label="分配账号">
+            <el-button @click="addQwUser">添加</el-button>
+            <el-row :gutter="24" v-for="(item, index) in form.qwUser" style="margin-top: 5px">
+              <el-col :span="5">
+                <el-select v-model="item.intention" placeholder="意向等级" filterable clearable>
+                  <el-option v-for="item in levelList" :label="item.dictLabel" :value="item.dictLabel"/>
+                </el-select>
+              </el-col>
+              <el-col :span="4">
+                <el-button @click="openQwUserSelect(index)">
+                  选择个微({{ item.companyUserId ? item.companyUserId.length : 0 }})
+                </el-button>
+              </el-col>
+              <el-col :span="5">
+                <el-select v-model="item.wxDialogId" placeholder="话术" filterable>
+                  <el-option v-for="item in wxDialogList" :label="item.name" :value="item.id"/>
+                </el-select>
+              </el-col>
+              <el-col :span="3">
+                <el-button type="danger" icon="el-icon-delete" circle @click="removeQwUser(index)"></el-button>
+              </el-col>
+            </el-row>
+          </el-form-item>
+          <el-form-item label="模式" prop="mode">
+            <el-select v-model="form.mode">
+              <el-option label="呼叫机器人后挂断" :value="7"/>
+            </el-select>
+          </el-form-item>
+          <el-form-item label="呼叫倍率" prop="multiplier">
+            <el-select v-model="form.multiplier">
+              <el-option :value="1"/>
+              <el-option :value="2"/>
+              <el-option :value="3"/>
+              <el-option :value="4"/>
+              <el-option :value="5"/>
+            </el-select>
+          </el-form-item>
+          <el-form-item label="自动重呼" prop="autoRecall">
+            <el-radio v-model="form.autoRecall" label="0">否</el-radio>
+            <el-radio v-model="form.autoRecall" label="1">是</el-radio>
+          </el-form-item>
+          <el-form-item label="重呼次数" prop="recallTimes" v-if="form.autoRecall == 1">
+            <el-select v-model="form.recallTimes">
+              <el-option label="不自动重呼" :value="0"/>
+              <el-option :value="1"/>
+              <el-option :value="2"/>
+              <el-option :value="3"/>
+              <el-option :value="4"/>
+              <el-option :value="5"/>
+            </el-select>
+          </el-form-item>
+          <el-form-item label="工作日" prop="weekDay">
+            <el-select v-model="form.weekDay" multiple style="width: 100%">
+              <el-option v-for="item in weekList" :label="item.label" :value="item.value"/>
+            </el-select>
+          </el-form-item>
+          <el-form-item label="开始时间" prop="startTime1">
+            <el-time-select
+              v-model="form.startTime1"
+              format="HH:mm"
+              value-format="HH:mm:00"
+              :picker-options="{
+                  start: '00:00',
+                  end: '23:59',
+                  step: '00:30',
+                }"
+              placeholder="请选择开始时间">
+            </el-time-select>
+          </el-form-item>
+          <el-form-item label="结束时间" prop="endTime1">
+            <el-time-select
+              v-model="form.endTime1"
+              format="HH:mm"
+              value-format="HH:mm:00"
+              :picker-options="{
+                  start: '00:00',
+                  end: '23:59',
+                  step: '00:30',
+                  minTime: form.startTime1
+                }"
+              placeholder="请选择结束时间">
+            </el-time-select>
+          </el-form-item>
+        </el-form>
+        <div slot="footer" class="dialog-footer">
+          <el-button type="primary" @click="submitForm">确 定</el-button>
+          <el-button @click="cancel">取 消</el-button>
+        </div>
+      </div>
+    </el-drawer>
+    <customer-select @success="selectFun" ref="customer"/>
+    <qw-user-select @success="selectQwUserFun" ref="qwUserSelect"/>
+    <qw-user-select @success="selectQwUserFunTow" ref="qwUserSelectTow"/>
+
+    <el-drawer title="呼叫客户列表" size="60%" :visible.sync="callees.show" width="800px" append-to-body>
+      <el-table v-loading="callees.loading" :data="callees.list">
+        <el-table-column label="电话号码" align="center" prop="phone"/>
+        <el-table-column label="客户名称" align="center" prop="userName"/>
+        <el-table-column label="客户ID" align="center" prop="userId"/>
+        <el-table-column label="是否回调" align="center">
+          <template slot-scope="scope">
+            <el-tag v-if="scope.row.result == 0">否</el-tag>
+            <el-tag v-if="scope.row.result == 1">是</el-tag>
+          </template>
+        </el-table-column>
+        <el-table-column label="意向等级" align="center" prop="intention"/>
+        <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
+          <template slot-scope="scope">
+            <el-button
+              size="mini"
+              type="text"
+              @click="openCustomer(scope.row.userId)"
+            >客户信息详情
+            </el-button>
+          </template>
+        </el-table-column>
+      </el-table>
+
+      <pagination
+        v-show="callees.total>0"
+        :total="callees.total"
+        :page.sync="callees.queryParams.pageNum"
+        :limit.sync="callees.queryParams.pageSize"
+        @pagination="getCalleesList"
+      />
+    </el-drawer>
+    <el-drawer title="加微详情" size="60%" :visible.sync="wx.show" append-to-body>
+      <el-table v-loading="wx.loading" :data="wx.list">
+        <el-table-column label="意向等级" align="center" prop="intention"/>
+        <el-table-column label="微信昵称" align="center" prop="wxNickName"/>
+        <el-table-column label="微信号" align="center" prop="wxNo"/>
+        <el-table-column label="手机号" align="center" prop="phone"/>
+        <el-table-column label="员工名称" align="center" prop="companyUserName"/>
+        <el-table-column label="话术" align="center" prop="dialogName"/>
+        <el-table-column label="分配数量" align="center" prop="num"/>
+        <el-table-column label="添加数量" align="center" prop="addNum"/>
+      </el-table>
+
+      <pagination
+        v-show="wx.total>0"
+        :total="wx.total"
+        :page.sync="wx.queryParams.pageNum"
+        :limit.sync="wx.queryParams.pageSize"
+        @pagination="getWxList"
+      />
+    </el-drawer>
+    <el-drawer size="75%" title="客户详情" :visible.sync="customerDetailShow" append-to-body>
+      <customer-details ref="customerDetails"/>
+    </el-drawer>
+
+
+    <!-- 添加或修改添加个微信账号对话框 -->
+    <el-dialog title="追加个微" :visible.sync="openAdd" width="75%" append-to-body>
+      <el-form ref="form" :model="formOpen" label-width="80px">
+        <el-form-item label="分配账号">
+          <el-button @click="addQwUserTow">添加</el-button>
+          <el-row :gutter="24" v-for="(item, index) in formOpen.qwUser" style="margin-top: 5px">
+            <el-col :span="5">
+              <el-select v-model="item.intention" placeholder="意向等级" filterable clearable>
+                <el-option v-for="item in levelList" :label="item.dictLabel" :value="item.dictLabel"/>
+              </el-select>
+            </el-col>
+            <el-col :span="5">
+              <el-button @click="openQwUserSelectTow(index)">
+                选择企微({{ item.companyUserId ? item.companyUserId.length : 0 }})
+              </el-button>
+            </el-col>
+            <el-col :span="5">
+              <el-select v-model="item.wxDialogId" placeholder="话术" filterable>
+                <el-option v-for="item in wxDialogList" :label="item.name" :value="item.id"/>
+              </el-select>
+            </el-col>
+            <el-col :span="3">
+              <el-button type="danger" icon="el-icon-delete" circle
+                         @click="removeQwUser(index)"></el-button>
+            </el-col>
+          </el-row>
+        </el-form-item>
+      </el-form>
+      <div slot="footer" class="dialog-footer">
+        <el-button type="primary" @click="submitFormTow">确 定</el-button>
+        <el-button @click="openAdd = false">取 消</el-button>
+      </div>
+    </el-dialog>
+  </div>
+</template>
+
+<script>
+import {
+  listRobotic,
+  getRobotic,
+  delRobotic,
+  addRobotic,
+  updateRobotic,
+  exportRobotic,
+  calleesList,
+  statusList,
+  startRobotic,
+  stopRobotic,
+  addScheme,
+  companyUserList,
+  wxList,
+  getTypes
+} from "@/api/company/companyVoiceRobotic";
+import {listAll} from '@/api/company/wxDialog';
+import customerSelect from '@/views/crm/components/CustomerSelect.vue';
+import qwUserSelect from '@/views/components/QwUserSelect.vue';
+import customerDetails from "@/views/crm/components/customerDetails.vue";
+import {clearTime} from "element-ui";
+import {getDicts} from "@/api/system/dict/data";
+
+export default {
+  name: "Robotic",
+  components: {customerDetails, customerSelect, qwUserSelect},
+  data() {
+    return {
+      // 遮罩层
+      loading: true,
+      // 选中数组
+      ids: [],
+      weekList: [
+        {label: "星期一", value: 1},
+        {label: "星期二", value: 2},
+        {label: "星期三", value: 3},
+        {label: "星期四", value: 4},
+        {label: "星期五", value: 5},
+        {label: "星期六", value: 6},
+        {label: "星期日", value: 0},
+      ],
+      // 非单个禁用
+      single: true,
+      // 非多个禁用
+      multiple: true,
+      // 显示搜索条件
+      showSearch: true,
+      loadingStatus: true,
+      // 总条数
+      total: 0,
+      // 机器人外呼任务表格数据
+      roboticList: [],
+      userTableList: [],
+      // 弹出层标题
+      title: "",
+      // 是否显示弹出层
+      open: false,
+      openAdd: false,
+      // 查询参数
+      queryParams: {
+        pageNum: 1,
+        pageSize: 10,
+        name: null,
+        taskName: null,
+        taskId: null,
+        robot: null,
+        dialogId: null,
+        mode: null,
+        multiplier: null,
+        autoRecall: null,
+        recallTimes: null,
+        cidGroupId: null,
+        weekDay1: null,
+        startTime1: null,
+        endTime1: null,
+        weekDay2: null,
+        startTime2: null,
+        endTime2: null,
+        createUser: null
+      },
+      // 表单参数
+      form: {},
+      formOpen: {},
+      statusObj: {},
+      levelList: {},
+      robotList: [],
+      dialogList: [],
+      wxDialogList: [],
+      qwUserList: [],
+      selectQwUserList: [],
+      thisQwUserIndex: 0,
+      updateTime: null,
+      customer: {
+        show: false,
+      },
+      customerDetailShow: false,
+      callees: {
+        show: false,
+        list: [],
+        loading: false,
+        total: 0,
+        queryParams: {
+          id: null,
+          pageNum: 1,
+          pageSize: 10,
+        },
+      },
+      wx: {
+        show: false,
+        list: [],
+        loading: false,
+        total: 0,
+        queryParams: {
+          id: null,
+          pageNum: 1,
+          pageSize: 10,
+        },
+      },
+      // 表单校验
+      rules: {}
+    };
+  },
+  created() {
+    getTypes().then(e => {
+      this.robotList = e.robot;
+      this.dialogList = e.dialog;
+    })
+    listAll().then(e => {
+      this.wxDialogList = e.data;
+    })
+    companyUserList().then(e => {
+      this.qwUserList = e.data;
+    })
+    getDicts("customer_intention_level").then(e => {
+      this.levelList = e.data;
+    })
+    this.getList();
+  },
+  methods: {
+    /** 查询机器人外呼任务列表 */
+    getList() {
+      this.loading = true;
+      listRobotic(this.queryParams).then(response => {
+        this.roboticList = response.rows;
+        this.roboticList.forEach(e => {
+          if (e.weekDay1) {
+            e.weekDay = e.weekDay1.split(",")
+          }
+        })
+        this.total = response.total;
+        this.loading = false;
+        this.updateStatusFun();
+      });
+    },
+    updateStatusFun() {
+      if (!this.roboticList) {
+        return;
+      }
+      this.loadingStatus = true;
+      statusList(this.roboticList.map(e => e.taskId).join()).then(e => {
+        this.loadingStatus = false;
+        this.statusObj = e.data;
+      });
+    },
+    // 取消按钮
+    cancel() {
+      this.open = false;
+      this.reset();
+    },
+    // 表单重置
+    reset() {
+      this.form = {
+        id: null,
+        name: null,
+        taskName: null,
+        taskId: null,
+        robot: null,
+        dialogId: null,
+        mode: null,
+        multiplier: null,
+        autoRecall: null,
+        recallTimes: null,
+        cidGroupId: null,
+        weekDay1: null,
+        startTime1: null,
+        addType: 0,
+        endTime1: null,
+        weekDay2: null,
+        startTime2: null,
+        endTime2: null,
+        createTime: null,
+        qwUser: [],
+        createUser: null
+      };
+      this.resetForm("form");
+    },
+    /** 搜索按钮操作 */
+    handleQuery() {
+      this.queryParams.pageNum = 1;
+      this.getList();
+    },
+    /** 重置按钮操作 */
+    resetQuery() {
+      this.resetForm("queryForm");
+      this.handleQuery();
+    },
+    // 多选框选中数据
+    handleSelectionChange(selection) {
+      this.ids = selection.map(item => item.id)
+      this.single = selection.length !== 1
+      this.multiple = !selection.length
+    },
+    /** 新增按钮操作 */
+    handleAdd() {
+      this.reset();
+      this.open = true;
+      this.title = "添加机器人外呼任务";
+    },
+    /** 修改按钮操作 */
+    handleUpdate(row) {
+      this.reset();
+      const id = row.id || this.ids
+      getRobotic(id).then(response => {
+        this.form = response.data;
+        this.open = true;
+        this.title = "修改机器人外呼任务";
+      });
+    },
+    /** 提交按钮 */
+    submitForm() {
+      this.$refs["form"].validate(valid => {
+        if (valid) {
+          if (this.form.weekDay && this.form.weekDay.length > 0) {
+            this.form.weekDay1 = this.form.weekDay.join(",")
+          }
+          let list = [];
+          this.form.qwUser.forEach(l => {
+            list = list.concat(l.companyUserId.map(e => {
+              return {intention: l.intention, companyUserId: e, wxDialogId: l.wxDialogId}
+            }))
+          })
+          this.form.qwUserList = list;
+          if (!this.form.qwUserList || this.form.qwUserList.length == 0) {
+            this.msgError("请选者加微方案");
+            return;
+          }
+          if (this.form.id != null) {
+            updateRobotic(this.form).then(response => {
+              if (response.code === 200) {
+                this.msgSuccess("修改成功");
+                this.open = false;
+                this.getList();
+              }
+            });
+          } else {
+            addRobotic(this.form).then(response => {
+              if (response.code === 200) {
+                this.msgSuccess("新增成功");
+                this.open = false;
+                this.getList();
+              }
+            });
+          }
+        }
+      });
+    },
+    /** 提交按钮 */
+    submitFormTow() {
+      let list = [];
+      this.formOpen.qwUser.forEach(l => {
+        list = list.concat(l.companyUserId.map(e => {
+          return {intention: l.intention, companyUserId: e, wxDialogId: l.wxDialogId}
+        }))
+      })
+      this.formOpen.qwUserList = list;
+      if (!this.formOpen.qwUserList || this.formOpen.qwUserList.length == 0) {
+        this.msgError("请选者加微方案");
+        return;
+      }
+      addScheme(this.formOpen).then(response => {
+        if (response.code === 200) {
+          this.msgSuccess("修改成功");
+          this.open = false;
+          this.getList();
+        }
+      });
+    },
+    /** 删除按钮操作 */
+    handleDelete(row) {
+      const ids = row.id || this.ids;
+      this.$confirm('是否确认删除机器人外呼任务编号为"' + ids + '"的数据项?', "警告", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "warning"
+      }).then(function () {
+        return delRobotic(ids);
+      }).then(() => {
+        this.getList();
+        this.msgSuccess("删除成功");
+      }).catch(function () {
+      });
+    },
+    /** 导出按钮操作 */
+    handleExport() {
+      const queryParams = this.queryParams;
+      this.$confirm('是否确认导出所有机器人外呼任务数据项?', "警告", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "warning"
+      }).then(function () {
+        return exportRobotic(queryParams);
+      }).then(response => {
+        this.download(response.msg);
+      }).catch(function () {
+      });
+    },
+    openSelect() {
+      this.$refs.customer.setRows(this.form.userTableList);
+    },
+    openQwUserSelectTow(index) {
+      this.thisQwUserIndex = index;
+      this.$nextTick(() => {
+        this.$refs.qwUserSelectTow.setRows(this.selectQwUserList[index]);
+      })
+    },
+    openQwUserSelect(index) {
+      this.thisQwUserIndex = index;
+      this.$nextTick(() => {
+        this.$refs.qwUserSelect.setRows(this.selectQwUserList[index]);
+      })
+    },
+    selectFun(e) {
+      this.form.userIds = e.ids;
+      this.form.userNames = e.names;
+      this.form.userTableList = e.rows;
+      this.$forceUpdate()
+    },
+    selectQwUserFunTow(e) {
+      console.info(this.formOpen.qwUser[this.thisQwUserIndex])
+      this.formOpen.qwUser[this.thisQwUserIndex].companyUserId = e.ids;
+      console.info(this.formOpen)
+      this.selectQwUserList[this.thisQwUserIndex] = e.rows;
+      this.$forceUpdate()
+    },
+    selectQwUserFun(e) {
+      this.form.qwUser[this.thisQwUserIndex].companyUserId = e.ids;
+      this.selectQwUserList[this.thisQwUserIndex] = e.rows;
+      this.$forceUpdate()
+    },
+    calleesOpen(id) {
+      this.callees.show = true;
+      this.callees.queryParams.id = id;
+      this.getCalleesList();
+    },
+    getCalleesList() {
+      this.callees.loading = true;
+      calleesList(this.callees.queryParams).then(response => {
+        this.callees.list = response.rows;
+        this.callees.total = response.total;
+        this.callees.loading = false;
+      });
+    },
+    wxOpen(id) {
+      this.wx.show = true;
+      this.wx.queryParams.id = id;
+      this.getWxList();
+    },
+    getWxList() {
+      this.wx.loading = true;
+      wxList(this.wx.queryParams).then(response => {
+        this.wx.list = response.rows;
+        this.wx.total = response.total;
+        this.wx.loading = false;
+      });
+    },
+    openCustomer(id) {
+      this.customerDetailShow = true;
+      this.$nextTick(() => {
+        this.$refs.customerDetails.getDetails(id);
+      })
+    },
+    startRoboticFun(id) {
+      startRobotic(id).then(e => {
+        this.updateStatusFun();
+      })
+    },
+    stopRoboticFun(id) {
+      stopRobotic(id).then(e => {
+        this.updateStatusFun();
+      })
+    },
+    addQwUserTow(row) {
+      this.formOpen.qwUser.push({});
+    },
+    addRoboticFun(row) {
+      this.openAdd = true;
+      this.formOpen = {id: row.id, qwUser: []};
+    },
+    addQwUser() {
+      this.form.qwUser.push({});
+    },
+    removeQwUser(index) {
+      this.form.qwUser.splice(index, 1)
+    }
+  }
+};
+</script>

+ 97 - 44
src/views/company/companyVoiceRobotic/index.vue

@@ -93,14 +93,32 @@
           <el-tag v-if="scope.row.addType == 1">意向</el-tag>
         </template>
       </el-table-column>
-      <el-table-column label="星期" align="center" prop="weekDay1">
+<!--      <el-table-column label="星期" align="center" prop="weekDay1">-->
+<!--        <template slot-scope="scope">-->
+<!--          <el-tag v-for="(item, index) in weekList"   v-if="scope.row.weekDay1 && scope.row.weekDay1.indexOf(item.value) != -1">{{item.label}}</el-tag>-->
+<!--        </template>-->
+<!--      </el-table-column>-->
+<!--      <el-table-column label="开始时间" align="center" prop="startTime1"/>-->
+<!--      <el-table-column label="结束时间" align="center" prop="endTime1"/>-->
+      <el-table-column label="任务流程" align="center" width="230">
         <template slot-scope="scope">
-          <el-tag v-for="(item, index) in weekList"   v-if="scope.row.weekDay1 && scope.row.weekDay1.indexOf(item.value) != -1">{{item.label}}</el-tag>
+          <div v-if="scope.row.taskFlow" v-model="scope.row.taskFlow.split(',')" class="flow-parent">
+            <div v-for="(item, index) in scope.row.taskFlow.split(',')">
+              <el-tag :type="scope.row.runTaskFlow != null && scope.row.runTaskFlow.split(',').indexOf(item) != -1 ? 'success' : 'warning'">{{ taskFlowMap[item] }}</el-tag>
+              <i class="el-icon-arrow-right" v-if="index != 2"></i>
+            </div>
+          </div>
+        </template>
+      </el-table-column>
+      <el-table-column label="任务状态" align="center">
+        <template slot-scope="scope">
+            <el-tag v-if="scope.row.taskStatus == 0">未启动</el-tag>
+            <el-tag v-if="scope.row.taskStatus == 1" type="warning">执行中</el-tag>
+            <el-tag v-if="scope.row.taskStatus == 2" type="danger">执行中断</el-tag>
+            <el-tag v-if="scope.row.taskStatus == 3" type="success">执行完成</el-tag>
         </template>
       </el-table-column>
-      <el-table-column label="开始时间" align="center" prop="startTime1"/>
-      <el-table-column label="结束时间" align="center" prop="endTime1"/>
-      <el-table-column label="当前状态" align="center">
+      <el-table-column label="外呼状态" align="center">
         <template slot-scope="scope">
           <div v-loading="loadingStatus">
             <p v-if="statusObj.hasOwnProperty(scope.row.taskId)">
@@ -127,13 +145,19 @@
             @click="wxOpen(scope.row.id)"
             v-hasPermi="['system:companyVoiceRobotic:list']"
           >加微管理</el-button>
+          <el-button
+            size="mini"
+            type="text"
+            v-if="scope.row.taskStatus == 0"
+            @click="taskRunFun(scope.row.id)"
+          >启动任务</el-button>
           <el-button
             size="mini"
             type="text"
             v-if="statusObj.hasOwnProperty(scope.row.taskId) && (statusObj[scope.row.taskId].runningStatus == 0 || statusObj[scope.row.taskId].runningStatus == 3)"
             @click="startRoboticFun(scope.row.taskId)"
             v-hasPermi="['system:companyVoiceRobotic:list']"
-          >启动任务</el-button>
+          >开启外呼任务</el-button>
           <el-button
             size="mini"
             type="text"
@@ -181,6 +205,14 @@
           <el-form-item label="拨打客户" prop="userIds">
             <el-button @click="openSelect">选择客户({{ form.userIds ? form.userIds.length : 0 }})</el-button>
           </el-form-item>
+          <el-form-item label="任务流程" prop="taskFlow">
+            <draggable v-model="taskFlowList" @end="" class="flow-parent">
+              <div class="flow-child" v-for="item in taskFlowList">
+                <el-tag>{{ item.value }}</el-tag>
+                <i class="el-icon-arrow-right"></i>
+              </div>
+            </draggable>
+          </el-form-item>
           <el-form-item label="加微方式" prop="addType">
             <el-radio v-model="form.addType" :label="0">平均</el-radio>
             <el-radio v-model="form.addType" :label="1">意向</el-radio>
@@ -221,8 +253,8 @@
             </el-select>
           </el-form-item>
           <el-form-item label="自动重呼" prop="autoRecall">
-            <el-radio v-model="form.autoRecall" label="0">否</el-radio>
-            <el-radio v-model="form.autoRecall" label="1">是</el-radio>
+            <el-radio v-model="form.autoRecall" :label="0">否</el-radio>
+            <el-radio v-model="form.autoRecall" :label="1">是</el-radio>
           </el-form-item>
           <el-form-item label="重呼次数" prop="recallTimes" v-if="form.autoRecall == 1">
             <el-select v-model="form.recallTimes">
@@ -234,38 +266,6 @@
               <el-option :value="5"/>
             </el-select>
           </el-form-item>
-          <el-form-item label="星期" prop="weekDay">
-            <el-select v-model="form.weekDay" multiple style="width: 100%">
-              <el-option v-for="item in weekList" :label="item.label" :value="item.value"/>
-            </el-select>
-          </el-form-item>
-          <el-form-item label="开始时间" prop="startTime1">
-            <el-time-select
-              v-model="form.startTime1"
-              format="HH:mm"
-              value-format="HH:mm:00"
-              :picker-options="{
-                  start: '00:00',
-                  end: '23:59',
-                  step: '00:30',
-                }"
-              placeholder="请选择开始时间">
-            </el-time-select>
-          </el-form-item>
-          <el-form-item label="结束时间" prop="endTime1">
-            <el-time-select
-              v-model="form.endTime1"
-              format="HH:mm"
-              value-format="HH:mm:00"
-              :picker-options="{
-                  start: '00:00',
-                  end: '23:59',
-                  step: '00:30',
-                  minTime: form.startTime1
-                }"
-              placeholder="请选择结束时间">
-            </el-time-select>
-          </el-form-item>
         </el-form>
         <div slot="footer" class="dialog-footer">
           <el-button type="primary" @click="submitForm">确 定</el-button>
@@ -281,6 +281,11 @@
         <el-table-column label="电话号码" align="center" prop="phone"/>
         <el-table-column label="客户名称" align="center" prop="userName"/>
         <el-table-column label="客户ID" align="center" prop="userId"/>
+        <el-table-column label="客户意向度" align="center">
+          <template slot-scope="scope">
+            <el-tag v-for="item in levelList" v-if="scope.row.intention == item.dictValue">{{item.dictLabel}}</el-tag>
+          </template>
+        </el-table-column>
         <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
           <template slot-scope="scope">
             <el-button
@@ -340,8 +345,10 @@ import {
   stopRobotic,
   companyUserList,
   wxList,
+  taskRun,
   getTypes
 } from "@/api/company/companyVoiceRobotic";
+import draggable from 'vuedraggable'
 import { listAll } from '@/api/company/wxDialog';
 import customerSelect from '@/views/crm/components/CustomerSelect.vue';
 import qwUserSelect from '@/views/components/QwUserSelect.vue';
@@ -351,7 +358,7 @@ import {getDicts} from "@/api/system/dict/data";
 
 export default {
   name: "Robotic",
-  components: {customerDetails, customerSelect, qwUserSelect},
+  components: { draggable, customerDetails, customerSelect, qwUserSelect},
   data() {
     return {
       // 遮罩层
@@ -407,6 +414,8 @@ export default {
       },
       // 表单参数
       form: {},
+      taskFlowList: [{key: "cellPhone", value: "外呼"}, {key: "sendMsg", value: "发短信"}, {key: "addWx", value: "加微"}],
+      taskFlowMap: {cellPhone: "外呼", sendMsg: "发短信", addWx: "加微"},
       statusObj: {},
       levelList: {},
       robotList: [],
@@ -502,9 +511,9 @@ export default {
         taskId: null,
         robot: null,
         dialogId: null,
-        mode: null,
-        multiplier: null,
-        autoRecall: null,
+        mode: 7,
+        multiplier: 3,
+        autoRecall: 0,
         recallTimes: null,
         cidGroupId: null,
         weekDay1: null,
@@ -568,6 +577,7 @@ export default {
             this.msgError("请选者加微方案");
             return;
           }
+          this.form.taskFlow = this.taskFlowList.map(e => e.key).join();
           if (this.form.id != null) {
             updateRobotic(this.form).then(response => {
               if (response.code === 200) {
@@ -674,6 +684,11 @@ export default {
         this.updateStatusFun();
       })
     },
+    taskRunFun(id){
+      taskRun({id}).then(e => {
+        this.getList();
+      })
+    },
     stopRoboticFun(id){
       stopRobotic(id).then(e => {
         this.updateStatusFun();
@@ -688,3 +703,41 @@ export default {
   }
 };
 </script>
+<style>
+.flow-parent{
+  display: flex;
+  flex-wrap: nowrap;
+}
+.flow-child{
+  position: relative;
+  width: 150px;
+  cursor: move;
+}
+.flow-child:last-child i{
+  display: none;
+}
+.flow-child:last-child::after{
+  display: none;
+}
+.flow-child i{
+  right: 20px;
+  top: 50%;
+  transform: translateY(-50%);
+  position: absolute;
+  font-weight: bold;
+}
+.flow-child::after{
+  content: "";
+  border-top: 1px solid #000;
+  height: 1px;
+  width: 50px;
+  right: 26px;
+  top: 50%;
+  transform: translateY(-50%);
+  position: absolute;
+}
+.sortable-ghost{
+  //background: #FFF !important;
+  background: rgb(217, 236, 255) !important;
+}
+</style>

+ 163 - 35
src/views/gw/gwAccount/index.vue

@@ -31,7 +31,7 @@
       </el-form-item>
       <el-form-item label="员工" prop="companyUserId">
         <el-select v-model="queryParams.companyUserId" clearable>
-          <el-option v-for="item in qwUserList" :label="item.qwUserName" :value="item.id" />
+          <el-option v-for="item in qwUserList" :label="item.nickName" :value="item.userId" />
         </el-select>
       </el-form-item>
       <el-form-item>
@@ -49,46 +49,41 @@
           @click="handleAdd"
           v-hasPermi="['company:companyWx:add']"
         >新增</el-button>
-      </el-col>
-      <el-col :span="1.5">
-        <el-button
-          type="success"
-          icon="el-icon-edit"
-          size="mini"
-          :disabled="single"
-          @click="handleUpdate"
-          v-hasPermi="['company:companyWx:edit']"
-        >修改</el-button>
-      </el-col>
-      <el-col :span="1.5">
-        <el-button
-          type="danger"
-          icon="el-icon-delete"
-          size="mini"
-          :disabled="multiple"
-          @click="handleDelete"
-          v-hasPermi="['company:companyWx:remove']"
-        >删除</el-button>
-      </el-col>
-      <el-col :span="1.5">
-        <el-button
-          type="warning"
-          icon="el-icon-download"
-          size="mini"
-          @click="handleExport"
-          v-hasPermi="['company:companyWx:export']"
-        >导出</el-button>
       </el-col>
 	  <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
     </el-row>
 
     <el-table v-loading="loading" :data="companyAccountList" @selection-change="handleSelectionChange">
-      <el-table-column type="selection" width="55" align="center" />
-      <el-table-column label="id" align="center" prop="id" />
       <el-table-column label="微信昵称" align="center" prop="wxNickName" />
+      <el-table-column label="头像" width="150" align="center">
+        <template slot-scope="scope">
+          <img :src="scope.row.headImgUrl" style="height: 80px">
+        </template>
+      </el-table-column>
       <el-table-column label="微信号" align="center" prop="wxNo" />
       <el-table-column label="手机号" align="center" prop="phone" />
-      <el-table-column label="员工" align="center" prop="companyUserName" />
+      <el-table-column label="员工" align="center">
+        <template slot-scope="scope">
+          <el-tag>{{scope.row.companyUserName}}</el-tag>
+        </template>
+      </el-table-column>
+      <el-table-column label="登录状态" align="center">
+        <template slot-scope="scope">
+          <el-tag v-if="scope.row.loginStatus == 1" type="success">在线</el-tag>
+          <el-tag v-else type="danger">离线</el-tag>
+        </template>
+      </el-table-column>
+      <el-table-column label="在线/离线时间" align="center">
+        <template slot-scope="scope">
+          <el-tag type="danger" v-if="scope.row.loginStatus == 0">{{scope.row.outTime}}</el-tag>
+          <el-tag type="success" v-if="scope.row.loginStatus == 1">{{scope.row.loginTime}}</el-tag>
+        </template>
+      </el-table-column>
+      <el-table-column label="离线备注" align="center" prop="outRemark">
+        <template slot-scope="scope">
+          <p v-if="scope.row.loginStatus == 0">{{scope.row.outRemark}}</p>
+        </template>
+      </el-table-column>
       <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
         <template slot-scope="scope">
           <el-button
@@ -98,6 +93,48 @@
             @click="handleUpdate(scope.row)"
             v-hasPermi="['company:companyWx:edit']"
           >修改</el-button>
+          <el-button
+            v-if="scope.row.serverStatus == 0"
+            size="mini"
+            type="text"
+            @click="bind(scope.row)"
+          >获取PAD</el-button>
+          <el-button
+            v-if="scope.row.serverStatus == 1 && scope.row.loginStatus == 0"
+            size="mini"
+            type="text"
+            @click="login(scope.row, 'ipad')"
+          >登录IPAD</el-button>
+          <el-button
+            v-if="scope.row.serverStatus == 1 && scope.row.loginStatus == 0"
+            size="mini"
+            type="text"
+            @click="login(scope.row, 'mac')"
+          >登录Mac</el-button>
+          <el-button
+            v-if="scope.row.serverStatus == 1 && scope.row.loginStatus == 0"
+            size="mini"
+            type="text"
+            @click="wkUp(scope.row)"
+          >唤醒登录</el-button>
+          <el-button
+            v-if="scope.row.serverStatus == 1 && scope.row.loginStatus == 1"
+            size="mini"
+            type="text"
+            @click="updateWxInfoFun(scope.row.id)"
+          >更新微信信息</el-button>
+          <el-button
+            v-if="scope.row.serverStatus == 1 && scope.row.loginStatus == 1"
+            size="mini"
+            type="text"
+            @click="wxLoginOutFun(scope.row.id)"
+          >退出微信</el-button>
+          <el-button
+            v-if="scope.row.serverStatus == 1 && scope.row.loginStatus == 1"
+            size="mini"
+            type="text"
+            @click="syncWxFun(scope.row.id)"
+          >同步通讯录</el-button>
           <el-button
             size="mini"
             type="text"
@@ -140,12 +177,46 @@
         <el-button @click="cancel">取 消</el-button>
       </div>
     </el-dialog>
+
+    <!-- 添加或修改个微账号对话框 -->
+    <el-dialog title="扫码登录" :visible.sync="loginData.open" width="500px" append-to-body>
+    </el-dialog>
+    <el-dialog
+      title="扫码登录"
+      :visible.sync="loginData.open"
+      width="600px"
+      append-to-body
+      custom-class="qr-login-dialog"
+    >
+      <div class="qr-login-container" style="text-align: center;">
+          <el-image
+            :src="loginData.url"
+            style="display: block; margin: 0 auto; width: 300px; height: 300px;"
+          />
+        <p class="qr-login-instructions">使用微信扫码授权登录</p>
+      </div>
+    </el-dialog>
   </div>
 </template>
 
 <script>
-import { listCompanyAccount, getCompanyAccount, delCompanyAccount, addCompanyAccount, updateCompanyAccount, exportCompanyAccount, companyListAll } from "@/api/company/companyAccount";
-import {getAllUserlist} from "@/api/company/companyUser";
+import {
+  listCompanyAccount,
+  getCompanyAccount,
+  delCompanyAccount,
+  addCompanyAccount,
+  updateCompanyAccount,
+  exportCompanyAccount,
+  companyListAll,
+  getWxQrCode,
+  getLoginStatus,
+  wakeUpLogin,
+  syncWx,
+  updateWxInfo,
+  wxLoginOut,
+  bindService
+} from '@/api/company/companyAccount'
+import { qrCodeStatus } from '@/api/qw/user'
 
 
 export default {
@@ -164,8 +235,13 @@ export default {
       showSearch: true,
       // 总条数
       total: 0,
+      loginData:{
+        open: false,
+        url: null
+      },
       // 个微账号表格数据
       companyAccountList: [],
+      loginQwInterval: null,
       qwUserList: [],
       // 弹出层标题
       title: "",
@@ -242,6 +318,58 @@ export default {
       this.open = true;
       this.title = "添加个微账号";
     },
+    login(row, ipadOrMac){
+      getWxQrCode({accountId: row.id, ipadOrMac}).then(e => {
+        this.loginData.open = true;
+        this.loginData.url = e.data;
+        this.loginStatus(row.id);
+      });
+    },
+    wkUp(row){
+      wakeUpLogin({accountId: row.id}).then(e => {
+        this.loginStatus(row.id);
+      });
+    },
+    loginStatus(id){
+      this.loginQwInterval = setInterval(() => {
+        this.getLoginStatusFun(id);
+      }, 3000);
+    },
+    getLoginStatusFun(id){
+      getLoginStatus({accountId: id}).then(res => {
+        if(res.data){
+          this.loginData.open = false;
+          this.getList();
+          clearInterval(this.loginQwInterval);
+        }
+      });
+    },
+    updateWxInfoFun(id){
+      updateWxInfo({accountId: id}).then(res => {
+        if(res.data){
+          this.loginData.open = false;
+          this.getList();
+          clearInterval(this.loginQwInterval);
+        }
+      });
+    },
+    wxLoginOutFun(id){
+      wxLoginOut({accountId: id}).then(res => {
+        if(res.data){
+          this.getList();
+        }
+      });
+    },
+    syncWxFun(id){
+      syncWx({accountId: id}).then(res => {
+        this.msgSuccess("正在同步......");
+      });
+    },
+    bind(row){
+      bindService({accountId: row.id}).then(e => {
+        this.getList();
+      })
+    },
     /** 修改按钮操作 */
     handleUpdate(row) {
       this.reset();

+ 10 - 0
src/views/hisStore/storeAfterSales/list.vue

@@ -90,6 +90,15 @@
               />
         </el-select>
       </el-form-item>
+
+      <el-form-item label="银行交易流水" prop="bankTransactionId" label-width="100">
+          <el-input
+            v-model="queryParams.bankTransactionId"
+            placeholder="请输入银行交易流水"
+            clearable
+            size="small"
+            @keyup.enter.native="handleQuery"/>
+       </el-form-item>
       <el-form-item>
         <el-button type="cyan" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
         <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
@@ -216,6 +225,7 @@ export default {
         shipperCode: null,
         deliverySn: null,
         deliveryName: null,
+        bankTransactionId: null,
         status: null,
         salesStatus: null,
         isDel: null,

+ 17 - 1
src/views/live/liveAfteraSales/index.vue

@@ -99,6 +99,14 @@
           @keyup.enter.native="handleQuery"/>
       </el-form-item>
 
+      <el-form-item label="银行交易流水" prop="bankTransactionId" label-width="100">
+          <el-input
+            v-model="queryParams.bankTransactionId"
+            placeholder="请输入银行交易流水"
+            clearable
+            size="small"
+            @keyup.enter.native="handleQuery"/>
+       </el-form-item>
 
       <el-form-item label="提交时间" prop="createTime">
         <el-date-picker
@@ -250,6 +258,7 @@ export default {
         shipperCode: null,
         deliverySn: null,
         deliveryName: null,
+        bankTransactionId: null,
         status: null,
         salesStatus: null,
         isDel: null,
@@ -308,7 +317,13 @@ export default {
     /** 查询售后记录列表 */
     getList() {
       this.loading = true;
-      listLiveAfterSales(this.queryParams).then(response => {
+      const params = { ...this.queryParams };
+      // 处理日期范围
+      if (this.dateRange && this.dateRange.length === 2) {
+        params.createTimeBegin = this.dateRange[0];
+        params.createTimeEnd = this.dateRange[1];
+      }
+      listLiveAfterSales(params).then(response => {
         this.liveAfterSalesList = response.rows;
         this.total = response.total;
         this.loading = false;
@@ -356,6 +371,7 @@ export default {
     },
     /** 重置按钮操作 */
     resetQuery() {
+      this.dateRange = [];
       this.resetForm("queryForm");
       this.handleQuery();
     },

+ 9 - 21
src/views/live/order/index.vue

@@ -1,20 +1,6 @@
 <template>
   <div class="app-container">
     <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="100px">
-      <el-form-item label="公司名" prop="companyId">
-        <el-select filterable v-model="queryParams.companyId" placeholder="请选择公司名" @change="companyChange" clearable size="small">
-          <el-option
-            v-for="item in companys"
-            :key="item.companyId"
-            :label="item.companyName"
-            :value="item.companyId"
-          />
-        </el-select>
-      </el-form-item>
-
-      <el-form-item>
-        <treeselect style="width: 220px" :clearable="false" v-model="queryParams.deptId" :options="deptOptions" :show-count="true" placeholder="请选择归属部门" />
-      </el-form-item>
 
       <el-form-item label="订单类型" prop="orderTypeFilter">
         <el-select v-model="queryParams.orderTypeFilter" placeholder="请选择订单类型" clearable size="small">
@@ -291,9 +277,11 @@
           v-model="createTimeRange"
           type="datetimerange"
           value-format="yyyy-MM-dd HH:mm:ss"
+          format="yyyy-MM-dd HH:mm:ss"
           range-separator="至"
           start-placeholder="开始日期"
           end-placeholder="结束日期"
+          :default-time="['00:00:00', '23:59:59']"
           @change="handleOrderTimeChange"
         />
       </el-form-item>
@@ -306,8 +294,11 @@
           v-model="payTimeRange"
           type="datetimerange"
           value-format="yyyy-MM-dd HH:mm:ss"
+          format="yyyy-MM-dd HH:mm:ss"
           start-placeholder="开始日期"
           end-placeholder="结束日期"
+          :default-time="['00:00:00', '23:59:59']"
+          @change="handlePayTimeChange"
         />
       </el-form-item>
 
@@ -913,13 +904,10 @@ export default {
       this.getList()
     },
     handleOrderTimeChange(value) {
-      if (value && value.length === 2) {
-        this.queryParams.createTimeStart = value[0]
-        this.queryParams.createTimeEnd = value[1]
-      } else {
-        this.queryParams.createTimeStart = null
-        this.queryParams.createTimeEnd = null
-      }
+
+    },
+    handlePayTimeChange(value) {
+
     },
     /** 导出订单 */
     handleExport() {

+ 26 - 26
src/views/member/list.vue

@@ -153,6 +153,7 @@
     <!-- User Table -->
     <el-table v-loading="loading" :data="userList" @selection-change="handleSelectionChange" border>
       <el-table-column type="selection" width="55" align="center" />
+<!--      <el-table-column label="项目会员id" align="center" prop="id" />-->
       <el-table-column label="ID" align="center" prop="userId" />
       <el-table-column label="项目" align="center" prop="projectId">
         <template slot-scope="scope">
@@ -315,7 +316,16 @@
 </template>
 
 <script>
-import { listUser, getUser, addUser, updateUser, delUser, exportUser, auditUser } from "@/api/user/fsUser";
+import {
+  listUser,
+  getMemberUser,
+  addUser,
+  updateUser,
+  delUser,
+  exportUser,
+  auditUser,
+  updateMemberUser
+} from '@/api/user/fsUser'
 import {getUserList} from "@/api/company/companyUser";
 import userDetails from '@/views/store/components/userDetails.vue';
 export default {
@@ -326,6 +336,7 @@ export default {
       show:{
         open:false,
       },
+      rowInfo:null,
       cusTransfer: {
         targetUserId: [{required: true, message: '请选择转移至销售', trigger: 'change'}],
         content: [{required: true, message: '请选择转移至销售', trigger: 'change'}]
@@ -561,9 +572,10 @@ export default {
 
     /** 修改按钮操作 */
     handleUpdate(row) {
+      this.rowInfo=row;
       this.reset();
-      const userId = row.userId || this.ids[0];
-      getUser(userId).then(response => {
+      const id = row.id;
+      getMemberUser(id).then(response => {
         this.form = response.data;
 
         // 处理标签数据,将字符串转为数组
@@ -580,30 +592,18 @@ export default {
     submitForm() {
       this.$refs["form"].validate(valid => {
         if (valid) {
-          // 处理标签数据,将数组转为字符串
-          if (this.form.tagIds && Array.isArray(this.form.tagIds)) {
-            this.form.tagIds = this.form.tagIds.join(',');
-          }
-
-          if (this.form.userId != null) {
-            //手机号不能修改 置空
-            this.form.phone = null;
-            updateUser(this.form).then(response => {
-              if (response.code === 200) {
-                this.$message.success("修改成功");
-                this.open = false;
-                this.getList();
-              }
-            });
-          } else {
-            addUser(this.form).then(response => {
-              if (response.code === 200) {
-                this.$message.success("新增成功");
-                this.open = false;
-                this.getList();
-              }
-            });
+          const updateForm={
+            id: this.rowInfo.id,
+            status: this.form.status,
+            remark: this.form.remark
           }
+          updateMemberUser(updateForm).then(response => {
+            if (response.code === 200) {
+              this.$message.success("修改成功");
+              this.open = false;
+              this.getList();
+            }
+          });
         }
       });
     },

+ 16 - 24
src/views/member/mylist.vue

@@ -326,7 +326,7 @@
 </template>
 
 <script>
-import { listUser, getUser, addUser, updateUser, delUser, exportUser, auditUser,myListUser } from "@/api/user/fsUser";
+import { listUser, getMemberUser, addUser, updateMemberUser, delUser, exportUser, auditUser,myListUser } from "@/api/user/fsUser";
 import {transferUser} from "@/api/users/user";
 import {getUserList} from "@/api/company/companyUser";
 import userDetails from '@/views/store/components/userDetails.vue';
@@ -341,6 +341,7 @@ export default {
         title:"会员详情",
         open:false,
       },
+      rowInfo:null,
       cusTransfer: {
         targetUserId: [{required: true, message: '请选择转移至销售', trigger: 'change'}],
         content: [{required: true, message: '请选择转移至销售', trigger: 'change'}]
@@ -603,9 +604,10 @@ export default {
 
     /** 修改按钮操作 */
     handleUpdate(row) {
+      this.rowInfo=row;
       this.reset();
-      const userId = row.userId || this.ids[0];
-      getUser(userId).then(response => {
+      const id = row.id;
+      getMemberUser(id).then(response => {
         this.form = response.data;
 
         // 处理标签数据,将字符串转为数组
@@ -622,28 +624,18 @@ export default {
     submitForm() {
       this.$refs["form"].validate(valid => {
         if (valid) {
-          // 处理标签数据,将数组转为字符串
-          if (this.form.tagIds && Array.isArray(this.form.tagIds)) {
-            this.form.tagIds = this.form.tagIds.join(',');
-          }
-
-          if (this.form.userId != null) {
-            updateUser(this.form).then(response => {
-              if (response.code === 200) {
-                this.$message.success("修改成功");
-                this.open = false;
-                this.getList();
-              }
-            });
-          } else {
-            addUser(this.form).then(response => {
-              if (response.code === 200) {
-                this.$message.success("新增成功");
-                this.open = false;
-                this.getList();
-              }
-            });
+          const updateForm={
+            id: this.rowInfo.id,
+            status: this.form.status,
+            remark: this.form.remark
           }
+          updateMemberUser(updateForm).then(response => {
+            if (response.code === 200) {
+              this.$message.success("修改成功");
+              this.open = false;
+              this.getList();
+            }
+          });
         }
       });
     },

+ 2 - 2
src/views/qw/qwChat/qq.vue

@@ -802,11 +802,11 @@ export default {
         padding: 0 8px;
     }
 
-    /deep/.el-dialog__headerbtn{
+    .el-dialog__headerbtn{
          top:10px;
     }
 
-    /deep/.el-dialog:not(.is-fullscreen) {
+  .el-dialog:not(.is-fullscreen) {
         margin-top: 0 !important;
     }
 

+ 36 - 3
src/views/qw/user/index.vue

@@ -273,7 +273,7 @@
             @click="uploadAuthorizeKey2(scope.row)"
           >授权key
           </el-button>
-          <el-button
+<!--          <el-button
             v-if="scope.row.loginCodeUrl==null && scope.row.appKey !=null"
             v-show="false"
             size="mini"
@@ -284,7 +284,7 @@
             v-hasPermi="['qw:user:loginIp']"
           >
             绑定主机
-          </el-button>
+          </el-button>-->
           <!--          <el-button-->
           <!--            v-if="scope.row.loginCodeUrl!=null"-->
           <!--            size="mini"-->
@@ -344,6 +344,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>
@@ -569,7 +587,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";
@@ -591,6 +610,7 @@ export default {
         id:null,
         newIp:null,
       },
+      projectFrom:process.env.VUE_APP_PROJECT_FROM,
       authorizeKeyOpen:false,
       authorizeKeyFrom:{
         id:null,
@@ -1215,6 +1235,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) {