556 lines
20 KiB
Vue
556 lines
20 KiB
Vue
<template>
|
||
<div>
|
||
<!-- 头部 -->
|
||
<!-- <Header :title="title" @onClickLeft="onClickLeft" /> -->
|
||
<div class="list">
|
||
<!-- 客户详情信息 -->
|
||
<div class="list-item">
|
||
<div class="list-item-customerName">{{ personInfo.customerName }}</div>
|
||
<div class="list-item-div">
|
||
<img src="@/assets/customerTypeName.png" alt="" />类型:{{ typeName }}
|
||
</div>
|
||
<div class="list-item-div">
|
||
<img src="@/assets/detailAddress.png" alt="" />地址:{{ personInfo.detailAddress }}
|
||
</div>
|
||
<div class="list-item-div">
|
||
<img src="@/assets/orgName.png" alt="" />所属区域:{{ personInfo.orgName }}
|
||
</div>
|
||
<div class="list-item-div ">
|
||
<img src="@/assets/contactName.png" alt="" /> 联系人:{{ personInfo.contactName }}
|
||
|
||
</div>
|
||
<div class="list-item-div list-item-display" style="overflow: unset;">
|
||
<img src="@/assets/contactPhone.png" alt="" />联系电话:{{ personInfo.contactPhone }}
|
||
<div class="list-item-text" @click="archivalInformation">
|
||
档案信息
|
||
</div>
|
||
</div>
|
||
</div>
|
||
<!--最新诊断报告 -->
|
||
<div class="new" v-if="customerStatistic.alarmList && customerStatistic.alarmList.length > 0">
|
||
<img src="@/assets/nio_icon@2x.png" alt="" /> {{ customerStatistic.alarmList[0]}}
|
||
</div>
|
||
<!-- 能源诊断报告图 -->
|
||
<div class="new-img" @click="goenergyReport" v-if="customerStatistic.alarmList && customerStatistic.alarmList.length > 0">
|
||
<img src="@/assets/mid_pic@2x.png" alt="" />
|
||
</div>
|
||
<!-- 建筑信息/用能设备信息/能耗数据信息 -->
|
||
<div class="info">
|
||
<div class="info-img" @click="constructionInfo" style="border-bottom: 2px solid #64d1ca">
|
||
<img src="@/assets/architecture.png" alt="" />
|
||
<p class="gray">建筑信息</p>
|
||
</div>
|
||
<div class="info-img" @click="facilityManage" style="border-bottom: 2px solid #ffc466">
|
||
<img src="@/assets/energy.png" alt="" />
|
||
<p class="gray">用能设备信息</p>
|
||
</div>
|
||
<div class="info-img" @click="energyConsumption" style="border-bottom: 2px solid #10968b">
|
||
<img src="@/assets/consumption.png" alt="" />
|
||
<p class="gray">能耗数据信息</p>
|
||
</div>
|
||
</div>
|
||
<!-- 建筑信息详情 -->
|
||
<div class="architecture">
|
||
<div class="architecture-div">
|
||
<p class="gray" style="margin-bottom: 10px;">总建筑面积</p>
|
||
<div class="architecture-m2">{{ customerStatistic.totalArea ? customerStatistic.totalArea : 0 }}</div>
|
||
<div style="color: #2382ff;">m²</div>
|
||
</div>
|
||
<div class="line"></div>
|
||
<div class="architecture-div">
|
||
<p class="gray" style="margin-bottom: 10px;">用能人数</p>
|
||
<div class="architecture-m2">
|
||
<span>{{ customerStatistic.peopleNum ? customerStatistic.peopleNum : 0 }}</span>
|
||
</div>
|
||
<div style="color: #2382ff;">人</div>
|
||
</div>
|
||
<div class="line"></div>
|
||
<div class="architecture-div">
|
||
<p class="gray" style="margin-bottom: 10px;">单位面积能耗</p>
|
||
<div class="architecture-m2">
|
||
<span>{{ customerStatistic.unitAreaEnergy ? customerStatistic.unitAreaEnergy : 0 }}</span>
|
||
</div>
|
||
<div style="color: #2382ff;">千克折煤/m³</div>
|
||
</div>
|
||
<div class="line"></div>
|
||
<div class="architecture-div">
|
||
<p class="gray" style="margin-bottom: 10px;">人均能耗</p>
|
||
<div class="architecture-m2">
|
||
<span>{{ customerStatistic.perEnergy ? customerStatistic.perEnergy : 0 }}</span>
|
||
</div>
|
||
<div style="color: #2382ff;">千克折煤/人</div>
|
||
</div>
|
||
</div>
|
||
<!-- 年度能耗详情 -->
|
||
<div class="energy">
|
||
<p class="energy-p">{{ customerStatistic.energyYear }}年度能耗</p>
|
||
<div class="energy-p-div"></div>
|
||
<div class="energy1">
|
||
<div class="energy-div">
|
||
<p class="gray" style="margin-bottom: 10px;">电能</p>
|
||
<div class="energy-m2">{{ customerStatistic.power ? customerStatistic.power : 0 }}</div>
|
||
<div style="color: #ffc466;">kWh</div>
|
||
</div>
|
||
<div class="line"></div>
|
||
<div class="energy-div">
|
||
<p class="gray" style="margin-bottom: 10px;">天燃气</p>
|
||
<div class="energy-m2">
|
||
{{ customerStatistic.naturalGas ? customerStatistic.naturalGas : 0 }}
|
||
</div>
|
||
<div style="color: #ffc466;">m³</div>
|
||
</div>
|
||
<div class="line"></div>
|
||
<div class="energy-div">
|
||
<p class="gray" style="margin-bottom: 10px;">饱和蒸汽</p>
|
||
<div class="energy-m2">{{ customerStatistic.steam ? customerStatistic.steam : 0 }}</div>
|
||
<div style="color: #ffc466;">t</div>
|
||
</div>
|
||
<div class="line"></div>
|
||
<div class="energy-div">
|
||
<p class="gray" style="margin-bottom: 10px;">光伏</p>
|
||
<div class="energy-m2">
|
||
{{ customerStatistic.energyPv ? customerStatistic.energyPv : 0 }}
|
||
</div>
|
||
<div style="color: #ffc466;">kWh</div>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
<!-- 能耗数据信息详情 -->
|
||
<div class="consumption">
|
||
<p class="consumption-p">用能设备统计</p>
|
||
<div class="consumption-p-div"></div>
|
||
<div class="consumption1">
|
||
<div class="consumption-div">
|
||
<div class="consumption-m2">
|
||
{{ customerStatistic.refrigeFlagDesc }}台
|
||
</div>
|
||
<p class="gray">空调制冷</p>
|
||
</div>
|
||
<div class="line"></div>
|
||
<div class="consumption-div">
|
||
<div class="consumption-m2">
|
||
{{ customerStatistic.heatFlagDesc }}台
|
||
</div>
|
||
<p class="gray">采暖</p>
|
||
</div>
|
||
<div class="line"></div>
|
||
<div class="consumption-div">
|
||
<div class="consumption-m2">
|
||
{{ customerStatistic.lightFlagDesc }}盏
|
||
</div>
|
||
<p class="gray">照明</p>
|
||
</div>
|
||
<div class="line"></div>
|
||
<div class="consumption-div">
|
||
<div class="consumption-m2">
|
||
{{ customerStatistic.distributeFlagDesc }}台
|
||
</div>
|
||
<p class="gray">配电</p>
|
||
</div>
|
||
<div class="line"></div>
|
||
<div class="consumption-div">
|
||
<div class="consumption-m2">
|
||
{{ customerStatistic.hotWaterFlagDesc }}台
|
||
</div>
|
||
<p class="gray">生活热水</p>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</template>
|
||
|
||
<script>
|
||
|
||
import {
|
||
getCurrentPersonInfoAPI,
|
||
getCustomerStatisticAPI,
|
||
} from '@/api/customerIformation.js'
|
||
// import { getInfo } from '@/api/api'
|
||
import { getCode } from '@/api/common.js'
|
||
// import Header from '@/components/headerNew'
|
||
// import { Dialog } from 'vant'
|
||
// import { getEnergyEquip } from '@/api/energyConsumption'
|
||
// import { getSingleInfo } from "@/api/customer.js";
|
||
export default {
|
||
components: {
|
||
// Header,
|
||
},
|
||
data() {
|
||
return {
|
||
currentPath: {
|
||
path: '',
|
||
type: 2,
|
||
name: '',
|
||
},
|
||
title: '客户能效管理',
|
||
statusPopup: false,
|
||
datePopup: false,
|
||
currentDate: new Date(),
|
||
// customerId: this.$route.query.customerId,
|
||
personInfo: {}, //客户信息
|
||
customerStatistic: {}, //统计信息
|
||
typeList: [], //客户类型
|
||
buildId: '',
|
||
customerData: {},
|
||
}
|
||
},
|
||
beforeDestroy() {
|
||
// sessionStorage.removeItem('tidCid')
|
||
},
|
||
created() {
|
||
// sessionStorage.removeItem('tidCid')
|
||
},
|
||
mounted() {
|
||
this.currentPersonInfo()
|
||
this.getCustomerStatistic()
|
||
this.getCustomerType()
|
||
// if (!sessionStorage.getItem('goBack')) {
|
||
// this.getFacData()
|
||
// }
|
||
|
||
// this.currentPersonInfo();
|
||
},
|
||
computed: {
|
||
// 类型
|
||
typeName() {
|
||
this.typeList.forEach((v) => {
|
||
v.child.forEach((ev) => {
|
||
if (this.personInfo.customerType === ev.code) {
|
||
this.personInfo.customerTypeName = v.name + '/' + ev.name
|
||
}
|
||
})
|
||
})
|
||
return this.personInfo.customerTypeName
|
||
},
|
||
// 最新诊断时间格式处理
|
||
// timeType() {
|
||
// if(this.customerStatistic && this.customerStatistic.alarmList && this.customerStatistic.alarmList.length > 0) {
|
||
// return this.dataDetail.alarmList[0]
|
||
// }
|
||
// return null
|
||
// },
|
||
},
|
||
methods: {
|
||
//获取用能设备数据
|
||
// async getFacData() {
|
||
// let id = JSON.parse(sessionStorage.getItem('detail')).equipId
|
||
// if(!id) return
|
||
// const res = await getEnergyEquip({equipId: id})
|
||
// if (res.code == 0) {
|
||
// const data = {
|
||
// info: res.data,
|
||
// pageKey: true,
|
||
// }
|
||
// this.$store.commit('pageData/GET_EDITDATA', data)
|
||
// return
|
||
// }
|
||
// },
|
||
//查询客户类型
|
||
async getCustomerType() {
|
||
const data = {
|
||
codeSortId: '80000001004',
|
||
codeType: 'khlx',
|
||
}
|
||
const res = await getCode(data)
|
||
if (res.code === 0) {
|
||
this.typeList = res.data
|
||
}
|
||
},
|
||
//根据客户id查询单个建筑信息获取建筑id
|
||
// async getBuildId() {
|
||
// const id = JSON.parse(sessionStorage.getItem('tidCid')).customerId
|
||
// const data = {
|
||
// customerId: id
|
||
// }
|
||
// sessionStorage.setItem('tidCid', JSON.stringify(data))
|
||
// const res = await getInfo({ customerId: id })
|
||
// if (res.code && res.data) {
|
||
// this.customerData = res.data
|
||
// sessionStorage.setItem('equipId', res.data.equipId)
|
||
// }
|
||
// },
|
||
//获取点击过后当前人信息
|
||
async currentPersonInfo() {
|
||
const id = JSON.parse(sessionStorage.getItem('tidCid')).customerId
|
||
const res = await getCurrentPersonInfoAPI(id)
|
||
if (res.code == 0) {
|
||
this.personInfo = res.data
|
||
console.log(res.data, '----------');
|
||
}else{
|
||
let item = JSON.parse(sessionStorage.getItem('detail')).item
|
||
this.personInfo = item
|
||
}
|
||
},
|
||
//查询单个客户统计信息
|
||
async getCustomerStatistic() {
|
||
const id = JSON.parse(sessionStorage.getItem('tidCid')).customerId
|
||
const res = await getCustomerStatisticAPI(id)
|
||
if (res.code == 0) {
|
||
this.customerStatistic = res.data
|
||
}
|
||
},
|
||
//获取当前页面信息
|
||
getPathInfo() {
|
||
this.currentPath.path = this.$route.path
|
||
this.currentPath.name = this.title
|
||
this.$store.commit('path/SET_PATH', this.currentPath)
|
||
sessionStorage.setItem('goPage', JSON.stringify(this.currentPath))
|
||
},
|
||
// 档案信息
|
||
archivalInformation() {
|
||
this.getPathInfo()
|
||
this.$router.push('/archivalinformation')
|
||
},
|
||
// 建筑信息
|
||
constructionInfo() {
|
||
// 注释跳转 ---20240206
|
||
// this.getPathInfo()
|
||
// this.$router.push('/TaskFilling')
|
||
},
|
||
// 用能设备信息
|
||
async facilityManage() {
|
||
// 注释跳转 ---20240206
|
||
// this.$router.push('/TaskFilling')
|
||
},
|
||
// 能耗数据信息
|
||
energyConsumption() {
|
||
// 注释跳转 ---20240206
|
||
// this.getPathInfo()
|
||
// this.$router.push('/TaskFilling')
|
||
},
|
||
// 能源诊断报告
|
||
goenergyReport() {
|
||
console.log('能源诊断报告!!');
|
||
this.$store.commit('user/GET_USER_LEVEL', 2)
|
||
// this.$router.push("/energyReport");
|
||
// this.$router.push("/report");
|
||
// console.log({
|
||
// name: 'report',
|
||
// params: { customerId: JSON.parse(sessionStorage.getItem('tidCid')).customerId },
|
||
// })
|
||
this.$router.push({
|
||
name: 'report',
|
||
params: { customerId: JSON.parse(sessionStorage.getItem('tidCid')).customerId },
|
||
})
|
||
},
|
||
},
|
||
}
|
||
</script>
|
||
|
||
<style lang="less" scoped>
|
||
.list {
|
||
padding: 10px;
|
||
background-color: #fff;
|
||
.list-item {
|
||
width: 100%;
|
||
background: url('~@/assets/manage-btn.png') no-repeat 70%;
|
||
background-size: cover;
|
||
border-radius: 10px;
|
||
padding: 10px;
|
||
box-sizing: border-box;
|
||
.list-item-customerName {
|
||
font-weight: 700;
|
||
font-size: 19px;
|
||
padding: 8px 0px;
|
||
box-sizing: border-box;
|
||
color: #fff;
|
||
}
|
||
.list-item-div {
|
||
color: #fff;
|
||
opacity: 0.9;
|
||
margin: 5px 0;
|
||
display: flex;
|
||
white-space: nowrap;
|
||
text-overflow: ellipsis;
|
||
overflow: hidden;
|
||
img {
|
||
width: 20px;
|
||
height: 20px;
|
||
margin-right: 5px;
|
||
}
|
||
}
|
||
.list-item-display {
|
||
display: flex;
|
||
position: relative;
|
||
.list-item-text {
|
||
position: absolute;
|
||
top: -6px;
|
||
right: 6px;
|
||
background-color: #64d1ca;
|
||
padding: 5px;
|
||
border-radius: 5px;
|
||
box-sizing: border-box;
|
||
border: 1px solid #fff;
|
||
}
|
||
}
|
||
}
|
||
.new {
|
||
margin-top: 10px;
|
||
width: 100%;
|
||
height: 36px;
|
||
padding-left: 10px;
|
||
line-height: 36px; // border: 1px solid rgb(225, 225, 225, 0);
|
||
box-shadow: 1px 1px 10px 1px rgb(225, 225, 225, 0);
|
||
box-sizing: border-box;
|
||
border-radius: 5px;
|
||
font-weight: 700;
|
||
display: flex;
|
||
img {
|
||
width: 15px;
|
||
height: 15px;
|
||
margin: auto 10px;
|
||
}
|
||
}
|
||
.new-img {
|
||
margin-top: 10px;
|
||
text-align: center;
|
||
img {
|
||
width: 340px;
|
||
height: 70px;
|
||
}
|
||
}
|
||
.info {
|
||
margin-top: 10px;
|
||
display: flex;
|
||
justify-content: space-between;
|
||
.info-img {
|
||
display: flex; // border: 1px solid #666666;
|
||
box-shadow: 1px 1px 10px 1px rgb(225, 225, 225, 0);
|
||
padding: 12px 5px;
|
||
border-radius: 5px;
|
||
box-sizing: border-box;
|
||
img {
|
||
width: 20px;
|
||
height: 20px;
|
||
margin-right: 5px;
|
||
}
|
||
}
|
||
}
|
||
.architecture {
|
||
display: flex;
|
||
justify-content: space-evenly; // border: 1px solid #666666;
|
||
box-shadow: 1px 1px 10px 1px rgb(225, 225, 225, 0);
|
||
box-sizing: border-box;
|
||
margin-top: 20px;
|
||
padding: 15px 5px;
|
||
border-radius: 5px;
|
||
.architecture-div {
|
||
text-align: center; // border-right: 1px solid #63cbb6;
|
||
box-sizing: border-box;
|
||
.architecture-m2 {
|
||
height: 20px;
|
||
color: #2382ff;
|
||
.people {
|
||
font-size: 13px;
|
||
}
|
||
}
|
||
}
|
||
}
|
||
.energy {
|
||
margin-top: 20px;
|
||
padding: 5px; // border: 1px solid #666666;
|
||
box-shadow: 1px 1px 10px 1px rgb(225, 225, 225, 0);
|
||
box-sizing: border-box;
|
||
border-radius: 5px;
|
||
.energy-p {
|
||
color: #10968b;
|
||
font-weight: 700;
|
||
margin: 10px;
|
||
border-left: 4px solid #2b827c;
|
||
padding-left: 10px;
|
||
box-sizing: border-box;
|
||
}
|
||
.energy-p-div {
|
||
margin-bottom: 10px;
|
||
border-bottom: 1px dashed #e9e9e9;
|
||
}
|
||
.energy1 {
|
||
display: flex;
|
||
justify-content: space-evenly;
|
||
.energy-div {
|
||
padding: 5px 0 15px;
|
||
width: 25%;
|
||
text-align: center; // border-right: 1px solid #63cbb6;
|
||
box-sizing: border-box;
|
||
.energy-m2 {
|
||
color: #ffc466;
|
||
height: 20px; // margin-bottom: 5px;
|
||
.people {
|
||
font-size: 13px;
|
||
}
|
||
}
|
||
}
|
||
}
|
||
}
|
||
.consumption {
|
||
margin-top: 20px;
|
||
padding: 5px; // border: 1px solid #666666;
|
||
box-shadow: 1px 1px 10px 1px rgb(225, 225, 225, 0);
|
||
box-sizing: border-box;
|
||
border-radius: 5px;
|
||
.consumption-p {
|
||
color: #10968b;
|
||
font-weight: 700;
|
||
margin: 10px;
|
||
border-left: 4px solid #2b827c;
|
||
padding-left: 10px;
|
||
box-sizing: border-box;
|
||
}
|
||
.consumption-p-div {
|
||
margin-bottom: 10px;
|
||
border-bottom: 1px dashed #e9e9e9;
|
||
}
|
||
.consumption1 {
|
||
display: flex;
|
||
justify-content: space-evenly;
|
||
.consumption-div {
|
||
padding: 5px 0 15px;
|
||
width: 20%;
|
||
text-align: center; // border-right: 1px solid #63cbb6;
|
||
box-sizing: border-box;
|
||
.consumption-m2 {
|
||
height: 25px;
|
||
color: #10968b;
|
||
}
|
||
}
|
||
}
|
||
}
|
||
}
|
||
|
||
.btn {
|
||
position: fixed;
|
||
bottom: 20px;
|
||
padding: 0 10px;
|
||
.faqi {
|
||
width: 355px;
|
||
background-color: #63cbb6;
|
||
color: #fff;
|
||
border-radius: 8px;
|
||
}
|
||
}
|
||
|
||
.van-cell__title,
|
||
.van-cell__value {
|
||
-webkit-box-flex: 1;
|
||
flex: 1;
|
||
display: flex;
|
||
justify-content: space-between;
|
||
}
|
||
|
||
.van-tag--primary {
|
||
background-color: #63cbb6;
|
||
}
|
||
|
||
.gray {
|
||
color: #808080;
|
||
}
|
||
|
||
.line {
|
||
width: 2px;
|
||
height: 60px;
|
||
margin-top: 5px;
|
||
background: linear-gradient(to bottom, #f5fafa, #daedec, #f5fafa);
|
||
}
|
||
</style>
|