From 22bd207587899810e9afb4c1a53f0d5dae1e2ece Mon Sep 17 00:00:00 2001
From: WXL (wul) <wl_5969728@163.com>
Date: 星期五, 05 十二月 2025 16:28:42 +0800
Subject: [PATCH] 测试完成

---
 src/views/followvisit/record/detailpage/index.vue |  113 +++++++++++++++++++++++++++++++-------------------------
 1 files changed, 62 insertions(+), 51 deletions(-)

diff --git a/src/views/followvisit/record/detailpage/index.vue b/src/views/followvisit/record/detailpage/index.vue
index 886d0b5..629bad8 100644
--- a/src/views/followvisit/record/detailpage/index.vue
+++ b/src/views/followvisit/record/detailpage/index.vue
@@ -695,7 +695,10 @@
                 </div>
 
                 <!-- SIP娉ㄥ唽鐘舵�佹彁绀� -->
-                <div v-if="isSipRegistering&&orgname == '涓芥按甯備腑鍖婚櫌'" class="sip-registering">
+                <div
+                  v-if="isSipRegistering && orgname == '涓芥按甯備腑鍖婚櫌'"
+                  class="sip-registering"
+                >
                   <el-alert
                     title="鍛煎彨搴ф満鍒濆鍖栦腑锛岃绋嶅��..."
                     type="info"
@@ -1157,6 +1160,7 @@
       callType: "", // 鐢ㄤ簬鍖哄垎鏄摢涓數璇�
       isSipRegistering: true, // SIP娉ㄥ唽鐘舵��
       // 宸叉湁鏁版嵁...
+      customCallStatus: "", // 鐢ㄤ簬瀛樺偍鑷畾涔夌姸鎬佹枃鏈�
       callStatus: "idle", // idle, calling, connected, ended, failed
       isEndingCall: false,
       CaldialogVisible: false,
@@ -1376,6 +1380,7 @@
           label: "涓�骞村悗",
         },
       ],
+      statusTimer: null,
       userform: {},
       smsDialogVisible: false, // 鎺у埗鐭俊瀵硅瘽妗嗘樉绀�
       smsContent: "", // 瀛樺偍鐭俊鍐呭
@@ -1392,9 +1397,18 @@
       patid: null,
     };
   },
-
+  // 鍦ㄧ粍浠朵腑娣诲姞閿�姣佸墠鐨勬竻鐞�
+  beforeUnmount() {
+    if (this.statusTimer) {
+      clearTimeout(this.statusTimer);
+      this.statusTimer = null;
+    }
+  },
   computed: {
     callStatusText() {
+      if (this.customCallStatus) {
+        return this.customCallStatus;
+      }
       const statusMap = {
         idle: "鍑嗗鍛煎彨",
         calling: `姝e湪鍛煎彨 ${this.currentPhoneNumber}...`,
@@ -1428,16 +1442,26 @@
 
     this.getTaskservelist();
   },
-mounted() {
+  mounted() {
     // 鐩戝惉瀛愮粍浠剁殑sipStatus灞炴�у彉鍖�
     if (this.$refs.callButton) {
       this.$watch(
         () => this.$refs.callButton.sipStatus,
         (newStatus) => {
-          if (newStatus === '宸叉敞鍐�') {
+          if (this.statusTimer) {
+            clearTimeout(this.statusTimer);
+            this.statusTimer = null;
+          }
+          if (newStatus === "宸叉敞鍐�") {
+            this.statusTimer = setTimeout(() => {
+              this.isSipRegistering = false;
+              this.customCallStatus = ""; // 娉ㄥ唽鎴愬姛鍚庢竻绌鸿嚜瀹氫箟鎻愮ず
+              console.log("SIP娉ㄥ唽鎴愬姛锛岀姸鎬佸凡鏇存柊");
+            }, 2000);
             this.isSipRegistering = false;
-          } else if (newStatus === '娉ㄥ唽澶辫触' || newStatus === '鏈繛鎺�') {
+          } else if (newStatus === "娉ㄥ唽澶辫触" || newStatus === "鏈繛鎺�") {
             this.isSipRegistering = true;
+            this.customCallStatus = "鍛煎彨涓柇锛岃祫婧愰噸鏂板姞杞戒腑璇风◢绛�3s閲嶆柊銆�";
           }
         },
         { immediate: true } // 绔嬪嵆鎵ц涓�娆′互鑾峰彇鍒濆鍊�
@@ -1582,8 +1606,6 @@
     },
     // 妫�鏌ラ殢璁挎棩鏈熸槸鍚︽湁鏁�
     checkFollowupDate(date) {
-      console.log(date);
-
       if (!date) {
         this.form.date1 = "";
         this.$refs.zcform.clearValidate(["date1"]);
@@ -1710,7 +1732,10 @@
             }
           });
           this.Editsingletasksonyic(6);
-
+          if (this.visitCount != 1) {
+            this.Torouter();
+            return;
+          }
           this.$modal
             .confirm(
               '浠诲姟淇濆瓨鎴愬姛鏄惁閽堝鎮h�咃細"' +
@@ -1732,33 +1757,36 @@
               this.dialogFormVisible = true;
             })
             .catch(() => {
-              if (this.form.serviceType == 13) {
-                if (this.visitCount != 1) {
-                  this.$router.push({
-                    path: "/logisticsservice/zbAgain",
-                  });
-                } else {
-                  this.$router.push({
-                    path: "/logisticsservice/record",
-                  });
-                }
-              } else if (this.form.serviceType == 2) {
-                if (this.visitCount != 1) {
-                  this.$router.push({
-                    path: "/logisticsservice/again",
-                  });
-                } else {
-                  this.$router.push({
-                    path: "/followvisit/discharge",
-                  });
-                }
-              }
+              this.Torouter();
             });
         })
         .catch((error) => {
           // 濡傛灉鏈変换浣曚竴涓紓姝ユ搷浣滃け璐ワ紝浼氳繘鍏ヨ繖閲�
           console.error("鍙戠敓閿欒锛�", error);
         });
+    },
+    Torouter() {
+      if (this.form.serviceType == 13) {
+        if (this.visitCount != 1) {
+          this.$router.push({
+            path: "/logisticsservice/zbAgain",
+          });
+        } else {
+          this.$router.push({
+            path: "/logisticsservice/record",
+          });
+        }
+      } else if (this.form.serviceType == 2) {
+        if (this.visitCount != 1) {
+          this.$router.push({
+            path: "/logisticsservice/again",
+          });
+        } else {
+          this.$router.push({
+            path: "/followvisit/discharge",
+          });
+        }
+      }
     },
     // 鐢佃瘽============================
     // 楠岃瘉鐢佃瘽鍙风爜鏍煎紡骞惰繑鍥為敊璇俊鎭�
@@ -1889,7 +1917,10 @@
         param2: this.patid,
         subId: this.id,
       };
-
+      if (this.visitCount != 1) {
+        this.Torouter();
+        return;
+      }
       addPersonVoices(obj).then((res) => {
         if (res.code == 200) {
           this.$modal.msgSuccess("鏈嶅姟淇濆瓨鎴愬姛");
@@ -1914,27 +1945,7 @@
               this.dialogFormVisible = true;
             })
             .catch(() => {
-              if (this.form.serviceType == 13) {
-                if (this.visitCount != 1) {
-                  this.$router.push({
-                    path: "/logisticsservice/zbAgain",
-                  });
-                } else {
-                  this.$router.push({
-                    path: "/logisticsservice/record",
-                  });
-                }
-              } else if (form.serviceType == 2) {
-                if (this.visitCount != 1) {
-                  this.$router.push({
-                    path: "/followvisit/again",
-                  });
-                } else {
-                  this.$router.push({
-                    path: "/followvisit/discharge",
-                  });
-                }
-              }
+              this.Torouter();
             });
         }
       });

--
Gitblit v1.9.3