|
|
|
@ -129,6 +129,17 @@ |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
</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"> |
|
|
|
@ -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 |
|
|
|
|