2025-11-27 16:55:35 +08:00
|
|
|
|
$(function() {
|
|
|
|
|
|
initTable();
|
|
|
|
|
|
})
|
|
|
|
|
|
function responseHandler(res) {
|
|
|
|
|
|
console.log(res);
|
|
|
|
|
|
var datas=[];
|
|
|
|
|
|
console.log(res.total);
|
|
|
|
|
|
datas.push({total:res.total,rows:res.list});
|
|
|
|
|
|
return datas[0];
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
function initTable() {
|
|
|
|
|
|
//初始化Table
|
|
|
|
|
|
$("#table").bootstrapTable({
|
|
|
|
|
|
classes: 'table table-hover',
|
2025-12-09 18:44:29 +08:00
|
|
|
|
url: smz_web_url + 'proInfo/getProCountList',
|
2025-11-27 16:55:35 +08:00
|
|
|
|
method: 'post',
|
|
|
|
|
|
responseHandler: responseHandler, //处理服务器返回的数据格式
|
|
|
|
|
|
height: $(window).height() - ($(window).height() * 0.13),
|
|
|
|
|
|
undefinedText: '', //当数据为 undefined 时显示的字符
|
|
|
|
|
|
queryParams: function(param) {
|
|
|
|
|
|
param = {
|
|
|
|
|
|
companyId: localStorage.getItem("companyId"),
|
|
|
|
|
|
keyWord:$("#keyWord").val(),
|
|
|
|
|
|
pageSize: param.limit,
|
|
|
|
|
|
pageNum: param.offset / param.limit + 1,
|
|
|
|
|
|
sort: param.sort, //排序列名
|
|
|
|
|
|
sortOrder: param.order //排位命令(desc,asc)
|
|
|
|
|
|
}
|
|
|
|
|
|
return param;
|
|
|
|
|
|
},
|
|
|
|
|
|
sortable: true, //是否启用排序
|
|
|
|
|
|
sortOrder: "asc", //排序方式
|
|
|
|
|
|
cache: false, //是否使用缓存,默认为true,所以一般情况下需要设置一下这个属性(*)
|
|
|
|
|
|
pagination: true,
|
|
|
|
|
|
pageNumber: 1,
|
|
|
|
|
|
pageSize: 5,
|
|
|
|
|
|
pageList: [5,10],
|
|
|
|
|
|
smartDisplay: false,
|
|
|
|
|
|
showColumns: false,
|
|
|
|
|
|
sidePagination: "server", //分页方式:client客户端分页,server服务端分页(*)
|
|
|
|
|
|
contentType: "application/x-www-form-urlencoded",
|
|
|
|
|
|
minimumCountColumns: 2, //最少允许的列数
|
|
|
|
|
|
uniqueId: "no", //每一行的唯一标识,一般为主键列
|
|
|
|
|
|
columns: [
|
|
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
title: '序号',
|
|
|
|
|
|
formatter: function(value, row, index) {
|
|
|
|
|
|
return index + 1;
|
|
|
|
|
|
},
|
|
|
|
|
|
rowspan: 1,
|
|
|
|
|
|
align: 'center',
|
|
|
|
|
|
valign: 'middle',
|
|
|
|
|
|
width: 50
|
|
|
|
|
|
},
|
|
|
|
|
|
{
|
|
|
|
|
|
title: '公司名称',
|
|
|
|
|
|
field: 'orgName',
|
|
|
|
|
|
rowspan: 1,
|
|
|
|
|
|
align: 'center',
|
|
|
|
|
|
valign: 'middle',
|
|
|
|
|
|
sortable: true,
|
|
|
|
|
|
width: 150
|
|
|
|
|
|
},
|
|
|
|
|
|
{
|
|
|
|
|
|
title: '工程名称',
|
|
|
|
|
|
field: 'name',
|
|
|
|
|
|
rowspan: 1,
|
|
|
|
|
|
align: 'center',
|
|
|
|
|
|
valign: 'middle',
|
|
|
|
|
|
sortable: true,
|
|
|
|
|
|
width: 200
|
|
|
|
|
|
},
|
|
|
|
|
|
{
|
|
|
|
|
|
title: '工程类型',
|
|
|
|
|
|
field: 'proType',
|
|
|
|
|
|
rowspan: 1,
|
|
|
|
|
|
align: 'center',
|
|
|
|
|
|
valign: 'middle',
|
|
|
|
|
|
sortable: true,
|
|
|
|
|
|
width: 100
|
|
|
|
|
|
},
|
|
|
|
|
|
{
|
|
|
|
|
|
title: '电压等级',
|
|
|
|
|
|
field: 'voltageLevel',
|
|
|
|
|
|
rowspan: 1,
|
|
|
|
|
|
align: 'center',
|
|
|
|
|
|
valign: 'middle',
|
|
|
|
|
|
sortable: true,
|
|
|
|
|
|
width: 100
|
|
|
|
|
|
},
|
|
|
|
|
|
{
|
|
|
|
|
|
title: '项目地址',
|
|
|
|
|
|
field: 'origin',
|
|
|
|
|
|
rowspan: 1,
|
|
|
|
|
|
align: 'center',
|
|
|
|
|
|
valign: 'middle',
|
|
|
|
|
|
sortable: true,
|
|
|
|
|
|
width: 150
|
|
|
|
|
|
},
|
|
|
|
|
|
{
|
|
|
|
|
|
title: '所属电网',
|
|
|
|
|
|
field: 'powerGrid',
|
|
|
|
|
|
// formatter: function(value, row, index) {
|
|
|
|
|
|
// var trainType = '';
|
|
|
|
|
|
// if(row.trainType != null && row.trainType != ''){
|
|
|
|
|
|
// if(row.trainType == '1'){
|
|
|
|
|
|
// trainType = '未完成';
|
|
|
|
|
|
// }else if(row.trainType == '2'){
|
|
|
|
|
|
// trainType = '完成';
|
|
|
|
|
|
// }else{
|
|
|
|
|
|
// trainType = '状态错误';
|
|
|
|
|
|
// }
|
|
|
|
|
|
// }
|
|
|
|
|
|
// return trainType;
|
|
|
|
|
|
// },
|
|
|
|
|
|
rowspan: 1,
|
|
|
|
|
|
align: 'center',
|
|
|
|
|
|
valign: 'middle',
|
|
|
|
|
|
sortable: true,
|
|
|
|
|
|
width: 100
|
|
|
|
|
|
},
|
|
|
|
|
|
{
|
|
|
|
|
|
title: '项目状态',
|
|
|
|
|
|
field: 'status',
|
|
|
|
|
|
rowspan: 1,
|
|
|
|
|
|
align: 'center',
|
|
|
|
|
|
valign: 'middle',
|
|
|
|
|
|
sortable: true,
|
|
|
|
|
|
width: 100
|
|
|
|
|
|
}
|
|
|
|
|
|
],
|
|
|
|
|
|
onLoadSuccess: function(data) {
|
|
|
|
|
|
top.layer.close(index);
|
|
|
|
|
|
$("#dataCount").html("数量:" + data.total);
|
|
|
|
|
|
},
|
|
|
|
|
|
onLoadError: function() {
|
|
|
|
|
|
$("#dataCount").html("数量:0");
|
|
|
|
|
|
$("#table").bootstrapTable('removeAll');
|
|
|
|
|
|
top.layer.close(index);
|
|
|
|
|
|
},
|
|
|
|
|
|
});
|
|
|
|
|
|
}
|
|
|
|
|
|
var index;
|
|
|
|
|
|
// 模糊查询数据、重置查询
|
|
|
|
|
|
function query(type) {
|
|
|
|
|
|
index = top.layer.load(1, {
|
|
|
|
|
|
shade: false
|
|
|
|
|
|
}); // 0代表加载的风格,支持0-2
|
|
|
|
|
|
var keyWord = $("#keyWord").val();
|
|
|
|
|
|
$("#query").css("background-image", "url(../../img/info/queryClick.png)");
|
|
|
|
|
|
$("#reset").css("background-image", "url(../../img/info/resetQuery.png)");
|
|
|
|
|
|
var opt = {
|
2025-12-09 18:44:29 +08:00
|
|
|
|
url: smz_web_url + 'proInfo/getProCountList',
|
2025-11-27 16:55:35 +08:00
|
|
|
|
silent: true,
|
|
|
|
|
|
query: {
|
|
|
|
|
|
keyWord: keyWord
|
|
|
|
|
|
}
|
|
|
|
|
|
};
|
|
|
|
|
|
if (type == 2) {
|
|
|
|
|
|
$("#query").css("background-image", "url(../../img/info/query.png)");
|
|
|
|
|
|
$("#reset").css("background-image", "url(../../img/info/resetQueryClick.png)");
|
|
|
|
|
|
$("#keyWord").val("");
|
|
|
|
|
|
opt = {
|
2025-12-09 18:44:29 +08:00
|
|
|
|
url: smz_web_url + 'proInfo/getProCountList',
|
2025-11-27 16:55:35 +08:00
|
|
|
|
silent: true,
|
|
|
|
|
|
};
|
|
|
|
|
|
}
|
|
|
|
|
|
$("#table").bootstrapTable('refresh', opt);
|
|
|
|
|
|
initTable();
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
function showMiurInsurance(proId){
|
|
|
|
|
|
// alert(proId);
|
|
|
|
|
|
$.ajax({
|
|
|
|
|
|
type: 'POST',
|
2025-12-09 18:44:29 +08:00
|
|
|
|
url: smz_web_url + 'proInfo/showRst',
|
2025-11-27 16:55:35 +08:00
|
|
|
|
data: {
|
|
|
|
|
|
'id' : proId,
|
|
|
|
|
|
},
|
|
|
|
|
|
dataType: "json",
|
|
|
|
|
|
async: false,
|
|
|
|
|
|
success: function(data) {
|
|
|
|
|
|
console.log(data);
|
|
|
|
|
|
// window.location.href=data.obj;
|
|
|
|
|
|
window.open(data.obj,"_self");
|
|
|
|
|
|
}
|
|
|
|
|
|
});
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|