|
@@ -543,7 +543,7 @@ import { getDataByCode } from '@/api/system/dict';
|
|
|
import { useTransition, useDocumentVisibility } from '@vueuse/core';
|
|
|
import { useWebSocket } from '@/hooks/useWebsocket';
|
|
|
import { olaFn } from '@/utils/olaFn';
|
|
|
-import {useIntervalFn, useTimeoutFn} from '@vueuse/shared/index';
|
|
|
+import { useIntervalFn, useTimeoutFn } from '@vueuse/shared/index';
|
|
|
import { callCenterIsSignIn, callCenterWs } from '@/utils/callCenter';
|
|
|
// 引入组件
|
|
|
const CommonAdvice = defineAsyncComponent(() => import('@/components/CommonAdvice/index.vue')); // 常用意见
|
|
@@ -945,7 +945,7 @@ const onMessage = async (event: any) => {
|
|
|
callCenterIsSignIn.value = true; // 签入状态
|
|
|
// 设置分机号和坐席组
|
|
|
useTelStatusStore.setCallInfo({ telsNo: currentTel.value.telNo });
|
|
|
- setTimeout(() => {
|
|
|
+ useTimeoutFn(() => {
|
|
|
console.log(`当前话机模式:${currentTel.value.telModel} 1:普通模式 2:外呼模式`, getNowDateTime());
|
|
|
if (currentTel.value.telModel == 2) {
|
|
|
// 设置示闲状态
|
|
@@ -1049,20 +1049,17 @@ const onMessage = async (event: any) => {
|
|
|
// 设置话机状态 设置为话后整理中
|
|
|
useTelStatusStore.setPhoneControlState(TelStates.onTalkingDeal);
|
|
|
|
|
|
- talkDealTimer.value = useTimeoutFn(
|
|
|
- () => {
|
|
|
- console.log('1111')
|
|
|
- // 设置话后整理
|
|
|
- useTelStatusStore.setTalkingDeal(false);
|
|
|
- // 设置话机状态 取消话后整理修改为空闲状态
|
|
|
- useTelStatusStore.setPhoneControlState(TelStates.dutyOn);
|
|
|
- olaRef.value.go_ready(); // 示闲
|
|
|
- console.log('呼叫中心:调用示闲', getNowDateTime());
|
|
|
- onEndAcw(); // 挂机后整理结束
|
|
|
- talkDealTimer.value.stop();
|
|
|
- },
|
|
|
- time,
|
|
|
- );
|
|
|
+ talkDealTimer.value = useTimeoutFn(() => {
|
|
|
+ console.log('1111');
|
|
|
+ // 设置话后整理
|
|
|
+ useTelStatusStore.setTalkingDeal(false);
|
|
|
+ // 设置话机状态 取消话后整理修改为空闲状态
|
|
|
+ useTelStatusStore.setPhoneControlState(TelStates.dutyOn);
|
|
|
+ olaRef.value.go_ready(); // 示闲
|
|
|
+ console.log('呼叫中心:调用示闲', getNowDateTime());
|
|
|
+ onEndAcw(); // 挂机后整理结束
|
|
|
+ talkDealTimer.value.stop();
|
|
|
+ }, time);
|
|
|
|
|
|
console.log('呼叫中心:话后整理中', getNowDateTime());
|
|
|
// 如果不是话后整理中
|
|
@@ -1425,7 +1422,7 @@ const offDutyFn = () => {
|
|
|
sendMsg('logout');
|
|
|
olaRef.value.logout(currentTel.value.telNo); //签出
|
|
|
state.dutyOnSrc = getImageUrl('phoneControls/dutyOn_blue.png'); //签入图片
|
|
|
- setTimeout(() => {
|
|
|
+ useTimeoutFn(() => {
|
|
|
olaRef.value.close();
|
|
|
}, 500);
|
|
|
resetState();
|
|
@@ -1647,7 +1644,7 @@ const clickOnRest = (formEl: FormInstance | undefined) => {
|
|
|
} else {
|
|
|
//不需要审核直接开始小休
|
|
|
olaRef.value.go_break(state.restForm.reason); //设置忙碌
|
|
|
- talkDealTimer.value.stop();
|
|
|
+ talkDealTimer.value.stop();
|
|
|
console.log('呼叫中心:调用示忙', getNowDateTime());
|
|
|
state.restDialogVisible = false;
|
|
|
state.loading = false;
|
|
@@ -1798,7 +1795,7 @@ const unTalkingDeal = () => {
|
|
|
// 设置话机状态 取消话后整理修改为空闲状态
|
|
|
useTelStatusStore.setPhoneControlState(TelStates.dutyOn);
|
|
|
olaRef.value.go_ready(); // 示闲
|
|
|
- talkDealTimer.value.stop();
|
|
|
+ talkDealTimer.value.stop();
|
|
|
onEndAcw(); // 挂机后整理结束
|
|
|
isAcw.value = false;
|
|
|
console.log('呼叫中心:调用示闲', getNowDateTime());
|
|
@@ -1878,7 +1875,7 @@ const clickOnOutbound = (formEl: FormInstance | undefined) => {
|
|
|
formEl.validate((valid: boolean) => {
|
|
|
if (!valid) return;
|
|
|
state.loading = true;
|
|
|
- setTimeout(() => {
|
|
|
+ useTimeoutFn(() => {
|
|
|
olaRef.value.dial(state.outboundForm.telNo);
|
|
|
state.outboundDialogVisible = false;
|
|
|
state.loading = false;
|
|
@@ -2010,7 +2007,7 @@ const resetState = () => {
|
|
|
useTelStatusStore.resetState();
|
|
|
stopSignTime(); // 移除签入时长定时器
|
|
|
stopTalkTimer(); // 移除通话计时器
|
|
|
- talkDealTimer.value.stop();
|
|
|
+ talkDealTimer.value.stop();
|
|
|
state.loading = false;
|
|
|
};
|
|
|
// 获取当前分机状态
|