2024-07-26 18:15:22 +08:00
|
|
|
|
var currentDate = new Date();
|
|
|
|
|
|
// 获取当前月份的第一天
|
|
|
|
|
|
var firstDay = new Date(currentDate.getFullYear(), currentDate.getMonth(), 1);
|
|
|
|
|
|
// 获取下一个月的第一天
|
|
|
|
|
|
var nextMonthFirstDay = new Date(currentDate.getFullYear(), currentDate.getMonth() + 1, 1);
|
|
|
|
|
|
// 获取当前月份的天数 //本月多少天
|
|
|
|
|
|
var daysInMonth = Math.floor((nextMonthFirstDay.getTime() - firstDay.getTime()) / (24 * 60 * 60 * 1000));
|
|
|
|
|
|
// console.log(daysInMonth);
|
|
|
|
|
|
var pers = []
|
|
|
|
|
|
var table,form,laydate,element;
|
|
|
|
|
|
var tabIndex = 0;
|
2024-08-16 09:20:11 +08:00
|
|
|
|
var tableType = 'layui_table1';
|
|
|
|
|
|
var times = getCurrentDateTimeArr();
|
2024-07-26 18:15:22 +08:00
|
|
|
|
layui.use(['form','layer','table','laydate','element'], function () {
|
|
|
|
|
|
table = layui.table;
|
|
|
|
|
|
form = layui.form;
|
|
|
|
|
|
laydate = layui.laydate;
|
|
|
|
|
|
element = layui.element;
|
|
|
|
|
|
|
|
|
|
|
|
// 渲染时间选择器
|
|
|
|
|
|
laydate.render({
|
2024-08-16 09:20:11 +08:00
|
|
|
|
elem: '#makeMonth',
|
2024-07-26 18:15:22 +08:00
|
|
|
|
type: 'month',
|
|
|
|
|
|
format: 'yyyy-MM',
|
|
|
|
|
|
fullPanel: true,
|
2024-08-16 09:20:11 +08:00
|
|
|
|
value: times[0] + "-" + times[1]
|
2024-07-26 18:15:22 +08:00
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
//监听Tab切换,以改变地址hash值
|
|
|
|
|
|
element.on('tab(chosenTab)', function(data){
|
|
|
|
|
|
// console.log(data)
|
|
|
|
|
|
tabIndex = data.index;
|
|
|
|
|
|
//切换重置
|
|
|
|
|
|
// $('#search1').val('');
|
|
|
|
|
|
// $('#search2').val('');
|
|
|
|
|
|
// $('#search3').val('');
|
|
|
|
|
|
// $('#month').val('');
|
|
|
|
|
|
if(tabIndex==0){
|
2024-08-16 09:20:11 +08:00
|
|
|
|
tableType = 'layui_table1';
|
2024-07-26 18:15:22 +08:00
|
|
|
|
initTable1();
|
|
|
|
|
|
}else if(tabIndex==1){
|
2024-08-16 09:20:11 +08:00
|
|
|
|
tableType = 'layui_table2';
|
2024-07-26 18:15:22 +08:00
|
|
|
|
initTable2();
|
|
|
|
|
|
}else if(tabIndex==2){
|
2024-08-16 09:20:11 +08:00
|
|
|
|
tableType = 'layui_table3';
|
2024-07-26 18:15:22 +08:00
|
|
|
|
initTable3();
|
|
|
|
|
|
}else{
|
2024-08-16 09:20:11 +08:00
|
|
|
|
tableType = 'layui_table1';
|
2024-07-26 18:15:22 +08:00
|
|
|
|
initTable1();
|
|
|
|
|
|
}
|
|
|
|
|
|
});
|
|
|
|
|
|
|
2024-08-16 09:20:11 +08:00
|
|
|
|
table.on(`tool(${tableType})`, function (obj) {
|
2024-07-26 18:15:22 +08:00
|
|
|
|
switch (obj.event) {
|
|
|
|
|
|
case 'detail':
|
|
|
|
|
|
console.log('详情',obj)
|
2024-08-16 09:20:11 +08:00
|
|
|
|
checkView(obj)
|
2024-07-26 18:15:22 +08:00
|
|
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
}
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
initTable1();
|
|
|
|
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
2024-08-16 09:20:11 +08:00
|
|
|
|
|
|
|
|
|
|
//查询
|
|
|
|
|
|
function queryClick(){
|
|
|
|
|
|
let userName = $('#userName').val();
|
|
|
|
|
|
let proName = $('#proName').val();
|
|
|
|
|
|
let yjName = $('#yjName').val();
|
|
|
|
|
|
let startMakeMonth = $('#makeMonth').val();
|
|
|
|
|
|
let endMakeMonth = $('#makeMonth').val();
|
|
|
|
|
|
table.reload(tableType, {
|
|
|
|
|
|
where: {
|
|
|
|
|
|
userName: userName,
|
|
|
|
|
|
proName: proName,
|
|
|
|
|
|
yjName: yjName,
|
|
|
|
|
|
startMakeMonth: startMakeMonth,
|
|
|
|
|
|
endMakeMonth: endMakeMonth
|
|
|
|
|
|
}
|
|
|
|
|
|
})
|
2024-07-26 18:15:22 +08:00
|
|
|
|
}
|
2024-08-16 09:20:11 +08:00
|
|
|
|
//重置
|
|
|
|
|
|
function resetClick(){
|
|
|
|
|
|
$('#userName').val("");
|
|
|
|
|
|
$('#proName').val("");
|
|
|
|
|
|
$('#yjName').val("");
|
|
|
|
|
|
$('#makeMonth').val("");
|
|
|
|
|
|
table.reload(tableType, {
|
|
|
|
|
|
where: {
|
|
|
|
|
|
userName: "",
|
|
|
|
|
|
proName: "",
|
|
|
|
|
|
yjName: "",
|
|
|
|
|
|
startMakeMonth: '',
|
|
|
|
|
|
endMakeMonth: "",
|
|
|
|
|
|
}
|
|
|
|
|
|
})
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-07-26 18:15:22 +08:00
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
* 初始化数据 全部
|
|
|
|
|
|
*/
|
|
|
|
|
|
function initTable1(){
|
|
|
|
|
|
console.log('全部')
|
|
|
|
|
|
table.render({
|
2024-08-16 09:20:11 +08:00
|
|
|
|
id: 'layui_table1',
|
|
|
|
|
|
elem: '#table',
|
|
|
|
|
|
url: PATH_URL + '/attendance/getAllInspectionList',
|
|
|
|
|
|
where: {
|
|
|
|
|
|
startMakeMonth: $('#makeMonth').val(),
|
|
|
|
|
|
endMakeMonth: $('#makeMonth').val()
|
|
|
|
|
|
},
|
|
|
|
|
|
page: true, //开启分页
|
|
|
|
|
|
method:'post',
|
|
|
|
|
|
skin: 'line', // 表格样式
|
|
|
|
|
|
cols: [[
|
|
|
|
|
|
// {
|
|
|
|
|
|
// type: 'checkbox'
|
|
|
|
|
|
// },
|
|
|
|
|
|
{
|
|
|
|
|
|
title: '序号',
|
|
|
|
|
|
field: 'zizeng',
|
|
|
|
|
|
align: 'center',
|
|
|
|
|
|
type: 'numbers'
|
|
|
|
|
|
},
|
|
|
|
|
|
{field:'userName', title: '姓名',align: 'center',},
|
|
|
|
|
|
{field:'idNumber', title: '身份证号',align: 'center',},
|
|
|
|
|
|
{field:'tel', title: '联系电话',align: 'center',},
|
|
|
|
|
|
{field:'makeMonth', title: '月份',align: 'center',},
|
|
|
|
|
|
|
|
|
|
|
|
{field:'allMake', title: '正常巡视(基*次)',align: 'center',},
|
|
|
|
|
|
{field:'special', title: '特巡(天*人)',align: 'center',width:170},
|
|
|
|
|
|
{field:'proName', title: '管辖线路名称',align: 'center',width:170},
|
|
|
|
|
|
{field:'yjName', title: '所属运检站',align: 'center', },
|
|
|
|
|
|
{
|
|
|
|
|
|
title: '操作',
|
|
|
|
|
|
toolbar: '#opeator-bar',
|
|
|
|
|
|
align: 'center',
|
|
|
|
|
|
width: 200
|
|
|
|
|
|
}
|
|
|
|
|
|
]],
|
|
|
|
|
|
done: function(res,curr,count){
|
|
|
|
|
|
//checkPermission();
|
|
|
|
|
|
}
|
2024-07-26 18:15:22 +08:00
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
* 初始化数据 正常巡视统计
|
|
|
|
|
|
*/
|
|
|
|
|
|
function initTable2(){
|
|
|
|
|
|
console.log('正常巡视统计')
|
|
|
|
|
|
// 渲染表格
|
|
|
|
|
|
table.render({
|
2024-08-16 09:20:11 +08:00
|
|
|
|
id: 'layui_table2',
|
|
|
|
|
|
elem: '#table',
|
|
|
|
|
|
url: PATH_URL + '/lineProject/getLineProjectList',
|
|
|
|
|
|
where: {
|
|
|
|
|
|
},
|
|
|
|
|
|
page: true, //开启分页
|
|
|
|
|
|
method:'post',
|
|
|
|
|
|
skin: 'line', // 表格样式
|
|
|
|
|
|
cols: [[
|
|
|
|
|
|
// {
|
|
|
|
|
|
// type: 'checkbox'
|
|
|
|
|
|
// },
|
|
|
|
|
|
{
|
|
|
|
|
|
title: '序号',
|
|
|
|
|
|
field: 'zizeng',
|
|
|
|
|
|
align: 'center',
|
|
|
|
|
|
type: 'numbers'
|
|
|
|
|
|
},
|
|
|
|
|
|
{field:'fgsName', title: '分公司',align: 'center',},
|
|
|
|
|
|
{field:'yjName', title: '运检站',align: 'center',},
|
|
|
|
|
|
{field:'proName', title: '线路工程名称',align: 'center',},
|
|
|
|
|
|
{field:'volLevel', title: '电压等级',align: 'center',},
|
|
|
|
|
|
{
|
|
|
|
|
|
title: '单/双回路',
|
|
|
|
|
|
field: '',
|
|
|
|
|
|
align: 'center',
|
|
|
|
|
|
templet: function(d){
|
|
|
|
|
|
let isTwo = d.isTwo;
|
|
|
|
|
|
let html;
|
|
|
|
|
|
if(isTwo == '0' || isTwo == 0){
|
|
|
|
|
|
html = '<span>单回路</span>'
|
|
|
|
|
|
}else{
|
|
|
|
|
|
html = '<span>双回路</span>'
|
|
|
|
|
|
}
|
|
|
|
|
|
// 返回模板内容
|
|
|
|
|
|
return html;
|
|
|
|
|
|
}
|
|
|
|
|
|
},
|
|
|
|
|
|
{field:'powerNum', title: '杆塔数量',align: 'center',},
|
|
|
|
|
|
{field:'lineNum', title: '群众护线员数量',align: 'center',width:170},
|
|
|
|
|
|
{field:'inLinePowerNum', title: '已绑定护线员杆塔数量',align: 'center',width:170},
|
|
|
|
|
|
{field:'unLinePowerNum', title: '未绑定护线员杆塔数量',align: 'center', },
|
|
|
|
|
|
{
|
|
|
|
|
|
title: '操作',
|
|
|
|
|
|
toolbar: '#opeator-bar',
|
|
|
|
|
|
align: 'center',
|
|
|
|
|
|
width: 200
|
|
|
|
|
|
}
|
|
|
|
|
|
]],
|
|
|
|
|
|
done: function(res,curr,count){
|
|
|
|
|
|
//checkPermission();
|
|
|
|
|
|
}
|
2024-07-26 18:15:22 +08:00
|
|
|
|
});
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
* 初始化数据 特巡统计
|
|
|
|
|
|
*/
|
|
|
|
|
|
function initTable3(){
|
|
|
|
|
|
console.log('特巡统计')
|
|
|
|
|
|
table.render({
|
2024-08-16 09:20:11 +08:00
|
|
|
|
id: 'layui_table3',
|
|
|
|
|
|
elem: '#table',
|
|
|
|
|
|
url: PATH_URL + '/lineProject/getLineProjectList',
|
|
|
|
|
|
where: {
|
|
|
|
|
|
},
|
|
|
|
|
|
page: true, //开启分页
|
|
|
|
|
|
method:'post',
|
|
|
|
|
|
skin: 'line', // 表格样式
|
|
|
|
|
|
cols: [[
|
|
|
|
|
|
// {
|
|
|
|
|
|
// type: 'checkbox'
|
|
|
|
|
|
// },
|
|
|
|
|
|
{
|
|
|
|
|
|
title: '序号',
|
|
|
|
|
|
field: 'zizeng',
|
|
|
|
|
|
align: 'center',
|
|
|
|
|
|
type: 'numbers'
|
|
|
|
|
|
},
|
|
|
|
|
|
{field:'fgsName', title: '分公司',align: 'center',},
|
|
|
|
|
|
{field:'yjName', title: '运检站',align: 'center',},
|
|
|
|
|
|
{field:'proName', title: '线路工程名称',align: 'center',},
|
|
|
|
|
|
{field:'volLevel', title: '电压等级',align: 'center',},
|
|
|
|
|
|
{
|
|
|
|
|
|
title: '单/双回路',
|
|
|
|
|
|
field: '',
|
|
|
|
|
|
align: 'center',
|
|
|
|
|
|
templet: function(d){
|
|
|
|
|
|
let isTwo = d.isTwo;
|
|
|
|
|
|
let html;
|
|
|
|
|
|
if(isTwo == '0' || isTwo == 0){
|
|
|
|
|
|
html = '<span>单回路</span>'
|
|
|
|
|
|
}else{
|
|
|
|
|
|
html = '<span>双回路</span>'
|
|
|
|
|
|
}
|
|
|
|
|
|
// 返回模板内容
|
|
|
|
|
|
return html;
|
|
|
|
|
|
}
|
|
|
|
|
|
},
|
|
|
|
|
|
{field:'powerNum', title: '杆塔数量',align: 'center',},
|
|
|
|
|
|
{field:'lineNum', title: '群众护线员数量',align: 'center',width:170},
|
|
|
|
|
|
{field:'inLinePowerNum', title: '已绑定护线员杆塔数量',align: 'center',width:170},
|
|
|
|
|
|
{field:'unLinePowerNum', title: '未绑定护线员杆塔数量',align: 'center', },
|
|
|
|
|
|
{
|
|
|
|
|
|
title: '操作',
|
|
|
|
|
|
toolbar: '#opeator-bar',
|
|
|
|
|
|
align: 'center',
|
|
|
|
|
|
width: 200
|
|
|
|
|
|
}
|
|
|
|
|
|
]],
|
|
|
|
|
|
done: function(res,curr,count){
|
|
|
|
|
|
//checkPermission();
|
|
|
|
|
|
}
|
2024-07-26 18:15:22 +08:00
|
|
|
|
});
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
* 详情
|
|
|
|
|
|
* */
|
2024-08-16 09:20:11 +08:00
|
|
|
|
function checkView(obj) {
|
2024-07-26 18:15:22 +08:00
|
|
|
|
let height = '98%';
|
|
|
|
|
|
let width = '95%';
|
2024-08-16 09:20:11 +08:00
|
|
|
|
$.ajax({
|
|
|
|
|
|
type: 'POST',
|
|
|
|
|
|
url: PATH_URL + '/attendance/getInspectionParticular',
|
|
|
|
|
|
contentType: "application/json; charset=utf-8",
|
|
|
|
|
|
data: JSON.stringify({
|
|
|
|
|
|
makeMonth: $("#makeMonth").val(),
|
|
|
|
|
|
proId: obj.data.proId
|
|
|
|
|
|
}),
|
|
|
|
|
|
success: function (data) {
|
|
|
|
|
|
console.log("dataaaaaa:", data)
|
2024-07-26 18:15:22 +08:00
|
|
|
|
var index = layer.open({
|
|
|
|
|
|
title: ['详情'],
|
|
|
|
|
|
type: 2,
|
|
|
|
|
|
content: 'attendanceDetail.html',
|
|
|
|
|
|
area: [width, height],
|
|
|
|
|
|
maxmin: false,
|
|
|
|
|
|
success: function (layero, index) {
|
|
|
|
|
|
// console.log(data);
|
|
|
|
|
|
var myIframe = window[layero.find('iframe')[0]['name']];
|
2024-08-16 09:20:11 +08:00
|
|
|
|
var times = obj.data.makeMonth.split("-")
|
|
|
|
|
|
myIframe.init(times[0],times[1]);
|
|
|
|
|
|
myIframe.setData(data); //aaa()为子页面的方法
|
2024-07-26 18:15:22 +08:00
|
|
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
});
|
2024-08-16 09:20:11 +08:00
|
|
|
|
}
|
|
|
|
|
|
})
|
2024-07-26 18:15:22 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//导出
|
|
|
|
|
|
function exportData() {
|
|
|
|
|
|
// let search1 = $('#search1').val();
|
|
|
|
|
|
// let search2 = $('#search2').val();
|
|
|
|
|
|
window.location.href = oiPlanUrl + "/monthlyPlanSubmission/export?token=" + token;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|