|
|
@ -140,8 +140,6 @@ |
|
|
@click="resetSearch"> |
|
|
@click="resetSearch"> |
|
|
重置 |
|
|
重置 |
|
|
</el-button> |
|
|
</el-button> |
|
|
</div> |
|
|
|
|
|
<div class="action-right"> |
|
|
|
|
|
<download-excel |
|
|
<download-excel |
|
|
:fields="fields()" |
|
|
:fields="fields()" |
|
|
:data="exportData" |
|
|
:data="exportData" |
|
|
@ -153,10 +151,20 @@ |
|
|
:before-generate="startDownload" |
|
|
:before-generate="startDownload" |
|
|
:before-finish="finishDownload" |
|
|
:before-finish="finishDownload" |
|
|
worksheet="生产领料任务通知" |
|
|
worksheet="生产领料任务通知" |
|
|
class="el-button el-button--default"> |
|
|
|
|
|
|
|
|
class="el-button el-button--success el-button--medium"> |
|
|
<i class="el-icon-download"></i> 导出 |
|
|
<i class="el-icon-download"></i> 导出 |
|
|
</download-excel> |
|
|
</download-excel> |
|
|
</div> |
|
|
</div> |
|
|
|
|
|
<div class="action-right"> |
|
|
|
|
|
<span class="summary-item"> |
|
|
|
|
|
申请数量: |
|
|
|
|
|
<span class="summary-value">{{ formatSummaryQty(summaryData.qtyToIssue) }}</span> |
|
|
|
|
|
</span> |
|
|
|
|
|
<span class="summary-item"> |
|
|
|
|
|
累计出库数量: |
|
|
|
|
|
<span class="summary-value">{{ formatSummaryQty(summaryData.actualOutQty) }}</span> |
|
|
|
|
|
</span> |
|
|
|
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
</el-col> |
|
|
</el-col> |
|
|
</el-row> |
|
|
</el-row> |
|
|
@ -240,6 +248,11 @@ export default { |
|
|
pageIndex: 1, |
|
|
pageIndex: 1, |
|
|
pageSize: 50, |
|
|
pageSize: 50, |
|
|
totalPage: 0, |
|
|
totalPage: 0, |
|
|
|
|
|
// 汇总数据(按当前查询条件,全量) |
|
|
|
|
|
summaryData: { |
|
|
|
|
|
qtyToIssue: 0, |
|
|
|
|
|
actualOutQty: 0 |
|
|
|
|
|
}, |
|
|
columnList: [ |
|
|
columnList: [ |
|
|
{ |
|
|
{ |
|
|
columnProp: "notifyNo", |
|
|
columnProp: "notifyNo", |
|
|
@ -482,6 +495,7 @@ export default { |
|
|
warehouseIdList: [] |
|
|
warehouseIdList: [] |
|
|
} |
|
|
} |
|
|
this.pageIndex = 1 |
|
|
this.pageIndex = 1 |
|
|
|
|
|
this.resetSummaryData() |
|
|
this.searchTable() |
|
|
this.searchTable() |
|
|
}, |
|
|
}, |
|
|
// 获取用户BU列表 |
|
|
// 获取用户BU列表 |
|
|
@ -539,22 +553,73 @@ export default { |
|
|
this.pageIndex = data.page.currPage |
|
|
this.pageIndex = data.page.currPage |
|
|
this.pageSize = data.page.pageSize |
|
|
this.pageSize = data.page.pageSize |
|
|
this.totalPage = data.page.totalCount |
|
|
this.totalPage = data.page.totalCount |
|
|
|
|
|
this.loadSummaryData() |
|
|
} else { |
|
|
} else { |
|
|
this.dataList = [] |
|
|
this.dataList = [] |
|
|
|
|
|
this.resetSummaryData() |
|
|
this.$message.error(data.msg || '查询失败') |
|
|
this.$message.error(data.msg || '查询失败') |
|
|
} |
|
|
} |
|
|
}).catch(() => { |
|
|
}).catch(() => { |
|
|
this.dataListLoading = false |
|
|
this.dataListLoading = false |
|
|
this.dataList = [] |
|
|
this.dataList = [] |
|
|
|
|
|
this.resetSummaryData() |
|
|
}) |
|
|
}) |
|
|
}, |
|
|
}, |
|
|
// 导出相关方法 |
|
|
// 导出相关方法 |
|
|
async createExportData() { |
|
|
async createExportData() { |
|
|
this.searchData.limit = -1 |
|
|
|
|
|
this.searchData.page = 1 |
|
|
|
|
|
const {data} = await searchIssueNotifyReport(this.searchData) |
|
|
|
|
|
|
|
|
const params = { |
|
|
|
|
|
...this.searchData, |
|
|
|
|
|
page: 1, |
|
|
|
|
|
limit: -1 |
|
|
|
|
|
} |
|
|
|
|
|
const {data} = await searchIssueNotifyReport(params) |
|
|
return data && data.page ? data.page.list : [] |
|
|
return data && data.page ? data.page.list : [] |
|
|
}, |
|
|
}, |
|
|
|
|
|
// 获取汇总数据(当前条件下全量) |
|
|
|
|
|
async loadSummaryData() { |
|
|
|
|
|
const params = { |
|
|
|
|
|
...this.searchData, |
|
|
|
|
|
page: 1, |
|
|
|
|
|
limit: -1 |
|
|
|
|
|
} |
|
|
|
|
|
try { |
|
|
|
|
|
const {data} = await searchIssueNotifyReport(params) |
|
|
|
|
|
if (data && data.code === 0) { |
|
|
|
|
|
this.calculateSummary(data.page && data.page.list ? data.page.list : []) |
|
|
|
|
|
} else { |
|
|
|
|
|
this.resetSummaryData() |
|
|
|
|
|
} |
|
|
|
|
|
} catch (err) { |
|
|
|
|
|
console.error('查询汇总失败:', err) |
|
|
|
|
|
this.resetSummaryData() |
|
|
|
|
|
} |
|
|
|
|
|
}, |
|
|
|
|
|
calculateSummary(list) { |
|
|
|
|
|
const summary = list.reduce((acc, item) => { |
|
|
|
|
|
acc.qtyToIssue += this.normalizeQty(item.qtyToIssue) |
|
|
|
|
|
acc.actualOutQty += this.normalizeQty(item.actualOutQty) |
|
|
|
|
|
return acc |
|
|
|
|
|
}, { |
|
|
|
|
|
qtyToIssue: 0, |
|
|
|
|
|
actualOutQty: 0 |
|
|
|
|
|
}) |
|
|
|
|
|
this.summaryData = summary |
|
|
|
|
|
}, |
|
|
|
|
|
normalizeQty(value) { |
|
|
|
|
|
const numberValue = Number(value) |
|
|
|
|
|
return Number.isFinite(numberValue) ? numberValue : 0 |
|
|
|
|
|
}, |
|
|
|
|
|
formatSummaryQty(value) { |
|
|
|
|
|
const numberValue = this.normalizeQty(value) |
|
|
|
|
|
const fixedValue = numberValue.toFixed(6).replace(/\.?0+$/, '') |
|
|
|
|
|
return fixedValue || '0' |
|
|
|
|
|
}, |
|
|
|
|
|
resetSummaryData() { |
|
|
|
|
|
this.summaryData = { |
|
|
|
|
|
qtyToIssue: 0, |
|
|
|
|
|
actualOutQty: 0 |
|
|
|
|
|
} |
|
|
|
|
|
}, |
|
|
startDownload() { |
|
|
startDownload() { |
|
|
this._exportLoading = this.$loading({ |
|
|
this._exportLoading = this.$loading({ |
|
|
lock: true, |
|
|
lock: true, |
|
|
@ -736,10 +801,29 @@ export default { |
|
|
padding-top: 0; |
|
|
padding-top: 0; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
.action-left, |
|
|
|
|
|
.action-right { |
|
|
|
|
|
|
|
|
.action-left { |
|
|
display: flex; |
|
|
display: flex; |
|
|
gap: 8px; |
|
|
gap: 8px; |
|
|
|
|
|
align-items: center; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
.action-right { |
|
|
|
|
|
display: flex; |
|
|
|
|
|
align-items: center; |
|
|
|
|
|
gap: 18px; |
|
|
|
|
|
margin-left: auto; |
|
|
|
|
|
color: #606266; |
|
|
|
|
|
font-size: 12px; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
.summary-item { |
|
|
|
|
|
white-space: nowrap; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
.summary-value { |
|
|
|
|
|
margin-left: 4px; |
|
|
|
|
|
color: #303133; |
|
|
|
|
|
font-weight: 600; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
.search-actions .el-button { |
|
|
.search-actions .el-button { |
|
|
@ -765,6 +849,16 @@ export default { |
|
|
border-color: #7dbdff; |
|
|
border-color: #7dbdff; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
.search-actions .el-button--success { |
|
|
|
|
|
background: #67C23A; |
|
|
|
|
|
border-color: #67C23A; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
.search-actions .el-button--success:hover { |
|
|
|
|
|
background: #85ce61; |
|
|
|
|
|
border-color: #85ce61; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
/* 响应式设计 */ |
|
|
/* 响应式设计 */ |
|
|
@media (max-width: 1200px) { |
|
|
@media (max-width: 1200px) { |
|
|
.search-actions { |
|
|
.search-actions { |
|
|
@ -772,10 +866,15 @@ export default { |
|
|
gap: 10px; |
|
|
gap: 10px; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
.action-left, |
|
|
|
|
|
|
|
|
.action-left { |
|
|
|
|
|
width: 100%; |
|
|
|
|
|
justify-content: center; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
.action-right { |
|
|
.action-right { |
|
|
width: 100%; |
|
|
width: 100%; |
|
|
justify-content: center; |
|
|
justify-content: center; |
|
|
|
|
|
margin-left: 0; |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
</style> |
|
|
</style> |