|
|
@@ -43,6 +43,7 @@
|
|
|
:option="tableOption"
|
|
|
@row-del="rowDel"
|
|
|
@saveColumn="saveColumn"
|
|
|
+ :summary-method="summaryMethod"
|
|
|
>
|
|
|
<template slot="menuLeft">
|
|
|
<el-button
|
|
|
@@ -218,7 +219,11 @@ import {
|
|
|
} from "@/api/basicData/invoice";
|
|
|
import uploadFile from "@/components/upload-file/main";
|
|
|
import reportDialog from "@/components/report-dialog/main";
|
|
|
-import { isvalidatemobile, validatename } from "@/util/validate";
|
|
|
+import {
|
|
|
+ isvalidatemobile,
|
|
|
+ validatename,
|
|
|
+ micrometerFormat
|
|
|
+} from "@/util/validate";
|
|
|
import _ from "lodash";
|
|
|
export default {
|
|
|
name: "detailsPageEdit",
|
|
|
@@ -391,7 +396,7 @@ export default {
|
|
|
total: 0
|
|
|
},
|
|
|
loading: false,
|
|
|
- goodsOption: goodsOption,
|
|
|
+ goodsOption:{},
|
|
|
data: [],
|
|
|
goodsList: [],
|
|
|
selectionList: [],
|
|
|
@@ -416,6 +421,10 @@ export default {
|
|
|
this.getColumnName(9),
|
|
|
tableOption
|
|
|
);
|
|
|
+ this.goodsOption = await this.getColumnData(
|
|
|
+ this.getColumnName(30),
|
|
|
+ goodsOption
|
|
|
+ );
|
|
|
if (this.$route.query.pageType == "Generate") {
|
|
|
this.getGenerate(JSON.parse(this.$route.query.data));
|
|
|
}
|
|
|
@@ -630,6 +639,34 @@ export default {
|
|
|
onClose(val) {
|
|
|
this.switchDialog = val;
|
|
|
},
|
|
|
+ summaryMethod({ columns, data }) {
|
|
|
+ const sums = [];
|
|
|
+ if (columns.length > 0) {
|
|
|
+ columns.forEach((item, index) => {
|
|
|
+ sums[0] = "合计";
|
|
|
+ if (
|
|
|
+ item.property == "actualQuantity" ||
|
|
|
+ item.property == "contractAmount"
|
|
|
+ ) {
|
|
|
+ let qtySum = 0;
|
|
|
+ let amountSum = 0;
|
|
|
+ data.forEach(e => {
|
|
|
+ qtySum = _.add(qtySum, Number(e.actualQuantity));
|
|
|
+ amountSum = _.add(amountSum, Number(e.contractAmount));
|
|
|
+ });
|
|
|
+ //数量总计
|
|
|
+ if (item.property == "actualQuantity") {
|
|
|
+ sums[index] = qtySum ? qtySum.toFixed(2) : "0.00";
|
|
|
+ }
|
|
|
+ //金额总计
|
|
|
+ if (item.property == "contractAmount") {
|
|
|
+ sums[index] = micrometerFormat(amountSum);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+ return sums;
|
|
|
+ },
|
|
|
async saveColumn() {
|
|
|
const inSave = await this.saveColumnData(
|
|
|
this.getColumnName(9),
|
|
|
@@ -640,6 +677,17 @@ export default {
|
|
|
//关闭窗口
|
|
|
this.$refs.crud.$refs.dialogColumn.columnBox = false;
|
|
|
}
|
|
|
+ },
|
|
|
+ async saveGoodsColumn() {
|
|
|
+ const inSave = await this.saveColumnData(
|
|
|
+ this.getColumnName(30),
|
|
|
+ this.goodsOption
|
|
|
+ );
|
|
|
+ if (inSave) {
|
|
|
+ this.$message.success("保存成功");
|
|
|
+ //关闭窗口
|
|
|
+ this.$refs.goodsCrud.$refs.dialogColumn.columnBox = false;
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
};
|