From a5cba9ab040f6f97558046885dce3017f9bab7e9 Mon Sep 17 00:00:00 2001
From: WXL (wul) <wl_5969728@163.com>
Date: 星期二, 11 八月 2026 14:12:29 +0800
Subject: [PATCH] 提交

---
 src/api/knowledge/drug.js                                               |   53 
 vue.config.js                                                           |    4 
 src/api/AiCentre/Qtemplate.js                                           |   17 
 src/views/followvisit/zysatisfaction/index.vue                          |  125 
 src/views/outsideChainnew.vue                                           |    4 
 src/views/system/ruleconfig/index.vue                                   |   24 
 src/views/sfstatistics/propaganda/index.vue                             |  373 -
 src/views/SatisfactionRelay.vue                                         |  181 
 src/views/patient/archives/childHealth/detail.vue                       |  305 +
 src/views/knowledge/drug/index.vue                                      |  623 ++
 src/views/patient/archives/childHealth/index.vue                        |  145 
 src/views/patient/patient/behospitalized.vue                            |   61 
 src/components/CallButton/index.vue                                     |   10 
 src/views/Satisfaction/configurationmyd/index.vue                       |  186 
 src/views/patient/archives/childHealth/InfoField.vue                    |   42 
 src/api/AiCentre/external.js                                            |   44 
 src/views/Satisfaction/diseaseStatistics/components/SecondFollowUp.vue  |    5 
 src/permission.js                                                       |    4 
 src/views/sfstatistics/percentage/components/SecondFollowUp.vue         |   18 
 src/store/modules/user.js                                               |   16 
 src/views/system/user/profile/index.vue                                 |  316 +
 src/api/AiCentre/SingleTask.js                                          |   10 
 src/views/sfstatistics/percentage/components/FirstFollowUp.vue          |   44 
 src/router/index.js                                                     |    8 
 src/views/patient/archives/maternalHealth/PSQIScoreTable.vue            |   37 
 src/views/patient/archives/maternalHealth/MRSScoreTable.vue             |   37 
 src/views/sfstatistics/percentage/index.vue                             |   32 
 src/views/outsideChainwtnew copy.vue                                    | 1339 +++++
 src/views/patient/patient/hospital.vue                                  |   31 
 src/views/patient/patient/AwaitingAdmission.vue                         |   14 
 src/views/patient/archives/maternalHealth/index.vue                     |  141 
 src/views/sfstatistics/percentage/components/CombinedFollowUp.vue       |  949 ++++
 src/views/patient/archives/components/ArchiveDialog.vue                 |  372 +
 src/views/patient/patient/outpatient.vue                                |   37 
 src/views/patient/archives/components/EditableTable.vue                 |  109 
 src/views/followvisit/Continue/ContinueFordetails.vue                   | 1566 ++---
 随访通用 (2).zip                                                            |    0 
 src/views/patient/propaganda/QuestionnaireTask.vue                      | 1982 ++++---
 src/views/sfstatistics/percentage/components/ChartDialog.vue            |  547 +-
 src/views/followvisit/mzsatisfaction/index.vue                          |   81 
 随访通用.zip                                                                |    0 
 随访通用8.7.zip                                                             |    0 
 src/views/followvisit/record/detailpage/index.vue                       |  377 
 src/views/patient/archives/maternalHealth/detail.vue                    |  329 +
 src/views/outsideChainwtnew.vue                                         |  155 
 src/views/followvisit/tasklist/index.vue                                |  266 
 src/assets/logo/Hrs.png                                                 |    0 
 src/views/sfstatistics/propaganda/components/PropagandaDetailDialog.vue |  273 +
 src/utils/sipService.js                                                 |   40 
 src/views/followvisit/operation/index.vue                               |   21 
 随访通用8.10.zip                                                            |    0 
 src/views/patient/archives/maternalHealth/KuppermanScoreTable.vue       |   50 
 src/views/Satisfaction/diseaseStatistics/components/FirstFollowUp.vue   |    5 
 src/views/followvisit/record/index.vue                                  |   87 
 src/views/loginSSO.vue                                                  |   78 
 src/utils/request.js                                                    |    2 
 /dev/null                                                               |    0 
 src/views/system/user/index.vue                                         |    1 
 src/api/AiCentre/indicator.js                                           |   10 
 src/views/login.vue                                                     |   72 
 package.json                                                            |    1 
 随访通用8.11.zip                                                            |    0 
 src/App.vue                                                             |    4 
 src/views/patient/propaganda/particty.vue                               | 2141 ++++----
 src/views/followvisit/discharge/index.vue                               |  339 
 65 files changed, 10,132 insertions(+), 4,011 deletions(-)

diff --git a/package.json b/package.json
index 7b26edc..343f698 100644
--- a/package.json
+++ b/package.json
@@ -65,6 +65,7 @@
     "lemon-imui": "^1.7.7",
     "moment": "^2.30.1",
     "nprogress": "0.2.0",
+    "qrcode": "^1.5.4",
     "quill": "1.3.7",
     "quill-image-drop-module": "^1.0.3",
     "quill-image-resize": "^3.0.9",
diff --git a/src/App.vue b/src/App.vue
index 25aaecd..83f295c 100644
--- a/src/App.vue
+++ b/src/App.vue
@@ -3,13 +3,13 @@
     <router-view />
     <theme-picker />
     <!-- <Assistant v-if="routertf" /> -->
-    <!-- <Assistant
+    <Assistant
       v-if="Assvite"
       :initial-position="{ x: 50, y: 200 }"
       :auto-hide="false"
       :hide-delay="3000"
       primary-color="#1890ff"
-    /> -->
+    />
   </div>
 </template>
 
diff --git a/src/api/AiCentre/Qtemplate.js b/src/api/AiCentre/Qtemplate.js
index 454c72f..e36895b 100644
--- a/src/api/AiCentre/Qtemplate.js
+++ b/src/api/AiCentre/Qtemplate.js
@@ -195,6 +195,15 @@
     data: data,
   });
 }
+
+//浠诲姟缁勭瀹ょ梾鍖烘ā鏉垮叧鑱旀煡璇�
+export function rwztaskdepthospgetsonlist(data) {
+  return request({
+    url: "/smartor/taskSchedule/getTaskScheduleDeptList",
+    method: "post",
+    data: data,
+  });
+}
 // 鍒犻櫎绉戝鐥呭尯妯℃澘鍒嗙被
 export function depthospgetsondel(id) {
   return request({
@@ -231,6 +240,14 @@
     data: data,
   });
 }
+// 浠诲姟缁勭柧鐥呭叧鑱�
+export function rwztaskdiaggetlist(data) {
+  return request({
+    url: "/smartor/taskSchedule/getTaskScheduleDiagList",
+    method: "post",
+    data: data,
+  });
+}
 // 鑾峰彇浠诲姟鎵嬫湳鍏宠仈
 export function taskopergetlist(data) {
   return request({
diff --git a/src/api/AiCentre/SingleTask.js b/src/api/AiCentre/SingleTask.js
index 0acb38f..0f24aa0 100644
--- a/src/api/AiCentre/SingleTask.js
+++ b/src/api/AiCentre/SingleTask.js
@@ -127,7 +127,7 @@
   });
 }
 
-// 鏌ヨ闂ㄨ瘖鍑洪櫌鏈嶅姟鍒楄〃
+// 鏌ヨ鏈嶅姟鍒楄〃
 export function getTaskservelist(data) {
   return request({
     url: "/smartor/serviceSubtask/patItem",
@@ -135,6 +135,14 @@
     data: data,
   });
 }
+// 鏈嶅姟杞瀹�/鐥呭尯
+export function transferDept(data) {
+  return request({
+    url: "/smartor/serviceSubtask/transferDept",
+    method: "post",
+    data: data,
+  });
+}
 // 璇婃柇鏌ヨ鍘嗗彶鏈嶅姟鍒楄〃
 export function historservelist(data) {
   return request({
diff --git a/src/api/AiCentre/external.js b/src/api/AiCentre/external.js
index 9288107..e42f8c9 100644
--- a/src/api/AiCentre/external.js
+++ b/src/api/AiCentre/external.js
@@ -6,25 +6,40 @@
     url: "/smartor/servicetask/getScriptInfoByCondition",
     // url: "/servicetask/getScriptInfoByCondition",
     method: "post",
-    data: data
+    data: data,
   });
 }
 // 鐭摼鎺ヨВ鏋�
 export function geturlinfo(id) {
   return request({
     url: "/smartor/outPath/getInfoByParam",
-    method: 'post',
-    params: {param:id}
+    method: "post",
+    params: { param: id },
   });
 }
 
+// 鍒涘缓浠诲姟鐢熸垚澶栭摼
+export function scanGenerateSubtask(data) {
+  return request({
+    url: "/smartor/serviceSubtask/scanGenerateSubtask",
+    method: "post",
+    data: data,
+  });
+}
+export function goSfRelay(data) {
+  return request({
+    url: "/smartor/serviceSubtask/goSfRelay",
+    method: "post",
+    params: data,
+  });
+}
 
 // 缂撳瓨闂嵎
 export function Cachequestionnaire(data) {
   return request({
     url: "/smartor/subtaskAnswer/saveQuestionCache",
     method: "post",
-    data: data
+    data: data,
   });
 }
 // 鎷跨紦瀛橀棶鍗�
@@ -32,7 +47,7 @@
   return request({
     url: "/smartor/subtaskAnswer/getQuestionCache",
     method: "post",
-    data: data
+    data: data,
   });
 }
 // 鎻愪氦闂嵎
@@ -40,7 +55,7 @@
   return request({
     url: "/smartor/subtaskAnswer/saveQuestionAnswer",
     method: "post",
-    data: data
+    data: data,
   });
 }
 
@@ -49,7 +64,7 @@
   return request({
     url: "/smartor/subtaskAnswer/selectPatQuestionResult",
     method: "post",
-    data: data
+    data: data,
   });
 }
 // 鑾峰彇闂嵎锛堝唴锛�
@@ -57,7 +72,7 @@
   return request({
     url: "/smartor/subtaskAnswer/selectPatQuestionResult",
     method: "post",
-    data: data
+    data: data,
   });
 }
 // 鑾峰彇璇煶鏈嶅姟锛堝唴锛�
@@ -65,7 +80,7 @@
   return request({
     url: "/smartor/serviceSubtaskDetail/getPersonVoice",
     method: "post",
-    data: data
+    data: data,
   });
 }
 // 鏇存柊璇煶鏈嶅姟锛堝唴锛�
@@ -73,7 +88,7 @@
   return request({
     url: "/smartor/serviceSubtaskDetail/batchEdit",
     method: "post",
-    data: data
+    data: data,
   });
 }
 // 鏇存柊璇煶鏈嶅姟锛堝唴锛�
@@ -81,7 +96,7 @@
   return request({
     url: "/smartor/serviceSubtaskDetail/batchAdd",
     method: "post",
-    data: data
+    data: data,
   });
 }
 // 鑾峰彇360绯荤粺token
@@ -89,7 +104,7 @@
   return request({
     url: "https://9.0.124.104:13021/mediinfo-lyra-authserver/connect/token",
     method: "post",
-    data: data
+    data: data,
   });
 }
 // 鍐嶆闅忚鏈嶅姟
@@ -97,7 +112,7 @@
   return request({
     url: "/smartor/serviceSubtask/addSubTaskAgain",
     method: "post",
-    data: data
+    data: data,
   });
 }
 // 鍐嶆闅忚鏈嶅姟
@@ -105,7 +120,6 @@
   return request({
     url: "/smartor/serviceSubtask/addSubTask",
     method: "post",
-    data: data
+    data: data,
   });
 }
-
diff --git a/src/api/AiCentre/indicator.js b/src/api/AiCentre/indicator.js
index 1895d93..95e72df 100644
--- a/src/api/AiCentre/indicator.js
+++ b/src/api/AiCentre/indicator.js
@@ -51,7 +51,15 @@
 export function gethelibraryCount(data) {
   return request({
     url: "/smartor/serviceSubtask/gethelibraryCount",
-      method: "post",
+    method: "post",
+    data: data,
+  });
+}
+// 瀹f暀缁熻
+export function gethelibraryCountHyperlink(data) {
+  return request({
+    url: "/smartor/serviceSubtask/gethelibraryCountHyperlink",
+    method: "post",
     data: data,
   });
 }
diff --git a/src/api/knowledge/drug.js b/src/api/knowledge/drug.js
new file mode 100644
index 0000000..8cb8e7e
--- /dev/null
+++ b/src/api/knowledge/drug.js
@@ -0,0 +1,53 @@
+import request from '@/utils/request'
+
+// 鏌ヨ鑽搧淇℃伅鍒楄〃
+export function listMedication(data) {
+  return request({
+    url: '/smartor/medicationitem/list',
+    method: 'post',
+    data: data
+  })
+}
+
+// 鑾峰彇鑽搧淇℃伅璇︾粏淇℃伅
+export function getMedication(id) {
+  return request({
+    url: '/smartor/medicationitem/getInfo/' + id,
+    method: 'get'
+  })
+}
+
+// 鏂板鑽搧淇℃伅
+export function addMedication(data) {
+  return request({
+    url: '/smartor/medicationitem/add',
+    method: 'post',
+    data: data
+  })
+}
+
+// 淇敼鑽搧淇℃伅
+export function updateMedication(data) {
+  return request({
+    url: '/smartor/medicationitem/edit',
+    method: 'post',
+    data: data
+  })
+}
+
+// 鍒犻櫎鑽搧淇℃伅
+export function delMedication(ids) {
+  return request({
+    url: '/smartor/medicationitem/remove/' + ids,
+    method: 'get'
+  })
+}
+
+// 瀵煎嚭鑽搧淇℃伅鍒楄〃
+export function exportMedication(data) {
+  return request({
+    url: '/smartor/medicationitem/export',
+    method: 'post',
+    data: data
+  })
+}
diff --git a/src/assets/logo/Hrs.png b/src/assets/logo/Hrs.png
new file mode 100644
index 0000000..746d78e
--- /dev/null
+++ b/src/assets/logo/Hrs.png
Binary files differ
diff --git a/src/components/CallButton/index.vue b/src/components/CallButton/index.vue
index 83186de..71f35a3 100644
--- a/src/components/CallButton/index.vue
+++ b/src/components/CallButton/index.vue
@@ -407,7 +407,17 @@
           orgName == "绗竴浜烘皯鍖婚櫌鍚村北闄㈠尯"
         ) {
           this.sipConfig.sipUri = `${this.randomNum}@192.169.129.198`;
+        } else if (
+          orgName == "鐪佺珛鍚屽痉缈犺嫅闄㈠尯" ||
+          orgName == "鐪佺珛鍚屽痉涔嬫睙闄㈠尯"||
+          orgName == "鐪佺珛鍚屽痉闂叉灄闄㈠尯"||
+          orgName == "鐪佺珛鍚屽痉澶╃洰灞辫矾闄㈠尯"||
+          orgName == "鐪佺珛鍚屽痉闈掑北婀栭櫌鍖�"
+        ) {
+          this.sipConfig.sipUri = `${this.randomNum}@220.88.10.62`;
         }
+        console.log(this.sipConfig.sipUri);
+
       } catch (error) {
         console.error("鑾峰彇鍒嗘満鍙峰け璐�:", error);
         throw error; // 鎶涘嚭閿欒浠ヤ究涓婂眰澶勭悊
diff --git a/src/permission.js b/src/permission.js
index b049b44..cdd4f4f 100644
--- a/src/permission.js
+++ b/src/permission.js
@@ -15,6 +15,7 @@
   "/register",
   "/wt",
   "/xj",
+  "/SfRelay",
   "/sf",
   "/satisfaction",
   "/loginSSO",
@@ -58,8 +59,9 @@
     }
 
     console.log(processedPath, "澶勭悊鍚庣殑璺緞");
+    console.log(whiteList.indexOf(processedPath), 11);
 
-    if (whiteList.indexOf(processedPath) !== -1) {
+    if (whiteList.indexOf(processedPath) != -1) {
       // 鍦ㄥ厤鐧诲綍鐧藉悕鍗曪紝鐩存帴杩涘叆
       // 濡傛灉璺緞琚慨鏀逛簡锛岄渶瑕侀噸瀹氬悜
       if (processedPath !== to.path) {
diff --git a/src/router/index.js b/src/router/index.js
index b96f433..5469140 100644
--- a/src/router/index.js
+++ b/src/router/index.js
@@ -61,6 +61,11 @@
     component: () => import("@/views/outsideChainwtnew"),
     hidden: true,
   },
+    {
+    path: "/SfRelay",
+    component: () => import("@/views/SatisfactionRelay"),
+    hidden: true,
+  },
   {
     path: "/xj",
     component: () => import("@/views/outsideChainxjnew"),
@@ -211,7 +216,8 @@
         meta: { title: "淇敼鐢熸垚閰嶇疆", activeMenu: "/tool/gen" },
       },
     ],
-  } /*,
+  },
+ /*,
   {
     path: '/smartor/archive',
     component: Layout,
diff --git a/src/store/modules/user.js b/src/store/modules/user.js
index 907f097..c42f8f7 100644
--- a/src/store/modules/user.js
+++ b/src/store/modules/user.js
@@ -180,8 +180,8 @@
               localStorage.setItem("orgname", "缂欎簯绗簩浜烘皯鍖婚櫌");
               localStorage.setItem("ZuHuID", "1429338802177000013");
               localStorage.setItem("deptCode", "");
-              localStorage.setItem("YongHuID", "");
-              localStorage.setItem("YongHuXM", "");
+              localStorage.setItem("YongHuID", "1570315144653705216");
+              localStorage.setItem("YongHuXM", "JYDERMYY");
             } else if (orgid == "47240018433118111A2101") {
               localStorage.setItem("orgname", "榫欐硥甯備腑鍖诲尰闄�");
               localStorage.setItem("ZuHuID", "1429338802177000003");
@@ -243,20 +243,20 @@
               localStorage.setItem("orgname", "缂欎簯鍘夸汉姘戝尰闄�");
               localStorage.setItem("ZuHuID", "1429338802177000010");
               localStorage.setItem("deptCode", "");
-              localStorage.setItem("YongHuID", "");
-              localStorage.setItem("YongHuXM", "");
+              localStorage.setItem("YongHuID", "1512704798124675072");
+              localStorage.setItem("YongHuXM", "JYRMYY ");
             } else if (orgid == "47226079133110211G1001") {
               localStorage.setItem("orgname", "涓芥按甯傚骞间繚鍋ラ櫌");
               localStorage.setItem("ZuHuID", "1429338802177000014");
               localStorage.setItem("deptCode", "");
-              localStorage.setItem("YongHuID", "");
-              localStorage.setItem("YongHuXM", "");
+              localStorage.setItem("YongHuID", "1540518838905344000");
+              localStorage.setItem("YongHuXM", "LSFBY");
             } else if (orgid == "47226007033110211A5201") {
               localStorage.setItem("orgname", "涓芥按甯傜浜屼汉姘戝尰闄�");
               localStorage.setItem("ZuHuID", "");
               localStorage.setItem("deptCode", "");
-              localStorage.setItem("YongHuID", "");
-              localStorage.setItem("YongHuXM", "");
+              localStorage.setItem("YongHuID", "1540295571200282624");
+              localStorage.setItem("YongHuXM", "LSDERMYY");
             }
             resolve();
           })
diff --git a/src/utils/request.js b/src/utils/request.js
index 2445631..ea1f0f8 100644
--- a/src/utils/request.js
+++ b/src/utils/request.js
@@ -111,6 +111,8 @@
         )
           .then(() => {
             console.log('閫夋嫨閲嶆柊鐧诲綍');
+            location.href = "/index";
+
             this.$router.replace("/login");
           })
           .catch(() => {
diff --git a/src/utils/sipService.js b/src/utils/sipService.js
index 7d952c6..0e722c5 100644
--- a/src/utils/sipService.js
+++ b/src/utils/sipService.js
@@ -19,6 +19,26 @@
     wsUrl: "wss://192.169.129.198:7443",
     domain: "192.169.129.198",
   },
+  鐪佺珛鍚屽痉缈犺嫅闄㈠尯: {
+    wsUrl: "wss://220.88.10.62:7443",
+    domain: "220.88.10.62",
+  },
+  鐪佺珛鍚屽痉涔嬫睙闄㈠尯: {
+    wsUrl: "wss://220.88.10.62:7443",
+    domain: "220.88.10.62",
+  },
+  鐪佺珛鍚屽痉闂叉灄闄㈠尯: {
+    wsUrl: "wss://220.88.10.62:7443",
+    domain: "220.88.10.62",
+  },
+  鐪佺珛鍚屽痉澶╃洰灞辫矾闄㈠尯: {
+    wsUrl: "wss://220.88.10.62:7443",
+    domain: "220.88.10.62",
+  },
+  鐪佺珛鍚屽痉闈掑北婀栭櫌鍖�: {
+    wsUrl: "wss://220.88.10.62:7443",
+    domain: "220.88.10.62",
+  },
   // 鍙互缁х画娣诲姞鍏朵粬鍖婚櫌閰嶇疆
   default: {
     wsUrl: "wss://192.168.10.124:7443",
@@ -422,16 +442,18 @@
     });
   }
 
-endCall() {
-  if (this.currentSession) {
-    this.isManualEnd = true;
-    this.currentSession.terminate();
-    this.updateCallStatus('ended', '閫氳瘽宸茬粨鏉�');
-    this.currentSession = null;
-    // 寤惰繜閲嶇疆鏍囧織锛岄伩鍏嶅奖鍝嶅悗缁簨浠�
-    setTimeout(() => { this.isManualEnd = false; }, 100);
+  endCall() {
+    if (this.currentSession) {
+      this.isManualEnd = true;
+      this.currentSession.terminate();
+      this.updateCallStatus("ended", "閫氳瘽宸茬粨鏉�");
+      this.currentSession = null;
+      // 寤惰繜閲嶇疆鏍囧織锛岄伩鍏嶅奖鍝嶅悗缁簨浠�
+      setTimeout(() => {
+        this.isManualEnd = false;
+      }, 100);
+    }
   }
-}
 
   updateStatus(type, text) {
     console.log(`SIP鐘舵�佹洿鏂�: ${type} - ${text}`);
diff --git a/src/views/Satisfaction/configurationmyd/index.vue b/src/views/Satisfaction/configurationmyd/index.vue
index a6debdc..dbc0df8 100644
--- a/src/views/Satisfaction/configurationmyd/index.vue
+++ b/src/views/Satisfaction/configurationmyd/index.vue
@@ -116,7 +116,7 @@
               <span class="meta-item">
                 <i class="el-icon-s-order"></i>
                 妯℃澘绫诲瀷锛歿{
-                  templateForm.templateType === 1 ? "闂嵎妯℃澘" : "璇煶妯℃澘"
+                  templateForm.templateType == 1 ? "闂嵎妯℃澘" : "璇煶妯℃澘"
                 }}
               </span>
               <span class="meta-item">
@@ -132,11 +132,11 @@
           <div class="info-right">
             <el-tag
               :type="
-                currentTemplateInfo.templateStatus === 1 ? 'success' : 'info'
+                currentTemplateInfo.templateStatus == 1 ? 'success' : 'info'
               "
               size="medium"
             >
-              {{ currentTemplateInfo.templateStatus === 1 ? "鍚敤" : "鍋滅敤" }}
+              {{ currentTemplateInfo.templateStatus == 1 ? "鍚敤" : "鍋滅敤" }}
             </el-tag>
           </div>
         </div>
@@ -211,13 +211,12 @@
       </div>
 
       <div
-        v-else-if="questionList.length === 0 && templateForm.templateId"
+        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>
@@ -378,7 +377,15 @@
                       </div>
                     </el-form-item>
                   </div>
-
+                  <div class="config-field">
+                    <el-form-item label="璐d换浜哄伐鍙�">
+                      <el-input
+                        v-model="question.exceptionConfig.dutyDeptPersonCode"
+                        placeholder="璇疯緭鍏ヨ矗浠讳汉宸ュ彿"
+                        @input="handleConfigChange(question)"
+                      />
+                    </el-form-item>
+                  </div>
                   <!-- 鎶ュ绉戝锛堝閫夛級 -->
                   <div class="config-field">
                     <el-form-item
@@ -444,9 +451,7 @@
                       :closable="false"
                       show-icon
                       :effect="
-                        question.saveStatus.type === 'success'
-                          ? 'dark'
-                          : 'light'
+                        question.saveStatus.type == 'success' ? 'dark' : 'light'
                       "
                       size="small"
                     />
@@ -495,7 +500,7 @@
 
         <div class="option-list">
           <el-alert
-            v-if="!currentOptions.some((opt) => opt.isabnormal === 1)"
+            v-if="!currentOptions.some((opt) => opt.isabnormal == 1)"
             title="璇疯嚦灏戣缃竴涓紓甯搁�夐」锛堟爣璁颁负寮傚父锛�"
             type="warning"
             :closable="false"
@@ -582,9 +587,7 @@
 
       <span slot="footer" class="dialog-footer">
         <el-button @click="optionDialogVisible = false">鍙栨秷</el-button>
-        <el-button type="primary" @click="saveOptions" :loading="savingOptions">
-          淇濆瓨閰嶇疆
-        </el-button>
+        <el-button type="primary" @click="saveOptions"> 淇濆瓨閰嶇疆 </el-button>
       </span>
     </el-dialog>
     <!-- 棰樼洰棰勮瀵硅瘽妗� -->
@@ -801,7 +804,7 @@
           },
           {
             validator: (rule, value, callback) => {
-              if (!value || value.length === 0) {
+              if (!value || value.length == 0) {
                 callback(new Error("璇疯嚦灏戦�夋嫨涓�涓矗浠荤瀹�"));
               } else {
                 callback();
@@ -818,7 +821,7 @@
           },
           {
             validator: (rule, value, callback) => {
-              if (!value || value.length === 0) {
+              if (!value || value.length == 0) {
                 callback(new Error("璇疯嚦灏戦�夋嫨涓�涓姤澶囩瀹�"));
               } else {
                 callback();
@@ -833,9 +836,9 @@
   computed: {
     // 鏍规嵁妯℃澘绫诲瀷杩囨护妯℃澘閫夐」
     filteredTemplateOptions() {
-      if (this.templateForm.templateType === 1) {
+      if (this.templateForm.templateType == 1) {
         return this.questionnaireTemplates;
-      } else if (this.templateForm.templateType === 2) {
+      } else if (this.templateForm.templateType == 2) {
         return this.followupTemplates;
       }
       return [];
@@ -843,11 +846,11 @@
 
     // 婊℃剰搴﹂鐩暟閲�
     satisfactionQuestionsCount() {
-      if (this.templateForm.templateType === 1) {
+      if (this.templateForm.templateType == 1) {
         return this.questionList.filter((q) =>
           this.questionnaireCategorys.includes(q.categoryid)
         ).length;
-      } else if (this.templateForm.templateType === 2) {
+      } else if (this.templateForm.templateType == 2) {
         return this.questionList.filter((q) =>
           this.voiceCategories.includes(q.scriptAssortid)
         ).length;
@@ -858,14 +861,13 @@
     // 绛涢�夊悗鐨勯鐩垪琛�
     filteredQuestionList() {
       let filtered = this.questionList;
-      console.log("queryParams:", this.queryParams);
-      console.log("questionList:", this.questionList);
+
       // 绛涢�夋弧鎰忓害棰樼洰
-      if (this.templateForm.templateType === 1) {
+      if (this.templateForm.templateType == 1) {
         filtered = filtered.filter((q) =>
           this.questionnaireCategorys.includes(q.categoryid)
         );
-      } else if (this.templateForm.templateType === 2) {
+      } else if (this.templateForm.templateType == 2) {
         filtered = filtered.filter((q) =>
           this.voiceCategories.includes(q.scriptAssortid)
         );
@@ -892,6 +894,9 @@
   },
   created() {
     if (store.getters.satisfactionCategories) {
+      // this.questionnaireCategorys = [404, 405, 406, 10039, 10041, 10042];
+      // console.log(1);
+
       this.questionnaireCategorys =
         store.getters.satisfactionCategories.questionnaireCategorys.map(
           (item) => item.categoryid
@@ -951,13 +956,13 @@
     /** 鏍规嵁绉戝缂栫爜鑾峰彇绉戝鍚嶇О */
     getDeptName(deptCode) {
       if (!deptCode) return "";
-      const dept = this.deptOptions.find((d) => d.deptCode === deptCode);
+      const dept = this.deptOptions.find((d) => d.deptCode == deptCode);
       return dept ? dept.label : deptCode;
     },
 
     /** 鏍规嵁绉戝缂栫爜鏁扮粍鑾峰彇绉戝鍚嶇О鏁扮粍 */
     getDeptNames(deptCodes) {
-      if (!Array.isArray(deptCodes) || deptCodes.length === 0) return [];
+      if (!Array.isArray(deptCodes) || deptCodes.length == 0) return [];
       return deptCodes
         .map((code) => this.getDeptName(code))
         .filter((name) => name && name.trim());
@@ -1029,7 +1034,7 @@
     handleTemplateChange(templateId) {
       if (templateId) {
         const selectedTemplate = this.filteredTemplateOptions.find(
-          (t) => t.id === templateId
+          (t) => t.id == templateId
         );
         if (selectedTemplate) {
           this.currentTemplateInfo = {
@@ -1043,9 +1048,9 @@
         this.loading = true;
         this.questionList = [];
 
-        if (this.templateForm.templateType === 1) {
+        if (this.templateForm.templateType == 1) {
           this.loadQuestionnaireTemplateDetail();
-        } else if (this.templateForm.templateType === 2) {
+        } else if (this.templateForm.templateType == 2) {
           this.loadFollowupTemplateDetail();
         }
       } else {
@@ -1066,9 +1071,9 @@
         this.loading = true;
         this.questionList = [];
 
-        if (this.templateForm.templateType === 1) {
+        if (this.templateForm.templateType == 1) {
           this.loadQuestionnaireTemplateDetail();
-        } else if (this.templateForm.templateType === 2) {
+        } else if (this.templateForm.templateType == 2) {
           this.loadFollowupTemplateDetail();
         }
       });
@@ -1081,7 +1086,7 @@
           this.templateLoading = false;
           this.loading = false;
 
-          if (res.code === 200 && res.rows && res.rows.length > 0) {
+          if (res.code == 200 && res.rows && res.rows.length > 0) {
             const templateDetail = res.rows[0];
 
             // 鏇存柊妯℃澘淇℃伅
@@ -1116,7 +1121,7 @@
           this.templateLoading = false;
           this.loading = false;
 
-          if (res.code === 200) {
+          if (res.code == 200) {
             const templateDetail = res.data;
 
             // 鏇存柊妯℃澘淇℃伅
@@ -1152,6 +1157,7 @@
         let exceptionConfig = {
           responsibilityDept: [], // 璐d换绉戝缂栫爜鏁扮粍
           reportDept: [], // 鎶ュ绉戝缂栫爜鏁扮粍
+          dutyDeptPersonCode: question.dutyDeptPersonCode || "", // 璐d换浜哄伐鍙�
         };
 
         // 浠庨鐩《灞傚瓧娈佃鍙栨暟鎹�
@@ -1205,27 +1211,12 @@
 
     /** 閰嶇疆鍙樻洿澶勭悊 */
     handleConfigChange(question) {
-      this.$nextTick(() => {
-        const index = this.filteredQuestionList.findIndex(
-          (q) => q.id === question.id
-        );
-        console.log(index, "index");
-
-        if (index !== -1) {
-          const formRef = this.$refs.configForm && this.$refs.configForm[index];
-          if (formRef) {
-            formRef.validate((valid) => {
-              if (valid) {
-                question.hasChanges = !this.isConfigEqual(
-                  question.exceptionConfig,
-                  question.originalConfig
-                );
-                this.updateChangedStatus();
-              }
-            });
-          }
-        }
-      });
+      // 鐩存帴瀵规瘮閰嶇疆鏄惁鍙樺寲锛屼笉渚濊禆琛ㄥ崟鏍¢獙锛堥伩鍏嶅彧鏀逛竴涓瓧娈垫椂鏍¢獙涓嶉�氳繃瀵艰嚧 hasChanges 鏃犳硶鏇存柊锛�
+      question.hasChanges = !this.isConfigEqual(
+        question.exceptionConfig,
+        question.originalConfig
+      );
+      this.updateChangedStatus();
     },
 
     /** 姣旇緝閰嶇疆鏄惁鏀瑰彉 */
@@ -1248,8 +1239,12 @@
         .sort()
         .join(",")
         .toLowerCase();
+      const person1 = (config1.dutyDeptPersonCode || "").trim();
+      const person2 = (config2.dutyDeptPersonCode || "").trim();
 
-      return responsibility1 === responsibility2 && report1 === report2;
+      return responsibility1 == responsibility2
+        && report1 == report2
+        && person1 == person2;
     },
 
     /** 鏇存柊鍙樻洿鐘舵�� */
@@ -1264,13 +1259,13 @@
 
     /** 妫�鏌ラ鐩槸鍚︽湁寮傚父閫夐」 */
     checkHasAbnormalOptions(question) {
-      if (this.templateForm.templateType === 1) {
+      if (this.templateForm.templateType == 1) {
         return (question.svyLibTemplateTargetoptions || []).some(
-          (opt) => opt.isabnormal === 1
+          (opt) => opt.isabnormal == 1
         );
-      } else if (this.templateForm.templateType === 2) {
+      } else if (this.templateForm.templateType == 2) {
         return (question.ivrLibaScriptTargetoptionList || []).some(
-          (opt) => opt.isabnormal === 1
+          (opt) => opt.isabnormal == 1
         );
       }
       return false;
@@ -1302,8 +1297,8 @@
         return;
       }
 
-      const index = this.questionList.findIndex((q) => q.id === question.id);
-      if (index === -1) return;
+      const index = this.questionList.findIndex((q) => q.id == question.id);
+      if (index == -1) return;
 
       const formRef = this.$refs.configForm && this.$refs.configForm[index];
       if (!formRef) return;
@@ -1322,16 +1317,16 @@
       try {
         // 鑾峰彇褰撳墠妯℃澘璇︽儏
         let templateDetail;
-        if (this.templateForm.templateType === 1) {
+        if (this.templateForm.templateType == 1) {
           // 闂嵎妯℃澘
           const res = await getQtemplateobj({
             svyid: this.templateForm.templateId,
           });
-          if (res.code !== 200 || !res.rows || res.rows.length === 0) {
+          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) {
+        } else if (this.templateForm.templateType == 2) {
           // 璇煶妯℃澘
           const res = await getvFollowup({ id: this.templateForm.templateId });
           if (res.code !== 200) {
@@ -1343,14 +1338,14 @@
         // 鏇存柊棰樼洰閰嶇疆
         let updatedTemplateDetail = { ...templateDetail };
         let questionsField =
-          this.templateForm.templateType === 1
+          this.templateForm.templateType == 1
             ? "svyTemplateLibScripts"
             : "ivrLibaTemplateScriptVOList";
 
         const questions = updatedTemplateDetail[questionsField] || [];
-        const questionIndex = questions.findIndex((q) => q.id === question.id);
+        const questionIndex = questions.findIndex((q) => q.id == question.id);
 
-        if (questionIndex === -1) {
+        if (questionIndex == -1) {
           throw new Error("鏈壘鍒伴鐩�");
         }
 
@@ -1370,16 +1365,14 @@
           dutyDeptName: responsibilityDeptNames.join(","),
           reportDeptCode: question.exceptionConfig.reportDept.join(","),
           reportDeptName: reportDeptNames.join(","),
+          dutyDeptPersonCode: question.exceptionConfig.dutyDeptPersonCode || "",
         };
 
         // 濡傛灉闇�瑕侊紝涔熸洿鏂伴�夐」鏁版嵁
-        if (question.hasChanges && this.templateForm.templateType === 1) {
+        if (question.hasChanges && this.templateForm.templateType == 1) {
           questions[questionIndex].svyLibTemplateTargetoptions =
             question.svyLibTemplateTargetoptions || [];
-        } else if (
-          question.hasChanges &&
-          this.templateForm.templateType === 2
-        ) {
+        } else if (question.hasChanges && this.templateForm.templateType == 2) {
           questions[questionIndex].ivrLibaScriptTargetoptionList =
             question.ivrLibaScriptTargetoptionList || [];
         }
@@ -1389,7 +1382,7 @@
 
         // 淇濆瓨妯℃澘
         let response;
-        if (this.templateForm.templateType === 1) {
+        if (this.templateForm.templateType == 1) {
           response = await compileQtemplate({
             ...updatedTemplateDetail,
             id: this.templateForm.templateId,
@@ -1403,7 +1396,7 @@
           });
         }
 
-        if (response.code === 200) {
+        if (response.code == 200) {
           this.handleSaveSuccess(question);
         } else {
           throw new Error(response.msg || "淇濆瓨澶辫触");
@@ -1436,6 +1429,7 @@
       question.dutyDeptName = responsibilityDeptNames.join(",");
       question.reportDeptCode = question.exceptionConfig.reportDept.join(",");
       question.reportDeptName = reportDeptNames.join(",");
+      question.dutyDeptPersonCode = question.exceptionConfig.dutyDeptPersonCode || "";
 
       // 鏇存柊鍘熷閰嶇疆
       question.originalConfig = JSON.parse(
@@ -1496,7 +1490,7 @@
 
       // 鑾峰彇鏈夊彉鏇寸殑棰樼洰
       const changedQuestions = this.questionList.filter((q) => q.hasChanges);
-      if (changedQuestions.length === 0) {
+      if (changedQuestions.length == 0) {
         this.$message.info("娌℃湁闇�瑕佷繚瀛樼殑閰嶇疆鍙樻洿");
         return;
       }
@@ -1555,7 +1549,7 @@
           const successCount = results.filter((r) => r.success).length;
           const failCount = results.length - successCount;
 
-          if (failCount === 0) {
+          if (failCount == 0) {
             this.saveSuccessVisible = true;
             this.$message.success(`鎴愬姛淇濆瓨 ${successCount} 涓厤缃甡);
           } else {
@@ -1586,18 +1580,18 @@
       this.editingQuestion = question;
 
       // 淇濆瓨鍘熷閫夐」鐨勫揩鐓�
-      if (this.templateForm.templateType === 1) {
+      if (this.templateForm.templateType == 1) {
         this.editingQuestion.originalOptions = JSON.parse(
           JSON.stringify(question.svyLibTemplateTargetoptions || [])
         );
-      } else if (this.templateForm.templateType === 2) {
+      } else if (this.templateForm.templateType == 2) {
         this.editingQuestion.originalOptions = JSON.parse(
           JSON.stringify(question.ivrLibaScriptTargetoptionList || [])
         );
       }
 
       // 澶嶅埗閫夐」鏁版嵁
-      if (this.templateForm.templateType === 1) {
+      if (this.templateForm.templateType == 1) {
         this.currentOptions = JSON.parse(
           JSON.stringify(question.svyLibTemplateTargetoptions || [])
         ).map((opt, index) => ({
@@ -1606,7 +1600,7 @@
           targetvalue: opt.optioncontent || "",
           isabnormal: opt.isabnormal || 0,
         }));
-      } else if (this.templateForm.templateType === 2) {
+      } else if (this.templateForm.templateType == 2) {
         this.currentOptions = JSON.parse(
           JSON.stringify(question.ivrLibaScriptTargetoptionList || [])
         ).map((opt, index) => ({
@@ -1649,7 +1643,7 @@
         // 楠岃瘉蹇呭~椤�
         for (let i = 0; i < this.currentOptions.length; i++) {
           const option = this.currentOptions[i];
-          if (!option.targetvalue || option.targetvalue.trim() === "") {
+          if (!option.targetvalue || option.targetvalue.trim() == "") {
             this.$message.warning(`绗� ${i + 1} 涓�夐」鍐呭涓嶈兘涓虹┖`);
             return;
           }
@@ -1657,7 +1651,7 @@
 
         // 妫�鏌ユ槸鍚︽湁寮傚父閫夐」
         const hasAbnormal = this.currentOptions.some(
-          (opt) => opt.isabnormal === 1
+          (opt) => opt.isabnormal == 1
         );
 
         if (!hasAbnormal) {
@@ -1668,7 +1662,7 @@
         // 鍒ゆ柇閫夐」鏄惁鍙戠敓鍙樺寲
         let isOptionsChanged = false;
 
-        if (this.templateForm.templateType === 1) {
+        if (this.templateForm.templateType == 1) {
           const originalOptions =
             this.editingQuestion.svyLibTemplateTargetoptions || [];
           isOptionsChanged = this.checkOptionsChanged(
@@ -1676,7 +1670,7 @@
             this.currentOptions,
             "questionnaire"
           );
-        } else if (this.templateForm.templateType === 2) {
+        } else if (this.templateForm.templateType == 2) {
           const originalOptions =
             this.editingQuestion.ivrLibaScriptTargetoptionList || [];
           isOptionsChanged = this.checkOptionsChanged(
@@ -1687,7 +1681,7 @@
         }
 
         // 淇濆瓨閫昏緫 - 鏇存柊棰樼洰瀵硅薄鐨勯�夐」鏁版嵁
-        if (this.templateForm.templateType === 1) {
+        if (this.templateForm.templateType == 1) {
           this.editingQuestion.svyLibTemplateTargetoptions =
             this.currentOptions.map((opt) => ({
               ...opt,
@@ -1697,7 +1691,7 @@
               targetvalue: undefined,
               isNew: undefined,
             }));
-        } else if (this.templateForm.templateType === 2) {
+        } else if (this.templateForm.templateType == 2) {
           this.editingQuestion.ivrLibaScriptTargetoptionList =
             this.currentOptions.map((opt) => ({
               ...opt,
@@ -1731,7 +1725,7 @@
         const original = originalOptions[i];
         const current = newOptions[i];
 
-        if (templateType === "questionnaire") {
+        if (templateType == "questionnaire") {
           // 闂嵎妯℃澘姣旇緝
           if (
             original.optioncontent !== current.targetvalue ||
@@ -1739,7 +1733,7 @@
           ) {
             return true;
           }
-        } else if (templateType === "voice") {
+        } else if (templateType == "voice") {
           // 璇煶妯℃澘姣旇緝
           if (
             original.targetvalue !== current.targetvalue ||
@@ -1754,21 +1748,21 @@
     },
     /** 鑾峰彇寮傚父閫夐」缁熻 */
     getAbnormalStats(question) {
-      if (this.templateForm.templateType === 1) {
+      if (this.templateForm.templateType == 1) {
         const options = question.svyLibTemplateTargetoptions || [];
         return {
           total: options.length,
-          abnormal: options.filter((opt) => opt.isabnormal === 1).length,
-          warning: options.filter((opt) => opt.isabnormal === 2).length,
-          normal: options.filter((opt) => opt.isabnormal === 0).length,
+          abnormal: options.filter((opt) => opt.isabnormal == 1).length,
+          warning: options.filter((opt) => opt.isabnormal == 2).length,
+          normal: options.filter((opt) => opt.isabnormal == 0).length,
         };
-      } else if (this.templateForm.templateType === 2) {
+      } else if (this.templateForm.templateType == 2) {
         const options = question.ivrLibaScriptTargetoptionList || [];
         return {
           total: options.length,
-          abnormal: options.filter((opt) => opt.isabnormal === 1).length,
-          warning: options.filter((opt) => opt.isabnormal === 2).length,
-          normal: options.filter((opt) => opt.isabnormal === 0).length,
+          abnormal: options.filter((opt) => opt.isabnormal == 1).length,
+          warning: options.filter((opt) => opt.isabnormal == 2).length,
+          normal: options.filter((opt) => opt.isabnormal == 0).length,
         };
       }
       return { total: 0, abnormal: 0, warning: 0, normal: 0 };
diff --git a/src/views/Satisfaction/diseaseStatistics/components/FirstFollowUp.vue b/src/views/Satisfaction/diseaseStatistics/components/FirstFollowUp.vue
index e8ee568..978e85d 100644
--- a/src/views/Satisfaction/diseaseStatistics/components/FirstFollowUp.vue
+++ b/src/views/Satisfaction/diseaseStatistics/components/FirstFollowUp.vue
@@ -190,6 +190,7 @@
             </template>
           </el-table-column>
           <el-table-column
+            v-if="orgname != '鏅畞鐣叉棌鑷不鍘夸汉姘戝尰闄�'"
             label="鎴愬姛鐜�"
             align="center"
             width="120"
@@ -404,7 +405,7 @@
 
       delete params.leavehospitaldistrictcodes.all;
       delete params.deptcodes.all;
-      params.rateDay = 7;
+      params.rateDay = this.orgname == "榫欐硥甯備汉姘戝尰闄�" ? 21 : 7;
       getSpecialSfStatistics(params)
         .then((response) => {
           this.tableData = this.customSort(response.data);
@@ -617,7 +618,7 @@
 
       if (!row.doctorStats) {
         this.loading = true;
-        params.rateDay = 7;
+        params.rateDay = this.orgname == "榫欐硥甯備汉姘戝尰闄�" ? 21 : 7;
 
         getSpecialSfStatistics(params).then((res) => {
           this.$set(row, "doctorStats", res.data);
diff --git a/src/views/Satisfaction/diseaseStatistics/components/SecondFollowUp.vue b/src/views/Satisfaction/diseaseStatistics/components/SecondFollowUp.vue
index fb14b1a..1eae5a5 100644
--- a/src/views/Satisfaction/diseaseStatistics/components/SecondFollowUp.vue
+++ b/src/views/Satisfaction/diseaseStatistics/components/SecondFollowUp.vue
@@ -198,6 +198,7 @@
             </template>
           </el-table-column>
           <el-table-column
+          v-if="orgname != '鏅畞鐣叉棌鑷不鍘夸汉姘戝尰闄�'"
             label="鎴愬姛鐜�"
             align="center"
             width="120"
@@ -367,7 +368,7 @@
 
       delete params.leavehospitaldistrictcodes.all;
       delete params.deptcodes.all;
-      params.rateDay = 7;
+      params.rateDay = this.orgname == "榫欐硥甯備汉姘戝尰闄�" ? 21 : 7;
 
       getSfStatistics(params)
         .then((response) => {
@@ -581,7 +582,7 @@
 
       if (!row.doctorStats) {
         this.loading = true;
-        params.rateDay = 7;
+        params.rateDay = this.orgname == "榫欐硥甯備汉姘戝尰闄�" ? 21 : 7;
 
         getSfStatistics(params).then((res) => {
           this.$set(row, "doctorStats", res.data);
diff --git a/src/views/SatisfactionRelay.vue b/src/views/SatisfactionRelay.vue
new file mode 100644
index 0000000..63a591b
--- /dev/null
+++ b/src/views/SatisfactionRelay.vue
@@ -0,0 +1,181 @@
+<template>
+  <div class="relay-container">
+    <div class="relay-card">
+      <!-- 鍔犺浇鍔ㄧ敾 -->
+      <div class="loading-spinner">
+        <div class="spinner-dot"></div>
+        <div class="spinner-dot"></div>
+        <div class="spinner-dot"></div>
+      </div>
+      <!-- 鏍囬 -->
+      <h1 class="relay-title">姝e湪鍔犺浇鏈嶅姟</h1>
+      <!-- 鎻忚堪 -->
+      <p class="relay-desc">璇风◢鍊欙紝鍗冲皢涓烘偍璺宠浆鑷抽棶鍗烽〉闈�</p>
+      <!-- 杩涘害鏉¤楗� -->
+      <div class="progress-bar">
+        <div class="progress-fill"></div>
+      </div>
+    </div>
+  </div>
+</template>
+
+<script>
+import { scanGenerateSubtask } from '@/api/AiCentre/index';
+
+export default {
+  name: 'RelayPage',
+  created() {
+    this.handleRedirect();
+  },
+  methods: {
+    handleRedirect() {
+      const { taskid, deptcode, leaveldeptcodes } = this.$route.query;
+      if (!taskid) {
+        this.$message.error('缂哄皯浠诲姟鏍囪瘑锛岃閲嶆柊鎵爜');
+        return;
+      }
+      const params = {
+        taskid: taskid,
+        deptcode: deptcode ,
+        leaveldeptcodes: leaveldeptcodes
+      };
+      scanGenerateSubtask(params).then(res => {
+        return
+        if (res.code === 200 ) {
+          window.location.href = res.msg;
+        } else {
+          this.$message.error('鑾峰彇闂嵎閾炬帴澶辫触锛�' + (res.msg || '鏈煡閿欒'));
+        }
+      }).catch(err => {
+        console.error(err);
+        this.$message.error('鏈嶅姟寮傚父锛岃绋嶅悗閲嶈瘯');
+      });
+    }
+  }
+};
+</script>
+
+<style scoped>
+/* 鍏ㄥ眬閲嶇疆 */
+.relay-container {
+  display: flex;
+  justify-content: center;
+  align-items: center;
+  min-height: 100vh;
+  margin: 0;
+  padding: 20px;
+  background: linear-gradient(145deg, #f5f9ff 0%, #e8f0fe 100%);
+  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
+}
+
+/* 鍗$墖瀹瑰櫒 */
+.relay-card {
+  max-width: 420px;
+  width: 100%;
+  padding: 48px 36px 40px;
+  background: rgba(255, 255, 255, 0.85);
+  backdrop-filter: blur(10px);
+  -webkit-backdrop-filter: blur(10px);
+  border-radius: 32px;
+  box-shadow: 0 20px 60px rgba(64, 158, 255, 0.15),
+              0 8px 20px rgba(0, 0, 0, 0.04);
+  text-align: center;
+  transition: all 0.3s ease;
+  border: 1px solid rgba(255, 255, 255, 0.3);
+}
+
+/* 鍔犺浇鍔ㄧ敾 鈥� 涓夌偣娉㈡氮 */
+.loading-spinner {
+  display: flex;
+  justify-content: center;
+  gap: 8px;
+  margin-bottom: 28px;
+}
+
+.spinner-dot {
+  width: 14px;
+  height: 14px;
+  background: #409EFF;
+  border-radius: 50%;
+  animation: bounce 1.4s infinite ease-in-out both;
+}
+
+.spinner-dot:nth-child(1) {
+  animation-delay: -0.32s;
+  background: #409EFF;
+}
+
+.spinner-dot:nth-child(2) {
+  animation-delay: -0.16s;
+  background: #66b1ff;
+}
+
+.spinner-dot:nth-child(3) {
+  animation-delay: 0s;
+  background: #8cc5ff;
+}
+
+@keyframes bounce {
+  0%, 80%, 100% {
+    transform: scale(0.6);
+    opacity: 0.4;
+  }
+  40% {
+    transform: scale(1);
+    opacity: 1;
+  }
+}
+
+/* 鏍囬 */
+.relay-title {
+  font-size: 24px;
+  font-weight: 600;
+  color: #2c3e50;
+  margin: 0 0 10px 0;
+  letter-spacing: 1px;
+}
+
+/* 鎻忚堪鏂囧瓧 */
+.relay-desc {
+  font-size: 16px;
+  color: #7f8c8d;
+  margin: 0 0 30px 0;
+  line-height: 1.6;
+}
+
+/* 杩涘害鏉★紙瑁呴グ锛� */
+.progress-bar {
+  width: 100%;
+  height: 4px;
+  background: #e0e7f1;
+  border-radius: 4px;
+  overflow: hidden;
+  margin-top: 8px;
+}
+
+.progress-fill {
+  width: 60%;
+  height: 100%;
+  background: linear-gradient(90deg, #409EFF, #79bbff);
+  border-radius: 4px;
+  animation: progressMove 1.8s ease-in-out infinite alternate;
+}
+
+@keyframes progressMove {
+  0% { transform: translateX(-10%); width: 40%; }
+  100% { transform: translateX(10%); width: 80%; }
+}
+
+/* 绉诲姩绔�傞厤 */
+@media (max-width: 480px) {
+  .relay-card {
+    padding: 32px 20px 28px;
+  }
+  .relay-title {
+    font-size: 20px;
+  }
+  .relay-desc {
+    font-size: 14px;
+  }
+}
+</style>
diff --git a/src/views/followvisit/Continue/ContinueFordetails.vue b/src/views/followvisit/Continue/ContinueFordetails.vue
index d20c246..827db3c 100644
--- a/src/views/followvisit/Continue/ContinueFordetails.vue
+++ b/src/views/followvisit/Continue/ContinueFordetails.vue
@@ -3,9 +3,7 @@
   <div class="ContinuityCarePage" id="app-container">
     <!-- 绗竴閮ㄥ垎锛氭偅鑰呭熀纭�淇℃伅 -->
     <div class="patient-info-section">
-      <div class="headline">
-        <div>鎮h�呭熀纭�淇℃伅</div>
-      </div>
+      <div class="headline"><div>鎮h�呭熀纭�淇℃伅</div></div>
       <div class="patient-info-form">
         <el-form
           ref="patientForm"
@@ -21,7 +19,7 @@
                   placeholder="璇疯緭鍏ユ偅鑰呭鍚�"
                   maxlength="30"
                   clearable
-                ></el-input>
+                />
               </el-form-item>
             </el-col>
             <el-col :span="8">
@@ -31,8 +29,8 @@
                   placeholder="璇烽�夋嫨"
                   clearable
                 >
-                  <el-option label="鐢�" :value="1"></el-option>
-                  <el-option label="濂�" :value="2"></el-option>
+                  <el-option label="鐢�" :value="1" />
+                  <el-option label="濂�" :value="2" />
                 </el-select>
               </el-form-item>
             </el-col>
@@ -43,11 +41,10 @@
                   placeholder="璇疯緭鍏ュ勾榫�"
                   maxlength="3"
                   clearable
-                ></el-input>
+                />
               </el-form-item>
             </el-col>
           </el-row>
-
           <el-row :gutter="20">
             <el-col :span="8">
               <el-form-item label="鑱旂郴鐢佃瘽" prop="telcode">
@@ -56,7 +53,7 @@
                   placeholder="璇疯緭鍏ヨ仈绯荤數璇�"
                   maxlength="20"
                   clearable
-                ></el-input>
+                />
               </el-form-item>
             </el-col>
             <el-col :span="8">
@@ -66,7 +63,7 @@
                   placeholder="璇疯緭鍏ヤ綇闄㈠彿"
                   maxlength="50"
                   clearable
-                ></el-input>
+                />
               </el-form-item>
             </el-col>
             <el-col :span="8">
@@ -77,12 +74,10 @@
                   placeholder="閫夋嫨鍑洪櫌鏃ユ湡"
                   value-format="yyyy-MM-dd"
                   style="width: 100%"
-                >
-                </el-date-picker>
+                />
               </el-form-item>
             </el-col>
           </el-row>
-
           <el-row :gutter="20">
             <el-col :span="12">
               <el-form-item label="璇婃柇鍚嶇О" prop="diagnosis">
@@ -91,7 +86,7 @@
                   placeholder="璇疯緭鍏ヨ瘖鏂悕绉�"
                   maxlength="100"
                   clearable
-                ></el-input>
+                />
               </el-form-item>
             </el-col>
             <el-col :span="12">
@@ -101,11 +96,10 @@
                   placeholder="璇疯緭鍏ヨ矗浠绘姢澹�"
                   maxlength="50"
                   clearable
-                ></el-input>
+                />
               </el-form-item>
             </el-col>
           </el-row>
-
           <el-row :gutter="20">
             <el-col :span="24">
               <el-form-item label="灞呬綇鍦板潃" prop="address">
@@ -114,11 +108,10 @@
                   placeholder="璇疯緭鍏ヨ缁嗗眳浣忓湴鍧�"
                   maxlength="200"
                   clearable
-                ></el-input>
+                />
               </el-form-item>
             </el-col>
           </el-row>
-
           <el-row :gutter="20">
             <el-col :span="12">
               <el-form-item label="浜插睘濮撳悕" prop="relativeName">
@@ -127,7 +120,7 @@
                   placeholder="璇疯緭鍏ヤ翰灞炲鍚�"
                   maxlength="30"
                   clearable
-                ></el-input>
+                />
               </el-form-item>
             </el-col>
             <el-col :span="12">
@@ -137,31 +130,29 @@
                   placeholder="璇疯緭鍏ヤ翰灞炵數璇�"
                   maxlength="20"
                   clearable
-                ></el-input>
+                />
               </el-form-item>
             </el-col>
           </el-row>
-
-          <!-- 寤剁画鎶ょ悊姹囨�讳俊鎭� -->
           <el-row :gutter="20" v-if="continuitySummary.continueCount > 0">
             <el-col :span="24">
               <el-form-item label="寤剁画鎶ょ悊姹囨��">
                 <div class="continuity-summary">
                   <div class="summary-item">
-                    <span class="label">寤剁画娆℃暟锛�</span>
-                    <span class="value"
+                    <span class="label">寤剁画娆℃暟锛�</span
+                    ><span class="value"
                       >{{ continuitySummary.continueCount }} 娆�</span
                     >
                   </div>
                   <div class="summary-item">
-                    <span class="label">鏈�鏂版湇鍔★細</span>
-                    <span class="value">{{
+                    <span class="label">鏈�鏂版湇鍔★細</span
+                    ><span class="value">{{
                       formatDisplayTime(continuitySummary.continueTimeNow)
                     }}</span>
                   </div>
                   <div class="summary-item">
-                    <span class="label">涓嬫鏈嶅姟锛�</span>
-                    <span class="value">{{
+                    <span class="label">涓嬫鏈嶅姟锛�</span
+                    ><span class="value">{{
                       formatDisplayTime(continuitySummary.continueTimeNext)
                     }}</span>
                   </div>
@@ -169,31 +160,27 @@
               </el-form-item>
             </el-col>
           </el-row>
-
-          <!-- 鎿嶄綔鎸夐挳 -->
           <el-form-item>
             <el-button
               type="primary"
               @click="savePatientInfo"
               :loading="savingPatientInfo"
+              >淇濆瓨鎮h�呬俊鎭�</el-button
             >
-              淇濆瓨鎮h�呬俊鎭�
-            </el-button>
             <el-button @click="resetPatientInfo">閲嶇疆</el-button>
           </el-form-item>
         </el-form>
       </div>
     </div>
+
     <!-- 绗簩閮ㄥ垎锛氭湇鍔″熀纭�淇℃伅 -->
     <div class="basic-info-section">
-      <div class="headline">
-        <div>鏈嶅姟鍩虹淇℃伅</div>
-      </div>
+      <div class="headline"><div>鏈嶅姟鍩虹淇℃伅</div></div>
       <div class="basic-info-container">
         <!-- 宸﹀崐閮ㄥ垎锛氬綋鍓嶆湇鍔¢殢璁垮唴瀹癸紙鍙锛� -->
         <div class="followup-content readonly-content">
           <div class="sub-headline">
-            <i class="el-icon-document"></i> 褰撳墠鏈嶅姟闅忚鍐呭锛堝彧璇伙級
+            <i class="el-icon-document" /> 褰撳墠鏈嶅姟闅忚鍐呭锛堝彧璇伙級
             <el-button
               type="text"
               size="small"
@@ -203,7 +190,6 @@
               {{ showQuestionSelector ? "闅愯棌闂閫夊彇" : "閫夊彇寤剁画闂" }}
             </el-button>
           </div>
-
           <!-- 闂閫夊彇闈㈡澘 -->
           <div v-if="showQuestionSelector" class="question-selector-panel">
             <div class="selector-header">
@@ -212,14 +198,13 @@
                 type="primary"
                 size="small"
                 @click="confirmQuestionSelection"
+                >纭閫夊彇</el-button
               >
-                纭閫夊彇
-              </el-button>
             </div>
             <div class="question-list">
               <el-checkbox-group v-model="selectedQuestionIds">
                 <div
-                  v-for="(question, index) in availableQuestions"
+                  v-for="(question, idx) in availableQuestions"
                   :key="question.id"
                   class="question-item"
                 >
@@ -239,7 +224,7 @@
             <el-tabs v-model="activeName" type="border-card">
               <el-tab-pane name="wj">
                 <span slot="label"
-                  ><i class="el-icon-notebook-1"></i> 闂嵎闅忚缁撴灉</span
+                  ><i class="el-icon-notebook-1" /> 闂嵎闅忚缁撴灉</span
                 >
                 <div class="CONTENT">
                   <div class="title">{{ taskname ? taskname : "闂嵎" }}</div>
@@ -252,7 +237,6 @@
                       <!-- 鍗曢�� -->
                       <div
                         :class="getTopicClass(item)"
-                        :key="index"
                         v-if="item.scriptType == 1 && !item.astrict"
                       >
                         <div class="dev-text">
@@ -264,10 +248,10 @@
                           <el-radio-group v-model="item.scriptResult" disabled>
                             <el-radio
                               v-for="(
-                                items, indexs
+                                items, idx
                               ) in item.svyTaskTemplateTargetoptions"
                               :class="getOptionClass(items)"
-                              :key="indexs"
+                              :key="idx"
                               :label="items.optioncontent"
                               >{{ items.optioncontent }}</el-radio
                             >
@@ -283,11 +267,10 @@
                             placeholder="璇疯緭鍏ュ叿浣撲俊鎭�"
                             v-model="item.answerps"
                             readonly
-                          ></el-input>
+                          />
                         </div>
                         <div v-show="item.prompt">
-                          <el-alert :title="item.prompt" type="warning">
-                          </el-alert>
+                          <el-alert :title="item.prompt" type="warning" />
                         </div>
                       </div>
                       <!-- 澶氶�� -->
@@ -297,7 +280,6 @@
                             ? 'scriptTopic-isabnormal'
                             : 'scriptTopic-dev'
                         "
-                        :key="index"
                         v-if="item.scriptType == 2 && !item.astrict"
                       >
                         <div class="dev-text">
@@ -313,31 +295,30 @@
                             <el-checkbox
                               :class="items.isabnormal ? 'red-star' : ''"
                               v-for="(
-                                items, indexs
+                                items, idx
                               ) in item.svyTaskTemplateTargetoptions"
-                              :key="indexs"
+                              :key="idx"
                               :label="items.optioncontent"
+                              >{{ items.optioncontent }}</el-checkbox
                             >
-                              {{ 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>
+                          <el-alert :title="item.prompt" type="warning" />
                         </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>
+                          }}</span
+                          ><span v-if="item.valueType == 3"
+                            >(鍙兘杈撳叆鏁板瓧)</span
+                          >
                         </div>
                         <div class="dev-xx" v-if="item.valueType == 3">
                           <el-input
@@ -345,8 +326,7 @@
                             placeholder="璇疯緭鍏ョ瓟妗�"
                             v-model="item.scriptResult"
                             readonly
-                          >
-                          </el-input>
+                          />
                         </div>
                         <div class="dev-xx" v-else>
                           <el-input
@@ -355,8 +335,7 @@
                             placeholder="璇疯緭鍏ョ瓟妗�"
                             v-model="item.scriptResult"
                             readonly
-                          >
-                          </el-input>
+                          />
                         </div>
                       </div>
                     </div>
@@ -376,8 +355,8 @@
                         <div class="dev-xx">
                           <el-radio-group v-model="item.matchedtext" disabled>
                             <el-radio
-                              v-for="(items, index) in item.scriptResult"
-                              :key="index"
+                              v-for="(items, idx) in item.scriptResult"
+                              :key="idx"
                               :label="items"
                               :class="items.isabnormal ? 'red-star' : ''"
                               >{{ items }}</el-radio
@@ -385,16 +364,17 @@
                           </el-radio-group>
                         </div>
                         <div v-show="item.prompt">
-                          <el-alert :title="item.prompt" type="warning">
-                          </el-alert>
+                          <el-alert :title="item.prompt" type="warning" />
                         </div>
                       </div>
-                      <div class="scriptTopic-dev" :key="index" v-else>
+                      <div class="scriptTopic-dev" v-else>
                         <div class="dev-text">
                           {{ index + 1 }}. [闂瓟]<span>{{
                             item.scriptContent
-                          }}</span>
-                          <span v-if="item.valueType == 3">(鍙兘杈撳叆鏁板瓧)</span>
+                          }}</span
+                          ><span v-if="item.valueType == 3"
+                            >(鍙兘杈撳叆鏁板瓧)</span
+                          >
                         </div>
                         <div class="dev-xx" v-if="item.valueType == 3">
                           <el-input
@@ -402,8 +382,7 @@
                             placeholder="璇疯緭鍏ョ瓟妗�"
                             v-model="item.scriptResult"
                             readonly
-                          >
-                          </el-input>
+                          />
                         </div>
                         <div class="dev-xx" v-else>
                           <el-input
@@ -412,8 +391,7 @@
                             placeholder="璇疯緭鍏ョ瓟妗�"
                             v-model="item.scriptResult"
                             readonly
-                          >
-                          </el-input>
+                          />
                         </div>
                       </div>
                     </div>
@@ -422,33 +400,33 @@
               </el-tab-pane>
               <el-tab-pane name="yy">
                 <span slot="label"
-                  ><i class="el-icon-headset"></i> 璇煶闅忚璇︽儏</span
+                  ><i class="el-icon-headset" /> 璇煶闅忚璇︽儏</span
                 >
                 <div class="borderdiv">
                   <div class="title">{{ taskname ? taskname : "闂嵎" }}</div>
                   <div class="voice-audio">
-                    瀹屾暣璇煶锛�
-                    <mini-audio
+                    瀹屾暣璇煶锛�<mini-audio
                       :audio-source="
                         voice ? voice : '@assets/order/example.mp3'
                       "
-                    ></mini-audio>
+                    />
                   </div>
                   <div class="preview-left">
-                    <div v-for="item in voiceDatatop">
+                    <div v-for="item in voiceDatatop" :key="item.id">
                       <div class="leftside">
-                        <i class="el-icon-phone-outline"></i
-                        ><span>{{ item.questiontext }}</span>
+                        <i class="el-icon-phone-outline" /><span>{{
+                          item.questiontext
+                        }}</span>
                       </div>
                       <div class="offside">
-                        <i class="el-icon-user"></i>
+                        <i class="el-icon-user" />
                         <div class="offside-value">
                           <el-input
                             type="textarea"
                             :autosize="{ minRows: 1 }"
                             v-model="item.asrtext"
                             readonly
-                          ></el-input>
+                          />
                           <div>
                             <mini-audio
                               :audio-source="
@@ -456,7 +434,7 @@
                                   ? item.questionvoice
                                   : '@assets/order/example.mp3'
                               "
-                            ></mini-audio>
+                            />
                           </div>
                         </div>
                       </div>
@@ -469,10 +447,9 @@
         </div>
 
         <!-- 鍙冲崐閮ㄥ垎锛氬巻娆″欢缁姢鐞嗘湇鍔� -->
-        <!-- 鍙冲崐閮ㄥ垎锛氬巻娆″欢缁姢鐞嗘湇鍔� -->
         <div class="continuity-history">
           <div class="sub-headline">
-            <i class="el-icon-time"></i> 鍘嗘寤剁画鎶ょ悊鏈嶅姟
+            <i class="el-icon-time" /> 鍘嗘寤剁画鎶ょ悊鏈嶅姟
             <el-button
               type="primary"
               size="small"
@@ -501,9 +478,7 @@
                     :ref="'continuityForm' + index"
                     :model="item.form"
                     :rules="continuityRules"
-                    label-width="120px"
                   >
-                    <!-- 寤剁画闂琛ㄥ崟 -->
                     <el-form-item label="寤剁画闂" prop="continuityProblems">
                       <div class="continuity-problems-form">
                         <div class="problems-header">
@@ -513,12 +488,17 @@
                             size="small"
                             icon="el-icon-plus"
                             @click="addContinuityProblem(index)"
+                            >鏂板闂锛堜粠宸叉湁閫夋嫨锛�</el-button
                           >
-                            鏂板闂
-                          </el-button>
+                          <el-button
+                            type="text"
+                            size="small"
+                            icon="el-icon-edit"
+                            @click="addCustomProblem(index)"
+                            >鑷畾涔夐棶棰�</el-button
+                          >
                         </div>
-
-                        <!-- 宸查�夊彇鐨勯棶棰樺垪琛� -->
+                        <!-- 闂鍒楄〃 -->
                         <div
                           v-if="
                             item.form.continuityProblems &&
@@ -539,7 +519,7 @@
                                 >
                                 <el-select
                                   v-model="problem.questionId"
-                                  placeholder="閫夋嫨闂"
+                                  placeholder="閫夋嫨宸叉湁闂"
                                   size="small"
                                   style="width: 300px; margin: 0 10px"
                                   @change="
@@ -549,6 +529,7 @@
                                       $event
                                     )
                                   "
+                                  :disabled="problem.isCustom"
                                 >
                                   <el-option
                                     v-for="q in availableQuestions"
@@ -562,7 +543,6 @@
                                     >
                                   </el-option>
                                 </el-select>
-                                <!-- 淇锛氫紶閫掓纭殑绱㈠紩 -->
                                 <el-button
                                   type="danger"
                                   icon="el-icon-delete"
@@ -571,34 +551,146 @@
                                   @click="
                                     removeContinuityProblem(index, problemIndex)
                                   "
-                                >
-                                </el-button>
+                                />
                               </div>
 
-                              <!-- 闂嵎寮忛棶棰樺睍绀哄尯鍩� -->
+                              <!-- ========== 鑷畾涔夐棶棰樼紪杈戝尯 ========== -->
                               <div
-                                v-if="problem.questionId"
+                                v-if="problem.isCustom"
+                                class="custom-editor"
+                              >
+                                <el-form-item
+                                  label="棰樼洰鍐呭"
+                                  style="margin-bottom: 10px"
+                                >
+                                  <el-input
+                                    v-model="problem.customText"
+                                    placeholder="璇疯緭鍏ラ棶棰樺唴瀹�"
+                                    size="small"
+                                    clearable
+                                  />
+                                </el-form-item>
+                                <el-form-item
+                                  label="棰樺瀷"
+                                  style="margin-bottom: 10px"
+                                >
+                                  <el-radio-group
+                                    v-model="problem.customType"
+                                    size="small"
+                                  >
+                                    <el-radio-button :label="1"
+                                      >鍗曢�夐</el-radio-button
+                                    >
+                                    <el-radio-button :label="2"
+                                      >澶氶�夐</el-radio-button
+                                    >
+                                    <el-radio-button :label="4"
+                                      >闂瓟棰�</el-radio-button
+                                    >
+                                  </el-radio-group>
+                                </el-form-item>
+                                <el-form-item
+                                  v-if="
+                                    problem.customType === 1 ||
+                                    problem.customType === 2
+                                  "
+                                  label="閫夐」"
+                                  style="margin-bottom: 10px"
+                                >
+                                  <div
+                                    v-for="(opt, idx) in problem.customOptions"
+                                    :key="idx"
+                                    class="option-row"
+                                  >
+                                    <el-input
+                                      v-model="opt.optioncontent"
+                                      placeholder="璇疯緭鍏ラ�夐」鍐呭"
+                                      size="small"
+                                      style="width: 200px; margin-right: 10px"
+                                    />
+                                    <el-button
+                                      type="danger"
+                                      size="mini"
+                                      icon="el-icon-delete"
+                                      @click="
+                                        removeCustomOption(
+                                          index,
+                                          problemIndex,
+                                          idx
+                                        )
+                                      "
+                                    />
+                                  </div>
+                                  <el-button
+                                    type="primary"
+                                    size="mini"
+                                    @click="
+                                      addCustomOption(index, problemIndex)
+                                    "
+                                    >娣诲姞閫夐」</el-button
+                                  >
+                                </el-form-item>
+                                <el-form-item label="绛旀">
+                                  <!-- 鍗曢�� -->
+                                  <el-radio-group
+                                    v-if="problem.customType === 1"
+                                    v-model="problem.customAnswer"
+                                  >
+                                    <el-radio
+                                      v-for="opt in problem.customOptions"
+                                      :key="opt.optioncontent"
+                                      :label="opt.optioncontent"
+                                    >
+                                      {{ opt.optioncontent }}
+                                    </el-radio>
+                                  </el-radio-group>
+                                  <!-- 澶氶�� -->
+                                  <el-checkbox-group
+                                    v-else-if="problem.customType === 2"
+                                    v-model="problem.customAnswer"
+                                  >
+                                    <el-checkbox
+                                      v-for="opt in problem.customOptions"
+                                      :key="opt.optioncontent"
+                                      :label="opt.optioncontent"
+                                    >
+                                      {{ opt.optioncontent }}
+                                    </el-checkbox>
+                                  </el-checkbox-group>
+                                  <!-- 闂瓟 -->
+                                  <el-input
+                                    v-else-if="problem.customType === 4"
+                                    v-model="problem.customAnswer"
+                                    placeholder="璇疯緭鍏ョ瓟妗�"
+                                    size="small"
+                                    style="width: 300px"
+                                  />
+                                  <span v-else style="color: #999"
+                                    >璇峰厛閫夋嫨棰樺瀷</span
+                                  >
+                                </el-form-item>
+                              </div>
+
+                              <!-- ========== 闈炶嚜瀹氫箟锛氬睍绀哄凡鏈夐棶棰� ========== -->
+                              <div
+                                v-else-if="
+                                  problem.questionId &&
+                                  getQuestionOriginalData(problem.questionId)
+                                "
                                 class="question-display-area"
                               >
-                                <!-- 鏍规嵁闂绫诲瀷鍔ㄦ�佹覆鏌� -->
-                                <div
-                                  v-if="
-                                    getQuestionOriginalData(problem.questionId)
-                                  "
-                                  class="question-render"
-                                >
-                                  <!-- 鍗曢�夌被鍨� -->
+                                <div class="question-item-render">
+                                  <!-- 鍗曢�� -->
                                   <div
                                     v-if="
                                       getQuestionOriginalData(
                                         problem.questionId
                                       ).scriptType == 1
                                     "
-                                    class="question-item-render"
                                   >
                                     <div class="question-text">
-                                      <strong>[鍗曢�塢</strong>
-                                      <span>{{
+                                      <strong>[鍗曢�塢</strong
+                                      ><span>{{
                                         getQuestionOriginalData(
                                           problem.questionId
                                         ).scriptContent
@@ -609,44 +701,39 @@
                                         v-model="problem.selectedOption"
                                       >
                                         <el-radio
-                                          v-for="option in getQuestionOriginalData(
+                                          v-for="opt in getQuestionOriginalData(
                                             problem.questionId
                                           ).svyTaskTemplateTargetoptions"
-                                          :key="option.optioncontent"
-                                          :label="option.optioncontent"
-                                          :class="getOptionClass(option)"
+                                          :key="opt.optioncontent"
+                                          :label="opt.optioncontent"
+                                          :class="getOptionClass(opt)"
+                                          >{{ opt.optioncontent }}</el-radio
                                         >
-                                          {{ option.optioncontent }}
-                                        </el-radio>
                                       </el-radio-group>
                                     </div>
-                                    <!-- 闄勫姞杈撳叆妗� -->
                                     <div
                                       v-if="problem.showAppendInput"
                                       class="append-input"
-                                      style="margin-top: 10px"
                                     >
                                       <el-input
                                         type="textarea"
                                         :rows="2"
                                         placeholder="璇疯緭鍏ュ叿浣撲俊鎭�"
                                         v-model="problem.appendInput"
-                                      ></el-input>
+                                      />
                                     </div>
                                   </div>
-
-                                  <!-- 澶氶�夌被鍨� -->
+                                  <!-- 澶氶�� -->
                                   <div
                                     v-else-if="
                                       getQuestionOriginalData(
                                         problem.questionId
                                       ).scriptType == 2
                                     "
-                                    class="question-item-render"
                                   >
                                     <div class="question-text">
-                                      <strong>[澶氶�塢</strong>
-                                      <span>{{
+                                      <strong>[澶氶�塢</strong
+                                      ><span>{{
                                         getQuestionOriginalData(
                                           problem.questionId
                                         ).scriptContent
@@ -657,38 +744,35 @@
                                         v-model="problem.selectedOptions"
                                       >
                                         <el-checkbox
-                                          v-for="option in getQuestionOriginalData(
+                                          v-for="opt in getQuestionOriginalData(
                                             problem.questionId
                                           ).svyTaskTemplateTargetoptions"
-                                          :key="option.optioncontent"
-                                          :label="option.optioncontent"
+                                          :key="opt.optioncontent"
+                                          :label="opt.optioncontent"
                                           :class="
-                                            option.isabnormal ? 'red-star' : ''
+                                            opt.isabnormal ? 'red-star' : ''
                                           "
+                                          >{{ opt.optioncontent }}</el-checkbox
                                         >
-                                          {{ option.optioncontent }}
-                                        </el-checkbox>
                                       </el-checkbox-group>
                                     </div>
                                   </div>
-
-                                  <!-- 濉┖/闂瓟绫诲瀷 -->
+                                  <!-- 闂瓟 -->
                                   <div
                                     v-else-if="
                                       getQuestionOriginalData(
                                         problem.questionId
                                       ).scriptType == 4
                                     "
-                                    class="question-item-render"
                                   >
                                     <div class="question-text">
-                                      <strong>[闂瓟]</strong>
-                                      <span>{{
+                                      <strong>[闂瓟]</strong
+                                      ><span>{{
                                         getQuestionOriginalData(
                                           problem.questionId
                                         ).scriptContent
-                                      }}</span>
-                                      <span
+                                      }}</span
+                                      ><span
                                         v-if="
                                           getQuestionOriginalData(
                                             problem.questionId
@@ -708,7 +792,7 @@
                                         placeholder="璇疯緭鍏ョ瓟妗�"
                                         v-model="problem.answer"
                                         style="width: 200px"
-                                      ></el-input>
+                                      />
                                       <el-input
                                         v-else
                                         type="textarea"
@@ -716,16 +800,13 @@
                                         placeholder="璇疯緭鍏ョ瓟妗�"
                                         v-model="problem.answer"
                                         style="width: 100%"
-                                      ></el-input>
+                                      />
                                     </div>
                                   </div>
                                 </div>
-                                <div v-else class="no-question-data">
-                                  闂鏁版嵁鍔犺浇涓�...
-                                </div>
                               </div>
 
-                              <!-- 鍘熸湁鐨勯棶棰樻弿杩扮瓑瀛楁 -->
+                              <!-- 闂鐘舵�佸拰瑙e喅鏃ユ湡 -->
                               <div class="problem-detail">
                                 <div class="detail-row">
                                   <span class="detail-label">褰撳墠鐘舵�侊細</span>
@@ -735,31 +816,26 @@
                                     size="small"
                                     style="width: 120px; margin-right: 20px"
                                   >
-                                    <el-option
-                                      label="鏈鐞�"
-                                      value="pending"
-                                    ></el-option>
+                                    <el-option label="鏈鐞�" value="pending" />
                                     <el-option
                                       label="澶勭悊涓�"
                                       value="processing"
-                                    ></el-option>
+                                    />
                                     <el-option
                                       label="宸茶В鍐�"
                                       value="resolved"
-                                    ></el-option>
+                                    />
                                     <el-option
                                       label="鎸佺画鍏虫敞"
                                       value="watching"
-                                    ></el-option>
+                                    />
                                   </el-select>
-
                                   <span
-                                    class="detail-label"
                                     v-if="problem.status === 'resolved'"
+                                    class="detail-label"
                                     style="margin-left: 20px"
+                                    >瑙e喅鏃ユ湡锛�</span
                                   >
-                                    瑙e喅鏃ユ湡锛�
-                                  </span>
                                   <el-date-picker
                                     v-if="problem.status === 'resolved'"
                                     v-model="problem.resolvedDate"
@@ -767,29 +843,19 @@
                                     placeholder="閫夋嫨瑙e喅鏃ユ湡"
                                     value-format="yyyy-MM-dd"
                                     size="small"
-                                    style="width: 150px; margin-left: 10px"
-                                  ></el-date-picker>
+                                    style="width: 150px"
+                                  />
                                 </div>
-
-                                <!-- <div class="detail-row">
-                                  <span class="detail-label">闂鎻忚堪锛�</span>
-                                  <el-input
-                                    type="textarea"
-                                    :rows="2"
-                                    v-model="problem.description"
-                                    placeholder="璇疯缁嗘弿杩拌寤剁画闂锛堝彲璁板綍璇勪及缁撴灉銆佸鐞嗗缓璁瓑锛�"
-                                    size="small"
-                                    style="flex: 1"
-                                  ></el-input>
-                                </div> -->
                               </div>
                             </div>
                           </div>
                         </div>
+                        <div v-else class="empty-problems">
+                          鏆傛棤寤剁画闂锛岃鐐瑰嚮涓婃柟鎸夐挳娣诲姞
+                        </div>
                       </div>
                     </el-form-item>
 
-                    <!-- 寤剁画鎬ф姢鐞嗚褰� -->
                     <el-form-item label="鎶ょ悊璁板綍" prop="careRecord">
                       <el-input
                         type="textarea"
@@ -797,10 +863,8 @@
                         v-model="item.form.careRecord"
                         placeholder="璇疯緭鍏ュ欢缁�ф姢鐞嗚褰�"
                         clearable
-                      ></el-input>
+                      />
                     </el-form-item>
-
-                    <!-- 璐d换鎶ゅ+銆佸洖璁垮舰寮忋�佹湇鍔℃椂闂� -->
                     <el-row :gutter="20">
                       <el-col :span="12">
                         <el-form-item label="璐d换鎶ゅ+" prop="dutyNurse">
@@ -808,7 +872,7 @@
                             v-model="item.form.dutyNurse"
                             placeholder="璇疯緭鍏ヨ矗浠绘姢澹�"
                             clearable
-                          ></el-input>
+                          />
                         </el-form-item>
                       </el-col>
                       <el-col :span="12">
@@ -819,23 +883,11 @@
                             style="width: 100%"
                             clearable
                           >
-                            <el-option
-                              label="鐢佃瘽鍥炶"
-                              value="phone"
-                            ></el-option>
-                            <el-option
-                              label="涓婇棬鍥炶"
-                              value="home"
-                            ></el-option>
-                            <el-option
-                              label="闂ㄨ瘖鍥炶"
-                              value="clinic"
-                            ></el-option>
-                            <el-option
-                              label="寰俊鍥炶"
-                              value="wechat"
-                            ></el-option>
-                            <el-option label="鍏朵粬" value="other"></el-option>
+                            <el-option label="鐢佃瘽鍥炶" value="phone" />
+                            <el-option label="涓婇棬鍥炶" value="home" />
+                            <el-option label="闂ㄨ瘖鍥炶" value="clinic" />
+                            <el-option label="寰俊鍥炶" value="wechat" />
+                            <el-option label="鍏朵粬" value="other" />
                           </el-select>
                         </el-form-item>
                       </el-col>
@@ -852,14 +904,15 @@
                             placeholder="閫夋嫨涓嬫寤剁画鏈嶅姟鏃堕棿"
                             value-format="yyyy-MM-dd HH:mm:ss"
                             style="width: 100%"
-                          >
-                          </el-date-picker>
+                          />
                           <div
                             class="time-tip"
                             v-if="item.form.nextServiceTime"
                           >
                             璺濅笅娆℃湇鍔¤繕鏈�
-                            {{ calculateDaysLeft(item.form.nextServiceTime) }}
+                            {{
+                              calculateDaysLeft(item.form.nextServiceTime)
+                            }}
                             澶�
                           </div>
                         </el-form-item>
@@ -872,26 +925,20 @@
                             placeholder="閫夋嫨鏈嶅姟鏃堕棿"
                             value-format="yyyy-MM-dd HH:mm:ss"
                             style="width: 100%"
-                          >
-                          </el-date-picker>
+                          />
                         </el-form-item>
                       </el-col>
                     </el-row>
-
-                    <!-- 涓嬫寤剁画鏈嶅姟鏃堕棿 -->
-
-                    <!-- 鎿嶄綔鎸夐挳 -->
                     <el-form-item>
                       <el-button
                         type="primary"
                         @click="saveContinuityTab(index)"
                         :loading="item.saving"
+                        >淇濆瓨</el-button
                       >
-                        淇濆瓨
-                      </el-button>
-                      <el-button @click="resetContinuityTab(index)">
-                        閲嶇疆
-                      </el-button>
+                      <el-button @click="resetContinuityTab(index)"
+                        >閲嶇疆</el-button
+                      >
                     </el-form-item>
                   </el-form>
                 </div>
@@ -903,6 +950,7 @@
     </div>
   </div>
 </template>
+
 <script>
 import {
   getsearchrResults,
@@ -920,7 +968,6 @@
   dicts: ["sys_yujing"],
   data() {
     return {
-      // 璺敱鍙傛暟
       taskid: "",
       id: "",
       sendname: "",
@@ -928,7 +975,6 @@
       Voicetype: 0,
       serviceType: "",
 
-      // 闅忚鍐呭鐩稿叧
       activeName: "wj",
       taskname: "",
       voice: "",
@@ -936,10 +982,10 @@
       voiceDatatop: [],
       form: {},
       userform: {},
-      // 鏂板锛氶棶棰橀�夋嫨鐩稿叧
+
       showQuestionSelector: false,
       selectedQuestionIds: [],
-      // 鎮h�呭熀纭�淇℃伅琛ㄥ崟
+
       patientForm: {
         name: "",
         sex: "",
@@ -970,12 +1016,10 @@
       },
       savingPatientInfo: false,
 
-      // 寤剁画鎶ょ悊鐩稿叧
       activeContinuityTab: "continuity-0",
       continuityTabs: [],
       continuityTabIndex: 0,
       continuityRules: {
-        // 绉婚櫎continuityProblems鐨勯獙璇佽鍒�
         careRecord: [
           { required: true, message: "璇疯緭鍏ユ姢鐞嗚褰�", trigger: "blur" },
         ],
@@ -988,15 +1032,10 @@
         serviceTime: [
           { required: true, message: "璇烽�夋嫨鏈嶅姟鏃堕棿", trigger: "change" },
         ],
-        nextServiceTime: [
-          { required: true, message: "璇烽�夋嫨涓嬫鏈嶅姟鏃堕棿", trigger: "change" },
-        ],
       },
 
-      // 鍙�夌殑寤剁画闂锛堜粠宸︿晶闂嵎涓彁鍙栵級
       availableQuestions: [],
 
-      // 寤剁画鎶ょ悊姹囨�讳俊鎭�
       continuitySummary: {
         continueCount: 0,
         continueTimeNow: "",
@@ -1004,7 +1043,6 @@
         continueContent: "",
       },
 
-      // 鍏朵粬
       logsheetlist: [],
     };
   },
@@ -1015,34 +1053,21 @@
     this.patid = this.$route.query.patid;
     this.Voicetype = this.$route.query.Voicetype || 0;
     this.serviceType = this.$route.query.serviceType;
-
     this.getTaskservelist(this.id);
   },
   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";
-      }
+      if (item.isabnormal == 1) return "scriptTopic-isabnormal";
+      else if (item.isabnormal == 2) return "scriptTopic-warning";
+      else return "scriptTopic-dev";
     },
-
-    // 鑾峰彇閫夐」鏍峰紡绫�
     getOptionClass(items) {
-      if (items.isabnormal == 1) {
-        return "red-star";
-      } else if (items.isabnormal == 2) {
-        return "yellow-star";
-      }
+      if (items.isabnormal == 1) return "red-star";
+      else if (items.isabnormal == 2) return "yellow-star";
       return "";
     },
 
-    // 鑾峰彇闂嵎鏁版嵁
+    // ---- 闂嵎鏁版嵁鍔犺浇 ----
     getsearchrResults(id) {
       getsearchrResults({
         taskid: this.taskid,
@@ -1052,7 +1077,6 @@
       }).then((res) => {
         if (res.code === 200) {
           this.tableDatatop = res.data.scriptResult;
-
           this.tableDatatop.forEach((item) => {
             if (item.scriptType == 2) item.scriptResult = [];
             if (item.scriptResultId && item.scriptType != 2) {
@@ -1065,18 +1089,18 @@
           });
           this.taskname = res.data.taskName;
           this.overdata();
-          // 鎻愬彇鍙�夌殑寤剁画闂
           this.extractAvailableQuestions();
+          // 鍔犺浇鍘嗗彶寤剁画鎶ょ悊锛堟鏃� availableQuestions 宸插氨缁級
+          this.loadContinuityHistory();
         }
       });
     },
     overdata() {
       this.tableDatatop.forEach((item, index) => {
-        var obj = item.svyTaskTemplateTargetoptions.find(
+        const obj = item.svyTaskTemplateTargetoptions.find(
           (items) => items.optioncontent == item.scriptResult
         );
         if (obj) {
-          console.log(obj, "obj");
           if (obj.isabnormal) {
             this.tableDatatop[index].isabnormal = obj.isabnormal;
           }
@@ -1084,7 +1108,6 @@
         }
       });
     },
-    // 鎻愬彇鍙�夌殑寤剁画闂
     extractAvailableQuestions() {
       this.availableQuestions = this.tableDatatop
         .filter(
@@ -1096,136 +1119,29 @@
           text: item.scriptContent,
           originalIndex: index,
         }));
-    }, // 鍒囨崲闂閫夋嫨闈㈡澘鏄剧ず
+    },
+
+    // ---- 闂閫夊彇 ----
     toggleQuestionSelection() {
       this.showQuestionSelector = !this.showQuestionSelector;
-      if (this.showQuestionSelector) {
-        // 閲嶇疆閫夋嫨
-        this.selectedQuestionIds = [];
-      }
+      if (this.showQuestionSelector) this.selectedQuestionIds = [];
     },
-    // 娣诲姞寤剁画闂
-    addContinuityProblem(tabIndex) {
-      this.continuityTabs[tabIndex].form.continuityProblems.push({
-        questionId: "",
-        status: "pending",
-        description: "",
-        resolvedDate: "",
-        createTime: new Date().toISOString(),
-        // 鏂板瀛楁锛岀敤浜庨棶鍗峰紡浜や簰
-        selectedOption: "", // 鍗曢�夌瓟妗�
-        selectedOptions: [], // 澶氶�夌瓟妗�
-        answer: "", // 濉┖绛旀
-        showAppendInput: false, // 鏄惁鏄剧ず闄勫姞杈撳叆妗�
-        appendInput: "", // 闄勫姞杈撳叆鍐呭
-      });
-    },
-    // 鏍规嵁闂ID鑾峰彇鍘熷闂鏁版嵁
-    getQuestionOriginalData(questionId) {
-      if (!questionId) return null;
-      const originalIndex = this.availableQuestions.find(
-        (q) => q.id === questionId
-      )?.originalIndex;
-      if (originalIndex !== undefined && this.tableDatatop[originalIndex]) {
-        return this.tableDatatop[originalIndex];
-      }
-      return null;
-    },
-    // 绉婚櫎寤剁画闂
-    removeContinuityProblem(tabIndex, problemIndex) {
-      this.continuityTabs[tabIndex].form.continuityProblems.splice(
-        problemIndex,
-        1
-      );
-    },
-
-    // 澶勭悊闂閫夋嫨鍙樻洿
-    handleProblemChange(tabIndex, problemIndex, questionId) {
-      const problem =
-        this.continuityTabs[tabIndex].form.continuityProblems[problemIndex];
-
-      if (!questionId) {
-        problem.description = "";
-        // 娓呯┖绛旀瀛楁
-        problem.selectedOption = "";
-        problem.selectedOptions = [];
-        problem.answer = "";
-        problem.showAppendInput = false;
-        problem.appendInput = "";
-        return;
-      }
-
-      // 鑷姩濉厖闂鎻忚堪
-      const question = this.availableQuestions.find((q) => q.id === questionId);
-      if (question) {
-        problem.description = `闂锛�${question.text}`;
-      }
-
-      // 鏍规嵁闂绫诲瀷鍒濆鍖栫瓟妗堝瓧娈�
-      const originalData = this.getQuestionOriginalData(questionId);
-      if (originalData) {
-        // 鍒濆鍖栧崟閫夌瓟妗�
-        if (originalData.scriptType === 1) {
-          problem.selectedOption = originalData.scriptResult || "";
-          // 妫�鏌ユ槸鍚﹂渶瑕佹樉绀洪檮鍔犺緭鍏ユ
-          problem.showAppendInput = originalData.showAppendInput || false;
-          problem.appendInput = originalData.answerps || "";
-        }
-        // 鍒濆鍖栧閫夌瓟妗�
-        else if (originalData.scriptType === 2) {
-          problem.selectedOptions = Array.isArray(originalData.scriptResult)
-            ? [...originalData.scriptResult]
-            : originalData.scriptResult
-            ? originalData.scriptResult.split("&")
-            : [];
-        }
-        // 鍒濆鍖栧~绌虹瓟妗�
-        else if (originalData.scriptType === 4) {
-          problem.answer = originalData.scriptResult || "";
-        }
-      }
-    },
-
-    // 鏍规嵁闂ID鑾峰彇闂鏂囨湰
-    getQuestionText(questionId) {
-      if (!questionId) return "鏈�夋嫨闂";
-      const question = this.availableQuestions.find((q) => q.id === questionId);
-      return question
-        ? `${question.index + 1}. ${question.text}`
-        : "闂宸插垹闄�";
-    },
-
-    // 鎴柇鏂囨湰
-    truncateText(text, length) {
-      if (!text) return "";
-      return text.length > length ? text.substring(0, length) + "..." : text;
-    },
-    // 纭闂閫夋嫨
     confirmQuestionSelection() {
       if (this.selectedQuestionIds.length === 0) {
         this.$modal.msgWarning("璇疯嚦灏戦�夋嫨涓�涓欢缁棶棰�");
         return;
       }
-
-      // 鑾峰彇褰撳墠婵�娲荤殑鏍囩椤电储寮�
       const activeTabIndex = this.continuityTabs.findIndex(
         (tab) => tab.name === this.activeContinuityTab
       );
-
       if (activeTabIndex === -1) {
         this.$modal.msgError("鏈壘鍒版縺娲荤殑寤剁画鎶ょ悊鏍囩椤�");
         return;
       }
-
-      // 娣诲姞閫変腑鐨勯棶棰樺埌褰撳墠鏍囩椤�
       this.selectedQuestionIds.forEach((questionId) => {
-        // 妫�鏌ユ槸鍚﹀凡瀛樺湪鐩稿悓闂
         const exists = this.continuityTabs[
           activeTabIndex
-        ].form.continuityProblems.some(
-          (problem) => problem.questionId === questionId
-        );
-
+        ].form.continuityProblems.some((p) => p.questionId === questionId);
         if (!exists) {
           this.continuityTabs[activeTabIndex].form.continuityProblems.push({
             questionId: questionId,
@@ -1233,35 +1149,31 @@
             description: "",
             resolvedDate: "",
             createTime: new Date().toISOString(),
+            isCustom: false,
+            customText: "",
+            customType: null,
+            customOptions: [],
+            customAnswer: "",
+            selectedOption: "",
+            selectedOptions: [],
+            answer: "",
+            showAppendInput: false,
+            appendInput: "",
           });
         }
       });
-
-      // 鍏抽棴閫夋嫨闈㈡澘
       this.showQuestionSelector = false;
       this.selectedQuestionIds = [];
-
-      this.$modal.msgSuccess(
-        `宸叉坊鍔� ${this.selectedQuestionIds.length} 涓欢缁棶棰榒
-      );
+      this.$modal.msgSuccess("宸叉坊鍔犻�変腑鐨勫欢缁棶棰�");
     },
 
-    // 绉婚櫎寤剁画闂
-    removeContinuityProblem(tabIndex, problemIndex) {
-      this.continuityTabs[tabIndex].form.continuityProblems.splice(
-        problemIndex,
-        1
-      );
-    },
-
-    // 鑾峰彇璇煶鏁版嵁
+    // ---- 璇煶鏁版嵁 ----
     getPersonVoices(id) {
-      let obj = {
+      const 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;
@@ -1276,27 +1188,22 @@
               item.scriptResult = [];
             }
           });
-
-          // 鎻愬彇鍙�夌殑寤剁画闂
           this.extractAvailableQuestions();
+          this.loadContinuityHistory();
         }
       });
     },
 
-    // 鑾峰彇鍩虹淇℃伅
+    // ---- 鎮h�呬俊鎭� ----
     getuserinfo() {
-      const queryParams = {
-        pid: Number(this.patid),
-        allhosp: "0",
-      };
-
-      messagelistpatient(queryParams).then((response) => {
-        if (response.rows[0]) {
-          this.userform = response.rows[0];
-          this.initPatientForm();
+      messagelistpatient({ pid: Number(this.patid), allhosp: "0" }).then(
+        (response) => {
+          if (response.rows[0]) {
+            this.userform = response.rows[0];
+            this.initPatientForm();
+          }
         }
-      });
-
+      );
       listcontactinformation({ patid: this.patid }).then((response) => {
         this.tableData = response.rows;
         if (this.tableData.length) {
@@ -1305,8 +1212,6 @@
         }
       });
     },
-
-    // 鍒濆鍖栨偅鑰呰〃鍗�
     initPatientForm() {
       if (this.userform) {
         this.patientForm.name = this.userform.name || "";
@@ -1316,7 +1221,6 @@
         this.patientForm.address = this.userform.placeOfResidence || "";
         this.patientForm.hospitalNumber = this.userform.medicalRecordNo || "";
       }
-
       if (this.form) {
         this.patientForm.dischargeDate =
           this.formatTime(this.form.endtime) || "";
@@ -1325,59 +1229,116 @@
       }
     },
 
-    // 鑾峰彇鎮h�呰褰�
+    // ---- 涓绘暟鎹姞杞� ----
     getTaskservelist(id) {
-      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
-          );
-          this.logsheetlist = res.rows[0].serviceSubtaskList;
-
-          // 鍒濆鍖栨偅鑰呬俊鎭�
-          this.initPatientForm();
-
-          // 鍔犺浇鍘嗗彶寤剁画鎶ょ悊鏁版嵁
-          this.loadContinuityHistory();
-          this.getuserinfo();
+      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
+            );
+            this.logsheetlist = res.rows[0].serviceSubtaskList;
+            this.initPatientForm();
+            this.getuserinfo();
+          }
+          if (this.Voicetype) {
+            this.getPersonVoices();
+          } else {
+            this.getsearchrResults();
+          }
         }
-
-        if (this.Voicetype) {
-          this.getPersonVoices();
-        } else {
-          this.getsearchrResults();
-        }
-      });
+      );
     },
 
-    // 鍔犺浇鍘嗗彶寤剁画鎶ょ悊鏁版嵁
+    // ---- 寤剁画鎶ょ悊鍘嗗彶鍔犺浇锛堝吋瀹硅嚜瀹氫箟锛� ----
     loadContinuityHistory() {
       if (this.form && this.form.continueContent) {
         try {
           const historyData = JSON.parse(this.form.continueContent);
-          this.continuityTabs = historyData.map((item, index) => ({
-            name: `continuity-${index}`,
-            title: `寤剁画鎶ょ悊${index + 1}`,
-            form: {
-              continuityProblems: item.continuityProblems || [],
-              careRecord: item.careRecord || "",
-              dutyNurse: item.dutyNurse || "",
-              visitType: item.visitType || "",
-              serviceTime: item.serviceTime || "",
-              nextServiceTime: item.nextServiceTime || "",
-            },
-            saving: false,
-          }));
+          this.continuityTabs = historyData.map((item, index) => {
+            const problems = (item.continuityProblems || []).map((problem) => {
+              // 澶勭悊鑷畾涔夐棶棰樺洖鏄�
+              const isCustom =
+                problem.questionId === "__CUSTOM__" ||
+                problem.isCustom === true;
+              if (isCustom) {
+                problem.isCustom = true;
+                problem.questionId = "__CUSTOM__";
+                if (!problem.customText && problem.description) {
+                  const match =
+                    problem.description.match(/鑷畾涔夐棶棰榌锛�:]\s*(.*)/);
+                  if (match) problem.customText = match[1];
+                }
+                if (!problem.customText) problem.customText = "锛堣嚜瀹氫箟闂锛�";
+                // 纭繚閫夐」鏁扮粍瀛樺湪
+                if (!Array.isArray(problem.customOptions))
+                  problem.customOptions = [];
+                if (!problem.customType) problem.customType = 1; // 榛樿鍗曢��
+                if (problem.customAnswer === undefined)
+                  problem.customAnswer = "";
+              } else if (
+                problem.customText &&
+                this.availableQuestions.length > 0
+              ) {
+                // 鏈夎嚜瀹氫箟鏂囨湰浣嗘湭鏍囪锛屼笖涓嶅湪宸叉湁鍒楄〃涓紝瑙嗕负鑷畾涔�
+                const exists = this.availableQuestions.some(
+                  (q) => q.id === problem.questionId
+                );
+                if (!exists) {
+                  problem.isCustom = true;
+                  problem.questionId = "__CUSTOM__";
+                  if (!problem.customText && problem.description) {
+                    const match =
+                      problem.description.match(/鑷畾涔夐棶棰榌锛�:]\s*(.*)/);
+                    if (match) problem.customText = match[1];
+                  }
+                  if (!problem.customText)
+                    problem.customText = "锛堣嚜瀹氫箟闂锛�";
+                  if (!Array.isArray(problem.customOptions))
+                    problem.customOptions = [];
+                  if (!problem.customType) problem.customType = 1;
+                  if (problem.customAnswer === undefined)
+                    problem.customAnswer = "";
+                }
+              }
+              // 纭繚瀛楁瀹屾暣
+              if (!problem.hasOwnProperty("selectedOption"))
+                problem.selectedOption = "";
+              if (!problem.hasOwnProperty("selectedOptions"))
+                problem.selectedOptions = [];
+              if (!problem.hasOwnProperty("answer")) problem.answer = "";
+              if (!problem.hasOwnProperty("showAppendInput"))
+                problem.showAppendInput = false;
+              if (!problem.hasOwnProperty("appendInput"))
+                problem.appendInput = "";
+              if (!problem.hasOwnProperty("status")) problem.status = "pending";
+              if (!problem.hasOwnProperty("description"))
+                problem.description = "";
+              if (!problem.hasOwnProperty("resolvedDate"))
+                problem.resolvedDate = "";
+              if (!problem.hasOwnProperty("createTime"))
+                problem.createTime = new Date().toISOString();
+              return problem;
+            });
+
+            return {
+              name: `continuity-${index}`,
+              title: `寤剁画鎶ょ悊${index + 1}`,
+              form: {
+                continuityProblems: problems,
+                careRecord: item.careRecord || "",
+                dutyNurse: item.dutyNurse || "",
+                visitType: item.visitType || "",
+                serviceTime: item.serviceTime || "",
+                nextServiceTime: item.nextServiceTime || "",
+              },
+              saving: false,
+            };
+          });
 
           if (this.continuityTabs.length > 0) {
             this.activeContinuityTab = this.continuityTabs[0].name;
           }
-
-          // 鏇存柊姹囨�讳俊鎭�
           this.updateContinuitySummary();
         } catch (error) {
           console.error("瑙f瀽寤剁画鎶ょ悊鍘嗗彶鏁版嵁澶辫触:", error);
@@ -1385,26 +1346,9 @@
       }
     },
 
-    // 鏇存柊寤剁画鎶ょ悊姹囨�讳俊鎭�
-    updateContinuitySummary() {
-      if (this.form) {
-        this.continuitySummary.continueCount = this.form.continueCount || 0;
-        this.continuitySummary.continueTimeNow =
-          this.form.continueTimeNow || "";
-        this.continuitySummary.continueTimeNext =
-          this.form.continueTimeNext || "";
-        this.continuitySummary.continueContent =
-          this.form.continueContent || "";
-      }
-    },
-
-    // 娣诲姞寤剁画鎶ょ悊鏍囩椤�
+    // ---- 寤剁画鎶ょ悊 Tab 绠$悊 ----
     addContinuityTab() {
-      console.log(this.continuityTabs.length);
-      if (this.continuityTabs.length) {
-        this.continuityTabIndex = this.continuityTabs.length;
-      }
-      const newIndex = this.continuityTabIndex + 1;
+      const newIndex = this.continuityTabs.length + 1;
       const newTab = {
         name: `continuity-${newIndex}`,
         title: `寤剁画鎶ょ悊${newIndex}`,
@@ -1418,153 +1362,234 @@
         },
         saving: false,
       };
-
       this.continuityTabs.push(newTab);
-      this.continuityTabIndex = newIndex;
       this.activeContinuityTab = newTab.name;
     },
-
-    // 绉婚櫎寤剁画鎶ょ悊鏍囩椤�
     removeContinuityTab(targetName) {
-      const tabs = this.continuityTabs;
       let activeName = this.activeContinuityTab;
-
       if (activeName === targetName) {
+        const tabs = this.continuityTabs;
         tabs.forEach((tab, index) => {
           if (tab.name === targetName) {
             const nextTab = tabs[index + 1] || tabs[index - 1];
-            if (nextTab) {
-              activeName = nextTab.name;
-            }
+            if (nextTab) activeName = nextTab.name;
           }
         });
       }
-
       this.activeContinuityTab = activeName;
-      this.continuityTabs = tabs.filter((tab) => tab.name !== targetName);
+      this.continuityTabs = this.continuityTabs.filter(
+        (tab) => tab.name !== targetName
+      );
     },
-
-    // 澶勭悊鏍囩椤电偣鍑�
     handleTabClick(tab) {
       this.activeContinuityTab = tab.name;
     },
 
-    // 璁$畻璺濈涓嬫鏈嶅姟杩樻湁澶氬皯澶�
-    calculateDaysLeft(nextServiceTime) {
-      if (!nextServiceTime) return 0;
-
-      const nextTime = new Date(nextServiceTime);
-      const now = new Date();
-      const diffTime = nextTime - now;
-      const diffDays = Math.ceil(diffTime / (1000 * 60 * 60 * 24));
-
-      return diffDays > 0 ? diffDays : 0;
+    // ---- 寤剁画闂绠$悊锛堝凡鏈夐棶棰橈級 ----
+    addContinuityProblem(tabIndex) {
+      this.continuityTabs[tabIndex].form.continuityProblems.push({
+        questionId: "",
+        status: "pending",
+        description: "",
+        resolvedDate: "",
+        createTime: new Date().toISOString(),
+        isCustom: false,
+        customText: "",
+        customType: null,
+        customOptions: [],
+        customAnswer: "",
+        selectedOption: "",
+        selectedOptions: [],
+        answer: "",
+        showAppendInput: false,
+        appendInput: "",
+      });
+    },
+    removeContinuityProblem(tabIndex, problemIndex) {
+      this.continuityTabs[tabIndex].form.continuityProblems.splice(
+        problemIndex,
+        1
+      );
+    },
+    handleProblemChange(tabIndex, problemIndex, questionId) {
+      const problem =
+        this.continuityTabs[tabIndex].form.continuityProblems[problemIndex];
+      // 濡傛灉鍒囨崲涓哄凡鏈夐棶棰橈紝娓呴櫎鑷畾涔夌姸鎬�
+      if (questionId) {
+        problem.isCustom = false;
+        problem.customText = "";
+        problem.customType = null;
+        problem.customOptions = [];
+        problem.customAnswer = "";
+        // 鑷姩濉厖鎻忚堪
+        const question = this.availableQuestions.find(
+          (q) => q.id === questionId
+        );
+        if (question) problem.description = `闂锛�${question.text}`;
+        // 鍒濆鍖栫瓟妗堝瓧娈�
+        const originalData = this.getQuestionOriginalData(questionId);
+        if (originalData) {
+          if (originalData.scriptType === 1) {
+            problem.selectedOption = originalData.scriptResult || "";
+            problem.showAppendInput = originalData.showAppendInput || false;
+            problem.appendInput = originalData.answerps || "";
+          } else if (originalData.scriptType === 2) {
+            problem.selectedOptions = Array.isArray(originalData.scriptResult)
+              ? [...originalData.scriptResult]
+              : originalData.scriptResult
+              ? originalData.scriptResult.split("&")
+              : [];
+          } else if (originalData.scriptType === 4) {
+            problem.answer = originalData.scriptResult || "";
+          }
+        }
+      } else {
+        // 鏈�夋嫨闂
+        problem.description = "";
+        problem.selectedOption = "";
+        problem.selectedOptions = [];
+        problem.answer = "";
+        problem.showAppendInput = false;
+        problem.appendInput = "";
+      }
     },
 
-    // 淇濆瓨寤剁画鎶ょ悊鏍囩椤�
+    // ---- 鑷畾涔夐棶棰樼浉鍏� ----
+    addCustomProblem(tabIndex) {
+      this.continuityTabs[tabIndex].form.continuityProblems.push({
+        questionId: "__CUSTOM__",
+        isCustom: true,
+        customText: "",
+        customType: 1, // 榛樿鍗曢��
+        customOptions: [{ optioncontent: "" }],
+        customAnswer: "",
+        status: "pending",
+        description: "",
+        resolvedDate: "",
+        createTime: new Date().toISOString(),
+        selectedOption: "",
+        selectedOptions: [],
+        answer: "",
+        showAppendInput: false,
+        appendInput: "",
+      });
+    },
+    addCustomOption(tabIndex, problemIndex) {
+      const problem =
+        this.continuityTabs[tabIndex].form.continuityProblems[problemIndex];
+      problem.customOptions.push({ optioncontent: "" });
+    },
+    removeCustomOption(tabIndex, problemIndex, optionIndex) {
+      const problem =
+        this.continuityTabs[tabIndex].form.continuityProblems[problemIndex];
+      problem.customOptions.splice(optionIndex, 1);
+    },
+
+    // ---- 杈呭姪鏂规硶 ----
+    getQuestionOriginalData(questionId) {
+      if (!questionId) return null;
+      const found = this.availableQuestions.find((q) => q.id === questionId);
+      if (found && this.tableDatatop[found.originalIndex]) {
+        return this.tableDatatop[found.originalIndex];
+      }
+      return null;
+    },
+    truncateText(text, length) {
+      if (!text) return "";
+      return text.length > length ? text.substring(0, length) + "..." : text;
+    },
+
+    // ---- 淇濆瓨寤剁画鎶ょ悊 ----
     saveContinuityTab(index) {
       const formRef = this.$refs[`continuityForm${index}`];
       if (!formRef) return;
-
-      // 楠岃瘉鍩烘湰琛ㄥ崟
       formRef[0].validate((valid) => {
         if (valid) {
-          // 楠岃瘉寤剁画闂鏄惁瀹屾暣
           const problems = this.continuityTabs[index].form.continuityProblems;
           let hasError = false;
-
-          problems.forEach((problem, problemIndex) => {
-            if (!problem.questionId) {
-              hasError = true;
-              this.$modal.msgError(`绗�${problemIndex + 1}涓欢缁棶棰樻湭閫夋嫨`);
+          problems.forEach((problem, pIdx) => {
+            if (problem.isCustom) {
+              // 鑷畾涔夐棶棰樻牎楠�
+              if (!problem.customText || !problem.customText.trim()) {
+                hasError = true;
+                this.$modal.msgError(`绗�${pIdx + 1}涓嚜瀹氫箟闂鍐呭涓虹┖`);
+              }
+              if (
+                (problem.customType === 1 || problem.customType === 2) &&
+                problem.customOptions.some((opt) => !opt.optioncontent.trim())
+              ) {
+                hasError = true;
+                this.$modal.msgError(`绗�${pIdx + 1}涓嚜瀹氫箟闂瀛樺湪绌洪�夐」`);
+              }
+              if (problem.customType === 1 && !problem.customAnswer) {
+                hasError = true;
+                this.$modal.msgError(
+                  `绗�${pIdx + 1}涓嚜瀹氫箟闂锛堝崟閫夛級鏈�夋嫨绛旀`
+                );
+              }
+              if (
+                problem.customType === 2 &&
+                (!problem.customAnswer || problem.customAnswer.length === 0)
+              ) {
+                hasError = true;
+                this.$modal.msgError(
+                  `绗�${pIdx + 1}涓嚜瀹氫箟闂锛堝閫夛級鏈�夋嫨绛旀`
+                );
+              }
+              if (problem.customType === 4 && !problem.customAnswer) {
+                hasError = true;
+                this.$modal.msgError(
+                  `绗�${pIdx + 1}涓嚜瀹氫箟闂锛堥棶绛旓級鏈~鍐欑瓟妗坄
+                );
+              }
+            } else {
+              // 宸叉湁闂鏍¢獙
+              if (!problem.questionId) {
+                hasError = true;
+                this.$modal.msgError(`绗�${pIdx + 1}涓欢缁棶棰樻湭閫夋嫨`);
+              }
             }
           });
-
-          if (hasError) {
-            return false;
-          }
+          if (hasError) return;
 
           this.continuityTabs[index].saving = true;
-
-          // 鏇存柊姹囨�讳俊鎭�
           this.updateContinuitySummaryFromTabs();
-
-          // 璋冪敤淇濆瓨API
           this.saveContinuityData();
         } else {
           this.$modal.msgError("璇峰~鍐欏畬鏁翠俊鎭�");
-          return false;
         }
       });
     },
-
-    // 鏇存柊寤剁画鎶ょ悊姹囨�讳俊鎭�
     updateContinuitySummaryFromTabs() {
       if (this.continuityTabs.length === 0) return;
-
-      // 鎵惧埌鏈�鏂扮殑鏈嶅姟鏃堕棿
-      let latestTime = "";
-      let nextTime = "";
-      let totalProblems = 0;
-
+      let latestTime = "",
+        nextTime = "";
       this.continuityTabs.forEach((tab) => {
-        if (tab.form.serviceTime) {
-          if (
-            !latestTime ||
-            new Date(tab.form.serviceTime) > new Date(latestTime)
-          ) {
-            latestTime = tab.form.serviceTime;
-          }
+        if (
+          tab.form.serviceTime &&
+          (!latestTime || new Date(tab.form.serviceTime) > new Date(latestTime))
+        ) {
+          latestTime = tab.form.serviceTime;
         }
-        if (tab.form.nextServiceTime) {
-          if (
-            !nextTime ||
-            new Date(tab.form.nextServiceTime) < new Date(nextTime)
-          ) {
-            nextTime = tab.form.nextServiceTime;
-          }
+        if (
+          tab.form.nextServiceTime &&
+          (!nextTime || new Date(tab.form.nextServiceTime) < new Date(nextTime))
+        ) {
+          nextTime = tab.form.nextServiceTime;
         }
-
-        // 缁熻闂鏁伴噺
-        totalProblems += tab.form.continuityProblems.length;
       });
-
       this.continuitySummary.continueCount = this.continuityTabs.length;
       this.continuitySummary.continueTimeNow = latestTime;
       this.continuitySummary.continueTimeNext = nextTime;
-
-      // 鏋勫缓瀹屾暣鐨勫欢缁姢鐞嗘暟鎹�
       const continuityData = this.continuityTabs.map((tab) => ({
         ...tab.form,
         tabTitle: tab.title,
         tabName: tab.name,
       }));
-
       this.continuitySummary.continueContent = JSON.stringify(continuityData);
-      this.continuitySummary.totalProblems = totalProblems;
     },
-
-    // 淇濆瓨寤剁画鎶ょ悊鏁版嵁
     saveContinuityData() {
       const vm = this;
-
-      // 楠岃瘉姣忎釜闂鐨剄uestionId鏄惁宸查�夋嫨
-      let hasEmptyQuestion = false;
-      this.continuityTabs.forEach((tab, tabIndex) => {
-        tab.form.continuityProblems.forEach((problem, problemIndex) => {
-          if (!problem.questionId) {
-            hasEmptyQuestion = true;
-            vm.$modal.msgError(
-              `绗�${tabIndex + 1}涓爣绛鹃〉鐨勭${problemIndex + 1}涓棶棰樻湭閫夋嫨`
-            );
-          }
-        });
-      });
-
-      if (hasEmptyQuestion) {
-        return;
-      }
-
       const formData = {
         id: vm.id,
         patid: vm.patid,
@@ -1574,29 +1599,12 @@
         continueTimeNow: vm.continuitySummary.continueTimeNow,
         continueTimeNext: vm.continuitySummary.continueTimeNext,
         continueContent: vm.continuitySummary.continueContent,
-        // 鍙互娣诲姞闂嵎绛旀鐨勬暣鍚�
-        // questionnaireAnswers: vm.continuityTabs.map((tab) => ({
-        //   tabName: tab.name,
-        //   problems: tab.form.continuityProblems.map((problem) => ({
-        //     questionId: problem.questionId,
-        //     answer:
-        //       problem.selectedOption ||
-        //       problem.selectedOptions ||
-        //       problem.answer,
-        //     status: problem.status,
-        //     description: problem.description,
-        //   })),
-        // })),
       };
-
       Editsingletaskson(formData)
         .then((res) => {
           if (res.code === 200) {
             vm.$modal.msgSuccess("寤剁画鎶ょ悊璁板綍淇濆瓨鎴愬姛");
-            // 閲嶇疆淇濆瓨鐘舵��
-            vm.continuityTabs.forEach((tab) => {
-              tab.saving = false;
-            });
+            vm.continuityTabs.forEach((tab) => (tab.saving = false));
           } else {
             vm.$modal.msgError("淇濆瓨澶辫触");
           }
@@ -1604,13 +1612,9 @@
         .catch((error) => {
           console.error("淇濆瓨澶辫触:", error);
           vm.$modal.msgError("淇濆瓨澶辫触");
-          vm.continuityTabs.forEach((tab) => {
-            tab.saving = false;
-          });
+          vm.continuityTabs.forEach((tab) => (tab.saving = false));
         });
     },
-
-    // 閲嶇疆寤剁画鎶ょ悊鏍囩椤�
     resetContinuityTab(index) {
       this.continuityTabs[index].form = {
         continuityProblems: [],
@@ -1623,13 +1627,11 @@
       this.$refs[`continuityForm${index}`][0].clearValidate();
     },
 
-    // 淇濆瓨鎮h�呬俊鎭�
+    // ---- 鎮h�呬俊鎭繚瀛� ----
     savePatientInfo() {
       this.$refs.patientForm.validate((valid) => {
         if (valid) {
           this.savingPatientInfo = true;
-
-          // 鏇存柊userform鏁版嵁
           const updatedUserform = {
             ...this.userform,
             name: this.patientForm.name,
@@ -1639,7 +1641,6 @@
             placeOfResidence: this.patientForm.address,
             medicalRecordNo: this.patientForm.hospitalNumber,
           };
-
           alterpatient(updatedUserform)
             .then((res) => {
               if (res.code == 200) {
@@ -1657,47 +1658,56 @@
             });
         } else {
           this.$modal.msgError("璇峰~鍐欏畬鏁翠俊鎭�");
-          return false;
         }
       });
     },
-
-    // 閲嶇疆鎮h�呬俊鎭�
     resetPatientInfo() {
       this.initPatientForm();
       this.$refs.patientForm.clearValidate();
     },
 
-    // 鏃堕棿鏍煎紡鍖�
+    // ---- 宸ュ叿鏂规硶 ----
     formatTime(time) {
       if (!time) return "";
       return time.split(" ")[0];
     },
-
-    // 鏍煎紡鍖栨樉绀烘椂闂�
     formatDisplayTime(time) {
       if (!time) return "鏈缃�";
       return time.replace(" ", " ");
     },
-
-    // 寮傚父鍒楁覆鏌�
-    tableRowClassName({ row }) {
-      if (row.id == this.id) {
-        return "warning-row";
+    calculateDaysLeft(nextServiceTime) {
+      if (!nextServiceTime) return 0;
+      const diff = new Date(nextServiceTime) - new Date();
+      const days = Math.ceil(diff / (1000 * 60 * 60 * 24));
+      return days > 0 ? days : 0;
+    },
+    updateContinuitySummary() {
+      if (this.form) {
+        this.continuitySummary.continueCount = this.form.continueCount || 0;
+        this.continuitySummary.continueTimeNow =
+          this.form.continueTimeNow || "";
+        this.continuitySummary.continueTimeNext =
+          this.form.continueTimeNext || "";
+        this.continuitySummary.continueContent =
+          this.form.continueContent || "";
       }
+    },
+    tableRowClassName({ row }) {
+      if (row.id == this.id) return "warning-row";
       return "";
     },
   },
 };
 </script>
+
 <style lang="scss" scoped>
+/* 鍘熸湁鏍峰紡淇濇寔涓嶅彉锛屼粎澧炲姞鑷畾涔夌紪杈戠浉鍏虫牱寮� */
 .ContinuityCarePage {
   margin: 10px;
   display: flex;
   flex-direction: column;
   gap: 20px;
 }
-
 .headline {
   font-size: 20px;
   height: 40px;
@@ -1709,7 +1719,6 @@
   color: #333;
   font-weight: 600;
 }
-
 .sub-headline {
   font-size: 16px;
   height: 36px;
@@ -1721,14 +1730,11 @@
   font-weight: 500;
   border-bottom: 2px solid #e4e7ed;
   padding-bottom: 8px;
-
   i {
     margin-right: 8px;
     font-size: 18px;
   }
 }
-
-/* 绗竴閮ㄥ垎锛氭湇鍔″熀纭�淇℃伅 */
 .basic-info-section {
   margin: 0 10px;
   padding: 20px;
@@ -1736,43 +1742,35 @@
   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;
-
   .basic-info-container {
     display: flex;
     gap: 20px;
     min-height: 1000px;
-
     @media screen and (max-width: 1200px) {
       flex-direction: column;
     }
   }
-
   .followup-content {
     flex: 1;
     min-width: 0;
-
     &.readonly-content {
       background: #f8f9fa;
       border-radius: 8px;
       padding: 15px;
       border: 1px solid #e4e7ed;
     }
-
     .content-container {
       height: calc(1000px - 60px);
       overflow: hidden;
       display: flex;
       flex-direction: column;
-
       ::v-deep .el-tabs {
         flex: 1;
         display: flex;
         flex-direction: column;
-
         .el-tabs__content {
           flex: 1;
           overflow: hidden;
-
           .el-tab-pane {
             height: 100%;
             overflow: hidden;
@@ -1783,7 +1781,6 @@
       }
     }
   }
-
   .continuity-history {
     flex: 1;
     min-width: 0;
@@ -1792,41 +1789,28 @@
     padding: 15px;
     border: 1px solid #e4e7ed;
     box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
-
     .history-content {
       height: calc(1000px - 60px);
       overflow: hidden;
       display: flex;
       flex-direction: column;
-
       ::v-deep .el-tabs {
         flex: 1;
         display: flex;
         flex-direction: column;
-
+        min-height: 0;
         .el-tabs__content {
           flex: 1;
           overflow-y: auto;
+            min-height: 0;           // 鍏抽敭锛氶厤鍚� flex
           padding: 15px 0;
-
           .continuity-form {
             padding: 0 10px;
-
-            .el-form {
-              .selected-problems {
-                margin-top: 10px;
-                padding: 10px;
-                background: #f5f7fa;
-                border-radius: 4px;
-                border: 1px solid #e4e7ed;
-              }
-
-              .time-tip {
-                margin-top: 5px;
-                font-size: 12px;
-                color: #67c23a;
-                font-style: italic;
-              }
+            .el-form .time-tip {
+              margin-top: 5px;
+              font-size: 12px;
+              color: #67c23a;
+              font-style: italic;
             }
           }
         }
@@ -1834,7 +1818,6 @@
     }
   }
 }
-
 .patient-info-section {
   margin: 0 10px 20px 10px;
   padding: 20px;
@@ -1842,40 +1825,31 @@
   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;
-
-  .patient-info-form {
-    .continuity-summary {
-      padding: 15px;
-      background: #ddf0f8;
-      border-radius: 8px;
-      border: 1px solid #b3e0f2;
-
-      .summary-item {
-        display: inline-block;
-        margin-right: 30px;
-        margin-bottom: 8px;
-
-        .label {
-          font-weight: 500;
-          color: #333;
-        }
-
-        .value {
-          color: #409eff;
-          font-weight: 500;
-        }
+  .patient-info-form .continuity-summary {
+    padding: 15px;
+    background: #ddf0f8;
+    border-radius: 8px;
+    border: 1px solid #b3e0f2;
+    .summary-item {
+      display: inline-block;
+      margin-right: 30px;
+      margin-bottom: 8px;
+      .label {
+        font-weight: 500;
+        color: #333;
+      }
+      .value {
+        color: #409eff;
+        font-weight: 500;
       }
     }
   }
 }
-
-/* 鍏变韩鏍峰紡 */
 .CONTENT {
   padding: 10px;
   height: 100%;
   display: flex;
   flex-direction: column;
-
   .title {
     font-size: 18px;
     font-weight: bold;
@@ -1884,7 +1858,6 @@
     color: #333;
   }
 }
-
 .preview-left {
   margin: 10px;
   padding: 20px;
@@ -1894,11 +1867,9 @@
   overflow-y: auto;
   background: #fff;
   flex: 1;
-
   .topic-dev {
     margin-bottom: 20px;
     font-size: 16px;
-
     .dev-text {
       margin-bottom: 10px;
       font-weight: 500;
@@ -1906,7 +1877,6 @@
     }
   }
 }
-
 .scriptTopic-dev {
   padding: 15px;
   border-radius: 4px;
@@ -1914,7 +1884,6 @@
   border: 1px solid #e4e7ed;
   margin-bottom: 15px;
 }
-
 .scriptTopic-isabnormal {
   padding: 15px;
   border-radius: 4px;
@@ -1923,7 +1892,6 @@
   color: #f56c6c;
   margin-bottom: 15px;
 }
-
 .scriptTopic-warning {
   padding: 15px;
   border-radius: 4px;
@@ -1932,14 +1900,10 @@
   color: #e6a23c;
   margin-bottom: 15px;
 }
-
-.red-star {
-  ::v-deep.el-radio__label {
-    position: relative;
-    padding-right: 10px;
-  }
-
-  ::v-deep.el-radio__label::after {
+.red-star ::v-deep.el-radio__label {
+  position: relative;
+  padding-right: 10px;
+  &::after {
     content: "*";
     color: #f56c6c;
     position: absolute;
@@ -1947,14 +1911,10 @@
     top: 0;
   }
 }
-
-.yellow-star {
-  ::v-deep.el-radio__label {
-    position: relative;
-    padding-right: 10px;
-  }
-
-  ::v-deep.el-radio__label::after {
+.yellow-star ::v-deep.el-radio__label {
+  position: relative;
+  padding-right: 10px;
+  &::after {
     content: "*";
     color: #e6a23c;
     position: absolute;
@@ -1963,20 +1923,17 @@
     font-weight: bold;
   }
 }
-
 .borderdiv {
   height: 100%;
   padding: 10px;
   display: flex;
   flex-direction: column;
-
   .title {
     font-size: 18px;
     font-weight: bold;
     margin-bottom: 20px;
     text-align: center;
   }
-
   .voice-audio {
     display: flex;
     align-items: center;
@@ -1986,14 +1943,11 @@
     background: #f5f7fa;
     border-radius: 4px;
   }
-
   .preview-left {
     flex: 1;
     margin: 0;
-
     .leftside {
       margin: 15px 0;
-
       span {
         display: inline-block;
         padding: 8px 12px;
@@ -2004,12 +1958,10 @@
         margin-left: 10px;
       }
     }
-
     .offside {
       display: flex;
       flex-direction: row-reverse;
       margin: 15px 0;
-
       .offside-value {
         padding: 8px 12px;
         background: #67c23a;
@@ -2021,48 +1973,37 @@
     }
   }
 }
-
-/* 鍝嶅簲寮忚璁� */
 @media (max-width: 768px) {
   .ContinuityCarePage {
     margin: 5px;
     gap: 10px;
   }
-
   .basic-info-section,
   .patient-info-section {
     margin: 0 5px;
     padding: 10px;
   }
-
   .basic-info-container {
     gap: 10px !important;
   }
-
-  .patient-info-form {
-    .el-row {
-      flex-direction: column;
-    }
-
-    .el-col {
-      width: 100% !important;
-      margin-bottom: 10px;
-    }
+  .patient-info-form .el-row {
+    flex-direction: column;
   }
-
+  .patient-info-form .el-col {
+    width: 100% !important;
+    margin-bottom: 10px;
+  }
   .preview-left {
     margin: 5px;
     padding: 10px;
   }
 }
-/* 闂閫夋嫨鍣ㄩ潰鏉� */
 .question-selector-panel {
   margin-bottom: 20px;
   padding: 15px;
   background: #f8f9fa;
   border: 1px solid #e4e7ed;
   border-radius: 8px;
-
   .selector-header {
     display: flex;
     justify-content: space-between;
@@ -2070,18 +2011,15 @@
     margin-bottom: 15px;
     padding-bottom: 10px;
     border-bottom: 1px solid #e4e7ed;
-
     span {
       font-weight: 500;
       color: #333;
     }
   }
-
   .question-list {
     max-height: 200px;
     overflow-y: auto;
     padding-right: 10px;
-
     .question-item {
       margin-bottom: 10px;
       padding: 8px 12px;
@@ -2089,22 +2027,18 @@
       border-radius: 6px;
       border: 1px solid #e4e7ed;
       transition: all 0.3s;
-
       &:hover {
         border-color: #409eff;
         background: #f0f7ff;
       }
-
       .question-content {
         display: flex;
         align-items: flex-start;
-
         .question-index {
           font-weight: 600;
           color: #409eff;
           min-width: 30px;
         }
-
         .question-text {
           flex: 1;
           line-height: 1.5;
@@ -2113,8 +2047,6 @@
     }
   }
 }
-
-/* 寤剁画闂琛ㄥ崟 */
 .continuity-problems-form {
   .problems-header {
     display: flex;
@@ -2123,131 +2055,112 @@
     margin-bottom: 15px;
     padding-bottom: 10px;
     border-bottom: 1px solid #e4e7ed;
-
     span {
       font-weight: 500;
       color: #333;
     }
   }
-
-  .problems-list {
-    .problem-item {
-      margin-bottom: 20px;
-      padding: 15px;
-      background: #f8f9fa;
-      border-radius: 8px;
-      border: 1px solid #e4e7ed;
-
-      &:last-child {
-        margin-bottom: 0;
+  .problems-list-container {
+    // max-height: 680px;
+    // overflow-y: auto;
+    padding-right: 10px;
+    margin-bottom: 15px;
+    &::-webkit-scrollbar {
+      width: 6px;
+    }
+    &::-webkit-scrollbar-track {
+      background: #f1f1f1;
+      border-radius: 3px;
+    }
+    &::-webkit-scrollbar-thumb {
+      background: #c1c1c1;
+      border-radius: 3px;
+      &:hover {
+        background: #a8a8a8;
       }
-
-      .problem-content {
-        .problem-meta {
+    }
+  }
+  .problem-item {
+    margin-bottom: 20px;
+    padding: 15px;
+    background: #f8f9fa;
+    border-radius: 8px;
+    border: 1px solid #e4e7ed;
+    .problem-content {
+      .problem-meta {
+        display: flex;
+        align-items: center;
+        margin-bottom: 15px;
+        padding-bottom: 10px;
+        border-bottom: 1px dashed #e4e7ed;
+        .problem-index {
+          font-weight: 500;
+          color: #409eff;
+          min-width: 80px;
+        }
+      }
+      .custom-editor {
+        padding: 10px 0;
+        .option-row {
+          display: flex;
+          align-items: center;
+          margin-bottom: 6px;
+        }
+      }
+      .problem-detail {
+        margin-top: 5px;
+        padding-top: 5px;
+        padding-bottom: 20px;
+        margin-bottom: 10px;
+        border-bottom: 1px dashed #6e9af4;
+        .detail-row {
           display: flex;
           align-items: center;
           margin-bottom: 15px;
-          padding-bottom: 10px;
-          border-bottom: 1px dashed #e4e7ed;
-
-          .problem-index {
-            font-weight: 500;
-            color: #409eff;
-            min-width: 80px;
+          &:last-child {
+            margin-bottom: 0;
           }
-        }
-
-        .problem-detail {
-          .detail-row {
-            display: flex;
-            align-items: flex-start;
-            margin-bottom: 10px;
-
-            &:last-child {
-              margin-bottom: 0;
-            }
-
-            .detail-label {
-              font-weight: 500;
-              color: #666;
-              min-width: 100px;
-              line-height: 32px;
-            }
-
-            .detail-value {
-              flex: 1;
-              line-height: 1.5;
-              color: #333;
-              padding: 5px 0;
-            }
+          .detail-label {
+            font-weight: 500;
+            color: #666;
+            min-width: 80px;
+            white-space: nowrap;
           }
         }
       }
     }
   }
-
   .empty-problems {
     text-align: center;
     padding: 30px 0;
     background: #fafafa;
     border-radius: 8px;
     border: 1px dashed #e4e7ed;
+    color: #999;
   }
 }
-/* 寤剁画闂鍒楄〃瀹瑰櫒 - 娣诲姞婊氬姩 */
-.problems-list-container {
-  max-height: 400px; /* 鎺у埗鏈�澶ч珮搴� */
-  overflow-y: auto;
-  padding-right: 10px;
-  margin-bottom: 15px;
-
-  &::-webkit-scrollbar {
-    width: 6px;
-  }
-
-  &::-webkit-scrollbar-track {
-    background: #f1f1f1;
-    border-radius: 3px;
-  }
-
-  &::-webkit-scrollbar-thumb {
-    background: #c1c1c1;
-    border-radius: 3px;
-
-    &:hover {
-      background: #a8a8a8;
-    }
-  }
-}
-
-/* 闂嵎寮忛棶棰樺睍绀� */
 .question-display-area {
   margin: 15px 0;
   padding: 15px;
   background: #fff;
   border-radius: 8px;
   border: 1px solid #e4e7ed;
-
   .question-item-render {
     .question-text {
       margin-bottom: 15px;
       font-size: 14px;
       line-height: 1.5;
       color: #333;
-
       strong {
         color: #409eff;
         margin-right: 5px;
       }
-
       span {
         color: #666;
       }
     }
-
     .question-options {
       margin-left: 20px;
-
       .el-radio,
       .el-checkbox {
         display: block;
@@ -2255,132 +2168,61 @@
         margin-right: 20px;
       }
     }
-
     .append-input {
       margin-left: 20px;
       margin-top: 10px;
     }
   }
-
-  .no-question-data {
-    text-align: center;
-    color: #999;
-    padding: 20px;
-    font-style: italic;
-  }
 }
-
-/* 璋冩暣闂璇︽儏甯冨眬 */
-.problem-detail {
-  margin-top: 5px;
-  padding-top: 5px;
-  padding-bottom: 20px;
-  margin-bottom: 10px;
-  border-bottom: 1px dashed #6e9af4;
-
-  .detail-row {
-    display: flex;
-    align-items: center;
-    margin-bottom: 15px;
-
-    &:last-child {
-      margin-bottom: 0;
-    }
-
-    .detail-label {
-      font-weight: 500;
-      color: #666;
-      min-width: 80px;
-      white-space: nowrap;
-    }
-  }
-}
-
-/* 鍝嶅簲寮忚皟鏁� */
 @media (max-width: 768px) {
   .problems-list-container {
     max-height: 300px;
   }
-
-  .problem-detail {
-    .detail-row {
-      flex-direction: column;
-      align-items: flex-start;
-
-      .detail-label {
-        margin-bottom: 5px;
-        min-width: auto;
-      }
-
-      .el-select,
-      .el-date-picker {
-        width: 100% !important;
-        margin: 5px 0 !important;
-      }
+  .problem-detail .detail-row {
+    flex-direction: column;
+    align-items: flex-start;
+    .detail-label {
+      margin-bottom: 5px;
+      min-width: auto;
+    }
+    .el-select,
+    .el-date-picker {
+      width: 100% !important;
+      margin: 5px 0 !important;
     }
   }
-}
-/* 鍝嶅簲寮忚皟鏁� */
-@media (max-width: 768px) {
   .question-selector-panel {
     padding: 10px;
-
-    .question-list {
-      .question-item {
-        padding: 6px 8px;
-      }
+    .question-list .question-item {
+      padding: 6px 8px;
     }
   }
-
-  .continuity-problems-form {
-    .problems-list {
-      .problem-item {
-        padding: 10px;
-
-        .problem-content {
-          .problem-meta {
-            flex-direction: column;
-            align-items: flex-start;
-
-            .el-select {
-              width: 100% !important;
-              margin: 10px 0;
-            }
-          }
-
-          .problem-detail {
-            .detail-row {
-              flex-direction: column;
-              align-items: flex-start;
-
-              .detail-label {
-                margin-bottom: 5px;
-                min-width: auto;
-              }
-            }
-          }
-        }
-      }
+  .continuity-problems-form
+    .problems-list
+    .problem-item
+    .problem-content
+    .problem-meta {
+    flex-direction: column;
+    align-items: flex-start;
+    .el-select {
+      width: 100% !important;
+      margin: 10px 0;
     }
   }
 }
-/* 婊氬姩鏉$編鍖� */
 .preview-left,
 .history-content .el-tabs__content,
 .content-container .el-tabs__content {
   &::-webkit-scrollbar {
     width: 6px;
   }
-
   &::-webkit-scrollbar-track {
     background: #f1f1f1;
     border-radius: 3px;
   }
-
   &::-webkit-scrollbar-thumb {
     background: #c1c1c1;
     border-radius: 3px;
-
     &:hover {
       background: #a8a8a8;
     }
diff --git a/src/views/followvisit/discharge/index.vue b/src/views/followvisit/discharge/index.vue
index d5dbb08..15b77d9 100644
--- a/src/views/followvisit/discharge/index.vue
+++ b/src/views/followvisit/discharge/index.vue
@@ -169,7 +169,7 @@
                 plain
                 icon="el-icon-warning-outline"
                 size="medium"
-                @click="toleadExport(1)"
+                @click="toleadExport(1, 1)"
                 >鎵ц澶辫触</el-button
               >
             </div>
@@ -183,7 +183,7 @@
                 plain
                 icon="el-icon-warning"
                 size="medium"
-                @click="toleadExport(2)"
+                @click="toleadExport(2, 1)"
                 >缁撴灉寮傚父</el-button
               >
             </div>
@@ -437,6 +437,20 @@
           prop="drname"
         />
         <el-table-column
+          label="璐d换鎶ゅ+"
+          width="120"
+          align="center"
+          key="nurseName"
+          prop="nurseName"
+        />
+        <el-table-column
+          label="缁忕鍖荤敓"
+          align="center"
+          key="managementDoctor"
+          prop="managementDoctor"
+          width="120"
+        />
+        <el-table-column
           v-if="orgname != '涓芥按甯備腑鍖婚櫌'"
           label="闅忚浜哄憳"
           align="center"
@@ -518,20 +532,6 @@
           prop="sfzh"
         />
 
-        <el-table-column
-          label="璐d换鎶ゅ+"
-          width="120"
-          align="center"
-          key="nurseName"
-          prop="nurseName"
-        />
-        <el-table-column
-          label="缁忕鍖荤敓"
-          align="center"
-          key="managementDoctor"
-          prop="managementDoctor"
-          width="120"
-        />
         <!-- <el-table-column
           label="鐥呭巻鍙�"
           align="center"
@@ -658,6 +658,15 @@
               @click="handleUpdate(scope.row)"
               ><span class="button-textxga"
                 ><i class="el-icon-edit"></i>鎮h�呰繃婊�</span
+              ></el-button
+            >
+            <el-button
+              size="medium"
+              type="text"
+              v-if="orgname == '鍗楀崕澶у闄勫睘绗竴鍖婚櫌'"
+              @click="handleTransferOpen(scope.row)"
+              ><span class="button-textxgc"
+                ><i class="el-icon-sort"></i>鍙樻洿绉�/鍖�</span
               ></el-button
             >
           </template>
@@ -919,81 +928,7 @@
         <el-button @click="cancel">鍙� 娑�</el-button>
       </div>
     </el-dialog>
-    <!-- 淇敼鍙戦�佹椂闂村璇濇 -->
-    <el-dialog
-      title="鍙戦�佹椂闂磋缃�"
-      :visible.sync="modificationVisible"
-      width="45%"
-    >
-      <div style="margin-bottom: 20px; color: red">
-        缁熶竴淇敼褰撳ぉ鏈彂閫佺殑浠诲姟鏃堕棿
-      </div>
 
-      <el-form
-        :model="ruleForm"
-        :rules="rules"
-        ref="ruleForm"
-        label-width="120px"
-        class="demo-ruleForm"
-      >
-        <el-form-item label="鍙戦�佹棩鏈�">
-          <el-date-picker
-            v-model="ruleForm.value1"
-            type="date"
-            placeholder="閫夋嫨鏃ユ湡"
-          >
-          </el-date-picker>
-        </el-form-item>
-
-        <el-form-item label="鏃堕棿娈�" prop="type">
-          <el-checkbox-group v-model="ruleForm.type">
-            <el-checkbox label="涓婂崍" name="type"></el-checkbox>
-            <el-checkbox label="涓嬪崍" name="type"></el-checkbox>
-            <el-checkbox label="鏅氫笂" name="type"></el-checkbox>
-          </el-checkbox-group>
-        </el-form-item>
-        <el-form-item label="涓婂崍鏃堕棿鍖洪棿" required>
-          <el-time-picker
-            is-range
-            v-model="ruleForm.value2"
-            range-separator="鑷�"
-            start-placeholder="寮�濮嬫椂闂�"
-            end-placeholder="缁撴潫鏃堕棿"
-            placeholder="閫夋嫨鏃堕棿鑼冨洿"
-          >
-          </el-time-picker>
-        </el-form-item>
-        <el-form-item label="涓嬪崍鏃堕棿鍖洪棿" required>
-          <el-time-picker
-            is-range
-            v-model="ruleForm.value3"
-            range-separator="鑷�"
-            start-placeholder="寮�濮嬫椂闂�"
-            end-placeholder="缁撴潫鏃堕棿"
-            placeholder="閫夋嫨鏃堕棿鑼冨洿"
-          >
-          </el-time-picker>
-        </el-form-item>
-        <el-form-item label="鏅氫笂鏃堕棿鍖洪棿" required>
-          <el-time-picker
-            is-range
-            v-model="ruleForm.value4"
-            range-separator="鑷�"
-            start-placeholder="寮�濮嬫椂闂�"
-            end-placeholder="缁撴潫鏃堕棿"
-            placeholder="閫夋嫨鏃堕棿鑼冨洿"
-          >
-          </el-time-picker>
-        </el-form-item>
-      </el-form>
-
-      <span slot="footer" class="dialog-footer">
-        <el-button @click="modificationVisible = false">鍙� 娑�</el-button>
-        <el-button type="primary" @click="modificationVisible = false"
-          >纭� 瀹�</el-button
-        >
-      </span>
-    </el-dialog>
     <!-- 鍐嶆闅忚 -->
     <el-dialog title="鎮h�呭啀娆¢殢璁�" :visible.sync="dialogFormVisible">
       <el-form ref="zcform" :rules="zcrules" :model="zcform" label-width="80px">
@@ -1066,6 +1001,57 @@
         <el-button type="primary" @click="setupsubtask">纭鍒涘缓鏈嶅姟</el-button>
       </div>
     </el-dialog>
+
+    <!-- 鍙樻洿绉戝/鐥呭尯寮圭獥 -->
+    <el-dialog
+      title="鍙樻洿绉戝/鐥呭尯"
+      :visible.sync="transferDialogVisible"
+      width="480px"
+      :close-on-click-modal="false"
+    >
+      <el-form :model="transferForm" label-width="100px">
+        <el-form-item label="褰撳墠绉戝">
+          <span>{{ transferForm.currentDeptName || "-" }}</span>
+        </el-form-item>
+        <el-form-item label="褰撳墠鐥呭尯">
+          <span>{{ transferForm.currentWardName || "-" }}</span>
+        </el-form-item>
+        <el-form-item label="鐩爣绉戝">
+          <el-cascader
+            v-model="transferDeptValue"
+            :options="deptOptionsks"
+            :props="cascaderPropsa"
+            placeholder="璇烽�夋嫨鐩爣绉戝"
+            filterable
+            clearable
+            style="width: 100%"
+            @change="handleDeptCascaderChange"
+          />
+        </el-form-item>
+        <el-form-item label="鐩爣鐥呭尯">
+          <el-cascader
+            v-model="transferWardValue"
+            :options="deptOptionsbq"
+            :props="cascaderPropsa"
+            placeholder="璇烽�夋嫨鐩爣鐥呭尯"
+            filterable
+            clearable
+            style="width: 100%"
+            @change="handleWardCascaderChange"
+          />
+        </el-form-item>
+      </el-form>
+      <div slot="footer" class="dialog-footer">
+        <el-button @click="transferDialogVisible = false">鍙� 娑�</el-button>
+        <el-button
+          type="primary"
+          :loading="transferLoading"
+          @click="handleTransferSubmit"
+        >
+          纭鍙樻洿
+        </el-button>
+      </div>
+    </el-dialog>
   </div>
 </template>
 
@@ -1076,6 +1062,7 @@
   updateUser,
   resetUserPwd,
   changeUserStatus,
+  deptTreeSelect,
 } from "@/api/system/user";
 import {
   getTaskservelist,
@@ -1083,6 +1070,7 @@
   addserviceSubtask,
   query360PatInfo,
   addsatisfaction,
+  transferDept,
   query360PatInfonh,
 } from "@/api/AiCentre/index";
 import { alterpatient, particularpatient } from "@/api/patient/homepage";
@@ -1117,8 +1105,7 @@
       title: "鏂板褰卞儚闅忚",
       // 鏄惁鏄剧ず淇敼銆佹坊鍔犲脊鍑哄眰
       addalteropen: false,
-      // 淇敼鍙戦�佹椂闂村璇濇
-      modificationVisible: false,
+
       // 閮ㄩ棬鍚嶇О
       deptName: undefined,
       // 榛樿瀵嗙爜
@@ -1294,12 +1281,21 @@
         pageNum: 1,
         pageSize: 10,
         sendstateView: 1,
-        sort: localStorage.getItem("orgname") == "涓芥按甯備腑鍖婚櫌" ? 8 : 1, //0 鍑洪櫌鏃堕棿(姝e簭)    1 鍑洪櫌鏃堕棿(鍊掑簭)   2 鍙戦�佹椂闂�(姝e簭)    3 鍙戦�佹椂闂�(鍊掑簭)  7搴旈殢璁挎棩鏈�(鍊掑簭) 搴旈殢璁挎棩鏈�(姝e簭)
+        sort:
+          localStorage.getItem("orgname") == "涓芥按甯備腑鍖婚櫌"
+            ? 8
+            : localStorage.getItem("orgname") == "鏅畞鐣叉棌鑷不鍘夸汉姘戝尰闄�"
+            ? 2
+            : 1, //0 鍑洪櫌鏃堕棿(姝e簭)    1 鍑洪櫌鏃堕棿(鍊掑簭)   2 鍙戦�佹椂闂�(姝e簭)    3 鍙戦�佹椂闂�(鍊掑簭)  7搴旈殢璁挎棩鏈�(鍊掑簭) 搴旈殢璁挎棩鏈�(姝e簭)
         serviceType: 2,
         sendstate: null,
         searchscope: 3,
         visitCount: 1,
         scopetype: [],
+        managementDoctor:
+          localStorage.getItem("orgname") == "缂欎簯鍘夸汉姘戝尰闄�"
+            ? store.getters.nickName
+            : "",
         leaveldeptcodes: [],
         leavehospitaldistrictcodes: [],
       },
@@ -1397,6 +1393,25 @@
       leavehospitaldistrictcode: "",
       serviceState: [],
       checkboxlist: [],
+      // 鍙樻洿绉戝/鐥呭尯
+      transferDialogVisible: false,
+      transferForm: {
+        subId: null,
+        leavelDeptCode: "",
+        leavelDeptName: "",
+        leavehospitaldistrictcode: "",
+        leavehospitaldistrictname: "",
+      },
+      deptOptionsks: [],
+      deptOptionsbq: [],
+      transferDeptValue: [],
+      transferWardValue: [],
+      cascaderPropsa: {
+        value: "deptCode",
+        label: "label",
+        checkStrictly: true,
+      },
+      transferLoading: false,
       // 琛ㄥ崟鏍¢獙
       rules: {},
     };
@@ -1552,10 +1567,8 @@
           }
 
           if (item.preachform) {
-            if (item.endtime) {
-              item.preachformson = item.preachform;
-              idArray = item.preachform.split(",");
-            }
+            item.preachformson = item.preachform;
+            idArray = item.preachform.split(",");
 
             item.preachform = idArray.map((value) => {
               const item = this.checkboxlist.find(
@@ -1648,10 +1661,13 @@
       return `${year}-${month}-${day}`;
     },
     affiliation() {
+      this.resetQuerykj();
       this.topqueryParams.managementDoctorCode = store.getters.hisUserId;
       this.getList(1);
     },
     onthatday() {
+      this.resetQuerykj();
+
       this.topqueryParams.startSendDateTime = this.getCurrentDate();
       this.topqueryParams.endSendDateTime = this.getCurrentDate();
       this.getList(1);
@@ -1660,7 +1676,11 @@
       const now = new Date();
       return now.toISOString().slice(0, 10); // 鎴彇鍓�10涓瓧绗︼紝鍗� YYYY-MM-DD
     },
+
     buidegetTasklist(type) {
+      if (type) {
+        this.resetQuerykj();
+      }
       if (this.topqueryParams.searchscope == 3) {
         this.topqueryParams.leaveldeptcodes = store.getters.belongDepts.map(
           (obj) => obj.deptCode
@@ -1869,6 +1889,24 @@
         leavehospitaldistrictcodes: [],
       };
       this.handleQuery(1);
+    },
+    /** 閲嶇疆鎸夐挳鎿嶄綔 */
+    resetQuerykj() {
+      this.dateRange = [];
+      this.dateRangefs = [];
+      this.serviceStatusValue = null;
+      this.topqueryParams = {
+        pageNum: 1,
+        pageSize: 10,
+        sendstateView: null,
+        sort: 2, //0 鍑洪櫌鏃堕棿(姝e簭)    1 鍑洪櫌鏃堕棿(鍊掑簭)   2 鍙戦�佹椂闂�(姝e簭)    3 鍙戦�佹椂闂�(鍊掑簭)
+        serviceType: 2,
+        searchscope: 3,
+        visitCount: 1,
+        scopetype: [],
+        leaveldeptcodes: [],
+        leavehospitaldistrictcodes: [],
+      };
     },
     handleSelectionChange(rows) {
       // 鉁� 濡傛灉鏄仮澶嶉�変腑鐘舵�佽Е鍙戠殑锛岀洿鎺ヨ繑鍥�
@@ -2091,10 +2129,7 @@
         })
         .catch(() => {});
     },
-    // 璁剧疆鍙戦�佹椂闂�
-    Sendtimesetting() {
-      this.modificationVisible = true;
-    },
+
     // 璺宠浆璇︽儏椤�
     Seedetails(row) {
       let type = "";
@@ -2160,8 +2195,10 @@
       this.Labelchange = true;
     },
     // 渚挎嵎鎸夐挳
-    toleadExport(too) {
-      console.log(too, "too");
+    toleadExport(too, type) {
+      if (type) {
+        this.resetQuerykj();
+      }
 
       if (too == 1) {
         this.topqueryParams.sendstate = 4;
@@ -2173,7 +2210,6 @@
         this.topqueryParams.endSendDateTime = this.formatDateToYYYYMMDDHHMMSS(
           this.getEndOfDay()
         );
-        console.log(1111, this.topqueryParams.endSendDateTime);
 
         this.topqueryParams.excep = null;
         this.topqueryParams.sendstate = 2;
@@ -2329,6 +2365,98 @@
       const seconds = String(now.getSeconds()).padStart(2, "0");
 
       return `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`;
+    },
+
+    // ---------- 鍙樻洿绉戝/鐥呭尯 ----------
+    handleTransferOpen(row) {
+      if (!this.deptOptionsks.length) {
+        deptTreeSelect(1).then((res) => {
+          this.deptOptionsks = res.data || [];
+        });
+        deptTreeSelect(2).then((res) => {
+          this.deptOptionsbq = res.data || [];
+        });
+      }
+      this.transferForm = {
+        subId: row.id || row.subtaskid,
+        leavelDeptCode: "",
+        leavelDeptName: "",
+        leavehospitaldistrictcode: "",
+        leavehospitaldistrictname: "",
+        currentDeptName: row.deptname || row.deptName || "",
+        currentWardName:
+          row.leavehospitaldistrictname || row.leavehospitaldistrictName || "",
+      };
+      this.transferDeptValue = [];
+      this.transferWardValue = [];
+      this.transferDialogVisible = true;
+    },
+    handleDeptCascaderChange(val) {
+      if (val && val.length) {
+        this.transferForm.leavelDeptCode = val[val.length - 1];
+        // 浠庨�夐」鏍戜腑鏌ユ壘瀵瑰簲鍚嶇О
+        const node = this.findCascaderNode(this.deptOptionsks, this.transferForm.leavelDeptCode);
+        this.transferForm.leavelDeptName = node ? node.label : '';
+      } else {
+        this.transferForm.leavelDeptCode = '';
+        this.transferForm.leavelDeptName = '';
+      }
+    },
+    handleWardCascaderChange(val) {
+      if (val && val.length) {
+        this.transferForm.leavehospitaldistrictcode = val[val.length - 1];
+        const node = this.findCascaderNode(this.deptOptionsbq, this.transferForm.leavehospitaldistrictcode);
+        this.transferForm.leavehospitaldistrictname = node ? node.label : '';
+      } else {
+        this.transferForm.leavehospitaldistrictcode = '';
+        this.transferForm.leavehospitaldistrictname = '';
+      }
+    },
+    findCascaderNode(options, code) {
+      for (const item of options) {
+        if (item.deptCode === code || item.value === code) return item;
+        if (item.children) {
+          const found = this.findCascaderNode(item.children, code);
+          if (found) return found;
+        }
+      }
+      return null;
+    },
+    handleTransferSubmit() {
+      const hasDept = !!this.transferForm.leavelDeptCode;
+      const hasWard = !!this.transferForm.leavehospitaldistrictcode;
+      if (!hasDept && !hasWard) {
+        this.$modal.msgError("璇疯嚦灏戦�夋嫨鐩爣绉戝鎴栫洰鏍囩梾鍖�");
+        return;
+      }
+      console.log(this.transferForm);
+
+      // 缁勮鍙樻洿鎻愮ず鏂囨湰
+      const deptName = this.transferForm.leavelDeptName || "涓嶅彉";
+      const wardName = this.transferForm.leavehospitaldistrictname || "涓嶅彉";
+      const tip = `纭灏嗙瀹ゅ彉鏇翠负"${deptName}"銆佺梾鍖哄彉鏇翠负"${wardName}"锛焋;
+      this.$modal
+        .confirm(tip, "鍙樻洿纭")
+        .then(() => {
+          this.transferLoading = true;
+          transferDept(this.transferForm)
+            .then((res) => {
+              if (res.code === 200) {
+                this.$modal.msgSuccess("绉戝/鐥呭尯鍙樻洿鎴愬姛");
+                this.transferDialogVisible = false;
+                this.getList();
+              } else {
+                this.$modal.msgError(res.msg || "鍙樻洿澶辫触");
+              }
+            })
+            .catch(() => {
+              this.$modal.msgError("鍙樻洿澶辫触锛岃閲嶈瘯");
+            })
+            .finally(() => {
+              this.transferLoading = false;
+            });
+        })
+        .catch(() => {});
     },
   },
 };
@@ -2509,6 +2637,9 @@
 .button-textxga {
   color: #de7897;
 }
+.button-textxgc {
+  color: #9054e4;
+}
 .purple-button.is-disabled {
   background-color: #d8b4fe;
   border-color: #d8b4fe;
diff --git a/src/views/followvisit/mzsatisfaction/index.vue b/src/views/followvisit/mzsatisfaction/index.vue
index b0f7cb0..583cafc 100644
--- a/src/views/followvisit/mzsatisfaction/index.vue
+++ b/src/views/followvisit/mzsatisfaction/index.vue
@@ -78,7 +78,7 @@
           ></el-cascader>
         </el-form-item>
 
-        <el-form-item label="鏈嶅姟鐘舵��" prop="status">
+        <!-- <el-form-item label="鏈嶅姟鐘舵��" prop="status">
           <el-select
             v-model="topqueryParams.sendstateView"
             placeholder="璇烽�夋嫨"
@@ -91,6 +91,16 @@
             >
             </el-option>
           </el-select>
+        </el-form-item> -->
+         <el-form-item label="闅忚鐘舵��" prop="status">
+          <el-cascader
+            v-model="serviceStatusValue"
+            placeholder="璇烽�夋嫨"
+            :options="serviceStatusOptions"
+            :props="cascaderProps"
+            @change="handleServiceStatusChange"
+            clearable
+          ></el-cascader>
         </el-form-item>
         <el-form-item label="鎺掑簭鏂瑰紡" prop="status">
           <el-select v-model="topqueryParams.sort" placeholder="璇烽�夋嫨">
@@ -1030,7 +1040,41 @@
       // 婊℃剰搴﹁皟鏌ユ暟鎹�
       scoreDialogVisible: false,
       selectedRows: [],
-
+ // 绾ц仈閫夋嫨鍣ㄧ粦瀹氬��
+      serviceStatusValue: 10,
+      cascaderProps: {
+        expandTrigger: "hover", // 鎮仠灞曞紑
+        checkStrictly: true, // 鉁� 鍏抽敭锛氬厑璁搁�変腑浠绘剰涓�绾�
+        emitPath: false, // 鉁� 鍙繑鍥為�変腑鐨勫�硷紝涓嶈繑鍥炶矾寰勬暟缁�
+      },
+      // 鏈嶅姟鐘舵�侀�夐」锛堜竴绾у拰浜岀骇鍊间笉鍐茬獊锛�
+      serviceStatusOptions: [
+        {
+          value: null,
+          label: "鍏ㄩ儴",
+        },
+        {
+          value: 10, // 涓�绾э細寰呴殢璁�
+          label: "寰呴殢璁�",
+          children: [
+            { value: 1, label: "琚鍙�" },
+            { value: 2, label: "寰呭彂閫�" },
+            { value: 3, label: "宸插彂閫�" },
+            { value: 5, label: "鍙戦�佸け璐�" },
+            { value: 7, label: "瓒呮椂" },
+          ],
+        },
+        {
+          value: 20, // 涓�绾э細宸插畬鎴�
+          label: "宸插畬鎴�",
+          children: [{ value: 6, label: "宸插畬鎴�" }],
+        },
+        {
+          value: 30, // 涓�绾э細鏃犻渶闅忚
+          label: "鏃犻渶闅忚",
+          children: [{ value: 4, label: "涓嶆墽琛�" }],
+        },
+      ],
       value: [],
       list: [],
 
@@ -1402,6 +1446,37 @@
         this.total = response.total;
       });
     },
+    // 鏈嶅姟鐘舵�佸彉鏇村鐞�
+    handleServiceStatusChange(value) {
+      // 娓呯┖閫夋嫨
+      if (value === null || value === undefined || value === "") {
+        this.topqueryParams.sendstateView = null;
+        this.topqueryParams.sendstate = null;
+        return;
+      }
+      console.log(value, "value");
+
+      // 涓�绾ц妭鐐圭殑鍊硷紙澶т簬绛変簬10锛�
+      if (value >= 10) {
+        // 閫変腑浜嗕竴绾�
+        switch (value) {
+          case 10:
+            this.topqueryParams.sendstateView = 1; // 寰呴殢璁�
+            break;
+          case 20:
+            this.topqueryParams.sendstateView = 2; // 宸插畬鎴�
+            break;
+          case 30:
+            this.topqueryParams.sendstateView = 3; // 鏃犻渶闅忚
+            break;
+        }
+        this.topqueryParams.sendstate = null;
+      } else {
+        // 閫変腑浜嗕簩绾э紙鍏蜂綋鐘舵�侊級
+        this.topqueryParams.sendstateView = null;
+        this.topqueryParams.sendstate = value;
+      }
+    },
     // 鏌ョ湅闂ㄨ瘖闅忚璇︽儏
     Referencequestion(row) {
       this.previewVisible = true;
@@ -1492,6 +1567,8 @@
     resetQuery() {
       this.dateRange = [];
       this.dateRangefs = [];
+      this.serviceStatusValue = 10;
+
       this.topqueryParams = {
         pageNum: 1,
         pageSize: 10,
diff --git a/src/views/followvisit/operation/index.vue b/src/views/followvisit/operation/index.vue
index 3386dbd..bbcde45 100644
--- a/src/views/followvisit/operation/index.vue
+++ b/src/views/followvisit/operation/index.vue
@@ -1580,15 +1580,12 @@
         this.loading = false;
         this.userList.forEach((item) => {
           let idArray = null;
-          if (item.endtime) {
-            item.endDay = this.daysBetween(item.endtime);
-          }
+
+          item.endDay = this.daysBetween(item.endtime);
 
           if (item.preachform) {
-            if (item.endtime) {
-              item.preachformson = item.preachform;
-              idArray = item.preachform.split(",");
-            }
+            item.preachformson = item.preachform;
+            idArray = item.preachform.split(",");
 
             item.preachform = idArray.map((value) => {
               // 鏌ユ壘id瀵瑰簲鐨勫璞�
@@ -1690,15 +1687,11 @@
         this.loading = false;
         this.userList.forEach((item) => {
           let idArray = null;
-          if (item.endtime) {
-            item.endDay = this.daysBetween(item.endtime);
-          }
+          item.endDay = this.daysBetween(item.endtime);
 
           if (item.preachform) {
-            if (item.endtime) {
-              item.preachformson = item.preachform;
-              idArray = item.preachform.split(",");
-            }
+            item.preachformson = item.preachform;
+            idArray = item.preachform.split(",");
 
             item.preachform = idArray.map((value) => {
               // 鏌ユ壘id瀵瑰簲鐨勫璞�
diff --git a/src/views/followvisit/record/detailpage/index.vue b/src/views/followvisit/record/detailpage/index.vue
index 7a81969..e776ec9 100644
--- a/src/views/followvisit/record/detailpage/index.vue
+++ b/src/views/followvisit/record/detailpage/index.vue
@@ -136,6 +136,18 @@
           >
           </el-table-column>
           <el-table-column
+            label="搴旈殢璁挎棩鏈�"
+            width="146"
+            align="center"
+            key="visitTime"
+            prop="visitTime"
+            :render-header="Tooltipy"
+          >
+            <template slot-scope="scope">
+              <span>{{ formatTime(scope.row.visitTime) }}</span>
+            </template></el-table-column
+          >
+          <el-table-column
             v-if="orgname == '鍗楀崕澶у闄勫睘绗竴鍖婚櫌'"
             label="鍏ラ櫌鏃ユ湡"
             width="200"
@@ -365,7 +377,12 @@
                   <div class="title">
                     {{ taskname ? taskname : "闂嵎" }}
                     <span style="margin-left: 50px">
-                      <el-button type="primary" round @click="smsSubTask" v-if="orgname != '鐪佺珛鍚屽痉缈犺嫅闄㈠尯'">
+                      <el-button
+                        type="primary"
+                        round
+                        @click="smsSubTask"
+                        v-if="orgname != '鐪佺珛鍚屽痉缈犺嫅闄㈠尯'"
+                      >
                         闂嵎鐭俊鎺ㄩ��
                       </el-button>
                     </span>
@@ -585,10 +602,10 @@
                     v-if="Voicetype"
                     type="primary"
                     @click="yuyingetdetail"
-                    >淇濆瓨鏈嶅姟璇︽儏</el-button
+                    >淇濆瓨闂嵎璇︽儏</el-button
                   >
                   <el-button v-else type="primary" @click="getdetail"
-                    >淇濆瓨鏈嶅姟璇︽儏</el-button
+                    >淇濆瓨闂嵎璇︽儏</el-button
                   >
                 </div>
               </el-tab-pane>
@@ -696,6 +713,7 @@
                   v-model="selectedTag"
                   placeholder="璇烽�夋嫨寮傚父鐘舵��"
                   clearable
+                  @change="exceptionHandling"
                   style="width: 150px; margin-right: 10px"
                 >
                   <el-option
@@ -929,7 +947,7 @@
                   >
                     鏆備笉澶勭悊
                   </el-button>
-                   <el-button
+                  <el-button
                     plain
                     type="success"
                     @click="Editsingletaskson('6')"
@@ -953,7 +971,12 @@
                   <el-button plain type="info" @click="Editsingletaskson('5')">
                     浜哄伐闅忚
                   </el-button>
-                  <el-button type="primary" round @click="sendAgainmsg" v-if="orgname != '鐪佺珛鍚屽痉缈犺嫅闄㈠尯'">
+                  <el-button
+                    type="primary"
+                    round
+                    @click="sendAgainmsg"
+                    v-if="orgname != '鐪佺珛鍚屽痉缈犺嫅闄㈠尯'"
+                  >
                     鐭俊鍙戦��
                   </el-button>
                 </div>
@@ -1089,142 +1112,168 @@
       </div>
     </el-dialog>
     <el-dialog
-  title="鎮h�呭啀娆¢殢璁�"
-  v-dialogDrags
-  :visible.sync="dialogFormVisible"
-  width="700px"
->
-  <el-form ref="zcform" :rules="zcrules" :model="form" label-width="80px">
-    <!-- 鍩虹鏈嶅姟淇℃伅 - 榛樿鎶樺彔 -->
-    <el-collapse v-model="activeNames" @change="handleCollapseChange">
-      <el-collapse-item title="鍩虹鏈嶅姟淇℃伅" name="basic">
-        <el-form-item label="浠诲姟鍚嶇О">
-          <el-input style="width: 100%" disabled v-model="form.taskName"></el-input>
-        </el-form-item>
-        <el-form-item label="鎮h�呭悕绉�">
-          <el-input style="width: 100%" disabled v-model="form.sendname"></el-input>
-        </el-form-item>
-        <el-form-item label="骞撮緞">
-          <el-input style="width: 100%" disabled v-model="form.age"></el-input>
-        </el-form-item>
-        <el-form-item label="绉戝">
-          <el-input style="width: 100%" disabled v-model="form.deptname"></el-input>
-        </el-form-item>
-        <el-form-item label="鐥呭尯">
-          <el-input style="width: 100%" disabled v-model="form.leavehospitaldistrictname"></el-input>
-        </el-form-item>
-        <el-form-item label="鍑洪櫌鏃堕棿">
-          <el-input style="width: 100%" disabled v-model="form.endtime"></el-input>
-        </el-form-item>
-      </el-collapse-item>
-
-      <!-- 涓婃闅忚淇℃伅 - 榛樿鎶樺彔 -->
-      <el-collapse-item title="涓婃闅忚" name="last">
-        <el-row>
-          <el-col :span="12">
-            <el-form-item label="闅忚鏂瑰紡">
-              <el-select
-                v-model="form.visitType2"
-                filterable
-                allow-create
-                default-first-option
+      title="鎮h�呭啀娆¢殢璁�"
+      v-dialogDrags
+      :visible.sync="dialogFormVisible"
+      width="700px"
+    >
+      <el-form ref="zcform" :rules="zcrules" :model="form" label-width="80px">
+        <!-- 鍩虹鏈嶅姟淇℃伅 - 榛樿鎶樺彔 -->
+        <el-collapse v-model="activeNames" @change="handleCollapseChange">
+          <el-collapse-item title="鍩虹鏈嶅姟淇℃伅" name="basic">
+            <el-form-item label="浠诲姟鍚嶇О">
+              <el-input
+                style="width: 100%"
                 disabled
-                placeholder="璇烽�夋嫨闅忚鏂瑰紡"
-                class="custom-disabled"
-                style="width: 90%"
-              >
-                <el-option
-                  v-for="item in options"
-                  :key="item.value"
-                  :label="item.label"
-                  :value="item.value"
-                >
-                </el-option>
-              </el-select>
+                v-model="form.taskName"
+              ></el-input>
             </el-form-item>
-          </el-col>
-          <el-col :span="12">
-            <el-form-item label="闅忚鏃堕棿">
-              <el-date-picker
-                type="date"
+            <el-form-item label="鎮h�呭悕绉�">
+              <el-input
+                style="width: 100%"
                 disabled
-                placeholder="閫夋嫨鏃ユ湡"
-                :picker-options="pickerOptions"
-                align="right"
-                v-model="form.date2"
-                class="custom-disabled"
-                style="width: 95%"
-              ></el-date-picker>
+                v-model="form.sendname"
+              ></el-input>
             </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>
-      </el-collapse-item>
+            <el-form-item label="骞撮緞">
+              <el-input
+                style="width: 100%"
+                disabled
+                v-model="form.age"
+              ></el-input>
+            </el-form-item>
+            <el-form-item label="绉戝">
+              <el-input
+                style="width: 100%"
+                disabled
+                v-model="form.deptname"
+              ></el-input>
+            </el-form-item>
+            <el-form-item label="鐥呭尯">
+              <el-input
+                style="width: 100%"
+                disabled
+                v-model="form.leavehospitaldistrictname"
+              ></el-input>
+            </el-form-item>
+            <el-form-item label="鍑洪櫌鏃堕棿">
+              <el-input
+                style="width: 100%"
+                disabled
+                v-model="form.endtime"
+              ></el-input>
+            </el-form-item>
+          </el-collapse-item>
 
-      <!-- 涓嬫闅忚淇℃伅 - 榛樿灞曞紑 -->
-      <el-collapse-item title="涓嬫闅忚" name="next">
-        <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="璇烽�夋嫨闅忚鏂瑰紡(渚濆嚭闄㈡椂闂磋绠�)"
-                style="width: 90%"
-              >
-                <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"
+          <!-- 涓婃闅忚淇℃伅 - 榛樿鎶樺彔 -->
+          <el-collapse-item title="涓婃闅忚" name="last">
+            <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"
+                    style="width: 90%"
+                  >
+                    <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"
+                    style="width: 95%"
+                  ></el-date-picker>
+                </el-form-item>
+              </el-col>
+            </el-row>
+            <el-form-item label="闅忚璁板綍">
+              <el-input
                 class="custom-disabled"
-                style="width: 92%"
-                value-format="yyyy-MM-dd hh:mm:ss"
-                @change="checkFollowupDate"
-              ></el-date-picker>
+                type="textarea"
+                disabled
+                v-model="form.remark2"
+              ></el-input>
             </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-collapse-item>
-    </el-collapse>
-  </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>
+          </el-collapse-item>
+
+          <!-- 涓嬫闅忚淇℃伅 - 榛樿灞曞紑 -->
+          <el-collapse-item title="涓嬫闅忚" name="next">
+            <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="璇烽�夋嫨闅忚鏂瑰紡(渚濆嚭闄㈡椂闂磋绠�)"
+                    style="width: 90%"
+                  >
+                    <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"
+                    style="width: 92%"
+                    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-collapse-item>
+        </el-collapse>
+      </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> -->
 
@@ -1361,7 +1410,7 @@
     };
     return {
       visitAgain: 1,
-      activeNames: ['next'], // 鍙睍寮�"涓嬫闅忚"锛屽叾浠栭兘鎶樺彔
+      activeNames: ["next"], // 鍙睍寮�"涓嬫闅忚"锛屽叾浠栭兘鎶樺彔
       userid: "",
       defaultKey: false, //鏄惁鍙粯璁ゅ~鎶�
       currentPhoneNumber: "",
@@ -1572,6 +1621,10 @@
           value: "涓�骞村悗",
           label: "涓�骞村悗",
         },
+        {
+          value: "浜斿勾鍚�",
+          label: "浜斿勾鍚�",
+        },
       ],
       statusTimer: null,
       userform: {},
@@ -1635,7 +1688,15 @@
     console.log(store.getters.visitAgain);
 
     this.orgname = localStorage.getItem("orgname");
-    if (this.orgname == "鐪佺珛鍚屽痉缈犺嫅闄㈠尯") {
+    console.log(localStorage.getItem("orgname"));
+
+    if (
+      this.orgname == "鐪佺珛鍚屽痉缈犺嫅闄㈠尯" ||
+      this.orgname == "鐪佺珛鍚屽痉涔嬫睙闄㈠尯" ||
+      this.orgname == "鐪佺珛鍚屽痉闂叉灄闄㈠尯" ||
+      this.orgname == "鐪佺珛鍚屽痉闈掑北婀栭櫌鍖�" ||
+      this.orgname == "鐪佺珛鍚屽痉澶╃洰灞辫矾闄㈠尯"
+    ) {
       this.showContinuationCareBtn = true;
     }
 
@@ -1709,8 +1770,21 @@
       }
     },
     handleCollapseChange(val) {
-    console.log('鎶樺彔闈㈡澘鐘舵�佸彉鍖�:', val);
-  },
+      console.log("鎶樺彔闈㈡澘鐘舵�佸彉鍖�:", val);
+    },
+    Tooltipy(h, { column }) {
+      return h(
+        "el-tooltip",
+        {
+          props: {
+            content: "浠诲姟閰嶇疆澶氱琛ュ伩绫诲瀷鏃讹紝鏈�鏂版墽琛岀被鍨嬬殑搴旈殢璁挎椂闂�",
+            placement: "top",
+            effect: "dark",
+          },
+        },
+        [h("span", column.label)]
+      );
+    },
     getconfigKey() {
       getconfigKey("default.value.icon").then((res) => {
         if (res.msg) {
@@ -1888,6 +1962,8 @@
         followupDate.setMonth(dischargeDate.getMonth() + 6);
       } else if (value.includes("涓�骞村悗") || value.includes("12涓湀鍚�")) {
         followupDate.setFullYear(dischargeDate.getFullYear() + 1);
+      } else if (value.includes("浜斿勾鍚�")) {
+        followupDate.setFullYear(dischargeDate.getFullYear() + 5);
       }
 
       if (followupDate < now) {
@@ -2092,6 +2168,8 @@
             path: "/followvisit/discharge",
           });
         }
+      } else {
+        location.reload();
       }
     },
     // 鐢佃瘽============================
@@ -2391,6 +2469,8 @@
           this.form = res.rows[0].serviceSubtaskList.find(
             (item) => item.id == this.id
           );
+          this.form.taskSituation = String(this.form.taskSituation);
+
           console.log(this.form.templatename, "templatename");
 
           this.form.remark = this.form.remark || "";
@@ -2455,7 +2535,12 @@
           this.$modal.msgError("鍙戦�佸け璐�");
         });
     },
-    Editsingletaskson(son) {
+    // 寮傚父澶勭悊
+    exceptionHandling(sid) {
+      this.Editsingletaskson(1, sid);
+    },
+    // 瀛樺偍鎰忚鑷姩瀛樺偍
+    Editsingletaskson(son, sid) {
       let objson = {};
       getTaskservelist({
         patid: this.patid,
@@ -2463,13 +2548,14 @@
       }).then((res) => {
         if (res.code == 200) {
           objson = res.rows[0].serviceSubtaskList[0];
-          objson.suggest = son;
+          objson.suggest = sid ? this.form.suggest : son;
+          objson.excep = sid ? sid : 0;
           objson.remark = this.form.remark;
           objson.sendstate = this.serviceStates;
           objson.taskSituation = this.form.taskSituation;
           Editsingletaskson(objson).then((res) => {
             if (res.code) {
-              this.$modal.msgSuccess("鏈嶅姟璁板綍鎴愬姛");
+              this.$modal.msgSuccess("鏈嶅姟璁板綍鏇存柊鎴愬姛");
               this.getTaskservelist();
             }
           });
@@ -2647,7 +2733,7 @@
       }
       let selectedOptionObj = null;
       if (this.Voicetype) {
-        console.log('Voicetype');
+        console.log("Voicetype");
 
         selectedOptionObj = options.find(
           (item) => item.targetvalue == selectedOption
@@ -2978,7 +3064,7 @@
   .call-action {
     width: 60%;
     min-width: 0;
-    height: 100%;
+    // height: 100%;
     /* 纭繚楂樺害缁ф壙 */
   }
 }
@@ -3250,7 +3336,7 @@
 .CONTENT {
   padding: 10px;
   height: 100%;
-  min-height: 738px;
+  // min-height: 938px;
   /* 璁剧疆鏈�灏忛珮搴� */
 
   .title {
@@ -3266,7 +3352,7 @@
   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;
+  max-height: 916px;
   /* 璁剧疆鏈�澶ч珮搴� */
   overflow-y: auto;
   /* 鍐呭瓒呰繃楂樺害鏃舵樉绀烘粴鍔ㄦ潯 */
@@ -4059,5 +4145,4 @@
   padding: 20px 15px;
   background-color: #fff;
 }
-
 </style>
diff --git a/src/views/followvisit/record/index.vue b/src/views/followvisit/record/index.vue
index c485cfd..38c6868 100644
--- a/src/views/followvisit/record/index.vue
+++ b/src/views/followvisit/record/index.vue
@@ -70,7 +70,7 @@
             placeholder="璇疯緭鍏ヨ瘖鏂悕绉�"
           ></el-input>
         </el-form-item>
-        <el-form-item label="鏈嶅姟鐘舵��" prop="status">
+        <!-- <el-form-item label="鏈嶅姟鐘舵��" prop="status">
           <el-select
             v-model="topqueryParams.sendstateView"
             placeholder="璇烽�夋嫨"
@@ -83,6 +83,16 @@
             >
             </el-option>
           </el-select>
+        </el-form-item> -->
+        <el-form-item label="闅忚鐘舵��" prop="status">
+          <el-cascader
+            v-model="serviceStatusValue"
+            placeholder="璇烽�夋嫨"
+            :options="serviceStatusOptions"
+            :props="cascaderProps"
+            @change="handleServiceStatusChange"
+            clearable
+          ></el-cascader>
         </el-form-item>
         <el-form-item label="鎺掑簭鏂瑰紡" prop="status">
           <el-select v-model="topqueryParams.sort" placeholder="璇烽�夋嫨">
@@ -234,7 +244,7 @@
           width="120"
         >
           <template slot-scope="scope">
-             <el-tooltip
+            <el-tooltip
               class="item"
               effect="dark"
               :content="scope.row.remark"
@@ -414,7 +424,7 @@
           prop="templatename"
           width="200"
         />
-         <el-table-column
+        <el-table-column
           label="浠诲姟鐘舵��"
           align="center"
           key="sendstate"
@@ -762,7 +772,7 @@
 export default {
   name: "Discharge",
   dicts: ["sys_normal_disable", "sys_user_sex", "sys_yujing", "sys_suggest"],
-  components: { Treeselect,StatisticsCards },
+  components: { Treeselect, StatisticsCards },
   data() {
     return {
       // 閬僵灞�
@@ -847,6 +857,41 @@
       previewvalue: {
         username: "杩欎釜鍖荤敓瀵逛綘鎬庝箞鏍�",
       },
+      // 绾ц仈閫夋嫨鍣ㄧ粦瀹氬��
+      serviceStatusValue: 10,
+      cascaderProps: {
+        expandTrigger: "hover", // 鎮仠灞曞紑
+        checkStrictly: true, // 鉁� 鍏抽敭锛氬厑璁搁�変腑浠绘剰涓�绾�
+        emitPath: false, // 鉁� 鍙繑鍥為�変腑鐨勫�硷紝涓嶈繑鍥炶矾寰勬暟缁�
+      },
+      // 鏈嶅姟鐘舵�侀�夐」锛堜竴绾у拰浜岀骇鍊间笉鍐茬獊锛�
+      serviceStatusOptions: [
+        {
+          value: null,
+          label: "鍏ㄩ儴",
+        },
+        {
+          value: 10, // 涓�绾э細寰呴殢璁�
+          label: "寰呴殢璁�",
+          children: [
+            { value: 1, label: "琚鍙�" },
+            { value: 2, label: "寰呭彂閫�" },
+            { value: 3, label: "宸插彂閫�" },
+            { value: 5, label: "鍙戦�佸け璐�" },
+            { value: 7, label: "瓒呮椂" },
+          ],
+        },
+        {
+          value: 20, // 涓�绾э細宸插畬鎴�
+          label: "宸插畬鎴�",
+          children: [{ value: 6, label: "宸插畬鎴�" }],
+        },
+        {
+          value: 30, // 涓�绾э細鏃犻渶闅忚
+          label: "鏃犻渶闅忚",
+          children: [{ value: 4, label: "涓嶆墽琛�" }],
+        },
+      ],
       value: [],
       list: [],
       endOut: localStorage.getItem("orgname") == "涓芥按甯備腑鍖婚櫌" ? 0 : 1, //0 鍑洪櫌鏃堕棿(姝e簭)    1 鍑洪櫌鏃堕棿(鍊掑簭)   2 鍙戦�佹椂闂�(姝e簭)    3 鍙戦�佹椂闂�(鍊掑簭)  7搴旈殢璁挎棩鏈�(鍊掑簭) 搴旈殢璁挎棩鏈�(姝e簭)
@@ -1233,6 +1278,36 @@
         this.options = [];
       }
     },
+    handleServiceStatusChange(value) {
+      // 娓呯┖閫夋嫨
+      if (value === null || value === undefined || value === "") {
+        this.topqueryParams.sendstateView = null;
+        this.topqueryParams.sendstate = null;
+        return;
+      }
+      console.log(value, "value");
+
+      // 涓�绾ц妭鐐圭殑鍊硷紙澶т簬绛変簬10锛�
+      if (value >= 10) {
+        // 閫変腑浜嗕竴绾�
+        switch (value) {
+          case 10:
+            this.topqueryParams.sendstateView = 1; // 寰呴殢璁�
+            break;
+          case 20:
+            this.topqueryParams.sendstateView = 2; // 宸插畬鎴�
+            break;
+          case 30:
+            this.topqueryParams.sendstateView = 3; // 鏃犻渶闅忚
+            break;
+        }
+        this.topqueryParams.sendstate = null;
+      } else {
+        // 閫変腑浜嗕簩绾э紙鍏蜂綋鐘舵�侊級
+        this.topqueryParams.sendstateView = null;
+        this.topqueryParams.sendstate = value;
+      }
+    },
     // 褰卞儚闅忚鐘舵�佷慨鏀�
     handleStatusChange(row) {
       let text = row.status === "0" ? "鍚敤" : "鍋滅敤";
@@ -1308,13 +1383,15 @@
     /** 閲嶇疆鎸夐挳鎿嶄綔 */
     resetQuery() {
       this.dateRange = [];
+      this.serviceStatusValue = 10;
+
       this.topqueryParams = {
         pageNum: 1,
         pageSize: 10,
         serviceType: 13,
         sort: 2,
         searchscope: 2,
-        sendstate: 2,
+        sendstateView: 1,
         scopetype: [],
         leaveldeptcodes: [],
         leavehospitaldistrictcodes: [],
diff --git a/src/views/followvisit/tasklist/index.vue b/src/views/followvisit/tasklist/index.vue
index d5409b2..0d7ef85 100644
--- a/src/views/followvisit/tasklist/index.vue
+++ b/src/views/followvisit/tasklist/index.vue
@@ -2,7 +2,6 @@
   <div class="app-container">
     <el-row :gutter="20">
       <!--鐢ㄦ埛鏁版嵁-->
-
       <el-form
         :model="topqueryParams"
         ref="queryForm"
@@ -34,7 +33,6 @@
             end-placeholder="缁撴潫鏃ユ湡"
           ></el-date-picker>
         </el-form-item>
-
         <el-form-item label="浠诲姟妯℃澘" prop="status">
           <el-input
             v-model="topqueryParams.templatename"
@@ -107,38 +105,8 @@
             >鏂板缓浠诲姟</el-button
           >
         </el-col>
-
-        <!-- <el-col :span="19">
-          <div class="documentf">
-            <div class="document">
-              <el-button
-                type="warning"
-                plain
-                icon="el-icon-download"
-                size="medium"
-                @click="handleExport"
-                v-hasPermi="['system:user:export']"
-                >瀵煎嚭</el-button
-              >
-            </div>
-          </div>
-        </el-col> -->
-        <!-- <el-col :span="1.5"> </el-col> -->
       </el-row>
-      <!-- <right-toolbar
-              :showSearch.sync="showSearch"
-              @queryTable="getList"
-              :columns="columns"
-            ></right-toolbar> -->
       <el-table v-loading="loading" :data="userList">
-        <!-- <el-table-column
-          label="搴忓彿"
-          fixed
-          align="center"
-          key="taskid"
-          prop="taskid"
-        /> -->
-
         <el-table-column
           label="浠诲姟鍚嶇О"
           fixed
@@ -184,29 +152,24 @@
           key="longTask"
           prop="longTask"
         >
-          <!-- <template slot-scope="scope">
-            <span>{{ scope.row.longTask ? "闀挎湡浠诲姟" : "闈為暱鏈�" }}</span>
-          </template> -->
-           <template slot-scope="scope">
-
-              <div v-if="scope.row.longTask == 0">
-                <el-tag type="primary" :disable-transitions="false"
-                  >鑷畾涔夊懆鏈熶换鍔�</el-tag
-                >
-              </div>
-              <div v-if="scope.row.longTask == 1">
-                <el-tag type="success" :disable-transitions="false"
-                  >闀挎湡浠诲姟</el-tag
-                >
-              </div>
-              <div v-if="scope.row.longTask == 2">
-                <el-tag type="success" :disable-transitions="false"
-                  >鍥哄畾浠诲姟</el-tag
-                >
-              </div>
+          <template slot-scope="scope">
+            <div v-if="scope.row.longTask == 0">
+              <el-tag type="primary" :disable-transitions="false"
+                >鑷畾涔夊懆鏈熶换鍔�</el-tag
+              >
+            </div>
+            <div v-if="scope.row.longTask == 1">
+              <el-tag type="success" :disable-transitions="false"
+                >闀挎湡浠诲姟</el-tag
+              >
+            </div>
+            <div v-if="scope.row.longTask == 2">
+              <el-tag type="success" :disable-transitions="false"
+                >鍥哄畾浠诲姟</el-tag
+              >
+            </div>
           </template>
         </el-table-column>
-
         <el-table-column
           label="鐘舵��"
           align="center"
@@ -220,7 +183,6 @@
             />
           </template>
         </el-table-column>
-
         <el-table-column
           label="鍒涘缓浜�"
           align="center"
@@ -238,12 +200,11 @@
             <span>{{ formatTime(scope.row.createTime) }}</span>
           </template>
         </el-table-column>
-
         <el-table-column
           label="鎿嶄綔"
           fixed="right"
           align="center"
-          width="240"
+          width="320"
           class-name="small-padding fixed-width"
         >
           <template slot-scope="scope">
@@ -259,11 +220,6 @@
                 ><i class="el-icon-s-promotion"></i>鍙戣捣</span
               ></el-button
             >
-            <!-- <el-button size="medium" type="text" @click="newAdd(scope.row)"
-              ><span class="button-xj"
-                ><i class="el-icon-circle-plus-outline"></i>缁堟</span
-              ></el-button
-            > -->
             <el-button
               size="medium"
               type="text"
@@ -286,13 +242,23 @@
               @click="stop(scope.row)"
               ><span class="button-zt">鏆傚仠</span></el-button
             >
+            <!-- 鏂板浜岀淮鐮佹寜閽� -->
+            <el-button
+              v-if="orgname == '鐪佺珛鍚屽痉缈犺嫅闄㈠尯'"
+              size="medium"
+              type="text"
+              @click="handleQrCode(scope.row)"
+              ><span class="button-qr"
+                ><i class="el-icon-s-grid"></i>浜岀淮鐮�</span
+              ></el-button
+            >
           </template>
         </el-table-column>
         <el-table-column
           label="浠诲姟璇︽儏"
           fixed="right"
           align="center"
-          width="240"
+          width="180"
           class-name="small-padding fixed-width"
         >
           <template slot-scope="scope">
@@ -304,7 +270,6 @@
                 ><i class="el-icon-s-data"></i>璇︽儏</span
               ></el-button
             >
-
             <el-button size="medium" type="text" @click="deletefn(scope.row)"
               ><span class="button-sc"
                 ><i class="el-icon-delete"></i>鍒犻櫎</span
@@ -313,7 +278,6 @@
           </template>
         </el-table-column>
       </el-table>
-
       <pagination
         v-show="total > 0"
         :total="total"
@@ -322,6 +286,31 @@
         @pagination="getList"
       />
     </el-row>
+
+    <!-- 浜岀淮鐮佸脊绐� -->
+    <el-dialog
+      title="浠诲姟浜岀淮鐮�"
+      :visible.sync="qrDialogVisible"
+      width="400px"
+      center
+      :before-close="handleQrClose"
+    >
+      <div style="text-align: center; padding: 20px 0">
+        <div
+          id="qrCodeContainer"
+          ref="qrCodeContainer"
+          style="display: inline-block"
+        ></div>
+        <div style="margin-top: 15px; color: #606266; font-size: 14px">
+          璇蜂娇鐢ㄥ井淇�/娴忚鍣ㄦ壂鐮佽闂�
+        </div>
+      </div>
+      <span slot="footer" class="dialog-footer">
+        <el-button @click="downloadQrCode">涓嬭浇浜岀淮鐮�</el-button>
+        <el-button type="primary" @click="printQrCode">鎵撳嵃</el-button>
+        <el-button @click="qrDialogVisible = false">鍏抽棴</el-button>
+      </span>
+    </el-dialog>
     <!-- 纭鍙戣捣瀵硅瘽妗� -->
     <el-dialog
       title="浠诲姟鍙戣捣纭"
@@ -419,13 +408,16 @@
   getTasklist,
   delTaskInfo,
   TaskTemplateSendExecution,
+  scanGenerateSubtask,
+  goSfRelay,
 } from "@/api/AiCentre/index";
 import store from "@/store";
 import PatientSelection from "@/components/PatientSelection"; //姝e垯缁勪欢
 import SFtable from "@/components/SFtable"; //琛ㄦ牸缁勪欢
 import Treeselect from "@riophae/vue-treeselect";
 import "@riophae/vue-treeselect/dist/vue-treeselect.css";
-
+// 寮曞叆浜岀淮鐮佸簱
+import QRCode from "qrcode";
 export default {
   name: "Tasklist",
   dicts: ["sys_normal_disable", "sys_user_sex", "task_status"],
@@ -454,6 +446,10 @@
       deptName: undefined,
       // 榛樿瀵嗙爜
       initPassword: undefined,
+      // 浜岀淮鐮佺浉鍏�
+      qrDialogVisible: false,
+      qrCodeUrl: "", // 涓棿椤甸摼鎺�
+      qrCodeCanvas: null, // 瀛樺偍canvas寮曠敤
       // 鏃ユ湡鑼冨洿
       dateRange: [],
       // 宀椾綅閫夐」
@@ -1021,22 +1017,25 @@
 
     // 鏆傚仠
     stop(row) {
-      this.$modal
-        .confirm('鏄惁纭鏆傚仠"' + row.taskName + '"锛�')
-        .then(function () {
-          if (row.sendState == 2) {
-            this.TaskOperation.taskId = row.taskid;
-            this.TaskOperation.sendState = 3;
-            this.TaskOperation.sendType = "";
-            this.TaskOperation.taskType = row.type;
+      if (row.sendState == 2) {
+        this.TaskOperation.taskId = row.taskid;
+        console.log(11);
+
+        this.TaskOperation.sendState = 3;
+        this.TaskOperation.sendType = "";
+        this.TaskOperation.taskType = row.type;
+
+        this.$modal
+          .confirm('鏄惁纭鏆傚仠"' + row.taskName + '"锛�')
+          .then(() => {
             TaskTemplateSendExecution(this.TaskOperation).then((res) => {
               this.$modal.msgSuccess("浠诲姟宸叉殏鍋�");
               this.getList();
             });
-          }
-        })
+          })
 
-        .catch(() => {});
+          .catch(() => {});
+      }
     },
 
     /** 鎻愪氦鎸夐挳 */
@@ -1095,6 +1094,107 @@
       this.dialogVisiblepatient = false; // 鎵嬪姩鎺у埗寮圭獥鏄剧ず
       this.handleQuery();
     },
+    // ============浜岀淮鐮佺浉鍏�
+    /**
+     * 鐢熸垚浜岀淮鐮�
+     */
+    handleQrCode(row) {
+      // 1. 鏋勯�犺姹傚弬鏁�
+      const params = {
+        taskId: row.taskid,
+        deptcode: row.deptcode || "", // 褰撳墠鐢ㄦ埛閮ㄩ棬缂栫爜锛岃纭繚 store 涓湁璇� getter
+        leavehospitaldistrictcode: row.leavehospitaldistrictcode || "", // 杞负閫楀彿鍒嗛殧瀛楃涓诧紝瑙嗘帴鍙i渶姹�
+        // 濡傛灉鏈夊叾浠栧弬鏁板 hospitalDistrictCode 涔熷彲琛ュ厖
+      };
+      // 2. 璋冪敤 goSfRelay 鑾峰彇涓棿椤甸摼鎺�
+      goSfRelay(params)
+        .then((res) => {
+          if (res.code == 200) {
+            this.qrCodeUrl = res.msg; // 鍋囪杩斿洖 data 涓哄畬鏁� URL
+            this.qrDialogVisible = true;
+            this.$nextTick(() => {
+              this.generateQrCode(this.qrCodeUrl);
+            });
+          } else {
+            this.$modal.msgError("鑾峰彇浜岀淮鐮侀摼鎺ュけ璐�");
+          }
+        })
+        .catch(() => {
+          this.$modal.msgError("鑾峰彇浜岀淮鐮侀摼鎺ュ紓甯�");
+        });
+    },
+
+    /**
+     * 鐢熸垚浜岀淮鐮佸浘鐗�
+     */
+    generateQrCode(url) {
+      const container = this.$refs.qrCodeContainer;
+      if (!container) return;
+      // 娓呯┖瀹瑰櫒
+      container.innerHTML = "";
+      // 浣跨敤 QRCode 搴撶粯鍒� canvas
+      QRCode.toCanvas(url, { width: 200, margin: 2 }, (err, canvas) => {
+        if (err) {
+          console.error(err);
+          this.$modal.msgError("鐢熸垚浜岀淮鐮佸け璐�");
+          return;
+        }
+        container.appendChild(canvas);
+        this.qrCodeCanvas = canvas; // 淇濆瓨寮曠敤渚夸簬涓嬭浇
+      });
+    },
+
+    /**
+     * 涓嬭浇浜岀淮鐮侊紙淇濆瓨涓哄浘鐗囷級
+     */
+    downloadQrCode() {
+      if (!this.qrCodeCanvas) {
+        this.$modal.msgWarning("璇峰厛鐢熸垚浜岀淮鐮�");
+        return;
+      }
+      const link = document.createElement("a");
+      link.download = `task_qrcode_${Date.now()}.png`;
+      link.href = this.qrCodeCanvas.toDataURL("image/png");
+      link.click();
+    },
+
+    /**
+     * 鎵撳嵃浜岀淮鐮侊紙璋冪敤娴忚鍣ㄦ墦鍗帮紝鍙墦鍗颁簩缁寸爜鍖哄煙锛�
+     */
+    printQrCode() {
+      if (!this.qrCodeCanvas) {
+        this.$modal.msgWarning("璇峰厛鐢熸垚浜岀淮鐮�");
+        return;
+      }
+      // 鏋勯�犳墦鍗板唴瀹�
+      const printWindow = window.open("", "_blank", "width=400,height=400");
+      const doc = printWindow.document;
+      doc.write(`
+        <html>
+          <head><title>鎵撳嵃浜岀淮鐮�</title></head>
+          <body style="text-align:center;padding-top:50px;">
+            <img src="${this.qrCodeCanvas.toDataURL(
+              "image/png"
+            )}" style="width:300px;height:300px;" />
+            <p style="font-size:14px;color:#666;">璇蜂娇鐢ㄥ井淇�/娴忚鍣ㄦ壂鐮�</p>
+          </body>
+        </html>
+      `);
+      doc.close();
+      printWindow.focus();
+      printWindow.print();
+    },
+
+    /**
+     * 鍏抽棴浜岀淮鐮佸脊绐�
+     */
+    handleQrClose() {
+      this.qrDialogVisible = false;
+      this.qrCodeUrl = "";
+      this.qrCodeCanvas = null;
+      const container = this.$refs.qrCodeContainer;
+      if (container) container.innerHTML = "";
+    },
   },
 };
 </script>
@@ -1127,7 +1227,10 @@
     font-size: 23px;
   }
 }
-
+.button-qr {
+  font-weight: 500;
+  color: #e6a23c;
+}
 .uploading {
   margin-top: 20px;
   margin: 20px;
@@ -1188,42 +1291,50 @@
     }
   }
 }
+
 .button-bb {
   font-weight: 500;
   color: #2ba05c;
 }
+
 .button-xq {
   font-weight: 500;
   color: #409eff;
 }
+
 .button-sc {
   font-weight: 500;
   color: #dd302a;
 }
+
 .button-zx {
   background: #4fabe9;
   padding: 5px;
   border-radius: 1px;
   color: #ffffff;
 }
+
 .button-lj {
   background: #e9614f;
   padding: 5px;
   border-radius: 1px;
   color: #ffffff;
 }
+
 .button-xj {
   background: #815c94;
   padding: 5px;
   border-radius: 1px;
   color: #ffffff;
 }
+
 .button-zt {
   background: #f9c116;
   padding: 5px;
   border-radius: 1px;
   color: #ffffff;
 }
+
 .button-hz {
   background: #63d37b;
   padding: 5px;
@@ -1240,6 +1351,7 @@
 ::v-deep.el-button + .el-button {
   margin-left: 0;
 }
+
 ::v-deep.el-checkbox-group {
   span {
     font-size: 24px;
diff --git a/src/views/followvisit/zysatisfaction/index.vue b/src/views/followvisit/zysatisfaction/index.vue
index a0b932b..565b21d 100644
--- a/src/views/followvisit/zysatisfaction/index.vue
+++ b/src/views/followvisit/zysatisfaction/index.vue
@@ -1,6 +1,6 @@
 <template>
   <div class="app-container">
-     <statistics-cards
+    <statistics-cards
       :cardlist="cardlist"
       :ycvalue="ycvalue"
       :jgvalue="jgvalue"
@@ -78,7 +78,7 @@
           ></el-cascader>
         </el-form-item>
 
-        <el-form-item label="鏈嶅姟鐘舵��" prop="status">
+        <!-- <el-form-item label="鏈嶅姟鐘舵��" prop="status">
           <el-select
             v-model="topqueryParams.sendstateView"
             placeholder="璇烽�夋嫨"
@@ -91,6 +91,16 @@
             >
             </el-option>
           </el-select>
+        </el-form-item> -->
+        <el-form-item label="闅忚鐘舵��" prop="status">
+          <el-cascader
+            v-model="serviceStatusValue"
+            placeholder="璇烽�夋嫨"
+            :options="serviceStatusOptions"
+            :props="cascaderProps"
+            @change="handleServiceStatusChange"
+            clearable
+          ></el-cascader>
         </el-form-item>
         <el-form-item label="鎺掑簭鏂瑰紡" prop="status">
           <el-select v-model="topqueryParams.sort" placeholder="璇烽�夋嫨">
@@ -258,7 +268,7 @@
           width="120"
         >
           <template slot-scope="scope">
-             <el-tooltip
+            <el-tooltip
               class="item"
               effect="dark"
               :content="scope.row.remark"
@@ -427,7 +437,7 @@
           prop="templatename"
           width="200"
         />
-         <el-table-column
+        <el-table-column
           label="浠诲姟鐘舵��"
           align="center"
           key="sendstate"
@@ -814,22 +824,22 @@
             </el-form-item>
           </el-col>
         </el-row>
-       <el-row>
-  <el-col :span="24">
-    <el-form-item label="杩囨护鍘熷洜">
-      <el-input
-        v-model="form.notrequiredreason"
-        type="textarea"
-        placeholder="璇疯緭鍏ヨ繃婊ゅ師鍥�"
-      ></el-input>
-      <!-- 鎻愰啋鏂囧瓧 -->
-      <div class="filter-warning">
-        <i class="el-icon-warning-outline"></i>
-        璇ュ姛鑳介�傜敤浜庢浜°�佸垪鍏ュ尰闄㈤粦鍚嶅崟銆佹槑纭嫆缁濋殢璁跨瓑鎮h�呯殑杩囨护鎺掗櫎锛岃繃婊ゅ悗璇ユ偅鑰呮墍鏈夎繘琛屼腑浠诲姟鍏ㄩ儴鍋滄涓旀棤娉曞尮閰嶆柊鐨勯殢璁夸换鍔★紝璇疯皑鎱庢搷浣滐紒
-      </div>
-    </el-form-item>
-  </el-col>
-</el-row>
+        <el-row>
+          <el-col :span="24">
+            <el-form-item label="杩囨护鍘熷洜">
+              <el-input
+                v-model="form.notrequiredreason"
+                type="textarea"
+                placeholder="璇疯緭鍏ヨ繃婊ゅ師鍥�"
+              ></el-input>
+              <!-- 鎻愰啋鏂囧瓧 -->
+              <div class="filter-warning">
+                <i class="el-icon-warning-outline"></i>
+                璇ュ姛鑳介�傜敤浜庢浜°�佸垪鍏ュ尰闄㈤粦鍚嶅崟銆佹槑纭嫆缁濋殢璁跨瓑鎮h�呯殑杩囨护鎺掗櫎锛岃繃婊ゅ悗璇ユ偅鑰呮墍鏈夎繘琛屼腑浠诲姟鍏ㄩ儴鍋滄涓旀棤娉曞尮閰嶆柊鐨勯殢璁夸换鍔★紝璇疯皑鎱庢搷浣滐紒
+              </div>
+            </el-form-item>
+          </el-col>
+        </el-row>
       </el-form>
       <div slot="footer" class="dialog-footer">
         <el-button type="primary" @click="submitForm">纭� 瀹�</el-button>
@@ -940,7 +950,7 @@
 export default {
   name: "Discharge",
   dicts: ["sys_normal_disable", "sys_user_sex", "sys_yujing", "sys_suggest"],
-  components: { Treeselect,StatisticsCards },
+  components: { Treeselect, StatisticsCards },
   data() {
     return {
       // 閬僵灞�
@@ -1035,6 +1045,41 @@
           value: 0,
         },
       ],
+      // 绾ц仈閫夋嫨鍣ㄧ粦瀹氬��
+      serviceStatusValue: 10,
+      cascaderProps: {
+        expandTrigger: "hover", // 鎮仠灞曞紑
+        checkStrictly: true, // 鉁� 鍏抽敭锛氬厑璁搁�変腑浠绘剰涓�绾�
+        emitPath: false, // 鉁� 鍙繑鍥為�変腑鐨勫�硷紝涓嶈繑鍥炶矾寰勬暟缁�
+      },
+      // 鏈嶅姟鐘舵�侀�夐」锛堜竴绾у拰浜岀骇鍊间笉鍐茬獊锛�
+      serviceStatusOptions: [
+        {
+          value: null,
+          label: "鍏ㄩ儴",
+        },
+        {
+          value: 10, // 涓�绾э細寰呴殢璁�
+          label: "寰呴殢璁�",
+          children: [
+            { value: 1, label: "琚鍙�" },
+            { value: 2, label: "寰呭彂閫�" },
+            { value: 3, label: "宸插彂閫�" },
+            { value: 5, label: "鍙戦�佸け璐�" },
+            { value: 7, label: "瓒呮椂" },
+          ],
+        },
+        {
+          value: 20, // 涓�绾э細宸插畬鎴�
+          label: "宸插畬鎴�",
+          children: [{ value: 6, label: "宸插畬鎴�" }],
+        },
+        {
+          value: 30, // 涓�绾э細鏃犻渶闅忚
+          label: "鏃犻渶闅忚",
+          children: [{ value: 4, label: "涓嶆墽琛�" }],
+        },
+      ],
       zcrules: {
         date1: [
           { required: true, message: "璇烽�夋嫨闅忚鏂瑰紡", trigger: "change" },
@@ -1082,7 +1127,7 @@
       topqueryParams: {
         pageNum: 1,
         pageSize: 10,
-         sendstateView:
+        sendstateView:
           localStorage.getItem("orgname") == "鍗楀崕澶у闄勫睘绗竴鍖婚櫌" ? 1 : 2,
         sort: localStorage.getItem("orgname") == "涓芥按甯備腑鍖婚櫌" ? 8 : 2, //0 鍑洪櫌鏃堕棿(姝e簭)    1 鍑洪櫌鏃堕棿(鍊掑簭)   2 鍙戦�佹椂闂�(姝e簭)    3 鍙戦�佹椂闂�(鍊掑簭)  7搴旈殢璁挎棩鏈�(鍊掑簭) 搴旈殢璁挎棩鏈�(姝e簭)
         serviceType: 6,
@@ -1095,7 +1140,7 @@
       propss: { multiple: true },
       options: [],
 
-       topicoptions: [
+      topicoptions: [
         {
           value: null,
           label: "鍏ㄩ儴",
@@ -1288,6 +1333,37 @@
         this.total = response.total;
       });
     },
+    // 鏈嶅姟鐘舵�佸彉鏇村鐞�
+    handleServiceStatusChange(value) {
+      // 娓呯┖閫夋嫨
+      if (value === null || value === undefined || value === "") {
+        this.topqueryParams.sendstateView = null;
+        this.topqueryParams.sendstate = null;
+        return;
+      }
+      console.log(value, "value");
+
+      // 涓�绾ц妭鐐圭殑鍊硷紙澶т簬绛変簬10锛�
+      if (value >= 10) {
+        // 閫変腑浜嗕竴绾�
+        switch (value) {
+          case 10:
+            this.topqueryParams.sendstateView = 1; // 寰呴殢璁�
+            break;
+          case 20:
+            this.topqueryParams.sendstateView = 2; // 宸插畬鎴�
+            break;
+          case 30:
+            this.topqueryParams.sendstateView = 3; // 鏃犻渶闅忚
+            break;
+        }
+        this.topqueryParams.sendstate = null;
+      } else {
+        // 閫変腑浜嗕簩绾э紙鍏蜂綋鐘舵�侊級
+        this.topqueryParams.sendstateView = null;
+        this.topqueryParams.sendstate = value;
+      }
+    },
     affiliation() {
       this.topqueryParams.managementDoctorCode = store.getters.hisUserId;
 
@@ -1454,10 +1530,11 @@
     resetQuery() {
       this.dateRange = [];
       this.dateRangefs = [];
+      this.serviceStatusValue = 10;
       this.topqueryParams = {
         pageNum: 1,
         pageSize: 10,
-          sendstateView:
+        sendstateView:
           localStorage.getItem("orgname") == "鍗楀崕澶у闄勫睘绗竴鍖婚櫌" ? 1 : 2,
         sort: 2, //0 鍑洪櫌鏃堕棿(姝e簭)    1 鍑洪櫌鏃堕棿(鍊掑簭)   2 鍙戦�佹椂闂�(姝e簭)    3 鍙戦�佹椂闂�(鍊掑簭)
         serviceType: 6,
diff --git a/src/views/knowledge/drug/index.vue b/src/views/knowledge/drug/index.vue
index aa54bde..b50a5a2 100644
--- a/src/views/knowledge/drug/index.vue
+++ b/src/views/knowledge/drug/index.vue
@@ -1,27 +1,624 @@
 <template>
-  <div>
-鑽搧鐭ヨ瘑搴�
+  <div class="app-container">
+    <!-- ===== 鎼滅储鏍� ===== -->
+    <el-form
+      :model="queryParams"
+      ref="queryForm"
+      size="small"
+      :inline="true"
+      v-show="showSearch"
+      label-width="88px"
+    >
+      <el-form-item label="鑽搧鍚嶇О" prop="itemName">
+        <el-input
+          v-model="queryParams.itemName"
+          placeholder="璇疯緭鍏ヨ嵂鍝佸悕绉�"
+          clearable
+          style="width: 200px"
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
+      <el-form-item label="鑽搧缂栫爜" prop="itemCode">
+        <el-input
+          v-model="queryParams.itemCode"
+          placeholder="璇疯緭鍏ヨ嵂鍝佺紪鐮�"
+          clearable
+          style="width: 200px"
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
+      <el-form-item label="鐢熶骇鍘傚" prop="manufacturerName">
+        <el-input
+          v-model="queryParams.manufacturerName"
+          placeholder="璇疯緭鍏ョ敓浜у巶瀹�"
+          clearable
+          style="width: 200px"
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
+      <el-form-item label="鑽搧绫诲瀷" prop="medicationType">
+        <el-input
+          v-model="queryParams.medicationType"
+          placeholder="璇疯緭鍏ヨ嵂鍝佺被鍨�"
+          clearable
+          style="width: 200px"
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
+      <el-form-item>
+        <el-button
+          type="primary"
+          icon="el-icon-search"
+          size="mini"
+          @click="handleQuery"
+          >鎼滅储</el-button
+        >
+        <el-button icon="el-icon-refresh" size="mini" @click="resetQuery"
+          >閲嶇疆</el-button
+        >
+      </el-form-item>
+    </el-form>
+
+    <!-- ===== 鎿嶄綔鏍� ===== -->
+    <el-row :gutter="10" class="mb8">
+      <el-col :span="1.5">
+        <el-button
+          type="primary"
+          plain
+          icon="el-icon-plus"
+          size="mini"
+          @click="handleAdd"
+          >鏂板</el-button
+        >
+      </el-col>
+      <el-col :span="1.5">
+        <el-button
+          type="success"
+          plain
+          icon="el-icon-edit"
+          size="mini"
+          :disabled="single"
+          @click="handleUpdate"
+          >淇敼</el-button
+        >
+      </el-col>
+      <el-col :span="1.5">
+        <el-button
+          type="danger"
+          plain
+          icon="el-icon-delete"
+          size="mini"
+          :disabled="multiple"
+          @click="handleDelete"
+          >鍒犻櫎</el-button
+        >
+      </el-col>
+      <el-col :span="1.5">
+        <el-button
+          type="warning"
+          plain
+          icon="el-icon-download"
+          size="mini"
+          @click="handleExport"
+          >瀵煎嚭</el-button
+        >
+      </el-col>
+      <right-toolbar :showSearch.sync="showSearch" @queryTable="getList" />
+    </el-row>
+
+    <!-- ===== 琛ㄦ牸 ===== -->
+    <el-table
+      v-loading="loading"
+      :data="drugList"
+      @selection-change="handleSelectionChange"
+    >
+      <el-table-column type="selection" width="55" align="center" />
+      <el-table-column
+        label="鑽搧缂栫爜"
+        align="center"
+        prop="itemCode"
+        :show-overflow-tooltip="true"
+        width="120"
+      />
+      <el-table-column
+        label="鑽搧鍚嶇О"
+        align="center"
+        prop="itemName"
+        :show-overflow-tooltip="true"
+        min-width="150"
+      />
+      <el-table-column
+        label="閫氱敤鍚�"
+        align="center"
+        prop="medicationCommonName"
+        :show-overflow-tooltip="true"
+        min-width="120"
+      />
+      <el-table-column
+        label="瑙勬牸"
+        align="center"
+        prop="specification"
+        width="120"
+      />
+      <el-table-column
+        label="鍓傚瀷"
+        align="center"
+        prop="doseFormName"
+        width="100"
+      />
+      <el-table-column
+        label="鐢熶骇鍘傚"
+        align="center"
+        prop="manufacturerName"
+        :show-overflow-tooltip="true"
+        min-width="150"
+      />
+      <el-table-column
+        label="鎵瑰噯鏂囧彿"
+        align="center"
+        prop="licenseNumber"
+        width="140"
+      />
+      <el-table-column
+        label="闆跺敭浠�"
+        align="center"
+        prop="retailPrice"
+        width="100"
+      />
+      <el-table-column label="鐘舵��" align="center" prop="status" width="80">
+        <template slot-scope="scope">
+          <el-tag
+            :type="scope.row.status == 1 ? 'success' : 'danger'"
+            size="small"
+          >
+            {{ scope.row.status == 1 ? "鍚敤" : "绂佺敤" }}
+          </el-tag>
+        </template>
+      </el-table-column>
+      <el-table-column
+        label="鎿嶄綔"
+        align="center"
+        width="160"
+        class-name="small-padding fixed-width"
+      >
+        <template slot-scope="scope">
+          <el-button
+            size="mini"
+            type="text"
+            icon="el-icon-edit"
+            @click="handleUpdate(scope.row)"
+            >淇敼</el-button
+          >
+          <el-button
+            size="mini"
+            type="text"
+            icon="el-icon-delete"
+            @click="handleDelete(scope.row)"
+            >鍒犻櫎</el-button
+          >
+        </template>
+      </el-table-column>
+    </el-table>
+
+    <pagination
+      v-show="total > 0"
+      :total="total"
+      :page.sync="queryParams.pageNum"
+      :limit.sync="queryParams.pageSize"
+      @pagination="getList"
+    />
+
+    <!-- ===== 鏂板/淇敼寮圭獥 ===== -->
+    <el-dialog
+      :title="title"
+      :visible.sync="open"
+      width="700px"
+      append-to-body
+      :close-on-click-modal="false"
+    >
+      <el-form ref="form" :model="form" :rules="rules" label-width="110px">
+        <el-row :gutter="20">
+          <el-col :span="12">
+            <el-form-item label="鑽搧鍚嶇О" prop="itemName">
+              <el-input v-model="form.itemName" placeholder="璇疯緭鍏ヨ嵂鍝佸悕绉�" />
+            </el-form-item>
+          </el-col>
+          <el-col :span="12">
+            <el-form-item label="鑽搧缂栫爜" prop="itemCode">
+              <el-input v-model="form.itemCode" placeholder="璇疯緭鍏ヨ嵂鍝佺紪鐮�" />
+            </el-form-item>
+          </el-col>
+        </el-row>
+        <el-row :gutter="20">
+          <el-col :span="12">
+            <el-form-item label="鑽搧閫氱敤鍚�" prop="medicationCommonName">
+              <el-input
+                v-model="form.medicationCommonName"
+                placeholder="璇疯緭鍏ヨ嵂鍝侀�氱敤鍚�"
+              />
+            </el-form-item>
+          </el-col>
+          <el-col :span="12">
+            <el-form-item label="鑽搧璇嗗埆鐮�">
+              <el-input
+                v-model="form.identificationCode"
+                placeholder="璇疯緭鍏ヨ嵂鍝佽瘑鍒爜"
+              />
+            </el-form-item>
+          </el-col>
+        </el-row>
+        <el-row :gutter="20">
+          <el-col :span="12">
+            <el-form-item label="瑙勬牸" prop="specification">
+              <el-input
+                v-model="form.specification"
+                placeholder="濡� 0.25g*24绮�"
+              />
+            </el-form-item>
+          </el-col>
+          <el-col :span="12">
+            <el-form-item label="鍓傚瀷">
+              <el-input v-model="form.doseFormName" placeholder="濡� 鑳跺泭鍓�" />
+            </el-form-item>
+          </el-col>
+        </el-row>
+        <el-row :gutter="20">
+          <el-col :span="12">
+            <el-form-item label="鐢熶骇鍘傚" prop="manufacturerName">
+              <el-input
+                v-model="form.manufacturerName"
+                placeholder="璇疯緭鍏ョ敓浜у巶瀹�"
+              />
+            </el-form-item>
+          </el-col>
+          <el-col :span="12">
+            <el-form-item label="鎵瑰噯鏂囧彿">
+              <el-input
+                v-model="form.licenseNumber"
+                placeholder="璇疯緭鍏ユ壒鍑嗘枃鍙�"
+              />
+            </el-form-item>
+          </el-col>
+        </el-row>
+        <el-row :gutter="20">
+          <el-col :span="12">
+            <el-form-item label="鑽搧绫诲瀷" prop="medicationType">
+              <el-input v-model="form.medicationType" placeholder="濡� 鎶楃敓绱�" />
+            </el-form-item>
+          </el-col>
+          <el-col :span="12">
+            <el-form-item label="闆跺敭浠�">
+              <el-input-number
+                v-model="form.retailPrice"
+                :precision="2"
+                :min="0"
+                style="width: 100%"
+                placeholder="璇疯緭鍏ラ浂鍞环"
+              />
+            </el-form-item>
+          </el-col>
+        </el-row>
+        <el-row :gutter="20">
+          <el-col :span="12">
+            <el-form-item label="灏忓寘瑁呭崟浣�">
+              <el-input v-model="form.smallPackageUnit" placeholder="濡� 鐩�" />
+            </el-form-item>
+          </el-col>
+          <el-col :span="12">
+            <el-form-item label="澶у寘瑁呭崟浣�">
+              <el-input v-model="form.largePackageUnit" placeholder="濡� 绠�" />
+            </el-form-item>
+          </el-col>
+        </el-row>
+        <el-row :gutter="20">
+          <el-col :span="12">
+            <el-form-item label="澶у皬鍖呰杞崲姣�">
+              <el-input-number
+                v-model="form.smallLargePackageRatio"
+                :min="0"
+                style="width: 100%"
+                placeholder="澶у皬鍖呰杞崲姣�"
+              />
+            </el-form-item>
+          </el-col>
+          <el-col :span="12">
+            <el-form-item label="鐘舵��" prop="status">
+              <el-select
+                v-model="form.status"
+                placeholder="璇烽�夋嫨鐘舵��"
+                style="width: 100%"
+              >
+                <el-option label="鍚敤" :value="1" />
+                <el-option label="绂佺敤" :value="0" />
+              </el-select>
+            </el-form-item>
+          </el-col>
+        </el-row>
+        <el-row :gutter="20">
+          <el-col :span="12">
+            <el-form-item label="榛樿鐢ㄦ硶">
+              <el-input
+                v-model="form.defaultUsageName"
+                placeholder="璇疯緭鍏ラ粯璁ょ敤娉�"
+              />
+            </el-form-item>
+          </el-col>
+          <el-col :span="12">
+            <el-form-item label="鐗规畩鑽搧">
+              <el-input
+                v-model="form.specialDrugsName"
+                placeholder="璇疯緭鍏ョ壒娈婅嵂鍝佸悕绉�"
+              />
+            </el-form-item>
+          </el-col>
+        </el-row>
+
+        <!-- ===== 鍓傞噺鏄庣粏鍒楄〃 ===== -->
+        <el-divider content-position="left">鍓傞噺鏄庣粏</el-divider>
+        <el-button
+          type="primary"
+          size="small"
+          icon="el-icon-plus"
+          @click="addDoseRow"
+          style="margin-bottom: 10px"
+          >娣诲姞鍓傞噺</el-button
+        >
+        <el-table
+          :data="form.doseInfoList"
+          border
+          size="small"
+          style="width: 100%"
+        >
+          <el-table-column label="鍓傞噺" width="100" align="center">
+            <template slot-scope="scope">
+              <el-input-number
+                v-model="scope.row.dose"
+                :min="0"
+                size="small"
+                controls-position="right"
+                style="width: 80px"
+              />
+            </template>
+          </el-table-column>
+          <el-table-column label="灏忓寘瑁呮暟閲�" width="120" align="center">
+            <template slot-scope="scope">
+              <el-input-number
+                v-model="scope.row.doseSmallPackageNum"
+                :min="0"
+                size="small"
+                controls-position="right"
+                style="width: 90px"
+              />
+            </template>
+          </el-table-column>
+          <el-table-column label="鍗曚綅" align="center">
+            <template slot-scope="scope">
+              <el-input
+                v-model="scope.row.doseUnit"
+                size="small"
+                placeholder="濡� 绮�"
+                style="width: 70px"
+              />
+            </template>
+          </el-table-column>
+          <el-table-column label="鍗曚綅绫诲瀷" align="center">
+            <template slot-scope="scope">
+              <el-select
+                v-model="scope.row.doseUnitType"
+                size="small"
+                placeholder="閫夋嫨"
+                style="width: 90px"
+              >
+                <el-option label="涓�" :value="1" />
+                <el-option label="鍏�" :value="2" />
+                <el-option label="姣崌" :value="3" />
+                <el-option label="姣厠" :value="4" />
+              </el-select>
+            </template>
+          </el-table-column>
+          <el-table-column label="鎿嶄綔" width="70" align="center">
+            <template slot-scope="scope">
+              <el-button
+                size="mini"
+                type="danger"
+                icon="el-icon-delete"
+                @click="removeDoseRow(scope.$index)"
+              />
+            </template>
+          </el-table-column>
+        </el-table>
+      </el-form>
+      <div slot="footer" class="dialog-footer">
+        <el-button @click="cancel">鍙� 娑�</el-button>
+        <el-button type="primary" :loading="submitLoading" @click="submitForm"
+          >纭� 瀹�</el-button
+        >
+      </div>
+    </el-dialog>
   </div>
 </template>
 
 <script>
+import {
+  listMedication,
+  getMedication,
+  addMedication,
+  updateMedication,
+  delMedication,
+  exportMedication,
+} from "@/api/knowledge/drug";
+
 export default {
-  data () {
+  name: "Drug",
+  data() {
     return {
-
-    }
+      loading: false,
+      submitLoading: false,
+      showSearch: true,
+      ids: [],
+      single: true,
+      multiple: true,
+      total: 0,
+      drugList: [],
+      title: "",
+      open: false,
+      queryParams: {
+        pageNum: 1,
+        pageSize: 10,
+        itemName: undefined,
+        itemCode: undefined,
+        manufacturerName: undefined,
+        medicationType: undefined,
+      },
+      form: {
+        doseInfoList: [],
+      },
+      rules: {
+        itemName: [
+          { required: true, message: "鑽搧鍚嶇О涓嶈兘涓虹┖", trigger: "blur" },
+        ],
+        itemCode: [
+          { required: true, message: "鑽搧缂栫爜涓嶈兘涓虹┖", trigger: "blur" },
+        ],
+        medicationCommonName: [
+          { required: true, message: "鑽搧閫氱敤鍚嶄笉鑳戒负绌�", trigger: "blur" },
+        ],
+        manufacturerName: [
+          { required: true, message: "鐢熶骇鍘傚涓嶈兘涓虹┖", trigger: "blur" },
+        ],
+        specification: [
+          { required: true, message: "瑙勬牸涓嶈兘涓虹┖", trigger: "blur" },
+        ],
+        medicationType: [
+          { required: true, message: "鑽搧绫诲瀷涓嶈兘涓虹┖", trigger: "blur" },
+        ],
+        status: [
+          { required: true, message: "鐘舵�佷笉鑳戒负绌�", trigger: "change" },
+        ],
+      },
+    };
   },
-
-  created () {
-
+  created() {
+    this.getList();
   },
-
   methods: {
+    // ===== 鍒楄〃 =====
+    getList() {
+      this.loading = true;
+      listMedication(this.queryParams)
+        .then((res) => {
+          this.drugList = res.rows || [];
+          this.total = res.total || 0;
+          this.loading = false;
+        })
+        .catch(() => {
+          this.loading = false;
+        });
+    },
+    handleQuery() {
+      this.queryParams.pageNum = 1;
+      this.getList();
+    },
+    resetQuery() {
+      this.resetForm("queryForm");
+      this.handleQuery();
+    },
+    handleSelectionChange(selection) {
+      this.ids = selection.map((item) => item.id);
+      this.single = selection.length !== 1;
+      this.multiple = !selection.length;
+    },
 
-  }
-}
+    // ===== 鏂板/淇敼 =====
+    handleAdd() {
+      this.reset();
+      this.title = "鏂板鑽搧";
+      this.open = true;
+    },
+    handleUpdate(row) {
+      this.reset();
+      const id = row.id || this.ids[0];
+      this.title = "淇敼鑽搧";
+      getMedication(id).then((res) => {
+        this.form = res.data || {};
+        this.form.doseInfoList = this.form.doseInfoList || [];
+        this.open = true;
+      });
+    },
+    submitForm() {
+      this.$refs["form"].validate((valid) => {
+        if (!valid) return;
+        this.submitLoading = true;
+        const api = this.form.id
+          ? updateMedication(this.form)
+          : addMedication(this.form);
+        api
+          .then((res) => {
+            if (res.code === 200) {
+              this.$modal.msgSuccess(this.form.id ? "淇敼鎴愬姛" : "鏂板鎴愬姛");
+              this.open = false;
+              this.getList();
+            }
+          })
+          .finally(() => {
+            this.submitLoading = false;
+          });
+      });
+    },
+    cancel() {
+      this.open = false;
+      this.reset();
+    },
+    reset() {
+      this.form = { status: 1, doseInfoList: [] };
+      this.resetForm("form");
+    },
+
+    // ===== 鍓傞噺鏄庣粏 =====
+    addDoseRow() {
+      this.form.doseInfoList.push({
+        dose: null,
+        doseSmallPackageNum: null,
+        doseUnit: "",
+        doseUnitType: 1,
+      });
+    },
+    removeDoseRow(index) {
+      this.form.doseInfoList.splice(index, 1);
+    },
+
+    // ===== 鍒犻櫎 =====
+    handleDelete(row) {
+      const ids = row.id ? [row.id] : this.ids;
+      this.$modal
+        .confirm("鏄惁纭鍒犻櫎鎵�閫夎嵂鍝佷俊鎭紵")
+        .then(() => {
+          return delMedication(JSON.stringify(ids));
+        })
+        .then((res) => {
+          if (res.code === 200) {
+            this.getList();
+            this.$modal.msgSuccess("鍒犻櫎鎴愬姛");
+          }
+        })
+        .catch(() => {});
+    },
+
+    // ===== 瀵煎嚭 =====
+    handleExport() {
+      this.download(
+        "smartor/medicationitem/export",
+        { ...this.queryParams },
+        `鑽搧淇℃伅_${new Date().getTime()}.xlsx`
+      );
+    },
+  },
+};
 </script>
 
-<style lang='scss' scoped>
-
+<style lang="scss" scoped>
+::v-deep .el-divider__text {
+  font-size: 14px;
+  font-weight: 600;
+}
 </style>
diff --git a/src/views/login.vue b/src/views/login.vue
index eaafca4..10cf9d3 100644
--- a/src/views/login.vue
+++ b/src/views/login.vue
@@ -1,5 +1,3 @@
-
-
 <template>
   <div class="login">
     <el-form
@@ -27,6 +25,7 @@
         <el-input
           v-model="loginForm.password"
           type="password"
+          show-password
           auto-complete="off"
           placeholder="瀵嗙爜"
           @keyup.enter.native="handleLogin"
@@ -95,10 +94,19 @@
         </div>
       </el-form-item>
     </el-form>
-    <!--  搴曢儴  -->
-    <!-- <div class="el-login-footer">
-      <span style="color: #568FBD; font-size: 25px;">Copyright 漏 2018-2022 ruoyi.vip All Rights Reserved.</span>
-    </div> -->
+    <!-- 搴曢儴淇℃伅 -->
+    <div class="el-login-footer">
+      <div class="footer-content">
+        <div class="footer-row">
+          <span class="tech-label">鎶�鏈敮鎸侊細</span>
+          <img src="@/assets/logo/Hrs.png" class="tech-logo" alt="logo" />
+          <span class="tech-name">娴欐睙浜ュ皵鏃剁鎶�鏈夐檺鍏徃</span>
+        </div>
+        <div class="footer-row">
+          <span class="hotline">鏈嶅姟鐑嚎锛�17778760073</span>
+        </div>
+      </div>
+    </div>
   </div>
 </template>
 
@@ -212,7 +220,7 @@
           );
           this.loginForm.campusid = selectedOrg.campusid || 1;
           this.loginForm.orgid = selectedOrg.value || 1;
-          this.loginForm.orgname = selectedOrg.label || '';
+          this.loginForm.orgname = selectedOrg.label || "";
           // 甯備竴澶勭悊-----------------
           // if (selectedOrg) {
           //   if (selectedOrg.label.includes("婀栨花")) {
@@ -306,18 +314,54 @@
   }
 }
 .el-login-footer {
-  height: 40px;
-  line-height: 40px;
   position: fixed;
-  bottom: 0;
+  bottom: 20px;
+  left: 0;
+  right: 0;
   width: 100%;
   text-align: center;
-  color: #fff;
-  font-family: Arial;
-  font-size: 12px;
-  letter-spacing: 1px;
+  font-size: 13px;
+  color: #3664D9;
+  z-index: 10;
 }
 
+.footer-content {
+  display: flex;
+  flex-direction: column;
+  align-items: center;
+  justify-content: center;
+  gap: 4px;
+}
+
+.footer-row {
+  display: flex;
+  align-items: center;
+  justify-content: center;
+}
+
+.tech-logo {
+  width: 28px;
+  height: 28px;
+  margin: 0 6px;
+  vertical-align: middle;
+}
+
+.tech-label,
+.tech-name,
+.hotline {
+  color: #3664D9;;
+  font-size: 13px;
+}
+
+.tech-name {
+  color: #3664D9;;
+  font-weight: 500;
+}
+
+.hotline {
+  font-size: 12px;
+  color: #3664D9;;
+}
 .login-code-img {
   height: 38px;
 }
diff --git a/src/views/loginSSO.vue b/src/views/loginSSO.vue
index d195a79..e43a341 100644
--- a/src/views/loginSSO.vue
+++ b/src/views/loginSSO.vue
@@ -34,45 +34,47 @@
   },
   methods: {
     // 鍖归厤orgid - 浼樺寲涓哄璞℃槧灏�
-    mateOrgid(orgid) {
+    mateOrgid(campusid, orgid) {
       const orgMap = {
-        "30001002": {
+        30001002: {
           orgname: "鐪佺珛鍚屽痉缈犺嫅闄㈠尯",
           ZuHuID: "1400361376454545408",
           deptCode: "1017",
         },
-        "30001003": {
+        30001003: {
           orgname: "鐪佺珛鍚屽痉涔嬫睙闄㈠尯",
           ZuHuID: "1400360867068907520",
           deptCode: "01040201",
         },
-        "30001004": {
+        30001004: {
           orgname: "鐪佺珛鍚屽痉闂叉灄闄㈠尯",
           ZuHuID: "1429338802177000002",
           deptCode: "",
         },
-        "30001005": {
+        30001005: {
           orgname: "鐪佺珛鍚屽痉澶╃洰灞辫矾闄㈠尯",
           ZuHuID: "1429338802177000003",
           deptCode: "",
         },
-        "30001006": {
+        30001006: {
           orgname: "鐪佺珛鍚屽痉闈掑北婀栭櫌鍖�",
           ZuHuID: "1429338802177000004",
           deptCode: "",
         },
-        "30001007": {
-          orgname: "娴嬭瘯闄㈠尯",
+        30001007: {
+          orgname: "鐪佺珛鍚屽痉缈犺嫅闄㈠尯", //娴嬭瘯
           ZuHuID: "1429338802177000005",
           deptCode: "",
         },
       };
 
-      const orgInfo = orgMap[orgid];
+      const orgInfo = orgMap[campusid];
       if (orgInfo) {
         localStorage.setItem("orgname", orgInfo.orgname);
         localStorage.setItem("ZuHuID", orgInfo.ZuHuID);
         localStorage.setItem("deptCode", orgInfo.deptCode);
+        localStorage.setItem("campusid", campusid);
+        localStorage.setItem("orgid", orgid);
         return orgInfo;
       }
       return null;
@@ -147,7 +149,18 @@
         // 3. 娓呯悊鏃х郴缁熸暟鎹�
         this.clearOldSystemData();
 
-        const { token, orgid, orgname, ZuHuID, deptCode, redirect } = params;
+        const { token, orgid, orgname, ZuHuID, deptCode, redirect, campusid } =
+          params;
+        console.log(
+          token,
+          orgid,
+          orgname,
+          ZuHuID,
+          deptCode,
+          redirect,
+          campusid,
+          "鍙傛暟鏃ュ織"
+        );
 
         // 4. 瀛樺偍token
         setToken(token);
@@ -157,7 +170,7 @@
         // 5. 澶勭悊鏈烘瀯淇℃伅
         if (orgid) {
           // 浼樺厛浣跨敤mateOrgid鏄犲皠
-          const orgInfo = this.mateOrgid(orgid);
+          const orgInfo = this.mateOrgid(campusid, orgid);
           if (!orgInfo) {
             // 濡傛灉娌℃湁鏄犲皠锛屼娇鐢ㄤ紶鍏ョ殑鍙傛暟
             if (orgname) localStorage.setItem("orgname", orgname);
@@ -166,15 +179,26 @@
           }
 
           localStorage.setItem("orgid", orgid);
-          if (this.$store.dispatch && typeof this.$store.dispatch === "function") {
+          if (
+            this.$store.dispatch &&
+            typeof this.$store.dispatch === "function"
+          ) {
             await this.$store.dispatch("UpdateOrgId", orgid);
           }
         }
         this.loadingDetail = "璁剧疆鏈烘瀯淇℃伅...";
 
-        // 6. 鑾峰彇鐢ㄦ埛淇℃伅
-        if (this.$store.dispatch && typeof this.$store.dispatch === "function") {
+        // 6. 鑾峰彇鐢ㄦ埛淇℃伅 + 鐢熸垚鍔ㄦ�佽矾鐢�
+        if (
+          this.$store.dispatch &&
+          typeof this.$store.dispatch === "function"
+        ) {
           await this.$store.dispatch("GetInfo");
+          // SSO 鍏嶇櫥鍦ㄨ烦杞墠宸插畬鎴� GetInfo锛岃矾鐢卞畧鍗笉浼氬啀瑙﹀彂 GenerateRoutes
+          // 蹇呴』鍦ㄦ澶勬樉寮忚皟鐢紝鍚﹀垯鍔ㄦ�佽矾鐢变笉浼氭敞鍐�
+          await this.$store.dispatch("GenerateRoutes").then((accessRoutes) => {
+            this.$router.addRoutes(accessRoutes);
+          });
         }
         this.loadingDetail = "鑾峰彇鐢ㄦ埛淇℃伅...";
 
@@ -203,15 +227,17 @@
           console.log("鍑嗗璺宠浆鍒�:", redirectPath);
 
           // 鉁� 浣跨敤 push 鑰屼笉鏄� replace锛屼繚鐣欏巻鍙茶褰�
-          this.$router.push({ path: redirectPath }).then(() => {
-            console.log("SSO鐧诲綍鎴愬姛锛岃烦杞畬鎴�");
-          }).catch((error) => {
-            console.error("璺敱璺宠浆澶辫触:", error);
-            // 鍥為��鍒伴粯璁ら〉闈�
-            this.$router.push({ path: "/followvisit/discharge" });
-          });
+          this.$router
+            .push({ path: redirectPath })
+            .then(() => {
+              console.log("SSO鐧诲綍鎴愬姛锛岃烦杞畬鎴�");
+            })
+            .catch((error) => {
+              console.error("璺敱璺宠浆澶辫触:", error);
+              // 鍥為��鍒伴粯璁ら〉闈�
+              this.$router.push({ path: "/followvisit/discharge" });
+            });
         }, 500);
-
       } catch (error) {
         console.error("SSO鐧诲綍澶辫触:", error);
         this.errorMessage = `鍗曠偣鐧诲綍澶辫触: ${error.message || "鏈煡閿欒"}`;
@@ -273,8 +299,12 @@
 }
 
 @keyframes spin {
-  0% { transform: rotate(0deg); }
-  100% { transform: rotate(360deg); }
+  0% {
+    transform: rotate(0deg);
+  }
+  100% {
+    transform: rotate(360deg);
+  }
 }
 
 .loading-content p {
diff --git a/src/views/outsideChainnew.vue b/src/views/outsideChainnew.vue
index 1e83bb8..1132d17 100644
--- a/src/views/outsideChainnew.vue
+++ b/src/views/outsideChainnew.vue
@@ -331,7 +331,7 @@
       // let taskids = this.encrypt(this.taskid);
       // let patids = this.encrypt(this.patid);
       // 鍏堝彇缂撳瓨
-      getCachequestionnaire({ param1: this.taskid, param2: this.patid }).then(
+      getCachequestionnaire({ param1: this.taskid, param2: this.patid,param6:this.param6 }).then(
         (res) => {
           if (res.code == 200) {
             this.questionList = res.data;
@@ -356,7 +356,7 @@
     },
     // 鑾峰彇鏁版嵁
     getExternalfollowup() {
-      getExternalfollowup({ param1: this.taskid, param2: this.patid }).then(
+      getExternalfollowup({ param1: this.taskid, param2: this.patid,param6:this.param6 }).then(
         (res) => {
           if (res.code == 200) {
             this.questionList = res.data.script;
diff --git a/src/views/outsideChainwtnew copy.vue b/src/views/outsideChainwtnew copy.vue
new file mode 100644
index 0000000..018b549
--- /dev/null
+++ b/src/views/outsideChainwtnew copy.vue
@@ -0,0 +1,1339 @@
+<template>
+  <div class="questionnaire-optimized">
+    <div v-if="loading && !accomplish" class="loading-container">
+      <div class="loading-content">
+        <i class="el-icon-loading loading-icon"></i>
+        <div class="loading-text">闂嵎鍔犺浇涓紝璇风◢鍊�...</div>
+      </div>
+    </div>
+
+    <!-- 姝e父鍐呭 -->
+    <div v-else>
+      <div class="content-wrapper" v-if="!accomplish">
+        <div class="questionnaire-container">
+          <!-- 闂嵎鏍囬鍖哄煙 -->
+          <div class="questionnaire-header">
+            <h1 class="questionnaire-title">
+              {{ taskname ? taskname : "闂嵎" }}
+            </h1>
+            <div class="questionnaire-description">
+              {{
+                kcb
+                  ? kcb
+                  : "浜茬埍鐨勬偅鑰�-瀹跺睘锛屾垜浠槸鍖婚櫌鐨勫尰鎶や汉鍛橈紝涓轰簡鏇村ソ鍦颁簡瑙f偍鐨勫悍澶嶆儏鍐碉紝璇锋偍鎶戒竴鐐瑰疂璐垫椂闂达紝瀹屾垚杩欎唤闅忚闂嵎銆�"
+              }}
+            </div>
+            <div v-if="orgname" class="questionnaire-signature">
+              鈥斺�斺�攞{ orgname }}
+            </div>
+          </div>
+
+          <el-divider class="custom-divider"></el-divider>
+
+          <!-- 鎸夌淮搴﹀垎缁勭殑棰樼洰鍖哄煙 -->
+          <div class="dimension-section" v-if="hasDimension">
+            <!-- 閬嶅巻缁村害鍒嗙粍 -->
+            <div
+              class="dimension-group"
+              v-for="(group, dimensionKey) in dimensionGroups"
+              :key="dimensionKey"
+            >
+              <!-- 缁村害鏍囬 - 鍙樉绀烘湁缁村害鏍囩鐨� -->
+              <div class="dimension-title" v-if="group.dimensionLabel">
+                <h3>{{ group.dimensionLabel }}</h3>
+              </div>
+
+              <!-- 璇ョ淮搴︿笅鐨勯鐩� -->
+              <div class="questions-section">
+                <div
+                  class="question-item"
+                  v-for="(item, index) in group.questions"
+                  :key="item.id"
+                  :class="{
+                    'has-warning':
+                      item.prompt &&
+                      item.scriptResult &&
+                      (item.scriptType !== 2 || item.scriptResult.length > 0),
+                  }"
+                >
+                  <!-- 棰樼洰棰樺共 -->
+                  <div class="question-stem">
+                    <span class="question-number"
+                      >{{ getQuestionNumber(group, index) }}.</span
+                    >
+                    <span class="question-text">{{ item.scriptContent }}</span>
+                    <span class="question-type-tag">
+                      {{
+                        item.scriptType == 1
+                          ? "[鍗曢�塢"
+                          : item.scriptType == 2
+                          ? "[澶氶�塢"
+                          : "[闂瓟]"
+                      }}
+                    </span>
+                  </div>
+
+                  <!-- 鍗曢�夐鐩� -->
+                  <div
+                    class="question-options"
+                    v-if="item.scriptType == 1 && !item.ishide"
+                  >
+                    <el-radio-group
+                      class="options-group"
+                      v-model="item.scriptResult"
+                    >
+                      <el-radio
+                        v-for="(
+                          option, optionIndex
+                        ) in item.svyTaskTemplateTargetoptions"
+                        :key="optionIndex"
+                        :label="option.optioncontent"
+                        :class="{
+                          'abnormal-option':
+                            option.isabnormal &&
+                            item.scriptResult == option.optioncontent,
+                        }"
+                        @click.native.prevent="
+                          handleRadioToggle(
+                            item,
+                            getGlobalIndex(item.dimension, group, index),
+                            item.svyTaskTemplateTargetoptions,
+                            option.optioncontent
+                          )
+                        "
+                        class="option-radio"
+                      >
+                        <span class="option-text">{{
+                          option.optioncontent
+                        }}</span>
+                      </el-radio>
+                    </el-radio-group>
+                  </div>
+
+                  <!-- 澶氶�夐鐩� -->
+                  <div class="question-options" v-if="item.scriptType == 2">
+                    <el-checkbox-group
+                      class="options-group"
+                      v-model="item.scriptResult"
+                    >
+                      <el-checkbox
+                        v-for="(
+                          option, optionIndex
+                        ) in item.svyTaskTemplateTargetoptions"
+                        :key="optionIndex"
+                        :label="option.optioncontent"
+                        :class="{
+                          'abnormal-option': option.isabnormal,
+                        }"
+                        @change="$forceUpdate()"
+                        class="option-checkbox"
+                      >
+                        <span class="option-text">{{
+                          option.optioncontent
+                        }}</span>
+                      </el-checkbox>
+                    </el-checkbox-group>
+                  </div>
+
+                  <!-- 濉┖棰樼洰 -->
+                  <div class="question-input" v-if="item.scriptType == 4">
+                    <el-input
+                      type="textarea"
+                      :rows="3"
+                      placeholder="璇疯緭鍏ユ偍鐨勫洖绛�"
+                      v-model="item.scriptResult"
+                      clearable
+                      class="answer-textarea"
+                    ></el-input>
+                  </div>
+
+                  <!-- 鎻愮ず淇℃伅 -->
+                  <div
+                    class="question-warning"
+                    v-show="
+                      item.prompt &&
+                      item.scriptResult &&
+                      (item.scriptType !== 2 || item.scriptResult.length > 0)
+                    "
+                  >
+                    <el-alert
+                      :title="item.prompt"
+                      type="warning"
+                      :closable="false"
+                      class="warning-alert"
+                    ></el-alert>
+                  </div>
+                  <div
+                    v-if="item.showAppendInput || item.answerps"
+                    class="append-input-container"
+                  >
+                    <el-input
+                      type="textarea"
+                      :rows="1"
+                      placeholder="璇疯緭鍏ュ叿浣撲俊鎭�"
+                      v-model="item.answerps"
+                      clearable
+                    ></el-input>
+                  </div>
+                </div>
+              </div>
+            </div>
+          </div>
+
+          <!-- 鏃犵淮搴︽椂鐨勯鐩尯鍩燂紙淇濇寔鍘熸牱锛� -->
+          <div class="questions-section" v-else>
+            <div
+              class="question-item"
+              v-for="(item, index) in visibleQuestions"
+              :key="item.id"
+              :class="{
+                'has-warning':
+                  item.prompt &&
+                  item.scriptResult &&
+                  (item.scriptType !== 2 || item.scriptResult.length > 0),
+              }"
+            >
+              <!-- 棰樼洰棰樺共 -->
+              <div class="question-stem">
+                <span class="question-number"
+                  >{{ getVisibleQuestionIndex(index) }}.</span
+                >
+                <span class="question-text">{{ item.scriptContent }}</span>
+                <span class="question-type-tag">
+                  {{
+                    item.scriptType == 1
+                      ? "[鍗曢�塢"
+                      : item.scriptType == 2
+                      ? "[澶氶�塢"
+                      : "[闂瓟]"
+                  }}
+                </span>
+              </div>
+
+              <!-- 鍗曢�夐鐩� -->
+              <div
+                class="question-options"
+                v-if="item.scriptType == 1 && !item.ishide"
+              >
+                <el-radio-group
+                  class="options-group"
+                  v-model="item.scriptResult"
+                >
+                  <el-radio
+                    v-for="(
+                      option, optionIndex
+                    ) in item.svyTaskTemplateTargetoptions"
+                    :key="optionIndex"
+                    :label="option.optioncontent"
+                    :class="{
+                      'abnormal-option':
+                        option.isabnormal &&
+                        item.scriptResult == option.optioncontent,
+                    }"
+                    @click.native.prevent="
+                      handleRadioToggle(
+                        item,
+                        index,
+                        item.svyTaskTemplateTargetoptions,
+                        option.optioncontent
+                      )
+                    "
+                    class="option-radio"
+                  >
+                    <span class="option-text">{{ option.optioncontent }}</span>
+                  </el-radio>
+                </el-radio-group>
+              </div>
+
+              <!-- 澶氶�夐鐩� -->
+              <div class="question-options" v-if="item.scriptType == 2">
+                <el-checkbox-group
+                  class="options-group"
+                  v-model="item.scriptResult"
+                >
+                  <el-checkbox
+                    v-for="(
+                      option, optionIndex
+                    ) in item.svyTaskTemplateTargetoptions"
+                    :key="optionIndex"
+                    :label="option.optioncontent"
+                    :class="{
+                      'abnormal-option': option.isabnormal,
+                    }"
+                    @change="$forceUpdate()"
+                    class="option-checkbox"
+                  >
+                    <span class="option-text">{{ option.optioncontent }}</span>
+                  </el-checkbox>
+                </el-checkbox-group>
+              </div>
+
+              <!-- 濉┖棰樼洰 -->
+              <div class="question-input" v-if="item.scriptType == 4">
+                <el-input
+                  type="textarea"
+                  :rows="3"
+                  placeholder="璇疯緭鍏ユ偍鐨勫洖绛�"
+                  v-model="item.scriptResult"
+                  clearable
+                  class="answer-textarea"
+                ></el-input>
+              </div>
+
+              <!-- 鎻愮ず淇℃伅 -->
+              <div
+                class="question-warning"
+                v-show="
+                  item.prompt &&
+                  item.scriptResult &&
+                  (item.scriptType !== 2 || item.scriptResult.length > 0)
+                "
+              >
+                <el-alert
+                  :title="item.prompt"
+                  type="warning"
+                  :closable="false"
+                  class="warning-alert"
+                ></el-alert>
+              </div>
+              <div
+                v-if="item.showAppendInput || item.answerps"
+                class="append-input-container"
+              >
+                <el-input
+                  type="textarea"
+                  :rows="1"
+                  placeholder="璇疯緭鍏ュ叿浣撲俊鎭�"
+                  v-model="item.answerps"
+                  clearable
+                ></el-input>
+              </div>
+            </div>
+          </div>
+
+          <!-- 鎻愪氦鎸夐挳 -->
+          <div class="submit-section">
+            <el-button
+              type="primary"
+              @click="cache(true)"
+              class="submit-button"
+            >
+              鎻愪氦闂嵎
+            </el-button>
+          </div>
+        </div>
+      </div>
+
+      <!-- 瀹屾垚椤甸潰 -->
+      <div class="completion-page" v-else>
+        <div class="completion-content">
+          <div class="completion-icon">鉁�</div>
+          <h2 class="completion-title">鎰熻阿鎮ㄧ殑閰嶅悎!</h2>
+          <h2 class="completion-title">绁濇偍鍋ュ悍蹇箰!</h2>
+          <p class="completion-message">
+            {{
+              jsy
+                ? jsy
+                : "鐢熸椿涓婅鍔抽�哥粨鍚堬紝娉ㄦ剰浼戞伅鍜岃惀鍏伙紝閫傚綋閿荤偧锛屾垝鐑熼檺閰掞紝淇濇寔蹇冩儏鑸掔晠锛屽畾鏈熷璇娿�傞偅鏈鍥炶灏卞埌杩欓噷锛岀鎮ㄨ韩浣撳仴搴凤紒"
+            }}
+          </p>
+        </div>
+      </div>
+    </div>
+  </div>
+</template>
+
+<script>
+import {
+  getExternalfollowup,
+  getCachequestionnaire,
+  Cachequestionnaire,
+  gettypeout,
+  Submitaquestionnaire,
+  geturlinfo,
+} from "@/api/AiCentre/index";
+import JSEncrypt from "jsencrypt";
+export default {
+  data() {
+    return {
+      loading: true,
+      taskid: 355,
+      patid: 265823,
+      kcb: "",
+      excep: 0,
+      isabnormal: 0,
+      taskname: "",
+      orgname: "",
+      questionList: [],
+      permanentlyHidden: [], // 瀛樺偍琚案涔呴殣钘忕殑棰樼洰绱㈠紩
+      param6: null,
+      jsy: null,
+      dialogVisible: false,
+      Endornot: true,
+      accomplish: false,
+      dimensionTypes: [
+        {
+          value: 1,
+          label: "缁村害1",
+          listClass: "primary",
+        },
+        {
+          value: 2,
+          label: "缁村害浜�",
+          listClass: "primary",
+        },
+        {
+          value: 3,
+          label: "缁村害涓�",
+          listClass: "primary",
+        },
+      ],
+      // 鍓嶇鍏挜
+      publicKey:
+        "MFwwDQYJKoZIhvcNAQEBBQADSwAwSAJBAKR0yHv0rbJWQE+Sc7/FwpW66qMd9qX2k6z+SDgkSdxWh/1GbBoAP7bDQQRF6vXmoKsD2ya42H6XRLSDXAoayuMCAwEAAQ== ",
+      // 鍚庣绉侀挜
+      privateKey:
+        " MIIBUwIBADANBgkqhkiG9w0BAQEFAASCAT0wggE5AgEAAkEAtDOpbUQhcEoYy77agRhIHmAzs7H+KHJhN56gTTI9fWq23j77nI055MFV3oQQziIrNUTNaPpEQhZXBpI0+f9K9QIDAQABAkB3n0fcWfrcoMN/FU3VnrnZOEF6CzFNxkgU9P8y36QECWKZ9JhYQkNpKrMC9oXlN3VSaRigV7B+L/I/a0Rs1W+tAiEA4jx7xcXJ4y4BNwAmVHt6NNiEkzIwWnwC/0qsEu8NsOsCIQDL6MMn1D2uznC6OuOWpxDCkBh1JL1NzZTZeH2G+hj7nwIgKGAC9tjFnvWm4dn0/T7MIIJDpsFeP8fCAS2iZ/6hwuECIAS/eLvWr1EAsZNEh8QcQ8GkBU3E+ztyjAK8UX/xFt/VAiBf79/1tDErX4/DChecM8w3c3DhbBcjuE3fHZn7p6/UKg==",
+      formData: {
+        question1: "",
+        question2: "",
+        question3: "",
+      },
+    };
+  },
+  mounted() {
+    // window.addEventListener("beforeunload", this.cache);
+  },
+  beforeDestroy() {
+    // window.removeEventListener("beforeunload", this.cache);
+  },
+  created() {
+    this.gettypeout();
+    this.geturlinfo();
+  },
+  computed: {
+    // 璁$畻灞炴�э細鑾峰彇鎵�鏈夊彲瑙佺殑棰樼洰
+    visibleQuestions() {
+      if (!Array.isArray(this.questionList)) {
+        return [];
+      }
+      return this.questionList.filter((question) => !question.ishide);
+    },
+
+    // 璁$畻灞炴�э細妫�鏌ユ槸鍚︽湁缁村害瀛楁
+    hasDimension() {
+      if (!this.questionList || this.questionList.length == 0) {
+        return false;
+      }
+      // 妫�鏌ヤ换鎰忎竴涓鐩槸鍚︽湁dimension瀛楁
+      return this.questionList.some(
+        (question) =>
+          question.dimension && this.getDimensionLabel(question.dimension)
+      );
+    },
+
+    // 璁$畻灞炴�э細鎸夌淮搴︽暣鐞嗛鐩�
+    dimensionGroups() {
+      if (!this.questionList || this.questionList.length == 0) {
+        return {};
+      }
+
+      const groups = {};
+      let currentGroupKey = null;
+      let groupStartIndex = 0; // 璁板綍褰撳墠缁村害缁勭殑寮�濮嬬储寮�
+
+      this.visibleQuestions.forEach((question, index) => {
+        const dimensionValue = question.dimension;
+        const dimensionLabel = this.getDimensionLabel(dimensionValue);
+
+        // 鐢熸垚缁刱ey锛氭湁缁村害鐢ㄧ淮搴﹀�硷紝鏃犵淮搴︾敤鐗规畩鏍囪+璧峰绱㈠紩
+        let groupKey;
+        if (dimensionValue && dimensionLabel) {
+          groupKey = `dimension-${dimensionValue}`;
+        } else {
+          // 鏃犵淮搴︽垨缁村害鏄犲皠涓嶅瓨鍦ㄧ殑棰樼洰鍗曠嫭鍒嗙粍
+          groupKey = `no-dimension-${groupStartIndex}`;
+        }
+
+        // 鍒涘缓鎴栬幏鍙栫淮搴︾粍
+        if (!groups[groupKey]) {
+          groups[groupKey] = {
+            questions: [],
+            startIndex: groupStartIndex,
+            dimensionValue: dimensionValue, // 淇濆瓨缁村害鍊肩敤浜庡悗缁鐞�
+            dimensionLabel: dimensionLabel, // 淇濆瓨缁村害鏍囩
+            isNoDimension: !dimensionValue || !dimensionLabel,
+          };
+          currentGroupKey = groupKey;
+        }
+
+        // 灏嗛鐩坊鍔犲埌瀵瑰簲鐨勭淮搴︾粍
+        groups[groupKey].questions.push(question);
+
+        // 濡傛灉涓嬩竴涓鐩淮搴︿笉鍚岋紝閲嶆柊寮�濮嬭鏁�
+        const nextQuestion = this.visibleQuestions[index + 1];
+        if (nextQuestion) {
+          const nextDimensionValue = nextQuestion.dimension;
+          const nextDimensionLabel = this.getDimensionLabel(nextDimensionValue);
+          const currentDimensionLabel = this.getDimensionLabel(dimensionValue);
+
+          // 鍒ゆ柇缁村害鏄惁鐩稿悓
+          if (
+            dimensionValue !== nextDimensionValue ||
+            (dimensionValue &&
+              nextDimensionValue &&
+              ((!dimensionValue && nextDimensionValue) ||
+                (dimensionValue && !nextDimensionValue)))
+          ) {
+            groupStartIndex = index + 1;
+          }
+        }
+      });
+
+      return groups;
+    },
+  },
+  methods: {
+    // 瑙f瀽urlid
+    geturlinfo() {
+      // let url = window.location.href;
+      let url = this.$route.query.p;
+      console.log(url, "url");
+      // let url = 'http://218.108.11.22:8093/sf/003';
+      // let urlid = this.extractLastSegmentFromUrl(url);
+      console.log("妫掓2");
+
+      geturlinfo(url).then((res) => {
+        if (res.code == 200) {
+          this.getQuestionnaire(
+            res.data.param1,
+            res.data.param2,
+            res.data.param3,
+            res.data.param5,
+            res.data.param6
+          );
+          if (
+            res.data.orgname == "鐪佺珛鍚屽痉缈犺嫅闄㈠尯" ||
+            res.data.orgname == "鐪佺珛鍚屽痉涔嬫睙闄㈠尯" ||
+            res.data.orgname == "鐪佺珛鍚屽痉闂叉灄闄㈠尯"
+          ) {
+            this.orgname = "娴欐睙鐪佺珛鍚屽痉鍖婚櫌";
+          } else {
+            this.orgname = res.data.orgname;
+          }
+
+          this.param6 = res.data.param6;
+        }
+      });
+    },
+    // 鑾峰彇瀛楀吀
+    gettypeout() {
+      gettypeout("dimensionality_type").then((res) => {
+        if (res.code == 200) {
+          this.dimensionTypes = res.data;
+        }
+      });
+    },
+    // 鏍规嵁缁村害鍊艰幏鍙栫淮搴︽爣绛�
+    getDimensionLabel(dimensionValue) {
+      if (!dimensionValue) return "";
+
+      const dimensionType = this.dimensionTypes.find(
+        (item) => item.dictValue == Number(dimensionValue)
+      );
+      return dimensionType ? dimensionType.dictLabel : "";
+    },
+    //     extractLastSegmentFromUrl(url) {
+    //     // 鎵惧埌鏈�鍚庝竴涓�'/'鐨勪綅缃�
+    //     const lastSlashIndex = url.lastIndexOf('/');
+    //     // 濡傛灉鎵惧埌浜�'/'锛屾埅鍙栧叾鍚庣殑鎵�鏈夊瓧绗�
+    //     if (lastSlashIndex !== -1) {
+    //         return url.substring(lastSlashIndex + 1);
+    //     }
+    //     // 濡傛灉娌℃湁鎵惧埌'/'锛岃繑鍥炵┖瀛楃涓�
+    //     return '';
+    // },
+
+    // 鑾峰彇鏁版嵁
+    getQuestionnaire(param1, param2, param3, param5, param6) {
+      this.taskid = decodeURIComponent(param1);
+      this.patid = decodeURIComponent(param2);
+      this.taskname = decodeURIComponent(param3);
+      this.loading = true;
+
+      // let taskid =
+      //   "OFp7tn/B6x7IzKJetvGWHdSWBj7msRlnlj6am9dyuHTH6sEt4uBbVCUXs5kcF/e4O2W6vqHf2Bz9K3/evbYDmw==";
+      // let patid =
+      //   "CVk0j8O86AeCqhV5WPsBBYDg9fec0wDoDlP9imYK4wDBNIkxywZzMJEGlPagOxnq6qr2WYZo0U8MUGWRGnq8ZA==";
+      // this.taskid = this.decrypt(taskid);
+      // this.patid = this.decrypt(patid);
+      // let taskids = this.encrypt(this.taskid);
+      // let patids = this.encrypt(this.patid);
+      // 鍏堝彇缂撳瓨
+      getCachequestionnaire({
+        param1: this.taskid,
+        param2: this.patid,
+        param6: param6,
+      })
+        .then((res) => {
+          if (res.code == 200) {
+            this.questionList = res.data.result;
+            this.accomplish = res.data.submit;
+            if (this.questionList[0]) {
+              this.questionList.forEach((item) => {
+                if (item.scriptResult && item.scriptType != 2) {
+                  item.scriptResult = JSON.parse(item.scriptResult);
+                } else if (item.scriptResult && item.scriptType == 2) {
+                  item.scriptResult = item.scriptResult.split("&");
+                }
+              });
+              this.loading = false;
+
+              return;
+            } else {
+              this.getExternalfollowup();
+            }
+          } else {
+            this.getExternalfollowup();
+          }
+        })
+        .finally(() => {});
+    },
+    // 鑾峰彇鏁版嵁
+    getExternalfollowup() {
+      getExternalfollowup({
+        param1: this.taskid,
+        param2: this.patid,
+        param6: param6,
+      })
+        .then((res) => {
+          if (res.code == 200) {
+            this.questionList = res.data.script;
+            this.jsy = res.data.jsy;
+            this.kcb = res.data.kcb;
+            // 澶勭悊棰樼洰鏀堕泦缁撴灉鏍煎紡
+            this.questionList.forEach((item) => {
+              item.nextScriptno = Number(item.nextScriptno);
+              if (item.scriptType == 2) {
+                item.scriptResult = [];
+              }
+            });
+            this.loading = false;
+          }
+        })
+        .finally(() => {
+          this.loading = false;
+        });
+    },
+    // 鍔犲瘑鍑芥暟
+    encrypt(txt) {
+      const encryptor = new JSEncrypt();
+      encryptor.setPublicKey(this.publicKey); // 璁剧疆鍏挜
+      return encryptor.encrypt(txt); // 瀵规暟鎹繘琛屽姞瀵�
+    },
+    // 瑙e瘑鍑芥暟
+    decrypt(txt) {
+      const encryptor = new JSEncrypt();
+      encryptor.setPrivateKey(this.privateKey); // 璁剧疆绉侀挜
+      return encryptor.decrypt(txt); // 瀵规暟鎹繘琛岃В瀵�
+    },
+    // 鎻愪氦
+    submitForm() {
+      // 鎻愪氦琛ㄥ崟閫昏緫
+      let form = {
+        param1: this.taskid,
+        param2: this.patid,
+        param6: this.param6,
+        excep: this.excep,
+        isabnormal: this.isabnormal,
+        serviceSubtaskDetailList: [],
+      };
+      console.log(form.isabnormal, "formisabnormal");
+
+      const arr = structuredClone(this.questionList);
+      // arr.forEach((item) => {
+      //   item.asrtext = JSON.stringify(item.scriptResult);
+      //   if (item.scriptType == 2 && item.scriptResult[0]) {
+      //     item.scriptResult = item.scriptResult.join("&");
+      //   }
+      // });
+      form.serviceSubtaskDetailList = arr;
+      Submitaquestionnaire(form).then((res) => {
+        if (res.code == 200) {
+          if (this.jsy) {
+            this.dialogVisible = true;
+          }
+          this.accomplish = true;
+          this.$modal.msgSuccess("鎻愪氦鎴愬姛");
+        }
+      });
+    },
+    // 缂撳瓨
+    cache(subm) {
+      console.log("杩涘叆缂撳瓨");
+      let form = {
+        param1: this.taskid,
+        param2: this.patid,
+        param6: this.param6,
+        svyTaskTemplateScriptVOS: [],
+      };
+      const arr = structuredClone(this.questionList);
+      arr.forEach((item) => {
+        item.ishide = item.ishide ? 1 : 0;
+      });
+      arr.forEach((item, index) => {
+        if (item.scriptType == 1 && item.scriptResult) {
+          var obj = item.svyTaskTemplateTargetoptions.find(
+            (items) => items.optioncontent == item.scriptResult
+          );
+          console.log(item);
+
+          console.log(obj, "obj");
+          if (obj.sendTaskid) {
+            item.sendTaskname = obj.sendTaskname;
+            item.sendTaskid = obj.sendTaskid;
+            console.log(String(obj.sendTaskid).split(","));
+            item.sendTaskids = String(obj.sendTaskid).split(",");
+          }
+          if (obj) {
+            form.excep = obj.isabnormal;
+            form.isabnormal = obj.isabnormal;
+            if (this.isabnormal != 1 && obj.isabnormal) {
+              this.excep = obj.isabnormal;
+              this.isabnormal = obj.isabnormal;
+            }
+            console.log(obj.isabnormal);
+          }
+        }
+      });
+
+      arr.forEach((item) => {
+        if (item.scriptType == 2 && item.scriptResult[0]) {
+          item.scriptResult = item.scriptResult.join("&");
+        } else if (item.scriptType != 2 && item.scriptResult) {
+          item.scriptResult = JSON.stringify(item.scriptResult);
+        }
+      });
+      form.svyTaskTemplateScriptVOS = arr;
+      form.type = 2;
+      Cachequestionnaire(form).then((res) => {
+        if (res.code == 200) {
+          if (subm) {
+            this.submitForm();
+          }
+        }
+      });
+    },
+    // 鑾峰彇鍙棰樼洰鐨勬纭簭鍙凤紙瑙e喅璺抽鍚庡簭鍙蜂笉杩炵画鐨勯棶棰橈級
+    getVisibleQuestionIndex(index) {
+      return index + 1;
+    },
+
+    // 鑾峰彇缁村害鍐呴鐩殑搴忓彿
+    getQuestionNumber(group, index) {
+      return group.startIndex + index + 1;
+    },
+
+    // 鑾峰彇棰樼洰鍦ㄥ叏閲忔暟缁勪腑鐨勭储寮�
+    getGlobalIndex(dimension, group, localIndex) {
+      return group.startIndex + localIndex;
+    },
+    // 鍦ㄦā鏉夸腑浣跨敤
+    getDimensionLabelForDisplay(dimensionKey) {
+      if (dimensionKey.startsWith("no-dimension-")) {
+        return "";
+      }
+      const dimensionValue = dimensionKey.replace("dimension-", "");
+      return this.getDimensionLabel(dimensionValue);
+    },
+    // 鏂板鐨勫垏鎹㈤�変腑/鍙栨秷閫変腑鏂规硶
+    handleRadioToggle(questionItem, globalIndex, options, optionValue) {
+      // 淇濆瓨褰撳墠鐘舵�佷互渚垮悗缁瘮杈�
+      this.permanentlyHidden = this.permanentlyHidden.filter(
+        (idx) => idx <= globalIndex
+      );
+
+      if (questionItem.scriptResult == optionValue) {
+        questionItem.scriptResult = "";
+        questionItem.isabnormal = 0;
+        questionItem.showAppendInput = false;
+      } else {
+        questionItem.scriptResult = optionValue;
+        this.handleOptionChange(
+          optionValue,
+          globalIndex,
+          options,
+          questionItem
+        );
+      }
+      this.$forceUpdate();
+    },
+
+    // 鍦╩ethods閮ㄥ垎锛屼慨鏀筯andleOptionChange鏂规硶:
+    handleOptionChange(selectedOption, questionIndex, options, a) {
+      if (document.activeElement) {
+        document.activeElement.blur();
+      }
+
+      const selectedOptionObj = options.find(
+        (item) => item.optioncontent == selectedOption
+      );
+      if (selectedOptionObj) {
+        this.questionList[questionIndex].nextScriptno =
+          selectedOptionObj.nextQuestion;
+        this.questionList[questionIndex].score = selectedOptionObj.score;
+        this.questionList[questionIndex].prompt = selectedOptionObj.prompt;
+      }
+      this.questionList[questionIndex].isabnormal =
+        selectedOptionObj.isabnormal;
+      this.questionList[questionIndex].showAppendInput =
+        selectedOptionObj.appendflag == 1;
+
+      // 璁板綍褰撳墠棰樹箣鍓嶅凡闅愯棌鐨勯鐩储寮曪紙涓嶆敼鍙橈級
+      const previouslyHiddenBeforeCurrent = this.questionList
+        .slice(0, questionIndex)
+        .map((item, index) => (item.ishide ? index : -1))
+        .filter((idx) => idx !== -1);
+
+      if (a.branchFlag == 1) {
+        if (selectedOptionObj.nextQuestion == 0) {
+          // 銆愮粨鏉熼棶绛斻�戦殣钘忔墍鏈夊悗缁鐩紝骞惰褰曟案涔呴殣钘�
+          this.questionList = this.questionList.map((item, index) => {
+            if (index > questionIndex) {
+              if (!this.permanentlyHidden.includes(index)) {
+                this.permanentlyHidden.push(index);
+              }
+              return { ...item, ishide: 1, hiddenByEnd: true };
+            }
+            // 褰撳墠棰樺強涔嬪墠鐨勯淇濇寔鍘熸湁鍙鎬э紙浣嗕箣鍓嶉殣钘忕殑浠嶉殣钘忥級
+            return {
+              ...item,
+              ishide: index < questionIndex ? item.ishide : 0,
+              hiddenByEnd: false,
+            };
+          });
+        } else {
+          // 銆愭甯歌烦杞��
+          const nextQuestionIndex = selectedOptionObj.nextQuestion - 1;
+          this.questionList = this.questionList.map((item, index) => {
+            if (index < questionIndex) {
+              return {
+                ...item,
+                ishide: previouslyHiddenBeforeCurrent.includes(index),
+                hiddenByEnd: false,
+              };
+            }
+            if (index == questionIndex) {
+              return { ...item, ishide: 0, hiddenByEnd: false };
+            }
+            // 鐩爣棰橈細鑻ュ湪姘镐箙闅愯棌鍒楄〃涓紝寮哄埗闅愯棌
+            if (index == nextQuestionIndex) {
+              const shouldShow = !this.permanentlyHidden.includes(index);
+              return {
+                ...item,
+                ishide: shouldShow ? 0 : 1,
+                hiddenByEnd: false,
+              };
+            }
+            // 涔嬪墠鍥犵粨鏉熼棶绛旈殣钘忕殑棰橈細鎭㈠鏄剧ず浣嗘鏌ユ案涔呴殣钘�
+            if (item.hiddenByEnd) {
+              const shouldShow = !this.permanentlyHidden.includes(index);
+              return {
+                ...item,
+                ishide: shouldShow ? 0 : 1,
+                hiddenByEnd: false,
+              };
+            }
+            // 闅愯棌褰撳墠棰樺拰鐩爣棰樹箣闂寸殑棰樼洰锛屽苟璁板綍姘镐箙闅愯棌
+            if (index > questionIndex && index < nextQuestionIndex) {
+              if (!this.permanentlyHidden.includes(index)) {
+                this.permanentlyHidden.push(index);
+              }
+              return { ...item, ishide: 1, hiddenByEnd: false };
+            }
+            return item;
+          });
+        }
+      } else {
+        // 銆愭棤璺宠浆銆戜粎鏄剧ず涓嬩竴棰橈紝浣嗛渶妫�鏌ユ案涔呴殣钘�
+        this.questionList = this.questionList.map((item, index) => {
+          if (index == questionIndex + 1) {
+            const shouldShow = !this.permanentlyHidden.includes(index);
+            return { ...item, ishide: shouldShow ? 0 : 1, hiddenByEnd: false };
+          }
+          return item;
+        });
+      }
+
+      this.$forceUpdate();
+      this.$nextTick(() => {
+        this.$forceUpdate();
+      });
+    },
+  },
+};
+</script>
+
+<style lang="scss" scoped>
+.questionnaire-optimized {
+  min-height: 100vh;
+  background: linear-gradient(135deg, #f5f7fa 0%, #e4edf5 100%);
+  padding: 20px 0;
+  font-family: "PingFang SC", "Microsoft YaHei", sans-serif;
+}
+
+.content-wrapper {
+  max-width: 800px;
+  margin: 0 auto;
+  padding: 0 15px;
+}
+
+.questionnaire-container {
+  background: #ffffff;
+  border-radius: 12px;
+  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.08);
+  padding: 30px;
+  margin-bottom: 30px;
+}
+
+.questionnaire-header {
+  text-align: center;
+  margin-bottom: 25px;
+}
+
+.questionnaire-title {
+  color: #0d3b6b; // 鍩虹娣辫摑鑹�
+  font-size: 28px;
+  font-weight: 700;
+  margin-bottom: 15px;
+  line-height: 1.3;
+  text-shadow: 0 1px 3px rgba(255, 255, 255, 0.4);
+
+  // 閽堝澶滈棿妯″紡鐨勪紭鍖�
+  @media (prefers-color-scheme: dark) {
+    color: #4a90d9; // 澶滈棿妯″紡浣跨敤鏇翠寒鐨勮摑鑹�
+    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
+  }
+}
+
+.questionnaire-description {
+  font-size: 16px;
+  color: #303a47;
+  line-height: 1.8;
+  max-width: 720px;
+  margin: 0;
+  padding: 0 16px;
+  text-align: justify;
+  /* 涓ょ瀵归綈锛屾洿缇庤 */
+  text-indent: 2em;
+  /* 棣栬缂╄繘 */
+}
+
+.questionnaire-signature {
+  font-size: 16px;
+  color: #303a47;
+  text-align: right;
+  /* 鍙冲榻� */
+  max-width: 720px;
+  margin: 8px 0 0 auto;
+  /* 涓婅竟璺�8px锛屽彸杈归潬榻� */
+  padding: 0 16px;
+  letter-spacing: 1px;
+  /* 瀛楅棿璺濈◢瀹斤紝鏇存湁钀芥鎰� */
+}
+
+.custom-divider {
+  margin: 25px 0;
+  background-color: #eaeef2;
+}
+
+/* 缁村害鍒嗙粍鏍峰紡 */
+.dimension-section {
+  margin-bottom: 20px;
+}
+
+.dimension-group {
+  margin-bottom: 30px;
+
+  &:last-child {
+    margin-bottom: 0;
+  }
+}
+
+.dimension-title {
+  background: linear-gradient(135deg, #e8f4ff 0%, #d1e7ff 100%);
+  padding: 12px 20px;
+  border-radius: 8px;
+  margin-bottom: 20px;
+  border-left: 4px solid #175997;
+
+  h3 {
+    color: #175997;
+    font-size: 20px;
+    font-weight: 600;
+    margin: 0;
+  }
+}
+
+.questions-section {
+  margin-bottom: 10px;
+}
+
+.question-item {
+  margin-bottom: 25px;
+  padding: 20px;
+  border-radius: 8px;
+  border: 1px solid #eaeef2;
+  transition: all 0.3s ease;
+
+  &:hover {
+    border-color: #d1e0f0;
+    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
+  }
+
+  &.has-warning {
+    border-left: 4px solid #e6a23c;
+  }
+
+  &:last-child {
+    margin-bottom: 0;
+  }
+}
+
+.question-stem {
+  display: grid;
+  grid-template-columns: auto 1fr auto;
+  gap: 3px;
+  align-items: start;
+  /* 鏀逛负 start 閬垮厤灞呬腑瀵艰嚧鐨勮瑙夐棶棰� */
+  margin-bottom: 20px;
+  font-size: 18px;
+}
+
+.question-text {
+  line-height: 1.5;
+  color: #2c3e50;
+  font-weight: 500;
+  word-wrap: break-word;
+  overflow-wrap: break-word;
+  white-space: normal;
+  /* 纭繚鍏佽鎹㈣ */
+  min-width: 0;
+  /* 闃叉 grid 椤规孩鍑� */
+}
+
+.question-number {
+  font-weight: 600;
+  color: #175997;
+  min-width: 16px;
+}
+
+// .question-text {
+//   line-height: 1.5;
+//   color: #2c3e50;
+//   font-weight: 500;
+//   overflow: hidden;
+//   text-overflow: ellipsis;
+//   white-space: nowrap;
+// }
+
+.question-type-tag {
+  color: #3ba2f7;
+  font-size: 14px;
+  font-weight: 500;
+  text-align: right;
+}
+
+.question-options {
+  margin: 12px 0;
+  padding: 0 4px;
+}
+
+::v-deep .el-radio-group.options-group,
+::v-deep .el-checkbox-group.options-group {
+  display: grid;
+  grid-template-columns: repeat(2, 1fr);
+  gap: 10px;
+  width: 100%;
+}
+
+// 鍚屾牱澶勭悊澶氶�夌殑鎯呭喌
+::v-deep .el-checkbox-group {
+  display: grid;
+  grid-template-columns: repeat(2, 1fr);
+  gap: 10px;
+  width: 100%;
+
+  @media (max-width: 420px) {
+    grid-template-columns: 1fr;
+  }
+}
+
+// 淇敼閫夐」鐨勬牱寮�
+.option-radio,
+.option-checkbox {
+  margin: 0;
+  padding: 10px 12px;
+  border-radius: 6px;
+  border: 1px solid #e0e0e0;
+  transition: all 0.2s;
+  display: flex;
+  align-items: center;
+  width: 100%;
+  box-sizing: border-box;
+
+  &:hover {
+    border-color: #c0c4cc;
+    background-color: #f8fafc;
+  }
+
+  // 纭繚鍐呴儴鍐呭鑷�傚簲
+  :deep(.el-radio__label),
+  :deep(.el-checkbox__label) {
+    display: inline;
+    font-size: 15px;
+    line-height: 1.4;
+    word-break: break-all; // 鍏佽鍦ㄤ换鎰忓瓧绗﹀鎹㈣
+    white-space: normal; // 鍏佽鑷姩鎹㈣
+    padding-left: 6px;
+  }
+
+  // 纭繚 radio/checkbox 鍥炬爣涓嶅帇缂�
+  :deep(.el-radio__input),
+  :deep(.el-checkbox__input) {
+    flex-shrink: 0;
+  }
+}
+
+// :deep(.option-radio .el-radio__label),
+// :deep(.option-checkbox .el-checkbox__label) {
+//   display: flex;
+//   align-items: center;
+//   font-size: 16px;
+// }
+
+.option-text {
+  word-break: break-all;
+  white-space: normal;
+  line-height: 1.4;
+}
+
+.abnormal-indicator {
+  color: #f56c6c;
+  font-weight: bold;
+}
+
+.abnormal-option {
+  :deep(.el-radio__inner) {
+    border-color: #f56c6c;
+  }
+
+  :deep(.el-checkbox__inner) {
+    border-color: #f56c6c;
+  }
+}
+
+.question-input {
+  margin: 15px 0;
+}
+
+.answer-textarea {
+  :deep(.el-textarea__inner) {
+    font-size: 16px;
+    line-height: 1.5;
+  }
+}
+
+.question-warning {
+  margin-top: 15px;
+}
+
+.append-input-container {
+  margin-top: 15px;
+  padding: 10px;
+  background-color: #f5f7fa;
+  border-radius: 4px;
+  border: 1px solid #dcdfe6;
+}
+
+.warning-alert {
+  :deep(.el-alert__title) {
+    font-size: 15px;
+    line-height: 1.4;
+  }
+}
+
+.submit-section {
+  text-align: center;
+  padding: 20px 0 10px;
+  border-top: 1px solid #eaeef2;
+  margin-top: 20px;
+}
+
+.submit-button {
+  width: 100%;
+  max-width: 300px;
+  height: 50px;
+  font-size: 18px;
+  font-weight: 500;
+  border-radius: 8px;
+  background: linear-gradient(135deg, #175997 0%, #2a77c9 100%);
+  border: none;
+  box-shadow: 0 4px 12px rgba(23, 89, 151, 0.3);
+  transition: all 0.3s;
+
+  &:hover {
+    transform: translateY(-2px);
+    box-shadow: 0 6px 16px rgba(23, 89, 151, 0.4);
+  }
+
+  &:active {
+    transform: translateY(0);
+  }
+}
+
+.completion-page {
+  display: flex;
+  justify-content: center;
+  align-items: center;
+  min-height: 70vh;
+  padding: 20px;
+}
+
+.completion-content {
+  text-align: center;
+  max-width: 600px;
+  padding: 40px;
+  background: #ffffff;
+  border-radius: 12px;
+  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.08);
+}
+
+.completion-icon {
+  font-size: 80px;
+  color: #52c41a;
+  margin-bottom: 20px;
+}
+
+.completion-title {
+  color: #175997;
+  font-size: 32px;
+  font-weight: 700;
+  margin-bottom: 20px;
+}
+
+.completion-message {
+  font-size: 18px;
+  color: #5a6c84;
+  line-height: 1.6;
+}
+
+/* 鍝嶅簲寮忚璁� */
+@media (max-width: 768px) {
+  .content-wrapper {
+    padding: 0 10px;
+  }
+
+  .questionnaire-container {
+    padding: 20px 15px;
+  }
+
+  .questionnaire-title {
+    font-size: 24px;
+  }
+
+  .questionnaire-description {
+    font-size: 16px;
+  }
+
+  // .question-stem {
+  //   font-size: 16px;
+  //   flex-direction: column;
+  //   align-items: flex-start;
+  // }
+
+  .question-type-tag {
+    margin-left: 0;
+    margin-top: 5px;
+  }
+
+  .question-item {
+    padding: 15px;
+  }
+
+  .dimension-title {
+    padding: 10px 15px;
+
+    h3 {
+      font-size: 18px;
+    }
+  }
+
+  .completion-content {
+    padding: 30px 20px;
+  }
+
+  .completion-title {
+    font-size: 28px;
+  }
+
+  .completion-message {
+    font-size: 16px;
+  }
+}
+
+@media (max-width: 480px) {
+  .questionnaire-title {
+    font-size: 22px;
+  }
+
+  .completion-title {
+    font-size: 24px;
+  }
+
+  .completion-icon {
+    font-size: 60px;
+  }
+
+  .dimension-title h3 {
+    font-size: 16px;
+  }
+}
+
+.loading-container {
+  display: flex;
+  justify-content: center;
+  align-items: center;
+  min-height: 70vh;
+}
+
+.loading-content {
+  text-align: center;
+  padding: 40px;
+  background: #fff;
+  border-radius: 8px;
+  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1);
+}
+
+.loading-icon {
+  font-size: 40px;
+  color: #409eff;
+  margin-bottom: 15px;
+  animation: rotating 2s linear infinite;
+}
+
+.loading-text {
+  font-size: 16px;
+  color: #606266;
+}
+
+@keyframes rotating {
+  from {
+    transform: rotate(0deg);
+  }
+
+  to {
+    transform: rotate(360deg);
+  }
+}
+</style>
diff --git a/src/views/outsideChainwtnew.vue b/src/views/outsideChainwtnew.vue
index 4080709..4d5e662 100644
--- a/src/views/outsideChainwtnew.vue
+++ b/src/views/outsideChainwtnew.vue
@@ -360,11 +360,13 @@
       taskid: 355,
       patid: 265823,
       kcb: "",
+      subtaskid: null,
       excep: 0,
       isabnormal: 0,
       taskname: "",
       orgname: "",
       questionList: [],
+      permanentlyHidden: [], // 瀛樺偍琚案涔呴殣钘忕殑棰樼洰绱㈠紩
       param6: null,
       jsy: null,
       dialogVisible: false,
@@ -508,7 +510,8 @@
             res.data.param1,
             res.data.param2,
             res.data.param3,
-            res.data.param5
+            res.data.param5,
+            res.data.param6
           );
           if (
             res.data.orgname == "鐪佺珛鍚屽痉缈犺嫅闄㈠尯" ||
@@ -553,10 +556,11 @@
     // },
 
     // 鑾峰彇鏁版嵁
-    getQuestionnaire(param1, param2, param3) {
+    getQuestionnaire(param1, param2, param3, param5, param6) {
       this.taskid = decodeURIComponent(param1);
       this.patid = decodeURIComponent(param2);
       this.taskname = decodeURIComponent(param3);
+      this.subtaskid = decodeURIComponent(param6);
       this.loading = true;
 
       // let taskid =
@@ -568,7 +572,11 @@
       // let taskids = this.encrypt(this.taskid);
       // let patids = this.encrypt(this.patid);
       // 鍏堝彇缂撳瓨
-      getCachequestionnaire({ param1: this.taskid, param2: this.patid })
+      getCachequestionnaire({
+        param1: this.taskid,
+        param2: this.patid,
+        param6: param6,
+      })
         .then((res) => {
           if (res.code == 200) {
             this.questionList = res.data.result;
@@ -595,12 +603,18 @@
     },
     // 鑾峰彇鏁版嵁
     getExternalfollowup() {
-      getExternalfollowup({ param1: this.taskid, param2: this.patid })
+      getExternalfollowup({
+        param1: this.taskid,
+        param2: this.patid,
+        param6: this.subtaskid,
+      })
         .then((res) => {
           if (res.code == 200) {
             this.questionList = res.data.script;
             this.jsy = res.data.jsy;
             this.kcb = res.data.kcb;
+            if (res.data.taskName) this.taskname = res.data.taskName;
+
             // 澶勭悊棰樼洰鏀堕泦缁撴灉鏍煎紡
             this.questionList.forEach((item) => {
               item.nextScriptno = Number(item.nextScriptno);
@@ -739,9 +753,10 @@
     // 鏂板鐨勫垏鎹㈤�変腑/鍙栨秷閫変腑鏂规硶
     handleRadioToggle(questionItem, globalIndex, options, optionValue) {
       // 淇濆瓨褰撳墠鐘舵�佷互渚垮悗缁瘮杈�
-      const previousState = JSON.parse(JSON.stringify(this.questionList));
+      this.permanentlyHidden = this.permanentlyHidden.filter(
+        (idx) => idx <= globalIndex
+      );
 
-      // 鍘熸湁鐨勫鐞嗛�昏緫
       if (questionItem.scriptResult == optionValue) {
         questionItem.scriptResult = "";
         questionItem.isabnormal = 0;
@@ -755,20 +770,15 @@
           questionItem
         );
       }
-
-      // 澶勭悊瀹屾垚鍚庯紝纭繚閲嶆柊璁$畻鍙棰樼洰鐨勫簭鍙�
       this.$forceUpdate();
     },
 
     // 鍦╩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
       );
@@ -778,90 +788,93 @@
         this.questionList[questionIndex].score = selectedOptionObj.score;
         this.questionList[questionIndex].prompt = selectedOptionObj.prompt;
       }
-      // 澶勭悊寮傚父鐘舵�侀珮浜�
+      console.log(
+        this.questionList[questionIndex].nextScriptno,
+        "this.questionList[questionIndex].nextScriptno"
+      );
+      console.log(questionIndex, "questionIndex");
+
       this.questionList[questionIndex].isabnormal =
         selectedOptionObj.isabnormal;
-      // 澶勭悊闄勫姞杈撳叆妗嗘樉绀�
-
       this.questionList[questionIndex].showAppendInput =
         selectedOptionObj.appendflag == 1;
-      console.log(this.questionList);
-      console.log(selectedOptionObj.appendflag);
 
-      // if (!this.questionList[questionIndex].showAppendInput) {
-      //   this.questionList[questionIndex].answerps = ""; // 娓呴櫎闄勫姞淇℃伅
-      // }
-      // 淇濆瓨褰撳墠棰樼洰涔嬪墠宸茬粡闅愯棌鐨勯鐩姸鎬�
+      // 璁板綍褰撳墠棰樹箣鍓嶅凡闅愯棌鐨勯鐩储寮曪紙涓嶆敼鍙橈級
       const previouslyHiddenBeforeCurrent = this.questionList
         .slice(0, questionIndex)
         .map((item, index) => (item.ishide ? index : -1))
-        .filter((index) => index !== -1);
+        .filter((idx) => idx !== -1);
 
-      // 淇濆瓨涔嬪墠鍥爊extQuestion=0鑰岄殣钘忕殑棰樼洰鑼冨洿
-      const previouslyHiddenByEnd = this.questionList
-        .map((item, index) => (item.hiddenByEnd ? index : -1))
-        .filter((index) => index !== -1);
-
-      // 濡傛灉branchFlag涓�1锛屽鐞嗛鐩烦杞�
       if (a.branchFlag == 1) {
         if (selectedOptionObj.nextQuestion == 0) {
-          // 缁撴潫闂瓟 - 闅愯棌鍚庨潰鎵�鏈夐鐩苟鏍囪
+          // 銆愮粨鏉熼棶绛斻�戦殣钘忔墍鏈夊悗缁鐩紝骞惰褰曟案涔呴殣钘�
           this.questionList = this.questionList.map((item, index) => ({
             ...item,
             ishide: index > questionIndex,
-            hiddenByEnd: index > questionIndex, // 鏍囪杩欎簺棰樼洰鏄缁撴潫闂瓟闅愯棌鐨�
+            hiddenByEnd: index > questionIndex,
           }));
+          // 灏嗗悗缁殣钘忕殑棰樼洰鍔犲叆姘镐箙闅愯棌
+          this.questionList.forEach((item, idx) => {
+            if (idx > questionIndex && !this.permanentlyHidden.includes(idx)) {
+              this.permanentlyHidden.push(idx);
+            }
+          });
         } else {
-          // 姝e父璺宠浆閫昏緫
+          // 銆愭甯歌烦杞��
           const nextQuestionIndex = selectedOptionObj.nextQuestion - 1;
-          console.log(nextQuestionIndex, 4);
-          console.log(selectedOptionObj);
-
           this.questionList = this.questionList.map((item, index) => {
-            // 淇濈暀褰撳墠棰樼洰涔嬪墠鐨勯殣钘忕姸鎬�
             if (index < questionIndex) {
               return {
                 ...item,
                 ishide: previouslyHiddenBeforeCurrent.includes(index),
-                hiddenByEnd: false, // 娓呴櫎缁撴潫鏍囪
+                hiddenByEnd: false,
               };
             }
-
-            // 褰撳墠棰樼洰鎬绘槸鍙
             if (index == questionIndex) {
               return { ...item, ishide: 0, hiddenByEnd: false };
             }
-
-            // 鏄剧ず鐩爣涓嬩竴棰�
+            // 鐩爣棰橈細鑻ュ湪姘镐箙闅愯棌鍒楄〃涓紝寮哄埗闅愯棌
             if (index == nextQuestionIndex) {
-              return { ...item, ishide: 0, hiddenByEnd: false };
+              const shouldShow = !this.permanentlyHidden.includes(index);
+              return {
+                ...item,
+                ishide: shouldShow ? 0 : 1,
+                hiddenByEnd: false,
+              };
             }
-
-            // 濡傛灉鏄箣鍓嶈缁撴潫闂瓟闅愯棌鐨勯鐩紝鐜板湪搴旇鎭㈠鏄剧ず
+            // 涔嬪墠鍥犵粨鏉熼棶绛旈殣钘忕殑棰橈細鎭㈠鏄剧ず浣嗘鏌ユ案涔呴殣钘�
             if (item.hiddenByEnd) {
-              return { ...item, ishide: 0, hiddenByEnd: false };
+              const shouldShow = !this.permanentlyHidden.includes(index);
+              return {
+                ...item,
+                ishide: shouldShow ? 0 : 1,
+                hiddenByEnd: false,
+              };
             }
-
-            // 闅愯棌褰撳墠棰樺拰鐩爣棰樹箣闂寸殑棰樼洰
+            // 闅愯棌褰撳墠棰樺拰鐩爣棰樹箣闂寸殑棰樼洰锛屽苟璁板綍姘镐箙闅愯棌
             if (index > questionIndex && index < nextQuestionIndex) {
+              if (!this.permanentlyHidden.includes(index)) {
+                this.permanentlyHidden.push(index);
+              }
               return { ...item, ishide: 1, hiddenByEnd: false };
             }
-
-            // 鍏朵粬鎯呭喌淇濇寔鍘熺姸
             return item;
           });
         }
       } else {
-        // 濡傛灉娌℃湁璺宠浆锛屽彧闇�纭繚涓嬩竴棰樺彲瑙�
-        this.questionList = this.questionList.map((item, index) => ({
-          ...item,
-          ishide: index == questionIndex + 1 ? 0 : item.ishide,
-          hiddenByEnd: index == questionIndex + 1 ? false : item.hiddenByEnd,
-        }));
+        // 銆愭棤璺宠浆銆戜粎鏄剧ず涓嬩竴棰橈紝浣嗛渶妫�鏌ユ案涔呴殣钘�
+        // 濡傛灉娌℃湁璺宠浆锛屽彧闇�纭繚涓嬩竴棰樺彲瑙侊紝浣嗛渶妫�鏌ユ案涔呴殣钘�
+        this.questionList = this.questionList.map((item, index) => {
+          if (index == questionIndex + 1) {
+            const shouldShow = !this.permanentlyHidden.includes(index);
+            return { ...item, ishide: shouldShow ? 0 : 1, hiddenByEnd: false };
+          }
+          // 鍏朵粬棰樼洰淇濇寔涓嶅彉
+          return item;
+        });
       }
-      this.$forceUpdate();
 
-      // 鍦ㄥ鐞嗗畬棰樼洰鏄剧ず/闅愯棌鍚庯紝寮哄埗鏇存柊瑙嗗浘浠ョ‘淇濆簭鍙锋纭�
+      this.$forceUpdate();
       this.$nextTick(() => {
         this.$forceUpdate();
       });
@@ -919,18 +932,25 @@
   max-width: 720px;
   margin: 0;
   padding: 0 16px;
-  text-align: justify; /* 涓ょ瀵归綈锛屾洿缇庤 */
-  text-indent: 2em; /* 棣栬缂╄繘 */
+  text-align: justify;
+  /* 涓ょ瀵归綈锛屾洿缇庤 */
+  text-indent: 2em;
+  /* 棣栬缂╄繘 */
 }
+
 .questionnaire-signature {
   font-size: 16px;
   color: #303a47;
-  text-align: right; /* 鍙冲榻� */
+  text-align: right;
+  /* 鍙冲榻� */
   max-width: 720px;
-  margin: 8px 0 0 auto; /* 涓婅竟璺�8px锛屽彸杈归潬榻� */
+  margin: 8px 0 0 auto;
+  /* 涓婅竟璺�8px锛屽彸杈归潬榻� */
   padding: 0 16px;
-  letter-spacing: 1px; /* 瀛楅棿璺濈◢瀹斤紝鏇存湁钀芥鎰� */
+  letter-spacing: 1px;
+  /* 瀛楅棿璺濈◢瀹斤紝鏇存湁钀芥鎰� */
 }
+
 .custom-divider {
   margin: 25px 0;
   background-color: #eaeef2;
@@ -993,7 +1013,8 @@
   display: grid;
   grid-template-columns: auto 1fr auto;
   gap: 3px;
-  align-items: start; /* 鏀逛负 start 閬垮厤灞呬腑瀵艰嚧鐨勮瑙夐棶棰� */
+  align-items: start;
+  /* 鏀逛负 start 閬垮厤灞呬腑瀵艰嚧鐨勮瑙夐棶棰� */
   margin-bottom: 20px;
   font-size: 18px;
 }
@@ -1004,8 +1025,10 @@
   font-weight: 500;
   word-wrap: break-word;
   overflow-wrap: break-word;
-  white-space: normal; /* 纭繚鍏佽鎹㈣ */
-  min-width: 0; /* 闃叉 grid 椤规孩鍑� */
+  white-space: normal;
+  /* 纭繚鍏佽鎹㈣ */
+  min-width: 0;
+  /* 闃叉 grid 椤规孩鍑� */
 }
 
 .question-number {
@@ -1034,6 +1057,7 @@
   margin: 12px 0;
   padding: 0 4px;
 }
+
 ::v-deep .el-radio-group.options-group,
 ::v-deep .el-checkbox-group.options-group {
   display: grid;
@@ -1053,6 +1077,7 @@
     grid-template-columns: 1fr;
   }
 }
+
 // 淇敼閫夐」鐨勬牱寮�
 .option-radio,
 .option-checkbox {
@@ -1131,6 +1156,7 @@
 .question-warning {
   margin-top: 15px;
 }
+
 .append-input-container {
   margin-top: 15px;
   padding: 10px;
@@ -1138,6 +1164,7 @@
   border-radius: 4px;
   border: 1px solid #dcdfe6;
 }
+
 .warning-alert {
   :deep(.el-alert__title) {
     font-size: 15px;
@@ -1281,6 +1308,7 @@
     font-size: 16px;
   }
 }
+
 .loading-container {
   display: flex;
   justify-content: center;
@@ -1312,6 +1340,7 @@
   from {
     transform: rotate(0deg);
   }
+
   to {
     transform: rotate(360deg);
   }
diff --git a/src/views/patient/archives/childHealth/InfoField.vue b/src/views/patient/archives/childHealth/InfoField.vue
new file mode 100644
index 0000000..3749a24
--- /dev/null
+++ b/src/views/patient/archives/childHealth/InfoField.vue
@@ -0,0 +1,42 @@
+<template>
+  <div class="info-field">
+    <label>{{ label }}锛�</label>
+    <template v-if="editing && type === 'select'">
+      <el-select :value="value" size="small" style="width:100%" @change="$emit('change', $event)">
+        <el-option v-for="o in options" :key="o.value || o" :label="o.label || o" :value="o.value || o" />
+      </el-select>
+    </template>
+    <template v-else-if="editing">
+      <el-input :value="value" size="small" @input="$emit('update:modelValue', $event)" />
+    </template>
+    <span v-else>{{ displayValue }}</span>
+  </div>
+</template>
+
+<script>
+export default {
+  name: "InfoField",
+  props: {
+    label: { type: String, default: "" },
+    value: { default: "" },
+    editing: { type: Boolean, default: false },
+    type: { type: String, default: "text" },
+    options: { type: Array, default: () => [] },
+  },
+  computed: {
+    displayValue() {
+      if (this.type === 'select' && this.options.length) {
+        const opt = this.options.find(o => (o.value || o) === this.value);
+        return opt ? (opt.label || opt) : (this.value || "-");
+      }
+      return this.value || "-";
+    },
+  },
+};
+</script>
+
+<style scoped>
+.info-field { font-size: 14px; line-height: 2; }
+.info-field label { color: #909399; }
+.info-field span { color: #303133; }
+</style>
diff --git a/src/views/patient/archives/childHealth/detail.vue b/src/views/patient/archives/childHealth/detail.vue
new file mode 100644
index 0000000..9505e80
--- /dev/null
+++ b/src/views/patient/archives/childHealth/detail.vue
@@ -0,0 +1,305 @@
+<template>
+  <div class="app-container" v-loading="loading">
+    <template v-if="archive">
+      <div class="action-bar">
+        <el-button @click="$router.go(-1)" icon="el-icon-back">杩斿洖</el-button>
+        <el-button :type="editing ? 'success' : 'primary'" :icon="editing ? 'el-icon-check' : 'el-icon-edit'" @click="toggleEdit">{{ editing ? '淇濆瓨' : '缂栬緫' }}</el-button>
+        <el-tag :type="subTypeTag(archive.subType)" style="margin-left:12px">{{ archive.subTypeLabel }}</el-tag>
+      </div>
+
+      <!-- 鎮h�呭熀鏈俊鎭� -->
+      <el-card class="info-card" shadow="never">
+        <div slot="header" class="card-header"><span>鎮h�呭熀鏈俊鎭�</span></div>
+        <el-row :gutter="20">
+          <el-col :span="6"><InfoField label="濮撳悕" :value="archive.patname" /></el-col>
+          <el-col :span="6"><InfoField label="鎬у埆" :value="archive.sex == 1 ? '鐢�' : '濂�'" /></el-col>
+          <el-col :span="6"><InfoField label="骞撮緞" :value="archive.age" /></el-col>
+          <el-col :span="6"><InfoField label="鐢佃瘽" :value="archive.telcode" /></el-col>
+        </el-row>
+        <el-row :gutter="20" style="margin-top:10px">
+          <el-col :span="6"><InfoField label="绉戝" :value="archive.deptname" /></el-col>
+          <el-col :span="6"><InfoField label="璇婃柇" :value="archive.diagname" /></el-col>
+          <el-col :span="6"><InfoField label="涓绘不鍖荤敓" :value="archive.drname" /></el-col>
+          <el-col :span="6"><InfoField label="鏉ユ簮" :value="sourceLabel" /></el-col>
+        </el-row>
+      </el-card>
+
+      <!-- 瀹堕暱淇℃伅 -->
+      <el-card class="info-card" shadow="never" style="margin-top:14px">
+        <div slot="header" class="card-header"><span>瀹堕暱/鐩戞姢浜轰俊鎭�</span></div>
+        <el-row :gutter="20">
+          <el-col :span="6">
+            <InfoField label="瀹堕暱濮撳悕" :value="parentInfo.parentName" :editing="editing" v-model="parentInfo.parentName" />
+          </el-col>
+          <el-col :span="6">
+            <InfoField label="涓庡効绔ュ叧绯�" :value="relationLabel" :editing="editing" type="select" :options="relationOptions" @change="v => parentInfo.relation = v" />
+          </el-col>
+          <el-col :span="6">
+            <InfoField label="鑱旂郴鐢佃瘽" :value="parentInfo.parentPhone" :editing="editing" v-model="parentInfo.parentPhone" />
+          </el-col>
+          <el-col :span="6">
+            <InfoField label="韬唤璇佸彿" :value="parentInfo.parentIdCard" :editing="editing" v-model="parentInfo.parentIdCard" />
+          </el-col>
+        </el-row>
+        <el-row :gutter="20" style="margin-top:10px">
+          <el-col :span="12">
+            <InfoField label="鑱旂郴鍦板潃" :value="parentInfo.address" :editing="editing" v-model="parentInfo.address" />
+          </el-col>
+        </el-row>
+      </el-card>
+
+      <!-- 妗f鍩烘湰淇℃伅 -->
+      <el-card class="info-card" shadow="never" style="margin-top:14px">
+        <div slot="header" class="card-header">
+          <span>妗f鍩烘湰淇℃伅</span>
+          <span class="header-sub">{{ archive.createTime ? archive.createTime.substring(0,10) : '-' }} 寤烘。</span>
+        </div>
+        <el-row :gutter="20">
+          <el-col :span="8"><InfoField label="寤烘。绫诲瀷" :value="archive.subTypeLabel" /></el-col>
+          <el-col :span="8"><InfoField label="寤烘。鍖荤敓" :value="archive.archiveForm.doctorName" :editing="editing" v-model="archive.archiveForm.doctorName" /></el-col>
+          <el-col :span="8"><InfoField label="寤烘。鏃堕棿" :value="archive.createTime" /></el-col>
+        </el-row>
+      </el-card>
+
+      <!-- 楂樺嵄鍎夸笓妗� 鈫� 鍙紪杈戣〃鏍� -->
+      <el-card v-if="archive.subType === 'highRisk'" class="info-card" shadow="never" style="margin-top:14px">
+        <div slot="header" class="card-header"><span>楂樺嵄鍎夸笓妗堢鐞�</span></div>
+        <el-tabs v-model="activeTab" type="border-card">
+          <el-tab-pane label="鐢熼暱鍙戣偛鐩戞祴" name="growth">
+            <EditableTable :data.sync="growthData" :editing="editing" :columns="growthColumns" />
+          </el-tab-pane>
+          <el-tab-pane label="绁炵粡绯荤粺璇勪及" name="neuro">
+            <EditableTable :data.sync="neuroData" :editing="editing" :columns="neuroColumns" />
+          </el-tab-pane>
+          <el-tab-pane label="骞查璁板綍" name="intervention">
+            <EditableTable :data.sync="interventionData" :editing="editing" :columns="interventionColumns" />
+          </el-tab-pane>
+        </el-tabs>
+      </el-card>
+
+      <!-- 钀ュ吇鎬х柧鐥呬笓妗� 鈫� 鍙紪杈戣〃鏍� -->
+      <el-card v-if="archive.subType === 'nutrition'" class="info-card" shadow="never" style="margin-top:14px">
+        <div slot="header" class="card-header"><span>钀ュ吇鎬х柧鐥呬笓妗堢鐞�</span></div>
+        <el-tabs v-model="activeTab" type="border-card">
+          <el-tab-pane label="浣撴牸娴嬮噺" name="measure">
+            <EditableTable :data.sync="measureData" :editing="editing" :columns="measureColumns" />
+          </el-tab-pane>
+          <el-tab-pane label="鑶抽璇勪及" name="diet">
+            <EditableTable :data.sync="dietData" :editing="editing" :columns="dietColumns" />
+          </el-tab-pane>
+          <el-tab-pane label="骞查鏂规" name="plan">
+            <EditableTable :data.sync="planData" :editing="editing" :columns="planColumns" />
+          </el-tab-pane>
+        </el-tabs>
+      </el-card>
+
+      <!-- 瀛︿範鍥伴毦涓撴 鈫� 鍗曚竴琛ㄥ崟 -->
+      <el-card v-if="archive.subType === 'learning'" class="info-card" shadow="never" style="margin-top:14px">
+        <div slot="header" class="card-header"><span>瀛︿範鍥伴毦涓撴绠$悊</span></div>
+        <el-form :model="form" label-width="130px" size="small" :disabled="!editing">
+          <el-divider content-position="left">瀛︿範鑳藉姏璇勪及</el-divider>
+          <el-row :gutter="20">
+            <el-col :span="8"><el-form-item label="璇勪及鏃ユ湡"><el-date-picker v-model="form.assessDate" value-format="yyyy-MM-dd" style="width:100%" /></el-form-item></el-col>
+            <el-col :span="8"><el-form-item label="娴嬭瘎宸ュ叿"><el-input v-model="form.testName" /></el-form-item></el-col>
+            <el-col :span="8"><el-form-item label="鏅哄晢(IQ)"><el-input-number v-model="form.iq" :min="40" :max="160" /></el-form-item></el-col>
+          </el-row>
+          <el-row :gutter="20">
+            <el-col :span="8"><el-form-item label="闃呰鑳藉姏"><el-select v-model="form.reading" style="width:100%"><el-option v-for="o in gradeOptions" :key="o" :label="o" :value="o" /></el-select></el-form-item></el-col>
+            <el-col :span="8"><el-form-item label="涔﹀啓鑳藉姏"><el-select v-model="form.writing" style="width:100%"><el-option v-for="o in gradeOptions" :key="o" :label="o" :value="o" /></el-select></el-form-item></el-col>
+            <el-col :span="8"><el-form-item label="璁$畻鑳藉姏"><el-select v-model="form.math" style="width:100%"><el-option v-for="o in gradeOptions" :key="o" :label="o" :value="o" /></el-select></el-form-item></el-col>
+          </el-row>
+          <el-form-item label="缁煎悎缁撹"><el-input v-model="form.result" type="textarea" :rows="2" /></el-form-item>
+
+          <el-divider content-position="left">琛屼负璇勪及</el-divider>
+          <el-row :gutter="20">
+            <el-col :span="8"><el-form-item label="璇勪及鏃ユ湡"><el-date-picker v-model="form.behaviorDate" value-format="yyyy-MM-dd" style="width:100%" /></el-form-item></el-col>
+            <el-col :span="4"><el-form-item label="娉ㄦ剰鍔�"><el-input-number v-model="form.attention" :min="0" :max="36" /></el-form-item></el-col>
+            <el-col :span="4"><el-form-item label="澶氬姩"><el-input-number v-model="form.hyperactivity" :min="0" :max="36" /></el-form-item></el-col>
+            <el-col :span="4"><el-form-item label="鍐插姩"><el-input-number v-model="form.impulsivity" :min="0" :max="36" /></el-form-item></el-col>
+            <el-col :span="4"><el-form-item label="鎯呯华"><el-input-number v-model="form.emotional" :min="0" :max="36" /></el-form-item></el-col>
+          </el-row>
+          <el-row :gutter="20">
+            <el-col :span="8"><el-form-item label="鎬诲垎"><el-input-number v-model="form.totalScore" disabled /></el-form-item></el-col>
+            <el-col :span="8"><el-form-item label="璇勪环"><el-select v-model="form.evaluation" style="width:100%"><el-option label="姝e父鑼冨洿" value="姝e父鑼冨洿" /><el-option label="杞诲害寮傚父" value="杞诲害寮傚父" /><el-option label="涓害寮傚父" value="涓害寮傚父" /></el-select></el-form-item></el-col>
+          </el-row>
+
+          <el-divider content-position="left">骞查璁粌璁板綍</el-divider>
+          <el-row :gutter="20">
+            <el-col :span="8"><el-form-item label="璁粌鏃ユ湡"><el-date-picker v-model="form.trainDate" value-format="yyyy-MM-dd" style="width:100%" /></el-form-item></el-col>
+            <el-col :span="8"><el-form-item label="璁粌绫诲瀷"><el-input v-model="form.trainingType" /></el-form-item></el-col>
+            <el-col :span="8"><el-form-item label="鏃堕暱(鍒嗛挓)"><el-input-number v-model="form.duration" :min="10" :max="120" /></el-form-item></el-col>
+          </el-row>
+          <el-form-item label="璁粌鍐呭"><el-input v-model="form.trainContent" type="textarea" :rows="2" /></el-form-item>
+          <el-row :gutter="20">
+            <el-col :span="8"><el-form-item label="璁粌甯�"><el-input v-model="form.trainer" /></el-form-item></el-col>
+            <el-col :span="8"><el-form-item label="杩涘睍"><el-select v-model="form.progress" style="width:100%"><el-option label="鑹ソ" value="鑹ソ" /><el-option label="涓�鑸�" value="涓�鑸�" /><el-option label="缂撴參" value="缂撴參" /></el-select></el-form-item></el-col>
+          </el-row>
+        </el-form>
+      </el-card>
+    </template>
+    <div v-else class="empty-wrap">妗f涓嶅瓨鍦ㄦ垨宸插垹闄�</div>
+  </div>
+</template>
+
+<script>
+import EditableTable from "../components/EditableTable.vue";
+import InfoField from "./InfoField.vue";
+
+export default {
+  name: "ChildHealthArchiveDetail",
+  components: { EditableTable, InfoField },
+  data() {
+    return {
+      loading: false, archive: null, editing: false, activeTab: "growth",
+      relationOptions: [
+        { label:"鐖朵翰", value:"father" },{ label:"姣嶄翰", value:"mother" },{ label:"绁栫埗", value:"grandfather" },{ label:"绁栨瘝", value:"grandmother" },{ label:"鍏朵粬", value:"other" },
+      ],
+      gradeOptions: ["浼樼","鑹ソ","涓瓑","涓笅","宸�"],
+      form: { assessDate:"", testName:"", reading:"涓瓑", writing:"涓瓑", math:"涓瓑", iq:null, result:"",
+        behaviorDate:"", attention:null, hyperactivity:null, impulsivity:null, emotional:null, totalScore:null, evaluation:"姝e父鑼冨洿",
+        trainDate:"", trainingType:"", trainContent:"", duration:40, trainer:"", progress:"鑹ソ" },
+      growthData: [], neuroData: [], interventionData: [],
+      measureData: [], dietData: [], planData: [],
+      growthColumns: [
+        { prop:"checkDate", label:"妫�鏌ユ棩鏈�", width:120, type:"date" },{ prop:"monthAge", label:"鏈堥緞", width:80 },
+        { prop:"weight", label:"浣撻噸(kg)", width:100, type:"number" },{ prop:"height", label:"韬珮(cm)", width:100, type:"number" },
+        { prop:"headCircum", label:"澶村洿(cm)", width:100, type:"number" },{ prop:"weightPercentile", label:"浣撻噸鐧惧垎浣�", width:110 },
+        { prop:"heightPercentile", label:"韬珮鐧惧垎浣�", width:110 },{ prop:"evaluation", label:"璇勪及缁撴灉", type:"select", options:["姝e父","鍋忕槮","鍋忚儢","鍙戣偛杩熺紦"] },
+        { prop:"doctor", label:"妫�鏌ュ尰鐢�", width:100 },
+      ],
+      neuroColumns: [
+        { prop:"checkDate", label:"璇勪及鏃ユ湡", width:120, type:"date" },{ prop:"monthAge", label:"鏈堥緞", width:70 },
+        { prop:"muscleTone", label:"鑲屽紶鍔�", width:100 },{ prop:"reflex", label:"鍘熷鍙嶅皠", width:100 },
+        { prop:"gms", label:"GMs璇勪及", width:120 },{ prop:"nbnaScore", label:"NBNA璇勫垎", width:100, type:"number" },
+        { prop:"evaluation", label:"缁煎悎璇勪及", type:"select", options:["姝e父","寮傚父","鍙枒"] },{ prop:"doctor", label:"璇勪及鍖荤敓", width:100 },
+      ],
+      interventionColumns: [
+        { prop:"date", label:"鏃ユ湡", width:120, type:"date" },{ prop:"type", label:"骞查绫诲瀷", width:140 },
+        { prop:"content", label:"骞查鍐呭", minWidth:200 },{ prop:"frequency", label:"棰戠巼", width:120 },
+        { prop:"effect", label:"鏁堟灉璇勪环", width:100 },{ prop:"executor", label:"鎵ц浜�", width:100 },
+      ],
+      measureColumns: [
+        { prop:"checkDate", label:"妫�鏌ユ棩鏈�", width:120, type:"date" },{ prop:"weight", label:"浣撻噸(kg)", width:100, type:"number" },
+        { prop:"height", label:"韬珮(cm)", width:100, type:"number" },{ prop:"bmi", label:"BMI", width:80, type:"number" },
+        { prop:"bmiPercentile", label:"BMI鐧惧垎浣�", width:110 },{ prop:"waistHip", label:"鑵板洿/鑷�鍥�", width:120 },
+        { prop:"evaluation", label:"钀ュ吇璇勪环", type:"select", options:["姝e父","瓒呴噸","鑲ヨ儢","钀ュ吇涓嶈壇"] },
+      ],
+      dietColumns: [
+        { prop:"date", label:"璇勪及鏃ユ湡", width:120, type:"date" },{ prop:"energy", label:"鑳介噺(kcal/d)", width:120, type:"number" },
+        { prop:"protein", label:"铔嬬櫧璐�(g/d)", width:120, type:"number" },{ prop:"fat", label:"鑴傝偑(g/d)", width:100, type:"number" },
+        { prop:"carbs", label:"纰虫按(g/d)", width:100, type:"number" },{ prop:"dietScore", label:"鑶抽璇勫垎", width:100 },
+        { prop:"problem", label:"瀛樺湪闂", minWidth:160 },
+      ],
+      planColumns: [
+        { prop:"date", label:"鍒跺畾鏃ユ湡", width:120, type:"date" },{ prop:"target", label:"骞查鐩爣", minWidth:200 },
+        { prop:"energyTarget", label:"鑳介噺鐩爣(kcal)", width:130, type:"number" },{ prop:"foodGuide", label:"鑶抽鎸囧", minWidth:200 },
+        { prop:"exercise", label:"杩愬姩寤鸿", minWidth:180 },{ prop:"reviewDate", label:"澶嶆煡鏃ユ湡", width:120 },
+      ],
+    };
+  },
+  computed: {
+    parentInfo() { return (this.archive && this.archive.parentInfo) ? this.archive.parentInfo : {}; },
+    sourceLabel() {
+      const map = { standalone:"鐙珛寤烘。", outpatient:"闂ㄨ瘖璁板綍", inpatient:"鍦ㄩ櫌璁板綍" };
+      return map[this.archive?.sourcePage] || this.archive?.sourcePage || "-";
+    },
+    relationLabel() {
+      const r = this.relationOptions.find(o => o.value === (this.archive?.parentInfo?.relation));
+      return r ? r.label : "-";
+    },
+  },
+  created() {
+    const id = this.$route.query.id;
+    if (id) this.loadArchive(id);
+  },
+  methods: {
+    loadArchive(id) {
+      this.loading = true;
+      const all = JSON.parse(localStorage.getItem("patientArchives") || "[]");
+      this.archive = all.find(item => item.id === id) || null;
+      if (this.archive) {
+        if (this.archive.subType === 'highRisk') {
+          this.activeTab = "growth";
+          this.growthData = this.archive.growthData || getDefaultGrowthData();
+          this.neuroData = this.archive.neuroData || getDefaultNeuroData();
+          this.interventionData = this.archive.interventionData || getDefaultInterventionData();
+        } else if (this.archive.subType === 'nutrition') {
+          this.activeTab = "measure";
+          this.measureData = this.archive.measureData || getDefaultMeasureData();
+          this.dietData = this.archive.dietData || getDefaultDietData();
+          this.planData = this.archive.planData || getDefaultPlanData();
+        } else if (this.archive.subType === 'learning' && this.archive.archiveForm?.learningData) {
+          Object.assign(this.form, this.archive.archiveForm.learningData);
+        }
+      }
+      this.loading = false;
+    },
+    toggleEdit() {
+      if (this.editing) {
+        if (this.archive.subType === 'learning') {
+          if (!this.archive.archiveForm) this.archive.archiveForm = {};
+          this.archive.archiveForm.learningData = JSON.parse(JSON.stringify(this.form));
+        }
+        if (this.archive.subType === 'highRisk') {
+          this.archive.growthData = JSON.parse(JSON.stringify(this.growthData));
+          this.archive.neuroData = JSON.parse(JSON.stringify(this.neuroData));
+          this.archive.interventionData = JSON.parse(JSON.stringify(this.interventionData));
+        }
+        if (this.archive.subType === 'nutrition') {
+          this.archive.measureData = JSON.parse(JSON.stringify(this.measureData));
+          this.archive.dietData = JSON.parse(JSON.stringify(this.dietData));
+          this.archive.planData = JSON.parse(JSON.stringify(this.planData));
+        }
+        this.archive.updateTime = new Date().toISOString().replace("T"," ").substring(0,19);
+        const all = JSON.parse(localStorage.getItem("patientArchives") || "[]");
+        const idx = all.findIndex(item => item.id === this.archive.id);
+        if (idx >= 0) all[idx] = JSON.parse(JSON.stringify(this.archive));
+        localStorage.setItem("patientArchives", JSON.stringify(all));
+        this.$message.success("淇濆瓨鎴愬姛");
+      }
+      this.editing = !this.editing;
+    },
+    subTypeTag(type) { const m={highRisk:"danger",nutrition:"warning",learning:"info"}; return m[type]||""; },
+  },
+};
+
+function getDefaultGrowthData() {
+  return [
+    { checkDate:"2026-07-01", monthAge:"1鏈�", weight:4.2, height:54.5, headCircum:37.0, weightPercentile:"P25", heightPercentile:"P30", evaluation:"姝e父", doctor:"寮犲尰鐢�" },
+    { checkDate:"2026-08-01", monthAge:"2鏈�", weight:5.3, height:58.0, headCircum:39.0, weightPercentile:"P35", heightPercentile:"P40", evaluation:"姝e父", doctor:"寮犲尰鐢�" },
+  ];
+}
+function getDefaultNeuroData() {
+  return [
+    { checkDate:"2026-07-01", monthAge:"1鏈�", muscleTone:"姝e父", reflex:"瀛樺湪", gms:"姝e父鎵姩", nbnaScore:38, evaluation:"姝e父", doctor:"鐜嬪尰鐢�" },
+  ];
+}
+function getDefaultInterventionData() {
+  return [
+    { date:"2026-07-01", type:"鏃╂湡骞查璁粌", content:"淇崸鎶ご璁粌銆佽瑙夎拷韪缁�", frequency:"姣忔棩2娆�", effect:"鑹ソ", executor:"搴峰甯堣档" },
+  ];
+}
+function getDefaultMeasureData() {
+  return [
+    { checkDate:"2026-07-05", weight:28.5, height:132.0, bmi:16.4, bmiPercentile:"P85", waistHip:"62/74", evaluation:"瓒呴噸" },
+  ];
+}
+function getDefaultDietData() {
+  return [
+    { date:"2026-07-05", energy:2200, protein:65, fat:80, carbs:320, dietScore:"65", problem:"鑳介噺鎽勫叆鍋忛珮銆佽敩鑿滄按鏋滄憚鍏ヤ笉瓒�" },
+  ];
+}
+function getDefaultPlanData() {
+  return [
+    { date:"2026-07-05", target:"3涓湀鍐匓MI闄嶈嚦P75浠ヤ笅", energyTarget:1800, foodGuide:"鎺у埗闆堕銆佸鍔犺敩鑿滆嚦姣忔棩300g", exercise:"姣忔棩杩愬姩60鍒嗛挓", reviewDate:"2026-10-05" },
+  ];
+}
+</script>
+
+<style lang="scss" scoped>
+.action-bar { margin-bottom: 16px; }
+.info-card { margin-bottom: 0; }
+.card-header { display: flex; justify-content: space-between; align-items: center; font-size: 16px; font-weight: 600; }
+.header-sub { font-size: 13px; color: #909399; font-weight: normal; }
+.empty-wrap { text-align: center; padding: 100px 0; color: #c0c4cc; font-size: 16px; }
+</style>
diff --git a/src/views/patient/archives/childHealth/index.vue b/src/views/patient/archives/childHealth/index.vue
new file mode 100644
index 0000000..546b5c9
--- /dev/null
+++ b/src/views/patient/archives/childHealth/index.vue
@@ -0,0 +1,145 @@
+<template>
+  <div class="app-container">
+    <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="80px">
+      <el-form-item label="鎮h�呭鍚�">
+        <el-input v-model="queryParams.patname" placeholder="璇疯緭鍏ュ鍚�" clearable @keyup.enter.native="handleQuery" style="width:180px" />
+      </el-form-item>
+      <el-form-item label="涓撴绫诲瀷">
+        <el-select v-model="queryParams.subType" placeholder="璇烽�夋嫨" clearable style="width:180px">
+          <el-option label="楂樺嵄鍎夸笓妗堢鐞�" value="highRisk" />
+          <el-option label="钀ュ吇鎬х柧鐥呬笓妗堢鐞�" value="nutrition" />
+          <el-option label="瀛︿範鍥伴毦涓撴绠$悊" value="learning" />
+        </el-select>
+      </el-form-item>
+      <el-form-item label="绉戝">
+        <el-input v-model="queryParams.deptname" placeholder="璇疯緭鍏ョ瀹�" clearable @keyup.enter.native="handleQuery" style="width:180px" />
+      </el-form-item>
+      <el-form-item label="寤烘。鏃ユ湡">
+        <el-date-picker v-model="dateRange" style="width:240px" value-format="yyyy-MM-dd" type="daterange"
+          range-separator="-" start-placeholder="寮�濮嬫棩鏈�" end-placeholder="缁撴潫鏃ユ湡" />
+      </el-form-item>
+      <el-form-item>
+        <el-button type="primary" icon="el-icon-search" size="medium" @click="handleQuery">鎼滅储</el-button>
+        <el-button icon="el-icon-refresh" size="medium" @click="resetQuery">閲嶇疆</el-button>
+      </el-form-item>
+    </el-form>
+
+    <el-row :gutter="10" class="mb8">
+      <el-col :span="1.5">
+        <el-button type="primary" plain icon="el-icon-plus" size="medium" @click="handleCreateStandalone">鏂板缓寤烘。</el-button>
+      </el-col>
+      <el-col :span="1.5">
+        <el-button type="danger" plain icon="el-icon-delete" size="medium" :disabled="multiple" @click="handleDelete">鍒犻櫎</el-button>
+      </el-col>
+      <right-toolbar :showSearch.sync="showSearch" @queryTable="getList" />
+    </el-row>
+
+    <el-table v-loading="loading" :data="displayList" @selection-change="handleSelectionChange">
+      <el-table-column type="selection" width="50" align="center" />
+      <el-table-column label="鎮h�呭鍚�" align="center" prop="patname" width="100" />
+      <el-table-column label="鎬у埆" align="center" width="60">
+        <template slot-scope="scope">{{ scope.row.sex == 1 ? '鐢�' : '濂�' }}</template>
+      </el-table-column>
+      <el-table-column label="骞撮緞" align="center" prop="age" width="60" />
+      <el-table-column label="鑱旂郴鐢佃瘽" align="center" prop="telcode" width="130" />
+      <!-- 瀹堕暱淇℃伅鍒� -->
+      <el-table-column label="瀹堕暱濮撳悕" align="center" width="100">
+        <template slot-scope="scope">{{ scope.row.parentInfo ? scope.row.parentInfo.parentName || '-' : '-' }}</template>
+      </el-table-column>
+      <el-table-column label="瀹堕暱鐢佃瘽" align="center" width="130">
+        <template slot-scope="scope">{{ scope.row.parentInfo ? scope.row.parentInfo.parentPhone || '-' : '-' }}</template>
+      </el-table-column>
+      <el-table-column label="绉戝" align="center" prop="deptname" width="120" show-overflow-tooltip />
+      <el-table-column label="璇婃柇" align="center" prop="diagname" min-width="150" show-overflow-tooltip />
+      <el-table-column label="涓撴绫诲瀷" align="center" width="160">
+        <template slot-scope="scope">
+          <el-tag :type="subTypeTag(scope.row.subType)">{{ scope.row.subTypeLabel }}</el-tag>
+        </template>
+      </el-table-column>
+      <el-table-column label="寤烘。鍖荤敓" align="center" prop="archiveForm.doctorName" width="100" />
+      <el-table-column label="寤烘。鏃堕棿" align="center" width="160">
+        <template slot-scope="scope">{{ scope.row.createTime ? scope.row.createTime.substring(0, 10) : '-' }}</template>
+      </el-table-column>
+      <el-table-column label="鏉ユ簮" align="center" width="80">
+        <template slot-scope="scope">
+          <el-tag v-if="scope.row.sourcePage === 'standalone'" type="info" size="mini">鐙珛</el-tag>
+          <span v-else>{{ scope.row.sourcePage === 'inpatient' ? '鍦ㄩ櫌' : '闂ㄨ瘖' }}</span>
+        </template>
+      </el-table-column>
+      <el-table-column label="鎿嶄綔" align="center" fixed="right" width="120">
+        <template slot-scope="scope">
+          <el-button size="medium" type="text" @click="goDetail(scope.row)">
+            <span class="button-textsc"><i class="el-icon-zoom-in" />鏌ョ湅</span>
+          </el-button>
+          <el-button size="medium" type="text" @click="handleSingleDelete(scope.row)">
+            <span style="color:#f56c6c"><i class="el-icon-delete" />鍒犻櫎</span>
+          </el-button>
+        </template>
+      </el-table-column>
+    </el-table>
+
+    <pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize"
+      @pagination="getList" />
+
+    <!-- 鐙珛寤烘。寮圭獥 -->
+    <ArchiveDialog :visible.sync="createDialogVisible" :standalone="true" @created="getList" />
+  </div>
+</template>
+
+<script>
+import ArchiveDialog from "@/views/patient/archives/components/ArchiveDialog.vue";
+
+export default {
+  name: "ChildHealthArchive",
+  components: { ArchiveDialog },
+  data() {
+    return {
+      loading: false, showSearch: true, multiple: true, ids: [], dateRange: [], total: 0, allList: [], displayList: [],
+      createDialogVisible: false,
+      queryParams: { pageNum: 1, pageSize: 10, patname: "", subType: "", deptname: "" },
+    };
+  },
+  created() { this.getList(); },
+  methods: {
+    getList() {
+      this.loading = true;
+      const all = JSON.parse(localStorage.getItem("patientArchives") || "[]");
+      this.allList = all.filter((item) => item.mainCategory === "child");
+      let filtered = [...this.allList];
+      if (this.queryParams.patname) filtered = filtered.filter((item) => item.patname && item.patname.includes(this.queryParams.patname));
+      if (this.queryParams.subType) filtered = filtered.filter((item) => item.subType === this.queryParams.subType);
+      if (this.queryParams.deptname) filtered = filtered.filter((item) => item.deptname && item.deptname.includes(this.queryParams.deptname));
+      if (this.dateRange && this.dateRange.length === 2) {
+        filtered = filtered.filter((item) => {
+          const d = (item.createTime || "").substring(0, 10);
+          return d >= this.dateRange[0] && d <= this.dateRange[1];
+        });
+      }
+      this.total = filtered.length;
+      const start = (this.queryParams.pageNum - 1) * this.queryParams.pageSize;
+      this.displayList = filtered.slice(start, start + this.queryParams.pageSize);
+      this.loading = false;
+    },
+    subTypeTag(type) { const map = { highRisk: "danger", nutrition: "warning", learning: "info" }; return map[type] || ""; },
+    handleQuery() { this.queryParams.pageNum = 1; this.getList(); },
+    resetQuery() { this.dateRange = []; this.queryParams = { pageNum: 1, pageSize: 10, patname: "", subType: "", deptname: "" }; this.getList(); },
+    handleSelectionChange(s) { this.ids = s.map(i => i.id); this.multiple = !s.length; },
+    handleDelete() {
+      if (this.ids.length === 0) { this.$modal.msgWarning("璇疯嚦灏戦�夋嫨涓�鏉�"); return; }
+      this.$modal.confirm("纭鍒犻櫎閫変腑妗f锛�").then(() => {
+        const all = JSON.parse(localStorage.getItem("patientArchives") || "[]");
+        const remaining = all.filter((item) => !this.ids.includes(item.id));
+        localStorage.setItem("patientArchives", JSON.stringify(remaining));
+        this.$modal.msgSuccess("鍒犻櫎鎴愬姛"); this.getList();
+      }).catch(() => {});
+    },
+    handleSingleDelete(row) { this.ids = [row.id]; this.handleDelete(); },
+    handleCreateStandalone() { this.createDialogVisible = true; },
+    goDetail(row) { this.$router.push({ path: "/filing/childDetail", query: { id: row.id } }); },
+  },
+};
+</script>
+
+<style lang="scss" scoped>
+.button-textsc { color: #3664d9; }
+</style>
diff --git a/src/views/patient/archives/components/ArchiveDialog.vue b/src/views/patient/archives/components/ArchiveDialog.vue
new file mode 100644
index 0000000..a5a4207
--- /dev/null
+++ b/src/views/patient/archives/components/ArchiveDialog.vue
@@ -0,0 +1,372 @@
+<template>
+  <el-dialog
+    :title="dialogTitle"
+    :visible.sync="dialogVisible"
+    width="750px"
+    :close-on-click-modal="false"
+    append-to-body
+    @close="handleClose"
+    top="3vh"
+  >
+    <!-- 宸查�夋偅鑰呴瑙堬紙鍏宠仈寤烘。妯″紡锛� -->
+    <div class="archive-section" v-if="selectedPatients.length > 0">
+      <div class="section-title">宸查�夋偅鑰咃紙{{ selectedPatients.length }}浜猴級</div>
+      <el-table :data="selectedPatients" border size="small" max-height="180">
+        <el-table-column prop="patname" label="濮撳悕" width="80" align="center" />
+        <el-table-column label="鎬у埆" width="60" align="center">
+          <template slot-scope="scope">{{ scope.row.sex == 1 ? "鐢�" : "濂�" }}</template>
+        </el-table-column>
+        <el-table-column prop="age" label="骞撮緞" width="60" align="center" />
+        <el-table-column prop="deptname" label="绉戝" align="center" />
+        <el-table-column prop="diagname" label="璇婃柇" align="center" show-overflow-tooltip />
+      </el-table>
+      <el-divider />
+    </div>
+
+    <!-- 鐙珛寤烘。锛氬綍鍏ユ偅鑰呬俊鎭� -->
+    <div class="archive-section" v-if="standalone">
+      <div class="section-title">鎮h�呭熀鏈俊鎭�</div>
+      <el-form :model="standalonePatient" label-width="100px" size="small" inline>
+        <el-form-item label="濮撳悕" required>
+          <el-input v-model="standalonePatient.patname" placeholder="璇疯緭鍏�" style="width:150px" />
+        </el-form-item>
+        <el-form-item label="鎬у埆" required>
+          <el-select v-model="standalonePatient.sex" style="width:80px">
+            <el-option :value="1" label="鐢�" />
+            <el-option :value="2" label="濂�" />
+          </el-select>
+        </el-form-item>
+        <el-form-item label="骞撮緞">
+          <el-input v-model="standalonePatient.age" placeholder="骞撮緞" style="width:80px" />
+        </el-form-item>
+        <el-form-item label="鑱旂郴鐢佃瘽">
+          <el-input v-model="standalonePatient.telcode" placeholder="鑱旂郴鐢佃瘽" style="width:150px" />
+        </el-form-item>
+        <el-form-item label="绉戝">
+          <el-input v-model="standalonePatient.deptname" placeholder="绉戝" style="width:150px" />
+        </el-form-item>
+        <el-form-item label="璇婃柇">
+          <el-input v-model="standalonePatient.diagname" placeholder="璇婃柇" style="width:200px" />
+        </el-form-item>
+      </el-form>
+      <el-divider />
+    </div>
+
+    <!-- 鍎夸繚绉戯細瀹堕暱淇℃伅锛堝繀濉級 -->
+    <div class="archive-section" v-if="mainCategory === 'child'">
+      <div class="section-title">瀹堕暱/鐩戞姢浜轰俊鎭�</div>
+      <el-form :model="parentInfo" label-width="100px" size="small" inline>
+        <el-form-item label="瀹堕暱濮撳悕" required>
+          <el-input v-model="parentInfo.parentName" placeholder="璇疯緭鍏�" style="width:150px" />
+        </el-form-item>
+        <el-form-item label="涓庡効绔ュ叧绯�">
+          <el-select v-model="parentInfo.relation" style="width:120px">
+            <el-option label="鐖朵翰" value="father" />
+            <el-option label="姣嶄翰" value="mother" />
+            <el-option label="绁栫埗" value="grandfather" />
+            <el-option label="绁栨瘝" value="grandmother" />
+            <el-option label="鍏朵粬" value="other" />
+          </el-select>
+        </el-form-item>
+        <el-form-item label="鑱旂郴鐢佃瘽" required>
+          <el-input v-model="parentInfo.parentPhone" placeholder="鑱旂郴鐢佃瘽" style="width:150px" />
+        </el-form-item>
+        <el-form-item label="韬唤璇佸彿">
+          <el-input v-model="parentInfo.parentIdCard" placeholder="韬唤璇佸彿" style="width:200px" />
+        </el-form-item>
+        <el-form-item label="鑱旂郴鍦板潃">
+          <el-input v-model="parentInfo.address" placeholder="鑱旂郴鍦板潃" style="width:300px" />
+        </el-form-item>
+      </el-form>
+      <el-divider />
+    </div>
+
+    <!-- 寤烘。涓诲垎绫� -->
+    <div class="archive-section">
+      <div class="section-title">閫夋嫨寤烘。绫诲瀷</div>
+      <el-radio-group v-model="mainCategory" size="medium" @change="onMainCategoryChange">
+        <el-radio-button label="child">鍎夸繚绉戝缓妗�</el-radio-button>
+        <el-radio-button label="maternal">濡囦繚绉戝缓妗�</el-radio-button>
+      </el-radio-group>
+    </div>
+
+    <!-- 瀛愮被鍨� -->
+    <div class="archive-section" v-if="mainCategory">
+      <div class="section-title">閫夋嫨涓撴绫诲瀷</div>
+      <el-radio-group v-model="subType" size="small" @change="onSubTypeChange">
+        <template v-if="mainCategory === 'child'">
+          <el-radio-button label="highRisk">楂樺嵄鍎夸笓妗堢鐞�</el-radio-button>
+          <el-radio-button label="nutrition">钀ュ吇鎬х柧鐥呬笓妗堢鐞�</el-radio-button>
+          <el-radio-button label="learning">瀛︿範鍥伴毦涓撴绠$悊</el-radio-button>
+        </template>
+        <template v-else>
+          <el-radio-button label="pregnancy">瀛曞闅忚</el-radio-button>
+          <el-radio-button label="menopause">鏇村勾鏈熼殢璁�</el-radio-button>
+        </template>
+      </el-radio-group>
+    </div>
+
+    <!-- 寤烘。涓撳睘瀛楁 -->
+    <div class="archive-section" v-if="subType">
+      <div class="section-title">寤烘。淇℃伅</div>
+      <el-form :model="archiveForm" label-width="120px" size="small">
+        <!-- 鍎夸繚绉� - 楂樺嵄鍎� -->
+        <template v-if="mainCategory === 'child' && subType === 'highRisk'">
+          <el-form-item label="楂樺嵄鍥犵礌">
+            <el-select v-model="archiveForm.riskFactor" multiple placeholder="鍙閫�" style="width:100%">
+              <el-option label="鏃╀骇/浣庝綋閲�" value="preterm" />
+              <el-option label="绐掓伅鍙�" value="asphyxia" />
+              <el-option label="棰呭唴鍑鸿" value="ich" />
+              <el-option label="楂樿儐绾㈢礌琛�鐥�" value="hyperbilirubinemia" />
+              <el-option label="瀹唴鎰熸煋" value="intrauterine" />
+              <el-option label="鍏堝ぉ鐣稿舰" value="malformation" />
+              <el-option label="鍏朵粬" value="other" />
+            </el-select>
+          </el-form-item>
+          <el-form-item label="鍑虹敓浣撻噸(g)">
+            <el-input-number v-model="archiveForm.birthWeight" :min="500" :max="6000" />
+          </el-form-item>
+          <el-form-item label="鍑虹敓瀛曞懆">
+            <el-input-number v-model="archiveForm.gestationalWeek" :min="22" :max="42" :precision="1" /> 鍛�
+          </el-form-item>
+          <el-form-item label="寤烘。鍖荤敓">
+            <el-input v-model="archiveForm.doctorName" placeholder="璇疯緭鍏ュ缓妗e尰鐢�" />
+          </el-form-item>
+          <el-form-item label="澶囨敞">
+            <el-input v-model="archiveForm.remark" type="textarea" :rows="2" />
+          </el-form-item>
+        </template>
+
+        <!-- 鍎夸繚绉� - 钀ュ吇鎬х柧鐥� -->
+        <template v-if="mainCategory === 'child' && subType === 'nutrition'">
+          <el-form-item label="钀ュ吇璇婃柇" required>
+            <el-select v-model="archiveForm.nutritionDiagnosis" placeholder="璇烽�夋嫨" style="width:100%">
+              <el-option label="钀ュ吇涓嶈壇" value="malnutrition" />
+              <el-option label="瓒呴噸" value="overweight" />
+              <el-option label="鑲ヨ儢" value="obesity" />
+              <el-option label="寰噺鍏冪礌缂轰箯" value="micronutrient" />
+              <el-option label="鍠傚吇鍥伴毦" value="feeding" />
+            </el-select>
+          </el-form-item>
+          <el-form-item label="寤烘。鍖荤敓">
+            <el-input v-model="archiveForm.doctorName" placeholder="璇疯緭鍏ュ缓妗e尰鐢�" />
+          </el-form-item>
+          <el-form-item label="澶囨敞">
+            <el-input v-model="archiveForm.remark" type="textarea" :rows="2" />
+          </el-form-item>
+        </template>
+
+        <!-- 鍎夸繚绉� - 瀛︿範鍥伴毦 -->
+        <template v-if="mainCategory === 'child' && subType === 'learning'">
+          <el-form-item label="瀛︿範闂" required>
+            <el-select v-model="archiveForm.learningIssue" placeholder="璇烽�夋嫨" style="width:100%">
+              <el-option label="闃呰闅滅" value="dyslexia" />
+              <el-option label="涔﹀啓闅滅" value="dysgraphia" />
+              <el-option label="璁$畻闅滅" value="dyscalculia" />
+              <el-option label="娉ㄦ剰鍔涚己闄�" value="adhd" />
+              <el-option label="娣峰悎鍨�" value="mixed" />
+            </el-select>
+          </el-form-item>
+          <el-form-item label="寤烘。鍖荤敓">
+            <el-input v-model="archiveForm.doctorName" placeholder="璇疯緭鍏ュ缓妗e尰鐢�" />
+          </el-form-item>
+          <el-form-item label="澶囨敞">
+            <el-input v-model="archiveForm.remark" type="textarea" :rows="2" />
+          </el-form-item>
+        </template>
+
+        <!-- 濡囦繚绉� - 瀛曞闅忚 -->
+        <template v-if="mainCategory === 'maternal' && subType === 'pregnancy'">
+          <el-form-item label="鏈鏈堢粡">
+            <el-date-picker v-model="archiveForm.lmp" type="date" value-format="yyyy-MM-dd" placeholder="閫夋嫨鏃ユ湡" style="width:100%" />
+          </el-form-item>
+          <el-row :gutter="12">
+            <el-col :span="8"><el-form-item label="瀛曞懆"><el-input-number v-model="archiveForm.gestationalWeek" :min="1" :max="42" :precision="1" /> 鍛�</el-form-item></el-col>
+            <el-col :span="8"><el-form-item label="瀛曟"><el-input-number v-model="archiveForm.gravidity" :min="1" :max="20" /></el-form-item></el-col>
+            <el-col :span="8"><el-form-item label="浜ф"><el-input-number v-model="archiveForm.parity" :min="0" :max="20" /></el-form-item></el-col>
+          </el-row>
+          <el-form-item label="棰勪骇鏈�">
+            <el-date-picker v-model="archiveForm.edd" type="date" value-format="yyyy-MM-dd" placeholder="閫夋嫨棰勪骇鏈�" style="width:100%" />
+          </el-form-item>
+          <el-form-item label="楂樺嵄濡婂">
+            <el-switch v-model="archiveForm.highRiskPregnancy" active-text="鏄�" inactive-text="鍚�" />
+          </el-form-item>
+          <el-form-item label="寤烘。鍖荤敓">
+            <el-input v-model="archiveForm.doctorName" placeholder="璇疯緭鍏ュ缓妗e尰鐢�" />
+          </el-form-item>
+          <el-form-item label="澶囨敞">
+            <el-input v-model="archiveForm.remark" type="textarea" :rows="2" />
+          </el-form-item>
+        </template>
+
+        <!-- 濡囦繚绉� - 鏇村勾鏈熼殢璁� -->
+        <template v-if="mainCategory === 'maternal' && subType === 'menopause'">
+          <el-form-item label="鏈堢粡鐘舵��">
+            <el-select v-model="archiveForm.menstrualStatus" placeholder="璇烽�夋嫨" style="width:100%">
+              <el-option label="鏈堢粡绱婁贡" value="irregular" />
+              <el-option label="闂粡锛�<12涓湀锛�" value="amenorrhea_short" />
+              <el-option label="缁濈粡锛堚墺12涓湀锛�" value="menopause" />
+              <el-option label="浜哄伐缁濈粡" value="surgical" />
+            </el-select>
+          </el-form-item>
+          <el-form-item label="鏈鏈堢粡">
+            <el-date-picker v-model="archiveForm.lmp" type="date" value-format="yyyy-MM-dd" placeholder="閫夋嫨鏃ユ湡" style="width:100%" />
+          </el-form-item>
+          <el-form-item label="寤烘。鍖荤敓">
+            <el-input v-model="archiveForm.doctorName" placeholder="璇疯緭鍏ュ缓妗e尰鐢�" />
+          </el-form-item>
+          <el-form-item label="澶囨敞">
+            <el-input v-model="archiveForm.remark" type="textarea" :rows="2" />
+          </el-form-item>
+        </template>
+      </el-form>
+    </div>
+
+    <div slot="footer" class="dialog-footer">
+      <el-button @click="dialogVisible = false">鍙� 娑�</el-button>
+      <el-button type="primary" :loading="submitting" @click="handleSubmit" :disabled="!canSubmit">
+        纭寤烘。
+      </el-button>
+    </div>
+  </el-dialog>
+</template>
+
+<script>
+export default {
+  name: "ArchiveDialog",
+  props: {
+    visible: { type: Boolean, default: false },
+    patients: { type: Array, default: () => [] },
+    sourcePage: { type: String, default: "outpatient" },
+    standalone: { type: Boolean, default: false },
+  },
+  data() {
+    return {
+      dialogVisible: false,
+      mainCategory: "",
+      subType: "",
+      submitting: false,
+      standalonePatient: { patname: "", sex: 2, age: "", telcode: "", deptname: "", diagname: "" },
+      parentInfo: { parentName: "", relation: "", parentPhone: "", parentIdCard: "", address: "" },
+      archiveForm: {
+        riskFactor: [], birthWeight: null, gestationalWeek: null,
+        nutritionDiagnosis: "", learningIssue: "",
+        gravidity: 1, parity: 0, edd: "", lmp: "",
+        highRiskPregnancy: false, menstrualStatus: "",
+        doctorName: "", remark: "",
+      },
+    };
+  },
+  computed: {
+    dialogTitle() {
+      return this.standalone ? "鏂板缓寤烘。" : "鎮h�呭缓妗�";
+    },
+    canSubmit() {
+      if (!this.subType) return false;
+      if (this.mainCategory === 'child' && !this.parentInfo.parentName) return false;
+      if (this.standalone && !this.standalonePatient.patname) return false;
+      return true;
+    },
+    selectedPatients() {
+      return this.patients || [];
+    },
+  },
+  watch: {
+    visible(val) {
+      this.dialogVisible = val;
+      if (val) this.resetForm();
+    },
+    dialogVisible(val) {
+      if (!val) this.$emit("update:visible", false);
+    },
+  },
+  methods: {
+    resetForm() {
+      this.mainCategory = "";
+      this.subType = "";
+      this.standalonePatient = { patname: "", sex: 2, age: "", telcode: "", deptname: "", diagname: "" };
+      this.parentInfo = { parentName: "", relation: "", parentPhone: "", parentIdCard: "", address: "" };
+      this.archiveForm = {
+        riskFactor: [], birthWeight: null, gestationalWeek: null,
+        nutritionDiagnosis: "", learningIssue: "",
+        gravidity: 1, parity: 0, edd: "", lmp: "",
+        highRiskPregnancy: false, menstrualStatus: "",
+        doctorName: "", remark: "",
+      };
+    },
+    onMainCategoryChange() { this.subType = ""; },
+    onSubTypeChange() {},
+
+    getSubTypeLabel() {
+      const map = { highRisk: "楂樺嵄鍎夸笓妗堢鐞�", nutrition: "钀ュ吇鎬х柧鐥呬笓妗堢鐞�", learning: "瀛︿範鍥伴毦涓撴绠$悊", pregnancy: "瀛曞闅忚", menopause: "鏇村勾鏈熼殢璁�" };
+      return map[this.subType] || "";
+    },
+    getMainCategoryLabel() {
+      return this.mainCategory === "child" ? "鍎夸繚绉戝缓妗�" : "濡囦繚绉戝缓妗�";
+    },
+
+    handleSubmit() {
+      if (!this.subType) { this.$message.warning("璇烽�夋嫨涓撴绫诲瀷"); return; }
+      if (!this.standalone && this.selectedPatients.length === 0) { this.$message.warning("璇烽�夋嫨鎮h��"); return; }
+      this.submitting = true;
+
+      const archives = JSON.parse(localStorage.getItem("patientArchives") || "[]");
+      const now = new Date().toISOString().replace("T", " ").substring(0, 19);
+
+      // 纭畾鎮h�呭垪琛�
+      const patientList = this.standalone
+        ? [{ ...this.standalonePatient, patid: "sa_" + Date.now() }]
+        : this.selectedPatients;
+
+      patientList.forEach((patient) => {
+        archives.push({
+          id: "arc_" + Date.now() + "_" + Math.random().toString(36).substr(2, 6),
+          patientId: patient.patid || patient.id,
+          patname: patient.patname,
+          sex: patient.sex,
+          age: patient.age,
+          telcode: patient.telcode || patient.phone || "",
+          deptname: patient.deptname || "",
+          diagname: patient.diagname || "",
+          inhospno: patient.inhospno || "",
+          outhospno: patient.outhospno || "",
+          bedNo: patient.bedNo || "",
+          drname: patient.drname || "",
+          nurseName: patient.nurseName || "",
+          starttime: patient.starttime || patient.admitdate || "",
+          mainCategory: this.mainCategory,
+          mainCategoryLabel: this.getMainCategoryLabel(),
+          subType: this.subType,
+          subTypeLabel: this.getSubTypeLabel(),
+          archiveForm: JSON.parse(JSON.stringify(this.archiveForm)),
+          parentInfo: this.mainCategory === 'child' ? JSON.parse(JSON.stringify(this.parentInfo)) : {},
+          sourcePage: this.standalone ? "standalone" : this.sourcePage,
+          status: "active",
+          createTime: now,
+          updateTime: now,
+        });
+      });
+
+      localStorage.setItem("patientArchives", JSON.stringify(archives));
+
+      this.submitting = false;
+      this.dialogVisible = false;
+      this.$message.success(`鎴愬姛鍒涘缓 ${patientList.length} 鏉″缓妗h褰昤);
+      this.$emit("created");
+
+      // 璺宠浆
+      const routePath = this.mainCategory === "child"
+        ? "/filing/childHealth"
+        : "/filing/maternalHealth";
+      this.$router.push({ path: routePath });
+    },
+    handleClose() { this.resetForm(); },
+  },
+};
+</script>
+
+<style lang="scss" scoped>
+.archive-section { margin-bottom: 18px; }
+.section-title { font-size: 15px; font-weight: 600; color: #303133; margin-bottom: 12px; padding-left: 10px; border-left: 3px solid #409eff; }
+.dialog-footer { text-align: right; }
+</style>
diff --git a/src/views/patient/archives/components/EditableTable.vue b/src/views/patient/archives/components/EditableTable.vue
new file mode 100644
index 0000000..3591c6e
--- /dev/null
+++ b/src/views/patient/archives/components/EditableTable.vue
@@ -0,0 +1,109 @@
+<template>
+  <div>
+    <div v-if="editing" style="margin-bottom:10px">
+      <el-button size="small" type="primary" icon="el-icon-plus" @click="addRow">鏂板涓�琛�</el-button>
+      <el-button size="small" type="danger" icon="el-icon-delete" :disabled="!selectedRows.length" @click="deleteRows">鍒犻櫎閫変腑</el-button>
+    </div>
+    <el-table :data="localData" border @selection-change="onSelect" ref="table">
+      <el-table-column v-if="editing" type="selection" width="45" align="center" />
+      <el-table-column
+        v-for="col in columns" :key="col.prop"
+        :prop="col.prop"
+        :label="col.label"
+        :width="col.width"
+        :min-width="col.minWidth"
+        align="center"
+      >
+        <template slot-scope="scope">
+          <!-- 缂栬緫妯″紡 -->
+          <template v-if="editing">
+            <!-- date -->
+            <el-date-picker
+              v-if="col.type === 'date'"
+              v-model="scope.row[col.prop]"
+              value-format="yyyy-MM-dd"
+              size="small"
+              style="width:100%"
+            />
+            <!-- number -->
+            <el-input-number
+              v-else-if="col.type === 'number'"
+              v-model="scope.row[col.prop]"
+              size="small"
+              :controls="false"
+              style="width:100%"
+            />
+            <!-- select -->
+            <el-select
+              v-else-if="col.type === 'select'"
+              v-model="scope.row[col.prop]"
+              size="small"
+              style="width:100%"
+            >
+              <el-option v-for="o in col.options" :key="o" :label="o" :value="o" />
+            </el-select>
+            <!-- text -->
+            <el-input v-else v-model="scope.row[col.prop]" size="small" />
+          </template>
+          <!-- 鏌ョ湅妯″紡锛歵ag for select fields -->
+          <template v-else>
+            <el-tag v-if="col.type === 'select' && scope.row[col.prop]"
+              :type="tagType(scope.row[col.prop])" size="small"
+            >{{ scope.row[col.prop] }}</el-tag>
+            <span v-else>{{ scope.row[col.prop] }}</span>
+          </template>
+        </template>
+      </el-table-column>
+    </el-table>
+  </div>
+</template>
+
+<script>
+export default {
+  name: "EditableTable",
+  props: {
+    data: { type: Array, default: () => [] },
+    editing: { type: Boolean, default: false },
+    columns: { type: Array, default: () => [] },
+    tableKey: { type: String, default: "" },
+  },
+  data() {
+    return {
+      localData: [],
+      selectedRows: [],
+    };
+  },
+  watch: {
+    data: { immediate: true, handler(v) { this.localData = v || []; } },
+    localData: { deep: true, handler(v) { this.$emit("update:data", v); } },
+  },
+  methods: {
+    addRow() {
+      const row = {};
+      this.columns.forEach(col => {
+        if (col.type === 'number') row[col.prop] = null;
+        else if (col.type === 'date') row[col.prop] = '';
+        else row[col.prop] = '';
+      });
+      this.localData.push(row);
+    },
+    deleteRows() {
+      // remove by reference
+      this.localData = this.localData.filter(row => !this.selectedRows.includes(row));
+      this.selectedRows = [];
+      this.$emit("update:data", this.localData);
+    },
+    onSelect(rows) { this.selectedRows = rows; },
+    tagType(v) {
+      if (!v) return '';
+      const good = ['姝e父','鑹ソ','鎺屾彙','鍙戦�佹垚鍔�','宸插畬鎴�'];
+      const warn = ['鍋忕槮','鍋忚儢','瓒呴噸','杞诲害','涓笅','娉ㄦ剰缂洪櫡鍙枒','涓�鑸�','杞诲害寮傚父'];
+      const bad = ['鍙戣偛杩熺紦','宸�','寮傚父','涓害寮傚父','澶辫触','钀ュ吇涓嶈壇'];
+      if (good.includes(v)) return 'success';
+      if (warn.includes(v)) return 'warning';
+      if (bad.includes(v)) return 'danger';
+      return '';
+    },
+  },
+};
+</script>
diff --git a/src/views/patient/archives/maternalHealth/KuppermanScoreTable.vue b/src/views/patient/archives/maternalHealth/KuppermanScoreTable.vue
new file mode 100644
index 0000000..af18f04
--- /dev/null
+++ b/src/views/patient/archives/maternalHealth/KuppermanScoreTable.vue
@@ -0,0 +1,50 @@
+<template>
+  <div>
+    <el-table :data="items" border size="small">
+      <el-table-column prop="symptom" label="鐥囩姸" width="160" />
+      <el-table-column label="绋嬪害" align="center" width="120">
+        <template slot-scope="scope">
+          <el-select v-if="editing" v-model="scope.row.degree" size="small">
+            <el-option v-for="o in degrees" :key="o.v" :label="o.l" :value="o.v" />
+          </el-select>
+          <span v-else>{{ degLabel(scope.row.degree) }}</span>
+        </template>
+      </el-table-column>
+      <el-table-column prop="score" label="璇勫垎" align="center" width="100" />
+    </el-table>
+    <div style="margin-top:10px;font-size:14px">鎬诲垎锛歿{ totalScore }} &nbsp;&nbsp; 绋嬪害锛歿{ severity }}</div>
+  </div>
+</template>
+<script>
+export default {
+  name:"KuppermanScoreTable",
+  props:{ value:{ type:Object, default:()=>({}) }, editing:Boolean },
+  data(){ return { degrees:[{v:0,l:"鏃�"},{v:1,l:"杞�"},{v:2,l:"涓�"},{v:3,l:"閲�"}] }; },
+  computed:{
+    items(){
+      const list = [
+        { symptom:"娼儹鍑烘睏",factor:4 },{ symptom:"鎰熻寮傚父",factor:2 },{ symptom:"澶辩湢",factor:2 },
+        { symptom:"鎯呯华娉㈠姩",factor:2 },{ symptom:"鎶戦儊",factor:1 },{ symptom:"鐪╂檿",factor:1 },
+        { symptom:"鐤蹭箯",factor:1 },{ symptom:"鍏宠妭鐥�",factor:1 },{ symptom:"澶寸棝",factor:1 },
+        { symptom:"蹇冩偢",factor:1 },{ symptom:"鐨偆铓佽蛋鎰�",factor:1 },{ symptom:"鎬х敓娲�",factor:2 },{ symptom:"娉屽翱绯绘劅鏌�",factor:2 },
+      ];
+      return list.map(item => {
+        const v = this.value[item.symptom]||0;
+        return { ...item, degree:v, score:item.factor * v };
+      });
+    },
+    totalScore(){ return this.items.reduce((s,i)=>s+i.score,0); },
+    severity(){ const t=this.totalScore; return t<=6?"姝e父":t<=15?"杞诲害":t<=30?"涓害":"閲嶅害"; },
+  },
+  watch:{
+    items:{ deep:true, handler(v){
+      const obj = { ...this.value, kuppermanTotal:this.totalScore, kuppermanSeverity:this.severity };
+      v.forEach(i=>{ obj[i.symptom]=i.degree; });
+      this.$emit('input',obj);
+    }},
+  },
+  methods:{
+    degLabel(v){ const r=this.degrees.find(d=>d.v===v); return r?r.l:"-"; },
+  },
+};
+</script>
diff --git a/src/views/patient/archives/maternalHealth/MRSScoreTable.vue b/src/views/patient/archives/maternalHealth/MRSScoreTable.vue
new file mode 100644
index 0000000..39b2d05
--- /dev/null
+++ b/src/views/patient/archives/maternalHealth/MRSScoreTable.vue
@@ -0,0 +1,37 @@
+<template>
+  <div>
+    <el-table :data="items" border size="small">
+      <el-table-column prop="item" label="鏉$洰" width="220" />
+      <el-table-column label="璇勫垎" align="center" width="120">
+        <template slot-scope="scope">
+          <el-select v-if="editing" v-model="scope.row.score" size="small">
+            <el-option v-for="s in scoreOptions" :key="s" :label="s" :value="s" />
+          </el-select>
+          <span v-else>{{ scope.row.score }}</span>
+        </template>
+      </el-table-column>
+    </el-table>
+    <div style="margin-top:10px;font-size:14px">MRS鎬诲垎锛歿{ totalScore }}</div>
+  </div>
+</template>
+<script>
+export default {
+  name:"MRSScoreTable",
+  props:{ value:{ type:Object, default:()=>({}) }, editing:Boolean },
+  data(){ return { scoreOptions:[0,0.1,0.2,0.3,0.4,0.5,0.6,0.7,0.8,0.9,1] }; },
+  computed:{
+    items(){
+      const names=["娼儹鍑烘睏","蹇冭剰涓嶉��","鐫$湢闅滅","鎯呯华鎶戦儊","鏄撴縺鎯�","鐒﹁檻","浣撳姏/绮惧姏涓嬮檷","鎬у姛鑳�","娉屽翱绯荤棁鐘�","闃撮亾骞叉订","鍏宠妭鑲岃倝涓嶉��"];
+      return names.map((n,i)=>({ item:n, key:'mrs_'+i, score:this.value['mrs_'+i]||0 }));
+    },
+    totalScore(){ return this.items.reduce((s,i)=>s+i.score,0).toFixed(1); },
+  },
+  watch:{
+    items:{ deep:true, handler(v){
+      const obj={...this.value, mrsTotal:this.totalScore};
+      v.forEach(i=>{ obj[i.key]=i.score; });
+      this.$emit('input',obj);
+    }},
+  },
+};
+</script>
diff --git a/src/views/patient/archives/maternalHealth/PSQIScoreTable.vue b/src/views/patient/archives/maternalHealth/PSQIScoreTable.vue
new file mode 100644
index 0000000..f9f8a83
--- /dev/null
+++ b/src/views/patient/archives/maternalHealth/PSQIScoreTable.vue
@@ -0,0 +1,37 @@
+<template>
+  <div>
+    <el-table :data="items" border size="small">
+      <el-table-column prop="item" label="鏉$洰" width="280" />
+      <el-table-column label="璇勫垎" align="center" width="120">
+        <template slot-scope="scope">
+          <el-select v-if="editing" v-model="scope.row.score" size="small">
+            <el-option v-for="s in [0,1,2,3]" :key="s" :label="s" :value="s" />
+          </el-select>
+          <span v-else>{{ scope.row.score }}</span>
+        </template>
+      </el-table-column>
+    </el-table>
+    <div style="margin-top:10px;font-size:14px">PSQI鎬诲垎锛歿{ totalScore }} &nbsp;&nbsp; 璇勪环锛歿{ evaluation }}</div>
+  </div>
+</template>
+<script>
+export default {
+  name:"PSQIScoreTable",
+  props:{ value:{ type:Object, default:()=>({}) }, editing:Boolean },
+  computed:{
+    items(){
+      const names=["涓昏鐫$湢璐ㄩ噺","鍏ョ潯鏃堕棿(鍒嗛挓)","鐫$湢鏃堕暱(灏忔椂)","鐫$湢鏁堢巼(%)","鐫$湢闅滅","鍌湢鑽墿浣跨敤","鏃ラ棿鍔熻兘闅滅"];
+      return names.map((n,i)=>({ item:n, key:'psqi_'+i, score:this.value['psqi_'+i]||0 }));
+    },
+    totalScore(){ return this.items.reduce((s,i)=>s+i.score,0); },
+    evaluation(){ const t=this.totalScore; return t<=5?"鐫$湢璐ㄩ噺鑹ソ":t<=10?"鐫$湢璐ㄩ噺涓�鑸�":t<=15?"鐫$湢璐ㄩ噺杈冨樊":"鐫$湢璐ㄩ噺寰堝樊"; },
+  },
+  watch:{
+    items:{ deep:true, handler(v){
+      const obj={...this.value, psqiTotal:this.totalScore, psqiEvaluation:this.evaluation};
+      v.forEach(i=>{ obj[i.key]=i.score; });
+      this.$emit('input',obj);
+    }},
+  },
+};
+</script>
diff --git a/src/views/patient/archives/maternalHealth/detail.vue b/src/views/patient/archives/maternalHealth/detail.vue
new file mode 100644
index 0000000..6d723e9
--- /dev/null
+++ b/src/views/patient/archives/maternalHealth/detail.vue
@@ -0,0 +1,329 @@
+<template>
+  <div class="app-container" v-loading="loading">
+    <template v-if="archive">
+      <div class="action-bar">
+        <el-button @click="$router.go(-1)" icon="el-icon-back">杩斿洖</el-button>
+        <el-button :type="editing ? 'success' : 'primary'" :icon="editing ? 'el-icon-check' : 'el-icon-edit'" @click="toggleEdit">{{ editing ? '淇濆瓨' : '缂栬緫' }}</el-button>
+        <el-tag :type="archive.subType === 'pregnancy' ? 'success' : 'warning'" style="margin-left:12px">{{ archive.subTypeLabel }}</el-tag>
+      </div>
+
+      <!-- 鎮h�呭熀鏈俊鎭� -->
+      <el-card class="info-card" shadow="never">
+        <div slot="header" class="card-header"><span>鎮h�呭熀鏈俊鎭�</span></div>
+        <el-row :gutter="20">
+          <el-col :span="6"><InfoField label="濮撳悕" :value="archive.patname" /></el-col>
+          <el-col :span="6"><InfoField label="鎬у埆" :value="archive.sex == 1 ? '鐢�' : '濂�'" /></el-col>
+          <el-col :span="6"><InfoField label="骞撮緞" :value="archive.age" /></el-col>
+          <el-col :span="6"><InfoField label="鐢佃瘽" :value="archive.telcode" /></el-col>
+        </el-row>
+        <el-row :gutter="20" style="margin-top:10px">
+          <el-col :span="6"><InfoField label="绉戝" :value="archive.deptname" /></el-col>
+          <el-col :span="6"><InfoField label="璇婃柇" :value="archive.diagname" /></el-col>
+          <el-col :span="6"><InfoField label="涓绘不鍖荤敓" :value="archive.drname" /></el-col>
+          <el-col :span="6"><InfoField label="鏉ユ簮" :value="sourceLabel" /></el-col>
+        </el-row>
+      </el-card>
+
+      <!-- 妗f鍩烘湰淇℃伅 -->
+      <el-card class="info-card" shadow="never" style="margin-top:14px">
+        <div slot="header" class="card-header">
+          <span>妗f鍩烘湰淇℃伅</span>
+          <span class="header-sub">{{ archive.createTime ? archive.createTime.substring(0,10) : '-' }} 寤烘。</span>
+        </div>
+        <el-row :gutter="20">
+          <el-col :span="8"><InfoField label="寤烘。绫诲瀷" :value="archive.subTypeLabel" /></el-col>
+          <el-col :span="8"><InfoField label="寤烘。鍖荤敓" :value="archive.archiveForm.doctorName" :editing="editing" v-model="archive.archiveForm.doctorName" /></el-col>
+          <el-col :span="8"><InfoField label="寤烘。鏃堕棿" :value="archive.createTime" /></el-col>
+        </el-row>
+        <!-- 瀛曞涓撳睘 -->
+        <el-row v-if="archive.subType === 'pregnancy'" :gutter="20" style="margin-top:10px">
+          <el-col :span="6"><InfoField label="瀛曞懆" :value="archive.archiveForm.gestationalWeek" :editing="editing" v-model="archive.archiveForm.gestationalWeek" type="number" /></el-col>
+          <el-col :span="6"><InfoField label="瀛曟/浜ф" :value="'G'+(archive.archiveForm.gravidity||1)+'P'+(archive.archiveForm.parity||0)" /></el-col>
+          <el-col :span="6"><InfoField label="棰勪骇鏈�" :value="archive.archiveForm.edd" /></el-col>
+          <el-col :span="6"><InfoField label="楂樺嵄濡婂" :value="archive.archiveForm.highRiskPregnancy ? '鏄�' : '鍚�'" /></el-col>
+        </el-row>
+        <el-row v-if="archive.subType === 'menopause'" :gutter="20" style="margin-top:10px">
+          <el-col :span="8"><InfoField label="鏈堢粡鐘舵��" :value="menstrualLabel" /></el-col>
+          <el-col :span="8"><InfoField label="鏈鏈堢粡" :value="archive.archiveForm.lmp" /></el-col>
+        </el-row>
+      </el-card>
+
+      <!-- ===== 瀛曞闅忚锛�3涓〃鍗� ===== -->
+      <template v-if="archive.subType === 'pregnancy'">
+        <el-card class="info-card" shadow="never" style="margin-top:14px">
+          <div slot="header" class="card-header"><span>瀛曞闅忚绠$悊</span></div>
+          <el-tabs v-model="activeTab" type="border-card">
+            <!-- 1. 瀛曞闅忚绯荤粺闂 -->
+            <el-tab-pane label="瀛曞闅忚绯荤粺闂" name="sysQ">
+              <el-form :model="form.pregSysQ" label-width="150px" size="small" :disabled="!editing">
+                <el-row :gutter="20">
+                  <el-col :span="8"><el-form-item label="濉啓鏃ユ湡"><el-date-picker v-model="form.pregSysQ.date" value-format="yyyy-MM-dd" style="width:100%" /></el-form-item></el-col>
+                  <el-col :span="8"><el-form-item label="瀛曞懆"><el-input-number v-model="form.pregSysQ.gestWeek" :min="1" :max="42" /></el-form-item></el-col>
+                </el-row>
+                <el-row :gutter="20">
+                  <el-col :span="8"><el-form-item label="浣撻噸(kg)"><el-input-number v-model="form.pregSysQ.weight" :precision="1" /></el-form-item></el-col>
+                  <el-col :span="8"><el-form-item label="琛�鍘�"><el-input v-model="form.pregSysQ.bloodPressure" placeholder="鏀剁缉鍘�/鑸掑紶鍘�" /></el-form-item></el-col>
+                  <el-col :span="8"><el-form-item label="瀹珮(cm)"><el-input-number v-model="form.pregSysQ.fundalHeight" /></el-form-item></el-col>
+                </el-row>
+                <el-row :gutter="20">
+                  <el-col :span="8"><el-form-item label="鑳庡績(娆�/鍒�)"><el-input-number v-model="form.pregSysQ.fetalHeart" /></el-form-item></el-col>
+                  <el-col :span="8"><el-form-item label="姘磋偪"><el-select v-model="form.pregSysQ.edema" style="width:100%"><el-option label="鏃�" value="鏃�" /><el-option label="+" value="+" /><el-option label="++" value="++" /><el-option label="+++" value="+++" /></el-select></el-form-item></el-col>
+                  <el-col :span="8"><el-form-item label="灏胯泲鐧�"><el-select v-model="form.pregSysQ.urineProtein" style="width:100%"><el-option label="-" value="-" /><el-option label="卤" value="卤" /><el-option label="+" value="+" /><el-option label="++" value="++" /></el-select></el-form-item></el-col>
+                </el-row>
+                <el-form-item label="鑷鐥囩姸"><el-input v-model="form.pregSysQ.symptoms" type="textarea" :rows="2" placeholder="澶存檿/鐪艰姳/鑳搁椃/鑵圭棝绛�" /></el-form-item>
+                <el-form-item label="澶勭悊鎰忚"><el-input v-model="form.pregSysQ.advice" type="textarea" :rows="2" /></el-form-item>
+                <el-form-item label="涓嬫闅忚鏃ユ湡"><el-date-picker v-model="form.pregSysQ.nextVisit" value-format="yyyy-MM-dd" style="width:200px" /></el-form-item>
+                <el-form-item label="闅忚鍖荤敓"><el-input v-model="form.pregSysQ.doctor" style="width:200px" /></el-form-item>
+              </el-form>
+            </el-tab-pane>
+
+            <!-- 2. 瀛曞棣栬瘖淇℃伅鐧昏琛� -->
+            <el-tab-pane label="涓芥按濡囧辜淇濆仴闄㈠瓡濡囬璇婁俊鎭櫥璁拌〃" name="firstVisit">
+              <el-form :model="form.pregFirst" label-width="160px" size="small" :disabled="!editing">
+                <el-divider content-position="left">鍩烘湰淇℃伅</el-divider>
+                <el-row :gutter="20">
+                  <el-col :span="8"><el-form-item label="寤烘。鏃ユ湡"><el-date-picker v-model="form.pregFirst.regDate" value-format="yyyy-MM-dd" style="width:100%" /></el-form-item></el-col>
+                  <el-col :span="8"><el-form-item label="涓堝か濮撳悕"><el-input v-model="form.pregFirst.husbandName" /></el-form-item></el-col>
+                  <el-col :span="8"><el-form-item label="涓堝か鐢佃瘽"><el-input v-model="form.pregFirst.husbandPhone" /></el-form-item></el-col>
+                </el-row>
+                <el-row :gutter="20">
+                  <el-col :span="8"><el-form-item label="鏈鏈堢粡"><el-date-picker v-model="form.pregFirst.lmp" value-format="yyyy-MM-dd" style="width:100%" /></el-form-item></el-col>
+                  <el-col :span="8"><el-form-item label="棰勪骇鏈�"><el-date-picker v-model="form.pregFirst.edd" value-format="yyyy-MM-dd" style="width:100%" /></el-form-item></el-col>
+                  <el-col :span="8"><el-form-item label="瀛曟/浜ф"><el-input v-model="form.pregFirst.gp" placeholder="G_P_" /></el-form-item></el-col>
+                </el-row>
+                <el-divider content-position="left">鏃㈠線鍙�</el-divider>
+                <el-row :gutter="20">
+                  <el-col :span="8"><el-form-item label="鍓栧浜у彶"><el-select v-model="form.pregFirst.csHistory" style="width:100%"><el-option label="鏃�" :value="0" /><el-option label="鏈�" :value="1" /></el-select></el-form-item></el-col>
+                  <el-col :span="8"><el-form-item label="娴佷骇鍙�"><el-select v-model="form.pregFirst.abortionHistory" style="width:100%"><el-option label="鏃�" :value="0" /><el-option label="鏈�" :value="1" /></el-select></el-form-item></el-col>
+                  <el-col :span="8"><el-form-item label="鐤剧梾鍙�"><el-input v-model="form.pregFirst.diseaseHistory" placeholder="楂樿鍘�/绯栧翱鐥�/鐢茬姸鑵虹瓑" /></el-form-item></el-col>
+                </el-row>
+                <el-divider content-position="left">鏈濡婂鎯呭喌</el-divider>
+                <el-row :gutter="20">
+                  <el-col :span="8"><el-form-item label="韬珮(cm)"><el-input-number v-model="form.pregFirst.height" :precision="1" /></el-form-item></el-col>
+                  <el-col :span="8"><el-form-item label="瀛曞墠浣撻噸(kg)"><el-input-number v-model="form.pregFirst.preWeight" :precision="1" /></el-form-item></el-col>
+                </el-row>
+                <el-form-item label="楂樺嵄鍥犵礌璇勪及"><el-input v-model="form.pregFirst.riskAssessment" type="textarea" :rows="2" /></el-form-item>
+                <el-form-item label="寤哄唽鍖荤敓"><el-input v-model="form.pregFirst.doctor" style="width:200px" /></el-form-item>
+              </el-form>
+            </el-tab-pane>
+
+            <!-- 3. 鏃╁瓡闅忚鐧昏琛� -->
+            <el-tab-pane label="涓芥按濡囧辜淇濆仴闄㈡棭瀛曢殢璁跨櫥璁拌〃" name="earlyFollow">
+              <el-form :model="form.pregEarly" label-width="150px" size="small" :disabled="!editing">
+                <el-row :gutter="20">
+                  <el-col :span="8"><el-form-item label="闅忚鏃ユ湡"><el-date-picker v-model="form.pregEarly.date" value-format="yyyy-MM-dd" style="width:100%" /></el-form-item></el-col>
+                  <el-col :span="8"><el-form-item label="瀛曞懆"><el-input-number v-model="form.pregEarly.gestWeek" :min="1" :max="14" /></el-form-item></el-col>
+                </el-row>
+                <el-row :gutter="20">
+                  <el-col :span="8"><el-form-item label="鏃╁瓡鍙嶅簲"><el-select v-model="form.pregEarly.morningSickness" style="width:100%"><el-option label="鏃�" value="鏃�" /><el-option label="杞诲害" value="杞诲害" /><el-option label="涓害" value="涓害" /><el-option label="閲嶅害" value="閲嶅害" /></el-select></el-form-item></el-col>
+                  <el-col :span="8"><el-form-item label="闃撮亾鍑鸿"><el-select v-model="form.pregEarly.bleeding" style="width:100%"><el-option label="鏃�" value="鏃�" /><el-option label="鏈�" value="鏈�" /></el-select></el-form-item></el-col>
+                  <el-col :span="8"><el-form-item label="鑵圭棝"><el-select v-model="form.pregEarly.abdominalPain" style="width:100%"><el-option label="鏃�" value="鏃�" /><el-option label="鏈�" value="鏈�" /></el-select></el-form-item></el-col>
+                </el-row>
+                <el-row :gutter="20">
+                  <el-col :span="8"><el-form-item label="琛�甯歌"><el-input v-model="form.pregEarly.bloodRoutine" placeholder="Hb/PLT绛�" /></el-form-item></el-col>
+                  <el-col :span="8"><el-form-item label="灏垮父瑙�"><el-input v-model="form.pregEarly.urineRoutine" /></el-form-item></el-col>
+                  <el-col :span="8"><el-form-item label="B瓒呮鏌�"><el-input v-model="form.pregEarly.ultrasound" placeholder="CRL/NT绛�" /></el-form-item></el-col>
+                </el-row>
+                <el-form-item label="鍙堕吀琛ュ厖"><el-select v-model="form.pregEarly.folicAcid" style="width:200px"><el-option label="瑙勫緥鏈嶇敤" value="瑙勫緥鏈嶇敤" /><el-option label="鍋跺皵鏈嶇敤" value="鍋跺皵鏈嶇敤" /><el-option label="鏈湇鐢�" value="鏈湇鐢�" /></el-select></el-form-item>
+                <el-form-item label="鎸囧鎰忚"><el-input v-model="form.pregEarly.advice" type="textarea" :rows="2" /></el-form-item>
+                <el-form-item label="闅忚鍖荤敓"><el-input v-model="form.pregEarly.doctor" style="width:200px" /></el-form-item>
+              </el-form>
+            </el-tab-pane>
+          </el-tabs>
+        </el-card>
+      </template>
+
+      <!-- ===== 鏇村勾鏈熼殢璁匡細6涓〃鍗� ===== -->
+      <template v-if="archive.subType === 'menopause'">
+        <el-card class="info-card" shadow="never" style="margin-top:14px">
+          <div slot="header" class="card-header"><span>鏇村勾鏈熼殢璁跨鐞�</span></div>
+          <el-tabs v-model="activeTab" type="border-card">
+            <!-- 1. 鏇村勾鏈熼殢璁跨郴缁熼棶棰樿〃 -->
+            <el-tab-pane label="鏇村勾鏈熼殢璁跨郴缁熼棶棰樿〃" name="sysQ">
+              <el-form :model="form.menoSysQ" label-width="150px" size="small" :disabled="!editing">
+                <el-row :gutter="20">
+                  <el-col :span="8"><el-form-item label="濉啓鏃ユ湡"><el-date-picker v-model="form.menoSysQ.date" value-format="yyyy-MM-dd" style="width:100%" /></el-form-item></el-col>
+                  <el-col :span="8"><el-form-item label="骞撮緞"><el-input-number v-model="form.menoSysQ.age" /></el-form-item></el-col>
+                </el-row>
+                <el-row :gutter="20">
+                  <el-col :span="8"><el-form-item label="鏈堢粡鎯呭喌"><el-input v-model="form.menoSysQ.menstruation" placeholder="鍛ㄦ湡/缁忔湡/缁忛噺" /></el-form-item></el-col>
+                  <el-col :span="8"><el-form-item label="鏈鏈堢粡"><el-date-picker v-model="form.menoSysQ.lmp" value-format="yyyy-MM-dd" style="width:100%" /></el-form-item></el-col>
+                  <el-col :span="8"><el-form-item label="缁濈粡骞撮緞"><el-input-number v-model="form.menoSysQ.menopauseAge" /></el-form-item></el-col>
+                </el-row>
+                <el-row :gutter="20">
+                  <el-col :span="6"><el-form-item label="娼儹鍑烘睏"><el-select v-model="form.menoSysQ.hotFlash" style="width:100%"><el-option :value="0" label="鏃�" /><el-option :value="1" label="杞�" /><el-option :value="2" label="涓�" /><el-option :value="3" label="閲�" /></el-select></el-form-item></el-col>
+                  <el-col :span="6"><el-form-item label="澶辩湢"><el-select v-model="form.menoSysQ.insomnia" style="width:100%"><el-option :value="0" label="鏃�" /><el-option :value="1" label="杞�" /><el-option :value="2" label="涓�" /><el-option :value="3" label="閲�" /></el-select></el-form-item></el-col>
+                  <el-col :span="6"><el-form-item label="鎯呯华娉㈠姩"><el-select v-model="form.menoSysQ.mood" style="width:100%"><el-option :value="0" label="鏃�" /><el-option :value="1" label="杞�" /><el-option :value="2" label="涓�" /><el-option :value="3" label="閲�" /></el-select></el-form-item></el-col>
+                  <el-col :span="6"><el-form-item label="鐤蹭箯"><el-select v-model="form.menoSysQ.fatigue" style="width:100%"><el-option :value="0" label="鏃�" /><el-option :value="1" label="杞�" /><el-option :value="2" label="涓�" /><el-option :value="3" label="閲�" /></el-select></el-form-item></el-col>
+                </el-row>
+                <el-row :gutter="20">
+                  <el-col :span="6"><el-form-item label="鍏宠妭鐥�"><el-select v-model="form.menoSysQ.jointPain" style="width:100%"><el-option :value="0" label="鏃�" /><el-option :value="1" label="杞�" /><el-option :value="2" label="涓�" /><el-option :value="3" label="閲�" /></el-select></el-form-item></el-col>
+                  <el-col :span="6"><el-form-item label="蹇冩偢"><el-select v-model="form.menoSysQ.palpitation" style="width:100%"><el-option :value="0" label="鏃�" /><el-option :value="1" label="杞�" /><el-option :value="2" label="涓�" /><el-option :value="3" label="閲�" /></el-select></el-form-item></el-col>
+                  <el-col :span="6"><el-form-item label="闃撮亾骞叉订"><el-select v-model="form.menoSysQ.dryness" style="width:100%"><el-option :value="0" label="鏃�" /><el-option :value="1" label="杞�" /><el-option :value="2" label="涓�" /><el-option :value="3" label="閲�" /></el-select></el-form-item></el-col>
+                  <el-col :span="6"><el-form-item label="鎬ф鍑忛��"><el-select v-model="form.menoSysQ.libido" style="width:100%"><el-option :value="0" label="鏃�" /><el-option :value="1" label="杞�" /><el-option :value="2" label="涓�" /><el-option :value="3" label="閲�" /></el-select></el-form-item></el-col>
+                </el-row>
+                <el-form-item label="鍏朵粬鐥囩姸"><el-input v-model="form.menoSysQ.otherSymptoms" type="textarea" :rows="2" /></el-form-item>
+                <el-form-item label="澶勭悊鎰忚"><el-input v-model="form.menoSysQ.advice" type="textarea" :rows="2" /></el-form-item>
+                <el-form-item label="鍖荤敓"><el-input v-model="form.menoSysQ.doctor" style="width:200px" /></el-form-item>
+              </el-form>
+            </el-tab-pane>
+
+            <!-- 2. MHT棣栬瘖鐥呭巻琛� -->
+            <el-tab-pane label="MHT棣栬瘖鐥呭巻琛�" name="mhtFirst">
+              <el-form :model="form.mhtFirst" label-width="160px" size="small" :disabled="!editing">
+                <el-row :gutter="20">
+                  <el-col :span="8"><el-form-item label="灏辫瘖鏃ユ湡"><el-date-picker v-model="form.mhtFirst.date" value-format="yyyy-MM-dd" style="width:100%" /></el-form-item></el-col>
+                  <el-col :span="8"><el-form-item label="涓昏瘔"><el-input v-model="form.mhtFirst.chiefComplaint" /></el-form-item></el-col>
+                  <el-col :span="8"><el-form-item label="缁濈粡骞撮檺"><el-input-number v-model="form.mhtFirst.menopauseYears" :precision="1" /></el-form-item></el-col>
+                </el-row>
+                <el-row :gutter="20">
+                  <el-col :span="8"><el-form-item label="韬珮(cm)"><el-input-number v-model="form.mhtFirst.height" :precision="1" /></el-form-item></el-col>
+                  <el-col :span="8"><el-form-item label="浣撻噸(kg)"><el-input-number v-model="form.mhtFirst.weight" :precision="1" /></el-form-item></el-col>
+                  <el-col :span="8"><el-form-item label="BMI"><el-input-number v-model="form.mhtFirst.bmi" :precision="1" disabled /></el-form-item></el-col>
+                </el-row>
+                <el-row :gutter="20">
+                  <el-col :span="8"><el-form-item label="琛�鍘�"><el-input v-model="form.mhtFirst.bloodPressure" /></el-form-item></el-col>
+                  <el-col :span="8"><el-form-item label="琛�绯�"><el-input-number v-model="form.mhtFirst.glucose" :precision="1" /></el-form-item></el-col>
+                  <el-col :span="8"><el-form-item label="琛�鑴�"><el-input v-model="form.mhtFirst.lipid" placeholder="TC/TG/LDL/HDL" /></el-form-item></el-col>
+                </el-row>
+                <el-form-item label="鏃㈠線鍙�"><el-input v-model="form.mhtFirst.pastHistory" type="textarea" :rows="2" placeholder="楂樿鍘�/绯栧翱鐥�/琛�鏍�/涔宠吅鐧�/瀛愬鑲岀槫绛�" /></el-form-item>
+                <el-form-item label="濡囩妫�鏌�"><el-input v-model="form.mhtFirst.gynExam" type="textarea" :rows="2" /></el-form-item>
+                <el-form-item label="涔宠吅妫�鏌�"><el-input v-model="form.mhtFirst.breastExam" type="textarea" :rows="2" /></el-form-item>
+                <el-form-item label="杈呭姪妫�鏌�"><el-input v-model="form.mhtFirst.auxExam" type="textarea" :rows="2" placeholder="B瓒�/楠ㄥ瘑搴�/婵�绱犳按骞崇瓑" /></el-form-item>
+                <el-form-item label="MHT鏂规"><el-input v-model="form.mhtFirst.mhtPlan" type="textarea" :rows="2" placeholder="鑽墿鍚嶇О/鍓傞噺/鐢ㄦ硶/鐤楃▼" /></el-form-item>
+                <el-form-item label="鍖荤敓"><el-input v-model="form.mhtFirst.doctor" style="width:200px" /></el-form-item>
+              </el-form>
+            </el-tab-pane>
+
+            <!-- 3. MHT澶嶈瘖鐥呭巻琛� -->
+            <el-tab-pane label="MHT澶嶈瘖鐥呭巻琛�" name="mhtFollow">
+              <el-form :model="form.mhtFollow" label-width="160px" size="small" :disabled="!editing">
+                <el-row :gutter="20">
+                  <el-col :span="8"><el-form-item label="澶嶈瘖鏃ユ湡"><el-date-picker v-model="form.mhtFollow.date" value-format="yyyy-MM-dd" style="width:100%" /></el-form-item></el-col>
+                  <el-col :span="8"><el-form-item label="鐢ㄨ嵂渚濅粠鎬�"><el-select v-model="form.mhtFollow.compliance" style="width:100%"><el-option label="鑹ソ" value="鑹ソ" /><el-option label="涓�鑸�" value="涓�鑸�" /><el-option label="宸�" value="宸�" /></el-select></el-form-item></el-col>
+                </el-row>
+                <el-row :gutter="20">
+                  <el-col :span="8"><el-form-item label="鐥囩姸鏀瑰杽"><el-select v-model="form.mhtFollow.symptomImprove" style="width:100%"><el-option label="鏄庢樉" value="鏄庢樉" /><el-option label="閮ㄥ垎" value="閮ㄥ垎" /><el-option label="鏃犲彉鍖�" value="鏃犲彉鍖�" /></el-select></el-form-item></el-col>
+                  <el-col :span="8"><el-form-item label="涓嶈壇鍙嶅簲"><el-input v-model="form.mhtFollow.sideEffect" placeholder="濡備钩鎴胯儉鐥�/闃撮亾鍑鸿绛�" /></el-form-item></el-col>
+                  <el-col :span="8"><el-form-item label="闃撮亾鍑鸿"><el-select v-model="form.mhtFollow.bleeding" style="width:100%"><el-option label="鏃�" value="鏃�" /><el-option label="鐐规淮" value="鐐规淮" /><el-option label="灏戦噺" value="灏戦噺" /><el-option label="涓噺" value="涓噺" /></el-select></el-form-item></el-col>
+                </el-row>
+                <el-row :gutter="20">
+                  <el-col :span="8"><el-form-item label="浣撻噸(kg)"><el-input-number v-model="form.mhtFollow.weight" :precision="1" /></el-form-item></el-col>
+                  <el-col :span="8"><el-form-item label="琛�鍘�"><el-input v-model="form.mhtFollow.bloodPressure" /></el-form-item></el-col>
+                </el-row>
+                <el-form-item label="澶嶆煡缁撴灉"><el-input v-model="form.mhtFollow.reExamResult" type="textarea" :rows="2" placeholder="B瓒�/涔宠吅/婵�绱犵瓑妫�鏌ョ粨鏋�" /></el-form-item>
+                <el-form-item label="鏂规璋冩暣"><el-input v-model="form.mhtFollow.planAdjust" type="textarea" :rows="2" /></el-form-item>
+                <el-form-item label="涓嬫澶嶈瘖"><el-date-picker v-model="form.mhtFollow.nextVisit" value-format="yyyy-MM-dd" style="width:200px" /></el-form-item>
+                <el-form-item label="鍖荤敓"><el-input v-model="form.mhtFollow.doctor" style="width:200px" /></el-form-item>
+              </el-form>
+            </el-tab-pane>
+
+            <!-- 4. 鏀硅壇Kupperman璇勫垎鏍囧噯琛� -->
+            <el-tab-pane label="鏀硅壇Kupperman璇勫垎鏍囧噯琛�" name="kupperman">
+              <el-form :model="form.kupperman" label-width="160px" size="small" :disabled="!editing">
+                <el-row :gutter="20">
+                  <el-col :span="8"><el-form-item label="璇勪及鏃ユ湡"><el-date-picker v-model="form.kupperman.date" value-format="yyyy-MM-dd" style="width:100%" /></el-form-item></el-col>
+                </el-row>
+                <KuppermanScoreTable v-model="form.kupperman" :editing="editing" />
+              </el-form>
+            </el-tab-pane>
+
+            <!-- 5. 鏇村勾鏈熻瘎鍒嗛噺琛�(MRS) -->
+            <el-tab-pane label="鏇村勾鏈熻瘎鍒嗛噺琛紙MRS锛�" name="mrs">
+              <el-form :model="form.mrs" label-width="160px" size="small" :disabled="!editing">
+                <el-row :gutter="20">
+                  <el-col :span="8"><el-form-item label="璇勪及鏃ユ湡"><el-date-picker v-model="form.mrs.date" value-format="yyyy-MM-dd" style="width:100%" /></el-form-item></el-col>
+                </el-row>
+                <MRSScoreTable v-model="form.mrs" :editing="editing" />
+              </el-form>
+            </el-tab-pane>
+
+            <!-- 6. 鍖瑰吂鍫$潯鐪犺川閲忚瘎鍒嗛噺琛�(PSQI) -->
+            <el-tab-pane label="鍖瑰吂鍫$潯鐪犺川閲忚瘎鍒嗛噺琛紙PSQI锛�" name="psqi">
+              <el-form :model="form.psqi" label-width="160px" size="small" :disabled="!editing">
+                <el-row :gutter="20">
+                  <el-col :span="8"><el-form-item label="璇勪及鏃ユ湡"><el-date-picker v-model="form.psqi.date" value-format="yyyy-MM-dd" style="width:100%" /></el-form-item></el-col>
+                </el-row>
+                <PSQIScoreTable v-model="form.psqi" :editing="editing" />
+              </el-form>
+            </el-tab-pane>
+          </el-tabs>
+        </el-card>
+      </template>
+    </template>
+    <div v-else class="empty-wrap">妗f涓嶅瓨鍦ㄦ垨宸插垹闄�</div>
+  </div>
+</template>
+
+<script>
+import InfoField from "../childHealth/InfoField.vue";
+import KuppermanScoreTable from "./KuppermanScoreTable.vue";
+import MRSScoreTable from "./MRSScoreTable.vue";
+import PSQIScoreTable from "./PSQIScoreTable.vue";
+
+export default {
+  name: "MaternalHealthArchiveDetail",
+  components: { InfoField, KuppermanScoreTable, MRSScoreTable, PSQIScoreTable },
+  data() {
+    return {
+      loading: false, archive: null, editing: false, activeTab: "sysQ",
+      form: {
+        pregSysQ: { date:"", gestWeek:null, weight:null, bloodPressure:"", fundalHeight:null, fetalHeart:null, edema:"鏃�", urineProtein:"-", symptoms:"", advice:"", nextVisit:"", doctor:"" },
+        pregFirst: { regDate:"", husbandName:"", husbandPhone:"", lmp:"", edd:"", gp:"", csHistory:0, abortionHistory:0, diseaseHistory:"", height:null, preWeight:null, riskAssessment:"", doctor:"" },
+        pregEarly: { date:"", gestWeek:null, morningSickness:"鏃�", bleeding:"鏃�", abdominalPain:"鏃�", bloodRoutine:"", urineRoutine:"", ultrasound:"", folicAcid:"瑙勫緥鏈嶇敤", advice:"", doctor:"" },
+        menoSysQ: { date:"", age:null, menstruation:"", lmp:"", menopauseAge:null, hotFlash:0, insomnia:0, mood:0, fatigue:0, jointPain:0, palpitation:0, dryness:0, libido:0, otherSymptoms:"", advice:"", doctor:"" },
+        mhtFirst: { date:"", chiefComplaint:"", menopauseYears:null, height:null, weight:null, bmi:null, bloodPressure:"", glucose:null, lipid:"", pastHistory:"", gynExam:"", breastExam:"", auxExam:"", mhtPlan:"", doctor:"" },
+        mhtFollow: { date:"", compliance:"鑹ソ", symptomImprove:"閮ㄥ垎", sideEffect:"", bleeding:"鏃�", weight:null, bloodPressure:"", reExamResult:"", planAdjust:"", nextVisit:"", doctor:"" },
+        kupperman: { date:"", 娼儹鍑烘睏:0,鎰熻寮傚父:0,澶辩湢:0,鎯呯华娉㈠姩:0,鎶戦儊:0,鐪╂檿:0,鐤蹭箯:0,鍏宠妭鐥�:0,澶寸棝:0,蹇冩偢:0,鐨偆铓佽蛋鎰�:0,鎬х敓娲�:0,娉屽翱绯绘劅鏌�:0 },
+        mrs: { date:"" },
+        psqi: { date:"" },
+      },
+    };
+  },
+  computed: {
+    sourceLabel() { const m={standalone:"鐙珛寤烘。",outpatient:"闂ㄨ瘖璁板綍",inpatient:"鍦ㄩ櫌璁板綍"}; return m[this.archive?.sourcePage]||this.archive?.sourcePage||"-"; },
+    menstrualLabel() { const m={irregular:"鏈堢粡绱婁贡",amenorrhea_short:"闂粡锛�<12涓湀锛�",menopause:"缁濈粡锛堚墺12涓湀锛�",surgical:"浜哄伐缁濈粡"}; return m[this.archive?.archiveForm?.menstrualStatus]||"-"; },
+  },
+  created() {
+    const id = this.$route.query.id;
+    if (id) this.loadArchive(id);
+  },
+  methods: {
+    loadArchive(id) {
+      this.loading = true;
+      const all = JSON.parse(localStorage.getItem("patientArchives") || "[]");
+      this.archive = all.find(item => item.id === id) || null;
+      if (this.archive) {
+        if (this.archive.subType === 'pregnancy') this.activeTab = "sysQ";
+        else if (this.archive.subType === 'menopause') this.activeTab = "sysQ";
+        if (this.archive.formData) {
+          Object.keys(this.form).forEach(k => {
+            if (this.archive.formData[k]) Object.assign(this.form[k], this.archive.formData[k]);
+          });
+        }
+      }
+      this.loading = false;
+    },
+    toggleEdit() {
+      if (this.editing) {
+        this.archive.formData = JSON.parse(JSON.stringify(this.form));
+        this.archive.updateTime = new Date().toISOString().replace("T"," ").substring(0,19);
+        const all = JSON.parse(localStorage.getItem("patientArchives") || "[]");
+        const idx = all.findIndex(item => item.id === this.archive.id);
+        if (idx >= 0) all[idx] = JSON.parse(JSON.stringify(this.archive));
+        localStorage.setItem("patientArchives", JSON.stringify(all));
+        this.$message.success("淇濆瓨鎴愬姛");
+      }
+      this.editing = !this.editing;
+    },
+  },
+};
+</script>
+
+<style lang="scss" scoped>
+.action-bar { margin-bottom: 16px; }
+.info-card { margin-bottom: 0; }
+.card-header { display: flex; justify-content: space-between; align-items: center; font-size: 16px; font-weight: 600; }
+.header-sub { font-size: 13px; color: #909399; font-weight: normal; }
+.empty-wrap { text-align: center; padding: 100px 0; color: #c0c4cc; font-size: 16px; }
+</style>
diff --git a/src/views/patient/archives/maternalHealth/index.vue b/src/views/patient/archives/maternalHealth/index.vue
new file mode 100644
index 0000000..c8bf90a
--- /dev/null
+++ b/src/views/patient/archives/maternalHealth/index.vue
@@ -0,0 +1,141 @@
+<template>
+  <div class="app-container">
+    <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="80px">
+      <el-form-item label="鎮h�呭鍚�">
+        <el-input v-model="queryParams.patname" placeholder="璇疯緭鍏ュ鍚�" clearable @keyup.enter.native="handleQuery" style="width:180px" />
+      </el-form-item>
+      <el-form-item label="涓撴绫诲瀷">
+        <el-select v-model="queryParams.subType" placeholder="璇烽�夋嫨" clearable style="width:180px">
+          <el-option label="瀛曞闅忚" value="pregnancy" />
+          <el-option label="鏇村勾鏈熼殢璁�" value="menopause" />
+        </el-select>
+      </el-form-item>
+      <el-form-item label="绉戝">
+        <el-input v-model="queryParams.deptname" placeholder="璇疯緭鍏ョ瀹�" clearable @keyup.enter.native="handleQuery" style="width:180px" />
+      </el-form-item>
+      <el-form-item label="寤烘。鏃ユ湡">
+        <el-date-picker v-model="dateRange" style="width:240px" value-format="yyyy-MM-dd" type="daterange"
+          range-separator="-" start-placeholder="寮�濮嬫棩鏈�" end-placeholder="缁撴潫鏃ユ湡" />
+      </el-form-item>
+      <el-form-item>
+        <el-button type="primary" icon="el-icon-search" size="medium" @click="handleQuery">鎼滅储</el-button>
+        <el-button icon="el-icon-refresh" size="medium" @click="resetQuery">閲嶇疆</el-button>
+      </el-form-item>
+    </el-form>
+
+    <el-row :gutter="10" class="mb8">
+      <el-col :span="1.5">
+        <el-button type="primary" plain icon="el-icon-plus" size="medium" @click="handleCreateStandalone">鏂板缓寤烘。</el-button>
+      </el-col>
+      <el-col :span="1.5">
+        <el-button type="danger" plain icon="el-icon-delete" size="medium" :disabled="multiple" @click="handleDelete">鍒犻櫎</el-button>
+      </el-col>
+      <right-toolbar :showSearch.sync="showSearch" @queryTable="getList" />
+    </el-row>
+
+    <el-table v-loading="loading" :data="displayList" @selection-change="handleSelectionChange">
+      <el-table-column type="selection" width="50" align="center" />
+      <el-table-column label="鎮h�呭鍚�" align="center" prop="patname" width="100" />
+      <el-table-column label="鎬у埆" align="center" width="60">
+        <template slot-scope="scope">{{ scope.row.sex == 1 ? '鐢�' : '濂�' }}</template>
+      </el-table-column>
+      <el-table-column label="骞撮緞" align="center" prop="age" width="60" />
+      <el-table-column label="鑱旂郴鐢佃瘽" align="center" prop="telcode" width="130" />
+      <el-table-column label="绉戝" align="center" prop="deptname" width="120" show-overflow-tooltip />
+      <el-table-column label="璇婃柇" align="center" prop="diagname" min-width="150" show-overflow-tooltip />
+      <el-table-column label="涓撴绫诲瀷" align="center" width="140">
+        <template slot-scope="scope">
+          <el-tag :type="scope.row.subType === 'pregnancy' ? 'success' : 'warning'">{{ scope.row.subTypeLabel }}</el-tag>
+        </template>
+      </el-table-column>
+      <el-table-column label="瀛曞懆" align="center" width="70">
+        <template slot-scope="scope">{{ scope.row.subType === 'pregnancy' ? (scope.row.archiveForm.gestationalWeek || '-') : '-' }}</template>
+      </el-table-column>
+      <el-table-column label="KMI璇勫垎" align="center" width="90">
+        <template slot-scope="scope">{{ scope.row.subType === 'menopause' ? (scope.row.archiveForm.kmiScore || '-') : '-' }}</template>
+      </el-table-column>
+      <el-table-column label="寤烘。鍖荤敓" align="center" prop="archiveForm.doctorName" width="100" />
+      <el-table-column label="寤烘。鏃堕棿" align="center" width="160">
+        <template slot-scope="scope">{{ scope.row.createTime ? scope.row.createTime.substring(0, 10) : '-' }}</template>
+      </el-table-column>
+      <el-table-column label="鏉ユ簮" align="center" width="80">
+        <template slot-scope="scope">
+          <el-tag v-if="scope.row.sourcePage === 'standalone'" type="info" size="mini">鐙珛</el-tag>
+          <span v-else>{{ scope.row.sourcePage === 'inpatient' ? '鍦ㄩ櫌' : '闂ㄨ瘖' }}</span>
+        </template>
+      </el-table-column>
+      <el-table-column label="鎿嶄綔" align="center" fixed="right" width="120">
+        <template slot-scope="scope">
+          <el-button size="medium" type="text" @click="goDetail(scope.row)">
+            <span class="button-textsc"><i class="el-icon-zoom-in" />鏌ョ湅</span>
+          </el-button>
+          <el-button size="medium" type="text" @click="handleSingleDelete(scope.row)">
+            <span style="color:#f56c6c"><i class="el-icon-delete" />鍒犻櫎</span>
+          </el-button>
+        </template>
+      </el-table-column>
+    </el-table>
+
+    <pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize"
+      @pagination="getList" />
+
+    <ArchiveDialog :visible.sync="createDialogVisible" :standalone="true" @created="getList" />
+  </div>
+</template>
+
+<script>
+import ArchiveDialog from "@/views/patient/archives/components/ArchiveDialog.vue";
+
+export default {
+  name: "MaternalHealthArchive",
+  components: { ArchiveDialog },
+  data() {
+    return {
+      loading: false, showSearch: true, multiple: true, ids: [], dateRange: [], total: 0, allList: [], displayList: [],
+      createDialogVisible: false,
+      queryParams: { pageNum: 1, pageSize: 10, patname: "", subType: "", deptname: "" },
+    };
+  },
+  created() { this.getList(); },
+  methods: {
+    getList() {
+      this.loading = true;
+      const all = JSON.parse(localStorage.getItem("patientArchives") || "[]");
+      this.allList = all.filter((item) => item.mainCategory === "maternal");
+      let filtered = [...this.allList];
+      if (this.queryParams.patname) filtered = filtered.filter((item) => item.patname && item.patname.includes(this.queryParams.patname));
+      if (this.queryParams.subType) filtered = filtered.filter((item) => item.subType === this.queryParams.subType);
+      if (this.queryParams.deptname) filtered = filtered.filter((item) => item.deptname && item.deptname.includes(this.queryParams.deptname));
+      if (this.dateRange && this.dateRange.length === 2) {
+        filtered = filtered.filter((item) => {
+          const d = (item.createTime || "").substring(0, 10);
+          return d >= this.dateRange[0] && d <= this.dateRange[1];
+        });
+      }
+      this.total = filtered.length;
+      const start = (this.queryParams.pageNum - 1) * this.queryParams.pageSize;
+      this.displayList = filtered.slice(start, start + this.queryParams.pageSize);
+      this.loading = false;
+    },
+    handleQuery() { this.queryParams.pageNum = 1; this.getList(); },
+    resetQuery() { this.dateRange = []; this.queryParams = { pageNum: 1, pageSize: 10, patname: "", subType: "", deptname: "" }; this.getList(); },
+    handleSelectionChange(s) { this.ids = s.map(i => i.id); this.multiple = !s.length; },
+    handleDelete() {
+      if (this.ids.length === 0) { this.$modal.msgWarning("璇疯嚦灏戦�夋嫨涓�鏉�"); return; }
+      this.$modal.confirm("纭鍒犻櫎閫変腑妗f锛�").then(() => {
+        const all = JSON.parse(localStorage.getItem("patientArchives") || "[]");
+        const remaining = all.filter((item) => !this.ids.includes(item.id));
+        localStorage.setItem("patientArchives", JSON.stringify(remaining));
+        this.$modal.msgSuccess("鍒犻櫎鎴愬姛"); this.getList();
+      }).catch(() => {});
+    },
+    handleSingleDelete(row) { this.ids = [row.id]; this.handleDelete(); },
+    handleCreateStandalone() { this.createDialogVisible = true; },
+    goDetail(row) { this.$router.push({ path: "/filing/maternalDetail", query: { id: row.id } }); },
+  },
+};
+</script>
+
+<style lang="scss" scoped>
+.button-textsc { color: #3664d9; }
+</style>
diff --git a/src/views/patient/patient/AwaitingAdmission.vue b/src/views/patient/patient/AwaitingAdmission.vue
index 5bcff2a..4ed56bb 100644
--- a/src/views/patient/patient/AwaitingAdmission.vue
+++ b/src/views/patient/patient/AwaitingAdmission.vue
@@ -219,7 +219,7 @@
                     scope.row.idcardno,
                     scope.row.drcode,
                     scope.row.drname,
-                    scope.row.patid,
+                    scope.row.patid
                   )
                 "
                 ><span class="button-textsc">{{
@@ -546,7 +546,12 @@
 import { getToken } from "@/utils/auth";
 import Treeselect from "@riophae/vue-treeselect";
 import "@riophae/vue-treeselect/dist/vue-treeselect.css";
-import { query360PatInfo,query360PatInfonh, getTasklist, addSubtask } from "@/api/AiCentre/index";
+import {
+  query360PatInfo,
+  query360PatInfonh,
+  getTasklist,
+  addSubtask,
+} from "@/api/AiCentre/index";
 
 import store from "@/store";
 import { type } from "jquery";
@@ -698,7 +703,7 @@
       queryParams: {
         pageNum: 1,
         pageSize: 10,
-
+        inhospstate: "3",
       },
       // 琛ㄥ崟鏍¢獙
       rules: {
@@ -781,7 +786,8 @@
         this.queryParams.beginTime = "";
         this.queryParams.endTime = "";
       }
-        this.loading = false;
+      this.queryParams.inhospstate = "3";
+      this.loading = false;
 
       listPatMedInhosp(this.queryParams).then((response) => {
         this.userList = response.rows;
diff --git a/src/views/patient/patient/behospitalized.vue b/src/views/patient/patient/behospitalized.vue
index f7e42d2..81b612d 100644
--- a/src/views/patient/patient/behospitalized.vue
+++ b/src/views/patient/patient/behospitalized.vue
@@ -49,8 +49,8 @@
               v-model="queryParams.scopetype"
               placeholder="榛樿鍏ㄩ儴绉戝"
               :options="sourcetype"
-            filterable
-            clearable
+              filterable
+              clearable
               :props="{ expandTrigger: 'hover' }"
               @change="handleChange"
             ></el-cascader>
@@ -110,6 +110,18 @@
             >
               娣诲姞寤剁画鎶ょ悊浠诲姟
             </el-button>
+          </el-col>
+          <el-col :span="1.5">
+            <el-button
+              type="success"
+              plain
+              icon="el-icon-folder-add"
+              size="medium"
+              :disabled="multiple"
+              @click="handleCreateArchive"
+            >
+              鎮h�呭缓妗�</el-button
+            >
           </el-col>
           <el-col :span="1.5">
             <el-button
@@ -176,7 +188,7 @@
                     scope.row.idcardno,
                     scope.row.drcode,
                     scope.row.drname,
-                    scope.row.patid,
+                    scope.row.patid
                   )
                 "
                 ><span class="button-textsc">{{
@@ -544,6 +556,13 @@
         <el-button @click="submitclose">鍙� 娑�</el-button>
       </div>
     </el-dialog>
+
+    <!-- 鎮h�呭缓妗e脊绐� -->
+    <ArchiveDialog
+      :visible.sync="archiveDialogVisible"
+      :patients="archivePatients"
+      source-page="inpatient"
+    />
   </div>
 </template>
 
@@ -567,14 +586,20 @@
 import Treeselect from "@riophae/vue-treeselect";
 import { listDept } from "@/api/system/dept";
 import "@riophae/vue-treeselect/dist/vue-treeselect.css";
-import { query360PatInfo,query360PatInfonh, getTasklist, addSubtask } from "@/api/AiCentre/index";
+import {
+  query360PatInfo,
+  query360PatInfonh,
+  getTasklist,
+  addSubtask,
+} from "@/api/AiCentre/index";
 
 import store from "@/store";
+import ArchiveDialog from "@/views/patient/archives/components/ArchiveDialog.vue";
 
 export default {
   name: "behospitalized",
   dicts: ["sys_normal_disable", "sys_user_sex", "nursinggrade"],
-  components: { Treeselect },
+  components: { Treeselect, ArchiveDialog },
   data() {
     return {
       // 閬僵灞�
@@ -608,6 +633,9 @@
       taskList: [], // 浠诲姟鍒楄〃
       selectedTask: null, // 閫変腑鐨勪换鍔�
       batchLoading: false, // 鎵归噺鎻愪氦鍔犺浇鐘舵��
+      // 鎮h�呭缓妗�
+      archiveDialogVisible: false,
+      archivePatients: [],
       // 鏃ユ湡鑼冨洿
       dateRange: [],
       paperstypes: [
@@ -630,6 +658,8 @@
           label: "鐥呭尯鎮h��",
         },
       ],
+      orgName: localStorage.getItem("orgname"),
+
       postData: {
         XiaoXiTou: {
           FaSongFCSJC: "ZJHES",
@@ -893,7 +923,12 @@
         pageSize: 100, // 璁剧疆杈冨ぇ鐨勫垎椤佃幏鍙栨洿澶氫换鍔�
         type: 2, // 寤剁画鎶ょ悊浠诲姟绫诲瀷
       };
-
+      topqueryParams.deptcodes = store.getters.belongDepts.map(
+        (obj) => obj.deptCode
+      );
+      topqueryParams.hospitaldistrictcodes = store.getters.belongWards.map(
+        (obj) => obj.districtCode
+      );
       getTasklist(topqueryParams)
         .then((response) => {
           this.taskList = response.rows;
@@ -983,6 +1018,9 @@
         }
 
         this.batchTaskVisible = false;
+        this.$router.push({
+          path: "/followvisit/Continue",
+        });
         this.getList(); // 鍒锋柊鎮h�呭垪琛�
       } catch (error) {
         this.$modal.msgError("鎵归噺娣诲姞浠诲姟杩囩▼涓嚭閿欙細" + error.message);
@@ -1210,6 +1248,17 @@
       this.upload.open = false;
       this.dractive = 1;
     },
+    /** 鎮h�呭缓妗� */
+    handleCreateArchive() {
+      if (this.ids.length === 0) {
+        this.$modal.msgWarning("璇疯嚦灏戦�変腑1鍚嶆偅鑰�");
+        return;
+      }
+      this.archivePatients = this.userList.filter((item) =>
+        this.ids.includes(item.patid)
+      );
+      this.archiveDialogVisible = true;
+    },
   },
 };
 </script>
diff --git a/src/views/patient/patient/hospital.vue b/src/views/patient/patient/hospital.vue
index 560b7a6..4120437 100644
--- a/src/views/patient/patient/hospital.vue
+++ b/src/views/patient/patient/hospital.vue
@@ -60,8 +60,8 @@
               v-model="queryParams.scopetype"
               placeholder="榛樿鍏ㄩ儴绉戝"
               :options="sourcetype"
-            filterable
-            clearable
+              filterable
+              clearable
               :props="{ expandTrigger: 'hover' }"
               @change="handleChange"
             ></el-cascader>
@@ -205,7 +205,7 @@
                     scope.row.idcardno,
                     scope.row.drcode,
                     scope.row.drname,
-                    scope.row.patid,
+                    scope.row.patid
                   )
                 "
                 ><span class="button-textsc">{{
@@ -404,7 +404,11 @@
                 width="120"
                 align="center"
               />
-              <el-table-column prop="leaveldeptname" label="绉戝" align="center" />
+              <el-table-column
+                prop="leaveldeptname"
+                label="绉戝"
+                align="center"
+              />
               <el-table-column
                 prop="leavehospitaldistrictname"
                 label="鐥呭尯"
@@ -431,7 +435,7 @@
             <el-table
               :data="taskList"
               border
-               height="680"
+              height="680"
               style="width: 100%"
               size="small"
               @current-change="handleTaskSelectionChange"
@@ -615,7 +619,12 @@
 import Treeselect from "@riophae/vue-treeselect";
 import { listDept } from "@/api/system/dept";
 import "@riophae/vue-treeselect/dist/vue-treeselect.css";
-import { query360PatInfo,query360PatInfonh, getTasklist, addSubtask } from "@/api/AiCentre/index";
+import {
+  query360PatInfo,
+  query360PatInfonh,
+  getTasklist,
+  addSubtask,
+} from "@/api/AiCentre/index";
 
 import store from "@/store";
 
@@ -927,7 +936,12 @@
         pageSize: 100, // 璁剧疆杈冨ぇ鐨勫垎椤佃幏鍙栨洿澶氫换鍔�
         type: 2, // 鏍规嵁瀹為檯鎯呭喌璋冩暣
       };
-
+      topqueryParams.deptcodes = store.getters.belongDepts.map(
+        (obj) => obj.deptCode
+      );
+      topqueryParams.hospitaldistrictcodes = store.getters.belongWards.map(
+        (obj) => obj.districtCode
+      );
       getTasklist(topqueryParams)
         .then((response) => {
           this.taskList = response.rows;
@@ -1015,6 +1029,9 @@
         }
 
         this.batchTaskVisible = false;
+        this.$router.push({
+          path: "/followvisit/Continue",
+        });
         this.getList(); // 鍒锋柊鎮h�呭垪琛�
       } catch (error) {
         this.$modal.msgError("鎵归噺娣诲姞浠诲姟杩囩▼涓嚭閿欙細" + error.message);
diff --git a/src/views/patient/patient/outpatient.vue b/src/views/patient/patient/outpatient.vue
index e691434..5e18d72 100644
--- a/src/views/patient/patient/outpatient.vue
+++ b/src/views/patient/patient/outpatient.vue
@@ -166,6 +166,18 @@
               鎵归噺娣诲姞浠诲姟</el-button
             >
           </el-col>
+          <el-col :span="1.5">
+            <el-button
+              type="success"
+              plain
+              icon="el-icon-folder-add"
+              size="medium"
+              :disabled="multiple"
+              @click="handleCreateArchive"
+            >
+              鎮h�呭缓妗�</el-button
+            >
+          </el-col>
           <el-col :span="19">
             <div class="documentf">
               <div class="document">
@@ -569,6 +581,13 @@
         <el-button @click="submitclose">鍙� 娑�</el-button>
       </div>
     </el-dialog>
+
+    <!-- 鎮h�呭缓妗e脊绐� -->
+    <ArchiveDialog
+      :visible.sync="archiveDialogVisible"
+      :patients="archivePatients"
+      source-page="outpatient"
+    />
   </div>
 </template>
 
@@ -591,11 +610,12 @@
 
 import store from "@/store";
 import { type } from "jquery";
+import ArchiveDialog from "@/views/patient/archives/components/ArchiveDialog.vue";
 
 export default {
   name: "Userhuanze",
   dicts: ["sys_normal_disable", "sys_user_sex"],
-  components: { Treeselect },
+  components: { Treeselect, ArchiveDialog },
   data() {
     return {
       // 閬僵灞�
@@ -656,6 +676,9 @@
       taskList: [], // 浠诲姟鍒楄〃
       selectedTask: null, // 閫変腑鐨勪换鍔″垪琛�
       batchLoading: false, // 鎵归噺鎻愪氦鍔犺浇鐘舵��
+      // 鎮h�呭缓妗�
+      archiveDialogVisible: false,
+      archivePatients: [],
       deptcode: "",
       Patientrange: [
         {
@@ -667,6 +690,7 @@
           id: 1,
         },
       ],
+      orgName:localStorage.getItem("orgname"),
       postData: {
         XiaoXiTou: {
           FaSongFCSJC: "ZJHES",
@@ -1201,6 +1225,17 @@
 
     /** 鎵归噺娣诲姞鎮h�呬换鍔℃帴鍙� */
     batchAddPatientTask(params) {},
+    /** 鎮h�呭缓妗� */
+    handleCreateArchive() {
+      if (this.ids.length === 0) {
+        this.$modal.msgWarning("璇疯嚦灏戦�変腑1鍚嶆偅鑰�");
+        return;
+      }
+      this.archivePatients = this.userList.filter((item) =>
+        this.ids.includes(item.patid)
+      );
+      this.archiveDialogVisible = true;
+    },
   },
 };
 </script>
diff --git a/src/views/patient/propaganda/QuestionnaireTask.vue b/src/views/patient/propaganda/QuestionnaireTask.vue
index f5cfbd4..763a462 100644
--- a/src/views/patient/propaganda/QuestionnaireTask.vue
+++ b/src/views/patient/propaganda/QuestionnaireTask.vue
@@ -69,17 +69,7 @@
                     placeholder="璇疯緭鍏ヤ换鍔℃弿杩�"
                   />
                 </el-form-item>
-                <!-- <el-form-item label="鏈嶅姟褰㈠紡">
-                  <el-radio-group v-model="checkList">
-                    <el-radio
-                      v-for="(item, index) in checkboxlist"
-                      :key="index"
-                      :label="item.value"
-                    >
-                      {{ item.label }}</el-radio
-                    >
-                  </el-radio-group>
-                </el-form-item> -->
+
                 <el-form-item label="鏈嶅姟褰㈠紡">
                   <SortCheckbox
                     v-model="checkList"
@@ -90,6 +80,7 @@
                     @change="checkSelectionChange"
                   />
                 </el-form-item>
+
                 <el-form-item label="鎵ц鍛ㄦ湡" prop="longTask">
                   <el-radio-group v-model="form.longTask">
                     <el-radio :label="0">鑷畾涔夊懆鏈�</el-radio>
@@ -207,14 +198,51 @@
                     </div>
                   </div>
                 </el-form-item>
+
                 <el-form-item label="浠诲姟鍏宠仈" prop="longTask">
                   <el-radio-group v-model="form.appltype">
                     <el-radio label="1">绉戝鍏宠仈</el-radio>
                     <el-radio label="2">鐥呭尯鍏宠仈</el-radio>
                     <el-radio label="3">鐤剧梾鍏宠仈</el-radio>
                     <el-radio label="4">鎵嬫湳鍏宠仈</el-radio>
+                    <el-radio label="6" v-if="orgname == '鐪佺珛鍚屽痉缈犺嫅闄㈠尯'"
+                      >鑽搧鍏宠仈</el-radio
+                    >
+                    <el-radio label="5">浠诲姟缁�</el-radio>
                   </el-radio-group>
                 </el-form-item>
+
+                <!-- 鑽搧鍏宠仈 -->
+                <el-row v-if="form.appltype == 6">
+                  <el-col :span="20">
+                    <el-form-item label="鍏宠仈鑽搧" prop="region">
+                      <el-select
+                        v-model="medicalCodes"
+                        @remove-tag="removeMedical"
+                        style="width: 400px"
+                        size="medium"
+                        multiple
+                        filterable
+                        remote
+                        reserve-keyword
+                        :remote-method="remoteSearchMedical"
+                        placeholder="璇疯緭鍏ヨ嵂鍝佸悕绉版悳绱�"
+                        loading-text="鎼滅储涓�..."
+                      >
+                        <el-option
+                          v-for="item in medicalOptions"
+                          :key="item.id"
+                          :label="
+                            item.itemName + ' (' + item.manufacturerName + ')'
+                          "
+                          :value="item.itemCode"
+                        />
+                      </el-select>
+                    </el-form-item>
+                  </el-col>
+                </el-row>
+
+                <!-- 绉戝鍏宠仈 -->
                 <el-row v-if="form.appltype == 1">
                   <el-col :span="20"
                     ><el-form-item label="閫傜敤绉戝" prop="region">
@@ -237,6 +265,8 @@
                       </el-select> </el-form-item
                   ></el-col>
                 </el-row>
+
+                <!-- 鐥呭尯鍏宠仈 -->
                 <el-row v-if="form.appltype == 2">
                   <el-col :span="20"
                     ><el-form-item label="閫傜敤鐥呭尯" prop="region">
@@ -259,6 +289,8 @@
                       </el-select> </el-form-item
                   ></el-col>
                 </el-row>
+
+                <!-- 鐤剧梾鍏宠仈 -->
                 <el-row v-if="form.appltype == 3">
                   <div class="xinz-infs">
                     <el-form-item>
@@ -288,7 +320,6 @@
                       >
                         {{ tag.icdname }}
                       </el-tag>
-                      <!-- <el-tag v-if="hasMore" type="info">+{{ remaining }} more</el-tag> -->
                     </el-form-item>
                   </div>
                   <div
@@ -299,14 +330,7 @@
                       border-left: 4px solid #409eff;
                     "
                   >
-                    <p
-                      style="
-                        margin: 0;
-                        color: #606266;
-                        font-size: 13px;
-                        line-height: 1.4;
-                      "
-                    >
+                    <p style="margin: 0; color: #606266; font-size: 13px">
                       <i
                         class="el-icon-info"
                         style="color: #409eff; margin-right: 6px"
@@ -314,7 +338,6 @@
                       閽堝鍚屼竴鐤剧梾鍦ㄥ绉戝/鐥呭尯涓嬪瓨鍦ㄧ殑鎯呭喌锛屽彲閫夋嫨鎬ч厤缃浐瀹氱瀹�/鐥呭尯
                     </p>
                   </div>
-                  <!-- 鏂板锛氱柧鐥呭叧鑱斾笅鐨勭瀹ら厤缃紙鍗曢�夛級 -->
                   <el-row :gutter="20" style="margin-top: 20px">
                     <el-col :span="12">
                       <el-form-item label="鍏宠仈绉戝" prop="diseaseDept">
@@ -341,7 +364,6 @@
                         </div>
                       </el-form-item>
                     </el-col>
-
                     <el-col :span="12">
                       <el-form-item label="鍏宠仈鐥呭尯" prop="diseaseWard">
                         <el-select
@@ -369,6 +391,8 @@
                     </el-col>
                   </el-row>
                 </el-row>
+
+                <!-- 鎵嬫湳鍏宠仈 -->
                 <el-row v-if="form.appltype == 4">
                   <el-form-item label="閫傜敤鎵嬫湳" prop="region">
                     <el-select
@@ -398,14 +422,7 @@
                       border-left: 4px solid #409eff;
                     "
                   >
-                    <p
-                      style="
-                        margin: 0;
-                        color: #606266;
-                        font-size: 13px;
-                        line-height: 1.4;
-                      "
-                    >
+                    <p style="margin: 0; color: #606266; font-size: 13px">
                       <i
                         class="el-icon-info"
                         style="color: #409eff; margin-right: 6px"
@@ -413,7 +430,6 @@
                       閽堝鍚屼竴鎵嬫湳绫诲瀷鍦ㄥ绉戝/鐥呭尯涓嬪瓨鍦ㄧ殑鎯呭喌锛屽彲閫夋嫨鎬ч厤缃浐瀹氱瀹�/鐥呭尯
                     </p>
                   </div>
-                  <!-- 鏂板锛氭墜鏈叧鑱斾笅鐨勭瀹ら厤缃紙鍗曢�夛級 -->
                   <el-row :gutter="20" style="margin-top: 20px">
                     <el-col :span="12">
                       <el-form-item label="鍏宠仈绉戝" prop="diseaseDept">
@@ -440,7 +456,6 @@
                         </div>
                       </el-form-item>
                     </el-col>
-
                     <el-col :span="12">
                       <el-form-item label="鍏宠仈鐥呭尯" prop="diseaseWard">
                         <el-select
@@ -468,6 +483,293 @@
                     </el-col>
                   </el-row>
                 </el-row>
+
+                <!-- ========= 浠诲姟缁� (appltype=5) ========= -->
+                <div v-if="form.appltype == 5">
+                  <el-divider content-position="left">浠诲姟缁勪富璁″垝</el-divider>
+                  <el-form-item label="鎵ц鏂瑰紡">
+                    <el-radio-group
+                      v-model="form.serviceTaskScheduleVO.scheduleStyle"
+                    >
+                      <el-radio :label="0">闈炲惊鐜�</el-radio>
+                      <el-radio :label="1">寰幆</el-radio>
+                    </el-radio-group>
+                  </el-form-item>
+
+                  <div v-if="form.serviceTaskScheduleVO.scheduleStyle == 1">
+                    <el-row :gutter="20" style="margin-top: 20px">
+                      <el-col :span="12">
+                        <el-form-item label="寰幆闂撮殧">
+                          <el-input-number
+                            v-model="form.serviceTaskScheduleVO.scheduleTimeNum"
+                            :min="1"
+                            style="width: 120px"
+                          />
+                          <el-select
+                            v-model="
+                              form.serviceTaskScheduleVO.scheduleTimeUnit
+                            "
+                            placeholder="鍗曚綅"
+                            style="width: 100px; margin-left: 8px"
+                          >
+                            <el-option label="澶�" :value="1" />
+                            <el-option label="鍛�" :value="2" />
+                            <el-option label="鏈�" :value="3" />
+                            <el-option label="骞�" :value="4" />
+                          </el-select>
+                        </el-form-item>
+                      </el-col>
+                      <el-col :span="12">
+                        <el-form-item label="鏈�澶ц疆娆�">
+                          <el-input-number
+                            v-model="form.serviceTaskScheduleVO.maxLoopCount"
+                            :min="0"
+                            :step="1"
+                            placeholder="0琛ㄧず鏃犻檺"
+                          />
+                        </el-form-item>
+                      </el-col>
+                    </el-row>
+                  </div>
+                  <el-row :gutter="20" style="margin-top: 20px">
+                    <el-col :span="12">
+                      <el-form-item label="鍩哄噯鏃堕棿">
+                        <el-radio-group
+                          v-model="form.serviceTaskScheduleVO.scheduleBenchmark"
+                        >
+                          <el-radio :label="0">鑷畾涔�</el-radio>
+                          <el-radio :label="1">鍏ラ櫌鏃堕棿</el-radio>
+                          <el-radio :label="2">鍑洪櫌鏃堕棿</el-radio>
+                          <el-radio :label="3">灏辫瘖鏃堕棿</el-radio>
+                          <el-radio :label="4">鍏ョ粍鏃堕棿</el-radio>
+                        </el-radio-group>
+                      </el-form-item>
+                    </el-col>
+                    <el-col
+                      :span="12"
+                      v-if="form.serviceTaskScheduleVO.scheduleBenchmark == 0"
+                    >
+                      <el-form-item label="鑷畾涔夊熀鍑嗘椂闂�">
+                        <el-date-picker
+                          v-model="
+                            form.serviceTaskScheduleVO
+                              .scheduleBenchmarkCustomTime
+                          "
+                          type="datetime"
+                          placeholder="閫夋嫨鏃ユ湡鏃堕棿"
+                          value-format="yyyy-MM-dd HH:mm:ss"
+                        />
+                      </el-form-item>
+                    </el-col>
+
+                    <el-col :span="12">
+                      <el-form-item label="涓嬫鎵ц鏃堕棿">
+                        <el-date-picker
+                          v-model="form.serviceTaskScheduleVO.nextExecuteTime"
+                          type="datetime"
+                          placeholder="閫夋嫨棣栨鎵ц鏃堕棿"
+                          value-format="yyyy-MM-dd HH:mm:ss"
+                        />
+                      </el-form-item>
+                    </el-col>
+                  </el-row>
+                  <el-row :gutter="20" style="margin-top: 20px">
+                    <el-col :span="12">
+                      <el-form-item label="鍏宠仈绉戝" prop="diseaseDept">
+                        <el-select
+                          v-model="diseaseDept"
+                          style="width: 100%"
+                          clearable
+                          filterable
+                          placeholder="璇烽�夋嫨绉戝锛堝彲閫夛級"
+                          value-key="deptCode"
+                          @change="handleDiseaseDeptChange"
+                        >
+                          <el-option
+                            v-for="item in belongDepts"
+                            :key="item.deptCode"
+                            :label="item.deptName"
+                            :value="item"
+                          ></el-option>
+                        </el-select>
+                        <div v-if="diseaseDept" class="selected-info">
+                          宸查�夋嫨: {{ diseaseDept.deptName }} ({{
+                            diseaseDept.deptCode
+                          }})
+                        </div>
+                      </el-form-item>
+                    </el-col>
+                    <el-col :span="12">
+                      <el-form-item label="鍏宠仈鐥呭尯" prop="diseaseWard">
+                        <el-select
+                          v-model="diseaseWard"
+                          style="width: 100%"
+                          clearable
+                          filterable
+                          placeholder="璇烽�夋嫨鐥呭尯锛堝彲閫夛級"
+                          value-key="districtCode"
+                          @change="handleDiseaseWardChange"
+                        >
+                          <el-option
+                            v-for="item in belongWards"
+                            :key="item.districtCode"
+                            :label="item.districtName"
+                            :value="item"
+                          ></el-option>
+                        </el-select>
+                        <div v-if="diseaseWard" class="selected-info">
+                          宸查�夋嫨: {{ diseaseWard.districtName }} ({{
+                            diseaseWard.districtCode
+                          }})
+                        </div>
+                      </el-form-item>
+                    </el-col>
+                  </el-row>
+                  <el-row>
+                    <div class="xinz-infs">
+                      <el-form-item>
+                        <template #label>
+                          <el-tooltip
+                            class="item"
+                            effect="light"
+                            content="閫夋嫨濂介�傜敤鐤剧梾鍚庯紝鍙互鏂逛究鎮ㄩ�氳繃鐤剧梾璇婃柇鏌ユ壘鍒板搴旂殑鐥呬汉!"
+                            placement="top-start"
+                          >
+                            <i class="el-icon-warning-outline"></i>
+                          </el-tooltip>
+                        </template>
+                        <div style="margin-bottom: 10px">
+                          <el-button
+                            type="warning"
+                            @click="$refs.child.handleAddpatient()"
+                            >娣诲姞鐤剧梾璇婃柇</el-button
+                          >
+                        </div>
+                        <el-tag
+                          v-for="tag in diagglist"
+                          @close="removediagg(tag.icd10code)"
+                          type="warning"
+                          closable
+                          :disable-transitions="false"
+                        >
+                          {{ tag.icdname }}
+                        </el-tag>
+                      </el-form-item>
+                    </div>
+                  </el-row>
+                  <!-- 鏄庣粏鍒楄〃 -->
+                  <el-row :gutter="20" style="margin-top: 20px">
+                    <el-col :span="24">
+                      <el-divider content-position="left"
+                        >浠诲姟鏄庣粏鍒楄〃</el-divider
+                      >
+                      <el-button
+                        type="primary"
+                        size="small"
+                        icon="el-icon-plus"
+                        @click="addDetail"
+                        >娣诲姞鏄庣粏</el-button
+                      >
+                      <el-table
+                        :data="form.serviceTaskScheduleVO.detailList"
+                        border
+                        style="width: 100%; margin-top: 10px"
+                      >
+                        <el-table-column label="搴忓彿" width="80" align="center">
+                          <template slot-scope="scope">{{
+                            scope.row.seq
+                          }}</template>
+                        </el-table-column>
+                        <el-table-column label="闂撮殧澶╂暟" width="120">
+                          <template slot-scope="scope">
+                            <el-input-number
+                              v-model="scope.row.dayOffset"
+                              :min="0"
+                              size="small"
+                              controls-position="right"
+                            />
+                          </template>
+                        </el-table-column>
+                        <el-table-column label="妯℃澘" min-width="200">
+                          <template slot-scope="scope">
+                            <el-select
+                              v-model="scope.row.templateid"
+                              filterable
+                              remote
+                              :remote-method="remoteTemplate"
+                              placeholder="鎼滅储妯℃澘"
+                              size="small"
+                              @change="
+                                handleTemplateSelect(scope.$index, scope.row)
+                              "
+                            >
+                              <el-option
+                                v-for="item in templateOptions"
+                                :key="item.svyid"
+                                :label="item.svyname"
+                                :value="item.svyid"
+                              >
+                                <span style="float: left">{{
+                                  item.svyname
+                                }}</span>
+                                <span
+                                  style="
+                                    float: right;
+                                    color: #8492a6;
+                                    font-size: 12px;
+                                  "
+                                  >{{ item.createBy }}</span
+                                >
+                              </el-option>
+                            </el-select>
+                            <span
+                              style="
+                                margin-left: 5px;
+                                font-size: 12px;
+                                color: #909399;
+                              "
+                              >{{ scope.row.templatename }}</span
+                            >
+                          </template>
+                        </el-table-column>
+                        <el-table-column label="寮�鍦虹櫧" min-width="150">
+                          <template slot-scope="scope">
+                            <el-input
+                              v-model="scope.row.kcb"
+                              size="small"
+                              placeholder="鍙��"
+                            />
+                          </template>
+                        </el-table-column>
+                        <el-table-column label="缁撴潫璇�" min-width="150">
+                          <template slot-scope="scope">
+                            <el-input
+                              v-model="scope.row.jsy"
+                              size="small"
+                              placeholder="鍙��"
+                            />
+                          </template>
+                        </el-table-column>
+                        <el-table-column
+                          label="鎿嶄綔"
+                          width="100"
+                          align="center"
+                        >
+                          <template slot-scope="scope">
+                            <el-button
+                              size="mini"
+                              type="danger"
+                              icon="el-icon-delete"
+                              @click="removeDetail(scope.$index)"
+                            ></el-button>
+                          </template>
+                        </el-table-column>
+                      </el-table>
+                    </el-col>
+                  </el-row>
+                </div>
+                <!-- ===== 浠诲姟缁勭粨鏉� ===== -->
+
                 <el-row>
                   <el-col :span="12"
                     ><el-form-item label="寮�鍦虹櫧" prop="kcb">
@@ -548,11 +850,6 @@
                     </el-table-column>
                     <el-table-column label="鎿嶄綔" align="center">
                       <template slot-scope="scope">
-                        <!-- <el-button
-                          size="mini"
-                          @click="variableEdit(scope.$index, scope.row)"
-                          >缂栬緫</el-button
-                        > -->
                         <el-button
                           size="mini"
                           type="danger"
@@ -576,7 +873,6 @@
           @click="submitForm('ruleForm')"
           >{{ quote ? "绔嬪嵆鍒涘缓" : "纭鏈嶅姟閰嶇疆" }}</el-button
         >
-        <!-- <el-button @click="resetForm('ruleForm')">閲嶇疆</el-button> -->
       </div>
       <!-- 浠诲姟璇︽儏 -->
       <div v-if="Editprogress == 2">
@@ -617,22 +913,7 @@
                         >鏂板</el-button
                       >
                     </el-col>
-
-                    <!-- <el-col :span="1.5">
-                      <el-button
-                        type="danger"
-                        plain
-                        icon="el-icon-delete"
-                        size="medium"
-                        :disabled="multiple"
-                        @click="handleDelete"
-                        >鍒犻櫎</el-button
-                      >
-                    </el-col> -->
-
-                    <!-- <el-col :span="1.5"> </el-col> -->
                   </el-row>
-                  <!-- 閫変腑鎮h�呭垪琛� -->
                   <SFtable
                     @details="detailhz"
                     @handleUpdate="handleUpdate"
@@ -644,13 +925,6 @@
                     :controlxz="false"
                     :typeinfo="2"
                   />
-                  <!-- <pagination
-                    v-show="total > 0"
-                    :total="total"
-                    :page.sync="topqueryParams.pageNum"
-                    :limit.sync="topqueryParams.pageSize"
-                    @pagination="getList"
-                  /> -->
                 </el-row>
               </div>
             </div>
@@ -663,7 +937,6 @@
           @click="submitForm('ruleForm')"
           >{{ quote ? "绔嬪嵆鍒涘缓" : "纭鏈嶅姟閰嶇疆" }}</el-button
         >
-        <!-- <el-button @click="resetForm('ruleForm')">閲嶇疆</el-button> -->
       </div>
     </div>
     <!-- 娣诲姞鎮h�� -->
@@ -677,7 +950,6 @@
       <div class="examine-jic">
         <div class="jic-value">
           <el-row :gutter="20">
-            <!--鐢ㄦ埛鏁版嵁-->
             <el-form
               :model="patientqueryParams"
               ref="queryForm"
@@ -733,7 +1005,6 @@
                 >
               </el-form-item>
             </el-form>
-            <!-- 閫夋嫨鎮h�呭垪琛� -->
             <SFtable
               ref="multipleTable"
               @handleSelectionChange="handleSelectionChange"
@@ -931,21 +1202,6 @@
           >淇濆瓨浣跨敤</el-button
         >
       </span>
-      <!-- <span slot="footer" class="dialog-footer">
-        <el-button
-          v-if="(form.templateid && form.sendState == 1) || !form.templateid"
-          type="primary"
-          @click="Departmenttreatment"
-          >{{ form.templateid ? "鏇挎崲浣跨敤" : "閫夋嫨浣跨敤" }}</el-button
-        >
-        <el-button
-          :type="previewtftype ? 'success' : 'warning'"
-          @click="previewGo"
-          >{{
-            previewtftype ? "鍓嶅線淇敼宸查�夋嫨妯℃澘" : "鏂板淇濆瓨骞跺墠寰�淇敼"
-          }}</el-button
-        >
-      </span> -->
     </el-dialog>
     <el-drawer
       title="闂嵎鍐呭鍒楄〃"
@@ -957,8 +1213,6 @@
       <div class="examine-jic">
         <div class="jic-value">
           <el-row :gutter="20">
-            <!--鐢ㄦ埛鏁版嵁-->
-
             <el-form
               :model="topqueryParams"
               ref="queryForm"
@@ -973,17 +1227,6 @@
                   @keyup.enter.native="handleQuerymb"
                 ></el-input>
               </el-form-item>
-              <!-- <el-form-item label="閫傜敤褰㈠紡" prop="status">
-                <el-select v-model="topqueryParams.topica" placeholder="璇烽�夋嫨">
-                  <el-option
-                    v-for="item in taskoptions"
-                    :key="item.value"
-                    :label="item.label"
-                    :value="item.value"
-                  >
-                  </el-option>
-                </el-select>
-              </el-form-item> -->
               <el-form-item>
                 <el-button
                   type="primary"
@@ -1001,7 +1244,6 @@
               </el-form-item>
             </el-form>
             <el-divider></el-divider>
-            <!-- 閫夋嫨妯℃澘鍒楄〃 -->
             <SFtable
               @selectfn="selectfn"
               :currentList="userList"
@@ -1031,7 +1273,6 @@
     />
   </div>
 </template>
-
 <script>
 import { messagelistpatient } from "@/api/patient/homepage";
 import store from "@/store";
@@ -1056,12 +1297,14 @@
   taskdepthospgetsondel,
   taskdepthospgetsonlist,
   taskdiaggetlist,
+  rwztaskdepthospgetsonlist,
+  rwztaskdiaggetlist,
   taskopergetlist,
 } from "@/api/AiCentre/index";
-import OptionalForm from "@/components/OptionalForm"; //鐤剧梾娣诲姞缁勪欢
-import SFtable from "@/components/SFtable"; //琛ㄦ牸缁勪欢
-import SortCheckbox from "@/components/SortCheckbox"; //琛ㄦ牸缁勪欢
-
+import { listMedication } from "@/api/knowledge/drug";
+import OptionalForm from "@/components/OptionalForm";
+import SFtable from "@/components/SFtable";
+import SortCheckbox from "@/components/SortCheckbox";
 import { MessageBox } from "element-ui";
 
 export default {
@@ -1069,31 +1312,31 @@
   data() {
     return {
       title: "瀹f暀鍐呭鍒楄〃",
-      currenttype: 1, //1瀹f暀2闂ㄨ瘖3鍑洪櫌4澶嶈瘖5浣撴6闂嵎
-      id: "", //
-      previewid: "", //浠诲姟妯℃澘浼犻�抜d
+      currenttype: 1,
+      id: "",
+      previewid: "",
       libName: "",
       templateor: false,
-      submitLoading: false, // 鎺у埗鎸夐挳鍔犺浇鐘舵��
+      submitLoading: false,
       objyl: {},
-      overallCase: [], //閫夋嫨鎮h�呮��
+      overallCase: [],
       allpids: [],
       appraiselist: [],
       optionsclass: [],
       illnesslist: [],
       mode: [],
-      libId: null, //妯℃澘搴撴ā鏉縤d
-      Editprogress: 1, //缂栬緫杩涘害
-      drawermb: false, //閫夋嫨妯℃澘寮圭獥
-      previewtf: false, //棰勮
-      loading: false, // 閬僵灞�
-      patientloading: false, // 閬僵灞�
-      previewtftype: 0, //棰勮鎯呭喌0鏂版ā鏉块瑙�1宸查�夋嫨妯℃澘淇敼
-      dialogVisiblepatient: false, //娣诲姞鎮h�呭脊妗�
-      dialogVisiblepatientjb: false, //娣诲姞鐤剧梾寮规
-      deptcodesWards: [], //绉戝鏁版嵁
-      leavehospitaldistrictcodes: [], //鐥呭尯鏁版嵁
-      illnesscodes: [], //鐤剧梾鏁版嵁
+      libId: null,
+      Editprogress: 1,
+      drawermb: false,
+      previewtf: false,
+      loading: false,
+      patientloading: false,
+      previewtftype: 0,
+      dialogVisiblepatient: false,
+      dialogVisiblepatientjb: false,
+      deptcodesWards: [],
+      leavehospitaldistrictcodes: [],
+      illnesscodes: [],
       radio: 1,
       checkboxlist: [],
       tableLabel: [],
@@ -1115,7 +1358,6 @@
       ],
       props: { multiple: true, value: "deptCode", label: "deptName" },
       propstask: { value: "deptCode", label: "deptName" },
-      // 鎮h�呰〃鍗�
       tableLabelhz: [
         { label: "鍑洪櫌鏃ユ湡", width: "150", prop: "inhosptime" },
         { label: "鎮h��", width: "", prop: "name" },
@@ -1129,7 +1371,6 @@
         { label: "绉戝", width: "240", prop: "dept" },
         { label: "鐥呭尯", width: "240", prop: "leavehospitaldistrictname" },
       ],
-      // 鎮h�呰〃鍗�
       tableLabelhzwb: [
         { label: "鍑洪櫌鏃ユ湡", width: "150", prop: "endtime" },
         { label: "鎮h��", width: "", prop: "name" },
@@ -1144,14 +1385,12 @@
         { label: "绉戝", width: "180", prop: "deptName" },
         { label: "鐥呭尯", width: "150", prop: "leavehospitaldistrictname" },
       ],
-
       tableLabelwj: [
         { label: "闂嵎鏍囬", width: "", prop: "svyname" },
         { label: "闂嵎鎻忚堪", width: "", prop: "description" },
         { label: "淇敼鏃ユ湡", width: "", prop: "updateTime" },
         { label: "鍒涘缓浜�", width: "", prop: "createBy" },
       ],
-      // 鍙橀噺
       tableLabelvariable: [
         { label: "鍙橀噺鍚嶇О", width: "", prop: "variablename" },
         { label: "鍖归厤绗�", width: "", prop: "character" },
@@ -1170,50 +1409,45 @@
         { label: "绾夸笅锛堢焊璐級", value: 10 },
         { label: "绾夸笂锛堢煭淇�/閽夐拤鐨勬枃鏈�侀棶鍗烽摼鎺ワ級", value: 11 },
       ],
-      // 鏃堕棿澶勭悊
-      daytime: [], //鏃ユ湡
-      applydaytime: [], //璁$畻鏃ユ湡
-      diseaseDept: null, // 鐤剧梾鎴栨墜鏈叧鑱斾笅鐨勭瀹わ紙瀛樺偍鏁翠釜瀵硅薄锛�
-      diseaseWard: null, // 鐤剧梾鎴栨墜鏈叧鑱斾笅鐨勭梾鍖猴紙瀛樺偍鏁翠釜瀵硅薄锛�
+      daytime: [],
+      applydaytime: [],
+      diseaseDept: null,
+      diseaseWard: null,
       diseaseDepts: "",
       diseaseWards: "",
-      time1: "", //涓婂崍鏃堕棿娈�
-      time2: "", //涓嬪崍鏃堕棿娈�
-      time3: "", //鏅氫笂鏃堕棿娈�
-      time4: "", //鏅氫笂鏃堕棿娈�
+      time1: "",
+      time2: "",
+      time3: "",
+      time4: "",
       topqueryParams: {
-        pageNum: 1, //
+        pageNum: 1,
         pageSize: 10,
       },
       checkList: "",
       selectedOrder: [],
       deliverytopqueryParams: {
-        pageNum: 1, //
+        pageNum: 1,
         pageSize: 10,
       },
       patientqueryParams: {
-        pageNum: 1, //
+        pageNum: 1,
         pageSize: 10,
         leavehospitaldistrictcodes: [],
         leaveldeptcodes: [],
       },
       topicoptions: [{ children: [{ children: [] }] }],
-      showSearch: true, //
-      total: 0, //
-      sontotal: 0, //
-      patienttotal: 0, //
-      // 閫変腑鏁扮粍
+      showSearch: true,
+      total: 0,
+      sontotal: 0,
+      patienttotal: 0,
       ids: [],
-      // 闈炲崟涓鐢�
       single: true,
-      // 闈炲涓鐢�
       multiple: true,
-      // 鐢ㄦ埛琛ㄦ牸鏁版嵁
-      userList: [], //妯℃澘鍒楄〃
-      multiplechoice: [], //澶氶�夌粨鏋�
-      patientuserList: [], //閫夋嫨鎮h�呭垪琛�
-      sonuserList: [], //閫変腑鎮h�呭垪琛�
-      delvariableList: [], //鍒犻櫎鍙橀噺涓存椂瀛樺偍
+      userList: [],
+      multiplechoice: [],
+      patientuserList: [],
+      sonuserList: [],
+      delvariableList: [],
       longtype: [
         { value: 0, label: "鑷畾涔夊懆鏈�" },
         { value: 1, label: "闀挎湡浠诲姟" },
@@ -1237,7 +1471,7 @@
           fill: "娲惧彂鏃惰嚜鍔ㄥ尮閰�",
           default: true,
         },
-      ], //鍙橀噺鍒楄〃
+      ],
       transitionList: [
         {
           name: "濮撳悕",
@@ -1259,8 +1493,9 @@
         },
       ],
       variableListTime: [],
-      tasktopic: null, //鏂板绫诲瀷
+      tasktopic: null,
       SelectPatientslist: [],
+      orgname: localStorage.getItem("orgname"),
       form: {
         patTaskRelevances: [],
         sendType: 1,
@@ -1273,59 +1508,46 @@
           localStorage.getItem("orgname") +
           "鐨勫尰鎶や汉鍛橈紝涓轰簡鏇村ソ鍦颁簡瑙f偍鐨勫悍澶嶆儏鍐碉紝璇锋偍鎶戒竴鐐瑰疂璐垫椂闂达紝瑙傜湅杩欎唤瀹f暀璧勮銆�",
         jsy: "璇锋偍娉ㄦ剰浼戞伅鍜岃惀鍏伙紝鐢熸椿涓婅鍔抽�哥粨鍚堬紝閫傚綋閿荤偧锛屾垝鐑熼檺閰掞紝淇濇寔蹇冩儏鑸掔晠锛屽畾鏈熷璇娿�傞偅鏈瀹f暀鍐呭灏卞埌杩欓噷锛岀鎮ㄨ韩浣撳仴搴凤紒",
+        // ===== 浠诲姟缁勪富瀵硅薄 =====
+        serviceTaskScheduleVO: {
+          scheduleStyle: 0,
+          scheduleTimeNum: null,
+          scheduleTimeUnit: null,
+          maxLoopCount: 0,
+          currentLoopCount: 0,
+          currentSeq: 0,
+          nextSeq: 0,
+          nextExecuteTime: "",
+          scheduleBenchmark: 0,
+          scheduleBenchmarkCustomTime: "",
+          detailList: [],
+        },
       },
       taskoptions: [
-        {
-          value: "4",
-          label: "鍑洪櫌鐥呬汉",
-        },
-        {
-          value: "1",
-          label: "鍦ㄩ櫌鐥呬汉",
-        },
-        {
-          value: "2",
-          label: "闂ㄨ瘖鐥呬汉",
-        },
-        {
-          value: "3",
-          label: "浣撴鐥呬汉",
-        },
-        {
-          value: "6",
-          label: "闄㈠鎮h��",
-        },
-        {
-          value: "5",
-          label: "鎵嬫湳鐥呬汉",
-        },
+        { value: "4", label: "鍑洪櫌鐥呬汉" },
+        { value: "1", label: "鍦ㄩ櫌鐥呬汉" },
+        { value: "2", label: "闂ㄨ瘖鐥呬汉" },
+        { value: "3", label: "浣撴鐥呬汉" },
+        { value: "6", label: "闄㈠鎮h��" },
+        { value: "5", label: "鎵嬫湳鐥呬汉" },
       ],
       source: [
-        {
-          value: 0,
-          label: "鎵�灞炴偅鑰�",
-        },
-        {
-          value: 1,
-          label: "绉戝鎮h��",
-        },
-        {
-          value: 2,
-          label: "鐥呭尯鎮h��",
-        },
+        { value: 0, label: "鎵�灞炴偅鑰�" },
+        { value: 1, label: "绉戝鎮h��" },
+        { value: 2, label: "鐥呭尯鎮h��" },
       ],
-
       tasktypes: store.getters.tasktypes,
-      // 绉戝/鐥呭尯
       belongWards: [],
       deptlist: [],
       hosplist: [],
       diagglist: [],
       operlist: [],
-      tempDetpRelevanceslist: [], //绉戝鏁版嵁
-      tempDetpRelevanceslistform: [], //绉戝鏁版嵁
-      tempbelongWards: [], //鐥呭尯鏁版嵁
-      tempbelongWardsform: [], //鐥呭尯鏁版嵁
+      medicalCodes: [],
+      medicalOptions: [],
+      tempDetpRelevanceslist: [],
+      tempDetpRelevanceslistform: [],
+      tempbelongWards: [],
+      tempbelongWardsform: [],
       rules: {
         taskName: [
           { required: true, message: "浠诲姟鍚嶇О涓嶈兘涓虹┖", trigger: "blur" },
@@ -1339,23 +1561,20 @@
         sendType: [
           { required: true, message: "鍙戦�佽缃笉鑳戒负绌�", trigger: "blur" },
         ],
-
         longTask: [
           { required: true, message: "璇烽�夋嫨鎵ц鍛ㄦ湡", trigger: "blur" },
         ],
-        // leavehospitaldistrictcode: [
-        //   { required: true, message: "閫傜敤鐥呭尯涓嶈兘涓虹┖", trigger: "blur" },
-        // ],
       },
       belongDepts: [],
-      // 绉戝闄㈠尯鏌ヨ鍏ュ弬
       queryParamsdept: {},
       quote: false,
       serviceType: null,
+      // 妯℃澘鎼滅储
+      templateOptions: [],
+      templateLoading: false,
     };
   },
   components: { SFtable, OptionalForm, SortCheckbox },
-
   created() {
     this.appraiselist = store.getters.appraiselist;
     this.belongWards = store.getters.belongWards;
@@ -1381,20 +1600,17 @@
   },
   computed: {
     displayedTags() {
-      // 杩斿洖鍓�10涓猼ag
       return this.illnesslist.slice(0, 10);
     },
     hasMore() {
-      // 鍒ゆ柇鏄惁鏈夋洿澶氱殑tag
       return this.illnesslist.length > 10;
     },
     remaining() {
-      // 璁$畻鍓╀綑鐨則ag鏁伴噺
       return this.illnesslist.length - 10;
     },
   },
   methods: {
-    // 鍙橀噺杞崲瀵硅薄杞暟缁�
+    // ---------- 宸ュ叿鏂规硶 ----------
     convertFormat1ToFormat2(data) {
       let result = [];
       for (let key in data) {
@@ -1407,7 +1623,6 @@
       }
       return result;
     },
-    // 鏁扮粍杞璞�
     convertFormat2ToFormat1(data) {
       let result = {};
       data.forEach((item) => {
@@ -1417,7 +1632,15 @@
       });
       return result;
     },
-    // 鑾峰彇褰撳墠绫诲瀷
+    daysBetween(endDate) {
+      if (!endDate) return "";
+      const now = new Date();
+      const end = new Date(endDate);
+      const diff = Math.floor((now - end) / (1000 * 60 * 60 * 24));
+      return diff > 0 ? diff : 0;
+    },
+
+    // ---------- 鏁版嵁鍔犺浇 ----------
     Acquisitiontype() {
       let queryParams = {
         pageNum: this.topqueryParams.pageNum,
@@ -1429,23 +1652,10 @@
       this.tableLabel = this.tableLabelwj;
       if (this.form.serviceType == 1) {
         this.checkboxlist = [
-          {
-            value: "1",
-            label: "浜哄伐",
-          },
-
-          {
-            value: "2",
-            label: "绾歌川",
-          },
-          {
-            value: "4",
-            label: "鐭俊",
-          },
-          {
-            value: "5",
-            label: "寰俊鍏紬鍙�",
-          },
+          { value: "1", label: "浜哄伐" },
+          { value: "2", label: "绾歌川" },
+          { value: "4", label: "鐭俊" },
+          { value: "5", label: "寰俊鍏紬鍙�" },
           { label: "寰俊灏忕▼搴�", value: "6" },
         ];
       } else if (
@@ -1454,31 +1664,11 @@
         this.form.serviceType == 15
       ) {
         this.checkboxlist = [
-          {
-            value: "1",
-            label: "浜哄伐",
-          },
-          {
-            value: "3",
-            label: "鏅鸿兘璇煶",
-          },
-          {
-            value: "4",
-            label: "鐭俊",
-          },
-          {
-            value: "5",
-            label: "寰俊鍏紬鍙�",
-          },
-          {
-            value: "6",
-            label: "寰俊灏忕▼搴�",
-          },
-
-          // {
-          //   value: "8",
-          //   label: "鏅鸿兘鏈哄櫒浜�",
-          // },
+          { value: "1", label: "浜哄伐" },
+          { value: "3", label: "鏅鸿兘璇煶" },
+          { value: "4", label: "鐭俊" },
+          { value: "5", label: "寰俊鍏紬鍙�" },
+          { value: "6", label: "寰俊灏忕▼搴�" },
         ];
       } else if (
         this.form.serviceType == 7 ||
@@ -1490,34 +1680,13 @@
         this.form.serviceType == 9
       ) {
         this.checkboxlist = [
-          {
-            value: "1",
-            label: "浜哄伐",
-          },
-          {
-            value: "2",
-            label: "绾歌川",
-          },
-          {
-            value: "3",
-            label: "鏅鸿兘璇煶",
-          },
-          {
-            value: "4",
-            label: "鐭俊",
-          },
-          {
-            value: "5",
-            label: "寰俊鍏紬鍙�",
-          },
-          {
-            value: "6",
-            label: "寰俊灏忕▼搴�",
-          },
-          {
-            value: "7",
-            label: "鏈悗闅忚",
-          },
+          { value: "1", label: "浜哄伐" },
+          { value: "2", label: "绾歌川" },
+          { value: "3", label: "鏅鸿兘璇煶" },
+          { value: "4", label: "鐭俊" },
+          { value: "5", label: "寰俊鍏紬鍙�" },
+          { value: "6", label: "寰俊灏忕▼搴�" },
+          { value: "7", label: "鏈悗闅忚" },
         ];
       } else if (
         this.form.serviceType == 2 ||
@@ -1529,31 +1698,11 @@
         this.form.serviceType == 4
       ) {
         this.checkboxlist = [
-          {
-            value: "1",
-            label: "浜哄伐",
-          },
-          {
-            value: "3",
-            label: "鏅鸿兘璇煶",
-          },
-          {
-            value: "4",
-            label: "鐭俊",
-          },
-          {
-            value: "5",
-            label: "寰俊鍏紬鍙�",
-          },
-          {
-            value: "6",
-            label: "寰俊灏忕▼搴�",
-          },
-
-          // {
-          //   value: "8",
-          //   label: "鏅鸿兘鏈哄櫒浜�",
-          // },
+          { value: "1", label: "浜哄伐" },
+          { value: "3", label: "鏅鸿兘璇煶" },
+          { value: "4", label: "鐭俊" },
+          { value: "5", label: "寰俊鍏紬鍙�" },
+          { value: "6", label: "寰俊灏忕▼搴�" },
         ];
       }
       getQtemplatelist(this.topqueryParams).then((response) => {
@@ -1561,211 +1710,268 @@
         this.total = response.total;
       });
     },
+    getQtemplateclassify() {
+      getQtemplateclassify({}).then((res) => {
+        this.optionsclass = res.rows;
+      });
+    },
+    getillnesslist() {
+      getillnesslist({ pageNum: 1, pageSize: 1000 }).then((res) => {
+        this.donorchargeList = res.rows;
+      });
+    },
+    getillness(id) {
+      if (id) {
+        getillness({ outid: id, type: 5 }).then((res) => {
+          this.illnesslist = res.rows;
+          this.illnesslist.forEach((item) => {
+            item.icdname = item.icd10name;
+          });
+        });
+      }
+    },
+    Getdetails() {
+      this.form = {
+        patTaskRelevances: [],
+        sendType: 1,
+        sendDay: 5,
+        templatename: "",
+        templateid: null,
+        libtemplateid: null,
+        kcb:
+          "浜茬埍鐨勬偅鑰�/瀹跺睘锛屾垜浠槸" +
+          localStorage.getItem("orgname") +
+          "鐨勫尰鎶や汉鍛橈紝涓轰簡鏇村ソ鍦颁簡瑙f偍鐨勫悍澶嶆儏鍐碉紝璇锋偍鎶戒竴鐐瑰疂璐垫椂闂达紝瀹屾垚杩欎唤闅忚闂嵎銆�",
+        jsy: "璇锋偍娉ㄦ剰浼戞伅鍜岃惀鍏伙紝鐢熸椿涓婅鍔抽�哥粨鍚堬紝閫傚綋閿荤偧锛屾垝鐑熼檺閰掞紝淇濇寔蹇冩儏鑸掔晠锛屽畾鏈熷璇娿�傞偅鏈鍥炶灏卞埌杩欓噷锛岀鎮ㄨ韩浣撳仴搴凤紒",
+        serviceTaskScheduleVO: {
+          scheduleStyle: 0,
+          scheduleTimeNum: null,
+          scheduleTimeUnit: null,
+          maxLoopCount: 0,
+          currentLoopCount: 0,
+          currentSeq: 0,
+          nextSeq: 0,
+          nextExecuteTime: "",
+          scheduleBenchmark: 0,
+          scheduleBenchmarkCustomTime: "",
+          detailList: [],
+        },
+      };
+      this.questionList = [];
+      if (this.id) {
+        Questionnairetaskgetson({ taskid: this.id }).then((res) => {
+          if (res.code == 200) {
+            this.form = res.data;
+            // 濡傛灉杩斿洖浜� serviceTaskScheduleVO锛岃В鏋愭槑缁嗕腑鐨� content
+            if (
+              this.form.serviceTaskScheduleVO &&
+              this.form.serviceTaskScheduleVO.detailList
+            ) {
+              this.form.serviceTaskScheduleVO.detailList.forEach((item) => {
+                if (item.content) {
+                  try {
+                    const contentObj = JSON.parse(item.content);
+                    item.kcb = contentObj.kcb || "";
+                    item.jsy = contentObj.jsy || "";
+                    item.textParam = contentObj.text_param || {};
+                  } catch (e) {
+                    item.kcb = "";
+                    item.jsy = "";
+                    item.textParam = {};
+                  }
+                } else {
+                  item.kcb = "";
+                  item.jsy = "";
+                  item.textParam = {};
+                }
+              });
+            } else {
+              // 鑻ュ悗鍙版湭杩斿洖锛屽垯鍒濆鍖栦负绌�
+              this.form.serviceTaskScheduleVO = {
+                scheduleStyle: 0,
+                scheduleTimeNum: null,
+                scheduleTimeUnit: null,
+                maxLoopCount: 0,
+                currentLoopCount: 0,
+                currentSeq: 0,
+                nextSeq: 0,
+                nextExecuteTime: "",
+                scheduleBenchmark: 0,
+                scheduleBenchmarkCustomTime: "",
+                detailList: [],
+              };
+            }
+            this.form.serviceType = this.serviceType;
+            this.form.patTaskRelevances = this.form.patTaskRelevances
+              ? this.form.patTaskRelevances
+              : [];
+            this.diseaseDept = {
+              deptCode: this.form.deptcode,
+              deptName: this.form.deptname,
+            };
+            this.diseaseWard = {
+              districtCode: this.form.leavehospitaldistrictcode,
+              districtName: this.form.leavehospitaldistrictname,
+            };
+            // 鑽搧鍏宠仈鍥炴樉
+            if (this.form.medicalCode) {
+              this.medicalCodes = this.form.medicalCode
+                .split(",")
+                .filter(Boolean);
+              // 鍔犺浇宸查�夎嵂鍝佺殑閫夐」鍒楄〃锛堢敤浜庡睍绀� label锛�
+              const codes = this.form.medicalCode;
+              listMedication({
+                itemCode: codes,
+                pageNum: 1,
+                pageSize: 200,
+              }).then((res) => {
+                this.medicalOptions = res.rows || [];
+              });
+            }
+            this.overallCase = this.form.patTaskRelevances.concat();
+            this.checkList = this.form.preachform
+              ? this.form.preachform.split(",")
+              : "";
+            this.selectedOrder = this.form.preachformList || [];
+            this.overallCase.forEach((item) => {
+              if (item.endtime) {
+                item.endDay = this.daysBetween(item.endtime);
+              }
+            });
+            if (this.form.showDate)
+              this.daytime = this.form.showDate.split(",");
+            if (this.form.showTimeMorn) {
+              if (this.form.sendType == 3) {
+                this.time4 = this.form.showTimeMorn;
+              } else {
+                this.time1 = this.form.showTimeMorn.split(",");
+              }
+            }
+            if (this.form.taskid) {
+              this.listDept();
+            }
+            if (this.form.showTimeNoon)
+              this.time2 = this.form.showTimeNoon.split(",");
+            if (this.form.showTimeNight)
+              this.time3 = this.form.showTimeNight.split(",");
+            let filteredArray = this.convertFormat1ToFormat2(
+              this.form.textParam || {}
+            );
+            this.variableList = this.transitionList.concat(filteredArray);
+          } else {
+            this.$modal.msgError(res.code);
+          }
+          if (this.newadd) {
+            this.neWaddfn();
+          }
+        });
+      }
+    },
+    neWaddfn() {
+      this.id = null;
+      this.form.taskName = "";
+      this.form.taskid = null;
+      this.overallCase = [];
+      this.form.patTaskRelevances = [];
+      this.daytime = [];
+      this.applydaytime = [];
+      this.time1 = "";
+      this.time2 = "";
+      this.time3 = "";
+      this.time4 = "";
+      // 閲嶇疆浠诲姟缁�
+      this.form.serviceTaskScheduleVO = {
+        scheduleStyle: 0,
+        scheduleTimeNum: null,
+        scheduleTimeUnit: null,
+        maxLoopCount: 0,
+        currentLoopCount: 0,
+        currentSeq: 0,
+        nextSeq: 0,
+        nextExecuteTime: "",
+        scheduleBenchmark: 0,
+        scheduleBenchmarkCustomTime: "",
+        detailList: [],
+      };
+    },
+
+    // ---------- 浠诲姟缁勬槑缁嗘搷浣� ----------
+    addDetail() {
+      const detailList = this.form.serviceTaskScheduleVO.detailList;
+      const seq = detailList.length + 1;
+      detailList.push({
+        seq: seq,
+        dayOffset: 0,
+        templateid: null,
+        libtemplateid: null,
+        templatename: "",
+        content: "",
+        kcb: "",
+        jsy: "",
+        textParam: {},
+      });
+    },
+    removeDetail(index) {
+      this.form.serviceTaskScheduleVO.detailList.splice(index, 1);
+      this.form.serviceTaskScheduleVO.detailList.forEach((item, idx) => {
+        item.seq = idx + 1;
+      });
+    },
+    handleTemplateSelect(index, row) {
+      const selected = this.templateOptions.find(
+        (item) => item.svyid === row.templateid
+      );
+      if (selected) {
+        row.templatename = selected.svyname;
+        row.libtemplateid = selected.svyid; // 妯℃澘搴揑D
+      } else {
+        row.templatename = "";
+        row.libtemplateid = null;
+      }
+    },
+    remoteTemplate(query) {
+      if (query !== "") {
+        this.templateLoading = true;
+        getQtemplatelist({ svyname: query, pageNum: 1, pageSize: 20 })
+          .then((res) => {
+            this.templateOptions = res.rows;
+            this.templateLoading = false;
+          })
+          .catch(() => {
+            this.templateLoading = false;
+          });
+      } else {
+        this.templateOptions = [];
+      }
+    },
+
+    // ---------- 姝ラ瀵艰埅 ----------
     nextstep() {
       this.$refs["form"].validate((valid) => {
         if (valid) {
-          if (this.Editprogress <= 3) {
-            return this.Editprogress++;
-          }
+          if (this.Editprogress <= 3) this.Editprogress++;
         } else {
           this.$modal.msgError("琛ㄥ崟鍐呭鏈畬鍠勶紝璇锋鏌�");
         }
       });
     },
-    // 淇濆瓨
-    submitForm(formName) {
-      console.log(this.submitLoading, "1");
-
-      if (this.submitLoading) {
-        return;
-      }
-
-      // 寮�鍚姞杞界姸鎬�
-      this.submitLoading = true;
-      console.log(this.submitLoading);
-
-      try {
-        // 鏃堕棿澶勭悊
-        if (this.time4 && this.form.sendType == 3) {
-          this.form.showTimeMorn = this.time4;
-        }
-        this.form.sendTimeslot = [
-          {
-            begantime: this.time4,
-            endtime: "",
-            xh: 1,
-          },
-        ];
-
-        // 鏍规嵁搴旂敤绫诲瀷娓呯悊瀛楁
-        if (this.form.appltype == 1) {
-          this.leavehospitaldistrictcodes = [];
-          this.form.oplevelcode = null;
-          this.illnesscodes = [];
-        } else if (this.form.appltype == 2) {
-          this.deptcodesWards = [];
-          this.form.oplevelcode = null;
-          this.illnesscodes = [];
-        } else if (this.form.appltype == 3) {
-          this.deptcodesWards = [];
-          this.leavehospitaldistrictcodes = [];
-          this.form.oplevelcode = null;
-        } else if (this.form.appltype == 4) {
-          this.deptcodesWards = [];
-          this.illnesscodes = [];
-          this.leavehospitaldistrictcodes = [];
-        }
-
-        // 鏍¢獙锛氭湇鍔$被鍨�
-        if (this.checkList) {
-          this.form.preachform = this.checkList.join(",");
-          this.form.preachformList = this.selectedOrder;
-        } else {
-          this.$modal.msgError("璇烽�夋嫨鏈嶅姟绫诲瀷");
-          this.submitLoading = false;
-          return;
-        }
-
-        // 鏍¢獙锛氱柧鐥呭叧鑱旂瀹ゆ垨鐥呭尯
-        if (this.form.appltype == 3 || this.form.appltype == 4) {
-          const hasDept = this.diseaseDept?.deptCode;
-          const hasWard = this.diseaseWard?.districtCode;
-
-          if (!hasDept && !hasWard) {
-            this.$modal.msgError("闇�鍏宠仈绉戝鎴栫梾鍖�");
-            this.submitLoading = false;
-            return;
-          }
-        }
-
-        // 鏍¢獙锛氫换鍔″叧鑱旀潯浠�
-        const hasCondition =
-          this.deptcodesWards[0] ||
-          this.leavehospitaldistrictcodes[0] ||
-          this.diagglist[0] ||
-          this.form.oplevelcode ||
-          this.form.longTask == 2 ||
-          this.serviceType == 3;
-
-        if (!hasCondition) {
-          this.$modal.msgError("璇烽�夋嫨浠诲姟鍏宠仈鏉′欢");
-          this.submitLoading = false;
-          return;
-        }
-
-        // 鏍¢獙锛氭ā鏉�
-        if (!this.form.templatename && !this.templateor) {
-          this.$modal.msgError("鏈�夋嫨妯℃澘");
-          this.submitLoading = false;
-          return;
-        }
-
-        // 鏍¢獙锛氭椂闂翠俊鎭�
-        const isValidTime =
-          (this.form.sendType == 1 && this.time1) ||
-          this.form.sendType == 2 ||
-          (this.form.sendType == 3 && this.time4) ||
-          this.form.longTask;
-
-        if (!isValidTime) {
-          this.submitLoading = false;
-          this.$modal.msgError("鏃堕棿淇℃伅缂哄け");
-          return;
-        }
-
-        // 澶勭悊鏂囨湰鍙傛暟
-        const filteredArray = this.variableList.filter(
-          (item) =>
-            item.name !== "濮撳悕" && item.name !== "鐢佃瘽" && item.name !== "鍦板潃"
-        );
-        this.form.textParam = this.convertFormat2ToFormat1(filteredArray);
-
-        // 璁剧疆鎿嶄綔绫诲瀷
-        if (this.form.taskid) {
-          this.form.isoperation = 2;
-        } else {
-          this.form.isoperation = 1;
-        }
-
-        // 璁剧疆绫诲瀷
-        if (!this.form.type) {
-          this.form.type = this.$route.query.type;
-        }
-
-        // 缁勮鎻愪氦鏁版嵁
-        this.form.serviceType = this.serviceType;
-        this.form.deptcode = this.deptcodesWards.join(",");
-        this.form.leavehospitaldistrictcode =
-          this.leavehospitaldistrictcodes.join(",");
-
-        // 鐤剧梾鍏宠仈鐨勭瀹�/鐥呭尯
-        if (this.form.appltype == 3) {
-          if (this.diseaseDept) {
-            this.form.deptcode = this.diseaseDept.deptCode;
-            this.form.deptname = this.diseaseDept.deptName;
-          }
-
-          if (this.diseaseWard) {
-            this.form.leavehospitaldistrictcode = this.diseaseWard.districtCode;
-            this.form.leavehospitaldistrictname = this.diseaseWard.districtName;
-          }
-        }
-
-        // 璇婃柇淇℃伅
-        this.form.icd10code = this.diagglist
-          .map((item) => item.icdcode)
-          .join(",");
-        this.form.icd10name = this.diagglist
-          .map((item) => item.icdname)
-          .join(",");
-
-        // 鎻愪氦鎺ュ彛
-        Editsingletask(this.form)
-          .then((res) => {
-            if (res.code == 200) {
-              if (this.form.taskid) {
-                this.$modal.msgSuccess("淇敼鎴愬姛");
-              } else {
-                this.$modal.msgSuccess("鏂板鎴愬姛");
-              }
-              this.$router.push({
-                path: "/followvisit/tasklist",
-                query: { tasktopic: this.form.serviceType },
-              });
-            } else {
-              // 鉁� 鎺ュ彛杩斿洖閿欒鐮佹椂鐨勫鐞�
-              this.$modal.msgError(res.msg || "鎿嶄綔澶辫触");
-            }
-          })
-          .catch((error) => {
-            // 鉁� 鎹曡幏鎺ュ彛璇锋眰寮傚父
-            console.error("鎻愪氦澶辫触:", error);
-            this.$modal.msgError(error.message || "缃戠粶寮傚父锛岃绋嶅悗閲嶈瘯");
-          })
-          .finally(() => {
-            // 鉁� 鏃犺鎴愬姛鎴栧け璐ワ紝鏈�缁堥兘鍏抽棴鍔犺浇鐘舵��
-            this.submitLoading = false;
-          });
-      } catch (error) {
-        // 鉁� 鎹曡幏鍚屾浠g爜寮傚父
-        console.error("琛ㄥ崟鎻愪氦寮傚父:", error);
-        this.$modal.msgError(error.message || "琛ㄥ崟鎻愪氦寮傚父");
-        this.submitLoading = false;
-      }
+    laststep() {
+      this.Editprogress--;
     },
+    resetForm(formName) {
+      this.$refs[formName].resetFields();
+    },
+
+    // ---------- 鍏宠仈閫夋嫨 ----------
     handleDiseaseDeptChange(dept) {
-      // 褰撻�夋嫨绉戝鏃讹紝瀛樺偍鏁翠釜绉戝瀵硅薄
       this.diseaseDept = dept;
     },
-
     handleDiseaseWardChange(ward) {
-      // 褰撻�夋嫨鐥呭尯鏃讹紝瀛樺偍鏁翠釜鐥呭尯瀵硅薄
       this.diseaseWard = ward;
     },
-    // ----------------------琛ㄦ牸瀛愮粍浠朵簨浠�
-    // 閫夋嫨棰勮
+
+    // ---------- 妯℃澘鐩稿叧 ----------
     selectfn(row, type) {
-      // 妯℃澘鎯呭喌涓嬭幏鍙栨ā鏉夸俊鎭�
       if (type == 1) {
         this.libName = row.svyname;
         this.libId = row.svyid;
@@ -1776,13 +1982,12 @@
             if (this.form.longTask) {
               this.objyl.longTemp = 1;
             }
-
             this.tempDetpRelevanceslist = [];
             this.tempbelongWards = [];
-            this.objyl.suitway = this.objyl.suitway.split(",");
+            this.objyl.suitway = this.objyl.suitway
+              ? this.objyl.suitway.split(",")
+              : [];
             this.questionList = res.rows[0].svyTemplateLibScripts;
-            console.log(this.questionList, "this.questionList");
-
             this.questionList.forEach((item) => {
               item.qremark = [];
             });
@@ -1792,23 +1997,15 @@
         });
         this.previewid = row.svyid;
         this.Variablehandling(row.svyTemplateLibScripts, 1);
-      } else if (type == 2) {
-      } else if (type == 3) {
       }
     },
-    // 棰勮
     previewfnmb() {
-      // taskgetQtemplateobj({ id: this.form.templateid });
-
       getTaskQuestioncomit(this.form.templateid).then((res) => {
         if (res.code == 200) {
-          console.log(res, "棰勮鏁版嵁");
           this.objyl = res.data;
           if (this.objyl.suitway)
             this.objyl.suitway = this.objyl.suitway.split(",");
-
           this.getillness(this.form.libtemplateid);
-
           this.previewtf = true;
           taskgetQtemplateobj({ id: this.form.templateid }).then((res) => {
             if (res.code == 200) {
@@ -1826,103 +2023,188 @@
         }
       });
     },
-    checkSelectionChange(selectedValues, selectedOrder) {
-      this.selectedOrder = selectedValues;
-      console.log("褰撳墠閫変腑:", selectedValues);
-      console.log("閫変腑椤哄簭:", selectedOrder);
-    },
-    // 鏈嶅姟褰㈠紡閫夊彇
-    handleCheckedCitiesChange(row) {
-      console.log(row, "鏈嶅姟");
-      this.foncheckList = this.checkboxlist.filter((obj) =>
-        row.includes(obj.value)
-      );
-    },
-    // 鏈嶅姟褰㈠紡鍒犻櫎
-    handleClosetag(tag) {
-      console.log(tag, "tag");
-      console.log(this.foncheckList, "foncheckList");
-      this.checkList = this.checkList.filter((item) => item != tag.value);
-      this.foncheckList = this.foncheckList.filter(
-        (obj) => obj.value !== tag.value
-      );
-    },
-    getillness(id) {
-      if (id) {
-        getillness({ outid: id, type: 5 }).then((res) => {
-          this.illnesslist = res.rows;
-          this.illnesslist.forEach((item) => {
-            item.icdname = item.icd10name;
-          });
-        });
-      }
-    },
-    getillnesslist() {
-      getillnesslist({
-        pageNum: 1,
-        pageSize: 1000,
-      }).then((res) => {
-        this.donorchargeList = res.rows;
-      });
-      // getbaseopera({
-      //   pageNum: 1,
-      //   pageSize: 1000,
-      // }).then((res) => {
-      //   this.baseoperaList = res.rows;
-      // });
-    },
-    // 鎵嬫湳鏌ヨ
-    remoteopcode(name) {
-      // if (name) {
-      //   getbaseopera({
-      //     pageNum: 1,
-      //     pageSize: 1000,
-      //     opdesc: name,
-      //   }).then((res) => {
-      //     this.baseoperaList = res.rows;
-      //   });
-      // }
-    },
-    // 鐤剧梾鏌ヨ
-    remotedonor(name) {
-      // if (name) {
-      //   getbaseopera({
-      //     pageNum: 1,
-      //     pageSize: 1000,
-      //     opdesc: name,
-      //   }).then((res) => {
-      //     this.baseoperaList = res.rows;
-      //   });
-      // }
-    },
-    // 澶勭悊闂灞傚彉閲�
     Variablehandling(arr, type) {
       let Variablist = [];
       if (type == 1) {
-        // 寰幆闂
         arr.forEach((res) => {
-          // 寰幆閫夐」
-          JSON.parse(res.otherdata).forEach((item) => {
-            if (item.default != 1) {
-              Variablist.push({
-                value: item.variate,
-                fill: "",
-                name: item.variatename,
-              });
-            }
-          });
+          if (res.otherdata) {
+            JSON.parse(res.otherdata).forEach((item) => {
+              if (item.default != 1) {
+                Variablist.push({
+                  value: item.variate,
+                  fill: "",
+                  name: item.variatename,
+                });
+              }
+            });
+          }
         });
         const Aarr = Variablist.filter(
           (obj, index, self) =>
             index ===
             self.findIndex((t) => t.name === obj.name && t.value === obj.value)
         );
-
         this.variableList = this.transitionList.concat(Aarr);
-        // this.form.textParam = this.convertFormat2ToFormat1(this.variableList);
       }
     },
-    // 瀛愪换鍔′簩绾у脊妗�
+    variableDelete(index, row) {
+      this.variableList.splice(index, 1);
+      row.isoperation = 3;
+      this.delvariableList.push(row);
+    },
+
+    // ---------- 绉戝/鐥呭尯/鐤剧梾/鎵嬫湳 鎿嶄綔 ----------
+    listDept() {
+      this.leavehospitaldistrictcodes = [];
+      this.deptcodesWards = [];
+      // this.queryParamsdept.taskId = this.form.taskid;
+      this.queryParamsdept.taskId = this.form.taskid;
+
+      if (this.form.appltype == 5) {
+        rwztaskdepthospgetsonlist(this.queryParamsdept).then((res) => {
+          if (res.code == 200) {
+            let arr = res.rows;
+            arr.forEach((item) => {
+              if (item.deptType == 1) {
+                this.deptlist.push(item);
+                this.deptcodesWards.push(item.deptCode);
+              } else if (item.deptType == 2) {
+                this.hosplist.push(item);
+                this.leavehospitaldistrictcodes.push(item.deptCode);
+              }
+            });
+          }
+        });
+        rwztaskdiaggetlist(this.queryParamsdept).then((res) => {
+          if (res.code == 200) {
+            let arr = res.rows;
+            arr.forEach((item) => {
+              if (localStorage.getItem("orgname") == "鍗楀崕澶у闄勫睘绗竴鍖婚櫌") {
+                item.icdname = item.icd10name;
+                this.diagglist.push(item);
+              } else {
+                this.diagglist.push(item);
+              }
+              this.illnesscodes.push(item.icd10code);
+            });
+          }
+        });
+      } else {
+        taskdepthospgetsonlist(this.queryParamsdept).then((res) => {
+          if (res.code == 200) {
+            let arr = res.rows;
+            arr.forEach((item) => {
+              if (item.deptType == 1) {
+                this.deptlist.push(item);
+                this.deptcodesWards.push(item.deptCode);
+              } else if (item.deptType == 2) {
+                this.hosplist.push(item);
+                this.leavehospitaldistrictcodes.push(item.deptCode);
+              }
+            });
+          }
+        });
+        taskdiaggetlist(this.queryParamsdept).then((res) => {
+          if (res.code == 200) {
+            let arr = res.rows;
+            arr.forEach((item) => {
+              if (localStorage.getItem("orgname") == "鍗楀崕澶у闄勫睘绗竴鍖婚櫌") {
+                item.icdname = item.icd10name;
+                this.diagglist.push(item);
+              } else {
+                getillnesslist({ icdname: item.icd10name }).then((res) => {
+                  item.icdname = res.rows[0].icdname;
+                  this.diagglist.push(item);
+                });
+              }
+              this.illnesscodes.push(item.icd10code);
+            });
+          }
+        });
+      }
+
+      taskopergetlist(this.queryParamsdept).then((res) => {
+        if (res.code == 200) {
+          let arr = res.rows;
+          arr.forEach((item) => {
+            this.operlist.push(item);
+            this.operationcodes.push(item.opcode);
+          });
+        }
+      });
+    },
+    removetag(row) {
+      let result = this.deptlist
+        .filter((item) => item.deptCode == row)
+        .map((item) => item.id);
+      if (result.length) {
+        taskdepthospgetsondel(result).then((res) => {
+          if (res.code) this.$modal.msgSuccess("鍒犻櫎鎴愬姛");
+        });
+      }
+    },
+    removehpsp(row) {
+      let result = this.hosplist
+        .filter((item) => item.deptCode == row)
+        .map((item) => item.id);
+      if (result.length) {
+        taskdepthospgetsondel(result).then((res) => {
+          if (res.code) this.$modal.msgSuccess("鍒犻櫎鎴愬姛");
+        });
+      }
+    },
+    removeopera(row) {
+      let result = this.operlist
+        .filter((item) => item.opcode == row)
+        .map((item) => item.id);
+      if (result.length) {
+        taskoperhospgetsondel(result).then((res) => {
+          if (res.code) this.$modal.msgSuccess("鍒犻櫎鎴愬姛");
+        });
+      }
+    },
+    removediagg(row) {
+      // 浠诲姟缁勶細鏈湴鍒犻櫎鍗冲彲锛屽悗绔繚瀛樻椂缁熶竴鏇存柊
+      if (this.form.appltype == 5) {
+        this.diagglist = this.diagglist.filter((item) => item.icd10code != row);
+        return;
+      }
+      // 鏅�氱柧鐥呭叧鑱旓細璋冨悗绔帴鍙i�愭潯鍒犻櫎
+      let result = this.diagglist
+        .filter((item) => item.icd10code == row)
+        .map((item) => item.id);
+      if (result.length) {
+        taskdiaghospgetsondel(result).then((res) => {
+          if (res.code) {
+            this.diagglist = this.diagglist.filter(
+              (item) => item.icd10code != row
+            );
+            this.$modal.msgSuccess("鍒犻櫎鎴愬姛");
+          }
+        });
+      }
+    },
+    remoteopcode(name) {
+      // 鍗犱綅
+    },
+    // 杩滅▼鎼滅储鑽搧
+    remoteSearchMedical(query) {
+      if (!query) {
+        this.medicalOptions = [];
+        return;
+      }
+      listMedication({ itemName: query, pageNum: 1, pageSize: 20 }).then(
+        (res) => {
+          this.medicalOptions = res.rows || [];
+        }
+      );
+    },
+    // 鍒犻櫎宸查�夎嵂鍝�
+    removeMedical(code) {
+      this.medicalCodes = this.medicalCodes.filter((c) => c !== code);
+    },
+
+    // ---------- 鎮h�呴�夋嫨 ----------
     handleAddpatient(row) {
       this.allpids = [];
       this.overallCase.forEach((item) => {
@@ -1930,7 +2212,6 @@
       });
       if (this.patientqueryParams.allhosp == 4) {
         this.tableLabelhz = [
-          // { label: "鍏ラ櫌鏃ユ湡", width: "170", prop: "starttime" },
           { label: "鍑洪櫌鏃ユ湡", width: "150", prop: "endtime" },
           { label: "鎮h��", width: "", prop: "name" },
           { label: "鎮h�呰瘖鏂�", width: "", prop: "leavediagname" },
@@ -1980,8 +2261,6 @@
       } else {
         this.patientqueryParams.pids = null;
       }
-      // 鏉ユ簮鍒ゆ柇
-
       if (this.patientqueryParams.allhosp == 4) {
         this.patientqueryParams.hospitaldistrictcodes = [];
         this.patientqueryParams.deptcodes = [];
@@ -2006,16 +2285,9 @@
       });
       this.dialogVisiblepatient = true;
     },
-    handleUpdate() {},
-    handleDelete() {},
-    handleExport() {},
-
-    // 閫夋嫨鎮h�呰〃鏁版嵁
     handleSelectionChange(selection) {
       this.SelectPatientslist = structuredClone(selection);
       this.multiple = !selection.length;
-
-      // 璧嬪�肩粰鏁翠綋閫変腑鏁扮粍
       this.SelectPatientslist.forEach((item) => {
         const isExist = this.overallCase.find((obj) => obj.name == item.name);
         if (!isExist) {
@@ -2029,46 +2301,37 @@
           item.admindate = item.inhosptime;
           item.diagname = item.leavediagname;
           item.sfzh = item.idcardno;
-          if (this.patientqueryParams.allhosp == 6) {
-            item.patfrom = 1;
-          }
-          if (this.patientqueryParams.allhosp == 1) {
+          if (this.patientqueryParams.allhosp == 6) item.patfrom = 1;
+          if (this.patientqueryParams.allhosp == 1)
             item.visittime = item.endtime;
-          } else if (this.patientqueryParams.allhosp == 4) {
+          else if (this.patientqueryParams.allhosp == 4)
             item.visittime = item.starttime;
-          } else if (this.patientqueryParams.allhosp == 2) {
+          else if (this.patientqueryParams.allhosp == 2)
             item.visittime = item.admitdate;
-          }
           this.overallCase.push(item);
           this.form.patTaskRelevances.push(item);
         }
       });
     },
-    // 鍒囨崲椤靛悗鎭㈠閫変腑
     Restorecheck() {
       const allid = this.overallCase.map((item) => item.patid);
-      const overlap = this.patientuserList.filter((value) => {
-        return allid.includes(value.patid);
-      });
-      // 淇濇寔ids鍜屽綋鍓嶉〉闈㈢殑鍚屾鎬�
+      const overlap = this.patientuserList.filter((value) =>
+        allid.includes(value.patid)
+      );
       this.SelectPatientslist = overlap;
       this.toggleSelection(overlap);
     },
-    // 鎸傝浇閫夋嫨鐘舵��
     toggleSelection(rows) {
       if (rows) {
-        this.decision = true;
         this.$nextTick(() => {
           rows.forEach((row) => {
             this.$refs.multipleTable.toggleRowSelection(row, true);
           });
-          this.decision = false;
         });
       } else {
         this.$refs.multipleTable.clearSelection();
       }
     },
-    // 鍒犻櫎閫変腑鎮h��
     detailhz(row, info) {
       this.$modal
         .confirm('鏄惁纭鍒犻櫎鎮h��"' + row.name + '"鐨勬湇鍔¢」锛�')
@@ -2084,14 +2347,9 @@
           this.$modal.msgSuccess("鍒犻櫎鎴愬姛");
         });
     },
-    getList() {},
     handleQuery() {
-      // 鑾峰彇澶栭儴鎮h��
-
       if (this.patientqueryParams.allhosp == 6) {
         this.Externallist();
-        console.log();
-
         return;
       }
       if (
@@ -2125,7 +2383,6 @@
         this.patientqueryParams.leaveldeptcodes = null;
       this.handleAddpatient();
     },
-    // 鑾峰彇澶栭儴鎮h�呭鍏ュ垪琛�
     Externallist() {
       this.tableLabelhz = [
         { label: "鎮h��", width: "", prop: "name" },
@@ -2136,7 +2393,6 @@
         { label: "鍑洪櫌澶╂暟", width: "", prop: "endDay" },
       ];
       this.patientqueryParams.pageSize = 1000;
-
       Externallist(this.patientqueryParams).then((response) => {
         this.patientuserList = response.rows;
         this.patientuserList.forEach((item) => {
@@ -2149,16 +2405,15 @@
         this.loading = false;
       });
     },
-
     resetQuerymb() {
       this.topqueryParams = { svyname: "" };
       this.handleQuerymb();
     },
     resetQuery() {
       this.patientqueryParams = {
-        pageNum: 1, //
+        pageNum: 1,
         pageSize: 10,
-        topica: 1, //0鍏ㄩ儴1绉戝2鐥呭尯
+        topica: 1,
         leavehospitaldistrictcodes: [],
         leaveldeptcodes: [],
       };
@@ -2173,235 +2428,20 @@
     handleClosehz() {
       this.dialogVisiblepatient = false;
     },
-    // 涓婁竴姝�
-    laststep() {
-      this.Editprogress--;
-    },
-    // 鎻愪氦琛ㄥ崟
-    resetForm(formName) {
-      this.$refs[formName].resetFields();
-    },
-    // 棰勮妯℃澘
-    PreviewTemplate() {},
-    Acknowledgereference() {
-      this.quote = true;
-    },
-    // 鑾峰彇璇︽儏
-    Getdetails() {
-      this.form = {
-        patTaskRelevances: [],
-        sendType: 1,
-        sendDay: 5,
-        templatename: "",
-        templateid: null,
-        libtemplateid: null,
-        kcb:
-          "浜茬埍鐨勬偅鑰�/瀹跺睘锛屾垜浠槸" +
-          localStorage.getItem("orgname") +
-          "鐨勫尰鎶や汉鍛橈紝涓轰簡鏇村ソ鍦颁簡瑙f偍鐨勫悍澶嶆儏鍐碉紝璇锋偍鎶戒竴鐐瑰疂璐垫椂闂达紝瀹屾垚杩欎唤闅忚闂嵎銆�",
-        jsy: "璇锋偍娉ㄦ剰浼戞伅鍜岃惀鍏伙紝鐢熸椿涓婅鍔抽�哥粨鍚堬紝閫傚綋閿荤偧锛屾垝鐑熼檺閰掞紝淇濇寔蹇冩儏鑸掔晠锛屽畾鏈熷璇娿�傞偅鏈鍥炶灏卞埌杩欓噷锛岀鎮ㄨ韩浣撳仴搴凤紒",
-      };
-
-      this.questionList = [];
-      if (this.id) {
-        Questionnairetaskgetson({ taskid: this.id }).then((res) => {
-          let filteredArray = "";
-          if (res.code == 200) {
-            this.form = res.data;
-            this.form.serviceType = this.serviceType;
-            this.form.patTaskRelevances = this.form.patTaskRelevances
-              ? this.form.patTaskRelevances
-              : [];
-            this.diseaseDept = {
-              deptCode: this.form.deptcode,
-              deptName: this.form.deptname,
-            };
-            this.diseaseWard = {
-              districtCode: this.form.leavehospitaldistrictcode,
-              districtName: this.form.leavehospitaldistrictname,
-            };
-            this.overallCase = this.form.patTaskRelevances.concat();
-            this.checkList = this.form.preachform.split(",");
-            this.selectedOrder = this.form.preachformList;
-            this.overallCase.forEach((item) => {
-              if (item.endtime) {
-                item.endDay = this.daysBetween(item.endtime);
-              }
-            });
-            if (this.form.showDate)
-              this.daytime = this.form.showDate.split(",");
-            if (this.form.showTimeMorn) {
-              if (this.form.sendType == 3) {
-                this.time4 = this.form.showTimeMorn;
-              } else {
-                this.time1 = this.form.showTimeMorn.split(",");
-              }
-            }
-            // 鑾峰彇浠诲姟绉戝
-            if (this.form.taskid) {
-              this.listDept();
-            }
-            if (this.form.showTimeNoon)
-              this.time2 = this.form.showTimeNoon.split(",");
-            if (this.form.showTimeNight)
-              this.time3 = this.form.showTimeNight.split(",");
-            filteredArray = this.convertFormat1ToFormat2(this.form.textParam);
-            this.variableList = this.transitionList.concat(filteredArray);
-          } else {
-            this.$modal.msgError(res.code);
-          }
-
-          if (this.newadd) {
-            this.neWaddfn();
-          }
-        });
-      }
-    },
-    // 渚濈収鏂板鏃跺鐞�
-    neWaddfn() {
-      this.id = null;
-      this.form.taskName = "";
-      this.form.taskid = null;
-      this.overallCase = [];
-      this.form.patTaskRelevances = [];
-      this.daytime = []; //鏃ユ湡
-      this.applydaytime = []; //璁$畻鏃ユ湡
-      this.time1 = ""; //涓婂崍鏃堕棿娈�
-      this.time2 = ""; //涓嬪崍鏃堕棿娈�
-      this.time3 = ""; //鏅氫笂鏃堕棿娈�
-      this.time4 = ""; //鏅氫笂鏃堕棿娈�
-    },
-    // 鑾峰彇鍚勭被
-    listDept() {
-      this.leavehospitaldistrictcodes = [];
-      this.deptcodesWards = [];
-      this.queryParamsdept.taskId = this.form.taskid;
-      taskdepthospgetsonlist(this.queryParamsdept).then((res) => {
-        if (res.code == 200) {
-          let arr = res.rows;
-          arr.forEach((item) => {
-            if (item.deptType == 1) {
-              this.deptlist.push(item);
-              this.deptcodesWards.push(item.deptCode);
-            } else if (item.deptType == 2) {
-              this.hosplist.push(item);
-              this.leavehospitaldistrictcodes.push(item.deptCode);
-            }
-          });
-        }
-      });
-      taskdiaggetlist(this.queryParamsdept).then((res) => {
-        if (res.code == 200) {
-          let arr = res.rows;
-          arr.forEach((item) => {
-            if (localStorage.getItem("orgname") == "鍗楀崕澶у闄勫睘绗竴鍖婚櫌") {
-              item.icdname = item.icd10name;
-              this.diagglist.push(item);
-            } else {
-              getillnesslist({
-                icdname: item.icd10name,
-              }).then((res) => {
-                item.icdname = res.rows[0].icdname;
-                this.diagglist.push(item);
-              });
-            }
-            this.illnesscodes.push(item.icd10code);
-          });
-        }
-      });
-      taskopergetlist(this.queryParamsdept).then((res) => {
-        if (res.code == 200) {
-          let arr = res.rows;
-          arr.forEach((item) => {
-            this.operlist.push(item);
-            this.operationcodes.push(item.opcode);
-          });
-        }
-      });
-    },
-    // 浠诲姟绉戝鍒犻櫎瑙﹀彂
-    removetag(row) {
-      let result = this.deptlist
-        .filter((item) => item.deptCode == row)
-        .map((item) => item.id);
-
-      if (result.length) {
-        taskdepthospgetsondel(result).then((res) => {
-          if (res.code) {
-            this.$modal.msgSuccess("鍒犻櫎鎴愬姛");
-          }
-        });
-      }
-    },
-    // 闄㈠尯鍒犻櫎鍒犻櫎瑙﹀彂
-    removehpsp(row) {
-      let result = this.hosplist
-        .filter((item) => item.deptCode == row)
-        .map((item) => item.id);
-      if (result.length) {
-        taskdepthospgetsondel(result).then((res) => {
-          if (res.code) {
-            this.$modal.msgSuccess("鍒犻櫎鎴愬姛");
-          }
-        });
-      }
-    },
-    // 鎵嬫湳鍒犻櫎瑙﹀彂
-    removeopera(row) {
-      let result = this.operlist
-        .filter((item) => item.opcode == row)
-        .map((item) => item.id);
-      if (result.length) {
-        taskoperhospgetsondel(result).then((res) => {
-          if (res.code) {
-            this.$modal.msgSuccess("鍒犻櫎鎴愬姛");
-          }
-        });
-      }
-    },
-    // 鐤剧梾鍒犻櫎瑙﹀彂
-    removediagg(row) {
-      console.log(row, "row");
-      console.log(this.diagglist, "this.diagglist");
-
-      let result = this.diagglist
-        .filter((item) => item.icd10code == row)
-        .map((item) => item.id);
-      if (result.length) {
-        taskdiaghospgetsondel(result).then((res) => {
-          if (res.code) {
-            this.diagglist = this.diagglist.filter(
-              (item) => item.icd10code != row
-            );
-            this.$modal.msgSuccess("鍒犻櫎鎴愬姛");
-          }
-        });
-      }
-    },
-
-    getQtemplateclassify() {
-      getQtemplateclassify({}).then((res) => {
-        this.optionsclass = res.rows;
-      });
-    },
-    // 鏂板娲鹃�佹偅鑰�
     AddDispatchpatients() {
-      // this.SelectPatientslist.forEach((item) => {
-      //   item.isoperation = 1;
-      // });
-      // this.form.patTaskRelevances.push(...this.SelectPatientslist);
-      // this.overallCase.push(...this.SelectPatientslist);
       this.dialogVisiblepatient = false;
     },
+    handleUpdate() {},
+    handleDelete() {},
+    handleExport() {},
 
-    variableDelete(index, row) {
-      this.variableList.splice(index, 1);
-      row.isoperation = 3;
-      this.delvariableList.push(row);
+    // ---------- 鏈嶅姟褰㈠紡鎺掑簭 ----------
+    checkSelectionChange(selectedValues, selectedOrder) {
+      this.selectedOrder = selectedValues;
     },
 
-    // 鏃堕棿----------
-    changeTime(row) {
+    // ---------- 鏃堕棿澶勭悊 ----------
+    changeTime() {
       this.processingTime();
     },
     Totaldate(row) {
@@ -2417,27 +2457,19 @@
     getDates(startDate, endDate) {
       const dates = [];
       let currentDate = new Date(startDate);
-
       while (currentDate <= endDate) {
         dates.push(this.$moment(currentDate).format("YYYY-MM-DD"));
         currentDate.setDate(currentDate.getDate() + 1);
       }
-
       return dates;
     },
-    // 鏃堕棿鏈�缁堝鐞嗘柟娉�
     processingTime() {
       const combinedData = [];
       let serialnumber = 1;
-      if (this.time3[0]) {
-        serialnumber = 3;
-      } else if (this.time2[0]) {
-        serialnumber = 2;
-      } else if (this.time1[0]) {
-        serialnumber = 1;
-      } else {
-        return;
-      }
+      if (this.time3 && this.time3[0]) serialnumber = 3;
+      else if (this.time2 && this.time2[0]) serialnumber = 2;
+      else if (this.time1 && this.time1[0]) serialnumber = 1;
+      else return;
 
       for (let i = 0; i < this.applydaytime.length; i++) {
         combinedData.push({
@@ -2461,31 +2493,28 @@
         }
       }
       this.form.sendTimeslot = combinedData;
-      // 灞曠ず鏁版嵁涓存椂瀛樺偍鏃ユ湡銆佹棭銆佷腑銆佹櫄
-
       this.form.showDate = this.daytime.join(",");
       if (this.time1) this.form.showTimeMorn = this.time1.join(",");
       if (this.time2) this.form.showTimeNoon = this.time2.join(",");
       if (this.time3) this.form.showTimeNight = this.time3.join(",");
     },
-    // 鏌ョ湅妯℃澘
+
+    // ---------- 妯℃澘淇濆瓨涓庢浛鎹� ----------
     previewGo() {
       this.$modal.confirm("鏄惁鍓嶅線淇敼浠诲姟妯℃澘璇︾粏鍐呭锛�").then(() => {
-        this.drawermb = false; //閫夋嫨妯℃澘寮圭獥
-        this.previewtf = false; //棰勮
+        this.drawermb = false;
+        this.previewtf = false;
         this.$router.push({
           path: "/knowledge/tpuconfigurat/",
           query: { id: this.previewid, task: true, data: this.form },
         });
       });
     },
-    // 淇濆瓨/鏇存柊浠诲姟妯℃澘
     previewFn() {
       if (Array.isArray(this.objyl.suitway)) {
         this.objyl.suitway = this.objyl.suitway.join(",");
       }
       this.objyl.templateid = this.objyl.svyid;
-
       this.objyl.isoperation = 1;
       this.objyl.taskid = this.form.taskid;
       this.objyl.svyTemplateLibScripts.forEach((item) => {
@@ -2497,7 +2526,6 @@
         deleteTaskQuestioncomit(this.objyl.id).then((res) => {
           if (res.code == 200) {
             this.objyl.id = null;
-
             TaskQuestioncomit(this.objyl).then((response) => {
               this.previewtf = false;
               this.form.libtemplateid = this.objyl.svyid;
@@ -2519,7 +2547,6 @@
         });
       }
     },
-    // 淇濆瓨绉戝/鐥呭尯
     putbelongDepts(id) {
       this.tempDetpRelevanceslistform.forEach((item) => {
         item.tempid = id;
@@ -2540,8 +2567,6 @@
         }
       });
     },
-
-    // 绉戝澶勭悊
     Departmenttreatment() {
       if (!this.form.taskid) {
         this.templateor = true;
@@ -2583,10 +2608,211 @@
         }, 1000);
       }
     },
+
+    // ---------- 鎻愪氦琛ㄥ崟 ----------
+    submitForm(formName) {
+      if (this.submitLoading) return;
+      this.submitLoading = true;
+
+      try {
+        if (this.time4 && this.form.sendType == 3) {
+          this.form.showTimeMorn = this.time4;
+        }
+        this.form.sendTimeslot = [
+          {
+            begantime: this.time4,
+            endtime: "",
+            xh: 1,
+          },
+        ];
+
+        if (this.form.appltype == 1) {
+          this.leavehospitaldistrictcodes = [];
+          this.form.oplevelcode = null;
+          this.illnesscodes = [];
+        } else if (this.form.appltype == 2) {
+          this.deptcodesWards = [];
+          this.form.oplevelcode = null;
+          this.illnesscodes = [];
+        } else if (this.form.appltype == 3) {
+          this.deptcodesWards = [];
+          this.leavehospitaldistrictcodes = [];
+          this.form.oplevelcode = null;
+        } else if (this.form.appltype == 4) {
+          this.deptcodesWards = [];
+          this.illnesscodes = [];
+          this.leavehospitaldistrictcodes = [];
+        } else if (this.form.appltype == 6) {
+          this.deptcodesWards = [];
+          this.leavehospitaldistrictcodes = [];
+          this.illnesscodes = [];
+          this.form.oplevelcode = null;
+        }
+
+        // 鏈嶅姟褰㈠紡鏍¢獙
+        if (this.checkList) {
+          this.form.preachform = this.checkList.join(",");
+          this.form.preachformList = this.selectedOrder;
+        } else {
+          this.$modal.msgError("璇烽�夋嫨鏈嶅姟绫诲瀷");
+          this.submitLoading = false;
+          return;
+        }
+
+        // 浠诲姟鍏宠仈鏉′欢鏍¢獙锛堜换鍔$粍璺宠繃寮哄埗鍏宠仈锛�
+        const hasCondition =
+          this.deptcodesWards[0] ||
+          this.leavehospitaldistrictcodes[0] ||
+          this.diagglist[0] ||
+          this.form.oplevelcode ||
+          this.medicalCodes[0] ||
+          this.form.longTask == 2 ||
+          this.serviceType == 3 ||
+          this.form.appltype == 5;
+
+        if (!hasCondition) {
+          this.$modal.msgError("璇烽�夋嫨浠诲姟鍏宠仈鏉′欢");
+          this.submitLoading = false;
+          return;
+        }
+
+        if (!this.form.templatename && !this.templateor) {
+          this.$modal.msgError("鏈�夋嫨妯℃澘");
+          this.submitLoading = false;
+          return;
+        }
+
+        const isValidTime =
+          (this.form.sendType == 1 && this.time1) ||
+          this.form.sendType == 2 ||
+          (this.form.sendType == 3 && this.time4) ||
+          this.form.longTask;
+        if (!isValidTime) {
+          this.submitLoading = false;
+          this.$modal.msgError("鏃堕棿淇℃伅缂哄け");
+          return;
+        }
+
+        // 澶勭悊鍙橀噺
+        const filteredArray = this.variableList.filter(
+          (item) =>
+            item.name !== "濮撳悕" && item.name !== "鐢佃瘽" && item.name !== "鍦板潃"
+        );
+        this.form.textParam = this.convertFormat2ToFormat1(filteredArray);
+
+        // 澶勭悊浠诲姟缁勬槑缁嗙殑 content
+        if (this.form.appltype == 5 && this.form.serviceTaskScheduleVO) {
+          this.form.serviceTaskScheduleVO.detailList.forEach((item) => {
+            const contentObj = {
+              kcb: item.kcb || "",
+              jsy: item.jsy || "",
+              text_param: item.textParam || {},
+            };
+            item.content = JSON.stringify(contentObj);
+            delete item.kcb;
+            delete item.jsy;
+            delete item.textParam;
+          });
+          // 灏嗕富瀵硅薄鏀惧叆 form 鎻愪氦锛堝凡瀛樺湪锛�
+        }
+
+        if (this.form.taskid) {
+          this.form.isoperation = 2;
+        } else {
+          this.form.isoperation = 1;
+        }
+        if (!this.form.type) {
+          this.form.type = this.$route.query.type;
+        }
+        console.log(this.diseaseDept, this.diseaseWard);
+
+        if (this.form.appltype == 1 || this.form.appltype == 2) {
+          this.form.deptcode = this.deptcodesWards.join(",");
+          this.form.leavehospitaldistrictcode =
+            this.leavehospitaldistrictcodes.join(",");
+        } else {
+          if (this.diseaseDept) {
+            this.form.deptcode = this.diseaseDept.deptCode;
+            this.form.deptname = this.diseaseDept.deptName;
+          }
+          if (this.diseaseWard) {
+            this.form.leavehospitaldistrictcode = this.diseaseWard.districtCode;
+            this.form.leavehospitaldistrictname = this.diseaseWard.districtName;
+          }
+        }
+
+        // 鑽搧鍏宠仈锛氱粍瑁呴�楀彿鍒嗛殧鐨勭紪鐮�/鍚嶇О/鍘傚
+        if (this.form.appltype == 6) {
+          const selectedMeds = this.medicalOptions.filter((m) =>
+            this.medicalCodes.includes(m.itemCode)
+          );
+          this.form.medicalCode = this.medicalCodes.join(",");
+          this.form.medicalName = selectedMeds.map((m) => m.itemName).join(",");
+          this.form.medicalCompany = selectedMeds
+            .map((m) => m.manufacturerName)
+            .join(",");
+        }
+
+        this.form.serviceType = this.serviceType;
+
+        this.form.icd10code = this.diagglist
+          .map((item) => item.icdcode)
+          .join(",");
+        this.form.icd10name = this.diagglist
+          .map((item) => item.icdname)
+          .join(",");
+        // 鐤剧梾/鎵嬫湳鍏宠仈鐨勭瀹�/鐥呭尯鏍¢獙
+        if (this.form.appltype == 3 || this.form.appltype == 4) {
+          const hasDept = this.diseaseDept?.deptCode;
+          const hasWard = this.diseaseWard?.districtCode;
+          if (!hasDept && !hasWard) {
+            this.$modal.msgError("闇�鍏宠仈绉戝鎴栫梾鍖�");
+            this.submitLoading = false;
+            return;
+          }
+
+          this.form.deptcode = hasDept;
+          this.form.leavehospitaldistrictcode = hasWard;
+        }
+        // 浠诲姟缁勭殑鏁版嵁澶勭悊
+        if (this.form.appltype == 5) {
+          this.form.serviceTaskScheduleVO.icd10codes = this.form.icd10code;
+          this.form.serviceTaskScheduleVO.wardCodes =
+            this.form.leavehospitaldistrictcode;
+          this.form.serviceTaskScheduleVO.deptCodes = this.form.deptcode;
+        }
+        Editsingletask(this.form)
+          .then((res) => {
+            if (res.code == 200) {
+              if (this.form.taskid) {
+                this.$modal.msgSuccess("淇敼鎴愬姛");
+              } else {
+                this.$modal.msgSuccess("鏂板鎴愬姛");
+              }
+              this.$router.push({
+                path: "/followvisit/tasklist",
+                query: { tasktopic: this.form.serviceType },
+              });
+            } else {
+              this.$modal.msgError(res.msg || "鎿嶄綔澶辫触");
+            }
+          })
+          .catch((error) => {
+            console.error("鎻愪氦澶辫触:", error);
+            this.$modal.msgError(error.message || "缃戠粶寮傚父锛岃绋嶅悗閲嶈瘯");
+          })
+          .finally(() => {
+            this.submitLoading = false;
+          });
+      } catch (error) {
+        console.error("琛ㄥ崟鎻愪氦寮傚父:", error);
+        this.$modal.msgError(error.message || "琛ㄥ崟鎻愪氦寮傚父");
+        this.submitLoading = false;
+      }
+    },
   },
 };
 </script>
-
 <style lang="scss" scoped>
 .Questionnairemanagement {
 }
@@ -2597,7 +2823,6 @@
 
 .sidecolumn {
   width: 100%;
-  // min-height: 12vh;
   margin: 20px;
   margin-bottom: 0;
   padding: 30px;
@@ -2608,11 +2833,8 @@
 }
 
 .leftvlue {
-  //   display: flex;
-  //   flex: 1;
   width: 100%;
   margin-top: 20px;
-  //   margin: 20px;
   padding: 30px;
   background: #ffff;
   border: 1px solid #dcdfe6;
@@ -2631,7 +2853,6 @@
     margin-bottom: 10px;
     display: flex;
 
-    // justify-content: space-between;
     .Add-details {
       font-size: 18px;
       color: #02a7f0;
@@ -2681,32 +2902,11 @@
   }
 }
 
-// .leftvlue-jbxx {
-//   margin-bottom: 50px;
-//   font-size: 20px;
-//   span {
-//     position: absolute;
-//     right: 80px;
-//   }
-//   .demo-cascader {
-//     margin-right: 20px;
-//   }
-//   .PreviewTemplate {
-//     color: #02a7f0;
-//     cursor: pointer;
-//     font-size: 20px;
-//     margin: 0 20px;
-//   }
-// }
 .preview-left {
   margin: 20px;
-  //   margin: 20px;
   padding: 30px;
   background: #ffff;
 
-  // border: 1px solid #dcdfe6;
-  // -webkit-box-shadow: 0 2px 4px 0 rgba(0, 0, 0, 0.12),
-  //   0 0 6px 0 rgba(0, 0, 0, 0.04);
   .scriptTopic-dev {
     margin-bottom: 25px;
     font-size: 20px !important;
@@ -2765,9 +2965,6 @@
   margin-bottom: 10px;
 }
 
-// ::v-deep.el-input--medium {
-//   font-size: 24px !important;
-// }
 ::v-deep.ruleFormaa.el-select {
   display: inline-block;
   position: relative;
@@ -2784,9 +2981,6 @@
   height: 22px;
 }
 
-// ::v-deep.topic-dev.el-radio__label {
-//   font-size: 24px;
-// }
 ::v-deep.el-radio-group {
   span {
     font-size: 18px;
diff --git a/src/views/patient/propaganda/particty copy.vue b/src/views/patient/propaganda/particty copy.vue
deleted file mode 100644
index 0bfc80c..0000000
--- a/src/views/patient/propaganda/particty copy.vue
+++ /dev/null
@@ -1,1437 +0,0 @@
-<template>
-  <div class="Questionnairemanagement">
-    <!-- 涓婁晶鏍� -->
-    <div class="sidecolumn">
-      <div>
-        <el-steps simple :active="Editprogress">
-          <el-step
-            icon="el-icon-edit"
-            title="鍩虹淇℃伅"
-            description="閫夋嫨妯℃澘銆佸舰寮忕瓑鍩虹淇℃伅"
-          ></el-step>
-          <el-step
-            icon="el-icon-user"
-            title="浠诲姟涓讳綋"
-            description="鍦ㄦ湰閮ㄩ�夋嫨鏈嶅姟鎮h��"
-          ></el-step>
-        </el-steps>
-      </div>
-    </div>
-    <!-- 涓嬩晶鏁版嵁 -->
-    <div class="leftvlue" style="margin: 0 20px">
-      <!-- 鍩烘湰淇℃伅 -->
-      <div v-if="Editprogress == 1">
-        <el-alert title="閫夋嫨妯℃澘銆佸舰寮忕瓑鍩虹淇℃伅" type="success" effect="dark">
-        </el-alert>
-        <div class="leftvlue-jbxx">
-          <!-- 鍩虹淇℃伅 -->
-          <div class="examine-jic">
-            <div class="headline">
-              <div>鍩虹淇℃伅</div>
-            </div>
-            <div class="jic-value">
-              <el-form ref="form" :model="form" label-width="105px">
-                <el-row :gutter="20">
-                  <el-col :span="12"
-                    ><el-form-item label="浠诲姟鍚嶇О">
-                      <el-input
-                        style="width: 220px"
-                        v-model="form.taskName"
-                        placeholder="璇疯緭鍏ヤ换鍔″悕绉�"
-                      /> </el-form-item
-                  ></el-col>
-                  <el-col :span="8"
-                    ><el-form-item label="妯℃澘鍚嶇О">
-                      <el-input
-                        style="width: 220px"
-                        :disabled="true"
-                        v-model="form.templatename"
-                        placeholder="鐐瑰嚮鍙充晶閫夋嫨"
-                      /> </el-form-item
-                  ></el-col>
-                  <el-col :span="4">
-                    <el-button
-                      type="primary"
-                      icon="el-icon-edit"
-                      @click="drawermb = true"
-                      circle
-                    ></el-button>
-                  </el-col>
-                </el-row>
-
-                <el-form-item label="浠诲姟鎻忚堪">
-                  <el-input
-                    type="textarea"
-                    v-model="form.taskDesc"
-                    placeholder="璇疯緭鍏ヤ换鍔℃弿杩�"
-                  />
-                </el-form-item>
-                <el-form-item label="鍙戦�佽缃細">
-                  <el-radio-group v-model="form.sendType">
-                    <el-radio :label="1">鏃堕棿娈靛彂閫�</el-radio>
-                    <el-radio :label="3">鏃堕棿鐐瑰彂閫�</el-radio>
-                    <el-radio :label="2">鍗冲埢鍙戦��</el-radio>
-                  </el-radio-group>
-                </el-form-item>
-                <el-form-item label="鍙戦�佹棩鏈燂細" v-if="form.sendType == 1">
-                  <el-date-picker
-                    v-model="daytime"
-                    @change="changeTimeday"
-                    type="daterange"
-                    range-separator="鑷�"
-                    start-placeholder="寮�濮嬫棩鏈�"
-                    end-placeholder="缁撴潫鏃ユ湡"
-                    value-format="yyyy-MM-dd"
-                  >
-                  </el-date-picker>
-                </el-form-item>
-
-                <el-form-item label="鍙戦�佹椂闂寸偣锛�" v-if="form.sendType == 3">
-                  <div style="display: flex">
-                    <div style="margin-right: 10px">
-                      <el-date-picker
-                        v-model="time4"
-                        value-format="yyyy-MM-dd HH:mm:ss"
-                        @change="Totaldate"
-                        type="datetime"
-                        placeholder="閫夋嫨鏃ユ湡鏃堕棿"
-                      >
-                      </el-date-picker>
-                    </div>
-                  </div>
-                </el-form-item>
-
-                <el-form-item label="鍙戦�佹椂闂存锛�" v-if="form.sendType == 1">
-                  <div style="display: flex">
-                    <div style="margin-right: 10px">
-                      <span style="font-size: 18px; margin-right: 10px"
-                        >鏃堕棿娈典竴</span
-                      >
-                      <el-time-picker
-                        is-range
-                        arrow-control
-                        @change="changeTime"
-                        v-model="time1"
-                        range-separator="鑷�"
-                        start-placeholder="寮�濮嬫椂闂�"
-                        end-placeholder="缁撴潫鏃堕棿"
-                        placeholder="閫夋嫨鏃堕棿鑼冨洿"
-                        value-format="HH:mm:ss"
-                      >
-                      </el-time-picker>
-                    </div>
-                    <div style="margin-right: 10px">
-                      <span style="font-size: 18px; margin-right: 10px"
-                        >鏃堕棿娈典簩</span
-                      >
-                      <el-time-picker
-                        is-range
-                        arrow-control
-                        @change="changeTime"
-                        v-model="time2"
-                        range-separator="鑷�"
-                        start-placeholder="寮�濮嬫椂闂�"
-                        end-placeholder="缁撴潫鏃堕棿"
-                        placeholder="閫夋嫨鏃堕棿鑼冨洿"
-                        value-format="HH:mm:ss"
-                      >
-                      </el-time-picker>
-                    </div>
-                    <div style="margin-right: 10px">
-                      <span style="font-size: 18px; margin-right: 10px"
-                        >鏃堕棿娈典笁</span
-                      >
-                      <el-time-picker
-                        is-range
-                        arrow-control
-                        @change="changeTime"
-                        v-model="time3"
-                        range-separator="鑷�"
-                        start-placeholder="寮�濮嬫椂闂�"
-                        end-placeholder="缁撴潫鏃堕棿"
-                        placeholder="閫夋嫨鏃堕棿鑼冨洿"
-                        value-format="HH:mm:ss"
-                      >
-                      </el-time-picker>
-                    </div>
-                  </div>
-                </el-form-item>
-                <el-form-item label="鏈嶅姟褰㈠紡">
-                  <el-checkbox-group v-model="checkList">
-                    <el-checkbox
-                      v-for="(item, index) in checkboxlist"
-                      :key="index"
-                      :label="item.value"
-                    >
-                      {{ item.label }}</el-checkbox
-                    >
-                  </el-checkbox-group>
-                </el-form-item>
-              </el-form>
-            </div>
-          </div>
-          <div class="examine-jic">
-            <div class="headline">
-              <div>鍙橀噺鍖归厤閲忓弬</div>
-            </div>
-            <div class="examine-jic">
-              <div class="jic-value">
-                <el-row :gutter="20">
-                  <el-table :data="variableList" style="width: 100%">
-                    <el-table-column
-                      prop="name"
-                      align="center"
-                      label="鍙橀噺鍚嶇О"
-                    >
-                    </el-table-column>
-                    <el-table-column prop="value" align="center" label="鍖归厤绗�">
-                    </el-table-column>
-                    <el-table-column label="鏇挎崲鍊�" align="center">
-                      <template slot-scope="scope">
-                        <el-input
-                          :disabled="scope.row.default"
-                          v-model="scope.row.fill"
-                          placeholder="璇疯緭鍏ュ唴瀹�"
-                        ></el-input>
-                      </template>
-                    </el-table-column>
-                    <el-table-column label="鎿嶄綔" align="center">
-                      <template slot-scope="scope">
-                        <!-- <el-button
-                          size="mini"
-                          @click="variableEdit(scope.$index, scope.row)"
-                          >缂栬緫</el-button
-                        > -->
-                        <el-button
-                          size="mini"
-                          type="danger"
-                          @click="variableDelete(scope.$index, scope.row)"
-                          >鍒犻櫎</el-button
-                        >
-                      </template>
-                    </el-table-column>
-                  </el-table>
-                </el-row>
-              </div>
-            </div>
-          </div>
-        </div>
-        <el-button type="success" @click="nextstep('ruleForm')">{{
-          quote ? "绔嬪嵆鍒涘缓" : "浠诲姟璇︽儏閰嶇疆"
-        }}</el-button>
-        <el-button @click="resetForm('ruleForm')">閲嶇疆</el-button>
-      </div>
-
-      <!-- 浠诲姟璇︽儏 -->
-      <div v-if="Editprogress == 2">
-        <el-alert title="鍦ㄦ湰闃舵閫夋嫨闅忚鐥呬汉" type="success" effect="dark">
-        </el-alert>
-        <div class="leftvlue-jbxx">
-          <div class="examine-jic">
-            <div class="headline">
-              <div>鎮h�呭垪琛�</div>
-            </div>
-            <div class="examine-jic">
-              <div class="jic-value">
-                <el-row :gutter="20">
-                  <!--鐢ㄦ埛鏁版嵁-->
-
-                  <el-row :gutter="10" class="mb8">
-                    <el-col :span="1.5">
-                      <el-select
-                        v-model="patientqueryParams.allhosp"
-                        placeholder="璇烽�夋嫨鏂板绫诲瀷"
-                      >
-                        <el-option
-                          v-for="item in taskoptions"
-                          :key="item.value"
-                          :label="item.label"
-                          :value="item.value"
-                        >
-                        </el-option>
-                      </el-select>
-                    </el-col>
-                    <el-col :span="1.5">
-                      <el-button
-                        type="primary"
-                        plain
-                        icon="el-icon-plus"
-                        size="medium"
-                        :disabled="!patientqueryParams.allhosp"
-                        @click="handleAddpatient"
-                        >鏂板</el-button
-                      >
-                    </el-col>
-
-                    <el-col :span="1.5">
-                      <el-button
-                        type="danger"
-                        plain
-                        icon="el-icon-delete"
-                        size="medium"
-                        :disabled="multiple"
-                        @click="handleDelete"
-                        >鍒犻櫎</el-button
-                      >
-                    </el-col>
-
-                    <!-- <el-col :span="1.5"> </el-col> -->
-                  </el-row>
-                  <!-- 閫変腑鎮h�呭垪琛� -->
-                  <SFtable
-                    @details="detailhz"
-                    @handleUpdate="handleUpdate"
-                    :currentList="overallCase"
-                    :tableLabel="tableLabelhz"
-                    :serialnumber="false"
-                    :searchTrue="true"
-                    :multiplechoice="false"
-                    :controlxz="false"
-                    :typeinfo="2"
-                  />
-                  <pagination
-                    v-show="total > 0"
-                    :total="total"
-                    :page.sync="topqueryParams.pageNum"
-                    :limit.sync="topqueryParams.pageSize"
-                    @pagination="getList"
-                  />
-                </el-row>
-              </div>
-            </div>
-          </div>
-        </div>
-        <el-button type="primary" @click="laststep()">涓婁竴姝�</el-button>
-        <el-button type="success" @click="submitForm('ruleForm')">{{
-          quote ? "绔嬪嵆鍒涘缓" : "纭浠诲姟閰嶇疆"
-        }}</el-button>
-        <el-button @click="resetForm('ruleForm')">閲嶇疆</el-button>
-      </div>
-    </div>
-    <!-- 娣诲姞鎮h�� -->
-    <el-dialog
-      title="閫夋嫨鎮h��"
-      :visible.sync="dialogVisiblepatient"
-      width="70%"
-      :before-close="handleClosehz"
-      :close-on-click-modal="false"
-    >
-      <div class="examine-jic">
-        <div class="jic-value">
-          <el-row :gutter="20">
-            <!--鐢ㄦ埛鏁版嵁-->
-            <el-form
-              :model="patientqueryParams"
-              ref="queryForm"
-              size="small"
-              :inline="true"
-              v-show="showSearch"
-              label-width="98px"
-            >
-              <el-form-item label="鎮h�呭悕绉帮細">
-                <el-input
-                  v-model="patientqueryParams.name"
-                  @keyup.enter.native="handleQuery"
-                ></el-input>
-              </el-form-item>
-              <el-form-item label="鍒涘缓鏃堕棿">
-                <el-date-picker
-                  v-model="dateRange"
-                  style="width: 240px"
-                  value-format="yyyy-MM-dd"
-                  type="daterange"
-                  range-separator="-"
-                  start-placeholder="寮�濮嬫棩鏈�"
-                  end-placeholder="缁撴潫鏃ユ湡"
-                ></el-date-picker>
-              </el-form-item>
-
-              <el-form-item>
-                <el-button
-                  type="primary"
-                  icon="el-icon-search"
-                  size="medium"
-                  @click="handleQuery"
-                  >鎼滅储</el-button
-                >
-                <el-button
-                  icon="el-icon-refresh"
-                  size="medium"
-                  @click="resetQuery"
-                  >閲嶇疆</el-button
-                >
-              </el-form-item>
-            </el-form>
-            <!-- 閫夋嫨鎮h�呭垪琛� -->
-            <SFtable
-              ref="multipleTable"
-              @handleUpdate="handleUpdate"
-              @handleSelectionChange="handleSelectionChange"
-              :currentList="patientuserList"
-              :tableLabel="tableLabelhz"
-              :serialnumber="false"
-              :center="false"
-              :typeinfo="3"
-            />
-          </el-row>
-          <pagination
-            v-show="patienttotal > 0"
-            :total="patienttotal"
-            :page.sync="patientqueryParams.pageNum"
-            :limit.sync="patientqueryParams.pageSize"
-            @pagination="handleAddpatient"
-          />
-        </div>
-      </div>
-      <span slot="footer" class="dialog-footer">
-        <el-button @click="dialogVisiblepatient = false">鍙� 娑�</el-button>
-        <el-button type="primary" @click="AddDispatchpatients"
-          >纭畾娣诲姞</el-button
-        >
-      </span>
-    </el-dialog>
-    <el-dialog title="妯℃澘棰勮" :visible.sync="previewtf" width="60%">
-      <div class="preview-left">
-        <!-- 鍗曢�� -->
-        <div
-          class="scriptTopic-dev"
-          v-for="(item, index) in questionList"
-          :key="item.aaa"
-        >
-          <div class="dev-text">
-            {{ index + 1 }}銆�<span>{{ item.scriptContent }}</span>
-          </div>
-
-          <div class="dev-xx" v-if="item.valueType == 1">
-            <el-radio-group v-model="item.radio">
-              <el-radio
-                v-for="(items, index) in item.ivrLibaScriptTargetoptionList"
-                :key="items.id"
-                :label="items.id"
-                >{{ items.targetvalue }}
-              </el-radio>
-            </el-radio-group>
-          </div>
-          <div v-else>
-            <el-input
-              type="textarea"
-              placeholder="鏈幏鍙栧埌淇℃伅"
-              v-model.sync="item.scriptResult"
-              :rows="2"
-            />
-          </div>
-        </div>
-      </div>
-      <span slot="footer" class="dialog-footer">
-        <el-button @click="previewGo">鍓嶅線妯℃澘璇︽儏淇敼</el-button>
-        <el-button type="primary" @click="previewFn">纭浣跨敤</el-button>
-      </span>
-    </el-dialog>
-    <el-drawer
-      title="闅忚鍐呭鍒楄〃"
-      :visible.sync="drawermb"
-      direction="rtl"
-      size="50%"
-    >
-      <div class="headline"></div>
-      <div class="examine-jic">
-        <div class="jic-value">
-          <el-row :gutter="20">
-            <!--鐢ㄦ埛鏁版嵁-->
-
-            <el-form
-              :model="topqueryParams"
-              ref="queryForm"
-              size="small"
-              :inline="true"
-              v-show="showSearch"
-              label-width="98px"
-            >
-              <el-form-item label="闅忚鍚嶇О">
-                <el-input v-model="topqueryParams.templateName"></el-input>
-              </el-form-item>
-
-              <el-form-item label="閫傜敤绉戝" prop="status">
-                <el-select v-model="topqueryParams.topicd" placeholder="璇烽�夋嫨">
-                  <el-option
-                    v-for="item in topicoptions"
-                    :key="item.value"
-                    :label="item.label"
-                    :value="item.value"
-                  >
-                  </el-option>
-                </el-select>
-              </el-form-item>
-              <el-form-item label="闅忚妯℃澘鍒嗙被" prop="region">
-                <el-select
-                  v-model="topqueryParams.assortid"
-                  size="medium"
-                  filterable
-                  placeholder="璇烽�夋嫨鍒嗙被"
-                >
-                  <el-option-group
-                    v-for="group in indexAssortlist"
-                    :key="group.id"
-                    :label="group.indexAssortName"
-                  >
-                    <el-option
-                      v-for="item in group.ivrLibaTemplateAssortList"
-                      :key="item.id"
-                      :label="item.indexAssortName"
-                      :value="item.id"
-                    >
-                    </el-option>
-                  </el-option-group>
-                </el-select>
-              </el-form-item>
-              <el-form-item>
-                <el-button
-                  type="primary"
-                  icon="el-icon-search"
-                  size="medium"
-                  @click="handleQuery"
-                  >鎼滅储</el-button
-                >
-                <el-button
-                  icon="el-icon-refresh"
-                  size="medium"
-                  @click="resetQuery"
-                  >閲嶇疆</el-button
-                >
-              </el-form-item>
-            </el-form>
-            <el-divider></el-divider>
-            <!-- 閫夋嫨妯℃澘鍒楄〃 -->
-            <SFtable
-              @selectfn="selectfn"
-              :currentList="userList"
-              :tableLabel="tableLabel"
-              :controlsc="false"
-              :multiplechoice="false"
-              :typeinfo="1"
-            />
-            <pagination
-              v-show="total > 0"
-              :total="total"
-              :page.sync="topqueryParams.pageNum"
-              :limit.sync="topqueryParams.pageSize"
-              @pagination="Acquisitiontype"
-            />
-          </el-row>
-        </div>
-      </div>
-    </el-drawer>
-  </div>
-</template>
-
-<script>
-import { messagelistpatient } from "@/api/patient/homepage";
-import store from "@/store";
-import {
-  getTaskpatient,
-  getlibrarylist,
-  getFollowuplist,
-  getQtemplatelist,
-  TaskTemplatecomit,
-  getTaskInfo,
-  gethetaskinfo,
-  delhetaskinfo,
-  Editsingletask,
-  getvFollowup,
-  getFollowupclassify,
-} from "@/api/AiCentre/index";
-import { listDept } from "@/api/system/dept";
-
-import SFtable from "@/components/SFtable"; //琛ㄦ牸缁勪欢
-
-export default {
-  name: "serviceDetailsa",
-  data() {
-    const endDate = new Date();
-    const startDate = new Date();
-    startDate.setDate(endDate.getDate() - 7); // 璁剧疆寮�濮嬫棩鏈熶负褰撳墠鏃ユ湡鍓�7澶�
-    return {
-      title: "闅忚鍐呭鍒楄〃",
-      currenttype: 1, //1闅忚2闂嵎3閫氱煡瀹f暀
-      id: "", //
-      previewid: "", //浠诲姟妯℃澘浼犻�抜d
-      libName: "",
-      overallCase: [], //閫夋嫨鎮h�呮��
-      // 鏃ユ湡鑼冨洿
-      dateRange: [startDate, endDate],
-      allpids: [],
-      libId: null, //妯℃澘搴撴ā鏉縤d
-      nhh: null, //鏄惁渚濈収鏂板
-      Editprogress: 1, //缂栬緫杩涘害
-      drawermb: false, //閫夋嫨妯℃澘寮圭獥
-      previewtf: false, //棰勮
-      loading: false, // 閬僵灞�
-      patientloading: false, // 閬僵灞�
-      dialogVisiblepatient: false, //娣诲姞鎮h�呭脊妗�
-      radio: 1,
-      checkboxlist: [],
-      tableLabel: [],
-      questionList: [],
-      // 鎮h�呰〃鍗�
-      tableLabelhz: [
-        { label: "鎮h�呭悕绉�", width: "", prop: "name" },
-        { label: "鎬у埆", width: "", prop: "sex" },
-        { label: "骞撮緞", width: "", prop: "age" },
-        { label: "灏辫瘖绉戝", width: "", prop: "deptName" },
-        { label: "鍏ラ櫌鏃ユ湡", width: "", prop: "birthdate" },
-        { label: "鍒涘缓浜猴紙缂猴級", width: "", prop: "update_by" },
-      ],
-
-      tableLabelmz: [
-        { label: "闅忚鍚嶇О", width: "", prop: "templateName" },
-        { label: "涓昏鍐呭", width: "", prop: "note" },
-        { label: "淇敼鏃ユ湡", width: "", prop: "updateTime" },
-        { label: "鍒涘缓浜猴紙缂猴級", width: "", prop: "updateBy" },
-      ],
-
-      // 鏈嶅姟褰㈠紡
-      preachform: [
-        { label: "绾夸笅", value: 1 },
-        { label: "鐢佃瘽", value: 2 },
-        { label: "灏忕▼搴�", value: 3 },
-        { label: "鐭俊", value: 4 },
-        { label: "寰俊鍏紬", value: 5 },
-        { label: "閽夐拤", value: 6 },
-        { label: "鏅鸿兘鏈哄櫒浜�", value: 7 },
-      ],
-      // 鏃堕棿澶勭悊
-      daytime: [], //鏃ユ湡
-      applydaytime: [], //璁$畻鏃ユ湡
-      time1: "", //涓婂崍鏃堕棿娈�
-      time2: "", //涓嬪崍鏃堕棿娈�
-      time3: "", //鏅氫笂鏃堕棿娈�
-      time4: "", //鏅氫笂鏃堕棿娈�
-      topqueryParams: {
-        pageNum: 1, //
-        pageSize: 10,
-      },
-      checkList: [],
-      deliverytopqueryParams: {
-        pageNum: 1, //
-        pageSize: 10,
-      },
-      patientqueryParams: {
-        pageNum: 1, //
-        pageSize: 10,
-      },
-      topicoptions: [{ children: [{ children: [] }] }],
-      showSearch: true, //
-      total: 0, //
-      sontotal: 0, //
-      patienttotal: 0, //
-      // 閫変腑鏁扮粍
-      ids: [],
-      // 闈炲崟涓鐢�
-      single: true,
-      // 闈炲涓鐢�
-      multiple: true,
-      // 鐢ㄦ埛琛ㄦ牸鏁版嵁
-      userList: [], //妯℃澘鍒楄〃
-      patientuserList: [], //閫夋嫨鎮h�呭垪琛�
-      sonuserList: [], //閫変腑鎮h�呭垪琛�
-      delvariableList: [], //鍒犻櫎鍙橀噺涓存椂瀛樺偍
-      indexAssortlist: [],
-
-      variableList: [
-        {
-          name: "濮撳悕",
-          value: "${name}",
-          fill: "娲惧彂鏃惰嚜鍔ㄥ尮閰�",
-          default: true,
-        },
-        {
-          name: "鍦板潃",
-          value: "${dzz}",
-          fill: "娲惧彂鏃惰嚜鍔ㄥ尮閰�",
-          default: true,
-        },
-        {
-          name: "鐢佃瘽",
-          value: "${dhh}",
-          fill: "娲惧彂鏃惰嚜鍔ㄥ尮閰�",
-          default: true,
-        },
-      ], //鍙橀噺鍒楄〃
-      transitionList: [
-        {
-          name: "濮撳悕",
-          value: "${name}",
-          fill: "娲惧彂鏃惰嚜鍔ㄥ尮閰�",
-          default: true,
-        },
-        {
-          name: "鍦板潃",
-          value: "${dzz}",
-          fill: "娲惧彂鏃惰嚜鍔ㄥ尮閰�",
-          default: true,
-        },
-        {
-          name: "鐢佃瘽",
-          value: "${dhh}",
-          fill: "娲惧彂鏃惰嚜鍔ㄥ尮閰�",
-          default: true,
-        },
-      ],
-      variableListTime: [],
-      tasktopic: null, //鏂板绫诲瀷
-      SelectPatientslist: [],
-      form: {
-        patTaskRelevances: [],
-        sendType: 1,
-        templatename: "",
-        templateid: null,
-        libtemplateid: null,
-      },
-      taskoptions: [
-        {
-          value: "1",
-          label: "鍑洪櫌鐥呬汉",
-        },
-        {
-          value: "2",
-          label: "闂ㄨ瘖鐥呬汉",
-        },
-        {
-          value: "3",
-          label: "浣撴鐥呬汉",
-        },
-      ],
-      quote: false,
-      serviceType:null,
-
-    };
-  },
-  components: { SFtable },
-
-  created() {
-    this.id = this.$route.query.id;
-    this.form.type = this.$route.query.type;
-    this.serviceType = Number(this.$route.query.serviceType);
-    this.form.serviceType = Number(this.$route.query.serviceType);
-    this.form.nhh = this.$route.query.nhh;
-    // this.listDept();
-    this.Acquisitiontype();
-    this.Getdetails();
-  },
-
-  methods: {
-    // {
-    //   濮撳悕: { "${name}": "榫欏偛澶�" },
-    //   鍦板潃: { "${dzz}": "榫欏" },
-    //   鐢佃瘽: { "${dhh}": "鍏釜鍏�" },
-    // }
-    // 鍙橀噺杞崲瀵硅薄杞暟缁�
-    convertFormat1ToFormat2(data) {
-      let result = [];
-      for (let key in data) {
-        let innerKey = Object.keys(data[key])[0];
-        result.push({
-          name: key,
-          value: innerKey,
-          fill: data[key][innerKey],
-        });
-      }
-      return result;
-    },
-    // 鏁扮粍杞璞�
-    convertFormat2ToFormat1(data) {
-      let result = {};
-      data.forEach((item) => {
-        let innerObj = {};
-        innerObj[item.value] = item.fill;
-        result[item.name] = innerObj;
-      });
-      return result;
-    },
-    // 鑾峰彇褰撳墠绫诲瀷
-    Acquisitiontype() {
-      let queryParams = {
-        pageNum: this.topqueryParams.pageNum,
-        pageSize: this.topqueryParams.pageSize,
-        isavailable: "",
-      };
-      this.currenttype = this.$route.query.type;
-      // 鍑洪櫌銆侀棬璇娿�佷笓鐥呴殢璁�
-      this.title = "闅忚鍐呭鍒楄〃";
-      this.tableLabel = this.tableLabelmz;
-      if (this.form.serviceType == 2 || this.form.serviceType == 3) {
-        this.checkboxlist = [
-          {
-            value: "1",
-            label: "浜哄伐",
-          },
-          {
-            value: "3",
-            label: "鐢佃瘽",
-          },
-          {
-            value: "4",
-            label: "鐭俊",
-          },
-          {
-            value: "5",
-            label: "寰俊鍏紬鍙�",
-          },
-          {
-            value: "6",
-            label: "寰俊灏忕▼搴�",
-          },
-
-          {
-            value: "8",
-            label: "鏅鸿兘鏈哄櫒浜�",
-          },
-        ];
-      } else if (this.form.serviceType == 5) {
-        this.checkboxlist = [
-          {
-            value: "3",
-            label: "鐢佃瘽",
-          },
-          {
-            value: "4",
-            label: "鐭俊",
-          },
-          {
-            value: "5",
-            label: "寰俊鍏紬鍙�",
-          },
-          {
-            value: "6",
-            label: "寰俊灏忕▼搴�",
-          },
-
-          {
-            value: "8",
-            label: "鏅鸿兘鏈哄櫒浜�",
-          },
-        ];
-      }
-
-      getFollowuplist(queryParams).then((response) => {
-        this.userList = response.rows;
-        this.total = response.total;
-      });
-    },
-
-    nextstep() {
-      if (this.Editprogress <= 3) {
-        return this.Editprogress++;
-      }
-    },
-    // 淇濆瓨
-    submitForm(formName) {
-      this.form.preachform = this.checkList.join(",");
-      // this.formatFn(1);
-      if (!this.form.patTaskRelevances[0]) {
-        this.$modal.msgError("璇烽�夋嫨鐥呬汉");
-        return;
-      }
-      const filteredArray = this.variableList.filter(
-        (item) =>
-          item.name !== "濮撳悕" && item.name !== "鐢佃瘽" && item.name !== "鍦板潃"
-      );
-      console.log(filteredArray, "瀛樺墠鍙橀噺");
-      this.form.textParam = this.convertFormat2ToFormat1(filteredArray);
-      if (this.form.taskid) {
-        this.form.isoperation = 2;
-      } else {
-        this.form.isoperation = 1;
-      }
-      this.form.serviceType=this.serviceType;
-      Editsingletask(this.form).then((res) => {
-        if (res.code == 200) {
-          if (this.form.taskid) {
-            this.$modal.msgSuccess("鏂板鎴愬姛");
-          } else {
-            this.$modal.msgSuccess("淇敼鎴愬姛");
-          }
-          this.$router.push({
-            path: "/followvisit/tasklist",
-            query: { tasktopic: this.form.serviceType },
-          });
-        }
-      });
-    },
-    // ----------------------琛ㄦ牸瀛愮粍浠朵簨浠�
-    // 纭閫夋嫨妯℃澘鏀惧叆浠诲姟妯℃澘
-    selectfn(row, type) {
-      // 妯℃澘鎯呭喌涓嬭幏鍙栨ā鏉夸俊鎭�
-      console.log(row, "閫夋嫨妯℃澘");
-      this.libName = row.templateName;
-      this.libId = row.id;
-      getvFollowup({ id: row.id }).then((res) => {
-        if (res.code == 200) {
-          this.Tasktemplate = res.data;
-          const data = res.data;
-          this.questionList = data.ivrLibaTemplateScriptVOList;
-          this.previewtf = true;
-          this.previewid = data.id;
-          console.log(this.questionList, "questionList");
-          this.Variablehandling(data.ivrLibaTemplateScriptVOList, 1);
-        }
-      });
-    },
-    // 澶勭悊闂灞傚彉閲�
-    Variablehandling(arr, type) {
-      let Variablist = [];
-      this.variableList = []; //鍙橀噺鍒楄〃
-      if (type == 1) {
-        console.log(arr);
-        // 寰幆闂
-        arr.forEach((res) => {
-          console.log(JSON.parse(res.otherdata), "ss");
-          // 寰幆閫夐」
-          JSON.parse(res.otherdata).forEach((item) => {
-            if (item.default != 1) {
-              Variablist.push({
-                value: item.variate,
-                fill: "",
-                name: item.variatename,
-              });
-            }
-          });
-        });
-        const Aarr = Variablist.filter(
-          (obj, index, self) =>
-            index ===
-            self.findIndex((t) => t.name === obj.name && t.value === obj.value)
-        );
-        this.variableList = this.transitionList.concat(Aarr);
-        console.log(this.variableList, "variableList");
-        // this.form.textParam = this.convertFormat2ToFormat1(this.variableList);
-      }
-    },
-    // 瀛愪换鍔′簩绾у脊妗�
-    handleAddpatient(row) {
-      console.log(this.overallCase, "ssaaa");
-      this.allpids = [];
-      this.overallCase.forEach((item) => {
-        this.allpids.push(item.patid);
-      });
-      if (this.patientqueryParams.allhosp == 1) {
-        this.tableLabelhz = [
-          { label: "鎮h�呭悕绉�", width: "", prop: "name" },
-          { label: "鎬у埆", width: "", prop: "sex" },
-          { label: "骞撮緞", width: "", prop: "age" },
-          { label: "涓讳换鍖诲笀", width: "", prop: "drname" },
-          { label: "灏辫瘖绉戝", width: "", prop: "deptName" },
-          { label: "鍏ラ櫌鏃ユ湡", width: "", prop: "birthdate" },
-          { label: "鍒涘缓浜�", width: "", prop: "createBy" },
-        ];
-      } else if (this.patientqueryParams.allhosp == 2) {
-        this.tableLabelhz = [
-          { label: "鎮h�呭悕绉�", width: "", prop: "name" },
-          { label: "鎬у埆", width: "", prop: "sex" },
-          { label: "骞撮緞", width: "", prop: "age" },
-          { label: "璇婃柇", width: "", prop: "diagname" },
-          { label: "灏辫瘖绉戝", width: "", prop: "deptName" },
-          { label: "鍏ラ櫌鏃ユ湡", width: "", prop: "birthdate" },
-          { label: "鍒涘缓浜�", width: "", prop: "createBy" },
-        ];
-      }
-      if (this.allpids[0]) {
-        this.patientqueryParams.pids = this.allpids;
-        console.log(this.patientqueryParams.pids);
-      } else {
-        this.patientqueryParams.pids = null;
-      }
-
-      getTaskpatient(
-        this.addDateRange(this.patientqueryParams, this.dateRange)
-      ).then((response) => {
-        this.patientuserList = response.rows;
-        this.patienttotal = response.total;
-        this.loading = false;
-        this.Restorecheck();
-      });
-      this.dialogVisiblepatient = true;
-    },
-    handleUpdate() {},
-    handleDelete() {},
-    handleExport() {},
-    // 閫変腑鎮h�呰〃
-    handlePitchionChange() {},
-    // 閫夋嫨鎮h�呰〃鏁版嵁
-    handleSelectionChange(selection) {
-      console.log("澶氶�夋偅鑰�");
-      this.SelectPatientslist = selection;
-      this.multiple = !selection.length;
-
-      // 璧嬪�肩粰鏁翠綋閫変腑鏁扮粍
-      this.SelectPatientslist.forEach((item) => {
-        const isExist = this.overallCase.find((obj) => obj.name == item.name);
-        if (!isExist) {
-          console.log(this.patientqueryParams.allhosp, "allhosp");
-          item.isoperation = 1;
-          item.patid = item.id;
-          item.hospType = this.patientqueryParams.allhosp;
-          this.overallCase.push(item);
-          this.form.patTaskRelevances.push(item);
-          console.log(this.overallCase, "this.overallCase");
-        }
-      });
-    },
-    // 鍒囨崲椤靛悗鎭㈠閫変腑
-    Restorecheck() {
-      console.log(this.overallCase, "this.overallCase");
-      const allid = this.overallCase.map((item) => item.id);
-      const overlap = this.patientuserList.filter((value) => {
-        return allid.includes(value.id);
-      });
-      console.log(overlap, "overlap");
-
-      // 淇濇寔ids鍜屽綋鍓嶉〉闈㈢殑鍚屾鎬�
-      this.SelectPatientslist = overlap;
-      console.log(this.SelectPatientslist, "杩涘叆鍒嗛〉SelectPatientslist");
-
-      this.toggleSelection(overlap);
-    },
-    // 鎸傝浇閫夋嫨鐘舵��
-    toggleSelection(rows) {
-      if (rows) {
-        this.decision = true;
-        this.$nextTick(() => {
-          rows.forEach((row) => {
-            this.$refs.multipleTable.toggleRowSelection(row, true);
-          });
-          this.decision = false;
-        });
-        console.log(123);
-      } else {
-        this.$refs.multipleTable.clearSelection();
-      }
-    },
-    // 鍒犻櫎閫変腑鎮h��
-    detailhz(row, info) {
-      this.$modal
-        .confirm('鏄惁纭鍒犻櫎鎮h��"' + row.name + '"鐨勬湇鍔¢」锛�')
-        .then(() => {
-          let indexa = this.overallCase.indexOf(row);
-          let indexb = this.form.patTaskRelevances.indexOf(row);
-          this.overallCase.splice(indexa, 1);
-          this.form.patTaskRelevances[indexb].isoperation = 3;
-          this.$modal.msgSuccess("鍒犻櫎鎴愬姛");
-        });
-    },
-    getList() {},
-    handleQuery() {
-      this.handleAddpatient();
-    },
-    resetQuery() {
-      this.dateRange = [];
-      // 鏌ヨ鍙傛暟
-      this.queryParams = {
-        pageNum: 1,
-        pageSize: 10,
-        userName: undefined,
-        phonenumber: undefined,
-        status: undefined,
-        deptId: undefined,
-      };
-    },
-    handleClosehz() {
-      this.dialogVisiblepatient = false;
-    },
-    // 涓婁竴姝�
-    laststep() {
-      this.Editprogress--;
-    },
-    // 鎻愪氦琛ㄥ崟
-    resetForm(formName) {
-      this.$refs[formName].resetFields();
-    },
-    // 棰勮妯℃澘
-    PreviewTemplate() {},
-    Acknowledgereference() {
-      this.quote = true;
-    },
-    // 鑾峰彇璇︽儏
-    Getdetails() {
-      if (this.id) {
-        getTaskInfo({ taskid: this.id }).then((res) => {
-          let filteredArray = "";
-          console.log(2233);
-          if (res.code == 200) {
-            this.form = res.data;
-      this.form.serviceType=this.serviceType;
-            this.overallCase = this.form.patTaskRelevances.concat();
-            this.checkList = this.form.preachform.split(",");
-            console.log(this.form.showDate, "this.form");
-            this.daytime = this.form.showDate.split(",");
-            this.changeTimeday(this.daytime);
-            if (this.form.showTimeMorn) {
-              if (this.form.sendType == 3) {
-                this.time4 = this.form.showTimeMorn;
-              } else {
-                this.time1 = this.form.showTimeMorn.split(",");
-              }
-            }
-            if (this.form.showTimeNoon)
-              this.time2 = this.form.showTimeNoon.split(",");
-            if (this.form.showTimeNight)
-              this.time3 = this.form.showTimeNight.split(",");
-            console.log(1122);
-            filteredArray = this.convertFormat1ToFormat2(this.form.textParam);
-            this.variableList = this.transitionList.concat(filteredArray);
-          } else {
-            this.$modal.msgError(res.code);
-          }
-        });
-      }
-      getFollowupclassify({}).then((res) => {
-        this.indexAssortlist = res.rows;
-      });
-    },
-    // 鑾峰彇绉戝鍒楄〃
-    listDept() {
-      listDept().then((res) => {
-        this.topicoptions = this.handleTree(res.data, "deptId");
-        console.log(this.topicoptions, "topicoptions");
-      });
-    },
-    // 鏂板娲鹃�佹偅鑰�
-    AddDispatchpatients() {
-      // this.SelectPatientslist.forEach((item) => {
-      //   item.isoperation = 1;
-      // });
-      // this.form.patTaskRelevances.push(...this.SelectPatientslist);
-      // this.overallCase.push(...this.SelectPatientslist);
-      this.dialogVisiblepatient = false;
-    },
-
-    variableDelete(index, row) {
-      this.variableList.splice(index, 1);
-      row.isoperation = 3;
-      this.delvariableList.push(row);
-      console.log(index, row);
-    },
-    // 鏃堕棿----------
-    changeTime(row) {
-      console.log(row, "鏃堕棿");
-      this.processingTime();
-    },
-    Totaldate(row) {
-      console.log(row, "鏃堕棿");
-      this.form.sendTimeslot = [{ begantime: row, endtime: row, xh: 1 }];
-      this.form.showTimeMorn = row;
-      console.log(this.form.sendTimeslot, "鏃堕棿");
-    },
-    changeTimeday(row) {
-      console.log(row, "鏃ユ湡");
-      const startDate = new Date(row[0]);
-      const endDate = new Date(row[1]);
-      this.applydaytime = this.getDates(startDate, endDate);
-      if (!top) {
-        this.processingTime();
-      }
-    },
-    getDates(startDate, endDate) {
-      const dates = [];
-      let currentDate = new Date(startDate);
-
-      while (currentDate <= endDate) {
-        dates.push(this.$moment(currentDate).format("YYYY-MM-DD"));
-        currentDate.setDate(currentDate.getDate() + 1);
-      }
-
-      return dates;
-    },
-    // 鏃堕棿鏈�缁堝鐞嗘柟娉�
-    processingTime() {
-      const combinedData = [];
-      let serialnumber = 1;
-      if (this.time3[0]) {
-        serialnumber = 3;
-      } else if (this.time2[0]) {
-        serialnumber = 2;
-      } else if (this.time1[0]) {
-        serialnumber = 1;
-      } else {
-        return;
-      }
-
-      for (let i = 0; i < this.applydaytime.length; i++) {
-        combinedData.push({
-          begantime: `${this.applydaytime[i]} ${this.time1[0]}`,
-          endtime: `${this.applydaytime[i]} ${this.time1[1]}`,
-          xh: serialnumber * i + 1,
-        });
-        if (serialnumber >= 2) {
-          combinedData.push({
-            begantime: `${this.applydaytime[i]} ${this.time2[0]}`,
-            endtime: `${this.applydaytime[i]} ${this.time2[1]}`,
-            xh: serialnumber * i + 2,
-          });
-        }
-        if (serialnumber >= 3) {
-          combinedData.push({
-            begantime: `${this.applydaytime[i]} ${this.time3[0]}`,
-            endtime: `${this.applydaytime[i]} ${this.time3[1]}`,
-            xh: serialnumber * i + 3,
-          });
-        }
-      }
-      this.form.sendTimeslot = combinedData;
-      // 灞曠ず鏁版嵁涓存椂瀛樺偍鏃ユ湡銆佹棭銆佷腑銆佹櫄
-      console.log(this.daytime);
-
-      this.form.showDate = this.daytime.join(",");
-      if (this.time1) this.form.showTimeMorn = this.time1.join(",");
-      if (this.time2) this.form.showTimeNoon = this.time2.join(",");
-      if (this.time3) this.form.showTimeNight = this.time3.join(",");
-      console.log(combinedData, "combinedData");
-    },
-    // 鏌ョ湅妯℃澘
-    previewGo() {
-      this.$router.push({
-        path: "/knowledge/tpuconfigurat/",
-        query: { id: this.previewid, task: true, data: this.form },
-      });
-    },
-    previewFn() {
-      let id = this.Tasktemplate.id;
-      this.Tasktemplate.id = null;
-      this.Tasktemplate.ivrLibaTemplateScriptVOList.forEach((item) => {
-        item.ivrTaskScriptTargetoptionList = item.ivrLibaScriptTargetoptionList;
-      });
-      console.log(this.Tasktemplate.ivrLibaTemplateScriptVOList);
-
-      this.Tasktemplate.ivrTaskTemplateScriptVOList =
-        this.Tasktemplate.ivrLibaTemplateScriptVOList;
-      this.Tasktemplate.ivrLibaTemplateTagList = null;
-      this.Tasktemplate.tempDetpRelevances = null;
-      this.Tasktemplate.libtemplateid = id;
-      this.Tasktemplate.isoperation = 1;
-      this.Tasktemplate.libtemplatename = this.Tasktemplate.templatename;
-      console.log(this.libName, this.libId);
-
-      TaskTemplatecomit(this.Tasktemplate).then((response) => {
-        console.log(response);
-        this.previewtf = false;
-        this.form.templateid = response.data;
-        this.form.libtemplateid = this.libId;
-        this.form.templatename = this.libName;
-        console.log(this.form.templatename, "ss");
-        this.$modal.msgSuccess("閫夋嫨妯℃澘鎴愬姛", this.form.templatename);
-      });
-    },
-    // 澶勭悊鏈嶅姟褰㈠紡
-    formatFn(type) {
-      console.log(this.preachform, "preachform");
-      console.log(this.checkList, "checklist");
-      let list = [];
-      let formlist = [];
-      if (type == 1) {
-        this.preachform.forEach((item) => {
-          this.checkList.forEach((obj) => {
-            if (item.label == obj) {
-              list.push(item.value);
-            }
-          });
-        });
-        this.form.preachform = list.join(",");
-      } else {
-        console.log(this.form.preachform, "this.form.preachform");
-        formlist = this.form.preachform.split(",");
-        console.log(11);
-        this.preachform.forEach((item) => {
-          formlist.forEach((obj) => {
-            if (item.value == obj) {
-              list.push(item.label);
-            }
-          });
-        });
-        this.checkList = list;
-      }
-    },
-  },
-};
-</script>
-
-<style lang="scss" scoped>
-.Questionnairemanagement {
-}
-.leftvlue-jbxx {
-  margin-top: 10px;
-}
-.sidecolumn {
-  width: 100%;
-  // min-height: 12vh;
-  margin: 20px;
-  margin-bottom: 0;
-  padding: 30px;
-  background: #edf1f7;
-  border: 1px solid #dcdfe6;
-  -webkit-box-shadow: 0 2px 4px 0 rgba(0, 0, 0, 0.12),
-    0 0 6px 0 rgba(0, 0, 0, 0.04);
-}
-.leftvlue {
-  //   display: flex;
-  //   flex: 1;
-  width: 100%;
-  margin-top: 20px;
-  //   margin: 20px;
-  padding: 30px;
-  background: #ffff;
-  border: 1px solid #dcdfe6;
-  -webkit-box-shadow: 0 2px 4px 0 rgba(0, 0, 0, 0.12),
-    0 0 6px 0 rgba(0, 0, 0, 0.04);
-}
-.examine-jic {
-  margin: 20px;
-  .headline {
-    font-size: 24px;
-    border-left: 5px solid #41a1be;
-    padding-left: 5px;
-    margin-bottom: 10px;
-    display: flex;
-    justify-content: space-between;
-    .Add-details {
-      font-size: 18px;
-      color: #02a7f0;
-      cursor: pointer;
-    }
-  }
-  .jic-value {
-    font-size: 20px;
-    border-top: 1px solid #a7abac;
-    padding: 10px;
-    margin-bottom: 10px;
-    .details-jic {
-      padding: 10px 15px;
-      border: 1px solid #dcdfe6;
-      -webkit-box-shadow: 0 2px 4px 0 rgba(0, 0, 0, 0.12),
-        0 0 6px 0 rgba(0, 0, 0, 0.04);
-      .details-title {
-        display: flex;
-        justify-content: space-between;
-        margin-bottom: 10px;
-        div:nth-child(2) {
-          color: #02a7f0;
-          cursor: pointer;
-        }
-      }
-      .details-renw {
-        background: #e4ebfc;
-        padding: 15px 5px;
-        border-radius: 5px;
-        margin-bottom: 20px;
-      }
-    }
-  }
-}
-// .leftvlue-jbxx {
-//   margin-bottom: 50px;
-//   font-size: 20px;
-//   span {
-//     position: absolute;
-//     right: 80px;
-//   }
-//   .demo-cascader {
-//     margin-right: 20px;
-//   }
-//   .PreviewTemplate {
-//     color: #02a7f0;
-//     cursor: pointer;
-//     font-size: 20px;
-//     margin: 0 20px;
-//   }
-// }
-.preview-left {
-  margin: 20px;
-  //   margin: 20px;
-  padding: 30px;
-  background: #ffff;
-  border: 1px solid #dcdfe6;
-  -webkit-box-shadow: 0 2px 4px 0 rgba(0, 0, 0, 0.12),
-    0 0 6px 0 rgba(0, 0, 0, 0.04);
-  .scriptTopic-dev {
-    margin-bottom: 25px;
-    font-size: 20px !important;
-    .dev-text {
-      margin-bottom: 10px;
-    }
-  }
-}
-.jic-value {
-  font-size: 20px;
-  border-top: 1px solid #a7abac;
-  padding: 10px;
-  margin-bottom: 10px;
-  .details-jic {
-    padding: 10px 15px;
-    border: 1px solid #dcdfe6;
-    -webkit-box-shadow: 0 2px 4px 0 rgba(0, 0, 0, 0.12),
-      0 0 6px 0 rgba(0, 0, 0, 0.04);
-    .details-title {
-      display: flex;
-      justify-content: space-between;
-      margin-bottom: 10px;
-      div:nth-child(2) {
-        color: #02a7f0;
-        cursor: pointer;
-      }
-    }
-    .details-renw {
-      background: #e4ebfc;
-      padding: 15px 5px;
-      border-radius: 5px;
-      margin-bottom: 20px;
-    }
-  }
-}
-::v-deep .addtopic-input {
-  input {
-    background: #02a7f0;
-    color: #edf1f7;
-    width: 150px;
-  }
-}
-::v-deep.el-step.is-vertical .el-step__title {
-  font-size: 25px;
-}
-::v-deep.el-row {
-  margin-bottom: 10px;
-}
-// ::v-deep.el-input--medium {
-//   font-size: 24px !important;
-// }
-::v-deep.ruleFormaa.el-select {
-  display: inline-block;
-  position: relative;
-  width: 700px;
-}
-.el-select__tags {
-  font-size: 20px;
-  max-width: 888px !important;
-}
-::v-deep.el-radio__inner {
-  width: 22px;
-  height: 22px;
-}
-// ::v-deep.scriptTopic-dev.el-radio__label {
-//   font-size: 24px;
-// }
-::v-deep.el-radio-group {
-  span {
-    font-size: 24px;
-  }
-}
-::v-deep.el-input.is-disabled .el-input__inner {
-  background-color: #f5f7fa;
-  border-color: #dfe4ed;
-  color: rgb(253, 66, 66);
-  cursor: not-allowed;
-}
-::v-deep.el-checkbox-group {
-  span {
-    font-size: 24px;
-  }
-}
-</style>
diff --git a/src/views/patient/propaganda/particty.vue b/src/views/patient/propaganda/particty.vue
index 09e1d13..e169997 100644
--- a/src/views/patient/propaganda/particty.vue
+++ b/src/views/patient/propaganda/particty.vue
@@ -69,20 +69,7 @@
                     placeholder="璇疯緭鍏ヤ换鍔℃弿杩�"
                   />
                 </el-form-item>
-                <!-- <el-form-item label="鏈嶅姟褰㈠紡">
-                  <el-radio-group
-                    v-model="checkList"
-                    @change="handleCheckedCitiesChange"
-                  >
-                    <el-radio
-                      v-for="(item, index) in checkboxlist"
-                      :key="index"
-                      :label="item.value"
-                    >
-                      {{ item.label }}</el-radio
-                    >
-                  </el-radio-group>
-                </el-form-item> -->
+
                 <el-form-item label="鏈嶅姟褰㈠紡">
                   <SortCheckbox
                     v-model="checkList"
@@ -93,20 +80,7 @@
                     @change="checkSelectionChange"
                   />
                 </el-form-item>
-                <!-- <div class="xinz-infs">
-                  <el-form-item label="鏈嶅姟鎵ц椤哄簭" prop="daytime">
-                    <el-tag
-                      :key="tag.label"
-                      type="success"
-                      v-for="(tag, index) in foncheckList"
-                      closable
-                      :disable-transitions="false"
-                      @close="handleClosetag(tag)"
-                    >
-                      ({{ index + 1 }}){{ tag.label }}
-                    </el-tag>
-                  </el-form-item>
-                </div> -->
+
                 <el-form-item label="鎵ц鍛ㄦ湡" prop="longTask">
                   <el-radio-group v-model="form.longTask">
                     <el-radio :label="0">鑷畾涔夊懆鏈�</el-radio>
@@ -223,14 +197,47 @@
                     </div>
                   </div>
                 </el-form-item>
+
                 <el-form-item label="浠诲姟鍏宠仈" prop="longTask">
                   <el-radio-group v-model="form.appltype">
                     <el-radio label="1">绉戝鍏宠仈</el-radio>
                     <el-radio label="2">鐥呭尯鍏宠仈</el-radio>
                     <el-radio label="3">鐤剧梾鍏宠仈</el-radio>
                     <el-radio label="4">鎵嬫湳鍏宠仈</el-radio>
+                    <el-radio label="5">浠诲姟缁�</el-radio>
+                    <el-radio label="6">鑽搧鍏宠仈</el-radio>
                   </el-radio-group>
                 </el-form-item>
+
+                <!-- 鑽搧鍏宠仈 -->
+                <el-row v-if="form.appltype == 6">
+                  <el-col :span="20">
+                    <el-form-item label="鍏宠仈鑽搧" prop="region">
+                      <el-select
+                        v-model="medicalCodes"
+                        @remove-tag="removeMedical"
+                        style="width: 400px"
+                        size="medium"
+                        multiple
+                        filterable
+                        remote
+                        reserve-keyword
+                        :remote-method="remoteSearchMedical"
+                        placeholder="璇疯緭鍏ヨ嵂鍝佸悕绉版悳绱�"
+                        loading-text="鎼滅储涓�..."
+                      >
+                        <el-option
+                          v-for="item in medicalOptions"
+                          :key="item.id"
+                          :label="item.itemName + ' (' + item.manufacturerName + ')'"
+                          :value="item.itemCode"
+                        />
+                      </el-select>
+                    </el-form-item>
+                  </el-col>
+                </el-row>
+
+                <!-- 绉戝鍏宠仈 -->
                 <el-row v-if="form.appltype == 1">
                   <el-col :span="20"
                     ><el-form-item label="閫傜敤绉戝" prop="region">
@@ -254,6 +261,8 @@
                       </el-select> </el-form-item
                   ></el-col>
                 </el-row>
+
+                <!-- 鐥呭尯鍏宠仈 -->
                 <el-row v-if="form.appltype == 2">
                   <el-col :span="20"
                     ><el-form-item label="閫傜敤鐥呭尯" prop="region">
@@ -277,6 +286,8 @@
                       </el-select> </el-form-item
                   ></el-col>
                 </el-row>
+
+                <!-- 鐤剧梾鍏宠仈 -->
                 <el-row v-if="form.appltype == 3">
                   <div class="xinz-infs">
                     <el-form-item>
@@ -307,7 +318,6 @@
                       >
                         {{ tag.icdname }}
                       </el-tag>
-                      <!-- <el-tag v-if="hasMore" type="info">+{{ remaining }} more</el-tag> -->
                     </el-form-item>
                   </div>
                   <div
@@ -318,14 +328,7 @@
                       border-left: 4px solid #409eff;
                     "
                   >
-                    <p
-                      style="
-                        margin: 0;
-                        color: #606266;
-                        font-size: 13px;
-                        line-height: 1.4;
-                      "
-                    >
+                    <p style="margin: 0; color: #606266; font-size: 13px">
                       <i
                         class="el-icon-info"
                         style="color: #409eff; margin-right: 6px"
@@ -333,7 +336,6 @@
                       閽堝鍚屼竴鐤剧梾鍦ㄥ绉戝/鐥呭尯涓嬪瓨鍦ㄧ殑鎯呭喌锛屽彲閫夋嫨鎬ч厤缃浐瀹氱瀹�/鐥呭尯
                     </p>
                   </div>
-                  <!-- 鏂板锛氱柧鐥呭叧鑱斾笅鐨勭瀹ら厤缃紙鍗曢�夛級 -->
                   <el-row :gutter="20" style="margin-top: 20px">
                     <el-col :span="12">
                       <el-form-item label="鍏宠仈绉戝" prop="diseaseDept">
@@ -360,7 +362,6 @@
                         </div>
                       </el-form-item>
                     </el-col>
-
                     <el-col :span="12">
                       <el-form-item label="鍏宠仈鐥呭尯" prop="diseaseWard">
                         <el-select
@@ -388,6 +389,8 @@
                     </el-col>
                   </el-row>
                 </el-row>
+
+                <!-- 鎵嬫湳鍏宠仈 -->
                 <el-row v-if="form.appltype == 4">
                   <el-form-item label="閫傜敤鎵嬫湳" prop="region">
                     <el-select
@@ -417,14 +420,7 @@
                       border-left: 4px solid #409eff;
                     "
                   >
-                    <p
-                      style="
-                        margin: 0;
-                        color: #606266;
-                        font-size: 13px;
-                        line-height: 1.4;
-                      "
-                    >
+                    <p style="margin: 0; color: #606266; font-size: 13px">
                       <i
                         class="el-icon-info"
                         style="color: #409eff; margin-right: 6px"
@@ -432,7 +428,6 @@
                       閽堝鍚屼竴鎵嬫湳绫诲瀷鍦ㄥ绉戝/鐥呭尯涓嬪瓨鍦ㄧ殑鎯呭喌锛屽彲閫夋嫨鎬ч厤缃浐瀹氱瀹�/鐥呭尯
                     </p>
                   </div>
-                  <!-- 鏂板锛氭墜鏈叧鑱斾笅鐨勭瀹ら厤缃紙鍗曢�夛級 -->
                   <el-row :gutter="20" style="margin-top: 20px">
                     <el-col :span="12">
                       <el-form-item label="鍏宠仈绉戝" prop="diseaseDept">
@@ -459,7 +454,6 @@
                         </div>
                       </el-form-item>
                     </el-col>
-
                     <el-col :span="12">
                       <el-form-item label="鍏宠仈鐥呭尯" prop="diseaseWard">
                         <el-select
@@ -487,6 +481,292 @@
                     </el-col>
                   </el-row>
                 </el-row>
+
+                <!-- 浠诲姟缁� (appltype=5) -->
+                <div v-if="form.appltype == 5">
+                  <el-divider content-position="left">浠诲姟缁勪富璁″垝</el-divider>
+                  <el-form-item label="鎵ц鏂瑰紡">
+                    <el-radio-group
+                      v-model="form.serviceTaskScheduleVO.scheduleStyle"
+                    >
+                      <el-radio :label="0">闈炲惊鐜�</el-radio>
+                      <el-radio :label="1">寰幆</el-radio>
+                    </el-radio-group>
+                  </el-form-item>
+                  <div v-if="form.serviceTaskScheduleVO.scheduleStyle == 1">
+                    <el-row :gutter="20" style="margin-top: 20px">
+                      <el-col :span="12">
+                        <el-form-item label="寰幆闂撮殧">
+                          <el-input-number
+                            v-model="form.serviceTaskScheduleVO.scheduleTimeNum"
+                            :min="1"
+                            style="width: 120px"
+                          />
+                          <el-select
+                            v-model="
+                              form.serviceTaskScheduleVO.scheduleTimeUnit
+                            "
+                            placeholder="鍗曚綅"
+                            style="width: 100px; margin-left: 8px"
+                          >
+                            <el-option label="澶�" :value="1" />
+                            <el-option label="鍛�" :value="2" />
+                            <el-option label="鏈�" :value="3" />
+                            <el-option label="骞�" :value="4" />
+                          </el-select>
+                        </el-form-item>
+                      </el-col>
+                      <el-col :span="12">
+                        <el-form-item label="鏈�澶ц疆娆�">
+                          <el-input-number
+                            v-model="form.serviceTaskScheduleVO.maxLoopCount"
+                            :min="0"
+                            :step="1"
+                            placeholder="0琛ㄧず鏃犻檺"
+                          />
+                        </el-form-item>
+                      </el-col>
+                    </el-row>
+                  </div>
+                  <el-row :gutter="20" style="margin-top: 20px">
+                    <el-col :span="12">
+                      <el-form-item label="鍩哄噯鏃堕棿">
+                        <el-radio-group
+                          v-model="form.serviceTaskScheduleVO.scheduleBenchmark"
+                        >
+                          <el-radio :label="0">鑷畾涔�</el-radio>
+                          <el-radio :label="1">鍏ラ櫌鏃堕棿</el-radio>
+                          <el-radio :label="2">鍑洪櫌鏃堕棿</el-radio>
+                          <el-radio :label="3">灏辫瘖鏃堕棿</el-radio>
+                          <el-radio :label="4">鍏ョ粍鏃堕棿</el-radio>
+                        </el-radio-group>
+                      </el-form-item>
+                    </el-col>
+                    <el-col
+                      :span="12"
+                      v-if="form.serviceTaskScheduleVO.scheduleBenchmark == 0"
+                    >
+                      <el-form-item label="鑷畾涔夊熀鍑嗘椂闂�">
+                        <el-date-picker
+                          v-model="
+                            form.serviceTaskScheduleVO
+                              .scheduleBenchmarkCustomTime
+                          "
+                          type="datetime"
+                          placeholder="閫夋嫨鏃ユ湡鏃堕棿"
+                          value-format="yyyy-MM-dd HH:mm:ss"
+                        />
+                      </el-form-item>
+                    </el-col>
+
+                    <el-col :span="12">
+                      <el-form-item label="涓嬫鎵ц鏃堕棿">
+                        <el-date-picker
+                          v-model="form.serviceTaskScheduleVO.nextExecuteTime"
+                          type="datetime"
+                          placeholder="閫夋嫨棣栨鎵ц鏃堕棿"
+                          value-format="yyyy-MM-dd HH:mm:ss"
+                        />
+                      </el-form-item>
+                    </el-col>
+                  </el-row>
+                  <el-row :gutter="20" style="margin-top: 20px">
+                    <el-col :span="12">
+                      <el-form-item label="鍏宠仈绉戝" prop="diseaseDept">
+                        <el-select
+                          v-model="diseaseDept"
+                          style="width: 100%"
+                          clearable
+                          filterable
+                          placeholder="璇烽�夋嫨绉戝锛堝彲閫夛級"
+                          value-key="deptCode"
+                          @change="handleDiseaseDeptChange"
+                        >
+                          <el-option
+                            v-for="item in belongDepts"
+                            :key="item.deptCode"
+                            :label="item.deptName"
+                            :value="item"
+                          ></el-option>
+                        </el-select>
+                        <div v-if="diseaseDept" class="selected-info">
+                          宸查�夋嫨: {{ diseaseDept.deptName }} ({{
+                            diseaseDept.deptCode
+                          }})
+                        </div>
+                      </el-form-item>
+                    </el-col>
+                    <el-col :span="12">
+                      <el-form-item label="鍏宠仈鐥呭尯" prop="diseaseWard">
+                        <el-select
+                          v-model="diseaseWard"
+                          style="width: 100%"
+                          clearable
+                          filterable
+                          placeholder="璇烽�夋嫨鐥呭尯锛堝彲閫夛級"
+                          value-key="districtCode"
+                          @change="handleDiseaseWardChange"
+                        >
+                          <el-option
+                            v-for="item in belongWards"
+                            :key="item.districtCode"
+                            :label="item.districtName"
+                            :value="item"
+                          ></el-option>
+                        </el-select>
+                        <div v-if="diseaseWard" class="selected-info">
+                          宸查�夋嫨: {{ diseaseWard.districtName }} ({{
+                            diseaseWard.districtCode
+                          }})
+                        </div>
+                      </el-form-item>
+                    </el-col>
+                  </el-row>
+                  <el-row>
+                    <div class="xinz-infs">
+                      <el-form-item>
+                        <template #label>
+                          <el-tooltip
+                            class="item"
+                            effect="light"
+                            content="閫夋嫨濂介�傜敤鐤剧梾鍚庯紝鍙互鏂逛究鎮ㄩ�氳繃鐤剧梾璇婃柇鏌ユ壘鍒板搴旂殑鐥呬汉!"
+                            placement="top-start"
+                          >
+                            <i class="el-icon-warning-outline"></i>
+                          </el-tooltip>
+                        </template>
+                        <div style="margin-bottom: 10px">
+                          <el-button
+                            type="warning"
+                            @click="$refs.child.handleAddpatient()"
+                            >娣诲姞鐤剧梾璇婃柇</el-button
+                          >
+                        </div>
+                        <el-tag
+                          v-for="tag in diagglist"
+                          @close="removediagg(tag.icd10code)"
+                          type="warning"
+                          closable
+                          :disable-transitions="false"
+                        >
+                          {{ tag.icdname }}
+                        </el-tag>
+                      </el-form-item>
+                    </div>
+                  </el-row>
+                  <!-- 鏄庣粏鍒楄〃 -->
+                  <el-row :gutter="20" style="margin-top: 20px">
+                    <el-col :span="24">
+                      <el-divider content-position="left"
+                        >浠诲姟鏄庣粏鍒楄〃</el-divider
+                      >
+                      <el-button
+                        type="primary"
+                        size="small"
+                        icon="el-icon-plus"
+                        @click="addDetail"
+                        >娣诲姞鏄庣粏</el-button
+                      >
+                      <el-table
+                        :data="form.serviceTaskScheduleVO.detailList"
+                        border
+                        style="width: 100%; margin-top: 10px"
+                      >
+                        <el-table-column label="搴忓彿" width="80" align="center">
+                          <template slot-scope="scope">{{
+                            scope.row.seq
+                          }}</template>
+                        </el-table-column>
+                        <el-table-column label="闂撮殧澶╂暟" width="120">
+                          <template slot-scope="scope">
+                            <el-input-number
+                              v-model="scope.row.dayOffset"
+                              :min="0"
+                              size="small"
+                              controls-position="right"
+                            />
+                          </template>
+                        </el-table-column>
+                        <el-table-column label="妯℃澘" min-width="200">
+                          <template slot-scope="scope">
+                            <el-select
+                              v-model="scope.row.templateid"
+                              filterable
+                              remote
+                              :remote-method="remoteTemplate"
+                              placeholder="鎼滅储妯℃澘"
+                              size="small"
+                              @change="
+                                handleTemplateSelect(scope.$index, scope.row)
+                              "
+                            >
+                              <el-option
+                                v-for="item in templateOptions"
+                                :key="item.id"
+                                :label="item.templateName"
+                                :value="item.id"
+                              >
+                                <span style="float: left">{{
+                                  item.templateName
+                                }}</span>
+                                <span
+                                  style="
+                                    float: right;
+                                    color: #8492a6;
+                                    font-size: 12px;
+                                  "
+                                  >{{ item.createBy }}</span
+                                >
+                              </el-option>
+                            </el-select>
+                            <span
+                              style="
+                                margin-left: 5px;
+                                font-size: 12px;
+                                color: #909399;
+                              "
+                              >{{ scope.row.templatename }}</span
+                            >
+                          </template>
+                        </el-table-column>
+                        <el-table-column label="寮�鍦虹櫧" min-width="150">
+                          <template slot-scope="scope">
+                            <el-input
+                              v-model="scope.row.kcb"
+                              size="small"
+                              placeholder="鍙��"
+                            />
+                          </template>
+                        </el-table-column>
+                        <el-table-column label="缁撴潫璇�" min-width="150">
+                          <template slot-scope="scope">
+                            <el-input
+                              v-model="scope.row.jsy"
+                              size="small"
+                              placeholder="鍙��"
+                            />
+                          </template>
+                        </el-table-column>
+                        <el-table-column
+                          label="鎿嶄綔"
+                          width="100"
+                          align="center"
+                        >
+                          <template slot-scope="scope">
+                            <el-button
+                              size="mini"
+                              type="danger"
+                              icon="el-icon-delete"
+                              @click="removeDetail(scope.$index)"
+                            ></el-button>
+                          </template>
+                        </el-table-column>
+                      </el-table>
+                    </el-col>
+                  </el-row>
+                </div>
+
+                <!-- 缁撴潫 -->
                 <el-row>
                   <el-col :span="12"
                     ><el-form-item label="寮�鍦虹櫧" prop="kcb">
@@ -523,14 +803,12 @@
                       placeholder="璇风偣鍑诲彸渚ч�夋嫨"
                     />
                     <el-button
-                      v-if="form.templateid"
                       style="margin-left: 10px"
                       type="primary"
                       icon="el-icon-edit"
                       @click="drawermb = true"
                       circle
                     ></el-button>
-
                     <el-button
                       v-if="form.templateid"
                       type="success"
@@ -546,17 +824,18 @@
             <div class="examine-jic">
               <div class="jic-value">
                 <div style="margin-bottom: 10px">妯℃澘涓娇鐢ㄧ殑鍙橀噺锛�</div>
-
                 <el-row :gutter="20">
                   <el-table :data="variableList" style="width: 100%">
                     <el-table-column
                       prop="name"
                       align="center"
                       label="鍙橀噺鍚嶇О"
-                    >
-                    </el-table-column>
-                    <el-table-column prop="value" align="center" label="鍖归厤绗�">
-                    </el-table-column>
+                    ></el-table-column>
+                    <el-table-column
+                      prop="value"
+                      align="center"
+                      label="鍖归厤绗�"
+                    ></el-table-column>
                     <el-table-column label="鏇挎崲鍊�" align="center">
                       <template slot-scope="scope">
                         <el-input
@@ -568,11 +847,6 @@
                     </el-table-column>
                     <el-table-column label="鎿嶄綔" align="center">
                       <template slot-scope="scope">
-                        <!-- <el-button
-                          size="mini"
-                          @click="variableEdit(scope.$index, scope.row)"
-                          >缂栬緫</el-button
-                        > -->
                         <el-button
                           size="mini"
                           type="danger"
@@ -590,7 +864,6 @@
         <el-button type="success" @click="nextstep('ruleForm')">{{
           quote ? "绔嬪嵆鍒涘缓" : "浠诲姟璇︽儏閰嶇疆"
         }}</el-button>
-        <!-- <el-button @click="resetForm('ruleForm')">閲嶇疆</el-button> -->
       </div>
       <!-- 浠诲姟璇︽儏 -->
       <div v-if="Editprogress == 2">
@@ -619,7 +892,6 @@
                         </el-option>
                       </el-select>
                     </el-col>
-
                     <el-col :span="1.5">
                       <el-button
                         type="primary"
@@ -631,22 +903,7 @@
                         >娣诲姞鎮h��</el-button
                       >
                     </el-col>
-
-                    <!-- <el-col :span="1.5">
-                      <el-button
-                        type="danger"
-                        plain
-                        icon="el-icon-delete"
-                        size="medium"
-                        :disabled="multiple"
-                        @click="handleDelete"
-                        >鍒犻櫎</el-button
-                      >
-                    </el-col> -->
-
-                    <!-- <el-col :span="1.5"> </el-col> -->
                   </el-row>
-                  <!-- 閫変腑鎮h�呭垪琛� -->
                   <SFtable
                     @details="detailhz"
                     @handleUpdate="handleUpdate"
@@ -677,7 +934,6 @@
           @click="submitForm('11')"
           >{{ quote ? "绔嬪嵆鍒涘缓" : "纭浠诲姟閰嶇疆" }}</el-button
         >
-        <!-- <el-button @click="resetForm('ruleForm')">閲嶇疆</el-button> -->
       </div>
     </div>
     <!-- 娣诲姞鎮h�� -->
@@ -691,7 +947,6 @@
       <div class="examine-jic">
         <div class="jic-value">
           <el-row :gutter="20">
-            <!--鐢ㄦ埛鏁版嵁-->
             <el-form
               :model="patientqueryParams"
               ref="queryForm"
@@ -724,7 +979,6 @@
                 >
                 </el-option>
               </el-select>
-
               <el-form-item>
                 <el-button
                   type="primary"
@@ -741,7 +995,6 @@
                 >
               </el-form-item>
             </el-form>
-            <!-- 閫夋嫨鎮h�呭垪琛� -->
             <SFtable
               ref="multipleTable"
               @handleUpdate="handleUpdate"
@@ -772,8 +1025,8 @@
     <!-- 妯℃澘棰勮 -->
     <el-dialog title="妯℃澘棰勮" :visible.sync="previewtf" width="70%">
       <el-tabs type="border-card">
-        <el-tab-pane label="妯℃澘鍩虹鏁版嵁"
-          ><div class="preview-left">
+        <el-tab-pane label="妯℃澘鍩虹鏁版嵁">
+          <div class="preview-left">
             <el-form :model="objyl" label-width="100px" class="demo-objyl">
               <el-row :gutter="10">
                 <el-col :span="14">
@@ -827,7 +1080,6 @@
                   <el-input v-model="objyl.templateName"></el-input>
                 </div>
               </el-form-item>
-
               <div class="xinz-infs">
                 <el-form-item>
                   <template #label>
@@ -841,7 +1093,6 @@
                       <i class="el-icon-warning-outline"></i>
                     </el-tooltip>
                   </template>
-
                   <el-tag
                     v-for="tag in illnesslist"
                     :key="tag.icdid"
@@ -850,7 +1101,6 @@
                   >
                     {{ tag.icdname }}
                   </el-tag>
-                  <!-- <el-tag v-if="hasMore" type="info">+{{ remaining }} more</el-tag> -->
                 </el-form-item>
               </div>
               <el-form-item label="闅忚鎻忚堪" prop="description">
@@ -862,7 +1112,6 @@
                 >
                 </el-input
               ></el-form-item>
-
               <el-form-item label="闅忚缁撴潫璇�" prop="conclusion">
                 <el-input
                   type="textarea"
@@ -872,10 +1121,11 @@
                 >
                 </el-input
               ></el-form-item>
-            </el-form></div
-        ></el-tab-pane>
-        <el-tab-pane label="闂灞曠ず"
-          ><div class="preview-left">
+            </el-form>
+          </div>
+        </el-tab-pane>
+        <el-tab-pane label="闂灞曠ず">
+          <div class="preview-left">
             <div v-for="item in questionList">
               <!-- 鍗曢�� -->
               <div
@@ -940,12 +1190,11 @@
                   </el-input>
                 </div>
               </div>
-            </div></div
-        ></el-tab-pane>
+            </div>
+          </div>
+        </el-tab-pane>
       </el-tabs>
-
       <span slot="footer" class="dialog-footer">
-        <!-- <el-button @click="previewGo">淇濆瓨妯℃澘璇︽儏淇敼</el-button> -->
         <el-button
           v-if="(form.templateid && form.sendState == 1) || !form.templateid"
           type="primary"
@@ -961,6 +1210,7 @@
         >
       </span>
     </el-dialog>
+    <!-- 妯℃澘鍒楄〃鎶藉眽 -->
     <el-drawer
       title="闅忚鍐呭鍒楄〃"
       :visible.sync="drawermb"
@@ -971,8 +1221,6 @@
       <div class="examine-jic">
         <div class="jic-value">
           <el-row :gutter="20">
-            <!--鐢ㄦ埛鏁版嵁-->
-
             <el-form
               :model="topqueryParams"
               ref="queryForm"
@@ -984,17 +1232,6 @@
               <el-form-item label="闅忚鍚嶇О">
                 <el-input v-model="topqueryParams.templateName"></el-input>
               </el-form-item>
-              <!-- <el-form-item label="閫傜敤褰㈠紡" prop="status">
-                <el-select v-model="topqueryParams.topica" placeholder="璇烽�夋嫨">
-                  <el-option
-                    v-for="item in taskoptions"
-                    :key="item.value"
-                    :label="item.label"
-                    :value="item.value"
-                  >
-                  </el-option>
-                </el-select>
-              </el-form-item> -->
               <el-form-item>
                 <el-button
                   type="primary"
@@ -1006,13 +1243,12 @@
                 <el-button
                   icon="el-icon-refresh"
                   size="medium"
-                  @click="resetQuery"
+                  @click="resetQuerymb"
                   >閲嶇疆</el-button
                 >
               </el-form-item>
             </el-form>
             <el-divider></el-divider>
-            <!-- 閫夋嫨妯℃澘鍒楄〃 -->
             <SFtable
               @selectfn="selectfn"
               :currentList="userList"
@@ -1042,7 +1278,6 @@
     />
   </div>
 </template>
-
 <script>
 import { messagelistpatient } from "@/api/patient/homepage";
 import store from "@/store";
@@ -1067,60 +1302,61 @@
   taskdiaghospgetsondel,
   taskdiaggetlist,
   taskopergetlist,
+  rwztaskdepthospgetsonlist,
+  rwztaskdiaggetlist,
+  getQtemplatelist,
 } from "@/api/AiCentre/index";
+import { listMedication } from "@/api/knowledge/drug";
 import { deptTreeSelect } from "@/api/system/user";
 import OptionalForm from "@/components/OptionalForm";
-import SortCheckbox from "@/components/SortCheckbox"; //琛ㄦ牸缁勪欢
+import SortCheckbox from "@/components/SortCheckbox";
 import { MessageBox } from "element-ui";
-
-import SFtable from "@/components/SFtable"; //琛ㄦ牸缁勪欢
+import SFtable from "@/components/SFtable";
 
 export default {
   name: "particty",
   data() {
     return {
       title: "瀹f暀鍐呭鍒楄〃",
-      currenttype: 1, //1瀹f暀2闂ㄨ瘖3鍑洪櫌4澶嶈瘖5浣撴6闅忚
-      id: "", //
-      previewid: "", //浠诲姟妯℃澘浼犻�抜d
+      currenttype: 1,
+      id: "",
+      previewid: "",
       libName: "",
       username: "",
       templateor: false,
-      submitLoading: false, // 鎺у埗鎸夐挳鍔犺浇鐘舵��
+      submitLoading: false,
       objyl: {},
-      overallCase: [], //閫夋嫨鎮h�呮��
+      overallCase: [],
       allpids: [],
       appraiselist: [],
       optionsclass: [],
       illnesslist: [],
       mode: [],
-      libId: null, //妯℃澘搴撴ā鏉縤d
-      Editprogress: 1, //缂栬緫杩涘害
-      drawermb: false, //閫夋嫨妯℃澘寮圭獥
-      previewtf: false, //棰勮
-      previewtftype: 0, //棰勮鎯呭喌0鏂版ā鏉块瑙�1宸查�夋嫨妯℃澘淇敼
-      loading: false, // 閬僵灞�
-      patientloading: false, // 閬僵灞�
-      dialogVisiblepatient: false, //娣诲姞鎮h�呭脊妗�
+      libId: null,
+      Editprogress: 1,
+      drawermb: false,
+      previewtf: false,
+      previewtftype: 0,
+      dialogVisiblepatient: false,
       dialogVisiblepatientjb: false,
-      deptcodesWards: [], //绉戝鏁版嵁
-      leavehospitaldistrictcodes: [], //鐥呭尯鏁版嵁
-      operationcodes: [], //鎵嬫湳鏁版嵁
-      illnesscodes: [], //鐤剧梾鏁版嵁
+      deptcodesWards: [],
+      leavehospitaldistrictcodes: [],
+      operationcodes: [],
+      illnesscodes: [],
       radio: 1,
       checkboxlist: [],
       tableLabel: [],
       questionList: [],
-      skip: false,
       donorchargeList: [],
-      baseoperaList: [ { value: "1", label: "涓�绾ф墜鏈�" },
+      baseoperaList: [
+        { value: "1", label: "涓�绾ф墜鏈�" },
         { value: "2", label: "浜岀骇鎵嬫湳" },
         { value: "3", label: "涓夌骇鎵嬫湳" },
-        { value: "4", label: "鍥涚骇鎵嬫湳" },],
+        { value: "4", label: "鍥涚骇鎵嬫湳" },
+      ],
       selectedOrder: [],
-      diseaseDept: null, // 鐤剧梾鍏宠仈涓嬬殑绉戝锛堝瓨鍌ㄦ暣涓璞★級
-      diseaseWard: null, // 鐤剧梾鍏宠仈涓嬬殑鐥呭尯锛堝瓨鍌ㄦ暣涓璞★級
-
+      diseaseDept: null,
+      diseaseWard: null,
       usable: [
         { value: "0", label: "鍙敤" },
         { value: "1", label: "鍋滅敤" },
@@ -1131,7 +1367,6 @@
       ],
       props: { multiple: true, value: "deptCode", label: "deptName" },
       propstask: { value: "deptCode", label: "deptName" },
-      // 鎮h�呰〃鍗�
       tableLabelhz: [
         { label: "鍑洪櫌鏃ユ湡", width: "150", prop: "inhosptime" },
         { label: "鎮h��", width: "", prop: "name" },
@@ -1145,7 +1380,6 @@
         { label: "绉戝", width: "240", prop: "dept" },
         { label: "鐥呭尯", width: "240", prop: "leavehospitaldistrictname" },
       ],
-      // 鎮h�呰〃鍗�
       tableLabelhzwb: [
         { label: "鍑洪櫌鏃ユ湡", width: "150", prop: "endtime" },
         { label: "鎮h��", width: "", prop: "name" },
@@ -1159,14 +1393,12 @@
         { label: "绉戝", width: "180", prop: "deptName" },
         { label: "鐥呭尯", width: "150", prop: "leavehospitaldistrictname" },
       ],
-
       tableLabelwj: [
         { label: "鍒涘缓浜�", width: "", prop: "createBy" },
         { label: "妯℃澘鏍囬", width: "", prop: "templateName" },
         { label: "闅忚鎻忚堪", width: "", prop: "note" },
         { label: "淇敼鏃ユ湡", width: "", prop: "updateTime" },
       ],
-      // 鍙橀噺
       tableLabelvariable: [
         { label: "鍙橀噺鍚嶇О", width: "", prop: "variablename" },
         { label: "鍖归厤绗�", width: "", prop: "character" },
@@ -1185,15 +1417,14 @@
         { label: "绾夸笅锛堢焊璐級", value: 10 },
         { label: "绾夸笂锛堢煭淇�/閽夐拤鐨勬枃鏈�侀殢璁块摼鎺ワ級", value: 11 },
       ],
-      // 鏃堕棿澶勭悊
-      daytime: [], //鏃ユ湡
-      applydaytime: [], //璁$畻鏃ユ湡
-      time1: "", //涓婂崍鏃堕棿娈�
-      time2: "", //涓嬪崍鏃堕棿娈�
-      time3: "", //鏅氫笂鏃堕棿娈�
-      time4: "", //鏅氫笂鏃堕棿娈�
+      daytime: [],
+      applydaytime: [],
+      time1: "",
+      time2: "",
+      time3: "",
+      time4: "",
       topqueryParams: {
-        pageNum: 1, //
+        pageNum: 1,
         pageSize: 10,
       },
       checkList: [],
@@ -1204,33 +1435,29 @@
         format3: "",
       },
       deliverytopqueryParams: {
-        pageNum: 1, //
+        pageNum: 1,
         pageSize: 10,
       },
       patientqueryParams: {
-        pageNum: 1, //
+        pageNum: 1,
         pageSize: 10,
-        topica: 1, //0鍏ㄩ儴1绉戝2鐥呭尯
+        topica: 1,
         leaveldeptcodes: [],
         leavehospitaldistrictcodes: [],
       },
       topicoptions: [{ children: [{ children: [] }] }],
-      showSearch: true, //
-      total: 0, //
-      sontotal: 0, //
-      patienttotal: 0, //
-      // 閫変腑鏁扮粍
+      showSearch: true,
+      total: 0,
+      sontotal: 0,
+      patienttotal: 0,
       ids: [],
-      // 闈炲崟涓鐢�
       single: true,
-      // 闈炲涓鐢�
       multiple: true,
-      // 鐢ㄦ埛琛ㄦ牸鏁版嵁
-      userList: [], //妯℃澘鍒楄〃
-      multiplechoice: [], //澶氶�夌粨鏋�
-      patientuserList: [], //閫夋嫨鎮h�呭垪琛�
-      sonuserList: [], //閫変腑鎮h�呭垪琛�
-      delvariableList: [], //鍒犻櫎鍙橀噺涓存椂瀛樺偍
+      userList: [],
+      multiplechoice: [],
+      patientuserList: [],
+      sonuserList: [],
+      delvariableList: [],
       longtype: [
         { value: 0, label: "鑷畾涔夊懆鏈�" },
         { value: 1, label: "闀挎湡浠诲姟" },
@@ -1254,7 +1481,7 @@
           fill: "娲惧彂鏃惰嚜鍔ㄥ尮閰�",
           default: true,
         },
-      ], //鍙橀噺鍒楄〃
+      ],
       transitionList: [
         {
           name: "濮撳悕",
@@ -1276,7 +1503,7 @@
         },
       ],
       variableListTime: [],
-      tasktopic: null, //鏂板绫诲瀷
+      tasktopic: null,
       SelectPatientslist: [],
       form: {
         patTaskRelevances: [],
@@ -1290,55 +1517,45 @@
           localStorage.getItem("orgname") +
           "鐨勫尰鎶や汉鍛橈紝涓轰簡鏇村ソ鍦颁簡瑙f偍鐨勫悍澶嶆儏鍐碉紝璇锋偍鎶戒竴鐐瑰疂璐垫椂闂达紝杩涜鏈鍥炶鏈嶅姟銆�",
         jsy: "璇锋偍娉ㄦ剰浼戞伅鍜岃惀鍏伙紝鐢熸椿涓婅鍔抽�哥粨鍚堬紝閫傚綋閿荤偧锛屾垝鐑熼檺閰掞紝淇濇寔蹇冩儏鑸掔晠锛屽畾鏈熷璇娿�傞偅鏈鍥炶鍐呭灏卞埌杩欓噷锛岀鎮ㄨ韩浣撳仴搴凤紒",
+        // 浠诲姟缁勪富瀵硅薄
+        serviceTaskScheduleVO: {
+          scheduleStyle: 0,
+          scheduleTimeNum: null,
+          scheduleTimeUnit: null,
+          maxLoopCount: 0,
+          currentLoopCount: 0,
+          currentSeq: 0,
+          nextSeq: 0,
+          nextExecuteTime: "",
+          scheduleBenchmark: 0,
+          scheduleBenchmarkCustomTime: "",
+          detailList: [],
+        },
       },
       taskoptions: [
-        {
-          value: "4",
-          label: "鍑洪櫌鐥呬汉",
-        },
-        {
-          value: "1",
-          label: "鍦ㄩ櫌鐥呬汉",
-        },
-        {
-          value: "2",
-          label: "闂ㄨ瘖鐥呬汉",
-        },
-        {
-          value: "3",
-          label: "浣撴鐥呬汉",
-        },
-        {
-          value: "5",
-          label: "鎵嬫湳鐥呬汉",
-        },
+        { value: "4", label: "鍑洪櫌鐥呬汉" },
+        { value: "1", label: "鍦ㄩ櫌鐥呬汉" },
+        { value: "2", label: "闂ㄨ瘖鐥呬汉" },
+        { value: "3", label: "浣撴鐥呬汉" },
+        { value: "5", label: "鎵嬫湳鐥呬汉" },
       ],
       source: [
-        {
-          value: 0,
-          label: "鎵�灞炴偅鑰�",
-        },
-        {
-          value: 1,
-          label: "绉戝鎮h��",
-        },
-        {
-          value: 2,
-          label: "鐥呭尯鎮h��",
-        },
+        { value: 0, label: "鎵�灞炴偅鑰�" },
+        { value: 1, label: "绉戝鎮h��" },
+        { value: 2, label: "鐥呭尯鎮h��" },
       ],
-
       tasktypes: store.getters.tasktypes,
-      // 绉戝/鐥呭尯
       belongWards: [],
       deptlist: [],
       hosplist: [],
       diagglist: [],
       operlist: [],
-      tempDetpRelevanceslist: [], //绉戝鏁版嵁
-      tempDetpRelevanceslistform: [], //绉戝鏁版嵁
-      tempbelongWards: [], //鐥呭尯鏁版嵁
-      tempbelongWardsform: [], //鐥呭尯鏁版嵁
+      medicalCodes: [],
+      medicalOptions: [],
+      tempDetpRelevanceslist: [],
+      tempDetpRelevanceslistform: [],
+      tempbelongWards: [],
+      tempbelongWardsform: [],
       rules: {
         taskName: [
           { required: true, message: "浠诲姟鍚嶇О涓嶈兘涓虹┖", trigger: "blur" },
@@ -1355,14 +1572,7 @@
         longTask: [
           { required: true, message: "璇烽�夋嫨鎵ц鍛ㄦ湡", trigger: "blur" },
         ],
-        // deptcode: [
-        //   { required: true, message: "閫傜敤绉戝涓嶈兘涓虹┖", trigger: "blur" },
-        // ],
-        // leavehospitaldistrictcode: [
-        //   { required: true, message: "閫傜敤鐥呭尯涓嶈兘涓虹┖", trigger: "blur" },
-        // ],
       },
-      // 绉戝闄㈠尯鏌ヨ鍏ュ弬
       queryParamsdept: {
         tempid: "",
         type: 2,
@@ -1370,10 +1580,12 @@
       belongDepts: [],
       quote: false,
       serviceType: null,
+      // 妯℃澘鎼滅储
+      templateOptions: [],
+      templateLoading: false,
     };
   },
   components: { SFtable, OptionalForm, SortCheckbox },
-
   created() {
     this.appraiselist = store.getters.appraiselist;
     this.belongWards = store.getters.belongWards;
@@ -1386,15 +1598,12 @@
     this.form.typename = this.$route.query.typename;
     this.serviceType = Number(this.$route.query.serviceType);
     this.form.serviceType = Number(this.$route.query.serviceType);
-    console.log(localStorage.getItem("orgid"), "orgid");
-
     this.Acquisitiontype();
     this.getillnesslist();
     this.Getdetails();
     this.getFollowupclassify();
   },
   activated() {
-    console.log(this.id, "CS", this.$route.query.id);
     if (this.id != this.$route.query.id) {
       this.id = this.$route.query.id;
       this.newadd = this.$route.query.newadd;
@@ -1402,15 +1611,13 @@
       this.form.typename = this.$route.query.typename;
       this.serviceType = Number(this.$route.query.serviceType);
       this.form.serviceType = Number(this.$route.query.serviceType);
-
       this.Acquisitiontype();
       this.Getdetails();
       this.getFollowupclassify();
     }
   },
-
   methods: {
-    // 鍙橀噺杞崲瀵硅薄杞暟缁�
+    // ---------- 宸ュ叿鏂规硶 ----------
     convertFormat1ToFormat2(data) {
       let result = [];
       for (let key in data) {
@@ -1423,7 +1630,6 @@
       }
       return result;
     },
-    // 鏁扮粍杞璞�
     convertFormat2ToFormat1(data) {
       let result = {};
       data.forEach((item) => {
@@ -1433,27 +1639,28 @@
       });
       return result;
     },
-
     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); // 灏嗘渶搴曞眰鐨勫厓绱犳坊鍔犲埌缁撴灉鏁扮粍
+          result.push(item);
         }
       }
-
-      // 浠庨《灞傚厓绱犲紑濮嬮�掑綊
       multiArray.forEach((element) => flatten(element));
-      return result; // 杩斿洖鍙寘鍚渶搴曞眰鍏冪礌鐨勪竴缁存暟缁�
+      return result;
     },
-    // 鑾峰彇褰撳墠绫诲瀷
+    daysBetween(endDate) {
+      if (!endDate) return "";
+      const now = new Date();
+      const end = new Date(endDate);
+      const diff = Math.floor((now - end) / (1000 * 60 * 60 * 24));
+      return diff > 0 ? diff : 0;
+    },
+
+    // ---------- 鏁版嵁鍔犺浇 ----------
     Acquisitiontype() {
       let queryParams = {
         pageNum: this.topqueryParams.pageNum,
@@ -1465,22 +1672,10 @@
       this.tableLabel = this.tableLabelwj || [];
       if (this.form.serviceType == 1) {
         this.checkboxlist = [
-          {
-            value: "1",
-            label: "浜哄伐",
-          },
-          {
-            value: "2",
-            label: "绾歌川",
-          },
-          {
-            value: "4",
-            label: "鐭俊",
-          },
-          {
-            value: "5",
-            label: "寰俊鍏紬鍙�",
-          },
+          { value: "1", label: "浜哄伐" },
+          { value: "2", label: "绾歌川" },
+          { value: "4", label: "鐭俊" },
+          { value: "5", label: "寰俊鍏紬鍙�" },
         ];
       } else if (
         this.form.serviceType == 6 ||
@@ -1488,31 +1683,11 @@
         this.form.serviceType == 15
       ) {
         this.checkboxlist = [
-          {
-            value: "1",
-            label: "浜哄伐",
-          },
-          {
-            value: "3",
-            label: "鏅鸿兘璇煶",
-          },
-          {
-            value: "4",
-            label: "鐭俊",
-          },
-          {
-            value: "5",
-            label: "寰俊鍏紬鍙�",
-          },
-          {
-            value: "6",
-            label: "寰俊灏忕▼搴�",
-          },
-
-          // {
-          //   value: "8",
-          //   label: "鏅鸿兘鏈哄櫒浜�",
-          // },
+          { value: "1", label: "浜哄伐" },
+          { value: "3", label: "鏅鸿兘璇煶" },
+          { value: "4", label: "鐭俊" },
+          { value: "5", label: "寰俊鍏紬鍙�" },
+          { value: "6", label: "寰俊灏忕▼搴�" },
         ];
       } else if (
         this.form.serviceType == 7 ||
@@ -1524,34 +1699,13 @@
         this.form.serviceType == 10
       ) {
         this.checkboxlist = [
-          {
-            value: "1",
-            label: "浜哄伐",
-          },
-          {
-            value: "2",
-            label: "绾歌川",
-          },
-          {
-            value: "3",
-            label: "鏅鸿兘璇煶",
-          },
-          {
-            value: "4",
-            label: "鐭俊",
-          },
-          {
-            value: "5",
-            label: "寰俊鍏紬鍙�",
-          },
-          {
-            value: "6",
-            label: "寰俊灏忕▼搴�",
-          },
-          {
-            value: "7",
-            label: "鏈悗闅忚",
-          },
+          { value: "1", label: "浜哄伐" },
+          { value: "2", label: "绾歌川" },
+          { value: "3", label: "鏅鸿兘璇煶" },
+          { value: "4", label: "鐭俊" },
+          { value: "5", label: "寰俊鍏紬鍙�" },
+          { value: "6", label: "寰俊灏忕▼搴�" },
+          { value: "7", label: "鏈悗闅忚" },
         ];
       } else if (
         this.form.serviceType == 2 ||
@@ -1562,31 +1716,11 @@
         this.form.serviceType == 4
       ) {
         this.checkboxlist = [
-          {
-            value: "1",
-            label: "浜哄伐",
-          },
-          {
-            value: "3",
-            label: "鏅鸿兘璇煶",
-          },
-          {
-            value: "4",
-            label: "鐭俊",
-          },
-          {
-            value: "5",
-            label: "寰俊鍏紬鍙�",
-          },
-          {
-            value: "6",
-            label: "寰俊灏忕▼搴�",
-          },
-
-          // {
-          //   value: "8",
-          //   label: "鏅鸿兘鏈哄櫒浜�",
-          // },
+          { value: "1", label: "浜哄伐" },
+          { value: "3", label: "鏅鸿兘璇煶" },
+          { value: "4", label: "鐭俊" },
+          { value: "5", label: "寰俊鍏紬鍙�" },
+          { value: "6", label: "寰俊灏忕▼搴�" },
         ];
       }
       getFollowuplist(this.topqueryParams).then((response) => {
@@ -1594,274 +1728,17 @@
         this.total = response.total;
       });
     },
-    nextstep() {
-      this.$refs["form"].validate((valid) => {
-        if (valid) {
-          if (this.Editprogress <= 3) {
-            return this.Editprogress++;
-          }
-        } else {
-          this.$modal.msgError("琛ㄥ崟鍐呭鏈畬鍠勶紝璇锋鏌�");
-        }
+    getFollowupclassify() {
+      getFollowupclassify({}).then((res) => {
+        this.optionsclass = res.rows;
       });
     },
-    // 淇濆瓨
-    submitForm(type) {
-      // 闃叉閲嶅鎻愪氦
-      if (this.submitLoading) {
-        return;
-      }
-
-      // 寮�鍚姞杞界姸鎬�
-      this.submitLoading = true;
-
-      try {
-        // 妯℃澘鐩稿叧澶勭悊
-        if (this.templateor && type) {
-          this.templateor = false;
-        }
-
-        // 鏃堕棿澶勭悊
-        if (this.time4 && this.form.sendType == 3) {
-          this.form.showTimeMorn = this.time4;
-        }
-        this.form.sendTimeslot = [
-          {
-            begantime: this.time4,
-            endtime: "",
-            xh: 1,
-          },
-        ];
-
-        // 鏍规嵁搴旂敤绫诲瀷娓呯悊瀛楁
-        if (this.form.appltype == 1) {
-          this.leavehospitaldistrictcodes = [];
-          this.operationcodes = [];
-          this.illnesscodes = [];
-        } else if (this.form.appltype == 2) {
-          this.deptcodesWards = [];
-          this.operationcodes = [];
-          this.illnesscodes = [];
-        } else if (this.form.appltype == 3) {
-          this.deptcodesWards = [];
-          this.leavehospitaldistrictcodes = [];
-          this.operationcodes = [];
-        } else if (this.form.appltype == 4) {
-          this.deptcodesWards = [];
-          this.illnesscodes = [];
-          this.leavehospitaldistrictcodes = [];
-        }
-
-        // ===== 琛ㄥ崟鏍¢獙 =====
-
-        // 1. 鏈嶅姟绫诲瀷鏍¢獙
-        if (this.checkList) {
-          this.form.preachform = this.checkList.join(",") || [];
-          this.form.preachformList = this.selectedOrder || [];
-        } else {
-          this.$modal.msgError("璇烽�夋嫨鏈嶅姟绫诲瀷");
-          this.submitLoading = false;
-          return;
-        }
-
-        // 2. 鐤剧梾鍏宠仈绉戝鎴栫梾鍖烘牎楠�
-        if (this.form.appltype == 3 || this.form.appltype == 4) {
-          const hasDept = this.diseaseDept?.deptCode;
-          const hasWard = this.diseaseWard?.districtCode;
-
-          if (!hasDept && !hasWard) {
-            this.$modal.msgError("褰撳墠鐤剧梾闇�鍏宠仈绉戝鎴栫梾鍖�");
-            this.submitLoading = false;
-            return;
-          }
-        }
-
-        // 3. 浠诲姟鍏宠仈鏉′欢鏍¢獙
-        const hasCondition =
-          this.deptcodesWards[0] ||
-          this.leavehospitaldistrictcodes[0] ||
-          this.diagglist[0] ||
-          this.operationcodes[0] ||
-          this.form.longTask == 2 ||
-          this.serviceType == 3;
-
-        if (!hasCondition) {
-          this.$modal.msgError("璇烽�夋嫨浠诲姟鍏宠仈鏉′欢");
-          this.submitLoading = false;
-          return;
-        }
-
-        // 4. 妯℃澘鏍¢獙
-        if (!this.form.templatename && !this.templateor) {
-          this.$modal.msgError("鏈�夋嫨妯℃澘");
-          this.submitLoading = false;
-          return;
-        }
-
-        // 5. 鏃堕棿淇℃伅鏍¢獙
-        const isValidTime =
-          (this.form.sendType == 1 && this.time1) ||
-          this.form.sendType == 2 ||
-          (this.form.sendType == 3 && this.time4) ||
-          this.form.longTask;
-
-        if (!isValidTime) {
-          this.submitLoading = false;
-          this.$modal.msgError("鏃堕棿淇℃伅缂哄け");
-          return;
-        }
-
-        // ===== 鏁版嵁澶勭悊 =====
-
-        // 杩囨护鏂囨湰鍙傛暟
-        const filteredArray = this.variableList.filter(
-          (item) =>
-            item.name !== "濮撳悕" && item.name !== "鐢佃瘽" && item.name !== "鍦板潃"
-        );
-        this.form.textParam = this.convertFormat2ToFormat1(filteredArray);
-
-        // 璁剧疆鎿嶄綔绫诲瀷
-        if (this.form.taskid) {
-          this.form.isoperation = 2;
-        } else {
-          this.form.isoperation = 1;
-        }
-
-        // 璁剧疆绫诲瀷
-        if (!this.form.type) {
-          this.form.type = this.$route.query.type;
-        }
-
-        // 鐤剧梾鍏宠仈鐨勭瀹�/鐥呭尯
-        if (this.form.appltype == 3) {
-          if (this.diseaseDept) {
-            this.form.deptcode = this.diseaseDept.deptCode;
-            this.form.deptname = this.diseaseDept.deptName;
-          }
-
-          if (this.diseaseWard) {
-            this.form.leavehospitaldistrictcode = this.diseaseWard.districtCode;
-            this.form.leavehospitaldistrictname = this.diseaseWard.districtName;
-          }
-        }
-
-        // 缁勮鎻愪氦鏁版嵁
-        this.form.serviceType = this.serviceType;
-        this.form.deptcode = this.deptcodesWards.join(",");
-        this.form.leavehospitaldistrictcode =
-          this.leavehospitaldistrictcodes.join(",");
-        this.form.opcode = this.operationcodes.join(",");
-        this.form.icd10code = this.diagglist
-          .map((item) => item.icdcode)
-          .join(",");
-        this.form.icd10name = this.diagglist
-          .map((item) => item.icdname)
-          .join(",");
-
-        // ===== 鎻愪氦鎺ュ彛 =====
-        Editsingletask(this.form)
-          .then((res) => {
-            if (res.code == 200) {
-              // 鉁� 鎴愬姛
-              if (this.form.taskid) {
-                this.$modal.msgSuccess("淇敼鎴愬姛");
-              } else {
-                this.$modal.msgSuccess("鏂板鎴愬姛");
-              }
-              this.submitLoading = false;
-              this.$router.push({
-                path: "/followvisit/tasklist",
-                query: { tasktopic: this.form.serviceType },
-              });
-            } else {
-              // 鉁� 鎺ュ彛杩斿洖閿欒鐮�
-              this.$modal.msgError(res.msg || "鎿嶄綔澶辫触");
-              this.submitLoading = false;
-            }
-          })
-          .catch((error) => {
-            // 鉁� 鎹曡幏鎺ュ彛璇锋眰寮傚父
-            console.error("鎻愪氦澶辫触:", error);
-            this.$modal.msgError(error.message || "缃戠粶寮傚父锛岃绋嶅悗閲嶈瘯");
-            this.submitLoading = false;
-          });
-      } catch (error) {
-        // 鉁� 鎹曡幏鍚屾浠g爜寮傚父
-        console.error("琛ㄥ崟鎻愪氦寮傚父:", error);
-        this.$modal.msgError(error.message || "琛ㄥ崟鎻愪氦寮傚父");
-        this.submitLoading = false;
-      }
-    },
-    handleDiseaseDeptChange(dept) {
-      console.log(dept, "dept");
-
-      // 褰撻�夋嫨绉戝鏃讹紝瀛樺偍鏁翠釜绉戝瀵硅薄
-      this.diseaseDept = dept;
-    },
-
-    handleDiseaseWardChange(ward) {
-      // 褰撻�夋嫨鐥呭尯鏃讹紝瀛樺偍鏁翠釜鐥呭尯瀵硅薄
-      this.diseaseWard = ward;
-    },
-    // ----------------------琛ㄦ牸瀛愮粍浠朵簨浠�
-
-    // 閫夋嫨棰勮
-    selectfn(row, type) {
-      // 妯℃澘鎯呭喌涓嬭幏鍙栨ā鏉夸俊鎭�
-      if (type == 1) {
-        this.libName = row.templateName;
-        this.libId = row.id;
-        this.questionList = row.ivrLibaTemplateScriptVOList;
-        getvFollowup({ id: row.id }).then((res) => {
-          if (res.code == 200) {
-            this.objyl = res.data;
-            // if (this.form.longTask) {
-            //   this.objyl.sendDay = 5;
-            // }
-            this.queryParamsdept.type = 2;
-            this.queryParamsdept.tempid = row.id;
-            this.tempDetpRelevanceslist = [];
-            this.tempbelongWards = [];
-            this.objyl.suitway = this.objyl.suitway.split(",");
-            this.questionList = res.data.ivrLibaTemplateScriptVOList;
-            this.getillness(row.id);
-            this.Variablehandling(res.data.ivrLibaTemplateScriptVOList, 1);
-            this.previewtf = true;
-          }
-        });
-        this.previewid = row.id;
-      } else if (type == 2) {
-      } else if (type == 3) {
-      }
-    },
-    // 棰勮
-    previewfnmb() {
-      getTaskparticty(this.form.templateid).then((res) => {
-        if (res.code == 200) {
-          this.objyl = res.data;
-          if (this.objyl.suitway)
-            this.objyl.suitway = this.objyl.suitway.split(",");
-          this.queryParamsdept.tempid = this.form.templateid;
-          this.queryParamsdept.type = 21;
-          // 鐤剧梾
-          this.getillness(this.form.libtemplateid);
-
-          selectInfoByCondition({ id: this.form.templateid }).then((res) => {
-            if (res.code == 200) {
-              this.previewtf = true;
-              this.previewtftype = 1;
-              this.questionList = res.data.ivrTaskTemplateScriptVOList;
-              this.questionList.forEach((item) => {
-                item.qremark = [];
-                item.ivrLibaScriptTargetoptionList =
-                  item.ivrTaskScriptTargetoptionList;
-              });
-              this.objyl.ivrLibaScriptTargetoptionList =
-                res.data.ivrTaskScriptTargetoptionList;
-            } else {
-            }
-          });
-        }
+    getillnesslist() {
+      getillnesslist({
+        pageNum: 1,
+        pageSize: 1000,
+      }).then((res) => {
+        this.donorchargeList = res.rows;
       });
     },
     getillness(id) {
@@ -1874,35 +1751,466 @@
         });
       }
     },
-    // 澶勭悊闂灞傚彉閲�
+    Getdetails() {
+      this.form = {
+        patTaskRelevances: [],
+        sendType: 1,
+        sendDay: 5,
+        templatename: "",
+        templateid: null,
+        libtemplateid: null,
+        kcb:
+          "浜茬埍鐨勬偅鑰�/瀹跺睘锛屾偍濂斤紒鎴戜滑鏄�" +
+          localStorage.getItem("orgname") +
+          "鐨勫尰鎶や汉鍛橈紝涓轰簡鏇村ソ鍦颁簡瑙f偍鐨勫悍澶嶆儏鍐碉紝璇锋偍鎶戒竴鐐瑰疂璐垫椂闂达紝杩涜鏈鍥炶鏈嶅姟銆�",
+        jsy: "璇锋偍娉ㄦ剰浼戞伅鍜岃惀鍏伙紝鐢熸椿涓婅鍔抽�哥粨鍚堬紝閫傚綋閿荤偧锛屾垝鐑熼檺閰掞紝淇濇寔蹇冩儏鑸掔晠锛屽畾鏈熷璇娿�傞偅鏈鍥炶灏卞埌杩欓噷锛岀鎮ㄨ韩浣撳仴搴凤紒",
+        serviceTaskScheduleVO: {
+          scheduleStyle: 0,
+          scheduleTimeNum: null,
+          scheduleTimeUnit: null,
+          maxLoopCount: 0,
+          currentLoopCount: 0,
+          currentSeq: 0,
+          nextSeq: 0,
+          nextExecuteTime: "",
+          scheduleBenchmark: 0,
+          scheduleBenchmarkCustomTime: "",
+          detailList: [],
+        },
+      };
+      this.questionList = [];
+      if (this.id) {
+        getTaskInfo({ taskid: this.id }).then((res) => {
+          if (res.code == 200) {
+            this.form = res.data;
+            // 濡傛灉杩斿洖浜� serviceTaskScheduleVO锛屽垯瑙f瀽鏄庣粏涓殑 content
+            if (
+              this.form.serviceTaskScheduleVO &&
+              this.form.serviceTaskScheduleVO.detailList
+            ) {
+              this.form.serviceTaskScheduleVO.detailList.forEach((item) => {
+                if (item.content) {
+                  try {
+                    const contentObj = JSON.parse(item.content);
+                    item.kcb = contentObj.kcb || "";
+                    item.jsy = contentObj.jsy || "";
+                    item.textParam = contentObj.text_param || {};
+                  } catch (e) {
+                    item.kcb = "";
+                    item.jsy = "";
+                    item.textParam = {};
+                  }
+                } else {
+                  item.kcb = "";
+                  item.jsy = "";
+                  item.textParam = {};
+                }
+              });
+            } else {
+              // 鑻ュ悗鍙版湭杩斿洖锛屽垯鍒濆鍖栦负绌哄璞�
+              this.form.serviceTaskScheduleVO = {
+                scheduleStyle: 0,
+                scheduleTimeNum: null,
+                scheduleTimeUnit: null,
+                maxLoopCount: 0,
+                currentLoopCount: 0,
+                currentSeq: 0,
+                nextSeq: 0,
+                nextExecuteTime: "",
+                scheduleBenchmark: 0,
+                scheduleBenchmarkCustomTime: "",
+                detailList: [],
+              };
+            }
+            // 鍘熸湁鍥炴樉
+            this.diseaseDept = {
+              deptCode: this.form.deptcode,
+              deptName: this.form.deptname,
+            };
+            this.diseaseWard = {
+              districtCode: this.form.leavehospitaldistrictcode,
+              districtName: this.form.leavehospitaldistrictname,
+            };
+            this.form.serviceType = this.serviceType;
+            this.form.patTaskRelevances = this.form.patTaskRelevances
+              ? this.form.patTaskRelevances
+              : [];
+            // 鑽搧鍏宠仈鍥炴樉
+            if (this.form.medicalCode) {
+              this.medicalCodes = this.form.medicalCode.split(",").filter(Boolean);
+              listMedication({ itemCode: this.form.medicalCode, pageNum: 1, pageSize: 200 }).then((res) => {
+                this.medicalOptions = res.rows || [];
+              });
+            }
+            this.overallCase = this.form.patTaskRelevances.concat();
+            this.checkList = this.form.preachform
+              ? this.form.preachform.split(",")
+              : [];
+            this.selectedOrder = this.form.preachformList || [];
+            this.overallCase.forEach((item) => {
+              if (item.endtime) {
+                item.endDay = this.daysBetween(item.endtime);
+              }
+            });
+            if (this.form.showDate)
+              this.daytime = this.form.showDate.split(",");
+            if (this.form.showTimeMorn) {
+              if (this.form.sendType == 3) {
+                this.time4 = this.form.showTimeMorn;
+              } else {
+                this.time1 = this.form.showTimeMorn.split(",");
+              }
+            }
+            if (this.form.taskid) {
+              this.listDept();
+            }
+            if (this.form.showTimeNoon)
+              this.time2 = this.form.showTimeNoon.split(",");
+            if (this.form.showTimeNight)
+              this.time3 = this.form.showTimeNight.split(",");
+            let filteredArray = this.convertFormat1ToFormat2(
+              this.form.textParam || {}
+            );
+            this.variableList = this.transitionList.concat(filteredArray);
+          } else {
+            this.$modal.msgError(res.code);
+          }
+          if (this.newadd) {
+            this.neWaddfn();
+          }
+        });
+      }
+    },
+    neWaddfn() {
+      this.id = null;
+      this.form.taskName = "";
+      this.form.sendState = null;
+      this.form.taskid = null;
+      this.overallCase = [];
+      this.form.patTaskRelevances = [];
+      this.daytime = [];
+      this.applydaytime = [];
+      this.time1 = "";
+      this.time2 = "";
+      this.time3 = "";
+      this.time4 = "";
+      // 閲嶇疆浠诲姟缁�
+      this.form.serviceTaskScheduleVO = {
+        scheduleStyle: 0,
+        scheduleTimeNum: null,
+        scheduleTimeUnit: null,
+        maxLoopCount: 0,
+        currentLoopCount: 0,
+        currentSeq: 0,
+        nextSeq: 0,
+        nextExecuteTime: "",
+        scheduleBenchmark: 0,
+        scheduleBenchmarkCustomTime: "",
+        detailList: [],
+      };
+    },
+
+    // ---------- 浠诲姟缁勬槑缁嗘搷浣� ----------
+    addDetail() {
+      const detailList = this.form.serviceTaskScheduleVO.detailList;
+      const seq = detailList.length + 1;
+      detailList.push({
+        seq: seq,
+        dayOffset: 0,
+        templateid: null,
+        libtemplateid: null,
+        templatename: "",
+        content: "",
+        kcb: "",
+        jsy: "",
+        textParam: {},
+      });
+    },
+    removeDetail(index) {
+      this.form.serviceTaskScheduleVO.detailList.splice(index, 1);
+      // 閲嶆柊璋冩暣搴忓彿
+      this.form.serviceTaskScheduleVO.detailList.forEach((item, idx) => {
+        item.seq = idx + 1;
+      });
+    },
+    handleTemplateSelect(index, row) {
+      // 浠� templateOptions 涓煡鎵鹃�変腑椤�
+      const selected = this.templateOptions.find(
+        (item) => item.id === row.templateid
+      );
+      if (selected) {
+        row.templatename = selected.templateName;
+        row.libtemplateid = selected.libtemplateid || selected.id; // 鍋囪鏈� libtemplateid
+      } else {
+        row.templatename = "";
+        row.libtemplateid = null;
+      }
+    },
+    remoteTemplate(query) {
+      if (query !== "") {
+        this.templateLoading = true;
+        getFollowuplist({ templateName: query, pageNum: 1, pageSize: 20 })
+          .then((res) => {
+            this.templateOptions = res.rows;
+            this.templateLoading = false;
+          })
+          .catch(() => {
+            this.templateLoading = false;
+          });
+      } else {
+        this.templateOptions = [];
+      }
+    },
+
+    // ---------- 鍒楄〃涓庢悳绱� ----------
+    handleQuerymb() {
+      getFollowuplist(this.topqueryParams).then((response) => {
+        this.userList = response.rows;
+        this.total = response.total;
+      });
+    },
+    resetQuerymb() {
+      this.topqueryParams = { pageNum: 1, pageSize: 10 };
+      this.handleQuerymb();
+    },
+    getList() {
+      // 鍗犱綅
+    },
+
+    // ---------- 妯℃澘鐩稿叧 ----------
+    selectfn(row, type) {
+      if (type == 1) {
+        this.libName = row.templateName;
+        this.libId = row.id;
+        this.questionList = row.ivrLibaTemplateScriptVOList;
+        getvFollowup({ id: row.id }).then((res) => {
+          if (res.code == 200) {
+            this.objyl = res.data;
+            this.queryParamsdept.type = 2;
+            this.queryParamsdept.tempid = row.id;
+            this.tempDetpRelevanceslist = [];
+            this.tempbelongWards = [];
+            this.objyl.suitway = this.objyl.suitway
+              ? this.objyl.suitway.split(",")
+              : [];
+            this.questionList = res.data.ivrLibaTemplateScriptVOList;
+            this.getillness(row.id);
+            this.Variablehandling(res.data.ivrLibaTemplateScriptVOList, 1);
+            this.previewtf = true;
+          }
+        });
+        this.previewid = row.id;
+      }
+    },
+    previewfnmb() {
+      getTaskparticty(this.form.templateid).then((res) => {
+        if (res.code == 200) {
+          this.objyl = res.data;
+          if (this.objyl.suitway)
+            this.objyl.suitway = this.objyl.suitway.split(",");
+          this.queryParamsdept.tempid = this.form.templateid;
+          this.queryParamsdept.type = 21;
+          this.getillness(this.form.libtemplateid);
+          selectInfoByCondition({ id: this.form.templateid }).then((res) => {
+            if (res.code == 200) {
+              this.previewtf = true;
+              this.previewtftype = 1;
+              this.questionList = res.data.ivrTaskTemplateScriptVOList;
+              this.questionList.forEach((item) => {
+                item.qremark = [];
+                item.ivrLibaScriptTargetoptionList =
+                  item.ivrTaskScriptTargetoptionList;
+              });
+              this.objyl.ivrLibaScriptTargetoptionList =
+                res.data.ivrTaskScriptTargetoptionList;
+            }
+          });
+        }
+      });
+    },
     Variablehandling(arr, type) {
       let Variablist = [];
       if (type == 1) {
-        // 寰幆闂
         arr.forEach((res) => {
-          // 寰幆閫夐」
-          JSON.parse(res.otherdata).forEach((item) => {
-            if (item.default != 1) {
-              Variablist.push({
-                value: item.variate,
-                fill: "",
-                name: item.variatename,
-              });
-            }
-          });
+          if (res.otherdata) {
+            JSON.parse(res.otherdata).forEach((item) => {
+              if (item.default != 1) {
+                Variablist.push({
+                  value: item.variate,
+                  fill: "",
+                  name: item.variatename,
+                });
+              }
+            });
+          }
         });
-
         const Aarr = Variablist.filter(
           (obj, index, self) =>
             index ===
             self.findIndex((t) => t.name === obj.name && t.value === obj.value)
         );
-
         this.variableList = this.transitionList.concat(Aarr);
-        // this.form.textParam = this.convertFormat2ToFormat1(this.variableList);
       }
     },
-    // 瀛愪换鍔′簩绾у脊妗�
+    variableDelete(index, row) {
+      this.variableList.splice(index, 1);
+      row.isoperation = 3;
+      this.delvariableList.push(row);
+    },
+
+    // ---------- 鍏宠仈閫夋嫨 ----------
+    handleDiseaseDeptChange(dept) {
+      this.diseaseDept = dept;
+    },
+    handleDiseaseWardChange(ward) {
+      this.diseaseWard = ward;
+    },
+
+    // ---------- 绉戝/鐥呭尯/鐤剧梾/鎵嬫湳 鎿嶄綔 ----------
+    listDept() {
+      this.leavehospitaldistrictcodes = [];
+      this.deptcodesWards = [];
+      this.queryParamsdept.taskId = this.form.taskid;
+
+      if (this.form.appltype == 5) {
+        // 浠诲姟缁勶細浣跨敤 rwz 鍓嶇紑鐨勪笓灞炴帴鍙�
+        rwztaskdepthospgetsonlist(this.queryParamsdept).then((res) => {
+          if (res.code == 200) {
+            let arr = res.rows;
+            arr.forEach((item) => {
+              if (item.deptType == 1) {
+                this.deptlist.push(item);
+                this.deptcodesWards.push(item.deptCode);
+              } else if (item.deptType == 2) {
+                this.hosplist.push(item);
+                this.leavehospitaldistrictcodes.push(item.deptCode);
+              }
+            });
+          }
+        });
+        rwztaskdiaggetlist(this.queryParamsdept).then((res) => {
+          if (res.code == 200) {
+            let arr = res.rows;
+            arr.forEach((item) => {
+              if (localStorage.getItem("orgname") == "鍗楀崕澶у闄勫睘绗竴鍖婚櫌") {
+                item.icdname = item.icd10name;
+                this.diagglist.push(item);
+              } else {
+               this.diagglist.push(item);
+              }
+              this.illnesscodes.push(item.icd10code);
+            });
+          }
+        });
+      } else {
+        // 鏅�氱被鍨�
+        taskdepthospgetsonlist(this.queryParamsdept).then((res) => {
+          if (res.code == 200) {
+            let arr = res.rows;
+            arr.forEach((item) => {
+              if (item.deptType == 1) {
+                this.deptlist.push(item);
+                this.deptcodesWards.push(item.deptCode);
+              } else if (item.deptType == 2) {
+                this.hosplist.push(item);
+                this.leavehospitaldistrictcodes.push(item.deptCode);
+              }
+            });
+          }
+        });
+        taskdiaggetlist(this.queryParamsdept).then((res) => {
+          if (res.code == 200) {
+            let arr = res.rows;
+            arr.forEach((item) => {
+              if (localStorage.getItem("orgname") == "鍗楀崕澶у闄勫睘绗竴鍖婚櫌") {
+                item.icdname = item.icd10name;
+                this.diagglist.push(item);
+              } else {
+                getillnesslist({ icdname: item.icd10name }).then((res) => {
+                  item.icdname = res.rows[0].icdname;
+                  this.diagglist.push(item);
+                });
+              }
+              this.illnesscodes.push(item.icd10code);
+            });
+          }
+        });
+      }
+      taskopergetlist(this.queryParamsdept).then((res) => {
+        if (res.code == 200) {
+          let arr = res.rows;
+          arr.forEach((item) => {
+            this.operlist.push(item);
+            this.operationcodes.push(item.opcode);
+          });
+        }
+      });
+    },
+    removetag(row) {
+      let result = this.deptlist
+        .filter((item) => item.deptCode == row)
+        .map((item) => item.id);
+      if (result.length) {
+        taskdepthospgetsondel(result).then((res) => {
+          if (res.code) this.$modal.msgSuccess("鍒犻櫎鎴愬姛");
+        });
+      }
+    },
+    removehpsp(row) {
+      let result = this.hosplist
+        .filter((item) => item.deptCode == row)
+        .map((item) => item.id);
+      if (result.length) {
+        taskdepthospgetsondel(result).then((res) => {
+          if (res.code) this.$modal.msgSuccess("鍒犻櫎鎴愬姛");
+        });
+      }
+    },
+    removeopera(row) {
+      let result = this.operlist
+        .filter((item) => item.opcode == row)
+        .map((item) => item.id);
+      if (result.length) {
+        taskoperhospgetsondel(result).then((res) => {
+          if (res.code) this.$modal.msgSuccess("鍒犻櫎鎴愬姛");
+        });
+      }
+    },
+    removediagg(row) {
+      // 浠诲姟缁勶細鏈湴鍒犻櫎鍗冲彲锛屽悗绔繚瀛樻椂缁熶竴鏇存柊
+      if (this.form.appltype == 5) {
+        this.diagglist = this.diagglist.filter((item) => item.icd10code != row);
+        return;
+      }
+      // 鏅�氱柧鐥呭叧鑱旓細璋冨悗绔帴鍙i�愭潯鍒犻櫎
+      let result = this.diagglist
+        .filter((item) => item.icd10code == row)
+        .map((item) => item.id);
+      if (result.length) {
+        taskdiaghospgetsondel(result).then((res) => {
+          if (res.code) {
+            this.diagglist = this.diagglist.filter(
+              (item) => item.icd10code != row
+            );
+            this.$modal.msgSuccess("鍒犻櫎鎴愬姛");
+          }
+        });
+      }
+    },
+    remoteopcode(name) {
+      // 鍗犱綅
+    },
+    remoteSearchMedical(query) {
+      if (!query) { this.medicalOptions = []; return; }
+      listMedication({ itemName: query, pageNum: 1, pageSize: 20 }).then((res) => {
+        this.medicalOptions = res.rows || [];
+      });
+    },
+    removeMedical(code) {
+      this.medicalCodes = this.medicalCodes.filter((c) => c !== code);
+    },
+
+    // ---------- 鎮h�呴�夋嫨 ----------
     handleAddpatient(row) {
       this.allpids = [];
       this.overallCase.forEach((item) => {
@@ -1910,7 +2218,6 @@
       });
       if (this.patientqueryParams.allhosp == 1) {
         this.tableLabelhz = [
-          // { label: "鍏ラ櫌鏃ユ湡", width: "170", prop: "starttime" },
           { label: "鍑洪櫌鏃ユ湡", width: "150", prop: "endtime" },
           { label: "鎮h��", width: "", prop: "name" },
           { label: "韬唤璇�", width: "200", prop: "idcardno" },
@@ -1962,12 +2269,7 @@
       }
       if (this.patientqueryParams.allhosp == 1) {
         this.patientqueryParams.cry = 1;
-      } else if (this.patientqueryParams.allhosp == 4) {
-        //  this.patientqueryParams.cry = 0;
-        //  this.patientqueryParams.allhosp = "1";
       }
-      // 鏉ユ簮鍒ゆ柇
-
       if (this.patientqueryParams.searchscope == 1) {
         this.patientqueryParams.leaveldeptcodes = store.getters.belongDepts.map(
           (obj) => obj.deptCode
@@ -1992,20 +2294,13 @@
           }
         });
         this.patienttotal = response.total;
-        this.loading = false;
         this.Restorecheck();
       });
       this.dialogVisiblepatient = true;
     },
-    handleUpdate() {},
-    handleDelete() {},
-    handleExport() {},
-    // 閫夋嫨鎮h�呰〃鏁版嵁
     handleSelectionChange(selection) {
       this.SelectPatientslist = structuredClone(selection);
       this.multiple = !selection.length;
-
-      // 璧嬪�肩粰鏁翠綋閫変腑鏁扮粍
       this.SelectPatientslist.forEach((item) => {
         const isExist = this.overallCase.find((obj) => obj.name == item.name);
         if (!isExist) {
@@ -2016,47 +2311,37 @@
           item.deptCode = item.deptcode;
           item.deptName = item.dept;
           item.admindate = item.inhosptime;
-          item.sfzh = item.idcardno;
-          if (this.patientqueryParams.allhosp == 6) {
-            item.patfrom = 1;
-          }
-          if (this.patientqueryParams.allhosp == 1) {
+          if (this.patientqueryParams.allhosp == 6) item.patfrom = 1;
+          if (this.patientqueryParams.allhosp == 1)
             item.visittime = item.endtime;
-          } else if (this.patientqueryParams.allhosp == 4) {
+          else if (this.patientqueryParams.allhosp == 4)
             item.visittime = item.starttime;
-          } else if (this.patientqueryParams.allhosp == 2) {
+          else if (this.patientqueryParams.allhosp == 2)
             item.visittime = item.admitdate;
-          }
           this.overallCase.push(item);
           this.form.patTaskRelevances.push(item);
         }
       });
     },
-    // 鍒囨崲椤靛悗鎭㈠閫変腑
     Restorecheck() {
       const allid = this.overallCase.map((item) => item.patid);
-      const overlap = this.patientuserList.filter((value) => {
-        return allid.includes(value.patid);
-      });
-      // 淇濇寔ids鍜屽綋鍓嶉〉闈㈢殑鍚屾鎬�
+      const overlap = this.patientuserList.filter((value) =>
+        allid.includes(value.patid)
+      );
       this.SelectPatientslist = overlap;
       this.toggleSelection(overlap);
     },
-    // 鎸傝浇閫夋嫨鐘舵��
     toggleSelection(rows) {
       if (rows) {
-        this.decision = true;
         this.$nextTick(() => {
           rows.forEach((row) => {
             this.$refs.multipleTable.toggleRowSelection(row, true);
           });
-          this.decision = false;
         });
       } else {
         this.$refs.multipleTable.clearSelection();
       }
     },
-    // 鍒犻櫎閫変腑鎮h��
     detailhz(row, info) {
       this.$modal
         .confirm('鏄惁纭鍒犻櫎鎮h��"' + row.name + '"鐨勬湇鍔¢」锛�')
@@ -2072,12 +2357,7 @@
           this.$modal.msgSuccess("鍒犻櫎鎴愬姛");
         });
     },
-    getList() {},
     handleQuery() {
-      console.log(
-        "this.patientqueryParams.allhosp",
-        this.patientqueryParams.allhosp
-      );
       if (this.patientqueryParams.topica == 0) {
         this.patientqueryParams.leavehospitaldistrictcodes =
           store.getters.leavehospitaldistrictcodes;
@@ -2101,284 +2381,51 @@
       )
         this.patientqueryParams.leaveldeptcodes = null;
       this.handleAddpatient();
-
-      console.log(
-        "this.patientqueryParams.allhosp",
-        this.patientqueryParams.allhosp
-      );
-    },
-
-    resetQuerymb() {
-      this.topqueryParams = { svyname: "" };
-      this.handleQuerymb();
     },
     resetQuery() {
       this.patientqueryParams = {
-        pageNum: 1, //
+        pageNum: 1,
         pageSize: 10,
-        topica: 1, //0鍏ㄩ儴1绉戝2鐥呭尯
+        topica: 1,
         leaveldeptcodes: [],
         leavehospitaldistrictcodes: [],
       };
       this.handleQuery();
     },
-    handleQuerymb() {
-      getFollowuplist(this.topqueryParams).then((response) => {
-        this.userList = response.rows;
-        this.total = response.total;
-      });
-    },
     handleClosehz() {
       this.dialogVisiblepatient = false;
     },
-    // 涓婁竴姝�
+    AddDispatchpatients() {
+      this.dialogVisiblepatient = false;
+    },
+    handleUpdate() {},
+    handleDelete() {},
+    handleExport() {},
+
+    // ---------- 姝ラ瀵艰埅 ----------
+    nextstep() {
+      this.$refs["form"].validate((valid) => {
+        if (valid) {
+          if (this.Editprogress <= 3) this.Editprogress++;
+        } else {
+          this.$modal.msgError("琛ㄥ崟鍐呭鏈畬鍠勶紝璇锋鏌�");
+        }
+      });
+    },
     laststep() {
       this.Editprogress--;
     },
-    // 鎻愪氦琛ㄥ崟
     resetForm(formName) {
       this.$refs[formName].resetFields();
     },
-    // 棰勮妯℃澘
-    PreviewTemplate() {},
-    Acknowledgereference() {
-      this.quote = true;
-    },
-    // 鑾峰彇璇︽儏
-    Getdetails() {
-      this.form = {
-        patTaskRelevances: [],
-        sendType: 1,
-        sendDay: 5,
-        templatename: "",
-        templateid: null,
-        libtemplateid: null,
-        kcb:
-          "浜茬埍鐨勬偅鑰�/瀹跺睘锛屾偍濂斤紒鎴戜滑鏄�" +
-          localStorage.getItem("orgname") +
-          "鐨勫尰鎶や汉鍛橈紝涓轰簡鏇村ソ鍦颁簡瑙f偍鐨勫悍澶嶆儏鍐碉紝璇锋偍鎶戒竴鐐瑰疂璐垫椂闂达紝杩涜鏈鍥炶鏈嶅姟銆�",
-        jsy: "璇锋偍娉ㄦ剰浼戞伅鍜岃惀鍏伙紝鐢熸椿涓婅鍔抽�哥粨鍚堬紝閫傚綋閿荤偧锛屾垝鐑熼檺閰掞紝淇濇寔蹇冩儏鑸掔晠锛屽畾鏈熷璇娿�傞偅鏈鍥炶灏卞埌杩欓噷锛岀鎮ㄨ韩浣撳仴搴凤紒",
-      };
 
-      this.questionList = [];
-      if (this.id) {
-        getTaskInfo({ taskid: this.id }).then((res) => {
-          let filteredArray = "";
-          if (res.code == 200) {
-            this.form = res.data;
-            this.diseaseDept = {
-              deptCode: this.form.deptcode,
-              deptName: this.form.deptname,
-            };
-            this.diseaseWard = {
-              districtCode: this.form.leavehospitaldistrictcode,
-              districtName: this.form.leavehospitaldistrictname,
-            };
-            console.log(this.diseaseWard, this.diseaseDept);
-
-            this.form.serviceType = this.serviceType;
-            this.form.patTaskRelevances = this.form.patTaskRelevances
-              ? this.form.patTaskRelevances
-              : [];
-            this.overallCase = this.form.patTaskRelevances.concat();
-            this.checkList = this.form.preachform.split(",") || [];
-            this.selectedOrder = this.form.preachformList || [];
-
-            this.overallCase.forEach((item) => {
-              if (item.endtime) {
-                item.endDay = this.daysBetween(item.endtime);
-              }
-            });
-            if (this.form.showDate)
-              this.daytime = this.form.showDate.split(",");
-            if (this.form.showTimeMorn) {
-              if (this.form.sendType == 3) {
-                this.time4 = this.form.showTimeMorn;
-              } else {
-                this.time1 = this.form.showTimeMorn.split(",");
-              }
-            }
-            if (this.form.taskid) {
-              this.listDept();
-            }
-            if (this.form.showTimeNoon)
-              this.time2 = this.form.showTimeNoon.split(",");
-            if (this.form.showTimeNight)
-              this.time3 = this.form.showTimeNight.split(",");
-            filteredArray = this.convertFormat1ToFormat2(this.form.textParam);
-            this.variableList = this.transitionList.concat(filteredArray);
-          } else {
-            this.$modal.msgError(res.code);
-          }
-          if (this.newadd) {
-            this.neWaddfn();
-          }
-        });
-      }
-    },
-    // 渚濈収鏂板鏃跺鐞�
-    neWaddfn() {
-      this.id = null;
-      this.form.taskName = "";
-      this.form.sendState = null;
-      this.form.taskid = null;
-      this.overallCase = [];
-      this.form.patTaskRelevances = [];
-      this.daytime = []; //鏃ユ湡
-      this.applydaytime = []; //璁$畻鏃ユ湡
-      this.time1 = ""; //涓婂崍鏃堕棿娈�
-      this.time2 = ""; //涓嬪崍鏃堕棿娈�
-      this.time3 = ""; //鏅氫笂鏃堕棿娈�
-      this.time4 = ""; //鏅氫笂鏃堕棿娈�
-    },
-    // 鑾峰彇绉戝鍒楄〃
-    listDept() {
-      this.leavehospitaldistrictcodes = [];
-      this.deptcodesWards = [];
-      this.queryParamsdept.taskId = this.form.taskid;
-      taskdepthospgetsonlist(this.queryParamsdept).then((res) => {
-        if (res.code == 200) {
-          let arr = res.rows;
-          arr.forEach((item) => {
-            if (item.deptType == 1) {
-              this.deptlist.push(item);
-              this.deptcodesWards.push(item.deptCode);
-            } else if (item.deptType == 2) {
-              this.hosplist.push(item);
-              this.leavehospitaldistrictcodes.push(item.deptCode);
-            }
-          });
-        }
-      });
-      taskdiaggetlist(this.queryParamsdept).then((res) => {
-        if (res.code == 200) {
-          let arr = res.rows;
-          arr.forEach((item) => {
-            getillnesslist({
-              icdname: item.icd10name,
-            }).then((res) => {
-              item.icdname = res.rows[0].icdname;
-              this.diagglist.push(item);
-            });
-            this.illnesscodes.push(item.icd10code);
-          });
-        }
-      });
-      taskopergetlist(this.queryParamsdept).then((res) => {
-        if (res.code == 200) {
-          let arr = res.rows;
-          arr.forEach((item) => {
-            this.operlist.push(item);
-            this.operationcodes.push(item.opcode);
-          });
-        }
-      });
-    },
-    getillnesslist() {
-      getillnesslist({
-        pageNum: 1,
-        pageSize: 1000,
-      }).then((row) => {
-        this.donorchargeList = res.rows;
-      });
-      // getbaseopera({
-      //   pageNum: 1,
-      //   pageSize: 1000,
-      // }).then((row) => {
-      //   this.baseoperaList = res.rows;
-      // });
-    },
-    // 鎵嬫湳鏌ヨ
-    remoteopcode(name) {
-      // if (name) {
-      //   getbaseopera({
-      //     pageNum: 1,
-      //     pageSize: 1000,
-      //     opdesc: name,
-      //   }).then((res) => {
-      //     this.baseoperaList = res.rows;
-      //   });
-      // }
+    // ---------- 鏈嶅姟褰㈠紡鎺掑簭 ----------
+    checkSelectionChange(selectedValues, selectedOrder) {
+      this.selectedOrder = selectedValues || [];
     },
 
-    // 浠诲姟绉戝鍒犻櫎瑙﹀彂
-    removetag(row) {
-      let result = this.deptlist
-        .filter((item) => item.deptCode == row)
-        .map((item) => item.id);
-
-      if (result.length) {
-        taskdepthospgetsondel(result).then((res) => {
-          if (res.code) {
-            this.$modal.msgSuccess("鍒犻櫎鎴愬姛");
-          }
-        });
-      }
-    },
-    // 闄㈠尯鍒犻櫎鍒犻櫎瑙﹀彂
-    removehpsp(row) {
-      let result = this.hosplist
-        .filter((item) => item.deptCode == row)
-        .map((item) => item.id);
-      if (result.length) {
-        taskdepthospgetsondel(result).then((res) => {
-          if (res.code) {
-            this.$modal.msgSuccess("鍒犻櫎鎴愬姛");
-          }
-        });
-      }
-    },
-    // 鎵嬫湳鍒犻櫎瑙﹀彂
-    removeopera(row) {
-      let result = this.operlist
-        .filter((item) => item.opcode == row)
-        .map((item) => item.id);
-      if (result.length) {
-        taskoperhospgetsondel(result).then((res) => {
-          if (res.code) {
-            this.$modal.msgSuccess("鍒犻櫎鎴愬姛");
-          }
-        });
-      }
-    },
-    // 鐤剧梾鍒犻櫎瑙﹀彂
-    removediagg(row) {
-      let result = this.diagglist
-        .filter((item) => item.icd10code == row)
-        .map((item) => item.id);
-      if (result.length) {
-        taskdiaghospgetsondel(result).then((res) => {
-          if (res.code) {
-            this.diagglist = this.diagglist.filter(
-              (item) => item.icd10code != row
-            );
-            this.$modal.msgSuccess("鍒犻櫎鎴愬姛");
-          }
-        });
-      }
-    },
-    getFollowupclassify() {
-      getFollowupclassify({}).then((res) => {
-        this.optionsclass = res.rows;
-      });
-    },
-    // 鏂板娲鹃�佹偅鑰�
-    AddDispatchpatients() {
-      // this.SelectPatientslist.forEach((item) => {
-      //   item.isoperation = 1;
-      // });
-      // this.form.patTaskRelevances.push(...this.SelectPatientslist);
-      // this.overallCase.push(...this.SelectPatientslist);
-      this.dialogVisiblepatient = false;
-    },
-
-    variableDelete(index, row) {
-      this.variableList.splice(index, 1);
-      row.isoperation = 3;
-      this.delvariableList.push(row);
-    },
-    // 鏃堕棿----------
-    changeTime(row) {
+    // ---------- 鏃堕棿澶勭悊 ----------
+    changeTime() {
       this.processingTime();
     },
     Totaldate(row) {
@@ -2394,27 +2441,19 @@
     getDates(startDate, endDate) {
       const dates = [];
       let currentDate = new Date(startDate);
-
       while (currentDate <= endDate) {
         dates.push(this.$moment(currentDate).format("YYYY-MM-DD"));
         currentDate.setDate(currentDate.getDate() + 1);
       }
-
       return dates;
     },
-    // 鏃堕棿鏈�缁堝鐞嗘柟娉�
     processingTime() {
       const combinedData = [];
       let serialnumber = 1;
-      if (this.time3[0]) {
-        serialnumber = 3;
-      } else if (this.time2[0]) {
-        serialnumber = 2;
-      } else if (this.time1[0]) {
-        serialnumber = 1;
-      } else {
-        return;
-      }
+      if (this.time3 && this.time3[0]) serialnumber = 3;
+      else if (this.time2 && this.time2[0]) serialnumber = 2;
+      else if (this.time1 && this.time1[0]) serialnumber = 1;
+      else return;
 
       for (let i = 0; i < this.applydaytime.length; i++) {
         combinedData.push({
@@ -2438,15 +2477,13 @@
         }
       }
       this.form.sendTimeslot = combinedData;
-      // 灞曠ず鏁版嵁涓存椂瀛樺偍鏃ユ湡銆佹棭銆佷腑銆佹櫄
-
       this.form.showDate = this.daytime.join(",");
       if (this.time1) this.form.showTimeMorn = this.time1.join(",");
       if (this.time2) this.form.showTimeNoon = this.time2.join(",");
       if (this.time3) this.form.showTimeNight = this.time3.join(",");
     },
 
-    // 淇濆瓨/鏇存柊浠诲姟妯℃澘
+    // ---------- 妯℃澘淇濆瓨涓庢浛鎹� ----------
     previewFn() {
       if (Array.isArray(this.objyl.suitway)) {
         this.objyl.suitway = this.objyl.suitway.join(",");
@@ -2460,9 +2497,6 @@
       if (this.form.id) {
         this.objyl.taskid = this.form.id;
       }
-      // if (!this.objyl.sendDay) {
-      //   this.objyl.sendDay = "5";
-      // }
       if (this.form.templateid) {
         deleteTaskparticty(this.form.templateid).then((res) => {
           if (res.code == 200) {
@@ -2474,10 +2508,9 @@
               this.putbelongDepts(response.data);
               this.form.templatename = this.objyl.templateName;
               this.$modal.msgSuccess("鏇挎崲妯℃澘鎴愬姛");
-              this.drawermb = false; //閫夋嫨妯℃澘寮圭獥
-              this.previewtf = false; //棰勮
+              this.drawermb = false;
+              this.previewtf = false;
               if (this.skip) {
-                // 璺宠浆鍓嶅線淇敼
                 this.$router.push({
                   path: "/knowledge/taskub/",
                   query: { id: response.data },
@@ -2495,10 +2528,9 @@
           this.putbelongDepts(response.data);
           this.form.templatename = this.objyl.templateName;
           this.$modal.msgSuccess("閫夋嫨妯℃澘鎴愬姛");
-          this.drawermb = false; //閫夋嫨妯℃澘寮圭獥
-          this.previewtf = false; //棰勮
+          this.drawermb = false;
+          this.previewtf = false;
           if (this.skip) {
-            // 璺宠浆鍓嶅線淇敼
             this.$router.push({
               path: "/knowledge/taskub/",
               query: { id: response.data },
@@ -2507,7 +2539,6 @@
         });
       }
     },
-    // 淇濆瓨绉戝/鐥呭尯
     putbelongDepts(id) {
       this.tempDetpRelevanceslistform.forEach((item) => {
         item.tempid = id;
@@ -2528,28 +2559,6 @@
         }
       });
     },
-    checkSelectionChange(selectedValues, selectedOrder) {
-      this.selectedOrder = selectedValues || [];
-      console.log("褰撳墠閫変腑:", selectedValues);
-      console.log("閫変腑椤哄簭:", selectedOrder);
-    },
-    // 鏈嶅姟褰㈠紡閫夊彇
-    handleCheckedCitiesChange(row) {
-      console.log(row, "鏈嶅姟");
-      this.foncheckList = this.checkboxlist.filter((obj) =>
-        row.includes(obj.value)
-      );
-    },
-    // 鏈嶅姟褰㈠紡鍒犻櫎
-    handleClosetag(tag) {
-      console.log(tag, "tag");
-      console.log(this.foncheckList, "foncheckList");
-      this.checkList = this.checkList.filter((item) => item != tag.value);
-      this.foncheckList = this.foncheckList.filter(
-        (obj) => obj.value !== tag.value
-      );
-    },
-    // 绉戝澶勭悊
     Departmenttreatment() {
       if (!this.form.taskid) {
         this.templateor = true;
@@ -2568,10 +2577,7 @@
             }
             this.objyl.libtemplateid = this.objyl.id;
             this.form.libtemplateid = this.objyl.id;
-
             this.objyl.isoperation = 1;
-            console.log(this.objyl, "this.objyl");
-
             this.objyl.ivrLibaTemplateScriptVOList.forEach((item) => {
               item.ivrTaskScriptTargetoptionList =
                 item.ivrLibaScriptTargetoptionList;
@@ -2594,12 +2600,11 @@
         }, 1000);
       }
     },
-    // 鍓嶅線淇敼
     Modifytemplate() {
       if (this.form.templateid && this.previewtftype) {
         this.$modal.confirm("鏄惁鍓嶅線淇敼浠诲姟妯℃澘璇︾粏鍐呭锛�").then(() => {
-          this.drawermb = false; //閫夋嫨妯℃澘寮圭獥
-          this.previewtf = false; //棰勮
+          this.drawermb = false;
+          this.previewtf = false;
           this.$router.push({
             path: "/knowledge/taskub/",
             query: { id: this.form.templateid },
@@ -2609,25 +2614,228 @@
         this.$modal
           .confirm("褰撳墠涓哄熀纭�棰勮鏄惁鍒涘缓浠诲姟妯℃澘骞跺墠寰�淇敼璇︽儏锛�")
           .then(() => {
-            // 璧板彇鍏堢粦瀹氬悗淇敼鎿嶄綔
             this.Departmenttreatment();
             this.skip = true;
           });
       }
     },
+
+    // ---------- 鎻愪氦琛ㄥ崟 ----------
+    submitForm(type) {
+      if (this.submitLoading) return;
+      this.submitLoading = true;
+
+      try {
+        if (this.templateor && type) {
+          this.templateor = false;
+        }
+        if (this.time4 && this.form.sendType == 3) {
+          this.form.showTimeMorn = this.time4;
+        }
+        this.form.sendTimeslot = [
+          {
+            begantime: this.time4,
+            endtime: "",
+            xh: 1,
+          },
+        ];
+
+        if (this.form.appltype == 1) {
+          this.leavehospitaldistrictcodes = [];
+          this.operationcodes = [];
+          this.illnesscodes = [];
+        } else if (this.form.appltype == 2) {
+          this.deptcodesWards = [];
+          this.operationcodes = [];
+          this.illnesscodes = [];
+        } else if (this.form.appltype == 3) {
+          this.deptcodesWards = [];
+          this.leavehospitaldistrictcodes = [];
+          this.operationcodes = [];
+        } else if (this.form.appltype == 4) {
+          this.deptcodesWards = [];
+          this.illnesscodes = [];
+          this.leavehospitaldistrictcodes = [];
+        } else if (this.form.appltype == 6) {
+          this.deptcodesWards = [];
+          this.leavehospitaldistrictcodes = [];
+          this.illnesscodes = [];
+          this.operationcodes = [];
+        }
+
+        // 鏈嶅姟褰㈠紡鏍¢獙
+        if (this.checkList) {
+          this.form.preachform = this.checkList.join(",") || [];
+          this.form.preachformList = this.selectedOrder || [];
+        } else {
+          this.$modal.msgError("璇烽�夋嫨鏈嶅姟绫诲瀷");
+          this.submitLoading = false;
+          return;
+        }
+
+        // 浠诲姟鍏宠仈鏉′欢鏍¢獙锛堜换鍔$粍鍏佽鏃犲叧鑱旀潯浠讹級
+        const hasCondition =
+          this.deptcodesWards[0] ||
+          this.leavehospitaldistrictcodes[0] ||
+          this.diagglist[0] ||
+          this.operationcodes[0] ||
+          this.medicalCodes[0] ||
+          this.form.longTask == 2 ||
+          this.serviceType == 3 ||
+          this.form.appltype == 5; // 浠诲姟缁勮烦杩囧己鍒跺叧鑱�
+
+        if (!hasCondition) {
+          this.$modal.msgError("璇烽�夋嫨浠诲姟鍏宠仈鏉′欢");
+          this.submitLoading = false;
+          return;
+        }
+
+        // 浠诲姟缁勯�氳繃鏄庣粏鍒楄〃鍚勮嚜閫夋嫨妯℃澘锛屼富妯℃澘鍙负绌�
+        if (
+          !this.form.templatename &&
+          !this.templateor &&
+          this.form.appltype != 5
+        ) {
+          this.$modal.msgError("鏈�夋嫨妯℃澘");
+          this.submitLoading = false;
+          return;
+        }
+
+        const isValidTime =
+          (this.form.sendType == 1 && this.time1) ||
+          this.form.sendType == 2 ||
+          (this.form.sendType == 3 && this.time4) ||
+          this.form.longTask;
+        if (!isValidTime) {
+          this.submitLoading = false;
+          this.$modal.msgError("鏃堕棿淇℃伅缂哄け");
+          return;
+        }
+
+        // 澶勭悊鍙橀噺
+        const filteredArray = this.variableList.filter(
+          (item) =>
+            item.name !== "濮撳悕" && item.name !== "鐢佃瘽" && item.name !== "鍦板潃"
+        );
+        this.form.textParam = this.convertFormat2ToFormat1(filteredArray);
+
+        // 澶勭悊浠诲姟缁勬槑缁嗙殑 content
+        if (this.form.appltype == 5 && this.form.serviceTaskScheduleVO) {
+          this.form.serviceTaskScheduleVO.detailList.forEach((item) => {
+            // 缁勮 content
+            const contentObj = {
+              kcb: item.kcb || "",
+              jsy: item.jsy || "",
+              text_param: item.textParam || {},
+            };
+            item.content = JSON.stringify(contentObj);
+            // 鍒犻櫎涓存椂瀛楁锛岄伩鍏嶆彁浜ゅ浣欏瓧娈�
+            delete item.kcb;
+            delete item.jsy;
+            delete item.textParam;
+          });
+          // 灏嗕富瀵硅薄鏀惧叆 form 鎻愪氦
+        }
+        if (this.form.appltype == 5) {
+          console.log(this.form,'杩涘叆浠诲姟缁勯厤缃�');
+
+          this.form.serviceTaskScheduleVO.icd10codes = this.form.icd10code;
+          this.form.serviceTaskScheduleVO.wardCodes =
+            this.form.leavehospitaldistrictcode;
+          this.form.serviceTaskScheduleVO.deptCodes = this.form.deptcode;
+        }
+        if (this.form.taskid) {
+          this.form.isoperation = 2;
+        } else {
+          this.form.isoperation = 1;
+        }
+        if (!this.form.type) {
+          this.form.type = this.$route.query.type;
+        }
+
+        if (this.form.appltype == 1 || this.form.appltype == 2) {
+          this.form.deptcode = this.deptcodesWards.join(",");
+          this.form.leavehospitaldistrictcode =
+            this.leavehospitaldistrictcodes.join(",");
+        } else {
+          if (this.diseaseDept) {
+            this.form.deptcode = this.diseaseDept.deptCode;
+            this.form.deptname = this.diseaseDept.deptName;
+          }
+          if (this.diseaseWard) {
+            this.form.leavehospitaldistrictcode = this.diseaseWard.districtCode;
+            this.form.leavehospitaldistrictname = this.diseaseWard.districtName;
+          }
+        }
+        // 鑽搧鍏宠仈锛氱粍瑁呴�楀彿鍒嗛殧鐨勭紪鐮�/鍚嶇О/鍘傚
+        if (this.form.appltype == 6) {
+          const selectedMeds = this.medicalOptions.filter((m) =>
+            this.medicalCodes.includes(m.itemCode)
+          );
+          this.form.medicalCode = this.medicalCodes.join(",");
+          this.form.medicalName = selectedMeds.map((m) => m.itemName).join(",");
+          this.form.medicalCompany = selectedMeds.map((m) => m.manufacturerName).join(",");
+        }
+
+        this.form.serviceType = this.serviceType;
+
+        this.form.opcode = this.operationcodes.join(",");
+        this.form.icd10code = this.diagglist
+          .map((item) => item.icdcode)
+          .join(",");
+        this.form.icd10name = this.diagglist
+          .map((item) => item.icdname)
+          .join(",");
+        // 鐤剧梾/鎵嬫湳鍏宠仈鐨勭瀹�/鐥呭尯鏍¢獙
+        if (this.form.appltype == 3 || this.form.appltype == 4) {
+          const hasDept = this.diseaseDept?.deptCode;
+          const hasWard = this.diseaseWard?.districtCode;
+          if (!hasDept && !hasWard) {
+            this.$modal.msgError("褰撳墠鐤剧梾闇�鍏宠仈绉戝鎴栫梾鍖�");
+            this.submitLoading = false;
+            return;
+          }
+          this.form.deptcode = hasDept;
+          this.form.leavehospitaldistrictcode = hasWard;
+        }
+        Editsingletask(this.form)
+          .then((res) => {
+            if (res.code == 200) {
+              if (this.form.taskid) {
+                this.$modal.msgSuccess("淇敼鎴愬姛");
+              } else {
+                this.$modal.msgSuccess("鏂板鎴愬姛");
+              }
+              this.submitLoading = false;
+              this.$router.push({
+                path: "/followvisit/tasklist",
+                query: { tasktopic: this.form.serviceType },
+              });
+            } else {
+              this.$modal.msgError(res.msg || "鎿嶄綔澶辫触");
+              this.submitLoading = false;
+            }
+          })
+          .catch((error) => {
+            console.error("鎻愪氦澶辫触:", error);
+            this.$modal.msgError(error.message || "缃戠粶寮傚父锛岃绋嶅悗閲嶈瘯");
+            this.submitLoading = false;
+          });
+      } catch (error) {
+        console.error("琛ㄥ崟鎻愪氦寮傚父:", error);
+        this.$modal.msgError(error.message || "琛ㄥ崟鎻愪氦寮傚父");
+        this.submitLoading = false;
+      }
+    },
   },
 };
 </script>
-
 <style lang="scss" scoped>
-.Questionnairemanagement {
-}
 .leftvlue-jbxx {
   margin-top: 10px;
 }
 .sidecolumn {
   width: 100%;
-  // min-height: 12vh;
   margin: 20px;
   margin-bottom: 0;
   padding: 30px;
@@ -2637,17 +2845,15 @@
     0 0 6px 0 rgba(0, 0, 0, 0.04);
 }
 .leftvlue {
-  //   display: flex;
-  //   flex: 1;
   width: 100%;
   margin-top: 20px;
-  //   margin: 20px;
   padding: 30px;
   background: #ffff;
   border: 1px solid #dcdfe6;
   -webkit-box-shadow: 0 2px 4px 0 rgba(0, 0, 0, 0.12),
     0 0 6px 0 rgba(0, 0, 0, 0.04);
 }
+
 .examine-jic {
   margin: 20px;
   .headline {
@@ -2657,7 +2863,6 @@
     padding-left: 5px;
     margin-bottom: 10px;
     display: flex;
-    // justify-content: space-between;
     .Add-details {
       font-size: 18px;
       color: #02a7f0;
@@ -2692,10 +2897,10 @@
     }
   }
 }
+
 .xinz-infs {
   font-size: 18px;
   line-height: 48px;
-
   .el-tag + .el-tag {
     margin-left: 10px;
   }
@@ -2703,12 +2908,8 @@
 
 .preview-left {
   margin: 20px;
-  //   margin: 20px;
   padding: 30px;
   background: #ffff;
-  // border: 1px solid #dcdfe6;
-  // -webkit-box-shadow: 0 2px 4px 0 rgba(0, 0, 0, 0.12),
-  //   0 0 6px 0 rgba(0, 0, 0, 0.04);
   .scriptTopic-dev {
     margin-bottom: 25px;
     font-size: 20px !important;
@@ -2717,6 +2918,7 @@
     }
   }
 }
+
 .jic-value {
   font-size: 20px;
   border-top: 1px solid #a7abac;
@@ -2744,6 +2946,7 @@
     }
   }
 }
+
 ::v-deep .addtopic-input {
   input {
     background: #02a7f0;
@@ -2757,9 +2960,6 @@
 ::v-deep.el-row {
   margin-bottom: 10px;
 }
-// ::v-deep.el-input--medium {
-//   font-size: 24px !important;
-// }
 ::v-deep.ruleFormaa.el-select {
   display: inline-block;
   position: relative;
@@ -2773,9 +2973,6 @@
   width: 22px;
   height: 22px;
 }
-// ::v-deep.topic-dev.el-radio__label {
-//   font-size: 24px;
-// }
 ::v-deep.el-radio-group {
   span {
     font-size: 18px;
diff --git a/src/views/sfstatistics/percentage/components/ChartDialog.vue b/src/views/sfstatistics/percentage/components/ChartDialog.vue
index 4172811..f8deb36 100644
--- a/src/views/sfstatistics/percentage/components/ChartDialog.vue
+++ b/src/views/sfstatistics/percentage/components/ChartDialog.vue
@@ -22,355 +22,366 @@
 </template>
 
 <script>
-import * as echarts from 'echarts'
+import * as echarts from "echarts";
 
 export default {
-  name: 'ChartDialog',
+  name: "ChartDialog",
   props: {
     visible: {
       type: Boolean,
-      default: false
+      default: false,
+    },
+    statisticaltype: {
+      type: Number,
+      default: 1,
     },
     data: {
       type: Array,
-      default: () => []
+      default: () => [],
     },
     activeTab: {
       type: String,
-      default: 'first'
-    }
+      default: "first",
+    },
   },
   data() {
     return {
       pieChart: null,
-      barLineChart: null
-    }
+      barLineChart: null,
+    };
   },
   watch: {
     visible(newVal) {
       if (newVal) {
         this.$nextTick(() => {
-          this.initCharts()
-        })
+          this.initCharts();
+        });
       } else {
-        this.destroyCharts()
+        this.destroyCharts();
       }
-    }
+    },
   },
   mounted() {
     if (this.visible) {
       this.$nextTick(() => {
-        this.initCharts()
-      })
+        this.initCharts();
+      });
     }
   },
   beforeDestroy() {
-    this.destroyCharts()
+    this.destroyCharts();
   },
   methods: {
     initCharts() {
-      this.initPieChart()
-      this.initBarLineChart()
+      this.initPieChart();
+      this.initBarLineChart();
     },
 
     initPieChart() {
-      const pieDom = document.getElementById('pieChart')
-      if (!pieDom) return
+      const pieDom = document.getElementById("pieChart");
+      if (!pieDom) return;
 
       if (this.pieChart) {
-        this.pieChart.dispose()
+        this.pieChart.dispose();
       }
 
-      this.pieChart = echarts.init(pieDom)
+      this.pieChart = echarts.init(pieDom);
 
       // 鏍规嵁褰撳墠tab璁$畻楗煎浘鏁版嵁
-      const pieData = this.getPieChartData()
+      const pieData = this.getPieChartData();
 
       const pieOption = {
         title: {
-          text: '闅忚鐘舵�佸垎甯�',
-          left: 'center',
+          text: "闅忚鐘舵�佸垎甯�",
+          left: "center",
           textStyle: {
-            color: '#333',
-            fontSize: 16
-          }
+            color: "#333",
+            fontSize: 16,
+          },
         },
         tooltip: {
-          trigger: 'item',
-          formatter: '{a} <br/>{b}: {c} ({d}%)'
+          trigger: "item",
+          formatter: "{a} <br/>{b}: {c} ({d}%)",
         },
         legend: {
-          orient: 'vertical',
-          left: 'left',
+          orient: "vertical",
+          left: "left",
           data: pieData.legendData,
           textStyle: {
-            color: '#666'
-          }
+            color: "#666",
+          },
         },
-        color: ['#FF9D4D', '#36B37E', '#FF5C5C'],
+        color: ["#FF9D4D", "#36B37E", "#FF5C5C"],
         series: [
           {
-            name: '闅忚鐘舵��',
-            type: 'pie',
-            radius: ['40%', '70%'],
+            name: "闅忚鐘舵��",
+            type: "pie",
+            radius: ["40%", "70%"],
             avoidLabelOverlap: true,
             itemStyle: {
               borderRadius: 10,
-              borderColor: '#fff',
-              borderWidth: 2
+              borderColor: "#fff",
+              borderWidth: 2,
             },
             label: {
               show: true,
-              formatter: '{b}: {c} ({d}%)',
-              color: '#333'
+              formatter: "{b}: {c} ({d}%)",
+              color: "#333",
             },
             emphasis: {
               label: {
                 show: true,
-                fontSize: '18',
-                fontWeight: 'bold'
+                fontSize: "18",
+                fontWeight: "bold",
               },
               itemStyle: {
                 shadowBlur: 10,
                 shadowOffsetX: 0,
-                shadowColor: 'rgba(0, 0, 0, 0.5)'
-              }
+                shadowColor: "rgba(0, 0, 0, 0.5)",
+              },
             },
-            data: pieData.seriesData
-          }
-        ]
-      }
+            data: pieData.seriesData,
+          },
+        ],
+      };
 
-      this.pieChart.setOption(pieOption)
-      window.addEventListener('resize', this.resizePieChart)
+      this.pieChart.setOption(pieOption);
+      window.addEventListener("resize", this.resizePieChart);
     },
 
     getPieChartData() {
-      let legendData = []
-      let seriesData = []
+      let legendData = [];
+      let seriesData = [];
 
-      if (this.activeTab === 'first') {
-        legendData = ['寰呴殢璁�', '闅忚鎴愬姛', '闅忚澶辫触']
+      if (this.activeTab === "first") {
+        legendData = ["寰呴殢璁�", "闅忚鎴愬姛", "闅忚澶辫触"];
         const followUpData = {
           pending: 0,
           success: 0,
-          fail: 0
-        }
+          fail: 0,
+        };
 
         this.data.forEach((item) => {
-          followUpData.pending += item.pendingFollowUp || 0
-          followUpData.success += item.followUpSuccess || 0
-          followUpData.fail += item.followUpFail || 0
-        })
+          followUpData.pending += item.pendingFollowUp || 0;
+          followUpData.success += item.followUpSuccess || 0;
+          followUpData.fail += item.followUpFail || 0;
+        });
 
         seriesData = [
-          { value: followUpData.pending, name: '寰呴殢璁�' },
-          { value: followUpData.success, name: '闅忚鎴愬姛' },
-          { value: followUpData.fail, name: '闅忚澶辫触' }
-        ]
-      } else if (this.activeTab === 'second') {
-        legendData = ['寰呴殢璁�(鍐嶆)', '闅忚鎴愬姛(鍐嶆)', '闅忚澶辫触(鍐嶆)']
+          { value: followUpData.pending, name: "寰呴殢璁�" },
+          { value: followUpData.success, name: "闅忚鎴愬姛" },
+          { value: followUpData.fail, name: "闅忚澶辫触" },
+        ];
+      } else if (this.activeTab === "second") {
+        legendData = ["寰呴殢璁�(鍐嶆)", "闅忚鎴愬姛(鍐嶆)", "闅忚澶辫触(鍐嶆)"];
         const followUpData = {
           pending: 0,
           success: 0,
-          fail: 0
-        }
+          fail: 0,
+        };
 
         this.data.forEach((item) => {
-          followUpData.pending += item.pendingFollowUpAgain || 0
-          followUpData.success += item.followUpSuccessAgain || 0
-          followUpData.fail += item.followUpFailAgain || 0
-        })
+          followUpData.pending += item.pendingFollowUpAgain || 0;
+          followUpData.success += item.followUpSuccessAgain || 0;
+          followUpData.fail += item.followUpFailAgain || 0;
+        });
 
         seriesData = [
-          { value: followUpData.pending, name: '寰呴殢璁�(鍐嶆)' },
-          { value: followUpData.success, name: '闅忚鎴愬姛(鍐嶆)' },
-          { value: followUpData.fail, name: '闅忚澶辫触(鍐嶆)' }
-        ]
-      } else if (this.activeTab === 'continued') {
-        legendData = ['鎶ょ悊瀹屾垚', '鎶ょ悊杩涜涓�', '鎶ょ悊鏈紑濮�']
+          { value: followUpData.pending, name: "寰呴殢璁�(鍐嶆)" },
+          { value: followUpData.success, name: "闅忚鎴愬姛(鍐嶆)" },
+          { value: followUpData.fail, name: "闅忚澶辫触(鍐嶆)" },
+        ];
+      } else if (this.activeTab === "continued") {
+        legendData = ["鎶ょ悊瀹屾垚", "鎶ょ悊杩涜涓�", "鎶ょ悊鏈紑濮�"];
         const careData = {
           completed: 0,
           inProgress: 0,
-          notStarted: 0
-        }
+          notStarted: 0,
+        };
 
         this.data.forEach((item) => {
-          careData.completed += item.careCompleted || 0
-          careData.inProgress += item.careInProgress || 0
-          careData.notStarted += item.careNotStarted || 0
-        })
+          careData.completed += item.careCompleted || 0;
+          careData.inProgress += item.careInProgress || 0;
+          careData.notStarted += item.careNotStarted || 0;
+        });
 
         seriesData = [
-          { value: careData.completed, name: '鎶ょ悊瀹屾垚' },
-          { value: careData.inProgress, name: '鎶ょ悊杩涜涓�' },
-          { value: careData.notStarted, name: '鎶ょ悊鏈紑濮�' }
-        ]
+          { value: careData.completed, name: "鎶ょ悊瀹屾垚" },
+          { value: careData.inProgress, name: "鎶ょ悊杩涜涓�" },
+          { value: careData.notStarted, name: "鎶ょ悊鏈紑濮�" },
+        ];
       }
 
-      return { legendData, seriesData }
+      return { legendData, seriesData };
     },
 
     initBarLineChart() {
-      const barDom = document.getElementById('barLineChart')
-      if (!barDom) return
+      const barDom = document.getElementById("barLineChart");
+      if (!barDom) return;
 
       if (this.barLineChart) {
-        this.barLineChart.dispose()
+        this.barLineChart.dispose();
       }
 
-      this.barLineChart = echarts.init(barDom)
+      this.barLineChart = echarts.init(barDom);
 
       // 鍑嗗鏁版嵁
-      const chartData = this.getBarLineChartData()
+      const chartData = this.getBarLineChartData();
 
       const option = {
         title: {
           text: `${chartData.title}瓒嬪娍`,
-          left: 'center',
+          left: "center",
           textStyle: {
-            color: '#333',
-            fontSize: 16
-          }
+            color: "#333",
+            fontSize: 16,
+          },
         },
         tooltip: {
-          trigger: 'axis',
+          trigger: "axis",
           axisPointer: {
-            type: 'cross',
+            type: "cross",
             crossStyle: {
-              color: '#999'
-            }
-          }
+              color: "#999",
+            },
+          },
         },
         legend: {
           data: chartData.legendData,
-          top: 'bottom',
+          top: "bottom",
           textStyle: {
-            color: '#666'
-          }
+            color: "#666",
+          },
         },
         color: chartData.colors,
         xAxis: {
-          type: 'category',
+          type: "category",
           data: chartData.categories,
           axisLabel: {
             interval: 0,
             rotate: 30,
-            color: '#666'
+            color: "#666",
           },
           axisLine: {
             lineStyle: {
-              color: '#ddd'
-            }
-          }
+              color: "#ddd",
+            },
+          },
         },
         yAxis: [
           {
-            type: 'value',
+            type: "value",
             name: chartData.yAxisName1,
             min: 0,
             axisLabel: {
-              color: '#666'
+              color: "#666",
             },
             axisLine: {
               lineStyle: {
-                color: '#ddd'
-              }
+                color: "#ddd",
+              },
             },
             splitLine: {
               lineStyle: {
-                color: '#f0f0f0'
-              }
-            }
+                color: "#f0f0f0",
+              },
+            },
           },
           {
-            type: 'value',
-            name: '鐧惧垎姣�(%)',
+            type: "value",
+            name: "鐧惧垎姣�(%)",
             min: 0,
             max: 100,
             axisLabel: {
-              color: '#666',
-              formatter: '{value}%'
+              color: "#666",
+              formatter: "{value}%",
             },
             axisLine: {
               lineStyle: {
-                color: '#ddd'
-              }
+                color: "#ddd",
+              },
             },
             splitLine: {
-              show: false
-            }
-          }
+              show: false,
+            },
+          },
         ],
         series: chartData.series,
         grid: {
-          top: '15%',
-          left: '3%',
-          right: '4%',
-          bottom: '15%',
-          containLabel: true
-        }
-      }
+          top: "15%",
+          left: "3%",
+          right: "4%",
+          bottom: "15%",
+          containLabel: true,
+        },
+      };
 
-      this.barLineChart.setOption(option)
-      window.addEventListener('resize', this.resizeBarLineChart)
+      this.barLineChart.setOption(option);
+      window.addEventListener("resize", this.resizeBarLineChart);
     },
 
     getBarLineChartData() {
-      const categories = this.data.map(
-        (item) => item.leavehospitaldistrictname || item.deptname
-      )
+      let categories
+      if (this.statisticaltype == 2) {
+         categories = this.data.map(
+          (item) => item.deptname || item.leavehospitaldistrictname
+        );
+      } else {
+         categories = this.data.map(
+          (item) => item.leavehospitaldistrictname || item.deptname
+        );
+      }
 
-      let title = '绉戝/鐥呭尯'
-      let yAxisName1 = '浜烘'
-      let legendData = []
-      let colors = []
-      let series = []
+      let title = "绉戝/鐥呭尯";
+      let yAxisName1 = "浜烘";
+      let legendData = [];
+      let colors = [];
+      let series = [];
 
-      if (this.activeTab === 'first') {
-        title = '棣栨闅忚'
-        yAxisName1 = '浜烘'
-        legendData = ['鍑洪櫌浜烘', '搴旈殢璁夸汉娆�', '闅忚鐜�(%)', '鍙婃椂鐜�(%)']
-        colors = ['#5470C6', '#91CC75', '#EE6666', '#9A60B4']
+      if (this.activeTab === "first") {
+        title = "棣栨闅忚";
+        yAxisName1 = "浜烘";
+        legendData = ["鍑洪櫌浜烘", "搴旈殢璁夸汉娆�", "闅忚鐜�(%)", "鍙婃椂鐜�(%)"];
+        colors = ["#5470C6", "#91CC75", "#EE6666", "#9A60B4"];
 
-        const dischargeData = this.data.map((item) => item.dischargeCount || 0)
-        const followUpData = this.data.map((item) => item.followUpNeeded || 0)
+        const dischargeData = this.data.map((item) => item.dischargeCount || 0);
+        const followUpData = this.data.map((item) => item.followUpNeeded || 0);
         const followUpRateData = this.data.map((item) => {
-          if (!item.followUpRate) return 0
-          const rateStr = String(item.followUpRate).replace('%', '')
-          return parseFloat(rateStr) || 0
-        })
+          if (!item.followUpRate) return 0;
+          const rateStr = String(item.followUpRate).replace("%", "");
+          return parseFloat(rateStr) || 0;
+        });
         const timelyRateData = this.data.map((item) =>
           item.rate ? (Number(item.rate) * 100).toFixed(2) : 0
-        )
+        );
 
         series = [
           {
-            name: '鍑洪櫌浜烘',
-            type: 'bar',
-            barWidth: '25%',
+            name: "鍑洪櫌浜烘",
+            type: "bar",
+            barWidth: "25%",
             data: dischargeData,
             itemStyle: {
-              borderRadius: [4, 4, 0, 0]
-            }
+              borderRadius: [4, 4, 0, 0],
+            },
           },
           {
-            name: '搴旈殢璁夸汉娆�',
-            type: 'bar',
-            barWidth: '25%',
+            name: "搴旈殢璁夸汉娆�",
+            type: "bar",
+            barWidth: "25%",
             data: followUpData,
             itemStyle: {
-              borderRadius: [4, 4, 0, 0]
-            }
+              borderRadius: [4, 4, 0, 0],
+            },
           },
           {
-            name: '闅忚鐜�(%)',
-            type: 'line',
+            name: "闅忚鐜�(%)",
+            type: "line",
             yAxisIndex: 1,
             data: followUpRateData,
             symbolSize: 8,
             lineStyle: {
-              width: 3
+              width: 3,
             },
             markLine: {
               silent: true,
@@ -378,22 +389,22 @@
                 {
                   yAxis: 80,
                   lineStyle: {
-                    color: '#EE6666',
-                    type: 'dashed'
-                  }
-                }
-              ]
-            }
+                    color: "#EE6666",
+                    type: "dashed",
+                  },
+                },
+              ],
+            },
           },
           {
-            name: '鍙婃椂鐜�(%)',
-            type: 'line',
+            name: "鍙婃椂鐜�(%)",
+            type: "line",
             yAxisIndex: 1,
             data: timelyRateData,
             symbolSize: 8,
             lineStyle: {
               width: 3,
-              type: 'dotted'
+              type: "dotted",
             },
             markLine: {
               silent: true,
@@ -401,55 +412,55 @@
                 {
                   yAxis: 90,
                   lineStyle: {
-                    color: '#9A60B4',
-                    type: 'dashed'
-                  }
-                }
-              ]
-            }
-          }
-        ]
-      } else if (this.activeTab === 'second') {
-        title = '鍐嶆闅忚'
-        yAxisName1 = '浜烘'
-        legendData = ['鍑洪櫌浜烘', '搴旈殢璁夸汉娆�', '闅忚鐜�(%)']
-        colors = ['#5470C6', '#91CC75', '#EE6666']
+                    color: "#9A60B4",
+                    type: "dashed",
+                  },
+                },
+              ],
+            },
+          },
+        ];
+      } else if (this.activeTab === "second") {
+        title = "鍐嶆闅忚";
+        yAxisName1 = "浜烘";
+        legendData = ["鍑洪櫌浜烘", "搴旈殢璁夸汉娆�", "闅忚鐜�(%)"];
+        colors = ["#5470C6", "#91CC75", "#EE6666"];
 
-        const dischargeData = this.data.map((item) => item.dischargeCount || 0)
-        const followUpData = this.data.map((item) => item.followUpNeeded || 0)
+        const dischargeData = this.data.map((item) => item.dischargeCount || 0);
+        const followUpData = this.data.map((item) => item.followUpNeeded || 0);
         const followUpRateAgainData = this.data.map((item) => {
-          if (!item.followUpRateAgain) return 0
-          const rateStr = String(item.followUpRateAgain).replace('%', '')
-          return parseFloat(rateStr) || 0
-        })
+          if (!item.followUpRateAgain) return 0;
+          const rateStr = String(item.followUpRateAgain).replace("%", "");
+          return parseFloat(rateStr) || 0;
+        });
 
         series = [
           {
-            name: '鍑洪櫌浜烘',
-            type: 'bar',
-            barWidth: '25%',
+            name: "鍑洪櫌浜烘",
+            type: "bar",
+            barWidth: "25%",
             data: dischargeData,
             itemStyle: {
-              borderRadius: [4, 4, 0, 0]
-            }
+              borderRadius: [4, 4, 0, 0],
+            },
           },
           {
-            name: '搴旈殢璁夸汉娆�',
-            type: 'bar',
-            barWidth: '25%',
+            name: "搴旈殢璁夸汉娆�",
+            type: "bar",
+            barWidth: "25%",
             data: followUpData,
             itemStyle: {
-              borderRadius: [4, 4, 0, 0]
-            }
+              borderRadius: [4, 4, 0, 0],
+            },
           },
           {
-            name: '闅忚鐜�(%)',
-            type: 'line',
+            name: "闅忚鐜�(%)",
+            type: "line",
             yAxisIndex: 1,
             data: followUpRateAgainData,
             symbolSize: 8,
             lineStyle: {
-              width: 3
+              width: 3,
             },
             markLine: {
               silent: true,
@@ -457,55 +468,59 @@
                 {
                   yAxis: 80,
                   lineStyle: {
-                    color: '#EE6666',
-                    type: 'dashed'
-                  }
-                }
-              ]
-            }
-          }
-        ]
-      } else if (this.activeTab === 'continued') {
-        title = '寤剁画鎶ょ悊'
-        yAxisName1 = '浜烘'
-        legendData = ['寤剁画鎶ょ悊浜烘', '鎶ょ悊瀹屾垚', '瀹屾垚鐜�(%)']
-        colors = ['#5470C6', '#91CC75', '#EE6666']
+                    color: "#EE6666",
+                    type: "dashed",
+                  },
+                },
+              ],
+            },
+          },
+        ];
+      } else if (this.activeTab === "continued") {
+        title = "寤剁画鎶ょ悊";
+        yAxisName1 = "浜烘";
+        legendData = ["寤剁画鎶ょ悊浜烘", "鎶ょ悊瀹屾垚", "瀹屾垚鐜�(%)"];
+        colors = ["#5470C6", "#91CC75", "#EE6666"];
 
-        const continuedCareData = this.data.map((item) => item.continuedCareCount || 0)
-        const careCompletedData = this.data.map((item) => item.careCompleted || 0)
+        const continuedCareData = this.data.map(
+          (item) => item.continuedCareCount || 0
+        );
+        const careCompletedData = this.data.map(
+          (item) => item.careCompleted || 0
+        );
         const completionRateData = this.data.map((item) => {
-          if (!item.completionRate) return 0
-          const rateStr = String(item.completionRate).replace('%', '')
-          return parseFloat(rateStr) || 0
-        })
+          if (!item.completionRate) return 0;
+          const rateStr = String(item.completionRate).replace("%", "");
+          return parseFloat(rateStr) || 0;
+        });
 
         series = [
           {
-            name: '寤剁画鎶ょ悊浜烘',
-            type: 'bar',
-            barWidth: '25%',
+            name: "寤剁画鎶ょ悊浜烘",
+            type: "bar",
+            barWidth: "25%",
             data: continuedCareData,
             itemStyle: {
-              borderRadius: [4, 4, 0, 0]
-            }
+              borderRadius: [4, 4, 0, 0],
+            },
           },
           {
-            name: '鎶ょ悊瀹屾垚',
-            type: 'bar',
-            barWidth: '25%',
+            name: "鎶ょ悊瀹屾垚",
+            type: "bar",
+            barWidth: "25%",
             data: careCompletedData,
             itemStyle: {
-              borderRadius: [4, 4, 0, 0]
-            }
+              borderRadius: [4, 4, 0, 0],
+            },
           },
           {
-            name: '瀹屾垚鐜�(%)',
-            type: 'line',
+            name: "瀹屾垚鐜�(%)",
+            type: "line",
             yAxisIndex: 1,
             data: completionRateData,
             symbolSize: 8,
             lineStyle: {
-              width: 3
+              width: 3,
             },
             markLine: {
               silent: true,
@@ -513,14 +528,14 @@
                 {
                   yAxis: 85,
                   lineStyle: {
-                    color: '#EE6666',
-                    type: 'dashed'
-                  }
-                }
-              ]
-            }
-          }
-        ]
+                    color: "#EE6666",
+                    type: "dashed",
+                  },
+                },
+              ],
+            },
+          },
+        ];
       }
 
       return {
@@ -529,41 +544,41 @@
         categories,
         legendData,
         colors,
-        series
-      }
+        series,
+      };
     },
 
     resizePieChart() {
       if (this.pieChart) {
-        this.pieChart.resize()
+        this.pieChart.resize();
       }
     },
 
     resizeBarLineChart() {
       if (this.barLineChart) {
-        this.barLineChart.resize()
+        this.barLineChart.resize();
       }
     },
 
     destroyCharts() {
       if (this.pieChart) {
-        this.pieChart.dispose()
-        this.pieChart = null
+        this.pieChart.dispose();
+        this.pieChart = null;
       }
       if (this.barLineChart) {
-        this.barLineChart.dispose()
-        this.barLineChart = null
+        this.barLineChart.dispose();
+        this.barLineChart = null;
       }
-      window.removeEventListener('resize', this.resizePieChart)
-      window.removeEventListener('resize', this.resizeBarLineChart)
+      window.removeEventListener("resize", this.resizePieChart);
+      window.removeEventListener("resize", this.resizeBarLineChart);
     },
 
     handleClose() {
-      this.destroyCharts()
-      this.$emit('close')
-    }
-  }
-}
+      this.destroyCharts();
+      this.$emit("close");
+    },
+  },
+};
 </script>
 
 <style lang="scss" scoped>
diff --git a/src/views/sfstatistics/percentage/components/CombinedFollowUp.vue b/src/views/sfstatistics/percentage/components/CombinedFollowUp.vue
new file mode 100644
index 0000000..d5f8cb8
--- /dev/null
+++ b/src/views/sfstatistics/percentage/components/CombinedFollowUp.vue
@@ -0,0 +1,949 @@
+<template>
+  <div class="combined-follow-up">
+    <div class="your-table-container">
+      <el-table
+        ref="exportTable"
+        id="exportTableCombined"
+        v-loading="loading"
+        :data="tableData"
+        border
+        @expand-change="handleRowClick"
+        :row-key="getRowKey"
+        :expand-row-keys="expands"
+        show-summary
+        :summary-method="getSummaries"
+      >
+        <!-- ========== 灞曞紑琛岋紙鍖荤敓瀛愯〃锛� ========== -->
+        <el-table-column type="expand">
+          <template slot-scope="props">
+            <el-table
+              :data="props.row.doctorStats"
+              border
+              style="width: 95%; margin: 0 auto"
+              class="inner-table"
+              show-summary
+              :summary-method="getInnerSummaries"
+            >
+              <el-table-column label="" align="center" width="96" fixed="left">
+                <template slot="header">
+                  <div style="display: flex; justify-content: space-between; align-items: center;">
+                    <el-button type="primary" size="mini" icon="el-icon-download" @click="exportDoctorTable(props.row)">
+                      瀵煎嚭
+                    </el-button>
+                  </div>
+                </template>
+              </el-table-column>
+
+              <el-table-column label="鍖荤敓濮撳悕" prop="drname" align="center" />
+              <el-table-column label="绉戝" prop="deptname" align="center" width="120" />
+
+              <!-- 鍩虹鍒� -->
+              <el-table-column label="鍑洪櫌浜烘" prop="dischargeCount" align="center">
+                <template slot-scope="scope">
+                  <el-button type="text" @click="handleViewDetails(scope.row, 'dischargeCountInfo', '鍑洪櫌鎮h�呭垪琛�', '1')">
+                    <span class="button-zx">{{ scope.row.dischargeCount }}</span>
+                  </el-button>
+                </template>
+              </el-table-column>
+
+              <!-- 棣栨闅忚锛堝尰鐢燂級 -->
+              <el-table-column label="棣栨鏃犻渶闅忚" prop="nonFollowUp" align="center">
+                <template slot-scope="scope">
+                  <el-button type="text" @click="handleViewDetails(scope.row, 'nonFollowUpInfo', '棣栨鏃犻渶闅忚鍒楄〃', '1')">
+                    <span class="button-zx">{{ scope.row.nonFollowUp }}</span>
+                  </el-button>
+                </template>
+              </el-table-column>
+              <el-table-column label="棣栨搴旈殢璁�" prop="followUpNeeded" align="center">
+                <template slot-scope="scope">
+                  <el-button type="text" @click="handleViewDetails(scope.row, 'followUpNeededInfo', '棣栨搴旈殢璁垮垪琛�', '1')">
+                    <span class="button-zx">{{ scope.row.followUpNeeded }}</span>
+                  </el-button>
+                </template>
+              </el-table-column>
+              <el-table-column label="棣栨闇�闅忚" prop="needFollowUp" align="center">
+                <template slot-scope="scope">
+                  <el-button type="text" @click="handleViewDetails(scope.row, 'needFollowUpInfo', '棣栨闇�闅忚鍒楄〃', '1')">
+                    <span class="button-zx">{{ scope.row.needFollowUp }}</span>
+                  </el-button>
+                </template>
+              </el-table-column>
+              <el-table-column label="棣栨寰呴殢璁�" prop="pendingFollowUp" align="center">
+                <template slot-scope="scope">
+                  <el-button type="text" @click="handleViewDetails(scope.row, 'pendingFollowUpInfo', '棣栨寰呴殢璁垮垪琛�', '1')">
+                    <span class="button-zx">{{ scope.row.pendingFollowUp }}</span>
+                  </el-button>
+                </template>
+              </el-table-column>
+              <el-table-column label="棣栨瀹屾垚" prop="followUpSuccess" align="center">
+                <template slot-scope="scope">
+                  <el-button type="text" @click="handleViewDetails(scope.row, 'followUpSuccessInfo', '棣栨瀹屾垚鍒楄〃', '1')">
+                    <span class="button-zx">{{ scope.row.followUpSuccess }}</span>
+                  </el-button>
+                </template>
+              </el-table-column>
+              <el-table-column label="棣栨澶辫触" prop="followUpFail" align="center">
+                <template slot-scope="scope">
+                  <el-button type="text" @click="handleViewDetails(scope.row, 'followUpFailInfo', '棣栨澶辫触鍒楄〃', '1')">
+                    <span class="button-zx">{{ scope.row.followUpFail }}</span>
+                  </el-button>
+                </template>
+              </el-table-column>
+              <el-table-column v-if="orgname != '鏅畞鐣叉棌鑷不鍘夸汉姘戝尰闄�'" label="棣栨鎴愬姛鐜�" prop="successRate" align="center" :render-header="Tooltipcgl">
+                <template slot-scope="scope">
+                  <span>{{ calculateSuccessRate(scope.row.followUpSuccess, scope.row.needFollowUp, scope.row.pendingFollowUp) }}</span>
+                </template>
+              </el-table-column>
+
+              <!-- 鍐嶆闅忚锛堝尰鐢燂級 -->
+              <el-table-column label="鍐嶆闇�闅忚" prop="needFollowUpAgain" align="center">
+                <template slot-scope="scope">
+                  <el-button type="text" @click="handleViewDetails(scope.row, 'needFollowUpAgainInfo', '鍐嶆闇�闅忚鍒楄〃', '1')">
+                    <span class="button-zx">{{ scope.row.needFollowUpAgain }}</span>
+                  </el-button>
+                </template>
+              </el-table-column>
+              <el-table-column label="鍐嶆寰呴殢璁�" prop="pendingFollowUpAgain" align="center">
+                <template slot-scope="scope">
+                  <el-button type="text" @click="handleViewDetails(scope.row, 'pendingFollowUpAgainInfo', '鍐嶆寰呴殢璁垮垪琛�', '1')">
+                    <span class="button-zx">{{ scope.row.pendingFollowUpAgain }}</span>
+                  </el-button>
+                </template>
+              </el-table-column>
+              <el-table-column label="鍐嶆瀹屾垚" prop="followUpSuccessAgain" align="center">
+                <template slot-scope="scope">
+                  <el-button type="text" @click="handleViewDetails(scope.row, 'followUpSuccessAgainInfo', '鍐嶆瀹屾垚鍒楄〃', '1')">
+                    <span class="button-zx">{{ scope.row.followUpSuccessAgain }}</span>
+                  </el-button>
+                </template>
+              </el-table-column>
+              <el-table-column label="鍐嶆澶辫触" prop="followUpFailAgain" align="center">
+                <template slot-scope="scope">
+                  <el-button type="text" @click="handleViewDetails(scope.row, 'followUpFailAgainInfo', '鍐嶆澶辫触鍒楄〃', '1')">
+                    <span class="button-zx">{{ scope.row.followUpFailAgain }}</span>
+                  </el-button>
+                </template>
+              </el-table-column>
+              <el-table-column v-if="orgname != '鏅畞鐣叉棌鑷不鍘夸汉姘戝尰闄�'" label="鍐嶆鎴愬姛鐜�" prop="successRateAgain" align="center" :render-header="Tooltipcgl">
+                <template slot-scope="scope">
+                  <span>{{ calculateSuccessRate(scope.row.followUpSuccessAgain, scope.row.needFollowUpAgain, scope.row.pendingFollowUpAgain) }}</span>
+                </template>
+              </el-table-column>
+
+              <!-- 鏂板璁$畻鎸囨爣锛堝尰鐢燂級 -->
+              <el-table-column label="闅忚鐜�" align="center" prop="followUpRate" :render-header="TooltipFollowUpRate">
+                <template slot-scope="scope">
+                  <span>{{ calculateFollowUpRate(scope.row) }}</span>
+                </template>
+              </el-table-column>
+              <el-table-column label="鎺ㄩ�佺巼" align="center" prop="pushRate" :render-header="TooltipPushRate">
+                <template slot-scope="scope">
+                  <span>{{ calculatePushRate(scope.row) }}</span>
+                </template>
+              </el-table-column>
+            </el-table>
+          </template>
+        </el-table-column>
+
+        <!-- ========== 涓昏〃鏍煎垪 ========== -->
+        <!-- 鐥呭尯 / 绉戝 -->
+        <el-table-column
+          v-if="queryParams.statisticaltype == 1"
+          label="鍑洪櫌鐥呭尯"
+          align="center"
+          sortable
+          prop="leavehospitaldistrictname"
+          width="150"
+          :show-overflow-tooltip="true"
+          :sort-method="sortChineseNumber"
+        />
+        <el-table-column
+          v-if="queryParams.statisticaltype == 2"
+          label="绉戝"
+          align="center"
+          prop="deptname"
+          :show-overflow-tooltip="true"
+        />
+
+        <!-- 鍑洪櫌浜烘 -->
+        <el-table-column label="鍑洪櫌浜烘" align="center" prop="dischargeCount">
+          <template slot-scope="scope">
+            <el-button type="text" @click="handleViewDetails(scope.row, 'dischargeCountInfo', '鍑洪櫌鎮h�呭垪琛�')">
+              <span class="button-zx">{{ scope.row.dischargeCount }}</span>
+            </el-button>
+          </template>
+        </el-table-column>
+
+        <!-- ===== 棣栨闅忚 ===== -->
+        <el-table-column align="center" label="棣栨闅忚">
+          <el-table-column label="鏃犻渶闅忚" align="center" prop="nonFollowUp">
+            <template slot-scope="scope">
+              <el-button type="text" @click="handleViewDetails(scope.row, 'nonFollowUpInfo', '棣栨鏃犻渶闅忚鍒楄〃')">
+                <span class="button-zx">{{ scope.row.nonFollowUp }}</span>
+              </el-button>
+            </template>
+          </el-table-column>
+          <el-table-column label="搴旈殢璁�" align="center" prop="followUpNeeded">
+            <template slot-scope="scope">
+              <el-button type="text" @click="handleViewDetails(scope.row, 'followUpNeededInfo', '棣栨搴旈殢璁垮垪琛�')">
+                <span class="button-zx">{{ scope.row.followUpNeeded }}</span>
+              </el-button>
+            </template>
+          </el-table-column>
+          <el-table-column label="闇�闅忚" align="center" prop="needFollowUp">
+            <template slot-scope="scope">
+              <el-button type="text" @click="handleViewDetails(scope.row, 'needFollowUpInfo', '棣栨闇�闅忚鍒楄〃')">
+                <span class="button-zx">{{ scope.row.needFollowUp }}</span>
+              </el-button>
+            </template>
+          </el-table-column>
+          <el-table-column label="寰呴殢璁�" align="center" prop="pendingFollowUp">
+            <template slot-scope="scope">
+              <el-button type="text" @click="handleViewDetails(scope.row, 'pendingFollowUpInfo', '棣栨寰呴殢璁垮垪琛�')">
+                <span class="button-zx">{{ scope.row.pendingFollowUp }}</span>
+              </el-button>
+            </template>
+          </el-table-column>
+          <el-table-column label="瀹屾垚" align="center" prop="followUpSuccess">
+            <template slot-scope="scope">
+              <el-button type="text" @click="handleViewDetails(scope.row, 'followUpSuccessInfo', '棣栨瀹屾垚鍒楄〃')">
+                <span class="button-zx">{{ scope.row.followUpSuccess }}</span>
+              </el-button>
+            </template>
+          </el-table-column>
+          <el-table-column label="澶辫触" align="center" prop="followUpFail">
+            <template slot-scope="scope">
+              <el-button type="text" @click="handleViewDetails(scope.row, 'followUpFailInfo', '棣栨澶辫触鍒楄〃')">
+                <span class="button-zx">{{ scope.row.followUpFail }}</span>
+              </el-button>
+            </template>
+          </el-table-column>
+          <el-table-column v-if="orgname != '鏅畞鐣叉棌鑷不鍘夸汉姘戝尰闄�'" label="鎴愬姛鐜�" align="center" prop="successRate" :render-header="Tooltipcgl">
+            <template slot-scope="scope">
+              <span>{{ calculateSuccessRate(scope.row.followUpSuccess, scope.row.needFollowUp, scope.row.pendingFollowUp) }}</span>
+            </template>
+          </el-table-column>
+        </el-table-column>
+
+        <!-- ===== 鍐嶆闅忚 ===== -->
+        <el-table-column align="center" label="鍐嶆闅忚">
+          <el-table-column label="闇�闅忚" align="center" prop="needFollowUpAgain">
+            <template slot-scope="scope">
+              <el-button type="text" @click="handleViewDetails(scope.row, 'needFollowUpAgainInfo', '鍐嶆闇�闅忚鍒楄〃')">
+                <span class="button-zx">{{ scope.row.needFollowUpAgain }}</span>
+              </el-button>
+            </template>
+          </el-table-column>
+          <el-table-column label="寰呴殢璁�" align="center" prop="pendingFollowUpAgain">
+            <template slot-scope="scope">
+              <el-button type="text" @click="handleViewDetails(scope.row, 'pendingFollowUpAgainInfo', '鍐嶆寰呴殢璁垮垪琛�')">
+                <span class="button-zx">{{ scope.row.pendingFollowUpAgain }}</span>
+              </el-button>
+            </template>
+          </el-table-column>
+          <el-table-column label="瀹屾垚" align="center" prop="followUpSuccessAgain">
+            <template slot-scope="scope">
+              <el-button type="text" @click="handleViewDetails(scope.row, 'followUpSuccessAgainInfo', '鍐嶆瀹屾垚鍒楄〃')">
+                <span class="button-zx">{{ scope.row.followUpSuccessAgain }}</span>
+              </el-button>
+            </template>
+          </el-table-column>
+          <el-table-column label="澶辫触" align="center" prop="followUpFailAgain">
+            <template slot-scope="scope">
+              <el-button type="text" @click="handleViewDetails(scope.row, 'followUpFailAgainInfo', '鍐嶆澶辫触鍒楄〃')">
+                <span class="button-zx">{{ scope.row.followUpFailAgain }}</span>
+              </el-button>
+            </template>
+          </el-table-column>
+          <el-table-column v-if="orgname != '鏅畞鐣叉棌鑷不鍘夸汉姘戝尰闄�'" label="鎴愬姛鐜�" align="center" prop="successRateAgain" :render-header="Tooltipcgl">
+            <template slot-scope="scope">
+              <span>{{ calculateSuccessRate(scope.row.followUpSuccessAgain, scope.row.needFollowUpAgain, scope.row.pendingFollowUpAgain) }}</span>
+            </template>
+          </el-table-column>
+        </el-table-column>
+
+        <!-- ===== 鏂板璁$畻鎸囨爣 ===== -->
+        <el-table-column label="闅忚鐜�" align="center" prop="followUpRate" :render-header="TooltipFollowUpRate">
+          <template slot-scope="scope">
+            <span>{{ calculateFollowUpRate(scope.row) }}</span>
+          </template>
+        </el-table-column>
+        <el-table-column label="鎺ㄩ�佺巼" align="center" prop="pushRate" :render-header="TooltipPushRate">
+          <template slot-scope="scope">
+            <span>{{ calculatePushRate(scope.row) }}</span>
+          </template>
+        </el-table-column>
+      </el-table>
+    </div>
+  </div>
+</template>
+
+<script>
+import { getSfStatistics } from "@/api/system/user";
+import ExcelJS from "exceljs";
+import { saveAs } from "file-saver";
+import store from "@/store";
+
+export default {
+  name: "CombinedFollowUp",
+  props: {
+    queryParams: {
+      type: Object,
+      required: true,
+    },
+    flatArrayhospit: {
+      type: Array,
+      default: () => [],
+    },
+    flatArraydept: {
+      type: Array,
+      default: () => [],
+    },
+    options: {
+      type: Array,
+      default: () => [],
+    },
+    orgname: {
+      type: String,
+      default: "",
+    },
+  },
+  data() {
+    return {
+      tableData: [],
+      loading: false,
+      expands: [],
+      tasktypes: store.getters.tasktypes,
+    };
+  },
+
+  methods: {
+    // ===================== 鏁版嵁鍔犺浇 =====================
+    loadData() {
+      this.loading = true;
+      const params = {
+        ...this.queryParams,
+        // 涓嶄紶 visitCount锛屽悗绔繑鍥炲寘鍚娆″拰鍐嶆鐨勬暟鎹�
+        leavehospitaldistrictcodes: this.queryParams.leavehospitaldistrictcodes.includes("all")
+          ? this.getAllWardCodes()
+          : this.queryParams.leavehospitaldistrictcodes,
+        deptcodes: this.queryParams.deptcodes.includes("all")
+          ? this.getAllDeptCodes()
+          : this.queryParams.deptcodes,
+        rateDay: this.orgname == "榫欐硥甯備汉姘戝尰闄�" ? 21 : 7,
+      };
+
+      delete params.leavehospitaldistrictcodes.all;
+      delete params.deptcodes.all;
+
+      getSfStatistics(params)
+        .then((res) => {
+          this.tableData = this.customSort(res.data);
+        })
+        .catch((err) => {
+          console.error("鑾峰彇缁煎悎缁熻鏁版嵁澶辫触:", err);
+          this.$message.error("鑾峰彇缁煎悎缁熻鏁版嵁澶辫触");
+        })
+        .finally(() => {
+          this.loading = false;
+        });
+    },
+
+    getAllWardCodes() {
+      return this.flatArrayhospit.filter((item) => item.value !== "all").map((item) => item.value);
+    },
+    getAllDeptCodes() {
+      return this.flatArraydept.filter((item) => item.value !== "all").map((item) => item.value);
+    },
+
+    // ===================== 鎺掑簭 =====================
+    customSort(data) {
+      const order = [
+        "涓�", "浜�", "涓�", "鍥�", "浜�", "鍏�", "涓�", "鍏�", "涔�", "鍗�",
+        "鍗佷竴", "鍗佷簩", "鍗佷笁", "鍗佸洓", "鍗佷簲", "鍗佸叚", "鍗佷竷", "鍗佸叓", "鍗佷節", "浜屽崄",
+        "浜屽崄涓�", "浜屽崄浜�", "浜屽崄涓�", "浜屽崄鍥�", "浜屽崄浜�", "浜屽崄鍏�", "浜屽崄涓�", "浜屽崄鍏�", "浜屽崄涔�", "涓夊崄",
+        "涓夊崄涓�", "涓夊崄浜�", "涓夊崄涓�", "涓夊崄鍥�", "涓夊崄浜�", "涓夊崄鍏�", "涓夊崄涓�", "涓夊崄鍏�", "涓夊崄涔�", "鍥涘崄",
+        "鍥涘崄涓�", "鍥涘崄浜�", "鍥涘崄涓�", "鍥涘崄鍥�", "鍥涘崄浜�",
+      ];
+      return data.sort((a, b) => {
+        const getIndex = (name) => {
+          if (!name || typeof name !== "string") return -1;
+          const chineseMatch = name.match(/^([涓�浜屼笁鍥涗簲鍏竷鍏節鍗乚+)/);
+          if (chineseMatch && chineseMatch[1]) {
+            return order.indexOf(chineseMatch[1]);
+          }
+          const arabicMatch = name.match(/^(\d+)/);
+          if (arabicMatch && arabicMatch[1]) {
+            const num = parseInt(arabicMatch[1], 10);
+            if (num >= 1 && num <= 45) return num - 1;
+          }
+          return -1;
+        };
+        const indexA = getIndex(a.leavehospitaldistrictname);
+        const indexB = getIndex(b.leavehospitaldistrictname);
+        if (indexA === -1 && indexB === -1) {
+          return (a.leavehospitaldistrictname || "").localeCompare(b.leavehospitaldistrictname || "");
+        }
+        if (indexA === -1) return 1;
+        if (indexB === -1) return -1;
+        return indexA - indexB;
+      });
+    },
+
+    sortChineseNumber(aRow, bRow) {
+      // 涓� customSort 閫昏緫鐩稿悓锛屼絾鐢ㄤ簬 el-table 鐨� sort-method
+      const a = aRow.leavehospitaldistrictname;
+      const b = bRow.leavehospitaldistrictname;
+      const chineseNumMap = {
+        涓�: 1, 浜�: 2, 涓�: 3, 鍥�: 4, 浜�: 5,
+        鍏�: 6, 涓�: 7, 鍏�: 8, 涔�: 9, 鍗�: 10,
+        鍗佷竴: 11, 鍗佷簩: 12, 鍗佷笁: 13, 鍗佸洓: 14, 鍗佷簲: 15,
+        鍗佸叚: 16, 鍗佷竷: 17, 鍗佸叓: 18, 鍗佷節: 19, 浜屽崄: 20,
+        浜屽崄涓�: 21, 浜屽崄浜�: 22, 浜屽崄涓�: 23, 浜屽崄鍥�: 24, 浜屽崄浜�: 25,
+        浜屽崄鍏�: 26, 浜屽崄涓�: 27, 浜屽崄鍏�: 28, 浜屽崄涔�: 29, 涓夊崄: 30,
+        涓夊崄涓�: 31, 涓夊崄浜�: 32, 涓夊崄涓�: 33, 涓夊崄鍥�: 34, 涓夊崄浜�: 35,
+        涓夊崄鍏�: 36, 涓夊崄涓�: 37, 涓夊崄鍏�: 38, 涓夊崄涔�: 39, 鍥涘崄: 40,
+        鍥涘崄涓�: 41, 鍥涘崄浜�: 42, 鍥涘崄涓�: 43, 鍥涘崄鍥�: 44, 鍥涘崄浜�: 45,
+      };
+      const getNumberFromText = (text) => {
+        if (!text || typeof text !== "string") return -1;
+        const match = text.match(/^([涓�浜屼笁鍥涗簲鍏竷鍏節鍗乚+)/);
+        if (match && match[1]) {
+          const chineseNum = match[1];
+          return chineseNumMap[chineseNum] !== undefined ? chineseNumMap[chineseNum] : -1;
+        }
+        const arabicMatch = text.match(/^(\d+)/);
+        if (arabicMatch && arabicMatch[1]) {
+          const num = parseInt(arabicMatch[1], 10);
+          return num >= 1 && num <= 45 ? num : -1;
+        }
+        return -1;
+      };
+      const numA = getNumberFromText(a);
+      const numB = getNumberFromText(b);
+      if (numA === -1 && numB === -1) return (a || "").localeCompare(b || "");
+      if (numA === -1) return 1;
+      if (numB === -1) return -1;
+      return numA - numB;
+    },
+
+    // ===================== 琛屽睍寮� =====================
+    getRowKey(row) {
+      return row.statisticaltype === 1 ? row.leavehospitaldistrictcode : row.deptcode;
+    },
+
+    handleRowClick(row) {
+      if (this.expands.includes(this.getRowKey(row))) {
+        this.expands = [];
+        return;
+      }
+
+      const params = {
+        ...this.queryParams,
+        deptcodes: this.queryParams.deptcodes.includes("all")
+          ? this.getAllDeptCodes()
+          : this.queryParams.deptcodes,
+        leavehospitaldistrictcodes: [row.leavehospitaldistrictcode],
+        drcode: "1",
+        // 涓嶄紶 visitCount
+        rateDay: this.orgname == "榫欐硥甯備汉姘戝尰闄�" ? 21 : 7,
+      };
+      delete params.leavehospitaldistrictcodes.all;
+      delete params.deptcodes.all;
+
+      if (!row.doctorStats) {
+        this.loading = true;
+        getSfStatistics(params)
+          .then((res) => {
+            this.$set(row, "doctorStats", res.data);
+            this.expands = [this.getRowKey(row)];
+          })
+          .catch(() => {
+            this.$message.error("鑾峰彇鍖荤敓鏁版嵁澶辫触");
+          })
+          .finally(() => {
+            this.loading = false;
+          });
+      } else {
+        this.expands = [this.getRowKey(row)];
+      }
+    },
+
+    // ===================== 璁$畻鎸囨爣 =====================
+    calculateSuccessRate(success, need, pending) {
+      const s = Number(success) || 0;
+      const n = Number(need) || 0;
+      const p = Number(pending) || 0;
+      const denominator = n - p;
+      if (denominator <= 0) return "0.00%";
+      return ((s / denominator) * 100).toFixed(2) + "%";
+    },
+
+    // 闅忚鐜� = (棣栨瀹屾垚 + 棣栨鏃犻渶闅忚) / (棣栨搴旈殢璁� + 棣栨鏃犻渶闅忚)
+    calculateFollowUpRate(row) {
+      const success = Number(row.followUpSuccess) || 0;
+      const nonFollowUp = Number(row.nonFollowUp) || 0;
+      const followUpNeeded = Number(row.followUpNeeded) || 0;
+      const denominator = followUpNeeded + nonFollowUp;
+      if (denominator <= 0) return "0.00%";
+      return (((success + nonFollowUp) / denominator) * 100).toFixed(2) + "%";
+    },
+
+    // 鎺ㄩ�佺巼 = 鍐嶆瀹屾垚 / (棣栨搴旈殢璁� + 棣栨鏃犻渶闅忚)
+    calculatePushRate(row) {
+      const successAgain = Number(row.followUpSuccessAgain) || 0;
+      const nonFollowUp = Number(row.nonFollowUp) || 0;
+      const followUpNeeded = Number(row.followUpNeeded) || 0;
+      const denominator = followUpNeeded + nonFollowUp;
+      console.log(successAgain,nonFollowUp,followUpNeeded);
+
+      if (denominator <= 0) return "0.00%";
+      return ((successAgain / denominator) * 100).toFixed(2) + "%";
+    },
+
+    // ===================== 姹囨�� =====================
+    getSummaries(param) {
+      const { columns, data } = param;
+      const sums = [];
+      columns.forEach((column, index) => {
+        if (index === 0) {
+          sums[index] = "鍚堣";
+          return;
+        }
+        if (index === 1) {
+          sums[index] = "/";
+          return;
+        }
+
+        const prop = column.property;
+        // 瀵逛簬鐧惧垎姣斿垪锛屼娇鐢ㄦ暣浣撴硶鎴栧钩鍧囨硶锛堣繖閲岀敤骞冲潎鍊硷級
+        if (prop === "successRate" || prop === "successRateAgain") {
+          // 鍥犱负璁$畻澶嶆潅锛岃繖閲岀畝鍖栦负 "-"
+          sums[index] = "-";
+        } else if (prop === "followUpRate") {
+          const values = data.map((row) => parseFloat(this.calculateFollowUpRate(row).replace("%", ""))).filter(v => !isNaN(v));
+          if (values.length === 0) sums[index] = "0.00%";
+          else sums[index] = (values.reduce((a, b) => a + b, 0) / values.length).toFixed(2) + "%";
+        } else if (prop === "pushRate") {
+          const values = data.map((row) => parseFloat(this.calculatePushRate(row).replace("%", ""))).filter(v => !isNaN(v));
+          if (values.length === 0) sums[index] = "0.00%";
+          else sums[index] = (values.reduce((a, b) => a + b, 0) / values.length).toFixed(2) + "%";
+        } else {
+          // 鏁板瓧鍒楁眰鍜�
+          const values = data.map((item) => Number(item[prop]) || 0);
+          sums[index] = values.reduce((a, b) => a + b, 0);
+          sums[index] = this.formatNumber(sums[index]);
+        }
+      });
+      return sums;
+    },
+
+    // 鍐呭祵琛ㄦ牸姹囨�伙紙鍖荤敓锛�
+    getInnerSummaries(param) {
+      const { columns, data } = param;
+      const sums = [];
+      columns.forEach((column, index) => {
+        if (index === 0) {
+          sums[index] = "灏忚";
+          return;
+        }
+        if (column.property === "drname" || column.property === "deptname") {
+          sums[index] = "-";
+          return;
+        }
+        const prop = column.property;
+        if (prop === "successRate" || prop === "successRateAgain") {
+          sums[index] = "-";
+        } else if (prop === "followUpRate") {
+          const values = data.map((row) => parseFloat(this.calculateFollowUpRate(row).replace("%", ""))).filter(v => !isNaN(v));
+          sums[index] = values.length ? (values.reduce((a, b) => a + b, 0) / values.length).toFixed(2) + "%" : "0.00%";
+        } else if (prop === "pushRate") {
+          const values = data.map((row) => parseFloat(this.calculatePushRate(row).replace("%", ""))).filter(v => !isNaN(v));
+          sums[index] = values.length ? (values.reduce((a, b) => a + b, 0) / values.length).toFixed(2) + "%" : "0.00%";
+        } else {
+          const values = data.map((item) => Number(item[prop]) || 0);
+          sums[index] = values.reduce((a, b) => a + b, 0);
+          sums[index] = this.formatNumber(sums[index]);
+        }
+      });
+      return sums;
+    },
+
+    formatNumber(num) {
+      if (isNaN(num)) return "-";
+      return Number.isInteger(num) ? num.toString() : num.toFixed(0);
+    },
+
+    // ===================== 鐐瑰嚮閽诲彇 =====================
+    handleViewDetails(row, infoKey, titleSuffix, type) {
+      const title = `${row.leavehospitaldistrictname || row.deptname}${titleSuffix}`;
+      this.$emit("view-details", row, infoKey, title, type);
+    },
+
+    // ===================== 瀵煎嚭 =====================
+    async exportTable() {
+      try {
+        let dateRangeString = "";
+        const isLishuiHospital = this.orgname === "涓芥按甯備腑鍖婚櫌";
+        if (this.queryParams.dateRange && this.queryParams.dateRange.length === 2) {
+          const start = this.queryParams.dateRange[0];
+          const end = this.queryParams.dateRange[1];
+          if (isLishuiHospital) {
+            const formatMonth = (d) => {
+              const date = new Date(d);
+              return `${date.getFullYear()}骞�${date.getMonth() + 1}鏈坄;
+            };
+            dateRangeString = `${formatMonth(start)}鑷�${formatMonth(end)}`;
+          } else {
+            dateRangeString = `${start.split(" ")[0]}鑷�${end.split(" ")[0]}`;
+          }
+        } else {
+          const now = new Date();
+          dateRangeString = isLishuiHospital ? `${now.getFullYear()}骞�${now.getMonth() + 1}鏈坄 : `${now.getMonth() + 1}鏈坄;
+        }
+
+        const excelName = `缁煎悎闅忚缁熻琛╛${dateRangeString}.xlsx`;
+        if (!this.tableData || this.tableData.length === 0) {
+          this.$message.warning("鏆傛棤鏁版嵁鍙鍑�");
+          return false;
+        }
+
+        const workbook = new ExcelJS.Workbook();
+        const worksheet = workbook.addWorksheet("缁煎悎缁熻");
+        this.buildExportSheet(worksheet, dateRangeString);
+        const buffer = await workbook.xlsx.writeBuffer();
+        const blob = new Blob([buffer], {
+          type: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
+        });
+        saveAs(blob, excelName);
+        this.$message.success("瀵煎嚭鎴愬姛");
+        return true;
+      } catch (error) {
+        console.error(error);
+        this.$message.error("瀵煎嚭澶辫触");
+        return false;
+      }
+    },
+
+    buildExportSheet(worksheet, dateRangeString) {
+      // 瀹氫箟鏍峰紡
+      const titleStyle = {
+        font: { name: "寰蒋闆呴粦", size: 16, bold: true },
+        alignment: { horizontal: "center", vertical: "middle" },
+        fill: { type: "pattern", pattern: "solid", fgColor: { argb: "FFE6F3FF" } },
+        border: { top: { style: "thin" }, left: { style: "thin" }, bottom: { style: "thin" }, right: { style: "thin" } },
+      };
+      const headerStyle = {
+        font: { name: "寰蒋闆呴粦", size: 11, bold: true },
+        fill: { type: "pattern", pattern: "solid", fgColor: { argb: "FFF5F7FA" } },
+        alignment: { horizontal: "center", vertical: "middle", wrapText: true },
+        border: { top: { style: "thin" }, left: { style: "thin" }, bottom: { style: "thin" }, right: { style: "thin" } },
+      };
+      const cellStyle = {
+        font: { name: "瀹嬩綋", size: 10 },
+        alignment: { horizontal: "center", vertical: "middle" },
+        border: { top: { style: "thin" }, left: { style: "thin" }, bottom: { style: "thin" }, right: { style: "thin" } },
+      };
+      const summaryStyle = {
+        ...cellStyle,
+        font: { ...cellStyle.font, bold: true, color: { argb: "FF409EFF" } },
+        fill: { type: "pattern", pattern: "solid", fgColor: { argb: "FFF5F7FA" } },
+      };
+
+      // 鏍囬琛�
+      worksheet.mergeCells(1, 1, 1, 20);
+      worksheet.getCell(1, 1).value = `缁煎悎闅忚缁熻琛╛${dateRangeString}`;
+      worksheet.getCell(1, 1).style = titleStyle;
+      worksheet.getRow(1).height = 35;
+
+      // 绗簩琛屽拰绗笁琛屽悎骞舵瀯寤鸿〃澶�
+      // 绗竴鍒楃暀绌�
+      worksheet.mergeCells(2, 1, 3, 1);
+      worksheet.getCell(2, 1).value = "";
+      worksheet.getCell(2, 1).style = headerStyle;
+
+      // 鐥呭尯/绉戝
+      worksheet.mergeCells(2, 2, 3, 2);
+      worksheet.getCell(2, 2).value = this.queryParams.statisticaltype == 1 ? "鍑洪櫌鐥呭尯" : "绉戝";
+      worksheet.getCell(2, 2).style = headerStyle;
+
+      // 鍑洪櫌浜烘
+      worksheet.mergeCells(2, 3, 3, 3);
+      worksheet.getCell(2, 3).value = "鍑洪櫌浜烘";
+      worksheet.getCell(2, 3).style = headerStyle;
+
+      // 棣栨闅忚澶у垪
+      worksheet.mergeCells(2, 4, 2, 10);
+      worksheet.getCell(2, 4).value = "棣栨闅忚";
+      worksheet.getCell(2, 4).style = headerStyle;
+      const firstCols = ["鏃犻渶闅忚", "搴旈殢璁�", "闇�闅忚", "寰呴殢璁�", "瀹屾垚", "澶辫触", "鎴愬姛鐜�"];
+      firstCols.forEach((label, idx) => {
+        const col = 4 + idx;
+        worksheet.getCell(3, col).value = label;
+        worksheet.getCell(3, col).style = headerStyle;
+      });
+
+      // 鍐嶆闅忚澶у垪
+      worksheet.mergeCells(2, 11, 2, 15);
+      worksheet.getCell(2, 11).value = "鍐嶆闅忚";
+      worksheet.getCell(2, 11).style = headerStyle;
+      const secondCols = ["闇�闅忚", "寰呴殢璁�", "瀹屾垚", "澶辫触", "鎴愬姛鐜�"];
+      secondCols.forEach((label, idx) => {
+        const col = 11 + idx;
+        worksheet.getCell(3, col).value = label;
+        worksheet.getCell(3, col).style = headerStyle;
+      });
+
+      // 鏂板璁$畻鎸囨爣
+      worksheet.mergeCells(2, 16, 3, 16);
+      worksheet.getCell(2, 16).value = "闅忚鐜�";
+      worksheet.getCell(2, 16).style = headerStyle;
+      worksheet.mergeCells(2, 17, 3, 17);
+      worksheet.getCell(2, 17).value = "鎺ㄩ�佺巼";
+      worksheet.getCell(2, 17).style = headerStyle;
+
+      // 鏁版嵁琛�
+      this.tableData.forEach((item) => {
+        const rowData = [
+          "",
+          item.leavehospitaldistrictname || item.deptname || "",
+          item.dischargeCount || 0,
+          item.nonFollowUp || 0,
+          item.followUpNeeded || 0,
+          item.needFollowUp || 0,
+          item.pendingFollowUp || 0,
+          item.followUpSuccess || 0,
+          item.followUpFail || 0,
+          this.calculateSuccessRate(item.followUpSuccess, item.needFollowUp, item.pendingFollowUp),
+          item.needFollowUpAgain || 0,
+          item.pendingFollowUpAgain || 0,
+          item.followUpSuccessAgain || 0,
+          item.followUpFailAgain || 0,
+          this.calculateSuccessRate(item.followUpSuccessAgain, item.needFollowUpAgain, item.pendingFollowUpAgain),
+          this.calculateFollowUpRate(item),
+          this.calculatePushRate(item),
+        ];
+        const row = worksheet.addRow(rowData);
+        row.eachCell((cell) => { cell.style = cellStyle; });
+        row.height = 24;
+      });
+
+      // 鍚堣琛�
+      const summaries = this.getExportSummaries();
+      const summaryRow = worksheet.addRow(summaries);
+      summaryRow.eachCell((cell) => { cell.style = summaryStyle; });
+
+      // 鍒楀
+      worksheet.columns = [
+        { width: 8 },
+        { width: 20 },
+        { width: 12 },
+        { width: 12 }, { width: 12 }, { width: 12 }, { width: 12 }, { width: 12 }, { width: 12 }, { width: 12 },
+        { width: 12 }, { width: 12 }, { width: 12 }, { width: 12 }, { width: 12 },
+        { width: 12 }, { width: 12 },
+      ];
+    },
+
+    getExportSummaries() {
+      // 鎻愬彇鏁版嵁锛岃绠楀悎璁¤
+      const data = this.tableData;
+      const sums = ["鍚堣", "/", 0, 0, 0, 0, 0, 0, 0, "0%", 0, 0, 0, 0, "0%", "0%", "0%"];
+      // 鏁板瓧鍒楃储寮�
+      const numIndices = [2, 3, 4, 5, 6, 7, 8, 10, 11, 12, 13];
+      data.forEach(row => {
+        numIndices.forEach(idx => {
+          const val = Number(row[this.getFieldByIndex(idx)]) || 0;
+          sums[idx] += val;
+        });
+      });
+      // 鏍煎紡鍖栨暟瀛�
+      numIndices.forEach(idx => { sums[idx] = this.formatNumber(sums[idx]); });
+      // 璁$畻涓や釜鐧惧垎姣斿垪鐨勫钩鍧囧��
+      const followUpRates = data.map(row => parseFloat(this.calculateFollowUpRate(row).replace("%", ""))).filter(v => !isNaN(v));
+      const pushRates = data.map(row => parseFloat(this.calculatePushRate(row).replace("%", ""))).filter(v => !isNaN(v));
+      sums[15] = followUpRates.length ? (followUpRates.reduce((a,b)=>a+b,0)/followUpRates.length).toFixed(2)+"%" : "0.00%";
+      sums[16] = pushRates.length ? (pushRates.reduce((a,b)=>a+b,0)/pushRates.length).toFixed(2)+"%" : "0.00%";
+      // 鎴愬姛鐜囩殑鍚堣鐢ㄦ暣浣撴硶璁$畻
+      const totalSuccess = data.reduce((s, row) => s + (Number(row.followUpSuccess)||0), 0);
+      const totalNeed = data.reduce((s, row) => s + (Number(row.needFollowUp)||0), 0);
+      const totalPending = data.reduce((s, row) => s + (Number(row.pendingFollowUp)||0), 0);
+      const denom = totalNeed - totalPending;
+      sums[9] = denom > 0 ? ((totalSuccess/denom)*100).toFixed(2)+"%" : "0.00%";
+      const totalSuccessAgain = data.reduce((s, row) => s + (Number(row.followUpSuccessAgain)||0), 0);
+      const totalNeedAgain = data.reduce((s, row) => s + (Number(row.needFollowUpAgain)||0), 0);
+      const totalPendingAgain = data.reduce((s, row) => s + (Number(row.pendingFollowUpAgain)||0), 0);
+      const denomAgain = totalNeedAgain - totalPendingAgain;
+      sums[14] = denomAgain > 0 ? ((totalSuccessAgain/denomAgain)*100).toFixed(2)+"%" : "0.00%";
+      return sums;
+    },
+
+    getFieldByIndex(idx) {
+      // 鏍规嵁瀵煎嚭鍒楃储寮曟槧灏勫瓧娈靛悕
+      const map = {
+        2: "dischargeCount",
+        3: "nonFollowUp",
+        4: "followUpNeeded",
+        5: "needFollowUp",
+        6: "pendingFollowUp",
+        7: "followUpSuccess",
+        8: "followUpFail",
+        10: "needFollowUpAgain",
+        11: "pendingFollowUpAgain",
+        12: "followUpSuccessAgain",
+        13: "followUpFailAgain",
+      };
+      return map[idx];
+    },
+
+    // ===================== 瀵煎嚭鍖荤敓瀛愯〃 =====================
+    async exportDoctorTable(row) {
+      try {
+        const areaName = row.leavehospitaldistrictname || row.deptname || "鏈煡鐥呭尯";
+        let dateRangeString = "";
+        if (this.queryParams.dateRange && this.queryParams.dateRange.length === 2) {
+          const start = this.queryParams.dateRange[0].split(" ")[0];
+          const end = this.queryParams.dateRange[1].split(" ")[0];
+          dateRangeString = `${start}鑷�${end}`;
+        } else {
+          dateRangeString = `${new Date().getMonth() + 1}鏈坄;
+        }
+        const fileName = `${areaName}鍖荤敓缁煎悎闅忚鍒楄〃_${dateRangeString}.xlsx`;
+        const sheetName = `${areaName}鍖荤敓缁煎悎闅忚`;
+        if (!row.doctorStats || row.doctorStats.length === 0) {
+          this.$message.warning("褰撳墠鐥呭尯鏆傛棤鍖荤敓鏁版嵁");
+          return;
+        }
+        const workbook = new ExcelJS.Workbook();
+        const worksheet = workbook.addWorksheet(sheetName);
+        this.buildDoctorExportSheet(worksheet, row.doctorStats, areaName);
+        const buffer = await workbook.xlsx.writeBuffer();
+        saveAs(new Blob([buffer], { type: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" }), fileName);
+        this.$message.success("鍖荤敓缁煎悎闅忚鍒楄〃瀵煎嚭鎴愬姛");
+      } catch (err) {
+        console.error(err);
+        this.$message.error("瀵煎嚭澶辫触");
+      }
+    },
+
+    buildDoctorExportSheet(worksheet, data, areaName) {
+      const titleStyle = { font: { name: "寰蒋闆呴粦", size: 16, bold: true }, alignment: { horizontal: "center", vertical: "middle" } };
+      const headerStyle = {
+        font: { name: "寰蒋闆呴粦", size: 11, bold: true },
+        fill: { type: "pattern", pattern: "solid", fgColor: { argb: "FFF5F7FA" } },
+        alignment: { horizontal: "center", vertical: "middle", wrapText: true },
+        border: { top: { style: "thin" }, left: { style: "thin" }, bottom: { style: "thin" }, right: { style: "thin" } },
+      };
+      const cellStyle = {
+        font: { name: "瀹嬩綋", size: 10 },
+        alignment: { horizontal: "center", vertical: "middle" },
+        border: { top: { style: "thin" }, left: { style: "thin" }, bottom: { style: "thin" }, right: { style: "thin" } },
+      };
+      const summaryStyle = { ...cellStyle, font: { ...cellStyle.font, bold: true } };
+
+      worksheet.mergeCells(1, 1, 1, 17);
+      worksheet.getCell(1, 1).value = `${areaName}鍖荤敓缁煎悎闅忚鍒楄〃`;
+      worksheet.getCell(1, 1).style = titleStyle;
+      worksheet.getRow(1).height = 30;
+
+      const headers = [
+        "鍖荤敓濮撳悕", "绉戝", "鍑洪櫌浜烘",
+        "棣栨鏃犻渶闅忚", "棣栨搴旈殢璁�", "棣栨闇�闅忚", "棣栨寰呴殢璁�", "棣栨瀹屾垚", "棣栨澶辫触", "棣栨鎴愬姛鐜�",
+        "鍐嶆闇�闅忚", "鍐嶆寰呴殢璁�", "鍐嶆瀹屾垚", "鍐嶆澶辫触", "鍐嶆鎴愬姛鐜�",
+        "闅忚鐜�", "鎺ㄩ�佺巼"
+      ];
+      const headerRow = worksheet.addRow(headers);
+      headerRow.eachCell((cell) => { cell.style = headerStyle; });
+      worksheet.getRow(2).height = 25;
+
+      data.forEach(item => {
+        const row = worksheet.addRow([
+          item.drname,
+          item.deptname,
+          item.dischargeCount,
+          item.nonFollowUp,
+          item.followUpNeeded,
+          item.needFollowUp,
+          item.pendingFollowUp,
+          item.followUpSuccess,
+          item.followUpFail,
+          this.calculateSuccessRate(item.followUpSuccess, item.needFollowUp, item.pendingFollowUp),
+          item.needFollowUpAgain,
+          item.pendingFollowUpAgain,
+          item.followUpSuccessAgain,
+          item.followUpFailAgain,
+          this.calculateSuccessRate(item.followUpSuccessAgain, item.needFollowUpAgain, item.pendingFollowUpAgain),
+          this.calculateFollowUpRate(item),
+          this.calculatePushRate(item),
+        ]);
+        row.eachCell((cell) => { cell.style = cellStyle; });
+        row.height = 24;
+      });
+
+      // 灏忚
+      const summaryRow = worksheet.addRow(this.getDoctorExportSummary(data));
+      summaryRow.eachCell((cell) => { cell.style = summaryStyle; });
+
+      worksheet.columns = Array(17).fill({ width: 12 });
+      worksheet.columns[0].width = 15;
+      worksheet.columns[1].width = 15;
+    },
+
+    getDoctorExportSummary(data) {
+      const sums = ["灏忚", "-", 0, 0, 0, 0, 0, 0, 0, "0%", 0, 0, 0, 0, "0%", "0%", "0%"];
+      const numIndices = [2, 3, 4, 5, 6, 7, 8, 10, 11, 12, 13];
+      data.forEach(row => {
+        numIndices.forEach(idx => {
+          const val = Number(row[this.getFieldByIndex(idx)]) || 0;
+          sums[idx] += val;
+        });
+      });
+      numIndices.forEach(idx => { sums[idx] = this.formatNumber(sums[idx]); });
+      // 骞冲潎鍊�
+      const followUpRates = data.map(row => parseFloat(this.calculateFollowUpRate(row).replace("%", ""))).filter(v => !isNaN(v));
+      const pushRates = data.map(row => parseFloat(this.calculatePushRate(row).replace("%", ""))).filter(v => !isNaN(v));
+      sums[15] = followUpRates.length ? (followUpRates.reduce((a,b)=>a+b,0)/followUpRates.length).toFixed(2)+"%" : "0.00%";
+      sums[16] = pushRates.length ? (pushRates.reduce((a,b)=>a+b,0)/pushRates.length).toFixed(2)+"%" : "0.00%";
+      // 鎴愬姛鐜囨暣浣撴硶
+      const totalSuccess = data.reduce((s, row) => s + (Number(row.followUpSuccess)||0), 0);
+      const totalNeed = data.reduce((s, row) => s + (Number(row.needFollowUp)||0), 0);
+      const totalPending = data.reduce((s, row) => s + (Number(row.pendingFollowUp)||0), 0);
+      const denom = totalNeed - totalPending;
+      sums[9] = denom > 0 ? ((totalSuccess/denom)*100).toFixed(2)+"%" : "0.00%";
+      const totalSuccessAgain = data.reduce((s, row) => s + (Number(row.followUpSuccessAgain)||0), 0);
+      const totalNeedAgain = data.reduce((s, row) => s + (Number(row.needFollowUpAgain)||0), 0);
+      const totalPendingAgain = data.reduce((s, row) => s + (Number(row.pendingFollowUpAgain)||0), 0);
+      const denomAgain = totalNeedAgain - totalPendingAgain;
+      sums[14] = denomAgain > 0 ? ((totalSuccessAgain/denomAgain)*100).toFixed(2)+"%" : "0.00%";
+      return sums;
+    },
+
+    // ===================== Tooltips =====================
+    Tooltipcgl(h, { column }) {
+      return h("el-tooltip", {
+        props: { content: "闅忚鎴愬姛/(闇�闅忚-寰呴殢璁�)", placement: "top", effect: "dark" },
+      }, [h("span", column.label)]);
+    },
+    TooltipFollowUpRate(h, { column }) {
+      return h("el-tooltip", {
+        props: { content: "(棣栨瀹屾垚+棣栨鏃犻渶闅忚)/(棣栨搴旈殢璁�+棣栨鏃犻渶闅忚)", placement: "top", effect: "dark" },
+      }, [h("span", column.label)]);
+    },
+    TooltipPushRate(h, { column }) {
+      return h("el-tooltip", {
+        props: { content: "鍐嶆瀹屾垚/(棣栨搴旈殢璁�+棣栨鏃犻渶闅忚)", placement: "top", effect: "dark" },
+      }, [h("span", column.label)]);
+    },
+  },
+};
+</script>
+
+<style lang="scss" scoped>
+.combined-follow-up {
+  .your-table-container {
+    margin-top: 10px;
+  }
+  .button-zx {
+    color: rgb(70, 204, 238);
+  }
+}
+</style>
diff --git a/src/views/sfstatistics/percentage/components/FirstFollowUp.vue b/src/views/sfstatistics/percentage/components/FirstFollowUp.vue
index 89b4de0..d766ae3 100644
--- a/src/views/sfstatistics/percentage/components/FirstFollowUp.vue
+++ b/src/views/sfstatistics/percentage/components/FirstFollowUp.vue
@@ -231,6 +231,7 @@
                   </template>
                 </el-table-column>
                 <el-table-column
+                  v-if="orgname != '鏅畞鐣叉棌鑷不鍘夸汉姘戝尰闄�'"
                   label="鎴愬姛鐜�"
                   align="center"
                   width="120"
@@ -541,6 +542,7 @@
             </template>
           </el-table-column>
           <el-table-column
+            v-if="orgname != '鏅畞鐣叉棌鑷不鍘夸汉姘戝尰闄�'"
             label="鎴愬姛鐜�"
             align="center"
             width="120"
@@ -764,7 +766,7 @@
 
       delete params.leavehospitaldistrictcodes.all;
       delete params.deptcodes.all;
-      params.rateDay = 7;
+      params.rateDay = this.orgname == "榫欐硥甯備汉姘戝尰闄�" ? 21 : 7;
       getSfStatistics(params)
         .then((response) => {
           this.tableData = this.customSort(response.data);
@@ -887,7 +889,8 @@
         "el-tooltip",
         {
           props: {
-            content: "(搴旈殢璁挎椂闂�+浠诲姟鍛ㄦ湡)灏忎簬瀹屾垚鏃堕棿鍗充负瓒呮椂;(闇�闅忚-瓒呮椂)/闇�闅忚",
+            content:
+              "(鍑洪櫌鏃堕棿+浠诲姟鍛ㄦ湡)灏忎簬瀹屾垚鏃堕棿鍗充负瓒呮椂;(闇�闅忚-瓒呮椂)/闇�闅忚",
             placement: "top",
             effect: "dark",
           },
@@ -1015,7 +1018,7 @@
 
       if (!row.doctorStats) {
         this.loading = true;
-        params.rateDay = 7;
+        params.rateDay = this.orgname == "榫欐硥甯備汉姘戝尰闄�" ? 21 : 7;
 
         getSfStatistics(params).then((res) => {
           this.$set(row, "doctorStats", res.data);
@@ -1286,40 +1289,29 @@
           Array.isArray(this.queryParams.serviceType) &&
           this.queryParams.serviceType.length > 0
         ) {
-          if (this.tasktypes && Array.isArray(this.tasktypes)) {
-            // 杩囨护鍑哄尮閰嶇殑闅忚绫诲瀷
-            const matchedTypes = this.tasktypes.filter((task) =>
+          // 浣跨敤 props 涓殑 options锛堝嵆 tasktypes锛�
+          if (this.options && Array.isArray(this.options)) {
+            const matchedTypes = this.options.filter((task) =>
               this.queryParams.serviceType.includes(task.value)
             );
+            console.log(matchedTypes, "matchedTypes");
 
             if (matchedTypes.length === 1) {
-              // 鍗曚釜绫诲瀷
               const label = matchedTypes[0].label;
               serviceTypeName = `棣栨${label}`;
               sheetTypeName = `棣栨${label}`;
             } else if (matchedTypes.length > 1) {
-              // 澶氫釜绫诲瀷
               const typeNames = matchedTypes.map((task) => task.label);
-
-              // 鏂囦欢鍚嶏細鐢ㄦ枩鏉犲垎闅�
               serviceTypeName = `棣栨${typeNames.join("/")}`;
-
-              // 宸ヤ綔琛ㄥ悕锛氫娇鐢ㄧ涓�涓被鍨嬫垨绠�鍖栧悕绉�
-              if (matchedTypes.length <= 2) {
-                // 濡傛灉鍙湁2涓被鍨嬶紝閮芥樉绀�
-                sheetTypeName = `棣栨${typeNames[0]}绛塦;
-              } else {
-                // 濡傛灉瓒呰繃2涓被鍨嬶紝鍙樉绀虹涓�涓�
-                sheetTypeName = `棣栨${typeNames[0]}绛塦;
-              }
+              // 宸ヤ綔琛ㄥ悕绠�鍖栵紙鍙栫涓�涓�+鈥滅瓑鈥濓級
+              sheetTypeName = `棣栨${typeNames[0]}绛塦;
             } else if (this.queryParams.serviceType.length > 0) {
-              // 濡傛灉娌℃湁鍖归厤鐨勶紝浣跨敤鍘熷鍊�
+              // 鏃犲尮閰嶆椂浣跨敤鍘熷鍊�
               const typeStr = this.queryParams.serviceType.join("/");
               serviceTypeName = `棣栨${typeStr}`;
               sheetTypeName = "棣栨闅忚";
             }
           } else if (this.queryParams.serviceType.length > 0) {
-            // 濡傛灉娌℃湁 tasktypes锛屼娇鐢ㄥ師濮嬪��
             const typeStr = this.queryParams.serviceType.join("/");
             serviceTypeName = `棣栨${typeStr}`;
             sheetTypeName = "棣栨闅忚";
@@ -1347,7 +1339,7 @@
         const worksheet = workbook.addWorksheet(worksheetName);
 
         // 鏋勫缓琛ㄦ牸
-        this.buildExportSheet(worksheet, sheetNameSuffix);
+        this.buildExportSheet(worksheet, sheetNameSuffix, serviceTypeName);
 
         const buffer = await workbook.xlsx.writeBuffer();
         const blob = new Blob([buffer], {
@@ -1576,7 +1568,7 @@
 
       return sums;
     },
-    buildExportSheet(worksheet, sheetNameSuffix) {
+    buildExportSheet(worksheet, sheetNameSuffix, serviceTypeName) {
       const titleStyle = {
         font: {
           name: "寰蒋闆呴粦",
@@ -1650,11 +1642,11 @@
           right: { style: "thin", color: { argb: "FFD0D0D0" } },
         },
       };
-
+      const titleText = `${serviceTypeName}缁熻琛╛${sheetNameSuffix}`;
       // 娣诲姞鏍囬琛�
       worksheet.mergeCells(1, 1, 1, 16);
       const titleCell = worksheet.getCell(1, 1);
-      titleCell.value = `棣栨鍑洪櫌闅忚缁熻琛╛${sheetNameSuffix}`;
+      titleCell.value = titleText; // 浣跨敤鍔ㄦ�佹爣棰�
       titleCell.style = titleStyle;
       worksheet.getRow(1).height = 35;
 
@@ -1700,7 +1692,7 @@
       worksheet.getCell(2, 6).value = "搴旈殢璁夸汉娆�";
 
       worksheet.mergeCells(2, 7, 2, 16); // 浠�7鍚堝苟鍒�16锛堝師鏉ユ槸7-15锛�
-      worksheet.getCell(2, 7).value = "棣栨鍑洪櫌闅忚";
+      worksheet.getCell(2, 7).value = serviceTypeName; // 鎴栭�傚綋鎴彇
       worksheet.getCell(2, 7).style = headerStyle;
 
       worksheet.getRow(2).height = 28;
diff --git a/src/views/sfstatistics/percentage/components/SecondFollowUp.vue b/src/views/sfstatistics/percentage/components/SecondFollowUp.vue
index c97f352..ed11442 100644
--- a/src/views/sfstatistics/percentage/components/SecondFollowUp.vue
+++ b/src/views/sfstatistics/percentage/components/SecondFollowUp.vue
@@ -229,6 +229,7 @@
                   </template>
                 </el-table-column>
                 <el-table-column
+                  v-if="orgname != '鏅畞鐣叉棌鑷不鍘夸汉姘戝尰闄�'"
                   label="鎴愬姛鐜�"
                   align="center"
                   width="120"
@@ -526,6 +527,7 @@
             </template>
           </el-table-column>
           <el-table-column
+            v-if="orgname != '鏅畞鐣叉棌鑷不鍘夸汉姘戝尰闄�'"
             label="鎴愬姛鐜�"
             align="center"
             width="120"
@@ -697,7 +699,7 @@
 
       delete params.leavehospitaldistrictcodes.all;
       delete params.deptcodes.all;
-      params.rateDay = 7;
+      params.rateDay = this.orgname == "榫欐硥甯備汉姘戝尰闄�" ? 21 : 7;
 
       getSfStatistics(params)
         .then((response) => {
@@ -729,7 +731,8 @@
         "el-tooltip",
         {
           props: {
-            content: "(搴旈殢璁挎椂闂�+浠诲姟鍛ㄦ湡)灏忎簬瀹屾垚鏃堕棿鍗充负瓒呮椂;(闇�闅忚-瓒呮椂)/闇�闅忚",
+            content:
+              "(鍑洪櫌鏃堕棿+浠诲姟鍛ㄦ湡)灏忎簬瀹屾垚鏃堕棿鍗充负瓒呮椂;(闇�闅忚-瓒呮椂)/闇�闅忚",
             placement: "top",
             effect: "dark",
           },
@@ -949,7 +952,7 @@
 
       if (!row.doctorStats) {
         this.loading = true;
-        params.rateDay = 7;
+        params.rateDay = this.orgname == "榫欐硥甯備汉姘戝尰闄�" ? 21 : 7;
 
         getSfStatistics(params).then((res) => {
           this.$set(row, "doctorStats", res.data);
@@ -1272,7 +1275,7 @@
         const worksheet = workbook.addWorksheet(worksheetName);
 
         // 鏋勫缓琛ㄦ牸
-        this.buildExportSheet(worksheet, sheetNameSuffix);
+        this.buildExportSheet(worksheet, sheetNameSuffix, serviceTypeName);
 
         const buffer = await workbook.xlsx.writeBuffer();
         const blob = new Blob([buffer], {
@@ -1501,7 +1504,7 @@
 
       return sums;
     },
-    buildExportSheet(worksheet, sheetNameSuffix) {
+    buildExportSheet(worksheet, sheetNameSuffix, serviceTypeName) {
       const titleStyle = {
         font: {
           name: "寰蒋闆呴粦",
@@ -1576,10 +1579,11 @@
         },
       };
 
+      const titleText = `鍐嶆${serviceTypeName}缁熻琛╛${sheetNameSuffix}`;
       // 娣诲姞鏍囬琛�
-      worksheet.mergeCells(1, 1, 1, 15);
+      worksheet.mergeCells(1, 1, 1, 16);
       const titleCell = worksheet.getCell(1, 1);
-      titleCell.value = `鍐嶆鍑洪櫌闅忚缁熻琛╛${sheetNameSuffix}`;
+      titleCell.value = titleText; // 浣跨敤鍔ㄦ�佹爣棰�
       titleCell.style = titleStyle;
       worksheet.getRow(1).height = 35;
 
diff --git a/src/views/sfstatistics/percentage/index.vue b/src/views/sfstatistics/percentage/index.vue
index d8e3072..b6cb27c 100644
--- a/src/views/sfstatistics/percentage/index.vue
+++ b/src/views/sfstatistics/percentage/index.vue
@@ -132,6 +132,21 @@
     <!-- Tab鍒囨崲鍖哄煙 -->
     <div class="tab-section">
       <el-tabs v-model="activeTab" @tab-click="handleTabClick">
+        <el-tab-pane
+          label="缁煎悎缁熻"
+          v-if="orgname == '涓芥按甯備腑鍖婚櫌'"
+          name="combined"
+        >
+          <CombinedFollowUp
+            ref="combinedFollowUp"
+            :query-params="queryParams"
+            :flat-array-hospit="flatArrayhospit"
+            :flat-array-dept="flatArraydept"
+            :options="options"
+            :orgname="orgname"
+            @view-details="viewDetails"
+          />
+        </el-tab-pane>
         <el-tab-pane label="棣栨闅忚" name="first">
           <FirstFollowUp
             ref="firstFollowUp"
@@ -179,6 +194,7 @@
     <ChartDialog
       :visible="chartDialogVisible"
       :data="chartData"
+      :statisticaltype="queryParams.statisticaltype"
       :active-tab="activeTab"
       @close="chartDialogVisible = false"
     />
@@ -213,7 +229,7 @@
 import ChartDialog from "./components/ChartDialog.vue";
 import DetailDialog from "./components/DetailDialog.vue";
 import TimelyRateDialog from "./components/TimelyRateDialog.vue";
-
+import CombinedFollowUp from "./components/CombinedFollowUp.vue";
 import { getSfStatisticsHyperlink } from "@/api/AiCentre/index";
 
 export default {
@@ -225,6 +241,7 @@
     ChartDialog,
     DetailDialog,
     TimelyRateDialog,
+    CombinedFollowUp,
   },
   data() {
     return {
@@ -240,7 +257,10 @@
         dateRange: this.getLastMonthRange(),
         dateRangecy: [],
         statisticaltype:
-          localStorage.getItem("orgname") == "缂欎簯鍘夸汉姘戝尰闄�" ? 2 : 1,
+          localStorage.getItem("orgname") == "缂欎簯鍘夸汉姘戝尰闄�" ||
+          localStorage.getItem("orgname") == "鏅畞鐣叉棌鑷不鍘夸汉姘戝尰闄�"
+            ? 2
+            : 1,
         leavehospitaldistrictcodes: ["all"],
         deptcodes: ["all"],
       },
@@ -368,6 +388,9 @@
         case "continued":
           this.$refs.continuedCare.loadData();
           break;
+        case "combined":
+          this.$refs.combinedFollowUp.loadData();
+          break;
       }
     },
 
@@ -408,6 +431,9 @@
         case "continued":
           await this.$refs.continuedCare.exportTable();
           break;
+        case "combined":
+          await this.$refs.combinedFollowUp.exportTable();
+          break;
       }
     },
 
@@ -424,6 +450,8 @@
           return this.$refs.secondFollowUp.tableData;
         case "continued":
           return this.$refs.continuedCare.tableData;
+        case "combined":
+          return this.$refs.combinedFollowUp.tableData;
         default:
           return [];
       }
diff --git a/src/views/sfstatistics/propaganda/components/PropagandaDetailDialog.vue b/src/views/sfstatistics/propaganda/components/PropagandaDetailDialog.vue
new file mode 100644
index 0000000..c2e174d
--- /dev/null
+++ b/src/views/sfstatistics/propaganda/components/PropagandaDetailDialog.vue
@@ -0,0 +1,273 @@
+<template>
+  <el-dialog
+    :title="title"
+    :visible.sync="visible"
+    width="70%"
+    :close-on-click-modal="false"
+    @close="handleClose"
+  >
+    <div class="propaganda-detail-dialog">
+      <!-- 鎼滅储鏍� -->
+      <div class="search-bar">
+        <span class="search-label">鎮h�呭鍚嶆煡璇�:</span>
+        <el-input
+          v-model="localSearchName"
+          placeholder="璇疯緭鍏ユ偅鑰呭鍚嶈繘琛岀瓫閫�"
+          clearable
+          style="width: 300px"
+          @input="handleSearch"
+          @clear="handleSearch"
+        />
+        <span class="record-count">
+          鍏� {{ displayList.length }} 鏉¤褰�
+        </span>
+      </div>
+
+      <!-- 鏁版嵁琛ㄦ牸 -->
+      <div class="table-wrap" ref="tableWrap" @scroll="handleScroll">
+        <el-table
+          :data="currentDisplayList"
+          height="560"
+          style="width: 100%"
+          v-loading="loading"
+        >
+          <el-table-column
+            prop="sendname"
+            align="center"
+            label="鎮h�呭鍚�"
+            width="100"
+          />
+          <el-table-column
+            prop="telcode"
+            align="center"
+            label="鑱旂郴鐢佃瘽"
+            width="120"
+          />
+          <el-table-column
+            prop="preachcontent"
+            align="center"
+            label="瀹f暀鏍囬"
+            min-width="200"
+            show-overflow-tooltip
+          />
+          <el-table-column
+            prop="deptname"
+            align="center"
+            label="绉戝"
+            width="120"
+          />
+          <el-table-column
+            prop="leavehospitaldistrictname"
+            align="center"
+            label="鐥呭尯"
+            width="120"
+          />
+          <el-table-column
+            prop="sendTime"
+            align="center"
+            label="鍙戦�佹椂闂�"
+            width="160"
+          >
+            <template slot-scope="scope">
+              <span>{{ formatTime(scope.row.sendTime) }}</span>
+            </template>
+          </el-table-column>
+          <el-table-column
+            prop="readTime"
+            align="center"
+            label="闃呰鏃堕棿"
+            width="160"
+          >
+            <template slot-scope="scope">
+              <span>{{ formatTime(scope.row.readTime) }}</span>
+            </template>
+          </el-table-column>
+          <el-table-column
+            prop="sendState"
+            align="center"
+            label="鍙戦�佺姸鎬�"
+            width="100"
+          >
+            <template slot-scope="scope">
+              <el-tag
+                :type="getSendStateType(scope.row.sendState)"
+                :disable-transitions="false"
+              >
+                {{ getSendStateText(scope.row.sendState) }}
+              </el-tag>
+            </template>
+          </el-table-column>
+          <el-table-column
+            prop="isRead"
+            align="center"
+            label="闃呰鐘舵��"
+            width="100"
+          >
+            <template slot-scope="scope">
+              <el-tag
+                :type="scope.row.isRead == 1 ? 'success' : 'info'"
+                :disable-transitions="false"
+              >
+                {{ scope.row.isRead == 1 ? '宸茶' : '鏈' }}
+              </el-tag>
+            </template>
+          </el-table-column>
+        </el-table>
+      </div>
+    </div>
+  </el-dialog>
+</template>
+
+<script>
+export default {
+  name: "PropagandaDetailDialog",
+  props: {
+    visible: {
+      type: Boolean,
+      default: false,
+    },
+    title: {
+      type: String,
+      default: "",
+    },
+    data: {
+      type: Array,
+      default: () => [],
+    },
+    loading: {
+      type: Boolean,
+      default: false,
+    },
+  },
+  data() {
+    return {
+      localSearchName: "",
+      displayList: [],
+      currentDisplayList: [],
+      loadIndex: 0,
+      pageSize: 100,
+      isLoading: false,
+    };
+  },
+  watch: {
+    data: {
+      immediate: true,
+      handler(newData) {
+        if (newData && newData.length > 0) {
+          this.initializeData(newData);
+        } else {
+          this.displayList = [];
+          this.currentDisplayList = [];
+          this.loadIndex = 0;
+        }
+      },
+    },
+  },
+  methods: {
+    initializeData(data) {
+      this.displayList = [...data];
+      this.loadIndex = 0;
+      this.currentDisplayList = [];
+      this.$nextTick(() => {
+        this.loadMoreData();
+      });
+    },
+
+    handleSearch() {
+      if (!this.localSearchName.trim()) {
+        this.displayList = [...this.data];
+      } else {
+        const keyword = this.localSearchName.toLowerCase();
+        this.displayList = this.data.filter((item) => {
+          return item.sendname && item.sendname.toLowerCase().includes(keyword);
+        });
+      }
+      this.loadIndex = 0;
+      this.currentDisplayList = [];
+      this.$nextTick(() => {
+        this.loadMoreData();
+      });
+    },
+
+    loadMoreData() {
+      if (this.isLoading || this.loadIndex >= this.displayList.length) return;
+      this.isLoading = true;
+      setTimeout(() => {
+        const nextChunk = this.displayList.slice(
+          this.loadIndex,
+          this.loadIndex + this.pageSize
+        );
+        this.currentDisplayList = this.currentDisplayList.concat(nextChunk);
+        this.loadIndex += this.pageSize;
+        this.isLoading = false;
+      }, 100);
+    },
+
+    handleScroll(event) {
+      const scrollContainer = event.target;
+      const isAtBottom =
+        scrollContainer.scrollTop + scrollContainer.clientHeight >=
+        scrollContainer.scrollHeight - 10;
+      if (
+        isAtBottom &&
+        !this.isLoading &&
+        this.loadIndex < this.displayList.length
+      ) {
+        this.loadMoreData();
+      }
+    },
+
+    getSendStateType(state) {
+      const map = {
+        1: "success",
+        2: "danger",
+        0: "info",
+      };
+      return map[state] || "info";
+    },
+
+    getSendStateText(state) {
+      const map = {
+        1: "鍙戦�佹垚鍔�",
+        2: "鍙戦�佸け璐�",
+        0: "鏈彂閫�",
+      };
+      return map[state] || "鏈煡";
+    },
+
+    formatTime(time) {
+      if (!time) return "-";
+      return this.parseTime ? this.parseTime(time) : time;
+    },
+
+    handleClose() {
+      this.localSearchName = "";
+      this.$emit("close");
+    },
+  },
+};
+</script>
+
+<style lang="scss" scoped>
+.propaganda-detail-dialog {
+  .search-bar {
+    margin-bottom: 16px;
+    display: flex;
+    align-items: center;
+    .search-label {
+      margin-right: 10px;
+      font-weight: bold;
+    }
+    .record-count {
+      margin-left: 10px;
+      color: #2351e9;
+      font-size: 16px;
+    }
+  }
+
+  .table-wrap {
+    max-height: 600px;
+    overflow-y: auto;
+  }
+}
+</style>
diff --git a/src/views/sfstatistics/propaganda/index.vue b/src/views/sfstatistics/propaganda/index.vue
index 781ac98..5f258a4 100644
--- a/src/views/sfstatistics/propaganda/index.vue
+++ b/src/views/sfstatistics/propaganda/index.vue
@@ -182,7 +182,19 @@
           sortable="custom"
         >
           <template slot-scope="scope">
-            <span class="count-highlight">{{ scope.row.totalCount }}</span>
+            <el-button
+              size="medium"
+              type="text"
+              @click="
+                handleViewDetails(
+                  scope.row,
+                  'totalCountInfo',
+                  '瀹f暀鍙戦�佹�婚噺鏄庣粏'
+                )
+              "
+            >
+              <span class="count-highlight">{{ scope.row.totalCount }}</span>
+            </el-button>
           </template>
         </el-table-column>
 
@@ -193,7 +205,19 @@
           sortable="custom"
         >
           <template slot-scope="scope">
-            <span class="success-count">{{ scope.row.sendSuccessCount }}</span>
+            <el-button
+              size="medium"
+              type="text"
+              @click="
+                handleViewDetails(
+                  scope.row,
+                  'sendSuccessCountInfo',
+                  '鍙戦�佹垚鍔熼噺鏄庣粏'
+                )
+              "
+            >
+              <span class="success-count">{{ scope.row.sendSuccessCount }}</span>
+            </el-button>
           </template>
         </el-table-column>
 
@@ -204,7 +228,15 @@
           sortable="custom"
         >
           <template slot-scope="scope">
-            <span class="read-count">{{ scope.row.readCount }}</span>
+            <el-button
+              size="medium"
+              type="text"
+              @click="
+                handleViewDetails(scope.row, 'readCountInfo', '宸茶閲忔槑缁�')
+              "
+            >
+              <span class="read-count">{{ scope.row.readCount }}</span>
+            </el-button>
           </template>
         </el-table-column>
 
@@ -216,16 +248,28 @@
           sortable="custom"
         >
           <template slot-scope="scope">
-            <el-progress
-              :percentage="scope.row.sendSuccessRate * 100"
-              :stroke-width="8"
-              :show-text="false"
-              style="width: 80px; margin: 0 auto"
-              :color="getRateColor(scope.row.sendSuccessRate)"
-            />
-            <span class="rate-text"
-              >{{ (scope.row.sendSuccessRate * 100).toFixed(1) }}%</span
+            <el-button
+              size="medium"
+              type="text"
+              @click="
+                handleViewDetails(
+                  scope.row,
+                  'sendSuccessRate',
+                  '鍙戦�佹垚鍔熺巼鏄庣粏'
+                )
+              "
             >
+              <el-progress
+                :percentage="scope.row.sendSuccessRate * 100"
+                :stroke-width="8"
+                :show-text="false"
+                style="width: 80px; margin: 0 auto"
+                :color="getRateColor(scope.row.sendSuccessRate)"
+              />
+              <span class="rate-text"
+                >{{ (scope.row.sendSuccessRate * 100).toFixed(1) }}%</span
+              >
+            </el-button>
           </template>
         </el-table-column>
 
@@ -237,16 +281,24 @@
           sortable="custom"
         >
           <template slot-scope="scope">
-            <el-progress
-              :percentage="scope.row.readRate * 100"
-              :stroke-width="8"
-              :show-text="false"
-              style="width: 80px; margin: 0 auto"
-              :color="getRateColor(scope.row.readRate)"
-            />
-            <span class="rate-text"
-              >{{ (scope.row.readRate * 100).toFixed(1) }}%</span
+            <el-button
+              size="medium"
+              type="text"
+              @click="
+                handleViewDetails(scope.row, 'readRate', '宸茶鐜囨槑缁�')
+              "
             >
+              <el-progress
+                :percentage="scope.row.readRate * 100"
+                :stroke-width="8"
+                :show-text="false"
+                style="width: 80px; margin: 0 auto"
+                :color="getRateColor(scope.row.readRate)"
+              />
+              <span class="rate-text"
+                >{{ (scope.row.readRate * 100).toFixed(1) }}%</span
+              >
+            </el-button>
           </template>
         </el-table-column>
 
@@ -282,124 +334,24 @@
       />
     </div>
 
-    <!-- 鍒嗙粍璇︽儏寮圭獥 -->
-    <el-dialog
+    <!-- 鏄庣粏鏁版嵁寮圭獥 -->
+    <PropagandaDetailDialog
+      :visible="detailVisible"
       :title="detailTitle"
-      :visible.sync="detailVisible"
-      width="80%"
-      :before-close="handleCloseDetail"
-    >
-      <div v-loading="detailLoading">
-        <el-row :gutter="20" class="detail-header">
-          <el-col :span="6">
-            <div class="detail-item">
-              <label>鍒嗙粍鍚嶇О锛�</label>
-              <span>{{ currentGroup.groupName }}</span>
-            </div>
-          </el-col>
-          <el-col :span="6">
-            <div class="detail-item">
-              <label>鍒嗙粍缂栫爜锛�</label>
-              <span>{{ currentGroup.groupCode }}</span>
-            </div>
-          </el-col>
-          <el-col :span="6">
-            <div class="detail-item">
-              <label>鍙戦�佹垚鍔熺巼锛�</label>
-              <span class="rate-highlight"
-                >{{ (currentGroup.sendSuccessRate * 100).toFixed(1) }}%</span
-              >
-            </div>
-          </el-col>
-          <el-col :span="6">
-            <div class="detail-item">
-              <label>宸茶鐜囷細</label>
-              <span class="rate-highlight"
-                >{{ (currentGroup.readRate * 100).toFixed(1) }}%</span
-              >
-            </div>
-          </el-col>
-        </el-row>
-
-        <el-tabs v-model="detailActiveTab" class="detail-tabs">
-          <el-tab-pane label="瓒嬪娍鍒嗘瀽" name="trend">
-            <!-- 杩欓噷鍙互鏀剧疆鍥捐〃缁勪欢 -->
-            <div class="chart-placeholder">
-              瓒嬪娍鍥捐〃锛堝彲鏍规嵁闇�姹傛帴鍏Charts锛�
-            </div>
-          </el-tab-pane>
-          <el-tab-pane label="鏄庣粏鏁版嵁" name="detail">
-            <el-table
-              :data="detailList"
-              border
-              style="width: 100%; margin-top: 20px"
-            >
-              <el-table-column
-                prop="patientName"
-                label="鎮h�呭鍚�"
-                align="center"
-                width="120"
-              ></el-table-column>
-              <el-table-column
-                prop="patientNo"
-                label="鎮h�呯紪鍙�"
-                align="center"
-                width="120"
-              ></el-table-column>
-              <el-table-column
-                prop="sendTime"
-                label="鍙戦�佹椂闂�"
-                align="center"
-                width="180"
-              ></el-table-column>
-              <el-table-column
-                prop="readTime"
-                label="闃呰鏃堕棿"
-                align="center"
-                width="180"
-              ></el-table-column>
-              <el-table-column
-                prop="educationTitle"
-                label="瀹f暀鏍囬"
-                align="center"
-              ></el-table-column>
-              <el-table-column
-                prop="status"
-                label="鐘舵��"
-                align="center"
-                width="100"
-              >
-                <template slot-scope="scope">
-                  <el-tag
-                    :type="
-                      scope.row.status === '宸茶'
-                        ? 'success'
-                        : scope.row.status === '鍙戦�佹垚鍔�'
-                        ? 'info'
-                        : 'danger'
-                    "
-                    size="small"
-                  >
-                    {{ scope.row.status }}
-                  </el-tag>
-                </template>
-              </el-table-column>
-            </el-table>
-          </el-tab-pane>
-        </el-tabs>
-      </div>
-      <span slot="footer" class="dialog-footer">
-        <el-button @click="detailVisible = false">鍏� 闂�</el-button>
-      </span>
-    </el-dialog>
+      :data="detailList"
+      :loading="detailLoading"
+      @close="detailVisible = false"
+    />
   </div>
 </template>
 
 <script>
-import { gethelibraryCount } from "@/api/AiCentre/index";
+import { gethelibraryCount, gethelibraryCountHyperlink } from "@/api/AiCentre/index";
+import PropagandaDetailDialog from "./components/PropagandaDetailDialog.vue";
 
 export default {
   name: "EducationStatistics",
+  components: { PropagandaDetailDialog },
   data() {
     return {
       // 鏌ヨ鍙傛暟
@@ -436,8 +388,6 @@
       // 璇︽儏寮圭獥
       detailVisible: false,
       detailTitle: "",
-      detailActiveTab: "trend",
-      currentGroup: {},
       detailList: [],
 
       // 鏃ユ湡閫夋嫨鍣ㄩ厤缃�
@@ -656,78 +606,48 @@
       return "#F56C6C";
     },
 
-    // 鏌ョ湅鍒嗙粍璇︽儏
-    handleGroupDetail(row) {
-      this.currentGroup = row;
-      this.detailTitle = `${row.groupName} - 瀹f暀缁熻璇︽儏`;
-      this.detailActiveTab = "trend";
+    // 鐐瑰嚮缁熻鏁板瓧鏌ョ湅鏄庣粏锛堜豢闅忚缁熻妯″紡锛�
+    handleViewDetails(row, infoKey, titleSuffix) {
+      const groupName = row.groupName || "";
+      this.detailTitle = `${groupName} - ${titleSuffix}`;
       this.detailVisible = true;
-      this.loadDetailData();
-    },
-
-    // 鍔犺浇璇︽儏鏁版嵁
-    async loadDetailData() {
       this.detailLoading = true;
-      try {
-        // 杩欓噷搴旇璋冪敤鑾峰彇璇︽儏鐨勬帴鍙�
-        // 妯℃嫙鏁版嵁
-        setTimeout(() => {
-          this.detailList = [
-            {
-              patientName: "寮犱笁",
-              patientNo: "P202312001",
-              sendTime: "2023-12-01 10:30:00",
-              readTime: "2023-12-01 14:20:00",
-              educationTitle: "楠ㄧ鏈悗搴峰鎸囧",
-              status: "宸茶",
-            },
-            {
-              patientName: "鏉庡洓",
-              patientNo: "P202312002",
-              sendTime: "2023-12-01 11:15:00",
-              readTime: "",
-              educationTitle: "蹇冭绠$柧鐥呴闃�",
-              status: "鍙戦�佹垚鍔�",
-            },
-            {
-              patientName: "鐜嬩簲",
-              patientNo: "P202312003",
-              sendTime: "2023-12-02 09:45:00",
-              readTime: "2023-12-02 16:10:00",
-              educationTitle: "绯栧翱鐥呴ギ椋熸寚瀵�",
-              status: "宸茶",
-            },
-          ];
-          this.detailLoading = false;
-        }, 500);
-      } catch (error) {
-        console.error("鍔犺浇璇︽儏鏁版嵁澶辫触:", error);
-        this.$message.error("鍔犺浇璇︽儏鏁版嵁澶辫触");
-        this.detailLoading = false;
+      this.detailList = [];
+
+      const params = {
+        hyperLinkInfoType: infoKey,
+        hospType: this.queryParams.hospType,
+      };
+
+      // 鏍规嵁缁熻缁村害浼犲叆瀵瑰簲鐨勮繃婊ゅ弬鏁�
+      if (this.queryParams.groupType == "1") {
+        // 鎸夌瀹ょ粺璁�
+        params.deptcodes = [row.groupCode];
+      } else if (this.queryParams.groupType == "2") {
+        // 鎸夌梾鍖虹粺璁�
+        params.hospitaldistrictcodes = [row.groupCode];
       }
-    },
 
-    // 鏌ョ湅璇︽儏
-    handleDetail(row) {
-      this.currentGroup = row;
-      this.detailTitle = `${row.groupName} - 鏄庣粏鏁版嵁`;
-      this.detailActiveTab = "detail";
-      this.detailVisible = true;
-      this.loadDetailData();
-    },
+      // 浼犲叆鏃堕棿鑼冨洿
+      if (
+        this.queryParams.dateRange &&
+        this.queryParams.dateRange.length === 2
+      ) {
+        params.starttime = this.queryParams.dateRange[0];
+        params.endtime = this.queryParams.dateRange[1];
+      }
+      if (this.queryParams.visittime) {
+        params.visittime = this.queryParams.visittime;
+      }
 
-    // 瀵煎嚭褰撳墠鍒嗙粍鏁版嵁
-    handleExportGroup(row) {
-      this.$confirm(`纭畾瑕佸鍑� "${row.groupName}" 鐨勭粺璁℃暟鎹悧?`, "鎻愮ず", {
-        confirmButtonText: "纭畾",
-        cancelButtonText: "鍙栨秷",
-        type: "warning",
-      })
-        .then(() => {
-          // 杩欓噷璋冪敤瀵煎嚭鎺ュ彛
-          this.$message.success("瀵煎嚭浠诲姟宸插紑濮嬶紝璇风◢鍚庡湪涓嬭浇涓績鏌ョ湅");
+      gethelibraryCountHyperlink(params)
+        .then((response) => {
+          this.detailList = response.data || [];
+          this.detailLoading = false;
         })
-        .catch(() => {});
+        .catch(() => {
+          this.detailLoading = false;
+        });
     },
 
     // 瀵煎嚭鍏ㄩ儴鏁版嵁
@@ -738,26 +658,10 @@
         type: "warning",
       })
         .then(() => {
-          // 鏋勫缓瀵煎嚭鍙傛暟
           const exportParams = { ...this.queryParams };
           delete exportParams.pageNum;
           delete exportParams.pageSize;
-
-          // 杩欓噷璋冪敤瀵煎嚭鎺ュ彛
           this.$message.success("瀵煎嚭浠诲姟宸插紑濮嬶紝璇风◢鍚庡湪涓嬭浇涓績鏌ョ湅");
-        })
-        .catch(() => {});
-    },
-
-    // 鍏抽棴璇︽儏寮圭獥
-    handleCloseDetail(done) {
-      this.$confirm("纭鍏抽棴锛�", "鎻愮ず", {
-        confirmButtonText: "纭畾",
-        cancelButtonText: "鍙栨秷",
-        type: "warning",
-      })
-        .then(() => {
-          done();
         })
         .catch(() => {});
     },
@@ -856,45 +760,6 @@
     }
   }
 
-  .detail-header {
-    margin-bottom: 20px;
-    padding: 20px;
-    background: #f8f9fa;
-    border-radius: 8px;
-
-    .detail-item {
-      label {
-        color: #909399;
-        font-size: 14px;
-      }
-
-      span {
-        font-size: 16px;
-        font-weight: 500;
-        color: #303133;
-      }
-
-      .rate-highlight {
-        color: #409eff;
-        font-weight: 600;
-      }
-    }
-  }
-
-  .detail-tabs {
-    margin-top: 20px;
-  }
-
-  .chart-placeholder {
-    height: 300px;
-    display: flex;
-    align-items: center;
-    justify-content: center;
-    background: #f8f9fa;
-    border-radius: 8px;
-    color: #909399;
-    border: 1px dashed #dcdfe6;
-  }
 }
 
 // 鍝嶅簲寮忚皟鏁�
diff --git a/src/views/system/ruleconfig/index.vue b/src/views/system/ruleconfig/index.vue
index 7554947..f832adf 100644
--- a/src/views/system/ruleconfig/index.vue
+++ b/src/views/system/ruleconfig/index.vue
@@ -334,11 +334,21 @@
       }
       return [];
     },
+     computedWardOptions() {
+      if (this.$store.getters.belongWards) {
+        return this.$store.getters.belongWards.map((dept) => ({
+          label: dept.districtName,
+          value: dept.districtCode,
+        }));
+      }
+      return [];
+    },
   },
   created() {
     this.getList();
     this.departmentOptions = this.computedDepartmentOptions;
-    this.fetchWardOptions();
+    this.wardOptions = this.computedWardOptions;
+    // this.fetchWardOptions();
   },
   methods: {
     // 鑾峰彇瑙勫垯鍒楄〃
@@ -375,12 +385,12 @@
       // });
 
       // 涓存椂鏁版嵁
-      this.wardOptions = [
-        { label: "蹇冭绠″唴绉戜竴鐥呭尯", value: "W001" },
-        { label: "蹇冭绠″唴绉戜簩鐥呭尯", value: "W002" },
-        { label: "鍛煎惛鍐呯鐥呭尯", value: "W003" },
-        { label: "绁炵粡鍐呯鐥呭尯", value: "W004" },
-      ];
+      // this.wardOptions = [
+      //   { label: "蹇冭绠″唴绉戜竴鐥呭尯", value: "W001" },
+      //   { label: "蹇冭绠″唴绉戜簩鐥呭尯", value: "W002" },
+      //   { label: "鍛煎惛鍐呯鐥呭尯", value: "W003" },
+      //   { label: "绁炵粡鍐呯鐥呭尯", value: "W004" },
+      // ];
     },
 
     // 绉戝鍙樺寲澶勭悊
diff --git a/src/views/system/user/index.vue b/src/views/system/user/index.vue
index 7b132b3..b3c00ab 100644
--- a/src/views/system/user/index.vue
+++ b/src/views/system/user/index.vue
@@ -722,6 +722,7 @@
       deptTreeSelect(1).then((response) => {
         this.deptOptionsks = response.data;
       });
+      // 鐥呭尯鍒楄〃
       deptTreeSelect(2).then((response) => {
         this.deptOptionsbq = response.data;
       });
diff --git a/src/views/system/user/profile/index.vue b/src/views/system/user/profile/index.vue
index 0918602..2533e08 100644
--- a/src/views/system/user/profile/index.vue
+++ b/src/views/system/user/profile/index.vue
@@ -23,95 +23,144 @@
                 <svg-icon icon-class="email" />鐢ㄦ埛閭
                 <div class="pull-right">{{ user.email }}</div>
               </li>
-              <li class="list-group-item" v-if="user.belongWards[0]">
+
+              <!-- ===== 鎵�灞炵梾鍖� ===== -->
+              <li class="list-group-item" v-if="user.belongWards && user.belongWards.length">
                 <svg-icon icon-class="tree" />鎵�灞炵梾鍖�
                 <div class="pull-right">
-                  <el-popover
-                    v-model="showAllWardsPopover"
-                    placement="right-start"
-                    :width="300"
-                    trigger="manual"
-                    popper-class="ward-popover"
-                  >
-                    <div class="popover-content">
-                      <p
-                        v-for="ward in user.belongWards"
-                        :key="ward.districtId"
-                        class="popover-item"
-                      >
-                        {{ ward.districtName }}
-                      </p>
-                    </div>
-                    <!-- 闇�瑕佷竴涓┖鍏冪礌浣滀负瑙﹀彂鍣ㄧ殑寮曠敤 -->
-                    <!-- <div style="display: none" slot="reference"></div> -->
-                    <div slot="reference">
-                      <el-tag
-                        v-for="(ward, index) in displayWards"
-                        :key="ward.districtId"
-                        size="small"
-                        class="ward-tag"
-                        >{{ ward.districtName }}</el-tag
-                      >
-                      <!-- 鏄剧ず闅愯棌鏁伴噺鐨勬爣绛撅紝鐐瑰嚮瑙﹀彂Popover -->
-                      <el-tag
-                        v-if="user.belongWards.length > maxTagCount"
-                        size="small"
-                        class="more-tag"
-                        @click="showAllWardsPopover = !showAllWardsPopover"
-                        >+{{ user.belongWards.length - maxTagCount }}</el-tag
-                      >
-                    </div>
-                  </el-popover>
+                  <!-- 鍗楀崕闄勪竴锛氬彲缂栬緫妯″紡 -->
+                  <template v-if="isNanhua && editing">
+                    <el-cascader
+                      v-model="formWardCodes"
+                      :options="deptOptionsbq"
+                      :props="cascaderProps"
+                      filterable
+                      clearable
+                      size="small"
+                      style="width: 100%"
+                      @remove-tag="onWardRemoveTag"
+                    />
+                  </template>
+                  <!-- 鍗楀崕闄勪竴锛氬彧璇绘ā寮� -->
+                  <template v-else-if="isNanhua">
+                    <el-tag
+                      v-for="ward in user.belongWards"
+                      :key="ward.districtId"
+                      size="small"
+                      class="ward-tag"
+                    >{{ ward.districtName }}</el-tag>
+                  </template>
+                  <!-- 鍏朵粬鏈烘瀯锛氬師鏈� Popover 灞曠ず -->
+                  <template v-else>
+                    <el-popover
+                      v-model="showAllWardsPopover"
+                      placement="right-start"
+                      :width="300"
+                      trigger="manual"
+                      popper-class="ward-popover"
+                    >
+                      <div class="popover-content">
+                        <p v-for="ward in user.belongWards" :key="ward.districtId" class="popover-item">
+                          {{ ward.districtName }}
+                        </p>
+                      </div>
+                      <div slot="reference">
+                        <el-tag
+                          v-for="(ward, index) in displayWards"
+                          :key="ward.districtId"
+                          size="small"
+                          class="ward-tag"
+                        >{{ ward.districtName }}</el-tag>
+                        <el-tag
+                          v-if="user.belongWards.length > maxTagCount"
+                          size="small"
+                          class="more-tag"
+                          @click="showAllWardsPopover = !showAllWardsPopover"
+                        >+{{ user.belongWards.length - maxTagCount }}</el-tag>
+                      </div>
+                    </el-popover>
+                  </template>
                 </div>
               </li>
               <li class="list-group-item" v-else>
-                <svg-icon icon-class="tree" />鎵�灞為櫌鍖�
+                <svg-icon icon-class="tree" />鎵�灞炵梾鍖�
                 <div class="pull-right">鏈厤缃�</div>
               </li>
-              <li class="list-group-item" v-if="user.belongDepts[0]">
+
+              <!-- ===== 鎵�灞炵瀹� ===== -->
+              <li class="list-group-item" v-if="user.belongDepts && user.belongDepts.length">
                 <svg-icon icon-class="tree" />鎵�灞炵瀹�
                 <div class="pull-right">
-                  <el-popover
-                    v-model="showAllDeptsPopover"
-                    placement="right-start"
-                    :width="300"
-                    style="top: 130px; left: 0px"
-                    trigger="manual"
-                    popper-class="dept-popover"
-                  >
-                    <div class="popover-content">
-                      <p
-                        v-for="dept in user.belongDepts"
-                        :key="dept.deptId"
-                        class="popover-item"
-                      >
-                        {{ dept.deptName }}
-                      </p>
-                    </div>
-                    <!-- <div style="display: none" slot="reference"></div> -->
-                    <div slot="reference">
-                      <el-tag
-                        v-for="(dept, index) in displayDepts"
-                        :key="dept.deptId"
-                        size="small"
-                        class="dept-tag"
-                        >{{ dept.deptName }}</el-tag
-                      >
-                      <el-tag
-                        v-if="user.belongDepts.length > maxTagCount"
-                        size="small"
-                        class="more-tag"
-                        @click="showAllDeptsPopover = !showAllDeptsPopover"
-                        >+{{ user.belongDepts.length - maxTagCount }}</el-tag
-                      >
-                    </div>
-                  </el-popover>
+                  <!-- 鍗楀崕闄勪竴锛氬彲缂栬緫妯″紡 -->
+                  <template v-if="isNanhua && editing">
+                    <el-cascader
+                      v-model="formDeptCodes"
+                      :options="deptOptionsks"
+                      :props="cascaderProps"
+                      filterable
+                      clearable
+                      size="small"
+                      style="width: 100%"
+                      @remove-tag="onDeptRemoveTag"
+                    />
+                  </template>
+                  <!-- 鍗楀崕闄勪竴锛氬彧璇绘ā寮� -->
+                  <template v-else-if="isNanhua">
+                    <el-tag
+                      v-for="dept in user.belongDepts"
+                      :key="dept.deptId"
+                      size="small"
+                      class="dept-tag"
+                    >{{ dept.deptName }}</el-tag>
+                  </template>
+                  <!-- 鍏朵粬鏈烘瀯锛氬師鏈� Popover 灞曠ず -->
+                  <template v-else>
+                    <el-popover
+                      v-model="showAllDeptsPopover"
+                      placement="right-start"
+                      :width="300"
+                      trigger="manual"
+                      popper-class="dept-popover"
+                    >
+                      <div class="popover-content">
+                        <p v-for="dept in user.belongDepts" :key="dept.deptId" class="popover-item">
+                          {{ dept.deptName }}
+                        </p>
+                      </div>
+                      <div slot="reference">
+                        <el-tag
+                          v-for="(dept, index) in displayDepts"
+                          :key="dept.deptId"
+                          size="small"
+                          class="dept-tag"
+                        >{{ dept.deptName }}</el-tag>
+                        <el-tag
+                          v-if="user.belongDepts.length > maxTagCount"
+                          size="small"
+                          class="more-tag"
+                          @click="showAllDeptsPopover = !showAllDeptsPopover"
+                        >+{{ user.belongDepts.length - maxTagCount }}</el-tag>
+                      </div>
+                    </el-popover>
+                  </template>
                 </div>
               </li>
               <li class="list-group-item" v-else>
                 <svg-icon icon-class="tree" />鎵�灞炵瀹�
                 <div class="pull-right">鏈厤缃�</div>
               </li>
+
+              <!-- 鍗楀崕闄勪竴锛氱紪杈�/淇濆瓨鎸夐挳 -->
+              <li class="list-group-item" v-if="isNanhua" style="justify-content: center; padding-top: 16px;">
+                <template v-if="!editing">
+                  <el-button type="primary" size="small" icon="el-icon-edit" @click="startEdit">缂栬緫绉戝/鐥呭尯</el-button>
+                </template>
+                <template v-else>
+                  <el-button size="small" @click="cancelEdit">鍙栨秷</el-button>
+                  <el-button type="primary" size="small" :loading="saving" @click="saveEdit">淇濆瓨</el-button>
+                </template>
+              </li>
+
               <li class="list-group-item">
                 <svg-icon icon-class="peoples" />鎵�灞炶鑹�
                 <div class="pull-right">{{ roleGroup }}</div>
@@ -147,7 +196,7 @@
 import userAvatar from "./userAvatar";
 import userInfo from "./userInfo";
 import resetPwd from "./resetPwd";
-import { getUserProfile } from "@/api/system/user";
+import { getUserProfile, updateUser, deptTreeSelect, adduserdept, removeusertd } from "@/api/system/user";
 
 export default {
   name: "Profile",
@@ -161,6 +210,16 @@
       maxTagCount: 3, // 鎺у埗榛樿鏄剧ず鐨勬爣绛炬暟閲�
       showAllWardsPopover: false, // 鎺у埗鐥呭尯Popover鐨勬樉绀�
       showAllDeptsPopover: false, // 鎺у埗绉戝Popover鐨勬樉绀�
+      // 缂栬緫妯″紡锛堜粎鍗楀崕闄勪竴锛�
+      editing: false,
+      saving: false,
+      deptOptionsks: [],  // 绉戝绾ц仈鏍�
+      deptOptionsbq: [],  // 鐥呭尯绾ц仈鏍�
+      formDeptCodes: [],  // 绉戝绾ц仈缁戝畾鍊�
+      formWardCodes: [],  // 鐥呭尯绾ц仈缁戝畾鍊�
+      originalDeptCodes: [], // 鍘熷绉戝鍊硷紙鍙栨秷鏃舵仮澶嶏級
+      originalWardCodes: [], // 鍘熷鐥呭尯鍊硷紙鍙栨秷鏃舵仮澶嶏級
+      cascaderProps: { multiple: true, value: "deptCode", label: "label" },
     };
   },
   computed: {
@@ -174,9 +233,16 @@
       if (!this.user.belongDepts) return [];
       return this.user.belongDepts.slice(0, this.maxTagCount);
     },
+    // 鍗楀崕澶у闄勫睘绗竴鍖婚櫌 鍏佽缂栬緫绉戝/鐥呭尯
+    isNanhua() {
+      return localStorage.getItem("orgname") === "鍗楀崕澶у闄勫睘绗竴鍖婚櫌";
+    },
   },
   created() {
     this.getUser();
+    if (localStorage.getItem("orgname") === "鍗楀崕澶у闄勫睘绗竴鍖婚櫌") {
+      this.loadDeptTree();
+    }
   },
   methods: {
     getUser() {
@@ -184,6 +250,102 @@
         this.user = response.data;
         this.roleGroup = response.roleGroup;
         this.postGroup = response.postGroup;
+        // 瑙f瀽宸蹭繚瀛樼殑绉戝/鐥呭尯绾ц仈璺緞锛坔ospInfo = 绉戝, deptInfo = 鐥呭尯锛�
+        try {
+          this.formDeptCodes = this.user.hospInfo ? JSON.parse(this.user.hospInfo) : [];
+        } catch (e) { this.formDeptCodes = []; }
+        try {
+          this.formWardCodes = this.user.deptInfo ? JSON.parse(this.user.deptInfo) : [];
+        } catch (e) { this.formWardCodes = []; }
+        this.originalDeptCodes = JSON.parse(JSON.stringify(this.formDeptCodes));
+        this.originalWardCodes = JSON.parse(JSON.stringify(this.formWardCodes));
+      });
+    },
+    // 鍔犺浇绉戝/鐥呭尯绾ц仈鏍�
+    loadDeptTree() {
+      deptTreeSelect(1).then((res) => { this.deptOptionsks = res.data || []; });
+      deptTreeSelect(2).then((res) => { this.deptOptionsbq = res.data || []; });
+    },
+    // 杩涘叆缂栬緫妯″紡
+    startEdit() {
+      this.originalDeptCodes = JSON.parse(JSON.stringify(this.formDeptCodes));
+      this.originalWardCodes = JSON.parse(JSON.stringify(this.formWardCodes));
+      this.editing = true;
+    },
+    // 鍙栨秷缂栬緫
+    cancelEdit() {
+      this.formDeptCodes = JSON.parse(JSON.stringify(this.originalDeptCodes));
+      this.formWardCodes = JSON.parse(JSON.stringify(this.originalWardCodes));
+      this.editing = false;
+    },
+    // 淇濆瓨绉戝/鐥呭尯
+    saveEdit() {
+      if (!this.user.userId) return;
+      this.saving = true;
+
+      const deptCodes = this.formDeptCodes.length
+        ? this.formDeptCodes.map(arr => arr[arr.length - 1])
+        : [];
+      const wardCodes = this.formWardCodes.length
+        ? this.formWardCodes.map(arr => arr[arr.length - 1])
+        : [];
+
+      const params = {
+        userId: this.user.userId,
+        hospInfo: JSON.stringify(this.formDeptCodes),
+        deptInfo: JSON.stringify(this.formWardCodes),
+        deptCodes: deptCodes,
+        wardCodes: wardCodes,
+      };
+
+      updateUser(params).then(() => {
+        // 鍚屾鏂板/鍒犻櫎鐨勭瀹ょ梾鍖�
+        this.syncUserDept(wardCodes, 2);
+        this.syncUserDept(deptCodes, 1);
+        this.$modal.msgSuccess("绉戝/鐥呭尯淇敼鎴愬姛");
+        this.editing = false;
+        this.saving = false;
+        this.getUser(); // 鍒锋柊鐢ㄦ埛淇℃伅
+      }).catch(() => {
+        this.saving = false;
+      });
+    },
+    // 鍚屾鐢ㄦ埛绉戝/鐥呭尯锛堟柊澧炲拰鍒犻櫎宸紓锛�
+    syncUserDept(codes, deptType) {
+      const original = deptType === 1
+        ? this.originalDeptCodes.map(arr => arr[arr.length - 1])
+        : this.originalWardCodes.map(arr => arr[arr.length - 1]);
+
+      // 鏂板
+      codes.forEach(code => {
+        if (!original.includes(code)) {
+          adduserdept({ deptCode: code, deptType, userId: this.user.userId });
+        }
+      });
+      // 鍒犻櫎
+      original.forEach(code => {
+        if (!codes.includes(code)) {
+          removeusertd(this.user.userId, code);
+        }
+      });
+    },
+    // 绾ц仈閫夋嫨鍣� remove-tag 浜嬩欢
+    onDeptRemoveTag(removedValues) {
+      const currentCodes = (removedValues || []).map(arr => arr[arr.length - 1]);
+      const prevCodes = (this.originalDeptCodes || []).map(arr => arr[arr.length - 1]);
+      prevCodes.forEach(code => {
+        if (!currentCodes.includes(code)) {
+          removeusertd(this.user.userId, code);
+        }
+      });
+    },
+    onWardRemoveTag(removedValues) {
+      const currentCodes = (removedValues || []).map(arr => arr[arr.length - 1]);
+      const prevCodes = (this.originalWardCodes || []).map(arr => arr[arr.length - 1]);
+      prevCodes.forEach(code => {
+        if (!currentCodes.includes(code)) {
+          removeusertd(this.user.userId, code);
+        }
       });
     },
   },
@@ -213,6 +375,10 @@
   flex: 1;
   text-align: right;
 }
+/* 绾ц仈閫夋嫨鍣ㄥ唴閮ㄦ牱寮� */
+.pull-right .el-cascader {
+  width: 100%;
+}
 </style>
 
 <style>
diff --git a/vue.config.js b/vue.config.js
index fe4bda0..7f985b0 100644
--- a/vue.config.js
+++ b/vue.config.js
@@ -37,10 +37,10 @@
       [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:8094`,//鐪佺珛鍚屽痉
         // target: `http://192.168.100.10:8095`,//鏂板崕
         // target: `http://192.168.100.10:8098`,//甯備竴
-        target:`http://localhost:8095`,
+        // target:`http://localhost:8095`,
         // target:`http://35z1t16164.qicp.vip`,
         // target: `http://192.168.100.172:8095`,
         // target: `http://192.168.100.10:8089`,//鍗楀崕
diff --git "a/\351\232\217\350\256\2777.6.zip" "b/\351\232\217\350\256\2777.6.zip"
deleted file mode 100644
index 97686ff..0000000
--- "a/\351\232\217\350\256\2777.6.zip"
+++ /dev/null
Binary files differ
diff --git "a/\351\232\217\350\256\2777.7.zip" "b/\351\232\217\350\256\2777.7.zip"
deleted file mode 100644
index ff30da1..0000000
--- "a/\351\232\217\350\256\2777.7.zip"
+++ /dev/null
Binary files differ
diff --git a/dist.zip "b/\351\232\217\350\256\277\351\200\232\347\224\250 \0502\051.zip"
similarity index 73%
copy from dist.zip
copy to "\351\232\217\350\256\277\351\200\232\347\224\250 \0502\051.zip"
index 07b3666..1614893 100644
--- a/dist.zip
+++ "b/\351\232\217\350\256\277\351\200\232\347\224\250 \0502\051.zip"
Binary files differ
diff --git a/dist.zip "b/\351\232\217\350\256\277\351\200\232\347\224\250.zip"
similarity index 73%
copy from dist.zip
copy to "\351\232\217\350\256\277\351\200\232\347\224\250.zip"
index 07b3666..e119a81 100644
--- a/dist.zip
+++ "b/\351\232\217\350\256\277\351\200\232\347\224\250.zip"
Binary files differ
diff --git a/dist.zip "b/\351\232\217\350\256\277\351\200\232\347\224\2508.10.zip"
similarity index 73%
copy from dist.zip
copy to "\351\232\217\350\256\277\351\200\232\347\224\2508.10.zip"
index 07b3666..719643c 100644
--- a/dist.zip
+++ "b/\351\232\217\350\256\277\351\200\232\347\224\2508.10.zip"
Binary files differ
diff --git a/dist.zip "b/\351\232\217\350\256\277\351\200\232\347\224\2508.11.zip"
similarity index 74%
rename from dist.zip
rename to "\351\232\217\350\256\277\351\200\232\347\224\2508.11.zip"
index 07b3666..a119b53 100644
--- a/dist.zip
+++ "b/\351\232\217\350\256\277\351\200\232\347\224\2508.11.zip"
Binary files differ
diff --git a/dist.zip "b/\351\232\217\350\256\277\351\200\232\347\224\2508.7.zip"
similarity index 74%
copy from dist.zip
copy to "\351\232\217\350\256\277\351\200\232\347\224\2508.7.zip"
index 07b3666..b73b3be 100644
--- a/dist.zip
+++ "b/\351\232\217\350\256\277\351\200\232\347\224\2508.7.zip"
Binary files differ

--
Gitblit v1.9.3