@unizhen/ui 0.1.143 → 0.1.145
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/lib/components/bom/quantity.d.ts +2 -2
- package/lib/ui.js +8 -8
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { BomRow } from './interface';
|
|
2
2
|
export declare const calculateRequiredQuantity: (row: BomRow) => number | null;
|
|
3
|
-
export declare const calculatePlannedQuantity: (quantity: BomRow["quantity"],
|
|
4
|
-
export declare const syncDescendantPlannedQuantities: (rows: BomRow[],
|
|
3
|
+
export declare const calculatePlannedQuantity: (quantity: BomRow["quantity"], lossRateValue: BomRow["lossRate"], parentPlannedQuantity: unknown) => number | null;
|
|
4
|
+
export declare const syncDescendantPlannedQuantities: (rows: BomRow[], parentPlannedQuantity: unknown) => void;
|
package/lib/ui.js
CHANGED
|
@@ -2766,13 +2766,13 @@ var Xr = (e, t) => e.map((e, n) => {
|
|
|
2766
2766
|
let t = Number(e.quantity), n = ei(e.lossRate);
|
|
2767
2767
|
return !Number.isFinite(t) || n === null || n < 0 ? null : Math.ceil(t * (1 + n / 100));
|
|
2768
2768
|
}, ni = (e, t, n) => {
|
|
2769
|
-
|
|
2770
|
-
|
|
2771
|
-
|
|
2769
|
+
let r = ei(t);
|
|
2770
|
+
if (r === null || r < 0 || n == null || n === "") return null;
|
|
2771
|
+
let i = Number(e), a = Number(n);
|
|
2772
|
+
return Number.isFinite(i) && Number.isFinite(a) ? Math.ceil(i * a * (1 + r / 100)) : null;
|
|
2772
2773
|
}, ri = (e, t) => {
|
|
2773
2774
|
e.forEach((e) => {
|
|
2774
|
-
|
|
2775
|
-
e.required_quantity = n, e.counts = ni(e.quantity, n, t), Array.isArray(e.children) && ri(e.children, t);
|
|
2775
|
+
e.required_quantity = ti(e), e.counts = ni(e.quantity, e.lossRate, t), Array.isArray(e.children) && ri(e.children, e.counts);
|
|
2776
2776
|
});
|
|
2777
2777
|
}, ii = (e) => e.key ?? e.code, ai = () => globalThis.crypto?.randomUUID?.() ?? `bom-${Date.now().toString(36)}-${Math.random().toString(36).slice(2)}`, oi = (e, t, n) => {
|
|
2778
2778
|
let r = e.findIndex((e) => ii(e) === t);
|
|
@@ -3462,7 +3462,7 @@ var Di = (e) => e.key === "product_no" || e.key === "product_name" || typeof e.t
|
|
|
3462
3462
|
row: e,
|
|
3463
3463
|
index: t
|
|
3464
3464
|
})).sort((e, t) => (typeof e.row.sort_index == "number" && Number.isFinite(e.row.sort_index) ? e.row.sort_index : Number.isFinite(e.row.sort) ? e.row.sort : e.index) - (typeof t.row.sort_index == "number" && Number.isFinite(t.row.sort_index) ? t.row.sort_index : Number.isFinite(t.row.sort) ? t.row.sort : t.index)).map(({ row: e }, i) => {
|
|
3465
|
-
let a = l(e, i, n), o = e.children, s = ti(e), d = t === 1 ? c() : ni(e.quantity,
|
|
3465
|
+
let a = l(e, i, n), o = e.children, s = ti(e), d = t === 1 ? c() : ni(e.quantity, e.lossRate, r);
|
|
3466
3466
|
return {
|
|
3467
3467
|
...e,
|
|
3468
3468
|
required_quantity: s,
|
|
@@ -3472,7 +3472,7 @@ var Di = (e) => e.key === "product_no" || e.key === "product_name" || typeof e.t
|
|
|
3472
3472
|
code: a,
|
|
3473
3473
|
sort: i,
|
|
3474
3474
|
sort_index: i,
|
|
3475
|
-
...Array.isArray(o) ? { children: u(o, t + 1, a,
|
|
3475
|
+
...Array.isArray(o) ? { children: u(o, t + 1, a, d) } : {}
|
|
3476
3476
|
};
|
|
3477
3477
|
}), d = w(u(e.value)), m = w([]), h = !1, g = 1, _ = ii, b = (e, t = 1, n) => {
|
|
3478
3478
|
e.forEach((e, r) => {
|
|
@@ -7875,7 +7875,7 @@ function oc(e, t, n) {
|
|
|
7875
7875
|
}
|
|
7876
7876
|
//#endregion
|
|
7877
7877
|
//#region package.json
|
|
7878
|
-
var sc = "0.1.
|
|
7878
|
+
var sc = "0.1.145", cc;
|
|
7879
7879
|
async function lc() {
|
|
7880
7880
|
let e = await fetch(`${window.location.protocol}//${window.location.host}`, {
|
|
7881
7881
|
method: "HEAD",
|