123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373 |
- <%--
- Created by IntelliJ IDEA.
- User: user
- Date: 2019/8/16
- Time: 14:49
- To change this template use File | Settings | File Templates.
- --%>
- <%@ page contentType="text/html;charset=UTF-8" language="java" %>
- <%@ include file="/webpage/include/taglib.jsp"%>
- <!DOCTYPE html>
- <html>
- <head>
- <title>工程管理</title>
- <link rel="stylesheet" href="${ctxp}/static/plugin/assets/layui/css/layui.css">
- <link rel="stylesheet" href="${ctxp}/static/plugin/assets/common.css"/>
- <link rel="stylesheet" href="${ctxp}/static/plugin/assets/vermeit.css">
- <script type="text/javascript" src="${ctxp}/static/plugin/assets/jquery-3.2.1.min.js"></script>
- <script src="${ctxp}/static/plugin/assets/layui/layui.js"></script>
- </head>
- <style>
- .layui-input{
- height: 28px;
- margin-top: 5px;
- width: 260px;
- }
- .input-meself-time{
- font-size: 13px;
- width: 140px;
- }
- .btn_out{
- width: 100px;
- margin: 0;
- float: right;
- margin-right:2%;
- }
- .div_main_form{
- width: 50%;
- margin-left: 10px;
- }
- .layui-icon-layer{
- display: none;
- }
- .layui-icon-file{
- display: none;
- }
- .layui-table-view .layui-table {width:100%}
- </style>
- <body style="height:100%">
- <input style="display: none;" id="addtext" value=""/>
- <div class="layui-main-bgc">
- <%--<sys:message content="${message}"/>--%>
- <div class="layui-row layui-col-space15">
- <div class="layui-col-md12">
- <div class="layui-card">
- <div class="layui-card-header layui-card-header-add">工程管理</div>
- <div class="layui-card-body">
- <div class="" style="margin-left: 10px;margin-right: 10px;margin-top: 10px;">
- <div class="layui-btn-group">
- <button type="button" class="layui-btn layui-btn-normal layui-btn-meself" onclick="addProject()"><i class="layui-icon"></i>新建</button>
- <button type="button" class="layui-btn layui-btn-primary layui-btn-meself" onclick="refresh()"><img class="layui-meself-img1" src="${ctxp}/icon/refush.png" alt=""> 刷新</button>
- <button type="button" class="layui-btn layui-btn-warm layui-btn-meself" href="#"><img class="layui-meself-img1" src="${ctxp}/icon/daochu2.png" alt=""> 导出</button>
- </div>
- <table id="table1" class="layui-table" lay-filter="table1"></table>
- </div>
- </div>
- </div>
- </div>
- </div>
- </div>
- <script>
- layui.config({
- base: '${ctxp}/static/plugin/assets/'
- }).extend({
- treetable: 'treetable-lay/treetable'
- }).use(['layer', 'table', 'treetable'], function () {
- var $ = layui.jquery;
- var table = layui.table;
- var layer = layui.layer;
- var treetable = layui.treetable;
- var renderTable1 = function () {
- layer.load(2);
- treetable.render({
- treeColIndex: 0,
- treeSpid: -1,
- treeIdName: 'id',
- treePidName: 'pid',
- treeDefaultClose: false,
- treeLinkage: false,
- elem: '#table1',
- cols: [[
- {field: 'gcmc',width:200,title: '工程名称'},
- {field:'xmsl',width:180,title:"项目数量"},
- {field:'cjsq',width:200,title: '创建时期'},
- {field:'djr',width:200,title:'登记人'},
- {field:'op',align:'center',title:"操作",minWidth:200,templet:function(d){
- ////对操作进行初始化
- var xml = "";
- if(d.status==1){
- <%--xml += "<a class='layui-btn layui-btn-primary layui-btn-xs' onclick=\"look( '${ctx}/project/form?id=" + d.id + "&tabId=1')\">查看</a>"--%>
- <%--+"<a class='layui-btn layui-btn-xs' onclick=\"update( '${ctx}/project/form?id=" + d.id + "&tabId=2')\">修改</a>"--%>
- <%--+"<a class='layui-btn layui-btn-normal layui-btn-xs' lay-event='add'>添加项目</a>";--%>
- xml += "<a class='layui-btn layui-btn-primary layui-btn-xs'>查看</a>"
- +"<a class='layui-btn layui-btn-xs'>修改</a>"
- +"<a class='layui-btn layui-btn-normal layui-btn-xs' lay-event='add'>添加项目</a>";
- }
- if(d.status==2){
- xml +="<span class='myspan'>操作</span>";
- }
- if(d.status==3){
- <%--xml +="<a class='layui-btn layui-btn-xs' href=\"${ctx}/jkxl/list?id="+d.id+"&type="+d.type+"\">编辑</a>";--%>
- xml +="<a class='layui-btn layui-btn-xs'>编辑</a>";
- }
- return xml;
- }}
- ]],
- "data": [
- {
- "id": "1",
- "gcmc":"某线路工程",
- "xmsl": "3",
- "cjsq": "2018/8/14",
- "djr":"home",
- "status":"1",
- "pid": -1
- },
- {
- "id": "2",
- "gcmc":"项目名称",
- "xmsl": "施工单位",
- "cjsq": "项目划分",
- "djr":"创建时间",
- "status":"2",
- "pid": 1
- },
- {
- "id": "7",
- "gcmc":"项目名称",
- "xmsl": "施工单位",
- "cjsq": "项目类型",
- "djr":"创建时间",
- "status":"2",
- "pid": 6
- },
- {
- "id": "3",
- "gcmc":"某项目",
- "xmsl": "某施工单位一",
- "cjsq": "架空线路",
- "djr":"2018/8/14",
- "status":"3",
- "pid": 2
- },
- {
- "id": "4",
- "gcmc":"某项目",
- "xmsl": "某施工单位一",
- "cjsq": "架空线路",
- "djr":"2018/8/14",
- "status":"3",
- "pid": 2
- },
- {
- "id": "5",
- "gcmc":"某项目",
- "xmsl": "某施工单位一",
- "cjsq": "架空线路",
- "djr":"2018/8/14",
- "status":"3",
- "pid": 2
- },
- {
- "id": "6",
- "gcmc":"某线路工程二",
- "xmsl": "1",
- "cjsq": "2018/8/15",
- "djr":"home1",
- "status":"1",
- "pid": -1
- },
- {
- "id": "8",
- "gcmc":"某项目",
- "xmsl": "某施工单位一",
- "cjsq": "架空线路",
- "djr":"2018/8/14",
- "status":"3",
- "pid": 7
- },
- {
- "id": "9",
- "gcmc":"某项目",
- "xmsl": "某施工单位一",
- "cjsq": "架空线路",
- "djr":"2018/8/14",
- "status":"3",
- "pid": 7
- },
- <%--<c:if test="${ not empty list}">--%>
- <%--<c:forEach items="${list}" var="data" varStatus="index">--%>
- <%--{--%>
- <%--"id": "${data.id}",--%>
- <%--"gcmc":"${data.projectName}",--%>
- <%--"xmsl": "${data.number}",--%>
- <%--"cjsq": "<fmt:formatDate value="${data.createDate}" pattern="yyyy/MM/dd"/>",--%>
- <%--"djr":"${data.userName}",--%>
- <%--"status":"1",--%>
- <%--"pid": -1--%>
- <%--},--%>
- <%--{--%>
- <%--"id": "2",--%>
- <%--"gcmc":"项目名称",--%>
- <%--"xmsl": "施工单位",--%>
- <%--"cjsq": "项目划分",--%>
- <%--"djr":"创建时间",--%>
- <%--"status":"2",--%>
- <%--"pid": "${data.id}"--%>
- <%--},--%>
- <%--</c:forEach>--%>
- <%--</c:if>--%>
- <%--<c:forEach items="${list}" var="item" varStatus="index">--%>
- <%--<c:forEach items="${item.wbsItems}" var="items" varStatus="index">--%>
- <%--{--%>
- <%--"id": "${items.id}",--%>
- <%--"type":"${items.type}",--%>
- <%--"gcmc":"${items.itemName}",--%>
- <%--"xmsl": "某施工单位一",--%>
- <%--<%–"cjsq": <c:if test="${items.type eq '1'}">"架空线路"</c:if><c:if test="${items.type eq '2'}">"电缆线路"</c:if>,–%>--%>
- <%--"cjsq":<c:if test="${items.type eq '1'}">"架空线路"</c:if><c:if test="${items.type eq '2'}">"电缆线路"</c:if>,--%>
- <%--"djr":"<fmt:formatDate value="${items.createDate}" pattern="yyyy/MM/dd"/>",--%>
- <%--"status":"3",--%>
- <%--"pid": "${items.projectId}"--%>
- <%--},--%>
- <%--</c:forEach>--%>
- <%--</c:forEach>--%>
- ],
- done: function () {
- $(".myspan").closest("tr").css('background-color','#f2f2f2');
- layer.closeAll('loading');
- }
- });
- };
- renderTable1();
- treetable.foldAll('#table1');
- table.on('tool(table1)', function(obj,target){
- var data = obj.data;
- //console.log(obj)
- if(obj.event == 'add'){
- $("#addtext").val(data.id);
- layui.use(['table','layer'],function(){
- layer.open({
- type: 2,
- title: '添加工程',
- area: ['40%', '80%'],
- shade: 0.8,
- shadeClose: true,
- content: '${ctxp}/webpage/modules/sg/project/addItemForm.jsp'
- , btn: ['确定','关闭']
- ,yes: function(index, layero){
- // var bodyparent = layer.getChildFrame('body', index);
- // bodyparent.find('#newProject').click();
- var body = layer.getChildFrame('body', index);
- var iframeWin = layero.find('iframe')[0]; //得到iframe页的窗口对象,执行iframe页的方法:iframeWin.method();
- var inputForm = body.find('#inputForm');
- var top_iframe;
- if(target){
- top_iframe = target;//如果指定了iframe,则在改frame中跳转
- }else{
- top_iframe = top.getActiveTab().attr("name");//获取当前active的tab的iframe
- }
- inputForm.attr("target",top_iframe);//表单提交成功后,从服务器返回的url在当前tab中展示
- iframeWin.contentWindow.doSubmit();
- layer.close(index);//关闭对话框。
- }
- ,btn2: function(index, layero){
- layer.close(index);
- }
- })
- })
- }
- });
- });
- </script>
- <script>
- function refresh(){
- window.location.reload();
- }
- function addProject(){
- layer.open({
- type: 2,
- title: '添加工程',
- area: ['43%', '90%'],
- shade: 0.8,
- shadeClose: true,
- content: '${ctxp}/webpage/modules/sg/project/addItem2Form.jsp'
- , btn: ['确定','关闭']
- ,yes: function(index, layero){
- // var bodyparent = layer.getChildFrame('body', index);
- // bodyparent.find('#newProject').click();
- var body = layer.getChildFrame('body', index);
- var iframeWin = layero.find('iframe')[0]; //得到iframe页的窗口对象,执行iframe页的方法:iframeWin.method();
- var inputForm = body.find('#inputForm');
- var top_iframe;
- if(target){
- top_iframe = target;//如果指定了iframe,则在改frame中跳转
- }else{
- top_iframe = top.getActiveTab().attr("name");//获取当前active的tab的iframe
- }
- inputForm.attr("target",top_iframe);//表单提交成功后,从服务器返回的url在当前tab中展示
- iframeWin.contentWindow.doSubmit();
- layer.close(index);//关闭对话框。
- }
- ,btn2: function(index, layero){
- layer.close(index);
- }
- })
- }
- </script>
- <script>
- function look(url) {
- layer.open({
- type: 2,
- title: '查看',
- area: ['70%', '90%'],
- shade: 0.8,
- shadeClose: true,
- fixed: true, //不固定
- maxmin: true,
- content: url
- , btn: ['关闭']
- })
- }
- function update(url) {
- layer.open({
- type: 2,
- title: '修改工程',
- area: ['70%', '90%'],
- shade: 0.8,
- shadeClose: true,
- fixed: false, //不固定
- maxmin: true,
- content: url
- , btn: ['确定','关闭']
- ,yes: function(index, layero){
- var bodyparent = layer.getChildFrame('body', index);
- bodyparent.find('#updatebtn').click();
- }
- ,btn2: function(index, layero){
- layer.close(index);
- }
- })
- }
- </script>
- <script>
- $(document).ready(function(e) {
- $("#noneBtn").click(function(e) {
- $("#noneDiv").toggle(400);
- });
- });
- </script>
- </body>
- </html>
|