@gct-paas/excel 0.1.40-beta.6 → 0.1.40-beta.7
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/{BaseComponent-Dfx-Xuv4.js → BaseComponent-ByKSQlX5.js} +2 -2
- package/dist/{VueVideoPlayer-DHqhqgGs.js → VueVideoPlayer-D9kpfmiz.js} +2 -2
- package/dist/{align-editor-hvllGvX8.js → align-editor-lWVPNKlR.js} +1 -1
- package/dist/{barcode-design-CzlfYJ3s.js → barcode-design-zpWBlelw.js} +2 -2
- package/dist/base/index.es.js +265 -109
- package/dist/{diagonal-design-DCVidBZD.js → diagonal-design-CzRKVjcY.js} +2 -2
- package/dist/{dynamic-table-action-Dn_iw4tV.js → dynamic-table-action-DkHb1ST4.js} +146 -146
- 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-CAg9oyuD.js} +536 -495
- package/dist/{edit.utils-CXmmCnxE-BUEfsAZ3.js → edit.utils-CXmmCnxE-DIhkrimt.js} +1 -1
- package/dist/excel.css +9 -9
- package/dist/{exceljs.min-9FX7NALn.js → exceljs.min-DoNsTxQp.js} +2 -2
- package/dist/{font-editor-ClqMOFPr.js → font-editor-N7060zuX.js} +3 -3
- package/dist/{image-design-Cx1YIea4.js → image-design-fXKNGIm3.js} +2 -2
- package/dist/{index-Cl_94fZQ.js → index-7J6OP2x9.js} +2 -2
- package/dist/{index-B4c_0M_d.js → index-8A45IOjw.js} +2 -2
- package/dist/{index-BM1sPB29.js → index-8BLKPnwH.js} +1 -1
- package/dist/{index-B3KkYxiX.js → index-B5FuofNW.js} +2 -2
- package/dist/{index-Dp2q7ZPo.js → index-B6fCHnZl.js} +2 -2
- package/dist/{index-BLrixMsM.js → index-BA4zmgdk.js} +2 -2
- package/dist/{index-mCrtpdq2.js → index-BDRyjPGr.js} +204 -59
- package/dist/{index-CcB9d0A-.js → index-BEX6lJX9.js} +2 -2
- package/dist/{index-CVG3Z6rp.js → index-BJA3YJns.js} +3 -3
- package/dist/{index-COmm7d4j.js → index-BXxzWXS4.js} +1 -1
- package/dist/{index-NqYSNDX9.js → index-Bgh8yfAl.js} +2 -2
- package/dist/{index-D7ZzvopL.js → index-Bh-tmh-F.js} +2 -2
- package/dist/{index-Dru8lW-_.js → index-C4Mlck0_.js} +1 -1
- package/dist/{index-B9xwdsWY.js → index-C5IwDker.js} +4 -4
- package/dist/{index-BWHnHAjs.js → index-C6STl6m-.js} +1 -1
- package/dist/{index-D4zDlgqU.js → index-CCw8gM1y.js} +1 -1
- package/dist/{index-CWjwF2wn.js → index-CZIuP6b-.js} +2 -2
- package/dist/{index-CjCFTTI3.js → index-CaojJi0S.js} +1 -1
- package/dist/{index-BdYI71iy.js → index-CbeaPNDv.js} +2 -2
- package/dist/{index-DCv60fUG.js → index-CfY2WTcN.js} +2 -2
- package/dist/{index-BgzCdSQH.js → index-CtHy6vBq.js} +3 -3
- package/dist/{index-NJZaG-sl.js → index-CuHKZOUw.js} +2 -2
- package/dist/{index-CG5LAGQp.js → index-Cza077GN.js} +2 -2
- package/dist/{index-DkXBzlUL.js → index-DGyygsxH.js} +2 -2
- package/dist/{index-BjSWHyj1.js → index-DSUDSbPf.js} +1 -1
- package/dist/{index-DYyVGkv3.js → index-DeEz6LI3.js} +2 -2
- package/dist/{index-BkoKoZbl.js → index-DgbgqO-w.js} +1 -1
- package/dist/{index-a6chYhIK.js → index-DnHsEIgl.js} +2 -2
- package/dist/{index-BRc6frrP.js → index-Xx36PP2U.js} +2 -2
- package/dist/{index-vEKEZcff.js → index-a0vY4sVG.js} +2 -2
- package/dist/{index-CyPwg8fV.js → index-bRZUDA7R.js} +1 -1
- package/dist/{index-Cj_t_73x.js → index-gEI8m-b5.js} +1 -1
- package/dist/{index-q_pMlfx9.js → index-pSRRsoDQ.js} +3 -3
- package/dist/{index-lf11EIvP.js → index-tjo9dn4X.js} +2 -2
- package/dist/{index-BKnroXXX.js → index-yf50oYV1.js} +3 -3
- package/dist/index.es.js +2 -2
- package/dist/{mb-render-DjSdDuaL.js → mb-render-BCtvoXM-.js} +1 -1
- 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-DbNfQIzD.js} +1 -1
- package/dist/{pagination-design-DJEw5vlL.js → pagination-design-BLhJhoHb.js} +2 -2
- package/dist/paper-widget-design-B8gKgZep.js +4 -0
- package/dist/{print-runtime-instance-BtxZfq51.js → print-runtime-instance-v1jzD3oO.js} +1 -1
- package/dist/{print-snapshot-renderer-0D5MUsR6.js → print-snapshot-renderer-BSf76qD7.js} +3 -3
- package/dist/{qrcode-design-9jPH-S8z.js → qrcode-design-D9f0hRKd.js} +1 -1
- package/dist/{revo-grid.entry-BhCFcCVS.js → revo-grid.entry-NMojEZjd.js} +1 -1
- package/dist/{revogr-attribution_7.entry-icpuI3V8.js → revogr-attribution_7.entry-jR0LwEie.js} +3 -3
- package/dist/{revogr-clipboard_3.entry-Dm2_h2RL.js → revogr-clipboard_3.entry-DMQ65QLh.js} +2 -2
- package/dist/{revogr-data_4.entry-DlVEyI7J.js → revogr-data_4.entry-Buvf7dRf.js} +2 -2
- package/dist/{revogr-filter-panel.entry-MJr7PMnd.js → revogr-filter-panel.entry-TLjszdsH.js} +1 -1
- package/dist/seal-design-B80mv8SJ.js +4 -0
- package/dist/{serialnumber-design-BsfJH6Kp.js → serialnumber-design-DsSZwN3t.js} +1 -1
- package/dist/shared/index.es.js +9 -9
- package/dist/{single-field-drop-DXjppxDh.js → single-field-drop-DRMCsh_s.js} +2 -2
- package/dist/{size-editor-DzQdRb-7.js → size-editor-m8uyQ1bU.js} +1 -1
- package/dist/src/domain/document-business/business/product-release/profile.d.ts +2 -0
- package/dist/src/domain/document-business/business/product-release/service.d.ts +2 -0
- package/dist/src/domain/document-business/index.d.ts +2 -0
- package/dist/src/domain/document-business/registry.d.ts +2 -0
- package/dist/src/domain/document-business/runtime/field-query-runtime.d.ts +4 -0
- package/dist/src/domain/document-business/types.d.ts +24 -0
- package/dist/src/domain/field/number/product-release-qty-manifest.d.ts +2 -0
- package/dist/src/domain/field/query-filter.d.ts +15 -0
- package/dist/src/domain/table/business/material/material-substitution/profile/field-keys.d.ts +13 -11
- package/dist/src/domain/table/business/material/material-substitution/runtime/select-loaders.d.ts +8 -0
- package/dist/src/nocode-base/src/core/sub-table/profile-driven-sub-table-core.d.ts +3 -3
- package/dist/src/nocode-base/src/hooks/material-consume-object/object-validation-controller.d.ts +24 -0
- package/dist/src/nocode-base/src/hooks/render-page/initialize-runtime.d.ts +1 -0
- package/dist/src/nocode-base/src/hooks/useRenderPageFactory.d.ts +3 -0
- package/dist/src/nocode-base/src/interface/ref-loader.d.ts +12 -1
- package/dist/src/nocode-base/src/types/common/base.d.ts +2 -0
- package/dist/src/online-form/src/views/designer/constants/index.d.ts +1 -0
- package/dist/src/shared/enum/field-type.d.ts +5 -0
- package/dist/src/shared/utils/withRequestCache.d.ts +27 -0
- package/dist/{sub-table-factory-Ddx70uYs.js → sub-table-factory-BxxIXXCZ.js} +194 -85
- package/dist/{text-design-DmLrMqdk.js → text-design-DgOV0ZhV.js} +2 -2
- package/dist/{throttle-Cpk1LoGk-DLVGpnFw.js → throttle-Cpk1LoGk-Dj14U5ox.js} +1 -1
- package/dist/{timediff-design-CYqz1SKQ.js → timediff-design-C0zYdIQI.js} +1 -1
- package/dist/{trace-like-wrapper-CVl0Vm8r.js → trace-like-wrapper-XB73ltP9.js} +2 -2
- package/dist/{value-editor.vue_vue_type_style_index_0_lang-B0aWEk5D.js → value-editor.vue_vue_type_style_index_0_lang-CRFXw695.js} +2 -2
- package/dist/web-render/index.es.js +3 -3
- package/dist/{widget-barcode-DwYihxgd.js → widget-barcode-BLKBY_Dh.js} +4 -4
- package/dist/{widget-diagonal-DWdxDYVl.js → widget-diagonal-LVxcpB3b.js} +3 -3
- package/dist/{widget-image-D1SXIbMU.js → widget-image-Cch0ImSI.js} +5 -5
- package/dist/{widget-line-BNTbSFkx.js → widget-line-CUSNrxgG.js} +2 -2
- package/dist/{widget-pagination-25CKNe-i.js → widget-pagination-CM1S6Ytp.js} +5 -5
- package/dist/{widget-power-BSjWdgM3.js → widget-power-DQJ8F2R7.js} +3 -3
- package/dist/{widget-qrcode-Kbe9Skrd.js → widget-qrcode-BmnaFfc4.js} +3 -3
- package/dist/{widget-rangelimit-TWPoG8DX.js → widget-rangelimit-Db0ZX6Fb.js} +3 -3
- package/dist/{widget-serialnumber-uNkQzBIT.js → widget-serialnumber-BEOWsFs1.js} +1 -1
- package/dist/{widget-text-DH4r60jo.js → widget-text-DZFAhPxy.js} +5 -5
- package/dist/{widget-timediff-Bv8VCgrv.js → widget-timediff-C_Nh7uw-.js} +2 -2
- package/package.json +1 -1
- package/dist/paper-widget-design-C3rm4SzP.js +0 -4
- 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,
|
|
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-CAg9oyuD.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-
|
|
8
|
+
import { u as useFormModel } from "./mb-render-BCtvoXM-.js";
|
|
9
9
|
var MaterialConsumptionPatternEnum = /* @__PURE__ */ ((MaterialConsumptionPatternEnum2) => {
|
|
10
10
|
MaterialConsumptionPatternEnum2["RECORD"] = "record";
|
|
11
11
|
MaterialConsumptionPatternEnum2["BOM"] = "bom";
|
|
@@ -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,
|