Bläddra i källkod

Merge remote-tracking branch 'origin/master'

user5 4 år sedan
förälder
incheckning
4e1f7c8774

+ 36 - 4
src/main/java/com/jeeplus/modules/projectFilingBatch/web/ProjectFilingBatchController.java

@@ -28,10 +28,7 @@ import org.apache.shiro.authz.annotation.RequiresPermissions;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Controller;
 import org.springframework.ui.Model;
-import org.springframework.web.bind.annotation.ModelAttribute;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RequestParam;
-import org.springframework.web.bind.annotation.ResponseBody;
+import org.springframework.web.bind.annotation.*;
 import org.springframework.web.multipart.MultipartFile;
 import org.springframework.web.servlet.mvc.support.RedirectAttributes;
 
@@ -221,6 +218,41 @@ public class ProjectFilingBatchController extends BaseController {
         model.addAttribute("projectFilingBatch", projectFilingBatch);
         return "modules/projectFilingBatch/projectFilingBatchForm";
     }
+    @RequiresPermissions(value = {"projectFilingBatch:projectFilingBatchInfo:add", "projectFilingBatch:projectFilingBatchInfo:edit"}, logical = Logical.OR)
+    @ResponseBody
+    @RequestMapping(value = "formTwo")
+    public ProjectFilingBatch formTwo(@RequestParam("filingId") String filingId, Model model) {
+        ProjectFilingBatch projectFilingBatch=new ProjectFilingBatch();
+        projectFilingBatch.setId(filingId);
+        //判断实体类是否为空
+        if (projectFilingBatch.getId() != null && StringUtils.isNotBlank(projectFilingBatch.getId())) {
+            //获取详细信息
+            projectFilingBatch = projectFilingBatchService.get(projectFilingBatch.getId());
+            List<RuralProjectRecords> ruralProjectRecordsList = new ArrayList<>();
+            //获取详细信息
+            projectFilingBatch = projectFilingBatchService.get(projectFilingBatch.getId());
+            List<ProjectFilingBatch> projectFilingBatches = projectFilingBatchService.findProjectIdByFiling(projectFilingBatch.getId());
+            for (ProjectFilingBatch filingBatch : projectFilingBatches) {
+                RuralProjectRecords ruralProjectRecords = ruralProjectRecordsService.get(filingBatch.getProjectId());
+                ruralProjectRecords.setProjectReportNumber(filingBatch.getNumber());
+                ruralProjectRecordsList.add(ruralProjectRecords);
+            }
+            //获取归档人
+            projectFilingBatch.setCreateBy(UserUtils.get(projectFilingBatch.getCreateBy().getId()));
+            //项目信息
+            projectFilingBatch.setProject(ruralProjectRecordsList);
+
+        } else {
+            //获取归档人
+            projectFilingBatch.setCreateBy(UserUtils.getUser());
+            projectFilingBatch.setCreateDate(new Date());
+        }
+        //查询总审人员信息
+//        List<User> auditUserList = userService.getFilingUserList();
+//        projectFilingBatch.setBzshbUserList(auditUserList);
+        model.addAttribute("projectFilingBatch", projectFilingBatch);
+        return projectFilingBatch;
+    }
 
     @RequiresPermissions(value={"ruralProject:ruralProjectRecords:edit"},logical=Logical.OR)
     @RequestMapping(value = "modify")

+ 119 - 18
src/main/webapp/webpage/modules/projectFilingBatch/projectFilingBatchForm.jsp

@@ -59,6 +59,84 @@
             return false;
         }
         $(document).ready(function() {
+            var filingId=$("#filingId").val();
+            if(filingId!=""){
+                $.ajax({
+                    url:"${ctx}/projectFilingBatch/projectFilingBatchInfo/formTwo",
+                    data:{
+                        "filingId":filingId
+                    },
+                    type:"post",
+                    success:function (d) {
+                        $.each(d.project,function(index,obj){
+                            var id="projectList_"+obj.id;
+                            var pid="project_"+obj.id;
+                            var tid="project_"+obj.id+"_proId";
+                            var inId="#"+tid;
+                            var size=$("#projectList .rowSize").size();
+                            var flag=true;
+                            var dd=$(inId).val();
+                            for (var i=0;i<size;i++){
+                                if (dd==d.id){
+                                    flag=false;
+                                }
+                            }
+                            if(flag) {
+                                $("#projectList").append("<tr class='rowSize'>" +
+                                    "<td><input type=\"hidden\" name=\"proId\" id='" + tid + "' value=" + obj.id + ">" + obj.projectId + "</td>" +
+                                    "<td>" + obj.projectName + "</td>" +
+                                    "<td>" + obj.projectReportNumber + "</td>" +
+                                    "<td class=\"text-center op-td\" >" +
+                                    "<span class=\"op-btn op-btn-add\" onclick=\"addRowInfo(" + id + ")\" title=\"添加\"><i class=\"fa fa-plus\"></i>&nbsp;添加</span>" +
+                                    "<span class=\"op-btn op-btn-delete\" onclick=\"delListRow(this," + id + ")\" title=\"删除\"><i class=\"glyphicon glyphicon-remove\"></i>&nbsp;删除</span>" +
+                                    "</td>" +
+                                    "</tr>")
+                                $("#projectList").append("<tr style='display: none;'> <td colspan='4' style='padding: 0px;'>" +
+                                    "<table style=\"width: 100%;padding: 0px;margin: 0px;\" class=\"table table-bordered table-condensed details\">" +
+                                    "<tbody id='" + id + "'>" +
+                                    "</tbody>" +
+                                    "</table>" +
+                                    "</td></tr>")
+
+                                $.ajax({
+                                    type : "POST",
+                                    url : "${ctx}/projectFilingBatch/projectFilingBatchInfo/getAttachmentList",
+                                    data : {'projectId':obj.id},
+                                    //请求成功
+                                    success : function(result) {
+                                        var iid="#"+id
+                                        // var ss=(obj.id).split("_")
+                                        // var sa=ss[1];
+                                        $(iid).parent().parent().parent().show();
+                                        $.each(result.data,function(index,value){
+                                            $(iid).append(
+                                                "<tr>"+
+                                                "<td class=\"hide\">"+
+                                                "<input type='file' multiple='multiple' style='display: none;' onChange='if(this.value)insertAccording(this.value,"+obj.id+",this);'/>"+
+                                                "<input type='hidden' style='display: none;' id='attId' value='"+value.id+"'/>"+
+                                                "</td>"+
+                                                "<td style=\"text-align: center\" width=\"20%\"><input name='wType' onChange='upwType(this)' class=\"form-control required\" value='"+value.remarks+"'/></td>"+
+                                                "<td style=\"text-align: center\" width=\"20%\"><a class=\"attention-info\" href=\"javascript:void(0)\" title=\""+value.attachmentName+"\" onclick=\"preview('预览','"+value.url+"','90%','90%')\"></a>"+value.attachmentName+"</td>"+
+                                                "<td style=\"text-align: center\" width=\"20%\"></td>"+
+                                                "<td width=\"20%\">" +
+                                                "<span href=javascript:void(0); onclick=\"accordingBtn(this)\"   class=\"op-btn op-btn-edit\" title=\"上传附件\"><i class=\"glyphicon glyphicon-edit\"></i>&nbsp;编辑</span>" +
+                                                "<span class=\"op-btn op-btn-delete\" onclick=\"delListInfoRow(this)\" title=\"删除\"><i class=\"glyphicon glyphicon-remove\"></i>&nbsp;删除</span>" +
+                                                "</td>"+
+                                                "</tr>"
+                                            )
+                                        })
+                                    }
+                                });
+                            }
+                        })
+                    }
+                });
+            }
+
+
+
+
+
             var radioVal ;
             validateForm = $("#inputForm").validate({
                 submitHandler: function(form){
@@ -159,6 +237,8 @@
                 });
             })
 
+
+
             $('#masterId').on("change", function () {
                 var masterId = $("#masterId").val();
                 $("#officeName").val('');
@@ -191,6 +271,8 @@
                 , trigger: 'click'
                 , trigger: 'click'
             });
+
+
         });
 
 
@@ -431,7 +513,7 @@
                                 "<td>" + d.projectReportNumber + "</td>" +
                                 "<td class=\"text-center op-td\" >" +
                                 "<span class=\"op-btn op-btn-add\" onclick=\"addRowInfo(" + id + ")\" title=\"添加\"><i class=\"fa fa-plus\"></i>&nbsp;添加</span>" +
-                                "<span class=\"op-btn op-btn-delete\" onclick=\"delEntrustRow(" + id + ")\" title=\"删除\"><i class=\"glyphicon glyphicon-remove\"></i>&nbsp;删除</span>" +
+                                "<span class=\"op-btn op-btn-delete\" onclick=\"delListRow(this," + id + ")\" title=\"删除\"><i class=\"glyphicon glyphicon-remove\"></i>&nbsp;删除</span>" +
                                 "</td>" +
                                 "</tr>")
                             $("#projectList").append("<tr style='display: none;'> <td colspan='4' style='padding: 0px;'>" +
@@ -483,7 +565,7 @@
                 "<td style=\"text-align: center\" width=\"20%\"></td>"+
                 "<td width=\"20%\">" +
                 "<span href=javascript:void(0); onclick=\"accordingBtn(this)\"   class=\"op-btn op-btn-edit\" title=\"上传附件\"><i class=\"glyphicon glyphicon-edit\"></i>&nbsp;编辑</span>" +
-                "<span class=\"op-btn op-btn-delete\" onclick=\"delEntrustRow(this)\" title=\"删除\"><i class=\"glyphicon glyphicon-remove\"></i>&nbsp;删除</span>" +
+                "<span class=\"op-btn op-btn-delete\" onclick=\"delListInfoRow(this)\" title=\"删除\"><i class=\"glyphicon glyphicon-remove\"></i>&nbsp;删除</span>" +
                 "</td>"+
                 "</tr>"
             )
@@ -552,9 +634,28 @@
                 }
             });
         }
-        function delListRow(obj){
+        function delListRow(o,obj){
+            $(o).parent().parent().remove();
+            $(obj).parent().parent().parent().remove();
+            $(obj).parent().parent().parent().hide();
+            var id=$(obj+" tr").length();
+            $.ajax({
+                type:"post",
+                url:"${ctx}/projectFilingBatch/projectFilingBatchInfo/deleteById",
+                data:{
+                    "id":id
+                },
+                dataType:"json",
+                success:function (d) {
+
+                }
+            });
+        }
+        function delListInfoRow(obj, prefix){
+            var id = $(prefix+"_id");
+            var delFlag = $(prefix+"_delFlag");
             $(obj).parent().parent().remove();
-            $(obj).parent().parent().parent().parent()
+            $(obj).parent().parent().parent().parent().parent().parent().remove();
         }
         function delEntrustRow(obj, prefix){
             var id = $(prefix+"_id");
@@ -756,7 +857,7 @@
     <div class="container">
         <sys:message content="${message}"/>
         <form:form id="inputForm" modelAttribute="projectFilingBatch" action="${ctx}/projectFilingBatch/projectFilingBatchInfo/save" method="post" class="form-horizontal">
-            <form:hidden path="id"/>
+            <form:input path="id" id="filingId"/>
             <div class="form-group layui-row">
                 <div class="form-group-label"><h2>归档批次基础信息</h2></div>
                 <div class="layui-item layui-col-sm6 lw7">
@@ -805,19 +906,19 @@
                         </tr>
                         </thead>
                         <tbody id="projectList">
-                            <c:if test="${projectFilingBatch.project!=null}">
-                                <c:forEach items="${projectFilingBatch.project}" var="pro" >
-                                    <tr>
-                                        <td><input type="hidden" name="proId" value="${pro.id}"/>${pro.projectId}</td>
-                                        <td>${pro.projectName}</td>
-                                        <td>${pro.projectReportNumber}</td>
-                                        <td class="text-center op-td" >
-                                            <span class="op-btn op-btn-add" onclick="addRowInfo()" title=\添加"><i class="fa fa-plus"></i>&nbsp;添加</span>
-                                            <span class="op-btn op-btn-delete" onclick="delEntrustRow(this)" title="删除"><i class="glyphicon glyphicon-remove"></i>&nbsp;删除</span>
-                                        </td>
-                                    </tr>
-                                </c:forEach>
-                            </c:if>
+<%--                            <c:if test="${projectFilingBatch.project!=null}">--%>
+<%--                                <c:forEach items="${projectFilingBatch.project}" var="pro" >--%>
+<%--                                    <tr>--%>
+<%--                                        <td><input type="hidden" name="proId" value="${pro.id}"/>${pro.projectId}</td>--%>
+<%--                                        <td>${pro.projectName}</td>--%>
+<%--                                        <td>${pro.projectReportNumber}</td>--%>
+<%--                                        <td class="text-center op-td" >--%>
+<%--                                            <span class="op-btn op-btn-add" onclick="addRowInfo($)" title=\添加"><i class="fa fa-plus"></i>&nbsp;添加</span>--%>
+<%--                                            <span class="op-btn op-btn-delete" onclick="delEntrustRow(this)" title="删除"><i class="glyphicon glyphicon-remove"></i>&nbsp;删除</span>--%>
+<%--                                        </td>--%>
+<%--                                    </tr>--%>
+<%--                                </c:forEach>--%>
+<%--                            </c:if>--%>
                         </tbody>
                     </table>
                 </div>