wh 1 年間 前
コミット
0631953fde

+ 1 - 1
pages.json

@@ -82,7 +82,7 @@
 			"path": "pages/Workorder/Remotecontrol/Remotecontrol",
 			"style": {
 				"navigationBarTitleText": "远程管控",
-				"enablePullDownRefresh": false,
+				"enablePullDownRefresh": true,
 				"navigationBarTextStyle": "white",
 				"navigationBarBackgroundColor": "#5C8FFF"
 			}

+ 84 - 63
pages/Workorder/Remotecontrol/Remotecontrol.vue

@@ -12,7 +12,7 @@
 		</view> -->
 
 		<u-cell-group class="toptemplate">
-			<u-cell :title="mytitle" @click="floorchange"  :border="false">
+			<u-cell :title="mytitle" @click="floorchange" :border="false">
 				<u-icon slot="icon" size="40" color="#fff" name="map"></u-icon>
 				<u-icon slot="right-icon" size="40" color="#fff" name="search"></u-icon>
 			</u-cell>
@@ -26,13 +26,13 @@
 					<u-icon name="arrow-down-fill" color="#666" size="16" class="inline"></u-icon>
 				</picker>
 			</view>
-			<view class="drawdownMenu">
+			<!-- <view class="drawdownMenu">
 				<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>
 					<u-icon name="arrow-down-fill" color="#666" size="16" class="inline"></u-icon>
 				</picker>
-			</view>
+			</view> -->
 		</view>
 		<view class="total">
 			共有<text style="color: #f44;">{{total}}</text>条记录
@@ -40,22 +40,24 @@
 		<!-- 列表 -->
 		<view class="list">
 			<template v-if="deviceType == 'AirConditioner'">
-				<view class="each c" v-for="(item,index) in dataList"  :class="'bg'+(item.attributeList.length==0?'':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'"
-						src="../../../static/management/zl.png"></image>
-						<image  v-if="item.attributeList[2].value == '4'"
-						src="../../../static/management/auto.png"</image>
-						<image  v-if="item.attributeList[2].value == '8'"
-						src="../../../static/management/cs.png"</image>
+							<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'"
+								src="../../../static/management/zl.png"></image>
+							<image v-if="item.attributeList[2].value == '4'" 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.length==0?'--':item.attributeList[5].value}}℃</view>
-						<view class="l4">室温:{{ item.attributeList.length==0?'--':item.attributeList[4].value }}℃</view>
+						<view class="l4">室温:{{ item.attributeList.length==0?'--':item.attributeList[4].value }}℃
+						</view>
 					</div>
 					</div>
 					<view class="operation" v-if="item.attributeList&&item.attributeList.length!=0">
@@ -96,8 +98,8 @@
 						</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" />
+						@click="(val)=>changeSwitch('AirConditioner', item.attributeList[3].value, item.deviceId, index,item.attributeList[3].sensorAddress)"
+						style="transform:scale(0.7)" class="switch" disabled />
 				</view>
 			</template>
 			<template v-if="deviceType == 'Relay'">
@@ -155,7 +157,7 @@
 				dataForm: {
 					page: 1,
 					limit: 10,
-					opStatus:'',
+					opStatus: '',
 					buildingId: "",
 					storeyId: "",
 					status: "",
@@ -195,6 +197,9 @@
 				],
 			}
 		},
+		onPullDownRefresh() {
+			this.onRefresh();
+		},
 		onReachBottom() {
 			if (!this.finished) {
 				this.dataForm.page++;
@@ -203,20 +208,24 @@
 		},
 		onLoad(v) {
 			uni.setNavigationBarTitle({
-				title:v.type==1?'空调控制':'照明控制'
+				title: v.type == 1 ? '空调控制' : '照明控制'
 			})
-			if(v.type==1){
-				this.deviceType="AirConditioner";
-				this.deviceTypeIndex=0;
-			}else{
-				this.deviceType='Relay';
-				this.deviceTypeIndex=1;
+			if (v.type == 1) {
+				this.deviceType = "AirConditioner";
+				this.deviceTypeIndex = 0;
+			} else {
+				this.deviceType = 'Relay';
+				this.deviceTypeIndex = 1;
 			}
 			let getDictDataList = uni.getStorageSync('getDictDataList');
 			for (let i = 0; i < getDictDataList.length; i++) {
 				if (getDictDataList[i].dictType == 'ModeType') {
 					this.modeTypeList = getDictDataList[i].dataList
-					this.modeTypeList.push({dictLabel: "制冷",dictTypeId: "1610183082852225025",dictValue: "0"})
+					this.modeTypeList.push({
+						dictLabel: "制冷",
+						dictTypeId: "1610183082852225025",
+						dictValue: "0"
+					})
 				}
 
 				if (getDictDataList[i].dictType == 'SpeedType') {
@@ -348,7 +357,7 @@
 					Api.setControlElec(val).then((res) => {
 						uni.hideLoading()
 						if (res.data.code == 0) {
-							this.dataForm.page=1;
+							this.dataForm.page = 1;
 							this.getDataList();
 							uni.showToast({
 								title: '操作成功'
@@ -372,17 +381,18 @@
 				this.showfloor = true;
 			},
 			confirmfloor(e) {
-				let a="";let b="";
-				if(e.value[0]){
-					a=e.value[0].orgName=='全部'?'跨境电商':e.value[0].orgName;
+				let a = "";
+				let b = "";
+				if (e.value[0]) {
+					a = e.value[0].orgName == '全部' ? '跨境电商' : e.value[0].orgName;
 					this.dataForm.buildingId = e.value[0].orgId;
-					this.dataForm.storeyId="";
+					this.dataForm.storeyId = "";
 				}
-				if(e.value[1]){
-					b=e.value[1].orgName=='全部'?'':e.value[1].orgName;
-					this.dataForm.storeyId = e.value[1].orgId?e.value[1].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.mytitle = a + b;
 				this.showfloor = false;
 				this.dataList = []; // 清空数组
 				this.dataForm.page = 1;
@@ -427,7 +437,9 @@
 								json.concat(res.data.data[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));
 							}
@@ -459,7 +471,7 @@
 							}).then((res) => {
 								uni.hideLoading()
 								if (res.data.code == 0) {
-									this.dataForm.page=1;
+									this.dataForm.page = 1;
 									that.getDataList();
 									uni.showLoading({
 										title: "操作成功",
@@ -506,14 +518,14 @@
 						this.onRefresh();
 					}
 					if (type == "modeType" || type == "speedType" || type == "temp") {
-						let data="";
-						if(type=='modeType'){
+						let data = "";
+						if (type == 'modeType') {
 							data = this.modeTypeList[e.detail.value].dictValue;
 						}
-						if(type=='speedType'){
-							data =this.speedTypeList[e.detail.value].dictValue;
+						if (type == 'speedType') {
+							data = this.speedTypeList[e.detail.value].dictValue;
 						}
-						if(type=='temp'){
+						if (type == 'temp') {
 							data = this.temperatureList[e.detail.value];
 						}
 						this.onConfirmMode(data, deviceId, identifier);
@@ -567,6 +579,7 @@
 			getAircond() {
 				this.dataForm.status = "";
 				Api.airconditioner(this.dataForm).then((res) => {
+					uni.stopPullDownRefresh();//停止刷新
 					if (res.data.code == 0) {
 						if (res.data.data) {
 							if (res.data.data.list.length == 0) {
@@ -578,11 +591,11 @@
 							if (this.dataForm.page == 1) {
 								this.dataList = res.data.data.list;
 							} else {
-							this.dataList.push(...res.data.data.list); // 将数据放入list中
+								this.dataList.push(...res.data.data.list); // 将数据放入list中
 							}
 							this.loading = false; // 加载状态结束
 							this.total = res.data.data.total;
-							
+
 							// 如果list长度大于等于总数据条数,数据全部加载完成
 							if (this.dataList.length >= res.data.data.total) {
 								this.finished = true; // 结束加载状态
@@ -601,6 +614,7 @@
 
 			getElec() {
 				Api.getElec(this.dataForm).then((res) => {
+					uni.stopPullDownRefresh();//停止刷新
 					if (res.data.code == 0) {
 						if (res.data.data) {
 							if (res.data.data.list.length == 0) {
@@ -633,8 +647,9 @@
 			},
 			//下发指令开关
 			changeSwitch(type, val, deviceId, index, identifier) {
+				console.log(val)
 				let msg = "";
-				if (val.detail.value) {
+				if (!val) {
 					msg = "开启";
 				} else {
 					msg = "关闭";
@@ -758,7 +773,7 @@
 			display: flex;
 			text-align: center;
 			min-width: 50%;
-			flex:1;
+			flex: 1;
 		}
 	}
 
@@ -806,7 +821,7 @@
 			&.on2 {
 				background: linear-gradient(to bottom,
 						rgba(255, 155, 37, 0.25),
-				  rgba(255, 234, 200, 0.13),
+						rgba(255, 234, 200, 0.13),
 						rgba(255, 255, 255, 0.04));
 
 			}
@@ -818,28 +833,33 @@
 				.top1 {
 					padding: 16px 20px;
 					border-bottom: 1px solid #E6E7EA;
-					image{
+
+					image {
 						width: 54px;
-						    height: 56px;
-						    position: absolute;
-						    left: 0;
-						    top: 0;
-						    z-index: 1;
+						height: 56px;
+						position: absolute;
+						left: 0;
+						top: 0;
+						z-index: 1;
 					}
 				}
 			}
-			&.bg0,&.bg2{
-				background: linear-gradient(to bottom,#D2F0FF,#FFFFFF)
+
+			&.bg0,
+			&.bg2 {
+				background: linear-gradient(to bottom, #D2F0FF, #FFFFFF)
 			}
-			&.bg1{
-				background: linear-gradient(to bottom,#FFE2DF,#FFFFFF)
+
+			&.bg1 {
+				background: linear-gradient(to bottom, #FFE2DF, #FFFFFF)
 			}
-			
-			&.bg4{
-				background: linear-gradient(to bottom,#DDF8DC,#FFFFFF)
+
+			&.bg4 {
+				background: linear-gradient(to bottom, #DDF8DC, #FFFFFF)
 			}
-			&.bg8{
-				background: linear-gradient(to bottom,#DEE4FE,#FFFFFF)
+
+			&.bg8 {
+				background: linear-gradient(to bottom, #DEE4FE, #FFFFFF)
 			}
 
 			.top {
@@ -902,8 +922,9 @@
 				font-size: 14px;
 				padding: 18px;
 				text-align: center;
-				box-sizing:border-box;
-				.uni-input{
+				box-sizing: border-box;
+
+				.uni-input {
 					color: #2e69eb;
 				}
 
@@ -943,4 +964,4 @@
 			}
 		}
 	}
-</style>
+</style>

+ 2 - 2
pages/index/Workordertodone/Toberepaired/Toberepaired.vue

@@ -36,8 +36,8 @@
 			<u-cell-group>
 				<u-cell title="紧急程度" :value="details.jinji">
 				</u-cell>
-				<u-cell title="维修人员" :value="details.weixiury">
-				</u-cell>
+				<!-- <u-cell title="维修人员" :value="details.weixiury">
+				</u-cell> -->
 				<u-cell title="联系电话" :value="details.weixiudh">
 				</u-cell>
 			</u-cell-group>

+ 2 - 2
pages/index/Workordertodone/hasrepaired/hasrepaired.vue

@@ -40,8 +40,8 @@
 				</u-cell>
 				<u-cell title="维修人员" :value="details.weixiury">
 				</u-cell>
-				<u-cell title="联系电话" :value="details.weixiudh">
-				</u-cell>
+			<!-- 	<u-cell title="联系电话" :value="details.weixiudh">
+				</u-cell> -->
 				<u-cell title="完成时间" :value="details.repairFinishTime">
 				</u-cell>
 			</u-cell-group>