|
|
|
|
@ -65,7 +65,7 @@
|
|
|
|
|
<el-tab-pane v-for="item in categoryTypeOptions" :key="item.value" :label="item.label"
|
|
|
|
|
:name="String(item.value)" />
|
|
|
|
|
</el-tabs>
|
|
|
|
|
<el-table v-loading="loading" :data="list" :stripe="true" :show-overflow-tooltip="true" row-key="id"
|
|
|
|
|
<el-table ref="tableRef" v-loading="loading" :data="list" :stripe="true" :show-overflow-tooltip="true" :max-height="planTableMaxHeight" row-key="id"
|
|
|
|
|
@selection-change="handleSelectionChange">
|
|
|
|
|
<el-table-column width="30" :label="t('action.select')" type="selection" />
|
|
|
|
|
<el-table-column :label="t('ErpStock.Record.bizNo')" align="center" prop="bizNo" min-width="180" sortable />
|
|
|
|
|
@ -130,6 +130,18 @@ const dictStore = useDictStoreWithOut()
|
|
|
|
|
const loading = ref(true) // 列表的加载中
|
|
|
|
|
const list = ref<StockRecordVO[]>([]) // 列表的数据
|
|
|
|
|
const total = ref(0) // 列表的总页数
|
|
|
|
|
const tableRef = ref()
|
|
|
|
|
const planTableMaxHeight = ref(520)
|
|
|
|
|
const planPaginationRef = ref<HTMLElement>()
|
|
|
|
|
|
|
|
|
|
const updatePlanTableMaxHeight = async () => {
|
|
|
|
|
await nextTick()
|
|
|
|
|
const tableTop = tableRef.value?.$el?.getBoundingClientRect().top ?? 0
|
|
|
|
|
const paginationHeight = planPaginationRef.value?.getBoundingClientRect().height ?? 72
|
|
|
|
|
const pageBottomGap = 56
|
|
|
|
|
const availableHeight = window.innerHeight - tableTop - paginationHeight - pageBottomGap
|
|
|
|
|
planTableMaxHeight.value = Math.min(window.innerHeight, Math.max(240, Math.floor(availableHeight)))
|
|
|
|
|
}
|
|
|
|
|
const queryParams = reactive<{
|
|
|
|
|
pageNo: number
|
|
|
|
|
pageSize: number
|
|
|
|
|
@ -156,6 +168,7 @@ const activeName = ref('')
|
|
|
|
|
const filterCount = 5
|
|
|
|
|
const toggleFilters = () => {
|
|
|
|
|
showAllFilters.value = !showAllFilters.value
|
|
|
|
|
updatePlanTableMaxHeight()
|
|
|
|
|
}
|
|
|
|
|
const productList = ref<ProductVO[]>([]) // 产品列表
|
|
|
|
|
const warehouseList = ref<WarehouseVO[]>([]) // 仓库列表
|
|
|
|
|
@ -212,6 +225,7 @@ const getList = async () => {
|
|
|
|
|
total.value = data.total
|
|
|
|
|
} finally {
|
|
|
|
|
loading.value = false
|
|
|
|
|
updatePlanTableMaxHeight()
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@ -289,10 +303,16 @@ onActivated(() => {
|
|
|
|
|
onMounted(async () => {
|
|
|
|
|
await dictStore.setDictMap()
|
|
|
|
|
await getList()
|
|
|
|
|
updatePlanTableMaxHeight()
|
|
|
|
|
window.addEventListener('resize', updatePlanTableMaxHeight)
|
|
|
|
|
// 加载产品、仓库列表
|
|
|
|
|
productList.value = await ProductApi.getProductSimpleList()
|
|
|
|
|
warehouseList.value = await WarehouseApi.getWarehouseSimpleList()
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
onBeforeUnmount(() => {
|
|
|
|
|
window.removeEventListener('resize', updatePlanTableMaxHeight)
|
|
|
|
|
})
|
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
<style scoped lang="scss">
|
|
|
|
|
|