From 2513fac6daa6239f1b92c2f479856c8fa1999cee Mon Sep 17 00:00:00 2001 From: "zangch@mesnac.com" Date: Mon, 13 Oct 2025 09:52:48 +0800 Subject: [PATCH] =?UTF-8?q?feat(mes):=20=E6=B7=BB=E5=8A=A0=E5=9C=A8?= =?UTF-8?q?=E5=88=B6=E5=93=81=E8=B7=9F=E8=B8=AA=E6=8A=A5=E8=A1=A8=E7=9A=84?= =?UTF-8?q?=E6=A0=91=E5=BD=A2=E5=B7=A5=E5=BA=8F=E5=B1=95=E7=A4=BA=E5=8A=9F?= =?UTF-8?q?=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 在表格中新增展开列,用于展示工序的树形结构 - 实现 buildProcessTree 方法构建订单与工序的父子关系 - 使用 el-tree 组件渲染工序进度与状态信息 - 添加工序状态的颜色标识与进度条展示 - 调整部分字段的默认显示状态,优化列配置 - 增加工序树样式,支持不同状态的视觉区分 - 修复物料编号列默认不显示的问题 - 隐藏在制工序、剩余工序及工序进度等冗余列 - 提供 tooltip 显示工序计划、完成与剩余数量信息- 完善 tree-node 样式布局与状态类名控制 --- src/views/mes/wipTrackingReport/backup.vue | 675 +++++++++++++++++++++ src/views/mes/wipTrackingReport/index.vue | 125 +++- 2 files changed, 795 insertions(+), 5 deletions(-) create mode 100644 src/views/mes/wipTrackingReport/backup.vue diff --git a/src/views/mes/wipTrackingReport/backup.vue b/src/views/mes/wipTrackingReport/backup.vue new file mode 100644 index 0000000..9bb782a --- /dev/null +++ b/src/views/mes/wipTrackingReport/backup.vue @@ -0,0 +1,675 @@ + + + + + diff --git a/src/views/mes/wipTrackingReport/index.vue b/src/views/mes/wipTrackingReport/index.vue index 9bb782a..31c8a4a 100644 --- a/src/views/mes/wipTrackingReport/index.vue +++ b/src/views/mes/wipTrackingReport/index.vue @@ -125,7 +125,39 @@ - + + + + + @@ -226,7 +258,7 @@ let processStatsChart: echarts.ECharts | null = null; // 列显隐信息 const columns = ref([ { key: 0, label: '生产订单号', visible: true }, - { key: 1, label: '物料编号', visible: false }, + { key: 1, label: '物料编号', visible: true }, { key: 2, label: '物料名称', visible: true }, { key: 3, label: '规格型号', visible: true }, { key: 4, label: '计划总数量', visible: true }, @@ -237,11 +269,11 @@ const columns = ref([ { key: 9, label: '计划完工时间', visible: true }, { key: 10, label: '当前时间', visible: false }, { key: 11, label: '总工序数', visible: true }, - { key: 12, label: '在制工序', visible: true }, - { key: 13, label: '剩余工序', visible: true }, + { key: 12, label: '在制工序', visible: false }, + { key: 13, label: '剩余工序', visible: false }, { key: 14, label: '整体进度', visible: true }, { key: 15, label: '进度状态', visible: true }, - { key: 16, label: '工序进度', visible: true } + { key: 16, label: '工序进度', visible: false } ]); const queryParams = ref({ @@ -324,6 +356,30 @@ function getProgressColor(percentage: number) { return '#67c23a'; } +/** 树形结构配置 */ +const treeProps = { children: 'children', label: 'label' } as const; + +/** 构建工序树(父:订单;子:工序) */ +function buildProcessTree(row: WipTrackingReportVO) { + const children = (row.processProgressList || []).map(p => ({ + id: p.processId, + label: p.processName, + progress: p.processProgress ?? 0, + planAmount: p.planAmount ?? 0, + completeAmount: p.completeAmount ?? 0, + remainingAmount: p.remainingAmount ?? 0, + status: (p as any).isCompleted === 1 || p.isCompleted ? 'completed' : ((p as any).isInProgress === 1 || p.isInProgress ? 'in_progress' : 'pending') + })); + + return [ + { + id: row.productOrderId || row.orderCode, + label: `${row.orderCode}(在制工序(${children.filter(c => c.status === 'in_progress').length}))`, + children + } + ]; +} + /** 初始化图表 */ function initCharts() { if (statusChartRef.value) { @@ -589,6 +645,32 @@ onBeforeUnmount(() => { }); + +