diff --git a/src/views/warehouse/import.vue b/src/views/warehouse/import.vue
index 02a015586..49e24622c 100644
--- a/src/views/warehouse/import.vue
+++ b/src/views/warehouse/import.vue
@@ -93,6 +93,11 @@
+
+
+
+
+
>,
@@ -151,12 +158,15 @@ const emit = defineEmits(['success', 'close'])
const formRef = shallowRef()
const { removeTab } = useMultipleTabs()
const mode = ref('add')
+const warehouse_id = ref('')
// 表单数据
const formData = reactive({
store_id: ''
})
-
+if (route.query.warehouse_id) {
+ warehouse_id.value = parseInt(route.query.warehouse_id)
+}
const showStore = ref(false) // 选择门店列表是否显示
// 门店列表
const storeList = ref([])
@@ -204,26 +214,28 @@ const stock_type = ref(1)
const router = useRouter()
// 提交按钮
const handleSubmit = async () => {
+ if (warehouse_id.value == '') {
+ ElMessage.error('请选择仓库')
+ return
+ }
const product_arr = productList.value.map((item: any) => {
return {
- id: item.id,
- stock: item.new_stock || 0
+ id: item.product_id,
+ stock: item.new_stock || 0,
+ batch: item.batch || 0
}
})
const store_arr = storeList.value.map((item: any) => item.id)
- console.log(product_arr)
- console.log(store_arr)
- console.log(stock_type.value)
- return false
apiStoreProductImport({
product_arr,
store_arr,
- stock_type: stock_type.value
+ stock_type: stock_type.value,
+ warehouse_id: warehouse_id.value
}).then((res) => {
removeTab()
- router.push({
- path: '/store/store_product'
- })
+ // router.push({
+ // path: '/warehouse/warehouse_product'
+ // })
})
}
diff --git a/src/views/warehouse/product_import.vue b/src/views/warehouse/product_import.vue
index 6f5a0a4c0..78e359083 100644
--- a/src/views/warehouse/product_import.vue
+++ b/src/views/warehouse/product_import.vue
@@ -32,7 +32,8 @@
diff --git a/src/views/warehouse_product/index.vue b/src/views/warehouse_product/index.vue
index 60883f8fd..32a2efa9d 100644
--- a/src/views/warehouse_product/index.vue
+++ b/src/views/warehouse_product/index.vue
@@ -63,7 +63,7 @@
-
+