|
|
@@ -17,6 +17,7 @@
|
|
|
v-model="form"
|
|
|
:page.sync="page"
|
|
|
:before-open="handleBeforeOpen"
|
|
|
+ :summary-method="summaryMethod"
|
|
|
>
|
|
|
<template slot="menuLeft">
|
|
|
<el-button
|
|
|
@@ -74,7 +75,7 @@ import {exportBloByPost} from "@/api/common";
|
|
|
import UploadExcelDialog from "@/components/upload-excel-dialog";
|
|
|
import projectSelect from "@/components/project-select";
|
|
|
import {getToken} from "@/util/auth";
|
|
|
-import {downloadXls} from "@/util/util";
|
|
|
+import {downloadXls, summaryMethod} from "@/util/util";
|
|
|
import moment from "moment";
|
|
|
import Decimal from "decimal.js";
|
|
|
import assetSelect from "@/components/asset-select";
|
|
|
@@ -104,7 +105,6 @@ export default window.$crudCommon({
|
|
|
},
|
|
|
created() {
|
|
|
this.params.xmId = this.projectId;
|
|
|
- this.option.height = window.innerHeight - 340;
|
|
|
},
|
|
|
watch: {
|
|
|
projectId(newVal, oldVal) {
|
|
|
@@ -124,6 +124,10 @@ export default window.$crudCommon({
|
|
|
}
|
|
|
},
|
|
|
methods: {
|
|
|
+ // 合计
|
|
|
+ summaryMethod({ columns, data }) {
|
|
|
+ return summaryMethod(columns, data, this.option.sumColumnList, 'zcbm');
|
|
|
+ },
|
|
|
validCustom() {
|
|
|
const { sysm, ysysm } = this.currZcObj;
|
|
|
const { xmkssj, xmjssj } = this.selProject
|
|
|
@@ -203,9 +207,17 @@ export default window.$crudCommon({
|
|
|
* @param isLandscape 是否横向打印
|
|
|
*/
|
|
|
printTable(isLandscape) {
|
|
|
+ let wideTableData = JSON.parse(JSON.stringify(this.data))
|
|
|
+ if (wideTableData.length) {
|
|
|
+ wideTableData.push(this.$refs.crud.sumsList);
|
|
|
+ }
|
|
|
+ wideTableData = wideTableData.map(item => {
|
|
|
+ item.zcbm = item.zcbm == '合计' ? '合计' : item.zcmc
|
|
|
+ return item
|
|
|
+ })
|
|
|
this.$emit("printClick", {
|
|
|
column: this.printOption.column,
|
|
|
- data: this.data,
|
|
|
+ data: wideTableData,
|
|
|
pageTitle: this.pageTitle,
|
|
|
zoom: 95
|
|
|
});
|