style:库存查询-添加库区筛选条件

main
黄伟杰 2 days ago
parent 8525e25d73
commit 6437c0c408

@ -694,6 +694,7 @@ export default {
placeholderProduct: 'Please select product',
placeholderCategory: 'Please select material category',
placeholderWarehouse: 'Please select warehouse',
placeholderArea: 'Please select area',
exportName: 'Product Stock.xls'
},
In: {

@ -694,6 +694,7 @@ export default {
placeholderProduct: '请选择产品',
placeholderCategory: '请选择物料大类',
placeholderWarehouse: '请选择仓库',
placeholderArea: '\u8bf7\u9009\u62e9\u5e93\u533a',
exportName: '产品库存.xls'
},
In: {

@ -35,6 +35,7 @@
filterable
:placeholder="t('ErpStock.Stock.placeholderWarehouse')"
class="!w-240px"
@change="handleWarehouseChange"
>
<el-option
v-for="item in warehouseList"
@ -44,6 +45,23 @@
/>
</el-select>
</el-form-item>
<el-form-item :label="t('ErpStock.Stock.area')" prop="areaId">
<el-select
v-model="queryParams.areaId"
clearable
filterable
:placeholder="t('ErpStock.Stock.placeholderArea')"
class="!w-240px"
:disabled="!queryParams.warehouseId"
>
<el-option
v-for="item in areaList"
:key="item.id"
:label="getAreaLabel(item)"
:value="String(item.id)"
/>
</el-select>
</el-form-item>
<el-form-item>
<el-button @click="handleQuery"><Icon icon="ep:search" class="mr-5px" /> {{ t('common.query') }}</el-button>
<el-button @click="resetQuery"><Icon icon="ep:refresh" class="mr-5px" /> {{ t('common.reset') }}</el-button>
@ -135,11 +153,11 @@
<span v-else>-</span>
</template>
</el-table-column>
<el-table-column :label="t('ErpStock.Stock.totalPackageCount')" align="center" sortable prop="totalPackageCount" min-width="120">
<!-- <el-table-column :label="t('ErpStock.Stock.totalPackageCount')" align="center" sortable prop="totalPackageCount" min-width="120">
<template #default="{ row }">
{{ formatStockCount(row.totalPackageCount) }}
</template>
</el-table-column>
</el-table-column> -->
<el-table-column :label="t('ErpStock.Stock.totalBaseCount')" align="center" sortable prop="totalBaseCount" min-width="120">
<template #default="{ row }">
{{ formatStockCount(row.totalBaseCount) }}
@ -182,6 +200,7 @@ import { DICT_TYPE, getDictObj, getIntDictOptions } from '@/utils/dict'
import { StockApi, StockVO } from '@/api/erp/stock/stock'
import { ProductApi, ProductVO } from '@/api/erp/product/product'
import { WarehouseApi, WarehouseVO } from '@/api/erp/stock/warehouse'
import { WarehouseAreaApi, WarehouseAreaVO } from '@/api/erp/stock/warehousearea'
import { useDictStoreWithOut } from '@/store/modules/dict'
import { formatDate } from '@/utils/formatTime'
import { isHexColor } from '@/utils/color'
@ -212,12 +231,14 @@ const queryParams = reactive<{
pageSize: number
productId?: number
warehouseId?: number
areaId?: string
categoryType?: number
}>({
pageNo: 1,
pageSize: 10,
productId: undefined,
warehouseId: undefined,
areaId: undefined,
categoryType: undefined
})
const queryFormRef = ref() //
@ -225,6 +246,7 @@ const exportLoading = ref(false) // 导出的加载中
const activeName = ref('')
const productList = ref<ProductVO[]>([]) //
const warehouseList = ref<WarehouseVO[]>([]) //
const areaList = ref<WarehouseAreaVO[]>([])
const categoryTypeOptions = computed(() => getIntDictOptions(DICT_TYPE.MATERIAL_CLASSIFICATION_TYPE))
const formatStockCount = (value: number | string | undefined) => {
@ -286,6 +308,26 @@ const getProductList = async () => {
}
}
const getAreaLabel = (area: WarehouseAreaVO) => {
return area.areaName || area.areaCode || String(area.id)
}
const getAreaList = async () => {
if (!queryParams.warehouseId) {
areaList.value = []
return
}
const data = await WarehouseAreaApi.getWarehouseAreaPage({
pageNo: 1,
pageSize: 100,
warehouseId: queryParams.warehouseId
})
areaList.value = data?.list ?? []
if (queryParams.areaId && !areaList.value.some((item) => String(item.id) === String(queryParams.areaId))) {
queryParams.areaId = undefined
}
}
/** 查询列表 */
const getList = async () => {
loading.value = true
@ -310,10 +352,16 @@ const resetQuery = async () => {
queryFormRef.value.resetFields()
activeName.value = ''
queryParams.categoryType = undefined
areaList.value = []
await getProductList()
handleQuery()
}
const handleWarehouseChange = async () => {
queryParams.areaId = undefined
await getAreaList()
}
const handleTabClick = async (tab: any) => {
const value = String(tab.paneName || '')
activeName.value = value
@ -376,6 +424,7 @@ onMounted(async () => {
//
await getProductList()
warehouseList.value = await WarehouseApi.getWarehouseSimpleList()
await getAreaList()
})
onBeforeUnmount(() => {

Loading…
Cancel
Save