@gct-paas/excel 0.1.39-beta.2 → 0.1.39-beta.21
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-vgYIyddq.js → BaseComponent-DuVlKAnk.js} +2 -2
- package/dist/{VueVideoPlayer-Ca2aYCnh.js → VueVideoPlayer-BlB2c7W0.js} +2 -2
- package/dist/{align-editor-Bpdx7EAg.js → align-editor-wPpZ_4zH.js} +1 -1
- package/dist/{barcode-design-l88FtSJH.js → barcode-design-eIy9Jo3b.js} +2 -2
- package/dist/base/index.es.js +485 -194
- package/dist/{diagonal-design-BrC_JEX_.js → diagonal-design-_BNVSp15.js} +2 -2
- package/dist/{dynamic-table-action--l3y-33T.js → dynamic-table-action-cb-6H4R2.js} +325 -258
- package/dist/{dynamic-table-action.vue_vue_type_style_index_0_scoped_53d7e66c_lang-D-u5mq0C.js → dynamic-table-action.vue_vue_type_style_index_0_scoped_53d7e66c_lang-BmECtuSE.js} +328 -284
- package/dist/{edit.utils-CXmmCnxE-CLHOa5aM.js → edit.utils-CXmmCnxE-CQiGidG5.js} +1 -1
- package/dist/excel.css +473 -284
- package/dist/{exceljs.min-DC03-hj2.js → exceljs.min-CZa2mjfK.js} +2 -2
- package/dist/{font-editor-Cdbnw5gf.js → font-editor-c7CowiTX.js} +3 -3
- package/dist/{image-design-B2Ujtrgf.js → image-design-DbOmyTpn.js} +2 -2
- package/dist/{index-2FOQLZQX.js → index-2Vv4Nw6L.js} +2 -2
- package/dist/{index-CosS1BAQ.js → index-B4LBLC9w.js} +1 -1
- package/dist/{index-VbeM2qtu.js → index-BBfo_rmJ.js} +2 -2
- package/dist/{index-Cy3W1BCw.js → index-BD_l8t-r.js} +4 -4
- package/dist/{index-qIYTDaGB.js → index-BH365AyZ.js} +3 -3
- package/dist/{index-CdmpbReR.js → index-Bgr6S6x6.js} +2 -2
- package/dist/{index-DAOq48BR.js → index-BhJGnoAZ.js} +2 -2
- package/dist/{index-Dfx_FNTM.js → index-BsSL0R1j.js} +2 -2
- package/dist/{index-q6aP_omk.js → index-C-urdRZ2.js} +1 -1
- package/dist/{index-NJMyznIn.js → index-CA07wQMJ.js} +3 -3
- package/dist/{index-BwPjN5_z.js → index-CAGghO4i.js} +2 -2
- package/dist/{index-CCJHoK5a.js → index-CCyMfv1Z.js} +2 -2
- package/dist/{index-DHi56KLO.js → index-CPQNMrdO.js} +1 -1
- package/dist/{index-OtzvrfOW.js → index-CRo6J80n.js} +2 -2
- package/dist/{index-CinlHNlv.js → index-CSlejyqH.js} +1 -1
- package/dist/{index-BObb1Ah_.js → index-CksQHOUM.js} +2 -2
- package/dist/{index-ElmEtsp1.js → index-CvPWXCmn.js} +1 -1
- package/dist/{index-d-BkSigM.js → index-CyX1kNkY.js} +1 -1
- package/dist/{index-CyRyKW5Z.js → index-Cz1FK52K.js} +2 -2
- package/dist/{index-BTt4zC25.js → index-D2NnQYm7.js} +1252 -1048
- package/dist/{index-DoKgmcyb.js → index-DOiOWH2x.js} +2 -2
- package/dist/{index-BHrga-sR.js → index-DUXHvUXT.js} +2 -2
- package/dist/{index-BP9XsPy_.js → index-DaYPI9DA.js} +1 -1
- package/dist/{index-Bt1-V2lW.js → index-DcePcIKd.js} +3 -3
- package/dist/{index-isNDc9Eg.js → index-Dkj2h_zE.js} +2 -2
- package/dist/{index-DLURy62t.js → index-DpRoz6eZ.js} +2 -2
- package/dist/{index-CFr4e8Xs.js → index-Dq8DSt0w.js} +1 -1
- package/dist/{index-BmkcFEIb.js → index-DrWkEAL9.js} +2 -2
- package/dist/{index-BqWM4biL.js → index-DyZzboE8.js} +2 -2
- package/dist/{index-BfvMXo6W.js → index-Dzqrtkn_.js} +2 -2
- package/dist/{index-1RcD_jJ_.js → index-N2ZMSuL6.js} +1 -1
- package/dist/{index-CbXb5NUR.js → index-cunDtoJs.js} +2 -2
- package/dist/{index-C2NlobVm.js → index-haSf7Cn8.js} +1 -1
- package/dist/{index-BOw6pLMO.js → index-kcIzcNba.js} +4 -4
- package/dist/{index-Ls2829xQ.js → index-l8FZ6Q3X.js} +53 -5
- package/dist/index.es.js +2 -2
- package/dist/{mb-render-BcBofCau.js → mb-render-DjXYXimz.js} +9 -3
- package/dist/{online-form-model-select.vue_vue_type_script_setup_true_name_online-form-model-select_lang-D8-YBa_f.js → online-form-model-select.vue_vue_type_script_setup_true_name_online-form-model-select_lang-CtYTpCF6.js} +8 -1
- package/dist/{pagination-design-C6BIV4Ko.js → pagination-design-Gv7xyOs2.js} +2 -2
- package/dist/paper-widget-design-DjjE1TJi.js +4 -0
- package/dist/{print-runtime-instance-BuO2RPZB.js → print-runtime-instance-DASPx9wj.js} +1 -1
- package/dist/{print-snapshot-renderer-CJiTu8_l.js → print-snapshot-renderer-dUe9-cUA.js} +3 -3
- package/dist/{qrcode-design-DCAMHxR6.js → qrcode-design-CBPXRrbn.js} +1 -1
- package/dist/{revo-grid.entry-s6oHfg7z.js → revo-grid.entry-DORNB4cp.js} +1 -1
- package/dist/{revogr-attribution_7.entry-CBEbTBbC.js → revogr-attribution_7.entry-CrdX04rF.js} +3 -3
- package/dist/{revogr-clipboard_3.entry-DtE8OXYS.js → revogr-clipboard_3.entry-CWLVEZnP.js} +2 -2
- package/dist/{revogr-data_4.entry-seTKTkAE.js → revogr-data_4.entry-Bs8mqW3y.js} +2 -2
- package/dist/{revogr-filter-panel.entry-DSQR-lUK.js → revogr-filter-panel.entry-CTN0T0tx.js} +1 -1
- package/dist/seal-design-Dr_q6TYV.js +4 -0
- package/dist/{serialnumber-design-B3WHGrfc.js → serialnumber-design-BSgTQN0r.js} +1 -1
- package/dist/shared/index.es.js +10 -8
- package/dist/{single-field-drop-DFjo8ISo.js → single-field-drop-DlOiRRig.js} +2 -2
- package/dist/{size-editor-DKJpM9UW.js → size-editor-DQJIuZCE.js} +1 -1
- package/dist/src/nocode-base/src/core/sub-table/pretreatment-list-table-core.d.ts +1 -0
- package/dist/src/nocode-base/src/core/sub-table/sub-table-core.d.ts +2 -1
- package/dist/src/nocode-base/src/hooks/form-model/form-model-controller.d.ts +2 -0
- package/dist/src/nocode-base/src/hooks/material-consume/material-consume-table-controller.d.ts +1 -0
- package/dist/src/nocode-base/src/hooks/material-consume/tmpl-bom-controller.d.ts +12 -7
- package/dist/src/nocode-base/src/hooks/material-consume-object/bom-validator.d.ts +4 -3
- package/dist/src/nocode-base/src/hooks/material-consume-object/initialize-autofill.d.ts +17 -0
- package/dist/src/nocode-base/src/hooks/material-consume-object/object-validation-controller.d.ts +24 -0
- package/dist/src/nocode-base/src/interface/render.d.ts +3 -1
- package/dist/src/nocode-base/src/interface/transform.d.ts +9 -1
- package/dist/src/nocode-base/src/runtime/async-task-coordinator.d.ts +6 -2
- package/dist/src/nocode-base/src/runtime/multi-sheet-runtime.d.ts +2 -0
- package/dist/src/nocode-base/src/runtime/runtime-field-initializer.d.ts +1 -1
- package/dist/src/nocode-base/src/runtime/runtime-validation-service.d.ts +1 -0
- package/dist/src/nocode-base/src/types/render/mc-render.d.ts +1 -1
- package/dist/src/nocode-base/src/types/render/sub-table-render.d.ts +5 -1
- package/dist/src/nocode-web-render/src/render/sub-table/common/inventory-scan-columns.d.ts +6 -0
- package/dist/src/nocode-web-render/src/render/sub-table/material-consume/mc-web-render.d.ts +1 -1
- package/dist/src/online-form/src/views/__cell_widgets__/cell-widget-design.vue.d.ts +1 -0
- package/dist/src/online-form/src/views/__cell_widgets__/common/display-fields-editor/display-fields.util.d.ts +2 -2
- package/dist/src/online-form/src/views/__cell_widgets__/fake-field/fake-option-select.vue.d.ts +1 -0
- package/dist/src/online-form/src/views/designer/conversions/normalize-paper-grid.d.ts +3 -0
- package/dist/src/online-form/src/views/render/__components__/_field_/trace/utils/use-rule-props.d.ts +0 -3
- package/dist/src/online-form/src/views/render/sheet-tab-bar.vue.d.ts +5 -3
- package/dist/src/shared/enum/index.d.ts +2 -0
- package/dist/src/shared/enum/product-type.d.ts +9 -0
- package/dist/src/shared/enum/production-identification.d.ts +19 -0
- package/dist/{sub-table-factory-5l0MTqvt.js → sub-table-factory-Bnb8zZTb.js} +31 -12
- package/dist/{text-design-B69j6Z_b.js → text-design-D9n2Q3EK.js} +2 -2
- package/dist/{throttle-Cpk1LoGk-DfnQ57mt.js → throttle-Cpk1LoGk-w1fTQ4cj.js} +1 -1
- package/dist/{timediff-design-BUqlRNkO.js → timediff-design-BIyHZKid.js} +1 -1
- package/dist/{trace-like-wrapper-D5VFdJ3W.js → trace-like-wrapper-CXPDvRH0.js} +2 -2
- package/dist/{value-editor.vue_vue_type_style_index_0_lang-CEuFEVMv.js → value-editor.vue_vue_type_style_index_0_lang-BzBps2FA.js} +2 -2
- package/dist/web-render/index.es.js +3 -3
- package/dist/{widget-barcode-Bt55wEEk.js → widget-barcode-D3wbP7XT.js} +4 -4
- package/dist/{widget-diagonal-BSkoDXjJ.js → widget-diagonal-CRERJEJZ.js} +3 -3
- package/dist/{widget-image-BxycuGZB.js → widget-image-B4DXAEvK.js} +5 -5
- package/dist/{widget-line-DZ9sK1Zj.js → widget-line-BlHqjxIt.js} +2 -2
- package/dist/{widget-pagination-WerXXmx2.js → widget-pagination-BzmXHdR9.js} +5 -5
- package/dist/{widget-power-Bln2T1C-.js → widget-power-C0_OBETn.js} +3 -3
- package/dist/{widget-qrcode-BQWQXzru.js → widget-qrcode-Dct2jsRQ.js} +3 -3
- package/dist/{widget-rangelimit-E8yqsqv3.js → widget-rangelimit-CteDgTSI.js} +3 -3
- package/dist/{widget-serialnumber-Css27nM1.js → widget-serialnumber-u3zQMmmj.js} +1 -1
- package/dist/{widget-text-CD6_nGlp.js → widget-text-Bg-mgeq7.js} +5 -5
- package/dist/{widget-timediff-DQPeQkkV.js → widget-timediff-C3cRAguz.js} +2 -2
- package/package.json +2 -2
- package/dist/paper-widget-design-DujWhnh6.js +0 -4
- package/dist/seal-design--ciGkbUu.js +0 -4
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { reactive, toRaw, computed, watch, onScopeDispose, inject, h, shallowReactive, markRaw, ref, nextTick, toRef, provide, defineComponent, openBlock, createElementBlock, mergeProps, unref, createElementVNode, normalizeClass, renderSlot, createCommentVNode, createVNode, toDisplayString, Fragment, renderList, onUnmounted, isVNode, onMounted, onBeforeMount, resolveComponent, createBlock, withCtx, createTextVNode } from "vue";
|
|
2
|
-
import { ai as CellWidgetViewState, F as FIELD_TYPE,
|
|
2
|
+
import { ai as CellWidgetViewState, F as FIELD_TYPE, b9 as RenderModeEnum, Y as FormTypeEnum, bF as BpmnNodeTypeEnum, cw as getFieldPlaceholder, bW as MobileFillTypeEnum, C as ComponentTypeEnum, $ as PlatformEnum, cx as isReferenceOptionActive, E as api, bv as uuid2, c4 as calcUtils, bk as findRuntimeTableRow, c8 as ensureTableRowKeys, c1 as bindRuntimeTableColumns, bj as getRowId, cy as FRONT_ROW_KEY, cn as isTableRowKeyMatch, bx as isAttachFieldActive, cz as filterRulesByTrigger, cA as isEmptyValue$1, c5 as decodeTableCellRowKey, c7 as ensureFrontRowKey, b1 as getParseRuleInfo, aF as transformUtils, aY as materialCheck, aZ as getLotLockedReason, a_ as validateReinspectionDate, bo as FormulaRuleFieldKeyEnum, f as SubTableType, b2 as getParseRuleValue, cB as buildError, H as CreateType, bm as findRuntimeParentRow, aI as Dependency_ENUM, aH as ASSIGNMENTSTRATEGY_ENUM, bK as commonUtils, aM as DeviceLink, a8 as _export_sfc, ch as getRenderedRuntimeTableCell, y as CellType, cr as relocateDeletedRowsToEnd, cC as resetTableRowIdentity, J as useModal, cD as q, cE as QUICK_FILL_ALLOWED_FIELDS, cF as groupFixedTableRows, cG as processQuickFillRows, cH as getIsGroupEmpty } from "./dynamic-table-action.vue_vue_type_style_index_0_scoped_53d7e66c_lang-BmECtuSE.js";
|
|
3
3
|
import { cloneDeep, isEmpty, has, pickBy, isNil, mergeWith, omit, last, pick, merge } from "lodash-es";
|
|
4
4
|
import dayjs from "dayjs";
|
|
5
5
|
import { a as useNamespace, I as Icon } from "./AntdIcon-DCIaV352.js";
|
|
6
6
|
import { Modal, message } from "ant-design-vue";
|
|
7
|
-
import { u as useFormModel } from "./mb-render-
|
|
7
|
+
import { u as useFormModel } from "./mb-render-DjXYXimz.js";
|
|
8
8
|
var MaterialConsumptionPatternEnum = /* @__PURE__ */ ((MaterialConsumptionPatternEnum2) => {
|
|
9
9
|
MaterialConsumptionPatternEnum2["RECORD"] = "record";
|
|
10
10
|
MaterialConsumptionPatternEnum2["BOM"] = "bom";
|
|
@@ -942,6 +942,8 @@ function convertV1Runtime(runtime) {
|
|
|
942
942
|
return { schemaVersion: 1, formConfig, sheets: [sheet] };
|
|
943
943
|
}
|
|
944
944
|
const MULTI_SHEET_SCHEMA_VERSION = 2;
|
|
945
|
+
const MAX_RUNTIME_SHEETS = 100;
|
|
946
|
+
const MAX_RUNTIME_SHEET_TITLE_LENGTH = 255;
|
|
945
947
|
function assertObject(value, message2) {
|
|
946
948
|
if (!value || typeof value !== "object" || Array.isArray(value)) throw new Error(message2);
|
|
947
949
|
}
|
|
@@ -1007,7 +1009,9 @@ function normalizeRuntime(runtime) {
|
|
|
1007
1009
|
if (!Array.isArray(runtime.sheets) || runtime.sheets.length === 0) {
|
|
1008
1010
|
throw new Error("多 Sheet 运行时至少需要一个工作表");
|
|
1009
1011
|
}
|
|
1010
|
-
if (runtime.sheets.length >
|
|
1012
|
+
if (runtime.sheets.length > MAX_RUNTIME_SHEETS) {
|
|
1013
|
+
throw new Error(`每份表单最多支持 ${MAX_RUNTIME_SHEETS} 个工作表`);
|
|
1014
|
+
}
|
|
1011
1015
|
const formConfig = runtime.formConfig ?? {};
|
|
1012
1016
|
assertObject(formConfig, "多 Sheet 运行时的 formConfig 格式无效");
|
|
1013
1017
|
const ids = /* @__PURE__ */ new Set();
|
|
@@ -1018,7 +1022,9 @@ function normalizeRuntime(runtime) {
|
|
|
1018
1022
|
const sheetId = String(rawSheet.sheetId ?? "").trim();
|
|
1019
1023
|
const title = String(rawSheet.title ?? "").trim();
|
|
1020
1024
|
if (!sheetId) throw new Error(`第 ${index + 1} 个工作表缺少 sheetId`);
|
|
1021
|
-
if (!title || title.length >
|
|
1025
|
+
if (!title || title.length > MAX_RUNTIME_SHEET_TITLE_LENGTH) {
|
|
1026
|
+
throw new Error(`工作表名称必须为 1 到 ${MAX_RUNTIME_SHEET_TITLE_LENGTH} 个字符:${title}`);
|
|
1027
|
+
}
|
|
1022
1028
|
if (ids.has(sheetId)) throw new Error(`重复的 sheetId:${sheetId}`);
|
|
1023
1029
|
if (titles.has(title)) throw new Error(`重复的工作表名称:${title}`);
|
|
1024
1030
|
ids.add(sheetId);
|
|
@@ -1715,12 +1721,28 @@ class RuntimeFormStateStore {
|
|
|
1715
1721
|
incoming.forEach((savedRow) => {
|
|
1716
1722
|
const rowKey = savedRow?.[FRONT_ROW_KEY];
|
|
1717
1723
|
const savedId = savedRow?.id_;
|
|
1718
|
-
|
|
1724
|
+
let currentRow = target.find((row) => {
|
|
1719
1725
|
if (!row || typeof row !== "object") return false;
|
|
1720
1726
|
if (rowKey != null && isTableRowKeyMatch(rowKey, row[FRONT_ROW_KEY])) return true;
|
|
1721
1727
|
return savedId != null && row.id_ != null && String(row.id_) === String(savedId);
|
|
1722
1728
|
});
|
|
1723
|
-
|
|
1729
|
+
let matchedByGroup = false;
|
|
1730
|
+
if (!currentRow && Array.isArray(savedRow?._2DTABLE_) && savedRow.group_ != null && String(savedRow.group_).trim() !== "") {
|
|
1731
|
+
const matchingGroups = target.filter(
|
|
1732
|
+
(row) => Array.isArray(row?._2DTABLE_) && row.group_ != null && String(row.group_) === String(savedRow.group_)
|
|
1733
|
+
);
|
|
1734
|
+
if (matchingGroups.length === 1) {
|
|
1735
|
+
currentRow = matchingGroups[0];
|
|
1736
|
+
matchedByGroup = true;
|
|
1737
|
+
}
|
|
1738
|
+
}
|
|
1739
|
+
if (currentRow) {
|
|
1740
|
+
this.mergeSavedMetadata(
|
|
1741
|
+
currentRow,
|
|
1742
|
+
matchedByGroup ? { ...savedRow, [FRONT_ROW_KEY]: currentRow[FRONT_ROW_KEY] } : savedRow,
|
|
1743
|
+
path
|
|
1744
|
+
);
|
|
1745
|
+
}
|
|
1724
1746
|
});
|
|
1725
1747
|
return target;
|
|
1726
1748
|
}
|
|
@@ -1816,6 +1838,7 @@ class RuntimeAsyncTaskCoordinator {
|
|
|
1816
1838
|
fieldIdentity: options.fieldIdentity,
|
|
1817
1839
|
sheetId: options.sheetId,
|
|
1818
1840
|
required: options.required !== false,
|
|
1841
|
+
blockOnFailure: options.blockOnFailure !== false,
|
|
1819
1842
|
status: "pending",
|
|
1820
1843
|
sequence,
|
|
1821
1844
|
promise: task,
|
|
@@ -1859,7 +1882,7 @@ class RuntimeAsyncTaskCoordinator {
|
|
|
1859
1882
|
* 等待全部 required 任务达到稳定状态。
|
|
1860
1883
|
*
|
|
1861
1884
|
* 一轮任务完成后的字段回填可能触发新的公式或远程任务,因此这里循环读取任务表,直到
|
|
1862
|
-
* 没有新的 pending required
|
|
1885
|
+
* 没有新的 pending required 任务。稳定后只检查需要阻断提交的失败项。
|
|
1863
1886
|
*/
|
|
1864
1887
|
async waitForRequired(keyPrefix) {
|
|
1865
1888
|
const matches = (task) => task.required && (!keyPrefix || task.key.startsWith(keyPrefix));
|
|
@@ -1871,7 +1894,7 @@ class RuntimeAsyncTaskCoordinator {
|
|
|
1871
1894
|
await Promise.allSettled(pending.map((task) => task.promise));
|
|
1872
1895
|
}
|
|
1873
1896
|
const failed = Array.from(this.tasks.values()).filter(
|
|
1874
|
-
(task) => matches(task) && task.status === "rejected"
|
|
1897
|
+
(task) => matches(task) && task.blockOnFailure && task.status === "rejected"
|
|
1875
1898
|
);
|
|
1876
1899
|
if (failed.length) {
|
|
1877
1900
|
const details = failed.map((task) => {
|
|
@@ -3217,11 +3240,12 @@ class RuntimeValidationService {
|
|
|
3217
3240
|
this.pendingLive = this.pendingLive === "blur" ? "blur" : trigger;
|
|
3218
3241
|
if (this.liveTimer) clearTimeout(this.liveTimer);
|
|
3219
3242
|
this.liveTimer = void 0;
|
|
3220
|
-
if (immediate)
|
|
3243
|
+
if (immediate)
|
|
3244
|
+
void this.flushLive().catch((error) => this.logBackgroundError("字段校验失败", error));
|
|
3221
3245
|
else
|
|
3222
3246
|
this.liveTimer = setTimeout(() => {
|
|
3223
3247
|
this.liveTimer = void 0;
|
|
3224
|
-
void this.flushLive().catch((error) =>
|
|
3248
|
+
void this.flushLive().catch((error) => this.logBackgroundError("字段校验失败", error));
|
|
3225
3249
|
}, 300);
|
|
3226
3250
|
}
|
|
3227
3251
|
async flushLive() {
|
|
@@ -3243,11 +3267,17 @@ class RuntimeValidationService {
|
|
|
3243
3267
|
this.displayTimer = void 0;
|
|
3244
3268
|
const run = () => {
|
|
3245
3269
|
this.displayTimer = void 0;
|
|
3246
|
-
void this.validate("display").catch(
|
|
3270
|
+
void this.validate("display").catch(
|
|
3271
|
+
(error) => this.logBackgroundError("字段展示校验失败", error)
|
|
3272
|
+
);
|
|
3247
3273
|
};
|
|
3248
3274
|
if (immediate) run();
|
|
3249
3275
|
else this.displayTimer = setTimeout(run, 320);
|
|
3250
3276
|
}
|
|
3277
|
+
logBackgroundError(label, error) {
|
|
3278
|
+
if (error instanceof Error && error.message.startsWith("以下异步任务执行失败:")) return;
|
|
3279
|
+
console.error(label, error);
|
|
3280
|
+
}
|
|
3251
3281
|
pruneComments() {
|
|
3252
3282
|
if (!this.binding || this.disposed) return;
|
|
3253
3283
|
this.binding.applyComments(
|
|
@@ -4582,7 +4612,16 @@ class BomEntriesValidator {
|
|
|
4582
4612
|
memberIndexes.push(idx);
|
|
4583
4613
|
if (byLot && !row.material_no_) emptyLotIndexes.push(idx);
|
|
4584
4614
|
});
|
|
4585
|
-
const
|
|
4615
|
+
const targetExists = this.groupExistsInTable(arr, target);
|
|
4616
|
+
if (!targetExists) {
|
|
4617
|
+
const index = arr.findIndex((row2) => !row2.deleted_);
|
|
4618
|
+
const row = arr[index];
|
|
4619
|
+
const canReuse = row && !row.product_id_ && !row.bom_entry_id_ && !row.is_confirmed_ && arr.every((item, idx) => item.deleted_ || idx === index);
|
|
4620
|
+
if (canReuse) {
|
|
4621
|
+
emptyProductIndexes.push(index);
|
|
4622
|
+
}
|
|
4623
|
+
}
|
|
4624
|
+
const needInsert = !targetExists && emptyProductIndexes.length === 0;
|
|
4586
4625
|
const last2 = memberIndexes[memberIndexes.length - 1];
|
|
4587
4626
|
let groupInsertIndex = -1;
|
|
4588
4627
|
if (needInsert) {
|
|
@@ -5207,7 +5246,8 @@ class MaterialConsumeTableController {
|
|
|
5207
5246
|
constructor(tmplBomController, tmplBom, options = {}) {
|
|
5208
5247
|
this.tmplBomController = tmplBomController;
|
|
5209
5248
|
this.tmplBom = tmplBom;
|
|
5210
|
-
if (!options.printOnly
|
|
5249
|
+
if (!options.printOnly && this.hasFormInstance)
|
|
5250
|
+
this.initScanRule(this.tmplBom.barcode_parsing_rules_id_);
|
|
5211
5251
|
this.scanParamType = this.tmplBom.scan_param_type_;
|
|
5212
5252
|
markRaw(this);
|
|
5213
5253
|
this.bomEntriesValidator = new BomEntriesValidator(
|
|
@@ -5270,6 +5310,9 @@ class MaterialConsumeTableController {
|
|
|
5270
5310
|
get mcPattern() {
|
|
5271
5311
|
return this.tmplBom.material_consumption_pattern_ ?? this.tmplBomController.defaultMCPattern;
|
|
5272
5312
|
}
|
|
5313
|
+
get hasFormInstance() {
|
|
5314
|
+
return this.tmplBomController.hasFormInstance;
|
|
5315
|
+
}
|
|
5273
5316
|
/**
|
|
5274
5317
|
* 解析规则数据对象
|
|
5275
5318
|
*/
|
|
@@ -5522,6 +5565,10 @@ class MaterialConsumeTableController {
|
|
|
5522
5565
|
}
|
|
5523
5566
|
const isRecordPattern = this.mcPattern === MaterialConsumptionPatternEnum.RECORD && !this.tmplBom.personal_bom_enabled_;
|
|
5524
5567
|
console.log("parseScanStr", data);
|
|
5568
|
+
if (!data.lot && !data.uniqueCode) {
|
|
5569
|
+
this.error($t("sys.edhr.mcTable.lotOrUniqueCodeRequired"));
|
|
5570
|
+
return;
|
|
5571
|
+
}
|
|
5525
5572
|
const arr = await materialCheck({
|
|
5526
5573
|
material_no_: data.materialCode,
|
|
5527
5574
|
production_identification_name_: data.lot,
|
|
@@ -6016,7 +6063,16 @@ class MaterialConsumeTableController {
|
|
|
6016
6063
|
this.error(msg);
|
|
6017
6064
|
return;
|
|
6018
6065
|
}
|
|
6019
|
-
if (!value)
|
|
6066
|
+
if (!value) {
|
|
6067
|
+
if (row.product_id_ && !this.isCustomRequiredQty) {
|
|
6068
|
+
const util = this.bomEntriesValidator.findUtilByProductId(row.product_id_);
|
|
6069
|
+
if (util) {
|
|
6070
|
+
row.qty_required_ = util.total;
|
|
6071
|
+
}
|
|
6072
|
+
}
|
|
6073
|
+
this.updateDerivedQtyFields();
|
|
6074
|
+
return;
|
|
6075
|
+
}
|
|
6020
6076
|
try {
|
|
6021
6077
|
await validateReinspectionDate({
|
|
6022
6078
|
product_id_: option.product_id_ ?? row.product_id_,
|
|
@@ -6040,6 +6096,7 @@ class MaterialConsumeTableController {
|
|
|
6040
6096
|
const qty = oldGroupId && row.bom_entry_id_ === oldGroupId ? oldRequiredQty : this.getCustomGroupRequiredQty(row);
|
|
6041
6097
|
this.setCustomGroupRequiredQty(row, qty);
|
|
6042
6098
|
}
|
|
6099
|
+
this.updateDerivedQtyFields();
|
|
6043
6100
|
} else if (field === "qty_") {
|
|
6044
6101
|
this.updateDerivedQtyFields();
|
|
6045
6102
|
}
|
|
@@ -6674,11 +6731,12 @@ class SubTableCore {
|
|
|
6674
6731
|
/**
|
|
6675
6732
|
* 扫码多条候选时选择一行(1 条自动选中)
|
|
6676
6733
|
*/
|
|
6677
|
-
async pickScanRecord(records) {
|
|
6734
|
+
async pickScanRecord(records, options = {}) {
|
|
6678
6735
|
if (!records.length) return void 0;
|
|
6679
6736
|
if (records.length === 1) return records[0];
|
|
6680
6737
|
return this.render.openMultiRowsModal({
|
|
6681
|
-
rows: mapScanRecordsForPicker(records)
|
|
6738
|
+
rows: mapScanRecordsForPicker(records),
|
|
6739
|
+
...options
|
|
6682
6740
|
});
|
|
6683
6741
|
}
|
|
6684
6742
|
/**
|
|
@@ -6904,7 +6962,7 @@ async function validateObjectBomQtyOnSubmit(opts) {
|
|
|
6904
6962
|
for (const obj of objectFieldList) {
|
|
6905
6963
|
if (!obj?.objectField) continue;
|
|
6906
6964
|
const objectBom = findObjectBom(formInstBom, obj.objectField);
|
|
6907
|
-
if (objectBom?.material_consumption_pattern_ === MaterialConsumptionPatternEnum.RECORD) {
|
|
6965
|
+
if (objectBom?.material_consumption_pattern_ === MaterialConsumptionPatternEnum.RECORD && !objectBom.personal_bom_enabled_) {
|
|
6908
6966
|
continue;
|
|
6909
6967
|
}
|
|
6910
6968
|
const { productKey, productFieldName, qtyKey, qtyRequiredKey, qtyFieldName } = pickObjectFieldKeys(obj.subFields, obj.objectField);
|
|
@@ -6965,150 +7023,6 @@ async function validateObjectBomQtyOnSubmit(opts) {
|
|
|
6965
7023
|
}
|
|
6966
7024
|
return errors;
|
|
6967
7025
|
}
|
|
6968
|
-
function isBlank(value) {
|
|
6969
|
-
return value == null || value === "";
|
|
6970
|
-
}
|
|
6971
|
-
function pickPresent(preferred, fallback) {
|
|
6972
|
-
return isBlank(preferred) ? fallback : preferred;
|
|
6973
|
-
}
|
|
6974
|
-
function resolveObjectFieldKeys(opts) {
|
|
6975
|
-
const obj = opts.objectFieldList?.find((item) => item.objectField === opts.belongingObject);
|
|
6976
|
-
const fromList = obj?.subFields ? pickObjectFieldKeys(obj.subFields, opts.belongingObject) : {};
|
|
6977
|
-
const fromFallback = pickObjectFieldKeys(opts.fallbackFields, opts.belongingObject, {
|
|
6978
|
-
requireUsed: false
|
|
6979
|
-
});
|
|
6980
|
-
return {
|
|
6981
|
-
productKey: pickPresent(fromList.productKey, fromFallback.productKey),
|
|
6982
|
-
productFieldName: fromList.productFieldName ?? fromFallback.productFieldName,
|
|
6983
|
-
materialNoKey: pickPresent(fromList.materialNoKey, fromFallback.materialNoKey),
|
|
6984
|
-
materialNoFieldName: fromList.materialNoFieldName ?? fromFallback.materialNoFieldName,
|
|
6985
|
-
qtyKey: pickPresent(fromList.qtyKey, fromFallback.qtyKey),
|
|
6986
|
-
qtyRequiredKey: pickPresent(fromList.qtyRequiredKey, fromFallback.qtyRequiredKey),
|
|
6987
|
-
qtyFieldName: fromList.qtyFieldName ?? fromFallback.qtyFieldName,
|
|
6988
|
-
bomEntryIdKey: pickPresent(fromList.bomEntryIdKey, fromFallback.bomEntryIdKey)
|
|
6989
|
-
};
|
|
6990
|
-
}
|
|
6991
|
-
function buildObjectLotExtraQuery(productId) {
|
|
6992
|
-
if (isBlank(productId)) return {};
|
|
6993
|
-
const versionId = String(productId).split(":").pop();
|
|
6994
|
-
if (!versionId) return {};
|
|
6995
|
-
return { "product_id_.versionEq": versionId };
|
|
6996
|
-
}
|
|
6997
|
-
function clearedLotFields(materialNoKey) {
|
|
6998
|
-
if (!materialNoKey) return {};
|
|
6999
|
-
return {
|
|
7000
|
-
[materialNoKey]: void 0,
|
|
7001
|
-
[`${materialNoKey}_id_`]: void 0,
|
|
7002
|
-
[`${materialNoKey}_lb_`]: void 0
|
|
7003
|
-
};
|
|
7004
|
-
}
|
|
7005
|
-
function shouldClearLotOnProductChange(opts) {
|
|
7006
|
-
const { prevProduct, nextProduct, lotValue } = opts;
|
|
7007
|
-
if (isBlank(prevProduct) && isBlank(nextProduct)) return false;
|
|
7008
|
-
if (prevProduct === nextProduct) return false;
|
|
7009
|
-
if (isBlank(prevProduct) && !isBlank(nextProduct) && !isBlank(lotValue)) {
|
|
7010
|
-
return false;
|
|
7011
|
-
}
|
|
7012
|
-
return true;
|
|
7013
|
-
}
|
|
7014
|
-
let fillingProduct = false;
|
|
7015
|
-
function runWithFillProduct(fn) {
|
|
7016
|
-
fillingProduct = true;
|
|
7017
|
-
try {
|
|
7018
|
-
fn();
|
|
7019
|
-
} finally {
|
|
7020
|
-
nextTick(() => {
|
|
7021
|
-
fillingProduct = false;
|
|
7022
|
-
});
|
|
7023
|
-
}
|
|
7024
|
-
}
|
|
7025
|
-
function resolveLotValidateParams(keys, formData, option) {
|
|
7026
|
-
return {
|
|
7027
|
-
product_id_: option?.product_id_ ?? option?._item?.product_id_ ?? (keys.productKey ? formData[keys.productKey] : void 0),
|
|
7028
|
-
material_no_: option?.name_ ?? option?.__VALUE__ ?? (keys.materialNoKey ? formData[keys.materialNoKey] : void 0),
|
|
7029
|
-
material_no_id_: option?.id_ ?? (keys.materialNoKey ? formData[`${keys.materialNoKey}_id_`] : void 0)
|
|
7030
|
-
};
|
|
7031
|
-
}
|
|
7032
|
-
async function applyConsumeObjectTraceChange(opts) {
|
|
7033
|
-
const { belongingObject, role, formData } = opts;
|
|
7034
|
-
if (!belongingObject || !formData) return {};
|
|
7035
|
-
const keys = resolveObjectFieldKeys({
|
|
7036
|
-
belongingObject,
|
|
7037
|
-
objectFieldList: opts.objectFieldList,
|
|
7038
|
-
fallbackFields: opts.fallbackFields
|
|
7039
|
-
});
|
|
7040
|
-
if (role === FIELD_TYPE.PRODUCT) {
|
|
7041
|
-
if (!("prevProduct" in opts) || fillingProduct) return {};
|
|
7042
|
-
const values = {};
|
|
7043
|
-
if (shouldClearLotOnProductChange({
|
|
7044
|
-
prevProduct: opts.prevProduct,
|
|
7045
|
-
nextProduct: opts.nextValue,
|
|
7046
|
-
lotValue: keys.materialNoKey ? formData[keys.materialNoKey] : void 0
|
|
7047
|
-
})) {
|
|
7048
|
-
Object.assign(values, clearedLotFields(keys.materialNoKey));
|
|
7049
|
-
}
|
|
7050
|
-
if (keys.bomEntryIdKey) {
|
|
7051
|
-
values[keys.bomEntryIdKey] = null;
|
|
7052
|
-
if (!isBlank(opts.nextValue) && opts.formInstBom) {
|
|
7053
|
-
const entry = resolveObjectBomEntry({
|
|
7054
|
-
formInstBom: opts.formInstBom,
|
|
7055
|
-
belongingObject,
|
|
7056
|
-
productId: String(opts.nextValue)
|
|
7057
|
-
});
|
|
7058
|
-
if (entry) values[keys.bomEntryIdKey] = entry.id_;
|
|
7059
|
-
}
|
|
7060
|
-
}
|
|
7061
|
-
opts.rowWriter.patchRow(values, "autofill");
|
|
7062
|
-
const lotValue = keys.materialNoKey ? formData[keys.materialNoKey] : void 0;
|
|
7063
|
-
if (!isBlank(opts.nextValue) && !isBlank(lotValue)) {
|
|
7064
|
-
try {
|
|
7065
|
-
await validateReinspectionDate({
|
|
7066
|
-
product_id_: String(opts.nextValue),
|
|
7067
|
-
material_no_: lotValue,
|
|
7068
|
-
material_no_id_: keys.materialNoKey ? formData[`${keys.materialNoKey}_id_`] : void 0
|
|
7069
|
-
});
|
|
7070
|
-
} catch (e) {
|
|
7071
|
-
return { abortReinspection: e?.message || String(e) };
|
|
7072
|
-
}
|
|
7073
|
-
}
|
|
7074
|
-
return {};
|
|
7075
|
-
}
|
|
7076
|
-
if (role === FIELD_TYPE.MATERIAL_NO) {
|
|
7077
|
-
if (opts.option?.is_locked_) {
|
|
7078
|
-
opts.rowWriter.patchRow(clearedLotFields(keys.materialNoKey), "autofill");
|
|
7079
|
-
return { abortLocked: opts.option.id_ };
|
|
7080
|
-
}
|
|
7081
|
-
const params = resolveLotValidateParams(keys, formData, opts.option);
|
|
7082
|
-
if (isBlank(params.material_no_) && isBlank(params.material_no_id_)) return {};
|
|
7083
|
-
try {
|
|
7084
|
-
await validateReinspectionDate(params);
|
|
7085
|
-
} catch (e) {
|
|
7086
|
-
opts.rowWriter.patchRow(clearedLotFields(keys.materialNoKey), "async");
|
|
7087
|
-
return { abortReinspection: e?.message || String(e) };
|
|
7088
|
-
}
|
|
7089
|
-
const values = {};
|
|
7090
|
-
const productId = opts.option?.product_id_ ?? opts.option?._item?.product_id_;
|
|
7091
|
-
if (keys.productKey && !isBlank(productId)) values[keys.productKey] = productId;
|
|
7092
|
-
if (keys.bomEntryIdKey && opts.formInstBom) {
|
|
7093
|
-
if (!isBlank(productId)) {
|
|
7094
|
-
const entry = resolveObjectBomEntry({
|
|
7095
|
-
formInstBom: opts.formInstBom,
|
|
7096
|
-
belongingObject,
|
|
7097
|
-
productId: String(productId)
|
|
7098
|
-
});
|
|
7099
|
-
if (entry) values[keys.bomEntryIdKey] = entry.id_;
|
|
7100
|
-
}
|
|
7101
|
-
}
|
|
7102
|
-
const patchRelatedFields = () => opts.rowWriter.patchRow(values, "autofill");
|
|
7103
|
-
if (keys.productKey && !isBlank(productId)) {
|
|
7104
|
-
runWithFillProduct(patchRelatedFields);
|
|
7105
|
-
} else {
|
|
7106
|
-
patchRelatedFields();
|
|
7107
|
-
}
|
|
7108
|
-
return {};
|
|
7109
|
-
}
|
|
7110
|
-
return {};
|
|
7111
|
-
}
|
|
7112
7026
|
function useRuntimeRowState(rowSource) {
|
|
7113
7027
|
const { formStateStore } = useRuntimeInstanceServices();
|
|
7114
7028
|
function requireStore() {
|
|
@@ -7855,6 +7769,150 @@ function useFormTmplConfig() {
|
|
|
7855
7769
|
injectController
|
|
7856
7770
|
};
|
|
7857
7771
|
}
|
|
7772
|
+
function isBlank(value) {
|
|
7773
|
+
return value == null || value === "";
|
|
7774
|
+
}
|
|
7775
|
+
function pickPresent(preferred, fallback) {
|
|
7776
|
+
return isBlank(preferred) ? fallback : preferred;
|
|
7777
|
+
}
|
|
7778
|
+
function resolveObjectFieldKeys(opts) {
|
|
7779
|
+
const obj = opts.objectFieldList?.find((item) => item.objectField === opts.belongingObject);
|
|
7780
|
+
const fromList = obj?.subFields ? pickObjectFieldKeys(obj.subFields, opts.belongingObject) : {};
|
|
7781
|
+
const fromFallback = pickObjectFieldKeys(opts.fallbackFields, opts.belongingObject, {
|
|
7782
|
+
requireUsed: false
|
|
7783
|
+
});
|
|
7784
|
+
return {
|
|
7785
|
+
productKey: pickPresent(fromList.productKey, fromFallback.productKey),
|
|
7786
|
+
productFieldName: fromList.productFieldName ?? fromFallback.productFieldName,
|
|
7787
|
+
materialNoKey: pickPresent(fromList.materialNoKey, fromFallback.materialNoKey),
|
|
7788
|
+
materialNoFieldName: fromList.materialNoFieldName ?? fromFallback.materialNoFieldName,
|
|
7789
|
+
qtyKey: pickPresent(fromList.qtyKey, fromFallback.qtyKey),
|
|
7790
|
+
qtyRequiredKey: pickPresent(fromList.qtyRequiredKey, fromFallback.qtyRequiredKey),
|
|
7791
|
+
qtyFieldName: fromList.qtyFieldName ?? fromFallback.qtyFieldName,
|
|
7792
|
+
bomEntryIdKey: pickPresent(fromList.bomEntryIdKey, fromFallback.bomEntryIdKey)
|
|
7793
|
+
};
|
|
7794
|
+
}
|
|
7795
|
+
function buildObjectLotExtraQuery(productId) {
|
|
7796
|
+
if (isBlank(productId)) return {};
|
|
7797
|
+
const versionId = String(productId).split(":").pop();
|
|
7798
|
+
if (!versionId) return {};
|
|
7799
|
+
return { "product_id_.versionEq": versionId };
|
|
7800
|
+
}
|
|
7801
|
+
function clearedLotFields(materialNoKey) {
|
|
7802
|
+
if (!materialNoKey) return {};
|
|
7803
|
+
return {
|
|
7804
|
+
[materialNoKey]: void 0,
|
|
7805
|
+
[`${materialNoKey}_id_`]: void 0,
|
|
7806
|
+
[`${materialNoKey}_lb_`]: void 0
|
|
7807
|
+
};
|
|
7808
|
+
}
|
|
7809
|
+
function shouldClearLotOnProductChange(opts) {
|
|
7810
|
+
const { prevProduct, nextProduct, lotValue } = opts;
|
|
7811
|
+
if (isBlank(prevProduct) && isBlank(nextProduct)) return false;
|
|
7812
|
+
if (prevProduct === nextProduct) return false;
|
|
7813
|
+
if (isBlank(prevProduct) && !isBlank(nextProduct) && !isBlank(lotValue)) {
|
|
7814
|
+
return false;
|
|
7815
|
+
}
|
|
7816
|
+
return true;
|
|
7817
|
+
}
|
|
7818
|
+
let fillingProduct = false;
|
|
7819
|
+
function runWithFillProduct(fn) {
|
|
7820
|
+
fillingProduct = true;
|
|
7821
|
+
try {
|
|
7822
|
+
fn();
|
|
7823
|
+
} finally {
|
|
7824
|
+
nextTick(() => {
|
|
7825
|
+
fillingProduct = false;
|
|
7826
|
+
});
|
|
7827
|
+
}
|
|
7828
|
+
}
|
|
7829
|
+
function resolveLotValidateParams(keys, formData, option) {
|
|
7830
|
+
return {
|
|
7831
|
+
product_id_: option?.product_id_ ?? option?._item?.product_id_ ?? (keys.productKey ? formData[keys.productKey] : void 0),
|
|
7832
|
+
material_no_: option?.name_ ?? option?.__VALUE__ ?? (keys.materialNoKey ? formData[keys.materialNoKey] : void 0),
|
|
7833
|
+
material_no_id_: option?.id_ ?? (keys.materialNoKey ? formData[`${keys.materialNoKey}_id_`] : void 0)
|
|
7834
|
+
};
|
|
7835
|
+
}
|
|
7836
|
+
async function applyConsumeObjectTraceChange(opts) {
|
|
7837
|
+
const { belongingObject, role, formData } = opts;
|
|
7838
|
+
if (!belongingObject || !formData) return {};
|
|
7839
|
+
const keys = resolveObjectFieldKeys({
|
|
7840
|
+
belongingObject,
|
|
7841
|
+
objectFieldList: opts.objectFieldList,
|
|
7842
|
+
fallbackFields: opts.fallbackFields
|
|
7843
|
+
});
|
|
7844
|
+
if (role === FIELD_TYPE.PRODUCT) {
|
|
7845
|
+
if (!("prevProduct" in opts) || fillingProduct) return {};
|
|
7846
|
+
const values = {};
|
|
7847
|
+
if (shouldClearLotOnProductChange({
|
|
7848
|
+
prevProduct: opts.prevProduct,
|
|
7849
|
+
nextProduct: opts.nextValue,
|
|
7850
|
+
lotValue: keys.materialNoKey ? formData[keys.materialNoKey] : void 0
|
|
7851
|
+
})) {
|
|
7852
|
+
Object.assign(values, clearedLotFields(keys.materialNoKey));
|
|
7853
|
+
}
|
|
7854
|
+
if (keys.bomEntryIdKey) {
|
|
7855
|
+
values[keys.bomEntryIdKey] = null;
|
|
7856
|
+
if (!isBlank(opts.nextValue) && opts.formInstBom) {
|
|
7857
|
+
const entry = resolveObjectBomEntry({
|
|
7858
|
+
formInstBom: opts.formInstBom,
|
|
7859
|
+
belongingObject,
|
|
7860
|
+
productId: String(opts.nextValue)
|
|
7861
|
+
});
|
|
7862
|
+
if (entry) values[keys.bomEntryIdKey] = entry.id_;
|
|
7863
|
+
}
|
|
7864
|
+
}
|
|
7865
|
+
opts.rowWriter.patchRow(values, "autofill");
|
|
7866
|
+
const lotValue = keys.materialNoKey ? formData[keys.materialNoKey] : void 0;
|
|
7867
|
+
if (!isBlank(opts.nextValue) && !isBlank(lotValue)) {
|
|
7868
|
+
try {
|
|
7869
|
+
await validateReinspectionDate({
|
|
7870
|
+
product_id_: String(opts.nextValue),
|
|
7871
|
+
material_no_: lotValue,
|
|
7872
|
+
material_no_id_: keys.materialNoKey ? formData[`${keys.materialNoKey}_id_`] : void 0
|
|
7873
|
+
});
|
|
7874
|
+
} catch (e) {
|
|
7875
|
+
return { abortReinspection: e?.message || String(e) };
|
|
7876
|
+
}
|
|
7877
|
+
}
|
|
7878
|
+
return {};
|
|
7879
|
+
}
|
|
7880
|
+
if (role === FIELD_TYPE.MATERIAL_NO) {
|
|
7881
|
+
if (opts.option?.is_locked_) {
|
|
7882
|
+
opts.rowWriter.patchRow(clearedLotFields(keys.materialNoKey), "autofill");
|
|
7883
|
+
return { abortLocked: opts.option.id_ };
|
|
7884
|
+
}
|
|
7885
|
+
const params = resolveLotValidateParams(keys, formData, opts.option);
|
|
7886
|
+
if (isBlank(params.material_no_) && isBlank(params.material_no_id_)) return {};
|
|
7887
|
+
try {
|
|
7888
|
+
await validateReinspectionDate(params);
|
|
7889
|
+
} catch (e) {
|
|
7890
|
+
opts.rowWriter.patchRow(clearedLotFields(keys.materialNoKey), "async");
|
|
7891
|
+
return { abortReinspection: e?.message || String(e) };
|
|
7892
|
+
}
|
|
7893
|
+
const values = {};
|
|
7894
|
+
const productId = opts.option?.product_id_ ?? opts.option?._item?.product_id_;
|
|
7895
|
+
if (keys.productKey && !isBlank(productId)) values[keys.productKey] = productId;
|
|
7896
|
+
if (keys.bomEntryIdKey && opts.formInstBom) {
|
|
7897
|
+
if (!isBlank(productId)) {
|
|
7898
|
+
const entry = resolveObjectBomEntry({
|
|
7899
|
+
formInstBom: opts.formInstBom,
|
|
7900
|
+
belongingObject,
|
|
7901
|
+
productId: String(productId)
|
|
7902
|
+
});
|
|
7903
|
+
if (entry) values[keys.bomEntryIdKey] = entry.id_;
|
|
7904
|
+
}
|
|
7905
|
+
}
|
|
7906
|
+
const patchRelatedFields = () => opts.rowWriter.patchRow(values, "autofill");
|
|
7907
|
+
if (keys.productKey && !isBlank(productId)) {
|
|
7908
|
+
runWithFillProduct(patchRelatedFields);
|
|
7909
|
+
} else {
|
|
7910
|
+
patchRelatedFields();
|
|
7911
|
+
}
|
|
7912
|
+
return {};
|
|
7913
|
+
}
|
|
7914
|
+
return {};
|
|
7915
|
+
}
|
|
7858
7916
|
const _hoisted_1$5 = ["data-merge", "data-fill-direction"];
|
|
7859
7917
|
const _hoisted_2$1 = {
|
|
7860
7918
|
key: 0,
|
|
@@ -8175,6 +8233,7 @@ const DocumentSubTable = /* @__PURE__ */ defineComponent({
|
|
|
8175
8233
|
showDisplayStatus,
|
|
8176
8234
|
dataRelationShip
|
|
8177
8235
|
} = useWidgetStaticAttrs(props.widget);
|
|
8236
|
+
const isMockMaterialConsume = computed(() => !!dataRelationShip?.isMockReport && !!props.widget.props.isMaterialConsumeTable);
|
|
8178
8237
|
const sheetId = () => fields.value?.findWidgetById(props.widget.id)?.sheetId;
|
|
8179
8238
|
const subTableCore = props.subTableCore;
|
|
8180
8239
|
provide(NCB_PROVIDE.SUB_TABLE_CORE, subTableCore);
|
|
@@ -8315,6 +8374,9 @@ const DocumentSubTable = /* @__PURE__ */ defineComponent({
|
|
|
8315
8374
|
key,
|
|
8316
8375
|
actionValue
|
|
8317
8376
|
}) => {
|
|
8377
|
+
if (isMockMaterialConsume.value && (key === SubTableActionEnum.SCAN || key === SubTableActionEnum.Insert1GroupAfter)) {
|
|
8378
|
+
return;
|
|
8379
|
+
}
|
|
8318
8380
|
switch (key) {
|
|
8319
8381
|
case "insertRowBefore":
|
|
8320
8382
|
handleAddRow({
|
|
@@ -8408,10 +8470,11 @@ const DocumentSubTable = /* @__PURE__ */ defineComponent({
|
|
|
8408
8470
|
showRowWatermark,
|
|
8409
8471
|
rowGroupKey
|
|
8410
8472
|
}) => {
|
|
8411
|
-
const
|
|
8473
|
+
const baseMenus = subTableCore?.calcSubTableActionMenu({
|
|
8412
8474
|
rowData,
|
|
8413
8475
|
showDelBtn
|
|
8414
8476
|
});
|
|
8477
|
+
const menus = isMockMaterialConsume.value ? [getMenuByAction(SubTableActionEnum.SCAN), getMenuByAction(SubTableActionEnum.Insert1GroupAfter), ...baseMenus ?? []] : baseMenus;
|
|
8415
8478
|
const annRowDetails = dataRelationShip?.annRowDetails;
|
|
8416
8479
|
const rowMark = dataIdx !== -1 && annRowDetails?.length ? resolveRowFormChangeMark(field, rowData, annRowDetails) : null;
|
|
8417
8480
|
const rowUi = resolveFormChangeRowUi(rowData, rowMark);
|
|
@@ -8724,7 +8787,7 @@ const MaterialConsumeTable = /* @__PURE__ */ defineComponent({
|
|
|
8724
8787
|
const {
|
|
8725
8788
|
showDisplayStatus,
|
|
8726
8789
|
dataRelationShip
|
|
8727
|
-
} = useWidgetStaticAttrs(props);
|
|
8790
|
+
} = useWidgetStaticAttrs(props.widget);
|
|
8728
8791
|
const sheetId = () => fields.value?.findWidgetById(props.widget.id)?.sheetId;
|
|
8729
8792
|
const formModelController = useFormModel().injectController();
|
|
8730
8793
|
const tableController = props.tableController;
|
|
@@ -8913,6 +8976,7 @@ const MaterialConsumeTable = /* @__PURE__ */ defineComponent({
|
|
|
8913
8976
|
}));
|
|
8914
8977
|
};
|
|
8915
8978
|
const handleAction = (action, rowData) => {
|
|
8979
|
+
if (!tableController.hasFormInstance) return;
|
|
8916
8980
|
switch (action) {
|
|
8917
8981
|
case MaterialConsumeActionType.CONFIRM:
|
|
8918
8982
|
tableController.confirm(rowData);
|
|
@@ -8985,6 +9049,7 @@ const MaterialConsumeTable = /* @__PURE__ */ defineComponent({
|
|
|
8985
9049
|
key,
|
|
8986
9050
|
actionValue
|
|
8987
9051
|
}) => {
|
|
9052
|
+
if (!tableController.hasFormInstance) return;
|
|
8988
9053
|
switch (key) {
|
|
8989
9054
|
case "rowEdit":
|
|
8990
9055
|
await tableController.editRow(rowData);
|
|
@@ -9355,7 +9420,7 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
|
|
|
9355
9420
|
createElementVNode("i", { class: "iconfont icon-zhuyi" }),
|
|
9356
9421
|
createElementVNode("ul", { class: "tips-list" }, [
|
|
9357
9422
|
createElementVNode("li", null, "可将Excel内容粘贴到表格中,支持使用复制、粘贴、删除快捷键"),
|
|
9358
|
-
createElementVNode("li", null, "
|
|
9423
|
+
createElementVNode("li", null, " 表单中支持快速填报的字段类型:文本、长文本、整数、长整数、小数、精度小数、日期、时间、日期时间、批次/SN、报废物料批次、枚举单选、枚举多选(选项间以“,”分割) ")
|
|
9359
9424
|
])
|
|
9360
9425
|
], -1)),
|
|
9361
9426
|
createElementVNode("div", {
|
|
@@ -9380,7 +9445,7 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
|
|
|
9380
9445
|
};
|
|
9381
9446
|
}
|
|
9382
9447
|
});
|
|
9383
|
-
const FixedQuickFillModal = /* @__PURE__ */ _export_sfc(_sfc_main$4, [["__scopeId", "data-v-
|
|
9448
|
+
const FixedQuickFillModal = /* @__PURE__ */ _export_sfc(_sfc_main$4, [["__scopeId", "data-v-58540cb3"]]);
|
|
9384
9449
|
const _hoisted_1$1 = {
|
|
9385
9450
|
key: 1,
|
|
9386
9451
|
class: "sub-table-action__subtitle"
|
|
@@ -10153,7 +10218,7 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
|
10153
10218
|
createElementVNode("i", { class: "iconfont icon-zhuyi" }),
|
|
10154
10219
|
createElementVNode("ul", { class: "tips-list" }, [
|
|
10155
10220
|
createElementVNode("li", null, "可将Excel内容粘贴到表格中,支持使用复制、粘贴、删除快捷键"),
|
|
10156
|
-
createElementVNode("li", null, "
|
|
10221
|
+
createElementVNode("li", null, "表单中支持快速填报的字段类型:文本、长文本、整数、长整数、小数、精度小数、日期、时间、日期时间、批次/SN、报废物料批次、枚举单选、枚举多选(选项间以“,”分割)"),
|
|
10157
10222
|
createElementVNode("li", null, "当前快速填报最多支持200行")
|
|
10158
10223
|
])
|
|
10159
10224
|
], -1)),
|
|
@@ -10173,7 +10238,7 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
|
10173
10238
|
};
|
|
10174
10239
|
}
|
|
10175
10240
|
});
|
|
10176
|
-
const DynamicQuickFillModal = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["__scopeId", "data-v-
|
|
10241
|
+
const DynamicQuickFillModal = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["__scopeId", "data-v-840aca0a"]]);
|
|
10177
10242
|
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
10178
10243
|
__name: "dynamic-table-action",
|
|
10179
10244
|
props: {
|
|
@@ -10257,109 +10322,111 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
10257
10322
|
});
|
|
10258
10323
|
const DynamicTableAction = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-53d7e66c"]]);
|
|
10259
10324
|
export {
|
|
10260
|
-
|
|
10261
|
-
|
|
10325
|
+
RuntimeSheetService as $,
|
|
10326
|
+
useStyles as A,
|
|
10262
10327
|
BorderTD as B,
|
|
10263
|
-
|
|
10328
|
+
useDependency as C,
|
|
10264
10329
|
DEFAULT_BOOLEAN_FIELD_WIDTH as D,
|
|
10265
10330
|
EMPTY_PRODUCT_VERSION_ID as E,
|
|
10266
|
-
|
|
10267
|
-
|
|
10268
|
-
|
|
10269
|
-
|
|
10270
|
-
|
|
10271
|
-
|
|
10272
|
-
|
|
10273
|
-
|
|
10331
|
+
useFieldPresentation as F,
|
|
10332
|
+
useRuntimeEditorFlusher as G,
|
|
10333
|
+
createRuntimeInstanceContext as H,
|
|
10334
|
+
RuntimeInstanceRegistry as I,
|
|
10335
|
+
RequiredQtyCalcRule as J,
|
|
10336
|
+
registerFormulaFuncs as K,
|
|
10337
|
+
DocumentPaper as L,
|
|
10338
|
+
MAX_RUNTIME_SHEETS as M,
|
|
10274
10339
|
NCB_PROVIDE as N,
|
|
10275
|
-
|
|
10276
|
-
|
|
10277
|
-
|
|
10340
|
+
DynamicTableAction as O,
|
|
10341
|
+
getRuntimeDataFieldId as P,
|
|
10342
|
+
buildRuntimeFieldPath as Q,
|
|
10278
10343
|
RuntimeFormStateStore as R,
|
|
10279
10344
|
ScanParamType as S,
|
|
10280
|
-
|
|
10281
|
-
|
|
10282
|
-
|
|
10283
|
-
|
|
10284
|
-
|
|
10285
|
-
|
|
10286
|
-
|
|
10345
|
+
resolveRuntimeFieldProps as T,
|
|
10346
|
+
resolveRuntimeFieldState as U,
|
|
10347
|
+
getRuntimeDependencyOutputKey as V,
|
|
10348
|
+
isRowAddedInCurrentFormChange as W,
|
|
10349
|
+
MaterialConsumeTableController as X,
|
|
10350
|
+
setFormulaParamsConfig as Y,
|
|
10351
|
+
normalizeRuntime as Z,
|
|
10287
10352
|
_sfc_main$5 as _,
|
|
10288
|
-
|
|
10289
|
-
|
|
10290
|
-
|
|
10291
|
-
|
|
10292
|
-
|
|
10293
|
-
|
|
10294
|
-
|
|
10295
|
-
|
|
10296
|
-
|
|
10297
|
-
|
|
10298
|
-
|
|
10299
|
-
|
|
10300
|
-
|
|
10301
|
-
|
|
10302
|
-
|
|
10303
|
-
|
|
10304
|
-
|
|
10305
|
-
|
|
10306
|
-
|
|
10307
|
-
|
|
10308
|
-
|
|
10309
|
-
|
|
10310
|
-
|
|
10311
|
-
|
|
10312
|
-
|
|
10313
|
-
|
|
10314
|
-
|
|
10315
|
-
|
|
10316
|
-
|
|
10317
|
-
|
|
10318
|
-
|
|
10319
|
-
|
|
10320
|
-
|
|
10321
|
-
|
|
10322
|
-
|
|
10323
|
-
|
|
10324
|
-
|
|
10325
|
-
|
|
10326
|
-
|
|
10327
|
-
|
|
10328
|
-
|
|
10329
|
-
|
|
10330
|
-
|
|
10331
|
-
|
|
10332
|
-
|
|
10333
|
-
|
|
10334
|
-
|
|
10335
|
-
|
|
10336
|
-
|
|
10337
|
-
|
|
10338
|
-
|
|
10339
|
-
|
|
10340
|
-
|
|
10353
|
+
MAX_RUNTIME_SHEET_TITLE_LENGTH as a,
|
|
10354
|
+
validateObjectBomQtyOnSubmit as a0,
|
|
10355
|
+
closeValidatorPopovers as a1,
|
|
10356
|
+
enrichFormChangeRowDetails as a2,
|
|
10357
|
+
useMaterialBalance as a3,
|
|
10358
|
+
collectFormChangeFieldLocations as a4,
|
|
10359
|
+
nextFormChangeRowViewHistoryId as a5,
|
|
10360
|
+
DeviceConnector as a6,
|
|
10361
|
+
DocumentLoading as a7,
|
|
10362
|
+
DynamicQuickFillModal as a8,
|
|
10363
|
+
FixedQuickFillModal as a9,
|
|
10364
|
+
recordSubtableRowDelete as aA,
|
|
10365
|
+
resolveAnnotationFieldLocation as aB,
|
|
10366
|
+
resolveFormChangeRowUi as aC,
|
|
10367
|
+
resolveRowFormChangeMark as aD,
|
|
10368
|
+
setSelectMobileTdId as aE,
|
|
10369
|
+
stripLegacyFormConfigFromPaper as aF,
|
|
10370
|
+
SubTableActionMenuTypeEnum as aG,
|
|
10371
|
+
getMenuByAction as aH,
|
|
10372
|
+
SubTableActionEnum as aI,
|
|
10373
|
+
resolveScanFillData as aJ,
|
|
10374
|
+
getInsertSubMenu as aK,
|
|
10375
|
+
resolveScanAdjustType as aL,
|
|
10376
|
+
resolveScanQty as aM,
|
|
10377
|
+
toDateOnly as aN,
|
|
10378
|
+
getCopySubMenu as aO,
|
|
10379
|
+
resolveScanParsedValue as aP,
|
|
10380
|
+
isProductBatchEmptyRow as aQ,
|
|
10381
|
+
FormTmplConfigController as aa,
|
|
10382
|
+
LEGACY_RUNTIME_FORM_CONFIG_KEYS as ab,
|
|
10383
|
+
LEGACY_RUNTIME_SHEET_ID as ac,
|
|
10384
|
+
LEGACY_RUNTIME_SHEET_TITLE as ad,
|
|
10385
|
+
MCDataUtil as ae,
|
|
10386
|
+
OCR_MODEL_PRECISION_ENUM_KEY as af,
|
|
10387
|
+
RuntimeAsyncTaskCoordinator as ag,
|
|
10388
|
+
RuntimeDependencyService as ah,
|
|
10389
|
+
RuntimeFieldRegistry as ai,
|
|
10390
|
+
RuntimeInstanceEventBus as aj,
|
|
10391
|
+
RuntimePersistenceCoordinator as ak,
|
|
10392
|
+
RuntimeValidationService as al,
|
|
10393
|
+
SubTableCore as am,
|
|
10394
|
+
buildFormChangeDisplayRows as an,
|
|
10395
|
+
convertV1Runtime as ao,
|
|
10396
|
+
detailsHaveFormChangeRowOps as ap,
|
|
10397
|
+
extractFormChangeRowDetails as aq,
|
|
10398
|
+
getFormChangeRowKey as ar,
|
|
10399
|
+
getFormChangeRowOp as as,
|
|
10400
|
+
getSubTableQuickFillInfo as at,
|
|
10401
|
+
isAnnLocationSelected as au,
|
|
10402
|
+
isBlank as av,
|
|
10403
|
+
isFormChangeGhostRow as aw,
|
|
10404
|
+
normalizeHistoricalFieldConfig as ax,
|
|
10405
|
+
pickObjectFieldKeys as ay,
|
|
10406
|
+
recordSubtableRowAdd as az,
|
|
10407
|
+
MULTI_SHEET_SCHEMA_VERSION as b,
|
|
10341
10408
|
createRuntimeDocumentV2 as c,
|
|
10342
|
-
|
|
10343
|
-
|
|
10344
|
-
|
|
10409
|
+
normalizeHistoricalBusinessRow as d,
|
|
10410
|
+
DeviceLinkTmplUtil as e,
|
|
10411
|
+
normalizeAIOcrTmpl as f,
|
|
10345
10412
|
getBusinessFieldKey as g,
|
|
10346
|
-
|
|
10347
|
-
|
|
10348
|
-
|
|
10349
|
-
|
|
10350
|
-
|
|
10351
|
-
|
|
10413
|
+
useWidgetStaticAttrs as h,
|
|
10414
|
+
useRuntimeInstanceServices as i,
|
|
10415
|
+
setSelectAnnotationId as j,
|
|
10416
|
+
useRuntimeRowState as k,
|
|
10417
|
+
getObjectBomMaterialLotQuery as l,
|
|
10418
|
+
buildObjectLotExtraQuery as m,
|
|
10352
10419
|
normalizeFieldWidth as n,
|
|
10353
|
-
|
|
10354
|
-
|
|
10355
|
-
|
|
10420
|
+
MaterialConsumptionPatternEnum as o,
|
|
10421
|
+
resolveObjectBomEntry as p,
|
|
10422
|
+
runWithFillProduct as q,
|
|
10356
10423
|
resolveObjectFieldKeys as r,
|
|
10357
10424
|
setSelectValidatorId as s,
|
|
10358
|
-
|
|
10425
|
+
useNocodeFormWidget as t,
|
|
10359
10426
|
useFormTmplConfig as u,
|
|
10360
10427
|
validateObjectBomForScan as v,
|
|
10361
|
-
|
|
10362
|
-
|
|
10363
|
-
|
|
10364
|
-
|
|
10428
|
+
applyConsumeObjectTraceChange as w,
|
|
10429
|
+
getObjectBomProductQuery as x,
|
|
10430
|
+
normalizeHistoricalAutofillRow as y,
|
|
10431
|
+
parseRuntimeFieldPath as z
|
|
10365
10432
|
};
|