配合示方生成混炼示方完善

This commit is contained in:
2026-07-30 11:28:26 +08:00
parent 2310f79f43
commit 5c27bacd11
231 changed files with 33361 additions and 184 deletions

View File

@@ -42,7 +42,10 @@ export const batchDelete = (params, handleSuccess) => {
});
};
export const saveOrUpdate = (params, isUpdate) => defHttp.post({ url: isUpdate ? Api.edit : Api.save, params });
export const saveOrUpdate = (params, isUpdate) =>
//update-begin---author:jiangxh ---date:20260729 for【配合示方】保存延长超时避免远程库慢导致误报超时-----------
defHttp.post({ url: isUpdate ? Api.edit : Api.save, params, timeout: 120 * 1000 });
//update-end---author:jiangxh ---date:20260729 for【配合示方】保存延长超时避免远程库慢导致误报超时-----------
//update-begin---author:cursor ---date:20260522 for【XSLMES-20260522-A38】配合示方生成混炼示方-----------
export const buildMixingGeneratePreview = (params) =>

View File

@@ -111,7 +111,7 @@ export function applyWeightPercentToLines(lines: Recordable[]): void {
row.weightPercent = null;
return;
}
row.weightPercent = Number(((phr / totalPhr) * 100).toFixed(1));
row.weightPercent = Number(((phr / totalPhr) * 100).toFixed(3));
});
}
@@ -429,9 +429,25 @@ export function createEmptyLineRows(count = DEFAULT_LINE_ROW_COUNT): Recordable[
return Array.from({ length: count }, () => ({ id: buildUUID() }));
}
/** 明细数值保留三位小数 */
export function roundFormulaLineDecimal3(value: unknown): number | null {
if (value == null || value === '') {
return null;
}
const n = Number(value);
return Number.isFinite(n) ? Number(n.toFixed(3)) : null;
}
/** 确保每行有唯一 idJVxeTable rowKey 依赖 id否则单元格无法渲染 */
export function normalizeLineRows(rows: Recordable[]): Recordable[] {
return (rows || []).map((r) => ({ ...r, id: r?.id || buildUUID() }));
//update-begin---author:jiangxh ---date:20260729 for【配合示方】明细重量%/体积保留三位小数-----------
return (rows || []).map((r) => ({
...r,
id: r?.id || buildUUID(),
weightPercent: roundFormulaLineDecimal3(r?.weightPercent),
volume: roundFormulaLineDecimal3(r?.volume),
}));
//update-end---author:jiangxh ---date:20260729 for【配合示方】明细重量%/体积保留三位小数-----------
}
function sectionTitle(label: string, field: string): FormSchema {
@@ -931,6 +947,7 @@ export function buildLineJVxeColumns(mixingStages?: number | null, tableDisabled
type: JVxeTypes.inputNumber,
minWidth: 90,
align: 'center',
props: { precision: 3 },
},
{
title: '体积',
@@ -939,6 +956,7 @@ export function buildLineJVxeColumns(mixingStages?: number | null, tableDisabled
minWidth: 90,
align: 'center',
placeholder: '自动计算',
props: { precision: 3 },
},
{
title: '备注',

View File

@@ -92,6 +92,7 @@
}
loading.value = true;
try {
//update-begin---author:jiangxh ---date:20260730 for【混炼示方生成】打开预览即匹配胶料失败则关闭弹窗-----------
const preview = await buildMixingGeneratePreview({ formulaSpecId: formulaSpecId.value });
rubberName.value = preview?.rubberName || '';
mixingStages.value = preview?.mixingStages || 0;
@@ -106,9 +107,13 @@
if (!tableRows.value.length) {
createMessage.warning('无可生成的混炼段,请检查混合段数');
}
} catch (_e) {
// 预览阶段胶料匹配失败等错误由全局提示,关闭弹窗避免空表继续操作
closeModal();
} finally {
loading.value = false;
}
//update-end---author:jiangxh ---date:20260730 for【混炼示方生成】打开预览即匹配胶料失败则关闭弹窗-----------
});
function formatMachineNames(machines: Recordable[] = []) {

View File

@@ -441,6 +441,7 @@
createEmptyLineRows,
getActiveStageCount,
normalizeLineRows,
roundFormulaLineDecimal3,
stageTotalNumberProps,
SUMMARY_FOOTER_FIELD_KEYS,
SUMMARY_METRICS_FIELD_KEYS,
@@ -1464,7 +1465,7 @@
const material = (raw as Recordable)?.id != null ? raw : (raw as Recordable)?.result;
const sg = Number(material?.specificGravity);
if (sg > 0) {
row.volume = Number((Number(row.phr) / sg).toFixed(6));
row.volume = Number((Number(row.phr) / sg).toFixed(3));
} else {
row.volume = null;
}
@@ -1505,6 +1506,10 @@
.filter((r) => r && (r.mixerMaterialId || r.phr != null))
.map((r, index) => ({
...stripFormulaLineDisplayFields(r),
//update-begin---author:jiangxh ---date:20260729 for【配合示方】明细重量%/体积提交保留三位小数-----------
weightPercent: roundFormulaLineDecimal3(r.weightPercent),
volume: roundFormulaLineDecimal3(r.volume),
//update-end---author:jiangxh ---date:20260729 for【配合示方】明细重量%/体积提交保留三位小数-----------
sortNo: index,
}));

View File

@@ -79,11 +79,11 @@ export const mainSchema: FormSchema[] = [
rules: [{ required: true, message: '请选择发行编号' }],
},
//update-end---author:cursor ---date:20260522 for【XSLMES-20260522-A33】混炼示方基本信息字段优化-----------
{ label: '换算系数', field: 'convertFactor', component: 'InputNumber', colProps: { span: 8 }, componentProps: { precision: 2, style: { width: '100%' } } },
{ label: '填充体积', field: 'fillVolume', component: 'InputNumber', colProps: { span: 8 }, componentProps: { precision: 6, style: { width: '100%' } } },
{ label: '换算系数', field: 'convertFactor', component: 'InputNumber', colProps: { span: 8 }, componentProps: { precision: 3, style: { width: '100%' } } },
{ label: '填充体积', field: 'fillVolume', component: 'InputNumber', colProps: { span: 8 }, componentProps: { precision: 2, style: { width: '100%' } } },
{ label: '回收炭黑(秒)', field: 'recycleCarbonSec', component: 'InputNumber', colProps: { span: 8 }, componentProps: { precision: 0, style: { width: '100%' } } },
{ label: '母胶比重', field: 'motherRubberSg', component: 'InputNumber', colProps: { span: 8 }, componentProps: { precision: 6, style: { width: '100%' } } },
{ label: '终炼胶比重', field: 'finalRubberSg', component: 'InputNumber', colProps: { span: 8 }, componentProps: { precision: 6, style: { width: '100%' } } },
{ label: '母胶比重', field: 'motherRubberSg', component: 'InputNumber', colProps: { span: 8 }, componentProps: { precision: 3, style: { width: '100%' } } },
{ label: '终炼胶比重', field: 'finalRubberSg', component: 'InputNumber', colProps: { span: 8 }, componentProps: { precision: 3, style: { width: '100%' } } },
{ label: '适用工厂', field: 'applyFactory', component: 'Input', colProps: { span: 8 } },
{ label: '段数', field: 'stageCount', component: 'Input', colProps: { span: 8 }, componentProps: { placeholder: '如 2/3' } },
{ label: '纯混炼时间(秒)', field: 'pureMixSec', component: 'InputNumber', colProps: { span: 8 }, componentProps: { precision: 0, style: { width: '100%' } } },
@@ -319,7 +319,13 @@ const MIXING_MATERIAL_WEIGHT_SCALE = 6;
//update-begin---author:cursor ---date:20260526 for【XSLMES-20260526-A60】换算系数/配方参数数值展示优化-----------
/** 换算系数展示小数位 */
export const MIXING_CONVERT_FACTOR_SCALE = 2;
export const MIXING_CONVERT_FACTOR_SCALE = 3;
/** 母胶比重展示小数位 */
export const MIXING_MOTHER_RUBBER_SG_SCALE = 3;
/** 填充体积展示小数位 */
export const MIXING_FILL_VOLUME_SCALE = 2;
/** 配方参数设定允许的小数精度 */
export const MIXING_RECIPE_PARAM_DECIMAL_SCALE = 6;
@@ -333,7 +339,7 @@ export const MIXING_RECIPE_PARAM_DECIMAL_FIELDS = [
'maxFeedTemp',
] as const;
/** 换算系数展示:固定保留位小数 */
/** 换算系数展示:固定保留位小数 */
export function formatMixingConvertFactorDisplay(value: unknown): string {
if (value === null || value === undefined || value === '') {
return '';
@@ -536,7 +542,7 @@ export function calcMixingFillVolume(totalWeight: unknown, specificGravity: unkn
return null;
}
const materialVolume = weight / sg;
return Number(((materialVolume / volume) * 100).toFixed(6));
return Number(((materialVolume / volume) * 100).toFixed(MIXING_FILL_VOLUME_SCALE));
}
//update-end---author:cursor ---date:20260525 for【XSLMES-20260525-A46】填充体积按单重/比重/机台有效体积自动计算-----------
@@ -1311,8 +1317,9 @@ export function applyMixingMaterialFromSelection(row: Recordable, material: Reco
//update-begin---author:cursor ---date:20260601 for【XSLMES-20260601-A62】选料弹窗新增胶料页签查询胶料信息-----------
/** 选料弹窗「胶料」页签表格列(数据源为胶料信息 mes_material */
export const mixingRubberPickerTableColumns: BasicColumn[] = [
{ title: '胶料编码', align: 'center', width: 140, dataIndex: 'materialCode' },
//update-begin---author:jiangxh ---date:20260729 for【选料弹窗】胶料页签去掉胶料编码-----------
{ title: '胶料名称', align: 'center', width: 180, dataIndex: 'materialName' },
//update-end---author:jiangxh ---date:20260729 for【选料弹窗】胶料页签去掉胶料编码-----------
//update-begin---author:cursor ---date:20260601 for【XSLMES-20260601-A62】胶料页签补齐自动/人工称量列-----------
{ title: '自动/人工称量', align: 'center', width: 132, dataIndex: 'pickerWeighMode' },
//update-end---author:cursor ---date:20260601 for【XSLMES-20260601-A62】胶料页签补齐自动/人工称量列-----------

View File

@@ -13,7 +13,7 @@
<a-input
v-model:value="keyword"
allow-clear
placeholder="关键字(编码/名称/描述)"
:placeholder="keywordPlaceholder"
style="width: 280px"
@pressEnter="reloadTable"
/>
@@ -105,6 +105,11 @@
import { list as rubberList, queryById as queryRubberById } from '/@/views/mes/material/MesMaterial.api';
import { loadTreeData } from '/@/api/common/api';
//update-end---author:cursor ---date:20260601 for【XSLMES-20260601-A62】胶料页签查询胶料信息(mes_material)------------->
import {
buildOrLikeSuperQuery,
MIXER_MATERIAL_LIKE_FIELDS,
RUBBER_MATERIAL_LIKE_FIELDS,
} from '/@/views/mes/material/materialQuery.util';
import { useMessage } from '/@/hooks/web/useMessage';
import JDictSelectTag from '/@/components/Form/src/jeecg/components/JDictSelectTag.vue';
import MesXslMixingMaterialCategorySetting from './MesXslMixingMaterialCategorySetting.vue';
@@ -133,6 +138,11 @@
const RUBBER_TREE_ALL = 'ALL';
const RUBBER_CATEGORY_PCODE = 'XSLMES_RUBBER';
const pickerType = ref<'mixer' | 'rubber'>('mixer');
//update-begin---author:jiangxh ---date:20260729 for【选料弹窗】胶料页签关键字提示去掉编码-----------
const keywordPlaceholder = computed(() =>
pickerType.value === 'rubber' ? '关键字(名称/别名/ERP' : '关键字(编码/名称/描述)',
);
//update-end---author:jiangxh ---date:20260729 for【选料弹窗】胶料页签关键字提示去掉编码-----------
const rubberTreeLoading = ref(false);
const rubberCategoryTree = ref<Recordable[]>([]);
/** 胶料类别 id -> { code, title },用于按种类配置编码匹配 */
@@ -256,14 +266,20 @@
const kw = keyword.value?.trim();
if (pickerType.value === 'rubber') {
const rubberParams = { ...params, ...selectedRubberCategoryFilter.value };
if (kw) {
rubberParams.materialName = `*${kw}*`;
//update-begin---author:jiangxh ---date:20260729 for【选料弹窗】胶料关键字按名称/ERP/别名模糊查询-----------
// 关键字按名称/ERP/别名模糊 OR 查询(不含编码)
const orQuery = buildOrLikeSuperQuery(RUBBER_MATERIAL_LIKE_FIELDS, kw || '');
//update-end---author:jiangxh ---date:20260729 for【选料弹窗】胶料关键字按名称/ERP/别名模糊查询-----------
if (orQuery) {
Object.assign(rubberParams, orQuery);
}
return rubberParams;
}
const next = { ...params, ...selectedCategoryFilter.value };
if (kw) {
next.materialName = `*${kw}*`;
// 关键字按编码/名称/描述/ERP/别名模糊 OR 查询
const orQuery = buildOrLikeSuperQuery(MIXER_MATERIAL_LIKE_FIELDS, kw || '');
if (orQuery) {
Object.assign(next, orQuery);
}
return next;
},

View File

@@ -67,7 +67,7 @@
<a-input-number
v-model:value="sheetForm.convertFactor"
:disabled="!showFooter"
:precision="2"
:precision="3"
:formatter="formatConvertFactorInput"
:parser="parseConvertFactorInput"
:bordered="false"
@@ -78,7 +78,7 @@
</td>
<th class="formTitle" colspan="1">填充体积</th>
<td class="formValue" colspan="1">
<a-input-number v-model:value="sheetForm.fillVolume" :disabled="!showFooter" :precision="6" :bordered="false" class="form-input" style="width: 100%" />
<a-input-number v-model:value="sheetForm.fillVolume" :disabled="!showFooter" :precision="2" :bordered="false" class="form-input" style="width: 100%" />
</td>
<th class="formTitle" colspan="1">回收炭黑()</th>
<td class="formValue">
@@ -99,7 +99,7 @@
</td>
<th class="formTitle" colspan="1">母胶比重</th>
<td class="formValue">
<a-input-number v-model:value="sheetForm.motherRubberSg" :disabled="!showFooter" :precision="6" :bordered="false" class="form-input" style="width: 100%" @update:value="recalcFillVolume" />
<a-input-number v-model:value="sheetForm.motherRubberSg" :disabled="!showFooter" :precision="3" :bordered="false" class="form-input" style="width: 100%" @update:value="recalcFillVolume" />
</td>
<th class="formTitle">段数</th>
<td class="formValue" colspan="2">
@@ -123,7 +123,7 @@
<tr>
<th class="formTitle" colspan="1">终炼胶比重</th>
<td class="formValue">
<a-input-number v-model:value="sheetForm.finalRubberSg" :disabled="!showFooter" :precision="6" :bordered="false" class="form-input" style="width: 100%" @update:value="recalcFillVolume" />
<a-input-number v-model:value="sheetForm.finalRubberSg" :disabled="!showFooter" :precision="3" :bordered="false" class="form-input" style="width: 100%" @update:value="recalcFillVolume" />
</td>
<th class="formTitle" colspan="1">适用工厂</th>
<td class="formValue" colspan="2">