From 055c1f8a3ff936b777e625dcb782edf2ccfb0f59 Mon Sep 17 00:00:00 2001
From: WXL (wul) <wl_5969728@163.com>
Date: 星期五, 03 四月 2026 09:55:25 +0800
Subject: [PATCH] 测试完成

---
 src/views/followvisit/record/detailpage/index.vue |  121 ++++++++++++++++++++++++++++++---------
 1 files changed, 92 insertions(+), 29 deletions(-)

diff --git a/src/views/followvisit/record/detailpage/index.vue b/src/views/followvisit/record/detailpage/index.vue
index 0d8c44c..a58c449 100644
--- a/src/views/followvisit/record/detailpage/index.vue
+++ b/src/views/followvisit/record/detailpage/index.vue
@@ -655,6 +655,23 @@
                     </el-input>
                   </el-form-item>
                 </el-col>
+                <el-col :span="10">
+                  <el-form-item
+                    label="鐭彿鐢佃瘽"
+                    v-if="orgname == '鏅畞鐣叉棌鑷不鍘夸汉姘戝尰闄�'"
+                  >
+                    <el-input
+                      placeholder="鑱旂郴鐢佃瘽缂哄け"
+                      v-model="userform.telshortcode"
+                    >
+                      <el-button
+                        slot="append"
+                        icon="el-icon-phone"
+                        @click="handleCall(userform.telshortcode, 'tel', true)"
+                      ></el-button>
+                    </el-input>
+                  </el-form-item>
+                </el-col>
               </el-row>
 
               <!-- 鑱旂郴浜轰俊鎭 -->
@@ -1108,6 +1125,7 @@
   serviceSubtaskDetailedit,
   serviceSubtaskDetailadd,
   updatePersonVoices,
+  savequestiondetail,
   addPersonVoices,
   query360PatInfo,
   sendMsg,
@@ -1742,11 +1760,13 @@
         if (res.code == 200) {
           this.tableDatatop = res.data.ivrTaskTemplateScriptVOList;
           this.tableDatatop.forEach((item) => {
+            item.scriptID = item.id;
             item.id = null;
             // 绫诲瀷鍒ゆ柇璧嬪��
             if (item.ivrTaskScriptTargetoptionList) {
               item.targetvalue = 1;
               item.questiontext = item.scriptContent;
+
               item.targetvalue = item.ivrTaskScriptTargetoptionList
                 .map((obj) => obj.targetvalue)
                 .join("&");
@@ -1797,29 +1817,31 @@
         };
         if (item.scriptType == 2 && item.scriptResult[0]) {
           obj.asrtext = item.scriptResult.join("&");
+          obj.ivrtext = item.scriptResult.join("&");
         } else if (item.scriptType != 2 && item.scriptResult) {
           obj.asrtext = item.scriptResult;
+          obj.ivrtext = item.scriptResult;
         }
 
-        if (item.isoption == 3) {
-          promises.push(serviceSubtaskDetailedit(obj));
-        } else {
-          promises.push(serviceSubtaskDetailadd(obj));
-        }
+        // if (item.isoption == 3) {
+        //   promises.push(serviceSubtaskDetailedit(obj));
+        // } else {
+        //   promises.push(serviceSubtaskDetailadd(obj));
+        // }
       });
-
-      // 浣跨敤 Promise.all 绛夊緟鎵�鏈夊紓姝ユ搷浣滃畬鎴�
-      Promise.all(promises)
-        .then((results) => {
-          // 鎵�鏈夊紓姝ユ搷浣滄垚鍔熷畬鎴愬悗鐨勯�昏緫
-          results.forEach((res) => {
-            if (res.code !== 200) {
-              this.$modal.error("淇敼澶辫触");
-            }
-          });
+      console.log(this.tableDatatop);
+      let obj = {
+        svyTaskTemplateScriptVOS: this.tableDatatop, // 鎻愪氦澶勭悊鍚庣殑鍓湰
+        param1: this.taskid,
+        param2: this.patid,
+        param6: this.id,
+        type: 2,
+      };
+      savequestiondetail(obj).then((res) => {
+        if (res.code == 200) {
+          this.$modal.msgSuccess("鏈嶅姟淇濆瓨鎴愬姛");
           this.Editsingletasksonyic(6);
           const orgName = localStorage.getItem("orgname");
-          console.log(orgName, "orgName");
 
           if (this.form.isVisitAgain != 1 || orgName == "涓芥按甯備腑鍖婚櫌") {
             this.Torouter();
@@ -1848,11 +1870,53 @@
             .catch(() => {
               this.Torouter();
             });
-        })
-        .catch((error) => {
-          // 濡傛灉鏈変换浣曚竴涓紓姝ユ搷浣滃け璐ワ紝浼氳繘鍏ヨ繖閲�
-          console.error("鍙戠敓閿欒锛�", error);
-        });
+        }
+      });
+      // 浣跨敤 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) {
@@ -1913,8 +1977,8 @@
     isValidPhone(phone) {
       return this.validatePhoneNumber(phone).isValid;
     },
-    handleCall(phone, type) {
-      if (!this.isValidPhone(phone)) {
+    handleCall(phone, type, dh) {
+      if (!this.isValidPhone(phone) && !dh) {
         this.$message.error("璇疯緭鍏ユ纭殑鎵嬫満鍙风爜");
         return;
       }
@@ -1984,8 +2048,6 @@
     },
     yuyingetdetail() {
       const dataToSubmit = JSON.parse(JSON.stringify(this.tableDatatop));
-      console.log(dataToSubmit, "dataToSubmit");
-      // return;
       dataToSubmit.forEach((item, index) => {
         // 瀵规嫹璐濈殑鏁版嵁杩涜鎿嶄綔锛屼笉褰卞搷鍘熷鐨� scriptResult 鏁扮粍
         item.scriptResult = item.scriptResult.join("&");
@@ -1993,6 +2055,7 @@
         item.subId = this.id;
         item.taskid = this.taskid;
         item.asrtext = item.matchedtext;
+        item.ivrtext = item.matchedtext;
         if (!item.id) {
           item.isoperation = 1;
         }
@@ -2001,10 +2064,11 @@
       });
 
       let obj = {
-        serviceSubtaskDetailList: dataToSubmit, // 鎻愪氦澶勭悊鍚庣殑鍓湰
+        ivrTaskTemplateScriptVOList: dataToSubmit, // 鎻愪氦澶勭悊鍚庣殑鍓湰
         param1: this.taskid,
         param2: this.patid,
-        subId: this.id,
+        param6: this.id,
+        type: 1,
       };
       const orgName = localStorage.getItem("orgname");
       console.log(orgName, "orgName");
@@ -2013,7 +2077,7 @@
         this.Torouter();
         return;
       }
-      addPersonVoices(obj).then((res) => {
+      savequestiondetail(obj).then((res) => {
         if (res.code == 200) {
           this.$modal.msgSuccess("鏈嶅姟淇濆瓨鎴愬姛");
           this.$modal
@@ -2074,7 +2138,6 @@
           this.form = res.rows[0].serviceSubtaskList.find(
             (item) => item.id == this.id
           );
-          console.log(this.form, "serviceType");
 
           this.logsheetlist = res.rows[0].serviceSubtaskList;
           this.templateid = this.form.templateid;

--
Gitblit v1.9.3