From e1cb4683afc361d043d38d8d3352345aae28a699 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=A0=82=E7=B3=96?= Date: Fri, 20 Mar 2026 10:33:51 +0800 Subject: [PATCH 1/5] =?UTF-8?q?feat(wms=E6=8A=A5=E8=A1=A8):=20=E6=B7=BB?= =?UTF-8?q?=E5=8A=A0=E6=AD=A3=E5=93=81=E7=8E=87=E6=98=BE=E7=A4=BA=E5=B9=B6?= =?UTF-8?q?=E4=BC=98=E5=8C=96=E5=BC=82=E5=B8=B8=E7=BB=9F=E8=AE=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 在报表模板中添加正品率(passRate2)显示项 重构getLossList调用逻辑,改为在getList完成后调用 优化calc.js中的异常统计计算,添加各异常库占比数据 --- klp-ui/src/views/wms/report/js/calc.js | 33 +++++++++++++++---- klp-ui/src/views/wms/report/template/day.vue | 9 +++-- .../src/views/wms/report/template/month.vue | 10 ++++-- klp-ui/src/views/wms/report/template/team.vue | 10 ++++-- klp-ui/src/views/wms/report/template/year.vue | 10 ++++-- 5 files changed, 54 insertions(+), 18 deletions(-) diff --git a/klp-ui/src/views/wms/report/js/calc.js b/klp-ui/src/views/wms/report/js/calc.js index 79e6d870..b81917a4 100644 --- a/klp-ui/src/views/wms/report/js/calc.js +++ b/klp-ui/src/views/wms/report/js/calc.js @@ -25,6 +25,9 @@ const calcSummary = (list, lossList) => { return item.warehouseId == '2019583656787259393' || item.warehouseId == '2019583325311414274' || item.warehouseId == '2019583429955104769' || item.warehouseId == '2019583137616310273' }).length / totalCount : 0 + // 正品率(1-异常率) + const passRate2 = totalCount != 0 ? (1 - abRate * totalCount) : 0 + return { outCount, outTotalWeight: outTotalWeight.toFixed(2), @@ -38,6 +41,7 @@ const calcSummary = (list, lossList) => { passRate: (passRate * 100)?.toFixed(2) + '%', lossRate: (lossRate * 100)?.toFixed(2) + '%', abRate: (abRate * 100)?.toFixed(2) || 0, + passRate2: (passRate2 * 100)?.toFixed(2) || 0, } } @@ -45,14 +49,25 @@ const calcAbSummary = (list) => { // 异常统计,统计四个异常库中的各自的数量和总重 let o = { jishuCount: 0, - jishuWeight: 0, miniCount: 0, - miniWeight: 0, rubbishCount: 0, - rubbishWeight: 0, returnCount: 0, + + jishuWeight: 0, + miniWeight: 0, + rubbishWeight: 0, returnWeight: 0, + + // 计入技术部的钢卷占比 + jishuRate: 0, + // 计入小钢卷库的钢卷占比 + miniRate: 0, + // 计入废品库的钢卷占比 + rubbishRate: 0, + // 计入退货库的钢卷占比 + returnRate: 0, } + const totalCount = list.length for (let i = 0; i < list.length; i++) { // { label: '技术部', value: '2019583656787259393' }, // { label: '小钢卷库', value: '2019583325311414274' }, @@ -83,13 +98,19 @@ const calcAbSummary = (list) => { } 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['jishuWeight'] }, + { label: '小钢卷库钢卷重量', value: o['miniWeight'] }, + { label: '废品库钢卷重量', value: o['rubbishWeight'] }, { label: '退货库钢卷重量', value: o['returnWeight'] }, + + { label: '技术部占比', value: (o['jishuCount'] / totalCount * 100).toFixed(2) + '%' }, + { label: '小钢卷库占比', value: (o['miniCount'] / totalCount * 100).toFixed(2) + '%' }, + { label: '废品库占比', value: (o['rubbishCount'] / totalCount * 100).toFixed(2) + '%' }, + { label: '退货库占比', value: (o['returnCount'] / totalCount * 100).toFixed(2) + '%' }, ] } diff --git a/klp-ui/src/views/wms/report/template/day.vue b/klp-ui/src/views/wms/report/template/day.vue index 88e37c14..6cdcbef6 100644 --- a/klp-ui/src/views/wms/report/template/day.vue +++ b/klp-ui/src/views/wms/report/template/day.vue @@ -62,6 +62,8 @@ {{ summary.lossRate }} {{ summary.abRate }} + + {{ summary.passRate2 }} @@ -229,7 +231,7 @@ export default { // 统一查询入口(兼容回车和按钮点击) handleQuery() { this.getList() - this.getLossList() + // this.getLossList() }, // 核心查询逻辑 getList() { @@ -264,7 +266,8 @@ export default { computedWidth: parseFloat(width), } }) - this.loading = false + this.getLossList() + // this.loading = false }) }, async getLossList() { @@ -333,7 +336,7 @@ export default { }, mounted() { this.getList() - this.getLossList() + // this.getLossList() this.loadColumns() } } diff --git a/klp-ui/src/views/wms/report/template/month.vue b/klp-ui/src/views/wms/report/template/month.vue index d2405d58..45aaf022 100644 --- a/klp-ui/src/views/wms/report/template/month.vue +++ b/klp-ui/src/views/wms/report/template/month.vue @@ -62,6 +62,8 @@ {{ summary.lossRate }} {{ summary.abRate }} + + {{ summary.passRate2 }} @@ -259,7 +261,7 @@ export default { // 统一查询入口(兼容回车和按钮点击) handleQuery() { this.getList() - this.getLossList() + // this.getLossList() }, // 核心查询逻辑 getList() { @@ -294,7 +296,9 @@ export default { computedWidth: parseFloat(width), } }) - this.loading = false + // this.loading = false + this.getLossList() + // this.loading = false }) }, async getLossList() { @@ -363,7 +367,7 @@ export default { }, mounted() { this.getList() - this.getLossList() + // this.getLossList() this.loadColumns() } } diff --git a/klp-ui/src/views/wms/report/template/team.vue b/klp-ui/src/views/wms/report/template/team.vue index 70e7dd29..6c6dfd14 100644 --- a/klp-ui/src/views/wms/report/template/team.vue +++ b/klp-ui/src/views/wms/report/template/team.vue @@ -67,6 +67,8 @@ {{ summary.passRate }} {{ summary.lossRate }} {{ summary.abRate }} + + {{ summary.passRate2 }} @@ -243,7 +245,7 @@ export default { }, handleQuery() { this.getList(); - this.getLossList(); + // this.getLossList(); }, getList() { this.loading = true; @@ -273,7 +275,9 @@ export default { computedWidth: parseFloat(width), } }); - this.loading = false; + // this.loading = false; + this.getLossList() + // this.loading = false; }).catch(err => { console.error('查询失败:', err); this.loading = false; @@ -349,7 +353,7 @@ export default { }, mounted() { this.getList(); - this.getLossList(); + // this.getLossList(); this.loadColumns(); } }; diff --git a/klp-ui/src/views/wms/report/template/year.vue b/klp-ui/src/views/wms/report/template/year.vue index ae74bbb9..24911d4b 100644 --- a/klp-ui/src/views/wms/report/template/year.vue +++ b/klp-ui/src/views/wms/report/template/year.vue @@ -62,6 +62,8 @@ {{ summary.lossRate }} {{ summary.abRate }} + + {{ summary.passRate2 }} @@ -238,7 +240,7 @@ export default { // 统一查询入口(兼容回车和按钮点击) handleQuery() { this.getList() - this.getLossList() + // this.getLossList() }, // 核心查询逻辑 getList() { @@ -273,7 +275,9 @@ export default { computedWidth: parseFloat(width), } }) - this.loading = false + // this.loading = false + this.getLossList() + // this.loading = false }) }, async getLossList() { @@ -342,7 +346,7 @@ export default { }, mounted() { this.getList() - this.getLossList() + // this.getLossList() this.loadColumns() } } From b5d1dd64e6b8ee930c6867ea110c9f8760f44bbb Mon Sep 17 00:00:00 2001 From: Joshi <3040996759@qq.com> Date: Fri, 20 Mar 2026 11:04:08 +0800 Subject: [PATCH 2/5] =?UTF-8?q?fix(wms):=20=E6=B7=BB=E5=8A=A0=E8=B4=A8?= =?UTF-8?q?=E9=87=8F=E7=8A=B6=E6=80=81=E6=A3=80=E6=9F=A5=E9=98=B2=E6=AD=A2?= =?UTF-8?q?=E4=B8=8D=E5=90=88=E6=A0=BC=E9=92=A2=E5=8D=B7=E5=8F=91=E8=B4=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 实现质量状态为O时的发货限制功能 - 添加"当前钢卷为质检未通过,请勿发货!"错误提示 - 确保只有合格钢卷才能进行发货操作 --- .../java/com/klp/service/impl/WmsMaterialCoilServiceImpl.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/klp-wms/src/main/java/com/klp/service/impl/WmsMaterialCoilServiceImpl.java b/klp-wms/src/main/java/com/klp/service/impl/WmsMaterialCoilServiceImpl.java index 5164a25f..d2d183e9 100644 --- a/klp-wms/src/main/java/com/klp/service/impl/WmsMaterialCoilServiceImpl.java +++ b/klp-wms/src/main/java/com/klp/service/impl/WmsMaterialCoilServiceImpl.java @@ -2539,6 +2539,10 @@ public class WmsMaterialCoilServiceImpl implements IWmsMaterialCoilService { WmsMaterialCoilVo wmsMaterialCoilVo = queryById(coilId); Long oldActualWarehouseId = wmsMaterialCoilVo != null ? wmsMaterialCoilVo.getActualWarehouseId() : null; + // 如果质量状态为O的提示不能发货 + if (wmsMaterialCoilVo != null && Objects.equals(wmsMaterialCoilVo.getQualityStatus(), "O")) { + throw new RuntimeException("当前钢卷为质检未通过,请勿发货!"); + } // 如果当前钢卷为历史数据应该抛异常 if (wmsMaterialCoilVo != null && wmsMaterialCoilVo.getDataType() == 0) { throw new RuntimeException("当前数据为历史数据,请勿发货!"); From dba9a026362daec8a0f135961398b2dc222df50d Mon Sep 17 00:00:00 2001 From: Joshi <3040996759@qq.com> Date: Fri, 20 Mar 2026 11:18:54 +0800 Subject: [PATCH 3/5] =?UTF-8?q?feat(WmsMaterialCoil):=20=E6=B7=BB=E5=8A=A0?= =?UTF-8?q?=E9=92=A2=E5=8D=B7=E6=8C=89=E5=BC=82=E5=B8=B8=E6=95=B0=E9=87=8F?= =?UTF-8?q?=E6=8E=92=E5=BA=8F=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 在WmsMaterialCoilBo中新增orderByAbnormal字段用于控制排序方式 - 实现按异常数量排序逻辑:异常钢卷在前按创建时间倒序,无异常钢卷在后按创建时间倒序 - 使用CASE语句实现异常状态的条件排序 - 保持原有创建时间排序作为默认选项 --- .../src/main/java/com/klp/domain/bo/WmsMaterialCoilBo.java | 6 ++++++ .../com/klp/service/impl/WmsMaterialCoilServiceImpl.java | 4 ++++ 2 files changed, 10 insertions(+) diff --git a/klp-wms/src/main/java/com/klp/domain/bo/WmsMaterialCoilBo.java b/klp-wms/src/main/java/com/klp/domain/bo/WmsMaterialCoilBo.java index fba2faa8..afae1c0a 100644 --- a/klp-wms/src/main/java/com/klp/domain/bo/WmsMaterialCoilBo.java +++ b/klp-wms/src/main/java/com/klp/domain/bo/WmsMaterialCoilBo.java @@ -319,5 +319,11 @@ public class WmsMaterialCoilBo extends BaseEntity { * 钢卷异常信息列表(用于更新钢卷时同时插入异常信息) */ private List abnormals; + + /** + * 按异常数量排序(异常钢卷在前按创建时间,没异常的钢卷在后按创建时间) + */ + @TableField(exist = false) + private Boolean orderByAbnormal; } diff --git a/klp-wms/src/main/java/com/klp/service/impl/WmsMaterialCoilServiceImpl.java b/klp-wms/src/main/java/com/klp/service/impl/WmsMaterialCoilServiceImpl.java index d2d183e9..58d252b2 100644 --- a/klp-wms/src/main/java/com/klp/service/impl/WmsMaterialCoilServiceImpl.java +++ b/klp-wms/src/main/java/com/klp/service/impl/WmsMaterialCoilServiceImpl.java @@ -689,6 +689,10 @@ public class WmsMaterialCoilServiceImpl implements IWmsMaterialCoilService { qw.orderByAsc("aw_sort_key"); qw.orderByAsc("aw_layer_key"); qw.orderByAsc("aw_id_key"); + } else if (Boolean.TRUE.equals(bo.getOrderByAbnormal())) { + // 按异常排序:异常的钢卷在前按创建时间倒序,没异常的钢卷在后按创建时间倒序 + qw.orderByDesc("CASE WHEN COALESCE(ca.abnormal_count, 0) > 0 THEN 0 ELSE 1 END"); + qw.orderByDesc("mc.create_time"); } else { //根据创建时间倒叙 qw.orderByDesc("mc.create_time"); From 076b0e8e241070f2390fcc08ba618db0a7409fa0 Mon Sep 17 00:00:00 2001 From: Joshi <3040996759@qq.com> Date: Fri, 20 Mar 2026 12:57:04 +0800 Subject: [PATCH 4/5] =?UTF-8?q?fix(wms):=20=E4=BF=AE=E6=AD=A3=E9=92=A2?= =?UTF-8?q?=E5=8D=B7=E5=88=97=E8=A1=A8=E5=BC=82=E5=B8=B8=E6=8E=92=E5=BA=8F?= =?UTF-8?q?=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 将异常钢卷排序从降序改为升序,确保异常钢卷始终排在前面 - 保持非异常钢卷按创建时间倒序排列的原有逻辑不变 --- .../java/com/klp/service/impl/WmsMaterialCoilServiceImpl.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/klp-wms/src/main/java/com/klp/service/impl/WmsMaterialCoilServiceImpl.java b/klp-wms/src/main/java/com/klp/service/impl/WmsMaterialCoilServiceImpl.java index 58d252b2..88e258a0 100644 --- a/klp-wms/src/main/java/com/klp/service/impl/WmsMaterialCoilServiceImpl.java +++ b/klp-wms/src/main/java/com/klp/service/impl/WmsMaterialCoilServiceImpl.java @@ -691,7 +691,7 @@ public class WmsMaterialCoilServiceImpl implements IWmsMaterialCoilService { qw.orderByAsc("aw_id_key"); } else if (Boolean.TRUE.equals(bo.getOrderByAbnormal())) { // 按异常排序:异常的钢卷在前按创建时间倒序,没异常的钢卷在后按创建时间倒序 - qw.orderByDesc("CASE WHEN COALESCE(ca.abnormal_count, 0) > 0 THEN 0 ELSE 1 END"); + qw.orderByAsc("CASE WHEN COALESCE(ca.abnormal_count, 0) > 0 THEN 0 ELSE 1 END"); qw.orderByDesc("mc.create_time"); } else { //根据创建时间倒叙 From d6e30d4d50356e26f1611ab6d242841696fb1dd4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=A0=82=E7=B3=96?= Date: Fri, 20 Mar 2026 13:34:56 +0800 Subject: [PATCH 5/5] =?UTF-8?q?feat(=E6=8A=A5=E8=A1=A8):=20=E6=96=B0?= =?UTF-8?q?=E5=A2=9E=E7=BB=BC=E5=90=88=E6=8A=A5=E8=A1=A8=E6=A8=A1=E6=9D=BF?= =?UTF-8?q?=E5=8F=8AM=E5=8D=B7=E7=BB=9F=E8=AE=A1=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 新增综合报表模板,支持按不同仓库类型展示统计信息。添加M卷处理功能,在统计中自动过滤并计算M卷数据。优化报表展示顺序,默认显示产出钢卷。修复异常率计算问题,完善统计信息展示。 新增仓库特定报表页面,包括镀铬、拉矫、脱脂、双机架、镀锌和酸连轧成品库报表。调整KLPTable组件支持高度设置,优化基础面板显示逻辑。 修复API请求超时问题,统一设置超时时间为10分钟。调整标签显示文本,优化用户体验。 --- klp-ui/src/api/wms/coil.js | 3 +- klp-ui/src/api/wms/pendingAction.js | 3 +- .../src/components/KLPUI/KLPTable/index.vue | 6 +- klp-ui/src/components/TimeInput.vue | 2 +- klp-ui/src/views/wms/coil/abnormal.vue | 1 + .../coil/panels/LabelRender/GalvanizedTag.vue | 2 +- klp-ui/src/views/wms/coil/panels/base.vue | 10 +- .../views/wms/report/duge/comprehensive.vue | 37 ++ klp-ui/src/views/wms/report/js/calc.js | 80 +++- .../views/wms/report/lajiao/comprehensive.vue | 37 ++ klp-ui/src/views/wms/report/merge/index.vue | 30 +- .../views/wms/report/shuang/comprehensive.vue | 37 ++ .../wms/report/template/comprehensive.vue | 402 ++++++++++++++++++ klp-ui/src/views/wms/report/template/day.vue | 38 +- .../src/views/wms/report/template/month.vue | 36 +- .../src/views/wms/report/template/shuang.vue | 168 ++++++++ klp-ui/src/views/wms/report/template/team.vue | 31 +- klp-ui/src/views/wms/report/template/year.vue | 36 +- .../views/wms/report/tuozhi/comprehensive.vue | 37 ++ .../views/wms/report/zha/comprehensive.vue | 40 ++ .../views/wms/report/zinc/comprehensive.vue | 38 ++ 21 files changed, 1032 insertions(+), 42 deletions(-) create mode 100644 klp-ui/src/views/wms/report/duge/comprehensive.vue create mode 100644 klp-ui/src/views/wms/report/lajiao/comprehensive.vue create mode 100644 klp-ui/src/views/wms/report/shuang/comprehensive.vue create mode 100644 klp-ui/src/views/wms/report/template/comprehensive.vue create mode 100644 klp-ui/src/views/wms/report/template/shuang.vue create mode 100644 klp-ui/src/views/wms/report/tuozhi/comprehensive.vue create mode 100644 klp-ui/src/views/wms/report/zha/comprehensive.vue create mode 100644 klp-ui/src/views/wms/report/zinc/comprehensive.vue diff --git a/klp-ui/src/api/wms/coil.js b/klp-ui/src/api/wms/coil.js index 31472a82..fc627750 100644 --- a/klp-ui/src/api/wms/coil.js +++ b/klp-ui/src/api/wms/coil.js @@ -190,7 +190,8 @@ export function listCoilWithIds(data) { return request({ url: '/wms/materialCoil/listByPost', method: 'post', - data + data, + timeout: 600000 }) } diff --git a/klp-ui/src/api/wms/pendingAction.js b/klp-ui/src/api/wms/pendingAction.js index c0aba021..d6d17579 100644 --- a/klp-ui/src/api/wms/pendingAction.js +++ b/klp-ui/src/api/wms/pendingAction.js @@ -23,7 +23,8 @@ export function listPendingAction(query) { return request({ url: '/wms/coilPendingAction/list', method: 'get', - params: query + params: query, + timeout: 600000 }) } diff --git a/klp-ui/src/components/KLPUI/KLPTable/index.vue b/klp-ui/src/components/KLPUI/KLPTable/index.vue index 4bc14c76..180f77cd 100644 --- a/klp-ui/src/components/KLPUI/KLPTable/index.vue +++ b/klp-ui/src/components/KLPUI/KLPTable/index.vue @@ -9,7 +9,7 @@
+ @cell-mouse-enter="handleCellEnter" @row-mouseleave="handleRowLeave" :height="height"> diff --git a/klp-ui/src/views/wms/report/duge/comprehensive.vue b/klp-ui/src/views/wms/report/duge/comprehensive.vue new file mode 100644 index 00000000..3dacb83a --- /dev/null +++ b/klp-ui/src/views/wms/report/duge/comprehensive.vue @@ -0,0 +1,37 @@ + + + \ No newline at end of file diff --git a/klp-ui/src/views/wms/report/js/calc.js b/klp-ui/src/views/wms/report/js/calc.js index b81917a4..a4986f77 100644 --- a/klp-ui/src/views/wms/report/js/calc.js +++ b/klp-ui/src/views/wms/report/js/calc.js @@ -14,7 +14,7 @@ const calcSummary = (list, lossList) => { const totalAvgWeight = totalCount > 0 ? (totalWeight / totalCount)?.toFixed(2) : 0 // 成品比率 - const passRate = outCount > 0 ? (outTotalWeight / lossTotalWeight) : 0 + const passRate = outCount > 0 && lossTotalWeight > 0 ? (outTotalWeight / lossTotalWeight) : 0 // 损失比率 const lossRate = totalCount > 0 ? (1 - passRate) : 0 // 异常率,成品在warehouseId在'2019583656787259393', @@ -26,7 +26,7 @@ const calcSummary = (list, lossList) => { }).length / totalCount : 0 // 正品率(1-异常率) - const passRate2 = totalCount != 0 ? (1 - abRate * totalCount) : 0 + const passRate2 = totalCount != 0 ? (1 - abRate) : 0 return { outCount, @@ -102,15 +102,15 @@ const calcAbSummary = (list) => { { label: '废品库钢卷数', value: o['rubbishCount'] }, { label: '退货库钢卷数', value: o['returnCount'] }, - { label: '技术部钢卷重量', value: o['jishuWeight'] }, - { label: '小钢卷库钢卷重量', value: o['miniWeight'] }, - { label: '废品库钢卷重量', value: o['rubbishWeight'] }, - { label: '退货库钢卷重量', value: o['returnWeight'] }, + { label: '技术部钢卷重量', value: o['jishuWeight'].toFixed(2) }, + { label: '小钢卷库钢卷重量', value: o['miniWeight'].toFixed(2) }, + { label: '废品库钢卷重量', value: o['rubbishWeight'].toFixed(2) }, + { label: '退货库钢卷重量', value: o['returnWeight'].toFixed(2) }, - { label: '技术部占比', value: (o['jishuCount'] / totalCount * 100).toFixed(2) + '%' }, - { label: '小钢卷库占比', value: (o['miniCount'] / totalCount * 100).toFixed(2) + '%' }, - { label: '废品库占比', value: (o['rubbishCount'] / totalCount * 100).toFixed(2) + '%' }, - { label: '退货库占比', value: (o['returnCount'] / totalCount * 100).toFixed(2) + '%' }, + { label: '技术部占比', value: totalCount > 0 ? (o['jishuCount'] / totalCount * 100).toFixed(2) + '%' : '0.00%' }, + { label: '小钢卷库占比', value: totalCount > 0 ? (o['miniCount'] / totalCount * 100).toFixed(2) + '%' : '0.00%' }, + { label: '废品库占比', value: totalCount > 0 ? (o['rubbishCount'] / totalCount * 100).toFixed(2) + '%' : '0.00%' }, + { label: '退货库占比', value: totalCount > 0 ? (o['returnCount'] / totalCount * 100).toFixed(2) + '%' : '0.00%' }, ] } @@ -131,8 +131,68 @@ const calcTeamSummary = (list) => { return teamSummary } +const calcMSummary = (list, lossList) => { + // 统计,需要二外处理M卷,也就是钢卷的currentCoilNo中带有M的钢卷,在统计产出钢卷的数量和重量时需要忽略并记录,并且在统计消耗钢卷的总重量时也需要移除 + + // 筛选出 M 卷 + const mCoils = list.filter(item => item.currentCoilNo && item.currentCoilNo.includes('M')) + // 非 M 卷 + const nonMCoils = list.filter(item => !item.currentCoilNo || !item.currentCoilNo.includes('M')) + + // 非 M 卷作为产出统计 + const outCount = nonMCoils.length + const outTotalWeight = nonMCoils.reduce((acc, cur) => acc + (parseFloat(cur.netWeight) || 0), 0) + const outAvgWeight = outCount > 0 ? (outTotalWeight / outCount)?.toFixed(2) : 0 + + // 计算产出的 M 卷总重量 + const mOutTotalWeight = mCoils.reduce((acc, cur) => acc + (parseFloat(cur.netWeight) || 0), 0) + + // 消耗钢卷统计(数量包括所有卷,但总重量减去产出的 M 卷重量) + const lossCount = lossList.length + const lossTotalWeight = lossList.reduce((acc, cur) => acc + (parseFloat(cur.netWeight) || 0), 0) - mOutTotalWeight + 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 && lossTotalWeight > 0 ? (outTotalWeight / lossTotalWeight) : 0 + // 损失比率 + const lossRate = totalCount > 0 ? (1 - passRate) : 0 + + // 异常率,成品在warehouseId在'2019583656787259393', + // '2019583325311414274', + // '2019583429955104769', + // '2019583137616310273',这四个库中的占比 + const abRate = totalCount != 0 ? nonMCoils.filter(item => { + return item.warehouseId == '2019583656787259393' || item.warehouseId == '2019583325311414274' || item.warehouseId == '2019583429955104769' || item.warehouseId == '2019583137616310273' + }).length / totalCount : 0 + + // 正品率(1-异常率) + const passRate2 = totalCount != 0 ? (1 - abRate) : 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, + passRate2: (passRate2 * 100)?.toFixed(2) || 0, + } +} + export { calcSummary, calcAbSummary, calcTeamSummary, + calcMSummary, } \ No newline at end of file diff --git a/klp-ui/src/views/wms/report/lajiao/comprehensive.vue b/klp-ui/src/views/wms/report/lajiao/comprehensive.vue new file mode 100644 index 00000000..59b7ee5e --- /dev/null +++ b/klp-ui/src/views/wms/report/lajiao/comprehensive.vue @@ -0,0 +1,37 @@ + + + \ No newline at end of file diff --git a/klp-ui/src/views/wms/report/merge/index.vue b/klp-ui/src/views/wms/report/merge/index.vue index 8bf716de..ecb4dd29 100644 --- a/klp-ui/src/views/wms/report/merge/index.vue +++ b/klp-ui/src/views/wms/report/merge/index.vue @@ -61,6 +61,31 @@ {{ summary.lossRate }} {{ summary.abRate }} + + {{ summary.passRate2 }} + + + + + {{ mSummary.outCount }} + {{ mSummary.outTotalWeight }}t + {{ mSummary.outAvgWeight }}t + + {{ mSummary.lossCount }} + {{ mSummary.lossTotalWeight }}t + {{ mSummary.lossAvgWeight }}t + + {{ mSummary.totalCount }} + {{ mSummary.totalWeight }}t + {{ mSummary.totalAvgWeight }}t + + + {{ mSummary.passRate }} + {{ mSummary.lossRate }} + + {{ mSummary.abRate }} + + {{ mSummary.passRate2 }} @@ -94,7 +119,7 @@ import MutiSelect from "@/components/MutiSelect"; import ProductInfo from "@/components/KLPService/Renderer/ProductInfo"; import RawMaterialInfo from "@/components/KLPService/Renderer/RawMaterialInfo"; import CoilNo from "@/components/KLPService/Renderer/CoilNo.vue"; -import { calcSummary } from "@/views/wms/report/js/calc"; +import { calcSummary, calcMSummary } from "@/views/wms/report/js/calc"; import CoilTable from "@/views/wms/report/components/coilTable"; import ColumnsSetting from "@/views/wms/report/components/setting/columns"; @@ -191,6 +216,9 @@ export default { summary() { return calcSummary(this.outList, this.lossList) }, + mSummary() { + return calcMSummary(this.outList, this.lossList) + }, }, created() { this.handleQuery() diff --git a/klp-ui/src/views/wms/report/shuang/comprehensive.vue b/klp-ui/src/views/wms/report/shuang/comprehensive.vue new file mode 100644 index 00000000..363a0419 --- /dev/null +++ b/klp-ui/src/views/wms/report/shuang/comprehensive.vue @@ -0,0 +1,37 @@ + + + \ No newline at end of file diff --git a/klp-ui/src/views/wms/report/template/comprehensive.vue b/klp-ui/src/views/wms/report/template/comprehensive.vue new file mode 100644 index 00000000..7ed1e539 --- /dev/null +++ b/klp-ui/src/views/wms/report/template/comprehensive.vue @@ -0,0 +1,402 @@ + + + + + \ No newline at end of file diff --git a/klp-ui/src/views/wms/report/template/day.vue b/klp-ui/src/views/wms/report/template/day.vue index 6cdcbef6..59a46cc0 100644 --- a/klp-ui/src/views/wms/report/template/day.vue +++ b/klp-ui/src/views/wms/report/template/day.vue @@ -66,6 +66,29 @@ {{ summary.passRate2 }} + + + {{ mSummary.outCount }} + {{ mSummary.outTotalWeight }}t + {{ mSummary.outAvgWeight }}t + + {{ mSummary.lossCount }} + {{ mSummary.lossTotalWeight }}t + {{ mSummary.lossAvgWeight }}t + + {{ mSummary.totalCount }} + {{ mSummary.totalWeight }}t + {{ mSummary.totalAvgWeight }}t + + + {{ mSummary.passRate }} + {{ mSummary.lossRate }} + + {{ mSummary.abRate }} + + {{ mSummary.passRate2 }} + + {{ item.value @@ -75,12 +98,12 @@ - - - + + + @@ -104,7 +127,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"; +import { calcSummary, calcAbSummary, calcMSummary } from "@/views/wms/report/js/calc"; import ColumnsSetting from "@/views/wms/report/components/setting/columns.vue"; import CoilTable from "@/views/wms/report/components/coilTable/index.vue"; @@ -158,7 +181,7 @@ export default { const { start, end } = getDayTimeRange(currentDate) return { - activeTab: 'loss', + activeTab: 'output', activeColumnConfig: 'coil-report-loss', settingVisible: false, list: [], @@ -211,6 +234,9 @@ export default { }, abSummary() { return calcAbSummary(this.list) + }, + mSummary() { + return calcMSummary(this.list, this.lossList) } }, methods: { @@ -266,7 +292,7 @@ export default { computedWidth: parseFloat(width), } }) - this.getLossList() + this.getLossList() // this.loading = false }) }, diff --git a/klp-ui/src/views/wms/report/template/month.vue b/klp-ui/src/views/wms/report/template/month.vue index 45aaf022..44d88428 100644 --- a/klp-ui/src/views/wms/report/template/month.vue +++ b/klp-ui/src/views/wms/report/template/month.vue @@ -66,6 +66,29 @@ {{ summary.passRate2 }} + + + {{ mSummary.outCount }} + {{ mSummary.outTotalWeight }}t + {{ mSummary.outAvgWeight }}t + + {{ mSummary.lossCount }} + {{ mSummary.lossTotalWeight }}t + {{ mSummary.lossAvgWeight }}t + + {{ mSummary.totalCount }} + {{ mSummary.totalWeight }}t + {{ mSummary.totalAvgWeight }}t + + + {{ mSummary.passRate }} + {{ mSummary.lossRate }} + + {{ mSummary.abRate }} + + {{ mSummary.passRate2 }} + + {{ item.value @@ -75,12 +98,12 @@ - - - + + + @@ -104,7 +127,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"; +import { calcSummary, calcAbSummary, calcMSummary } from "@/views/wms/report/js/calc"; import ColumnsSetting from "@/views/wms/report/components/setting/columns.vue"; import CoilTable from "@/views/wms/report/components/coilTable/index.vue"; @@ -188,7 +211,7 @@ export default { const { start, end } = getDayTimeRange(currentDate) return { - activeTab: 'loss', + activeTab: 'output', activeColumnConfig: 'coil-report-loss', settingVisible: false, list: [], @@ -241,6 +264,9 @@ export default { }, abSummary() { return calcAbSummary(this.list) + }, + mSummary() { + return calcMSummary(this.list, this.lossList) } }, methods: { diff --git a/klp-ui/src/views/wms/report/template/shuang.vue b/klp-ui/src/views/wms/report/template/shuang.vue new file mode 100644 index 00000000..4bf638a0 --- /dev/null +++ b/klp-ui/src/views/wms/report/template/shuang.vue @@ -0,0 +1,168 @@ + + + \ No newline at end of file diff --git a/klp-ui/src/views/wms/report/zha/comprehensive.vue b/klp-ui/src/views/wms/report/zha/comprehensive.vue new file mode 100644 index 00000000..703bcd50 --- /dev/null +++ b/klp-ui/src/views/wms/report/zha/comprehensive.vue @@ -0,0 +1,40 @@ + + + \ No newline at end of file diff --git a/klp-ui/src/views/wms/report/zinc/comprehensive.vue b/klp-ui/src/views/wms/report/zinc/comprehensive.vue new file mode 100644 index 00000000..5be7bad7 --- /dev/null +++ b/klp-ui/src/views/wms/report/zinc/comprehensive.vue @@ -0,0 +1,38 @@ + + + \ No newline at end of file