From d54ac083e2992a5613f5cb22849db9742dbe9a9b Mon Sep 17 00:00:00 2001
From: WXL (wul) <wl_5969728@163.com>
Date: 星期三, 22 十月 2025 11:06:14 +0800
Subject: [PATCH] 问卷联调

---
 src/views/followvisit/record/detailpage/index.vue |   70 +++++++++++++++++++++++++++++------
 1 files changed, 58 insertions(+), 12 deletions(-)

diff --git a/src/views/followvisit/record/detailpage/index.vue b/src/views/followvisit/record/detailpage/index.vue
index b5dc4e7..fa48d8a 100644
--- a/src/views/followvisit/record/detailpage/index.vue
+++ b/src/views/followvisit/record/detailpage/index.vue
@@ -302,7 +302,7 @@
                               handleOptionChange(
                                 $event,
                                 index,
-                                item.svyLibTemplateTargetoptions,
+                                item.svyTaskTemplateTargetoptions,
                                 item
                               )
                             "
@@ -310,10 +310,11 @@
                             <el-radio
                               v-for="(
                                 items, indexs
-                              ) in item.svyLibTemplateTargetoptions"
+                              ) in item.svyTaskTemplateTargetoptions"
                               :class="items.isabnormal ? 'red-star' : ''"
                               :key="indexs"
                               :label="items.optioncontent"
+                               @click.native.prevent="handleRadioToggle(item, items.optioncontent)"
                               >{{ items.optioncontent }}</el-radio
                             >
                           </el-radio-group>
@@ -360,7 +361,7 @@
                               @change="$forceUpdate()"
                               v-for="(
                                 items, indexs
-                              ) in item.svyLibTemplateTargetoptions"
+                              ) in item.svyTaskTemplateTargetoptions"
                               :key="indexs"
                               :label="items.optioncontent"
                             >
@@ -436,6 +437,7 @@
                               v-for="(items, index) in item.scriptResult"
                               :key="items"
                               :label="items"
+                               @click.native.prevent="handleRadioToggle(item, items.optioncontent)"
                               >{{ items }}</el-radio
                             >
                           </el-radio-group>
@@ -1013,6 +1015,21 @@
         <el-button type="primary" @click="setupsubtask">纭鍒涘缓鏈嶅姟</el-button>
       </div>
     </el-dialog>
+    <div class="main-content" v-if="orgname == '鏅畞鐣叉棌鑷不鍘夸汉姘戝尰闄�'">
+      <!-- <el-button @click="CaldialogVisible = true">鎵撳紑寮规</el-button> -->
+
+      <!-- 寮规璋冪敤 -->
+      <el-dialog
+        title="鍛煎彨鍔熻兘妗�"
+        :visible.sync="CaldialogVisible"
+        width="60%"
+      >
+        <CallCenterLs
+          ref="callCenterModal"
+          :initial-phone="currentPhoneNumber"
+        />
+      </el-dialog>
+    </div>
   </div>
 </template>
 
@@ -1038,10 +1055,12 @@
 } from "@/api/patient/homepage";
 import CallButton from "@/components/CallButton";
 import MergeAndModify from "./MergeAndModify.vue";
+import CallCenterLs from "@/components/CallCenterLs";
 export default {
   components: {
     CallButton,
     MergeAndModify,
+    CallCenterLs,
   },
   directives: {
     numericOnly: {
@@ -1125,6 +1144,7 @@
       // 宸叉湁鏁版嵁...
       callStatus: "idle", // idle, calling, connected, ended, failed
       isEndingCall: false,
+      CaldialogVisible: false,
       currentCall: null, // 褰撳墠閫氳瘽瀵硅薄
       input: "浠婂ぉ韬綋杩樹笉閿�",
       radio: "2",
@@ -1541,7 +1561,7 @@
             return;
           }
         }
-        var objs = item.svyLibTemplateTargetoptions.find(
+        var objs = item.svyTaskTemplateTargetoptions.find(
           (items) => items.optioncontent == item.scriptResult
         );
         if (obj) {
@@ -1673,8 +1693,13 @@
         this.$message.error("璇疯緭鍏ユ纭殑鎵嬫満鍙风爜");
         return;
       }
-
       this.currentPhoneNumber = phone;
+      // 鍛煎彨鍒ゆ柇
+      if (this.orgname == "鏅畞鐣叉棌鑷不鍘夸汉姘戝尰闄�") {
+        this.CaldialogVisible = true;
+        return;
+      }
+
       this.callType = type;
       this.callStatus = "calling";
 
@@ -1721,7 +1746,10 @@
       }, 3000);
     },
     yuyingetdetail() {
-      this.tableDatatop.forEach((item, index) => {
+      const dataToSubmit = JSON.parse(JSON.stringify(this.tableDatatop));
+
+      dataToSubmit.forEach((item, index) => {
+        // 瀵规嫹璐濈殑鏁版嵁杩涜鎿嶄綔锛屼笉褰卞搷鍘熷鐨� scriptResult 鏁扮粍
         item.scriptResult = item.scriptResult.join("&");
         item.templatequestionnum = index + 1;
         item.subId = this.id;
@@ -1733,8 +1761,9 @@
         item.patid = this.patid;
         item.templateid = item.templateID;
       });
+
       let obj = {
-        serviceSubtaskDetailList: this.tableDatatop,
+        serviceSubtaskDetailList: dataToSubmit, // 鎻愪氦澶勭悊鍚庣殑鍓湰
         param1: this.taskid,
         param2: this.patid,
         subId: this.id,
@@ -1812,11 +1841,11 @@
           this.form = res.rows[0].serviceSubtaskList.find(
             (item) => item.id == this.id
           );
-          console.log(this.form.serviceType, "serviceType");
+          console.log(this.form, "serviceType");
 
           this.logsheetlist = res.rows[0].serviceSubtaskList;
-          this.templateid = this.logsheetlist[0].templateid;
-          this.selectedTag = this.logsheetlist[0].excep;
+          this.templateid = this.form.templateid;
+          this.selectedTag = this.form.excep;
           const targetDate = new Date(this.form.longSendTime); // 鐩爣鏃ユ湡
           const now = new Date(); // 褰撳墠鏃堕棿
           if (now < targetDate && this.form.sendstate == 2) {
@@ -1987,7 +2016,7 @@
           (item) => item.optioncontent == a
         );
       } else {
-        var obj = this.tableDatatop[b].svyLibTemplateTargetoptions.find(
+        var obj = this.tableDatatop[b].svyTaskTemplateTargetoptions.find(
           (item) => item.optioncontent == a
         );
       }
@@ -1997,6 +2026,23 @@
         this.tableDatatop[b].isabnormal = false;
       }
       this.$forceUpdate();
+    },
+    // 鏂板鐨勫垏鎹㈤�変腑/鍙栨秷閫変腑鏂规硶
+    handleRadioToggle(questionItem, optionValue) {
+      // 濡傛灉鐐瑰嚮鐨勬槸褰撳墠宸查�変腑鐨勯�夐」锛屽垯鍙栨秷閫変腑
+      if (questionItem.scriptResult === optionValue) {
+        questionItem.scriptResult = ""; // 娓呯┖閫変腑鍊�
+        // 鍚屾椂閲嶇疆涓庨�夐」鐩稿叧鐨勭姸鎬�
+        questionItem.isabnormal = false;
+        questionItem.showAppendInput = false;
+        // 娉ㄦ剰锛氬彇娑堥�変腑鏃讹紝鎴戜滑閫氬父涓嶅笇鏈涜Е鍙戦鐩烦杞�昏緫锛屾墍浠ョ洿鎺ヨ繑鍥�
+        // 濡傛灉闇�瑕侊紝鍙互鍦ㄨ繖閲屾坊鍔犲彇娑堥�変腑鍚庣殑鐗瑰畾閫昏緫锛屼緥濡傞噸缃鐩簭鍒�
+      } else {
+        // 濡傛灉鐐瑰嚮鐨勬槸鏈�変腑鐨勯�夐」锛屽垯閫氳繃鏇存敼缁戝畾鍊兼潵瑙﹀彂鍘熷鐨� handleOptionChange 鏂规硶
+        // 杩欓噷鍙渶瑕佹敼鍙� v-model 缁戝畾鐨勫�硷紝change浜嬩欢浼氳嚜鍔ㄨЕ鍙�
+        questionItem.scriptResult = optionValue;
+        // 鍚庣画鐨勮烦杞瓑澶嶆潅閫昏緫浼氬湪 handleOptionChange 涓甯告墽琛�
+      }
     },
     // 鍦╩ethods閮ㄥ垎锛屼慨鏀筯andleOptionChange鏂规硶:
     handleOptionChange(selectedOption, questionIndex, options, a) {
@@ -2092,7 +2138,7 @@
     },
     overdata() {
       this.tableDatatop.forEach((item, index) => {
-        var obj = item.svyLibTemplateTargetoptions.find(
+        var obj = item.svyTaskTemplateTargetoptions.find(
           (items) => items.optioncontent == item.scriptResult
         );
         if (obj) {

--
Gitblit v1.9.3