|
|
|
|
@ -0,0 +1,218 @@
|
|
|
|
|
import type { DemoColumn, DemoPageConfig, PageFilter } from '../types';
|
|
|
|
|
import { baseRows, categoryPool, date, datetime, machinePool, materialPool, mlMachinePool, n, shiftPool, teamPool } from './source';
|
|
|
|
|
|
|
|
|
|
const selectOptions = (list: string[]) => list.map(item => ({ label: item, value: item }));
|
|
|
|
|
const defaultToolbar = ['页面设置', '打印预览', '导出'].map(label => ({ label }));
|
|
|
|
|
|
|
|
|
|
const withStartEnd = <T extends Record<string, any>>(rows: T[]): Array<T & { startNo: string; endNo: string }> =>
|
|
|
|
|
rows.map(item => {
|
|
|
|
|
const [startNo, endNo] = String(item.startEndNo || '1-2').split('-');
|
|
|
|
|
return { ...item, startNo, endNo };
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
const dateFilters = (start = '2026-01-01', end = '2026-01-01', targets = ['prodDate']): PageFilter[] => [
|
|
|
|
|
{ key: 'startDate', label: '开始日期', type: 'date', defaultValue: start, targets },
|
|
|
|
|
{ key: 'endDate', label: '结束日期', type: 'date', defaultValue: end, targets }
|
|
|
|
|
];
|
|
|
|
|
|
|
|
|
|
const groupedCarsWeight = (label: string, prefix: string): DemoColumn => ({
|
|
|
|
|
label,
|
|
|
|
|
align: 'center',
|
|
|
|
|
children: [
|
|
|
|
|
{ label: '车数', prop: `${prefix}Cars`, minWidth: 90, align: 'right' },
|
|
|
|
|
{ label: '重量', prop: `${prefix}Weight`, minWidth: 100, align: 'right', format: 'fixed1' }
|
|
|
|
|
]
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
const shiftGroup = (label: string, prefix: string): DemoColumn => ({
|
|
|
|
|
label,
|
|
|
|
|
align: 'center',
|
|
|
|
|
children: [
|
|
|
|
|
{ label: '前存', prop: `${prefix}Prev`, minWidth: 80, align: 'right' },
|
|
|
|
|
{ label: '计划生产', prop: `${prefix}Plan`, minWidth: 90, align: 'right' },
|
|
|
|
|
{ label: '实际生产', prop: `${prefix}Actual`, minWidth: 90, align: 'right' },
|
|
|
|
|
{ label: '消耗数量', prop: `${prefix}Consume`, minWidth: 90, align: 'right' },
|
|
|
|
|
{ label: '实际结存', prop: `${prefix}Stock`, minWidth: 90, align: 'right' }
|
|
|
|
|
]
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
const mlMachines = [...mlMachinePool];
|
|
|
|
|
const summaryRows = ['2026-01-01', '2026-01-02'].map((d, idx) => {
|
|
|
|
|
const dayRows = baseRows.filter(row => row.prodDate === d).slice(0, 48);
|
|
|
|
|
const sourceRows = dayRows.length ? dayRows : baseRows.slice(idx * 24, idx * 24 + 48).map(item => ({ ...item, prodDate: d }));
|
|
|
|
|
const row: Record<string, any> = { date: d };
|
|
|
|
|
mlMachines.forEach((m, i) => {
|
|
|
|
|
const data = sourceRows.filter((item, j) => mlMachines[j % mlMachines.length] === m || String(item.machine).toUpperCase() === m);
|
|
|
|
|
row[`${m}Cars`] = data.reduce((s, x) => s + (Number(x.cars) || 0), 0);
|
|
|
|
|
row[`${m}Tons`] = n(data.reduce((s, x) => s + (Number(x.produceWeight) || 0), 0) / 1000, 3);
|
|
|
|
|
if (!row[`${m}Cars`]) {
|
|
|
|
|
row[`${m}Cars`] = 60 + i * 2 + idx;
|
|
|
|
|
row[`${m}Tons`] = n((60 + i * 2 + idx) * 0.42, 3);
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
row.sumCars = mlMachines.reduce((s, m) => s + Number(row[`${m}Cars`]), 0);
|
|
|
|
|
row.sumTons = n(mlMachines.reduce((s, m) => s + Number(row[`${m}Tons`]), 0), 3);
|
|
|
|
|
return row;
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
const productionAvgRow = (() => {
|
|
|
|
|
const avg: Record<string, any> = { date: '平均', _rowType: 'summary' };
|
|
|
|
|
mlMachines.forEach(m => {
|
|
|
|
|
avg[`${m}Cars`] = n((Number(summaryRows[0][`${m}Cars`]) + Number(summaryRows[1][`${m}Cars`])) / 2, 1);
|
|
|
|
|
avg[`${m}Tons`] = n((Number(summaryRows[0][`${m}Tons`]) + Number(summaryRows[1][`${m}Tons`])) / 2, 2);
|
|
|
|
|
});
|
|
|
|
|
avg.sumCars = '';
|
|
|
|
|
avg.sumTons = '';
|
|
|
|
|
return avg;
|
|
|
|
|
})();
|
|
|
|
|
|
|
|
|
|
const pageList = [
|
|
|
|
|
['workshop-production-stat', 'WorkshopProductionStat', '车间生产统计', '01车间生产统计.PNG'],
|
|
|
|
|
['workshop-compound-stat', 'WorkshopCompoundStat', '车间胶料统计', '02车间胶料统计.PNG'],
|
|
|
|
|
['small-material-consume', 'SmallMaterialConsume', '小料消耗', '03小料消耗.PNG'],
|
|
|
|
|
['small-material-detail-stat', 'SmallMaterialDetailStat', '小料明细统计', '04小料明细统计.PNG'],
|
|
|
|
|
['small-material-check', 'SmallMaterialCheck', '小料盘点', '05小料盘点.PNG'],
|
|
|
|
|
['workshop-compound-consume', 'WorkshopCompoundConsume', '车间胶料消耗', '06车间胶料消耗.PNG'],
|
|
|
|
|
['workshop-compound-detail-stat', 'WorkshopCompoundDetailStat', '车间胶料明细统计', '07.PNG'],
|
|
|
|
|
['workshop-compound-check', 'WorkshopCompoundCheck', '车间胶料盘点', '08.PNG'],
|
|
|
|
|
['workshop-stock-adjust', 'WorkshopStockAdjust', '车间胶料盘存修正', '09.PNG'],
|
|
|
|
|
['material-overdue-warning', 'MaterialOverdueWarning', '物料超期预警', '10.PNG'],
|
|
|
|
|
['compound-check-info-query', 'CompoundCheckInfoQuery', '胶料盘点信息查询', '11.PNG'],
|
|
|
|
|
['compound-realtime-stock', 'CompoundRealtimeStock', '胶料实时库存', '12.PNG'],
|
|
|
|
|
['mixer-hourly-output', 'MixerHourlyOutput', '密炼机台每小时产量查询', '13.PNG'],
|
|
|
|
|
['compound-dynamic-stock-check', 'CompoundDynamicStockCheck', '胶料动态库存(盘点)', '14.PNG'],
|
|
|
|
|
['compound-check-balance', 'CompoundCheckBalance', '胶料盘点结存', '15.PNG'],
|
|
|
|
|
['mixing-area-daily-output', 'MixingAreaDailyOutput', '炼胶工区日产量信息统计', '16.PNG'],
|
|
|
|
|
['compound-check-order-maintain', 'CompoundCheckOrderMaintain', '胶料盘点单维护', '17.PNG'],
|
|
|
|
|
['compound-production-stat', 'CompoundProductionStat', '胶料生产统计', '18.PNG'],
|
|
|
|
|
['final-compound-outbound-detail', 'FinalCompoundOutboundDetail', '终炼胶出库明细表', '19.PNG'],
|
|
|
|
|
['final-compound-flow-info', 'FinalCompoundFlowInfo', '终炼胶流转信息表', '20.PNG'],
|
|
|
|
|
['final-compound-unused-query', 'FinalCompoundUnusedQuery', '终炼胶领用未使用查询', '21.PNG'],
|
|
|
|
|
['mixing-area-quota-weight-stat', 'MixingAreaQuotaWeightStat', '炼胶工区日产量信息定额重量统计', '22.PNG']
|
|
|
|
|
] as const;
|
|
|
|
|
|
|
|
|
|
export const pageMetas = pageList.map(([key, file, title, photo]) => ({ key, file, title, photo }));
|
|
|
|
|
|
|
|
|
|
const configMap: Record<string, DemoPageConfig> = {
|
|
|
|
|
'workshop-production-stat': {
|
|
|
|
|
key: 'workshop-production-stat', title: '车间生产统计', loadingMs: 680,
|
|
|
|
|
toolbarActions: [...defaultToolbar, { label: '保存为常用参数组', type: 'primary' }],
|
|
|
|
|
filters: [...dateFilters('2026-01-01', '2026-01-04'), { key: 'materialName', label: '物料名称', type: 'select', options: selectOptions(materialPool.slice(0, 24)), targets: ['materialName', 'formulaName'] }],
|
|
|
|
|
tables: [{ key: 'main', showIndex: true, columns: [{ label: '物料名称', prop: 'materialName', minWidth: 140 }, { label: '料名', prop: 'formulaName', minWidth: 140 }, { label: '投入重量', prop: 'produceWeight', minWidth: 120, align: 'right', format: 'fixed1' }, { label: '配方标重', prop: 'setWeight', minWidth: 120, align: 'right', format: 'fixed1' }], rows: baseRows.slice(0, 38) }]
|
|
|
|
|
},
|
|
|
|
|
'workshop-compound-stat': {
|
|
|
|
|
key: 'workshop-compound-stat', title: '车间胶料统计', loadingMs: 700, toolbarActions: defaultToolbar,
|
|
|
|
|
filters: [...dateFilters(), { key: 'team', label: '班组', type: 'select', options: selectOptions(teamPool), targets: ['team'] }],
|
|
|
|
|
tables: [{ key: 'main', showIndex: true, columns: [{ label: '车间', prop: 'workshop', minWidth: 90 }, { label: '物料名称', prop: 'materialName', minWidth: 130 }, groupedCarsWeight('生产', 'produce'), groupedCarsWeight('消耗', 'consume'), groupedCarsWeight('出库', 'outbound')], rows: baseRows.slice(0, 34).map(item => ({ ...item, produceCars: item.cars + 2, produceWeight: item.produceWeight + 2800, consumeCars: item.consumeCars + 1, consumeWeight: item.consumeWeight + 2100, outboundCars: item.cars, outboundWeight: item.produceWeight - 500 })) }]
|
|
|
|
|
},
|
|
|
|
|
'small-material-consume': {
|
|
|
|
|
key: 'small-material-consume', title: '小料消耗', loadingMs: 720, toolbarActions: [...defaultToolbar, { label: 'PDF' }],
|
|
|
|
|
filters: [{ key: 'businessDate', label: '业务日期', type: 'date', defaultValue: '2026-01-01', targets: ['businessDate'] }, { key: 'businessDateEnd', label: '业务日期', type: 'date', defaultValue: '2026-01-01', targets: ['businessDate'] }, { key: 'machine', label: '机台', type: 'select', options: selectOptions(machinePool), targets: ['machine'] }, { key: 'materialName', label: '物料名称', type: 'select', options: selectOptions(materialPool.slice(0, 24)), targets: ['materialName', 'inputMaterial'] }],
|
|
|
|
|
tables: [{ key: 'main', showIndex: true, columns: [{ label: '单据号', prop: 'orderNo', minWidth: 120 }, { label: '业务日期', prop: 'businessDate', minWidth: 110 }, { label: '生产机台', prop: 'machine', minWidth: 90 }, { label: '班次', prop: 'shift', minWidth: 70, align: 'center' }, { label: '班组', prop: 'team', minWidth: 70, align: 'center' }, { label: '生产物料', prop: 'materialName', minWidth: 130 }, { label: '投入物料', prop: 'inputMaterial', minWidth: 130 }, { label: '定额重量', prop: 'setWeight', minWidth: 100, align: 'right', format: 'fixed1' }, { label: '实际重量', prop: 'consumeWeight', minWidth: 100, align: 'right', format: 'fixed1' }], rows: baseRows.slice(0, 42) }]
|
|
|
|
|
},
|
|
|
|
|
'small-material-detail-stat': {
|
|
|
|
|
key: 'small-material-detail-stat', title: '小料明细统计', statusText: '最新统计日期:2026-02-24', loadingMs: 730, toolbarActions: defaultToolbar,
|
|
|
|
|
filters: [...dateFilters('2026-01-01', '2026-01-04')],
|
|
|
|
|
tables: [{ key: 'main', showIndex: true, columns: [{ label: '生产日期', prop: 'prodDate', minWidth: 120 }, { label: '小料名称', prop: 'materialName', minWidth: 140 }, { label: '早', align: 'center', children: [{ label: '前存', prop: 'morningPrev', minWidth: 80, align: 'right' }, { label: '计划生产', prop: 'morningPlan', minWidth: 90, align: 'right' }, { label: '实际生产', prop: 'morningActual', minWidth: 90, align: 'right' }, { label: '消耗数量', prop: 'morningConsume', minWidth: 90, align: 'right' }, { label: '实际结存', prop: 'morningStock', minWidth: 90, align: 'right' }] }, { label: '中', align: 'center', children: [{ label: '前存', prop: 'noonPrev', minWidth: 80, align: 'right' }, { label: '计划生产', prop: 'noonPlan', minWidth: 90, align: 'right' }, { label: '实际生产', prop: 'noonActual', minWidth: 90, align: 'right' }, { label: '消耗数量', prop: 'noonConsume', minWidth: 90, align: 'right' }, { label: '实际结存', prop: 'noonStock', minWidth: 90, align: 'right' }] }, shiftGroup('夜', 'night')], rows: baseRows.slice(0, 36).map((item, idx) => ({ ...item, morningPrev: Math.max(0, item.stockQty - 4), morningPlan: item.planCars, morningActual: item.cars, morningConsume: item.consumeCars, morningStock: Math.max(0, item.stockQty - item.consumeCars), noonPrev: Math.max(0, item.stockQty - 6), noonPlan: Math.max(item.planCars - 1, 0), noonActual: Math.max(item.cars - 1, 0), noonConsume: Math.max(item.consumeCars - 1, 0), noonStock: Math.max(0, item.stockQty - item.consumeCars - 2), nightPrev: Math.max(0, item.stockQty - 8), nightPlan: Math.max(item.planCars - 1, 0), nightActual: Math.max(item.cars - 1, 0), nightConsume: Math.max(item.consumeCars - 1, 0), nightStock: Math.max(0, item.stockQty - item.consumeCars - 3), prodDate: date(idx) })) }]
|
|
|
|
|
},
|
|
|
|
|
'small-material-check': {
|
|
|
|
|
key: 'small-material-check', title: '小料盘点', statusText: '最新盘点日期:2012-06-04', loadingMs: 660, toolbarActions: defaultToolbar,
|
|
|
|
|
filters: [{ key: 'checkDate', label: '盘点日期', type: 'date', defaultValue: '2012-06-04', targets: ['checkDate'] }, { key: 'shift', label: '班次', type: 'select', options: selectOptions(shiftPool), targets: ['shift'] }],
|
|
|
|
|
tables: [{ key: 'main', showIndex: true, columns: [{ label: '小料名称', prop: 'materialName', minWidth: 140 }, { label: '账面数量', prop: 'stockQty', minWidth: 100, align: 'right' }, { label: '盘点数量', prop: 'checkQty', minWidth: 100, align: 'right' }, { label: '盘点日期', prop: 'checkDate', minWidth: 110 }, { label: '班次', prop: 'shift', minWidth: 70, align: 'center' }], rows: baseRows.slice(0, 38).map(item => ({ ...item, checkQty: item.stockQty, checkDate: '2012-06-04' })) }]
|
|
|
|
|
},
|
|
|
|
|
'workshop-compound-consume': {
|
|
|
|
|
key: 'workshop-compound-consume', title: '车间胶料消耗', loadingMs: 670, toolbarActions: [...defaultToolbar, { label: 'PDF' }],
|
|
|
|
|
filters: [...dateFilters(), { key: 'shift', label: '班次', type: 'select', options: selectOptions(shiftPool), targets: ['shift'] }, { key: 'team', label: '班组', type: 'select', options: selectOptions(teamPool), targets: ['team'] }, { key: 'materialName', label: '物料名称', type: 'select', options: selectOptions(materialPool.slice(0, 24)), targets: ['materialName', 'inputMaterial'] }, { key: 'machine', label: '机台', type: 'select', options: selectOptions(machinePool), targets: ['machine'] }],
|
|
|
|
|
tables: [{ key: 'main', showIndex: true, columns: [{ label: '生产日期', prop: 'prodDate', minWidth: 110 }, { label: '生产机台', prop: 'machine', minWidth: 90 }, { label: '班次', prop: 'shift', minWidth: 70, align: 'center' }, { label: '班组', prop: 'team', minWidth: 70, align: 'center' }, { label: '生产物料', prop: 'materialName', minWidth: 130 }, { label: '投入物料', prop: 'inputMaterial', minWidth: 130 }, { label: '定额重量', prop: 'setWeight', minWidth: 90, align: 'right', format: 'fixed1' }, { label: '称量重量', prop: 'actualWeight', minWidth: 90, align: 'right', format: 'fixed1' }, { label: '损耗量', prop: 'lossWeight', minWidth: 90, align: 'right', format: 'fixed1' }], rows: baseRows.slice(0, 40).map(item => ({ ...item, lossWeight: n(item.actualWeight - item.setWeight, 1) })) }]
|
|
|
|
|
},
|
|
|
|
|
'workshop-compound-detail-stat': {
|
|
|
|
|
key: 'workshop-compound-detail-stat', title: '车间胶料明细统计', statusText: '上次统计日期为:2026-02-24', loadingMs: 680, toolbarActions: [...defaultToolbar, { label: '分页导出' }],
|
|
|
|
|
filters: [...dateFilters('2026-01-01', '2026-01-07'), { key: 'category', label: '胶料类型', type: 'checkbox', options: selectOptions(categoryPool), targets: ['category'] }],
|
|
|
|
|
tables: [{ key: 'main', showIndex: true, columns: [{ label: '日期', prop: 'prodDate', minWidth: 100 }, { label: '胶料类型', prop: 'category', minWidth: 100 }, { label: '物料名称', prop: 'materialName', minWidth: 130 }, groupedCarsWeight('上期结存', 'prev'), groupedCarsWeight('生产', 'produce'), groupedCarsWeight('消耗', 'consume'), groupedCarsWeight('结存', 'balance')], rows: baseRows.slice(0, 42).map(item => ({ ...item, prevCars: item.cars + 4, prevWeight: n(item.produceWeight + 800, 1), produceCars: item.cars, consumeCars: item.consumeCars, balanceCars: Math.max(0, item.cars - item.consumeCars + 2), balanceWeight: n(item.produceWeight - item.consumeWeight + 500, 1) })) }]
|
|
|
|
|
},
|
|
|
|
|
'workshop-compound-check': {
|
|
|
|
|
key: 'workshop-compound-check', title: '车间胶料盘点', statusText: '最新盘点日期:2018-07-24', loadingMs: 670, toolbarActions: defaultToolbar,
|
|
|
|
|
filters: [{ key: 'checkDate', label: '盘点日期', type: 'date', defaultValue: '2018-06-24', targets: ['checkDate'] }, { key: 'shift', label: '班次', type: 'select', options: selectOptions(shiftPool), targets: ['shift'] }],
|
|
|
|
|
tables: [{ key: 'main', showIndex: true, columns: [{ label: '胶料名称', prop: 'materialName', minWidth: 130 }, { label: '账面结存(车)', prop: 'bookCars', minWidth: 110, align: 'right' }, { label: '盘点数量(车)', prop: 'checkCars', minWidth: 110, align: 'right' }, { label: '差异(车)', prop: 'diffCars', minWidth: 90, align: 'right' }, { label: '盘点日期', prop: 'checkDate', minWidth: 110 }], rows: baseRows.slice(0, 40).map(item => ({ ...item, bookCars: item.cars, checkCars: Math.max(0, item.cars + (item.seq % 3) - 1), diffCars: (item.seq % 3) - 1, checkDate: '2018-06-24' })) }]
|
|
|
|
|
},
|
|
|
|
|
'workshop-stock-adjust': {
|
|
|
|
|
key: 'workshop-stock-adjust', title: '车间胶料盘存修正', loadingMs: 630, toolbarActions: [{ label: '查询', type: 'primary' }, { label: '导出' }],
|
|
|
|
|
filters: [{ key: 'checkDate', label: '盘存日期', type: 'date', defaultValue: '2026-01-01', targets: ['checkDate'] }, { key: 'materialName', label: '物料名称', type: 'select', options: selectOptions(materialPool.slice(0, 24)), targets: ['materialName'] }],
|
|
|
|
|
tables: [{ key: 'main', showIndex: true, columns: [{ label: '盘存日期', prop: 'checkDate', minWidth: 120 }, { label: '物料名称', prop: 'materialName', minWidth: 140 }, { label: '盘存数量', prop: 'stockQty', minWidth: 100, align: 'right' }, { label: '盘存重量', prop: 'stockWeight', minWidth: 120, align: 'right', format: 'fixed1' }, { label: '修正后数量', prop: 'adjustQty', minWidth: 100, align: 'right' }, { label: '修正后重量', prop: 'adjustWeight', minWidth: 120, align: 'right', format: 'fixed1' }], rows: baseRows.slice(0, 32).map(item => ({ ...item, checkDate: item.prodDate, adjustQty: Math.max(0, item.stockQty + (item.seq % 2)), adjustWeight: n(item.stockWeight + (item.seq % 3) * 60, 1) })) }]
|
|
|
|
|
},
|
|
|
|
|
'material-overdue-warning': {
|
|
|
|
|
key: 'material-overdue-warning', title: '物料超期预警', loadingMs: 680, toolbarActions: defaultToolbar,
|
|
|
|
|
filters: [...dateFilters(), { key: 'hideOutbound', label: '不显示已出库', type: 'switch', defaultValue: true }],
|
|
|
|
|
tables: [{ key: 'main', showIndex: true, columns: [{ label: '生产日期', prop: 'prodDate', minWidth: 110 }, { label: '机台', prop: 'machine', minWidth: 90 }, { label: '起止车次', prop: 'startEndNo', minWidth: 100, align: 'center' }, { label: '实际重量', prop: 'actualWeight', minWidth: 100, align: 'right', format: 'fixed3' }, { label: '生产时间', prop: 'operTime', minWidth: 160 }, { label: '超期时长(h)', prop: 'overdueHours', minWidth: 110, align: 'right' }, { label: '条码', prop: 'barcode', minWidth: 170 }, { label: '出库标志', prop: 'outFlag', minWidth: 100, align: 'center' }], rows: baseRows.slice(0, 56).map(item => ({ ...item, outFlag: item.seq % 4 === 0 ? '已出库' : '未出库' })) }]
|
|
|
|
|
},
|
|
|
|
|
'compound-check-info-query': {
|
|
|
|
|
key: 'compound-check-info-query', title: '胶料盘点信息查询', loadingMs: 720, toolbarActions: defaultToolbar,
|
|
|
|
|
filters: [{ key: 'scanStart', label: '扫描时间', type: 'datetime', defaultValue: '2026-01-01 00:00:00', targets: ['scanDate'] }, { key: 'scanEnd', label: '扫描时间', type: 'datetime', defaultValue: '2026-01-31 00:00:00', targets: ['scanDate'] }, { key: 'checkNo', label: '盘点单号', type: 'input', targets: ['checkNo'] }],
|
|
|
|
|
tables: [{ key: 'main', showIndex: true, columns: [{ label: '盘点单号', prop: 'checkNo', minWidth: 150 }, { label: '胶料条码', prop: 'barcode', minWidth: 170 }, { label: '起始车次', prop: 'startNo', minWidth: 90, align: 'right' }, { label: '结束车次', prop: 'endNo', minWidth: 90, align: 'right' }, { label: '配方重量', prop: 'setWeight', minWidth: 100, align: 'right', format: 'fixed3' }, { label: '实际重量', prop: 'actualWeight', minWidth: 100, align: 'right', format: 'fixed3' }, { label: '确认时间', prop: 'confirmTime', minWidth: 160 }, { label: '扫描人', prop: 'scanUser', minWidth: 100 }], rows: withStartEnd(baseRows.slice(0, 48)).map(item => ({ ...item, checkNo: `PD${item.orderNo}`, confirmTime: datetime(item.seq + 12) })) }]
|
|
|
|
|
},
|
|
|
|
|
'compound-realtime-stock': {
|
|
|
|
|
key: 'compound-realtime-stock', title: '胶料实时库存', loadingMs: 560, toolbarActions: defaultToolbar,
|
|
|
|
|
filters: [{ key: 'materialName', label: '物料名称', type: 'select', options: selectOptions(materialPool.slice(0, 24)), targets: ['materialName'] }],
|
|
|
|
|
tables: [{ key: 'main', showIndex: true, columns: [{ label: '物料编码', prop: 'materialCode', minWidth: 140 }, { label: '物料名称', prop: 'materialName', minWidth: 130 }, { label: '生产重量', prop: 'produceWeight', minWidth: 110, align: 'right', format: 'fixed1' }, { label: '剩余重量', prop: 'leftWeight', minWidth: 110, align: 'right', format: 'fixed1' }], rows: baseRows.slice(0, 58).map(item => ({ materialCode: `${400000000000 + item.seq * 73}`, materialName: item.materialName, produceWeight: n(item.produceWeight * 12, 3), leftWeight: n(item.produceWeight * ((item.seq % 6) + 1), 3) })) }]
|
|
|
|
|
},
|
|
|
|
|
'mixer-hourly-output': {
|
|
|
|
|
key: 'mixer-hourly-output', title: '密炼机台每小时产量查询', loadingMs: 710, toolbarActions: defaultToolbar,
|
|
|
|
|
filters: [{ key: 'startDatetime', label: '生产开始时间', type: 'datetime', defaultValue: '2026-01-01 10:00:00', targets: ['timeSeg'] }, { key: 'endDatetime', label: '生产结束时间', type: 'datetime', defaultValue: '2026-01-02 10:00:00', targets: ['timeSeg'] }, { key: 'machine', label: '机台', type: 'select', options: selectOptions(machinePool), targets: ['machine'] }],
|
|
|
|
|
tables: [{ key: 'main', columns: [{ label: '机台', prop: 'machine', minWidth: 90 }, { label: '总车数', prop: 'totalCars', minWidth: 90, align: 'right' }, { label: '时间段', prop: 'timeSeg', minWidth: 120 }, { label: '时间段车数', prop: 'cars', minWidth: 100, align: 'right' }, { label: '胶料名称', prop: 'materialName', minWidth: 130 }, { label: '胶料车数', prop: 'materialCars', minWidth: 100, align: 'right' }], rows: Array.from({ length: 36 }).map((_, index) => ({ machine: machinePool[index % machinePool.length], totalCars: 440 + (index % 7) * 6, timeSeg: `${date(index)} ${String(index % 24).padStart(2, '0')}`, cars: (index % 22) + 4, materialName: materialPool[index % materialPool.length], materialCars: (index % 22) + 1 })) }]
|
|
|
|
|
},
|
|
|
|
|
'compound-dynamic-stock-check': {
|
|
|
|
|
key: 'compound-dynamic-stock-check', title: '胶料动态库存(盘点)', loadingMs: 560, toolbarActions: defaultToolbar,
|
|
|
|
|
filters: [],
|
|
|
|
|
tables: [{ key: 'main', title: '胶料动态库存(盘点)', columns: [{ label: '料名', prop: 'baseName', minWidth: 120 }, { label: '结存', prop: 'baseStock', minWidth: 90, align: 'right' }, { label: '母胶', prop: 'motherNameA', minWidth: 140 }, { label: '结存', prop: 'motherStockA', minWidth: 90, align: 'right' }, { label: '母胶', prop: 'motherNameB', minWidth: 140 }, { label: '结存', prop: 'motherStockB', minWidth: 90, align: 'right' }], rows: baseRows.slice(0, 30).map((item, index) => ({ baseName: item.materialName, baseStock: Math.max(0, 260 - index * 4), motherNameA: materialPool[(index + 8) % materialPool.length], motherStockA: Math.max(0, 65 - (index % 26)), motherNameB: materialPool[(index + 13) % materialPool.length], motherStockB: Math.max(0, 88 - (index % 31)) })) }]
|
|
|
|
|
},
|
|
|
|
|
'compound-check-balance': {
|
|
|
|
|
key: 'compound-check-balance', title: '胶料盘点结存', loadingMs: 500, toolbarActions: [{ label: '查询', type: 'primary' }, { label: '结存', type: 'success' }, { label: '导出' }],
|
|
|
|
|
filters: [{ key: 'checkDate', label: '盘点日期', type: 'date', defaultValue: '2026-01-01', targets: ['checkDate'] }],
|
|
|
|
|
tables: [{ key: 'main', columns: [{ label: '单号', prop: 'sheetNo', minWidth: 220 }, { label: '盘点单条码明细', prop: 'sheetDetail', minWidth: 280 }, { label: '确认时间', prop: 'confirmTime', minWidth: 180 }], rows: [] }]
|
|
|
|
|
},
|
|
|
|
|
'mixing-area-daily-output': {
|
|
|
|
|
key: 'mixing-area-daily-output', title: '炼胶工区日产量信息统计', loadingMs: 780, toolbarActions: defaultToolbar,
|
|
|
|
|
filters: [{ key: 'planDate', label: '计划日期', type: 'date', defaultValue: '2026-01-01', targets: ['date'] }],
|
|
|
|
|
tables: [{ key: 'summaryCars', title: '2026年1月1日炼胶工区产量信息统计表(单位:车)', columns: [{ label: '日期', prop: 'date', minWidth: 120 }, ...mlMachines.map(item => ({ label: `${item}车`, prop: `${item}Cars`, minWidth: 82, align: 'right' as const })), { label: '合计/车', prop: 'sumCars', minWidth: 100, align: 'right' }], rows: summaryRows }, { key: 'summaryWeight', title: '2026年1月1日炼胶工区产量信息统计表(单位:吨)', columns: [{ label: '日期', prop: 'date', minWidth: 120 }, ...mlMachines.map(item => ({ label: `${item}吨`, prop: `${item}Tons`, minWidth: 92, align: 'right' as const, format: 'fixed3' as const })), { label: '合计/吨', prop: 'sumTons', minWidth: 100, align: 'right', format: 'fixed3' }], rows: summaryRows }, { key: 'detail', columns: [{ label: '日期', prop: 'date', minWidth: 120 }, { label: '班组', prop: 'team', minWidth: 80, align: 'center' }, { label: '机台', prop: 'machine', minWidth: 90 }, { label: '胶料类型', prop: 'category', minWidth: 100 }, { label: '实际数量(车)', prop: 'cars', minWidth: 120, align: 'right' }, { label: '实际重量(吨)', prop: 'ton', minWidth: 120, align: 'right', format: 'fixed3' }], rows: baseRows.slice(0, 26).map(item => ({ date: summaryRows[0].date, team: item.team, machine: item.machine, category: item.category, cars: item.cars * 40, ton: n(item.actualWeight / 5, 3) })) }]
|
|
|
|
|
},
|
|
|
|
|
'compound-check-order-maintain': {
|
|
|
|
|
key: 'compound-check-order-maintain', title: '胶料盘点单维护', loadingMs: 560, toolbarActions: [{ label: '查询', type: 'primary' }, { label: '添加', type: 'success' }, { label: '删除', type: 'danger' }, { label: '导出' }],
|
|
|
|
|
filters: [{ key: 'startDate', label: '开始日期', type: 'date', defaultValue: '2026-01-01', targets: ['recordTime'] }],
|
|
|
|
|
tables: [{ key: 'main', columns: [{ label: '盘点单号', prop: 'sheetNo', minWidth: 180 }, { label: '记录人', prop: 'recorder', minWidth: 120 }, { label: '记录时间', prop: 'recordTime', minWidth: 180 }, { label: '备注', prop: 'remark', minWidth: 220 }], rows: baseRows.slice(0, 6).map(item => ({ sheetNo: `PDWH${item.orderNo}`, recorder: item.operator, recordTime: datetime(item.seq), remark: item.seq % 2 === 0 ? '已确认' : '待确认' })) }]
|
|
|
|
|
},
|
|
|
|
|
'compound-production-stat': {
|
|
|
|
|
key: 'compound-production-stat', title: '胶料生产统计', loadingMs: 680, toolbarActions: defaultToolbar,
|
|
|
|
|
filters: [{ key: 'planStartDate', label: '计划开始日期', type: 'date', defaultValue: '2026-01-01', targets: ['date'] }, { key: 'planEndDate', label: '计划结束日期', type: 'date', defaultValue: '2026-01-02', targets: ['date'] }],
|
|
|
|
|
tables: [{ key: 'main', showIndex: true, columns: [{ label: '日期', prop: 'date', minWidth: 100 }, ...mlMachines.map(item => ({ label: `${item}车`, prop: `${item}Cars`, minWidth: 82, align: 'right' as const })), ...mlMachines.map(item => ({ label: `${item}吨`, prop: `${item}Tons`, minWidth: 92, align: 'right' as const, format: 'fixed3' as const })), { label: '合计/车', prop: 'sumCars', minWidth: 100, align: 'right' }, { label: '合计/吨', prop: 'sumTons', minWidth: 100, align: 'right', format: 'fixed3' }], rows: [...summaryRows, productionAvgRow] }]
|
|
|
|
|
},
|
|
|
|
|
'final-compound-outbound-detail': {
|
|
|
|
|
key: 'final-compound-outbound-detail', title: '终炼胶出库明细表', loadingMs: 730, toolbarActions: defaultToolbar,
|
|
|
|
|
filters: [{ key: 'operStart', label: '操作时间', type: 'datetime', defaultValue: '2026-01-01 10:00:00', targets: ['operTime'] }, { key: 'operEnd', label: '操作时间', type: 'datetime', defaultValue: '2026-01-10 10:00:00', targets: ['operTime'] }, { key: 'machine', label: '机台名称', type: 'select', options: selectOptions(machinePool), targets: ['machine'] }, { key: 'materialName', label: '物料名称', type: 'select', options: selectOptions(materialPool.slice(0, 24)), targets: ['materialName'] }, { key: 'barcode', label: '条码号', type: 'input', targets: ['barcode'] }],
|
|
|
|
|
tables: [{ key: 'main', showIndex: true, columns: [{ label: '操作时间', prop: 'operTime', minWidth: 160 }, { label: '条码号', prop: 'barcode', minWidth: 170 }, { label: '生产日期', prop: 'planDate', minWidth: 110 }, { label: '生产机台', prop: 'machine', minWidth: 90 }, { label: '班组', prop: 'team', minWidth: 70, align: 'center' }, { label: '物料名称', prop: 'materialName', minWidth: 110 }, { label: '起始车次', prop: 'startNo', minWidth: 90, align: 'right' }, { label: '终止车次', prop: 'endNo', minWidth: 90, align: 'right' }, { label: '实际车数', prop: 'cars', minWidth: 90, align: 'right' }, { label: '实际重量', prop: 'actualWeight', minWidth: 100, align: 'right', format: 'fixed3' }, { label: '出库人员', prop: 'dispatchUser', minWidth: 120 }, { label: '质检标志', prop: 'checkFlag', minWidth: 90, align: 'center' }], rows: withStartEnd(baseRows.slice(0, 52)) }]
|
|
|
|
|
},
|
|
|
|
|
'final-compound-flow-info': {
|
|
|
|
|
key: 'final-compound-flow-info', title: '终炼胶流转信息表', loadingMs: 820, toolbarActions: defaultToolbar,
|
|
|
|
|
filters: [{ key: 'flowCardNo', label: '流转卡号', type: 'input', defaultValue: '260101J83N03300091', targets: ['flowCardNo', 'barcode'] }],
|
|
|
|
|
tables: [{ key: 'production', title: '胶料生产信息', columns: [{ label: '条码号', prop: 'barcode', minWidth: 160 }, { label: '计划日期', prop: 'planDate', minWidth: 110 }, { label: '生产机台', prop: 'machine', minWidth: 90 }, { label: '班次', prop: 'shift', minWidth: 70, align: 'center' }, { label: '班组', prop: 'team', minWidth: 70, align: 'center' }, { label: '物料名称', prop: 'materialName', minWidth: 120 }, { label: '起止车次', prop: 'startEndNo', minWidth: 90, align: 'center' }, { label: '实际重量', prop: 'actualWeight', minWidth: 100, align: 'right', format: 'fixed3' }, { label: '生产时间', prop: 'operTime', minWidth: 160 }, { label: '出库标志', prop: 'outFlag', minWidth: 90, align: 'center' }, { label: '质检标志', prop: 'checkFlag', minWidth: 90, align: 'center' }], rows: baseRows.slice(0, 1).map(item => ({ ...item, outFlag: '已出库' })) }, { key: 'lockInfo', title: '卡片锁定解锁信息', columns: [{ label: '流转卡号', prop: 'flowCardNo', minWidth: 160 }, { label: '操作内容', prop: 'action', minWidth: 120 }, { label: '操作时间', prop: 'actionTime', minWidth: 160 }, { label: '操作原因', prop: 'reason', minWidth: 220 }], rows: [{ flowCardNo: '', action: '', actionTime: '', reason: '' }] }, { key: 'outInfo', title: '终炼胶出库信息', columns: [{ label: '流转卡号', prop: 'flowCardNo', minWidth: 170 }, { label: '操作时间', prop: 'operTime', minWidth: 160 }, { label: '出库日期', prop: 'outDate', minWidth: 110 }, { label: '生产机台', prop: 'machine', minWidth: 90 }, { label: '物料名称', prop: 'materialName', minWidth: 120 }, { label: '实际重量', prop: 'actualWeight', minWidth: 100, align: 'right', format: 'fixed3' }, { label: '实际车数', prop: 'cars', minWidth: 90, align: 'right' }, { label: '出库标志', prop: 'outFlag', minWidth: 90, align: 'center' }], rows: baseRows.slice(0, 1).map(item => ({ ...item, flowCardNo: item.scanCode, outDate: date(3), outFlag: '已出库' })) }, { key: 'handInfo', title: '手持及后工序扫描信息', columns: [{ label: '流转卡号', prop: 'flowCardNo', minWidth: 170 }, { label: '扫描结果', prop: 'scanResult', minWidth: 140 }, { label: '扫描时间', prop: 'scanTime', minWidth: 160 }, { label: '扫描机台', prop: 'scanMachine', minWidth: 100 }, { label: '扫描人', prop: 'scanUser', minWidth: 90 }, { label: '上传时间', prop: 'uploadTime', minWidth: 160 }], rows: baseRows.slice(0, 1).map(item => ({ flowCardNo: item.scanCode, scanResult: '领料成功', scanTime: datetime(6), scanMachine: item.machine, scanUser: item.dispatchUser, uploadTime: datetime(7) })) }]
|
|
|
|
|
},
|
|
|
|
|
'final-compound-unused-query': {
|
|
|
|
|
key: 'final-compound-unused-query', title: '终炼胶领用未使用查询', loadingMs: 720, toolbarActions: defaultToolbar,
|
|
|
|
|
filters: [{ key: 'useStart', label: '领用日期', type: 'datetime', defaultValue: '2026-01-01 10:00:00', targets: ['operTime'] }, { key: 'useEnd', label: '领用日期', type: 'datetime', defaultValue: '2026-01-05 10:00:00', targets: ['operTime'] }],
|
|
|
|
|
tables: [{ key: 'main', showIndex: true, columns: [{ label: '领用时间', prop: 'operTime', minWidth: 160 }, { label: '领用标志', prop: 'outScanFlag', minWidth: 100, align: 'center' }, { label: '领用人', prop: 'shelfText', minWidth: 110 }, { label: '部件使用标志', prop: 'semiUsedFlag', minWidth: 120, align: 'center' }, { label: '条码号', prop: 'barcode', minWidth: 170 }, { label: '计划日期', prop: 'planDate', minWidth: 110 }, { label: '生产机台', prop: 'machine', minWidth: 90 }, { label: '物料名称', prop: 'materialName', minWidth: 120 }, { label: '起止车次', prop: 'startEndNo', minWidth: 100, align: 'center' }, { label: '生产时间', prop: 'prodDateTime', minWidth: 160 }], rows: baseRows.slice(0, 36).map(item => ({ ...item, outScanFlag: '1已领用', semiUsedFlag: '未使用', prodDateTime: datetime(item.seq + 20) })) }]
|
|
|
|
|
},
|
|
|
|
|
'mixing-area-quota-weight-stat': {
|
|
|
|
|
key: 'mixing-area-quota-weight-stat', title: '炼胶工区日产量信息定额重量统计', loadingMs: 780, toolbarActions: defaultToolbar,
|
|
|
|
|
filters: [{ key: 'planDate', label: '计划日期', type: 'date', defaultValue: '2026-01-01', targets: ['date'] }],
|
|
|
|
|
tables: [{ key: 'summaryCars', title: '2026年1月1日炼胶工区产量信息定额重量统计表(单位:车)', columns: [{ label: '日期', prop: 'date', minWidth: 120 }, ...mlMachines.map(item => ({ label: `${item}车`, prop: `${item}Cars`, minWidth: 82, align: 'right' as const })), { label: '合计/车', prop: 'sumCars', minWidth: 100, align: 'right' }], rows: summaryRows }, { key: 'summaryWeight', title: '2026年1月1日炼胶工区产量信息定额重量统计表(单位:吨)', columns: [{ label: '日期', prop: 'date', minWidth: 120 }, ...mlMachines.map(item => ({ label: `${item}吨`, prop: `${item}Tons`, minWidth: 92, align: 'right' as const, format: 'fixed3' as const })), { label: '合计/吨', prop: 'sumTons', minWidth: 100, align: 'right', format: 'fixed3' }], rows: summaryRows }, { key: 'detail', columns: [{ label: '日期', prop: 'date', minWidth: 120 }, { label: '班组', prop: 'team', minWidth: 80, align: 'center' }, { label: '机台', prop: 'machine', minWidth: 90 }, { label: '胶料类型', prop: 'category', minWidth: 100 }, { label: '实际数量(车)', prop: 'cars', minWidth: 120, align: 'right' }, { label: '实际重量(吨)', prop: 'ton', minWidth: 120, align: 'right', format: 'fixed3' }], rows: baseRows.slice(0, 26).map(item => ({ date: summaryRows[0].date, team: item.team, machine: item.machine, category: item.category, cars: item.cars * 40, ton: n(item.actualWeight / 5, 3) })) }]
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
export const pageConfigMap: Record<string, DemoPageConfig> = configMap;
|
|
|
|
|
export const getPageConfig = (key: string): DemoPageConfig =>
|
|
|
|
|
pageConfigMap[key] || {
|
|
|
|
|
key,
|
|
|
|
|
title: '未配置页面',
|
|
|
|
|
toolbarActions: defaultToolbar,
|
|
|
|
|
filters: [],
|
|
|
|
|
tables: [{ key: 'main', columns: [{ label: '提示', prop: 'message', minWidth: 320 }], rows: [{ message: `未找到页面配置:${key}` }] }]
|
|
|
|
|
};
|