@gct-paas/word 0.1.74-beta.44 → 0.1.74-beta.45

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/index.es.js CHANGED
@@ -1,4 +1,4 @@
1
- /*! @gct-paas/word v0.1.74-beta.44 */
1
+ /*! @gct-paas/word v0.1.74-beta.45 */
2
2
  import { Fragment, Suspense, Teleport, Transition, TransitionGroup, cloneVNode, computed, createApp, createBlock, createCommentVNode, createElementBlock, createElementVNode, createSlots, createStaticVNode, createTextVNode, createVNode, defineAsyncComponent, defineComponent, effectScope, getCurrentInstance, getCurrentScope, guardReactiveProps, h, inject, isRef, isVNode, markRaw, mergeModels, mergeProps, nextTick, normalizeClass, normalizeProps, normalizeStyle, onBeforeMount, onBeforeUnmount, onMounted, onScopeDispose, onUnmounted, openBlock, provide, reactive, readonly, ref, render, renderList, renderSlot, resolveComponent, resolveDynamicComponent, shallowRef, toDisplayString, toHandlers, toRaw, toRef, toValue, unref, useAttrs, useCssVars, useModel, useSlots, vModelRadio, vModelText, vShow, watch, watchEffect, withCtx, withDirectives, withKeys, withModifiers } from "vue";
3
3
  import St, { PopperWrapper } from "floating-vue";
4
4
  import VueKonva from "vue-konva";
@@ -125184,6 +125184,52 @@ async function getReinspectionDate(params) {
125184
125184
  if (!parsed.isValid()) return;
125185
125185
  return parsed.format("YYYY-MM-DD");
125186
125186
  }
125187
+ /** 物料+批次查复检日期;缺任一参数不查;无日期放过;小于当天则 throw */
125188
+ async function assertReinspectionDate(opts) {
125189
+ if (!opts.product_id_ || !opts.material_no_ && !opts.material_no_id_) return;
125190
+ const date = await getReinspectionDate({
125191
+ product_id_: opts.product_id_,
125192
+ material_no_: opts.material_no_,
125193
+ material_no_id_: opts.material_no_id_
125194
+ });
125195
+ if (!date) return;
125196
+ if (dayjs(date).isBefore(dayjs(), "day")) throw new Error("已超物料复检日期,该物料不可用");
125197
+ }
125198
+ function pickProductBaseId(option) {
125199
+ var _option$_OPCT;
125200
+ if (!option) return void 0;
125201
+ const nested = (_option$_OPCT = option._OPCT) === null || _option$_OPCT === void 0 || (_option$_OPCT = _option$_OPCT.product_id_) === null || _option$_OPCT === void 0 ? void 0 : _option$_OPCT.base_id_;
125202
+ const raw = option.product_id_base_id_ ?? nested;
125203
+ if (isBlank$1(raw)) return void 0;
125204
+ return String(raw);
125205
+ }
125206
+ async function fetchProductBaseId(versionId) {
125207
+ try {
125208
+ var _res$data2;
125209
+ const res = await postApi({
125210
+ modelCategory: "entity",
125211
+ modelKey: "em_product",
125212
+ bsKey: "getOne"
125213
+ }, {}, { query: { id_: versionId } });
125214
+ const record = (res === null || res === void 0 || (_res$data2 = res.data) === null || _res$data2 === void 0 ? void 0 : _res$data2[0]) ?? (res === null || res === void 0 ? void 0 : res.data);
125215
+ const baseId = record === null || record === void 0 ? void 0 : record.base_id_;
125216
+ return isBlank$1(baseId) ? void 0 : String(baseId);
125217
+ } catch {
125218
+ return;
125219
+ }
125220
+ }
125221
+ /** 主表物料 RDO 引用:`baseId:versionId`。无法拼出则返回 undefined,禁止写裸版本 id。 */
125222
+ async function resolveProductRdoRef(raw, option) {
125223
+ if (isBlank$1(raw)) return void 0;
125224
+ const parsed = parseFormTmplRefId(String(raw));
125225
+ if (parsed.baseId && parsed.id) return `${parsed.baseId}:${parsed.id}`;
125226
+ const versionId = parsed.id;
125227
+ if (!versionId) return void 0;
125228
+ const baseFromOption = pickProductBaseId(option);
125229
+ if (baseFromOption) return `${baseFromOption}:${versionId}`;
125230
+ const baseId = await fetchProductBaseId(versionId);
125231
+ return baseId ? `${baseId}:${versionId}` : void 0;
125232
+ }
125187
125233
  /** 查批次锁定记录(最新一条) */
125188
125234
  async function getLotLockedReason(production_identification_id_) {
125189
125235
  const { data = {}, dict = {} } = await postApi({
@@ -125196,6 +125242,7 @@ async function getLotLockedReason(production_identification_id_) {
125196
125242
  var postApi;
125197
125243
  var init_service$5 = __esmMin((() => {
125198
125244
  init_api$1();
125245
+ init_core$1();
125199
125246
  postApi = getApi().apaas.modelComprehensive.postBizServiceModelCategoryModelKeyBsKey;
125200
125247
  }));
125201
125248
  //#endregion
@@ -126495,14 +126542,44 @@ var init_material_consume_table_controller = __esmMin((() => {
126495
126542
  * @param rowPath $.f_sub[n] n 必须为数字
126496
126543
  */
126497
126544
  static updateViewFieldsDisablement(option) {
126498
- const fields = [
126545
+ const fields = ["material_no_", "qty_"];
126546
+ this._updateDisablement({
126547
+ ...option,
126548
+ fields
126549
+ });
126550
+ }
126551
+ /**
126552
+ * 编辑态行:按 Excel calcDisabledFields 禁用字段,其余受控字段可填
126553
+ */
126554
+ static applyEditingRowDisablement(option) {
126555
+ const allFields = [
126556
+ "product_id_",
126499
126557
  "material_no_",
126558
+ "qty_consumed_",
126500
126559
  "qty_",
126501
- "routing_operation_id_"
126560
+ "qty_required_",
126561
+ "routing_operation_id_",
126562
+ "expiration_date_",
126563
+ "qty_required_uom_id_",
126564
+ "qty_uom_id_",
126565
+ "qty_transfer_",
126566
+ "qty_consumed_total_",
126567
+ "qty_transfer_uom_id_",
126568
+ "transfer_formula_",
126569
+ "sort_num_"
126502
126570
  ];
126571
+ const disabledSet = new Set(option.disabledFields);
126503
126572
  this._updateDisablement({
126504
- ...option,
126505
- fields
126573
+ dataManager: option.dataManager,
126574
+ rowPath: option.rowPath,
126575
+ fields: allFields.filter((field) => disabledSet.has(field)),
126576
+ disabled: true
126577
+ });
126578
+ this._updateDisablement({
126579
+ dataManager: option.dataManager,
126580
+ rowPath: option.rowPath,
126581
+ fields: allFields.filter((field) => !disabledSet.has(field)),
126582
+ disabled: false
126506
126583
  });
126507
126584
  }
126508
126585
  /**
@@ -126737,11 +126814,13 @@ var init_material_consume_table_controller = __esmMin((() => {
126737
126814
  });
126738
126815
  this.actualTableData = tableRows;
126739
126816
  tableRows.forEach((row, i) => {
126740
- MCDataUtil.updateConfirmableFieldsDisablement({
126817
+ const rowPath = `$.${subFieldKey}[${i}]`;
126818
+ if (row.is_confirmed_) MCDataUtil.updateConfirmableFieldsDisablement({
126741
126819
  dataManager,
126742
- rowPath: `$.${subFieldKey}[${i}]`,
126743
- disabled: !!row.is_confirmed_
126820
+ rowPath,
126821
+ disabled: true
126744
126822
  });
126823
+ else this.syncEditingRowDisablement(dataManager, rowPath, row);
126745
126824
  });
126746
126825
  }
126747
126826
  /**
@@ -126762,6 +126841,14 @@ var init_material_consume_table_controller = __esmMin((() => {
126762
126841
  }
126763
126842
  return disabledKeys;
126764
126843
  }
126844
+ /** 可编辑行:对齐 Excel getNewTdInfo + calcDisabledFields */
126845
+ syncEditingRowDisablement(dataManager, rowPath, row) {
126846
+ MCDataUtil.applyEditingRowDisablement({
126847
+ dataManager,
126848
+ rowPath,
126849
+ disabledFields: this.calcDisabledFields(row)
126850
+ });
126851
+ }
126765
126852
  /**
126766
126853
  * 获取是否是 物料查看
126767
126854
  * @param product_id_
@@ -126964,14 +127051,7 @@ var init_material_consume_table_controller = __esmMin((() => {
126964
127051
  * 物料+批次查复检日期;缺任一参数不查;无日期放过;小于当天则 throw
126965
127052
  */
126966
127053
  async validateReinspectionDate(opts) {
126967
- if (!opts.product_id_ || !opts.material_no_ && !opts.material_no_id_) return;
126968
- const date = await getReinspectionDate({
126969
- product_id_: opts.product_id_,
126970
- material_no_: opts.material_no_,
126971
- material_no_id_: opts.material_no_id_
126972
- });
126973
- if (!date) return;
126974
- if (dayjs(date).isBefore(dayjs(), "day")) throw new Error("已超物料复检日期,该物料不可用");
127054
+ await assertReinspectionDate(opts);
126975
127055
  }
126976
127056
  /**
126977
127057
  * 校验数据,并退出编辑
@@ -127078,7 +127158,10 @@ var init_material_consume_table_controller = __esmMin((() => {
127078
127158
  const entryIdx = this.bomEntriesValidator.resolveEntryIndex(row);
127079
127159
  const targetUtil = entryIdx >= 0 ? this.bomEntriesValidator.bomEntryValidators[entryIdx] : void 0;
127080
127160
  if (!targetUtil) {
127161
+ var _dataManager$getRawDa2;
127081
127162
  MCDataUtil.updateRow(option, false);
127163
+ const unlocked = (_dataManager$getRawDa2 = dataManager.getRawData()[subFieldKey]) === null || _dataManager$getRawDa2 === void 0 ? void 0 : _dataManager$getRawDa2[rowIndex];
127164
+ if (unlocked) this.syncEditingRowDisablement(dataManager, `$.${subFieldKey}[${rowIndex}]`, unlocked);
127082
127165
  return;
127083
127166
  }
127084
127167
  const targetRows = this.actualTableData.filter((r) => isRowInBomGroup(r, targetUtil));
@@ -127094,6 +127177,18 @@ var init_material_consume_table_controller = __esmMin((() => {
127094
127177
  setGroupEditState(this.actualTableData, current, false);
127095
127178
  }
127096
127179
  setGroupEditState(this.actualTableData, targetUtil, true);
127180
+ const rawRows = dataManager.getRawData()[subFieldKey] ?? [];
127181
+ rawRows.forEach((item, index) => {
127182
+ if (item.deleted_) return;
127183
+ const rowPath = `$.${subFieldKey}[${index}]`;
127184
+ if (current && isRowInBomGroup(item, current)) MCDataUtil.updateConfirmableFieldsDisablement({
127185
+ dataManager,
127186
+ rowPath,
127187
+ disabled: true
127188
+ });
127189
+ if (isRowInBomGroup(item, targetUtil)) this.syncEditingRowDisablement(dataManager, rowPath, item);
127190
+ });
127191
+ dataManager.set(subFieldKey, rawRows, "user");
127097
127192
  }
127098
127193
  /**
127099
127194
  * 在当前 BOM 组下方新增一个空组。
@@ -127102,7 +127197,7 @@ var init_material_consume_table_controller = __esmMin((() => {
127102
127197
  * 返回新行在活跃数据中的下标,调用方据此执行 Word 子表行初始化。
127103
127198
  */
127104
127199
  async addGroup(option, doc) {
127105
- var _dataManager$getRawDa2;
127200
+ var _dataManager$getRawDa3;
127106
127201
  const { dataManager, subFieldKey, rowIndex } = option;
127107
127202
  const rawRows = dataManager.getRawData()[subFieldKey] ?? [];
127108
127203
  const activeRows = rawRows.filter((row) => !row.deleted_);
@@ -127141,7 +127236,7 @@ var init_material_consume_table_controller = __esmMin((() => {
127141
127236
  };
127142
127237
  ensureFrontRowKey(newRow);
127143
127238
  if (!dataManager.insertAt(`$.${subFieldKey}`, insertIndex, newRow)) return;
127144
- const insertedRow = (_dataManager$getRawDa2 = dataManager.getRawData()[subFieldKey]) === null || _dataManager$getRawDa2 === void 0 ? void 0 : _dataManager$getRawDa2[insertIndex];
127239
+ const insertedRow = (_dataManager$getRawDa3 = dataManager.getRawData()[subFieldKey]) === null || _dataManager$getRawDa3 === void 0 ? void 0 : _dataManager$getRawDa3[insertIndex];
127145
127240
  if (insertedRow) {
127146
127241
  this.setDefaultValue(insertedRow, doc);
127147
127242
  dataManager.set(`$.${subFieldKey}[${insertIndex}]`, insertedRow, "user");
@@ -127150,6 +127245,57 @@ var init_material_consume_table_controller = __esmMin((() => {
127150
127245
  return insertIndex;
127151
127246
  }
127152
127247
  /**
127248
+ * 组内加一行:当前行下方插入,继承 bom_entry_id_。
127249
+ */
127250
+ addRowForGroup(option, doc) {
127251
+ var _dataManager$getRawDa4;
127252
+ const { dataManager, subFieldKey, rowIndex } = option;
127253
+ const currentRow = (dataManager.getRawData()[subFieldKey] ?? []).filter((row) => !row.deleted_)[rowIndex];
127254
+ if (!currentRow) return;
127255
+ const newRow = {
127256
+ is_confirmed_: false,
127257
+ expiration_date_: "",
127258
+ ...currentRow.bom_entry_id_ ? { bom_entry_id_: currentRow.bom_entry_id_ } : {}
127259
+ };
127260
+ ensureFrontRowKey(newRow);
127261
+ const insertIndex = rowIndex + 1;
127262
+ if (!dataManager.insertAt(`$.${subFieldKey}`, insertIndex, newRow)) return;
127263
+ const insertedRow = (_dataManager$getRawDa4 = dataManager.getRawData()[subFieldKey]) === null || _dataManager$getRawDa4 === void 0 ? void 0 : _dataManager$getRawDa4[insertIndex];
127264
+ if (insertedRow) {
127265
+ this.setDefaultValue(insertedRow, doc);
127266
+ dataManager.set(`$.${subFieldKey}[${insertIndex}]`, insertedRow, "user");
127267
+ }
127268
+ this.updateDerivedQtyFields(doc);
127269
+ return insertIndex;
127270
+ }
127271
+ /**
127272
+ * 仅剩一行时清空内容:保留行身份和默认值,并断开 BOM 组。
127273
+ */
127274
+ clearRow(option, doc) {
127275
+ const { dataManager, subFieldKey, rowIndex } = option;
127276
+ const row = (dataManager.getRawData()[subFieldKey] ?? [])[rowIndex];
127277
+ if (!row) return;
127278
+ const preserved = pick(row, ["id_", FRONT_ROW_KEY]);
127279
+ Object.keys(row).forEach((key) => {
127280
+ if (!(key in preserved)) delete row[key];
127281
+ });
127282
+ Object.assign(row, {
127283
+ is_confirmed_: false,
127284
+ expiration_date_: ""
127285
+ }, preserved);
127286
+ ensureFrontRowKey(row);
127287
+ this.setDefaultValue(row, doc);
127288
+ row.bom_entry_id_ = void 0;
127289
+ row.qty_consumed_total_ = void 0;
127290
+ dataManager.set(`$.${subFieldKey}[${rowIndex}]`, row, "user");
127291
+ MCDataUtil.updateConfirmableFieldsDisablement({
127292
+ dataManager,
127293
+ rowPath: `$.${subFieldKey}[${rowIndex}]`,
127294
+ disabled: false
127295
+ });
127296
+ this.updateDerivedQtyFields(doc);
127297
+ }
127298
+ /**
127153
127299
  * 更新整个数组的所有行的已消耗数量
127154
127300
  *
127155
127301
  * 调用时机:[物料消耗表]任意一行
@@ -127233,6 +127379,7 @@ var init_material_consume_table_controller = __esmMin((() => {
127233
127379
  if (["product_id_", "material_no_"].includes(fieldKey)) {
127234
127380
  const rowPath = `${parentFieldPath}[${dataIndex}]`;
127235
127381
  if (fieldKey === "product_id_") {
127382
+ var _doc$dataManager$getR;
127236
127383
  const row = doc.dataManager.get(rowPath);
127237
127384
  if (row._scanFallback) {
127238
127385
  try {
@@ -127260,12 +127407,8 @@ var init_material_consume_table_controller = __esmMin((() => {
127260
127407
  [`${rowPath}.qty_`]: void 0,
127261
127408
  [`${rowPath}.expiration_date_`]: void 0
127262
127409
  }, "user");
127263
- const disabled = this.getMaterialTypeIsView(product_id_);
127264
- MCDataUtil.updateViewFieldsDisablement({
127265
- dataManager: doc.dataManager,
127266
- rowPath,
127267
- disabled
127268
- });
127410
+ const nextRow = (_doc$dataManager$getR = doc.dataManager.getRawData()[parentFieldKey]) === null || _doc$dataManager$getR === void 0 ? void 0 : _doc$dataManager$getR[dataIndex];
127411
+ if (nextRow) this.syncEditingRowDisablement(doc.dataManager, rowPath, nextRow);
127269
127412
  } else if (fieldKey === "material_no_") {
127270
127413
  if (selectedOption === null || selectedOption === void 0 ? void 0 : selectedOption.is_locked_) {
127271
127414
  doc.dataManager.setMultiple({
@@ -127529,7 +127672,9 @@ var init_material_consume_util = __esmMin((() => {
127529
127672
  rowPath,
127530
127673
  disabled: true
127531
127674
  });
127675
+ else tableController === null || tableController === void 0 || tableController.syncEditingRowDisablement(doc.dataManager, rowPath, row);
127532
127676
  });
127677
+ if (isBomPattern && !activeCount) tableController === null || tableController === void 0 || tableController.syncEditingRowDisablement(doc.dataManager, `${table_key_}[0]`, { is_confirmed_: false });
127533
127678
  });
127534
127679
  };
127535
127680
  handleAllMCTablesMounted = (doc, tmplBomC) => {
@@ -127572,9 +127717,11 @@ function getGroupProductIds(entry) {
127572
127717
  * 找不到说明物料不在当前 BOM 中。
127573
127718
  */
127574
127719
  function findEntryByProductId(entries, productId) {
127575
- return entries.find((entry) => getGroupProductIds(entry).includes(productId));
127720
+ const versionId = parseFormTmplRefId(productId).id || productId;
127721
+ return entries.find((entry) => getGroupProductIds(entry).includes(versionId));
127576
127722
  }
127577
127723
  var init_scan_validator = __esmMin((() => {
127724
+ init_core$1();
127578
127725
  window.$t;
127579
127726
  }));
127580
127727
  //#endregion
@@ -127682,23 +127829,51 @@ function validateObjectBomForScan(opts) {
127682
127829
  if (!findEntryByProductId(formInstBom.bomEntries ?? [], productId)) throw new Error(ERR_MATERIAL_NOT_MATCH);
127683
127830
  }
127684
127831
  /**
127685
- * 物料消耗对象物料批下拉:未开人为指定时,限制为 BOM 主料 + 已开替代料的替代料
127686
- * - 无需过滤时返回 null(无 belongingObject / 无配置 / 人为指定)
127687
- * - 无候选时用占位 id,避免空数组被后端当成不筛选
127832
+ * 收集实例 BOM 主料 + 已开替代料的版本 id。
127833
+ * - 无需过滤返回 null(无配置 / 记录模式 / 人为指定)
127688
127834
  */
127689
- function getObjectBomMaterialLotQuery(opts) {
127835
+ function collectObjectBomVersionIds(opts) {
127690
127836
  const { formInstBom, belongingObject } = opts;
127691
127837
  const objectBom = findObjectBom(formInstBom, belongingObject);
127692
- if (!objectBom || objectBom.personal_bom_enabled_) return null;
127693
- const bomEntries = formInstBom.bomEntries ?? [];
127838
+ if (!objectBom) return null;
127839
+ if (objectBom.material_consumption_pattern_ === MaterialConsumptionPatternEnum.RECORD) return null;
127840
+ if (objectBom.personal_bom_enabled_) return null;
127694
127841
  const versionIds = /* @__PURE__ */ new Set();
127695
- bomEntries.forEach((entry) => {
127842
+ (formInstBom.bomEntries ?? []).forEach((entry) => {
127696
127843
  getGroupProductIds(entry).forEach((id) => {
127697
127844
  const versionId = id === null || id === void 0 ? void 0 : id.split(":").pop();
127698
127845
  if (versionId) versionIds.add(versionId);
127699
127846
  });
127700
127847
  });
127701
- return { "product_id_.versionIn": versionIds.size ? Array.from(versionIds) : [EMPTY_PRODUCT_VERSION_ID] };
127848
+ return Array.from(versionIds);
127849
+ }
127850
+ function toObjectBomFilterIds(versionIds) {
127851
+ if (!versionIds) return null;
127852
+ return versionIds.length ? versionIds : [EMPTY_PRODUCT_VERSION_ID];
127853
+ }
127854
+ /**
127855
+ * 物料消耗对象物料批下拉:限制为 BOM 主料 + 已开替代料的替代料
127856
+ * - 无需过滤时返回 null(无配置 / 记录模式 / 人为指定)
127857
+ * - 无候选时用占位 id,避免空数组被后端当成不筛选
127858
+ */
127859
+ function getObjectBomMaterialLotQuery(opts) {
127860
+ const ids = toObjectBomFilterIds(collectObjectBomVersionIds(opts));
127861
+ return ids ? { "product_id_.versionIn": ids } : null;
127862
+ }
127863
+ /**
127864
+ * 物料消耗对象物料下拉:限制为 BOM 主料 + 已开替代料的替代料
127865
+ * - 无需过滤时返回 null(无配置 / 记录模式 / 人为指定)
127866
+ * - 无候选时用占位 id,避免空数组被后端当成不筛选
127867
+ */
127868
+ function getObjectBomProductQuery(opts) {
127869
+ const ids = toObjectBomFilterIds(collectObjectBomVersionIds(opts));
127870
+ return ids ? { "id_.in": ids } : null;
127871
+ }
127872
+ /** 对象下拉按字段类型取 BOM 过滤;非物料/批次返回 null */
127873
+ function getObjectBomDropdownQuery(fieldType, opts) {
127874
+ if (fieldType === FIELD_TYPE.MATERIAL_NO) return getObjectBomMaterialLotQuery(opts);
127875
+ if (fieldType === FIELD_TYPE.PRODUCT) return getObjectBomProductQuery(opts);
127876
+ return null;
127702
127877
  }
127703
127878
  /**
127704
127879
  * 表单提交:校验所有物料消耗对象的数量 vs 需求数量
@@ -127751,15 +127926,156 @@ var $t$1, ERR_MATERIAL_NOT_MATCH;
127751
127926
  var init_bom_validator = __esmMin((() => {
127752
127927
  init_product_id_query();
127753
127928
  init_scan_validator();
127929
+ init_types$4();
127754
127930
  init_field_type();
127755
127931
  $t$1 = (...args) => window.$t(...args);
127756
127932
  ERR_MATERIAL_NOT_MATCH = "当前物料不在 bom 中";
127757
127933
  }));
127758
127934
  //#endregion
127935
+ //#region src/suites/edhr/panel-schema/data-init/material-consume-object/linkage.ts
127936
+ function widgetFieldKey$1(field) {
127937
+ return (field.fieldLink ? getLastSegment$1(field.fieldLink) : field.key) || void 0;
127938
+ }
127939
+ function isMaterialConsumeObject(doc, belongingObject) {
127940
+ var _doc$fieldModelQuery$;
127941
+ const objectField = (_doc$fieldModelQuery$ = doc.fieldModelQuery.getFieldList(doc.mainModelKey)) === null || _doc$fieldModelQuery$ === void 0 ? void 0 : _doc$fieldModelQuery$.find((field) => field.key === belongingObject);
127942
+ if (!objectField) return false;
127943
+ return resolveFieldManifestType(objectField) === FIELD_TYPE.MATERIAL_CONSUME;
127944
+ }
127945
+ function collectConsumeObjectPaths(doc, belongingObject) {
127946
+ var _doc$model, _doc$model$getWidgetI;
127947
+ const paths = {};
127948
+ const widgets = ((_doc$model = doc.model) === null || _doc$model === void 0 || (_doc$model$getWidgetI = _doc$model.getWidgetInstances) === null || _doc$model$getWidgetI === void 0 ? void 0 : _doc$model$getWidgetI.call(_doc$model)) ?? [];
127949
+ for (const widget of widgets) {
127950
+ var _widget$widgetMeta;
127951
+ const field = (_widget$widgetMeta = widget.widgetMeta) === null || _widget$widgetMeta === void 0 ? void 0 : _widget$widgetMeta.field;
127952
+ if (!field || field.belongingObject !== belongingObject) continue;
127953
+ const key = widgetFieldKey$1(field);
127954
+ const path = key ? generateValuePath(key, "") : void 0;
127955
+ if (!path) continue;
127956
+ if (field.fieldType === FIELD_TYPE.PRODUCT) paths.productPath = path;
127957
+ if (field.fieldType === FIELD_TYPE.MATERIAL_NO) paths.materialNoPath = path;
127958
+ }
127959
+ return paths;
127960
+ }
127961
+ function pickLotProductRaw(option) {
127962
+ if (!option) return void 0;
127963
+ return option.product_id_ ?? option.materialId;
127964
+ }
127965
+ function isUnchangedProduct(doc, productPath, pending) {
127966
+ const oldValue = doc.dataManager.get(productPath);
127967
+ const nextValue = productPath in pending ? pending[productPath] : oldValue;
127968
+ return !isBlank$1(nextValue) && isSameFieldValue(oldValue, nextValue);
127969
+ }
127970
+ function buildLotClearUpdates(materialNoPath) {
127971
+ if (!materialNoPath) return {};
127972
+ return {
127973
+ [materialNoPath]: null,
127974
+ [getIdPath(materialNoPath)]: null
127975
+ };
127976
+ }
127977
+ /**
127978
+ * 消耗对象批次下拉:同组物料有值时按该物料版本过滤,替换 BOM versionIn。
127979
+ */
127980
+ function getConsumeObjectLotProductQuery(opts) {
127981
+ var _doc$isInEditMode;
127982
+ const { doc, belongingObject, fieldType } = opts;
127983
+ if ((_doc$isInEditMode = doc.isInEditMode) === null || _doc$isInEditMode === void 0 ? void 0 : _doc$isInEditMode.call(doc)) return null;
127984
+ if (!belongingObject || fieldType !== FIELD_TYPE.MATERIAL_NO) return null;
127985
+ if (!isMaterialConsumeObject(doc, belongingObject)) return null;
127986
+ const { productPath } = collectConsumeObjectPaths(doc, belongingObject);
127987
+ if (!productPath) return null;
127988
+ const productValue = doc.dataManager.get(productPath);
127989
+ if (isBlank$1(productValue)) return null;
127990
+ const productId = parseFormTmplRefId(String(productValue)).id;
127991
+ return productId ? { "product_id_.versionEq": productId } : null;
127992
+ }
127993
+ /**
127994
+ * 物料消耗对象下拉联动:
127995
+ * - 改/清物料:清空同组批次
127996
+ * - 选批次且 option 有物料 id:写入同组物料(RDO `base:version`)
127997
+ * - 清批次 / 手输批次:不动物料
127998
+ * - 选批次但解析不出 RDO 引用:throw,调用方不得写入批次
127999
+ */
128000
+ async function buildConsumeObjectSelectUpdates(opts) {
128001
+ var _doc$isInEditMode2;
128002
+ const { doc, belongingObject, fieldType, selectedOption, pending = {} } = opts;
128003
+ if ((_doc$isInEditMode2 = doc.isInEditMode) === null || _doc$isInEditMode2 === void 0 ? void 0 : _doc$isInEditMode2.call(doc)) return {};
128004
+ if (!belongingObject || !fieldType) return {};
128005
+ if (!isMaterialConsumeObject(doc, belongingObject)) return {};
128006
+ const { productPath, materialNoPath } = collectConsumeObjectPaths(doc, belongingObject);
128007
+ if (fieldType === FIELD_TYPE.PRODUCT) {
128008
+ if (productPath && isUnchangedProduct(doc, productPath, pending)) return {};
128009
+ return buildLotClearUpdates(materialNoPath);
128010
+ }
128011
+ if (fieldType === FIELD_TYPE.MATERIAL_NO) {
128012
+ const raw = pickLotProductRaw(selectedOption);
128013
+ if (isBlank$1(raw) || !productPath) return {};
128014
+ const ref = await resolveProductRdoRef(raw, selectedOption);
128015
+ if (!ref) throw new Error(ERR_RESOLVE_PRODUCT);
128016
+ return { [productPath]: ref };
128017
+ }
128018
+ return {};
128019
+ }
128020
+ /** 扫码写入同组物料:路径与下拉一致;解析失败 throw。 */
128021
+ async function buildConsumeObjectScanProductUpdate(opts) {
128022
+ var _doc$isInEditMode3;
128023
+ const { doc, belongingObject, material } = opts;
128024
+ if ((_doc$isInEditMode3 = doc.isInEditMode) === null || _doc$isInEditMode3 === void 0 ? void 0 : _doc$isInEditMode3.call(doc)) return {};
128025
+ if (!belongingObject || !material) return {};
128026
+ if (!isMaterialConsumeObject(doc, belongingObject)) return {};
128027
+ const { productPath } = collectConsumeObjectPaths(doc, belongingObject);
128028
+ if (!productPath) return {};
128029
+ const ref = await resolveProductRdoRef(material.product_id_ ?? material.materialId, material);
128030
+ if (!ref) throw new Error(ERR_RESOLVE_PRODUCT_SCAN);
128031
+ return { [productPath]: ref };
128032
+ }
128033
+ function pickMergedValue(doc, path, nextValues) {
128034
+ if (path in nextValues) return nextValues[path];
128035
+ return doc.dataManager.get(path);
128036
+ }
128037
+ /**
128038
+ * 消耗对象写入前的复检入参:用即将写入的物料+批次。
128039
+ * 缺对象、缺物料或批次时返回 null(与消耗表缺参不查一致)。
128040
+ * product_id_ 为版本 id,供 versionEq 使用。
128041
+ */
128042
+ function getConsumeObjectReinspectionParams(opts) {
128043
+ var _doc$isInEditMode4;
128044
+ const { doc, belongingObject, fieldType, nextValues = {} } = opts;
128045
+ if ((_doc$isInEditMode4 = doc.isInEditMode) === null || _doc$isInEditMode4 === void 0 ? void 0 : _doc$isInEditMode4.call(doc)) return null;
128046
+ if (!belongingObject || !fieldType) return null;
128047
+ if (fieldType !== FIELD_TYPE.PRODUCT && fieldType !== FIELD_TYPE.MATERIAL_NO) return null;
128048
+ if (!isMaterialConsumeObject(doc, belongingObject)) return null;
128049
+ const { productPath, materialNoPath } = collectConsumeObjectPaths(doc, belongingObject);
128050
+ if (!productPath || !materialNoPath) return null;
128051
+ const productId = pickMergedValue(doc, productPath, nextValues);
128052
+ const materialNo = pickMergedValue(doc, materialNoPath, nextValues);
128053
+ const materialNoId = pickMergedValue(doc, getIdPath(materialNoPath), nextValues);
128054
+ if (isBlank$1(productId) || isBlank$1(materialNo) && isBlank$1(materialNoId)) return null;
128055
+ const versionId = parseFormTmplRefId(String(productId)).id;
128056
+ if (!versionId) return null;
128057
+ return {
128058
+ product_id_: versionId,
128059
+ material_no_: isBlank$1(materialNo) ? void 0 : String(materialNo),
128060
+ material_no_id_: isBlank$1(materialNoId) ? void 0 : String(materialNoId)
128061
+ };
128062
+ }
128063
+ var ERR_RESOLVE_PRODUCT, ERR_RESOLVE_PRODUCT_SCAN;
128064
+ var init_linkage = __esmMin((() => {
128065
+ init_field_paths();
128066
+ init_field_updates();
128067
+ init_field_type();
128068
+ init_service$5();
128069
+ init_core$1();
128070
+ ERR_RESOLVE_PRODUCT = "无法解析物料,请重新选择批次";
128071
+ ERR_RESOLVE_PRODUCT_SCAN = "无法解析物料,请重新扫码";
128072
+ }));
128073
+ //#endregion
127759
128074
  //#region src/suites/edhr/panel-schema/data-init/material-consume-object/index.ts
127760
128075
  var init_material_consume_object = __esmMin((() => {
127761
128076
  init_use_tmpl_bom();
127762
128077
  init_bom_validator();
128078
+ init_linkage();
127763
128079
  }));
127764
128080
  //#endregion
127765
128081
  //#region src/runtime/validation/useFormValidator.ts
@@ -140234,7 +140550,7 @@ function useTableDropdown(props, searchFilters) {
140234
140550
  /** 非联动场景、可选过滤、或联动已选择关联值时,才展示搜索栏 */
140235
140551
  const showSearch = computed(() => !enableLinkage.value || !linkageRequiresUpstreamValue.value || !!linkDataValue.value);
140236
140552
  const fetcher = async ({ keyword = "", pageNo, pageSize, deviceTypeId }) => {
140237
- var _fieldMeta$value14, _fieldMeta$value15, _window$TMPL_BOM_CONT, _fieldMeta$value16, _parsedValuePath$segm;
140553
+ var _fieldMeta$value14, _fieldMeta$value15, _window$TMPL_BOM_CONT, _fieldMeta$value16, _fieldMeta$value17, _parsedValuePath$segm;
140238
140554
  if (!fieldInfo.value) return {
140239
140555
  data: [],
140240
140556
  totalPage: 0,
@@ -140255,10 +140571,15 @@ function useTableDropdown(props, searchFilters) {
140255
140571
  const assocFilterParams = await buildAssocFilterExtraParams(docInst.value, widgetProps.value, runtimeValuePath.value);
140256
140572
  const belongingObject = (_fieldMeta$value15 = fieldMeta.value) === null || _fieldMeta$value15 === void 0 ? void 0 : _fieldMeta$value15.belongingObject;
140257
140573
  const formTmplBomController = (_window$TMPL_BOM_CONT = window[TMPL_BOM_CONTROLLER]) === null || _window$TMPL_BOM_CONT === void 0 ? void 0 : _window$TMPL_BOM_CONT.value;
140258
- const objectBomParams = ((_fieldMeta$value16 = fieldMeta.value) === null || _fieldMeta$value16 === void 0 ? void 0 : _fieldMeta$value16.fieldType) === FIELD_TYPE.MATERIAL_NO ? getObjectBomMaterialLotQuery({
140574
+ const objectBomParams = getObjectBomDropdownQuery((_fieldMeta$value16 = fieldMeta.value) === null || _fieldMeta$value16 === void 0 ? void 0 : _fieldMeta$value16.fieldType, {
140259
140575
  formInstBom: formTmplBomController === null || formTmplBomController === void 0 ? void 0 : formTmplBomController.formInstBom,
140260
140576
  belongingObject
140261
- }) : null;
140577
+ });
140578
+ const lotProductParams = getConsumeObjectLotProductQuery({
140579
+ doc: docInst.value,
140580
+ belongingObject,
140581
+ fieldType: (_fieldMeta$value17 = fieldMeta.value) === null || _fieldMeta$value17 === void 0 ? void 0 : _fieldMeta$value17.fieldType
140582
+ });
140262
140583
  const parsedValuePath = parseValuePath(runtimeValuePath.value);
140263
140584
  const rowIndexMatch = (_parsedValuePath$segm = parsedValuePath.segments[0]) === null || _parsedValuePath$segm === void 0 ? void 0 : _parsedValuePath$segm.match(/\[(\d+)\]/);
140264
140585
  const rowIndex = rowIndexMatch ? Number(rowIndexMatch[1]) : void 0;
@@ -140266,15 +140587,15 @@ function useTableDropdown(props, searchFilters) {
140266
140587
  const materialConsumeRow = rowIndex != null ? materialConsumeTableController === null || materialConsumeTableController === void 0 ? void 0 : materialConsumeTableController.actualTableData[rowIndex] : void 0;
140267
140588
  let materialConsumeRowParams;
140268
140589
  if (materialConsumeTableController && materialConsumeRow) {
140269
- var _fieldMeta$value17, _fieldMeta$value18;
140270
- if (((_fieldMeta$value17 = fieldMeta.value) === null || _fieldMeta$value17 === void 0 ? void 0 : _fieldMeta$value17.fieldType) === FIELD_TYPE.PRODUCT) materialConsumeRowParams = materialConsumeTableController.getProductQueryForRow(materialConsumeRow, rowIndex);
140271
- else if (((_fieldMeta$value18 = fieldMeta.value) === null || _fieldMeta$value18 === void 0 ? void 0 : _fieldMeta$value18.fieldType) === FIELD_TYPE.MATERIAL_NO) materialConsumeRowParams = materialConsumeTableController.getMaterialNoQueryForRow(materialConsumeRow, rowIndex);
140590
+ var _fieldMeta$value18, _fieldMeta$value19;
140591
+ if (((_fieldMeta$value18 = fieldMeta.value) === null || _fieldMeta$value18 === void 0 ? void 0 : _fieldMeta$value18.fieldType) === FIELD_TYPE.PRODUCT) materialConsumeRowParams = materialConsumeTableController.getProductQueryForRow(materialConsumeRow, rowIndex);
140592
+ else if (((_fieldMeta$value19 = fieldMeta.value) === null || _fieldMeta$value19 === void 0 ? void 0 : _fieldMeta$value19.fieldType) === FIELD_TYPE.MATERIAL_NO) materialConsumeRowParams = materialConsumeTableController.getMaterialNoQueryForRow(materialConsumeRow, rowIndex);
140272
140593
  }
140273
140594
  const extraParams = {
140274
140595
  ...subFieldConfig.get(valuePath),
140275
140596
  ...runtimeValuePath.value ? subFieldConfig.get(runtimeValuePath.value) : {},
140276
140597
  ...assocFilterParams,
140277
- ...objectBomParams ?? {},
140598
+ ...lotProductParams ?? objectBomParams ?? {},
140278
140599
  ...materialConsumeRowParams ?? {}
140279
140600
  };
140280
140601
  const { queryData = {}, exp = "" } = (buildQuery === null || buildQuery === void 0 ? void 0 : buildQuery({
@@ -143532,8 +143853,17 @@ var init_overlay_render_vue_vue_type_script_setup_true_lang = __esmMin((() => {
143532
143853
  belongingObject,
143533
143854
  productId: material.materialId
143534
143855
  });
143856
+ await assertReinspectionDate({
143857
+ product_id_: material.materialId,
143858
+ material_no_: material.productionIdentificationName,
143859
+ material_no_id_: material.productionIdentificationId
143860
+ });
143861
+ const productUpdates = await buildConsumeObjectScanProductUpdate({
143862
+ doc: props.doc,
143863
+ belongingObject,
143864
+ material
143865
+ });
143535
143866
  const byBiz = (bizType) => objectFields.find((item) => (item.bizType || item.type) === bizType);
143536
- const productField = byBiz(FIELD_TYPE.PRODUCT);
143537
143867
  const qtyField = byBiz(FIELD_TYPE.QTY);
143538
143868
  const expirationField = objectFields.find((item) => {
143539
143869
  var _item$key;
@@ -143542,7 +143872,7 @@ var init_overlay_render_vue_vue_type_script_setup_true_lang = __esmMin((() => {
143542
143872
  const updates = { ...transformedData };
143543
143873
  updates[runtimeValuePath.value] = material.productionIdentificationName;
143544
143874
  updates[getIdPath(runtimeValuePath.value)] = material.productionIdentificationId;
143545
- if (productField) updates[productField.key] = material.materialId;
143875
+ Object.assign(updates, productUpdates);
143546
143876
  if (qtyField && parsedValue.qty !== void 0) updates[qtyField.key] = parsedValue.qty;
143547
143877
  if (expirationField && parsedValue.expiration !== void 0) updates[expirationField.key] = parsedValue.expiration;
143548
143878
  props.doc.dataManager.setMultiple(updates, "user");
@@ -143596,7 +143926,7 @@ var init_overlay_render_vue_vue_type_script_setup_true_lang = __esmMin((() => {
143596
143926
  });
143597
143927
  }
143598
143928
  async function onChange(data, record) {
143599
- var _widgetProps$value7, _widgetProps$value8, _props$widget$widgetM, _props$widget$dataSlo, _fieldMeta$value4, _fieldMeta$value5, _fieldMeta$value6, _fieldMeta$value7;
143929
+ var _widgetProps$value7, _widgetProps$value8, _props$widget$widgetM, _props$widget$dataSlo, _fieldMeta$value4, _fieldMeta$value5, _fieldMeta$value6, _fieldMeta$value7, _fieldMeta$value10, _fieldMeta$value11;
143600
143930
  const dataValues = loadDataValuesByAutofillRules(record, (_widgetProps$value7 = widgetProps.value) === null || _widgetProps$value7 === void 0 ? void 0 : _widgetProps$value7.autofillRules, runtimeValuePath.value, (_widgetProps$value8 = widgetProps.value) === null || _widgetProps$value8 === void 0 ? void 0 : _widgetProps$value8.autofillEnabled, props.doc);
143601
143931
  const subFieldValuePath = (_props$widget$widgetM = props.widget.widgetMeta) === null || _props$widget$widgetM === void 0 || (_props$widget$widgetM = _props$widget$widgetM.field) === null || _props$widget$widgetM === void 0 ? void 0 : _props$widget$widgetM.valuePath;
143602
143932
  const dataIndex = (_props$widget$dataSlo = props.widget.dataSlotIndex) === null || _props$widget$dataSlo === void 0 ? void 0 : _props$widget$dataSlo.dataIndex;
@@ -143639,11 +143969,39 @@ var init_overlay_render_vue_vue_type_script_setup_true_lang = __esmMin((() => {
143639
143969
  ...dateObjectFill
143640
143970
  };
143641
143971
  const linkageClears = tableRuntime.buildDownstreamClears(pending);
143642
- props.doc.dataManager.setMultiple({
143972
+ let consumeUpdates = {};
143973
+ try {
143974
+ var _fieldMeta$value8, _fieldMeta$value9;
143975
+ consumeUpdates = await buildConsumeObjectSelectUpdates({
143976
+ doc: props.doc,
143977
+ belongingObject: (_fieldMeta$value8 = fieldMeta.value) === null || _fieldMeta$value8 === void 0 ? void 0 : _fieldMeta$value8.belongingObject,
143978
+ fieldType: (_fieldMeta$value9 = fieldMeta.value) === null || _fieldMeta$value9 === void 0 ? void 0 : _fieldMeta$value9.fieldType,
143979
+ selectedOption: record,
143980
+ pending: data
143981
+ });
143982
+ } catch (e) {
143983
+ GctMessage.error((e === null || e === void 0 ? void 0 : e.message) || "无法解析物料,请重新选择批次");
143984
+ return;
143985
+ }
143986
+ const nextValues = {
143643
143987
  ...pending,
143644
143988
  ...linkageClears,
143645
- ...dateObjectClears
143646
- }, "user");
143989
+ ...dateObjectClears,
143990
+ ...consumeUpdates
143991
+ };
143992
+ const reinspection = getConsumeObjectReinspectionParams({
143993
+ doc: props.doc,
143994
+ belongingObject: (_fieldMeta$value10 = fieldMeta.value) === null || _fieldMeta$value10 === void 0 ? void 0 : _fieldMeta$value10.belongingObject,
143995
+ fieldType: (_fieldMeta$value11 = fieldMeta.value) === null || _fieldMeta$value11 === void 0 ? void 0 : _fieldMeta$value11.fieldType,
143996
+ nextValues
143997
+ });
143998
+ if (reinspection) try {
143999
+ await assertReinspectionDate(reinspection);
144000
+ } catch (e) {
144001
+ GctMessage.error((e === null || e === void 0 ? void 0 : e.message) || "已超物料复检日期,该物料不可用");
144002
+ return;
144003
+ }
144004
+ props.doc.dataManager.setMultiple(nextValues, "user");
143647
144005
  if (subFieldValuePath && isNumber(dataIndex)) {
143648
144006
  var _props$doc$model, _allRegions$find;
143649
144007
  const parsed = parseValuePath(subFieldValuePath);
@@ -143777,8 +144135,8 @@ var init_overlay_render_vue_vue_type_script_setup_true_lang = __esmMin((() => {
143777
144135
  //#region src/runtime/canvas/__common__/widget-container/overlay-render.vue?vue&type=style&index=0&lang.less
143778
144136
  var init_overlay_render_vue_vue_type_style_index_0_lang = __esmMin((() => {}));
143779
144137
  //#endregion
143780
- //#region src/runtime/canvas/__common__/widget-container/overlay-render.vue?vue&type=style&index=1&scoped=d63857b1&lang.less
143781
- var init_overlay_render_vue_vue_type_style_index_1_scoped_d63857b1_lang = __esmMin((() => {}));
144138
+ //#region src/runtime/canvas/__common__/widget-container/overlay-render.vue?vue&type=style&index=1&scoped=5a0ffda2&lang.less
144139
+ var init_overlay_render_vue_vue_type_style_index_1_scoped_5a0ffda2_lang = __esmMin((() => {}));
143782
144140
  //#endregion
143783
144141
  //#region src/runtime/canvas/__common__/widget-container/overlay-render.vue
143784
144142
  var overlay_render_default;
@@ -143786,9 +144144,9 @@ var init_overlay_render = __esmMin((() => {
143786
144144
  init_overlay_render_vue_vue_type_script_setup_true_lang();
143787
144145
  init_overlay_render_vue_vue_type_script_setup_true_lang();
143788
144146
  init_overlay_render_vue_vue_type_style_index_0_lang();
143789
- init_overlay_render_vue_vue_type_style_index_1_scoped_d63857b1_lang();
144147
+ init_overlay_render_vue_vue_type_style_index_1_scoped_5a0ffda2_lang();
143790
144148
  init__plugin_vue_export_helper();
143791
- overlay_render_default = /*#__PURE__*/ _plugin_vue_export_helper_default(overlay_render_vue_vue_type_script_setup_true_lang_default, [["__scopeId", "data-v-d63857b1"]]);
144149
+ overlay_render_default = /*#__PURE__*/ _plugin_vue_export_helper_default(overlay_render_vue_vue_type_script_setup_true_lang_default, [["__scopeId", "data-v-5a0ffda2"]]);
143792
144150
  }));
143793
144151
  //#endregion
143794
144152
  //#region src/utils/composables/useHoverDelay.ts
@@ -146996,7 +147354,7 @@ var init_business_scan_menu = __esmMin((() => {
146996
147354
  }));
146997
147355
  //#endregion
146998
147356
  //#region src/runtime/canvas/table/render/table-structure-overlay/sub-table-action/repeating-table-action.vue?vue&type=script&setup=true&name=sub-table-action&lang.ts
146999
- var _hoisted_1$133, _hoisted_2$81, _hoisted_3$54, _hoisted_4$39, _hoisted_5$29, _hoisted_6$19, _hoisted_7$15, _hoisted_8$11, _hoisted_9$6, _hoisted_10$5, _hoisted_11$4, _hoisted_12$3, _hoisted_13$2, _hoisted_14$2, _hoisted_15$2, _hoisted_16$2, _hoisted_17$1, _hoisted_18$1, _hoisted_19, _hoisted_20, repeating_table_action_vue_vue_type_script_setup_true_name_sub_table_action_lang_default;
147357
+ var _hoisted_1$133, _hoisted_2$81, _hoisted_3$54, _hoisted_4$39, _hoisted_5$29, _hoisted_6$19, _hoisted_7$15, _hoisted_8$11, _hoisted_9$6, _hoisted_10$5, _hoisted_11$4, _hoisted_12$3, _hoisted_13$2, _hoisted_14$2, _hoisted_15$2, _hoisted_16$2, _hoisted_17$1, _hoisted_18$1, _hoisted_19, _hoisted_20, _hoisted_21, _hoisted_22, _hoisted_23, _hoisted_24, _hoisted_25, _hoisted_26, repeating_table_action_vue_vue_type_script_setup_true_name_sub_table_action_lang_default;
147000
147358
  var init_repeating_table_action_vue_vue_type_script_setup_true_name_sub_table_action_lang = __esmMin((() => {
147001
147359
  init_base$2();
147002
147360
  init_core$1();
@@ -147006,39 +147364,47 @@ var init_repeating_table_action_vue_vue_type_script_setup_true_name_sub_table_ac
147006
147364
  init_table$1();
147007
147365
  init_material_balance();
147008
147366
  init__register_();
147009
- init_types$4();
147010
147367
  init_constants$1();
147011
147368
  init_quick_fill_util();
147012
147369
  init_business_scan_menu();
147013
147370
  _hoisted_1$133 = { class: "sub-table-action-bar" };
147014
147371
  _hoisted_2$81 = { class: "sub-table-action-popper" };
147015
- _hoisted_3$54 = {
147372
+ _hoisted_3$54 = { class: "action-menu" };
147373
+ _hoisted_4$39 = { class: "item-icon" };
147374
+ _hoisted_5$29 = { class: "action-menu" };
147375
+ _hoisted_6$19 = { class: "item-icon" };
147376
+ _hoisted_7$15 = { class: "item-icon" };
147377
+ _hoisted_8$11 = { class: "item-icon" };
147378
+ _hoisted_9$6 = {
147016
147379
  key: 0,
147017
147380
  class: "action-menu"
147018
147381
  };
147019
- _hoisted_4$39 = { class: "item-icon" };
147020
- _hoisted_5$29 = { class: "item-icon" };
147021
- _hoisted_6$19 = { class: "item-icon" };
147022
- _hoisted_7$15 = {
147382
+ _hoisted_10$5 = { class: "item-icon" };
147383
+ _hoisted_11$4 = {
147023
147384
  key: 1,
147024
147385
  class: "action-menu"
147025
147386
  };
147026
- _hoisted_8$11 = { class: "item-icon" };
147027
- _hoisted_9$6 = { class: "action-menu" };
147028
- _hoisted_10$5 = { class: "item-icon scale-large" };
147029
- _hoisted_11$4 = { class: "item-icon" };
147030
147387
  _hoisted_12$3 = { class: "item-icon" };
147031
- _hoisted_13$2 = { class: "item-icon scale-large" };
147032
- _hoisted_14$2 = { class: "item-label flex-between-center" };
147033
- _hoisted_15$2 = { class: "item-icon scale-large" };
147034
- _hoisted_16$2 = { class: "item-label flex-between-center" };
147035
- _hoisted_17$1 = {
147036
- key: 2,
147388
+ _hoisted_13$2 = {
147389
+ key: 1,
147037
147390
  class: "action-menu"
147038
147391
  };
147392
+ _hoisted_14$2 = { class: "item-icon" };
147393
+ _hoisted_15$2 = { class: "action-menu" };
147394
+ _hoisted_16$2 = { class: "item-icon scale-large" };
147395
+ _hoisted_17$1 = { class: "item-icon" };
147039
147396
  _hoisted_18$1 = { class: "item-icon" };
147040
- _hoisted_19 = { class: "sub-more-btn" };
147041
- _hoisted_20 = { class: "sub-more-btn-item" };
147397
+ _hoisted_19 = { class: "item-icon scale-large" };
147398
+ _hoisted_20 = { class: "item-label flex-between-center" };
147399
+ _hoisted_21 = { class: "item-icon scale-large" };
147400
+ _hoisted_22 = { class: "item-label flex-between-center" };
147401
+ _hoisted_23 = {
147402
+ key: 0,
147403
+ class: "action-menu"
147404
+ };
147405
+ _hoisted_24 = { class: "item-icon" };
147406
+ _hoisted_25 = { class: "sub-more-btn" };
147407
+ _hoisted_26 = { class: "sub-more-btn-item" };
147042
147408
  repeating_table_action_vue_vue_type_script_setup_true_name_sub_table_action_lang_default = /*@__PURE__*/ defineComponent({
147043
147409
  __name: "repeating-table-action",
147044
147410
  props: {
@@ -147119,12 +147485,20 @@ var init_repeating_table_action_vue_vue_type_script_setup_true_name_sub_table_ac
147119
147485
  const { subRenderer, subFieldKey, index } = getCtx();
147120
147486
  const visibleRows = getTableRows(subFieldKey, true);
147121
147487
  const { isMaterialConsume, isWarehouseInventory, isPretreatmentList } = subTableType.value;
147488
+ const canQuickFill = !!((_subRenderer$widgetMe = subRenderer.widgetMeta) === null || _subRenderer$widgetMe === void 0 || (_subRenderer$widgetMe = _subRenderer$widgetMe.props) === null || _subRenderer$widgetMe === void 0 ? void 0 : _subRenderer$widgetMe.quickFill);
147489
+ const canCopy = !isWarehouseInventory && !isPretreatmentList && !isMaterialConsume;
147490
+ const canInsertMulti = !isMaterialConsume;
147491
+ const canDelete = visibleRows.length > 1;
147492
+ const canClear = isMaterialConsume && visibleRows.length === 1 && !!props.isLastRow;
147493
+ const isConfirmed = !!((_visibleRows$index = visibleRows[index]) === null || _visibleRows$index === void 0 ? void 0 : _visibleRows$index.is_confirmed_);
147122
147494
  return {
147123
- canQuickFill: !!((_subRenderer$widgetMe = subRenderer.widgetMeta) === null || _subRenderer$widgetMe === void 0 || (_subRenderer$widgetMe = _subRenderer$widgetMe.props) === null || _subRenderer$widgetMe === void 0 ? void 0 : _subRenderer$widgetMe.quickFill),
147124
- canCopy: !isWarehouseInventory && !isPretreatmentList,
147125
- canInsertMulti: !isMaterialConsume,
147126
- canDelete: visibleRows.length > 1 && (isMaterialConsume ? props.isLastRow : true),
147127
- canEdit: !!((_visibleRows$index = visibleRows[index]) === null || _visibleRows$index === void 0 ? void 0 : _visibleRows$index.is_confirmed_)
147495
+ canQuickFill,
147496
+ canCopy,
147497
+ canInsertMulti,
147498
+ canDelete,
147499
+ canClear,
147500
+ canEdit: isConfirmed,
147501
+ canInsertMcRow: isMaterialConsume && !isConfirmed
147128
147502
  };
147129
147503
  });
147130
147504
  const mcTableCtrl = computed(() => {
@@ -147132,10 +147506,6 @@ var init_repeating_table_action_vue_vue_type_script_setup_true_name_sub_table_ac
147132
147506
  const { valuePath } = getCtx();
147133
147507
  return tmplBomCRef === null || tmplBomCRef === void 0 || (_tmplBomCRef$value = tmplBomCRef.value) === null || _tmplBomCRef$value === void 0 ? void 0 : _tmplBomCRef$value.tableControllers[valuePath];
147134
147508
  });
147135
- const mcTableIsBomPattern = computed(() => {
147136
- var _mcTableCtrl$value;
147137
- return ((_mcTableCtrl$value = mcTableCtrl.value) === null || _mcTableCtrl$value === void 0 ? void 0 : _mcTableCtrl$value.mcPattern) === MaterialConsumptionPatternEnum.BOM;
147138
- });
147139
147509
  const handleMaterialConsumeAction = async (val) => {
147140
147510
  const ctrl = mcTableCtrl.value;
147141
147511
  const { tableName, valuePath, subFieldKey, subModelKey, index: rowIndex } = getCtx();
@@ -147153,7 +147523,7 @@ var init_repeating_table_action_vue_vue_type_script_setup_true_name_sub_table_ac
147153
147523
  subModelKey,
147154
147524
  subFieldOptions: getSubFieldOptions(subModelKey)
147155
147525
  });
147156
- else if (val === "edit-row") ctrl.editRow({
147526
+ else if (val === "edit-row") await ctrl.editRow({
147157
147527
  dataManager,
147158
147528
  subFieldKey,
147159
147529
  rowIndex
@@ -147165,7 +147535,21 @@ var init_repeating_table_action_vue_vue_type_script_setup_true_name_sub_table_ac
147165
147535
  rowIndex
147166
147536
  }, doc);
147167
147537
  if (insertedIndex !== void 0) handleRowIncreased(subFieldKey, insertedIndex);
147168
- }
147538
+ } else if (val === "add-row") {
147539
+ const insertedIndex = ctrl.addRowForGroup({
147540
+ dataManager,
147541
+ subFieldKey,
147542
+ rowIndex
147543
+ }, doc);
147544
+ if (insertedIndex !== void 0) handleRowIncreased(subFieldKey, insertedIndex);
147545
+ } else if (val === "clear-row") GctModal.confirm("是否确认清除内容?", () => {
147546
+ ctrl.clearRow({
147547
+ dataManager,
147548
+ subFieldKey,
147549
+ rowIndex
147550
+ }, doc);
147551
+ handleRowIncreased(subFieldKey, rowIndex);
147552
+ });
147169
147553
  };
147170
147554
  const handleMaterialBalanceAction = async () => {
147171
147555
  await openMaterialBalanceConsumeModal({ doc: props.doc });
@@ -147198,9 +147582,13 @@ var init_repeating_table_action_vue_vue_type_script_setup_true_name_sub_table_ac
147198
147582
  */
147199
147583
  const handleRowIncreased = (subFieldKey, rowIndex) => {
147200
147584
  if (subTableType.value.isMaterialConsume) {
147201
- var _mcTableCtrl$value2;
147202
- (_mcTableCtrl$value2 = mcTableCtrl.value) === null || _mcTableCtrl$value2 === void 0 || _mcTableCtrl$value2.updateRowConsumed(props.doc);
147203
- if (mcTableIsBomPattern.value) MCDataUtil.updateQtyRequiredDisablement(props.doc.dataManager, `$.${subFieldKey}[${rowIndex}]`, true);
147585
+ var _mcTableCtrl$value, _props$doc$dataManage;
147586
+ (_mcTableCtrl$value = mcTableCtrl.value) === null || _mcTableCtrl$value === void 0 || _mcTableCtrl$value.updateRowConsumed(props.doc);
147587
+ const row = (_props$doc$dataManage = props.doc.dataManager.getRawData()[subFieldKey]) === null || _props$doc$dataManage === void 0 ? void 0 : _props$doc$dataManage[rowIndex];
147588
+ if (row) {
147589
+ var _mcTableCtrl$value2;
147590
+ (_mcTableCtrl$value2 = mcTableCtrl.value) === null || _mcTableCtrl$value2 === void 0 || _mcTableCtrl$value2.syncEditingRowDisablement(props.doc.dataManager, `$.${subFieldKey}[${rowIndex}]`, row);
147591
+ }
147204
147592
  }
147205
147593
  new TableRuntime(props.doc).onRowInit(subFieldKey, rowIndex);
147206
147594
  };
@@ -147275,76 +147663,104 @@ var init_repeating_table_action_vue_vue_type_script_setup_true_name_sub_table_ac
147275
147663
  "instant-move": ""
147276
147664
  }, {
147277
147665
  popper: withCtx(() => [createElementVNode("div", _hoisted_2$81, [
147278
- subTableType.value.isMaterialConsume ? (openBlock(), createElementBlock("div", _hoisted_3$54, [
147279
- _cache[16] || (_cache[16] = createElementVNode("div", { class: "menu-title" }, "业务操作", -1)),
147280
- actionInfo.value.canEdit ? (openBlock(), createElementBlock("div", {
147281
- key: 0,
147666
+ subTableType.value.isMaterialConsume ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
147667
+ createElementVNode("div", _hoisted_3$54, [_cache[17] || (_cache[17] = createElementVNode("div", { class: "menu-title" }, "业务操作", -1)), createElementVNode("div", {
147282
147668
  class: "menu-item",
147283
- onClick: _cache[0] || (_cache[0] = ($event) => handleMaterialConsumeAction("edit-row"))
147284
- }, [createElementVNode("div", _hoisted_4$39, [createVNode(unref(icon_default), { icon: "icon-bianji" })]), _cache[13] || (_cache[13] = createElementVNode("div", { class: "item-label" }, "编辑", -1))])) : createCommentVNode("", true),
147285
- __props.isLastRow ? (openBlock(), createElementBlock("div", {
147286
- key: 1,
147669
+ onClick: _cache[0] || (_cache[0] = ($event) => handleMaterialConsumeAction("scan"))
147670
+ }, [createElementVNode("div", _hoisted_4$39, [createVNode(unref(icon_default), {
147671
+ icon: "icon-saoma1",
147672
+ size: "16"
147673
+ })]), _cache[16] || (_cache[16] = createElementVNode("div", { class: "item-label" }, "条码扫描", -1))])]),
147674
+ createElementVNode("div", _hoisted_5$29, [
147675
+ _cache[21] || (_cache[21] = createElementVNode("div", { class: "menu-title" }, "行编辑", -1)),
147676
+ actionInfo.value.canEdit ? (openBlock(), createElementBlock("div", {
147677
+ key: 0,
147678
+ class: "menu-item",
147679
+ onClick: _cache[1] || (_cache[1] = ($event) => handleMaterialConsumeAction("edit-row"))
147680
+ }, [createElementVNode("div", _hoisted_6$19, [createVNode(unref(icon_default), {
147681
+ icon: "icon-zhongxinbianjidangqianhang",
147682
+ size: "20"
147683
+ })]), _cache[18] || (_cache[18] = createElementVNode("div", { class: "item-label" }, "重新编辑当前行", -1))])) : createCommentVNode("", true),
147684
+ actionInfo.value.canInsertMcRow ? (openBlock(), createElementBlock("div", {
147685
+ key: 1,
147686
+ class: "menu-item",
147687
+ onClick: _cache[2] || (_cache[2] = ($event) => handleMaterialConsumeAction("add-row"))
147688
+ }, [createElementVNode("div", _hoisted_7$15, [createVNode(unref(icon_default), {
147689
+ icon: "icon-jiayihang",
147690
+ size: "20"
147691
+ })]), _cache[19] || (_cache[19] = createElementVNode("div", { class: "item-label" }, "加一行", -1))])) : createCommentVNode("", true),
147692
+ createElementVNode("div", {
147693
+ class: "menu-item",
147694
+ onClick: _cache[3] || (_cache[3] = ($event) => handleMaterialConsumeAction("add-group"))
147695
+ }, [createElementVNode("div", _hoisted_8$11, [createVNode(unref(icon_default), {
147696
+ icon: "icon-jiayihang",
147697
+ size: "20"
147698
+ })]), _cache[20] || (_cache[20] = createElementVNode("div", { class: "item-label" }, "加一组", -1))])
147699
+ ]),
147700
+ actionInfo.value.canDelete ? (openBlock(), createElementBlock("div", _hoisted_9$6, [createElementVNode("div", {
147287
147701
  class: "menu-item",
147288
- onClick: _cache[1] || (_cache[1] = ($event) => handleMaterialConsumeAction("scan"))
147289
- }, [createElementVNode("div", _hoisted_5$29, [createVNode(unref(icon_default), { icon: "icon-saoyisao" })]), _cache[14] || (_cache[14] = createElementVNode("div", { class: "item-label" }, "条码扫描", -1))])) : createCommentVNode("", true),
147290
- __props.isLastRow ? (openBlock(), createElementBlock("div", {
147291
- key: 2,
147702
+ onClick: _cache[4] || (_cache[4] = ($event) => handleAction("deleteRowCurrent"))
147703
+ }, [createElementVNode("div", _hoisted_10$5, [createVNode(unref(icon_default), {
147704
+ icon: "icon-a-shanchubiaoge",
147705
+ size: "16"
147706
+ })]), _cache[22] || (_cache[22] = createElementVNode("div", { class: "item-label" }, "删除行", -1))])])) : actionInfo.value.canClear ? (openBlock(), createElementBlock("div", _hoisted_11$4, [createElementVNode("div", {
147292
147707
  class: "menu-item",
147293
- onClick: _cache[2] || (_cache[2] = ($event) => handleMaterialConsumeAction("add-group"))
147294
- }, [createElementVNode("div", _hoisted_6$19, [createVNode(unref(icon_default), { icon: "icon-tianjia" })]), _cache[15] || (_cache[15] = createElementVNode("div", { class: "item-label" }, "加一组", -1))])) : createCommentVNode("", true)
147295
- ])) : createCommentVNode("", true),
147296
- businessScanMenu.value ? (openBlock(), createElementBlock("div", _hoisted_7$15, [_cache[18] || (_cache[18] = createElementVNode("div", { class: "menu-title" }, "业务操作", -1)), createElementVNode("div", {
147708
+ onClick: _cache[5] || (_cache[5] = ($event) => handleMaterialConsumeAction("clear-row"))
147709
+ }, [createElementVNode("div", _hoisted_12$3, [createVNode(unref(icon_default), {
147710
+ icon: "icon-a-shanchubiaoge",
147711
+ size: "16"
147712
+ })]), _cache[23] || (_cache[23] = createElementVNode("div", { class: "item-label" }, "清除内容", -1))])])) : createCommentVNode("", true)
147713
+ ], 64)) : createCommentVNode("", true),
147714
+ businessScanMenu.value ? (openBlock(), createElementBlock("div", _hoisted_13$2, [_cache[25] || (_cache[25] = createElementVNode("div", { class: "menu-title" }, "业务操作", -1)), createElementVNode("div", {
147297
147715
  class: "menu-item",
147298
147716
  onClick: handleBusinessScanAction
147299
- }, [createElementVNode("div", _hoisted_8$11, [createVNode(unref(icon_default), { icon: "icon-saoyisao" })]), _cache[17] || (_cache[17] = createElementVNode("div", { class: "item-label" }, " 条码扫描 ", -1))])])) : createCommentVNode("", true),
147300
- createElementVNode("div", _hoisted_9$6, [
147717
+ }, [createElementVNode("div", _hoisted_14$2, [createVNode(unref(icon_default), { icon: "icon-saoyisao" })]), _cache[24] || (_cache[24] = createElementVNode("div", { class: "item-label" }, " 条码扫描 ", -1))])])) : createCommentVNode("", true),
147718
+ !subTableType.value.isMaterialConsume ? (openBlock(), createElementBlock(Fragment, { key: 2 }, [createElementVNode("div", _hoisted_15$2, [
147301
147719
  actionInfo.value.canQuickFill ? (openBlock(), createElementBlock("div", {
147302
147720
  key: 0,
147303
147721
  class: "menu-item",
147304
- onClick: _cache[3] || (_cache[3] = ($event) => unref(handleOpenDynamicQuickFillModal)(props))
147305
- }, [createElementVNode("div", _hoisted_10$5, [createVNode(unref(icon_default), { icon: "icon-zhongxinbianjidangqianhang" })]), _cache[19] || (_cache[19] = createElementVNode("div", { class: "item-label" }, "快速填报", -1))])) : createCommentVNode("", true),
147306
- _cache[24] || (_cache[24] = createElementVNode("div", { class: "menu-title" }, "行编辑", -1)),
147307
- !subTableType.value.isMaterialConsume ? (openBlock(), createElementBlock("div", {
147308
- key: 1,
147722
+ onClick: _cache[6] || (_cache[6] = ($event) => unref(handleOpenDynamicQuickFillModal)(props))
147723
+ }, [createElementVNode("div", _hoisted_16$2, [createVNode(unref(icon_default), { icon: "icon-zhongxinbianjidangqianhang" })]), _cache[26] || (_cache[26] = createElementVNode("div", { class: "item-label" }, "快速填报", -1))])) : createCommentVNode("", true),
147724
+ _cache[31] || (_cache[31] = createElementVNode("div", { class: "menu-title" }, "行编辑", -1)),
147725
+ createElementVNode("div", {
147309
147726
  class: "menu-item",
147310
- onClick: _cache[4] || (_cache[4] = ($event) => handleAction("insertRowAfter"))
147311
- }, [createElementVNode("div", _hoisted_11$4, [createVNode(unref(icon_default), { icon: "icon-tianjia" })]), _cache[20] || (_cache[20] = createElementVNode("div", { class: "item-label" }, " 加一行 ", -1))])) : createCommentVNode("", true),
147727
+ onClick: _cache[7] || (_cache[7] = ($event) => handleAction("insertRowAfter"))
147728
+ }, [createElementVNode("div", _hoisted_17$1, [createVNode(unref(icon_default), { icon: "icon-tianjia" })]), _cache[27] || (_cache[27] = createElementVNode("div", { class: "item-label" }, " 加一行 ", -1))]),
147312
147729
  actionInfo.value.canCopy ? (openBlock(), createElementBlock("div", {
147313
- key: 2,
147730
+ key: 1,
147314
147731
  class: "menu-item",
147315
- onClick: _cache[5] || (_cache[5] = ($event) => handleAction("copyCurrentRow"))
147316
- }, [createElementVNode("div", _hoisted_12$3, [createVNode(unref(icon_default), { icon: "icon-fuzhihang" })]), _cache[21] || (_cache[21] = createElementVNode("div", { class: "item-label" }, " 复制行 ", -1))])) : createCommentVNode("", true),
147732
+ onClick: _cache[8] || (_cache[8] = ($event) => handleAction("copyCurrentRow"))
147733
+ }, [createElementVNode("div", _hoisted_18$1, [createVNode(unref(icon_default), { icon: "icon-fuzhihang" })]), _cache[28] || (_cache[28] = createElementVNode("div", { class: "item-label" }, " 复制行 ", -1))])) : createCommentVNode("", true),
147317
147734
  actionInfo.value.canInsertMulti ? (openBlock(), createElementBlock("div", {
147318
- key: 3,
147735
+ key: 2,
147319
147736
  class: "menu-item",
147320
- onClick: _cache[8] || (_cache[8] = ($event) => handleAction("insertRowBeforeMore"))
147321
- }, [createElementVNode("div", _hoisted_13$2, [createVNode(unref(icon_default), { icon: "icon-shangfangcharuhang" })]), createElementVNode("div", _hoisted_14$2, [_cache[22] || (_cache[22] = createElementVNode("div", null, " 在上方插入行 ", -1)), createVNode(unref(input_number_default), {
147737
+ onClick: _cache[11] || (_cache[11] = ($event) => handleAction("insertRowBeforeMore"))
147738
+ }, [createElementVNode("div", _hoisted_19, [createVNode(unref(icon_default), { icon: "icon-shangfangcharuhang" })]), createElementVNode("div", _hoisted_20, [_cache[29] || (_cache[29] = createElementVNode("div", null, " 在上方插入行 ", -1)), createVNode(unref(input_number_default), {
147322
147739
  modelValue: formState.upRowNum,
147323
- "onUpdate:modelValue": _cache[6] || (_cache[6] = ($event) => formState.upRowNum = $event),
147740
+ "onUpdate:modelValue": _cache[9] || (_cache[9] = ($event) => formState.upRowNum = $event),
147324
147741
  min: 1,
147325
147742
  integer: "",
147326
147743
  style: { "width": "68px" },
147327
- onClick: _cache[7] || (_cache[7] = withModifiers(() => {}, ["stop"]))
147744
+ onClick: _cache[10] || (_cache[10] = withModifiers(() => {}, ["stop"]))
147328
147745
  }, null, 8, ["modelValue"])])])) : createCommentVNode("", true),
147329
147746
  actionInfo.value.canInsertMulti ? (openBlock(), createElementBlock("div", {
147330
- key: 4,
147747
+ key: 3,
147331
147748
  class: "menu-item",
147332
- onClick: _cache[11] || (_cache[11] = ($event) => handleAction("insertRowAfterMore"))
147333
- }, [createElementVNode("div", _hoisted_15$2, [createVNode(unref(icon_default), { icon: "icon-xiafangcharuhang" })]), createElementVNode("div", _hoisted_16$2, [_cache[23] || (_cache[23] = createElementVNode("div", null, " 在下方插入行 ", -1)), createVNode(unref(input_number_default), {
147749
+ onClick: _cache[14] || (_cache[14] = ($event) => handleAction("insertRowAfterMore"))
147750
+ }, [createElementVNode("div", _hoisted_21, [createVNode(unref(icon_default), { icon: "icon-xiafangcharuhang" })]), createElementVNode("div", _hoisted_22, [_cache[30] || (_cache[30] = createElementVNode("div", null, " 在下方插入行 ", -1)), createVNode(unref(input_number_default), {
147334
147751
  modelValue: formState.downRowNum,
147335
- "onUpdate:modelValue": _cache[9] || (_cache[9] = ($event) => formState.downRowNum = $event),
147752
+ "onUpdate:modelValue": _cache[12] || (_cache[12] = ($event) => formState.downRowNum = $event),
147336
147753
  min: 1,
147337
147754
  integer: "",
147338
147755
  style: { "width": "68px" },
147339
- onClick: _cache[10] || (_cache[10] = withModifiers(() => {}, ["stop"]))
147756
+ onClick: _cache[13] || (_cache[13] = withModifiers(() => {}, ["stop"]))
147340
147757
  }, null, 8, ["modelValue"])])])) : createCommentVNode("", true)
147341
- ]),
147342
- actionInfo.value.canDelete ? (openBlock(), createElementBlock("div", _hoisted_17$1, [createElementVNode("div", {
147758
+ ]), actionInfo.value.canDelete ? (openBlock(), createElementBlock("div", _hoisted_23, [createElementVNode("div", {
147343
147759
  class: "menu-item",
147344
- onClick: _cache[12] || (_cache[12] = ($event) => handleAction("deleteRowCurrent"))
147345
- }, [createElementVNode("div", _hoisted_18$1, [createVNode(unref(icon_default), { icon: "icon-shanchu1" })]), _cache[25] || (_cache[25] = createElementVNode("div", { class: "item-label" }, " 删除行 ", -1))])])) : createCommentVNode("", true)
147760
+ onClick: _cache[15] || (_cache[15] = ($event) => handleAction("deleteRowCurrent"))
147761
+ }, [createElementVNode("div", _hoisted_24, [createVNode(unref(icon_default), { icon: "icon-shanchu1" })]), _cache[32] || (_cache[32] = createElementVNode("div", { class: "item-label" }, " 删除行 ", -1))])])) : createCommentVNode("", true)], 64)) : createCommentVNode("", true)
147346
147762
  ])]),
147347
- default: withCtx(() => [createElementVNode("div", _hoisted_19, [createElementVNode("div", _hoisted_20, [createVNode(unref(icon_default), {
147763
+ default: withCtx(() => [createElementVNode("div", _hoisted_25, [createElementVNode("div", _hoisted_26, [createVNode(unref(icon_default), {
147348
147764
  icon: "icon-gengduo1",
147349
147765
  color: "#fff"
147350
147766
  })])])]),
@@ -20,7 +20,7 @@ export interface UpdateRowOption {
20
20
  * 物料消耗表字段控制 v2026.6.15
21
21
  * - [需求数量、已消耗数量] 始终只读
22
22
  * - [有效期、唯一标识、自定义字段] 始终可填(不做控制)
23
- * - 选择的物料类型是[查看物料]时 [批次、上料数量、工序] 只读
23
+ * - 选择的物料类型是[查看物料]时 [批次、上料数量] 只读(与 Excel calcDisabledFields 一致)
24
24
  * - 单行校验通过后(包括暂存后再次编辑)[物料、批次、上料数量、工序、需求数量单位、数量单位、转换后数量、转换数量单位ID、单位转化公式] 只读
25
25
  * v2026.7.30
26
26
  * - [物料消耗模式]是[记录模式]时,可以填写[需求数量](BOM 模式禁用 需求数量)
@@ -54,6 +54,14 @@ export declare class MCDataUtil {
54
54
  rowPath: string;
55
55
  disabled: boolean;
56
56
  }): void;
57
+ /**
58
+ * 编辑态行:按 Excel calcDisabledFields 禁用字段,其余受控字段可填
59
+ */
60
+ static applyEditingRowDisablement(option: {
61
+ dataManager: DataManager;
62
+ rowPath: string;
63
+ disabledFields: string[];
64
+ }): void;
57
65
  /**
58
66
  * 校验通过后,更新指定字段是否禁用
59
67
  * 参顶部[物料消耗表字段控制]
@@ -164,6 +172,8 @@ export declare class MaterialConsumeTableController {
164
172
  * @return {*}
165
173
  */
166
174
  calcDisabledFields(row: IMaterialConsumeData): (keyof IMaterialConsumeData)[];
175
+ /** 可编辑行:对齐 Excel getNewTdInfo + calcDisabledFields */
176
+ syncEditingRowDisablement(dataManager: DataManager, rowPath: string, row: IMaterialConsumeData): void;
167
177
  /**
168
178
  * 获取是否是 物料查看
169
179
  * @param product_id_
@@ -285,6 +295,14 @@ export declare class MaterialConsumeTableController {
285
295
  * 返回新行在活跃数据中的下标,调用方据此执行 Word 子表行初始化。
286
296
  */
287
297
  addGroup(option: UpdateRowOption, doc: Doc): Promise<number | undefined>;
298
+ /**
299
+ * 组内加一行:当前行下方插入,继承 bom_entry_id_。
300
+ */
301
+ addRowForGroup(option: UpdateRowOption, doc: Doc): number | undefined;
302
+ /**
303
+ * 仅剩一行时清空内容:保留行身份和默认值,并断开 BOM 组。
304
+ */
305
+ clearRow(option: UpdateRowOption, doc: Doc): void;
288
306
  /**
289
307
  * 更新整个数组的所有行的已消耗数量
290
308
  *
@@ -72,5 +72,13 @@ export declare function getReinspectionDate(params: {
72
72
  material_no_?: string;
73
73
  material_no_id_?: string;
74
74
  }): Promise<string | undefined>;
75
+ /** 物料+批次查复检日期;缺任一参数不查;无日期放过;小于当天则 throw */
76
+ export declare function assertReinspectionDate(opts: {
77
+ product_id_?: string;
78
+ material_no_?: string;
79
+ material_no_id_?: string;
80
+ }): Promise<void>;
81
+ /** 主表物料 RDO 引用:`baseId:versionId`。无法拼出则返回 undefined,禁止写裸版本 id。 */
82
+ export declare function resolveProductRdoRef(raw?: unknown, option?: Record<string, unknown> | null): Promise<string | undefined>;
75
83
  /** 查批次锁定记录(最新一条) */
76
84
  export declare function getLotLockedReason(production_identification_id_: string): Promise<string>;
@@ -25,16 +25,31 @@ export declare function validateObjectBomForScan(opts: {
25
25
  belongingObject?: string;
26
26
  productId?: string;
27
27
  }): void;
28
+ type ObjectBomSelectOpts = {
29
+ formInstBom?: FormInstBomResponse | null;
30
+ belongingObject?: string;
31
+ };
28
32
  /**
29
- * 物料消耗对象物料批下拉:未开人为指定时,限制为 BOM 主料 + 已开替代料的替代料
30
- * - 无需过滤时返回 null(无 belongingObject / 无配置 / 人为指定)
33
+ * 物料消耗对象物料批下拉:限制为 BOM 主料 + 已开替代料的替代料
34
+ * - 无需过滤时返回 null(无配置 / 记录模式 / 人为指定)
31
35
  * - 无候选时用占位 id,避免空数组被后端当成不筛选
32
36
  */
33
- export declare function getObjectBomMaterialLotQuery(opts: {
34
- formInstBom?: FormInstBomResponse | null;
35
- belongingObject?: string;
36
- }): {
37
+ export declare function getObjectBomMaterialLotQuery(opts: ObjectBomSelectOpts): {
38
+ 'product_id_.versionIn': string[];
39
+ } | null;
40
+ /**
41
+ * 物料消耗对象物料下拉:限制为 BOM 主料 + 已开替代料的替代料
42
+ * - 无需过滤时返回 null(无配置 / 记录模式 / 人为指定)
43
+ * - 无候选时用占位 id,避免空数组被后端当成不筛选
44
+ */
45
+ export declare function getObjectBomProductQuery(opts: ObjectBomSelectOpts): {
46
+ 'id_.in': string[];
47
+ } | null;
48
+ /** 对象下拉按字段类型取 BOM 过滤;非物料/批次返回 null */
49
+ export declare function getObjectBomDropdownQuery(fieldType: string | undefined, opts: ObjectBomSelectOpts): {
37
50
  'product_id_.versionIn': string[];
51
+ } | {
52
+ 'id_.in': string[];
38
53
  } | null;
39
54
  /**
40
55
  * 表单提交:校验所有物料消耗对象的数量 vs 需求数量
@@ -50,3 +65,4 @@ export declare function validateObjectBomQtyOnSubmit(opts: {
50
65
  field: string;
51
66
  message: string;
52
67
  } | null>;
68
+ export {};
@@ -1,2 +1,3 @@
1
1
  export * from './use-tmpl-bom';
2
2
  export * from './bom-validator';
3
+ export * from './linkage';
@@ -0,0 +1,64 @@
1
+ interface ConsumeObjectDoc {
2
+ isInEditMode?: () => boolean;
3
+ mainModelKey: string;
4
+ fieldModelQuery: {
5
+ getFieldList: (modelKey: string) => Array<{
6
+ key: string;
7
+ type?: string;
8
+ bizType?: string;
9
+ }> | undefined;
10
+ };
11
+ dataManager: {
12
+ get: (path: string) => unknown;
13
+ };
14
+ model?: {
15
+ getWidgetInstances?: () => any[];
16
+ };
17
+ }
18
+ export interface ConsumeObjectSelectUpdatesOpts {
19
+ doc: ConsumeObjectDoc;
20
+ belongingObject?: string;
21
+ fieldType?: string;
22
+ selectedOption?: Record<string, unknown> | null;
23
+ pending?: Record<string, unknown>;
24
+ }
25
+ /**
26
+ * 消耗对象批次下拉:同组物料有值时按该物料版本过滤,替换 BOM versionIn。
27
+ */
28
+ export declare function getConsumeObjectLotProductQuery(opts: {
29
+ doc: ConsumeObjectDoc;
30
+ belongingObject?: string;
31
+ fieldType?: string;
32
+ }): {
33
+ 'product_id_.versionEq': string;
34
+ } | null;
35
+ /**
36
+ * 物料消耗对象下拉联动:
37
+ * - 改/清物料:清空同组批次
38
+ * - 选批次且 option 有物料 id:写入同组物料(RDO `base:version`)
39
+ * - 清批次 / 手输批次:不动物料
40
+ * - 选批次但解析不出 RDO 引用:throw,调用方不得写入批次
41
+ */
42
+ export declare function buildConsumeObjectSelectUpdates(opts: ConsumeObjectSelectUpdatesOpts): Promise<Record<string, unknown>>;
43
+ /** 扫码写入同组物料:路径与下拉一致;解析失败 throw。 */
44
+ export declare function buildConsumeObjectScanProductUpdate(opts: {
45
+ doc: ConsumeObjectDoc;
46
+ belongingObject?: string;
47
+ material?: Record<string, unknown> | null;
48
+ }): Promise<Record<string, unknown>>;
49
+ /**
50
+ * 消耗对象写入前的复检入参:用即将写入的物料+批次。
51
+ * 缺对象、缺物料或批次时返回 null(与消耗表缺参不查一致)。
52
+ * product_id_ 为版本 id,供 versionEq 使用。
53
+ */
54
+ export declare function getConsumeObjectReinspectionParams(opts: {
55
+ doc: ConsumeObjectDoc;
56
+ belongingObject?: string;
57
+ fieldType?: string;
58
+ nextValues?: Record<string, unknown>;
59
+ }): {
60
+ product_id_: string;
61
+ material_no_?: string;
62
+ material_no_id_?: string;
63
+ } | null;
64
+ export {};
package/dist/word.css CHANGED
@@ -9689,7 +9689,7 @@ textarea[data-v-a7d89044]::placeholder {
9689
9689
  /**
9690
9690
  * 字段态配色 —— DOM 控件子集(input / select / overlay)
9691
9691
  */
9692
- .widget-container-action[data-v-d63857b1] {
9692
+ .widget-container-action[data-v-5a0ffda2] {
9693
9693
  position: absolute;
9694
9694
  inset: 0;
9695
9695
  z-index: 999;
@@ -9697,7 +9697,7 @@ textarea[data-v-a7d89044]::placeholder {
9697
9697
  height: 0;
9698
9698
  pointer-events: all;
9699
9699
  }
9700
- .picker-trigger[data-v-d63857b1] {
9700
+ .picker-trigger[data-v-5a0ffda2] {
9701
9701
  display: flex;
9702
9702
  box-sizing: border-box;
9703
9703
  align-items: center;
@@ -9709,19 +9709,19 @@ textarea[data-v-a7d89044]::placeholder {
9709
9709
  outline: none;
9710
9710
  background-color: #fff;
9711
9711
  }
9712
- .picker-trigger.disabled[data-v-d63857b1] {
9712
+ .picker-trigger.disabled[data-v-5a0ffda2] {
9713
9713
  border: 1px solid rgba(13, 13, 13, 0.12);
9714
9714
  cursor: not-allowed;
9715
9715
  }
9716
- .picker-trigger.disabled .gct-icon[data-v-d63857b1] {
9716
+ .picker-trigger.disabled .gct-icon[data-v-5a0ffda2] {
9717
9717
  color: rgba(0, 0, 0, 0.25);
9718
9718
  }
9719
- .picker-trigger.readonly[data-v-d63857b1] {
9719
+ .picker-trigger.readonly[data-v-5a0ffda2] {
9720
9720
  border-color: #d9d9d9;
9721
9721
  background-color: #f5f6f8;
9722
9722
  cursor: default;
9723
9723
  }
9724
- .picker-trigger.readonly .gct-icon[data-v-d63857b1] {
9724
+ .picker-trigger.readonly .gct-icon[data-v-5a0ffda2] {
9725
9725
  color: rgba(0, 0, 0, 0.65);
9726
9726
  }
9727
9727
  .resize-box[data-v-788ab62c] {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gct-paas/word",
3
- "version": "0.1.74-beta.44",
3
+ "version": "0.1.74-beta.45",
4
4
  "description": "GCT 在线 word",
5
5
  "keywords": [
6
6
  "vue",