提交设置套餐

This commit is contained in:
wuweihua
2026-09-07 13:57:45 +08:00
parent 926dea2488
commit a083a0dece
7 changed files with 112 additions and 8 deletions
+11 -1
View File
@@ -347,6 +347,7 @@ function weightOptionsOf(row) {
map.set(value, {
value,
label: value,
detailId: item.detailId,
freightPrice: item.freightPrice,
registrationFee: item.registrationFee
})
@@ -362,6 +363,7 @@ function emptyDetail() {
countryName: undefined,
_countryKey: undefined,
weightLabel: undefined,
productCountryId: undefined,
fvValue: undefined,
fvRegistrationFee: undefined,
discountValue: undefined
@@ -391,6 +393,7 @@ function clearCascadeAfterProduct(row) {
row.countryName = undefined
row._countryKey = undefined
row.weightLabel = undefined
row.productCountryId = undefined
row.fvValue = undefined
row.fvRegistrationFee = undefined
}
@@ -408,13 +411,18 @@ function onCountryChange(row) {
row.countryCode = opt ? opt.code : undefined
row.countryName = opt ? opt.name : undefined
row.weightLabel = undefined
row.productCountryId = undefined
row.fvValue = undefined
row.fvRegistrationFee = undefined
}
function onWeightChange(row) {
const opt = weightOptionsOf(row).find(w => w.value === row.weightLabel)
if (!opt) return
if (!opt) {
row.productCountryId = undefined
return
}
row.productCountryId = opt.detailId
if (opt.freightPrice != null) row.fvValue = Number(opt.freightPrice)
if (opt.registrationFee != null) row.fvRegistrationFee = Number(opt.registrationFee)
}
@@ -436,6 +444,7 @@ function hydrateDetailRow(d) {
if (hit) {
row.weightLabel = formatWeightLabel(hit.weightMin, hit.weightMax)
row._countryKey = countryKeyOf(hit)
row.productCountryId = hit.detailId
if (!row.countryCode) row.countryCode = hit.countryCode
if (!row.countryName) row.countryName = hit.countryName
}
@@ -451,6 +460,7 @@ function buildPayload(submitFlag) {
countryCode: d.countryCode || undefined,
countryName: d.countryName || undefined,
weightLabel: d.weightLabel || undefined,
productCountryId: d.productCountryId || undefined,
fvValue: d.fvValue,
fvRegistrationFee: d.fvRegistrationFee,
discountValue: d.discountValue