style:库存查询-产品下拉框入参

main
黄伟杰 5 days ago
parent 7c8a2801dc
commit 7d3ee0e1dd

@ -37,7 +37,7 @@ export const ProductApi = {
}, },
// 查询产品精简列表 // 查询产品精简列表
getProductSimpleList: async (params?: { categoryId?: string | number }) => { getProductSimpleList: async (params?: { categoryId?: string | number; categoryType?: number }) => {
return await request.get({ url: `/erp/product/simple-list-all`, params }) return await request.get({ url: `/erp/product/simple-list-all`, params })
}, },
// 查询原料精简列表 // 查询原料精简列表

@ -160,11 +160,11 @@
{{ formatStockCount(row.totalBaseCount) }} {{ formatStockCount(row.totalBaseCount) }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column :label="t('ErpStock.Stock.count')" align="center" sortable prop="count" min-width="120"> <!-- <el-table-column :label="t('ErpStock.Stock.count')" align="center" sortable prop="count" min-width="120">
<template #default="{ row }"> <template #default="{ row }">
{{ formatStockCount(row.count) }} {{ formatStockCount(row.count) }}
</template> </template>
</el-table-column> </el-table-column> -->
<el-table-column :label="t('ErpStock.Stock.unit')" align="center" prop="unitName" min-width="90" sortable /> <el-table-column :label="t('ErpStock.Stock.unit')" align="center" prop="unitName" min-width="90" sortable />
<el-table-column :label="t('ErpStock.Stock.latestInTime')" align="center" min-width="180"> <el-table-column :label="t('ErpStock.Stock.latestInTime')" align="center" min-width="180">
<template #default="{ row }"> <template #default="{ row }">
@ -286,6 +286,15 @@ const buildQueryParams = () => {
) )
} }
const getProductList = async () => {
productList.value = await ProductApi.getProductSimpleList(
queryParams.categoryType !== undefined ? { categoryType: queryParams.categoryType } : undefined
)
if (queryParams.productId && !productList.value.some((item) => item.id === queryParams.productId)) {
queryParams.productId = undefined
}
}
/** 查询列表 */ /** 查询列表 */
const getList = async () => { const getList = async () => {
loading.value = true loading.value = true
@ -305,17 +314,19 @@ const handleQuery = () => {
} }
/** 重置按钮操作 */ /** 重置按钮操作 */
const resetQuery = () => { const resetQuery = async () => {
queryFormRef.value.resetFields() queryFormRef.value.resetFields()
activeName.value = '' activeName.value = ''
queryParams.categoryType = undefined queryParams.categoryType = undefined
await getProductList()
handleQuery() handleQuery()
} }
const handleTabClick = (tab: any) => { const handleTabClick = async (tab: any) => {
const value = String(tab.paneName || '') const value = String(tab.paneName || '')
activeName.value = value activeName.value = value
queryParams.categoryType = value ? Number(value) : undefined queryParams.categoryType = value ? Number(value) : undefined
await getProductList()
handleQuery() handleQuery()
} }
@ -369,7 +380,7 @@ onMounted(async () => {
await dictStore.setDictMap() await dictStore.setDictMap()
await getList() await getList()
// //
productList.value = await ProductApi.getProductSimpleList() await getProductList()
warehouseList.value = await WarehouseApi.getWarehouseSimpleList() warehouseList.value = await WarehouseApi.getWarehouseSimpleList()
}) })
</script> </script>

Loading…
Cancel
Save