From 43017c316ab6a2e11305a7f016b12d13736e8cc1 Mon Sep 17 00:00:00 2001
From: WXL (wul) <wl_5969728@163.com>
Date: 星期二, 02 十二月 2025 17:33:33 +0800
Subject: [PATCH] 测试完成

---
 src/views/followvisit/record/detailpage/index.vue |  357 ++++++++++++++++++++++++++++++++++++++++++++++++++---------
 1 files changed, 302 insertions(+), 55 deletions(-)

diff --git a/src/views/followvisit/record/detailpage/index.vue b/src/views/followvisit/record/detailpage/index.vue
index 1113245..886d0b5 100644
--- a/src/views/followvisit/record/detailpage/index.vue
+++ b/src/views/followvisit/record/detailpage/index.vue
@@ -282,11 +282,7 @@
                     >
                       <!-- 鍗曢�� -->
                       <div
-                        :class="
-                          item.isabnormal
-                            ? 'scriptTopic-isabnormal'
-                            : 'scriptTopic-dev'
-                        "
+                        :class="getTopicClass(item)"
                         :key="index"
                         v-if="item.scriptType == 1 && !item.astrict"
                       >
@@ -301,7 +297,7 @@
                               v-for="(
                                 items, indexs
                               ) in item.svyTaskTemplateTargetoptions"
-                              :class="items.isabnormal ? 'red-star' : ''"
+                              :class="getOptionClass(items)"
                               :key="indexs"
                               :label="items.optioncontent"
                               @click.native.prevent="
@@ -632,8 +628,8 @@
                         icon="el-icon-phone"
                         @click="handleCall(userform.telcode, 'tel')"
                         :disabled="!isValidPhone(userform.telcode)"
-                      ></el-button
-                    ></el-input> </el-form-item
+                      ></el-button>
+                    </el-input> </el-form-item
                 ></el-col>
               </el-row>
               <el-row>
@@ -668,22 +664,44 @@
                   style="display: none"
                 />
 
-                <div v-if="callStatus === 'connected'" class="hangup-btn">
+                <!-- 鎸傛柇鎸夐挳鏍峰紡浼樺寲 -->
+                <div v-if="callStatus === 'connected'" class="hangup-container">
                   <el-button
                     type="danger"
                     icon="el-icon-phone"
                     @click="endCurrentCall"
                     :loading="isEndingCall"
+                    class="hangup-btn"
+                    size="medium"
                   >
-                    鎸傛柇鐢佃瘽
+                    {{ isEndingCall ? "鎸傛柇涓�..." : "鎸傛柇鐢佃瘽" }}
                   </el-button>
+
+                  <!-- 閫氳瘽璁℃椂鏄剧ず -->
+                  <div class="call-timer" v-if="callStartTime">
+                    閫氳瘽鏃堕暱: {{ formatCallTime }}
+                  </div>
                 </div>
-                <div class="call-status" v-if="callStatus !== 'idle'">
+
+                <!-- 鐘舵�佹彁绀轰紭鍖� -->
+                <div class="call-status-container" v-if="callStatus !== 'idle'">
                   <el-alert
                     :title="callStatusText"
                     :type="callStatusType"
                     :closable="false"
                     show-icon
+                    :class="['status-alert', `status-${callStatus}`]"
+                  />
+                </div>
+
+                <!-- SIP娉ㄥ唽鐘舵�佹彁绀� -->
+                <div v-if="isSipRegistering&&orgname == '涓芥按甯備腑鍖婚櫌'" class="sip-registering">
+                  <el-alert
+                    title="鍛煎彨搴ф満鍒濆鍖栦腑锛岃绋嶅��..."
+                    type="info"
+                    :closable="false"
+                    show-icon
+                    class="registering-alert"
                   />
                 </div>
               </div>
@@ -1137,6 +1155,7 @@
       userid: "",
       currentPhoneNumber: "",
       callType: "", // 鐢ㄤ簬鍖哄垎鏄摢涓數璇�
+      isSipRegistering: true, // SIP娉ㄥ唽鐘舵��
       // 宸叉湁鏁版嵁...
       callStatus: "idle", // idle, calling, connected, ended, failed
       isEndingCall: false,
@@ -1177,8 +1196,12 @@
           value: "5",
         },
         {
-          label: "鍏朵粬鎯呭喌涓嶅疁闅忚",
+          label: "涓嶅疁闅忚琚繃婊�",
           value: "6",
+        },
+        {
+          label: "鍏朵粬",
+          value: "7",
         },
       ],
       tableDatatop: [], //棰樼洰琛�
@@ -1190,21 +1213,21 @@
       selectedTag: "",
       tagOptions: [
         {
-          value: '0',
+          value: "0",
           label: "姝e父",
           type: "normal",
           color: "#7ff5e1",
           description: "鎮h�呮儏鍐垫甯革紝鏃犻渶鐗瑰埆鍏虫敞",
         },
         {
-          value: '1',
+          value: "1",
           label: "寮傚父",
           type: "abnormal",
           color: "#f75c5c",
           description: "鎮h�呭瓨鍦ㄥ紓甯告儏鍐碉紝闇�瑕侀噸鐐瑰叧娉�",
         },
         {
-          value: '2',
+          value: "2",
           label: "璀﹀憡",
           type: "warning",
           color: "#fbfb4a",
@@ -1405,8 +1428,44 @@
 
     this.getTaskservelist();
   },
-
+mounted() {
+    // 鐩戝惉瀛愮粍浠剁殑sipStatus灞炴�у彉鍖�
+    if (this.$refs.callButton) {
+      this.$watch(
+        () => this.$refs.callButton.sipStatus,
+        (newStatus) => {
+          if (newStatus === '宸叉敞鍐�') {
+            this.isSipRegistering = false;
+          } else if (newStatus === '娉ㄥ唽澶辫触' || newStatus === '鏈繛鎺�') {
+            this.isSipRegistering = true;
+          }
+        },
+        { immediate: true } // 绔嬪嵆鎵ц涓�娆′互鑾峰彇鍒濆鍊�
+      );
+    }
+  },
   methods: {
+    // 鑾峰彇涓婚鏍峰紡绫�
+    getTopicClass(item) {
+      // 鏍规嵁鐘舵�佸�艰繑鍥炲搴旂殑鏍峰紡绫�
+      if (item.isabnormal == 1) {
+        return "scriptTopic-isabnormal"; // 寮傚父 - 绾㈣壊
+      } else if (item.isabnormal == 2) {
+        return "scriptTopic-warning"; // 璀﹀憡 - 榛勮壊
+      } else {
+        return "scriptTopic-dev"; // 姝e父 - 榛樿鏍峰紡
+      }
+    },
+
+    // 鑾峰彇閫夐」鏍峰紡绫�
+    getOptionClass(items) {
+      if (items.isabnormal == 1) {
+        return "red-star"; // 寮傚父 - 绾㈣壊鏄熷彿
+      } else if (items.isabnormal == 2) {
+        return "yellow-star"; // 璀﹀憡 - 榛勮壊鏄熷彿
+      }
+      return ""; // 姝e父 - 鏃犵壒娈婃牱寮�
+    },
     // 鑾峰彇闂嵎鏁版嵁
     getsearchrResults(id) {
       getsearchrResults({
@@ -1609,11 +1668,15 @@
         var objs = item.svyTaskTemplateTargetoptions.find(
           (items) => items.optioncontent == item.scriptResult
         );
-        if (obj) {
-          if (objs.isabnormal) {
+
+        if (objs) {
+          if (excep != 1 && objs.isabnormal) {
             excep = objs.isabnormal;
+            this.selectedTag = objs.isabnormal;
           }
         }
+        console.log(excep, "excep");
+
         let obj = {
           asrtext: null,
           patid: this.patid,
@@ -1738,22 +1801,34 @@
         this.$message.error("璇疯緭鍏ユ纭殑鎵嬫満鍙风爜");
         return;
       }
+      // 妫�鏌IP鏄惁宸叉敞鍐�
+
       this.currentPhoneNumber = phone;
-      // 鍛煎彨鍒ゆ柇
+      // 鏄惁鏅畞鍛煎彨
       if (this.orgname == "鏅畞鐣叉棌鑷不鍘夸汉姘戝尰闄�") {
         this.CaldialogVisible = true;
         return;
       }
-
+      // 涓嬫柟鏄腑鍖婚櫌鍛煎彨
+      if (this.isSipRegistering) {
+        this.$message.warning("绯荤粺姝e湪鍒濆鍖栵紝璇风◢鍊�...");
+        return;
+      }
       this.callType = type;
       this.callStatus = "calling";
 
       this.$nextTick(() => {
         this.$refs.callButton.startCall();
 
-        // 鐩戝惉閫氳瘽鐘舵�佸彉鍖�
         this.$refs.callButton.$on("call-status-change", (status) => {
           this.handleCallStatusChange(status);
+          // 鐩戝惉娉ㄥ唽鐘舵�佸彉鍖�
+          if (status.type === "registered") {
+            this.isSipRegistering = false;
+          }
+          if (status.type === "failed" || status.type === "disconnected") {
+            this.isSipRegistering = true;
+          }
         });
       });
     },
@@ -1792,7 +1867,8 @@
     },
     yuyingetdetail() {
       const dataToSubmit = JSON.parse(JSON.stringify(this.tableDatatop));
-
+      console.log(dataToSubmit, "dataToSubmit");
+      // return;
       dataToSubmit.forEach((item, index) => {
         // 瀵规嫹璐濈殑鏁版嵁杩涜鎿嶄綔锛屼笉褰卞搷鍘熷鐨� scriptResult 鏁扮粍
         item.scriptResult = item.scriptResult.join("&");
@@ -2029,10 +2105,34 @@
 
     // 璋冭捣鍐嶆鍙戦��
     sendAgain() {
-      document.querySelector("#app").scrollTo(0, 0);
-      // scrollTo(0, 0)
-      this.formtidy();
-      this.dialogFormVisible = true;
+      getTaskservelist({
+        patid: this.patid,
+        visitCount: 2,
+        leaveldeptcodes: [this.form.deptcode],
+      }).then((res) => {
+        if (res.rows[0].serviceSubtaskList.length) {
+          if (
+            res.rows[0].serviceSubtaskList[0].sendstate != 5 &&
+            res.rows[0].serviceSubtaskList[0].sendstate != 6
+          ) {
+            this.$modal
+              .confirm(
+                '鏈偅鑰呭湪"' +
+                  res.rows[0].serviceSubtaskList[0].deptname +
+                  '"绉戝涓嬪凡鏈夊啀娆¢殢璁挎湇鍔¤繘琛屼腑鏄惁缁х画鍒涘缓锛�'
+              )
+              .then(() => {
+                document.querySelector("#app").scrollTo(0, 0);
+                this.formtidy();
+                this.dialogFormVisible = true;
+              });
+          }
+        } else {
+          document.querySelector("#app").scrollTo(0, 0);
+          this.formtidy();
+          this.dialogFormVisible = true;
+        }
+      });
     },
     // 鏌ョ湅璇︽儏
     Seedetails(row) {
@@ -2089,7 +2189,7 @@
       if (questionItem.matchedtext == optionValue) {
         this.$set(questionItem, "matchedtext", "");
         // 鍚屾椂閲嶇疆涓庨�夐」鐩稿叧鐨勭姸鎬�
-        questionItem.isabnormal = false;
+        // questionItem.isabnormal = false;
         questionItem.showAppendInput = false;
         // 娉ㄦ剰锛氬彇娑堥�変腑鏃讹紝鎴戜滑閫氬父涓嶅笇鏈涜Е鍙戦鐩烦杞�昏緫锛屾墍浠ョ洿鎺ヨ繑鍥�
         // 濡傛灉闇�瑕侊紝鍙互鍦ㄨ繖閲屾坊鍔犲彇娑堥�変腑鍚庣殑鐗瑰畾閫昏緫锛屼緥濡傞噸缃鐩簭鍒�
@@ -2101,13 +2201,11 @@
     },
     // 鏂板鐨勫垏鎹㈤�変腑/鍙栨秷閫変腑鏂规硶
     handleRadioToggle(questionItem, index, options, optionValue) {
-      console.log(questionItem, optionValue, 999);
-
       // 濡傛灉鐐瑰嚮鐨勬槸褰撳墠宸查�変腑鐨勯�夐」锛屽垯鍙栨秷閫変腑
       if (questionItem.scriptResult === optionValue) {
         questionItem.scriptResult = ""; // 娓呯┖閫変腑鍊�
         // 鍚屾椂閲嶇疆涓庨�夐」鐩稿叧鐨勭姸鎬�
-        questionItem.isabnormal = false;
+        // questionItem.isabnormal = false;
         questionItem.showAppendInput = false;
         // 娉ㄦ剰锛氬彇娑堥�変腑鏃讹紝鎴戜滑閫氬父涓嶅笇鏈涜Е鍙戦鐩烦杞�昏緫锛屾墍浠ョ洿鎺ヨ繑鍥�
         // 濡傛灉闇�瑕侊紝鍙互鍦ㄨ繖閲屾坊鍔犲彇娑堥�変腑鍚庣殑鐗瑰畾閫昏緫锛屼緥濡傞噸缃鐩簭鍒�
@@ -2135,7 +2233,7 @@
 
       // 澶勭悊寮傚父鐘舵�侀珮浜�
       this.tableDatatop[questionIndex].isabnormal =
-        !!selectedOptionObj.isabnormal;
+        selectedOptionObj.isabnormal;
       // 澶勭悊闄勫姞杈撳叆妗嗘樉绀�
 
       this.tableDatatop[questionIndex].showAppendInput =
@@ -2211,6 +2309,7 @@
           hiddenByEnd: index === questionIndex + 1 ? false : item.hiddenByEnd,
         }));
       }
+      2;
 
       this.$forceUpdate();
     },
@@ -2221,9 +2320,7 @@
         );
         if (obj) {
           if (obj.isabnormal) {
-            this.tableDatatop[index].isabnormal = true;
-          } else {
-            this.tableDatatop[index].isabnormal = false;
+            this.tableDatatop[index].isabnormal = obj.isabnormal;
           }
           this.$forceUpdate();
         }
@@ -2380,15 +2477,18 @@
   .manual-action {
     flex: 1;
     min-width: 0;
-    height: 100%; /* 纭繚楂樺害缁ф壙 */
+    height: 100%;
+    /* 纭繚楂樺害缁ф壙 */
   }
 
   .call-action {
     width: 60%;
     min-width: 0;
-    height: 100%; /* 纭繚楂樺害缁ф壙 */
+    height: 100%;
+    /* 纭繚楂樺害缁ф壙 */
   }
 }
+
 .numeric-input {
   position: relative;
 }
@@ -2405,6 +2505,7 @@
   padding: 2px 6px;
   border-radius: 4px;
 }
+
 .call-container {
   padding: 20px;
   background: #fff;
@@ -2434,11 +2535,13 @@
     margin-top: 20px;
   }
 }
+
 .merge-controls {
   background: #f5f7fa;
   border-radius: 4px;
   margin-left: 20px;
 }
+
 .Followuserinfo {
   margin: 10px 10px 0 10px;
   align-items: center;
@@ -2472,8 +2575,10 @@
   background: #ffff;
   border: 1px solid #dcdfe6;
   box-shadow: 0 2px 4px 0 rgba(0, 0, 0, 0.12), 0 0 6px 0 rgba(0, 0, 0, 0.04);
-  height: 100%; /* 纭繚楂樺害缁ф壙 */
-  min-height: 880px; /* 鏈�灏忛珮搴︿笌闅忚鍐呭涓�鑷� */
+  height: 100%;
+  /* 纭繚楂樺害缁ф壙 */
+  min-height: 880px;
+  /* 鏈�灏忛珮搴︿笌闅忚鍐呭涓�鑷� */
   display: flex;
   flex-direction: column;
 
@@ -2493,11 +2598,15 @@
 
   .el-form {
     flex: 1;
-    overflow-y: auto; /* 鍐呭瓒呰繃楂樺害鏃舵樉绀烘粴鍔ㄦ潯 */
-    max-height: calc(880px - 60px); /* 鍑忓幓padding */
-    padding-right: 10px; /* 闃叉婊氬姩鏉¢伄鎸″唴瀹� */
+    overflow-y: auto;
+    /* 鍐呭瓒呰繃楂樺害鏃舵樉绀烘粴鍔ㄦ潯 */
+    max-height: calc(880px - 60px);
+    /* 鍑忓幓padding */
+    padding-right: 10px;
+    /* 闃叉婊氬姩鏉¢伄鎸″唴瀹� */
   }
 }
+
 .append-input-container {
   margin-top: 15px;
   padding: 10px;
@@ -2505,6 +2614,7 @@
   border-radius: 4px;
   border: 1px solid #dcdfe6;
 }
+
 .borderdiv {
   min-height: 60vh;
   font-size: 20px;
@@ -2543,14 +2653,111 @@
     }
   }
 }
+
 .topic-dev[inert] {
   opacity: 0.5;
   pointer-events: none;
 }
+/* 鎸傛柇瀹瑰櫒鏍峰紡 */
+.hangup-container {
+  display: flex;
+  flex-direction: column;
+  align-items: center;
+  gap: 10px;
+  margin: 15px 0;
+}
+
+.hangup-btn {
+  width: 120px;
+  height: 40px;
+  font-size: 14px;
+  border-radius: 20px;
+  box-shadow: 0 2px 8px rgba(244, 67, 54, 0.3);
+  transition: all 0.3s ease;
+}
+
+.hangup-btn:hover:not(:disabled) {
+  transform: translateY(-2px);
+  box-shadow: 0 4px 12px rgba(244, 67, 54, 0.4);
+}
+
+/* 閫氳瘽璁℃椂鍣� */
+.call-timer {
+  font-size: 12px;
+  color: #666;
+  background: #f5f5f5;
+  padding: 4px 12px;
+  border-radius: 12px;
+  font-family: "Courier New", monospace;
+}
+
+/* 鐘舵�佹彁绀哄鍣� */
+.call-status-container {
+  margin: 10px 0;
+}
+
+.status-alert {
+  border-radius: 8px;
+  transition: all 0.3s ease;
+}
+
+.status-alert.status-calling {
+  border-left: 4px solid #e6a23c;
+}
+
+.status-alert.status-connected {
+  border-left: 4px solid #67c23a;
+  animation: pulse 2s infinite;
+}
+
+.status-alert.status-ended {
+  border-left: 4px solid #909399;
+}
+
+/* SIP娉ㄥ唽鎻愮ず */
+.sip-registering {
+  margin: 10px 0;
+}
+
+.registering-alert {
+  border-radius: 8px;
+  background-color: #f4f4f5;
+  border-left: 4px solid #909399;
+}
+
+/* 鍔ㄧ敾鏁堟灉 */
+@keyframes pulse {
+  0% {
+    opacity: 1;
+  }
+  50% {
+    opacity: 0.7;
+  }
+  100% {
+    opacity: 1;
+  }
+}
+
+/* 鍝嶅簲寮忚璁� */
+@media (max-width: 768px) {
+  .hangup-container {
+    margin: 10px 0;
+  }
+
+  .hangup-btn {
+    width: 100%;
+    max-width: 200px;
+  }
+
+  .status-alert {
+    font-size: 12px;
+  }
+}
 .CONTENT {
   padding: 10px;
   height: 100%;
-  min-height: 738px; /* 璁剧疆鏈�灏忛珮搴� */
+  min-height: 738px;
+  /* 璁剧疆鏈�灏忛珮搴� */
 
   .title {
     font-size: 22px;
@@ -2565,8 +2772,10 @@
   padding: 30px;
   border: 1px solid #dcdfe6;
   box-shadow: 0 2px 4px 0 rgba(0, 0, 0, 0.12), 0 0 6px 0 rgba(0, 0, 0, 0.04);
-  max-height: 618px; /* 璁剧疆鏈�澶ч珮搴� */
-  overflow-y: auto; /* 鍐呭瓒呰繃楂樺害鏃舵樉绀烘粴鍔ㄦ潯 */
+  max-height: 618px;
+  /* 璁剧疆鏈�澶ч珮搴� */
+  overflow-y: auto;
+  /* 鍐呭瓒呰繃楂樺害鏃舵樉绀烘粴鍔ㄦ潯 */
 
   .topic-dev {
     margin-bottom: 25px;
@@ -2615,6 +2824,18 @@
   }
 }
 
+/* 寮傚父鐘舵�佹牱寮� - 绾㈣壊 (淇濇寔涓嶅彉) */
+.scriptTopic-isabnormal {
+  color: red;
+}
+
+/* 鏂板锛氳鍛婄姸鎬佹牱寮� - 榛勮壊 */
+.scriptTopic-warning {
+  color: #d4be00;
+  /* 鎮ㄦ寚瀹氱殑榛勮壊 */
+}
+
+/* 寮傚父閫夐」鏍峰紡 - 绾㈣壊鏄熷彿 (淇濇寔涓嶅彉) */
 .red-star {
   ::v-deep.el-radio__label {
     position: relative;
@@ -2628,25 +2849,45 @@
     right: -5px;
     top: 0;
   }
+}
 
-  ::v-deep.el-input-group__textarea {
-    white-space: pre-wrap;
-    word-break: break-all;
-  }
-
-  ::v-deep.el-checkbox__label {
+/* 鏂板锛氳鍛婇�夐」鏍峰紡 - 榛勮壊鏄熷彿 */
+.yellow-star {
+  ::v-deep.el-radio__label {
     position: relative;
     padding-right: 10px;
   }
 
-  ::v-deep.el-checkbox__label::after {
+  ::v-deep.el-radio__label::after {
     content: "*";
-    color: red;
+    color: #ffe202;
+    /* 榛勮壊鏄熷彿 */
     position: absolute;
     right: -5px;
     top: 0;
+    font-weight: bold;
   }
 }
+
+/* 鍏辩敤鏍峰紡淇濇寔涓嶅彉 */
+::v-deep.el-input-group__textarea {
+  white-space: pre-wrap;
+  word-break: break-all;
+}
+
+::v-deep.el-checkbox__label {
+  position: relative;
+  padding-right: 10px;
+}
+
+::v-deep.el-checkbox__label::after {
+  content: "*";
+  color: red;
+  position: absolute;
+  right: -5px;
+  top: 0;
+}
+
 .tag-selector-container {
   display: flex;
   align-items: center;
@@ -2683,9 +2924,11 @@
 .tag-normal {
   background-color: #7ff5e1;
 }
+
 .tag-abnormal {
   background-color: #f75c5c;
 }
+
 .tag-warning {
   background-color: #fbfb4a;
 }
@@ -2695,6 +2938,7 @@
   color: #909399;
   cursor: pointer;
 }
+
 ::v-deep.offside-value .el-radio__label {
   color: #fff;
 }
@@ -2744,6 +2988,7 @@
   color: #080808 !important;
   cursor: not-allowed;
 }
+
 /* 鍘熸湁鐨勬牱寮忎繚鎸佷笉鍙橈紝娣诲姞浠ヤ笅鍝嶅簲寮忎唬鐮� */
 
 .Followupdetailspage {
@@ -2755,12 +3000,13 @@
 
 .action-container {
   display: flex;
-  flex-direction: row; /* 榛樿妯悜鎺掑垪 */
+  flex-direction: row;
+  /* 榛樿妯悜鎺掑垪 */
   gap: 20px;
   margin: 0 10px 20px 10px;
 
   /* 褰撶缉鏀炬瘮渚嬪ぇ浜�100%鎴栧睆骞曞搴﹁緝灏忔椂鏀逛负涓婁笅鎺掑垪 */
-  @media screen and  (min-resolution: 1.5dppx) {
+  @media screen and (min-resolution: 1.5dppx) {
     flex-direction: column;
 
     .call-action,
@@ -2898,7 +3144,8 @@
 
 /* 纭繚鍐呭鍦ㄧ缉鏀炬椂淇濇寔鍙鎬� */
 .headline {
-  font-size: clamp(18px, 2vw, 24px); /* 浣跨敤clamp鍑芥暟纭繚瀛椾綋澶у皬鍦ㄥ悎鐞嗚寖鍥村唴 */
+  font-size: clamp(18px, 2vw, 24px);
+  /* 浣跨敤clamp鍑芥暟纭繚瀛椾綋澶у皬鍦ㄥ悎鐞嗚寖鍥村唴 */
 }
 
 /* 涓虹Щ鍔ㄨ澶囦紭鍖栨粴鍔ㄤ綋楠� */

--
Gitblit v1.9.3