|
|
|
@ -135,8 +135,8 @@
|
|
|
|
|
</el-col>
|
|
|
|
|
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
|
|
|
|
</el-row>
|
|
|
|
|
|
|
|
|
|
<el-table v-loading="loading" :data="orderList" @selection-change="handleSelectionChange">
|
|
|
|
|
<div>
|
|
|
|
|
<el-table v-loading="loading" :data="orderList" @selection-change="handleSelectionChange" :show-summary="true" :summary-method="getSummary">
|
|
|
|
|
<el-table-column type="selection" width="55" align="center" />
|
|
|
|
|
<el-table-column label="序号" type="index" > </el-table-column>
|
|
|
|
|
<el-table-column label="工厂编码" align="center" prop="siteCode" v-if="false" />
|
|
|
|
@ -181,7 +181,14 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</el-table>
|
|
|
|
|
|
|
|
|
|
<!-- 汇总行 -->
|
|
|
|
|
<!-- <div class="summary-row">-->
|
|
|
|
|
<!-- <span>当页计划汇总数量:</span>-->
|
|
|
|
|
<!-- <span>{{ getTotalPlanNumber() }}</span>-->
|
|
|
|
|
<!-- <span>当页已入库数量汇总数量:</span>-->
|
|
|
|
|
<!-- <span>{{ getTotalRealityNumber() }}</span>-->
|
|
|
|
|
<!-- </div>-->
|
|
|
|
|
</div>
|
|
|
|
|
<pagination
|
|
|
|
|
v-show="total>0"
|
|
|
|
|
:total="total"
|
|
|
|
@ -326,6 +333,7 @@ export default {
|
|
|
|
|
open: false,
|
|
|
|
|
openTEM: false,
|
|
|
|
|
// 查询参数
|
|
|
|
|
|
|
|
|
|
queryParams: {
|
|
|
|
|
pageNum: 1,
|
|
|
|
|
pageSize: 10,
|
|
|
|
@ -451,6 +459,29 @@ export default {
|
|
|
|
|
this.open = true;
|
|
|
|
|
this.title = "添加包材采购单";
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
getTotalPlanNumber() {
|
|
|
|
|
return this.orderList.reduce((sum, order) => sum + (order.planNumber || 0), 0);
|
|
|
|
|
},
|
|
|
|
|
getTotalRealityNumber() {
|
|
|
|
|
return this.orderList.reduce((sum, order) => sum + (order.realityNumber || 0), 0);
|
|
|
|
|
},
|
|
|
|
|
getSummary(param) {
|
|
|
|
|
const { columns, data } = param;
|
|
|
|
|
const planNumberTotal = data.reduce((sum, row) => sum + (row.planNumber || 0), 0);
|
|
|
|
|
const realityNumberTotal = data.reduce((sum, row) => sum + (row.realityNumber || 0), 0);
|
|
|
|
|
|
|
|
|
|
const summary = columns.map((column, index) => {
|
|
|
|
|
if (index === 6) { // "计划数量"在第8列
|
|
|
|
|
return planNumberTotal;
|
|
|
|
|
} else if (index === 7) { // "已入库数量"在第9列
|
|
|
|
|
return realityNumberTotal;
|
|
|
|
|
}
|
|
|
|
|
return ''; // 其余列不汇总,返回空
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
return summary;
|
|
|
|
|
},
|
|
|
|
|
/** 修改按钮操作 */
|
|
|
|
|
handleUpdate(row) {
|
|
|
|
|
this.reset();
|
|
|
|
@ -565,3 +596,15 @@ export default {
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
</script>
|
|
|
|
|
<style>
|
|
|
|
|
.summary-row {
|
|
|
|
|
display: flex;
|
|
|
|
|
justify-content: flex-end; /* Aligns the summary to the right */
|
|
|
|
|
padding: 10px;
|
|
|
|
|
background-color: #f9f9f9; /* Optional: different background for summary row */
|
|
|
|
|
border-top: 1px solid #e4e7ed; /* Optional: border for separation */
|
|
|
|
|
}
|
|
|
|
|
.summary-row span {
|
|
|
|
|
margin-left: 20px; /* Optional: spacing between items */
|
|
|
|
|
}
|
|
|
|
|
</style>
|
|
|
|
|