Browse Source

更新

master
常熟吴彦祖 3 weeks ago
parent
commit
2640b697fd
  1. 50
      src/views/modules/supplier/supplierPartMoqPrice.vue
  2. 50
      src/views/modules/supplier/supplierPartNewProductAudit.vue
  3. 49
      src/views/modules/supplier/supplierPartTierPriceHistory.vue

50
src/views/modules/supplier/supplierPartMoqPrice.vue

@ -97,6 +97,17 @@
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
<el-pagination
class="main-pagination"
style="margin-top: 6px"
@size-change="sizeChangeHandle"
@current-change="currentChangeHandle"
:current-page="pageIndex"
:page-sizes="[20, 50, 100, 200, 500]"
:page-size="pageSize"
:total="totalPage"
layout="total, sizes, prev, pager, next, jumper"
/>
<div class="table-toolbar"> <div class="table-toolbar">
<span class="selected-text"> <span class="selected-text">
@ -419,6 +430,9 @@ export default {
}, },
topLoading: false, topLoading: false,
bottomLoading: false, bottomLoading: false,
pageIndex: 1,
pageSize: 50,
totalPage: 0,
supplierPartList: [], supplierPartList: [],
selectedSupplierPart: null, selectedSupplierPart: null,
currentTierPriceList: [], currentTierPriceList: [],
@ -492,13 +506,19 @@ export default {
const toolbarOuterHeight = toolbarEl const toolbarOuterHeight = toolbarEl
? toolbarRect.height + (parseFloat(toolbarStyle.marginTop) || 0) + (parseFloat(toolbarStyle.marginBottom) || 0) ? toolbarRect.height + (parseFloat(toolbarStyle.marginTop) || 0) + (parseFloat(toolbarStyle.marginBottom) || 0)
: 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 rootStyle = window.getComputedStyle(pageRootEl)
const rootPaddingBottom = parseFloat(rootStyle.paddingBottom) || 0 const rootPaddingBottom = parseFloat(rootStyle.paddingBottom) || 0
const topTableTop = topTableEl.getBoundingClientRect().top const topTableTop = topTableEl.getBoundingClientRect().top
// - rqrq // - rqrq
const viewportBottomGap = 24 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 equalHeight = Math.floor(tablesAvailableHeight / 2)
const nextHeight = Number.isFinite(equalHeight) && equalHeight > 120 ? equalHeight : 260 const nextHeight = Number.isFinite(equalHeight) && equalHeight > 120 ? equalHeight : 260
@ -549,11 +569,16 @@ export default {
partDesc: '', partDesc: '',
active: '' active: ''
} }
this.pageIndex = 1
this.totalPage = 0
this.supplierPartList = [] this.supplierPartList = []
this.selectedSupplierPart = null this.selectedSupplierPart = null
this.currentTierPriceList = [] this.currentTierPriceList = []
}, },
searchSupplierPartList () {
searchSupplierPartList (resetPage = true) {
if (resetPage) {
this.pageIndex = 1
}
this.topLoading = true this.topLoading = true
const inData = { const inData = {
site: this.$store.state.user.site, site: this.$store.state.user.site,
@ -562,14 +587,21 @@ export default {
item: (this.searchData.item || '').trim(), item: (this.searchData.item || '').trim(),
sku: (this.searchData.sku || '').trim(), sku: (this.searchData.sku || '').trim(),
partDesc: (this.searchData.partDesc || '').trim(), partDesc: (this.searchData.partDesc || '').trim(),
active: this.searchData.active || ''
active: this.searchData.active || '',
page: this.pageIndex,
limit: this.pageSize
} }
listSupplierPartMoq(inData).then(({ data }) => { listSupplierPartMoq(inData).then(({ data }) => {
if (data && data.code === 0) { 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, ...item,
moq: this.normalizeNumberValue(item.moq, 0) 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.selectedSupplierPart = null
this.currentTierPriceList = [] this.currentTierPriceList = []
if (this.supplierPartList.length > 0) { if (this.supplierPartList.length > 0) {
@ -578,6 +610,7 @@ export default {
} }
} else { } else {
this.supplierPartList = [] this.supplierPartList = []
this.totalPage = 0
this.$alert((data && data.msg) || '查询失败', '错误', { confirmButtonText: '确定' }) this.$alert((data && data.msg) || '查询失败', '错误', { confirmButtonText: '确定' })
} }
}).catch(() => { }).catch(() => {
@ -586,6 +619,15 @@ export default {
this.topLoading = false this.topLoading = false
}) })
}, },
sizeChangeHandle (val) {
this.pageSize = val
this.pageIndex = 1
this.searchSupplierPartList(false)
},
currentChangeHandle (val) {
this.pageIndex = val
this.searchSupplierPartList(false)
},
handleTopRowClick (row) { handleTopRowClick (row) {
this.selectedSupplierPart = row ? JSON.parse(JSON.stringify(row)) : null this.selectedSupplierPart = row ? JSON.parse(JSON.stringify(row)) : null
this.loadCurrentTierPrice() this.loadCurrentTierPrice()

50
src/views/modules/supplier/supplierPartNewProductAudit.vue

@ -129,6 +129,17 @@
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
<el-pagination
class="main-pagination"
style="margin-top: 6px"
@size-change="sizeChangeHandle"
@current-change="currentChangeHandle"
:current-page="pageIndex"
:page-sizes="[20, 50, 100, 200, 500]"
:page-size="pageSize"
:total="totalPage"
layout="total, sizes, prev, pager, next, jumper"
/>
<el-tabs v-model="activeTab" class="detail-tabs"> <el-tabs v-model="activeTab" class="detail-tabs">
@ -502,6 +513,9 @@ export default {
mainLoading: false, mainLoading: false,
auditLoading: false, auditLoading: false,
testLoading: false, testLoading: false,
pageIndex: 1,
pageSize: 50,
totalPage: 0,
supplierPartList: [], supplierPartList: [],
selectedSupplierPart: null, selectedSupplierPart: null,
activeTab: 'audit', activeTab: 'audit',
@ -578,16 +592,22 @@ export default {
const toolbarEl = pageRootEl.querySelector('.table-toolbar') const toolbarEl = pageRootEl.querySelector('.table-toolbar')
const tabsHeaderEl = pageRootEl.querySelector('.detail-tabs .el-tabs__header') const tabsHeaderEl = pageRootEl.querySelector('.detail-tabs .el-tabs__header')
const tabToolbarEl = pageRootEl.querySelector('.detail-tabs .tab-toolbar') const tabToolbarEl = pageRootEl.querySelector('.detail-tabs .tab-toolbar')
const paginationEl = pageRootEl.querySelector('.main-pagination')
const toolbarHeight = toolbarEl ? toolbarEl.getBoundingClientRect().height : 0 const toolbarHeight = toolbarEl ? toolbarEl.getBoundingClientRect().height : 0
const tabsHeaderHeight = tabsHeaderEl ? tabsHeaderEl.getBoundingClientRect().height : 40 const tabsHeaderHeight = tabsHeaderEl ? tabsHeaderEl.getBoundingClientRect().height : 40
const tabToolbarHeight = tabToolbarEl ? tabToolbarEl.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 rootStyle = window.getComputedStyle(pageRootEl)
const rootPaddingBottom = parseFloat(rootStyle.paddingBottom) || 0 const rootPaddingBottom = parseFloat(rootStyle.paddingBottom) || 0
const topOffset = mainTableEl.getBoundingClientRect().top const topOffset = mainTableEl.getBoundingClientRect().top
const viewportBottomGap = 24 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 mainHeight = Math.max(220, Math.floor(availableHeight * 0.42))
const detailHeight = Math.max(220, Math.floor(availableHeight - mainHeight - tabsHeaderHeight - tabToolbarHeight - 24)) const detailHeight = Math.max(220, Math.floor(availableHeight - mainHeight - tabsHeaderHeight - tabToolbarHeight - 24))
this.mainTableHeight = mainHeight this.mainTableHeight = mainHeight
@ -629,13 +649,18 @@ export default {
needNewProductAudit: '', needNewProductAudit: '',
needSubmitTest: '' needSubmitTest: ''
} }
this.pageIndex = 1
this.totalPage = 0
this.supplierPartList = [] this.supplierPartList = []
this.selectedSupplierPart = null this.selectedSupplierPart = null
this.auditRecordList = [] this.auditRecordList = []
this.testRecordList = [] this.testRecordList = []
this.refreshTableLayout() this.refreshTableLayout()
}, },
searchSupplierPartList () {
searchSupplierPartList (resetPage = true) {
if (resetPage) {
this.pageIndex = 1
}
const payload = { const payload = {
site: this.$store.state.user.site, site: this.$store.state.user.site,
supplierCode: (this.searchData.supplierCode || '').trim(), supplierCode: (this.searchData.supplierCode || '').trim(),
@ -645,12 +670,18 @@ export default {
partDesc: (this.searchData.partDesc || '').trim(), partDesc: (this.searchData.partDesc || '').trim(),
newProductAudited: this.searchData.newProductAudited || '', newProductAudited: this.searchData.newProductAudited || '',
needNewProductAudit: this.searchData.needNewProductAudit || '', needNewProductAudit: this.searchData.needNewProductAudit || '',
needSubmitTest: this.searchData.needSubmitTest || ''
needSubmitTest: this.searchData.needSubmitTest || '',
page: this.pageIndex,
limit: this.pageSize
} }
this.mainLoading = true this.mainLoading = true
listNewProductAuditSupplierPart(payload).then(({ data }) => { listNewProductAuditSupplierPart(payload).then(({ data }) => {
if (data && data.code === 0) { 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) { if (!this.supplierPartList.length) {
this.selectedSupplierPart = null this.selectedSupplierPart = null
this.auditRecordList = [] this.auditRecordList = []
@ -668,6 +699,7 @@ export default {
} else { } else {
this.$message.error((data && data.msg) || '加载供应商可供物料失败') this.$message.error((data && data.msg) || '加载供应商可供物料失败')
this.supplierPartList = [] this.supplierPartList = []
this.totalPage = 0
this.selectedSupplierPart = null this.selectedSupplierPart = null
this.auditRecordList = [] this.auditRecordList = []
this.testRecordList = [] this.testRecordList = []
@ -675,6 +707,7 @@ export default {
}).catch(() => { }).catch(() => {
this.$message.error('加载供应商可供物料失败') this.$message.error('加载供应商可供物料失败')
this.supplierPartList = [] this.supplierPartList = []
this.totalPage = 0
this.selectedSupplierPart = null this.selectedSupplierPart = null
this.auditRecordList = [] this.auditRecordList = []
this.testRecordList = [] this.testRecordList = []
@ -683,6 +716,15 @@ export default {
this.refreshTableLayout() this.refreshTableLayout()
}) })
}, },
sizeChangeHandle (val) {
this.pageSize = val
this.pageIndex = 1
this.searchSupplierPartList(false)
},
currentChangeHandle (val) {
this.pageIndex = val
this.searchSupplierPartList(false)
},
handleMainRowClick (row) { handleMainRowClick (row) {
if (!row) return if (!row) return
this.selectedSupplierPart = row this.selectedSupplierPart = row

49
src/views/modules/supplier/supplierPartTierPriceHistory.vue

@ -84,6 +84,17 @@
<el-table-column prop="priceDate" label="价格日期" min-width="120" header-align="center" align="center" /> <el-table-column prop="priceDate" label="价格日期" min-width="120" header-align="center" align="center" />
<el-table-column prop="submitBy" label="提交人" min-width="100" header-align="center" align="center" /> <el-table-column prop="submitBy" label="提交人" min-width="100" header-align="center" align="center" />
</el-table> </el-table>
<el-pagination
class="main-pagination"
style="margin-top: 6px"
@size-change="sizeChangeHandle"
@current-change="currentChangeHandle"
:current-page="pageIndex"
:page-sizes="[20, 50, 100, 200, 500]"
:page-size="pageSize"
:total="totalPage"
layout="total, sizes, prev, pager, next, jumper"
/>
<div class="table-toolbar"> <div class="table-toolbar">
<span class="selected-text"> <span class="selected-text">
@ -160,6 +171,9 @@ export default {
}, },
mainLoading: false, mainLoading: false,
detailLoading: false, detailLoading: false,
pageIndex: 1,
pageSize: 50,
totalPage: 0,
historyMainList: [], historyMainList: [],
selectedMain: null, selectedMain: null,
historyDetailList: [], historyDetailList: [],
@ -193,13 +207,19 @@ export default {
const toolbarOuterHeight = toolbarEl const toolbarOuterHeight = toolbarEl
? toolbarRect.height + (parseFloat(toolbarStyle.marginTop) || 0) + (parseFloat(toolbarStyle.marginBottom) || 0) ? toolbarRect.height + (parseFloat(toolbarStyle.marginTop) || 0) + (parseFloat(toolbarStyle.marginBottom) || 0)
: 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 rootStyle = window.getComputedStyle(pageRootEl)
const rootPaddingBottom = parseFloat(rootStyle.paddingBottom) || 0 const rootPaddingBottom = parseFloat(rootStyle.paddingBottom) || 0
const mainTableTop = mainTableEl.getBoundingClientRect().top const mainTableTop = mainTableEl.getBoundingClientRect().top
// - rqrq // - rqrq
const viewportBottomGap = 24 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 equalHeight = Math.floor(tablesAvailableHeight / 2)
const nextHeight = Number.isFinite(equalHeight) && equalHeight > 120 ? equalHeight : 260 const nextHeight = Number.isFinite(equalHeight) && equalHeight > 120 ? equalHeight : 260
@ -241,11 +261,16 @@ export default {
sku: '', sku: '',
priceDate: '' priceDate: ''
} }
this.pageIndex = 1
this.totalPage = 0
this.historyMainList = [] this.historyMainList = []
this.selectedMain = null this.selectedMain = null
this.historyDetailList = [] this.historyDetailList = []
}, },
searchMainList () {
searchMainList (resetPage = true) {
if (resetPage) {
this.pageIndex = 1
}
this.mainLoading = true this.mainLoading = true
const inData = { const inData = {
site: this.$store.state.user.site, site: this.$store.state.user.site,
@ -253,11 +278,17 @@ export default {
partNo: (this.searchData.partNo || '').trim(), partNo: (this.searchData.partNo || '').trim(),
item: (this.searchData.item || '').trim(), item: (this.searchData.item || '').trim(),
sku: (this.searchData.sku || '').trim(), sku: (this.searchData.sku || '').trim(),
priceDate: this.searchData.priceDate || ''
priceDate: this.searchData.priceDate || '',
page: this.pageIndex,
limit: this.pageSize
} }
listTierPriceHistoryMain(inData).then(({ data }) => { listTierPriceHistoryMain(inData).then(({ data }) => {
if (data && data.code === 0) { 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.selectedMain = null
this.historyDetailList = [] this.historyDetailList = []
if (this.historyMainList.length > 0) { if (this.historyMainList.length > 0) {
@ -266,6 +297,7 @@ export default {
} }
} else { } else {
this.historyMainList = [] this.historyMainList = []
this.totalPage = 0
this.$alert((data && data.msg) || '查询失败', '错误', { confirmButtonText: '确定' }) this.$alert((data && data.msg) || '查询失败', '错误', { confirmButtonText: '确定' })
} }
}).catch(() => { }).catch(() => {
@ -275,6 +307,15 @@ export default {
this.mainLoading = false this.mainLoading = false
}) })
}, },
sizeChangeHandle (val) {
this.pageSize = val
this.pageIndex = 1
this.searchMainList(false)
},
currentChangeHandle (val) {
this.pageIndex = val
this.searchMainList(false)
},
handleMainRowClick (row) { handleMainRowClick (row) {
this.selectedMain = row ? JSON.parse(JSON.stringify(row)) : null this.selectedMain = row ? JSON.parse(JSON.stringify(row)) : null
this.loadDetailList() this.loadDetailList()

Loading…
Cancel
Save