From 531c4388d415f7ecee66fc78bbbfc62d9fe090f5 Mon Sep 17 00:00:00 2001 From: "2358328281@qq.com" <邮箱地址> Date: Sun, 21 Jun 2026 00:21:41 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E6=96=B0=E5=AD=97=E6=AE=B5?= =?UTF-8?q?=20=E8=A7=A3=E5=86=B3=E6=97=A0=E6=B3=95=E7=BC=96=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/i18n/lang/en-US.js | 5 ++ src/i18n/lang/zh-CN.js | 5 ++ src/i18n/lang/zh-TW.js | 5 ++ src/views/admin/hospitals/edit.vue | 42 +++++++++++++--- src/views/admin/orders/list.vue | 77 ++++++++++++++++++++++++++---- 5 files changed, 119 insertions(+), 15 deletions(-) diff --git a/src/i18n/lang/en-US.js b/src/i18n/lang/en-US.js index f80b075..cda7282 100644 --- a/src/i18n/lang/en-US.js +++ b/src/i18n/lang/en-US.js @@ -162,6 +162,8 @@ export default { createTime: 'Created At', colorTag: 'Color Tag', currentPassword: 'Current Password', + feedbackchannel: 'Feedback Channel', + createat: 'Submit Time', }, // Form placeholder placeholder: { @@ -170,6 +172,8 @@ export default { dept: 'Enter department', name: 'Enter submitter name', type: 'Select service type', + feedbackchannel: 'Select feedback channel', + createat: 'Select submit time', hospital: 'Enter hospital name', contactPerson: 'Enter contact person', contactDept: 'Enter contact department', @@ -240,6 +244,7 @@ export default { status: 'Status', time: 'Submit Time', submitter: 'Submitter', + feedbackchannel: 'Feedback Channel', action: 'Action', hospital: 'Hospital', handler: 'Handler', diff --git a/src/i18n/lang/zh-CN.js b/src/i18n/lang/zh-CN.js index 5838d59..b421978 100644 --- a/src/i18n/lang/zh-CN.js +++ b/src/i18n/lang/zh-CN.js @@ -164,6 +164,8 @@ export default { createTime: "创建时间", colorTag: "颜色标签", currentPassword: "当前密码", + feedbackchannel: "反馈渠道", + createat: "提交时间", }, // 表单 placeholder placeholder: { @@ -172,6 +174,8 @@ export default { dept: "请输入提出科室", name: "请输入提出人员", type: "请选择服务类型", + feedbackchannel: "请选择反馈渠道", + createat: "请选择提交时间", hospital: "请输入医院名称", contactPerson: "请输入联系人", contactDept: "请输入联系科室", @@ -242,6 +246,7 @@ export default { status: "状态", time: "提交时间", submitter: "提交人", + feedbackchannel: "反馈渠道", action: "操作", hospital: "医院名称", handler: "处理人", diff --git a/src/i18n/lang/zh-TW.js b/src/i18n/lang/zh-TW.js index 35dda27..b04df97 100644 --- a/src/i18n/lang/zh-TW.js +++ b/src/i18n/lang/zh-TW.js @@ -162,6 +162,8 @@ export default { createTime: '創建時間', colorTag: '顏色標籤', currentPassword: '當前密碼', + feedbackchannel: '反饋渠道', + createat: '提交時間', }, // 表单 placeholder placeholder: { @@ -170,6 +172,8 @@ export default { dept: '請輸入提出科室', name: '請輸入提出人員', type: '請選擇服務類型', + feedbackchannel: '請選擇反饋渠道', + createat: '請選擇提交時間', hospital: '請輸入醫院名稱', contactPerson: '請輸入聯繫人', contactDept: '請輸入聯繫科室', @@ -240,6 +244,7 @@ export default { status: '狀態', time: '提交時間', submitter: '提交人', + feedbackchannel: '反饋渠道', action: '操作', hospital: '醫院名稱', handler: '處理人', diff --git a/src/views/admin/hospitals/edit.vue b/src/views/admin/hospitals/edit.vue index a9c04f8..0772f99 100644 --- a/src/views/admin/hospitals/edit.vue +++ b/src/views/admin/hospitals/edit.vue @@ -151,6 +151,7 @@ const formRef = ref(); const isEdit = computed(() => !!route.params.id); +// 详情接口返回的原始验收报告路径,为空表示无报告或已被用户替换 const form = reactive({ name: "", customerCategory: "", @@ -164,6 +165,7 @@ const form = reactive({ maintenanceEnd: "", managerId: undefined, remark: "", + attachmentPath: "", }); const rules = { @@ -203,8 +205,17 @@ const managerOptions = ref([]); const reportFileList = ref([]); +// 超出 limit 时仅保留最后一个 +// 触发即代表用户上传了新文件替换原报告,清空 attachmentPath const handleReportExceed = (files) => { reportFileList.value = files.slice(-1); + form.attachmentPath = ""; +}; + +// 从带路径分隔符的地址中截取最后的文件名(兼容 / 与 \) +const getAttachmentFileName = (path) => { + if (!path) return ""; + return String(path).replace(/\\/g, "/").split("/").pop() || ""; }; const buildHospitalFormData = () => { @@ -213,10 +224,15 @@ const buildHospitalFormData = () => { if (value === undefined || value === null || value === "") return; fd.append(key, value); }); - const file = (reportFileList.value || []) - .map((f) => f.raw) - .filter(Boolean)[0]; - if (file) fd.append("files", file); + // 兼容 el-upload 在新增/编辑两种场景下 file-list 项的结构差异: + // 新增时:item 为 UploadFile 对象,包含 raw 指向 File + // 编辑时:item 本身即为 File 对象(el-upload 直接以原始 File 替换了回显项) + // 回显项无 raw 且 size 未定义,命中后自然不会走到 files 提交 + const item = (reportFileList.value || [])[0]; + if (item) { + const file = item.raw || (typeof item.size === "number" ? item : null); + if (file) fd.append("files", file); + } return fd; }; @@ -235,6 +251,18 @@ const loadDetail = async () => { try { const data = await getAdminHospitalDetail(route.params.id); Object.assign(form, data); + // 若详情接口返回了验收报告路径,截取文件名以"已上传"状态回显到 file-list, + // 位置与正常上传后一致;不下载,仅展示以便用户决定是否替换 + const fileName = getAttachmentFileName(data?.attachmentPath); + if (fileName) { + reportFileList.value = [ + { + uid: `attachment-${route.params.id}`, + name: fileName, + status: "success", + }, + ]; + } } finally { loading.value = false; } @@ -243,7 +271,9 @@ const loadDetail = async () => { const submit = async () => { await formRef.value.validate(async (valid) => { if (!valid) return; - if (!reportFileList.value?.length) { + // 仅在"新增"或"编辑但原报告已被清空/移除"且 file-list 为空时,才提示需上传 + const keepOriginal = isEdit.value && !!form.attachmentPath; + if (!reportFileList.value?.length && !keepOriginal) { ElMessage.warning($t("label.acceptanceReport")); return; } @@ -280,4 +310,4 @@ onMounted(() => { font-weight: 600; } } - + \ No newline at end of file diff --git a/src/views/admin/orders/list.vue b/src/views/admin/orders/list.vue index 2588506..b1f2964 100644 --- a/src/views/admin/orders/list.vue +++ b/src/views/admin/orders/list.vue @@ -148,6 +148,12 @@ prop="serviceType" width="120" /> + - - - - - - + +
+ + + + + + + + + + + + + + + + + + +
+ + +
dayjs().format("YYYY-MM-DD HH:mm:ss"); const MAX_FILE_SIZE = 50 * 1024 * 1024; // 粘贴到富文本的图片大小上限(base64 内联存储,避免 HTML 过大) const MAX_PASTE_IMAGE_SIZE = 5 * 1024 * 1024; @@ -747,16 +787,20 @@ const resetQuickForm = () => { title: "", serviceType: "", priority: "中", + feedbackchannel: "", department: "", colorTag: "#667eea", description: "", submitter: "", + createat: "", files: [], }); quickFormRef.value?.clearValidate(); }; const openQuick = () => { + // 打开弹窗时自动填入当前时间作为提交时间默认值 + quickForm.createat = nowDatetime(); quickVisible.value = true; }; @@ -849,6 +893,21 @@ onBeforeUnmount(() => { .title-row .el-input { flex: 1; } +// 优先级 + 反馈渠道同一行展示 +.inline-row { + display: flex; + flex-wrap: wrap; + align-items: center; + gap: 0 24px; + width: 100%; +} +.inline-row .inline-item { + margin-bottom: 0 !important; +} +.inline-row .inline-item :deep(.el-form-item__content) { + display: flex; + align-items: center; +} .color-tag-picker { position: relative; flex-shrink: 0;