From 96dd34f77d81db58f54e3d0ad4a8cc8082189a61 Mon Sep 17 00:00:00 2001
From: WXL <wl_5969728@163.com>
Date: 星期四, 16 四月 2026 13:52:27 +0800
Subject: [PATCH] 考勤相关更改
---
src/views/business/maintain/maintainInfo.vue | 1296 +++++++++++++++++++++++++++++-----------------------------
1 files changed, 640 insertions(+), 656 deletions(-)
diff --git a/src/views/business/maintain/maintainInfo.vue b/src/views/business/maintain/maintainInfo.vue
index 3bfd5bb..c530732 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>
@@ -17,22 +12,18 @@
<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" :readonly="!isEdit" />
+ <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="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,34 +34,31 @@
<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-option label="DBD" value="2" />
- <el-option label="DBCD" value="3" />
- <el-option label="宸插畬鎴愭崘鐚�" value="4" />
- <el-option label="鏈畬鎴愭崘鐚�" value="5" />
+ <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>
@@ -78,11 +66,10 @@
<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 +78,55 @@
<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-option label="B鍨�" value="B" />
- <el-option label="O鍨�" value="O" />
- <el-option label="AB鍨�" value="AB" />
+ <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鍥犲瓙" 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 +136,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 +176,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 +192,6 @@
</el-tag>
</template>
</el-table-column>
- <!-- 闄勪欢鍒� -->
<el-table-column label="闄勪欢" align="center">
<template slot-scope="scope">
<el-button
@@ -257,14 +232,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 +239,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 +249,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 +259,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 +301,6 @@
min-width="200"
show-overflow-tooltip
/>
- <!-- 闄勪欢鍒� -->
<el-table-column label="闄勪欢" align="center" width="120">
<template slot-scope="scope">
<el-button
@@ -352,32 +320,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,11 +399,17 @@
</el-col>
</el-row>
- <!-- 闄勪欢涓婁紶 -->
<el-form-item label="闄勪欢">
- <upload-attachment
- :file-list="cultureForm.attachments"
+ <UploadAttachment
+ ref="cultureUploadAttachment"
+ :file-list="cultureFileList"
+ :limit="10"
+ :accept="attachmentAccept"
+ :multiple="true"
@change="handleCultureAttachmentChange"
+ @upload-success="handleCultureUploadSuccess"
+ @upload-error="handleCultureUploadError"
+ @remove="handleCultureAttachmentRemove"
/>
</el-form-item>
</el-form>
@@ -500,11 +469,17 @@
/>
</el-form-item>
- <!-- 闄勪欢涓婁紶 -->
<el-form-item label="闄勪欢">
- <upload-attachment
- :file-list="recordForm.attachments"
+ <UploadAttachment
+ ref="recordUploadAttachment"
+ :file-list="recordFileList"
+ :limit="10"
+ :accept="attachmentAccept"
+ :multiple="true"
@change="handleRecordAttachmentChange"
+ @upload-success="handleRecordUploadSuccess"
+ @upload-error="handleRecordUploadError"
+ @remove="handleRecordAttachmentRemove"
/>
</el-form-item>
</el-form>
@@ -521,160 +496,128 @@
</el-dialog>
<!-- 闄勪欢棰勮瀵硅瘽妗� -->
- <attachment-preview
- :visible="attachmentPreviewVisible"
- :file-list="currentAttachmentList"
+ <el-dialog
:title="attachmentPreviewTitle"
- @close="attachmentPreviewVisible = false"
+ :visible.sync="attachmentPreviewVisible"
+ width="900px"
+ @close="handleAttachmentPreviewClose"
+ >
+ <el-table :data="currentAttachmentList" style="width: 100%" size="small">
+ <el-table-column label="鏂囦欢鍚�" min-width="200">
+ <template slot-scope="scope">
+ <i
+ class="el-icon-document"
+ :style="{ color: getFileIconColor(scope.row.fileName) }"
+ ></i>
+ <span class="file-name">{{ scope.row.fileName }}</span>
+ </template>
+ </el-table-column>
+ <el-table-column label="鏂囦欢绫诲瀷" width="100">
+ <template slot-scope="scope">
+ <el-tag :type="getFileTagType(scope.row.fileName)" size="small">
+ {{ getFileTypeText(scope.row.fileName) }}
+ </el-tag>
+ </template>
+ </el-table-column>
+ <el-table-column label="涓婁紶鏃堕棿" width="160">
+ <template slot-scope="scope">
+ <span>{{ formatDateTime(scope.row.uploadTime) }}</span>
+ </template>
+ </el-table-column>
+ <el-table-column label="鏂囦欢澶у皬" width="100">
+ <template slot-scope="scope">
+ <span>{{ formatFileSize(scope.row.fileSize) }}</span>
+ </template>
+ </el-table-column>
+ <el-table-column label="鎿嶄綔" width="150" fixed="right">
+ <template slot-scope="scope">
+ <el-button
+ size="mini"
+ type="primary"
+ @click="handlePreviewAttachment(scope.row)"
+ :disabled="!isPreviewable(scope.row.fileName)"
+ >
+ 棰勮
+ </el-button>
+ <el-button
+ size="mini"
+ type="success"
+ @click="handleDownloadAttachment(scope.row)"
+ >
+ 涓嬭浇
+ </el-button>
+ </template>
+ </el-table-column>
+ </el-table>
+ </el-dialog>
+
+ <!-- 鏂囦欢棰勮寮圭獥 -->
+ <FilePreviewDialog
+ :visible="filePreviewVisible"
+ :file="currentPreviewFile"
+ @close="filePreviewVisible = false"
+ @download="handleDownloadAttachment"
/>
</div>
</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";
-import LiverKidneyPanel from "./components/LiverKidneyPanel.vue";
-import BloodRoutinePanel from "./components/BloodRoutinePanel.vue";
-import UrineRoutinePanel from "./components/UrineRoutinePanel.vue";
+import FilePreviewDialog from "@/components/FilePreviewDialog";
+import LiverKidneyPanel from "@/components/MaintainComponents/LiverKidneyPanel.vue";
+import BloodRoutinePanel from "@/components/MaintainComponents/BloodRoutinePanel.vue";
+import UrineRoutinePanel from "@/components/MaintainComponents/UrineRoutinePanel.vue";
+import dayjs from "dayjs";
export default {
name: "MaintenanceDetail",
components: {
Pagination,
UploadAttachment,
- AttachmentPreview,
+ FilePreviewDialog,
LiverKidneyPanel,
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",
- // 鍩瑰吇缁撴灉鐩稿叧鏁版嵁
- // 鍩瑰吇缁撴灉鐩稿叧鏁版嵁
- 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"
- }
- ]
- },
+ extracontentinfo: {},
- {
- 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,8 +626,9 @@
cultureType: "",
sampleTime: "",
result: "闃存��",
- attachments: [] // 鏂板闄勪欢瀛楁
+ attachments: []
},
+ cultureFileList: [],
cultureRules: {
cultureType: [
{ required: true, message: "璇烽�夋嫨鍩瑰吇绫诲瀷", trigger: "change" }
@@ -706,120 +650,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,9 +659,10 @@
id: undefined,
recordTime: "",
recorder: "",
- checkRecord: "", // 鏀逛负鍗曞瓧娈佃褰�
- attachments: [] // 鏂板闄勪欢瀛楁
+ checkRecord: "",
+ attachments: []
},
+ recordFileList: [],
recordRules: {
recordTime: [
{ required: true, message: "璇烽�夋嫨鏍告煡鏃堕棿", trigger: "change" }
@@ -845,87 +678,162 @@
// 闄勪欢棰勮鐩稿叧
attachmentPreviewVisible: false,
currentAttachmentList: [],
- attachmentPreviewTitle: ""
+ attachmentPreviewTitle: "",
+
+ // 鏂囦欢棰勮鐩稿叧
+ filePreviewVisible: false,
+ currentPreviewFile: null,
+
+ // 闄勪欢鐩稿叧閰嶇疆
+ attachmentLimit: 10,
+ attachmentAccept: ".pdf,.jpg,.jpeg,.png,.doc,.docx,.xls,.xlsx,.ppt,.pptx,.txt",
+
+ // 璇勪及鏁版嵁瀛樺偍
+ 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 => {
+ // 鍔犺浇缁存姢鏁版嵁
+ async loadMaintenanceData() {
+ try {
+ this.cultureLoading = true;
+ this.recordLoading = true;
+
+ const { id, infoid } = this.$route.query;
+ const queryParams = {};
+
+ if (id) {
+ queryParams.infoid = infoid;
+ this.currentMaintenanceId = id;
+ this.isEditMode = true;
+ } else if (infoid) {
+ queryParams.infoid = infoid;
+ this.currentMaintenanceId = null;
+ this.isEditMode = false;
+ } else {
+ this.$message.error("缂哄皯蹇呰鐨勮矾鐢卞弬鏁�");
+ return;
+ }
+
+ queryParams.infoid = infoid;
+ 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;
- });
+ if (maintenanceData.extracontent) {
+ this.extracontentinfo = JSON.parse(maintenanceData.extracontent);
+ if (this.extracontentinfo.specialMedicalHistory) {
+ this.form.specialMedicalHistory = this.extracontentinfo.specialMedicalHistory;
+ }
+ }
+
+ if (maintenanceData.itemDesc) {
+ try {
+ const itemDescData = 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;
+ }
},
+ // 淇濆瓨鎵�鏈夋暟鎹�
+ async handleSave() {
+ try {
+ const saveData = {
+ ...this.form,
+ itemDesc: {
+ liverKidney: this.assessmentData.liverKidney,
+ bloodRoutine: this.assessmentData.bloodRoutine,
+ urineRoutine: this.assessmentData.urineRoutine,
+ cultureResults: this.cultureList,
+ nursingRecords: this.recordList
+ }
+ };
+ this.extracontentinfo.specialMedicalHistory = this.form.specialMedicalHistory;
+ let response;
+ if (this.isEditMode && this.currentMaintenanceId) {
+ saveData.id = this.currentMaintenanceId;
+ response = await maintainedit(saveData);
+ } else {
+ response = await maintainAdd(saveData);
+ }
+
+ if (response.code === 200) {
+ this.$message.success("淇濆瓨鎴愬姛");
+ this.isEdit = false;
+ this.donatebaseinfoEdit({
+ id: this.$route.query.infoid,
+ extracontent: JSON.stringify(this.extracontentinfo)
+ });
+ 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,12 +841,9 @@
cultureType: "",
sampleTime: "",
result: "闃存��",
- bacteria: "",
- drugSensitivity: "",
- testingInstitution: "",
- specimenType: "",
- remarks: ""
+ attachments: []
};
+ this.cultureFileList = [];
this.cultureDialogVisible = true;
this.$nextTick(() => {
this.$refs.cultureForm && this.$refs.cultureForm.clearValidate();
@@ -948,76 +853,40 @@
handleEditCulture(row) {
this.cultureDialogTitle = "缂栬緫鍩瑰吇璁板綍";
this.cultureForm = { ...row };
+ this.cultureFileList = row.attachments ? row.attachments.map(item => ({
+ uid: item.id || Math.random(),
+ name: item.fileName,
+ fileSize: item.fileSize,
+ url: item.path || item.fileUrl,
+ uploadTime: item.uploadTime,
+ status: "success"
+ })) : [];
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;
- });
+ 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 +898,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,16 +915,11 @@
.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.recordFileList = [];
this.recordDialogVisible = true;
this.$nextTick(() => {
this.$refs.recordForm && this.$refs.recordForm.clearValidate();
@@ -1087,64 +929,40 @@
handleEditRecord(row) {
this.recordDialogTitle = "缂栬緫鎶ょ悊鏍告煡璁板綍";
this.recordForm = { ...row };
+ this.recordFileList = row.attachments ? row.attachments.map(item => ({
+ uid: item.id || Math.random(),
+ name: item.fileName,
+ fileSize: item.fileSize,
+ url: item.path || item.fileUrl,
+ uploadTime: item.uploadTime,
+ status: "success"
+ })) : [];
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;
- });
+ 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 +974,254 @@
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.cultureFileList = fileList;
+ },
+
+ handleCultureUploadSuccess({ file, fileList, response }) {
+ if (response.code === 200) {
+ const attachmentObj = {
+ fileName: file.name,
+ path: response.fileUrl || file.url,
+ fileUrl: response.fileUrl || file.url,
+ fileType: this.getFileExtension(file.name),
+ fileSize: file.size,
+ uploadTime: dayjs().format("YYYY-MM-DD HH:mm:ss")
+ };
+
+ if (!Array.isArray(this.cultureForm.attachments)) {
+ this.cultureForm.attachments = [];
+ }
+
+ this.cultureForm.attachments.push(attachmentObj);
+ this.cultureFileList = fileList;
+ this.$message.success("鏂囦欢涓婁紶鎴愬姛");
+ }
+ },
+
+ handleCultureUploadError({ file, fileList, error }) {
+ console.error("鍩瑰吇璁板綍闄勪欢涓婁紶澶辫触:", error);
+ this.$message.error("鏂囦欢涓婁紶澶辫触锛岃閲嶈瘯");
+ },
+
+ handleCultureAttachmentRemove(file) {
+ if (file.url) {
+ const index = this.cultureForm.attachments.findIndex(
+ item => item.path === file.url || item.fileUrl === file.url
+ );
+ if (index > -1) {
+ this.cultureForm.attachments.splice(index, 1);
+ this.$message.success("闄勪欢鍒犻櫎鎴愬姛");
+ }
+ }
+ },
+
+ // 鎶ょ悊璁板綍闄勪欢鐩稿叧鏂规硶
+ handleRecordAttachmentChange(fileList) {
+ this.recordFileList = fileList;
+ },
+
+ handleRecordUploadSuccess({ file, fileList, response }) {
+ if (response.code === 200) {
+ const attachmentObj = {
+ fileName: file.name,
+ path: response.fileUrl || file.url,
+ fileUrl: response.fileUrl || file.url,
+ fileType: this.getFileExtension(file.name),
+ fileSize: file.size,
+ uploadTime: dayjs().format("YYYY-MM-DD HH:mm:ss")
+ };
+
+ if (!Array.isArray(this.recordForm.attachments)) {
+ this.recordForm.attachments = [];
+ }
+
+ this.recordForm.attachments.push(attachmentObj);
+ this.recordFileList = fileList;
+ this.$message.success("鏂囦欢涓婁紶鎴愬姛");
+ }
+ },
+
+ handleRecordUploadError({ file, fileList, error }) {
+ console.error("鎶ょ悊璁板綍闄勪欢涓婁紶澶辫触:", error);
+ this.$message.error("鏂囦欢涓婁紶澶辫触锛岃閲嶈瘯");
+ },
+
+ handleRecordAttachmentRemove(file) {
+ if (file.url) {
+ const index = this.recordForm.attachments.findIndex(
+ item => item.path === file.url || item.fileUrl === file.url
+ );
+ if (index > -1) {
+ this.recordForm.attachments.splice(index, 1);
+ this.$message.success("闄勪欢鍒犻櫎鎴愬姛");
+ }
+ }
+ },
+
+ 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;
+ },
+
+ handleAttachmentPreviewClose() {
+ this.currentAttachmentList = [];
+ this.attachmentPreviewTitle = "";
+ },
+
+ handlePreviewAttachment(file) {
+ this.currentPreviewFile = {
+ fileName: file.fileName,
+ fileUrl: file.path || file.fileUrl,
+ fileType: this.getFileType(file.fileName)
+ };
+ this.filePreviewVisible = true;
+ },
+
+ handleDownloadAttachment(file) {
+ const fileUrl = file.path || file.fileUrl;
+ const fileName = file.fileName;
+
+ if (fileUrl) {
+ const link = document.createElement("a");
+ link.href = fileUrl;
+ link.download = fileName;
+ link.style.display = "none";
+ document.body.appendChild(link);
+ link.click();
+ document.body.removeChild(link);
+ this.$message.success("寮�濮嬩笅杞芥枃浠�");
+ } else {
+ this.$message.warning("鏂囦欢璺緞涓嶅瓨鍦紝鏃犳硶涓嬭浇");
+ }
+ },
+
+ /** 鑾峰彇鏂囦欢绫诲瀷 */
+ getFileType(fileName) {
+ if (!fileName) return "other";
+ const extension = fileName.split(".").pop().toLowerCase();
+ const imageTypes = ["jpg", "jpeg", "png", "gif", "bmp", "webp"];
+ const pdfTypes = ["pdf"];
+ const officeTypes = ["doc", "docx", "xls", "xlsx", "ppt", "pptx"];
+ if (imageTypes.includes(extension)) return "image";
+ if (pdfTypes.includes(extension)) return "pdf";
+ if (officeTypes.includes(extension)) return "office";
+ return "other";
+ },
+
+ /** 鑾峰彇鏂囦欢鍥炬爣棰滆壊 */
+ getFileIconColor(fileName) {
+ const type = this.getFileType(fileName);
+ const colorMap = {
+ image: "#67C23A",
+ pdf: "#F56C6C",
+ office: "#409EFF",
+ other: "#909399"
+ };
+ return colorMap[type] || "#909399";
+ },
+
+ /** 鑾峰彇鏂囦欢鏍囩绫诲瀷 */
+ getFileTagType(fileName) {
+ const type = this.getFileType(fileName);
+ const typeMap = {
+ image: "success",
+ pdf: "danger",
+ office: "primary",
+ other: "info"
+ };
+ return typeMap[type] || "info";
+ },
+
+ /** 鑾峰彇鏂囦欢绫诲瀷鏂囨湰 */
+ getFileTypeText(fileName) {
+ const type = this.getFileType(fileName);
+ const textMap = {
+ image: "鍥剧墖",
+ pdf: "PDF",
+ office: "鏂囨。",
+ other: "鍏朵粬"
+ };
+ return textMap[type] || "鏈煡";
+ },
+
+ /** 妫�鏌ユ槸鍚﹀彲棰勮 */
+ isPreviewable(fileName) {
+ const type = this.getFileType(fileName);
+ return ["image", "pdf"].includes(type);
+ },
+
+ /** 鑾峰彇鏂囦欢鎵╁睍鍚� */
+ getFileExtension(filename) {
+ return filename.split(".").pop().toLowerCase();
+ },
+
+ /** 鏍煎紡鍖栨枃浠跺ぇ灏� */
+ formatFileSize(bytes) {
+ if (!bytes || bytes === 0) return "0 B";
+ const k = 1024;
+ const sizes = ["B", "KB", "MB", "GB"];
+ const i = Math.floor(Math.log(bytes) / Math.log(k));
+ return parseFloat((bytes / Math.pow(k, i)).toFixed(2)) + " " + sizes[i];
+ },
+
+ /** 鏃ユ湡鏃堕棿鏍煎紡鍖� */
+ formatDateTime(dateTime) {
+ if (!dateTime) return "";
+ try {
+ const date = new Date(dateTime);
+ if (isNaN(date.getTime())) return dateTime;
+ const year = date.getFullYear();
+ const month = String(date.getMonth() + 1).padStart(2, "0");
+ const day = String(date.getDate()).padStart(2, "0");
+ const hours = String(date.getHours()).padStart(2, "0");
+ const minutes = String(date.getMinutes()).padStart(2, "0");
+ return `${year}-${month}-${day} ${hours}:${minutes}`;
+ } catch (error) {
+ return dateTime;
+ }
+ },
+
+ // 璇勪及鏁版嵁鍙樻洿澶勭悊
+ 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 +1238,30 @@
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;
+.file-name {
+ font-size: 13px;
+ margin-left: 8px;
}
</style>
--
Gitblit v1.9.3