<!DOCTYPE html>
|
<html>
|
<head>
|
<meta charset="utf-8">
|
<title>粮情检测-仓库列表</title>
|
<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
|
<link href="./css/mui.min.css" rel="stylesheet" />
|
<style>
|
.mui-bar-nav {
|
background: #245ca7;
|
-webkit-box-shadow: none;
|
box-shadow: none;
|
}
|
|
.mui-title {
|
color: #FFFFFF;
|
}
|
|
.mui-content {
|
margin: 0 5px;
|
}
|
|
.mui-icon-back:before,
|
.mui-icon-left-nav:before {
|
color: #FFFFFF;
|
}
|
|
.mui-grid-view.mui-grid-9 {
|
margin: auto;
|
background-color: #4e555b;
|
border-left: none;
|
border-top: none;
|
}
|
|
.mui-grid-view.mui-grid-9 .mui-table-view-cell {
|
padding: 10px 10px;
|
}
|
|
.mui-grid-view.mui-grid-9 .mui-table-view-cell>a:not(.mui-btn) {
|
padding: 8px 0;
|
}
|
|
.mui-col-xs-4 {
|
width: 33.333333%;
|
}
|
|
.mui-icon-list,
|
.mui-icon-chat,
|
.mui-icon-contact,
|
.mui-icon-gear,
|
.mui-icon-close {
|
color: #FFFFFF;
|
}
|
|
.mui-grid-view.mui-grid-9 .mui-media .mui-icon {
|
font-size: 2.4em;
|
position: relative;
|
border-radius: 50px;
|
padding: 12px;
|
}
|
|
.mui-table-view.mui-grid-view .mui-table-view-cell .mui-media-body {
|
color: #FFFFFF;
|
}
|
|
.mui-grid-view.mui-grid-9:after,
|
.mui-grid-view.mui-grid-9:before {
|
display: none;
|
|
}
|
|
.depot_img {
|
width: 60px;
|
height: auto;
|
display: block;
|
margin: auto;
|
}
|
|
</style>
|
</head>
|
<body>
|
<header class="mui-bar mui-bar-nav">
|
<a class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left"></a>
|
<h1 class="mui-title">粮情检测-仓库列表</h1>
|
</header>
|
<div class="mui-content">
|
<div>
|
<ul id="depotList" class="mui-table-view mui-grid-view mui-grid-9">
|
<li class="mui-table-view-cell mui-media mui-col-xs-4 mui-col-sm-3">
|
<a href="javascript:void(0)" onclick="getView('grain-listDepot')">
|
<div class="mui-media-body">入库中</div>
|
<img class="depot_img" src="./images/ico_depot1.png">
|
<div class="mui-media-body">1号仓</div>
|
</a>
|
</li>
|
<li class="mui-table-view-cell mui-media mui-col-xs-4 mui-col-sm-3">
|
<a href="javascript:void(0)" onclick="getView('grain-listDepot')">
|
<div class="mui-media-body">入库中</div>
|
<img class="depot_img" src="./images/ico_depot1.png">
|
<div class="mui-media-body">2号仓</div>
|
</a>
|
</li>
|
<li class="mui-table-view-cell mui-media mui-col-xs-4 mui-col-sm-3">
|
<a href="javascript:void(0)" onclick="getView('grain-listDepot')">
|
<div class="mui-media-body">入库中</div>
|
<img class="depot_img" src="./images/ico_depot1.png">
|
<div class="mui-media-body">3号仓</div>
|
</a>
|
</li>
|
<li class="mui-table-view-cell mui-media mui-col-xs-4 mui-col-sm-3">
|
<a href="javascript:void(0)" onclick="getView('grain-listDepot')">
|
<div class="mui-media-body">入库中</div>
|
<img class="depot_img" src="./images/ico_depot1.png">
|
<div class="mui-media-body">4号仓</div>
|
</a>
|
</li>
|
</ul>
|
</div>
|
</div>
|
<script src="./js/mui.js"></script>
|
<script src="./js/jquery.min.js"></script>
|
<script src="./js/echarts.min.js"></script>
|
|
<script type="text/javascript" charset="utf-8">
|
var user;
|
var contentList;
|
var data = {
|
"interfaceId": "5301",
|
"sign": "10301",
|
"outId": "10301",
|
"reqDateTime": new Date(),
|
"tokenAuth": "",
|
"data": {
|
"type": "grain"
|
}
|
};
|
mui.init()
|
|
mui.plusReady(function() {
|
user = JSON.parse(localStorage.getItem('user'));
|
data.tokenAuth = user.tokenAuth;
|
getList()
|
})
|
|
function getList() {
|
var url = user.url + "/api-phone/gateway";
|
//请求
|
mui.ajax(url, {
|
type: "POST",
|
dataType: "json",
|
crossDomain: true,
|
contentType: "application/json;charset=utf-8",
|
data: JSON.stringify(data),
|
success: function(data) {
|
if (data.code == "0000") {
|
contentList = data.data;
|
renderList();
|
} else {
|
mui.alert(data.msg, '提示',["确定"],function(){},"div");
|
}
|
},
|
error: function() {
|
mui.alert('系统繁忙,请重试!', '提示',["确定"],function(){},"div");
|
}
|
})
|
}
|
|
//渲染页面
|
function renderList() {
|
var html = '';
|
|
if (contentList != null && contentList.length > 0) {
|
for (var i = 0; i < contentList.length; i++) {
|
|
html += '<li class="mui-table-view-cell mui-media mui-col-xs-4 mui-col-sm-3">';
|
html += '<a href="javascript:void(0)" onclick="grainDetail(\'' + i + '\')">';
|
html += '<div class="mui-media-body">' + (contentList[i].depotStatusName ? contentList[i].depotStatusName:'') + '</div>';
|
html += '<img class="depot_img" ';
|
if (contentList[i].depotType == "01") {
|
if (contentList[i].depotStatus == "01") {
|
html += 'src="./images/ico_depot1.png">';
|
} else if (contentList[i].depotStatus == "02") {
|
html += 'src="./images/ico_depot2.png">';
|
} else if (contentList[i].depotStatus == "03") {
|
html += 'src="./images/ico_depot3.png">';
|
} else if (contentList[i].depotStatus == "04") {
|
html += 'src="./images/ico_depot4.png">';
|
} else if (contentList[i].depotStatus == "08") {
|
html += 'src="./images/ico_depot8.png">';
|
} else {
|
html += 'src="./images/ico_depot5.png">';
|
}
|
} else if (contentList[i].depotType == "02" || contentList[i].depotType == "04") {
|
if (contentList[i].depotStatus == "01") {
|
html += 'src="./images/ico_depot111.png">';
|
} else if (contentList[i].depotStatus == "02") {
|
html += 'src="./images/ico_depot222.png">';
|
} else if (contentList[i].depotStatus == "03") {
|
html += 'src="./images/ico_depot333.png">';
|
} else if (contentList[i].depotStatus == "04") {
|
html += 'src="./images/ico_depot444.png">';
|
} else if (contentList[i].depotStatus == "08") {
|
html += 'src="./images/ico_depot888.png">';
|
} else {
|
html += 'src="./images/ico_depot555.png">';
|
}
|
} else if (contentList[i].depotType == "03") {
|
if (contentList[i].depotStatus == "01") {
|
html += 'src="./images/ico_depot11.png">';
|
} else if (contentList[i].depotStatus == "02") {
|
html += 'src="./images/ico_depot22.png">';
|
} else if (contentList[i].depotStatus == "03") {
|
html += 'src="./images/ico_depot33.png">';
|
} else if (contentList[i].depotStatus == "04") {
|
html += 'src="./images/ico_depot44.png">';
|
} else if (contentList[i].depotStatus == "08") {
|
html += 'src="./images/ico_depot88.png">';
|
} else {
|
html += 'src="./images/ico_depot55.png">';
|
}
|
}
|
html += '<div class="mui-media-body">' + contentList[i].depotName + '</div>';
|
html += '</a></li>';
|
}
|
} else {
|
html += '';
|
}
|
$("#depotList").html(html);
|
}
|
|
function grainDetail(i) {
|
if (contentList[i].depotType == '01') {
|
//平房仓粮情
|
mui.openWindow({
|
url: "grain-detail-bungalow.html",
|
id: "grain-detail-bungalow",
|
extras: {
|
depotType: contentList[i].depotType,
|
depotId: contentList[i].depotId,
|
depotName: contentList[i].depotName
|
}
|
})
|
} else if (contentList[i].depotType == '02' || contentList[i].depotType == '04') {
|
//圆筒仓粮情
|
mui.openWindow({
|
url: "grain-detail-drum.html",
|
id: "grain-detail-drum",
|
extras: {
|
depotType: contentList[i].depotType,
|
depotId: contentList[i].depotId,
|
depotName: contentList[i].depotName
|
}
|
})
|
} else {
|
mui.alert('暂无权限!', '提示',["确定"],function(){},"div");
|
//油罐仓粮情
|
// mui.openWindow({
|
// url: "grain-detail-oil.html",
|
// id: "grain-detail-oil",
|
// extras: {
|
// depotType: contentList[i].depotType,
|
// depotId: contentList[i].depotId,
|
// depotName: contentList[i].depotName
|
// }
|
// })
|
}
|
}
|
</script>
|
</body>
|
</html>
|