ソースを参照

update:外呼

ct 1 週間 前
コミット
aeb2c2c3a1

+ 12 - 2
src/api/company/companyVoiceApi.js

@@ -17,11 +17,21 @@ export function callOffMobile(voiceId) {
     method: 'get'
   })
 }
-export function getSipAccount() {
+export function getSipAccount(query) {
 
   return request({
     url: '/company/voiceApi/getSipAccount' ,
-    method: 'get'
+    method: 'get',
+    params:query
+  })
+}
+
+export function getCallerApiList(query) {
+
+  return request({
+    url: '/company/voiceApi/list' ,
+    method: 'get',
+    params:query
   })
 }
 

+ 12 - 2
src/api/company/companyVoiceCaller.js

@@ -9,6 +9,15 @@ export function listCompanyVoiceCaller(query) {
   })
 }
 
+// 查询我的企业用户坐席列表
+export function getMyCallerApiList(query) {
+  return request({
+    url: '/company/companyVoiceCaller/myList',
+    method: 'get',
+    params: query
+  })
+}
+
 // 查询企业用户坐席详细
 export function getCompanyVoiceCaller(callerId) {
   return request({
@@ -52,10 +61,11 @@ export function exportCompanyVoiceCaller(query) {
   })
 }
 
-export function getCallerList() {
+export function getCallerList(query) {
   return request({
     url: '/company/companyVoiceCaller/getCallerList' ,
-    method: 'get'
+    method: 'get',
+    params: query
   })
 }
 export function bindCallerNo(data) {

+ 2 - 2
src/store/modules/user.js

@@ -84,9 +84,9 @@ const user = {
       })
     },
 
-    GetSipAccount({ commit, state }) {
+    GetSipAccount({ commit, state },param) {
       return new Promise((resolve, reject) => {
-        getSipAccount().then(res => {
+        getSipAccount(param).then(res => {
           console.log(res)
           if(res.code==200){
             commit('SET_CALL_USER', res.data.data.response.data.user)

+ 4 - 2
src/utils/call.js

@@ -25,7 +25,7 @@ function webphoneHandle(type, data, options) {
 	
 }
 
-export function callNumber(customerId,contactsId,orderId){
+export function callNumber(customerId,contactsId,orderId,callerLine){
 	
 	const callUser = store.getters && store.getters.callUser
 	const callRealm = store.getters && store.getters.callRealm
@@ -70,7 +70,9 @@ export function callNumber(customerId,contactsId,orderId){
 			})
 			_phone.start({});
 	}
-	var data={customerId:customerId,contactsId:contactsId,orderId:orderId};
+	
+	var data={customerId:customerId,contactsId:contactsId,orderId:orderId,callerId:callerLine};
+	
 	this.callMobile(data).then(response => {
         if(response.code==200){
 			_phone.call(response.mobile,{userdata:response.logs.sessionId});

+ 32 - 3
src/views/company/companyVoiceCaller/index.vue

@@ -72,6 +72,7 @@
       <el-table-column type="selection" width="55" align="center" />
       <el-table-column label="ID" align="center" prop="callerId" />
       <el-table-column label="员工姓名" align="center" prop="companyUserNickName" />
+      <el-table-column label="线路" align="center" prop="callerLine" />
       <el-table-column label="坐席号" align="center" prop="callerNo" />
       <el-table-column label="手机号" align="center" prop="mobile" />
       <!-- <el-table-column label="状态" align="center" prop="status" >
@@ -116,7 +117,17 @@
               />
           </el-select>
         </el-form-item>
-        <el-form-item label="坐席" prop="callerId">
+        <el-form-item label="线路" prop="callerLine">
+          <el-select v-model="form.callerLine"  @change="handleCallerLineChange"  placeholder="请选择线路" clearable size="small">
+              <el-option
+                v-for="item in callerApis"
+                :key="item.apiId"
+                :label="item.apiName"
+                :value="item.apiId"
+              />
+          </el-select>
+        </el-form-item>
+        <el-form-item label="坐席" prop="callerId" v-if="form.callerLine != null">
           <el-select v-model="form.callerId"    placeholder="请选择坐席" clearable size="small">
               <el-option
                 v-for="item in callers"
@@ -163,12 +174,14 @@
 import { bindCallerNo,listCompanyVoiceCaller, getCompanyVoiceCaller, delCompanyVoiceCaller, addCompanyVoiceCaller, updateCompanyVoiceCaller, exportCompanyVoiceCaller } from "@/api/company/companyVoiceCaller";
 import { getUserList } from "@/api/company/companyUser";
 import { getCallerList } from "@/api/company/companyVoiceCaller";
+import {getCallerApiList} from "@/api/company/companyVoiceApi"
 
 import { sendSmsCode } from "@/api/common";
 export default {
   name: "CompanyCaller",
   data() {
     return {
+      callerApis:[],
       callers:[],
       // codeShow: true, // 获取验证码样式
       // codeFlag:true,
@@ -217,6 +230,9 @@ export default {
         callerId: [
           { required: true, message: "坐席编号不能为空", trigger: "blur" }
         ],
+        callerLine:[
+          { required: true, message: "线路不能为空", trigger: "blur" }
+        ]
         
         // code: [
         //   { required: true, message: "验证码不能为空", trigger: "blur" }
@@ -281,11 +297,23 @@ export default {
     userChange(e){
       console.log(e)
     },
+    handleCallerLineChange(){
+      this.getCallerList();
+    },
+
     getCallerList() {
-      getCallerList().then(response => {
+      console.log("-------------------" + JSON.stringify(this.form))
+      const param = {callerLine :this.form.callerLine}
+      getCallerList(param).then(response => {
         this.callers = response.data;
       });
     },
+    getCallerApiList() {
+      const param = {status:1}
+      getCallerApiList(param).then(response => {
+        this.callerApis = response.rows;
+      });
+    },
     getUserList() {
       getUserList().then(response => {
         this.users = response.data;
@@ -338,7 +366,8 @@ export default {
       this.reset();
       this.open = true;
       this.title = "员工坐席绑定";
-      this.getCallerList();
+      this.getCallerApiList();
+      // this.getCallerList();
     },
     /** 修改按钮操作 */
     // handleUpdate(row) {

+ 46 - 8
src/views/crm/customer/my.vue

@@ -122,7 +122,7 @@
           size="mini"
           :disabled="multiple"
           @click="handleAssist"
-          v-hasPermi="['crm:customer:assistToUser']"
+         
         >客户协作</el-button>
       </el-col>  
       <el-col :span="1.5">
@@ -175,12 +175,6 @@
               </el-button>
             </span>
         </el-dropdown>
-
-<!--        <el-button-->
-<!--          type="success"-->
-<!--          size="mini"-->
-<!--          @click="addPackageOrder"-->
-<!--        >创建订单</el-button>-->
       </el-col>
       <el-col :span="1.5">
         <el-button
@@ -200,6 +194,24 @@
           v-hasPermi="['crm:customer:export']"
         >导出</el-button>
       </el-col>
+     
+       <!-- 新增选择外呼线路的下拉框 -->
+      <el-col :span="2">
+        <el-select
+          v-model="selectedCallerLine"
+          placeholder="外呼线路"
+          size="mini"
+          style="width: 100%;"
+          @change="changeCallerLine"
+        >
+        <el-option
+          v-for="item in callerApis"
+          :key="item.callerId"
+          :label="item.callerLine"
+          :value="item.callerId"
+        />
+        </el-select>
+      </el-col>
 	  <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
     </el-row>
 
@@ -214,7 +226,7 @@
       <el-table-column  label="手机" width="120px"  align="center" prop="mobile"   >
         <template slot-scope="scope">
           {{scope.row.mobile}}
-          <el-button type="text"    size="mini" @click="callNumber(scope.row.customerId,null)">拨号</el-button>
+          <el-button type="text"    size="mini" @click="callNumber(scope.row.customerId,null,null,selectedCallerLine)">拨号</el-button>
           <el-button v-hasPermi="['crm:customer:addVisit']"  type="text" size="mini" @click="handleAddVisit(scope.row)">写跟进</el-button>
           <el-button type="text"    size="mini" @click="addPackageOrder()" style="margin-right: 15px;">创建订单</el-button>
         </template>
@@ -357,11 +369,15 @@ import addCustomerType from '../components/addCustomerType.vue';
 import addVisitStatus from '../components/addVisitStatus.vue';
 import addPackage from "@/views/store/components/addOrder";
 import addOrderOffline from "@/views/store/components/addOrderOffline";
+import {getMyCallerApiList} from "@/api/company/companyVoiceCaller"
+import { getSipAccount } from "@/api/company/companyVoiceApi"
 export default {
   name: "Customer",
   components: {addPackage,addOrderOffline,addVisitStatus,addCustomerType,addRemark,addTag,assignUser,assistUser,addOrEditCustomer,editSource, addBatchSms,customerDetails,addVisit },
   data() {
     return {
+      selectedCallerLine:null,
+      callerApis:[], //我的线路
       addOfflineOrder:{
         open:false,
       },
@@ -440,6 +456,10 @@ export default {
         title:"客户详情",
         open:false,
       },
+      callerShow:{
+        title:"外呼线路",
+        open:false,
+      },
       // 选中数组
       ids: [],
       // 非单个禁用
@@ -527,8 +547,26 @@ export default {
     });
     this.getCitys();
     this.getList();
+    this.getCallerApiList();
   },
   methods: {
+    getCallerApiList() {
+      getMyCallerApiList().then(response => {
+        this.callerApis = response.rows;
+        this.selectedCallerLine = this.callerApis[0].callerId
+        this.changeCallerLine();
+      });
+    },
+    changeCallerLine(){
+      const param = {callerId:this.selectedCallerLine}
+      // getSipAccount(param)
+      this.$store.dispatch('GetSipAccount',param).then(() => {
+
+      }).catch(err => {
+
+      });
+
+    },
     handleCommand(command){
       if (command==="1"){
         this.addOfflineOrder.open = true