|
|
|
@ -96,8 +96,12 @@
|
|
|
|
|
</el-col>
|
|
|
|
|
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
|
|
|
|
</el-row>
|
|
|
|
|
|
|
|
|
|
<el-table v-loading="loading" :data="matetowsnList" @selection-change="handleSelectionChange">
|
|
|
|
|
<div>
|
|
|
|
|
<el-table v-loading="loading" :data="matetowsnList" @selection-change="handleSelectionChange"
|
|
|
|
|
:summary-method="getSummary"
|
|
|
|
|
:show-summary="true"
|
|
|
|
|
:summary-align="'center'"
|
|
|
|
|
>
|
|
|
|
|
<el-table-column type="selection" width="55" align="center" />
|
|
|
|
|
<el-table-column label="唯一序列号" align="center" prop="mateOrderInSnId" v-if="false" />
|
|
|
|
|
<el-table-column label="送货时间" align="center" prop="gmtCreate" width="100">
|
|
|
|
@ -150,7 +154,7 @@
|
|
|
|
|
<el-table-column label="有效标记" align="center" prop="activeFlag"v-if="false" />
|
|
|
|
|
<el-table-column label="工厂号" align="center" prop="factoryCode" />
|
|
|
|
|
</el-table>
|
|
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
<pagination
|
|
|
|
|
v-show="total>0"
|
|
|
|
|
:total="total"
|
|
|
|
@ -522,6 +526,31 @@ export default {
|
|
|
|
|
if (!code) return code; // 处理 null 或 undefined 情况
|
|
|
|
|
return code.replace(/^0{1,7}/, ''); // 替换前1到7个0
|
|
|
|
|
},
|
|
|
|
|
// getSummary(data) {
|
|
|
|
|
// const totalAmount = data.reduce((sum, row) => sum + (row.amount || 0), 0);
|
|
|
|
|
// const totalOutNumber = data.reduce((sum, row) => sum + (row.outNumber || 0), 0);
|
|
|
|
|
// const totalRemaining = totalAmount - totalOutNumber;
|
|
|
|
|
// return [
|
|
|
|
|
// { amount: totalAmount, outNumber: totalOutNumber, remaining: totalRemaining },
|
|
|
|
|
// ];
|
|
|
|
|
// },
|
|
|
|
|
getSummary(param) {
|
|
|
|
|
const { columns, data } = param;
|
|
|
|
|
const totalAmount = data.reduce((sum, row) => sum + (row.amount || 0), 0);
|
|
|
|
|
const totalOutNumber = data.reduce((sum, row) => sum + (row.outNumber || 0), 0);
|
|
|
|
|
const totalRemaining = totalAmount - totalOutNumber;
|
|
|
|
|
const summary = columns.map((column, index) => {
|
|
|
|
|
if (index === 7) { // "计划数量"在第8列
|
|
|
|
|
return totalAmount;
|
|
|
|
|
} else if (index === 8) { // "已入库数量"在第9列
|
|
|
|
|
return totalOutNumber;
|
|
|
|
|
}else if (index === 9) { // "已入库数量"在第9列
|
|
|
|
|
return totalRemaining;
|
|
|
|
|
}
|
|
|
|
|
return ''; // 其余列不汇总,返回空
|
|
|
|
|
});
|
|
|
|
|
return summary;
|
|
|
|
|
},
|
|
|
|
|
handlequeryform() {
|
|
|
|
|
this.showMaterialDialog = true; // 显示领料单信息弹窗
|
|
|
|
|
this.fetchMaterials(); // 加载领料单数据
|
|
|
|
|