能效诊断

This commit is contained in:
jiangyinzhi
2024-07-10 10:25:32 +08:00
parent b7aa6f87f1
commit 04f0606430
262 changed files with 58693 additions and 1 deletions
@@ -0,0 +1,895 @@
<template>
<div class="list">
<van-form ref="detailForm" @submit="handelClickSave">
<div class="list-upload" v-if="(type == 1||type == 2) && $store.getters.imageRecognition">
<btn-uploader type="filePic" :value="filePic" @afterRead="afterRead" @delImg="delImg" @onUpload="onUpload" />
</div>
<div class="container" v-if="type == 1">
<div class="inputStyle">
<van-cell-group>
<van-field v-model="formColumns.refrigeTypeName" label="机组类型" is-link readonly input-align="right" placeholder="请选择" required :rules="[{ required: true }]" @click="handelClickHeatingShow('jzlx', 80000001016,'refrigeTypeName','refrigeType','kt')"/>
<van-field v-model="form.model" label="设备型号" required :rules="[{ required: true },{pattern:/^.{2,30}$/, message:'2≤型号长度≤30'}]" input-align="right" maxlength="30" placeholder="请输入设备型号"/>
<van-field v-model="refrigeNum" v-input.numNo0 label="数量(台)" readonly type="number" required :rules="[{ required: true }]" input-align="right" placeholder="自动计算" />
<div class="tips" v-if="refrigeNum+''=='0'">数量>0</div>
<van-field v-model="edgl" v-input.floatNo0 label="额定功率(kW)" type="number" required :rules="[{ required: true }]" input-align="right" placeholder="请输入" />
<div class="tips" v-if="ratio">{{ refrigeTypeData[form.refrigeType][0]}} ≤额定制冷量/额定功率≤ {{refrigeTypeData[form.refrigeType][1]}}</div>
<van-field v-model="hyl" v-input.float label="耗用量(t或m3)" type="number" label-width="100" input-align="right" placeholder="请输入" />
<van-field v-model="form.coolCapacity" v-input.floatNo0 label="额定制冷量(kW)" required :rules="[{ required: true }]" type="number" input-align="right" placeholder="请输入" />
<div class="tips" v-if="ratio">{{ refrigeTypeData[form.refrigeType][0]}} ≤额定制冷量/额定功率≤ {{refrigeTypeData[form.refrigeType][1]}}</div>
<van-field v-model="form.useExpl" v-input.num label="在用台数(台)" type="number" required :rules="[{ required: true }]" input-align="right" placeholder="请输入"/>
<van-field v-model="form.backupExpl" v-input.num label="备用台数(台)" type="number" required :rules="[{ required: true }]" input-align="right" placeholder="请输入"/>
<van-field v-model="form.useYear" label="设备投用年份" label-width="140" required :rules="[{ required: true }]" input-align="right" is-link placeholder="请选择" readonly @click="handelClickYear('useYear')" />
</van-cell-group>
<van-cell class="img-box box1" title="设备外观" :required="$store.getters.cityType"/>
<Uploader type="exteriorImage1" :value="exteriorImage1" @afterRead="afterRead1" @delImg="delImg1" @onUpload="onUpload1" />
<div class="tips tipImage" v-if="$store.getters.cityType&&form.exteriorImage.length<1">请上传设备外观照片</div>
<van-cell class="img-box" title="设备铭牌" />
<Uploader type="tagImage1" :value="tagImage1" @afterRead="afterRead2" @delImg="delImg2" @onUpload="onUpload2" />
<van-cell class="img-box" title="设备能效标识" />
<Uploader type="markImage1" :value="markImage1" @afterRead="afterRead3" @delImg="delImg3" @onUpload="onUpload3" />
</div>
<VanPickerNew :show="show" :columns="list" :loading="loading" @onConfirm="onConfirm" @onCancel="onCancel" />
<Year :show="yearShow" :num="1" @onConfirmYear="onConfirmYear" @onCancelYear="onCancelYear" />
</div>
<div class="container" v-if="type == 2">
<!-- 设备类型选择 -->
<div class="inputStyle">
<van-cell-group>
<van-field v-model="formColumns.refrigeTypeName" label="设备类型" required :rules="[{ required: true }]" input-align="right" is-link placeholder="请选择" @click="handelClickHeatingShow('jzlx', 80000001016,'refrigeTypeName','refrigeType','lqt' )" readonly />
<!-- <van-cell title="设备类型" is-link :value="form.refrigeTypeName" @click="showPicker = true" readonly /> -->
<van-field v-model="form.model" label="设备型号" required :rules="[{ required: true },{pattern:/^.{2,30}$/, message:'2≤型号长度≤30'}]" input-align="right" maxlength="30" placeholder="请输入设备型号"/>
<van-field v-model="refrigeNum" v-input.numNo0 label="数量(台)" readonly type="number" required :rules="[{ required: true }]" input-align="right" placeholder="自动计算" />
<div class="tips" v-if="refrigeNum+''=='0'">数量>0</div>
<van-field v-model="form.ratedPower" v-input.floatNo0 label="额定功率(kW)" type="number" required :rules="[{ required: true }]" input-align="right" placeholder="请输入" />
<van-field v-model="form.useExpl" v-input.num label="在用台数(台)" required :rules="[{ required: true }]" input-align="right" placeholder="请输入" />
<van-field v-model="form.backupExpl" v-input.num label="备用台数(台)" required :rules="[{ required: true }]" input-align="right" placeholder="请输入" />
<van-field v-model="form.useYear" label="设备投用年份" label-width="140" required :rules="[{ required: true }]" input-align="right" is-link placeholder="请选择" readonly @click="handelClickYear('useYear')" />
</van-cell-group>
<van-cell class="img-box box1" title="设备外观" :required="$store.getters.cityType"/>
<Uploader type="exteriorImage1" :value="exteriorImage1" @afterRead="afterRead1" @delImg="delImg1" @onUpload="onUpload1" />
<div class="tips tipImage" v-if="$store.getters.cityType&&form.exteriorImage.length<1">请上传设备外观照片</div>
<van-cell class="img-box" title="设备铭牌" />
<Uploader type="tagImage1" :value="tagImage1" @afterRead="afterRead2" @delImg="delImg2" @onUpload="onUpload2" />
<van-cell class="img-box" title="设备能效标识" />
<Uploader type="markImage1" :value="markImage1" @afterRead="afterRead3" @delImg="delImg3" @onUpload="onUpload3" />
</div>
<VanPickerNew :show="show" :columns="list" :loading="loading" @onConfirm="onConfirm" @onCancel="onCancel" />
<Year :show="yearShow" :num="1" @onConfirmYear="onConfirmYear" @onCancelYear="onCancelYear" />
</div>
<div class="container" v-if="type == 3">
<div class="inputStyle">
<van-cell-group>
<van-field v-model="formColumns.refrigeTypeName" label="机组类型" required :rules="[{ required: true }]" input-align="right" is-link placeholder="请选择" @click="handelClickHeatingShow('jzlx',80000001020,'refrigeTypeName','refrigeType')" readonly />
<van-field v-model="form1.model" label="设备型号" required :rules="[{ required: true },{pattern:/^.{2,30}$/, message:'2≤型号长度≤30'}]" input-align="right" maxlength="30" placeholder="请输入设备型号"/>
<van-field v-model="heatNum" v-input.numNo0 label="数量(台)" readonly type="number" required :rules="[{ required: true }]" input-align="right" placeholder="自动计算" />
<div class="tips" v-if="heatNum+''=='0'">数量>0</div>
<van-field @input="changeTips" v-model="edgl" v-input.floatNo0 label="额定功率(kW)" type="number" required :rules="[{ required: true }]" input-align="right" placeholder="请输入" />
<van-field v-model="hyl" v-input.floatNo0 label="耗用量(t或m3)" type="number" label-width="100" input-align="right" placeholder="请输入" />
<van-field @input="changeTips" v-model="form1.heatCapacity" v-input.floatNo0 label="额定制热量(kW)" type="number" required :rules="[{ required: true }]" input-align="right" placeholder="请输入" />
<van-field v-model="form1.useExpl" v-input.num type="number" label="在用台数(台)" required :rules="[{ required: true }]" input-align="right" placeholder="请输入" />
<van-field v-model="form1.backupExpl" v-input.num type="number" label="备用台数(台)" required :rules="[{ required: true }]" input-align="right" placeholder="请输入" />
<van-field v-model="form1.useYear" label="设备投用年份" label-width="140" required :rules="[{ required: true }]" input-align="right" is-link placeholder="请选择" readonly @click="handelClickYear('useYear')" />
</van-cell-group>
<van-cell class="img-box box1" title="设备外观" :required="$store.getters.cityType"/>
<Uploader type="exteriorImage1" :value="exteriorImage1" @afterRead="afterRead1" @delImg="delImg1" @onUpload="onUpload1" />
<div class="tips tipImage" v-if="$store.getters.cityType&&form1.exteriorImage.length<1">请上传设备外观照片</div>
<van-cell class="img-box" title="设备铭牌" />
<Uploader type="tagImage1" :value="tagImage1" @afterRead="afterRead2" @delImg="delImg2" @onUpload="onUpload2" />
<van-cell class="img-box" title="设备能效标识" />
<Uploader type="markImage1" :value="markImage1" @afterRead="afterRead3" @delImg="delImg3" @onUpload="onUpload3" />
</div>
<VanPickerNew :show="show" :columns="list" :loading="loading" @onConfirm="onConfirm" @onCancel="onCancel" />
<Year :show="yearShow" :num="1" @onConfirmYear="onConfirmYear1" @onCancelYear="onCancelYear" />
</div>
<div class="bottom">
<van-button type="primary" block native-type="submit">
保存
</van-button>
</div>
</van-form>
</div>
</template>
<script>
// import Header from "@/components/headerNew";
// import { uploadFile } from "@/api/api.js";
// import { Toast } from "vant";
import { pureDigital } from '../pattern'
import VanPickerNew from "@/components/vanPickerNew";
import Year from "../common-vue/year.vue";
import mixin from "@/mixins/mixin";
import { downloadUrl } from "@/settings";
import Uploader from "../common-vue/uploader.vue";
import btnUploader from "../common-vue/btnUploader.vue";
export default {
name: "burstingDetail",
components: {
Uploader,
btnUploader,
Year,
// Header,
VanPickerNew,
},
mixins: [mixin],
computed: {
pureDigital() {
return pureDigital
},
refrigeNum: {
get(){
if( this.form.useExpl && this.form.backupExpl ){
this.form.refrigeNum = Number(this.form.useExpl) + Number(this.form.backupExpl)
}
return this.form.refrigeNum
},
set () {}
},
// 额定制冷量/额定功率
ratio(){
if(this.form.coolCapacity&&this.edgl&&this.edgl!=0&&this.form.refrigeType){
let ratioData = this.form.coolCapacity/this.edgl
let data = this.refrigeTypeData[this.form.refrigeType][0] <= ratioData && ratioData <= this.refrigeTypeData[this.form.refrigeType][1]
return !data
}
},
heatNum: {
get(){
if( this.form1.useExpl && this.form1.backupExpl ){
this.form1.heatNum = Number(this.form1.useExpl) + Number(this.form1.backupExpl)
}
return this.form1.heatNum
},
set () {}
},
},
data() {
return {
tips0: false,
exteriorImage1: [], //设备外观
tagImage1: [], //设备铭牌
markImage1: [], //设备能效标识
showPicker: false,
// 设备类型
option: [
{ value: 3, text: "地/水源热泵机组" },
{ value: 5, text: "冷冻泵(一、二次)" },
{ value: 6, text: "冷却泵" },
{ value: 7, text: "冷却塔" },
],
show: false,
parentPath: "",
list: [],
title: "",
type: "",
index: "",
form: {
equipId:'',
refrigeId:'',
refrigeType: "",
refrigeTypeName: "",
model: "",
refrigeNum: "",
ratedPower: "",
coolCapacity: "",
useExpl: "",
backupExpl: "",
useYear: "",
exteriorImage: "", //设备外观
tagImage: "", //设备铭牌
markImage: "", //设备能效标识
},
form1: {
equipId:'',
model: "",
heatId:'',
unitType: "",
unitTypeName: "",
heatNum: "",
ratedPower: "",
heatCapacity: "",
useExpl: "",
backupExpl: "",
useYear: "",
exteriorImage: "", //设备外观
tagImage: "", //设备铭牌
markImage: "", //设备能效标识
},
formColumns: {
refrigeType: "",
refrigeTypeName: "",
},
edgl: "", //额定功率
hyl: "", //耗用量
arrKt: [], // 集中式空调机组
arrLq: [], // 输送泵组/冷却塔
arrCn: [], // 采暖机组
//机组阈值
refrigeTypeData: {},
refrigeTypeDataSmall:{
"1": ['3.80', '6.30'],
"2": ['2.40', '3.40'],
"3": ['3.50', '5.90'],
"4": ['1.10', '1.40']
},
refrigeTypeDataBig:{
"1": ['1.90', '9.45'],
"2": ['1.20', '5.10'],
"3": ['1.75', '8.85'],
"4": ['0.55', '2.10']
},
filePic: []
};
},
created() {
this.getCome()
if(this.$store.getters.validate){
this.refrigeTypeData = this.refrigeTypeDataBig
}else{
this.refrigeTypeData = this.refrigeTypeDataSmall
}
},
beforeDestroy() {
this.clearPage();
},
methods: {
// 改变tips的状态
changeTips () {
},
//获取当前进入是新增还是修改
getCome() {
this.type = this.$route.params.type;
if (this.type == 1) {
this.getArrKt();
} else if (this.type == 2) {
this.getArrLq();
} else {
this.getArrCn();
}
},
onConfirmYear1(obj) {
this.form1.useYear = obj.value;
this.yearShow = false;
},
//判断删除的list中是否为对象格式
delIsObj(delList) {
const list = delList.map((ele) => {
if (ele instanceof Object) {
return ele.url
}
return ele
})
return list
},
// 上传图片调用原生的方法 获取到绝对路径调用getImageFileFromUrl
onUpload (data) {
if(this.type == 1){
this.form.coolCapacity = data.coolCapacity
this.edgl = parseFloat(data.ratedPower)
}else {
this.form.ratedPower = parseFloat(data.ratedPower)
}
this.form.model = data.model
},
delImg() {
this.filePic = []
const list = this.delIsObj(this.filePic)
this.filePic = list.join(',')
},
// 图片处理
afterRead(data) {
if(this.type == 1){
this.form.coolCapacity = data.coolCapacity
this.edgl = parseFloat(data.ratedPower)
}else {
this.form.ratedPower = parseFloat(data.ratedPower)
}
this.form.model = data.model
console.log(this.form);
// this.filePic.push(data.attach_id);
},
//安卓会调用的方法
onUpload1(data) {
this.exteriorImage1 = data
// const list = this.ifObj(this.exteriorImage1)
if (this.type != 3) {
this.form.exteriorImage = this.exteriorImage1
} else {
this.form1.exteriorImage = this.exteriorImage1
}
},
//安卓会调用的方法
onUpload2(data) {
this.tagImage1 = data
// const list = this.ifObj(this.tagImage1)
if (this.type != 3) {
this.form.tagImage = this.tagImage1
} else {
this.form1.tagImage = this.tagImage1
}
},
//安卓会调用的方法
onUpload3(data) {
this.markImage1 = data
// const list = this.ifObj(this.markImage1)
if (this.type != 3) {
this.form.markImage = this.markImage1
} else {
this.form1.markImage = this.markImage1
}
},
// 图片处理
afterRead1(data) {
this.exteriorImage1.push(data.attach_id);
if (this.type != 3) {
this.form.exteriorImage = this.exteriorImage1
} else {
this.form1.exteriorImage = this.exteriorImage1
}
},
delImg1() {
this.exteriorImage1 = []
const list = this.delIsObj(this.exteriorImage1)
if (this.type != 3) {
this.form.exteriorImage = list.join(',')
} else if (this.type == 3) {
this.form1.exteriorImage = list.join(',')
}
},
afterRead2(data) {
this.tagImage1.push(data.attach_id);
if (this.type != 3) {
this.form.tagImage = this.tagImage1
} else {
this.form1.tagImage = this.tagImage1
}
},
delImg2() {
this.tagImage1 = []
const list = this.delIsObj(this.tagImage1)
if (this.type != 3) {
this.form.tagImage = list.join(',')
} else if (this.type == 3) {
this.form1.tagImage = list.join(',')
}
},
afterRead3(data) {
this.markImage1.push(data.attach_id);
// const list = this.ifObj(this.markImage1)
if (this.type != 3) {
this.form.markImage = this.markImage1
} else {
this.form1.markImage = this.markImage1
}
},
delImg3() {
this.markImage1 = []
const list = this.delIsObj(this.markImage1)
if (this.type != 3) {
this.form.markImage = list.join(',')
} else if (this.type == 3) {
this.form1.markImage = list.join(',')
}
},
// 设备类型选择
select(val) {
this.form.refrigeType = val.value;
this.formColumns.refrigeTypeName = val.text;
this.showPicker = false;
},
getArrKt() {
const data = this.$route.params.item
if(data) {
for (const key in this.form) {
this.form[key] = data[key]
}
if(data.refrigeTypeName) {
this.formColumns.refrigeTypeName = data.refrigeTypeName
}
if(data.ratedPower) {
this.edgl = data.ratedPower.split(",")[0];
this.hyl = data.ratedPower.split(",")[1];
}
if(!data.exteriorImage || data.exteriorImage.length == 0) {
this.form.exteriorImage = []
} else {
this.form.exteriorImage = data.exteriorImage
if(data.exteriorImage instanceof Array) {
this.exteriorImage1 = data.exteriorImage
} else {
this.exteriorImage1 = data.exteriorImage.split(",")
}
this.picShow(this.exteriorImage1, "ktExter");
}
if(!data.markImage || data.markImage.length == 0) {
this.form.markImage = []
} else {
this.form.markImage = data.markImage
if(data.markImage instanceof Array) {
this.markImage1 = data.markImage
} else {
this.markImage1 = data.markImage.split(",")
}
this.picShow(this.markImage1, "ktMark");
}
if(!data.tagImage || data.tagImage.length == 0) {
this.form.tagImage = []
} else {
this.form.tagImage = data.tagImage
if(data.tagImage instanceof Array) {
this.tagImage1 = data.tagImage
} else {
this.tagImage1 = data.tagImage.split(",")
}
this.picShow(this.tagImage1, "KtTag");
}
} else {
for (const key in this.form) {
this.form[key] = ''
}
}
},
getArrLq() {
const data = this.$route.params.item
if(data) {
for (const key in this.form) {
this.form[key] = data[key]
}
if(data.refrigeTypeName) {
this.formColumns.refrigeTypeName = data.refrigeTypeName
}
if(data.ratedPower) {
this.edgl = data.ratedPower.split(",")[0];
this.hyl = data.ratedPower.split(",")[1];
}
if(!data.exteriorImage || data.exteriorImage.length == 0) {
this.form.exteriorImage = []
} else {
this.form.exteriorImage = data.exteriorImage
if(data.exteriorImage instanceof Array) {
this.exteriorImage1 = data.exteriorImage
} else {
this.exteriorImage1 = data.exteriorImage.split(",")
}
this.picShow(this.exteriorImage1, "LqExter");
}
if(!data.markImage || data.markImage.length == 0) {
this.form.markImage = []
} else {
this.form.markImage = data.markImage
if(data.markImage instanceof Array) {
this.markImage1 = data.markImage
} else {
this.markImage1 = data.markImage.split(",")
}
this.picShow(this.markImage1, "LqMark");
}
if(!data.tagImage || data.tagImage.length == 0) {
this.form.tagImage = []
} else {
this.form.tagImage = data.tagImage
if(data.tagImage instanceof Array) {
this.tagImage1 = data.tagImage
} else {
this.tagImage1 = data.tagImage.split(",")
}
this.picShow(this.tagImage1, "LqTag");
}
if (this.form.exteriorImage) {
if(this.form.exteriorImage instanceof Array) {
this.exteriorImage1 = this.form.exteriorImage
} else {
this.exteriorImage1 = this.form.exteriorImage.split(",")
}
this.picShow(this.exteriorImage1, "LqExter");
}
} else {
for (const key in this.form) {
this.form[key] = ''
}
}
},
getArrCn() {
const data = this.$route.params.item
const heatCnLx = JSON.parse(sessionStorage.getItem("heatCnLx"));
if(data) {
for (const key in this.form1) {
this.form1[key] = data[key]
}
if(heatCnLx && data) {
heatCnLx.forEach((v)=> {
if (data.unitType == v.code) {
this.formColumns.refrigeTypeName = v.name
}
})
}
this.formColumns.refrigeType = this.form1.unitType = data.unitType
if(data.ratedPower) {
this.edgl = data.ratedPower.split(",")[0];
this.hyl = data.ratedPower.split(",")[1];
}
if(!data.exteriorImage || data.exteriorImage.length == 0) {
this.form1.exteriorImage = []
} else {
this.form1.exteriorImage = data.exteriorImage
if(data.exteriorImage instanceof Array) {
this.exteriorImage1 = data.exteriorImage
} else {
this.exteriorImage1 = data.exteriorImage.split(",")
}
this.picShow(this.exteriorImage1, "CnExter");
}
if(!data.markImage || data.markImage.length == 0) {
this.form1.markImage = []
} else {
this.form1.markImage = data.markImage
if(data.markImage instanceof Array) {
this.markImage1 = data.markImage
} else {
this.markImage1 = data.markImage.split(",")
}
this.picShow(this.markImage1, "CnMark");
}
if(!data.tagImage || data.tagImage.length == 0) {
this.form1.tagImage = []
} else {
this.form1.tagImage = data.tagImage
if(data.tagImage instanceof Array) {
this.tagImage1 = data.tagImage
} else {
this.tagImage1 = data.tagImage.split(",")
}
this.picShow(this.tagImage1, "CnTag");
}
} else {
for (const key in this.form1) {
this.form1[key] = ''
}
}
},
//图片回显展示
picShow(formList, name) {
console.log(formList,name);
const picList = formList.map((ele) => {
if (ele.split(`${downloadUrl}`).length > 1) {
return {
url: ele,
};
}
ele = `${downloadUrl}${ele}`;
return {
url: ele,
};
});
switch (name) {
case "ktExter":
this.exteriorImage1 = picList;
break;
case "ktMark":
this.markImage1 = picList;
break;
case "KtTag":
this.tagImage1 = picList;
break;
case "LqExter":
console.log(picList, '1');
this.exteriorImage1 = picList;
console.log(this.exteriorImage1);
break;
case "LqMark":
console.log(picList, '3');
this.markImage1 = picList;
break;
case "LqTag":
console.log(picList, '2');
this.tagImage1 = picList;
// eslint-disable-next-line no-fallthrough
case "CnExter":
this.exteriorImage1 = picList;
break;
case "CnMark":
this.markImage1 = picList;
break;
case "CnTag":
this.tagImage1 = picList;
break;
default:
break;
}
},
// 集中式空调机组保存
handelClickSave() {
const item = this.$route.params.item
console.log(this.type, this.exteriorImage1.length);
if (this.type == 1) {
if(this.form.refrigeNum<1 || this.ratio){
return
}
if(this.$store.getters.cityType&&this.form.exteriorImage.length<1){
return
}
if(item) {
this.$store.getters.airConditioningUnitList.forEach((ele) => {
if(this.form.refrigeId == ele.refrigeId) {
this.form.ratedPower = this.edgl + "," + this.hyl
this.form.refrigeTypeName = this.formColumns.refrigeTypeName
for (const key in ele) {
ele[key] = this.form[key]
}
return ele
}
})
this.clearPage()
this.$router.push({
path: "/facilityManage",
query: {
id: 'focusAir',
typeId: '1'
}
})
} else {
this.form.ratedPower = this.edgl + "," + this.hyl
this.form.refrigeTypeName = this.formColumns.refrigeTypeName
this.$store.getters.airConditioningUnitList.push(this.form)
this.clearPage()
this.$router.push({
path: "/facilityManage",
query: {
id: 'focusAir',
typeId: '1'
}
})
}
} else if (this.type == 2) {
if(this.$store.getters.cityType&&this.form.exteriorImage.length<1){
return
}
if(item) {
this.$store.getters.coolingTowerUnitList.forEach((ele) => {
if(this.form.refrigeId == ele.refrigeId) {
this.form.refrigeTypeName = this.formColumns.refrigeTypeName
for (const key in ele) {
ele[key] = this.form[key]
}
return ele
}
})
this.clearPage()
this.$router.push({
path: "/facilityManage",
query: {
id: 'focusAir',
typeId: '1'
}
})
} else {
this.form.refrigeTypeName = this.formColumns.refrigeTypeName
this.$store.getters.coolingTowerUnitList.push(this.form)
this.clearPage()
this.$router.push({
path: "/facilityManage",
query: {
id: 'focusAir',
typeId: '1'
}
})
}
} else if (this.type == 3) {
if(this.$store.getters.cityType&&this.form1.exteriorImage.length<1){
return
}
if(item) {
this.$store.getters.heatingUnitList.forEach((ele) => {
if(this.form1.heatId == ele.heatId) {
for (const key in ele) {
ele[key] = this.form1[key]
}
ele.ratedPower = this.edgl + "," + this.hyl
// ele.unitType = this.form.refrigeType
ele.unitType = this.form1.unitType
ele.unitTypeName = this.formColumns.refrigeTypeName
return ele
}
})
this.heatPicArrtoStr()
this.clearPage()
this.$router.push({
path: "/facilityManage",
query: {
id: 'heating',
typeId: '2'
}
})
} else {
this.form1.ratedPower = this.edgl + "," + this.hyl
this.form1.unitType = this.formColumns.refrigeType
this.form1.unitTypeName = this.formColumns.refrigeTypeName
this.heatPicArrtoStr()
console.log(this.form1.unitType, 'this.form1.unitType');
this.$store.getters.heatingUnitList.push(this.form1)
this.clearPage()
this.$router.push({
path: "/facilityManage",
query: {
id: 'heating',
typeId: '2'
}
})
}
}
// this.clearPage();/
},
//将采暖机组图片数组转为字符串
heatPicArrtoStr() {
if (this.exteriorImage1.length > 0) {
this.form1.exteriorImage = this.exteriorImage1.map((ele) => {
if (ele.url) {
return ele = ele.url.split('download/')[1]
} else {
return ele
}
}).join(',')
}
if (this.tagImage1.length > 0) {
this.form1.tagImage = this.tagImage1.map((ele) => {
if (ele.url) {
return ele = ele.url.split('download/')[1]
} else {
return ele
}
}).join(',')
}
if (this.markImage1.length > 0) {
this.form1.markImage = this.markImage1.map((ele) => {
if (ele.url) {
return ele = ele.url.split('download/')[1]
} else {
return ele
}
}).join(',')
}
},
//清空页面
clearPage() {
this.form = {
equipId:'',
refrigeId:'',
refrigeType: "",
refrigeTypeName: "",
model: "",
refrigeNum: "",
ratedPower: "",
coolCapacity: "",
useExpl: "",
backupExpl: "",
useYear: "",
exteriorImage: "", //设备外观
tagImage: "", //设备铭牌
markImage: "", //设备能效标识
};
this.form1 = {
equipId:'',
unitType: "",
unitTypeName: "",
heatNum: "",
ratedPower: "",
heatCapacity: "",
useExpl: "",
backupExpl: "",
useYear: "",
exteriorImage: "", //设备外观
tagImage: "", //设备铭牌
markImage: "", //设备能效标识
};
this.formColumns = {
refrigeType: "",
refrigeTypeName: "",
};
this.edgl = ""; //额定功率
this.hyl = ""; //耗用量
this.exteriorImage1 = []; //设备外观
this.tagImage1 = []; //设备铭牌
this.markImage1 = []; //设备能效标识
},
},
};
</script>
<style lang="less" scoped>
.container {
height: calc(100vh - 2.7rem);
padding: 20px;
box-sizing: border-box;
overflow-y: auto;
.inputStyle {
border-radius: 8px;
overflow: auto;
background: #fff;
}
.picStyle {
padding: 10px 20px;
.title {
margin-bottom: 10px;
span {
color: red;
}
}
}
}
.bottom {
margin: 0.1rem 0.5333rem;
/deep/ .van-button {
background: #34baae;
border-radius: 10px;
}
}
/deep/ .van-cell__value {
color: #333;
}
.img-box {
padding-top: 0;
}
.box1 {
padding-top: 0.266667rem;
}
/deep/ .van-field__error-message {
text-align: right;
}
.tips {
padding: 0 16px;
display: flex;
justify-content: flex-end;
color: #ee0a24;
font-size: 12px;
}
.tipImage{
justify-content: flex-start
}
.list-upload{
/deep/.van-button {
background: #34baae;
border-radius: 0.266667rem;
}
/deep/.van-uploader{
width: 100%;
.van-uploader__input-wrapper{
width: 100%;
}
}
}
</style>
@@ -0,0 +1,220 @@
<template>
<div class="list">
<!-- <Header :title="title" @onClickLeft="onClickLeft" /> -->
<div class="container" v-if="type == 1">
<div class="listItem" v-for="(item, index) in arrKtList" @click="handleDetail(item)" :key="index">
<div class="navTile">
<div class="navLeft">
<img src="@/assets/imageNew/u600.png" alt="" />
<div class="nav-title">{{ item.refrigeTypeName }} ({{ item.useYear }})</div>
<span>x{{ item.refrigeNum }}</span>
</div>
<div class="navRight">
<span>使用</span><span>{{ item.useExpl }}</span> /
<span>备用</span><span>{{ item.backupExpl }}</span>
</div>
</div>
<van-cell :title="
'额定功率' + ' ' +
item.ratedPower[0] + ' ' +
'kW' + ' ' +
'耗用量' + ' ' +
item.ratedPower[1] + ' ' +
't' + ' ' +
'额定制冷' + ' ' +
(item.coolCapacity||'') + ' ' +
'kW'
" is-link />
</div>
</div>
<div class="container" v-if="type == 2">
<div class="listItem" v-for="(item, index) in arrLqList" @click="handleDetail(item)" :key="index">
<div class="navTile">
<div class="navLeft">
<img src="@/assets/imageNew/u600.png" alt="" />
<div class="nav-title">
{{ item.refrigeTypeName }} ({{ item.useYear }})
</div>
<span>x{{ item.refrigeNum }}</span>
</div>
<div class="navRight">
<span>使用</span><span>{{ item.useExpl }}</span> /
<span>备用</span><span>{{ item.backupExpl }}</span>
</div>
</div>
<van-cell :title="'额定功率' + ' ' + item.ratedPower + ' ' + 'kW'" is-link />
</div>
</div>
<div class="container" v-if="type == 3">
<div class="listItem" v-for="(item, index) in arrCnData" @click="handleDetail(item)" :key="index">
<div class="navTile">
<div class="navLeft">
<img src="@/assets/imageNew/u600.png" alt="" />
<div class="nav-title">
{{ item.unitTypeName }} ({{ item.useYear }})
</div>
<span>x{{ item.heatNum }}</span>
</div>
<div class="navRight">
<span>使用</span><span>{{ item.useExpl }}</span> /
<span>备用</span><span>{{ item.backupExpl }}</span>
</div>
</div>
<van-cell :title="
'额定功率' + ' ' +
item.ratedPower[0] + ' ' +
'kW' + ' ' +
'耗用量' + ' ' +
item.ratedPower[1] + ' ' +
't' + ' ' +
'额定制热' + ' ' +
item.heatCapacity + ' ' +
'kW'
" is-link />
</div>
</div>
<div class="btn-add">
<van-button @click="handelClickAdd">新增</van-button>
</div>
</div>
</template>
<script>
// import Header from "@/components/headerNew";
// import { getCustomerInfo } from "@/api/energyConsumption";
export default {
name: "burstingList",
components: {
// Header,
},
data() {
return {
title: "",
type: "",
arrKtList: [],
arrLqList: [],
arrCnList: [],
};
},
computed: {
arrCnData() {
const heatCnLx = JSON.parse(sessionStorage.getItem('heatCnLx'))
heatCnLx.forEach((v)=> {
this.arrCnList.forEach((ev)=> {
if(!ev.unitTypeName) {
if(ev.unitType == v.code ) {
ev.unitTypeName = v.name
}
} else {
ev.unitTypeName
}
})
})
return this.arrCnList
},
},
created() {
this.getArrKtList()
},
methods: {
getArrKtList() {
this.type = this.$route.params.type
if(this.type == 1) {
this.arrKtList = this.$store.getters.airConditioningUnitList
} else if(this.type == 2) {
this.arrLqList = this.$store.getters.coolingTowerUnitList
} else {
this.arrCnList = this.$store.getters.heatingUnitList
}
},
onClickLeft() {
this.$router.push("/facilityManage");
},
handelClickAdd() {
this.$router.replace({ name: "burstingDetail", params: { type: this.type } });
},
handleDetail(item) {
console.log(item);
this.$router.replace({ name: "burstingDetail", params: { item, type: this.type } });
},
},
};
</script>
<style lang="less" scoped>
.btn-add {
margin: 0.1rem 0.5333rem;
}
.van-button {
width: 100%;
background: #34baae;
color: #fff;
border-radius: 10px;
}
.container {
height: calc(100vh - 2.7rem);
padding: 20px;
overflow-y: auto;
box-sizing: border-box;
.listItem {
padding: 10px;
background: #fff;
border-radius: 8px;
margin-bottom: 10px;
.navTile {
display: flex;
align-items: center;
justify-content: space-between;
.navLeft {
display: flex;
align-items: center;
font-size: 16px;
color: #333; // font-weight: bold;
span {
// margin-left: 10px;
font-size: 14px;
margin-top: 3px;
color: #cbcbcb;
}
}
.navRight {
color: #333;
}
}
img {
width: 26px;
margin-right: 5px;
}
}
/deep/ .van-cell {
padding: 10px 0;
font-size: 15px;
}
}
.nav-title {
width: 140px;
white-space: nowrap;
text-overflow: ellipsis;
overflow: hidden;
flex: 1;
}
::v-deep .van-cell__title,
.van-cell__value {
-webkit-box-flex: 1;
-webkit-flex: 1;
flex: 1;
font-size: 14px;
color: #999;
}
</style>
@@ -0,0 +1,135 @@
<template>
<!-- :after-read="afterRead" -->
<!-- :after-read="afterRead" -->
<van-uploader
v-model="fileList"
multiple
:max-count="1"
:afterRead="afterRead"
:before-delete="delImg"
@click-upload="onUpload"
>
<div class="uploader">
<van-button icon="photo" type="primary">信息识别</van-button>
</div>
</van-uploader>
</template>
<script>
import { fileController } from '@/api/api.js'
import { uploadFile } from '@/api/api.js'
import { chooseAlbumAndTakePhoto } from '@/utils/dsbridge'
// import { downloadUrl } from '@/settings'
export default {
props: {
type: {
type: String,
default: '',
},
value: {
type: Array,
default: () => [],
},
},
data() {
return {
fileList: this.value,
activTimer: null,
}
},
mounted() {
this.activTimer = setTimeout(() => {
this.fileList = this.value
}, 200)
},
beforeDestroy() {
clearTimeout(this.activTimer)
this.fileList = []
},
methods: {
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
},
// 上传图片调用原生的方法 获取到绝对路径调用getImageFileFromUrl
onUpload () {
chooseAlbumAndTakePhoto(async (data) => {
console.log(data, 'chooseAlbumAndTakePhoto');
let d = 'data:image/jpeg;base64,' + data
this.fileIamge = d
let params = this.base64ToFile(d,new Date().getTime().toString())
console.log(params);
const res = await fileController(params)
// if (res.code == 0) {
this.$emit('onUpload', res.resultMap)
// }
})
},
async afterRead(file) {
let params = new FormData()
params.append('file', file.file)
console.log(file.file);
console.log(params);
// console.log(decryptParseToJSON(a),77777777);
// const res = await uploadFile(params)
const res = await fileController(params)
// if (res.code == 0) {
this.$emit('afterRead', res.resultMap)
// }
return true
},
delImg(file, detail) {
this.fileList.splice(detail.index, 1)
this.$emit('delImg', file, detail, this.type)
},
},
}
</script>
<style lang='less' scoped>
/deep/ .van-uploader__preview-image {
padding: 10px;
box-sizing: border-box;
background: #fff;
box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
border-radius: 10px;
margin-left: 20px;
margin-top: 10px;
}
/deep/ .van-uploader__preview-delete {
margin-top: 10px;
}
.uploader {
// width: 2.133333rem;
// height: 2.133333rem;
background: #f7f7f7;
border-radius: 5px;
// display: flex;
// justify-content: center;
// align-items: center;
margin: 10px 0 10px 20px;
// text-align: right;
.uploader-icon {
font-size: 30px;
color: #ababab;
}
}
</style>
@@ -0,0 +1,39 @@
/deep/ .van-popup--bottom {
min-height: 8rem;
}
.content {
height: 100%;
display: flex;
flex-direction: column;
.content-head {
display: flex;
justify-content: space-between;
font-size: 0.4rem;
padding: 0.2rem 0.426667rem;
box-sizing: border-box;
> div {
border: none;
cursor: pointer;
}
> div:nth-child(1) {
color: #969799;
}
> div:nth-child(2) {
color: #34baae;
}
}
.content-main {
flex: 1;
margin-top: 0.5vh;
/deep/ .van-checkbox {
width: 100%;
display: flex;
flex-direction: row-reverse;
align-items: center;
justify-content: space-between;
}
/deep/ .van-checkbox__label {
margin-left: 0;
}
}
}
@@ -0,0 +1,29 @@
.search-main {
background: #fff;
margin-top: 30px;
padding: 0 17px;
box-sizing: border-box;
box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
border-radius: 5px;
.title {
height: 60px;
color: #10968b;
display: flex;
align-items: center;
border-bottom: 1px solid #eee;
.line {
width: 5px;
height: 18px;
background: linear-gradient(to bottom, #2da197, #2c827c);
margin-right: 10px;
border-radius: 5px;
}
}
.wt {
margin-top: 10px;
padding-bottom: 15px;
border-bottom: 1px solid #eee;
box-sizing: border-box;
}
}
@@ -0,0 +1,277 @@
<template>
<!--
公共改造方法参数需要
columns 需要展示的对象
form 需要给后端传的对象
-->
<div>
<van-field v-if="value" required :rules="[{ required: required, message: '请选择至少一条改造方式' }]" v-bind:value="value1" label="改造方式" input-align="right" is-link placeholder="请选择" @click-input="onPopup" readonly />
<van-field v-else required :rules="[{ required: required, message: '请选择至少一条改造方式' }]" v-model="columns.modifyModeName" label="改造方式" input-align="right" is-link placeholder="请选择" @click-input="onPopup" readonly />
<VanPickerNew :loading="loading" :show="showCheckboxShow" :columns="checkboxList" :isCloseable="true" @onConfirm="onConfirmCheckbox" @onCancel="onCancelCheckbox">
<!-- 为了添加loading 如果有更好的办法这个可以替换掉 -->
<van-picker v-if="loading" :loading="loading" />
<div v-else class="content">
<div class="content-head">
<div @click="onCancelCheckbox">取消</div>
<div @click="onConfirmCheckbox" class="sure">确认</div>
</div>
<div class="content-main" v-if="type1 == 'cen'">
<van-cell v-for="(item, index) in list" :key="index" clickable :title="item.dict_label" style="font-weight: 400 !important; font-size: 15px !important">
<van-checkbox v-model="item.checked" checked-color="#009999" :name="item.dict_label" ref="checkboxes" @click="clickCheckbox(item)">
{{ item.name }}
</van-checkbox>
</van-cell>
</div>
<div class="content-main" v-if="type1 == 'con'">
<van-cell v-for="(item, index) in list" clickable :key="index" :title="item.dict_label" style="font-weight: 400 !important; font-size: 15px !important">
<van-checkbox v-model="item.checked" checked-color="#009999" :name="item.dict_label" ref="checkboxes" @click="clickCheckbox(item)">
{{ item.name }}
</van-checkbox>
</van-cell>
</div>
<div class="content-main" v-if="type1 == 'heat'">
<van-cell v-for="(item, index) in list" clickable :key="index" :title="item.dict_label" style="font-weight: 400 !important; font-size: 15px !important">
<van-checkbox v-model="item.checked" checked-color="#009999" :name="item.dict_label" ref="checkboxes" @click="clickCheckbox(item)">
{{ item.name }}
</van-checkbox>
</van-cell>
</div>
<div class="content-main" v-else>
<van-cell v-for="item in checkboxList" :key="item.code" 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.name }}
</van-checkbox>
</van-cell>
</div>
</div>
</VanPickerNew>
</div>
</template>
<script>
import VanPickerNew from '@/components/vanPickerNew'
import { getCodeCommon } from '../common.js'
export default {
components: {
VanPickerNew,
},
props: {
required:{
type: Boolean,
default: false
},
value: {
type: String,
default: '',
},
name: {
type: String,
default: '',
},
columns: {
type: Object,
default: () => {},
},
form: {
type: Object,
default: () => {},
},
feild: {
type: String,
default: ''
},
type: {
type: Object,
default: () => {
return {
id: 80000001017,
type: 'cnfs',
}
},
},
type1: {
type: String,
default: '',
},
list1: {
type: Array,
default: () => [],
},
list2: {
type: Array,
default: () => [],
},
list: {
type: Array,
default: () => [],
},
},
data() {
return {
//特殊值 -- 复选框
checkboxList: [],
value1: this.value,
//复选框选中值
result: [],
spliceList: [],
showCheckboxShow: false,
loading: false,
modifyList: [],
//选中的值
checkYesList: [],
}
},
watch: {
list1: {
handler(val){
this.getChcekboxList(val)
},
deep: true,
}
},
beforeUpdate() {
if(this.form[this.feild] == 2) {
this.result = []
}
},
mounted() {
this.getChcekboxList()
},
methods: {
//点击复选框的弹框
onPopup() {
if (this.type1 == 'cen' || this.type1 == 'con' || this.type1 == 'heat') {
this.result = this.list1
}
this.showCheckboxShow = true
},
//获取数据
async getChcekboxList(val) {
if (this.type1) {
return
}
this.loading = true
const data = this.type
try {
const res = await getCodeCommon(data)
res.forEach((v) => {
v.checked = false
})
this.checkboxList = res
const list = JSON.parse(JSON.stringify(this.checkboxList))
console.log(val);
if(val && val.length > 0) {
list.forEach((v) => {
v.checked = false
val.forEach((ev) => {
if (ev == v.value) {
v.checked = true
this.result.push(v)
}
})
})
const modifyList = this.result
this.modifyList = modifyList
if(this.type.type == 'zmgzfs') {
sessionStorage.setItem('zmModifyName', JSON.stringify(modifyList))
}
if(this.type.type == 'pdgzfs') {
sessionStorage.setItem('pdModifyName', JSON.stringify(modifyList))
}
if(this.type.type == 'rsgzfs') {
sessionStorage.setItem('rsModifyName', JSON.stringify(modifyList))
}
this.value1 = this.result.map((ele) => ele.name).join(',')
this.checkboxList = list
this.onConfirmCheckbox()
}
} finally {
this.loading = false
}
},
clickCheckbox(item) {
if (item.checked) {
this.result.push(item)
} else {
const i = this.result.findIndex((ele) => ele.code == item.code)
this.result.splice(i, 1)
}
},
//点击取消复选框
onCancelCheckbox() {
this.showCheckboxShow = false
},
//确认复选框展示和id
onConfirmCheckbox() {
const name = this.result.map((ele) => {
return ele.name
})
const id = this.result.map((ele) => {
return ele.code
})
const data = {
name,
id,
result: this.result,
delList: this.checkboxList
}
this.$emit('onConfirmCheckbox', data)
this.showCheckboxShow = false
},
},
}
</script>
<style lang='less' scoped>
@import '../common-vue/checkbox.less';
/deep/ .van-field__error-message {
text-align: right;
}
</style>
@@ -0,0 +1,75 @@
<template>
<div class="btn">
<div class="btn-click" @click="handelClickOk(item)">
<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 class="btn-click" @click="handelClickNo(item, index)">
<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>
</template>
<script>
export default {
props: {
item: {
type: Object,
default: () => {},
},
index: {
type: Number,
default: () => {},
},
},
methods: {
handelClickOk(ele) {
this.$emit('handelClickOk', ele)
},
handelClickNo(ele, i) {
this.$emit('handelClickNo', ele, i)
},
},
}
</script>
<style lang='less' scoped>
.btn {
margin-top: 10px;
display: flex;
justify-content: flex-end;
.btn-click {
display: flex;
font-size: 15px;
align-items: center;
}
.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;
}
}
</style>
@@ -0,0 +1,133 @@
<template>
<!-- :after-read="afterRead" -->
<!-- :after-read="afterRead" -->
<van-uploader
v-model="fileList"
multiple
:max-count="1"
:afterRead="afterRead"
:before-delete="delImg"
@click-upload="onUpload"
>
<div class="uploader">
<van-icon name="plus" class="uploader-icon" />
</div>
</van-uploader>
</template>
<script>
import { uploadFile } from '@/api/api.js'
import { chooseAlbumAndTakePhoto } from '@/utils/dsbridge'
import { downloadUrl } from '@/settings'
export default {
props: {
type: {
type: String,
default: '',
},
value: {
type: Array,
default: () => [],
},
},
data() {
return {
fileList: this.value,
activTimer: null,
}
},
mounted() {
this.activTimer = setTimeout(() => {
this.fileList = this.value
}, 200)
},
beforeDestroy() {
clearTimeout(this.activTimer)
this.fileList = []
},
methods: {
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
},
// 上传图片调用原生的方法 获取到绝对路径调用getImageFileFromUrl
onUpload () {
chooseAlbumAndTakePhoto(async (data) => {
let d = 'data:image/jpeg;base64,' + data
this.fileIamge = d
let params = this.base64ToFile(d,new Date().getTime().toString())
const res = await uploadFile(params)
if (res.code == 0) {
this.fileList.push({
url:`${downloadUrl}${res.data.attach_id}`
})
this.$emit('onUpload', this.fileList, this.type)
}
})
},
async afterRead(file) {
let params = new FormData()
params.append('file', file.file)
console.log(file.file);
console.log(params);
// console.log(decryptParseToJSON(a),77777777);
const res = await uploadFile(params)
if (res.code == 0) {
this.$emit('afterRead', res.data, this.type)
}
return true
},
delImg(file, detail) {
this.fileList.splice(detail.index, 1)
this.$emit('delImg', file, detail, this.type)
},
},
}
</script>
<style lang='less' scoped>
/deep/ .van-uploader__preview-image {
padding: 10px;
box-sizing: border-box;
background: #fff;
box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
border-radius: 10px;
margin-left: 20px;
margin-top: 10px;
}
/deep/ .van-uploader__preview-delete {
margin-top: 10px;
}
.uploader {
width: 2.133333rem;
height: 2.133333rem;
background: #f7f7f7;
border-radius: 5px;
display: flex;
justify-content: center;
align-items: center;
margin: 10px 0 10px 20px;
.uploader-icon {
font-size: 30px;
color: #ababab;
}
}
</style>
@@ -0,0 +1,81 @@
<template>
<div>
<van-field v-bind:value="value" :label="title" :required="required" :rules="rules" label-width="190" input-align="right" is-link placeholder="请选择" @click-input="onPopup" readonly />
<VanPickerNew :show="show" :columns="columns" @onConfirm="onConfirm" @onCancel="onCancel" />
</div>
</template>
<script>
import VanPickerNew from '@/components/vanPickerNew'
export default {
components: {
VanPickerNew,
},
props: {
title: {
type: String,
default: '是否进行过设备改造',
},
feildName: {
type: String,
default: '',
},
value: {
type: String,
default: '',
},
rules: {
type: Array,
default: ()=>[]
},
required: {
type: Boolean,
default: false
},
special: {
type: String,
default: ''
}
},
data() {
return {
value1: this.value,
form: {},
show: false,
columns: [
{ text: '是', value: '1' },
{ text: '否', value: '2' },
],
}
},
mounted() {},
methods: {
onConfirm(obj) {
this.value1 = obj.text
const data = {
info: obj,
field: this.feildName,
special: this.special
}
this.$store.commit('search/SET_EQUIPMODIY', data)
this.$emit('onConfirmTrueFalse', data)
this.show = false
},
onCancel() {
this.show = false
},
onPopup() {
this.show = true
},
},
}
</script>
<style lang='less' scoped>
/deep/ .van-picker__confirm{
color: #34baae;
}
/deep/ .van-picker-column__item--selected {
color: #34baae;
}
</style>
@@ -0,0 +1,91 @@
<template>
<van-popup v-model="show" :position="position" :style="{ height: '50%' }" :close-on-click-overlay="false" @open="open">
<van-picker
:title="title"
show-toolbar
:default-index="middleIndex"
:columns="columns"
@confirm="onConfirmYear"
@cancel="onCancelYear"
/>
</van-popup>
</template>
<script>
export default {
props: {
show: {
type: Boolean,
default: false,
},
num: {
type: Number,
default: 10,
},
position: {
type: String,
default: 'bottom'
},
title:{
type:String,
default:'选择年'
},
startYear: {
type: Number,
default: 1900,
},
},
data() {
return {
currentDate: new Date(),
columns: [],
middleIndex: 0,
}
},
created() {
this.activated = this.$route.query.id
this.tidCid = JSON.parse(sessionStorage.getItem('tidCid'))
},
computed: {
showForm() {
if(this.tidCid.taskId) {
return false
}
return true
},
},
methods: {
//打开年份弹框时获取到当前年份的前后num年
open() {
let _time = ''
let date = new Date(this.currentDate).getFullYear()
let currentDate = date
const num = currentDate - this.startYear
for (let i = 0; i <= num; i++) {
_time = currentDate--
this.columns.unshift(_time)
}
this.columns = [...new Set(this.columns)]
this.middleIndex = this.columns.findIndex((ele) => ele == date)
},
onConfirmYear(value) {
this.$emit('onConfirmYear', { value, name: this.name })
},
onCancelYear() {
this.$emit('onCancelYear')
},
},
}
</script>
<style lang='less' scoped>
/deep/ .van-picker__confirm{
color: #34babe;
}
/deep/ .van-picker-column__item--selected{
color: #34babe;
}
</style>
+46
View File
@@ -0,0 +1,46 @@
//公共方法 查询系统码表
import { getCode } from '@/api/common.js'
async function getCodeCommon(data) {
const info = {
codeSortId: data.id,
codeType: data.type
}
const res = await getCode(info)
res.data.forEach((v) => {
v.text = v.name
})
return res.data
}
//组成我想要的数据格式
function dataMode(list) {
const mapList = [...new Set(list.map((ele) => ele.enquireType))]
let selfList = []
mapList.forEach((ele) => {
selfList.push({
type: ele,
child: []
})
});
list.forEach((v) => {
selfList.forEach((ele) => {
if (ele.type == v.enquireType) {
v.color = true
v.noId = 0
ele.child.push(v)
}
});
});
console.log(selfList,22223);
return selfList
}
export {
getCodeCommon,
dataMode
}
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,90 @@
<template>
<div class="fissionAir">
<div class="fissionItem">
<van-cell-group>
<van-field v-model="form.refrigeNum" v-input.numNo0 label="空调数量" type="number" required :rules="[{ required: true, message: '请填写空调数量' }]" input-align="right" placeholder="请输入" />
</van-cell-group>
</div>
<!-- <div class="bottom"><van-button type="primary" block>保存</van-button></div> -->
</div>
</template>
<script>
import { pureDigital } from '../pattern'
export default {
data() {
return {
typeId: this.$route.query.typeId,
form: {
refrigeType:9,
refrigeNum: '',
},
eqid: '',
}
},
created() {
this.$store.commit('pageData/GET_FIS', this.typeId)
this.editData()
},
beforeDestroy() {
this.setVuexData()
},
computed: {
pureDigital() {
return pureDigital
},
},
methods: {
//第二次进入页面查询vuex页面是否存储
getVuexData() {
for (const key in this.$store.getters.fisData) {
for (const keys in this.$data) {
if (key == keys) {
this.$data[keys] = this.$store.getters.fisData[key]
}
}
}
},
//修改覆写数据
editData() {
const data = this.$store.getters.editData
if (data.pageKey) {
this.eqid = data.info.equipId
if (data.info.nxzdRefrigeSystemDTO) {
const kt = data.info.nxzdRefrigeSystemDTO.find(
(v) => v.refrigeType == 9
)
if(kt) {
this.form.refrigeNum = kt.refrigeNum
}
}
}
},
setVuexData() {
this.$store.commit('pageData/CURRENT_FIS_DATA', this.$data)
},
},
}
</script>
<style lang="less" scoped>
.fissionItem {
border-radius: 8px;
min-height: calc(100vh - 300px);
overflow: auto;
padding: 0 20px;
box-sizing: border-box;
}
.bottom {
margin-top: 20px;
border-radius: 10px;
overflow: auto;
}
/deep/ .van-field__error-message {
text-align: right;
}
</style>
@@ -0,0 +1,578 @@
<template>
<div class="focusAir">
<div class="focusItem">
<van-cell-group>
<van-field v-model="formColumns.cenkt" required :rules="[{ required: true, message:'请选择并填写集中式空调机组' }]" label="集中式空调机组" label-width="120" input-align="right" is-link placeholder="" @click-input="handleClickInput(1)" readonly />
<van-field v-model="formColumns.lqt" label="输送泵组冷却塔" label-width="120" input-align="right" is-link placeholder="" @click-input="handleClickInput(2)" readonly />
<!-- 是否进行过设备改造 -->
<Whether required :rules="[{ required: true, message:'请选择设备改造' }]" :value="formColumns.cenEquipModiyName" @onConfirmTrueFalse="onConfirmTrueFalse" feildName="cenEquipModiy" special="1" />
<!-- 改造方式 -->
<ModifyMode
v-show="form.cenEquipModiy == 1"
:columns="formColumns"
:list="cenList"
:form="form"
:type="null"
type1="cen"
:required="form.cenEquipModiy == 1"
:list1="resultList"
:list2="spliceList"
@onConfirmCheckbox="onConfirmCheckbox"
/>
<div v-for="item in resultList" :key="item.code">
<van-field
v-if="item.checked"
v-model="form[item.field]"
:label="item.name"
required
:rules="[{ required: item.checked, message: '请选择年份' }]"
label-width="220"
input-align="right"
is-link
placeholder="请选择"
readonly
@click="handelClickYear(`${item.field}`, 'SET_CEN_YEAR')"
/>
</div>
</van-cell-group>
</div>
<div :class="formColumns.cenkt ? 'search-main' : ''" v-for="item in searchList" :key="item.type">
<!-- -->
<div class="focusItem" v-if="formColumns.cenkt">
<div class="title" v-if="item.type == '1'">
<!-- <van-icon name="chat-o" /> -->
<div class="line"></div>
运营类节能诊断问询
</div>
<div class="title" v-if="item.type == '2'">
<div class="line"></div>
设备类节能诊断问询
</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" />
</div>
</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 Radio from '../common-vue/radio.vue'
import { dataMode } from '../common'
import { mapState } from 'vuex'
export default {
components: {
Year,
ModifyMode,
Whether,
Radio,
VanPickerNew,
},
mixins: [mixin],
props: {
ktLqt: {
type: Object,
default: () => {},
},
parentPath: {
type: String,
default: ''
}
},
data() {
return {
show: false,
typeId: this.$route.query.typeId,
//页面名称
pageName: {
name: '集中式空调',
title: 'focusAir',
},
kt: [],
lq: [],
formColumns: {
cenkt: '', //集中式空调机组
lqt: '', //输送泵组冷却塔
cenEquipModiyName: '',
modifyModeName:'',//改造方式名称
},
eqid: '',
form: {
modifyMode: '', //改造方式
cenEquipModiy: '', //是否进行过设备改造
cenWaterModifyYear:'',
cenIntellectModifyYear:'',
cenModifyYear:'',
},
/**
* 询问
*/
useSearch: {
cenEnquireDevIds: '', //设备类
cenEnquireIds: '', //运营类
},
searchList: [],
cenEnquireDevIdsList: [], //设备类
cenEnquireIdsList: [], //运营类
/**
* 复选框
*/
resultList: [],
spliceList: [],
cenList: [{
code: 1,
name: '水泵增加智能变频控制,改造年份',
checked: false,
field: 'cenWaterModifyYear',
},
{
code: 2,
name: '增加主机智能化集中控制系统,改造年份',
field: 'cenIntellectModifyYear',
checked: false,
},
{
code: 3,
name: '更换高能效设备,改造年份',
checked: false,
field: 'cenModifyYear',
},
],
//删除定时器
actSetTimer: null,
mouSetTimer: null,
creSetTimer: null,
ktlqTimer: null,
searchInfo: {},
fromPath:'', //上一个页面的路径
required: false,
}
},
computed: {
...mapState('saveList', ['airConditioningUnitList','coolingTowerUnitList']),
facilty() {
return this.$store.getters.fac
},
//如果选择为否,携带属性需要删除
notData() {
return {
cenEquipModiy: {
formColumnsField: ['modifyModeName'],
formField: ['modifyMode', 'cenWaterModifyYear', 'cenIntellectModifyYear', 'cenModifyYear'],
isShow: [],
setStore: 'SET_CEN_YEAR',
list: this.cenList,
}
}
}
},
mounted() {
// this.editData()
const path = sessionStorage.getItem('facilityManageParPath')
this.$store.commit('pageData/GET_FOC', this.$route.query.typeId)
if(path == '/TaskFilling' || path == '/Taskfilling' || path == '/useenergyadd') {
console.log('path ');
this.editData()
} else {
console.log('else ',this.$data);
for (const key in this.$data) {
this.$data[key] = this.$store.getters.cenData[key]
}
const kt = this.$store.getters.airConditioningUnitList
const lq = this.$store.getters.coolingTowerUnitList
if( kt.length > 0 ) {
this.formColumns.cenkt = kt.map((ele) => ele.refrigeTypeName).join(',')
}
if( lq.length > 0) {
this.formColumns.lqt = lq.map((ele) => ele.refrigeTypeName).join(',')
}
for (const key in this.form) {
this.form[key] = this.$store.getters[key]
}
console.log(this.useSearch, 'this.form');
}
},
beforeDestroy() {
this.setVuexData()
console.log('beforeDestroy ');
clearTimeout(this.mouSetTimer)
clearTimeout(this.actSetTimer)
clearTimeout(this.ktlqTimer)
},
methods: {
//修改覆写数据
editData() {
console.log('xiugai ');
this.mouSetTimer = setTimeout(() => {
const data = this.$store.getters.editData
const searchInfo = this.$store.getters.searchInfo
console.log(data.pageKey, 'data.pageKey');
if (searchInfo) {
const res = dataMode(searchInfo['sbktjz'])
this.searchList = res
//运营类
if(data.info.cenEnquireIds == '') {
const list1 = res.find((ele)=> ele.type == 1)
const dataList1 = list1.child.map((item)=> item.enquireId)
this.useSearch.cenEnquireIds = dataList1.join(',')
this.cenEnquireIdsList = dataList1
}
//设备类
if(data.info.cenEnquireDevIds == '') {
const list1 = res.find((ele)=> ele.type == 2)
const dataList1 = list1.child.map((item)=> item.enquireId)
this.useSearch.cenEnquireDevIds = dataList1.join(',')
this.cenEnquireDevIdsList = dataList1
}
this.$store.commit('search/SET_CENDATA', this.useSearch)
}
if (data.pageKey) {
this.form.cenEquipModiy = data.info.cenEquipModiy
this.formColumns.cenEquipModiyName = data.info.cenEquipModiy == 1 ? '是' : '否'
this.eqid = data.info.equipId
this.ktlqTimer = setTimeout(()=>{
const kt = this.$store.getters.airConditioningUnitList
const lq = this.$store.getters.coolingTowerUnitList
this.kt = kt
this.lq = lq
if(kt.length > 0 ) {
this.formColumns.cenkt = kt.map((ele) => ele.refrigeTypeName).join(',')
}
if(lq.length > 0) {
this.formColumns.lqt = lq.map((ele) => ele.refrigeTypeName).join(',')
}
},500)
this.spliceList = []
this.resultList = []
if (data.info.cenWaterModifyYear) {
this.form.cenWaterModifyYear = data.info.cenWaterModifyYear
this.resultList.push({
code: 1,
name: '水泵增加智能变频控制,改造年份',
field: 'cenWaterModifyYear',
checked: true,
})
}
if (data.info.cenIntellectModifyYear) {
this.form.cenIntellectModifyYear = data.info.cenIntellectModifyYear
this.resultList.push({
code: 2,
name: '增加主机智能化集中控制系统,改造年份',
field: 'cenIntellectModifyYear',
checked: true,
})
}
if (data.info.cenModifyYear) {
this.form.cenModifyYear = data.info.cenModifyYear
this.resultList.push({
code: 3,
name: '更换高能效设备,改造年份',
checked: true,
field: 'cenModifyYear',
})
}
if (!data.info.cenWaterModifyYear) {
this.form.cenWaterModifyYear = ''
this.spliceList.push({
code: 1,
name: '水泵增加智能变频控制,改造年份',
checked: false,
field: 'cenWaterModifyYear',
})
}
if (!data.info.cenIntellectModifyYear) {
this.form.cenIntellectModifyYear = ''
this.spliceList.push({
code: 2,
name: '增加主机智能化集中控制系统,改造年份',
field: 'cenIntellectModifyYear',
checked: false,
})
}
if (!data.info.cenModifyYear) {
this.form.cenModifyYear = ''
this.spliceList.push({
code: 3,
name: '更换高能效设备,改造年份',
checked: false,
field: 'cenModifyYear',
})
}
// this.cenList = this.resultList;
this.cenList.forEach((v) => {
v.checked = false
this.resultList.forEach((ev) => {
if (v.code == ev.code) {
v.checked = true
}
})
})
this.cenList.forEach((v) => {
v.checked = true
this.spliceList.forEach((ev) => {
if (v.code == ev.code) {
v.checked = false
}
})
})
const name = this.resultList.map((ele) => ele.name)
const id = this.resultList.map((ele) => ele.code)
const checkboxInfo = {
name,
id,
result: this.resultList,
}
this.onConfirmCheckbox(checkboxInfo)
/**
* 询问回显
*/
//设备类
if (data.info.cenEnquireDevIds && this.searchList.length > 0) {
const devList = data.info.cenEnquireDevIds.split(',')
this.useSearch.cenEnquireDevIds = data.info.cenEnquireDevIds
this.cenEnquireDevIdsList = devList
this.searchList[1].child.forEach((ele) => {
ele.color = false
devList.forEach((item) => {
if (item == ele.enquireId) {
ele.color = true
}
})
})
}
//运营类
if (data.info.cenEnquireIds && this.searchList.length > 0) {
const devList = data.info.cenEnquireIds.split(',')
this.useSearch.cenEnquireIds = data.info.cenEnquireIds
this.cenEnquireIdsList = 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_CENDATA', this.useSearch)
return
// eslint-disable-next-line no-empty
} else {}
}, 200)
},
setVuexData() {
this.$store.commit('pageData/CURRENT_CEN_DATA', this.$data)
this.clearForm()
},
clearForm() {
for (const key in this.form) {
this.form[key] = ''
}
},
//询问选择为是
handelClickOk(ele, i) {
if(this.showForm) {
return
}
if (ele.enquireType == '2' && !ele.color) {
// const index = this.cenEnquireDevIdsList.findIndex((v) => {
// return v == 0
// })
this.cenEnquireDevIdsList.splice(i-1, 1, ele.enquireId)
ele.color = true
}
if (ele.enquireType == '1' && !ele.color) {
// const index = this.cenEnquireIdsList.findIndex((v) => {
// return v == 0
// })
this.cenEnquireIdsList.splice(i-1, 1, ele.enquireId)
ele.color = true
}
this.useSearch.cenEnquireDevIds = this.cenEnquireDevIdsList.join(',')
this.useSearch.cenEnquireIds = this.cenEnquireIdsList.join(',')
this.$store.commit('search/SET_CENDATA', this.useSearch)
},
//询问选择为否
handelClickNo(ele, list) {
if(this.showForm) {
return
}
if (ele.enquireType == '2' && ele.color) {
const index = this.cenEnquireDevIdsList.findIndex((v) => v == ele.enquireId)
if(index == -1) {
this.cenEnquireDevIdsList = list.map((item)=> {
if(ele.enquireId == item.enquireId) {
return item.noId
}
return item.enquireId
})
this.useSearch.cenEnquireDevIds = this.cenEnquireDevIdsList.join(',')
const elseItem = this.searchList.find((ele)=> ele.type == '1')
this.useSearch.cenEnquireIds = elseItem.child.map((ele)=> {
if(ele.color) {
return ele.enquireId
} else {
return ele.noId
}
}).join(',')
ele.color = false
} else {
this.cenEnquireDevIdsList.splice(index, 1, ele.noId)
this.useSearch.cenEnquireDevIds = this.cenEnquireDevIdsList.join(',')
const elseItem = this.searchList.find((ele)=> ele.type == '1')
this.useSearch.cenEnquireIds = 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.cenEnquireIdsList.findIndex((v) => v == ele.enquireId)
if(index == -1) {
this.cenEnquireIdsList = list.map((item)=> {
if(ele.enquireId == item.enquireId) {
return item.noId
}
return item.enquireId
})
this.useSearch.cenEnquireIds = this.cenEnquireIdsList.join(',')
const elseItem = this.searchList.find((ele)=> ele.type == '2')
this.useSearch.cenEnquireDevIds = elseItem.child.map((ele)=> {
if(ele.color) {
return ele.enquireId
} else {
return ele.noId
}
}).join(',')
ele.color = false
} else {
this.cenEnquireIdsList.splice(index, 1, ele.noId)
this.useSearch.cenEnquireIds = this.cenEnquireIdsList.join(',')
const elseItem = this.searchList.find((ele)=> ele.type == '2')
this.useSearch.cenEnquireDevIds = elseItem.child.map((ele)=> {
if(ele.color) {
return ele.enquireId
} else {
return ele.noId
}
}).join(',')
ele.color = false
}
}
this.$store.commit('search/SET_CENDATA', this.useSearch)
},
//点击改造方式确认
onConfirmCheckbox(data) {
this.formColumns.modifyModeName = ''
this.form.modifyMode = ''
this.cenList.forEach((v)=> {
if(!v.checked) {
this.form[v.field] = ''
}else{
this.formColumns.modifyModeName += v.name
this.form.modifyMode += v.code
}
})
this.$store.commit('search/SET_CEN_YEAR', this.form)
},
handleClickInput(val) {
if (val == 1) {
this.$router.replace({
name: 'burstingList',
params: {
title: '集中式空调机组',
type: 1,
},
})
const data = {
title: '集中式空调机组',
type: 1,
}
sessionStorage.setItem('routerData', JSON.stringify(data))
} else if (val == 2) {
this.$router.replace({
name: 'burstingList',
params: {
title: '输送泵组冷却塔',
type: 2,
},
})
const data = {
title: '输送泵组冷却塔',
type: 2,
}
sessionStorage.setItem('routerData', JSON.stringify(data))
}
},
},
}
</script>
<style lang="less" scoped>
@import '../common-vue/common.less';
.focusAir {
.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;
}
</style>
@@ -0,0 +1,857 @@
<template>
<van-form ref="heat" :disabled="showForm">
<div class="focusAir">
<div class="focusItem">
<van-cell-group>
<van-field v-model="formColumns.heatModeName" required :rules="[{ required: true }]" label="采暖方式" input-align="right" is-link placeholder="请选择" readonly @click="handelHeatModeShow = !showForm" />
<van-field v-model="formColumns.heatTypeName" required :rules="[{ required: true }]" label="采暖设备类型" input-align="right" is-link placeholder="请选择" readonly @click="heatTypeShow = !showForm" />
<van-field v-model="formColumns.heatTypeListName" :rules="[{ required: false, message:'请选择并填写采暖机组' }]" label="采暖机组" input-align="right" is-link placeholder="" @click-input="handleClickInput(3)" readonly />
<van-field v-model="form.pumpNum" v-input.numNo0 required :rules="[{ required: true}]" label="输送泵组采暖泵台数" type="number" label-width="140" input-align="right" placeholder="请输入" @input="handelInput('pumpNum', form.pumpNum)" />
<van-field v-model="form.pumpTotalPower" v-input.floatNo0 required :rules="[{ required: true}]" label="输送泵组总功率(kW)" type="number" label-width="140" input-align="right" placeholder="请输入" @input="handelInput('pumpTotalPower', form.pumpTotalPower)" />
<van-field v-model="form.pumpYear" required :rules="[{ required: true}]" label="输送泵组设备年份" label-width="140" input-align="right" placeholder="请选择" is-link readonly @click="handelClickYear('pumpYear', 'SET_HEAT_YEAR')" />
<!-- 是否进行过设备改造 -->
<Whether required :rules="[{ required: true }]" :value="formColumns.heatEquipModiyName" @onConfirmTrueFalse="onConfirmTrueFalse" feildName="heatEquipModiy" special="1" />
<!-- 改造方式 -->
<ModifyMode
v-show="form.heatEquipModiy == 1"
:columns="formColumns"
:form="form"
:list="hetList"
:type="null"
type1="heat"
:required="form.heatEquipModiy == 1"
:list1="resultList"
:list2="spliceList"
@onConfirmCheckbox="onConfirmCheckbox"
/>
<van-field v-show="heatYear1" v-model="form.heatIntellectModifyYear" label="增加主机智能化集中控制系统年份" required :rules="[{ required: heatYear1, message:'请选择年份' }]" label-width="220" input-align="right" is-link placeholder="请选择" readonly @click="handelClickYear('heatIntellectModifyYear', 'SET_HEAT_YEAR')" />
<van-field v-show="heatYear2" v-model="form.heatModifyYear" label="更换高能效设备年份" required :rules="[{ required: heatYear2, message:'请选择年份' }]" label-width="140" input-align="right" is-link placeholder="请选择" readonly @click="handelClickYear('heatModifyYear', 'SET_HEAT_YEAR')" />
</van-cell-group>
</div>
<div :class="form.heatMode ? 'search-main' : ''" v-for="item in searchList" :key="item.type">
<div class="focusItem" v-if="form.heatMode">
<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="handelHeatModeShow">
<div class="content">
<div class="content-head">
<div @click="onCancelHe">取消</div>
<div @click="onConfirmHe">确认</div>
</div>
<div class="content-main">
<van-cell v-for="(item, index) in heatList" clickable :key="index" :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="heatTypeShow">
<div class="content">
<div class="content-head">
<div @click="onCancelHet">取消</div>
<div @click="onConfirmHet">确认</div>
</div>
<div class="content-main">
<van-cell v-for="item in heatTypeList" clickable :key="item.value" :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>
</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 } from '../common'
import Radio from '../common-vue/radio.vue'
import { pureDigital } from '../pattern'
import { getCodeCommon } from '@/views/facilityManage/common'
export default {
components: {
Radio,
Year,
ModifyMode,
Whether,
VanPickerNew,
},
mixins: [mixin],
data() {
return {
typeId: this.$route.query.typeId,
tidCid: null,
//页面名称
page: {
name: '采暖系统',
title: 'heating',
},
eqid: '',
/**
* 采暖方式
*/
handelHeatModeShow: false,
resultCheckboxHeat: [],
resultSpliceHeat: [],
heatList: [],
/**
* 采暖设备
*/
heatTypeShow: false,
resultCheckboxHeatType: [],
resultSpliceHeatType: [],
heatTypeList: [],
form: {
heatMode: '', //采暖方式
heatType: '', //采暖设备类型
pumpNum: '', // 输送机组采暖泵台数
pumpTotalPower: '', // 输送机组总功率(kW)
pumpYear: '', //输送机组设备年份
heatEquipModiy: '', //是否进行过设备改造
modifyMode: '', //改造方式
heatIntellectModifyYear: '', //增加主机智能化集中控制系统年份
heatModifyYear: '', //更换高能效设备年份
},
//展示名称
formColumns: {
heatModeName: '', //改造方式名称
heatTypeName: '',
modifyModeName: '',
heatTypeListName: '', //采暖机组名称
},
//机组展示list
/**
* 询问
*/
useSearch: {
heatEnquireDevIds: '', //设备类
heatEnquireIds: '', //运营类
},
searchList: [],
heatEnquireDevIdsList: [], //设备类
heatEnquireIdsList: [], //运营类
/**
* 改造方式复选框
*/
hetList: [{
code: 1,
name: '增加机组智能化集中控制系统',
checked: false,
},
{
code: 2,
name: '更换高能效设备',
checked: false,
},
],
resultList: [],
spliceList: [],
//定时器
mouSetTimer: null,
setValTimer: null,
heatYear1: false,
heatYear2: false,
required: false,
}
},
computed: {
showForm() {
if(this.tidCid.taskId) {
return false
}
return true
},
pureDigital() {
return pureDigital
},
//如果选择为否,携带属性需要删除
notData() {
return {
heatEquipModiy: {
formColumnsField: ['modifyModeName'],
formField: ['modifyMode','heatIntellectModifyYear','heatModifyYear'],
isShow: ['heatYear1','heatYear2'],
setStore: 'SET_HEAT_YEAR',
list: this.hetList,
}
}
}
},
created() {
this.tidCid = JSON.parse(sessionStorage.getItem('tidCid'))
},
mounted() {
const path = sessionStorage.getItem('facilityManageParPath')
this.$store.commit('pageData/GET_HET', this.typeId)
if(path == '/TaskFilling' || path == '/Taskfilling' || path == '/useenergyadd') {
this.editData()
} else {
for (const key in this.$data) {
this.$data[key] = this.$store.getters.heaData[key]
}
this.setValTimer = setTimeout(()=>{
if(this.form.heatMode) {
this.onConfirmHe()
}
if(this.form.heatType) {
this.onConfirmHet()
}
const cn = this.$store.getters.heatingUnitList
if(cn.length > 0 ) {
this.formColumns.heatTypeListName = cn.map((ele) => ele.unitTypeName).join(',')
}
}, 500)
for (const key in this.form) {
this.form[key] = this.$store.getters[key]
}
}
},
beforeDestroy() {
clearTimeout(this.mouSetTimer)
clearTimeout(this.setValTimer)
this.setVuexData()
},
methods: {
//修改覆写数据
async editData() {
console.log(this.$store.getters.heatingUnitList);
this.mouSetTimer = setTimeout(async () => {
//查询机组
this.searchHeatType()
//前页面存起来的数据
const data = this.$store.getters.editData
//采暖方式
this.editHt(data)
//采暖设备类型
this.editHm(data)
//问询问题
const searchInfo = this.$store.getters.searchInfo
if (searchInfo) {
console.log(this.$store.getters.searchInfo);
const res = dataMode(searchInfo['sbcn'])
this.searchList = res
//运营类
if(data.info.heatEnquireIds == '') {
const list1 = res.find((ele)=> ele.type == 1)
const dataList1 = list1.child.map((item)=> item.enquireId)
this.useSearch.heatEnquireIds = dataList1.join(',')
this.heatEnquireIdsList = dataList1
}
//设备类
if(data.info.heatEnquireDevIds == '') {
const list1 = res.find((ele)=> ele.type == 2)
const dataList1 = list1.child.map((item)=> item.enquireId)
this.useSearch.heatEnquireDevIds = dataList1.join(',')
this.heatEnquireDevIdsList = dataList1
}
this.$store.commit('search/SET_HEAT', this.useSearch)
}
//判断如果为修改状态
if (data.pageKey) {
//获取当前用能设备id
this.eqid = data.info.equipId
//循环当前页面form和后端返回的公共data部分
for (const key in this.form) {
for (const keys in data.info) {
if (key == keys) {
this.form[key] = data.info[keys]
}
}
}
for (const key in this.form) {
if (!this.form[key]) {
this.formColumns[key + 'Name'] = ''
}
}
//设备改造
this.editModify(data)
//问询
this.editDataSearch(data)
return
}
}, 200)
},
setVuexData() {
this.$store.commit('pageData/CURRENT_HEA_DATA', this.$data)
for (const key in this.form) {
this.form[key] = ''
}
},
/**
* editData是否改造
*/
editModify(data) {
this.formColumns.heatEquipModiyName = data.info.heatEquipModiy == 1 ? '是' : '否'
this.spliceList = []
this.resultList = []
if (data.info.heatIntellectModifyYear) {
this.resultList.push({
code: 1,
name: '增加机组智能化集中控制系统',
checked: true,
// field: "cenWaterModifyYear",
})
}
if (data.info.heatModifyYear) {
this.resultList.push({
code: 2,
name: '更换高能效设备',
checked: true,
// field: "cenWaterModifyYear",
})
}
if (!data.info.heatIntellectModifyYear) {
this.spliceList.push({
code: 1,
name: '增加机组智能化集中控制系统',
checked: false,
// field: "cenWaterModifyYear",
})
}
if (!data.info.heatModifyYear) {
this.spliceList.push({
code: 2,
name: '更换高能效设备',
checked: false,
// field: "cenWaterModifyYear",
})
}
// this.hetList = this.resultList;
this.hetList.forEach((v) => {
v.checked = false
this.resultList.forEach((ev) => {
if (v.code == ev.code) {
v.checked = true
}
})
})
this.hetList.forEach((v) => {
v.checked = true
this.spliceList.forEach((ev) => {
if (v.code == ev.code) {
v.checked = false
}
})
})
const name = this.resultList.map((ele) => ele.name)
const id = this.resultList.map((ele) => ele.code)
const checkboxInfo = {
name,
id,
result: this.resultList,
}
this.onConfirmCheckbox(checkboxInfo)
},
/**
* editData 采暖方式
*/
async editHt(data) {
const heatInfo = {
id: 80000001018,
type: 'cnfs',
}
const heatList = await getCodeCommon(heatInfo)
heatList.forEach((v) => {
v.checked = false
})
this.heatList = heatList
if (heatList && heatList.length > 0) {
if (data.info.heatMode) {
const heatModeList = data.info.heatMode.split(',')
const heData = heatList.filter((ele) => {
return heatModeList.some((item) => item == ele.code)
})
this.form.heatMode = data.info.heatMode
this.formColumns.heatModeName = heData.map((ele) => {
ele.checked = true
return ele.name
}).join(',')
this.resultCheckboxHeat = heData
}
}
},
/**
* editData 采暖设备类型
*/
async editHm(data) {
const heatTypeInfo = {
id: 80000001019,
type: 'cnsblx',
}
// const heatTypeList = ;
const heatTypeList = await getCodeCommon(heatTypeInfo)
heatTypeList.forEach((v) => {
v.checked = false
})
this.heatTypeList = heatTypeList
if (heatTypeList && heatTypeList.length > 0) {
if (data.info.heatType) {
const heTypeList = data.info.heatType.split(',')
const hetData = heatTypeList.filter((ele) => {
return heTypeList.some((item) => item == ele.code)
})
this.formColumns.heatTypeName = hetData.map((ele) => {
ele.checked = true
return ele.name
}).join(',')
this.resultCheckboxHeatType = hetData
}
}
},
/**
* edit 问询
*/
editDataSearch(data) {
/**
* 询问回显
*/
//设备类
if (data.info.heatEnquireDevIds && this.searchList.length > 0) {
const devList = data.info.heatEnquireDevIds.split(',')
this.useSearch.heatEnquireDevIds = data.info.heatEnquireDevIds
this.heatEnquireDevIdsList = devList
this.searchList[1].child.forEach((ele) => {
ele.color = false
devList.forEach((item) => {
if (item == ele.enquireId) {
ele.color = true
}
})
})
}
//运营类
if (data.info.heatEnquireIds && this.searchList.length > 0) {
const devList = data.info.heatEnquireIds.split(',')
this.useSearch.heatEnquireIds = data.info.heatEnquireIds
this.heatEnquireIdsList = 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_HEAT', this.useSearch)
},
//查询采暖机组
async searchHeatType() {
const arrCnList = this.$store.getters.heatingUnitList
const data = {
type: 'jzlx',
id: 80000001020,
}
const res = await getCodeCommon(data)
sessionStorage.setItem('heatCnLx', JSON.stringify(res))
const names = res.filter((ele) => {
return arrCnList.some((item) => ele.code == item.unitType)
})
if (arrCnList.length > 0) {
this.formColumns.heatTypeListName = names.map((ele) => ele.name).join(',')
}
},
/**
* 采暖方式
*/
onCancelHe() {
this.heatList.forEach((v)=>{
this.resultSpliceHeat.forEach((sv)=>{
if(v.value == sv.value) {
v.checked = false
}
})
this.resultCheckboxHeat.forEach((rv)=>{
if(v.value == rv.value) {
v.checked = true
}
})
})
this.handelHeatModeShow = false
},
onConfirmHe() {
const htName = this.heatList.filter((ele) => ele.checked)
const htameF = this.heatList.filter((ele) => !ele.checked)
this.resultCheckboxHeat = htName
this.resultSpliceHeat = htameF
this.formColumns.heatModeName = htName.map((ele)=> ele.name).join(',')
this.form.heatMode = htName.map((ele)=> ele.value).join(',')
const data = {
type: 'heatMode',
data: this.form.heatMode,
}
this.$store.commit('search/SET_HEAT_CHANGE', data)
this.handelHeatModeShow = false
},
/**
* 采暖设备
*/
onCancelHet() {
if(this.resultSpliceHeatType.length == 0) {
this.heatTypeList.forEach((v)=>{
v.checked = false
})
}
this.heatTypeList.forEach((v)=>{
this.resultSpliceHeatType.forEach((sv)=>{
if(v.value == sv.value) {
v.checked = false
}
})
this.resultCheckboxHeatType.forEach((rv)=>{
if(v.value == rv.value) {
v.checked = true
}
})
})
this.heatTypeShow = false
},
onConfirmHet() {
// this.formColumns.heatTypeName = this.resultCheckboxHeatType.map((ele) => ele.name).join(',')
// this.form.heatType = this.resultCheckboxHeatType.map((ele) => ele.value).join(',')
const hetName = this.heatTypeList.filter((ele) => ele.checked)
const hetameF = this.heatTypeList.filter((ele) => !ele.checked)
this.resultCheckboxHeatType = hetName
this.resultSpliceHeatType = hetameF
this.formColumns.heatTypeName = hetName.map((ele)=> ele.name).join(',')
this.form.heatType = hetName.map((ele)=> ele.value).join(',')
const data = {
type: 'heatType',
data: this.form.heatType,
}
this.$store.commit('search/SET_HEAT_CHANGE', data)
this.heatTypeShow = false
},
//机组展示
getArrCn() {
const arrCn = sessionStorage.getItem('arrCn') ?
sessionStorage.getItem('arrCn') :
sessionStorage.getItem('arrCnList')
if (arrCn) {
const list = JSON.parse(arrCn)
this.formColumns.heatType = list
.map((ele) => ele.unitTypeName)
.join(',')
}
},
/**
* 闻讯
*/
//询问选择为是
handelClickOk(ele, i) {
if(this.showForm) {
return
}
if (ele.enquireType == '2' && !ele.color) {
// const index = this.heatEnquireDevIdsList.findIndex((v) => {
// return v == 0
// })
this.heatEnquireDevIdsList.splice(i-1, 1, ele.enquireId)
ele.color = true
}
if (ele.enquireType == '1' && !ele.color) {
// const index = this.heatEnquireIdsList.findIndex((v) => {
// return v == 0
// })
this.heatEnquireIdsList.splice(i-1, 1, ele.enquireId)
ele.color = true
}
this.useSearch.heatEnquireDevIds = this.heatEnquireDevIdsList.join(',')
this.useSearch.heatEnquireIds = this.heatEnquireIdsList.join(',')
this.$store.commit('search/SET_HEAT', this.useSearch)
},
//询问选择为否
handelClickNo(ele, list) {
if(this.showForm) {
return
}
if (ele.enquireType == '2' && ele.color) {
const index = this.heatEnquireDevIdsList.findIndex((v) => v == ele.enquireId)
if(index == -1) {
this.heatEnquireDevIdsList = list.map((item)=> {
if(ele.enquireId == item.enquireId) {
return item.noId
}
return item.enquireId
})
this.useSearch.heatEnquireDevIds = this.heatEnquireDevIdsList.join(',')
const elseItem = this.searchList.find((ele)=> ele.type == '1')
this.useSearch.heatEnquireIds = elseItem.child.map((ele)=> {
if(ele.color) {
return ele.enquireId
} else {
return ele.noId
}
}).join(',')
ele.color = false
} else {
this.heatEnquireDevIdsList.splice(index, 1, ele.noId)
this.useSearch.heatEnquireDevIds = this.heatEnquireDevIdsList.join(',')
const elseItem = this.searchList.find((ele)=> ele.type == '1')
this.useSearch.heatEnquireIds = 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.heatEnquireIdsList.findIndex((v) => v == ele.enquireId)
if(index == -1) {
this.heatEnquireIdsList = list.map((item)=> {
if(ele.enquireId == item.enquireId) {
return item.noId
}
return item.enquireId
})
this.useSearch.heatEnquireIds = this.heatEnquireIdsList.join(',')
const elseItem = this.searchList.find((ele)=> ele.type == '2')
this.useSearch.heatEnquireDevIds = elseItem.child.map((ele)=> {
if(ele.color) {
return ele.enquireId
} else {
return ele.noId
}
}).join(',')
ele.color = false
} else {
this.heatEnquireIdsList.splice(index, 1, ele.noId)
this.useSearch.heatEnquireIds = this.heatEnquireIdsList.join(',')
const elseItem = this.searchList.find((ele)=> ele.type == '2')
this.useSearch.heatEnquireDevIds = elseItem.child.map((ele)=> {
if(ele.color) {
return ele.enquireId
} else {
return ele.noId
}
}).join(',')
ele.color = false
}
}
this.$store.commit('search/SET_HEAT', this.useSearch)
},
//点击改造方式确认
onConfirmCheckbox(data) {
this.heatYear1 = false
this.heatYear2 = false
this.hetList.forEach((v)=> {
if(!v.checked && v.code == 1) {
this.form.heatIntellectModifyYear = ''
}
if(!v.checked && v.code == 2) {
this.form.heatModifyYear = ''
}
})
this.$store.commit('search/SET_HEAT_YEAR', this.form)
data.id.forEach((v) => {
if (v == 1) {
this.heatYear1 = true
}
if (v == 2) {
this.heatYear2 = true
}
})
this.formColumns.modifyModeName = data.name.join(',')
this.form.modifyMode = data.id.join(',')
},
handelInput(type, num) {
if(type == 'pumpNum' && !num) {
num = 0
}
const data = {
type,
data: num,
}
console.log(type,num);
this.$store.commit('search/SET_NUM', data)
},
handleClickInput(val) {
this.$router.replace({
name: 'burstingList',
params: {
title: '采暖机组',
type: val,
},
})
const data = {
title: '采暖机组',
type: 3,
}
sessionStorage.setItem('routerData', JSON.stringify(data))
},
},
}
</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;
}
</style>
@@ -0,0 +1,750 @@
<template>
<van-form ref="hot" :disabled="showForm">
<div class="focusAir">
<div class="focusItem">
<van-cell-group>
<Whether :value="formColumns.venueName" @onConfirmTrueFalse="onConfirmTrueFalse" title="涉及医院,场馆类或学校" required :rules="[{ required: true, message:'请选择' }]" feildName="venue" />
<van-field v-model="formColumns.energyTypeName" label="消耗能源类型" required :rules="[{ required: true, message:'请选择消耗能源类型' }]" is-link input-align="right" placeholder="请选择" readonly @click="energyTypeShow = !showForm" />
<van-field v-input.floatNo0 v-model="form.waterDay" required :rules="[{ required: true}]" label="日用水量(L)" type="number" input-align="right" placeholder="请输入" />
<van-field v-input.float v-model="form.setWaterWarm" required :rules="[{ required: true}]" label="设定水温(℃)" type="number" input-align="right" placeholder="请输入" @input="inputForSetWaterWarm"/>
<div class="tips" v-if="tips0 == true">35℃ ≤设定水温≤100℃</div>
<!-- <van-field v-model="form.useYear" label="变压器投运年限(年)" label-width="140" input-align="right" placeholder="请输入" is-link readonly @click="handelClickYear('useYear')" /> -->
<van-field v-model="formColumns.deviceTypeName" label="热水设备类型" required :rules="[{ required: true, message:'请选择热水设备类型' }]" input-align="right" placeholder="请选择" readonly is-link @click="deviceTypeShow = !showForm" />
<!-- 是否进行过设备改造 -->
<Whether required :rules="[{ required: true, message:'请选择设备改造' }]" :value="formColumns.waterModiyName" @onConfirmTrueFalse="onConfirmTrueFalse" feildName="waterModiy" special="1" />
<!-- 改造方式 -->
<ModifyMode
v-show="form.waterModiy == 1"
:columns="formColumns"
:list1="resultList"
:list2="spliceList"
:type="hotType"
feild="waterModiy"
:required="form.waterModiy == 1"
:form="form"
@onConfirmCheckbox="onConfirmCheckbox"
/>
<van-field v-show="modifyYearShow" required :rules="[{ required: modifyYearShow, message:'请选择年份' }]" v-model="form.modifyYear" label="增加设备智能化集中控制系统年份" label-width="220" input-align="right" is-link placeholder="请选择" readonly @click="handelClickYear('modifyYear')" />
<van-field v-show="intellectModifyYearShow" required :rules="[{ required: intellectModifyYearShow, message:'请选择年份' }]" v-model="form.intellectModifyYear" label="更换高能效设备,改造年份" label-width="220" input-align="right" is-link placeholder="请选择" readonly @click="handelClickYear('intellectModifyYear')" />
</van-cell-group>
</div>
<div :class="form.energyType ? 'search-main' : ''" v-for="item in searchList" :key="item.type">
<div class="focusItem" v-if="form.energyType">
<div class="title" v-if="item.type == '1'">
<van-icon name="chat-o" />运营类节能诊断问询
</div>
<div class="title" v-if="item.type == '2'">
<van-icon name="chat-o" />设备类节能诊断问询
</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>
<!-- <div class="bottom"><van-button type="primary" block>保存</van-button></div> -->
<VanPickerNew :show="show" :columns="list" :loading="loading" @onConfirm="onConfirm" @onCancel="onCancel" />
<Year :show="yearShow" :num="1" @onConfirmYear="onConfirmYear" @onCancelYear="onCancelYear" />
<!-- 消耗能源类型 -->
<VanPickerNew :show="energyTypeShow">
<div class="content">
<div class="content-head">
<div @click="onCancelEnergyType">取消</div>
<div @click="onConfirmEnergyType">确认</div>
</div>
<div class="content-main">
<van-cell v-for="item in energyTypeList" :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="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 } from '../common'
import { getCodeCommon } from '@/views/facilityManage/common'
import Radio from '../common-vue/radio.vue'
export default {
components: {
Radio,
Year,
ModifyMode,
Whether,
VanPickerNew,
},
mixins: [mixin],
data() {
return {
tips0: false,
typeId: this.$route.query.typeId,
tidCid: null,
//当前是何页面
page: {
name: '生活热水系统',
title: 'hotWater',
},
//用能设备id
eqid: '',
//页面双向绑定及向后端传递的数据
form: {
venue: '', //涉及医院等
energyType: '', //消耗能源类型
waterDay: '', //日用水量
setWaterWarm: '', //设定水温
deviceType: '', //热水设备类型
waterModiy: '2', //是否进行过设备改造
modifyMode: '', //改造方式
modifyYear: '', //增加主机智能化集中控制系统年份
useYear: '',
intellectModifyYear:''
},
//页面展示的中文名称
formColumns: {
heatModeName: '', //改造方式名称
energyTypeName: '', //消耗能源类型名称
deviceTypeName: '', //热水设备类型名称
venueName: '',
modifyModeName: '',
waterModiyName: '',
},
//改造方式的系统码表数据
hotType: {
id: 80000001028,
type: 'rsgzfs',
},
/**
* 复选框
*/
//改造方式选中
resultList: [],
//改造方式未选中
spliceList: [],
/**
* 询问
*/
useSearch: {
hotWaterEnquireDevIds: '', //设备类
hotWaterEnquireIds: '', //运营类
},
//问询的数据
searchList: [],
hotWaterEnquireDevIdsList: [], //设备类
hotWaterEnquireIdsList: [], //运营类
/**
* 消耗能源类型
*/
energyTypeShow: false,
//消耗能源类型数据
energyTypeList: [],
//消耗能源类型选中
resultCheckboxEnergy: [],
//消耗能源类型未选中
resultSpliceEnergy:[],
/**
* 热水设备类型
*/
deviceTypeShow: false,
//热水设备类型
deviceTypeList: [],
resultCheckboxDevice: [],
resultSpliceDevice: [],
modifyYearShow: false,
intellectModifyYearShow:false,
//定时器
edSet: null,
required: false
}
},
created() {
this.tidCid = JSON.parse(sessionStorage.getItem('tidCid'))
},
watch: {
deviceTypeList: function(newVal) {
if (newVal && newVal.length > 0) {
if (this.form.deviceType) {
const deChcekedList = this.form.deviceType.split(',')
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
}
}
},
},
computed: {
showForm() {
if(this.tidCid.taskId) {
return false
}
return true
},
//如果选择为否,携带属性需要删除
notData() {
return {
waterModiy: {
formColumnsField: ['modifyModeName'],
formField: ['modifyMode', 'modifyYear','intellectModifyYear'],
isShow: ['modifyYearShow','intellectModifyYearShow'],
list: [],
}
}
}
},
mounted() {
this.$store.commit('pageData/GET_HOT', this.typeId)
this.editData()
},
beforeDestroy() {
clearTimeout(this.edSet)
this.clearData()
// this.setVuexData()
},
methods: {
//第二次进入页面查询vuex页面是否存储
// getVuexData() {
// for (const key in this.$store.getters.hotData) {
// for (const keys in this.$data) {
// if (key == keys) {
// this.$data[keys] = this.$store.getters.hotData[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.energyTypeShow = false
this.deviceTypeShow = false
this.modifyYearShow = false
this.resultList = []
this.spliceList = []
this.searchList = []
this.hotWaterEnquireDevIdsList = []
this.hotWaterEnquireIdsList = []
this.resultCheckboxEnergy = []
this.resultSpliceEnergy = []
this.resultCheckboxDevice = []
this.resultSpliceDevice = []
sessionStorage.removeItem('rsModifyName')
},
//修改覆写数据
async editData() {
//消耗能源类型
this.editDataEnergy()
//热水设备类型
this.editDatadevice()
this.edSet = setTimeout(async () => {
//前页面存起来的数据
const data = this.$store.getters.editData
//问询问题
const searchInfo = this.$store.getters.searchInfo
if (searchInfo) {
const res = dataMode(searchInfo['sbshrs'])
this.searchList = res
//运营类
if(data.info.hotWaterEnquireIds == '') {
const list1 = res.find((ele)=> ele.type == 1)
const dataList1 = list1.child.map((item)=> item.enquireId)
this.useSearch.hotWaterEnquireIds = dataList1.join(',')
this.hotWaterEnquireIdsList = dataList1
}
//设备类
if(data.info.hotWaterEnquireDevIds == '') {
const list1 = res.find((ele)=> ele.type == 2)
const dataList1 = list1.child.map((item)=> item.enquireId)
this.useSearch.hotWaterEnquireDevIds = dataList1.join(',')
this.hotWaterEnquireDevIdsList = dataList1
}
this.$store.commit('search/SET_HOT', this.useSearch)
}
//判断如果为修改状态
if (data.pageKey) {
//获取当前用能设备id
this.eqid = data.info.equipId
// 判断后端是否存在配电页面的数据
if (data.info.nxzdHotWaterSystemDTO) {
for (const key in data.info.nxzdHotWaterSystemDTO) {
for (const keys in this.form) {
if (key == keys) {
this.form[keys] = data.info.nxzdHotWaterSystemDTO[key]
}
}
}
if(this.form.modifyYear) {
this.modifyYearShow = true
}
if(this.form.intellectModifyYear) {
this.intellectModifyYearShow = true
}
//判断是否
this.editIsTrue()
//消耗能源类型
this.editDataEnergy()
//热水设备类型
this.editDatadevice()
//改造方式
this.editDataModify()
//问询
this.editSearch(data)
} else {
for (const key in this.form) {
this.form[key] = ''
this.formColumns[key + 'Name'] = ''
}
}
return
}
}, 250)
},
/**
* editData消耗能源类型
*/
async editDataEnergy() {
const energyInfo = {
id: 80000001026,
type: 'xhnylx',
}
const energyTypeList = await getCodeCommon(energyInfo)
energyTypeList.forEach((v) => {
v.checked = false
})
this.energyTypeList = energyTypeList
if (energyTypeList && energyTypeList.length > 0) {
if (this.form.energyType) {
const enChcekedList = this.form.energyType.split(',')
const enData = energyTypeList.filter((ele) => {
return enChcekedList.some((item) => item == ele.code)
})
this.formColumns.energyTypeName = enData.map((ele) => {
ele.checked = true
return ele.name
}).join(',')
this.resultCheckboxEnergy = enData
}
}
},
/**
* editData改造方式
*/
editDataModify() {
if(this.form.modifyMode) {
const data = this.form.modifyMode.split(',').find((ele)=> ele == 1)
const data2 = this.form.modifyMode.split(',').find((ele)=> ele == 2)
if(data) {
this.modifyYearShow = true
}
if(data2) {
this.intellectModifyYearShow = true
}
}
if (this.form.modifyMode) {
this.resultList = this.form.modifyMode.split(',')
setTimeout(() => {
const mNameData = JSON.parse(sessionStorage.getItem('rsModifyName'))
if (mNameData) {
this.formColumns.modifyModeName = mNameData.map((ele) => ele.name).join(',')
}
}, 500)
}
},
/**
* editData热水设备类型
*/
async editDatadevice() {
const deviceInfo = {
id: 80000001027,
type: 'rssblx',
}
const deviceTypeList = await getCodeCommon(deviceInfo)
this.getDeviceTypeList(deviceTypeList)
},
/**
* editData判断是否
*/
editIsTrue() {
/**
* 判断是否
*/
const list = [{
id: '1',
name: '是',
},
{
id: '2',
name: '否',
},
]
const obj = list.find((v) => v.id == this.form.venue)
const obj1 = list.find((v) => v.id == this.form.waterModiy)
if (obj) {
this.formColumns.venueName = obj.name
}
if (obj1) {
this.formColumns.waterModiyName = obj1.name
}
},
/**
* editData 问询
*/
editSearch(data) {
/**
* 询问回显
*/
//设备类
if (data.info.hotWaterEnquireDevIds && this.searchList.length > 0) {
const devList = data.info.hotWaterEnquireDevIds.split(',')
this.useSearch.hotWaterEnquireDevIds =
data.info.hotWaterEnquireDevIds
this.hotWaterEnquireDevIdsList = devList
this.searchList[1].child.forEach((ele) => {
ele.color = false
devList.forEach((item) => {
if (item == ele.enquireId) {
ele.color = true
}
})
})
}
//运营类
if (data.info.hotWaterEnquireIds && this.searchList.length > 0) {
const devList = data.info.hotWaterEnquireIds.split(',')
this.useSearch.hotWaterEnquireIds = data.info.hotWaterEnquireIds
this.hotWaterEnquireIdsList = 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_HOT', this.useSearch)
},
// setVuexData() {
// this.$store.commit('pageData/CURRENT_HOT_DATA', this.$data)
// },
//递归拆分数据
getDeviceTypeList(list) {
const list1 = JSON.parse(JSON.stringify(list))
let arr = []
list1.forEach((v) => {
if (!v.child) {
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
},
/**
* 消耗能源类型
*/
onCancelEnergyType() {
this.energyTypeList.forEach((v)=>{
this.resultSpliceEnergy.forEach((sv)=>{
if(v.value == sv.value) {
v.checked = false
}
})
this.resultCheckboxEnergy.forEach((rv)=>{
if(v.value == rv.value) {
v.checked = true
}
})
})
this.energyTypeShow = false
},
onConfirmEnergyType() {
const enName = this.energyTypeList.filter((ele) => ele.checked)
const enameF = this.energyTypeList.filter((ele) => !ele.checked)
this.resultCheckboxEnergy = enName
this.resultSpliceEnergy = enameF
this.formColumns.energyTypeName = enName.map((ele) => ele.name).join(',')
this.form.energyType = this.resultCheckboxEnergy.map((ele) => ele.value).join(',')
this.energyTypeShow = 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 devName = this.deviceTypeList.filter((ele) => ele.checked)
const devameF = this.deviceTypeList.filter((ele) => !ele.checked)
this.resultCheckboxDevice = devName
this.resultSpliceDevice = devameF
this.formColumns.deviceTypeName = this.resultCheckboxDevice.map((ele) => ele.name).join(',')
this.form.deviceType = this.resultCheckboxDevice.map((ele) => ele.value).join(',')
this.deviceTypeShow = false
},
/**
* 闻讯
*/
//询问选择为是
handelClickOk(ele, i) {
if(this.showForm) {
return
}
if (ele.enquireType == '2' && !ele.color) {
this.hotWaterEnquireDevIdsList.splice( i-1, 1, ele.enquireId)
ele.color = true
}
if (ele.enquireType == '1' && !ele.color) {
this.hotWaterEnquireIdsList.splice( i-1, 1, ele.enquireId)
ele.color = true
}
this.useSearch.hotWaterEnquireDevIds = this.hotWaterEnquireDevIdsList.join(',')
this.useSearch.hotWaterEnquireIds = this.hotWaterEnquireIdsList.join(',')
this.$store.commit('search/SET_HOT', this.useSearch)
},
//询问选择为否
handelClickNo(ele, list) {
if(this.showForm) {
return
}
if (ele.enquireType == '2' && ele.color) {
const index = this.hotWaterEnquireDevIdsList.findIndex((v) => v == ele.enquireId)
if(index == -1) {
this.hotWaterEnquireDevIdsList = list.map((item)=> {
if(ele.enquireId == item.enquireId) {
return item.noId
}
return item.enquireId
})
this.useSearch.hotWaterEnquireDevIds = this.hotWaterEnquireDevIdsList.join(',')
const elseItem = this.searchList.find((ele)=> ele.type == '1')
this.useSearch.hotWaterEnquireIds = elseItem.child.map((ele)=> {
if(ele.color) {
return ele.enquireId
} else {
return ele.noId
}
}).join(',')
ele.color = false
} else {
this.hotWaterEnquireDevIdsList.splice(index, 1, ele.noId)
this.useSearch.hotWaterEnquireDevIds = this.hotWaterEnquireDevIdsList.join(',')
const elseItem = this.searchList.find((ele)=> ele.type == '1')
this.useSearch.hotWaterEnquireIds = 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.hotWaterEnquireIdsList.findIndex((v) => v == ele.enquireId)
if(index == -1) {
this.hotWaterEnquireIdsList = list.map((item)=> {
if(ele.enquireId == item.enquireId) {
return item.noId
}
return item.enquireId
})
this.useSearch.hotWaterEnquireIds = this.hotWaterEnquireIdsList.join(',')
const elseItem = this.searchList.find((ele)=> ele.type == '2')
this.useSearch.hotWaterEnquireDevIds = elseItem.child.map((ele)=> {
if(ele.color) {
return ele.enquireId
} else {
return ele.noId
}
}).join(',')
ele.color = false
} else {
this.hotWaterEnquireIdsList.splice(index, 1, ele.noId)
this.useSearch.hotWaterEnquireIds = this.hotWaterEnquireIdsList.join(',')
const elseItem = this.searchList.find((ele)=> ele.type == '2')
this.useSearch.hotWaterEnquireDevIds = elseItem.child.map((ele)=> {
if(ele.color) {
return ele.enquireId
} else {
return ele.noId
}
}).join(',')
ele.color = false
}
}
this.$store.commit('search/SET_HOT', this.useSearch)
},
//点击改造方式确认
onConfirmCheckbox(data) {
this.modifyYearShow = false
this.intellectModifyYearShow = false
data.delList.forEach((v)=> {
if(!v.checked && v.value == 1) {
this.form.modifyYear = ''
}
if(!v.checked && v.value == 2) {
this.form.intellectModifyYear = ''
}
})
data.id.forEach((v) => {
if (v == 1) {
this.modifyYearShow = true
}
if (v == 2) {
this.intellectModifyYearShow = true
}
})
this.formColumns.modifyModeName = data.name.join(',')
this.form.modifyMode = data.id.join(',')
},
// 设定水温添加方法
inputForSetWaterWarm() {
let warm = Number(this.form.setWaterWarm)
if(warm&&(warm < 35 || warm > 100)){
this.tips0 = true
}else{
this.tips0 = false
}
},
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>
@@ -0,0 +1,788 @@
<template>
<van-form ref="ill" :disabled="showForm">
<div class="focusAir">
<div class="focusItem">
<!-- 主要灯具类型 -->
<van-field v-model="radioName" label="主要灯具类型" input-align="right" is-link placeholder="请选择" required :rules="[{ required: true, message:'请至少选择一个灯具类型' }]" readonly @click="handelClickRadioName" />
<van-field v-input.float v-show="ledRatioShow" required :rules="[{ required: ledRatioShow, message: '请填写占比' }]" v-model="form.ledRatio" label="LED灯占比(%)" type="number" label-width="140" input-align="right" placeholder="请输入" @input="handelChangeNumber('ledRatio')" />
<van-field v-input.float v-show="fluorescentRadioShow" required :rules="[{ required: fluorescentRadioShow, message:'请填写占比' }]" v-model="form.fluorescentRadio" label="普通荧光灯占比(%)" type="number" label-width="140" input-align="right" placeholder="请输入" @input="handelChangeNumber('fluorescentRadio')" />
<van-field v-input.float v-show="incandescentRadioShow" required :rules="[{ required: incandescentRadioShow, message:'请填写占比' }]" v-model="form.incandescentRadio" label="白炽灯占比(%)" type="number" label-width="140" input-align="right" placeholder="请输入" @input="handelChangeNumber('incandescentRadio')" />
<van-field v-input.float v-show="energySaviRatioShow" required :rules="[{ required: energySaviRatioShow, message:'请填写占比' }]" v-model="form.energySaviRatio" label="节能灯占比(%)" type="number" label-width="140" input-align="right" placeholder="请输入" @input="handelChangeNumber('energySaviRatio')" />
<van-field v-input.numNo0 v-model="form.totalNum" label="合计数量约(盏)" type="number" required :rules="[{ required: true, message: '请填写合计数量' }]" label-width="140" input-align="right" placeholder="请输入" />
<!-- 是否进行过设备改造 -->
<Whether required :rules="[{ required: true, message:'请选择设备改造' }]" :value="formColumns.equipModiyName" @onConfirmTrueFalse="onConfirmTrueFalse" title="是否进行过照明系统改造" feildName="equipModiy" special="1" />
<!-- 改造方式 -->
<ModifyMode
v-show="form.equipModiy == 1"
:columns="formColumns"
:form="form"
:type="illType"
feild="equipModiy"
:required="form.equipModiy == 1"
:list1="resultList"
:list2="spliceList"
@onConfirmCheckbox="onConfirmCheckbox"
/>
<van-field v-show="yearShow1" v-model="form.modifyYear" label="更换LED照明灯具改造年份" required :rules="[{ required: yearShow1, message:'请选择年份' }]" label-width="220" input-align="right" is-link placeholder="请选择" readonly @click="handelClickYear('modifyYear')" />
<van-field v-show="yearShow2" v-model="form.intellectModifyYear" label="采用感应控制或集中控制改造年份" required :rules="[{ required: yearShow2, message:'请选择年份' }]" label-width="220" input-align="right" is-link placeholder="请选择" readonly @click="handelClickYear('intellectModifyYear')" />
</div>
<div :class="radioName ? 'search-main' : ''" v-for="item in searchList" :key="item.type">
<div class="focusItem" v-if="radioName">
<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>
<Year :show="yearShow" :num="1" @onConfirmYear="onConfirmYear" @onCancelYear="onCancelYear" />
<VanPickerNew :show="show" :columns="list" :loading="loading" @onConfirm="onConfirm" @onCancel="onCancel" />
<!-- 主要灯具类型 -->
<VanPickerNew :show="checkboxShow">
<div class="content">
<div class="content-head">
<div @click="onCancelCheckboxRadioName">取消</div>
<div @click="onConfirmCheckboxRadioName">确认</div>
</div>
<div class="content-main">
<van-cell v-for="item in radioTypeList" :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>
</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 mixin from '@/mixins/mixin'
import { dataMode } from '../common'
import { Notify } from "vant";
import Radio from '../common-vue/radio.vue'
import Year from '../common-vue/year.vue'
export default {
components: {
Year,
Radio,
ModifyMode,
Whether,
VanPickerNew,
},
mixins: [mixin],
data() {
return {
typeId: this.$route.query.typeId,
tidCid: null,
//当前是何页面
page: {
name: '照明系统',
title: 'illumination',
},
//用能设备id
eqid: '',
//页面双向绑定及向后端传递的数据
form: {
ledRatio: '', //LED灯具占比(%)
fluorescentRadio: '', //普通荧光灯(%)
incandescentRadio: '', //白炽灯占比(%)
energySaviRatio: '', //节能灯占比(%)
totalNum: '', // 合计数量约
equipModiy: '', // 是否进行过照明系统改造
modifyMode: '', //改造方式
intellectModifyYear:'',
modifyYear:''
},
//页面展示的中文名称
formColumns: {
equipModiyName: '',
modifyModeName: '',
},
//灯具类型
radioTypeList: [{
text: 'LED灯',
value: '1',
field: 'ledRatio',
checked: false,
},
{
text: '普通荧光灯',
value: '2',
field: 'fluorescentRadio',
checked: false,
},
{
text: '白炽灯',
value: '3',
field: 'incandescentRadio',
checked: false,
},
{
text: '节能灯',
value: '4',
field: 'energySaviRatio',
checked: false,
},
],
//主要灯具类型弹框
checkboxShow: false,
//led灯是否展示
ledRatioShow: false,
//普通灯是否展示
fluorescentRadioShow: false,
//节能灯是否展示
incandescentRadioShow: false,
//白炽灯是否展示
energySaviRatioShow: false,
//选中的灯具
resultCheckbox: [],
//删除的灯具
spliceBox: [],
//主要灯具类型展示
radioName: '',
//主要灯具code
radioIdList: [],
//改造方式的系统码表数据
illType: {
id: 80000001021,
type: 'zmgzfs',
},
//改造方式说选年份
yearShow1:false,
yearShow2:false,
/**
* 询问
*/
useSearch: {
lightEnquireDevIds: '', //设备类
lightEnquireIds: '', //运营类
},
//照明问询数据
searchList: [],
lightEnquireDevIdsList: [], //设备类
lightEnquireIdsList: [], //运营类
//改造方式选中的list
resultList: [],
//改造方式未选中的list
spliceList: [],
//如果选择为否,携带属性需要删除
/**
* 定时器
*/
//覆写的定时器
mouSetTimer: null,
//改造方式获取名称的定时器
modiyTimer: null,
required: false
}
},
computed: {
showForm() {
if(this.tidCid.taskId) {
return false
}
return true
},
radioModel: {
get() {
return this.form
},
set() {
if (this.radioIdList.length > 0) {
this.radioIdList.forEach((v) => {
return this.form[v.field]
})
}
},
},
notData() {
return {
equipModiy: {
formColumnsField: ['modifyModeName','equipModiyName'],
formField: ['modifyMode','intellectModifyYear' ,'modifyYear'],
isShow: ['yearShow1','yearShow2'],
list: []
}
}
},
},
created() {
this.tidCid = JSON.parse(sessionStorage.getItem('tidCid'))
},
mounted() {
this.$store.commit('pageData/GET_ILL', this.typeId)
this.editData()
},
beforeDestroy() {
clearTimeout(this.mouSetTimer)
clearTimeout(this.modiyTimer)
this.clearData()
},
methods: {
//第二次进入页面查询vuex页面是否存储
// getVuexData() {
// for (const key in this.$store.getters.illData) {
// for (const keys in this.$data) {
// if (key == keys) {
// this.$data[keys] = this.$store.getters.illData[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.radioTypeList.forEach((v)=>{
v.checked = false
})
this.resultCheckbox = []
this.spliceBox = []
this.searchList = []
this.lightEnquireDevIdsList = []
this.lightEnquireIdsList = []
this.resultList = []
this.spliceList = []
this.radioName = ''
this.ledRatioShow = false
this.fluorescentRadioShow = false
this.incandescentRadioShow = false
this.energySaviRatioShow = false
sessionStorage.removeItem('zmModifyName')
},
//修改覆写数据
editData() {
this.mouSetTimer = setTimeout(() => {
//前页面存起来的数据
const data = this.$store.getters.editData
//问询问题
const searchInfo = this.$store.getters.searchInfo
if (searchInfo) {
const res = dataMode(searchInfo['sbzm'])
this.searchList = res
//运营类
if(data.info.lightEnquireIds == '') {
const list1 = res.find((ele)=> ele.type == 1)
const dataList1 = list1.child.map((item)=> item.enquireId)
this.useSearch.lightEnquireIds = dataList1.join(',')
this.lightEnquireIdsList = dataList1
}
//设备类
if(data.info.lightEnquireDevIds == '') {
const list1 = res.find((ele)=> ele.type == 2)
const dataList1 = list1.child.map((item)=> item.enquireId)
this.useSearch.lightEnquireDevIds = dataList1.join(',')
this.lightEnquireDevIdsList = dataList1
}
this.$store.commit('search/SET_LIGHT', this.useSearch)
}
//判断如果为修改状态
if (data.pageKey) {
//获取当前用能设备id
this.eqid = data.info.equipId
// 判断后端是否存在配电页面的数据
if (data.info.nxzdLightSystemDTO) {
for (const key in data.info.nxzdLightSystemDTO) {
for (const keys in this.form) {
if (key == keys) {
this.form[keys] = data.info.nxzdLightSystemDTO[key]
}
}
}
if(this.form.intellectModifyYear) {
this.yearShow2 = true
} else {
this.yearShow2 = false
}
if(this.form.modifyYear) {
this.yearShow1 = true
} else {
this.yearShow1 = false
}
//主要灯具回显
this.editDataRadioName()
//改造方式
this.editDataModiy()
//问询
this.editDataSearch(data)
} else {
for (const key in this.form) {
this.form[key] = ''
}
}
return
}
}, 200)
},
// setVuexData() {
// this.$store.commit('pageData/CURRENT_ILL_DATA', this.$data)
// },
/**
* editData回显主要灯具类型
*/
editDataRadioName() {
if (this.form.ledRatio) {
this.ledRatioShow = true
this.resultCheckbox.push({
text: 'LED灯',
value: this.form.ledRatio,
field: 'ledRatio',
checked: true,
})
}
if (this.form.fluorescentRadio) {
this.fluorescentRadioShow = true
this.resultCheckbox.push({
text: '普通荧光灯',
value: this.form.fluorescentRadio,
field: 'fluorescentRadio',
checked: true,
})
}
if (this.form.incandescentRadio) {
this.incandescentRadioShow = true
this.resultCheckbox.push({
text: '白炽灯',
value: this.form.incandescentRadio,
field: 'incandescentRadio',
checked: true,
})
}
if (this.form.energySaviRatio) {
this.energySaviRatioShow = true
this.resultCheckbox.push({
text: '节能灯',
value: this.form.energySaviRatio,
field: 'energySaviRatio',
checked: true,
})
}
if (!this.form.ledRatio) {
this.ledRatioShow = false
this.spliceBox.push({
text: 'LED灯',
value: this.form.ledRatio,
field: 'ledRatio',
checked: false,
})
}
if (!this.form.fluorescentRadio) {
this.fluorescentRadioShow = false
this.spliceBox.push({
text: '普通荧光灯',
value: this.form.fluorescentRadio,
field: 'fluorescentRadio',
checked: false,
})
}
if (!this.form.incandescentRadio) {
this.incandescentRadioShow = false
this.spliceBox.push({
text: '白炽灯',
value: this.form.incandescentRadio,
field: 'incandescentRadio',
checked: false,
})
}
if (!this.form.energySaviRatio) {
this.energySaviRatioShow = false
this.spliceBox.push({
text: '节能灯',
value: this.form.energySaviRatio,
field: 'energySaviRatio',
checked: false,
})
}
this.radioName = this.resultCheckbox.map((ele) => ele.text).join(',')
this.radioTypeList.forEach((v) => {
v.checked = false
this.resultCheckbox.forEach((ev) => {
if (v.field == ev.field) {
v.checked = ev.checked
}
})
})
},
/**
* editData 改造方式
*/
editDataModiy() {
this.formColumns.equipModiyName = this.form.equipModiy == 1 ? '是' : '否'
if (this.form.modifyMode) {
this.resultList = this.form.modifyMode.split(',')
}
this.modiyTimer = setTimeout(() => {
const mNameData = JSON.parse(sessionStorage.getItem('zmModifyName'))
console.log(mNameData);
if (mNameData) {
this.formColumns.modifyModeName = mNameData.map((ele) => ele.name).join(',')
}
}, 500)
},
/**
* editData 回显问询
*/
editDataSearch(data) {
/**
* 询问回显
*/
//设备类
if (data.info.lightEnquireDevIds && this.searchList.length > 0) {
const devList = data.info.lightEnquireDevIds.split(',')
this.useSearch.lightEnquireDevIds = data.info.lightEnquireDevIds
this.lightEnquireDevIdsList = devList
this.searchList[1].child.forEach((ele) => {
ele.color = false
devList.forEach((item) => {
if (item == ele.enquireId) {
ele.color = true
}
})
})
}
//运营类
if (data.info.lightEnquireIds && this.searchList.length > 0) {
const devList = data.info.lightEnquireIds.split(',')
this.useSearch.lightEnquireIds = data.info.lightEnquireIds
this.lightEnquireIdsList = 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_LIGHT', this.useSearch)
},
//点击改造方式确认
onConfirmCheckbox(data) {
this.yearShow1 = false
this.yearShow2 = false
data.delList.forEach((v)=> {
if(!v.checked && v.value == 1) {
this.form.modifyYear = ''
}
if(!v.checked && v.value == 2) {
this.form.intellectModifyYear = ''
}
})
data.id.forEach((v) => {
if (v == 1) {
this.yearShow1 = true
}
if (v == 2) {
this.yearShow2 = true
}
})
this.formColumns.modifyModeName = data.name.join(',')
this.form.modifyMode = data.id.join(',')
},
handelClickRadioName() {
this.checkboxShow = !this.showForm
},
onCancelCheckboxRadioName() {
this.radioTypeList.forEach((v) => {
this.spliceBox.forEach((sv) => {
if (v.field == sv.field) {
v.checked = false
}
})
this.resultCheckbox.forEach((rv) => {
if (v.field == rv.field) {
v.checked = true
}
})
})
this.checkboxShow = false
},
onConfirmCheckboxRadioName() {
const rtName = this.radioTypeList.filter((ele) => ele.checked)
const rtameF = this.radioTypeList.filter((ele) => !ele.checked)
this.resultCheckbox = rtName
this.spliceBox = rtameF
this.radioName = rtName.map((ele) => ele.text).join(',')
this.radioIdList = this.resultCheckbox
this.resultCheckbox.forEach((v) => {
if (v.text == 'LED灯' && v.checked) {
this.ledRatioShow = true
}
if (v.text == '普通荧光灯' && v.checked) {
this.fluorescentRadioShow = true
}
if (v.text == '白炽灯' && v.checked) {
this.incandescentRadioShow = true
}
if (v.text == '节能灯' && v.checked) {
this.energySaviRatioShow = true
}
})
this.spliceBox.forEach((v) => {
if (v.text == 'LED灯' && !v.checked) {
this.ledRatioShow = false
this.form.ledRatio = ''
}
if (v.text == '普通荧光灯' && !v.checked) {
this.fluorescentRadioShow = false
this.form.fluorescentRadio = ''
}
if (v.text == '白炽灯' && !v.checked) {
this.incandescentRadioShow = false
this.form.incandescentRadio = ''
}
if (v.text == '节能灯' && !v.checked) {
this.energySaviRatioShow = false
this.form.energySaviRatio = ''
}
})
this.checkboxShow = false
},
handelChangeNumber(title) {
if(!this.form.ledRatio) {
this.form.ledRatio = 0
}
if(!this.form.fluorescentRadio) {
this.form.fluorescentRadio = 0
}
if(!this.form.incandescentRadio) {
this.form.incandescentRadio = 0
}
if(!this.form.energySaviRatio) {
this.form.energySaviRatio = 0
}
if(this.resultCheckbox.length > 0) {
let num = 0
this.resultCheckbox.forEach((v)=> {
num += Number(this.form[v.field])
})
if(num > 100) {
Notify({ type: "danger", message: '不可超过100%' });
this.form[title] = 0
}
}
},
/**
* 闻讯
*/
//询问选择为是
handelClickOk(ele, i) {
if(this.showForm) {
return
}
if (ele.enquireType == '2' && !ele.color) {
this.lightEnquireDevIdsList.splice( i-1, 1, ele.enquireId)
ele.color = true
}
if (ele.enquireType == '1' && !ele.color) {
this.lightEnquireIdsList.splice( i-1, 1, ele.enquireId)
ele.color = true
}
this.useSearch.lightEnquireDevIds = this.lightEnquireDevIdsList.join(',')
this.useSearch.lightEnquireIds = this.lightEnquireIdsList.join(',')
this.$store.commit('search/SET_LIGHT', this.useSearch)
},
//询问选择为否
handelClickNo(ele, list) {
if(this.showForm) {
return
}
if (ele.enquireType == '2' && ele.color) {
const index = this.lightEnquireDevIdsList.findIndex((v) => v == ele.enquireId)
if(index == -1) {
this.lightEnquireDevIdsList = list.map((item)=> {
if(ele.enquireId == item.enquireId) {
return item.noId
}
return item.enquireId
})
this.useSearch.lightEnquireDevIds = this.lightEnquireDevIdsList.join(',')
const elseItem = this.searchList.find((ele)=> ele.type == '1')
this.useSearch.lightEnquireIds = elseItem.child.map((ele)=> {
if(ele.color) {
return ele.enquireId
} else {
return ele.noId
}
}).join(',')
ele.color = false
} else {
this.lightEnquireDevIdsList.splice(index, 1, ele.noId)
this.useSearch.lightEnquireDevIds = this.lightEnquireDevIdsList.join(',')
const elseItem = this.searchList.find((ele)=> ele.type == '1')
this.useSearch.lightEnquireIds = 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.lightEnquireIdsList.findIndex((v) => v == ele.enquireId)
if(index == -1) {
this.lightEnquireIdsList = list.map((item)=> {
if(ele.enquireId == item.enquireId) {
return item.noId
}
return item.enquireId
})
this.useSearch.lightEnquireIds = this.lightEnquireIdsList.join(',')
const elseItem = this.searchList.find((ele)=> ele.type == '2')
this.useSearch.lightEnquireDevIds = elseItem.child.map((ele)=> {
if(ele.color) {
return ele.enquireId
} else {
return ele.noId
}
}).join(',')
ele.color = false
} else {
this.lightEnquireIdsList.splice(index, 1, ele.noId)
this.useSearch.lightEnquireIds = this.lightEnquireIdsList.join(',')
const elseItem = this.searchList.find((ele)=> ele.type == '2')
this.useSearch.lightEnquireDevIds = elseItem.child.map((ele)=> {
if(ele.color) {
return ele.enquireId
} else {
return ele.noId
}
}).join(',')
ele.color = false
}
}
this.$store.commit('search/SET_LIGHT', this.useSearch)
},
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>
@@ -0,0 +1,782 @@
<template>
<div class="multipleAir">
<div class="list-upload" v-if="$store.getters.imageRecognition">
<btnUploader type="filePic" :value="filePic"
@afterRead="afterRead1"
@delImg="delImg1"
@onUpload="onUpload1" />
<!-- <Uploader type="exteriorImage" :value="exteriorImage"
@afterRead="afterRead"
@delImg="delImg"
@onUpload="onUpload" /> -->
</div>
<div class="focusItem">
<div class="inputStyle">
<van-cell-group>
<van-field v-model="form.refrigeNum" v-input.numNo0 label="空调数量" type="number" required :rules="[{ required: true}]" input-align="right" placeholder="请输入" />
<van-field v-model="edgl" v-input.floatNo0 label="总额定功率(kW)" type="number" required :rules="[{ required: true }]" input-align="right" placeholder="请输入" />
<div class="tips" v-if="ratio">{{validateData[0]}}≤额定制冷量/额定功率≤{{validateData[1]}}</div>
<van-field v-model="hyl" v-input.float label="耗用量(t或m3)" type="number" label-width="100" input-align="right" placeholder="请输入" />
<van-field v-model="form.coolCapacity" v-input.floatNo0 label="总额定制冷量(kW)" type="number" required :rules="[{ required: true}]" label-width="120" input-align="right" placeholder="请输入" />
<van-field v-model="form.useYear" label="设备最早投入使用年份" required :rules="[{ required: true, message: '请选择投入年份' }]" label-width="150" is-link input-align="right" placeholder="请输入" readonly @click="handelClickYear('useYear', 'SET_CON_YEAR')" />
<!-- 是否进行过设备改造 -->
<Whether required :rules="[{ required: true, message:'请选择设备改造' }]" :value="formColumns.conEquipModiyName" @onConfirmTrueFalse="onConfirmTrueFalse" feildName="conEquipModiy" special="1" />
<!-- 改造方式 -->
<ModifyMode
v-show="form.conEquipModiy == 1"
:columns="formColumns"
:list="conList"
:form="form"
:type="null"
type1="con"
:required="form.conEquipModiy == 1"
:list1="resultList"
:list2="spliceList"
@onConfirmCheckbox="onConfirmCheckbox"
/>
<van-field v-show="conYear1" v-model="form.conIntellectModifyYear" label="增加主机智能化集中控制系统年份" required :rules="[{ required: conYear1, message:'请选择年份' }]" label-width="220" input-align="right" is-link placeholder="请选择" readonly @click="handelClickYear('conIntellectModifyYear', 'SET_CON_YEAR')" />
<van-field v-show="conYear2" v-model="form.conModifyYear" label="更换高能效设备年份" required :rules="[{ required: conYear2, message:'请选择年份' }]" label-width="140" input-align="right" is-link placeholder="请选择" readonly @click="handelClickYear('conModifyYear', 'SET_CON_YEAR')" />
</van-cell-group>
<div v-if="form.refrigeNum">
<van-cell class="img-box box1" style="padding:10px;" title="设备外观" :required="$store.getters.cityType"/>
<Uploader type="exteriorImage" :value="exteriorImage" style="padding: 0 10px;"
@afterRead="afterRead"
@delImg="delImg"
@onUpload="onUpload" />
<div class="tips tipImage" v-if="$store.getters.cityType&&form.exteriorImage.length<1">请上传设备外观照片</div>
<!-- <div class="picStyle borderBot" :class="{cityType: $store.getters.cityType}">
<div class="title">设备外观</div>
<div class="pic">
<Uploader
type="exteriorImage"
:value="exteriorImage"
@afterRead="afterRead"
@delImg="delImg"
@onUpload="onUpload"
/>
</div>
</div> -->
<div class="picStyle borderBot">
<div class="title">设备铭牌</div>
<div class="pic">
<Uploader
type="tagImage"
:value="tagImage"
@afterRead="afterRead"
@delImg="delImg"
@onUpload="onUpload"
/>
</div>
</div>
<div class="picStyle">
<div class="title">设备能效标识</div>
<div class="pic">
<Uploader
type="markImage"
:value="markImage"
@afterRead="afterRead"
@delImg="delImg"
@onUpload="onUpload"
/>
</div>
</div>
</div>
</div>
</div>
<div :class="form.refrigeNum ? 'search-main' : ''" v-for="item in searchList" :key="item.type">
<div class="focusItem" v-if="form.refrigeNum">
<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>
<!-- <div class="bottom"><van-button type="primary" block>保存</van-button></div> -->
<VanPickerNew :show="show" :columns="list" :loading="loading" @onConfirm="onConfirm" @onCancel="onCancel" />
<Year :show="yearShow" :num="1" @onConfirmYear="onConfirmYear" @onCancelYear="onCancelYear" />
</div>
</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 Uploader from '../common-vue/uploader.vue'
import Radio from '../common-vue/radio.vue'
import { dataMode } from '../common'
import { downloadUrl } from '@/settings'
import { pureDigital } from '../pattern'
import btnUploader from "../common-vue/btnUploader.vue";
export default {
components: {
Year,
ModifyMode,
Whether,
Uploader,
Radio,
VanPickerNew,
btnUploader
},
mixins: [mixin],
data() {
return {
filePic: [],
edgl: "", //额定功率
hyl: "", //耗用量
typeId: this.$route.query.typeId,
show: false,
formColumns: {
conEquipModiyName: '', //改造方式名称
modifyModeName: '',
},
eqid: '',
form: {
modifyMode: '', //改造方式
conEquipModiy: '', //是否进行过设备改造
ratedPower: "",
refrigeNum: '', //空调数量
coolCapacity: '', //总额定制冷量
useYear: '', //设备最早投入使用年份
refrigeType: 8,
conIntellectModifyYear: '', //增加主机智能化集中控制系统年份
conModifyYear: '', //更换高能效设备年份
exteriorImage: '',
tagImage: '',
markImage: '',
},
/**
* 复选框
*/
resultList: [],
spliceList: [],
conList: [{
code: 1,
name: '智能化集中控制',
checked: false,
field: 'conIntellectModifyYear',
},
{
code: 2,
name: '更换高能效设备',
field: 'conModifyYear',
checked: false,
},
],
/**
* 询问
*/
useSearch: {
conEnquireDevIds: '', //设备类
conEnquireIds: '', //运营类
},
searchList: [],
conEnquireDevIdsList: [], //设备类
conEnquireIdsList: [], //运营类
//定时器
edSet: null,
conYear1: false,
conYear2: false,
/**
* 图片
*/
exteriorImage: [],
tagImage: [],
markImage: [],
required: false,
tidCid: null,
validateData: [],
}
},
computed: {
pureDigital() {
return pureDigital
},
showForm() {
if(this.tidCid.taskId) {
return false
}
return true
},
//如果选择为否,携带属性需要删除
notData() {
return {
conEquipModiy: {
formColumnsField: ['modifyModeName'],
formField: ['modifyMode','conIntellectModifyYear','conModifyYear'],
isShow: ['conYear1','conYear2'],
setStore: 'SET_CON_YEAR',
list: this.conList
}
}
},
// 额定制冷量/额定功率
ratio () {
if(this.form.coolCapacity && this.edgl && this.edgl != 0){
let ratioData = this.form.coolCapacity/this.edgl
let data = this.validateData[0] <= ratioData && ratioData <= this.validateData[1]
return !data
}
},
},
created() {
this.tidCid = JSON.parse(sessionStorage.getItem('tidCid'))
if(this.$store.getters.validate){
this.validateData = ['1.35', '10.50']
}else{
this.validateData = ['2.70', '7.0']
}
},
mounted() {
this.$store.commit('pageData/GET_MUL', this.typeId)
this.editData()
},
beforeDestroy() {
clearTimeout(this.edSet)
this.setVuexData()
for (const key in this.form) {
this.form[key] = ''
}
this.hyl = ''
this.edgl = ''
},
methods: {
//修改覆写数据
editData() {
this.edSet = setTimeout(async () => {
//前页面存起来的数据
const data = this.$store.getters.editData
//问询问题
const searchInfo = this.$store.getters.searchInfo
if (searchInfo) {
const res = dataMode(searchInfo['sbktdls'])
this.searchList = res
//运营类
if(data.info.conEnquireIds == '') {
const list1 = res.find((ele)=> ele.type == 1)
const dataList1 = list1.child.map((item)=> item.enquireId)
this.useSearch.conEnquireIds = dataList1.join(',')
this.conEnquireIdsList = dataList1
}
//设备类
if(data.info.conEnquireDevIds == '') {
const list1 = res.find((ele)=> ele.type == 2)
const dataList1 = list1.child.map((item)=> item.enquireId)
this.useSearch.conEnquireDevIds = dataList1.join(',')
this.conEnquireDevIdsList = dataList1
}
this.$store.commit('search/SET_CON', this.useSearch)
}
if (data.pageKey) {
this.resultList = []
this.spliceList = []
this.eqid = data.info.equipId
const kt = data.info.nxzdRefrigeSystemDTO.find(
(v) => v.refrigeType == 8
)
if (kt) {
for (const key in kt) {
for (const keys in this.form) {
if (key == keys) {
this.form[keys] = kt[key]
}
}
}
if(kt.ratedPower) {
this.edgl = kt.ratedPower.split(",")[0];
this.hyl = kt.ratedPower.split(",")[1];
}
console.log(this.edgl, this.hyl);
if (this.form.exteriorImage) {
const list = this.form.exteriorImage.split(',')
this.exteriorImage = list.map((ele) => {
return {
url: `${downloadUrl}${ele}`,
}
})
console.log(this.exteriorImage,'123')
}
if (this.form.tagImage) {
const list = this.form.tagImage.split(',')
this.tagImage = list.map((ele) => {
return {
url: `${downloadUrl}${ele}`,
}
})
console.log(this.tagImage)
}
if (this.form.markImage) {
const list = this.form.markImage.split(',')
this.markImage = list.map((ele) => {
return {
url: `${downloadUrl}${ele}`,
}
})
console.log(this.markImage)
}
} else {
this.form.refrigeNum = ''
this.form.coolCapacity = ''
}
// this.form.refrigeNum = data.info.refrigeNum;
// this.form.coolCapacity = data.info.coolCapacity;
// this.form.useYear = data.info.useYear;
this.form.conIntellectModifyYear = data.info.conIntellectModifyYear
this.form.conModifyYear = data.info.conModifyYear
this.form.conEquipModiy = data.info.conEquipModiy
this.formColumns.conEquipModiyName = data.info.conEquipModiy == 1 ? '是' : '否'
if (data.info.conIntellectModifyYear) {
this.form.conIntellectModifyYear = data.info.conIntellectModifyYear
this.resultList.push({
code: 1,
name: '智能化集中控制',
checked: true,
field: 'conIntellectModifyYear',
})
}
if (data.info.conModifyYear) {
this.form.conModifyYear = data.info.conModifyYear
this.resultList.push({
code: 2,
name: '更换高能效设备',
field: 'conModifyYear',
checked: true,
})
}
if (!data.info.conIntellectModifyYear) {
this.form.conIntellectModifyYear = data.info.conIntellectModifyYear
this.spliceList.push({
code: 1,
name: '智能化集中控制',
checked: false,
field: 'conIntellectModifyYear',
})
}
if (!data.info.conModifyYear) {
this.form.conModifyYear = data.info.conModifyYear
this.spliceList.push({
code: 2,
name: '更换高能效设备',
field: 'conModifyYear',
checked: false,
})
}
// this.conList = this.resultList;
this.conList.forEach((v) => {
v.checked = false
this.resultList.forEach((ev) => {
if (v.code == ev.code) {
v.checked = true
}
})
})
const name = this.resultList.map((ele) => ele.name)
const id = this.resultList.map((ele) => ele.code)
const checkboxInfo = {
name,
id,
result: this.resultList,
}
this.onConfirmCheckbox(checkboxInfo)
/**
* 询问回显
*/
//设备类
if (data.info.conEnquireDevIds && this.searchList.length > 0) {
const devList = data.info.conEnquireDevIds.split(',')
this.useSearch.conEnquireDevIds = data.info.conEnquireDevIds
this.conEnquireDevIdsList = devList
this.searchList[1].child.forEach((ele) => {
ele.color = false
devList.forEach((item) => {
if (item == ele.enquireId) {
ele.color = true
}
})
})
}
//运营类
if (data.info.conEnquireIds && this.searchList.length > 0) {
const devList = data.info.conEnquireIds.split(',')
this.useSearch.conEnquireIds = data.info.conEnquireIds
this.conEnquireIdsList = 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_CON', this.useSearch)
return
}
}, 200)
},
setVuexData() {
this.$store.commit('pageData/CURRENT_CON_DATA', this.$data)
},// 上传图片调用原生的方法 获取到绝对路径调用getImageFileFromUrl
onUpload1 (data) {
console.log(data);
this.form.coolCapacity = data.coolCapacity
this.edgl = parseFloat(data.ratedPower)
},
delImg1() {
this.filePic = []
const list = this.delIsObj(this.filePic)
this.filePic = list.join(',')
},
// 图片处理
afterRead1(data) {
this.form.coolCapacity = data.coolCapacity
this.edgl = parseFloat(data.ratedPower)
console.log(this.form);
// this.filePic.push(data.attach_id);
},
//安卓会调用的方法
onUpload(data, type) {
console.log('安卓进');
this.ifType(data, type, 1)
},
//浏览器 ios 会走这个方法
afterRead(data, type) {
console.log('浏览器ios');
this.ifType(data, type, 2)
},
//判断type
ifType(data, type, num) {
if(num == 1) {
if (type == 'exteriorImage') {
this.exteriorImage.push(data.attach_id)
// const list = this.ifObj(this.exteriorImage)
this.form.exteriorImage = this.exteriorImage
this.form.exteriorImage.pop()
}
if (type == 'tagImage') {
this.tagImage.push(data.attach_id)
// const list = this.tagImage.join(',')
this.form.tagImage = this.tagImage
this.form.tagImage.pop()
}
if (type == 'markImage') {
this.markImage.push(data.attach_id)
// const list = this.ifObj(this.markImage)
this.form.markImage = this.markImage
this.form.markImage.pop()
}
} else {
if (type == 'exteriorImage') {
this.exteriorImage.push(data.attach_id)
// const list = this.ifObj(this.exteriorImage)
this.form.exteriorImage = this.exteriorImage
}
if (type == 'tagImage') {
this.tagImage.push(data.attach_id)
// const list = this.tagImage.join(',')
this.form.tagImage = this.tagImage
}
if (type == 'markImage') {
this.markImage.push(data.attach_id)
// const list = this.ifObj(this.markImage)
this.form.markImage = this.markImage
}
}
},
//判断是否为对象格式
ifObj(imgList) {
imgList.forEach((v) => {
if(v instanceof Object && v.url.split('download/').length > 1) {
v.url = v.url.split('download/')[1]
}
})
const list = imgList.map((ele)=>{
if(ele instanceof Object) {
return ele.url
}
return ele
})
return list
},
delImg(data, info, type) {
this[type] = []
if (type == 'exteriorImage') {
const list = this.delIsObj(this.exteriorImage)
this.form.exteriorImage = list.join(',')
}
if (type == 'tagImage') {
const list = this.delIsObj(this.tagImage)
this.form.tagImage = list.join(',')
}
if (type == 'markImage') {
const list = this.delIsObj(this.markImage)
this.form.markImage = list.join(',')
}
},
//判断删除的list中是否为对象格式
delIsObj(delList) {
const list = delList.map((ele) => {
if(ele instanceof Object) {
return ele.url
}
return ele
})
return list
},
//询问选择为是
handelClickOk(ele, i) {
if(this.showForm) {
return
}
if (ele.enquireType == '2' && !ele.color) {
// const index = this.conEnquireDevIdsList.findIndex((v) => {
// return v == 0
// })
this.conEnquireDevIdsList.splice(i-1, 1, ele.enquireId)
ele.color = true
}
if (ele.enquireType == '1' && !ele.color) {
// const index = this.conEnquireIdsList.findIndex((v) => {
// return v == 0
// })
this.conEnquireIdsList.splice(i-1, 1, ele.enquireId)
ele.color = true
}
this.useSearch.conEnquireDevIds = this.conEnquireDevIdsList.join(',')
this.useSearch.conEnquireIds = this.conEnquireIdsList.join(',')
this.$store.commit('search/SET_CON', this.useSearch)
},
//询问选择为否
handelClickNo(ele, list) {
if(this.showForm) {
return
}
if (ele.enquireType == '2' && ele.color) {
const index = this.conEnquireDevIdsList.findIndex((v) => v == ele.enquireId )
if(index == -1) {
this.conEnquireDevIdsList = list.map((item)=> {
if(ele.enquireId == item.enquireId) {
return item.noId
}
return item.enquireId
})
this.useSearch.conEnquireDevIds = this.conEnquireDevIdsList.join(',')
const elseItem = this.searchList.find((ele)=> ele.type == '1')
this.useSearch.conEnquireIds = elseItem.child.map((ele)=> {
if(ele.color) {
return ele.enquireId
} else {
return ele.noId
}
}).join(',')
ele.color = false
} else {
this.conEnquireDevIdsList.splice(index, 1, ele.noId)
this.useSearch.conEnquireDevIds = this.conEnquireDevIdsList.join(',')
const elseItem = this.searchList.find((ele)=> ele.type == '1')
this.useSearch.conEnquireIds = 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.conEnquireIdsList.findIndex((v) => v == ele.enquireId )
if(index == -1) {
this.conEnquireIdsList = list.map((item)=> {
if(ele.enquireId == item.enquireId) {
return item.noId
}
return item.enquireId
})
this.useSearch.conEnquireIds = this.conEnquireIdsList.join(',')
const elseItem = this.searchList.find((ele)=> ele.type == '2')
this.useSearch.conEnquireDevIds = elseItem.child.map((ele)=> {
if(ele.color) {
return ele.enquireId
} else {
return ele.noId
}
}).join(',')
ele.color = false
} else {
this.conEnquireIdsList.splice(index, 1, ele.noId)
this.useSearch.conEnquireIds = this.conEnquireIdsList.join(',')
const elseItem = this.searchList.find((ele)=> ele.type == '2')
this.useSearch.conEnquireDevIds = elseItem.child.map((ele)=> {
if(ele.color) {
return ele.enquireId
} else {
return ele.noId
}
}).join(',')
ele.color = false
}
}
this.$store.commit('search/SET_CON', this.useSearch)
},
//点击改造方式确认
onConfirmCheckbox(data) {
this.conYear1 = false
this.conYear2 = false
this.conList.forEach((v)=> {
if(!v.checked && v.code == 1) {
// this.conYear1 = false
this.form.conIntellectModifyYear = ''
}
if(!v.checked && v.code == 2) {
// this.conYear2 = false
this.form.conModifyYear = ''
}
})
this.$store.commit('search/SET_CON_YEAR', this.form)
data.id.forEach((v) => {
if (v == 1) {
this.conYear1 = true
}
if (v == 2) {
this.conYear2 = 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';
.multipleAir {
// padding: 0 20px;
box-sizing: border-box;
.bottom {
margin-top: 20px;
border-radius: 10px;
overflow: auto;
}
.inputStyle {
border-radius: 8px;
overflow: auto;
background: #fff;
}
.picStyle {
padding: 10px 10px;
.title {
margin-bottom: 10px;
color: #000;
span {
color: red;
}
}
}
}
.focusItem {
padding: 0 20px;
border-radius: 8px;
overflow: auto;
.addTitleLeft {
flex: 0 0 220px;
}
}
.borderBot {
position: relative;
&::after {
position: absolute;
box-sizing: border-box;
content: ' ';
pointer-events: none;
right: 0.426667rem;
bottom: 0;
left: 0.426667rem;
border-bottom: 0.026667rem solid #ebedf0;
-webkit-transform: scaleY(0.5);
transform: scaleY(0.5);
}
}
.valueColor {
color: #000;
}
.remould {
flex: 0 0 80px;
}
.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;
}
.tipImage{
justify-content: flex-start
}
.list-upload{
/deep/.van-button {
background: #34baae;
border-radius: 0.266667rem;
}
/deep/.van-uploader{
width: 100%;
.van-uploader__input-wrapper{
width: 100%;
}
}
}
</style>
@@ -0,0 +1,137 @@
<template>
<div class="refrigeration">
<!-- <ul class="head-tab">
<li v-for="(item, index) in tabNav" :key="index + item.templateName" @click="handelClickTab(item, item.title)">
<span :class="item.color ? 'on' : 'normalColor'">{{ item.title }}</span>
</li>
</ul> -->
<div class="main">
<!-- <keep-alive> -->
<component :is="active" ref="rigerRef" :ktLqt="ktLqt" />
<!-- </keep-alive> -->
</div>
</div>
</template>
<script>
import focusAir from './focusAir.vue'
import multipleAir from './multipleAir.vue'
import fissionAir from './fissionAir.vue'
export default {
components: {
focusAir,
multipleAir,
fissionAir,
},
props: {
value: {
type: String,
default: ''
}
},
data() {
return {
active: 'focusAir',
searchData:{},
form: [],
form1: {},
form2: {},
form3: {},
userSearch: {
/**
* 集中空调询问
*/
cenEnquireDevIds: '',
cenEnquireIds: '',
/**
*多联空调询问
*/
},
page: {
name: '空调制冷系统',
title: 'refrigeration',
},
tabNav: [
{ title: '集中式空调', templateName: 'focusAir', color: true },
{ title: '多联式空调', templateName: 'multipleAir', color: false },
{ title: '分体式空调', templateName: 'fissionAir', color: false },
],
ktLqt: {
kt: [],
lqt: [],
},
}
},
watch: {
'searchInfo': {
handler(newVal){
this.searchData = newVal
},
deep: true,
immediate: true
}
// searchInfo:function(newVal){
// console.log(newVal,'23333');
// }
},
created() {
this.active = this.value
},
mounted() {
},
methods: {},
}
</script>
<style lang="less" scoped>
.refrigeration {
padding: 20px;
display: flex;
flex-direction: column;
overflow: auto;
}
.head-tab {
width: 100%;
display: flex;
height: 40px;
align-items: center;
justify-content: space-around;
border-radius: 10px;
background: #fff;
box-shadow: 0rem 0.02rem 0.2rem 0.1rem rgba(52, 186, 174, 0.2);
margin-bottom: 20px;
>li {
>span {
color: #989898;
}
>.on {
background: #34baae;
color: #fff;
padding: 0.25rem 0.5rem;
box-sizing: border-box;
border-radius: 0.2rem; // transform: translateX(135px) translateX(-50%);
transition-duration: 0.35s;
}
}
}
.main {
// flex: 1;
// height: calc(100vh - 40px);
overflow: auto;
}
// /deep/ .van-tab__text--ellipsis {
// color: #989898;
// }
// /deep/ .van-tabs__nav--card {
// border-radius: 10px;
// margin: 0;
// overflow: auto;
// padding: 10px;
// box-sizing: border-box;
// }
</style>
+745
View File
@@ -0,0 +1,745 @@
<template>
<van-form ref="form" :disabled="showForm" @submit="handelClickSave">
<Loading :loading="loading" />
<div class="facility">
<div class="container">
<div class="tabContent">
<component v-if="searchInfo" :is="activated" ref="component" />
</div>
</div>
<div class="footer-btn">
<van-button :disabled="showForm" native-type="submit">提交</van-button>
</div>
</div>
</van-form>
</template>
<script>
import Header from '@/components/headerNew'
import focusAir from './components/focusAir.vue'
import multipleAir from './components/multipleAir.vue'
import fissionAir from './components/fissionAir.vue'
import heating from './components/heatingSystem.vue'
import illumination from './components/illuminationSystem.vue'
import distribution from './components/distributionSystem.vue'
import hotWater from './components/hotWaterSystem.vue'
// import { getCodeCommon } from '@/views/facilityManage/common'
import Loading from '@/components/loading'
import { Notify } from "vant";
import { getEnergyEquip, editEnergyEquip } from '@/api/energyConsumption'
export default {
name: 'facilityManage',
components: {
Header,
focusAir,
multipleAir,
fissionAir,
heating,
Loading,
illumination,
distribution,
hotWater,
},
beforeRouteEnter(to, from, next) {
next((vm) => {
if(from.name =='TaskFilling'){
vm.isReload = false
}else{
vm.isReload = true
}
vm.parentPath = from.path
sessionStorage.setItem('facilityManageParPath', from.path)
vm.title = to.meta.title
})
},
data() {
return {
title: '用能设备信息',
parentPath: '',
tabNavTitle: [
{ title: '空调-集中式', templateName: 'focusAir' },
{ title: '空调-多联式', templateName: 'multipleAir' },
{ title: '空调-分体式', templateName: 'fissionAir' },
{ title: '采暖系统', templateName: 'heating' },
{ title: '照明系统', templateName: 'illumination' },
{ title: '配电系统', templateName: 'distribution' },
{ title: '生活热水系统', templateName: 'hotWater' },
],
commonForm: {
nxzdRefrigeSystemDTO: [], //空调信息
nxzdHeatSystemDTO: [], //采暖系统信息
nxzdLightSystemDTO: {}, //照明系统信息
nxzdDistributeSystemDTO: {}, //配电系统
nxzdHotWaterSystemDTO: {}, //生活热水系统信息
nxzdUseEnergyEquipDTO: {
buildId: '', //建筑id
consId: '', //客户编码
equipId: '', //用能设备id
// operDetailCode:'', // 展示九宫格图标的code
/**
* 集中式空调
*/
cenEnquireDevIds: '', //设备类
cenEnquireIds: '', //运营类
cenEquipModiy: '', //是否改造
cenIntellectModifyYear: '', //集中控制系统改造年份
cenModifyYear: '', //更换高能效设备改造年份
cenWaterModifyYear: '', //水泵增加智能变频控制改造年份
/**
* 多联式空调
*/
conEnquireDevIds: '', //设备类
conEnquireIds: '', //运营类
conEquipModiy: '', //是否改造
conIntellectModifyYear: '', //智能化集中改造年份
conModifyYear: '', //更换高能效设备改造年份
/**
* 用能设备明细
*/
// operDetailCode: '', // 用能设备明细类型编号用逗号隔开
/**
* 配电系统
*/
distributeEnquireDevIds: '', //设备类
distributeEnquireIds: '', //运营类
/**
* 采暖系统
*/
heatEnquireDevIds: '', //设备类
heatEnquireIds: '', //运营类
heatEquipModiy: '', //是否改造
heatMode: '', //采暖方式
heatIntellectModifyYear: '', //智能化集中改造年份
heatModifyYear: '', //更换高能效设备改造年份
heatType: '', //采暖设备类型
/**
* 生活热水
*/
hotWaterEnquireDevIds: '', //设备类
hotWaterEnquireIds: '', //运营类
/**
* 照明系统
*/
lightEnquireDevIds: '', //设备类
lightEnquireIds: '', //运营类
/**
* 输送泵组
*/
pumpNum: '', // 输送泵组台数
pumpTotalPower: '', //输送泵组总功率
pumpYear: '', // 输送泵组设备年份
}, //用能设备闻询问类
operDetailCode: ''
},
activated:'refrigeration',
active: '',
changeTitle: '空调制冷系统',
searchInfo: {},
pageType: '',
pageKey: false,
loading: false,
flag: 0,
operDetailCode: [],
tidCid: null,
isReload: false,
}
},
computed: {
showForm() {
if(this.tidCid.taskId) {
return false
}
return true
},
},
created() {
this.activated = this.$route.query.id
this.tidCid = JSON.parse(sessionStorage.getItem('tidCid'))
},
mounted() {
this.getCustomerInfo()
},
beforeDestroy() {
console.log('beforeDestroy');
this.resetData();
},
methods: {
//获取当前用户是否存在用能设备
async getCustomerInfo() {
this.loading = true
try {
let id = JSON.parse(sessionStorage.getItem('tidCid')).equipId||sessionStorage.getItem('equipId')
const res = await getEnergyEquip({equipId: id})
if (res.code == 0) {
if (res.data.equipId) {
// this.commonForm.nxzdUseEnergyEquipDTO.equipId = res.data.equipId;
this.pageKey = true
for (const keys in this.commonForm) {
for (const key in res.data) {
if (keys == key) {
this.commonForm[keys] = res.data[key]
} else {
for (const valKey in this.commonForm.nxzdUseEnergyEquipDTO) {
if (valKey == key) {
this.commonForm.nxzdUseEnergyEquipDTO[valKey] =
res.data[key]
}
}
}
}
}
if (res.data.nxzdRefrigeSystemDTO && this.parentPath.split('/facilityManage').length < 2) {
let str1 = "1,2,3,4"
let str2 = "5,6,7"
var ktArr = res.data.nxzdRefrigeSystemDTO.filter((item)=> str1.indexOf(item.refrigeType) != -1)
var lqArr = res.data.nxzdRefrigeSystemDTO.filter((item)=> str2.indexOf(item.refrigeType) != -1)
this.$store.dispatch('saveList/getAir', ktArr)
this.$store.dispatch('saveList/getCoo', lqArr)
}
if (res.data.nxzdHeatSystemDTO && this.parentPath.split('/facilityManage').length < 2) {
this.$store.dispatch('saveList/getHea', res.data.nxzdHeatSystemDTO)
}
const data = {
info: res.data,
pageKey: this.pageKey,
}
this.$store.commit('pageData/GET_EDITDATA', data)
this.$store.commit('search/SET_FACIL', data)
if(this.isReload) return
for (const key in res.data) {
for (const keys in this.$store.state.search) {
if (key == keys) {
console.log(keys, 'keys');
this.$store.state.search[keys] = res.data[key]
}
}
}
} else {
this.resetData()
}
}
} finally {
this.loading = false
}
},
//清空数据
resetData() {
this.pageKey = false
if (this.$route.name == 'customerIformation' || this.$route.name == 'taskFilling') {
sessionStorage.removeItem('arrCn')
sessionStorage.removeItem('ktArr')
sessionStorage.removeItem('lqArr')
sessionStorage.removeItem('arrList')
sessionStorage.removeItem('arrList2')
sessionStorage.removeItem('arrList3')
sessionStorage.removeItem('arrKtList')
sessionStorage.removeItem('burstingDetail')
sessionStorage.removeItem('routerData')
sessionStorage.removeItem('currentJZId')
sessionStorage.removeItem('heatCnLx')
sessionStorage.removeItem('rsModifyName')
sessionStorage.removeItem('zmModifyName')
sessionStorage.removeItem('pdModifyName')
}
sessionStorage.removeItem('facilityManageParPath')
const bid = JSON.parse(sessionStorage.getItem('tidCid')).buildId
const cid = JSON.parse(sessionStorage.getItem('tidCid')).customerId
this.$store.commit('pageData/GET_FOC', '')
this.$store.commit('pageData/GET_MUL', '')
this.$store.commit('pageData/GET_FIS', '')
this.$store.commit('pageData/GET_HET', '')
this.$store.commit('pageData/GET_DIS', '')
this.$store.commit('pageData/GET_ILL', '')
this.$store.commit('pageData/GET_HOT', '')
this.commonForm.nxzdRefrigeSystemDTO = [] //空调信息
this.commonForm.nxzdHeatSystemDTO = [] //采暖系统信息
this.commonForm.nxzdLightSystemDTO = {} //照明系统信息
this.commonForm.nxzdDistributeSystemDTO = {} //配电系统
this.commonForm.nxzdHotWaterSystemDTO = {} //生活热水系统信息
//用能设备闻询问类
this.commonForm.nxzdUseEnergyEquipDTO = {
buildId: bid ? bid : '', //建筑id
consId: cid ? cid : '', //客户编码
equipId: this.$store.getters.editData.equipId,
/**
* 集中式空调
*/
cenEnquireDevIds: '', //设备类
cenEnquireIds: '', //运营类
cenEquipModiy: '', //是否改造
cenIntellectModifyYear: '', //集中控制系统改造年份
cenModifyYear: '', //更换高能效设备改造年份
cenWaterModifyYear: '', //水泵增加智能变频控制改造年份
/**
* 多联式空调
*/
conEnquireDevIds: '', //设备类
conEnquireIds: '', //运营类
conEquipModiy: '', //是否改造
conIntellectModifyYear: '', //智能化集中改造年份
conModifyYear: '', //更换高能效设备改造年份
/**
* 用能设备明细
*/
/**
* 配电系统
*/
distributeEnquireDevIds: '', //设备类
distributeEnquireIds: '', //运营类
/**
* 采暖系统
*/
heatEnquireDevIds: '', //设备类
heatEnquireIds: '', //运营类
heatEquipModiy: '', //是否改造
heatMode: '', //采暖方式
heatIntellectModifyYear: '', //智能化集中改造年份
heatModifyYear: '', //更换高能效设备改造年份
heatType: '', //采暖设备类型
/**
* 生活热水
*/
hotWaterEnquireDevIds: '', //设备类
hotWaterEnquireIds: '', //运营类
/**
* 照明系统
*/
lightEnquireDevIds: '', //设备类
lightEnquireIds: '', //运营类
/**
* 输送泵组
*/
pumpNum: '', // 输送泵组台数
pumpTotalPower: '', //输送泵组总功率
pumpYear: '', // 输送泵组设备年份
}
this.commonForm.operDetailCode = '' // 用能设备明细类型编号用逗号隔开
},
//点击保存
async handelClickSave() {
let flag = 0
const title = this.$route.query.id
switch (title) {
case 'focusAir':
// eslint-disable-next-line no-case-declarations
const kt = this.$store.getters.airConditioningUnitList
// eslint-disable-next-line no-case-declarations
const lq = this.$store.getters.coolingTowerUnitList
// eslint-disable-next-line no-case-declarations
const conList = this.commonForm.nxzdRefrigeSystemDTO.find((ele)=> ele.refrigeType == 8)
// eslint-disable-next-line no-case-declarations
const fisList = this.commonForm.nxzdRefrigeSystemDTO.find((ele)=> ele.refrigeType == 9)
if(conList && fisList) {
this.commonForm.nxzdRefrigeSystemDTO = kt.concat(lq, conList, fisList)
} else if(conList) {
this.commonForm.nxzdRefrigeSystemDTO = kt.concat(lq, conList)
} else if(fisList) {
this.commonForm.nxzdRefrigeSystemDTO = kt.concat(lq, fisList)
} else {
this.commonForm.nxzdRefrigeSystemDTO = kt.concat(lq)
}
this.commonForm.operDetailCode = '1'
break;
case 'multipleAir':
// eslint-disable-next-line no-case-declarations
if(this.$refs.component.ratio||(this.$store.getters.cityType&&this.$refs.component.exteriorImage.length<1)){
return
}
const index1 = this.commonForm.nxzdRefrigeSystemDTO.findIndex((ele)=> ele.refrigeType == 8)
// this.commonForm.nxzdRefrigeSystemDTO.concat([this.$refs.component.form])
this.$refs.component.form.ratedPower = this.$refs.component.edgl + "," + this.$refs.component.hyl
if(index1 == -1) {
this.commonForm.nxzdRefrigeSystemDTO.push(this.$refs.component.form)
} else {
this.commonForm.nxzdRefrigeSystemDTO[index1] = this.$refs.component.form
}
this.commonForm.operDetailCode = '8'
break;
case 'fissionAir':
// eslint-disable-next-line no-case-declarations
const index2 = this.commonForm.nxzdRefrigeSystemDTO.findIndex((ele)=> ele.refrigeType == 9)
// this.commonForm.nxzdRefrigeSystemDTO.concat([this.$refs.component.form])
if(index2 == -1) {
this.commonForm.nxzdRefrigeSystemDTO.push(this.$refs.component.form)
} else {
this.commonForm.nxzdRefrigeSystemDTO[index2] = this.$refs.component.form
}
this.commonForm.operDetailCode = '9'
break;
case 'heating':
// // eslint-disable-next-line no-case-declarations
// const cn = this.$store.getters.heatingUnitList
// console.log(cn);
// eslint-disable-next-line no-case-declarations
const heatObj = this.$refs.component
// eslint-disable-next-line no-case-declarations
const heatRes = await this.flagNo(heatObj.$refs.heat)
flag = heatRes
this.commonForm.operDetailCode = '2'
break;
case 'distribution':
// eslint-disable-next-line no-case-declarations
const disObj = this.$refs.component
this.commonForm.nxzdDistributeSystemDTO = this.$refs.component.form
if(disObj.tips0){
return
}
// eslint-disable-next-line no-case-declarations
const disRes = await this.flagNo(disObj.$refs.dis)
flag = disRes
this.commonForm.operDetailCode = '4'
break;
case 'illumination':
// eslint-disable-next-line no-case-declarations
const illObj = this.$refs.component
this.commonForm.nxzdLightSystemDTO = this.$refs.component.form
// eslint-disable-next-line no-case-declarations
const illRes = await this.flagNo(illObj.$refs.ill)
flag = illRes
this.commonForm.operDetailCode = '3'
break;
case 'hotWater':
// eslint-disable-next-line no-case-declarations
const hotObj = this.$refs.component
this.commonForm.nxzdHotWaterSystemDTO = this.$refs.component.form
if(hotObj.tips0){
return
}
// eslint-disable-next-line no-case-declarations
const hotRes = await this.flagNo(hotObj.$refs.hot)
flag = hotRes
this.commonForm.operDetailCode = '5'
break;
default:
break;
}
const store = this.$store.getters
//获取建筑id和客户id
const data = this.$store.getters.editData
const buildId = JSON.parse(sessionStorage.getItem('tidCid')).buildId
const customerId = JSON.parse(sessionStorage.getItem('tidCid')).customerId
const equipId = data ? data.info.equipId : null
this.commonForm.nxzdUseEnergyEquipDTO.buildId = buildId
this.commonForm.nxzdUseEnergyEquipDTO.consId = customerId
this.commonForm.nxzdUseEnergyEquipDTO.equipId = equipId
//采暖系统添加equipid
this.commonForm.nxzdHeatSystemDTO.forEach((v)=> {
v.equipId = equipId
})
const jzsList = this.commonForm.nxzdRefrigeSystemDTO.filter((ele)=> ele.refrigeType != 8 && ele.refrigeType != 9)
jzsList.forEach((v)=> {
v.equipId = equipId
})
/**
* 配电系统
*/
this.commonForm.nxzdUseEnergyEquipDTO.distributeEnquireDevIds = store.distributeEnquireDevIds
this.commonForm.nxzdUseEnergyEquipDTO.distributeEnquireIds = store.distributeEnquireIds
/**
* 照明系统
*/
this.commonForm.nxzdUseEnergyEquipDTO.lightEnquireDevIds = store.lightEnquireDevIds
this.commonForm.nxzdUseEnergyEquipDTO.lightEnquireIds = store.lightEnquireIds
/**
* 生活热水
*/
this.commonForm.nxzdUseEnergyEquipDTO.hotWaterEnquireDevIds = store.hotWaterEnquireDevIds
this.commonForm.nxzdUseEnergyEquipDTO.hotWaterEnquireIds = store.hotWaterEnquireIds
/**
* 采暖
*/
this.commonForm.nxzdUseEnergyEquipDTO.heatEnquireDevIds = store.heatEnquireDevIds
this.commonForm.nxzdUseEnergyEquipDTO.heatEnquireIds = store.heatEnquireIds
this.commonForm.nxzdUseEnergyEquipDTO.heatIntellectModifyYear = store.heatIntellectModifyYear
this.commonForm.nxzdUseEnergyEquipDTO.heatModifyYear = store.heatModifyYear
this.commonForm.nxzdUseEnergyEquipDTO.pumpYear = store.pumpYear
this.commonForm.nxzdUseEnergyEquipDTO.heatEquipModiy = store.heatEquipModiy
this.commonForm.nxzdUseEnergyEquipDTO.heatType = store.heatType
this.commonForm.nxzdUseEnergyEquipDTO.heatMode = store.heatMode
this.commonForm.nxzdUseEnergyEquipDTO.pumpTotalPower = store.pumpTotalPower
this.commonForm.nxzdUseEnergyEquipDTO.pumpNum = store.pumpNum
this.commonForm.nxzdHeatSystemDTO = this.$store.getters.heatingUnitList
/**
*集中式空调
*/
console.log(store, 'pppppppppppppppppppp', store.cenEnquireIds);
this.commonForm.nxzdUseEnergyEquipDTO.cenEnquireIds = store.cenEnquireIds
this.commonForm.nxzdUseEnergyEquipDTO.cenEnquireDevIds = store.cenEnquireDevIds
this.commonForm.nxzdUseEnergyEquipDTO.cenEquipModiy = store.cenEquipModiy
this.commonForm.nxzdUseEnergyEquipDTO.cenIntellectModifyYear = store.cenIntellectModifyYear
this.commonForm.nxzdUseEnergyEquipDTO.cenModifyYear = store.cenModifyYear
this.commonForm.nxzdUseEnergyEquipDTO.cenWaterModifyYear = store.cenWaterModifyYear
/**
*多联式空调
*/
this.commonForm.nxzdUseEnergyEquipDTO.conEnquireDevIds = store.conEnquireDevIds
this.commonForm.nxzdUseEnergyEquipDTO.conEnquireIds = store.conEnquireIds
this.commonForm.nxzdUseEnergyEquipDTO.conIntellectModifyYear = store.conIntellectModifyYear
this.commonForm.nxzdUseEnergyEquipDTO.conEquipModiy = store.conEquipModiy
this.commonForm.nxzdUseEnergyEquipDTO.conModifyYear = store.conModifyYear
// console.log(this.$store.getters.operDetailCode,66666);
// const list = []
console.log(this.$store.getters.foc);
// if(this.$store.getters.foc) {
// this.commonForm.operDetailCode = this.$store.getters.foc
// }
// if(this.$store.getters.mul) {
// this.commonForm.operDetailCode = this.$store.getters.mul
// }
// if(this.$store.getters.fis) {
// this.commonForm.operDetailCode = this.$store.getters.fis
// }
// if(this.$store.getters.het) {
// this.commonForm.operDetailCode = this.$store.getters.het
// }
// if(this.$store.getters.dis) {
// this.commonForm.operDetailCode = this.$store.getters.dis
// }
// if(this.$store.getters.ill) {
// this.commonForm.operDetailCode = this.$store.getters.ill
// }
// if(this.$store.getters.hot) {
// this.commonForm.operDetailCode = this.$store.getters.hot
// }
this.ifObj()
for (const key in this.commonForm) {
if (this.commonForm[key] instanceof Array) {
this.commonForm[key].forEach((v) => {
for (const keys in v) {
if (keys == 'changeTime') {
delete v['changeTime']
}
if (keys == 'changeUser') {
delete v['changeUser']
}
}
})
} else {
for (const val in this.commonForm[key]) {
if (val == 'changeTime') {
delete this.commonForm[key]['changeTime']
}
if (val == 'changeUser') {
delete this.commonForm[key]['changeUser']
}
}
}
}
console.log(this.commonForm, flag, this.pageKey);
if (flag == 0) {
if (this.pageKey) {
const res = await editEnergyEquip(this.commonForm)
if (res.code == 0) {
const takPath = store.takPath.path ? store.takPath.path : JSON.parse(sessionStorage.getItem('goPage')).path
this.$router.push(takPath)
sessionStorage.setItem('goBack', '')
this.actived = 'refrigeration'
this.active = 'refrigeration'
Notify({ type: "success", background: '#34baae', message: "修改成功" });
this.getCustomerInfo()
this.resetData();
} else {
Notify({ type: "danger", message: res.msg });
}
}
}
},
flagNo(val) {
return new Promise((resolve) => {
val.validate().then(() => {
resolve(0)
}).catch((e) => {
resolve(e.length)
})
})
},
//判断是否为对象格式
ifObj() {
if(this.commonForm.nxzdRefrigeSystemDTO.length > 0) {
this.commonForm.nxzdRefrigeSystemDTO.forEach((v) => {
if (v.exteriorImage && v.exteriorImage instanceof Array) {
v.exteriorImage.forEach((ev) => {
if (ev.url && ev.url.split('download/').length > 1) {
ev.url = ev.url.split('download/')[1]
}
})
const list = v.exteriorImage.map((ele) => {
if (ele instanceof Object) {
return ele.url
}
return ele
})
v.exteriorImage = list.join(',')
}
if (v.tagImage && v.tagImage instanceof Array) {
v.tagImage.forEach((ev) => {
if (ev.url && ev.url.split('download/').length > 1) {
ev.url = ev.url.split('download/')[1]
}
})
const list1 = v.tagImage.map((ele) => {
if (ele instanceof Object) {
return ele.url
}
return ele
})
v.tagImage = list1.join(',')
}
if (v.markImage && v.markImage instanceof Array) {
v.markImage.forEach((ev) => {
if (ev.url && ev.url.split('download/').length > 1) {
ev.url = ev.url.split('download/')[1]
}
})
const list2 = v.markImage.map((ele) => {
if (ele instanceof Object) {
return ele.url
}
return ele
})
v.markImage = list2.join(',')
}
})
}
if(this.commonForm.nxzdHeatSystemDTO.length > 0) {
this.commonForm.nxzdHeatSystemDTO.forEach((v)=> {
if (v.exteriorImage && v.exteriorImage instanceof Array) {
v.exteriorImage.forEach((ev) => {
if (ev.url && ev.url.split('download/').length > 1) {
ev.url = ev.url.split('download/')[1]
}
})
const list = v.exteriorImage.map((ele) => {
if (ele instanceof Object) {
return ele.url
}
return ele
})
v.exteriorImage = list.join(',')
}
if (v.tagImage && v.tagImage instanceof Array) {
v.tagImage.forEach((ev) => {
if (ev.url && ev.url.split('download/').length > 1) {
ev.url = ev.url.split('download/')[1]
}
})
const list1 = v.tagImage.map((ele) => {
if (ele instanceof Object) {
return ele.url
}
return ele
})
v.tagImage = list1.join(',')
}
if (v.markImage && v.markImage instanceof Array) {
v.markImage.forEach((ev) => {
if (ev.url && ev.url.split('download/').length > 1) {
ev.url = ev.url.split('download/')[1]
}
})
const list2 = v.markImage.map((ele) => {
if (ele instanceof Object) {
return ele.url
}
return ele
})
v.markImage = list2.join(',')
}
})
}
},
},
}
</script>
<style lang="less" scoped>
.facility {
background: #f6f6f6;
padding-top: 10px;
}
/deep/ .van-icon-arrow-left {
font-size: 20px;
color: #111;
}
// /deep/ .van-nav-bar__title {
// font-size: 20px;
// color: #111;
// }
/deep/ .van-tabs__line {
height: 1.4px;
width: 60px;
}
.button-save {
color: #34baae;
font-size: 16px;
}
/deep/ .van-field__label {
color: #333;
}
/deep/ .van-tabs__content {
background: #f6f6f6;
}
.container {
height: calc(100vh - 60px);
overflow-y: auto;
.tabContent {
height: calc(100vh - 100px);
overflow: auto;
}
}
.footer-btn {
height: 35px;
padding: 0 0.4rem;
/deep/ .van-button {
width: 100%;
background: #34baae;
border-radius: 10px;
line-height: 35px;
text-align: center;
color: #fff;
}
}
</style>
+4
View File
@@ -0,0 +1,4 @@
//正则校验
// 数字
export const pureDigital = /^(\d)$/;