| | |
| | | var deviceData; |
| | | var targetStatus; |
| | | //阀门控制 |
| | | var data = { |
| | | "interfaceId": "5402", |
| | |
| | | "type": "09", |
| | | "passCode": "", |
| | | "serId": "", |
| | | "targetStatus":"" |
| | | "targetStatus":"", |
| | | "batchTag":"" |
| | | } |
| | | }; |
| | | //设备列表 - 电磁阀 |
| | |
| | | |
| | | var user = JSON.parse(localStorage.getItem('user')); |
| | | var selectDeptId = JSON.parse(localStorage.getItem('selectDeptId')); |
| | | url = user.url + "/api-phone/v35/gateway"; |
| | | url = user.url + "/api/phone/v35/gateway"; |
| | | data.tokenAuth = user.tokenAuth; |
| | | data.data.deptId = user.deptId; |
| | | data1.tokenAuth = user.tokenAuth; |
| | |
| | | |
| | | //渲染页面 |
| | | function renderDevice() { |
| | | console.log(JSON.stringify(deviceData)) |
| | | var html = ''; |
| | | if (deviceData) { |
| | | var deviceList = deviceData.listDevice |
| | |
| | | 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) { |
| | | targetStatus = item.status |
| | | if (item.location == '01') { |
| | | html += '<li><div class="con myfancy" passCode="' + item.passCode + '" serId="' + |
| | | html += '<li><div class="con myfancy" passCode="' + item.passCode + '" targetStatus="' + item.status +'" serId="' + |
| | | item.serId + |
| | | '" data-win="#win_kt"><div class="pic pic2"><img src="images/e2.png"></div>'; |
| | | if (targetStatus == 'OPEN') { |
| | | html += '<div class="info out" style="background-image: url(images/e5.png);">' + |
| | | item.name + '</div>' |
| | | } else { |
| | | } else if(targetStatus == 'CLOSE'){ |
| | | html += '<div class="info out" style="background-image: url(images/e9.png);">' + |
| | | item.name + '</div>' |
| | | } |
| | | html += '</div></div></li>' |
| | | html += '</div></li>' |
| | | } |
| | | }) |
| | | html += '</ul></div>' |
| | |
| | | html += '<div class="m-tf"><div class="g-tittf1">仓库反面</div><ul class="ul-listmana1 ullisttf1">'; |
| | | $.each(backList, function(index, item) { |
| | | if (item.location == '02') { |
| | | html += '<li><div class="con myfancy" passCode="' + item.passCode + '" serId="' + |
| | | targetStatus = item.status |
| | | html += '<li><div class="con myfancy" passCode="' + item.passCode + '" targetStatus="' + item.status +'" serId="' + |
| | | item.serId + |
| | | '" data-win="#win_fm"><div class="pic pic2"><img src="images/e2.png"></div>'; |
| | | if (targetStatus == 'OPEN') { |
| | | html += '<div class="info full" style="background-image: url(images/e5.png);">' + |
| | | item.name + '</div>' |
| | | } else { |
| | | } else if(targetStatus == 'CLOSE'){ |
| | | html += '<div class="info full" style="background-image: url(images/e9.png);">' + |
| | | item.name + '</div>' |
| | | } |
| | | html += '</div></div></li>' |
| | | html += '</div></li>' |
| | | } |
| | | }) |
| | | html += '</ul></div>' |
| | |
| | | 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) { |
| | | targetStatus = item.status |
| | | if (item.location == '03') { |
| | | html += '<li><div class="con myfancy" passCode="' + item.passCode + '" serId="' + |
| | | html += '<li><div class="con myfancy" passCode="' + item.passCode + '" targetStatus="' + item.status +'" serId="' + |
| | | item.serId + |
| | | '" data-win="#win_fm"><div class="pic pic2"><img src="images/e2.png"></div>'; |
| | | if (targetStatus == 'OPEN') { |
| | | html += '<div class="info full" style="background-image: url(images/e5.png);">' + |
| | | item.name + '</div>' |
| | | } else { |
| | | } else if(targetStatus == 'CLOSE'){ |
| | | html += '<div class="info full" style="background-image: url(images/e9.png);">' + |
| | | item.name + '</div>' |
| | | } |
| | | html += '</div></div></li>' |
| | | html += '</div></li>' |
| | | } |
| | | }) |
| | | html += '</ul></div>' |
| | |
| | | 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) { |
| | | targetStatus = item.status |
| | | if (item.location == '04') { |
| | | html += '<li><div class="con myfancy" passCode="' + item.passCode + '" serId="' + |
| | | html += '<li><div class="con myfancy" passCode="' + item.passCode + '" targetStatus="' + item.status +'" serId="' + |
| | | item.serId + |
| | | '" data-win="#win_fm"><div class="pic pic2"><img src="images/e2.png"></div>'; |
| | | if (targetStatus == 'OPEN') { |
| | | html += '<div class="info full" style="background-image: url(images/e5.png);">' + |
| | | item.name + '</div>' |
| | | } else { |
| | | } else if(targetStatus == 'CLOSE'){ |
| | | html += '<div class="info full" style="background-image: url(images/e9.png);">' + |
| | | item.name + '</div>' |
| | | } |
| | | html += '</div></div></li>' |
| | | html += '</div></li>' |
| | | } |
| | | }) |
| | | html += '</ul></div>' |
| | |
| | | html += '<div class="m-tf"><div class="g-tittf1" style="text-align: center;font-size: 20px;color:#dd524d">暂无数据</div></div>'; |
| | | // html += '<div>1111</div>' |
| | | } |
| | | console.log(html) |
| | | $("#recordList").html(html); |
| | | } |
| | | |
| | |
| | | mui(".mui-scroll-wrapper").on("tap", ".m-tf ul li .con", function() { |
| | | var passCode = this.getAttribute("passCode"); |
| | | var serId = this.getAttribute("serId"); |
| | | targetStatus = this.getAttribute("targetStatus"); |
| | | data.data.targetStatus = targetStatus; |
| | | data.data.passCode = passCode; |
| | | data.data.serId = serId; |
| | | $('.m-pop').css('display', 'flex'); |
| | | }); |
| | | mui(".m-pop").on("tap", ".inner a", function() { |
| | | var id = this.getAttribute("id"); |
| | | mui.toast(id); |
| | | console.log(JSON.stringify(data.data)) |
| | | if(id==1){ |
| | | data.data.targetStatus="OPEN" |
| | | batchTag = false; |
| | | } |
| | | if(id==2){ |
| | | data.data.targetStatus="CLOSE" |
| | | batchTag = false; |
| | | } |
| | | if(id==3){ |
| | | data.data.targetStatus="OPEN" |
| | | batchTag = true; |
| | | } |
| | | if(id==4){ |
| | | data.data.targetStatus="CLOSE" |
| | | batchTag = true; |
| | | } |
| | | setTemp(); |
| | | closePop(); |
| | | }); |
| | | //关闭弹窗 |