Files
energy_app/src/views/enterprise/yearEnergyAddEdit.vue
T
jiangyinzhi 63dc3bcc89 xiugai
2025-07-29 10:21:59 +08:00

1107 lines
40 KiB
Vue
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<template>
<div>
<!-- <Header :title="title" @onClickLeft="onClickLeft" /> -->
<div class="yearenergy">
<van-form @submit="handleClick">
<!-- 年份 -->
<!-- is-link -->
<!-- @click="showDatePicker" -->
<div class="container">
<van-cell
title="年份"
:value="energyYear"
class="year"
aria-disabled=""
/>
<div class="year-main" v-if="tabName == 'a'">
<!-- 能源 -->
<div class="title">
<div class="title-img"><img src="@/assets/u239.png" alt="" /></div>
<p>能源</p>
</div>
<div class="nengyuan">
<van-cell-group>
<van-field
v-input.reset
v-input.float
:disabled="showForm"
type="number"
v-model="yearForm.payPower"
label="外购电(kWh)"
placeholder="请输入"
/>
<van-field
v-input.reset
v-input.float
:disabled="showForm"
type="number"
v-model="yearForm.gasValue"
label="天然气(m³)"
placeholder="请输入"
/>
<van-field
v-input.reset
v-input.float
:disabled="showForm"
type="number"
v-model="yearForm.lowPreStreamValue"
label="低压外购蒸汽(t)"
placeholder="请输入"
/>
<van-field
v-input.reset
v-input.float
:disabled="showForm"
type="number"
v-model="yearForm.medPreStreamValue"
label="中压外购蒸汽(t)"
placeholder="请输入"
/>
<van-field
v-input.reset
v-input.float
:disabled="showForm"
type="number"
v-model="yearForm.highPreStreamValue"
label="高压外购蒸汽(t)"
placeholder="请输入"
/>
<van-field
v-input.reset
v-input.float
:disabled="showForm"
type="number"
v-model="yearForm.coalValue"
label="煤(t)"
placeholder="请输入"
/>
<van-field
v-input.reset
v-input.float
:disabled="showForm"
type="number"
v-model="yearForm.petrolValue"
label="汽油(t)"
placeholder="请输入"
/>
<van-field
v-input.reset
v-input.float
:disabled="showForm"
type="number"
v-model="yearForm.dieselValue"
label="柴油(t)"
placeholder="请输入"
/>
<van-field
v-input.reset
v-input.floatNo0
:disabled="showForm"
type="number"
v-model="yearForm.totalOutput"
@blur="checkData"
label="工业总产值(万元)"
placeholder="请输入"
/>
<van-field
v-input.reset
v-input.float
:disabled="showForm"
type="number"
@blur="checkData"
v-model="yearForm.addOutput"
label="工业增产值(万元)"
placeholder="请输入"
/>
<div class="tips" v-if="tips1">工业总产值>工业增产值</div>
</van-cell-group>
</div>
</div>
<div class="year-main" v-if="tabName == 'b'">
<van-cell
title="尚未利用的余能资源"
is-link
:value="notUsedResidueEnergyName || `请选择`"
@click="onCommon('notUsedResidueEnergyOption')"
value-class="text-ellipsis"
style="border-radius: 8px"
/>
<div class="title" style="margin-top: 12px; margin-left: 5px">
若存在尚未利用余热(高温气体、蒸汽 、热水)
</div>
<van-cell
title="主要余热排放温度"
is-link
v-if="readOnly"
:value="residueHotTempName || `请选择`"
value-class="text-ellipsis"
@click="onCommon2('residueHotTempOption')"
style="margin-top: 10px; border-radius: 8px 8px 0 0"
/>
<van-cell
title="主要余热排放温度"
is-link
title-style="color: #999"
value="无" v-else
style="margin-top: 10px; border-radius: 8px 8px 0 0"
/>
<van-cell
v-if="readOnly"
title="主要余热排放时间"
is-link
:value="residueHotTimeName || `请选择`"
value-class="text-ellipsis"
@click="onCommon2('residueHotTimeOption')"
style="border-radius: 0 0 8px 8px"
/>
<van-cell
title="主要余热排放时间"
is-link
title-style="color: #999"
value="无" v-else
style="margin-top: 10px; border-radius: 8px 8px 0 0"
/>
<div class="title" style="margin-top: 12px; margin-left: 5px">
若存在尚未利用可燃废气/废液/废料
</div>
<van-cell
v-if="readOnly"
title="可燃废气/废液/废料年排放时间"
is-link
:value="residueGasTimeName || `请选择`"
value-class="text-ellipsis"
@click="onCommon2('residueGasTime', 'residueHotTimeOption')"
style="margin-top: 10px; border-radius: 8px 8px 0 0"
/>
<van-cell
title="可燃废气/废液/废料年排放时间"
is-link
title-style="color: #999"
value="无" v-else
style="margin-top: 10px; border-radius: 8px 8px 0 0"
/>
<van-cell
v-if="readOnly"
title="企业生产工艺用热需求"
is-link
:value="heatDemandName || `请选择`"
value-class="text-ellipsis"
@click="onCommon('heatDemandOption')"
/>
<van-cell
title="企业生产工艺用热需求"
is-link
title-style="color: #999"
value="无" v-else
style="margin-top: 10px; border-radius: 8px 8px 0 0"
/>
<van-field
v-input.reset
v-show="heatDemandName && heatDemandName.indexOf('其他') >= 0"
label="其他企业生产工艺用热需求"
placeholder="请输入"
input-align="right"
v-model="heatDemandOtherName"
></van-field>
<van-cell
v-if="readOnly"
title="企业非生产用热需求"
is-link
:value="notHeatDemandName || `请选择`"
@click="onCommon('notHeatDemand', 'heatDemandOption')"
/>
<van-cell
title="企业非生产用热需求"
is-link
title-style="color: #999"
value="无" v-else
style="margin-top: 10px; border-radius: 8px 8px 0 0"
/>
<van-field
v-input.reset
v-show="notHeatDemandName && notHeatDemandName.indexOf('其他') >= 0"
label="其他企业非生产工艺用热需求"
placeholder="请输入"
v-model="notHeatDemandOtherName"
input-align="right"
></van-field>
</div>
<div class="year-main" v-if="tabName == 'c'">
<div class="partTwo-question">
<div>是否为已安装分布式光伏客户</div>
<div class="btn2">
<van-radio-group
:disabled="showForm"
v-model="yearForm.isPvInstallCondition"
direction="horizontal"
>
<van-radio checked-color="#009999" name="1">是</van-radio>
<van-radio checked-color="#009999" name="2">否</van-radio>
</van-radio-group>
</div>
</div>
<div v-if="yearForm.isPvInstallCondition == '1'">
<van-field
v-input.float
label="已装机容量(kW)"
type="number"
v-model="yearForm.installedCapacityValue"
placeholder="请输入"
required :rules="[{ required: true }]"
input-align="right"
:disabled="showForm"
></van-field>
<van-field
v-input.float
label="实际年发电量(kWh)"
type="number"
v-model="yearForm.actualPowerValue"
placeholder="请输入"
required :rules="[{ required: true }]"
input-align="right"
:disabled="showForm"
></van-field>
<!-- <div class="tips" v-if="tips2 == true">0<光伏实际年发电量/光伏已装机容量<2000</div> -->
<van-field
v-input.float
label="年发电小时数(h)"
type="number"
v-model="yearForm.actualPowerHoursValue"
placeholder="请输入"
required :rules="[{ required: true }]"
input-align="right"
style="border-radius: 0 0 8px 8px"
@input="showTips"
:disabled="showForm"
></van-field>
<div class="tips" v-if="tips0 == true">年发电小时数≤3000h</div>
</div>
<div class="partTwo-question" style="margin-top: 20px">
<div>是否具备光伏发电安装条件</div>
<div class="btn2">
<van-radio-group
v-model="yearForm.isPowerInstallCondition"
direction="horizontal"
:disabled="showForm"
>
<van-radio checked-color="#009999" name="1">是</van-radio>
<van-radio checked-color="#009999" name="2">否</van-radio>
</van-radio-group>
</div>
</div>
<div v-if="yearForm.isPowerInstallCondition == '1'">
<van-field
v-input.float
label="彩钢瓦屋顶可装机面积(平方米)"
type="number"
v-model="yearForm.wattCapacityValue"
placeholder="请输入"
required :rules="[{ required: true }]"
input-align="right"
:disabled="showForm"
></van-field>
<van-field
v-input.float
label="混凝土屋顶可装面积(平方米)"
type="number"
v-model="yearForm.concreteCapacityValue"
placeholder="请输入"
required :rules="[{ required: true }]"
input-align="right"
:disabled="showForm"
></van-field>
<van-field
v-input.float
label="其他类型屋顶可装面积(平方米)"
type="number"
v-model="yearForm.otherCapacityValue"
placeholder="请输入"
required :rules="[{ required: true }]"
input-align="right"
style="border-radius: 0 0 8px 8px"
:disabled="showForm"
></van-field>
</div>
</div>
</div>
<div class="btn">
<van-button :disabled="showForm" size="large" class="faqi" native-type="submit">
提交
</van-button>
</div>
</van-form>
<!-- 年份选择 -->
<van-popup v-model="datePicker" position="bottom">
<van-datetime-picker
v-model="currentDate"
type="year"
@confirm="dateSelect"
@cancel="datePicker = false"
/>
</van-popup>
<!-- 复选框 -->
<van-popup v-model="showPicker" position="bottom">
<div class="two-button">
<p @click="cancel">取消</p>
<div @click="submit">确认</div>
</div>
<div class="contentBody">
<van-checkbox-group v-model="result">
<van-cell-group>
<van-cell
v-for="(item, index) in option"
clickable
:key="index"
:title="item.name"
@click="clickRadio(index)"
>
<van-checkbox
checked-color="#009999"
:name="item"
ref="checkboxes"
/>
</van-cell>
</van-cell-group>
</van-checkbox-group>
</div>
</van-popup>
<van-popup v-model="showRadio" position="bottom">
<van-picker
show-toolbar
:columns="option2"
@confirm="submit"
:default-index="defaultIndex"
@cancel="radio2 = false"
/>
</van-popup>
<!-- loading加载效果 -->
<van-overlay :show="show">
<div class="wrapper" @click.stop>
<div class="block">
<van-loading size="24px" color="#34baae" vertical
>加载中...</van-loading
>
</div>
</div>
</van-overlay>
</div>
</div>
</template>
<script>
import { Notify } from 'vant'
import { NewAddQyAPI, getQyInfo, EditQyInfo, getInfoByCustomerId } from '@/api/energyReport.js'
import { mapGetters } from "vuex";
import {debounce} from '@/utils/common.js'
export default {
name: 'yearEnergyAddEdit',
data() {
return {
tips0: false,
tips1: false,
currentDate: new Date(),
datePicker: false,
title: "逐年能源账单详情",
tidCid: null,
customerInfo: {},
tabName: 'a',
result: [],
option: [],
option2: [],
showPicker: false,
showRadio: false,
defaultIndex: 0,
show: false,
yearForm: {
id: '',
enterpriseId: '',
energyOther: '',
payPower: 0,
gasValue: 0,
lowPreStreamValue: 0,
medPreStreamValue: 0,
highPreStreamValue: 0,
coalValue: 0,
petrolValue: 0,
dieselValue: 0,
totalOutput: 0,
addOutput: 0,
energyUnutilizedVO: {
notUsedResidueEnergyType: '', // 尚未利用的余能资源
residueHotTemp: '', // 主要余热排放温度
residueHotTime: '', // 主要余热排放时间
residueGasTime: '', // 主要可燃气体/废液/废料年排放时间
heatDemand: '', // 企业生产工艺用热需求
heatDemandOther: '', // 企业生产工艺用热需求其他具体内容
notHeatDemand: '', // 企业非生产工艺用热需求
notHeatDemandOther: '', // 企业非生产工艺用热需求其他具体内容
},
isPvInstallCondition: "2",
installedCapacityValue: '', // 已装机容量
actualPowerValue: '', // 实际年发电量
actualPowerHoursValue: '', // 年有效发电小时数,
isPowerInstallCondition: "2", // 是否具备光伏发电安装条件
wattCapacityValue: '', // 彩钢瓦屋顶可装机面积
concreteCapacityValue: '', // 混凝土屋顶可装面积
otherCapacityValue: '' // 其他类型屋顶可装机面积
},
notUsedResidueEnergyName: '', // 尚未利用的余能资源名称显示
residueHotTempName: '', // 主要余热排放温度名称显示
residueHotTimeName: '', // 主要余热排放时间名称显示
residueGasTimeName: '', // 主要可燃气体/废液/废料年排放时间名称显示
heatDemandName: '', // 企业生产工艺用热需求名称显示
notHeatDemandName: '', // 企业非生产工艺用热需求名称显示
heatDemandOtherName: '', // 企业生产工艺用热需求其他具体内容
notHeatDemandOtherName: '', // 企业非生产工艺用热需求其他具体内容
doDebounce: null,
};
},
watch: {
'yearForm.isPvInstallCondition': {
handler(val){
if(val == 2) {
this.yearForm.installedCapacityValue = ''
this.yearForm.actualPowerValue = ''
this.yearForm.actualPowerHoursValue = ''
}
},
deep: true
},
'yearForm.isPowerInstallCondition': {
handler(val){
if(val == 2) {
this.yearForm.wattCapacityValue = ''
this.yearForm.concreteCapacityValue = ''
this.yearForm.otherCapacityValue = ''
}
},
deep: true
},
'heatDemandName': {
handler(val){
if(val.indexOf('其他') < 0) {
this.heatDemandOtherName = ''
}
},
deep: true
},
'notHeatDemandName': {
handler(val) {
if(val.indexOf('其他') < 0) {
this.notHeatDemandOtherName = ''
}
},
deep: true
}
},
computed: {
// 以下为字典表
// notUsedResidueEnergyOption 尚未利用的余能资源
// residueHotTempOption 主要余热排放温度
// residueHotTimeOption 主要余热排放时间/主要可燃气体/废液/废料年排放时间
// heatDemandOption 企业生产工艺用热需求/企业非生产工艺用热需求
...mapGetters(['notUsedResidueEnergyOption', 'residueHotTempOption', 'residueHotTimeOption', 'heatDemandOption']),
showForm() {
if(this.tidCid.taskId) {
return false
}
return true
},
energyYear() {
// eslint-disable-next-line vue/no-side-effects-in-computed-properties
const time = this.yearForm.energyYear = new Date().getFullYear() - 1
return time
},
readOnly(){
return this.yearForm.energyUnutilizedVO&&this.yearForm.energyUnutilizedVO.notUsedResidueEnergyType!='01'
},
// tips2(){
// let rate = Number(this.yearForm.actualPowerValue)/Number(this.yearForm.installedCapacityValue)
// if(0 < rate && 2000 > rate){
// return false
// }
// return true
// }
},
mounted() {
this.doDebounce=debounce(async function () {
await this.handelClickSave()
}, 5000, true)
},
methods: {
// 校验总产值与增加值
checkData(){
this.tips1 = false
if(!(Number(this.yearForm.addOutput)< Number(this.yearForm.totalOutput))){
this.tips1 = true
}
},
showTips(value){
this.tips0 = false
if( Number(value) > 3000){
this.tips0 = true
}
},
//根据新增或者编辑判断是否能点击年份
showDatePicker() {
if(this.$route.query.id) {
this.datePicker = false
return
}
this.datePicker = true
},
dateSelect(data) {
if(this.showForm) {
return
}
let year = data.getFullYear();
this.yearForm.energyYear = year;
this.datePicker = false
// console.log('year',year)
this.updatePayPower();
},
async updatePayPower() {
let params = {
customerId: this.customerInfo.customerId,
energyYear: this.yearForm.energyYear,
}
const res = await getInfoByCustomerId(params)
if (res.code === 0) {
if(res.data){
this.yearForm.payPower = res.data.power
}
}
},
cancel() {
this.showPicker = false
this.showRadio = false
},
submit(value) {
if(this.showForm) {
return
}
// 弹窗选中值进行处理
if(!this.yearForm.energyUnutilizedVO) {
this.yearForm.energyUnutilizedVO = {
notUsedResidueEnergyType: '', // 尚未利用的余能资源
residueHotTemp: '', // 主要余热排放温度
residueHotTime: '', // 主要余热排放时间
residueGasTime: '', // 主要可燃气体/废液/废料年排放时间
heatDemand: '', // 企业生产工艺用热需求
heatDemandOther: '', // 企业生产工艺用热需求其他具体内容
notHeatDemand: '', // 企业非生产工艺用热需求
notHeatDemandOther: '', // 企业非生产工艺用热需求其他具体内容
}
}
if(this.type == 'notUsedResidueEnergyOption') {
this.notUsedResidueEnergyName = this.result.map(item => item.name).join(',')
if(this.yearForm.energyUnutilizedVO) {
this.yearForm.energyUnutilizedVO.notUsedResidueEnergyType = this.result.map(item => item.value).join(',')
if( this.yearForm.energyUnutilizedVO.notUsedResidueEnergyType==='01' ){
this.yearForm.energyUnutilizedVO.residueHotTemp = '', // 主要余热排放温度
this.yearForm.energyUnutilizedVO.residueHotTime = '', // 主要余热排放时间
this.yearForm.energyUnutilizedVO.residueGasTime = '', // 主要可燃气体/废液/废料年排放时间
this.yearForm.energyUnutilizedVO.heatDemand = '', // 企业生产工艺用热需求
this.yearForm.energyUnutilizedVO.heatDemandOther = '', // 企业生产工艺用热需求其他具体内容
this.yearForm.energyUnutilizedVO.notHeatDemand = '', // 企业非生产工艺用热需求
this.yearForm.energyUnutilizedVO.notHeatDemandOther = '', // 企业非生产工艺用热需求其他具体内容
this.residueHotTempName = '', // 主要余热排放温度名称显示
this.residueHotTimeName = '', // 主要余热排放时间名称显示
this.residueGasTimeName = '', // 主要可燃气体/废液/废料年排放时间名称显示
this.heatDemandName = '', // 企业生产工艺用热需求名称显示
this.notHeatDemandName = '', // 企业非生产工艺用热需求名称显示
this.heatDemandOtherName = '', // 企业生产工艺用热需求其他具体内容
this.notHeatDemandOtherName = '' // 企业非生产工艺用热需求其他具体内容
}
}
} else if(this.type == 'residueHotTempOption') {
this.residueHotTempName = value.text
if(this.yearForm.energyUnutilizedVO) {
this.yearForm.energyUnutilizedVO.residueHotTemp = value.value
}
} else if(this.type == 'residueHotTimeOption') {
this.residueHotTimeName = value.text
if(this.yearForm.energyUnutilizedVO) {
this.yearForm.energyUnutilizedVO.residueHotTime = value.value
}
} else if(this.type == 'residueGasTime') {
this.residueGasTimeName = value.text
if(this.yearForm.energyUnutilizedVO) {
this.yearForm.energyUnutilizedVO.residueGasTime = value.value
}
} else if(this.type == 'heatDemandOption') {
this.heatDemandName = this.result.map(item => item.name).join(',')
if(this.yearForm.energyUnutilizedVO) {
this.yearForm.energyUnutilizedVO.heatDemand = this.result.map(item => item.value).join(',')
}
} else if(this.type == 'notHeatDemand') {
this.notHeatDemandName = this.result.map(item => item.name).join(',')
if(this.yearForm.energyUnutilizedVO) {
this.yearForm.energyUnutilizedVO.notHeatDemand = this.result.map(item => item.value).join(',')
}
}
this.showPicker = false
this.showRadio = false
},
// handelChangePvCondition(val) {
// if(val == 2) {
// this.yearForm.installedCapacityValue = ''
// this.yearForm.actualPowerValue = ''
// this.yearForm.actualPowerHoursValue = ''
// }
// },
// handelChangePowerCondition(val) {
// if(val == 2) {
// this.yearForm.wattCapacityValue = ''
// this.yearForm.concreteCapacityValue = ''
// this.yearForm.otherCapacityValue = ''
// }
// },
// 复选框
// 如果option2存在, 则和当前选项共用同一个字典
onCommon(option, option2) {
if(this.showForm) {
return
}
this.result = []
this.option = []
this.type = option
this.option = this[option2 || option]
this.showPicker = true
// 处理下拉弹窗的数据回显
this.$nextTick(() => {
if(this.yearForm.energyUnutilizedVO) {
if(this.yearForm.energyUnutilizedVO.notUsedResidueEnergyType && option === 'notUsedResidueEnergyOption') {
let dataJSON = this.yearForm.energyUnutilizedVO.notUsedResidueEnergyType.split(',')
dataJSON.forEach(item => {
let sIndex = this.notUsedResidueEnergyOption.findIndex(it => it.value == item)
this.$refs.checkboxes[sIndex].toggle()
})
}
if( this.yearForm.energyUnutilizedVO.heatDemand && option === 'heatDemandOption') {
let dataJSON = this.yearForm.energyUnutilizedVO.heatDemand.split(',')
dataJSON.forEach(item => {
let sIndex = this.heatDemandOption.findIndex(it => it.value == item)
this.$refs.checkboxes[sIndex].toggle()
})
}
if( this.yearForm.energyUnutilizedVO.notHeatDemand && option === 'notHeatDemand') {
let dataJSON = this.yearForm.energyUnutilizedVO.notHeatDemand.split(',')
dataJSON.forEach(item => {
let sIndex = this.heatDemandOption.findIndex(it => it.value == item)
this.$refs.checkboxes[sIndex].toggle()
})
}
}
})
},
// 单选框
// 如果option2存在, 则和当前选项共用同一个字典
onCommon2(option, option2) {
if(this.showForm) {
return
}
this.option2 = []
this.type = option
this.option2 = this[option2 || option].map(item => {
return { value: item.value, text: item.name }
})
this.showRadio = true
// 处理下拉弹窗的数据回显
this.$nextTick(() => {
if(this.yearForm.energyUnutilizedVO) {
if( this.yearForm.energyUnutilizedVO.residueHotTemp && option === 'residueHotTempOption') {
let sIndex = this.residueHotTempOption.findIndex(it => it.value == this.yearForm.energyUnutilizedVO.residueHotTemp)
this.defaultIndex = sIndex
}
if( this.yearForm.energyUnutilizedVO.residueHotTime && option === 'residueHotTimeOption') {
let sIndex = this.residueHotTimeOption.findIndex(it => it.value == this.yearForm.energyUnutilizedVO.residueHotTime)
this.defaultIndex = sIndex
}
if( this.yearForm.energyUnutilizedVO.residueGasTime && option === 'residueGasTime') {
let sIndex = this.residueHotTimeOption.findIndex(it => it.value == this.yearForm.energyUnutilizedVO.residueGasTime)
this.defaultIndex = sIndex
}
}
})
},
// 复选框点击事件
clickRadio(index) {
if(this.showForm) {
return
}
// 处理单选择'无', 对其他选项进行处理
if(this.type == 'notUsedResidueEnergyOption' || this.type == 'heatDemandOption' || this.type == 'notHeatDemand') {
if(this.notUsedResidueEnergyOption[index].name == '无') {
this.option.forEach((item, idx) => {
this.$refs.checkboxes[idx].toggle(false);
})
} else {
this.$refs.checkboxes[0].toggle(false);
}
}
this.$refs.checkboxes[index].toggle();
},
handleClick(){
this.doDebounce()
},
// 保存接口
async handelClickSave() {
if(!this.yearForm.energyYear) {
Notify({ type: 'danger', duration: 500, message: '请选择年份' })
return
}
if(this.tabName == 'a'){
this.checkData()
}
if(this.tabName == 'b') {
if(this.heatDemandOtherName) {
this.yearForm.energyUnutilizedVO.heatDemandOther = this.heatDemandOtherName
}
if(this.notHeatDemandOtherName) {
this.yearForm.energyUnutilizedVO.notHeatDemandOther = this.notHeatDemandOtherName
}
this.yearForm.energyUnutilizedVO = Object.assign( this.yearForm.energyUnutilizedVO ,this.customerInfo)
}
if(this.tabName == 'a'&&this.tips1){
return
}
if(this.tabName == 'c'&&this.tips0){
return
}
// if(this.yearForm.isPvInstallCondition == '1'&&this.tips2){
// return
// }
let params = Object.assign(this.customerInfo, this.yearForm)
params.taskId = this.tidCid.taskId
if(this.$route.query.id) {
const res = await EditQyInfo(params)
if (res.code == 0) {
Notify({ type: 'success', background: '#34baae', duration: 500, message: '修改成功' })
} else {
Notify({ type: 'danger', duration: 500, message: res.msg })
return
}
} else {
const res = await NewAddQyAPI(params)
if (res.code == 0) {
Notify({ type: 'success', background: '#34baae',duration: 500, message: '新增成功' })
} else {
Notify({ type: 'danger', duration: 500, message: res.msg })
return
}
}
setTimeout(() => {
this.$router.push({
path: '/acquisition',
query:{
id: sessionStorage.getItem('enId')
}
})
}, 1000)
},
async getDetail() {
this.show = true
try {
const { data } = await getQyInfo({ id: this.$route.query.id })
this.show = false
this.yearForm = data
// console.log(this.yearForm.isPvInstallCondition);
// console.log(this.yearForm.isPowerInstallCondition);
if(!data.isPvInstallCondition) {
this.yearForm.isPvInstallCondition = "0"
}
if(!data.isPowerInstallCondition) {
this.yearForm.isPowerInstallCondition = "0"
}
// 处理下拉数据中文的显示
if(this.yearForm.energyUnutilizedVO && this.tabName == 'b') {
if(this.yearForm.energyUnutilizedVO.notUsedResidueEnergyType) {
let values = this.yearForm.energyUnutilizedVO.notUsedResidueEnergyType.split(',')
let names = this.notUsedResidueEnergyOption.filter(item => {
return values.some(it => it == item.value)
})
this.notUsedResidueEnergyName = names.map(item => item.name).join(',')
}
if(this.yearForm.energyUnutilizedVO.heatDemand) {
let values = this.yearForm.energyUnutilizedVO.heatDemand.split(',')
let names = this.heatDemandOption.filter(item => {
return values.some(it => it == item.value)
})
this.heatDemandName = names.map(item => item.name).join(',')
}
if(this.yearForm.energyUnutilizedVO.notHeatDemand) {
let values = this.yearForm.energyUnutilizedVO.notHeatDemand.split(',')
let names = this.heatDemandOption.filter(item => {
return values.some(it => it == item.value)
})
this.notHeatDemandName = names.map(item => item.name).join(',')
}
if(this.yearForm.energyUnutilizedVO.residueHotTemp) {
let values = this.yearForm.energyUnutilizedVO.residueHotTemp
let names = this.residueHotTempOption.filter(item => item.value == values)
this.residueHotTempName = names.map(item => item.name).join(',')
}
if(this.yearForm.energyUnutilizedVO.residueHotTime) {
let values = this.yearForm.energyUnutilizedVO.residueHotTime
let names = this.residueHotTimeOption.filter(item => item.value == values)
this.residueHotTimeName = names.map(item => item.name).join(',')
}
if(this.yearForm.energyUnutilizedVO.residueGasTime) {
let values = this.yearForm.energyUnutilizedVO.residueGasTime
let names = this.residueHotTimeOption.filter(item => item.value == values)
this.residueGasTimeName = names.map(item => item.name).join(',')
}
this.heatDemandOtherName = this.yearForm.energyUnutilizedVO.heatDemandOther
this.notHeatDemandOtherName = this.yearForm.energyUnutilizedVO.notHeatDemandOther
}
} catch (error) {
this.show = false
}
},
async getInt() {
if(this.$route.query.id) {
this.getDetail()
}
}
},
created() {
let infoData = JSON.parse(sessionStorage.getItem('tidCid'))
this.tidCid = infoData
if(typeof(this.$route.query.enId) == 'string') {
this.yearForm.enterpriseId = Number(this.$route.query.enId)
}
this.tabName = this.$route.query.tab
this.customerInfo = {
customerId: infoData.item&&infoData.item.customerId,
customerName: infoData.item&&infoData.item.consName,
customerType: infoData.item&&infoData.item.customerType,
// creditCode: '33121'
}
// console.log(this.customerInfo, 'oooooooooo');
this.getInt()
}
};
</script>
<style lang="less" scoped>
.yearenergy {
padding: 15px 10px;
.container {
height: calc(100vh - 80px);
overflow: auto;
}
.year-main {
margin-top: 10px;
}
.year {
// padding: 20px 20px;
border-radius: 10px;
}
.title {
margin: 10px;
display: flex;
.title-img {
width: 20px;
img {
width: 100%;
}
}
p {
font-size: 14px;
color: #009999;
line-height: 20px;
}
}
.nengyuan {
width: 100%;
border-radius: 10px;
background: #fff;
box-sizing: border-box;
overflow: hidden;
}
.faqi {
background-color: #63cbb6;
color: #fff;
border-radius: 8px;
}
}
.text-ellipsis {
span {
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
-o-text-overflow: ellipsis;
}
}
/deep/ .van-cell {
width: 100%;
display: flex;
}
.van-cell__title,
.van-cell__value {
-webkit-box-flex: 1;
-webkit-flex: 1;
flex: 1;
span {
font-size: 14px;
color: #333;
}
}
.contentBody {
height: 250px;
overflow: auto;
}
::v-deep .van-field__label {
-webkit-box-flex: 0;
-webkit-flex: none;
flex: none;
box-sizing: border-box;
flex: 1;
text-align: left;
word-wrap: break-word;
span {
font-size: 14px;
color: #333;
}
}
::v-deep .van-cell__value {
position: relative;
overflow: hidden;
color: #969799;
text-align: right;
vertical-align: middle;
word-wrap: break-word;
}
::v-deep .van-field__body {
display: -webkit-box;
display: -webkit-flex;
display: flex;
-webkit-box-align: center;
-webkit-align-items: center;
align-items: center;
}
::v-deep .van-field__control {
text-align: right;
font-size: 14px;
}
.two-button {
padding: 15px;
display: flex;
justify-content: space-between;
}
.two-button > p {
color: #969799;
}
.two-button > div {
color: #34baae;
}
.van-cell__value {
position: relative;
overflow: hidden;
color: #969799;
text-align: right;
vertical-align: middle;
word-wrap: break-word;
display: flex;
justify-content: flex-end;
}
.title {
font-size: 14px;
color: #000;
}
::v-deep .van-field__label {
-webkit-box-flex: 0;
-webkit-flex: none;
flex: none;
box-sizing: border-box;
width: 6.2em;
margin-right: 0.32rem;
color: #323233;
text-align: left;
word-wrap: break-word;
font-size: 14px;
width: 75%;
}
.partTwo-question {
width: 100%;
background-color: #fff;
border-radius: 8px 8px 0 0;
padding: 20px 10px;
box-sizing: border-box;
font-size: 14px;
color: #000;
display: flex;
justify-content: space-between;
}
.btn2 {
display: flex;
.btn-click2 {
display: flex;
align-items: center;
span {
color: #9d9d9d;
font-size: 14px;
}
}
.round-out {
width: 12px;
height: 12px;
border-radius: 50%;
margin: 0 7px;
display: flex;
justify-content: center;
align-items: center;
overflow: hidden;
.round-in {
width: 8px;
height: 8px;
border-radius: 50%;
}
}
.yes-out {
border: 2.5px solid #34baae;
.yes-in {
background: #34baae;
}
}
.no-out {
border: 2px solid #b3b3b3;
}
}
.wrapper {
display: flex;
align-items: center;
justify-content: center;
height: 100%;
}
.tips {
padding: 0 16px;
display: flex;
justify-content: flex-end;
color: #ee0a24;
font-size: 12px;
}
</style>