2024-08-02 16:34:45 +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-08-02 16:34:45 +08:00
|
|
|
laydate = layui.laydate
|
|
|
|
|
|
|
|
|
|
//初始化日期选择框
|
|
|
|
|
laydate.render({
|
2024-08-20 15:59:49 +08:00
|
|
|
elem: '#insMonth',
|
|
|
|
|
type: 'month',
|
|
|
|
|
btns: ['now', 'confirm']
|
2024-08-02 16:34:45 +08:00
|
|
|
});
|
2024-08-20 15:59:49 +08:00
|
|
|
|
|
|
|
|
init();
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
//查询
|
|
|
|
|
function queryClick() {
|
|
|
|
|
let fgsName = $('#fgsName').val();
|
|
|
|
|
let yjName = $('#yjName').val();
|
|
|
|
|
let insMonth = $('#insMonth').val();
|
|
|
|
|
let aiDitStatus = $('#aiDitStatus').val();
|
2024-08-21 20:27:19 +08:00
|
|
|
var subComId = $(window.parent.document).find("select[id='subComId']").val();
|
2024-08-20 15:59:49 +08:00
|
|
|
table.reload('layui_table', {
|
|
|
|
|
where: {
|
2024-08-21 20:27:19 +08:00
|
|
|
fgsId: subComId,
|
2024-08-20 15:59:49 +08:00
|
|
|
fgsName: fgsName,
|
|
|
|
|
yjName: yjName,
|
|
|
|
|
insMonth: insMonth,
|
|
|
|
|
aiDitStatus: aiDitStatus,
|
2024-08-02 16:34:45 +08:00
|
|
|
}
|
|
|
|
|
})
|
2024-08-20 15:59:49 +08:00
|
|
|
}
|
|
|
|
|
//重置
|
|
|
|
|
function resetClick() {
|
|
|
|
|
$('#fgsName').val('');
|
|
|
|
|
$('#yjName').val('');
|
|
|
|
|
$('#insMonth').val('');
|
|
|
|
|
$('#aiDitStatus').val('0');
|
2024-08-21 20:27:19 +08:00
|
|
|
var subComId = $(window.parent.document).find("select[id='subComId']").val();
|
2024-08-20 15:59:49 +08:00
|
|
|
form.render();
|
|
|
|
|
table.reload('layui_table', {
|
|
|
|
|
where: {
|
2024-08-21 20:27:19 +08:00
|
|
|
fgsId: subComId,
|
2024-08-20 15:59:49 +08:00
|
|
|
fgsName: "",
|
|
|
|
|
yjName: "",
|
|
|
|
|
insMonth: "",
|
2024-08-22 15:05:15 +08:00
|
|
|
aiDitStatus: "0",
|
2024-08-20 15:59:49 +08:00
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
}
|
2024-08-02 16:34:45 +08:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 初始化数据
|
|
|
|
|
*/
|
2024-08-20 15:59:49 +08:00
|
|
|
function init() {
|
|
|
|
|
let aiDitStatus = $('#aiDitStatus').val();
|
2024-08-21 20:27:19 +08:00
|
|
|
var subComId = $(window.parent.document).find("select[id='subComId']").val();
|
2024-08-20 15:59:49 +08:00
|
|
|
// 渲染表格
|
|
|
|
|
table.render({
|
|
|
|
|
id: 'layui_table',
|
|
|
|
|
elem: '#table',
|
|
|
|
|
url: PATH_URL + '/inspectionPlan/getLineProjectListAuditPage',
|
|
|
|
|
where: {
|
2024-08-21 20:27:19 +08:00
|
|
|
fgsId: subComId,
|
2024-08-20 15:59:49 +08:00
|
|
|
aiDitStatus: aiDitStatus
|
2024-08-02 16:34:45 +08:00
|
|
|
},
|
2024-08-20 15:59:49 +08:00
|
|
|
page: true,
|
|
|
|
|
method: 'post',
|
|
|
|
|
skin: 'line', // 表格样式
|
|
|
|
|
cols: [
|
|
|
|
|
[{
|
|
|
|
|
title: '序号',
|
|
|
|
|
field: 'zizeng',
|
|
|
|
|
align: 'center',
|
|
|
|
|
type: 'numbers',
|
|
|
|
|
width: '5%'
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
field: 'fgsName',
|
|
|
|
|
title: '分公司',
|
|
|
|
|
align: 'center',
|
|
|
|
|
width: '15%'
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
field: 'yjName',
|
|
|
|
|
title: '运检站',
|
|
|
|
|
align: 'center',
|
|
|
|
|
width: '15%'
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
field: 'insMonth',
|
|
|
|
|
title: '月份',
|
|
|
|
|
align: 'center',
|
|
|
|
|
width: '6%'
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
field: 'proPlanNum',
|
|
|
|
|
title: '工程计划数量',
|
|
|
|
|
align: 'center',
|
|
|
|
|
width: '7%'
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
field: 'createUser',
|
|
|
|
|
title: '提交人',
|
|
|
|
|
align: 'center',
|
|
|
|
|
width: '7%'
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
field: 'createTime',
|
|
|
|
|
title: '提交时间',
|
|
|
|
|
align: 'center',
|
|
|
|
|
width: '15%'
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
field: '',
|
|
|
|
|
title: '审核状态',
|
|
|
|
|
align: 'center',
|
|
|
|
|
width: '10%',
|
|
|
|
|
templet: function(d) {
|
|
|
|
|
var status = d.aiDitStatus;
|
|
|
|
|
console.log(status)
|
|
|
|
|
var text;
|
|
|
|
|
var color;
|
|
|
|
|
var html = "";
|
|
|
|
|
if (status == '2') {
|
|
|
|
|
text = '已通过';
|
|
|
|
|
color = '#19BE6B';
|
|
|
|
|
}
|
2024-08-21 20:27:19 +08:00
|
|
|
if (status == '0' || status == '4') {
|
2024-08-20 15:59:49 +08:00
|
|
|
text = '待审核';
|
|
|
|
|
color = '#FF9900';
|
|
|
|
|
}
|
|
|
|
|
if (status == '3') {
|
|
|
|
|
text = '未通过';
|
|
|
|
|
color = '#F56C6C';
|
|
|
|
|
}
|
|
|
|
|
if (status == '1') {
|
|
|
|
|
text = '已撤销';
|
|
|
|
|
color = '#999999';
|
|
|
|
|
}
|
|
|
|
|
html +=
|
|
|
|
|
"<span style='display: flex;justify-content: center;align-items: center'>"
|
|
|
|
|
html +=
|
|
|
|
|
`<span style='width: 5px;height: 5px;background: ${color};border-radius: 50%'></span> `
|
|
|
|
|
html += `<span>${text}</span>`
|
|
|
|
|
html += "</span>"
|
|
|
|
|
return html;
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
field: '',
|
|
|
|
|
title: '操作',
|
|
|
|
|
align: 'center',
|
|
|
|
|
width: '20%',
|
|
|
|
|
templet: function(d) {
|
|
|
|
|
var id = d.id;
|
|
|
|
|
var yjId = d.yjId;
|
|
|
|
|
var insMonth = d.insMonth;
|
|
|
|
|
var status = d.aiDitStatus;
|
|
|
|
|
var text;
|
|
|
|
|
var html = "";
|
|
|
|
|
if (status == '2') {
|
|
|
|
|
//已审核
|
|
|
|
|
html +=
|
|
|
|
|
`<button class="layui-btn layui-btn-sm" onclick="detailsView('${yjId}','${insMonth}')">详情</button>`
|
|
|
|
|
html +=
|
|
|
|
|
`<button class="layui-btn layui-btn-sm layui-btn-primary" onclick="exportDataDetails('${yjId}','${insMonth}')">导出</button>`
|
|
|
|
|
}
|
|
|
|
|
if (status == '0') {
|
|
|
|
|
//分公司待审核
|
|
|
|
|
html +=
|
|
|
|
|
`<button class="layui-btn layui-btn-sm" onclick="detailsView('${yjId}','${insMonth}')">详情</button>`
|
|
|
|
|
html +=
|
|
|
|
|
`<button type="button" class="layui-btn layui-btn-sm layui-bg-orange" onclick="auditView('${yjId}','${insMonth}','${id}')">审批</button>`
|
|
|
|
|
html +=
|
|
|
|
|
`<button class="layui-btn layui-btn-sm layui-btn-primary" onclick="exportDataDetails('${yjId}','${insMonth}')">导出</button>`
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (status == '4') {
|
|
|
|
|
//总公司待审核
|
|
|
|
|
html +=
|
|
|
|
|
`<button class="layui-btn layui-btn-sm" onclick="detailsView('${yjId}','${insMonth}')">详情</button>`
|
|
|
|
|
html +=
|
2024-08-22 15:05:15 +08:00
|
|
|
`<button type="button" class="layui-btn layui-btn-sm layui-bg-orange" onclick="auditTotalView('${yjId}','${insMonth}','${id}')">审 批</button>`
|
2024-08-20 15:59:49 +08:00
|
|
|
html +=
|
|
|
|
|
`<button class="layui-btn layui-btn-sm layui-btn-primary" onclick="exportDataDetails('${yjId}','${insMonth}')">导出</button>`
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (status == '3') {
|
|
|
|
|
//未通过
|
|
|
|
|
html +=
|
|
|
|
|
`<button class="layui-btn layui-btn-sm" onclick="detailsView('${yjId}','${insMonth}')">详情</button>`
|
|
|
|
|
html +=
|
|
|
|
|
`<button class="layui-btn layui-btn-sm layui-btn-primary" onclick="exportDataDetails('${yjId}','${insMonth}')">导出</button>`
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return html;
|
|
|
|
|
},
|
|
|
|
|
}
|
|
|
|
|
]
|
|
|
|
|
],
|
|
|
|
|
});
|
|
|
|
|
|
2024-08-02 16:34:45 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//详情
|
2024-08-20 15:59:49 +08:00
|
|
|
function detailsView(yjId, insMonth) {
|
2024-08-02 16:34:45 +08:00
|
|
|
let height = '98%';
|
2024-08-20 15:59:49 +08:00
|
|
|
let width = '95%';
|
|
|
|
|
$.ajax({
|
|
|
|
|
type: 'POST',
|
|
|
|
|
url: PATH_URL + '/inspectionPlan/getDetails',
|
|
|
|
|
contentType: "application/json; charset=utf-8",
|
|
|
|
|
data: JSON.stringify({
|
|
|
|
|
"yjId": yjId,
|
|
|
|
|
"insMonth": insMonth
|
|
|
|
|
}),
|
|
|
|
|
success: function(data) {
|
|
|
|
|
console.log("data:", data)
|
|
|
|
|
var index = layer.open({
|
|
|
|
|
title: ['月计划详情'],
|
|
|
|
|
type: 2,
|
|
|
|
|
content: './monthPlanDetails.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, yjId, insMonth); //aaa()为子页面的方法
|
|
|
|
|
|
|
|
|
|
},
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
})
|
2024-08-02 16:34:45 +08:00
|
|
|
}
|
|
|
|
|
//审批
|
2024-08-20 15:59:49 +08:00
|
|
|
function auditView(yjId, insMonth,id) {
|
2024-08-02 16:34:45 +08:00
|
|
|
let height = '98%';
|
2024-08-20 15:59:49 +08:00
|
|
|
let width = '95%';
|
|
|
|
|
$.ajax({
|
|
|
|
|
type: 'POST',
|
|
|
|
|
url: PATH_URL + '/inspectionPlan/getDetails',
|
|
|
|
|
contentType: "application/json; charset=utf-8",
|
|
|
|
|
data: JSON.stringify({
|
|
|
|
|
"yjId": yjId,
|
|
|
|
|
"insMonth": insMonth
|
|
|
|
|
}),
|
|
|
|
|
success: function(data) {
|
|
|
|
|
var index = layer.open({
|
|
|
|
|
title: ['月计划审核'],
|
|
|
|
|
type: 2,
|
|
|
|
|
content: './monthPlanAudit.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, yjId, insMonth,id); //aaa()为子页面的方法
|
2024-08-02 16:34:45 +08:00
|
|
|
|
2024-08-20 15:59:49 +08:00
|
|
|
},
|
2024-08-22 15:05:15 +08:00
|
|
|
end:function(){
|
|
|
|
|
debugger;
|
|
|
|
|
$('#fgsName').val('');
|
|
|
|
|
$('#yjName').val('');
|
|
|
|
|
$('#insMonth').val('');
|
|
|
|
|
$('#aiDitStatus').val('0');
|
|
|
|
|
var subComId = $(window.parent.document).find("select[id='subComId']").val();
|
|
|
|
|
form.render();
|
|
|
|
|
table.reload('layui_table', {
|
|
|
|
|
where: {
|
|
|
|
|
fgsId: subComId,
|
|
|
|
|
fgsName: "",
|
|
|
|
|
yjName: "",
|
|
|
|
|
insMonth: "",
|
|
|
|
|
aiDitStatus: "0",
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
}
|
2024-08-20 15:59:49 +08:00
|
|
|
});
|
2024-08-22 15:05:15 +08:00
|
|
|
},
|
|
|
|
|
|
2024-08-20 15:59:49 +08:00
|
|
|
})
|
2024-08-02 16:34:45 +08:00
|
|
|
}
|
2024-08-20 15:59:49 +08:00
|
|
|
|
|
|
|
|
//总公司审批
|
|
|
|
|
function auditTotalView(yjId, insMonth,id) {
|
|
|
|
|
let height = '98%';
|
|
|
|
|
let width = '95%';
|
|
|
|
|
$.ajax({
|
|
|
|
|
type: 'POST',
|
|
|
|
|
url: PATH_URL + '/inspectionPlan/getDetails',
|
|
|
|
|
contentType: "application/json; charset=utf-8",
|
|
|
|
|
data: JSON.stringify({
|
|
|
|
|
"yjId": yjId,
|
|
|
|
|
"insMonth": insMonth
|
|
|
|
|
}),
|
|
|
|
|
success: function(data) {
|
|
|
|
|
var index = layer.open({
|
|
|
|
|
title: ['月计划审核'],
|
|
|
|
|
type: 2,
|
|
|
|
|
content: './monthPlanAuditTotal.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, yjId, insMonth,id); //aaa()为子页面的方法
|
|
|
|
|
|
|
|
|
|
},
|
2024-08-22 15:05:15 +08:00
|
|
|
end:function(){
|
|
|
|
|
$('#fgsName').val('');
|
|
|
|
|
$('#yjName').val('');
|
|
|
|
|
$('#insMonth').val('');
|
|
|
|
|
$('#aiDitStatus').val('0');
|
|
|
|
|
var subComId = $(window.parent.document).find("select[id='subComId']").val();
|
|
|
|
|
form.render();
|
|
|
|
|
table.reload('layui_table', {
|
|
|
|
|
where: {
|
|
|
|
|
fgsId: subComId,
|
|
|
|
|
fgsName: "",
|
|
|
|
|
yjName: "",
|
|
|
|
|
insMonth: "",
|
|
|
|
|
aiDitStatus: "0",
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
}
|
2024-08-20 15:59:49 +08:00
|
|
|
});
|
2024-08-22 15:05:15 +08:00
|
|
|
},
|
|
|
|
|
|
2024-08-02 16:34:45 +08:00
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
|
2024-08-20 15:59:49 +08:00
|
|
|
//导出
|
|
|
|
|
function exportData() {
|
|
|
|
|
|
|
|
|
|
let fgsName = $('#fgsName').val();
|
|
|
|
|
let yjName = $('#yjName').val();
|
|
|
|
|
let insMonth = $('#insMonth').val();
|
|
|
|
|
let aiDitStatus = $('#aiDitStatus').val();
|
2024-08-21 20:27:19 +08:00
|
|
|
var subComId = $(window.parent.document).find("select[id='subComId']").val();
|
|
|
|
|
let fgsId = subComId
|
2024-08-20 15:59:49 +08:00
|
|
|
|
|
|
|
|
window.location.href = PATH_URL + `/inspectionPlan/exportAuditPlanData?token=` + token +
|
|
|
|
|
"&fgsName=" + fgsName +
|
|
|
|
|
"&yjName=" + yjName +
|
|
|
|
|
"&insMonth=" + insMonth +
|
|
|
|
|
"&aiDitStatus=" + aiDitStatus + "&fgsId=" + fgsId
|
|
|
|
|
|
|
|
|
|
layer.msg('下载中,请稍等', {
|
|
|
|
|
icon: 16,
|
|
|
|
|
scrollbar: false
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
2024-08-02 16:34:45 +08:00
|
|
|
|
|
|
|
|
//导出
|
2024-08-20 15:59:49 +08:00
|
|
|
function exportDataDetails(yjId, insMonth) {
|
|
|
|
|
window.location.href = PATH_URL + `/inspectionPlan/exportMonthPlanData?token=` + token +
|
|
|
|
|
"&insMonth=" + insMonth +
|
|
|
|
|
"&yjId=" + yjId
|
|
|
|
|
layer.msg('下载中,请稍等', {
|
|
|
|
|
icon: 16,
|
|
|
|
|
scrollbar: false
|
|
|
|
|
});
|
2024-08-02 16:34:45 +08:00
|
|
|
}
|