287 lines
15 KiB
JavaScript
287 lines
15 KiB
JavaScript
|
||
|
||
var pers = []
|
||
var table,form,laydate
|
||
layui.use(['form','layer','table','laydate'], function () {
|
||
table = layui.table;
|
||
form = layui.form;
|
||
laydate = layui.laydate
|
||
|
||
//初始化日期选择框
|
||
laydate.render({
|
||
elem: '#dataTime',
|
||
type: 'month',
|
||
});
|
||
// 触发submit提交 按钮点击或者表单被执行提交时触发
|
||
form.on('submit(query)', function (data) {
|
||
console.log("搜索")
|
||
// 对表格进行重载。id 即 table表格的id
|
||
table.reload('table', {
|
||
// //设定异步数据接口的额外参数
|
||
page:{curr : 1}
|
||
,where: data.field
|
||
})
|
||
return false; // 阻止表单跳转。如果需要表单跳转,去掉这段即可。
|
||
});
|
||
$("#reset").click(function(){
|
||
console.log("重置")
|
||
$('#search1').val('');
|
||
$('#search2').val('');
|
||
$('#search3').val('');
|
||
let obj = {
|
||
search1:'',
|
||
search2:'',
|
||
search3:''
|
||
}
|
||
// 对表格进行重载。id 即 table表格的id
|
||
table.reload('table', {
|
||
// //设定异步数据接口的额外参数
|
||
page:{curr : 1}
|
||
,where: obj
|
||
})
|
||
})
|
||
|
||
table.on('tool(table)', function (obj) {
|
||
switch (obj.event) {
|
||
case 'details':
|
||
console.log('详情',obj)
|
||
detailsView(obj.id)
|
||
break;
|
||
}
|
||
});
|
||
init();
|
||
});
|
||
|
||
// 静态数据
|
||
var tableData = [
|
||
{id: 1, station: '昆明运检一站', month: '2024-03', lineName: '±500kV永富直流线', maintainTotalArea: '#1-#131', userName: '李云飞', dominionLineName: '500kV邑劝甲线', dutyPatrol: '#1,#2,#3,#4,#5,#6,#7,#8,#9,#10,#11,#12,#13,#14,#15,#16', onePatrol: '#1,#2,#3,#4,#5,#6,#7,#8,#9,#10,#11,#12,#13,#14,#15',onePatrolNum: '15', twoPatrol: '#1,#2,#3,#4,#5', twoPatrolNum: '15', specialPatrolDayNum: '2'},
|
||
{id: 1, station: '昆明运检一站', month: '2024-03', lineName: '±500kV永富直流线', maintainTotalArea: '#1-#131', userName: '李云飞', dominionLineName: '500kV邑劝甲线', dutyPatrol: '#1,#2,#3,#4,#5,#6,#7,#8,#9,#10,#11,#12,#13,#14,#15,#16', onePatrol: '#1,#2,#3,#4,#5,#6,#7,#8,#9,#10,#11,#12,#13,#14,#15',onePatrolNum: '15', twoPatrol: '#1,#2,#3,#4,#5', twoPatrolNum: '15', specialPatrolDayNum: '2'},
|
||
{id: 1, station: '昆明运检一站', month: '2024-03', lineName: '±500kV永富直流线', maintainTotalArea: '#1-#131', userName: '李云飞', dominionLineName: '500kV邑劝甲线', dutyPatrol: '#1,#2,#3,#4,#5,#6,#7,#8,#9,#10,#11,#12,#13,#14,#15,#16', onePatrol: '#1,#2,#3,#4,#5,#6,#7,#8,#9,#10,#11,#12,#13,#14,#15',onePatrolNum: '15', twoPatrol: '#1,#2,#3,#4,#5', twoPatrolNum: '15', specialPatrolDayNum: '2'},
|
||
{id: 1, station: '昆明运检一站', month: '2024-03', lineName: '±500kV永富直流线', maintainTotalArea: '#1-#131', userName: '李云飞', dominionLineName: '500kV邑劝甲线', dutyPatrol: '#1,#2,#3,#4,#5,#6,#7,#8,#9,#10,#11,#12,#13,#14,#15,#16', onePatrol: '#1,#2,#3,#4,#5,#6,#7,#8,#9,#10,#11,#12,#13,#14,#15',onePatrolNum: '15', twoPatrol: '#1,#2,#3,#4,#5', twoPatrolNum: '15', specialPatrolDayNum: '2'},
|
||
{id: 1, station: '昆明运检一站', month: '2024-03', lineName: '±500kV永富直流线', maintainTotalArea: '#1-#131', userName: '李云飞', dominionLineName: '500kV邑劝甲线', dutyPatrol: '#1,#2,#3,#4,#5,#6,#7,#8,#9,#10,#11,#12,#13,#14,#15,#16', onePatrol: '#1,#2,#3,#4,#5,#6,#7,#8,#9,#10,#11,#12,#13,#14,#15',onePatrolNum: '15', twoPatrol: '#1,#2,#3,#4,#5', twoPatrolNum: '15', specialPatrolDayNum: '2'},
|
||
{id: 1, station: '昆明运检一站', month: '2024-03', lineName: '±500kV永富直流线', maintainTotalArea: '#1-#131', userName: '李云飞', dominionLineName: '500kV邑劝甲线', dutyPatrol: '#1,#2,#3,#4,#5,#6,#7,#8,#9,#10,#11,#12,#13,#14,#15,#16', onePatrol: '#1,#2,#3,#4,#5,#6,#7,#8,#9,#10,#11,#12,#13,#14,#15',onePatrolNum: '15', twoPatrol: '#1,#2,#3,#4,#5', twoPatrolNum: '15', specialPatrolDayNum: '2'},
|
||
{id: 1, station: '昆明运检一站', month: '2024-03', lineName: '±500kV永富直流线', maintainTotalArea: '#1-#131', userName: '李云飞', dominionLineName: '500kV邑劝甲线', dutyPatrol: '#1,#2,#3,#4,#5,#6,#7,#8,#9,#10,#11,#12,#13,#14,#15,#16', onePatrol: '#1,#2,#3,#4,#5,#6,#7,#8,#9,#10,#11,#12,#13,#14,#15',onePatrolNum: '15', twoPatrol: '#1,#2,#3,#4,#5', twoPatrolNum: '15', specialPatrolDayNum: '2'},
|
||
{id: 1, station: '昆明运检一站', month: '2024-03', lineName: '±500kV永富直流线', maintainTotalArea: '#1-#131', userName: '李云飞', dominionLineName: '500kV邑劝甲线', dutyPatrol: '#1,#2,#3,#4,#5,#6,#7,#8,#9,#10,#11,#12,#13,#14,#15,#16', onePatrol: '#1,#2,#3,#4,#5,#6,#7,#8,#9,#10,#11,#12,#13,#14,#15',onePatrolNum: '15', twoPatrol: '#1,#2,#3,#4,#5', twoPatrolNum: '15', specialPatrolDayNum: '2'},
|
||
{id: 1, station: '昆明运检一站', month: '2024-03', lineName: '±500kV永富直流线', maintainTotalArea: '#1-#131', userName: '李云飞', dominionLineName: '500kV邑劝甲线', dutyPatrol: '#1,#2,#3,#4,#5,#6,#7,#8,#9,#10,#11,#12,#13,#14,#15,#16', onePatrol: '#1,#2,#3,#4,#5,#6,#7,#8,#9,#10,#11,#12,#13,#14,#15',onePatrolNum: '15', twoPatrol: '#1,#2,#3,#4,#5', twoPatrolNum: '15', specialPatrolDayNum: '2'},
|
||
{id: 1, station: '昆明运检一站', month: '2024-03', lineName: '±500kV永富直流线', maintainTotalArea: '#1-#131', userName: '李云飞', dominionLineName: '500kV邑劝甲线', dutyPatrol: '#1,#2,#3,#4,#5,#6,#7,#8,#9,#10,#11,#12,#13,#14,#15,#16', onePatrol: '#1,#2,#3,#4,#5,#6,#7,#8,#9,#10,#11,#12,#13,#14,#15',onePatrolNum: '15', twoPatrol: '#1,#2,#3,#4,#5', twoPatrolNum: '15', specialPatrolDayNum: '2'},
|
||
{id: 1, station: '昆明运检一站', month: '2024-03', lineName: '±500kV永富直流线', maintainTotalArea: '#1-#131', userName: '李云飞', dominionLineName: '500kV邑劝甲线', dutyPatrol: '#1,#2,#3,#4,#5,#6,#7,#8,#9,#10,#11,#12,#13,#14,#15,#16', onePatrol: '#1,#2,#3,#4,#5,#6,#7,#8,#9,#10,#11,#12,#13,#14,#15',onePatrolNum: '15', twoPatrol: '#1,#2,#3,#4,#5', twoPatrolNum: '15', specialPatrolDayNum: '2'},
|
||
{id: 1, station: '昆明运检一站', month: '2024-03', lineName: '±500kV永富直流线', maintainTotalArea: '#1-#131', userName: '李云飞', dominionLineName: '500kV邑劝甲线', dutyPatrol: '#1,#2,#3,#4,#5,#6,#7,#8,#9,#10,#11,#12,#13,#14,#15,#16', onePatrol: '#1,#2,#3,#4,#5,#6,#7,#8,#9,#10,#11,#12,#13,#14,#15',onePatrolNum: '15', twoPatrol: '#1,#2,#3,#4,#5', twoPatrolNum: '15', specialPatrolDayNum: '2'},
|
||
{id: 1, station: '昆明运检一站', month: '2024-03', lineName: '±500kV永富直流线', maintainTotalArea: '#1-#131', userName: '李云飞', dominionLineName: '500kV邑劝甲线', dutyPatrol: '#1,#2,#3,#4,#5,#6,#7,#8,#9,#10,#11,#12,#13,#14,#15,#16', onePatrol: '#1,#2,#3,#4,#5,#6,#7,#8,#9,#10,#11,#12,#13,#14,#15',onePatrolNum: '15', twoPatrol: '#1,#2,#3,#4,#5', twoPatrolNum: '15', specialPatrolDayNum: '2'},
|
||
{id: 1, station: '昆明运检一站', month: '2024-03', lineName: '±500kV永富直流线', maintainTotalArea: '#1-#131', userName: '李云飞', dominionLineName: '500kV邑劝甲线', dutyPatrol: '#1,#2,#3,#4,#5,#6,#7,#8,#9,#10,#11,#12,#13,#14,#15,#16', onePatrol: '#1,#2,#3,#4,#5,#6,#7,#8,#9,#10,#11,#12,#13,#14,#15',onePatrolNum: '15', twoPatrol: '#1,#2,#3,#4,#5', twoPatrolNum: '15', specialPatrolDayNum: '2'},
|
||
{id: 1, station: '昆明运检一站', month: '2024-03', lineName: '±500kV永富直流线', maintainTotalArea: '#1-#131', userName: '李云飞', dominionLineName: '500kV邑劝甲线', dutyPatrol: '#1,#2,#3,#4,#5,#6,#7,#8,#9,#10,#11,#12,#13,#14,#15,#16', onePatrol: '#1,#2,#3,#4,#5,#6,#7,#8,#9,#10,#11,#12,#13,#14,#15',onePatrolNum: '15', twoPatrol: '#1,#2,#3,#4,#5', twoPatrolNum: '15', specialPatrolDayNum: '2'},
|
||
{id: 1, station: '昆明运检一站', month: '2024-03', lineName: '±500kV永富直流线', maintainTotalArea: '#1-#131', userName: '李云飞', dominionLineName: '500kV邑劝甲线', dutyPatrol: '#1,#2,#3,#4,#5,#6,#7,#8,#9,#10,#11,#12,#13,#14,#15,#16', onePatrol: '#1,#2,#3,#4,#5,#6,#7,#8,#9,#10,#11,#12,#13,#14,#15',onePatrolNum: '15', twoPatrol: '#1,#2,#3,#4,#5', twoPatrolNum: '15', specialPatrolDayNum: '2'},
|
||
{id: 1, station: '昆明运检一站', month: '2024-03', lineName: '±500kV永富直流线', maintainTotalArea: '#1-#131', userName: '李云飞', dominionLineName: '500kV邑劝甲线', dutyPatrol: '#1,#2,#3,#4,#5,#6,#7,#8,#9,#10,#11,#12,#13,#14,#15,#16', onePatrol: '#1,#2,#3,#4,#5,#6,#7,#8,#9,#10,#11,#12,#13,#14,#15',onePatrolNum: '15', twoPatrol: '#1,#2,#3,#4,#5', twoPatrolNum: '15', specialPatrolDayNum: '2'},
|
||
{id: 1, station: '昆明运检一站', month: '2024-03', lineName: '±500kV永富直流线', maintainTotalArea: '#1-#131', userName: '李云飞', dominionLineName: '500kV邑劝甲线', dutyPatrol: '#1,#2,#3,#4,#5,#6,#7,#8,#9,#10,#11,#12,#13,#14,#15,#16', onePatrol: '#1,#2,#3,#4,#5,#6,#7,#8,#9,#10,#11,#12,#13,#14,#15',onePatrolNum: '15', twoPatrol: '#1,#2,#3,#4,#5', twoPatrolNum: '15', specialPatrolDayNum: '2'},
|
||
{id: 1, station: '昆明运检一站', month: '2024-03', lineName: '±500kV永富直流线', maintainTotalArea: '#1-#131', userName: '李云飞', dominionLineName: '500kV邑劝甲线', dutyPatrol: '#1,#2,#3,#4,#5,#6,#7,#8,#9,#10,#11,#12,#13,#14,#15,#16', onePatrol: '#1,#2,#3,#4,#5,#6,#7,#8,#9,#10,#11,#12,#13,#14,#15',onePatrolNum: '15', twoPatrol: '#1,#2,#3,#4,#5', twoPatrolNum: '15', specialPatrolDayNum: '2'},
|
||
{id: 1, station: '昆明运检一站', month: '2024-03', lineName: '±500kV永富直流线', maintainTotalArea: '#1-#131', userName: '李云飞', dominionLineName: '500kV邑劝甲线', dutyPatrol: '#1,#2,#3,#4,#5,#6,#7,#8,#9,#10,#11,#12,#13,#14,#15,#16', onePatrol: '#1,#2,#3,#4,#5,#6,#7,#8,#9,#10,#11,#12,#13,#14,#15',onePatrolNum: '15', twoPatrol: '#1,#2,#3,#4,#5', twoPatrolNum: '15', specialPatrolDayNum: '2'},
|
||
{id: 1, station: '昆明运检一站', month: '2024-03', lineName: '±500kV永富直流线', maintainTotalArea: '#1-#131', userName: '李云飞', dominionLineName: '500kV邑劝甲线', dutyPatrol: '#1,#2,#3,#4,#5,#6,#7,#8,#9,#10,#11,#12,#13,#14,#15,#16', onePatrol: '#1,#2,#3,#4,#5,#6,#7,#8,#9,#10,#11,#12,#13,#14,#15',onePatrolNum: '15', twoPatrol: '#1,#2,#3,#4,#5', twoPatrolNum: '15', specialPatrolDayNum: '2'},
|
||
|
||
];
|
||
|
||
|
||
var col = [
|
||
[
|
||
{
|
||
title: '序号',
|
||
field: 'zizeng',
|
||
align: 'center',
|
||
type: 'numbers',
|
||
rowspan: 2
|
||
},
|
||
{
|
||
title: '运检站',
|
||
field: 'station',
|
||
align: 'center',
|
||
rowspan: 2
|
||
},
|
||
{
|
||
title: '月份',
|
||
field: 'month',
|
||
align: 'center',
|
||
rowspan: 2
|
||
},
|
||
{
|
||
title: '线路名称',
|
||
field: 'lineName',
|
||
align: 'center',
|
||
rowspan: 2
|
||
},
|
||
{
|
||
title: '运维总区段',
|
||
field: 'maintainTotalArea',
|
||
align: 'center',
|
||
rowspan: 2
|
||
},
|
||
{
|
||
title: '姓名',
|
||
field: 'userName',
|
||
align: 'center',
|
||
rowspan: 2
|
||
},
|
||
{
|
||
title: '管辖线路名称',
|
||
field: 'dominionLineName',
|
||
align: 'center',
|
||
rowspan: 2,
|
||
},
|
||
{
|
||
title: '负责巡护区段',
|
||
align: 'center',
|
||
rowspan: 2,
|
||
templet: function(d){
|
||
var dutyPatrol = d.dutyPatrol
|
||
var html = `<span style="color:#F56C82">16基:</span><span>${dutyPatrol}</span>`;
|
||
return html;
|
||
},
|
||
},
|
||
{
|
||
title: '本月实际提供到位照区段(或塔)及张数',
|
||
colspan: 5,
|
||
align: 'center'
|
||
},
|
||
{
|
||
title: '操作',
|
||
toolbar: '#opeator-bar',
|
||
align: 'center',
|
||
rowspan: 2,
|
||
},
|
||
],
|
||
[
|
||
{
|
||
title: '巡1次区段(基)',
|
||
field: 'onePatrol',
|
||
align: 'center',
|
||
},
|
||
{
|
||
title: '巡1次张数',
|
||
field: 'onePatrolNum',
|
||
align: 'center',
|
||
},
|
||
{
|
||
title: '巡2次区段(基)',
|
||
field: 'twoPatrol',
|
||
align: 'center',
|
||
},
|
||
{
|
||
title: '巡2次张数',
|
||
field: 'twoPatrolNum',
|
||
align: 'center',
|
||
},
|
||
{
|
||
title: '特巡天数',
|
||
field: 'specialPatrolDayNum',
|
||
align: 'center',
|
||
},
|
||
|
||
],
|
||
]
|
||
|
||
/**
|
||
* 初始化数据
|
||
*/
|
||
function init(){
|
||
// 渲染表格
|
||
table.render({
|
||
elem: '#table',
|
||
// url: "/sys/achievement",
|
||
page: true,
|
||
border: true,
|
||
data: tableData,
|
||
cols: col,
|
||
});
|
||
|
||
}
|
||
|
||
|
||
//详情
|
||
function detailsView(id) {
|
||
let height = '98%';
|
||
let width = '99%';
|
||
/* $.ajax({
|
||
type: 'post',
|
||
contentType: "application/x-www-form-urlencoded",
|
||
url: oiPlanUrl + '/monthlyPlanSubmission/getDataById',
|
||
dataType: 'json',
|
||
data: {
|
||
id: id
|
||
},
|
||
success: function (data) {
|
||
var index = layer.open({
|
||
title: ['详情', 'color:#3B70A1;background-color:#E8ECEB;font-size:20px'],
|
||
type: 2,
|
||
content: './wagesReport/producePayrollDetails.html',
|
||
area: [width, height],
|
||
maxmin: false,
|
||
success: function (layero, index) {
|
||
console.log(data);
|
||
var myIframe = window[layero.find('iframe')[0]['name']];
|
||
myIframe.hideSubmit();
|
||
// var fnc = myIframe.setData(data.data); //aaa()为子页面的方法
|
||
|
||
},
|
||
});
|
||
}
|
||
}) */
|
||
|
||
//测试
|
||
var index = layer.open({
|
||
title: ['详情', 'color:#3B70A1;background-color:#E8ECEB;font-size:20px'],
|
||
type: 2,
|
||
content: './viewStatisticsDetails.html',
|
||
area: [width, height],
|
||
maxmin: false,
|
||
success: function (layero, index) {
|
||
// var myIframe = window[layero.find('iframe')[0]['name']];
|
||
// myIframe.hideSubmit();
|
||
// var fnc = myIframe.setData(data.data); //aaa()为子页面的方法
|
||
|
||
},
|
||
});
|
||
}
|
||
|
||
|
||
//修改
|
||
function updateView(id) {
|
||
let height = '98%';
|
||
let width = '99%';
|
||
/* $.ajax({
|
||
type: 'post',
|
||
contentType: "application/x-www-form-urlencoded",
|
||
url: oiPlanUrl + '/monthlyPlanSubmission/getDataById',
|
||
dataType: 'json',
|
||
data: {
|
||
id: id
|
||
},
|
||
success: function (data) {
|
||
var index = layer.open({
|
||
title: ['巡视结果上传', 'color:#3B70A1;background-color:#E8ECEB;font-size:20px'],
|
||
type: 2,
|
||
content: './wagesReport/producePayrollDetails.html',
|
||
area: [width, height],
|
||
maxmin: false,
|
||
success: function (layero, index) {
|
||
console.log(data);
|
||
var myIframe = window[layero.find('iframe')[0]['name']];
|
||
myIframe.hideSubmit();
|
||
// var fnc = myIframe.setData(data.data); //aaa()为子页面的方法
|
||
|
||
},
|
||
});
|
||
}
|
||
}) */
|
||
|
||
//测试
|
||
var index = layer.open({
|
||
title: ['巡视结果上传', 'color:#3B70A1;background-color:#E8ECEB;font-size:20px'],
|
||
type: 2,
|
||
content: './viewResultUpdate.html',
|
||
area: [width, height],
|
||
maxmin: false,
|
||
success: function (layero, index) {
|
||
// var myIframe = window[layero.find('iframe')[0]['name']];
|
||
// myIframe.hideSubmit();
|
||
// var fnc = myIframe.setData(data.data); //aaa()为子页面的方法
|
||
|
||
},
|
||
});
|
||
} |