feat: 收货单未设置货主时禁止创建商品并提示

This commit is contained in:
liufumingren 2026-08-25 22:59:15 +08:00
parent 53f3b824f4
commit 5211f818fc

View File

@ -2389,6 +2389,12 @@ const openAddDrawer = (row?: any) => {
showReadOnlyTip()
return
}
// 收货单未设置货主时不允许创建商品
const receivingStoreId = Number(props.row?.store_id ?? props.row?.store?.id)
if (!Number.isFinite(receivingStoreId) || receivingStoreId <= 0) {
ElMessage.warning('请先设置收货单货主')
return
}
// row here is product row, but store info comes from parent receiving row (props.row)
addDrawerStore.value = props.row?.store || { id: props.row?.store_id, name: props.row?.store_name }
if (row) {