234 lines
9.2 KiB
HTML
234 lines
9.2 KiB
HTML
|
|
<!DOCTYPE html>
|
|||
|
|
<html lang="en" xmlns="http://www.w3.org/1999/html">
|
|||
|
|
<head>
|
|||
|
|
<meta charset="UTF-8">
|
|||
|
|
<title>历史工程列表</title>
|
|||
|
|
<link rel="stylesheet" href="../../layui-v2.8.18/layui/css/layui.css" media="all"/>
|
|||
|
|
</head>
|
|||
|
|
<style>
|
|||
|
|
.layui-table th{
|
|||
|
|
font-weight: bold;
|
|||
|
|
text-align: center
|
|||
|
|
}
|
|||
|
|
.layui-table td{
|
|||
|
|
text-align: center
|
|||
|
|
}
|
|||
|
|
.layui-btn-sm {
|
|||
|
|
height: 35px;
|
|||
|
|
line-height: 35px;
|
|||
|
|
padding: 0px 10px;
|
|||
|
|
font-size: 16px;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
</style>
|
|||
|
|
<body style="margin-left: 15px">
|
|||
|
|
<form class="layui-form" action="" onsubmit="return false">
|
|||
|
|
<div class="layui-form-item" style="margin-bottom: 0px;">
|
|||
|
|
<div class="layui-inline" style="margin-top: 10px;">
|
|||
|
|
<div class="layui-input-inline">
|
|||
|
|
<input type="text" id="keyWord" placeholder="关键字" autocomplete="off" class="layui-input">
|
|||
|
|
</div>
|
|||
|
|
|
|||
|
|
<div class="layui-input-inline" style="width: 150px;margin-left: 18px;">
|
|||
|
|
<select id="orgId" class="layui-select" lay-search=""></select>
|
|||
|
|
</div>
|
|||
|
|
<div class="layui-input-inline" style="width: 150px;margin-left: 18px;">
|
|||
|
|
<select id="volLevelIds" class="layui-select" lay-search=""></select>
|
|||
|
|
</div>
|
|||
|
|
<div class="layui-input-inline" style="width: 150px;margin-left: 18px;">
|
|||
|
|
<select id="status" name="status" class="form-control input-sm">
|
|||
|
|
<option value="">请选择项目状态</option>
|
|||
|
|
<option value="1">在建</option>
|
|||
|
|
<option value="2">完工</option>
|
|||
|
|
<option value="0">新工程</option>
|
|||
|
|
</select>
|
|||
|
|
</div>
|
|||
|
|
|
|||
|
|
<div class="layui-input-inline" style="width: 150px;margin-left: 18px;">
|
|||
|
|
<input id="timeRange" class="layui-select" placeholder="请选择日期范围" autocomplete="off"/>
|
|||
|
|
</div>
|
|||
|
|
|
|||
|
|
<div class="layui-input-inline" style="width: 70px;margin-top: 2px;margin-left: 50px;">
|
|||
|
|
<button id="searchBt" class="layui-btn layui-btn-sm">查询</button>
|
|||
|
|
</div>
|
|||
|
|
<div class="layui-input-inline" style="width: 70px;margin-top: 2px">
|
|||
|
|
<button id="resetBt" class="layui-btn layui-btn-sm">重置</button>
|
|||
|
|
</div>
|
|||
|
|
<div class="layui-input-inline" style="width: 70px;margin-top: 2px">
|
|||
|
|
<button id="exportBt" class="layui-btn layui-btn-sm">导出</button>
|
|||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
</form>
|
|||
|
|
|
|||
|
|
<table id="demo" lay-filter="test" style="overflow:auto;"></table>
|
|||
|
|
|
|||
|
|
<script type="text/html" id="toolsBar">
|
|||
|
|
<a lay-event="view" style="color: #009688;cursor: pointer;font-size: 15px">详情</a>
|
|||
|
|
</script>
|
|||
|
|
|
|||
|
|
</body>
|
|||
|
|
</html>
|
|||
|
|
<script src="../../js/jquery/jquery-3.6.0.js"></script>
|
|||
|
|
<script src="../../layui-v2.8.18/layui/layui.js"></script>
|
|||
|
|
<script type="text/javascript" src="../../js/jq.js"></script>
|
|||
|
|
<script src="../../js/common_methon.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/my/permission.js"></script>
|
|||
|
|
<script>
|
|||
|
|
|
|||
|
|
let form;
|
|||
|
|
var table;
|
|||
|
|
var laydate;
|
|||
|
|
const token = localStorage.getItem("token");
|
|||
|
|
$("#resetBt").click(function(){
|
|||
|
|
getReleaseData(form,"");
|
|||
|
|
table.reload('menuTable', {
|
|||
|
|
url: ctxPath + '/newPro/getHistoryProList'
|
|||
|
|
, method: 'post' //方式默认是get
|
|||
|
|
, page: true
|
|||
|
|
, where: {
|
|||
|
|
orgId: "",
|
|||
|
|
voltageLevelId: "",
|
|||
|
|
time: "",
|
|||
|
|
startTime: "",
|
|||
|
|
endTime: "",
|
|||
|
|
status: "",
|
|||
|
|
keyWord: "",
|
|||
|
|
} //设定异步数据接口的额外参数
|
|||
|
|
});
|
|||
|
|
getOrgName(form,"");
|
|||
|
|
getVoltageLevel(form,"");
|
|||
|
|
$("#timeRange").val("");
|
|||
|
|
$("#status").val("");
|
|||
|
|
$("#keyWord").val("");
|
|||
|
|
form.render();
|
|||
|
|
})
|
|||
|
|
$("#searchBt").click(function(){
|
|||
|
|
table.reload('menuTable', {
|
|||
|
|
url: ctxPath + '/newPro/getHistoryProList'
|
|||
|
|
, method: 'post' //方式默认是get
|
|||
|
|
, page: true
|
|||
|
|
, where: {
|
|||
|
|
orgId: $("#orgId").val(),
|
|||
|
|
voltageLevelId: $("#volLevelIds").val(),
|
|||
|
|
time: $("#timeRange").val(),
|
|||
|
|
startTime: $("#timeRange").val().substring(0,10),
|
|||
|
|
endTime: $("#timeRange").val().substring(13,23),
|
|||
|
|
status: $("#status").val(),
|
|||
|
|
keyWord: $("#keyWord").val(),
|
|||
|
|
} //设定异步数据接口的额外参数
|
|||
|
|
});
|
|||
|
|
form.render();
|
|||
|
|
})
|
|||
|
|
$("#exportBt").click(function(){
|
|||
|
|
window.location.href = ctxPath + "/newPro/exportHistoryPro?token=" + token
|
|||
|
|
+"&keyWord=" + $("#keyWord").val()
|
|||
|
|
+"&orgId=" + $("#orgId").val()
|
|||
|
|
+"&voltageLevelId=" + $("#volLevelIds").val()
|
|||
|
|
+"&status=" + $("#status").val()
|
|||
|
|
+"&startTime=" + $("#timeRange").val().substring(0,10)
|
|||
|
|
+"&endTime=" + $("#timeRange").val().substring(13,23)
|
|||
|
|
})
|
|||
|
|
layui.use(['table', 'form','laydate'], function () {
|
|||
|
|
table = layui.table;
|
|||
|
|
form = layui.form;
|
|||
|
|
laydate = layui.laydate;
|
|||
|
|
getReleaseData(form,"");
|
|||
|
|
getOrgName(form,"");
|
|||
|
|
getVoltageLevel(form,"");
|
|||
|
|
initTime();
|
|||
|
|
//渲染表格
|
|||
|
|
table.render({
|
|||
|
|
elem: '#demo'
|
|||
|
|
, url: ctxPath + '/newPro/getHistoryProList' //数据接口
|
|||
|
|
|
|||
|
|
, method: 'post' //方式默认是get
|
|||
|
|
, toolbar: 'default' //开启工具栏,此处显示默认图标,可以自定义模板,详见文档
|
|||
|
|
, where: {
|
|||
|
|
releaseData : $("#releaseData").val()
|
|||
|
|
} //post请求必须加where ,post请求需要的参数
|
|||
|
|
, cellMinWidth: 80
|
|||
|
|
, cols: [[ //表头
|
|||
|
|
{
|
|||
|
|
field: 'number', width:80,title: '序号', align: 'center', type: 'numbers'
|
|||
|
|
}
|
|||
|
|
, {field: 'orgName', align: 'center',title: '分公司'}
|
|||
|
|
, {field: 'proName', align: 'center', title: '工程名称'}
|
|||
|
|
, {field: 'voltageLevel', align: 'center', title: '电压等级'}
|
|||
|
|
, {field: 'scale', align: 'center',title: '规模(km) '}
|
|||
|
|
, {field: 'time', align: 'center', title: '开竣工时间'}
|
|||
|
|
, {field: 'status', align: 'center', title: '状态'}
|
|||
|
|
, {fixed: 'right', title: '操作', align: 'center',width: 200, toolbar: '#toolsBar'}
|
|||
|
|
]]
|
|||
|
|
,done: function (res, curr, count) {
|
|||
|
|
}
|
|||
|
|
, id: 'menuTable'
|
|||
|
|
, page: true //开启分页
|
|||
|
|
, loading: true //数据加载中。。。
|
|||
|
|
, limits: [5, 10, 20, 100] //一页选择显示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) {
|
|||
|
|
var data = obj.data; //当前行数据
|
|||
|
|
var rowIndex = obj.index;
|
|||
|
|
var layEvent = obj.event; //当前点击的事件名
|
|||
|
|
if (layEvent === 'view') {
|
|||
|
|
localStorage.setItem("historyProId",data.proId)
|
|||
|
|
layerOpenProgressView("详情","./historyProView.html");
|
|||
|
|
}
|
|||
|
|
});
|
|||
|
|
});
|
|||
|
|
|
|||
|
|
function layerOpenProgressView(title,contentUrl){
|
|||
|
|
var index = layer.open({
|
|||
|
|
title: [title, 'color:#3B70A1;background-color:#E8ECEB;font-size:20px'],
|
|||
|
|
type: 2,
|
|||
|
|
content: contentUrl,
|
|||
|
|
area: ['90%', '95%'],
|
|||
|
|
maxmin: false,
|
|||
|
|
cancel:function (){
|
|||
|
|
localStorage.removeItem("historyProId")
|
|||
|
|
table.reload('menuTable', {
|
|||
|
|
url: ctxPath + '/newPro/getHistoryProList'
|
|||
|
|
, method: 'post' //方式默认是get
|
|||
|
|
, where: {
|
|||
|
|
orgId: "",
|
|||
|
|
voltageLevelId: "",
|
|||
|
|
time: "",
|
|||
|
|
status: "",
|
|||
|
|
keyWord: "",
|
|||
|
|
} //设定异步数据接口的额外参数
|
|||
|
|
});
|
|||
|
|
}
|
|||
|
|
});
|
|||
|
|
}
|
|||
|
|
function initTime(){
|
|||
|
|
// 日期时间范围
|
|||
|
|
laydate.render({
|
|||
|
|
elem: '#timeRange',
|
|||
|
|
range: true
|
|||
|
|
});
|
|||
|
|
}
|
|||
|
|
</script>
|