@gct-paas/word 0.1.63-beta.9 → 0.1.64

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
@@ -108232,7 +108232,6 @@ class BomEntryValidator {
108232
108232
  if (idSet.size > 1) {
108233
108233
  throw new Error(
108234
108234
  "整批替代不允许混用主料或者替代料"
108235
- /*$t('sys.edhr.mcTable.notAllowMixSubstituteMaterial')*/
108236
108235
  );
108237
108236
  }
108238
108237
  }
@@ -108279,7 +108278,6 @@ class BomEntryValidator {
108279
108278
  if (["eq", "lte"].includes(this.bomEntry.qty_validation_rule_) && consumeNum > this.remainingNum) {
108280
108279
  throw new Error(
108281
108280
  "当前物料上料总消耗不能大于需求数量"
108282
- /*$t('sys.edhr.mcTable.overMaterialConsumeError')*/
108283
108281
  );
108284
108282
  }
108285
108283
  if (this.bomEntry.qty_validation_rule_ === "bounds") {
@@ -109016,7 +109014,7 @@ class MaterialConsumeTableController {
109016
109014
  if (data.expiration) {
109017
109015
  row.expiration_date_ = toDateOnly(data.expiration);
109018
109016
  }
109019
- this.setDefaultValue(row);
109017
+ this.setDefaultValue(row, option.doc);
109020
109018
  try {
109021
109019
  const newArr = this.bomEntriesValidator.mergeRowInArr(row, this.actualTableData);
109022
109020
  await this.bomEntriesValidator.validateScanCanInsert(newArr);
@@ -109258,7 +109256,7 @@ class MaterialConsumeTableController {
109258
109256
  * 设置默认值,如工序,需求数量/已消耗数量
109259
109257
  * @param row
109260
109258
  */
109261
- setDefaultValue(row) {
109259
+ setDefaultValue(row, doc) {
109262
109260
  if (!row.routing_operation_id_) {
109263
109261
  row.routing_operation_id_ = this.tmplBomController.operationId;
109264
109262
  }
@@ -109270,6 +109268,7 @@ class MaterialConsumeTableController {
109270
109268
  row.bom_entry_id_ = util.bomEntry.id_;
109271
109269
  }
109272
109270
  }
109271
+ this.updateRowConsumed(doc);
109273
109272
  }
109274
109273
  getDefaultValue(row) {
109275
109274
  const value = {};
@@ -109489,53 +109488,57 @@ const syncMaterialConsumeTableBomInfo = async (templateId, docModel) => {
109489
109488
  };
109490
109489
  const initMaterialConsumeTableConfig = (doc, subConfig, tmplBomC) => {
109491
109490
  if (!tmplBomC?.formInstBom?.formTmplBomList) return;
109492
- const useBomMode = tmplBomC.defaultMCPattern === MaterialConsumptionPatternEnum.BOM;
109493
- tmplBomC.formInstBom.formTmplBomList.forEach(({
109494
- personal_bom_enabled_,
109495
- entries_,
109496
- table_key_
109497
- }) => {
109498
- if (useBomMode) {
109499
- const entries = personal_bom_enabled_ ? entries_ : tmplBomC.bomEntries;
109500
- const includedIds = [];
109501
- (entries || []).forEach((e) => {
109502
- includedIds.push(e.product_id_.split(":").pop());
109503
- (e.substitute_material_entries_ || []).forEach((_e) => {
109504
- includedIds.push(_e.product_id_.split(":").pop());
109505
- });
109506
- });
109507
- subConfig[`${table_key_}[n].product_id_`] = { "id_.in": includedIds };
109508
- }
109509
- const subFieldKey = table_key_.replace("$.", "");
109510
- const rows = doc.dataManager.getRawData()[subFieldKey] || [];
109511
- const rowCount = rows.length;
109512
- repeat(rowCount || 1, (index2) => {
109513
- MCDataUtil.disableQtyFields(doc.dataManager, `${table_key_}[${index2}]`);
109514
- });
109515
- rows.forEach((row, rowIndex) => {
109516
- const rowPath = `${table_key_}[${rowIndex}]`;
109491
+ tmplBomC.formInstBom.formTmplBomList.forEach(
109492
+ ({ personal_bom_enabled_, entries_, table_key_ }) => {
109517
109493
  const tableController = tmplBomC?.findTableControllerByField(table_key_);
109518
- if (row.product_id_) {
109519
- const versionId = row.product_id_.split(":").pop();
109520
- if (versionId) {
109521
- subConfig[`${rowPath}.material_no_`] = {
109522
- "product_id_.versionIn": [versionId]
109523
- };
109524
- }
109494
+ const useBomMode = tableController?.mcPattern === MaterialConsumptionPatternEnum.BOM;
109495
+ if (useBomMode) {
109496
+ const entries = personal_bom_enabled_ ? entries_ : tmplBomC.bomEntries;
109497
+ const includedIds = [];
109498
+ (entries || []).forEach((e) => {
109499
+ includedIds.push(e.product_id_.split(":").pop());
109500
+ (e.substitute_material_entries_ || []).forEach((_e) => {
109501
+ includedIds.push(_e.product_id_.split(":").pop());
109502
+ });
109503
+ });
109504
+ subConfig[`${table_key_}[n].product_id_`] = { "id_.in": includedIds };
109525
109505
  }
109526
- MCDataUtil.updateViewFieldsDisablement({
109527
- dataManager: doc.dataManager,
109528
- rowPath,
109529
- disabled: !!tableController?.getMaterialTypeIsView(row.product_id_)
109506
+ const subFieldKey = table_key_.replace("$.", "");
109507
+ const rows = doc.dataManager.getRawData()[subFieldKey] || [];
109508
+ const rowCount = rows.length;
109509
+ repeat(rowCount || 1, (index2) => {
109510
+ MCDataUtil.disableQtyFields(doc.dataManager, `${table_key_}[${index2}]`);
109530
109511
  });
109531
- if (row.is_confirmed_) {
109532
- MCDataUtil.updateConfirmableFieldsDisablement({
109512
+ rows.forEach((row, rowIndex) => {
109513
+ const rowPath = `${table_key_}[${rowIndex}]`;
109514
+ if (row.product_id_) {
109515
+ const versionId = row.product_id_.split(":").pop();
109516
+ if (versionId) {
109517
+ subConfig[`${rowPath}.material_no_`] = {
109518
+ "product_id_.versionIn": [versionId]
109519
+ };
109520
+ }
109521
+ }
109522
+ MCDataUtil.updateViewFieldsDisablement({
109533
109523
  dataManager: doc.dataManager,
109534
109524
  rowPath,
109535
- disabled: true
109525
+ disabled: !!tableController?.getMaterialTypeIsView(row.product_id_)
109536
109526
  });
109537
- }
109538
- });
109527
+ if (row.is_confirmed_) {
109528
+ MCDataUtil.updateConfirmableFieldsDisablement({
109529
+ dataManager: doc.dataManager,
109530
+ rowPath,
109531
+ disabled: true
109532
+ });
109533
+ }
109534
+ });
109535
+ }
109536
+ );
109537
+ };
109538
+ const handleAllMCTablesMounted = (doc, tmplBomC) => {
109539
+ tmplBomC.formInstBom?.formTmplBomList?.forEach(({ table_key_ }) => {
109540
+ const tableController = tmplBomC.findTableControllerByField(table_key_);
109541
+ tableController?.updateRowConsumed(doc);
109539
109542
  });
109540
109543
  };
109541
109544
  class DocRequestStrategy {
@@ -110829,10 +110832,14 @@ function useDocumentFactory(props, payload) {
110829
110832
  try {
110830
110833
  const response = await runFetchDocument(newRequestId);
110831
110834
  if (!response) return;
110832
- if (response.tmplBomC) {
110833
- tmplBomCRef.value = response.tmplBomC;
110834
- }
110835
110835
  await mountDocument(response);
110836
+ const { tmplBomC } = response;
110837
+ if (tmplBomC) {
110838
+ tmplBomCRef.value = tmplBomC;
110839
+ if (docIns.value) {
110840
+ handleAllMCTablesMounted(docIns.value, tmplBomC);
110841
+ }
110842
+ }
110836
110843
  } catch (err) {
110837
110844
  console.error(err);
110838
110845
  }
@@ -129165,7 +129172,7 @@ const _sfc_main$1G = /* @__PURE__ */ defineComponent({
129165
129172
  };
129166
129173
  }
129167
129174
  });
129168
- const MaterialConsumeTablePanel = /* @__PURE__ */ _export_sfc(_sfc_main$1G, [["__scopeId", "data-v-0b5a3b4b"]]);
129175
+ const MaterialConsumeTablePanel = /* @__PURE__ */ _export_sfc(_sfc_main$1G, [["__scopeId", "data-v-0e3048f6"]]);
129169
129176
  const schema$a = createTablePanelSchema("material-consume-table.basic", MaterialConsumeTablePanel);
129170
129177
  const schema$9 = createTablePanelSchema("fixed-table.basic", BoundedSubTablePanel);
129171
129178
  const _sfc_main$1F = /* @__PURE__ */ defineComponent({
@@ -237,7 +237,7 @@ export declare class MaterialConsumeTableController {
237
237
  * 设置默认值,如工序,需求数量/已消耗数量
238
238
  * @param row
239
239
  */
240
- setDefaultValue(row: IMaterialConsumeData): void;
240
+ setDefaultValue(row: IMaterialConsumeData, doc: Doc): void;
241
241
  getDefaultValue(row: IMaterialConsumeData): any;
242
242
  /**
243
243
  * 处理[物料消耗表]下拉字段变更
@@ -2,10 +2,15 @@ import { Doc } from '../../../../../core';
2
2
  import { DocModel } from '../../../../../core/model';
3
3
  import { FormTmplBomController } from './tmpl-bom-controller';
4
4
  /**
5
- * 同步[物料消耗表] formTmplBomList 信息
5
+ * 同步[物料消耗表] formTmplBomList 信息到 widgetProps 上
6
+ * 因为 formTmplBomList 有独立存取接口
6
7
  */
7
8
  export declare const syncMaterialConsumeTableBomInfo: (templateId: string, docModel: DocModel) => Promise<void>;
8
9
  /**
9
10
  * 处理表单实例上的[物料消耗表]相关配置
10
11
  */
11
12
  export declare const initMaterialConsumeTableConfig: (doc: Doc, subConfig: Record<string, any>, tmplBomC?: FormTmplBomController) => void;
13
+ /**
14
+ * 文档加载完毕后,处理所有[物料消耗表]已消耗数量累加计算
15
+ */
16
+ export declare const handleAllMCTablesMounted: (doc: Doc, tmplBomC: FormTmplBomController) => void;
package/dist/word.css CHANGED
@@ -10774,22 +10774,22 @@ svg.portrait-icon[data-v-8bdb451e] {
10774
10774
  .bom-entry-item .iconfont.btn-item[data-v-cabb46fe] {
10775
10775
  margin-right: 8px;
10776
10776
  }
10777
- .panel-material-consume-table[data-v-0b5a3b4b] {
10777
+ .panel-material-consume-table[data-v-0e3048f6] {
10778
10778
  position: relative;
10779
10779
  }
10780
- .panel-material-consume-table .container[data-v-0b5a3b4b] {
10780
+ .panel-material-consume-table .container[data-v-0e3048f6] {
10781
10781
  padding: 16px;
10782
10782
  }
10783
- .panel-material-consume-table .form-custom-label[data-v-0b5a3b4b] {
10783
+ .panel-material-consume-table .form-custom-label[data-v-0e3048f6] {
10784
10784
  display: inline-flex;
10785
10785
  align-items: center;
10786
10786
  gap: 4px;
10787
10787
  }
10788
- .panel-material-consume-table .form-custom-label .icon[data-v-0b5a3b4b] {
10788
+ .panel-material-consume-table .form-custom-label .icon[data-v-0e3048f6] {
10789
10789
  cursor: pointer;
10790
10790
  vertical-align: text-top;
10791
10791
  }
10792
- .panel-material-consume-table .content[data-v-0b5a3b4b] {
10792
+ .panel-material-consume-table .content[data-v-0e3048f6] {
10793
10793
  display: flex;
10794
10794
  align-items: center;
10795
10795
  justify-content: flex-end;
@@ -10797,7 +10797,7 @@ svg.portrait-icon[data-v-8bdb451e] {
10797
10797
  line-height: 22px;
10798
10798
  width: 100%;
10799
10799
  }
10800
- .panel-material-consume-table .entries-container[data-v-0b5a3b4b] {
10800
+ .panel-material-consume-table .entries-container[data-v-0e3048f6] {
10801
10801
  padding: 6px 0;
10802
10802
  }
10803
10803
  .add-ds-btn[data-v-e5dff26f] {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gct-paas/word",
3
- "version": "0.1.63-beta.9",
3
+ "version": "0.1.64",
4
4
  "description": "GCT 在线 word",
5
5
  "keywords": [
6
6
  "vue",