diff --git a/klp-ui/src/views/wms/report/components/crossTable/index.vue b/klp-ui/src/views/wms/report/components/crossTable/index.vue
new file mode 100644
index 00000000..605ebfcf
--- /dev/null
+++ b/klp-ui/src/views/wms/report/components/crossTable/index.vue
@@ -0,0 +1,195 @@
+
+
+
+
+
+
+
+
+
+
+ {{ scope.row[`${summary.prop}_${colVal}`] || '--' }}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/klp-ui/src/views/wms/report/components/hierarchicalPivot/index.vue b/klp-ui/src/views/wms/report/components/hierarchicalPivot/index.vue
new file mode 100644
index 00000000..0199fbe7
--- /dev/null
+++ b/klp-ui/src/views/wms/report/components/hierarchicalPivot/index.vue
@@ -0,0 +1,108 @@
+
+
+
+
+
+
+ {{ scope.row[column] }}
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/klp-ui/src/views/wms/report/components/timeRangePicker.vue b/klp-ui/src/views/wms/report/components/timeRangePicker.vue
index 0a0ac655..64bc4097 100644
--- a/klp-ui/src/views/wms/report/components/timeRangePicker.vue
+++ b/klp-ui/src/views/wms/report/components/timeRangePicker.vue
@@ -21,6 +21,7 @@
前一天
+ 今天
后一天
近7天
近15天
@@ -127,12 +128,15 @@ export default {
switch (type) {
case 'prevDay':
- // 在当前时间基础上向前推一天
newStartDate.setDate(newStartDate.getDate() - 1)
newEndDate.setDate(newEndDate.getDate() - 1)
break
+ case 'today':
+ const todayNow = new Date()
+ newStartDate = todayNow
+ newEndDate = todayNow
+ break
case 'nextDay':
- // 在当前时间基础上向后推一天
newStartDate.setDate(newStartDate.getDate() + 1)
newEndDate.setDate(newEndDate.getDate() + 1)
break
@@ -205,7 +209,11 @@ export default {
}
.quick-options {
display: flex;
- gap: 8px;
+ gap: 2px;
flex-wrap: wrap;
}
+
+.el-button + .el-button {
+ margin-left: 4px
+}
diff --git a/klp-ui/src/views/wms/report/receive.vue b/klp-ui/src/views/wms/report/receive.vue
index 7084c596..6ed9c016 100644
--- a/klp-ui/src/views/wms/report/receive.vue
+++ b/klp-ui/src/views/wms/report/receive.vue
@@ -62,6 +62,12 @@
{{ summary.avgWeight }}t
+
+
+
+
+
+
@@ -90,6 +96,8 @@ import { listDeliveryPlan } from '@/api/wms/deliveryPlan'
import ColumnsSetting from "@/views/wms/report/components/setting/columns.vue";
import CoilTable from "@/views/wms/report/components/coilTable/index.vue";
import TimeRangePicker from "@/views/wms/report/components/timeRangePicker.vue";
+import HierarchicalPivot from "@/views/wms/report/components/hierarchicalPivot/index.vue";
+import CrossTable from "@/views/wms/report/components/crossTable/index.vue";
import { saveReportFile } from "@/views/wms/report/js/reportFile";
@@ -104,12 +112,13 @@ export default {
ColumnsSetting,
CoilTable,
TimeRangePicker,
+ HierarchicalPivot,
+ CrossTable,
},
dicts: ['product_coil_status', 'coil_material', 'coil_itemname', 'coil_manufacturer'],
data() {
// 工具函数:个位数补零,保证格式统一(比如 9 → 09,5 → 05)
const addZero = (num) => num.toString().padStart(2, '0')
-
const now = new Date() // 当前本地北京时间
// 核心:获取【昨天】的日期对象(自动处理跨月/跨年,无边界问题)
const yesterday = new Date(now)
@@ -151,6 +160,44 @@ export default {
loading: false,
receiveColumns: [],
+
+ // 厂家材质透视表配置
+ hierarchicalPivotConfig: {
+ groupFields: ['manufacturer', 'material'],
+ groupLabels: ['厂家', '材质'],
+ summaryFields: [
+ { prop: 'count', label: '求和项:件数', field: '', align: 'center' },
+ { prop: 'weight', label: '求和项:重量', field: 'netWeight', align: 'center' }
+ ],
+ formatValue: (value, summaryField) => {
+ if (summaryField.field === '') {
+ return value
+ }
+ return value.toFixed(3)
+ }
+ },
+
+ // 宽度厚度统计表配置
+ crossTableConfig: {
+ rowField: 'computedWidth',
+ rowLabel: '宽度',
+ rowWidth: 100,
+ columnField: 'computedThickness',
+ summaryColumns: [
+ { prop: 'count', label: '件数', width: 80, field: '' },
+ { prop: 'weight', label: '重量', width: 100, field: 'netWeight' }
+ ],
+ formatValue: (value, summaryField) => {
+ if (summaryField.field === '') {
+ return value
+ }
+ return value.toFixed(2)
+ },
+ formatKey: (num) => {
+ if (num === null || num === undefined || isNaN(num)) return null
+ return parseFloat(num).toFixed(2)
+ }
+ }
}
},
computed: {
@@ -167,7 +214,8 @@ export default {
},
coilIds() {
return this.list.map(item => item.coilId).join(',')
- }
+ },
+
},
methods: {
// 加载列设置
@@ -196,7 +244,6 @@ export default {
}).then(res => {
const actions = res.rows
const coilIds = actions.map(item => item.coilId).join(',')
- console.log(coilIds)
if (!coilIds) {
this.$message({
message: '暂无数据',
diff --git a/klp-ui/src/views/wms/report/template/mands.vue b/klp-ui/src/views/wms/report/template/mands.vue
index cd5a597a..ce4a55f9 100644
--- a/klp-ui/src/views/wms/report/template/mands.vue
+++ b/klp-ui/src/views/wms/report/template/mands.vue
@@ -452,7 +452,6 @@ export default {
this.lossList = lossList.filter(item => !this.mergeCoils.includes(item.coilId))
// 找出所有被剔除的卷的id,
const removedCoilIds = lossList.filter(item => this.mergeCoils.includes(item.coilId)).map(item => item.coilId)
- console.log(removedCoilIds)
this.list = outputList.filter(item => !removedCoilIds.includes(item.parentCoilId))
// if (this.viewType == 'day') {
// this.getYesterdayData()