提交产品列表

This commit is contained in:
wuweihua
2026-09-07 18:09:59 +08:00
parent 3994bd7998
commit 9e98cd791e
14 changed files with 528 additions and 39 deletions
+13 -2
View File
@@ -157,6 +157,13 @@
<el-input-number v-model="row.discountValue" :min="1" :max="99" :precision="2" controls-position="right" style="width: 100%" placeholder="空=默认折扣" />
</template>
</el-table-column>
<el-table-column label="取值方式" min-width="130">
<template #default="{ row }">
<el-select v-model="row.roundMode" placeholder="取值方式" style="width: 100%">
<el-option v-for="d in bms_round_mode" :key="d.value" :label="d.label" :value="d.value" />
</el-select>
</template>
</el-table-column>
<el-table-column label="操作" width="80" align="center">
<template #default="{ $index }">
<el-button link type="danger" @click="form.details.splice($index, 1)">删除</el-button>
@@ -248,6 +255,7 @@ import { getPriceSet, savePriceSet, validatePriceSet } from '@/api/price/set'
import { listProduct, listProductCountries } from '@/api/price/product'
const { proxy } = getCurrentInstance()
const { bms_round_mode } = useDict('bms_round_mode')
const route = useRoute()
const active = ref(0)
const saving = ref(false)
@@ -366,7 +374,8 @@ function emptyDetail() {
productCountryId: undefined,
fvValue: undefined,
fvRegistrationFee: undefined,
discountValue: undefined
discountValue: undefined,
roundMode: 'HALF_UP'
}
}
@@ -430,6 +439,7 @@ function onWeightChange(row) {
function hydrateDetailRow(d) {
const row = {
...d,
roundMode: d.roundMode || 'HALF_UP',
_countryKey: countryKeyOf(d)
}
// normalize historical weight labels to min≤W≤max when possible
@@ -463,7 +473,8 @@ function buildPayload(submitFlag) {
productCountryId: d.productCountryId || undefined,
fvValue: d.fvValue,
fvRegistrationFee: d.fvRegistrationFee,
discountValue: d.discountValue
discountValue: d.discountValue,
roundMode: d.roundMode || 'HALF_UP'
}))
const customers = (form.customers || [])
.filter(c => c.customerId)