From 45680b99ccdfb0d323088c57c237e0bc714a8e0b Mon Sep 17 00:00:00 2001
From: WXL <wl_5969728@163.com>
Date: 星期五, 13 三月 2026 09:21:32 +0800
Subject: [PATCH] 青岛opo维护
---
/dev/null | 1306 -------------------------
src/views/project/donatebaseinfo/EditCaseModal.vue | 362 ++++++
src/views/business/maintain/components/UrineRoutinePanel.vue | 324 +++++
src/views/business/assess/components/OrganAssessmentForm.vue | 2
src/views/project/DonationProcess/index.vue | 13
src/views/business/affirm/affirmInfo.vue | 10
src/views/business/maintain/maintainInfo.vue | 376 ++++++-
src/views/project/donatebaseinfo/index.vue | 1
src/views/business/maintain/components/BloodRoutinePanel.vue | 324 +++++
src/views/business/maintain/components/LiverKidneyPanel.vue | 362 ++++++
10 files changed, 1,592 insertions(+), 1,488 deletions(-)
diff --git a/src/views/business/affirm/affirmInfo.vue b/src/views/business/affirm/affirmInfo.vue
index 2d9be0c..9ed3c61 100644
--- a/src/views/business/affirm/affirmInfo.vue
+++ b/src/views/business/affirm/affirmInfo.vue
@@ -125,9 +125,9 @@
</el-form-item>
</el-col>
<el-col :span="6">
- <el-form-item label="涓庢崘璧犺�呭叧绯�" prop="familyrelations">
+ <el-form-item label="涓庢崘璧犺�呭叧绯�" prop="signfamilyrelations">
<el-select
- v-model="form.familyrelations"
+ v-model="form.signfamilyrelations"
placeholder="璇烽�夋嫨涓庢崘璧犺�呭叧绯�"
>
<el-option
@@ -370,7 +370,7 @@
relativeconfirmationsign: "0",
signdate: "",
relativeconfirmationsignname: "",
- familyrelations: "",
+ signfamilyrelations: "",
relativeidcardno: "",
relativephone: "",
relativeRemark: "",
@@ -498,7 +498,7 @@
signdate: detailData.signdate,
relativeconfirmationsignname:
detailData.relativeconfirmationsignname || "",
- familyrelations: detailData.familyrelations || "",
+ signfamilyrelations: detailData.signfamilyrelations || "",
relativeidcardno: detailData.relativeidcardno || "",
relativephone: detailData.relativephone || "",
relativeRemark: detailData.relativeRemark || "",
@@ -511,6 +511,8 @@
? detailData.organdecision
: detailData.organdecision.split(",");
}
+ console.log(this.organdecision,'this.organdecision');
+
// 澶勭悊闄勪欢鏁版嵁 - 浠巃ssessannex瀛楁瑙f瀽JSON骞舵寜绫诲瀷鍒嗙被
this.processAssessannexData();
diff --git a/src/views/business/assess/assessInfo copy.vue b/src/views/business/assess/assessInfo copy.vue
deleted file mode 100644
index eeed0d1..0000000
--- a/src/views/business/assess/assessInfo copy.vue
+++ /dev/null
@@ -1,1306 +0,0 @@
-<template>
- <div class="assessment-detail">
- <el-card class="basic-info-card">
- <div slot="header" class="clearfix">
- <span>妗堜緥鍩烘湰淇℃伅</span>
- <el-button
- style="float: right; padding: 3px 0"
- type="text"
- @click="handleAttachmentPreview"
- >
- <i class="el-icon-folder-opened"></i> 鏌ョ湅闄勪欢
- </el-button>
- </div>
-
- <el-descriptions :column="2" border>
- <el-descriptions-item label="浣忛櫌鍙�">{{
- assessmentData.caseNo
- }}</el-descriptions-item>
- <el-descriptions-item label="娼滃湪鎹愮尞鑰呭鍚�">{{
- assessmentData.name || assessmentData.donorName
- }}</el-descriptions-item>
- <el-descriptions-item label="鎬у埆">
- <dict-tag
- :options="dict.type.sys_user_sex"
- :value="assessmentData.sex"
- />
- </el-descriptions-item>
- <el-descriptions-item label="骞撮緞"
- >{{ assessmentData.age }}宀�</el-descriptions-item
- >
- <el-descriptions-item label="琛�鍨�">
- {{ assessmentData.bloodtype }}
- </el-descriptions-item>
- <el-descriptions-item label="璇佷欢鍙风爜">{{
- assessmentData.idcardno
- }}</el-descriptions-item>
- <el-descriptions-item label="鐤剧梾璇婃柇">{{
- assessmentData.diagnosisname
- }}</el-descriptions-item>
- <el-descriptions-item label="鎵�鍦ㄥ尰鐤楁満鏋�">{{
- assessmentData.treatmenthospitalname
- }}</el-descriptions-item>
- <el-descriptions-item label="鍗忚皟鍛�">{{
- assessmentData.coordinatorName
- }}</el-descriptions-item>
- <el-descriptions-item label="璇勪及鏃堕棿">{{
- assessmentData.assessTime
- }}</el-descriptions-item>
- <el-descriptions-item label="璇勪及鐘舵��">
- <el-tag :type="statusFilter(assessmentData.assessState)">
- {{ statusTextFilter(assessmentData.assessState) }}
- </el-tag>
- </el-descriptions-item>
- </el-descriptions>
- </el-card>
-
- <el-card class="organ-assessment-card">
- <div slot="header" class="clearfix">
- <span>鍣ㄥ畼璇勪及琛�</span>
- <el-button
- v-if="isCoordinator && allOrgansAssessed"
- style="float: right; margin-left: 10px"
- type="primary"
- size="mini"
- @click="handleCompleteAssessment"
- :loading="saveLoading"
- >
- 纭瀹屾垚璇勪及
- </el-button>
- <span v-if="!isCoordinator" class="jstitle">
- 褰撳墠瑙掕壊锛歿{ currentDepartment }}璇勪及浜哄憳
- </span>
- </div>
-
- <!-- 鎹愮尞鍐冲畾琛ㄥ崟 -->
- <el-form>
- <el-form-item label-width="100px" label="鎹愮尞鍐冲畾">
- <el-checkbox-group
- v-model="organdecisionValues"
- @change="handleOrganDecisionChange"
- :disabled="!isEdit"
- >
- <el-checkbox
- v-for="dict in dict.type.sys_Organ"
- :key="dict.value"
- :label="dict.value"
- >{{ dict.label }}
- </el-checkbox>
- </el-checkbox-group>
- <el-input
- v-if="showOtherInput"
- v-model="organdecisionOther"
- placeholder="璇疯緭鍏ュ叾浠栨崘鐚喅瀹氱殑鍏蜂綋鍐呭"
- style="margin-top: 10px; width: 300px;"
- :readonly="!isEdit"
- @input="handleOtherDecisionInput"
- ></el-input>
- </el-form-item>
- </el-form>
-
- <!-- 鍣ㄥ畼璇勪及琛ㄦ牸 -->
- <el-table
- :data="filteredOrganAssessmentList"
- v-loading="assessmentLoading"
- style="width: 100%"
- :row-class-name="getRowClassName"
- :expand-row-keys="expandedRowKeys"
- @expand-change="handleExpandChange"
- row-key="organno"
- empty-text="褰撳墠鎹愮尞鍐冲畾涓嬫殏鏃犻渶瑕佽瘎浼扮殑鍣ㄥ畼"
- >
- <el-table-column type="expand">
- <template slot-scope="scope">
- <div class="organ-expand-content" v-if="scope.row.expanded">
- <el-tabs
- v-model="scope.row.activeTab"
- type="card"
- class="organ-detail-tabs"
- @tab-click="handleTabClick(scope.row, $event)"
- >
- <!-- 鍔ㄦ�佺敓鎴愯瘎浼癟ab -->
- <el-tab-pane
- v-for="(assessment, index) in scope.row.assessments"
- :key="`${scope.row.organno}_${index}`"
- :label="`绗�${index + 1}娆¤瘎浼癭"
- :name="`assessment_${index}`"
- >
- <organ-assessment-form
- :organ-data="scope.row"
- :assessment-data="assessment"
- :assessment-index="index"
- :readonly="!canAssessOrgan(scope.row)"
- @update-assessment="handleUpdateAssessment"
- @delete-assessment="handleDeleteAssessment"
- />
- </el-tab-pane>
-
- <!-- 娣诲姞璇勪及鎸夐挳 -->
- <el-tab-pane
- name="add"
- v-if="canAssessOrgan(scope.row) && isEdit"
- >
- <template slot="label">
- <el-button
- type="text"
- icon="el-icon-plus"
- @click.stop="handleAddNewAssessment(scope.row)"
- size="mini"
- >
- 鏂板璇勪及
- </el-button>
- </template>
- <div class="add-assessment-prompt">
- <el-empty description="鐐瑰嚮涓婃柟鎸夐挳娣诲姞鏂扮殑璇勪及"></el-empty>
- </div>
- </el-tab-pane>
-
- <!-- 璇勪及姹囨�籘ab -->
- <el-tab-pane label="璇勪及姹囨��" name="summary">
- <div class="assessment-summary">
- <el-descriptions title="璇勪及缁撴灉姹囨��" :column="2" border>
- <el-descriptions-item label="鍣ㄥ畼绫诲瀷">{{
- getOrganLabel(scope.row.organno)
- }}</el-descriptions-item>
- <el-descriptions-item label="鑾峰彇鏈烘瀯">{{
- scope.row.gainhospitalname
- }}</el-descriptions-item>
- <el-descriptions-item label="璇勪及娆℃暟" :span="2">
- <el-tag type="info"
- >{{ scope.row.assessments.length }}娆�</el-tag
- >
- </el-descriptions-item>
- <el-descriptions-item label="鏈�鏂拌瘎浼版椂闂�" :span="2">
- {{ getLatestAssessmentTime(scope.row) || "-" }}
- </el-descriptions-item>
- </el-descriptions>
-
- <!-- 璇勪及璇︽儏姹囨�� -->
- <el-card header="璇勪及璇︽儏" style="margin-top: 20px;">
- <el-descriptions :column="1" border>
- <el-descriptions-item label="鑾峰彇鍓嶆椿妫�">
- <el-tag
- :type="
- scope.row.isbiopsybefore === '1'
- ? 'success'
- : 'info'
- "
- >
- {{ scope.row.isbiopsybefore === "1" ? "鏄�" : "鍚�" }}
- </el-tag>
- </el-descriptions-item>
- <el-descriptions-item label="鑾峰彇鍚庢椿妫�">
- <el-tag
- :type="
- scope.row.isbiopsyafter === '1'
- ? 'success'
- : 'info'
- "
- >
- {{ scope.row.isbiopsyafter === "1" ? "鏄�" : "鍚�" }}
- </el-tag>
- </el-descriptions-item>
- <el-descriptions-item label="杈圭紭鍣ㄥ畼">
- <el-tag
- :type="
- scope.row.ismarginalorgan === '1'
- ? 'warning'
- : 'info'
- "
- >
- {{
- scope.row.ismarginalorgan === "1" ? "鏄�" : "鍚�"
- }}
- </el-tag>
- </el-descriptions-item>
- <el-descriptions-item label="鐥呭師鑿岄槼鎬�">
- <el-tag
- :type="
- scope.row.ispathogenpositive === '1'
- ? 'danger'
- : 'info'
- "
- >
- {{
- scope.row.ispathogenpositive === "1" ? "鏄�" : "鍚�"
- }}
- </el-tag>
- </el-descriptions-item>
- </el-descriptions>
- </el-card>
- </div>
- </el-tab-pane>
- </el-tabs>
- </div>
- </template>
- </el-table-column>
-
- <el-table-column label="鍣ㄥ畼绫诲瀷" align="center" prop="organname">
- <template slot-scope="scope">
- {{ getOrganLabel(scope.row.organno) }}
- </template>
- </el-table-column>
-
- <el-table-column label="鍣ㄥ畼缂栧彿" align="center" prop="organnumber" />
-
- <el-table-column
- label="鑾峰彇鏈烘瀯"
- align="center"
- prop="gainhospitalname"
- show-overflow-tooltip
- />
-
- <!-- 鍔ㄦ�佹樉绀鸿瘎浼扮姸鎬佸垪 -->
- <el-table-column
- v-for="(assessment, index) in getMaxAssessmentCount()"
- :key="index"
- :label="`绗�${index + 1}娆¤瘎浼癭"
- align="center"
- width="120"
- >
- <template slot-scope="scope">
- <el-tag
- v-if="scope.row.assessments[index]"
- :type="getAssessmentTagType(scope.row.assessments[index].status)"
- size="small"
- >
- {{ getAssessmentStatusText(scope.row.assessments[index].status) }}
- </el-tag>
- <el-tag v-else type="info" size="small">鏈瘎浼�</el-tag>
- </template>
- </el-table-column>
-
- <el-table-column label="鏁翠綋鐘舵��" align="center" width="100">
- <template slot-scope="scope">
- <el-tag
- :type="
- getOrganOverallStatus(scope.row) === 'completed'
- ? 'success'
- : getOrganOverallStatus(scope.row) === 'assessing'
- ? 'primary'
- : 'warning'
- "
- size="small"
- >
- {{ getOrganOverallStatusText(scope.row) }}
- </el-tag>
- </template>
- </el-table-column>
-
- <el-table-column
- label="鎿嶄綔"
- align="center"
- width="150"
- class-name="small-padding fixed-width"
- >
- <template slot-scope="scope">
- <el-button
- v-if="canAssessOrgan(scope.row) && isEdit"
- size="mini"
- type="text"
- @click="handleToggleExpand(scope.row)"
- >
- {{
- expandedRowKeys.includes(scope.row.organno) ? "鏀惰捣" : "璇︽儏"
- }}
- </el-button>
- <el-button
- v-else-if="!isEdit"
- size="mini"
- type="text"
- @click="handleToggleExpand(scope.row)"
- >
- {{
- expandedRowKeys.includes(scope.row.organno) ? "鏀惰捣" : "鏌ョ湅"
- }}
- </el-button>
- <el-button v-else size="mini" type="text" disabled
- >鏃犳潈闄�</el-button
- >
- </template>
- </el-table-column>
- </el-table>
- </el-card>
-
- <!-- 鏁翠綋淇濆瓨鎸夐挳 -->
- <div class="footer-actions" v-if="isEdit">
- <el-button type="primary" @click="handleSaveAll" :loading="saveLoading"
- >淇濆瓨璇勪及琛�</el-button
- >
- <el-button @click="handleCancel">鍙栨秷</el-button>
- </div>
-
- <!-- 鏂囦欢棰勮寮圭獥 -->
- <FilePreviewDialog
- :visible="attachmentVisible"
- :file="currentPreviewFile"
- @close="attachmentVisible = false"
- />
- </div>
-</template>
-
-<script>
-import {
- evaluateBaseInfolist,
- assessedit,
- assessAdd
-} from "@/api/businessApi/index";
-import FilePreviewDialog from "@/components/FilePreviewDialog";
-import OrganAssessmentForm from "./components/OrganAssessmentForm.vue";
-
-export default {
- name: "AssessmentDetail",
- components: { OrganAssessmentForm, FilePreviewDialog },
- dicts: ["sys_user_sex", "sys_Organ", "sys_0_1"],
- data() {
- return {
- // 鏄惁缂栬緫妯″紡
- isEdit: false,
- // 鍔犺浇鐘舵��
- assessmentLoading: false,
- saveLoading: false,
- // 鏁版嵁ID
- infoid: undefined,
- assessmentId: undefined,
- // 涓昏鏁版嵁
- assessmentData: {},
- organAssessmentList: [], // 鎵�鏈夊櫒瀹樻暟鎹�
- // 灞曞紑琛岀浉鍏�
- expandedRowKeys: [],
- // 闄勪欢鐩稿叧
- currentPreviewFile: null,
- attachmentVisible: false,
- // 鎹愮尞鍐冲畾鐩稿叧
- organdecisionValues: [], // 瀛樺偍瀛楀吀value
- organdecisionOther: "",
- // 璁板綍鎹愮尞鍐冲畾鍙樺寲鍓嶇殑鍊�
- prevOrgandecisionValues: [],
- // 鍣ㄥ畼绫诲瀷鏄犲皠鍏崇郴
- organDecisionMapping: {
- // 浣跨敤瀛楀吀value浣滀负key
- C38: ["C38"], // 蹇冭剰 -> 蹇冭剰
- C22: ["C22"], // 鍏ㄨ倽 -> 鍏ㄨ倽
- C22L: ["C22L"], // 宸﹀崐鑲� -> 宸﹀崐鑲�
- C22L0: ["C22L0"], // 宸﹀鍙� -> 宸﹀鍙�
- C22R: ["C22R"], // 鍙冲崐鑲� -> 鍙冲崐鑲�
- C22R0: ["C22R0"], // 鍙充笁鍙� -> 鍙充笁鍙�
- C64: ["C64L", "C64R"], // 鍙岃偩 -> 宸﹁偩, 鍙宠偩
- C64L: ["C64L"], // 宸﹁偩 -> 宸﹁偩
- C64R: ["C64R"], // 鍙宠偩 -> 鍙宠偩
- C34: ["C34L", "C34R"], // 鍏ㄨ偤 -> 宸﹁偤, 鍙宠偤
- C34L: ["C34L"], // 宸﹁偤 -> 宸﹁偤
- C34R: ["C34R"], // 鍙宠偤 -> 鍙宠偤
- C17: ["C17"], // 灏忚偁 -> 灏忚偁
- C25: ["C25"], // 鑳拌吅 -> 鑳拌吅
- C00: [], // 閬椾綋 -> 涓嶆槧灏勫叿浣撳櫒瀹橈紙閬椾綋鏄暣浣擄級
- C69L: ["C69L"], // 宸︾溂瑙掕啘 -> 宸︾溂瑙掕啘
- C69R: ["C69R"], // 鍙崇溂瑙掕啘 -> 鍙崇溂瑙掕啘
- C01: [] // 鍏朵粬 -> 涓嶆槧灏勫叿浣撳櫒瀹�
- },
- // 鐢ㄦ埛淇℃伅
- currentUser: {
- id: "001",
- name: "寮犲尰鐢�",
- department: "蹇冭剰绉�",
- role: "coordinator" // coordinator, doctor
- },
- // 璁板綍琚垹闄ょ殑鍣ㄥ畼璇勪及
- deletedOrganAssessments: [],
- // 鐢ㄤ簬杩借釜tab婵�娲荤姸鎬�
- activeTabMap: new Map()
- };
- },
- computed: {
- isCoordinator() {
- return this.currentUser.role === "coordinator";
- },
- currentDepartment() {
- return this.currentUser.department;
- },
- // 鏍规嵁鎹愮尞鍐冲畾杩囨护鍚庣殑鍣ㄥ畼鍒楄〃
- filteredOrganAssessmentList() {
- if (!this.organdecisionValues || this.organdecisionValues.length === 0) {
- return [];
- }
-
- // 鑾峰彇鎵�鏈夐�変腑鐨勫櫒瀹樼被鍨�
- const selectedOrgans = new Set();
- this.organdecisionValues.forEach(decision => {
- const organs = this.organDecisionMapping[decision] || [];
- organs.forEach(organ => selectedOrgans.add(organ));
- });
-
- // 杩囨护鍣ㄥ畼璇勪及鍒楄〃锛屾帓闄よ鍒犻櫎鐨勫櫒瀹樿瘎浼�
- return this.organAssessmentList.filter(
- organ =>
- selectedOrgans.has(organ.organno) &&
- organ.delFlag !== "1" &&
- !this.deletedOrganAssessments.includes(organ.organno)
- );
- },
- // 妫�鏌ユ墍鏈夎繃婊ゅ悗鐨勫櫒瀹樻槸鍚﹂兘宸茶瘎浼�
- allOrgansAssessed() {
- return this.filteredOrganAssessmentList.every(
- organ =>
- organ.assessments &&
- organ.assessments.length > 0 &&
- organ.assessments.every(
- assessment => assessment.status === "assessed"
- )
- );
- },
- // 鑾峰彇鍣ㄥ畼瀛楀吀
- organDict() {
- return this.dict.type.sys_Organ || [];
- },
- // 鍒ゆ柇鏄惁闇�瑕佹樉绀哄叾浠栬緭鍏ユ
- showOtherInput() {
- return this.organdecisionValues.includes("C01"); // 瀛楀吀涓叾浠栫殑value
- }
- },
- watch: {
- // 鐩戝惉鎹愮尞鍐冲畾鍙樺寲锛岀敤浜庡鏉傞�昏緫澶勭悊
- organdecisionValues: {
- handler(newVal, oldVal) {
- this.handleComplexDecisionChange(newVal, oldVal);
- },
- deep: true
- }
- },
- created() {
- this.infoid = this.$route.query.infoid;
- this.assessmentId = this.$route.query.id;
- this.isEdit = this.$route.query.assess === "true";
- this.getAssessmentDetail();
- },
- methods: {
- // 鏍规嵁瀛楀吀value鑾峰彇label
- getOrganLabel(organValue) {
- const dictItem = this.organDict.find(item => item.value === organValue);
- return dictItem ? dictItem.label : organValue;
- },
-
- // Tab鐐瑰嚮浜嬩欢
- handleTabClick(organ, tab) {
- if (tab.name !== "add") {
- this.activeTabMap.set(organ.organno, tab.name);
- }
- },
-
- // 澶勭悊璇勪及鏇存柊
- handleUpdateAssessment(data) {
- const { organData, assessmentData, assessmentIndex } = data;
- if (organData.assessments[assessmentIndex]) {
- this.$set(organData.assessments, assessmentIndex, {
- ...organData.assessments[assessmentIndex],
- ...assessmentData
- });
- }
- },
-
- // 鏁翠綋淇濆瓨鏂规硶
- async handleSaveAll() {
- this.saveLoading = true;
- try {
- // 1. 鍑嗗涓昏瘎浼拌〃鏁版嵁
- const saveData = {
- // 鏍规嵁 id 鏄惁瀛樺湪鍐冲畾鏄洿鏂拌繕鏄柊澧�
- id: this.assessmentData.id || undefined,
- infoid: this.infoid,
- caseNo: this.assessmentData.caseNo,
- donorno: this.assessmentData.donorno,
- treatmenthospitalname: this.assessmentData.treatmenthospitalname,
- treatmenthospitalno: this.assessmentData.treatmenthospitalno,
- sex: this.assessmentData.sex,
- age: this.assessmentData.age,
- bloodtype: this.assessmentData.bloodtype,
- idcardno: this.assessmentData.idcardno,
- diagnosisname: this.assessmentData.diagnosisname,
- coordinatorName: this.assessmentData.coordinatorName,
- assessTime:
- this.assessmentData.assessTime || new Date().toISOString(),
- assessState: this.assessmentData.assessState,
- assessannex: this.assessmentData.assessannex,
- // 鎹愮尞鍐冲畾淇℃伅
- organdecision: this.organdecisionValues.join(","),
- organdecisionOther: this.organdecisionOther,
- // 鍣ㄥ畼璇勪及鍒楄〃
- serviceMedicalevaluationorganList: this.organAssessmentList.map(
- organ => ({
- id: organ.id,
- infoid: organ.infoid,
- donorno: organ.donorno,
- organno: organ.organno,
- organname: this.getOrganLabel(organ.organno), // 淇濆瓨label
- organnumber: organ.organnumber,
- gainhospitalno: organ.gainhospitalno,
- gainhospitalname: organ.gainhospitalname,
- isbiopsybefore: organ.isbiopsybefore,
- isbiopsyafter: organ.isbiopsyafter,
- ismarginalorgan: organ.ismarginalorgan,
- ispathogenpositive: organ.ispathogenpositive,
- ispnf: organ.ispnf,
- isdgf: organ.isdgf,
- delFlag: organ.delFlag || "0", // 淇濆瓨鍒犻櫎鏍囧織
- // 灏� assessments 鏁扮粍搴忓垪鍖栧埌 assesscontent 瀛楁
- assesscontent: JSON.stringify(organ.assessments)
- })
- )
- };
-
- // 2. 鏍规嵁 id 鍒ゆ柇璋冪敤鍝釜 API
- const saveMethod = this.assessmentData.id ? assessedit : assessAdd;
- const response = await saveMethod(saveData);
-
- if (response.code === 200) {
- this.$message.success("璇勪及琛ㄤ繚瀛樻垚鍔燂紒");
- // 淇濆瓨鎴愬姛鍚庯紝鏇存柊鏈湴鐨� assessmentData.id锛堝浜庢柊澧炴儏鍐碉級
- if (!this.assessmentData.id && response.data && response.data.id) {
- this.assessmentData.id = response.data.id;
- }
- } else {
- this.$message.error("淇濆瓨澶辫触锛�" + (response.msg || "鏈煡閿欒"));
- }
- } catch (error) {
- console.error("淇濆瓨璇勪及琛ㄥけ璐�:", error);
- this.$message.error("淇濆瓨澶辫触锛岃閲嶈瘯");
- } finally {
- this.saveLoading = false;
- }
- },
-
- // 鍙栨秷鎸夐挳浜嬩欢
- handleCancel() {
- this.$router.go(-1);
- },
-
- // 鎹愮尞鍐冲畾鍙樻洿澶勭悊
- async handleOrganDecisionChange(newDecision) {
- // 璁板綍鍙樻洿鍓嶇殑鍊�
- const oldDecision = [...this.prevOrgandecisionValues];
-
- // 鑷姩澶勭悊鐩稿叧閫昏緫
- this.autoHandleDecisionChange(newDecision);
-
- // 澶勭悊绉婚櫎鐨勫喅绛�
- const removedDecisions = oldDecision.filter(
- item => !newDecision.includes(item)
- );
-
- // 瀵规瘡涓Щ闄ょ殑鍐冲畾澶勭悊鐩稿叧鍣ㄥ畼鍒犻櫎
- for (const decision of removedDecisions) {
- await this.handleRemovedDecision(decision);
- }
-
- // 鏇存柊鍙樻洿鍓嶇殑璁板綍
- this.prevOrgandecisionValues = [...newDecision];
-
- // 寮哄埗閲嶆柊娓叉煋
- this.$forceUpdate();
-
- // 濡傛灉浠庢湁閫夋嫨鍙樹负鏃犻�夋嫨锛屾竻绌哄睍寮�鐘舵��
- if (newDecision.length === 0) {
- this.expandedRowKeys = [];
- }
- },
-
- // 鍏朵粬鎹愮尞鍐冲畾杈撳叆澶勭悊
- handleOtherDecisionInput(value) {
- // 杈撳叆鏃朵笉鍋氬崟鐙繚瀛橈紝绛夊緟鏁翠綋淇濆瓨
- },
-
- // 鑷姩澶勭悊鍐冲畾鍙樻洿閫昏緫
- autoHandleDecisionChange(newDecision) {
- // 濡傛灉閫夋嫨浜�"鍙岃偩"(value: C64)锛岃嚜鍔ㄥ彇娑堝崟鐙殑"宸﹁偩"(value: C64L)鍜�"鍙宠偩"(value: C64R)閫夋嫨
- if (newDecision.includes("C64")) {
- this.organdecisionValues = newDecision.filter(
- item => item !== "C64L" && item !== "C64R"
- );
- }
- // 濡傛灉閫夋嫨浜�"宸﹁偩"鎴�"鍙宠偩"锛屽彇娑�"鍙岃偩"閫夋嫨
- else if (newDecision.includes("C64L") || newDecision.includes("C64R")) {
- this.organdecisionValues = newDecision.filter(item => item !== "C64");
- }
-
- // 濡傛灉閫夋嫨浜�"鍏ㄨ偤"(value: C34)锛岃嚜鍔ㄥ彇娑堝崟鐙殑"宸﹁偤"(value: C34L)鍜�"鍙宠偤"(value: C34R)閫夋嫨
- if (newDecision.includes("C34")) {
- this.organdecisionValues = newDecision.filter(
- item => item !== "C34L" && item !== "C34R"
- );
- }
- // 濡傛灉閫夋嫨浜�"宸﹁偤"鎴�"鍙宠偤"锛屽彇娑�"鍏ㄨ偤"閫夋嫨
- else if (newDecision.includes("C34L") || newDecision.includes("C34R")) {
- this.organdecisionValues = newDecision.filter(item => item !== "C34");
- }
-
- // 澶勭悊鍏朵粬浜掓枼閫昏緫
- this.handleExclusiveDecisions();
- },
-
- // 澶勭悊浜掓枼鐨勬崘鐚喅瀹�
- handleExclusiveDecisions() {
- // 閬椾綋鎹愮尞(value: 10)涓庡叾浠栧櫒瀹樻崘鐚簰鏂ワ紙鏍规嵁涓氬姟闇�姹傝皟鏁达級
- if (this.organdecisionValues.includes("10")) {
- // 鍙互璁剧疆鍙繚鐣欓仐浣撴崘鐚紝鎴栬�呮牴鎹笟鍔¢渶姹傚鐞�
- }
- },
-
- // 澶嶆潅鍐崇瓥鍙樺寲澶勭悊
- handleComplexDecisionChange(newVal, oldVal) {
- // 澶勭悊鏂板鐨勯�夋嫨
- const addedDecisions = newVal.filter(item => !oldVal.includes(item));
-
- // 瀵规柊澧炲姞鐨勯�夋嫨杩涜鐗规畩澶勭悊
- addedDecisions.forEach(decision => {
- this.handleNewDecision(decision);
- });
- },
-
- // 澶勭悊鏂板鐨勬崘鐚喅瀹�
- handleNewDecision(decision) {
- // 鏍规嵁鏄犲皠鍏崇郴鑷姩鍒涘缓瀵瑰簲鐨勫櫒瀹樿瘎浼伴」
- this.autoCreateOrganAssessments(decision);
- },
-
- // 鑷姩鍒涘缓鍣ㄥ畼璇勪及椤�
- autoCreateOrganAssessments(decision) {
- const organsToCreate = this.organDecisionMapping[decision];
-
- if (organsToCreate && organsToCreate.length > 0) {
- organsToCreate.forEach(organValue => {
- this.ensureOrganExists(organValue);
- });
-
- // 鏄剧ず鍒涘缓鎻愮ず
- if (organsToCreate.length > 0) {
- this.$message.success(
- `宸蹭负銆�${this.getOrganLabel(decision)}銆戝垱寤�${
- organsToCreate.length
- }涓瘎浼伴」`
- );
- }
- } else {
- console.warn(
- `鎹愮尞鍐冲畾銆�${this.getOrganLabel(decision)}銆戞病鏈夐厤缃櫒瀹樻槧灏勫叧绯籤
- );
- }
- },
-
- // 澶勭悊绉婚櫎鐨勬崘鐚喅瀹�
- async handleRemovedDecision(decision) {
- const relatedOrgans = this.organDecisionMapping[decision] || [];
-
- for (const organValue of relatedOrgans) {
- // 鏌ユ壘瀵瑰簲鐨勫櫒瀹樿瘎浼伴」
- const organIndex = this.organAssessmentList.findIndex(
- organ => organ.organno === organValue && organ.delFlag !== "1"
- );
-
- if (organIndex !== -1) {
- const organ = this.organAssessmentList[organIndex];
- const organLabel = this.getOrganLabel(organValue);
-
- try {
- await this.$confirm(
- `鎹愮尞鍐冲畾"${this.getOrganLabel(
- decision
- )}"宸插彇娑堬紝鏄惁鍒犻櫎瀵瑰簲鐨�${organLabel}璇勪及璁板綍锛焋,
- "纭鍒犻櫎",
- {
- confirmButtonText: "纭畾",
- cancelButtonText: "鍙栨秷",
- type: "warning"
- }
- );
-
- // 鏍囪涓哄垹闄�
- this.$set(this.organAssessmentList[organIndex], "delFlag", "1");
- this.deletedOrganAssessments.push(organValue);
-
- // 浠庡睍寮�琛屼腑绉婚櫎
- const keyIndex = this.expandedRowKeys.indexOf(organValue);
- if (keyIndex > -1) {
- this.expandedRowKeys.splice(keyIndex, 1);
- }
-
- this.$message.success(`${organLabel}璇勪及璁板綍宸叉爣璁板垹闄);
- } catch (cancelError) {
- // 鐢ㄦ埛鍙栨秷鍒犻櫎锛屾仮澶嶉�夋嫨
- if (!this.organdecisionValues.includes(decision)) {
- this.organdecisionValues.push(decision);
- }
- this.$message.info(`宸插彇娑堝垹闄�${organLabel}璇勪及璁板綍`);
- }
- }
- }
- },
-
- // 纭繚鍣ㄥ畼瀛樺湪锛堝甫閲嶅妫�鏌ワ級
- ensureOrganExists(organValue) {
- // 妫�鏌ユ槸鍚﹀凡瀛樺湪鍚岀紪鍙风殑鍣ㄥ畼璇勪及椤�
- const exists = this.organAssessmentList.some(
- organ => organ.organno === organValue && organ.delFlag !== "1"
- );
-
- if (!exists) {
- // 鍒涘缓鏂扮殑鍣ㄥ畼璇勪及椤�
- const newOrgan = {
- id: null,
- organno: organValue, // 浣跨敤瀛楀吀value
- organname: this.getOrganLabel(organValue), // 浣跨敤瀛楀吀label
- gainhospitalname: "寰呭垎閰嶆満鏋�",
- isbiopsybefore: "0",
- isbiopsyafter: "0",
- ismarginalorgan: "0",
- ispathogenpositive: "0",
- assessments: [this.getDefaultAssessment(0)],
- activeTab: "assessment_0", // 缁熶竴浣跨敤activeTab
- expanded: false,
- createTime: new Date().toISOString(),
- delFlag: "0"
- };
-
- this.organAssessmentList = [...this.organAssessmentList, newOrgan];
- return true;
- }
- return false;
- },
-
- // 鑾峰彇璇勪及璇︽儏
- async getAssessmentDetail() {
- this.assessmentLoading = true;
- try {
- const response = await evaluateBaseInfolist({ infoid: this.infoid });
-
- if (response.code === 200) {
- this.handleResponseData(response);
- } else {
- this.$message.error("鑾峰彇璇︽儏澶辫触锛�" + (response.msg || "鏈煡閿欒"));
- }
- } catch (error) {
- console.error("鑾峰彇璇勪及璇︽儏澶辫触:", error);
- this.$message.error("鑾峰彇璇︽儏澶辫触");
- } finally {
- this.assessmentLoading = false;
- }
- },
-
- // 澶勭悊鎺ュ彛鍝嶅簲鏁版嵁
- handleResponseData(response) {
- let detailData = null;
-
- // 鏍规嵁鎺ュ彛瀹為檯杩斿洖鐨勬暟鎹粨鏋勮繘琛岃皟鏁�
- if (response.data) {
- if (Array.isArray(response.data)) {
- detailData = response.data[0] || {};
- } else if (response.data.rows && Array.isArray(response.data.rows)) {
- detailData = response.data.rows[0] || {};
- } else if (Array.isArray(response.data.list)) {
- detailData = response.data.list[0] || {};
- } else {
- detailData = response.data;
- }
- } else {
- detailData = response;
- }
-
- // 鏄犲皠瀛楁鍒拌瘎浼版暟鎹�
- this.assessmentData = {
- id: detailData.id || this.assessmentId,
- infoid: detailData.infoid || this.infoid,
- caseNo: detailData.caseNo || "",
- name: detailData.name || detailData.donorName || "",
- sex: detailData.sex || "",
- age: detailData.age || "",
- bloodtype: detailData.bloodtype || "",
- idcardno: detailData.idcardno || "",
- diagnosisname: detailData.diagnosisname || "",
- treatmenthospitalname: detailData.treatmenthospitalname || "",
- coordinatorName: detailData.coordinatorName || "",
- assessTime: detailData.assessTime || "",
- assessState: detailData.assessState || "1",
- assessannex: detailData.assessannex || ""
- };
-
- // 澶勭悊鎹愮尞鍐冲畾鏁版嵁
- if (detailData.organdecision) {
- const decisionArray = Array.isArray(detailData.organdecision)
- ? detailData.organdecision
- : (detailData.organdecision || "").split(",").filter(item => item);
-
- this.organdecisionValues = decisionArray;
- this.prevOrgandecisionValues = [...decisionArray]; // 鍒濆鍖杙revOrgandecisionValues
- this.organdecisionOther = detailData.organdecisionOther || "";
- }
-
- // 澶勭悊鍣ㄥ畼璇勪及鏁版嵁
- this.processOrganAssessmentData(detailData);
- },
-
- // 澶勭悊鍣ㄥ畼璇勪及鏁版嵁
- processOrganAssessmentData(detailData) {
- let organList = [];
-
- // 浠庢帴鍙f暟鎹腑鑾峰彇鍣ㄥ畼璇勪及鍒楄〃
- if (detailData.serviceMedicalevaluationorganList) {
- if (Array.isArray(detailData.serviceMedicalevaluationorganList)) {
- organList = detailData.serviceMedicalevaluationorganList;
- }
- }
-
- // 杞崲鍣ㄥ畼鏁版嵁鏍煎紡锛屾敮鎸佸娆¤瘎浼�
- this.organAssessmentList = organList.map(organ => {
- let assessments = [];
-
- // 瑙f瀽assesscontent瀛楁涓殑澶氭璇勪及鏁版嵁
- if (organ.assesscontent) {
- try {
- const assessData =
- typeof organ.assesscontent === "string"
- ? JSON.parse(organ.assesscontent)
- : organ.assesscontent;
- console.log(assessData, "assessData");
-
- if (Array.isArray(assessData)) {
- // 杩囨护鎺夊凡鍒犻櫎鐨勮瘎浼�
- const validAssessments = assessData.filter(
- item => item.delFlag !== "1"
- );
- console.log(validAssessments,'validAssessments');
-
- // assessments.push(
- // ...validAssessments.map((item, index) => ({
- // ...item,
- // index: index,
- // status: item.status || "assessed",
- // delFlag: item.delFlag || "0"
- // }))
- // );
- assessments = validAssessments;
- }
- } catch (error) {
- console.warn("瑙f瀽璇勪及鍐呭澶辫触:", error);
- assessments.push(this.getDefaultAssessment(0));
- }
- } else {
- assessments.push(this.getDefaultAssessment(0));
- }
-
- const organno = organ.organno;
- const activeTab = this.activeTabMap.has(organno)
- ? this.activeTabMap.get(organno)
- : assessments.length > 0
- ? "assessment_0"
- : "summary";
-
- return {
- ...organ,
- // 纭繚organname浣跨敤瀛楀吀label
- organname: this.getOrganLabel(organ.organno) || organ.organname,
- assessments: assessments,
- activeTab: activeTab,
- expanded: false,
- delFlag: organ.delFlag || "0"
- };
- });
- console.log(this.organAssessmentList, "this.organAssessmentList");
- },
-
- // 鑾峰彇榛樿璇勪及鏁版嵁缁撴瀯
- getDefaultAssessment(index) {
- return {
- index: index,
- status: "pending",
- assessmentTime: "",
- assessor: "",
- functionStatus: "",
- assessmentOpinion: "",
- clinicalData: {},
- labResults: {},
- createTime: new Date().toISOString(),
- delFlag: "0"
- };
- },
-
- // 璁$畻鏈�澶ц瘎浼版鏁�
- getMaxAssessmentCount() {
- const maxCount = Math.max(
- ...this.organAssessmentList
- .filter(organ => organ.delFlag !== "1")
- .map(organ => (organ.assessments ? organ.assessments.length : 0))
- );
- return Math.max(maxCount, 1);
- },
-
- // 鑾峰彇鍣ㄥ畼鏁翠綋鐘舵��
- getOrganOverallStatus(organ) {
- if (!organ.assessments || organ.assessments.length === 0) {
- return "pending";
- }
-
- const validAssessments = organ.assessments.filter(a => a.delFlag !== "1");
- if (validAssessments.length === 0) {
- return "pending";
- }
-
- const allAssessed = validAssessments.every(
- assessment => assessment.status === "assessed"
- );
- const someAssessed = validAssessments.some(
- assessment => assessment.status === "assessed"
- );
-
- if (allAssessed) return "completed";
- if (someAssessed) return "assessing";
- return "pending";
- },
-
- getOrganOverallStatusText(organ) {
- const status = this.getOrganOverallStatus(organ);
- const statusMap = {
- pending: "寰呰瘎浼�",
- assessing: "璇勪及涓�",
- completed: "宸插畬鎴�"
- };
- return statusMap[status] || "鏈煡";
- },
-
- // 鍒囨崲灞曞紑琛�
- handleToggleExpand(row) {
- const key = row.organno;
- const index = this.expandedRowKeys.indexOf(key);
-
- if (index > -1) {
- this.expandedRowKeys.splice(index, 1);
- row.expanded = false;
- } else {
- this.expandedRowKeys = [key];
- this.organAssessmentList.forEach(item => {
- item.expanded = item.organno === key;
- });
- }
- },
-
- // 灞曞紑琛屽彉鍖�
- handleExpandChange(row, expandedRows) {
- this.expandedRowKeys = expandedRows.map(item => item.organno);
- this.organAssessmentList.forEach(item => {
- item.expanded = this.expandedRowKeys.includes(item.organno);
- });
- },
-
- // 娣诲姞鏂拌瘎浼�
- handleAddNewAssessment(organ) {
- const newAssessment = {
- ...this.getDefaultAssessment(organ.assessments.length),
- assessor: this.currentUser.name
- };
-
- organ.assessments.push(newAssessment);
- // 鍒囨崲鍒版柊娣诲姞鐨勮瘎浼皌ab
- organ.activeTab = `assessment_${organ.assessments.length - 1}`;
- this.activeTabMap.set(organ.organno, organ.activeTab);
-
- this.$message.success("宸叉坊鍔犳柊鐨勮瘎浼�");
- },
-
- // 澶勭悊璇勪及鏇存柊浜嬩欢
- handleUpdateAssessment(data) {
- const { organData, assessmentData, assessmentIndex } = data;
- if (organData.assessments[assessmentIndex]) {
- this.$set(organData.assessments, assessmentIndex, {
- ...organData.assessments[assessmentIndex],
- ...assessmentData
- });
- }
- },
-
- // 澶勭悊鍒犻櫎璇勪及浜嬩欢
- handleDeleteAssessment(data) {
- const { organData, assessmentIndex } = data;
- this.deleteOrganAssessment(organData, assessmentIndex);
- },
-
- // 鍒犻櫎鍣ㄥ畼璇勪及
- async deleteOrganAssessment(organ, assessmentIndex) {
- try {
- await this.$confirm(
- `纭鍒犻櫎绗�${assessmentIndex + 1}娆¤瘎浼拌褰曞悧锛焋,
- "纭鍒犻櫎",
- {
- confirmButtonText: "纭畾",
- cancelButtonText: "鍙栨秷",
- type: "warning"
- }
- );
-
- // 鏍囪璇勪及涓哄垹闄�
- if (organ.assessments[assessmentIndex]) {
- this.$set(organ.assessments[assessmentIndex], "delFlag", "1");
-
- // 杩囨护鎺夊凡鍒犻櫎鐨勮瘎浼�
- organ.assessments = organ.assessments.filter(
- item => item.delFlag !== "1"
- );
-
- // 閲嶆柊璁$畻璇勪及绱㈠紩
- organ.assessments.forEach((assessment, index) => {
- assessment.index = index;
- });
-
- // 濡傛灉鍒犻櫎鍚庢病鏈夎瘎浼颁簡锛屾樉绀烘眹鎬婚〉
- if (organ.assessments.length === 0) {
- organ.activeTab = "summary";
- this.activeTabMap.set(organ.organno, "summary");
- } else if (organ.activeTab === `assessment_${assessmentIndex}`) {
- // 濡傛灉褰撳墠婵�娲荤殑灏辨槸琚垹闄ょ殑tab锛屽垏鎹㈠埌鍓嶄竴涓�
- const newIndex = Math.max(0, assessmentIndex - 1);
- organ.activeTab = `assessment_${newIndex}`;
- this.activeTabMap.set(organ.organno, `assessment_${newIndex}`);
- } else if (organ.activeTab === "summary") {
- this.activeTabMap.set(organ.organno, "summary");
- }
-
- this.$message.success("璇勪及璁板綍宸插垹闄�");
- }
- } catch (cancelError) {
- // 鐢ㄦ埛鍙栨秷鍒犻櫎
- this.$message.info("宸插彇娑堝垹闄�");
- }
- },
-
- // 鑾峰彇鏈�鏂拌瘎浼版椂闂�
- getLatestAssessmentTime(organ) {
- if (!organ.assessments || organ.assessments.length === 0) return null;
-
- const assessed = organ.assessments.filter(
- a => a.assessmentTime && a.delFlag !== "1"
- );
- if (assessed.length === 0) return null;
-
- return assessed.sort(
- (a, b) => new Date(b.assessmentTime) - new Date(a.assessmentTime)
- )[0].assessmentTime;
- },
-
- // 鑾峰彇璇勪及鐘舵�佹爣绛剧被鍨�
- getAssessmentTagType(status) {
- const typeMap = {
- pending: "warning",
- assessing: "primary",
- assessed: "success"
- };
- return typeMap[status] || "info";
- },
-
- // 鑾峰彇璇勪及鐘舵�佹枃鏈�
- getAssessmentStatusText(status) {
- const textMap = {
- pending: "寰呰瘎浼�",
- assessing: "璇勪及涓�",
- assessed: "宸茶瘎浼�"
- };
- return textMap[status] || "鏈煡";
- },
-
- // 妫�鏌ヨ瘎浼版潈闄�
- canAssessOrgan(organ) {
- if (this.isCoordinator) return true;
- if (!this.isEdit) return false;
- return (
- organ.gainhospitalname &&
- organ.gainhospitalname.includes(this.currentDepartment)
- );
- },
-
- // 鑾峰彇琛岀被鍚�
- getRowClassName({ row }) {
- return this.canAssessOrgan(row) ? "assessable-row" : "non-assessable-row";
- },
-
- // 鐘舵�佽繃婊ゅ櫒
- statusFilter(status) {
- const statusMap = {
- "1": "warning",
- "2": "primary",
- "3": "success"
- };
- return statusMap[status] || "info";
- },
-
- statusTextFilter(status) {
- const statusMap = {
- "1": "寰呰瘎浼�",
- "2": "璇勪及涓�",
- "3": "宸插畬鎴�"
- };
- return statusMap[status] || "鏈煡";
- },
-
- // 鏌ョ湅闄勪欢
- handleAttachmentPreview() {
- if (this.assessmentData.assessannex) {
- try {
- const annexData =
- typeof this.assessmentData.assessannex === "string"
- ? JSON.parse(this.assessmentData.assessannex)
- : this.assessmentData.assessannex;
-
- if (Array.isArray(annexData) && annexData.length > 0) {
- this.currentPreviewFile = annexData[0];
- this.attachmentVisible = true;
- } else {
- this.$message.info("鏆傛棤闄勪欢鍙瑙�");
- }
- } catch (error) {
- this.$message.info("闄勪欢鏁版嵁鏍煎紡閿欒");
- }
- } else {
- this.$message.info("鏆傛棤闄勪欢");
- }
- },
-
- // 瀹屾垚璇勪及
- async handleCompleteAssessment() {
- try {
- await this.$confirm(
- "纭瀹屾垚鎵�鏈夊櫒瀹樿瘎浼板悧锛熷畬鎴愬悗灏嗘棤娉曚慨鏀�",
- "纭鎿嶄綔",
- {
- confirmButtonText: "纭畾",
- cancelButtonText: "鍙栨秷",
- type: "warning"
- }
- );
-
- // 鏇存柊璇勪及鐘舵�佷负宸插畬鎴�
- const updateData = {
- ...this.assessmentData,
- assessState: "3",
- assessTime: new Date().toISOString()
- };
-
- const response = await assessedit(updateData);
-
- if (response.code === 200) {
- this.$message.success("璇勪及瀹屾垚纭鎴愬姛");
- this.assessmentData.assessState = "3";
- this.isEdit = false;
- } else {
- this.$message.error("鎿嶄綔澶辫触锛�" + (response.msg || "鏈煡閿欒"));
- }
- } catch (error) {
- if (error !== "cancel") {
- console.error("瀹屾垚璇勪及澶辫触:", error);
- this.$message.error("鎿嶄綔澶辫触");
- }
- }
- }
- }
-};
-</script>
-
-<style scoped>
-.assessment-detail {
- padding: 20px;
-}
-
-.basic-info-card {
- margin-bottom: 20px;
-}
-
-.organ-assessment-card {
- margin-bottom: 20px;
-}
-
-/* 灞曞紑琛屾牱寮� */
-.organ-expand-content {
- padding: 20px;
- background: #fafafa;
- border-radius: 4px;
- margin: 10px 0;
-}
-
-.organ-detail-tabs {
- background: white;
- border-radius: 4px;
- padding: 20px;
-}
-
-.add-assessment-prompt {
- text-align: center;
- padding: 40px 0;
-}
-
-.assessment-summary {
- padding: 10px;
-}
-
-/* 搴曢儴淇濆瓨鎸夐挳鏍峰紡 */
-.footer-actions {
- margin-top: 20px;
- text-align: center;
- padding: 20px;
- border-top: 1px solid #eaeaea;
-}
-
-/* 鍝嶅簲寮忚璁� */
-@media (max-width: 768px) {
- .assessment-detail {
- padding: 10px;
- }
-
- .organ-expand-content {
- padding: 10px;
- }
-}
-
-::v-deep .assessable-row {
- background-color: #f0f9ff;
-}
-
-::v-deep .non-assessable-row {
- background-color: #fafafa;
-}
-
-.jstitle {
- float: right;
- font-size: 18px !important;
- font-weight: 600;
- color: #2645f7;
- font-size: 12px;
-}
-
-/* 琛ㄦ牸灞曞紑鍥炬爣鏍峰紡 */
-::v-deep .el-table__expand-icon {
- cursor: pointer;
-}
-
-::v-deep .el-table__expanded-cell {
- padding: 0 !important;
-}
-
-/* 纭繚鎻忚堪鍒楄〃鏍囩瀹藉害涓�鑷� */
-::v-deep .el-descriptions__label {
- width: 120px;
- background-color: #f5f7fa;
- font-weight: bold;
-}
-
-.fixed-width .el-button {
- margin: 0 2px;
-}
-
-/* 鎹愮尞鍐冲畾鏍峰紡浼樺寲 */
-.organ-decision-info {
- margin: 10px 0;
- padding: 10px;
- background-color: #f8f9fa;
- border-radius: 4px;
- border-left: 4px solid #409eff;
-}
-
-.decision-tag {
- margin: 2px 5px;
-}
-</style>
diff --git a/src/views/business/assess/components/OrganAssessmentForm.vue b/src/views/business/assess/components/OrganAssessmentForm.vue
index 1b732dd..a3be60e 100644
--- a/src/views/business/assess/components/OrganAssessmentForm.vue
+++ b/src/views/business/assess/components/OrganAssessmentForm.vue
@@ -369,6 +369,8 @@
/** 涓婁紶鎴愬姛澶勭悊 */
handleUploadSuccess({ file, fileList, response }) {
+ console.log(response,'response');
+
if (response.code === 200) {
console.log(response, "涓婁紶鏁版嵁");
diff --git a/src/views/business/maintain/components/BloodRoutinePanel.vue b/src/views/business/maintain/components/BloodRoutinePanel.vue
index 19fbf42..6a76ef2 100644
--- a/src/views/business/maintain/components/BloodRoutinePanel.vue
+++ b/src/views/business/maintain/components/BloodRoutinePanel.vue
@@ -129,12 +129,80 @@
<span class="attachment-title">闄勪欢涓婁紶</span>
<span class="attachment-tip">鏀寔涓婁紶妫�楠屾姤鍛婂崟绛夋枃浠� (鏈�澶�10涓�)</span>
</div>
- <upload-attachment
- :file-list="attachments"
+
+ <!-- 浣跨敤 UploadAttachment 缁勪欢 -->
+ <UploadAttachment
+ ref="uploadAttachment"
+ :file-list="attachmentFileList"
+ :limit="attachmentLimit"
+ :accept="attachmentAccept"
+ :multiple="true"
@change="handleAttachmentChange"
- :limit="10"
- :accept="'.pdf,.jpg,.jpeg,.png,.doc,.docx'"
+ @upload-success="handleUploadSuccess"
+ @upload-error="handleUploadError"
+ @remove="handleAttachmentRemove"
/>
+
+ <!-- 闄勪欢鍒楄〃灞曠ず -->
+ <div class="attachment-list" v-if="attachments && attachments.length > 0">
+ <div class="list-title">宸蹭笂浼犻檮浠� ({{ attachments.length }})</div>
+ <el-table :data="attachments" 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="266" fixed="right">
+ <template slot-scope="scope">
+ <el-button
+ size="mini"
+ type="primary"
+ @click="handlePreview(scope.row)"
+ :disabled="!isPreviewable(scope.row.fileName)"
+ >
+ 棰勮
+ </el-button>
+ <el-button
+ v-if="isEditing"
+ size="mini"
+ type="success"
+ @click="handleDownload(scope.row)"
+ >
+ 涓嬭浇
+ </el-button>
+ <el-button
+ v-if="isEditing"
+ size="mini"
+ type="danger"
+ @click="handleRemoveAttachment(scope.$index)"
+ >
+ 鍒犻櫎
+ </el-button>
+ </template>
+ </el-table-column>
+ </el-table>
+ </div>
</div>
<!-- 鍒楃紪杈戝璇濇 -->
@@ -197,23 +265,33 @@
</el-button>
</span>
</el-dialog>
+
+ <!-- 鏂囦欢棰勮寮圭獥 -->
+ <FilePreviewDialog
+ :visible="previewVisible"
+ :file="currentPreviewFile"
+ @close="previewVisible = false"
+ @download="handleDownload"
+ />
</div>
</template>
<script>
import UploadAttachment from "@/components/UploadAttachment";
+import FilePreviewDialog from "@/components/FilePreviewDialog";
+import dayjs from "dayjs";
export default {
name: "BloodRoutinePanel",
components: {
- UploadAttachment
+ UploadAttachment,
+ FilePreviewDialog
},
props: {
isEditing: {
type: Boolean,
default: false
},
- // 淇敼涓� Object 绫诲瀷锛屾敮鎸佸鏉傛暟鎹粨鏋�
initialData: {
type: Object,
default: () => ({})
@@ -238,12 +316,21 @@
tableKey: 0,
tableLoading: false,
saveLoading: false,
- // 鍐呴儴鏁版嵁鐘舵��
internalData: {},
columnRules: {
date: [{ required: true, message: "璇烽�夋嫨鏃ユ湡", trigger: "change" }],
time: [{ required: true, message: "璇烽�夋嫨鏃堕棿", trigger: "change" }]
- }
+ },
+
+ // 棰勮鐩稿叧
+ previewVisible: false,
+ currentPreviewFile: null,
+
+ // 闄勪欢鐩稿叧閰嶇疆
+ attachmentLimit: 10,
+ attachmentAccept:
+ ".pdf,.jpg,.jpeg,.png,.doc,.docx,.xls,.xlsx,.ppt,.pptx,.txt",
+ attachmentFileList: []
};
},
computed: {
@@ -264,7 +351,6 @@
}
},
watch: {
- // 鐩戝惉 initialData 鍙樺寲锛岀‘淇濇暟鎹纭帴鏀�
initialData: {
handler(newData) {
if (newData && Object.keys(newData).length > 0) {
@@ -291,6 +377,20 @@
},
deep: true,
immediate: true
+ },
+ // 鐩戝惉闄勪欢鏁版嵁鍙樺寲
+ attachments: {
+ handler(newAttachments) {
+ this.attachmentFileList = newAttachments.map(item => ({
+ uid: item.id || Math.random(),
+ name: item.fileName,
+ fileSize: item.fileSize,
+ url: item.path || item.fileUrl,
+ uploadTime: item.uploadTime,
+ status: "success"
+ }));
+ },
+ deep: true
}
},
methods: {
@@ -304,7 +404,6 @@
}));
this.dynamicColumns = [...this.internalData.columns];
} else {
- // 濡傛灉娌℃湁澶栭儴鏁版嵁锛屼娇鐢ㄧ粍浠堕粯璁ゅ垵濮嬪寲
this.initTableData();
}
@@ -318,7 +417,6 @@
initTableData() {
const medicalItems = this.getMedicalItems();
- // 濡傛灉娌℃湁鍔ㄦ�佸垪锛屽垵濮嬪寲榛樿鍒�
if (this.dynamicColumns.length === 0) {
this.dynamicColumns = [
{
@@ -387,7 +485,6 @@
columns: this.dynamicColumns,
attachments: this.attachments
};
-
this.$emit("data-change", dataToEmit);
},
@@ -435,7 +532,6 @@
this.saveLoading = true;
if (this.editingColumnIndex !== null) {
- // 缂栬緫鐜版湁鍒�
const column = this.dynamicColumns[this.editingColumnIndex];
column.label = `${this.columnForm.date}\n${this.columnForm.time}`;
column.date = this.columnForm.date;
@@ -443,7 +539,6 @@
column.remark = this.columnForm.remark;
this.$message.success("鏃堕棿鐐逛慨鏀规垚鍔�");
} else {
- // 鏂板鍒�
const newColumn = {
label: `${this.columnForm.date}\n${this.columnForm.time}`,
key: `time${Date.now()}`,
@@ -451,8 +546,8 @@
time: this.columnForm.time,
remark: this.columnForm.remark
};
-
this.internalData.columns.push(newColumn);
+
this.dynamicColumns.push(newColumn);
this.tableData.forEach(row => {
if (!row.values) row.values = [];
@@ -464,6 +559,7 @@
this.columnDialogVisible = false;
this.saveLoading = false;
this.tableKey += 1;
+ this.saveData();
});
},
@@ -480,6 +576,7 @@
});
this.columnDialogVisible = false;
this.tableKey += 1;
+ this.saveData();
this.$message.success("鏃堕棿鐐瑰垹闄ゆ垚鍔�");
});
}
@@ -503,12 +600,181 @@
this.saveData();
},
+ /** 闄勪欢鍙樺寲澶勭悊 */
handleAttachmentChange(fileList) {
- this.attachments = fileList;
- this.$emit("attachment-change", {
- type: "blood_routine",
- attachments: fileList
- });
+ this.attachmentFileList = fileList;
+ },
+
+ /** 闄勪欢绉婚櫎澶勭悊 */
+ handleAttachmentRemove(file) {
+ if (file.url) {
+ const index = this.attachments.findIndex(
+ item => item.path === file.url || item.fileUrl === file.url
+ );
+ if (index > -1) {
+ this.attachments.splice(index, 1);
+ this.saveData();
+ this.$message.success("闄勪欢鍒犻櫎鎴愬姛");
+ }
+ }
+ },
+
+ /** 涓婁紶鎴愬姛澶勭悊 */
+ handleUploadSuccess({ 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.attachments)) {
+ this.attachments = [];
+ }
+
+ this.attachments.push(attachmentObj);
+ this.attachmentFileList = fileList;
+ this.saveData();
+ this.$message.success("鏂囦欢涓婁紶鎴愬姛");
+ }
+ },
+
+ /** 涓婁紶閿欒澶勭悊 */
+ handleUploadError({ file, fileList, error }) {
+ console.error("闄勪欢涓婁紶澶辫触:", error);
+ this.$message.error("鏂囦欢涓婁紶澶辫触锛岃閲嶈瘯");
+ },
+
+ /** 鎵嬪姩鍒犻櫎闄勪欢 */
+ handleRemoveAttachment(index) {
+ this.attachments.splice(index, 1);
+ this.attachmentFileList.splice(index, 1);
+ this.saveData();
+ this.$message.success("闄勪欢鍒犻櫎鎴愬姛");
+ },
+
+ /** 鏂囦欢棰勮 */
+ handlePreview(file) {
+ this.currentPreviewFile = {
+ fileName: file.fileName,
+ fileUrl: file.path || file.fileUrl,
+ fileType: this.getFileType(file.fileName)
+ };
+ this.previewVisible = true;
+ },
+
+ /** 鏂囦欢涓嬭浇 */
+ handleDownload(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;
+ }
},
forceTableLayout() {
@@ -539,7 +805,6 @@
}
},
mounted() {
- // 纭繚缁勪欢姝g‘鎸傝浇鍚庡垵濮嬪寲鏁版嵁
this.$nextTick(() => {
if (Object.keys(this.internalData).length === 0) {
this.initTableData();
@@ -678,6 +943,7 @@
font-size: 14px;
}
+/* 闄勪欢涓婁紶鍖哄煙鏍峰紡浼樺寲 */
.attachment-section {
margin-top: 24px;
padding: 20px;
@@ -703,6 +969,22 @@
color: #909399;
}
+.attachment-list {
+ margin-top: 16px;
+}
+
+.list-title {
+ font-weight: bold;
+ margin-bottom: 12px;
+ color: #303133;
+ font-size: 14px;
+}
+
+.file-name {
+ font-size: 13px;
+ margin-left: 8px;
+}
+
/* 鍝嶅簲寮忚璁� */
@media (max-width: 768px) {
.medical-panel {
diff --git a/src/views/business/maintain/components/LiverKidneyPanel.vue b/src/views/business/maintain/components/LiverKidneyPanel.vue
index beb903a..6a1ac0c 100644
--- a/src/views/business/maintain/components/LiverKidneyPanel.vue
+++ b/src/views/business/maintain/components/LiverKidneyPanel.vue
@@ -70,19 +70,89 @@
</el-table-column>
</el-table>
- <!-- 闄勪欢涓婁紶鍖哄煙 -->
+ <!-- 闄勪欢涓婁紶鍖哄煙浼樺寲 -->
<div class="attachment-section">
- <div class="attachment-title">
+ <div class="attachment-header">
<i class="el-icon-paperclip"></i>
- 闄勪欢涓婁紶
- <span class="attachment-tip">鏀寔涓婁紶妫�楠屾姤鍛婂崟绛夋枃浠�</span>
+ <span class="attachment-title">闄勪欢涓婁紶</span>
+ <span class="attachment-tip"
+ >鏀寔涓婁紶妫�楠屾姤鍛婂崟绛夋枃浠� (鏈�澶歿{ attachmentLimit }}涓�)</span
+ >
</div>
- <upload-attachment
- :file-list="attachments"
+
+ <!-- 浣跨敤 UploadAttachment 缁勪欢 -->
+ <UploadAttachment
+ ref="uploadAttachment"
+ :file-list="attachmentFileList"
+ :limit="attachmentLimit"
+ :accept="attachmentAccept"
+ :multiple="true"
@change="handleAttachmentChange"
- :limit="10"
- :accept="'.pdf,.jpg,.jpeg,.png,.doc,.docx'"
+ @upload-success="handleUploadSuccess"
+ @upload-error="handleUploadError"
+ @remove="handleAttachmentRemove"
/>
+
+ <!-- 闄勪欢鍒楄〃灞曠ず -->
+ <div class="attachment-list" v-if="attachments && attachments.length > 0">
+ <div class="list-title">宸蹭笂浼犻檮浠� ({{ attachments.length }})</div>
+ <el-table :data="attachments" 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="266" fixed="right">
+ <template slot-scope="scope">
+ <el-button
+ size="mini"
+ type="primary"
+ @click="handlePreview(scope.row)"
+ :disabled="!isPreviewable(scope.row.fileName)"
+ >
+ 棰勮
+ </el-button>
+ <el-button
+ v-if="isEditing"
+ size="mini"
+ type="success"
+ @click="handleDownload(scope.row)"
+ >
+ 涓嬭浇
+ </el-button>
+ <el-button
+ v-if="isEditing"
+ size="mini"
+ type="danger"
+ @click="handleRemoveAttachment(scope.$index)"
+ >
+ 鍒犻櫎
+ </el-button>
+ </template>
+ </el-table-column>
+ </el-table>
+ </div>
</div>
<!-- 鍒楃紪杈戝璇濇 -->
@@ -128,23 +198,33 @@
<el-button type="primary" @click="confirmAddColumn">纭畾</el-button>
</span>
</el-dialog>
+
+ <!-- 鏂囦欢棰勮寮圭獥 -->
+ <FilePreviewDialog
+ :visible="previewVisible"
+ :file="currentPreviewFile"
+ @close="previewVisible = false"
+ @download="handleDownload"
+ />
</div>
</template>
<script>
import UploadAttachment from "@/components/UploadAttachment";
+import FilePreviewDialog from "@/components/FilePreviewDialog";
+import dayjs from "dayjs";
export default {
name: "LiverKidneyPanel",
components: {
- UploadAttachment
+ UploadAttachment,
+ FilePreviewDialog
},
props: {
isEditing: {
type: Boolean,
default: false
},
- // 淇敼 prop 瀹氫箟锛屾敮鎸佸璞℃牸寮忕殑鍒濆鏁版嵁
initialData: {
type: Object,
default: () => ({})
@@ -161,12 +241,20 @@
time: ""
},
tableKey: 0,
- // 鍐呴儴鏁版嵁鐘舵��
- internalData: {}
+ internalData: {},
+
+ // 棰勮鐩稿叧
+ previewVisible: false,
+ currentPreviewFile: null,
+
+ // 闄勪欢鐩稿叧閰嶇疆
+ attachmentLimit: 10,
+ attachmentAccept:
+ ".pdf,.jpg,.jpeg,.png,.doc,.docx,.xls,.xlsx,.ppt,.pptx,.txt",
+ attachmentFileList: []
};
},
watch: {
- // 鐩戝惉 initialData 鍙樺寲锛岀‘淇濇暟鎹纭帴鏀� [5](@ref)
initialData: {
handler(newData) {
if (newData && Object.keys(newData).length > 0) {
@@ -192,13 +280,26 @@
});
},
deep: true
+ },
+ // 鐩戝惉闄勪欢鏁版嵁鍙樺寲
+ attachments: {
+ handler(newAttachments) {
+ this.attachmentFileList = newAttachments.map(item => ({
+ uid: item.id || Math.random(),
+ name: item.fileName,
+ fileSize: item.fileSize,
+ url: item.path || item.fileUrl,
+ uploadTime: item.uploadTime,
+ status: "success"
+ }));
+ },
+ deep: true
}
},
methods: {
- // 浠庡閮ㄦ暟鎹垵濮嬪寲缁勪欢 [9](@ref)
+ // 浠庡閮ㄦ暟鎹垵濮嬪寲缁勪欢
initFromExternalData() {
if (this.internalData.data && this.internalData.columns) {
- // 浣跨敤澶栭儴鏁版嵁鍒濆鍖栬〃鏍�
this.tableData = this.internalData.data.map(item => ({
...item,
values:
@@ -206,7 +307,6 @@
}));
this.dynamicColumns = [...this.internalData.columns];
} else {
- // 濡傛灉娌℃湁澶栭儴鏁版嵁锛屼娇鐢ㄩ粯璁ゅ垵濮嬪寲
this.initTableData();
}
@@ -247,7 +347,6 @@
{ itemName: "INR", unit: "", required: true, reference: "0.85-1.15" }
];
- // 濡傛灉娌℃湁鍔ㄦ�佸垪锛屽垵濮嬪寲榛樿鍒�
if (this.dynamicColumns.length === 0) {
this.dynamicColumns = [
{
@@ -265,7 +364,7 @@
}));
},
- // 淇濆瓨鏁版嵁鍒扮埗缁勪欢 [2](@ref)
+ // 淇濆瓨鏁版嵁鍒扮埗缁勪欢
saveData() {
const dataToEmit = {
type: "liver_kidney",
@@ -298,7 +397,6 @@
date: this.columnForm.date,
time: this.columnForm.time
};
- this.internalData.columns.push(newColumn);
this.dynamicColumns.push(newColumn);
@@ -313,14 +411,12 @@
this.columnDialogVisible = false;
this.$message.success("鏃堕棿鐐规坊鍔犳垚鍔�");
this.tableKey += 1;
+ this.saveData();
});
},
handleDialogClosed() {
- this.columnForm = {
- date: "",
- time: ""
- };
+ this.columnForm = { date: "", time: "" };
this.$refs.columnForm && this.$refs.columnForm.clearValidate();
},
@@ -328,12 +424,182 @@
this.saveData();
},
+ /** 闄勪欢鍙樺寲澶勭悊 */
handleAttachmentChange(fileList) {
- this.attachments = fileList;
- this.$emit("attachment-change", {
- type: "liver_kidney",
- attachments: fileList
- });
+ this.attachmentFileList = fileList;
+ },
+
+ /** 闄勪欢绉婚櫎澶勭悊 */
+ handleAttachmentRemove(file) {
+ if (file.url) {
+ const index = this.attachments.findIndex(
+ item => item.path === file.url || item.fileUrl === file.url
+ );
+ if (index > -1) {
+ this.attachments.splice(index, 1);
+ this.saveData();
+ this.$message.success("闄勪欢鍒犻櫎鎴愬姛");
+ }
+ }
+ },
+
+ /** 涓婁紶鎴愬姛澶勭悊 */
+ handleUploadSuccess({ 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")
+ };
+
+ // 纭繚 attachments 鏄暟缁�
+ if (!Array.isArray(this.attachments)) {
+ this.attachments = [];
+ }
+
+ this.attachments.push(attachmentObj);
+ this.attachmentFileList = fileList;
+ this.saveData();
+ this.$message.success("鏂囦欢涓婁紶鎴愬姛");
+ }
+ },
+
+ /** 涓婁紶閿欒澶勭悊 */
+ handleUploadError({ file, fileList, error }) {
+ console.error("闄勪欢涓婁紶澶辫触:", error);
+ this.$message.error("鏂囦欢涓婁紶澶辫触锛岃閲嶈瘯");
+ },
+
+ /** 鎵嬪姩鍒犻櫎闄勪欢 */
+ handleRemoveAttachment(index) {
+ this.attachments.splice(index, 1);
+ this.attachmentFileList.splice(index, 1);
+ this.saveData();
+ this.$message.success("闄勪欢鍒犻櫎鎴愬姛");
+ },
+
+ /** 鏂囦欢棰勮 */
+ handlePreview(file) {
+ this.currentPreviewFile = {
+ fileName: file.fileName,
+ fileUrl: file.path || file.fileUrl,
+ fileType: this.getFileType(file.fileName)
+ };
+ this.previewVisible = true;
+ },
+
+ /** 鏂囦欢涓嬭浇 */
+ handleDownload(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;
+ }
},
forceTableLayout() {
@@ -362,7 +628,6 @@
}
},
mounted() {
- // 纭繚缁勪欢姝g‘鎸傝浇鍚庡垵濮嬪寲鏁版嵁 [1](@ref)
this.$nextTick(() => {
if (Object.keys(this.internalData).length === 0) {
this.initTableData();
@@ -442,6 +707,7 @@
margin-right: 4px;
}
+/* 闄勪欢涓婁紶鍖哄煙鏍峰紡浼樺寲 */
.attachment-section {
margin-top: 30px;
padding: 20px;
@@ -450,21 +716,43 @@
background: #fafafa;
}
-.attachment-title {
- font-weight: bold;
- margin-bottom: 15px;
- color: #409eff;
+.attachment-header {
display: flex;
align-items: center;
+ margin-bottom: 16px;
+ padding-bottom: 8px;
+ border-bottom: 1px solid #ebeef5;
+}
+
+.attachment-title {
+ font-weight: bold;
+ margin: 0 8px;
+ color: #303133;
}
.attachment-tip {
font-size: 12px;
color: #909399;
- margin-left: 10px;
- font-weight: normal;
+ margin-left: auto;
}
+.attachment-list {
+ margin-top: 16px;
+}
+
+.list-title {
+ font-weight: bold;
+ margin-bottom: 12px;
+ color: #303133;
+ font-size: 14px;
+}
+
+.file-name {
+ font-size: 13px;
+ margin-left: 8px;
+}
+
+/* 鍝嶅簲寮忚皟鏁� */
@media (max-width: 768px) {
.medical-panel {
padding: 10px;
@@ -488,5 +776,9 @@
margin-left: 0;
margin-top: 4px;
}
+
+ .attachment-section {
+ padding: 10px;
+ }
}
</style>
diff --git a/src/views/business/maintain/components/UrineRoutinePanel.vue b/src/views/business/maintain/components/UrineRoutinePanel.vue
index 541158f..e482237 100644
--- a/src/views/business/maintain/components/UrineRoutinePanel.vue
+++ b/src/views/business/maintain/components/UrineRoutinePanel.vue
@@ -144,12 +144,80 @@
>鏀寔涓婁紶灏垮父瑙勬楠屾姤鍛婂崟绛夋枃浠� (鏈�澶�10涓�)</span
>
</div>
- <upload-attachment
- :file-list="attachments"
+
+ <!-- 浣跨敤 UploadAttachment 缁勪欢 -->
+ <UploadAttachment
+ ref="uploadAttachment"
+ :file-list="attachmentFileList"
+ :limit="attachmentLimit"
+ :accept="attachmentAccept"
+ :multiple="true"
@change="handleAttachmentChange"
- :limit="10"
- :accept="'.pdf,.jpg,.jpeg,.png,.doc,.docx'"
+ @upload-success="handleUploadSuccess"
+ @upload-error="handleUploadError"
+ @remove="handleAttachmentRemove"
/>
+
+ <!-- 闄勪欢鍒楄〃灞曠ず -->
+ <div class="attachment-list" v-if="attachments && attachments.length > 0">
+ <div class="list-title">宸蹭笂浼犻檮浠� ({{ attachments.length }})</div>
+ <el-table :data="attachments" 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="266" fixed="right">
+ <template slot-scope="scope">
+ <el-button
+ size="mini"
+ type="primary"
+ @click="handlePreview(scope.row)"
+ :disabled="!isPreviewable(scope.row.fileName)"
+ >
+ 棰勮
+ </el-button>
+ <el-button
+ v-if="isEditing"
+ size="mini"
+ type="success"
+ @click="handleDownload(scope.row)"
+ >
+ 涓嬭浇
+ </el-button>
+ <el-button
+ v-if="isEditing"
+ size="mini"
+ type="danger"
+ @click="handleRemoveAttachment(scope.$index)"
+ >
+ 鍒犻櫎
+ </el-button>
+ </template>
+ </el-table-column>
+ </el-table>
+ </div>
</div>
<!-- 鍒楃紪杈戝璇濇 -->
@@ -212,23 +280,33 @@
</el-button>
</span>
</el-dialog>
+
+ <!-- 鏂囦欢棰勮寮圭獥 -->
+ <FilePreviewDialog
+ :visible="previewVisible"
+ :file="currentPreviewFile"
+ @close="previewVisible = false"
+ @download="handleDownload"
+ />
</div>
</template>
<script>
import UploadAttachment from "@/components/UploadAttachment";
+import FilePreviewDialog from "@/components/FilePreviewDialog";
+import dayjs from "dayjs";
export default {
name: "UrineRoutinePanel",
components: {
- UploadAttachment
+ UploadAttachment,
+ FilePreviewDialog
},
props: {
isEditing: {
type: Boolean,
default: false
},
- // 淇敼涓� Object 绫诲瀷锛屾敮鎸佸鏉傛暟鎹粨鏋�
initialData: {
type: Object,
default: () => ({})
@@ -253,12 +331,21 @@
tableKey: 0,
tableLoading: false,
saveLoading: false,
- // 鍐呴儴鏁版嵁鐘舵��
internalData: {},
columnRules: {
date: [{ required: true, message: "璇烽�夋嫨鏃ユ湡", trigger: "change" }],
time: [{ required: true, message: "璇烽�夋嫨鏃堕棿", trigger: "change" }]
- }
+ },
+
+ // 棰勮鐩稿叧
+ previewVisible: false,
+ currentPreviewFile: null,
+
+ // 闄勪欢鐩稿叧閰嶇疆
+ attachmentLimit: 10,
+ attachmentAccept:
+ ".pdf,.jpg,.jpeg,.png,.doc,.docx,.xls,.xlsx,.ppt,.pptx,.txt",
+ attachmentFileList: []
};
},
computed: {
@@ -279,11 +366,9 @@
}
},
watch: {
- // 鐩戝惉 initialData 鍙樺寲锛岀‘淇濇暟鎹纭帴鏀�
initialData: {
handler(newData) {
console.log(newData);
-
if (newData && Object.keys(newData).length > 0) {
this.internalData = { ...newData };
this.initFromExternalData();
@@ -308,12 +393,26 @@
},
deep: true,
immediate: true
+ },
+ // 鐩戝惉闄勪欢鏁版嵁鍙樺寲
+ attachments: {
+ handler(newAttachments) {
+ this.attachmentFileList = newAttachments.map(item => ({
+ uid: item.id || Math.random(),
+ name: item.fileName,
+ fileSize: item.fileSize,
+ url: item.path || item.fileUrl,
+ uploadTime: item.uploadTime,
+ status: "success"
+ }));
+ },
+ deep: true
}
},
methods: {
// 浠庡閮ㄦ暟鎹垵濮嬪寲缁勪欢
initFromExternalData() {
- console.log(this.internalData,'this.internalData');
+ console.log(this.internalData, "this.internalData");
if (this.internalData.data && this.internalData.columns) {
this.tableData = this.internalData.data.map(item => ({
@@ -323,7 +422,6 @@
}));
this.dynamicColumns = [...this.internalData.columns];
} else {
- // 濡傛灉娌℃湁澶栭儴鏁版嵁锛屼娇鐢ㄧ粍浠堕粯璁ゅ垵濮嬪寲
this.initTableData();
}
@@ -337,7 +435,6 @@
initTableData() {
const medicalItems = this.getMedicalItems();
- // 濡傛灉娌℃湁鍔ㄦ�佸垪锛屽垵濮嬪寲榛樿鍒�
if (this.dynamicColumns.length === 0) {
this.dynamicColumns = [
{
@@ -501,7 +598,6 @@
this.saveLoading = true;
if (this.editingColumnIndex !== null) {
- // 缂栬緫鐜版湁鍒�
const column = this.dynamicColumns[this.editingColumnIndex];
column.label = `${this.columnForm.date}\n${this.columnForm.time}`;
column.date = this.columnForm.date;
@@ -509,7 +605,6 @@
column.remark = this.columnForm.remark;
this.$message.success("鏃堕棿鐐逛慨鏀规垚鍔�");
} else {
- // 鏂板鍒�
const newColumn = {
label: `${this.columnForm.date}\n${this.columnForm.time}`,
key: `time${Date.now()}`,
@@ -530,6 +625,7 @@
this.columnDialogVisible = false;
this.saveLoading = false;
this.tableKey += 1;
+ this.saveData();
});
},
@@ -546,6 +642,7 @@
});
this.columnDialogVisible = false;
this.tableKey += 1;
+ this.saveData();
this.$message.success("鏃堕棿鐐瑰垹闄ゆ垚鍔�");
});
}
@@ -569,12 +666,181 @@
this.saveData();
},
+ /** 闄勪欢鍙樺寲澶勭悊 */
handleAttachmentChange(fileList) {
- this.attachments = fileList;
- this.$emit("attachment-change", {
- type: "urine_routine",
- attachments: fileList
- });
+ this.attachmentFileList = fileList;
+ },
+
+ /** 闄勪欢绉婚櫎澶勭悊 */
+ handleAttachmentRemove(file) {
+ if (file.url) {
+ const index = this.attachments.findIndex(
+ item => item.path === file.url || item.fileUrl === file.url
+ );
+ if (index > -1) {
+ this.attachments.splice(index, 1);
+ this.saveData();
+ this.$message.success("闄勪欢鍒犻櫎鎴愬姛");
+ }
+ }
+ },
+
+ /** 涓婁紶鎴愬姛澶勭悊 */
+ handleUploadSuccess({ 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.attachments)) {
+ this.attachments = [];
+ }
+
+ this.attachments.push(attachmentObj);
+ this.attachmentFileList = fileList;
+ this.saveData();
+ this.$message.success("鏂囦欢涓婁紶鎴愬姛");
+ }
+ },
+
+ /** 涓婁紶閿欒澶勭悊 */
+ handleUploadError({ file, fileList, error }) {
+ console.error("闄勪欢涓婁紶澶辫触:", error);
+ this.$message.error("鏂囦欢涓婁紶澶辫触锛岃閲嶈瘯");
+ },
+
+ /** 鎵嬪姩鍒犻櫎闄勪欢 */
+ handleRemoveAttachment(index) {
+ this.attachments.splice(index, 1);
+ this.attachmentFileList.splice(index, 1);
+ this.saveData();
+ this.$message.success("闄勪欢鍒犻櫎鎴愬姛");
+ },
+
+ /** 鏂囦欢棰勮 */
+ handlePreview(file) {
+ this.currentPreviewFile = {
+ fileName: file.fileName,
+ fileUrl: file.path || file.fileUrl,
+ fileType: this.getFileType(file.fileName)
+ };
+ this.previewVisible = true;
+ },
+
+ /** 鏂囦欢涓嬭浇 */
+ handleDownload(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;
+ }
},
forceTableLayout() {
@@ -605,7 +871,6 @@
}
},
mounted() {
- // 纭繚缁勪欢姝g‘鎸傝浇鍚庡垵濮嬪寲鏁版嵁
this.$nextTick(() => {
if (Object.keys(this.internalData).length === 0) {
this.initTableData();
@@ -744,6 +1009,7 @@
font-size: 14px;
}
+/* 闄勪欢涓婁紶鍖哄煙鏍峰紡浼樺寲 */
.attachment-section {
margin-top: 24px;
padding: 20px;
@@ -769,6 +1035,22 @@
color: #909399;
}
+.attachment-list {
+ margin-top: 16px;
+}
+
+.list-title {
+ font-weight: bold;
+ margin-bottom: 12px;
+ color: #303133;
+ font-size: 14px;
+}
+
+.file-name {
+ font-size: 13px;
+ margin-left: 8px;
+}
+
/* 鍝嶅簲寮忚璁� */
@media (max-width: 768px) {
.medical-panel {
diff --git a/src/views/business/maintain/maintainInfo.vue b/src/views/business/maintain/maintainInfo.vue
index b1470fc..8083e63 100644
--- a/src/views/business/maintain/maintainInfo.vue
+++ b/src/views/business/maintain/maintainInfo.vue
@@ -53,11 +53,6 @@
<el-col :span="8">
<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
v-for="dict in dict.type.sys_DonationCategory || []"
:key="dict.value"
@@ -66,20 +61,6 @@
></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
@@ -127,10 +108,6 @@
<el-col :span="8">
<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
v-for="dict in dict.type.sys_BloodType"
:key="dict.value"
@@ -423,9 +400,16 @@
</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>
@@ -486,9 +470,16 @@
</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>
@@ -505,11 +496,67 @@
</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>
@@ -518,17 +565,18 @@
import { maintainList, maintainedit, maintainAdd } from "@/api/businessApi";
import Pagination from "@/components/Pagination";
import UploadAttachment from "@/components/UploadAttachment";
-import AttachmentPreview from "@/components/AttachmentPreview";
+import FilePreviewDialog from "@/components/FilePreviewDialog";
import LiverKidneyPanel from "./components/LiverKidneyPanel.vue";
import BloodRoutinePanel from "./components/BloodRoutinePanel.vue";
import UrineRoutinePanel from "./components/UrineRoutinePanel.vue";
+import dayjs from "dayjs";
export default {
name: "MaintenanceDetail",
components: {
Pagination,
UploadAttachment,
- AttachmentPreview,
+ FilePreviewDialog,
LiverKidneyPanel,
BloodRoutinePanel,
UrineRoutinePanel
@@ -565,10 +613,8 @@
incompleteReason: ""
},
activeTab: "culture",
- liverKidneyData: {}, // 浠� maintainList 鎺ュ彛鑾峰彇鐨勬暟鎹�
- bloodRoutineData: {}, // 浠� maintainList 鎺ュ彛鑾峰彇鐨勬暟鎹�
- liverKidneyData: {}, // 浠� maintainList 鎺ュ彛鑾峰彇鐨勬暟鎹�
extracontentinfo: {},
+
// 鍩瑰吇缁撴灉鐩稿叧鏁版嵁
cultureList: [],
cultureLoading: false,
@@ -582,6 +628,7 @@
result: "闃存��",
attachments: []
},
+ cultureFileList: [],
cultureRules: {
cultureType: [
{ required: true, message: "璇烽�夋嫨鍩瑰吇绫诲瀷", trigger: "change" }
@@ -615,6 +662,7 @@
checkRecord: "",
attachments: []
},
+ recordFileList: [],
recordRules: {
recordTime: [
{ required: true, message: "璇烽�夋嫨鏍告煡鏃堕棿", trigger: "change" }
@@ -631,6 +679,14 @@
attachmentPreviewVisible: false,
currentAttachmentList: [],
attachmentPreviewTitle: "",
+
+ // 鏂囦欢棰勮鐩稿叧
+ filePreviewVisible: false,
+ currentPreviewFile: null,
+
+ // 闄勪欢鐩稿叧閰嶇疆
+ attachmentLimit: 10,
+ attachmentAccept: ".pdf,.jpg,.jpeg,.png,.doc,.docx,.xls,.xlsx,.ppt,.pptx,.txt",
// 璇勪及鏁版嵁瀛樺偍
assessmentData: {
@@ -651,7 +707,7 @@
}
},
methods: {
- // 鍔犺浇缁存姢鏁版嵁[1,3](@ref)
+ // 鍔犺浇缁存姢鏁版嵁
async loadMaintenanceData() {
try {
this.cultureLoading = true;
@@ -661,7 +717,7 @@
const queryParams = {};
if (id) {
- queryParams.id = id;
+ queryParams.infoid = infoid;
this.currentMaintenanceId = id;
this.isEditMode = true;
} else if (infoid) {
@@ -672,30 +728,27 @@
this.$message.error("缂哄皯蹇呰鐨勮矾鐢卞弬鏁�");
return;
}
+
queryParams.infoid = infoid;
const response = await maintainList(queryParams);
if (response.code === 200) {
let maintenanceData = response.data[0];
- // 澶勭悊鏁扮粍鍝嶅簲
if (Array.isArray(maintenanceData)) {
maintenanceData = maintenanceData[0] || {};
}
if (maintenanceData.extracontent) {
- this.extracontentinfo = JSON.parse(maintenanceData.extracontent);
+ this.extracontentinfo = JSON.parse(maintenanceData.extracontent);
if (this.extracontentinfo.specialMedicalHistory) {
- this.form.specialMedicalHistory =
- this.extracontentinfo.specialMedicalHistory;
+ this.form.specialMedicalHistory = this.extracontentinfo.specialMedicalHistory;
}
}
- // 瑙f瀽itemDesc瀛楁涓殑JSON鏁版嵁[6,8](@ref)
if (maintenanceData.itemDesc) {
try {
const itemDescData = maintenanceData.itemDesc;
this.assessmentData = { ...this.assessmentData, ...itemDescData };
- // 濉厖鍚勪釜妯″潡鐨勬暟鎹�
if (itemDescData.cultureResults) {
this.cultureList = itemDescData.cultureResults;
}
@@ -716,7 +769,6 @@
}
}
- // 濉厖鍩虹琛ㄥ崟鏁版嵁
this.form = { ...this.form, ...maintenanceData };
this.$message.success("鏁版嵁鍔犺浇鎴愬姛");
} else {
@@ -731,10 +783,9 @@
}
},
- // 淇濆瓨鎵�鏈夋暟鎹甗1,2](@ref)
+ // 淇濆瓨鎵�鏈夋暟鎹�
async handleSave() {
try {
- // 鏋勫缓淇濆瓨鏁版嵁
const saveData = {
...this.form,
itemDesc: {
@@ -748,11 +799,9 @@
this.extracontentinfo.specialMedicalHistory = this.form.specialMedicalHistory;
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);
}
@@ -763,7 +812,6 @@
id: this.$route.query.infoid,
extracontent: JSON.stringify(this.extracontentinfo)
});
- // 濡傛灉鏄柊澧炰繚瀛橈紝鏇存柊褰撳墠ID
if (!this.isEditMode && response.data && response.data.id) {
this.currentMaintenanceId = response.data.id;
this.isEditMode = true;
@@ -795,6 +843,7 @@
result: "闃存��",
attachments: []
};
+ this.cultureFileList = [];
this.cultureDialogVisible = true;
this.$nextTick(() => {
this.$refs.cultureForm && this.$refs.cultureForm.clearValidate();
@@ -804,6 +853,14 @@
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();
@@ -816,7 +873,6 @@
this.cultureSaveLoading = true;
if (this.cultureForm.id) {
- // 缂栬緫鐜版湁璁板綍
const index = this.cultureList.findIndex(
item => item.id === this.cultureForm.id
);
@@ -824,7 +880,6 @@
this.cultureList.splice(index, 1, { ...this.cultureForm });
}
} else {
- // 鏂板璁板綍
this.cultureForm.id = Date.now();
this.cultureList.push({ ...this.cultureForm });
}
@@ -864,6 +919,7 @@
checkRecord: "",
attachments: []
};
+ this.recordFileList = [];
this.recordDialogVisible = true;
this.$nextTick(() => {
this.$refs.recordForm && this.$refs.recordForm.clearValidate();
@@ -873,6 +929,14 @@
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();
@@ -885,7 +949,6 @@
this.recordSaveLoading = true;
if (this.recordForm.id) {
- // 缂栬緫鐜版湁璁板綍
const index = this.recordList.findIndex(
item => item.id === this.recordForm.id
);
@@ -893,7 +956,6 @@
this.recordList.splice(index, 1, { ...this.recordForm });
}
} else {
- // 鏂板璁板綍
this.recordForm.id = Date.now();
this.recordList.push({ ...this.recordForm });
}
@@ -918,13 +980,90 @@
.catch(() => {});
},
- // 闄勪欢鐩稿叧鏂规硶
+ // 鍩瑰吇璁板綍闄勪欢鐩稿叧鏂规硶
handleCultureAttachmentChange(fileList) {
- this.cultureForm.attachments = 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.recordForm.attachments = 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) {
@@ -937,6 +1076,124 @@
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;
+ }
},
// 璇勪及鏁版嵁鍙樻洿澶勭悊
@@ -1002,4 +1259,9 @@
.fixed-width .el-button {
margin: 0 2px;
}
+
+.file-name {
+ font-size: 13px;
+ margin-left: 8px;
+}
</style>
diff --git a/src/views/project/DonationProcess/index.vue b/src/views/project/DonationProcess/index.vue
index 451ca73..16c62a1 100644
--- a/src/views/project/DonationProcess/index.vue
+++ b/src/views/project/DonationProcess/index.vue
@@ -396,7 +396,12 @@
components: {
TerminateRestoreModal
},
- dicts: ["sys_donornode",'sys_BloodType', "sys_EthicalReview", "sys_BaseAssessConclusion"],
+ dicts: [
+ "sys_donornode",
+ "sys_BloodType",
+ "sys_EthicalReview",
+ "sys_BaseAssessConclusion"
+ ],
data() {
return {
loading: false,
@@ -593,8 +598,10 @@
/** 鏌ョ湅璇︽儏 */
handleDetail(row) {
- this.currentRecord = { ...row };
- this.detailVisible = true;
+ this.$router.push({
+ path: "/case/course",
+ query: { id: row.id, organType: "edit" }
+ });
},
/** 缁堟鎿嶄綔 */
diff --git a/src/views/project/donatebaseinfo/EditCaseModal.vue b/src/views/project/donatebaseinfo/EditCaseModal.vue
index 28efaa4..8ccfa01 100644
--- a/src/views/project/donatebaseinfo/EditCaseModal.vue
+++ b/src/views/project/donatebaseinfo/EditCaseModal.vue
@@ -45,9 +45,12 @@
<el-col :span="6">
<el-form-item label="鎬у埆" prop="sex">
<el-select v-model="formData.sex" placeholder="璇烽�夋嫨鎬у埆">
- <el-option label="鏈煡" value="0" />
- <el-option label="鐢�" value="1" />
- <el-option label="濂�" value="2" />
+ <el-option
+ v-for="dict in dict.type.sys_user_sex || []"
+ :key="dict.value"
+ :label="dict.label"
+ :value="parseInt(dict.value)"
+ />
</el-select>
</el-form-item>
</el-col>
@@ -57,9 +60,12 @@
v-model="formData.idcardtype"
placeholder="璇烽�夋嫨璇佷欢绫诲瀷"
>
- <el-option label="韬唤璇�" :value="1" />
- <el-option label="鍐涗汉璇�" :value="2" />
- <el-option label="鎶ょ収" :value="3" />
+ <el-option
+ v-for="dict in dict.type.sys_IDType || []"
+ :key="dict.value"
+ :label="dict.label"
+ :value="parseInt(dict.value)"
+ />
</el-select>
</el-form-item>
</el-col>
@@ -96,7 +102,7 @@
<el-form-item label="姘戞棌" prop="nation">
<el-select v-model="formData.nation" placeholder="璇烽�夋嫨姘戞棌">
<el-option
- v-for="dict in dictOptions.sys_nation"
+ v-for="dict in dict.type.sys_nation || []"
:key="dict.value"
:label="dict.label"
:value="dict.value"
@@ -130,7 +136,7 @@
placeholder="璇烽�夋嫨瀛﹀巻"
>
<el-option
- v-for="dict in dictOptions.sys_education"
+ v-for="dict in dict.type.sys_education || []"
:key="dict.value"
:label="dict.label"
:value="dict.value"
@@ -145,7 +151,7 @@
placeholder="璇烽�夋嫨鑱屼笟"
>
<el-option
- v-for="dict in dictOptions.sys_occupation"
+ v-for="dict in dict.type.sys_occupation || []"
:key="dict.value"
:label="dict.label"
:value="dict.value"
@@ -204,14 +210,17 @@
</el-form-item>
</el-col>
</el-row>
+
<el-row :gutter="20">
<el-col :span="12">
<el-form-item label="琛�鍨�" prop="bloodtype">
<el-radio-group v-model="formData.bloodtype">
- <el-radio label="1">A鍨�</el-radio>
- <el-radio label="2">B鍨�</el-radio>
- <el-radio label="3">O鍨�</el-radio>
- <el-radio label="4">AB鍨�</el-radio>
+ <el-radio
+ v-for="dict in dict.type.sys_BloodType || []"
+ :key="dict.value"
+ :label="dict.value"
+ >{{ dict.label }}</el-radio
+ >
</el-radio-group>
</el-form-item>
</el-col>
@@ -222,8 +231,85 @@
v-for="dict in dict.type.sys_bloodtype_rhd || []"
:key="dict.value"
:label="dict.value"
- >{{ dict.label }}</el-radio>
+ >{{ dict.label }}</el-radio
+ >
</el-radio-group>
+ </el-form-item>
+ </el-col>
+ </el-row>
+
+ <!-- 鐤剧梾绫诲瀷 -->
+ <el-row>
+ <el-form-item label="鐤剧梾绫诲瀷" align="left">
+ <el-checkbox-group v-model="formData.diseasetype">
+ <el-checkbox
+ v-for="dict in dict.type.sys_DiseaseType || []"
+ :key="dict.value"
+ :label="dict.value"
+ >
+ {{ dict.label }}
+ </el-checkbox>
+ </el-checkbox-group>
+ </el-form-item>
+ <el-form-item label="鍏朵粬" prop="diseasetypeOther">
+ <el-input
+ v-model="formData.diseasetypeOther"
+ placeholder="璇疯緭鍏ュ叾浠�"
+ />
+ </el-form-item>
+ </el-row>
+
+ <!-- 浼犳煋鐥� -->
+ <el-row>
+ <el-col :span="12">
+ <el-form-item align="left" label="浼犳煋鐥�">
+ <el-checkbox-group v-model="formData.infectious">
+ <el-checkbox
+ v-for="dict in dict.type.sys_Infectious || []"
+ :key="dict.value"
+ :label="dict.value"
+ >
+ {{ dict.label }}
+ </el-checkbox>
+ </el-checkbox-group>
+ </el-form-item>
+ </el-col>
+ <el-col :span="12">
+ <el-form-item align="left" label="鍏朵粬" prop="infectiousOther">
+ <el-input
+ v-model="formData.infectiousOther"
+ placeholder="璇疯緭鍏ュ叾浠�"
+ />
+ </el-form-item>
+ </el-col>
+ </el-row>
+
+ <!-- 鐥呬汉鐘跺喌鍜屽叾浠栨儏鍐� -->
+ <el-row>
+ <el-col :span="9">
+ <el-form-item align="left" label="鐥呬汉鐘跺喌">
+ <el-checkbox-group v-model="formData.patientstate">
+ <el-checkbox
+ v-for="dict in dict.type.sys_patientstate || []"
+ :key="dict.value"
+ :label="dict.value"
+ >
+ {{ dict.label }}
+ </el-checkbox>
+ </el-checkbox-group>
+ </el-form-item>
+ </el-col>
+ <el-col :span="15" align="left">
+ <el-form-item label="鍏朵粬鎯呭喌">
+ <el-checkbox-group v-model="formData.othercases">
+ <el-checkbox
+ v-for="dict in dict.type.sys_OtherCases || []"
+ :key="dict.value"
+ :label="dict.value"
+ >
+ {{ dict.label }}
+ </el-checkbox>
+ </el-checkbox-group>
</el-form-item>
</el-col>
</el-row>
@@ -344,6 +430,128 @@
</el-row>
</el-card>
+ <!-- 鎰忔効鍜屼翰灞炰俊鎭儴鍒� -->
+ <el-card header="鎰忔効鍜屼翰灞炰俊鎭�" class="form-section">
+ <!-- 鏈汉鎰忔効 -->
+ <el-row>
+ <el-col :span="24">
+ <el-form-item align="left" label="鏈汉鎰忔効 ">
+ <el-checkbox-group v-model="formData.selfwill">
+ <el-checkbox
+ v-for="dict in dict.type.sys_SelfWill || []"
+ :key="dict.value"
+ :label="dict.value"
+ >
+ {{ dict.label }}
+ </el-checkbox>
+ </el-checkbox-group>
+ </el-form-item>
+ </el-col>
+ </el-row>
+
+ <!-- 浜插睘鐘跺喌 -->
+ <el-row>
+ <el-col :span="12">
+ <el-form-item
+ label="浜插睘鐘跺喌"
+ prop="kinship"
+ class="relation"
+ align="left"
+ >
+ <el-checkbox-group v-model="formData.kinship">
+ <el-checkbox
+ v-for="dict in dict.type.sys_Kinship || []"
+ :key="dict.value"
+ :label="dict.value"
+ >
+ {{ dict.label }}
+ </el-checkbox>
+ </el-checkbox-group>
+ </el-form-item>
+ </el-col>
+ <el-col :span="12">
+ <el-form-item label="鍏朵粬" prop="kinshipOther">
+ <el-input
+ v-model="formData.kinshipOther"
+ placeholder="璇疯緭鍏ュ叾浠�"
+ />
+ </el-form-item>
+ </el-col>
+ </el-row>
+
+ <!-- 涓昏浜插睘 -->
+ <el-row>
+ <el-col :span="12">
+ <el-form-item label="涓昏浜插睘" prop="majorrelatives">
+ <el-input
+ v-model="formData.majorrelatives"
+ placeholder="璇疯緭鍏ヤ富瑕佷翰灞�"
+ />
+ </el-form-item>
+ </el-col>
+ <el-col :span="8">
+ <el-form-item label="涓庢崘璧犺�呭叧绯�" prop="familyrelations">
+ <el-select
+ v-model="formData.familyrelations"
+ placeholder="璇烽�夋嫨涓庢崘璧犺�呭叧绯�"
+ >
+ <el-option
+ v-for="dict in dict.type.sys_FamilyRelation || []"
+ :key="dict.value"
+ :label="dict.label"
+ :value="dict.value"
+ />
+ </el-select>
+ </el-form-item>
+ </el-col>
+ </el-row>
+
+ <!-- 淇℃伅鏉ユ簮 -->
+ <el-row>
+ <el-col :span="12">
+ <el-form-item align="left" label="淇℃伅鏉ユ簮">
+ <el-checkbox-group v-model="formData.infosources">
+ <el-checkbox
+ v-for="dict in dict.type.sys_InfoSources || []"
+ :key="dict.value"
+ :label="dict.value"
+ >
+ {{ dict.label }}
+ </el-checkbox>
+ </el-checkbox-group>
+ </el-form-item>
+ </el-col>
+ <el-col :span="8">
+ <el-form-item label="鍏朵粬" prop="infosourcesOther">
+ <el-input
+ v-model="formData.infosourcesOther"
+ placeholder="璇疯緭鍏ヤ俊鎭潵婧愬叾浠�"
+ />
+ </el-form-item>
+ </el-col>
+ </el-row>
+
+ <!-- 淇℃伅鍛� -->
+ <el-row>
+ <el-col :span="8">
+ <el-form-item label="淇℃伅鍛�" prop="infoname">
+ <el-input
+ v-model="formData.infoname"
+ placeholder="璇疯緭鍏ヤ俊鎭憳"
+ />
+ </el-form-item>
+ </el-col>
+ <el-col :span="8">
+ <el-form-item label="鑱旂郴鐢佃瘽" prop="infophone">
+ <el-input
+ v-model="formData.infophone"
+ placeholder="璇疯緭鍏ヤ俊鎭憳鑱旂郴鐢佃瘽"
+ />
+ </el-form-item>
+ </el-col>
+ </el-row>
+ </el-card>
+
<!-- 鎹愮尞淇℃伅閮ㄥ垎 -->
<el-card header="鎹愮尞淇℃伅" class="form-section">
<el-row :gutter="20">
@@ -354,7 +562,7 @@
placeholder="璇烽�夋嫨鎹愮尞绫诲埆"
>
<el-option
- v-for="dict in dictOptions.sys_DonationCategory"
+ v-for="dict in dict.type.sys_DonationCategory || []"
:key="dict.value"
:label="dict.label"
:value="dict.value"
@@ -400,6 +608,38 @@
<el-input
v-model="formData.acquisitiontissuename"
placeholder="璇疯緭鍏ヨ幏鍙栫粍缁囧悕绉�"
+ />
+ </el-form-item>
+ </el-col>
+ </el-row>
+
+ <!-- 绾㈠崄瀛椾細鍜岃仈绯讳汉 -->
+ <el-row>
+ <el-col :span="8">
+ <el-form-item align="left" label="绾㈠崄瀛椾細" prop="redorganno">
+ <org-selecter
+ ref="addCrossOrgSelect"
+ :org-type="'2'"
+ v-model="formData.redorganno"
+ />
+ </el-form-item>
+ </el-col>
+ <el-col :span="8">
+ <el-form-item label="鑱旂郴浜�" prop="contactperson">
+ <el-input
+ v-model="formData.contactperson"
+ placeholder="璇疯緭鍏ヨ仈绯讳汉"
+ />
+ </el-form-item>
+ </el-col>
+ <el-col :span="8">
+ <el-form-item label="鑱旂郴鏃堕棿" prop="contacttime">
+ <el-date-picker
+ v-model="formData.contacttime"
+ type="datetime"
+ value-format="yyyy-MM-dd HH:mm:ss"
+ placeholder="閫夋嫨鎶ュ憡鏃堕棿"
+ style="width: 100%"
/>
</el-form-item>
</el-col>
@@ -496,7 +736,25 @@
LiAreaSelect
},
- dicts: ["sys_bloodtype_rhd", "sys_BloodType"],
+ // 娣诲姞鎵�鏈夐渶瑕佺殑瀛楀吀绫诲瀷
+ dicts: [
+ "sys_bloodtype_rhd",
+ "sys_BloodType",
+ "sys_user_sex",
+ "sys_IDType",
+ "sys_nation",
+ "sys_education",
+ "sys_occupation",
+ "sys_DiseaseType",
+ "sys_Infectious",
+ "sys_patientstate",
+ "sys_OtherCases",
+ "sys_SelfWill",
+ "sys_Kinship",
+ "sys_FamilyRelation",
+ "sys_InfoSources",
+ "sys_DonationCategory"
+ ],
props: {
visible: {
@@ -564,7 +822,7 @@
return this.visible;
},
set(value) {
- this.$emit('update:visible', value);
+ this.$emit("update:visible", value);
if (!value) {
this.handleClose();
}
@@ -592,15 +850,15 @@
}
},
created() {
- console.log('EditCaseModal created');
- console.log('visible:', this.visible);
- console.log('editData:', this.editData);
+ console.log("EditCaseModal created");
+ console.log("visible:", this.visible);
+ console.log("editData:", this.editData);
},
mounted() {
- console.log('EditCaseModal mounted');
- console.log('visible:', this.visible);
- console.log('editData:', this.editData);
- console.log('isEdit:', this.isEdit);
+ console.log("EditCaseModal mounted");
+ console.log("visible:", this.visible);
+ console.log("editData:", this.editData);
+ console.log("isEdit:", this.isEdit);
},
methods: {
getDefaultFormData() {
@@ -642,14 +900,32 @@
illnessoverview: null,
coordinatorNo: null,
coordinatorName: null,
+ diseasetype: [],
+ infectious: [],
+ patientstate: [],
+ othercases: [],
// 鍦板潃淇℃伅
residenceaddress: null,
residenceprovince: null,
residencecity: null,
+ residencetown: null,
registeraddress: null,
registerprovince: null,
registercity: null,
+ registertown: null,
+
+ // 鎰忔効鍜屼翰灞炰俊鎭�
+ selfwill: [],
+ kinship: [],
+ majorrelatives: null,
+ familyrelations: null,
+ infosources: [],
+ infoname: null,
+ infophone: null,
+ redorganno: null,
+ contactperson: null,
+ contacttime: null,
// 鎹愮尞淇℃伅
donationcategory: null,
@@ -665,25 +941,22 @@
reporttime: null,
deptid: null,
- // 鏁扮粍瀛楁
- diseasetype: [],
- infectious: [],
- selfwill: [],
- othercases: [],
- infosources: [],
- kinship: [],
- patientstate: []
+ // 鍏朵粬瀛楁
+ diseasetypeOther: null,
+ infectiousOther: null,
+ kinshipOther: null,
+ infosourcesOther: null
};
},
async initForm() {
- console.log('鍒濆鍖栬〃鍗曪紝isEdit:', this.isEdit);
+ console.log("鍒濆鍖栬〃鍗曪紝isEdit:", this.isEdit);
try {
if (this.isEdit && this.editData && this.editData.id) {
- console.log('鍔犺浇缂栬緫鏁版嵁锛宨d:', this.editData.id);
+ console.log("鍔犺浇缂栬緫鏁版嵁锛宨d:", this.editData.id);
await this.loadEditData();
} else {
- console.log('鏂板妯″紡锛屽垵濮嬪寲琛ㄥ崟');
+ console.log("鏂板妯″紡锛屽垵濮嬪寲琛ㄥ崟");
this.formData = this.getDefaultFormData();
this.formData.nationality = "涓浗";
this.formData.bloodtype = "0";
@@ -708,7 +981,7 @@
try {
const response = await getDonatebaseinfo(this.editData.id);
const data = response.data;
- console.log('鍔犺浇鍒扮殑鏁版嵁:', data);
+ console.log("鍔犺浇鍒扮殑鏁版嵁:", data);
// 澶勭悊鏁扮粍瀛楁
const arrayFields = [
@@ -721,15 +994,15 @@
"patientstate"
];
arrayFields.forEach(field => {
- if (data[field]) {
+ if (data[field] && typeof data[field] === "string") {
data[field] = data[field].split(",");
- } else {
+ } else if (!data[field]) {
data[field] = [];
}
});
this.formData = { ...this.getDefaultFormData(), ...data };
- console.log('鍚堝苟鍚庣殑formData:', this.formData);
+ console.log("鍚堝苟鍚庣殑formData:", this.formData);
// 璁剧疆鍦板潃淇℃伅
if (data.residenceprovince) {
@@ -864,7 +1137,7 @@
},
handleClose() {
- console.log('鍏抽棴寮规');
+ console.log("鍏抽棴寮规");
this.isEdit = false;
this.submitLoading = false;
this.formData = this.getDefaultFormData();
@@ -880,12 +1153,14 @@
this.submitLoading = true;
try {
const submitData = this.processSubmitData();
- console.log('鎻愪氦鏁版嵁:', submitData);
+ console.log("鎻愪氦鏁版嵁:", submitData);
const result = await updateDonatebaseinfo(submitData);
if (result.code === 200) {
this.$message.success(this.isEdit ? "鏇存柊鎴愬姛" : "鏂板鎴愬姛");
this.$emit("success", result.data);
+ console.log(1122);
+
this.handleClose();
} else {
this.$message.error(result.msg || "鎿嶄綔澶辫触");
@@ -935,6 +1210,11 @@
"YYYY-MM-DD HH:mm:ss"
);
}
+ if (data.contacttime) {
+ data.contacttime = this.$moment(data.contacttime).format(
+ "YYYY-MM-DD HH:mm:ss"
+ );
+ }
// 璁剧疆榛樿鍊�
if (!data.recordstate) {
diff --git a/src/views/project/donatebaseinfo/index.vue b/src/views/project/donatebaseinfo/index.vue
index f243ed9..10928eb 100644
--- a/src/views/project/donatebaseinfo/index.vue
+++ b/src/views/project/donatebaseinfo/index.vue
@@ -553,6 +553,7 @@
/** 澶勭悊缂栬緫寮圭獥鍏抽棴 */
handleEditClosed() {
this.currentEditData = {};
+ this.editModalVisible = false;
},
handleModalVisibleChange(newVisible) {
--
Gitblit v1.9.3