提交设置套餐

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
+13 -5
View File
@@ -76,9 +76,9 @@
<el-table-column v-if="set.setType === 'DISCOUNT'" label="产品折扣" min-width="110">
<template #default="{ row }">{{ row.discountValue != null ? row.discountValue + '%' : '默认折扣' }}</template>
</el-table-column>
<el-table-column label="关联 pr_id" prop="prId" width="110">
<!-- <el-table-column label="关联 pr_id" prop="prId" width="110">
<template #default="{ row }">{{ row.prId || '-' }}</template>
</el-table-column>
</el-table-column> -->
<el-table-column v-if="childEditable" label="操作" width="140" align="center">
<template #default="{ row }">
<el-button link type="primary" @click="openDetailDialog(row)" v-hasPermi="['price:set:edit']">编辑</el-button>
@@ -175,9 +175,9 @@
<el-form-item v-else label="产品折扣%" prop="discountValue">
<el-input-number v-model="detailForm.discountValue" :min="1" :max="99" controls-position="right" style="width: 100%" />
</el-form-item>
<el-form-item label="关联 pr_id" prop="prId">
<!-- <el-form-item label="关联 pr_id" prop="prId">
<el-input v-model="detailForm.prId" placeholder="可选" />
</el-form-item>
</el-form-item> -->
</el-form>
<template #footer>
<el-button type="primary" @click="submitDetail">确 定</el-button>
@@ -304,6 +304,7 @@ const detailWeightOptions = computed(() => {
map.set(value, {
value,
label: value,
detailId: item.detailId,
freightPrice: item.freightPrice,
registrationFee: item.registrationFee
})
@@ -328,6 +329,7 @@ function onDetailProductChange() {
detailForm.value.countryName = undefined
detailForm.value._countryKey = undefined
detailForm.value.weightLabel = undefined
detailForm.value.productCountryId = undefined
detailForm.value.fvValue = undefined
detailForm.value.fvRegistrationFee = undefined
if (detailForm.value.productCode && set.value.setType === 'FIXED') {
@@ -340,13 +342,18 @@ function onDetailCountryChange() {
detailForm.value.countryCode = opt ? opt.code : undefined
detailForm.value.countryName = opt ? opt.name : undefined
detailForm.value.weightLabel = undefined
detailForm.value.productCountryId = undefined
detailForm.value.fvValue = undefined
detailForm.value.fvRegistrationFee = undefined
}
function onDetailWeightChange() {
const opt = detailWeightOptions.value.find(w => w.value === detailForm.value.weightLabel)
if (!opt) return
if (!opt) {
detailForm.value.productCountryId = undefined
return
}
detailForm.value.productCountryId = opt.detailId
if (opt.freightPrice != null) detailForm.value.fvValue = Number(opt.freightPrice)
if (opt.registrationFee != null) detailForm.value.fvRegistrationFee = Number(opt.registrationFee)
}
@@ -440,6 +447,7 @@ function openDetailDialog(row) {
countryName: undefined,
_countryKey: undefined,
weightLabel: undefined,
productCountryId: undefined,
fvValue: undefined,
fvRegistrationFee: undefined,
discountValue: undefined