From 14817696a26eb142ccae03fa7c43050840e057f5 Mon Sep 17 00:00:00 2001
From: hsy <1029150275@qq.com>
Date: 星期一, 17 八月 2026 09:35:03 +0800
Subject: [PATCH] feat(mes): 优化生产订单与排产任务列表显示,新增启停工及校验逻辑 1. 生产订单列表展示优化 (WorkOrder) - 新增「生产状态」列,全局注册 `ORDER_PRODUCTION_STATUS` 常量并绑定系统动态字典。 - 彻底重构「工序生产进度」单元格显示:弃用臃肿的 Steps 组件,改为极简横向布局(彩色状态圆点 + 进度百分比),解决表格行高被强行撑开及内容截断问题,支持横向滚动。 - 优化「完成进度」列宽及展示样式,将百分比数值外置同行显示,更加直观。 2. 排产任务列表改造 (Task) - 顶部表头重构,由单一标题重构为「全部 / 未完成 / 已完成」的 Tabs 标签页切换结构。 - 重写数据过滤逻辑,剥离写死的 status 查询,改为使用 `scheduleStatus` 字段动态响应 Tabs 切换 (0: 未完成, 1: 已完成)。 3. 工单业务逻辑增强与状态流转 - 落实「工单查询逻辑设计方案」,优化底层的工单条件检索逻辑。 - 实现「添加工单启停功能」与「停工状态」,支持工单在执行过程中的暂停与恢复业务流转。 - 强化容错与防呆设计:操作「完成订单」时增加前置校验 `handleCheckFinish`,若生产状态为未完成,强制弹出二次确认 Modal,避免误操作。 # 相关讨论/参考方案 # - 添加工单启停功能 # - 停工状态功能设计方案 # - 工单查询逻辑设计方案 # - 工单完成进度显示优化
---
src/components/upload/file-upload.vue | 39 +++++++++------------------------------
1 files changed, 9 insertions(+), 30 deletions(-)
diff --git a/src/components/upload/file-upload.vue b/src/components/upload/file-upload.vue
index b095bdd..3692d2e 100644
--- a/src/components/upload/file-upload.vue
+++ b/src/components/upload/file-upload.vue
@@ -10,12 +10,9 @@
import { IconifyIcon } from '@vben/icons';
import { $t } from '@vben/locales';
-import { checkFileType, isFunction, isImage, isObject, isString } from '@vben/utils';
+import { checkFileType, isFunction, isObject, isString } from '@vben/utils';
import { Button, message, Upload } from 'ant-design-vue';
-
-import { requestClient } from '#/api/request';
-import { FilePreviewModal, useFilePreview } from '#/components/file-preview';
import { UploadResultStatus } from './typing';
import { useUpload, useUploadType } from './use-upload';
@@ -142,30 +139,15 @@
}
}
-const { openPreview, previewState } = useFilePreview();
-
/** 澶勭悊鏂囦欢棰勮 */
-async function handlePreview(file: UploadFile) {
+function handlePreview(file: UploadFile) {
const url = (file as any)?.url || (file as any)?.response?.url || (file as any)?.response;
if (!url) {
message.warning('鏂囦欢鍦板潃涓嶅瓨鍦紝鏃犳硶棰勮');
return;
}
- const name = file.name || (file as any)?.fileName || '';
- if (isImage(name || url)) {
- window.open(url, '_blank');
- return;
- }
- try {
- // 灏嗙粷瀵� URL 杞负鐩稿璺緞锛岃蛋 Vite 浠g悊閬垮厤璺ㄥ煙
- const path = typeof url === 'string' ? url.replace(/^https?:\/\/[^/]+/, '') : url;
- const blob = await requestClient.download(path);
- const blobUrl = URL.createObjectURL(blob as Blob);
- openPreview(blobUrl, name);
- emit('preview', file);
- } catch {
- message.error('鏂囦欢鍔犺浇澶辫触');
- }
+ window.open(url, '_blank');
+ emit('preview', file);
}
/** 澶勭悊鏂囦欢鏁伴噺瓒呴檺 */
@@ -310,14 +292,14 @@
:progress="{ showInfo: true }"
:show-upload-list="{
showPreviewIcon: true,
- showRemoveIcon: true,
+ showRemoveIcon: !disabled,
showDownloadIcon,
}"
@remove="handleRemove"
@preview="handlePreview"
@reject="handleExceed"
>
- <div v-if="drag" class="upload-drag-area">
+ <div v-if="drag && !disabled" class="upload-drag-area">
<p class="ant-upload-drag-icon">
<IconifyIcon icon="lucide:cloud-upload" />
</p>
@@ -326,7 +308,9 @@
鏀寔{{ accept.join('/') }}鏍煎紡鏂囦欢锛屼笉瓒呰繃{{ maxSize }}MB
</p>
</div>
- <div v-else-if="fileList && fileList.length < maxNumber">
+ <div
+ v-else-if="!disabled && fileList && fileList.length < maxNumber"
+ >
<Button>
<IconifyIcon icon="lucide:cloud-upload" />
{{ $t('ui.upload.upload') }}
@@ -343,11 +327,6 @@
鏍煎紡鏂囦欢
</div>
</Upload>
- <FilePreviewModal
- v-model:visible="previewState.visible.value"
- :file-url="previewState.fileUrl.value"
- :file-name="previewState.fileName.value"
- />
</div>
</template>
--
Gitblit v1.9.3