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

main
黄伟杰 4 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 })
},
// 查询原料精简列表

@ -160,11 +160,11 @@
{{ formatStockCount(row.totalBaseCount) }}
</template>
</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 }">
{{ formatStockCount(row.count) }}
</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.latestInTime')" align="center" min-width="180">
<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 () => {
loading.value = true
@ -305,17 +314,19 @@ const handleQuery = () => {
}
/** 重置按钮操作 */
const resetQuery = () => {
const resetQuery = async () => {
queryFormRef.value.resetFields()
activeName.value = ''
queryParams.categoryType = undefined
await getProductList()
handleQuery()
}
const handleTabClick = (tab: any) => {
const handleTabClick = async (tab: any) => {
const value = String(tab.paneName || '')
activeName.value = value
queryParams.categoryType = value ? Number(value) : undefined
await getProductList()
handleQuery()
}
@ -369,7 +380,7 @@ onMounted(async () => {
await dictStore.setDictMap()
await getList()
//
productList.value = await ProductApi.getProductSimpleList()
await getProductList()
warehouseList.value = await WarehouseApi.getWarehouseSimpleList()
})
</script>

Loading…
Cancel
Save