From 55f9876e876c7ddfcc2a7a2b870dfc224c9467a6 Mon Sep 17 00:00:00 2001
From: WXL (wul) <wl_5969728@163.com>
Date: 星期三, 01 四月 2026 17:28:43 +0800
Subject: [PATCH] 测试完成

---
 vue.config.js                                          |    4 
 src/views/followvisit/discharge/js/prototype.js        |    2 
 src/views/followvisit/record/detailpage/index.vue      |  105 
 src/views/knowledge/questionbank/particulars/index.vue |  166 +
 src/api/AiCentre/Qtemplate.js                          |    8 
 src/views/Satisfaction/configurationmyd/index.vue      | 1061 +++++++++--
 src/views/followvisit/record/detailpage/index copy.vue | 3703 +++++++++++++++++++++++++++++++++++++++++++
 src/views/followvisit/discharge/index.vue              |    4 
 src/views/patient/propaganda/QuestionnaireTask.vue     |    1 
 9 files changed, 4,726 insertions(+), 328 deletions(-)

diff --git a/src/api/AiCentre/Qtemplate.js b/src/api/AiCentre/Qtemplate.js
index 479007d..c619033 100644
--- a/src/api/AiCentre/Qtemplate.js
+++ b/src/api/AiCentre/Qtemplate.js
@@ -232,3 +232,11 @@
     data: data,
   });
 }
+// 鍖绘姢淇濆瓨鏁版嵁
+export function savequestiondetail(data) {
+  return request({
+    url: "/smartor/subtaskAnswer/savequestiondetail",
+    method: "post",
+    data: data,
+  });
+}
diff --git a/src/views/Satisfaction/configurationmyd/index.vue b/src/views/Satisfaction/configurationmyd/index.vue
index 8aa3dc9..b35f056 100644
--- a/src/views/Satisfaction/configurationmyd/index.vue
+++ b/src/views/Satisfaction/configurationmyd/index.vue
@@ -5,13 +5,149 @@
       <div class="header-content">
         <h2 class="page-title">婊℃剰搴﹂鐩紓甯稿鐞嗛厤缃�</h2>
         <p class="page-description">
-          涓烘弧鎰忓害棰樼洰閰嶇疆璐d换绉戝鍜屾姤澶囩瀹わ紝浼樺寲寮傚父鍙嶉娴佺▼
+          鍩轰簬妯℃澘閰嶇疆婊℃剰搴﹂鐩殑璐d换绉戝鍜屾姤澶囩瀹�
         </p>
       </div>
     </div>
 
-    <!-- 鎼滅储鍖哄煙 -->
-    <div class="search-card">
+    <!-- 妯℃澘閫夋嫨鍖哄煙 -->
+    <div class="template-section">
+      <el-card shadow="never">
+        <div class="template-header">
+          <h3 class="template-title">妯℃澘閫夋嫨</h3>
+          <p class="template-tip">璇峰厛閫夋嫨妯℃澘绫诲瀷鍜屽叿浣撴ā鏉�</p>
+        </div>
+
+        <el-form
+          :model="templateForm"
+          :rules="templateRules"
+          ref="templateForm"
+          label-width="120px"
+          size="medium"
+        >
+          <el-row :gutter="20">
+            <el-col :span="8">
+              <el-form-item label="妯℃澘绫诲瀷" prop="templateType">
+                <el-select
+                  v-model="templateForm.templateType"
+                  placeholder="璇烽�夋嫨妯℃澘绫诲瀷"
+                  clearable
+                  @change="handleTemplateTypeChange"
+                  style="width: 100%"
+                >
+                  <el-option label="闂嵎妯℃澘" :value="1" />
+                  <el-option label="璇煶妯℃澘" :value="2" />
+                </el-select>
+              </el-form-item>
+            </el-col>
+
+            <el-col :span="8">
+              <el-form-item
+                label="閫夋嫨妯℃澘"
+                prop="templateId"
+                :rules="
+                  templateForm.templateType
+                    ? [
+                        {
+                          required: true,
+                          message: '璇烽�夋嫨妯℃澘',
+                          trigger: 'change',
+                        },
+                      ]
+                    : []
+                "
+              >
+                <el-select
+                  v-model="templateForm.templateId"
+                  placeholder="璇烽�夋嫨妯℃澘"
+                  clearable
+                  filterable
+                  :disabled="
+                    !templateForm.templateType || templateOptionsLoading
+                  "
+                  @change="handleTemplateChange"
+                  style="width: 100%"
+                >
+                  <el-option
+                    v-for="template in filteredTemplateOptions"
+                    :key="template.id"
+                    :label="template.templateName"
+                    :value="template.id"
+                  />
+                  <div
+                    v-if="templateOptionsLoading"
+                    slot="empty"
+                    class="select-loading"
+                  >
+                    <i class="el-icon-loading"></i>
+                    <span>鍔犺浇涓�...</span>
+                  </div>
+                </el-select>
+              </el-form-item>
+            </el-col>
+
+            <el-col :span="8">
+              <el-form-item>
+                <el-button
+                  type="primary"
+                  icon="el-icon-search"
+                  @click="handleLoadTemplate"
+                  :loading="templateLoading"
+                  :disabled="!templateForm.templateId"
+                >
+                  鍔犺浇妯℃澘棰樼洰
+                </el-button>
+                <el-button icon="el-icon-refresh" @click="handleResetTemplate">
+                  閲嶇疆
+                </el-button>
+              </el-form-item>
+            </el-col>
+          </el-row>
+        </el-form>
+      </el-card>
+    </div>
+
+    <!-- 妯℃澘淇℃伅 -->
+    <div v-if="currentTemplateInfo" class="template-info-section">
+      <el-card shadow="never">
+        <div class="template-info">
+          <div class="info-left">
+            <h3 class="template-name">
+              {{ currentTemplateInfo.templateName }}
+            </h3>
+            <div class="template-meta">
+              <span class="meta-item">
+                <i class="el-icon-s-order"></i>
+                妯℃澘绫诲瀷锛歿{
+                  templateForm.templateType === 1 ? "闂嵎妯℃澘" : "璇煶妯℃澘"
+                }}
+              </span>
+              <span class="meta-item">
+                <i class="el-icon-s-management"></i>
+                棰樼洰鎬绘暟锛歿{ currentTemplateInfo.questionCount || 0 }}
+              </span>
+              <span class="meta-item">
+                <i class="el-icon-star-on"></i>
+                婊℃剰搴﹂鐩細{{ satisfactionQuestionsCount }}
+              </span>
+            </div>
+          </div>
+          <div class="info-right">
+            <el-tag
+              :type="
+                currentTemplateInfo.templateStatus === 1 ? 'success' : 'info'
+              "
+              size="medium"
+            >
+              {{ currentTemplateInfo.templateStatus === 1 ? "鍚敤" : "鍋滅敤" }}
+            </el-tag>
+          </div>
+        </div>
+      </el-card>
+    </div>
+
+    <!-- 鎼滅储鍖哄煙锛堥鐩瓫閫夛級 -->
+    <div v-if="questionList.length > 0" class="search-section">
       <el-card shadow="never" class="search-container">
         <el-form :model="queryParams" :inline="true" size="medium">
           <el-form-item label="闂涓婚">
@@ -30,30 +166,16 @@
               @keyup.enter.native="handleQuery"
             />
           </el-form-item>
-          <el-form-item label="鏄惁鍙敤">
-            <el-select
-              v-model="queryParams.isavailable"
-              placeholder="璇烽�夋嫨"
-              clearable
-            >
-              <el-option
-                v-for="item in qyoptions"
-                :key="item.value"
-                :label="item.label"
-                :value="item.value"
-              />
-            </el-select>
-          </el-form-item>
           <el-form-item>
             <el-button
               type="primary"
               icon="el-icon-search"
               @click="handleQuery"
             >
-              鎼滅储
+              绛涢�夐鐩�
             </el-button>
             <el-button icon="el-icon-refresh" @click="resetQuery">
-              閲嶇疆
+              閲嶇疆绛涢��
             </el-button>
           </el-form-item>
         </el-form>
@@ -79,7 +201,9 @@
             <span v-if="changedCount > 0" class="change-count">
               鏈� {{ changedCount }} 椤归厤缃渶瑕佷繚瀛�
             </span>
-            <div class="total-count">鍏� {{ total }} 鏉¤褰�</div>
+            <div class="total-count">
+              鍏� {{ filteredQuestionList.length }} 鏉¤褰�
+            </div>
           </div>
         </el-card>
       </div>
@@ -91,18 +215,22 @@
         </div>
       </div>
 
-      <div v-else-if="questionList.length === 0" class="empty-wrapper">
-        <el-empty description="鏆傛棤婊℃剰搴﹂鐩暟鎹�">
-          <el-button type="primary" @click="getQuestionList"
-            >鍒锋柊鏁版嵁</el-button
-          >
+      <div
+        v-else-if="questionList.length === 0 && templateForm.templateId"
+        class="empty-wrapper"
+      >
+        <el-empty description="璇ユā鏉夸腑鏆傛棤婊℃剰搴﹂鐩�">
+          <p class="empty-tip">
+            璇烽�夋嫨鍏朵粬妯℃澘鎴栨鏌ユā鏉夸腑鏄惁鍖呭惈婊℃剰搴︾被鍨嬮鐩紙鍒嗙被ID:
+            404,405,406锛�
+          </p>
         </el-empty>
       </div>
 
       <!-- 涓�琛屼竴琛岀殑鍗$墖鍒楄〃 -->
-      <div v-else class="question-list">
+      <div v-else-if="filteredQuestionList.length > 0" class="question-list">
         <div
-          v-for="(question, index) in questionList"
+          v-for="(question, index) in filteredQuestionList"
           :key="question.id"
           class="question-item"
         >
@@ -124,12 +252,6 @@
                       {{ question.scriptTopic || "鏃犱富棰�" }}
                     </h3>
                     <div class="question-tags">
-                      <el-tag
-                        :type="question.isavailable == 1 ? 'danger' : 'success'"
-                        size="small"
-                      >
-                        {{ question.isavailable == 1 ? "涓嶅彲鐢�" : "鍙敤" }}
-                      </el-tag>
                       <dict-tag
                         :options="askvaluetype"
                         :value="question.scriptType"
@@ -180,7 +302,7 @@
                 class="config-form"
               >
                 <div class="config-fields">
-                  <!-- 璐d换绉戝 -->
+                  <!-- 璐d换绉戝锛堝閫夛級 -->
                   <div class="config-field">
                     <el-form-item
                       label="璐d换绉戝"
@@ -192,21 +314,25 @@
                         placeholder="璇烽�夋嫨璐d换绉戝"
                         filterable
                         clearable
+                        multiple
+                        collapse-tags
                         style="width: 100%"
                         @change="handleConfigChange(question)"
                       >
                         <el-option
                           v-for="dept in deptOptions"
                           :key="dept.id"
-                          :label="dept.name"
-                          :value="dept.id"
+                          :label="dept.label"
+                          :value="dept.deptCode"
                         />
                       </el-select>
-                      <div class="config-tip">璐熻矗澶勭悊璇ラ鐩弽棣堢殑绉戝</div>
+                      <div class="config-tip">
+                        璐熻矗澶勭悊璇ラ鐩弽棣堢殑绉戝锛屽彲澶氶��
+                      </div>
                     </el-form-item>
                   </div>
 
-                  <!-- 鎶ュ绉戝 -->
+                  <!-- 鎶ュ绉戝锛堝閫夛級 -->
                   <div class="config-field">
                     <el-form-item
                       label="鎶ュ绉戝"
@@ -219,15 +345,14 @@
                         filterable
                         clearable
                         multiple
-                        collapse-tags
                         style="width: 100%"
                         @change="handleConfigChange(question)"
                       >
                         <el-option
                           v-for="dept in deptOptions"
                           :key="dept.id"
-                          :label="dept.name"
-                          :value="dept.id"
+                          :label="dept.label"
+                          :value="dept.deptCode"
                         />
                       </el-select>
                       <div class="config-tip">
@@ -235,24 +360,31 @@
                       </div>
                     </el-form-item>
                   </div>
+                </div>
 
-                  <!-- 閫氱煡鏂瑰紡 -->
-                  <div class="config-field">
-                    <el-form-item
-                      label="閫氱煡鏂瑰紡"
-                      prop="notifyTypes"
-                      class="config-item"
-                    >
-                      <el-checkbox-group
-                        v-model="question.exceptionConfig.notifyTypes"
-                        @change="handleConfigChange(question)"
-                      >
-                        <el-checkbox label="system">绯荤粺娑堟伅</el-checkbox>
-                        <el-checkbox label="sms">鐭俊</el-checkbox>
-                        <el-checkbox label="email">閭欢</el-checkbox>
-                        <el-checkbox label="wechat">浼佷笟寰俊</el-checkbox>
-                      </el-checkbox-group>
-                    </el-form-item>
+                <!-- 褰撳墠閰嶇疆淇℃伅 -->
+                <div v-if="question.hasChanges" class="current-config">
+                  <div class="config-preview">
+                    <div class="preview-item">
+                      <span class="preview-label">璐d换绉戝锛�</span>
+                      <span class="preview-value">
+                        {{
+                          getDeptNames(
+                            question.exceptionConfig.responsibilityDept || []
+                          ).join(", ")
+                        }}
+                      </span>
+                    </div>
+                    <div class="preview-item">
+                      <span class="preview-label">鎶ュ绉戝锛�</span>
+                      <span class="preview-value">
+                        {{
+                          getDeptNames(
+                            question.exceptionConfig.reportDept || []
+                          ).join(", ")
+                        }}
+                      </span>
+                    </div>
                   </div>
                 </div>
 
@@ -299,17 +431,6 @@
           </el-card>
         </div>
       </div>
-
-      <!-- 鍒嗛〉 -->
-      <div v-if="questionList.length > 0" class="pagination-wrapper">
-        <pagination
-          v-show="total > 0"
-          :total="total"
-          :page.sync="queryParams.pageNum"
-          :limit.sync="queryParams.pageSize"
-          @pagination="getQuestionList"
-        />
-      </div>
     </div>
 
     <!-- 棰樼洰棰勮瀵硅瘽妗� -->
@@ -328,19 +449,14 @@
               :value="currentPreview.scriptType"
               size="small"
             />
-            <el-tag
-              :type="currentPreview.isavailable === 1 ? 'success' : 'danger'"
-              size="small"
-            >
-              {{ currentPreview.isavailable === 1 ? "鍙敤" : "涓嶅彲鐢�" }}
-            </el-tag>
             <el-tag v-if="currentPreview.targetname" size="small" type="info">
               {{ currentPreview.targetname }}
             </el-tag>
           </div>
         </div>
+        <!-- 妯℃澘棰樼洰灞曠ず -->
 
-        <div class="preview-content">
+        <div class="preview-content" v-if="templateForm.templateType == 1">
           <p class="preview-question">{{ currentPreview.scriptContent }}</p>
 
           <div
@@ -351,13 +467,47 @@
           >
             <el-radio-group v-model="previewAnswer">
               <el-radio
-                v-for="(option, idx) in currentPreview.svyLibScriptOptions ||
-                []"
+                v-for="(
+                  option, idx
+                ) in currentPreview.svyLibTemplateTargetoptions || []"
                 :key="idx"
                 :label="option.optioncontent"
                 class="option-item"
               >
                 {{ option.optioncontent }}
+              </el-radio>
+            </el-radio-group>
+          </div>
+
+          <div v-else class="preview-textarea">
+            <el-input
+              type="textarea"
+              placeholder="璇疯緭鍏ュ洖绛�"
+              v-model="previewAnswer"
+              :rows="4"
+            />
+          </div>
+        </div>
+        <!-- 璇煶棰樼洰灞曠ず -->
+        <div class="preview-content" v-else>
+          <p class="preview-question">{{ currentPreview.scriptContent }}</p>
+
+          <div
+            v-if="
+              currentPreview.scriptType != 3 && currentPreview.scriptType != 4
+            "
+            class="preview-options"
+          >
+            <el-radio-group v-model="previewAnswer">
+              <el-radio
+                v-for="(
+                  option, idx
+                ) in currentPreview.ivrLibaScriptTargetoptionList || []"
+                :key="idx"
+                :label="option.targetvalue"
+                class="option-item"
+              >
+                {{ option.targetvalue }}
               </el-radio>
             </el-radio-group>
           </div>
@@ -399,10 +549,16 @@
 
 <script>
 import {
-  getissuelist,
   compileissue,
-  getissueclassify,
+  compileQtemplate,
+  compileFollowup,
+  getQtemplatelist,
+  getFollowuplist,
+  getvFollowup,
+  getQtemplateobj,
+  selectInfoByConditiony,
 } from "@/api/AiCentre/index";
+import { deptTreeSelect } from "@/api/system/user";
 import store from "@/store";
 import Pagination from "@/components/Pagination";
 
@@ -411,28 +567,40 @@
   components: { Pagination },
   data() {
     return {
+      // 妯℃澘琛ㄥ崟
+      templateForm: {
+        templateType: "",
+        templateId: "",
+      },
+      templateRules: {
+        templateType: [
+          { required: true, message: "璇烽�夋嫨妯℃澘绫诲瀷", trigger: "change" },
+        ],
+      },
+
+      // 妯℃澘閫夐」
+      questionnaireTemplates: [], // 闂嵎妯℃澘鍒楄〃
+      followupTemplates: [], // 璇煶妯℃澘鍒楄〃
+      templateOptionsLoading: false,
+
+      // 褰撳墠妯℃澘淇℃伅
+      currentTemplateInfo: null,
+      templateLoading: false,
+
       // 鏌ヨ鍙傛暟
       queryParams: {
-        pageNum: 1,
-        pageSize: 10,
         scriptTopic: "",
         scriptContent: "",
-        targetname: "",
-        isavailable: "",
-        categoryids: "404,405,406", // 鍥哄畾鏌ヨ婊℃剰搴︾被鍨�
       },
 
       // 鏁版嵁鍒楄〃
       questionList: [],
-      total: 0,
       loading: false,
       batchSaving: false,
 
       // 瀛楀吀鏁版嵁
       askvaluetype: store.getters.askvaluetype || [],
       qyoptions: store.getters.usable || [],
-      mode: store.getters.mode || [],
-      languagelist: store.getters.languagelist || [],
 
       // 绉戝閫夐」
       deptOptions: [],
@@ -447,21 +615,21 @@
       hasChanges: false,
       changedCount: 0,
 
+      // 婊℃剰搴﹀垎绫籌D
+      satisfactionCategoryIds: ["404", "405", "406"],
+
       // 琛ㄥ崟楠岃瘉瑙勫垯
       configRules: {
         responsibilityDept: [
-          { required: true, message: "璇烽�夋嫨璐d换绉戝", trigger: "change" },
-        ],
-        reportDept: [
           {
             required: true,
-            message: "璇烽�夋嫨鑷冲皯涓�涓姤澶囩瀹�",
+            message: "璇疯嚦灏戦�夋嫨涓�涓矗浠荤瀹�",
             trigger: "change",
           },
           {
             validator: (rule, value, callback) => {
               if (!value || value.length === 0) {
-                callback(new Error("璇烽�夋嫨鑷冲皯涓�涓姤澶囩瀹�"));
+                callback(new Error("璇疯嚦灏戦�夋嫨涓�涓矗浠荤瀹�"));
               } else {
                 callback();
               }
@@ -469,11 +637,16 @@
             trigger: "change",
           },
         ],
-        notifyTypes: [
+        reportDept: [
+          {
+            required: true,
+            message: "璇疯嚦灏戦�夋嫨涓�涓姤澶囩瀹�",
+            trigger: "change",
+          },
           {
             validator: (rule, value, callback) => {
               if (!value || value.length === 0) {
-                callback(new Error("璇疯嚦灏戦�夋嫨涓�绉嶉�氱煡鏂瑰紡"));
+                callback(new Error("璇疯嚦灏戦�夋嫨涓�涓姤澶囩瀹�"));
               } else {
                 callback();
               }
@@ -484,17 +657,76 @@
       },
     };
   },
+  computed: {
+    // 鏍规嵁妯℃澘绫诲瀷杩囨护妯℃澘閫夐」
+    filteredTemplateOptions() {
+      if (this.templateForm.templateType === 1) {
+        return this.questionnaireTemplates;
+      } else if (this.templateForm.templateType === 2) {
+        return this.followupTemplates;
+      }
+      return [];
+    },
+
+    // 婊℃剰搴﹂鐩暟閲�
+    satisfactionQuestionsCount() {
+      return this.questionList.filter((q) =>
+        this.satisfactionCategoryIds.includes(q.categoryid?.toString())
+      ).length;
+    },
+
+    // 绛涢�夊悗鐨勯鐩垪琛�
+    filteredQuestionList() {
+      let filtered = this.questionList;
+
+      // 绛涢�夋弧鎰忓害棰樼洰
+      filtered = filtered.filter((q) =>
+        this.satisfactionCategoryIds.includes(q.categoryid?.toString())
+      );
+
+      // 搴旂敤鎼滅储鏉′欢
+      if (this.queryParams.scriptTopic) {
+        const keyword = this.queryParams.scriptTopic.toLowerCase();
+        filtered = filtered.filter(
+          (q) => q.scriptTopic && q.scriptTopic.toLowerCase().includes(keyword)
+        );
+      }
+
+      if (this.queryParams.scriptContent) {
+        const keyword = this.queryParams.scriptContent.toLowerCase();
+        filtered = filtered.filter(
+          (q) =>
+            q.scriptContent && q.scriptContent.toLowerCase().includes(keyword)
+        );
+      }
+
+      return filtered;
+    },
+  },
   created() {
     this.getDeptOptions();
-    this.getQuestionList();
+    this.loadAllTemplates();
   },
   methods: {
+    /** 鍔犺浇鎵�鏈夋ā鏉垮垪琛� */
+    loadAllTemplates() {
+      this.templateOptionsLoading = true;
+
+      // 骞惰鍔犺浇闂嵎妯℃澘鍜岃闊虫ā鏉�
+      Promise.all([
+        this.loadQuestionnaireTemplates(),
+        this.loadFollowupTemplates(),
+      ]).finally(() => {
+        this.templateOptionsLoading = false;
+      });
+    },
+
     /** 鏌ヨ绉戝鍒楄〃 */
     getDeptOptions() {
-      getissueclassify({})
+      deptTreeSelect()
         .then((res) => {
-          if (res.code === 200) {
-            this.deptOptions = res.rows || [];
+          if (res.code == 200) {
+            this.deptOptions = this.flattenArray(res.data) || [];
           }
         })
         .catch((error) => {
@@ -503,58 +735,258 @@
         });
     },
 
-    /** 鏌ヨ婊℃剰搴﹂鐩垪琛� */
-    getQuestionList() {
-      this.loading = true;
+    flattenArray(multiArray) {
+      let result = [];
+
+      function flatten(element) {
+        if (element.children && element.children.length > 0) {
+          element.children.forEach((child) => flatten(child));
+        } else {
+          let item = JSON.parse(JSON.stringify(element));
+          result.push(item);
+        }
+      }
+
+      multiArray.forEach((element) => flatten(element));
+      return result;
+    },
+
+    /** 鏍规嵁绉戝缂栫爜鑾峰彇绉戝鍚嶇О */
+    getDeptName(deptCode) {
+      if (!deptCode) return "";
+      const dept = this.deptOptions.find((d) => d.deptCode === deptCode);
+      return dept ? dept.label : deptCode;
+    },
+
+    /** 鏍规嵁绉戝缂栫爜鏁扮粍鑾峰彇绉戝鍚嶇О鏁扮粍 */
+    getDeptNames(deptCodes) {
+      if (!Array.isArray(deptCodes) || deptCodes.length === 0) return [];
+      return deptCodes
+        .map((code) => this.getDeptName(code))
+        .filter((name) => name && name.trim());
+    },
+
+    /** 妯℃澘绫诲瀷鍙樻洿 */
+    handleTemplateTypeChange() {
+      this.templateForm.templateId = "";
+      this.currentTemplateInfo = null;
       this.questionList = [];
+    },
 
-      getissuelist(this.queryParams)
+    /** 鍔犺浇闂嵎妯℃澘鍒楄〃 */
+    loadQuestionnaireTemplates() {
+      return new Promise((resolve) => {
+        getQtemplatelist({ pageSize: 1000 })
+          .then((res) => {
+            if (res.code === 200) {
+              this.questionnaireTemplates = (res.rows || []).map((item) => ({
+                id: item.svyid,
+                templateName: item.svyname,
+                isavailable: item.isavailable,
+              }));
+            } else {
+              this.$message.error(res.msg || "鍔犺浇闂嵎妯℃澘澶辫触");
+            }
+            resolve();
+          })
+          .catch((error) => {
+            console.error("鍔犺浇闂嵎妯℃澘澶辫触:", error);
+            this.$message.error("鍔犺浇闂嵎妯℃澘澶辫触");
+            resolve();
+          });
+      });
+    },
+
+    /** 鍔犺浇璇煶妯℃澘鍒楄〃 */
+    loadFollowupTemplates() {
+      return new Promise((resolve) => {
+        getFollowuplist({ pageSize: 1000 })
+          .then((res) => {
+            if (res.code === 200) {
+              this.followupTemplates = (res.rows || []).map((item) => ({
+                id: item.id,
+                templateName: item.templateName,
+                isavailable: item.isavailable,
+              }));
+            } else {
+              this.$message.error(res.msg || "鍔犺浇璇煶妯℃澘澶辫触");
+            }
+            resolve();
+          })
+          .catch((error) => {
+            console.error("鍔犺浇璇煶妯℃澘澶辫触:", error);
+            this.$message.error("鍔犺浇璇煶妯℃澘澶辫触");
+            resolve();
+          });
+      });
+    },
+
+    /** 妯℃澘閫夋嫨鍙樻洿 */
+    handleTemplateChange(templateId) {
+      if (templateId) {
+        const selectedTemplate = this.filteredTemplateOptions.find(
+          (t) => t.id === templateId
+        );
+        if (selectedTemplate) {
+          this.currentTemplateInfo = {
+            templateName: selectedTemplate.templateName,
+            templateStatus: selectedTemplate.isavailable,
+            questionCount: 0,
+          };
+        }
+      } else {
+        this.currentTemplateInfo = null;
+        this.questionList = [];
+      }
+    },
+
+    /** 鍔犺浇妯℃澘璇︽儏鍜岄鐩� */
+    handleLoadTemplate() {
+      this.$refs.templateForm.validate((valid) => {
+        if (!valid) {
+          this.$message.warning("璇峰厛閫夋嫨妯℃澘");
+          return;
+        }
+
+        this.templateLoading = true;
+        this.loading = true;
+        this.questionList = [];
+
+        if (this.templateForm.templateType === 1) {
+          this.loadQuestionnaireTemplateDetail();
+        } else if (this.templateForm.templateType === 2) {
+          this.loadFollowupTemplateDetail();
+        }
+      });
+    },
+
+    /** 鍔犺浇闂嵎妯℃澘璇︽儏 */
+    loadQuestionnaireTemplateDetail() {
+      getQtemplateobj({ svyid: this.templateForm.templateId })
         .then((res) => {
+          this.templateLoading = false;
           this.loading = false;
-          if (res.code === 200) {
-            this.questionList = (res.rows || []).map((item) => {
-              // 瑙f瀽寮傚父澶勭悊閰嶇疆
-              let exceptionConfig = {
-                responsibilityDept: "",
-                reportDept: [],
-                notifyTypes: ["system"],
-              };
 
-              try {
-                if (item.otherdata) {
-                  const otherData = JSON.parse(item.otherdata);
-                  if (otherData.exceptionConfig) {
-                    exceptionConfig = {
-                      ...exceptionConfig,
-                      ...otherData.exceptionConfig,
-                    };
-                  }
-                }
-              } catch (error) {
-                console.warn("瑙f瀽寮傚父閰嶇疆澶辫触:", error);
-              }
+          if (res.code === 200 && res.rows && res.rows.length > 0) {
+            const templateDetail = res.rows[0];
 
-              return {
-                ...item,
-                originalConfig: JSON.parse(JSON.stringify(exceptionConfig)),
-                exceptionConfig: exceptionConfig,
-                hasChanges: false,
-                saving: false,
-                saveStatus: null,
-              };
-            });
+            // 鏇存柊妯℃澘淇℃伅
+            this.currentTemplateInfo = {
+              ...templateDetail,
+              templateName: templateDetail.svyname,
+              templateStatus: templateDetail.isavailable,
+              questionCount: templateDetail.svyTemplateLibScripts?.length || 0,
+            };
 
-            this.total = res.total || 0;
-            this.updateChangedStatus();
+            // 鎻愬彇棰樼洰鍒楄〃
+            const questions = templateDetail.svyTemplateLibScripts || [];
+            this.processQuestions(questions);
+
+            this.$message.success(`鎴愬姛鍔犺浇 ${questions.length} 涓鐩甡);
           } else {
-            this.$message.error(res.msg || "鑾峰彇鏁版嵁澶辫触");
+            this.$message.error(res.msg || "鍔犺浇妯℃澘璇︽儏澶辫触");
           }
         })
         .catch((error) => {
+          this.templateLoading = false;
           this.loading = false;
-          console.error("鏌ヨ澶辫触:", error);
-          this.$message.error("鑾峰彇鏁版嵁澶辫触");
+          console.error("鍔犺浇闂嵎妯℃澘璇︽儏澶辫触:", error);
+          this.$message.error("鍔犺浇妯℃澘璇︽儏澶辫触");
         });
+    },
+
+    /** 鍔犺浇璇煶妯℃澘璇︽儏 */
+    loadFollowupTemplateDetail() {
+      getvFollowup({ id: this.templateForm.templateId })
+        .then((res) => {
+          this.templateLoading = false;
+          this.loading = false;
+
+          if (res.code === 200) {
+            const templateDetail = res.data;
+
+            // 鏇存柊妯℃澘淇℃伅
+            this.currentTemplateInfo = {
+              ...this.currentTemplateInfo,
+              templateName: templateDetail.templateName,
+              templateStatus: templateDetail.isavailable,
+              questionCount:
+                templateDetail.ivrLibaTemplateScriptVOList?.length || 0,
+            };
+
+            // 鎻愬彇棰樼洰鍒楄〃
+            const questions = templateDetail.ivrLibaTemplateScriptVOList || [];
+            this.processQuestions(questions);
+
+            this.$message.success(`鎴愬姛鍔犺浇 ${questions.length} 涓鐩甡);
+          } else {
+            this.$message.error(res.msg || "鍔犺浇妯℃澘璇︽儏澶辫触");
+          }
+        })
+        .catch((error) => {
+          this.templateLoading = false;
+          this.loading = false;
+          console.error("鍔犺浇璇煶妯℃澘璇︽儏澶辫触:", error);
+          this.$message.error("鍔犺浇妯℃澘璇︽儏澶辫触");
+        });
+    },
+
+    /** 澶勭悊棰樼洰鏁版嵁 */
+    processQuestions(questions) {
+      this.questionList = questions.map((question) => {
+        // 瑙f瀽璐d换绉戝鍜屾姤澶囩瀹�
+        let exceptionConfig = {
+          responsibilityDept: [], // 璐d换绉戝缂栫爜鏁扮粍
+          reportDept: [], // 鎶ュ绉戝缂栫爜鏁扮粍
+        };
+
+        // 浠庨鐩《灞傚瓧娈佃鍙栨暟鎹�
+        if (question.dutyDeptCode) {
+          // 浠庨�楀彿鍒嗛殧鐨勫瓧绗︿覆杞负鏁扮粍
+          exceptionConfig.responsibilityDept = question.dutyDeptCode
+            .split(",")
+            .map((code) => code.trim())
+            .filter((code) => code);
+        }
+
+        if (question.reportDeptCode) {
+          exceptionConfig.reportDept = question.reportDeptCode
+            .split(",")
+            .map((code) => code.trim())
+            .filter((code) => code);
+        }
+
+        return {
+          ...question,
+          // 缁熶竴瀛楁鍚�
+          id: question.id || question.scriptId,
+          scriptTopic: question.scriptTopic || question.scriptTopic,
+          scriptContent: question.scriptContent || question.scriptContent,
+          scriptType: question.scriptType,
+          isavailable: question.isavailable,
+          targetname: question.targetname,
+          categoryid: question.categoryid || question.categoryid,
+          originalConfig: JSON.parse(JSON.stringify(exceptionConfig)),
+          exceptionConfig: exceptionConfig,
+          hasChanges: false,
+          saving: false,
+          saveStatus: null,
+        };
+      });
+
+      this.updateChangedStatus();
+    },
+
+    /** 閲嶇疆妯℃澘閫夋嫨 */
+    handleResetTemplate() {
+      this.templateForm = {
+        templateType: "",
+        templateId: "",
+      };
+      this.currentTemplateInfo = null;
+      this.questionList = [];
+      this.resetQuery();
+      this.$refs.templateForm?.clearValidate();
     },
 
     /** 閰嶇疆鍙樻洿澶勭悊 */
@@ -582,16 +1014,24 @@
     isConfigEqual(config1, config2) {
       if (!config1 || !config2) return false;
 
-      const report1 = [...(config1.reportDept || [])].sort().join(",");
-      const report2 = [...(config2.reportDept || [])].sort().join(",");
-      const notify1 = [...(config1.notifyTypes || [])].sort().join(",");
-      const notify2 = [...(config2.notifyTypes || [])].sort().join(",");
+      const responsibility1 = [...(config1.responsibilityDept || [])]
+        .sort()
+        .join(",")
+        .toLowerCase();
+      const responsibility2 = [...(config2.responsibilityDept || [])]
+        .sort()
+        .join(",")
+        .toLowerCase();
+      const report1 = [...(config1.reportDept || [])]
+        .sort()
+        .join(",")
+        .toLowerCase();
+      const report2 = [...(config2.reportDept || [])]
+        .sort()
+        .join(",")
+        .toLowerCase();
 
-      return (
-        config1.responsibilityDept === config2.responsibilityDept &&
-        report1 === report2 &&
-        notify1 === notify2
-      );
+      return responsibility1 === responsibility2 && report1 === report2;
     },
 
     /** 鏇存柊鍙樻洿鐘舵�� */
@@ -621,64 +1061,132 @@
       question.saveStatus = null;
 
       try {
-        // 鏋勫缓淇濆瓨鏁版嵁
-        const saveData = {
-          id: question.id,
-          isoperation: 2, // 淇敼鎿嶄綔
-          ...question,
+        // 鑾峰彇褰撳墠妯℃澘璇︽儏
+        let templateDetail;
+        if (this.templateForm.templateType === 1) {
+          // 闂嵎妯℃澘
+          const res = await getQtemplateobj({
+            svyid: this.templateForm.templateId,
+          });
+          if (res.code !== 200 || !res.rows || res.rows.length === 0) {
+            throw new Error(res.msg || "鑾峰彇妯℃澘璇︽儏澶辫触");
+          }
+          templateDetail = res.rows[0];
+        } else if (this.templateForm.templateType === 2) {
+          // 璇煶妯℃澘
+          const res = await getvFollowup({ id: this.templateForm.templateId });
+          if (res.code !== 200) {
+            throw new Error(res.msg || "鑾峰彇妯℃澘璇︽儏澶辫触");
+          }
+          templateDetail = res.data;
+        }
+
+        // 鏇存柊棰樼洰閰嶇疆
+        let updatedTemplateDetail = { ...templateDetail };
+        let questionsField =
+          this.templateForm.templateType === 1
+            ? "svyTemplateLibScripts"
+            : "ivrLibaTemplateScriptVOList";
+
+        const questions = updatedTemplateDetail[questionsField] || [];
+        const questionIndex = questions.findIndex((q) => q.id === question.id);
+
+        if (questionIndex === -1) {
+          throw new Error("鏈壘鍒伴鐩�");
+        }
+
+        // 鑾峰彇绉戝鍚嶇О
+        const responsibilityDeptNames = this.getDeptNames(
+          question.exceptionConfig.responsibilityDept
+        );
+        const reportDeptNames = this.getDeptNames(
+          question.exceptionConfig.reportDept
+        );
+
+        // 鐩存帴鏇存柊棰樼洰椤跺眰瀛楁
+        questions[questionIndex] = {
+          ...questions[questionIndex],
+          // 璁剧疆Excel瑕佹眰鐨勫瓧娈�
+          dutyDeptCode: question.exceptionConfig.responsibilityDept.join(","),
+          dutyDeptName: responsibilityDeptNames.join(","),
+          reportDeptCode: question.exceptionConfig.reportDept.join(","),
+          reportDeptName: reportDeptNames.join(","),
         };
 
-        // 灏嗗紓甯搁厤缃繚瀛樺埌 otherdata
-        const otherData = JSON.parse(question.otherdata || "{}");
-        otherData.exceptionConfig = question.exceptionConfig;
-        saveData.otherdata = JSON.stringify(otherData);
+        // 鏇存柊妯℃澘
+        updatedTemplateDetail[questionsField] = questions;
 
-        // 绉婚櫎涓嶉渶瑕佺殑瀛楁
-        delete saveData.originalConfig;
-        delete saveData.hasChanges;
-        delete saveData.saving;
-        delete saveData.saveStatus;
-        delete saveData.exceptionConfig;
-
-        const response = await compileissue(saveData);
+        // 淇濆瓨妯℃澘
+        let response;
+        if (this.templateForm.templateType === 1) {
+          response = await compileQtemplate({
+            ...updatedTemplateDetail,
+            id: this.templateForm.templateId,
+            isoperation: 2,
+          });
+        } else {
+          response = await compileFollowup({
+            ...updatedTemplateDetail,
+            id: this.templateForm.templateId,
+            isoperation: 2,
+          });
+        }
 
         if (response.code === 200) {
-          // 鏇存柊鍘熷閰嶇疆
-          question.originalConfig = JSON.parse(
-            JSON.stringify(question.exceptionConfig)
-          );
-          question.hasChanges = false;
-          question.saveStatus = {
-            type: "success",
-            message: "閰嶇疆淇濆瓨鎴愬姛",
-          };
-
-          this.updateChangedStatus();
-          this.$message.success("閰嶇疆淇濆瓨鎴愬姛");
-
-          // 5绉掑悗娓呴櫎鎴愬姛鎻愮ず
-          setTimeout(() => {
-            question.saveStatus = null;
-          }, 5000);
+          this.handleSaveSuccess(question);
         } else {
-          question.saveStatus = {
-            type: "error",
-            message: response.msg || "淇濆瓨澶辫触",
-          };
-          this.$message.error(response.msg || "淇濆瓨澶辫触");
+          throw new Error(response.msg || "淇濆瓨澶辫触");
         }
       } catch (error) {
         console.error("淇濆瓨澶辫触:", error);
         question.saveStatus = {
           type: "error",
-          message: "淇濆瓨澶辫触锛岃绋嶅悗閲嶈瘯",
+          message: error.message || "淇濆瓨澶辫触锛岃绋嶅悗閲嶈瘯",
         };
-        this.$message.error("淇濆瓨澶辫触锛岃绋嶅悗閲嶈瘯");
+        this.$message.error(error.message || "淇濆瓨澶辫触锛岃绋嶅悗閲嶈瘯");
       } finally {
         question.saving = false;
       }
     },
 
+    /** 澶勭悊淇濆瓨鎴愬姛 */
+    /** 澶勭悊淇濆瓨鎴愬姛 */
+    handleSaveSuccess(question) {
+      // 鍚屾椂鏇存柊棰樼洰椤跺眰瀛楁
+      const responsibilityDeptNames = this.getDeptNames(
+        question.exceptionConfig.responsibilityDept
+      );
+      const reportDeptNames = this.getDeptNames(
+        question.exceptionConfig.reportDept
+      );
+
+      // 鏇存柊棰樼洰鏈韩鐨勫瓧娈�
+      question.dutyDeptCode =
+        question.exceptionConfig.responsibilityDept.join(",");
+      question.dutyDeptName = responsibilityDeptNames.join(",");
+      question.reportDeptCode = question.exceptionConfig.reportDept.join(",");
+      question.reportDeptName = reportDeptNames.join(",");
+
+      // 鏇存柊鍘熷閰嶇疆
+      question.originalConfig = JSON.parse(
+        JSON.stringify(question.exceptionConfig)
+      );
+      question.hasChanges = false;
+      question.saveStatus = {
+        type: "success",
+        message: "閰嶇疆淇濆瓨鎴愬姛",
+      };
+
+      this.updateChangedStatus();
+      this.$message.success("閰嶇疆淇濆瓨鎴愬姛");
+
+      // 5绉掑悗娓呴櫎鎴愬姛鎻愮ず
+      setTimeout(() => {
+        question.saveStatus = null;
+      }, 5000);
+    },
+
+    /** 閲嶇疆鍗曚釜棰樼洰閰嶇疆 */
     /** 閲嶇疆鍗曚釜棰樼洰閰嶇疆 */
     resetSingleConfig(question) {
       this.$confirm("纭畾瑕侀噸缃綋鍓嶉鐩殑閰嶇疆鍚楋紵", "鎻愮ず", {
@@ -690,6 +1198,21 @@
           question.exceptionConfig = JSON.parse(
             JSON.stringify(question.originalConfig)
           );
+          // 鍚屾椂閲嶇疆棰樼洰椤跺眰瀛楁
+          const responsibilityDeptNames = this.getDeptNames(
+            question.exceptionConfig.responsibilityDept
+          );
+          const reportDeptNames = this.getDeptNames(
+            question.exceptionConfig.reportDept
+          );
+
+          question.dutyDeptCode =
+            question.exceptionConfig.responsibilityDept.join(",");
+          question.dutyDeptName = responsibilityDeptNames.join(",");
+          question.reportDeptCode =
+            question.exceptionConfig.reportDept.join(",");
+          question.reportDeptName = reportDeptNames.join(",");
+
           question.hasChanges = false;
           question.saveStatus = null;
           this.updateChangedStatus();
@@ -760,22 +1283,15 @@
 
     /** 鎼滅储 */
     handleQuery() {
-      this.queryParams.pageNum = 1;
-      this.getQuestionList();
+      // 浠呯瓫閫夋樉绀猴紝涓嶉渶瑕侀噸鏂板姞杞�
     },
 
     /** 閲嶇疆鎼滅储 */
     resetQuery() {
       this.queryParams = {
-        pageNum: 1,
-        pageSize: 10,
         scriptTopic: "",
         scriptContent: "",
-        targetname: "",
-        isavailable: "",
-        categoryids: "404,405,406",
       };
-      this.getQuestionList();
     },
   },
 };
@@ -809,7 +1325,76 @@
     }
   }
 
-  .search-card {
+  .template-section {
+    margin-bottom: 20px;
+
+    .template-header {
+      margin-bottom: 20px;
+
+      .template-title {
+        margin: 0 0 8px 0;
+        font-size: 16px;
+        font-weight: 600;
+        color: #303133;
+      }
+
+      .template-tip {
+        margin: 0;
+        color: #909399;
+        font-size: 13px;
+      }
+    }
+
+    .select-loading {
+      text-align: center;
+      padding: 10px;
+      color: #909399;
+
+      i {
+        margin-right: 8px;
+      }
+    }
+  }
+
+  .template-info-section {
+    margin-bottom: 20px;
+
+    .template-info {
+      display: flex;
+      justify-content: space-between;
+      align-items: center;
+      padding: 5px 0;
+
+      .info-left {
+        .template-name {
+          margin: 0 0 10px 0;
+          font-size: 18px;
+          font-weight: 600;
+          color: #303133;
+        }
+
+        .template-meta {
+          display: flex;
+          gap: 20px;
+          flex-wrap: wrap;
+
+          .meta-item {
+            display: flex;
+            align-items: center;
+            gap: 5px;
+            font-size: 13px;
+            color: #606266;
+
+            i {
+              font-size: 14px;
+            }
+          }
+        }
+      }
+    }
+  }
+
+  .search-section {
     margin-bottom: 20px;
 
     .search-container {
@@ -872,8 +1457,16 @@
     .empty-wrapper {
       min-height: 400px;
       display: flex;
+      flex-direction: column;
       align-items: center;
       justify-content: center;
+
+      .empty-tip {
+        margin-top: 10px;
+        color: #909399;
+        font-size: 13px;
+        text-align: center;
+      }
     }
 
     .question-list {
@@ -1035,6 +1628,40 @@
               }
             }
 
+            .current-config {
+              margin-bottom: 20px;
+              padding: 15px;
+              background: #f0f9ff;
+              border-radius: 6px;
+              border: 1px solid #d0ebff;
+
+              .config-preview {
+                .preview-item {
+                  display: flex;
+                  align-items: flex-start;
+                  margin-bottom: 8px;
+
+                  &:last-child {
+                    margin-bottom: 0;
+                  }
+
+                  .preview-label {
+                    font-size: 13px;
+                    color: #606266;
+                    font-weight: 500;
+                    min-width: 80px;
+                  }
+
+                  .preview-value {
+                    font-size: 13px;
+                    color: #303133;
+                    line-height: 1.5;
+                    flex: 1;
+                  }
+                }
+              }
+            }
+
             .config-footer {
               display: flex;
               justify-content: space-between;
@@ -1066,15 +1693,6 @@
           }
         }
       }
-    }
-
-    .pagination-wrapper {
-      margin-top: 20px;
-      padding: 20px;
-      background: white;
-      border-radius: 8px;
-      display: flex;
-      justify-content: center;
     }
   }
 
@@ -1161,6 +1779,12 @@
       margin-bottom: 16px;
     }
 
+    .template-info {
+      flex-direction: column;
+      align-items: flex-start;
+      gap: 10px;
+    }
+
     .search-card {
       margin-bottom: 16px;
     }
@@ -1205,6 +1829,10 @@
                 gap: 16px;
               }
 
+              .current-config {
+                padding: 12px;
+              }
+
               .config-footer {
                 flex-direction: column;
                 align-items: stretch;
@@ -1220,27 +1848,6 @@
         }
       }
     }
-  }
-}
-</style>
-
-<style lang="scss">
-.config-form {
-  .el-checkbox-group {
-    display: flex;
-    flex-wrap: wrap;
-    gap: 12px;
-  }
-
-  .el-checkbox {
-    margin: 0;
-  }
-}
-
-.option-item {
-  .el-radio__label {
-    display: block;
-    padding-left: 8px;
   }
 }
 </style>
diff --git a/src/views/followvisit/discharge/index.vue b/src/views/followvisit/discharge/index.vue
index e03f048..9b176e5 100644
--- a/src/views/followvisit/discharge/index.vue
+++ b/src/views/followvisit/discharge/index.vue
@@ -1250,6 +1250,10 @@
           value: 8,
           label: "搴旈殢璁挎棩鏈�(鍊掑簭)",
         },
+         {
+          value: 9,
+          label: "鎸夌収鎮h�呮帓搴�",
+        },
       ],
       // 鏌ヨ鍙傛暟
       topqueryParams: {
diff --git a/src/views/followvisit/discharge/js/prototype.js b/src/views/followvisit/discharge/js/prototype.js
index 0a83a4b..a02fc31 100644
--- a/src/views/followvisit/discharge/js/prototype.js
+++ b/src/views/followvisit/discharge/js/prototype.js
@@ -4871,4 +4871,4 @@
 
 Object.extend(Element.ClassNames.prototype, Enumerable);
 
-/*--------------------------------------------------------------------------*/
\ No newline at end of file
+/*--------------------------------------------------------------------------*/
diff --git a/src/views/followvisit/record/detailpage/index copy.vue b/src/views/followvisit/record/detailpage/index copy.vue
new file mode 100644
index 0000000..e06e792
--- /dev/null
+++ b/src/views/followvisit/record/detailpage/index copy.vue
@@ -0,0 +1,3703 @@
+<template>
+  <!-- 鑱婅繛椤甸潰璁板綍 -->
+  <div class="Followupdetailspage" id="app-container">
+    <div class="Followuserinfo">
+      <div>
+        <div class="userinfo-text">
+          <!-- <span>鎮h�呮湇鍔¤鎯�</span> -->
+          <div class="headline">
+            <div>鎮h�呮湇鍔¤鎯�</div>
+            <div style="margin-left: 20px">
+              <el-button
+                v-if="!Whetherall"
+                type="primary"
+                @click="getTaskservelist()"
+                >鏌ョ湅鎮h�呭叏閮ㄦ湇鍔�</el-button
+              >
+              <el-button v-else type="success" @click="getTaskservelist(id)"
+                >鍙睍绀烘湰娆℃湇鍔′俊鎭�</el-button
+              >
+            </div>
+            <!-- <div style="margin-left: 20px; color: #59a0f0">
+              <el-link
+                href="https://9.208.2.207:6060/search-homepage"
+                target="_blank"
+                :underline="true"
+              >
+                鍓嶅線CDSS鏌ヨ
+              </el-link>
+            </div> -->
+            <div class="merge-controls" v-if="Whetherall">
+              <el-button
+                type="primary"
+                @click="toggleMergeMode"
+                :disabled="selectedServices.length < 2"
+              >
+                {{ isMergeMode ? "鍙栨秷鍚堝苟" : "鍚堝苟缂栬緫闂嵎" }}
+              </el-button>
+              <el-button
+                v-if="isMergeMode"
+                type="success"
+                @click="openMergeDialog"
+                :disabled="selectedServices.length < 2"
+              >
+                寮�濮嬪悎骞� (宸查�� {{ selectedServices.length }} 涓湇鍔�)
+              </el-button>
+            </div>
+          </div>
+          <!-- <el-button type="success">闅忚鍚庣煭淇�</el-button> -->
+        </div>
+      </div>
+      <div>
+        <el-table
+          :data="logsheetlist"
+          :row-class-name="tableRowClassName"
+          :max-height="350"
+          style="width: 100%"
+          @selection-change="handleSelectionChange"
+        >
+          <el-table-column
+            type="selection"
+            width="55"
+            :selectable="checkSelectable"
+            v-if="Whetherall"
+          ></el-table-column>
+          <el-table-column
+            prop="sendname"
+            align="center"
+            label="濮撳悕"
+            width="100"
+          >
+            <template slot-scope="scope">
+              <el-button
+                size="medium"
+                type="text"
+                @click="
+                  gettoken360(
+                    scope.row.sfzh,
+                    scope.row.drcode,
+                    scope.row.drname
+                  )
+                "
+                ><span class="button-textsc">{{
+                  scope.row.sendname
+                }}</span></el-button
+              >
+            </template>
+          </el-table-column>
+          <el-table-column
+            prop="taskName"
+            align="center"
+            width="200"
+            show-overflow-tooltip
+            label="浠诲姟鍚嶇О"
+          >
+          </el-table-column>
+          <el-table-column
+            prop="sendstate"
+            align="center"
+            width="200"
+            label="浠诲姟鐘舵��"
+          >
+            <template slot-scope="scope">
+              <div v-if="scope.row.sendstate == 1">
+                <el-tag type="primary" :disable-transitions="false"
+                  >琛ㄥ崟宸查鍙�</el-tag
+                >
+              </div>
+              <div v-if="scope.row.sendstate == 2">
+                <el-tag type="primary" :disable-transitions="false"
+                  >寰呴殢璁�</el-tag
+                >
+              </div>
+              <div v-if="scope.row.sendstate == 3">
+                <el-tag type="success" :disable-transitions="false"
+                  >琛ㄥ崟宸插彂閫�</el-tag
+                >
+              </div>
+              <div v-if="scope.row.sendstate == 4">
+                <el-tag type="info" :disable-transitions="false">涓嶆墽琛�</el-tag>
+              </div>
+              <div v-if="scope.row.sendstate == 5">
+                <el-tag type="danger" :disable-transitions="false"
+                  >鍙戦�佸け璐�</el-tag
+                >
+              </div>
+              <div v-if="scope.row.sendstate == 6">
+                <el-tag type="success" :disable-transitions="false"
+                  >宸插畬鎴�</el-tag
+                >
+              </div>
+              <div v-if="scope.row.sendstate == 7">
+                <el-tag type="danger" :disable-transitions="false">瓒呮椂</el-tag>
+              </div>
+            </template>
+          </el-table-column>
+          <el-table-column
+            prop="finishtime"
+            align="center"
+            label="闅忚瀹屾垚鏃堕棿"
+            width="200"
+            show-overflow-tooltip
+          >
+          </el-table-column>
+          <el-table-column
+            label="鍑洪櫌鏃ユ湡"
+            width="200"
+            align="center"
+            key="endtime"
+            prop="endtime"
+          >
+            <template slot-scope="scope">
+              <span>{{ formatTime(scope.row.endtime) }}</span>
+            </template></el-table-column
+          >
+          <el-table-column
+            label="璐d换鎶ゅ+"
+            width="120"
+            align="center"
+            key="nurseName"
+            prop="nurseName"
+          />
+          <el-table-column
+            label="涓绘不鍖荤敓"
+            width="120"
+            align="center"
+            key="drname"
+            prop="drname"
+          />
+
+          <el-table-column
+            label="缁撴灉鐘舵��"
+            align="center"
+            key="excep"
+            prop="excep"
+            width="120"
+          >
+            <template slot-scope="scope">
+              <dict-tag
+                :options="dict.type.sys_yujing"
+                :value="scope.row.excep"
+              />
+            </template>
+          </el-table-column>
+          <el-table-column
+            label="澶勭悊鎰忚"
+            align="center"
+            key="suggest"
+            prop="suggest"
+            width="120"
+          >
+            <template slot-scope="scope">
+              <dict-tag
+                :options="dict.type.sys_suggest"
+                :value="scope.row.suggest"
+              />
+            </template>
+          </el-table-column>
+
+          <el-table-column
+            prop="templatename"
+            align="center"
+            label="鏈嶅姟妯℃澘"
+            width="200"
+            show-overflow-tooltip
+          >
+          </el-table-column>
+          <el-table-column
+            prop="remark"
+            align="center"
+            label="鏈嶅姟璁板綍"
+            width="200"
+            show-overflow-tooltip
+          >
+          </el-table-column>
+
+          <el-table-column
+            prop="bankcardno"
+            align="center"
+            label="鍛煎彨鐘舵��"
+            width="210"
+          >
+          </el-table-column>
+          <el-table-column
+            label="鎿嶄綔"
+            fixed="right"
+            align="center"
+            width="200"
+            class-name="small-padding fixed-width"
+          >
+            <template slot-scope="scope">
+              <el-button
+                size="medium"
+                type="text"
+                @click="Seedetails(scope.row)"
+                ><span class="button-zx"
+                  ><i class="el-icon-s-order"></i>鏌ョ湅</span
+                ></el-button
+              >
+            </template>
+          </el-table-column>
+        </el-table>
+      </div>
+    </div>
+    <!-- 娣诲姞鍚堝苟缂栬緫瀵硅瘽妗� -->
+    <el-dialog
+      title="鍚堝苟缂栬緫闂嵎"
+      :visible.sync="mergeDialogVisible"
+      width="80%"
+      top="5vh"
+      v-dialogDrag
+    >
+      <MergeAndModify
+        v-if="mergeDialogVisible"
+        :selected-services="selectedServices"
+        :patid="patid"
+        @save="handleMergeSave"
+        @cancel="mergeDialogVisible = false"
+      />
+    </el-dialog>
+    <div class="action-container">
+      <!-- 闅忚鍐呭 -->
+      <div class="call-action">
+        <div class="call-container">
+          <!-- <div class="call-header">
+            <h2>涓�閿懠鍙姛鑳�</h2>
+          </div> -->
+
+          <div class="headline">
+            <div>闅忚鍐呭</div>
+          </div>
+          <div>
+            <el-tabs v-model="activeName" type="border-card">
+              <el-tab-pane name="wj">
+                <span class="mulsz" slot="label"
+                  ><i class="el-icon-notebook-1"></i> 闂嵎闅忚缁撴灉</span
+                >
+                <div class="CONTENT">
+                  <div class="title">{{ taskname ? taskname : "闂嵎" }}</div>
+
+                  <div class="preview-left" v-if="!Voicetype">
+                    <div
+                      class="topic-dev"
+                      v-for="(item, index) in tableDatatop"
+                      :key="item.id"
+                    >
+                      <!-- 鍗曢�� -->
+                      <div
+                        :class="getTopicClass(item)"
+                        :key="index"
+                        v-if="item.scriptType == 1 && !item.astrict"
+                      >
+                        <div class="dev-text">
+                          {{ index + 1 }}銆乕鍗曢�塢<span>{{
+                            item.scriptContent
+                          }}</span>
+                        </div>
+                        <div class="dev-xx">
+                          <el-radio-group v-model="item.scriptResult">
+                            <el-radio
+                              v-for="(
+                                items, indexs
+                              ) in item.svyTaskTemplateTargetoptions"
+                              :class="getOptionClass(items)"
+                              :key="indexs"
+                              :label="items.optioncontent"
+                              @click.native.prevent="
+                                handleRadioToggle(
+                                  item,
+                                  index,
+                                  item.svyTaskTemplateTargetoptions,
+                                  items.optioncontent
+                                )
+                              "
+                              >{{ items.optioncontent }}</el-radio
+                            >
+                          </el-radio-group>
+                        </div>
+                        <div
+                          v-if="item.showAppendInput || item.answerps"
+                          class="append-input-container"
+                        >
+                          <el-input
+                            type="textarea"
+                            :rows="2"
+                            placeholder="璇疯緭鍏ュ叿浣撲俊鎭�"
+                            v-model="item.answerps"
+                            clearable
+                          ></el-input>
+                        </div>
+                        <div v-show="item.prompt">
+                          <el-alert :title="item.prompt" type="warning">
+                          </el-alert>
+                        </div>
+                      </div>
+                      <!-- 澶氶�� -->
+                      <div
+                        :class="
+                          item.isabnormal
+                            ? 'scriptTopic-isabnormal'
+                            : 'scriptTopic-dev'
+                        "
+                        :key="index"
+                        v-if="item.scriptType == 2 && !item.astrict"
+                      >
+                        <div class="dev-text">
+                          {{ index + 1 }}銆乕澶氶�塢<span>{{
+                            item.scriptContent
+                          }}</span>
+                        </div>
+                        <div class="dev-xx">
+                          <el-checkbox-group
+                            v-model="item.scriptResult"
+                            @change="updateScore($event, index, item)"
+                          >
+                            <el-checkbox
+                              :class="items.isabnormal ? 'red-star' : ''"
+                              @change="$forceUpdate()"
+                              v-for="(
+                                items, indexs
+                              ) in item.svyTaskTemplateTargetoptions"
+                              :key="indexs"
+                              :label="items.optioncontent"
+                            >
+                              {{ items.optioncontent }}
+                            </el-checkbox>
+                          </el-checkbox-group>
+                        </div>
+                        <div v-show="item.prompt && item.scriptResult[0]">
+                          <el-alert :title="item.prompt" type="warning">
+                          </el-alert>
+                        </div>
+                      </div>
+                      <!-- 濉┖ -->
+                      <div
+                        class="scriptTopic-dev"
+                        :key="index"
+                        v-if="item.scriptType == 4 && !item.astrict"
+                      >
+                        <div class="dev-text">
+                          {{ index + 1 }}銆乕闂瓟]<span>{{
+                            item.scriptContent
+                          }}</span>
+                          <span v-if="item.valueType == 3">(鍙兘杈撳叆鏁板瓧)</span>
+                        </div>
+                        <div class="dev-xx" v-if="item.valueType == 3">
+                          <el-input
+                            type="text"
+                            v-numeric-only
+                            placeholder="璇疯緭鍏ョ瓟妗�"
+                            v-model="item.scriptResult"
+                          >
+                          </el-input>
+                        </div>
+                        <div class="dev-xx" v-else>
+                          <el-input
+                            type="textarea"
+                            :rows="2"
+                            placeholder="璇疯緭鍏ョ瓟妗�"
+                            v-model="item.scriptResult"
+                            clearable
+                          >
+                          </el-input>
+                        </div>
+                      </div>
+                    </div>
+                  </div>
+
+                  <div class="preview-left" v-else>
+                    <div
+                      class="topic-dev"
+                      v-for="(item, index) in tableDatatop"
+                      :key="item.id"
+                    >
+                      <div v-if="item.targetvalue">
+                        <div class="dev-text">
+                          {{ index + 1 }}銆乕鍗曢�塢<span>{{
+                            item.questiontext
+                          }}</span>
+                        </div>
+                        <div class="dev-xx">
+                          <el-radio-group
+                            v-model="item.matchedtext"
+                            @change="
+                              handleOptionChange(
+                                $event,
+                                index,
+                                item.ivrTaskScriptTargetoptionList,
+                                item
+                              )
+                            "
+                          >
+                            <el-radio
+                              v-for="(items, index) in item.scriptResult"
+                              :key="index"
+                              :label="items"
+                              :class="items.isabnormal ? 'red-star' : ''"
+                              >{{ items }}</el-radio
+                            >
+                          </el-radio-group>
+                        </div>
+                        <div v-show="item.prompt">
+                          <el-alert :title="item.prompt" type="warning">
+                          </el-alert>
+                        </div>
+                      </div>
+
+                      <div class="scriptTopic-dev" :key="index" v-else>
+                        <div class="dev-text">
+                          {{ index + 1 }}銆乕闂瓟]<span>{{
+                            item.scriptContent
+                          }}</span>
+                          <span v-if="item.valueType == 3">(鍙兘杈撳叆鏁板瓧)</span>
+                        </div>
+                        <div class="dev-xx" v-if="item.valueType == 3">
+                          <el-input
+                            type="text"
+                            v-numeric-only
+                            placeholder="璇疯緭鍏ョ瓟妗�"
+                            v-model="item.scriptResult"
+                          >
+                          </el-input>
+                        </div>
+                        <div class="dev-xx" v-else>
+                          <el-input
+                            type="textarea"
+                            :rows="2"
+                            placeholder="璇疯緭鍏ョ瓟妗�"
+                            v-model="item.scriptResult"
+                            clearable
+                          >
+                          </el-input>
+                        </div>
+                      </div>
+                    </div>
+                  </div>
+                  <el-button
+                    v-if="Voicetype"
+                    type="primary"
+                    @click="yuyingetdetail"
+                    >淇濆瓨鏈嶅姟璇︽儏</el-button
+                  >
+                  <el-button v-else type="primary" @click="getdetail"
+                    >淇濆瓨鏈嶅姟璇︽儏</el-button
+                  >
+                </div>
+              </el-tab-pane>
+
+              <el-tab-pane name="yy">
+                <span class="mulsz" slot="label"
+                  ><i class="el-icon-headset"></i> 璇煶闅忚璇︽儏</span
+                >
+                <div class="borderdiv">
+                  <div class="title">{{ taskname ? taskname : "闂嵎" }}</div>
+                  <div
+                    style="
+                      display: flex;
+                      text-align: center;
+                      align-items: center;
+                      color: #59a0f0;
+                    "
+                  >
+                    瀹屾暣璇煶锛�
+                    <mini-audio
+                      :audio-source="
+                        voice ? voice : '@assets/order/example.mp3'
+                      "
+                    ></mini-audio>
+                  </div>
+                  <div class="preview-left">
+                    <div v-for="item in voiceDatatop">
+                      <div class="leftside">
+                        <i class="el-icon-phone-outline"></i
+                        ><span>{{ item.questiontext }}</span>
+                      </div>
+                      <div class="offside">
+                        <i class="el-icon-user"></i>
+                        <div class="offside-value">
+                          <el-input
+                            type="textarea"
+                            :autosize="{ minRows: 1 }"
+                            v-model="item.asrtext"
+                          ></el-input>
+
+                          <div>
+                            <mini-audio
+                              :audio-source="
+                                item.questionvoice
+                                  ? item.questionvoice
+                                  : '@assets/order/example.mp3'
+                              "
+                            ></mini-audio>
+                          </div>
+                        </div>
+                      </div>
+                    </div>
+                  </div>
+                  <el-button
+                    v-if="Voicetype"
+                    type="primary"
+                    @click="yuyingetdetail"
+                    >淇濆瓨闅忚璇︽儏</el-button
+                  >
+                  <el-button v-else type="primary" @click="getdetail"
+                    >淇濆瓨闅忚璇︽儏</el-button
+                  >
+                </div>
+              </el-tab-pane>
+            </el-tabs>
+          </div>
+        </div>
+      </div>
+      <!-- 浜哄伐澶勭悊 -->
+      <div class="manual-action">
+        <div class="Followuserinfos">
+          <!-- 椤堕儴鎿嶄綔鍖哄煙 -->
+          <div class="section-header">
+            <h3><i class="el-icon-s-operation"></i> 浜哄伐澶勭悊</h3>
+            <div class="header-actions">
+              <!-- 鍩虹鎿嶄綔鎸夐挳缁� -->
+              <div class="action-group basic-actions">
+                <el-button
+                  type="primary"
+                  plain
+                  @click="Editsingletasksonyic('')"
+                >
+                  淇濆瓨鍩虹淇℃伅
+                </el-button>
+
+                <!-- 鏂板锛氬欢缁姢鐞嗘寜閽� -->
+                <el-button
+                  type="success"
+                  plain
+                  @click="handleContinuationCare"
+                  v-if="showContinuationCareBtn"
+                >
+                  寤剁画鎶ょ悊
+                </el-button>
+
+                <el-button
+                  type="primary"
+                  round
+                  @click="sendAgain"
+                  v-if="form.isVisitAgain != 2"
+                >
+                  鍐嶆闅忚
+                </el-button>
+              </div>
+
+              <!-- 寮傚父鐘舵�侀�夋嫨鍣� -->
+              <div class="action-group tag-selector">
+                <el-select
+                  v-model="selectedTag"
+                  placeholder="璇烽�夋嫨寮傚父鐘舵��"
+                  clearable
+                  style="width: 150px; margin-right: 10px"
+                >
+                  <el-option
+                    v-for="item in tagOptions"
+                    :key="item.value"
+                    :label="item.label"
+                    :value="item.value"
+                  >
+                    <span style="display: flex; align-items: center">
+                      <span
+                        class="color-indicator"
+                        :style="{ backgroundColor: item.color }"
+                      ></span>
+                      <span>{{ item.label }}</span>
+                    </span>
+                  </el-option>
+                </el-select>
+
+                <!-- 褰撳墠閫夋嫨鐨勯鑹叉寚绀哄櫒 -->
+                <div
+                  v-if="selectedTag"
+                  class="color-indicator selected-indicator"
+                  :style="{ backgroundColor: getSelectedTagColor() }"
+                ></div>
+
+                <!-- 鏍囪璇存槑鎻愮ず -->
+                <el-tooltip
+                  v-if="selectedTag"
+                  effect="light"
+                  :content="getSelectedDescription()"
+                  placement="top"
+                >
+                  <i class="el-icon-info tag-info-icon"></i>
+                </el-tooltip>
+              </div>
+            </div>
+          </div>
+
+          <!-- 琛ㄥ崟鍖哄煙 -->
+          <div class="form-content">
+            <el-form
+              ref="userform"
+              :model="form"
+              :rules="userrules"
+              label-width="100px"
+            >
+              <!-- 鑱旂郴淇℃伅琛� -->
+              <el-row>
+                <el-col :span="14">
+                  <el-form-item label="鑱旂郴鐢佃瘽">
+                    <el-input
+                      placeholder="鑱旂郴鐢佃瘽缂哄け"
+                      v-model="userform.telcode"
+                    >
+                      <el-button
+                        slot="append"
+                        icon="el-icon-phone"
+                        @click="handleCall(userform.telcode, 'tel')"
+                        :disabled="!isValidPhone(userform.telcode)"
+                      ></el-button>
+                    </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>
+
+              <!-- 鑱旂郴浜轰俊鎭 -->
+              <el-row>
+                <el-col :span="14">
+                  <el-form-item label="鑱旂郴浜虹數璇�">
+                    <el-input
+                      placeholder="鑱旂郴浜虹數璇濈己澶�"
+                      v-model="userform.relativetelcode"
+                    >
+                      <el-button
+                        slot="append"
+                        icon="el-icon-phone"
+                        @click="
+                          handleCall(userform.relativetelcode, 'relative')
+                        "
+                        :disabled="!isValidPhone(userform.relativetelcode)"
+                      ></el-button>
+                    </el-input>
+                  </el-form-item>
+                </el-col>
+                <el-col :span="9">
+                  <el-form-item label="鍏崇郴">
+                    <el-input
+                      placeholder="鑱旂郴浜哄叧绯荤己澶�"
+                      v-model="userform.relation"
+                    ></el-input>
+                  </el-form-item>
+                </el-col>
+              </el-row>
+
+              <!-- 閫氳瘽鎺у埗鍖哄煙 -->
+              <div class="call-controls">
+                <CallButton
+                  ref="callButton"
+                  :phoneNumber="currentPhoneNumber"
+                  style="display: none"
+                />
+
+                <!-- 鎸傛柇鎸夐挳鏍峰紡浼樺寲 -->
+                <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-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>
+
+              <!-- 闅忚鍐呭/璁板綍 -->
+              <el-form-item
+                :label="orgname == '涓芥按甯備腑鍖婚櫌' ? '闅忚鍐呭' : '闅忚璁板綍'"
+              >
+                <el-input type="textarea" v-model="form.remark"></el-input>
+              </el-form-item>
+
+              <!-- 闅忚鎯呭喌 -->
+              <el-form-item label="闅忚鎯呭喌" v-if="orgname == '涓芥按甯備腑鍖婚櫌'">
+                <el-radio-group v-model="form.taskSituation">
+                  <el-radio
+                    v-for="city in cities"
+                    :label="city.value"
+                    :value="city.value"
+                    :key="city.value"
+                  >
+                    {{ city.label }}
+                  </el-radio>
+                </el-radio-group>
+              </el-form-item>
+
+              <!-- 澶勭悊鎰忚 -->
+              <el-form-item label="澶勭悊鎰忚">
+                <div class="opinion-buttons">
+                  <el-button
+                    plain
+                    type="warning"
+                    @click="Editsingletaskson('1')"
+                  >
+                    鏆備笉澶勭悊
+                  </el-button>
+                  <el-button
+                    plain
+                    type="success"
+                    @click="Editsingletaskson('2')"
+                  >
+                    鐥呮儏绋冲畾
+                  </el-button>
+                  <el-button
+                    plain
+                    type="primary"
+                    @click="Editsingletaskson('3')"
+                  >
+                    閫氱煡灏辫瘖
+                  </el-button>
+                  <el-button plain type="info" @click="Editsingletaskson('5')">
+                    浜哄伐闅忚
+                  </el-button>
+                  <el-button type="primary" round @click="sendAgainmsg">
+                    鐭俊鍙戦��
+                  </el-button>
+                </div>
+              </el-form-item>
+            </el-form>
+          </div>
+
+          <!-- 鎮h�呮。妗堜俊鎭� -->
+          <div class="detailed">
+            <h3>鎮h�呮。妗堜俊鎭�</h3>
+            <el-form ref="userform" :model="userform" label-width="100px">
+              <el-row :gutter="20">
+                <el-col :span="12">
+                  <el-form-item label="鎮h�呭鍚�" prop="name">
+                    <el-input
+                      v-model="userform.name"
+                      placeholder="璇疯緭鍏ュ鍚�"
+                      maxlength="30"
+                    ></el-input>
+                  </el-form-item>
+                </el-col>
+              </el-row>
+              <el-row :gutter="20">
+                <el-col :span="12">
+                  <el-form-item label="鎬у埆" prop="sex">
+                    <el-select v-model="userform.sex" placeholder="璇烽�夋嫨">
+                      <el-option label="鐢�" :value="1"> </el-option>
+                      <el-option label="濂�" :value="2"> </el-option>
+                    </el-select>
+                  </el-form-item>
+                </el-col>
+                <el-col :span="12">
+                  <el-form-item label="骞撮緞" prop="age">
+                    <el-input
+                      v-model="userform.age"
+                      placeholder="璇疯緭鍏ュ勾榫�"
+                      maxlength="20"
+                    ></el-input>
+                  </el-form-item>
+                </el-col>
+              </el-row>
+
+              <el-row :gutter="20">
+                <el-col :span="12">
+                  <el-form-item label="鑱旂郴鏂瑰紡" prop="telcode">
+                    <el-input
+                      v-model="userform.telcode"
+                      placeholder="璇疯緭鍏ヨ仈绯绘柟寮�"
+                      maxlength="20"
+                    />
+                  </el-form-item>
+                </el-col>
+                <el-col :span="12">
+                  <el-form-item label="浜插睘鑱旂郴鏂瑰紡" prop="relativetelcode">
+                    <el-input
+                      v-model="userform.relativetelcode"
+                      placeholder="璇疯緭鍏ヤ翰灞炶仈绯绘柟寮�"
+                      maxlength="20"
+                    ></el-input>
+                  </el-form-item>
+                </el-col>
+              </el-row>
+              <el-row :gutter="20">
+                <el-col :span="24">
+                  <el-form-item label="璇婃柇鍚嶇О" prop="leavediagname">
+                    <el-input
+                      v-model="form.leavediagname"
+                      placeholder="璇疯緭鍏ヨ瘖鏂�"
+                      maxlength="50"
+                    ></el-input>
+                  </el-form-item>
+                </el-col>
+              </el-row>
+              <el-row :gutter="20">
+                <el-col :span="24">
+                  <el-form-item label="鍑虹敓鍦�" prop="birthplace">
+                    <el-input
+                      v-model="userform.birthplace"
+                      placeholder="鍥姐�佺渷銆佸湴甯傘�佸尯鍘裤�佽閬撶瓑璇︾粏淇℃伅"
+                      maxlength="50"
+                    />
+                  </el-form-item>
+                </el-col>
+              </el-row>
+              <el-row :gutter="20">
+                <el-col :span="24">
+                  <el-form-item label="灞呬綇鍦�" prop="placeOfResidence">
+                    <el-input
+                      v-model="userform.placeOfResidence"
+                      placeholder="鍥姐�佺渷銆佸湴甯傘�佸尯鍘裤�佽閬撶瓑璇︾粏淇℃伅"
+                      maxlength="50"
+                    />
+                  </el-form-item>
+                </el-col>
+              </el-row>
+            </el-form>
+          </div>
+        </div>
+      </div>
+    </div>
+    <!-- 鐭俊鍙戦�佸璇濇 -->
+    <el-dialog title="鐭俊鍙戦��" :visible.sync="smsDialogVisible">
+      <!-- 娉ㄦ剰杩欓噷浣跨敤浜� smsDialogVisible 浠ュ尯鍒嗗凡鏈夌殑 dialogFormVisible -->
+      <el-form ref="smsForm" :model="form" label-width="80px">
+        <el-form-item label="鎮h�呭悕绉�">
+          <el-input
+            style="width: 400px"
+            disabled
+            v-model="form.sendname"
+          ></el-input>
+        </el-form-item>
+        <el-form-item label="骞撮緞">
+          <el-input style="width: 400px" disabled v-model="form.age"></el-input>
+        </el-form-item>
+        <el-form-item label="鐢佃瘽">
+          <el-input
+            style="width: 400px"
+            disabled
+            v-model="userform.telcode"
+          ></el-input>
+          <!-- 娉ㄦ剰杩欓噷鍙兘浣跨敤 userform.telcode -->
+        </el-form-item>
+        <el-form-item label="绉戝">
+          <el-input
+            style="width: 400px"
+            disabled
+            v-model="form.deptname"
+          ></el-input>
+        </el-form-item>
+        <el-form-item label="鐥呭尯">
+          <el-input
+            style="width: 400px"
+            disabled
+            v-model="form.leavehospitaldistrictname"
+          ></el-input>
+        </el-form-item>
+        <el-form-item label="鐭俊鍐呭">
+          <el-input type="textarea" v-model="smsContent"></el-input>
+          <!-- 寤鸿浣跨敤鐙珛鐨� smsContent 鍙橀噺 -->
+        </el-form-item>
+      </el-form>
+      <div slot="footer" class="dialog-footer">
+        <el-button @click="smsDialogVisible = false">鍙� 娑�</el-button>
+        <el-button type="primary" @click="sendSms">纭鍙戦��</el-button>
+        <!-- 娉ㄦ剰鏂规硶鍚嶆敼涓� sendSms -->
+      </div>
+    </el-dialog>
+    <el-dialog
+      title="鎮h�呭啀娆¢殢璁�"
+      v-dialogDrags
+      :visible.sync="dialogFormVisible"
+    >
+      <el-form ref="zcform" :rules="zcrules" :model="form" label-width="80px">
+        <el-form-item label="浠诲姟鍚嶇О">
+          <el-input
+            style="width: 400px"
+            disabled
+            v-model="form.taskName"
+          ></el-input>
+        </el-form-item>
+        <el-form-item label="鎮h�呭悕绉�">
+          <el-input
+            style="width: 400px"
+            disabled
+            v-model="form.sendname"
+          ></el-input>
+        </el-form-item>
+        <el-form-item label="骞撮緞">
+          <el-input style="width: 400px" disabled v-model="form.age"></el-input>
+        </el-form-item>
+        <el-form-item label="绉戝">
+          <el-input
+            style="width: 400px"
+            disabled
+            v-model="form.deptname"
+          ></el-input>
+        </el-form-item>
+        <el-form-item label="鐥呭尯">
+          <el-input
+            style="width: 400px"
+            disabled
+            v-model="form.leavehospitaldistrictname"
+          ></el-input>
+        </el-form-item>
+        <el-form-item label="鍑洪櫌鏃堕棿">
+          <el-input
+            style="width: 400px"
+            disabled
+            v-model="form.endtime"
+          ></el-input>
+        </el-form-item>
+        <div class="headline">涓婃闅忚</div>
+        <el-divider></el-divider>
+        <el-row>
+          <el-col :span="12">
+            <el-form-item label="闅忚鏂瑰紡">
+              <el-select
+                v-model="form.visitType2"
+                filterable
+                allow-create
+                default-first-option
+                disabled
+                placeholder="璇烽�夋嫨闅忚鏂瑰紡"
+                class="custom-disabled"
+              >
+                <el-option
+                  v-for="item in options"
+                  :key="item.value"
+                  :label="item.label"
+                  :value="item.value"
+                >
+                </el-option>
+              </el-select>
+            </el-form-item>
+          </el-col>
+          <el-col :span="12">
+            <el-form-item label="闅忚鏃堕棿">
+              <el-date-picker
+                type="date"
+                disabled
+                placeholder="閫夋嫨鏃ユ湡"
+                :picker-options="pickerOptions"
+                align="right"
+                v-model="form.date2"
+                class="custom-disabled"
+              ></el-date-picker>
+            </el-form-item>
+          </el-col>
+        </el-row>
+
+        <el-form-item label="闅忚璁板綍">
+          <el-input
+            class="custom-disabled"
+            type="textarea"
+            disabled
+            v-model="form.remark2"
+          ></el-input>
+        </el-form-item>
+        <div class="headline">涓嬫闅忚</div>
+        <el-divider></el-divider>
+        <el-row>
+          <el-col :span="12">
+            <el-form-item label="闅忚鏂瑰紡" prop="visitType">
+              <el-select
+                v-model="form.visitType"
+                filterable
+                allow-create
+                default-first-option
+                @change="visitChange"
+                placeholder="璇烽�夋嫨闅忚鏂瑰紡(渚濆嚭闄㈡椂闂磋绠�)"
+              >
+                <el-option
+                  v-for="item in options"
+                  :key="item.value"
+                  :label="item.label"
+                  :value="item.value"
+                >
+                </el-option>
+              </el-select>
+            </el-form-item>
+          </el-col>
+          <el-col :span="12">
+            <el-form-item label="闅忚鏃堕棿" prop="date1">
+              <el-date-picker
+                type="date"
+                placeholder="閫夋嫨鏃ユ湡"
+                :picker-options="pickerOptions"
+                align="right"
+                v-model="form.date1"
+                class="custom-disabled"
+                value-format="yyyy-MM-dd hh:mm:ss"
+                @change="checkFollowupDate"
+              ></el-date-picker>
+            </el-form-item>
+          </el-col>
+        </el-row>
+        <el-form-item label="闅忚绫诲瀷" prop="resource">
+          <el-radio-group v-model="form.resource">
+            <el-radio label="1">鏈梾鍖洪殢璁�</el-radio>
+            <el-radio label="2">闅忚涓績闅忚</el-radio>
+          </el-radio-group>
+        </el-form-item>
+
+        <el-form-item label="闅忚璁板綍" :required="form.resource == '2'">
+          <el-input type="textarea" v-model="form.remark"></el-input>
+        </el-form-item>
+      </el-form>
+      <div slot="footer" class="dialog-footer">
+        <el-button type="warning" @click="dialogFormVisible = false"
+          >鍙� 娑�</el-button
+        >
+        <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="CallCenterLs" :initial-phone="currentPhoneNumber" />
+      </el-dialog>
+    </div>
+  </div>
+</template>
+
+<script>
+import {
+  getsearchrResults,
+  getPersonVoices,
+  addserviceSubtask,
+  getTaskservelist,
+  getTaskFollowup,
+  Editsingletaskson,
+  serviceSubtaskDetailedit,
+  serviceSubtaskDetailadd,
+  updatePersonVoices,
+  addPersonVoices,
+  query360PatInfo,
+  sendMsg,
+} from "@/api/AiCentre/index";
+import {
+  messagelistpatient,
+  alterpatient,
+  listcontactinformation,
+} 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: {
+      bind(el, binding, vnode) {
+        // 灏濊瘯鑾峰彇瀹為檯鐨刬nput鍏冪礌
+        const input = el.tagName === "INPUT" ? el : el.querySelector("input");
+        if (!input) {
+          console.warn("v-numeric-only: 鏈壘鍒癷nput鍏冪礌");
+          return;
+        }
+
+        const handleInput = function (event) {
+          const oldValue = input.value;
+          const newValue = oldValue.replace(/[^\d]/g, "");
+          if (newValue !== oldValue) {
+            input.value = newValue;
+            // 瑙﹀彂input浜嬩欢锛岄�氱煡v-model鏇存柊
+            input.dispatchEvent(new Event("input", { bubbles: true })); // 娉ㄦ剰bubbles
+          }
+        };
+
+        const handlePaste = function (event) {
+          event.preventDefault();
+          const clipboardData = event.clipboardData || window.clipboardData;
+          const pastedData = clipboardData.getData("text");
+          const numericValue = pastedData.replace(/[^\d]/g, "");
+
+          // 妯℃嫙鍦ㄥ厜鏍囦綅缃彃鍏ョ函鏁板瓧鏂囨湰
+          const start = input.selectionStart;
+          const end = input.selectionEnd;
+          input.value =
+            input.value.substring(0, start) +
+            numericValue +
+            input.value.substring(end);
+          // 璋冩暣鍏夋爣浣嶇疆
+          const newCursorPos = start + numericValue.length;
+          input.setSelectionRange(newCursorPos, newCursorPos);
+
+          // 瑙﹀彂input浜嬩欢
+          input.dispatchEvent(new Event("input", { bubbles: true }));
+        };
+
+        input.addEventListener("input", handleInput);
+        input.addEventListener("paste", handlePaste);
+
+        // 瀛樺偍寮曠敤浠ヤ究瑙g粦
+        el._numericOnly = {
+          inputHandle: handleInput,
+          pasteHandle: handlePaste,
+          inputEl: input,
+        };
+      },
+      unbind(el) {
+        if (el._numericOnly) {
+          const { inputHandle, pasteHandle, inputEl } = el._numericOnly;
+          inputEl.removeEventListener("input", inputHandle);
+          inputEl.removeEventListener("paste", pasteHandle);
+          delete el._numericOnly;
+        }
+      },
+    },
+  },
+  dicts: ["sys_normal_disable", "sys_user_sex", "sys_yujing", "sys_suggest"],
+  data() {
+    const validatePhone = (rule, value, callback) => {
+      if (!value) {
+        return callback(new Error("璇疯緭鍏ヨ仈绯荤數璇�"));
+      }
+      setTimeout(() => {
+        if (!/^1[3-9]\d{9}$/.test(value)) {
+          callback(new Error("璇疯緭鍏ユ纭殑11浣嶆墜鏈哄彿鐮�"));
+        } else {
+          callback();
+        }
+      }, 300);
+    };
+    return {
+      userid: "",
+      currentPhoneNumber: "",
+      callType: "", // 鐢ㄤ簬鍖哄垎鏄摢涓數璇�
+      isSipRegistering: true, // SIP娉ㄥ唽鐘舵��
+      // 宸叉湁鏁版嵁...
+      customCallStatus: "", // 鐢ㄤ簬瀛樺偍鑷畾涔夌姸鎬佹枃鏈�
+      callStatus: "idle", // idle, calling, connected, ended, failed
+      isEndingCall: false,
+      CaldialogVisible: false,
+      currentCall: null, // 褰撳墠閫氳瘽瀵硅薄
+      // 鏂板鍔熻兘鏁版嵁
+      showPatientInfo: true,
+      showContinuationCareBtn: false, // 鎺у埗寤剁画鎶ょ悊鎸夐挳鏄剧ず
+      // 璺敱鐩戝惉鐩稿叧
+      routeWatcher: null,
+      lastRoutePath: this.$route.path,
+      input: "浠婂ぉ韬綋杩樹笉閿�",
+      radio: "2",
+      taskname: "",
+      activeName: "wj",
+      voice: "",
+      templateid: "",
+      again: "",
+      orgname: "",
+      zcform: {},
+      form: {},
+      cities: [
+        {
+          label: "姝e父璇煶",
+          value: "1",
+        },
+        {
+          label: "鎮h�呮嫆鎺ユ垨鎷掕",
+          value: "2",
+        },
+        {
+          label: "闈㈣鎴栬�呮帴璇�",
+          value: "3",
+        },
+        {
+          label: "寰俊闅忚",
+          value: "4",
+        },
+        {
+          label: "闅忚鐢佃瘽涓嶆纭�",
+          value: "5",
+        },
+        {
+          label: "涓嶅疁闅忚琚繃婊�",
+          value: "6",
+        },
+        {
+          label: "鍏朵粬",
+          value: "7",
+        },
+      ],
+      tableDatatop: [], //棰樼洰琛�
+      voiceDatatop: [], //棰樼洰琛�
+      dynamicTags: [],
+      isMergeMode: false,
+      mergeDialogVisible: false,
+      selectedServices: [], // 閫変腑鐨勬湇鍔″垪琛�
+      selectedTag: "",
+      tagOptions: [
+        {
+          value: "0",
+          label: "姝e父",
+          type: "normal",
+          color: "#7ff5e1",
+          description: "鎮h�呮儏鍐垫甯革紝鏃犻渶鐗瑰埆鍏虫敞",
+        },
+        {
+          value: "1",
+          label: "寮傚父",
+          type: "abnormal",
+          color: "#f75c5c",
+          description: "鎮h�呭瓨鍦ㄥ紓甯告儏鍐碉紝闇�瑕侀噸鐐瑰叧娉�",
+        },
+        {
+          value: "2",
+          label: "璀﹀憡",
+          type: "warning",
+          color: "#fbfb4a",
+          description: "鎮h�呮儏鍐甸渶瑕佽鍛婃敞鎰忥紝鍙兘瀛樺湪椋庨櫓",
+        },
+      ],
+      zcrules: {
+        resource: [
+          { required: true, message: "璇烽�夋嫨闅忚鏂瑰紡", trigger: "change" },
+        ],
+        date1: [
+          { required: true, message: "璇烽�夋嫨闅忚鏃堕棿", trigger: "blur" },
+          {
+            validator: (rule, value, callback) => {
+              if (!value) {
+                return callback(new Error("璇烽�夋嫨闅忚鏃堕棿"));
+              }
+              const selectedDate = new Date(value);
+              const now = new Date();
+              if (selectedDate < now) {
+                return callback(new Error("闅忚鏃堕棿涓嶈兘鏃╀簬褰撳墠鏃ユ湡"));
+              }
+              callback();
+            },
+            trigger: "change",
+          },
+        ],
+      },
+      userrules: {
+        telcode: [{ validator: validatePhone, trigger: "blur" }],
+        relativetelcode: [{ validator: validatePhone, trigger: "blur" }],
+      },
+      url: "http://9.208.2.190:8090/smartor/serviceExternal/query360PatInfo",
+      postData: {
+        XiaoXiTou: {
+          FaSongFCSJC: "ZJHES",
+          FaSongJGID: localStorage.getItem("orgid"),
+          FaSongJGMC: localStorage.getItem("orgname"),
+          FaSongSJ: "2025-01-09聽17:29:36",
+          FaSongXTJC: "SUIFANGXT",
+          FaSongXTMC: "闅忚绯荤粺",
+          XiaoXiID: "5FA92AFB-9833-4608-87C7-F56A654AC171",
+          XiaoXiLX: "SC_LC_360STCX",
+          XiaoXiMC: "360聽瑙嗗浘鏌ヨ",
+          ZuHuID: localStorage.getItem("ZuHuID"),
+          ZuHuMC: localStorage.getItem("orgname"),
+        },
+        YeWuXX: {
+          BingRenXX: {
+            ZhengJianHM: "",
+            ZhengJianLXDM: "01",
+            ZhengJianLXMC: "灞呮皯韬唤璇�",
+            ZuZhiJGID: localStorage.getItem("orgid"),
+            ZuZhiJGMC: localStorage.getItem("orgname"),
+          },
+          YongHuXX: {
+            XiTongID: "SUIFANGXT",
+            XiTongMC: "闅忚绯荤粺",
+            YongHuID: localStorage.getItem("YongHuID"),
+            YongHuXM: localStorage.getItem("YongHuXM"),
+            ZuZhiJGID: localStorage.getItem("orgid"),
+            ZuZhiJGMC: localStorage.getItem("orgname"),
+            idp: "lyra",
+          },
+        },
+      },
+      pickerOptions: {
+        disabledDate(time) {
+          // 绂佺敤浠婂ぉ鍙婁箣鍓嶇殑鏃ユ湡
+          return time.getTime() < Date.now() - 24 * 60 * 60 * 1000;
+        },
+        // shortcuts: [
+        //   {
+        //     text: "涓冨ぉ鍚�",
+        //     onClick(picker) {
+        //       const date = new Date();
+        //       date.setTime(date.getTime() + 3600 * 1000 * 24 * 7);
+        //       picker.$emit("pick", date);
+        //     },
+        //   },
+        //   {
+        //     text: "15澶╁悗",
+        //     onClick(picker) {
+        //       const date = new Date();
+        //       date.setTime(date.getTime() + 3600 * 1000 * 24 * 15);
+        //       picker.$emit("pick", date);
+        //     },
+        //   },
+        //   {
+        //     text: "涓�涓湀鍚�",
+        //     onClick(picker) {
+        //       const date = new Date();
+        //       date.setTime(date.getTime() + 3600 * 1000 * 24 * 30);
+        //       picker.$emit("pick", date);
+        //     },
+        //   },
+        //   {
+        //     text: "涓変釜鏈堝悗",
+        //     onClick(picker) {
+        //       const date = new Date();
+        //       date.setTime(date.getTime() + 3600 * 1000 * 24 * 90);
+        //       picker.$emit("pick", date);
+        //     },
+        //   },
+        //   {
+        //     text: "鍏釜鏈堝悗",
+        //     onClick(picker) {
+        //       const date = new Date();
+        //       date.setTime(date.getTime() + 3600 * 1000 * 24 * 180);
+        //       picker.$emit("pick", date);
+        //     },
+        //   },
+        //   {
+        //     text: "涓�骞村悗",
+        //     onClick(picker) {
+        //       const date = new Date();
+        //       date.setTime(date.getTime() + 3600 * 1000 * 24 * 365);
+        //       picker.$emit("pick", date);
+        //     },
+        //   },
+        // ],
+      },
+      options: [
+        {
+          value: "涓冨ぉ鍚�",
+          label: "涓冨ぉ鍚�",
+        },
+        {
+          value: "15澶╁悗",
+          label: "15澶╁悗",
+        },
+        {
+          value: "涓�涓湀鍚�",
+          label: "涓�涓湀鍚�",
+        },
+        {
+          value: "涓変釜鏈堝悗",
+          label: "涓変釜鏈堝悗",
+        },
+        {
+          value: "鍏釜鏈堝悗",
+          label: "鍏釜鏈堝悗",
+        },
+        {
+          value: "涓�骞村悗",
+          label: "涓�骞村悗",
+        },
+      ],
+      statusTimer: null,
+      userform: {},
+      smsDialogVisible: false, // 鎺у埗鐭俊瀵硅瘽妗嗘樉绀�
+      smsContent: "", // 瀛樺偍鐭俊鍐呭
+      Whetherall: true, //鏄惁鍏ㄩ儴璁板綍灞曠ず
+      dialogFormVisible: false,
+      Voicetype: 0, //鏄惁涓鸿闊虫湇鍔�
+      visitCount: null,
+      logsheetlist: [],
+      topicobj: {},
+      sendname: null,
+      serviceType: null,
+      id: null,
+      taskid: null,
+      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}...`,
+        connected: `宸叉帴閫� ${this.currentPhoneNumber}`,
+        ended: "閫氳瘽宸茬粨鏉�",
+        failed: "鍛煎彨澶辫触",
+      };
+      return statusMap[this.callStatus];
+    },
+    callStatusType() {
+      const typeMap = {
+        idle: "info",
+        calling: "warning",
+        connected: "success",
+        ended: "info",
+        failed: "error",
+      };
+      return typeMap[this.callStatus];
+    },
+  },
+  created() {
+    this.taskid = this.$route.query.taskid;
+    this.id = this.$route.query.id;
+    this.sendname = this.$route.query.sendname;
+    this.patid = this.$route.query.patid;
+    this.again = this.$route.query.again;
+    this.Voicetype = this.$route.query.Voicetype;
+    this.visitCount = this.$route.query.visitCount;
+    this.serviceType = this.$route.query.serviceType;
+    this.orgname = localStorage.getItem("orgname");
+    if (this.orgname == "鐪佺珛鍚屽痉缈犺嫅闄㈠尯") {
+      this.showContinuationCareBtn = true;
+    }
+
+    if (this.orgname == "缂欎簯鍘夸腑鍖诲尰闄�") {
+      this.options = [
+        {
+          value: "鍗婁釜鏈堝悗",
+          label: "鍗婁釜鏈堝悗",
+        },
+        {
+          value: "涓�涓湀鍚�",
+          label: "涓�涓湀鍚�",
+        },
+        {
+          value: "涓や釜鏈堝悗",
+          label: "涓や釜鏈堝悗",
+        },
+        {
+          value: "涓変釜鏈堝悗",
+          label: "涓変釜鏈堝悗",
+        },
+        {
+          value: "鍏釜鏈堝悗",
+          label: "鍏釜鏈堝悗",
+        },
+        {
+          value: "12涓湀鍚�",
+          label: "12涓湀鍚�",
+        },
+      ];
+    }
+    this.getTaskservelist();
+  },
+  mounted() {
+    // 鐩戝惉瀛愮粍浠剁殑sipStatus灞炴�у彉鍖�
+    if (this.$refs.callButton) {
+      this.$watch(
+        () => this.$refs.callButton.sipStatus,
+        (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 === "鏈繛鎺�") {
+            this.isSipRegistering = true;
+            this.customCallStatus = "鍛煎彨涓柇锛岃祫婧愰噸鏂板姞杞戒腑璇风◢绛�3s閲嶆柊銆�";
+          }
+        },
+        { immediate: true } // 绔嬪嵆鎵ц涓�娆′互鑾峰彇鍒濆鍊�
+      );
+    }
+  },
+  methods: {
+    // 鑾峰彇涓婚鏍峰紡绫�
+    getTopicClass(item) {
+      console.log(item.isabnormal, "getTopicClass");
+
+      // 鏍规嵁鐘舵�佸�艰繑鍥炲搴旂殑鏍峰紡绫�
+      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({
+        taskid: this.taskid,
+        patid: this.patid,
+        subId: id ? id : this.id,
+        isFinish: false,
+      }).then((res) => {
+        if (res.code === 200) {
+          // 閽堝鍐嶆闅忚鏈嶅姟杩涜鍒犻櫎缁撴灉璧嬪��
+          // if (this.again && res.data.upScriptResult) {
+          //   res.data.upScriptResult.forEach((itemA) => {
+          //     const itemB = res.data.scriptResult.find(
+          //       (item) => item.scriptContent === itemA.scriptContent
+          //     );
+          //     if (itemB) {
+          //       itemB.scriptResult = itemA.scriptResult;
+          //     }
+          //   });
+          // }
+          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) {
+              item.scriptResult = item.scriptResult.split("&");
+              item.isoption = 3;
+            }
+          });
+          this.taskname = res.data.taskName;
+          this.overdata();
+        }
+      });
+    },
+    //鎮h��360璺宠浆
+    gettoken360(sfzh, drcode, drname) {
+      // this.$modal.msgWarning("360鍔熻兘鏆傛湭寮�閫�");
+
+      this.postData.YeWuXX.BingRenXX.ZhengJianHM = sfzh;
+
+      query360PatInfo(this.postData).then((res) => {
+        if (res.data.url) {
+          window.open(res.data.url, "_blank");
+          // this.linkUrl = res.data.url;
+        } else {
+          this.$modal.msgWarning("360鏌ヨ鏃犵粨鏋�");
+        }
+      });
+    },
+    // 鑾峰彇鍩虹淇℃伅
+    getuserinfo() {
+      const queryParams = {
+        pid: Number(this.patid),
+        allhosp: "0", //1浣忛櫌2闂ㄨ瘖3浣撴4鍑洪櫌
+      };
+      // 鎮h�呭熀纭�淇℃伅
+      messagelistpatient(queryParams).then((response) => {
+        if (response.rows[0]) {
+          this.userform = response.rows[0];
+          // this.dynamicTags = response.rows[0].tagList.map(this.processElement);
+        }
+      });
+      listcontactinformation({ patid: this.patid }).then((response) => {
+        this.tableData = response.rows;
+        if (this.tableData.length) {
+          this.userform.relativetelcode = this.tableData[0].contactway;
+          this.userform.relation = this.tableData[0].relation;
+        }
+      });
+    },
+    // 鍐嶆闅忚鏃堕棿閫夊彇
+    visitChange(value) {
+      if (!this.form.endtime) {
+        this.$message.warning("璇峰厛纭鍑洪櫌鏃堕棿");
+        this.form.visitType = "";
+        this.$refs.zcform.clearValidate(["visitType"]);
+        return;
+      }
+
+      const dischargeDate = new Date(this.form.endtime);
+      const now = new Date();
+      let followupDate = new Date(dischargeDate);
+
+      // 鏍规嵁閫夋嫨鐨勯殢璁挎柟寮忚绠楅殢璁挎棩鏈�
+      if (value.includes("涓冨ぉ鍚�")) {
+        followupDate.setDate(dischargeDate.getDate() + 7);
+      } else if (value.includes("15澶╁悗") || value.includes("鍗婁釜鏈堝悗")) {
+        followupDate.setDate(dischargeDate.getDate() + 15);
+      } else if (value.includes("涓�涓湀鍚�")) {
+        followupDate.setMonth(dischargeDate.getMonth() + 1);
+      } else if (value.includes("涓や釜鏈堝悗")) {
+        followupDate.setMonth(dischargeDate.getMonth() + 2);
+      } else if (value.includes("涓変釜鏈堝悗")) {
+        followupDate.setMonth(dischargeDate.getMonth() + 3);
+      } else if (value.includes("鍏釜鏈堝悗")) {
+        followupDate.setMonth(dischargeDate.getMonth() + 6);
+      } else if (value.includes("涓�骞村悗") || value.includes("12涓湀鍚�")) {
+        followupDate.setFullYear(dischargeDate.getFullYear() + 1);
+      }
+
+      if (followupDate < now) {
+        this.$message.warning(
+          `璁$畻鍑虹殑闅忚鏃堕棿 ${this.formatTime(followupDate)} 宸茶繃鏈焋
+        );
+        this.form.visitType = "";
+        this.$refs.zcform.clearValidate(["visitType", "date1"]);
+        return;
+      }
+
+      this.form.date1 = this.formatTime(followupDate);
+
+      this.$refs.zcform.clearValidate(["date1"]);
+    },
+    // 妫�鏌ラ殢璁挎棩鏈熸槸鍚︽湁鏁�
+    checkFollowupDate(date) {
+      if (!date) {
+        this.form.date1 = "";
+        this.$refs.zcform.clearValidate(["date1"]);
+        return;
+      }
+
+      const selectedDate = new Date(date);
+      const now = new Date();
+
+      if (selectedDate < now) {
+        this.$message.warning("闅忚鏃堕棿涓嶈兘鏃╀簬褰撳墠鏃ユ湡");
+        this.form.date1 = "";
+        this.$refs.zcform.validateField("date1"); // 瑙﹀彂楠岃瘉
+      }
+    },
+    // 鑾峰彇璇煶鏁版嵁
+    getPersonVoices(id) {
+      let obj = {
+        taskid: this.taskid,
+        patid: this.patid,
+        subId: id ? id : this.id,
+      };
+
+      getPersonVoices(obj).then((res) => {
+        if (res.code == 200) {
+          this.voiceDatatop = res.data.serviceSubtaskDetails;
+          this.voice = res.data.voice;
+          this.activeName = "yy";
+          this.taskname = res.data.taskName;
+          // 闂嵎灞曠ず鏁版嵁澶勭悊
+          this.tableDatatop = res.data.filteredDetails;
+          this.tableDatatop.forEach((item) => {
+            if (item.targetvalue) {
+              item.scriptResult = item.targetvalue.split("&");
+            } else {
+              item.scriptResult = [];
+            }
+          });
+
+          if (!this.tableDatatop.length) {
+            this.puttaskid(this.templateid);
+          }
+        }
+      });
+    },
+    // 鑾峰彇闂嵎瀹屾暣鏁版嵁姣斿
+    puttaskid(id) {
+      getTaskFollowup(id).then((res) => {
+        if (res.code == 200) {
+          this.tableDatatop = res.data.ivrTaskTemplateScriptVOList;
+          this.tableDatatop.forEach((item) => {
+            item.id = null;
+            // 绫诲瀷鍒ゆ柇璧嬪��
+            if (item.ivrTaskScriptTargetoptionList) {
+              item.targetvalue = 1;
+              item.questiontext = item.scriptContent;
+              item.targetvalue = item.ivrTaskScriptTargetoptionList
+                .map((obj) => obj.targetvalue)
+                .join("&");
+            }
+            if (item.targetvalue) {
+              item.scriptResult = item.targetvalue.split("&");
+            } else {
+              item.scriptResult = [];
+            }
+          });
+        }
+      });
+    },
+    // 鍖绘姢浜哄憳瀛樺偍鏁版嵁
+    getdetail() {
+      let excep = "";
+      const promises = [];
+      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
+        );
+
+        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,
+          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("&");
+        } else if (item.scriptType != 2 && item.scriptResult) {
+          obj.asrtext = item.scriptResult;
+        }
+
+        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("淇敼澶辫触");
+            }
+          });
+          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) {
+        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",
+          });
+        }
+      }
+    },
+    // 鐢佃瘽============================
+    // 楠岃瘉鐢佃瘽鍙风爜鏍煎紡骞惰繑鍥為敊璇俊鎭�
+    validatePhoneNumber(phone) {
+      if (!phone) {
+        return { isValid: false, message: "璇疯緭鍏ョ數璇濆彿鐮�" };
+      }
+
+      // 鎵嬫満鍙锋鍒�
+      const mobileRegex = /^1[3-9]\d{9}$/;
+
+      // 甯﹀尯鍙风殑鍥哄畾鐢佃瘽锛堝畬鏁存牸寮忥級
+      const landlineFullRegex = /^0\d{2,3}-?\d{7,8}$/;
+
+      // 涓嶅甫鍖哄彿鐨勫浐瀹氱數璇濓紙浠呮湰鍦板彿鐮侊級
+      const landlineLocalRegex = /^\d{7,8}$/;
+
+      if (mobileRegex.test(phone)) {
+        return { isValid: true, type: "mobile" };
+      } else if (landlineFullRegex.test(phone)) {
+        return { isValid: true, type: "landline" };
+      } else if (landlineLocalRegex.test(phone)) {
+        return {
+          isValid: false,
+          message: "鏈湴鍙风爜璇锋坊鍔犲尯鍙凤紙濡�028-1234567锛�",
+        };
+      } else {
+        return {
+          isValid: false,
+          message: "璇疯緭鍏ユ纭殑鐢佃瘽鍙风爜锛堟墜鏈哄彿鎴栧甫鍖哄彿鐨勫浐瀹氱數璇濓級",
+        };
+      }
+    },
+    // 浣跨敤绀轰緥
+    isValidPhone(phone) {
+      return this.validatePhoneNumber(phone).isValid;
+    },
+    handleCall(phone, type, dh) {
+      if (!this.isValidPhone(phone) && !dh) {
+        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;
+          }
+        });
+      });
+    },
+    // 澶勭悊閫氳瘽鐘舵�佸彉鍖�
+    handleCallStatusChange(status) {
+      console.log(status, "status");
+
+      this.callStatus = status.type;
+
+      if (status.type === "connected") {
+        this.currentCall = {
+          phone: this.currentPhoneNumber,
+          type: this.callType,
+          startTime: new Date(),
+        };
+      } else if (status.type === "ended" || status.type === "failed") {
+        this.currentCall = null;
+      }
+
+      // 鍙互鏍规嵁鐘舵�佹墽琛屽叾浠栨搷浣�
+      if (status.type === "failed") {
+        this.$message.error(`鍛煎彨澶辫触: ${status.text}`);
+      }
+    },
+    // 缁撴潫褰撳墠閫氳瘽
+    endCurrentCall() {
+      if (!this.currentCall) return;
+
+      this.isEndingCall = true;
+      this.$refs.callButton.endCall();
+
+      // 3绉掑悗閲嶇疆鐘舵��
+      setTimeout(() => {
+        this.isEndingCall = false;
+      }, 3000);
+    },
+    yuyingetdetail() {
+      const dataToSubmit = JSON.parse(JSON.stringify(this.tableDatatop));
+      console.log(dataToSubmit, "dataToSubmit");
+      // return;
+      dataToSubmit.forEach((item, index) => {
+        // 瀵规嫹璐濈殑鏁版嵁杩涜鎿嶄綔锛屼笉褰卞搷鍘熷鐨� scriptResult 鏁扮粍
+        item.scriptResult = item.scriptResult.join("&");
+        item.templatequestionnum = index + 1;
+        item.subId = this.id;
+        item.taskid = this.taskid;
+        item.asrtext = item.matchedtext;
+        if (!item.id) {
+          item.isoperation = 1;
+        }
+        item.patid = this.patid;
+        item.templateid = item.templateID;
+      });
+
+      let obj = {
+        serviceSubtaskDetailList: dataToSubmit, // 鎻愪氦澶勭悊鍚庣殑鍓湰
+        param1: this.taskid,
+        param2: this.patid,
+        subId: this.id,
+      };
+      const orgName = localStorage.getItem("orgname");
+      console.log(orgName, "orgName");
+
+      if (this.form.isVisitAgain != 1 || orgName == "涓芥按甯備腑鍖婚櫌") {
+        this.Torouter();
+        return;
+      }
+      addPersonVoices(obj).then((res) => {
+        if (res.code == 200) {
+          this.$modal.msgSuccess("鏈嶅姟淇濆瓨鎴愬姛");
+          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();
+            });
+        }
+      });
+    },
+    // 鍐嶆闅忚鏁版嵁鏇存浛
+    formtidy() {
+      this.form.visitType2 = this.form.visitType;
+      this.form.date2 = this.form.visitTime;
+      // this.form.date1 = this.setCurrentDate();
+      this.form.remark2 = this.form.remark;
+    },
+    setCurrentDate() {
+      // 鑾峰彇褰撳墠鏃ユ湡骞舵牸寮忓寲涓� yyyy-MM-dd
+      const today = new Date();
+      const year = today.getFullYear();
+      const month = String(today.getMonth() + 1).padStart(2, "0");
+      const day = String(today.getDate()).padStart(2, "0");
+      return `${year}-${month}-${day}`;
+    },
+    // 鑾峰彇鎮h�呰褰�
+    getTaskservelist(id) {
+      if (id) {
+        this.Whetherall = false;
+      } else {
+        this.Whetherall = true;
+      }
+
+      getTaskservelist({
+        patid: this.patid,
+        subId: id,
+        pageSize: 100,
+      }).then((res) => {
+        if (res.code == 200) {
+          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;
+          this.selectedTag = this.form.excep;
+          const targetDate = new Date(this.form.visitTime); // 鐩爣鏃ユ湡
+          const now = new Date(); // 褰撳墠鏃堕棿
+          if (now < targetDate && this.form.sendstate == 2) {
+            this.$confirm("褰撳墠鏈嶅姟鏈埌鍙戦�佹椂闂磋璋ㄦ厧淇敼", "鎻愮ず", {
+              confirmButtonText: "纭畾",
+              cancelButtonText: "鍙栨秷",
+              type: "warning",
+            })
+              .then(() => {})
+              .catch(() => {});
+          }
+          this.getuserinfo();
+        }
+        if (this.Voicetype) {
+          this.getPersonVoices();
+        } else {
+          this.getsearchrResults();
+        }
+      });
+    },
+    // 璋冭捣鐭俊鍙戦�佸璇濇
+    sendAgainmsg() {
+      this.smsDialogVisible = true;
+      // 鍙互鍦ㄨ繖閲屽垵濮嬪寲 smsContent锛屼緥濡� this.smsContent = '';
+    },
+
+    // 鍙戦�佺煭淇$殑鏂规硶
+    sendSms() {
+      // 杩欓噷璋冪敤浣犵殑鐭俊鍙戦�� API
+      // 鍋囪 API 涓� sendMsg锛屽弬鏁板彲鑳介渶瑕佹牴鎹疄闄呮儏鍐佃皟鏁�
+      sendMsg({
+        phone: this.userform.telcode, // 纭繚鐢佃瘽鍙风爜瀛楁姝g‘
+        content: this.smsContent,
+      })
+        .then((res) => {
+          if (res.code == 200) {
+            this.$modal.msgSuccess("鍙戦�佹垚鍔�");
+            this.smsDialogVisible = false; // 鍏抽棴瀵硅瘽妗�
+            this.smsContent = ""; // 娓呯┖鍐呭
+          } else {
+            this.$modal.msgError("鍙戦�佸け璐�");
+          }
+        })
+        .catch((error) => {
+          console.error("鍙戦�佺煭淇″け璐�:", error);
+          this.$modal.msgError("鍙戦�佸け璐�");
+        });
+    },
+    Editsingletaskson(son) {
+      let objson = {};
+      getTaskservelist({
+        patid: this.patid,
+        subId: this.id,
+      }).then((res) => {
+        if (res.code == 200) {
+          objson = res.rows[0].serviceSubtaskList[0];
+          objson.suggest = son;
+          Editsingletaskson(objson).then((res) => {
+            if (res.code) {
+              this.$modal.msgSuccess("鏈嶅姟璁板綍鎴愬姛");
+              this.getTaskservelist();
+            }
+          });
+        }
+      });
+    },
+    Editsingletasksonyic(sendstate) {
+      let objson = {};
+      getTaskservelist({
+        patid: this.patid,
+        subId: this.id,
+      }).then((res) => {
+        if (res.code == 200) {
+          objson = res.rows[0].serviceSubtaskList.find(
+            (item) => item.id == this.id
+          );
+          objson.remark = this.form.remark;
+          objson.taskSituation = this.form.taskSituation;
+          objson.excep = this.selectedTag;
+          if (sendstate) objson.sendstate = sendstate;
+          Editsingletaskson(objson).then((res) => {
+            if (res.code) {
+              this.$modal.msgSuccess("鏈嶅姟淇敼鎴愬姛");
+              alterpatient(this.userform).then((res) => {
+                if (res.code == 200) {
+                  this.$modal.msgSuccess("鍩虹淇℃伅淇濆瓨鎴愬姛");
+                } else {
+                  this.$modal.msgError("鍩虹淇℃伅淇敼澶辫触");
+                }
+              });
+              this.getTaskservelist();
+            }
+          });
+        }
+      });
+    },
+    // 寮傚父鍒楁覆鏌�
+    tableRowClassName({ row, rowIndex }) {
+      if (row.id == this.id) {
+        return "warning-row";
+      }
+      return "";
+    },
+    getSelectedTagType() {
+      if (!this.selectedTag) return "";
+      const tag = this.tagOptions.find(
+        (item) => item.value === this.selectedTag
+      );
+      return tag ? tag.type : "";
+    },
+
+    getSelectedTagColor() {
+      if (!this.selectedTag) return "";
+      const tag = this.tagOptions.find(
+        (item) => item.value === this.selectedTag
+      );
+      return tag ? tag.color : "";
+    },
+
+    getSelectedDescription() {
+      if (!this.selectedTag) return "";
+      const tag = this.tagOptions.find(
+        (item) => item.value === this.selectedTag
+      );
+      return tag ? tag.description : "";
+    },
+
+    // 璋冭捣鍐嶆鍙戦��
+    sendAgain() {
+      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;
+          }
+        } else {
+          document.querySelector("#app").scrollTo(0, 0);
+          this.formtidy();
+          this.dialogFormVisible = true;
+        }
+      });
+    },
+    // 鏌ョ湅璇︽儏
+    Seedetails(row) {
+      this.$modal
+        .confirm('鏄惁鏌ョ湅浠诲姟涓�"' + row.taskName + '"鐨勬湇鍔¤鎯呮暟鎹紵')
+        .then(() => {
+          let type = "";
+          console.log(row, "rwo");
+          if (row.type == 1) {
+            type = 1;
+          }
+          this.taskid = row.taskid;
+          this.id = row.id;
+          this.patid = row.patid;
+          this.serviceType = row.serviceType;
+          this.getTaskservelist();
+        })
+        .catch(() => {});
+    },
+    aahandleOptionChange(a, b, c) {
+      const result = c.find((item) => item.optioncontent == a);
+      if (result.nextQuestion == 0) {
+        this.tableDatatop = this.tableDatatop.reduce((acc, item, i) => {
+          acc.push(i > b ? { ...item, astrict: 1 } : item);
+          return acc;
+        }, []);
+      } else {
+        this.tableDatatop = this.tableDatatop.reduce((acc, item, i) => {
+          acc.push(i > b ? { ...item, astrict: 0 } : item);
+          return acc;
+        }, []);
+      }
+      if (this.Voicetype) {
+        var obj = this.tableDatatop[b].ivrTaskScriptTargetoptionList.find(
+          (item) => item.optioncontent == a
+        );
+      } else {
+        var obj = this.tableDatatop[b].svyTaskTemplateTargetoptions.find(
+          (item) => item.optioncontent == a
+        );
+      }
+      if (obj.isabnormal) {
+        this.tableDatatop[b].isabnormal = true;
+      } else {
+        this.tableDatatop[b].isabnormal = false;
+      }
+      this.$forceUpdate();
+    },
+    handleRadioToggles(questionItem, optionValue) {
+      if (!questionItem.matchedtext) {
+        questionItem.matchedtext == "";
+      }
+      // 濡傛灉鐐瑰嚮鐨勬槸褰撳墠宸查�変腑鐨勯�夐」锛屽垯鍙栨秷閫変腑
+      if (questionItem.matchedtext == optionValue) {
+        this.$set(questionItem, "matchedtext", "");
+        // 鍚屾椂閲嶇疆涓庨�夐」鐩稿叧鐨勭姸鎬�
+        // questionItem.isabnormal = false;
+        questionItem.showAppendInput = false;
+        // 娉ㄦ剰锛氬彇娑堥�変腑鏃讹紝鎴戜滑閫氬父涓嶅笇鏈涜Е鍙戦鐩烦杞�昏緫锛屾墍浠ョ洿鎺ヨ繑鍥�
+        // 濡傛灉闇�瑕侊紝鍙互鍦ㄨ繖閲屾坊鍔犲彇娑堥�変腑鍚庣殑鐗瑰畾閫昏緫锛屼緥濡傞噸缃鐩簭鍒�
+      } else {
+        // 濡傛灉鐐瑰嚮鐨勬槸鏈�変腑鐨勯�夐」锛屽垯閫氳繃鏇存敼缁戝畾鍊兼潵瑙﹀彂鍘熷鐨� handleOptionChange 鏂规硶
+        // 杩欓噷鍙渶瑕佹敼鍙� v-model 缁戝畾鐨勫�硷紝change浜嬩欢浼氳嚜鍔ㄨЕ鍙�
+        this.$set(questionItem, "matchedtext", optionValue); // 鍚庣画鐨勮烦杞瓑澶嶆潅閫昏緫浼氬湪 handleOptionChange 涓甯告墽琛�
+      }
+    },
+    // 鏂板鐨勫垏鎹㈤�変腑/鍙栨秷閫変腑鏂规硶
+    handleRadioToggle(questionItem, index, options, optionValue) {
+      // 濡傛灉鐐瑰嚮鐨勬槸褰撳墠宸查�変腑鐨勯�夐」锛屽垯鍙栨秷閫変腑
+      if (questionItem.scriptResult === optionValue) {
+        questionItem.scriptResult = ""; // 娓呯┖閫変腑鍊�
+        // 鍚屾椂閲嶇疆涓庨�夐」鐩稿叧鐨勭姸鎬�
+        // questionItem.isabnormal = false;
+        questionItem.showAppendInput = false;
+        // 娉ㄦ剰锛氬彇娑堥�変腑鏃讹紝鎴戜滑閫氬父涓嶅笇鏈涜Е鍙戦鐩烦杞�昏緫锛屾墍浠ョ洿鎺ヨ繑鍥�
+        // 濡傛灉闇�瑕侊紝鍙互鍦ㄨ繖閲屾坊鍔犲彇娑堥�変腑鍚庣殑鐗瑰畾閫昏緫锛屼緥濡傞噸缃鐩簭鍒�
+      } else {
+        // 濡傛灉鐐瑰嚮鐨勬槸鏈�変腑鐨勯�夐」锛屽垯閫氳繃鏇存敼缁戝畾鍊兼潵瑙﹀彂鍘熷鐨� handleOptionChange 鏂规硶
+        // 杩欓噷鍙渶瑕佹敼鍙� v-model 缁戝畾鐨勫�硷紝change浜嬩欢浼氳嚜鍔ㄨЕ鍙�
+        questionItem.scriptResult = optionValue;
+        this.handleOptionChange(optionValue, index, options, questionItem);
+        // 鍚庣画鐨勮烦杞瓑澶嶆潅閫昏緫浼氬湪 handleOptionChange 涓甯告墽琛�
+      }
+    },
+
+    // 鍦╩ethods閮ㄥ垎锛屼慨鏀筯andleOptionChange鏂规硶:
+    handleOptionChange(selectedOption, questionIndex, options, a) {
+      console.log(selectedOption, questionIndex, options, a, "888");
+
+      if (document.activeElement) {
+        document.activeElement.blur();
+      }
+
+      // 鎵惧埌琚�変腑鐨勯�夐」瀵硅薄
+      const selectedOptionObj = options.find(
+        (item) => item.optioncontent == selectedOption
+      );
+
+      // 澶勭悊寮傚父鐘舵�侀珮浜�
+      this.tableDatatop[questionIndex].isabnormal =
+        selectedOptionObj.isabnormal;
+      // 澶勭悊闄勫姞杈撳叆妗嗘樉绀�
+
+      this.tableDatatop[questionIndex].showAppendInput =
+        selectedOptionObj.appendflag == 1;
+      console.log(this.tableDatatop);
+
+      // if (!this.tableDatatop[questionIndex].showAppendInput) {
+      //   this.tableDatatop[questionIndex].answerps = ""; // 娓呴櫎闄勫姞淇℃伅
+      // }
+      // 淇濆瓨褰撳墠棰樼洰涔嬪墠宸茬粡闅愯棌鐨勯鐩姸鎬�
+      const previouslyHiddenBeforeCurrent = this.tableDatatop
+        .slice(0, questionIndex)
+        .map((item, index) => (item.astrict ? index : -1))
+        .filter((index) => index !== -1);
+
+      // 淇濆瓨涔嬪墠鍥爊extQuestion=0鑰岄殣钘忕殑棰樼洰鑼冨洿
+      const previouslyHiddenByEnd = this.tableDatatop
+        .map((item, index) => (item.hiddenByEnd ? index : -1))
+        .filter((index) => index !== -1);
+
+      // 濡傛灉branchFlag涓�1锛屽鐞嗛鐩烦杞�
+      if (a.branchFlag == 1) {
+        if (selectedOptionObj.nextQuestion == 0) {
+          // 缁撴潫闂瓟 - 闅愯棌鍚庨潰鎵�鏈夐鐩苟鏍囪
+          this.tableDatatop = this.tableDatatop.map((item, index) => ({
+            ...item,
+            astrict: index > questionIndex,
+            hiddenByEnd: index > questionIndex, // 鏍囪杩欎簺棰樼洰鏄缁撴潫闂瓟闅愯棌鐨�
+          }));
+        } else {
+          // 姝e父璺宠浆閫昏緫
+          const nextQuestionIndex = selectedOptionObj.nextQuestion - 1;
+
+          this.tableDatatop = this.tableDatatop.map((item, index) => {
+            // 淇濈暀褰撳墠棰樼洰涔嬪墠鐨勯殣钘忕姸鎬�
+            if (index < questionIndex) {
+              return {
+                ...item,
+                astrict: previouslyHiddenBeforeCurrent.includes(index),
+                hiddenByEnd: false, // 娓呴櫎缁撴潫鏍囪
+              };
+            }
+
+            // 褰撳墠棰樼洰鎬绘槸鍙
+            if (index === questionIndex) {
+              return { ...item, astrict: 0, hiddenByEnd: false };
+            }
+
+            // 鏄剧ず鐩爣涓嬩竴棰�
+            if (index === nextQuestionIndex) {
+              return { ...item, astrict: 0, hiddenByEnd: false };
+            }
+
+            // 濡傛灉鏄箣鍓嶈缁撴潫闂瓟闅愯棌鐨勯鐩紝鐜板湪搴旇鎭㈠鏄剧ず
+            if (item.hiddenByEnd) {
+              return { ...item, astrict: 0, hiddenByEnd: false };
+            }
+
+            // 闅愯棌褰撳墠棰樺拰鐩爣棰樹箣闂寸殑棰樼洰
+            if (index > questionIndex && index < nextQuestionIndex) {
+              return { ...item, astrict: 1, hiddenByEnd: false };
+            }
+
+            // 鍏朵粬鎯呭喌淇濇寔鍘熺姸
+            return item;
+          });
+        }
+      } else {
+        // 濡傛灉娌℃湁璺宠浆锛屽彧闇�纭繚涓嬩竴棰樺彲瑙�
+        this.tableDatatop = this.tableDatatop.map((item, index) => ({
+          ...item,
+          astrict: index === questionIndex + 1 ? 0 : item.astrict,
+          hiddenByEnd: index === questionIndex + 1 ? false : item.hiddenByEnd,
+        }));
+      }
+      2;
+
+      this.$forceUpdate();
+    },
+    overdata() {
+      this.tableDatatop.forEach((item, index) => {
+        var obj = item.svyTaskTemplateTargetoptions.find(
+          (items) => items.optioncontent == item.scriptResult
+        );
+        if (obj) {
+          if (obj.isabnormal) {
+            this.tableDatatop[index].isabnormal = obj.isabnormal;
+          }
+          this.$forceUpdate();
+        }
+      });
+    },
+    // 鍒涘缓鍐嶆闅忚鏈嶅姟
+    setupsubtask() {
+      this.$refs["zcform"].validate((valid) => {
+        if (valid) {
+          if (this.form.date1 && new Date(this.form.date1) < new Date()) {
+            this.$message.error("闅忚鏃堕棿涓嶈兘灏忎簬褰撳墠鏃堕棿");
+            return false;
+          }
+          if (this.form.resource == "2" && !this.form.remark) {
+            this.$message.error("褰撳墠閫夋嫨涓洪殢璁夸腑蹇冮殢璁块渶杈撳叆闅忚璁板綍");
+            return false;
+          }
+          this.form.remark =
+            this.form.remark + "銆�" + this.getCurrentTime() + "銆�";
+          let form = structuredClone(this.form);
+          form.visitTime = this.parseTime(form.date1);
+          form.finishtime = "";
+          if (form.resource) {
+            if (form.resource == 2) {
+              form.visitDeptCode = localStorage.getItem("deptCode")
+                ? localStorage.getItem("deptCode")
+                : form.deptcode;
+              form.visitDeptName = "闅忚涓績";
+            } else {
+              form.visitDeptCode = form.deptcode;
+              form.visitDeptName = form.deptname;
+            }
+          } else {
+            this.$modal.msgError("鏈�夋嫨闅忚鏂瑰紡");
+            return;
+          }
+          // form.id = null;
+          form.sendstate = 2;
+          console.log(form.serviceType, "form.serviceType");
+
+          addserviceSubtask(form).then((res) => {
+            if (res.code == 200) {
+              this.$modal.msgSuccess("鍒涘缓鎴愬姛");
+              if (form.serviceType == 13) {
+                this.$router.push({
+                  path: "/logisticsservice/zbAgain",
+                });
+              } else if (form.serviceType == 2) {
+                this.$router.push({
+                  path: "/logisticsservice/again",
+                });
+              }
+            } else {
+              this.$modal.msgError("鍒涘缓澶辫触");
+            }
+            document.querySelector("#app").scrollTo(0, 0);
+            this.dialogFormVisible = false;
+          });
+        }
+      });
+    },
+    getCurrentTime() {
+      const now = new Date();
+      const year = now.getFullYear();
+      const month = String(now.getMonth() + 1).padStart(2, "0");
+      const day = String(now.getDate()).padStart(2, "0");
+      const hours = String(now.getHours()).padStart(2, "0");
+      const minutes = String(now.getMinutes()).padStart(2, "0");
+      const seconds = String(now.getSeconds()).padStart(2, "0");
+
+      return `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`;
+    },
+    updateScore(a, b, c) {},
+    // 鍚堝苟淇敼鐩稿叧=============================
+    toggleMergeMode() {
+      this.isMergeMode = !this.isMergeMode;
+      if (!this.isMergeMode) {
+        this.selectedServices = [];
+      }
+    },
+
+    handleSelectionChange(selection) {
+      this.selectedServices = selection
+        .filter(
+          (item) => !item.preachformson || !item.preachformson.includes("3")
+        )
+        .map((item) => ({
+          id: item.id,
+          taskid: item.taskid,
+          taskName: item.taskName,
+          sendname: item.sendname,
+        }));
+    },
+    checkSelectable(row, index) {
+      // 褰� sendstate 涓� 6 鏃朵笉鍙��
+      return row.sendstate !== 6;
+    },
+    openMergeDialog() {
+      if (this.selectedServices.length < 2) {
+        this.$message.warning("璇疯嚦灏戦�夋嫨2涓棶鍗锋湇鍔¤繘琛屽悎骞�");
+        return;
+      }
+      this.mergeDialogVisible = true;
+    },
+
+    handleMergeSave(mergedData) {
+      // 澶勭悊鍚堝苟淇濆瓨閫昏緫
+      this.mergeDialogVisible = false;
+      this.isMergeMode = false;
+      this.selectedServices = [];
+
+      // 鏄剧ず淇濆瓨缁撴灉
+      if (mergedData.successCount == mergedData.totalCount) {
+        this.$message.success(`鎴愬姛淇濆瓨 ${mergedData.successCount} 涓棶鍗穈);
+      } else if (mergedData.successCount > 0) {
+        this.$message.warning(
+          `鎴愬姛淇濆瓨 ${mergedData.successCount} 涓棶鍗凤紝澶辫触 ${
+            mergedData.totalCount - mergedData.successCount
+          } 涓猔
+        );
+      } else {
+        this.$message.error("鎵�鏈夐棶鍗蜂繚瀛樺け璐�");
+      }
+
+      // 鍒锋柊鏁版嵁
+      this.getTaskservelist();
+    },
+    // 寤剁画鎶ょ悊
+    handleContinuationCare() {
+      if (this.form.continueFlag != 2) {
+        this.$modal.confirm("鏄惁涓烘湰娆℃湇鍔″垱寤哄欢缁姢鐞嗭紵").then(() => {
+          this.$router.push({
+            path: "/followvisit/ContinueFordetails/",
+            query: {
+              taskid: this.taskid,
+              patid: this.patid,
+              id: this.id,
+              Voicetype: this.Voicetype,
+              visitCount: this.visitCount,
+            },
+          });
+        });
+      } else {
+        this.$router.push({
+          path: "/followvisit/ContinueFordetails/",
+          query: {
+            taskid: this.taskid,
+            patid: this.patid,
+            id: this.id,
+            Voicetype: this.Voicetype,
+            visitCount: this.visitCount,
+          },
+        });
+      }
+    },
+  },
+  // deactivated() {
+  //   console.log(11);
+  // },
+  beforeRouteLeave(to, from, next) {
+    this.$refs.callButton.cleanupResources();
+    if (this.$refs.CallCenterLs) {
+      console.log(1);
+
+      this.$refs.CallCenterLs.handleSeatLogout();
+    }
+    next(); // 纭繚璋冪敤 nex
+  },
+  // beforeRouteUpdate() {
+  //   console.log(33);
+  // },
+};
+</script>
+
+<style lang="scss" scoped>
+.Followupdetailspage {
+  margin: 10px;
+  display: flex;
+  flex-direction: column;
+  gap: 20px;
+}
+
+.action-container {
+  display: flex;
+  gap: 20px;
+  margin: 0 10px 20px 10px;
+
+  .manual-action {
+    flex: 1;
+    min-width: 0;
+    height: 100%;
+    /* 纭繚楂樺害缁ф壙 */
+  }
+
+  .call-action {
+    width: 60%;
+    min-width: 0;
+    height: 100%;
+    /* 纭繚楂樺害缁ф壙 */
+  }
+}
+
+.numeric-input {
+  position: relative;
+}
+
+.numeric-input::after {
+  content: "鍙兘杈撳叆鏁板瓧";
+  position: absolute;
+  right: 8px;
+  top: 50%;
+  transform: translateY(-50%);
+  font-size: 12px;
+  color: #999;
+  background: #f5f5f5;
+  padding: 2px 6px;
+  border-radius: 4px;
+}
+
+.call-container {
+  padding: 20px;
+  background: #fff;
+  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);
+  border-radius: 4px;
+  height: 100%;
+
+  .call-header {
+    margin-bottom: 20px;
+
+    h2 {
+      font-size: 20px;
+      color: #333;
+      margin: 0;
+      padding-bottom: 10px;
+      border-bottom: 1px solid #eee;
+    }
+  }
+
+  .call-status {
+    margin-bottom: 20px;
+  }
+
+  .hangup-btn {
+    text-align: center;
+    margin-top: 20px;
+  }
+}
+
+.merge-controls {
+  background: #f5f7fa;
+  border-radius: 4px;
+  margin-left: 20px;
+}
+
+.Followuserinfo {
+  margin: 10px 10px 0 10px;
+  align-items: center;
+  padding: 30px;
+  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);
+
+  .userinfo-text {
+    font-size: 20px;
+    margin-right: 20px;
+    margin-bottom: 10px;
+  }
+
+  .userinfo-value {
+    color: rgb(15, 139, 211);
+
+    span {
+      margin-right: 20px;
+    }
+  }
+}
+
+::v-deep.el-table .warning-row {
+  background: #c4e2ee;
+}
+
+.Followuserinfos {
+  align-items: center;
+  padding: 30px;
+  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;
+  /* 鏈�灏忛珮搴︿笌闅忚鍐呭涓�鑷� */
+  display: flex;
+  flex-direction: column;
+
+  .userinfo-text {
+    font-size: 20px;
+    margin-right: 20px;
+    margin-bottom: 10px;
+  }
+
+  .userinfo-value {
+    color: rgb(15, 139, 211);
+
+    span {
+      margin-right: 20px;
+    }
+  }
+
+  .el-form {
+    flex: 1;
+    overflow-y: auto;
+    /* 鍐呭瓒呰繃楂樺害鏃舵樉绀烘粴鍔ㄦ潯 */
+    max-height: calc(880px - 60px);
+    /* 鍑忓幓padding */
+    padding-right: 10px;
+    /* 闃叉婊氬姩鏉¢伄鎸″唴瀹� */
+  }
+}
+
+.append-input-container {
+  margin-top: 15px;
+  padding: 10px;
+  background-color: #f5f7fa;
+  border-radius: 4px;
+  border: 1px solid #dcdfe6;
+}
+
+.borderdiv {
+  min-height: 60vh;
+  font-size: 20px;
+  padding: 30px;
+
+  .title {
+    font-size: 22px;
+    font-weight: bold;
+    margin-bottom: 20px;
+    text-align: center;
+  }
+
+  .leftside {
+    margin: 30px 0;
+
+    span {
+      width: 400px;
+      margin-left: 20px;
+      padding: 10px;
+      color: #fff;
+      background: rgb(110, 196, 247);
+      border-radius: 10px;
+    }
+  }
+
+  .offside {
+    display: flex;
+    flex-direction: row-reverse;
+
+    .offside-value {
+      padding: 10px;
+      background: rgb(217, 173, 253);
+      border-radius: 10px;
+      color: #fff;
+      margin-right: 20px;
+    }
+  }
+}
+
+.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;
+  /* 璁剧疆鏈�灏忛珮搴� */
+
+  .title {
+    font-size: 22px;
+    font-weight: bold;
+    margin-bottom: 20px;
+    text-align: center;
+  }
+}
+
+.preview-left {
+  margin: 20px;
+  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: 716px;
+  /* 璁剧疆鏈�澶ч珮搴� */
+  overflow-y: auto;
+  /* 鍐呭瓒呰繃楂樺害鏃舵樉绀烘粴鍔ㄦ潯 */
+
+  .topic-dev {
+    margin-bottom: 25px;
+    font-size: 20px !important;
+
+    .dev-text {
+      margin-bottom: 10px;
+    }
+  }
+}
+
+.scriptTopic-isabnormal {
+  color: red;
+}
+
+.detailed {
+  width: 88%;
+  border-radius: 8px;
+  padding: 30px;
+  margin-bottom: 30px;
+  background-color: #ddf0f8;
+
+  .bg-purple {
+    margin-bottom: 20px;
+  }
+
+  .spanvalue {
+    display: inline-block;
+    min-width: 200px;
+    border-bottom: 1px solid rgb(172, 172, 172);
+  }
+}
+
+.headline {
+  font-size: 24px;
+  height: 40px;
+  border-left: 5px solid #41a1be;
+  padding-left: 5px;
+  margin-bottom: 10px;
+  display: flex;
+
+  .Add-details {
+    font-size: 18px;
+    color: #02a7f0;
+    cursor: pointer;
+  }
+}
+
+/* 寮傚父鐘舵�佹牱寮� - 绾㈣壊 (淇濇寔涓嶅彉) */
+.scriptTopic-isabnormal {
+  color: red;
+}
+
+/* 鏂板锛氳鍛婄姸鎬佹牱寮� - 榛勮壊 */
+.scriptTopic-warning {
+  color: #d4be00;
+  /* 鎮ㄦ寚瀹氱殑榛勮壊 */
+}
+
+/* 寮傚父閫夐」鏍峰紡 - 绾㈣壊鏄熷彿 (淇濇寔涓嶅彉) */
+.red-star {
+  ::v-deep.el-radio__label {
+    position: relative;
+    padding-right: 10px;
+  }
+
+  ::v-deep.el-radio__label::after {
+    content: "*";
+    color: red;
+    position: absolute;
+    right: -5px;
+    top: 0;
+  }
+}
+
+/* 鏂板锛氳鍛婇�夐」鏍峰紡 - 榛勮壊鏄熷彿 */
+.yellow-star {
+  ::v-deep.el-radio__label {
+    position: relative;
+    padding-right: 10px;
+  }
+
+  ::v-deep.el-radio__label::after {
+    content: "*";
+    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;
+  margin: 0 30px;
+}
+
+.color-indicator {
+  width: 16px;
+  height: 16px;
+  border-radius: 3px;
+  margin-right: 8px;
+  display: inline-block;
+}
+
+.selected-indicator {
+  margin-left: 10px;
+  width: 20px;
+  height: 20px;
+}
+
+.tag-info-icon {
+  margin-left: 10px;
+  color: #909399;
+  cursor: pointer;
+  font-size: 16px;
+}
+
+/* 纭繚閫夋嫨鍣ㄩ�夐」涓篃鏄剧ず棰滆壊鍧� */
+.el-select-dropdown__item {
+  display: flex;
+  align-items: center;
+}
+
+.tag-normal {
+  background-color: #7ff5e1;
+}
+
+.tag-abnormal {
+  background-color: #f75c5c;
+}
+
+.tag-warning {
+  background-color: #fbfb4a;
+}
+
+.tag-info {
+  margin-left: 10px;
+  color: #909399;
+  cursor: pointer;
+}
+
+::v-deep.offside-value .el-radio__label {
+  color: #fff;
+}
+
+::v-deep.el-link.el-link--default {
+  color: #02a7f0 !important;
+}
+
+.el-message-box__btns button:nth-child(2) {
+  margin-left: 10px;
+  background-color: #f57676;
+  border-color: #f57676;
+}
+
+.el-icon-phone {
+  transition: all 0.3s;
+}
+
+.el-button[disabled] .el-icon-phone {
+  color: #c0c4cc;
+}
+
+.el-button:not([disabled]) .el-icon-phone {
+  color: #409eff;
+}
+
+.el-button:not([disabled]):hover .el-icon-phone {
+  color: #66b1ff;
+  transform: scale(1.1);
+}
+
+.mulsz {
+  font-size: 25px;
+  margin-top: 20px;
+}
+
+.el-input.is-disabled .el-input__inner {
+  background-color: #fff;
+  border-color: #dcdfe6;
+  color: #080808 !important;
+  cursor: not-allowed;
+}
+
+.el-textarea.is-disabled .el-textarea__inner {
+  background-color: #fff;
+  border-color: #dcdfe6;
+  color: #080808 !important;
+  cursor: not-allowed;
+}
+
+/* 鍘熸湁鐨勬牱寮忎繚鎸佷笉鍙橈紝娣诲姞浠ヤ笅鍝嶅簲寮忎唬鐮� */
+
+.Followupdetailspage {
+  margin: 10px;
+  display: flex;
+  flex-direction: column;
+  gap: 20px;
+}
+
+.action-container {
+  display: flex;
+  flex-direction: row;
+  /* 榛樿妯悜鎺掑垪 */
+  gap: 20px;
+  margin: 0 10px 20px 10px;
+
+  /* 褰撶缉鏀炬瘮渚嬪ぇ浜�100%鎴栧睆骞曞搴﹁緝灏忔椂鏀逛负涓婁笅鎺掑垪 */
+  @media screen and (min-resolution: 1.5dppx) {
+    flex-direction: column;
+
+    .call-action,
+    .manual-action {
+      width: 100% !important;
+    }
+  }
+}
+
+.call-action {
+  width: 65%;
+  min-width: 0;
+}
+
+.manual-action {
+  flex: 1;
+  min-width: 0;
+}
+
+/* 璋冩暣鍐呴儴鍏冪礌鐨勫搷搴斿紡甯冨眬 */
+.Followuserinfos {
+  .el-form {
+    /* 琛ㄥ崟鍝嶅簲寮忚皟鏁� */
+    .el-row {
+      margin: 0 -10px;
+    }
+
+    .el-col {
+      padding: 0 10px;
+    }
+
+    @media screen and (max-width: 768px) {
+      .el-col {
+        width: 100%;
+        margin-bottom: 15px;
+
+        &:last-child {
+          margin-bottom: 0;
+        }
+      }
+    }
+  }
+}
+
+/* 璋冩暣琛ㄦ牸鐨勫搷搴斿紡琛ㄧ幇 */
+.el-table {
+  ::v-deep .el-table__body-wrapper {
+    overflow-x: auto;
+  }
+
+  /* 鍦ㄥ皬灞忓箷涓婅皟鏁磋〃鏍煎垪瀹� */
+  @media screen and (max-width: 992px) {
+    .el-table-column {
+      min-width: 120px;
+    }
+  }
+}
+
+/* 璋冩暣鏍囩閫夋嫨鍣ㄧ殑鍝嶅簲寮忓竷灞� */
+.tag-selector-container {
+  display: flex;
+  align-items: center;
+  flex-wrap: wrap;
+  gap: 10px;
+
+  @media screen and (max-width: 576px) {
+    flex-direction: column;
+    align-items: flex-start;
+
+    .el-select {
+      width: 100%;
+      margin-right: 0 !important;
+    }
+  }
+}
+
+/* 璋冩暣鎸夐挳缁勭殑鍝嶅簲寮忓竷灞� */
+.el-form-item.label-processing-opinion {
+  .el-button-group {
+    display: flex;
+    flex-wrap: wrap;
+    gap: 10px;
+
+    .el-button {
+      flex: 1;
+      min-width: 120px;
+    }
+  }
+}
+
+/* 璋冩暣閫夐」鍗$殑鍝嶅簲寮忚〃鐜� */
+.el-tabs {
+  ::v-deep .el-tabs__nav-wrap {
+    overflow-x: auto;
+    white-space: nowrap;
+
+    &::after {
+      display: none;
+    }
+  }
+}
+
+/* 璋冩暣棰勮鍖哄煙鐨勫搷搴斿紡琛ㄧ幇 */
+.preview-left {
+  @media screen and (max-width: 768px) {
+    margin: 10px;
+    padding: 15px;
+
+    .topic-dev,
+    .scriptTopic-dev {
+      margin-bottom: 15px;
+    }
+  }
+}
+
+/* 璋冩暣瀵硅瘽妗嗙殑鍝嶅簲寮忚〃鐜� */
+.el-dialog {
+  @media screen and (max-width: 992px) {
+    width: 90% !important;
+    margin-top: 5vh !important;
+
+    .el-dialog__body {
+      padding: 15px;
+    }
+  }
+
+  @media screen and (max-width: 576px) {
+    width: 95% !important;
+
+    .el-form-item {
+      margin-bottom: 15px;
+    }
+  }
+}
+
+/* 纭繚鍐呭鍦ㄧ缉鏀炬椂淇濇寔鍙鎬� */
+.headline {
+  font-size: clamp(18px, 2vw, 24px);
+  /* 浣跨敤clamp鍑芥暟纭繚瀛椾綋澶у皬鍦ㄥ悎鐞嗚寖鍥村唴 */
+}
+
+/* 涓虹Щ鍔ㄨ澶囦紭鍖栨粴鍔ㄤ綋楠� */
+@media screen and (max-width: 768px) {
+  .Followuserinfo,
+  .Followuserinfos {
+    padding: 15px;
+    margin: 5px;
+  }
+
+  .CONTENT {
+    min-height: auto;
+    padding: 5px;
+  }
+}
+
+/* 缂╂斁妫�娴嬫牱寮� */
+@media screen and (min-resolution: 1.5dppx),
+  screen and (-webkit-min-device-pixel-ratio: 1.5) {
+  .action-container {
+    flex-direction: column;
+  }
+
+  .call-action,
+  .manual-action {
+    width: 100%;
+  }
+
+  /* 璋冩暣鍐呴儴鍏冪礌闂磋窛 */
+  .call-container,
+  .Followuserinfos {
+    margin-bottom: 20px;
+  }
+}
+/* 浜哄伐澶勭悊閮ㄥ垎鏍峰紡 */
+.manual-action {
+  flex: 1;
+  min-width: 0;
+  height: 100%;
+  overflow: hidden;
+
+  .Followuserinfos {
+    display: flex;
+    flex-direction: column;
+    gap: 20px;
+    padding: 20px;
+    background: #fff;
+    border-radius: 8px;
+    box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
+    height: 100%;
+    overflow-y: auto;
+  }
+}
+
+/* 澶撮儴鍖哄煙 */
+.section-header {
+  display: flex;
+  justify-content: space-between;
+  align-items: center;
+  padding-bottom: 15px;
+  border-bottom: 2px solid #f0f0f0;
+  margin-bottom: 20px;
+  flex-wrap: wrap;
+  gap: 15px;
+
+  h3 {
+    margin: 0;
+    color: #409eff;
+    font-size: 18px;
+    font-weight: 600;
+    display: flex;
+    align-items: center;
+    gap: 8px;
+
+    i {
+      font-size: 20px;
+    }
+  }
+
+  .header-actions {
+    display: flex;
+    align-items: center;
+    flex-wrap: wrap;
+    gap: 15px;
+
+    .action-group {
+      display: flex;
+      align-items: center;
+      gap: 10px;
+    }
+  }
+}
+
+/* 鍩虹鎿嶄綔鎸夐挳 */
+.basic-actions {
+  .el-button {
+    min-width: 100px;
+  }
+}
+
+/* 寮傚父鐘舵�侀�夋嫨鍣� */
+.tag-selector {
+  display: flex;
+  align-items: center;
+  gap: 10px;
+
+  .current-tag {
+    display: flex;
+    align-items: center;
+    gap: 8px;
+    padding: 6px 12px;
+    background: #f8f9fa;
+    border: 1px solid;
+    border-radius: 4px;
+    font-size: 12px;
+    transition: all 0.3s;
+
+    &:hover {
+      box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
+    }
+  }
+}
+
+.color-indicator {
+  width: 16px;
+  height: 16px;
+  border-radius: 3px;
+  margin-right: 8px;
+  display: inline-block;
+}
+
+.selected-indicator {
+  margin-left: 10px;
+  width: 20px;
+  height: 20px;
+}
+
+.tag-info-icon {
+  margin-left: 10px;
+  color: #909399;
+  cursor: pointer;
+  font-size: 16px;
+}
+
+/* 琛ㄥ崟鍖哄煙 */
+.form-content {
+  background: #f8f9fa;
+  border-radius: 8px;
+  padding: 20px;
+  margin-bottom: 20px;
+
+  .el-form {
+    .el-row {
+      margin: 0 -10px;
+    }
+
+    .el-col {
+      padding: 0 10px;
+    }
+  }
+}
+
+/* 閫氳瘽鎺у埗鍖哄煙 */
+.call-controls {
+  margin: 15px 0;
+
+  .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-registering {
+    margin: 10px 0;
+  }
+
+  .registering-alert {
+    border-radius: 8px;
+    background-color: #f4f4f5;
+    border-left: 4px solid #909399;
+  }
+}
+
+/* 澶勭悊鎰忚鎸夐挳缁� */
+.opinion-buttons {
+  display: flex;
+  flex-wrap: wrap;
+  gap: 10px;
+  align-items: center;
+
+  .el-button {
+    flex: 1;
+    min-width: 120px;
+  }
+}
+
+/* 鎮h�呮。妗堜俊鎭� */
+.detailed {
+  width: 100%;
+  border-radius: 8px;
+  padding: 20px;
+  margin-bottom: 20px;
+  background-color: #ddf0f8;
+  border: 1px solid #b3e0f2;
+
+  h3 {
+    margin: 0 0 20px 0;
+    color: #333;
+    font-size: 16px;
+    font-weight: 500;
+    display: flex;
+    align-items: center;
+    gap: 8px;
+
+    &:before {
+      content: "";
+      display: block;
+      width: 4px;
+      height: 16px;
+      background: #409eff;
+      border-radius: 2px;
+    }
+  }
+
+  .el-form {
+    .el-row {
+      margin: 0 -10px;
+    }
+
+    .el-col {
+      padding: 0 10px;
+      margin-bottom: 15px;
+    }
+  }
+}
+
+/* 鍔ㄧ敾鏁堟灉 */
+@keyframes pulse {
+  0% {
+    opacity: 1;
+  }
+  50% {
+    opacity: 0.7;
+  }
+  100% {
+    opacity: 1;
+  }
+}
+
+/* 鍝嶅簲寮忚璁� */
+@media screen and (max-width: 1200px) {
+  .section-header {
+    flex-direction: column;
+    align-items: flex-start;
+    gap: 15px;
+  }
+
+  .header-actions {
+    width: 100%;
+    justify-content: space-between;
+  }
+
+  .opinion-buttons {
+    .el-button {
+      min-width: calc(50% - 8px);
+    }
+  }
+}
+
+@media screen and (max-width: 768px) {
+  .Followuserinfos {
+    padding: 15px;
+  }
+
+  .form-content,
+  .detailed {
+    padding: 15px;
+  }
+
+  .header-actions {
+    flex-direction: column;
+    align-items: stretch;
+
+    .action-group {
+      flex-direction: column;
+      align-items: stretch;
+
+      .el-select {
+        width: 100%;
+        margin-right: 0;
+      }
+    }
+  }
+
+  .opinion-buttons {
+    flex-direction: column;
+
+    .el-button {
+      width: 100%;
+    }
+  }
+
+  .detailed {
+    .el-form {
+      .el-col {
+        width: 100%;
+      }
+    }
+  }
+}
+
+/* 婊氬姩鏉$編鍖� */
+.Followuserinfos {
+  &::-webkit-scrollbar {
+    width: 6px;
+  }
+
+  &::-webkit-scrollbar-track {
+    background: #f1f1f1;
+    border-radius: 3px;
+  }
+
+  &::-webkit-scrollbar-thumb {
+    background: #c1c1c1;
+    border-radius: 3px;
+
+    &:hover {
+      background: #a8a8a8;
+    }
+  }
+}
+
+/* 鎸夐挳鍥炬爣浼樺寲 */
+.el-icon-phone {
+  transition: all 0.3s;
+}
+
+.el-button[disabled] .el-icon-phone {
+  color: #c0c4cc;
+}
+
+.el-button:not([disabled]) .el-icon-phone {
+  color: #409eff;
+}
+
+.el-button:not([disabled]):hover .el-icon-phone {
+  color: #66b1ff;
+  transform: scale(1.1);
+}
+</style>
diff --git a/src/views/followvisit/record/detailpage/index.vue b/src/views/followvisit/record/detailpage/index.vue
index ca5b159..da3b538 100644
--- a/src/views/followvisit/record/detailpage/index.vue
+++ b/src/views/followvisit/record/detailpage/index.vue
@@ -655,8 +655,11 @@
                     </el-input>
                   </el-form-item>
                 </el-col>
-                 <el-col :span="10">
-                  <el-form-item label="鐭彿鐢佃瘽">
+                <el-col :span="10">
+                  <el-form-item
+                    label="鐭彿鐢佃瘽"
+                    v-if="orgname == '鏅畞鐣叉棌鑷不鍘夸汉姘戝尰闄�'"
+                  >
                     <el-input
                       placeholder="鑱旂郴鐢佃瘽缂哄け"
                       v-model="userform.telshortcode"
@@ -664,7 +667,7 @@
                       <el-button
                         slot="append"
                         icon="el-icon-phone"
-                        @click="handleCall(userform.telshortcode, 'tel')"
+                        @click="handleCall(userform.telshortcode, 'tel', true)"
                       ></el-button>
                     </el-input>
                   </el-form-item>
@@ -1122,6 +1125,7 @@
   serviceSubtaskDetailedit,
   serviceSubtaskDetailadd,
   updatePersonVoices,
+  savequestiondetail,
   addPersonVoices,
   query360PatInfo,
   sendMsg,
@@ -1815,25 +1819,25 @@
           obj.asrtext = 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();
@@ -1862,11 +1866,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) {
@@ -1927,8 +1973,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;
       }
@@ -2015,10 +2061,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");
@@ -2027,7 +2074,7 @@
         this.Torouter();
         return;
       }
-      addPersonVoices(obj).then((res) => {
+      savequestiondetail(obj).then((res) => {
         if (res.code == 200) {
           this.$modal.msgSuccess("鏈嶅姟淇濆瓨鎴愬姛");
           this.$modal
diff --git a/src/views/knowledge/questionbank/particulars/index.vue b/src/views/knowledge/questionbank/particulars/index.vue
index b009153..880f6bd 100644
--- a/src/views/knowledge/questionbank/particulars/index.vue
+++ b/src/views/knowledge/questionbank/particulars/index.vue
@@ -23,7 +23,13 @@
       </div>
       <div v-if="Editprogress == 1">
         <el-card class="box-card">
-          <el-form :inline="true" ref="topicobj" :model="topicobj" :rules="rules" class="demo-form-inline">
+          <el-form
+            :inline="true"
+            ref="topicobj"
+            :model="topicobj"
+            :rules="rules"
+            class="demo-form-inline"
+          >
             <div class="headline">
               鍩虹淇℃伅閰嶇疆
               <span style="margin-left: 30px"
@@ -65,6 +71,7 @@
                       v-model="topicobj.categoryid"
                       size="medium"
                       filterable
+                      @change="categoryidChange"
                       placeholder="璇烽�夋嫨鍒嗙被"
                     >
                       <el-option-group
@@ -87,7 +94,7 @@
                   <el-form-item label="璇勪环绫诲瀷" prop="scoretype">
                     <el-select
                       v-model="topicobj.scoretype"
-                      placeholder="璇烽�夋嫨鍒嗙被"
+                      placeholder="璇烽�夋嫨绫诲瀷"
                     >
                       <el-option
                         v-for="group in appraiselist"
@@ -121,7 +128,7 @@
                   ><el-form-item label="鏄惁鍙敤" prop="isavailable">
                     <el-radio-group v-model="topicobj.isavailable">
                       <el-radio
-                      @change="$forceUpdate()"
+                        @change="$forceUpdate()"
                         v-for="(item, index) in usable"
                         :label="item.value"
                         >{{ item.label }}</el-radio
@@ -143,7 +150,6 @@
                 </el-col> -->
               </el-row>
               <el-row :gutter="10">
-
                 <el-col :span="8"
                   ><el-form-item label="闂绫诲瀷" prop="scriptType">
                     <el-select
@@ -151,7 +157,7 @@
                       @change="changefn"
                       size="medium"
                       filterable
-                      placeholder="璇烽�夋嫨鍒嗙被"
+                      placeholder="璇烽�夋嫨绫诲瀷"
                     >
                       <el-option
                         class="topicobjaa"
@@ -185,7 +191,7 @@
                       v-model="topicobj.language"
                       size="medium"
                       filterable
-                      placeholder="璇烽�夋嫨鍒嗙被"
+                      placeholder="璇烽�夋嫨"
                     >
                       <el-option
                         class="topicobjaa"
@@ -245,7 +251,6 @@
                 </el-form-item>
               </el-col>
             </el-row> -->
-
 
               <!-- <el-form-item label="閫変腑鎸囨爣锛�">
                 <span style="margin-left: 30px"
@@ -329,8 +334,8 @@
                       style="width: 100px; height: 100px"
                       :src="topicobj.picturePath"
                       :preview-src-list="
-                                topicobj.picturePath ? [topicobj.picturePath] : []
-                              "
+                        topicobj.picturePath ? [topicobj.picturePath] : []
+                      "
                     >
                     </el-image>
                   </div>
@@ -342,7 +347,12 @@
       </div>
       <div v-if="Editprogress == 2">
         <el-card class="box-card">
-          <el-form :inline="true" ref="topicobj" :model="topicobj" class="demo-form-inline">
+          <el-form
+            :inline="true"
+            ref="topicobj"
+            :model="topicobj"
+            class="demo-form-inline"
+          >
             <div class="headline">
               鎸囨爣璁剧疆璇︽儏
               <span v-if="topicobj.targetname" style="margin-left: 30px"
@@ -521,8 +531,8 @@
                           style="width: 100px; height: 100px"
                           :src="item.picturePath"
                           :preview-src-list="
-                                item.picturePath ? [item.picturePath] : []
-                              "
+                            item.picturePath ? [item.picturePath] : []
+                          "
                         >
                         </el-image>
                       </div>
@@ -731,8 +741,8 @@
         svyLibScriptOptions: [],
         svyLibScriptTagList: [],
         suitway: "1",
-        scoretype:'4',
-        language:'鏅�氳瘽',
+        scoretype: "4",
+        language: "鏅�氳瘽",
       },
       headers: {
         Authorization: "Bearer " + getToken(),
@@ -873,13 +883,12 @@
     getissueinfo() {
       this.id = this.$route.query.id;
 
-
       // 鍒嗙被
       getissueclassify({}).then((res) => {
         this.classifylist = res.rows;
         if (this.$route.query.categoryid) {
-        this.topicobj.categoryid = Number(this.$route.query.categoryid);
-      }
+          this.topicobj.categoryid = Number(this.$route.query.categoryid);
+        }
       });
       if (!this.id) {
         return;
@@ -919,75 +928,94 @@
         this.drawer = true;
       });
     },
+    //     categoryidChange(id) {
+    //   // 閬嶅巻鎵�鏈夊垎缁勶紝鍦ㄦ瘡涓垎缁勭殑 svyLibScriptCategoryList 涓煡鎵�
+    //   let targetOption = null;
+    //   for (const group of this.classifylist) {
+    //     targetOption = group.svyLibScriptCategoryList.find(item => item.id == id);
+    //     if (targetOption) break;
+    //   }
+
+    //   if (targetOption) {
+    //     console.log('閫変腑鐨勯�夐」:', targetOption);
+    //     // 娉ㄦ剰锛氳繖閲� targetOption.name 鏄�夐」鍚嶏紝濡傗�滀綇闄㈡弧鎰忓害璋冩煡鈥�
+    //     if (targetOption.name.includes('浣忛櫌')) {
+    //       this.topicobj.type = "zymyd";
+    //     } else if (targetOption.name.includes('闂ㄨ瘖')) {
+    //       this.topicobj.type = "mzmyd";
+    //     } else if (targetOption.name.includes('鍑洪櫌')) {
+    //       this.topicobj.type = "cymyd";
+    //     } else if (targetOption.name.includes('甯哥敤')) {
+    //       this.topicobj.type = "cymyd"; // 娉ㄦ剰锛氳繖閲屽拰鈥滃嚭闄⑩�濋噸澶嶄簡锛岀‘璁ゆ槸鍚﹂渶鍖哄垎
+    //     }
+    //   }
+    // },
     // 鏂板鎴栦慨鏀硅鎯�
     compileissue() {
       this.$refs["topicobj"].validate((valid) => {
         if (valid) {
-          this.topicobj.svyLibScriptOptions = this.topicobj.svyLibScriptOptions.map(
-        (item) => {
-          if (item.isoperation != 1 && item.isoperation != 3) {
-            item.isoperation = 2;
-          }
-          return item;
-        }
-      );
-      this.topicobj.targetoptions = this.topicobj.svyLibScriptOptions
-        .filter((item) => item.isoperation != 3)
-        .map((item) => item.optioncontent)
-        .join(", ");
-      this.topicobj.otherdata = JSON.stringify(this.variablelist);
-      if (this.id) {
-        this.topicobj.isoperation = 2;
-        compileissue(this.topicobj).then((res) => {
-          if (res.code == 200) {
-            this.$message({
-              message: "淇敼鎴愬姛",
-              type: "success",
+          this.topicobj.svyLibScriptOptions =
+            this.topicobj.svyLibScriptOptions.map((item) => {
+              if (item.isoperation != 1 && item.isoperation != 3) {
+                item.isoperation = 2;
+              }
+              return item;
             });
-            this.$router.go(-1);
+          this.topicobj.targetoptions = this.topicobj.svyLibScriptOptions
+            .filter((item) => item.isoperation != 3)
+            .map((item) => item.optioncontent)
+            .join(", ");
+          this.topicobj.otherdata = JSON.stringify(this.variablelist);
+          if (this.id) {
+            this.topicobj.isoperation = 2;
+            compileissue(this.topicobj).then((res) => {
+              if (res.code == 200) {
+                this.$message({
+                  message: "淇敼鎴愬姛",
+                  type: "success",
+                });
+                this.$router.go(-1);
+              } else {
+                this.$message({
+                  message: "淇敼澶辫触",
+                  type: "error",
+                });
+              }
+            });
           } else {
-            this.$message({
-              message: "淇敼澶辫触",
-              type: "error",
+            this.topicobj.isoperation = 1;
+            compileissue(this.topicobj).then((res) => {
+              if (res.code == 200) {
+                this.$message({
+                  message: "鏂板鎴愬姛",
+                  type: "success",
+                });
+                this.$router.go(-1);
+              } else {
+                this.$message({
+                  message: "鏂板澶辫触",
+                  type: "error",
+                });
+              }
             });
           }
-        });
-      } else {
-        this.topicobj.isoperation = 1;
-        compileissue(this.topicobj).then((res) => {
-          if (res.code == 200) {
-            this.$message({
-              message: "鏂板鎴愬姛",
-              type: "success",
-            });
-            this.$router.go(-1);
-          } else {
-            this.$message({
-              message: "鏂板澶辫触",
-              type: "error",
-            });
+          this.illnesslist.forEach((item, index) => {
+            if (!item.id) {
+              addtargetillness(item).then((res) => {});
+            }
+          });
+          if (this.illnesslistapi.length) {
+            deltargetillness(this.illnesslistapi.join(",")).then((res) => {});
           }
-        });
-      }
-      this.illnesslist.forEach((item, index) => {
-        if (!item.id) {
-          addtargetillness(item).then((res) => {});
         }
       });
-      if (this.illnesslistapi.length) {
-        deltargetillness(this.illnesslistapi.join(",")).then((res) => {});
-      }
-        }
-      })
-
-
     },
     // 鍒ゆ柇鍒嗗��
     Scorejudgment() {
       let scorearr = this.topicobj.svyLibScriptOptions;
       let isValid = scorearr.every((score, index) => {
         if (this.topicobj.scriptType == 1) {
-          if (score.score||score.score==0) {
+          if (score.score || score.score == 0) {
             if (
               Number(score.score) < 0 ||
               Number(score.score) > Number(this.topicobj.score)
diff --git a/src/views/patient/propaganda/QuestionnaireTask.vue b/src/views/patient/propaganda/QuestionnaireTask.vue
index 3ab1854..e51100c 100644
--- a/src/views/patient/propaganda/QuestionnaireTask.vue
+++ b/src/views/patient/propaganda/QuestionnaireTask.vue
@@ -1797,6 +1797,7 @@
           item.patid = item.id;
           item.hospType = this.patientqueryParams.allhosp;
           item.sfzh = item.idcardno;
+          item.telshortcode = item.telshortcode;
           item.deptCode = item.deptcode;
           item.deptName = item.dept;
           item.admindate = item.inhosptime;
diff --git a/vue.config.js b/vue.config.js
index 5a49e1f..79d9dfb 100644
--- a/vue.config.js
+++ b/vue.config.js
@@ -36,8 +36,8 @@
       // detail: https://cli.vuejs.org/config/#devserver-proxy
       [process.env.VUE_APP_BASE_API]: {
         // 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:8096`,
+        target: `http://192.168.100.10:8094`,//鐪佺珛鍚屽痉
         // target: `http://192.168.100.10:8095`,//鏂板崕
         // target:`http://localhost:8095`,
         // target:`http://35z1t16164.qicp.vip`,

--
Gitblit v1.9.3