@gct-paas/word 0.1.50 → 0.1.51

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
@@ -53897,21 +53897,6 @@ const getSubFieldConfig = (paramsConfig) => {
53897
53897
  };
53898
53898
  };
53899
53899
  class MCDataUtil {
53900
- static allFields = [
53901
- "product_id_",
53902
- "material_no_",
53903
- "qty_consumed_",
53904
- "qty_",
53905
- "qty_required_",
53906
- "routing_operation_id_",
53907
- "expiration_date_"
53908
- ];
53909
- static editMCTable(row, data) {
53910
- if (!row._MCTABLE) {
53911
- row._MCTABLE = {};
53912
- }
53913
- merge(row, { _MCTABLE: data });
53914
- }
53915
53900
  /**
53916
53901
  * 数组转对象并付统一的值
53917
53902
  * @static
@@ -53926,14 +53911,8 @@ class MCDataUtil {
53926
53911
  }, keyVal);
53927
53912
  }
53928
53913
  /**
53929
- * 设置禁用字段
53930
- * @static
53931
- * @param opts 参数
53914
+ * 更新字段禁用工具函数
53932
53915
  */
53933
- static setFieldsDisabled(opts) {
53934
- const { row, keys: keys2 = this.allFields, disabled = true } = opts;
53935
- this.editMCTable(row, { fieldDisabled: this.arrToObj(keys2, disabled) });
53936
- }
53937
53916
  static _updateDisablement(option) {
53938
53917
  const { dataManager, rowPath, fields, disabled } = option;
53939
53918
  const config = { newDisabled: disabled };
@@ -53942,7 +53921,8 @@ class MCDataUtil {
53942
53921
  });
53943
53922
  }
53944
53923
  /**
53945
- * 物料消耗表[需求数量、已消耗数量]一直禁用
53924
+ * [需求数量、已消耗数量]一直禁用
53925
+ * 参顶部[物料消耗表字段控制]
53946
53926
  * @param rowPath $.f_sub[n] n 必须为数字
53947
53927
  */
53948
53928
  static disableQtyFields(dataManager, rowPath) {
@@ -53950,21 +53930,22 @@ class MCDataUtil {
53950
53930
  this._updateDisablement({ dataManager, rowPath, fields, disabled: true });
53951
53931
  }
53952
53932
  /**
53953
- * 物料消耗表 物料类型是否是[查看物料]时需要更新[物料批号、数量]字段是否禁用
53933
+ * 物料类型 是否选择[查看物料]时,需要更新指定字段是否禁用
53934
+ * 参顶部[物料消耗表字段控制]
53954
53935
  * @param rowPath $.f_sub[n] n 必须为数字
53955
53936
  */
53956
53937
  static updateViewFieldsDisablement(option) {
53957
- const fields = ["material_no_", "qty_"];
53938
+ const fields = ["material_no_", "qty_", "routing_operation_id_"];
53958
53939
  this._updateDisablement({ ...option, fields });
53959
53940
  }
53960
53941
  /**
53961
- * 物料消耗表 更新固定几个字段是否禁用
53942
+ * 校验通过后,更新指定字段是否禁用
53943
+ * 参顶部[物料消耗表字段控制]
53962
53944
  * @param rowPath $.f_sub[n] n 必须为数字
53963
53945
  */
53964
- static updateFixedFieldsDisablement(option) {
53965
- const { disabledFields = [], ...otherOptions } = option;
53966
- const fields = ["product_id_", "material_no_", "routing_operation_id_", ...disabledFields];
53967
- this._updateDisablement({ ...otherOptions, fields });
53946
+ static updateConfirmableFieldsDisablement(option) {
53947
+ const fields = ["product_id_", "material_no_", "qty_", "routing_operation_id_"];
53948
+ this._updateDisablement({ ...option, fields });
53968
53949
  }
53969
53950
  /**
53970
53951
  * 设置行数据的编辑状态
@@ -53975,7 +53956,7 @@ class MCDataUtil {
53975
53956
  const rows = dataManager.getRawData()[subFieldKey] ?? [];
53976
53957
  rows[rowIndex] = row;
53977
53958
  dataManager.set(subFieldKey, rows);
53978
- MCDataUtil.updateFixedFieldsDisablement({
53959
+ MCDataUtil.updateConfirmableFieldsDisablement({
53979
53960
  dataManager,
53980
53961
  rowPath: `$.${subFieldKey}[${rowIndex}]`,
53981
53962
  disabled: isConfirmed
@@ -54409,6 +54390,9 @@ class MaterialConsumeTableController {
54409
54390
  }
54410
54391
  return value;
54411
54392
  }
54393
+ /**
54394
+ * 处理[物料消耗表]下拉字段变更
54395
+ */
54412
54396
  handleSelectChange({
54413
54397
  changedData,
54414
54398
  selectedOption,
@@ -54541,8 +54525,8 @@ class FormTmplBomController {
54541
54525
  /**
54542
54526
  * 根据字段key获取子表控制器
54543
54527
  */
54544
- findTableControllerByField(subFieldKey) {
54545
- return this.tableControllers[subFieldKey];
54528
+ findTableControllerByField(tableKey) {
54529
+ return this.tableControllers[tableKey];
54546
54530
  }
54547
54531
  // 方法废弃,word 里改在初始化时记录到 paramsConfig
54548
54532
  /**
@@ -103577,19 +103561,26 @@ async function initializeDocumentEngine(props, payload, result) {
103577
103561
  MCDataUtil.disableQtyFields(doc.dataManager, `${table_key_}[${index2}]`);
103578
103562
  });
103579
103563
  rows.forEach((row, rowIndex) => {
103564
+ const rowPath = `${table_key_}[${rowIndex}]`;
103565
+ const tableController = tmplBomC?.findTableControllerByField(table_key_);
103566
+ if (row.product_id_) {
103567
+ const versionId = row.product_id_.split(":").pop();
103568
+ if (versionId) {
103569
+ subConfig[`${rowPath}.material_no_`] = {
103570
+ "product_id_.versionIn": [versionId]
103571
+ };
103572
+ }
103573
+ }
103580
103574
  MCDataUtil.updateViewFieldsDisablement({
103581
103575
  dataManager: doc.dataManager,
103582
- rowPath: `$.${subFieldKey}[${rowIndex}]`,
103583
- disabled: Boolean(
103584
- tmplBomC?.findTableControllerByField(table_key_)?.getMaterialTypeIsView(row.product_id_)
103585
- )
103576
+ rowPath,
103577
+ disabled: !!tableController?.getMaterialTypeIsView(row.product_id_)
103586
103578
  });
103587
103579
  if (row.is_confirmed_) {
103588
- MCDataUtil.updateFixedFieldsDisablement({
103580
+ MCDataUtil.updateConfirmableFieldsDisablement({
103589
103581
  dataManager: doc.dataManager,
103590
- rowPath: `$.${subFieldKey}[${rowIndex}]`,
103591
- disabled: true,
103592
- disabledFields: ["qty_", "expiration_date_"]
103582
+ rowPath,
103583
+ disabled: true
103593
103584
  });
103594
103585
  }
103595
103586
  });
@@ -18,9 +18,14 @@ export interface UpdateRowOption {
18
18
  dataManager: DataManager;
19
19
  subFieldKey: string;
20
20
  }
21
+ /**
22
+ * 物料消耗表字段控制 v2026.6.15
23
+ * - [需求数量、已消耗数量] 始终只读
24
+ * - [有效期、唯一标识、自定义字段] 始终可填(不做控制)
25
+ * - 选择的物料类型是[查看物料]时 [批次、上料数量、工序] 只读
26
+ * - 单行校验通过后(包括暂存后再次编辑)[物料、批次、上料数量、工序] 只读
27
+ */
21
28
  export declare class MCDataUtil {
22
- static allFields: Array<keyof IMaterialConsumeData>;
23
- static editMCTable(row: IMaterialConsumeData, data: IMaterialConsumeData['_MCTABLE']): void;
24
29
  /**
25
30
  * 数组转对象并付统一的值
26
31
  * @static
@@ -30,26 +35,18 @@ export declare class MCDataUtil {
30
35
  */
31
36
  static arrToObj(arr: string[], keyVal?: any): any;
32
37
  /**
33
- * 设置禁用字段
34
- * @static
35
- * @param opts 参数
36
- */
37
- static setFieldsDisabled(opts: {
38
- /** 数据 */
39
- row: IMaterialConsumeData;
40
- /** 属性key集合(不给则默认全部) */
41
- keys?: Array<keyof IMaterialConsumeData>;
42
- /** 设置的值(不给则true) */
43
- disabled?: boolean;
44
- }): void;
38
+ * 更新字段禁用工具函数
39
+ */
45
40
  private static _updateDisablement;
46
41
  /**
47
- * 物料消耗表[需求数量、已消耗数量]一直禁用
42
+ * [需求数量、已消耗数量]一直禁用
43
+ * 参顶部[物料消耗表字段控制]
48
44
  * @param rowPath $.f_sub[n] n 必须为数字
49
45
  */
50
46
  static disableQtyFields(dataManager: DataManager, rowPath: string): void;
51
47
  /**
52
- * 物料消耗表 物料类型是否是[查看物料]时需要更新[物料批号、数量]字段是否禁用
48
+ * 物料类型 是否选择[查看物料]时,需要更新指定字段是否禁用
49
+ * 参顶部[物料消耗表字段控制]
53
50
  * @param rowPath $.f_sub[n] n 必须为数字
54
51
  */
55
52
  static updateViewFieldsDisablement(option: {
@@ -58,14 +55,14 @@ export declare class MCDataUtil {
58
55
  disabled: boolean;
59
56
  }): void;
60
57
  /**
61
- * 物料消耗表 更新固定几个字段是否禁用
58
+ * 校验通过后,更新指定字段是否禁用
59
+ * 参顶部[物料消耗表字段控制]
62
60
  * @param rowPath $.f_sub[n] n 必须为数字
63
61
  */
64
- static updateFixedFieldsDisablement(option: {
62
+ static updateConfirmableFieldsDisablement(option: {
65
63
  dataManager: DataManager;
66
64
  rowPath: string;
67
65
  disabled: boolean;
68
- disabledFields?: string[];
69
66
  }): void;
70
67
  /**
71
68
  * 设置行数据的编辑状态
@@ -233,6 +230,9 @@ export declare class MaterialConsumeTableController {
233
230
  */
234
231
  setDefaultValue(row: IMaterialConsumeData): void;
235
232
  getDefaultValue(row: IMaterialConsumeData): any;
233
+ /**
234
+ * 处理[物料消耗表]下拉字段变更
235
+ */
236
236
  handleSelectChange({ changedData, selectedOption, doc, parsed, dataIndex, }: {
237
237
  changedData: any;
238
238
  selectedOption: any;
@@ -62,7 +62,7 @@ export declare class FormTmplBomController {
62
62
  /**
63
63
  * 根据字段key获取子表控制器
64
64
  */
65
- findTableControllerByField(subFieldKey: string): MaterialConsumeTableController | undefined;
65
+ findTableControllerByField(tableKey: string): MaterialConsumeTableController | undefined;
66
66
  /**
67
67
  * 处理字段组件
68
68
  * - 补充物料字段的额外查询条件
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gct-paas/word",
3
- "version": "0.1.50",
3
+ "version": "0.1.51",
4
4
  "description": "GCT 在线 word",
5
5
  "keywords": [
6
6
  "vue",