修改自动拨打bug

This commit is contained in:
liuxi 2025-02-28 17:58:22 +08:00
parent 3094020d60
commit 1ec604fa22

View File

@ -471,9 +471,14 @@ export default {
const that = this const that = this
window.tccc.on('sessionEnded', (options) => { window.tccc.on('sessionEnded', (options) => {
console.log('监听挂断事件', options) console.log('监听挂断事件', options)
that.calling = false
that.resetTimer() if(that.calling)
that.nextCall() {
that.calling = false
that.resetTimer()
that.nextCall()
}
}) })
}, },
beforeDestroy() { beforeDestroy() {
@ -733,6 +738,7 @@ export default {
for (let i=0; i < this.queueList.length; i++) { for (let i=0; i < this.queueList.length; i++) {
if (this.queueList[i].status.code === 1) { if (this.queueList[i].status.code === 1) {
this.index = i this.index = i
console.log('startOutboundCall1')
this.startOutboundCall({phone:this.queueList[i].phone,contactId:this.queueList[i].contactId,queueName:this.queueList[i].queueName}) this.startOutboundCall({phone:this.queueList[i].phone,contactId:this.queueList[i].contactId,queueName:this.queueList[i].queueName})
return return
} }
@ -747,6 +753,7 @@ export default {
let phone = this.baseInfo.debtorEntityList.find(item => (item.role == 'DEBTOR' && item.type == '本人')).phone let phone = this.baseInfo.debtorEntityList.find(item => (item.role == 'DEBTOR' && item.type == '本人')).phone
let contactId = this.baseInfo.debtorEntityList.find(item => (item.role == 'DEBTOR' && item.type == '本人')).id let contactId = this.baseInfo.debtorEntityList.find(item => (item.role == 'DEBTOR' && item.type == '本人')).id
console.log('startOutboundCall2')
this.startOutboundCall({phone:phone,contactId:contactId}) this.startOutboundCall({phone:phone,contactId:contactId})
} }
}, },
@ -803,16 +810,20 @@ export default {
try { try {
let res = await window.tccc.Call.hungUp({sessionId: this.sessionId}) let res = await window.tccc.Call.hungUp({sessionId: this.sessionId})
console.log('挂断会话-hungUp') console.log('挂断会话-hungUp')
this.calling = false if(this.calling)
this.resetTimer() {
this.nextCall() this.calling = false
this.resetTimer()
this.nextCall()
}
} catch (err) { } catch (err) {
// //
} finally {} } finally {}
}, },
// //
nextCall() { nextCall() {
console.log('进入自动拨打下一个会话,','queue=',this.queue, ' isPause=', this.isPause) // console.log(',','queue=',this.queue, ' isPause=', this.isPause)
if (!this.queue) return if (!this.queue) return
if (this.isPause) { if (this.isPause) {
this.isPause = false this.isPause = false
@ -827,7 +838,7 @@ export default {
that.caseId = String(that.queueList[that.index].caseId) || '' that.caseId = String(that.queueList[that.index].caseId) || ''
that.getCaseInfoById() that.getCaseInfoById()
console.log('将会自动拨打下一个会话====',that.queueList[that.index]) console.log('将会自动拨打下一个会话====',that.queueList[that.index])
that.startOutboundCall({phone:that.queueList[that.index].phone,contactId:that.queueList[that.index].contactId}) that.startOutboundCall({phone:that.queueList[that.index].phone,contactId:that.queueList[that.index].contactId,queueName:this.queueList[that.index].queueName})
} }
}, 5000) }, 5000)
}, },