<!DOCTYPE html>
|
<html lang="zh-cn" xmlns:th=http://www.thymeleaf.org>
|
<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 rel="stylesheet" th:href="@{/ajax/libs/mui/css/mui.min.css}">
|
<style>
|
.mui-content {
|
margin: 0 5px;
|
}
|
|
.mui-table-view {
|
position: unset;
|
margin-top: 10px;
|
border-radius: 6px;
|
}
|
|
.mui-table-view-chevron .mui-table-view-cell {
|
padding-right: 10px;
|
}
|
|
.mui-table-view-cell {
|
padding: 10px 10px;
|
}
|
|
.mui-table-view-cell p {
|
font-size: 17px;
|
}
|
|
.mui-ellipsis {
|
margin-top: 5px;
|
margin-bottom: 10px;
|
font-size: 18px;
|
}
|
|
.first {
|
font-size: 15px;
|
float: right;
|
}
|
|
.sec {
|
border-radius: 6px;
|
margin-top: 10px;
|
margin-bottom: 10px;
|
list-style: none;
|
background: #FFFFFF;
|
}
|
|
.four {
|
padding: 7px 10px;
|
}
|
|
.sec-2 {
|
margin-top: 10px;
|
margin-bottom: 10px;
|
font-size: 18px;
|
}
|
|
input[type=color], input[type=date], input[type=datetime-local], input[type=datetime], input[type=email], input[type=month], input[type=number], input[type=password], input[type=search], input[type=tel], input[type=text], input[type=time], input[type=url], input[type=week], select, textarea {
|
border-radius: 4px;
|
padding: 10px 10px;
|
margin-bottom: unset;
|
background-color: #eee;
|
border: 1px solid #eee;
|
}
|
|
.title {
|
text-align: center;
|
background: #8bd2f5;
|
border-radius: 6px 6px 0 0;
|
font-size: 15px;
|
}
|
|
.mui-btn {
|
font-size: 22px;
|
padding: 6px 20px;
|
border-radius: 6px;
|
}
|
|
.mui-button-row {
|
margin-bottom: 10px;
|
}
|
|
.head {
|
margin-top: 44px;
|
}
|
</style>
|
</head>
|
<body>
|
<div id="head">
|
<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>
|
<div id="content" class="mui-content head">
|
<div>
|
<ul class="mui-table-view mui-table-view-chevron">
|
<div class="title">警告信息</div>
|
<li id="handle1" class="mui-table-view-cell">
|
<!-- <h4 class="mui-ellipsis">高温警告<span class="first">未处理</span></h4>-->
|
<!-- <h5 class="mui-ellipsis">温湿度#1</h5>-->
|
<!-- <h5 class="mui-ellipsis">2020-10-10 10:10:10</h5>-->
|
<!-- <p >您好,你的设备温湿度#1于2020-10-10 10:10:10触发高温告警,请及时处理!</p>-->
|
</li>
|
</ul>
|
</div>
|
<div class="sec">
|
<div class="title">处理信息</div>
|
<div id="handle2" class="four">
|
<!-- <h5 class="sec-2">张三</h5>-->
|
<!-- <h5 class="sec-2">2020-10-10 10:10:10</h5>-->
|
<!-- <textarea id="textarea" rows="5" placeholder="处理说明"></textarea>-->
|
</div>
|
</div>
|
<div class="mui-button-row">
|
<button id="btn1" type="button" class="mui-btn mui-btn-primary" onclick="toHandle()">处理</button>
|
<button type="button" class="mui-btn mui-btn-danger" onclick="toPage()">返回</button>
|
</div>
|
|
</div>
|
<script th:src="@{/js/jquery.min.js}"></script>
|
<script th:src="@{/wx/wx-common.js}"></script>
|
<script th:src="@{/ajax/libs/mui/js/mui.js}"></script>
|
<script th:inline="javascript">
|
var warnId = [[${id}]]; //设备id
|
var companyId = [[${companyId}]]; //组织编码
|
var deptList = [[${deptList}]];
|
var userName = [[${userName}]]; //当前操作人账号
|
var loginType = [[${loginType}]]; //登录方式
|
var deptListMap = {};
|
$(function () {
|
//所有库区
|
if (deptList) {
|
for (var i = 0; i < deptList.length; i++) {
|
deptListMap[deptList[i].id] = deptList[i];
|
}
|
}
|
mui.init();
|
try {
|
getDeviceList();
|
} catch (e) {
|
mui.alert(e, '提示', ["确定"], function () {
|
}, "div");
|
}
|
// getDeviceList()
|
});
|
|
//获取用户设备信息
|
function getDeviceList() {
|
var data = {
|
"id": warnId,
|
};
|
wxCommon.postJson("../wx/getSnapReplyInfoById", data, function (result) {
|
if (result.code == "0000") {
|
initData(result.data);
|
} else {
|
$("#listData").html('');
|
mui.alert(result.msg, '提示', ["确定"], function () {
|
}, "div");
|
}
|
});
|
}
|
|
//初始化页面数据
|
function initData(data) {
|
var deptName = deptListMap[data.deptId] ? deptListMap[data.deptId].kqmc : data.deptId;
|
|
var html1 = '';
|
var html2 = '';
|
html1 += '<h4 class="mui-ellipsis">' +deptName;
|
html1 += '<h5 class="mui-ellipsis">' + data.createTime + '</h5>';
|
html1 += '<p>' + data.content + '</p>';
|
|
//未处理
|
if(data.isHandle && data.isHandle == "N"){
|
html2 += '<input id="days" type="number" min="1" step="1" placeholder="未来正常天数" style="width: 100%; margin-top: 10px;margin-bottom: 10px" oninput="this.value = this.value.replace(/\\D|^0/g, \'\')" />';
|
html2 += '<textarea id="remark" rows="5" placeholder="处理说明"></textarea>';
|
}else{
|
html2 += '<p>' + '未来正常天数:'+ data.days + '</p>';
|
html2 += '<p>' + '处理说明:'+ data.remark + '</p>';
|
|
}
|
$("#handle1").html(html1);
|
$("#handle2").html(html2);
|
}
|
|
//警告处理提交
|
function toHandle() {
|
var remarkDetail = $("#remark").val();
|
var days = $("#days").val();
|
|
|
var data = {
|
"id": warnId,
|
"userName": userName,
|
"remark": remarkDetail,
|
"days": days
|
};
|
wxCommon.postJson("../wx/handleSnapReply", data, function (result) {
|
if (result.code == "0000") {
|
mui.toast("处理成功!");
|
toPage();
|
} else {
|
mui.alert(result.msg, '提示', ["确定"], function () {
|
}, "div");
|
}
|
});
|
}
|
|
//返回警报列表
|
function toPage() {
|
location.reload();
|
// 返回上一页
|
// 微信 H5 环境:使用 localStorage 标记
|
localStorage.setItem('needRefresh', 'true');
|
mui.back();
|
}
|
|
</script>
|
</body>
|
</html>
|