xs 5 vuotta sitten
vanhempi
commit
989e9b3e77

+ 3 - 1
src/main/webapp/webpage/modules/sg/free/wbslist.jsp

@@ -37,6 +37,9 @@
 </style>
 <body style="background-color: white ;height: 100%">
     <sys:message content="${message}"/>
+    <div style="margin-right: 20px">
+        <a class="layui-btn" href="${ctx}/project/tolist">返回</a>
+    </div>
     <fieldset class="layui-elem-field layui-field-title" style="margin-top: 30px;">
         <legend>结算汇总表</legend>
     </fieldset>
@@ -51,7 +54,6 @@
        <c:forEach items="${map.list1}" var="data1" varStatus="index">
            <input id="type" hidden value="${data1.type}">
          <a class="layui-btn" href="${ctx}/jkxl/export?id=${data1.id}&type=${data1.type}">导出</a>
-           <a class="layui-btn" href="${ctx}/project/tolist">返回</a>
        </c:forEach>
             <%--<table:importExcel url="${ctx}/propertycostreminder/propertyCostReminder/import"></table:importExcel>--%>
         <table id="table1" class="layui-table" lay-filter="table1"></table>

+ 128 - 0
src/main/webapp/webpage/modules/sg/project/addItem2Form.jsp

@@ -0,0 +1,128 @@
+<%--
+  Created by IntelliJ IDEA.
+  User: user
+  Date: 2019/8/19
+  Time: 13:06
+  To change this template use File | Settings | File Templates.
+--%>
+<%@ page contentType="text/html;charset=UTF-8" language="java" %>
+<%@ include file="/webpage/include/taglib.jsp"%>
+<link rel="stylesheet" href="${ctxp}/static/plugin/assets/layui/css/layui.css">
+<link rel="stylesheet" href="${ctxp}/static/plugin/assets/common.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>
+<html>
+<head>
+    <title>添加工程</title>
+    <style>
+        .layui-input{
+            height: 28px;
+            margin-top: 6px;
+        }
+    </style>
+</head>
+<body>
+<div style="padding: 10px; background-color: #F2F2F2;">
+    <div class="layui-row layui-col-space15">
+        <div class="layui-col-md12">
+            <div class="layui-card">
+                <form id="inputForm"class="layui-form" action="${ctx}/project/import" method="post" enctype="multipart/form-data">
+                    <div class="layui-card-body" style="margin-top: 2px;">
+                        <fieldset class="layui-elem-field layui-field-title" style="margin-top: 20px;">
+                            <legend style="font-size: 15px;">选择工程</legend>
+                        </fieldset>
+                        <div class="layui-form-item">
+                            <div class="layui-inline">
+                                <label class="layui-form-label">*工程名称</label>
+                                <div class="layui-input-inline">
+                                    <input type="text" name="" lay-verify="title" class="layui-input">
+                                </div>
+                            </div>
+                        </div>
+                        <fieldset class="layui-elem-field layui-field-title" style="margin-top: 20px;">
+                            <legend style="font-size: 15px;">选择项目</legend>
+                        </fieldset>
+                        <input id="newText1" hidden name="projectId" value=""/>
+                        <div class="layui-form-item">
+                            <div class="layui-inline" style="margin-left:30px;margin-top: 10px;display: flex">
+                                <input type="button" class="layui-btn-primary layui-btn-sm layui-btn-radius" onclick="uploadwj()" value="选择结算文件" id="btnxz"/>
+                                <span id="myspan" style="flex: 1;margin-top: 4px">&nbsp;*结算书文件为博微导出xls/xlsx格式文件</span>
+                                <input type="file" style="display: none;" lay-verify="context" accept=".xls,.xlsx"  name="file" id="myfile"/>
+                            </div>
+                        </div>
+                        <!---------列表---------->
+                        <div class="layui-form-item">
+                            <div class="layui-inline">
+                                <label class="layui-form-label">*项目划分</label>
+                                <div class="layui-input-inline">
+                                    <select name="type" lay-verify="required" lay-search="">
+                                        <option value="">请选择</option>
+                                        <option value="1">架空线路工程</option>
+                                        <option value="2">电缆工程</option>
+                                    </select>
+                                </div>
+                            </div>
+                        </div>
+                        <div class="layui-form-item">
+                            <div class="layui-inline">
+                                <label class="layui-form-label">项目名称</label>
+                                <div class="layui-input-inline">
+                                    <input type="text" name="name"  class="layui-input" id="inputwrite">
+                                </div>
+                            </div>
+                        </div>
+                        <div class="layui-form-item">
+                            <div class="layui-inline">
+                                <label class="layui-form-label">项目编号</label>
+                                <div class="layui-input-inline">
+                                    <input type="text" name="" class="layui-input">
+                                </div>
+                            </div>
+                        </div>
+                        <div class="layui-form-item">
+                            <div class="layui-input-block">
+                                <button class="layui-btn" lay-submit="" lay-filter="mysubmit" type="submit" id="newProject">创建</button>
+                                <button type="reset" class="layui-btn layui-btn-primary">取消</button>
+                            </div>
+                        </div>
+                    </div>
+                </form>
+            </div>
+        </div>
+    </div>
+</div>
+</body>
+<script>
+    layui.use(['form', 'layedit', 'laydate'], function(){
+        var form = layui.form;
+        form.render();
+        //自定义验证规则
+        form.verify({
+            context: function(value){
+                if(value.length <=0){
+                    return '请选择导入的文件';
+                }
+            }
+            ,title: function(value){
+                if(value.length <1){
+                    return '请输入工程名称';
+                }
+            }
+        });
+        var newText1 = parent.$('#addtext').val();
+        $("#newText1").val(newText1);
+    })
+    function doSubmit(obj){//回调函数,在编辑和保存动作时,供openDialog调用提交表单。
+        $("#inputForm").submit();
+    }
+</script>
+<script>
+    $("#btnxz").click(function(){
+        $("#myfile").trigger("click");
+    })
+    $("#myfile").bind("change",function(){
+        var w= $("#myfile").val();
+        $("#myspan").html('&nbsp;'+w);
+    });
+</script>
+</html>

+ 273 - 0
src/main/webapp/webpage/modules/sg/project/manageList.jsp

@@ -0,0 +1,273 @@
+<%--
+  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="">&nbsp;刷新</button>
+                            <button type="button" class="layui-btn layui-btn-warm  layui-btn-meself"  onclick="refresh()"><img class="layui-meself-img1" src="${ctxp}/icon/refush.png" alt="">&nbsp;导出</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>";
+                            }
+                            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>";
+                            }
+
+                            return xml;
+                        }}
+                ]],
+                "data": [
+                    <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.prompt({title: '请输入工程名称', formType: 3}, function(text, index){
+            layer.close(index);
+            $.ajax({
+                type: "post",
+                url: "${ctx}/project/save",
+                data:{projectName:text},
+                dataType: "json",
+                success: function(data){
+                    if(data.success){
+                        layer.msg(data.msg, {icon: 1});
+                        window.location.reload();
+                    }else{
+                        layer.msg('添加失败', {icon: 1});
+                    }
+                }
+            });
+
+        });
+    }
+</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>