2024-07-31 19:01:05 +08:00
|
|
|
var pers = []
|
2024-08-20 15:59:49 +08:00
|
|
|
var table, form, laydate
|
|
|
|
|
layui.use(['form', 'layer', 'table', 'laydate'], function() {
|
|
|
|
|
table = layui.table;
|
|
|
|
|
form = layui.form;
|
2024-07-31 19:01:05 +08:00
|
|
|
laydate = layui.laydate
|
2024-08-20 15:59:49 +08:00
|
|
|
|
|
|
|
|
|
2024-08-20 10:42:21 +08:00
|
|
|
init()
|
2024-07-31 19:01:05 +08:00
|
|
|
});
|
2024-08-20 15:59:49 +08:00
|
|
|
var yjIds, insMonths;
|
2024-07-31 19:01:05 +08:00
|
|
|
|
2024-08-20 10:42:21 +08:00
|
|
|
// 静态数据
|
|
|
|
|
var tableData = [];
|
2024-07-31 19:01:05 +08:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 初始化数据
|
|
|
|
|
*/
|
2024-08-20 15:59:49 +08:00
|
|
|
function init() {
|
|
|
|
|
// 渲染表格
|
|
|
|
|
table.render({
|
|
|
|
|
elem: '#table',
|
|
|
|
|
// url: "/sys/achievement",
|
|
|
|
|
// page: true,
|
|
|
|
|
skin: 'line', // 表格样式
|
|
|
|
|
cols: [
|
|
|
|
|
[{
|
|
|
|
|
title: '序号',
|
|
|
|
|
field: 'zizeng',
|
|
|
|
|
align: 'center',
|
|
|
|
|
type: 'numbers',
|
|
|
|
|
width: '5%'
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
field: 'proName',
|
|
|
|
|
title: '线路名称',
|
|
|
|
|
align: 'center'
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
field: 'workContent',
|
|
|
|
|
title: '工作内容',
|
|
|
|
|
align: 'center'
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
field: 'stateTime',
|
|
|
|
|
title: '计划开始时间',
|
|
|
|
|
align: 'center'
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
field: 'enTime',
|
|
|
|
|
title: '计划结束时间',
|
|
|
|
|
align: 'center'
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
field: 'dutyUser',
|
|
|
|
|
title: '责任人(护线员)',
|
|
|
|
|
align: 'center'
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
field: 'supervisor',
|
|
|
|
|
title: '督办人(设备主人)',
|
|
|
|
|
align: 'center'
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
field: 'complete',
|
|
|
|
|
title: '完成标准',
|
|
|
|
|
align: 'center'
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
field: 'remarks',
|
|
|
|
|
title: '备注',
|
|
|
|
|
align: 'center'
|
|
|
|
|
},
|
|
|
|
|
]
|
|
|
|
|
],
|
|
|
|
|
data: tableData,
|
|
|
|
|
done: function(res, curr, count, origin) {
|
|
|
|
|
|
|
|
|
|
},
|
|
|
|
|
});
|
|
|
|
|
|
2024-07-31 19:01:05 +08:00
|
|
|
}
|
|
|
|
|
|
2024-08-20 15:59:49 +08:00
|
|
|
function setData(data, yjId, insMonth) {
|
2024-08-20 10:42:21 +08:00
|
|
|
yjIds = yjId;
|
|
|
|
|
insMonths = insMonth;
|
2024-08-20 15:59:49 +08:00
|
|
|
if (data.length > 0) {
|
2024-08-20 10:42:21 +08:00
|
|
|
$('#fgsName').html(data[0].fgsName);
|
|
|
|
|
$('#yjName').html(data[0].yjName);
|
|
|
|
|
$('#insMonth').html(data[0].insMonth);
|
2024-08-20 15:59:49 +08:00
|
|
|
|
2024-08-20 10:42:21 +08:00
|
|
|
setAiDitStatus(data[0].aiDitStatus);
|
2024-08-20 15:59:49 +08:00
|
|
|
|
|
|
|
|
$('#createUser').html(data[0].createUser);
|
|
|
|
|
$('#createTime').html(data[0].createTime);
|
|
|
|
|
|
2024-08-20 10:42:21 +08:00
|
|
|
//分公司
|
2024-08-20 15:59:49 +08:00
|
|
|
if (data[0].aiDitStatuses) {
|
|
|
|
|
$('#aiDitStatuses').html(data[0].aiDitStatuses);
|
|
|
|
|
$('#auditUserName').html(data[0].auditUserName);
|
|
|
|
|
$('#auditTime').html(data[0].auditTime);
|
|
|
|
|
} else {
|
2024-08-20 10:42:21 +08:00
|
|
|
$('#aiDitStatuses').html("");
|
2024-08-20 15:59:49 +08:00
|
|
|
$('#auditUserName').html("");
|
|
|
|
|
$('#auditTime').html("");
|
2024-08-20 10:42:21 +08:00
|
|
|
}
|
2024-08-20 15:59:49 +08:00
|
|
|
|
2024-08-20 10:42:21 +08:00
|
|
|
//总公司
|
2024-08-20 15:59:49 +08:00
|
|
|
if (data[0].aiDitStatusTotal) {
|
2024-08-20 10:42:21 +08:00
|
|
|
$('#aiDitStatusTotal').html(data[0].aiDitStatusTotal);
|
2024-08-20 15:59:49 +08:00
|
|
|
$('#auditUserNameTotal').html(data[0].auditUserNameTotal);
|
|
|
|
|
$('#auditTimeTotal').html(data[0].auditTimeTotal);
|
|
|
|
|
} else {
|
2024-08-20 10:42:21 +08:00
|
|
|
$('#aiDitStatusTotal').html("");
|
2024-08-20 15:59:49 +08:00
|
|
|
$('#auditUserNameTotal').html("");
|
|
|
|
|
$('#auditTimeTotal').html("");
|
2024-08-20 10:42:21 +08:00
|
|
|
}
|
2024-08-20 15:59:49 +08:00
|
|
|
|
2024-08-20 10:42:21 +08:00
|
|
|
for (var i = 0; i < data.length; i++) {
|
|
|
|
|
tableData.push({
|
|
|
|
|
id: data[i].id,
|
|
|
|
|
proName: data[i].proName,
|
2024-08-20 15:59:49 +08:00
|
|
|
yjId: data[i].yjId,
|
|
|
|
|
insMonth: data[i].insMonth,
|
|
|
|
|
|
|
|
|
|
workContent: data[i].workContent,
|
|
|
|
|
stateTime: data[i].stateTime,
|
|
|
|
|
enTime: data[i].enTime,
|
|
|
|
|
dutyUser: data[i].dutyUser,
|
|
|
|
|
supervisor: data[i].supervisor,
|
|
|
|
|
complete: data[i].complete,
|
|
|
|
|
remarks: data[i].remarks,
|
|
|
|
|
|
2024-08-20 10:42:21 +08:00
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
init();
|
2024-08-20 15:59:49 +08:00
|
|
|
} else {
|
2024-08-20 10:42:21 +08:00
|
|
|
layer.alert("无数据,请联系管理员", {
|
|
|
|
|
icon: 2
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2024-08-20 15:59:49 +08:00
|
|
|
function setAiDitStatus(status) {
|
2024-08-20 10:42:21 +08:00
|
|
|
$("#subComName").empty();
|
|
|
|
|
var text;
|
|
|
|
|
var color;
|
|
|
|
|
var html = "";
|
2024-08-20 15:59:49 +08:00
|
|
|
if (status == '2') {
|
2024-08-20 10:42:21 +08:00
|
|
|
text = '已通过';
|
|
|
|
|
color = '#19BE6B';
|
|
|
|
|
}
|
2024-08-20 15:59:49 +08:00
|
|
|
if (status == '0') {
|
2024-08-20 10:42:21 +08:00
|
|
|
text = '待审核';
|
|
|
|
|
color = '#FF9900';
|
|
|
|
|
}
|
2024-08-20 15:59:49 +08:00
|
|
|
if (status == '3') {
|
2024-08-20 10:42:21 +08:00
|
|
|
text = '未通过';
|
|
|
|
|
color = '#F56C6C';
|
|
|
|
|
}
|
2024-08-20 15:59:49 +08:00
|
|
|
if (status == '1') {
|
2024-08-20 10:42:21 +08:00
|
|
|
text = '已撤销';
|
|
|
|
|
color = '#999999';
|
|
|
|
|
}
|
|
|
|
|
html += "<span style='display: flex;align-items: center'>"
|
|
|
|
|
html += `<span style='width: 5px;height: 5px;background: ${color};border-radius: 50%'></span> `
|
|
|
|
|
html += `<span>${text}</span>`
|
|
|
|
|
html += "</span>"
|
2024-08-20 15:59:49 +08:00
|
|
|
|
2024-08-20 10:42:21 +08:00
|
|
|
$("#subComName").append(html);
|
|
|
|
|
}
|
|
|
|
|
|
2024-07-31 19:01:05 +08:00
|
|
|
|
|
|
|
|
//导出
|
2024-08-20 15:59:49 +08:00
|
|
|
function exportData() {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
window.location.href = PATH_URL + `/inspectionPlan/exportMonthPlanData?token=` + token +
|
|
|
|
|
"&insMonth=" + insMonths +
|
|
|
|
|
"&yjId=" + yjIds
|
|
|
|
|
|
|
|
|
|
|
2024-08-20 10:42:21 +08:00
|
|
|
layer.msg('下载中,请稍等', {
|
|
|
|
|
icon: 16,
|
|
|
|
|
scrollbar: false
|
|
|
|
|
});
|
2024-07-31 19:01:05 +08:00
|
|
|
}
|