|
@@ -479,7 +479,7 @@
|
|
|
</template>
|
|
|
|
|
|
<script setup lang="ts" name="telControl">
|
|
|
-import { reactive, ref, computed, defineAsyncComponent, onMounted, onUnmounted } from "vue";
|
|
|
+import { reactive, ref, computed, defineAsyncComponent, onMounted, onUnmounted } from 'vue';
|
|
|
import { ElMessageBox, ElNotification, ElMessage, FormInstance } from 'element-plus';
|
|
|
import { storeToRefs } from 'pinia';
|
|
|
import { useTelStatus, TelStates, RestStates } from '@/stores/telStatus';
|
|
@@ -490,16 +490,26 @@ import { formatDuration } from '@/utils/formatTime';
|
|
|
import { commonEnum } from '@/utils/constants';
|
|
|
import other from '@/utils/other';
|
|
|
import { workflowStepOptions } from '@/api/system/workflow';
|
|
|
-import { restFlowStart, restFlowDel, restFlowStartWex, getTelList, telRestBaseData, dutyOff, dutyOn, busyOff, busyOn } from '@/api/public/wex';
|
|
|
+import {
|
|
|
+ restFlowStart,
|
|
|
+ restFlowDel,
|
|
|
+ restFlowStartWex,
|
|
|
+ getTelList,
|
|
|
+ telRestBaseData,
|
|
|
+ dutyOff,
|
|
|
+ dutyOn,
|
|
|
+ busyOff,
|
|
|
+ busyOn,
|
|
|
+ queryBlacklist,
|
|
|
+} from '@/api/public/wex';
|
|
|
import signalR from '@/utils/signalR';
|
|
|
import { Local } from '@/utils/storage';
|
|
|
import { ola } from '@/utils/ola_api';
|
|
|
import { useRouter } from 'vue-router';
|
|
|
import dayjs from 'dayjs';
|
|
|
-import axios from 'axios';
|
|
|
import { useSocket } from '@/utils/websocket';
|
|
|
import mittBus from '@/utils/mitt';
|
|
|
-import { voiceAssistant } from "@/api/todo/voiceAssistant";
|
|
|
+import { voiceAssistant } from '@/api/todo/voiceAssistant';
|
|
|
// 引入组件
|
|
|
const CommonAdvice = defineAsyncComponent(() => import('@/components/CommonAdvice/index.vue')); // 常用意见
|
|
|
const AnnexList = defineAsyncComponent(() => import('@/components/AnnexList/index.vue'));
|
|
@@ -558,6 +568,7 @@ const state = reactive<any>({
|
|
|
// 三方会议表单
|
|
|
telNo: null, // 三方会议号码
|
|
|
},
|
|
|
+ whiteList: [], // 白名单
|
|
|
});
|
|
|
|
|
|
const useTelStatusStore = useTelStatus();
|
|
@@ -619,11 +630,11 @@ const removeTimerOnDuty = () => {
|
|
|
};
|
|
|
// 监听消息
|
|
|
const signalRStart = async () => {
|
|
|
- mittBus.on('RestApplyPass', (data) => {
|
|
|
- // 小休审批通过消息
|
|
|
- console.log(data, '小休审批通过消息');
|
|
|
- RestApplyPassFn(data);
|
|
|
- });
|
|
|
+ mittBus.on('RestApplyPass', (data) => {
|
|
|
+ // 小休审批通过消息
|
|
|
+ console.log(data, '小休审批通过消息');
|
|
|
+ RestApplyPassFn(data);
|
|
|
+ });
|
|
|
};
|
|
|
// 检查用户状态
|
|
|
// 设置当前可用的按钮
|
|
@@ -868,7 +879,7 @@ const sendMsg = (msg: any) => {
|
|
|
const router = useRouter();
|
|
|
const talkDealTimer = ref<any>(null); // 话后整理定时器
|
|
|
// 呼叫中心消息
|
|
|
-const onMessage = (event: any) => {
|
|
|
+const onMessage = async (event: any) => {
|
|
|
const data = JSON.parse(event.data);
|
|
|
if (data.event_type == 'agent_state') {
|
|
|
if (data.agent_extn) {
|
|
@@ -915,10 +926,10 @@ const onMessage = (event: any) => {
|
|
|
console.log('呼叫中心:示闲中');
|
|
|
sendMsg('ready');
|
|
|
} else if (data.state == 'unready') {
|
|
|
- break_reason(data.private_data);
|
|
|
- sendMsg('unready'); // 发送消息 业务系统消息通知
|
|
|
+ break_reason(data.private_data);
|
|
|
+ sendMsg('unready'); // 发送消息 业务系统消息通知
|
|
|
|
|
|
- console.log('呼叫中心:示忙中,小休开始');
|
|
|
+ console.log('呼叫中心:示忙中,小休开始');
|
|
|
// 示忙中
|
|
|
useTelStatusStore.setPhoneControlState(TelStates.rest);
|
|
|
useTelStatusStore.setRest(RestStates.resting);
|
|
@@ -1053,6 +1064,16 @@ const onMessage = (event: any) => {
|
|
|
ElMessage.warning('请先配置工单受理页面');
|
|
|
return;
|
|
|
}
|
|
|
+ await getWithList(); // 获取白名单列表
|
|
|
+ const isWhite = state.whiteList.filter((item: any) => item.phone === data.ani);
|
|
|
+ if (isWhite) {
|
|
|
+ // 如果来电电话在呼入白名单中 需要提示
|
|
|
+ ElNotification({
|
|
|
+ title: '来电提醒',
|
|
|
+ message: '该市民为白名单。',
|
|
|
+ type: 'success',
|
|
|
+ });
|
|
|
+ }
|
|
|
router.push({
|
|
|
name: 'orderAccept',
|
|
|
state: {
|
|
@@ -1481,13 +1502,13 @@ const connectVoiceAssistant = async (telNo: string) => {
|
|
|
socket.value = useSocket(import.meta.env.VITE_VOICE_ASSISTANT_SOCKET_URL, { uid, subscribe });
|
|
|
socket.value.on('open', () => {
|
|
|
socket.value.send({ id: '', type: 1, from: uid, to: 'sys', timestamps: new Date().getTime(), body: result.userName });
|
|
|
- console.log('坐席辅助连接成功')
|
|
|
- ElMessage.success('坐席辅助连接成功');
|
|
|
+ console.log('坐席辅助连接成功');
|
|
|
+ ElMessage.success('坐席辅助连接成功');
|
|
|
});
|
|
|
socket.value.on('message', wsReceive);
|
|
|
} catch (err) {
|
|
|
console.log(err, '坐席辅助链接失败');
|
|
|
- ElMessage.error('坐席辅助链接失败');
|
|
|
+ ElMessage.error('坐席辅助链接失败');
|
|
|
}
|
|
|
};
|
|
|
// 坐席辅助关闭
|
|
@@ -1544,6 +1565,15 @@ const getReason = async () => {
|
|
|
console.log(err);
|
|
|
}
|
|
|
};
|
|
|
+// 获取白名单列表
|
|
|
+const getWithList = async () => {
|
|
|
+ try {
|
|
|
+ const response: any = await queryBlacklist({ SpecialFlag: 1 });
|
|
|
+ state.whiteList = response.result;
|
|
|
+ } catch (err) {
|
|
|
+ console.log(err);
|
|
|
+ }
|
|
|
+};
|
|
|
onMounted(async () => {
|
|
|
clearTimeout(talkDealTimer.value); // 清除话后整理定时器
|
|
|
await getReason(); // 获取小休原因
|
|
@@ -1551,13 +1581,12 @@ onMounted(async () => {
|
|
|
removeTimerOnDuty(); // 移除定时器
|
|
|
await getTelsLists(); // 查询所有分机
|
|
|
await callCenterConnect(); // 呼叫中心链接
|
|
|
-
|
|
|
// 加入分组
|
|
|
signalR.joinGroup('CallCenter');
|
|
|
});
|
|
|
-onUnmounted(()=>{
|
|
|
- mittBus.off('RestApplyPass');
|
|
|
-})
|
|
|
+onUnmounted(() => {
|
|
|
+ mittBus.off('RestApplyPass');
|
|
|
+});
|
|
|
</script>
|
|
|
|
|
|
<style scoped lang="scss">
|