@gct-paas/excel 0.1.39-beta.3 → 0.1.39-beta.30

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.
Files changed (120) hide show
  1. package/dist/{BaseComponent-MsYFQjlq.js → BaseComponent-BkwxLOiM.js} +2 -2
  2. package/dist/{VueVideoPlayer-B-X9Kvhp.js → VueVideoPlayer-DmZ_P4Cp.js} +2 -2
  3. package/dist/{align-editor-1IbAiPBg.js → align-editor-C1Fj-34U.js} +1 -1
  4. package/dist/{barcode-design-DPH8Uh2K.js → barcode-design-D90bLWOL.js} +2 -2
  5. package/dist/base/index.es.js +498 -195
  6. package/dist/{diagonal-design-AJOcMvxo.js → diagonal-design-YbEx-5SA.js} +2 -2
  7. package/dist/{dynamic-table-action-Bi7RdYoy.js → dynamic-table-action-DXlLVZZF.js} +349 -265
  8. package/dist/{dynamic-table-action.vue_vue_type_style_index_0_scoped_53d7e66c_lang-ClcBVLO0.js → dynamic-table-action.vue_vue_type_style_index_0_scoped_53d7e66c_lang-DlcK-wt_.js} +375 -299
  9. package/dist/{edit.utils-CXmmCnxE-88-QvdIv.js → edit.utils-CXmmCnxE-BMWwEMfe.js} +1 -1
  10. package/dist/excel.css +522 -332
  11. package/dist/{exceljs.min-D7RI5VAg.js → exceljs.min-B-mYUB0l.js} +2 -2
  12. package/dist/{font-editor-ttnkgG9j.js → font-editor-D0dV4bEL.js} +3 -3
  13. package/dist/{image-design-B84grap7.js → image-design-DkQBDv9K.js} +2 -2
  14. package/dist/{index-BbDITMyp.js → index-8GDKkzhT.js} +2 -2
  15. package/dist/{index-Db-ix7hC.js → index-B-hm9GED.js} +2 -2
  16. package/dist/{index-_h9yoejq.js → index-BEkX75av.js} +2 -2
  17. package/dist/{index-MJFci9IB.js → index-BKmJ_uM2.js} +1 -1
  18. package/dist/{index-CUHfI8cg.js → index-BPvsxMaD.js} +1 -1
  19. package/dist/{index-UCNknVxk.js → index-BYpPubsS.js} +1 -1
  20. package/dist/{index-Doz8Gf_5.js → index-BgL2ciTw.js} +1 -1
  21. package/dist/{index-_ZsA68LD.js → index-Boj1Babg.js} +2 -2
  22. package/dist/{index-BKBn7Evl.js → index-C0gB21qk.js} +2 -2
  23. package/dist/{index-7YbJRzdP.js → index-CHv965Bj.js} +2 -2
  24. package/dist/{index-DgdosgZd.js → index-CNSt1kk7.js} +2 -2
  25. package/dist/{index-CLL_9LZB.js → index-CVPJGks5.js} +2 -2
  26. package/dist/{index-ChncMTkv.js → index-CaKVMIWJ.js} +1 -1
  27. package/dist/{index-Bb41zgXE.js → index-CfLLsSW6.js} +2 -2
  28. package/dist/{index-CuGZ6C7l.js → index-CiyvJops.js} +2 -2
  29. package/dist/{index-CR2Qyh5l.js → index-CrnlU1jr.js} +6 -5
  30. package/dist/{index-DCzL4GOP.js → index-D19ggbiC.js} +53 -5
  31. package/dist/{index-D9xmHJZc.js → index-D9BcQ25Q.js} +2 -2
  32. package/dist/{index-CX6LqGJP.js → index-DOGxYpwq.js} +1 -1
  33. package/dist/{index-D0Q-6EtG.js → index-DWrIPK_U.js} +1 -1
  34. package/dist/{index-89I_eBZ-.js → index-DZYpzeZM.js} +3 -3
  35. package/dist/{index-jRA6sXVY.js → index-Dgs95dud.js} +1 -1
  36. package/dist/{index-C_FegWKd.js → index-DlfthBvr.js} +2 -2
  37. package/dist/{index-DBT8-Qit.js → index-DsS5smhd.js} +3 -3
  38. package/dist/{index-DAN58pC9.js → index-DyLoooUC.js} +2 -2
  39. package/dist/{index-IRXUwksU.js → index-DzmKXFwH.js} +2 -2
  40. package/dist/{index-DNmbm6HV.js → index-K9yUIBxc.js} +6 -5
  41. package/dist/{index-DHHyy4mL.js → index-V3FsjgC2.js} +1 -1
  42. package/dist/{index-C90vW_gE.js → index-VBBgqHqv.js} +3 -3
  43. package/dist/{index-ab9KSEKp.js → index-Zr4W3H4i.js} +2 -2
  44. package/dist/{index-DmBNvVlZ.js → index-jfKiyRsE.js} +1327 -1111
  45. package/dist/{index-EhaPjLBG.js → index-lSMZmF7U.js} +2 -2
  46. package/dist/{index-B5NG2ONv.js → index-rDv1Pb8y.js} +2 -2
  47. package/dist/{index-n1HZa-Ar.js → index-ulVZgzRz.js} +2 -2
  48. package/dist/{index-_-ORWa-m.js → index-w1Oz-JSm.js} +1 -1
  49. package/dist/index.es.js +2 -2
  50. package/dist/{mb-render-BZDgmpm9.js → mb-render-Dc2J-VKn.js} +9 -3
  51. package/dist/{online-form-model-select.vue_vue_type_script_setup_true_name_online-form-model-select_lang-Ciue53Ue.js → online-form-model-select.vue_vue_type_script_setup_true_name_online-form-model-select_lang-D60Qjkgq.js} +8 -1
  52. package/dist/{pagination-design-DU2ZuaY4.js → pagination-design-J5Xr1H6H.js} +2 -2
  53. package/dist/paper-widget-design-mppU2AMx.js +4 -0
  54. package/dist/{print-runtime-instance-ydLRVd0y.js → print-runtime-instance-CkGherFi.js} +1 -1
  55. package/dist/{print-snapshot-renderer-C3fEtvNI.js → print-snapshot-renderer-BxrmKmGQ.js} +3 -3
  56. package/dist/{qrcode-design-BXlQ5QTm.js → qrcode-design-DJciYm3W.js} +1 -1
  57. package/dist/{revo-grid.entry-DdE6cuGJ.js → revo-grid.entry-D2XU7yfg.js} +1 -1
  58. package/dist/{revogr-attribution_7.entry-Er1fVrov.js → revogr-attribution_7.entry-DiKuD6Oj.js} +3 -3
  59. package/dist/{revogr-clipboard_3.entry-COq2SN-B.js → revogr-clipboard_3.entry-BaU8s-5o.js} +2 -2
  60. package/dist/{revogr-data_4.entry--CfGDdVK.js → revogr-data_4.entry-D6AqE208.js} +2 -2
  61. package/dist/{revogr-filter-panel.entry-DoNXkBy6.js → revogr-filter-panel.entry-B0-_hrSZ.js} +1 -1
  62. package/dist/seal-design-FsL7H3e7.js +4 -0
  63. package/dist/{serialnumber-design-fMRSi9jn.js → serialnumber-design-BfeGFYY4.js} +1 -1
  64. package/dist/shared/index.es.js +10 -8
  65. package/dist/{single-field-drop-CYcOH6mT.js → single-field-drop-wg47buz7.js} +2 -2
  66. package/dist/{size-editor-BKJfYgbR.js → size-editor-hnWquuM2.js} +1 -1
  67. package/dist/src/domain/table/business/material/material-balance/profile/fields.d.ts +2 -0
  68. package/dist/src/domain/table/business/preprocess/pretreatment-list/profile/field-keys.d.ts +1 -7
  69. package/dist/src/domain/table/business/sterilize/entrust-steril-batch-list/profile/fields.d.ts +2 -0
  70. package/dist/src/nocode-base/src/core/sub-table/allocate-table-core.d.ts +2 -1
  71. package/dist/src/nocode-base/src/core/sub-table/sub-table-core.d.ts +2 -1
  72. package/dist/src/nocode-base/src/hooks/form-model/form-model-controller.d.ts +2 -0
  73. package/dist/src/nocode-base/src/hooks/material-consume/material-consume-table-controller.d.ts +1 -0
  74. package/dist/src/nocode-base/src/hooks/material-consume/tmpl-bom-controller.d.ts +12 -7
  75. package/dist/src/nocode-base/src/hooks/material-consume-object/bom-validator.d.ts +4 -3
  76. package/dist/src/nocode-base/src/hooks/material-consume-object/initialize-autofill.d.ts +19 -0
  77. package/dist/src/nocode-base/src/hooks/material-consume-object/object-validation-controller.d.ts +24 -0
  78. package/dist/src/nocode-base/src/interface/render.d.ts +3 -1
  79. package/dist/src/nocode-base/src/interface/transform.d.ts +9 -1
  80. package/dist/src/nocode-base/src/runtime/async-task-coordinator.d.ts +6 -2
  81. package/dist/src/nocode-base/src/runtime/multi-sheet-runtime.d.ts +5 -1
  82. package/dist/src/nocode-base/src/runtime/runtime-context.d.ts +4 -0
  83. package/dist/src/nocode-base/src/runtime/runtime-field-initializer.d.ts +1 -1
  84. package/dist/src/nocode-base/src/runtime/runtime-validation-service.d.ts +1 -0
  85. package/dist/src/nocode-base/src/types/render/mc-render.d.ts +1 -1
  86. package/dist/src/nocode-base/src/types/render/sub-table-render.d.ts +5 -1
  87. package/dist/src/nocode-web-render/src/render/sub-table/common/inventory-scan-columns.d.ts +6 -0
  88. package/dist/src/nocode-web-render/src/render/sub-table/material-consume/mc-web-render.d.ts +1 -1
  89. package/dist/src/online-form/src/views/__cell_widgets__/cell-widget-design.vue.d.ts +1 -0
  90. package/dist/src/online-form/src/views/__cell_widgets__/common/display-fields-editor/display-fields.util.d.ts +2 -2
  91. package/dist/src/online-form/src/views/__cell_widgets__/common/quick-search-editor/quick-search.util.d.ts +8 -0
  92. package/dist/src/online-form/src/views/__cell_widgets__/fake-field/fake-option-select.vue.d.ts +1 -0
  93. package/dist/src/online-form/src/views/designer/conversions/normalize-paper-grid.d.ts +3 -0
  94. package/dist/src/online-form/src/views/render/__components__/_field_/trace/utils/use-rule-props.d.ts +0 -3
  95. package/dist/src/online-form/src/views/render/sheet-tab-bar.vue.d.ts +5 -3
  96. package/dist/src/shared/enum/field-type.d.ts +2 -0
  97. package/dist/src/shared/enum/index.d.ts +2 -0
  98. package/dist/src/shared/enum/product-type.d.ts +9 -0
  99. package/dist/src/shared/enum/production-identification.d.ts +19 -0
  100. package/dist/{sub-table-factory-DxM8KQoS.js → sub-table-factory-DCjl5fld.js} +19 -7
  101. package/dist/{text-design-8Za9qOSI.js → text-design-BQqBHcG3.js} +2 -2
  102. package/dist/{throttle-Cpk1LoGk-BI0wP2Le.js → throttle-Cpk1LoGk-C-bCLTWf.js} +1 -1
  103. package/dist/{timediff-design-O1IfzLVD.js → timediff-design-DzNFXX0B.js} +1 -1
  104. package/dist/{trace-like-wrapper-BPNmxIDn.js → trace-like-wrapper-BO9GpUUT.js} +2 -2
  105. package/dist/{value-editor.vue_vue_type_style_index_0_lang-CQ0YP-OF.js → value-editor.vue_vue_type_style_index_0_lang-NrJ6BC4L.js} +2 -2
  106. package/dist/web-render/index.es.js +3 -3
  107. package/dist/{widget-barcode-C38yawCK.js → widget-barcode-CqFwMMNr.js} +4 -4
  108. package/dist/{widget-diagonal-abcgVyu4.js → widget-diagonal-Bv7rOoCE.js} +3 -3
  109. package/dist/{widget-image-DcSNslZ-.js → widget-image-C7uAoxCn.js} +5 -5
  110. package/dist/{widget-line-CttlnK7g.js → widget-line-DjEbtHhc.js} +2 -2
  111. package/dist/{widget-pagination-BNG9Rszh.js → widget-pagination-Dc4pC9a8.js} +5 -5
  112. package/dist/{widget-power-DaC1id-m.js → widget-power-9LyPBlNG.js} +3 -3
  113. package/dist/{widget-qrcode-BRFsOH44.js → widget-qrcode-wY0Htp8v.js} +3 -3
  114. package/dist/{widget-rangelimit-fA6YF2E2.js → widget-rangelimit-CT9yqbbL.js} +3 -3
  115. package/dist/{widget-serialnumber-mnpGMXuB.js → widget-serialnumber-CChK8wrF.js} +1 -1
  116. package/dist/{widget-text-gHJcpS1w.js → widget-text-mWwms2HC.js} +5 -5
  117. package/dist/{widget-timediff-ByHm9Dg3.js → widget-timediff-GSd_w8qO.js} +2 -2
  118. package/package.json +2 -2
  119. package/dist/paper-widget-design-BE_wOTpv.js +0 -4
  120. package/dist/seal-design-7aKsQ6RT.js +0 -4
@@ -1,10 +1,10 @@
1
1
  import { reactive, toRaw, computed, watch, onScopeDispose, inject, h, shallowReactive, markRaw, ref, nextTick, toRef, provide, defineComponent, openBlock, createElementBlock, mergeProps, unref, createElementVNode, normalizeClass, renderSlot, createCommentVNode, createVNode, toDisplayString, Fragment, renderList, onUnmounted, isVNode, onMounted, onBeforeMount, resolveComponent, createBlock, withCtx, createTextVNode } from "vue";
2
- import { ai as CellWidgetViewState, F as FIELD_TYPE, b8 as RenderModeEnum, Y as FormTypeEnum, bE as BpmnNodeTypeEnum, cv as getFieldPlaceholder, bV as MobileFillTypeEnum, C as ComponentTypeEnum, $ as PlatformEnum, cw as isReferenceOptionActive, E as api, bu as uuid2, c3 as calcUtils, bj as findRuntimeTableRow, c7 as ensureTableRowKeys, c0 as bindRuntimeTableColumns, bi as getRowId, cx as FRONT_ROW_KEY, cm as isTableRowKeyMatch, bw as isAttachFieldActive, cy as filterRulesByTrigger, cz as isEmptyValue$1, c4 as decodeTableCellRowKey, c6 as ensureFrontRowKey, b0 as getParseRuleInfo, aF as transformUtils, aY as materialCheck, aZ as getLotLockedReason, a_ as validateReinspectionDate, bn as FormulaRuleFieldKeyEnum, f as SubTableType, b1 as getParseRuleValue, cA as buildError, H as CreateType, bl as findRuntimeParentRow, aI as Dependency_ENUM, aH as ASSIGNMENTSTRATEGY_ENUM, bJ as commonUtils, aM as DeviceLink, a8 as _export_sfc, cg as getRenderedRuntimeTableCell, y as CellType, cq as relocateDeletedRowsToEnd, cB as resetTableRowIdentity, J as useModal, cC as q, cD as QUICK_FILL_ALLOWED_FIELDS, cE as groupFixedTableRows, cF as processQuickFillRows, cG as getIsGroupEmpty } from "./dynamic-table-action.vue_vue_type_style_index_0_scoped_53d7e66c_lang-ClcBVLO0.js";
2
+ import { ai as CellWidgetViewState, F as FIELD_TYPE, b9 as RenderModeEnum, Y as FormTypeEnum, bF as BpmnNodeTypeEnum, cw as getFieldPlaceholder, bW as MobileFillTypeEnum, C as ComponentTypeEnum, $ as PlatformEnum, cx as isReferenceOptionActive, E as api, bv as uuid2, c4 as calcUtils, bk as findRuntimeTableRow, c8 as ensureTableRowKeys, c1 as bindRuntimeTableColumns, bj as getRowId, cy as FRONT_ROW_KEY, cn as isTableRowKeyMatch, bx as isAttachFieldActive, cz as filterRulesByTrigger, cA as isEmptyValue$1, c5 as decodeTableCellRowKey, c7 as ensureFrontRowKey, b1 as getParseRuleInfo, aF as transformUtils, aY as materialCheck, aZ as getLotLockedReason, a_ as validateReinspectionDate, bo as FormulaRuleFieldKeyEnum, f as SubTableType, b2 as getParseRuleValue, cB as buildError, H as CreateType, bm as findRuntimeParentRow, aI as Dependency_ENUM, aH as ASSIGNMENTSTRATEGY_ENUM, bK as commonUtils, aM as DeviceLink, a8 as _export_sfc, ch as getRenderedRuntimeTableCell, y as CellType, cr as relocateDeletedRowsToEnd, cC as resetTableRowIdentity, J as useModal, cD as q, cE as QUICK_FILL_ALLOWED_FIELDS, cF as groupFixedTableRows, cG as processQuickFillRows, cH as getIsGroupEmpty } from "./dynamic-table-action.vue_vue_type_style_index_0_scoped_53d7e66c_lang-DlcK-wt_.js";
3
3
  import { cloneDeep, isEmpty, has, pickBy, isNil, mergeWith, omit, last, pick, merge } from "lodash-es";
4
4
  import dayjs from "dayjs";
5
5
  import { a as useNamespace, I as Icon } from "./AntdIcon-DCIaV352.js";
6
6
  import { Modal, message } from "ant-design-vue";
7
- import { u as useFormModel } from "./mb-render-BZDgmpm9.js";
7
+ import { u as useFormModel } from "./mb-render-Dc2J-VKn.js";
8
8
  var MaterialConsumptionPatternEnum = /* @__PURE__ */ ((MaterialConsumptionPatternEnum2) => {
9
9
  MaterialConsumptionPatternEnum2["RECORD"] = "record";
10
10
  MaterialConsumptionPatternEnum2["BOM"] = "bom";
@@ -942,6 +942,8 @@ function convertV1Runtime(runtime) {
942
942
  return { schemaVersion: 1, formConfig, sheets: [sheet] };
943
943
  }
944
944
  const MULTI_SHEET_SCHEMA_VERSION = 2;
945
+ const MAX_RUNTIME_SHEETS = 100;
946
+ const MAX_RUNTIME_SHEET_TITLE_LENGTH = 255;
945
947
  function assertObject(value, message2) {
946
948
  if (!value || typeof value !== "object" || Array.isArray(value)) throw new Error(message2);
947
949
  }
@@ -983,7 +985,7 @@ function normalizeSheetMetadata(sheet) {
983
985
  };
984
986
  return { ...sheet, paper, nodes, dataCenter: { [ComponentTypeEnum.PAPER]: paper, ...nodes } };
985
987
  }
986
- function normalizeRuntime(runtime) {
988
+ function normalizeRuntime(runtime, formType) {
987
989
  if (typeof runtime === "string") {
988
990
  if (!runtime.trim()) throw new Error("运行时数据不能为空");
989
991
  try {
@@ -994,7 +996,16 @@ function normalizeRuntime(runtime) {
994
996
  }
995
997
  assertObject(runtime, "运行时数据格式无效");
996
998
  if (runtime.schemaVersion == null || runtime.schemaVersion === 1) {
997
- const normalized = convertV1Runtime(runtime);
999
+ const legacyRuntime = formType === FormTypeEnum.FILE && runtime[ComponentTypeEnum.PAPER] == null ? {
1000
+ ...runtime,
1001
+ [ComponentTypeEnum.PAPER]: {
1002
+ id: ComponentTypeEnum.PAPER,
1003
+ component: ComponentTypeEnum.PAPER,
1004
+ props: {},
1005
+ nextIds: []
1006
+ }
1007
+ } : runtime;
1008
+ const normalized = convertV1Runtime(legacyRuntime);
998
1009
  normalized.sheets.forEach(validateSheetGraph);
999
1010
  return { ...normalized, sheets: normalized.sheets.map(normalizeSheetMetadata) };
1000
1011
  }
@@ -1007,7 +1018,9 @@ function normalizeRuntime(runtime) {
1007
1018
  if (!Array.isArray(runtime.sheets) || runtime.sheets.length === 0) {
1008
1019
  throw new Error("多 Sheet 运行时至少需要一个工作表");
1009
1020
  }
1010
- if (runtime.sheets.length > 10) throw new Error("每份表单最多支持 10 个工作表");
1021
+ if (runtime.sheets.length > MAX_RUNTIME_SHEETS) {
1022
+ throw new Error(`每份表单最多支持 ${MAX_RUNTIME_SHEETS} 个工作表`);
1023
+ }
1011
1024
  const formConfig = runtime.formConfig ?? {};
1012
1025
  assertObject(formConfig, "多 Sheet 运行时的 formConfig 格式无效");
1013
1026
  const ids = /* @__PURE__ */ new Set();
@@ -1018,7 +1031,9 @@ function normalizeRuntime(runtime) {
1018
1031
  const sheetId = String(rawSheet.sheetId ?? "").trim();
1019
1032
  const title = String(rawSheet.title ?? "").trim();
1020
1033
  if (!sheetId) throw new Error(`第 ${index + 1} 个工作表缺少 sheetId`);
1021
- if (!title || title.length > 20) throw new Error(`工作表名称必须为 1 到 20 个字符:${title}`);
1034
+ if (!title || title.length > MAX_RUNTIME_SHEET_TITLE_LENGTH) {
1035
+ throw new Error(`工作表名称必须为 1 到 ${MAX_RUNTIME_SHEET_TITLE_LENGTH} 个字符:${title}`);
1036
+ }
1022
1037
  if (ids.has(sheetId)) throw new Error(`重复的 sheetId:${sheetId}`);
1023
1038
  if (titles.has(title)) throw new Error(`重复的工作表名称:${title}`);
1024
1039
  ids.add(sheetId);
@@ -1127,6 +1142,7 @@ function createRuntimeInstanceContext(options) {
1127
1142
  uniqueId: options.uniqueId,
1128
1143
  instanceId: options.instanceId,
1129
1144
  templateId: options.templateId,
1145
+ formType: options.formType,
1130
1146
  schemaVersion: options.runtime.schemaVersion,
1131
1147
  formConfig: options.runtime.formConfig,
1132
1148
  defaultData: options.defaultData,
@@ -1216,7 +1232,7 @@ class RuntimeSheetService {
1216
1232
  this.calculatingDepth += 1;
1217
1233
  let succeeded = false;
1218
1234
  try {
1219
- const pageData = RuntimeSheetService.calculatePages(sheet.dataCenter, this.formState.state);
1235
+ const pageData = this.context.formType === FormTypeEnum.FILE ? [] : RuntimeSheetService.calculatePages(sheet.dataCenter, this.formState.state);
1220
1236
  this.assertAlive();
1221
1237
  sheet.pageData = pageData;
1222
1238
  sheet.paginationError = void 0;
@@ -1571,9 +1587,15 @@ class RuntimeFormStateStore {
1571
1587
  target = this.unwrap(target);
1572
1588
  value = this.unwrap(value);
1573
1589
  this.ensureIncomingRowKeys(target, fieldKey, value);
1574
- if (Object.is(toRaw(this.unwrap(target[fieldKey])), toRaw(value))) return;
1575
- this.mutate([path], source, () => {
1576
- target[fieldKey] = value;
1590
+ const valueChanged = !Object.is(toRaw(this.unwrap(target[fieldKey])), toRaw(value));
1591
+ const labelKey = `${fieldKey}_lb_`;
1592
+ const clearLabel = (value == null || value === "" || Array.isArray(value) && value.length === 0) && target[labelKey] != null;
1593
+ if (!valueChanged && !clearLabel) return;
1594
+ const paths = valueChanged ? [path] : [];
1595
+ if (clearLabel) paths.push(`${path}_lb_`);
1596
+ this.mutate(paths, source, () => {
1597
+ if (valueChanged) target[fieldKey] = value;
1598
+ if (clearLabel) target[labelKey] = null;
1577
1599
  });
1578
1600
  }
1579
1601
  /** 合并当前行的一组关联字段,累计稳定业务路径,只提交一次变更。 */
@@ -1715,12 +1737,28 @@ class RuntimeFormStateStore {
1715
1737
  incoming.forEach((savedRow) => {
1716
1738
  const rowKey = savedRow?.[FRONT_ROW_KEY];
1717
1739
  const savedId = savedRow?.id_;
1718
- const currentRow = target.find((row) => {
1740
+ let currentRow = target.find((row) => {
1719
1741
  if (!row || typeof row !== "object") return false;
1720
1742
  if (rowKey != null && isTableRowKeyMatch(rowKey, row[FRONT_ROW_KEY])) return true;
1721
1743
  return savedId != null && row.id_ != null && String(row.id_) === String(savedId);
1722
1744
  });
1723
- if (currentRow) this.mergeSavedMetadata(currentRow, savedRow, path);
1745
+ let matchedByGroup = false;
1746
+ if (!currentRow && Array.isArray(savedRow?._2DTABLE_) && savedRow.group_ != null && String(savedRow.group_).trim() !== "") {
1747
+ const matchingGroups = target.filter(
1748
+ (row) => Array.isArray(row?._2DTABLE_) && row.group_ != null && String(row.group_) === String(savedRow.group_)
1749
+ );
1750
+ if (matchingGroups.length === 1) {
1751
+ currentRow = matchingGroups[0];
1752
+ matchedByGroup = true;
1753
+ }
1754
+ }
1755
+ if (currentRow) {
1756
+ this.mergeSavedMetadata(
1757
+ currentRow,
1758
+ matchedByGroup ? { ...savedRow, [FRONT_ROW_KEY]: currentRow[FRONT_ROW_KEY] } : savedRow,
1759
+ path
1760
+ );
1761
+ }
1724
1762
  });
1725
1763
  return target;
1726
1764
  }
@@ -1816,6 +1854,7 @@ class RuntimeAsyncTaskCoordinator {
1816
1854
  fieldIdentity: options.fieldIdentity,
1817
1855
  sheetId: options.sheetId,
1818
1856
  required: options.required !== false,
1857
+ blockOnFailure: options.blockOnFailure !== false,
1819
1858
  status: "pending",
1820
1859
  sequence,
1821
1860
  promise: task,
@@ -1859,7 +1898,7 @@ class RuntimeAsyncTaskCoordinator {
1859
1898
  * 等待全部 required 任务达到稳定状态。
1860
1899
  *
1861
1900
  * 一轮任务完成后的字段回填可能触发新的公式或远程任务,因此这里循环读取任务表,直到
1862
- * 没有新的 pending required 任务。稳定后统一检查失败项,使提交事务得到明确失败原因。
1901
+ * 没有新的 pending required 任务。稳定后只检查需要阻断提交的失败项。
1863
1902
  */
1864
1903
  async waitForRequired(keyPrefix) {
1865
1904
  const matches = (task) => task.required && (!keyPrefix || task.key.startsWith(keyPrefix));
@@ -1871,7 +1910,7 @@ class RuntimeAsyncTaskCoordinator {
1871
1910
  await Promise.allSettled(pending.map((task) => task.promise));
1872
1911
  }
1873
1912
  const failed = Array.from(this.tasks.values()).filter(
1874
- (task) => matches(task) && task.status === "rejected"
1913
+ (task) => matches(task) && task.blockOnFailure && task.status === "rejected"
1875
1914
  );
1876
1915
  if (failed.length) {
1877
1916
  const details = failed.map((task) => {
@@ -3217,11 +3256,12 @@ class RuntimeValidationService {
3217
3256
  this.pendingLive = this.pendingLive === "blur" ? "blur" : trigger;
3218
3257
  if (this.liveTimer) clearTimeout(this.liveTimer);
3219
3258
  this.liveTimer = void 0;
3220
- if (immediate) void this.flushLive().catch((error) => console.error("字段校验失败", error));
3259
+ if (immediate)
3260
+ void this.flushLive().catch((error) => this.logBackgroundError("字段校验失败", error));
3221
3261
  else
3222
3262
  this.liveTimer = setTimeout(() => {
3223
3263
  this.liveTimer = void 0;
3224
- void this.flushLive().catch((error) => console.error("字段校验失败", error));
3264
+ void this.flushLive().catch((error) => this.logBackgroundError("字段校验失败", error));
3225
3265
  }, 300);
3226
3266
  }
3227
3267
  async flushLive() {
@@ -3243,11 +3283,17 @@ class RuntimeValidationService {
3243
3283
  this.displayTimer = void 0;
3244
3284
  const run = () => {
3245
3285
  this.displayTimer = void 0;
3246
- void this.validate("display").catch((error) => console.error("字段展示校验失败", error));
3286
+ void this.validate("display").catch(
3287
+ (error) => this.logBackgroundError("字段展示校验失败", error)
3288
+ );
3247
3289
  };
3248
3290
  if (immediate) run();
3249
3291
  else this.displayTimer = setTimeout(run, 320);
3250
3292
  }
3293
+ logBackgroundError(label, error) {
3294
+ if (error instanceof Error && error.message.startsWith("以下异步任务执行失败:")) return;
3295
+ console.error(label, error);
3296
+ }
3251
3297
  pruneComments() {
3252
3298
  if (!this.binding || this.disposed) return;
3253
3299
  this.binding.applyComments(
@@ -4582,7 +4628,16 @@ class BomEntriesValidator {
4582
4628
  memberIndexes.push(idx);
4583
4629
  if (byLot && !row.material_no_) emptyLotIndexes.push(idx);
4584
4630
  });
4585
- const needInsert = !this.groupExistsInTable(arr, target);
4631
+ const targetExists = this.groupExistsInTable(arr, target);
4632
+ if (!targetExists) {
4633
+ const index = arr.findIndex((row2) => !row2.deleted_);
4634
+ const row = arr[index];
4635
+ const canReuse = row && !row.product_id_ && !row.bom_entry_id_ && !row.is_confirmed_ && arr.every((item, idx) => item.deleted_ || idx === index);
4636
+ if (canReuse) {
4637
+ emptyProductIndexes.push(index);
4638
+ }
4639
+ }
4640
+ const needInsert = !targetExists && emptyProductIndexes.length === 0;
4586
4641
  const last2 = memberIndexes[memberIndexes.length - 1];
4587
4642
  let groupInsertIndex = -1;
4588
4643
  if (needInsert) {
@@ -5207,7 +5262,8 @@ class MaterialConsumeTableController {
5207
5262
  constructor(tmplBomController, tmplBom, options = {}) {
5208
5263
  this.tmplBomController = tmplBomController;
5209
5264
  this.tmplBom = tmplBom;
5210
- if (!options.printOnly) this.initScanRule(this.tmplBom.barcode_parsing_rules_id_);
5265
+ if (!options.printOnly && this.hasFormInstance)
5266
+ this.initScanRule(this.tmplBom.barcode_parsing_rules_id_);
5211
5267
  this.scanParamType = this.tmplBom.scan_param_type_;
5212
5268
  markRaw(this);
5213
5269
  this.bomEntriesValidator = new BomEntriesValidator(
@@ -5270,6 +5326,9 @@ class MaterialConsumeTableController {
5270
5326
  get mcPattern() {
5271
5327
  return this.tmplBom.material_consumption_pattern_ ?? this.tmplBomController.defaultMCPattern;
5272
5328
  }
5329
+ get hasFormInstance() {
5330
+ return this.tmplBomController.hasFormInstance;
5331
+ }
5273
5332
  /**
5274
5333
  * 解析规则数据对象
5275
5334
  */
@@ -5522,6 +5581,10 @@ class MaterialConsumeTableController {
5522
5581
  }
5523
5582
  const isRecordPattern = this.mcPattern === MaterialConsumptionPatternEnum.RECORD && !this.tmplBom.personal_bom_enabled_;
5524
5583
  console.log("parseScanStr", data);
5584
+ if (!data.lot && !data.uniqueCode) {
5585
+ this.error($t("sys.edhr.mcTable.lotOrUniqueCodeRequired"));
5586
+ return;
5587
+ }
5525
5588
  const arr = await materialCheck({
5526
5589
  material_no_: data.materialCode,
5527
5590
  production_identification_name_: data.lot,
@@ -6016,7 +6079,16 @@ class MaterialConsumeTableController {
6016
6079
  this.error(msg);
6017
6080
  return;
6018
6081
  }
6019
- if (!value) return;
6082
+ if (!value) {
6083
+ if (row.product_id_ && !this.isCustomRequiredQty) {
6084
+ const util = this.bomEntriesValidator.findUtilByProductId(row.product_id_);
6085
+ if (util) {
6086
+ row.qty_required_ = util.total;
6087
+ }
6088
+ }
6089
+ this.updateDerivedQtyFields();
6090
+ return;
6091
+ }
6020
6092
  try {
6021
6093
  await validateReinspectionDate({
6022
6094
  product_id_: option.product_id_ ?? row.product_id_,
@@ -6040,6 +6112,7 @@ class MaterialConsumeTableController {
6040
6112
  const qty = oldGroupId && row.bom_entry_id_ === oldGroupId ? oldRequiredQty : this.getCustomGroupRequiredQty(row);
6041
6113
  this.setCustomGroupRequiredQty(row, qty);
6042
6114
  }
6115
+ this.updateDerivedQtyFields();
6043
6116
  } else if (field === "qty_") {
6044
6117
  this.updateDerivedQtyFields();
6045
6118
  }
@@ -6674,11 +6747,12 @@ class SubTableCore {
6674
6747
  /**
6675
6748
  * 扫码多条候选时选择一行(1 条自动选中)
6676
6749
  */
6677
- async pickScanRecord(records) {
6750
+ async pickScanRecord(records, options = {}) {
6678
6751
  if (!records.length) return void 0;
6679
6752
  if (records.length === 1) return records[0];
6680
6753
  return this.render.openMultiRowsModal({
6681
- rows: mapScanRecordsForPicker(records)
6754
+ rows: mapScanRecordsForPicker(records),
6755
+ ...options
6682
6756
  });
6683
6757
  }
6684
6758
  /**
@@ -6904,7 +6978,7 @@ async function validateObjectBomQtyOnSubmit(opts) {
6904
6978
  for (const obj of objectFieldList) {
6905
6979
  if (!obj?.objectField) continue;
6906
6980
  const objectBom = findObjectBom(formInstBom, obj.objectField);
6907
- if (objectBom?.material_consumption_pattern_ === MaterialConsumptionPatternEnum.RECORD) {
6981
+ if (objectBom?.material_consumption_pattern_ === MaterialConsumptionPatternEnum.RECORD && !objectBom.personal_bom_enabled_) {
6908
6982
  continue;
6909
6983
  }
6910
6984
  const { productKey, productFieldName, qtyKey, qtyRequiredKey, qtyFieldName } = pickObjectFieldKeys(obj.subFields, obj.objectField);
@@ -6965,150 +7039,6 @@ async function validateObjectBomQtyOnSubmit(opts) {
6965
7039
  }
6966
7040
  return errors;
6967
7041
  }
6968
- function isBlank(value) {
6969
- return value == null || value === "";
6970
- }
6971
- function pickPresent(preferred, fallback) {
6972
- return isBlank(preferred) ? fallback : preferred;
6973
- }
6974
- function resolveObjectFieldKeys(opts) {
6975
- const obj = opts.objectFieldList?.find((item) => item.objectField === opts.belongingObject);
6976
- const fromList = obj?.subFields ? pickObjectFieldKeys(obj.subFields, opts.belongingObject) : {};
6977
- const fromFallback = pickObjectFieldKeys(opts.fallbackFields, opts.belongingObject, {
6978
- requireUsed: false
6979
- });
6980
- return {
6981
- productKey: pickPresent(fromList.productKey, fromFallback.productKey),
6982
- productFieldName: fromList.productFieldName ?? fromFallback.productFieldName,
6983
- materialNoKey: pickPresent(fromList.materialNoKey, fromFallback.materialNoKey),
6984
- materialNoFieldName: fromList.materialNoFieldName ?? fromFallback.materialNoFieldName,
6985
- qtyKey: pickPresent(fromList.qtyKey, fromFallback.qtyKey),
6986
- qtyRequiredKey: pickPresent(fromList.qtyRequiredKey, fromFallback.qtyRequiredKey),
6987
- qtyFieldName: fromList.qtyFieldName ?? fromFallback.qtyFieldName,
6988
- bomEntryIdKey: pickPresent(fromList.bomEntryIdKey, fromFallback.bomEntryIdKey)
6989
- };
6990
- }
6991
- function buildObjectLotExtraQuery(productId) {
6992
- if (isBlank(productId)) return {};
6993
- const versionId = String(productId).split(":").pop();
6994
- if (!versionId) return {};
6995
- return { "product_id_.versionEq": versionId };
6996
- }
6997
- function clearedLotFields(materialNoKey) {
6998
- if (!materialNoKey) return {};
6999
- return {
7000
- [materialNoKey]: void 0,
7001
- [`${materialNoKey}_id_`]: void 0,
7002
- [`${materialNoKey}_lb_`]: void 0
7003
- };
7004
- }
7005
- function shouldClearLotOnProductChange(opts) {
7006
- const { prevProduct, nextProduct, lotValue } = opts;
7007
- if (isBlank(prevProduct) && isBlank(nextProduct)) return false;
7008
- if (prevProduct === nextProduct) return false;
7009
- if (isBlank(prevProduct) && !isBlank(nextProduct) && !isBlank(lotValue)) {
7010
- return false;
7011
- }
7012
- return true;
7013
- }
7014
- let fillingProduct = false;
7015
- function runWithFillProduct(fn) {
7016
- fillingProduct = true;
7017
- try {
7018
- fn();
7019
- } finally {
7020
- nextTick(() => {
7021
- fillingProduct = false;
7022
- });
7023
- }
7024
- }
7025
- function resolveLotValidateParams(keys, formData, option) {
7026
- return {
7027
- product_id_: option?.product_id_ ?? option?._item?.product_id_ ?? (keys.productKey ? formData[keys.productKey] : void 0),
7028
- material_no_: option?.name_ ?? option?.__VALUE__ ?? (keys.materialNoKey ? formData[keys.materialNoKey] : void 0),
7029
- material_no_id_: option?.id_ ?? (keys.materialNoKey ? formData[`${keys.materialNoKey}_id_`] : void 0)
7030
- };
7031
- }
7032
- async function applyConsumeObjectTraceChange(opts) {
7033
- const { belongingObject, role, formData } = opts;
7034
- if (!belongingObject || !formData) return {};
7035
- const keys = resolveObjectFieldKeys({
7036
- belongingObject,
7037
- objectFieldList: opts.objectFieldList,
7038
- fallbackFields: opts.fallbackFields
7039
- });
7040
- if (role === FIELD_TYPE.PRODUCT) {
7041
- if (!("prevProduct" in opts) || fillingProduct) return {};
7042
- const values = {};
7043
- if (shouldClearLotOnProductChange({
7044
- prevProduct: opts.prevProduct,
7045
- nextProduct: opts.nextValue,
7046
- lotValue: keys.materialNoKey ? formData[keys.materialNoKey] : void 0
7047
- })) {
7048
- Object.assign(values, clearedLotFields(keys.materialNoKey));
7049
- }
7050
- if (keys.bomEntryIdKey) {
7051
- values[keys.bomEntryIdKey] = null;
7052
- if (!isBlank(opts.nextValue) && opts.formInstBom) {
7053
- const entry = resolveObjectBomEntry({
7054
- formInstBom: opts.formInstBom,
7055
- belongingObject,
7056
- productId: String(opts.nextValue)
7057
- });
7058
- if (entry) values[keys.bomEntryIdKey] = entry.id_;
7059
- }
7060
- }
7061
- opts.rowWriter.patchRow(values, "autofill");
7062
- const lotValue = keys.materialNoKey ? formData[keys.materialNoKey] : void 0;
7063
- if (!isBlank(opts.nextValue) && !isBlank(lotValue)) {
7064
- try {
7065
- await validateReinspectionDate({
7066
- product_id_: String(opts.nextValue),
7067
- material_no_: lotValue,
7068
- material_no_id_: keys.materialNoKey ? formData[`${keys.materialNoKey}_id_`] : void 0
7069
- });
7070
- } catch (e) {
7071
- return { abortReinspection: e?.message || String(e) };
7072
- }
7073
- }
7074
- return {};
7075
- }
7076
- if (role === FIELD_TYPE.MATERIAL_NO) {
7077
- if (opts.option?.is_locked_) {
7078
- opts.rowWriter.patchRow(clearedLotFields(keys.materialNoKey), "autofill");
7079
- return { abortLocked: opts.option.id_ };
7080
- }
7081
- const params = resolveLotValidateParams(keys, formData, opts.option);
7082
- if (isBlank(params.material_no_) && isBlank(params.material_no_id_)) return {};
7083
- try {
7084
- await validateReinspectionDate(params);
7085
- } catch (e) {
7086
- opts.rowWriter.patchRow(clearedLotFields(keys.materialNoKey), "async");
7087
- return { abortReinspection: e?.message || String(e) };
7088
- }
7089
- const values = {};
7090
- const productId = opts.option?.product_id_ ?? opts.option?._item?.product_id_;
7091
- if (keys.productKey && !isBlank(productId)) values[keys.productKey] = productId;
7092
- if (keys.bomEntryIdKey && opts.formInstBom) {
7093
- if (!isBlank(productId)) {
7094
- const entry = resolveObjectBomEntry({
7095
- formInstBom: opts.formInstBom,
7096
- belongingObject,
7097
- productId: String(productId)
7098
- });
7099
- if (entry) values[keys.bomEntryIdKey] = entry.id_;
7100
- }
7101
- }
7102
- const patchRelatedFields = () => opts.rowWriter.patchRow(values, "autofill");
7103
- if (keys.productKey && !isBlank(productId)) {
7104
- runWithFillProduct(patchRelatedFields);
7105
- } else {
7106
- patchRelatedFields();
7107
- }
7108
- return {};
7109
- }
7110
- return {};
7111
- }
7112
7042
  function useRuntimeRowState(rowSource) {
7113
7043
  const { formStateStore } = useRuntimeInstanceServices();
7114
7044
  function requireStore() {
@@ -7855,6 +7785,150 @@ function useFormTmplConfig() {
7855
7785
  injectController
7856
7786
  };
7857
7787
  }
7788
+ function isBlank(value) {
7789
+ return value == null || value === "";
7790
+ }
7791
+ function pickPresent(preferred, fallback) {
7792
+ return isBlank(preferred) ? fallback : preferred;
7793
+ }
7794
+ function resolveObjectFieldKeys(opts) {
7795
+ const obj = opts.objectFieldList?.find((item) => item.objectField === opts.belongingObject);
7796
+ const fromList = obj?.subFields ? pickObjectFieldKeys(obj.subFields, opts.belongingObject) : {};
7797
+ const fromFallback = pickObjectFieldKeys(opts.fallbackFields, opts.belongingObject, {
7798
+ requireUsed: false
7799
+ });
7800
+ return {
7801
+ productKey: pickPresent(fromList.productKey, fromFallback.productKey),
7802
+ productFieldName: fromList.productFieldName ?? fromFallback.productFieldName,
7803
+ materialNoKey: pickPresent(fromList.materialNoKey, fromFallback.materialNoKey),
7804
+ materialNoFieldName: fromList.materialNoFieldName ?? fromFallback.materialNoFieldName,
7805
+ qtyKey: pickPresent(fromList.qtyKey, fromFallback.qtyKey),
7806
+ qtyRequiredKey: pickPresent(fromList.qtyRequiredKey, fromFallback.qtyRequiredKey),
7807
+ qtyFieldName: fromList.qtyFieldName ?? fromFallback.qtyFieldName,
7808
+ bomEntryIdKey: pickPresent(fromList.bomEntryIdKey, fromFallback.bomEntryIdKey)
7809
+ };
7810
+ }
7811
+ function buildObjectLotExtraQuery(productId) {
7812
+ if (isBlank(productId)) return {};
7813
+ const versionId = String(productId).split(":").pop();
7814
+ if (!versionId) return {};
7815
+ return { "product_id_.versionEq": versionId };
7816
+ }
7817
+ function clearedLotFields(materialNoKey) {
7818
+ if (!materialNoKey) return {};
7819
+ return {
7820
+ [materialNoKey]: void 0,
7821
+ [`${materialNoKey}_id_`]: void 0,
7822
+ [`${materialNoKey}_lb_`]: void 0
7823
+ };
7824
+ }
7825
+ function shouldClearLotOnProductChange(opts) {
7826
+ const { prevProduct, nextProduct, lotValue } = opts;
7827
+ if (isBlank(prevProduct) && isBlank(nextProduct)) return false;
7828
+ if (prevProduct === nextProduct) return false;
7829
+ if (isBlank(prevProduct) && !isBlank(nextProduct) && !isBlank(lotValue)) {
7830
+ return false;
7831
+ }
7832
+ return true;
7833
+ }
7834
+ let fillingProduct = false;
7835
+ function runWithFillProduct(fn) {
7836
+ fillingProduct = true;
7837
+ try {
7838
+ fn();
7839
+ } finally {
7840
+ nextTick(() => {
7841
+ fillingProduct = false;
7842
+ });
7843
+ }
7844
+ }
7845
+ function resolveLotValidateParams(keys, formData, option) {
7846
+ return {
7847
+ product_id_: option?.product_id_ ?? option?._item?.product_id_ ?? (keys.productKey ? formData[keys.productKey] : void 0),
7848
+ material_no_: option?.name_ ?? option?.__VALUE__ ?? (keys.materialNoKey ? formData[keys.materialNoKey] : void 0),
7849
+ material_no_id_: option?.id_ ?? (keys.materialNoKey ? formData[`${keys.materialNoKey}_id_`] : void 0)
7850
+ };
7851
+ }
7852
+ async function applyConsumeObjectTraceChange(opts) {
7853
+ const { belongingObject, role, formData } = opts;
7854
+ if (!belongingObject || !formData) return {};
7855
+ const keys = resolveObjectFieldKeys({
7856
+ belongingObject,
7857
+ objectFieldList: opts.objectFieldList,
7858
+ fallbackFields: opts.fallbackFields
7859
+ });
7860
+ if (role === FIELD_TYPE.PRODUCT) {
7861
+ if (!("prevProduct" in opts) || fillingProduct) return {};
7862
+ const values = {};
7863
+ if (shouldClearLotOnProductChange({
7864
+ prevProduct: opts.prevProduct,
7865
+ nextProduct: opts.nextValue,
7866
+ lotValue: keys.materialNoKey ? formData[keys.materialNoKey] : void 0
7867
+ })) {
7868
+ Object.assign(values, clearedLotFields(keys.materialNoKey));
7869
+ }
7870
+ if (keys.bomEntryIdKey) {
7871
+ values[keys.bomEntryIdKey] = null;
7872
+ if (!isBlank(opts.nextValue) && opts.formInstBom) {
7873
+ const entry = resolveObjectBomEntry({
7874
+ formInstBom: opts.formInstBom,
7875
+ belongingObject,
7876
+ productId: String(opts.nextValue)
7877
+ });
7878
+ if (entry) values[keys.bomEntryIdKey] = entry.id_;
7879
+ }
7880
+ }
7881
+ opts.rowWriter.patchRow(values, "autofill");
7882
+ const lotValue = keys.materialNoKey ? formData[keys.materialNoKey] : void 0;
7883
+ if (!isBlank(opts.nextValue) && !isBlank(lotValue)) {
7884
+ try {
7885
+ await validateReinspectionDate({
7886
+ product_id_: String(opts.nextValue),
7887
+ material_no_: lotValue,
7888
+ material_no_id_: keys.materialNoKey ? formData[`${keys.materialNoKey}_id_`] : void 0
7889
+ });
7890
+ } catch (e) {
7891
+ return { abortReinspection: e?.message || String(e) };
7892
+ }
7893
+ }
7894
+ return {};
7895
+ }
7896
+ if (role === FIELD_TYPE.MATERIAL_NO) {
7897
+ if (opts.option?.is_locked_) {
7898
+ opts.rowWriter.patchRow(clearedLotFields(keys.materialNoKey), "autofill");
7899
+ return { abortLocked: opts.option.id_ };
7900
+ }
7901
+ const params = resolveLotValidateParams(keys, formData, opts.option);
7902
+ if (isBlank(params.material_no_) && isBlank(params.material_no_id_)) return {};
7903
+ try {
7904
+ await validateReinspectionDate(params);
7905
+ } catch (e) {
7906
+ opts.rowWriter.patchRow(clearedLotFields(keys.materialNoKey), "async");
7907
+ return { abortReinspection: e?.message || String(e) };
7908
+ }
7909
+ const values = {};
7910
+ const productId = opts.option?.product_id_ ?? opts.option?._item?.product_id_;
7911
+ if (keys.productKey && !isBlank(productId)) values[keys.productKey] = productId;
7912
+ if (keys.bomEntryIdKey && opts.formInstBom) {
7913
+ if (!isBlank(productId)) {
7914
+ const entry = resolveObjectBomEntry({
7915
+ formInstBom: opts.formInstBom,
7916
+ belongingObject,
7917
+ productId: String(productId)
7918
+ });
7919
+ if (entry) values[keys.bomEntryIdKey] = entry.id_;
7920
+ }
7921
+ }
7922
+ const patchRelatedFields = () => opts.rowWriter.patchRow(values, "autofill");
7923
+ if (keys.productKey && !isBlank(productId)) {
7924
+ runWithFillProduct(patchRelatedFields);
7925
+ } else {
7926
+ patchRelatedFields();
7927
+ }
7928
+ return {};
7929
+ }
7930
+ return {};
7931
+ }
7858
7932
  const _hoisted_1$5 = ["data-merge", "data-fill-direction"];
7859
7933
  const _hoisted_2$1 = {
7860
7934
  key: 0,
@@ -8175,6 +8249,7 @@ const DocumentSubTable = /* @__PURE__ */ defineComponent({
8175
8249
  showDisplayStatus,
8176
8250
  dataRelationShip
8177
8251
  } = useWidgetStaticAttrs(props.widget);
8252
+ const isMockMaterialConsume = computed(() => !!dataRelationShip?.isMockReport && !!props.widget.props.isMaterialConsumeTable);
8178
8253
  const sheetId = () => fields.value?.findWidgetById(props.widget.id)?.sheetId;
8179
8254
  const subTableCore = props.subTableCore;
8180
8255
  provide(NCB_PROVIDE.SUB_TABLE_CORE, subTableCore);
@@ -8315,6 +8390,9 @@ const DocumentSubTable = /* @__PURE__ */ defineComponent({
8315
8390
  key,
8316
8391
  actionValue
8317
8392
  }) => {
8393
+ if (isMockMaterialConsume.value && (key === SubTableActionEnum.SCAN || key === SubTableActionEnum.Insert1GroupAfter)) {
8394
+ return;
8395
+ }
8318
8396
  switch (key) {
8319
8397
  case "insertRowBefore":
8320
8398
  handleAddRow({
@@ -8408,10 +8486,11 @@ const DocumentSubTable = /* @__PURE__ */ defineComponent({
8408
8486
  showRowWatermark,
8409
8487
  rowGroupKey
8410
8488
  }) => {
8411
- const menus = subTableCore?.calcSubTableActionMenu({
8489
+ const baseMenus = subTableCore?.calcSubTableActionMenu({
8412
8490
  rowData,
8413
8491
  showDelBtn
8414
8492
  });
8493
+ const menus = isMockMaterialConsume.value ? [getMenuByAction(SubTableActionEnum.SCAN), getMenuByAction(SubTableActionEnum.Insert1GroupAfter), ...baseMenus ?? []] : baseMenus;
8415
8494
  const annRowDetails = dataRelationShip?.annRowDetails;
8416
8495
  const rowMark = dataIdx !== -1 && annRowDetails?.length ? resolveRowFormChangeMark(field, rowData, annRowDetails) : null;
8417
8496
  const rowUi = resolveFormChangeRowUi(rowData, rowMark);
@@ -8724,7 +8803,7 @@ const MaterialConsumeTable = /* @__PURE__ */ defineComponent({
8724
8803
  const {
8725
8804
  showDisplayStatus,
8726
8805
  dataRelationShip
8727
- } = useWidgetStaticAttrs(props);
8806
+ } = useWidgetStaticAttrs(props.widget);
8728
8807
  const sheetId = () => fields.value?.findWidgetById(props.widget.id)?.sheetId;
8729
8808
  const formModelController = useFormModel().injectController();
8730
8809
  const tableController = props.tableController;
@@ -8913,6 +8992,7 @@ const MaterialConsumeTable = /* @__PURE__ */ defineComponent({
8913
8992
  }));
8914
8993
  };
8915
8994
  const handleAction = (action, rowData) => {
8995
+ if (!tableController.hasFormInstance) return;
8916
8996
  switch (action) {
8917
8997
  case MaterialConsumeActionType.CONFIRM:
8918
8998
  tableController.confirm(rowData);
@@ -8985,6 +9065,7 @@ const MaterialConsumeTable = /* @__PURE__ */ defineComponent({
8985
9065
  key,
8986
9066
  actionValue
8987
9067
  }) => {
9068
+ if (!tableController.hasFormInstance) return;
8988
9069
  switch (key) {
8989
9070
  case "rowEdit":
8990
9071
  await tableController.editRow(rowData);
@@ -9355,7 +9436,7 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
9355
9436
  createElementVNode("i", { class: "iconfont icon-zhuyi" }),
9356
9437
  createElementVNode("ul", { class: "tips-list" }, [
9357
9438
  createElementVNode("li", null, "可将Excel内容粘贴到表格中,支持使用复制、粘贴、删除快捷键"),
9358
- createElementVNode("li", null, " 表单中支持快速填报的字段类型:文本、长文本、整数、长整数、小数、精度小数、日期、时间、日期时间、LOT/SN、报废物料批次、枚举单选、枚举多选(选项间以“,”分割) ")
9439
+ createElementVNode("li", null, " 表单中支持快速填报的字段类型:文本、长文本、整数、长整数、小数、精度小数、日期、时间、日期时间、批次/SN、报废物料批次、枚举单选、枚举多选(选项间以“,”分割) ")
9359
9440
  ])
9360
9441
  ], -1)),
9361
9442
  createElementVNode("div", {
@@ -9380,7 +9461,7 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
9380
9461
  };
9381
9462
  }
9382
9463
  });
9383
- const FixedQuickFillModal = /* @__PURE__ */ _export_sfc(_sfc_main$4, [["__scopeId", "data-v-b589958f"]]);
9464
+ const FixedQuickFillModal = /* @__PURE__ */ _export_sfc(_sfc_main$4, [["__scopeId", "data-v-58540cb3"]]);
9384
9465
  const _hoisted_1$1 = {
9385
9466
  key: 1,
9386
9467
  class: "sub-table-action__subtitle"
@@ -10082,7 +10163,7 @@ const DocumentPaper = /* @__PURE__ */ defineComponent({
10082
10163
  }) : null,
10083
10164
  // 在[固定表]顶部的可见单元格上加装操作按钮
10084
10165
  tableAction: (() => {
10085
- const fixedTableActionVisible = fixedTableInfo?.quickFillVisible && !filledFixedTableKeys.value.includes(fixedTableInfo.subFieldKey);
10166
+ const fixedTableActionVisible = props.basicInfo.renderModeType !== RenderModeEnum.ViewMode && fixedTableInfo?.quickFillVisible && !filledFixedTableKeys.value.includes(fixedTableInfo.subFieldKey);
10086
10167
  return () => fixedTableActionVisible ? createVNode(_sfc_main$2, {
10087
10168
  "tdId": tdId,
10088
10169
  "formState": formState.value,
@@ -10153,7 +10234,7 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
10153
10234
  createElementVNode("i", { class: "iconfont icon-zhuyi" }),
10154
10235
  createElementVNode("ul", { class: "tips-list" }, [
10155
10236
  createElementVNode("li", null, "可将Excel内容粘贴到表格中,支持使用复制、粘贴、删除快捷键"),
10156
- createElementVNode("li", null, "表单中支持快速填报的字段类型:文本、长文本、整数、长整数、小数、精度小数、日期、时间、日期时间、LOT/SN、报废物料批次、枚举单选、枚举多选(选项间以“,”分割)"),
10237
+ createElementVNode("li", null, "表单中支持快速填报的字段类型:文本、长文本、整数、长整数、小数、精度小数、日期、时间、日期时间、批次/SN、报废物料批次、枚举单选、枚举多选(选项间以“,”分割)"),
10157
10238
  createElementVNode("li", null, "当前快速填报最多支持200行")
10158
10239
  ])
10159
10240
  ], -1)),
@@ -10173,7 +10254,7 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
10173
10254
  };
10174
10255
  }
10175
10256
  });
10176
- const DynamicQuickFillModal = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["__scopeId", "data-v-ae9acd3f"]]);
10257
+ const DynamicQuickFillModal = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["__scopeId", "data-v-840aca0a"]]);
10177
10258
  const _sfc_main = /* @__PURE__ */ defineComponent({
10178
10259
  __name: "dynamic-table-action",
10179
10260
  props: {
@@ -10257,109 +10338,112 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
10257
10338
  });
10258
10339
  const DynamicTableAction = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-53d7e66c"]]);
10259
10340
  export {
10260
- closeValidatorPopovers as $,
10261
- useFieldPresentation as A,
10341
+ RuntimeSheetService as $,
10342
+ useStyles as A,
10262
10343
  BorderTD as B,
10263
- useRuntimeEditorFlusher as C,
10344
+ useDependency as C,
10264
10345
  DEFAULT_BOOLEAN_FIELD_WIDTH as D,
10265
10346
  EMPTY_PRODUCT_VERSION_ID as E,
10266
- createRuntimeInstanceContext as F,
10267
- RuntimeInstanceRegistry as G,
10268
- RequiredQtyCalcRule as H,
10269
- registerFormulaFuncs as I,
10270
- DocumentPaper as J,
10271
- DynamicTableAction as K,
10272
- getRuntimeDataFieldId as L,
10273
- MULTI_SHEET_SCHEMA_VERSION as M,
10347
+ useFieldPresentation as F,
10348
+ useRuntimeEditorFlusher as G,
10349
+ createRuntimeInstanceContext as H,
10350
+ RuntimeInstanceRegistry as I,
10351
+ RequiredQtyCalcRule as J,
10352
+ registerFormulaFuncs as K,
10353
+ DocumentPaper as L,
10354
+ MAX_RUNTIME_SHEETS as M,
10274
10355
  NCB_PROVIDE as N,
10275
- buildRuntimeFieldPath as O,
10276
- resolveRuntimeFieldProps as P,
10277
- resolveRuntimeFieldState as Q,
10356
+ DynamicTableAction as O,
10357
+ getRuntimeDataFieldId as P,
10358
+ buildRuntimeFieldPath as Q,
10278
10359
  RuntimeFormStateStore as R,
10279
10360
  ScanParamType as S,
10280
- getRuntimeDependencyOutputKey as T,
10281
- isRowAddedInCurrentFormChange as U,
10282
- MaterialConsumeTableController as V,
10283
- setFormulaParamsConfig as W,
10284
- normalizeRuntime as X,
10285
- RuntimeSheetService as Y,
10286
- validateObjectBomQtyOnSubmit as Z,
10361
+ resolveRuntimeFieldProps as T,
10362
+ resolveRuntimeFieldState as U,
10363
+ getRuntimeDependencyOutputKey as V,
10364
+ isRowAddedInCurrentFormChange as W,
10365
+ MaterialConsumeTableController as X,
10366
+ setFormulaParamsConfig as Y,
10367
+ normalizeRuntime as Z,
10287
10368
  _sfc_main$5 as _,
10288
- normalizeHistoricalBusinessRow as a,
10289
- enrichFormChangeRowDetails as a0,
10290
- useMaterialBalance as a1,
10291
- collectFormChangeFieldLocations as a2,
10292
- nextFormChangeRowViewHistoryId as a3,
10293
- DeviceConnector as a4,
10294
- DocumentLoading as a5,
10295
- DynamicQuickFillModal as a6,
10296
- FixedQuickFillModal as a7,
10297
- FormTmplConfigController as a8,
10298
- LEGACY_RUNTIME_FORM_CONFIG_KEYS as a9,
10299
- resolveFormChangeRowUi as aA,
10300
- resolveRowFormChangeMark as aB,
10301
- setSelectMobileTdId as aC,
10302
- stripLegacyFormConfigFromPaper as aD,
10303
- SubTableActionMenuTypeEnum as aE,
10304
- getMenuByAction as aF,
10305
- SubTableActionEnum as aG,
10306
- resolveScanFillData as aH,
10307
- getInsertSubMenu as aI,
10308
- resolveScanAdjustType as aJ,
10309
- resolveScanQty as aK,
10310
- toDateOnly as aL,
10311
- getCopySubMenu as aM,
10312
- resolveScanParsedValue as aN,
10313
- isProductBatchEmptyRow as aO,
10314
- LEGACY_RUNTIME_SHEET_ID as aa,
10315
- LEGACY_RUNTIME_SHEET_TITLE as ab,
10316
- MCDataUtil as ac,
10317
- OCR_MODEL_PRECISION_ENUM_KEY as ad,
10318
- RuntimeAsyncTaskCoordinator as ae,
10319
- RuntimeDependencyService as af,
10320
- RuntimeFieldRegistry as ag,
10321
- RuntimeInstanceEventBus as ah,
10322
- RuntimePersistenceCoordinator as ai,
10323
- RuntimeValidationService as aj,
10324
- SubTableCore as ak,
10325
- buildFormChangeDisplayRows as al,
10326
- convertV1Runtime as am,
10327
- detailsHaveFormChangeRowOps as an,
10328
- extractFormChangeRowDetails as ao,
10329
- getFormChangeRowKey as ap,
10330
- getFormChangeRowOp as aq,
10331
- getSubTableQuickFillInfo as ar,
10332
- isAnnLocationSelected as as,
10333
- isBlank as at,
10334
- isFormChangeGhostRow as au,
10335
- normalizeHistoricalFieldConfig as av,
10336
- pickObjectFieldKeys as aw,
10337
- recordSubtableRowAdd as ax,
10338
- recordSubtableRowDelete as ay,
10339
- resolveAnnotationFieldLocation as az,
10340
- DeviceLinkTmplUtil as b,
10369
+ MAX_RUNTIME_SHEET_TITLE_LENGTH as a,
10370
+ validateObjectBomQtyOnSubmit as a0,
10371
+ closeValidatorPopovers as a1,
10372
+ enrichFormChangeRowDetails as a2,
10373
+ useMaterialBalance as a3,
10374
+ collectFormChangeFieldLocations as a4,
10375
+ nextFormChangeRowViewHistoryId as a5,
10376
+ DeviceConnector as a6,
10377
+ DocumentLoading as a7,
10378
+ DynamicQuickFillModal as a8,
10379
+ FixedQuickFillModal as a9,
10380
+ recordSubtableRowDelete as aA,
10381
+ resolveAnnotationFieldLocation as aB,
10382
+ resolveFormChangeRowUi as aC,
10383
+ resolveRowFormChangeMark as aD,
10384
+ setSelectMobileTdId as aE,
10385
+ stripLegacyFormConfigFromPaper as aF,
10386
+ SubTableActionMenuTypeEnum as aG,
10387
+ getMenuByAction as aH,
10388
+ SubTableActionEnum as aI,
10389
+ resolveScanFillData as aJ,
10390
+ getInsertSubMenu as aK,
10391
+ resolveScanAdjustType as aL,
10392
+ resolveScanQty as aM,
10393
+ toDateOnly as aN,
10394
+ hasSubtableBusinessData as aO,
10395
+ getCopySubMenu as aP,
10396
+ resolveScanParsedValue as aQ,
10397
+ isProductBatchEmptyRow as aR,
10398
+ FormTmplConfigController as aa,
10399
+ LEGACY_RUNTIME_FORM_CONFIG_KEYS as ab,
10400
+ LEGACY_RUNTIME_SHEET_ID as ac,
10401
+ LEGACY_RUNTIME_SHEET_TITLE as ad,
10402
+ MCDataUtil as ae,
10403
+ OCR_MODEL_PRECISION_ENUM_KEY as af,
10404
+ RuntimeAsyncTaskCoordinator as ag,
10405
+ RuntimeDependencyService as ah,
10406
+ RuntimeFieldRegistry as ai,
10407
+ RuntimeInstanceEventBus as aj,
10408
+ RuntimePersistenceCoordinator as ak,
10409
+ RuntimeValidationService as al,
10410
+ SubTableCore as am,
10411
+ buildFormChangeDisplayRows as an,
10412
+ convertV1Runtime as ao,
10413
+ detailsHaveFormChangeRowOps as ap,
10414
+ extractFormChangeRowDetails as aq,
10415
+ getFormChangeRowKey as ar,
10416
+ getFormChangeRowOp as as,
10417
+ getSubTableQuickFillInfo as at,
10418
+ isAnnLocationSelected as au,
10419
+ isBlank as av,
10420
+ isFormChangeGhostRow as aw,
10421
+ normalizeHistoricalFieldConfig as ax,
10422
+ pickObjectFieldKeys as ay,
10423
+ recordSubtableRowAdd as az,
10424
+ MULTI_SHEET_SCHEMA_VERSION as b,
10341
10425
  createRuntimeDocumentV2 as c,
10342
- normalizeAIOcrTmpl as d,
10343
- useWidgetStaticAttrs as e,
10344
- useRuntimeInstanceServices as f,
10426
+ normalizeHistoricalBusinessRow as d,
10427
+ DeviceLinkTmplUtil as e,
10428
+ normalizeAIOcrTmpl as f,
10345
10429
  getBusinessFieldKey as g,
10346
- setSelectAnnotationId as h,
10347
- useRuntimeRowState as i,
10348
- getObjectBomMaterialLotQuery as j,
10349
- buildObjectLotExtraQuery as k,
10350
- MaterialConsumptionPatternEnum as l,
10351
- resolveObjectBomEntry as m,
10430
+ useWidgetStaticAttrs as h,
10431
+ useRuntimeInstanceServices as i,
10432
+ setSelectAnnotationId as j,
10433
+ useRuntimeRowState as k,
10434
+ getObjectBomMaterialLotQuery as l,
10435
+ buildObjectLotExtraQuery as m,
10352
10436
  normalizeFieldWidth as n,
10353
- runWithFillProduct as o,
10354
- useNocodeFormWidget as p,
10355
- applyConsumeObjectTraceChange as q,
10437
+ MaterialConsumptionPatternEnum as o,
10438
+ resolveObjectBomEntry as p,
10439
+ runWithFillProduct as q,
10356
10440
  resolveObjectFieldKeys as r,
10357
10441
  setSelectValidatorId as s,
10358
- getObjectBomProductQuery as t,
10442
+ useNocodeFormWidget as t,
10359
10443
  useFormTmplConfig as u,
10360
10444
  validateObjectBomForScan as v,
10361
- normalizeHistoricalAutofillRow as w,
10362
- parseRuntimeFieldPath as x,
10363
- useStyles as y,
10364
- useDependency as z
10445
+ applyConsumeObjectTraceChange as w,
10446
+ getObjectBomProductQuery as x,
10447
+ normalizeHistoricalAutofillRow as y,
10448
+ parseRuntimeFieldPath as z
10365
10449
  };