253 lines
8.3 KiB
Plaintext
253 lines
8.3 KiB
Plaintext
@model List<dccdc.Models.AccessModel>
|
||
|
||
@{
|
||
ViewBag.Title = "门禁设备";
|
||
}
|
||
<div style="padding:10px">
|
||
<div id="maingrid" style="width:100%;"></div>
|
||
</div>
|
||
|
||
|
||
<script type="text/javascript" src="@Url.Content("~/Scripts/public.js")"></script>
|
||
<script type="text/javascript" src="@Url.Content("~/layuiadmin/layui/layui.js")"></script>
|
||
<script type="text/javascript" src="@Url.Content("~/layuiadmin/layui/layui.all.js")"></script>
|
||
<link type="text/css" rel="stylesheet" href="@Url.Content("~/layuiadmin/layui/css/layui.css")" />
|
||
<style type="text/css">
|
||
.div_box {
|
||
width: 80%;
|
||
height: 800px;
|
||
margin: 0 auto;
|
||
/*background: url(/Images/tabl_back.png)no-repeat;*/
|
||
background-size: 20px;
|
||
}
|
||
|
||
.div_cont_box ul {
|
||
margin: 0px;
|
||
padding: 0px;
|
||
padding-top: 102px !important;
|
||
padding-left: 35px;
|
||
}
|
||
|
||
.div_cont_box ul li {
|
||
list-style: none;
|
||
background: url(@Url.Content("~/Images/li_back.png"))no-repeat;
|
||
width: 1029px;
|
||
height: 70px;
|
||
background-size: 100% 100%;
|
||
}
|
||
|
||
.clear_box::after {
|
||
content: "";
|
||
display: block;
|
||
clear: both;
|
||
}
|
||
|
||
.li_left {
|
||
width: 50%;
|
||
height: 70px;
|
||
float: left;
|
||
padding-left: 20px;
|
||
box-sizing: border-box;
|
||
}
|
||
|
||
.li_right {
|
||
width: 50%;
|
||
height: 70px;
|
||
float: left;
|
||
}
|
||
|
||
.li_left a {
|
||
color: #FFF;
|
||
font-size: 18px;
|
||
line-height: 57px;
|
||
float: left;
|
||
display: block;
|
||
margin-top: 6px;
|
||
}
|
||
|
||
.sbmc {
|
||
font-size: 20px !important;
|
||
margin-right: 15px;
|
||
}
|
||
|
||
.li_right button {
|
||
background: #FFF;
|
||
color: #0661a1;
|
||
height: 35px;
|
||
border: none;
|
||
padding: 5px 15px;
|
||
border-radius: 20px;
|
||
margin-top: 17px;
|
||
line-height: 15px;
|
||
margin-right: 15px;
|
||
outline: none;
|
||
font-size: 14px;
|
||
}
|
||
|
||
.icon_car {
|
||
width: 30px;
|
||
height: 30px;
|
||
background: url(@Url.Content("~/Images/car.png"))no-repeat;
|
||
margin -right: 10px;
|
||
display: block;
|
||
margin-top: 18px !important;
|
||
float: left;
|
||
margin-left: 37px;
|
||
}
|
||
|
||
.icon_men {
|
||
width: 30px;
|
||
height: 30px;
|
||
background: url(@Url.Content("~/Images/men02.png"))no-repeat;
|
||
margin -right: 10px;
|
||
display: block;
|
||
margin-top: 18px !important;
|
||
float: left;
|
||
margin-left: 37px;
|
||
}
|
||
</style>
|
||
|
||
<div style=" width: 600px;
|
||
margin-left: 237px;
|
||
margin-bottom: -90px;
|
||
margin-top: 10px;">
|
||
<button class="layui-btn" value="2" title="添加" onclick="setTop(this)">添加</button>
|
||
<button class="layui-btn layui-btn-normal" value="2" title="修改" layui-btn-normal" onclick="setTop(this)">修改</button>
|
||
<button class="layui-btn layui-btn-danger" onclick="">删除</button>
|
||
</div>
|
||
<div class="div_box">
|
||
<div class="div_cont_box">
|
||
|
||
<ul>
|
||
@{
|
||
for (int i = 0; i < Model.Count; i++)
|
||
{
|
||
<li class="clear_box">
|
||
<div class="li_left">
|
||
<span class="icon_car"></span>
|
||
<a class="sbmc" value="sbmc">@Model[i].sbmc</a>
|
||
</div>
|
||
<div class="li_right">
|
||
<button doorid="@Model[i].id" type="button" value="0" onclick="setTop(this)">临时开门</button>
|
||
<button doorid="@Model[i].id" type="button" value="1" title="查看详情" onclick="setTop(this)">详细信息</button>
|
||
<button doorid="@Model[i].id" type="button" value="3" title="出入记录" onclick="setTop(this)">出入记录</button>
|
||
<button doorid="@Model[i].id" type="button" value="2" title="修改" onclick="setTop(this)">修改</button>
|
||
<button doorid="@Model[i].id" onclick="del(this)" type="button">删除</button>
|
||
</div>
|
||
</li>
|
||
}
|
||
}
|
||
</ul>
|
||
</div>
|
||
</div>
|
||
|
||
@section scripts{
|
||
<script type="text/javascript" src="@Url.Content("~/Scripts/public.js")"></script>
|
||
<script type="text/javascript">
|
||
function setTop(obj) {
|
||
var id = $(obj).attr("doorid");
|
||
var vlue = obj.value;
|
||
debugger
|
||
try {
|
||
if (vlue == 2) {
|
||
layer.open({
|
||
type: 2,
|
||
area: ['50%', '70%'],
|
||
title: obj.title,
|
||
maxmin: true,
|
||
content: 'AccessForm?id=' + id,
|
||
btn: ['保存', '关闭'],
|
||
yes: function (index) {
|
||
|
||
layer.getChildFrame('#btnsubmit', index).click();
|
||
}, btn2:function (index) {
|
||
layer.close(index);
|
||
}
|
||
});
|
||
}
|
||
else if (vlue == 1) {
|
||
layer.open({
|
||
type: 2,
|
||
area: ['50%', '70%'],
|
||
title: obj.title,
|
||
maxmin: true,
|
||
content: 'AccessForm?id=' + id,
|
||
btn: ['关闭'],
|
||
yes: function (index) {
|
||
layer.close(index);
|
||
}
|
||
});
|
||
}
|
||
else if (vlue == 3) {
|
||
layer.open({
|
||
type: 2,
|
||
area: ['50%', '70%'],
|
||
title: obj.title,
|
||
maxmin: true,
|
||
content: 'OpeningRecordResult?doorid=' + id,
|
||
btn: ['关闭'],
|
||
yes: function (index) {
|
||
layer.close(index);
|
||
}
|
||
})
|
||
}
|
||
else if (vlue == 0) {
|
||
var index = 0;
|
||
$.ajax("@Url.Action("lskm")", {
|
||
type: "post", dataType: "json", data: {doorid:id},
|
||
beforeSend: function () {
|
||
index = layer.load(0, { shade: [0.3, '#000'], content:"正在开门请稍后……" });
|
||
},
|
||
success: function (data) {
|
||
layer.close(index);
|
||
if (data.State == 0) {
|
||
layer.msg(data.Message, {
|
||
shade: [0.2, '#000'],
|
||
icon: 2,
|
||
time: 2000 //2秒关闭(如果不配置,默认是3秒)
|
||
});
|
||
}
|
||
else {
|
||
layer.msg(data.Message, {
|
||
shade: [0.2, '#000'],
|
||
icon: 1,
|
||
time: 2000 //2秒关闭(如果不配置,默认是3秒)
|
||
});
|
||
}
|
||
}
|
||
});
|
||
|
||
}
|
||
} catch (e) {
|
||
|
||
}
|
||
}
|
||
function del(obj) {
|
||
var id = $(obj).attr("doorid");
|
||
layer.confirm('确定删除吗?', {
|
||
btn: ['确定','取消'] //按钮
|
||
}, function(){
|
||
$.ajax({
|
||
type: "Post",
|
||
url: "DeleteAccess?id=" + id,
|
||
data:id,
|
||
dataType: "text",
|
||
success: function () {
|
||
layer.msg('删除成功');
|
||
location.reload();
|
||
},
|
||
error: function (xmlReq, err, c) {
|
||
layer.msg('删除失败');
|
||
}
|
||
});
|
||
});
|
||
}
|
||
|
||
|
||
</script>
|
||
}
|
||
|
||
|
||
|
||
|