| | |
| | | var deviceData; |
| | | var deviceList; |
| | | var deptId; |
| | | var depotId; |
| | | var deptId; //库区编码 |
| | | var depotId; //仓库编码 |
| | | var frontList = []; //仓库正面设备列表 |
| | | var backList = []; //仓库反面设备列表 |
| | | var leftList = []; //仓库左侧面设备列表 |
| | | var rightList = []; //仓库右侧面设备列表 |
| | | var deviceDetail = { |
| | | "passCode": "", |
| | | "serId": "", |
| | | "location": "", |
| | | "type": "", |
| | | "status":"" |
| | | } |
| | | //设备控制 |
| | | var data = { |
| | | "interfaceId": "5403", |
| | | "outId": "10403", |
| | | "interfaceId": "5402", |
| | | "outId": "10402", |
| | | "reqDateTime": new Date(), |
| | | "tokenAuth": "", |
| | | "data": [], |
| | | // { |
| | | // "deptId": "", |
| | | // "depotId": "", |
| | | // "type": "01", |
| | | // "type": "", |
| | | // "passCode": "", |
| | | // "serId": "", |
| | | // "targetStatus": "" |
| | | // } |
| | | }; |
| | | |
| | | //设备列表 |
| | | var data1 = { |
| | | "interfaceId": "5401", |
| | | "outId": "10401", |
| | |
| | | "data": { |
| | | "deptId": "", |
| | | "depotId": "", |
| | | "type": "01", //风窗 |
| | | "type": "01", //风窗 |
| | | "type1": "02", //轴流风窗 |
| | | "type2": "04", //环流风机 |
| | | "type3": "0B", //通风口 |
| | |
| | | // depotName = self.depotName |
| | | } |
| | | |
| | | var slider = mui(".mui-slider"); |
| | | slider.slider({ |
| | | interval: 3000 |
| | | }); |
| | | //获取设备列表(通风) |
| | | function getDeviceList() { |
| | | mui.ajax(url, { |
| | | type: "POST", |
| | | dataType: "json", |
| | | crossDomain: true, |
| | | contentType: "application/json;charset=utf-8", |
| | | data: JSON.stringify(data1), |
| | | success: function(result) { |
| | | if (result.code == "0000") { |
| | | deviceData = result.data; |
| | | } else { |
| | | mui.toast(result.msg); |
| | | } |
| | | }, |
| | | error: function() { |
| | | mui.alert("系统繁忙,请重试!", "提示", ["确定"], function() {}, "div") |
| | | } |
| | | }) |
| | | } |
| | | |
| | | //渲染页面 |
| | | function renderDevice() { |
| | | var html = ''; |
| | | if (deviceData) { |
| | | var deviceList = deviceData.listDevice; |
| | | if (deviceList && deviceList.length > 0) { |
| | | $.each(deviceList, function(index, item) { |
| | | if (item.location == '01') { |
| | | frontList.push(item) |
| | | } else if (item.location == '02') { |
| | | backList.push(item) |
| | | } else if (item.location == '03') { |
| | | leftList.push(item) |
| | | } else if (item.location == '04') { |
| | | rightList.push(item) |
| | | } |
| | | }) |
| | | } |
| | | if (frontList && frontList.length > 0) { //仓库正面 |
| | | html += '<div class="m-tf"><div class="g-tittf1">仓库正面</div><ul class="ul-listmana1 ullisttf1">'; |
| | | $.each(frontList, function(index, item) { |
| | | if (item.type == '01') { //风窗 |
| | | html += '<li><div class="con myfancy chuangkou" status="' + item.status + '" passCode="' + |
| | | item.passCode + '" serId="' + item.serId + '"name="' + item.name + |
| | | '" location="front" type="01">'; |
| | | html += '<div class="pic"><img src="images/device-status/STATUS_01_OPEN.png"></div>' |
| | | html += '<div class="info in" style="background-image: url(images/e3.png);">' + item.name + |
| | | '</div>' |
| | | html += '</div></li>' |
| | | } else if (item.type == '02') { //轴流风机 |
| | | html += '<li><div class="con myfancy zhouliu" status="' + item.status + '" passCode="' + |
| | | item.passCode + '" serId="' + item.serId + '"name="' + item.name + |
| | | '" location="front">'; |
| | | html += '<div class="pic"><img src="images/d8.png"></div>' |
| | | html += '<div class="info in" style="background-image: url(images/e4.png);">' + item.name + |
| | | '</div>' |
| | | html += '</div></li>' |
| | | } else if (item.type == '04') { //环流风机 |
| | | html += '<li><div class="con myfancy huanliu" status="' + item.status + '" passCode="' + |
| | | item.passCode + '" serId="' + item.serId + '"name="' + item.name + |
| | | '" location="front">'; |
| | | html += '<div class="pic"><img src="images/d7.png"></div>' |
| | | html += '<div class="info out" style="background-image: url(images/e5.png);"> ' + item |
| | | .name + '</div>' |
| | | html += '</div></li>' |
| | | } else if (item.type == '0B') { //通风口 |
| | | html += '<li><div class="con myfancy chuangkou" status="' + item.status + '" passCode="' + |
| | | item.passCode + '" serId="' + item.serId + '"name="' + item.name + |
| | | '" location="front" type="0B">'; |
| | | html += '<div class="pic"><img src="images/device-status/STATUS_0B_OPEN.png"></div>' |
| | | html += '<div class="info out" ' + item.name + '</div>' |
| | | html += '</div></li>' |
| | | } else if (item.type == '0C') { //混流风机 |
| | | html += '<li><div class="con myfancy hunliu" status="' + item.status + '" passCode="' + |
| | | item.passCode + '" serId="' + item.serId + '"name="' + item.name + |
| | | '" location="front">'; |
| | | html += '<div class="pic"><img src="images/device-status/STATUS_01_OPEN.png"></div>' |
| | | html += '<div class="info full" style="background-image: url(images/e6.png);">' + item |
| | | .name + '</div>' |
| | | html += '</div></li>' |
| | | } else if (item.type == '0D') { //加压风机 |
| | | html += '<li><div class="con myfancy jiaya" status="' + item.status + '" passCode="' + |
| | | item.passCode + '" serId="' + item.serId + '"name="' + item.name + |
| | | '" location="front">'; |
| | | html += '<div class="pic pic1"><img src="images/d9.png"></div>' |
| | | html += '<div class="info full" style="background-image: url(images/e7.png);">' + item |
| | | .name + '</div>' |
| | | html += '</div></li>' |
| | | } |
| | | }) |
| | | html += '</ul></div>' |
| | | } else if (backList && backList.length > 0) { //仓库反面 |
| | | html += '<div class="m-tf"><div class="g-tittf1">仓库反面</div><ul class="ul-listmana1 ullisttf1">'; |
| | | $.each(backList, function(index, item) { |
| | | if (item.type == '01') { //风窗 |
| | | html += '<li><div class="con myfancy chuangkou" status="' + item.status + '" passCode="' + |
| | | item.passCode + '" serId="' + item.serId + '"name="' + item.name + |
| | | '" location="back" type="01">'; |
| | | html += '<div class="pic"><img src="images/device-status/STATUS_01_OPEN.png"></div>' |
| | | html += '<div class="info in" style="background-image: url(images/e3.png);">' + item.name + |
| | | '</div>' |
| | | html += '</div></li>' |
| | | } else if (item.type == '02') { //轴流风机 |
| | | html += '<li><div class="con myfancy zhouliu" status="' + item.status + '" passCode="' + |
| | | item.passCode + '" serId="' + item.serId + '"name="' + item.name + '" location="back">'; |
| | | html += '<div class="pic"><img src="images/d8.png"></div>' |
| | | html += '<div class="info in" style="background-image: url(images/e4.png);">' + item.name + |
| | | '</div>' |
| | | html += '</div></li>' |
| | | } else if (item.type == '04') { //环流风机 |
| | | html += '<li><div class="con myfancy huanliu" status="' + item.status + '" passCode="' + |
| | | item.passCode + '" serId="' + item.serId + '"name="' + item.name + '" location="back">'; |
| | | html += '<div class="pic"><img src="images/d7.png"></div>' |
| | | html += '<div class="info out" style="background-image: url(images/e5.png);"> ' + item |
| | | .name + '</div>' |
| | | html += '</div></li>' |
| | | } else if (item.type == '0B') { //通风口 |
| | | html += '<li><div class="con myfancy chuangkou" status="' + item.status + '" passCode="' + |
| | | item.passCode + '" serId="' + item.serId + '"name="' + item.name + |
| | | '" location="back" type="0B">'; |
| | | html += '<div class="pic"><img src="images/device-status/STATUS_0B_OPEN.png"></div>' |
| | | html += '<div class="info out" ' + item.name + '</div>' |
| | | html += '</div></li>' |
| | | } else if (item.type == '0C') { //混流风机 |
| | | html += '<li><div class="con myfancy hunliu" status="' + item.status + '" passCode="' + |
| | | item.passCode + '" serId="' + item.serId + '"name="' + item.name + '" location="back">'; |
| | | html += '<div class="pic"><img src="images/device-status/STATUS_01_OPEN.png"></div>' |
| | | html += '<div class="info full" style="background-image: url(images/e6.png);">' + item |
| | | .name + '</div>' |
| | | html += '</div></li>' |
| | | } else if (item.type == '0D') { //加压风机 |
| | | html += '<li><div class="con myfancy jiaya" status="' + item.status + '" passCode="' + |
| | | item.passCode + '" serId="' + item.serId + '"name="' + item.name + '" location="back">'; |
| | | html += '<div class="pic pic1"><img src="images/d9.png"></div>' |
| | | html += '<div class="info full" style="background-image: url(images/e7.png);">' + item |
| | | .name + '</div>' |
| | | html += '</div></li>' |
| | | } |
| | | }) |
| | | html += '</ul></div>' |
| | | } else if (leftList && leftList.length > 0) { //仓库左侧面 |
| | | html += '<div class="m-tf"><div class="g-tittf1">仓库左侧面</div><ul class="ul-listmana1 ullisttf1">'; |
| | | $.each(leftList, function(index, item) { |
| | | if (item.type == '01') { //风窗 |
| | | html += '<li><div class="con myfancy chuangkou" status="' + item.status + '" passCode="' + |
| | | item.passCode + '" serId="' + item.serId + '"name="' + item.name + |
| | | '" location="left" type="01">'; |
| | | html += '<div class="pic"><img src="images/device-status/STATUS_01_OPEN.png"></div>' |
| | | html += '<div class="info in" style="background-image: url(images/e3.png);">' + item.name + |
| | | '</div>' |
| | | html += '</div></li>' |
| | | } else if (item.type == '02') { //轴流风机 |
| | | html += '<li><div class="con myfancy zhouliu" status="' + item.status + '" passCode="' + |
| | | item.passCode + '" serId="' + item.serId + '"name="' + item.name + '" location="left">'; |
| | | html += '<div class="pic"><img src="images/d8.png"></div>' |
| | | html += '<div class="info in" style="background-image: url(images/e4.png);">' + item.name + |
| | | '</div>' |
| | | html += '</div></li>' |
| | | } else if (item.type == '04') { //环流风机 |
| | | html += '<li><div class="con myfancy huanliu" status="' + item.status + '" passCode="' + |
| | | item.passCode + '" serId="' + item.serId + '"name="' + item.name + '" location="left">'; |
| | | html += '<div class="pic"><img src="images/d7.png"></div>' |
| | | html += '<div class="info out" style="background-image: url(images/e5.png);"> ' + item |
| | | .name + '</div>' |
| | | html += '</div></li>' |
| | | } else if (item.type == '0B') { //通风口 |
| | | html += '<li><div class="con myfancy chuangkou" status="' + item.status + '" passCode="' + |
| | | item.passCode + '" serId="' + item.serId + '"name="' + item.name + |
| | | '" location="left" type="0B">'; |
| | | html += '<div class="pic"><img src="images/device-status/STATUS_0B_OPEN.png"></div>' |
| | | html += '<div class="info out" ' + item.name + '</div>' |
| | | html += '</div></li>' |
| | | } else if (item.type == '0C') { //混流风机 |
| | | html += '<li><div class="con myfancy hunliu" status="' + item.status + '" passCode="' + |
| | | item.passCode + '" serId="' + item.serId + '"name="' + item.name + '" location="left">'; |
| | | html += '<div class="pic"><img src="images/device-status/STATUS_01_OPEN.png"></div>' |
| | | html += '<div class="info full" style="background-image: url(images/e6.png);">' + item |
| | | .name + '</div>' |
| | | html += '</div></li>' |
| | | } else if (item.type == '0D') { //加压风机 |
| | | html += '<li><div class="con myfancy jiaya" status="' + item.status + '" passCode="' + |
| | | item.passCode + '" serId="' + item.serId + '"name="' + item.name + '" location="left">'; |
| | | html += '<div class="pic pic1"><img src="images/d9.png"></div>' |
| | | html += '<div class="info full" style="background-image: url(images/e7.png);">' + item |
| | | .name + '</div>' |
| | | html += '</div></li>' |
| | | } |
| | | }) |
| | | html += '</ul></div>' |
| | | } else if (rightList && rightList.length > 0) { //仓库右侧面 |
| | | html += '<div class="m-tf"><div class="g-tittf1">仓库右侧面</div><ul class="ul-listmana1 ullisttf1">'; |
| | | $.each(rightList, function(index, item) { |
| | | if (item.type == '01') { //风窗 |
| | | html += '<li><div class="con myfancy chuangkou" status="' + item.status + '" passCode="' + |
| | | item.passCode + '" serId="' + item.serId + '"name="' + item.name + |
| | | '" location="right" type="01">'; |
| | | html += '<div class="pic"><img src="images/device-status/STATUS_01_OPEN.png"></div>' |
| | | html += '<div class="info in" style="background-image: url(images/e3.png);">' + item.name + |
| | | '</div>' |
| | | html += '</div></li>' |
| | | } else if (item.type == '02') { //轴流风机 |
| | | html += '<li><div class="con myfancy zhouliu" status="' + item.status + '" passCode="' + |
| | | item.passCode + '" serId="' + item.serId + '"name="' + item.name + |
| | | '" location="right">'; |
| | | html += '<div class="pic"><img src="images/d8.png"></div>' |
| | | html += '<div class="info in" style="background-image: url(images/e4.png);">' + item.name + |
| | | '</div>' |
| | | html += '</div></li>' |
| | | } else if (item.type == '04') { //环流风机 |
| | | html += '<li><div class="con myfancy huanliu" status="' + item.status + '" passCode="' + |
| | | item.passCode + '" serId="' + item.serId + '"name="' + item.name + |
| | | '" location="right">'; |
| | | html += '<div class="pic"><img src="images/d7.png"></div>' |
| | | html += '<div class="info out" style="background-image: url(images/e5.png);"> ' + item |
| | | .name + '</div>' |
| | | html += '</div></li>' |
| | | } else if (item.type == '0B') { //通风口 |
| | | html += '<li><div class="con myfancy chuangkou" status="' + item.status + '" passCode="' + |
| | | item.passCode + '" serId="' + item.serId + '"name="' + item.name + |
| | | '" location="right" type="0B">'; |
| | | html += '<div class="pic"><img src="images/device-status/STATUS_0B_OPEN.png"></div>' |
| | | html += '<div class="info out" ' + item.name + '</div>' |
| | | html += '</div></li>' |
| | | } else if (item.type == '0C') { //混流风机 |
| | | html += '<li><div class="con myfancy hunliu" status="' + item.status + '" passCode="' + |
| | | item.passCode + '" serId="' + item.serId + '"name="' + item.name + |
| | | '" location="right">'; |
| | | html += '<div class="pic"><img src="images/device-status/STATUS_01_OPEN.png"></div>' |
| | | html += '<div class="info full" style="background-image: url(images/e6.png);">' + item |
| | | .name + '</div>' |
| | | html += '</div></li>' |
| | | } else if (item.type == '0D') { //加压风机 |
| | | html += '<li><div class="con myfancy jiaya" status="' + item.status + '" passCode="' + |
| | | item.passCode + '" serId="' + item.serId + '"name="' + item.name + |
| | | '" location="right">'; |
| | | html += '<div class="pic pic1"><img src="images/d9.png"></div>' |
| | | html += '<div class="info full" style="background-image: url(images/e7.png);">' + item |
| | | .name + '</div>' |
| | | html += '</div></li>' |
| | | } |
| | | }) |
| | | html += '</ul></div>' |
| | | } |
| | | } |
| | | } |
| | | |
| | | //设备操作请求 |
| | | function toControlDevice() { |
| | | mui.ajax(url, { |
| | | type: "POST", |
| | | dataType: "json", |
| | | crossDomain: true, |
| | | contentType: "application/json;charset=utf-8", |
| | | data: JSON.stringify(data), |
| | | success: function(result) { |
| | | if (result.code == "0000") { |
| | | window.setTimeout(function() { |
| | | renderDevice(); |
| | | }, 200) |
| | | } else { |
| | | mui.alert(result.msg, "提示", ["确定"], function() {}, "div") |
| | | } |
| | | }, |
| | | error: function() { |
| | | mui.alert("系统繁忙,请重试!", "提示", ["确定"], function() {}, "div") |
| | | } |
| | | }) |
| | | } |
| | | |
| | | mui('.mui-scroll-wrapper').scroll({ |
| | | indicators: false, //是否显示滚动条 |
| | |
| | | bounce: false, //是否启用回弹 |
| | | deceleration: 0.0005 //flick 减速系数,系数越大,滚动速度越慢,滚动距离越小,默认值0.0006 |
| | | }); |
| | | |
| | | //空调操作 |
| | | //风窗和通风口弹窗 |
| | | mui(".mui-scroll-wrapper").on("tap", ".m-tf ul li .chuangkou", function() { |
| | | deviceDetail.passCode = this.getAttribute("passCode"); |
| | | deviceDetail.serId = this.getAttribute("serId"); |
| | | deviceDetail.location = this.getAttribute("location"); |
| | | deviceDetail.type = this.getAttribute("type") |
| | | deviceDetail.status = this.getAttribute("status") |
| | | var name = this.getAttribute("name"); |
| | | document.getElementById("Fname").innerText = name |
| | | $('#win_chuangkou').css('display', 'flex'); |
| | | }); |
| | | //环流弹窗 |
| | | mui(".mui-scroll-wrapper").on("tap", ".m-tf ul li .huanliu", function() { |
| | | deviceDetail.passCode = this.getAttribute("passCode"); |
| | | deviceDetail.serId = this.getAttribute("serId"); |
| | | deviceDetail.location = this.getAttribute("location"); |
| | | deviceDetail.status = this.getAttribute("status") |
| | | deviceDetail.type = '04' |
| | | var name = this.getAttribute("name"); |
| | | document.getElementById("huanliuName").innerText = name |
| | | $('#win_huanliu').css('display', 'flex'); |
| | | }); |
| | | //混流弹窗 |
| | | mui(".mui-scroll-wrapper").on("tap", ".m-tf ul li .hunliu", function() { |
| | | deviceDetail.passCode = this.getAttribute("passCode"); |
| | | deviceDetail.serId = this.getAttribute("serId"); |
| | | deviceDetail.location = this.getAttribute("location"); |
| | | deviceDetail.status = this.getAttribute("status") |
| | | deviceDetail.type = "0C" |
| | | var name = this.getAttribute("name"); |
| | | document.getElementById("hunliuName").innerText = name |
| | | $('#win_hunliu').css('display', 'flex'); |
| | | }); |
| | | //轴流弹窗 |
| | | mui(".mui-scroll-wrapper").on("tap", ".m-tf ul li .zhouliu", function() { |
| | | deviceDetail.passCode = this.getAttribute("passCode"); |
| | | deviceDetail.serId = this.getAttribute("serId"); |
| | | deviceDetail.location = this.getAttribute("location"); |
| | | deviceDetail.status = this.getAttribute("status") |
| | | deviceDetail.type = "02" |
| | | var name = this.getAttribute("name"); |
| | | document.getElementById("zhouliuName").innerText = name |
| | | $('#win_zhouliu').css('display', 'flex'); |
| | | }); |
| | | //加压风机弹窗 |
| | | mui(".mui-scroll-wrapper").on("tap", ".m-tf ul li .jiaya", function() { |
| | | deviceDetail.passCode = this.getAttribute("passCode"); |
| | | deviceDetail.serId = this.getAttribute("serId"); |
| | | deviceDetail.location = this.getAttribute("location"); |
| | | deviceDetail.status = this.getAttribute("status"); |
| | | deviceDetail.type = "0D" |
| | | var name = this.getAttribute("name"); |
| | | document.getElementById("zhouliuName").innerText = name |
| | | $('#win_jiaya').css('display', 'flex'); |
| | | }); |
| | | //设备操作 |
| | | mui(".m-pop").on("tap", ".inner a", function() { |
| | | var id = this.getAttribute("id"); |
| | | //所进行的操作 |
| | | var targetStatus = this.getAttribute("targetStatus"); |
| | | |
| | | //如果是轴流风机,先根据风机状态判断风机操作是否可以执行 |
| | | if (deviceDetail.type == '02') { |
| | | //风机状态为风机开风窗开,即F_OPEN或者F_OPEN_F时,不能执行关风窗操作 |
| | | if ((deviceDetail.status == 'F_OPEN' || deviceDetail.status == 'F_OPEN_F') && targetStatus == 'CLOSE') { |
| | | mui.alert("此风机正在运行,不能执行关闭风窗操作!", "提示", ["确定"], function() {}, "div") |
| | | return; |
| | | } |
| | | //风机状态为风机开风窗开,即F_OPEN或者F_OPEN_F时,不能执行风窗全关操作 |
| | | if ((deviceDetail.status == 'F_OPEN' || deviceDetail.status == 'F_OPEN_F') && targetStatus == |
| | | 'W_CLOSE_ALL') { |
| | | mui.alert("此风机正在运行,不能执行风窗全关操作!", "提示", ["确定"], function() {}, "div") |
| | | return; |
| | | } |
| | | //风机状态为风机关风窗关,即W_CLOSE时,不能执行开风机操作 |
| | | if (deviceDetail.status == 'W_CLOSE' && (targetStatus == 'F_CLOSE' || targetStatus == 'F_OPEN')) { |
| | | mui.alert("此风机的风窗关闭中,不能执行风机操作!", "提示", ["确定"], function() {}, "div") |
| | | return; |
| | | } |
| | | } |
| | | //如果是混流风机,先判断风机操作是否可以执行 |
| | | if (deviceDetail.type == '0C') { |
| | | //风机状态为风机开风口开,即F_OPEN时,不能执行关风口操作 |
| | | if ((deviceDetail.status == 'F_OPEN_F' || deviceDetail.status == 'F_OPEN') && targetStatus == 'CLOSE') { |
| | | mui.alert("此风机正在运行,不能执行关闭风口操作!", "提示", ["确定"], function() {}, "div") |
| | | return; |
| | | } |
| | | //风机状态为风机开风窗开,即F_OPEN时,不能执行风窗全关操作 |
| | | if ((deviceDetail.status == 'F_OPEN_F' || deviceDetail.status == 'F_OPEN') && targetStatus == |
| | | 'W_CLOSE_ALL') { |
| | | mui.alert("此风机正在运行,不能执行风口全关操作!", "提示", ["确定"], function() {}, "div") |
| | | return; |
| | | } |
| | | //风机状态为风机关风窗关,即W_CLOSE时,不能执行开风窗操作 |
| | | if (deviceDetail.status == 'W_CLOSE' && (targetStatus == 'F_CLOSE' || targetStatus == 'F_OPEN' || |
| | | targetStatus == 'F_OPEN_F')) { |
| | | mui.alert("此风机的风口关闭中,不能执行风机操作!", "提示", ["确定"], function() {}, "div") |
| | | return; |
| | | } |
| | | //风机状态为风机开风窗开,即F_OPEN时,不能执行反转操作 |
| | | if (deviceDetail.status == 'F_OPEN' && targetStatus == 'F_OPEN_F') { |
| | | mui.alert("此风机正转状态,不能执行反转操作!", "提示", ["确定"], function() {}, "div") |
| | | return; |
| | | } |
| | | //风机状态为风机开风窗开,即F_OPEN_F时,不能执行正转操作 |
| | | if (deviceDetail.status == 'F_OPEN_F' && targetStatus == 'F_OPEN') { |
| | | mui.alert("此风机反转状态,不能执行正转操作!", "提示", ["确定"], function() {}, "div") |
| | | return; |
| | | } |
| | | } |
| | | //判断是否是批量 |
| | | var batchTag = false; |
| | | if (targetStatus == 'W_OPEN_ALL') { |
| | | targetStatus = 'OPEN'; |
| | | batchTag = true; |
| | | } |
| | | if (targetStatus == 'W_CLOSE_ALL') { |
| | | targetStatus = 'CLOSE'; |
| | | batchTag = true; |
| | | } |
| | | if (targetStatus == 'OPEN_ALL') { |
| | | targetStatus = 'OPEN'; |
| | | batchTag = true; |
| | | } |
| | | if (targetStatus == 'CLOSE_ALL') { |
| | | targetStatus = 'CLOSE'; |
| | | batchTag = true; |
| | | } |
| | | |
| | | //仓库前面 |
| | | if (deviceDetail.location == "front") { |
| | | //参数清空 |
| | | data.data = []; |
| | | if (batchTag) { //批量操作 |
| | | $.each(frontList, function(index, item) { |
| | | if (deviceDetail.type == item.type) { |
| | | data.data.push({ |
| | | "deptId": deptId, |
| | | "depotId": depotId, |
| | | "passCode": item.passCode, |
| | | "serId": item.serId, |
| | | "type": item.type, |
| | | "targetStatus": targetStatus |
| | | }) |
| | | } |
| | | }) |
| | | } else { //单设备操作 |
| | | data.data.push({ |
| | | "deptId": deptId, |
| | | "depotId": depotId, |
| | | "passCode": deviceDetail.passCode, |
| | | "serId": deviceDetail.serId, |
| | | "type": deviceDetail.type, |
| | | "targetStatus": targetStatus |
| | | }) |
| | | } |
| | | } else if (deviceDetail.location == "back") { |
| | | //参数清空 |
| | | data.data = []; |
| | | if (batchTag) { //批量操作 |
| | | $.each(backList, function(index, item) { |
| | | if (deviceDetail.type == item.type) { |
| | | data.data.push({ |
| | | "deptId": deptId, |
| | | "depotId": depotId, |
| | | "passCode": item.passCode, |
| | | "serId": item.serId, |
| | | "type": item.type, |
| | | "targetStatus": targetStatus |
| | | }) |
| | | } |
| | | }) |
| | | } else { //单设备操作 |
| | | data.data.push({ |
| | | "deptId": deptId, |
| | | "depotId": depotId, |
| | | "passCode": deviceDetail.passCode, |
| | | "serId": deviceDetail.serId, |
| | | "type": deviceDetail.type, |
| | | "targetStatus": targetStatus |
| | | }) |
| | | } |
| | | } else if (deviceDetail.location == "left") { |
| | | //参数清空 |
| | | data.data = []; |
| | | if (batchTag) { //批量操作 |
| | | $.each(leftList, function(index, item) { |
| | | if (deviceDetail.type == item.type) { |
| | | data.data.push({ |
| | | "deptId": deptId, |
| | | "depotId": depotId, |
| | | "passCode": item.passCode, |
| | | "serId": item.serId, |
| | | "type": item.type, |
| | | "targetStatus": targetStatus |
| | | }) |
| | | } |
| | | }) |
| | | } else { //单设备操作 |
| | | data.data.push({ |
| | | "deptId": deptId, |
| | | "depotId": depotId, |
| | | "passCode": deviceDetail.passCode, |
| | | "serId": deviceDetail.serId, |
| | | "type": deviceDetail.type, |
| | | "targetStatus": targetStatus |
| | | }) |
| | | } |
| | | } else if (deviceDetail.location == "right") { |
| | | //参数清空 |
| | | data.data = []; |
| | | if (batchTag) { //批量操作 |
| | | $.each(rightList, function(index, item) { |
| | | if (deviceDetail.type == item.type) { |
| | | data.data.push({ |
| | | "deptId": deptId, |
| | | "depotId": depotId, |
| | | "passCode": item.passCode, |
| | | "serId": item.serId, |
| | | "type": item.type, |
| | | "targetStatus": targetStatus |
| | | }) |
| | | } |
| | | }) |
| | | } else { //单设备操作 |
| | | data.data.push({ |
| | | "deptId": deptId, |
| | | "depotId": depotId, |
| | | "passCode": deviceDetail.passCode, |
| | | "serId": deviceDetail.serId, |
| | | "type": deviceDetail.type, |
| | | "targetStatus": targetStatus |
| | | }) |
| | | } |
| | | } |
| | | |
| | | //发送操作请求 |
| | | toControlDevice(); |
| | | |
| | | closePop(); |
| | | }); |
| | |
| | | $('.pop-bg,.m-pop .close').click(function(e) { |
| | | e.stopPropagation(); |
| | | $('.m-pop').fadeOut(); |
| | | }); |
| | | |
| | | var slider = mui(".mui-slider"); |
| | | slider.slider({ |
| | | interval: 3000 |
| | | }); |