diff --git a/src/views/erp/product/product/index.vue b/src/views/erp/product/product/index.vue index 008a64c8..c9213789 100644 --- a/src/views/erp/product/product/index.vue +++ b/src/views/erp/product/product/index.vue @@ -82,7 +82,7 @@
- + @@ -329,6 +329,18 @@ const { t } = useI18n() const loading = ref(true) const list = ref([]) const total = ref(0) +const tableRef = ref() +const planTableMaxHeight = ref(520) +const planPaginationRef = ref() + +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: 1, pageSize: 10, @@ -420,6 +432,7 @@ const getList = async () => { } } finally { loading.value = false + updatePlanTableMaxHeight() } } @@ -475,6 +488,12 @@ onMounted(async () => { queryParams.categoryType = typeOptions[0].value } await getList() + updatePlanTableMaxHeight() + window.addEventListener('resize', updatePlanTableMaxHeight) +}) + +onBeforeUnmount(() => { + window.removeEventListener('resize', updatePlanTableMaxHeight) }) const bomFormRef = ref() diff --git a/src/views/erp/purchase/supplier/index.vue b/src/views/erp/purchase/supplier/index.vue index f0b086c6..2af7fd6a 100644 --- a/src/views/erp/purchase/supplier/index.vue +++ b/src/views/erp/purchase/supplier/index.vue @@ -63,7 +63,7 @@ - + @@ -126,6 +126,18 @@ const { t } = useI18n() // 国际化 const loading = ref(true) // 列表的加载中 const list = ref([]) // 列表的数据 const total = ref(0) // 列表的总页数 +const tableRef = ref() +const planTableMaxHeight = ref(520) +const planPaginationRef = ref() + +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: 1, pageSize: 10, @@ -145,6 +157,7 @@ const getList = async () => { total.value = data.total } finally { loading.value = false + updatePlanTableMaxHeight() } } @@ -197,5 +210,11 @@ const handleExport = async () => { /** 初始化 **/ onMounted(() => { getList() + updatePlanTableMaxHeight() + window.addEventListener('resize', updatePlanTableMaxHeight) +}) + +onBeforeUnmount(() => { + window.removeEventListener('resize', updatePlanTableMaxHeight) }) diff --git a/src/views/erp/stock/checkExecution/index.vue b/src/views/erp/stock/checkExecution/index.vue index 686a2d9b..081bb9e1 100644 --- a/src/views/erp/stock/checkExecution/index.vue +++ b/src/views/erp/stock/checkExecution/index.vue @@ -90,9 +90,11 @@ @@ -278,6 +280,18 @@ const message = useMessage() const loading = ref(false) const list = ref([]) const total = ref(0) +const tableRef = ref() +const planTableMaxHeight = ref(520) +const planPaginationRef = ref() + +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 warehouseList = ref([]) const selectionList = ref([]) const queryFormRef = ref() @@ -319,6 +333,7 @@ const getList = async () => { total.value = data?.total || 0 } finally { loading.value = false + updatePlanTableMaxHeight() } } @@ -455,5 +470,11 @@ onMounted(async () => { ]) warehouseList.value = warehouses || [] await getList() + updatePlanTableMaxHeight() + window.addEventListener('resize', updatePlanTableMaxHeight) +}) + +onBeforeUnmount(() => { + window.removeEventListener('resize', updatePlanTableMaxHeight) }) diff --git a/src/views/erp/stock/checkRecord/index.vue b/src/views/erp/stock/checkRecord/index.vue index 2e520c29..272534ea 100644 --- a/src/views/erp/stock/checkRecord/index.vue +++ b/src/views/erp/stock/checkRecord/index.vue @@ -156,10 +156,12 @@ @@ -250,6 +252,18 @@ const dictStore = useDictStoreWithOut() const loading = ref(false) const list = ref([]) const total = ref(0) +const tableRef = ref() +const planTableMaxHeight = ref(520) +const planPaginationRef = ref() + +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 queryFormRef = ref() const productList = ref([]) const warehouseList = ref([]) @@ -283,6 +297,7 @@ const filteredAreaList = computed(() => { const toggleFilters = () => { showAllFilters.value = !showAllFilters.value + updatePlanTableMaxHeight() } const buildQueryParams = () => { @@ -302,6 +317,7 @@ const getList = async () => { total.value = data?.total || 0 } finally { loading.value = false + updatePlanTableMaxHeight() } } @@ -414,6 +430,12 @@ onMounted(async () => { }) ]) await getList() + updatePlanTableMaxHeight() + window.addEventListener('resize', updatePlanTableMaxHeight) +}) + +onBeforeUnmount(() => { + window.removeEventListener('resize', updatePlanTableMaxHeight) }) diff --git a/src/views/erp/stock/in/index.vue b/src/views/erp/stock/in/index.vue index c00db095..1e0851d1 100644 --- a/src/views/erp/stock/in/index.vue +++ b/src/views/erp/stock/in/index.vue @@ -157,10 +157,12 @@ @@ -337,6 +339,18 @@ const { t } = useI18n() // 国际化 const loading = ref(true) // 列表的加载中 const list = ref([]) // 列表的数据 const total = ref(0) // 列表的总页数 +const tableRef = ref() +const planTableMaxHeight = ref(520) +const planPaginationRef = ref() + +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: 1, pageSize: 10, @@ -367,6 +381,7 @@ const useInitialStatusFilter = ref(true) const filterCount = 7 const toggleFilters = () => { showAllFilters.value = !showAllFilters.value + updatePlanTableMaxHeight() } const productList = ref([]) // 产品列表 const warehouseList = ref([]) // 仓库列表 @@ -413,6 +428,7 @@ const getList = async () => { total.value = data.total } finally { loading.value = false + updatePlanTableMaxHeight() } } @@ -568,12 +584,18 @@ watch(stockInTypeOptions, (options) => { onMounted(async () => { syncDefaultInType() await getList() + updatePlanTableMaxHeight() + window.addEventListener('resize', updatePlanTableMaxHeight) // 加载产品、仓库列表、供应商 productList.value = await ProductApi.getProductSimpleList() warehouseList.value = await WarehouseApi.getWarehouseSimpleList() supplierList.value = await SupplierApi.getSupplierSimpleList() userList.value = await UserApi.getSimpleUserList() }) + +onBeforeUnmount(() => { + window.removeEventListener('resize', updatePlanTableMaxHeight) +}) const handleTabClick = (tab: TabsPaneContext) => { queryParams.inType = String(tab.paneName || '') activeName.value = queryParams.inType diff --git a/src/views/erp/stock/move/index.vue b/src/views/erp/stock/move/index.vue index f679981d..2e566f78 100644 --- a/src/views/erp/stock/move/index.vue +++ b/src/views/erp/stock/move/index.vue @@ -132,10 +132,12 @@ @@ -298,6 +300,18 @@ const { t } = useI18n() // 国际化 const loading = ref(true) // 列表的加载中 const list = ref([]) // 列表的数据 const total = ref(0) // 列表的总页数 +const tableRef = ref() +const planTableMaxHeight = ref(520) +const planPaginationRef = ref() + +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: 1, pageSize: 10, @@ -351,6 +365,7 @@ const getList = async () => { total.value = data.total } finally { loading.value = false + updatePlanTableMaxHeight() } } @@ -474,11 +489,17 @@ const handleSelectionChange = (rows: StockMoveVO[]) => { /** 初始化 **/ onMounted(async () => { await getList() + updatePlanTableMaxHeight() + window.addEventListener('resize', updatePlanTableMaxHeight) // 加载产品、仓库列表、客户 productList.value = await ProductApi.getProductSimpleList() warehouseList.value = await WarehouseApi.getWarehouseSimpleList() userList.value = await UserApi.getSimpleUserList() }) + +onBeforeUnmount(() => { + window.removeEventListener('resize', updatePlanTableMaxHeight) +}) // TODO 芋艿:可优化功能:列表界面,支持导入 // TODO 芋艿:可优化功能:详情界面,支持打印 diff --git a/src/views/erp/stock/out/index.vue b/src/views/erp/stock/out/index.vue index 948b41de..273106f0 100644 --- a/src/views/erp/stock/out/index.vue +++ b/src/views/erp/stock/out/index.vue @@ -157,10 +157,12 @@ @@ -336,6 +338,18 @@ const { t } = useI18n() // 鍥介檯鍖? const loading = ref(true) // 鍒楄〃鐨勫姞杞戒腑 const list = ref([]) // 鍒楄〃鐨勬暟鎹? const total = ref(0) // 鍒楄〃鐨勬€婚〉鏁? +const tableRef = ref() +const planTableMaxHeight = ref(520) +const planPaginationRef = ref() + +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: 1, pageSize: 10, @@ -367,6 +381,7 @@ const useInitialStatusFilter = ref(true) const filterCount = 7 const toggleFilters = () => { showAllFilters.value = !showAllFilters.value + updatePlanTableMaxHeight() } const productList = ref([]) // 浜у搧鍒楄〃 const warehouseList = ref([]) // 浠撳簱鍒楄〃 @@ -412,6 +427,7 @@ const getList = async () => { total.value = data.total } finally { loading.value = false + updatePlanTableMaxHeight() } } @@ -566,11 +582,17 @@ watch(stockOutTypeOptions, (options) => { onMounted(async () => { syncDefaultOutType() await getList() + updatePlanTableMaxHeight() + window.addEventListener('resize', updatePlanTableMaxHeight) // 鍔犺浇浜у搧銆佷粨搴撳垪琛ㄣ€佷緵搴斿晢 productList.value = await ProductApi.getProductSimpleList() warehouseList.value = await WarehouseApi.getWarehouseSimpleList() userList.value = await UserApi.getSimpleUserList() }) + +onBeforeUnmount(() => { + window.removeEventListener('resize', updatePlanTableMaxHeight) +}) const handleTabClick = (tab: TabsPaneContext) => { queryParams.outType = String(tab.paneName || '') activeName.value = queryParams.outType diff --git a/src/views/erp/stock/packagingSolution/index.vue b/src/views/erp/stock/packagingSolution/index.vue index 121a067f..489208a3 100644 --- a/src/views/erp/stock/packagingSolution/index.vue +++ b/src/views/erp/stock/packagingSolution/index.vue @@ -60,10 +60,12 @@ @@ -133,6 +135,18 @@ const { t } = useI18n() const loading = ref(true) const list = ref([]) const total = ref(0) +const tableRef = ref() +const planTableMaxHeight = ref(520) +const planPaginationRef = ref() + +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: 1, pageSize: 10, @@ -151,6 +165,7 @@ const getList = async () => { total.value = data.total } finally { loading.value = false + updatePlanTableMaxHeight() } } @@ -185,5 +200,11 @@ const handleDelete = async (id: number) => { /** 初始化 **/ onMounted(() => { getList() + updatePlanTableMaxHeight() + window.addEventListener('resize', updatePlanTableMaxHeight) +}) + +onBeforeUnmount(() => { + window.removeEventListener('resize', updatePlanTableMaxHeight) }) diff --git a/src/views/erp/stock/pallet/index.vue b/src/views/erp/stock/pallet/index.vue index e82ba818..1e5733b5 100644 --- a/src/views/erp/stock/pallet/index.vue +++ b/src/views/erp/stock/pallet/index.vue @@ -57,7 +57,7 @@ - +