import { stationurl,brigade } from "../../public/js/url.js";
import { layuiObj} from "../../pages/cmddispatch/js/index.js"
import {getCurrData} from "../../public/js/timestamp.js";
import {getSchoolOptions} from "../cmddispatch/js/tree.js"
import {openClockInfo} from "../cmddispatch/js/orgApi/getEntranceStaffSign.js"
function getEntranceStaffSignHistory(obj){
var loginurl=stationurl+"/firectrl/client/sensor/entrance/staff_sign_list";
return axios({
method: 'post',
url:loginurl,
data: obj
})
}
function showStaffSignHistory(){
layuiObj.layer.open({
type: 1,
title: '护校考勤', //不显示标题栏
area: ['1000px', '580px'],
shade: 0.6,
id:new Date().getTime(), //设定一个id,防止重复弹出
btnAlign: 'c',
moveType: 1, //拖拽模式,0或者1
content: `
`,
success: function(layero){
staffSignFromRender();
showstaffSignHistoryContent([])
}
});
}
function staffSignFromRender(){
$("#staffSignHistorySelect").html(getSchoolOptions());
layuiObj.layuiForm.render("select","staffSignHistoryForm");
layuiObj.laydate.render({
elem: '#staffSignHistoryStart',
type: 'datetime',
});
layuiObj.laydate.render({
elem: '#staffSignHistoryEnd',
type: 'datetime',
});
$("#staffSignHistoryBtn").on('click',function(e){
e.preventDefault();
var station=$("#staffSignHistorySelect").find("option:selected").val();
var signobj={
"brigade":brigade,
"start":$("#staffSignHistoryStart").val(),
"end":$("#staffSignHistoryEnd").val(),
}
if(station!="000"){
signobj["station"]=station
}
getEntranceStaffSignHistory(signobj).then(res=>{
var code=res["data"]["code"];
if(code==0){
var data=res["data"]["data"];
if(data.length==0){
layuiObj.layer.msg("无数据")
showstaffSignHistoryContent([])
}else{
showstaffSignHistoryContent(data)
}
}
})
})
}
function showstaffSignHistoryContent(data){
var tempData=[];
var tempObj={};
for(var i=0;i