1161 lines
43 KiB
Plaintext
1161 lines
43 KiB
Plaintext
|
|
let form, layer, table, tableIns, laydate, formSelects;
|
|||
|
|
// 选中的工程的状态、年份、地市、页面类型
|
|||
|
|
let checkProStatus = '', checkYear = '', checkOrg = '', checkProNo = '', pageType = '1', obj = {}, singProData = {},
|
|||
|
|
isChecked = true;
|
|||
|
|
let pageNum = 1, limitSize = 50; // 默认第一页,分页数量为10
|
|||
|
|
|
|||
|
|
var singleTypeList = ['变电站', '开关站', '间隔', '架空线', '架空线切改', '陆上电缆', '陆上电缆切改', '水下电缆', '水下电缆切改', '混合线路', '串联补偿站', '静止无功补偿工程'];
|
|||
|
|
let user = getUser();
|
|||
|
|
setBtn();
|
|||
|
|
let bidProList = getProSelected('2');
|
|||
|
|
layui.config({
|
|||
|
|
base: "../../js/layui/", //此处路径请自行处理, 可以使用绝对路径
|
|||
|
|
}).extend({
|
|||
|
|
formSelects: 'formSelects-v4'
|
|||
|
|
}).use(['form', 'layer', 'table', 'laydate', 'formSelects'], function () {
|
|||
|
|
form = layui.form;
|
|||
|
|
layer = layui.layer;
|
|||
|
|
table = layui.table;
|
|||
|
|
laydate = layui.laydate;
|
|||
|
|
layui.form.render();
|
|||
|
|
laydate.render({
|
|||
|
|
elem: '#kgDate-search', //指定元素 元素选择器
|
|||
|
|
type: 'date', //选择时间类型 可选值:year(年) month(年月) date(年月日) time(时分秒) datetime(年月日时分秒)
|
|||
|
|
trigger: 'click',
|
|||
|
|
range: true,
|
|||
|
|
format: 'yyyy-MM-dd', //时间格式 常用时间格式:yyyy-MM-dd HH:mm:ss
|
|||
|
|
|
|||
|
|
});
|
|||
|
|
laydate.render({
|
|||
|
|
elem: '#tcDate-search', //指定元素 元素选择器
|
|||
|
|
type: 'date', //选择时间类型 可选值:year(年) month(年月) date(年月日) time(时分秒) datetime(年月日时分秒)
|
|||
|
|
trigger: 'click',
|
|||
|
|
range: true,
|
|||
|
|
format: 'yyyy-MM-dd', //时间格式 常用时间格式:yyyy-MM-dd HH:mm:ss
|
|||
|
|
});
|
|||
|
|
$('#myModal_edit').on('show.bs.modal', centerModals);
|
|||
|
|
getProStatusListNumAjax();
|
|||
|
|
changePage(null, 2);
|
|||
|
|
// getProOverViewData();
|
|||
|
|
// getProByUnitData();
|
|||
|
|
})
|
|||
|
|
|
|||
|
|
// 设置按钮
|
|||
|
|
function setBtn() {
|
|||
|
|
let html = '';
|
|||
|
|
if (user.isSup !== '3') {
|
|||
|
|
html += '<button type="button" class="layui-btn layui-btn-normal" onclick="exportProData()">导出</button>';
|
|||
|
|
html += '<button type="button" class="layui-btn layui-btn-normal" onclick="addPowerData()">新增输变电工程</button>';
|
|||
|
|
html += '<button type="button" class="layui-btn layui-btn-normal" onclick="updatePowerData()">修改输变电工程</button>';
|
|||
|
|
html += '<button type="button" class="layui-btn layui-btn-normal" onclick="delPowerData()">删除</button>';
|
|||
|
|
html += '<button type="button" class="layui-btn layui-btn-normal" onclick="chooseFile()">数据上传更新</button>' +
|
|||
|
|
'<input type="file" id="import-excel" name="image" style="display: none;"/>';
|
|||
|
|
$('#btn-box').removeAttr('style');
|
|||
|
|
} else {
|
|||
|
|
$('#pro-box').css('height', 'calc(100%)');
|
|||
|
|
}
|
|||
|
|
$('#operate-box').append(html)
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
// 在建工程、停工工程、投产工程
|
|||
|
|
function setProData(result) {
|
|||
|
|
let html = '', cent = '', cent2 = '', cent3 = '';
|
|||
|
|
if (result) {
|
|||
|
|
let zjDataList = result.zjList,
|
|||
|
|
tgDataList = result.tgList,
|
|||
|
|
tcDataList = result.tcList,
|
|||
|
|
dkgDataList = result.dkgList;
|
|||
|
|
if (zjDataList && zjDataList.length > 0) {
|
|||
|
|
$.each(zjDataList, function (index, item) {
|
|||
|
|
html += '<div class="child-p layout" proStatus = "1" year="' + item.yearDate + '" num = "' + item.num + '" tabindex="' + (index + 1) + '" onclick="checkedData(this,\'zj\')"><p></p><p class="year-title">' + item.yearDate + '(' + item.num + ')</p></div>'
|
|||
|
|
})
|
|||
|
|
}
|
|||
|
|
if (tgDataList && tgDataList.length > 0) {
|
|||
|
|
$.each(tgDataList, function (index, item) {
|
|||
|
|
cent += '<div class="child-p layout" proStatus = "2" year="' + item.yearDate + '" num = "' + item.num + '" tabindex="' + (index + 200) + '" onclick="checkedData(this,\'tg\')"><p></p><p class="year-title">' + item.yearDate + '(' + item.num + ')</p></div>'
|
|||
|
|
})
|
|||
|
|
}
|
|||
|
|
if (tcDataList && tcDataList.length > 0) {
|
|||
|
|
$.each(tcDataList, function (index, item) {
|
|||
|
|
cent2 += '<div class="child-p layout" proStatus = "3" year="' + item.yearDate + '" num = "' + item.num + '" tabindex="' + (index + 300) + '" onclick="checkedData(this,\'tc\')"><p></p><p class="year-title">' + item.yearDate + '(' + item.num + ')</p></div>'
|
|||
|
|
})
|
|||
|
|
}
|
|||
|
|
if (dkgDataList && dkgDataList.length > 0) {
|
|||
|
|
$.each(dkgDataList, function (index, item) {
|
|||
|
|
cent3 += '<div class="child-p layout" proStatus = "0" year="' + item.yearDate + '" num = "' + item.num + '" tabindex="' + (index + 400) + '" onclick="checkedData(this,\'dkg\')"><p></p><p class="year-title">' + item.yearDate + '(' + item.num + ')</p></div>'
|
|||
|
|
})
|
|||
|
|
}
|
|||
|
|
$('#zjNum').html(result.zjNum)
|
|||
|
|
$('#tgNum').html(result.tgNum)
|
|||
|
|
$('#tcNum').html(result.tcNum)
|
|||
|
|
$('#dkgNum').html(result.dkgNum)
|
|||
|
|
$('.zj').attr('num', result.zjNum)
|
|||
|
|
$('.tg').attr('num', result.tgNum)
|
|||
|
|
$('.tc').attr('num', result.tcNum)
|
|||
|
|
$('.dkg').attr('num', result.dkgNum)
|
|||
|
|
$('#build-pro-child').empty().append(html);
|
|||
|
|
$('#tg-pro-child').empty().append(cent);
|
|||
|
|
$('#tc-pro-child').empty().append(cent2);
|
|||
|
|
$('#dkg-pro-child').empty().append(cent3);
|
|||
|
|
// 第一次页面加载
|
|||
|
|
if (zjDataList && zjDataList.length > 0 && !checkProStatus && !checkYear && !checkOrg && !checkProNo) {
|
|||
|
|
loadZj('build-pro-child', 'zj', '1');
|
|||
|
|
}
|
|||
|
|
// 更新工程信息数据刷新
|
|||
|
|
if (checkProStatus && checkYear) {
|
|||
|
|
if (checkProStatus === '1') {
|
|||
|
|
if (zjDataList && zjDataList.length > 0) {
|
|||
|
|
$('#build-pro-child').find('.child-p').each(function () {
|
|||
|
|
if ($(this).attr("year") === checkYear) {
|
|||
|
|
$(this).addClass('child-p-checked');
|
|||
|
|
$('.zj').find('img').eq(0).css('display', 'none');
|
|||
|
|
$('.zj').find('img').eq(1).css('display', 'block');
|
|||
|
|
$('.zj').addClass('parent-p-checked');
|
|||
|
|
}
|
|||
|
|
})
|
|||
|
|
} else {
|
|||
|
|
checkProStatus = '', checkYear = '', checkOrg = '', checkProNo = '';
|
|||
|
|
$('.zj').find('img').eq(0).css('display', 'block');
|
|||
|
|
$('.zj').find('img').eq(1).css('display', 'none');
|
|||
|
|
$('.zj').removeClass('parent-p-checked');
|
|||
|
|
let flag = false;
|
|||
|
|
if (dkgDataList && dkgDataList.length > 0 && !flag) {
|
|||
|
|
loadZj('dkg-pro-child', 'dkg', '0');
|
|||
|
|
flag = true
|
|||
|
|
} else if (tgDataList && tgDataList.length > 0 && !flag) {
|
|||
|
|
loadZj('tg-pro-child', 'tg', '2');
|
|||
|
|
flag = true
|
|||
|
|
} else if (tcDataList && tcDataList.length > 0 && !flag) {
|
|||
|
|
loadZj('tc-pro-child', 'tc', '3');
|
|||
|
|
flag = true
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
} else if (checkProStatus === '2') {
|
|||
|
|
if (tgDataList && tgDataList.length > 0) {
|
|||
|
|
$('#tg-pro-child').find('.child-p').each(function () {
|
|||
|
|
if ($(this).attr("year") === checkYear) {
|
|||
|
|
$(this).addClass('child-p-checked');
|
|||
|
|
$('.tg').find('img').eq(0).css('display', 'none');
|
|||
|
|
$('.tg').find('img').eq(1).css('display', 'block');
|
|||
|
|
$('.tg').addClass('parent-p-checked');
|
|||
|
|
}
|
|||
|
|
})
|
|||
|
|
} else {
|
|||
|
|
checkProStatus = '', checkYear = '', checkOrg = '', checkProNo = '';
|
|||
|
|
$('#tg-pro-child').css('display', 'none');
|
|||
|
|
$('.tg').find('img').eq(0).css('display', 'block');
|
|||
|
|
$('.tg').find('img').eq(1).css('display', 'none');
|
|||
|
|
$('.tg').removeClass('parent-p-checked');
|
|||
|
|
let flag = false;
|
|||
|
|
if (zjDataList && zjDataList.length > 0 && !flag) {
|
|||
|
|
loadZj('build-pro-child', 'zj', '1');
|
|||
|
|
flag = true
|
|||
|
|
} else if (dkgDataList && dkgDataList.length > 0 && !flag) {
|
|||
|
|
loadZj('dkg-pro-child', 'dkg', '0');
|
|||
|
|
flag = true
|
|||
|
|
} else if (tcDataList && tcDataList.length > 0 && !flag) {
|
|||
|
|
loadZj('tc-pro-child', 'tc', '3');
|
|||
|
|
flag = true
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
} else if (checkProStatus === '3') {
|
|||
|
|
if (tcDataList && tcDataList.length > 0) {
|
|||
|
|
$('#tc-pro-child').find('.child-p').each(function () {
|
|||
|
|
if ($(this).attr("year") === checkYear) {
|
|||
|
|
$(this).addClass('child-p-checked');
|
|||
|
|
$('.tc').find('img').eq(0).css('display', 'none');
|
|||
|
|
$('.tc').find('img').eq(1).css('display', 'block');
|
|||
|
|
$('.tc').addClass('parent-p-checked');
|
|||
|
|
}
|
|||
|
|
})
|
|||
|
|
} else {
|
|||
|
|
checkProStatus = '', checkYear = '', checkOrg = '', checkProNo = '';
|
|||
|
|
$('#tc-pro-child').css('display', 'none');
|
|||
|
|
$('.tc').find('img').eq(0).css('display', 'block');
|
|||
|
|
$('.tc').find('img').eq(1).css('display', 'none');
|
|||
|
|
$('.tc').removeClass('parent-p-checked');
|
|||
|
|
let flag = false;
|
|||
|
|
if (zjDataList && zjDataList.length > 0 && !flag) {
|
|||
|
|
loadZj('build-pro-child', 'zj', '1');
|
|||
|
|
flag = true
|
|||
|
|
} else if (dkgDataList && dkgDataList.length > 0 && !flag) {
|
|||
|
|
loadZj('dkg-pro-child', 'dkg', '0');
|
|||
|
|
flag = true
|
|||
|
|
} else if (tgDataList && tgDataList.length > 0 && !flag) {
|
|||
|
|
loadZj('tg-pro-child', 'tg', '2');
|
|||
|
|
flag = true
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
} else if (checkProStatus === '0') {
|
|||
|
|
if (dkgDataList && dkgDataList.length > 0) {
|
|||
|
|
$('#dkg-pro-child').find('.child-p').each(function () {
|
|||
|
|
if ($(this).attr("year") === checkYear) {
|
|||
|
|
$(this).addClass('child-p-checked');
|
|||
|
|
$('.dkg').find('img').eq(0).css('display', 'none');
|
|||
|
|
$('.dkg').find('img').eq(1).css('display', 'block');
|
|||
|
|
$('.dkg').addClass('parent-p-checked');
|
|||
|
|
}
|
|||
|
|
})
|
|||
|
|
} else {
|
|||
|
|
checkProStatus = '', checkYear = '', checkOrg = '', checkProNo = '';
|
|||
|
|
$('#dkg-pro-child').css('display', 'none');
|
|||
|
|
$('.dkg').find('img').eq(0).css('display', 'block');
|
|||
|
|
$('.dkg').find('img').eq(1).css('display', 'none');
|
|||
|
|
$('.dkg').removeClass('parent-p-checked');
|
|||
|
|
let flag = false;
|
|||
|
|
if (zjDataList && zjDataList.length > 0 && !flag) {
|
|||
|
|
loadZj('build-pro-child', 'zj', '1');
|
|||
|
|
flag = true
|
|||
|
|
} else if (tgDataList && tgDataList.length > 0 && !flag) {
|
|||
|
|
loadZj('tg-pro-child', 'tg', '2');
|
|||
|
|
flag = true
|
|||
|
|
} else if (tcDataList && tcDataList.length > 0 && !flag) {
|
|||
|
|
loadZj('tc-pro-child', 'tc', '3');
|
|||
|
|
flag = true
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
getOrgProNumAjax();
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
function loadZj(name, name2, value) {
|
|||
|
|
$('#' + name).css('display', 'block');
|
|||
|
|
$('#' + name).find('.child-p').eq(0).addClass('child-p-checked');
|
|||
|
|
$('.' + name2).find('img').eq(0).css('display', 'none');
|
|||
|
|
$('.' + name2).find('img').eq(1).css('display', 'block');
|
|||
|
|
$('.' + name2).addClass('parent-p-checked');
|
|||
|
|
checkProStatus = value;
|
|||
|
|
checkYear = $('#' + name).find('.child-p').eq(0).attr('year');
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
// 地市工程数据
|
|||
|
|
function setOrgProData(result) {
|
|||
|
|
// 重置选中地市
|
|||
|
|
if (isChecked) {
|
|||
|
|
checkOrg = '';
|
|||
|
|
}
|
|||
|
|
let html = '';
|
|||
|
|
let proDataList = result.list;
|
|||
|
|
if (proDataList && proDataList.length > 0) {
|
|||
|
|
$.each(proDataList, function (index, item) {
|
|||
|
|
html += '<div class="org-child-p layout" orgNum="' + item.orgId + '" cityName="' + item.cityName + '" num="' + item.num + '" num2 = "' + item.num2 + '" tabindex="' + (index + 1000) + '" onclick="checkedOrgData(this)"><p class="org-title">' + item.cityName + '(' + item.num2 + '/' + item.num + ')</p></div>'
|
|||
|
|
})
|
|||
|
|
}
|
|||
|
|
$('#org-pro-num').empty().append(html);
|
|||
|
|
if (proDataList && proDataList.length > 0 && checkProStatus && checkYear) {
|
|||
|
|
if (checkOrg) {
|
|||
|
|
$.each(proDataList, function (index, item) {
|
|||
|
|
if (item.orgId === checkOrg && parseInt(item.num2) === 0) {
|
|||
|
|
checkOrg = '';
|
|||
|
|
}
|
|||
|
|
})
|
|||
|
|
}
|
|||
|
|
let flag = false;
|
|||
|
|
$('.org-child-p.layout').each(function (index, item) {
|
|||
|
|
if (checkOrg) {
|
|||
|
|
let orgNum = $(this).attr('orgNum');
|
|||
|
|
if (orgNum === checkOrg) {
|
|||
|
|
$(this).addClass('org-child-p-checked')
|
|||
|
|
}
|
|||
|
|
} else {
|
|||
|
|
let num = $(this).attr('num');
|
|||
|
|
let num2 = $(this).attr('num2');
|
|||
|
|
if ((parseInt(num) > 0 || parseInt(num2) > 0) && !flag) {
|
|||
|
|
$(this).addClass('org-child-p-checked')
|
|||
|
|
checkOrg = $(this).attr('orgNum')
|
|||
|
|
flag = true;
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
})
|
|||
|
|
}
|
|||
|
|
getProNumByOrgAjax();
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
// 输变电工程数据
|
|||
|
|
function setPowerProData(result) {
|
|||
|
|
// 重置选中工程
|
|||
|
|
if (isChecked) {
|
|||
|
|
checkProNo = '';
|
|||
|
|
}
|
|||
|
|
let html = '';
|
|||
|
|
let proDataList = result.list;
|
|||
|
|
if (proDataList && proDataList.length > 0) {
|
|||
|
|
$.each(proDataList, function (index, item) {
|
|||
|
|
html += "<div class='power-child-p layout' proNo=" + item.proNo + " proName=" + item.proName + " num=" + item.num + " tabindex=" + (index + 100000) + " objData = '" + JSON.stringify(item) + "' onclick='checkedPowerData(this," + JSON.stringify(item) + ")'><p style='text-align: center;'>" + item.proName + "(" + item.num + ")</p></div>"
|
|||
|
|
})
|
|||
|
|
} else {
|
|||
|
|
html += '<div class="power-child-p layout" proNo="-1" tabindex="100000"><p style="text-align: center;">无数据(0)</p></div>'
|
|||
|
|
}
|
|||
|
|
$('#power-pro-num').empty().append(html);
|
|||
|
|
if (proDataList && proDataList.length > 0 && checkProStatus && checkYear && checkOrg) {
|
|||
|
|
if (checkProNo) {
|
|||
|
|
let isExist = false;
|
|||
|
|
$('.power-child-p.layout').each(function (index, item) {
|
|||
|
|
if (checkProNo) {
|
|||
|
|
let proNo = $(this).attr('proNo');
|
|||
|
|
if (checkProNo === proNo) {
|
|||
|
|
$(this).addClass('power-child-p-checked');
|
|||
|
|
singProData = JSON.parse($(this).attr('objData'));
|
|||
|
|
isExist = true;
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
})
|
|||
|
|
if (!isExist) {
|
|||
|
|
$('#power-pro-num').find('.power-child-p').eq(0).addClass('power-child-p-checked');
|
|||
|
|
checkProNo = $('#power-pro-num').find('.power-child-p').eq(0).attr('proNo')
|
|||
|
|
singProData = proDataList[0];
|
|||
|
|
}
|
|||
|
|
} else {
|
|||
|
|
$('#power-pro-num').find('.power-child-p').eq(0).addClass('power-child-p-checked');
|
|||
|
|
checkProNo = $('#power-pro-num').find('.power-child-p').eq(0).attr('proNo')
|
|||
|
|
singProData = proDataList[0];
|
|||
|
|
}
|
|||
|
|
if (pageType === '2') {
|
|||
|
|
// pages(1, 30, 1);
|
|||
|
|
initTable();
|
|||
|
|
}
|
|||
|
|
} else {
|
|||
|
|
singProData = {};
|
|||
|
|
checkProNo = ''
|
|||
|
|
if (pageType === '2') {
|
|||
|
|
// pages(1, 30, 1);
|
|||
|
|
initTable();
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
// 工程总览-详情数据
|
|||
|
|
function setProOverViewData(result) {
|
|||
|
|
if (result && result.list && result.list.length > 0) {
|
|||
|
|
for (let i = 0; i <= 8; i++) {
|
|||
|
|
$('#num' + (i + 1) + '').html(result.list[i].num)
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
// 监理单位信息、施工单位信息
|
|||
|
|
function setUnitTableData(result) {
|
|||
|
|
let html = '', cent = '';
|
|||
|
|
if (result) {
|
|||
|
|
let jlDataList = result.list,
|
|||
|
|
sgDataList = result.list2;
|
|||
|
|
if (jlDataList && jlDataList.length > 0) {
|
|||
|
|
jlDataList.forEach(function (item, index) {
|
|||
|
|
html += '<tr><td>' + (index + 1) + '</td><td>' + item.jlUnit + '</td><td>' + item.num + '</td></tr>';
|
|||
|
|
})
|
|||
|
|
} else {
|
|||
|
|
html += '<tr><td colspan="3">暂无数据</td></tr>'
|
|||
|
|
}
|
|||
|
|
if (sgDataList && sgDataList.length > 0) {
|
|||
|
|
sgDataList.forEach(function (item, index) {
|
|||
|
|
cent += '<tr><td>' + (index + 1) + '</td><td>' + item.sgUnit + '</td><td>' + item.num + '</td></tr>';
|
|||
|
|
})
|
|||
|
|
} else {
|
|||
|
|
cent += '<tr><td colspan="3">暂无数据</td></tr>'
|
|||
|
|
}
|
|||
|
|
} else {
|
|||
|
|
html += '<tr><td colspan="3">暂无数据</td></tr>'
|
|||
|
|
cent += '<tr><td colspan="3">暂无数据</td></tr>'
|
|||
|
|
}
|
|||
|
|
$('#jlTable tbody').empty().append(html);
|
|||
|
|
$('#sgTable tbody').empty().append(cent);
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
|
|||
|
|
/* function pages(pageNum, pageSize, typeNum) {
|
|||
|
|
let params = getReqParams(pageNum, pageSize, typeNum);
|
|||
|
|
$.ajax({
|
|||
|
|
headers: {
|
|||
|
|
"encrypt": sm3(JSON.stringify(params))
|
|||
|
|
},
|
|||
|
|
url: dataUrl + "proteam/pot/proInfo/getProInfoList?token=" + token,
|
|||
|
|
data: params,
|
|||
|
|
type: 'POST',
|
|||
|
|
async: false,
|
|||
|
|
success: function (result) {
|
|||
|
|
if (result.code === 200) {
|
|||
|
|
if (result.data) {
|
|||
|
|
initTable(result.data, result.limit, result.curr)
|
|||
|
|
laypages(result.count, result.curr, result.limit)
|
|||
|
|
}
|
|||
|
|
} else if (result.code === 500) {
|
|||
|
|
layer.alert(result.msg, { icon: 2 })
|
|||
|
|
} else if (result.code === 401) {
|
|||
|
|
logout(1);
|
|||
|
|
}
|
|||
|
|
}, error: function () {
|
|||
|
|
}
|
|||
|
|
});
|
|||
|
|
} */
|
|||
|
|
|
|||
|
|
/* function laypages(total, page, limit) {
|
|||
|
|
layui.use(['laypage'], function () {
|
|||
|
|
let laypage = layui.laypage;
|
|||
|
|
laypage.render({
|
|||
|
|
elem: 'voi-page',
|
|||
|
|
count: total,
|
|||
|
|
curr: page,
|
|||
|
|
limit: limit,
|
|||
|
|
limits: [30, 50, 100],
|
|||
|
|
layout: ['prev', 'page', 'next', 'skip', 'count', 'limit'],
|
|||
|
|
groups: 5,
|
|||
|
|
jump: function (obj, first) {
|
|||
|
|
if (!first) {
|
|||
|
|
pageNum = obj.curr, limitSize = obj.limit;
|
|||
|
|
pages(obj.curr, obj.limit, null);
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
});
|
|||
|
|
})
|
|||
|
|
} */
|
|||
|
|
|
|||
|
|
/*初始化表格*/
|
|||
|
|
function initTable(dataList, limit, page) {
|
|||
|
|
// let loadingMsg = layer.msg("数据加载中,请稍候...", { icon: 16, scrollbar: false, time: 0, });
|
|||
|
|
tableIns = table.render({
|
|||
|
|
id: 'dataTableId',
|
|||
|
|
elem: "#todayTaskTable",
|
|||
|
|
height: user.isSup !== '3' ? "full-140" : "full-90",
|
|||
|
|
// data: dataList,
|
|||
|
|
// limit: limit,
|
|||
|
|
url: dataUrl + "proteam/pot/proInfo/getProInfoList?token=" + token,
|
|||
|
|
page: {
|
|||
|
|
layout: ['prev', 'page', 'next', 'skip', 'count', 'limit'],
|
|||
|
|
groups: 5, //只显示 5 个连续页码
|
|||
|
|
limits: [30, 50, 100],
|
|||
|
|
limit: 50,
|
|||
|
|
curr: 1
|
|||
|
|
},
|
|||
|
|
method: 'POST',
|
|||
|
|
where: {
|
|||
|
|
proName: '',
|
|||
|
|
voltageLevel: '',
|
|||
|
|
type: checkProStatus,
|
|||
|
|
yearDate: checkYear,
|
|||
|
|
org: checkOrg,
|
|||
|
|
proNo: checkProNo
|
|||
|
|
},
|
|||
|
|
response: {
|
|||
|
|
statusCode: 200 //重新规定成功的状态码为 200,table 组件默认为 0
|
|||
|
|
},
|
|||
|
|
parseData: function (res) { // res 即为原始返回的数据
|
|||
|
|
return {
|
|||
|
|
"code": res.code,
|
|||
|
|
"msg": res.msg,
|
|||
|
|
"count": res.count,
|
|||
|
|
"data": res.data,
|
|||
|
|
"limit": res.limit,
|
|||
|
|
"curr": res.curr
|
|||
|
|
};
|
|||
|
|
},
|
|||
|
|
toolbar: true,
|
|||
|
|
drag: 'simple',
|
|||
|
|
defaultToolbar: ['filter'],
|
|||
|
|
cols: [
|
|||
|
|
function () {
|
|||
|
|
var arr = [
|
|||
|
|
//表头
|
|||
|
|
{
|
|||
|
|
fixed: 'left',
|
|||
|
|
title: "序号",
|
|||
|
|
width: 100,
|
|||
|
|
unresize: true,
|
|||
|
|
align: "center",
|
|||
|
|
templet: function (d) {
|
|||
|
|
// return (page - 1) * limit + d.LAY_INDEX;
|
|||
|
|
return d.LAY_NUM;
|
|||
|
|
}
|
|||
|
|
},
|
|||
|
|
{
|
|||
|
|
fixed: 'left',
|
|||
|
|
field: "proName",
|
|||
|
|
title: "工程名称",
|
|||
|
|
width: 300,
|
|||
|
|
unresize: false,
|
|||
|
|
align: "center",
|
|||
|
|
},
|
|||
|
|
{
|
|||
|
|
field: "voltageLevel",
|
|||
|
|
title: "电压等级",
|
|||
|
|
width: 120,
|
|||
|
|
unresize: false,
|
|||
|
|
align: "center"
|
|||
|
|
},
|
|||
|
|
{
|
|||
|
|
field: "orgName",
|
|||
|
|
title: "建管单位",
|
|||
|
|
width: 120,
|
|||
|
|
unresize: false,
|
|||
|
|
align: "center",
|
|||
|
|
},
|
|||
|
|
|
|||
|
|
{
|
|||
|
|
field: "jlUnit",
|
|||
|
|
title: "监理单位",
|
|||
|
|
width: 220,
|
|||
|
|
unresize: false,
|
|||
|
|
align: "center",
|
|||
|
|
},
|
|||
|
|
{
|
|||
|
|
field: "sgUnit",
|
|||
|
|
title: "施工单位",
|
|||
|
|
width: 220,
|
|||
|
|
unresize: false,
|
|||
|
|
align: "center"
|
|||
|
|
},
|
|||
|
|
{
|
|||
|
|
field: "singleType",
|
|||
|
|
title: "工程类型",
|
|||
|
|
width: 150,
|
|||
|
|
unresize: false,
|
|||
|
|
align: "center",
|
|||
|
|
},
|
|||
|
|
{
|
|||
|
|
field: "proStatus",
|
|||
|
|
title: "工程状态",
|
|||
|
|
width: 140,
|
|||
|
|
unresize: false,
|
|||
|
|
align: "center",
|
|||
|
|
templet: function (d) {
|
|||
|
|
return setProStatus(d.proStatus)
|
|||
|
|
}
|
|||
|
|
},
|
|||
|
|
{
|
|||
|
|
field: "supervisionTime",
|
|||
|
|
title: "规模",
|
|||
|
|
width: 140,
|
|||
|
|
unresize: false,
|
|||
|
|
align: "center",
|
|||
|
|
templet: function (d) {
|
|||
|
|
if (d.buildScaleLine) {
|
|||
|
|
return d.buildScaleLine + '千米';
|
|||
|
|
}
|
|||
|
|
if (d.buildScalePower) {
|
|||
|
|
return d.buildScalePower + '万千伏安';
|
|||
|
|
}
|
|||
|
|
return '';
|
|||
|
|
}
|
|||
|
|
},
|
|||
|
|
{
|
|||
|
|
field: "yzManager",
|
|||
|
|
title: "业主项目经理",
|
|||
|
|
width: 180,
|
|||
|
|
unresize: false,
|
|||
|
|
align: "center",
|
|||
|
|
},
|
|||
|
|
{
|
|||
|
|
field: "jlManager",
|
|||
|
|
title: "总监理工程师",
|
|||
|
|
width: 180,
|
|||
|
|
unresize: false,
|
|||
|
|
align: "center",
|
|||
|
|
},
|
|||
|
|
{
|
|||
|
|
field: "sgManager",
|
|||
|
|
title: "施工项目经理",
|
|||
|
|
width: 180,
|
|||
|
|
unresize: false,
|
|||
|
|
align: "center",
|
|||
|
|
},
|
|||
|
|
{
|
|||
|
|
field: "safetyDirector",
|
|||
|
|
title: "安全总监",
|
|||
|
|
width: 180,
|
|||
|
|
unresize: false,
|
|||
|
|
align: "center",
|
|||
|
|
},
|
|||
|
|
{
|
|||
|
|
field: "classNum",
|
|||
|
|
title: "当日站班会/<br>施工人数",
|
|||
|
|
width: 160,
|
|||
|
|
unresize: false,
|
|||
|
|
align: "center",
|
|||
|
|
},
|
|||
|
|
{
|
|||
|
|
field: "yeClassNum",
|
|||
|
|
title: "昨日站班会/<br>施工人数",
|
|||
|
|
width: 160,
|
|||
|
|
unresize: false,
|
|||
|
|
align: "center",
|
|||
|
|
},
|
|||
|
|
{
|
|||
|
|
field: "kgDate",
|
|||
|
|
title: "计划开工日期",
|
|||
|
|
width: 140,
|
|||
|
|
unresize: false,
|
|||
|
|
align: "center",
|
|||
|
|
},
|
|||
|
|
{
|
|||
|
|
field: "sjKgDate",
|
|||
|
|
title: "实际开工日期",
|
|||
|
|
width: 140,
|
|||
|
|
unresize: false,
|
|||
|
|
align: "center",
|
|||
|
|
},
|
|||
|
|
{
|
|||
|
|
field: "tcDate",
|
|||
|
|
title: "计划投产日期",
|
|||
|
|
width: 140,
|
|||
|
|
unresize: false,
|
|||
|
|
align: "center",
|
|||
|
|
},
|
|||
|
|
{
|
|||
|
|
field: "sjTcDate",
|
|||
|
|
title: "实际投产日期",
|
|||
|
|
width: 140,
|
|||
|
|
unresize: false,
|
|||
|
|
align: "center",
|
|||
|
|
},
|
|||
|
|
{
|
|||
|
|
field: "updateTime",
|
|||
|
|
title: "最后修改日期",
|
|||
|
|
width: 200,
|
|||
|
|
unresize: false,
|
|||
|
|
align: "center",
|
|||
|
|
templet: function (d) {
|
|||
|
|
if (d.updateTime) {
|
|||
|
|
return '<a style="font-size:15px;" onclick="openProEditHistory(' + d.id + ')">' + d.updateTime + '</a>';
|
|||
|
|
}
|
|||
|
|
return '';
|
|||
|
|
}
|
|||
|
|
},
|
|||
|
|
{
|
|||
|
|
fixed: 'right',
|
|||
|
|
field: "",
|
|||
|
|
title: "操作",
|
|||
|
|
width: 140,
|
|||
|
|
unresize: false,
|
|||
|
|
align: "center",
|
|||
|
|
templet: function (d) {
|
|||
|
|
let html = "<a onclick='editSignProData(" + d.id + "," + JSON.stringify(d) + ")' class='layui-icon layui-icon-edit' style='color:#1E9FFF;margin-right:5px;' title='编辑' lay-event='edit'></a>";;
|
|||
|
|
if (user.isSup == '3') {
|
|||
|
|
return html;
|
|||
|
|
}
|
|||
|
|
html += "<a onclick='delData(" + d.id + ")' class='layui-icon layui-icon-delete' style='color:red' title='删除' lay-event='del'></a>";
|
|||
|
|
return html;
|
|||
|
|
}
|
|||
|
|
},
|
|||
|
|
];
|
|||
|
|
|
|||
|
|
// 初始化筛选状态
|
|||
|
|
var local = layui.data('table-filter-test'); // 获取对应的本地记录
|
|||
|
|
layui.each(arr, function (index, item) {
|
|||
|
|
if (item.field in local) {
|
|||
|
|
item.hide = local[item.field];
|
|||
|
|
}
|
|||
|
|
});
|
|||
|
|
return arr;
|
|||
|
|
}()
|
|||
|
|
],
|
|||
|
|
done: function (res, curr, count) {
|
|||
|
|
// layer.close(loadingMsg);
|
|||
|
|
$(".layui-table-main tr").each(function (index, val) {
|
|||
|
|
$($(".layui-table-fixed .layui-table-body tbody tr")[index]).height($(val).height());
|
|||
|
|
});
|
|||
|
|
//动态监听表体高度变化,冻结行跟着改变高度
|
|||
|
|
$(".layui-table-body tr").resize(function () {
|
|||
|
|
$(".layui-table-body tr").each(function (index, val) {
|
|||
|
|
$($(".layui-table-fixed .layui-table-body table tr")[index]).height($(val).height());
|
|||
|
|
});
|
|||
|
|
});
|
|||
|
|
//初始化高度,使得冻结行表体高度一致
|
|||
|
|
$(".layui-table-body tr").each(function (index, val) {
|
|||
|
|
$($(".layui-table-fixed .layui-table-body table tr")[index]).height($(val).height());
|
|||
|
|
});
|
|||
|
|
table.resize("dataTableId");
|
|||
|
|
|
|||
|
|
// 设置默认选中第一行数据
|
|||
|
|
let that = this.elem.next();
|
|||
|
|
if (res.data && res.data.length > 0) {
|
|||
|
|
res.data.forEach(function (item, index) {
|
|||
|
|
if (index === 0) {
|
|||
|
|
that.find('.layui-table-box tbody tr[data-index="' + index + '"]').addClass('success')
|
|||
|
|
// obj = item;
|
|||
|
|
// setProInfoData(item);
|
|||
|
|
}
|
|||
|
|
if (item.proStatus == '1') {
|
|||
|
|
$("div[lay-id='dataTableId'] .layui-table-fixed-l table tbody tr").eq(index).css('color', 'black');
|
|||
|
|
$("div[lay-id='dataTableId'] .layui-table-main table tbody tr").eq(index).css('color', 'black');
|
|||
|
|
} else {
|
|||
|
|
$("div[lay-id='dataTableId'] .layui-table-fixed-l table tbody tr").eq(index).css('color', 'grey');
|
|||
|
|
$("div[lay-id='dataTableId'] .layui-table-main table tbody tr").eq(index).css('color', 'grey');
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
})
|
|||
|
|
} else {
|
|||
|
|
// setNoProInfoData();
|
|||
|
|
}
|
|||
|
|
// 记录筛选状态
|
|||
|
|
var that2 = this;
|
|||
|
|
that2.elem.next().on('mousedown', 'input[lay-filter="LAY_TABLE_TOOL_COLS"]+', function () {
|
|||
|
|
var input = $(this).prev()[0];
|
|||
|
|
// 此处表名可任意定义
|
|||
|
|
layui.data('table-filter-test', {
|
|||
|
|
key: input.name,
|
|||
|
|
value: input.checked
|
|||
|
|
})
|
|||
|
|
});
|
|||
|
|
pageNum = res.curr, limitSize = res.limit;
|
|||
|
|
},
|
|||
|
|
});
|
|||
|
|
table.on('row(todayTask)', function (obj) {
|
|||
|
|
$('.success').removeClass('success')
|
|||
|
|
$(obj.tr).addClass('success')
|
|||
|
|
// setProInfoData(obj.data);
|
|||
|
|
})
|
|||
|
|
//触发行双击事件
|
|||
|
|
table.on('rowDouble(todayTask)', function (obj) {
|
|||
|
|
console.log(obj.data);
|
|||
|
|
var clasNum = obj.data.classNum.split("/");
|
|||
|
|
|
|||
|
|
if (clasNum[0] > 0) {
|
|||
|
|
$.each(bidProList, function (index, item) {
|
|||
|
|
|
|||
|
|
if (item.name.indexOf(obj.data.proName) != -1) {
|
|||
|
|
console.log(item.name);
|
|||
|
|
console.log(item.code);
|
|||
|
|
openClassMetting(3, item.code);
|
|||
|
|
}
|
|||
|
|
})
|
|||
|
|
}
|
|||
|
|
});
|
|||
|
|
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
function openClassMetting(type, id) {
|
|||
|
|
let layerIndex = layer.open({
|
|||
|
|
id: "workTeam",
|
|||
|
|
title: false,
|
|||
|
|
type: 2,
|
|||
|
|
maxmin: false,
|
|||
|
|
content: 'classMetting.html',
|
|||
|
|
area: ['100%', '100%'],
|
|||
|
|
move: false,
|
|||
|
|
closeBtn: 0,
|
|||
|
|
success: function (layero, index) {
|
|||
|
|
let iframeWin = window["layui-layer-iframe" + layerIndex];
|
|||
|
|
iframeWin.setParams(type, id);
|
|||
|
|
}
|
|||
|
|
});
|
|||
|
|
}
|
|||
|
|
function delData(id) {
|
|||
|
|
layer.msg('确定删除该工程?', {
|
|||
|
|
time: 10000, //10s后自动关闭
|
|||
|
|
btn: ['确定', '取消']
|
|||
|
|
, yes: function (index, leyuo) {
|
|||
|
|
delPower(id);
|
|||
|
|
layer.closeAll();
|
|||
|
|
}
|
|||
|
|
});
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
|
|||
|
|
// 获取参数
|
|||
|
|
function getReqParams(page, limit, type) {
|
|||
|
|
let obj = {};
|
|||
|
|
if (!type) {
|
|||
|
|
obj = {
|
|||
|
|
page: page + "",
|
|||
|
|
limit: limit + "",
|
|||
|
|
proName: $('#proName-search').val(),
|
|||
|
|
voltageLevel: $('#voltageLevel-search').val(),
|
|||
|
|
kgDate: $('#kgDate-search').val(),
|
|||
|
|
tcDate: $('#tcDate-search').val(),
|
|||
|
|
type: checkProStatus,
|
|||
|
|
yearDate: checkYear,
|
|||
|
|
org: checkOrg,
|
|||
|
|
proNo: checkProNo
|
|||
|
|
};
|
|||
|
|
} else {
|
|||
|
|
obj = {
|
|||
|
|
page: '1',
|
|||
|
|
limit: '30',
|
|||
|
|
proName: '',
|
|||
|
|
voltageLevel: '',
|
|||
|
|
type: checkProStatus,
|
|||
|
|
yearDate: checkYear,
|
|||
|
|
org: checkOrg,
|
|||
|
|
proNo: checkProNo
|
|||
|
|
};
|
|||
|
|
}
|
|||
|
|
return obj;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
// 查询/重置
|
|||
|
|
function query(type) {
|
|||
|
|
if (type === 1) {
|
|||
|
|
let pattern = new RegExp("[%_<>]");
|
|||
|
|
if (pattern.test($("#proName-search").val())) {
|
|||
|
|
$("#proName-search").val('');
|
|||
|
|
return layer.msg('工程名称查询包含特殊字符,请重新输入', {
|
|||
|
|
icon: 2,
|
|||
|
|
time: 2000 //2秒关闭(如果不配置,默认是3秒)
|
|||
|
|
});
|
|||
|
|
}
|
|||
|
|
} else {
|
|||
|
|
resetForm();
|
|||
|
|
}
|
|||
|
|
// pages(1, limitSize)
|
|||
|
|
reloadTableData(1);
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
function reloadTableData(type){
|
|||
|
|
table.reload('dataTableId', {
|
|||
|
|
where: {
|
|||
|
|
proName: $('#proName-search').val(),
|
|||
|
|
voltageLevel: $('#voltageLevel-search').val(),
|
|||
|
|
kgDate: $('#kgDate-search').val(),
|
|||
|
|
tcDate: $('#tcDate-search').val(),
|
|||
|
|
type: checkProStatus,
|
|||
|
|
yearDate: checkYear,
|
|||
|
|
org: checkOrg,
|
|||
|
|
proNo: checkProNo
|
|||
|
|
},
|
|||
|
|
page: {
|
|||
|
|
curr: type ? 1 : pageNum,
|
|||
|
|
limit: limitSize,
|
|||
|
|
groups: 5, //只显示 5 个连续页码
|
|||
|
|
},
|
|||
|
|
});
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
// 刷新表格
|
|||
|
|
function reloadData3() {
|
|||
|
|
// pages(1, limitSize)
|
|||
|
|
reloadTableData(1);
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
|
|||
|
|
// 清空查询内容
|
|||
|
|
function resetForm() {
|
|||
|
|
$('#proName-search').val('')
|
|||
|
|
$('#voltageLevel-search').val('')
|
|||
|
|
$('#kgDate-search').val('')
|
|||
|
|
$('#tcDate-search').val('')
|
|||
|
|
layui.form.render();
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
// 导入刷新页面数据
|
|||
|
|
function reloadData(type) {
|
|||
|
|
if (type === '1') {
|
|||
|
|
getProStatusListNumAjax();
|
|||
|
|
getProOverViewData();
|
|||
|
|
getProByUnitData();
|
|||
|
|
} else if (type === '2') {
|
|||
|
|
getProStatusListNumAjax();
|
|||
|
|
}
|
|||
|
|
parent.layer.msg('导入成功', { icon: 1 });
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
// 新增输变电工程刷新页面
|
|||
|
|
function reloadData2(type) {
|
|||
|
|
isChecked = false;
|
|||
|
|
if (type === 1) {
|
|||
|
|
if (pageType === '1') {
|
|||
|
|
getProStatusListNumAjax();
|
|||
|
|
getProOverViewData();
|
|||
|
|
getProByUnitData();
|
|||
|
|
} else {
|
|||
|
|
getProStatusListNumAjax();
|
|||
|
|
}
|
|||
|
|
} else if (type === 2) {
|
|||
|
|
getProStatusListNumAjax();
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
/*导入*/
|
|||
|
|
function chooseFile() {
|
|||
|
|
$("#import-excel").trigger("click");
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
$("#import-excel").change(function () {
|
|||
|
|
if ($(this).val()) {
|
|||
|
|
let files = $(this)[0].files[0];
|
|||
|
|
let fileType = files.name.substring(
|
|||
|
|
files.name.lastIndexOf(".") + 1,
|
|||
|
|
files.name.length
|
|||
|
|
);
|
|||
|
|
if (fileType === "xlsx" || fileType === "xls") {
|
|||
|
|
excelUpload5(this, '', dataUrl + "proteam/pot/proInfo/importExcel?token=" + token)
|
|||
|
|
} else {
|
|||
|
|
layer.msg("仅支持上传文件格式为:xlx、xlsx", { icon: 5, });
|
|||
|
|
$("#import-excel").val("");
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
});
|
|||
|
|
|
|||
|
|
// 弹出模态框
|
|||
|
|
function centerModals() {
|
|||
|
|
$('#myModal_edit').each(function (i) {
|
|||
|
|
var $clone = $(this).clone().css('display', 'block').appendTo('body');
|
|||
|
|
var top = Math.round(($clone.height() - $clone.find('.modal-content').height()) / 3);
|
|||
|
|
top = top > 0 ? top : 0;
|
|||
|
|
$clone.remove();
|
|||
|
|
$(this).find('.modal-content').css("margin-top", top);
|
|||
|
|
});
|
|||
|
|
};
|
|||
|
|
|
|||
|
|
// 设置编辑按钮
|
|||
|
|
function setEditBtn(that, id) {
|
|||
|
|
if (user.isSup !== '3') {
|
|||
|
|
return '<a style="color: #0a84ff;width: 15%;" onclick="editPowerData(' + id + ')">编辑</a>'
|
|||
|
|
} else {
|
|||
|
|
$(that).prev().css('width', '100%')
|
|||
|
|
return '';
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
// 修改输变电工程
|
|||
|
|
function editPowerData(id) {
|
|||
|
|
console.log(singProData);
|
|||
|
|
event.stopPropagation();
|
|||
|
|
let layerIndex = layer.open({
|
|||
|
|
id: "editPowerData",
|
|||
|
|
title: ['<div style="border-left: 3px solid #2F82FB;display: flex;align-items: center;height: 20px;padding: 0 10px;">编辑输变电工程</div>', 'font-size:16px;background-color:#f0f0f0;display: flex;align-items: center;'],
|
|||
|
|
type: 2,
|
|||
|
|
maxmin: false,
|
|||
|
|
content: 'child/editPowerDataForm.html',
|
|||
|
|
area: ['800px', '650px'],
|
|||
|
|
move: false,
|
|||
|
|
success: function (layero, index) {
|
|||
|
|
let iframeWin = window["layui-layer-iframe" + layerIndex];
|
|||
|
|
iframeWin.setParams(id);
|
|||
|
|
}
|
|||
|
|
});
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
// 新增输变电工程
|
|||
|
|
function addPowerData() {
|
|||
|
|
let layerIndex = layer.open({
|
|||
|
|
id: "addPowerData",
|
|||
|
|
title: ['<div style="border-left: 3px solid #2F82FB;display: flex;align-items: center;height: 20px;padding: 0 10px;">新增输变电工程</div>', 'font-size:16px;background-color:#f0f0f0;display: flex;align-items: center;'],
|
|||
|
|
type: 2,
|
|||
|
|
maxmin: false,
|
|||
|
|
content: 'child/addPowerDataForm.html',
|
|||
|
|
area: ['800px', '650px'],
|
|||
|
|
move: false,
|
|||
|
|
success: function (layero, index) {
|
|||
|
|
|
|||
|
|
}
|
|||
|
|
});
|
|||
|
|
}
|
|||
|
|
function updatePowerData() {
|
|||
|
|
let layerIndex = layer.open({
|
|||
|
|
id: "addPowerData",
|
|||
|
|
title: ['<div style="border-left: 3px solid #2F82FB;display: flex;align-items: center;height: 20px;padding: 0 10px;">修改输变电工程</div>', 'font-size:16px;background-color:#f0f0f0;display: flex;align-items: center;'],
|
|||
|
|
type: 2,
|
|||
|
|
maxmin: false,
|
|||
|
|
content: 'child/editPowerDataForm.html',
|
|||
|
|
area: ['800px', '650px'],
|
|||
|
|
move: false,
|
|||
|
|
success: function (layero, index) {
|
|||
|
|
let iframeWin = window["layui-layer-iframe" + layerIndex];
|
|||
|
|
iframeWin.setParams(singProData.id);
|
|||
|
|
}
|
|||
|
|
});
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
function delPowerData() {
|
|||
|
|
if (!$.isEmptyObject(singProData)) {
|
|||
|
|
gettChilderNum();
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
|
|||
|
|
// 新增单项工程
|
|||
|
|
function addProData() {
|
|||
|
|
if (!singProData.proNo) {
|
|||
|
|
return layer.msg('未选择工程', { icon: 7 })
|
|||
|
|
}
|
|||
|
|
let layerIndex = layer.open({
|
|||
|
|
id: "addProData",
|
|||
|
|
title: ['<div style="border-left: 3px solid #2F82FB;display: flex;align-items: center;height: 20px;padding: 0 10px;">新增单项工程</div>', 'font-size:16px;background-color:#f0f0f0;display: flex;align-items: center;'],
|
|||
|
|
type: 2,
|
|||
|
|
maxmin: false,
|
|||
|
|
content: 'child/addProDataForm.html',
|
|||
|
|
area: ['800px', '630px'],
|
|||
|
|
move: false,
|
|||
|
|
success: function (layero, index) {
|
|||
|
|
let iframeWin = window["layui-layer-iframe" + layerIndex];
|
|||
|
|
iframeWin.setParams(singProData);
|
|||
|
|
}
|
|||
|
|
});
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
// 导出工程
|
|||
|
|
function exportProData() {
|
|||
|
|
let layerIndex = layer.open({
|
|||
|
|
id: "exportProData",
|
|||
|
|
title: ['<div style="border-left: 3px solid #2F82FB;display: flex;align-items: center;height: 20px;padding: 0 10px;">导出工程</div>', 'font-size:16px;background-color:#f0f0f0;display: flex;align-items: center;'],
|
|||
|
|
type: 2,
|
|||
|
|
maxmin: false,
|
|||
|
|
content: 'child/exportProData.html',
|
|||
|
|
area: ['800px', '630px'],
|
|||
|
|
move: false,
|
|||
|
|
success: function (layero, index) {
|
|||
|
|
// let iframeWin = window["layui-layer-iframe" + layerIndex];
|
|||
|
|
// iframeWin.setParams(singProData);
|
|||
|
|
}
|
|||
|
|
});
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
// 工程历史修改记录
|
|||
|
|
function openProEditHistory(id) {
|
|||
|
|
let layerIndex = layer.open({
|
|||
|
|
id: "openProEditHistory",
|
|||
|
|
title: ['<div style="border-left: 3px solid #2F82FB;display: flex;align-items: center;height: 20px;padding: 0 10px;">工程修改记录</div>', 'font-size:16px;background-color:#f0f0f0;display: flex;align-items: center;'],
|
|||
|
|
type: 2,
|
|||
|
|
maxmin: false,
|
|||
|
|
content: 'child/proEditHistory.html',
|
|||
|
|
area: ['800px', '630px'],
|
|||
|
|
move: false,
|
|||
|
|
success: function (layero, index) {
|
|||
|
|
let iframeWin = window["layui-layer-iframe" + layerIndex];
|
|||
|
|
iframeWin.setParams(id);
|
|||
|
|
}
|
|||
|
|
});
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
// 编辑单项工程
|
|||
|
|
function editSignProData(id, obj) {
|
|||
|
|
let layerIndex = layer.open({
|
|||
|
|
id: "editSignProData",
|
|||
|
|
title: ['<div style="border-left: 3px solid #2F82FB;display: flex;align-items: center;height: 20px;padding: 0 10px;">编辑单项工程</div>', 'font-size:16px;background-color:#f0f0f0;display: flex;align-items: center;'],
|
|||
|
|
type: 2,
|
|||
|
|
maxmin: false,
|
|||
|
|
content: 'child/editSignProDataForm.html',
|
|||
|
|
area: ['800px', '650px'],
|
|||
|
|
move: false,
|
|||
|
|
success: function (layero, index) {
|
|||
|
|
let iframeWin = window["layui-layer-iframe" + layerIndex];
|
|||
|
|
iframeWin.setParams(id, obj);
|
|||
|
|
}
|
|||
|
|
});
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
function setValue(value, type) {
|
|||
|
|
if (value) {
|
|||
|
|
return value;
|
|||
|
|
} else if (!value && type === 1) {
|
|||
|
|
return '/';
|
|||
|
|
} else if (!value && type === 2) {
|
|||
|
|
return '';
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
// 设置规模
|
|||
|
|
function setValue2(buildScaleLine, buildScalePower) {
|
|||
|
|
if (buildScaleLine) {
|
|||
|
|
return buildScaleLine + '千米'
|
|||
|
|
}
|
|||
|
|
if (buildScalePower) {
|
|||
|
|
return buildScalePower + '万千伏安'
|
|||
|
|
}
|
|||
|
|
return '/'
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
// 设置工程状态
|
|||
|
|
function setProStatus(proStatus) {
|
|||
|
|
if (proStatus === '0') {
|
|||
|
|
return '待开工';
|
|||
|
|
} else if (proStatus === '1') {
|
|||
|
|
return '开工';
|
|||
|
|
} else if (proStatus === '2') {
|
|||
|
|
return '停工';
|
|||
|
|
} else if (proStatus === '3') {
|
|||
|
|
return '投产';
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
/*监理单位赋值*/
|
|||
|
|
function setSelectId(List, id) {
|
|||
|
|
let keys = [];
|
|||
|
|
$.each(List, function (index, item) {
|
|||
|
|
let temp = {
|
|||
|
|
"name": item.name,
|
|||
|
|
"value": item.name,
|
|||
|
|
"titleName": item.name
|
|||
|
|
};
|
|||
|
|
keys.push(temp);
|
|||
|
|
})
|
|||
|
|
formSelects.data(id, 'local', {
|
|||
|
|
arr: keys
|
|||
|
|
});
|
|||
|
|
layui.form.render();
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
function gettChilderNum() {
|
|||
|
|
$.ajax({
|
|||
|
|
headers: {
|
|||
|
|
"encrypt": sm3(JSON.stringify({
|
|||
|
|
proNo: singProData.proNo
|
|||
|
|
}))
|
|||
|
|
},
|
|||
|
|
url: dataUrl + 'proteam/pot/proInfo/getChiderNum?token=' + token,
|
|||
|
|
type: 'POST',
|
|||
|
|
data: {
|
|||
|
|
proNo: singProData.proNo,
|
|||
|
|
proStatus: singProData.proStatus
|
|||
|
|
},
|
|||
|
|
dataType: 'json',
|
|||
|
|
async: false,
|
|||
|
|
success: function (result) {
|
|||
|
|
if (result.code === 200) {
|
|||
|
|
console.log(result);
|
|||
|
|
if (result.data > 0) {
|
|||
|
|
layer.msg(singProData.proName + "下存在单项工程不允许删除", { icon: 7 })
|
|||
|
|
} else {
|
|||
|
|
layer.msg('确定删除' + singProData.proName + '?', {
|
|||
|
|
time: 10000, //10s后自动关闭
|
|||
|
|
btn: ['确定', '取消']
|
|||
|
|
, yes: function (index, leyuo) {
|
|||
|
|
delPower(singProData.id);
|
|||
|
|
layer.closeAll();
|
|||
|
|
}
|
|||
|
|
});
|
|||
|
|
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
} else if (result.code === 500) {
|
|||
|
|
} else if (result.code === 401) {
|
|||
|
|
logout(1)
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
});
|
|||
|
|
|
|||
|
|
}
|
|||
|
|
/**
|
|||
|
|
* 删除工程数据
|
|||
|
|
*/
|
|||
|
|
function delPower(id) {
|
|||
|
|
$.ajax({
|
|||
|
|
headers: {
|
|||
|
|
"encrypt": sm3(JSON.stringify({
|
|||
|
|
id: id,
|
|||
|
|
}))
|
|||
|
|
},
|
|||
|
|
url: dataUrl + 'proteam/pot/proInfo/delPower?token=' + token,
|
|||
|
|
type: 'POST',
|
|||
|
|
data: {
|
|||
|
|
id: id,
|
|||
|
|
|
|||
|
|
},
|
|||
|
|
dataType: 'json',
|
|||
|
|
async: false,
|
|||
|
|
success: function (result) {
|
|||
|
|
console.log(result)
|
|||
|
|
if (result.code === 200) {
|
|||
|
|
reloadData2(2);
|
|||
|
|
layer.msg(result.msg, { icon: 1 });
|
|||
|
|
} else if (result.code === 401) {
|
|||
|
|
logout(1)
|
|||
|
|
} else {
|
|||
|
|
layer.msg(result.msg, { icon: 2 })
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
}
|
|||
|
|
});
|
|||
|
|
}
|