@gct-paas/excel 0.1.40-beta.6 → 0.1.40-beta.8

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 (108) hide show
  1. package/dist/{BaseComponent-Dfx-Xuv4.js → BaseComponent-CELRDc47.js} +2 -2
  2. package/dist/{VueVideoPlayer-DHqhqgGs.js → VueVideoPlayer-CQ3WMohj.js} +2 -2
  3. package/dist/{align-editor-hvllGvX8.js → align-editor-BjxHuSxl.js} +1 -1
  4. package/dist/{barcode-design-CzlfYJ3s.js → barcode-design-BDHtEF3j.js} +2 -2
  5. package/dist/base/index.es.js +265 -109
  6. package/dist/{diagonal-design-DCVidBZD.js → diagonal-design-DLxRO_uM.js} +2 -2
  7. package/dist/{dynamic-table-action-Dn_iw4tV.js → dynamic-table-action-C_1EGXMe.js} +153 -148
  8. package/dist/{dynamic-table-action.vue_vue_type_style_index_0_scoped_53d7e66c_lang-Cz-fpECL.js → dynamic-table-action.vue_vue_type_style_index_0_scoped_53d7e66c_lang-B7k5famp.js} +544 -495
  9. package/dist/{edit.utils-CXmmCnxE-BUEfsAZ3.js → edit.utils-CXmmCnxE-C1w2rhHM.js} +1 -1
  10. package/dist/excel.css +16 -16
  11. package/dist/{exceljs.min-9FX7NALn.js → exceljs.min-rIUD8u2M.js} +2 -2
  12. package/dist/{font-editor-ClqMOFPr.js → font-editor-DWmzS_0C.js} +3 -3
  13. package/dist/{image-design-Cx1YIea4.js → image-design-Cjob0qMO.js} +2 -2
  14. package/dist/{index-BKnroXXX.js → index--kolAY9o.js} +3 -3
  15. package/dist/{index-mCrtpdq2.js → index-2X2QGo0A.js} +255 -85
  16. package/dist/{index-Cj_t_73x.js → index-B9a9T8if.js} +1 -1
  17. package/dist/{index-DCv60fUG.js → index-BHxDpc-C.js} +2 -2
  18. package/dist/{index-a6chYhIK.js → index-BLpDtBBv.js} +2 -2
  19. package/dist/{index-D7ZzvopL.js → index-BeYN1fxt.js} +2 -2
  20. package/dist/{index-D4zDlgqU.js → index-BgsXETEd.js} +1 -1
  21. package/dist/{index-lf11EIvP.js → index-BlLeFC1A.js} +2 -2
  22. package/dist/{index-DkXBzlUL.js → index-Bn5H-iFV.js} +2 -2
  23. package/dist/{index-Dp2q7ZPo.js → index-Bw67kX4Y.js} +2 -2
  24. package/dist/{index-BkoKoZbl.js → index-ByeVrxVl.js} +1 -1
  25. package/dist/{index-BjSWHyj1.js → index-BzBMhjxB.js} +1 -1
  26. package/dist/{index-BRc6frrP.js → index-C-F1u_o7.js} +2 -2
  27. package/dist/{index-BLrixMsM.js → index-CAekmaIN.js} +2 -2
  28. package/dist/{index-BgzCdSQH.js → index-CHS101Sz.js} +3 -3
  29. package/dist/{index-BWHnHAjs.js → index-CIkhaEj4.js} +1 -1
  30. package/dist/{index-NJZaG-sl.js → index-CQ0BwWRP.js} +2 -2
  31. package/dist/{index-CVG3Z6rp.js → index-CQkWk_7M.js} +3 -3
  32. package/dist/{index-CjCFTTI3.js → index-CfyXGhk3.js} +1 -1
  33. package/dist/{index-BM1sPB29.js → index-Cn2_Yd7q.js} +1 -1
  34. package/dist/{index-DYyVGkv3.js → index-DJj0H4QE.js} +2 -2
  35. package/dist/{index-Cl_94fZQ.js → index-DMOi4nAC.js} +2 -2
  36. package/dist/{index-B9xwdsWY.js → index-DQNLZ671.js} +4 -4
  37. package/dist/{index-CG5LAGQp.js → index-DdxuhIJY.js} +2 -2
  38. package/dist/{index-NqYSNDX9.js → index-DiNxihKr.js} +2 -2
  39. package/dist/{index-Dru8lW-_.js → index-DqomTxsG.js} +1 -1
  40. package/dist/{index-CcB9d0A-.js → index-DxW-5l6p.js} +2 -2
  41. package/dist/{index-B3KkYxiX.js → index-DxaR4DCk.js} +2 -2
  42. package/dist/{index-CWjwF2wn.js → index-LOpDQbHn.js} +2 -2
  43. package/dist/{index-COmm7d4j.js → index-RV5ozdPP.js} +1 -1
  44. package/dist/{index-q_pMlfx9.js → index-Refavqkv.js} +3 -3
  45. package/dist/{index-vEKEZcff.js → index-U90xa0_k.js} +2 -2
  46. package/dist/{index-B4c_0M_d.js → index-nGGsFW_9.js} +2 -2
  47. package/dist/{index-BdYI71iy.js → index-poil0x4K.js} +2 -2
  48. package/dist/{index-CyPwg8fV.js → index-w6agN1-G.js} +1 -1
  49. package/dist/index.es.js +2 -2
  50. package/dist/{mb-render-DjSdDuaL.js → mb-render-wAlqnYW9.js} +1 -1
  51. package/dist/{online-form-model-select.vue_vue_type_script_setup_true_name_online-form-model-select_lang-QrM7rL99.js → online-form-model-select.vue_vue_type_script_setup_true_name_online-form-model-select_lang-BLEHWjXh.js} +1 -1
  52. package/dist/{pagination-design-DJEw5vlL.js → pagination-design-CuM2_cOO.js} +2 -2
  53. package/dist/paper-widget-design-OVR0zocz.js +4 -0
  54. package/dist/{print-runtime-instance-BtxZfq51.js → print-runtime-instance-xGsbD9K-.js} +1 -1
  55. package/dist/{print-snapshot-renderer-0D5MUsR6.js → print-snapshot-renderer-DYUY1xCI.js} +3 -3
  56. package/dist/{qrcode-design-9jPH-S8z.js → qrcode-design-CO631M71.js} +1 -1
  57. package/dist/{revo-grid.entry-BhCFcCVS.js → revo-grid.entry-B7SWMhl1.js} +1 -1
  58. package/dist/{revogr-attribution_7.entry-icpuI3V8.js → revogr-attribution_7.entry-BkqynH6l.js} +3 -3
  59. package/dist/{revogr-clipboard_3.entry-Dm2_h2RL.js → revogr-clipboard_3.entry-DAHR-Vx9.js} +2 -2
  60. package/dist/{revogr-data_4.entry-DlVEyI7J.js → revogr-data_4.entry-CVh6lcCy.js} +2 -2
  61. package/dist/{revogr-filter-panel.entry-MJr7PMnd.js → revogr-filter-panel.entry-BBhV4Xqa.js} +1 -1
  62. package/dist/seal-design-BnXd0buM.js +4 -0
  63. package/dist/{serialnumber-design-BsfJH6Kp.js → serialnumber-design-DxGYVdk3.js} +1 -1
  64. package/dist/shared/index.es.js +9 -9
  65. package/dist/{single-field-drop-DXjppxDh.js → single-field-drop-DpHqYP0Z.js} +2 -2
  66. package/dist/{size-editor-DzQdRb-7.js → size-editor-D0jQ3Lrf.js} +1 -1
  67. package/dist/src/domain/document-business/business/product-release/profile.d.ts +2 -0
  68. package/dist/src/domain/document-business/business/product-release/service.d.ts +2 -0
  69. package/dist/src/domain/document-business/index.d.ts +2 -0
  70. package/dist/src/domain/document-business/registry.d.ts +2 -0
  71. package/dist/src/domain/document-business/runtime/field-query-runtime.d.ts +4 -0
  72. package/dist/src/domain/document-business/types.d.ts +24 -0
  73. package/dist/src/domain/field/number/product-release-qty-manifest.d.ts +2 -0
  74. package/dist/src/domain/field/query-filter.d.ts +15 -0
  75. package/dist/src/domain/table/business/material/material-substitution/profile/field-keys.d.ts +13 -11
  76. package/dist/src/domain/table/business/material/material-substitution/runtime/select-loaders.d.ts +8 -0
  77. package/dist/src/nocode-base/src/core/sub-table/profile-driven-sub-table-core.d.ts +3 -3
  78. package/dist/src/nocode-base/src/hooks/material-consume-object/bom-validator.d.ts +4 -3
  79. package/dist/src/nocode-base/src/hooks/material-consume-object/object-validation-controller.d.ts +24 -0
  80. package/dist/src/nocode-base/src/hooks/render-page/initialize-runtime.d.ts +1 -0
  81. package/dist/src/nocode-base/src/hooks/useRenderPageFactory.d.ts +3 -0
  82. package/dist/src/nocode-base/src/interface/ref-loader.d.ts +12 -1
  83. package/dist/src/nocode-base/src/types/common/base.d.ts +2 -0
  84. package/dist/src/online-form/src/views/__cell_widgets__/common/display-fields-editor/display-fields.util.d.ts +2 -2
  85. package/dist/src/online-form/src/views/designer/constants/index.d.ts +1 -0
  86. package/dist/src/shared/enum/field-type.d.ts +7 -0
  87. package/dist/src/shared/utils/withRequestCache.d.ts +27 -0
  88. package/dist/{sub-table-factory-Ddx70uYs.js → sub-table-factory-dhsoO5eF.js} +194 -85
  89. package/dist/{text-design-DmLrMqdk.js → text-design-CCJVszh9.js} +2 -2
  90. package/dist/{throttle-Cpk1LoGk-DLVGpnFw.js → throttle-Cpk1LoGk-D7Z-44El.js} +1 -1
  91. package/dist/{timediff-design-CYqz1SKQ.js → timediff-design-DE0Lb5-J.js} +1 -1
  92. package/dist/{trace-like-wrapper-CVl0Vm8r.js → trace-like-wrapper-u1qMVyxo.js} +2 -2
  93. package/dist/{value-editor.vue_vue_type_style_index_0_lang-B0aWEk5D.js → value-editor.vue_vue_type_style_index_0_lang-BDK70sFY.js} +2 -2
  94. package/dist/web-render/index.es.js +3 -3
  95. package/dist/{widget-barcode-DwYihxgd.js → widget-barcode-BiqBkpJf.js} +4 -4
  96. package/dist/{widget-diagonal-DWdxDYVl.js → widget-diagonal-DEPOR_xL.js} +3 -3
  97. package/dist/{widget-image-D1SXIbMU.js → widget-image-CT0b6oE3.js} +5 -5
  98. package/dist/{widget-line-BNTbSFkx.js → widget-line-CencIyCA.js} +2 -2
  99. package/dist/{widget-pagination-25CKNe-i.js → widget-pagination-CLokA4N9.js} +5 -5
  100. package/dist/{widget-power-BSjWdgM3.js → widget-power-BPxteor_.js} +3 -3
  101. package/dist/{widget-qrcode-Kbe9Skrd.js → widget-qrcode-gYHAR233.js} +3 -3
  102. package/dist/{widget-rangelimit-TWPoG8DX.js → widget-rangelimit-BJKYDkcT.js} +3 -3
  103. package/dist/{widget-serialnumber-uNkQzBIT.js → widget-serialnumber-BCPB7hqo.js} +1 -1
  104. package/dist/{widget-text-DH4r60jo.js → widget-text-D_CGo-mQ.js} +5 -5
  105. package/dist/{widget-timediff-Bv8VCgrv.js → widget-timediff-cBekBImJ.js} +2 -2
  106. package/package.json +1 -1
  107. package/dist/paper-widget-design-C3rm4SzP.js +0 -4
  108. package/dist/seal-design-CtzWGxnH.js +0 -4
@@ -1,11 +1,11 @@
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 { aj as CellWidgetViewState, F as FIELD_TYPE, b9 as RenderModeEnum, Z as FormTypeEnum, bF as BpmnNodeTypeEnum, cy as getFieldPlaceholder, bX as MobileFillTypeEnum, C as ComponentTypeEnum, a0 as PlatformEnum, cz as isReferenceOptionActive, p as api, bv as uuid2, c5 as calcUtils, bk as findRuntimeTableRow, c9 as ensureTableRowKeys, c2 as bindRuntimeTableColumns, bj as getRowId, cA as FRONT_ROW_KEY, co as isTableRowKeyMatch, bx as isAttachFieldActive, cB as filterRulesByTrigger, cC as isEmptyValue$1, c6 as decodeTableCellRowKey, c8 as ensureFrontRowKey, b1 as getParseRuleInfo, aH as transformUtils, aY as materialCheck, aZ as getLotLockedReason, a_ as validateReinspectionDate, bo as FormulaRuleFieldKeyEnum, h as SubTableType, b2 as getParseRuleValue, cD as buildError, I as CreateType, bm as findRuntimeParentRow, aK as Dependency_ENUM, aJ as ASSIGNMENTSTRATEGY_ENUM, bK as commonUtils, aO as DeviceLink, a9 as _export_sfc, ci as getRenderedRuntimeTableCell, A as CellType, cs as relocateDeletedRowsToEnd, cE as resetTableRowIdentity, K as useModal, cF as q, cG as QUICK_FILL_ALLOWED_FIELDS, cH as groupFixedTableRows, cI as processQuickFillRows, cJ as getIsGroupEmpty } from "./dynamic-table-action.vue_vue_type_style_index_0_scoped_53d7e66c_lang-Cz-fpECL.js";
2
+ import { aj as CellWidgetViewState, F as FIELD_TYPE, ba as RenderModeEnum, Z as FormTypeEnum, bG as BpmnNodeTypeEnum, cz as getFieldPlaceholder, bY as MobileFillTypeEnum, C as ComponentTypeEnum, a0 as PlatformEnum, cA as isReferenceOptionActive, p as api, bw as uuid2, c6 as calcUtils, bl as findRuntimeTableRow, ca as ensureTableRowKeys, c3 as bindRuntimeTableColumns, bk as getRowId, cB as FRONT_ROW_KEY, cp as isTableRowKeyMatch, by as isAttachFieldActive, cC as filterRulesByTrigger, cD as isEmptyValue$1, c7 as decodeTableCellRowKey, c9 as ensureFrontRowKey, b2 as getParseRuleInfo, aH as transformUtils, aZ as materialCheck, a_ as getLotLockedReason, a$ as validateReinspectionDate, bp as FormulaRuleFieldKeyEnum, h as SubTableType, b3 as getParseRuleValue, cE as buildError, I as CreateType, bn as findRuntimeParentRow, aK as Dependency_ENUM, aJ as ASSIGNMENTSTRATEGY_ENUM, bL as commonUtils, aO as DeviceLink, a9 as _export_sfc, cj as getRenderedRuntimeTableCell, A as CellType, ct as relocateDeletedRowsToEnd, cF as resetTableRowIdentity, K as useModal, cG as q, cH as QUICK_FILL_ALLOWED_FIELDS, cI as groupFixedTableRows, cJ as processQuickFillRows, cK as getIsGroupEmpty } from "./dynamic-table-action.vue_vue_type_style_index_0_scoped_53d7e66c_lang-B7k5famp.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 "@gct-paas/form-base";
7
7
  import { Modal, message } from "ant-design-vue";
8
- import { u as useFormModel } from "./mb-render-DjSdDuaL.js";
8
+ import { u as useFormModel } from "./mb-render-wAlqnYW9.js";
9
9
  var MaterialConsumptionPatternEnum = /* @__PURE__ */ ((MaterialConsumptionPatternEnum2) => {
10
10
  MaterialConsumptionPatternEnum2["RECORD"] = "record";
11
11
  MaterialConsumptionPatternEnum2["BOM"] = "bom";
@@ -7065,7 +7065,7 @@ async function validateObjectBomQtyOnSubmit(opts) {
7065
7065
  for (const obj of objectFieldList) {
7066
7066
  if (!obj?.objectField) continue;
7067
7067
  const objectBom = findObjectBom(formInstBom, obj.objectField);
7068
- if (objectBom?.material_consumption_pattern_ === MaterialConsumptionPatternEnum.RECORD) {
7068
+ if (objectBom?.material_consumption_pattern_ === MaterialConsumptionPatternEnum.RECORD && !objectBom.personal_bom_enabled_) {
7069
7069
  continue;
7070
7070
  }
7071
7071
  const { productKey, productFieldName, qtyKey, qtyRequiredKey, qtyFieldName } = pickObjectFieldKeys(obj.subFields, obj.objectField);
@@ -7126,150 +7126,6 @@ async function validateObjectBomQtyOnSubmit(opts) {
7126
7126
  }
7127
7127
  return errors;
7128
7128
  }
7129
- function isBlank(value) {
7130
- return value == null || value === "";
7131
- }
7132
- function pickPresent(preferred, fallback) {
7133
- return isBlank(preferred) ? fallback : preferred;
7134
- }
7135
- function resolveObjectFieldKeys(opts) {
7136
- const obj = opts.objectFieldList?.find((item) => item.objectField === opts.belongingObject);
7137
- const fromList = obj?.subFields ? pickObjectFieldKeys(obj.subFields, opts.belongingObject) : {};
7138
- const fromFallback = pickObjectFieldKeys(opts.fallbackFields, opts.belongingObject, {
7139
- requireUsed: false
7140
- });
7141
- return {
7142
- productKey: pickPresent(fromList.productKey, fromFallback.productKey),
7143
- productFieldName: fromList.productFieldName ?? fromFallback.productFieldName,
7144
- materialNoKey: pickPresent(fromList.materialNoKey, fromFallback.materialNoKey),
7145
- materialNoFieldName: fromList.materialNoFieldName ?? fromFallback.materialNoFieldName,
7146
- qtyKey: pickPresent(fromList.qtyKey, fromFallback.qtyKey),
7147
- qtyRequiredKey: pickPresent(fromList.qtyRequiredKey, fromFallback.qtyRequiredKey),
7148
- qtyFieldName: fromList.qtyFieldName ?? fromFallback.qtyFieldName,
7149
- bomEntryIdKey: pickPresent(fromList.bomEntryIdKey, fromFallback.bomEntryIdKey)
7150
- };
7151
- }
7152
- function buildObjectLotExtraQuery(productId) {
7153
- if (isBlank(productId)) return {};
7154
- const versionId = String(productId).split(":").pop();
7155
- if (!versionId) return {};
7156
- return { "product_id_.versionEq": versionId };
7157
- }
7158
- function clearedLotFields(materialNoKey) {
7159
- if (!materialNoKey) return {};
7160
- return {
7161
- [materialNoKey]: void 0,
7162
- [`${materialNoKey}_id_`]: void 0,
7163
- [`${materialNoKey}_lb_`]: void 0
7164
- };
7165
- }
7166
- function shouldClearLotOnProductChange(opts) {
7167
- const { prevProduct, nextProduct, lotValue } = opts;
7168
- if (isBlank(prevProduct) && isBlank(nextProduct)) return false;
7169
- if (prevProduct === nextProduct) return false;
7170
- if (isBlank(prevProduct) && !isBlank(nextProduct) && !isBlank(lotValue)) {
7171
- return false;
7172
- }
7173
- return true;
7174
- }
7175
- let fillingProduct = false;
7176
- function runWithFillProduct(fn) {
7177
- fillingProduct = true;
7178
- try {
7179
- fn();
7180
- } finally {
7181
- nextTick(() => {
7182
- fillingProduct = false;
7183
- });
7184
- }
7185
- }
7186
- function resolveLotValidateParams(keys, formData, option) {
7187
- return {
7188
- product_id_: option?.product_id_ ?? option?._item?.product_id_ ?? (keys.productKey ? formData[keys.productKey] : void 0),
7189
- material_no_: option?.name_ ?? option?.__VALUE__ ?? (keys.materialNoKey ? formData[keys.materialNoKey] : void 0),
7190
- material_no_id_: option?.id_ ?? (keys.materialNoKey ? formData[`${keys.materialNoKey}_id_`] : void 0)
7191
- };
7192
- }
7193
- async function applyConsumeObjectTraceChange(opts) {
7194
- const { belongingObject, role, formData } = opts;
7195
- if (!belongingObject || !formData) return {};
7196
- const keys = resolveObjectFieldKeys({
7197
- belongingObject,
7198
- objectFieldList: opts.objectFieldList,
7199
- fallbackFields: opts.fallbackFields
7200
- });
7201
- if (role === FIELD_TYPE.PRODUCT) {
7202
- if (!("prevProduct" in opts) || fillingProduct) return {};
7203
- const values = {};
7204
- if (shouldClearLotOnProductChange({
7205
- prevProduct: opts.prevProduct,
7206
- nextProduct: opts.nextValue,
7207
- lotValue: keys.materialNoKey ? formData[keys.materialNoKey] : void 0
7208
- })) {
7209
- Object.assign(values, clearedLotFields(keys.materialNoKey));
7210
- }
7211
- if (keys.bomEntryIdKey) {
7212
- values[keys.bomEntryIdKey] = null;
7213
- if (!isBlank(opts.nextValue) && opts.formInstBom) {
7214
- const entry = resolveObjectBomEntry({
7215
- formInstBom: opts.formInstBom,
7216
- belongingObject,
7217
- productId: String(opts.nextValue)
7218
- });
7219
- if (entry) values[keys.bomEntryIdKey] = entry.id_;
7220
- }
7221
- }
7222
- opts.rowWriter.patchRow(values, "autofill");
7223
- const lotValue = keys.materialNoKey ? formData[keys.materialNoKey] : void 0;
7224
- if (!isBlank(opts.nextValue) && !isBlank(lotValue)) {
7225
- try {
7226
- await validateReinspectionDate({
7227
- product_id_: String(opts.nextValue),
7228
- material_no_: lotValue,
7229
- material_no_id_: keys.materialNoKey ? formData[`${keys.materialNoKey}_id_`] : void 0
7230
- });
7231
- } catch (e) {
7232
- return { abortReinspection: e?.message || String(e) };
7233
- }
7234
- }
7235
- return {};
7236
- }
7237
- if (role === FIELD_TYPE.MATERIAL_NO) {
7238
- if (opts.option?.is_locked_) {
7239
- opts.rowWriter.patchRow(clearedLotFields(keys.materialNoKey), "autofill");
7240
- return { abortLocked: opts.option.id_ };
7241
- }
7242
- const params = resolveLotValidateParams(keys, formData, opts.option);
7243
- if (isBlank(params.material_no_) && isBlank(params.material_no_id_)) return {};
7244
- try {
7245
- await validateReinspectionDate(params);
7246
- } catch (e) {
7247
- opts.rowWriter.patchRow(clearedLotFields(keys.materialNoKey), "async");
7248
- return { abortReinspection: e?.message || String(e) };
7249
- }
7250
- const values = {};
7251
- const productId = opts.option?.product_id_ ?? opts.option?._item?.product_id_;
7252
- if (keys.productKey && !isBlank(productId)) values[keys.productKey] = productId;
7253
- if (keys.bomEntryIdKey && opts.formInstBom) {
7254
- if (!isBlank(productId)) {
7255
- const entry = resolveObjectBomEntry({
7256
- formInstBom: opts.formInstBom,
7257
- belongingObject,
7258
- productId: String(productId)
7259
- });
7260
- if (entry) values[keys.bomEntryIdKey] = entry.id_;
7261
- }
7262
- }
7263
- const patchRelatedFields = () => opts.rowWriter.patchRow(values, "autofill");
7264
- if (keys.productKey && !isBlank(productId)) {
7265
- runWithFillProduct(patchRelatedFields);
7266
- } else {
7267
- patchRelatedFields();
7268
- }
7269
- return {};
7270
- }
7271
- return {};
7272
- }
7273
7129
  function useRuntimeRowState(rowSource) {
7274
7130
  const { formStateStore } = useRuntimeInstanceServices();
7275
7131
  function requireStore() {
@@ -8022,6 +7878,150 @@ function useFormTmplConfig() {
8022
7878
  injectController
8023
7879
  };
8024
7880
  }
7881
+ function isBlank(value) {
7882
+ return value == null || value === "";
7883
+ }
7884
+ function pickPresent(preferred, fallback) {
7885
+ return isBlank(preferred) ? fallback : preferred;
7886
+ }
7887
+ function resolveObjectFieldKeys(opts) {
7888
+ const obj = opts.objectFieldList?.find((item) => item.objectField === opts.belongingObject);
7889
+ const fromList = obj?.subFields ? pickObjectFieldKeys(obj.subFields, opts.belongingObject) : {};
7890
+ const fromFallback = pickObjectFieldKeys(opts.fallbackFields, opts.belongingObject, {
7891
+ requireUsed: false
7892
+ });
7893
+ return {
7894
+ productKey: pickPresent(fromList.productKey, fromFallback.productKey),
7895
+ productFieldName: fromList.productFieldName ?? fromFallback.productFieldName,
7896
+ materialNoKey: pickPresent(fromList.materialNoKey, fromFallback.materialNoKey),
7897
+ materialNoFieldName: fromList.materialNoFieldName ?? fromFallback.materialNoFieldName,
7898
+ qtyKey: pickPresent(fromList.qtyKey, fromFallback.qtyKey),
7899
+ qtyRequiredKey: pickPresent(fromList.qtyRequiredKey, fromFallback.qtyRequiredKey),
7900
+ qtyFieldName: fromList.qtyFieldName ?? fromFallback.qtyFieldName,
7901
+ bomEntryIdKey: pickPresent(fromList.bomEntryIdKey, fromFallback.bomEntryIdKey)
7902
+ };
7903
+ }
7904
+ function buildObjectLotExtraQuery(productId) {
7905
+ if (isBlank(productId)) return {};
7906
+ const versionId = String(productId).split(":").pop();
7907
+ if (!versionId) return {};
7908
+ return { "product_id_.versionEq": versionId };
7909
+ }
7910
+ function clearedLotFields(materialNoKey) {
7911
+ if (!materialNoKey) return {};
7912
+ return {
7913
+ [materialNoKey]: void 0,
7914
+ [`${materialNoKey}_id_`]: void 0,
7915
+ [`${materialNoKey}_lb_`]: void 0
7916
+ };
7917
+ }
7918
+ function shouldClearLotOnProductChange(opts) {
7919
+ const { prevProduct, nextProduct, lotValue } = opts;
7920
+ if (isBlank(prevProduct) && isBlank(nextProduct)) return false;
7921
+ if (prevProduct === nextProduct) return false;
7922
+ if (isBlank(prevProduct) && !isBlank(nextProduct) && !isBlank(lotValue)) {
7923
+ return false;
7924
+ }
7925
+ return true;
7926
+ }
7927
+ let fillingProduct = false;
7928
+ function runWithFillProduct(fn) {
7929
+ fillingProduct = true;
7930
+ try {
7931
+ fn();
7932
+ } finally {
7933
+ nextTick(() => {
7934
+ fillingProduct = false;
7935
+ });
7936
+ }
7937
+ }
7938
+ function resolveLotValidateParams(keys, formData, option) {
7939
+ return {
7940
+ product_id_: option?.product_id_ ?? option?._item?.product_id_ ?? (keys.productKey ? formData[keys.productKey] : void 0),
7941
+ material_no_: option?.name_ ?? option?.__VALUE__ ?? (keys.materialNoKey ? formData[keys.materialNoKey] : void 0),
7942
+ material_no_id_: option?.id_ ?? (keys.materialNoKey ? formData[`${keys.materialNoKey}_id_`] : void 0)
7943
+ };
7944
+ }
7945
+ async function applyConsumeObjectTraceChange(opts) {
7946
+ const { belongingObject, role, formData } = opts;
7947
+ if (!belongingObject || !formData) return {};
7948
+ const keys = resolveObjectFieldKeys({
7949
+ belongingObject,
7950
+ objectFieldList: opts.objectFieldList,
7951
+ fallbackFields: opts.fallbackFields
7952
+ });
7953
+ if (role === FIELD_TYPE.PRODUCT) {
7954
+ if (!("prevProduct" in opts) || fillingProduct) return {};
7955
+ const values = {};
7956
+ if (shouldClearLotOnProductChange({
7957
+ prevProduct: opts.prevProduct,
7958
+ nextProduct: opts.nextValue,
7959
+ lotValue: keys.materialNoKey ? formData[keys.materialNoKey] : void 0
7960
+ })) {
7961
+ Object.assign(values, clearedLotFields(keys.materialNoKey));
7962
+ }
7963
+ if (keys.bomEntryIdKey) {
7964
+ values[keys.bomEntryIdKey] = null;
7965
+ if (!isBlank(opts.nextValue) && opts.formInstBom) {
7966
+ const entry = resolveObjectBomEntry({
7967
+ formInstBom: opts.formInstBom,
7968
+ belongingObject,
7969
+ productId: String(opts.nextValue)
7970
+ });
7971
+ if (entry) values[keys.bomEntryIdKey] = entry.id_;
7972
+ }
7973
+ }
7974
+ opts.rowWriter.patchRow(values, "autofill");
7975
+ const lotValue = keys.materialNoKey ? formData[keys.materialNoKey] : void 0;
7976
+ if (!isBlank(opts.nextValue) && !isBlank(lotValue)) {
7977
+ try {
7978
+ await validateReinspectionDate({
7979
+ product_id_: String(opts.nextValue),
7980
+ material_no_: lotValue,
7981
+ material_no_id_: keys.materialNoKey ? formData[`${keys.materialNoKey}_id_`] : void 0
7982
+ });
7983
+ } catch (e) {
7984
+ return { abortReinspection: e?.message || String(e) };
7985
+ }
7986
+ }
7987
+ return {};
7988
+ }
7989
+ if (role === FIELD_TYPE.MATERIAL_NO) {
7990
+ if (opts.option?.is_locked_) {
7991
+ opts.rowWriter.patchRow(clearedLotFields(keys.materialNoKey), "autofill");
7992
+ return { abortLocked: opts.option.id_ };
7993
+ }
7994
+ const params = resolveLotValidateParams(keys, formData, opts.option);
7995
+ if (isBlank(params.material_no_) && isBlank(params.material_no_id_)) return {};
7996
+ try {
7997
+ await validateReinspectionDate(params);
7998
+ } catch (e) {
7999
+ opts.rowWriter.patchRow(clearedLotFields(keys.materialNoKey), "async");
8000
+ return { abortReinspection: e?.message || String(e) };
8001
+ }
8002
+ const values = {};
8003
+ const productId = opts.option?.product_id_ ?? opts.option?._item?.product_id_;
8004
+ if (keys.productKey && !isBlank(productId)) values[keys.productKey] = productId;
8005
+ if (keys.bomEntryIdKey && opts.formInstBom) {
8006
+ if (!isBlank(productId)) {
8007
+ const entry = resolveObjectBomEntry({
8008
+ formInstBom: opts.formInstBom,
8009
+ belongingObject,
8010
+ productId: String(productId)
8011
+ });
8012
+ if (entry) values[keys.bomEntryIdKey] = entry.id_;
8013
+ }
8014
+ }
8015
+ const patchRelatedFields = () => opts.rowWriter.patchRow(values, "autofill");
8016
+ if (keys.productKey && !isBlank(productId)) {
8017
+ runWithFillProduct(patchRelatedFields);
8018
+ } else {
8019
+ patchRelatedFields();
8020
+ }
8021
+ return {};
8022
+ }
8023
+ return {};
8024
+ }
8025
8025
  const _hoisted_1$5 = ["data-merge", "data-fill-direction"];
8026
8026
  const _hoisted_2$1 = {
8027
8027
  key: 0,
@@ -8342,6 +8342,7 @@ const DocumentSubTable = /* @__PURE__ */ defineComponent({
8342
8342
  showDisplayStatus,
8343
8343
  dataRelationShip
8344
8344
  } = useWidgetStaticAttrs(props.widget);
8345
+ const isMockMaterialConsume = computed(() => !!dataRelationShip?.isMockReport && !!props.widget.props.isMaterialConsumeTable);
8345
8346
  const sheetId = () => fields.value?.findWidgetById(props.widget.id)?.sheetId;
8346
8347
  const subTableCore = props.subTableCore;
8347
8348
  provide(NCB_PROVIDE.SUB_TABLE_CORE, subTableCore);
@@ -8482,6 +8483,9 @@ const DocumentSubTable = /* @__PURE__ */ defineComponent({
8482
8483
  key,
8483
8484
  actionValue
8484
8485
  }) => {
8486
+ if (isMockMaterialConsume.value && (key === SubTableActionEnum.SCAN || key === SubTableActionEnum.Insert1GroupAfter)) {
8487
+ return;
8488
+ }
8485
8489
  switch (key) {
8486
8490
  case "insertRowBefore":
8487
8491
  handleAddRow({
@@ -8575,10 +8579,11 @@ const DocumentSubTable = /* @__PURE__ */ defineComponent({
8575
8579
  showRowWatermark,
8576
8580
  rowGroupKey
8577
8581
  }) => {
8578
- const menus = subTableCore?.calcSubTableActionMenu({
8582
+ const baseMenus = subTableCore?.calcSubTableActionMenu({
8579
8583
  rowData,
8580
8584
  showDelBtn
8581
8585
  });
8586
+ const menus = isMockMaterialConsume.value ? [getMenuByAction(SubTableActionEnum.SCAN), getMenuByAction(SubTableActionEnum.Insert1GroupAfter), ...baseMenus ?? []] : baseMenus;
8582
8587
  const annRowDetails = dataRelationShip?.annRowDetails;
8583
8588
  const rowMark = dataIdx !== -1 && annRowDetails?.length ? resolveRowFormChangeMark(field, rowData, annRowDetails) : null;
8584
8589
  const rowUi = resolveFormChangeRowUi(rowData, rowMark);