吴树波 2 недель назад
Родитель
Сommit
be6e028337
1 измененных файлов с 11 добавлено и 8 удалено
  1. 11 8
      src/components/FloatingSoftPhone/index.vue

+ 11 - 8
src/components/FloatingSoftPhone/index.vue

@@ -437,6 +437,7 @@ export default {
 
       // ===== 委托通话标记 =====
       delegatedCallActive: false,  // 是否有通话委托给弹窗的phoneBar
+      isOutboundInProgress: false,  // 外呼进行中(含 SIP 回振坐席阶段,需自动接听)
       incomingJsipCall: false,  // 是否为JsSIP直接来电(转人工等)
       pendingManualNavigation: false  // 转人工来电结束后是否需要跳转到通话列表
     };
@@ -1110,6 +1111,7 @@ export default {
         if (!this.ccSocketConnected && this.ccConnectingReject) this.ccConnectingReject(new Error('服务器错误'));
       });
       this.ccPhoneBar.on(EventList.OUTBOUND_START, (msg) => {
+        this.isOutboundInProgress = true;
         this.isIncomingCall = false;
         this.callStatus = UI_STATE.RINGING;
         this.showLeftButton = false;
@@ -1332,6 +1334,11 @@ export default {
     },
     onRing(event) {
       if (!event.outgoing) {
+        // 外呼时呼叫中心回振坐席 SIP,自动接听,不展示来电 UI
+        if (this.isOutboundInProgress) {
+          if (this.phone) this.phone.Answer();
+          return;
+        }
         this.isIncomingCall = true;
         this.incomingJsipCall = true;
         this.incomingCaller = event.caller || '';
@@ -1370,6 +1377,7 @@ export default {
         this.rightButtonHangup = false;
       }
       this.delegatedCallActive = false;
+      this.isOutboundInProgress = false;
       this.incomingJsipCall = false;
       this.incomingCaller = '';
       // 注意:不在_resetCallState中重置pendingManualNavigation,它由onSessionClosed消费
@@ -1441,12 +1449,9 @@ export default {
 
       // 人工外呼弹窗打开时,委托弹窗 phoneBar(含通话记录、工作流等业务逻辑)
       if (window.__floatingPhoneCallDelegateActive) {
+        this.isOutboundInProgress = true;
         this.$root.$emit('floating-softphone-call-triggered', phoneNumber);
         this.delegatedCallActive = true;
-        this.isIncomingCall = false;
-        this.callStatus = UI_STATE.RINGING;
-        this.showLeftButton = false;
-        this.showRightButton = false;
         this.showStatus('拨号中...', 'info');
         return;
       }
@@ -1454,12 +1459,10 @@ export default {
       // 普通页面:使用浮动软电话自身的 ccPhoneBar 直接外呼
       try {
         this.delegatedCallActive = false;
-        this.isIncomingCall = false;
-        this.callStatus = UI_STATE.RINGING;
-        this.showLeftButton = false;
-        this.showRightButton = false;
+        this.isOutboundInProgress = true;
         this.ccPhoneBar.call(phoneNumber, 'audio', VideoLevels.HD.levelId);
       } catch (err) {
+        this.isOutboundInProgress = false;
         console.error('[FloatingSoftPhone] 外呼失败:', err);
         this.showStatus('拨号失败', 'error');
       }