From 3b7fcf5ea471f6cb388f86d0732b8ece47a3cefc Mon Sep 17 00:00:00 2001
From: WXL <wl_5969728@163.com>
Date: 星期一, 29 十二月 2025 21:05:58 +0800
Subject: [PATCH] 页面更新

---
 src/views/business/course/components/DonorMaintenanceStage.vue | 1128 +++++++++++++++++++++++++++++++++++++++++++++++++++++------
 1 files changed, 1,013 insertions(+), 115 deletions(-)

diff --git a/src/views/business/course/components/DonorMaintenanceStage.vue b/src/views/business/course/components/DonorMaintenanceStage.vue
index a7e82a9..ebfe7e6 100644
--- a/src/views/business/course/components/DonorMaintenanceStage.vue
+++ b/src/views/business/course/components/DonorMaintenanceStage.vue
@@ -1,156 +1,1054 @@
 <template>
-  <base-stage :stage-data="stageData" :case-info="caseInfo">
-    <template #header>
-      <el-alert
-        title="渚涜�呯淮鎶ら樁娈�"
-        type="success"
-        description="渚涜�呬俊鎭淮鎶ゅ凡瀹屾垚锛屾墍鏈夊熀鏈俊鎭凡纭鏃犺"
-        show-icon
-        :closable="false"
-      />
-    </template>
+  <div class="maintenance-detail">
+    <!-- 鍩虹淇℃伅 -->
 
-    <el-row :gutter="20" style="margin-top: 20px;">
-      <el-col :span="12">
-        <el-card class="info-card">
-          <div slot="header" class="card-header">
-            <span>渚涜�呭熀鏈俊鎭�</span>
-          </div>
-          <el-descriptions :column="1" border size="small">
-            <el-descriptions-item label="浣忛櫌鍙�">
-              {{ caseInfo.hospitalNo }}
-            </el-descriptions-item>
-            <el-descriptions-item label="鎹愮尞鑰呭鍚�">
-              {{ caseInfo.donorName }}
-            </el-descriptions-item>
-            <el-descriptions-item label="鎬у埆">
-              <dict-tag :options="dict.type.sys_user_sex" :value="parseInt(caseInfo.gender)" />
-            </el-descriptions-item>
-            <el-descriptions-item label="骞撮緞">
-              {{ caseInfo.age }} 宀�
-            </el-descriptions-item>
-            <el-descriptions-item label="鐤剧梾璇婃柇">
-              {{ caseInfo.diagnosis }}
-            </el-descriptions-item>
-          </el-descriptions>
-        </el-card>
-      </el-col>
+    <el-card class="assessment-card">
 
-      <el-col :span="12">
-        <el-card class="timeline-card">
-          <div slot="header" class="card-header">
-            <span>缁存姢鏃堕棿绾�</span>
-          </div>
-          <el-timeline>
-            <el-timeline-item
-              v-for="event in maintenanceEvents"
-              :key="event.time"
-              :timestamp="formatTime(event.time)"
-              :type="event.type"
-            >
-              {{ event.content }}
-            </el-timeline-item>
-          </el-timeline>
-        </el-card>
-      </el-col>
-    </el-row>
+      <el-tabs v-model="activeTab" type="card" @tab-click="handleTabClick">
+        <!-- 鍩瑰吇缁撴灉璁板綍 -->
+        <el-tab-pane label="鍩瑰吇缁撴灉" name="culture">
+          <el-card class="culture-card">
+            <div slot="header" class="clearfix">
+              <span class="detail-title">鍩瑰吇缁撴灉璁板綍</span>
+            </div>
 
-    <el-card style="margin-top: 20px;">
-      <div slot="header" class="card-header">
-        <span>缁存姢璁板綍璇︽儏</span>
+            <el-table :data="cultureList" v-loading="cultureLoading">
+              <el-table-column
+                label="鍩瑰吇绫诲瀷"
+                align="center"
+                prop="cultureType"
+              >
+                <!-- <template slot-scope="scope">
+            <dict-tag
+              :options="cultureTypeOptions"
+              :value="scope.row.cultureType"
+            />
+          </template> -->
+              </el-table-column>
+              <el-table-column
+                label="閲囨牱鏃堕棿"
+                align="center"
+                prop="sampleTime"
+              />
+              <el-table-column label="鍩瑰吇缁撴灉" align="center" prop="result">
+                <template slot-scope="scope">
+                  <el-tag
+                    :type="scope.row.result === '闃存��' ? 'success' : 'danger'"
+                    effect="plain"
+                  >
+                    {{ scope.row.result }}
+                  </el-tag>
+                </template>
+              </el-table-column>
+              <!-- 闄勪欢鍒� -->
+              <el-table-column label="闄勪欢" align="center">
+                <template slot-scope="scope">
+                  <el-button
+                    v-if="
+                      scope.row.attachments && scope.row.attachments.length > 0
+                    "
+                    size="mini"
+                    type="text"
+                    @click="handleViewCultureAttachments(scope.row)"
+                  >
+                    鏌ョ湅闄勪欢({{ scope.row.attachments.length }})
+                  </el-button>
+                  <span v-else>鏃犻檮浠�</span>
+                </template>
+              </el-table-column>
+
+            </el-table>
+
+            <pagination
+              v-show="cultureTotal > 0"
+              :total="cultureTotal"
+              :page.sync="cultureQueryParams.pageNum"
+              :limit.sync="cultureQueryParams.pageSize"
+              @pagination="getCultureList"
+            />
+          </el-card>
+        </el-tab-pane>
+
+        <!-- 鑲濆姛鑳借偩鍔熻兘 -->
+        <el-tab-pane label="鑲濆姛鑳借偩鍔熻兘" name="liverKidney">
+          <liver-kidney-panel
+            ref="liverKidney"
+            :is-editing="isEdit && activeTab === 'liverKidney'"
+            @data-change="handleLiverKidneyDataChange"
+          />
+        </el-tab-pane>
+
+        <!-- 琛�甯歌 -->
+        <el-tab-pane label="琛�甯歌" name="bloodRoutine">
+          <blood-routine-panel
+            ref="bloodRoutine"
+            :is-editing="isEdit && activeTab === 'bloodRoutine'"
+            @data-change="handleBloodRoutineDataChange"
+          />
+        </el-tab-pane>
+
+        <!-- 灏垮父瑙� -->
+        <el-tab-pane label="灏垮父瑙�" name="urineRoutine">
+          <urine-routine-panel
+            ref="urineRoutine"
+            :is-editing="isEdit && activeTab === 'urineRoutine'"
+            @data-change="handleUrineRoutineDataChange"
+          />
+        </el-tab-pane>
+      </el-tabs>
+    </el-card>
+    <!-- 鍩瑰吇缁撴灉璁板綍 -->
+
+    <!-- 绠�鍖栧悗鐨勬姢鐞嗘牳鏌ヨ褰� -->
+    <el-card class="record-card">
+      <div slot="header" class="clearfix">
+        <span class="detail-title">鎶ょ悊鏍告煡璁板綍</span>
       </div>
-      <el-table :data="maintenanceRecords" border>
-        <el-table-column label="缁存姢椤圭洰" prop="item" width="150" />
-        <el-table-column label="缁存姢鍐呭" prop="content" min-width="200" />
-        <el-table-column label="缁存姢浜�" prop="operator" width="120" />
-        <el-table-column label="缁存姢鏃堕棿" width="160">
+
+      <el-table :data="recordList" v-loading="recordLoading">
+        <el-table-column
+          label="鏍告煡鏃堕棿"
+          align="center"
+          prop="recordTime"
+          width="160"
+        />
+        <el-table-column
+          label="鏍告煡浜�"
+          align="center"
+          prop="recorder"
+          width="100"
+        />
+        <el-table-column
+          label="鏍告煡璁板綍"
+          align="center"
+          prop="checkRecord"
+          min-width="200"
+          show-overflow-tooltip
+        />
+        <!-- 闄勪欢鍒� -->
+        <el-table-column label="闄勪欢" align="center" width="120">
           <template slot-scope="scope">
-            {{ formatTime(scope.row.time) }}
-          </template>
-        </el-table-column>
-        <el-table-column label="鐘舵��" width="100">
-          <template slot-scope="scope">
-            <el-tag :type="scope.row.status === 'completed' ? 'success' : 'warning'">
-              {{ scope.row.status === 'completed' ? '宸插畬鎴�' : '杩涜涓�' }}
-            </el-tag>
+            <el-button
+              v-if="scope.row.attachments && scope.row.attachments.length > 0"
+              size="mini"
+              type="text"
+              @click="handleViewRecordAttachments(scope.row)"
+            >
+              鏌ョ湅闄勪欢({{ scope.row.attachments.length }})
+            </el-button>
+            <span v-else>鏃犻檮浠�</span>
           </template>
         </el-table-column>
       </el-table>
+
+      <pagination
+        v-show="recordTotal > 0"
+        :total="recordTotal"
+        :page.sync="recordQueryParams.pageNum"
+        :limit.sync="recordQueryParams.pageSize"
+        @pagination="getRecordList"
+      />
     </el-card>
-  </base-stage>
+    <!-- 鍩瑰吇璁板綍缂栬緫瀵硅瘽妗� -->
+    <el-dialog
+      :title="cultureDialogTitle"
+      :visible.sync="cultureDialogVisible"
+      width="700px"
+      :close-on-click-modal="false"
+    >
+      <el-form
+        :model="cultureForm"
+        ref="cultureForm"
+        :rules="cultureRules"
+        label-width="120px"
+      >
+        <el-row :gutter="20">
+          <el-col :span="12">
+            <el-form-item label="鍩瑰吇绫诲瀷" prop="cultureType">
+              <el-select
+                v-model="cultureForm.cultureType"
+                placeholder="璇烽�夋嫨鍩瑰吇绫诲瀷"
+                style="width: 100%"
+              >
+                <el-option
+                  v-for="item in cultureTypeOptions"
+                  :key="item.value"
+                  :label="item.label"
+                  :value="item.label"
+                />
+              </el-select>
+            </el-form-item>
+          </el-col>
+          <el-col :span="12">
+            <el-form-item label="閲囨牱鏃堕棿" prop="sampleTime">
+              <el-date-picker
+                v-model="cultureForm.sampleTime"
+                type="datetime"
+                value-format="yyyy-MM-dd HH:mm:ss"
+                placeholder="閫夋嫨閲囨牱鏃堕棿"
+                style="width: 100%"
+              />
+            </el-form-item>
+          </el-col>
+        </el-row>
+
+        <el-row :gutter="20">
+          <el-col :span="12">
+            <el-form-item label="鍩瑰吇缁撴灉" prop="result">
+              <el-select
+                v-model="cultureForm.result"
+                placeholder="璇烽�夋嫨鍩瑰吇缁撴灉"
+                style="width: 100%"
+              >
+                <el-option label="闃存��" value="闃存��" />
+                <el-option label="闃虫��" value="闃虫��" />
+              </el-select>
+            </el-form-item>
+          </el-col>
+        </el-row>
+
+        <!-- 闄勪欢涓婁紶 -->
+        <el-form-item label="闄勪欢">
+          <upload-attachment
+            :file-list="cultureForm.attachments"
+            @change="handleCultureAttachmentChange"
+          />
+        </el-form-item>
+      </el-form>
+
+      <span slot="footer" class="dialog-footer">
+        <el-button @click="cultureDialogVisible = false">鍙栨秷</el-button>
+        <el-button
+          type="primary"
+          @click="handleSaveCulture"
+          :loading="cultureSaveLoading"
+          >淇濆瓨</el-button
+        >
+      </span>
+    </el-dialog>
+
+    <!-- 鎶ょ悊鏍告煡璁板綍缂栬緫瀵硅瘽妗� -->
+    <el-dialog
+      :title="recordDialogTitle"
+      :visible.sync="recordDialogVisible"
+      width="700px"
+      :close-on-click-modal="false"
+    >
+      <el-form
+        :model="recordForm"
+        ref="recordForm"
+        :rules="recordRules"
+        label-width="120px"
+      >
+        <el-row :gutter="20">
+          <el-col :span="12">
+            <el-form-item label="鏍告煡鏃堕棿" prop="recordTime">
+              <el-date-picker
+                v-model="recordForm.recordTime"
+                type="datetime"
+                value-format="yyyy-MM-dd HH:mm:ss"
+                placeholder="閫夋嫨鏍告煡鏃堕棿"
+                style="width: 100%"
+              />
+            </el-form-item>
+          </el-col>
+          <el-col :span="12">
+            <el-form-item label="鏍告煡浜�" prop="recorder">
+              <el-input
+                v-model="recordForm.recorder"
+                placeholder="璇疯緭鍏ユ牳鏌ヤ汉濮撳悕"
+              />
+            </el-form-item>
+          </el-col>
+        </el-row>
+
+        <el-form-item label="鏍告煡璁板綍" prop="checkRecord">
+          <el-input
+            type="textarea"
+            :rows="4"
+            v-model="recordForm.checkRecord"
+            placeholder="璇疯緭鍏ユ牳鏌ヨ褰曞唴瀹�"
+          />
+        </el-form-item>
+
+        <!-- 闄勪欢涓婁紶 -->
+        <el-form-item label="闄勪欢">
+          <upload-attachment
+            :file-list="recordForm.attachments"
+            @change="handleRecordAttachmentChange"
+          />
+        </el-form-item>
+      </el-form>
+
+      <span slot="footer" class="dialog-footer">
+        <el-button @click="recordDialogVisible = false">鍙栨秷</el-button>
+        <el-button
+          type="primary"
+          @click="handleSaveRecord"
+          :loading="recordSaveLoading"
+          >淇濆瓨</el-button
+        >
+      </span>
+    </el-dialog>
+
+    <!-- 闄勪欢棰勮瀵硅瘽妗� -->
+    <attachment-preview
+      :visible="attachmentPreviewVisible"
+      :file-list="currentAttachmentList"
+      :title="attachmentPreviewTitle"
+      @close="attachmentPreviewVisible = false"
+    />
+  </div>
 </template>
 
 <script>
-import BaseStage from './BaseStage.vue';
+import { getMaintenanceDetail, updateMaintenance } from "./api//mockMaintenanceApi";
+import {
+  listCultureResults,
+  addCultureResult,
+  updateCultureResult,
+  deleteCultureResult
+} from "./api/mockMaintenanceApi";
+import {
+  listNursingRecords,
+  addNursingRecord,
+  updateNursingRecord,
+  deleteNursingRecord
+} from "./api//mockMaintenanceApi";
+import Pagination from "@/components/Pagination";
+import UploadAttachment from "@/components/UploadAttachment";
+import AttachmentPreview from "@/components/AttachmentPreview";
+import LiverKidneyPanel from "./components/LiverKidneyPanel.vue";
+import BloodRoutinePanel from "./components/BloodRoutinePanel.vue";
+import UrineRoutinePanel from "./components/UrineRoutinePanel.vue";
 
 export default {
-  name: 'DonorMaintenanceStage',
-  components: { BaseStage },
-  dicts: ['sys_user_sex'],
-  props: {
-    stageData: {
-      type: Object,
-      default: () => ({})
-    },
-    caseInfo: {
-      type: Object,
-      default: () => ({})
-    }
+  name: "MaintenanceDetail",
+  components: {
+    Pagination,
+    UploadAttachment,
+    AttachmentPreview,
+    LiverKidneyPanel,
+    BloodRoutinePanel,
+    UrineRoutinePanel
   },
   data() {
     return {
-      maintenanceEvents: [
+      isEdit: true,
+      form: {
+        id: undefined,
+        caseNo: "",
+        donorName: "",
+        gender: "",
+        age: "",
+        diagnosis: "",
+        hospitalName: "",
+        patientStatus: "1",
+        admissionTime: "",
+        dischargeTime: "",
+        coordinator: "",
+        bloodType: "",
+        rhFactor: "",
+        specialMedicalHistory: "",
+        incompleteReason: ""
+      },
+      activeTab: "culture",
+      // 鍩瑰吇缁撴灉鐩稿叧鏁版嵁
+      // 鍩瑰吇缁撴灉鐩稿叧鏁版嵁
+      cultureList: [
         {
-          time: '2023-12-01 08:30:00',
-          content: '渚涜�呭熀鏈俊鎭綍鍏�',
-          type: 'primary'
+          id: 1,
+          cultureType: "琛�鍩瑰吇",
+          sampleTime: "2024-12-19 10:30:00",
+          result: "闃存��",
+          bacteria: "",
+          drugSensitivity: "",
+          testingInstitution: "鍖椾含鍖诲妫�楠屼腑蹇�",
+          specimenType: "琛�娑�",
+          remarks: "甯歌妫�娴�",
+          attachments: [
+            {
+              id: 1,
+              fileName: "琛�鍩瑰吇鎶ュ憡.pdf",
+              fileUrl:
+                "http://localhost:8080/profile/upload/2025/12/27/1.COPO渚涗綋璇勪及琛�.pdf",
+              fileSize: 1024000,
+              uploadTime: "2024-12-19 11:00:00"
+            }
+          ]
         },
         {
-          time: '2023-12-01 09:15:00',
-          content: '鍖荤枟妗f寤虹珛',
-          type: 'success'
+          id: 3,
+          cultureType: "琛�鍩瑰吇",
+          sampleTime: "2024-12-20 09:15:00",
+          result: "闃存��",
+          bacteria: "",
+          drugSensitivity: "",
+          testingInstitution: "骞垮窞妫�娴嬩腑蹇�",
+          specimenType: "灏挎恫",
+          remarks: "娓呮磥涓灏挎爣鏈�",
+          attachments: []
         },
         {
-          time: '2023-12-01 10:00:00',
-          content: '鍒濇璇勪及瀹屾垚',
-          type: 'success'
+          id: 2,
+          cultureType: "鐥板煿鍏荤粨鏋�",
+          sampleTime: "2024-12-19 14:20:00",
+          result: "闃虫��",
+          bacteria: "閲戦粍鑹茶憽钀勭悆鑿�",
+          drugSensitivity: "瀵归潚闇夌礌鏁忔劅锛屽澶村绫讳腑浠�",
+          testingInstitution: "涓婃捣鍖诲妫�楠屾墍",
+          specimenType: "鐥版恫",
+          remarks: "鑽晱璇曢獙瀹屾垚",
+          attachments: [
+            {
+              id: 2,
+              fileName: "鐥板煿鍏荤粨鏋�.jpg",
+              fileUrl:
+                "https://img95.699pic.com/photo/40142/8262.jpg_wh860.jpg",
+              fileSize: 512000,
+              uploadTime: "2024-12-19 15:30:00"
+            },
+            {
+              id: 3,
+              fileName: "鑽晱鎶ュ憡.pdf",
+              fileUrl:
+                "http://localhost:8080/profile/upload/2025/12/27/(鍚撮緳8.7)姣忔棩宸ヤ綔鎬荤粨.pdf",
+              fileSize: 768000,
+              uploadTime: "2024-12-19 16:00:00"
+            }
+          ]
+        },
+
+        {
+          id: 4,
+          cultureType: "鐪熻弻鍩瑰吇",
+          sampleTime: "2024-12-20 11:45:00",
+          result: "闃虫��",
+          bacteria: "澶ц偁鏉嗚弻",
+          drugSensitivity: "瀵瑰乏姘ф盁娌欐槦鏁忔劅",
+          testingInstitution: "娣卞湷浜烘皯鍖婚櫌",
+          specimenType: "浼ゅ彛鍒嗘硨鐗�",
+          remarks: "鏈悗浼ゅ彛鎰熸煋鐩戞祴",
+          attachments: [
+            {
+              id: 4,
+              fileName: "鐪熻弻鍩瑰吇.pdf",
+              fileUrl: "/reports/culture4.pdf",
+              fileSize: 890000,
+              uploadTime: "2024-12-20 13:20:00"
+            }
+          ]
         }
       ],
-      maintenanceRecords: [
+      cultureLoading: false,
+      cultureTotal: 5,
+      cultureQueryParams: {
+        pageNum: 1,
+        pageSize: 10
+      },
+      cultureDialogVisible: false,
+      cultureDialogTitle: "",
+      cultureSaveLoading: false,
+      cultureForm: {
+        id: undefined,
+        cultureType: "",
+        sampleTime: "",
+        result: "闃存��",
+        attachments: [] // 鏂板闄勪欢瀛楁
+      },
+      cultureRules: {
+        cultureType: [
+          { required: true, message: "璇烽�夋嫨鍩瑰吇绫诲瀷", trigger: "change" }
+        ],
+        sampleTime: [
+          { required: true, message: "璇烽�夋嫨閲囨牱鏃堕棿", trigger: "change" }
+        ],
+        result: [
+          { required: true, message: "璇烽�夋嫨鍩瑰吇缁撴灉", trigger: "change" }
+        ]
+      },
+      cultureTypeOptions: [
+        { value: "1", label: "琛�鍩瑰吇" },
+        { value: "2", label: "鐥板煿鍏�" },
+        { value: "3", label: "灏垮煿鍏�" },
+        { value: "4", label: "浼ゅ彛鍒嗘硨鐗�" },
+        { value: "5", label: "鑴戣剨娑插煿鍏�" },
+        { value: "6", label: "鍏朵粬" }
+      ],
+
+      // 鎶ょ悊鏍告煡璁板綍鐩稿叧鏁版嵁
+      recordList: [
         {
-          item: '鍩烘湰淇℃伅',
-          content: '渚涜�呰韩浠戒俊鎭‘璁や笌褰曞叆',
-          operator: '寮犲尰鐢�',
-          time: '2023-12-01 08:30:00',
-          status: 'completed'
+          id: 1,
+          recordTime: "2024-12-19 08:30:00",
+          recorder: "寮犳姢澹�",
+          temperature: 36.8,
+          heartRate: 78,
+          bloodPressure: "120/80",
+          respirationRate: 18,
+          oxygenSaturation: 98,
+          urineOutput: 60,
+          cvp: 8,
+          checkRecord: "鎮h�呯敓鍛戒綋寰佸钩绋筹紝鎰忚瘑娓呮锛岄厤鍚堟不鐤�",
+          remarks: "澶滈棿鐫$湢鑹ソ",
+          attachments: [
+            {
+              id: 1,
+              fileName: "鏃╃彮鎶ょ悊璁板綍.jpg",
+              fileUrl: "/records/nursing1.jpg",
+              fileSize: 1024000,
+              uploadTime: "2024-12-19 09:00:00"
+            }
+          ]
         },
         {
-          item: '鍖荤枟妗f',
-          content: '鐥呭彶璧勬枡鏀堕泦涓庢暣鐞�',
-          operator: '鏉庢姢澹�',
-          time: '2023-12-01 09:15:00',
-          status: 'completed'
+          id: 2,
+          recordTime: "2024-12-19 14:30:00",
+          recorder: "鏉庢姢澹�",
+          temperature: 37.2,
+          heartRate: 82,
+          bloodPressure: "118/76",
+          respirationRate: 16,
+          oxygenSaturation: 97,
+          urineOutput: 45,
+          cvp: 7.5,
+          checkRecord: "鎮h�呭崍鍚庝綋娓╃暐鏈夊崌楂橈紝瑙傚療涓�",
+          remarks: "寤鸿澧炲姞姘村垎鎽勫叆",
+          attachments: []
         },
         {
-          item: '鍒濇璇勪及',
-          content: '鎹愮尞閫傚疁鎬у垵姝ヨ瘎浼�',
-          operator: '鐜嬩富浠�',
-          time: '2023-12-01 10:00:00',
-          status: 'completed'
+          id: 3,
+          recordTime: "2024-12-19 20:30:00",
+          recorder: "鐜嬫姢澹�",
+          temperature: 36.9,
+          heartRate: 75,
+          bloodPressure: "122/78",
+          respirationRate: 17,
+          oxygenSaturation: 98,
+          urineOutput: 55,
+          cvp: 8.2,
+          checkRecord: "鏅氶棿鐢熷懡浣撳緛绋冲畾锛屾偅鑰呬紤鎭壇濂�",
+          remarks: "澶滈棿鐩戞祴鏃犲紓甯�",
+          attachments: [
+            {
+              id: 2,
+              fileName: "鏅氱彮鎶ょ悊璁板綍.pdf",
+              fileUrl: "/records/nursing3.pdf",
+              fileSize: 890000,
+              uploadTime: "2024-12-19 21:00:00"
+            },
+            {
+              id: 3,
+              fileName: "浣撳緛鐩戞祴琛�.xlsx",
+              fileUrl: "/records/monitoring3.xlsx",
+              fileSize: 256000,
+              uploadTime: "2024-12-19 21:15:00"
+            }
+          ]
+        },
+        {
+          id: 4,
+          recordTime: "2024-12-20 08:30:00",
+          recorder: "璧垫姢澹�",
+          temperature: 36.7,
+          heartRate: 80,
+          bloodPressure: "119/77",
+          respirationRate: 18,
+          oxygenSaturation: 99,
+          urineOutput: 65,
+          cvp: 7.8,
+          checkRecord: "鏅ㄩ棿鐢熷懡浣撳緛姝e父锛屾偅鑰呯簿绁炵姸鎬佽壇濂�",
+          remarks: "鍑嗗浠婃棩妫�鏌�",
+          attachments: []
+        },
+        {
+          id: 5,
+          recordTime: "2024-12-20 12:30:00",
+          recorder: "鍒樻姢澹�",
+          temperature: 37.1,
+          heartRate: 85,
+          bloodPressure: "121/79",
+          respirationRate: 19,
+          oxygenSaturation: 96,
+          urineOutput: 40,
+          cvp: 8.5,
+          checkRecord: "鍗堥棿浣撴俯鐣ユ湁娉㈠姩锛岀户缁瀵�",
+          remarks: "宸查�氱煡鍖荤敓",
+          attachments: [
+            {
+              id: 4,
+              fileName: "鍗堥棿鎶ょ悊璁板綍.jpg",
+              fileUrl: "/records/nursing5.jpg",
+              fileSize: 765000,
+              uploadTime: "2024-12-20 13:00:00"
+            }
+          ]
         }
-      ]
+      ],
+      recordLoading: false,
+      recordTotal: 4,
+      recordQueryParams: {
+        pageNum: 1,
+        pageSize: 10
+      },
+      recordDialogVisible: false,
+      recordDialogTitle: "",
+      recordSaveLoading: false,
+      recordForm: {
+        id: undefined,
+        recordTime: "",
+        recorder: "",
+        checkRecord: "", // 鏀逛负鍗曞瓧娈佃褰�
+        attachments: [] // 鏂板闄勪欢瀛楁
+      },
+      recordRules: {
+        recordTime: [
+          { required: true, message: "璇烽�夋嫨鏍告煡鏃堕棿", trigger: "change" }
+        ],
+        recorder: [
+          { required: true, message: "璇疯緭鍏ユ牳鏌ヤ汉", trigger: "blur" }
+        ],
+        checkRecord: [
+          { required: true, message: "璇疯緭鍏ユ牳鏌ヨ褰�", trigger: "blur" }
+        ]
+      },
+
+      // 闄勪欢棰勮鐩稿叧
+      attachmentPreviewVisible: false,
+      currentAttachmentList: [],
+      attachmentPreviewTitle: ""
     };
+  },
+  created() {
+    const id = this.$route.query.id;
+    // this.isEdit = this.$route.query.edit === "true";
+    if (id) {
+      this.getDetail(id);
+      this.getCultureList();
+      this.getRecordList();
+    }
+  },
+  methods: {
+    // 鑾峰彇璇︽儏
+    getDetail(id) {
+      getMaintenanceDetail(id).then(response => {
+        if (response.code === 200) {
+          this.form = response.data;
+        }
+      });
+    },
+    // 鍩瑰吇璁板綍闄勪欢鍙樻洿
+    handleCultureAttachmentChange(fileList) {
+      this.cultureForm.attachments = fileList;
+    },
+
+    // 鎶ょ悊璁板綍闄勪欢鍙樻洿
+    handleRecordAttachmentChange(fileList) {
+      this.recordForm.attachments = fileList;
+    },
+
+    // 鏌ョ湅鍩瑰吇璁板綍闄勪欢
+    handleViewCultureAttachments(row) {
+      console.log(22, row.attachments);
+
+      this.currentAttachmentList = row.attachments || [];
+      this.attachmentPreviewTitle = `鍩瑰吇璁板綍闄勪欢 - ${row.cultureType}`;
+      this.attachmentPreviewVisible = true;
+    },
+    handleTabClick(tab) {
+      this.$nextTick(() => {
+        console.log(tab.name, 88);
+        const tableRef=null;
+        if (tab.name == "liverKidney") {
+           tableRef = this.$refs.liverKidney; // 璇锋浛鎹负鎮ㄧ殑琛ㄦ牸 ref
+        } else if (tab.name == "bloodRoutine") {
+           tableRef = this.$refs.bloodRoutine; // 璇锋浛鎹负鎮ㄧ殑琛ㄦ牸 ref
+        } else if (tab.name == "bloodRoutine") {
+           tableRef = this.$refs.bloodRoutine; // 璇锋浛鎹负鎮ㄧ殑琛ㄦ牸 ref
+        }
+        // 濡傛灉鏄� el-table锛屽皾璇曡皟鐢ㄥ叾 doLayout 鏂规硶
+        if (tableRef && tableRef.doLayout) {
+          tableRef.doLayout();
+        }
+
+        // 鎴栬�咃紝鏇撮�氱敤鐨勫己鍒堕噸鏂版覆鏌撴柟寮�
+        this.$forceUpdate(); // 鎱庣敤锛屽彲鑳藉紩鍙戝叾浠栭棶棰榌1](@ref)
+      });
+    },
+    // 鏌ョ湅鎶ょ悊璁板綍闄勪欢
+    handleViewRecordAttachments(row) {
+      this.currentAttachmentList = row.attachments || [];
+      this.attachmentPreviewTitle = `鎶ょ悊鏍告煡璁板綍闄勪欢 - ${row.recorder}`;
+      this.attachmentPreviewVisible = true;
+    },
+    // 鍩瑰吇璁板綍鐩稿叧鏂规硶
+    getCultureList() {
+      this.cultureLoading = true;
+      listCultureResults(this.form.id, this.cultureQueryParams)
+        .then(response => {
+          if (response.code === 200) {
+            // this.cultureList = response.data.rows;
+            // this.cultureTotal = response.data.total;
+          }
+          this.cultureLoading = false;
+        })
+        .catch(() => {
+          this.cultureLoading = false;
+        });
+    },
+
+    handleAddCulture() {
+      this.cultureDialogTitle = "鏂板鍩瑰吇璁板綍";
+      this.cultureForm = {
+        id: undefined,
+        cultureType: "",
+        sampleTime: "",
+        result: "闃存��",
+        bacteria: "",
+        drugSensitivity: "",
+        testingInstitution: "",
+        specimenType: "",
+        remarks: ""
+      };
+      this.cultureDialogVisible = true;
+      this.$nextTick(() => {
+        this.$refs.cultureForm && this.$refs.cultureForm.clearValidate();
+      });
+    },
+
+    handleEditCulture(row) {
+      this.cultureDialogTitle = "缂栬緫鍩瑰吇璁板綍";
+      this.cultureForm = { ...row };
+      this.cultureDialogVisible = true;
+      this.$nextTick(() => {
+        this.$refs.cultureForm && this.$refs.cultureForm.clearValidate();
+      });
+    },
+
+    handleViewCulture(row) {
+      this.$alert(
+        `
+        <div>
+          <p><strong>鍩瑰吇绫诲瀷锛�</strong>${this.getCultureTypeLabel(
+            row.cultureType
+          )}</p>
+          <p><strong>閲囨牱鏃堕棿锛�</strong>${row.sampleTime}</p>
+          <p><strong>鍩瑰吇缁撴灉锛�</strong>${row.result}</p>
+          <p><strong>妫�娴嬫満鏋勶細</strong>${row.testingInstitution}</p>
+        </div>
+      `,
+        "鍩瑰吇璁板綍璇︽儏",
+        {
+          dangerouslyUseHTMLString: true,
+          customClass: "detail-dialog"
+        }
+      );
+    },
+    toggleEditMode() {
+      this.isEdit = !this.isEdit;
+      // if (!this.isEdit) {
+      //   this.saveAllData();
+      // }
+    },
+    handleLiverKidneyDataChange(data) {
+      console.log("鑲濆姛鑳借偩鍔熻兘鏁版嵁鍙樻洿:", data);
+      // 澶勭悊鏁版嵁淇濆瓨鎴栦复鏃跺瓨鍌�
+    },
+    handleBloodRoutineDataChange(data) {
+      console.log("琛�甯歌鍔熻兘鏁版嵁鍙樻洿:", data);
+      // 澶勭悊鏁版嵁淇濆瓨鎴栦复鏃跺瓨鍌�
+    },
+    handleUrineRoutineDataChange(data) {
+      console.log("灏垮父瑙勫姛鑳芥暟鎹彉鏇�:", data);
+      // 澶勭悊鏁版嵁淇濆瓨鎴栦复鏃跺瓨鍌�
+    },
+    // 淇濆瓨鍩瑰吇璁板綍
+    handleSaveCulture() {
+      this.$refs.cultureForm.validate(valid => {
+        if (valid) {
+          this.cultureSaveLoading = true;
+          const api = this.cultureForm.id
+            ? updateCultureResult
+            : addCultureResult;
+          const requestData = {
+            ...this.cultureForm,
+            maintenanceId: this.form.id
+          };
+
+          api(requestData)
+            .then(response => {
+              if (response.code === 200) {
+                this.$message.success(
+                  this.cultureForm.id ? "淇敼鎴愬姛" : "鏂板鎴愬姛"
+                );
+                this.cultureDialogVisible = false;
+                this.getCultureList();
+              }
+              this.cultureSaveLoading = false;
+            })
+            .catch(() => {
+              this.cultureSaveLoading = false;
+            });
+        }
+      });
+    },
+
+    handleDeleteCulture(row) {
+      this.$confirm("纭畾瑕佸垹闄よ繖鏉″煿鍏昏褰曞悧锛�", "鎻愮ず", {
+        confirmButtonText: "纭畾",
+        cancelButtonText: "鍙栨秷",
+        type: "warning"
+      })
+        .then(() => {
+          deleteCultureResult(row.id).then(response => {
+            if (response.code === 200) {
+              this.$message.success("鍒犻櫎鎴愬姛");
+              this.getCultureList();
+            }
+          });
+        })
+        .catch(() => {});
+    },
+
+    getCultureTypeLabel(value) {
+      const type = this.cultureTypeOptions.find(item => item.value === value);
+      return type ? type.label : "鏈煡";
+    },
+
+    // 鎶ょ悊鏍告煡璁板綍鐩稿叧鏂规硶
+    getRecordList() {
+      this.recordLoading = true;
+      listNursingRecords(this.form.id, this.recordQueryParams)
+        .then(response => {
+          if (response.code === 200) {
+            // this.recordList = response.data.rows;
+            // this.recordTotal = response.data.total;
+          }
+          this.recordLoading = false;
+        })
+        .catch(() => {
+          this.recordLoading = false;
+        });
+    },
+
+    handleAddRecord() {
+      this.recordDialogTitle = "鏂板鎶ょ悊鏍告煡璁板綍";
+      this.recordForm = {
+        id: undefined,
+        recordTime: new Date()
+          .toISOString()
+          .replace("T", " ")
+          .substring(0, 19),
+        recorder: "褰撳墠鐢ㄦ埛", // 瀹為檯椤圭洰涓粠鐢ㄦ埛淇℃伅鑾峰彇
+        temperature: 36.5,
+        heartRate: 80,
+        bloodPressure: "120/80",
+        respirationRate: 18,
+        oxygenSaturation: 98,
+        urineOutput: 50,
+        cvp: 8,
+        remarks: ""
+      };
+      this.recordDialogVisible = true;
+      this.$nextTick(() => {
+        this.$refs.recordForm && this.$refs.recordForm.clearValidate();
+      });
+    },
+
+    handleEditRecord(row) {
+      this.recordDialogTitle = "缂栬緫鎶ょ悊鏍告煡璁板綍";
+      this.recordForm = { ...row };
+      this.recordDialogVisible = true;
+      this.$nextTick(() => {
+        this.$refs.recordForm && this.$refs.recordForm.clearValidate();
+      });
+    },
+
+    handleViewRecord(row) {
+      this.$alert(
+        `
+        <div>
+          <p><strong>鏍告煡鏃堕棿锛�</strong>${row.recordTime}</p>
+          <p><strong>鏍告煡浜猴細</strong>${row.recorder}</p>
+          <p><strong>鐢熷懡浣撳緛锛�</strong></p>
+          <ul>
+            <li>浣撴俯锛�${row.temperature}鈩�</li>
+            <li>蹇冪巼锛�${row.heartRate}娆�/鍒�</li>
+            <li>琛�鍘嬶細${row.bloodPressure}mmHg</li>
+            <li>鍛煎惛锛�${row.respirationRate}娆�/鍒�</li>
+            <li>琛�姘чケ鍜屽害锛�${row.oxygenSaturation}%</li>
+            <li>灏块噺锛�${row.urineOutput}ml/h</li>
+          </ul>
+          <p><strong>澶囨敞锛�</strong>${row.remarks || "鏃�"}</p>
+        </div>
+      `,
+        "鎶ょ悊鏍告煡璁板綍璇︽儏",
+        {
+          dangerouslyUseHTMLString: true,
+          customClass: "detail-dialog"
+        }
+      );
+    },
+
+    handleSaveRecord() {
+      this.$refs.recordForm.validate(valid => {
+        if (valid) {
+          this.recordSaveLoading = true;
+          const api = this.recordForm.id
+            ? updateNursingRecord
+            : addNursingRecord;
+          const requestData = {
+            ...this.recordForm,
+            maintenanceId: this.form.id
+          };
+
+          api(requestData)
+            .then(response => {
+              if (response.code === 200) {
+                this.$message.success(
+                  this.recordForm.id ? "淇敼鎴愬姛" : "鏂板鎴愬姛"
+                );
+                this.recordDialogVisible = false;
+                this.getRecordList();
+              }
+              this.recordSaveLoading = false;
+            })
+            .catch(() => {
+              this.recordSaveLoading = false;
+            });
+        }
+      });
+    },
+
+    handleDeleteRecord(row) {
+      this.$confirm("纭畾瑕佸垹闄よ繖鏉℃姢鐞嗘牳鏌ヨ褰曞悧锛�", "鎻愮ず", {
+        confirmButtonText: "纭畾",
+        cancelButtonText: "鍙栨秷",
+        type: "warning"
+      })
+        .then(() => {
+          deleteNursingRecord(row.id).then(response => {
+            if (response.code === 200) {
+              this.$message.success("鍒犻櫎鎴愬姛");
+              this.getRecordList();
+            }
+          });
+        })
+        .catch(() => {});
+    },
+
+    // 淇濆瓨鍩烘湰淇℃伅
+    handleSave() {
+      this.$refs.form.validate(valid => {
+        if (valid) {
+          updateMaintenance(this.form).then(response => {
+            if (response.code === 200) {
+              this.$message.success("淇濆瓨鎴愬姛");
+              this.isEdit = false;
+            }
+          });
+        }
+      });
+    }
   }
 };
 </script>
 
 <style scoped>
-.card-header {
-  font-weight: 600;
-  color: #303133;
+.maintenance-detail {
+  padding: 20px;
 }
 
-.info-card, .timeline-card {
-  height: 100%;
+.detail-card {
+  margin-bottom: 20px;
+}
+
+.culture-card {
+  margin-bottom: 20px;
+}
+
+.record-card {
+  margin-bottom: 20px;
+}
+
+.detail-title {
+  font-size: 16px;
+  font-weight: bold;
+}
+.maintenance-detail {
+  padding: 20px;
+}
+
+.detail-card {
+  margin-bottom: 20px;
+}
+
+.culture-card {
+  margin-bottom: 20px;
+}
+
+.record-card {
+  margin-bottom: 20px;
+}
+
+.detail-title {
+  font-size: 16px;
+  font-weight: bold;
+}
+.medical-panel {
+  padding: 20px;
+}
+
+.attachment-section {
+  margin-top: 20px;
+  padding: 15px;
+  border: 1px solid #ebeef5;
+  border-radius: 4px;
+}
+
+.attachment-title {
+  font-weight: bold;
+  margin-bottom: 10px;
+  color: #409eff;
+}
+
+.required-item::before {
+  content: "*";
+  color: #f56c6c;
+  margin-right: 4px;
+}
+
+.assessment-card {
+  margin-bottom: 20px;
+}
+
+.medical-table {
+  width: 100%;
+  margin-bottom: 20px;
+}
+
+.dynamic-column {
+  min-width: 120px;
+}
+.fixed-width .el-button {
+  margin: 0 2px;
+}
+
+/* 璇︽儏瀵硅瘽妗嗘牱寮� */
+:deep(.detail-dialog) {
+  width: 500px;
+}
+
+:deep(.detail-dialog .el-message-box__content) {
+  line-height: 1.8;
+}
+
+:deep(.detail-dialog ul) {
+  margin: 10px 0;
+  padding-left: 20px;
+}
+
+:deep(.detail-dialog li) {
+  margin-bottom: 5px;
 }
 </style>

--
Gitblit v1.9.3