能效诊断

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
+579
View File
@@ -0,0 +1,579 @@
<template>
<div>
<!-- <van-nav-bar title="数据采集" @click-left="onClickLeft" left-arrow /> -->
<div id="dadaAcquisition">
<div class="header">
<div class="header-name">
<img src="@/assets/TaskFilling1.png" alt="" /> {{ info.customerName|| info.consName }}
</div>
<div class="header-address">
<img src="@/assets/TaskFilling2.png" alt="" />
<div class="address-warp">地址: {{ info.detailAddress|| info.elecAddr }}</div>
</div>
<div class="header-title">{{ typeName }}</div>
</div>
<div class="main1">
<div class="main1-name">
<div class="line"></div>
能源管理
</div>
<div class="main1-content" @click="EnergyManagement">
<img src="@/assets/gyqy/one.png" alt="" />
<div class="main1-content-text">能源管理</div>
</div>
</div>
<div class="main1">
<div class="main1-name">
<div class="line"></div>
企业用能
</div>
<div class="main1-content" @click="enterpriseenergy">
<img src="@/assets/gyqy/two.png" alt="" />
<div class="main1-content-text">企业用能</div>
</div>
</div>
<div class="main2">
<div class="main2-name">
<div class="line"></div>
企业通用能源
</div>
<div class="main2-flex">
<div
class="main2-content"
v-for="(item, index) in showList"
:key="index"
>
<img :src="item.icon" alt="" @click="toGeneral(item.url)" />
<div class="main2-content-text" @click="toGeneral(item.url)">
{{ item.name }}
</div>
<div class="img-del" @click="iconDelete(item)">
<img src="@/assets/数据采集-减号.png" alt="" />
</div>
</div>
<div
class="main2-content"
@click="energyadd"
v-if="showList.length < 4"
>
<img src="@/assets/数据采集-新增.png" alt="" />
<div class="main2-content-text">新增</div>
</div>
</div>
</div>
<div class="btn">
<van-button
size="large"
class="faqi"
v-if="taskType < 3"
@click="saveAllInfo"
>提交</van-button
>
</div>
<!-- <div class="footer" @click="saveAllInfo">提交</div> -->
</div>
</div>
</template>
<script>
import { getInfoByEnterpris, systemInfoRemove, enterprisAdd} from '@/api/universalEnergy.js'
import { getCurrentPersonInfoAPI } from '@/api/customerIformation.js'
import { getSingleTaskInfo } from '@/api/customer.js'
import { getCode } from '@/api/common.js'
import { changeSubStateType, taskList } from '@/api/api'
// import img1 from '@/assets/gyqy/three.png'
// import EnergyManagement from './energyManagement.vue'
export default {
data() {
return {
nyList: [
{
id: '01',
name: '配电系统',
icon: require('@/assets/gyqy/three.png'),
url: './generalEnergy',
},
{
id: '02',
name: '泵机系统',
icon: require('@/assets/gyqy/four.png'),
url: './bengjisystem',
},
{
id: '03',
name: '风机系统',
icon: require('@/assets/gyqy/five.png'),
url: './fengjisystem',
},
{
id: '04',
name: '空压机系统',
icon: require('@/assets/gyqy/six.png'),
url: './kongyajisystem',
},
],
showList: [], // 显示列表
systemTypes: '', // 通用能源图标列表值
systemId: '', // 通用能源图标编辑时传
info: {}, //页面信息
enterpriseId: '', //新增过有enterpriseId
typeList: [], //类型列表
taskId: '',
taskType: '1',
records: [],
tidCid: null,
enterpriseSystemId: null,
}
},
created() {
this.tidCid = JSON.parse(sessionStorage.getItem('tidCid'))
this.enterpriseSystemId = sessionStorage.getItem('enterpriseSystemId')
this.getInfo()
this.getEnergyList()
this.getCustomerType()
this.getSingleTaskInfo()
},
mounted() {
// alert(this.$route.params.enterpriseId)
this.enterpriseId = this.$route.params.enterpriseId? this.$route.params.enterpriseId: sessionStorage.getItem('enterpriseId')
if (this.enterpriseId) {
sessionStorage.setItem('enterpriseId', this.enterpriseId)
sessionStorage.setItem('enId', this.enterpriseId)
} else if (this.$route.params.creditCode) {
sessionStorage.setItem('creditCode', this.$route.params.creditCode)
}
let data = JSON.parse(sessionStorage.getItem('tidCid'))
if(data.taskId) {
this.taskId = data.taskId
this.taskType = data.taskType
}
},
computed: {
showForm() {
if(this.tidCid.taskId) {
return false
}
return true
},
id() {
return this.$route.params.customerId
},
// 类型
typeName() {
this.typeList.forEach((v) => {
v.child.forEach((ev) => {
if (this.info.customerType === ev.code) {
this.info.customerTypeName = v.name + '/' + ev.name
}
})
})
return this.info.customerTypeName
},
},
methods: {
async getSingleTaskInfo () {
const data = JSON.parse(sessionStorage.getItem('tidCid'))
const id = data.taskId
if(id) {
const res = await getSingleTaskInfo(id)
if(res.code == 0) {
this.taskType = res.data.taskType
if(data) {
data.taskType = res.data.taskType
sessionStorage.setItem('tidCid', JSON.stringify(data))
}
}
} else {
this.taskType = 4
}
},
// 获取通用能源选项列表
getEnergyList() {
if(!this.enterpriseSystemId||this.enterpriseSystemId=='null') return
getInfoByEnterpris({id: this.enterpriseSystemId}).then((res) => {
localStorage.setItem('customerItem', JSON.stringify(res.data))
if (res.code == 0) {
this.systemId = res.data.id
this.systemTypes = res.data.systemTypes
let str = res.data.systemTypes
let arr = this.nyList.filter(function (item) {
if(str){
return str.indexOf(item.id) != -1
}
})
this.showList = arr
} else {
(this.showList = []), (this.systemTypes = ''), (this.systemId = '')
}
})
},
EnergyManagement() {
if (this.enterpriseId ) {
this.$router.push({
name: 'energyManagement',
params: { enterpriseId: this.enterpriseId, item:this.info },
})
} else {
this.$router.push({
name: 'energyManagement',
params: { creditCode: this.$route.params.creditCode, item:this.info },
})
}
},
enterpriseenergy() {
this.$router.push('./enterpriseenergy')
},
// 返回
onClickLeft() {
this.$router.push('./customer')
},
// 删除项
deleteItem() {
// console.log(123);
},
toGeneral(url) {
this.$router.push(url)
},
energyadd() {
if(this.showList.length === 0){
this.addSystem()
}
if(this.showForm) {
return
}
this.$router.push({
path: './energyAdd',
query: { systemTypes: this.systemTypes, systemId: this.systemId },
})
},
// 图标右上角减号删除
iconDelete(item) {
if(this.showForm) {
return
}
let data = {
energyType: item.id,
id: this.systemId,
}
systemInfoRemove(data).then((res) => {
if(res.code == 0) {
this.$toast('删除成功')
this.getEnergyList()
} else {
this.$toast(res.msg)
}
})
},
// 获取当前页面信息
async getInfo() {
const res = await getCurrentPersonInfoAPI(JSON.parse(sessionStorage.getItem('tidCid')).customerId)
if (res.code === 0) {
this.info = res.data
// const data = {
// customerId: JSON.parse(sessionStorage.getItem('tidCid')).customerId,
// taskId: JSON.parse(sessionStorage.getItem('tidCid')).taskId,
// taskType: JSON.parse(sessionStorage.getItem('tidCid')).taskType,
// enterpriseSystemId: JSON.parse(sessionStorage.getItem('tidCid')).enterpriseSystemId,
// item: res.data
// }
// sessionStorage.setItem('tidCid', JSON.stringify(data))
}else{
this.info = JSON.parse(sessionStorage.getItem('tidCid')).item
}
},
//查询客户类型
async getCustomerType() {
const data = {
codeSortId: '80000001004',
codeType: 'khlx',
}
const ref = await getCode(data)
if (ref.code === 0) {
this.typeList = ref.data
}
},
saveAllInfo() {
taskList({ consName: this.info.customerName }).then((res) => {
this.records = res.data.list[0]
if (!this.records.enterpriseId) {
this.$notify({
message: '请填写能源管理信息',
duration: 1000,
// background: '#34baae',
type: 'danger'
})
return false
}
if (!this.records.enterpriseEnergyId) {
this.$notify({
message: '请填写企业用能信息',
duration: 1000,
// background: '#34baae',
type: 'danger'
})
return false
}
if (!this.records.enterpriseSystemId) {
this.$notify({
message: '请填写企业通用能源信息',
duration: 1000,
// background: '#34baae',
type: 'danger'
})
return false
}
changeSubStateType({ taskId: this.taskId }).then((res) => {
if (res.code == 0) {
this.$notify({
message: '保存成功',
duration: 1000,
background: '#34baae',
})
this.$router.push('/taskManage')
}else if(res.code == 1){
this.$notify({
message: res.msg,
duration: 1000,
// background: '#34baae',
type: 'danger'
})
}
})
})
},
addSystem(){
let params = {
"airEnquireIds": "",
"creditCode": this.tidCid.item.creditCode,
"customerId": this.tidCid.customerId,
"distributeEnquireIds": "",
"id": this.tidCid.taskId,
"fanEnquireIds": "", "pumpEnquireIds": "", "systemTypes": ""
}
enterprisAdd(params).then(res=> {
this.enterpriseSystemId = res.data
sessionStorage.setItem('enterpriseSystemId', res.data)
})
}
},
}
</script>
<style lang="less" scoped>
::v-deep .van-icon-arrow-left {
font-size: 15px;
color: #000000;
}
#dadaAcquisition {
background-color: #f4f4f4;
padding: 0 10px;
box-sizing: border-box;
.header {
margin-top: 10px;
background-color: #ffffff;
padding: 10px;
box-sizing: border-box;
border-radius: 5px;
position: relative;
.header-name {
display: flex;
padding-bottom: 10px;
box-sizing: border-box;
font-size: 17px;
font-weight: 700;
opacity: 0.9;
width: 66%;
img {
width: 20px;
height: 20px;
margin-right: 10px;
margin-top: 2px;
}
}
.header-address {
display: flex;
border-top: 1px dashed;
padding: 6px 0;
box-sizing: border-box;
color: #8d8d8d;
line-height: 25px;
img {
width: 20px; // height: 20px;
margin-right: 10px;
}
.address-warp {
white-space: nowrap; //规定段落中的文本不进行换行
text-overflow: ellipsis;
overflow: hidden;
}
}
.header-title {
position: absolute;
top: 4px;
right: 4px;
color: #0fabd9;
border: 1px solid #42d9ff;
border-radius: 5px;
padding: 3px 10px;
box-sizing: border-box;
background-color: #cbf5ff;
}
}
.main1 {
background-color: #fff;
border-radius: 5px;
padding: 10px;
box-sizing: border-box;
margin-top: 10px;
.main1-name {
font-weight: 700;
color: #10968a;
font-size: 17px;
margin-bottom: 10px;
border-bottom: 1px dashed #eaeaea;
padding-bottom: 8px;
}
.main1-content {
font-size: 13px;
text-align: center;
width: 25%;
img {
margin: 0 auto 10px;
width: 50px;
height: 50px;
}
.main1-content-text {
color: #808080;
}
}
}
.main2 {
background-color: #fff;
border-radius: 5px;
padding: 10px;
box-sizing: border-box;
margin-top: 10px;
.main2-name {
font-weight: 700;
color: #10968a;
font-size: 17px;
margin-bottom: 10px;
border-bottom: 1px dashed #eaeaea;
padding-bottom: 8px;
}
.main2-flex {
display: flex;
flex-wrap: wrap;
.main2-content {
font-size: 13px;
margin-top: 10px;
text-align: center;
width: 25%;
position: relative;
img {
margin: 0 auto 10px;
width: 50px;
height: 50px;
}
.main2-content-text {
color: #808080;
}
.img-del {
width: 20px;
height: 20px;
position: absolute;
top: -9px;
right: 12px;
img {
width: 100%;
height: 100%;
}
}
}
}
}
.main3 {
background-color: #fff;
border-radius: 5px;
padding: 10px;
box-sizing: border-box;
margin-top: 10px;
.main3-name {
font-weight: 700;
color: #34baae;
font-size: 17px;
margin-bottom: 10px;
}
.main3-content {
text-align: center;
width: 25%;
font-size: 13px;
img {
margin: 0 auto 10px;
width: 40px;
height: 40px;
}
.main3-content-text {
color: #808080;
}
}
}
.footer {
color: #fff;
background-color: #34baae;
border-radius: 5px;
text-align: center;
padding: 10px;
margin-top: 10px;
}
}
.line {
display: inline-block;
width: 5px;
height: 17px;
position: relative;
top: 2px;
margin-right: 5px;
border-radius: 3px;
background: linear-gradient(to bottom, #2da197, #2c827c);
}
.btn {
position: fixed;
bottom: 20px;
// padding: 0 10px;
.faqi {
width: 355px;
background-color: #34baaf;
color: #fff;
border-radius: 8px;
}
}
</style>
+318
View File
@@ -0,0 +1,318 @@
<template>
<div class="container">
<div>
<van-cell title="一级/二级类目" is-link :value="gzType" required @click="showPicker = true" />
<van-cell title="改造时间" is-link required :value="gzDate" @click="datePicker = true" />
<div class="text">
<van-cell title="改造内容" required />
<van-cell-group>
<van-field v-model="message" type="textarea" placeholder="请输入改造内容" rows="5" autosize />
</van-cell-group>
</div>
</div>
<div class="footer-btn" @click="save">
<div>保存</div>
</div>
<!-- 年份选择 -->
<van-popup v-model="datePicker" position="bottom">
<van-datetime-picker v-model="currentDate" :max-date="maxDate" :min-date="minDate" type="date" @confirm="dateSelect" @cancel="datePicker = false" />
</van-popup>
<!-- 类目选择 -->
<van-popup v-model="showPicker" position="bottom">
<div class="two-button">
<p @click="showPicker = false">取消</p>
<div @click="showPicker = false">确认</div>
</div>
<van-tree-select :items="option" :main-active-index="mainActiveIndex" :active-id="activeId"
@click-nav="onNavClick" @click-item="onItemClick" />
</van-popup>
<van-overlay :show="show">
<div class="wrapper" @click.stop>
<div class="block">
<van-loading size="24px" color="#34baae" vertical>加载中...</van-loading>
</div>
</div>
</van-overlay>
</div>
</template>
<script>
import { getCode } from '@/api/common.js'
import { Notify } from "vant";
import { reformAdd, reformGetInfo, reformEdit } from "@/api/universalEnergy.js"
export default {
components: {
},
data() {
return {
primaryType: '', // 一级类目
secondType: '', // 二级类目
showPicker: false, // 选择框
gzType: '', // 改造类目
gzDate: '', // 改造时间
currentDate: new Date(),
maxDate: new Date(),
minDate: new Date('1900-1-1'),
datePicker: false,
message: '',
option: [],
// 左侧高亮元素的index
mainActiveIndex: 0,
// 被选中元素的id
activeId: 1,
customerId: '', // 用户id
getGzId: '', // 改造id
id: '', // 修改时所用id
show: false
}
},
created() {
this.currentDate = new Date();
this.activeId = 1;
this.gzDate = '';
this.message = '';
this.mainActiveIndex = 0;
this.gzType = '';
this.id = this.$route.query.id;
this.getGzId = this.$route.query.getGzId;
this.customerId = JSON.parse(sessionStorage.getItem('tidCid')).customerId;
this.getType()
},
mounted() {
},
methods: {
onNavClick(index) {
this.mainActiveIndex = index;
},
onItemClick(data) {
this.activeId = data.id;
this.primaryType = data.pid;
this.secondType = data.id;
// this.formData.buildType = data.id;
this.gzType = data.text;
},
// 查询单条
async getInfo() {
this.show = true
const res = await reformGetInfo({id: this.id});
if(res.code == 0) {
this.show = false
this.currentDate = new Date(res.data.tranTime);
this.activeId = res.data.secondType;
this.gzDate = res.data.tranTime;
this.message = res.data.tranContent;
this.primaryType = res.data.primaryType;
this.secondType = res.data.secondType;
for (var i = 0; i < this.option.length; i ++ ) {
const aaa = this.option[i].children.find((ele) => ele.id == this.activeId)
if(aaa) {
this.gzType = aaa.text;
this.mainActiveIndex = i
}
}
}else {
this.show = false
}
},
// 获取类目选项
getType() {
const info = {
codeSortId: 80000001035,
codeType: "gygzlx",
};
getCode(info).then((res) => {
if (res.code == 0) {
let arr = [];
res.data.forEach((v) => {
const list = v.child.map((ele) => {
return {
text: ele.name,
id: ele.code,
pid: ele.pCode
};
});
arr.push({
text: v.name,
value: v.code,
children: list,
});
});
this.option = arr;
if(this.id) {
this.getInfo()
}
}
})
.catch(() => {
this.$toast("失败");
});
},
dateSelect(data) {
let year = data.getFullYear();
let month = data.getMonth() + 1;
let day = data.getDate();
this.gzDate = year + '-' + month + '-' + day;
this.datePicker = false
},
// 保存
save() {
let taskId = JSON.parse(sessionStorage.getItem('tidCid')).taskId
if(this.id == undefined) {
if(this.secondType == '') {
this.$toast('请选择二级类目');
return
}else if(this.gzDate == '') {
this.$toast('请选择改造时间');
return
}else if(this.message == '') {
this.$toast('改造内容不能为空');
return
}
let params = {
customerId: this.customerId,
enterpriseId: this.getGzId,
primaryType: this.primaryType,
secondType: this.secondType,
tranTime: this.gzDate,
tranContent: this.message,
taskId,
}
reformAdd(params).then(() => {
this.$router.push ({
path: './energymanagement',
query: { gaizao: 1 }
})
// this.$router.go(-1);
Notify({ type: "success", background: '#34baae', message: "保存成功" });
}).catch((error) => {
this.$toast(error.msg);
})
}else {
if(this.message == '') {
this.$toast('改造内容不能为空');
return
}
let params = {
id: this.id,
customerId: this.customerId,
enterpriseId: this.getGzId,
primaryType: this.primaryType,
secondType: this.secondType,
tranTime: this.gzDate,
tranContent: this.message,
taskId,
}
reformEdit(params).then(() => {
this.$router.push ({
path: './energymanagement',
query: { gaizao: 1 }
})
// this.$router.go(-1);
Notify({ type: "success", background: '#34baae', message: "保存成功" });
}).catch((error) => {
this.$toast(error.msg);
})
}
}
}
}
</script>
<style lang='less' scoped>
.container {
padding: 20px 15px;
}
::v-deep .van-cell {
position: relative;
display: -webkit-box;
display: -webkit-flex;
display: flex;
box-sizing: border-box;
width: 100%;
padding: 20px;
overflow: hidden;
color: #323233;
font-size: 15px;
line-height: 0.64rem;
background-color: #fff;
// border-radius: 8px;
}
.text {
background-color: #fff;
min-height: 12rem;
margin-top: 15px;
}
::v-deep .van-field__control {
display: block;
box-sizing: border-box;
width: 100%;
min-width: 0;
margin: 0;
padding: 0;
color: #323233;
line-height: inherit;
text-align: left;
background-color: #f9f9f9;
border: 0;
resize: none;
padding: 20px 10px;
box-sizing: border-box;
}
.footer-btn {
margin-top: 50px;
height: 35px;
// padding: 0 0.4rem;
>div {
background: #34baae;
border-radius: 10px;
line-height: 35px;
text-align: center;
color: #fff;
}
}
.two-button {
display: flex;
justify-content: space-between;
}
.two-button>p {
color: #969799;
}
.two-button>div {
color: #34baae;
}
.two-button {
padding: 0.426667rem;
}
.van-sidebar-item--select::before {
position: absolute;
top: 50%;
left: 0;
width: 0.106667rem;
height: 0.426667rem;
background-color: #34baae;
-webkit-transform: translateY(-50%);
transform: translateY(-50%);
content: '';
}
.van-tree-select__item--active {
color: #34baae;
}
.wrapper {
display: flex;
align-items: center;
justify-content: center;
height: 100%;
}
</style>
+660
View File
@@ -0,0 +1,660 @@
<template>
<div>
<!-- 头部 -->
<!-- <Header :title="title" @onClickLeft="onClickLeft" /> -->
<div class="container">
<div>
<!-- <div class="title" style="margin-top: 20px;margin-left: 5px;">通用能源系统</div> -->
<div class="partTwo-box">
<div class="partTwo-content">
<div class="title">泵机系统基本信息<span style="font-size: 14px; color: #bbbbbb;"> 单台电机额定功率≥20kW</span>
</div>
<van-swipe-cell :right-width="65" v-for="(item, index) in list" :key="index">
<div class="msg-card" @click="bengjisystemaddedit(item.id)">
<div>
<div style="text-align: center;margin-top: 3px;"><van-icon name="credit-pay"
color="#fff" size="22px" /></div>
<div>x {{ item.systemNum }} 台</div>
</div>
<div>
<div class="space-between">
<span>泵机 {{ item.systemModel }} / 电机 {{ item.motorModel }} </span><span><van-icon
name="arrow" color="#fff" /></span>
</div>
<div class="space-between" style="margin-top: 10px;font-size: 12px;">
<span>单台额定功率:{{ item.ratedPowerValue }} kVA</span><span>变频占比: {{
item.frequencyPerValue }} %</span>
</div>
</div>
</div>
<!--TODO 把slot改一下 -->
<span slot="right" @click="remove(item.id)">删除</span>
</van-swipe-cell>
<div class="add-box" @click="bengjisystemaddedit('')">
+ 新增
</div>
</div>
</div>
<div>
<div class="title" style="margin-top: 20px;margin-left: 5px;margin-bottom: 15px;">能效问卷</div>
<div class="partThree-question" v-for="(item, index) in askList" :key="index">
<div>{{ index + 1 }} 、 {{ item.enquireTitle }}</div>
<div class="btn2">
<div class="btn-click2" @click="buttonClick(item, index)">
<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-click2" @click="buttonNoClick(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>
</div>
</div>
<div class="upload-group">
<van-cell class="title" title="设备外观" :required="$store.getters.cityType"/>
<Uploader type="text1" :value="text1"
@afterRead="afterRead"
@delImg="delImg"
@onUpload="onUpload" />
<div class="tips tipImage" v-if="$store.getters.cityType&&text1.length<1">请上传设备外观照片</div>
<!-- <div class="picStyle borderBot">
<div class="title">设备外观</div>
<div class="pic">
<Uploader
type="text1"
:value="text1"
@afterRead="afterRead"
@delImg="delImg"
@onUpload="onUpload"
/>
</div>
</div> -->
<div class="picStyle borderBot">
<div class="title">设备铭牌</div>
<div class="pic">
<Uploader
type="text2"
:value="text2"
@afterRead="afterRead"
@delImg="delImg"
@onUpload="onUpload"
/>
</div>
</div>
<div class="picStyle">
<div class="title">设备能效标识</div>
<div class="pic">
<Uploader
type="text3"
:value="text3"
@afterRead="afterRead"
@delImg="delImg"
@onUpload="onUpload"
/>
</div>
</div>
</div>
<div class="footer-btn" @click="save">
<div>保存</div>
</div>
</div>
</div>
<van-overlay :show="show">
<div class="wrapper" @click.stop>
<div class="block">
<van-loading size="24px" color="#34baae" vertical>加载中...</van-loading>
</div>
</div>
</van-overlay>
</div>
</template>
<script>
import {
buildAsk,
} from '@/api/api.js'
import { pumpList, pumpRemove, enterprisGetInfo, enterprisEdit, enterprisAdd } from "@/api/universalEnergy.js";
import { Notify } from "vant";
import Uploader from '@/views/facilityManage/common-vue/uploader.vue'
import { downloadUrl } from '@/settings'
// import Header from "@/components/headerNew";
export default {
components: {
// Header,
Uploader
},
data() {
return {
newAnswer: [], // 问答题存
title: '泵机系统',
userMsg: {}, // 任务列表单条数据
list: [], // 列表
item: {
type: Object,
default: () => { },
},
aarr: [],
aarr1: [],
pumpEnquireIds: '',
id: '',
customerId: '',
askList: [], // 问询列表
show: false,
getid: '',
enterpriseSystemId: '',
tidCid: null,
text1:[],
text2:[],
text3:[],
img1:'0,0,0',
img3:'0,0,0',
img4:'0,0,0',
}
},
created() {
this.tidCid = JSON.parse(sessionStorage.getItem('tidCid'))
this.getAsk()
this.enterpriseSystemId = sessionStorage.getItem('enterpriseSystemId');
let msg2 = JSON.parse(localStorage.getItem('customerItem'));
if(msg2) {
this.getid = msg2.id
}
this.getList();
},
activated() {
},
computed: {
showForm() {
if(this.tidCid.taskId) {
return false
}
return true
},
},
methods: {
/**
* 图片方法
*/
//浏览器 ios 会走这个方法
afterRead(data, type) {
this[type] = [data.attach_id]
data.type = type
},
//安卓会调用的方法
onUpload(data, type) {
this[type] = [data[0].url]
},
delImg(file, detail, type) {
if(type == 'text1') {
this.delIsObj(this.text1)
this.text1 = []
}
if(type == 'text2') {
this.delIsObj(this.text2)
this.text2 = []
}
if(type == 'text3') {
this.delIsObj(this.text3)
this.text3 = []
}
},
//判断删除的list中是否为对象格式
delIsObj(delList) {
const list = delList.map((ele) => {
if(ele instanceof Object) {
return ele.url
}
return ele
})
return list
},
// 图片格式化
fomattPic() {
if(this.text1.length == 0) {
this.text1 = ['0']
}
if(this.text2.length == 0) {
this.text2 = ['0']
}
if(this.text3.length == 0) {
this.text3 = ['0']
}
if(this.text1.length > 0 && this.text1[0] instanceof Object) {
this.text1 = [this.text1[0].url.split('download/')[1]]
} else if(this.text1.length > 0 && this.text1[0].split('download/').length > 1) {
this.text1 = [this.text1[0].split('download/')[1]]
}
if(this.text2.length > 0 && this.text2[0] instanceof Object) {
this.text2 = [this.text2[0].url.split('download/')[1]]
} else if(this.text2.length > 0 && this.text2[0].split('download/').length > 1) {
this.text2 = [this.text2[0].split('download/')[1]]
}
if(this.text3.length > 0 && this.text3[0] instanceof Object) {
this.text3 = [this.text3[0].url.split('download/')[1]]
} else if(this.text3.length > 0 && this.text3[0].split('download/').length > 1) {
this.text3 = [this.text3[0].split('download/')[1]]
}
const text = this.text1.concat(this.text2, this.text3)
return text
},
//判断是否为对象格式
ifObj(imgList) {
console.log(imgList,'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
},
// 获取问询信息
getAsk() {
buildAsk({ enquireMode: 'gybjwx' }).then((res) => {
if (res.code == 0) {
res.data.forEach((v) => {
if(v.enquireId == 61) {
v.color = false
} else {
v.color = true
}
})
this.askList = res.data
this.newAnswer = res.data.map((item) => {
if(item.enquireId == 61) {
return 0
}
return item.enquireId
})
this.getEnterprisGetInfo()
}
})
},
// 获取内容信息
async getEnterprisGetInfo() {
this.show = true
let tidCid = JSON.parse(sessionStorage.getItem('tidCid'))
let customerId = tidCid.customerId;
let taskId = tidCid.taskId;
const res = await enterprisGetInfo({customerId, taskId});
if (res.code == 0) {
this.show = false
this.pumpEnquireIds = res.data.pumpEnquireIds;
this.customerId = res.data.customerId;
this.id = res.data.id;
if(res.data.pumpEnquireIds) {
this.newAnswer = res.data.pumpEnquireIds.split(',')
}
if(this.askList && this.askList.length > 0) {
const list = this.newAnswer.filter((ele) => ele != 0)
this.askList.forEach((v)=>{
v.color = false
list.forEach((ev)=>{
if(v.enquireId == ev) {
v.color = true
}
})
})
}
if(res.data.text2) {
if(res.data.text2.split(',')[0] != 0) {
this.text1.push({
url:`${downloadUrl}${res.data.text2.split(',')[0]}`
})
}
if(res.data.text2.split(',')[1] != 0) {
this.text2.push({
url:`${downloadUrl}${res.data.text2.split(',')[1]}`
})
}
if(res.data.text2.split(',')[2] != 0) {
this.text3.push({
url:`${downloadUrl}${res.data.text2.split(',')[2]}`
})
}
if(res.data.text1) {
this.img1 = res.data.text1
}
if(res.data.text3) {
this.img3 = res.data.text3
}
if(res.data.text4) {
this.img4 = res.data.text4
}
}
} else {
this.show = false
}
},
buttonClick(item, index) {
if(this.showForm) {
return
}
this.newAnswer[index] = item.enquireId
if (!item.color) {
item.color = true
this.aarr.push(item.enquireId)
this.aarr = [...new Set(this.aarr)]
if(item.enquireId == 60 || item.enquireId == 61) {
this.changeId(item, [60, 61])
}
}
},
buttonNoClick(item, index) {
if(this.showForm) {
return
}
this.newAnswer[index] = 0
item.color = false
this.aarr.splice(this.aarr.indexOf(item.enquireId), 1)
const i = this.aarr1.findIndex((ele) => ele == item.enquireId)
this.aarr1.splice(i, 1)
},
changeId(item, numList) {
const num = numList.find((ele)=> ele != item.enquireId)
const enqIndex = this.newAnswer.findIndex((ele)=> ele == num)
if(enqIndex > -1) {
this.newAnswer.splice(enqIndex, 1, 0)
}
this.askList.forEach((v)=> {
if(v.enquireId == num) {
v.color = false
}
})
},
save() {
if(this.showForm||(this.$store.getters.cityType&&this.text1.length<1)) {
return
}
const text2 = this.fomattPic()
let enterpriseId = sessionStorage.getItem('enId')
let formIds = this.newAnswer.toString();
if (enterpriseId) {
let params = {
customerId: this.customerId,
id: this.enterpriseSystemId,
taskId: this.tidCid.taskId,
enterpriseId: enterpriseId,
pumpEnquireIds: formIds,
systemTypes: this.$route.query.item,
text2: this.ifObj(text2).join(','),
text1: this.img1,
text3: this.img3,
text4: this.img4
}
enterprisEdit(params).then((res) => {
if (res.code == 0) {
Notify({ type: "success", background: '#34baae', message: "保存成功" });
} else {
this.$toast(res.msg)
}
})
} else {
let params = {
customerId: this.customerId,
id: this.tidCid.taskId,
enterpriseId: enterpriseId,
pumpEnquireIds: formIds,
systemTypes: this.$route.query.item,
text2: this.ifObj(text2).join(','),
text1: this.img1,
text3: this.img3,
text4: this.img4
}
enterprisAdd(params).then((res) => {
if (res.code == 0) {
Notify({ type: "success", background: '#34baae', message: "保存成功" });
} else {
this.$toast(res.msg)
}
})
}
this.$router.push('./acquisition')
},
// 跳转
bengjisystemaddedit(id) {
if(this.showForm) {
return
}
this.$router.push({ path: './bengjisystemaddedit', query: { id: id } })
},
// 列表
async getList() {
const params = {
customerId: this.userMsg.customerId,
systemId: this.enterpriseSystemId ? this.enterpriseSystemId : this.getid
}
const res = await pumpList(params);
if (res.code == 0) {
this.list = res.data
}
},
// 删除
remove(ids) {
if(this.showForm) {
return
}
pumpRemove(ids).then((res) => {
if (res.code == 0) {
this.getList();
Notify({ type: 'success', background: '#34baae', message: '删除成功' })
} else {
Notify({ type: 'error', background: 'red', message: res.msg })
}
})
}
}
}
</script>
<style lang="less" scoped>
.container {
padding: 0 20px;
}
.title {
font-size: 15px;
color: #000;
}
.partTwo-box {
width: 100%;
border-radius: 8px;
padding: 0 15px 10px;
box-sizing: border-box;
background-color: #fff;
overflow: hidden;
margin-top: 15px;
.partTwo-content {
margin-top: 10px;
.add-box {
width: 100%;
padding: 10px 0;
box-sizing: border-box;
border-radius: 5px;
border: 1px solid #63cbb6;
background-color: #e0f5f0;
color: #63cbb6;
text-align: center;
margin-top: 15px;
}
}
}
.msg-card {
margin-top: 10px;
background: #63cbb6;
padding: 15px;
border-radius: 6px;
color: #fff;
display: flex;
justify-content: space-between;
}
.space-between {
width: 230px;
display: flex;
justify-content: space-between;
}
::v-deep .van-swipe-cell__right {
right: -20px;
-webkit-transform: translate3d(100%, 0, 0);
transform: translate3d(100%, 0, 0);
display: flex;
align-items: center;
color: red;
}
.partThree-question {
width: 100%;
background-color: #fff;
border-radius: 8px;
padding: 20px 10px;
box-sizing: border-box;
font-size: 14px;
color: #000;
.btn2 {
display: flex;
justify-content: flex-end;
}
}
.btn2 {
margin-top: 20px;
display: flex;
.btn-click2 {
display: flex;
align-items: center;
span {
color: #9d9d9d;
font-size: 14px;
}
}
.round-out {
width: 12px;
height: 12px;
border-radius: 50%;
margin: 0 7px;
display: flex;
justify-content: center;
align-items: center;
overflow: hidden;
.round-in {
width: 8px;
height: 8px;
border-radius: 50%;
}
}
.yes-out {
border: 2.5px solid #34baae;
.yes-in {
background: #34baae;
}
}
.no-out {
border: 2px solid #b3b3b3;
}
}
.footer-btn {
margin-top: 180px;
height: 35px;
// padding: 0 0.4rem;
>div {
position: fixed;
bottom: 0.533333rem;
width: 90%;
background: #34baae;
border-radius: 0.266667rem;
line-height: 0.933333rem;
text-align: center;
color: #fff;
z-index: 99999;
}
}
.wrapper {
display: flex;
align-items: center;
justify-content: center;
height: 100%;
}
.upload-group {
background: #fff;
margin-top: 0.2rem;
padding: 0.2rem;
border-radius: 0.2rem;
}
.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);
}
}
.tips {
padding: 0 16px;
display: flex;
justify-content: flex-end;
color: #ee0a24;
font-size: 12px;
}
.tipImage{
justify-content: flex-start
}
</style>
@@ -0,0 +1,270 @@
<template>
<div>
<!-- <Header :title="title" @onClickLeft="onClickLeft" /> -->
<van-form ref="form" @submit="handelClickSave">
<div class="yearenergy">
<div class="year-main">
<div class="nengyuan">
<van-cell-group>
<van-field v-model="form.systemModel" required :rules="[{ required: true },{pattern:/^.{2,20}$/, message:'2≤型号长度≤20'}]" maxlength="20" label="泵机型号" placeholder="请输入泵机型号"/>
<van-field v-model="form.motorModel" required :rules="[{ required: true },{pattern:/^.{2,20}$/, message:'2≤型号长度≤20'}]" maxlength="20" label="电机型号" placeholder="请输入电机型号"/>
<van-field v-input.numNo0 v-model="form.systemNum" type="number" required :rules="[{ required: true }]" label="台数(台)" placeholder="请输入台数" />
<van-field v-input.floatNo0 v-model="form.ratedPowerValue" type="number" required :rules="[{ required: true }]" label="单台额定功率(kW)" placeholder="请输入" @blur="handelChange"/>
<van-field v-input.float v-model="form.frequencyPerValue" type="number" required :rules="[{ required: true }]" label="变频占比(%)" placeholder="请输入" @input="handelChangeNumber('frequencyPerValue','变频占比')" />
<van-field v-input.num v-model="form.absoleteElecNum" type="number" label="淘汰电机数量" placeholder="请输入" />
<van-field v-input.num v-model="form.absoleteNum" type="number" label="淘汰泵机数量" placeholder="请输入" />
<van-field v-input.floatNo0 v-model="form.efficiency" type="number" label="泵机效率(%)" placeholder="请输入" @input="handelChangeNumber('efficiency','泵机效率')" />
<van-field v-input.num v-model="form.userYear" type="number" label="投入年份" placeholder="请选择投入年份" is-link readonly @click="handelClickYear('userYear', 'SET_CON_YEAR')" />
</van-cell-group>
</div>
</div>
<div class="btn">
<van-button size="large" class="faqi" native-type="submit">
保存
</van-button>
</div>
</div>
</van-form>
<van-overlay :show="show">
<div class="wrapper" @click.stop>
<div class="block">
<van-loading size="24px" color="#34baae" vertical>加载中...</van-loading>
</div>
</div>
</van-overlay>
<Year :show="yearShow" :num="1" @onConfirmYear="onConfirmYear" @onCancelYear="onCancelYear" />
</div>
</template>
<script>
import { pumpAdd, pumpGetInfo, pumpEdit } from "@/api/universalEnergy.js"
import { Notify } from "vant";
import mixin from '@/mixins/mixin'
import Year from '../facilityManage/common-vue/year.vue'
export default {
components: {
// Header,
Year
},
mixins: [mixin],
data() {
return {
addeditId: '', // 新增修改提交id
title: '新增/修改',
id: '', // 查详情时取的id
userMsg: {}, // 任务列表单条数据
form: {
systemModel: '',
motorModel: '',
systemNum: '',
ratedPowerValue: '',
frequencyPerValue: '',
absoleteElecNum: '',
absoleteNum: '',
efficiency: '',
userYear: '',
},
show: false
};
},
activated() {
this.id = '',
this.form = {
systemModel: '',
motorModel: '',
systemNum: '',
ratedPowerValue: '',
frequencyPerValue: '',
absoleteElecNum: '',
absoleteNum: '',
efficiency: '',
userYear: '',
};
let msg = JSON.parse(sessionStorage.getItem('tidCid'));
this.userMsg = msg
// let msg2 = localStorage.getItem('customerItem');
// let objMsg2 = JSON.parse(msg2);
// if(msg) {
// this.userMsg = JSON.parse(msg);
// this.addeditId = this.userMsg.id
// }else {
// this.userMsg = objMsg2;
// this.addeditId = localStorage.getItem('taskId')
// }
const id = this.$route.query.id;
if(id.isTrusted == undefined) {
this.id = this.$route.query.id;
this.getGetInfo()
}
},
mounted() {
},
methods: {
handelChangeNumber (params,name) {
if(params === 'efficiency'){
if(!(Number(this.form[params]) < 100)) {
Notify({ type: "danger", message: `${name}不可超过100%` });
this.form[params] = 0
}
}else{
if(Number(this.form[params]) > 100) {
Notify({ type: "danger", message: `${name}不可超过100%` });
this.form[params] = 0
}
}
},
handelChange () {
if(Number(this.form.ratedPowerValue) < 20) {
Notify({ type: "danger", message: '单台额定功率≥20 ' });
this.form.ratedPowerValue = ''
}
},
// 返回
onClickLeft() {
this.$router.go(-1)
},
async handelClickSave() {
if(this.id == '') {
this.form.id = sessionStorage.getItem('enterpriseSystemId') ? this.form.systemId = sessionStorage.getItem('enterpriseSystemId') : this.userMsg.taskId;
this.form.customerId = this.userMsg.customerId;
this.form.systemId = sessionStorage.getItem('enterpriseSystemId') ? this.form.systemId = sessionStorage.getItem('enterpriseSystemId') : this.userMsg.taskId;
this.form.systemTypes = '02';
const res = await pumpAdd(this.form);
if(res.code == 0) {
this.$router.go(-1);
Notify({ type: "success", background: '#34baae', message: "保存成功" });
return
}
Notify({ type: "error", background: 'red', message: res.msg })
}else {
this.form.id = this.id;
this.form.customerId = this.userMsg.customerId;
this.form.systemId = sessionStorage.getItem('enterpriseSystemId') ? this.form.systemId = sessionStorage.getItem('enterpriseSystemId') : this.userMsg.taskId;
this.form.systemTypes = '02';
const res = await pumpEdit(this.form);
if(res.code == 0) {
this.$router.go(-1);
Notify({ type: "success", background: '#34baae', message: "保存成功" });
return
}
Notify({ type: "error", background: 'red', message: res.msg })
}
},
async getGetInfo() {
this.show = true
const res = await pumpGetInfo(this.id);
if(res.code == 0) {
this.form = res.data
this.show = false
}else {
this.show = false
}
}
},
};
</script>
<style lang="less" scoped>
::v-deep .van-field__error-message{
text-align: right;
}
.yearenergy {
padding: 15px 10px;
.year-main {
height: calc(100vh - 5rem);
overflow: auto;
}
.year {
// padding: 20px 20px;
border-radius: 10px;
}
.title {
margin: 10px;
display: flex;
.title-img {
width: 20px;
img {
width: 100%;
}
}
p {
font-size: 14px;
color: #009999;
line-height: 20px;
}
}
.nengyuan {
width: 100%;
border-radius: 10px;
background: #fff;
box-sizing: border-box;
overflow: hidden;
}
.faqi {
background-color: #63cbb6;
color: #fff;
border-radius: 8px;
}
}
/deep/ .van-cell {
width: 100%;
display: flex;
}
.van-cell__title,
.van-cell__value {
-webkit-box-flex: 1;
-webkit-flex: 1;
flex: 1;
span {
font-size: 14px;
color: #333;
}
}
::v-deep .van-field__label {
-webkit-box-flex: 0;
-webkit-flex: none;
flex: none;
box-sizing: border-box;
flex: 1;
text-align: left;
word-wrap: break-word;
span {
font-size: 14px;
color: #333;
}
}
::v-deep .van-cell__value {
position: relative;
overflow: hidden;
color: #969799;
text-align: right;
vertical-align: middle;
word-wrap: break-word;
}
::v-deep .van-field__body {
display: -webkit-box;
display: -webkit-flex;
display: flex;
-webkit-box-align: center;
-webkit-align-items: center;
align-items: center;
}
::v-deep .van-field__control {
text-align: right;
font-size: 14px;
}
.wrapper {
display: flex;
align-items: center;
justify-content: center;
height: 100%;
}
</style>
+679
View File
@@ -0,0 +1,679 @@
<template>
<div>
<!-- 头部 -->
<!-- <Header :title="title" @onClickLeft="onClickLeft" /> -->
<div class="list">
<!-- 客户详情信息 -->
<div class="list-item">
<div class="list-item-customerName">
{{ personDetail.customerName }}
</div>
<div class="list-item-div">
<img src="@/assets/customerTypeName.png" alt="" />类型:{{ typeName }}
</div>
<div class="list-item-div">
<img src="@/assets/detailAddress.png" alt="" />地址:{{
personDetail.detailAddress
}}
</div>
<div class="list-item-div">
<img src="@/assets/orgName.png" alt="" />所属区域:
{{ personDetail.orgName }}
</div>
<div class="list-item-div list-item-display" style="overflow: unset;">
<img src="@/assets/contactName.png" alt="" /> 联系人:
{{ personDetail.contactName }}
<div class="list-item-text" @click="goPrpfile">
档案信息
</div>
</div>
<div class="list-item-div">
<img src="@/assets/contactPhone.png" alt="" />联系电话:{{
personDetail.contactPhone
}}
</div>
</div>
<!--最新诊断报告 -->
<div class="new" v-if="timeType">
<img src="@/assets/nio_icon@2x.png" alt="" /> {{ timeType }}
</div>
<!-- 能源诊断报告图 -->
<div class="new-img" @click="goPartialReport" v-if="timeType">
<img src="@/assets/mid_pic@2x.png" alt="" />
</div>
<!-- 建筑信息/用能设备信息/能耗数据信息 -->
<div class="info">
<div class="info-img" @click="toDeal" style="border-bottom: 2px solid #64d1ca;flex:1;">
<img src="@/assets/architecture.png" alt="" />
<p class="gray">能源管理</p>
</div>
<div class="distance"></div>
<div class="info-img" @click="toDeal" style="border-bottom: 2px solid #ffc466;flex:1;">
<img src="@/assets/energy.png" alt="" />
<p class="gray">企业用能</p>
</div>
<div class="distance"></div>
<div class="info-img" @click="toDeal" style="border-bottom: 2px solid #10968b;flex:1;">
<img src="@/assets/consumption.png" alt="" />
<p class="gray">企业通用能源</p>
</div>
</div>
<!-- 建筑信息详情 -->
<div class="architecture">
<div class="architecture-div">
<p class="gray">年工业总产值</p>
<div class="architecture-m2">
{{ dataDetail.totalOutput }}
</div>
<div class="architecture-m2">
万元
</div>
</div>
<div class="line"></div>
<div class="architecture-div">
<p class="gray">年工业增加值</p>
<div class="architecture-m2">
{{ dataDetail.addOutput }}
</div>
<div class="architecture-m2">
万元
</div>
</div>
<div class="line"></div>
<div class="architecture-div">
<p class="gray">单位面积能耗</p>
<div class="architecture-m2">
{{ dataDetail.unitAreaEnergy }}
</div>
<div class="architecture-m2">
千克折煤/m³
</div>
</div>
<div class="line"></div>
<div class="architecture-div">
<p class="gray">人均能耗</p>
<div class="architecture-m2">
{{ dataDetail.perEnergy }}
</div>
<div class="architecture-m2">
千克折煤/人
</div>
</div>
</div>
<!-- 年度能耗详情 -->
<div class="energy">
<p class="energy-p">{{ dataDetail.energyYear }}年度能耗</p>
<div class="energy-p-div"></div>
<div class="energy1">
<div class="energy-div">
<p class="gray">外购电</p>
<div class="energy-m2">{{ dataDetail.payPower }}</div>
<div class="energy-m2">万kWh</div>
</div>
<div class="line"></div>
<div class="energy-div">
<p class="gray">外购低压蒸汽</p>
<div class="energy-m2">
{{ dataDetail.lowPreStreamValue }}
</div>
<div class="energy-m2">
t
</div>
</div>
<div class="line"></div>
<div class="energy-div">
<p class="gray">外购中压蒸汽</p>
<div class="energy-m2">
{{ dataDetail.medPreStreamValue }}
</div>
<div class="energy-m2">
t
</div>
</div>
<div class="line"></div>
<div class="energy-div">
<p class="gray">外购高压蒸汽</p>
<div class="energy-m2">
{{ dataDetail.highPreStreamValue }}
</div>
<div class="energy-m2">
t
</div>
</div>
</div>
<div class="energy-p-div"></div>
<div class="energy1">
<div class="energy-div">
<p class="gray">天然气</p>
<div class="energy-m2">{{ dataDetail.gasValue }}</div>
<div class="energy-m2">万m³</div>
</div>
<div class="line"></div>
<div class="energy-div">
<p class="gray">煤</p>
<div class="energy-m2">
{{ dataDetail.coalValue }}
</div>
<div class="energy-m2">
t
</div>
</div>
<div class="line"></div>
<div class="energy-div">
<p class="gray">汽油</p>
<div class="energy-m2">
{{ dataDetail.petrolValue }}
</div>
<div class="energy-m2">
t
</div>
</div>
<div class="line"></div>
<div class="energy-div">
<p class="gray">柴油</p>
<div class="energy-m2">
{{ dataDetail.dieselValue }}
</div>
<div class="energy-m2">
t
</div>
</div>
</div>
</div>
<!-- 能耗数据信息详情 -->
<div class="consumption">
<p class="consumption-p">用能系统设备统计</p>
<div class="consumption-p-div"></div>
<div class="consumption1">
<div class="consumption-div">
<div class="consumption-m2">
{{ dataDetail.distributeFlagDesc }}台
</div>
<p class="gray">配电系统</p>
</div>
<div class="line"></div>
<div class="consumption-div">
<div class="consumption-m2">{{ dataDetail.pumpFlagDesc }}台</div>
<p class="gray">泵机系统</p>
</div>
<div class="line"></div>
<div class="consumption-div">
<div class="consumption-m2">{{ dataDetail.fanFlagDesc }}台</div>
<p class="gray">风机系统</p>
</div>
<div class="line"></div>
<div class="consumption-div">
<div class="consumption-m2">{{ dataDetail.airFlagDesc }}台</div>
<p class="gray">空压机系统</p>
</div>
</div>
</div>
</div>
</div>
</template>
<script>
import {
getInfoAPI,
getCurrentPersonInfoAPI
} from '@/api/customerIformation.js'
import { getCode } from '@/api/common.js'
import { getInfoByCustomerIdAPI } from '@/api/api.js'
// import Header from '@/components/headerNew'
export default {
components: {
// Header
},
data() {
return {
title: '客户能效管理',
dataDetail: {}, //客户能耗信息
personDetail: {}, //客户信息
typeList: [], //客户类型
currentPath: {
path: '',
type: 3,
name: ''
},
enterpriseId22: '', //判断是新增,还是修改
creditCode: ''
}
},
created() {
const data = {
customerId: JSON.parse(sessionStorage.getItem('tidCid')).customerId
}
sessionStorage.setItem('tidCid', JSON.stringify(data))
this.getCustomerType()
},
beforeDestroy() {
sessionStorage.removeItem('enterpriseId')
sessionStorage.removeItem('creditCode')
},
computed: {
// 类型
typeName() {
this.typeList.forEach(v => {
v.child.forEach(ev => {
if (this.personDetail.customerType === ev.code) {
this.personDetail.customerTypeName = v.name + '/' + ev.name
}
})
})
return this.personDetail.customerTypeName
},
// 最新诊断时间格式处理
timeType() {
if(this.dataDetail && this.dataDetail.alarmList instanceof Array) {
return this.dataDetail.alarmList[0]
}
return null
},
},
methods: {
// 跳转至工业企业业务处理
toDeal() {
// this.$router.push('/acquisition')
// 注释跳转 ---20240206
// if (this.enterpriseId22) {
// // localStorage.setItem('enterpriseId22', this.enterpriseId22)
// this.$router.push({
// name: 'acquisition',
// params: {
// customerId: JSON.parse(sessionStorage.getItem('tidCid')).customerId,
// enterpriseId: this.enterpriseId22
// }
// })
// } else {
// // localStorage.setItem('creditCode', this.creditCode)
// this.$router.push({
// name: 'acquisition',
// params: {
// customerId: JSON.parse(sessionStorage.getItem('tidCid')).customerId,
// creditCode: this.creditCode
// }
// })
// }
},
// //获取用能设备数据
// async getFacData() {
// let id = JSON.parse(sessionStorage.getItem('tidCid')).customerId
// const res = await getCurrentPersonInfoAPI(id)
// if (res.code == 0) {
// const data = {
// info: res.data,
// pageKey: true
// }
// // sessionStorage.setItem('facilityManage', JSON.stringify(data))
// this.$store.commit('pageData/GET_EDITDATA', data)
// return
// }
// },
// 返回
onClickLeft() {
sessionStorage.removeItem('facilityManage')
sessionStorage.removeItem('goBack')
this.$router.push('/')
},
//查询客户类型
async getCustomerType() {
const data = {
codeSortId: '80000001004',
codeType: 'khlx'
}
let tidCid = JSON.parse(sessionStorage.getItem('tidCid'))
let id = tidCid.customerId
//查询客户类型
const ref = await getCode(data)
if (ref.code === 0) {
this.typeList = ref.data
}
//获取客户信息
const req = await getCurrentPersonInfoAPI(id)
if (req.code === 0) {
this.personDetail = req.data
localStorage.setItem('taskId', req.data.taskId)
this.creditCode = req.data.creditCode
}else{
let item = JSON.parse(sessionStorage.getItem('detail')).item
this.personDetail = item
}
//获取客户能耗信息
const res = await getInfoAPI(id)
if (res.code === 0) {
this.dataDetail = res.data
}
// 查询是否有新增|修改
// if(!tidCid.item.enterpriseId) return
// const rew = await getInfoByCustomerIdAPI({ id: tidCid.item.enterpriseId })
// if (rew.code == 0) {
// console.log(rew.data.id, 'rew')
// this.enterpriseId22 = rew.data.id
// }else {
// this.enterpriseId22 = ''
// }
},
// //根据客户id查询单个建筑信息获取建筑id
// async getBuildId() {
// const id = JSON.parse(sessionStorage.getItem('tidCid')).customerId
// const res = await getInfoAPI({ customerId: id })
// if (res.code && res.data) {
// this.customerData = res.data
// sessionStorage.setItem('buildId', res.data.buildId)
// sessionStorage.setItem('equipId', res.data.equipId)
// }
// },
// //获取点击过后当前人信息
// async currentPersonInfo() {
// const id = JSON.parse(sessionStorage.getItem('tidCid')).customerId
// const res = await getCurrentPersonInfoAPI(id)
// if (res.code == 0) {
// this.personDetail = res.data
// sessionStorage.setItem('buildId', res.data.buildId)
// }
// },
// //查询单个客户统计信息
// async getCustomerStatistic() {
// const id = JSON.parse(sessionStorage.getItem('tidCid')).customerId
// const res = await getCurrentPersonInfoAPI(id)
// if (res.code == 0) {
// this.customerStatistic = res.data
// }
// },
// //获取当前页面信息
getPathInfo() {
this.currentPath.path = this.$route.path
this.currentPath.name = this.title
this.$store.commit('path/SET_PATH', this.currentPath)
sessionStorage.setItem('goPage', JSON.stringify(this.currentPath))
},
// 客户档案详情
goPrpfile() {
// this.getPathInfo()
this.getPathInfo()
this.$router.push('./archivalinformation')
// this.$router.push({
// name: 'archivalinformation'
// })
},
// 跳转到能源诊断报告
goPartialReport() {
this.$store.commit('user/GET_USER_LEVEL', 2)
this.$router.push({
name: 'partialreport',
params: { customerId: JSON.parse(sessionStorage.getItem('tidCid')).customerId }
})
}
}
}
</script>
<style lang="less" scoped>
.list {
padding: 10px;
background-color: #fff;
.list-item {
width: 100%;
background: url('~@/assets/manage-btn.png') no-repeat 70%;
background-size: cover;
border-radius: 10px;
padding: 10px;
box-sizing: border-box;
.list-item-customerName {
font-weight: 700;
font-size: 19px;
padding: 8px 0px;
box-sizing: border-box;
color: #fff;
}
.list-item-div {
color: #fff;
opacity: 0.9;
margin: 5px 0;
display: flex;
white-space: nowrap;
text-overflow: ellipsis;
overflow: hidden;
img {
width: 20px;
height: 20px;
margin-right: 5px;
}
}
.list-item-display {
display: flex;
position: relative;
.list-item-text {
position: absolute;
top: -6px;
right: 6px;
background-color: #64d1ca;
padding: 5px;
border-radius: 5px;
box-sizing: border-box;
border: 1px solid #fff;
}
}
}
.new {
margin-top: 10px;
width: 100%;
height: 36px;
padding-left: 10px;
line-height: 36px; // border: 1px solid rgb(225, 225, 225, 0);
box-shadow: 1px 1px 10px 1px rgb(225, 225, 225, 0);
box-sizing: border-box;
border-radius: 5px;
font-weight: 700;
display: flex;
img {
width: 15px;
height: 15px;
margin: auto 10px;
}
}
.new-img {
margin-top: 10px;
text-align: center;
img {
width: 340px;
height: 70px;
}
}
.info {
margin-top: 10px;
display: flex;
justify-content: space-between;
.info-img {
display: flex; // border: 1px solid #666666;
box-shadow: 1px 1px 10px 1px rgb(225, 225, 225, 0);
padding: 12px 5px;
border-radius: 5px;
box-sizing: border-box;
justify-content: center;
img {
width: 20px;
height: 20px;
margin-right: 5px;
}
}
}
.architecture {
display: flex;
justify-content: space-evenly; // border: 1px solid #666666;
box-shadow: 1px 1px 10px 1px rgb(225, 225, 225, 0);
box-sizing: border-box;
margin-top: 20px;
padding: 15px 5px;
border-radius: 5px;
.architecture-div {
flex: 1;
text-align: center; // border-right: 1px solid #63cbb6;
box-sizing: border-box;
.architecture-m2 {
// height: 20px;
// line-height: 20px;
margin-top: 10px;
color: #2382ff;
font-size: 12px;
.people {
font-size: 13px;
}
}
}
}
.energy {
margin-top: 20px;
padding: 5px; // border: 1px solid #666666;
box-shadow: 1px 1px 10px 1px rgb(225, 225, 225, 0);
box-sizing: border-box;
border-radius: 5px;
.energy-p {
color: #10968b;
font-weight: 700;
margin: 10px;
border-left: 4px solid #2b827c;
padding-left: 10px;
box-sizing: border-box;
}
.energy-p-div {
margin-bottom: 10px;
// border-bottom: 1px dashed #e9e9e9;
width: 100%;
height: 1px;
background: linear-gradient(to right, #f5fafa, #daedec, #f5fafa);
}
.energy1 {
display: flex;
justify-content: space-evenly;
.energy-div {
padding: 5px 0 15px;
width: 25%;
text-align: center; // border-right: 1px solid #63cbb6;
box-sizing: border-box;
.energy-m2 {
color: #ffc466;
margin-top: 10px;
font-size: 12px;
.people {
font-size: 13px;
}
}
}
}
}
.consumption {
margin-top: 20px;
padding: 5px; // border: 1px solid #666666;
box-shadow: 1px 1px 10px 1px rgb(225, 225, 225, 0);
box-sizing: border-box;
border-radius: 5px;
.consumption-p {
color: #10968b;
font-weight: 700;
margin: 10px;
border-left: 4px solid #2b827c;
padding-left: 10px;
box-sizing: border-box;
}
.consumption-p-div {
margin-bottom: 10px;
border-bottom: 1px dashed #e9e9e9;
}
.consumption1 {
display: flex;
justify-content: space-evenly;
.consumption-div {
padding: 5px 0 15px;
width: 20%;
text-align: center; // border-right: 1px solid #63cbb6;
box-sizing: border-box;
.consumption-m2 {
// height: 25px;
color: #10968b;
margin-bottom: 10px;
font-size: 12px;
}
}
}
}
}
.btn {
position: fixed;
bottom: 20px;
padding: 0 10px;
.faqi {
width: 355px;
background-color: #63cbb6;
color: #fff;
border-radius: 8px;
}
}
.van-cell__title,
.van-cell__value {
-webkit-box-flex: 1;
flex: 1;
display: flex;
justify-content: space-between;
}
.van-tag--primary {
background-color: #63cbb6;
}
.gray {
color: #808080;
font-size: 12px;
display: flex;
justify-content: center;
flex-direction: column;
margin-top: 1px;
}
.line {
width: 2px;
height: 60px;
margin-top: 5px;
background: linear-gradient(to bottom, #f5fafa, #daedec, #f5fafa);
}
.distance {
width: 10px;
height: 10px;
}</style>
+303
View File
@@ -0,0 +1,303 @@
<template>
<div class="list">
<!-- <Header :title="title" @onClickLeft="onClickLeft" /> -->
<!-- @load="onLoad" -->
<div class="container">
<van-radio-group v-model="radio">
<van-cell-group>
<van-cell
v-for="(item, index) in client"
:title="item.name"
:key="index"
clickable
:title-style="item.color"
:style="radio == index? 'background: #d6f1ef' : ''"
@click="clickRadio(item, index)"
>
</van-cell>
</van-cell-group>
</van-radio-group>
</div>
<div class="btn" @click="sure">
<van-button size="large" class="faqi">
确认
</van-button>
</div>
</div>
</template>
<script>
import { getInfoByCustomerId } from '@/api/universalEnergy.js'
// import Header from "@/components/headerNew";
import { enterprisAdd, enterprisEdit } from "@/api/universalEnergy.js"
// import Header from "@/components/headerNew";
export default {
name: '',
components: {
// Header,
},
beforeRouteEnter(to, from, next) {
next(vm => {
vm.title = to.meta.title
})
},
data() {
return {
// 单选框
title: '新增',
radio: '999',
customerId: '',
systemTypes: '',
client: [
{
name: '配电系统',
color: 'color: #000',
id: '01',
path: 'generalEnergy'
},
{
name: '泵机系统',
color: 'color: #000',
id: '02',
path: 'bengjisystem'
},
{
name: '风机系统',
color: 'color: #000',
id: '03',
path: 'fengjisystem'
},
{
name: '空压机系统',
color: 'color: #000',
id: '04',
path: 'kongyajisystem'
}
],
checkCurrent: null,
numArr: []
}
},
mounted() {
this.radio = 999,
this.customerId = JSON.parse(sessionStorage.getItem('tidCid')).customerId;
this.systemTypes = this.$route.query.systemTypes;
this.systemId = sessionStorage.getItem('enterpriseSystemId');
this.setGray()
},
methods: {
// 选择客户数据处理
clickRadio(item, index) {
let str = this.systemTypes;
this.checkCurrent = item
if(str.indexOf("01") != -1 && index == 0) {
this.radio = 999
} else if(str.indexOf("02") != -1 && index == 1) {
this.radio = 999
} else if(str.indexOf("03") != -1 && index == 2) {
this.radio = 999
} else if(str.indexOf("04") != -1 && index == 3) {
this.radio = 999
} else {
this.radio = index
}
},
// 跳转
sure() {
let tidCid = JSON.parse(sessionStorage.getItem('tidCid'))
let customerId = tidCid.customerId
const data = {
customerId,
systemTypes: this.checkCurrent.id,
}
if(!this.systemId) {
data.id = tidCid.taskId
enterprisAdd(data).then((resId)=>{
sessionStorage.setItem('enterpriseSystemId', resId.data)
});
getInfoByCustomerId(customerId).then((res) => {
localStorage.removeItem('customerItem')
localStorage.setItem('customerItem', JSON.stringify(res.data))
})
} else {
let list = this.systemTypes.split(',').filter((ele)=> ele != 0)
list.push(this.checkCurrent.id)
data.systemTypes = list.join(',')
data.id = sessionStorage.getItem('enterpriseSystemId')
data.taskId = tidCid.taskId
// let toatlsystemTypes = this.systemTypes + ',' + systemTypes;
enterprisEdit(data);
}
this.$router.push({
path:`./${this.checkCurrent.path}`,
query: {
item: data.systemTypes
}
})
// let systemTypes = 0;
// switch (this.radio) {
// case 0:
// if(!this.systemId) {
// systemTypes = '01';
// let customerId = JSON.parse(sessionStorage.getItem('tidCid')).customerId;
// enterprisAdd({ customerId: customerId, systemTypes: systemTypes }).then((resId)=>{
// console.log('zyh000 ',resId.data)
// sessionStorage.setItem('enterpriseSystemId', resId.data)
// });
// getInfoByCustomerId(customerId).then((res) => {
// localStorage.removeItem('customerItem')
// localStorage.setItem('customerItem', JSON.stringify(res.data))
// if(res.code == 0) {
// // sessionStorage.setItem('enterpriseSystemId', res.data.id)
// }
// })
// } else {
// systemTypes = '01';
// let toatlsystemTypes = this.systemTypes + ',' + systemTypes;
// enterprisEdit({ customerId: customerId, systemTypes: toatlsystemTypes, id: this.systemId });
// }
// this.$router.push('./generalEnergy')
// break;
// case 1:
// if(!this.systemId) {
// systemTypes = '02';
// let customerId = JSON.parse(sessionStorage.getItem('tidCid')).customerId
// enterprisAdd({ customerId: customerId, systemTypes: systemTypes }).then((resId)=>{
// console.log('zyh111 ',resId.data)
// sessionStorage.setItem('enterpriseSystemId', resId.data)
// });
// getInfoByCustomerId(customerId).then((res) => {
// localStorage.removeItem('customerItem')
// localStorage.setItem('customerItem', JSON.stringify(res.data))
// // sessionStorage.setItem('enterpriseSystemId', res.data.id)
// })
// } else {
// systemTypes = '02';
// let toatlsystemTypes = this.systemTypes + ',' + systemTypes;
// enterprisEdit({ customerId: customerId, systemTypes: toatlsystemTypes, id: this.systemId });
// }
// this.$router.push('./bengjisystem')
// break;
// case 2:
// if(!this.systemId) {
// systemTypes = '03';
// let customerId = JSON.parse(sessionStorage.getItem('tidCid')).customerId
// enterprisAdd({ customerId: customerId, systemTypes: systemTypes }).then((resId)=>{
// console.log('zyh222 ',resId.data)
// sessionStorage.setItem('enterpriseSystemId', resId.data)
// });
// getInfoByCustomerId(customerId).then((res) => {
// localStorage.removeItem('customerItem')
// localStorage.setItem('customerItem', JSON.stringify(res.data))
// // sessionStorage.setItem('enterpriseSystemId', res.data.id)
// })
// } else {
// systemTypes = '03';
// let toatlsystemTypes = this.systemTypes + ',' + systemTypes;
// enterprisEdit({ customerId: customerId, systemTypes: toatlsystemTypes, id: this.systemId });
// }
// this.$router.push('./fengjisystem')
// break;
// case 3:
// if(!this.systemId) {
// systemTypes = '04';
// let customerId = JSON.parse(sessionStorage.getItem('tidCid')).customerId
// enterprisAdd({ customerId: customerId, systemTypes: systemTypes }).then((resId)=>{
// console.log('zyh333 ',resId.data)
// sessionStorage.setItem('enterpriseSystemId', resId.data)
// });
// getInfoByCustomerId(customerId).then((res) => {
// localStorage.removeItem('customerItem')
// localStorage.setItem('customerItem', JSON.stringify(res.data))
// })
// } else {
// systemTypes = '04';
// let toatlsystemTypes = this.systemTypes + ',' + systemTypes;
// enterprisEdit({ customerId: customerId, systemTypes: toatlsystemTypes, id: this.systemId });
// }
// this.$router.push('./kongyajisystem')
// break;
// default:
// this.$toast('点击选择新增系统')
// }
},
// 选项置灰
setGray() {
let str = this.systemTypes;
console.log(str);
if(str.indexOf("01") != -1 == true) {
this.client[0].color = 'color: #d7d7d7'
}else {
this.client[0].color = 'color: #000'
}
if(str.indexOf("02") != -1 == true) {
this.client[1].color = 'color: #d7d7d7'
}else {
this.client[1].color = 'color: #000'
}
if(str.indexOf("03") != -1 == true) {
this.client[2].color = 'color: #d7d7d7'
}else {
this.client[2].color = 'color: #000'
}
if(str.indexOf("04") != -1 == true) {
this.client[3].color = 'color: #d7d7d7'
}else {
this.client[3].color = 'color: #000'
}
// eslint-disable-next-line no-self-assign
this.client = this.client
}
},
// 点击确认
}
</script>
<style lang="less" scoped>
.container {
height: calc(88vh - 50px);
overflow-y: auto;
.van-cell {
padding: 20px;
font-size: 15px;
opacity: 0.9;
}
.item {
background: #fff;
padding: 30px;
box-sizing: border-box;
font-size: 18px;
color: #797b7b;
border-bottom: 1px solid #e9e9e9;
}
}
::v-deep .van-radio__icon {
-webkit-box-flex: 0;
-webkit-flex: none;
flex: none;
height: 1em;
font-size: 0.533333rem;
line-height: 1em;
cursor: pointer;
position: absolute;
right: 0;
top: 0px;
}
.btn {
padding: 0 20px;
}
.faqi {
background-color: #63cbb6;
color: #fff;
border-radius: 8px;
margin-top: -20px;
}
</style>
File diff suppressed because it is too large Load Diff
+526
View File
@@ -0,0 +1,526 @@
<template>
<div>
<!-- 逐年逐月切换 -->
<div class="tab">
<van-tabs v-model="activeName" type="card" color="#34baae">
<van-tab title="年度用能信息" name="a"></van-tab>
<van-tab title="未利用能源" name="b"></van-tab>
<van-tab title="清洁能源" name="c"></van-tab>
</van-tabs>
<div class="container">
<van-list
>
<!-- v-model="loading"
:finished="finished"
finished-text="没有更多了"
@load="onLoad" -->
<!-- <template v-for="(item, index) in listData"> -->
<van-swipe-cell v-if="!ifAddBtn" :right-width="65" style="margin-bottom: 15px;border-radius: 10px;">
<div v-show="activeName == 'a'">
<van-cell :title="item.energyYear" title-class="titleClass" :value="'工业总产值 '+ (item.totalOutput || 0) + '万元 工业增加值 ' + (item.addOutput || 0) +'万元'" value-class='valueClass' is-link @click="toyearenergyaddedit(item.id)" />
<div class="box-bottom" @click="toyearenergyaddedit(item.id)">
<div class="data-box">
<table>
<tbody>
<tr>
<td>外购电</td>
<td><span style="color: #6bceb9;">{{ item.payPower || 0 }}</span>kWh</td>
</tr>
</tbody>
<tbody>
<tr>
<td>外购蒸汽(低压)</td>
<td><span style="color: #6bceb9;">{{ item.lowPreStreamValue || 0 }}</span>t</td>
</tr>
</tbody>
<tbody>
<tr>
<td>外购蒸汽(中压)</td>
<td><span style="color: #6bceb9;">{{ item.medPreStreamValue || 0 }}</span>t</td>
</tr>
</tbody>
<tbody>
<tr>
<td>外购蒸汽(高压)</td>
<td><span style="color: #6bceb9;">{{ item.highPreStreamValue || 0 }}</span>t</td>
</tr>
</tbody>
<tbody>
<tr>
<td>天然气</td>
<td><span style="color: #6bceb9;">{{ item.gasValue || 0 }}</span>m³</td>
</tr>
</tbody>
<tbody>
<tr>
<td>煤</td>
<td><span style="color: #6bceb9;">{{ item.coalValue || 0 }}</span>t</td>
</tr>
</tbody>
<tbody>
<tr>
<td>汽油</td>
<td><span style="color: #6bceb9;">{{ item.petrolValue || 0 }}</span>t</td>
</tr>
</tbody>
<tbody>
<tr>
<td>柴油</td>
<td><span style="color: #6bceb9;">{{ item.dieselValue || 0 }}</span>t</td>
</tr>
</tbody>
</table>
<!-- <div class="word-style">
<div>外购电</div>
<div class="word-bottom"><span>{{ item.payPower || 0 }}</span>kWh</div>
</div>
<div class="word-style">
<div>外购蒸气(低压/中压/高压)</div>
<div class="word-bottom"><span>{{ item.lowPreStreamValue || 0 }}</span>t/<span>{{ item.medPreStreamValue || 0 }}</span>t/<span>{{ item.highPreStreamValue || 0 }}</span>t</div>
</div>
<div class="word-style">
<div>天然气/煤/汽油/柴油</div>
<div class="word-bottom">
<span>{{ item.gasValue || 0 }}</span>m³/<span>{{ item.coalValue || 0 }}</span>t/<span>{{ item.petrolValue || 0 }}</span>t/<span>{{ item.dieselValue || 0 }}</span>t
</div>
</div> -->
</div>
</div>
</div>
<div v-show="activeName == 'b'">
<van-cell :title="item.energyYear" title-class="titleClass" is-link @click="toyearenergyaddedit(item.id)" />
<div class="box-bottom" @click="toyearenergyaddedit(item.id)">
<div class="dataContent">
<div class="content_c word-style">
<div>尚未利用的余能资源</div>
<div class="word-bottom"><span>{{ getNotUsed(item.notUsedResidueEnergyType) }}</span></div>
</div>
</div>
</div>
</div>
<div v-show="activeName == 'c'">
<van-cell :title="item.energyYear" title-class="titleClass" is-link @click="toyearenergyaddedit(item.id)" />
<div class="box-bottom" @click="toyearenergyaddedit(item.id)">
<div class="dataContent">
<div class="content_c word-style">
<div>是否为已安装分布式光伏客户</div>
<div class="word-bottom"><span>{{ item.isPvInstallCondition == 1 ? '是' : item.isPvInstallCondition == 2 ? '否' : '未知' }}</span></div>
</div>
<div class="content_c word-style">
<div>是否具备光伏发电安装条件</div>
<div class="word-bottom"><span>{{ item.isPowerInstallCondition == 1 ? '是' : item.isPowerInstallCondition == 2 ? '否' : '未知' }}</span></div>
</div>
</div>
</div>
</div>
<span slot="right" @click="onDel(item.id)">删除</span>
</van-swipe-cell>
<!-- </template> -->
</van-list>
</div>
</div>
<div class="footer-btn">
<div class="add" v-if="ifAddBtn" @click="toyearenergyaddedit()">新增</div>
</div>
<van-overlay :show="show">
<div class="wrapper" @click.stop>
<div class="block">
<van-loading size="24px" color="#34baae" vertical>加载中...</van-loading>
</div>
</div>
</van-overlay>
</div>
</template>
<script>
import { Dialog, Notify } from 'vant'
import { getQyListAPI, DeleteQyAPI } from '@/api/energyReport.js'
import { mapGetters } from "vuex";
export default {
components: {
},
data() {
return {
infoData: null,
form: {
customerId: "",
pageNum: 1,
pageSize: 10
},
loading: false,
finished: false,
activeName: 'a',
listData: [],
item:{},
show: false,
total: 0,
tidCid: null
};
},
computed: {
...mapGetters(['notUsedResidueEnergyOption']),
showForm() {
if(this.tidCid.taskId) {
return false
}
return true
},
ifAddBtn() {
if(Object.keys(this.item).length>0) {
return false
}
return true
}
},
methods: {
onLoad() {
if(this.listData.length < this.total) {
this.form.pageNum += 1
this.getInit()
}
},
// 新增修改
toyearenergyaddedit(id) {
// if(this.showForm) {
// return
// }
const enId = this.listData[0]? this.listData[0].enterpriseId: sessionStorage.getItem('enId')
this.$router.push({ path: '/yearenergyaddedit', query: { id: id, tab: this.activeName, enId: enId } })
},
getNotUsed(val) {
if(val) {
let values = val.split(',')
let names = this.notUsedResidueEnergyOption.filter(item => {
return values.some(it => it == item.value)
})
return names.map(item => item.name).join(',')
}
return '未知'
},
onDel(id) {
Dialog.confirm({
title: '提示',
message: '是否确认删除',
beforeClose: async (action, done) => {
if (action === 'confirm') {
await DeleteQyAPI({ ids: id })
done();
Notify({ type: 'success', background: '#34baae', message: '删除成功' })
this.getInit()
}else {
done();
}
}
});
},
async getInit() {
this.show =true
try {
const { data } = await getQyListAPI(this.form)
this.show = false
this.item = data||{}
console.log(data, 'ppppppppppppp');
// this.listData = this.listData.concat(data.list)
// this.total = data.total
// // 加载状态结束
// this.loading = false;
// // 数据全部加载完成
// if (this.listData.length >= data.total) {
// this.finished = true;
// }
} catch (error) {
this.show = false
}
}
},
created() {
this.tidCid = JSON.parse(sessionStorage.getItem('tidCid'))
// 获取字典表里面的接口进行vuex缓存
this.$store.dispatch('setzdTable', { id: 80000001038, type: 'gywlyyn', option: 'notUsedResidueEnergyOption' } )
this.$store.dispatch('setzdTable', { id: 80000001039, type: 'yrpfwd', option: 'residueHotTempOption' } )
this.$store.dispatch('setzdTable', { id: 80000001040, type: 'yrpfsj', option: 'residueHotTimeOption' } )
this.$store.dispatch('setzdTable', { id: 80000001041, type: 'gywlyyn', option: 'heatDemandOption' } )
// this.infoData = JSON.parse(sessionStorage.getItem('tidCid')).customerId
if(this.$route.query.tab) {
this.activeName = this.$route.query.tab
}
},
mounted() {
// console.log(this.infoData);
this.form.customerId = this.tidCid.customerId
this.form.taskId = this.tidCid.taskId
this.getInit()
}
};
</script>
<style lang="less" scoped>
.padding {
padding: 10px 15px;
}
.container {
padding: 20px;
height: calc(100vh - 160px);
overflow: auto;
}
.titleClass {
font-size: 16px;
font-weight: bold;
}
.valueClass {
font-size: 12px;
}
.content_c {
display: flex;
justify-content: space-between;
width: 100%;
}
.tab {
padding-top: 10px;
height: 100%; // overflow: auto;
}
::v-deep .van-tabs__nav {
padding: 0.05rem;
box-sizing: border-box;
}
::v-deep .van-tab:nth-child(1) {
border-top-left-radius: 5px;
border-bottom-left-radius: 5px;
}
::v-deep .van-tabs--card > .van-tabs__wrap {
height: 40px;
}
::v-deep .van-tabs__nav--card {
box-sizing: border-box;
height: 40px;
margin: 0 0.426667rem;
border: 2px solid #fff;
border-color: #fff !important;
border-radius: 8px;
overflow: hidden;
box-shadow: 1px 1px 10px 1px rgb(225, 225, 225, 0);
}
.footer-btn {
// height: 35px;
padding: 0 0.4rem;
> div {
position: fixed;
bottom: 10px;
width: 92%;
background: #34baae;
border-radius: 10px;
// line-height: 35px;
text-align: center;
color: #fff;
}
}
.van-cell__title,
.van-cell__value {
/* -webkit-box-flex: 1; */
/* -webkit-flex: 1; */
flex: auto;
}
.van-cell__title {
font-size: 16px;
}
.van-cell {
position: unset;
display: -webkit-box;
display: -webkit-flex;
display: flex;
box-sizing: border-box;
width: 100%;
padding: 0.366667rem 0.426667rem;
overflow: hidden;
color: #323233;
font-size: 0.373333rem;
line-height: 0.64rem;
background-color: #fff;
}
.box-bottom {
background-color: #fff;
padding: 0 8px 15px;
.data-box {
width: 100%;
// background: #edf9f6;
border-radius: 10px;
padding: 10px 8px;
box-sizing: border-box;
display: flex;
justify-content: space-between;
table {
margin-top: 5px;
border-collapse: collapse;
width: 100%;
th,
td {
border: 0.5px solid #4d4d4d;
text-align: center;
padding: 1px 3px;
width: 30%;
}
th {
color: #40aba2;
font-weight: 500;
}
}
}
.dataContent {
width: 100%;
background: #edf9f6;
border-radius: 10px;
padding: 10px 8px;
box-sizing: border-box;
font-size: 12px;
}
}
.word-style {
font-size: 12px;
color: #a0a1a1;
.word-bottom {
margin-top: 3px;
span {
color: #6bceb9;
}
}
}
::v-deep .van-swipe-cell__right {
right: -22px;
-webkit-transform: translate3d(100%, 0, 0);
transform: translate3d(100%, 0, 0);
color: red;
display: flex;
align-items: center;
}
.add {
width: 100%;
background: #fff;
border-radius: 8px;
text-align: center;
padding: 10px 0;
box-sizing: border-box;
color: #34baae;
}
.two-button {
padding: 15px;
display: flex;
justify-content: space-between;
}
.two-button > p {
color: #969799;
}
.two-button > div {
color: #34baae;
}
.van-cell__value {
position: relative;
overflow: hidden;
color: #969799;
text-align: right;
vertical-align: middle;
word-wrap: break-word;
display: flex;
justify-content: flex-end;
}
.title {
font-size: 16px;
color: #000;
}
::v-deep .van-field__label {
-webkit-box-flex: 0;
-webkit-flex: none;
flex: none;
box-sizing: border-box;
width: 6.2em;
margin-right: 0.32rem;
color: #323233;
text-align: left;
word-wrap: break-word;
font-size: 16px;
width: 75%;
}
.partTwo-question {
width: 100%;
background-color: #fff;
border-radius: 8px 8px 0 0;
padding: 20px 10px;
box-sizing: border-box;
font-size: 16px;
color: #000;
display: flex;
justify-content: space-between;
}
.btn2 {
display: flex;
.btn-click2 {
display: flex;
align-items: center;
span {
color: #9d9d9d;
font-size: 16px;
}
}
.round-out {
width: 12px;
height: 12px;
border-radius: 50%;
margin: 0 7px;
display: flex;
justify-content: center;
align-items: center;
overflow: hidden;
.round-in {
width: 8px;
height: 8px;
border-radius: 50%;
}
}
.yes-out {
border: 2.5px solid #34baae;
.yes-in {
background: #34baae;
}
}
.no-out {
border: 2px solid #b3b3b3;
}
}
.wrapper {
display: flex;
align-items: center;
justify-content: center;
height: 100%;
}
</style>
+667
View File
@@ -0,0 +1,667 @@
<template>
<div>
<!-- 头部 -->
<!-- <Header :title="title" @onClickLeft="onClickLeft" /> -->
<div class="container">
<div>
<!-- <div class="title" style="margin-top: 20px;margin-left: 5px;">通用能源系统</div> -->
<div class="partTwo-box">
<div class="partTwo-content">
<div class="title">风机系统基本信息 <span style="font-size: 14px; color: #bbbbbb;">单机额定功率≥20kW</span></div>
<van-swipe-cell :right-width="65" v-for="(item, index) in list" :key="index">
<div class="msg-card" @click="fengjisystemaddedit(item.id)">
<div>
<div style="text-align: center;margin-top: 3px;"><van-icon name="credit-pay" color="#fff"
size="22px" /></div>
<div>x {{ item.systemNum }} 台</div>
</div>
<div>
<div class="space-between">
<span>风机 {{ item.systemModel }} / 电机 {{ item.motorModel }} </span><span><van-icon name="arrow" color="#fff" /></span>
</div>
<div class="space-between" style="margin-top: 10px;font-size: 12px;">
<span>单台额定功率:{{ item.ratedPowerValue }} kVA</span><span>变频占比: {{ item.frequencyPerValue }} %</span>
</div>
</div>
</div>
<span slot="right" @click="remove(item.id)">删除</span>
</van-swipe-cell>
<div class="add-box" @click="fengjisystemaddedit('')">
+ 新增
</div>
</div>
</div>
<div>
<div class="title" style="margin-top: 20px;margin-left: 5px;margin-bottom: 15px;">能效问卷</div>
<div class="partThree-question" v-for="(item, index) in askList" :key="index">
<div>{{ index + 1 }} 、 {{ item.enquireTitle }}</div>
<div class="btn2">
<div class="btn-click2" @click="buttonClick(item, index)">
<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-click2" @click="buttonNoClick(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>
</div>
</div>
<div class="upload-group">
<van-cell class="title" title="设备外观" :required="$store.getters.cityType"/>
<Uploader type="text1" :value="text1"
@afterRead="afterRead"
@delImg="delImg"
@onUpload="onUpload" />
<div class="tips tipImage" v-if="$store.getters.cityType&&text1.length<1">请上传设备外观照片</div>
<!-- <div class="picStyle borderBot">
<div class="title">设备外观</div>
<div class="pic">
<Uploader
type="text1"
:value="text1"
@afterRead="afterRead"
@delImg="delImg"
@onUpload="onUpload"
/>
</div>
</div> -->
<div class="picStyle borderBot">
<div class="title">设备铭牌</div>
<div class="pic">
<Uploader
type="text2"
:value="text2"
@afterRead="afterRead"
@delImg="delImg"
@onUpload="onUpload"
/>
</div>
</div>
<div class="picStyle">
<div class="title">设备能效标识</div>
<div class="pic">
<Uploader
type="text3"
:value="text3"
@afterRead="afterRead"
@delImg="delImg"
@onUpload="onUpload"
/>
</div>
</div>
</div>
<div class="footer-btn" @click="save">
<div>保存</div>
</div>
</div>
</div>
<van-overlay :show="show">
<div class="wrapper" @click.stop>
<div class="block">
<van-loading size="24px" color="#34baae" vertical>加载中...</van-loading>
</div>
</div>
</van-overlay>
</div>
</template>
<script>
import { buildAsk } from '@/api/api.js'
import { fanList, fanRemove, enterprisGetInfo, enterprisEdit, enterprisAdd } from "@/api/universalEnergy.js";
import { Notify } from "vant";
import Uploader from '@/views/facilityManage/common-vue/uploader.vue'
import { downloadUrl } from '@/settings'
// import Header from "@/components/headerNew";
export default {
components: {
// Header,
Uploader
},
data() {
return {
newAnswer: [], // 问答题存
title: '风机系统',
userMsg: {}, // 任务列表单条数据
list:[], // 列表
item: {
type: Object,
default: () => { },
},
aarr: [],
aarr1: [],
fanEnquireIds: '',
id: '',
customerId: '',
askList: [], // 问询列表
show: false,
getid: '',
enterpriseSystemId: '',
tidCid: null,
text1:[],
text2:[],
text3:[],
img1:'0,0,0',
img2:'0,0,0',
img4:'0,0,0',
}
},
created() {
this.tidCid = JSON.parse(sessionStorage.getItem('tidCid'))
this.getAsk()
this.enterpriseSystemId = sessionStorage.getItem('enterpriseSystemId');
let msg2 = JSON.parse(localStorage.getItem('customerItem'));
if(msg2) {
this.getid = msg2.id
}
this.getList();
},
// activated() {
// // let objMsg2 = JSON.parse(msg2);
// // if (msg) {
// // this.userMsg = JSON.parse(msg);
// // } else {
// // this.userMsg = objMsg2;
// // }
// },
computed: {
showForm() {
if(this.tidCid.taskId) {
return false
}
return true
},
},
methods: {
/**
* 图片方法
*/
//浏览器 ios 会走这个方法
afterRead(data, type) {
this[type] = [data.attach_id]
data.type = type
},
//安卓会调用的方法
onUpload(data, type) {
this[type] = [data[0].url]
},
delImg(file, detail, type) {
if(type == 'text1') {
this.delIsObj(this.text1)
this.text1 = []
}
if(type == 'text2') {
this.delIsObj(this.text2)
this.text2 = []
}
if(type == 'text3') {
this.delIsObj(this.text3)
this.text3 = []
}
},
//判断删除的list中是否为对象格式
delIsObj(delList) {
const list = delList.map((ele) => {
if(ele instanceof Object) {
return ele.url
}
return ele
})
return list
},
// 图片格式化
fomattPic() {
if(this.text1.length == 0) {
this.text1 = ['0']
}
if(this.text2.length == 0) {
this.text2 = ['0']
}
if(this.text3.length == 0) {
this.text3 = ['0']
}
if(this.text1.length > 0 && this.text1[0] instanceof Object) {
this.text1 = [this.text1[0].url.split('download/')[1]]
} else if(this.text1.length > 0 && this.text1[0].split('download/').length > 1) {
this.text1 = [this.text1[0].split('download/')[1]]
}
if(this.text2.length > 0 && this.text2[0] instanceof Object) {
this.text2 = [this.text2[0].url.split('download/')[1]]
} else if(this.text2.length > 0 && this.text2[0].split('download/').length > 1) {
this.text2 = [this.text2[0].split('download/')[1]]
}
if(this.text3.length > 0 && this.text3[0] instanceof Object) {
this.text3 = [this.text3[0].url.split('download/')[1]]
} else if(this.text3.length > 0 && this.text3[0].split('download/').length > 1) {
this.text3 = [this.text3[0].split('download/')[1]]
}
const text = this.text1.concat(this.text2, this.text3)
return text
},
//判断是否为对象格式
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
},
// 获取问询信息
getAsk() {
buildAsk({ enquireMode: 'gyfjwx' }).then((res) => {
if (res.code == 0) {
res.data.forEach((v) => {
if(v.enquireId == 66) {
v.color = false
} else {
v.color = true
}
})
this.askList = res.data
this.newAnswer = res.data.map((item) => {
if(item.enquireId == 66) {
return 0
}
return item.enquireId
})
this.getEnterprisGetInfo()
}
})
},
// 获取内容信息
async getEnterprisGetInfo() {
this.show = true
let tidCid = JSON.parse(sessionStorage.getItem('tidCid'))
let customerId = tidCid.customerId;
let taskId = tidCid.taskId;
const res = await enterprisGetInfo({customerId, taskId});
if (res.code == 0) {
this.show = false
this.fanEnquireIds = res.data.fanEnquireIds;
this.customerId = res.data.customerId;
this.id = res.data.id;
if(res.data.fanEnquireIds) {
this.newAnswer = res.data.fanEnquireIds.split(',')
}
if(this.askList && this.askList.length > 0) {
const list = this.newAnswer.filter((ele) => ele != 0)
this.askList.forEach((v)=>{
v.color = false
list.forEach((ev)=>{
if(v.enquireId == ev) {
v.color = true
}
})
})
}
if(res.data.text3) {
if(res.data.text3.split(',')[0] != 0) {
this.text1.push({
url:`${downloadUrl}${res.data.text3.split(',')[0]}`
})
}
if(res.data.text3.split(',')[1] != 0) {
this.text2.push({
url:`${downloadUrl}${res.data.text3.split(',')[1]}`
})
}
if(res.data.text3.split(',')[2] != 0) {
this.text3.push({
url:`${downloadUrl}${res.data.text3.split(',')[2]}`
})
}
if(res.data.text1) {
this.img1 = res.data.text1
}
if(res.data.text2) {
this.img2 = res.data.text2
}
if(res.data.text4) {
this.img4 = res.data.text4
}
}
} else {
this.show = false
}
},
buttonClick(item, index) {
if(this.showForm) {
return
}
this.newAnswer[index] = item.enquireId
if (!item.color) {
item.color = true
this.aarr.push(item.enquireId)
this.aarr = [...new Set(this.aarr)]
if(item.enquireId == 65 || item.enquireId == 66) {
this.changeId(item, [65, 66])
}
}
},
buttonNoClick(item, index) {
if(this.showForm) {
return
}
this.newAnswer[index] = 0
item.color = false
this.aarr.splice(this.aarr.indexOf(item.enquireId), 1)
const i = this.aarr1.findIndex((ele) => ele == item.enquireId)
this.aarr1.splice(i, 1)
},
changeId(item, numList) {
const num = numList.find((ele)=> ele != item.enquireId)
const enqIndex = this.newAnswer.findIndex((ele)=> ele == num)
if(enqIndex > -1) {
this.newAnswer.splice(enqIndex, 1, 0)
}
this.askList.forEach((v)=> {
if(v.enquireId == num) {
v.color = false
}
})
},
save() {
if(this.showForm||(this.$store.getters.cityType&&this.text1.length<1)) {
return
}
const text3 = this.fomattPic()
let enterpriseId = sessionStorage.getItem('enId')
let formIds = this.newAnswer.toString();
console.log(formIds);
if (enterpriseId) {
let params = {
customerId: this.customerId,
// id: this.id,
id:this.enterpriseSystemId,
taskId: this.tidCid.taskId,
enterpriseId: enterpriseId,
fanEnquireIds: formIds,
systemTypes: this.$route.query.item,
text3: this.ifObj(text3).join(','),
text1: this.img1,
text2: this.img2,
text4: this.img4
}
enterprisEdit(params).then((res) => {
if (res.code == 0) {
Notify({ type: "success", background: '#34baae', message: "保存成功" });
} else {
this.$toast(res.msg)
}
})
} else {
let params = {
customerId: this.customerId,
id: this.tidCid.taskId,
enterpriseId: enterpriseId,
fanEnquireIds: formIds,
systemTypes: this.$route.query.item,
text3: this.ifObj(text3).join(','),
text1: this.img1,
text2: this.img2,
text4: this.img4
}
enterprisAdd(params).then((res) => {
if (res.code == 0) {
Notify({ type: "success", background: '#34baae', message: "保存成功" });
} else {
this.$toast(res.msg)
}
})
}
this.$router.push('./acquisition')
},
// 跳转
fengjisystemaddedit(id) {
if(this.showForm) {
return
}
this.$router.push({ path: './fengjisystemaddedit', query: {id: id} })
},
// 列表
async getList() {
const params = {
customerId: this.userMsg.customerId,
systemId: this.enterpriseSystemId ? this.enterpriseSystemId : this.getid
}
const res = await fanList(params);
if(res.code == 0) {
this.list = res.data
}
},
// 删除
remove(ids) {
if(this.showForm) {
return
}
fanRemove(ids).then((res) => {
if(res.code == 0) {
this.getList();
Notify({ type: 'success', background: '#34baae', message: '删除成功' })
}else {
Notify({ type: 'error', background: 'red', message: res.msg })
}
})
}
}
}
</script>
<style lang="less" scoped>
.container {
padding: 0 20px;
}
.title {
font-size: 15px;
color: #000;
}
.partTwo-box {
width: 100%;
border-radius: 8px;
padding: 0 15px 10px;
box-sizing: border-box;
background-color: #fff;
overflow: hidden;
margin-top: 15px;
.partTwo-content {
margin-top: 10px;
.add-box {
width: 100%;
padding: 10px 0;
box-sizing: border-box;
border-radius: 5px;
border: 1px solid #63cbb6;
background-color: #e0f5f0;
color: #63cbb6;
text-align: center;
margin-top: 15px;
}
}
}
.msg-card {
margin-top: 10px;
background: #63cbb6;
padding: 15px;
border-radius: 6px;
color: #fff;
display: flex;
justify-content: space-between;
}
.space-between {
width: 230px;
display: flex;
justify-content: space-between;
}
::v-deep .van-swipe-cell__right {
right: -20px;
-webkit-transform: translate3d(100%, 0, 0);
transform: translate3d(100%, 0, 0);
display: flex;
align-items: center;
color: red;
}
.partThree-question {
width: 100%;
background-color: #fff;
border-radius: 8px;
padding: 20px 10px;
box-sizing: border-box;
font-size: 14px;
color: #000;
.btn2 {
display: flex;
justify-content: flex-end;
}
}
.btn2 {
margin-top: 20px;
display: flex;
.btn-click2 {
display: flex;
align-items: center;
span {
color: #9d9d9d;
font-size: 14px;
}
}
.round-out {
width: 12px;
height: 12px;
border-radius: 50%;
margin: 0 7px;
display: flex;
justify-content: center;
align-items: center;
overflow: hidden;
.round-in {
width: 8px;
height: 8px;
border-radius: 50%;
}
}
.yes-out {
border: 2.5px solid #34baae;
.yes-in {
background: #34baae;
}
}
.no-out {
border: 2px solid #b3b3b3;
}
}
.footer-btn {
margin-top: 180px;
height: 35px;
// padding: 0 0.4rem;
>div {
position: fixed;
bottom: 0.533333rem;
width: 90%;
background: #34baae;
border-radius: 0.266667rem;
line-height: 0.933333rem;
text-align: center;
color: #fff;
z-index: 99999;
}
}
.wrapper {
display: flex;
align-items: center;
justify-content: center;
height: 100%;
}
.upload-group {
background: #fff;
margin-top: 0.2rem;
padding: 0.2rem;
border-radius: 0.2rem;
}
.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);
}
}
.tips {
padding: 0 16px;
display: flex;
justify-content: flex-end;
color: #ee0a24;
font-size: 12px;
}
.tipImage{
justify-content: flex-start
}
</style>
@@ -0,0 +1,270 @@
<template>
<div>
<!-- <Header :title="title" @onClickLeft="onClickLeft" /> -->
<van-form ref="form" @submit="handelClickSave">
<div class="yearenergy">
<div class="year-main">
<div class="nengyuan">
<van-cell-group>
<van-field v-model="form.systemModel" required :rules="[{ required: true },{pattern:/^.{2,20}$/, message:'2≤型号长度≤20'}]" label="风机型号" placeholder="请输入风机型号" maxlength="20" />
<van-field v-model="form.motorModel" required :rules="[{ required: true },{pattern:/^.{2,20}$/, message:'2≤型号长度≤20'}]" label="电机型号" placeholder="请输入电机型号" maxlength="20"/>
<van-field v-input.numNo0 v-model="form.systemNum" required :rules="[{ required: true }]" type="number" label="台数(台)" placeholder="请输入台数" />
<van-field v-input.floatNo0 v-model="form.ratedPowerValue" required :rules="[{ required: true }]" type="number" label="单台额定功率(kW)" placeholder="请输入" @blur="handelChange('ratedPowerValue',20,'单台额定功率')"/>
<van-field v-input.float v-model="form.frequencyPerValue" required :rules="[{ required: true }]" type="number" label="变频占比(%)" placeholder="请输入" @input="handelChangeNumber('frequencyPerValue','变频占比')" />
<van-field v-input.num v-model="form.absoleteElecNum" type="number" label="淘汰电机数量" placeholder="请输入" />
<van-field v-input.num v-model="form.absoleteNum" type="number" label="淘汰风机数量" placeholder="请输入" />
<van-field v-input.floatNo0 v-model="form.efficiency" type="number" label="风机效率(%)" placeholder="请输入" @input="handelChangeNumber('efficiency','风机效率')" />
<van-field v-input.num v-model="form.userYear" type="number" label="投入年份" placeholder="请选择投入年份" is-link readonly @click="handelClickYear('userYear', 'SET_CON_YEAR')" />
</van-cell-group>
</div>
</div>
<div class="btn">
<van-button size="large" class="faqi" native-type="submit">
保存
</van-button>
</div>
</div>
</van-form>
<van-overlay :show="show">
<div class="wrapper" @click.stop>
<div class="block">
<van-loading size="24px" color="#34baae" vertical>加载中...</van-loading>
</div>
</div>
</van-overlay>
<Year :show="yearShow" :num="1" @onConfirmYear="onConfirmYear" @onCancelYear="onCancelYear" />
</div>
</template>
<script>
import { fanAdd, fanGetInfo, fanEdit } from "@/api/universalEnergy.js"
import { Notify } from "vant";
// import Header from "@/components/headerNew";
import mixin from '@/mixins/mixin'
import Year from '../facilityManage/common-vue/year.vue'
export default {
components: {
// Header,
Year
},
mixins: [mixin],
data() {
return {
title: '新增/修改',
id: '', // 查详情时取的id
userMsg: {}, // 任务列表单条数据
form: {
systemModel: '',
motorModel: '',
systemNum: '',
ratedPowerValue: '',
frequencyPerValue: '',
absoleteElecNum: '',
absoleteNum: '',
efficiency: '',
userYear: '',
},
show: false
};
},
activated() {
this.id = '',
this.form = {
systemModel: '',
motorModel: '',
systemNum: '',
ratedPowerValue: '',
frequencyPerValue: '',
absoleteElecNum: '',
absoleteNum: '',
efficiency: '',
userYear: '',
};
let msg = JSON.parse(sessionStorage.getItem('tidCid'));
this.userMsg = msg
// let msg2 = localStorage.getItem('customerItem');
// let objMsg2 = JSON.parse(msg2);
// if(msg) {
// this.userMsg = JSON.parse(msg);
// this.addeditId = this.userMsg.id
// }else {
// this.userMsg = objMsg2;
// this.addeditId = localStorage.getItem('taskId')
// }
const id = this.$route.query.id;
if(id.isTrusted == undefined) {
this.id = this.$route.query.id;
this.getGetInfo()
}
},
mounted() {
},
methods: {
handelChange (params,num,name) {
if(Number(this.form[params]) < Number(num)) {
Notify({ type: "danger", message: `${name}≥${num}` });
this.form[params] = ''
}
},
handelChangeNumber (params,name) {
if(params === 'efficiency'){
if(!(Number(this.form[params]) < 100)) {
Notify({ type: "danger", message: `${name}不可超过100%` });
this.form[params] = 0
}
}else{
if(Number(this.form[params]) > 100) {
Notify({ type: "danger", message: `${name}不可超过100%` });
this.form[params] = 0
}
}
},
// 返回
onClickLeft() {
this.$router.go(-1)
},
async handelClickSave() {
if(this.id == '') {
this.form.id = sessionStorage.getItem('enterpriseSystemId') ? this.form.systemId = sessionStorage.getItem('enterpriseSystemId') : this.userMsg.taskId;
this.form.customerId = this.userMsg.customerId;
this.form.systemId = sessionStorage.getItem('enterpriseSystemId') ? this.form.systemId = sessionStorage.getItem('enterpriseSystemId') : this.userMsg.taskId;
this.form.systemTypes = '03';
const res = await fanAdd(this.form);
if(res.code == 0) {
this.$router.go(-1);
Notify({ type: "success", background: '#34baae', message: "保存成功" });
return
}
Notify({ type: "error", background: 'red', message: res.msg })
}else {
this.form.id = this.id;
this.form.customerId = this.userMsg.customerId;
this.form.systemId = sessionStorage.getItem('enterpriseSystemId') ? this.form.systemId = sessionStorage.getItem('enterpriseSystemId') : this.userMsg.taskId;
this.form.systemTypes = '03';
const res = await fanEdit(this.form);
if(res.code == 0) {
this.$router.go(-1);
Notify({ type: "success", background: '#34baae', message: "保存成功" });
return
}
Notify({ type: "error", background: 'red', message: res.msg })
}
},
async getGetInfo() {
this.show = true
const res = await fanGetInfo(this.id);
if(res.code == 0) {
this.form = res.data
this.show = false
}else {
this.show = false
}
}
},
};
</script>
<style lang="less" scoped>
::v-deep .van-field__error-message{
text-align: right;
}
.yearenergy {
padding: 15px 10px;
.year-main {
height: calc(100vh - 5rem);
overflow: auto;
}
.year {
// padding: 20px 20px;
border-radius: 10px;
}
.title {
margin: 10px;
display: flex;
.title-img {
width: 20px;
img {
width: 100%;
}
}
p {
font-size: 14px;
color: #009999;
line-height: 20px;
}
}
.nengyuan {
width: 100%;
border-radius: 10px;
background: #fff;
box-sizing: border-box;
overflow: hidden;
}
.faqi {
background-color: #63cbb6;
color: #fff;
border-radius: 8px;
}
}
/deep/ .van-cell {
width: 100%;
display: flex;
}
.van-cell__title,
.van-cell__value {
-webkit-box-flex: 1;
-webkit-flex: 1;
flex: 1;
span {
font-size: 14px;
color: #333;
}
}
::v-deep .van-field__label {
-webkit-box-flex: 0;
-webkit-flex: none;
flex: none;
box-sizing: border-box;
flex: 1;
text-align: left;
word-wrap: break-word;
span {
font-size: 14px;
color: #333;
}
}
::v-deep .van-cell__value {
position: relative;
overflow: hidden;
color: #969799;
text-align: right;
vertical-align: middle;
word-wrap: break-word;
}
::v-deep .van-field__body {
display: -webkit-box;
display: -webkit-flex;
display: flex;
-webkit-box-align: center;
-webkit-align-items: center;
align-items: center;
}
::v-deep .van-field__control {
text-align: right;
font-size: 14px;
}
.wrapper {
display: flex;
align-items: center;
justify-content: center;
height: 100%;
}
</style>
+651
View File
@@ -0,0 +1,651 @@
<template>
<div>
<!-- 头部 -->
<!-- <Header :title="title" @onClickLeft="onClickLeft" /> -->
<div class="container">
<div></div>
<div>
<!-- <div class="title" style="margin-top: 20px;margin-left: 5px;">通用能源系统</div> -->
<div class="partTwo-box">
<div class="partTwo-content">
<div class="title">配电系统基本信息 <span style="font-size: 14px; color: #bbbbbb;"> 35kV 及以上</span></div>
<van-swipe-cell :right-width="65" v-for="(item, index) in list" :key="index">
<div class="msg-card" @click="generalenergyaddedit(item.id)">
<div>
<div style="text-align: center;margin-top: 3px;"><van-icon name="credit-pay" color="#fff" size="22px" />
</div>
<div>x {{ item.systemNum }} 台</div>
</div>
<div>
<div class="space-between">
<span>型号 {{ item.systemModel }} </span><span><van-icon name="arrow" color="#fff" /></span>
</div>
<div class="space-between" style="margin-top: 10px;font-size: 12px;">
<span>额定容量:{{ item.ratedCapacityValue }} kVA</span><span>额定一次电压:{{ item.ratedVoltageValue }} kV</span>
</div>
</div>
</div>
<span slot="right" @click="remove(item.id)">删除</span>
</van-swipe-cell>
<div class="add-box" @click="generalenergyaddedit('')">
+ 新增
</div>
</div>
</div>
<div>
<div class="title" style="margin-top: 20px;margin-left: 5px;margin-bottom: 15px;">能效问卷</div>
<div class="partThree-question" v-for="(item, index) in askList" :key="index" >
<div>{{ index + 1 }} 、 {{ item.enquireTitle }}</div>
<div class="btn2">
<div class="btn-click2" @click="buttonClick(item, index)">
<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-click2" @click="buttonNoClick(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>
</div>
</div>
<div class="upload-group">
<van-cell class="img-box box1" title="设备外观" :required="$store.getters.cityType"/>
<Uploader type="text1" :value="text1"
@afterRead="afterRead"
@delImg="delImg"
@onUpload="onUpload" />
<div class="tips tipImage" v-if="$store.getters.cityType&&text1.length<1">请上传设备外观照片</div>
<!-- <div
class="picStyle borderBot"
>
<div class="title">设备外观</div>
<div class="pic">
<Uploader
type="text1"
:value="text1"
@afterRead="afterRead"
@delImg="delImg"
@onUpload="onUpload"
/>
</div>
</div> -->
<div class="picStyle borderBot">
<div class="title">设备铭牌</div>
<div class="pic">
<Uploader
type="text2"
:value="text2"
@afterRead="afterRead"
@delImg="delImg"
@onUpload="onUpload"
/>
</div>
</div>
<div class="picStyle">
<div class="title">设备能效标识</div>
<div class="pic">
<Uploader
type="text3"
:value="text3"
@afterRead="afterRead"
@delImg="delImg"
@onUpload="onUpload"
/>
</div>
</div>
</div>
<div class="footer-btn" @click="save">
<div>保存</div>
</div>
</div>
</div>
<van-overlay :show="show">
<div class="wrapper" @click.stop>
<div class="block">
<van-loading size="24px" color="#34baae" vertical>加载中...</van-loading>
</div>
</div>
</van-overlay>
</div>
</template>
<script>
import {
buildAsk,
} from '@/api/api.js'
import { distributeList, distributeRemove, enterprisGetInfo, enterprisEdit, enterprisAdd } from "@/api/universalEnergy.js";
import { Notify } from "vant";
import Uploader from '@/views/facilityManage/common-vue/uploader.vue'
import { downloadUrl } from '@/settings'
// import Header from "@/components/headerNew";
export default {
components: {
// Header,
Uploader
},
data() {
return {
newAnswer: [], // 问答题存
title: '配电系统',
userMsg: {}, // 任务列表单条数据
list: [], // 列表
askList: [], // 问询列表
item: {
type: Object,
default: () => { },
},
aarr: [],
aarr1: [],
distributeEnquireIds: '',
id: '',
customerId: '',
show: false,
getid: '',
enterpriseSystemId: '',
tidCid: null,
text1:[],
text2:[],
text3:[],
img2:'0,0,0',
img3:'0,0,0',
img4:'0,0,0',
}
},
created() {
this.tidCid = JSON.parse(sessionStorage.getItem('tidCid'))
this.getAsk()
this.enterpriseSystemId = sessionStorage.getItem('enterpriseSystemId');
let msg2 = JSON.parse(localStorage.getItem('customerItem'));
if(msg2) {
this.getid = msg2.id
}
this.getList();
},
activated() {
// let objMsg2 = JSON.parse(msg2);
// if (msg) {
// this.userMsg = JSON.parse(msg);
// } else {
// this.userMsg = objMsg2;
// }
},
computed: {
showForm() {
if(this.tidCid.taskId) {
return false
}
return true
},
},
methods: {
/**
* 图片方法
*/
//浏览器 ios 会走这个方法
afterRead(data, type) {
this[type] = [data.attach_id]
},
//安卓会调用的方法
onUpload(data, type) {
this[type] = [data[0].url]
},
delImg(file, detail, type) {
if(type == 'text1') {
this.delIsObj(this.text1)
this.text1 = []
}
if(type == 'text2') {
this.delIsObj(this.text2)
this.text2 = []
}
if(type == 'text3') {
this.delIsObj(this.text3)
this.text3 = []
}
},
//判断删除的list中是否为对象格式
delIsObj(delList) {
const list = delList.map((ele) => {
if(ele instanceof Object) {
return ele.url
}
return ele
})
return list
},
// 图片格式化
fomattPic() {
if(this.text1.length == 0) {
this.text1 = ['0']
}
if(this.text2.length == 0) {
this.text2 = ['0']
}
if(this.text3.length == 0) {
this.text3 = ['0']
}
if(this.text1.length > 0 && this.text1[0] instanceof Object) {
this.text1 = [this.text1[0].url.split('download/')[1]]
} else if(this.text1.length > 0 && this.text1[0].split('download/').length > 1) {
this.text1 = [this.text1[0].split('download/')[1]]
}
if(this.text2.length > 0 && this.text2[0] instanceof Object) {
this.text2 = [this.text2[0].url.split('download/')[1]]
} else if(this.text2.length > 0 && this.text2[0].split('download/').length > 1) {
this.text2 = [this.text2[0].split('download/')[1]]
}
if(this.text3.length > 0 && this.text3[0] instanceof Object) {
this.text3 = [this.text3[0].url.split('download/')[1]]
} else if(this.text3.length > 0 && this.text3[0].split('download/').length > 1) {
this.text3 = [this.text3[0].split('download/')[1]]
}
const text = this.text1.concat(this.text2, this.text3)
return text
},
//判断是否为对象格式
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
},
// 获取问询信息
getAsk() {
buildAsk({ enquireMode: 'gypdwx' })
.then((res) => {
if (res.code == 0) {
res.data.forEach((v) => {
v.color = true
})
this.askList = res.data
this.newAnswer = res.data.map((item) => {
return item.enquireId
})
this.getEnterprisGetInfo()
}
})
.catch(() => {
// this.$toast(error);
})
},
// 获取内容信息
async getEnterprisGetInfo() {
this.show = true
let tidCid = JSON.parse(sessionStorage.getItem('tidCid'))
let customerId = tidCid.customerId;
let taskId = tidCid.taskId;
const res = await enterprisGetInfo({customerId, taskId});
if(res.code == 0) {
this.show = false
this.distributeEnquireIds = res.data.distributeEnquireIds;
sessionStorage.setItem('enterpriseSystemId', res.data.id)
this.customerId = res.data.customerId;
this.id = res.data.id;
if(res.data.distributeEnquireIds) {
this.newAnswer = res.data.distributeEnquireIds.split(',')
}
if(this.askList && this.askList.length > 0) {
const list = this.newAnswer.filter((ele) => ele != 0)
this.askList.forEach((v)=>{
v.color = false
list.forEach((ev)=>{
if(v.enquireId == ev) {
v.color = true
}
})
})
}
if(res.data.text1) {
if(res.data.text1.split(',')[0] != 0) {
this.text1.push({
url:`${downloadUrl}${res.data.text1.split(',')[0]}`
})
}
if(res.data.text1.split(',')[1] != 0) {
this.text2.push({
url:`${downloadUrl}${res.data.text1.split(',')[1]}`
})
}
if(res.data.text1.split(',')[2] != 0) {
this.text3.push({
url:`${downloadUrl}${res.data.text1.split(',')[2]}`
})
}
if(res.data.text2) {
this.img2 = res.data.text2
}
if(res.data.text3) {
this.img3 = res.data.text3
}
if(res.data.text4) {
this.img4 = res.data.text4
}
}
} else {
this.show = false
}
},
buttonClick(item, index) {
if(this.showForm) {
return
}
this.newAnswer[index] = item.enquireId
if (!item.color) {
item.color = true
this.aarr.push(item.enquireId)
this.aarr = [...new Set(this.aarr)]
}
// // this.askList[index].enquireType = 3;
// item.color = true
},
buttonNoClick(item, index) {
if(this.showForm) {
return
}
this.newAnswer[index] = 0
item.color = false
this.aarr.splice(this.aarr.indexOf(item.enquireId), 1)
const i = this.aarr1.findIndex((ele) => ele == item.enquireId)
this.aarr1.splice(i, 1)
},
// 保存
save() {
if(this.showForm||(this.$store.getters.cityType&&this.text1.length<1)) {
return
}
const text1 = this.fomattPic()
let enterpriseId = sessionStorage.getItem('enId')
let formIds = this.newAnswer.toString();
if(enterpriseId) {
let params = {
customerId: this.customerId,
// id: this.id,
id: this.enterpriseSystemId,
taskId: this.tidCid.taskId,
enterpriseId: enterpriseId,
distributeEnquireIds: formIds,
systemTypes: this.$route.query.item,
text1: this.ifObj(text1).join(','),
text2: this.img2,
text3: this.img3,
text4: this.img4,
}
enterprisEdit(params).then((res) => {
if(res.code == 0) {
Notify({ type: "success", background: '#34baae', message: "保存成功" });
}else {
this.$toast(res.msg)
}
})
}else {
let params = {
customerId: this.customerId,
id: this.tidCid.taskId,
enterpriseId: enterpriseId,
distributeEnquireIds: formIds,
systemTypes: this.$route.query.item,
text1: this.ifObj(this.text1).join(','),
text2: this.img2,
text3: this.img3,
text4: this.img4,
}
enterprisAdd(params).then((res) => {
if(res.code == 0) {
Notify({ type: "success", background: '#34baae', message: "保存成功" });
}else {
this.$toast(res.msg)
}
})
}
this.$router.push('./acquisition')
},
// 跳转
generalenergyaddedit(id) {
if(this.showForm) {
return
}
this.$router.push({ path: './generalenergyaddedit', query: { id: id } })
},
// 列表
async getList() {
const params = {
customerId: this.userMsg.customerId,
systemId: this.enterpriseSystemId ? this.enterpriseSystemId : this.getid
}
const res = await distributeList(params);
if (res.code == 0) {
this.list = res.data
}
},
// 删除
remove(ids) {
if(this.showForm) {
return
}
distributeRemove(ids).then((res) => {
if (res.code == 0) {
this.getList();
Notify({ type: 'success', background: '#34baae', message: '删除成功' })
} else {
Notify({ type: 'error', background: 'red', message: res.msg })
}
})
}
}
}
</script>
<style lang="less" scoped>
.container {
padding: 0 20px;
}
.title {
font-size: 15px;
color: #000;
}
.partTwo-box {
width: 100%;
border-radius: 8px;
padding: 0 15px 10px;
box-sizing: border-box;
background-color: #fff;
overflow: hidden;
margin-top: 15px;
.partTwo-content {
margin-top: 10px;
.add-box {
width: 100%;
padding: 10px 0;
box-sizing: border-box;
border-radius: 5px;
border: 1px solid #63cbb6;
background-color: #e0f5f0;
color: #63cbb6;
text-align: center;
margin-top: 15px;
}
}
}
.msg-card {
margin-top: 10px;
background: #63cbb6;
padding: 15px;
border-radius: 6px;
color: #fff;
display: flex;
justify-content: space-between;
}
.space-between {
width: 230px;
display: flex;
justify-content: space-between;
}
::v-deep .van-swipe-cell__right {
right: -20px;
-webkit-transform: translate3d(100%, 0, 0);
transform: translate3d(100%, 0, 0);
display: flex;
align-items: center;
color: red;
}
.partThree-question {
width: 100%;
background-color: #fff;
border-radius: 8px;
padding: 20px 10px;
box-sizing: border-box;
font-size: 14px;
color: #000;
.btn2 {
display: flex;
justify-content: flex-end;
}
}
.btn2 {
margin-top: 20px;
display: flex;
.btn-click2 {
display: flex;
align-items: center;
span {
color: #9d9d9d;
font-size: 15px;
}
}
.round-out {
width: 12px;
height: 12px;
border-radius: 50%;
margin: 0 7px;
display: flex;
justify-content: center;
align-items: center;
overflow: hidden;
.round-in {
width: 8px;
height: 8px;
border-radius: 50%;
}
}
.yes-out {
border: 2.5px solid #34baae;
.yes-in {
background: #34baae;
}
}
.no-out {
border: 2px solid #b3b3b3;
}
}
.footer-btn {
margin-top: 180px;
height: 35px;
// padding: 0 0.4rem;
>div {
position: fixed;
bottom: 0.533333rem;
width: 90%;
background: #34baae;
border-radius: 0.266667rem;
line-height: 0.933333rem;
text-align: center;
color: #fff;
z-index: 99999;
}
}
.wrapper {
display: flex;
align-items: center;
justify-content: center;
height: 100%;
}
.upload-group {
background: #fff;
margin-top: 0.2rem;
padding: 0.2rem;
border-radius: 0.2rem;
}
.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);
}
}
.tips {
padding: 0 16px;
display: flex;
justify-content: flex-end;
color: #ee0a24;
font-size: 12px;
}
.tipImage{
justify-content: flex-start
}
</style>
@@ -0,0 +1,259 @@
<template>
<div>
<!-- <Header :title="title" @onClickLeft="onClickLeft" /> -->
<van-form ref="form" @submit="handelClickSave">
<div class="yearenergy">
<div class="year-main">
<div class="nengyuan">
<van-cell-group>
<van-field v-model="form.systemModel" required :rules="[{ required: true },{pattern:/^.{2,20}$/, message:'2≤型号长度≤20'}]" label="型号" maxlength="20" placeholder="请输入型号"/>
<van-field v-input.numNo0 v-model="form.systemNum" type="number" required :rules="[{ required: true }]" label="台数(台)" placeholder="请输入台数" />
<van-field v-input.numNo0 v-model="form.ratedCapacityValue" required :rules="[{ required: true }]" ltype="number" label="额定容量(kVA)" placeholder="请输入" @blur="handelChange('ratedCapacityValue',50,'额定容量')"/>
<van-field v-input.floatNo0 v-model="form.ratedVoltageValue" required :rules="[{ required: true }]" type="number" label="额定一次电压(kV)" placeholder="请输入" @blur="handelChange('ratedVoltageValue',10,'额定一次电压')"/>
<van-field v-input.num v-model="form.absoleteElecNum" type="number" label="淘汰电机数量" placeholder="请输入" />
<van-field v-input.num v-model="form.absoleteNum" type="number" label="淘汰变压器数量" placeholder="请输入" />
<van-field v-input.floatNo0 v-model="form.loadRate" required :rules="[{ required: true }]" type="number" label="负载率(%)" placeholder="请输入" @input="handelChangeNumber('loadRate','负载率')" />
<van-field v-input.num v-model="form.userYear" required :rules="[{ required: true }]" type="number" label="投入年份" placeholder="请选择投入年份" is-link readonly @click="handelClickYear('userYear', 'SET_CON_YEAR')" />
</van-cell-group>
</div>
</div>
<div class="btn">
<van-button size="large" class="faqi" native-type="submit">
保存
</van-button>
</div>
</div>
</van-form>
<van-overlay :show="show">
<div class="wrapper" @click.stop>
<div class="block">
<van-loading size="24px" color="#34baae" vertical>加载中...</van-loading>
</div>
</div>
</van-overlay>
<Year :show="yearShow" :num="1" @onConfirmYear="onConfirmYear" @onCancelYear="onCancelYear" />
</div>
</template>
<script>
import { distributeAdd, distributeGetInfo, distributeEdit } from "@/api/universalEnergy.js"
import { Notify } from "vant";
import mixin from '@/mixins/mixin'
import Year from '../facilityManage/common-vue/year.vue'
export default {
components: {
// Header,
Year
},
mixins: [mixin],
data() {
return {
addeditId: '', // 新增修改提交id
title: '新增/修改',
id: '', // 查详情时取的id
userMsg: {}, // 任务列表单条数据
form: {
systemModel: "",
systemNum: "",
ratedCapacityValue: "",
ratedVoltageValue: "",
absoleteElecNum: "",
absoleteNum: "",
loadRate: '',
userYear: '',
},
show: false
};
},
activated() {
this.id = '',
this.form = {
systemModel: "",
systemNum: "",
ratedCapacityValue: "",
ratedVoltageValue: "",
absoleteElecNum: "",
absoleteNum: "",
loadRate: '',
userYear: '',
};
let msg = JSON.parse(sessionStorage.getItem('tidCid'));
// let msg2 = localStorage.getItem('customerItem');
this.userMsg = msg
// let objMsg2 = JSON.parse(msg2);
// if(msg) {
// this.userMsg = JSON.parse(msg);
// this.addeditId = this.userMsg.id
// }else {
// this.userMsg = objMsg2;
// this.addeditId = localStorage.getItem('taskId')
// }
const id = this.$route.query.id;
if(id.isTrusted == undefined) {
this.id = this.$route.query.id;
this.getGetInfo()
}
},
mounted() {
},
methods: {
handelChangeNumber (params,name) {
if(Number(this.form[params]) > 100) {
Notify({ type: "danger", message: `${name}不可超过100%` });
this.form[params] = 0
}
},
handelChange (params,num,name) {
if(Number(this.form[params]) < Number(num)) {
Notify({ type: "danger", message: `${name}≥${num}` });
this.form[params] = ''
}
},
// 返回
onClickLeft() {
this.$router.go(-1)
},
async handelClickSave() {
if(this.id == '') {
this.form.id = sessionStorage.getItem('enterpriseSystemId') ? this.form.systemId = sessionStorage.getItem('enterpriseSystemId') : this.userMsg.taskId;
this.form.customerId = this.userMsg.customerId;
this.form.systemId = sessionStorage.getItem('enterpriseSystemId') ? this.form.systemId = sessionStorage.getItem('enterpriseSystemId') : this.userMsg.taskId;
this.form.systemTypes = '01';
const res = await distributeAdd(this.form);
if(res.code == 0) {
this.$router.go(-1);
Notify({ type: "success", background: '#34baae', message: "保存成功" });
return
}
Notify({ type: "error", background: 'red', message: res.msg })
}else {
this.form.id = this.id;
this.form.customerId = this.userMsg.customerId;
this.form.systemId = sessionStorage.getItem('enterpriseSystemId') ? this.form.systemId = sessionStorage.getItem('enterpriseSystemId') : this.userMsg.taskId;
this.form.systemTypes = '01';
const res = await distributeEdit(this.form);
if(res.code == 0) {
this.$router.go(-1);
Notify({ type: "success", background: '#34baae', message: "保存成功" });
return
}
Notify({ type: "error", background: 'red', message: res.msg })
}
},
async getGetInfo() {
this.show = true
const res = await distributeGetInfo(this.id);
if(res.code == 0) {
this.form = res.data
this.show = false
}else {
this.show = false
}
}
},
};
</script>
<style lang="less" scoped>
.yearenergy {
padding: 15px 10px;
.year-main {
height: calc(100vh - 5rem);
overflow: auto;
}
.year {
// padding: 20px 20px;
border-radius: 10px;
}
.title {
margin: 10px;
display: flex;
.title-img {
width: 20px;
img {
width: 100%;
}
}
p {
font-size: 15px;
color: #009999;
line-height: 20px;
}
}
.nengyuan {
width: 100%;
border-radius: 10px;
background: #fff;
box-sizing: border-box;
overflow: hidden;
}
.faqi {
background-color: #63cbb6;
color: #fff;
border-radius: 8px;
}
}
/deep/ .van-cell {
width: 100%;
display: flex;
}
.van-cell__title,
.van-cell__value {
-webkit-box-flex: 1;
-webkit-flex: 1;
flex: 1;
span {
font-size: 15px;
color: #333;
}
}
::v-deep .van-field__label {
-webkit-box-flex: 0;
-webkit-flex: none;
flex: none;
box-sizing: border-box;
flex: 1;
text-align: left;
word-wrap: break-word;
span {
font-size: 14px;
color: #333;
}
}
::v-deep .van-field__error-message{
text-align: right;
}
::v-deep .van-cell__value {
position: relative;
overflow: hidden;
color: #969799;
text-align: right;
vertical-align: middle;
word-wrap: break-word;
}
::v-deep .van-field__body {
display: -webkit-box;
display: -webkit-flex;
display: flex;
-webkit-box-align: center;
-webkit-align-items: center;
align-items: center;
}
::v-deep .van-field__control {
text-align: right;
font-size: 14px;
}
.wrapper {
display: flex;
align-items: center;
justify-content: center;
height: 100%;
}
</style>
+663
View File
@@ -0,0 +1,663 @@
<template>
<div>
<!-- 头部 -->
<!-- <Header :title="title" @onClickLeft="onClickLeft" /> -->
<div class="container">
<div>
<!-- <div class="title" style="margin-top: 20px;margin-left: 5px;">通用能源系统</div> -->
<div class="partTwo-box">
<div class="partTwo-content">
<div class="title">空压机系统基本信息 <span style="font-size: 14px; color: #bbbbbb;">单机额定功率≥50kW</span></div>
<van-swipe-cell :right-width="65" v-for="(item, index) in list" :key="index">
<div class="msg-card" @click="kongyajisystemaddedit(item.id)">
<div>
<div style="text-align: center;margin-top: 3px;"><van-icon name="credit-pay" color="#fff"
size="22px" /></div>
<div>x {{ item.systemNum }} 台</div>
</div>
<div>
<div class="space-between">
<span>空压机 {{ item.systemModel }} / 电机 {{ item.motorModel }} </span><span><van-icon name="arrow" color="#fff" /></span>
</div>
<div class="space-between" style="margin-top: 10px;font-size: 12px;">
<span>单台额定功率:{{ item.ratedPowerValue }} kVA</span><span>变频占比: {{ item.frequencyPerValue }} %</span>
</div>
</div>
</div>
<span slot="right" @click="remove(item.id)">删除</span>
</van-swipe-cell>
<div class="add-box" @click="kongyajisystemaddedit('')">
+ 新增
</div>
</div>
</div>
<div>
<div class="title" style="margin-top: 20px;margin-left: 5px;margin-bottom: 15px;">能效问卷</div>
<div class="partThree-question" v-for="(item, index) in askList" :key="index" >
<div>{{ index + 1 }} 、 {{ item.enquireTitle }}</div>
<div class="btn2">
<div class="btn-click2" @click="buttonClick(item, index)">
<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-click2" @click="buttonNoClick(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>
</div>
</div>
<div class="upload-group">
<van-cell class="title" title="设备外观" :required="$store.getters.cityType"/>
<Uploader type="text1" :value="text1"
@afterRead="afterRead"
@delImg="delImg"
@onUpload="onUpload" />
<div class="tips tipImage" v-if="$store.getters.cityType&&text1.length<1">请上传设备外观照片</div>
<!-- <div class="picStyle borderBot">
<div class="title">设备外观</div>
<div class="pic">
<Uploader
type="text1"
:value="text1"
@afterRead="afterRead"
@delImg="delImg"
@onUpload="onUpload"
/>
</div>
</div> -->
<div class="picStyle borderBot">
<div class="title">设备铭牌</div>
<div class="pic">
<Uploader
type="text2"
:value="text2"
@afterRead="afterRead"
@delImg="delImg"
@onUpload="onUpload"
/>
</div>
</div>
<div class="picStyle">
<div class="title">设备能效标识</div>
<div class="pic">
<Uploader
type="text3"
:value="text3"
@afterRead="afterRead"
@delImg="delImg"
@onUpload="onUpload"
/>
</div>
</div>
</div>
<div class="footer-btn" @click="save">
<div>保存</div>
</div>
</div>
</div>
<van-overlay :show="show">
<div class="wrapper" @click.stop>
<div class="block">
<van-loading size="24px" color="#34baae" vertical>加载中...</van-loading>
</div>
</div>
</van-overlay>
</div>
</template>
<script>
import {
buildAsk,
} from '@/api/api.js'
import { airList, airRemove, enterprisGetInfo, enterprisEdit, enterprisAdd } from "@/api/universalEnergy.js";
import { Notify } from "vant";
import Uploader from '@/views/facilityManage/common-vue/uploader.vue'
import { downloadUrl } from '@/settings'
// import Header from "@/components/headerNew"
export default {
components: {
// Header,
Uploader
},
data() {
return {
newAnswer: [], // 问答题存
title: '空压机系统',
userMsg: {}, // 任务列表单条数据
list: [], // 列表
item: {
type: Object,
default: () => { },
},
aarr: [],
aarr1: [],
airEnquireIds: '',
id: '',
customerId: '',
askList: [], // 问询列表
show: false,
tidCid: null,
text1:[],
text2:[],
text3:[],
img1:'0,0,0',
img2:'0,0,0',
img3:'0,0,0',
}
},
created() {
this.tidCid = JSON.parse(sessionStorage.getItem('tidCid'))
this.getAsk()
this.enterpriseSystemId = sessionStorage.getItem('enterpriseSystemId');
let msg2 = JSON.parse(localStorage.getItem('customerItem'));
if(msg2) {
this.getid = msg2.id
}
this.getList();
},
activated() {
// let objMsg2 = JSON.parse(msg2);
// if (msg) {
// this.userMsg = JSON.parse(msg);
// } else {
// this.userMsg = objMsg2;
// }
},
computed: {
showForm() {
if(this.tidCid.taskId) {
return false
}
return true
},
},
methods: {
/**
* 图片方法
*/
//浏览器 ios 会走这个方法
afterRead(data, type) {
this[type] = [data.attach_id]
data.type = type
},
//安卓会调用的方法
onUpload(data, type) {
this[type] = [data[0].url]
},
delImg(file, detail, type) {
if(type == 'text1') {
this.delIsObj(this.text1)
this.text1 = []
}
if(type == 'text2') {
this.delIsObj(this.text2)
this.text2 = []
}
if(type == 'text3') {
this.delIsObj(this.text3)
this.text3 = []
}
},
//判断删除的list中是否为对象格式
delIsObj(delList) {
const list = delList.map((ele) => {
if(ele instanceof Object) {
return ele.url
}
return ele
})
return list
},
// 图片格式化
fomattPic() {
if(this.text1.length == 0) {
this.text1 = ['0']
}
if(this.text2.length == 0) {
this.text2 = ['0']
}
if(this.text3.length == 0) {
this.text3 = ['0']
}
if(this.text1.length > 0 && this.text1[0] instanceof Object) {
this.text1 = [this.text1[0].url.split('download/')[1]]
} else if(this.text1.length > 0 && this.text1[0].split('download/').length > 1) {
this.text1 = [this.text1[0].split('download/')[1]]
}
if(this.text2.length > 0 && this.text2[0] instanceof Object) {
this.text2 = [this.text2[0].url.split('download/')[1]]
} else if(this.text2.length > 0 && this.text2[0].split('download/').length > 1) {
this.text2 = [this.text2[0].split('download/')[1]]
}
if(this.text3.length > 0 && this.text3[0] instanceof Object) {
this.text3 = [this.text3[0].url.split('download/')[1]]
} else if(this.text3.length > 0 && this.text3[0].split('download/').length > 1) {
this.text3 = [this.text3[0].split('download/')[1]]
}
const text = this.text1.concat(this.text2, this.text3)
return text
},
//判断是否为对象格式
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
},
// 获取问询信息
getAsk() {
buildAsk({ enquireMode: 'gykyjwx' })
.then((res) => {
if (res.code == 0) {
res.data.forEach((v) => {
if(v.enquireId == 73) {
v.color = false
} else {
v.color = true
}
})
this.askList = res.data
this.newAnswer = res.data.map((item) => {
if(item.enquireId == 73) {
return 0
}
return item.enquireId
})
this.getEnterprisGetInfo()
}
})
},
// 获取内容信息
async getEnterprisGetInfo() {
this.show = true
let tidCid = JSON.parse(sessionStorage.getItem('tidCid'))
let customerId = tidCid.customerId;
let taskId = tidCid.taskId;
const res = await enterprisGetInfo({customerId, taskId});
if (res.code == 0) {
this.show = false
this.airEnquireIds = res.data.airEnquireIds;
this.customerId = res.data.customerId;
this.id = res.data.id;
if(res.data.airEnquireIds) {
this.newAnswer = res.data.airEnquireIds.split(',')
}
if(this.askList && this.askList.length > 0) {
const list = this.newAnswer.filter((ele) => ele != 0)
this.askList.forEach((v)=>{
v.color = false
list.forEach((ev)=>{
if(v.enquireId == ev) {
v.color = true
}
})
})
}
if(res.data.text4) {
if(res.data.text4.split(',')[0] != 0) {
this.text1.push({
url:`${downloadUrl}${res.data.text4.split(',')[0]}`
})
}
if(res.data.text4.split(',')[1] != 0) {
this.text2.push({
url:`${downloadUrl}${res.data.text4.split(',')[1]}`
})
}
if(res.data.text4.split(',')[2] != 0) {
this.text3.push({
url:`${downloadUrl}${res.data.text4.split(',')[2]}`
})
}
if(res.data.text1) {
this.img1 = res.data.text1
}
if(res.data.text2) {
this.img2 = res.data.text2
}
if(res.data.text3) {
this.img3 = res.data.text3
}
}
} else {
this.show = false
}
},
buttonClick(item, index) {
if(this.showForm) {
return
}
this.newAnswer[index] = item.enquireId
if (!item.color) {
item.color = true
this.aarr.push(item.enquireId)
this.aarr = [...new Set(this.aarr)]
if(item.enquireId == 72 || item.enquireId == 73) {
this.changeId(item, [72, 73])
}
}
},
buttonNoClick(item, index) {
if(this.showForm) {
return
}
this.newAnswer[index] = 0
item.color = false
this.aarr.splice(this.aarr.indexOf(item.enquireId), 1)
const i = this.aarr1.findIndex((ele) => ele == item.enquireId)
this.aarr1.splice(i, 1)
},
changeId(item, numList) {
const num = numList.find((ele)=> ele != item.enquireId)
const enqIndex = this.newAnswer.findIndex((ele)=> ele == num)
if(enqIndex > -1) {
this.newAnswer.splice(enqIndex, 1, 0)
}
this.askList.forEach((v)=> {
if(v.enquireId == num) {
v.color = false
}
})
},
save() {
if(this.showForm||(this.$store.getters.cityType&&this.text1.length<1)) {
return
}
const text4 = this.fomattPic()
let enterpriseId = sessionStorage.getItem('enId')
let formIds = this.newAnswer.toString();
if (enterpriseId) {
let params = {
customerId: this.customerId,
// id: this.id,
id: this.enterpriseSystemId,
taskId: this.tidCid.taskId,
enterpriseId: enterpriseId,
airEnquireIds: formIds,
systemTypes: this.$route.query.item,
text4: this.ifObj(text4).join(','),
text1: this.img1,
text3: this.img3,
text2: this.img2
}
enterprisEdit(params).then((res) => {
if (res.code == 0) {
Notify({ type: "success", background: '#34baae', message: "保存成功" });
} else {
this.$toast(res.msg)
}
})
} else {
let params = {
customerId: this.customerId,
id: this.tidCid.taskId,
enterpriseId: enterpriseId,
airEnquireIds: formIds,
systemTypes: this.$route.query.item,
text4: this.ifObj(text4).join(','),
text1: this.img1,
text3: this.img3,
text2: this.img2
}
enterprisAdd(params).then((res) => {
if (res.code == 0) {
Notify({ type: "success", background: '#34baae', message: "保存成功" });
} else {
this.$toast(res.msg)
}
})
}
this.$router.push('./acquisition')
},
// 跳转
kongyajisystemaddedit(id) {
if(this.showForm) {
return
}
this.$router.push({ path: './kongyajisystemaddedit', query: { id: id } })
},
// 列表
async getList() {
const params = {
customerId: this.userMsg.customerId,
systemId: this.enterpriseSystemId ? this.enterpriseSystemId : this.getid
}
const res = await airList(params);
if (res.code == 0) {
this.list = res.data
}
},
// 删除
remove(ids) {
if(this.showForm) {
return
}
airRemove(ids).then((res) => {
if (res.code == 0) {
this.getList();
Notify({ type: 'success', background: '#34baae', message: '删除成功' })
} else {
Notify({ type: 'error', background: 'red', message: res.msg })
}
})
}
}
}
</script>
<style lang="less" scoped>
.container {
padding: 0 20px;
}
.title {
font-size: 15px;
color: #000;
}
.partTwo-box {
width: 100%;
border-radius: 8px;
padding: 0 15px 10px;
box-sizing: border-box;
background-color: #fff;
overflow: hidden;
margin-top: 15px;
.partTwo-content {
margin-top: 10px;
.add-box {
width: 100%;
padding: 10px 0;
box-sizing: border-box;
border-radius: 5px;
border: 1px solid #63cbb6;
background-color: #e0f5f0;
color: #63cbb6;
text-align: center;
margin-top: 15px;
}
}
}
.msg-card {
margin-top: 10px;
background: #63cbb6;
padding: 15px;
border-radius: 6px;
color: #fff;
display: flex;
justify-content: space-between;
}
.space-between {
width: 230px;
display: flex;
justify-content: space-between;
}
::v-deep .van-swipe-cell__right {
right: -20px;
-webkit-transform: translate3d(100%, 0, 0);
transform: translate3d(100%, 0, 0);
display: flex;
align-items: center;
color: red;
}
.partThree-question {
width: 100%;
background-color: #fff;
border-radius: 8px;
padding: 20px 10px;
box-sizing: border-box;
font-size: 14px;
color: #000;
.btn2 {
display: flex;
justify-content: flex-end;
}
}
.btn2 {
margin-top: 20px;
display: flex;
.btn-click2 {
display: flex;
align-items: center;
span {
color: #9d9d9d;
font-size: 14px;
}
}
.round-out {
width: 12px;
height: 12px;
border-radius: 50%;
margin: 0 7px;
display: flex;
justify-content: center;
align-items: center;
overflow: hidden;
.round-in {
width: 8px;
height: 8px;
border-radius: 50%;
}
}
.yes-out {
border: 2.5px solid #34baae;
.yes-in {
background: #34baae;
}
}
.no-out {
border: 2px solid #b3b3b3;
}
}
.footer-btn {
margin-top: 180px;
height: 35px;
// padding: 0 0.4rem;
>div {
position: fixed;
bottom: 0.533333rem;
width: 90%;
background: #34baae;
border-radius: 0.266667rem;
line-height: 0.933333rem;
text-align: center;
color: #fff;
z-index: 99999;
}
}
.wrapper {
display: flex;
align-items: center;
justify-content: center;
height: 100%;
}
.upload-group {
background: #fff;
margin-top: 0.2rem;
padding: 0.2rem;
border-radius: 0.2rem;
}
.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);
}
}
.tips {
padding: 0 16px;
display: flex;
justify-content: flex-end;
color: #ee0a24;
font-size: 12px;
}
.tipImage{
justify-content: flex-start
}
</style>
@@ -0,0 +1,269 @@
<template>
<div>
<!-- <Header :title="title" @onClickLeft="onClickLeft" /> -->
<van-form ref="form" @submit="handelClickSave">
<div class="yearenergy">
<div class="year-main">
<div class="nengyuan">
<van-cell-group>
<van-field v-model="form.systemModel" required :rules="[{ required: true },{pattern:/^.{2,20}$/, message:'2≤型号长度≤20'}]" label="空压机型号" placeholder="请输入空压机型号" maxlength="20" />
<van-field v-model="form.motorModel" required :rules="[{ required: true },{pattern:/^.{2,20}$/, message:'2≤型号长度≤20'}]" label="电机型号" placeholder="请输入电机型号" maxlength="20" />
<van-field v-input.numNo0 v-model="form.systemNum" type="number" required :rules="[{ required: true }]" label="台数(台)" placeholder="请输入台数" />
<van-field v-input.floatNo0 v-model="form.ratedPowerValue" required :rules="[{ required: true }]" type="number" label="单台额定功率(kW)" placeholder="请输入" @blur="handelChange('ratedPowerValue',50,'单台额定功率')"/>
<van-field v-input.float v-model="form.frequencyPerValue" required :rules="[{ required: true }]" type="number" label="变频占比(%)" placeholder="请输入" @input="handelChangeNumber('frequencyPerValue','变频占比')" />
<van-field v-input.num v-model="form.absoleteElecNum" type="number" label="淘汰电机数量" placeholder="请输入" />
<van-field v-input.num v-model="form.absoleteNum" type="number" label="淘汰空压机数量" placeholder="请输入" />
<van-field v-input.floatNo0 v-model="form.efficiency" type="number" label="空压机效率(%)" placeholder="请输入" @input="handelChangeNumber('efficiency','空压机效率')" />
<van-field v-input.num v-model="form.userYear" type="number" label="投入年份" placeholder="请选择投入年份" is-link readonly @click="handelClickYear('userYear', 'SET_CON_YEAR')" />
</van-cell-group>
</div>
</div>
<div class="btn">
<van-button size="large" class="faqi" native-type="submit">
保存
</van-button>
</div>
</div>
</van-form>
<van-overlay :show="show">
<div class="wrapper" @click.stop>
<div class="block">
<van-loading size="24px" color="#34baae" vertical>加载中...</van-loading>
</div>
</div>
</van-overlay>
<Year :show="yearShow" :num="1" @onConfirmYear="onConfirmYear" @onCancelYear="onCancelYear" />
</div>
</template>
<script>
import { airAdd, airGetInfo, airEdit } from "@/api/universalEnergy.js"
import { Notify } from "vant";
import mixin from '@/mixins/mixin'
// import Header from "@/components/headerNew";
import Year from '../facilityManage/common-vue/year.vue'
export default {
components: {
// Header,
Year
},
mixins: [mixin],
data() {
return {
title: '新增/修改',
id: '', // 查详情时取的id
userMsg: {}, // 任务列表单条数据
form: {
systemModel: '',
motorModel: '',
systemNum: '',
ratedPowerValue: '',
frequencyPerValue: '',
absoleteElecNum: '',
absoleteNum: '',
efficiency: '',
userYear: '',
},
show: false
};
},
activated() {
this.id = '',
this.form = {
systemModel: '',
motorModel: '',
systemNum: '',
ratedPowerValue: '',
frequencyPerValue: '',
absoleteElecNum: '',
absoleteNum: '',
efficiency: '',
userYear: '',
};
let msg = JSON.parse(sessionStorage.getItem('tidCid'));
// let msg2 = localStorage.getItem('customerItem');
this.userMsg = msg
// let objMsg2 = JSON.parse(msg2);
// if(msg) {
// this.userMsg = JSON.parse(msg);
// this.addeditId = this.userMsg.id
// }else {
// this.userMsg = objMsg2;
// this.addeditId = localStorage.getItem('taskId')
// }
const id = this.$route.query.id;
if(id.isTrusted == undefined) {
this.id = this.$route.query.id;
this.getGetInfo()
}
},
mounted() {
},
methods: {
handelChange (params,num,name) {
if(Number(this.form[params]) < Number(num)) {
Notify({ type: "danger", message: `${name}≥${num}` });
this.form[params] = ''
}
},
handelChangeNumber (params,name) {
if(params === 'efficiency'){
if(!(Number(this.form[params]) < 100)) {
Notify({ type: "danger", message: `${name}不可超过100%` });
this.form[params] = 0
}
}else{
if(Number(this.form[params]) > 100) {
Notify({ type: "danger", message: `${name}不可超过100%` });
this.form[params] = 0
}
}
},
// 返回
onClickLeft() {
this.$router.go(-1)
},
async handelClickSave() {
if(this.id == '') {
this.form.id = sessionStorage.getItem('enterpriseSystemId') ? this.form.systemId = sessionStorage.getItem('enterpriseSystemId') : this.userMsg.taskId;
this.form.customerId = this.userMsg.customerId;
this.form.systemId = sessionStorage.getItem('enterpriseSystemId') ? this.form.systemId = sessionStorage.getItem('enterpriseSystemId') : this.userMsg.taskId;
this.form.systemTypes = '04';
const res = await airAdd(this.form);
if(res.code == 0) {
this.$router.go(-1);
Notify({ type: "success", background: '#34baae', message: "保存成功" });
return
}
Notify({ type: "error", background: 'red', message: res.msg })
}else {
this.form.id = this.id;
this.form.customerId = this.userMsg.customerId;
this.form.systemId = sessionStorage.getItem('enterpriseSystemId') ? this.form.systemId = sessionStorage.getItem('enterpriseSystemId') : this.userMsg.taskId;
this.form.systemTypes = '04';
const res = await airEdit(this.form);
if(res.code == 0) {
this.$router.go(-1);
Notify({ type: "success", background: '#34baae', message: "保存成功" });
return
}
Notify({ type: "error", background: 'red', message: res.msg })
}
},
async getGetInfo() {
this.show = true
const res = await airGetInfo(this.id);
if(res.code == 0) {
this.form = res.data
this.show = false
}else {
this.show = false
}
}
},
};
</script>
<style lang="less" scoped>
::v-deep .van-field__error-message{
text-align: right;
}
.yearenergy {
padding: 15px 10px;
.year-main {
height: calc(100vh - 5rem);
overflow: auto;
}
.year {
// padding: 20px 20px;
border-radius: 10px;
}
.title {
margin: 10px;
display: flex;
.title-img {
width: 20px;
img {
width: 100%;
}
}
p {
font-size: 14px;
color: #009999;
line-height: 20px;
}
}
.nengyuan {
width: 100%;
border-radius: 10px;
background: #fff;
box-sizing: border-box;
overflow: hidden;
}
.faqi {
background-color: #63cbb6;
color: #fff;
border-radius: 8px;
}
}
/deep/ .van-cell {
width: 100%;
display: flex;
}
.van-cell__title,
.van-cell__value {
-webkit-box-flex: 1;
-webkit-flex: 1;
flex: 1;
span {
font-size: 14px;
color: #333;
}
}
::v-deep .van-field__label {
-webkit-box-flex: 0;
-webkit-flex: none;
flex: none;
box-sizing: border-box;
flex: 1;
text-align: left;
word-wrap: break-word;
span {
font-size: 14px;
color: #333;
}
}
::v-deep .van-cell__value {
position: relative;
overflow: hidden;
color: #969799;
text-align: right;
vertical-align: middle;
word-wrap: break-word;
}
::v-deep .van-field__body {
display: -webkit-box;
display: -webkit-flex;
display: flex;
-webkit-box-align: center;
-webkit-align-items: center;
align-items: center;
}
::v-deep .van-field__control {
text-align: right;
font-size: 14px;
}
.wrapper {
display: flex;
align-items: center;
justify-content: center;
height: 100%;
}
</style>
+237
View File
@@ -0,0 +1,237 @@
<template>
<div class="list">
<!-- 搜索框 -->
<!-- <div class="search">
<img src="@/assets/search.png" alt="" />
<input
type="text"
placeholder="请输入搜索文字"
@keydown.enter="searchEveryItem"
v-model="searchValue"
/>
</div> -->
<div class="container">
<van-radio-group v-model="radio">
<van-cell
v-for="(item, index) in client"
:title="item.consName +' '+ item.consNo"
:key="index"
clickable
@click="clickRadio(item, index)"
:style="item.checked ? 'background: #e5f6f3; ' : ''"
>
<!-- <van-radio :name="index" /> -->
</van-cell>
</van-radio-group>
</div>
<div class="btn">
<van-button size="large" class="faqi" @click="sureEle">
确认
</van-button>
</div>
</div>
</template>
<script>
// import Header from "@/components/headerNew";
import { getUseele } from '@/api/customer'
import { Notify } from 'vant'
export default {
name: '',
components: {
// Header,
},
beforeRouteEnter(to, from, next) {
next(vm => {
vm.title = to.meta.title
})
},
data() {
return {
// 标题
title: '客户选择',
// 单选框
radio: '',
searchValue:'',
client: [],
loading: false, //加载
finished: false, //完成
pageNum: 1, //当前页数
pageSize: 10, //每页多少条
allPage: 0, //总共多少条
numArr: [],
currentItem: {}
}
},
mounted() {
// this.getData();
},
created() {
// this.getUseele()
this.getUseele()
},
methods: {
//反显数据
editData(data) {
const arr = sessionStorage.getItem('customer')
if(arr) {
this.numArr = JSON.parse(arr).list
data.forEach((ele)=> {
this.numArr.forEach((v)=>{
if(ele.consId == v.consId) {
ele.checked = true
}
})
})
}
},
//获取列表数据
async getUseele() {
const customer = sessionStorage.getItem('customer')
const data = {
pageNum: this.pageNum,
pagesize: this.pageSize,
}
if(customer) {
data.consName = JSON.parse(customer).name
} else {
data.consName = ''
}
const res = await getUseele(data)
if(res.code == 0) {
res.data.records.forEach((v) => {
v.checked = false
})
this.client = res.data.records
this.editData(res.data.records)
} else {
Notify({ type: 'danger', message: res.msg })
}
},
// 滑动加载
// onLoad() {
// // 异步更新数据
// setTimeout(async () => {
// this.pageNum++
// const data = {
// pageNum: this.pageNum,
// pagesize: this.pageSize,
// }
// // 加载状态结束
// this.loading = false
// const res = await getUseele(data)
// if(res.code == 0) {
// res.data.records.forEach((v) => {
// v.checked = false
// })
// // this.client = res.data.records
// this.client.push(...res.data.records)
// this.editData(res.data.records)
// // 数据全部加载完成
// if (this.client.length == res.data.total) {
// this.finished = true
// return
// }
// } else {
// this.finished = true
// }
// }, 1000)
// },
// 选择客户数据处理
clickRadio(item, index) {
item.checked = !item.checked
if(item.checked == true) {
this.numArr.push(item)
} else {
this.numArr.splice(index, 1)
}
console.log(this.numArr);
},
// 点击确认
sureEle() {
if (this.numArr.length == 0 ) {
Notify({ type: 'danger', message: '请至少选择一条' })
return
}
sessionStorage.setItem('numArr', JSON.stringify(this.numArr))
this.$router.go(-1)
}
},
}
</script>
<style lang="less" scoped>
.list {
width: 100%;
height: 100%;
display: flex;
flex-direction: column;
}
.container {
height: calc(100vh - 60px);
overflow-y: auto;
.van-cell {
padding: 20px;
font-size: 17px;
opacity: 0.9;
}
.item {
background: #fff;
padding: 30px;
box-sizing: border-box;
font-size: 18px;
color: #797b7b;
border-bottom: 1px solid #e9e9e9;
}
}
::v-deep .van-radio__icon {
-webkit-box-flex: 0;
-webkit-flex: none;
flex: none;
height: 1em;
font-size: 0.533333rem;
line-height: 1em;
cursor: pointer;
position: absolute;
right: 0;
top: 0px;
}
.btn {
padding: 0 20px;
}
.faqi {
background-color: #63cbb6;
color: #fff;
border-radius: 8px;
margin-top: -20px;
}
/deep/ .van-radio-group{
height: 100%;
background: #fff;
}
.search {
width: 100%;
height: 60px;
display: flex;
// border: 1px solid #f2f2f2;
// opacity: 0.5;
border-radius: 6px;
padding: 5px 10px;
box-sizing: border-box;
align-items: center;
background: #fff;
margin-bottom: 10px;
img {
width: 15px;
height: 15px;
margin-right: 10px;
}
}
</style>
File diff suppressed because it is too large Load Diff