修改导入问题

This commit is contained in:
wuweihua
2026-09-14 18:56:31 +08:00
parent c89c1340b0
commit 6146525e62
8 changed files with 312 additions and 93 deletions
@@ -25,6 +25,7 @@
<script setup>
import SimpleTable from '@/components/SimpleTable'
import { listProductCountries } from '@/api/price/product'
import { formatWeightLabel } from '@/views/price/set/utils/priceSet'
const columns = [
{ prop: 'countryName', label: '国家', width: 90, showOverflowTooltip: true },
@@ -32,9 +33,11 @@ const columns = [
{
prop: 'weightMin',
label: '重量段(KG)',
width: 120,
width: 130,
align: 'center',
formatter: (row) => (row.weightMin != null || row.weightMax != null ? (row.weightMin + ' ~ ' + row.weightMax) : '-')
formatter: (row) => (row.weightMin != null || row.weightMax != null
? formatWeightLabel(row.weightMin, row.weightMax)
: '-')
},
{ prop: 'freightPrice', label: '运费(RMB/KG)', width: 110, align: 'right' },
{ prop: 'registrationFee', label: '挂号费(RMB/票)', width: 120, align: 'right' },
+1 -1
View File
@@ -294,7 +294,7 @@ const rules = {
}
function loadProducts() {
listProduct({ pageNum: 1, pageSize: 500, status: '0' }).then(res => {
listProduct({ pageNum: 1, pageSize: 500, status: '1' }).then(res => {
productOptions.value = res.rows || []
})
}
@@ -30,9 +30,9 @@ export function usePriceSetRefData() {
const productMap = computed(() => new Map(productOptions.value.map(p => [p.value, p])))
/** 加载可选产品(在售) */
/** 加载可选产品(已生效) */
function loadProducts() {
return listProduct({ status: '0', pageNum: 1, pageSize: 1000 }).then(res => {
return listProduct({ status: '1', pageNum: 1, pageSize: 1000 }).then(res => {
productOptions.value = (res.rows || []).map(p => ({
value: p.productCode,
label: `${p.productCode} ${p.productName || ''}`.trim(),
@@ -162,7 +162,7 @@ export function useDetailCascade(refData) {
if (opt.registrationFee != null) row.fvRegistrationFee = Number(opt.registrationFee)
}
/** 回显历史明细行:补齐字段,并把旧重量段文案归一化为 min≤W≤max */
/** hydrate detail row; normalize weight label to min<W\u2264max */
function hydrateRow(d, setType) {
const row = toEditableDetailRow(d)
if (!row.productCode) return row
@@ -94,9 +94,9 @@ export function trimNum(v) {
return String(parseFloat(n.toFixed(6)))
}
/** 重量段展示文案:1≤W≤2 */
/** Weight label: left-open right-closed, e.g. 0.3<W\u22641 */
export function formatWeightLabel(min, max) {
return `${trimNum(min)}≤W≤${trimNum(max)}`
return `${trimNum(min)}<W≤${trimNum(max)}`
}
/** 国家唯一键:优先国家三字码,其次国家名称 */