This commit is contained in:
parent
a37a24ecf5
commit
acccd00866
|
@ -93,6 +93,11 @@
|
|||
<el-input-number v-model="row.new_stock" :min="1" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="批次" min-width="150">
|
||||
<template #default="{ row }">
|
||||
<el-input-number v-model="row.batch" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" width="120" fixed="right">
|
||||
<template #default="{ row }">
|
||||
<el-button
|
||||
|
@ -141,6 +146,8 @@ import { onMounted } from 'vue'
|
|||
import { useRouter, useRoute } from 'vue-router'
|
||||
import { apiStoreCategoryLists } from '@/api/store_category'
|
||||
import { apiStoreProductUnitLists } from '@/api/store_product_unit'
|
||||
|
||||
const route = useRoute()
|
||||
defineProps({
|
||||
dictData: {
|
||||
type: Object as PropType<Record<string, any[]>>,
|
||||
|
@ -151,12 +158,15 @@ const emit = defineEmits(['success', 'close'])
|
|||
const formRef = shallowRef<FormInstance>()
|
||||
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'
|
||||
// })
|
||||
})
|
||||
}
|
||||
</script>
|
||||
|
|
|
@ -32,7 +32,8 @@
|
|||
<el-card class="!border-none" v-loading="pager.loading" shadow="never">
|
||||
<router-link
|
||||
:to="{
|
||||
path: 'import'
|
||||
path: 'import',
|
||||
query: { warehouse_id: queryParams.warehouse_id }
|
||||
}"
|
||||
class="ml-4"
|
||||
>
|
||||
|
|
|
@ -63,7 +63,7 @@
|
|||
<el-table-column type="selection" width="55" />
|
||||
<el-table-column label="" prop="id" show-overflow-tooltip />
|
||||
<el-table-column label="操作人员" prop="admin_name" show-overflow-tooltip />
|
||||
<el-table-column label="仓库" prop="warehouse_id" show-overflow-tooltip />
|
||||
<el-table-column label="仓库" prop="warehouse_name" show-overflow-tooltip />
|
||||
<el-table-column label="商品" prop="store_name" show-overflow-tooltip />
|
||||
<el-table-column
|
||||
label="出入库"
|
||||
|
|
Loading…
Reference in New Issue