From 2afa2f5a9c451a9e9a081e49b5a9ee5c75d66ac6 Mon Sep 17 00:00:00 2001
From: WXL (wul) <wl_5969728@163.com>
Date: 星期一, 13 四月 2026 10:35:45 +0800
Subject: [PATCH] 测试完成

---
 vue.config.js                                     |    4 
 src/views/followvisit/record/detailpage/index.vue |  118 +++++++++++----------------------------
 xhyy.zip                                          |    0 
 3 files changed, 35 insertions(+), 87 deletions(-)

diff --git a/src/views/followvisit/record/detailpage/index.vue b/src/views/followvisit/record/detailpage/index.vue
index 5d10928..955da10 100644
--- a/src/views/followvisit/record/detailpage/index.vue
+++ b/src/views/followvisit/record/detailpage/index.vue
@@ -447,7 +447,7 @@
                       <div class="scriptTopic-dev" :key="index" v-else>
                         <div class="dev-text">
                           {{ index + 1 }}銆乕闂瓟]<span>{{
-                            item.scriptContent
+                            item.questiontext
                           }}</span>
                           <span v-if="item.valueType == 3">(鍙兘杈撳叆鏁板瓧)</span>
                         </div>
@@ -1570,8 +1570,6 @@
   methods: {
     // 鑾峰彇涓婚鏍峰紡绫�
     getTopicClass(item) {
-      console.log(item.isabnormal, "getTopicClass");
-
       // 鏍规嵁鐘舵�佸�艰繑鍥炲搴旂殑鏍峰紡绫�
       if (item.isabnormal == 1) {
         return "scriptTopic-isabnormal"; // 寮傚父 - 绾㈣壊
@@ -1614,13 +1612,15 @@
           this.tableDatatop = res.data.scriptResult;
 
           this.tableDatatop.forEach((item) => {
-            if (item.scriptType == 2) item.scriptResult = [];
             if (item.scriptResultId && item.scriptType != 2) {
               item.isoption = 3;
               item.scriptResult = item.scriptResult;
             } else if (item.scriptResultId && item.scriptType == 2) {
+              console.log(item.scriptResult, "item.scriptResult");
               item.scriptResult = item.scriptResult.split("&");
               item.isoption = 3;
+            } else if (!item.scriptResultId && item.scriptType == 2) {
+              item.scriptResult = [];
             }
           });
           this.taskname = res.data.taskName;
@@ -1744,7 +1744,7 @@
             if (item.targetvalue) {
               item.scriptResult = item.targetvalue.split("&");
             } else {
-              item.scriptResult = [];
+              item.scriptResult = item.asrtext;
             }
           });
 
@@ -1773,8 +1773,6 @@
             }
             if (item.targetvalue) {
               item.scriptResult = item.targetvalue.split("&");
-            } else {
-              item.scriptResult = [];
             }
           });
         }
@@ -1783,17 +1781,17 @@
     // 鍖绘姢浜哄憳瀛樺偍鏁版嵁
     getdetail() {
       console.log(1);
-
       let excep = "";
-      const promises = [];
+
+      // 鍏堝鐞� tableDatatop 涓殑鏁版嵁
       this.tableDatatop.forEach((item) => {
         if (item.valueType == 3 && item.scriptResult) {
-          // 楠岃瘉鏄惁涓烘湁鏁堟暟瀛�
           if (!/^\d+$/.test(item.scriptResult)) {
             this.$message.error(`闂 "${item.scriptContent}" 蹇呴』杈撳叆鏁板瓧`);
             return;
           }
         }
+
         var objs = item.svyTaskTemplateTargetoptions.find(
           (items) => items.optioncontent == item.scriptResult
         );
@@ -1804,37 +1802,36 @@
             this.selectedTag = objs.isabnormal;
           }
         }
-        console.log(excep, "excep");
 
-        let obj = {
-          asrtext: null,
-          patid: this.patid,
-          subId: this.id,
-          taskid: this.taskid,
-          scriptid: item.id,
-          excep: excep,
-          questiontext: item.scriptContent,
-          categoryid: item.categoryid,
-          answerps: item.answerps || null, // 娣诲姞闄勫姞淇℃伅
-        };
-        if (item.scriptType == 2 && item.scriptResult[0]) {
-          obj.asrtext = item.scriptResult.join("&");
-          obj.ivrtext = item.scriptResult.join("&");
+        // 澶勭悊 scriptResult锛岀洿鎺ヤ慨鏀瑰師濮嬫暟鎹�
+        if (item.scriptType == 2 && item.scriptResult) {
+          // 澶勭悊鏁扮粍绫诲瀷鐨� scriptResult
+          if (
+            Array.isArray(item.scriptResult) &&
+            item.scriptResult.length > 0
+          ) {
+            item.originalScriptResult = item.scriptResult; // 淇濆瓨鍘熷鏁扮粍锛堝彲閫夛級
+            item.scriptResult = item.scriptResult.join("&"); // 杞崲涓哄瓧绗︿覆
+          }
         } else if (item.scriptType != 2 && item.scriptResult) {
-          obj.asrtext = item.scriptResult;
-          obj.ivrtext = item.scriptResult;
+          // 纭繚闈炴暟缁勭被鍨嬪凡缁忔槸瀛楃涓�
+          if (Array.isArray(item.scriptResult)) {
+            item.originalScriptResult = item.scriptResult; // 淇濆瓨鍘熷鏁扮粍锛堝彲閫夛級
+            item.scriptResult =
+              item.scriptResult.length > 0 ? item.scriptResult[0] : "";
+          }
         }
-
-        // if (item.isoption == 3) {
-        //   promises.push(serviceSubtaskDetailedit(obj));
-        // } else {
-        //   promises.push(serviceSubtaskDetailadd(obj));
-        // }
       });
-      console.log(2);
-      console.log(this.tableDatatop);
+
+      // 鍒涘缓鍓湰鐢ㄤ簬淇濆瓨锛岄伩鍏嶅奖鍝嶆樉绀�
+      const saveData = this.tableDatatop.map((item) => ({
+        ...item,
+        // 濡傛灉闇�瑕侊紝鍙互鍦ㄨ繖閲屽仛鏈�鍚庣殑鏁版嵁娓呯悊
+        scriptResult: item.scriptResult || "", // 纭繚涓嶄负 undefined
+      }));
+
       let obj = {
-        svyTaskTemplateScriptVOS: this.tableDatatop, // 鎻愪氦澶勭悊鍚庣殑鍓湰
+        svyTaskTemplateScriptVOS: saveData, // 浣跨敤澶勭悊鍚庣殑鏁版嵁
         param1: this.taskid,
         param2: this.patid,
         param6: this.id,
@@ -1875,51 +1872,6 @@
             });
         }
       });
-      // 浣跨敤 Promise.all 绛夊緟鎵�鏈夊紓姝ユ搷浣滃畬鎴�
-      // Promise.all(promises)
-      //   .then((results) => {
-      //     // 鎵�鏈夊紓姝ユ搷浣滄垚鍔熷畬鎴愬悗鐨勯�昏緫
-      //     results.forEach((res) => {
-      //       if (res.code !== 200) {
-      //         this.$modal.error("淇敼澶辫触");
-      //       }
-      //     });
-      //     this.Editsingletasksonyic(6);
-      //     const orgName = localStorage.getItem("orgname");
-      //     console.log(orgName, "orgName");
-
-      //     if (this.form.isVisitAgain != 1 || orgName == "涓芥按甯備腑鍖婚櫌") {
-      //       this.Torouter();
-      //       return;
-      //     }
-      //     this.$modal
-      //       .confirm(
-      //         '浠诲姟淇濆瓨鎴愬姛鏄惁閽堝鎮h�咃細"' +
-      //           this.userform.name +
-      //           '"鍐嶆闅忚锛�',
-      //         "纭",
-      //         {
-      //           confirmButtonText: "纭畾",
-      //           cancelButtonText: "鍙栨秷",
-      //           showCancelButton: true,
-      //           dangerouslyUseHTMLString: true,
-      //           confirmButtonClass: "custom-confirm-button", // 鑷畾涔夌‘璁ゆ寜閽殑绫诲悕
-      //           cancelButtonClass: "custom-cancel-button", // 鑷畾涔夊彇娑堟寜閽殑绫诲悕
-      //         }
-      //       )
-      //       .then(() => {
-      //         document.querySelector("#app").scrollTo(0, 0);
-      //         this.formtidy();
-      //         this.dialogFormVisible = true;
-      //       })
-      //       .catch(() => {
-      //         this.Torouter();
-      //       });
-      //   })
-      //   .catch((error) => {
-      //     // 濡傛灉鏈変换浣曚竴涓紓姝ユ搷浣滃け璐ワ紝浼氳繘鍏ヨ繖閲�
-      //     console.error("鍙戠敓閿欒锛�", error);
-      //   });
     },
     Torouter() {
       if (this.form.serviceType == 13) {
@@ -2050,13 +2002,9 @@
       }, 3000);
     },
     yuyingetdetail() {
-      console.log("c", 1);
-
       const dataToSubmit = JSON.parse(JSON.stringify(this.tableDatatop));
-      console.log(dataToSubmit, 2);
 
       dataToSubmit.forEach((item, index) => {
-
         // 瀵规嫹璐濈殑鏁版嵁杩涜鎿嶄綔锛屼笉褰卞搷鍘熷鐨� scriptResult 鏁扮粍
         if (item.targetvalue) {
           item.scriptResult = item.scriptResult.join("&");
diff --git a/vue.config.js b/vue.config.js
index 7fc1739..2542f56 100644
--- a/vue.config.js
+++ b/vue.config.js
@@ -38,8 +38,8 @@
         // target: `https://www.health-y.cn/lssf`,
         // target: `http://192.168.100.10:8096`,
         // target: `http://192.168.100.10:8094`,//鐪佺珛鍚屽痉
-        target: `http://192.168.100.10:8095`,//鏂板崕
-        // target:`http://localhost:8095`,
+        // target: `http://192.168.100.10:8095`,//鏂板崕
+        target:`http://localhost:8095`,
         // target:`http://35z1t16164.qicp.vip`,
         // target: `http://192.168.100.183:8095`,
         // target: `http://192.168.101.166:8093`,
diff --git a/xhyy.zip b/xhyy.zip
new file mode 100644
index 0000000..98caa1f
--- /dev/null
+++ b/xhyy.zip
Binary files differ

--
Gitblit v1.9.3