From 475a352a4bfd7ac3a81e8c7c92d3bb64e2e01037 Mon Sep 17 00:00:00 2001
From: WXL <wl_5969728@163.com>
Date: 星期五, 27 二月 2026 15:48:37 +0800
Subject: [PATCH] 青岛维护提交
---
src/views/business/maintain/maintainInfo.vue | 989 ++++++++++++++++++++-------------------------------------
1 files changed, 350 insertions(+), 639 deletions(-)
diff --git a/src/views/business/maintain/maintainInfo.vue b/src/views/business/maintain/maintainInfo.vue
index 36ded43..d6aa6ec 100644
--- a/src/views/business/maintain/maintainInfo.vue
+++ b/src/views/business/maintain/maintainInfo.vue
@@ -4,12 +4,7 @@
<el-card class="detail-card">
<div slot="header" class="clearfix">
<span class="detail-title">渚涜�呭熀鏈俊鎭�</span>
- <el-button
- v-if="isEdit"
- type="primary"
- style="float: right; padding: 3px 0"
- @click="handleSave"
- >
+ <el-button type="success" style="float: right;" @click="handleSave">
淇濆瓨淇℃伅
</el-button>
</div>
@@ -18,21 +13,17 @@
<el-row :gutter="20">
<el-col :span="8">
<el-form-item label="浣忛櫌鍙�" prop="caseNo">
- <el-input v-model="form.caseNo" :readonly="!isEdit" />
+ <el-input v-model="form.caseNo" />
</el-form-item>
</el-col>
<el-col :span="8">
- <el-form-item label="鎹愮尞鑰呭鍚�" prop="donorName">
- <el-input v-model="form.donorName" :readonly="!isEdit" />
+ <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.gender"
- :disabled="!isEdit"
- style="width: 100%"
- >
+ <el-select v-model="form.sex" style="width: 100%">
<el-option label="鐢�" value="0" />
<el-option label="濂�" value="1" />
</el-select>
@@ -43,46 +34,61 @@
<el-row :gutter="20">
<el-col :span="8">
<el-form-item label="骞撮緞" prop="age">
- <el-input v-model="form.age" :readonly="!isEdit" />
+ <el-input v-model="form.age" />
</el-form-item>
</el-col>
<el-col :span="8">
- <el-form-item label="鐤剧梾璇婃柇" prop="diagnosis">
- <el-input v-model="form.diagnosis" :readonly="!isEdit" />
+ <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="hospitalName">
- <el-input v-model="form.hospitalName" :readonly="!isEdit" />
+ <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="patientStatus">
- <el-select
- v-model="form.patientStatus"
- :disabled="!isEdit"
- style="width: 100%"
- >
- <el-option label="DCD" value="1" />
+ <el-form-item label="鎮h�呯姸鎬�" prop="recordstate">
+ <el-select v-model="form.recordstate" style="width: 100%">
+ <!-- <el-option label="DCD" value="1" />
<el-option label="DBD" value="2" />
<el-option label="DBCD" value="3" />
<el-option label="宸插畬鎴愭崘鐚�" value="4" />
- <el-option label="鏈畬鎴愭崘鐚�" value="5" />
+ <el-option label="鏈畬鎴愭崘鐚�" value="5" /> -->
+ <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-form-item
+ align="left"
+ label="鎮h�呮崘鐚姸鎬�"
+ prop="donationcategory"
+ >
+ <el-radio-group v-model="form.recordstate">
+ <el-radio
+ v-for="dict in dict.type.sys_DonationCategory || []"
+ :key="dict.value"
+ :label="dict.value"
+ >{{ dict.label }}</el-radio
+ >
+ </el-radio-group>
+ </el-form-item> -->
</el-col>
<el-col :span="8">
<el-form-item
label="鏈畬鎴愬師鍥�"
prop="incompleteReason"
- v-if="form.patientStatus === '5'"
+ v-if="form.recordstate === '5'"
>
<el-input
v-model="form.incompleteReason"
- :readonly="!isEdit"
placeholder="璇疯緭鍏ユ湭瀹屾垚鎹愮尞鐨勫師鍥�"
/>
</el-form-item>
@@ -91,59 +97,59 @@
<el-row :gutter="20">
<el-col :span="8">
- <el-form-item label="鍏ラ櫌鏃堕棿" prop="admissionTime">
+ <el-form-item label="涓婃姤鏃堕棿" prop="reporttime">
<el-date-picker
- v-model="form.admissionTime"
+ v-model="form.reporttime"
type="datetime"
value-format="yyyy-MM-dd HH:mm:ss"
style="width: 100%"
- :disabled="!isEdit"
/>
</el-form-item>
</el-col>
<el-col :span="8">
- <el-form-item label="鍑洪櫌鏃堕棿" prop="dischargeTime">
+ <el-form-item label="姝讳骸鏃堕棿" prop="deathTime">
<el-date-picker
- v-model="form.dischargeTime"
+ v-model="form.deathTime"
type="datetime"
value-format="yyyy-MM-dd HH:mm:ss"
style="width: 100%"
- :disabled="!isEdit"
/>
</el-form-item>
</el-col>
<el-col :span="8">
- <el-form-item label="鍗忚皟鍛�" prop="coordinator">
- <el-input v-model="form.coordinator" :readonly="!isEdit" />
+ <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"
- :disabled="!isEdit"
- style="width: 100%"
- >
- <el-option label="A鍨�" value="A" />
+ <el-form-item label="琛�鍨�" prop="bloodtype">
+ <el-select v-model="form.bloodtype" style="width: 100%">
+ <!-- <el-option label="A鍨�" value="A" />
<el-option label="B鍨�" value="B" />
<el-option label="O鍨�" value="O" />
- <el-option label="AB鍨�" value="AB" />
+ <el-option label="AB鍨�" value="AB" /> -->
+ <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鍥犲瓙" prop="rhFactor">
- <el-select
- v-model="form.rhFactor"
- :disabled="!isEdit"
- style="width: 100%"
- >
- <el-option label="闃虫��" value="positive" />
- <el-option label="闃存��" value="negative" />
- </el-select>
+ <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>
@@ -153,12 +159,12 @@
type="textarea"
:rows="3"
v-model="form.specialMedicalHistory"
- :readonly="!isEdit"
placeholder="璁板綍鐗规畩鐥呭彶淇℃伅"
/>
</el-form-item>
</el-form>
</el-card>
+
<el-card class="assessment-card">
<div slot="header" class="clearfix">
<span class="detail-title">渚涜�呰瘎浼板悇椤硅褰�</span>
@@ -193,14 +199,7 @@
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"
@@ -216,7 +215,6 @@
</el-tag>
</template>
</el-table-column>
- <!-- 闄勪欢鍒� -->
<el-table-column label="闄勪欢" align="center">
<template slot-scope="scope">
<el-button
@@ -257,14 +255,6 @@
</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>
@@ -272,6 +262,7 @@
<el-tab-pane label="鑲濆姛鑳借偩鍔熻兘" name="liverKidney">
<liver-kidney-panel
ref="liverKidney"
+ :initial-data="assessmentData.liverKidney"
:is-editing="isEdit && activeTab === 'liverKidney'"
@data-change="handleLiverKidneyDataChange"
/>
@@ -281,6 +272,7 @@
<el-tab-pane label="琛�甯歌" name="bloodRoutine">
<blood-routine-panel
ref="bloodRoutine"
+ :initial-data="assessmentData.bloodRoutine"
:is-editing="isEdit && activeTab === 'bloodRoutine'"
@data-change="handleBloodRoutineDataChange"
/>
@@ -290,15 +282,15 @@
<el-tab-pane label="灏垮父瑙�" name="urineRoutine">
<urine-routine-panel
ref="urineRoutine"
+ :initial-data="assessmentData.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>
@@ -332,7 +324,6 @@
min-width="200"
show-overflow-tooltip
/>
- <!-- 闄勪欢鍒� -->
<el-table-column label="闄勪欢" align="center" width="120">
<template slot-scope="scope">
<el-button
@@ -352,32 +343,27 @@
width="180"
class-name="small-padding fixed-width"
>
- <el-button
- size="mini"
- type="text"
- icon="el-icon-edit"
- @click="handleEditRecord(scope.row)"
- >缂栬緫</el-button
- >
- <el-button
- size="mini"
- type="text"
- icon="el-icon-delete"
- style="color: #F56C6C;"
- @click="handleDeleteRecord(scope.row)"
- >鍒犻櫎</el-button
- >
+ <template slot-scope="scope">
+ <el-button
+ size="mini"
+ type="text"
+ icon="el-icon-edit"
+ @click="handleEditRecord(scope.row)"
+ >缂栬緫</el-button
+ >
+ <el-button
+ size="mini"
+ type="text"
+ icon="el-icon-delete"
+ style="color: #F56C6C;"
+ @click="handleDeleteRecord(scope.row)"
+ >鍒犻櫎</el-button
+ >
+ </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>
+
<!-- 鍩瑰吇璁板綍缂栬緫瀵硅瘽妗� -->
<el-dialog
:title="cultureDialogTitle"
@@ -436,7 +422,6 @@
</el-col>
</el-row>
- <!-- 闄勪欢涓婁紶 -->
<el-form-item label="闄勪欢">
<upload-attachment
:file-list="cultureForm.attachments"
@@ -500,7 +485,6 @@
/>
</el-form-item>
- <!-- 闄勪欢涓婁紶 -->
<el-form-item label="闄勪欢">
<upload-attachment
:file-list="recordForm.attachments"
@@ -531,19 +515,7 @@
</template>
<script>
-import { getMaintenanceDetail, updateMaintenance } from "./mockMaintenanceApi";
-import {
- listCultureResults,
- addCultureResult,
- updateCultureResult,
- deleteCultureResult
-} from "./mockMaintenanceApi";
-import {
- listNursingRecords,
- addNursingRecord,
- updateNursingRecord,
- deleteNursingRecord
-} from "./mockMaintenanceApi";
+import { maintainList, maintainedit, maintainAdd } from "@/api/businessApi";
import Pagination from "@/components/Pagination";
import UploadAttachment from "@/components/UploadAttachment";
import AttachmentPreview from "@/components/AttachmentPreview";
@@ -561,120 +533,44 @@
BloodRoutinePanel,
UrineRoutinePanel
},
+ dicts: [
+ "sys_donornode",
+ "sys_BloodType",
+ "sys_EthicalReview",
+ "sys_BaseAssessConclusion",
+ "sys_bloodtype_rhd",
+ "sys_DonationCategory"
+ ],
+
data() {
return {
- isEdit: true,
+ isEdit: false,
+ currentMaintenanceId: null,
+ isEditMode: false,
form: {
id: undefined,
caseNo: "",
- donorName: "",
+ name: "",
gender: "",
age: "",
- diagnosis: "",
- hospitalName: "",
- patientStatus: "1",
- admissionTime: "",
- dischargeTime: "",
- coordinator: "",
- bloodType: "",
+ diagnosisname: "",
+ treatmenthospitalname: "",
+ recordstate: "1",
+ reporttime: "",
+ deathTime: "",
+ coordinatorName: "",
+ bloodtype: "",
rhFactor: "",
specialMedicalHistory: "",
incompleteReason: ""
},
activeTab: "culture",
+ liverKidneyData: {}, // 浠� maintainList 鎺ュ彛鑾峰彇鐨勬暟鎹�
+ bloodRoutineData: {}, // 浠� maintainList 鎺ュ彛鑾峰彇鐨勬暟鎹�
+ liverKidneyData: {}, // 浠� maintainList 鎺ュ彛鑾峰彇鐨勬暟鎹�
// 鍩瑰吇缁撴灉鐩稿叧鏁版嵁
- // 鍩瑰吇缁撴灉鐩稿叧鏁版嵁
- cultureList: [
- {
- 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"
- }
- ]
- },
- {
- id: 3,
- cultureType: "琛�鍩瑰吇",
- sampleTime: "2024-12-20 09:15:00",
- result: "闃存��",
- bacteria: "",
- drugSensitivity: "",
- testingInstitution: "骞垮窞妫�娴嬩腑蹇�",
- specimenType: "灏挎恫",
- remarks: "娓呮磥涓灏挎爣鏈�",
- attachments: []
- },
- {
- 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"
- }
- ]
- }
- ],
+ cultureList: [],
cultureLoading: false,
- cultureTotal: 5,
- cultureQueryParams: {
- pageNum: 1,
- pageSize: 10
- },
cultureDialogVisible: false,
cultureDialogTitle: "",
cultureSaveLoading: false,
@@ -683,7 +579,7 @@
cultureType: "",
sampleTime: "",
result: "闃存��",
- attachments: [] // 鏂板闄勪欢瀛楁
+ attachments: []
},
cultureRules: {
cultureType: [
@@ -706,120 +602,8 @@
],
// 鎶ょ悊鏍告煡璁板綍鐩稿叧鏁版嵁
- recordList: [
- {
- 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"
- }
- ]
- },
- {
- 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: []
- },
- {
- 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"
- }
- ]
- }
- ],
+ recordList: [],
recordLoading: false,
- recordTotal: 4,
- recordQueryParams: {
- pageNum: 1,
- pageSize: 10
- },
recordDialogVisible: false,
recordDialogTitle: "",
recordSaveLoading: false,
@@ -827,8 +611,8 @@
id: undefined,
recordTime: "",
recorder: "",
- checkRecord: "", // 鏀逛负鍗曞瓧娈佃褰�
- attachments: [] // 鏂板闄勪欢瀛楁
+ checkRecord: "",
+ attachments: []
},
recordRules: {
recordTime: [
@@ -845,87 +629,152 @@
// 闄勪欢棰勮鐩稿叧
attachmentPreviewVisible: false,
currentAttachmentList: [],
- attachmentPreviewTitle: ""
+ attachmentPreviewTitle: "",
+
+ // 璇勪及鏁版嵁瀛樺偍
+ assessmentData: {
+ liverKidney: {},
+ bloodRoutine: {},
+ urineRoutine: {},
+ cultureResults: [],
+ nursingRecords: []
+ }
};
},
created() {
- const id = this.$route.query.id;
- // this.isEdit = this.$route.query.edit === "true";
- if (id) {
- this.getDetail(id);
- this.getCultureList();
- this.getRecordList();
+ this.loadMaintenanceData();
+ },
+ watch: {
+ $route(to, from) {
+ this.loadMaintenanceData();
}
},
methods: {
- // 鑾峰彇璇︽儏
- getDetail(id) {
- getMaintenanceDetail(id).then(response => {
+ // 鍔犺浇缁存姢鏁版嵁[1,3](@ref)
+ async loadMaintenanceData() {
+ try {
+ this.cultureLoading = true;
+ this.recordLoading = true;
+
+ const { id, infoid } = this.$route.query;
+ const queryParams = {};
+
+ if (id) {
+ queryParams.id = id;
+ this.currentMaintenanceId = id;
+ this.isEditMode = true;
+ } else if (infoid) {
+ queryParams.infoid = infoid;
+ this.currentMaintenanceId = null;
+ this.isEditMode = false;
+ } else {
+ this.$message.error("缂哄皯蹇呰鐨勮矾鐢卞弬鏁�");
+ return;
+ }
+
+ const response = await maintainList(queryParams);
if (response.code === 200) {
- this.form = response.data;
- }
- });
- },
- // 鍩瑰吇璁板綍闄勪欢鍙樻洿
- handleCultureAttachmentChange(fileList) {
- this.cultureForm.attachments = fileList;
- },
+ let maintenanceData = response.data[0];
- // 鎶ょ悊璁板綍闄勪欢鍙樻洿
- 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;
+ // 澶勭悊鏁扮粍鍝嶅簲
+ if (Array.isArray(maintenanceData)) {
+ maintenanceData = maintenanceData[0] || {};
}
- this.cultureLoading = false;
- })
- .catch(() => {
- this.cultureLoading = false;
- });
+
+ // 瑙f瀽itemDesc瀛楁涓殑JSON鏁版嵁[6,8](@ref)
+ if (maintenanceData.itemDesc) {
+ try {
+ const itemDescData = JSON.parse(maintenanceData.itemDesc);
+ this.assessmentData = { ...this.assessmentData, ...itemDescData };
+
+ // 濉厖鍚勪釜妯″潡鐨勬暟鎹�
+ if (itemDescData.cultureResults) {
+ this.cultureList = itemDescData.cultureResults;
+ }
+ if (itemDescData.nursingRecords) {
+ this.recordList = itemDescData.nursingRecords;
+ }
+ if (itemDescData.liverKidney) {
+ this.assessmentData.liverKidney = itemDescData.liverKidney;
+ }
+ if (itemDescData.bloodRoutine) {
+ this.assessmentData.bloodRoutine = itemDescData.bloodRoutine;
+ }
+ if (itemDescData.urineRoutine) {
+ this.assessmentData.urineRoutine = itemDescData.urineRoutine;
+ }
+ } catch (error) {
+ console.error("瑙f瀽itemDesc JSON澶辫触:", error);
+ }
+ }
+
+ // 濉厖鍩虹琛ㄥ崟鏁版嵁
+ this.form = { ...this.form, ...maintenanceData };
+ this.$message.success("鏁版嵁鍔犺浇鎴愬姛");
+ } else {
+ this.$message.error("鏁版嵁鍔犺浇澶辫触锛�" + (response.msg || "鏈煡閿欒"));
+ }
+ } catch (error) {
+ console.error("鍔犺浇缁存姢鏁版嵁澶辫触:", error);
+ this.$message.error("鏁版嵁鍔犺浇澶辫触");
+ } finally {
+ this.cultureLoading = false;
+ this.recordLoading = false;
+ }
},
+ // 淇濆瓨鎵�鏈夋暟鎹甗1,2](@ref)
+ async handleSave() {
+ try {
+ // 鏋勫缓淇濆瓨鏁版嵁
+ const saveData = {
+ ...this.form,
+ itemDesc: JSON.stringify({
+ liverKidney: this.assessmentData.liverKidney,
+ bloodRoutine: this.assessmentData.bloodRoutine,
+ urineRoutine: this.assessmentData.urineRoutine,
+ cultureResults: this.cultureList,
+ nursingRecords: this.recordList
+ })
+ };
+
+ let response;
+ if (this.isEditMode && this.currentMaintenanceId) {
+ // 缂栬緫妯″紡锛岃皟鐢╩aintainedit鎺ュ彛[1](@ref)
+ saveData.id = this.currentMaintenanceId;
+ response = await maintainedit(saveData);
+ } else {
+ // 鏂板妯″紡锛岃皟鐢╩aintainAdd鎺ュ彛[2](@ref)
+ response = await maintainAdd(saveData);
+ }
+
+ if (response.code === 200) {
+ this.$message.success("淇濆瓨鎴愬姛");
+ this.isEdit = false;
+
+ // 濡傛灉鏄柊澧炰繚瀛橈紝鏇存柊褰撳墠ID
+ if (!this.isEditMode && response.data && response.data.id) {
+ this.currentMaintenanceId = response.data.id;
+ this.isEditMode = true;
+ }
+ } else {
+ this.$message.error("淇濆瓨澶辫触锛�" + (response.msg || "鏈煡閿欒"));
+ }
+ } catch (error) {
+ console.error("淇濆瓨鏁版嵁澶辫触:", error);
+ this.$message.error("淇濆瓨澶辫触");
+ }
+ },
+
+ // 鍒囨崲缂栬緫妯″紡
+ toggleEditMode() {
+ this.isEdit = !this.isEdit;
+ if (!this.isEdit) {
+ this.handleSave();
+ }
+ },
+
+ // 鍩瑰吇璁板綍鐩稿叧鏂规硶
handleAddCulture() {
this.cultureDialogTitle = "鏂板鍩瑰吇璁板綍";
this.cultureForm = {
@@ -933,11 +782,7 @@
cultureType: "",
sampleTime: "",
result: "闃存��",
- bacteria: "",
- drugSensitivity: "",
- testingInstitution: "",
- specimenType: "",
- remarks: ""
+ attachments: []
};
this.cultureDialogVisible = true;
this.$nextTick(() => {
@@ -954,70 +799,28 @@
});
},
- 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;
- });
+ if (this.cultureForm.id) {
+ // 缂栬緫鐜版湁璁板綍
+ const index = this.cultureList.findIndex(
+ item => item.id === this.cultureForm.id
+ );
+ if (index !== -1) {
+ this.cultureList.splice(index, 1, { ...this.cultureForm });
+ }
+ } else {
+ // 鏂板璁板綍
+ this.cultureForm.id = Date.now();
+ this.cultureList.push({ ...this.cultureForm });
+ }
+
+ this.$message.success(this.cultureForm.id ? "淇敼鎴愬姛" : "鏂板鎴愬姛");
+ this.cultureDialogVisible = false;
+ this.cultureSaveLoading = false;
}
});
},
@@ -1029,37 +832,15 @@
type: "warning"
})
.then(() => {
- deleteCultureResult(row.id).then(response => {
- if (response.code === 200) {
- this.$message.success("鍒犻櫎鎴愬姛");
- this.getCultureList();
- }
- });
+ this.cultureList = this.cultureList.filter(
+ item => item.id !== row.id
+ );
+ this.$message.success("鍒犻櫎鎴愬姛");
})
.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 = {
@@ -1068,15 +849,9 @@
.toISOString()
.replace("T", " ")
.substring(0, 19),
- recorder: "褰撳墠鐢ㄦ埛", // 瀹為檯椤圭洰涓粠鐢ㄦ埛淇℃伅鑾峰彇
- temperature: 36.5,
- heartRate: 80,
- bloodPressure: "120/80",
- respirationRate: 18,
- oxygenSaturation: 98,
- urineOutput: 50,
- cvp: 8,
- remarks: ""
+ recorder: "褰撳墠鐢ㄦ埛",
+ checkRecord: "",
+ attachments: []
};
this.recordDialogVisible = true;
this.$nextTick(() => {
@@ -1093,58 +868,28 @@
});
},
- 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;
- });
+ if (this.recordForm.id) {
+ // 缂栬緫鐜版湁璁板綍
+ const index = this.recordList.findIndex(
+ item => item.id === this.recordForm.id
+ );
+ if (index !== -1) {
+ this.recordList.splice(index, 1, { ...this.recordForm });
+ }
+ } else {
+ // 鏂板璁板綍
+ this.recordForm.id = Date.now();
+ this.recordList.push({ ...this.recordForm });
+ }
+
+ this.$message.success(this.recordForm.id ? "淇敼鎴愬姛" : "鏂板鎴愬姛");
+ this.recordDialogVisible = false;
+ this.recordSaveLoading = false;
}
});
},
@@ -1156,26 +901,59 @@
type: "warning"
})
.then(() => {
- deleteNursingRecord(row.id).then(response => {
- if (response.code === 200) {
- this.$message.success("鍒犻櫎鎴愬姛");
- this.getRecordList();
- }
- });
+ this.recordList = this.recordList.filter(item => item.id !== row.id);
+ this.$message.success("鍒犻櫎鎴愬姛");
})
.catch(() => {});
},
- // 淇濆瓨鍩烘湰淇℃伅
- handleSave() {
- this.$refs.form.validate(valid => {
- if (valid) {
- updateMaintenance(this.form).then(response => {
- if (response.code === 200) {
- this.$message.success("淇濆瓨鎴愬姛");
- this.isEdit = false;
- }
- });
+ // 闄勪欢鐩稿叧鏂规硶
+ handleCultureAttachmentChange(fileList) {
+ this.cultureForm.attachments = fileList;
+ },
+
+ handleRecordAttachmentChange(fileList) {
+ this.recordForm.attachments = fileList;
+ },
+
+ handleViewCultureAttachments(row) {
+ this.currentAttachmentList = row.attachments || [];
+ this.attachmentPreviewTitle = `鍩瑰吇璁板綍闄勪欢 - ${row.cultureType}`;
+ this.attachmentPreviewVisible = true;
+ },
+
+ handleViewRecordAttachments(row) {
+ this.currentAttachmentList = row.attachments || [];
+ this.attachmentPreviewTitle = `鎶ょ悊鏍告煡璁板綍闄勪欢 - ${row.recorder}`;
+ this.attachmentPreviewVisible = true;
+ },
+
+ // 璇勪及鏁版嵁鍙樻洿澶勭悊
+ handleLiverKidneyDataChange(data) {
+ this.assessmentData.liverKidney = data;
+ },
+
+ handleBloodRoutineDataChange(data) {
+ this.assessmentData.bloodRoutine = data;
+ },
+
+ handleUrineRoutineDataChange(data) {
+ this.assessmentData.urineRoutine = data;
+ },
+
+ handleTabClick(tab) {
+ this.$nextTick(() => {
+ let tableRef = null;
+ if (tab.name === "liverKidney") {
+ tableRef = this.$refs.liverKidney;
+ } else if (tab.name === "bloodRoutine") {
+ tableRef = this.$refs.bloodRoutine;
+ } else if (tab.name === "urineRoutine") {
+ tableRef = this.$refs.urineRoutine;
+ }
+
+ if (tableRef && tableRef.doLayout) {
+ tableRef.doLayout();
}
});
}
@@ -1192,92 +970,25 @@
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%;
+.record-card {
margin-bottom: 20px;
}
-.dynamic-column {
- min-width: 120px;
+.detail-title {
+ font-size: 16px;
+ font-weight: bold;
+ margin-right: 20px;
}
+
+.culture-card {
+ margin-bottom: 20px;
+}
+
.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