feat(web-admin): fill load/delivery notes from address when empty

Apply library notes only if the stop notes field is currently blank.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
zlwuandCursor committed 2026-09-02 11:59:29 +08:00
1 parent 9c3c53c705
commit 6021287c97
2 files changed
+11

No files matched your search

@@ -230,6 +230,7 @@
} from '@/components/business/pl-address-with-library/index.vue'
import PlPlanContractMultiSelect from '@/components/business/pl-plan-contract-multi-select/index.vue'
import PlPlanStopProductTable from '@/components/business/pl-plan-stop-product-table/index.vue'
import { resolveAddressNotesFill } from '@/utils/pl-address-notes-fill'
import {
createEmptyDeliveryForm,
resolveStopDibangDefaults,
@@ -336,6 +337,7 @@
}
function patchDeliveryAddress(index: number, fields: PlAddressApplyPayload) {
const delivery = props.modelValue[index]
const partial: Partial<PlanDeliveryForm> = {
address: fields.address,
lng: fields.lng,
@@ -344,6 +346,10 @@
if (fields.contact !== undefined) {
partial.contact = fields.contact
}
const nextNotes = resolveAddressNotesFill(delivery?.notes, fields.notes)
if (nextNotes !== undefined) {
partial.notes = nextNotes
}
patchDelivery(index, partial)
}
@@ -161,6 +161,7 @@
} from '@/components/business/pl-address-with-library/index.vue'
import PlPlanContractMultiSelect from '@/components/business/pl-plan-contract-multi-select/index.vue'
import PlPlanStopProductTable from '@/components/business/pl-plan-stop-product-table/index.vue'
import { resolveAddressNotesFill } from '@/utils/pl-address-notes-fill'
import { resolveStopDibangDefaults, type PlanLoadForm } from '@/utils/pl-plan-stop-form'
import { isPlInternalCustomerName } from '@/utils/pl-internal-customer'
import { pickBxData } from '@/utils/http/bx'
@@ -241,6 +242,10 @@
if (fields.contact !== undefined) {
partial.contact = fields.contact
}
const nextNotes = resolveAddressNotesFill(props.modelValue.notes, fields.notes)
if (nextNotes !== undefined) {
partial.notes = nextNotes
}
patch(partial)
}