diff --git a/src/layout/components/ivr/ivrBar.vue b/src/layout/components/ivr/ivrBar.vue index 2295c93..50ec55d 100644 --- a/src/layout/components/ivr/ivrBar.vue +++ b/src/layout/components/ivr/ivrBar.vue @@ -1,18 +1,18 @@ @@ -56,10 +59,11 @@ import { seatReport } from '@/api/call' import ChooseExten from './chooseExten' import { mapState } from 'vuex' +import LeftCallBar from '../../../components/cti/LeftCallBar' export default { name: 'IvrBar', - components: { ChooseExten, ChooseSeats, CreateCase, IvrBtn, Keyboard }, + components: { LeftCallBar, ChooseExten, ChooseSeats, CreateCase, IvrBtn, Keyboard }, data() { return { debug: true, // 是否开启debug模式 @@ -90,6 +94,8 @@ btnQuitWorkState: true // 退出工作态 }, status: '', // 签入状态:已连接,已签入,未签入 + holdStatus: false, // 保持状态 + currentNumber: '', // 当前接入号码 busy: '', // 坐席忙碌状态 :忙碌,'', 另一坐席已登录 call: '', // 通话状态 isInComing: false, // 是否来电 @@ -104,7 +110,7 @@ threeWayPhone: '', // 三方通话电话号码 ip: getProject().ws_ip, // websocket Ip port: getProject().ws_port, // webSocket Port - showAddCase: false, // 是否显示新建案卷的弹窗 + showAddCase: true, // 是否显示新建案卷的弹窗 notify: null // 来电通知 } }, @@ -156,27 +162,27 @@ } }, watch: { - busy(val) { - // 忙碌状态为不忙时,示忙按钮允许点,示闲不允许 - if (val === '') { - this.btnStatus.btnBusy = false - this.btnStatus.btnIdle = true - } else if (val === '忙碌') { - this.btnStatus.btnBusy = true - this.btnStatus.btnIdle = false - } - }, - wsStatus(val) { // 监控ws连接状态 - if (val) { // 如果wsStatus==true - if (!this.signStatus) { // 如果还没有签入 - this.btnStatus.btnLogin = false - } else { - this.btnStatus.btnLogin = true - } - } else { - this.btnStatus.btnLogin = true - } - }, + // busy(val) { + // // 忙碌状态为不忙时,示忙按钮允许点,示闲不允许 + // if (val === '') { + // this.btnStatus.btnBusy = false + // this.btnStatus.btnIdle = true + // } else if (val === '忙碌') { + // this.btnStatus.btnBusy = true + // this.btnStatus.btnIdle = false + // } + // }, + // wsStatus(val) { // 监控ws连接状态 + // if (val) { // 如果wsStatus==true + // if (!this.signStatus) { // 如果还没有签入 + // this.btnStatus.btnLogin = false + // } else { + // this.btnStatus.btnLogin = true + // } + // } else { + // this.btnStatus.btnLogin = true + // } + // }, signStatus(val) { // 监控签入状态 console.log('sign status Change:' + val) if (val) { // 已签入 @@ -197,9 +203,11 @@ if (val === 'incomming answered') { // 接听呼入 this.incommingAnswerd() } else if (val === 'holding') { // 状态为保持 + this.holdStatus = true this.btnStatus.btnHold = true this.btnStatus.btnUnhold = false } else if (val === 'unholding') { // 状态为解除保持 + this.holdStatus = false this.btnStatus.btnHold = false this.btnStatus.btnUnhold = true } else if (val === 'incomming ringing') { // 来电振铃 @@ -278,7 +286,8 @@ }, // 签入成功后按钮的操作 onLoginSuccess() { - this.btnStatus.btnLogin = true // 签出按钮不显示 + this.onidle() + this.btnStatus.btnLogin = true // 签入按钮不显示 this.btnStatus.btnLogOut = false this.btnStatus.btnDialOut = false this.btnStatus.btnDialIn = false @@ -286,8 +295,9 @@ this.btnStatus.btnUnhold = true this.btnStatus.btnBusy = false this.btnStatus.btnIdle = true // 置闲不显示 - this.btnStatus.btnMeeting = false - this.btnStatus.btnHangUp = false + this.btnStatus.btnMeeting = true + this.btnStatus.btnHangUp = true + this.btnStatus.btnTransfer = true // 转接不可用 this.status = '已签入' this.call = '空闲' // 通知后台已签入 @@ -450,6 +460,8 @@ }, // 通话结束 callOver() { + this.btnStatus.btnTransfer = true + this.btnStatus.btnHangUp = true // 结束计时器 if (this.timeInterval) { this.$message.info('通话结束') @@ -458,14 +470,17 @@ this.time = 0 this.number = '' } - // 如果是来电,进入工作态 - if (this.isInComing) { - this.goWorkState() + // 如果还显示着弹窗,关闭弹窗 + if (this.statusShow) { + this.statusShow = false } + // 如果是来电,进入工作态 + // if (this.isInComing) { + // this.goWorkState() + // } }, // 处理接通来电之后 incommingAnswerd() { - debugger const object = this.websocketObj this.isInComing = true if (this.notify) { @@ -480,20 +495,22 @@ this.btnStatus.btnIdle = true this.btnStatus.btnMeeting = true this.btnStatus.btnHangUp = false + this.btnStatus.btnTransfer = false // 判断是不是内呼,内呼则不弹出新建工单页面 // if (!this.judgeInsideNumber()) { - // 弹出新建工单窗口 - this.showAddCase = true - const data = { - callid: object.callid, - number: object.number, - dialStartStamp: getToday('yyyy-MM-dd hh:mm:ss') - } - console.log(data) - const that = this - setTimeout(function() { - that.$refs['addcase'].initData(data) - }, 500) + // 弹出新建工单窗口 + this.showAddCase = true + const data = { + callid: object.callid, + number: object.number, + dialStartStamp: getToday('yyyy-MM-dd hh:mm:ss') + } + this.currentNumber = object.number + console.log(data) + const that = this + setTimeout(function() { + that.$refs['addcase'].initData(data) + }, 500) // } }, // 新建事件完毕调用 @@ -611,6 +628,28 @@ // 向后台写记录 sendRecord(type, recordName) { seatReport(type, recordName) + }, + click(method) { + console.log('click this') + switch (method) { + case 'hangup': + this.hangup() + break + case 'hold': + this.hold() + break + case 'unhold': + this.unhold() + break + case 'transfer': + this.transferDial() + break + case 'meeting': + this.meeting() + break + default: + break + } } } } @@ -680,9 +719,12 @@ } } -