2024-07-26 18:15:22 +08:00
|
|
|
|
var table,form,layer,element;
|
2024-08-16 09:20:11 +08:00
|
|
|
|
var parentData;
|
2024-07-26 18:15:22 +08:00
|
|
|
|
layui.use(['form','layer','table','element'], function () {
|
|
|
|
|
|
table = layui.table;
|
|
|
|
|
|
form = layui.form;
|
|
|
|
|
|
layer = layui.layer;
|
|
|
|
|
|
//杆塔信息
|
2024-08-16 09:20:11 +08:00
|
|
|
|
if(parentData.isTwo == '0'){
|
|
|
|
|
|
//单回路
|
|
|
|
|
|
initGmTableOne();
|
|
|
|
|
|
}else{
|
|
|
|
|
|
//双回路
|
|
|
|
|
|
var html = `<div class="layui-input-inline">
|
|
|
|
|
|
<select id="type" name="type" class="layui-select" lay-verify="required">
|
|
|
|
|
|
<option value="" >杆塔绑定状态</option>
|
|
|
|
|
|
<option value="1" >已绑定</option>
|
|
|
|
|
|
<option value="2" >未绑定</option>
|
|
|
|
|
|
</select>
|
|
|
|
|
|
</div>`
|
|
|
|
|
|
$("#two").append(html)
|
|
|
|
|
|
initGmTableTwo();
|
|
|
|
|
|
}
|
2024-07-26 18:15:22 +08:00
|
|
|
|
form.on('submit(resetGm)', function () {
|
|
|
|
|
|
console.log("重置")
|
2024-08-16 09:20:11 +08:00
|
|
|
|
$('#keyWord').val('');
|
|
|
|
|
|
$('#type').val('');
|
|
|
|
|
|
form.render("select");
|
2024-07-26 18:15:22 +08:00
|
|
|
|
let obj = {
|
2024-08-16 09:20:11 +08:00
|
|
|
|
keyWord:'',
|
|
|
|
|
|
type:'',
|
|
|
|
|
|
proId: parentData.proId
|
2024-07-26 18:15:22 +08:00
|
|
|
|
}
|
|
|
|
|
|
// 对表格进行重载。id 即 table表格的id
|
|
|
|
|
|
table.reload('gmTable', {
|
|
|
|
|
|
// //设定异步数据接口的额外参数
|
|
|
|
|
|
page:{curr : 1}
|
|
|
|
|
|
,where: obj
|
|
|
|
|
|
})
|
|
|
|
|
|
return false; // 阻止表单跳转。如果需要表单跳转,去掉这段即可。
|
|
|
|
|
|
});
|
2024-08-28 12:36:09 +08:00
|
|
|
|
console.log(parentData,"parentData")
|
2024-08-21 19:52:53 +08:00
|
|
|
|
initStaffTable();
|
2024-07-26 18:15:22 +08:00
|
|
|
|
});
|
2024-08-16 09:20:11 +08:00
|
|
|
|
//杆塔信息搜索
|
|
|
|
|
|
function queryClick1(){
|
|
|
|
|
|
var type = "";
|
|
|
|
|
|
if(parentData.isTwo == '1'){
|
|
|
|
|
|
//双回路
|
|
|
|
|
|
type = $("#type").val();
|
|
|
|
|
|
}
|
|
|
|
|
|
// 对表格进行重载。id 即 table表格的id
|
|
|
|
|
|
table.reload('layui_table', {
|
|
|
|
|
|
// //设定异步数据接口的额外参数
|
|
|
|
|
|
page:{curr : 1}
|
|
|
|
|
|
,where: {
|
|
|
|
|
|
'keyWord': $("#keyWord").val(),
|
|
|
|
|
|
'type': type,
|
|
|
|
|
|
'proId': parentData.proId
|
|
|
|
|
|
}
|
|
|
|
|
|
})
|
|
|
|
|
|
}
|
2024-07-26 18:15:22 +08:00
|
|
|
|
|
2024-08-16 09:20:11 +08:00
|
|
|
|
//重置
|
|
|
|
|
|
function resetClick1(){
|
|
|
|
|
|
//重置
|
|
|
|
|
|
$('#keyWord').val("");
|
|
|
|
|
|
$('#type').val("");
|
|
|
|
|
|
table.reload('layui_table', {
|
|
|
|
|
|
where: {
|
|
|
|
|
|
'keyWord': '',
|
|
|
|
|
|
'type': '',
|
|
|
|
|
|
'proId': parentData.proId
|
|
|
|
|
|
}
|
|
|
|
|
|
})
|
|
|
|
|
|
}
|
2024-08-21 19:52:53 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-08-16 09:20:11 +08:00
|
|
|
|
//新增杆塔
|
|
|
|
|
|
function addClick1(){
|
|
|
|
|
|
var height = '80%';
|
|
|
|
|
|
var width = '50%';
|
|
|
|
|
|
var index = layer.open({
|
|
|
|
|
|
title: ['新增', 'color:#3B70A1;background-color:#E8ECEB;font-size:20px'],
|
|
|
|
|
|
type: 2,
|
|
|
|
|
|
content: 'addTower.html',
|
|
|
|
|
|
area: [width, height],
|
|
|
|
|
|
maxmin: false,
|
|
|
|
|
|
success: function (layero, index) {
|
|
|
|
|
|
// //打开页面成功时执行
|
|
|
|
|
|
var myIframe = window[layero.find('iframe')[0]['name']];
|
|
|
|
|
|
myIframe.setData(parentData.proId);
|
|
|
|
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
yes: function (index, layero) {
|
|
|
|
|
|
// //提交子页面时执行
|
|
|
|
|
|
// // 获取弹出层中的form表单元素
|
|
|
|
|
|
// var formSubmit = layer.getChildFrame('form', index);
|
|
|
|
|
|
// var submited = formSubmit.find('button')[0];
|
|
|
|
|
|
// // 触发点击事件,会对表单进行验证,验证成功则提交表单,失败则返回错误信息
|
|
|
|
|
|
// // var myIframe = window[layero.find('iframe')[0]['name']];
|
|
|
|
|
|
// // myIframe.selectCheck(); //aaa()为子页面的方法
|
|
|
|
|
|
// submited.click();
|
|
|
|
|
|
// example.ajax.reload(); // 刷新页面
|
|
|
|
|
|
},
|
|
|
|
|
|
end: function(){
|
|
|
|
|
|
if(parentData.isTwo == '0'){
|
|
|
|
|
|
initGmTableOne()
|
|
|
|
|
|
}else{
|
|
|
|
|
|
initGmTableTwo()
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
}
|
|
|
|
|
|
//修改杆塔信息
|
|
|
|
|
|
function updClick1(){
|
|
|
|
|
|
var checkStatus = table.checkStatus('layui_table');
|
|
|
|
|
|
var data = checkStatus.data;
|
|
|
|
|
|
if(data.length == 0){
|
|
|
|
|
|
layer.msg("请勾选需要修改的数据", { icon: 0} );
|
|
|
|
|
|
return;
|
|
|
|
|
|
}
|
|
|
|
|
|
if(data.length > 1){
|
|
|
|
|
|
layer.msg("请勿勾选多个", { icon: 0} )
|
|
|
|
|
|
return;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
var height = '80%';
|
|
|
|
|
|
var width = '50%';
|
|
|
|
|
|
var index = layer.open({
|
|
|
|
|
|
title: ['修改', 'color:#3B70A1;background-color:#E8ECEB;font-size:20px'],
|
|
|
|
|
|
type: 2,
|
|
|
|
|
|
content: 'updTower.html',
|
|
|
|
|
|
area: [width, height],
|
|
|
|
|
|
maxmin: false,
|
|
|
|
|
|
success: function (layero, index) {
|
|
|
|
|
|
// //打开页面成功时执行
|
|
|
|
|
|
var myIframe = window[layero.find('iframe')[0]['name']];
|
|
|
|
|
|
myIframe.setData(data, parentData.proId);
|
|
|
|
|
|
},
|
|
|
|
|
|
yes: function (index, layero) {
|
|
|
|
|
|
// //提交子页面时执行
|
|
|
|
|
|
// // 获取弹出层中的form表单元素
|
|
|
|
|
|
// var formSubmit = layer.getChildFrame('form', index);
|
|
|
|
|
|
// var submited = formSubmit.find('button')[0];
|
|
|
|
|
|
},
|
|
|
|
|
|
end: function(){
|
|
|
|
|
|
if(parentData.isTwo == '0'){
|
|
|
|
|
|
initGmTableOne()
|
|
|
|
|
|
}else{
|
|
|
|
|
|
initGmTableTwo()
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
}
|
|
|
|
|
|
//删除杆塔
|
|
|
|
|
|
function delClick1(){
|
|
|
|
|
|
var checkStatus = table.checkStatus('layui_table');
|
|
|
|
|
|
var data = checkStatus.data;
|
|
|
|
|
|
if(data.length == 0){
|
|
|
|
|
|
layer.msg("请勾选需要删除的数据", { icon: 0} );
|
|
|
|
|
|
return;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
var gtIds = '';
|
|
|
|
|
|
if(data.length == 1){
|
|
|
|
|
|
gtIds = data[0].gtId;
|
|
|
|
|
|
}
|
|
|
|
|
|
if(data.length > 1){
|
|
|
|
|
|
for (var i = 0; i < data.length; i++) {
|
|
|
|
|
|
if(i < data.length - 1){
|
|
|
|
|
|
gtIds += data[i].gtId + ',';
|
|
|
|
|
|
}else{
|
|
|
|
|
|
gtIds += data[i].gtId;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var index = layer.confirm("确认删除吗?",{icon: 0},function(){
|
|
|
|
|
|
$.ajax({
|
|
|
|
|
|
type: 'POST',
|
|
|
|
|
|
url: PATH_URL + "/lineProject/delPowerId", // 请求地址
|
|
|
|
|
|
contentType: "application/json; charset=utf-8",
|
|
|
|
|
|
dataType: 'json', // 服务器返回数据类型
|
|
|
|
|
|
data: JSON.stringify({ "gtIds": gtIds, "proId": parentData.proId }), //获取提交的表单字段
|
|
|
|
|
|
success: function (data) {
|
|
|
|
|
|
if (data.code == 200) {
|
|
|
|
|
|
layer.msg("删除成功", { icon: 1 });
|
|
|
|
|
|
document.getElementById('powerNum').innerText = data.data.powerNum;
|
|
|
|
|
|
if(parentData.isTwo == '0'){
|
|
|
|
|
|
initGmTableOne()
|
|
|
|
|
|
}else{
|
|
|
|
|
|
initGmTableTwo()
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//关闭弹框
|
|
|
|
|
|
layer.close(index); //再执行关闭
|
|
|
|
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
layer.alert(data.msg);
|
|
|
|
|
|
}
|
|
|
|
|
|
},
|
|
|
|
|
|
error: function (XMLHttpRequest, textStatus, e) {
|
|
|
|
|
|
top.layer.close(loadingMsg);
|
|
|
|
|
|
layer.msg('数据请求发生异常,请稍后重试', {icon: 16, scrollbar: false});
|
|
|
|
|
|
}
|
|
|
|
|
|
});
|
|
|
|
|
|
})
|
|
|
|
|
|
}
|
2024-07-26 18:15:22 +08:00
|
|
|
|
|
2024-08-16 09:20:11 +08:00
|
|
|
|
//导入杆塔信息
|
|
|
|
|
|
function importData1(){
|
|
|
|
|
|
var height = '99%';
|
|
|
|
|
|
var width = '50%';
|
|
|
|
|
|
var index = layer.open({
|
|
|
|
|
|
title: [`导入`, 'color:#3B70A1;background-color:#E8ECEB;font-size:20px'],
|
|
|
|
|
|
type: 2,
|
|
|
|
|
|
// content: 'child/orgInformation.html',
|
|
|
|
|
|
content: 'projectImport.html',
|
|
|
|
|
|
area: [width, height],
|
|
|
|
|
|
maxmin: false,
|
|
|
|
|
|
success: function (layero, index) {
|
|
|
|
|
|
var myIframe = window[layero.find('iframe')[0]['name']];
|
|
|
|
|
|
var json = {
|
|
|
|
|
|
type: '2',
|
|
|
|
|
|
proId: parentData.proId
|
|
|
|
|
|
}
|
|
|
|
|
|
myIframe.setParam(json)
|
|
|
|
|
|
},
|
|
|
|
|
|
yes: function (index, layero) {
|
|
|
|
|
|
},
|
|
|
|
|
|
end: function () {
|
|
|
|
|
|
if(parentData.isTwo == '0'){
|
|
|
|
|
|
initGmTableOne()
|
|
|
|
|
|
}else{
|
|
|
|
|
|
initGmTableTwo()
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
});
|
|
|
|
|
|
}
|
2024-07-26 18:15:22 +08:00
|
|
|
|
|
|
|
|
|
|
|
2024-08-16 09:20:11 +08:00
|
|
|
|
function setData(data){
|
2024-08-21 19:52:53 +08:00
|
|
|
|
$("#proId").val(data.proId);
|
|
|
|
|
|
$("#proName").val(data.proName);
|
|
|
|
|
|
|
2024-08-21 14:28:04 +08:00
|
|
|
|
var proName = data.proName;
|
2024-08-21 19:52:53 +08:00
|
|
|
|
if(proName.length > 8){
|
2024-08-21 14:28:04 +08:00
|
|
|
|
proName = proName.substring(0, 8) + '...'
|
|
|
|
|
|
}
|
|
|
|
|
|
$("#proName").text(proName);
|
|
|
|
|
|
$("#proName").attr('title', data.proName);
|
|
|
|
|
|
|
2024-08-16 09:20:11 +08:00
|
|
|
|
$(".isTwo").text(data.isTwo == '0'? '单回路': '双回路');
|
|
|
|
|
|
$("#powerNum").text(data.powerNum);
|
|
|
|
|
|
$("#lineNum").text(data.lineNum);
|
2024-08-21 19:52:53 +08:00
|
|
|
|
|
|
|
|
|
|
var proName1 = data.proName;
|
|
|
|
|
|
if(proName1.length > 50){
|
|
|
|
|
|
proName1 = proName1.substring(0, 50) + '...'
|
|
|
|
|
|
}
|
|
|
|
|
|
$("#lineProName").text(proName1);
|
|
|
|
|
|
$("#lineProName").attr('title', data.proName);
|
2024-08-16 09:20:11 +08:00
|
|
|
|
|
|
|
|
|
|
$("#yjName").text(data.fgsName + ' / ' + data.yjName);
|
2024-08-28 17:54:21 +08:00
|
|
|
|
$("#volLevel").text(data.volLevel);
|
2024-08-16 09:20:11 +08:00
|
|
|
|
|
|
|
|
|
|
parentData = data;
|
2024-07-26 18:15:22 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
2024-08-16 09:20:11 +08:00
|
|
|
|
// 渲染杆塔表格 单回路
|
|
|
|
|
|
function initGmTableOne(){
|
|
|
|
|
|
table.render({
|
|
|
|
|
|
id: 'layui_table',
|
|
|
|
|
|
elem: '#gmTable',
|
|
|
|
|
|
url: PATH_URL + '/lineProject/getDetailsPowerList',
|
|
|
|
|
|
where: {
|
|
|
|
|
|
proId: parentData.proId
|
|
|
|
|
|
},
|
|
|
|
|
|
page: true, //开启分页
|
|
|
|
|
|
method:'post',
|
|
|
|
|
|
skin: 'line', // 表格样式
|
|
|
|
|
|
cols: [[
|
|
|
|
|
|
{
|
2024-08-21 21:21:45 +08:00
|
|
|
|
type: 'checkbox',
|
|
|
|
|
|
templet: function(d){
|
|
|
|
|
|
// 根据条件决定是否渲染多选框
|
|
|
|
|
|
return '<input type="checkbox" disabled />';
|
|
|
|
|
|
}
|
2024-08-16 09:20:11 +08:00
|
|
|
|
},
|
|
|
|
|
|
{
|
|
|
|
|
|
title: '序号',
|
|
|
|
|
|
field: 'zizeng',
|
|
|
|
|
|
align: 'center',
|
|
|
|
|
|
type: 'numbers'
|
|
|
|
|
|
},
|
|
|
|
|
|
{field:'gtName', title: '杆塔名称',align: 'center',},
|
|
|
|
|
|
{field:'gtUserName', title: '护线员 (来源:人员合同)',align: 'center',},
|
|
|
|
|
|
]],
|
|
|
|
|
|
done: function(res,curr,count){
|
2024-08-21 21:21:45 +08:00
|
|
|
|
//我这里是封装过talbe所以是res.rows,需要打印出自己的res是什么
|
|
|
|
|
|
for (var i in res.data) {
|
|
|
|
|
|
let item = res.data[i];
|
|
|
|
|
|
if(item.isTower == '1'){
|
|
|
|
|
|
// checkbox 根据条件设置不可选中
|
|
|
|
|
|
$('tr[data-index=' + i + '] input[type="checkbox"]').prop('disabled', true);
|
|
|
|
|
|
//重新渲染
|
|
|
|
|
|
form.render();
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
2024-08-16 09:20:11 +08:00
|
|
|
|
}
|
|
|
|
|
|
});
|
|
|
|
|
|
}
|
2024-07-26 18:15:22 +08:00
|
|
|
|
|
|
|
|
|
|
|
2024-08-16 09:20:11 +08:00
|
|
|
|
// 渲染杆塔表格 双回路
|
|
|
|
|
|
function initGmTableTwo(){
|
|
|
|
|
|
table.render({
|
|
|
|
|
|
id: 'layui_table',
|
|
|
|
|
|
elem: '#gmTable',
|
|
|
|
|
|
url: PATH_URL + '/lineProject/getDetailsPowerList',
|
|
|
|
|
|
where: {
|
|
|
|
|
|
proId: parentData.proId
|
|
|
|
|
|
},
|
|
|
|
|
|
page: true, //开启分页
|
|
|
|
|
|
method:'post',
|
|
|
|
|
|
skin: 'line', // 表格样式
|
|
|
|
|
|
cols: [[
|
|
|
|
|
|
{
|
|
|
|
|
|
type: 'checkbox'
|
|
|
|
|
|
},
|
|
|
|
|
|
{
|
|
|
|
|
|
title: '序号',
|
|
|
|
|
|
field: 'zizeng',
|
|
|
|
|
|
align: 'center',
|
|
|
|
|
|
type: 'numbers'
|
|
|
|
|
|
},
|
|
|
|
|
|
{field:'gtName', title: '杆塔名称',align: 'center',},
|
|
|
|
|
|
{field:'gtUserName', title: '护线员 (来源:人员合同)',align: 'center',},
|
|
|
|
|
|
{field:'gtTwoName', title: '对应双回路杆塔',align: 'center',},
|
|
|
|
|
|
{field:'gtTwoUserName', title: '对应双回路杆塔护线员',align: 'center',},
|
|
|
|
|
|
{
|
|
|
|
|
|
title: '操作(双回路杆塔设置)',
|
|
|
|
|
|
field: '',
|
|
|
|
|
|
align: 'center',
|
|
|
|
|
|
templet: function(d){
|
2024-08-21 19:52:53 +08:00
|
|
|
|
var gtTwoName = d.gtTwoName;
|
|
|
|
|
|
var gtId = d.gtId;
|
|
|
|
|
|
var gtName = d.gtName;
|
|
|
|
|
|
var gtTwoId = d.gtTwoId;
|
|
|
|
|
|
if(gtTwoName == 'null' || gtTwoName == null){
|
|
|
|
|
|
html = `<button class="layui-btn layui-btn-sm layui-bg-orange" onclick="setUpGt('${ gtId }', '${ gtName }')">设置</button>`
|
2024-08-16 09:20:11 +08:00
|
|
|
|
}else{
|
2024-08-21 19:52:53 +08:00
|
|
|
|
html = `<button class="layui-btn layui-btn-sm layui-btn-primary" onclick="cancelGt('${ gtId }', '${ gtTwoId }')">取消</button>`
|
2024-08-16 09:20:11 +08:00
|
|
|
|
}
|
|
|
|
|
|
// 返回模板内容
|
|
|
|
|
|
return html;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
]],
|
|
|
|
|
|
done: function(res,curr,count){
|
2024-08-21 21:21:45 +08:00
|
|
|
|
//我这里是封装过talbe所以是res.rows,需要打印出自己的res是什么
|
|
|
|
|
|
for (var i in res.data) {
|
|
|
|
|
|
let item = res.data[i];
|
|
|
|
|
|
if(item.isTower == '1'){
|
|
|
|
|
|
// checkbox 根据条件设置不可选中
|
|
|
|
|
|
$('tr[data-index=' + i + '] input[type="checkbox"]').prop('disabled', true);
|
|
|
|
|
|
//重新渲染
|
|
|
|
|
|
form.render();
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
2024-08-16 09:20:11 +08:00
|
|
|
|
}
|
2024-07-26 18:15:22 +08:00
|
|
|
|
});
|
|
|
|
|
|
}
|
2024-08-21 19:52:53 +08:00
|
|
|
|
//设置杆塔
|
|
|
|
|
|
function setUpGt(gtId, gtName){
|
|
|
|
|
|
var height = '98%';
|
|
|
|
|
|
var width = '30%';
|
|
|
|
|
|
var index = parent.layer.open({
|
|
|
|
|
|
title: ['选择双回路杆塔', 'color:#3B70A1;background-color:#E8ECEB;font-size:20px'],
|
|
|
|
|
|
type: 2,
|
|
|
|
|
|
content: 'setUpGt.html',
|
|
|
|
|
|
area: [width, height],
|
|
|
|
|
|
maxmin: false,
|
|
|
|
|
|
success: function (layero, index) {
|
|
|
|
|
|
// //打开页面成功时执行
|
|
|
|
|
|
var myIframe = parent.window[layero.find('iframe')[0]['name']];
|
|
|
|
|
|
|
|
|
|
|
|
var proId = $("#proId").val();
|
|
|
|
|
|
var proName = $("#proName").val();
|
|
|
|
|
|
//getTaskSource()为子页面的方法
|
|
|
|
|
|
myIframe.setData(gtId,gtName,proId,proName);
|
|
|
|
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
yes: function (index, layero) {
|
|
|
|
|
|
// //提交子页面时执行
|
|
|
|
|
|
// // 获取弹出层中的form表单元素
|
|
|
|
|
|
// var formSubmit = layer.getChildFrame('form', index);
|
|
|
|
|
|
// var submited = formSubmit.find('button')[0];
|
|
|
|
|
|
// // 触发点击事件,会对表单进行验证,验证成功则提交表单,失败则返回错误信息
|
|
|
|
|
|
// // var myIframe = window[layero.find('iframe')[0]['name']];
|
|
|
|
|
|
// // myIframe.selectCheck(); //aaa()为子页面的方法
|
|
|
|
|
|
// submited.click();
|
|
|
|
|
|
// example.ajax.reload(); // 刷新页面
|
|
|
|
|
|
},
|
|
|
|
|
|
end: function(){
|
|
|
|
|
|
initGmTableTwo();
|
|
|
|
|
|
}
|
|
|
|
|
|
});
|
|
|
|
|
|
}
|
|
|
|
|
|
//取消设置
|
|
|
|
|
|
function cancelGt(gtId, gtTwoId){
|
|
|
|
|
|
var index = layer.confirm("确认取消吗?", { icon: 0 }, function(){
|
|
|
|
|
|
$.ajax({
|
|
|
|
|
|
type: 'POST',
|
|
|
|
|
|
url: PATH_URL + '/lineProject/delGtRelId',
|
|
|
|
|
|
contentType: "application/json; charset=utf-8",
|
|
|
|
|
|
data: JSON.stringify({
|
|
|
|
|
|
gtId: gtId,
|
|
|
|
|
|
gtTwoId: gtTwoId
|
|
|
|
|
|
}),
|
|
|
|
|
|
success: function (data) {
|
|
|
|
|
|
if(data.code == 200){
|
|
|
|
|
|
parent.layer.msg("取消成功", { icon: 1 });
|
|
|
|
|
|
layer.close(index);
|
|
|
|
|
|
initGmTableTwo();
|
|
|
|
|
|
}else{
|
|
|
|
|
|
layer.alert(data.msg);
|
|
|
|
|
|
}
|
|
|
|
|
|
},
|
|
|
|
|
|
error: function (XMLHttpRequest, textStatus, e) {
|
|
|
|
|
|
layer.close(loadingMsg);
|
|
|
|
|
|
layer.msg('数据请求发生异常,请稍后重试', {icon: 16, scrollbar: false});
|
|
|
|
|
|
}
|
|
|
|
|
|
});
|
|
|
|
|
|
})
|
|
|
|
|
|
}
|
2024-07-26 18:15:22 +08:00
|
|
|
|
|
2024-08-16 09:20:11 +08:00
|
|
|
|
|
2024-08-21 19:52:53 +08:00
|
|
|
|
//杆塔信息搜索
|
|
|
|
|
|
function queryClick2(){
|
|
|
|
|
|
// 对表格进行重载。id 即 table表格的id
|
|
|
|
|
|
table.reload('layui_table2', {
|
|
|
|
|
|
// //设定异步数据接口的额外参数
|
|
|
|
|
|
page:{curr : 1}
|
|
|
|
|
|
,where: {
|
|
|
|
|
|
'userName': $("#userName").val()
|
|
|
|
|
|
}
|
|
|
|
|
|
})
|
|
|
|
|
|
}
|
2024-08-16 09:20:11 +08:00
|
|
|
|
|
2024-08-21 19:52:53 +08:00
|
|
|
|
//重置
|
|
|
|
|
|
function resetClick2(){
|
|
|
|
|
|
//重置
|
|
|
|
|
|
$('#userName').val("");
|
|
|
|
|
|
table.reload('layui_table2', {
|
|
|
|
|
|
where: {
|
|
|
|
|
|
'userName': '',
|
|
|
|
|
|
}
|
|
|
|
|
|
})
|
|
|
|
|
|
}
|
2024-07-26 18:15:22 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 渲染人员表格
|
|
|
|
|
|
function initStaffTable(){
|
|
|
|
|
|
table.render({
|
2024-08-21 19:52:53 +08:00
|
|
|
|
id: 'layui_table2',
|
2024-07-26 18:15:22 +08:00
|
|
|
|
elem: '#staffTable',
|
2024-08-21 19:52:53 +08:00
|
|
|
|
url: PATH_URL + "/personbase/getList",
|
|
|
|
|
|
where: {
|
|
|
|
|
|
},
|
|
|
|
|
|
page: true, //开启分页
|
|
|
|
|
|
method:'post',
|
2024-07-26 18:15:22 +08:00
|
|
|
|
skin: 'line', // 表格样式
|
|
|
|
|
|
cols: [[
|
|
|
|
|
|
{
|
|
|
|
|
|
type: 'checkbox'
|
|
|
|
|
|
},
|
|
|
|
|
|
{
|
|
|
|
|
|
title: '序号',
|
|
|
|
|
|
field: 'zizeng',
|
|
|
|
|
|
align: 'center',
|
|
|
|
|
|
type: 'numbers'
|
|
|
|
|
|
},
|
2024-08-21 19:52:53 +08:00
|
|
|
|
{field:'userName', title: '姓 名',align: 'center',width:100},
|
|
|
|
|
|
{field:'idNumber', title: '身份证号',align: 'center',},
|
|
|
|
|
|
{field:'tel', title: '联系电话',align: 'center',width:120},
|
|
|
|
|
|
{field:'proName', title: '管辖线路名称',align: 'center',width:350},
|
|
|
|
|
|
{field:'gtName', title: '范围、基数',align: 'center',width:350},
|
2024-07-26 18:15:22 +08:00
|
|
|
|
{field:'startTime', title: '协议起始日期',align: 'center',width:140},
|
|
|
|
|
|
{field:'endTime', title: '协议终止日期',align: 'center',width:140}
|
|
|
|
|
|
]],
|
2024-08-21 19:52:53 +08:00
|
|
|
|
done: function(res,curr,count){
|
|
|
|
|
|
//checkPermission();
|
|
|
|
|
|
}
|
2024-07-26 18:15:22 +08:00
|
|
|
|
});
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function editProject(){
|
2024-08-28 12:36:09 +08:00
|
|
|
|
var proid=$("#proId").val();
|
|
|
|
|
|
window.parent.updateView(parentData);
|
2024-07-26 18:15:22 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
function projectAddUser(){
|
|
|
|
|
|
var height = '98%';
|
|
|
|
|
|
var width = '90%';
|
|
|
|
|
|
var index = layer.open({
|
|
|
|
|
|
title: ['新增人员', 'color:#3B70A1;background-color:#E8ECEB;font-size:20px'],
|
|
|
|
|
|
type: 2,
|
2024-08-21 14:28:04 +08:00
|
|
|
|
content: '../staff/staffAdd.html',
|
2024-07-26 18:15:22 +08:00
|
|
|
|
area: [width, height],
|
|
|
|
|
|
maxmin: false,
|
|
|
|
|
|
success: function (layero, index) {
|
|
|
|
|
|
// //打开页面成功时执行
|
|
|
|
|
|
var myIframe = window[layero.find('iframe')[0]['name']];
|
|
|
|
|
|
//getTaskSource()为子页面的方法
|
|
|
|
|
|
// myIframe.getTaskSource("taskSourceId","");
|
2024-08-21 14:28:04 +08:00
|
|
|
|
|
2024-07-26 18:15:22 +08:00
|
|
|
|
},
|
|
|
|
|
|
yes: function (index, layero) {
|
|
|
|
|
|
// //提交子页面时执行
|
|
|
|
|
|
// // 获取弹出层中的form表单元素
|
|
|
|
|
|
// var formSubmit = layer.getChildFrame('form', index);
|
|
|
|
|
|
// var submited = formSubmit.find('button')[0];
|
|
|
|
|
|
// // 触发点击事件,会对表单进行验证,验证成功则提交表单,失败则返回错误信息
|
|
|
|
|
|
// // var myIframe = window[layero.find('iframe')[0]['name']];
|
|
|
|
|
|
// // myIframe.selectCheck(); //aaa()为子页面的方法
|
|
|
|
|
|
// submited.click();
|
|
|
|
|
|
// example.ajax.reload(); // 刷新页面
|
|
|
|
|
|
}
|
|
|
|
|
|
});
|
|
|
|
|
|
}
|
2024-08-16 09:20:11 +08:00
|
|
|
|
|
|
|
|
|
|
//导出杆塔信息
|
|
|
|
|
|
function exportData1() {
|
|
|
|
|
|
var keyWord = $("#keyWord").val();
|
|
|
|
|
|
var type = '';
|
|
|
|
|
|
var path = '';
|
|
|
|
|
|
if(parentData.isTwo == '0'){
|
|
|
|
|
|
type = '';
|
|
|
|
|
|
path = 'exportPowerDataOne';
|
|
|
|
|
|
}else{
|
|
|
|
|
|
type = $("#type").val();
|
|
|
|
|
|
path = 'exportPowerDataTwo';
|
|
|
|
|
|
}
|
|
|
|
|
|
var proId = parentData.proId;
|
|
|
|
|
|
|
|
|
|
|
|
window.location.href = PATH_URL + `/lineProject/${path}?token=` + token
|
|
|
|
|
|
+ "&keyWord=" + keyWord
|
|
|
|
|
|
+ "&type=" + type
|
|
|
|
|
|
+ "&proId=" + proId
|
|
|
|
|
|
+ "&proName=" + parentData.proName
|
2024-08-21 19:52:53 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//导出人员信息
|
|
|
|
|
|
function exportData() {
|
|
|
|
|
|
// let search1 = $('#search1').val();
|
|
|
|
|
|
// let search2 = $('#search2').val();
|
|
|
|
|
|
window.location.href = oiPlanUrl + "/monthlyPlanSubmission/export?token=" + token;
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-08-16 09:20:11 +08:00
|
|
|
|
}
|