@@ -419,6 +430,9 @@ export default {
},
topLoading: false,
bottomLoading: false,
+ pageIndex: 1,
+ pageSize: 50,
+ totalPage: 0,
supplierPartList: [],
selectedSupplierPart: null,
currentTierPriceList: [],
@@ -492,13 +506,19 @@ export default {
const toolbarOuterHeight = toolbarEl
? toolbarRect.height + (parseFloat(toolbarStyle.marginTop) || 0) + (parseFloat(toolbarStyle.marginBottom) || 0)
: 0
+ const paginationEl = pageRootEl.querySelector('.main-pagination')
+ const paginationRect = paginationEl ? paginationEl.getBoundingClientRect() : { height: 0 }
+ const paginationStyle = paginationEl ? window.getComputedStyle(paginationEl) : null
+ const paginationOuterHeight = paginationEl
+ ? paginationRect.height + (parseFloat(paginationStyle.marginTop) || 0) + (parseFloat(paginationStyle.marginBottom) || 0)
+ : 0
const rootStyle = window.getComputedStyle(pageRootEl)
const rootPaddingBottom = parseFloat(rootStyle.paddingBottom) || 0
const topTableTop = topTableEl.getBoundingClientRect().top
// 预留安全边距,避免双表总高度刚好贴边导致轻微超出 - rqrq
const viewportBottomGap = 24
- const tablesAvailableHeight = window.innerHeight - topTableTop - toolbarOuterHeight - rootPaddingBottom - viewportBottomGap
+ const tablesAvailableHeight = window.innerHeight - topTableTop - paginationOuterHeight - toolbarOuterHeight - rootPaddingBottom - viewportBottomGap
const equalHeight = Math.floor(tablesAvailableHeight / 2)
const nextHeight = Number.isFinite(equalHeight) && equalHeight > 120 ? equalHeight : 260
@@ -549,11 +569,16 @@ export default {
partDesc: '',
active: ''
}
+ this.pageIndex = 1
+ this.totalPage = 0
this.supplierPartList = []
this.selectedSupplierPart = null
this.currentTierPriceList = []
},
- searchSupplierPartList () {
+ searchSupplierPartList (resetPage = true) {
+ if (resetPage) {
+ this.pageIndex = 1
+ }
this.topLoading = true
const inData = {
site: this.$store.state.user.site,
@@ -562,14 +587,21 @@ export default {
item: (this.searchData.item || '').trim(),
sku: (this.searchData.sku || '').trim(),
partDesc: (this.searchData.partDesc || '').trim(),
- active: this.searchData.active || ''
+ active: this.searchData.active || '',
+ page: this.pageIndex,
+ limit: this.pageSize
}
listSupplierPartMoq(inData).then(({ data }) => {
if (data && data.code === 0) {
- this.supplierPartList = (data.rows || []).map(item => ({
+ const pageData = data.page || {}
+ const rows = Array.isArray(pageData.list) ? pageData.list : (data.rows || [])
+ this.supplierPartList = rows.map(item => ({
...item,
moq: this.normalizeNumberValue(item.moq, 0)
}))
+ this.pageIndex = Number(pageData.currPage || this.pageIndex || 1)
+ this.pageSize = Number(pageData.pageSize || this.pageSize || 50)
+ this.totalPage = Number(pageData.totalCount || 0)
this.selectedSupplierPart = null
this.currentTierPriceList = []
if (this.supplierPartList.length > 0) {
@@ -578,6 +610,7 @@ export default {
}
} else {
this.supplierPartList = []
+ this.totalPage = 0
this.$alert((data && data.msg) || '查询失败', '错误', { confirmButtonText: '确定' })
}
}).catch(() => {
@@ -586,6 +619,15 @@ export default {
this.topLoading = false
})
},
+ sizeChangeHandle (val) {
+ this.pageSize = val
+ this.pageIndex = 1
+ this.searchSupplierPartList(false)
+ },
+ currentChangeHandle (val) {
+ this.pageIndex = val
+ this.searchSupplierPartList(false)
+ },
handleTopRowClick (row) {
this.selectedSupplierPart = row ? JSON.parse(JSON.stringify(row)) : null
this.loadCurrentTierPrice()
diff --git a/src/views/modules/supplier/supplierPartNewProductAudit.vue b/src/views/modules/supplier/supplierPartNewProductAudit.vue
index f0fec8a..7e47cda 100644
--- a/src/views/modules/supplier/supplierPartNewProductAudit.vue
+++ b/src/views/modules/supplier/supplierPartNewProductAudit.vue
@@ -129,6 +129,17 @@
+
@@ -502,6 +513,9 @@ export default {
mainLoading: false,
auditLoading: false,
testLoading: false,
+ pageIndex: 1,
+ pageSize: 50,
+ totalPage: 0,
supplierPartList: [],
selectedSupplierPart: null,
activeTab: 'audit',
@@ -578,16 +592,22 @@ export default {
const toolbarEl = pageRootEl.querySelector('.table-toolbar')
const tabsHeaderEl = pageRootEl.querySelector('.detail-tabs .el-tabs__header')
const tabToolbarEl = pageRootEl.querySelector('.detail-tabs .tab-toolbar')
+ const paginationEl = pageRootEl.querySelector('.main-pagination')
const toolbarHeight = toolbarEl ? toolbarEl.getBoundingClientRect().height : 0
const tabsHeaderHeight = tabsHeaderEl ? tabsHeaderEl.getBoundingClientRect().height : 40
const tabToolbarHeight = tabToolbarEl ? tabToolbarEl.getBoundingClientRect().height : 40
+ const paginationRect = paginationEl ? paginationEl.getBoundingClientRect() : { height: 0 }
+ const paginationStyle = paginationEl ? window.getComputedStyle(paginationEl) : null
+ const paginationOuterHeight = paginationEl
+ ? paginationRect.height + (parseFloat(paginationStyle.marginTop) || 0) + (parseFloat(paginationStyle.marginBottom) || 0)
+ : 0
const rootStyle = window.getComputedStyle(pageRootEl)
const rootPaddingBottom = parseFloat(rootStyle.paddingBottom) || 0
const topOffset = mainTableEl.getBoundingClientRect().top
const viewportBottomGap = 24
- const availableHeight = window.innerHeight - topOffset - toolbarHeight - rootPaddingBottom - viewportBottomGap
+ const availableHeight = window.innerHeight - topOffset - paginationOuterHeight - toolbarHeight - rootPaddingBottom - viewportBottomGap
const mainHeight = Math.max(220, Math.floor(availableHeight * 0.42))
const detailHeight = Math.max(220, Math.floor(availableHeight - mainHeight - tabsHeaderHeight - tabToolbarHeight - 24))
this.mainTableHeight = mainHeight
@@ -629,13 +649,18 @@ export default {
needNewProductAudit: '',
needSubmitTest: ''
}
+ this.pageIndex = 1
+ this.totalPage = 0
this.supplierPartList = []
this.selectedSupplierPart = null
this.auditRecordList = []
this.testRecordList = []
this.refreshTableLayout()
},
- searchSupplierPartList () {
+ searchSupplierPartList (resetPage = true) {
+ if (resetPage) {
+ this.pageIndex = 1
+ }
const payload = {
site: this.$store.state.user.site,
supplierCode: (this.searchData.supplierCode || '').trim(),
@@ -645,12 +670,18 @@ export default {
partDesc: (this.searchData.partDesc || '').trim(),
newProductAudited: this.searchData.newProductAudited || '',
needNewProductAudit: this.searchData.needNewProductAudit || '',
- needSubmitTest: this.searchData.needSubmitTest || ''
+ needSubmitTest: this.searchData.needSubmitTest || '',
+ page: this.pageIndex,
+ limit: this.pageSize
}
this.mainLoading = true
listNewProductAuditSupplierPart(payload).then(({ data }) => {
if (data && data.code === 0) {
- this.supplierPartList = data.rows || []
+ const pageData = data.page || {}
+ this.supplierPartList = Array.isArray(pageData.list) ? pageData.list : (data.rows || [])
+ this.pageIndex = Number(pageData.currPage || this.pageIndex || 1)
+ this.pageSize = Number(pageData.pageSize || this.pageSize || 50)
+ this.totalPage = Number(pageData.totalCount || 0)
if (!this.supplierPartList.length) {
this.selectedSupplierPart = null
this.auditRecordList = []
@@ -668,6 +699,7 @@ export default {
} else {
this.$message.error((data && data.msg) || '加载供应商可供物料失败')
this.supplierPartList = []
+ this.totalPage = 0
this.selectedSupplierPart = null
this.auditRecordList = []
this.testRecordList = []
@@ -675,6 +707,7 @@ export default {
}).catch(() => {
this.$message.error('加载供应商可供物料失败')
this.supplierPartList = []
+ this.totalPage = 0
this.selectedSupplierPart = null
this.auditRecordList = []
this.testRecordList = []
@@ -683,6 +716,15 @@ export default {
this.refreshTableLayout()
})
},
+ sizeChangeHandle (val) {
+ this.pageSize = val
+ this.pageIndex = 1
+ this.searchSupplierPartList(false)
+ },
+ currentChangeHandle (val) {
+ this.pageIndex = val
+ this.searchSupplierPartList(false)
+ },
handleMainRowClick (row) {
if (!row) return
this.selectedSupplierPart = row
diff --git a/src/views/modules/supplier/supplierPartTierPriceHistory.vue b/src/views/modules/supplier/supplierPartTierPriceHistory.vue
index 80d2be2..f57b2c7 100644
--- a/src/views/modules/supplier/supplierPartTierPriceHistory.vue
+++ b/src/views/modules/supplier/supplierPartTierPriceHistory.vue
@@ -84,6 +84,17 @@
+
@@ -160,6 +171,9 @@ export default {
},
mainLoading: false,
detailLoading: false,
+ pageIndex: 1,
+ pageSize: 50,
+ totalPage: 0,
historyMainList: [],
selectedMain: null,
historyDetailList: [],
@@ -193,13 +207,19 @@ export default {
const toolbarOuterHeight = toolbarEl
? toolbarRect.height + (parseFloat(toolbarStyle.marginTop) || 0) + (parseFloat(toolbarStyle.marginBottom) || 0)
: 0
+ const paginationEl = pageRootEl.querySelector('.main-pagination')
+ const paginationRect = paginationEl ? paginationEl.getBoundingClientRect() : { height: 0 }
+ const paginationStyle = paginationEl ? window.getComputedStyle(paginationEl) : null
+ const paginationOuterHeight = paginationEl
+ ? paginationRect.height + (parseFloat(paginationStyle.marginTop) || 0) + (parseFloat(paginationStyle.marginBottom) || 0)
+ : 0
const rootStyle = window.getComputedStyle(pageRootEl)
const rootPaddingBottom = parseFloat(rootStyle.paddingBottom) || 0
const mainTableTop = mainTableEl.getBoundingClientRect().top
// 预留安全边距,避免双表总高度刚好贴边导致轻微超出 - rqrq
const viewportBottomGap = 24
- const tablesAvailableHeight = window.innerHeight - mainTableTop - toolbarOuterHeight - rootPaddingBottom - viewportBottomGap
+ const tablesAvailableHeight = window.innerHeight - mainTableTop - paginationOuterHeight - toolbarOuterHeight - rootPaddingBottom - viewportBottomGap
const equalHeight = Math.floor(tablesAvailableHeight / 2)
const nextHeight = Number.isFinite(equalHeight) && equalHeight > 120 ? equalHeight : 260
@@ -241,11 +261,16 @@ export default {
sku: '',
priceDate: ''
}
+ this.pageIndex = 1
+ this.totalPage = 0
this.historyMainList = []
this.selectedMain = null
this.historyDetailList = []
},
- searchMainList () {
+ searchMainList (resetPage = true) {
+ if (resetPage) {
+ this.pageIndex = 1
+ }
this.mainLoading = true
const inData = {
site: this.$store.state.user.site,
@@ -253,11 +278,17 @@ export default {
partNo: (this.searchData.partNo || '').trim(),
item: (this.searchData.item || '').trim(),
sku: (this.searchData.sku || '').trim(),
- priceDate: this.searchData.priceDate || ''
+ priceDate: this.searchData.priceDate || '',
+ page: this.pageIndex,
+ limit: this.pageSize
}
listTierPriceHistoryMain(inData).then(({ data }) => {
if (data && data.code === 0) {
- this.historyMainList = data.rows || []
+ const pageData = data.page || {}
+ this.historyMainList = Array.isArray(pageData.list) ? pageData.list : (data.rows || [])
+ this.pageIndex = Number(pageData.currPage || this.pageIndex || 1)
+ this.pageSize = Number(pageData.pageSize || this.pageSize || 50)
+ this.totalPage = Number(pageData.totalCount || 0)
this.selectedMain = null
this.historyDetailList = []
if (this.historyMainList.length > 0) {
@@ -266,6 +297,7 @@ export default {
}
} else {
this.historyMainList = []
+ this.totalPage = 0
this.$alert((data && data.msg) || '查询失败', '错误', { confirmButtonText: '确定' })
}
}).catch(() => {
@@ -275,6 +307,15 @@ export default {
this.mainLoading = false
})
},
+ sizeChangeHandle (val) {
+ this.pageSize = val
+ this.pageIndex = 1
+ this.searchMainList(false)
+ },
+ currentChangeHandle (val) {
+ this.pageIndex = val
+ this.searchMainList(false)
+ },
handleMainRowClick (row) {
this.selectedMain = row ? JSON.parse(JSON.stringify(row)) : null
this.loadDetailList()