修复快递接口ext_data结构:改为服务值映射并兼容系统快递编码
This commit is contained in:
parent
072f4dd833
commit
53f3b824f4
@ -1727,7 +1727,7 @@ function initializeSiteSelection(
|
||||
}
|
||||
|
||||
function syncExtDataByServiceSelection() {
|
||||
const expressCode = String(formData.express_code || '').trim()
|
||||
const expressCode = String(formData.express_code || formData.sys_express_code || '').trim()
|
||||
if (!selectedShopId.value || !expressCode) {
|
||||
formData.ext_data = undefined
|
||||
return
|
||||
@ -1742,20 +1742,7 @@ function syncExtDataByServiceSelection() {
|
||||
bucket[field.attrCode] = toServicePayloadValue(v)
|
||||
})
|
||||
|
||||
const serviceSelection: Record<string, any> = {}
|
||||
Object.entries(valueByService).forEach(([serviceCode, attrValues]) => {
|
||||
const entries = Object.entries(attrValues || {})
|
||||
if (entries.length === 0) return
|
||||
if (entries.length === 1) {
|
||||
const firstEntry = entries[0]
|
||||
if (!firstEntry) return
|
||||
serviceSelection[serviceCode] = firstEntry[1]
|
||||
return
|
||||
}
|
||||
serviceSelection[serviceCode] = attrValues
|
||||
})
|
||||
|
||||
formData.ext_data = Object.keys(serviceSelection).length > 0 ? serviceSelection : undefined
|
||||
formData.ext_data = Object.keys(valueByService).length > 0 ? valueByService : undefined
|
||||
}
|
||||
|
||||
async function handleExpressCodeChange() {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user