|
|
|
@ -189,9 +189,10 @@ |
|
|
|
</el-form> |
|
|
|
<el-table |
|
|
|
ref="caseTable" |
|
|
|
:data="casesPagedList" |
|
|
|
:data="casesPageData" |
|
|
|
:height="height - 32" |
|
|
|
border |
|
|
|
v-loading="casesDataLoading" |
|
|
|
@selection-change="handleCaseSelectionChange" |
|
|
|
style="width: 100%;"> |
|
|
|
<el-table-column |
|
|
|
@ -256,7 +257,7 @@ |
|
|
|
:current-page="casesPageIndex" |
|
|
|
:page-sizes="[20, 50, 100, 200]" |
|
|
|
:page-size="casesPageSize" |
|
|
|
:total="casesList.length" |
|
|
|
:total="casesTotal" |
|
|
|
layout="total, sizes, prev, pager, next, jumper"> |
|
|
|
</el-pagination> |
|
|
|
</el-tab-pane> |
|
|
|
@ -463,6 +464,7 @@ import pallet from "./com_saleBoxManage_pallet.vue" |
|
|
|
import { |
|
|
|
searchRollForOrderNo, |
|
|
|
searchSoReceiveCasesData, |
|
|
|
searchSoReceiveCasesDataByPage, |
|
|
|
deleteSoReceiveCasesData, |
|
|
|
validateAndScanCaseRoll, |
|
|
|
saveCaseRollList, |
|
|
|
@ -512,7 +514,9 @@ export default { |
|
|
|
dataListLoading: false, |
|
|
|
activeName: 'cases', |
|
|
|
// 盒清单相关数据 |
|
|
|
casesList: [], |
|
|
|
casesPageData: [], |
|
|
|
casesTotal: 0, |
|
|
|
casesDataLoading: false, |
|
|
|
casesStatistics: { |
|
|
|
boxCountCases: 0, // 盒标签张数 |
|
|
|
boxCountRolls: 0, // 卷标签张数 |
|
|
|
@ -884,12 +888,6 @@ export default { |
|
|
|
exportName: '销售出库单'+this.dayjs().format('YYYYMMDDHHmmss'), |
|
|
|
} |
|
|
|
}, |
|
|
|
computed: { |
|
|
|
casesPagedList() { |
|
|
|
const start = (this.casesPageIndex - 1) * this.casesPageSize |
|
|
|
return this.casesList.slice(start, start + this.casesPageSize) |
|
|
|
} |
|
|
|
}, |
|
|
|
|
|
|
|
/*组件*/ |
|
|
|
components: { |
|
|
|
@ -1059,25 +1057,54 @@ export default { |
|
|
|
sizeChangeCasesHandle(val) { |
|
|
|
this.casesPageSize = val |
|
|
|
this.casesPageIndex = 1 |
|
|
|
this.refreshCasesTable(false) |
|
|
|
}, |
|
|
|
// 扫描装盒分页 - 当前页变更 |
|
|
|
currentChangeCasesHandle(val) { |
|
|
|
this.casesPageIndex = val |
|
|
|
this.refreshCasesTable(false) |
|
|
|
}, |
|
|
|
|
|
|
|
// ===== 盒清单相关方法 ===== |
|
|
|
refreshCasesTable(){ |
|
|
|
refreshCasesTable(resetPage = true){ |
|
|
|
if (resetPage) { |
|
|
|
this.casesPageIndex = 1 |
|
|
|
} |
|
|
|
// 无当前出库单时不触发查询,避免不必要的大数据渲染 |
|
|
|
if (!this.currentRow || !this.currentRow.orderNo) { |
|
|
|
this.casesDataLoading = false |
|
|
|
this.casesTotal = 0 |
|
|
|
this.casesPageIndex = 1 |
|
|
|
this.casesPageData = [] |
|
|
|
this.selectedCaseRecords = [] |
|
|
|
this.casesStatistics.boxCountCases = 0 |
|
|
|
this.casesStatistics.boxCountRolls = 0 |
|
|
|
this.casesStatistics.totalQty = 0 |
|
|
|
return |
|
|
|
} |
|
|
|
let templateData = { |
|
|
|
site: this.currentRow.site, |
|
|
|
buNo: this.currentRow.buNo, |
|
|
|
notifyNo: this.currentRow.orderNo, |
|
|
|
page: this.casesPageIndex, |
|
|
|
limit: this.casesPageSize |
|
|
|
} |
|
|
|
searchSoReceiveCasesData(templateData).then(({data}) => { |
|
|
|
this.casesList = data.rows || [] |
|
|
|
this.casesPageIndex = 1 |
|
|
|
// 更新统计数据 - 从列表第一条记录中获取 |
|
|
|
if (data.rows && data.rows.length > 0) { |
|
|
|
const firstRecord = data.rows[0] |
|
|
|
this.casesDataLoading = true |
|
|
|
searchSoReceiveCasesDataByPage(templateData).then(({data}) => { |
|
|
|
const pageData = data.page || {} |
|
|
|
const rows = pageData.list || [] |
|
|
|
this.casesPageData = rows |
|
|
|
this.casesTotal = pageData.totalCount || 0 |
|
|
|
this.casesPageIndex = pageData.currPage || this.casesPageIndex |
|
|
|
this.selectedCaseRecords = [] |
|
|
|
this.$nextTick(() => { |
|
|
|
if (this.$refs.caseTable && typeof this.$refs.caseTable.clearSelection === 'function') { |
|
|
|
this.$refs.caseTable.clearSelection() |
|
|
|
} |
|
|
|
}) |
|
|
|
// 更新统计数据 - 从当前页第一条记录中获取(统计值在每一行都相同) |
|
|
|
if (rows.length > 0) { |
|
|
|
const firstRecord = rows[0] |
|
|
|
this.casesStatistics.boxCountCases = firstRecord.boxCountCases || 0 |
|
|
|
this.casesStatistics.boxCountRolls = firstRecord.boxCountRolls || 0 |
|
|
|
this.casesStatistics.totalQty = firstRecord.totalQty || 0 |
|
|
|
@ -1086,6 +1113,8 @@ export default { |
|
|
|
this.casesStatistics.boxCountRolls = 0 |
|
|
|
this.casesStatistics.totalQty = 0 |
|
|
|
} |
|
|
|
}).finally(() => { |
|
|
|
this.casesDataLoading = false |
|
|
|
}) |
|
|
|
}, |
|
|
|
|
|
|
|
|