@gct-paas/word 0.2.24 → 0.2.26
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.2.
|
|
1
|
+
/*! @gct-paas/word v0.2.26 */
|
|
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, toHandlers, toRaw, toRef, toValue, unref, useAttrs, useCssVars, useModel, useSlots, vModelRadio, vModelText, vShow, watch, watchEffect, withCtx, withDirectives, withKeys, withModifiers } from "vue";
|
|
3
3
|
import fa, { PopperWrapper } from "floating-vue";
|
|
4
4
|
import VueKonva from "vue-konva";
|
|
@@ -126891,7 +126891,7 @@ var init_bom_validator$1 = __esmMin((() => {
|
|
|
126891
126891
|
}
|
|
126892
126892
|
/** 需求总量 = 数量倍数 × BOM 单位用量 */
|
|
126893
126893
|
get total() {
|
|
126894
|
-
return this.materialNoNum * this.bomEntry.qty_required_;
|
|
126894
|
+
return this.materialNoNum * Number(this.bomEntry.qty_required_);
|
|
126895
126895
|
}
|
|
126896
126896
|
constructor(bomEntry, enableSequenceLoading, getMaterialNoNum, historyData, mainMaterialNo, noBomMode) {
|
|
126897
126897
|
_defineProperty(this, "bomEntry", void 0);
|
|
@@ -126989,7 +126989,7 @@ var init_bom_validator$1 = __esmMin((() => {
|
|
|
126989
126989
|
if (!this.bomEntry.lot_mixing_enabled_) return;
|
|
126990
126990
|
if (this.bomEntry.type_ !== "by_lot") return;
|
|
126991
126991
|
const groupData = this.filterGroupData(arr);
|
|
126992
|
-
const maxTimes = this.bomEntry.lot_mixing_times_;
|
|
126992
|
+
const maxTimes = Number(this.bomEntry.lot_mixing_times_);
|
|
126993
126993
|
const set = /* @__PURE__ */ new Set();
|
|
126994
126994
|
let errorMsg = "";
|
|
126995
126995
|
groupData.find((i) => {
|
|
@@ -127015,7 +127015,7 @@ var init_bom_validator$1 = __esmMin((() => {
|
|
|
127015
127015
|
if (i.product_id_ && i.material_no_) lots.add(i.material_no_);
|
|
127016
127016
|
});
|
|
127017
127017
|
if (row.material_no_) lots.add(row.material_no_);
|
|
127018
|
-
const maxTimes = this.bomEntry.lot_mixing_times_;
|
|
127018
|
+
const maxTimes = Number(this.bomEntry.lot_mixing_times_);
|
|
127019
127019
|
if (lots.size > maxTimes) throw new Error(`超过允许的混批次数:${maxTimes}`);
|
|
127020
127020
|
}
|
|
127021
127021
|
/** 指定物料批次:material_no_ 须在 specified_material_entries_ 的 name_ 范围内 */
|
|
@@ -127085,7 +127085,7 @@ var init_bom_validator$1 = __esmMin((() => {
|
|
|
127085
127085
|
if (!str) return;
|
|
127086
127086
|
try {
|
|
127087
127087
|
const json = JSON.parse(str);
|
|
127088
|
-
if (json.expr) return await window.gct_expression.execute(json.expr, { qty_required_: data.qty_required_ });
|
|
127088
|
+
if (json.expr) return Number(await window.gct_expression.execute(json.expr, { qty_required_: Number(data.qty_required_) }));
|
|
127089
127089
|
else console.warn("没有配置表达式");
|
|
127090
127090
|
} catch (error) {
|
|
127091
127091
|
console.error("parse expression error", error);
|
|
@@ -127223,7 +127223,7 @@ var init_bom_validator$1 = __esmMin((() => {
|
|
|
127223
127223
|
}
|
|
127224
127224
|
if (util.bomEntry.type_ === "view") return;
|
|
127225
127225
|
if (util.bomEntry.type_ === "by_lot" && !row.material_no_) errors.push(new McRowValidateError(`物料${this.translateProductCode(row.product_id_)}批次不能为空`, "material_no_", row));
|
|
127226
|
-
if (!row.qty_) errors.push(new McRowValidateError(`物料${this.translateProductCode(row.product_id_)}数量不能为空`, "qty_", row));
|
|
127226
|
+
if (!Number(row.qty_)) errors.push(new McRowValidateError(`物料${this.translateProductCode(row.product_id_)}数量不能为空`, "qty_", row));
|
|
127227
127227
|
if (row.expiration_date_ && dayjs(row.expiration_date_).endOf("day").isBefore(dayjs())) errors.push(new McRowValidateError(`${row.product_id__lb_} 的批次 ${row.material_no_} 已过期`, "expiration_date_", row));
|
|
127228
127228
|
try {
|
|
127229
127229
|
util.validateSpecifiedMaterialNo(row);
|
|
@@ -127504,7 +127504,7 @@ var init_bom_validator$1 = __esmMin((() => {
|
|
|
127504
127504
|
const { type_ } = this.findUtilByProductId(row.product_id_).bomEntry;
|
|
127505
127505
|
if (type_ === "view") return;
|
|
127506
127506
|
if (type_ === "by_lot" && !row.material_no_) throw new Error(`物料${this.translateProductCode(row.product_id_)}批次不能为空`);
|
|
127507
|
-
if (!row.qty_) throw new Error(`物料${this.translateProductCode(row.product_id_)}数量不能为空`);
|
|
127507
|
+
if (!Number(row.qty_)) throw new Error(`物料${this.translateProductCode(row.product_id_)}数量不能为空`);
|
|
127508
127508
|
}
|
|
127509
127509
|
/**
|
|
127510
127510
|
* 校验替代料校验
|
|
@@ -127622,7 +127622,7 @@ var init_bom_validator$1 = __esmMin((() => {
|
|
|
127622
127622
|
});
|
|
127623
127623
|
if (sameIndex >= 0) {
|
|
127624
127624
|
var _newArr$sameIndex;
|
|
127625
|
-
const newQty = (((_newArr$sameIndex = newArr[sameIndex]) === null || _newArr$sameIndex === void 0 ? void 0 : _newArr$sameIndex.qty_) ?? 0) + (row.qty_ ?? 0);
|
|
127625
|
+
const newQty = Number(((_newArr$sameIndex = newArr[sameIndex]) === null || _newArr$sameIndex === void 0 ? void 0 : _newArr$sameIndex.qty_) ?? 0) + Number(row.qty_ ?? 0);
|
|
127626
127626
|
merge(newArr[sameIndex], row, { qty_: newQty });
|
|
127627
127627
|
return newArr;
|
|
127628
127628
|
}
|
|
@@ -127728,12 +127728,12 @@ function buildFormulaValues(rule, row, mainData) {
|
|
|
127728
127728
|
for (const map of fieldMaps) {
|
|
127729
127729
|
if (map.key === "formulaRuleInput") {
|
|
127730
127730
|
const fieldKey = map.formField || DEFAULT_INPUT_FIELD;
|
|
127731
|
-
values[FORMULA_RULE_INPUT_KEY] = row[fieldKey];
|
|
127731
|
+
values[FORMULA_RULE_INPUT_KEY] = Number(row[fieldKey]);
|
|
127732
127732
|
continue;
|
|
127733
127733
|
}
|
|
127734
127734
|
if (!isParamMap(map) || !map.formField) continue;
|
|
127735
|
-
if (map.formSubModel === 1) values[map.key] = row[map.formField];
|
|
127736
|
-
else values[map.key] = mainData[map.formField];
|
|
127735
|
+
if (map.formSubModel === 1) values[map.key] = Number(row[map.formField]);
|
|
127736
|
+
else values[map.key] = Number(mainData[map.formField]);
|
|
127737
127737
|
}
|
|
127738
127738
|
return values;
|
|
127739
127739
|
}
|
|
@@ -127751,7 +127751,8 @@ async function applyUnitConversionRules(options) {
|
|
|
127751
127751
|
for (const rule of rules) {
|
|
127752
127752
|
if (!rule.expressionStr || !matchRule(rule, row, subFieldKey)) continue;
|
|
127753
127753
|
const values = buildFormulaValues(rule, row, mainData);
|
|
127754
|
-
|
|
127754
|
+
const result = await serviceUtil.formulaCalculate(rule.expressionStr, values);
|
|
127755
|
+
row.qty_transfer_ = Number(result);
|
|
127755
127756
|
row.qty_transfer_uom_id_ = getTargetUomId(rule.fieldMaps);
|
|
127756
127757
|
row.transfer_formula_ = rule.expressionStr;
|
|
127757
127758
|
return true;
|
|
@@ -128355,7 +128356,10 @@ var init_material_consume_table_controller = __esmMin((() => {
|
|
|
128355
128356
|
/** 批次数量或生产数量 */
|
|
128356
128357
|
get materialNoNum() {
|
|
128357
128358
|
const { required_qty_calc_rule_, product_qty_field_ } = this.tmplBom;
|
|
128358
|
-
if (required_qty_calc_rule_ === RequiredQtyCalcRule.ProductQty)
|
|
128359
|
+
if (required_qty_calc_rule_ === RequiredQtyCalcRule.ProductQty) {
|
|
128360
|
+
const qty = product_qty_field_ ? this.mainFormState.value[product_qty_field_] : 0;
|
|
128361
|
+
return qty === void 0 ? void 0 : Number(qty);
|
|
128362
|
+
}
|
|
128359
128363
|
return this.tmplBomController.materialNoNum;
|
|
128360
128364
|
}
|
|
128361
128365
|
/** 物料消耗模式(自身没有配置的话取环境的默认值) */
|
|
@@ -128513,19 +128517,22 @@ var init_material_consume_table_controller = __esmMin((() => {
|
|
|
128513
128517
|
* @readonly
|
|
128514
128518
|
*/
|
|
128515
128519
|
get actualBomEntries() {
|
|
128516
|
-
return ((this.isPersonalBom ? this.tmplBom.entries_ : this.tmplBomController.bomEntries) ?? []).sort((a, b) => (a.operation_sort_num_ ?? 0) - (b.operation_sort_num_ ?? 0));
|
|
128520
|
+
return ((this.isPersonalBom ? this.tmplBom.entries_ : this.tmplBomController.bomEntries) ?? []).sort((a, b) => Number(a.operation_sort_num_ ?? 0) - Number(b.operation_sort_num_ ?? 0));
|
|
128517
128521
|
}
|
|
128518
128522
|
/**
|
|
128519
128523
|
* 根据bom明细构造子表数据(初始化时)
|
|
128520
128524
|
*/
|
|
128521
128525
|
calcFormState() {
|
|
128522
|
-
if (this.tmplBom.bom_init_enabled_)
|
|
128523
|
-
|
|
128524
|
-
|
|
128525
|
-
|
|
128526
|
-
|
|
128527
|
-
|
|
128528
|
-
|
|
128526
|
+
if (this.tmplBom.bom_init_enabled_) {
|
|
128527
|
+
const materialNoNum = this.materialNoNum;
|
|
128528
|
+
return this.actualBomEntries.map((i) => {
|
|
128529
|
+
return {
|
|
128530
|
+
product_id_: i.product_id_,
|
|
128531
|
+
...materialNoNum === void 0 ? {} : { qty_required_: Number(i.qty_required_) * materialNoNum },
|
|
128532
|
+
bom_entry_id_: i.id_
|
|
128533
|
+
};
|
|
128534
|
+
});
|
|
128535
|
+
}
|
|
128529
128536
|
}
|
|
128530
128537
|
/**
|
|
128531
128538
|
* 未填报时初始化消耗表行数据
|
|
@@ -129367,7 +129374,7 @@ var init_tmpl_bom_controller = __esmMin((() => {
|
|
|
129367
129374
|
*/
|
|
129368
129375
|
get materialNoNum() {
|
|
129369
129376
|
var _this$formInstBom;
|
|
129370
|
-
return ((_this$formInstBom = this.formInstBom) === null || _this$formInstBom === void 0 ? void 0 : _this$formInstBom.qty) ?? 1;
|
|
129377
|
+
return Number(((_this$formInstBom = this.formInstBom) === null || _this$formInstBom === void 0 ? void 0 : _this$formInstBom.qty) ?? 1);
|
|
129371
129378
|
}
|
|
129372
129379
|
/**
|
|
129373
129380
|
* bom模块配置关联过来的bom明细集合
|
|
@@ -114,8 +114,8 @@ export declare class BomEntryValidator {
|
|
|
114
114
|
* @return {*}
|
|
115
115
|
*/
|
|
116
116
|
calcCustomNumberLimit(data: IMaterialConsumeData): Promise<{
|
|
117
|
-
max:
|
|
118
|
-
min:
|
|
117
|
+
max: number | undefined;
|
|
118
|
+
min: number | undefined;
|
|
119
119
|
}>;
|
|
120
120
|
/**
|
|
121
121
|
* 通用校验 5:本组上料数量是否满足 qty_validation_rule_。
|
package/dist/runtime/canvas/table/render/material-consume/material-consume-table-controller.d.ts
CHANGED
|
@@ -110,7 +110,7 @@ export declare class MaterialConsumeTableController {
|
|
|
110
110
|
private setupDataUnsubscribe?;
|
|
111
111
|
private setupUomUnsubscribe?;
|
|
112
112
|
/** 批次数量或生产数量 */
|
|
113
|
-
get materialNoNum():
|
|
113
|
+
get materialNoNum(): number | undefined;
|
|
114
114
|
/** 物料消耗模式(自身没有配置的话取环境的默认值) */
|
|
115
115
|
get mcPattern(): MaterialConsumptionPatternEnum;
|
|
116
116
|
/**
|