@gct-paas/word 0.1.74-beta.42 → 0.1.74-beta.43

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.
@@ -24,12 +24,14 @@ export declare function resolveScanParsedValue<T extends Record<string, unknown>
24
24
  export declare function resolveScanFillData(input: ScanModalInput): Record<string, unknown>;
25
25
  /** 取扫码数量调整方向,默认 add */
26
26
  export declare function resolveScanAdjustType(input: ScanModalInput): ScanAdjustType;
27
+ /** 出入库空行:物料、批次都没值 */
28
+ export declare function isProductBatchEmptyRow(row: Record<string, unknown>): boolean;
27
29
  /**
28
30
  * 扫码入行:优先回填首个空壳占位行,否则在活跃区末尾新增。
29
31
  * 避免版面默认空行时 insertAt 导致「第一行空、第二行有数据」。
30
32
  * 回填时空壳行按字段合并,保留 front_row_key_ / group_ 等元数据。
31
33
  */
32
- export declare function appendOrFillScanRow(doc: Doc, subFieldKey: string, row: Record<string, unknown>): number;
34
+ export declare function appendOrFillScanRow(doc: Doc, subFieldKey: string, row: Record<string, unknown>, isEmptyRow?: (item: Record<string, unknown>) => boolean): number;
33
35
  /** 将 widget 上的条码解析规则 id 字符串转为配置对象 */
34
36
  export declare function toParseRuleConfig(value?: string): ParseRuleProps | undefined;
35
37
  /**
package/dist/index.es.js CHANGED
@@ -1,4 +1,4 @@
1
- /*! @gct-paas/word v0.1.74-beta.42 */
1
+ /*! @gct-paas/word v0.1.74-beta.43 */
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";
@@ -102632,15 +102632,24 @@ function resolveScanFillData(input) {
102632
102632
  function resolveScanAdjustType(input) {
102633
102633
  return input.type === "minus" ? "minus" : "add";
102634
102634
  }
102635
+ function isEmptyScanValue(value) {
102636
+ if (value == null || value === "") return true;
102637
+ if (typeof value === "object" && !Array.isArray(value) && Object.keys(value).length === 0) return true;
102638
+ return false;
102639
+ }
102640
+ /** 出入库空行:物料、批次都没值 */
102641
+ function isProductBatchEmptyRow(row) {
102642
+ return isEmptyScanValue(row.product_id_) && isEmptyScanValue(row.material_no_) && isEmptyScanValue(row.material_no__id_);
102643
+ }
102635
102644
  /**
102636
102645
  * 扫码入行:优先回填首个空壳占位行,否则在活跃区末尾新增。
102637
102646
  * 避免版面默认空行时 insertAt 导致「第一行空、第二行有数据」。
102638
102647
  * 回填时空壳行按字段合并,保留 front_row_key_ / group_ 等元数据。
102639
102648
  */
102640
- function appendOrFillScanRow(doc, subFieldKey, row) {
102649
+ function appendOrFillScanRow(doc, subFieldKey, row, isEmptyRow = (item) => !hasSubtableBusinessData(item)) {
102641
102650
  const arrayPath = `$.${subFieldKey}`;
102642
102651
  const rows = doc.dataManager.getRawData()[subFieldKey] ?? [];
102643
- const emptyIndex = rows.findIndex((r) => r && !r.deleted_ && !hasSubtableBusinessData(r));
102652
+ const emptyIndex = rows.findIndex((r) => r && !r.deleted_ && isEmptyRow(r));
102644
102653
  if (emptyIndex >= 0) {
102645
102654
  const existing = rows[emptyIndex];
102646
102655
  const frontKey = ensureFrontRowKey(existing);
@@ -102869,7 +102878,7 @@ var init_scan$5 = __esmMin((() => {
102869
102878
  }
102870
102879
  const selected = await pickProductionIdentificationScanRecord(records);
102871
102880
  if (!selected) return;
102872
- const rowIndex = appendOrFillScanRow(doc, subFieldKey, buildWarehouseInScanRow(selected, parsed, resolveScanFillData(input)));
102881
+ const rowIndex = appendOrFillScanRow(doc, subFieldKey, buildWarehouseInScanRow(selected, parsed, resolveScanFillData(input)), isProductBatchEmptyRow);
102873
102882
  await doc.dataManager.whenEmitSettled();
102874
102883
  await hydrateSubtableRowLabels(doc, subFieldKey, [rowIndex]);
102875
102884
  };
@@ -103424,7 +103433,7 @@ var init_scan$4 = __esmMin((() => {
103424
103433
  await doc.dataManager.whenEmitSettled();
103425
103434
  return;
103426
103435
  }
103427
- const rowIndex = appendOrFillScanRow(doc, subFieldKey, buildWarehouseOutScanRow(selected, parsed, fillData, scanQty));
103436
+ const rowIndex = appendOrFillScanRow(doc, subFieldKey, buildWarehouseOutScanRow(selected, parsed, fillData, scanQty), isProductBatchEmptyRow);
103428
103437
  await doc.dataManager.whenEmitSettled();
103429
103438
  await hydrateSubtableRowLabels(doc, subFieldKey, [rowIndex]);
103430
103439
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gct-paas/word",
3
- "version": "0.1.74-beta.42",
3
+ "version": "0.1.74-beta.43",
4
4
  "description": "GCT 在线 word",
5
5
  "keywords": [
6
6
  "vue",