var layer;
var loadingMsg;
var example = null;
var pers = null;
var form;
var subComIdThree;
var proIdThree;
var currentDayThree;
var ctxPath;
let status;
$(function () {
layui.use(['layer','form','laydate'], function () {
layer = layui.layer;
form = layui.form;
var laydate = layui.laydate;
laydate.render({
elem: '#currentDayThree',
value: getNowTime(),
isInitValue: true
});
ctxPath = "http://192.168.0.14:1911/bmw/";
status = '0';
if(status == '1'){
$("#searchDiv").css("display","none");
$("#proTypeSwitchThree").css("display","none");
$("#proTypeSwitchThree1").css("display","none");
$("#proTypeSwitchThree2").css("display","none");
}else{
$("#searchDiv").css("display","");
$("#proTypeSwitchThree").css("display","");
$("#proTypeSwitchThree1").css("display","");
$("#proTypeSwitchThree2").css("display","");
}
let realWorkPlanData = localStorage.getItem('realWorkPlanData');
if(realWorkPlanData != null){
let value = JSON.parse(realWorkPlanData);
currentDayThree = value.companyDate;
subComIdThree = value.companyId;
proIdThree = value.proId;
$("#currentDayThree").val(currentDayThree);
}
$("#currentDayThree").val(currentDayThree);
var tipIndex;
var html = "";
html += "红灯率(%)(人员超3天红灯情况)
";
html += " 在场人员红灯率(%):在场超3天红灯人员/在场人员数
";
html += " 在场特殊工种红灯率(%):在场超3天红灯人员/特殊工种人数
";
html += "
"
html += "作业计划人员与实名制打卡人员偏差情况
";
html += " 偏差人数:在场人员数-日计划上报人数
";
html += " 偏差率(%):偏差人数/在场人员数
";
html += "
"
html += "打卡率
";
html += " 在场人员打卡率(%):今日考勤打卡人数-在场人员数
";
html += " 日计划人员打卡率(%):日计划上报打卡人数/日计划上报人数
";
$("#tip").hover(function() {
tipIndex = layer.tips(html, this, {
tips: 4,
area: ['480px', 'auto']
});
}, function() {
layer.close(tipIndex)
});
$("#dataTypeThree").val("1")
init(); //1在建 2 遗留
$("#searchThreeBt").click(function () {
example.ajax.reload();
});
$("#resetThreeBt").click(function () {
localStorage.removeItem("proIdThree");
proIdThree = "";
$("#keyWordThree").val('');
getCompanyAndSubCompanyById("",$('#orgIdThree'),"3");
$("#currentDayThree").val(getNowTime());
example.ajax.reload();
});
$(".switch").click(function () {
$(".switch").removeClass('switch-css');
$(this).addClass('switch-css');
var proType = $(this).text();
if(proType == "在建项目情况"){
$("#dataTypeThree").val("1")
}else{
$("#dataTypeThree").val("2")
}
example.ajax.reload();
});
});
})
function init() {
example =
$('#dt-table').DataTable({
"scrollX": "300px",//表格高度,可实现Y轴滚动
"sort": false,
"searching": false,
"processing": true, //加载数据时显示进度状态
"serverSide": true,
"pagingType": "full_numbers", //首页|尾页
"ajax": {
"url": ctxPath + "planAndRealName/getSsfbListByCacheList",
"type": "get",
"data": function (d) {
d.dataType = $("#dataTypeThree").val();
d.orgId = subComIdThree;
var time = "";
if($("#currentDayThree").val() == ""){
time = getNowTime()
}else{
time = $("#currentDayThree").val();
}
d.currentDay = time;
d.keyWord = $("#keyWordThree").val();
d.proId = proIdThree;
},
"error": function (xhr, textStatus, errorThrown) {
var msg = xhr.responseText;
console.log(msg);
var response = JSON.parse(msg);
var code = response.code;
var message = response.message;
if (code == 400) {
layer.msg(message);
} else if (code == 401) {
localStorage.removeItem("token");
layer.msg("token过期,请先登录", {shift: -1, time: 1000}, function () {
location.href = ctxPath + '/login.html';
});
} else if (code == 403) {
console.log("未授权:" + message);
layer.msg('未授权');
} else if (code == 500) {
console.log('系统错误:' + message);
}
}
},
"drawCallback": function() {
// alert( '表格重绘了' );
var thisDataTable = $('#dt-table').DataTable();
$(".pagination").append("