|
@@ -1,5 +1,5 @@
|
|
|
<template>
|
|
|
- <div>
|
|
|
+ <div class="paddingLeft">
|
|
|
<!-- <TitleBar propTitle="经营数据查询" /> -->
|
|
|
<el-form :model="form" ref="form" class="marginTop">
|
|
|
<el-form-item label="查询类别" :label-width="formLabelWidth">
|
|
@@ -210,10 +210,10 @@
|
|
|
</el-form-item>-->
|
|
|
</el-form>
|
|
|
<!-- 查询结果收入表 -->
|
|
|
- <div class="totalSumDiv" >全部金额合计:{{totalSum}}</div>
|
|
|
+ <div class="totalSumDiv">全部金额合计:{{totalSum}}</div>
|
|
|
<el-table
|
|
|
:data="searchResult"
|
|
|
- style="margin-top:30px; margin-left:20px;"
|
|
|
+ style="margin-top:30px;"
|
|
|
:summary-method="tableSummary"
|
|
|
show-summary
|
|
|
v-if="tableType === 'INCOME'"
|
|
@@ -229,7 +229,7 @@
|
|
|
<el-table-column
|
|
|
:formatter="moneyFormat"
|
|
|
prop="amount"
|
|
|
- width="110px"
|
|
|
+ width="130px"
|
|
|
align="right"
|
|
|
label="金额"
|
|
|
></el-table-column>
|
|
@@ -241,11 +241,11 @@
|
|
|
:formatter="incomeTypeFormat"
|
|
|
></el-table-column>
|
|
|
<el-table-column label="产品" width="200px" align="right" prop="product.name"></el-table-column>
|
|
|
- <el-table-column label="归属项目" width="290px" align="right" prop="project.name"></el-table-column>
|
|
|
+ <el-table-column label="归属项目" width="235px" align="right" prop="project.name"></el-table-column>
|
|
|
<el-table-column label="归属部门" width="250px" align="right" prop="department.name"></el-table-column>
|
|
|
- <el-table-column label="来源项目" width="290px" align="right" prop="toProject.name"></el-table-column>
|
|
|
- <el-table-column label="来源部门" width="220px" align="right" prop="toDepartment.name"></el-table-column>
|
|
|
- <el-table-column prop="remark" align="right" width="330px" label="备注"></el-table-column>
|
|
|
+ <el-table-column label="来源项目" width="235px" align="right" prop="toProject.name"></el-table-column>
|
|
|
+ <el-table-column label="来源部门" width="300px" align="right" prop="toDepartment.name"></el-table-column>
|
|
|
+ <el-table-column prop="remark" align="right" label="备注"></el-table-column>
|
|
|
<el-table-column
|
|
|
width="120px"
|
|
|
align="right"
|
|
@@ -258,7 +258,7 @@
|
|
|
<!-- 查询结果成本表 -->
|
|
|
<el-table
|
|
|
:data="searchResult"
|
|
|
- style=";margin-top:30px; margin-left:20px;"
|
|
|
+ style="margin-top:30px;"
|
|
|
show-summary
|
|
|
:summary-method="tableSummary"
|
|
|
v-if="tableType === 'COST'"
|
|
@@ -274,16 +274,16 @@
|
|
|
<el-table-column
|
|
|
:formatter="moneyFormat"
|
|
|
prop="amount"
|
|
|
- width="110px"
|
|
|
+ width="130px"
|
|
|
align="right"
|
|
|
label="金额"
|
|
|
></el-table-column>
|
|
|
- <el-table-column label="成本类别" width="130px" align="right" prop="costType.name"></el-table-column>
|
|
|
- <el-table-column label="发生部门" width="220px" align="right" prop="department.name"></el-table-column>
|
|
|
- <el-table-column label="发生项目/人" width="300px" align="right" prop="project.name"></el-table-column>
|
|
|
- <el-table-column label="接收项目" width="300px" align="right" prop="toProject.name"></el-table-column>
|
|
|
- <el-table-column label="接收部门" width="220px" align="right" prop="toDepartment.name"></el-table-column>
|
|
|
- <el-table-column label="备注" width="320px" align="right" prop="remark"></el-table-column>
|
|
|
+ <el-table-column label="成本类别" width="270px" align="right" prop="costType.name"></el-table-column>
|
|
|
+ <el-table-column label="发生部门" width="240px" align="right" prop="department.name"></el-table-column>
|
|
|
+ <el-table-column label="发生项目/人" width="245px" align="right" prop="project.name"></el-table-column>
|
|
|
+ <el-table-column label="接收项目" width="235px" align="right" prop="toProject.name"></el-table-column>
|
|
|
+ <el-table-column label="接收部门" width="310px" align="right" prop="toDepartment.name"></el-table-column>
|
|
|
+ <el-table-column label="备注" align="right" prop="remark"></el-table-column>
|
|
|
<el-table-column
|
|
|
width="120px"
|
|
|
align="right"
|
|
@@ -415,10 +415,11 @@ export default {
|
|
|
case "amount":
|
|
|
const amountNum = data.map(item => Number(item["amount"]));
|
|
|
console.log(amountNum);
|
|
|
- sums[index] = amountNum.reduce((prev, cur) => {
|
|
|
+ let amountTemp = amountNum.reduce((prev, cur) => {
|
|
|
// const sum = prev.toFixed(2) + cur.toFixed(2);
|
|
|
return (parseFloat(prev) + parseFloat(cur)).toFixed(2);
|
|
|
}, 0);
|
|
|
+ sums[index] = this.moneyFormatNew(amountTemp);
|
|
|
break;
|
|
|
case "remark":
|
|
|
sums[index] = "全部合计:";
|
|
@@ -434,7 +435,19 @@ export default {
|
|
|
},
|
|
|
// 金额格式化
|
|
|
moneyFormat(row) {
|
|
|
- return row.amount.toFixed(2);
|
|
|
+ let num = row.amount.toFixed(2);
|
|
|
+ num += "";
|
|
|
+ return num.replace(/(\d)(?=(\d{3})+\.)/g, function($0, $1) {
|
|
|
+ return $1 + ",";
|
|
|
+ });
|
|
|
+ },
|
|
|
+ // 重写一遍 方便接收参数
|
|
|
+ moneyFormatNew(amount) {
|
|
|
+ let num = parseFloat(amount).toFixed(2);
|
|
|
+ num += "";
|
|
|
+ return num.replace(/(\d)(?=(\d{3})+\.)/g, function($0, $1) {
|
|
|
+ return $1 + ",";
|
|
|
+ });
|
|
|
},
|
|
|
// 全选
|
|
|
handleCheckAllChange(val) {
|
|
@@ -470,7 +483,7 @@ export default {
|
|
|
this.searchResult = response.data.content;
|
|
|
this.totalNumber = parseInt(response.data.totalElements);
|
|
|
this.pageNo = parseInt(response.data.number) + 1;
|
|
|
- this.totalSum = response.data.content[0].totalAmount.toFixed(2);
|
|
|
+ this.totalSum = this.moneyFormatNew(response.data.content[0].totalAmount)
|
|
|
console.log("全部合计", response.data.content[0].totalAmount);
|
|
|
if (response.data && response.data.length == 0) {
|
|
|
this.$message("未找到相应数据");
|
|
@@ -526,6 +539,9 @@ export default {
|
|
|
</script>
|
|
|
|
|
|
<style scope>
|
|
|
+.paddingLeft {
|
|
|
+ padding: 0 20px 0 20px;
|
|
|
+}
|
|
|
.marginTop {
|
|
|
margin-top: 20px;
|
|
|
}
|
|
@@ -541,7 +557,7 @@ export default {
|
|
|
color: red;
|
|
|
/* color: #f0f9eb; */
|
|
|
}
|
|
|
-.totalSumDiv{
|
|
|
+.totalSumDiv {
|
|
|
width: 100%;
|
|
|
/* text-align: right; */
|
|
|
padding-left: 120px;
|