配合示方生成混炼示方优化
This commit is contained in:
@@ -134,7 +134,11 @@ export const materialColumns: JVxeColumn[] = [
|
||||
minWidth: MIXING_MATERIAL_MIN_COLUMN_WIDTH,
|
||||
},
|
||||
{ title: '密炼物料描述', key: 'mixerMaterialDesc', type: JVxeTypes.input, width: 220, minWidth: MIXING_MATERIAL_MIN_COLUMN_WIDTH },
|
||||
{ title: '单重', key: 'unitWeight', type: JVxeTypes.inputNumber, width: 72, minWidth: MIXING_MATERIAL_MIN_COLUMN_WIDTH, align: 'center' },
|
||||
{ title: '单重', key: 'unitWeight', type: JVxeTypes.inputNumber, width: 72, minWidth: MIXING_MATERIAL_MIN_COLUMN_WIDTH, align: 'center',
|
||||
//update-begin---author:jiangxh ---date:20260730 for:【混炼示方】单重列保留三位小数-----------
|
||||
props: { precision: 3 },
|
||||
//update-end---author:jiangxh ---date:20260730 for:【混炼示方】单重列保留三位小数-----------
|
||||
},
|
||||
//update-begin---author:cursor ---date:20260525 for:【XSLMES-20260525-A41】累计列按种类分组合计只读展示-----------
|
||||
{
|
||||
title: '累计',
|
||||
@@ -144,6 +148,9 @@ export const materialColumns: JVxeColumn[] = [
|
||||
minWidth: MIXING_MATERIAL_MIN_COLUMN_WIDTH,
|
||||
align: 'center',
|
||||
disabled: true,
|
||||
//update-begin---author:jiangxh ---date:20260730 for:【混炼示方】累计列保留三位小数-----------
|
||||
props: { precision: 3 },
|
||||
//update-end---author:jiangxh ---date:20260730 for:【混炼示方】累计列保留三位小数-----------
|
||||
},
|
||||
//update-end---author:cursor ---date:20260525 for:【XSLMES-20260525-A41】累计列按种类分组合计只读展示-----------
|
||||
{ title: '顺序', key: 'seqNo', type: JVxeTypes.inputNumber, width: 64, minWidth: MIXING_MATERIAL_MIN_COLUMN_WIDTH, align: 'center' },
|
||||
@@ -297,8 +304,10 @@ export function fillMixingMaterialAccumWeight(rows: Recordable[] = []): Recordab
|
||||
groupEnd++;
|
||||
}
|
||||
for (let rowIndex = index; rowIndex < groupEnd; rowIndex++) {
|
||||
//update-begin---author:jiangxh ---date:20260730 for:【混炼示方】累计列保留三位小数-----------
|
||||
rows[rowIndex].accumWeight =
|
||||
rowIndex === groupEnd - 1 && sum !== 0 ? roundMixingMaterialNumber(sum) : null;
|
||||
rowIndex === groupEnd - 1 && sum !== 0 ? roundMixingMaterialAccumNumber(sum) : null;
|
||||
//update-end---author:jiangxh ---date:20260730 for:【混炼示方】累计列保留三位小数-----------
|
||||
}
|
||||
index = groupEnd;
|
||||
}
|
||||
@@ -315,7 +324,14 @@ function toMixingMaterialNumber(value: unknown): number | null {
|
||||
}
|
||||
|
||||
/** 混炼示方重量小数位(与后端 BigDecimal 精度一致) */
|
||||
const MIXING_MATERIAL_WEIGHT_SCALE = 6;
|
||||
//update-begin---author:jiangxh ---date:20260730 for:【混炼示方】单重列保留三位小数-----------
|
||||
const MIXING_MATERIAL_WEIGHT_SCALE = 3;
|
||||
//update-end---author:jiangxh ---date:20260730 for:【混炼示方】单重列保留三位小数-----------
|
||||
|
||||
//update-begin---author:jiangxh ---date:20260730 for:【混炼示方】累计列保留三位小数-----------
|
||||
/** 累计列小数位 */
|
||||
const MIXING_MATERIAL_ACCUM_WEIGHT_SCALE = 3;
|
||||
//update-end---author:jiangxh ---date:20260730 for:【混炼示方】累计列保留三位小数-----------
|
||||
|
||||
//update-begin---author:cursor ---date:20260526 for:【XSLMES-20260526-A60】换算系数/配方参数数值展示优化-----------
|
||||
/** 换算系数展示小数位 */
|
||||
@@ -401,6 +417,22 @@ function roundMixingMaterialNumber(value: number): number {
|
||||
return Number(value.toFixed(MIXING_MATERIAL_WEIGHT_SCALE));
|
||||
}
|
||||
|
||||
//update-begin---author:jiangxh ---date:20260730 for:【混炼示方】累计列保留三位小数-----------
|
||||
/** 累计重量四舍五入为三位小数 */
|
||||
function roundMixingMaterialAccumNumber(value: number): number {
|
||||
return Number(value.toFixed(MIXING_MATERIAL_ACCUM_WEIGHT_SCALE));
|
||||
}
|
||||
|
||||
/** 格式化累计重量展示文本 */
|
||||
function formatMixingMaterialAccumWeight(value: unknown): string {
|
||||
const num = toMixingMaterialNumber(value);
|
||||
if (num == null) {
|
||||
return '';
|
||||
}
|
||||
return String(roundMixingMaterialAccumNumber(num));
|
||||
}
|
||||
//update-end---author:jiangxh ---date:20260730 for:【混炼示方】累计列保留三位小数-----------
|
||||
|
||||
/** 格式化重量展示文本 */
|
||||
function formatMixingMaterialWeight(value: unknown): string {
|
||||
const num = toMixingMaterialNumber(value);
|
||||
@@ -593,7 +625,9 @@ export function buildMixingMaterialFooterCells(
|
||||
return { key, width, text: formatTotal(totals.unitWeight), align: 'center', isTotal: true };
|
||||
}
|
||||
if (key === 'accumWeight') {
|
||||
return { key, width, text: formatTotal(totals.accumWeight), align: 'center', isTotal: true };
|
||||
//update-begin---author:jiangxh ---date:20260730 for:【混炼示方】累计列保留三位小数-----------
|
||||
return { key, width, text: formatMixingMaterialAccumWeight(totals.accumWeight), align: 'center', isTotal: true };
|
||||
//update-end---author:jiangxh ---date:20260730 for:【混炼示方】累计列保留三位小数-----------
|
||||
}
|
||||
const isLabelCol = unitWeightIndex > 0 && index === unitWeightIndex - 1;
|
||||
return {
|
||||
|
||||
Reference in New Issue
Block a user