You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
119 lines
4.4 KiB
119 lines
4.4 KiB
11 months ago
|
layui.use(['form', 'layer', 'table', 'laytpl', 'laypage', 'laydate'], function () {
|
||
|
var form = layui.form,
|
||
|
layer = layui.layer,
|
||
|
laytpl = layui.laytpl,
|
||
|
table = layui.table,
|
||
|
laypage = layui.laypage,
|
||
|
laydate = layui.laydate;
|
||
|
var OrgId = "fbbb44bb458c4336a84e009df74c8598";//JSON.parse(window.sessionStorage.getItem("userInfo")).OrgID;
|
||
|
|
||
|
var obj = new Date();
|
||
|
var nowtime = obj.getFullYear() + "-" + (obj.getMonth() + 1);
|
||
|
$(".searchTime").val(nowtime);
|
||
|
//自定义事件
|
||
|
laydate.render({
|
||
|
elem: '.searchTime'
|
||
|
, trigger: 'click' //采用click弹出
|
||
|
, type: 'month'
|
||
|
, value:nowtime
|
||
|
});
|
||
|
|
||
|
|
||
|
|
||
|
pageConf = {};
|
||
|
pageConf.pageSize = 10;
|
||
|
pageConf.currentPage = 1;
|
||
|
|
||
|
LoadPersonAList(pageConf);
|
||
|
|
||
|
|
||
|
function LoadPersonAList(pageConf) {
|
||
|
var tableIns = table.render({
|
||
|
elem: '#PAList',
|
||
|
url: '../../ashx/PersonAccessHandler.ashx',
|
||
|
where: { Action: 'personTravel', OrgId: OrgId, searchTime: $(".searchTime").val(), searchIDCard: $(".searchIDCard").val(), searchName: $(".searchName").val(), random: new Date().getTime() },
|
||
|
cellMinWidth: 95,
|
||
|
page: {
|
||
|
layout: ['limit', 'count', 'prev', 'page', 'next', 'skip'] //自定义分页布局
|
||
|
//,curr: 5 //设定初始在第 5 页
|
||
|
, groups: 1 //只显示 1 个连续页码
|
||
|
, first: false //不显示首页
|
||
|
, last: false //不显示尾页
|
||
|
},
|
||
|
height: "full-125",
|
||
|
limits: [10, 15, 20, 25,50,100],
|
||
|
limit: 10,
|
||
|
id: "palist",
|
||
|
cols: [[
|
||
|
{ field: 'NAME', title: '姓名', minWidth: 60, align: "center" },
|
||
|
{ field: 'EXTEND2', title: '身份证号', minWidth: 60, align: "center" }
|
||
|
,{ title: '操作', width: 180, templet: '#sysappListBar', fixed: "right", align: "center" }
|
||
|
]],
|
||
|
done: function (res, curr, count) {
|
||
|
//如果是异步请求数据方式,res即为你接口返回的信息。
|
||
|
//如果是直接赋值的方式,res即为:{data: [], count: 99} data为当前页数据、count为数据总长度
|
||
|
if (res.data.length>0)
|
||
|
{
|
||
|
TravelList(res.data[0].EXTEND2);
|
||
|
}
|
||
|
}
|
||
|
});
|
||
|
}
|
||
|
|
||
|
function TravelList(idcard)
|
||
|
{
|
||
|
$.post("../../ashx/PersonAccessHandler.ashx", {
|
||
|
Action: 'TravelList'
|
||
|
, OrgId: OrgId
|
||
|
, searchTime: $(".searchTime").val()
|
||
|
, searchIDCard: idcard
|
||
|
, random: new Date().getTime()
|
||
|
}, function (res) {
|
||
|
res = JSON.parse(res);
|
||
|
if (res.data != undefined && res.data != null && res.data.length > 0) {
|
||
|
//设置时间树轨迹显示
|
||
|
}
|
||
|
else {
|
||
|
|
||
|
}
|
||
|
});
|
||
|
}
|
||
|
|
||
|
//搜索【此功能需要后台配合,所以暂时没有动态效果演示】
|
||
|
$(".search_btn").on("click", function () {
|
||
|
LoadPersonAList(pageConf)
|
||
|
});
|
||
|
|
||
|
|
||
|
//查看
|
||
|
function view(taskId) {
|
||
|
var clientWidth = parseInt(document.body.clientWidth * 0.7) + 'px';
|
||
|
var clientHeight = parseInt(document.body.clientHeight * 0.9) + 'px';
|
||
|
|
||
|
var index = layui.layer.open({
|
||
|
title: "查看访客出入记录",
|
||
|
type: 2,
|
||
|
area: [clientWidth, clientHeight],
|
||
|
maxmin: true,
|
||
|
content: "VisitorAudit.html?taskId=" + taskId,
|
||
|
success: function (layero, index) {
|
||
|
|
||
|
}
|
||
|
})
|
||
|
window.sessionStorage.setItem("index", index);
|
||
|
//改变窗口大小时,重置弹窗的宽高,防止超出可视区域(如F12调出debug的操作)
|
||
|
$(window).on("resize", function () {
|
||
|
layui.layer.full(window.sessionStorage.getItem("index"));
|
||
|
})
|
||
|
}
|
||
|
//列表操作
|
||
|
table.on('tool(sysappListBar)', function (obj) {
|
||
|
var layEvent = obj.event;
|
||
|
data = obj.data;
|
||
|
if (layEvent == 'audit') {//查看
|
||
|
AddEdit(data);
|
||
|
TravelList(data.EXTEND2)
|
||
|
}
|
||
|
})
|
||
|
|
||
|
})
|