|
|
|
@ -197,7 +197,7 @@ |
|
|
|
</el-select> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item label=" "> |
|
|
|
<el-button type="primary" @click="getDetailList()">查询</el-button> |
|
|
|
<el-button type="primary" @click="detailSearch()">查询</el-button> |
|
|
|
</el-form-item> |
|
|
|
</el-form> |
|
|
|
|
|
|
|
@ -205,7 +205,7 @@ |
|
|
|
<div style="margin-bottom: 15px; padding: 10px; background-color: #f5f7fa; border-radius: 4px;"> |
|
|
|
<span style="margin-right: 30px;"><strong>标签总数:</strong><span style="color: #409EFF; font-size: 18px;">{{ detailStatistics.totalCount }}</span></span> |
|
|
|
<span style="margin-right: 30px;"><strong>物料总数:</strong><span style="color: #67C23A; font-size: 18px;">{{ detailStatistics.totalQty }}</span></span> |
|
|
|
<span><strong>已盘点数:</strong><span style="color: #E6A23C; font-size: 18px;">{{ detailStatistics.checkedQty }}</span></span> |
|
|
|
<span><strong>已盘点标签数:</strong><span style="color: #E6A23C; font-size: 18px;">{{ detailStatistics.checkedQty }}</span></span> |
|
|
|
</div> |
|
|
|
|
|
|
|
<!-- 明细列表 --> |
|
|
|
@ -229,7 +229,19 @@ |
|
|
|
</el-table-column> |
|
|
|
</el-table> |
|
|
|
|
|
|
|
<el-footer style="height:35px;margin-top: 20px;text-align:center"> |
|
|
|
<!-- 盘点清单分页 --> |
|
|
|
<el-pagination |
|
|
|
style="margin-top: 10px; text-align: right;" |
|
|
|
@size-change="detailSizeChangeHandle" |
|
|
|
@current-change="detailCurrentChangeHandle" |
|
|
|
:current-page="detailPageIndex" |
|
|
|
:page-sizes="[50, 100, 200, 500]" |
|
|
|
:page-size="detailPageSize" |
|
|
|
:total="detailTotal" |
|
|
|
layout="total, sizes, prev, pager, next, jumper"> |
|
|
|
</el-pagination> |
|
|
|
|
|
|
|
<el-footer style="height:35px;margin-top: 10px;text-align:center"> |
|
|
|
<el-button type="primary" @click="detailFlag = false">关闭</el-button> |
|
|
|
</el-footer> |
|
|
|
</el-dialog> |
|
|
|
@ -337,6 +349,9 @@ export default { |
|
|
|
detailFlag: false, |
|
|
|
detailLoading: false, |
|
|
|
detailList: [], |
|
|
|
detailPageIndex: 1, |
|
|
|
detailPageSize: 50, |
|
|
|
detailTotal: 0, |
|
|
|
detailSearchData: { |
|
|
|
site: '', |
|
|
|
buNo: '', |
|
|
|
@ -346,9 +361,9 @@ export default { |
|
|
|
checkedFlag: '' |
|
|
|
}, |
|
|
|
detailStatistics: { |
|
|
|
totalCount: 0, // 标签总数 |
|
|
|
totalQty: 0, // 物料总数(所有标签数量总和) |
|
|
|
checkedQty: 0 // 已盘点数(已盘点标签数量总和) |
|
|
|
totalCount: 0, |
|
|
|
totalQty: 0, |
|
|
|
checkedQty: 0 |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
@ -669,6 +684,9 @@ export default { |
|
|
|
// 查看盘点清单 |
|
|
|
viewDetail(row) { |
|
|
|
this.detailFlag = true |
|
|
|
this.detailPageIndex = 1 |
|
|
|
this.detailPageSize = 50 |
|
|
|
this.detailTotal = 0 |
|
|
|
this.detailSearchData = { |
|
|
|
site: row.site, |
|
|
|
buNo: row.buNo, |
|
|
|
@ -680,16 +698,33 @@ export default { |
|
|
|
this.getDetailList() |
|
|
|
}, |
|
|
|
|
|
|
|
// 盘点清单查询按钮(重置页码) |
|
|
|
detailSearch() { |
|
|
|
this.detailPageIndex = 1 |
|
|
|
this.getDetailList() |
|
|
|
}, |
|
|
|
|
|
|
|
// 获取盘点清单列表 |
|
|
|
getDetailList() { |
|
|
|
this.detailLoading = true |
|
|
|
countingReportDetailList(this.detailSearchData).then(({data}) => { |
|
|
|
const params = { |
|
|
|
...this.detailSearchData, |
|
|
|
page: this.detailPageIndex, |
|
|
|
limit: this.detailPageSize |
|
|
|
} |
|
|
|
countingReportDetailList(params).then(({data}) => { |
|
|
|
if (data && data.code === 0) { |
|
|
|
this.detailList = data.detailList || [] |
|
|
|
// 计算统计数据 |
|
|
|
this.calculateStatistics() |
|
|
|
this.detailList = data.page.list || [] |
|
|
|
this.detailTotal = data.page.totalCount || 0 |
|
|
|
// 统计信息来自后端全量聚合,不受分页/查询条件影响 |
|
|
|
if (data.statistics) { |
|
|
|
this.detailStatistics.totalCount = data.statistics.totalCount || 0 |
|
|
|
this.detailStatistics.totalQty = data.statistics.totalQty || 0 |
|
|
|
this.detailStatistics.checkedQty = data.statistics.checkedQty || 0 |
|
|
|
} |
|
|
|
} else { |
|
|
|
this.detailList = [] |
|
|
|
this.detailTotal = 0 |
|
|
|
this.$message.error(data.msg || '查询失败') |
|
|
|
} |
|
|
|
this.detailLoading = false |
|
|
|
@ -698,13 +733,17 @@ export default { |
|
|
|
}) |
|
|
|
}, |
|
|
|
|
|
|
|
// 计算统计数据 |
|
|
|
calculateStatistics() { |
|
|
|
this.detailStatistics.totalCount = this.detailList.length |
|
|
|
this.detailStatistics.totalQty = this.detailList.reduce((sum, item) => sum + (item.rollQty || 0), 0) |
|
|
|
this.detailStatistics.checkedQty = this.detailList |
|
|
|
.filter(item => item.checkedFlag === 'Y') |
|
|
|
.reduce((sum, item) => sum + (item.rollQty || 0), 0) |
|
|
|
// 盘点清单每页数变化 |
|
|
|
detailSizeChangeHandle(val) { |
|
|
|
this.detailPageSize = val |
|
|
|
this.detailPageIndex = 1 |
|
|
|
this.getDetailList() |
|
|
|
}, |
|
|
|
|
|
|
|
// 盘点清单当前页变化 |
|
|
|
detailCurrentChangeHandle(val) { |
|
|
|
this.detailPageIndex = val |
|
|
|
this.getDetailList() |
|
|
|
}, |
|
|
|
|
|
|
|
// 打开多选对话框 |
|
|
|
|