diff --git a/src/views/storage/receiving/component/Product.vue b/src/views/storage/receiving/component/Product.vue index 9eb76818..0e8f595f 100644 --- a/src/views/storage/receiving/component/Product.vue +++ b/src/views/storage/receiving/component/Product.vue @@ -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) {