From c8e9849cb5f24848df0174c13bfbbff37bb08a5a Mon Sep 17 00:00:00 2001
From: WXL <wl_5969728@163.com>
Date: 星期二, 21 七月 2026 15:45:30 +0800
Subject: [PATCH] 维护
---
src/views/business/allocation/allocationInfo.vue | 872 +++++++++++++++++++++++++--------------------------------
1 files changed, 389 insertions(+), 483 deletions(-)
diff --git a/src/views/business/allocation/allocationInfo.vue b/src/views/business/allocation/allocationInfo.vue
index c78d505..1ab3aab 100644
--- a/src/views/business/allocation/allocationInfo.vue
+++ b/src/views/business/allocation/allocationInfo.vue
@@ -5,47 +5,22 @@
<el-card class="detail-card">
<div slot="header" class="clearfix">
<span class="detail-title">鍣ㄥ畼鍒嗛厤鍩烘湰淇℃伅</span>
- <div style="float: right;">
- <el-button type="primary" @click="handleSave" :loading="saveLoading">
- 淇濆瓨
- </el-button>
- <el-button
- type="success"
- @click="handleConfirmAllocation"
- :disabled="form.allocationStatus == '1'"
- :loading="confirmLoading"
- >
- 纭鍒嗛厤
- </el-button>
- </div>
</div>
<el-form :model="form" ref="form" :rules="rules" label-width="120px">
<el-row :gutter="20">
<el-col :span="12">
<el-form-item label="鍒嗛厤鐘舵��" prop="allocationStatus">
- <el-select
- v-model="form.allocationStatus"
- placeholder="璇烽�夋嫨鍒嗛厤鐘舵��"
- >
- <el-option
- v-for="dict in dict.type.organ_allocation_status || []"
- :key="dict.value"
- :label="dict.label"
- :value="dict.value"
- ></el-option>
+ <el-select v-model="form.allocationStatus" placeholder="璇烽�夋嫨鍒嗛厤鐘舵��">
+ <el-option v-for="dict in dict.type.organ_allocation_status || []" :key="dict.value" :label="dict.label"
+ :value="dict.value"></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="鍒嗛厤鏃堕棿" prop="allocationTime">
- <el-date-picker
- v-model="form.allocationTime"
- type="datetime"
- value-format="yyyy-MM-dd HH:mm:ss"
- style="width: 100%"
- :disabled="form.allocationStatus == '1'"
- />
+ <el-date-picker v-model="form.allocationTime" type="datetime" value-format="yyyy-MM-dd HH:mm:ss"
+ style="width: 100%" :disabled="form.allocationStatus == '1'" />
</el-form-item>
</el-col>
</el-row>
@@ -56,16 +31,7 @@
<el-input v-model="form.registrationName" />
</el-form-item>
</el-col>
- <el-col :span="12">
- <el-form-item label="鐧昏鏃堕棿" prop="registrationTime">
- <el-date-picker
- v-model="form.registrationTime"
- type="datetime"
- value-format="yyyy-MM-dd HH:mm:ss"
- style="width: 100%"
- />
- </el-form-item>
- </el-col>
+
</el-row>
</el-form>
</el-card>
@@ -75,55 +41,22 @@
<div slot="header" class="clearfix">
<span class="detail-title">鍣ㄥ畼鍒嗛厤璁板綍</span>
<div style="float: right;">
- <el-tag
- :type="
- form.allocationStatus == '1'
- ? 'success'
- : form.allocationStatus == '2'
- ? 'danger'
- : 'warning'
- "
- >
- {{
- form.allocationStatus == "1"
- ? "宸插垎閰�"
- : form.allocationStatus == "2"
- ? "浣滃簾"
- : "鏈垎閰�"
- }}
- </el-tag>
+ <dict-tag :options="dict.type.organ_allocation_status" :value="form.allocationStatus" />
</div>
</div>
- <el-form
- ref="allocationForm"
- :rules="allocationRules"
- :model="allocationData"
- label-position="right"
- >
+ <el-form ref="allocationForm" :rules="allocationRules" :model="allocationData" label-position="right">
<el-row>
<el-col>
<el-form-item label-width="100px" label="鍒嗛厤鍣ㄥ畼">
- <el-checkbox-group
- v-model="selectedOrgans"
- @change="handleOrganSelectionChange"
- >
- <el-checkbox
- v-for="dict in dict.type.sys_Organ || []"
- :key="dict.value"
- :label="dict.value"
- :disabled="form.allocationStatus == '1'"
- >
+ <el-checkbox-group v-model="selectedOrgans" @change="handleOrganSelectionChange">
+ <el-checkbox v-for="dict in dict.type.sys_Organ || []" :key="dict.value" :label="dict.value"
+ :disabled="form.allocationStatus == '1'">
{{ dict.label }}
</el-checkbox>
</el-checkbox-group>
- <el-input
- v-if="showOtherInput"
- v-model="otherOrganInput"
- placeholder="璇疯緭鍏ュ叾浠栧櫒瀹樺悕绉�"
- style="margin-top: 10px; width: 300px;"
- :disabled="form.allocationStatus == '1'"
- />
+ <el-input v-if="showOtherInput" v-model="otherOrganInput" placeholder="璇疯緭鍏ュ叾浠栧櫒瀹樺悕绉�"
+ style="margin-top: 10px; width: 300px;" :disabled="form.allocationStatus == '1'" />
</el-form-item>
</el-col>
</el-row>
@@ -131,56 +64,26 @@
<el-row>
<el-col>
<el-form-item>
- <el-table
- :data="allocationData.serviceDonateorganList"
- v-loading="loading"
- border
- style="width: 100%"
- :row-class-name="getOrganRowClassName"
- >
- <el-table-column
- label="搴忓彿"
- type="index"
- width="60"
- align="center"
- fixed
- ></el-table-column>
+ <el-table :data="displayOrgans" v-loading="loading" border style="width: 100%"
+ :row-class-name="getOrganRowClassName">
+ <el-table-column label="搴忓彿" type="index" width="60" align="center" fixed></el-table-column>
- <el-table-column
- label="鍒嗛厤鐘舵��"
- align="center"
- width="100"
- prop="allocationstatus"
- fixed
- >
+ <el-table-column label="鍒嗛厤鐘舵��" align="center" width="100" prop="allocationstatus" fixed>
<template slot-scope="scope">
- <el-tag
- :type="
- getAllocationStatusTagType(scope.row.allocationstatus)
- "
- size="small"
- >
+ <el-tag :type="getAllocationStatusTagType(scope.row.allocationstatus)
+ " size="small">
{{ getAllocationStatusText(scope.row.allocationstatus) }}
</el-tag>
</template>
</el-table-column>
- <el-table-column
- label="鍣ㄥ畼鍚嶇О"
- align="center"
- width="120"
- prop="organname"
- >
+ <el-table-column label="鍣ㄥ畼鍚嶇О" align="center" width="120" prop="organname">
<template slot-scope="scope">
- <el-input
- v-model="scope.row.organname"
- placeholder="鍣ㄥ畼鍚嶇О"
- :disabled="true"
- />
+ <el-input v-model="scope.row.organname" placeholder="鍣ㄥ畼鍚嶇О" :disabled="true" />
</template>
</el-table-column>
- <el-table-column
+ <!-- <el-table-column
label="鍒嗛厤绯荤粺缂栧彿"
align="center"
width="150"
@@ -196,143 +99,78 @@
"
/>
</template>
+ </el-table-column> -->
+
+ <el-table-column label="鍒嗛厤寮�濮嬫椂闂�" align="center" width="180" prop="applicanttime">
+ <template slot-scope="scope">
+ <el-date-picker clearable size="small" style="width: 100%" v-model="scope.row.applicanttime"
+ type="datetime" value-format="yyyy-MM-dd HH:mm:ss" placeholder="閫夋嫨寮�濮嬫帴鏀舵椂闂�" :disabled="form.allocationStatus == '1' ||
+ scope.row.allocationstatus == '3'
+ " />
+ </template>
+ </el-table-column>
+ <el-table-column label="鍒嗛厤鎺ユ敹鏃堕棿" align="center" width="180" prop="organgettime">
+ <template slot-scope="scope">
+ <el-date-picker clearable size="small" style="width: 100%" v-model="scope.row.organgettime"
+ type="datetime" value-format="yyyy-MM-dd HH:mm:ss" placeholder="閫夋嫨鍒嗛厤鎺ユ敹鏃堕棿" :disabled="form.allocationStatus == '1' ||
+ scope.row.allocationstatus == '3'
+ " />
+ </template>
</el-table-column>
- <el-table-column
- label="鍒嗛厤寮�濮嬫椂闂�"
- align="center"
- width="180"
- prop="applicanttime"
- >
+ <el-table-column label="鍙椾綋濮撴皬" align="center" width="120" prop="name">
<template slot-scope="scope">
- <el-date-picker
- clearable
- size="small"
+ <el-input v-model="scope.row.name" placeholder="鍙椾綋濮撴皬" :disabled="form.allocationStatus == '1' ||
+ scope.row.allocationstatus == '3'
+ " />
+ </template>
+ </el-table-column>
+
+ <el-table-column label="绉绘鍖婚櫌" align="center" width="200" prop="transplanthospitalname">
+ <template slot-scope="scope">
+ <el-autocomplete v-model="scope.row.transplanthospitalname" :fetch-suggestions="queryHospitalSearch"
+ placeholder="璇烽�夋嫨鎴栬緭鍏ョЩ妞嶅尰闄�" style="width: 100%" clearable></el-autocomplete>
+ </template>
+ <!-- <template slot-scope="scope">
+ <el-select
+ v-model="scope.row.transplanthospitalname"
+ placeholder="璇烽�夋嫨绉绘鍖婚櫌"
style="width: 100%"
- v-model="scope.row.applicanttime"
- type="datetime"
- value-format="yyyy-MM-dd HH:mm:ss"
- placeholder="閫夋嫨寮�濮嬫帴鏀舵椂闂�"
- :disabled="
- form.allocationStatus == '1' ||
- scope.row.allocationstatus == '3'
- "
- />
- </template>
- </el-table-column>
- <el-table-column
- label="鍒嗛厤鎺ユ敹鏃堕棿"
- align="center"
- width="180"
- prop="organgettime"
- >
- <template slot-scope="scope">
- <el-date-picker
- clearable
- size="small"
- style="width: 100%"
- v-model="scope.row.organgettime"
- type="datetime"
- value-format="yyyy-MM-dd HH:mm:ss"
- placeholder="閫夋嫨鍒嗛厤鎺ユ敹鏃堕棿"
- :disabled="
- form.allocationStatus == '1' ||
- scope.row.allocationstatus == '3'
- "
- />
- </template>
- </el-table-column>
-
- <el-table-column
- label="鍙椾綋濮撴皬"
- align="center"
- width="120"
- prop="name"
- >
- <template slot-scope="scope">
- <el-input
- v-model="scope.row.name"
- placeholder="鍙椾綋濮撴皬"
- :disabled="
- form.allocationStatus == '1' ||
- scope.row.allocationstatus == '3'
- "
- />
- </template>
- </el-table-column>
-
- <el-table-column
- label="绉绘鍖婚櫌"
- align="center"
- width="200"
- prop="transplanthospitalno"
- >
- <template slot-scope="scope">
- <div>
- <org-selecter
- ref="tranHosSelect"
- :org-type="'4'"
- :dataList="dataList"
- v-model="scope.row.transplanthospitalno"
- style="width: 100%"
- :disabled="
- form.allocationStatus == '1' ||
- scope.row.allocationstatus == '3'
- "
- />
- </div>
- </template>
+ >
+ <el-option
+ v-for="dict in dict.type.Geta_hospital"
+ :key="dict.value"
+ :label="dict.label"
+ :value="dict.value"
+ ></el-option>
+ </el-select>
+ </template> -->
</el-table-column>
<!-- 淇敼template涓殑璇存槑鍒� -->
- <el-table-column
- label="璇存槑"
- align="center"
- prop="reallocationreason"
- min-width="200"
- >
+ <el-table-column label="璇存槑" align="center" prop="reallocationreason" min-width="200">
<template slot-scope="scope">
<div v-if="scope.row.allocationstatus != '3'">
- <el-input
- type="textarea"
- clearable
- v-model="scope.row.reallocationreason"
- placeholder="璇疯緭鍏ヨ鏄�"
- :disabled="
- form.allocationStatus == '1' ||
- scope.row.allocationstatus == '3'
- "
- />
+ <el-input type="textarea" clearable v-model="scope.row.reallocationreason" placeholder="璇疯緭鍏ヨ鏄�"
+ :disabled="form.allocationStatus == '1' ||
+ scope.row.allocationstatus == '3'
+ " />
</div>
<div v-else>
<!-- 閲嶅垎閰嶈褰曪細鏄剧ず璇︾粏鏌ョ湅鎸夐挳 -->
- <el-button
- v-if="scope.row.reallocationreason"
- type="text"
- size="small"
- @click="handleViewRedistributionDetail(scope.row)"
- style="color: #e6a23c;"
- >
+ <el-button v-if="scope.row.reallocationreason" type="text" size="small"
+ @click="handleViewRedistributionDetail(scope.row)" style="color: #e6a23c;">
<i class="el-icon-document"></i>
鏌ョ湅閲嶅垎閰嶈鎯�
</el-button>
<span v-else class="no-data">-</span>
<!-- 淇濈暀鍘熸湁鐨勫伐鍏锋彁绀猴紙鍙Щ闄ゆ垨淇濈暀锛� -->
- <el-tooltip
- v-if="scope.row.redistributionInfo"
- :content="
- formatRedistributionTooltip(
- scope.row.redistributionInfo
- )
- "
- placement="top"
- >
- <el-button
- type="text"
- size="small"
- style="margin-left: 5px;"
- >
+ <el-tooltip v-if="scope.row.redistributionInfo" :content="formatRedistributionTooltip(
+ scope.row.redistributionInfo
+ )
+ " placement="top">
+ <el-button type="text" size="small" style="margin-left: 5px;">
<i class="el-icon-info"></i>
</el-button>
</el-tooltip>
@@ -340,29 +178,24 @@
</template>
</el-table-column>
- <el-table-column
- label="鎿嶄綔"
- align="center"
- width="120"
- class-name="small-padding fixed-width"
- v-if="form.allocationStatus !== '1'"
- fixed="right"
- >
+ <el-table-column label="鎿嶄綔" align="center" width="120" class-name="small-padding fixed-width"
+ v-if="form.allocationStatus !== '1'" fixed="right">
<template slot-scope="scope">
- <el-button
- size="mini"
- type="text"
- icon="el-icon-copy-document"
- @click="handleRedistribution(scope.row)"
- :disabled="
- scope.row.allocationstatus == '3' || !scope.row.caseno
- "
- style="color: #e6a23c;"
- >
+ <el-button size="mini" type="text" icon="el-icon-copy-document"
+ @click="handleRedistribution(scope.row)" :disabled="scope.row.allocationstatus == '3'"
+ style="color: #e6a23c;">
{{
scope.row.allocationstatus == "3"
? "宸查噸鍒嗛厤"
: "閲嶅垎閰�"
+ }}
+ </el-button>
+ <el-button v-if="scope.row.allocationstatus != '3'" size="mini" type="text" icon="el-icon-delete"
+ @click="handleInvalidate(scope.row)" :disabled="scope.row.allocationstatus == '3' ||
+ scope.row.allocationstatus == '2'
+ " style="color: #f56c6c;">
+ {{
+ scope.row.allocationstatus == "2" ? "宸蹭綔搴�" : "浣滃簾"
}}
</el-button>
</template>
@@ -373,7 +206,7 @@
</el-row>
<!-- 鍒嗛厤缁熻淇℃伅 -->
- <div
+ <!-- <div
class="allocation-stats"
v-if="
allocationData.serviceDonateorganList &&
@@ -408,9 +241,12 @@
</div>
</el-col>
</el-row>
- </div>
+ </div> -->
- <div v-else class="empty-allocation">
+ <div v-if="
+ !allocationData.serviceDonateorganList ||
+ allocationData.serviceDonateorganList.length == 0
+ " class="empty-allocation">
<el-empty description="鏆傛棤鍒嗛厤璁板綍" :image-size="80">
<span>璇峰厛閫夋嫨瑕佸垎閰嶇殑鍣ㄥ畼</span>
</el-empty>
@@ -423,34 +259,21 @@
<div class="attachment-header">
<i class="el-icon-paperclip"></i>
<span class="attachment-title">鐩稿叧闄勪欢</span>
- <span class="attachment-tip"
- >鏀寔涓婁紶鍣ㄥ畼鍒嗛厤鐩稿叧鏂囦欢 (鏈�澶歿{ attachmentLimit }}涓�)</span
- >
+ <span class="attachment-tip">鏀寔涓婁紶鍣ㄥ畼鍒嗛厤鐩稿叧鏂囦欢 (鏈�澶歿{ attachmentLimit }}涓�)</span>
</div>
<!-- 浣跨敤 UploadAttachment 缁勪欢 -->
- <UploadAttachment
- ref="uploadAttachment"
- :file-list="attachmentFileList"
- :limit="attachmentLimit"
- :accept="attachmentAccept"
- :multiple="true"
- @change="handleAttachmentChange"
- @upload-success="handleUploadSuccess"
- @upload-error="handleUploadError"
- @remove="handleAttachmentRemove"
- />
+ <UploadAttachment ref="uploadAttachment" :file-list="attachmentFileList" :limit="attachmentLimit"
+ :accept="attachmentAccept" :multiple="true" @change="handleAttachmentChange"
+ @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">
+ <el-table-column label="鏂囦欢鍚�" min-width="150">
<template slot-scope="scope">
- <i
- class="el-icon-document"
- :style="{ color: getFileIconColor(scope.row.fileName) }"
- ></i>
+ <i class="el-icon-document" :style="{ color: getFileIconColor(scope.row.fileName) }"></i>
<span class="file-name">{{ scope.row.fileName }}</span>
</template>
</el-table-column>
@@ -471,28 +294,16 @@
<span>{{ formatFileSize(scope.row.fileSize) }}</span>
</template>
</el-table-column>
- <el-table-column label="鎿嶄綔" width="200" fixed="right">
+ <el-table-column label="鎿嶄綔" width="280" fixed="right">
<template slot-scope="scope">
- <el-button
- size="mini"
- type="primary"
- @click="handlePreview(scope.row)"
- :disabled="!isPreviewable(scope.row.fileName)"
- >
+ <el-button size="mini" type="primary" @click="handlePreview(scope.row)"
+ :disabled="!isPreviewable(scope.row.fileName)">
棰勮
</el-button>
- <el-button
- size="mini"
- type="success"
- @click="handleDownloadAttachment(scope.row)"
- >
+ <el-button size="mini" type="success" @click="handleDownloadAttachment(scope.row)">
涓嬭浇
</el-button>
- <el-button
- size="mini"
- type="danger"
- @click="handleRemoveAttachment(scope.$index)"
- >
+ <el-button size="mini" type="danger" @click="handleRemoveAttachment(scope.$index)">
鍒犻櫎
</el-button>
</template>
@@ -500,52 +311,34 @@
</el-table>
</div>
</el-card>
-
+ <div style="text-align: center; margin: 30px 0;">
+ <el-button type="primary" @click="handleSave" :loading="saveLoading">
+ 淇濆瓨
+ </el-button>
+ <el-button type="success" @click="handleConfirmAllocation" :disabled="form.allocationStatus == '1'"
+ :loading="confirmLoading">
+ 纭鍒嗛厤
+ </el-button>
+ </div>
<!-- 閲嶅垎閰嶅璇濇 -->
- <el-dialog
- title="鍣ㄥ畼閲嶅垎閰�"
- :visible.sync="redistributionDialogVisible"
- width="500px"
- @close="handleRedistributionDialogClose"
- >
- <el-form
- :model="redistributionForm"
- :rules="redistributionRules"
- ref="redistributionFormRef"
- label-width="100px"
- >
+ <el-dialog title="鍣ㄥ畼閲嶅垎閰�" :visible.sync="redistributionDialogVisible" width="500px"
+ @close="handleRedistributionDialogClose">
+ <el-form :model="redistributionForm" :rules="redistributionRules" ref="redistributionFormRef" label-width="100px">
<el-form-item label="鍘熷櫒瀹樹俊鎭�">
<el-input v-model="redistributionForm.organname" readonly />
</el-form-item>
<el-form-item label="閲嶅垎閰嶅師鍥�" prop="reason" required>
- <el-input
- type="textarea"
- :rows="4"
- v-model="redistributionForm.reason"
- placeholder="璇疯緭鍏ラ噸鍒嗛厤鍘熷洜"
- />
+ <el-input type="textarea" :rows="4" v-model="redistributionForm.reason" placeholder="璇疯緭鍏ラ噸鍒嗛厤鍘熷洜" />
</el-form-item>
<el-form-item label="閲嶅垎閰嶆椂闂�" prop="redistributionTime" required>
- <el-date-picker
- v-model="redistributionForm.redistributionTime"
- type="datetime"
- placeholder="璇烽�夋嫨閲嶅垎閰嶆椂闂�"
- value-format="yyyy-MM-dd HH:mm:ss"
- style="width: 100%"
- />
+ <el-date-picker v-model="redistributionForm.redistributionTime" type="datetime" placeholder="璇烽�夋嫨閲嶅垎閰嶆椂闂�"
+ value-format="yyyy-MM-dd HH:mm:ss" style="width: 100%" />
</el-form-item>
<el-form-item label="閲嶅垎閰嶉檮浠�">
- <UploadAttachment
- ref="redistributionAttachmentUpload"
- :file-list="redistributionAttachmentList"
- :limit="5"
- :accept="attachmentAccept"
- :multiple="true"
- @change="handleRedistributionChange"
- @upload-success="handleRedistributionUploadSuccess"
- @upload-error="handleRedistributionUploadError"
- @remove="handleRedistributionAttachmentRemove"
- />
+ <UploadAttachment ref="redistributionAttachmentUpload" :file-list="redistributionAttachmentList" :limit="5"
+ :accept="attachmentAccept" :multiple="true" @change="handleRedistributionChange"
+ @upload-success="handleRedistributionUploadSuccess" @upload-error="handleRedistributionUploadError"
+ @remove="handleRedistributionAttachmentRemove" />
<div style="margin-top: 5px; font-size: 12px; color: #999;">
鏀寔涓婁紶閲嶅垎閰嶇浉鍏虫枃浠� (鏈�澶�5涓�)
</div>
@@ -553,21 +346,13 @@
</el-form>
<div slot="footer">
<el-button @click="redistributionDialogVisible = false">鍙栨秷</el-button>
- <el-button
- type="primary"
- @click="handleRedistributionConfirm"
- :loading="redistributionLoading"
- >
+ <el-button type="primary" @click="handleRedistributionConfirm" :loading="redistributionLoading">
纭閲嶅垎閰�
</el-button>
</div>
</el-dialog>
<!-- 鍦╰emplate涓坊鍔犻噸鍒嗛厤璇︽儏寮圭獥 -->
- <el-dialog
- title="閲嶅垎閰嶈鎯�"
- :visible.sync="redistributionDetailDialogVisible"
- width="600px"
- >
+ <el-dialog title="閲嶅垎閰嶈鎯�" :visible.sync="redistributionDetailDialogVisible" width="600px">
<div v-loading="redistributionDetailLoading">
<div v-if="currentRedistributionDetail" style="padding: 20px;">
<!-- 鍩烘湰淇℃伅 -->
@@ -589,8 +374,8 @@
{{
currentRedistributionDetail.redistributionTime
? formatDateTime(
- currentRedistributionDetail.redistributionTime
- )
+ currentRedistributionDetail.redistributionTime
+ )
: "-"
}}
</el-descriptions-item>
@@ -599,46 +384,30 @@
<!-- 閲嶅垎閰嶅師鍥� -->
<div style="margin-top: 20px;">
<div class="section-title">閲嶅垎閰嶅師鍥�</div>
- <div
- class="section-content"
- style="padding: 10px; background: #f5f7fa; border-radius: 4px;"
- >
+ <div class="section-content" style="padding: 10px; background: #f5f7fa; border-radius: 4px;">
{{ currentRedistributionDetail.reason || "鏃�" }}
</div>
</div>
<!-- 閲嶅垎閰嶉檮浠� -->
- <div
- style="margin-top: 20px;"
- v-if="
- currentRedistributionDetail.attachments &&
- currentRedistributionDetail.attachments.length > 0
- "
- >
+ <div style="margin-top: 20px;" v-if="
+ currentRedistributionDetail.attachments &&
+ currentRedistributionDetail.attachments.length > 0
+ ">
<div class="section-title">
閲嶅垎閰嶉檮浠� ({{ currentRedistributionDetail.attachments.length }})
</div>
<div class="redistribution-attachments">
- <el-table
- :data="currentRedistributionDetail.attachments"
- size="small"
- style="width: 100%"
- >
- <el-table-column label="鏂囦欢鍚�" min-width="200">
+ <el-table :data="currentRedistributionDetail.attachments" size="small" style="width: 100%">
+ <el-table-column label="鏂囦欢鍚�" min-width="150">
<template slot-scope="scope">
- <i
- class="el-icon-document"
- :style="{ color: getFileIconColor(scope.row.fileName) }"
- ></i>
+ <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"
- >
+ <el-tag :type="getFileTagType(scope.row.fileName)" size="small">
{{ getFileTypeText(scope.row.fileName) }}
</el-tag>
</template>
@@ -654,19 +423,11 @@
</el-table-column>
<el-table-column label="鎿嶄綔" width="150" fixed="right">
<template slot-scope="scope">
- <el-button
- size="mini"
- type="primary"
- @click="handleRedistributionAttachmentPreview(scope.row)"
- :disabled="!isPreviewable(scope.row.fileName)"
- >
+ <el-button size="mini" type="primary" @click="handleRedistributionAttachmentPreview(scope.row)"
+ :disabled="!isPreviewable(scope.row.fileName)">
棰勮
</el-button>
- <el-button
- size="mini"
- type="success"
- @click="handleRedistributionAttachmentDownload(scope.row)"
- >
+ <el-button size="mini" type="success" @click="handleRedistributionAttachmentDownload(scope.row)">
涓嬭浇
</el-button>
</template>
@@ -675,27 +436,18 @@
</div>
</div>
- <div
- v-else
- style="margin-top: 20px; text-align: center; color: #909399;"
- >
+ <div v-else style="margin-top: 20px; text-align: center; color: #909399;">
鏃犻噸鍒嗛厤闄勪欢
</div>
</div>
</div>
<div slot="footer">
- <el-button @click="redistributionDetailDialogVisible = false"
- >鍏抽棴</el-button
- >
+ <el-button @click="redistributionDetailDialogVisible = false">鍏抽棴</el-button>
</div>
</el-dialog>
<!-- 闄勪欢棰勮瀵硅瘽妗� -->
- <FilePreviewDialog
- :visible="filePreviewVisible"
- :file="currentPreviewFile"
- @close="filePreviewVisible = false"
- @download="handleDownloadAttachment"
- />
+ <FilePreviewDialog :visible="filePreviewVisible" :file="currentPreviewFile" @close="filePreviewVisible = false"
+ @download="handleDownloadAttachment" />
</div>
</template>
@@ -725,6 +477,8 @@
"sys_DonationCategory",
"sys_RecordState",
"sys_Organ",
+ "Geta_hospital",
+
"organ_allocation_status"
],
data() {
@@ -825,16 +579,19 @@
currentUser() {
return JSON.parse(sessionStorage.getItem("user") || "{}");
},
+ displayOrgans() {
+ return (this.allocationData.serviceDonateorganList || [])
+ .filter(item => item.delFlag !== 1);
+ },
// 涓嶅畬鏁寸殑璁板綍鏁伴噺
incompleteRecords() {
if (!this.allocationData.serviceDonateorganList) return 0;
return this.allocationData.serviceDonateorganList.filter(
record =>
- !record.caseno ||
!record.applicanttime ||
!record.organgettime ||
!record.name ||
- !record.transplanthospitalno
+ !record.transplanthospitalname
).length;
},
// 寰呭鏍歌褰曟暟閲�
@@ -851,11 +608,10 @@
record => record.allocationstatus == "3"
).length;
},
- // 鍞竴鍖婚櫌鏁伴噺
uniqueHospitals() {
if (!this.allocationData.serviceDonateorganList) return 0;
const hospitals = this.allocationData.serviceDonateorganList
- .map(record => record.transplanthospitalno)
+ .map(record => record.transplanthospitalname)
.filter(Boolean);
return new Set(hospitals).size;
},
@@ -872,7 +628,7 @@
return {
"0": { label: "鎻愪氦鍒嗛厤", type: "info" },
"1": { label: "瀹℃牳閫氳繃", type: "success" },
- "2": { label: "瀹℃牳鎷掔粷", type: "danger" },
+ "2": { label: "宸蹭綔搴�", type: "danger" },
"3": { label: "閲嶅垎閰�", type: "warning" }
};
}
@@ -921,7 +677,17 @@
const statusMap = this.allocationStatusDict;
return statusMap[status] ? statusMap[status].label : "鏈煡鐘舵��";
},
+ queryHospitalSearch(queryString, cb) {
+ const hospitals = this.dict.type.Geta_hospital || [];
+ const results = queryString
+ ? hospitals.filter(item =>
+ item.label.toLowerCase().includes(queryString.toLowerCase())
+ )
+ : hospitals;
+ // el-autocomplete 闇�瑕� value 瀛楁
+ cb(results.map(item => ({ value: item.label })));
+ },
// 鏌ョ湅閲嶅垎閰嶈鎯�
handleViewRedistributionDetail(row) {
this.redistributionDetailLoading = true;
@@ -1067,7 +833,6 @@
if (response.code == 200 && response.data && response.data.length > 0) {
const data = response.data[0];
- data.allocationStatus = JSON.stringify(data.allocationStatus);
// 濉厖琛ㄥ崟鏁版嵁
Object.assign(this.form, data);
// 杞崲闄勪欢涓洪泦鍚�
@@ -1086,29 +851,29 @@
data.serviceDonateorganList
)
? data.serviceDonateorganList.map(item => {
- // 纭繚姣忔潯璁板綍閮芥湁鍒嗛厤鐘舵�佸瓧娈碉紝榛樿鍊间负0
- const allocationstatus = item.allocationstatus || "0";
- let redistributionInfo = null;
+ // 纭繚姣忔潯璁板綍閮芥湁鍒嗛厤鐘舵�佸瓧娈碉紝榛樿鍊间负0
+ const allocationstatus = item.allocationstatus || "0";
+ let redistributionInfo = null;
- // 瑙f瀽閲嶅垎閰嶄俊鎭�
- if (allocationstatus == "3" && item.reallocationreason) {
- try {
- redistributionInfo = JSON.parse(item.reallocationreason);
- console.log(redistributionInfo);
- } catch (error) {
- console.warn("瑙f瀽閲嶅垎閰嶄俊鎭け璐�:", error);
- redistributionInfo = item.reallocationreason;
- }
+ // 瑙f瀽閲嶅垎閰嶄俊鎭�
+ if (allocationstatus == "3" && item.reallocationreason) {
+ try {
+ redistributionInfo = JSON.parse(item.reallocationreason);
+ console.log(redistributionInfo);
+ } catch (error) {
+ console.warn("瑙f瀽閲嶅垎閰嶄俊鎭け璐�:", error);
+ redistributionInfo = item.reallocationreason;
}
+ }
- return {
- ...item,
- allocationstatus,
- redistributionInfo: redistributionInfo
- ? JSON.stringify(redistributionInfo)
- : null
- };
- })
+ return {
+ ...item,
+ allocationstatus,
+ redistributionInfo: redistributionInfo
+ ? JSON.stringify(redistributionInfo)
+ : null
+ };
+ })
: [];
// 鏇存柊閫変腑鐨勫櫒瀹�
@@ -1176,58 +941,78 @@
},
// 鍣ㄥ畼閫夋嫨鐘舵�佸彉鍖�
- handleOrganSelectionChange(selectedValues) {
- if (!this.allocationData.serviceDonateorganList) {
- this.allocationData.serviceDonateorganList = [];
+ async handleOrganSelectionChange(selectedValues) {
+ // 1. 澶勭悊浜掓枼閫昏緫锛堜慨鏀� this.selectedOrgans锛�
+ this.handleExclusiveSelections(selectedValues);
+
+ const finalSelected = this.selectedOrgans;
+ const records = this.allocationData.serviceDonateorganList || [];
+
+ // 2. 鏋勫缓鐩爣鍣ㄥ畼缂栧彿鍒楄〃锛堢洿鎺ヤ娇鐢ㄩ�変腑鐨勫�硷紝涓嶅睍寮�锛�
+ const targetOrganNos = finalSelected; // 杩欓噷涓嶅睍寮�锛屽氨鏄�変腑鐨勫櫒瀹樼紪鍙�
+
+ // 3. 鏂板鎴栨仮澶嶈褰�
+ targetOrganNos.forEach(no => {
+ const existing = records.find(r => r.organno === no);
+ if (existing) {
+ if (existing.delFlag === 1) {
+ existing.delFlag = 0; // 鎭㈠鏄剧ず
}
+ } else {
+ this.createOrganRecord(no);
+ }
+ });
- const currentOrganValues = this.allocationData.serviceDonateorganList.map(
- item => item.organno
+ // 4. 鎵惧嚭闇�瑕佸彇娑堢殑璁板綍锛堜笉鍦ㄧ洰鏍囬泦鍚堜腑锛�
+ const toRemove = records.filter(r => !targetOrganNos.includes(r.organno));
+ const toRemoveSaved = toRemove.filter(r => r.id); // 宸蹭繚瀛橈紝闇�纭
+ const toRemoveUnsaved = toRemove.filter(r => !r.id); // 鏈繚瀛橈紝鐩存帴绉婚櫎
+
+ // 4.1 鐩存帴绉婚櫎鏈繚瀛樼殑璁板綍
+ toRemoveUnsaved.forEach(r => {
+ const idx = records.indexOf(r);
+ if (idx !== -1) records.splice(idx, 1);
+ });
+
+ // 4.2 澶勭悊宸蹭繚瀛樼殑璁板綍锛氬脊绐楃‘璁�
+ if (toRemoveSaved.length > 0) {
+ const organNames = toRemoveSaved.map(r => r.organname).join('銆�');
+ try {
+ await this.$confirm(
+ `鎮ㄧ‘瀹氳鍙栨秷浠ヤ笅宸蹭繚瀛樼殑鍣ㄥ畼鍒嗛厤璁板綍鍚楋紵\n${organNames}\n鍙栨秷鍚庯紝杩欎簺璁板綍灏嗕粠鍒楄〃涓Щ闄わ紙鏁版嵁浠嶄繚鐣欙紝鍙仮澶嶏級銆俙,
+ '鎻愮ず',
+ {
+ confirmButtonText: '纭畾绉婚櫎',
+ cancelButtonText: '鍙栨秷',
+ type: 'warning'
+ }
);
-
- // 澶勭悊浜掓枼閫昏緫锛堝弬鑰冩崘鐚喅瀹氶〉闈級
- this.handleExclusiveSelections(selectedValues);
-
- // 鏂板閫夋嫨鐨勫櫒瀹�
- selectedValues.forEach(organValue => {
- if (!currentOrganValues.includes(organValue)) {
- this.createOrganRecord(organValue);
+ // 鐢ㄦ埛纭锛氭爣璁� delFlag=1锛屽苟浠庨�変腑鍒楄〃涓Щ闄�
+ toRemoveSaved.forEach(r => {
+ r.delFlag = 1;
+ // 浠� selectedOrgans 涓Щ闄ゅ搴旂殑鍣ㄥ畼缂栧彿
+ const idx = this.selectedOrgans.indexOf(r.organno);
+ if (idx !== -1) this.selectedOrgans.splice(idx, 1);
+ });
+ } catch (error) {
+ // 鐢ㄦ埛鍙栨秷锛氭仮澶嶉�変腑鐘舵�侊紙灏嗗彇娑堢殑鍣ㄥ畼閲嶆柊鍔犲叆 selectedOrgans锛�
+ const parentToRestore = new Set();
+ toRemoveSaved.forEach(r => {
+ // 鐩存帴鎭㈠鍣ㄥ畼缂栧彿锛堝洜涓轰笉灞曞紑锛屾墍浠ュ氨鏄� r.organno锛�
+ if (!this.selectedOrgans.includes(r.organno)) {
+ this.selectedOrgans.push(r.organno);
}
});
+ this.$message.info('宸插彇娑堝垹闄ゆ搷浣�');
+ return; // 閫�鍑烘柟娉曪紝閬垮厤缁х画鎵ц
+ }
+ }
- // 绉婚櫎鍙栨秷閫夋嫨鐨勫櫒瀹�
- this.allocationData.serviceDonateorganList = this.allocationData.serviceDonateorganList.filter(
- record => {
- if (selectedValues.includes(record.organno)) {
- return true;
- } else {
- if (record.id) {
- this.$confirm(
- "鍒犻櫎鍣ㄥ畼鍒嗛厤鏁版嵁鍚庡皢鏃犳硶鎭㈠锛屾偍纭鍒犻櫎璇ユ潯璁板綍鍚楋紵",
- "鎻愮ず",
- {
- confirmButtonText: "纭畾",
- cancelButtonText: "鍙栨秷",
- type: "warning"
- }
- )
- .then(() => {
- this.allocationData.serviceDonateorganList = this.allocationData.serviceDonateorganList.filter(
- r => r.organno !== record.organno
- );
- this.$message.success("鍒犻櫎鎴愬姛");
- })
- .catch(() => {
- this.selectedOrgans.push(record.organno);
- });
- return true; // 绛夊緟鐢ㄦ埛纭
- } else {
- return false; // 鐩存帴鍒犻櫎鏂拌褰�
- }
- }
- }
- );
- },
+ // 5. 娉ㄦ剰锛氬浜庡凡鏍囪鍒犻櫎鐨勮褰曪紝鎴戜滑涓嶄粠 selectedOrgans 涓Щ闄わ紙宸插湪纭鏃剁Щ闄わ級
+ // 浣嗚繕瑕佽�冭檻锛氭煇浜涜褰曞彲鑳藉洜涓轰簰鏂ラ�昏緫琚Щ闄わ紝宸插寘鍚湪 finalSelected 涓鐞嗭紝鏃犻澶栨搷浣�
+ // 鏇存柊琛ㄥ崟瀛楁锛堝鏋滈渶瑕佷繚瀛橀�変腑鐨勫櫒瀹樺垪琛紝鍙互鍦ㄨ繖閲岃缃� this.form.donateorgan锛屼絾鏈」鐩湭鐢級
+ // 濡傛灉闇�瑕侊紝鍙互娣诲姞 this.form.donateorgan = this.selectedOrgans.join(',');
+},
// 澶勭悊浜掓枼閫夋嫨锛堝弬鑰冩崘鐚喅瀹氶〉闈級
handleExclusiveSelections(selectedValues) {
@@ -1282,7 +1067,8 @@
reallocationreason: "",
allocationstatus: "0", // 榛樿鎻愪氦鍒嗛厤鐘舵��
redistributionInfo: null,
- organState: 1
+ organState: 1,
+ delFlag: 0 // 鏂板
});
},
@@ -1308,7 +1094,41 @@
this.redistributionAttachmentList = [];
this.redistributionDialogVisible = true;
},
+ // 浣滃簾鎿嶄綔
+ handleInvalidate(row) {
+ this.$confirm(`纭畾瑕佸皢 "${row.organname}" 鐨勫垎閰嶈褰曚綔搴熷悧锛焋, "鎻愮ず", {
+ confirmButtonText: "纭畾",
+ cancelButtonText: "鍙栨秷",
+ type: "warning"
+ })
+ .then(() => {
+ // 鎵惧埌褰撳墠璁板綍鐨勭储寮�
+ const index = this.allocationData.serviceDonateorganList.findIndex(
+ item => item === row
+ );
+ if (index !== -1) {
+ // 鏇存柊璁板綍鐘舵�佷负浣滃簾
+ this.allocationData.serviceDonateorganList[index].allocationstatus =
+ "2";
+
+ // 鏇存柊閫変腑鐨勫櫒瀹樺垪琛紙濡傛灉璇ュ櫒瀹樹笉鍐嶆湁鍏朵粬鏈夋晥璁板綍锛�
+ const organNo = row.organno;
+ const hasOtherValidRecord = this.allocationData.serviceDonateorganList.some(
+ item => item.organno === organNo && item.allocationstatus !== "2"
+ );
+
+ if (!hasOtherValidRecord) {
+ this.selectedOrgans = this.selectedOrgans.filter(
+ item => item !== organNo
+ );
+ }
+
+ this.$message.success("璁板綍宸蹭綔搴�");
+ }
+ })
+ .catch(() => { });
+ },
// 閲嶅垎閰嶅璇濇鍏抽棴
handleRedistributionDialogClose() {
this.redistributionForm = {
@@ -1459,12 +1279,13 @@
getOrganRowClassName({ row }) {
if (row.allocationstatus == "3") {
return "redistributed-row"; // 閲嶅垎閰嶈褰曟牱寮�
+ } else if (row.allocationstatus == "2") {
+ return "invalidated-row"; // 浣滃簾璁板綍鏍峰紡
} else if (
- !row.caseno ||
!row.applicanttime ||
!row.organgettime ||
!row.name ||
- !row.transplanthospitalno
+ !row.transplanthospitalname
) {
return "warning-row"; // 淇℃伅涓嶅畬鏁存牱寮�
} else if (row.allocationstatus == "0") {
@@ -1584,7 +1405,7 @@
this.confirmLoading = false;
}
})
- .catch(() => {});
+ .catch(() => { });
},
// 闄勪欢鐩稿叧鏂规硶
@@ -1863,6 +1684,7 @@
font-size: 20px;
font-weight: bold;
}
+
/* 鍦╯tyle閮ㄥ垎娣诲姞 */
.section-title {
font-weight: 600;
@@ -1903,6 +1725,7 @@
overflow-x: auto;
}
}
+
/* 绌虹姸鎬佹牱寮� */
.empty-allocation {
text-align: center;
@@ -1916,7 +1739,9 @@
font-style: italic;
}
-/* 琛ㄦ牸琛屾牱寮� */
+/* ===== 琛ㄦ牸琛屾牱寮� ===== */
+
+/* 閲嶅垎閰嶈鏍峰紡 */
:deep(.redistributed-row) {
background-color: #fdf6ec;
opacity: 0.8;
@@ -1927,6 +1752,7 @@
opacity: 0.9;
}
+/* 淇℃伅涓嶅畬鏁磋鍛婅鏍峰紡 */
:deep(.warning-row) {
background-color: #fff7e6;
}
@@ -1935,12 +1761,99 @@
background-color: #ffecc2;
}
+/* 寰呭鏍歌鏍峰紡 */
:deep(.pending-row) {
background-color: #f0f9ff;
}
:deep(.pending-row:hover) {
background-color: #e0f2ff;
+}
+
+/* ===== 鏂板锛氫綔搴熻鏍峰紡 ===== */
+:deep(.invalidated-row) {
+ background-color: #fef0f0;
+ position: relative;
+}
+
+:deep(.invalidated-row td) {
+ opacity: 0.6;
+ text-decoration: line-through;
+ color: #c0c4cc !important;
+}
+
+:deep(.invalidated-row:hover td) {
+ background-color: #fde2e2 !important;
+ opacity: 0.75;
+}
+
+/* 浣滃簾琛屽唴鐨勮緭鍏ユ鍜岄�夋嫨鍣ㄦ牱寮� */
+:deep(.invalidated-row .el-input__inner),
+:deep(.invalidated-row .el-textarea__inner),
+:deep(.invalidated-row .el-date-editor .el-input__inner) {
+ background-color: #fef0f0 !important;
+ border-color: #fbc4c4 !important;
+ color: #c0c4cc !important;
+ cursor: not-allowed !important;
+}
+
+/* 浣滃簾琛屽唴鐨勬爣绛炬牱寮� */
+:deep(.invalidated-row .el-tag) {
+ opacity: 0.5;
+}
+
+/* 浣滃簾琛屽唴鐨勬寜閽牱寮� */
+:deep(.invalidated-row .el-button--text) {
+ color: #c0c4cc !important;
+ cursor: not-allowed !important;
+}
+
+/* ===== 鎿嶄綔鎸夐挳鏍峰紡 ===== */
+
+/* 鎿嶄綔鎸夐挳瀹瑰櫒 */
+.operation-buttons {
+ display: flex;
+ gap: 4px;
+ justify-content: center;
+ align-items: center;
+}
+
+/* 鎿嶄綔鎸夐挳閫氱敤鏍峰紡 */
+:deep(.el-table .el-button--text) {
+ padding: 4px 6px;
+ font-size: 12px;
+}
+
+/* 閲嶅垎閰嶆寜閽牱寮� */
+:deep(.el-button--text.redistribute-btn) {
+ color: #e6a23c;
+}
+
+:deep(.el-button--text.redistribute-btn:hover:not(:disabled)) {
+ color: #cf9236;
+}
+
+/* 浣滃簾鎸夐挳鏍峰紡 */
+:deep(.el-button--text.invalidate-btn) {
+ color: #f56c6c;
+}
+
+:deep(.el-button--text.invalidate-btn:hover:not(:disabled)) {
+ color: #d9534f;
+}
+
+/* 绂佺敤鐘舵�佺殑鎸夐挳鏍峰紡 */
+:deep(.el-button--text.is-disabled) {
+ color: #c0c4cc !important;
+ cursor: not-allowed !important;
+ opacity: 0.5;
+}
+
+/* 閲嶅垎閰嶄俊鎭彁绀烘鏍峰紡 */
+:deep(.el-tooltip__popper) {
+ max-width: 300px;
+ white-space: pre-line;
+ line-height: 1.6;
}
/* 绂佺敤鐘舵�佺殑杈撳叆妗嗘牱寮� */
@@ -1958,19 +1871,6 @@
cursor: not-allowed;
}
-/* 閲嶅垎閰嶆寜閽牱寮� */
-:deep(.el-button--text.is-disabled) {
- color: #c0c4cc !important;
- cursor: not-allowed;
-}
-
-/* 閲嶅垎閰嶄俊鎭彁绀烘鏍峰紡 */
-:deep(.el-tooltip__popper) {
- max-width: 300px;
- white-space: pre-line;
- line-height: 1.6;
-}
-
/* 鍝嶅簲寮忚璁� */
@media (max-width: 768px) {
.organ-allocation-detail {
@@ -1980,5 +1880,11 @@
.allocation-stats .el-col {
margin-bottom: 10px;
}
+
+ /* 绉诲姩绔搷浣滄寜閽牱寮忚皟鏁� */
+ :deep(.el-table .el-button--text) {
+ padding: 2px 4px;
+ font-size: 11px;
+ }
}
</style>
--
Gitblit v1.9.3