@gct-paas/excel 0.1.32 → 0.1.33-beta.1
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-CC5rukQG.js → BaseComponent-CAe1GFCG.js} +1 -1
- package/dist/{VueVideoPlayer-h_ZG9FHq.js → VueVideoPlayer-BR4RbIhY.js} +2 -2
- package/dist/{align-editor-CnDiBeYX.js → align-editor-jvwZmJhi.js} +1 -1
- package/dist/{barcode-design-DKS1-ByA.js → barcode-design-D-RUtBUQ.js} +2 -2
- package/dist/base/index.es.js +594 -338
- package/dist/{diagonal-design-DsSAdTPc.js → diagonal-design-D0-8xfY9.js} +2 -2
- package/dist/{dynamic-table-action-C06Eolmw.js → dynamic-table-action-CuwejY0h.js} +260 -63
- package/dist/{dynamic-table-action.vue_vue_type_style_index_0_scoped_53d7e66c_lang-CeMxIrHD.js → dynamic-table-action.vue_vue_type_style_index_0_scoped_53d7e66c_lang-CFFrNEYh.js} +6784 -4914
- package/dist/{edit.utils-CXmmCnxE-DgR7eBfx.js → edit.utils-CXmmCnxE-DsHacnTy.js} +1 -1
- package/dist/excel.css +2050 -1111
- package/dist/{exceljs.min-tTYbMh8Q.js → exceljs.min-Cq93OYx0.js} +2 -2
- package/dist/{font-editor-Dg4-mIar.js → font-editor-STIcKQS9.js} +3 -3
- package/dist/{image-design-DipYIW7J.js → image-design-BE0reQ2L.js} +2 -2
- package/dist/{index-BSDIqsy-.js → index-7fOfFIWA.js} +1 -1
- package/dist/{index-4oVjbEL5.js → index-B8UxP4I8.js} +2 -2
- package/dist/{index-Bbm1OZll.js → index-BDEROc8n.js} +2 -2
- package/dist/{index-D77cqI26.js → index-BHKYBIU4.js} +1 -1
- package/dist/{index-CRhFD2Ma.js → index-BR8jTu0U.js} +3 -3
- package/dist/{index-hdnCCYft.js → index-B_Vz06n5.js} +2 -2
- package/dist/{index-CxeNA6if.js → index-Boh-6KTf.js} +3 -3
- package/dist/{index-C2LjfZ8T.js → index-ByFo5Dnd.js} +2 -2
- package/dist/{index-B2uQ_Gpo.js → index-BzYqBsXt.js} +6 -3
- package/dist/{index-8yIbmmaT.js → index-C1qPKXtI.js} +2 -2
- package/dist/{index-ClPbkivx.js → index-CTtq3ytv.js} +2 -2
- package/dist/{index-CnD1HgLA.js → index-CZ_rns9z.js} +3 -3
- package/dist/{index-D7uEmsRJ.js → index-CZjv5O4w.js} +2 -2
- package/dist/{index-CoqaGOXy.js → index-CaAA6yTk.js} +2 -2
- package/dist/{index-CLijkm1b.js → index-CrlUK3mJ.js} +3 -3
- package/dist/{index-7uJnJBMV.js → index-CsE9ftfx.js} +9 -3
- package/dist/{index-BzWrm1H6.js → index-CxOH8cdl.js} +1 -1
- package/dist/{index-DtBIvDQH.js → index-CzZMgyTs.js} +1 -1
- package/dist/{index-DJS-Qycc.js → index-D1qAQzmB.js} +2 -2
- package/dist/{index-DyJk8rK7.js → index-D5ZIZcxA.js} +2 -2
- package/dist/{index-BX7fyebb.js → index-D5aim6xd.js} +1 -1
- package/dist/{index-DwCjfahr.js → index-D9JmIbUb.js} +1 -1
- package/dist/{index-MOgjK9eo.js → index-DcN-7DVw.js} +36526 -35225
- package/dist/{index-DkBu7mHZ.js → index-Dl5qzD_4.js} +2 -2
- package/dist/{index-BhReeJJg.js → index-DogAqNJV.js} +2 -2
- package/dist/{index-DWHpkDH4.js → index-DvbyBcoW.js} +3 -3
- package/dist/{index-Cl6vrDfE.js → index-DwQuEur6.js} +2 -2
- package/dist/{index-B_-itxOF.js → index-GZPHkfRf.js} +2 -2
- package/dist/{index-CSgBgTvS.js → index-Gqpg9XkM.js} +2 -2
- package/dist/{index-Cca1mHnO.js → index-OQIgIej5.js} +1 -1
- package/dist/{index-D6PLyjGU.js → index-TfrN14XT.js} +2 -2
- package/dist/{index-15gZRWSR.js → index-uyTvicTO.js} +1 -1
- package/dist/{index-DH7pin31.js → index-vCGSByW_.js} +2 -2
- package/dist/{index-BVyNEH4i.js → index-wGLH0bRh.js} +1 -1
- package/dist/index.es.js +2 -2
- package/dist/{mb-render-BVp5fqUK.js → mb-render-CtCYbeiE.js} +1 -1
- package/dist/{online-form-model-select.vue_vue_type_script_setup_true_name_online-form-model-select_lang-0eC-BT2j.js → online-form-model-select.vue_vue_type_script_setup_true_name_online-form-model-select_lang-DhcW_QTf.js} +1 -8
- package/dist/{pagination-design-BugQ6_X1.js → pagination-design-Dww0Y1-3.js} +2 -2
- package/dist/paper-widget-design-D_mxf4dD.js +4 -0
- package/dist/{qrcode-design-BvcrdqjC.js → qrcode-design-D0aSeR4l.js} +1 -1
- package/dist/{revo-grid.entry-ByZf-Mkh.js → revo-grid.entry-DI2rNob_.js} +1 -1
- package/dist/{revogr-attribution_7.entry-Bkbb15P7.js → revogr-attribution_7.entry-CBbD7d-g.js} +3 -3
- package/dist/{revogr-clipboard_3.entry-BAsnJv1y.js → revogr-clipboard_3.entry-CLAxZ5jH.js} +2 -2
- package/dist/{revogr-data_4.entry-Cpmztqm8.js → revogr-data_4.entry-7VW0g6vl.js} +2 -2
- package/dist/{revogr-filter-panel.entry-CUJGzSbz.js → revogr-filter-panel.entry-DGHVS3a2.js} +1 -1
- package/dist/{serialnumber-design-CtnZEPSs.js → serialnumber-design-D37xioAJ.js} +1 -1
- package/dist/shared/index.es.js +31 -25
- package/dist/{single-field-drop-BKf3R6dR.js → single-field-drop-D5eogcuY.js} +2 -2
- package/dist/{size-editor-DbOpQm-C.js → size-editor-_oGc1_8M.js} +1 -1
- package/dist/src/assets/svgs/table/index.d.ts +1 -0
- package/dist/src/domain/field/text/udi-manifest.d.ts +2 -0
- package/dist/src/domain/table/business/device/maintenance/index.d.ts +1 -0
- package/dist/src/domain/table/business/device/maintenance/profile/field-keys.d.ts +9 -0
- package/dist/src/domain/table/business/device/maintenance/profile/fields.d.ts +2 -0
- package/dist/src/domain/table/business/device/maintenance/profile/index.d.ts +3 -0
- package/dist/src/domain/table/business/device/point-inspection/index.d.ts +1 -0
- package/dist/src/domain/table/business/device/point-inspection/profile/field-keys.d.ts +9 -0
- package/dist/src/domain/table/business/device/point-inspection/profile/fields.d.ts +2 -0
- package/dist/src/domain/table/business/device/point-inspection/profile/index.d.ts +3 -0
- package/dist/src/domain/table/business/device/signature-lock.d.ts +9 -0
- package/dist/src/domain/table/business/material/material-substitution/index.d.ts +2 -0
- package/dist/src/domain/table/business/material/material-substitution/profile/field-keys.d.ts +75 -0
- package/dist/src/domain/table/business/material/material-substitution/profile/fields.d.ts +2 -0
- package/dist/src/domain/table/business/material/material-substitution/profile/index.d.ts +4 -0
- package/dist/src/domain/table/business/material/material-substitution/runtime/register-handlers.d.ts +1 -0
- package/dist/src/domain/table/business/material/material-substitution/runtime/row-change-handlers.d.ts +6 -0
- package/dist/src/domain/table/design/create-subtable.d.ts +1 -1
- package/dist/src/domain/table/design/hooks/on-field-attach.d.ts +1 -1
- package/dist/src/domain/table/design/index.d.ts +1 -1
- package/dist/src/domain/table/design/sub-model-matcher.d.ts +1 -0
- package/dist/src/domain/table/index.d.ts +3 -2
- package/dist/src/domain/table/registry.d.ts +1 -0
- package/dist/src/domain/table/types.d.ts +8 -3
- package/dist/src/nocode-base/src/components/inspection-decision-prompt-modal.vue.d.ts +7 -0
- package/dist/src/nocode-base/src/constant/index.d.ts +17 -1
- package/dist/src/nocode-base/src/core/sub-table/profile-driven-sub-table-core.d.ts +22 -0
- package/dist/src/nocode-base/src/hooks/index.d.ts +2 -1
- package/dist/src/nocode-base/src/hooks/inspection-decision-rule/evaluator.d.ts +11 -0
- package/dist/src/nocode-base/src/hooks/material-consume/bom-validator.d.ts +10 -2
- package/dist/src/nocode-base/src/hooks/material-consume/material-consume-table-controller.d.ts +5 -0
- package/dist/src/nocode-base/src/hooks/udi.d.ts +5 -0
- package/dist/src/nocode-base/src/hooks/useValidator.d.ts +2 -2
- package/dist/src/nocode-base/src/hooks/validation/runValidation.d.ts +2 -0
- package/dist/src/nocode-base/src/hooks/validation/useFormValidator.d.ts +4 -0
- package/dist/src/nocode-base/src/types/business/index.d.ts +8 -1
- package/dist/src/nocode-base/src/types/common/base.d.ts +53 -1
- package/dist/src/nocode-base/src/types/fields/i-sign.d.ts +5 -1
- package/dist/src/nocode-base/src/types/index.d.ts +1 -1
- package/dist/src/nocode-base/src/types/widgets/i-paper.d.ts +3 -1
- package/dist/src/online-form/src/components/version-diff/index/types.d.ts +5 -1
- package/dist/src/online-form/src/views/designer/constants/index.d.ts +1 -0
- package/dist/src/online-form/src/views/designer/enums/index.d.ts +2 -1
- package/dist/src/online-form/src/views/designer/hooks/useAllSpreadSheets.d.ts +48 -0
- package/dist/src/online-form/src/views/designer/hooks/useSpreadSheet.d.ts +63 -0
- package/dist/src/online-form/src/views/designer/modules/panel/panel-rule-config/decision-rule-condition.vue.d.ts +19 -0
- package/dist/src/online-form/src/views/designer/modules/panel/panel-rule-config/decision-rule-group.vue.d.ts +16 -0
- package/dist/src/online-form/src/views/designer/modules/panel/panel-rule-config/decision-rule.d.ts +54 -0
- package/dist/src/online-form/src/views/designer/modules/panel/panel-rule-config/field-tree-node.vue.d.ts +24 -0
- package/dist/src/online-form/src/views/designer/modules/panel/panel-rule-config/field-tree-select.vue.d.ts +30 -0
- package/dist/src/online-form/src/views/designer/modules/panel/panel-rule-config/field-tree-utils.d.ts +12 -0
- package/dist/src/online-form/src/views/designer/modules/panel/panel-rule-config/inspection-decision-modal.vue.d.ts +9 -0
- package/dist/src/online-form/src/views/designer/modules/panel/panel-rule-config/panel-rule-config.vue.d.ts +18 -1
- package/dist/src/online-form/src/views/designer/modules/panel/panel-rule-config/word-ui/gct-button.vue.d.ts +33 -0
- package/dist/src/online-form/src/views/designer/modules/panel/panel-rule-config/word-ui/gct-icon.vue.d.ts +12 -0
- package/dist/src/online-form/src/views/designer/modules/panel/panel-rule-config/word-ui/gct-input.vue.d.ts +23 -0
- package/dist/src/online-form/src/views/designer/modules/panel/panel-rule-config/word-ui/gct-modal.vue.d.ts +36 -0
- package/dist/src/online-form/src/views/designer/modules/panel/panel-rule-config/word-ui/gct-scrollbar.vue.d.ts +21 -0
- package/dist/src/online-form/src/views/designer/modules/panel/panel-rule-config/word-ui/gct-select.vue.d.ts +30 -0
- package/dist/src/online-form/src/views/designer/modules/panel/panel-rule-config/word-ui/gct-switch.vue.d.ts +17 -0
- package/dist/src/online-form/src/views/designer/modules/panel/panel-rule-config/word-ui/gct-text-area.vue.d.ts +20 -0
- package/dist/src/online-form/src/views/designer/modules/panel/panel-rule-config/word-ui/index.d.ts +8 -0
- package/dist/src/online-form/src/views/designer/modules/panel/sub-table/comps/use-dynamic-sub-table-panel.d.ts +30 -0
- package/dist/src/online-form/src/views/designer/types/index.d.ts +4 -2
- package/dist/src/online-form/src/views/designer/utils/xlsx-parser.d.ts +3 -0
- package/dist/src/online-form/src/views/render/__components__/_field_/sign/component/sign-validation.d.ts +13 -0
- package/dist/src/shared/components/Signature/card-signer.vue.d.ts +2 -2
- package/dist/src/shared/components/Signature/index.d.ts +1 -2
- package/dist/src/shared/components/Signature/logic/index.d.ts +8 -23
- package/dist/src/shared/components/Signature/types/index.d.ts +4 -1
- package/dist/src/shared/components/Signature/ui/password-signer.vue.d.ts +2 -0
- package/dist/src/shared/components/Signature/ui/sign-popover-content.vue.d.ts +6 -2
- package/dist/src/shared/components/Signature/ui/sign-switcher.vue.d.ts +3 -1
- package/dist/src/shared/enum/field-type.d.ts +5 -0
- package/dist/src/shared/enum/online-form.d.ts +7 -1
- package/dist/{text-design-D9Qm-frB.js → text-design-CHoQtOBi.js} +2 -2
- package/dist/{throttle-Cpk1LoGk-CMDdqI7x.js → throttle-Cpk1LoGk-CEvaM6uf.js} +1 -1
- package/dist/{timediff-design-D9liVCTr.js → timediff-design-BxItKsBW.js} +1 -1
- package/dist/{trace-like-wrapper-DQqwOlxy.js → trace-like-wrapper-BNwwljhN.js} +2 -2
- package/dist/{value-editor.vue_vue_type_style_index_0_lang-B-NZBJiV.js → value-editor.vue_vue_type_style_index_0_lang-WwOnevs0.js} +2 -2
- package/dist/web-render/index.es.js +3 -3
- package/dist/{widget-barcode-CRnaA-B2.js → widget-barcode-CmzvEEWx.js} +4 -4
- package/dist/{widget-diagonal-5QDZqvMH.js → widget-diagonal-B6Mvq_Ck.js} +3 -3
- package/dist/{widget-image-CkLJ-5pC.js → widget-image-DPd6ZI2K.js} +5 -5
- package/dist/{widget-line-DEsmouIk.js → widget-line-BRgNGqLk.js} +2 -2
- package/dist/{widget-pagination-Ce7zEUJk.js → widget-pagination-Dn3BpM0I.js} +5 -5
- package/dist/{widget-power-CwQz7Uwf.js → widget-power-C6BzkxLE.js} +3 -3
- package/dist/{widget-qrcode-CHkKCBRy.js → widget-qrcode-_Fe3bqQy.js} +3 -3
- package/dist/{widget-rangelimit-Bki9XhUU.js → widget-rangelimit-Dlt83D9J.js} +3 -3
- package/dist/{widget-serialnumber-DI9hVJDB.js → widget-serialnumber-VA2ngpH9.js} +1 -1
- package/dist/{widget-text-BM9hrxw_.js → widget-text-CiwYrzt_.js} +5 -5
- package/dist/{widget-timediff-Ooda0sMm.js → widget-timediff-Ch3L6a1S.js} +2 -2
- package/package.json +1 -1
- package/dist/paper-widget-design-C4mfMuuG.js +0 -4
- package/dist/src/shared/components/Signature/ui/sign-editor.vue.d.ts +0 -29
- package/dist/src/shared/components/Signature/ui/sign-preview.vue.d.ts +0 -18
- package/dist/src/shared/components/Signature/ui/sign-switcher-modal.vue.d.ts +0 -116
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { defineComponent, computed, openBlock, createBlock } from "vue";
|
|
2
|
-
import { d as useModelFields, D as Diagonal } from "./index-
|
|
3
|
-
import {
|
|
2
|
+
import { d as useModelFields, D as Diagonal } from "./index-DcN-7DVw.js";
|
|
3
|
+
import { al as resolveDiagonalVertex, a7 as _export_sfc } from "./dynamic-table-action.vue_vue_type_style_index_0_scoped_53d7e66c_lang-CFFrNEYh.js";
|
|
4
4
|
import "lodash-es";
|
|
5
5
|
import "dayjs";
|
|
6
6
|
import "ant-design-vue";
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { computed, watch, toRaw, onUnmounted, markRaw, ref, inject, unref, provide, nextTick, reactive, defineComponent, openBlock, createElementBlock, mergeProps, createElementVNode, normalizeClass, renderSlot, createCommentVNode, createVNode, toDisplayString, toRef, isVNode, h, onMounted, onBeforeMount, resolveComponent, createBlock, withCtx, Fragment, renderList, createTextVNode } from "vue";
|
|
2
|
-
import { C as ComponentTypeEnum,
|
|
2
|
+
import { C as ComponentTypeEnum, aT as useWidgetStaticAttrs, _ as PlatformEnum, dk as assembleRules, dl as deleteFormRule, dm as setFormRule, cc as requestDisplayValidation, dn as isReferenceOptionActive, dp as validateAllFields, dq as runValidation, dr as ensureFrontRowKey, ds as FRONT_ROW_KEY, cq as getRowId, b5 as getParseRuleInfo, bf as transformUtils, b0 as materialCheck, b1 as getLotLockedReason, b2 as validateReinspectionDate, bn as FormulaRuleFieldKeyEnum, a_ as NCB_PROVIDE, F as FIELD_TYPE, dt as buildError, A as api, m as SubTableType, du as isPersistedSignatureLockActive, dv as isSignatureLockActive, b6 as getParseRuleValue, ck as uuid2, aL as DeviceLink, a7 as _export_sfc, cK as buildFormChangeDisplayRows, dg as resolveRowFormChangeMark, df as resolveFormChangeRowUi, d1 as isAnnLocationSelected, dh as setSelectMobileTdId, d2 as isFormChangeGhostRow, y as CellType, aV as setSelectAnnotationId, da as recordSubtableRowDelete, cM as deleteSubtableRow, db as relocateDeletedRowsToEnd, d0 as insertSubtableRows, d9 as recordSubtableRowAdd, H as useModal, dw as q, dx as groupFixedTableRows, dy as QUICK_FILL_ALLOWED_FIELDS, dz as processQuickFillRows, dA as getIsGroupEmpty, bl as RenderModeEnum, cX as getSubTableQuickFillInfo } from "./dynamic-table-action.vue_vue_type_style_index_0_scoped_53d7e66c_lang-CFFrNEYh.js";
|
|
3
3
|
import { isNil, cloneDeep, merge, pickBy, mergeWith, omit, last, pick } from "lodash-es";
|
|
4
4
|
import dayjs from "dayjs";
|
|
5
5
|
import { u as useNamespace } from "./use-namespace-BxkK4ofX.js";
|
|
6
6
|
import { Modal, message } from "ant-design-vue";
|
|
7
|
-
import { u as useFormModel } from "./mb-render-
|
|
7
|
+
import { u as useFormModel } from "./mb-render-CtCYbeiE.js";
|
|
8
8
|
const InstanceStatusValues = {
|
|
9
9
|
/** 作废状态 */
|
|
10
10
|
ABANDON: "ABANDON",
|
|
@@ -365,13 +365,14 @@ class McRowValidateError extends Error {
|
|
|
365
365
|
row;
|
|
366
366
|
}
|
|
367
367
|
class BomEntryValidator {
|
|
368
|
-
constructor(bomEntry, enableSequenceLoading, getMaterialNoNum, historyData, mainMaterialNo, noBomMode) {
|
|
368
|
+
constructor(bomEntry, enableSequenceLoading, getMaterialNoNum, historyData, mainMaterialNo, noBomMode, isCustomRequiredQty = false) {
|
|
369
369
|
this.bomEntry = bomEntry;
|
|
370
370
|
this.enableSequenceLoading = enableSequenceLoading;
|
|
371
371
|
this.getMaterialNoNum = getMaterialNoNum;
|
|
372
372
|
this.historyData = historyData;
|
|
373
373
|
this.mainMaterialNo = mainMaterialNo;
|
|
374
374
|
this.noBomMode = noBomMode;
|
|
375
|
+
this.isCustomRequiredQty = isCustomRequiredQty;
|
|
375
376
|
this.productIds.push(this.bomEntry.product_id_);
|
|
376
377
|
this.productCodes[this.bomEntry.product_id_] = this.bomEntry.product_code_;
|
|
377
378
|
if (this.bomEntry.substitute_material_enabled_ && this.bomEntry.substitute_material_entries_) {
|
|
@@ -388,6 +389,7 @@ class BomEntryValidator {
|
|
|
388
389
|
historyData;
|
|
389
390
|
mainMaterialNo;
|
|
390
391
|
noBomMode;
|
|
392
|
+
isCustomRequiredQty;
|
|
391
393
|
/** 该明细使用到的产品的id集合 */
|
|
392
394
|
productIds = [];
|
|
393
395
|
/** 物料和code的映射 */
|
|
@@ -420,7 +422,7 @@ class BomEntryValidator {
|
|
|
420
422
|
* @return {*}
|
|
421
423
|
*/
|
|
422
424
|
filterGroupData(arr) {
|
|
423
|
-
return arr.filter((i) => this.
|
|
425
|
+
return arr.filter((i) => this.isRowInGroup(i) && i.product_id_);
|
|
424
426
|
}
|
|
425
427
|
/** 行是否属于本 BOM 组(优先 bom_entry_id_,避免跨组 product_id_ 误判) */
|
|
426
428
|
isRowInGroup(row) {
|
|
@@ -603,8 +605,18 @@ class BomEntryValidator {
|
|
|
603
605
|
if (!entry.qty_validation_enabled_ || entry.type_ === "view") {
|
|
604
606
|
return;
|
|
605
607
|
}
|
|
608
|
+
const groupData = this.filterGroupData(arr);
|
|
606
609
|
const loaded = this.calcQtyConsumed(arr);
|
|
607
|
-
|
|
610
|
+
let required = this.remainingNum;
|
|
611
|
+
if (this.isCustomRequiredQty) {
|
|
612
|
+
const currentQty = groupData[0]?.qty_required_;
|
|
613
|
+
if (typeof currentQty !== "number" || !Number.isFinite(currentQty) || currentQty <= 0) {
|
|
614
|
+
throw new Error(
|
|
615
|
+
groupNo != null && groupNo > 0 ? `序号${groupNo},需求数量必须大于 0` : "需求数量必须大于 0"
|
|
616
|
+
);
|
|
617
|
+
}
|
|
618
|
+
required = currentQty - this.hasConsumed;
|
|
619
|
+
}
|
|
608
620
|
const diff = loaded - required;
|
|
609
621
|
const rule = entry.qty_validation_rule_;
|
|
610
622
|
const fail = (msg) => {
|
|
@@ -626,9 +638,9 @@ class BomEntryValidator {
|
|
|
626
638
|
if (diff > 0) fail($t("sys.qtyValidationRule.lte"));
|
|
627
639
|
break;
|
|
628
640
|
case "bounds": {
|
|
629
|
-
const
|
|
641
|
+
const groupData2 = this.filterGroupData(arr);
|
|
630
642
|
const consumeSum = this.calcQtyForBounds(arr) + this.calcQtyForBounds(this.historyData);
|
|
631
|
-
const { min, max } = await this.calcCustomNumberLimit(
|
|
643
|
+
const { min, max } = await this.calcCustomNumberLimit(groupData2[0]);
|
|
632
644
|
if (min !== void 0 && consumeSum < min || max !== void 0 && consumeSum > max) {
|
|
633
645
|
fail($t("sys.qtyValidationRule.bounds", { min, max }));
|
|
634
646
|
}
|
|
@@ -638,13 +650,14 @@ class BomEntryValidator {
|
|
|
638
650
|
}
|
|
639
651
|
}
|
|
640
652
|
class BomEntriesValidator {
|
|
641
|
-
constructor(entries, enableSequenceLoading, getMaterialNoNum, historyData, mainMaterialNo, noBomMode) {
|
|
653
|
+
constructor(entries, enableSequenceLoading, getMaterialNoNum, historyData, mainMaterialNo, noBomMode, isCustomRequiredQty = false) {
|
|
642
654
|
this.entries = entries;
|
|
643
655
|
this.enableSequenceLoading = enableSequenceLoading;
|
|
644
656
|
this.getMaterialNoNum = getMaterialNoNum;
|
|
645
657
|
this.historyData = historyData;
|
|
646
658
|
this.mainMaterialNo = mainMaterialNo;
|
|
647
659
|
this.noBomMode = noBomMode;
|
|
660
|
+
this.isCustomRequiredQty = isCustomRequiredQty;
|
|
648
661
|
this.bomEntryValidators = entries.map(
|
|
649
662
|
(i) => new BomEntryValidator(
|
|
650
663
|
i,
|
|
@@ -652,7 +665,8 @@ class BomEntriesValidator {
|
|
|
652
665
|
getMaterialNoNum,
|
|
653
666
|
historyData,
|
|
654
667
|
mainMaterialNo,
|
|
655
|
-
noBomMode
|
|
668
|
+
noBomMode,
|
|
669
|
+
isCustomRequiredQty
|
|
656
670
|
)
|
|
657
671
|
);
|
|
658
672
|
}
|
|
@@ -662,6 +676,7 @@ class BomEntriesValidator {
|
|
|
662
676
|
historyData;
|
|
663
677
|
mainMaterialNo;
|
|
664
678
|
noBomMode;
|
|
679
|
+
isCustomRequiredQty;
|
|
665
680
|
bomEntryValidators;
|
|
666
681
|
/**
|
|
667
682
|
* 翻译物料的code
|
|
@@ -719,11 +734,14 @@ class BomEntriesValidator {
|
|
|
719
734
|
* 行 → BOM 明细在 bomEntryValidators 中的下标,找不到返回 -1
|
|
720
735
|
*/
|
|
721
736
|
resolveEntryIndex(row) {
|
|
737
|
+
if (row.bom_entry_id_) {
|
|
738
|
+
return this.bomEntryValidators.findIndex((v) => v.bomEntry.id_ === row.bom_entry_id_);
|
|
739
|
+
}
|
|
722
740
|
if (row.product_id_) {
|
|
723
741
|
const i = this.bomEntryValidators.findIndex((v) => v.productIds.includes(row.product_id_));
|
|
724
742
|
if (i >= 0) return i;
|
|
725
743
|
}
|
|
726
|
-
return
|
|
744
|
+
return -1;
|
|
727
745
|
}
|
|
728
746
|
/**
|
|
729
747
|
* 行所属组在序号列中的 groupOrderIndex(0-based;-1 未绑 BOM 组)
|
|
@@ -1119,6 +1137,7 @@ var ScanParamType = /* @__PURE__ */ ((ScanParamType2) => {
|
|
|
1119
1137
|
var RequiredQtyCalcRule = /* @__PURE__ */ ((RequiredQtyCalcRule2) => {
|
|
1120
1138
|
RequiredQtyCalcRule2["LotQty"] = "lotQty";
|
|
1121
1139
|
RequiredQtyCalcRule2["ProductQty"] = "productQty";
|
|
1140
|
+
RequiredQtyCalcRule2["Custom"] = "custom";
|
|
1122
1141
|
return RequiredQtyCalcRule2;
|
|
1123
1142
|
})(RequiredQtyCalcRule || {});
|
|
1124
1143
|
async function applyScanFillPlan(arr, scanRow, plan, options) {
|
|
@@ -1247,7 +1266,9 @@ function buildMaterialNoQuery(options) {
|
|
|
1247
1266
|
};
|
|
1248
1267
|
} else {
|
|
1249
1268
|
const productQuery = buildProductIdQuery(options);
|
|
1250
|
-
if (!productQuery
|
|
1269
|
+
if (!productQuery) {
|
|
1270
|
+
baseQuery = { "product_id_.versionIn": null };
|
|
1271
|
+
} else if (isEmptyProductQuery(productQuery)) {
|
|
1251
1272
|
baseQuery = { "product_id_.versionIn": [EMPTY_PRODUCT_VERSION_ID] };
|
|
1252
1273
|
} else {
|
|
1253
1274
|
const versionIds = productQuery["id_.in"].filter((id) => Boolean(id));
|
|
@@ -1489,7 +1510,8 @@ class MaterialConsumeTableController {
|
|
|
1489
1510
|
() => this.materialNoNum,
|
|
1490
1511
|
this.tmplBomController.historyData,
|
|
1491
1512
|
this.tmplBomController.materialNo,
|
|
1492
|
-
this.mcPattern === MaterialConsumptionPatternEnum.RECORD && !this.tmplBom.personal_bom_enabled_
|
|
1513
|
+
this.mcPattern === MaterialConsumptionPatternEnum.RECORD && !this.tmplBom.personal_bom_enabled_,
|
|
1514
|
+
this.tmplBom.required_qty_calc_rule_ === RequiredQtyCalcRule.Custom
|
|
1493
1515
|
);
|
|
1494
1516
|
}
|
|
1495
1517
|
tmplBomController;
|
|
@@ -1528,6 +1550,9 @@ class MaterialConsumeTableController {
|
|
|
1528
1550
|
/** 批次数量或生产数量 */
|
|
1529
1551
|
get materialNoNum() {
|
|
1530
1552
|
const { required_qty_calc_rule_, product_qty_field_ } = this.tmplBom;
|
|
1553
|
+
if (required_qty_calc_rule_ === RequiredQtyCalcRule.Custom) {
|
|
1554
|
+
return void 0;
|
|
1555
|
+
}
|
|
1531
1556
|
if (required_qty_calc_rule_ === RequiredQtyCalcRule.ProductQty) {
|
|
1532
1557
|
return product_qty_field_ ? this.mainFormState.value[product_qty_field_] : 0;
|
|
1533
1558
|
}
|
|
@@ -1575,6 +1600,35 @@ class MaterialConsumeTableController {
|
|
|
1575
1600
|
const deletedArr = this.tableDataRef.value.filter((i) => i.deleted_);
|
|
1576
1601
|
this.tableDataRef.value = [...value, ...deletedArr];
|
|
1577
1602
|
}
|
|
1603
|
+
get isCustomRequiredQty() {
|
|
1604
|
+
return this.tmplBom.required_qty_calc_rule_ === RequiredQtyCalcRule.Custom;
|
|
1605
|
+
}
|
|
1606
|
+
getBomGroupForRow(row) {
|
|
1607
|
+
const validators = this.bomEntriesValidator.bomEntryValidators;
|
|
1608
|
+
if (row.bom_entry_id_) {
|
|
1609
|
+
return validators.find((util) => util.bomEntry.id_ === row.bom_entry_id_);
|
|
1610
|
+
}
|
|
1611
|
+
return row.product_id_ ? this.bomEntriesValidator.findUtilByProductId(row.product_id_) : void 0;
|
|
1612
|
+
}
|
|
1613
|
+
/** 自定义规则的需求数量在同一 BOM 组内保持一致。 */
|
|
1614
|
+
getCustomGroupRequiredQty(row) {
|
|
1615
|
+
const util = this.getBomGroupForRow(row);
|
|
1616
|
+
if (!util) return row.qty_required_;
|
|
1617
|
+
return this.actualTableData.find(
|
|
1618
|
+
(item) => util.isRowInGroup(item) && item.qty_required_ != null
|
|
1619
|
+
)?.qty_required_;
|
|
1620
|
+
}
|
|
1621
|
+
setCustomGroupRequiredQty(row, qty) {
|
|
1622
|
+
if (!this.isCustomRequiredQty) return;
|
|
1623
|
+
const util = this.getBomGroupForRow(row);
|
|
1624
|
+
if (!util) {
|
|
1625
|
+
row.qty_required_ = qty;
|
|
1626
|
+
return;
|
|
1627
|
+
}
|
|
1628
|
+
this.actualTableData.forEach((item) => {
|
|
1629
|
+
if (util.isRowInGroup(item)) item.qty_required_ = qty;
|
|
1630
|
+
});
|
|
1631
|
+
}
|
|
1578
1632
|
/** 错误信息 */
|
|
1579
1633
|
error(message2) {
|
|
1580
1634
|
MaterialConsumeTableController.render.message({
|
|
@@ -1630,10 +1684,11 @@ class MaterialConsumeTableController {
|
|
|
1630
1684
|
*/
|
|
1631
1685
|
calcFormState() {
|
|
1632
1686
|
if (this.tmplBom.bom_init_enabled_) {
|
|
1687
|
+
const materialNoNum = this.materialNoNum;
|
|
1633
1688
|
return this.actualBomEntries.map((i) => {
|
|
1634
1689
|
return {
|
|
1635
1690
|
product_id_: i.product_id_,
|
|
1636
|
-
qty_required_: i.qty_required_ *
|
|
1691
|
+
...materialNoNum === void 0 ? {} : { qty_required_: i.qty_required_ * materialNoNum },
|
|
1637
1692
|
bom_entry_id_: i.id_
|
|
1638
1693
|
};
|
|
1639
1694
|
});
|
|
@@ -1673,7 +1728,7 @@ class MaterialConsumeTableController {
|
|
|
1673
1728
|
"sort_num_",
|
|
1674
1729
|
"qty_consumed_total_"
|
|
1675
1730
|
];
|
|
1676
|
-
const isRecordPattern = this.mcPattern === MaterialConsumptionPatternEnum.RECORD && !this.tmplBom.personal_bom_enabled_;
|
|
1731
|
+
const isRecordPattern = this.mcPattern === MaterialConsumptionPatternEnum.RECORD && (!this.tmplBom.personal_bom_enabled_ || this.tmplBom.required_qty_calc_rule_ === RequiredQtyCalcRule.Custom);
|
|
1677
1732
|
if (!isRecordPattern) {
|
|
1678
1733
|
disabledKeys.push("qty_required_");
|
|
1679
1734
|
}
|
|
@@ -1813,9 +1868,19 @@ class MaterialConsumeTableController {
|
|
|
1813
1868
|
this.setDefaultValue(row);
|
|
1814
1869
|
try {
|
|
1815
1870
|
const plan = await this.bomEntriesValidator.validateScanCanInsert(row, this.actualTableData);
|
|
1816
|
-
|
|
1871
|
+
const existingRequiredQty = this.isCustomRequiredQty && plan ? this.actualTableData.find(
|
|
1872
|
+
(item) => plan.target.isRowInGroup(item) && item.qty_required_ != null
|
|
1873
|
+
)?.qty_required_ : void 0;
|
|
1874
|
+
const nextTable = await applyScanFillPlan(this.actualTableData, row, plan, {
|
|
1817
1875
|
validateCurrentGroupForSwitch: (table, current) => this.bomEntriesValidator.validateCurrentGroupForSwitch(table, current)
|
|
1818
1876
|
});
|
|
1877
|
+
if (this.isCustomRequiredQty && plan) {
|
|
1878
|
+
const requiredQty = existingRequiredQty ?? row.qty_required_;
|
|
1879
|
+
nextTable.forEach((item) => {
|
|
1880
|
+
if (plan.target.isRowInGroup(item)) item.qty_required_ = requiredQty;
|
|
1881
|
+
});
|
|
1882
|
+
}
|
|
1883
|
+
this.tableDataRef.value = nextTable;
|
|
1819
1884
|
this.updateDerivedQtyFields();
|
|
1820
1885
|
} catch (e) {
|
|
1821
1886
|
console.error(e);
|
|
@@ -1904,6 +1969,7 @@ class MaterialConsumeTableController {
|
|
|
1904
1969
|
* 按当前 materialNoNum 回写各行 qty_required_(校验侧 total 已通过 getter 实时读取)
|
|
1905
1970
|
*/
|
|
1906
1971
|
syncQtyRequiredFromBom() {
|
|
1972
|
+
if (this.tmplBom.required_qty_calc_rule_ === RequiredQtyCalcRule.Custom) return;
|
|
1907
1973
|
this.actualTableData.forEach((row) => {
|
|
1908
1974
|
if (!row.product_id_) return;
|
|
1909
1975
|
const util = this.bomEntriesValidator.findUtilByProductId(row.product_id_);
|
|
@@ -2175,7 +2241,9 @@ class MaterialConsumeTableController {
|
|
|
2175
2241
|
if (row.product_id_) {
|
|
2176
2242
|
const util = this.bomEntriesValidator.findUtilByProductId(row.product_id_);
|
|
2177
2243
|
if (util) {
|
|
2178
|
-
|
|
2244
|
+
if (this.tmplBom.required_qty_calc_rule_ !== RequiredQtyCalcRule.Custom) {
|
|
2245
|
+
row.qty_required_ = util.total;
|
|
2246
|
+
}
|
|
2179
2247
|
row.qty_consumed_ = util.hasConsumed;
|
|
2180
2248
|
row.bom_entry_id_ = util.bomEntry.id_;
|
|
2181
2249
|
}
|
|
@@ -2188,7 +2256,10 @@ class MaterialConsumeTableController {
|
|
|
2188
2256
|
async handleChange(opts) {
|
|
2189
2257
|
const { field, row, value, option } = opts;
|
|
2190
2258
|
console.log("handleChange", opts);
|
|
2191
|
-
if (field === "
|
|
2259
|
+
if (field === "qty_required_" && this.isCustomRequiredQty) {
|
|
2260
|
+
const qty = value == null || value === "" ? void 0 : Number(value);
|
|
2261
|
+
this.setCustomGroupRequiredQty(row, qty);
|
|
2262
|
+
} else if (field === "product_id_") {
|
|
2192
2263
|
if (row._scanFallback) {
|
|
2193
2264
|
try {
|
|
2194
2265
|
await validateReinspectionDate({
|
|
@@ -2202,6 +2273,8 @@ class MaterialConsumeTableController {
|
|
|
2202
2273
|
}
|
|
2203
2274
|
return;
|
|
2204
2275
|
}
|
|
2276
|
+
const oldGroupId = row.bom_entry_id_;
|
|
2277
|
+
const oldRequiredQty = this.isCustomRequiredQty && oldGroupId ? this.getCustomGroupRequiredQty(row) : void 0;
|
|
2205
2278
|
row.material_no_ = void 0;
|
|
2206
2279
|
row.material_no__id_ = void 0;
|
|
2207
2280
|
row.material_no__lb_ = void 0;
|
|
@@ -2210,6 +2283,10 @@ class MaterialConsumeTableController {
|
|
|
2210
2283
|
row.expiration_date_ = void 0;
|
|
2211
2284
|
this.setDefaultValue(row);
|
|
2212
2285
|
this.updateDerivedQtyFields();
|
|
2286
|
+
if (this.isCustomRequiredQty) {
|
|
2287
|
+
const qty = oldGroupId && row.bom_entry_id_ === oldGroupId ? oldRequiredQty : this.getCustomGroupRequiredQty(row);
|
|
2288
|
+
this.setCustomGroupRequiredQty(row, qty);
|
|
2289
|
+
}
|
|
2213
2290
|
} else if (field === "material_no_") {
|
|
2214
2291
|
if (option?.is_locked_) {
|
|
2215
2292
|
row.material_no_ = void 0;
|
|
@@ -2233,9 +2310,16 @@ class MaterialConsumeTableController {
|
|
|
2233
2310
|
this.error(e.message);
|
|
2234
2311
|
return;
|
|
2235
2312
|
}
|
|
2313
|
+
const oldGroupId = row.bom_entry_id_;
|
|
2314
|
+
const oldRequiredQty = this.isCustomRequiredQty && oldGroupId ? this.getCustomGroupRequiredQty(row) : void 0;
|
|
2236
2315
|
row.product_id_ = option.product_id_;
|
|
2237
2316
|
row.expiration_date_ = option.validate_;
|
|
2317
|
+
if (this.isCustomRequiredQty) row.qty_required_ = void 0;
|
|
2238
2318
|
this.setDefaultValue(row);
|
|
2319
|
+
if (this.isCustomRequiredQty) {
|
|
2320
|
+
const qty = oldGroupId && row.bom_entry_id_ === oldGroupId ? oldRequiredQty : this.getCustomGroupRequiredQty(row);
|
|
2321
|
+
this.setCustomGroupRequiredQty(row, qty);
|
|
2322
|
+
}
|
|
2239
2323
|
} else if (field === "qty_") {
|
|
2240
2324
|
this.updateDerivedQtyFields();
|
|
2241
2325
|
}
|
|
@@ -2509,11 +2593,11 @@ async function validateObjectBomQtyOnSubmit(opts) {
|
|
|
2509
2593
|
}
|
|
2510
2594
|
return errors;
|
|
2511
2595
|
}
|
|
2512
|
-
function isBlank$
|
|
2596
|
+
function isBlank$2(value) {
|
|
2513
2597
|
return value == null || value === "";
|
|
2514
2598
|
}
|
|
2515
2599
|
function pickPresent(preferred, fallback) {
|
|
2516
|
-
return isBlank$
|
|
2600
|
+
return isBlank$2(preferred) ? fallback : preferred;
|
|
2517
2601
|
}
|
|
2518
2602
|
function resolveObjectFieldKeys(opts) {
|
|
2519
2603
|
const obj = opts.objectFieldList?.find((item) => item.objectField === opts.belongingObject);
|
|
@@ -2533,7 +2617,7 @@ function resolveObjectFieldKeys(opts) {
|
|
|
2533
2617
|
};
|
|
2534
2618
|
}
|
|
2535
2619
|
function buildObjectLotExtraQuery(productId) {
|
|
2536
|
-
if (isBlank$
|
|
2620
|
+
if (isBlank$2(productId)) return {};
|
|
2537
2621
|
const versionId = String(productId).split(":").pop();
|
|
2538
2622
|
if (!versionId) return {};
|
|
2539
2623
|
return { "product_id_.versionEq": versionId };
|
|
@@ -2546,9 +2630,9 @@ function clearObjectLotFields(formData, materialNoKey) {
|
|
|
2546
2630
|
}
|
|
2547
2631
|
function shouldClearLotOnProductChange(opts) {
|
|
2548
2632
|
const { prevProduct, nextProduct, lotValue } = opts;
|
|
2549
|
-
if (isBlank$
|
|
2633
|
+
if (isBlank$2(prevProduct) && isBlank$2(nextProduct)) return false;
|
|
2550
2634
|
if (prevProduct === nextProduct) return false;
|
|
2551
|
-
if (isBlank$
|
|
2635
|
+
if (isBlank$2(prevProduct) && !isBlank$2(nextProduct) && !isBlank$2(lotValue)) {
|
|
2552
2636
|
return false;
|
|
2553
2637
|
}
|
|
2554
2638
|
return true;
|
|
@@ -2566,7 +2650,7 @@ function runWithFillProduct(fn) {
|
|
|
2566
2650
|
}
|
|
2567
2651
|
function fillProductFromLotOption(opts) {
|
|
2568
2652
|
const productId = opts.option?.product_id_ ?? opts.option?._item?.product_id_;
|
|
2569
|
-
if (!opts.productKey || isBlank$
|
|
2653
|
+
if (!opts.productKey || isBlank$2(productId)) return;
|
|
2570
2654
|
runWithFillProduct(() => {
|
|
2571
2655
|
opts.formData[opts.productKey] = productId;
|
|
2572
2656
|
});
|
|
@@ -2597,7 +2681,7 @@ async function applyConsumeObjectTraceChange(opts) {
|
|
|
2597
2681
|
}
|
|
2598
2682
|
if (keys.bomEntryIdKey) {
|
|
2599
2683
|
formData[keys.bomEntryIdKey] = null;
|
|
2600
|
-
if (!isBlank$
|
|
2684
|
+
if (!isBlank$2(opts.nextValue) && opts.formInstBom) {
|
|
2601
2685
|
const entry = resolveObjectBomEntry({
|
|
2602
2686
|
formInstBom: opts.formInstBom,
|
|
2603
2687
|
belongingObject,
|
|
@@ -2607,7 +2691,7 @@ async function applyConsumeObjectTraceChange(opts) {
|
|
|
2607
2691
|
}
|
|
2608
2692
|
}
|
|
2609
2693
|
const lotValue = keys.materialNoKey ? formData[keys.materialNoKey] : void 0;
|
|
2610
|
-
if (!isBlank$
|
|
2694
|
+
if (!isBlank$2(opts.nextValue) && !isBlank$2(lotValue)) {
|
|
2611
2695
|
try {
|
|
2612
2696
|
await validateReinspectionDate({
|
|
2613
2697
|
product_id_: String(opts.nextValue),
|
|
@@ -2626,7 +2710,7 @@ async function applyConsumeObjectTraceChange(opts) {
|
|
|
2626
2710
|
return { abortLocked: opts.option.id_ };
|
|
2627
2711
|
}
|
|
2628
2712
|
const params = resolveLotValidateParams(keys, formData, opts.option);
|
|
2629
|
-
if (isBlank$
|
|
2713
|
+
if (isBlank$2(params.material_no_) && isBlank$2(params.material_no_id_)) return {};
|
|
2630
2714
|
try {
|
|
2631
2715
|
await validateReinspectionDate(params);
|
|
2632
2716
|
} catch (e) {
|
|
@@ -2640,7 +2724,7 @@ async function applyConsumeObjectTraceChange(opts) {
|
|
|
2640
2724
|
});
|
|
2641
2725
|
if (keys.bomEntryIdKey && opts.formInstBom) {
|
|
2642
2726
|
const productId = opts.option?.product_id_ ?? opts.option?._item?.product_id_;
|
|
2643
|
-
if (!isBlank$
|
|
2727
|
+
if (!isBlank$2(productId)) {
|
|
2644
2728
|
const entry = resolveObjectBomEntry({
|
|
2645
2729
|
formInstBom: opts.formInstBom,
|
|
2646
2730
|
belongingObject,
|
|
@@ -2896,6 +2980,7 @@ class TdHandler {
|
|
|
2896
2980
|
set fieldReadonly(val) {
|
|
2897
2981
|
this.cloneTd();
|
|
2898
2982
|
this.td.cellWidget.props.readonly = val;
|
|
2983
|
+
this.td.cellWidget.props.field_readonly = val;
|
|
2899
2984
|
if (val) {
|
|
2900
2985
|
this.td.cellWidget.props.disabled = false;
|
|
2901
2986
|
}
|
|
@@ -3207,6 +3292,12 @@ class SubTableCore {
|
|
|
3207
3292
|
*/
|
|
3208
3293
|
calcFieldStatus(params) {
|
|
3209
3294
|
const result = {};
|
|
3295
|
+
const config = this.bizTableConfig;
|
|
3296
|
+
if (config?.dataLockControlField && params.field === config.dataLockControlField) {
|
|
3297
|
+
result.readonly = isPersistedSignatureLockActive(config, params.rowData);
|
|
3298
|
+
} else if (config?.dataLockControlField) {
|
|
3299
|
+
result.disabled = isSignatureLockActive(config, params.rowData);
|
|
3300
|
+
}
|
|
3210
3301
|
return result;
|
|
3211
3302
|
}
|
|
3212
3303
|
/**
|
|
@@ -3764,7 +3855,7 @@ const OPERATION_RECEIVE_QTY_API = {
|
|
|
3764
3855
|
modelKey: "em_routing_operation_number",
|
|
3765
3856
|
bsKey: "getOne"
|
|
3766
3857
|
};
|
|
3767
|
-
function isBlank(value) {
|
|
3858
|
+
function isBlank$1(value) {
|
|
3768
3859
|
return value == null || value === "";
|
|
3769
3860
|
}
|
|
3770
3861
|
function unwrapBizPayload(res) {
|
|
@@ -3779,7 +3870,7 @@ function unwrapBizPayload(res) {
|
|
|
3779
3870
|
async function fetchOperationReceiveQty(paramsConfig) {
|
|
3780
3871
|
const containerId = paramsConfig?.containerId;
|
|
3781
3872
|
const routingOperationId = paramsConfig?.routingOperationId;
|
|
3782
|
-
if (isBlank(containerId) || isBlank(routingOperationId)) return void 0;
|
|
3873
|
+
if (isBlank$1(containerId) || isBlank$1(routingOperationId)) return void 0;
|
|
3783
3874
|
try {
|
|
3784
3875
|
const res = await api.apaas.modelComprehensive.postBizServiceModelCategoryModelKeyBsKey(
|
|
3785
3876
|
OPERATION_RECEIVE_QTY_API,
|
|
@@ -3800,6 +3891,74 @@ async function fetchOperationReceiveQty(paramsConfig) {
|
|
|
3800
3891
|
return void 0;
|
|
3801
3892
|
}
|
|
3802
3893
|
}
|
|
3894
|
+
const UDI_API = {
|
|
3895
|
+
modelCategory: "entity",
|
|
3896
|
+
modelKey: "em_production_identification_udi",
|
|
3897
|
+
bsKey: "listAll"
|
|
3898
|
+
};
|
|
3899
|
+
function isPresent(value) {
|
|
3900
|
+
return value !== void 0 && value !== null && value !== "";
|
|
3901
|
+
}
|
|
3902
|
+
function isBlank(value) {
|
|
3903
|
+
return value === void 0 || value === null || value === "";
|
|
3904
|
+
}
|
|
3905
|
+
function unwrapUdiList(res) {
|
|
3906
|
+
if (Array.isArray(res)) return res;
|
|
3907
|
+
if (!res || typeof res !== "object") return [];
|
|
3908
|
+
const data = res.data;
|
|
3909
|
+
if (Array.isArray(data)) return data;
|
|
3910
|
+
if (data && typeof data === "object" && Array.isArray(data.data)) {
|
|
3911
|
+
return data.data;
|
|
3912
|
+
}
|
|
3913
|
+
return [];
|
|
3914
|
+
}
|
|
3915
|
+
function resolveUdiQuery(paramsConfig) {
|
|
3916
|
+
const containerId = paramsConfig?.containerId;
|
|
3917
|
+
if (!isBlank(containerId)) {
|
|
3918
|
+
return { production_identification_id_: String(containerId) };
|
|
3919
|
+
}
|
|
3920
|
+
const snId = paramsConfig?.snId;
|
|
3921
|
+
if (!isBlank(snId)) {
|
|
3922
|
+
return { production_identification_id_: String(snId) };
|
|
3923
|
+
}
|
|
3924
|
+
return void 0;
|
|
3925
|
+
}
|
|
3926
|
+
function parseUdi(res) {
|
|
3927
|
+
const row = unwrapUdiList(res)[0];
|
|
3928
|
+
if (!row) return void 0;
|
|
3929
|
+
const value = row.udi_;
|
|
3930
|
+
return isPresent(value) ? String(value) : void 0;
|
|
3931
|
+
}
|
|
3932
|
+
const inflightUdiByQuery = /* @__PURE__ */ new Map();
|
|
3933
|
+
const resolvedUdiByQuery = /* @__PURE__ */ new Map();
|
|
3934
|
+
async function fetchUdi(paramsConfig) {
|
|
3935
|
+
const query = resolveUdiQuery(paramsConfig);
|
|
3936
|
+
if (!query) return void 0;
|
|
3937
|
+
const cacheKey = JSON.stringify(query);
|
|
3938
|
+
if (resolvedUdiByQuery.has(cacheKey)) return resolvedUdiByQuery.get(cacheKey);
|
|
3939
|
+
const existing = inflightUdiByQuery.get(cacheKey);
|
|
3940
|
+
if (existing) return existing;
|
|
3941
|
+
const task = (async () => {
|
|
3942
|
+
try {
|
|
3943
|
+
const res = await api.apaas.modelComprehensive.postBizServiceModelCategoryModelKeyBsKey(
|
|
3944
|
+
UDI_API,
|
|
3945
|
+
{},
|
|
3946
|
+
{ query, pageNo: 1, pageSize: 1 }
|
|
3947
|
+
);
|
|
3948
|
+
const udi = parseUdi(res);
|
|
3949
|
+
resolvedUdiByQuery.set(cacheKey, udi);
|
|
3950
|
+
return udi;
|
|
3951
|
+
} catch {
|
|
3952
|
+
return void 0;
|
|
3953
|
+
}
|
|
3954
|
+
})();
|
|
3955
|
+
inflightUdiByQuery.set(cacheKey, task);
|
|
3956
|
+
try {
|
|
3957
|
+
return await task;
|
|
3958
|
+
} finally {
|
|
3959
|
+
inflightUdiByQuery.delete(cacheKey);
|
|
3960
|
+
}
|
|
3961
|
+
}
|
|
3803
3962
|
const _hoisted_1$5 = ["data-merge", "data-fill-direction"];
|
|
3804
3963
|
const _hoisted_2$1 = {
|
|
3805
3964
|
key: 0,
|
|
@@ -4673,6 +4832,7 @@ const MaterialConsumeTable = /* @__PURE__ */ defineComponent({
|
|
|
4673
4832
|
Object.assign(rowData, defaultRow, preserved);
|
|
4674
4833
|
tableController.setDefaultValue(rowData);
|
|
4675
4834
|
rowData.bom_entry_id_ = void 0;
|
|
4835
|
+
if (tableController.isCustomRequiredQty) rowData.qty_required_ = void 0;
|
|
4676
4836
|
rowData.qty_consumed_total_ = void 0;
|
|
4677
4837
|
clearMcValidatorComments();
|
|
4678
4838
|
tableController.updateDerivedQtyFields();
|
|
@@ -4694,8 +4854,11 @@ const MaterialConsumeTable = /* @__PURE__ */ defineComponent({
|
|
|
4694
4854
|
rowNum = 1,
|
|
4695
4855
|
quickFillDatas
|
|
4696
4856
|
}) => {
|
|
4857
|
+
const bomEntryId = rowData.bom_entry_id_ ?? (rowData.product_id_ ? tableController.bomEntriesValidator.findUtilByProductId(rowData.product_id_)?.bomEntry.id_ : void 0);
|
|
4858
|
+
const requiredQty = tableController.isCustomRequiredQty && bomEntryId ? tableController.getCustomGroupRequiredQty(rowData) : void 0;
|
|
4697
4859
|
insertRowsAt(resolveRealIndex(index) + 1, createDefaultRows(rowNum, quickFillDatas, (r) => {
|
|
4698
|
-
if (
|
|
4860
|
+
if (bomEntryId) r.bom_entry_id_ = bomEntryId;
|
|
4861
|
+
if (tableController.isCustomRequiredQty && bomEntryId) r.qty_required_ = requiredQty;
|
|
4699
4862
|
}));
|
|
4700
4863
|
};
|
|
4701
4864
|
const handleAddGroup = async ({
|
|
@@ -4732,7 +4895,11 @@ const MaterialConsumeTable = /* @__PURE__ */ defineComponent({
|
|
|
4732
4895
|
});
|
|
4733
4896
|
}
|
|
4734
4897
|
if (groupLast < 0) groupLast = resolveRealIndex(index);
|
|
4735
|
-
insertRowsAt(groupLast + 1, createDefaultRows(1, quickFillDatas)
|
|
4898
|
+
insertRowsAt(groupLast + 1, createDefaultRows(1, quickFillDatas, (row) => {
|
|
4899
|
+
if (tableController.isCustomRequiredQty && quickFillDatas?.[0]?.qty_required_ == null) {
|
|
4900
|
+
row.qty_required_ = void 0;
|
|
4901
|
+
}
|
|
4902
|
+
}));
|
|
4736
4903
|
};
|
|
4737
4904
|
const handleAction = (action, rowData) => {
|
|
4738
4905
|
switch (action) {
|
|
@@ -5728,6 +5895,33 @@ const DocumentPaper = /* @__PURE__ */ defineComponent({
|
|
|
5728
5895
|
}
|
|
5729
5896
|
return attrInfo;
|
|
5730
5897
|
};
|
|
5898
|
+
const applyFixedTableSignatureLock = (tdInfo) => {
|
|
5899
|
+
if (!tdInfo.props?.isNewFixedTableTd || !tdInfo.cellWidget?.props?.field) {
|
|
5900
|
+
return tdInfo;
|
|
5901
|
+
}
|
|
5902
|
+
const tableField = tdInfo.props.fixedTableFieldId;
|
|
5903
|
+
const table = fixedTables.value.find((item) => item.field === tableField);
|
|
5904
|
+
const config2 = table?.bizTableConfig;
|
|
5905
|
+
if (!config2?.dataLockControlField) return tdInfo;
|
|
5906
|
+
const rowIndex = tdInfo.cellFixedTableDataIdx ?? 0;
|
|
5907
|
+
const rowData = props.formState?.[tableField]?.[rowIndex];
|
|
5908
|
+
const isControlField = tdInfo.cellWidget.props.field === config2.dataLockControlField;
|
|
5909
|
+
const locked = isSignatureLockActive(config2, rowData) && !isControlField;
|
|
5910
|
+
const controlFieldReadonly = isControlField && isPersistedSignatureLockActive(config2, rowData);
|
|
5911
|
+
const originalProps = tdInfo.cellWidget.props;
|
|
5912
|
+
return {
|
|
5913
|
+
...tdInfo,
|
|
5914
|
+
cellWidget: {
|
|
5915
|
+
...tdInfo.cellWidget,
|
|
5916
|
+
props: {
|
|
5917
|
+
...originalProps,
|
|
5918
|
+
fieldDisabled: locked ? true : originalProps.fieldDisabled,
|
|
5919
|
+
field_readonly: controlFieldReadonly ? true : originalProps.field_readonly,
|
|
5920
|
+
readonly: controlFieldReadonly ? true : originalProps.readonly
|
|
5921
|
+
}
|
|
5922
|
+
}
|
|
5923
|
+
};
|
|
5924
|
+
};
|
|
5731
5925
|
onMounted(async () => {
|
|
5732
5926
|
if (props.basicInfo.renderModeType === RenderModeEnum.ViewMode) {
|
|
5733
5927
|
await waitDomStable(mainTableRef.value, void 0, void 0, props.basicInfo.__isPrintRender);
|
|
@@ -5782,7 +5976,7 @@ const DocumentPaper = /* @__PURE__ */ defineComponent({
|
|
|
5782
5976
|
"key": `${trId}_${trIndex}`,
|
|
5783
5977
|
"height": height
|
|
5784
5978
|
}, [tdIds.map((tdId) => {
|
|
5785
|
-
const tdInfo = props.widgetCenter[tdId];
|
|
5979
|
+
const tdInfo = applyFixedTableSignatureLock(props.widgetCenter[tdId]);
|
|
5786
5980
|
const tdAttrs = {
|
|
5787
5981
|
key: tdId,
|
|
5788
5982
|
id: tdId,
|
|
@@ -6042,57 +6236,60 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
6042
6236
|
});
|
|
6043
6237
|
const DynamicTableAction = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-53d7e66c"]]);
|
|
6044
6238
|
export {
|
|
6045
|
-
|
|
6239
|
+
parseUdi as $,
|
|
6240
|
+
resolveScanQty as A,
|
|
6046
6241
|
BorderTD as B,
|
|
6047
|
-
|
|
6242
|
+
toDateOnly as C,
|
|
6048
6243
|
DeviceLinkTmplUtil as D,
|
|
6049
6244
|
EMPTY_PRODUCT_VERSION_ID as E,
|
|
6050
|
-
|
|
6051
|
-
|
|
6052
|
-
|
|
6245
|
+
getCopySubMenu as F,
|
|
6246
|
+
resolveScanParsedValue as G,
|
|
6247
|
+
isProductBatchEmptyRow as H,
|
|
6053
6248
|
InstanceStatusValues as I,
|
|
6054
|
-
|
|
6055
|
-
|
|
6056
|
-
|
|
6249
|
+
useMaterialBalance as J,
|
|
6250
|
+
validate as K,
|
|
6251
|
+
validateObjectBomQtyOnSubmit as L,
|
|
6057
6252
|
MaterialConsumptionPatternEnum as M,
|
|
6058
|
-
|
|
6059
|
-
|
|
6060
|
-
|
|
6061
|
-
|
|
6253
|
+
DeviceConnector as N,
|
|
6254
|
+
DocumentLoading as O,
|
|
6255
|
+
DynamicQuickFillModal as P,
|
|
6256
|
+
FixedQuickFillModal as Q,
|
|
6062
6257
|
RequiredQtyCalcRule as R,
|
|
6063
6258
|
ScanParamType as S,
|
|
6064
|
-
|
|
6065
|
-
|
|
6066
|
-
|
|
6067
|
-
|
|
6068
|
-
|
|
6069
|
-
|
|
6070
|
-
|
|
6259
|
+
FormTmplConfigController as T,
|
|
6260
|
+
MCDataUtil as U,
|
|
6261
|
+
OCR_MODEL_PRECISION_ENUM_KEY as V,
|
|
6262
|
+
getAppInfo as W,
|
|
6263
|
+
getSuiteKey as X,
|
|
6264
|
+
isBlank$2 as Y,
|
|
6265
|
+
isEqmSuite as Z,
|
|
6071
6266
|
_sfc_main$5 as _,
|
|
6072
6267
|
useTmplBom as a,
|
|
6268
|
+
pickObjectFieldKeys as a0,
|
|
6269
|
+
resolveUdiQuery as a1,
|
|
6073
6270
|
buildObjectLotExtraQuery as b,
|
|
6074
6271
|
resolveObjectBomEntry as c,
|
|
6075
6272
|
runWithFillProduct as d,
|
|
6076
6273
|
applyConsumeObjectTraceChange as e,
|
|
6077
|
-
|
|
6274
|
+
fetchUdi as f,
|
|
6078
6275
|
getObjectBomMaterialLotQuery as g,
|
|
6079
|
-
|
|
6276
|
+
fetchOperationReceiveQty as h,
|
|
6080
6277
|
isEdhrSuite as i,
|
|
6081
|
-
|
|
6082
|
-
|
|
6083
|
-
|
|
6084
|
-
|
|
6278
|
+
getObjectBomProductQuery as j,
|
|
6279
|
+
useStyles as k,
|
|
6280
|
+
useValidator as l,
|
|
6281
|
+
DocumentPaper as m,
|
|
6085
6282
|
normalizeFieldWidth as n,
|
|
6086
|
-
|
|
6087
|
-
|
|
6283
|
+
DynamicTableAction as o,
|
|
6284
|
+
MaterialConsumeTableController as p,
|
|
6088
6285
|
SubTableActionMenuTypeEnum as q,
|
|
6089
6286
|
resolveObjectFieldKeys as r,
|
|
6090
6287
|
getMenuByAction as s,
|
|
6091
6288
|
SubTableActionEnum as t,
|
|
6092
6289
|
useFormTmplConfig as u,
|
|
6093
6290
|
validateObjectBomForScan as v,
|
|
6094
|
-
|
|
6095
|
-
|
|
6096
|
-
|
|
6097
|
-
|
|
6291
|
+
resolveScanFillData as w,
|
|
6292
|
+
SubTableCore as x,
|
|
6293
|
+
getInsertSubMenu as y,
|
|
6294
|
+
resolveScanAdjustType as z
|
|
6098
6295
|
};
|