From c8e9849cb5f24848df0174c13bfbbff37bb08a5a Mon Sep 17 00:00:00 2001
From: WXL <wl_5969728@163.com>
Date: 星期二, 21 七月 2026 15:45:30 +0800
Subject: [PATCH] 维护

---
 src/views/business/maintain/maintainInfo.vue |  403 ++++++++++++++++++++++++++++++++++-----------------------
 1 files changed, 240 insertions(+), 163 deletions(-)

diff --git a/src/views/business/maintain/maintainInfo.vue b/src/views/business/maintain/maintainInfo.vue
index 4e03dca..212bdc6 100644
--- a/src/views/business/maintain/maintainInfo.vue
+++ b/src/views/business/maintain/maintainInfo.vue
@@ -1,147 +1,6 @@
 <template>
   <div class="maintenance-detail">
     <case-basic-info :case-id="caseId" :show-attachment="true" />
-    <!-- 鍩虹淇℃伅 -->
-    <!-- <el-card class="detail-card">
-      <div slot="header" class="clearfix">
-        <span class="detail-title">渚涜�呭熀鏈俊鎭�</span>
-        <el-button type="success" style="float: right;" @click="handleSave">
-          淇濆瓨淇℃伅
-        </el-button>
-      </div>
-
-      <el-form :model="form" ref="form" label-width="120px">
-        <el-row :gutter="20">
-          <el-col :span="8">
-            <el-form-item label="浣忛櫌鍙�" prop="caseNo">
-              <el-input v-model="form.caseNo" />
-            </el-form-item>
-          </el-col>
-          <el-col :span="8">
-            <el-form-item label="鎹愮尞鑰呭鍚�" prop="name">
-              <el-input v-model="form.name" />
-            </el-form-item>
-          </el-col>
-          <el-col :span="8">
-            <el-form-item label="鎬у埆" prop="gender">
-              <el-select v-model="form.sex" style="width: 100%">
-                <el-option label="鐢�" value="0" />
-                <el-option label="濂�" value="1" />
-              </el-select>
-            </el-form-item>
-          </el-col>
-        </el-row>
-
-        <el-row :gutter="20">
-          <el-col :span="8">
-            <el-form-item label="骞撮緞" prop="age">
-              <el-input v-model="form.age" />
-            </el-form-item>
-          </el-col>
-          <el-col :span="8">
-            <el-form-item label="鐤剧梾璇婃柇" prop="diagnosisname">
-              <el-input v-model="form.diagnosisname" />
-            </el-form-item>
-          </el-col>
-          <el-col :span="8">
-            <el-form-item label="棣栬瘖鍖荤枟鏈烘瀯" prop="treatmenthospitalname">
-              <el-input v-model="form.treatmenthospitalname" />
-            </el-form-item>
-          </el-col>
-        </el-row>
-
-        <el-row :gutter="20">
-          <el-col :span="8">
-            <el-form-item label="鎮h�呯姸鎬�" prop="recordstate">
-              <el-select v-model="form.recordstate" style="width: 100%">
-                <el-option
-                  v-for="dict in dict.type.sys_DonationCategory || []"
-                  :key="dict.value"
-                  :label="dict.label"
-                  :value="dict.value"
-                ></el-option>
-              </el-select>
-            </el-form-item>
-          </el-col>
-          <el-col :span="8">
-            <el-form-item
-              label="鏈畬鎴愬師鍥�"
-              prop="incompleteReason"
-              v-if="form.recordstate === '5'"
-            >
-              <el-input
-                v-model="form.incompleteReason"
-                placeholder="璇疯緭鍏ユ湭瀹屾垚鎹愮尞鐨勫師鍥�"
-              />
-            </el-form-item>
-          </el-col>
-        </el-row>
-
-        <el-row :gutter="20">
-          <el-col :span="8">
-            <el-form-item label="涓婃姤鏃堕棿" prop="reporttime">
-              <el-date-picker
-                v-model="form.reporttime"
-                type="datetime"
-                value-format="yyyy-MM-dd HH:mm:ss"
-                style="width: 100%"
-              />
-            </el-form-item>
-          </el-col>
-          <el-col :span="8">
-            <el-form-item label="姝讳骸鏃堕棿" prop="deathTime">
-              <el-date-picker
-                v-model="form.deathTime"
-                type="datetime"
-                value-format="yyyy-MM-dd HH:mm:ss"
-                style="width: 100%"
-              />
-            </el-form-item>
-          </el-col>
-          <el-col :span="8">
-            <el-form-item label="鍗忚皟鍛�" prop="coordinatorName">
-              <el-input v-model="form.coordinatorName" />
-            </el-form-item>
-          </el-col>
-        </el-row>
-
-        <el-row :gutter="20">
-          <el-col :span="8">
-            <el-form-item label="琛�鍨�" prop="bloodtype">
-              <el-select v-model="form.bloodtype" style="width: 100%">
-                <el-option
-                  v-for="dict in dict.type.sys_BloodType"
-                  :key="dict.value"
-                  :label="dict.label"
-                  :value="dict.value"
-                ></el-option>
-              </el-select>
-            </el-form-item>
-          </el-col>
-          <el-col :span="8">
-            <el-form-item label="Rh(D)" prop="rhYin">
-              <el-radio-group v-model="form.rhYin">
-                <el-radio
-                  v-for="dict in dict.type.sys_bloodtype_rhd || []"
-                  :key="dict.value"
-                  :label="dict.value"
-                  >{{ dict.label }}</el-radio
-                >
-              </el-radio-group>
-            </el-form-item>
-          </el-col>
-        </el-row>
-
-        <el-form-item label="鐗规畩鐥呭彶" prop="specialMedicalHistory">
-          <el-input
-            type="textarea"
-            :rows="3"
-            v-model="form.specialMedicalHistory"
-            placeholder="璁板綍鐗规畩鐥呭彶淇℃伅"
-          />
-        </el-form-item>
-      </el-form>
-    </el-card> -->
 
     <el-card class="assessment-card">
       <div slot="header" class="clearfix">
@@ -150,9 +9,17 @@
           type="primary"
           size="mini"
           @click="toggleEditMode"
-          style="float: right;"
+          style="float: right;margin-left: 20px;"
         >
-          {{ isEdit ? "瀹屾垚缂栬緫" : "寮�濮嬬紪杈�" }}
+          淇濆瓨缂栬緫
+        </el-button>
+        <el-button
+          type="success"
+          size="mini"
+          @click="accomplish"
+          style="float: right;margin-left: 20px;"
+        >
+          瀹屾垚缂栬緫
         </el-button>
       </div>
 
@@ -185,10 +52,54 @@
               />
               <el-table-column label="鍩瑰吇缁撴灉" align="center" prop="result">
                 <template slot-scope="scope">
-                  <el-tag
-                    :type="scope.row.result === '闃存��' ? 'success' : 'danger'"
-                    effect="plain"
+                  <!-- 闃虫�х粨鏋滃甫鎮诞鎻愮ず -->
+                  <el-tooltip
+                    v-if="
+                      scope.row.result === '闃虫��' && scope.row.positiveDetails
+                    "
+                    effect="light"
+                    placement="top"
+                    :open-delay="200"
+                    popper-class="custom-positive-tooltip"
                   >
+                    <div slot="content">
+                      <div
+                        style="font-weight: bold; color: #f56c6c; margin-bottom: 8px;"
+                      >
+                        <i class="el-icon-warning"></i> 闃虫�х粨鏋滆鎯�
+                      </div>
+                      <div
+                        style="color: #606266; line-height: 1.6; white-space: pre-wrap;"
+                      >
+                        {{ scope.row.positiveDetails }}
+                      </div>
+                    </div>
+                    <el-tag
+                      type="danger"
+                      effect="plain"
+                      @click="handleResultClick(scope.row)"
+                      style="cursor: pointer;"
+                    >
+                      {{ scope.row.result }}
+                      <i class="el-icon-info" style="margin-left: 4px;"></i>
+                    </el-tag>
+                  </el-tooltip>
+
+                  <!-- 闃虫�т絾娌℃湁璇︽儏鐨� -->
+                  <el-tag
+                    v-else-if="
+                      scope.row.result === '闃虫��' && !scope.row.positiveDetails
+                    "
+                    type="danger"
+                    effect="plain"
+                    @click="handleResultClick(scope.row)"
+                    style="cursor: pointer;"
+                  >
+                    {{ scope.row.result }}
+                  </el-tag>
+
+                  <!-- 闃存�х粨鏋� -->
+                  <el-tag v-else type="success" effect="plain">
                     {{ scope.row.result }}
                   </el-tag>
                 </template>
@@ -341,6 +252,30 @@
             @data-change="handleUrineRoutineDataChange"
           />
         </el-tab-pane>
+        <el-tab-pane label="蹇冭剰鍖栭獙" name="heartLab">
+          <heart-lab-panel
+            ref="heartLab"
+            :initial-data="assessmentData.heartLab"
+            :is-editing="isEdit && activeTab === 'heartLab'"
+            @data-change="handleHeartLabDataChange"
+          />
+        </el-tab-pane>
+        <el-tab-pane label="鑲鸿剰鍖栭獙" name="lungLab">
+          <lung-lab-panel
+            ref="lungLab"
+            :initial-data="assessmentData.lungLab"
+            :is-editing="isEdit && activeTab === 'lungLab'"
+            @data-change="handleLungLabDataChange"
+          />
+        </el-tab-pane>
+        <el-tab-pane label="鑳拌吅鍖栭獙" name="pancreasLab">
+          <pancreas-lab-panel
+            ref="pancreasLab"
+            :initial-data="assessmentData.pancreasLab"
+            :is-editing="isEdit && activeTab === 'pancreasLab'"
+            @data-change="handlePancreasLabDataChange"
+          />
+        </el-tab-pane>
       </el-tabs>
     </el-card>
 
@@ -396,6 +331,7 @@
                 v-model="cultureForm.result"
                 placeholder="璇烽�夋嫨鍩瑰吇缁撴灉"
                 style="width: 100%"
+                @change="handleResultChange"
               >
                 <el-option label="闃存��" value="闃存��" />
                 <el-option label="闃虫��" value="闃虫��" />
@@ -403,7 +339,19 @@
             </el-form-item>
           </el-col>
         </el-row>
-
+        <el-form-item
+          v-if="cultureForm.result === '闃虫��'"
+          label="闃虫�ц鎯�"
+          prop="positiveDetails"
+        >
+          <el-input
+            type="textarea"
+            :rows="2"
+            v-model="cultureForm.positiveDetails"
+            placeholder="璇疯緭鍏ラ槼鎬х粨鏋滅殑璇︾粏淇℃伅"
+            clearable
+          />
+        </el-form-item>
         <el-form-item label="闄勪欢">
           <UploadAttachment
             ref="cultureUploadAttachment"
@@ -574,6 +522,9 @@
 import LiverKidneyPanel from "@/components/MaintainComponents/LiverKidneyPanel.vue";
 import BloodRoutinePanel from "@/components/MaintainComponents/BloodRoutinePanel.vue";
 import UrineRoutinePanel from "@/components/MaintainComponents/UrineRoutinePanel.vue";
+import HeartLabPanel from "@/components/MaintainComponents/HeartLabPanel.vue";
+import LungLabPanel from "@/components/MaintainComponents/LungLabPanel.vue";
+import PancreasLabPanel from "@/components/MaintainComponents/PancreasLabPanel.vue";
 import CaseBasicInfo from "@/components/CaseBasicInfo";
 import store from "@/store";
 import dayjs from "dayjs";
@@ -587,7 +538,10 @@
     LiverKidneyPanel,
     BloodRoutinePanel,
     UrineRoutinePanel,
-    CaseBasicInfo
+    CaseBasicInfo,
+    HeartLabPanel,
+    LungLabPanel,
+    PancreasLabPanel
   },
   dicts: [
     "sys_donornode",
@@ -635,6 +589,7 @@
         cultureType: "",
         sampleTime: "",
         result: "闃存��",
+        positiveDetails: "", // 鏂板锛氶槼鎬ц鎯�
         attachments: []
       },
       cultureFileList: [],
@@ -647,7 +602,8 @@
         ],
         result: [
           { required: true, message: "璇烽�夋嫨鍩瑰吇缁撴灉", trigger: "change" }
-        ]
+        ],
+        positiveDetails: [] // 鍔ㄦ�侀獙璇佽鍒�
       },
       cultureTypeOptions: [
         { value: "1", label: "琛�鍩瑰吇" },
@@ -655,6 +611,7 @@
         { value: "3", label: "灏垮煿鍏�" },
         { value: "4", label: "浼ゅ彛鍒嗘硨鐗�" },
         { value: "5", label: "鑴戣剨娑插煿鍏�" },
+        { value: "5", label: "鐨偆" },
         { value: "6", label: "鍏朵粬" }
       ],
 
@@ -703,6 +660,9 @@
         liverKidney: {},
         bloodRoutine: {},
         urineRoutine: {},
+        heartLab: {}, // 鏂板
+        lungLab: {}, // 鏂板
+        pancreasLab: {}, // 鏂板
         cultureResults: [],
         nursingRecords: []
       }
@@ -776,6 +736,15 @@
               if (itemDescData.urineRoutine) {
                 this.assessmentData.urineRoutine = itemDescData.urineRoutine;
               }
+              if (itemDescData.heartLab) {
+                this.assessmentData.heartLab = itemDescData.heartLab;
+              }
+              if (itemDescData.lungLab) {
+                this.assessmentData.lungLab = itemDescData.lungLab;
+              }
+              if (itemDescData.pancreasLab) {
+                this.assessmentData.pancreasLab = itemDescData.pancreasLab;
+              }
             } catch (error) {
               console.error("瑙f瀽itemDesc JSON澶辫触:", error);
             }
@@ -794,7 +763,46 @@
         this.recordLoading = false;
       }
     },
+    // 澶勭悊鍩瑰吇缁撴灉閫夋嫨鍙樺寲
+    handleResultChange(value) {
+      this.$nextTick(() => {
+        if (value === "闃虫��") {
+          this.cultureRules.positiveDetails = [
+            { required: true, message: "璇疯緭鍏ラ槼鎬ц鎯�", trigger: "blur" }
+          ];
+        } else {
+          this.cultureRules.positiveDetails = [];
+          this.cultureForm.positiveDetails = "";
+        }
+        // 娓呴櫎楠岃瘉
+        if (this.$refs.cultureForm) {
+          this.$refs.cultureForm.clearValidate("positiveDetails");
+        }
+      });
+    },
 
+    // 澶勭悊鐐瑰嚮鍩瑰吇缁撴灉鏍囩
+    handleResultClick(row) {
+      if (row.result === "闃虫��" && row.positiveDetails) {
+        this.$alert(
+          `<div style="padding: 10px;">
+        <h4 style="margin-bottom: 10px; color: #f56c6c;">闃虫�ц鎯咃細</h4>
+        <div style="background: #fef0f0; padding: 15px; border-radius: 4px; border-left: 4px solid #f56c6c;">
+          <p style="margin: 0; white-space: pre-wrap; line-height: 1.5;">${row.positiveDetails}</p>
+        </div>
+      </div>`,
+          "闃虫�х粨鏋滆鎯�",
+          {
+            dangerouslyUseHTMLString: true,
+            confirmButtonText: "鍏抽棴",
+            customClass: "result-details-dialog",
+            showClose: false
+          }
+        );
+      } else if (row.result === "闃虫��") {
+        this.$message.warning("璇ラ槼鎬ц褰曟殏鏃犺鎯呬俊鎭�");
+      }
+    },
     // 淇濆瓨鎵�鏈夋暟鎹�
     async handleSave() {
       try {
@@ -804,13 +812,19 @@
             liverKidney: this.assessmentData.liverKidney,
             bloodRoutine: this.assessmentData.bloodRoutine,
             urineRoutine: this.assessmentData.urineRoutine,
+            heartLab: this.assessmentData.heartLab, // 鏂板
+            lungLab: this.assessmentData.lungLab, // 鏂板
+            pancreasLab: this.assessmentData.pancreasLab, // 鏂板
             cultureResults: this.cultureList,
             nursingRecords: this.recordList
           }
         };
+        if (saveData.state == 1 || !saveData.state) {
+          saveData.state = 2;
+        }
         this.extracontentinfo.specialMedicalHistory = this.form.specialMedicalHistory;
         let response;
-        if (this.isEditMode && this.currentMaintenanceId) {
+        if (this.currentMaintenanceId) {
           saveData.id = this.currentMaintenanceId;
           response = await maintainedit(saveData);
         } else {
@@ -819,7 +833,7 @@
 
         if (response.code === 200) {
           this.$message.success("淇濆瓨鎴愬姛");
-          this.isEdit = false;
+          // this.isEdit = false;
           if (!this.currentMaintenanceId) {
             this.currentMaintenanceId = response.data;
           }
@@ -839,15 +853,36 @@
         this.$message.error("淇濆瓨澶辫触");
       }
     },
-
+    // 5. 鍦� methods 涓坊鍔犳暟鎹鐞嗘柟娉�
+    handleHeartLabDataChange(data) {
+      this.assessmentData.heartLab = data;
+    },
+    handleLungLabDataChange(data) {
+      this.assessmentData.lungLab = data;
+    },
+    handlePancreasLabDataChange(data) {
+      this.assessmentData.pancreasLab = data;
+    },
     // 鍒囨崲缂栬緫妯″紡
     toggleEditMode() {
-      this.isEdit = !this.isEdit;
-      if (!this.isEdit) {
-        this.handleSave();
-      }
+      // this.isEdit = !this.isEdit;
+      // if (!this.isEdit) {
+      // }
+      this.handleSave();
     },
+    accomplish() {
+      this.$confirm("鏄惁瀹屾垚璇ユ渚嬫崘鐚‘璁ゆ楠わ紵", "鎻愰啋", {
+        confirmButtonText: "纭畾",
+        cancelButtonText: "鍙栨秷",
+        type: "warning"
+      })
+        .then(() => {
+          this.form.state = 3;
+          this.handleSave();
+        })
 
+        .catch(() => {});
+    },
     // 鍩瑰吇璁板綍鐩稿叧鏂规硶
     handleAddCulture() {
       this.cultureDialogTitle = "鏂板鍩瑰吇璁板綍";
@@ -865,9 +900,13 @@
       });
     },
 
+    // 5. 淇敼缂栬緫鍩瑰吇璁板綍鏂规硶
     handleEditCulture(row) {
       this.cultureDialogTitle = "缂栬緫鍩瑰吇璁板綍";
-      this.cultureForm = { ...row };
+      this.cultureForm = {
+        ...row,
+        positiveDetails: row.positiveDetails || "" // 纭繚鏈塸ositiveDetails瀛楁
+      };
       this.cultureFileList = row.attachments
         ? row.attachments.map(item => ({
             uid: item.id || Math.random(),
@@ -881,27 +920,44 @@
       this.cultureDialogVisible = true;
       this.$nextTick(() => {
         this.$refs.cultureForm && this.$refs.cultureForm.clearValidate();
+        // 濡傛灉缂栬緫鏃舵槸闃虫�х粨鏋滐紝璁剧疆楠岃瘉瑙勫垯
+        if (row.result === "闃虫��") {
+          this.cultureRules.positiveDetails = [
+            { required: true, message: "璇疯緭鍏ラ槼鎬ц鎯�", trigger: "blur" }
+          ];
+        }
       });
     },
 
+    // 6. 淇敼淇濆瓨鍩瑰吇璁板綍鏂规硶
     handleSaveCulture() {
       this.$refs.cultureForm.validate(valid => {
         if (valid) {
           this.cultureSaveLoading = true;
 
-          if (this.cultureForm.id) {
+          // 鏋勫缓淇濆瓨鏁版嵁
+          const saveData = {
+            ...this.cultureForm,
+            // 濡傛灉鏄槾鎬э紝娓呯┖闃虫�ц鎯�
+            positiveDetails:
+              this.cultureForm.result === "闃虫��"
+                ? this.cultureForm.positiveDetails || ""
+                : ""
+          };
+
+          if (saveData.id) {
             const index = this.cultureList.findIndex(
-              item => item.id === this.cultureForm.id
+              item => item.id === saveData.id
             );
             if (index !== -1) {
-              this.cultureList.splice(index, 1, { ...this.cultureForm });
+              this.cultureList.splice(index, 1, { ...saveData });
             }
           } else {
-            this.cultureForm.id = Date.now();
-            this.cultureList.push({ ...this.cultureForm });
+            saveData.id = Date.now();
+            this.cultureList.push({ ...saveData });
           }
 
-          this.$message.success(this.cultureForm.id ? "淇敼鎴愬姛" : "鏂板鎴愬姛");
+          this.$message.success(saveData.id ? "淇敼鎴愬姛" : "鏂板鎴愬姛");
           this.cultureDialogVisible = false;
           this.cultureSaveLoading = false;
         }
@@ -1289,4 +1345,25 @@
   font-size: 13px;
   margin-left: 8px;
 }
+/* 7. 娣诲姞涓�浜涙牱寮� */
+.result-details-dialog {
+  width: 500px;
+}
+
+.result-details-dialog .el-message-box__content {
+  padding: 0;
+}
+
+.result-details-dialog .el-message-box__header {
+  background: #fef0f0;
+  border-bottom: 1px solid #fde2e2;
+}
+
+.result-details-dialog .el-message-box__title {
+  color: #f56c6c;
+  font-weight: bold;
+}
+.custom-positive-tooltip {
+  max-width: 400px;
+}
 </style>

--
Gitblit v1.9.3