Browse Source

2026-07-21

优化
master
fengyuan_yang 1 week ago
parent
commit
47ebd8f219
  1. 117
      src/views/modules/orderIssure/soIssueNotify/searchIssureNotifyForCK.vue
  2. 89
      src/views/modules/report/inboundNotificationReport.vue
  3. 89
      src/views/modules/report/outboundNotificationReport.vue

117
src/views/modules/orderIssure/soIssueNotify/searchIssureNotifyForCK.vue

@ -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>

89
src/views/modules/report/inboundNotificationReport.vue

@ -180,6 +180,16 @@
<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.requiredQty) }}</span>
</span>
<span class="summary-item">
实际入库数量
<span class="summary-value">{{ formatSummaryQty(summaryData.actualInQty) }}</span>
</span>
</div>
</div> </div>
</el-col> </el-col>
</el-row> </el-row>
@ -295,6 +305,11 @@ export default {
pageIndex: 1, pageIndex: 1,
pageSize: 50, pageSize: 50,
totalPage: 0, totalPage: 0,
//
summaryData: {
requiredQty: 0,
actualInQty: 0
},
// //
tableHeight: 400, tableHeight: 400,
// //
@ -403,15 +418,18 @@ export default {
if (data && data.code === 0) { if (data && data.code === 0) {
this.dataList = data.page.list || []; this.dataList = data.page.list || [];
this.totalPage = data.page.totalCount || 0; this.totalPage = data.page.totalCount || 0;
this.loadSummaryData();
} else { } else {
this.dataList = []; this.dataList = [];
this.totalPage = 0; this.totalPage = 0;
this.resetSummaryData();
this.$message.error(data.msg || '查询失败'); this.$message.error(data.msg || '查询失败');
} }
}).catch(err => { }).catch(err => {
console.error(err); console.error(err);
this.searchLoading = false; this.searchLoading = false;
this.dataListLoading = false; this.dataListLoading = false;
this.resetSummaryData();
this.$message.error('查询异常:' + err.message); this.$message.error('查询异常:' + err.message);
}); });
}, },
@ -434,6 +452,7 @@ export default {
departmentNo: '' departmentNo: ''
}; };
this.pageIndex = 1; this.pageIndex = 1;
this.resetSummaryData();
}, },
// //
sizeChangeHandle(val) { sizeChangeHandle(val) {
@ -455,6 +474,51 @@ export default {
const { data } = await searchInboundNotificationReport(params); const { data } = await searchInboundNotificationReport(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 searchInboundNotificationReport(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.requiredQty += this.normalizeQty(item.requiredQty);
acc.actualInQty += this.normalizeQty(item.actualInQty);
return acc;
}, {
requiredQty: 0,
actualInQty: 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 = {
requiredQty: 0,
actualInQty: 0
};
},
startDownload() { startDownload() {
this._exportLoading = this.$loading({ this._exportLoading = this.$loading({
lock: true, lock: true,
@ -631,6 +695,25 @@ export default {
align-items: center; 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 {
border-radius: 4px; border-radius: 4px;
padding: 5px 10px; padding: 5px 10px;
@ -733,5 +816,11 @@ export default {
width: 100%; width: 100%;
justify-content: center; justify-content: center;
} }
.action-right {
width: 100%;
justify-content: center;
margin-left: 0;
}
} }
</style> </style>

89
src/views/modules/report/outboundNotificationReport.vue

@ -181,6 +181,16 @@
<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.requiredQty) }}</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>
@ -296,6 +306,11 @@ export default {
pageIndex: 1, pageIndex: 1,
pageSize: 50, pageSize: 50,
totalPage: 0, totalPage: 0,
//
summaryData: {
requiredQty: 0,
actualOutQty: 0
},
// //
tableHeight: 400, tableHeight: 400,
// //
@ -408,15 +423,18 @@ export default {
if (data && data.code === 0) { if (data && data.code === 0) {
this.dataList = data.page.list || []; this.dataList = data.page.list || [];
this.totalPage = data.page.totalCount || 0; this.totalPage = data.page.totalCount || 0;
this.loadSummaryData();
} else { } else {
this.dataList = []; this.dataList = [];
this.totalPage = 0; this.totalPage = 0;
this.resetSummaryData();
this.$message.error(data.msg || '查询失败'); this.$message.error(data.msg || '查询失败');
} }
}).catch(err => { }).catch(err => {
console.error(err); console.error(err);
this.searchLoading = false; this.searchLoading = false;
this.dataListLoading = false; this.dataListLoading = false;
this.resetSummaryData();
this.$message.error('查询异常:' + err.message); this.$message.error('查询异常:' + err.message);
}); });
}, },
@ -439,6 +457,7 @@ export default {
departmentNo: '' departmentNo: ''
}; };
this.pageIndex = 1; this.pageIndex = 1;
this.resetSummaryData();
}, },
// //
sizeChangeHandle(val) { sizeChangeHandle(val) {
@ -460,6 +479,51 @@ export default {
const { data } = await searchOutboundNotificationReport(params); const { data } = await searchOutboundNotificationReport(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 searchOutboundNotificationReport(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.requiredQty += this.normalizeQty(item.requiredQty);
acc.actualOutQty += this.normalizeQty(item.actualOutQty);
return acc;
}, {
requiredQty: 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 = {
requiredQty: 0,
actualOutQty: 0
};
},
startDownload() { startDownload() {
this._exportLoading = this.$loading({ this._exportLoading = this.$loading({
lock: true, lock: true,
@ -636,6 +700,25 @@ export default {
align-items: center; 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 {
border-radius: 4px; border-radius: 4px;
padding: 5px 10px; padding: 5px 10px;
@ -738,5 +821,11 @@ export default {
width: 100%; width: 100%;
justify-content: center; justify-content: center;
} }
.action-right {
width: 100%;
justify-content: center;
margin-left: 0;
}
} }
</style> </style>
Loading…
Cancel
Save