@gct-paas/word 0.1.74-beta.49 → 0.1.74-beta.50
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.es.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! @gct-paas/word v0.1.74-beta.
|
|
1
|
+
/*! @gct-paas/word v0.1.74-beta.50 */
|
|
2
2
|
import { Fragment, Suspense, Teleport, Transition, TransitionGroup, cloneVNode, computed, createApp, createBlock, createCommentVNode, createElementBlock, createElementVNode, createSlots, createStaticVNode, createTextVNode, createVNode, defineAsyncComponent, defineComponent, effectScope, getCurrentInstance, getCurrentScope, guardReactiveProps, h, inject, isRef, isVNode, markRaw, mergeModels, mergeProps, nextTick, normalizeClass, normalizeProps, normalizeStyle, onBeforeMount, onBeforeUnmount, onMounted, onScopeDispose, onUnmounted, openBlock, provide, reactive, readonly, ref, render, renderList, renderSlot, resolveComponent, resolveDynamicComponent, shallowRef, toDisplayString, toHandlers, toRaw, toRef, toValue, unref, useAttrs, useCssVars, useModel, useSlots, vModelRadio, vModelText, vShow, watch, watchEffect, withCtx, withDirectives, withKeys, withModifiers } from "vue";
|
|
3
3
|
import Rt, { PopperWrapper } from "floating-vue";
|
|
4
4
|
import VueKonva from "vue-konva";
|
|
@@ -125682,6 +125682,7 @@ var init_bom_validator$1 = __esmMin((() => {
|
|
|
125682
125682
|
hasEditingGroup(arr) {
|
|
125683
125683
|
const editRows = arr.filter((i) => !i.is_confirmed_ && !i.deleted_);
|
|
125684
125684
|
if (!editRows.length) return false;
|
|
125685
|
+
if (!this.enableSequenceLoading) return true;
|
|
125685
125686
|
const groupIds = /* @__PURE__ */ new Set();
|
|
125686
125687
|
for (const row of editRows) {
|
|
125687
125688
|
const id = this.getRowGroupId(row);
|
|
@@ -125897,9 +125898,10 @@ var init_bom_validator$1 = __esmMin((() => {
|
|
|
125897
125898
|
* 单组整组校验(提交编辑态组 / 切组前复用)
|
|
125898
125899
|
*/
|
|
125899
125900
|
async validateGroup(arr, util) {
|
|
125900
|
-
const rows = arr.filter((r) =>
|
|
125901
|
+
const rows = arr.filter((r) => isRowInBomGroup(r, util));
|
|
125901
125902
|
if (!rows.length) throw new Error("物料不能为空");
|
|
125902
125903
|
rows.forEach((row) => {
|
|
125904
|
+
if (!row.product_id_) throw new Error("物料不能为空");
|
|
125903
125905
|
this.validateDataCompleted(row);
|
|
125904
125906
|
if (row.expiration_date_ && dayjs(row.expiration_date_).endOf("day").isBefore(dayjs())) throw new Error(`${row.product_id__lb_} 的批次 ${row.material_no_} 已过期`);
|
|
125905
125907
|
});
|
|
@@ -126487,6 +126489,20 @@ var init_product_id_query = __esmMin((() => {
|
|
|
126487
126489
|
}));
|
|
126488
126490
|
//#endregion
|
|
126489
126491
|
//#region src/runtime/canvas/table/render/material-consume/material-consume-group-merge.ts
|
|
126492
|
+
/** Word 序号组件使用 pageWidgetMeta;业务字段使用 widgetMeta。 */
|
|
126493
|
+
function getGroupMergeColumn(cell) {
|
|
126494
|
+
const stack = [...cell.children];
|
|
126495
|
+
while (stack.length) {
|
|
126496
|
+
var _node$pageWidgetMeta, _meta$field, _meta$props, _node$children;
|
|
126497
|
+
const node = stack.shift();
|
|
126498
|
+
if ((node === null || node === void 0 || (_node$pageWidgetMeta = node.pageWidgetMeta) === null || _node$pageWidgetMeta === void 0 ? void 0 : _node$pageWidgetMeta.type) === "pw:serialnumber") return "__serialnumber__";
|
|
126499
|
+
const meta = node === null || node === void 0 ? void 0 : node.widgetMeta;
|
|
126500
|
+
const fieldLink = (meta === null || meta === void 0 || (_meta$field = meta.field) === null || _meta$field === void 0 ? void 0 : _meta$field.fieldLink) ?? (meta === null || meta === void 0 || (_meta$props = meta.props) === null || _meta$props === void 0 ? void 0 : _meta$props.field);
|
|
126501
|
+
const field = Array.isArray(fieldLink) ? fieldLink[fieldLink.length - 1] : String(fieldLink ?? "").split(".").pop();
|
|
126502
|
+
if (field && GROUP_MERGE_FIELDS.has(field)) return field;
|
|
126503
|
+
if (node === null || node === void 0 || (_node$children = node.children) === null || _node$children === void 0 ? void 0 : _node$children.length) stack.push(...node.children);
|
|
126504
|
+
}
|
|
126505
|
+
}
|
|
126490
126506
|
/** 连续相同 key 的行属于同一合并组 */
|
|
126491
126507
|
function getGroupMergeKey(row, validator) {
|
|
126492
126508
|
const entryIdx = validator.resolveEntryIndex(row);
|
|
@@ -126494,6 +126510,37 @@ function getGroupMergeKey(row, validator) {
|
|
|
126494
126510
|
if (row.bom_entry_id_) return `bom:${row.bom_entry_id_}`;
|
|
126495
126511
|
return `row:${getRowId(row)}`;
|
|
126496
126512
|
}
|
|
126513
|
+
/** 与 Excel 序号组件保持相同的起始值、步长和未绑 BOM 处理。 */
|
|
126514
|
+
function formatGroupSerialNumber(groupOrderIndex, props) {
|
|
126515
|
+
const initial = Number(props.initialValue);
|
|
126516
|
+
const step = Number(props.autoAddValue);
|
|
126517
|
+
if (Number.isNaN(initial) || Number.isNaN(step) || groupOrderIndex < 0) return "";
|
|
126518
|
+
return String(initial + step * groupOrderIndex);
|
|
126519
|
+
}
|
|
126520
|
+
/** 只替换画布序号文本,保留布局节点原型与其他单元格内容。 */
|
|
126521
|
+
function withGroupSerialNumber(cell, groupOrderIndex) {
|
|
126522
|
+
let hasWrittenLabel = false;
|
|
126523
|
+
const replace = (node) => {
|
|
126524
|
+
var _node$pageWidgetMeta2, _node$getChildren;
|
|
126525
|
+
if ((node === null || node === void 0 || (_node$pageWidgetMeta2 = node.pageWidgetMeta) === null || _node$pageWidgetMeta2 === void 0 ? void 0 : _node$pageWidgetMeta2.type) === "pw:serialnumber") {
|
|
126526
|
+
const copy = Object.assign(Object.create(Object.getPrototypeOf(node)), node);
|
|
126527
|
+
copy.text = hasWrittenLabel ? "" : formatGroupSerialNumber(groupOrderIndex, node.pageWidgetMeta.props ?? {});
|
|
126528
|
+
hasWrittenLabel = true;
|
|
126529
|
+
return copy;
|
|
126530
|
+
}
|
|
126531
|
+
const children = node === null || node === void 0 || (_node$getChildren = node.getChildren) === null || _node$getChildren === void 0 ? void 0 : _node$getChildren.call(node);
|
|
126532
|
+
if (!(children === null || children === void 0 ? void 0 : children.length)) return node;
|
|
126533
|
+
const nextChildren = children.map(replace);
|
|
126534
|
+
if (nextChildren.every((child, index) => child === children[index])) return node;
|
|
126535
|
+
const copy = Object.assign(Object.create(Object.getPrototypeOf(node)), node);
|
|
126536
|
+
copy.children = nextChildren;
|
|
126537
|
+
return copy;
|
|
126538
|
+
};
|
|
126539
|
+
return {
|
|
126540
|
+
...cell,
|
|
126541
|
+
children: cell.children.map(replace)
|
|
126542
|
+
};
|
|
126543
|
+
}
|
|
126497
126544
|
/** 计算某一 BOM 组的总上料数量 */
|
|
126498
126545
|
function calcGroupQtyConsumedTotal(entryIdx, tableData, validator) {
|
|
126499
126546
|
if (entryIdx < 0) return 0;
|
|
@@ -126701,8 +126748,11 @@ var init_material_consume_table_controller = __esmMin((() => {
|
|
|
126701
126748
|
"qty_transfer_",
|
|
126702
126749
|
"qty_consumed_total_",
|
|
126703
126750
|
"qty_transfer_uom_id_",
|
|
126704
|
-
"transfer_formula_"
|
|
126751
|
+
"transfer_formula_",
|
|
126752
|
+
"expiration_date_",
|
|
126753
|
+
"sort_num_"
|
|
126705
126754
|
];
|
|
126755
|
+
if (option.disabled && option.row) fields.push(...Object.keys(option.row).filter((key) => key.startsWith("f_")));
|
|
126706
126756
|
if (option.disabled) fields.push("qty_required_", "qty_consumed_");
|
|
126707
126757
|
this._updateDisablement({
|
|
126708
126758
|
...option,
|
|
@@ -126723,7 +126773,8 @@ var init_material_consume_table_controller = __esmMin((() => {
|
|
|
126723
126773
|
MCDataUtil.updateConfirmableFieldsDisablement({
|
|
126724
126774
|
dataManager,
|
|
126725
126775
|
rowPath: `$.${subFieldKey}[${rowIndex}]`,
|
|
126726
|
-
disabled: isConfirmed
|
|
126776
|
+
disabled: isConfirmed,
|
|
126777
|
+
row
|
|
126727
126778
|
});
|
|
126728
126779
|
}
|
|
126729
126780
|
};
|
|
@@ -126864,7 +126915,7 @@ var init_material_consume_table_controller = __esmMin((() => {
|
|
|
126864
126915
|
this.tmplBomController = tmplBomController;
|
|
126865
126916
|
this.tmplBom = tmplBom;
|
|
126866
126917
|
this.initScanRule(this.tmplBom.barcode_parsing_rules_id_);
|
|
126867
|
-
this.scanParamType = this.tmplBom.
|
|
126918
|
+
this.scanParamType = this.tmplBom.scan_param_type_;
|
|
126868
126919
|
markRaw(this);
|
|
126869
126920
|
this.bomEntriesValidator = new BomEntriesValidator(this.actualBomEntries, this.enableSequenceLoading, () => this.materialNoNum, this.tmplBomController.historyData, this.tmplBomController.materialNo, this.mcPattern === MaterialConsumptionPatternEnum.RECORD && !this.tmplBom.personal_bom_enabled_);
|
|
126870
126921
|
}
|
|
@@ -126928,7 +126979,8 @@ var init_material_consume_table_controller = __esmMin((() => {
|
|
|
126928
126979
|
if (row.is_confirmed_) MCDataUtil.updateConfirmableFieldsDisablement({
|
|
126929
126980
|
dataManager,
|
|
126930
126981
|
rowPath,
|
|
126931
|
-
disabled: true
|
|
126982
|
+
disabled: true,
|
|
126983
|
+
row
|
|
126932
126984
|
});
|
|
126933
126985
|
else this.syncEditingRowDisablement(dataManager, rowPath, row);
|
|
126934
126986
|
});
|
|
@@ -126954,10 +127006,14 @@ var init_material_consume_table_controller = __esmMin((() => {
|
|
|
126954
127006
|
}
|
|
126955
127007
|
/** 可编辑行:对齐 Excel getNewTdInfo + calcDisabledFields */
|
|
126956
127008
|
syncEditingRowDisablement(dataManager, rowPath, row) {
|
|
127009
|
+
const disabledFields = this.calcDisabledFields(row);
|
|
126957
127010
|
MCDataUtil.applyEditingRowDisablement({
|
|
126958
127011
|
dataManager,
|
|
126959
127012
|
rowPath,
|
|
126960
|
-
disabledFields
|
|
127013
|
+
disabledFields
|
|
127014
|
+
});
|
|
127015
|
+
Object.keys(row).filter((key) => key.startsWith("f_")).forEach((field) => {
|
|
127016
|
+
if (!disabledFields.includes(field)) dataManager.setFieldRuntimeSpecificConfig(`${rowPath}.${field}`, { newDisabled: false });
|
|
126961
127017
|
});
|
|
126962
127018
|
}
|
|
126963
127019
|
/**
|
|
@@ -127015,7 +127071,7 @@ var init_material_consume_table_controller = __esmMin((() => {
|
|
|
127015
127071
|
}
|
|
127016
127072
|
/**
|
|
127017
127073
|
* 是否有正在编辑的组。
|
|
127018
|
-
*
|
|
127074
|
+
* 顺序上料时同时只能有一组处于编辑态;非顺序上料允许多组编辑。
|
|
127019
127075
|
*/
|
|
127020
127076
|
hasEditingGroup(showMessage = true) {
|
|
127021
127077
|
try {
|
|
@@ -127033,7 +127089,7 @@ var init_material_consume_table_controller = __esmMin((() => {
|
|
|
127033
127089
|
* @param str
|
|
127034
127090
|
*/
|
|
127035
127091
|
async parseScanStr(data, transformedData, doc) {
|
|
127036
|
-
|
|
127092
|
+
if (this.enableSequenceLoading) this.bomEntriesValidator.hasEditingGroup(this.actualTableData);
|
|
127037
127093
|
const isRecordPattern = this.mcPattern === MaterialConsumptionPatternEnum.RECORD && !this.tmplBom.personal_bom_enabled_;
|
|
127038
127094
|
console.log("parseScanStr", data);
|
|
127039
127095
|
const arr = await materialCheck({
|
|
@@ -127354,24 +127410,24 @@ var init_material_consume_table_controller = __esmMin((() => {
|
|
|
127354
127410
|
const targetRows = this.actualTableData.filter((r) => isRowInBomGroup(r, targetUtil));
|
|
127355
127411
|
if (targetRows.length && targetRows.every((r) => !r.is_confirmed_)) return;
|
|
127356
127412
|
const current = this.bomEntriesValidator.findSequenceBomEntry(this.actualTableData);
|
|
127357
|
-
if (current && current !== targetUtil) {
|
|
127358
|
-
|
|
127359
|
-
|
|
127360
|
-
|
|
127361
|
-
|
|
127362
|
-
return;
|
|
127363
|
-
}
|
|
127364
|
-
setGroupEditState(this.actualTableData, current, false);
|
|
127413
|
+
if (current && current !== targetUtil) try {
|
|
127414
|
+
await this.bomEntriesValidator.validateCurrentGroupForSwitch(this.actualTableData, current);
|
|
127415
|
+
} catch (e) {
|
|
127416
|
+
if (e === null || e === void 0 ? void 0 : e.message) this.error(e.message);
|
|
127417
|
+
return;
|
|
127365
127418
|
}
|
|
127366
|
-
setGroupEditState(this.actualTableData, targetUtil, true);
|
|
127367
127419
|
const rawRows = dataManager.getRawData()[subFieldKey] ?? [];
|
|
127420
|
+
const activeRows = rawRows.filter((item) => !item.deleted_);
|
|
127421
|
+
if (current && current !== targetUtil) setGroupEditState(activeRows, current, false);
|
|
127422
|
+
setGroupEditState(activeRows, targetUtil, true);
|
|
127368
127423
|
rawRows.forEach((item, index) => {
|
|
127369
127424
|
if (item.deleted_) return;
|
|
127370
127425
|
const rowPath = `$.${subFieldKey}[${index}]`;
|
|
127371
127426
|
if (current && isRowInBomGroup(item, current)) MCDataUtil.updateConfirmableFieldsDisablement({
|
|
127372
127427
|
dataManager,
|
|
127373
127428
|
rowPath,
|
|
127374
|
-
disabled: true
|
|
127429
|
+
disabled: true,
|
|
127430
|
+
row: item
|
|
127375
127431
|
});
|
|
127376
127432
|
if (isRowInBomGroup(item, targetUtil)) this.syncEditingRowDisablement(dataManager, rowPath, item);
|
|
127377
127433
|
});
|
|
@@ -127405,7 +127461,8 @@ var init_material_consume_table_controller = __esmMin((() => {
|
|
|
127405
127461
|
MCDataUtil.updateConfirmableFieldsDisablement({
|
|
127406
127462
|
dataManager,
|
|
127407
127463
|
rowPath: `$.${subFieldKey}[${index}]`,
|
|
127408
|
-
disabled: true
|
|
127464
|
+
disabled: true,
|
|
127465
|
+
row
|
|
127409
127466
|
});
|
|
127410
127467
|
});
|
|
127411
127468
|
dataManager.set(subFieldKey, rawRows, "user");
|
|
@@ -127861,7 +127918,8 @@ var init_material_consume_util = __esmMin((() => {
|
|
|
127861
127918
|
if (row.is_confirmed_) MCDataUtil.updateConfirmableFieldsDisablement({
|
|
127862
127919
|
dataManager: doc.dataManager,
|
|
127863
127920
|
rowPath,
|
|
127864
|
-
disabled: true
|
|
127921
|
+
disabled: true,
|
|
127922
|
+
row
|
|
127865
127923
|
});
|
|
127866
127924
|
else tableController === null || tableController === void 0 || tableController.syncEditingRowDisablement(doc.dataManager, rowPath, row);
|
|
127867
127925
|
});
|
|
@@ -147870,17 +147928,35 @@ var init_repeating_table_action_vue_vue_type_script_setup_true_name_sub_table_ac
|
|
|
147870
147928
|
var _props$cell$subRender;
|
|
147871
147929
|
return resolveBusinessScanMenu((_props$cell$subRender = props.cell.subRenderer) === null || _props$cell$subRender === void 0 ? void 0 : _props$cell$subRender.type);
|
|
147872
147930
|
});
|
|
147931
|
+
const materialConsumeRows = ref([]);
|
|
147932
|
+
let unsubscribeRowData = [];
|
|
147933
|
+
const refreshMaterialConsumeRows = (subFieldKey) => {
|
|
147934
|
+
materialConsumeRows.value = getTableRows(subFieldKey, true);
|
|
147935
|
+
};
|
|
147936
|
+
onMounted(() => {
|
|
147937
|
+
const { subFieldKey } = getCtx();
|
|
147938
|
+
if (subTableType.value.isMaterialConsume && subFieldKey) {
|
|
147939
|
+
refreshMaterialConsumeRows(subFieldKey);
|
|
147940
|
+
const refresh = () => refreshMaterialConsumeRows(subFieldKey);
|
|
147941
|
+
unsubscribeRowData = [props.doc.dataManager.subscribe(subFieldKey, refresh), props.doc.dataManager.subscribe(`$.${subFieldKey}`, refresh)];
|
|
147942
|
+
}
|
|
147943
|
+
});
|
|
147944
|
+
onBeforeUnmount(() => unsubscribeRowData.forEach((unsubscribe) => unsubscribe()));
|
|
147873
147945
|
const actionInfo = computed(() => {
|
|
147874
|
-
var _subRenderer$widgetMe, _visibleRows$index;
|
|
147946
|
+
var _subRenderer$widgetMe, _visibleRows$index, _ctrl$bomEntriesValid;
|
|
147875
147947
|
const { subRenderer, subFieldKey, index } = getCtx();
|
|
147876
|
-
const visibleRows = getTableRows(subFieldKey, true);
|
|
147877
147948
|
const { isMaterialConsume, isWarehouseInventory, isPretreatmentList } = subTableType.value;
|
|
147949
|
+
const visibleRows = isMaterialConsume ? materialConsumeRows.value : getTableRows(subFieldKey, true);
|
|
147878
147950
|
const canQuickFill = !!((_subRenderer$widgetMe = subRenderer.widgetMeta) === null || _subRenderer$widgetMe === void 0 || (_subRenderer$widgetMe = _subRenderer$widgetMe.props) === null || _subRenderer$widgetMe === void 0 ? void 0 : _subRenderer$widgetMe.quickFill);
|
|
147879
147951
|
const canCopy = !isWarehouseInventory && !isPretreatmentList && !isMaterialConsume;
|
|
147880
147952
|
const canInsertMulti = !isMaterialConsume;
|
|
147881
147953
|
const canDelete = visibleRows.length > 1;
|
|
147882
147954
|
const canClear = isMaterialConsume && visibleRows.length === 1 && !!props.isLastRow;
|
|
147883
147955
|
const isConfirmed = !!((_visibleRows$index = visibleRows[index]) === null || _visibleRows$index === void 0 ? void 0 : _visibleRows$index.is_confirmed_);
|
|
147956
|
+
const currentRow = visibleRows[index];
|
|
147957
|
+
const ctrl = mcTableCtrl.value;
|
|
147958
|
+
const entryIndex = currentRow ? ctrl === null || ctrl === void 0 ? void 0 : ctrl.bomEntriesValidator.resolveEntryIndex(currentRow) : -1;
|
|
147959
|
+
const hasSubstituteMaterial = entryIndex !== void 0 && entryIndex >= 0 && !!(ctrl === null || ctrl === void 0 || (_ctrl$bomEntriesValid = ctrl.bomEntriesValidator.bomEntryValidators[entryIndex]) === null || _ctrl$bomEntriesValid === void 0 ? void 0 : _ctrl$bomEntriesValid.bomEntry.substitute_material_enabled_);
|
|
147884
147960
|
return {
|
|
147885
147961
|
canQuickFill,
|
|
147886
147962
|
canCopy,
|
|
@@ -147888,7 +147964,7 @@ var init_repeating_table_action_vue_vue_type_script_setup_true_name_sub_table_ac
|
|
|
147888
147964
|
canDelete,
|
|
147889
147965
|
canClear,
|
|
147890
147966
|
canEdit: isConfirmed,
|
|
147891
|
-
canInsertMcRow: isMaterialConsume && !isConfirmed
|
|
147967
|
+
canInsertMcRow: isMaterialConsume && (!isConfirmed || hasSubstituteMaterial)
|
|
147892
147968
|
};
|
|
147893
147969
|
});
|
|
147894
147970
|
const mcTableCtrl = computed(() => {
|
|
@@ -147908,12 +147984,14 @@ var init_repeating_table_action_vue_vue_type_script_setup_true_name_sub_table_ac
|
|
|
147908
147984
|
subModelKey,
|
|
147909
147985
|
subFieldOptions: getSubFieldOptions(subModelKey)
|
|
147910
147986
|
});
|
|
147911
|
-
else if (val === "edit-row")
|
|
147912
|
-
|
|
147913
|
-
|
|
147914
|
-
|
|
147915
|
-
|
|
147916
|
-
|
|
147987
|
+
else if (val === "edit-row") {
|
|
147988
|
+
await ctrl.editRow({
|
|
147989
|
+
dataManager,
|
|
147990
|
+
subFieldKey,
|
|
147991
|
+
rowIndex
|
|
147992
|
+
});
|
|
147993
|
+
refreshMaterialConsumeRows(subFieldKey);
|
|
147994
|
+
} else if (val === "add-group") {
|
|
147917
147995
|
const insertedIndex = await ctrl.addGroup({
|
|
147918
147996
|
dataManager,
|
|
147919
147997
|
subFieldKey,
|
|
@@ -148474,23 +148552,6 @@ var init_table_render_vue_vue_type_script_setup_true_lang = __esmMin((() => {
|
|
|
148474
148552
|
const props = __props;
|
|
148475
148553
|
const widget = toRef(props, "widget");
|
|
148476
148554
|
/**
|
|
148477
|
-
* 找出物料消耗表需要按 BOM 组合并的列。
|
|
148478
|
-
* Word 的字段信息位于单元格内容节点,而不是 Excel 的 tdInfo.cellWidget。
|
|
148479
|
-
*/
|
|
148480
|
-
const getGroupMergeColumn = (cell) => {
|
|
148481
|
-
const stack = [...cell.children];
|
|
148482
|
-
while (stack.length) {
|
|
148483
|
-
var _meta$field, _meta$props, _node$children;
|
|
148484
|
-
const node = stack.shift();
|
|
148485
|
-
const meta = node === null || node === void 0 ? void 0 : node.widgetMeta;
|
|
148486
|
-
if ((meta === null || meta === void 0 ? void 0 : meta.type) === "pw:serialnumber") return "__serialnumber__";
|
|
148487
|
-
const fieldLink = (meta === null || meta === void 0 || (_meta$field = meta.field) === null || _meta$field === void 0 ? void 0 : _meta$field.fieldLink) ?? (meta === null || meta === void 0 || (_meta$props = meta.props) === null || _meta$props === void 0 ? void 0 : _meta$props.field);
|
|
148488
|
-
const field = Array.isArray(fieldLink) ? fieldLink[fieldLink.length - 1] : String(fieldLink ?? "").split(".").pop();
|
|
148489
|
-
if (field && GROUP_MERGE_FIELDS.has(field)) return field;
|
|
148490
|
-
if (node === null || node === void 0 || (_node$children = node.children) === null || _node$children === void 0 ? void 0 : _node$children.length) stack.push(...node.children);
|
|
148491
|
-
}
|
|
148492
|
-
};
|
|
148493
|
-
/**
|
|
148494
148555
|
* 生成仅供画布展示的物理单元格合并关系,不修改文档模型。
|
|
148495
148556
|
* 当前 Table widget 已经是分页后的片段,因此合并会自然止于页边界。
|
|
148496
148557
|
*/
|
|
@@ -148512,7 +148573,8 @@ var init_table_render_vue_vue_type_script_setup_true_lang = __esmMin((() => {
|
|
|
148512
148573
|
if (!column) return;
|
|
148513
148574
|
const controller = controllers[sub.valuePath];
|
|
148514
148575
|
const subFieldKey = sub.valuePath.replace(/^\$\./, "");
|
|
148515
|
-
const
|
|
148576
|
+
const dataRows = (docInst.value.dataManager.getRawData()[subFieldKey] ?? []).filter((row) => !(row === null || row === void 0 ? void 0 : row.deleted_));
|
|
148577
|
+
const dataRow = dataRows[sub.dataIndex];
|
|
148516
148578
|
if (!controller || !dataRow) return;
|
|
148517
148579
|
const key = `${sub.id}:${cell.x}:${column}`;
|
|
148518
148580
|
const list = columns.get(key) ?? [];
|
|
@@ -148521,17 +148583,23 @@ var init_table_render_vue_vue_type_script_setup_true_lang = __esmMin((() => {
|
|
|
148521
148583
|
row,
|
|
148522
148584
|
rowIndex,
|
|
148523
148585
|
dataIndex: sub.dataIndex,
|
|
148524
|
-
groupKey: getGroupMergeKey(dataRow, controller.bomEntriesValidator)
|
|
148586
|
+
groupKey: getGroupMergeKey(dataRow, controller.bomEntriesValidator),
|
|
148587
|
+
groupOrderIndex: column === "__serialnumber__" ? controller.bomEntriesValidator.resolveGroupOrderIndex(dataRow, dataRows) : -1
|
|
148525
148588
|
});
|
|
148526
148589
|
columns.set(key, list);
|
|
148527
148590
|
});
|
|
148528
148591
|
});
|
|
148529
|
-
columns.forEach((candidates) => {
|
|
148592
|
+
columns.forEach((candidates, key) => {
|
|
148530
148593
|
for (let start = 0; start < candidates.length;) {
|
|
148531
148594
|
let end = start + 1;
|
|
148532
148595
|
while (end < candidates.length && candidates[end].groupKey === candidates[start].groupKey && candidates[end].dataIndex === candidates[end - 1].dataIndex + 1) end++;
|
|
148596
|
+
const anchor = candidates[start];
|
|
148597
|
+
if (key.endsWith(":__serialnumber__")) {
|
|
148598
|
+
const cellIndex = anchor.row.cells.indexOf(anchor.cell);
|
|
148599
|
+
anchor.row.cells[cellIndex] = withGroupSerialNumber(anchor.cell, anchor.groupOrderIndex);
|
|
148600
|
+
anchor.cell = anchor.row.cells[cellIndex];
|
|
148601
|
+
}
|
|
148533
148602
|
if (end - start > 1) {
|
|
148534
|
-
const anchor = candidates[start];
|
|
148535
148603
|
const last = candidates[end - 1];
|
|
148536
148604
|
anchor.cell.height = last.row.y + last.cell.height - anchor.row.y;
|
|
148537
148605
|
anchor.cell.rowspan = last.rowIndex - anchor.rowIndex + 1;
|
|
@@ -1,11 +1,38 @@
|
|
|
1
1
|
import { IMaterialConsumeData } from '../../../../../domain/table/business/material/types';
|
|
2
2
|
import { BomEntriesValidator } from './bom-validator';
|
|
3
|
+
import { Row } from '../../types/table';
|
|
4
|
+
/** Word 序号组件使用 pageWidgetMeta;业务字段使用 widgetMeta。 */
|
|
5
|
+
export declare function getGroupMergeColumn(cell: Row['cells'][number]): string | undefined;
|
|
3
6
|
/** 按组合并的组级只读字段(不含 qty_) */
|
|
4
7
|
export declare const GROUP_MERGE_FIELDS: Set<keyof IMaterialConsumeData>;
|
|
5
8
|
/** 是否为按组合并列:序号组件 + 组级字段 */
|
|
6
9
|
export declare function isGroupMergeCell(tdInfo: any): boolean;
|
|
7
10
|
/** 连续相同 key 的行属于同一合并组 */
|
|
8
11
|
export declare function getGroupMergeKey(row: IMaterialConsumeData, validator: BomEntriesValidator): string;
|
|
12
|
+
/** 与 Excel 序号组件保持相同的起始值、步长和未绑 BOM 处理。 */
|
|
13
|
+
export declare function formatGroupSerialNumber(groupOrderIndex: number, props: {
|
|
14
|
+
initialValue?: number;
|
|
15
|
+
autoAddValue?: number;
|
|
16
|
+
}): string;
|
|
17
|
+
/** 只替换画布序号文本,保留布局节点原型与其他单元格内容。 */
|
|
18
|
+
export declare function withGroupSerialNumber(cell: Row['cells'][number], groupOrderIndex: number): {
|
|
19
|
+
children: any[];
|
|
20
|
+
id: string;
|
|
21
|
+
x: number;
|
|
22
|
+
layoutX: number;
|
|
23
|
+
width: number;
|
|
24
|
+
height: number;
|
|
25
|
+
mergeFromId?: string;
|
|
26
|
+
backgroundColor?: string;
|
|
27
|
+
isNested: boolean;
|
|
28
|
+
pl: number;
|
|
29
|
+
pr: number;
|
|
30
|
+
pt: number;
|
|
31
|
+
pb: number;
|
|
32
|
+
rowspan: number;
|
|
33
|
+
colspan: number;
|
|
34
|
+
subRenderer?: import('../../../../../core').SubRenderer;
|
|
35
|
+
};
|
|
9
36
|
/**
|
|
10
37
|
* 当前页可见行的组 rowspan 计划
|
|
11
38
|
* - spans[i] > 1:组首行,值为 rowspan
|
package/dist/runtime/canvas/table/render/material-consume/material-consume-table-controller.d.ts
CHANGED
|
@@ -19,7 +19,7 @@ export interface UpdateRowOption {
|
|
|
19
19
|
/**
|
|
20
20
|
* 物料消耗表字段控制 v2026.6.15
|
|
21
21
|
* - [需求数量、已消耗数量] 始终只读
|
|
22
|
-
* - [有效期、唯一标识、自定义字段]
|
|
22
|
+
* - 编辑态可填写[有效期、唯一标识、自定义字段];顺序上料的确认态整行只读
|
|
23
23
|
* - 选择的物料类型是[查看物料]时 [批次、上料数量] 只读(与 Excel calcDisabledFields 一致)
|
|
24
24
|
* - 单行校验通过后(包括暂存后再次编辑)[物料、批次、上料数量、工序、需求数量单位、数量单位、转换后数量、转换数量单位ID、单位转化公式] 只读
|
|
25
25
|
* v2026.7.30
|
|
@@ -71,6 +71,7 @@ export declare class MCDataUtil {
|
|
|
71
71
|
dataManager: DataManager;
|
|
72
72
|
rowPath: string;
|
|
73
73
|
disabled: boolean;
|
|
74
|
+
row?: IMaterialConsumeData;
|
|
74
75
|
}): void;
|
|
75
76
|
/**
|
|
76
77
|
* 设置行数据的编辑状态
|
|
@@ -209,7 +210,7 @@ export declare class MaterialConsumeTableController {
|
|
|
209
210
|
isFirstBlankRow(): boolean;
|
|
210
211
|
/**
|
|
211
212
|
* 是否有正在编辑的组。
|
|
212
|
-
*
|
|
213
|
+
* 顺序上料时同时只能有一组处于编辑态;非顺序上料允许多组编辑。
|
|
213
214
|
*/
|
|
214
215
|
hasEditingGroup(showMessage?: boolean): boolean;
|
|
215
216
|
/**
|