修复商品库存与网络摘要并校验订购编号

This commit is contained in:
cieanyau committed 2026-11-06 04:48:38 +08:00
1 parent 28894e0813
commit d8224ec5b7
15 files changed
+529 -68

No files matched your search

+1 -8
View File
@@ -60,14 +60,7 @@ import ConfigResourceOption from "~/components/config/ConfigResourceOption.vue";
import { t as password_t } from "~/lib/password-2.js";
import { n as order_image_continuation_n } from "~/lib/order-image-continuation.js";
import { t as order_image_continuation_t } from "~/lib/order-image-continuation.js";
function I(e) {
if (e)
return Number(
e.type === `step` || e.type === `total`
? (e.min_value ?? e.value)
: e.value,
);
}
import { resourceOptionValue as I } from "~/lib/resource-option-value.js";
function L(e, t) {
// 区间内的值还必须落在步长网格上,不能仅凭最小/最大值认定配置可购买。
if (t == null || t === ``) return !1;
+5 -17
View File
@@ -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() {
// 报价和提交共用前置校验,型号/线路/镜像与正整数数量缺一不可。