@gct-paas/word 0.1.73-patch.3 → 0.1.73-patch.4
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.73-patch.
|
|
1
|
+
/*! @gct-paas/word v0.1.73-patch.4 */
|
|
2
2
|
import { Fragment, Suspense, Teleport, Transition, TransitionGroup, cloneVNode, computed, createApp, createBlock, createCommentVNode, createElementBlock, createElementVNode, createSlots, createStaticVNode, createTextVNode, createVNode, defineAsyncComponent, defineComponent, 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, toRaw, toRef, toValue, unref, useCssVars, useModel, useSlots, vModelText, vShow, watch, watchEffect, withCtx, withDirectives, withKeys, withModifiers } from "vue";
|
|
3
3
|
import FloatingVue, { PopperWrapper } from "floating-vue";
|
|
4
4
|
import VueKonva from "vue-konva";
|
|
@@ -123339,20 +123339,19 @@ function findLastIndex(array, predicate) {
|
|
|
123339
123339
|
var BomEntryValidator, BomEntriesValidator;
|
|
123340
123340
|
var init_bom_validator = __esmMin((() => {
|
|
123341
123341
|
init_service$5();
|
|
123342
|
-
init_types$2();
|
|
123343
123342
|
init_defineProperty();
|
|
123344
123343
|
BomEntryValidator = class {
|
|
123345
123344
|
/** 剩于可消耗数量 */
|
|
123346
123345
|
get remainingNum() {
|
|
123347
123346
|
return this.total - this.hasConsumed;
|
|
123348
123347
|
}
|
|
123349
|
-
constructor(bomEntry, enableSequenceLoading, materialNoNum, historyData, mainMaterialNo,
|
|
123348
|
+
constructor(bomEntry, enableSequenceLoading, materialNoNum, historyData, mainMaterialNo, noBomMode) {
|
|
123350
123349
|
_defineProperty(this, "bomEntry", void 0);
|
|
123351
123350
|
_defineProperty(this, "enableSequenceLoading", void 0);
|
|
123352
123351
|
_defineProperty(this, "materialNoNum", void 0);
|
|
123353
123352
|
_defineProperty(this, "historyData", void 0);
|
|
123354
123353
|
_defineProperty(this, "mainMaterialNo", void 0);
|
|
123355
|
-
_defineProperty(this, "
|
|
123354
|
+
_defineProperty(this, "noBomMode", void 0);
|
|
123356
123355
|
_defineProperty(
|
|
123357
123356
|
this,
|
|
123358
123357
|
/** 该明细使用到的产品的id集合 */
|
|
@@ -123382,7 +123381,7 @@ var init_bom_validator = __esmMin((() => {
|
|
|
123382
123381
|
this.materialNoNum = materialNoNum;
|
|
123383
123382
|
this.historyData = historyData;
|
|
123384
123383
|
this.mainMaterialNo = mainMaterialNo;
|
|
123385
|
-
this.
|
|
123384
|
+
this.noBomMode = noBomMode;
|
|
123386
123385
|
this.productIds.push(this.bomEntry.product_id_);
|
|
123387
123386
|
this.productCodes[this.bomEntry.product_id_] = this.bomEntry.product_code_;
|
|
123388
123387
|
if (this.bomEntry.substitute_material_enabled_ && this.bomEntry.substitute_material_entries_) this.bomEntry.substitute_material_entries_.forEach((i) => {
|
|
@@ -123525,21 +123524,21 @@ var init_bom_validator = __esmMin((() => {
|
|
|
123525
123524
|
}
|
|
123526
123525
|
};
|
|
123527
123526
|
BomEntriesValidator = class {
|
|
123528
|
-
constructor(entries, enableSequenceLoading, materialNoNum, historyData, mainMaterialNo,
|
|
123527
|
+
constructor(entries, enableSequenceLoading, materialNoNum, historyData, mainMaterialNo, noBomMode) {
|
|
123529
123528
|
_defineProperty(this, "entries", void 0);
|
|
123530
123529
|
_defineProperty(this, "enableSequenceLoading", void 0);
|
|
123531
123530
|
_defineProperty(this, "materialNoNum", void 0);
|
|
123532
123531
|
_defineProperty(this, "historyData", void 0);
|
|
123533
123532
|
_defineProperty(this, "mainMaterialNo", void 0);
|
|
123534
|
-
_defineProperty(this, "
|
|
123533
|
+
_defineProperty(this, "noBomMode", void 0);
|
|
123535
123534
|
_defineProperty(this, "bomEntryValidators", void 0);
|
|
123536
123535
|
this.entries = entries;
|
|
123537
123536
|
this.enableSequenceLoading = enableSequenceLoading;
|
|
123538
123537
|
this.materialNoNum = materialNoNum;
|
|
123539
123538
|
this.historyData = historyData;
|
|
123540
123539
|
this.mainMaterialNo = mainMaterialNo;
|
|
123541
|
-
this.
|
|
123542
|
-
this.bomEntryValidators = entries.map((i) => new BomEntryValidator(i, enableSequenceLoading, materialNoNum, historyData, mainMaterialNo,
|
|
123540
|
+
this.noBomMode = noBomMode;
|
|
123541
|
+
this.bomEntryValidators = entries.map((i) => new BomEntryValidator(i, enableSequenceLoading, materialNoNum, historyData, mainMaterialNo, noBomMode));
|
|
123543
123542
|
}
|
|
123544
123543
|
/**
|
|
123545
123544
|
* 翻译物料的code
|
|
@@ -123577,7 +123576,7 @@ var init_bom_validator = __esmMin((() => {
|
|
|
123577
123576
|
* @param row 单行的数据
|
|
123578
123577
|
*/
|
|
123579
123578
|
validateInBom(row) {
|
|
123580
|
-
if (this.
|
|
123579
|
+
if (this.noBomMode) return;
|
|
123581
123580
|
if (!row.product_id_) throw new Error("物料不能为空");
|
|
123582
123581
|
if (!this.findUtilByProductId(row.product_id_)) {
|
|
123583
123582
|
const name = row.product_id__lb_ || "";
|
|
@@ -123650,7 +123649,7 @@ var init_bom_validator = __esmMin((() => {
|
|
|
123650
123649
|
async validateScanCanInsert(arr) {
|
|
123651
123650
|
const editRow = arr.find((i) => !i.is_confirmed_);
|
|
123652
123651
|
if (!editRow) throw new Error("没有正在编辑的行");
|
|
123653
|
-
if (this.
|
|
123652
|
+
if (this.noBomMode) return;
|
|
123654
123653
|
this.validateInBom(editRow);
|
|
123655
123654
|
await this.validateSequenceLoading(editRow, arr);
|
|
123656
123655
|
this.validateSubstitute(arr);
|
|
@@ -123931,6 +123930,9 @@ var init_material_consume_table_controller = __esmMin((() => {
|
|
|
123931
123930
|
get mcPattern() {
|
|
123932
123931
|
return this.tmplBom.material_consumption_pattern_ ?? this.tmplBomController.defaultMCPattern;
|
|
123933
123932
|
}
|
|
123933
|
+
get isRecordPattern() {
|
|
123934
|
+
return this.mcPattern === MaterialConsumptionPatternEnum.RECORD && !this.tmplBom.personal_bom_enabled_;
|
|
123935
|
+
}
|
|
123934
123936
|
/**
|
|
123935
123937
|
* 解析规则配置
|
|
123936
123938
|
*/
|
|
@@ -124018,7 +124020,7 @@ var init_material_consume_table_controller = __esmMin((() => {
|
|
|
124018
124020
|
this.tmplBom = tmplBom;
|
|
124019
124021
|
this.initScanRule(this.tmplBom.barcode_parsing_rules_id_);
|
|
124020
124022
|
markRaw(this);
|
|
124021
|
-
this.bomEntriesValidator = new BomEntriesValidator(this.actualBomEntries, this.enableSequenceLoading, this.materialNoNum, this.tmplBomController.historyData, this.tmplBomController.materialNo, this.
|
|
124023
|
+
this.bomEntriesValidator = new BomEntriesValidator(this.actualBomEntries, this.enableSequenceLoading, this.materialNoNum, this.tmplBomController.historyData, this.tmplBomController.materialNo, this.isRecordPattern);
|
|
124022
124024
|
}
|
|
124023
124025
|
/** 错误信息 */
|
|
124024
124026
|
error(message) {
|
|
@@ -124108,7 +124110,6 @@ var init_material_consume_table_controller = __esmMin((() => {
|
|
|
124108
124110
|
async parseScanStr(str, option) {
|
|
124109
124111
|
var _this$scanRuleProps;
|
|
124110
124112
|
if (!this.isFirstBlankRow() && this.hasEditingRow()) return;
|
|
124111
|
-
const isRecordPattern = this.mcPattern === MaterialConsumptionPatternEnum.RECORD;
|
|
124112
124113
|
const data = getParseRuleValue$1(str, this.scanRules);
|
|
124113
124114
|
console.log("parseScanStr", data);
|
|
124114
124115
|
const arr = await materialCheck({
|
|
@@ -124116,15 +124117,15 @@ var init_material_consume_table_controller = __esmMin((() => {
|
|
|
124116
124117
|
production_identification_name_: data.lot,
|
|
124117
124118
|
qty_: data.qty,
|
|
124118
124119
|
validate_: data.expiration,
|
|
124119
|
-
bom_entries_: isRecordPattern ? null : this.actualBomEntries,
|
|
124120
|
+
bom_entries_: this.isRecordPattern ? null : this.actualBomEntries,
|
|
124120
124121
|
operation_id_: this.tmplBomController.operationId
|
|
124121
|
-
}) || (isRecordPattern ? [{ productionIdentificationName: data.lot }] : null);
|
|
124122
|
+
}) || (this.isRecordPattern ? [{ productionIdentificationName: data.lot }] : null);
|
|
124122
124123
|
if (!arr) {
|
|
124123
124124
|
this.error("扫描的物料不存在或不在bom中");
|
|
124124
124125
|
return;
|
|
124125
124126
|
}
|
|
124126
124127
|
let materialData = arr[0];
|
|
124127
|
-
if (arr.length > 1 && !isRecordPattern) {
|
|
124128
|
+
if (arr.length > 1 && !this.isRecordPattern) {
|
|
124128
124129
|
const ids = this.actualTableData.map((i) => i.product_id_);
|
|
124129
124130
|
const find = arr.find((j) => ids.includes(j.materialId));
|
|
124130
124131
|
if (!find) throw new Error("表格数据里没有匹配的物料,请选择该物料后再扫码");
|
|
@@ -124136,7 +124137,7 @@ var init_material_consume_table_controller = __esmMin((() => {
|
|
|
124136
124137
|
qty_: data.qty,
|
|
124137
124138
|
is_confirmed_: false
|
|
124138
124139
|
};
|
|
124139
|
-
if (isRecordPattern && !row.product_id_) row._scanFallback = true;
|
|
124140
|
+
if (this.isRecordPattern && !row.product_id_) row._scanFallback = true;
|
|
124140
124141
|
if ((_this$scanRuleProps = this.scanRuleProps) === null || _this$scanRuleProps === void 0 || (_this$scanRuleProps = _this$scanRuleProps.fillMapArr) === null || _this$scanRuleProps === void 0 ? void 0 : _this$scanRuleProps.length) {
|
|
124141
124142
|
const fillData = calcFillData(data, this.scanRuleProps.fillMapArr);
|
|
124142
124143
|
console.log("fillData", fillData);
|
|
@@ -124221,7 +124222,7 @@ var init_material_consume_table_controller = __esmMin((() => {
|
|
|
124221
124222
|
async confirm(option, subModelKey, doc) {
|
|
124222
124223
|
try {
|
|
124223
124224
|
if (doc) await this.applyUnitConversionBeforeConfirm(option, doc);
|
|
124224
|
-
if (this.
|
|
124225
|
+
if (this.isRecordPattern) {
|
|
124225
124226
|
const { dataManager, rowIndex, subFieldKey } = option;
|
|
124226
124227
|
const row = (dataManager.getRawData()[subFieldKey] ?? [])[rowIndex];
|
|
124227
124228
|
if (!row) throw new Error("请填写数据");
|
|
@@ -124245,7 +124246,7 @@ var init_material_consume_table_controller = __esmMin((() => {
|
|
|
124245
124246
|
if (!rules.length) return;
|
|
124246
124247
|
const rawRows = dataManager.getRawData()[subFieldKey] ?? [];
|
|
124247
124248
|
const tableRows = ((_this$tableDataRef = this.tableDataRef) === null || _this$tableDataRef === void 0 ? void 0 : _this$tableDataRef.value) ?? rawRows;
|
|
124248
|
-
const row = this.
|
|
124249
|
+
const row = this.isRecordPattern ? tableRows[rowIndex] ?? rawRows[rowIndex] : tableRows.find((item) => !item.is_confirmed_ && !item.deleted_) ?? rawRows.find((item) => !item.is_confirmed_ && !item.deleted_);
|
|
124249
124250
|
if (!row) return;
|
|
124250
124251
|
if (!await applyUnitConversionRules({
|
|
124251
124252
|
rules,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { IBomEntry, IMaterialConsumeData
|
|
1
|
+
import { IBomEntry, IMaterialConsumeData } from '../../../../../domain/table/business/material/types';
|
|
2
2
|
export declare class BomEntryValidator {
|
|
3
3
|
bomEntry: IBomEntry;
|
|
4
4
|
/** 是否启用顺序投料 */
|
|
@@ -10,7 +10,7 @@ export declare class BomEntryValidator {
|
|
|
10
10
|
/** 表单实例的批次号 */
|
|
11
11
|
mainMaterialNo: string;
|
|
12
12
|
/** 物料消耗模式 */
|
|
13
|
-
|
|
13
|
+
noBomMode: boolean;
|
|
14
14
|
/** 该明细使用到的产品的id集合 */
|
|
15
15
|
productIds: string[];
|
|
16
16
|
/** 物料和code的映射 */
|
|
@@ -31,7 +31,7 @@ export declare class BomEntryValidator {
|
|
|
31
31
|
/** 表单实例的批次号 */
|
|
32
32
|
mainMaterialNo: string,
|
|
33
33
|
/** 物料消耗模式 */
|
|
34
|
-
|
|
34
|
+
noBomMode: boolean);
|
|
35
35
|
/**
|
|
36
36
|
* 翻译物料的code
|
|
37
37
|
* @param productId
|
|
@@ -90,7 +90,7 @@ export declare class BomEntriesValidator {
|
|
|
90
90
|
/** 表单实例的批次号 */
|
|
91
91
|
mainMaterialNo: string;
|
|
92
92
|
/** 物料消耗模式 */
|
|
93
|
-
|
|
93
|
+
noBomMode: boolean;
|
|
94
94
|
bomEntryValidators: BomEntryValidator[];
|
|
95
95
|
constructor(entries: IBomEntry[],
|
|
96
96
|
/** 是否启用顺序投料 */
|
|
@@ -102,7 +102,7 @@ export declare class BomEntriesValidator {
|
|
|
102
102
|
/** 表单实例的批次号 */
|
|
103
103
|
mainMaterialNo: string,
|
|
104
104
|
/** 物料消耗模式 */
|
|
105
|
-
|
|
105
|
+
noBomMode: boolean);
|
|
106
106
|
/**
|
|
107
107
|
* 翻译物料的code
|
|
108
108
|
* @param productId
|