<template>
|
<div class="summary" v-if="summaryArr.length">
|
<p class="title">
|
<span></span>
|
物业汇总信息
|
</p>
|
<el-form inline label-width="165px" size="small">
|
<el-form-item v-for="(item,index) in summaryArr" :key="index" :label="item.filedDescription" v-show="item.visible">
|
<el-input v-model="item.value" disabled></el-input>
|
</el-form-item>
|
</el-form>
|
</div>
|
</template>
|
<script>
|
import { queryHouseTotalInfo } from "@/api/product";
|
export default {
|
props: ["serialNo", "customerid", "update"],
|
data() {
|
return {
|
summaryArr: []
|
};
|
},
|
created() {
|
this.getHouseTotalInfo();
|
},
|
watch: {
|
update(val) {
|
if (val) {
|
this.getHouseTotalInfo();
|
this.$emit("sendUpdate", false);
|
}
|
}
|
},
|
methods: {
|
// 物业汇总信息查询
|
getHouseTotalInfo() {
|
const arr = [];
|
const nums = []
|
queryHouseTotalInfo({
|
applyserialno: this.serialNo,
|
customerid: this.customerid
|
}).then(res => {
|
if (JSON.stringify(res.result) != "{}") {
|
for (const key in res.result) {
|
if (
|
key == "totalhouseassessment" ||
|
key == "totaloneamt" ||
|
key == "totalonebalance" ||
|
key == "totaltwoamt" ||
|
key == "evstotal" ||
|
key == "totalmortgagerate" ||
|
key == "totalcreditline" ||
|
key == "totaltwobalance"
|
) {
|
res.result[key].value = this.formatMoney(res.result[key].value);
|
}
|
if(res.result[key].orders){
|
nums.push(parseInt(res.result[key].orders))
|
}
|
}
|
nums.sort(function(a,b) {
|
return a-b
|
});
|
nums.forEach(val => {
|
const obj = {}
|
for (const key in res.result) {
|
if (val == res.result[key].orders) {
|
arr.push(res.result[key]);
|
}
|
}
|
});
|
this.summaryArr = arr;
|
}
|
});
|
},
|
// 金额格式化
|
formatMoney(value) {
|
if (value) {
|
value =
|
parseFloat((value + "").replace(/[^\d\.-]/g, "")).toFixed(2) + "";
|
if (value == "NaN") return;
|
let l = value
|
.split(".")[0]
|
.split("")
|
.reverse();
|
let r = value.split(".")[1];
|
let t = "";
|
for (let i = 0; i < l.length; i++) {
|
t += l[i] + ((i + 1) % 3 === 0 && i + 1 !== l.length ? "," : "");
|
}
|
return (
|
t
|
.split("")
|
.reverse()
|
.join("") +
|
"." +
|
r
|
);
|
}
|
}
|
}
|
};
|
</script>
|
<style lang="stylus">
|
.summary
|
margin-bottom 36px
|
margin-left 10px
|
.el-form
|
margin-left 10px
|
display: flex
|
justify-content: flex-start
|
flex-wrap: wrap
|
.el-form-item
|
display: table
|
width: 33.33%
|
margin: 0 0 24px 0
|
padding-right: 50px
|
box-sizing:border-box
|
@media (max-width:1280px){
|
&{
|
width: 40%
|
}
|
}
|
.el-form-item__label
|
display: table-cell
|
color: #888
|
line-height: 16px
|
.el-form-item__content
|
width 100%
|
.el-input__inner
|
color #222
|
</style>
|