fix(pl): keep multi-brand site feedback when plan product row is stale

Persist submitted brand qtys even if plan brand_mode lookup fails; resolve soft-deleted plan products for brand metadata instead of substituting another product; stop seeding all actual qty onto the first brand option.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
zlwuandCursor committed 2026-07-31 07:06:41 +08:00
1 parent d1daedc17d
commit 5a9abfdd5d
6 files changed
+220 -54

No files matched your search

@@ -201,27 +201,7 @@
setQty(brandId, normalized)
}
watch(
() => [props.brandMode, props.requiredBrandId, props.brandOptions] as const,
() => {
if (props.brandMode !== 'required') return
const id = props.requiredBrandId || props.brandOptions[0]?.brandId
if (!id) return
const opt = props.brandOptions.find((o) => o.brandId === id)
const existing = props.modelValue.find((r) => r.brandId === id)
if (!existing) {
emitRows([
...props.modelValue,
{
brandId: id,
brandName: opt?.brandName || '指定品牌',
qty: 0
}
])
}
},
{ immediate: true }
)
// 偏好品牌预选由父级初始化;组件内不再强制回填,避免取消后被再次插入
</script>
<style scoped lang="scss">