hn_cloud_web/czl-web/pages/newpro/preReleaseResourceList.html

187 lines
7.6 KiB
HTML
Raw Normal View History

2025-11-27 16:55:35 +08:00
<!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="proName" placeholder="请输入工程名称" autocomplete="off" class="layui-input">
</div>
<div class="layui-input-inline" style="width: 150px;margin-left: 18px;">
<select id="releaseData" class="layui-select" lay-search=""></select>
</div>
<div class="layui-input-inline" style="width: 70px;margin-top: 2px">
<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>
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/select.js"></script>
<script type="text/javascript" src="../../js/my/permission.js"></script>
<script>
2025-12-05 15:39:43 +08:00
const token = localStorage.getItem("czl-token");
2025-11-27 16:55:35 +08:00
let form;
var table;
$("#resetBt").click(function(){
getReleaseData(form,"");
table.reload('menuTable', {
2025-12-09 18:44:29 +08:00
url: czl_ht_url + '/newPro/getReleaseDataList'
2025-11-27 16:55:35 +08:00
, method: 'post' //方式默认是get
, page: true
, where: {
proName: "",
releaseData: $("#releaseData").val(),
} //设定异步数据接口的额外参数
});
$("#proName").val("");
})
$("#searchBt").click(function(){
table.reload('menuTable', {
2025-12-09 18:44:29 +08:00
url: czl_ht_url + '/newPro/getReleaseDataList'
2025-11-27 16:55:35 +08:00
, method: 'post' //方式默认是get
, page: true
, where: {
proName: $("#proName").val(),
releaseData: $("#releaseData").val(),
} //设定异步数据接口的额外参数
});
})
$("#exportBt").click(function(){
2025-12-09 18:44:29 +08:00
window.location.href = czl_ht_url + "/newPro/exportPreReleaseResource?token=" + token
2025-11-27 16:55:35 +08:00
+"&proName=" + $("#proName").val()
+"&releaseData=" + $("#releaseData").val()
})
layui.use(['table', 'form'], function () {
table = layui.table;
form = layui.form;
getReleaseData(form,"");
//渲染表格
table.render({
elem: '#demo'
2025-12-09 18:44:29 +08:00
, url: czl_ht_url + '/newPro/getReleaseDataList' //数据接口
2025-11-27 16:55:35 +08:00
, 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: 'endTime', align: 'center', title: '计划完工时间'}
, {field: 'teamNum', align: 'center',title: '管理团队数量'}
, {field: 'subTeamNum', align: 'center', title: '分包班组'}
, {field: 'basicNum', align: 'center',width: 240, title: '基础班组'}
, {field: 'groupTowerNum', align: 'center', title: '组塔班组'}
, {field: 'lineNum', 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("releaseProId",data.proId)
layerOpenProgressView("详情","./preReleaseResourceView.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("releaseProId")
table.reload('menuTable', {
2025-12-09 18:44:29 +08:00
url: czl_ht_url + '/newPro/getReleaseDataList'
2025-11-27 16:55:35 +08:00
, method: 'post' //方式默认是get
, page: true
, where: {
proName: "",
releaseData: $("#releaseData").val(),
} //设定异步数据接口的额外参数
});
}
});
}
</script>