From 0223102269598494d6862282a1125ab7cf41ea27 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=A0=82=E7=B3=96?= Date: Tue, 31 Mar 2026 18:37:17 +0800 Subject: [PATCH] =?UTF-8?q?feat(wms/report):=20=E6=B7=BB=E5=8A=A0=E5=B7=AE?= =?UTF-8?q?=E5=80=BC=E8=AE=A1=E7=AE=97=E5=92=8C=E5=BC=82=E5=B8=B8=E4=BF=A1?= =?UTF-8?q?=E6=81=AF=E5=B1=95=E7=A4=BA=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit refactor(wms/report): 替换合计信息为差值显示 feat(wms/coil): 增加创建时间和创建人字段 feat(crm/contract): 添加合同导出按钮 --- klp-ui/src/views/crm/contract/index.vue | 5 ++ klp-ui/src/views/wms/coil/do/correntAll.vue | 10 ++++ .../wms/report/components/coilTable/index.vue | 49 +++++++++++++++++++ klp-ui/src/views/wms/report/js/calc.js | 18 +++++++ .../wms/report/template/comprehensive.vue | 14 +++--- klp-ui/src/views/wms/report/template/day.vue | 14 +++--- .../src/views/wms/report/template/merge.vue | 36 ++++++++++++-- .../src/views/wms/report/template/month.vue | 16 +++--- klp-ui/src/views/wms/report/template/team.vue | 26 +++++++--- klp-ui/src/views/wms/report/template/year.vue | 15 +++--- 10 files changed, 161 insertions(+), 42 deletions(-) diff --git a/klp-ui/src/views/crm/contract/index.vue b/klp-ui/src/views/crm/contract/index.vue index ddccc05c..9e246d0d 100644 --- a/klp-ui/src/views/crm/contract/index.vue +++ b/klp-ui/src/views/crm/contract/index.vue @@ -89,6 +89,7 @@ @@ -541,6 +542,10 @@ export default { this.download('crm/contract/export', { ...this.queryParams }, `contract_${new Date().getTime()}.xlsx`) + }, + handleExportContract(row) { + // 合同导出 + } } }; diff --git a/klp-ui/src/views/wms/coil/do/correntAll.vue b/klp-ui/src/views/wms/coil/do/correntAll.vue index 4067115f..f440a42e 100644 --- a/klp-ui/src/views/wms/coil/do/correntAll.vue +++ b/klp-ui/src/views/wms/coil/do/correntAll.vue @@ -426,6 +426,16 @@ + + + + + + + + + @@ -63,6 +90,8 @@ import ProductInfo from "@/components/KLPService/Renderer/ProductInfo"; import RawMaterialInfo from "@/components/KLPService/Renderer/RawMaterialInfo"; import CoilNo from "@/components/KLPService/Renderer/CoilNo.vue"; +import { listCoilAbnormal } from '@/api/wms/coilAbnormal' + export default { name: 'CoilTable', components: { @@ -80,6 +109,7 @@ export default { default: () => [], }, }, + dicts: ['coil_quality_status', 'coil_abnormal_code', 'coil_abnormal_degree'], data() { return { pageNum: 1, @@ -90,6 +120,11 @@ export default { // 筛选相关 filterKeyword: '', filterColumn: [], + abmornal: { + visible: false, + data: {}, + loading: false, + } } }, mounted() { @@ -201,6 +236,20 @@ export default { // 处理排序规则变化 handleSortChange() { this.pageNum = 1 + }, + handleQualityStatusClick(row) { + this.abmornal.visible = true + this.abmornal.loading = true + listCoilAbnormal({ + coilId: row.coilId + }).then(response => { + this.abmornal.data = response.rows || [] + }).catch(error => { + console.error('查询异常记录失败:', error) + this.$message.error('查询异常记录失败: ' + (error.message || error)) + }).finally(() => { + this.abmornal.loading = false + }) } } } diff --git a/klp-ui/src/views/wms/report/js/calc.js b/klp-ui/src/views/wms/report/js/calc.js index a35d6d1d..fd88a95f 100644 --- a/klp-ui/src/views/wms/report/js/calc.js +++ b/klp-ui/src/views/wms/report/js/calc.js @@ -13,6 +13,11 @@ const calcSummary = (list, lossList) => { const totalWeight = parseFloat((outTotalWeight + lossTotalWeight).toFixed(2)) const totalAvgWeight = totalCount > 0 ? (totalWeight / totalCount)?.toFixed(2) : 0 + // 计算数量、总重、均重的插值 + const countDiff = Math.abs(outCount - lossCount) + const weightDiff = Math.abs(parseFloat((outTotalWeight - lossTotalWeight).toFixed(2))) + const avgWeightDiff = Math.abs(parseFloat((outAvgWeight - lossAvgWeight).toFixed(2))) + // 成品比率 const passRate = outCount > 0 && lossTotalWeight > 0 ? (outTotalWeight / lossTotalWeight) : 0 // 损失比率 @@ -38,6 +43,9 @@ const calcSummary = (list, lossList) => { totalCount, totalWeight: totalWeight.toFixed(2), totalAvgWeight, + countDiff, + weightDiff, + avgWeightDiff, passRate: (passRate * 100)?.toFixed(2) + '%', lossRate: (lossRate * 100)?.toFixed(2) + '%', abRate: (abRate * 100)?.toFixed(2) || 0, @@ -163,6 +171,13 @@ const calcMSummary = (list, lossList) => { const totalWeight = parseFloat((outTotalWeight + lossTotalWeight).toFixed(2)) const totalAvgWeight = totalCount > 0 ? (totalWeight / totalCount)?.toFixed(2) : 0 + // 数量差值 + const countDiff = Math.abs(outCount - lossCount) + // 总重差值 + const weightDiff = Math.abs(parseFloat((outTotalWeight - lossTotalWeight).toFixed(2))) + // 均重差值 + const avgWeightDiff = Math.abs(parseFloat((outAvgWeight - lossAvgWeight).toFixed(2))) + // 成品比率 const passRate = outCount > 0 && lossTotalWeight > 0 ? (outTotalWeight / lossTotalWeight) : 0 // 损失比率 @@ -189,6 +204,9 @@ const calcMSummary = (list, lossList) => { totalCount, totalWeight: totalWeight.toFixed(2), totalAvgWeight, + countDiff, + weightDiff: weightDiff.toFixed(2), + avgWeightDiff, passRate: (passRate * 100)?.toFixed(2) + '%', lossRate: (lossRate * 100)?.toFixed(2) + '%', abRate: (abRate * 100)?.toFixed(2) || 0, diff --git a/klp-ui/src/views/wms/report/template/comprehensive.vue b/klp-ui/src/views/wms/report/template/comprehensive.vue index f6eadaeb..5ee2bdc1 100644 --- a/klp-ui/src/views/wms/report/template/comprehensive.vue +++ b/klp-ui/src/views/wms/report/template/comprehensive.vue @@ -57,9 +57,10 @@ {{ summary.lossTotalWeight }}t {{ summary.lossAvgWeight }}t - {{ summary.totalCount }} - {{ summary.totalWeight }}t - {{ summary.totalAvgWeight }}t + {{ summary.countDiff }} + {{ summary.weightDiff }} + {{ summary.avgWeightDiff }}t + {{ summary.passRate }} @@ -80,10 +81,9 @@ {{ mSummary.lossTotalWeight }}t {{ mSummary.lossAvgWeight }}t - {{ mSummary.totalCount }} - {{ mSummary.totalWeight }}t - {{ mSummary.totalAvgWeight }}t - + {{ mSummary.countDiff }} + {{ mSummary.weightDiff }} + {{ mSummary.avgWeightDiff }}t {{ mSummary.passRate }} {{ mSummary.lossRate }} diff --git a/klp-ui/src/views/wms/report/template/day.vue b/klp-ui/src/views/wms/report/template/day.vue index c0aa932b..7ebb70b5 100644 --- a/klp-ui/src/views/wms/report/template/day.vue +++ b/klp-ui/src/views/wms/report/template/day.vue @@ -53,9 +53,10 @@ {{ summary.lossTotalWeight }}t {{ summary.lossAvgWeight }}t - {{ summary.totalCount }} - {{ summary.totalWeight }}t - {{ summary.totalAvgWeight }}t + {{ summary.countDiff }} + {{ summary.weightDiff }} + {{ summary.avgWeightDiff }}t + {{ summary.passRate }} @@ -76,10 +77,9 @@ {{ mSummary.lossTotalWeight }}t {{ mSummary.lossAvgWeight }}t - {{ mSummary.totalCount }} - {{ mSummary.totalWeight }}t - {{ mSummary.totalAvgWeight }}t - + {{ mSummary.countDiff }} + {{ mSummary.weightDiff }} + {{ mSummary.avgWeightDiff }}t {{ mSummary.passRate }} {{ mSummary.lossRate }} diff --git a/klp-ui/src/views/wms/report/template/merge.vue b/klp-ui/src/views/wms/report/template/merge.vue index 6ea97bcc..45e14e6f 100644 --- a/klp-ui/src/views/wms/report/template/merge.vue +++ b/klp-ui/src/views/wms/report/template/merge.vue @@ -52,15 +52,40 @@ {{ summary.lossTotalWeight }}t {{ summary.lossAvgWeight }}t - {{ summary.totalCount }} - {{ summary.totalWeight }}t - {{ summary.totalAvgWeight }}t + {{ summary.countDiff }} + {{ summary.weightDiff }} + {{ summary.avgWeightDiff }}t + {{ summary.passRate }} {{ summary.lossRate }} {{ summary.abRate }} + + {{ summary.passRate2 }} + + + + + {{ mSummary.outCount }} + {{ mSummary.outTotalWeight }}t + {{ mSummary.outAvgWeight }}t + + {{ mSummary.lossCount }} + {{ mSummary.lossTotalWeight }}t + {{ mSummary.lossAvgWeight }}t + + {{ mSummary.countDiff }} + {{ mSummary.weightDiff }} + {{ mSummary.avgWeightDiff }}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/template/month.vue b/klp-ui/src/views/wms/report/template/month.vue index d8d2efdd..2e058452 100644 --- a/klp-ui/src/views/wms/report/template/month.vue +++ b/klp-ui/src/views/wms/report/template/month.vue @@ -44,7 +44,7 @@ - + {{ summary.outCount }} {{ summary.outTotalWeight }}t {{ summary.outAvgWeight }}t @@ -53,9 +53,10 @@ {{ summary.lossTotalWeight }}t {{ summary.lossAvgWeight }}t - {{ summary.totalCount }} - {{ summary.totalWeight }}t - {{ summary.totalAvgWeight }}t + {{ summary.countDiff }} + {{ summary.weightDiff }} + {{ summary.avgWeightDiff }}t + {{ summary.passRate }} @@ -76,10 +77,9 @@ {{ mSummary.lossTotalWeight }}t {{ mSummary.lossAvgWeight }}t - {{ mSummary.totalCount }} - {{ mSummary.totalWeight }}t - {{ mSummary.totalAvgWeight }}t - + {{ mSummary.countDiff }} + {{ mSummary.weightDiff }} + {{ mSummary.avgWeightDiff }}t {{ mSummary.passRate }} {{ mSummary.lossRate }} diff --git a/klp-ui/src/views/wms/report/template/team.vue b/klp-ui/src/views/wms/report/template/team.vue index 6f1b42ba..d9d2bf4d 100644 --- a/klp-ui/src/views/wms/report/template/team.vue +++ b/klp-ui/src/views/wms/report/template/team.vue @@ -54,36 +54,46 @@ - + {{ summary.outCount }} {{ summary.outTotalWeight }}t {{ summary.outAvgWeight }}t + {{ summary.lossCount }} {{ summary.lossTotalWeight }}t {{ summary.lossAvgWeight }}t - {{ summary.totalCount }} - {{ summary.totalWeight }}t - {{ summary.totalAvgWeight }}t + + {{ summary.countDiff }} + {{ summary.weightDiff }} + {{ summary.avgWeightDiff }}t + + + {{ summary.passRate }} {{ 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.countDiff }} + {{ mSummary.weightDiff }} + {{ mSummary.avgWeightDiff }}t + {{ mSummary.passRate }} {{ mSummary.lossRate }} + {{ mSummary.abRate }} {{ mSummary.passRate2 }} diff --git a/klp-ui/src/views/wms/report/template/year.vue b/klp-ui/src/views/wms/report/template/year.vue index 2f7b95e2..adfacf88 100644 --- a/klp-ui/src/views/wms/report/template/year.vue +++ b/klp-ui/src/views/wms/report/template/year.vue @@ -44,7 +44,7 @@ - + {{ summary.outCount }} {{ summary.outTotalWeight }}t {{ summary.outAvgWeight }}t @@ -53,9 +53,9 @@ {{ summary.lossTotalWeight }}t {{ summary.lossAvgWeight }}t - {{ summary.totalCount }} - {{ summary.totalWeight }}t - {{ summary.totalAvgWeight }}t + {{ summary.countDiff }} + {{ summary.weightDiff }} + {{ summary.avgWeightDiff }}t {{ summary.passRate }} @@ -76,10 +76,9 @@ {{ mSummary.lossTotalWeight }}t {{ mSummary.lossAvgWeight }}t - {{ mSummary.totalCount }} - {{ mSummary.totalWeight }}t - {{ mSummary.totalAvgWeight }}t - + {{ mSummary.countDiff }} + {{ mSummary.weightDiff }} + {{ mSummary.avgWeightDiff }}t {{ mSummary.passRate }} {{ mSummary.lossRate }}