From 574b449a39019a59dc90ecc19dda9f63d3aa9636 Mon Sep 17 00:00:00 2001
From: WXL (wul) <wl_5969728@163.com>
Date: 星期三, 18 十一月 2026 15:35:47 +0800
Subject: [PATCH] 测试完成

---
 src/views/followvisit/record/detailpage/index.vue |  235 +++++++++++++++++++++++++++++++++++++++++++++++++++++-----
 1 files changed, 214 insertions(+), 21 deletions(-)

diff --git a/src/views/followvisit/record/detailpage/index.vue b/src/views/followvisit/record/detailpage/index.vue
index 61ae393..0340bf4 100644
--- a/src/views/followvisit/record/detailpage/index.vue
+++ b/src/views/followvisit/record/detailpage/index.vue
@@ -127,10 +127,9 @@
               </el-tooltip>
             </template>
           </el-table-column>
-                <el-table-column
+          <el-table-column
             v-if="
-              orgname == '鏅畞鐣叉棌鑷不鍘夸汉姘戝尰闄�' ||
-              orgname == '涓芥按甯備腑鍖婚櫌'
+              orgname == '鏅畞鐣叉棌鑷不鍘夸汉姘戝尰闄�' || orgname == '涓芥按甯備腑鍖婚櫌'
             "
             label="鎷ㄥ彿鐘舵��"
             width="120"
@@ -305,8 +304,6 @@
             show-overflow-tooltip
           >
           </el-table-column>
-
-
 
           <el-table-column
             prop="bankcardno"
@@ -761,7 +758,13 @@
           <!-- 椤堕儴鎿嶄綔鍖哄煙 -->
           <div class="section-header">
             <h3><i class="el-icon-s-operation"></i> 浜哄伐澶勭悊</h3>
+
             <div class="header-actions">
+              <div v-if="form.doctorOpinion2" class="last-opinion">
+                <i class="el-icon-sunny"></i>
+                <span class="last-opinion-label">涓婃鐨勫鐞嗘剰瑙侊細</span>
+                <span class="last-opinion-text">{{ form.doctorOpinion2 }}</span>
+              </div>
               <!-- 鍩虹鎿嶄綔鎸夐挳缁� -->
               <div class="action-group basic-actions">
                 <el-button type="primary" plain @click="alterpatient('')">
@@ -841,6 +844,8 @@
               </div>
             </div>
           </div>
+
+
 
           <!-- 琛ㄥ崟鍖哄煙 -->
           <div class="form-content">
@@ -1060,6 +1065,14 @@
                   </el-button>
                   <el-button plain type="info" @click="Editsingletaskson('5')">
                     浜哄伐闅忚
+                  </el-button>
+                  <el-button
+                    plain
+                    v-if="orgname != '缂欎簯绗簩浜烘皯鍖婚櫌'"
+                    type="primary"
+                    @click="Editsingletaskson('7')"
+                  >
+                    鍥為櫌澶嶆煡澶嶈瘖
                   </el-button>
                   <el-button
                     type="primary"
@@ -1321,6 +1334,15 @@
                 v-model="form.remark2"
               ></el-input>
             </el-form-item>
+            <el-form-item label="澶勭悊鎰忚">
+              <el-input
+                class="custom-disabled"
+                type="textarea"
+                disabled
+                v-model="form.doctorOpinion2"
+                placeholder="鏃�"
+              ></el-input>
+            </el-form-item>
           </el-collapse-item>
 
           <!-- 涓嬫闅忚淇℃伅 - 榛樿灞曞紑 -->
@@ -1371,7 +1393,10 @@
               </el-col>
             </el-row>
             <el-form-item label="闅忚绫诲瀷" prop="resource">
-              <el-radio-group v-model="form.resource">
+              <el-radio-group
+                v-model="form.resource"
+                @change="handleResourceChange"
+              >
                 <el-radio label="1">鏈梾鍖洪殢璁�</el-radio>
                 <el-radio label="2">闅忚涓績闅忚</el-radio>
               </el-radio-group>
@@ -1379,11 +1404,12 @@
             <el-form-item label="闅忚璁板綍" :required="form.resource == '2'">
               <el-input type="textarea" v-model="form.remark"></el-input>
             </el-form-item>
-            <el-form-item label="鍖荤敓澶勭悊鎰忚" prop="doctorOpinion">
-              <el-input
-                type="textarea"
-                v-model="form.doctorOpinion"
-              ></el-input>
+            <el-form-item
+              label="鍖荤敓澶勭悊鎰忚"
+              prop="doctorOpinion"
+              :required="isDoctorOpinionRequired"
+            >
+              <el-input type="textarea" v-model="form.doctorOpinion"></el-input>
             </el-form-item>
           </el-collapse-item>
         </el-collapse>
@@ -1439,6 +1465,7 @@
 import {
   messagelistpatient,
   alterpatient,
+  particularpatient,
   listcontactinformation,
 } from "@/api/patient/homepage";
 import CallButton from "@/components/CallButton";
@@ -1688,8 +1715,19 @@
             trigger: "change",
           },
         ],
+        // 鍖荤敓澶勭悊鎰忚锛氫粎銆岄殢璁夸腑蹇冮殢璁裤��+銆屼附姘村競涓尰闄€�嶆椂蹇呭~锛屽叾浣欐儏鍐典笉鏍¢獙
         doctorOpinion: [
-          { required: true, message: "璇疯緭鍏ュ尰鐢熷鐞嗘剰瑙�", trigger: "blur" },
+          {
+            validator: (rule, value, callback) => {
+              const needRequired =
+                this.form.resource == "2" && this.orgname === "涓芥按甯備腑鍖婚櫌";
+              if (needRequired && !String(value || "").trim()) {
+                return callback(new Error("璇疯緭鍏ュ尰鐢熷鐞嗘剰瑙�"));
+              }
+              callback();
+            },
+            trigger: "blur",
+          },
         ],
       },
       userrules: {
@@ -1809,7 +1847,8 @@
     unansweredQuestions() {
       return (this.tableDatatop || [])
         .map((item, i) => ({ index: i + 1, title: item.scriptContent || "鏈懡鍚嶉鐩�", raw: item }))
-        .filter((q) => !this.hasOptionValue(q.raw));
+        // astrict=1 琛ㄧず璇ラ鍥犻�夐」璺宠浆琚烦杩囷紙宸查殣钘忥級锛岃烦杩囬涓嶇畻鈥滄湭浣滅瓟鈥�
+        .filter((q) => !q.raw.astrict && !this.hasOptionValue(q.raw));
     },
     callStatusText() {
       if (this.customCallStatus) {
@@ -1833,6 +1872,10 @@
         failed: "error",
       };
       return typeMap[this.callStatus];
+    },
+    // 鍖荤敓澶勭悊鎰忚鏄惁蹇呭~锛氶殢璁跨被鍨嬮�夈�岄殢璁夸腑蹇冮殢璁裤�嶄笖褰撳墠鏈烘瀯涓轰附姘村競涓尰闄�
+    isDoctorOpinionRequired() {
+      return this.form.resource == "2" && this.orgname === "涓芥按甯備腑鍖婚櫌";
     },
     // 鏄惁浠ラ棶鍗峰舰寮忓睍绀猴紙闈炶闊虫湇鍔★紝鎴栬闊虫湇鍔′絾鏃犲畬鏁磋闊虫暟鎹渶鎵嬪姩濉姤锛�
     showQuestionnaireForm() {
@@ -1859,13 +1902,7 @@
     this.orgname = localStorage.getItem("orgname");
     console.log(localStorage.getItem("orgname"));
 
-    if (
-      this.orgname == "鐪佺珛鍚屽痉缈犺嫅闄㈠尯" ||
-      this.orgname == "鐪佺珛鍚屽痉涔嬫睙闄㈠尯" ||
-      this.orgname == "鐪佺珛鍚屽痉闂叉灄闄㈠尯" ||
-      this.orgname == "鐪佺珛鍚屽痉闈掑北婀栭櫌鍖�" ||
-      this.orgname == "鐪佺珛鍚屽痉澶╃洰灞辫矾闄㈠尯"
-    ) {
+    if (this.isTongdeCampus) {
       this.showContinuationCareBtn = true;
     }
 
@@ -2008,6 +2045,35 @@
         const newPos = start + text.length;
         target.setSelectionRange(newPos, newPos);
       });
+
+      // 蹇嵎璇寘鍚�滄浜♀�濇椂锛岃繃婊ゆ帓闄よ鎮h��
+      if (text && text.includes("姝讳骸")) {
+        this.filterDeathPatient(text);
+      }
+    },
+    // 蹇嵎璇寘鍚�滄浜♀�濇椂杩囨护鎺掗櫎鎮h�咃紙鍙傝�� discharge 椤垫偅鑰呰繃婊わ級
+    filterDeathPatient(text) {
+      this.$modal
+        .confirm(
+          "璇ュ揩鎹疯鍖呭惈鈥滄浜♀�濓紝纭灏嗚鎮h�呰繃婊ゆ帓闄ゅ悧锛熻繃婊ゅ悗璇ユ偅鑰呮墍鏈夎繘琛屼腑浠诲姟灏嗗叏閮ㄥ仠姝紝涓旀棤娉曞尮閰嶆柊鐨勯殢璁夸换鍔★紝璇疯皑鎱庢搷浣滐紒"
+        )
+        .then(() => {
+          particularpatient(this.patid).then((response) => {
+            const patient = response.data;
+            patient.isoperation = 2;
+            patient.notrequiredFlag = 1;
+            patient.notrequiredreason = text;
+            patient.filterDrname = store.getters.nickName;
+            alterpatient(patient).then((res) => {
+              if (res.code == 200) {
+                this.$modal.msgSuccess("鎮h�呰繃婊ゆ垚鍔�");
+              } else {
+                this.$modal.msgError("鎮h�呰繃婊ゅけ璐�");
+              }
+            });
+          });
+        })
+        .catch(() => {});
     },
     // 鑾峰彇闂嵎鏁版嵁
     getsearchrResults(id) {
@@ -2047,6 +2113,8 @@
           });
           this.taskname = res.data.taskName;
           this.overdata();
+          // 鏍规嵁宸蹭繚瀛樼瓟妗堝洖鏀鹃�夐」璺宠浆閫昏緫锛屾仮澶嶈璺宠繃棰樼洰鐨勯殣钘忕姸鎬�
+          this.restoreJumpState();
         }
       });
     },
@@ -2388,6 +2456,26 @@
         if (this.visitCount != 1) {
           this.$router.push({
             path: "/logisticsservice/again",
+          });
+        } else {
+          this.$router.push({
+            path: "/followvisit/discharge",
+          });
+        }
+      } else if (this.form.serviceType == 3) {
+        if (this.visitCount != 1) {
+          this.$router.push({
+            path: "/logisticsservice/OutpatientAgain",
+          });
+        } else {
+          this.$router.push({
+            path: "/followvisit/discharge",
+          });
+        }
+      } else if (this.form.serviceType == 19) {
+        if (this.visitCount != 1) {
+          this.$router.push({
+            path: "/logisticsservice/operationAgain",
           });
         } else {
           this.$router.push({
@@ -2762,7 +2850,8 @@
           console.log(this.form.templatename, "templatename");
 
           this.form.remark = this.form.remark || "";
-          this.form.doctorOpinion = this.form.doctorOpinion || "";
+          this.form.doctorOpinion2 = this.form.doctorOpinion || "";
+          this.form.doctorOpinion = "";
           this.logsheetlist = res.rows[0].serviceSubtaskList;
           this.templateid = this.form.templateid;
           this.selectedTag = this.form.excep;
@@ -3196,6 +3285,71 @@
         }
       });
     },
+    // 鏍规嵁宸蹭繚瀛樼瓟妗堝洖鏀锯�滈�夐」璺宠浆鈥濋�昏緫锛屾仮澶嶈璺宠繃棰樼洰鐨勯殣钘忕姸鎬侊紙astrict锛�
+    restoreJumpState() {
+      const list = this.tableDatatop;
+      if (!list || !list.length) return;
+
+      // 鍏堝叏閮ㄧ疆涓哄彲瑙�
+      list.forEach((item) => {
+        this.$set(item, "astrict", 0);
+        this.$set(item, "hiddenByEnd", false);
+      });
+
+      for (let i = 0; i < list.length; ) {
+        const q = list[i];
+        let jumped = false;
+
+        // 鍙湁鈥滃崟閫� + 鐢遍�夐」閰嶇疆璺宠浆鈥濅笖宸蹭綔绛旂殑棰樼洰鎵嶅彲鑳戒骇鐢熻烦杞�
+        if (q.branchFlag == 1 && q.scriptType == 1 && this.hasOptionValue(q)) {
+          const opt = (q.svyTaskTemplateTargetoptions || []).find(
+            (o) => o.optioncontent == q.scriptResult
+          );
+          const next = opt ? opt.nextQuestion : null;
+
+          if (next !== null && next !== undefined && next !== "") {
+            const targetNum = Number(next);
+
+            // 缁撴潫闂瓟锛氶殣钘忓悗闈㈡墍鏈夐
+            if (targetNum === 0) {
+              for (let j = i + 1; j < list.length; j++) {
+                this.$set(list[j], "astrict", 1);
+                this.$set(list[j], "hiddenByEnd", true);
+              }
+              break;
+            }
+
+            const target = targetNum - 1; // 杞� 0-indexed
+            if (target > i && target < list.length) {
+              // 闅愯棌褰撳墠棰樺拰鐩爣棰樹箣闂寸殑棰�
+              for (let j = i + 1; j < target; j++) {
+                this.$set(list[j], "astrict", 1);
+                this.$set(list[j], "hiddenByEnd", false);
+              }
+              // 鐩爣棰樹繚鎸佸彲瑙�
+              this.$set(list[target], "astrict", 0);
+              this.$set(list[target], "hiddenByEnd", false);
+              i = target;
+              jumped = true;
+            }
+          }
+        }
+
+        if (!jumped) {
+          i++;
+        }
+      }
+
+      this.$forceUpdate();
+    },
+    // 鍒囨崲闅忚绫诲瀷鍚庯紝閲嶇疆鍖荤敓澶勭悊鎰忚鐨勬牎楠岀姸鎬侊紙蹇呭~鏉′欢闅忕被鍨嬪彉鍖栵級
+    handleResourceChange() {
+      this.$nextTick(() => {
+        if (this.$refs.zcform) {
+          this.$refs.zcform.clearValidate("doctorOpinion");
+        }
+      });
+    },
     // 鍒涘缓鍐嶆闅忚鏈嶅姟
     setupsubtask() {
       this.$refs["zcform"].validate((valid) => {
@@ -3211,6 +3365,10 @@
           this.form.remark =
             this.form.remark + "銆�" + this.getCurrentTime() + "銆�";
           let form = structuredClone(this.form);
+          // 鍐嶆闅忚鍗斥�滃洖闄㈠鏌ュ璇娾�濓細澶勭悊鎰忚缃负 suggest=7
+          if (String(form.suggest) !== "7") {
+            form.suggest = "7";
+          }
           form.visitTime = this.parseTime(form.date1);
           form.finishtime = "";
           if (form.resource) {
@@ -4248,6 +4406,41 @@
   }
 }
 
+/* 涓婃鐨勫鐞嗘剰瑙� */
+.last-opinion {
+  display: flex;
+  gap: 8px;
+  margin-bottom: 20px;
+  padding: 8px 14px;
+  background: linear-gradient(135deg, #ecfdf5 0%, #f0fdfa 100%);
+  border: 1px solid #d1fae5;
+  border-left: 4px solid #10b981;
+  border-radius: 8px;
+  box-shadow: 0 1px 3px rgba(16, 185, 129, 0.08);
+  line-height: 1.5;
+
+  > i {
+    font-size: 18px;
+    color: #10b981;
+    flex-shrink: 0;
+  }
+
+  .last-opinion-label {
+    font-size: 13px;
+    color: #059669;
+    font-weight: 600;
+    white-space: nowrap;
+    flex-shrink: 0;
+  }
+
+  .last-opinion-text {
+    font-size: 14px;
+    color: #334155;
+    word-break: break-word;
+    white-space: pre-wrap;
+  }
+}
+
 /* 閫氳瘽鎺у埗鍖哄煙 */
 .call-controls {
   margin: 15px 0;

--
Gitblit v1.9.3