|
@@ -169,7 +169,7 @@
|
|
|
|
|
|
<!-- 三方会议 可用(两个通话 一个取消保持 一个保持 才能使用三方通话) -->
|
|
|
<!-- && activeArr.includes('conference') -->
|
|
|
- <template v-if="telStatusInfo.isDutyOn">
|
|
|
+ <template v-if="telStatusInfo.isDutyOn && activeArr.includes('conference')">
|
|
|
<div
|
|
|
class="item active"
|
|
|
@mouseenter="onHover('conferenceSrc', 'phoneControls/conference_white.png')"
|
|
@@ -210,9 +210,8 @@
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
-
|
|
|
<!-- 评价 可用 来电才可以评价 callType === 3 -->
|
|
|
-<!-- <template v-if="telStatusInfo.isDutyOn && activeArr.includes('evaluate') && telStatusInfo.telType === 3">
|
|
|
+ <!-- <template v-if="telStatusInfo.isDutyOn && activeArr.includes('evaluate') && telStatusInfo.telType === 3">
|
|
|
<div
|
|
|
class="item active"
|
|
|
@mouseenter="onHover('evaluateSrc', 'phoneControls/evaluate_white.png')"
|
|
@@ -225,7 +224,7 @@
|
|
|
</div>
|
|
|
</template>-->
|
|
|
<!-- 评价 不可用 -->
|
|
|
-<!-- <template v-else>
|
|
|
+ <!-- <template v-else>
|
|
|
<div class="item disabled" title="评价">
|
|
|
<img :src="getImageUrl('phoneControls/evaluate_grey.png')" alt="" />
|
|
|
<span>评价</span>
|
|
@@ -240,13 +239,7 @@
|
|
|
<el-dialog v-model="state.dutyDialogVisible" draggable title="签入" width="500px" :show-close="false">
|
|
|
<el-form :model="state.dutyForm" label-width="80px" ref="dutyFormRef">
|
|
|
<el-form-item label="分机" prop="telNo" :rules="[{ required: true, message: '请选择需要签入的分机', trigger: 'change' }]">
|
|
|
- <el-select-v2
|
|
|
- v-model="state.dutyForm.telNo"
|
|
|
- :options="state.telsList"
|
|
|
- placeholder="选择要签入的分机"
|
|
|
- filterable
|
|
|
- class="w100"
|
|
|
- />
|
|
|
+ <el-select-v2 v-model="state.dutyForm.telNo" :options="state.telsList" placeholder="选择要签入的分机" filterable class="w100" />
|
|
|
</el-form-item>
|
|
|
</el-form>
|
|
|
<template #footer>
|
|
@@ -266,7 +259,7 @@
|
|
|
:width="AppConfigInfo.IsRestApproval ? '60%' : '500px'"
|
|
|
@mouseup="mouseup"
|
|
|
:style="'transform: ' + state.transform + ';'"
|
|
|
- @opend="restFormOpened"
|
|
|
+ @opend="restFormOpened"
|
|
|
>
|
|
|
<!-- 需要审核 -->
|
|
|
<template v-if="AppConfigInfo.IsRestApproval">
|
|
@@ -319,25 +312,29 @@
|
|
|
<el-checkbox v-model="state.restForm.acceptSms" label="短信通知" />
|
|
|
</el-form-item>
|
|
|
</el-col> -->
|
|
|
- <el-col :xs="24" :sm="12" :md="12" :lg="8" :xl="8">
|
|
|
- <el-form-item label="是否发起会签" prop="isStartCountersign" :rules="[{ required: false, message: '请选择是否发起会签', trigger: 'change' }]">
|
|
|
- <el-switch v-model="state.restForm.isStartCountersign" inline-prompt active-text="是" inactive-text="否" />
|
|
|
- </el-form-item>
|
|
|
- </el-col>
|
|
|
+ <el-col :xs="24" :sm="12" :md="12" :lg="8" :xl="8">
|
|
|
+ <el-form-item
|
|
|
+ label="是否发起会签"
|
|
|
+ prop="isStartCountersign"
|
|
|
+ :rules="[{ required: false, message: '请选择是否发起会签', trigger: 'change' }]"
|
|
|
+ >
|
|
|
+ <el-switch v-model="state.restForm.isStartCountersign" inline-prompt active-text="是" inactive-text="否" />
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
<el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24">
|
|
|
<el-form-item label="办理意见" prop="opinion" :rules="[{ required: true, message: '请填写小休办理意见', trigger: 'blur' }]">
|
|
|
- <Comment
|
|
|
- @chooseComment="chooseComment"
|
|
|
+ <common-advice
|
|
|
+ @chooseAdvice="chooseAdvice"
|
|
|
v-model="state.restForm.opinion"
|
|
|
- :loading="state.loading"
|
|
|
placeholder="请填写小休办理意见"
|
|
|
+ :loading="state.loading"
|
|
|
:commonEnum="commonEnum.RestReason"
|
|
|
/>
|
|
|
</el-form-item>
|
|
|
</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 />
|
|
|
+ <annex-list />
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
</el-row>
|
|
@@ -370,15 +367,15 @@
|
|
|
<el-dialog v-model="state.transferDialogVisible" draggable title="转接" width="500px">
|
|
|
<el-form :model="state.transferForm" label-width="100px" ref="transferFormRef">
|
|
|
<el-form-item label="转接号码" prop="telNo" :rules="[{ required: true, message: '请选择转接分机或输入外部电话', trigger: 'blur' }]">
|
|
|
- <el-select-v2
|
|
|
- v-model="state.transferForm.telNo"
|
|
|
- :options="state.telsList"
|
|
|
- placeholder="请选择转接分机或输入外部电话"
|
|
|
- filterable
|
|
|
- class="w100"
|
|
|
- allow-create
|
|
|
- default-first-option
|
|
|
- />
|
|
|
+ <el-select-v2
|
|
|
+ v-model="state.transferForm.telNo"
|
|
|
+ :options="state.telsList"
|
|
|
+ placeholder="请选择转接分机或输入外部电话"
|
|
|
+ filterable
|
|
|
+ class="w100"
|
|
|
+ allow-create
|
|
|
+ default-first-option
|
|
|
+ />
|
|
|
</el-form-item>
|
|
|
</el-form>
|
|
|
<template #footer>
|
|
@@ -393,15 +390,15 @@
|
|
|
<el-dialog v-model="state.outboundDialogVisible" draggable title="呼叫" width="450px">
|
|
|
<el-form :model="state.outboundForm" label-width="80px" ref="outboundFormRef">
|
|
|
<el-form-item label="呼叫号码" prop="telNo" :rules="[{ required: true, message: '请选择或输入呼叫号码', trigger: 'blur' }]">
|
|
|
- <el-select-v2
|
|
|
- v-model="state.outboundForm.telNo"
|
|
|
- :options="state.telsList"
|
|
|
- placeholder="请选择或输入呼叫号码"
|
|
|
- filterable
|
|
|
- class="w100"
|
|
|
- allow-create
|
|
|
- default-first-option
|
|
|
- />
|
|
|
+ <el-select-v2
|
|
|
+ v-model="state.outboundForm.telNo"
|
|
|
+ :options="state.telsList"
|
|
|
+ placeholder="请选择或输入呼叫号码"
|
|
|
+ filterable
|
|
|
+ class="w100"
|
|
|
+ allow-create
|
|
|
+ default-first-option
|
|
|
+ />
|
|
|
</el-form-item>
|
|
|
</el-form>
|
|
|
<template #footer>
|
|
@@ -432,72 +429,75 @@
|
|
|
</template>
|
|
|
|
|
|
<script setup lang="ts" name="telControl">
|
|
|
-import {reactive, ref, computed, watch, defineAsyncComponent, onMounted, onBeforeMount,} from 'vue';
|
|
|
+import { reactive, ref, computed, watch, defineAsyncComponent, onMounted, onBeforeMount } from 'vue';
|
|
|
import { useRouter } from 'vue-router';
|
|
|
-import {ElMessageBox, ElNotification, ElMessage, FormInstance} from 'element-plus';
|
|
|
+import { ElMessageBox, ElNotification, ElMessage, FormInstance } from 'element-plus';
|
|
|
import { storeToRefs } from 'pinia';
|
|
|
-import { useTelStatus,TelStates, RestStates } from '/@/stores/telStatus';
|
|
|
+import { useTelStatus, TelStates, RestStates } from '/@/stores/telStatus';
|
|
|
import { useUserInfo } from '/@/stores/userInfo';
|
|
|
import { useAppConfig } from '/@/stores/appConfig';
|
|
|
-import {debounce, getImageUrl} from '/@/utils/tools';
|
|
|
+import { debounce, 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 } from '/@/api/public/wex'
|
|
|
+import { restFlowStart, restFlowDel, restFlowStartWex, getTelList } from '/@/api/public/wex';
|
|
|
import { commonList } from '/@/api/business/commonP';
|
|
|
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 { Local } from '/@/utils/storage';
|
|
|
const storesUserInfo = useUserInfo();
|
|
|
const { userInfos } = storeToRefs(storesUserInfo);
|
|
|
+
|
|
|
// 引入组件
|
|
|
-const Comment = defineAsyncComponent(() => import('/@/views/business/order/components/Order-comment.vue'));
|
|
|
+const CommonAdvice = defineAsyncComponent(() => import('/@/components/CommonAdvice/index.vue')); // 常用意见
|
|
|
const AnnexList = defineAsyncComponent(() => import('/@/components/AnnexList/index.vue'));
|
|
|
|
|
|
const state = reactive<any>({
|
|
|
active: <EmptyArrayType>[], // 当前选中
|
|
|
currentStatus: '', //当前通话状态
|
|
|
dutyDialogVisible: false, //签入选分机弹窗
|
|
|
- dutyForm: { //签入选分机表单
|
|
|
+ dutyForm: {
|
|
|
+ //签入选分机表单
|
|
|
telNo: null, //分机号
|
|
|
},
|
|
|
telsList: <EmptyArrayType>[], // 分机列表
|
|
|
loading: false,
|
|
|
showHangupList: false, //是否展示挂断列表
|
|
|
restDialogVisible: false, //小休弹窗
|
|
|
- restForm: {//小休表单
|
|
|
- opinion: '',//小休原因
|
|
|
+ restForm: {
|
|
|
+ //小休表单
|
|
|
+ opinion: '', //小休原因
|
|
|
nextStepCode: '', //下一步
|
|
|
nextHandlers: [], //下一步处理人
|
|
|
acceptSms: false, //是否接收短信
|
|
|
- nextMainHandler: '',//下一步主办人
|
|
|
+ nextMainHandler: '', //下一步主办人
|
|
|
reason: '', //小休原因
|
|
|
- expiredTime: '', //期满时间
|
|
|
- isStartCountersign: false, //是否发起会签
|
|
|
+ expiredTime: '', //期满时间
|
|
|
+ isStartCountersign: false, //是否发起会签
|
|
|
},
|
|
|
handlerMainOptions: [], // 主办
|
|
|
- transferDialogVisible: false, // 转接弹窗
|
|
|
+ transferDialogVisible: false, // 转接弹窗
|
|
|
transferForm: {
|
|
|
//转接表单
|
|
|
telNo: null,
|
|
|
},
|
|
|
outboundDialogVisible: false, //外呼弹窗
|
|
|
- outboundForm: { // 外呼表单
|
|
|
+ outboundForm: {
|
|
|
+ // 外呼表单
|
|
|
telNo: null, //外呼号码
|
|
|
},
|
|
|
- talkTime:0, //通话时长
|
|
|
- talkTimer:null, //通话时长定时器
|
|
|
+ talkTime: 0, //通话时长
|
|
|
+ talkTimer: null, //通话时长定时器
|
|
|
dutyOnSrc: getImageUrl('phoneControls/dutyOn_blue.png'), //签入图片
|
|
|
dutyOffSrc: getImageUrl('phoneControls/dutyOff_blue.png'), //签出图片
|
|
|
hangupSrc: getImageUrl('phoneControls/hangup_blue.png'), //挂断图片
|
|
|
restSrc: getImageUrl('phoneControls/rest_blue.png'), //小休图片
|
|
|
holdSrc: getImageUrl('phoneControls/hold_blue.png'), //保持图片
|
|
|
- talkingDealSrc: getImageUrl('phoneControls/talkingDeal_blue.png'), //时候处理图片
|
|
|
+ talkingDealSrc: getImageUrl('phoneControls/talkingDeal_blue.png'), //时候处理图片
|
|
|
transferSrc: getImageUrl('phoneControls/transfer_blue.png'), //转接图片
|
|
|
conferenceSrc: getImageUrl('phoneControls/conference_blue.png'), //三方会议图片
|
|
|
outboundSrc: getImageUrl('phoneControls/outbound_blue.png'), //外呼图片
|
|
@@ -509,7 +509,8 @@ const state = reactive<any>({
|
|
|
transform: 'translate(0px, 0px)',
|
|
|
fileList: [], // 文件上传列表
|
|
|
metingDialogVisible: false, // 三方会议弹窗
|
|
|
- metingForm: {// 三方会议表单
|
|
|
+ metingForm: {
|
|
|
+ // 三方会议表单
|
|
|
metingId: '', // 三方会议ID
|
|
|
phoneNo: '', // 三方会议号码
|
|
|
},
|
|
@@ -528,25 +529,25 @@ const router = useRouter();
|
|
|
|
|
|
// 开始计时
|
|
|
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));
|
|
|
- }, 1000);
|
|
|
- } else {
|
|
|
- state.talkTimer = setInterval(() => {
|
|
|
- state.talkTime++;
|
|
|
- Local.set('talkTime', String(state.talkTime));
|
|
|
- }, 1000);
|
|
|
- }
|
|
|
+ let talkTime = Local.get('talkTime');
|
|
|
+ if (talkTime) {
|
|
|
+ state.talkTime = Number(talkTime);
|
|
|
+ state.talkTimer = setInterval(() => {
|
|
|
+ state.talkTime++;
|
|
|
+ Local.set('talkTime', String(state.talkTime));
|
|
|
+ }, 1000);
|
|
|
+ } else {
|
|
|
+ state.talkTimer = setInterval(() => {
|
|
|
+ state.talkTime++;
|
|
|
+ Local.set('talkTime', String(state.talkTime));
|
|
|
+ }, 1000);
|
|
|
+ }
|
|
|
}, 1000);
|
|
|
// 结束计时
|
|
|
const removeTimer = debounce(() => {
|
|
|
- state.talkTime = 0;
|
|
|
- Local.remove('talkTime');
|
|
|
- clearInterval(state.talkTimer);
|
|
|
+ state.talkTime = 0;
|
|
|
+ Local.remove('talkTime');
|
|
|
+ clearInterval(state.talkTimer);
|
|
|
}, 1000);
|
|
|
|
|
|
// 小休审批通过消息
|
|
@@ -560,16 +561,18 @@ const RestApplyPassFn = (data: any) => {
|
|
|
};
|
|
|
// 链接websocket
|
|
|
const initWebsocket = () => {
|
|
|
- if(!userInfos.value.staffNo){
|
|
|
- ElMessage.warning('账号暂无工号,请设置工号后重新登录后重试');
|
|
|
- return;
|
|
|
- }
|
|
|
- let telNo:string|number;
|
|
|
- if(telStatusInfo.value.isDutyOn){ // 如果已签入
|
|
|
- telNo = telStatusInfo.value.telsNo;
|
|
|
- }else{ // 如果未签入
|
|
|
- telNo = state.dutyForm.telNo;
|
|
|
- }
|
|
|
+ if (!userInfos.value.staffNo) {
|
|
|
+ ElMessage.warning('账号暂无工号,请设置工号后重新登录后重试');
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ let telNo: string | number;
|
|
|
+ if (telStatusInfo.value.isDutyOn) {
|
|
|
+ // 如果已签入
|
|
|
+ telNo = telStatusInfo.value.telsNo;
|
|
|
+ } else {
|
|
|
+ // 如果未签入
|
|
|
+ telNo = state.dutyForm.telNo;
|
|
|
+ }
|
|
|
// 设置变量
|
|
|
VoiceInterfaceObject.SetSendModel({
|
|
|
GongHao: userInfos.value.staffNo,
|
|
@@ -588,7 +591,8 @@ const initWebsocket = () => {
|
|
|
onOpen: async () => {
|
|
|
//登录语音系统
|
|
|
VoiceInterfaceObject.Login();
|
|
|
- await checkTelStatus(); // 检查签入状态
|
|
|
+ VoiceInterfaceObject.GetOnUserState(); //获取用户状态
|
|
|
+ await checkTelStatus(); // 检查签入状态
|
|
|
},
|
|
|
onMessage: (e: any) => {
|
|
|
// 收到消息调用方法
|
|
@@ -606,7 +610,7 @@ const initWebsocket = () => {
|
|
|
};
|
|
|
//初始化WebSocket
|
|
|
WebsocketInterface(wsParams);
|
|
|
- return Promise.resolve();
|
|
|
+ return Promise.resolve();
|
|
|
};
|
|
|
|
|
|
// signalR 初始化signalr
|
|
@@ -635,9 +639,9 @@ const activeArr = computed(() => {
|
|
|
ring: ['hangup'], //振铃中
|
|
|
onCall: ['hangup', 'hold', 'transfer', 'evaluate'], // 单个通话中
|
|
|
onHold: ['hangup', 'hold', 'transfer', 'evaluate'], // 保持中
|
|
|
- oneHoldOneCall: ['hangup', 'hold', 'transfer', 'conference'], // 通话一保持通话二通话中(可用三方通话)
|
|
|
- onTalkingDeal: ['dutyOff', 'rest', 'outbound', 'callForwarding','TalkingDeal'], // 事后处理中
|
|
|
- onConference: ['hangup', 'hold', 'transfer', 'conference'], // 三方会议中
|
|
|
+ onTalkingDeal: ['dutyOff', 'rest', 'outbound', 'callForwarding', 'TalkingDeal'], // 事后处理中
|
|
|
+ onTransferSuccess:['hangup','conference'], // 转接成功
|
|
|
+ onConference: ['hangup'], // 三方会议中 只能挂断
|
|
|
};
|
|
|
let arr = <EmptyArrayType>[];
|
|
|
if (telStatusInfo.value.phoneControlState in switchCases) {
|
|
@@ -654,26 +658,26 @@ const currentStatusText = computed(() => {
|
|
|
ring: '振铃中',
|
|
|
onHold: '保持中',
|
|
|
onCall: '通话中',
|
|
|
- oneCallHold: '通话保持',
|
|
|
onTalkingDeal: '事后处理',
|
|
|
onConference: '会议中',
|
|
|
+ onTransferSuccess:'转接成功'
|
|
|
};
|
|
|
return statusMap[telStatusInfo.value.phoneControlState] || '';
|
|
|
});
|
|
|
// 查询所有分机
|
|
|
-const getTelsLists = async (object?:object) => {
|
|
|
- try {
|
|
|
- const res: any = await getTelList(object);
|
|
|
- state.telsList = res?.data ?? [];
|
|
|
- state.telsList = state.telsList.map((item: any) => ({
|
|
|
- value: item.device,
|
|
|
- label: item.device,
|
|
|
- ...item
|
|
|
- }))
|
|
|
- return Promise.resolve(state.telsList);
|
|
|
- }catch(err){
|
|
|
- console.log(err);
|
|
|
- }
|
|
|
+const getTelsLists = async (object?: object) => {
|
|
|
+ try {
|
|
|
+ const res: any = await getTelList(object);
|
|
|
+ state.telsList = res?.data ?? [];
|
|
|
+ state.telsList = state.telsList.map((item: any) => ({
|
|
|
+ value: item.device,
|
|
|
+ label: item.device,
|
|
|
+ ...item,
|
|
|
+ }));
|
|
|
+ return Promise.resolve(state.telsList);
|
|
|
+ } catch (err) {
|
|
|
+ console.log(err);
|
|
|
+ }
|
|
|
};
|
|
|
// 鼠标移入移出改变图标
|
|
|
const onHover = (val: string, path: string) => {
|
|
@@ -746,26 +750,27 @@ const onControlClick = (val: string) => {
|
|
|
const onDutyFn = async () => {
|
|
|
dutyFormRef.value?.resetFields();
|
|
|
// 获取所有分机列表(未签入的)
|
|
|
- const list = await getTelsLists({sigin:0});
|
|
|
- const isDefaultTelNo = list.some((item: any) => item.value === userInfos.value.defaultTelNo);
|
|
|
- if(isDefaultTelNo) { // 如果默认分机号是空闲的,就默认选中
|
|
|
- state.dutyForm.telNo = userInfos.value.defaultTelNo;
|
|
|
- }
|
|
|
+ const list = await getTelsLists({ sigin: 0 });
|
|
|
+ const isDefaultTelNo = list.some((item: any) => item.value === userInfos.value.defaultTelNo);
|
|
|
+ if (isDefaultTelNo) {
|
|
|
+ // 如果默认分机号是空闲的,就默认选中
|
|
|
+ state.dutyForm.telNo = userInfos.value.defaultTelNo;
|
|
|
+ }
|
|
|
state.dutyDialogVisible = true;
|
|
|
};
|
|
|
// 确认签入
|
|
|
const clickOnDuty = (formEl: FormInstance | undefined) => {
|
|
|
- if(!formEl) return;
|
|
|
- formEl.validate((valid: boolean) => {
|
|
|
- if (!valid) return;
|
|
|
- state.loading = true;
|
|
|
- // {telNo:state.dutyForm.telNo}
|
|
|
- setTimeout(() => {
|
|
|
- state.loading = false;
|
|
|
- state.dutyDialogVisible = false;
|
|
|
- initWebsocket(); //开启消息监听
|
|
|
- }, 300);
|
|
|
- })
|
|
|
+ if (!formEl) return;
|
|
|
+ formEl.validate((valid: boolean) => {
|
|
|
+ if (!valid) return;
|
|
|
+ state.loading = true;
|
|
|
+ // {telNo:state.dutyForm.telNo}
|
|
|
+ setTimeout(() => {
|
|
|
+ state.loading = false;
|
|
|
+ state.dutyDialogVisible = false;
|
|
|
+ initWebsocket(); //开启消息监听
|
|
|
+ }, 300);
|
|
|
+ });
|
|
|
};
|
|
|
// 签出
|
|
|
const offDutyFn = () => {
|
|
@@ -821,8 +826,8 @@ const onRest = async () => {
|
|
|
};
|
|
|
// 打开弹窗清空表单
|
|
|
const restFormOpened = () => {
|
|
|
- restFormRef.value?.resetFields();
|
|
|
- restFormRef.value?.clearValidate();
|
|
|
+ restFormRef.value?.resetFields();
|
|
|
+ restFormRef.value?.clearValidate();
|
|
|
};
|
|
|
// 小休流程选择下一个环节
|
|
|
const selectNextStep = (val: any) => {
|
|
@@ -848,68 +853,57 @@ state.handlerMainOptions = computed(() => {
|
|
|
});
|
|
|
// 确定小休(示忙)
|
|
|
const clickOnRest = (formEl: FormInstance | undefined) => {
|
|
|
- if (!formEl) return;
|
|
|
- formEl.validate((valid: boolean) => {
|
|
|
- if (!valid) return;
|
|
|
- ElMessageBox.confirm(`确认提交?`, '提示', {
|
|
|
- confirmButtonText: '确认',
|
|
|
- cancelButtonText: '取消',
|
|
|
- type: 'warning',
|
|
|
- draggable: true,
|
|
|
- cancelButtonClass: 'default-button',
|
|
|
- autofocus: false,
|
|
|
- })
|
|
|
- .then(() => {
|
|
|
- state.loading = true;
|
|
|
- if (AppConfigInfo.value.IsRestApproval) {
|
|
|
- //如果需要审核
|
|
|
- state.restForm.additions = state.fileList;
|
|
|
- let submitObj = other.deepClone(state.restForm);
|
|
|
- if (submitObj.nextHandlers && submitObj.nextHandlers.length) {
|
|
|
- submitObj.nextHandlers = submitObj.nextHandlers.map((item: any) => {
|
|
|
- return {
|
|
|
- id: item.key,
|
|
|
- name: item.value,
|
|
|
- };
|
|
|
- });
|
|
|
- if (submitObj.nextHandlers.length === 1) {
|
|
|
- submitObj.nextMainHandler = submitObj.nextHandlers[0].id;
|
|
|
- }
|
|
|
- }
|
|
|
- restFlowStartWex(submitObj)
|
|
|
- .then(() => {
|
|
|
- ElNotification({
|
|
|
- title: '成功',
|
|
|
- message: '申请小休成功',
|
|
|
- type: 'success',
|
|
|
- });
|
|
|
- // 设置休息状态 审核中
|
|
|
- useTelStatusStore.setRest(RestStates.InReview);
|
|
|
- state.restDialogVisible = false;
|
|
|
- state.loading = false;
|
|
|
- })
|
|
|
- .catch(() => {
|
|
|
- restFlowDel().then(() => {
|
|
|
- state.loading = false;
|
|
|
- state.restDialogVisible = false;
|
|
|
- });
|
|
|
- });
|
|
|
- } else {
|
|
|
- //不需要审核直接开始小休
|
|
|
- VoiceInterfaceObject.SetBusy(state.restForm.reason); //设置忙碌
|
|
|
- state.restDialogVisible = false;
|
|
|
- state.loading = false;
|
|
|
- }
|
|
|
- })
|
|
|
- .catch(() => {});
|
|
|
- })
|
|
|
+ if (!formEl) return;
|
|
|
+ formEl.validate((valid: boolean) => {
|
|
|
+ if (!valid) return;
|
|
|
+ state.loading = true;
|
|
|
+ if (AppConfigInfo.value.IsRestApproval) {
|
|
|
+ //如果需要审核
|
|
|
+ state.restForm.additions = state.fileList;
|
|
|
+ let submitObj = other.deepClone(state.restForm);
|
|
|
+ if (submitObj.nextHandlers && submitObj.nextHandlers.length) {
|
|
|
+ submitObj.nextHandlers = submitObj.nextHandlers.map((item: any) => {
|
|
|
+ return {
|
|
|
+ id: item.key,
|
|
|
+ name: item.value,
|
|
|
+ };
|
|
|
+ });
|
|
|
+ if (submitObj.nextHandlers.length === 1) {
|
|
|
+ submitObj.nextMainHandler = submitObj.nextHandlers[0].id;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ restFlowStartWex(submitObj)
|
|
|
+ .then(() => {
|
|
|
+ ElNotification({
|
|
|
+ title: '成功',
|
|
|
+ message: '申请小休成功',
|
|
|
+ type: 'success',
|
|
|
+ });
|
|
|
+ // 设置休息状态 审核中
|
|
|
+ useTelStatusStore.setRest(RestStates.InReview);
|
|
|
+ state.restDialogVisible = false;
|
|
|
+ state.loading = false;
|
|
|
+ })
|
|
|
+ .catch(() => {
|
|
|
+ restFlowDel().then(() => {
|
|
|
+ state.loading = false;
|
|
|
+ state.restDialogVisible = false;
|
|
|
+ });
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ //不需要审核直接开始小休
|
|
|
+ VoiceInterfaceObject.SetBusy(state.restForm.reason); //设置忙碌
|
|
|
+ state.restDialogVisible = false;
|
|
|
+ state.loading = false;
|
|
|
+ }
|
|
|
+ });
|
|
|
};
|
|
|
// 设置抽屉
|
|
|
const mouseup = () => {
|
|
|
state.transform = dialogRestRef.value.dialogContentRef.$el.style.transform;
|
|
|
};
|
|
|
// 选择常用意见 填入填写框
|
|
|
-const chooseComment = (item: any) => {
|
|
|
+const chooseAdvice = (item: any) => {
|
|
|
state.restForm.opinion += item.content;
|
|
|
};
|
|
|
// 小休结束
|
|
@@ -999,60 +993,54 @@ const unTalkingDeal = () => {
|
|
|
useTelStatusStore.setTalkingDeal(false);
|
|
|
// 设置话机状态 取消时候处理修改为空闲状态
|
|
|
useTelStatusStore.setPhoneControlState(TelStates.dutyOn);
|
|
|
- VoiceInterfaceObject.EndTalkingDeal(); //结束事后处理
|
|
|
+ VoiceInterfaceObject.EndTalkingDeal(); //结束事后处理
|
|
|
state.loading = false;
|
|
|
})
|
|
|
.catch(() => {});
|
|
|
};
|
|
|
// 打开转接弹窗
|
|
|
const onTransfer = () => {
|
|
|
- // 重置表单
|
|
|
- transferFormRef.value?.resetFields();
|
|
|
+ // 重置表单
|
|
|
+ transferFormRef.value?.resetFields();
|
|
|
// 获取所有分机列表
|
|
|
getTelsLists();
|
|
|
state.transferDialogVisible = true;
|
|
|
};
|
|
|
// 确认转接
|
|
|
const clickOnTransfer = (formEl: FormInstance | undefined) => {
|
|
|
- if (!formEl) return;
|
|
|
- formEl.validate((valid: boolean) => {
|
|
|
- if (!valid) return;
|
|
|
- VoiceInterfaceObject.TeleSwitch(state.transferForm.telNo);
|
|
|
- state.transferDialogVisible = false;
|
|
|
- })
|
|
|
+ if (!formEl) return;
|
|
|
+ formEl.validate((valid: boolean) => {
|
|
|
+ if (!valid) return;
|
|
|
+ VoiceInterfaceObject.TeleSwitch(state.transferForm.telNo);
|
|
|
+ state.transferDialogVisible = false;
|
|
|
+ });
|
|
|
};
|
|
|
// 三方会议开始
|
|
|
const onConference = () => {
|
|
|
- // state.loading = true;
|
|
|
- state.metingDialogVisible = true;
|
|
|
- // meeting({ telNo: telStatusInfo.value.telsNo })
|
|
|
- // .then(() => {
|
|
|
- // ElNotification({
|
|
|
- // title: '成功',
|
|
|
- // message: '三方会议开始',
|
|
|
- // type: 'success',
|
|
|
- // });
|
|
|
- // // 设置三方会议状态
|
|
|
- // useTelStatusStore.setMetTing(true);
|
|
|
- // // 设置话机状态 取消静音修改为会议状态
|
|
|
- // useTelStatusStore.setPhoneControlState(TelStates.onConference);
|
|
|
- // state.loading = false;
|
|
|
- // })
|
|
|
- // .catch(() => {
|
|
|
- // state.loading = false;
|
|
|
- // });
|
|
|
+ ElMessageBox.confirm(`确定确定要开启三方会议,是否继续?`, '提示', {
|
|
|
+ confirmButtonText: '确认',
|
|
|
+ cancelButtonText: '取消',
|
|
|
+ type: 'warning',
|
|
|
+ draggable: true,
|
|
|
+ cancelButtonClass: 'default-button',
|
|
|
+ autofocus: false,
|
|
|
+ })
|
|
|
+ .then(() => {
|
|
|
+ VoiceInterfaceObject.Dtmf('0'); // 开启dtmf 三方通话
|
|
|
+ })
|
|
|
+ .catch(() => {});
|
|
|
};
|
|
|
const onMetingSubmit = (formEl: FormInstance | undefined) => {
|
|
|
- if (!formEl) return;
|
|
|
- formEl.validate((valid: boolean) => {
|
|
|
- if (!valid) return;
|
|
|
- state.loading = true;
|
|
|
- setTimeout(() => {
|
|
|
- VoiceInterfaceObject.StartMeeting(state.metingForm.metingId, state.metingForm.phoneNo);
|
|
|
- state.metingDialogVisible = false;
|
|
|
- state.loading = false;
|
|
|
- }, 300);
|
|
|
- })
|
|
|
+ if (!formEl) return;
|
|
|
+ formEl.validate((valid: boolean) => {
|
|
|
+ if (!valid) return;
|
|
|
+ state.loading = true;
|
|
|
+ setTimeout(() => {
|
|
|
+ VoiceInterfaceObject.StartMeeting(state.metingForm.metingId, state.metingForm.phoneNo);
|
|
|
+ state.metingDialogVisible = false;
|
|
|
+ state.loading = false;
|
|
|
+ }, 300);
|
|
|
+ });
|
|
|
};
|
|
|
// 确定要结束三方会议
|
|
|
const onConferenceEnd = () => {
|
|
@@ -1088,16 +1076,16 @@ const onOutbound = () => {
|
|
|
};
|
|
|
// 外呼保存
|
|
|
const clickOnOutbound = (formEl: FormInstance | undefined) => {
|
|
|
- if (!formEl) return;
|
|
|
- formEl.validate((valid: boolean) => {
|
|
|
- if (!valid) return;
|
|
|
- state.loading = true;
|
|
|
- setTimeout(() => {
|
|
|
- VoiceInterfaceObject.DialOut(state.outboundForm.telNo);
|
|
|
- state.outboundDialogVisible = false;
|
|
|
- state.loading = false;
|
|
|
- }, 300);
|
|
|
- })
|
|
|
+ if (!formEl) return;
|
|
|
+ formEl.validate((valid: boolean) => {
|
|
|
+ if (!valid) return;
|
|
|
+ state.loading = true;
|
|
|
+ setTimeout(() => {
|
|
|
+ VoiceInterfaceObject.DialOut(state.outboundForm.telNo);
|
|
|
+ state.outboundDialogVisible = false;
|
|
|
+ state.loading = false;
|
|
|
+ }, 300);
|
|
|
+ });
|
|
|
};
|
|
|
|
|
|
// 评价
|
|
@@ -1122,106 +1110,114 @@ watch(
|
|
|
console.log(`状态改变了:${oldVal}=====>${newVal}`);
|
|
|
}
|
|
|
);
|
|
|
-const checkTelStatus = async ()=>{ // 检查话机状态
|
|
|
- let telNo:string|number;
|
|
|
- if(telStatusInfo.value.isDutyOn){ // 如果已签入
|
|
|
- telNo = telStatusInfo.value.telsNo;
|
|
|
- }else{ // 如果未签入
|
|
|
- telNo = state.dutyForm.telNo;
|
|
|
- }
|
|
|
- const res = await getTelList({device:telNo});
|
|
|
- // {
|
|
|
- // "device":"8000", //设备
|
|
|
- // "psw":"Wex12345", //注册密码
|
|
|
- // "regGroup":"users", //注册组
|
|
|
- // "status":0,//分机状态 0离线 1空闲 2振铃 3通话 4值守 5保持 6响铃 7监听中 8会议呼叫中 9会议通话中 10会议禁言
|
|
|
- //
|
|
|
- // "callGuid":"",//呼叫标识
|
|
|
- // "meetId":"",//会议号码
|
|
|
- // "loginType":"",//登录方式
|
|
|
- // "sigin":0,//是否签入 0为签出 1签入
|
|
|
- // "agentStatus":0,//座席状态 1空闲 2振铃 3通话 4示忙 5保持 6响铃
|
|
|
- // "zloginer":"",//座席员
|
|
|
- // "zrole":"",//座席组
|
|
|
- // "zloginNumber":""//座席工号
|
|
|
- // },
|
|
|
- const agent:any = {
|
|
|
- 0:'签出',
|
|
|
- 1:'签入'
|
|
|
- }
|
|
|
- const telStatus:any = {
|
|
|
- 0:'离线',
|
|
|
- 1:'空闲',
|
|
|
- 2:'振铃',
|
|
|
- 3:'通话',
|
|
|
- 4:'值守',
|
|
|
- 5:'保持',
|
|
|
- 6:'响铃',
|
|
|
- 7:'监听中',
|
|
|
- 8:'会议呼叫中',
|
|
|
- 9:'会议通话中',
|
|
|
- 10:'会议禁言'
|
|
|
- }
|
|
|
- const {device,status,sigin} = res.data[0];
|
|
|
-console.log('是否签入:',agent[sigin],'分机状态:',telStatus[status],res.data[0])
|
|
|
- if(sigin === 1){ // 已签入
|
|
|
- switch (status) { // 以分机状态为准
|
|
|
- case 1: // 空闲
|
|
|
- // useTelStatusStore.resetCallInfo();// 重置电话信息
|
|
|
- // 设置分机号
|
|
|
- useTelStatusStore.setCallInfo({telsNo: device});
|
|
|
- // 设置签入状态
|
|
|
- useTelStatusStore.setDutyState(true);
|
|
|
- // 设置电话状态
|
|
|
- useTelStatusStore.setPhoneControlState(TelStates.dutyOn);
|
|
|
- break;
|
|
|
- case 2: // 振铃
|
|
|
- // 设置电话状态 振铃中
|
|
|
- useTelStatusStore.setPhoneControlState(TelStates.ring);
|
|
|
- break;
|
|
|
- case 3: // 通话
|
|
|
- console.log('通话中,121')
|
|
|
- // 开始计时
|
|
|
- startTime();
|
|
|
- // 设置电话状态 通话中
|
|
|
- useTelStatusStore.setPhoneControlState(TelStates.onCall);
|
|
|
- break;
|
|
|
- case 4: // 示忙
|
|
|
- // 设置电话状态小休中
|
|
|
- useTelStatusStore.setPhoneControlState(TelStates.rest);
|
|
|
- useTelStatusStore.setRest(RestStates.resting);
|
|
|
- break;
|
|
|
- case 5: // 保持
|
|
|
- // 设置电话状态
|
|
|
- useTelStatusStore.setHold(true);
|
|
|
- // 设置电话状态
|
|
|
- useTelStatusStore.setPhoneControlState(TelStates.onHold);
|
|
|
- break;
|
|
|
- case 6: // 响铃
|
|
|
- // useTelStatusStore.setPhoneControlState(TelStates.ringing);
|
|
|
- break;
|
|
|
- }
|
|
|
- }else{ // 未签入 重置电话控件状态
|
|
|
- // 重置所有状态
|
|
|
- useTelStatusStore.resetState();
|
|
|
- }
|
|
|
-}
|
|
|
+const checkTelStatus = async () => {
|
|
|
+ // 检查话机状态
|
|
|
+ let telNo: string | number;
|
|
|
+ if (telStatusInfo.value.isDutyOn) {
|
|
|
+ // 如果已签入
|
|
|
+ telNo = telStatusInfo.value.telsNo;
|
|
|
+ } else {
|
|
|
+ // 如果未签入
|
|
|
+ telNo = state.dutyForm.telNo;
|
|
|
+ }
|
|
|
+ const res = await getTelList({ device: telNo });
|
|
|
+ // {
|
|
|
+ // "device":"8000", //设备
|
|
|
+ // "psw":"Wex12345", //注册密码
|
|
|
+ // "regGroup":"users", //注册组
|
|
|
+ // "status":0,//分机状态 0离线 1空闲 2振铃 3通话 4值守 5保持 6响铃 7监听中 8会议呼叫中 9会议通话中 10会议禁言
|
|
|
+ //
|
|
|
+ // "callGuid":"",//呼叫标识
|
|
|
+ // "meetId":"",//会议号码
|
|
|
+ // "loginType":"",//登录方式
|
|
|
+ // "sigin":0,//是否签入 0为签出 1签入
|
|
|
+ // "agentStatus":0,//座席状态 1空闲 2振铃 3通话 4示忙 5保持 6响铃
|
|
|
+ // "zloginer":"",//座席员
|
|
|
+ // "zrole":"",//座席组
|
|
|
+ // "zloginNumber":""//座席工号
|
|
|
+ // },
|
|
|
+ const agent: any = {
|
|
|
+ 0: '签出',
|
|
|
+ 1: '签入',
|
|
|
+ };
|
|
|
+ const telStatus: any = {
|
|
|
+ 0: '离线',
|
|
|
+ 1: '空闲',
|
|
|
+ 2: '振铃',
|
|
|
+ 3: '通话',
|
|
|
+ 4: '值守',
|
|
|
+ 5: '保持',
|
|
|
+ 6: '响铃',
|
|
|
+ 7: '监听中',
|
|
|
+ 8: '会议呼叫中',
|
|
|
+ 9: '会议通话中',
|
|
|
+ 10: '会议禁言',
|
|
|
+ };
|
|
|
+ const { device, status, sigin } = res.data[0];
|
|
|
+ console.log('是否签入:', agent[sigin], '分机状态:', telStatus[status], res.data[0]);
|
|
|
+ if (sigin === 1) {
|
|
|
+ // 已签入
|
|
|
+ switch (
|
|
|
+ status // 以分机状态为准
|
|
|
+ ) {
|
|
|
+ case 1: // 空闲
|
|
|
+ // useTelStatusStore.resetCallInfo();// 重置电话信息
|
|
|
+ // 设置分机号
|
|
|
+ useTelStatusStore.setCallInfo({ telsNo: device });
|
|
|
+ // 设置签入状态
|
|
|
+ useTelStatusStore.setDutyState(true);
|
|
|
+ // 设置电话状态
|
|
|
+ useTelStatusStore.setPhoneControlState(TelStates.dutyOn);
|
|
|
+ break;
|
|
|
+ case 2: // 振铃
|
|
|
+ // 设置电话状态 振铃中
|
|
|
+ useTelStatusStore.setPhoneControlState(TelStates.ring);
|
|
|
+ break;
|
|
|
+ case 3: // 通话
|
|
|
+ console.log('通话中,121');
|
|
|
+ // 开始计时
|
|
|
+ startTime();
|
|
|
+ // 设置电话状态 通话中
|
|
|
+ useTelStatusStore.setPhoneControlState(TelStates.onCall);
|
|
|
+ break;
|
|
|
+ case 4: // 示忙
|
|
|
+ // 设置电话状态小休中
|
|
|
+ useTelStatusStore.setPhoneControlState(TelStates.rest);
|
|
|
+ useTelStatusStore.setRest(RestStates.resting);
|
|
|
+ break;
|
|
|
+ case 5: // 保持
|
|
|
+ // 设置电话状态
|
|
|
+ useTelStatusStore.setHold(true);
|
|
|
+ // 设置电话状态
|
|
|
+ useTelStatusStore.setPhoneControlState(TelStates.onHold);
|
|
|
+ break;
|
|
|
+ case 6: // 响铃
|
|
|
+ // useTelStatusStore.setPhoneControlState(TelStates.ringing);
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ // 未签入 重置电话控件状态
|
|
|
+ // 重置所有状态
|
|
|
+ useTelStatusStore.resetState();
|
|
|
+ }
|
|
|
+};
|
|
|
onMounted(() => {
|
|
|
- signalRStart(); //开启消息监听
|
|
|
- if(telStatusInfo.value.telsNo){// 有分机号
|
|
|
- initWebsocket(); // 初始化websocket
|
|
|
- }
|
|
|
- mittBus.on('startTalkTime', () => {
|
|
|
- startTime();
|
|
|
- });
|
|
|
- mittBus.on('endTalkTime', () => {
|
|
|
- removeTimer();
|
|
|
- });
|
|
|
+ signalRStart(); //开启消息监听
|
|
|
+ if (telStatusInfo.value.telsNo) {
|
|
|
+ // 有分机号
|
|
|
+ initWebsocket(); // 初始化websocket
|
|
|
+ }
|
|
|
+ mittBus.on('startTalkTime', () => {
|
|
|
+ startTime();
|
|
|
+ });
|
|
|
+ mittBus.on('endTalkTime', () => {
|
|
|
+ removeTimer();
|
|
|
+ });
|
|
|
});
|
|
|
onBeforeMount(() => {
|
|
|
- mittBus.off('startTalkTime');
|
|
|
- mittBus.off('endTalkTime');
|
|
|
- signalR.leaveGroup('CallCenter');
|
|
|
+ mittBus.off('startTalkTime');
|
|
|
+ mittBus.off('endTalkTime');
|
|
|
+ signalR.leaveGroup('CallCenter');
|
|
|
});
|
|
|
</script>
|
|
|
|