From 17191738bef2b1a61fec6330573e4b8568bb0ea8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=A0=82=E7=B3=96?= Date: Tue, 24 Feb 2026 10:32:26 +0800 Subject: [PATCH 1/8] =?UTF-8?q?fix(wms/report):=20=E4=BF=AE=E6=AD=A3?= =?UTF-8?q?=E5=B9=B4=E4=BB=BD=E6=8A=A5=E8=A1=A8=E7=9A=84=E9=BB=98=E8=AE=A4?= =?UTF-8?q?=E6=97=A5=E6=9C=9F=E6=A0=BC=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 将默认日期格式从完整日期改为仅显示年份,以符合年份报表的需求 --- klp-ui/src/views/wms/report/zha/year.vue | 2 +- klp-ui/src/views/wms/report/zinc/year.vue | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/klp-ui/src/views/wms/report/zha/year.vue b/klp-ui/src/views/wms/report/zha/year.vue index 0e0dc476..f85e24b3 100644 --- a/klp-ui/src/views/wms/report/zha/year.vue +++ b/klp-ui/src/views/wms/report/zha/year.vue @@ -161,7 +161,7 @@ export default { // 获取当前日期(默认选中当天) const now = new Date() - const currentDate = `${now.getFullYear()}-${addZero(now.getMonth() + 1)}-${addZero(now.getDate())}` + const currentDate = `${now.getFullYear()}}` /** * 生成指定年份的时间范围字符串 diff --git a/klp-ui/src/views/wms/report/zinc/year.vue b/klp-ui/src/views/wms/report/zinc/year.vue index 9cbf8db7..e7e1802c 100644 --- a/klp-ui/src/views/wms/report/zinc/year.vue +++ b/klp-ui/src/views/wms/report/zinc/year.vue @@ -161,7 +161,7 @@ export default { // 获取当前日期(默认选中当天) const now = new Date() - const currentDate = `${now.getFullYear()}-${addZero(now.getMonth() + 1)}-${addZero(now.getDate())}` + const currentDate = `${now.getFullYear()}}` /** * 生成指定年份的时间范围字符串 From 46ffb02c49fd277ffaf3e920dbe7ea8d98ad9470 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=A0=82=E7=B3=96?= Date: Tue, 24 Feb 2026 10:32:57 +0800 Subject: [PATCH 2/8] =?UTF-8?q?feat(=E4=BA=A7=E5=93=81=E9=80=89=E6=8B=A9):?= =?UTF-8?q?=20=E6=96=B0=E5=A2=9E=E4=BA=A7=E5=93=81=E5=BF=AB=E9=80=9F?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E5=8A=9F=E8=83=BD=E5=B9=B6=E4=BC=98=E5=8C=96?= =?UTF-8?q?=E5=B1=95=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 在产品选择和原材料选择组件中新增快速添加功能 - 移除产品编号搜索字段,将规格信息显示在标题中 - 优化卡片信息布局为网格显示 - 在空数据提示中添加快速新增链接 - 删除不再使用的半成品视图文件 --- .../acid/service/IAcidTypingService.java | 1 - .../KLPService/ProductSelect/index.vue | 156 ++++++- .../KLPService/RawMaterialSelect/index.vue | 160 ++++++- .../src/views/wms/delivery/waybill/index.vue | 23 +- klp-ui/src/views/wms/product/semi.vue | 411 ------------------ package-lock.json | 6 + 6 files changed, 324 insertions(+), 433 deletions(-) delete mode 100644 klp-ui/src/views/wms/product/semi.vue create mode 100644 package-lock.json diff --git a/klp-pocket/src/main/java/com/klp/pocket/acid/service/IAcidTypingService.java b/klp-pocket/src/main/java/com/klp/pocket/acid/service/IAcidTypingService.java index f35b9570..a8ea66e8 100644 --- a/klp-pocket/src/main/java/com/klp/pocket/acid/service/IAcidTypingService.java +++ b/klp-pocket/src/main/java/com/klp/pocket/acid/service/IAcidTypingService.java @@ -1,7 +1,6 @@ package com.klp.pocket.acid.service; import com.klp.pocket.acid.domain.vo.AcidTypingPrefillVo; -import org.w3c.dom.stylesheets.LinkStyle; import java.util.List; diff --git a/klp-ui/src/components/KLPService/ProductSelect/index.vue b/klp-ui/src/components/KLPService/ProductSelect/index.vue index 6edcb19d..0f689dd2 100644 --- a/klp-ui/src/components/KLPService/ProductSelect/index.vue +++ b/klp-ui/src/components/KLPService/ProductSelect/index.vue @@ -14,10 +14,10 @@ @close="handleClose"> - + @@ -45,6 +45,7 @@ 搜索 重置 + 新增 @@ -67,10 +68,9 @@
{{ item.productName }} - [{{ item.productCode }}] + [{{ item.specification || '-' }}]
-
规格:{{ item.specification || '-' }}
材质:{{ item.material || '-' }}
厂家:{{ item.manufacturer || '-' }}
表面处理:{{ item.surfaceTreatmentDesc || '-' }}
@@ -81,7 +81,8 @@
- 暂无匹配的产品数据 + 暂无匹配的产品数据, + 点击快速新增产品
@@ -92,12 +93,58 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
diff --git a/package-lock.json b/package-lock.json new file mode 100644 index 00000000..5301f2e4 --- /dev/null +++ b/package-lock.json @@ -0,0 +1,6 @@ +{ + "name": "klp-oa", + "lockfileVersion": 2, + "requires": true, + "packages": {} +} From 9925c28bd5342a1b2c0154665db1e7483049221c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=A0=82=E7=B3=96?= Date: Thu, 26 Feb 2026 11:33:50 +0800 Subject: [PATCH 3/8] =?UTF-8?q?refactor(=E6=B8=B2=E6=9F=93=E5=99=A8):=20?= =?UTF-8?q?=E7=A7=BB=E9=99=A4=E4=BA=A7=E5=93=81=E7=BC=96=E7=A0=81=E5=92=8C?= =?UTF-8?q?=E5=8E=9F=E6=9D=90=E6=96=99=E7=BC=96=E7=A0=81=E7=9A=84=E6=98=BE?= =?UTF-8?q?=E7=A4=BA=E5=B9=B6=E4=BC=98=E5=8C=96=E7=BA=BF=E5=9C=88=E5=8F=B7?= =?UTF-8?q?=E6=98=BE=E7=A4=BA=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 注释掉产品信息和原材料信息中的编码显示字段 - 将线圈号显示逻辑优化为优先使用当前线圈号 --- klp-ui/src/components/KLPService/Renderer/CoilNo.vue | 7 +++++-- klp-ui/src/components/KLPService/Renderer/ProductInfo.vue | 4 ++-- .../src/components/KLPService/Renderer/RawMaterialInfo.vue | 2 +- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/klp-ui/src/components/KLPService/Renderer/CoilNo.vue b/klp-ui/src/components/KLPService/Renderer/CoilNo.vue index 9a1b4cc2..0d015d3e 100644 --- a/klp-ui/src/components/KLPService/Renderer/CoilNo.vue +++ b/klp-ui/src/components/KLPService/Renderer/CoilNo.vue @@ -28,11 +28,11 @@ - {{ coilNo }} + {{ currentCoilNo }} - {{ coilNo }} + {{ currentCoilNo }} @@ -71,6 +71,9 @@ export default { manufacturer() { return this.coilInfo.product?.manufacturer || this.coilInfo.rawMaterial?.manufacturer || '-' }, + currentCoilNo() { + return this.coilNo || this.coilInfo?.currentCoilNo || '-' + } }, methods: { getCoilInfo() { diff --git a/klp-ui/src/components/KLPService/Renderer/ProductInfo.vue b/klp-ui/src/components/KLPService/Renderer/ProductInfo.vue index bc05b4e0..97cecf68 100644 --- a/klp-ui/src/components/KLPService/Renderer/ProductInfo.vue +++ b/klp-ui/src/components/KLPService/Renderer/ProductInfo.vue @@ -13,9 +13,9 @@ {{ productFull.productName || '--' }} - + {{ productFull.specification || '--' }} diff --git a/klp-ui/src/components/KLPService/Renderer/RawMaterialInfo.vue b/klp-ui/src/components/KLPService/Renderer/RawMaterialInfo.vue index 8ba74d8e..1042ca16 100644 --- a/klp-ui/src/components/KLPService/Renderer/RawMaterialInfo.vue +++ b/klp-ui/src/components/KLPService/Renderer/RawMaterialInfo.vue @@ -12,7 +12,7 @@ {{ materialFull.rawMaterialName || '--' }} - {{ materialFull.rawMaterialCode || '--' }} + {{ materialFull.specification || '--' }} {{ materialFull.material || '--' }} {{ materialFull.surfaceTreatment || '--' }} From ca5bb8a8ff8919706123043050ee8612e720a622 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=A0=82=E7=B3=96?= Date: Thu, 26 Feb 2026 13:07:47 +0800 Subject: [PATCH 4/8] =?UTF-8?q?feat(wms):=20=E6=B7=BB=E5=8A=A0=E9=92=A2?= =?UTF-8?q?=E5=8D=B7=E5=BC=82=E5=B8=B8=E7=AE=A1=E7=90=86=E5=8A=9F=E8=83=BD?= =?UTF-8?q?=E5=8F=8A=E7=BB=84=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 新增异常钢卷列表展示组件CoilList - 在abnormalDetail.vue中添加异常钢卷显示列 - 创建新的异常钢卷管理页面abnormalCoil.vue - 实现钢卷列表与异常明细的联动展示 - 优化表单交互,根据场景显示/隐藏钢卷选择器 --- klp-ui/src/views/wms/coil/abnormalCoil.vue | 402 ++++++++++++++++++ klp-ui/src/views/wms/coil/abnormalDetail.vue | 23 +- .../views/wms/coil/components/CoilList.vue | 196 +++++++++ 3 files changed, 615 insertions(+), 6 deletions(-) create mode 100644 klp-ui/src/views/wms/coil/abnormalCoil.vue create mode 100644 klp-ui/src/views/wms/coil/components/CoilList.vue diff --git a/klp-ui/src/views/wms/coil/abnormalCoil.vue b/klp-ui/src/views/wms/coil/abnormalCoil.vue new file mode 100644 index 00000000..eb989a65 --- /dev/null +++ b/klp-ui/src/views/wms/coil/abnormalCoil.vue @@ -0,0 +1,402 @@ + + + diff --git a/klp-ui/src/views/wms/coil/abnormalDetail.vue b/klp-ui/src/views/wms/coil/abnormalDetail.vue index 9e933ff0..e9e8a433 100644 --- a/klp-ui/src/views/wms/coil/abnormalDetail.vue +++ b/klp-ui/src/views/wms/coil/abnormalDetail.vue @@ -46,6 +46,13 @@ + + + - + + + @@ -88,7 +97,7 @@ - + @@ -143,12 +152,14 @@ + + \ No newline at end of file From f580b664017b7f91ca22983133ba6596e07a8d0f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=A0=82=E7=B3=96?= Date: Thu, 26 Feb 2026 13:15:33 +0800 Subject: [PATCH 5/8] =?UTF-8?q?fix(wms/report):=20=E4=BF=AE=E5=A4=8D?= =?UTF-8?q?=E5=B9=B4=E4=BB=BD=E5=8F=98=E9=87=8F=E6=A0=BC=E5=BC=8F=E9=94=99?= =?UTF-8?q?=E8=AF=AF=E5=B9=B6=E7=A7=BB=E9=99=A4=E6=B3=A8=E9=87=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 修复两个报表组件中currentDate变量的多余大括号格式错误 在zinc报表中恢复createBy字段的注释状态为实际值 --- klp-ui/src/views/wms/report/zha/year.vue | 4 +++- klp-ui/src/views/wms/report/zinc/year.vue | 14 +++++++------- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/klp-ui/src/views/wms/report/zha/year.vue b/klp-ui/src/views/wms/report/zha/year.vue index f85e24b3..63125723 100644 --- a/klp-ui/src/views/wms/report/zha/year.vue +++ b/klp-ui/src/views/wms/report/zha/year.vue @@ -161,7 +161,7 @@ export default { // 获取当前日期(默认选中当天) const now = new Date() - const currentDate = `${now.getFullYear()}}` + const currentDate = `${now.getFullYear()}` /** * 生成指定年份的时间范围字符串 @@ -183,6 +183,8 @@ export default { }; }; + console.log(currentDate) + const { start, end } = getDayTimeRange(currentDate) return { diff --git a/klp-ui/src/views/wms/report/zinc/year.vue b/klp-ui/src/views/wms/report/zinc/year.vue index e7e1802c..96ef2837 100644 --- a/klp-ui/src/views/wms/report/zinc/year.vue +++ b/klp-ui/src/views/wms/report/zinc/year.vue @@ -161,7 +161,7 @@ export default { // 获取当前日期(默认选中当天) const now = new Date() - const currentDate = `${now.getFullYear()}}` + const currentDate = `${now.getFullYear()}` /** * 生成指定年份的时间范围字符串 @@ -224,32 +224,32 @@ export default { warehouseQueryMap: { '1988150323162836993': { selectType: 'product', - // createBy: 'suanzhakuguan', + createBy: 'suanzhakuguan', warehouseId: '1988150323162836993' }, '1988150487185289217': { selectType: 'raw_material', - // createBy: 'suanzhakuguan', + createBy: 'suanzhakuguan', warehouseId: '1988150487185289217' }, '2019583656787259393': { selectType: 'product', - // createBy: 'suanzhakuguan', + createBy: 'suanzhakuguan', warehouseId: '2019583656787259393' }, '20195833325311414274': { selectType: 'product', - // createBy: 'suanzhakuguan', + createBy: 'suanzhakuguan', warehouseId: '20195833325311414274' }, '2019583429955104769': { selectType: 'product', - // createBy: 'suanzhakuguan', + createBy: 'suanzhakuguan', warehouseId: '2019583429955104769' }, '2019583137616310273': { selectType: 'product', - // createBy: 'suanzhakuguan', + createBy: 'suanzhakuguan', warehouseId: '2019583137616310273' }, }, From af97afcbcbcb01445c3a5cc1a3e950be21ca2d80 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=A0=82=E7=B3=96?= Date: Thu, 26 Feb 2026 15:09:14 +0800 Subject: [PATCH 6/8] =?UTF-8?q?refactor(wms/report):=20=E6=8F=90=E5=8F=96?= =?UTF-8?q?=E8=AE=A1=E7=AE=97=E9=80=BB=E8=BE=91=E5=88=B0=E5=85=AC=E5=85=B1?= =?UTF-8?q?=E6=A8=A1=E5=9D=97=E5=B9=B6=E4=BF=AE=E5=A4=8D=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E5=B1=95=E7=A4=BA=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 将各报表页面的统计计算逻辑提取到公共模块calc.js中 修复损失列表数据展示错误问题 增加异常统计功能展示 统一各报表页面的计算逻辑 修复日期格式化错误 调整页面大小限制从999到9999 --- klp-ui/src/views/wms/report/js/calc.js | 99 ++++++++++++++++++++++ klp-ui/src/views/wms/report/zha/day.vue | 53 +++--------- klp-ui/src/views/wms/report/zha/month.vue | 47 +--------- klp-ui/src/views/wms/report/zha/year.vue | 47 +--------- klp-ui/src/views/wms/report/zinc/day.vue | 51 +++-------- klp-ui/src/views/wms/report/zinc/month.vue | 47 +--------- klp-ui/src/views/wms/report/zinc/year.vue | 47 +--------- 7 files changed, 136 insertions(+), 255 deletions(-) create mode 100644 klp-ui/src/views/wms/report/js/calc.js diff --git a/klp-ui/src/views/wms/report/js/calc.js b/klp-ui/src/views/wms/report/js/calc.js new file mode 100644 index 00000000..cd6b0939 --- /dev/null +++ b/klp-ui/src/views/wms/report/js/calc.js @@ -0,0 +1,99 @@ +const calcSummary = (list) => { + // 总钢卷数量、总重、均重 + const outCount = list.length + const outTotalWeight = list.reduce((acc, cur) => acc + (parseFloat(cur.netWeight) || 0), 0) // 增加容错 + const outAvgWeight = outCount > 0 ? (outTotalWeight / outCount)?.toFixed(2) : 0 + + // 损失钢卷数量、总重、均重 + const lossCount = list.length + const lossTotalWeight = list.reduce((acc, cur) => acc + (parseFloat(cur.netWeight) || 0), 0) // 增加容错 + const lossAvgWeight = lossCount > 0 ? (lossTotalWeight / lossCount)?.toFixed(2) : 0 + // 合计数量、总重、均重 + const totalCount = outCount + lossCount + const totalWeight = parseFloat((outTotalWeight + lossTotalWeight).toFixed(2)) + const totalAvgWeight = totalCount > 0 ? (totalWeight / totalCount)?.toFixed(2) : 0 + + // 成品比率 + const passRate = outCount > 0 ? (outCount / lossCount) : 0 + // 损失比率 + const lossRate = totalCount > 0 ? (1 - passRate) : 0 + // 异常率,成品在warehouseId在'2019583656787259393', + // '2019583325311414274', + // '2019583429955104769', + // '2019583137616310273',这四个库中的占比 + const abRate = totalCount != 0 ? list.filter(item => { + return item.warehouseId == '2019583656787259393' || item.warehouseId == '2019583325311414274' || item.warehouseId == '2019583429955104769' || item.warehouseId == '2019583137616310273' + }).length / totalCount : 0 + + return { + outCount, + outTotalWeight: outTotalWeight.toFixed(2), + outAvgWeight, + lossCount, + lossTotalWeight: lossTotalWeight.toFixed(2), + lossAvgWeight, + totalCount, + totalWeight: totalWeight.toFixed(2), + totalAvgWeight, + passRate: (passRate * 100)?.toFixed(2) + '%', + lossRate: (lossRate * 100)?.toFixed(2) + '%', + abRate: (abRate * 100)?.toFixed(2) || 0, + } +} + +const calcAbSummary = (list) => { + // 异常统计,统计四个异常库中的各自的数量和总重 + let o = { + jishuCount: 0, + jishuWeight: 0, + miniCount: 0, + miniWeight: 0, + rubbishCount: 0, + rubbishWeight: 0, + returnCount: 0, + returnWeight: 0, + } + for (let i = 0; i < list.length; i++) { + // { label: '技术部', value: '2019583656787259393' }, + // { label: '小钢卷库', value: '2019583325311414274' }, + // { label: '废品库', value: '2019583429955104769' }, + // { label: '退货库', value: '2019583137616310273' }, + // 技术部 + const coil = list[i]; + // 技术部 + if (coil.warehouseId == '2019583656787259393') { + o['jishuCount'] = o['jishuCount'] + 1 + o['jishuWeight'] = o['jishuWeight'] + parseFloat(coil.netWeight) || 0 + } + // 小刚卷库 + if (coil.warehouseId == '2019583325311414274') { + o['miniCount'] = o['miniCount'] + 1 + o['miniWeight'] = o['miniWeight'] + parseFloat(coil.netWeight) || 0 + } + // 废品库 + if (coil.warehouseId == '2019583429955104769') { + o['rubbishCount'] = o['rubbishCount'] + 1 + o['rubbishWeight'] = o['rubbishWeight'] + parseFloat(coil.netWeight) || 0 + } + // 退货库 + if (coil.warehouseId == '2019583137616310273') { + o['returnCount'] = o['returnCount'] + 1 + o['returnWeight'] = o['returnWeight'] + parseFloat(coil.netWeight) || 0 + } + } + return [ + { label: '技术部钢卷数', value: o['jishuCount'] }, + { label: '技术部钢卷重量', value: o['jishuWeight'] }, + { label: '小钢卷库钢卷数', value: o['miniCount'] }, + { label: '小钢卷库钢卷重量', value: o['miniWeight'] }, + { label: '废品库钢卷数', value: o['rubbishCount'] }, + { label: '废品库钢卷重量', value: o['rubbishWeight'] }, + { label: '退货库钢卷数', value: o['returnCount'] }, + { label: '退货库钢卷重量', value: o['returnWeight'] }, + ] +} + +export { + calcSummary, + calcAbSummary, +} \ No newline at end of file diff --git a/klp-ui/src/views/wms/report/zha/day.vue b/klp-ui/src/views/wms/report/zha/day.vue index 6c37e5e8..57ca4ad6 100644 --- a/klp-ui/src/views/wms/report/zha/day.vue +++ b/klp-ui/src/views/wms/report/zha/day.vue @@ -63,6 +63,11 @@ {{ summary.abRate }} + + + {{ item.value }} + + @@ -144,6 +149,7 @@ import CoilNo from "@/components/KLPService/Renderer/CoilNo.vue"; import MemoInput from "@/components/MemoInput"; import MutiSelect from "@/components/MutiSelect"; import WarehouseSelect from "@/components/KLPService/WarehouseSelect"; +import { calcSummary, calcAbSummary } from "@/views/wms/report/js/calc"; export default { components: { @@ -260,47 +266,10 @@ export default { }, computed: { summary() { - // 总钢卷数量、总重、均重 - const outCount = this.list.length - const outTotalWeight = this.list.reduce((acc, cur) => acc + (parseFloat(cur.netWeight) || 0), 0) // 增加容错 - const outAvgWeight = outCount > 0 ? (outTotalWeight / outCount)?.toFixed(2) : 0 - - // 损失钢卷数量、总重、均重 - const lossCount = this.lossList.length - const lossTotalWeight = this.lossList.reduce((acc, cur) => acc + (parseFloat(cur.netWeight) || 0), 0) // 增加容错 - const lossAvgWeight = lossCount > 0 ? (lossTotalWeight / lossCount)?.toFixed(2) : 0 - // 合计数量、总重、均重 - const totalCount = outCount + lossCount - const totalWeight = parseFloat((outTotalWeight + lossTotalWeight).toFixed(2)) - const totalAvgWeight = totalCount > 0 ? (totalWeight / totalCount)?.toFixed(2) : 0 - - // 成品比率 - const passRate = outCount > 0 ? (outCount / lossCount) : 0 - // 损失比率 - const lossRate = 1 - passRate - // 异常率,成品在warehouseId在'2019583656787259393', - // '2019583325311414274', - // '2019583429955104769', - // '2019583137616310273',这四个库中的占比 - const abRate = this.list.filter(item => { - return item.warehouseId == '2019583656787259393' || item.warehouseId == '2019583325311414274' || item.warehouseId == '2019583429955104769' || item.warehouseId == '2019583137616310273' - }).length / totalCount - - - return { - outCount, - outTotalWeight: outTotalWeight.toFixed(2), - outAvgWeight, - lossCount, - lossTotalWeight: lossTotalWeight.toFixed(2), - lossAvgWeight, - totalCount, - totalWeight: totalWeight.toFixed(2), - totalAvgWeight, - passRate: passRate?.toFixed(2) * 100 + '%', - lossRate: lossRate?.toFixed(2) * 100 + '%', - abRate: (abRate?.toFixed(2) * 100) || 0 + '%', - } + return calcSummary(this.list) + }, + abSummary() { + return calcAbSummary(this.list) } }, methods: { @@ -360,7 +329,7 @@ export default { message: '暂无数据', type: 'warning', }) - this.list = [] + this.lossList = [] this.loading = false return } diff --git a/klp-ui/src/views/wms/report/zha/month.vue b/klp-ui/src/views/wms/report/zha/month.vue index 0b78591e..09ebf3b0 100644 --- a/klp-ui/src/views/wms/report/zha/month.vue +++ b/klp-ui/src/views/wms/report/zha/month.vue @@ -144,6 +144,7 @@ import CoilNo from "@/components/KLPService/Renderer/CoilNo.vue"; import MemoInput from "@/components/MemoInput"; import MutiSelect from "@/components/MutiSelect"; import WarehouseSelect from "@/components/KLPService/WarehouseSelect"; +import { calcSummary, calcAbSummary } from "@/views/wms/report/js/calc"; export default { components: { @@ -161,7 +162,7 @@ export default { // 获取当前日期(默认选中当天) const now = new Date() - const currentDate = `${now.getFullYear()}-${addZero(now.getMonth() + 1)}}` + const currentDate = `${now.getFullYear()}-${addZero(now.getMonth() + 1)}` /** * 生成指定日期/月份的时间范围字符串 @@ -290,47 +291,7 @@ export default { }, computed: { summary() { - // 总钢卷数量、总重、均重 - const outCount = this.list.length - const outTotalWeight = this.list.reduce((acc, cur) => acc + (parseFloat(cur.netWeight) || 0), 0) // 增加容错 - const outAvgWeight = outCount > 0 ? (outTotalWeight / outCount)?.toFixed(2) : 0 - - // 损失钢卷数量、总重、均重 - const lossCount = this.lossList.length - const lossTotalWeight = this.lossList.reduce((acc, cur) => acc + (parseFloat(cur.netWeight) || 0), 0) // 增加容错 - const lossAvgWeight = lossCount > 0 ? (lossTotalWeight / lossCount)?.toFixed(2) : 0 - // 合计数量、总重、均重 - const totalCount = outCount + lossCount - const totalWeight = parseFloat((outTotalWeight + lossTotalWeight).toFixed(2)) - const totalAvgWeight = totalCount > 0 ? (totalWeight / totalCount)?.toFixed(2) : 0 - - // 成品比率 - const passRate = outCount > 0 ? (outCount / lossCount) : 0 - // 损失比率 - const lossRate = 1 - passRate - // 异常率,成品在warehouseId在'2019583656787259393', - // '2019583325311414274', - // '2019583429955104769', - // '2019583137616310273',这四个库中的占比 - const abRate = this.list.filter(item => { - return item.warehouseId == '2019583656787259393' || item.warehouseId == '2019583325311414274' || item.warehouseId == '2019583429955104769' || item.warehouseId == '2019583137616310273' - }).length / totalCount - - - return { - outCount, - outTotalWeight: outTotalWeight.toFixed(2), - outAvgWeight, - lossCount, - lossTotalWeight: lossTotalWeight.toFixed(2), - lossAvgWeight, - totalCount, - totalWeight: totalWeight.toFixed(2), - totalAvgWeight, - passRate: passRate?.toFixed(2) * 100 + '%', - lossRate: lossRate?.toFixed(2) * 100 + '%', - abRate: (abRate?.toFixed(2) * 100) || 0 + '%', - } + return calcSummary(this.list) } }, methods: { @@ -390,7 +351,7 @@ export default { message: '暂无数据', type: 'warning', }) - this.list = [] + this.lossList = [] this.loading = false return } diff --git a/klp-ui/src/views/wms/report/zha/year.vue b/klp-ui/src/views/wms/report/zha/year.vue index 63125723..72b36c89 100644 --- a/klp-ui/src/views/wms/report/zha/year.vue +++ b/klp-ui/src/views/wms/report/zha/year.vue @@ -144,6 +144,7 @@ import CoilNo from "@/components/KLPService/Renderer/CoilNo.vue"; import MemoInput from "@/components/MemoInput"; import MutiSelect from "@/components/MutiSelect"; import WarehouseSelect from "@/components/KLPService/WarehouseSelect"; +import { calcSummary, calcAbSummary } from "@/views/wms/report/js/calc"; export default { components: { @@ -274,47 +275,7 @@ export default { }, computed: { summary() { - // 总钢卷数量、总重、均重 - const outCount = this.list.length - const outTotalWeight = this.list.reduce((acc, cur) => acc + (parseFloat(cur.netWeight) || 0), 0) // 增加容错 - const outAvgWeight = outCount > 0 ? (outTotalWeight / outCount)?.toFixed(2) : 0 - - // 损失钢卷数量、总重、均重 - const lossCount = this.lossList.length - const lossTotalWeight = this.lossList.reduce((acc, cur) => acc + (parseFloat(cur.netWeight) || 0), 0) // 增加容错 - const lossAvgWeight = lossCount > 0 ? (lossTotalWeight / lossCount)?.toFixed(2) : 0 - // 合计数量、总重、均重 - const totalCount = outCount + lossCount - const totalWeight = parseFloat((outTotalWeight + lossTotalWeight).toFixed(2)) - const totalAvgWeight = totalCount > 0 ? (totalWeight / totalCount)?.toFixed(2) : 0 - - // 成品比率 - const passRate = outCount > 0 ? (outCount / lossCount) : 0 - // 损失比率 - const lossRate = 1 - passRate - // 异常率,成品在warehouseId在'2019583656787259393', - // '2019583325311414274', - // '2019583429955104769', - // '2019583137616310273',这四个库中的占比 - const abRate = this.list.filter(item => { - return item.warehouseId == '2019583656787259393' || item.warehouseId == '2019583325311414274' || item.warehouseId == '2019583429955104769' || item.warehouseId == '2019583137616310273' - }).length / totalCount - - - return { - outCount, - outTotalWeight: outTotalWeight.toFixed(2), - outAvgWeight, - lossCount, - lossTotalWeight: lossTotalWeight.toFixed(2), - lossAvgWeight, - totalCount, - totalWeight: totalWeight.toFixed(2), - totalAvgWeight, - passRate: passRate?.toFixed(2) * 100 + '%', - lossRate: lossRate?.toFixed(2) * 100 + '%', - abRate: (abRate?.toFixed(2) * 100) || 0 + '%', - } + return calcSummary(this.list) } }, methods: { @@ -361,7 +322,7 @@ export default { this.loading = true listPendingAction({ actionType: 11, // 酸轧工序 - pageSize: 999, + pageSize: 9999, pageNum: 1, startTime: this.queryParams.byCreateTimeStart, endTime: this.queryParams.byCreateTimeEnd, @@ -374,7 +335,7 @@ export default { message: '暂无数据', type: 'warning', }) - this.list = [] + this.lossList = [] this.loading = false return } diff --git a/klp-ui/src/views/wms/report/zinc/day.vue b/klp-ui/src/views/wms/report/zinc/day.vue index b672562f..f3d62365 100644 --- a/klp-ui/src/views/wms/report/zinc/day.vue +++ b/klp-ui/src/views/wms/report/zinc/day.vue @@ -63,6 +63,11 @@ {{ summary.abRate }} + + + {{ item.value }} + + @@ -144,6 +149,7 @@ import CoilNo from "@/components/KLPService/Renderer/CoilNo.vue"; import MemoInput from "@/components/MemoInput"; import MutiSelect from "@/components/MutiSelect"; import WarehouseSelect from "@/components/KLPService/WarehouseSelect"; +import { calcSummary, calcAbSummary } from "@/views/wms/report/js/calc"; export default { components: { @@ -246,47 +252,10 @@ export default { }, computed: { summary() { - // 总钢卷数量、总重、均重 - const outCount = this.list.length - const outTotalWeight = this.list.reduce((acc, cur) => acc + (parseFloat(cur.netWeight) || 0), 0) // 增加容错 - const outAvgWeight = outCount > 0 ? (outTotalWeight / outCount)?.toFixed(2) : 0 - - // 损失钢卷数量、总重、均重 - const lossCount = this.lossList.length - const lossTotalWeight = this.lossList.reduce((acc, cur) => acc + (parseFloat(cur.netWeight) || 0), 0) // 增加容错 - const lossAvgWeight = lossCount > 0 ? (lossTotalWeight / lossCount)?.toFixed(2) : 0 - // 合计数量、总重、均重 - const totalCount = outCount + lossCount - const totalWeight = parseFloat((outTotalWeight + lossTotalWeight).toFixed(2)) - const totalAvgWeight = totalCount > 0 ? (totalWeight / totalCount)?.toFixed(2) : 0 - - // 成品比率 - const passRate = outCount > 0 ? (outCount / lossCount) : 0 - // 损失比率 - const lossRate = 1 - passRate - // 异常率,成品在warehouseId在'2019583656787259393', - // '2019583325311414274', - // '2019583429955104769', - // '2019583137616310273',这四个库中的占比 - const abRate = this.list.filter(item => { - return item.warehouseId == '2019583656787259393' || item.warehouseId == '2019583325311414274' || item.warehouseId == '2019583429955104769' || item.warehouseId == '2019583137616310273' - }).length / totalCount - - - return { - outCount, - outTotalWeight: outTotalWeight.toFixed(2), - outAvgWeight, - lossCount, - lossTotalWeight: lossTotalWeight.toFixed(2), - lossAvgWeight, - totalCount, - totalWeight: totalWeight.toFixed(2), - totalAvgWeight, - passRate: passRate?.toFixed(2) * 100 + '%', - lossRate: lossRate?.toFixed(2) * 100 + '%', - abRate: (abRate?.toFixed(2) * 100) || 0 + '%', - } + return calcSummary(this.list) + }, + abSummary() { + return calcAbSummary(this.list) } }, methods: { diff --git a/klp-ui/src/views/wms/report/zinc/month.vue b/klp-ui/src/views/wms/report/zinc/month.vue index 9905629b..066b16c1 100644 --- a/klp-ui/src/views/wms/report/zinc/month.vue +++ b/klp-ui/src/views/wms/report/zinc/month.vue @@ -144,6 +144,7 @@ import CoilNo from "@/components/KLPService/Renderer/CoilNo.vue"; import MemoInput from "@/components/MemoInput"; import MutiSelect from "@/components/MutiSelect"; import WarehouseSelect from "@/components/KLPService/WarehouseSelect"; +import { calcSummary, calcAbSummary } from "@/views/wms/report/js/calc"; export default { components: { @@ -161,7 +162,7 @@ export default { // 获取当前日期(默认选中当天) const now = new Date() - const currentDate = `${now.getFullYear()}-${addZero(now.getMonth() + 1)}}` + const currentDate = `${now.getFullYear()}-${addZero(now.getMonth() + 1)}` /** * 生成指定日期/月份的时间范围字符串 @@ -276,47 +277,7 @@ export default { }, computed: { summary() { - // 总钢卷数量、总重、均重 - const outCount = this.list.length - const outTotalWeight = this.list.reduce((acc, cur) => acc + (parseFloat(cur.netWeight) || 0), 0) // 增加容错 - const outAvgWeight = outCount > 0 ? (outTotalWeight / outCount)?.toFixed(2) : 0 - - // 损失钢卷数量、总重、均重 - const lossCount = this.lossList.length - const lossTotalWeight = this.lossList.reduce((acc, cur) => acc + (parseFloat(cur.netWeight) || 0), 0) // 增加容错 - const lossAvgWeight = lossCount > 0 ? (lossTotalWeight / lossCount)?.toFixed(2) : 0 - // 合计数量、总重、均重 - const totalCount = outCount + lossCount - const totalWeight = parseFloat((outTotalWeight + lossTotalWeight).toFixed(2)) - const totalAvgWeight = totalCount > 0 ? (totalWeight / totalCount)?.toFixed(2) : 0 - - // 成品比率 - const passRate = outCount > 0 ? (outCount / lossCount) : 0 - // 损失比率 - const lossRate = 1 - passRate - // 异常率,成品在warehouseId在'2019583656787259393', - // '2019583325311414274', - // '2019583429955104769', - // '2019583137616310273',这四个库中的占比 - const abRate = this.list.filter(item => { - return item.warehouseId == '2019583656787259393' || item.warehouseId == '2019583325311414274' || item.warehouseId == '2019583429955104769' || item.warehouseId == '2019583137616310273' - }).length / totalCount - - - return { - outCount, - outTotalWeight: outTotalWeight.toFixed(2), - outAvgWeight, - lossCount, - lossTotalWeight: lossTotalWeight.toFixed(2), - lossAvgWeight, - totalCount, - totalWeight: totalWeight.toFixed(2), - totalAvgWeight, - passRate: passRate?.toFixed(2) * 100 + '%', - lossRate: lossRate?.toFixed(2) * 100 + '%', - abRate: (abRate?.toFixed(2) * 100) || 0 + '%', - } + return calcSummary(this.list) } }, methods: { @@ -376,7 +337,7 @@ export default { message: '暂无数据', type: 'warning', }) - this.list = [] + this.lossList = [] this.loading = false return } diff --git a/klp-ui/src/views/wms/report/zinc/year.vue b/klp-ui/src/views/wms/report/zinc/year.vue index 96ef2837..60e90241 100644 --- a/klp-ui/src/views/wms/report/zinc/year.vue +++ b/klp-ui/src/views/wms/report/zinc/year.vue @@ -144,6 +144,7 @@ import CoilNo from "@/components/KLPService/Renderer/CoilNo.vue"; import MemoInput from "@/components/MemoInput"; import MutiSelect from "@/components/MutiSelect"; import WarehouseSelect from "@/components/KLPService/WarehouseSelect"; +import { calcSummary, calcAbSummary } from "@/views/wms/report/js/calc"; export default { components: { @@ -258,47 +259,7 @@ export default { }, computed: { summary() { - // 总钢卷数量、总重、均重 - const outCount = this.list.length - const outTotalWeight = this.list.reduce((acc, cur) => acc + (parseFloat(cur.netWeight) || 0), 0) // 增加容错 - const outAvgWeight = outCount > 0 ? (outTotalWeight / outCount)?.toFixed(2) : 0 - - // 损失钢卷数量、总重、均重 - const lossCount = this.lossList.length - const lossTotalWeight = this.lossList.reduce((acc, cur) => acc + (parseFloat(cur.netWeight) || 0), 0) // 增加容错 - const lossAvgWeight = lossCount > 0 ? (lossTotalWeight / lossCount)?.toFixed(2) : 0 - // 合计数量、总重、均重 - const totalCount = outCount + lossCount - const totalWeight = parseFloat((outTotalWeight + lossTotalWeight).toFixed(2)) - const totalAvgWeight = totalCount > 0 ? (totalWeight / totalCount)?.toFixed(2) : 0 - - // 成品比率 - const passRate = outCount > 0 ? (outCount / lossCount) : 0 - // 损失比率 - const lossRate = 1 - passRate - // 异常率,成品在warehouseId在'2019583656787259393', - // '2019583325311414274', - // '2019583429955104769', - // '2019583137616310273',这四个库中的占比 - const abRate = this.list.filter(item => { - return item.warehouseId == '2019583656787259393' || item.warehouseId == '2019583325311414274' || item.warehouseId == '2019583429955104769' || item.warehouseId == '2019583137616310273' - }).length / totalCount - - - return { - outCount, - outTotalWeight: outTotalWeight.toFixed(2), - outAvgWeight, - lossCount, - lossTotalWeight: lossTotalWeight.toFixed(2), - lossAvgWeight, - totalCount, - totalWeight: totalWeight.toFixed(2), - totalAvgWeight, - passRate: passRate?.toFixed(2) * 100 + '%', - lossRate: lossRate?.toFixed(2) * 100 + '%', - abRate: (abRate?.toFixed(2) * 100) || 0 + '%', - } + return calcSummary(this.list) } }, methods: { @@ -345,7 +306,7 @@ export default { this.loading = true listPendingAction({ actionType: 501, // 镀锌工序 - pageSize: 999, + pageSize: 9999, pageNum: 1, startTime: this.queryParams.byCreateTimeStart, endTime: this.queryParams.byCreateTimeEnd, @@ -358,7 +319,7 @@ export default { message: '暂无数据', type: 'warning', }) - this.list = [] + this.lossList = [] this.loading = false return } From 48273d49b5ab5637fd952acad4985b4ccc3817e3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=A0=82=E7=B3=96?= Date: Fri, 27 Feb 2026 13:05:36 +0800 Subject: [PATCH 7/8] =?UTF-8?q?fix(wms):=20=E4=BF=AE=E6=AD=A3=E4=BB=93?= =?UTF-8?q?=E5=BA=93ID=E6=A0=BC=E5=BC=8F=E5=92=8C=E8=AE=A1=E7=AE=97?= =?UTF-8?q?=E9=80=BB=E8=BE=91=EF=BC=8C=E4=BC=98=E5=8C=96=E5=9B=A2=E9=98=9F?= =?UTF-8?q?=E6=8A=A5=E8=A1=A8=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 修复仓库ID格式错误,统一为正确格式 修改calcSummary计算逻辑,使用lossList计算损耗数据 重构团队报表页面,增加班组统计功能 优化日期选择器,支持月份范围选择 调整钢卷标签显示为"投入钢卷" --- klp-ui/src/views/wms/report/js/calc.js | 26 +++- klp-ui/src/views/wms/report/zha.vue | 4 +- klp-ui/src/views/wms/report/zha/day.vue | 6 +- klp-ui/src/views/wms/report/zha/month.vue | 4 +- klp-ui/src/views/wms/report/zha/team.vue | 157 ++++++++++++-------- klp-ui/src/views/wms/report/zha/year.vue | 4 +- klp-ui/src/views/wms/report/zinc.vue | 4 +- klp-ui/src/views/wms/report/zinc/day.vue | 22 +-- klp-ui/src/views/wms/report/zinc/month.vue | 8 +- klp-ui/src/views/wms/report/zinc/team.vue | 162 +++++++++++++-------- klp-ui/src/views/wms/report/zinc/year.vue | 8 +- 11 files changed, 251 insertions(+), 154 deletions(-) diff --git a/klp-ui/src/views/wms/report/js/calc.js b/klp-ui/src/views/wms/report/js/calc.js index cd6b0939..79e6d870 100644 --- a/klp-ui/src/views/wms/report/js/calc.js +++ b/klp-ui/src/views/wms/report/js/calc.js @@ -1,12 +1,12 @@ -const calcSummary = (list) => { +const calcSummary = (list, lossList) => { // 总钢卷数量、总重、均重 const outCount = list.length const outTotalWeight = list.reduce((acc, cur) => acc + (parseFloat(cur.netWeight) || 0), 0) // 增加容错 const outAvgWeight = outCount > 0 ? (outTotalWeight / outCount)?.toFixed(2) : 0 // 损失钢卷数量、总重、均重 - const lossCount = list.length - const lossTotalWeight = list.reduce((acc, cur) => acc + (parseFloat(cur.netWeight) || 0), 0) // 增加容错 + const lossCount = lossList.length + const lossTotalWeight = lossList.reduce((acc, cur) => acc + (parseFloat(cur.netWeight) || 0), 0) // 增加容错 const lossAvgWeight = lossCount > 0 ? (lossTotalWeight / lossCount)?.toFixed(2) : 0 // 合计数量、总重、均重 const totalCount = outCount + lossCount @@ -14,7 +14,7 @@ const calcSummary = (list) => { const totalAvgWeight = totalCount > 0 ? (totalWeight / totalCount)?.toFixed(2) : 0 // 成品比率 - const passRate = outCount > 0 ? (outCount / lossCount) : 0 + const passRate = outCount > 0 ? (outTotalWeight / lossTotalWeight) : 0 // 损失比率 const lossRate = totalCount > 0 ? (1 - passRate) : 0 // 异常率,成品在warehouseId在'2019583656787259393', @@ -93,7 +93,25 @@ const calcAbSummary = (list) => { ] } +const calcTeamSummary = (list) => { + // 按照班组汇总信息 + const teamSummary = {} + for (let i = 0; i < list.length; i++) { + const coil = list[i]; + if (!teamSummary[coil.team]) { + teamSummary[coil.team] = { + count: 0, + weight: 0, + } + } + teamSummary[coil.team].count = teamSummary[coil.team].count + 1 + teamSummary[coil.team].weight = teamSummary[coil.team].weight + parseFloat(coil.netWeight) || 0 + } + return teamSummary +} + export { calcSummary, calcAbSummary, + calcTeamSummary, } \ No newline at end of file diff --git a/klp-ui/src/views/wms/report/zha.vue b/klp-ui/src/views/wms/report/zha.vue index 11782543..2826bf48 100644 --- a/klp-ui/src/views/wms/report/zha.vue +++ b/klp-ui/src/views/wms/report/zha.vue @@ -197,10 +197,10 @@ export default { createBy: 'suanzhakuguan', warehouseId: '2019583656787259393' }, - '20195833325311414274': { + '2019583325311414274': { selectType: 'product', createBy: 'suanzhakuguan', - warehouseId: '20195833325311414274' + warehouseId: '2019583325311414274' }, '2019583429955104769': { selectType: 'product', diff --git a/klp-ui/src/views/wms/report/zha/day.vue b/klp-ui/src/views/wms/report/zha/day.vue index 57ca4ad6..48ba02fc 100644 --- a/klp-ui/src/views/wms/report/zha/day.vue +++ b/klp-ui/src/views/wms/report/zha/day.vue @@ -71,7 +71,7 @@ - +