|
@@ -78,7 +78,9 @@
|
|
|
@mouseleave="onHover('restSrc', 'phoneControls/rest_blue.png')"
|
|
|
>
|
|
|
<img :src="state.restSrc" alt="" />
|
|
|
- <span>结束<span v-if="restReason">({{restReason}})</span></span>
|
|
|
+ <span
|
|
|
+ >结束<span v-if="restReason">({{ restReason }})</span></span
|
|
|
+ >
|
|
|
</div>
|
|
|
<div
|
|
|
class="item active"
|
|
@@ -246,7 +248,7 @@
|
|
|
<el-col :xs="24" :sm="12" :md="12" :lg="8" :xl="8">
|
|
|
<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.dicDataValue" :label="item.dicDataName" :value="item.dicDataValue" />
|
|
|
+ <el-option v-for="item in state.restReasonOptions" :key="item.dicDataValue" :label="item.dicDataName" :value="item.dicDataValue" />
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
@@ -325,7 +327,7 @@
|
|
|
<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.dicDataValue" :label="item.dicDataName" :value="item.dicDataValue" />
|
|
|
+ <el-option v-for="item in state.restReasonOptions" :key="item.dicDataValue" :label="item.dicDataName" :value="item.dicDataValue" />
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
@@ -386,22 +388,24 @@
|
|
|
</span>
|
|
|
</template>
|
|
|
</el-dialog>
|
|
|
+
|
|
|
+ <!-- 三方通话弹窗 -->
|
|
|
+
|
|
|
</template>
|
|
|
|
|
|
<script setup lang="ts" name="telControl">
|
|
|
-import { reactive, ref, computed, defineAsyncComponent, onMounted, onBeforeMount } from 'vue';
|
|
|
+import { reactive, ref, computed, defineAsyncComponent, onMounted } from 'vue';
|
|
|
import { ElMessageBox, ElNotification, ElMessage, FormInstance } from 'element-plus';
|
|
|
import { storeToRefs } from 'pinia';
|
|
|
import { useTelStatus, TelStates, RestStates } from '/@/stores/telStatus';
|
|
|
import { useUserInfo } from '/@/stores/userInfo';
|
|
|
import { useAppConfig } from '/@/stores/appConfig';
|
|
|
-import { debounce, getImageUrl } from '/@/utils/tools';
|
|
|
+import { getImageUrl } from '/@/utils/tools';
|
|
|
import { formatDuration } from '/@/utils/formatTime';
|
|
|
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, telRestProcess, telRestAdd, telRestBaseData} from '/@/api/public/wex';
|
|
|
+import { restFlowStart, restFlowDel, restFlowStartWex, getTelList, telRestProcess, telRestAdd, telRestBaseData } from '/@/api/public/wex';
|
|
|
import { auth } from '/@/utils/authFunction';
|
|
|
import { VoiceInterfaceObject } from '/@/utils/PhoneScript';
|
|
|
import signalR from '/@/utils/signalR';
|
|
@@ -478,37 +482,33 @@ const { AppConfigInfo } = storeToRefs(appConfigStore); // 系统配置信息
|
|
|
const storesUserInfo = useUserInfo();
|
|
|
const { userInfos } = storeToRefs(storesUserInfo); // 用户信息
|
|
|
|
|
|
-const talkTime = ref<Number>(0);// 通话时长
|
|
|
-const talkTimer = ref<any>(null);// 通话时长定时器
|
|
|
+const talkTime = ref<any>(0); // 通话时长
|
|
|
+const talkTimer = ref<any>(null); // 通话时长定时器
|
|
|
+
|
|
|
// 开始计时
|
|
|
-const startTime = debounce(() => {
|
|
|
- let talkTime = Local.get('talkTime');
|
|
|
+const startTime = () => {
|
|
|
+ let localTalkTime = Local.get('talkTime');
|
|
|
if (talkTime) {
|
|
|
- talkTime.value = Number(talkTime);
|
|
|
- talkTimer.value = setInterval(() => {
|
|
|
- talkTime.value++;
|
|
|
+ talkTime.value = Number(localTalkTime);
|
|
|
+ talkTimer.value = setInterval(() => {
|
|
|
+ talkTime.value++;
|
|
|
Local.set('talkTime', String(talkTime.value));
|
|
|
}, 1000);
|
|
|
} else {
|
|
|
- talkTimer.value = setInterval(() => {
|
|
|
- talkTime.value++;
|
|
|
+ talkTimer.value = setInterval(() => {
|
|
|
+ talkTime.value++;
|
|
|
Local.set('talkTime', String(talkTime.value));
|
|
|
}, 1000);
|
|
|
}
|
|
|
-}, 1000);
|
|
|
+};
|
|
|
// 结束计时
|
|
|
-const removeTimer = debounce(() => {
|
|
|
- talkTime.value = 0;
|
|
|
+const removeTimer = () => {
|
|
|
+ talkTime.value = 0;
|
|
|
Local.remove('talkTime');
|
|
|
clearInterval(talkTimer.value);
|
|
|
-}, 1000);
|
|
|
-
|
|
|
-// signalR 初始化signalr
|
|
|
-signalR.init();
|
|
|
+};
|
|
|
// 监听消息
|
|
|
const signalRStart = () => {
|
|
|
- // 加入分组
|
|
|
- signalR.joinGroup('CallCenter');
|
|
|
signalR.SR.on('Send', (data: any) => {
|
|
|
// 加入分组成功
|
|
|
console.log(data, '加入分组成功');
|
|
@@ -527,7 +527,7 @@ const activeArr = computed(() => {
|
|
|
dutyOn: ['dutyOff', 'rest', 'outbound', 'callForwarding'], // 已签入无通话状态
|
|
|
rest: ['rest', 'callForwarding'], // 小休中状态
|
|
|
ring: ['hangup'], //振铃中
|
|
|
- onCall: ['hangup', 'hold', 'transfer', 'evaluate'], // 单个通话中
|
|
|
+ onCall: ['hangup', 'hold', 'transfer', 'evaluate','conference'], // 单个通话中
|
|
|
onHold: ['hangup', 'hold', 'transfer', 'evaluate'], // 保持中
|
|
|
onTalkingDeal: ['dutyOff', 'rest', 'outbound', 'callForwarding', 'TalkingDeal'], // 事后处理中
|
|
|
onTransferSuccess: ['hangup', 'conference'], // 转接成功
|
|
@@ -556,12 +556,12 @@ const currentStatusText = computed(() => {
|
|
|
});
|
|
|
// 小休审批通过消息
|
|
|
const RestApplyPassFn = (data: any) => {
|
|
|
- ElNotification({
|
|
|
- title: '成功',
|
|
|
- message: '小休审批通过,开始小休',
|
|
|
- type: 'success',
|
|
|
- });
|
|
|
- VoiceInterfaceObject.SetBusy(data); //设置忙碌
|
|
|
+ ElNotification({
|
|
|
+ title: '成功',
|
|
|
+ message: '小休审批通过,开始小休',
|
|
|
+ type: 'success',
|
|
|
+ });
|
|
|
+ VoiceInterfaceObject.SetBusy(data); //设置忙碌
|
|
|
};
|
|
|
// 查询所有分机
|
|
|
const getTelsLists = async (object?: object) => {
|
|
@@ -643,71 +643,75 @@ const onControlClick = (val: string) => {
|
|
|
|
|
|
// 当前分机对象
|
|
|
const ola_object = {
|
|
|
- ola_extn: '1001', //分机hao
|
|
|
- ola_password: '!@#123Qw', //分机密码
|
|
|
- queues: '10010', //队列
|
|
|
+ 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,);
|
|
|
+ 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);
|
|
|
+ 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();
|
|
|
+ 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' });
|
|
|
- }
|
|
|
+ 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) {
|
|
|
+ const data = JSON.parse(event.data);
|
|
|
+ console.log('onMessage', data);
|
|
|
+ if (data.event_type == 'agent_state') {
|
|
|
+ // 坐席状态
|
|
|
+ if (data.state == 'login') {
|
|
|
+ // 签入
|
|
|
+ // 设置分机号和坐席组
|
|
|
+ useTelStatusStore.setCallInfo({ telsNo: ola_object.ola_extn });
|
|
|
+ // 设置签入状态
|
|
|
+ useTelStatusStore.setDutyState(true);
|
|
|
+ // 设置电话状态
|
|
|
+ useTelStatusStore.setPhoneControlState(TelStates.dutyOn);
|
|
|
+ setTimeout(() => {
|
|
|
+ // 设置示闲状态
|
|
|
+ ola.go_ready();
|
|
|
+ }, 1000);
|
|
|
+ console.log('已签入');
|
|
|
+ } else if (data.state == 'logout') {
|
|
|
+ // 签出
|
|
|
+ state.loading = true;
|
|
|
+ // 重置所有状态
|
|
|
+ useTelStatusStore.resetState();
|
|
|
+ state.loading = false;
|
|
|
+ console.log('已签出');
|
|
|
+ } 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) => {
|
|
@@ -740,105 +744,149 @@ const onMessage = (event: any) => {
|
|
|
|
|
|
});
|
|
|
}*/
|
|
|
- console.log('示忙中');
|
|
|
- break_reason(data.private_data);
|
|
|
- } else if (data.state == 'acw') {
|
|
|
- console.log('话后整理中');
|
|
|
- const time: number = AppConfigInfo.value.TalkingDealTime * 1000; // 事后处理时间
|
|
|
+ break_reason(data.private_data);
|
|
|
+ console.log('示忙中');
|
|
|
+ } else if (data.state == 'acw') {
|
|
|
+ // 话后整理中
|
|
|
+ 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(); // 示闲
|
|
|
+ }, time);
|
|
|
+ console.log('话后整理中');
|
|
|
+ } else if (data.state == 'busy') {
|
|
|
|
|
|
- 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 {
|
|
|
+ console.log(data.state, '其他状态');
|
|
|
+ }
|
|
|
|
|
|
- } else if (data.state == 'busy') {
|
|
|
- console.log('通话中');
|
|
|
- } else {
|
|
|
- console.log(data.state);
|
|
|
- }
|
|
|
+ if (data.state == 'busy') {
|
|
|
+ holdStatus(data.private_data); //处理保持
|
|
|
+ if (data.call_direction == 'outbound') {
|
|
|
+ // 呼出
|
|
|
+ if (data.private_data == 'calling') {
|
|
|
+ // 拨号中
|
|
|
+ // 设置电话状态 振铃中
|
|
|
+ useTelStatusStore.setPhoneControlState(TelStates.ring);
|
|
|
+ console.log('呼出拨号中');
|
|
|
+ } else if (data.private_data == 'answered') {
|
|
|
+ //振铃中
|
|
|
+ if (data.other_answered == false) {
|
|
|
+ // 设置电话状态 振铃中
|
|
|
+ useTelStatusStore.setPhoneControlState(TelStates.ring);
|
|
|
+ console.log('呼出振铃中');
|
|
|
+ } else if (data.other_answered == true) {
|
|
|
+ // 通话中
|
|
|
+ // 开始计时
|
|
|
+ startTime();
|
|
|
+ // 设置电话状态 通话中
|
|
|
+ useTelStatusStore.setPhoneControlState(TelStates.onCall);
|
|
|
+ console.log('呼出通话中');
|
|
|
+ }
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ // 呼入
|
|
|
+ if (data.private_data == 'ring') {
|
|
|
+ // 设置电话状态 振铃中
|
|
|
+ useTelStatusStore.setPhoneControlState(TelStates.ring);
|
|
|
+ console.log('呼入振铃中');
|
|
|
+ } else if (data.private_data == 'answered') {
|
|
|
+ // 开始计时
|
|
|
+ startTime();
|
|
|
+ // 设置电话状态 通话中
|
|
|
+ useTelStatusStore.setPhoneControlState(TelStates.onCall);
|
|
|
+ console.log('呼入通话中');
|
|
|
+ }
|
|
|
+ }
|
|
|
+ } else if (data.old_state == 'busy') {
|
|
|
+ //挂机后系统可以返回两种状态:acw 话后整理状态 ready 示闲状态,如果不需要acw,可以联系我们后台修改配置,如果需要保留,如果需要再次
|
|
|
+ //拨打电话的话,需要手动点击示闲按钮
|
|
|
|
|
|
- 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);
|
|
|
- }
|
|
|
+ // 设置电话状态
|
|
|
+ useTelStatusStore.setPhoneControlState(TelStates.dutyOn);
|
|
|
+ // 结束计时
|
|
|
+ removeTimer();
|
|
|
+ console.log('已挂机');
|
|
|
+ }
|
|
|
+ } 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('呼叫中心断开链接');
|
|
|
+ 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 'train':
|
|
|
- restReason.value = '培训中';
|
|
|
+ switch (reason) {
|
|
|
+ case 'away':
|
|
|
+ restReason.value = '外出中';
|
|
|
+ break;
|
|
|
+ case 'rest':
|
|
|
+ restReason.value = '休息中';
|
|
|
+ break;
|
|
|
+ case 'conference':
|
|
|
+ restReason.value = '会议中';
|
|
|
+ break;
|
|
|
+ case 'train':
|
|
|
+ restReason.value = '培训中';
|
|
|
+ break;
|
|
|
+ case 'eat':
|
|
|
+ restReason.value = '用餐中';
|
|
|
+ break;
|
|
|
+ default:
|
|
|
+ restReason.value = '休息中';
|
|
|
+ break;
|
|
|
+ }
|
|
|
+};
|
|
|
+// 保持状态处理
|
|
|
+const holdStatus = (holdStatus:string)=>{
|
|
|
+ switch (holdStatus) {
|
|
|
+ case 'held':
|
|
|
+ // 设置电话状态
|
|
|
+ useTelStatusStore.setHold(true);
|
|
|
+ // 设置电话状态 保持中
|
|
|
+ useTelStatusStore.setPhoneControlState(TelStates.onHold);
|
|
|
break;
|
|
|
- case 'eat':
|
|
|
- restReason.value = '用餐中';
|
|
|
+ case 'unheld':
|
|
|
+ // 设置电话状态 通话中
|
|
|
+ // 设置电话状态 取消单个保持为通话中
|
|
|
+ useTelStatusStore.setHold(false);
|
|
|
+ // 设置电话状态
|
|
|
+ useTelStatusStore.setPhoneControlState(TelStates.onCall);
|
|
|
break;
|
|
|
default:
|
|
|
- restReason.value = '休息中';
|
|
|
break;
|
|
|
}
|
|
|
-};
|
|
|
+}
|
|
|
//签入
|
|
|
const dutyFormRef = ref<RefType>();
|
|
|
const onDutyFn = async () => {
|
|
|
- websocket_connect();
|
|
|
+ websocket_connect();
|
|
|
/*dutyFormRef.value?.resetFields();
|
|
|
// 获取所有分机列表(未签入的)
|
|
|
const list = await getTelsLists({ sigin: 0 });
|
|
@@ -856,7 +904,7 @@ const clickOnDuty = (formEl: FormInstance | undefined) => {
|
|
|
if (!valid) return;
|
|
|
state.loading = true;
|
|
|
// {telNo:state.dutyForm.telNo}
|
|
|
- websocket_connect(); //开启消息监听
|
|
|
+ websocket_connect(); //开启消息监听
|
|
|
});
|
|
|
};
|
|
|
// 签出
|
|
@@ -875,7 +923,7 @@ const offDutyFn = () => {
|
|
|
// 重置所有状态
|
|
|
useTelStatusStore.resetState();
|
|
|
state.loading = false;
|
|
|
- state.dutyOnSrc = getImageUrl('phoneControls/dutyOn_blue.png'); //签入图片
|
|
|
+ state.dutyOnSrc = getImageUrl('phoneControls/dutyOn_blue.png'); //签入图片
|
|
|
})
|
|
|
.catch(() => {
|
|
|
state.loading = false;
|
|
@@ -893,8 +941,8 @@ const onHangup = () => {
|
|
|
})
|
|
|
.then(() => {
|
|
|
state.loading = true;
|
|
|
- ola.hangup(); //挂断
|
|
|
- state.loading = false;
|
|
|
+ ola.hangup(); //挂断
|
|
|
+ state.loading = false;
|
|
|
})
|
|
|
.catch(() => {});
|
|
|
};
|
|
@@ -1010,7 +1058,7 @@ const onRestEnd = () => {
|
|
|
})
|
|
|
.then(() => {
|
|
|
state.loading = true;
|
|
|
- ola.go_ready(); // 示闲
|
|
|
+ ola.go_ready(); // 示闲
|
|
|
state.loading = false;
|
|
|
})
|
|
|
.catch(() => {});
|
|
@@ -1027,7 +1075,7 @@ const onHold = () => {
|
|
|
})
|
|
|
.then(() => {
|
|
|
state.loading = true;
|
|
|
- ola.hold(); //保持
|
|
|
+ ola.hold(); //保持
|
|
|
state.loading = false;
|
|
|
})
|
|
|
.catch(() => {});
|
|
@@ -1044,15 +1092,13 @@ const onUnHold = () => {
|
|
|
})
|
|
|
.then(() => {
|
|
|
state.loading = true;
|
|
|
- ola.hold(); //保持
|
|
|
+ ola.unhold(); //取消保持
|
|
|
state.loading = false;
|
|
|
})
|
|
|
.catch(() => {});
|
|
|
};
|
|
|
// 事后处理(系统默认进入)
|
|
|
-const onTalkingDeal = () => {
|
|
|
-
|
|
|
-};
|
|
|
+const onTalkingDeal = () => {};
|
|
|
// 取消事后处理
|
|
|
const unTalkingDeal = () => {
|
|
|
ElMessageBox.confirm(`确定要取消事后处理,是否继续?`, '提示', {
|
|
@@ -1065,11 +1111,11 @@ const unTalkingDeal = () => {
|
|
|
})
|
|
|
.then(() => {
|
|
|
state.loading = true;
|
|
|
- // 设置事后处理
|
|
|
- useTelStatusStore.setTalkingDeal(false);
|
|
|
- // 设置话机状态 取消事后处理修改为空闲状态
|
|
|
- useTelStatusStore.setPhoneControlState(TelStates.dutyOn);
|
|
|
- ola.go_ready(); // 示闲
|
|
|
+ // 设置事后处理
|
|
|
+ useTelStatusStore.setTalkingDeal(false);
|
|
|
+ // 设置话机状态 取消事后处理修改为空闲状态
|
|
|
+ useTelStatusStore.setPhoneControlState(TelStates.dutyOn);
|
|
|
+ ola.go_ready(); // 示闲
|
|
|
state.loading = false;
|
|
|
})
|
|
|
.catch(() => {});
|
|
@@ -1089,7 +1135,7 @@ const clickOnTransfer = (formEl: FormInstance | undefined) => {
|
|
|
if (!formEl) return;
|
|
|
formEl.validate((valid: boolean) => {
|
|
|
if (!valid) return;
|
|
|
- ola.transfer(state.transferForm.telNo); //转接
|
|
|
+ ola.transfer(state.transferForm.telNo); //转接
|
|
|
state.transferDialogVisible = false;
|
|
|
});
|
|
|
};
|
|
@@ -1135,21 +1181,8 @@ onMounted(() => {
|
|
|
signalRStart(); //开启消息监听
|
|
|
if (telStatusInfo.value.telsNo) {
|
|
|
// 有分机号
|
|
|
- websocket_connect(); // 链接呼叫中心
|
|
|
+ websocket_connect(); // 链接呼叫中心
|
|
|
}
|
|
|
- mittBus.on('startTalkTime', (message: string) => {
|
|
|
- // 开始计时
|
|
|
- startTime();
|
|
|
- });
|
|
|
- mittBus.on('endTalkTime', () => {
|
|
|
- // 结束计时
|
|
|
- removeTimer();
|
|
|
- });
|
|
|
-});
|
|
|
-onBeforeMount(() => {
|
|
|
- mittBus.off('startTalkTime'); // 移除监听
|
|
|
- mittBus.off('endTalkTime'); // 移除监听
|
|
|
- signalR.leaveGroup('CallCenter'); // 离开分组
|
|
|
});
|
|
|
</script>
|
|
|
|