|
|
|
@ -157,10 +157,12 @@
|
|
|
|
</el-tabs>
|
|
|
|
</el-tabs>
|
|
|
|
|
|
|
|
|
|
|
|
<el-table
|
|
|
|
<el-table
|
|
|
|
|
|
|
|
ref="tableRef"
|
|
|
|
v-loading="loading"
|
|
|
|
v-loading="loading"
|
|
|
|
:data="list"
|
|
|
|
:data="list"
|
|
|
|
:stripe="true"
|
|
|
|
:stripe="true"
|
|
|
|
:show-overflow-tooltip="true"
|
|
|
|
:show-overflow-tooltip="true"
|
|
|
|
|
|
|
|
:max-height="planTableMaxHeight"
|
|
|
|
@selection-change="handleSelectionChange"
|
|
|
|
@selection-change="handleSelectionChange"
|
|
|
|
>
|
|
|
|
>
|
|
|
|
<el-table-column width="30" :label="t('common.select')" type="selection" />
|
|
|
|
<el-table-column width="30" :label="t('common.select')" type="selection" />
|
|
|
|
@ -337,6 +339,18 @@ const { t } = useI18n() // 国际化
|
|
|
|
const loading = ref(true) // 列表的加载中
|
|
|
|
const loading = ref(true) // 列表的加载中
|
|
|
|
const list = ref<StockInVO[]>([]) // 列表的数据
|
|
|
|
const list = ref<StockInVO[]>([]) // 列表的数据
|
|
|
|
const total = ref(0) // 列表的总页数
|
|
|
|
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({
|
|
|
|
const queryParams = reactive({
|
|
|
|
pageNo: 1,
|
|
|
|
pageNo: 1,
|
|
|
|
pageSize: 10,
|
|
|
|
pageSize: 10,
|
|
|
|
@ -367,6 +381,7 @@ const useInitialStatusFilter = ref(true)
|
|
|
|
const filterCount = 7
|
|
|
|
const filterCount = 7
|
|
|
|
const toggleFilters = () => {
|
|
|
|
const toggleFilters = () => {
|
|
|
|
showAllFilters.value = !showAllFilters.value
|
|
|
|
showAllFilters.value = !showAllFilters.value
|
|
|
|
|
|
|
|
updatePlanTableMaxHeight()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
const productList = ref<ProductVO[]>([]) // 产品列表
|
|
|
|
const productList = ref<ProductVO[]>([]) // 产品列表
|
|
|
|
const warehouseList = ref<WarehouseVO[]>([]) // 仓库列表
|
|
|
|
const warehouseList = ref<WarehouseVO[]>([]) // 仓库列表
|
|
|
|
@ -413,6 +428,7 @@ const getList = async () => {
|
|
|
|
total.value = data.total
|
|
|
|
total.value = data.total
|
|
|
|
} finally {
|
|
|
|
} finally {
|
|
|
|
loading.value = false
|
|
|
|
loading.value = false
|
|
|
|
|
|
|
|
updatePlanTableMaxHeight()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@ -568,12 +584,18 @@ watch(stockInTypeOptions, (options) => {
|
|
|
|
onMounted(async () => {
|
|
|
|
onMounted(async () => {
|
|
|
|
syncDefaultInType()
|
|
|
|
syncDefaultInType()
|
|
|
|
await getList()
|
|
|
|
await getList()
|
|
|
|
|
|
|
|
updatePlanTableMaxHeight()
|
|
|
|
|
|
|
|
window.addEventListener('resize', updatePlanTableMaxHeight)
|
|
|
|
// 加载产品、仓库列表、供应商
|
|
|
|
// 加载产品、仓库列表、供应商
|
|
|
|
productList.value = await ProductApi.getProductSimpleList()
|
|
|
|
productList.value = await ProductApi.getProductSimpleList()
|
|
|
|
warehouseList.value = await WarehouseApi.getWarehouseSimpleList()
|
|
|
|
warehouseList.value = await WarehouseApi.getWarehouseSimpleList()
|
|
|
|
supplierList.value = await SupplierApi.getSupplierSimpleList()
|
|
|
|
supplierList.value = await SupplierApi.getSupplierSimpleList()
|
|
|
|
userList.value = await UserApi.getSimpleUserList()
|
|
|
|
userList.value = await UserApi.getSimpleUserList()
|
|
|
|
})
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
onBeforeUnmount(() => {
|
|
|
|
|
|
|
|
window.removeEventListener('resize', updatePlanTableMaxHeight)
|
|
|
|
|
|
|
|
})
|
|
|
|
const handleTabClick = (tab: TabsPaneContext) => {
|
|
|
|
const handleTabClick = (tab: TabsPaneContext) => {
|
|
|
|
queryParams.inType = String(tab.paneName || '')
|
|
|
|
queryParams.inType = String(tab.paneName || '')
|
|
|
|
activeName.value = queryParams.inType
|
|
|
|
activeName.value = queryParams.inType
|
|
|
|
|