hn_cloud_web/czl-screen/pages/home/z_projectList.html

328 lines
12 KiB
HTML
Raw Permalink Normal View History

2025-11-27 16:55:35 +08:00
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>工程信息</title>
<!--<link rel="stylesheet" type="text/css" media="screen" href="../../css/bootstrap.min.css">-->
<!--<link rel="stylesheet" type="text/css" media="screen" href="../../css/dataTables.bootstrap.min.css">-->
<link rel="stylesheet" type="text/css" media="screen" href="../../layui/css/layui.css">
<link rel="stylesheet" href="../../css/mainList.css">
<style type="text/css">
/*.table-bordered, .table-bordered>tbody>tr>td, .table-bordered>tbody>tr>th, .table-bordered>tfoot>tr>td, .table-bordered>tfoot>tr>th, .table-bordered>thead>tr>td, .table-bordered>thead>tr>th {*/
/* border: 0px solid #ddd;*/
/*}*/
th {
text-align: center;
}
.layui-table-tool {
display: none;
}
.layui-table thead th {
background-color: #0A2559;
color: white;
border: 0px;
}
.layui-table-cell {
color: white;
}
/*.layui-laydate-content>table>tbody>tr>td{*/
/* background-color: white;*/
/*}*/
#layui-laydate1 {
left: 534.578px;
top: 171.484px;
background: #020B31;
color: white;
}
.laydate-footer-btns span {
height: 26px;
line-height: 26px;
margin: 0 0 0 -1px;
padding: 0 10px;
border: 1px solid #C9C9C9;
background-color: #020B31 !important;
white-space: nowrap;
vertical-align: top;
border-radius: 2px;
}
.layui-btn {
background-color: #2a91d3;
}
.layui-btn-sm {
height: 36px;
line-height: 30px;
padding: 0 10px;
font-size: 12px;
width: 75px;
border-radius: 9px;
}
.clickable-text {
cursor: pointer;
}
.layui-table-view {
overflow-y: auto;
height: 80%;
}
.layui-table-fixed-r {
right: -150px !important;
}
</style>
</head>
<body>
<div class="figure">
<div class="figures">
<div style="padding-top: 5%;">
<img src="../../img/home/name.png" style="margin-left: 20%; margin-top: -2%;">
<span style="font-size: 18px;color: #ffffff;" id="returnPage">工程信息</span>
</div>
</div>
</div>
<div class="time" id="nowTime"></div>
<div class="tou" style="padding: 10px">
<div class="head centers clickable-text">
线路承载力看板
</div>
<form class="layui-form" action="" onsubmit="return false">
<div style="height: 7%;width: 100%;margin-top: 2%;">
<div class="layui-input-inline">
<input type="text" id="keyWord" placeholder="请输入工程名称" autocomplete="off" class="layui-input">
</div>
<div class="layui-input-inline" style="width: 162px;margin-left: 18px;">
<select id="volLevelIds" name="volLevelIds" class="layui-select" lay-search=""></select>
</div>
<div class="layui-input-inline" style="width: 150px;margin-left: 18px;">
<select id="orgId" name="orgId" class="layui-select" lay-search=""></select>
</div>
<div class="layui-input-inline">
<input type="text" class="layui-input" lay-search="" id="time" style="width: 220px"
placeholder="选择完工日期范围">
</div>
<div class="layui-input-inline" style="width: 150px;margin-left: 18px;">
<select id="proStatus" name="proStatus" class="form-control input-sm">
<option value="">选择状态</option>
<option value="1">在建</option>
<option value="2">已完工</option>
</select>
</div>
<div class="layui-input-inline" style="width: 70px;margin-top: 1px;margin-left: 16px;">
<button id="searchBt" class="layui-btn layui-btn-sm" style="border-radius: 9px;">
<i class="layui-icon layui-icon-search"></i> 查询
</button>
</div>
<div class="layui-input-inline" style="width: 70px;margin-top: 1px;margin-left: 16px;">
<button id="exportBt" class="layui-btn layui-btn-sm" style="border-radius: 9px;">
导出
</button>
</div>
</div>
</form>
<table id="demo" lay-filter="test"></table>
<script type="text/html" id="toolsBar">
<i lay-event="view_message" class="layui-icon">&#xe615;</i>
</script>
</div>
</body>
</html>
2025-12-09 18:44:29 +08:00
<script type="text/javascript" src="../../../public/public.js"></script>
2025-11-27 16:55:35 +08:00
<script type="text/javascript" src="../../js/publicJs.js"></script>
<script type="text/javascript" src="../../js/libs/jquery.min.js"></script>
<script type="text/javascript" src="../../js/jq.js"></script>
<!--<script type="text/javascript" src="../../js/plugin/datatables/jquery.dataTables.min.js"></script>-->
<!--<script type="text/javascript" src="../../js/plugin/datatables/dataTables.bootstrap.min.js"></script>-->
<script type="text/javascript" src="../../js/my/permission.js"></script>
<script type="text/javascript" src="../../js/layui-v2.8.18/layui/layui.js"></script>
<script type="text/javascript" src="../../js/publicJs.js"></script>
<script type="text/javascript" src="../../js/select.js"></script>
<script type="text/javascript" src="../../js/dict.js"></script>
<script type="text/javascript">
var layer;
var table;
var laydate;
2025-12-05 15:39:43 +08:00
const token = localStorage.getItem("czldp-token");
2025-11-27 16:55:35 +08:00
const ds_pro_status = localStorage.getItem("ds_pro_status");
layui.use(['layer', 'table', 'form', 'laydate'], function () {
layer = layui.layer;
table = layui.table;
form = layui.form;
laydate = layui.laydate;
2025-12-05 15:39:43 +08:00
const token = localStorage.getItem("czldp-token");
2025-11-27 16:55:35 +08:00
setInterval(function () {
$("#nowTime").text(getNowTime())
}, 1000);
//渲染表格
table.render({
elem: '#demo'
2025-12-09 18:44:29 +08:00
, url: czl_url + '/dataDetail/getProjectDetailMessage' //数据接口
2025-11-27 16:55:35 +08:00
, method: 'post' //方式默认是get
, toolbar: 'default' //开启工具栏,此处显示默认图标,可以自定义模板,详见文档
, where: {
status: ds_pro_status
} //post请求必须加where post请求需要的参数
, cellMinWidth: 80
, cols: [[ //表头
{
field: 'number', width: 80, title: '序号', align: 'center', type: 'numbers'
}
, { field: 'name', width: 400, align: 'center', title: '工程名称' }
, { field: 'voltageLevel', width: 200, align: 'center', title: '电压等级' }
, { field: 'lineLength', width: 200, align: 'center', title: '线路长度' }
, { field: 'towerNum', width: 200, align: 'center', title: '杆塔数量' }
, { field: 'startTime', width: 200, align: 'center', title: '计划开工日期' }
, { field: 'endTime', width: 200, align: 'center', title: '计划完工日期' }
, { field: 'orgName', width: 300, align: 'center', title: '所属分公司' }
, { fixed: 'right', title: '操作', align: 'center', toolbar: '#toolsBar' }
]]
, id: 'menuTable'
, page: true //开启分页
, loading: true //数据加载中。。。
, limits: [5, 10, 20] //一页选择显示3,5或10条数据
, limit: 10 //一页显示5条数据
, response: {
statusCode: 200 //规定成功的状态码默认0
}, parseData: function (res) { //将原始数据解析成 table 组件所规定的数据res为从url中get到的数据
let result;
if (res.data !== '' && res.data != null && res.data !== "null") {
if (this.page.curr) {
result = res.data.slice(this.limit * (this.page.curr - 1), this.limit * this.page.curr);
} else {
result = res.data.slice(0, this.limit);
}
}
return {
"code": res.code, //解析接口状态
"msg": res.msg, //解析提示文本
"count": res.count, //解析数据长度
"data": result, //解析数据列表
};
},
toolbar: "#toolbar"
});
//监听工具条
table.on('tool(test)', function (obj) {
let layEvent = obj.event; //当前点击的事件名
let data = obj.data; //当前行数据
if (layEvent === 'view_message') {
let id = data.id;
let lon = data.lon;
let lat = data.lat;
let cityName = data.cityName;
localStorage.setItem("proId", id);
localStorage.setItem("selectLon", lon);
localStorage.setItem("selectLat", lat);
localStorage.setItem("cityName", cityName);
window.location.href = "./schedule.html";
}
});
laydate.render({
elem: '#time',
range: true,
value: '' // 设置默认值为当天
});
getOrgName(form, '');
getVoltageLevel(form, '');
$("#proStatus").val(ds_pro_status);
form.render();
});
var userStatus = showDictSelect("status", "userStatus", true);
var pers = checkPermission();
var example;
$("#returnPage").click(function () {
window.history.go(-1);
});
// $("#searchBt").click(function () {
// example.ajax.reload();
// });
$("#searchBt").click(function () {
oldKeyWord = $("#keyWord").val();
volLevel = $("#volLevelIds").val();
orgId = $("#orgId").val();
time = $("#time").val();
proStatus = $("#proStatus").val();
var parts = time.split(' - ');
var startTime = parts[0];
var endTime = parts[1];
table.reload('menuTable', {
2025-12-09 18:44:29 +08:00
url: czl_url + '/dataDetail/getProjectDetailMessage'
2025-11-27 16:55:35 +08:00
, method: 'post' //方式默认是get
, page: true
, where: {
name: oldKeyWord,
orgId: orgId,
status: proStatus,
voltageLevel: volLevel,
startTime: startTime,
endTime: endTime,
} //设定异步数据接口的额外参数
});
$("#keyWord").val(oldKeyWord);
$("#orgId").val(orgId);
$("#volLevelIds").val(volLevel);
$("#proStatus").val(proStatus);
$("#time").val(time);
});
$("#exportBt").click(function () {
name = $("#keyWord").val();
volLevelIds = $("#volLevelIds").val();
proStatus = $("#proStatus").val();
orgId = $("#orgId").val();
time = $("#time").val();
var parts = time.split(' - ');
var startTime = parts[0];
var endTime = parts[1];
window.location.href = pagesPath + "/dataDetail/exportPhysicalCheckResult?"
+ "name=" + name
+ "&volLevelIds=" + volLevelIds
+ "&orgId=" + orgId
+ "&status=" + proStatus
+ "&startTime=" + startTime
+ "&endTime=" + endTime
+ "&type=" + '1'
+ "&token=" + token; //下载文件
})
function getNowDay() {
var time = new Date();
var year = time.getFullYear();
var month = time.getMonth() + 1 >= 10 ? time.getMonth() + 1 : '0' + (time.getMonth() + 1);
var day = time.getDate() >= 10 ? time.getDate() : '0' + time.getDate();
return year + "-" + month + "-" + day;
}
$(document).ready(function () {
$(".clickable-text").on("click", function () {
window.location.href = "./home.html";
});
});
</script>