393 lines
11 KiB
Vue
393 lines
11 KiB
Vue
<template>
|
||
<div class="tarnsform">
|
||
<!-- <reportHeader v-if="show" title="清洁能源利用"></reportHeader> -->
|
||
<div class="tarnsform-content" v-if="this.flagModule">
|
||
<div class="tarnsform-title">
|
||
<img src="@/assets/energyReport-left.png" alt="" />
|
||
<div class="tarnsform-title-color">节能改造措施</div>
|
||
<img src="@/assets/energyReport-right.png" alt="" />
|
||
</div>
|
||
<div>
|
||
近年来,贵单位一贯重视节能工作。积极采取了一些措施降低能耗,具体改造内容如下:
|
||
</div>
|
||
<div class="tarnsform-card" v-if="centralizeModifyYear">
|
||
<div class="card-img">
|
||
<img
|
||
class="tarnsform-card-img"
|
||
src="@/assets/jzs.png"
|
||
alt=""
|
||
/>
|
||
</div>
|
||
<div class="card-text">
|
||
<h1>空调制冷系统-集中式空调改造方式</h1>
|
||
<div
|
||
v-for="(item, index) in JSON.parse(
|
||
EnergyReportInfo.centralizeModifyYear
|
||
)"
|
||
:key="index"
|
||
>
|
||
{{ index + 1 }}、 {{ item }}
|
||
</div>
|
||
</div>
|
||
</div>
|
||
<div class="tarnsform-card" v-if="multiCtrlModifyYear">
|
||
<div class="card-img">
|
||
<img
|
||
class="tarnsform-card-img"
|
||
src="@/assets/jlkt.png"
|
||
alt=""
|
||
/>
|
||
</div>
|
||
<div class="card-text">
|
||
<h1>空调制冷系统-多联式空调改造方式</h1>
|
||
<div
|
||
v-for="(item, index) in JSON.parse(
|
||
EnergyReportInfo.multiCtrlModifyYear
|
||
)"
|
||
:key="index"
|
||
>
|
||
{{ index + 1 }}、 {{ item }}
|
||
</div>
|
||
</div>
|
||
</div>
|
||
<div class="tarnsform-card" v-if="heatDeviceModifyYear">
|
||
<div class="card-img">
|
||
<img class="tarnsform-card-img" src="@/assets/cn.png" alt="" />
|
||
</div>
|
||
<div class="card-text">
|
||
<h1>采暖系统改造方式</h1>
|
||
<div
|
||
v-for="(item, index) in JSON.parse(
|
||
EnergyReportInfo.heatDeviceModifyYear
|
||
)"
|
||
:key="index"
|
||
>
|
||
{{ index + 1 }}、 {{ item }}
|
||
</div>
|
||
</div>
|
||
</div>
|
||
<div class="tarnsform-card" v-if="ratioLedModifyYear">
|
||
<div class="card-img">
|
||
<img class="tarnsform-card-img" src="@/assets/zm.png" alt="" />
|
||
</div>
|
||
<div class="card-text">
|
||
<h1>照明系统改造方式</h1>
|
||
<div
|
||
v-for="(item, index) in JSON.parse(
|
||
EnergyReportInfo.ratioLedModifyYear
|
||
)"
|
||
:key="index"
|
||
>
|
||
{{ index + 1 }}、 {{ item }}
|
||
</div>
|
||
</div>
|
||
</div>
|
||
<div class="tarnsform-card" v-if="distributeMakeModifyYear">
|
||
<div class="card-img">
|
||
<img class="tarnsform-card-img" src="@/assets/pd.png" alt="" />
|
||
</div>
|
||
<div class="card-text">
|
||
<h1>配电系统改造方式</h1>
|
||
<div
|
||
v-for="(item, index) in JSON.parse(
|
||
EnergyReportInfo.distributeMakeModifyYear
|
||
)"
|
||
:key="index"
|
||
>
|
||
{{ index + 1 }}、 {{ item }}
|
||
</div>
|
||
</div>
|
||
</div>
|
||
<div class="tarnsform-card" v-if="hotWaterCtrlModifyYear">
|
||
<div class="card-img">
|
||
<img class="tarnsform-card-img" src="@/assets/rs.png" alt="" />
|
||
</div>
|
||
<div class="card-text">
|
||
<h1>生活热水系统改造方式</h1>
|
||
<div
|
||
v-for="(item, index) in JSON.parse(
|
||
EnergyReportInfo.hotWaterCtrlModifyYear
|
||
)"
|
||
:key="index"
|
||
>
|
||
{{ index + 1 }}、 {{ item }}
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
<!-- {{levelShow}}
|
||
{{imageUrl}} -->
|
||
<div
|
||
class="tarnsform-footer"
|
||
@click="goSignature"
|
||
v-if="levelShow && !imageUrl && EnergyReportInfo.grsgState == 1"
|
||
>
|
||
签名
|
||
</div>
|
||
|
||
<div v-if='imageUrl' class="img-box">
|
||
<img :src="imageUrl" >
|
||
</div>
|
||
</div>
|
||
</template>
|
||
|
||
<script>
|
||
// import reportHeader from './report-header.vue'
|
||
import { downloadUrl } from '@/settings'
|
||
import { mapState,mapMutations } from 'vuex'
|
||
import { setTitle } from '@/utils/dsbridge.js'
|
||
import { Notify } from 'vant'
|
||
import { getLoginCustomerAPI,getReport } from '@/api/energyReport.js'
|
||
|
||
export default {
|
||
props: {
|
||
check: {
|
||
type: Boolean,
|
||
default: true
|
||
}
|
||
},
|
||
data() {
|
||
return {
|
||
signed: '',
|
||
signFile: '',
|
||
flagModule:false,
|
||
isState: false
|
||
// EnergyReportInfo: {}
|
||
|
||
}
|
||
},
|
||
// components: { reportHeader },
|
||
created() {
|
||
setTitle('节能改造措施')
|
||
this.getEnergyReportInfo()
|
||
|
||
this.signed = sessionStorage.getItem('signed')
|
||
|
||
const obj = JSON.parse(sessionStorage.getItem('tidCid'))
|
||
if(obj&&obj.item && obj.item.isState) {
|
||
this.isState = obj.item.isState
|
||
}
|
||
|
||
|
||
if(this.centralizeModifyYear ||
|
||
this.multiCtrlModifyYear ||
|
||
this.heatDeviceModifyYear ||
|
||
this.ratioLedModifyYear ||
|
||
this.distributeMakeModifyYear ||
|
||
this.hotWaterCtrlModifyYear ){
|
||
this.flagModule = true
|
||
}
|
||
},
|
||
computed: {
|
||
...mapState('report', ['EnergyReportInfo']),
|
||
levelShow() {
|
||
// 客户经理 2
|
||
if(this.$store.getters.userLevel != 2) {
|
||
return false
|
||
}
|
||
return true
|
||
},
|
||
imageUrl() {
|
||
if(this.$store.getters.imageUrl) {
|
||
return `${downloadUrl}${this.$store.getters.imageUrl}`
|
||
}
|
||
return null
|
||
},
|
||
show() {
|
||
return localStorage.getItem('show') === 'true'
|
||
},
|
||
|
||
// 以下是判断接口是否返回对应字段
|
||
centralizeModifyYear() {
|
||
if (!this.EnergyReportInfo.centralizeModifyYear) return false
|
||
if (!this.EnergyReportInfo.centralizeModifyYear) return false
|
||
return JSON.parse(this.EnergyReportInfo.centralizeModifyYear).length > 0
|
||
},
|
||
multiCtrlModifyYear() {
|
||
if (!this.EnergyReportInfo.multiCtrlModifyYear) return false
|
||
if (!this.EnergyReportInfo.multiCtrlModifyYear) return false
|
||
return JSON.parse(this.EnergyReportInfo&&this.EnergyReportInfo.multiCtrlModifyYear).length > 0
|
||
},
|
||
heatDeviceModifyYear() {
|
||
if (!this.EnergyReportInfo.heatDeviceModifyYear) return false
|
||
if (!this.EnergyReportInfo.heatDeviceModifyYear) return false
|
||
return JSON.parse(this.EnergyReportInfo&&this.EnergyReportInfo.heatDeviceModifyYear).length > 0
|
||
},
|
||
ratioLedModifyYear() {
|
||
if (!this.EnergyReportInfo.ratioLedModifyYear) return false
|
||
return JSON.parse(this.EnergyReportInfo&&this.EnergyReportInfo.ratioLedModifyYear).length > 0
|
||
},
|
||
distributeMakeModifyYear() {
|
||
if (!this.EnergyReportInfo.distributeMakeModifyYear) return false
|
||
return (
|
||
JSON.parse(this.EnergyReportInfo&&this.EnergyReportInfo.distributeMakeModifyYear).length > 0
|
||
)
|
||
},
|
||
hotWaterCtrlModifyYear() {
|
||
if (!this.EnergyReportInfo.hotWaterCtrlModifyYear) return false
|
||
return (
|
||
JSON.parse(this.EnergyReportInfo&&this.EnergyReportInfo.hotWaterCtrlModifyYear).length > 0
|
||
)
|
||
}
|
||
},
|
||
// created() {
|
||
|
||
// },
|
||
methods: {
|
||
...mapMutations('report', ['setEnergyReportInfo']),
|
||
|
||
// 跳转到签名页面
|
||
goSignature() {
|
||
this.$router.push('/comment')
|
||
},
|
||
// 集中式空调改造方式-”字段
|
||
formaterall(val) {
|
||
let reg = '集中式空调改造方式-'
|
||
return val.replace(reg, '')
|
||
},
|
||
// 多联式空调-”字段
|
||
formatersome(val) {
|
||
let reg = '多联式空调-'
|
||
return val.replace(reg, '')
|
||
},
|
||
// 采暖系统改造方式-”字段
|
||
formaterhot(val) {
|
||
let reg = '采暖系统改造方式-'
|
||
return val.replace(reg, '')
|
||
},
|
||
|
||
|
||
//不同角色,不同id传参不同
|
||
getEnergyReportInfo() {
|
||
const level = sessionStorage.getItem('level')
|
||
// this.energyData = JSON.parse(sessionStorage.getItem('tidCid'))
|
||
if(level != 2) {
|
||
this.getLoginCustomer()
|
||
}
|
||
},
|
||
// getLoginCustomerAPI获取登录客户信息
|
||
async getLoginCustomer() {
|
||
this.loading2 = true
|
||
try {
|
||
let reportCustomerId = localStorage.getItem('reportCustomerId')
|
||
if(reportCustomerId&&this.$route.name=='energyReport'){
|
||
return
|
||
}
|
||
const res = await getLoginCustomerAPI()
|
||
// console.log(res.data.customerId);
|
||
if (res.code == 0) {
|
||
localStorage.setItem('reportCustomerId', res.data.customerId)
|
||
const data = {
|
||
customerId: res.data.customerId,
|
||
ai: this.$route.query.ai? this.$route.query.ai: sessionStorage.getItem('saikey')
|
||
}
|
||
this.getReport(data)
|
||
} else {
|
||
Notify({ type: 'danger', message: res.msg })
|
||
}
|
||
}
|
||
finally{
|
||
this.loading2 = false
|
||
}
|
||
|
||
},
|
||
//客户角色调用此接口
|
||
async getReport(data) {
|
||
this.loading2 = true
|
||
const res = await getReport(data)
|
||
try {
|
||
if(res.code == 0) {
|
||
this.saveData(res)
|
||
} else {
|
||
Notify({ type: 'danger', message: res.msg })
|
||
}
|
||
// this.getTime()
|
||
|
||
} finally{
|
||
this.loading2 = false
|
||
}
|
||
|
||
},
|
||
//数据保存
|
||
saveData(res) {
|
||
// this.EnergyReportInfo = res.data
|
||
this.setEnergyReportInfo(res.data)
|
||
},
|
||
}
|
||
}
|
||
</script>
|
||
|
||
<style scoped lang="less">
|
||
.tarnsform {
|
||
.tarnsform-content {
|
||
margin-top: 10px;
|
||
background-color: #fff;
|
||
padding: 10px;
|
||
box-sizing: border-box;
|
||
.tarnsform-title {
|
||
display: flex;
|
||
align-items: center;
|
||
justify-content: space-between;
|
||
font-weight: 700;
|
||
margin-bottom: 17px;
|
||
img {
|
||
// height: 10px;
|
||
width: 100px!important;
|
||
}
|
||
.tarnsform-title-color {
|
||
// width: 280px;
|
||
color: #146660;
|
||
font-size: 15px;
|
||
}
|
||
}
|
||
.tarnsform-card {
|
||
margin-top: 10px;
|
||
// background-color: #f1f1f1;
|
||
box-shadow: 1px 1px 10px 1px #f1f1f1;
|
||
display: flex;
|
||
// justify-content: space-between;
|
||
align-items: center;
|
||
padding: 10px;
|
||
box-sizing: border-box;
|
||
.card-img {
|
||
margin-right: 10px;
|
||
width: 80px;
|
||
.tarnsform-card-img {
|
||
width: 75px;
|
||
}
|
||
}
|
||
.card-text {
|
||
h1 {
|
||
color: #23b2a4;
|
||
font-size: 13px;
|
||
margin-bottom: 5px;
|
||
}
|
||
div {
|
||
font-size: 11px;
|
||
}
|
||
}
|
||
}
|
||
}
|
||
.tarnsform-footer {
|
||
background-color: #63cdd6;
|
||
color: #fff;
|
||
text-align: center;
|
||
padding: 10px;
|
||
margin-top: 20px;
|
||
box-sizing: border-box;
|
||
border-radius: 5px;
|
||
}
|
||
|
||
.img-box{
|
||
width: 100%;
|
||
background: #fff;
|
||
margin-top: 10px;
|
||
>img{
|
||
width: 100%;
|
||
height: auto;
|
||
display: block;
|
||
}
|
||
}
|
||
}
|
||
</style>
|