1312 lines
39 KiB
Vue
1312 lines
39 KiB
Vue
<template>
|
||
<div>
|
||
<!-- 头部 -->
|
||
<!-- <Header :title="title" @onClickLeft="onClickLeft" /> -->
|
||
<!-- 选项卡 -->
|
||
<div class="container">
|
||
<van-tabs
|
||
v-model="active"
|
||
color="#63cbb6"
|
||
title-active-color="#63cbb6"
|
||
swipe-threshold="3"
|
||
line-width="60px"
|
||
>
|
||
<van-tab title="能源信息" class="padding">
|
||
<div class="partone-box">
|
||
<div class="title">企业具有的通用能源系统</div>
|
||
<van-checkbox-group :disabled="showForm" v-model="result">
|
||
<van-checkbox
|
||
v-for="(item, index) in list"
|
||
:key="index"
|
||
:name="item"
|
||
shape="square"
|
||
checked-color="#009999"
|
||
>
|
||
{{ item.name }}
|
||
</van-checkbox>
|
||
</van-checkbox-group>
|
||
</div>
|
||
<div class="partone-box">
|
||
<div class="title">能源计量建设</div>
|
||
<div class="needLine">
|
||
<div class="little-title">(1) 一级计量(进出用能企业)</div>
|
||
<van-checkbox-group :disabled="showForm" v-model="result2">
|
||
<van-checkbox
|
||
v-for="(item, index) in list2"
|
||
:key="index"
|
||
:name="item"
|
||
shape="square"
|
||
checked-color="#009999"
|
||
>
|
||
{{ item.name }}
|
||
</van-checkbox>
|
||
</van-checkbox-group>
|
||
</div>
|
||
<div class="needLine">
|
||
<div class="little-title">
|
||
(2) 二级计量(进出主要次级用能单位)
|
||
</div>
|
||
<van-checkbox-group :disabled="showForm" v-model="result3">
|
||
<van-checkbox
|
||
v-for="(item, index) in list3"
|
||
:key="index"
|
||
:name="item"
|
||
shape="square"
|
||
checked-color="#009999"
|
||
>
|
||
{{ item.name }}
|
||
</van-checkbox>
|
||
</van-checkbox-group>
|
||
</div>
|
||
<div>
|
||
<div class="little-title">
|
||
(3) 三级计量(主要用能设备)能源计量器具配备率是否高于90%
|
||
</div>
|
||
<div class="btn">
|
||
<div class="btn-click" @click="handelClickOk">
|
||
<div
|
||
:class="isfaly ? 'round-out yes-out' : 'round-out no-out'"
|
||
>
|
||
<div
|
||
:class="isfaly ? 'round-in yes-in' : 'round-in no-in'"
|
||
></div>
|
||
</div>
|
||
<span style="margin-left: 20px;">是</span>
|
||
</div>
|
||
<div class="btn-click" @click="handelClickNo">
|
||
<div
|
||
:class="isfaly ? 'round-out no-out' : 'round-out yes-out'"
|
||
>
|
||
<div
|
||
:class="isfaly ? 'round-in no-in' : 'round-in yes-in'"
|
||
></div>
|
||
</div>
|
||
<span style="margin-left: 20px;">否</span>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
<div class="partone-box">
|
||
<div class="title">企业信息</div>
|
||
<div class="needLine">
|
||
<div class="little-title">外观照片</div>
|
||
<van-uploader v-model="fileList" :max-count="3" :after-read="afterRead" :before-delete="delImg" @click-upload="onUpload" preview-size="100px" class="uploader" ref="file" />
|
||
<!-- <van-uploader v-model="fileList" multiple :max-count="3" :after-read="afterRead" :before-delete="delImg" @click-upload="onUpload" preview-size="100px" class="uploader" ref="file" /> -->
|
||
</div>
|
||
<!-- <div class="little-title">位置信息</div>
|
||
<van-field v-model="address" center disabled clearable label="" placeholder="位置信息" class="location">
|
||
<template #button>
|
||
<van-button :disabled="showForm" native-type="button" size="small" type="primary" style="background: #0caea0" @click="getLocation">获取</van-button>
|
||
</template>
|
||
</van-field> -->
|
||
</div>
|
||
</van-tab>
|
||
<van-tab title="能源管理信息" class="padding">
|
||
<div class="partThree-question">
|
||
<div>5年内是否进行过ISO50001能源管理体系认证?</div>
|
||
<div class="btn2">
|
||
<div class="btn-click2" @click="handelClickOk">
|
||
<div
|
||
:class="isfaly2 ? 'round-out yes-out' : 'round-out no-out'"
|
||
>
|
||
<div
|
||
:class="isfaly2 ? 'round-in yes-in' : 'round-in no-in'"
|
||
></div>
|
||
</div>
|
||
<span>是</span>
|
||
</div>
|
||
<div class="btn-click2" @click="handelClickNo">
|
||
<div
|
||
:class="isfaly2 ? 'round-out no-out' : 'round-out yes-out'"
|
||
>
|
||
<div
|
||
:class="isfaly2 ? 'round-in no-in' : 'round-in yes-in'"
|
||
></div>
|
||
</div>
|
||
<span>否</span>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
<div class="partThree-question">
|
||
<div v-if="isfaly2" class="coverfocusItem"></div>
|
||
<div class="focusItem" :style="isfaly2 ? 'color: #9d9d9d;' : ''" v-if="isfaly2 == false">
|
||
<div class="wt">
|
||
<div
|
||
class="wtItem borderBot"
|
||
v-for="(item, index) in askList"
|
||
:key="index"
|
||
>
|
||
<p>{{ index + 1 }}、{{ item.enquireTitle }}</p>
|
||
<div class="btn">
|
||
<div @click="buttonClick(item, index)" class="btn-click">
|
||
<div
|
||
:class="
|
||
item.color ? 'round-out yes-out' : 'round-out no-out'
|
||
"
|
||
>
|
||
<div
|
||
:class="
|
||
item.color ? 'round-in yes-in' : 'round-in no-in'
|
||
"
|
||
></div>
|
||
</div>
|
||
<span>是</span>
|
||
</div>
|
||
<div @click="buttonNoClick(item, index)" class="btn-click">
|
||
<div
|
||
:class="
|
||
item.color ? 'round-out no-out' : 'round-out yes-out'
|
||
"
|
||
>
|
||
<div
|
||
:class="
|
||
item.color ? 'round-in no-in' : 'round-in yes-in'
|
||
"
|
||
></div>
|
||
</div>
|
||
<span>否</span>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
|
||
<div class="focusItem" :style="isfaly2 ? 'color: #9d9d9d;' : ''" v-if="isfaly2 == true">
|
||
<div class="wt">
|
||
<div
|
||
class="wtItem borderBot"
|
||
v-for="(item, index) in askList"
|
||
:key="index"
|
||
>
|
||
<p>{{ index + 1 }}、{{ item.enquireTitle }}</p>
|
||
<div class="btn">
|
||
<div @click="buttonClick(item, index)" class="btn-click">
|
||
<div
|
||
class="round-out no-out"
|
||
>
|
||
<div
|
||
class="round-in no-in"
|
||
></div>
|
||
</div>
|
||
<span>是</span>
|
||
</div>
|
||
<div @click="buttonNoClick(item, index)" class="btn-click">
|
||
<div
|
||
class="round-out no-out"
|
||
>
|
||
<div
|
||
class="round-in no-in"
|
||
></div>
|
||
</div>
|
||
<span>否</span>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</van-tab>
|
||
<van-tab
|
||
title="节能改造信息"
|
||
class="padding"
|
||
style="margin-bottom: 50px;"
|
||
>
|
||
<div class="partTwo-question">
|
||
<div>5年内是否实施过节能改造?</div>
|
||
<div class="btn2">
|
||
<div class="btn-click2" @click="handelClickOk">
|
||
<div
|
||
:class="isfaly1 ? 'round-out yes-out' : 'round-out no-out'"
|
||
>
|
||
<div
|
||
:class="isfaly1 ? 'round-in yes-in' : 'round-in no-in'"
|
||
></div>
|
||
</div>
|
||
<span>是</span>
|
||
</div>
|
||
<div class="btn-click2" @click="handelClickNo">
|
||
<div
|
||
:class="isfaly1 ? 'round-out no-out' : 'round-out yes-out'"
|
||
>
|
||
<div
|
||
:class="isfaly1 ? 'round-in no-in' : 'round-in yes-in'"
|
||
></div>
|
||
</div>
|
||
<span>否</span>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
<div class="title" style="margin-top: 20px;margin-left: 5px;">
|
||
改造信息
|
||
</div>
|
||
<!-- 通用能源系统 -->
|
||
<div class="partTwo-box">
|
||
<van-list
|
||
v-model="loading"
|
||
:finished="finished"
|
||
:immediate-check="immediateCheck"
|
||
finished-text="没有更多了"
|
||
@load="onLoad"
|
||
>
|
||
<div class="partTwo-content" v-if="isfaly1 == true">
|
||
<div
|
||
class="msg-box"
|
||
@click="editMsg(item.id)"
|
||
v-for="(item, index) in gzList"
|
||
:key="index"
|
||
>
|
||
<van-cell
|
||
:title="item.pName + '/' + item.cName"
|
||
icon="calender-o"
|
||
is-link
|
||
/>
|
||
<van-cell :title="item.tranTime" />
|
||
<van-cell :title="item.tranContent" />
|
||
</div>
|
||
<div class="add-box" @click="addMsg">
|
||
+ 新增改造信息
|
||
</div>
|
||
</div>
|
||
<div class="partTwo-content2" v-else>
|
||
<div
|
||
class="msg-box2"
|
||
v-for="(item, index) in gzList"
|
||
:key="index"
|
||
>
|
||
<van-cell
|
||
:title="item.pName + '/' + item.cName"
|
||
icon="calender-o"
|
||
is-link
|
||
/>
|
||
<van-cell :title="item.tranTime" />
|
||
<van-cell :title="item.tranContent" />
|
||
</div>
|
||
<div class="add-box2">
|
||
+ 新增改造信息
|
||
</div>
|
||
</div>
|
||
</van-list>
|
||
</div>
|
||
</van-tab>
|
||
|
||
</van-tabs>
|
||
</div>
|
||
<div class="footer-btn">
|
||
<div @click="handleClick">保存</div>
|
||
</div>
|
||
<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>
|
||
</template>
|
||
|
||
<script>
|
||
import { uploadFile, buildAsk, getInfoAPI, editInfoAPI, addInfoAPI, changeSaveStateAPI, getInfoByCustomerIdAPI } from '@/api/api.js'
|
||
import { getCurrentPersonInfoAPI } from '@/api/customerIformation.js'
|
||
import { getCode } from '@/api/common.js'
|
||
// import Header from '@/components/headerNew'
|
||
import { reformList, reformRemove } from '@/api/universalEnergy.js'
|
||
import { Notify } from 'vant'
|
||
import { formatymd } from '@/utils/timeUtil.js'
|
||
import { getLocationMessage, chooseAlbumAndTakePhoto } from '@/utils/dsbridge'
|
||
import { downloadUrl } from '@/settings'
|
||
import {debounce} from '@/utils/common.js'
|
||
export default {
|
||
components: {
|
||
// Header
|
||
},
|
||
data() {
|
||
return {
|
||
address: '', //定位地址
|
||
fileList: [], //外观照片
|
||
fileIds: [],
|
||
immediateCheck: false,
|
||
title: '能源管理',
|
||
tidCid: null,
|
||
dataDetail: {},
|
||
active: 0,
|
||
list: [], // 企业具有的通用能源系统
|
||
listValue: ['01'], //企业具有的通用能源系统value值
|
||
list2: [], // 一级计量(进出用能企业)
|
||
listValue2: ['01'],
|
||
listValue3: [],
|
||
list3: [], // 二级计量(进出主要次级用能单位)
|
||
// list: ['配电系统', '泵机系统', '风机系统', '空压机系统'], // 企业具有的通用能源系统
|
||
// list2: ['电', '天然气', '蒸汽', '煤'], // 一级计量(进出用能企业)
|
||
// list3: ['电', '天然气', '蒸汽', '煤'], // 二级计量(进出主要次级用能单位)
|
||
result: [], // 企业具有的通用能源系统选中
|
||
result2: [], // 一级计量(进出用能企业)选中
|
||
result3: [], // 二级计量(进出主要次级用能单位)选中
|
||
item: {
|
||
type: Object,
|
||
default: () => {}
|
||
},
|
||
resultdata: [],
|
||
resultdata1: ['52', '53', '54', '55', '56', '57'],
|
||
// 问询列表
|
||
askList: [],
|
||
isfaly: null, //通用是否
|
||
isfaly1: null, //是否节能改造
|
||
isfaly2: true, //是否认证
|
||
getGzId: '', // 获取改造列表id
|
||
gzList: [], // 改造列表
|
||
getTypeList: [], //改造信息列表获取码表数据
|
||
customerInfo: {},
|
||
loading: false, //加载
|
||
finished: false, //完成
|
||
pageNum: 1, //当前页数
|
||
pageSize: 5, //每页多少条
|
||
allPage: 0, //总共多少条
|
||
gaizao: '',
|
||
show: false,
|
||
taskId:"",
|
||
taskType:"",
|
||
buildId:"",
|
||
ifEnterpriseId: '', // 查询是否有enterpriseId,编辑/新增
|
||
doDebounce: null,
|
||
}
|
||
},
|
||
computed: {
|
||
showForm() {
|
||
if(this.tidCid.taskId) {
|
||
return false
|
||
}
|
||
return true
|
||
},
|
||
},
|
||
watch: {
|
||
result: function(newVal, oldVal) {
|
||
console.log(newVal,'12344');
|
||
if (oldVal != newVal) {
|
||
if (this.listValue != []) {
|
||
this.listValue = []
|
||
newVal.forEach(v => {
|
||
if (v) {
|
||
this.listValue.push(v.value)
|
||
}
|
||
})
|
||
}
|
||
}
|
||
},
|
||
result2: function(newVal, oldVal) {
|
||
console.log(newVal,'123');
|
||
if (oldVal != newVal) {
|
||
if (this.listValue2 != []) {
|
||
this.listValue2 = []
|
||
newVal.forEach(v => {
|
||
if (v) {
|
||
this.listValue2.push(v.value)
|
||
this.listValue2 = [...new Set(this.listValue2)]
|
||
}
|
||
})
|
||
}
|
||
}
|
||
},
|
||
result3: function(newVal, oldVal) {
|
||
if (oldVal != newVal) {
|
||
if (this.listValue3 != []) {
|
||
this.listValue3 = []
|
||
newVal.forEach(v => {
|
||
if (v) {
|
||
this.listValue3.push(v.value)
|
||
}
|
||
})
|
||
}
|
||
}
|
||
}
|
||
},
|
||
activated() {
|
||
this.result = [], // 企业具有的通用能源系统选中
|
||
this.result2 = [], // 一级计量(进出用能企业)选中
|
||
this.result3 = [] // 二级计量(进出主要次级用能单位)选中
|
||
},
|
||
created() {
|
||
this.tidCid = JSON.parse(sessionStorage.getItem('tidCid'))
|
||
if (this.tidCid) {
|
||
this.taskType = this.tidCid.taskType
|
||
this.taskId = this.tidCid.taskId
|
||
}
|
||
// this.getInfo()
|
||
this.getEnterpriseId()
|
||
this.nxzdCommonYes()
|
||
this.getsecondEnergyMeterType()
|
||
this.getbase()
|
||
this.getBuildAsk()
|
||
this.doDebounce = debounce(function () {
|
||
this.adddata()
|
||
}, 5000, true)
|
||
},
|
||
mounted() {
|
||
this.getList()
|
||
|
||
|
||
},
|
||
methods: {
|
||
// // 获取当前位置
|
||
// getLocation() {
|
||
// if (process.env.NODE_ENV === 'development') {
|
||
// this.address = '江苏省南京市江宁区'
|
||
// }
|
||
|
||
// getLocationMessage(data=> {
|
||
// if(data) {
|
||
// this.address = data
|
||
// } else {
|
||
// Notify({ type: 'warning', message: '未获取到定位信息' });
|
||
// }
|
||
// })
|
||
// },
|
||
base64ToFile(data, fileName) {
|
||
const dataArr = data.split(",");
|
||
const byteString = window.atob(dataArr[1]);
|
||
const options = {
|
||
type: "image/jpeg",
|
||
endings: "native"
|
||
};
|
||
const u8Arr = new Uint8Array(byteString.length);
|
||
for (let i = 0; i < byteString.length; i++) {
|
||
u8Arr[i] = byteString.charCodeAt(i);
|
||
}
|
||
let formData = new FormData();
|
||
let fileOfBlob = new File([u8Arr], fileName + ".jpg", options);//返回文件流
|
||
formData.append("file", fileOfBlob);
|
||
return formData
|
||
},
|
||
afterRead(file) {
|
||
console.log('afterRead-file',file);
|
||
let params = new FormData()
|
||
params.append('file', file.file)
|
||
uploadFile(params).then((res) => {
|
||
if (res.code == 0) {
|
||
this.fileIds.push(res.data.attach_id)
|
||
}
|
||
})
|
||
return true
|
||
},
|
||
// 上传图片调用原生的方法 获取到绝对路径调用getImageFileFromUrl
|
||
onUpload () {
|
||
console.log('进入chooseAlbumAndTakePhoto方法')
|
||
chooseAlbumAndTakePhoto((data) => {
|
||
// this.saveGreenComeData(data)
|
||
let d = 'data:image/jpeg;base64,' + data
|
||
console.log('data', d);
|
||
this.fileIamge = d
|
||
let params = this.base64ToFile(d,new Date().getTime().toString())
|
||
uploadFile(params).then((res) => {
|
||
if (res.code === 0) {
|
||
this.fileList.push({
|
||
url:`${downloadUrl}${res.data.attach_id}`
|
||
})
|
||
this.fileIds.push(res.data.attach_id)
|
||
}
|
||
})
|
||
|
||
})
|
||
},
|
||
delImg(detail) {
|
||
let url = ''
|
||
if(!detail.file) {
|
||
url = detail.url.split('download/')[1]
|
||
}
|
||
const index = this.fileList.findIndex((ele)=> ele == detail)
|
||
const index2 = this.fileIds.findIndex((ele)=> ele == url)
|
||
this.fileList.splice(index, 1)
|
||
this.fileIds.splice(index2, 1)
|
||
},
|
||
updateUserStatus() {
|
||
const params = {
|
||
taskId: this.taskId
|
||
}
|
||
if(this.taskType == '1') {
|
||
changeSaveStateAPI(params).then((res) => {
|
||
if (res.code == 0) {
|
||
this.$notify({
|
||
message: '保存成功',
|
||
duration: 1000,
|
||
background: '#34baae',
|
||
})
|
||
}
|
||
})
|
||
}
|
||
},
|
||
// 获取类目选项
|
||
getType() {
|
||
const customerInfo = {
|
||
codeSortId: 80000001035,
|
||
codeType: 'gygzlx'
|
||
}
|
||
getCode(customerInfo)
|
||
.then(res => {
|
||
if (res.code == 0) {
|
||
this.getTypeList = res.data
|
||
this.getList()
|
||
}
|
||
})
|
||
.catch(() => {
|
||
this.$toast('失败')
|
||
})
|
||
},
|
||
// 获取列表
|
||
async getList() {
|
||
let params = {
|
||
pageNum: this.pageNum,
|
||
pageSize: this.pageSize,
|
||
enterpriseId: this.getGzId
|
||
}
|
||
const res = await reformList(params)
|
||
if (res.code == 0) {
|
||
console.log(res.data);
|
||
this.gzList = res.data.records
|
||
this.getTypeName(this.getTypeList)
|
||
this.allPage = res.data.total
|
||
if(res.data.total == res.data.records.length) {
|
||
this.immediateCheck = true
|
||
this.finished = true
|
||
}
|
||
this.gaizao = this.$route.query.gaizao
|
||
if(this.gaizao == 1 || res.data.records.length>0) {
|
||
this.isfaly1 = true,
|
||
this.active = 2
|
||
}
|
||
|
||
}
|
||
},
|
||
//递归获取类目选项中文名称
|
||
getTypeName(list) {
|
||
if (list && list.length > 0) {
|
||
list.forEach(v => {
|
||
this.gzList.forEach(ev => {
|
||
this.getTypeName(v.child)
|
||
if (ev.primaryType == v.code) {
|
||
ev.pName = v.name
|
||
}
|
||
if (ev.secondType == v.code) {
|
||
ev.cName = v.name
|
||
}
|
||
})
|
||
})
|
||
}
|
||
},
|
||
// 滑动加载
|
||
onLoad() {
|
||
// 异步更新数据
|
||
setTimeout(async () => {
|
||
this.pageNum++
|
||
const res = await reformList({
|
||
pageNum: this.pageNum,
|
||
pageSize: this.pageSize,
|
||
enterpriseId: this.getGzId
|
||
})
|
||
if (res.code == 0) {
|
||
this.gzList.push(...res.data.records)
|
||
this.getTypeName(this.getTypeList)
|
||
}
|
||
// 加载状态结束
|
||
this.loading = false
|
||
// 数据全部加载完成
|
||
if (this.gzList.length == this.allPage) {
|
||
this.finished = true
|
||
this.immediateCheck = true
|
||
|
||
}
|
||
}, 1000)
|
||
},
|
||
async getEnterpriseId() {
|
||
this.ifEnterpriseId = ''
|
||
// 查询是否有新增|修改
|
||
let id = JSON.parse(sessionStorage.getItem('enterpriseId'))
|
||
if(!id) return
|
||
const rew = await getInfoByCustomerIdAPI({ id })
|
||
if (rew.code == 0) {
|
||
this.ifEnterpriseId = rew.data.id
|
||
this.getInfo()
|
||
}
|
||
},
|
||
// 查询是否有数据
|
||
async getInfo() {
|
||
this.show = true
|
||
let data = {
|
||
// id: this.$route.params.enterpriseId ? this.$route.params.enterpriseId : sessionStorage.getItem('enterpriseId')
|
||
id: this.ifEnterpriseId
|
||
}
|
||
if (data.id) {
|
||
let res = await getInfoAPI(data)
|
||
if (res.code == 0) {
|
||
this.getGzId = res.data.id
|
||
this.dataDetail = res.data
|
||
this.getType()
|
||
|
||
//能源管理信息数据处理
|
||
if(res.data.enquireIds) {
|
||
let enquireIdsArr = res.data.enquireIds.split(',')
|
||
enquireIdsArr.forEach(v => {
|
||
this.resultdata.push(v)
|
||
})
|
||
// let arr2 = enquireIdsArr.splice(1)
|
||
for (let i = 0; i < enquireIdsArr.length; i++) {
|
||
for (let j = 0; j < this.askList.length; j++) {
|
||
if (i === j) {
|
||
if (enquireIdsArr[i] == '0') {
|
||
this.askList[i].color = false
|
||
} else {
|
||
this.askList[i].color = true
|
||
}
|
||
}
|
||
}
|
||
}
|
||
}
|
||
this.address = res.data.address
|
||
if (res.data.text1) {
|
||
const url1 = `${downloadUrl}${res.data.text1}`
|
||
this.fileList.push({
|
||
url: url1,
|
||
})
|
||
this.fileIds.push(res.data.text1)
|
||
}
|
||
if (res.data.text2) {
|
||
const url2 = `${downloadUrl}${res.data.text2}`
|
||
this.fileList.push({
|
||
url: url2,
|
||
})
|
||
this.fileIds.push(res.data.text2)
|
||
}
|
||
if (res.data.text3) {
|
||
const url3 = `${downloadUrl}${res.data.text3}`
|
||
this.fileList.push({
|
||
url: url3,
|
||
})
|
||
this.fileIds.push(res.data.text3)
|
||
}
|
||
console.log('res.data',res.data)
|
||
|
||
//通用能源系统数据处理
|
||
if(res.data.commonEnergySystem.indexOf('0')>-1){
|
||
let commonEnergySystemArr = res.data.commonEnergySystem.split(',')
|
||
this.listValue.push(commonEnergySystemArr)
|
||
for (let i = 0; i < commonEnergySystemArr.length; i++) {
|
||
let aaa = commonEnergySystemArr[i].replace('0', '') - 1;
|
||
this.result.push(this.list[aaa])
|
||
}
|
||
}
|
||
//能源计量见着数据处理
|
||
if(res.data.primaryEnergyMeterType.indexOf('0')>-1){
|
||
let primaryEnergyMeterTypeArr = res.data.primaryEnergyMeterType.split(',')
|
||
this.listValue2.push(primaryEnergyMeterTypeArr)
|
||
for (let i = 0; i < primaryEnergyMeterTypeArr.length; i++) {
|
||
let bbb = primaryEnergyMeterTypeArr[i].replace('0', '') - 1;
|
||
this.result2.push(this.list2[bbb])
|
||
}
|
||
this.result2 = [...new Set(this.result2)]
|
||
}
|
||
if(res.data.secondEnergyMeterType.indexOf('0')>-1){
|
||
let secondEnergyMeterTypeArr = res.data.secondEnergyMeterType.split(',')
|
||
this.listValue3.push(secondEnergyMeterTypeArr)
|
||
for (let i = 0; i < secondEnergyMeterTypeArr.length; i++) {
|
||
let ccc = secondEnergyMeterTypeArr[i].replace('0', '') - 1;
|
||
this.result3.push(this.list3[ccc])
|
||
}
|
||
}
|
||
|
||
|
||
|
||
|
||
// 通用是否
|
||
this.isfaly = res.data.isExceedNinetyPercent === '1'
|
||
// 是否节能改造
|
||
this.isfaly1 = res.data.isSaveEnergyTrans == '1'
|
||
// 是否认证
|
||
this.isfaly2 = res.data.isPassIsoPuth == '1'
|
||
if(this.gaizao == 1) {
|
||
this.isfaly1 = true
|
||
}
|
||
}
|
||
}
|
||
const res = await getCurrentPersonInfoAPI(
|
||
this.$route.params.customerId || JSON.parse(sessionStorage.getItem('tidCid')).customerId
|
||
)
|
||
if (res.code == 0) {
|
||
this.customerInfo = res.data
|
||
}
|
||
|
||
this.show = false
|
||
},
|
||
// 获取能源管理信息问询
|
||
getBuildAsk() {
|
||
buildAsk({ enquireMode: 'gynygl' })
|
||
.then(res => {
|
||
if (res.code == 0) {
|
||
res.data.forEach(v => {
|
||
v.color = true
|
||
})
|
||
this.askList = res.data
|
||
}
|
||
})
|
||
.catch(() => {
|
||
// this.$toast(error);
|
||
})
|
||
},
|
||
// 获取通用是否
|
||
async nxzdCommonYes() {
|
||
let customerInfo = {
|
||
codeSortId: 80000001007,
|
||
codeType: 'nxzdtysf'
|
||
}
|
||
const res = await getCode(customerInfo)
|
||
console.log(res, '获取通用是否的数据');
|
||
},
|
||
// 查询码表获取到能源信息
|
||
async getsecondEnergyMeterType() {
|
||
const customerInfo = {
|
||
codeSortId: 80000001034,
|
||
codeType: 'gyyj'
|
||
}
|
||
let res = await getCode(customerInfo)
|
||
if (res.code === 0) {
|
||
res.data.forEach(v => {
|
||
this.list2.push({ name: v.name, value: v.value })
|
||
this.list3.push({ name: v.name, value: v.value })
|
||
})
|
||
if(this.ifEnterpriseId === ''){
|
||
this.result2=[]
|
||
this.result2.push(this.list2[0])
|
||
}
|
||
}
|
||
},
|
||
// 查询码表获取到能源系统
|
||
async getbase() {
|
||
const info1 = {
|
||
codeSortId: 80000001033,
|
||
codeType: 'gytynyxt'
|
||
}
|
||
let res1 = await getCode(info1)
|
||
if (res1.code === 0) {
|
||
res1.data.forEach(v => {
|
||
|
||
this.list.push({ name: v.name, value: v.value })
|
||
})
|
||
}
|
||
|
||
},
|
||
handleClick(){
|
||
this.doDebounce()
|
||
},
|
||
// 保存
|
||
async adddata() {
|
||
if(this.showForm) {
|
||
return
|
||
}
|
||
if( this.listValue.indexOf("01") === -1){
|
||
this.$toast('通用能源系统必须有配电系统')
|
||
return
|
||
}
|
||
console.log(this.listValue2, 'this.listValue2', this.list);
|
||
return
|
||
if( this.listValue2.indexOf("01") === -1){
|
||
this.$toast('一级计量必须有勾选电')
|
||
return
|
||
}
|
||
if ((this.fileIds.length == 0&&this.$store.getters.cityType)) {
|
||
this.$toast('请上传企业外观照片')
|
||
return
|
||
}
|
||
if (this.isfaly1 == false) {
|
||
let id = this.gzList.map(v => {
|
||
return v.id
|
||
})
|
||
let ids = id.toString()
|
||
if(ids) {
|
||
reformRemove({ ids: ids }).then(res => {
|
||
console.log(res, '点击保存后删除某个id');
|
||
})
|
||
}
|
||
}
|
||
if (this.isfaly2 == true) {
|
||
this.resultdata = []
|
||
}
|
||
let taskId = JSON.parse(sessionStorage.getItem('tidCid')).taskId
|
||
if (this.ifEnterpriseId) {
|
||
// 修改
|
||
const data = {
|
||
commonEnergySystem: this.listValue.join(','),
|
||
secondEnergyMeterType: this.listValue3.join(','),
|
||
primaryEnergyMeterType: this.listValue2.join(','),
|
||
enquireIds: this.resultdata.join(','),
|
||
text1: this.fileIds[0] ? this.fileIds[0] : '',
|
||
text2: this.fileIds[1] ? this.fileIds[1] : '',
|
||
text3: this.fileIds[2] ? this.fileIds[2] : '',
|
||
address: this.address,
|
||
|
||
nxzdEnterpriseReformVOList: null,
|
||
isPassIsoPuth: this.dataDetail.isPassIsoPuth,
|
||
isExceedNinetyPercent: this.dataDetail.isExceedNinetyPercent,
|
||
isSaveEnergyTrans: this.isfaly1 == true ? '1' : '2',
|
||
changeTime: formatymd(new Date()),
|
||
|
||
changeUser: this.dataDetail.changeUser,
|
||
customerId: this.dataDetail.customerId,
|
||
productType: this.$route.params.item?this.$route.params.item.productType:this.dataDetail.productType,
|
||
productUnitConsume: this.$route.params.item?this.$route.params.item.productUnitConsume:this.dataDetail.productUnitConsume,
|
||
enterpriseName: this.$route.params.item?this.$route.params.item.customerName:this.dataDetail.customerName,
|
||
taskId,
|
||
}
|
||
|
||
data.id = this.dataDetail.id
|
||
let res = await editInfoAPI(data)
|
||
console.log(res, 'res0---------------------');
|
||
if (res.code == 0) {
|
||
// this.active = 0
|
||
Notify({
|
||
type: 'success',
|
||
background: '#34baae',
|
||
message: '修改成功'
|
||
})
|
||
this.updateUserStatus()
|
||
sessionStorage.setItem('enterpriseId', res.data)
|
||
this.result = [] // 企业具有的通用能源系统选中
|
||
this.result2 = [] // 一级计量(进出用能企业)选中
|
||
this.result3 = [] // 二级计量(进出主要次级用能单位)选中
|
||
this.$router.push({
|
||
path:'/acquisition'
|
||
})
|
||
|
||
// this.$router.push({
|
||
// name: 'acquisition',
|
||
// params: { enterpriseId: res.data }
|
||
// })
|
||
}
|
||
} else {
|
||
// 新增
|
||
if (this.isfaly2 == true) {
|
||
this.resultdata = []
|
||
}
|
||
const data1 = {
|
||
commonEnergySystem: this.listValue.join(',') || '',
|
||
secondEnergyMeterType: this.listValue3.join(',') || '',
|
||
primaryEnergyMeterType: this.listValue2.join(',') || '',
|
||
enquireIds: this.resultdata.join(',') || '',
|
||
text1: this.fileIds[0] ? this.fileIds[0] : '',
|
||
text2: this.fileIds[1] ? this.fileIds[1] : '',
|
||
text3: this.fileIds[2] ? this.fileIds[2] : '',
|
||
address: this.address,
|
||
|
||
customerId: JSON.parse(JSON.parse(sessionStorage.getItem('tidCid')).customerId),
|
||
nxzdEnterpriseReformVOList: null,
|
||
isPassIsoPuth: this.dataDetail.isPassIsoPuth? this.dataDetail.isPassIsoPuth: '1' ,
|
||
isExceedNinetyPercent: this.dataDetail.isExceedNinetyPercent? this.dataDetail.isExceedNinetyPercent: '2',
|
||
isSaveEnergyTrans: this.dataDetail.isSaveEnergyTrans? this.dataDetail.isSaveEnergyTrans: '2',
|
||
changeTime: formatymd(new Date()),
|
||
|
||
creditCode: this.$route.params.creditCode || '',
|
||
changeUser: this.$route.params.item.changeUser,
|
||
productType: this.$route.params.item.productType,
|
||
productUnitConsume: this.$route.params.item.productUnitConsume,
|
||
enterpriseName: this.$route.params.item.customerName,
|
||
taskId,
|
||
// inVoltage: this.$route.params.item.inVoltage
|
||
}
|
||
let req = await addInfoAPI(data1)
|
||
if (req.code == 0) {
|
||
Notify({
|
||
type: 'success',
|
||
background: '#34baae',
|
||
message: '新增成功'
|
||
})
|
||
this.updateUserStatus()
|
||
sessionStorage.setItem('enterpriseId', req.data)
|
||
this.result = [] // 企业具有的通用能源系统选中
|
||
this.result2 = [] // 一级计量(进出用能企业)选中
|
||
this.result3 = [] // 二级计量(进出主要次级用能单位)选中
|
||
this.$router.push({
|
||
path: '/acquisition'
|
||
})
|
||
// this.$router.push({
|
||
// name: 'acquisition',
|
||
// params: { enterpriseId: req.data }
|
||
// })
|
||
}
|
||
}
|
||
},
|
||
// 选中是
|
||
handelClickOk() {
|
||
if(this.showForm) {
|
||
return
|
||
}
|
||
if (this.active == 0) {
|
||
this.isfaly = true
|
||
this.dataDetail.isExceedNinetyPercent = '1'
|
||
}
|
||
if (this.active == 1) {
|
||
this.isfaly2 = true
|
||
this.dataDetail.isPassIsoPuth = '1'
|
||
|
||
}
|
||
if (this.active == 2) {
|
||
this.isfaly1 = true
|
||
this.dataDetail.isSaveEnergyTrans = '1'
|
||
}
|
||
},
|
||
// 选中否
|
||
handelClickNo() {
|
||
if(this.showForm) {
|
||
return
|
||
}
|
||
if (this.active == 0) {
|
||
this.isfaly = false
|
||
this.dataDetail.isExceedNinetyPercent = '2'
|
||
}
|
||
if (this.active == 1) {
|
||
this.isfaly2 = false
|
||
this.dataDetail.isPassIsoPuth = '2'
|
||
this.resultdata = this.resultdata1
|
||
}
|
||
if (this.active == 2) {
|
||
this.isfaly1 = false
|
||
this.dataDetail.isSaveEnergyTrans = '2'
|
||
|
||
}
|
||
},
|
||
// 修改信息
|
||
editMsg(id) {
|
||
this.$router.push({
|
||
path: './addeditmsg',
|
||
query: { getGzId: this.getGzId, id: id }
|
||
})
|
||
},
|
||
// 新增信息
|
||
addMsg() {
|
||
if(this.showForm) {
|
||
return
|
||
}
|
||
if(this.getGzId != '') {
|
||
this.$router.push({
|
||
path: './addeditmsg',
|
||
query: { getGzId: this.getGzId }
|
||
})
|
||
}else {
|
||
Notify({ type: "error", background: 'red', message: '请先填报能源信息或能源管理信息' })
|
||
}
|
||
},
|
||
//能源管理信息选择是
|
||
buttonClick(item, index) {
|
||
if (!item.color) {
|
||
item.color = true
|
||
this.resultdata.splice(index, 1, this.resultdata1[index])
|
||
}
|
||
},
|
||
//能源管理信息选择否
|
||
buttonNoClick(item, index) {
|
||
item.color = false
|
||
this.resultdata.splice(index, 1, '0')
|
||
}
|
||
}
|
||
}
|
||
</script>
|
||
|
||
<style lang="less" scoped>
|
||
.padding {
|
||
padding: 10px 15px;
|
||
box-sizing: border-box;
|
||
}
|
||
.partone-box {
|
||
width: 100%;
|
||
background-color: #fff;
|
||
border-radius: 8px;
|
||
padding: 20px;
|
||
box-sizing: border-box;
|
||
margin-bottom: 20px;
|
||
}
|
||
.title {
|
||
font-size: 15px;
|
||
color: #000;
|
||
}
|
||
::v-deep .van-checkbox__icon .van-icon {
|
||
border-radius: 5px;
|
||
}
|
||
::v-deep .van-checkbox {
|
||
display: -webkit-box;
|
||
display: -webkit-flex;
|
||
display: flex;
|
||
-webkit-box-align: center;
|
||
-webkit-align-items: center;
|
||
align-items: center;
|
||
overflow: hidden;
|
||
cursor: pointer;
|
||
-webkit-user-select: none;
|
||
user-select: none;
|
||
margin-top: 15px;
|
||
}
|
||
::v-deep .van-checkbox__label {
|
||
margin-left: 30px;
|
||
color: #9d9d9d;
|
||
font-size: 14px;
|
||
line-height: 0.533333rem;
|
||
}
|
||
.little-title {
|
||
color: #9d9d9d;
|
||
font-size: 14px;
|
||
margin-top: 10px;
|
||
}
|
||
.needLine {
|
||
padding-bottom: 15px;
|
||
border-bottom: 1px solid #f2f2f2;
|
||
}
|
||
.btn {
|
||
margin-top: 10px;
|
||
.btn-click {
|
||
display: flex;
|
||
font-size: 15px;
|
||
align-items: center;
|
||
margin-bottom: 10px;
|
||
span {
|
||
// margin-left: 20px;
|
||
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;
|
||
}
|
||
}
|
||
.footer-btn {
|
||
height: 35px;
|
||
padding: 0 0.4rem;
|
||
> div {
|
||
position: fixed;
|
||
bottom: 20px;
|
||
width: 92%;
|
||
background: #34baae;
|
||
border-radius: 10px;
|
||
line-height: 35px;
|
||
text-align: center;
|
||
color: #fff;
|
||
z-index: 99999;
|
||
}
|
||
}
|
||
.partTwo-question {
|
||
width: 100%;
|
||
background-color: #fff;
|
||
border-radius: 8px;
|
||
padding: 20px 10px;
|
||
box-sizing: border-box;
|
||
font-size: 15px;
|
||
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;
|
||
}
|
||
}
|
||
.partTwo-box {
|
||
width: 100%;
|
||
border-radius: 8px;
|
||
padding: 0 15px 10px;
|
||
box-sizing: border-box;
|
||
background-color: #fff;
|
||
overflow: hidden;
|
||
margin-top: 15px;
|
||
.partTwo-content {
|
||
margin-top: 20px;
|
||
.add-box {
|
||
width: 100%;
|
||
padding: 10px 0;
|
||
box-sizing: border-box;
|
||
border-radius: 5px;
|
||
border: 1px solid #63cbb6;
|
||
background-color: #e0f5f0;
|
||
color: #63cbb6;
|
||
text-align: center;
|
||
margin-top: 15px;
|
||
transition-duration: 0.3s;
|
||
}
|
||
.msg-box {
|
||
padding: 15px 10px;
|
||
border-radius: 5px;
|
||
box-sizing: border-box;
|
||
background: #63cbb6;
|
||
margin-top: 15px;
|
||
}
|
||
}
|
||
.partTwo-content2 {
|
||
margin-top: 20px;
|
||
.add-box2 {
|
||
width: 100%;
|
||
padding: 10px 0;
|
||
box-sizing: border-box;
|
||
border-radius: 5px;
|
||
border: 1px solid #fff;
|
||
background-color: #ccc;
|
||
color: #fff;
|
||
text-align: center;
|
||
margin-top: 15px;
|
||
transition-duration: 0.3s;
|
||
|
||
}
|
||
.msg-box2 {
|
||
padding: 15px 10px;
|
||
border-radius: 5px;
|
||
box-sizing: border-box;
|
||
background: #ccc;
|
||
margin-top: 15px;
|
||
}
|
||
}
|
||
}
|
||
::v-deep .van-cell {
|
||
position: unset;
|
||
display: -webkit-box;
|
||
display: -webkit-flex;
|
||
display: flex;
|
||
box-sizing: border-box;
|
||
width: 100%;
|
||
padding: 0;
|
||
overflow: hidden;
|
||
color: #fff;
|
||
font-size: 0.373333rem;
|
||
line-height: 0.64rem;
|
||
background-color: unset;
|
||
}
|
||
::v-deep {
|
||
.van-cell__right-icon {
|
||
margin-left: 0.106667rem;
|
||
color: #fff;
|
||
}
|
||
}
|
||
.partThree-question {
|
||
width: 100%;
|
||
background-color: #fff;
|
||
border-radius: 8px;
|
||
padding: 20px 10px;
|
||
box-sizing: border-box;
|
||
font-size: 15px;
|
||
color: #000;
|
||
margin-bottom: 15px;
|
||
position: relative;
|
||
.btn2 {
|
||
margin-top: 10px;
|
||
display: flex;
|
||
justify-content: flex-end;
|
||
}
|
||
.focusItem {
|
||
margin-top: 10px;
|
||
border-radius: 8px;
|
||
overflow: auto;
|
||
.addTitleLeft {
|
||
flex: 0 0 220px;
|
||
}
|
||
.title {
|
||
color: #009999;
|
||
}
|
||
.wt {
|
||
// padding: 20px;
|
||
background: #fff;
|
||
border-radius: 8px;
|
||
.wtItem {
|
||
&:not(:first-child) {
|
||
padding-top: 10px;
|
||
}
|
||
&:not(:last-child) {
|
||
padding-bottom: 10px;
|
||
border-bottom: solid #eee thin;
|
||
}
|
||
p {
|
||
line-height: 20px;
|
||
}
|
||
.btn {
|
||
margin-top: 10px;
|
||
display: flex;
|
||
justify-content: flex-end;
|
||
/deep/ .van-button--normal {
|
||
min-width: 60px;
|
||
height: 35px;
|
||
margin-left: 8px;
|
||
}
|
||
}
|
||
}
|
||
}
|
||
}
|
||
.focusItem-color {
|
||
color: #9d9d9d;
|
||
}
|
||
.coverfocusItem {
|
||
position: absolute;
|
||
left: 0;
|
||
top: 0;
|
||
width: 100%;
|
||
height: 100%;
|
||
background-color: #fff;
|
||
opacity: 1;
|
||
z-index: 999;
|
||
}
|
||
}
|
||
.wrapper {
|
||
display: flex;
|
||
align-items: center;
|
||
justify-content: center;
|
||
height: 100%;
|
||
display: flex;
|
||
align-items: center;
|
||
justify-content: center;
|
||
height: 100%;
|
||
}
|
||
</style>
|
||
|
||
|
||
|
||
|