增加导入模版逻辑判断
This commit is contained in:
@@ -118,7 +118,20 @@ const colSurcharge = '附加费'
|
||||
const colAction = '操作'
|
||||
|
||||
function cellKey(row, field) {
|
||||
return String(row && row.psdId != null ? row.psdId : row && row.productCountryId) + ':' + field
|
||||
if (!row) return 'none:' + field
|
||||
// Prefer DB id; local Excel draft uses _localKey (psdId cleared in applyLocalDraft).
|
||||
if (row.psdId != null && row.psdId !== '') return String(row.psdId) + ':' + field
|
||||
if (row._localKey) return String(row._localKey) + ':' + field
|
||||
const parts = [
|
||||
row.productCode,
|
||||
row.countryCode || row.countryName,
|
||||
row.zoneCode || row.zoneName,
|
||||
row.weightLabel,
|
||||
row.weightMin,
|
||||
row.weightMax,
|
||||
row.productCountryId
|
||||
]
|
||||
return parts.map(v => (v == null ? '' : String(v))).join('|') + ':' + field
|
||||
}
|
||||
|
||||
function formatNum(v, precision) {
|
||||
@@ -150,7 +163,8 @@ async function commitEdit(row, field) {
|
||||
editingKey.value = ''
|
||||
try {
|
||||
if (!row) return
|
||||
if (!row.psdId) return
|
||||
// Always emit: create/IMPORT_FRESH local draft has no psdId until finish;
|
||||
// parent persist path decides DB write vs local-only.
|
||||
emit('row-change', row)
|
||||
} finally {
|
||||
committing.value = false
|
||||
|
||||
Reference in New Issue
Block a user