1225 lines
44 KiB
Vue
1225 lines
44 KiB
Vue
<template>
|
|
<van-form ref="dis" :disabled="showForm">
|
|
<div class="focusAir" >
|
|
<div class="focusItem">
|
|
<van-cell-group>
|
|
|
|
<van-field v-model="formColumns.voltageLevelName" label="最大电压等级" name="voltageLevelName" required :rules="[{ required: true, message:'请选择电压等级' }]" input-align="right" is-link placeholder="请选择" readonly @click="levelShow = !showForm" />
|
|
|
|
<van-field v-model="trName" label="变压器类型" name="trName" required :rules="[{ required: true, message:'请至少选择一个变压器类型' }]" is-link input-align="right" placeholder="请选择" readonly @click="handelClcikTrShow = !showForm" />
|
|
|
|
<van-field v-input.numNo0 v-show="s13show" v-model="form.s13Num" label="变压器S13台数" type="number" required :rules="[{ required: s13show, message:'请输入变压器S13台数' }]" label-width="140" input-align="right" placeholder="请输入" />
|
|
<van-field v-input.numNo0 v-show="s12show" v-model="form.s12Num" label="变压器S12台数" type="number" required :rules="[{ required: s12show, message:'请输入变压器S12台数' }]" label-width="140" input-align="right" placeholder="请输入" />
|
|
<van-field v-input.numNo0 v-show="s11show" v-model="form.s11Num" label="变压器S11台数" type="number" required :rules="[{ required: s11show, message:'请输入变压器S11台数' }]" label-width="140" input-align="right" placeholder="请输入" />
|
|
<van-field v-input.numNo0 v-show="s10show" v-model="form.s10Num" label="变压器S10台数量" type="number" required :rules="[{ required: s10show, message:'请输入变压器S10台数量' }]" label-width="140" input-align="right" placeholder="请输入" />
|
|
<van-field v-input.numNo0 v-show="s9show" v-model="form.s9Num" label="变压器S9台数" type="number" required :rules="[{ required: s9show, message:'请输入变压器S9台数' }]" label-width="140" input-align="right" placeholder="请输入" />
|
|
<van-field v-input.numNo0 v-show="otherShow" v-model="form.otherNum" label="其他变压器数量" type="number" required :rules="[{ required: otherShow, message:'请输入其他变压器数量' }]" label-width="140" input-align="right" placeholder="请输入" />
|
|
<van-field v-model="form.useYear" required :rules="[{ required: true, message:'请选择变压器最早投运年限' }]" label="变压器最早投运年限(年)" label-width="140" input-align="right" placeholder="请输入" is-link readonly @click="handelClickYear('useYear')" />
|
|
|
|
<van-field v-input.numNo0 v-model="form.distributeCapacity" label="总额定容量(kVA)" type="number" name="distributeCapacity" required :rules="[{ required: true, message:'请填写总额定容量' }]" label-width="100" input-align="right" placeholder="请输入" />
|
|
|
|
<van-field v-input.float v-model="form.maxNeed" required :rules="[{ required: true}]" label="最大需量(kW)" type="number" input-align="right" placeholder="请输入" @input="changeTips" />
|
|
<div class="tips" v-if="tips0">最大需量≤总额定容量</div>
|
|
<van-field v-input.allFloat v-model="form.penaltyAmount" required :rules="[{ required: true}]" label="上一年累计度力调电费的惩罚金额(元)" type="number" label-width="220" input-align="right" placeholder="请输入" />
|
|
|
|
<Whether :value="formColumns.chargingName" feildName="charging" title="是否安装新能源充电桩" @onConfirmTrueFalse="onConfirmTrueFalse" />
|
|
|
|
<van-field v-show="form.charging == 1" v-model="formColumns.deviceTypeName" label="设备类型" required :rules="[{ required: form.charging == 1, message:'请选择设备类型' }]" is-link input-align="right" placeholder="请输入" readonly @click="deviceTypeShow = true" />
|
|
|
|
<Whether v-show="v2Show" :rules="[{ required: v2Show, message:'请选择是否具备V2G充电桩' }]" required :value="formColumns.computeName" feildName="compute" title="V2G充电桩是否具备独立计量" @onConfirmTrueFalse="onConfirmTrueFalse" />
|
|
|
|
<Whether :value="formColumns.inteVehicleName" feildName="inteVehicle" title="是否接入车联网平台" @onConfirmTrueFalse="onConfirmTrueFalse" />
|
|
|
|
<!-- 是否进行过设备改造 -->
|
|
|
|
<Whether required :rules="[{ required: true, message:'请选择设备改造' }]" :value="formColumns.distributeModiyName" feildName="distributeModiy" special="1" @onConfirmTrueFalse="onConfirmTrueFalse" />
|
|
|
|
<!-- 改造方式 -->
|
|
|
|
<ModifyMode
|
|
v-show="form.distributeModiy == 1"
|
|
:form="form"
|
|
:columns="formColumns"
|
|
:type="disType"
|
|
feild="distributeModiy"
|
|
:required="form.distributeModiy == 1"
|
|
:list1="resultList"
|
|
:list2="spliceList"
|
|
@onConfirmCheckbox="onConfirmCheckbox"
|
|
/>
|
|
<van-field v-show="addModifyYearShow" v-model="form.addModifyYear" label="台区新增扩容改造年份" required :rules="[{ required: addModifyYearShow, message:'请选择年份' }]" label-width="220" input-align="right" is-link placeholder="请选择" readonly @click="handelClickYear('addModifyYear')" />
|
|
<van-field v-show="makeModifyYearShow" v-model="form.makeModifyYear" label="无功补偿,改造年份" required :rules="[{ required: makeModifyYearShow, message:'请选择年份' }]" label-width="220" input-align="right" is-link placeholder="请选择" readonly @click="handelClickYear('makeModifyYear')" />
|
|
<van-field v-show="modifyYearShow" v-model="form.modifyYear" label="变压器更换改造年份" required :rules="[{ required: modifyYearShow, message:'请选择年份' }]" label-width="220" input-align="right" is-link placeholder="请选择" readonly @click="handelClickYear('modifyYear')" />
|
|
</van-cell-group>
|
|
|
|
</div>
|
|
|
|
<div :class="form.voltageLevel ? 'search-main' : ''" v-for="item in searchList" :key="item.type">
|
|
<div class="focusItem" v-show="form.voltageLevel">
|
|
<div class="title" v-if="item.type == '1'">
|
|
<div class="line" /> 运营类节能诊断问询
|
|
</div>
|
|
<div class="title" v-if="item.type == '2'">
|
|
<div class="line" /> 设备类节能诊断问询
|
|
</div>
|
|
<div class="wt" v-for="(ele, i) in item.child" :key="ele.enquireId">
|
|
<div class="wtItem">
|
|
<p>{{ ++i }}.{{ ele.enquireTitle }}</p>
|
|
<Radio :item="ele" :index="i" @handelClickOk="handelClickOk(ele, i)" @handelClickNo="handelClickNo(ele, item.child)" />
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<VanPickerNew :show="show" :columns="list" :loading="loading" @onConfirm="onConfirm" @onCancel="onCancel" />
|
|
|
|
<Year :show="yearShow" :num="1" @onConfirmYear="onConfirmYear" @onCancelYear="onCancelYear" />
|
|
|
|
<!-- 变压器类型 -->
|
|
|
|
<VanPickerNew :show="handelClcikTrShow">
|
|
|
|
<div class="content">
|
|
|
|
<div class="content-head">
|
|
|
|
<div @click="onCancelTr">取消</div>
|
|
|
|
<div @click="onConfirmTr">确认</div>
|
|
|
|
</div>
|
|
|
|
<div class="content-main">
|
|
|
|
<van-cell v-for="item in trTypeList" :key="item.value" clickable :title="item.dict_label" style="font-weight: 400 !important; font-size: 15px !important">
|
|
|
|
<van-checkbox :name="item" checked-color="#009999" v-model="item.checked">
|
|
|
|
{{ item.text }}
|
|
|
|
</van-checkbox>
|
|
|
|
</van-cell>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</VanPickerNew>
|
|
|
|
|
|
|
|
<!-- 电压等级 -->
|
|
|
|
<VanPickerNew :show="levelShow">
|
|
|
|
<div class="content">
|
|
|
|
<div class="content-head">
|
|
|
|
<div @click="onCancelLe">取消</div>
|
|
|
|
<div @click="onConfirmLe">确认</div>
|
|
|
|
</div>
|
|
|
|
<div class="content-main">
|
|
|
|
<van-cell v-for="item in levelList" :key="item.value" clickable :title="item.dict_label" style="font-weight: 400 !important; font-size: 15px !important">
|
|
|
|
<van-checkbox :name="item" checked-color="#009999" v-model="item.checked" @click="clickCheckbox(item)">
|
|
|
|
{{ item.text }}
|
|
|
|
</van-checkbox>
|
|
|
|
</van-cell>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</VanPickerNew>
|
|
|
|
|
|
|
|
<!-- 设备类型 -->
|
|
|
|
<VanPickerNew :show="deviceTypeShow">
|
|
|
|
<div class="content">
|
|
|
|
<div class="content-head">
|
|
|
|
<div @click="onCancelDeviceType">取消</div>
|
|
|
|
<div @click="onConfirmDeviceType">确认</div>
|
|
|
|
</div>
|
|
|
|
<div class="content-main">
|
|
|
|
<van-cell v-for="item in deviceTypeList" :key="item.value" clickable :title="item.dict_label" style="font-weight: 400 !important; font-size: 15px !important">
|
|
|
|
<van-checkbox :name="item" checked-color="#009999" v-model="item.checked">
|
|
|
|
{{ item.name }}
|
|
|
|
</van-checkbox>
|
|
|
|
</van-cell>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</VanPickerNew>
|
|
|
|
</div>
|
|
</van-form>
|
|
|
|
</template>
|
|
|
|
<script>
|
|
import VanPickerNew from '@/components/vanPickerNew'
|
|
import ModifyMode from '../common-vue/modifyMode.vue'
|
|
import Whether from '../common-vue/whether.vue'
|
|
import Year from '../common-vue/year.vue'
|
|
import mixin from '@/mixins/mixin'
|
|
import { dataMode, getCodeCommon } from '../common'
|
|
import Radio from '../common-vue/radio.vue'
|
|
import { getNxzdPower } from '@/api/api.js'
|
|
import { mapGetters } from 'vuex'
|
|
|
|
export default {
|
|
name:'dis',
|
|
components: {
|
|
Radio,
|
|
Year,
|
|
ModifyMode,
|
|
Whether,
|
|
VanPickerNew,
|
|
},
|
|
mixins: [mixin],
|
|
|
|
data() {
|
|
return {
|
|
tips0: false,
|
|
typeId: this.$route.query.typeId,
|
|
tidCid: null,
|
|
//当前是何页面
|
|
page: {
|
|
name: '配电系统',
|
|
title: 'distribution',
|
|
},
|
|
//电压等级是否展示
|
|
levelShow: false,
|
|
//用能设备id
|
|
eqid: '',
|
|
//页面双向绑定及向后端传递的数据
|
|
form: {
|
|
voltageLevel: '', //电压等级
|
|
transformerType: "", //变压器类型
|
|
transformerNum: '', //变压器数量
|
|
distributeCapacity: '', //额定容量
|
|
maxNeed: '', //最大需量
|
|
penaltyAmount: '', //上一年累计度力调电费的惩罚金额
|
|
charging: '', //是否安装新能源充电桩
|
|
deviceType: '', //设备类型
|
|
compute: '', //V2G充电桩是否具备独立计量
|
|
inteVehicle: '', //是否接入车联网平台
|
|
distributeModiy: '', //是否进行过设备改造
|
|
modifyMode: '', //改造方式
|
|
modifyYear: '', //台区新增扩容改造年份
|
|
s13Num: '',
|
|
s12Num: '',
|
|
s11Num: '',
|
|
s10Num: '',
|
|
s9Num: '',
|
|
otherNum: '',
|
|
useYear:'',
|
|
makeModifyYear:'',
|
|
addModifyYear:'',
|
|
},
|
|
//页面展示的中文名称
|
|
formColumns: {
|
|
voltageLevelName: '',
|
|
// transformerTypeName: "",
|
|
deviceTypeName: '',
|
|
distributeModiyName: '',
|
|
inteVehicleName: '',
|
|
computeName: '',
|
|
chargingName: '',
|
|
modifyModeName: '',
|
|
},
|
|
/**
|
|
* 变压器类型
|
|
*/
|
|
handelClcikTrShow: false,
|
|
trName: '',
|
|
s13show: false,
|
|
s12show: false,
|
|
s11show: false,
|
|
s10show: false,
|
|
s9show: false,
|
|
otherShow: false,
|
|
|
|
//变压器类型数组
|
|
trTypeList: [{
|
|
text: 's13',
|
|
title:'s13Num',
|
|
value: '1',
|
|
checked: false,
|
|
},
|
|
{
|
|
text: 's12',
|
|
title:'s12Num',
|
|
value: '2',
|
|
checked: false,
|
|
},
|
|
{
|
|
text: 's11',
|
|
title:'s11Num',
|
|
value: '3',
|
|
checked: false,
|
|
},
|
|
{
|
|
text: 's10',
|
|
title:'s10Num',
|
|
value: '4',
|
|
checked: false,
|
|
},
|
|
{
|
|
text: 's9',
|
|
title:'s9Num',
|
|
value: '5',
|
|
checked: false,
|
|
},
|
|
{
|
|
text: '其他',
|
|
title:'otherNum',
|
|
value: '6',
|
|
checked: false,
|
|
},
|
|
],
|
|
//选中的变压器
|
|
resultTrList: [],
|
|
//未选中的变压器
|
|
resultTrSpliceList: [],
|
|
|
|
/**
|
|
* 电压等级
|
|
*/
|
|
//电压等级获取的数据
|
|
levelList: [],
|
|
//电压等级选中的数据
|
|
resultCheckboxLevel: [],
|
|
//电压等级未选中的数据
|
|
resultSpliceLevel: [],
|
|
|
|
//改造方式的系统码表数据
|
|
disType: {
|
|
id: 80000001025,
|
|
type: 'pdgzfs',
|
|
},
|
|
/**
|
|
* 复选框
|
|
*/
|
|
//改造方式选中
|
|
resultList: [],
|
|
//改造方式未选中
|
|
spliceList: [],
|
|
/**
|
|
* 询问
|
|
*/
|
|
useSearch: {
|
|
distributeEnquireDevIds: '', //设备类
|
|
distributeEnquireIds: '', //运营类
|
|
},
|
|
searchList: [],
|
|
distributeEnquireDevIdsList: [], //设备类
|
|
distributeEnquireIdsList: [], //运营类
|
|
|
|
/**
|
|
* 设备类型
|
|
*/
|
|
//谁被类型是否展示弹框
|
|
deviceTypeShow: false,
|
|
//设备类型数据
|
|
deviceTypeList: [],
|
|
//设备类型选中
|
|
resultCheckboxDevice: [],
|
|
//设备类型未选中
|
|
resultSpliceDevice: [],
|
|
//v2类型是否展示
|
|
v2Show: false,
|
|
//年份是否展示
|
|
modifyYearShow: false,
|
|
addModifyYearShow:false,
|
|
makeModifyYearShow:false,
|
|
//定时器
|
|
edSet: null,
|
|
modifyTimer:null,
|
|
required: false
|
|
// notData: {
|
|
// charging: {
|
|
// formColumnsField: ['deviceTypeName', 'computeName'],
|
|
// formField: ['deviceType', 'compute'],
|
|
// isShow: ['v2Show'],
|
|
// },
|
|
// distributeModiy: {
|
|
// formColumnsField: ['modifyModeName'],
|
|
// formField: ['modifyMode', 'modifyYear'],
|
|
// isShow: ['modifyYearShow'],
|
|
// }
|
|
|
|
// }
|
|
}
|
|
},
|
|
computed: {
|
|
...mapGetters(['cityIsNx']),
|
|
showForm() {
|
|
if(this.tidCid.taskId) {
|
|
return false
|
|
}
|
|
return true
|
|
},
|
|
//如果选择为否,携带属性需要删除
|
|
notData() {
|
|
return {
|
|
charging: {
|
|
formColumnsField: ['deviceTypeName', 'computeName'],
|
|
formField: ['deviceType', 'compute'],
|
|
isShow: ['v2Show'],
|
|
disList: this.deviceTypeList
|
|
},
|
|
distributeModiy: {
|
|
formColumnsField: ['modifyModeName'],
|
|
formField: ['modifyMode', 'modifyYear','addModifyYear','makeModifyYear'],
|
|
isShow: ['modifyYearShow','addModifyYearShow','makeModifyYearShow'],
|
|
list: []
|
|
}
|
|
}
|
|
|
|
}
|
|
},
|
|
watch: {
|
|
deviceTypeList: function(newVal) {
|
|
if (newVal && newVal.length > 0) {
|
|
if (this.form.deviceType) {
|
|
const deChcekedList = this.form.deviceType.split(',')
|
|
// 设备类型包含3时:展示V2G充电桩是否具备独立计量
|
|
if (deChcekedList.indexOf('3')>-1) {
|
|
this.v2Show = true
|
|
} else {
|
|
this.v2Show = false
|
|
}
|
|
const deData = newVal.filter((ele) => {
|
|
return deChcekedList.some((item) => item == ele.code)
|
|
})
|
|
|
|
this.formColumns.deviceTypeName = deData.map((ele) => {
|
|
ele.checked = true
|
|
return ele.name
|
|
}).join(',')
|
|
this.resultCheckboxDevice = deData
|
|
}
|
|
}
|
|
},
|
|
},
|
|
created() {
|
|
this.tidCid = JSON.parse(sessionStorage.getItem('tidCid'))
|
|
},
|
|
async mounted() {
|
|
this.$store.commit('pageData/GET_DIS', this.typeId)
|
|
this.editData()
|
|
},
|
|
|
|
beforeDestroy() {
|
|
clearTimeout(this.edSet)
|
|
clearTimeout(this.modifyTimer)
|
|
this.clearData()
|
|
},
|
|
methods: {
|
|
async getData(){
|
|
let {code, data} = await getNxzdPower(this.tidCid.customerId)
|
|
if(code==0){
|
|
Object.keys(data).map(ele => {
|
|
this.form[ele] = data[ele]
|
|
})
|
|
//电压等级
|
|
this.getList()
|
|
//变压器
|
|
this.editDataTrName()
|
|
}
|
|
},
|
|
changeTips () {
|
|
this.tips0 = false
|
|
if (Number(this.form.maxNeed) > Number(this.form.distributeCapacity)) {
|
|
this.tips0 = true
|
|
}
|
|
},
|
|
//获取系统码表返回值数据
|
|
//电压等级
|
|
async getList() {
|
|
const dydj = {
|
|
id: 80000001022,
|
|
type: 'dydj',
|
|
}
|
|
const level = await getCodeCommon(dydj)
|
|
console.log(level,335);
|
|
level.forEach((v) => {
|
|
v.checked = false
|
|
})
|
|
this.levelList = JSON.parse(JSON.stringify(level))
|
|
if (this.form.voltageLevel) {
|
|
const cheLevelList = this.form.voltageLevel.split(',')
|
|
this.resultCheckboxLevel=[]
|
|
this.levelList.forEach((ele) => {
|
|
ele.checked = false
|
|
cheLevelList.forEach((v) => {
|
|
if (ele.code == v) {
|
|
ele.checked = true
|
|
this.resultCheckboxLevel.push(ele)
|
|
}
|
|
})
|
|
})
|
|
|
|
this.formColumns.voltageLevelName = this.resultCheckboxLevel.map((ele) => ele.name).join(',')
|
|
} else {
|
|
this.formColumns.voltageLevelName = ''
|
|
}
|
|
},
|
|
async getList3() {
|
|
const deviceInfo = {
|
|
id: 80000001024,
|
|
type: 'cdzlx',
|
|
}
|
|
const deviceTypeList = await getCodeCommon(deviceInfo)
|
|
|
|
this.getDeviceTypeList(deviceTypeList)
|
|
},
|
|
//第二次进入页面查询vuex页面是否存储
|
|
// getVuexData() {
|
|
// for (const key in this.$store.getters.dirData) {
|
|
// for (const keys in this.$data) {
|
|
// if (key == keys) {
|
|
// this.$data[keys] = this.$store.getters.dirData[key]
|
|
// }
|
|
// }
|
|
// }
|
|
// },
|
|
clearData() {
|
|
for (const key in this.form) {
|
|
this.form[key] = ''
|
|
}
|
|
for (const key in this.formColumns) {
|
|
this.formColumns[key] = ''
|
|
}
|
|
for (const key in this.useSearch) {
|
|
this.useSearch[key] = ''
|
|
}
|
|
this.trTypeList.forEach((v)=>{
|
|
v.checked = false
|
|
})
|
|
this.handelClcikTrShow = false
|
|
this.deviceTypeShow = false
|
|
this.trName = ''
|
|
this.s13show = false
|
|
this.s12show = false
|
|
this.s11show = false
|
|
this.s10show = false
|
|
this.s9show = false
|
|
this.otherShow = false
|
|
this.v2Show = false
|
|
this.resultTrList = []
|
|
this.resultTrSpliceList = []
|
|
this.resultCheckboxLevel = []
|
|
this.resultSpliceLevel = []
|
|
this.resultList = []
|
|
this.spliceList = []
|
|
this.resultCheckboxDevice = []
|
|
this.resultSpliceDevice = []
|
|
sessionStorage.removeItem('pdModifyName')
|
|
|
|
},
|
|
//修改覆写数据
|
|
async editData() {
|
|
//电压等级
|
|
this.getList()
|
|
//设备类型
|
|
this.getList3()
|
|
this.edSet = setTimeout(async () => {
|
|
//前页面存起来的数据
|
|
const data = this.$store.getters.editData
|
|
//问询问题
|
|
const searchInfo = this.$store.getters.searchInfo
|
|
|
|
if (searchInfo) {
|
|
const res = dataMode(searchInfo['sbpd'])
|
|
this.searchList = res
|
|
//运营类
|
|
if(data.info.distributeEnquireIds == '') {
|
|
const list1 = res.find((ele)=> ele.type == 1)
|
|
const dataList1 = list1.child.map((item)=> item.enquireId)
|
|
this.useSearch.distributeEnquireIds = dataList1.join(',')
|
|
this.distributeEnquireIdsList = dataList1
|
|
}
|
|
//设备类
|
|
if(data.info.distributeEnquireDevIds == '') {
|
|
const list1 = res.find((ele)=> ele.type == 2)
|
|
const dataList1 = list1.child.map((item)=> item.enquireId)
|
|
this.useSearch.distributeEnquireDevIds = dataList1.join(',')
|
|
this.distributeEnquireDevIdsList = dataList1
|
|
|
|
}
|
|
this.$store.commit('search/SET_DISTR', this.useSearch)
|
|
}
|
|
console.log(data.pageKey);
|
|
//判断如果为修改状态
|
|
if (data.pageKey) {
|
|
//获取当前用能设备id
|
|
this.eqid = data.info.equipId
|
|
// 判断后端是否存在配电页面的数据
|
|
if (data.info.nxzdDistributeSystemDTO) {
|
|
for (const key in data.info.nxzdDistributeSystemDTO) {
|
|
for (const keys in this.form) {
|
|
if (key == keys) {
|
|
this.form[keys] = data.info.nxzdDistributeSystemDTO[key]
|
|
}
|
|
}
|
|
}
|
|
console.log(this.form,'ppppp');
|
|
if (this.form.modifyYear) {
|
|
this.modifyYearShow = true
|
|
}
|
|
if (this.form.makeModifyYear) {
|
|
this.makeModifyYearShow = true
|
|
}
|
|
if (this.form.addModifyYear) {
|
|
this.addModifyYearShow = true
|
|
}
|
|
//电压等级
|
|
this.getList()
|
|
//设备类型
|
|
this.getList3()
|
|
//变压器
|
|
this.editDataTrName()
|
|
//判断是否
|
|
this.editDataIsTrue()
|
|
//改造方式
|
|
this.editModifyMode()
|
|
//问询
|
|
this.editDataSearch(data)
|
|
|
|
// this.getList2()
|
|
} else {
|
|
for (const key in this.form) {
|
|
this.form[key] = ''
|
|
}
|
|
if(this.cityIsNx){
|
|
this.getData()
|
|
}
|
|
}
|
|
return
|
|
}
|
|
}, 200)
|
|
},
|
|
|
|
// setVuexData() {
|
|
// this.$store.commit('pageData/CURRENT_DIR_DATA', this.$data)
|
|
// },
|
|
|
|
/**
|
|
* editData变压器
|
|
*/
|
|
editDataTrName() {
|
|
if (this.form.s13Num) {
|
|
this.s13show = true
|
|
this.resultTrList.push({
|
|
text: 's13',
|
|
title:'s13Num',
|
|
value: '1',
|
|
checked: true,
|
|
})
|
|
}
|
|
|
|
if (this.form.s12Num) {
|
|
this.s12show = true
|
|
this.resultTrList.push({
|
|
text: 's12',
|
|
title:'s12Num',
|
|
value: '2',
|
|
checked: true,
|
|
})
|
|
}
|
|
|
|
if (this.form.s11Num) {
|
|
this.s11show = true
|
|
this.resultTrList.push({
|
|
text: 's11',
|
|
title:'s11Num',
|
|
value: '3',
|
|
checked: true,
|
|
})
|
|
}
|
|
|
|
if (this.form.s10Num) {
|
|
this.s10show = true
|
|
this.resultTrList.push({
|
|
text: 's10',
|
|
title:'s10Num',
|
|
value: '4',
|
|
checked: true,
|
|
})
|
|
}
|
|
|
|
if (this.form.s9Num) {
|
|
this.s9show = true
|
|
this.resultTrList.push({
|
|
text: 's9',
|
|
title:'s9Num',
|
|
value: '5',
|
|
checked: true,
|
|
})
|
|
}
|
|
|
|
if (this.form.otherNum) {
|
|
this.otherShow = true
|
|
this.resultTrList.push({
|
|
text: '其他',
|
|
title:'otherNum',
|
|
value: '6',
|
|
checked: true,
|
|
})
|
|
}
|
|
|
|
if (!this.form.s13Num) {
|
|
this.s13show = false
|
|
this.resultTrSpliceList.push({
|
|
text: 's13',
|
|
title:'s13Num',
|
|
value: '1',
|
|
checked: false,
|
|
})
|
|
}
|
|
|
|
if (!this.form.s12Num) {
|
|
this.s12show = false
|
|
this.resultTrSpliceList.push({
|
|
text: 's12',
|
|
title:'s12Num',
|
|
value: '2',
|
|
checked: false,
|
|
})
|
|
}
|
|
|
|
if (!this.form.s11Num) {
|
|
this.s11show = false
|
|
this.resultTrSpliceList.push({
|
|
text: 's11',
|
|
title:'s11Num',
|
|
value: '3',
|
|
checked: false,
|
|
})
|
|
}
|
|
|
|
if (!this.form.s10Num) {
|
|
this.s10show = false
|
|
this.resultTrSpliceList.push({
|
|
text: 's10',
|
|
title:'s10Num',
|
|
value: '4',
|
|
checked: false,
|
|
})
|
|
}
|
|
|
|
if (!this.form.s9Num) {
|
|
this.s9show = false
|
|
this.resultTrSpliceList.push({
|
|
text: 's9',
|
|
title:'s9Num',
|
|
value: '5',
|
|
checked: false,
|
|
})
|
|
}
|
|
|
|
if (!this.form.otherNum) {
|
|
this.otherShow = false
|
|
this.resultTrSpliceList.push({
|
|
text: '其他',
|
|
title:'otherNum',
|
|
value: '6',
|
|
checked: false,
|
|
})
|
|
}
|
|
|
|
this.trName = this.resultTrList.map((ele) => ele.text).join(',')
|
|
this.form.transformerType = this.resultTrList.map((ele) => ele.value).join(',')
|
|
|
|
if (this.resultTrList && this.resultTrList.length > 0) {
|
|
this.trTypeList.forEach((v) => {
|
|
v.checked = false
|
|
this.resultTrList.forEach((ev) => {
|
|
if (v.value == ev.value) {
|
|
v.checked = ev.checked
|
|
}
|
|
})
|
|
})
|
|
}
|
|
},
|
|
|
|
/**
|
|
* editData判断所有的是否
|
|
*/
|
|
editDataIsTrue() {
|
|
const list = [
|
|
{
|
|
id: '1',
|
|
name: '是',
|
|
},
|
|
{
|
|
id: '2',
|
|
name: '否',
|
|
},
|
|
]
|
|
//是否进行过设备改造
|
|
const obj = list.find((v) => v.id == this.form.distributeModiy)
|
|
//是否接入车联网平台
|
|
const obj1 = list.find((v) => v.id == this.form.inteVehicle)
|
|
//V2G充电桩是否具备独立计量
|
|
const obj2 = list.find((v) => v.id == this.form.compute)
|
|
//是否安装新能源充电桩
|
|
const obj3 = list.find((v) => v.id == this.form.charging)
|
|
|
|
if (obj) {
|
|
this.formColumns.distributeModiyName = obj.name
|
|
} else {
|
|
this.formColumns.distributeModiyName = ''
|
|
}
|
|
if (obj1) {
|
|
this.formColumns.inteVehicleName = obj1.name
|
|
} else {
|
|
this.formColumns.inteVehicleName = ''
|
|
}
|
|
if (obj2) {
|
|
this.formColumns.computeName = obj2.name
|
|
} else {
|
|
this.formColumns.computeName = ''
|
|
}
|
|
|
|
if (obj3) {
|
|
this.formColumns.chargingName = obj3.name
|
|
} else {
|
|
this.formColumns.chargingName = ''
|
|
}
|
|
},
|
|
/**
|
|
* editData改造方式
|
|
*/
|
|
editModifyMode() {
|
|
if (this.form.modifyMode) {
|
|
const data = this.form.modifyMode.split(',')
|
|
this.resultList = data
|
|
|
|
}
|
|
|
|
// editData改造方式名称
|
|
this.modifyTimer = setTimeout(() => {
|
|
const mNameData = JSON.parse(sessionStorage.getItem('pdModifyName'))
|
|
if (mNameData) {
|
|
this.formColumns.modifyModeName = mNameData.map((ele) => ele.name).join(',')
|
|
}
|
|
}, 500)
|
|
},
|
|
|
|
/**
|
|
* editData问询
|
|
*/
|
|
editDataSearch(data) {
|
|
/**
|
|
* 询问回显
|
|
*/
|
|
//设备类
|
|
if (data.info.distributeEnquireDevIds && this.searchList.length > 0) {
|
|
const devList = data.info.distributeEnquireDevIds.split(',')
|
|
|
|
this.useSearch.distributeEnquireDevIds = data.info.distributeEnquireDevIds
|
|
|
|
this.distributeEnquireDevIdsList = devList
|
|
|
|
this.searchList[1].child.forEach((ele) => {
|
|
ele.color = false
|
|
devList.forEach((item) => {
|
|
if (item == ele.enquireId) {
|
|
ele.color = true
|
|
}
|
|
})
|
|
})
|
|
}
|
|
//运营类
|
|
|
|
if (data.info.distributeEnquireIds && this.searchList.length > 0) {
|
|
const devList = data.info.distributeEnquireIds.split(',')
|
|
this.useSearch.distributeEnquireIds = data.info.distributeEnquireIds
|
|
this.distributeEnquireIdsList = devList
|
|
this.searchList[0].child.forEach((ele) => {
|
|
ele.color = false
|
|
devList.forEach((v) => {
|
|
if (v == ele.enquireId) {
|
|
ele.color = true
|
|
}
|
|
})
|
|
})
|
|
}
|
|
this.$store.commit('search/SET_DISTR', this.useSearch)
|
|
},
|
|
|
|
|
|
/**
|
|
* 电压等级
|
|
*/
|
|
onCancelLe() {
|
|
this.levelList.forEach((v)=>{
|
|
this.resultSpliceLevel.forEach((sv)=>{
|
|
if(v.value == sv.value) {
|
|
v.checked = false
|
|
}
|
|
})
|
|
|
|
this.resultCheckboxLevel.forEach((rv)=>{
|
|
if(v.value == rv.value) {
|
|
v.checked = true
|
|
}
|
|
})
|
|
})
|
|
this.levelShow = false
|
|
},
|
|
onConfirmLe() {
|
|
const leName = this.levelList.filter((ele) => ele.checked)
|
|
const leameF = this.levelList.filter((ele) => !ele.checked)
|
|
this.resultCheckboxLevel = leName
|
|
this.resultSpliceLevel = leameF
|
|
this.formColumns.voltageLevelName = leName.map((ele)=> ele.name).join(',')
|
|
this.form.voltageLevel = leName.map((ele)=> ele.code).join(',')
|
|
this.levelShow = false
|
|
},
|
|
|
|
/**
|
|
* 设备类型
|
|
*/
|
|
|
|
onCancelDeviceType() {
|
|
this.deviceTypeList.forEach((v)=>{
|
|
this.resultSpliceDevice.forEach((sv)=>{
|
|
if(v.value == sv.value) {
|
|
v.checked = false
|
|
}
|
|
})
|
|
|
|
this.resultCheckboxDevice.forEach((rv)=>{
|
|
if(v.value == rv.value) {
|
|
v.checked = true
|
|
}
|
|
})
|
|
})
|
|
this.deviceTypeShow = false
|
|
},
|
|
onConfirmDeviceType() {
|
|
const deName = this.deviceTypeList.filter((ele) => ele.checked)
|
|
const deameF = this.deviceTypeList.filter((ele) => !ele.checked)
|
|
this.resultCheckboxDevice = deName
|
|
this.resultSpliceDevice = deameF
|
|
const v2Obj = deName.find((ele) => ele.code == 3)
|
|
if (v2Obj && v2Obj.checked) {
|
|
this.v2Show = true
|
|
} else {
|
|
this.formColumns.computeName = this.form.compute = ''
|
|
this.v2Show = false
|
|
}
|
|
|
|
this.formColumns.deviceTypeName = deName.map((ele) => ele.name).join(',')
|
|
this.form.deviceType = deName.map((ele) => ele.value).join(',')
|
|
this.deviceTypeShow = false
|
|
|
|
},
|
|
//点击变压器类型取消还原上次操作
|
|
onCancelTr() {
|
|
this.handelClcikTrShow = false
|
|
|
|
this.trTypeList.forEach((v)=>{
|
|
this.resultTrSpliceList.forEach((sv)=>{
|
|
if(v.value == sv.value) {
|
|
v.checked = false
|
|
}
|
|
})
|
|
|
|
this.resultTrList.forEach((rv)=>{
|
|
if(v.value == rv.value) {
|
|
v.checked = true
|
|
}
|
|
})
|
|
})
|
|
|
|
},
|
|
onConfirmTr() {
|
|
const trName = this.trTypeList.filter((ele) => ele.checked)
|
|
const trNameF = this.trTypeList.filter((ele) => !ele.checked)
|
|
this.resultTrList = trName
|
|
this.resultTrSpliceList = trNameF
|
|
this.trName = trName.map((ele)=> ele.text).join(',')
|
|
this.form.transformerType = trName.map((ele)=> ele.value).join(',')
|
|
this.resultTrList.forEach((v) => {
|
|
if (v.text == 's13' && v.checked) {
|
|
this.s13show = true
|
|
}
|
|
if (v.text == 's12' && v.checked) {
|
|
this.s12show = true
|
|
}
|
|
if (v.text == 's11' && v.checked) {
|
|
this.s11show = true
|
|
}
|
|
if (v.text == 's10' && v.checked) {
|
|
this.s10show = true
|
|
}
|
|
if (v.text == 's9' && v.checked) {
|
|
this.s9show = true
|
|
}
|
|
if (v.text == '其他' && v.checked) {
|
|
this.otherShow = true
|
|
}
|
|
})
|
|
this.resultTrSpliceList.forEach((v) => {
|
|
if (v.text == 's13' && !v.checked) {
|
|
this.s13show = false
|
|
this.form.s13Num = ''
|
|
}
|
|
if (v.text == 's12' && !v.checked) {
|
|
this.s12show = false
|
|
this.form.s12Num = ''
|
|
}
|
|
if (v.text == 's11' && !v.checked) {
|
|
this.s11show = false
|
|
this.form.s11Num = ''
|
|
}
|
|
if (v.text == 's10' && !v.checked) {
|
|
this.s10show = false
|
|
this.form.s10Num = ''
|
|
}
|
|
if (v.text == 's9' && !v.checked) {
|
|
this.s9show = false
|
|
this.form.s9Num = ''
|
|
}
|
|
if (v.text == '其他' && !v.checked) {
|
|
this.otherShow = false
|
|
this.form.otherNum = ''
|
|
}
|
|
})
|
|
|
|
this.handelClcikTrShow = false
|
|
},
|
|
clickCheckbox(item){
|
|
this.levelList.forEach((v) => {
|
|
v.checked = false
|
|
if (v.value == item.value) {
|
|
v.checked = true
|
|
}
|
|
})
|
|
},
|
|
//递归拆分数据
|
|
getDeviceTypeList(list) {
|
|
const list1 = JSON.parse(JSON.stringify(list))
|
|
let arr = []
|
|
list1.forEach((v) => {
|
|
arr.push(v)
|
|
if (v.child) {
|
|
v.child.forEach((ev) => {
|
|
arr.push(ev)
|
|
})
|
|
this.getDeviceTypeList(v.child)
|
|
}
|
|
})
|
|
arr.forEach((v) => {
|
|
v.checked = false
|
|
})
|
|
this.deviceTypeList = arr
|
|
},
|
|
|
|
/**
|
|
* 闻讯
|
|
*/
|
|
//询问选择为是
|
|
handelClickOk(ele, i) {
|
|
if(this.showForm) {
|
|
return
|
|
}
|
|
if (ele.enquireType == '2' && !ele.color) {
|
|
this.distributeEnquireDevIdsList.splice(i-1, 1, ele.enquireId)
|
|
ele.color = true
|
|
}
|
|
if (ele.enquireType == '1' && !ele.color) {
|
|
this.distributeEnquireIdsList.splice(i-1, 1, ele.enquireId)
|
|
ele.color = true
|
|
}
|
|
|
|
this.useSearch.distributeEnquireDevIds = this.distributeEnquireDevIdsList.join(',')
|
|
this.useSearch.distributeEnquireIds = this.distributeEnquireIdsList.join(',')
|
|
|
|
this.$store.commit('search/SET_DISTR', this.useSearch)
|
|
},
|
|
//询问选择为否
|
|
handelClickNo(ele, list) {
|
|
if(this.showForm) {
|
|
return
|
|
}
|
|
if (ele.enquireType == '2' && ele.color) {
|
|
const index = this.distributeEnquireDevIdsList.findIndex((v) => v == ele.enquireId)
|
|
if(index == -1) {
|
|
this.distributeEnquireDevIdsList = list.map((item)=> {
|
|
if(ele.enquireId == item.enquireId) {
|
|
return item.noId
|
|
}
|
|
return item.enquireId
|
|
})
|
|
|
|
this.useSearch.distributeEnquireDevIds = this.distributeEnquireDevIdsList.join(',')
|
|
const elseItem = this.searchList.find((ele)=> ele.type == '1')
|
|
this.useSearch.distributeEnquireIds = elseItem.child.map((ele)=> {
|
|
if(ele.color) {
|
|
return ele.enquireId
|
|
} else {
|
|
return ele.noId
|
|
}
|
|
}).join(',')
|
|
|
|
ele.color = false
|
|
} else {
|
|
this.distributeEnquireDevIdsList.splice(index, 1, ele.noId)
|
|
this.useSearch.distributeEnquireDevIds = this.distributeEnquireDevIdsList.join(',')
|
|
const elseItem = this.searchList.find((ele)=> ele.type == '1')
|
|
this.useSearch.distributeEnquireIds = elseItem.child.map((ele)=> {
|
|
if(ele.color) {
|
|
return ele.enquireId
|
|
} else {
|
|
return ele.noId
|
|
}
|
|
}).join(',')
|
|
|
|
ele.color = false
|
|
}
|
|
|
|
}
|
|
if (ele.enquireType == '1' && ele.color) {
|
|
const index = this.distributeEnquireIdsList.findIndex((v) => v == ele.enquireId)
|
|
if(index == -1) {
|
|
this.distributeEnquireIdsList = list.map((item)=> {
|
|
if(ele.enquireId == item.enquireId) {
|
|
return item.noId
|
|
}
|
|
return item.enquireId
|
|
})
|
|
|
|
this.useSearch.distributeEnquireIds = this.distributeEnquireIdsList.join(',')
|
|
const elseItem = this.searchList.find((ele)=> ele.type == '2')
|
|
this.useSearch.distributeEnquireDevIds = elseItem.child.map((ele)=> {
|
|
if(ele.color) {
|
|
return ele.enquireId
|
|
} else {
|
|
return ele.noId
|
|
}
|
|
}).join(',')
|
|
|
|
ele.color = false
|
|
} else {
|
|
this.distributeEnquireIdsList.splice(index, 1, ele.noId)
|
|
this.useSearch.distributeEnquireIds = this.distributeEnquireIdsList.join(',')
|
|
const elseItem = this.searchList.find((ele)=> ele.type == '2')
|
|
this.useSearch.distributeEnquireDevIds = elseItem.child.map((ele)=> {
|
|
if(ele.color) {
|
|
return ele.enquireId
|
|
} else {
|
|
return ele.noId
|
|
}
|
|
}).join(',')
|
|
|
|
ele.color = false
|
|
}
|
|
|
|
}
|
|
this.$store.commit('search/SET_DISTR', this.useSearch)
|
|
},
|
|
//点击改造方式确认
|
|
onConfirmCheckbox(data) {
|
|
this.modifyYearShow = false
|
|
this.makeModifyYearShow = false
|
|
this.addModifyYearShow = false
|
|
data.delList.forEach((v)=> {
|
|
if(!v.checked && v.value == 1) {
|
|
this.form.addModifyYear = ''
|
|
}
|
|
if(!v.checked && v.value == 2) {
|
|
this.form.makeModifyYear = ''
|
|
}
|
|
if(!v.checked && v.value == 3) {
|
|
this.form.modifyYear = ''
|
|
}
|
|
})
|
|
data.id.forEach((v)=> {
|
|
console.log(v);
|
|
if (v == 1) {
|
|
this.addModifyYearShow = true
|
|
}
|
|
if (v == 2) {
|
|
this.makeModifyYearShow = true
|
|
}
|
|
if (v == 3) {
|
|
this.modifyYearShow = true
|
|
}
|
|
})
|
|
this.formColumns.modifyModeName = data.name.join(',')
|
|
this.form.modifyMode = data.id.join(',')
|
|
},
|
|
handleClickInput() {
|
|
this.$router.push({ path: '/facilityManage/list' })
|
|
},
|
|
},
|
|
}
|
|
</script>
|
|
|
|
<style lang="less" scoped>
|
|
@import '../common-vue/common.less';
|
|
@import '../common-vue/checkbox.less';
|
|
.focusAir {
|
|
padding: 0 15px;
|
|
.bottom {
|
|
margin-top: 20px;
|
|
border-radius: 10px;
|
|
overflow: auto;
|
|
}
|
|
}
|
|
|
|
.focusItem {
|
|
border-radius: 8px;
|
|
overflow: auto;
|
|
.addTitleLeft {
|
|
flex: 0 0 220px;
|
|
}
|
|
}
|
|
|
|
.text-ellipsis {
|
|
overflow: hidden;
|
|
white-space: nowrap;
|
|
text-overflow: ellipsis;
|
|
-o-text-overflow: ellipsis;
|
|
}
|
|
/deep/ .van-field__error-message {
|
|
text-align: right;
|
|
}
|
|
.tips {
|
|
padding: 0 16px;
|
|
display: flex;
|
|
justify-content: flex-end;
|
|
color: #ee0a24;
|
|
font-size: 12px;
|
|
}
|
|
</style> |