修复商品库存与网络摘要并校验订购编号
This commit is contained in:
1 parent
28894e0813
commit
d8224ec5b7
15 files changed
+529
-68
No files matched your search
@@ -51,6 +51,8 @@ import { o as cart_edit_o } from "~/lib/cart-edit.js";
|
||||
import { r as cart_edit_r } from "~/lib/cart-edit.js";
|
||||
import ConfigDiskCard from "~/components/config/ConfigDiskCard.vue";
|
||||
import slider from "primevue/slider";
|
||||
import { productStock } from "~/lib/product-inventory.js";
|
||||
import { resourceOptionValue } from "~/lib/resource-option-value.js";
|
||||
function z(e, t = {}, n = `mf_dcim`, r = {}) {
|
||||
// 商品库存与型号同步库存可能同时生效;可购数量取所有有效限制中的最小值。
|
||||
let i = useApi(),
|
||||
@@ -108,17 +110,7 @@ function z(e, t = {}, n = `mf_dcim`, r = {}) {
|
||||
h.value?.model_config.find((e) => e.id === D.value.model_config_id),
|
||||
),
|
||||
ne = computed(() => A.value.find((e) => e.id === D.value.line_id)),
|
||||
re = computed(() => {
|
||||
let e = [
|
||||
m.value?.stock_control === 1 ? m.value.qty : void 0,
|
||||
j.value?.auto_sync_dcim_stock === 1 ? j.value.qty : void 0,
|
||||
]
|
||||
.filter(
|
||||
(e) => e !== void 0 && Number.isFinite(Number(e)) && Number(e) >= 0,
|
||||
)
|
||||
.map(Number);
|
||||
return e.length ? Math.min(...e) : null;
|
||||
}),
|
||||
re = computed(() => productStock(m.value, j.value)),
|
||||
ie = computed(() => re.value === null || C.value <= re.value),
|
||||
F = computed(() =>
|
||||
JSON.stringify({
|
||||
@@ -188,12 +180,8 @@ function z(e, t = {}, n = `mf_dcim`, r = {}) {
|
||||
}));
|
||||
let q = (e) => !V && e === z,
|
||||
le = (e) => {
|
||||
let t = e?.[0];
|
||||
return t
|
||||
? String(
|
||||
t.type && t.type !== `radio` ? (t.min_value ?? t.value) : t.value,
|
||||
)
|
||||
: ``;
|
||||
const value = resourceOptionValue(e?.[0]);
|
||||
return value === undefined ? `` : String(value);
|
||||
};
|
||||
function ue() {
|
||||
// 报价和提交共用前置校验,型号/线路/镜像与正整数数量缺一不可。
|
||||
|
||||
Reference in new issue
Block a user