瀏覽代碼

Merge branch 'master' of http://192.168.2.4:3000/chengqiang/sg_finalAcountAuto

# Conflicts:
#	src/main/webapp/webpage/modules/sg/project/management.jsp
xs 5 年之前
父節點
當前提交
ed48ab6d81

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

@@ -411,8 +411,8 @@
                 layer.open({
                     type: 1,
                     title:data.entryName,
-                    skin: 'layui-layer-rim',
-                    area: ['420px', '240px'],
+                    // skin: 'layui-layer-rim',
+                    area: ['50%', '50%'],
                     content: data.reason
                 });
             }

+ 27 - 42
src/main/webapp/webpage/modules/sg/project/management.jsp

@@ -45,7 +45,7 @@
         width: 90px;
     }
 </style>
-<body>
+<body style="height: 100%">
 <input style="display: none;" id="addtext" value=""/>
 <div style="padding: 20px; background-color: #F2F2F2;">
     <div class="layui-row layui-col-space15">
@@ -195,6 +195,7 @@
                             if(d.status==1){
                                 xml += "<a class='layui-btn layui-btn-primary layui-btn-xs' lay-event='look'>查看</a>"
                                     +"<a class='layui-btn layui-btn-xs' lay-event='update'>修改</a>"
+                                    +"<a class='layui-btn layui-btn-normal layui-btn-xs' onclick='add()'>添加项目</a>"
                                     +"<a class='layui-btn layui-btn-normal layui-btn-xs' lay-event='add'>添加项目</a>"
                                     +"<a class='layui-btn layui-btn-warm layui-btn-xs' lay-event=''>导出</a>";
                             }
@@ -229,19 +230,6 @@
                         "status":"2",
                         "pid": "${data.id}"
                     },
-                    <%--<c:if test="${ not empty data.wbsItems}">--%>
-                    <%--<c:forEach items="${data.wbsItems}" var="items" varStatus="index">--%>
-                    <%--{--%>
-                    <%--"id": "${items.id}",--%>
-                    <%--"gcmc":"${items.itemName}",--%>
-                    <%--"xmsl": "某施工单位一",--%>
-                    <%--"cjsq": "架空线路",--%>
-                    <%--"djr":"<fmt:formatDate value="${items.updateDate}" pattern="yyyy-MM-dd hh:mm:ss"/>",--%>
-                    <%--"status":"3",--%>
-                    <%--"pid": "${items.projectId}"--%>
-                    <%--},--%>
-                    <%--</c:forEach>--%>
-                    <%--</c:if>--%>
                     </c:forEach>
                     </c:if>
                     <c:forEach items="${list}" var="item" varStatus="index">
@@ -269,9 +257,32 @@
             var data = obj.data;
             //console.log(obj)
             if(obj.event == 'look'){
-                alert("查看");
+                layer.open({
+                    type: 2,
+                    title: '添加工程',
+                    area: ['60%', '80%'],
+                    shade: 0.8,
+                    shadeClose: true,
+                    content: '${ctxp}/webpage/modules/sg/project/lookItemForm.html'
+                    , btn: ['关闭']
+                })
             }else if(obj.event == 'update'){
-                alert("修改");
+                layer.open({
+                    type: 2,
+                    title: '添加工程',
+                    area: ['60%', '80%'],
+                    shade: 0.8,
+                    shadeClose: true,
+                    content: '${ctxp}/webpage/modules/sg/project/updateItemForm.html'
+                    , btn: ['确定','关闭']
+                    ,yes: function(index, layero){
+                        var bodyparent = layer.getChildFrame('body', index);
+                        bodyparent.find('#updatebtn').click();
+                    }
+                    ,btn2: function(index, layero){
+                        layer.close(index);
+                    }
+                })
             }else if(obj.event == 'add'){
                 $("#addtext").val(data.id);
                 layui.use(['table','layer'],function(){
@@ -293,8 +304,6 @@
                         }
                     })
                 })
-            }else if(obj.event =='update1'){
-                alert("编辑");
             }
         });
     });
@@ -324,29 +333,5 @@
         });
     }
 </script>
-<%--<script>--%>
-    <%--function add(result){--%>
-        <%--$("#addtext").val(result);--%>
-        <%--layui.use(['table','layer'],function(){--%>
-            <%--layer.open({--%>
-                <%--type: 2,--%>
-                <%--title: '添加工程',--%>
-                <%--area: ['60%', '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();--%>
-
-                <%--}--%>
-                <%--,btn2: function(index, layero){--%>
-                    <%--layer.close(index);--%>
-                <%--}--%>
-            <%--})--%>
-        <%--})--%>
-    <%--}--%>
-<%--</script>--%>
 </body>
 </html>

+ 119 - 2
src/main/webapp/webpage/modules/sg/project/updateItemForm.jsp

@@ -6,11 +6,128 @@
   To change this template use File | Settings | File Templates.
 --%>
 <%@ page contentType="text/html;charset=UTF-8" language="java" %>
+<%@ include file="/webpage/include/taglib.jsp"%>
 <html>
 <head>
-    <title>$Title$</title>
+    <title>修改</title>
+    <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>
 </head>
+<style>
+    .layui-input{
+        height: 28px;
+        margin-top: 6px;
+        /*background: whitesmoke;*/
+    }
+    .layui-form-label {
+        float: left;
+        display: block;
+        padding: 9px 15px;
+        width: 100px;
+        font-weight: 400;
+        line-height: 20px;
+        text-align: right;
+    }
+    .layui-table-view .layui-table {width:100%}
+</style>
 <body>
-$END$
+<form id="updateForm">
+    <div class="layui-form-item" style="margin-top: 10px;">
+        <div class="layui-inline">
+            <label class="layui-form-label">工程名称</label>
+            <div class="layui-input-inline">
+                <input type="text" name="hcmc" name="name" lay-verify="" autocomplete="off" class="layui-input">
+            </div>
+        </div>
+        <div class="layui-inline">
+            <label class="layui-form-label">创建时间</label>
+            <div class="layui-input-inline">
+                <input type="text" name="beginUpdate" id="beginUpdate" lay-verify=""  placeholder="yyyy-MM-dd" autocomplete="off" class="layui-input">
+            </div>
+            <div class="layui-form-mid">-</div>
+            <div class="layui-input-inline">
+                <input type="text" name="endUpdate"  id="endUpdate" lay-verify=""  placeholder="yyyy-MM-dd" autocomplete="off" class="layui-input">
+            </div>
+        </div>
+    </div>
+</form>
+<div style="margin: 20px;">
+    <fieldset class="layui-elem-field layui-field-title">
+        <legend style="font-size: 20px;">项目信息</legend>
+    </fieldset>
+    <table class="layui-hide" id="updatetable" lay-filter="updatetable"></table>
+</div>
+<input id="updatebtn" type="button" onclick="updateProject()" style="display: none" />
 </body>
+<script>
+    layui.use(['table','form','layedit', 'laydate'], function(){
+        var table = layui.table
+            ,form = layui.form
+            ,laydate = layui.laydate;
+        laydate.render({
+            elem: '#beginUpdate'
+        });
+        laydate.render({
+            elem: '#endUpdate'
+        });
+        //日期
+        form.render();
+        table.render({
+            elem: '#updatetable'
+            ,cols: [[
+                {field:'xmmc',width:100,title:'项目名称'}
+                ,{field:'sgdw',width:120,title:'施工单位'}
+                ,{field:'xmlx',width:100,title:'项目类型'}
+                ,{field:'op',align:'center',title:"操作",width:100,templet:function(d){
+                        ////对操作进行初始化
+                        var xml = "<a href='xmmc3.html' class='layui-btn layui-btn-xs' lay-event='update'>编辑</a>";
+                        return xml;
+                    }}
+            ]]
+            ,data:[
+                {
+                    "id":"1",
+                    "xmmc": "wbs要素1",
+                    "sgdw": "wbs识别码",
+                    "xmlx":'比例'
+                },
+                {
+                    "id":"2",
+                    "xmmc": "wbs要素1",
+                    "sgdw": "wbs识别码",
+                    "xmlx":'比例'
+                },
+                {
+                    "id":"1",
+                    "xmmc": "wbs要素1",
+                    "sgdw": "wbs识别码",
+                    "xmlx":'比例'
+                }
+            ]
+            ,page: true
+        });
+        table.on('tool(updatetable)', function(obj){
+            var data = obj.data;
+            //console.log(obj)
+            if(obj.event == 'update'){
+//		     alert(data.id);
+            }
+        });
+    });
+</script>
+<script>
+    function updateProject(){
+        $.ajax({
+            type:"post",
+            url:"${ctx}/jkxl/ddtz",
+            // data:JSON.stringify({id:newid2,type:xmmc2,fee:fyje2}),
+            data:$('#updateForm').serialize(),
+            success:function(result){
+                parent.location.reload();
+            }
+        });
+    }
+</script>
 </html>