From d27451a2c24fcc785d02619d5840378df7cfc939 Mon Sep 17 00:00:00 2001
From: WXL <wl_5969728@163.com>
Date: 星期三, 22 四月 2026 18:12:05 +0800
Subject: [PATCH] 限制取消
---
src/views/business/transfer/TransportEdit.vue | 202 ++++++++++++++++++++++++++++++++------------------
1 files changed, 128 insertions(+), 74 deletions(-)
diff --git a/src/views/business/transfer/TransportEdit.vue b/src/views/business/transfer/TransportEdit.vue
index 996f8cd..bae6f58 100644
--- a/src/views/business/transfer/TransportEdit.vue
+++ b/src/views/business/transfer/TransportEdit.vue
@@ -17,17 +17,27 @@
/>
<el-card shadow="never" class="case-info-card">
<el-descriptions :column="2" border>
- <el-descriptions-item label="妗堜緥缂栧彿">{{ selectedCase.caseNo }}</el-descriptions-item>
- <el-descriptions-item label="鎮h�呭鍚�">{{ selectedCase.name }}</el-descriptions-item>
+ <el-descriptions-item label="妗堜緥缂栧彿">{{
+ selectedCase.caseNo
+ }}</el-descriptions-item>
+ <el-descriptions-item label="鎮h�呭鍚�">{{
+ selectedCase.name
+ }}</el-descriptions-item>
<el-descriptions-item label="鎬у埆">
<dict-tag
:options="dict.type.sys_user_sex"
:value="selectedCase.sex"
/>
</el-descriptions-item>
- <el-descriptions-item label="骞撮緞">{{ selectedCase.age }}</el-descriptions-item>
- <el-descriptions-item label="鐤剧梾璇婃柇">{{ selectedCase.diagnosisname }}</el-descriptions-item>
- <el-descriptions-item label="娌荤枟鍖婚櫌">{{ selectedCase.treatmenthospitalname }}</el-descriptions-item>
+ <el-descriptions-item label="骞撮緞">{{
+ selectedCase.age
+ }}</el-descriptions-item>
+ <el-descriptions-item label="鐤剧梾璇婃柇">{{
+ selectedCase.diagnosisname
+ }}</el-descriptions-item>
+ <el-descriptions-item label="娌荤枟鍖婚櫌">{{
+ selectedCase.treatmenthospitalname
+ }}</el-descriptions-item>
</el-descriptions>
</el-card>
</div>
@@ -41,20 +51,14 @@
<!-- 鍩虹淇℃伅 -->
<el-card class="form-section" shadow="never">
<div slot="header" class="section-header">
- <i class="el-icon-document" style="color: #409EFF; margin-right: 8px;"></i>
+ <i
+ class="el-icon-document"
+ style="color: #409EFF; margin-right: 8px;"
+ ></i>
<span>鍩虹淇℃伅</span>
</div>
<el-row :gutter="20">
- <el-col :span="12">
- <el-form-item label="杞繍鍗曞彿" prop="reportId">
- <el-input
- v-model="formData.reportId"
- :disabled="isEdit"
- placeholder="绯荤粺鑷姩鐢熸垚"
- />
- </el-form-item>
- </el-col>
<el-col :span="12">
<el-form-item label="妗堜緥缂栧彿" prop="caseNo">
<el-input
@@ -119,7 +123,10 @@
<!-- 鍖婚櫌淇℃伅 -->
<el-card class="form-section" shadow="never">
<div slot="header" class="section-header">
- <i class="el-icon-office-building" style="color: #67C23A; margin-right: 8px;"></i>
+ <i
+ class="el-icon-office-building"
+ style="color: #67C23A; margin-right: 8px;"
+ ></i>
<span>鍖婚櫌淇℃伅</span>
</div>
@@ -147,7 +154,10 @@
<!-- 杞繍淇℃伅 -->
<el-card class="form-section" shadow="never">
<div slot="header" class="section-header">
- <i class="el-icon-location-information" style="color: #E6A23C; margin-right: 8px;"></i>
+ <i
+ class="el-icon-location-information"
+ style="color: #E6A23C; margin-right: 8px;"
+ ></i>
<span>杞繍淇℃伅</span>
</div>
@@ -203,7 +213,10 @@
<!-- 鍖绘姢浜哄憳淇℃伅 -->
<el-card class="form-section" shadow="never">
<div slot="header" class="section-header">
- <i class="el-icon-user" style="color: #F56C6C; margin-right: 8px;"></i>
+ <i
+ class="el-icon-user"
+ style="color: #F56C6C; margin-right: 8px;"
+ ></i>
<span>鍖绘姢浜哄憳淇℃伅</span>
</div>
@@ -284,7 +297,10 @@
<!-- 闄勪欢淇℃伅 -->
<el-card class="form-section" shadow="never">
<div slot="header" class="section-header">
- <i class="el-icon-folder" style="color: #909399; margin-right: 8px;"></i>
+ <i
+ class="el-icon-folder"
+ style="color: #909399; margin-right: 8px;"
+ ></i>
<span>闄勪欢淇℃伅</span>
</div>
@@ -292,7 +308,9 @@
<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 缁勪欢 -->
@@ -309,18 +327,32 @@
</div>
<!-- 闄勪欢鍒楄〃 -->
- <div class="attachment-list" v-if="formData.annexfilesList && formData.annexfilesList.length > 0">
- <div class="list-title">宸蹭笂浼犻檮浠� ({{ formData.annexfilesList.length }})</div>
- <el-table :data="formData.annexfilesList" style="width: 100%" size="small">
+ <div
+ class="attachment-list"
+ v-if="formData.annexfilesList && formData.annexfilesList.length > 0"
+ >
+ <div class="list-title">
+ 宸蹭笂浼犻檮浠� ({{ formData.annexfilesList.length }})
+ </div>
+ <el-table
+ :data="formData.annexfilesList"
+ style="width: 100%"
+ size="small"
+ >
<el-table-column label="鏂囦欢鍚�" min-width="200">
<template slot-scope="scope">
- <i class="el-icon-document" style="margin-right: 8px; color: #409EFF;"></i>
+ <i
+ class="el-icon-document"
+ style="margin-right: 8px; color: #409EFF;"
+ ></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 size="small">{{ getFileType(scope.row.fileName) }}</el-tag>
+ <el-tag size="small">{{
+ getFileType(scope.row.fileName)
+ }}</el-tag>
</template>
</el-table-column>
<el-table-column label="鍒涘缓鏃堕棿" width="160">
@@ -360,7 +392,10 @@
<!-- 澶囨敞淇℃伅 -->
<el-card class="form-section" shadow="never">
<div slot="header" class="section-header">
- <i class="el-icon-edit" style="color: #409EFF; margin-right: 8px;"></i>
+ <i
+ class="el-icon-edit"
+ style="color: #409EFF; margin-right: 8px;"
+ ></i>
<span>澶囨敞淇℃伅</span>
</div>
<el-form-item prop="remark">
@@ -378,7 +413,9 @@
<div slot="footer" class="dialog-footer">
<el-button @click="handleClose">鍙栨秷</el-button>
- <el-button type="primary" :loading="saveLoading" @click="handleSave">淇濆瓨</el-button>
+ <el-button type="primary" :loading="saveLoading" @click="handleSave"
+ >淇濆瓨</el-button
+ >
</div>
<!-- 鏂囦欢棰勮寮圭獥 -->
@@ -464,9 +501,14 @@
watch: {
editOpen(val) {
if (val) {
+
if (this.isEdit) {
// 缂栬緫妯″紡锛屼娇鐢ㄤ紶鍏ョ殑杞繍鍗曟暟鎹�
- this.formData = { ...this.getDefaultFormData(), ...this.transportData };
+
+ this.formData = {
+ ...this.getDefaultFormData(),
+ ...this.transportData
+ };
} else {
// 鏂板妯″紡
this.formData = this.getDefaultFormData();
@@ -499,7 +541,6 @@
getDefaultFormData() {
return {
id: undefined,
- reportId: undefined,
caseNo: undefined,
patName: undefined,
sex: undefined,
@@ -531,18 +572,20 @@
/** 鐢ㄦ渚嬫暟鎹~鍏呰〃鍗� */
fillFormWithCaseData(caseData) {
+
this.formData = {
...this.formData,
- caseNo: caseData.caseNo || '',
- patName: caseData.name || '',
- sex: caseData.sex || '',
- age: caseData.age || '',
- diagnosisname: caseData.diagnosisname || '',
- treatmentHospitalName: caseData.treatmenthospitalname || '',
- treatmentDeptName: caseData.treatmentdeptname || '',
+ caseNo: caseData.caseNo || "",
+ patName: caseData.name || "",
+ sex: caseData.sex || "",
+ age: caseData.age || "",
+ reportId: caseData.id || null,
+ diagnosisname: caseData.diagnosisname || "",
+ treatmentHospitalName: caseData.treatmenthospitalname || "",
+ treatmentDeptName: caseData.treatmentdeptname || "",
// 鍙互璁剧疆涓�浜涢粯璁ゅ��
- transportStartPlace: caseData.treatmenthospitalname || '',
- contactPerson: caseData.coordinatorName || ''
+ transportStartPlace: caseData.treatmenthospitalname || "",
+ contactPerson: caseData.coordinatorName || ""
};
},
@@ -550,12 +593,14 @@
initAttachmentList() {
if (this.isEdit && this.transportData.annexfilesList) {
this.formData.annexfilesList = [...this.transportData.annexfilesList];
- this.attachmentFileList = this.transportData.annexfilesList.map(item => ({
- uid: item.id || Math.random(),
- name: item.fileName,
- url: item.path || item.fileUrl,
- status: 'success'
- }));
+ this.attachmentFileList = this.transportData.annexfilesList.map(
+ item => ({
+ uid: item.id || Math.random(),
+ name: item.fileName,
+ url: item.path || item.fileUrl,
+ status: "success"
+ })
+ );
} else {
this.formData.annexfilesList = [];
this.attachmentFileList = [];
@@ -570,8 +615,8 @@
/** 闄勪欢绉婚櫎澶勭悊 */
handleAttachmentRemove(file) {
if (file.url) {
- const index = this.formData.annexfilesList.findIndex(item =>
- item.path === file.url || item.fileUrl === file.url
+ const index = this.formData.annexfilesList.findIndex(
+ item => item.path === file.url || item.fileUrl === file.url
);
if (index > -1) {
this.formData.annexfilesList.splice(index, 1);
@@ -583,7 +628,7 @@
handleRemoveAttachment(index) {
this.formData.annexfilesList.splice(index, 1);
this.attachmentFileList.splice(index, 1);
- this.$message.success('闄勪欢鍒犻櫎鎴愬姛');
+ this.$message.success("闄勪欢鍒犻櫎鎴愬姛");
},
/** 涓婁紶鎴愬姛澶勭悊 */
@@ -594,21 +639,21 @@
path: response.data || file.url,
fileUrl: response.data || file.url,
type: this.getFileExtension(file.name),
- createTime: dayjs().format('YYYY-MM-DD HH:mm:ss'),
+ createTime: dayjs().format("YYYY-MM-DD HH:mm:ss"),
transportId: this.formData.id,
delFlag: 0,
caseNo: this.formData.caseNo
};
this.formData.annexfilesList.push(attachmentObj);
- this.$message.success('鏂囦欢涓婁紶鎴愬姛');
+ this.$message.success("鏂囦欢涓婁紶鎴愬姛");
}
},
/** 涓婁紶閿欒澶勭悊 */
handleUploadError({ file, fileList, error }) {
- console.error('闄勪欢涓婁紶澶辫触:', error);
- this.$message.error('鏂囦欢涓婁紶澶辫触锛岃閲嶈瘯');
+ console.error("闄勪欢涓婁紶澶辫触:", error);
+ this.$message.error("鏂囦欢涓婁紶澶辫触锛岃閲嶈瘯");
},
/** 鏂囦欢棰勮 */
@@ -627,53 +672,59 @@
const fileName = file.fileName;
if (fileUrl) {
- const link = document.createElement('a');
+ const link = document.createElement("a");
link.href = fileUrl;
link.download = fileName;
- link.style.display = 'none';
+ link.style.display = "none";
document.body.appendChild(link);
link.click();
document.body.removeChild(link);
- this.$message.success('寮�濮嬩笅杞芥枃浠�');
+ this.$message.success("寮�濮嬩笅杞芥枃浠�");
} else {
- this.$message.warning('鏂囦欢璺緞涓嶅瓨鍦紝鏃犳硶涓嬭浇');
+ this.$message.warning("鏂囦欢璺緞涓嶅瓨鍦紝鏃犳硶涓嬭浇");
}
},
/** 鑾峰彇鏂囦欢绫诲瀷 */
getFileType(fileName) {
- if (!fileName) return 'other';
+ 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'];
+ 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';
+ if (imageTypes.includes(extension)) return "image";
+ if (pdfTypes.includes(extension)) return "pdf";
+ if (officeTypes.includes(extension)) return "office";
+ return "other";
},
/** 鑾峰彇鏂囦欢鎵╁睍鍚� */
getFileExtension(filename) {
- return filename.split('.').pop().toLowerCase();
+ return filename
+ .split(".")
+ .pop()
+ .toLowerCase();
},
/** 鏃ユ湡鏃堕棿鏍煎紡鍖� */
formatDateTime(dateTime) {
- if (!dateTime) return '';
+ 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');
- const seconds = String(date.getSeconds()).padStart(2, '0');
+ 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");
+ const seconds = String(date.getSeconds()).padStart(2, "0");
return `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`;
} catch (error) {
@@ -692,9 +743,13 @@
const valid = await this.$refs.editForm.validate();
if (!valid) return;
- const pendingFiles = this.attachmentFileList.filter(item => item.status !== 'success');
+ const pendingFiles = this.attachmentFileList.filter(
+ item => item.status !== "success"
+ );
if (pendingFiles.length > 0) {
- this.$message.warning('杩樻湁鏂囦欢鏈笂浼犲畬鎴愶紝璇峰厛涓婁紶鎵�鏈夋枃浠舵垨绉婚櫎鏈笂浼犵殑鏂囦欢');
+ this.$message.warning(
+ "杩樻湁鏂囦欢鏈笂浼犲畬鎴愶紝璇峰厛涓婁紶鎵�鏈夋枃浠舵垨绉婚櫎鏈笂浼犵殑鏂囦欢"
+ );
return;
}
@@ -702,7 +757,6 @@
const requestData = { ...this.formData };
let response;
-
if (this.isEdit) {
response = await transportEdit(requestData);
} else {
--
Gitblit v1.9.3