|
@@ -149,6 +149,8 @@
|
|
|
fit
|
|
|
highlight-current-row
|
|
|
stripe
|
|
|
+ show-summary
|
|
|
+ :summary-method="getSummaries"
|
|
|
>
|
|
|
<el-table-column
|
|
|
label="序号"
|
|
@@ -193,7 +195,7 @@
|
|
|
show-overflow-tooltip
|
|
|
></el-table-column>
|
|
|
<el-table-column
|
|
|
- align="center"
|
|
|
+ align="right"
|
|
|
label="预付货款"
|
|
|
prop="flag"
|
|
|
min-width="160"
|
|
@@ -207,12 +209,12 @@
|
|
|
: scope.row.amountType == "OUT"
|
|
|
? -scope.row.amount
|
|
|
: ""
|
|
|
- : "-"
|
|
|
+ : "-" | numToFixed
|
|
|
}}
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
<el-table-column
|
|
|
- align="center"
|
|
|
+ align="right"
|
|
|
label="订单占款"
|
|
|
prop="flag"
|
|
|
min-width="160"
|
|
@@ -226,12 +228,12 @@
|
|
|
: scope.row.amountType == "OUT"
|
|
|
? -scope.row.amount
|
|
|
: ""
|
|
|
- : "-"
|
|
|
+ : "-" | numToFixed
|
|
|
}}
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
<el-table-column
|
|
|
- align="center"
|
|
|
+ align="right"
|
|
|
label="支付货款"
|
|
|
prop="flag"
|
|
|
min-width="160"
|
|
@@ -245,12 +247,12 @@
|
|
|
: scope.row.amountType == "OUT"
|
|
|
? -scope.row.amount
|
|
|
: ""
|
|
|
- : "-"
|
|
|
+ : "-" | numToFixed
|
|
|
}}
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
<el-table-column
|
|
|
- align="center"
|
|
|
+ align="right"
|
|
|
label="押金"
|
|
|
prop="flag"
|
|
|
min-width="160"
|
|
@@ -264,12 +266,12 @@
|
|
|
: scope.row.amountType == "OUT"
|
|
|
? -scope.row.amount
|
|
|
: ""
|
|
|
- : "-"
|
|
|
+ : "-" | numToFixed
|
|
|
}}
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
<el-table-column
|
|
|
- align="center"
|
|
|
+ align="right"
|
|
|
label="工程保证金"
|
|
|
prop="flag"
|
|
|
min-width="160"
|
|
@@ -283,12 +285,12 @@
|
|
|
: scope.row.amountType == "OUT"
|
|
|
? -scope.row.amount
|
|
|
: ""
|
|
|
- : "-"
|
|
|
+ : "-" | numToFixed
|
|
|
}}
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
<el-table-column
|
|
|
- align="center"
|
|
|
+ align="right"
|
|
|
label="其他暂扣款"
|
|
|
prop="flag"
|
|
|
min-width="160"
|
|
@@ -302,17 +304,21 @@
|
|
|
: scope.row.amountType == "OUT"
|
|
|
? -scope.row.amount
|
|
|
: ""
|
|
|
- : "-"
|
|
|
+ : "-" | numToFixed
|
|
|
}}
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
<el-table-column
|
|
|
- align="center"
|
|
|
+ align="right"
|
|
|
label="账户余额"
|
|
|
prop="balanceAmount"
|
|
|
min-width="160"
|
|
|
show-overflow-tooltip
|
|
|
- ></el-table-column>
|
|
|
+ >
|
|
|
+ <template slot-scope="scope">
|
|
|
+ {{ scope.row.balanceAmount | numToFixed }}
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
</el-table>
|
|
|
</div>
|
|
|
<!-- 分页
|
|
@@ -350,6 +356,8 @@
|
|
|
fit
|
|
|
highlight-current-row
|
|
|
stripe
|
|
|
+ show-summary
|
|
|
+ :summary-method="getSummaries2"
|
|
|
>
|
|
|
<el-table-column
|
|
|
label="序号"
|
|
@@ -419,57 +427,68 @@
|
|
|
show-overflow-tooltip
|
|
|
></el-table-column>
|
|
|
<el-table-column
|
|
|
- align="center"
|
|
|
+ align="right"
|
|
|
label="收入"
|
|
|
prop="amountType"
|
|
|
min-width="160"
|
|
|
show-overflow-tooltip
|
|
|
>
|
|
|
<template slot-scope="scope">
|
|
|
- {{ scope.row.amountType == "IN" ? scope.row.amount : "-" }}
|
|
|
+ {{
|
|
|
+ scope.row.amountType == "IN"
|
|
|
+ ? scope.row.amount
|
|
|
+ : "-" | numToFixed
|
|
|
+ }}
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
<el-table-column
|
|
|
- align="center"
|
|
|
+ align="right"
|
|
|
label="支出"
|
|
|
prop="amountType"
|
|
|
min-width="160"
|
|
|
show-overflow-tooltip
|
|
|
>
|
|
|
<template slot-scope="scope">
|
|
|
- {{ scope.row.amountType == "OUT" ? scope.row.amount : "-" }}
|
|
|
+ {{
|
|
|
+ scope.row.amountType == "OUT"
|
|
|
+ ? scope.row.amount
|
|
|
+ : "-" | numToFixed
|
|
|
+ }}
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
<el-table-column
|
|
|
- align="center"
|
|
|
+ align="right"
|
|
|
label="折让金额"
|
|
|
prop="allowanceAmount"
|
|
|
min-width="160"
|
|
|
show-overflow-tooltip
|
|
|
>
|
|
|
+ <template slot-scope="scope">
|
|
|
+ {{ scope.row.allowanceAmount | numToFixed }}
|
|
|
+ </template>
|
|
|
</el-table-column>
|
|
|
<el-table-column
|
|
|
- align="center"
|
|
|
+ align="right"
|
|
|
label="暂扣返利"
|
|
|
prop="withholdAmount"
|
|
|
min-width="160"
|
|
|
show-overflow-tooltip
|
|
|
>
|
|
|
- <!-- <template slot-scope="scope">
|
|
|
- {{
|
|
|
- scope.row.amountType == "OUT"
|
|
|
- ? scope.row.amount
|
|
|
- : -scope.row.amount
|
|
|
- }}
|
|
|
- </template> -->
|
|
|
+ <template slot-scope="scope">
|
|
|
+ {{ scope.row.withholdAmount | numToFixed }}
|
|
|
+ </template>
|
|
|
</el-table-column>
|
|
|
<el-table-column
|
|
|
- align="center"
|
|
|
+ align="right"
|
|
|
label="结存"
|
|
|
prop="balanceAmount"
|
|
|
min-width="160"
|
|
|
show-overflow-tooltip
|
|
|
- ></el-table-column>
|
|
|
+ >
|
|
|
+ <template slot-scope="scope">
|
|
|
+ {{ scope.row.balanceAmount | numToFixed }}
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
</el-table>
|
|
|
</div>
|
|
|
<!-- 分页 -->
|
|
@@ -686,35 +705,167 @@ export default {
|
|
|
// this.getDataDict();
|
|
|
},
|
|
|
methods: {
|
|
|
- // //合计
|
|
|
- // getSummaries(param) {
|
|
|
- // console.log(this.$getSummaries, 333333333);
|
|
|
- // console.log(param, "param");
|
|
|
- // // const { columns, data } = param;
|
|
|
- // // const sums = [];
|
|
|
- // // columns.forEach((column, index) => {
|
|
|
- // // if (index === 0) {
|
|
|
- // // sums[index] = "总价";
|
|
|
- // // return;
|
|
|
- // // }
|
|
|
- // // const values = data.map((item) => Number(item[column.property]));
|
|
|
- // // if (!values.every((value) => isNaN(value))) {
|
|
|
- // // sums[index] = values.reduce((prev, curr) => {
|
|
|
- // // const value = Number(curr);
|
|
|
- // // if (!isNaN(value)) {
|
|
|
- // // return prev + curr;
|
|
|
- // // } else {
|
|
|
- // // return prev;
|
|
|
- // // }
|
|
|
- // // }, 0);
|
|
|
- // // sums[index] += " 元";
|
|
|
- // // } else {
|
|
|
- // // sums[index] = "N/A";
|
|
|
- // // }
|
|
|
- // // });
|
|
|
+ //
|
|
|
+ computedFn(data, i, sums, index) {
|
|
|
+ let map1 = data.map((v) => {
|
|
|
+ if (v.flag == i && v.amountType == "IN") {
|
|
|
+ return v.amount;
|
|
|
+ }
|
|
|
+ if (v.flag == i && v.amountType == "OUT") {
|
|
|
+ return -v.amount;
|
|
|
+ }
|
|
|
+ });
|
|
|
|
|
|
- // // return sums;
|
|
|
- // },
|
|
|
+ let sum = map1
|
|
|
+ .reduce((prev, curr) => {
|
|
|
+ const value = Number(curr);
|
|
|
+ if (!isNaN(value)) {
|
|
|
+ return prev + curr;
|
|
|
+ } else {
|
|
|
+ return prev;
|
|
|
+ }
|
|
|
+ }, 0)
|
|
|
+ .toFixed(2);
|
|
|
+ return sum;
|
|
|
+ },
|
|
|
+ //合计
|
|
|
+ //返利台账列表合计
|
|
|
+ getSummaries2(param) {
|
|
|
+ const { columns, data } = param;
|
|
|
+ const sums = [];
|
|
|
+ columns.forEach((column, index) => {
|
|
|
+ if (index === 0) {
|
|
|
+ sums[index] = "合计";
|
|
|
+ }
|
|
|
+ if (index === 9) {
|
|
|
+ let map1 = data.map((v) => {
|
|
|
+ if (v.amountType == "IN") {
|
|
|
+ return v.amount;
|
|
|
+ }
|
|
|
+ });
|
|
|
+ sums[index] = map1
|
|
|
+ .reduce((prev, curr) => {
|
|
|
+ const value = Number(curr);
|
|
|
+ if (!isNaN(value)) {
|
|
|
+ return prev + curr;
|
|
|
+ } else {
|
|
|
+ return prev;
|
|
|
+ }
|
|
|
+ }, 0)
|
|
|
+ .toFixed(2);
|
|
|
+ }
|
|
|
+ if (index === 10) {
|
|
|
+ let map1 = data.map((v) => {
|
|
|
+ if (v.amountType == "OUT") {
|
|
|
+ return v.amount;
|
|
|
+ }
|
|
|
+ });
|
|
|
+ sums[index] = map1
|
|
|
+ .reduce((prev, curr) => {
|
|
|
+ const value = Number(curr);
|
|
|
+ if (!isNaN(value)) {
|
|
|
+ return prev + curr;
|
|
|
+ } else {
|
|
|
+ return prev;
|
|
|
+ }
|
|
|
+ }, 0)
|
|
|
+ .toFixed(2);
|
|
|
+ }
|
|
|
+ if (index === 11) {
|
|
|
+ let map1 = data.map((v) => {
|
|
|
+ return v.allowanceAmount;
|
|
|
+ });
|
|
|
+ sums[index] = map1
|
|
|
+ .reduce((prev, curr) => {
|
|
|
+ const value = Number(curr);
|
|
|
+ if (!isNaN(value)) {
|
|
|
+ return prev + curr;
|
|
|
+ } else {
|
|
|
+ return prev;
|
|
|
+ }
|
|
|
+ }, 0)
|
|
|
+ .toFixed(2);
|
|
|
+ }
|
|
|
+ if (index === 12) {
|
|
|
+ let map1 = data.map((v) => {
|
|
|
+ return v.withholdAmount;
|
|
|
+ });
|
|
|
+ sums[index] = map1
|
|
|
+ .reduce((prev, curr) => {
|
|
|
+ const value = Number(curr);
|
|
|
+ if (!isNaN(value)) {
|
|
|
+ return prev + curr;
|
|
|
+ } else {
|
|
|
+ return prev;
|
|
|
+ }
|
|
|
+ }, 0)
|
|
|
+ .toFixed(2);
|
|
|
+ }
|
|
|
+ if (index === 13) {
|
|
|
+ let map1 = data.map((v) => {
|
|
|
+ return v.balanceAmount;
|
|
|
+ });
|
|
|
+ sums[index] = map1
|
|
|
+ .reduce((prev, curr) => {
|
|
|
+ const value = Number(curr);
|
|
|
+ if (!isNaN(value)) {
|
|
|
+ return prev + curr;
|
|
|
+ } else {
|
|
|
+ return prev;
|
|
|
+ }
|
|
|
+ }, 0)
|
|
|
+ .toFixed(2);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ return sums;
|
|
|
+ },
|
|
|
+ //货款台账列表合计
|
|
|
+ getSummaries(param) {
|
|
|
+ const { columns, data } = param;
|
|
|
+
|
|
|
+ const sums = [];
|
|
|
+
|
|
|
+ columns.forEach((column, index) => {
|
|
|
+ if (index === 0) {
|
|
|
+ sums[index] = "合计";
|
|
|
+ }
|
|
|
+ if (index === 6) {
|
|
|
+ sums[index] = this.computedFn(data, 1);
|
|
|
+ }
|
|
|
+ if (index === 7) {
|
|
|
+ sums[index] = this.computedFn(data, 2);
|
|
|
+ }
|
|
|
+ if (index === 8) {
|
|
|
+ sums[index] = this.computedFn(data, 3);
|
|
|
+ }
|
|
|
+ if (index === 9) {
|
|
|
+ sums[index] = this.computedFn(data, 4);
|
|
|
+ }
|
|
|
+ if (index === 10) {
|
|
|
+ sums[index] = this.computedFn(data, 5);
|
|
|
+ }
|
|
|
+ if (index === 11) {
|
|
|
+ sums[index] = this.computedFn(data, 6);
|
|
|
+ }
|
|
|
+ if (index === 12) {
|
|
|
+ let map2 = data.map((v) => {
|
|
|
+ return v.balanceAmount;
|
|
|
+ });
|
|
|
+ sums[index] = map2
|
|
|
+ .reduce((prev, curr) => {
|
|
|
+ const value = Number(curr);
|
|
|
+ if (!isNaN(value)) {
|
|
|
+ return prev + curr;
|
|
|
+ } else {
|
|
|
+ return prev;
|
|
|
+ }
|
|
|
+ }, 0)
|
|
|
+ .toFixed(2);
|
|
|
+ }
|
|
|
+ });
|
|
|
+
|
|
|
+ return sums;
|
|
|
+ },
|
|
|
|
|
|
//获取汇总总数
|
|
|
async getAmountList(data) {
|
|
@@ -840,6 +991,8 @@ export default {
|
|
|
},
|
|
|
//查询
|
|
|
searchFn() {
|
|
|
+ this.currentPage = 1;
|
|
|
+ this.pageSize = 10;
|
|
|
// this.customerName = null;
|
|
|
// this.customerNumber = null;
|
|
|
let res = this.customerList.filter((v) => {
|