蔡德晨 5 anni fa
parent
commit
26f832a452

+ 0 - 1
src/main/java/com/jeeplus/modules/sg/project/mapper/xml/ProjectMapper.xml

@@ -92,7 +92,6 @@
 	<update id="update">
 		UPDATE sg_wbs_project SET
 			project_name = #{projectName},
-			number = #{number},
 			update_by = #{updateBy.id},
 			update_date = #{updateDate},
 			remarks = #{remarks}

+ 17 - 2
src/main/java/com/jeeplus/modules/sg/project/web/ProjectController.java

@@ -17,6 +17,7 @@ import org.springframework.ui.Model;
 
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
+import java.util.ArrayList;
 import java.util.List;
 
 
@@ -24,6 +25,8 @@ import java.util.List;
 @RequestMapping("${adminPath}/project")
 public class ProjectController extends BaseController {
     @Autowired
+    private HttpServletRequest request;
+    @Autowired
     private ProjectService projectService;
 
     @ModelAttribute
@@ -47,7 +50,19 @@ public class ProjectController extends BaseController {
     }
 
 
-
+    @RequestMapping("/form")
+    public String form(WbsProject wbsProject, Model model) {
+        WbsProject wbsProject1 = projectService.get(wbsProject.getId());
+        List<WbsProject> list = new ArrayList<>();
+        list.add(wbsProject1);
+        model.addAttribute("list", list);
+        String view = "updateItemForm";
+        String tabId = request.getParameter("tabId");
+        if("1".equals(tabId)){
+            view = "lookItemForm";
+        }
+        return "modules/sg/project/"+view;
+    }
 
     //项目保存
     @ResponseBody
@@ -64,7 +79,7 @@ public class ProjectController extends BaseController {
         //新增或编辑表单保存
         projectService.save(wbsProject);//保存
         j.setSuccess(true);
-        j.setMsg("新建工程成功");
+        j.setMsg("保存工程成功");
         return j;
     }
 

+ 16 - 19
src/main/webapp/webpage/modules/sg/project/lookItemForm.jsp

@@ -33,17 +33,20 @@
     .layui-table-view .layui-table {width:100%}
 </style>
 <body style="height: 100%">
+<c:if test="${ not empty list}">
+    <c:forEach items="${list}" var="data" varStatus="index">
 <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" lay-verify="" autocomplete="off" class="layui-input" readonly="readonly">
+            <input type="text" name="projectName" lay-verify="" autocomplete="off" class="layui-input" readonly="readonly" value="${data.projectName}">
         </div>
     </div>
     <div class="layui-inline">
         <label class="layui-form-label">创建时间</label>
         <div class="layui-input-inline">
-            <input type="text" name="beginName1" id="beginDate1" lay-verify="" readonly="readonly" placeholder="yyyy-MM-dd" autocomplete="off" class="layui-input">
+            <input type="text" name="createDate" id="beginDate1" lay-verify="" readonly="readonly" placeholder="yyyy-MM-dd" autocomplete="off"
+                   class="layui-input" value="<fmt:formatDate value="${data.createDate}" pattern="yyyy/MM/dd "/>">
         </div>
     </div>
 </div>
@@ -66,29 +69,21 @@
                 ,{field:'xmlx',width:100,title:'项目类型'}
                 ,{field:'op',align:'center',title:"操作",width:100,templet:function(d){
                         ////对操作进行初始化
-                        var xml = "<a class='layui-btn layui-btn-xs' lay-event='update'>编辑</a>";
+                        var xml = "<a class='layui-btn layui-btn-xs' href=\"${ctx}/jkxl/list?id="+d.id+"\">编辑</a>";
                         return xml;
                     }}
             ]]
             ,data:[
+                <c:if test="${ not empty data.wbsItems}">
+            <c:forEach items="${data.wbsItems}" var="data1" varStatus="index">
                 {
-                    "id":"1",
-                    "xmmc": "wbs要素1",
-                    "sgdw": "wbs识别码",
-                    "xmlx":'比例'
+                    "id":"${data1.id}",
+                    "xmmc": "${data1.itemName}",
+                    "sgdw": "某施工单位一",
+                    "xmlx":"架空线路"
                 },
-                {
-                    "id":"2",
-                    "xmmc": "wbs要素1",
-                    "sgdw": "wbs识别码",
-                    "xmlx":'比例'
-                },
-                {
-                    "id":"1",
-                    "xmmc": "wbs要素1",
-                    "sgdw": "wbs识别码",
-                    "xmlx":'比例'
-                }
+                </c:forEach>
+                </c:if>
             ]
             ,page: true
         });
@@ -101,5 +96,7 @@
 //         });
     });
 </script>
+    </c:forEach>
+</c:if>
 </body>
 </html>

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

@@ -193,8 +193,8 @@
                             ////对操作进行初始化
                             var xml = "";
                             if(d.status==1){
-                                xml += "<a class='layui-btn layui-btn-primary layui-btn-xs' onclick='look()'>查看</a>"
-                                    +"<a class='layui-btn layui-btn-xs'  onclick='update()'>修改</a>"
+                                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=\"look( '${ctx}/project/form?id=" + d.id + "&tabId=2')\">修改</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>";
                             }
@@ -202,7 +202,7 @@
                                 xml +="<span>操作</span>";
                             }
                             if(d.status==3){
-                                xml +="<a class='layui-btn layui-btn-xs' lay-event='update1'>编辑</a>";
+                                xml +="<a class='layui-btn layui-btn-xs' href=\"${ctx}/jkxl/list?id="+d.id+"\">编辑</a>";
                             }
 
                             return xml;
@@ -238,7 +238,7 @@
                         "gcmc":"${items.itemName}",
                         "xmsl": "某施工单位一",
                         "cjsq": "架空线路",
-                        "djr":"<fmt:formatDate value="${items.updateDate}" pattern="yyyy/MM/dd"/>",
+                        "djr":"<fmt:formatDate value="${items.createDate}" pattern="yyyy/MM/dd"/>",
                         "status":"3",
                         "pid": "${items.projectId}"
                     },
@@ -323,10 +323,10 @@
         layer.open({
             type: 2,
             title: '查看',
-            area: ['60%', '80%'],
+            area: ['80%', '90%'],
             shade: 0.8,
             shadeClose: true,
-            content: 'url'
+            content: url
             , btn: ['关闭']
         })
     }
@@ -334,10 +334,10 @@
         layer.open({
             type: 2,
             title: '修改',
-            area: ['50%', '70%'],
+            area: ['80%', '90%'],
             shade: 0.8,
             shadeClose: true,
-            content: 'url'
+            content: url
             , btn: ['确定','关闭']
             ,yes: function(index, layero){
                 var bodyparent = layer.getChildFrame('body', index);

+ 17 - 20
src/main/webapp/webpage/modules/sg/project/updateItemForm.jsp

@@ -33,18 +33,21 @@
     .layui-table-view .layui-table {width:100%}
 </style>
 <body>
+<c:if test="${ not empty list}">
+    <c:forEach items="${list}" var="data" varStatus="index">
 <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">
+                <input type="text" name="projectName"  autocomplete="off" class="layui-input" value="${data.projectName}">
             </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">
+                <input type="text" name="beginUpdate" id="beginUpdate" readonly="readonly"  placeholder="yyyy-MM-dd" autocomplete="off"
+                       class="layui-input" value="<fmt:formatDate value="${data.createDate}" pattern="yyyy/MM/dd "/>">
             </div>
         </div>
     </div>
@@ -56,7 +59,6 @@
     <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
@@ -78,29 +80,21 @@
                 ,{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>";
+                        var xml = "<a href='' class='layui-btn layui-btn-xs' lay-event='update'>编辑</a>";
                         return xml;
                     }}
             ]]
             ,data:[
+                <c:if test="${ not empty data.wbsItems}">
+               <c:forEach items="${data.wbsItems}" var="data1" varStatus="index">
                 {
-                    "id":"1",
-                    "xmmc": "wbs要素1",
-                    "sgdw": "wbs识别码",
-                    "xmlx":'比例'
-                },
-                {
-                    "id":"2",
-                    "xmmc": "wbs要素1",
-                    "sgdw": "wbs识别码",
-                    "xmlx":'比例'
+                    "id":"${data1.id}",
+                    "xmmc": "${data1.itemName}",
+                    "sgdw": "某施工单位一",
+                    "xmlx":"架空线路"
                 },
-                {
-                    "id":"1",
-                    "xmmc": "wbs要素1",
-                    "sgdw": "wbs识别码",
-                    "xmlx":'比例'
-                }
+                </c:forEach>
+                </c:if>
             ]
             ,page: true
         });
@@ -126,4 +120,7 @@
         });
     }
 </script>
+    </c:forEach>
+</c:if>
+</body>
 </html>