|
@@ -1,12 +1,12 @@
|
|
|
<template>
|
|
|
<div class="phoneControls" v-loading="state.loading">
|
|
|
<div class="infos">
|
|
|
- <div class="pt5" :class="state.talkTime ? '' : 'mt8'"><span>分机号:</span>{{ telStatusInfo.telsNo }}</div>
|
|
|
- <div class="pt5" :class="state.talkTime ? '' : 'mt8'">
|
|
|
+ <div class="pt5" :class="talkTime ? '' : 'mt8'"><span>分机号:</span>{{ telStatusInfo.telsNo }}</div>
|
|
|
+ <div class="pt5" :class="talkTime ? '' : 'mt8'">
|
|
|
<span>状态:</span><b class="dutyOn_status">{{ currentStatusText }}</b>
|
|
|
</div>
|
|
|
- <div class="pt5" v-if="state.talkTime">
|
|
|
- <span>通话时长:</span><b class="dutyOn_timer">{{ formatDuration(state.talkTime, false) }}</b>
|
|
|
+ <div class="pt5" v-if="talkTime">
|
|
|
+ <span>通话时长:</span><b class="dutyOn_timer">{{ formatDuration(talkTime, false) }}</b>
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="btn">
|
|
@@ -246,7 +246,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.id" :label="item.content" :value="item.content" />
|
|
|
+ <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,12 +325,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.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-option v-for="item in state.restReasonOptions" :key="item.dicDataValue" :label="item.dicDataName" :value="item.dicDataValue" />
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
@@ -406,8 +401,7 @@ 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} from '/@/api/public/wex';
|
|
|
-import { commonList } from '/@/api/auxiliary/advice';
|
|
|
+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';
|
|
@@ -452,8 +446,6 @@ const state = reactive<any>({
|
|
|
// 外呼表单
|
|
|
telNo: null, //外呼号码
|
|
|
},
|
|
|
- talkTime: 0, //通话时长
|
|
|
- talkTimer: null, //通话时长定时器
|
|
|
dutyOnSrc: getImageUrl('phoneControls/dutyOn_blue.png'), //签入图片
|
|
|
dutyOffSrc: getImageUrl('phoneControls/dutyOff_blue.png'), //签出图片
|
|
|
hangupSrc: getImageUrl('phoneControls/hangup_blue.png'), //挂断图片
|
|
@@ -486,27 +478,29 @@ const { AppConfigInfo } = storeToRefs(appConfigStore); // 系统配置信息
|
|
|
const storesUserInfo = useUserInfo();
|
|
|
const { userInfos } = storeToRefs(storesUserInfo); // 用户信息
|
|
|
|
|
|
+const talkTime = ref<Number>(0);// 通话时长
|
|
|
+const talkTimer = ref<any>(null);// 通话时长定时器
|
|
|
// 开始计时
|
|
|
const startTime = debounce(() => {
|
|
|
let talkTime = Local.get('talkTime');
|
|
|
if (talkTime) {
|
|
|
- state.talkTime = Number(talkTime);
|
|
|
- state.talkTimer = setInterval(() => {
|
|
|
- state.talkTime++;
|
|
|
- Local.set('talkTime', String(state.talkTime));
|
|
|
+ talkTime.value = Number(talkTime);
|
|
|
+ talkTimer.value = setInterval(() => {
|
|
|
+ talkTime.value++;
|
|
|
+ Local.set('talkTime', String(talkTime.value));
|
|
|
}, 1000);
|
|
|
} else {
|
|
|
- state.talkTimer = setInterval(() => {
|
|
|
- state.talkTime++;
|
|
|
- Local.set('talkTime', String(state.talkTime));
|
|
|
+ talkTimer.value = setInterval(() => {
|
|
|
+ talkTime.value++;
|
|
|
+ Local.set('talkTime', String(talkTime.value));
|
|
|
}, 1000);
|
|
|
}
|
|
|
}, 1000);
|
|
|
// 结束计时
|
|
|
const removeTimer = debounce(() => {
|
|
|
- state.talkTime = 0;
|
|
|
+ talkTime.value = 0;
|
|
|
Local.remove('talkTime');
|
|
|
- clearInterval(state.talkTimer);
|
|
|
+ clearInterval(talkTimer.value);
|
|
|
}, 1000);
|
|
|
|
|
|
// signalR 初始化signalr
|
|
@@ -825,22 +819,21 @@ const break_reason = (reason: string) => {
|
|
|
restReason.value = '外出中';
|
|
|
break;
|
|
|
case 'rest':
|
|
|
- restReason.value = '小休中';
|
|
|
+ restReason.value = '休息中';
|
|
|
break;
|
|
|
case 'conference':
|
|
|
restReason.value = '会议中';
|
|
|
break;
|
|
|
- case 'trainning':
|
|
|
+ case 'train':
|
|
|
restReason.value = '培训中';
|
|
|
break;
|
|
|
- case 'coach':
|
|
|
- restReason.value = '辅导中';
|
|
|
+ case 'eat':
|
|
|
+ restReason.value = '用餐中';
|
|
|
break;
|
|
|
default:
|
|
|
- restReason.value = '示忙中';
|
|
|
+ restReason.value = '休息中';
|
|
|
break;
|
|
|
}
|
|
|
- console.log(restReason.value)
|
|
|
};
|
|
|
//签入
|
|
|
const dutyFormRef = ref<RefType>();
|
|
@@ -918,8 +911,8 @@ const onRest = async () => {
|
|
|
// 重置表单
|
|
|
restFormRef.value?.resetFields();
|
|
|
// 查询小休原因
|
|
|
- const response: any = await commonList({ commonType: commonEnum.RestReason });
|
|
|
- state.restReasonOptions = response.result;
|
|
|
+ const response: any = await telRestBaseData();
|
|
|
+ state.restReasonOptions = response.result?.restReason ?? [];
|
|
|
state.restDialogVisible = true;
|
|
|
};
|
|
|
// 打开弹窗清空表单
|