|
@@ -78,7 +78,7 @@
|
|
|
@mouseleave="onHover('restSrc', 'phoneControls/rest_blue.png')"
|
|
|
>
|
|
|
<img :src="state.restSrc" alt="" />
|
|
|
- <span>结束</span>
|
|
|
+ <span>结束<span v-if="restReason">({{restReason}})</span></span>
|
|
|
</div>
|
|
|
<div
|
|
|
class="item active"
|
|
@@ -89,7 +89,7 @@
|
|
|
@mouseleave="onHover('restSrc', 'phoneControls/rest_blue.png')"
|
|
|
>
|
|
|
<img :src="state.restSrc" alt="" />
|
|
|
- <span>小休</span>
|
|
|
+ <span>小休 </span>
|
|
|
</div>
|
|
|
<div class="item disabled" title="审批中" v-else-if="telStatusInfo.isRest === 'InReview'">
|
|
|
<img :src="getImageUrl('phoneControls/rest_grey.png')" alt="" />
|
|
@@ -117,7 +117,7 @@
|
|
|
<span>{{ telStatusInfo.isHold ? '取消保持' : '保持' }}</span>
|
|
|
</div>
|
|
|
</template>
|
|
|
- <!-- 灰色小休不可用 -->
|
|
|
+ <!-- 灰色保持不可用 -->
|
|
|
<template v-else>
|
|
|
<div class="item disabled" title="保持">
|
|
|
<img :src="getImageUrl('phoneControls/hold_grey.png')" alt="" />
|
|
@@ -174,7 +174,7 @@
|
|
|
@mouseenter="onHover('conferenceSrc', 'phoneControls/conference_white.png')"
|
|
|
title="三方会议"
|
|
|
@mouseleave="onHover('conferenceSrc', 'phoneControls/conference_blue.png')"
|
|
|
- @click="onControlClick( 'conference')"
|
|
|
+ @click="onControlClick('conference')"
|
|
|
>
|
|
|
<img :src="state.conferenceSrc" alt="" />
|
|
|
<span>三方会议</span>
|
|
@@ -285,11 +285,11 @@
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
- <!-- <el-col :xs="24" :sm="12" :md="8" :lg="8" :xl="8">
|
|
|
+ <el-col :xs="24" :sm="12" :md="8" :lg="8" :xl="8">
|
|
|
<el-form-item label="" prop="acceptSms">
|
|
|
<el-checkbox v-model="state.restForm.acceptSms" label="短信通知" />
|
|
|
</el-form-item>
|
|
|
- </el-col> -->
|
|
|
+ </el-col>
|
|
|
<el-col :xs="24" :sm="12" :md="12" :lg="8" :xl="8">
|
|
|
<el-form-item
|
|
|
label="是否发起会签"
|
|
@@ -312,7 +312,7 @@
|
|
|
</el-col>
|
|
|
<el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24">
|
|
|
<el-form-item label="附件" prop="remark" :rules="[{ required: false, message: '请填写诉求内容', trigger: 'change' }]">
|
|
|
- <annex-list name="小休附件" businessId="" classify="小休上传"/>
|
|
|
+ <annex-list name="小休附件" businessId="" classify="小休上传" />
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
</el-row>
|
|
@@ -325,7 +325,12 @@
|
|
|
<el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24">
|
|
|
<el-form-item label="小休" prop="reason" :rules="[{ required: true, message: '请选择小休原因', trigger: 'change' }]">
|
|
|
<el-select v-model="state.restForm.reason" placeholder="请选择小休原因" class="w100" clearable>
|
|
|
- <el-option v-for="item in state.restReasonOptions" :key="item.id" :label="item.content" :value="item.content" />
|
|
|
+ <el-option v-for="item in state.restReasonOptions" :key="item.id" :label="item.content" :value="item.content" />
|
|
|
+ <el-option label="小休中" value="rest" />
|
|
|
+ <el-option label="外出" value="away" />
|
|
|
+ <el-option label="培训" value="trainning" />
|
|
|
+ <el-option label="辅导" value="coach" />
|
|
|
+ <el-option label="会议" value="conference" />
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
@@ -401,14 +406,13 @@ import { commonEnum } from '/@/utils/constants';
|
|
|
import other from '/@/utils/other';
|
|
|
import mittBus from '/@/utils/mitt';
|
|
|
import { workflowStepOptions } from '/@/api/system/workflow';
|
|
|
-import { restFlowStart, restFlowDel, restFlowStartWex, getTelList } from '/@/api/public/wex';
|
|
|
+import {restFlowStart, restFlowDel, restFlowStartWex, getTelList, telRestProcess, telRestAdd} from '/@/api/public/wex';
|
|
|
import { commonList } from '/@/api/auxiliary/advice';
|
|
|
import { auth } from '/@/utils/authFunction';
|
|
|
import { VoiceInterfaceObject } from '/@/utils/PhoneScript';
|
|
|
-import { WebsocketInterface } from '/@/utils/websocket';
|
|
|
import signalR from '/@/utils/signalR';
|
|
|
import { Local } from '/@/utils/storage';
|
|
|
-import {getGroup} from '/@/api/tels/group';
|
|
|
+import { ola } from '/@/utils/ola_api';
|
|
|
|
|
|
// 引入组件
|
|
|
const CommonAdvice = defineAsyncComponent(() => import('/@/components/CommonAdvice/index.vue')); // 常用意见
|
|
@@ -472,7 +476,7 @@ const state = reactive<any>({
|
|
|
metingId: '', // 三方会议ID
|
|
|
phoneNo: '', // 三方会议号码
|
|
|
},
|
|
|
- groupName:'', //坐席组名称
|
|
|
+ groupName: '', //坐席组名称
|
|
|
});
|
|
|
|
|
|
const useTelStatusStore = useTelStatus();
|
|
@@ -505,71 +509,6 @@ const removeTimer = debounce(() => {
|
|
|
clearInterval(state.talkTimer);
|
|
|
}, 1000);
|
|
|
|
|
|
-// 小休审批通过消息
|
|
|
-const RestApplyPassFn = (data: any) => {
|
|
|
- ElNotification({
|
|
|
- title: '成功',
|
|
|
- message: '小休审批通过,开始小休',
|
|
|
- type: 'success',
|
|
|
- });
|
|
|
- VoiceInterfaceObject.SetBusy(data); //设置忙碌
|
|
|
-};
|
|
|
-// 链接websocket
|
|
|
-const initWebsocket = () => {
|
|
|
- if (!userInfos.value.staffNo) {
|
|
|
- ElMessage.warning('账号暂无工号,请设置工号后重新登录后重试');
|
|
|
- return;
|
|
|
- }
|
|
|
- let telNo: string | number;
|
|
|
- let groupName:string|number = '';
|
|
|
- if (telStatusInfo.value.isDutyOn) {
|
|
|
- // 如果已签入
|
|
|
- telNo = telStatusInfo.value.telsNo;
|
|
|
- groupName = telStatusInfo.value.groupName;
|
|
|
- } else {
|
|
|
- // 如果未签入
|
|
|
- telNo = state.dutyForm.telNo;
|
|
|
- groupName = state.groupName;
|
|
|
- }
|
|
|
- // 设置变量
|
|
|
- VoiceInterfaceObject.SetSendModel({
|
|
|
- GongHao: userInfos.value.staffNo,
|
|
|
- FenJi: telNo,
|
|
|
- DepartmentID: 'Default',
|
|
|
- AgentGroupName: groupName,
|
|
|
- });
|
|
|
- // 初始化参数
|
|
|
- const wsParams = {
|
|
|
- url: import.meta.env.VITE_WEX_SOCKET_URL,
|
|
|
- IsReConnect: true, //是否重连
|
|
|
- reConnectTime: 40, //重连间隔
|
|
|
- IsKeepAlive: true, //是否发送心跳
|
|
|
- KeepAliveTime: 30, //30秒发送1次
|
|
|
- KeepAliveData: JSON.stringify(VoiceInterfaceObject.GetSendModel('keeplive')), //心跳
|
|
|
- onOpen: async () => {
|
|
|
- //登录语音系统
|
|
|
- VoiceInterfaceObject.Login();
|
|
|
- VoiceInterfaceObject.GetOnUserState(); //获取用户状态
|
|
|
- },
|
|
|
- onMessage: (e: any) => {
|
|
|
- // 收到消息调用方法
|
|
|
- let str: string = e.data; // 收到的消息
|
|
|
- const methodsName = str.split('(')[0]; // 方法名
|
|
|
- const parsers = str.split('(')[1].split(')')[0]; // 参数
|
|
|
- VoiceInterfaceObject[methodsName](JSON.parse(parsers));
|
|
|
- },
|
|
|
- onClose: () => {
|
|
|
- console.info('链接关闭了');
|
|
|
- },
|
|
|
- onError: (e: any) => {
|
|
|
- console.info('链接出错', e);
|
|
|
- },
|
|
|
- };
|
|
|
- //初始化WebSocket
|
|
|
- WebsocketInterface(wsParams);
|
|
|
- return Promise.resolve();
|
|
|
-};
|
|
|
-
|
|
|
// signalR 初始化signalr
|
|
|
signalR.init();
|
|
|
// 监听消息
|
|
@@ -597,7 +536,7 @@ const activeArr = computed(() => {
|
|
|
onCall: ['hangup', 'hold', 'transfer', 'evaluate'], // 单个通话中
|
|
|
onHold: ['hangup', 'hold', 'transfer', 'evaluate'], // 保持中
|
|
|
onTalkingDeal: ['dutyOff', 'rest', 'outbound', 'callForwarding', 'TalkingDeal'], // 事后处理中
|
|
|
- onTransferSuccess:['hangup','conference'], // 转接成功
|
|
|
+ onTransferSuccess: ['hangup', 'conference'], // 转接成功
|
|
|
onConference: ['hangup'], // 三方会议中 只能挂断
|
|
|
};
|
|
|
let arr = <EmptyArrayType>[];
|
|
@@ -617,13 +556,22 @@ const currentStatusText = computed(() => {
|
|
|
onCall: '通话中',
|
|
|
onTalkingDeal: '事后处理',
|
|
|
onConference: '会议中',
|
|
|
- onTransferSuccess:'转接成功'
|
|
|
+ onTransferSuccess: '转接成功',
|
|
|
};
|
|
|
return statusMap[telStatusInfo.value.phoneControlState] || '';
|
|
|
});
|
|
|
+// 小休审批通过消息
|
|
|
+const RestApplyPassFn = (data: any) => {
|
|
|
+ ElNotification({
|
|
|
+ title: '成功',
|
|
|
+ message: '小休审批通过,开始小休',
|
|
|
+ type: 'success',
|
|
|
+ });
|
|
|
+ VoiceInterfaceObject.SetBusy(data); //设置忙碌
|
|
|
+};
|
|
|
// 查询所有分机
|
|
|
const getTelsLists = async (object?: object) => {
|
|
|
- state.loading = true;
|
|
|
+ state.loading = true;
|
|
|
try {
|
|
|
const res: any = await getTelList(object);
|
|
|
state.telsList = res?.data ?? [];
|
|
@@ -632,11 +580,11 @@ const getTelsLists = async (object?: object) => {
|
|
|
label: item.device,
|
|
|
...item,
|
|
|
}));
|
|
|
- state.loading = false;
|
|
|
+ state.loading = false;
|
|
|
return Promise.resolve(state.telsList);
|
|
|
} catch (err) {
|
|
|
console.log(err);
|
|
|
- state.loading = false;
|
|
|
+ state.loading = false;
|
|
|
}
|
|
|
};
|
|
|
// 鼠标移入移出改变图标
|
|
@@ -686,10 +634,10 @@ const onControlClick = (val: string) => {
|
|
|
if (!auth('public:seat:transfer')) ElMessage.error('抱歉,您没有转接权限!');
|
|
|
else onTransfer();
|
|
|
break;
|
|
|
- case 'conference': //三方会议
|
|
|
- if (!auth('public:seat:meeting')) ElMessage.error('抱歉,您没有三方会议权限!');
|
|
|
- else onConference();
|
|
|
- break;
|
|
|
+ case 'conference': //三方会议
|
|
|
+ if (!auth('public:seat:meeting')) ElMessage.error('抱歉,您没有三方会议权限!');
|
|
|
+ else onConference();
|
|
|
+ break;
|
|
|
case 'outbound': //外呼
|
|
|
if (!auth('public:seat:outbound')) ElMessage.error('抱歉,您没有呼叫权限!');
|
|
|
else onOutbound();
|
|
@@ -698,10 +646,207 @@ const onControlClick = (val: string) => {
|
|
|
break;
|
|
|
}
|
|
|
};
|
|
|
+
|
|
|
+// 当前分机对象
|
|
|
+const ola_object = {
|
|
|
+ ola_extn: '1001', //分机hao
|
|
|
+ ola_password: '!@#123Qw', //分机密码
|
|
|
+ queues: '10010', //队列
|
|
|
+};
|
|
|
+// 链接呼叫中心
|
|
|
+const websocket_connect = () => {
|
|
|
+ ola.onConnect = onConnect;
|
|
|
+ ola.onClose = onClose;
|
|
|
+ ola.onMessage = onMessage;
|
|
|
+ ola.connect(import.meta.env.VITE_CALLCENTER_SOCKET_URL, ola_object.ola_extn, ola_object.ola_password,);
|
|
|
+};
|
|
|
+// 呼叫中心链接
|
|
|
+const onConnect = () => {
|
|
|
+ ola.subscribe('ola.agent.' + ola_object.ola_extn);
|
|
|
+ ola.subscribe('ola.caller.' + ola_object.ola_extn);
|
|
|
+ ola.get_agent_state(ola_object.ola_extn);
|
|
|
+
|
|
|
+ callCenterLogin();
|
|
|
+};
|
|
|
+// 呼叫中心登录
|
|
|
+const callCenterLogin = () => {
|
|
|
+ ola.logout(ola_object.ola_extn); //连接之后,先登出一次,防止其他地方已经登陆
|
|
|
+ let array_ola_queue: EmptyArrayType = []; // 队列
|
|
|
+ if (ola_object.queues) {
|
|
|
+ let array = ola_object.queues.split(',');
|
|
|
+ for (let i = 0; i < array.length; i++) {
|
|
|
+ array_ola_queue[i] = array[i];
|
|
|
+ }
|
|
|
+ ola.login(array_ola_queue, ola_object.ola_extn, { type: 'onhook' });
|
|
|
+ }
|
|
|
+};
|
|
|
+// 呼叫中心消息
|
|
|
+const onMessage = (event: any) => {
|
|
|
+ const data = JSON.parse(event.data);
|
|
|
+ console.log('onMessage', data);
|
|
|
+ if (data.event_type == 'agent_state') {
|
|
|
+ // 坐席状态
|
|
|
+ if (data.state == 'login') {
|
|
|
+ console.log('已签入');
|
|
|
+ // 设置分机号和坐席组
|
|
|
+ useTelStatusStore.setCallInfo({ telsNo: ola_object.ola_extn });
|
|
|
+ // 设置签入状态
|
|
|
+ useTelStatusStore.setDutyState(true);
|
|
|
+ // 设置电话状态
|
|
|
+ useTelStatusStore.setPhoneControlState(TelStates.dutyOn);
|
|
|
+ setTimeout(() => {
|
|
|
+ // 设置示闲状态
|
|
|
+ ola.go_ready();
|
|
|
+ }, 1000);
|
|
|
+ } else if (data.state == 'logout') {
|
|
|
+ console.log('未签入');
|
|
|
+ state.loading = true;
|
|
|
+ // 重置所有状态
|
|
|
+ useTelStatusStore.resetState();
|
|
|
+ state.loading = false;
|
|
|
+ } else if (data.state == 'ready') {
|
|
|
+ // 设置休息状态 设置未正常状态
|
|
|
+ useTelStatusStore.setRest(RestStates.unRest);
|
|
|
+ // 设置话机状态 结束休息改为签入状态
|
|
|
+ useTelStatusStore.setPhoneControlState(TelStates.dutyOn);
|
|
|
+ console.log('示闲中');
|
|
|
+ } else if (data.state == 'unready') {
|
|
|
+ useTelStatusStore.setPhoneControlState(TelStates.rest);
|
|
|
+ useTelStatusStore.setRest(RestStates.resting);
|
|
|
+ /*if (AppConfigInfo.value.IsRestApproval) {
|
|
|
+ // 如果小休需要审核
|
|
|
+ telRestProcess()
|
|
|
+ .then((res: any) => {
|
|
|
+ console.log('小休申请成功', res);
|
|
|
+ // 设置电话状态小休中
|
|
|
+ useTelStatusStore.setPhoneControlState(TelStates.rest);
|
|
|
+ useTelStatusStore.setRest(RestStates.resting);
|
|
|
+ ElMessage.success('小休开始!');
|
|
|
+ })
|
|
|
+ .catch((err: any) => {
|
|
|
+ console.log('小休申请失败', err);
|
|
|
+ restFlowDel().then(() => {
|
|
|
+ // 删除小休流程
|
|
|
+ });
|
|
|
+ ola.go_ready();// 示闲
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ // ElMessage.success('小休开始!');
|
|
|
+ // 设置电话状态小休中
|
|
|
+ useTelStatusStore.setPhoneControlState(TelStates.rest);
|
|
|
+ useTelStatusStore.setRest(RestStates.resting);
|
|
|
+ // 添加小休记录
|
|
|
+ telRestAdd({ reason: data.private_data })
|
|
|
+ .then((res: any) => {
|
|
|
+ console.log('小休记录添加成功 开始休息', res);
|
|
|
+ ElMessage.success('小休开始!');
|
|
|
+ })
|
|
|
+ .catch((err: any) => {
|
|
|
+ console.log('小休记录添加失败 开始休息', err);
|
|
|
+
|
|
|
+ });
|
|
|
+ }*/
|
|
|
+ console.log('示忙中');
|
|
|
+ break_reason(data.private_data);
|
|
|
+ } else if (data.state == 'acw') {
|
|
|
+ console.log('话后整理中');
|
|
|
+ const time: number = AppConfigInfo.value.TalkingDealTime * 1000; // 事后处理时间
|
|
|
+
|
|
|
+ ElNotification({
|
|
|
+ title: '自动开启事后处理成功',
|
|
|
+ message: `${AppConfigInfo.value.TalkingDealTime}秒后自动结束事后处理,或者手动结束事后处理`,
|
|
|
+ type: 'success',
|
|
|
+ duration: time,
|
|
|
+ });
|
|
|
+ // 设置事后处理
|
|
|
+ useTelStatusStore.setTalkingDeal(true);
|
|
|
+ // 设置话机状态 设置为事后处理中
|
|
|
+ useTelStatusStore.setPhoneControlState(TelStates.onTalkingDeal);
|
|
|
+ setTimeout(() => {
|
|
|
+ // 设置事后处理
|
|
|
+ useTelStatusStore.setTalkingDeal(false);
|
|
|
+ // 设置话机状态 取消事后处理修改为空闲状态
|
|
|
+ useTelStatusStore.setPhoneControlState(TelStates.dutyOn);
|
|
|
+ ola.go_ready(); // 示闲
|
|
|
+ }, 10000);
|
|
|
+
|
|
|
+ } else if (data.state == 'busy') {
|
|
|
+ console.log('通话中');
|
|
|
+ } else {
|
|
|
+ console.log(data.state);
|
|
|
+ }
|
|
|
+
|
|
|
+ if (data.state == 'busy') {
|
|
|
+ if (data.call_direction == 'outbound') {
|
|
|
+ if (data.private_data == 'calling') {
|
|
|
+ console.log('拨号中');
|
|
|
+ } else if (data.private_data == 'answered') {
|
|
|
+ if (data.other_answered == false) {
|
|
|
+ console.log('振铃中');
|
|
|
+ } else if (data.other_answered == true) {
|
|
|
+ console.log('通话中');
|
|
|
+ }
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ if (data.private_data == 'ring') {
|
|
|
+ console.log('振铃中');
|
|
|
+ } else if (data.private_data == 'answered') {
|
|
|
+ console.log('通话中');
|
|
|
+ }
|
|
|
+ }
|
|
|
+ } else if (data.old_state == 'busy') {
|
|
|
+ //挂机后系统可以返回两种状态:acw 话后整理状态 ready 示闲状态,如果不需要acw,可以联系我们后台修改配置,如果需要保留,如果需要再次
|
|
|
+ //拨打电话的话,需要手动点击示闲按钮
|
|
|
+ alert('已挂机');
|
|
|
+ }
|
|
|
+ } else if (data.event_type == 'agent_caller_state') {
|
|
|
+ //通话状态
|
|
|
+ // special feature, never mind
|
|
|
+ if (data.action == 'in') {
|
|
|
+ console.log('呼入', data.caller.cid_number, data.caller.uuid);
|
|
|
+ // ola.take_call(data.caller.uuid);
|
|
|
+ } else {
|
|
|
+ console.log('呼出', data.caller.uuid);
|
|
|
+ }
|
|
|
+ } else if (data.event_type == 'command/reply') {
|
|
|
+ // 其他消息
|
|
|
+ // console.log('command/reply', data);
|
|
|
+ }
|
|
|
+};
|
|
|
+// 呼叫中心链接关闭
|
|
|
+const onClose = () => {
|
|
|
+ ElMessage.error('呼叫中心断开链接');
|
|
|
+};
|
|
|
+// 小休原因
|
|
|
+const restReason = ref(''); // 小休原因
|
|
|
+const break_reason = (reason: string) => {
|
|
|
+ switch (reason) {
|
|
|
+ case 'away':
|
|
|
+ restReason.value = '外出中';
|
|
|
+ break;
|
|
|
+ case 'rest':
|
|
|
+ restReason.value = '小休中';
|
|
|
+ break;
|
|
|
+ case 'conference':
|
|
|
+ restReason.value = '会议中';
|
|
|
+ break;
|
|
|
+ case 'trainning':
|
|
|
+ restReason.value = '培训中';
|
|
|
+ break;
|
|
|
+ case 'coach':
|
|
|
+ restReason.value = '辅导中';
|
|
|
+ break;
|
|
|
+ default:
|
|
|
+ restReason.value = '示忙中';
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ console.log(restReason.value)
|
|
|
+};
|
|
|
//签入
|
|
|
const dutyFormRef = ref<RefType>();
|
|
|
const onDutyFn = async () => {
|
|
|
- dutyFormRef.value?.resetFields();
|
|
|
+ websocket_connect();
|
|
|
+ /*dutyFormRef.value?.resetFields();
|
|
|
// 获取所有分机列表(未签入的)
|
|
|
const list = await getTelsLists({ sigin: 0 });
|
|
|
const isDefaultTelNo = list.some((item: any) => item.value === userInfos.value.defaultTelNo);
|
|
@@ -709,7 +854,7 @@ const onDutyFn = async () => {
|
|
|
// 如果默认分机号是空闲的,就默认选中
|
|
|
state.dutyForm.telNo = userInfos.value.defaultTelNo;
|
|
|
}
|
|
|
- state.dutyDialogVisible = true;
|
|
|
+ state.dutyDialogVisible = true;*/
|
|
|
};
|
|
|
// 确认签入
|
|
|
const clickOnDuty = (formEl: FormInstance | undefined) => {
|
|
@@ -718,12 +863,7 @@ const clickOnDuty = (formEl: FormInstance | undefined) => {
|
|
|
if (!valid) return;
|
|
|
state.loading = true;
|
|
|
// {telNo:state.dutyForm.telNo}
|
|
|
- getGroup(state.dutyForm.telNo).then((res:any)=>{// 获取坐席分组
|
|
|
- state.groupName = res.result.groupName ?? '';
|
|
|
- state.loading = false;
|
|
|
- state.dutyDialogVisible = false;
|
|
|
- initWebsocket(); //开启消息监听
|
|
|
- })
|
|
|
+ websocket_connect(); //开启消息监听
|
|
|
});
|
|
|
};
|
|
|
// 签出
|
|
@@ -738,10 +878,11 @@ const offDutyFn = () => {
|
|
|
})
|
|
|
.then(() => {
|
|
|
state.loading = true;
|
|
|
- VoiceInterfaceObject.LogOut(); // 退出语音系统
|
|
|
+ ola.logout(ola_object.ola_extn); //签出
|
|
|
// 重置所有状态
|
|
|
useTelStatusStore.resetState();
|
|
|
state.loading = false;
|
|
|
+ state.dutyOnSrc = getImageUrl('phoneControls/dutyOn_blue.png'); //签入图片
|
|
|
})
|
|
|
.catch(() => {
|
|
|
state.loading = false;
|
|
@@ -758,7 +899,9 @@ const onHangup = () => {
|
|
|
autofocus: false,
|
|
|
})
|
|
|
.then(() => {
|
|
|
- VoiceInterfaceObject.HangUp(); // 挂断
|
|
|
+ state.loading = true;
|
|
|
+ ola.hangup(); //挂断
|
|
|
+ state.loading = false;
|
|
|
})
|
|
|
.catch(() => {});
|
|
|
};
|
|
@@ -847,7 +990,7 @@ const clickOnRest = (formEl: FormInstance | undefined) => {
|
|
|
});
|
|
|
} else {
|
|
|
//不需要审核直接开始小休
|
|
|
- VoiceInterfaceObject.SetBusy(state.restForm.reason); //设置忙碌
|
|
|
+ ola.go_break(state.restForm.reason); //设置忙碌
|
|
|
state.restDialogVisible = false;
|
|
|
state.loading = false;
|
|
|
}
|
|
@@ -874,7 +1017,7 @@ const onRestEnd = () => {
|
|
|
})
|
|
|
.then(() => {
|
|
|
state.loading = true;
|
|
|
- VoiceInterfaceObject.SetIdle(); //设置空闲
|
|
|
+ ola.go_ready(); // 示闲
|
|
|
state.loading = false;
|
|
|
})
|
|
|
.catch(() => {});
|
|
@@ -891,7 +1034,7 @@ const onHold = () => {
|
|
|
})
|
|
|
.then(() => {
|
|
|
state.loading = true;
|
|
|
- VoiceInterfaceObject.KeepInTouch();
|
|
|
+ ola.hold(); //保持
|
|
|
state.loading = false;
|
|
|
})
|
|
|
.catch(() => {});
|
|
@@ -908,30 +1051,14 @@ const onUnHold = () => {
|
|
|
})
|
|
|
.then(() => {
|
|
|
state.loading = true;
|
|
|
- VoiceInterfaceObject.KeepCancelInTouch();
|
|
|
+ ola.hold(); //保持
|
|
|
state.loading = false;
|
|
|
})
|
|
|
.catch(() => {});
|
|
|
};
|
|
|
-// 事后处理
|
|
|
+// 事后处理(系统默认进入)
|
|
|
const onTalkingDeal = () => {
|
|
|
- ElMessageBox.confirm(`确定要事后处理,是否继续?`, '提示', {
|
|
|
- confirmButtonText: '确认',
|
|
|
- cancelButtonText: '取消',
|
|
|
- type: 'warning',
|
|
|
- draggable: true,
|
|
|
- cancelButtonClass: 'default-button',
|
|
|
- autofocus: false,
|
|
|
- })
|
|
|
- .then(() => {
|
|
|
- state.loading = true;
|
|
|
- // 设置事后处理
|
|
|
- useTelStatusStore.setTalkingDeal(true);
|
|
|
- // 设置话机状态 设置为事后处理中
|
|
|
- useTelStatusStore.setPhoneControlState(TelStates.onTalkingDeal);
|
|
|
- state.loading = false;
|
|
|
- })
|
|
|
- .catch(() => {});
|
|
|
+
|
|
|
};
|
|
|
// 取消事后处理
|
|
|
const unTalkingDeal = () => {
|
|
@@ -945,11 +1072,11 @@ const unTalkingDeal = () => {
|
|
|
})
|
|
|
.then(() => {
|
|
|
state.loading = true;
|
|
|
- // 设置事后处理
|
|
|
- useTelStatusStore.setTalkingDeal(false);
|
|
|
- // 设置话机状态 取消时候处理修改为空闲状态
|
|
|
- useTelStatusStore.setPhoneControlState(TelStates.dutyOn);
|
|
|
- VoiceInterfaceObject.EndTalkingDeal(); //结束事后处理
|
|
|
+ // 设置事后处理
|
|
|
+ useTelStatusStore.setTalkingDeal(false);
|
|
|
+ // 设置话机状态 取消事后处理修改为空闲状态
|
|
|
+ useTelStatusStore.setPhoneControlState(TelStates.dutyOn);
|
|
|
+ ola.go_ready(); // 示闲
|
|
|
state.loading = false;
|
|
|
})
|
|
|
.catch(() => {});
|
|
@@ -960,33 +1087,33 @@ const onTransfer = () => {
|
|
|
// 重置表单
|
|
|
transferFormRef.value?.resetFields();
|
|
|
// 获取所有分机列表
|
|
|
- getTelsLists().then(()=>{
|
|
|
- state.transferDialogVisible = true;
|
|
|
- })
|
|
|
+ getTelsLists().then(() => {
|
|
|
+ state.transferDialogVisible = true;
|
|
|
+ });
|
|
|
};
|
|
|
// 确认转接
|
|
|
const clickOnTransfer = (formEl: FormInstance | undefined) => {
|
|
|
if (!formEl) return;
|
|
|
formEl.validate((valid: boolean) => {
|
|
|
if (!valid) return;
|
|
|
- VoiceInterfaceObject.TeleSwitch(state.transferForm.telNo);
|
|
|
+ ola.transfer(state.transferForm.telNo); //转接
|
|
|
state.transferDialogVisible = false;
|
|
|
});
|
|
|
};
|
|
|
// 三方会议开始
|
|
|
const onConference = () => {
|
|
|
- ElMessageBox.confirm(`确定确定要开启三方会议,是否继续?`, '提示', {
|
|
|
- confirmButtonText: '确认',
|
|
|
- cancelButtonText: '取消',
|
|
|
- type: 'warning',
|
|
|
- draggable: true,
|
|
|
- cancelButtonClass: 'default-button',
|
|
|
- autofocus: false,
|
|
|
- })
|
|
|
- .then(() => {
|
|
|
- VoiceInterfaceObject.Dtmf('0'); // 开启dtmf 三方通话
|
|
|
- })
|
|
|
- .catch(() => {});
|
|
|
+ ElMessageBox.confirm(`确定确定要开启三方会议,是否继续?`, '提示', {
|
|
|
+ confirmButtonText: '确认',
|
|
|
+ cancelButtonText: '取消',
|
|
|
+ type: 'warning',
|
|
|
+ draggable: true,
|
|
|
+ cancelButtonClass: 'default-button',
|
|
|
+ autofocus: false,
|
|
|
+ })
|
|
|
+ .then(() => {
|
|
|
+ VoiceInterfaceObject.Dtmf('0'); // 开启dtmf 三方通话
|
|
|
+ })
|
|
|
+ .catch(() => {});
|
|
|
};
|
|
|
// 外呼
|
|
|
const outboundFormRef = ref<RefType>(); //外呼
|
|
@@ -994,9 +1121,9 @@ const onOutbound = () => {
|
|
|
// 重置表单
|
|
|
outboundFormRef.value?.resetFields();
|
|
|
// 获取所有分机列表
|
|
|
- getTelsLists().then(()=>{
|
|
|
- state.outboundDialogVisible = true;
|
|
|
- })
|
|
|
+ getTelsLists().then(() => {
|
|
|
+ state.outboundDialogVisible = true;
|
|
|
+ });
|
|
|
};
|
|
|
// 外呼保存
|
|
|
const clickOnOutbound = (formEl: FormInstance | undefined) => {
|
|
@@ -1005,7 +1132,7 @@ const clickOnOutbound = (formEl: FormInstance | undefined) => {
|
|
|
if (!valid) return;
|
|
|
state.loading = true;
|
|
|
setTimeout(() => {
|
|
|
- VoiceInterfaceObject.DialOut(state.outboundForm.telNo);
|
|
|
+ ola.dial(state.outboundForm.telNo, 'dsadasdsa');
|
|
|
state.outboundDialogVisible = false;
|
|
|
state.loading = false;
|
|
|
}, 300);
|
|
@@ -1015,12 +1142,14 @@ onMounted(() => {
|
|
|
signalRStart(); //开启消息监听
|
|
|
if (telStatusInfo.value.telsNo) {
|
|
|
// 有分机号
|
|
|
- initWebsocket(); // 初始化websocket
|
|
|
+ websocket_connect(); // 链接呼叫中心
|
|
|
}
|
|
|
- mittBus.on('startTalkTime', (message:string) => { // 开始计时
|
|
|
+ mittBus.on('startTalkTime', (message: string) => {
|
|
|
+ // 开始计时
|
|
|
startTime();
|
|
|
});
|
|
|
- mittBus.on('endTalkTime', () => { // 结束计时
|
|
|
+ mittBus.on('endTalkTime', () => {
|
|
|
+ // 结束计时
|
|
|
removeTimer();
|
|
|
});
|
|
|
});
|