wh 1 year ago
parent
commit
0ada3ce4dc
1 changed files with 62 additions and 10 deletions
  1. 62 10
      pages/Workorder/Remotecontrol/Remotecontrol.vue

+ 62 - 10
pages/Workorder/Remotecontrol/Remotecontrol.vue

@@ -41,8 +41,9 @@
 		<view class="list">
 
 			<template v-if="deviceType == 'AirConditioner'">
-				<view class="each c" v-for="(item,index) in dataList" :class="'bg'+item.attributeList[2].value">
+				<view class="each c" v-for="(item,index) in dataList"  :class="'bg'+(item.attributeList.length==0?'':item.attributeList[2].value)">
 					<div class="top1">
+						<template v-if="item.attributeList.length!=0">
 						<image  v-if="item.attributeList[2].value == '1'"
                         src="../../../static/management/taiyang.png"></image>
 						<image  v-if="item.attributeList[2].value == '2'||item.attributeList[2].value == '0'"
@@ -51,13 +52,14 @@
 						src="../../../static/management/auto.png"</image>
 						<image  v-if="item.attributeList[2].value == '8'"
 						src="../../../static/management/cs.png"</image>
+						</template>
 						<view class="l1">{{item.airConditionerName}}</view>
 						<view class="l2">{{ item.installSite }}{{ item.roomNumbers }}</view>
-						<view class="l3">{{item.attributeList[5].value}}</view>
-						<view class="l4" v-if="item.attributeList">室温:{{ item.attributeList[4].value }}℃</view>
+						<view class="l3">{{item.attributeList.length==0?'--':item.attributeList[5].value}}</view>
+						<view class="l4">室温:{{ item.attributeList.length==0?'--':item.attributeList[4].value }}℃</view>
 					</div>
 					</div>
-					<view class="operation" v-if="item.attributeList">
+					<view class="operation" v-if="item.attributeList&&item.attributeList.length!=0">
 						<picker
 							@change="(val)=>confirmHandle(val,'modeType',item.deviceId,item.attributeList[2].sensorAddress)"
 							:value="item.attributeList[2].value|findInd(modeTypeList)" :range="modeTypeList"
@@ -80,7 +82,21 @@
 							<u-icon name="arrow-down" color="#999" size="16" class="inline"></u-icon>
 						</picker>
 					</view>
-					<switch :checked="item.attributeList[3].value==1?true:false"
+					<view class="operation" v-else>
+						<picker style="width:100%;height: 100%;">
+							<view class="uni-input">--</view>
+							<u-icon name="arrow-down" color="#999" size="16" class="inline"></u-icon>
+						</picker>
+						<picker style="width:100%;height: 100%;">
+							<view class="uni-input">--</view>
+							<u-icon name="arrow-down" color="#999" size="16" class="inline"></u-icon>
+						</picker>
+						<picker style="width:100%;height: 100%;">
+							<view class="uni-input">--</view>
+							<u-icon name="arrow-down" color="#999" size="16" class="inline"></u-icon>
+						</picker>
+					</view>
+					<switch :checked="item.attributeList[3].value==1?true:false" v-if="item.attributeList.length!=0"
 						@change="(val)=>changeSwitch('AirConditioner', val, item.deviceId, index,item.attributeList[3].sensorAddress)"
 						style="transform:scale(0.7)" class="switch" />
 				</view>
@@ -106,7 +122,7 @@
 							                    index,
 							                    item.attributeList[index2].sensorAddress
 							                  )
-							                " style="margin: 0 auto;"></u-switch>
+							                " style="margin: 0 auto;height: 16px;"></u-switch>
 						</div>
 					</div>
 				</view>
@@ -355,7 +371,8 @@
 				this.showfloor = true;
 			},
 			confirmfloor(e) {
-				this.mytitle = e.value[0].orgName + e.value[1].orgName;
+				console.log(e)
+				this.mytitle = (e.value[0].orgName=='全部'?'跨境电商':e.value[0].orgName) + (e.value[1].orgName=='全部'?'':e.value[1].orgName);
 				this.dataForm.buildingId = e.value[0].orgId;
 				this.dataForm.storeyId = e.value[1].orgId;
 
@@ -383,26 +400,58 @@
 				// this.dataForm.page = 1;
 				// this.getDataList()
 			},
+			//获取楼栋
+						getBuildList2() {
+							Api.getBuildInfo().then((res) => {
+								if (res.data.code == 0) {
+									this.name = this.projectName = res.data.data[0].orgName;
+									this.positionList[0]=[];
+									let positionList = res.data.data[0].childrenList;
+									if (positionList) {
+										let json = {
+											category: "s",
+											childrenList: null,
+											orgId: "",
+											orgName: "全部",
+										};
+										for (let i = 0; i <positionList.length; i++) {
+											positionList[i].childrenList.unshift(json);
+											this.positionList[0].push(positionList[i]);
+										}
+										this.positionList[0].unshift(json);
+										//this.positionList[1]=this.positionList[0][0].childrenList;
+										console.log(this.positionList)
+									}
+								}
+							});
+						},
 			//获取楼栋
 			getBuildList() {
 				this.$api.get('/control/getOrgStructureTree/', {})
 					.then(res => {
 
 						if (res.data.code == 0) {
+							let json = [{
+								category: "s",
+								childrenList: null,
+								orgId: "",
+								orgName: "全部",
+							}];
 							this.dataForm.projectId = res.data.data[0].orgId;
 
 							this.mytitle = res.data.data[0].orgName;
 							this.alldata = res.data.data[0].childrenList;
 							//console.log('111111111111111111',  res.data.data[0].childrenList)			
 							this.columns = [
-								res.data.data[0].childrenList,
+								json.concat(res.data.data[0].childrenList),
 								res.data.data[0].childrenList[0].childrenList
 							]
+							console.log(this.columns)
 							let allfloor = [];
 							for (let i = 0; i < res.data.data[0].childrenList.length; i++) {
-								allfloor.push(res.data.data[0].childrenList[i].childrenList)
+								allfloor.push(json.concat(res.data.data[0].childrenList[i].childrenList));
 							}
-							//  console.log('111111111111111111',allfloor)
+							console.log(allfloor)
 							this.columnData = allfloor;
 							this.dataList = []; // 清空数组
 							this.dataForm.page = 1;
@@ -529,6 +578,7 @@
 				this.dataForm.status = "";
 				Api.airconditioner(this.dataForm).then((res) => {
 					if (res.data.code == 0) {
+						console.log(res.data.data)
 						if (res.data.data) {
 							if (res.data.data.list.length == 0) {
 								// 判断获取数据条数若等于0
@@ -543,6 +593,7 @@
 							if (this.dataList.length >= res.data.data.total) {
 								this.finished = true; // 结束加载状态
 							}
+							console.log(this.dataList)
 						} else {
 							// 判断获取数据条数若等于0
 							this.dataList = []; // 清空数组
@@ -856,6 +907,7 @@
 				font-size: 14px;
 				padding: 18px;
 				text-align: center;
+				box-sizing:border-box;
 				.uni-input{
 					color: #2e69eb;
 				}