|
@@ -21,7 +21,7 @@
|
|
<i class="el-icon-refresh"></i>刷新
|
|
<i class="el-icon-refresh"></i>刷新
|
|
</el-button>
|
|
</el-button>
|
|
</div>
|
|
</div>
|
|
- <dilTable v-bind.sync="option">
|
|
|
|
|
|
+ <dilTable v-bind.sync="option" @func="callback">
|
|
<el-table-column fixed="right" label="操作" align="center" width="100">
|
|
<el-table-column fixed="right" label="操作" align="center" width="100">
|
|
<template slot-scope="scope">
|
|
<template slot-scope="scope">
|
|
<el-button @click="click(scope.row.resultId)" type="text" size="small"
|
|
<el-button @click="click(scope.row.resultId)" type="text" size="small"
|
|
@@ -41,6 +41,7 @@
|
|
<script>
|
|
<script>
|
|
import { sjTime } from "@/utils/sharedJsFile";
|
|
import { sjTime } from "@/utils/sharedJsFile";
|
|
import { getCookie } from "@/utils/util.js";
|
|
import { getCookie } from "@/utils/util.js";
|
|
|
|
+import BigNumber from 'bignumber.js';
|
|
export default {
|
|
export default {
|
|
name: "homeworkPath",
|
|
name: "homeworkPath",
|
|
data() {
|
|
data() {
|
|
@@ -51,8 +52,8 @@ export default {
|
|
option: {
|
|
option: {
|
|
// 表格请求数据的地址
|
|
// 表格请求数据的地址
|
|
requestUrl: null,
|
|
requestUrl: null,
|
|
- isshowSummary:true,
|
|
|
|
- showSummaryList:['resultInspectionFee','realWeight','resultWaterTonnage','planWeight']
|
|
|
|
|
|
+ // isshowSummary:true,
|
|
|
|
+ // showSummaryList:['resultInspectionFee','realWeight','resultWaterTonnage','planWeight']
|
|
},
|
|
},
|
|
};
|
|
};
|
|
},
|
|
},
|
|
@@ -69,6 +70,44 @@ export default {
|
|
this.startTime.setSeconds(0);
|
|
this.startTime.setSeconds(0);
|
|
this.onclick();
|
|
this.onclick();
|
|
},
|
|
},
|
|
|
|
+ callback(param){
|
|
|
|
+ //自定义合计
|
|
|
|
+ console.log("param:",param);
|
|
|
|
+ let totalLoad=new BigNumber(0);
|
|
|
|
+ let totalInstuctions=new BigNumber(0);
|
|
|
|
+ let totalWater=new BigNumber(0);
|
|
|
|
+ let totalPlan=new BigNumber(0);
|
|
|
|
+ let content= null;
|
|
|
|
+ if(param.list.length<=0){
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+ param.list.forEach(row => {
|
|
|
|
+ if(row.realWeight && typeof row.realWeight == 'number'){
|
|
|
|
+ totalLoad = totalLoad.plus(new BigNumber(row.realWeight));
|
|
|
|
+ }
|
|
|
|
+ if(row.resultInspectionFee && typeof row.resultInspectionFee == 'number'){
|
|
|
|
+ totalInstuctions =totalInstuctions.plus(new BigNumber(row.resultInspectionFee));
|
|
|
|
+ }
|
|
|
|
+ if(row.resultWaterTonnage && typeof row.resultWaterTonnage == 'number'){
|
|
|
|
+ totalWater = totalWater.plus(new BigNumber(row.resultWaterTonnage));
|
|
|
|
+ }
|
|
|
|
+ if(row.planWeight && typeof row.planWeight == 'number'){
|
|
|
|
+ totalPlan = totalPlan.plus(new BigNumber(row.planWeight));
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+ if(totalLoad && totalLoad.toFixed(4)>0){
|
|
|
|
+ content=new BigNumber(totalWater.times(100)).div(totalLoad).toFixed(2);
|
|
|
|
+ }
|
|
|
|
+ param.list.push({
|
|
|
|
+ ROW_ID:' ',
|
|
|
|
+ noticePort:'合计',
|
|
|
|
+ realWeight:totalLoad.toFixed(2),
|
|
|
|
+ resultInspectionFee:totalInstuctions.toFixed(2),
|
|
|
|
+ resultWaterTonnage:totalWater.toFixed(4),
|
|
|
|
+ planWeight:totalPlan.toFixed(2),
|
|
|
|
+ resultMoistureContent:content
|
|
|
|
+ });
|
|
|
|
+ },
|
|
onclick() {
|
|
onclick() {
|
|
let startTime = null;
|
|
let startTime = null;
|
|
let endTime = null;
|
|
let endTime = null;
|