feat:出入库明细-列表tabs去除

main
黄伟杰 7 days ago
parent f970ef7daf
commit f59c04387a

@ -564,6 +564,7 @@
bizNo: 'Business No',
bizDirection: 'Direction',
categoryType: 'Business Type',
materialCategory: 'Material Category',
productId: 'Product ID',
warehouseId: 'Warehouse ID',
areaId: 'Area ID',
@ -587,6 +588,7 @@
createTime: 'Create Date',
creatorName: 'Operator',
placeholderProduct: 'Please select product',
placeholderMaterialCategory: 'Please select material category',
placeholderWarehouse: 'Please select warehouse',
placeholderBizType: 'Please select type',
placeholderBizNo: 'Please input business no',

@ -564,6 +564,7 @@
bizNo: '业务单号',
bizDirection: '方向',
categoryType: '业务类型',
materialCategory: '物料大类',
productId: '产品编号',
warehouseId: '仓库编号',
areaId: '库区编号',
@ -587,6 +588,7 @@
createTime: '创建日期',
creatorName: '操作人',
placeholderProduct: '请选择产品',
placeholderMaterialCategory: '请选择物料大类',
placeholderWarehouse: '请选择仓库',
placeholderBizType: '请选择类型',
placeholderBizNo: '请输入业务单号',

@ -42,6 +42,21 @@
/>
</el-select>
</el-form-item>
<el-form-item :label="t('ErpStock.Record.materialCategory')" prop="categoryType">
<el-select
v-model="queryParams.categoryType"
clearable
:placeholder="t('ErpStock.Record.placeholderMaterialCategory')"
class="!w-240px"
>
<el-option
v-for="item in categoryTypeOptions"
:key="item.value"
:label="item.label"
:value="item.value"
/>
</el-select>
</el-form-item>
<el-form-item :label="t('ErpStock.Record.bizType')" prop="bizType">
<el-select
v-model="queryParams.bizType"
@ -110,15 +125,6 @@
<!-- 列表 -->
<ContentWrap>
<el-tabs v-model="activeName" @tab-click="handleTabClick">
<el-tab-pane
v-for="item in categoryTabs"
:key="String(item.value)"
:label="item.label"
:name="String(item.value)"
/>
</el-tabs>
<el-table
v-loading="loading"
:data="list"
@ -139,6 +145,11 @@
</el-table-column>
<el-table-column :label="t('ErpStock.Record.categoryType')" align="center" prop="bizDocType" min-width="120" sortable />
<el-table-column :label="t('ErpStock.Record.productName')" align="center" sortable prop="productName" min-width="160" />
<el-table-column :label="t('ErpStock.Record.materialCategory')" align="center" prop="categoryType" min-width="120" sortable>
<template #default="scope">
<dict-tag :type="DICT_TYPE.MATERIAL_CLASSIFICATION_TYPE" :value="scope.row.categoryType" />
</template>
</el-table-column>
<el-table-column :label="t('ErpStock.Record.categoryName')" align="center" prop="categoryName" min-width="120" sortable />
<el-table-column :label="t('ErpStock.Record.warehouseName')" align="center" prop="warehouseName" min-width="140" sortable />
<el-table-column :label="t('ErpStock.Record.areaName')" align="center" prop="areaName" min-width="120" sortable />
@ -234,7 +245,7 @@ const toggleFilters = () => {
}
const productList = ref<ProductVO[]>([]) //
const warehouseList = ref<WarehouseVO[]>([]) //
const categoryTabs = computed(() => getIntDictOptions(DICT_TYPE.MATERIAL_CLASSIFICATION_TYPE))
const categoryTypeOptions = computed(() => getIntDictOptions(DICT_TYPE.MATERIAL_CLASSIFICATION_TYPE))
const isStockIn = (direction?: string) => direction === '入库'
const isStockOut = (direction?: string) => direction === '出库'
@ -271,11 +282,17 @@ const formatCountWithUnit = (row: StockRecordVO, withDirectionSign = false) => {
return `${formatNumber(value)}${unit}`
}
const buildQueryParams = () => {
return Object.fromEntries(
Object.entries(queryParams).filter(([, value]) => value !== undefined && value !== null && value !== '')
)
}
/** 查询列表 */
const getList = async () => {
loading.value = true
try {
const data = await StockRecordApi.getStockRecordPage(queryParams)
const data = await StockRecordApi.getStockRecordPage(buildQueryParams())
list.value = data.list
total.value = data.total
} finally {
@ -323,7 +340,7 @@ const handleExport = async () => {
exportLoading.value = true
const ids = selectionList.value.map((item) => item.id).filter((v) => v != null)
const params = {
...queryParams,
...buildQueryParams(),
ids: ids.length ? ids.join(',') : undefined
}
const data = await StockRecordApi.exportStockRecord(params)
@ -347,25 +364,11 @@ onActivated(() => {
onMounted(async () => {
await dictStore.setDictMap()
await loadCategoryTabs()
await getList()
//
productList.value = await ProductApi.getProductSimpleList()
warehouseList.value = await WarehouseApi.getWarehouseSimpleList()
})
/** tab 切换 */
const activeName = ref('')
const handleTabClick = (tab: TabsPaneContext) => {
queryParams.categoryType = tab.paneName ? Number(tab.paneName) : undefined
handleQuery()
}
const loadCategoryTabs = async () => {
const defaultValue = categoryTabs.value[0]?.value
queryParams.categoryType = defaultValue !== undefined && defaultValue !== null ? Number(defaultValue) : undefined
activeName.value = defaultValue !== undefined && defaultValue !== null ? String(defaultValue) : ''
}
</script>
<style scoped lang="scss">

Loading…
Cancel
Save