wh 1 year ago
parent
commit
ec7a45ed2f
1 changed files with 29 additions and 43 deletions
  1. 29 43
      pages/Workorder/Remotecontrol/Remotecontrol.vue

+ 29 - 43
pages/Workorder/Remotecontrol/Remotecontrol.vue

@@ -26,7 +26,7 @@
 					<u-icon name="arrow-down-fill" color="#666" size="16" class="inline"></u-icon>
 				</picker>
 			</view>
-			<view class="drawdownMenu">
+			<view class="drawdownMenu" v-if="deviceType=='Relay'">
 				<picker @change="(val)=>confirmHandle(val,'deviceStatus')" :value="deviceStatusIndex"
 					:range="deviceStatusList" style="width:100%;height: 100%;" range-key="text">
 					<view class="uni-input">{{deviceStatusList[deviceStatusIndex].text}}</view>
@@ -223,7 +223,6 @@
 
 				if (getDictDataList[i].dictType == 'DeviceCategory') {
 					this.deviceTypeList = getDictDataList[i].dataList;
-					// console.log('7777',this.deviceTypeList)
 
 					this.deviceTypeList.forEach((item) => {
 						item.text = item.dictLabel;
@@ -370,11 +369,16 @@
 				this.showfloor = true;
 			},
 			confirmfloor(e) {
-				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;
-
+				let a="";let b="";
+				if(e.value[0]){
+					a=e.value[0].orgName=='全部'?'跨境电商':e.value[0].orgName;
+					this.dataForm.buildingId = e.value[0].orgId;
+				}
+				if(e.value[1]){
+					b=e.value[1].orgName=='全部'?'':e.value[1].orgName;
+					this.dataForm.storeyId = e.value[1].orgId?e.value[1].orgId:'';
+				}
+				this.mytitle = a+b;
 				this.showfloor = false;
 				this.dataList = []; // 清空数组
 				this.dataForm.page = 1;
@@ -399,31 +403,6 @@
 				// 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/', {})
@@ -440,12 +419,11 @@
 
 							this.mytitle = res.data.data[0].orgName;
 							this.alldata = res.data.data[0].childrenList;
-							//console.log('111111111111111111',  res.data.data[0].childrenList)			
 							this.columns = [
 								json.concat(res.data.data[0].childrenList),
-								res.data.data[0].childrenList[0].childrenList
+								[]
 							]
-							let allfloor = [];
+							let allfloor = [[]];
 							for (let i = 0; i < res.data.data[0].childrenList.length; i++) {
 								allfloor.push(json.concat(res.data.data[0].childrenList[i].childrenList));
 							}
@@ -522,8 +500,17 @@
 						this.onRefresh();
 					}
 					if (type == "modeType" || type == "speedType" || type == "temp") {
-						let data = this.modeTypeList[e.detail.value].dictValue;
-						this.onConfirmMode(data, 'modeTypeList', deviceId, identifier);
+						let data="";
+						if(type=='modeType'){
+							data = this.modeTypeList[e.detail.value].dictValue;
+						}
+						if(type=='speedType'){
+							data =this.speedTypeList[e.detail.value].dictValue;
+						}
+						if(type=='temp'){
+							data = this.temperatureList[e.detail.value];
+						}
+						this.onConfirmMode(data, deviceId, identifier);
 					}
 				}
 
@@ -575,14 +562,12 @@
 				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
 								this.dataList = []; // 清空数组
 								this.finished = true; // 停止加载
 							}
-							console.log(this.dataList)
 							// 若数据条数不等于0
 							if (this.dataForm.page == 1) {
 								this.dataList = res.data.data.list;
@@ -596,7 +581,6 @@
 							if (this.dataList.length >= res.data.data.total) {
 								this.finished = true; // 结束加载状态
 							}
-							console.log(this.dataList)
 						} else {
 							// 判断获取数据条数若等于0
 							this.dataList = []; // 清空数组
@@ -702,7 +686,7 @@
 					}
 				});
 			},
-			onConfirmMode(data, module, deviceId, identifier) {
+			onConfirmMode(data, deviceId, identifier) {
 				let deviceCommandDTO = {
 					action: 0,
 					identifier: identifier,
@@ -734,12 +718,13 @@
 				// 		break;
 				// }
 				Api.setControl(deviceCommandDTO).then((res) => {
-					this.$toast.clear();
+					//this.$toast.clear();
 					if (res.data.code == 0) {
 						uni.showToast({
 							title: '操作成功',
 							duration: 2000
 						});
+						this.onRefresh();
 					}
 				});
 			},
@@ -766,7 +751,8 @@
 		.drawdownMenu {
 			display: flex;
 			text-align: center;
-			width: 50%;
+			min-width: 50%;
+			flex:1;
 		}
 	}