feat(web-admin): submit stable load/delivery/product ids on plan save.
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
1 parent
2e5b05f477
commit
c90ff7c419
3 files changed
+24
-5
No files matched your search
@@ -1419,6 +1419,7 @@
|
||||
return formData.products.map((item) => {
|
||||
prepareLineAliasAndBrandForSubmit(item)
|
||||
return {
|
||||
...(item.id ? { id: item.id } : {}),
|
||||
productId: item.productId,
|
||||
productNo: item.productNo,
|
||||
productName: item.productName,
|
||||
@@ -1779,13 +1780,24 @@
|
||||
remark: data.remark || ''
|
||||
})
|
||||
applyStopsFromPlan(data)
|
||||
loadForm.value.products = loadForm.value.products.map((row) => ({
|
||||
...row,
|
||||
planProductId: undefined
|
||||
}))
|
||||
// 复制为新计划:不回传源计划段/段产品 id,避免误 upsert
|
||||
loadForm.value = {
|
||||
...loadForm.value,
|
||||
id: undefined,
|
||||
products: loadForm.value.products.map((row) => ({
|
||||
...row,
|
||||
id: undefined,
|
||||
planProductId: undefined
|
||||
}))
|
||||
}
|
||||
deliveryForms.value = deliveryForms.value.map((row) => ({
|
||||
...row,
|
||||
products: row.products.map((product) => ({ ...product, planProductId: undefined }))
|
||||
id: undefined,
|
||||
products: row.products.map((product) => ({
|
||||
...product,
|
||||
id: undefined,
|
||||
planProductId: undefined
|
||||
}))
|
||||
}))
|
||||
loadedTransportStatus.value = 'pending'
|
||||
loadedFollowStatus.value = ''
|
||||
|
||||
Reference in new issue
Block a user