新增附加费计费标识,优化附加费管理逻辑
This commit is contained in:
@@ -87,7 +87,7 @@
|
||||
</div>
|
||||
|
||||
<el-drawer v-model="detailVisible" :title="detailTitle" size="78%" destroy-on-close append-to-body>
|
||||
<pay-config-detail :product="detailProduct" :editable="false" />
|
||||
<pay-config-detail :product="detailProduct" :editable="false" :bill-select="true" />
|
||||
<template #footer>
|
||||
<el-button @click="detailVisible = false">关闭</el-button>
|
||||
</template>
|
||||
@@ -187,7 +187,9 @@ async function onFile(uploadFile) {
|
||||
const data = res.data || {}
|
||||
data.products = (data.products || []).map((item, index) => ({
|
||||
...item,
|
||||
rowKey: `${item.sheetName || ''}-${item.productName || ''}-${index}`
|
||||
rowKey: `${item.sheetName || ''}-${item.productName || ''}-${index}`,
|
||||
// 解析后默认不计费,勾选后才入 pay_surcharge
|
||||
surcharges: (item.surcharges || []).map(fee => ({ ...fee, needBill: fee?.needBill === true }))
|
||||
}))
|
||||
preview.value = data
|
||||
const picked = data.products.filter(row => canSelect(row))
|
||||
@@ -310,12 +312,17 @@ async function submit(payload = {}) {
|
||||
const productsPayload = (payload.products && payload.products.length)
|
||||
? payload.products
|
||||
: selected.value.map(row => ({ ...row, productType: 'AR' }))
|
||||
const filteredProducts = productsPayload.map(product => ({
|
||||
...product,
|
||||
productType: product.productType || 'AR',
|
||||
surcharges: (product.surcharges || []).filter(fee => fee && fee.needBill === true)
|
||||
}))
|
||||
const res = await saveLabelImport({
|
||||
priceSetId: payload.priceSetId || null,
|
||||
priceSetName: String(payload.priceSetName || '').trim(),
|
||||
priceSetNote: payload.priceSetNote || '',
|
||||
overwrite: payload.overwrite != null ? payload.overwrite : overwrite.value,
|
||||
products: productsPayload
|
||||
products: filteredProducts
|
||||
})
|
||||
const data = res.data || {}
|
||||
return {
|
||||
|
||||
Reference in New Issue
Block a user