<!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-icon-back:before,
|
.mui-icon-left-nav:before {
|
color: #FFFFFF;
|
}
|
|
.pest_depot {
|
background: #fff;
|
width: 94%;
|
margin: auto;
|
margin-top: 12px;
|
margin-bottom: 10px;
|
border-top-left-radius: 5px;
|
border-top-right-radius: 5px;
|
}
|
|
.pest_depot_title {
|
background: rgb(68, 189, 245);
|
height: 10px;
|
border-top-left-radius: 5px;
|
border-top-right-radius: 5px;
|
}
|
|
.pest_depot_body {
|
padding-left: 15px;
|
}
|
|
.pest_depot_body table {
|
width: 100%;
|
}
|
|
.pest_depot_body tr {
|
border-bottom: 1px #efefef solid;
|
height: 32px;
|
line-height: 32px;
|
}
|
|
.pest_depot_img {
|
width: 8px;
|
margin-right: 3px;
|
}
|
|
.pest_depot_one {
|
color: rgb(102, 102, 102);
|
font-size: 15px;
|
width: 35%;
|
}
|
|
.pest_depot_two {
|
color: black;
|
font-size: 16px;
|
font-weight: 510;
|
}
|
</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 id="pestList">
|
<!-- <div class="pest_depot">
|
<div class="pest_depot_title"></div>
|
<div class="pest_depot_body">
|
<table>
|
<tr class="pest_depot_tr">
|
<td class="pest_depot_one">仓库名称:</td>
|
<td class="pest_depot_two">##号仓</td>
|
<td>
|
<a href="javascript:void(0)" (click)="pestDetail(item.depotType,item.depotId,item.depotName,item.storeKeeperName)">
|
<img class="pest_depot_img" src="./images/ico_arr.png">
|
</a>
|
</td>
|
</tr>
|
<tr>
|
<td class="pest_depot_one">仓库状态:</td>
|
<td class="pest_depot_two">###</td>
|
<td></td>
|
</tr>
|
<tr>
|
<td class="pest_depot_one">是否有虫:</td>
|
<td class="pest_depot_two">##</td>
|
<td></td>
|
</tr>
|
<tr style="border-bottom: 0 #efefef solid;">
|
<td class="pest_depot_one">检测时间:</td>
|
<td class="pest_depot_two">2020-01-01 01:01:01</td>
|
<td></td>
|
</tr>
|
</table>
|
</div>
|
</div> -->
|
</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">
|
mui.init();
|
var url; //接口路径
|
var pestList; //虫害仓库列表集合集合
|
var data = {
|
"interfaceId": "5301",
|
"sign": "10301",
|
"outId": "10301",
|
"reqDateTime": new Date(),
|
"tokenAuth": "",
|
"data": {
|
"type": "pest"
|
}
|
};
|
|
mui.plusReady(function() {
|
var user = JSON.parse(localStorage.getItem('user'));
|
data.tokenAuth = user.tokenAuth;
|
url = user.url + "/api-phone/gateway";
|
getPestList();
|
})
|
|
//获取仓库信息
|
function getPestList() {
|
//发送请求获取仓库信息
|
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") {
|
pestList = result.data;
|
if (pestList != null && pestList.length > 0) {
|
renderPestList();
|
} else {
|
mui.alert("暂无数据!", '提示',["确定"],function(){},"div");
|
}
|
} else {
|
mui.alert(result.msg, '提示',["确定"],function(){},"div");
|
}
|
},
|
error: function() {
|
mui.alert('系统繁忙,请重试!', '提示',["确定"],function(){},"div");
|
}
|
})
|
}
|
|
//渲染
|
function renderPestList() {
|
var html = '';
|
$.each(pestList, function(index, item) {
|
html += '<div class="pest_depot"><div class="pest_depot_title"></div><div class="pest_depot_body"><table>';
|
|
html += '<tr class="pest_depot_tr"><td class="pest_depot_one">仓库名称:</td><td class="pest_depot_two">'
|
+ item.depotName + '</td><td><a href="javascript:void(0)" onclick="pestDetail(\''+index+'\')">'
|
+ '<img class="pest_depot_img" src="./images/ico_arr.png"></a></td></tr>';
|
|
html += '<tr><td class="pest_depot_one">仓库状态:</td><td class="pest_depot_two">'
|
+ (item.depotStatusName?item.depotStatusName:'') + '</td><td></td></tr>';
|
|
html += '<tr><td class="pest_depot_one">是否有虫:</td><td class="pest_depot_two">'
|
+ (item.isPest?item.isPest:'') + '</td><td></td></tr>';
|
|
html += '<tr><td class="pest_depot_one">检测时间:</td><td class="pest_depot_two">'
|
+ (item.receiveDate == null ? '无检测记录' : item.receiveDate) + '</td><td></td></tr>';
|
|
html += '</table></div></div>';
|
})
|
$("#pestList").html(html);
|
}
|
|
//跳转详情页面
|
function pestDetail(index) {
|
mui.openWindow({
|
url: "pest-detail.html",
|
id: "pest-detail",
|
extras: {
|
depotType: pestList[index].depotType,
|
depotId: pestList[index].depotId,
|
depotName: pestList[index].depotName
|
}
|
})
|
}
|
</script>
|
</body>
|
</html>
|