瀏覽代碼

Merge remote-tracking branch 'origin/master'

user5 4 年之前
父節點
當前提交
3eec54f6b5

+ 1 - 1
src/main/java/com/jeeplus/modules/projectFilingBatch/dao/ProjectFilingBatchProInfoDao.java

@@ -10,7 +10,7 @@ import java.util.List;
 
 @MyBatisDao
 public interface ProjectFilingBatchProInfoDao extends CrudDao<ProjectFilingBatchProInfo> {
-     ProjectFilingBatchProInfo findProInfo(ProjectFilingBatchProInfo proInfo);
+     List<ProjectFilingBatchProInfo> findProInfo(ProjectFilingBatchProInfo proInfo);
      Integer proInfoInsert(ProjectFilingBatchProInfo proInfo);
 
      List<ProjectFilingBatchProInfo> getListByFilingBatchId(String filingBatchId);

+ 77 - 0
src/main/java/com/jeeplus/modules/projectFilingBatch/service/ProjectFilingBatchService.java

@@ -1,6 +1,7 @@
 package com.jeeplus.modules.projectFilingBatch.service;
 
 import com.google.common.collect.Maps;
+import com.google.gson.JsonObject;
 import com.jeeplus.common.persistence.Page;
 import com.jeeplus.common.service.CrudService;
 import com.jeeplus.common.utils.IdGen;
@@ -40,6 +41,8 @@ import com.jeeplus.modules.workcontractinfo.entity.WorkContractInfo;
 import com.jeeplus.modules.workprojectnotify.entity.WorkProjectNotify;
 import com.jeeplus.modules.workprojectnotify.service.WorkProjectNotifyService;
 import com.jeeplus.modules.workprojectnotify.util.UtilNotify;
+import net.sf.json.JSONArray;
+import net.sf.json.JSONObject;
 import org.activiti.engine.IdentityService;
 import org.activiti.engine.RuntimeService;
 import org.activiti.engine.runtime.ProcessInstance;
@@ -89,6 +92,8 @@ public class ProjectFilingBatchService extends CrudService<ProjectFilingBatchDao
     @Autowired
     private WorkattachmentService workattachmentService;
     @Autowired
+    private ProjectFilingBatchProInfoDao proInfoDao;
+    @Autowired
     private ProjectFilingBatchProInfoDao projectFilingBatchProInfoDao;
     @Override
     public ProjectFilingBatch get(String id) {
@@ -310,7 +315,30 @@ public class ProjectFilingBatchService extends CrudService<ProjectFilingBatchDao
         map.put("data",attachmentList);
         return map;
     }
+    /**
+     * 根据项目id查询项目Info信息
+     * @param projectId  项目id
+     * @return
+     */
+    public Map<String,Object> getFilingBatchProInfo(String projectId,String filingBatch) {
+        Map<String,Object> map = new HashMap<>();
+        //获取子项目信息
+        ProjectFilingBatchProInfo proInfo = new ProjectFilingBatchProInfo();
+        proInfo.setProId(projectId);
+        proInfo.setProInfofilingBatch(filingBatch);
+        //查询对应子项目数据
+        List<ProjectFilingBatchProInfo> proInfos = proInfoDao.findProInfo(proInfo);
 
+        if(proInfos.size()>0){
+            map.put("result",true);
+        }else{
+            map.put("result",false);
+        }
+        map.put("data",proInfos);
+
+
+        return map;
+    }
 
     public List<ProjectFilingBatch> findProjectIdByFiling(String id){
         return projectFilingBatchDao.findProjectIdByFiling(id);
@@ -963,4 +991,53 @@ public class ProjectFilingBatchService extends CrudService<ProjectFilingBatchDao
         projectFilingbatchRelationDao.updateDelFlagByFilingBatch(filingBatch.getId());
     }
 
+    /**
+     * 添加--项目附件info
+     */
+    @Transactional(readOnly = false)
+    public void insertProInfo(String[] proInfos,String[] flags,String[] proId,String filingId){
+        String pro="";
+        JSONObject json = null;
+        if (flags.length!=0 && proId.length==1){
+            int count=0;
+            for (int s=0;s< proInfos.length;s++){
+                count++;
+                pro+=proInfos[s];
+                if(count!=proInfos.length){
+                    pro+=",";
+                }
+            }
+            json = JSONObject.fromObject(pro);
+            ProjectFilingBatchProInfo info = new ProjectFilingBatchProInfo();
+            info.setId(IdGen.uuid());
+            info.setProId(json.get("proId").toString());
+            info.setProInfofilingBatch(json.get("filingId").toString());
+            info.setProInfoName(json.get("names").toString());
+            info.setProInfoType(json.get("types").toString());
+            DelProInfo(info);
+            proInfoDao.proInfoInsert(info);
+        }else{
+            for (int i=0;i<proInfos.length;i++){
+                if (proInfos[i]!="") {
+                    json = JSONObject.fromObject(proInfos[i]);
+                    ProjectFilingBatchProInfo info = new ProjectFilingBatchProInfo();
+                    info.setId(IdGen.uuid());
+                    info.setProId(json.get("proId").toString());
+                    info.setProInfofilingBatch(json.get("filingId").toString());
+                    info.setProInfoName(json.get("names").toString());
+                    info.setProInfoType(json.get("types").toString());
+                    if(i==0){ DelProInfo(info);}
+                    proInfoDao.proInfoInsert(info);
+                }
+            }
+        }
+
+    }
+    /**
+     * 删除--项目附件info
+     * @param proInfo
+     */
+    public void DelProInfo(ProjectFilingBatchProInfo proInfo){
+        proInfoDao.delete(proInfo);
+    }
 }

+ 44 - 1
src/main/java/com/jeeplus/modules/projectFilingBatch/web/ProjectFilingBatchController.java

@@ -3,12 +3,16 @@ package com.jeeplus.modules.projectFilingBatch.web;
 import com.google.gson.internal.$Gson$Preconditions;
 import com.jeeplus.common.config.Global;
 import com.jeeplus.common.persistence.Page;
+import com.jeeplus.common.utils.IdGen;
 import com.jeeplus.common.utils.MyBeanUtils;
 import com.jeeplus.common.utils.StringUtils;
 import com.jeeplus.common.web.BaseController;
 import com.jeeplus.modules.act.entity.Act;
 import com.jeeplus.modules.act.service.ActTaskService;
+import com.jeeplus.modules.projectAccessory.entity.ProjectTemplateInfo;
+import com.jeeplus.modules.projectFilingBatch.dao.ProjectFilingBatchProInfoDao;
 import com.jeeplus.modules.projectFilingBatch.entity.ProjectFilingBatch;
+import com.jeeplus.modules.projectFilingBatch.entity.ProjectFilingBatchProInfo;
 import com.jeeplus.modules.projectFilingBatch.entity.ProjectFilingbatchRelation;
 import com.jeeplus.modules.projectFilingBatch.service.ProjectFilingBatchService;
 import com.jeeplus.modules.projectrecord.entity.ProjectRecords;
@@ -20,6 +24,7 @@ import com.jeeplus.modules.sys.entity.User;
 import com.jeeplus.modules.sys.entity.Workattachment;
 import com.jeeplus.modules.sys.service.UserService;
 import com.jeeplus.modules.sys.utils.UserUtils;
+import com.jeeplus.modules.workclientinfo.entity.WorkClientAttachment;
 import com.jeeplus.modules.workengineeringproject.entity.WorkEngineeringProject;
 import org.activiti.engine.runtime.ProcessInstance;
 import org.activiti.engine.task.Task;
@@ -51,6 +56,7 @@ public class ProjectFilingBatchController extends BaseController {
     private UserService userService;
     @Autowired
     private WorkattachmentDao workattachmentDao;
+
     @ModelAttribute
     public ProjectFilingBatch get(@RequestParam(required = false) String id) {
         ProjectFilingBatch entity = null;
@@ -178,6 +184,15 @@ public class ProjectFilingBatchController extends BaseController {
         Map<String, Object> map = projectFilingBatchService.getAttachmentList(projectId);
         return map;
     }
+    /**
+     * 根据项目id查询info信息
+     */
+    @RequestMapping(value = "getFilingBatchProInfo")
+    @ResponseBody
+    public Map<String,Object> getFilingBatchProInfo(String projectId,String filingBatch) {
+        Map<String, Object> map = projectFilingBatchService.getFilingBatchProInfo(projectId,filingBatch);
+        return map;
+    }
 
     /**
      * 添加
@@ -330,7 +345,7 @@ public class ProjectFilingBatchController extends BaseController {
      */
     @RequiresPermissions(value = {"projectFilingBatch:projectFilingBatchInfo:add", "projectFilingBatch:projectFilingBatchInfo:edit"}, logical = Logical.OR)
     @RequestMapping(value = "save")
-    public String save(ProjectFilingBatch projectFilingBatch, Model model, RedirectAttributes redirectAttributes,@RequestParam("proId")String[] proId) throws Exception {
+    public String save(ProjectFilingBatch projectFilingBatch, Model model, RedirectAttributes redirectAttributes, @RequestParam("proId")String[] proId, String[] proInfos,String[] flags) throws Exception {
         if (!beanValidator(model, projectFilingBatch)){
             return form(projectFilingBatch, model);
         }
@@ -340,6 +355,10 @@ public class ProjectFilingBatchController extends BaseController {
                 if (t.getFilingStatus() == 3 ||t.getFilingStatus()==1){
                     MyBeanUtils.copyBeanNotNull2Bean(projectFilingBatch, t);//将编辑表单中的非NULL值覆盖数据库记录中的值
                     projectFilingBatchService.saveProject(proId,t, ProjectStatusEnum.IN_APRL);//保存
+                    if (proInfos!=null){
+                        projectFilingBatchService.insertProInfo(proInfos,flags,proId,projectFilingBatch.getId());
+                    }
+
                 }else if(t.getFilingStatus() == 2){
                     addMessage(redirectAttributes, "归档批次已送审,无法暂存");
                     return "redirect:"+Global.getAdminPath()+"/projectFilingBatch/projectFilingBatchInfo/?repage";
@@ -350,6 +369,10 @@ public class ProjectFilingBatchController extends BaseController {
             } else {//新增表单保存
                 projectFilingBatch.setFilingStatus(1);
                 projectFilingBatchService.saveProject(proId,projectFilingBatch, ProjectStatusEnum.IN_APRL);//保存
+                //新增项目树形信息
+                if (proInfos!=null) {
+                    projectFilingBatchService.insertProInfo(proInfos, flags, proId,projectFilingBatch.getId());
+                }
             }
             addMessage(redirectAttributes, "归档送审成功");
         }catch (Exception e){
@@ -470,4 +493,24 @@ public class ProjectFilingBatchController extends BaseController {
         }
     }
 
+    /**
+     * 跳转到项目info页面
+     * @return
+     */
+    @RequestMapping("projectFilingBatchProInfoForm")
+    public String projectFilingBatchProInfoForm(String[] types,String[] names,String proid,String filingId,Model model){
+//        Map<String, Object> map = projectFilingBatchService.getFilingBatchProInfo(projectId,filingBatch);
+//        model.addAttribute("projectFilingBatchProInfo", map.get("data"));
+        List<Map<String,String>> proInfo=new ArrayList<>();
+        for(int i=0;i<types.length;i++){
+            Map<String,String> map=new HashMap<>();
+            map.put("type",types[i]);
+            map.put("name",names[i]);
+            proInfo.add(map);
+        }
+        model.addAttribute("proInfo", proInfo);
+        model.addAttribute("proid", proid);
+        model.addAttribute("filingId", filingId);
+        return "modules/projectFilingBatch/ProjectFilingBatchProInfoForm";
+    }
 }

+ 5 - 0
src/main/resources/mappings/modules/projectGuidang/ProjectFilingBatchProInfoDao.xml

@@ -36,4 +36,9 @@
 		where filing_batch=#{filingBatchId}
 	</select>
 
+	<delete id="delete">
+		delete from project_filingbatch_proinfo
+		where filing_batch=#{proInfofilingBatch} and project_id=#{proId}
+	</delete>
+
 </mapper>

+ 1 - 0
src/main/webapp/static/bos/bosupload.js

@@ -152,6 +152,7 @@ function fBmultitestFlag (storeAs, file,attachmentId,attachmentFlag,uploadPath,d
                             }
                             $(prefix).parent().parent().find("td").eq(2).html(str)
                             $(prefix).parent().parent().find("td").eq(0).find("input").eq(1).val(data.id)
+                            $(prefix).parent().parent().find("td").eq(0).find("input").eq(2).val(data.url)
                             var d = new Date();
                             var dateTime=d.getFullYear() + '-' + (d.getMonth() + 1) + '-' + d.getDate();
                             var result = '<a href="javascript:location.href=\''+realPath+'/a/workfullmanage/workFullManage/downLoadAttach?file=\'+encodeURIComponent(\''+data.url+'\');" class="op-btn op-btn-download"><i class="fa fa-download"></i>&nbsp;下载</a>';

+ 214 - 0
src/main/webapp/webpage/modules/projectFilingBatch/ProjectFilingBatchProInfoForm.jsp

@@ -0,0 +1,214 @@
+<%@ page contentType="text/html;charset=UTF-8" %>
+<%@ include file="/webpage/include/taglib.jsp"%>
+<html>
+<head>
+	<title>添加信息</title>
+	<meta name="decorator" content="default"/>
+	<script type="text/javascript">
+		$(document).ready(function() {
+
+		})
+		var validateForm;
+		function doSubmit(i){//回调函数,在编辑和保存动作时,供openDialog调用提交表单。
+			if(validateForm.form()){
+				$("#inputForm").submit();
+				return true;
+			}
+			return false;
+		}
+		function addProInfo(){
+			var length =body.find("#file_attachment tr").length;
+			var types = new Array();
+			for (var i=0;i<length;i++){
+				types[i]=$(body).find("#file_attachment").find("tr").eq(i).find("td").eq(0).find("input").val();
+			}
+		}
+		$(document).ready(function() {
+			validateForm = $("#inputForm").validate({
+				submitHandler: function(form){
+					loading('正在提交,请稍等...');
+					form.submit();
+				},
+				errorContainer: "#messageBox",
+				errorPlacement: function(error, element) {
+					$("#messageBox").text("输入有误,请先更正。");
+					if (element.is(":checkbox")||element.is(":radio")||element.parent().is(".input-append")){
+						error.appendTo(element.parent().parent());
+					} else {
+						error.insertAfter(element);
+					}
+				}
+			});
+			$("#attachment_btn").click(function () {
+				$("#attachment_file").click();
+			});
+		});
+
+		function insertTitle(tValue){
+			//文件后缀名
+			var attachTypes = $("#attachTypes").val();
+			//文件大小
+			var attachLength = $("#attachLength").val();
+			var suffixResult = 0;
+
+			var fileName = tValue.lastIndexOf(".");//获取到文件名开始到最后一个“.”的长度。
+			var fileNameLength = tValue.length;//获取到文件名长度
+
+			var suffix = tValue.substring(fileName + 1, fileNameLength);//截取后缀名
+			if(attachTypes!=undefined && attachTypes !=null & attachTypes !=''){
+				var attachTypeList = attachTypes.split(",");
+				for (var x in attachTypeList) {
+					if(attachTypeList[x] == suffix){
+						suffixResult = 1;
+						break;
+					}
+				}
+				if(suffixResult == 0 ){
+					top.layer.msg("上传附件只能为:"+attachTypes+" 类型文件", {icon: 0});
+					return false;
+				}
+			}
+
+			var list = "${workIncomingMessage.workAttachments}";
+			var size = (list.split('url')).length-1;
+			var files = $("#attachment_file")[0].files;
+
+			for(var i = 0;i<files.length;i++) {
+				var file = files[i];
+				var fileSize = (file.size/(1024 * 1024)).toFixed(2);
+				if(attachLength !=undefined && attachLength != null && attachLength !='') {
+					if (fileSize > attachLength) {
+						top.layer.msg("上传附件只能上传:" + attachLength + "M以下的文件", {icon: 0});
+						return false;
+					}
+				}
+				var attachmentId = "";
+				var attachmentFlag = "100";
+				console.log(file);
+				var timestamp=new Date().getTime();
+
+				var storeAs = "workAttachment";
+				var uploadPath="http://gangwan-app.oss-cn-hangzhou.aliyuncs.com/"+storeAs;/*将这段字符串存到数据库即可*/
+				var divId = "_attachment";
+				$("#addFile"+divId).show();
+				multipartUploadWithSts(storeAs, file,attachmentId,attachmentFlag,uploadPath,divId,size);}
+		}
+		function addRowInfo(obj,d){
+			var id="#"+obj.id
+			var ss=(obj.id).split("_")
+			var sa=ss[1];
+			$(id).parent().parent().parent().show();
+			$(id).append(
+					"<tr class='listInfo'>"+
+					"<td style=\"text-align: center;position: relative;\" width=\"20%\"><span style='color: red;float: left;position: absolute;left: 15px;top: 15px;'>*</span><input name='ProInfoType' style='text-align: center'  class=\"form-control required\"></input></td>"+
+					"<td style=\"text-align: center\" width=\"20%\"><input name='ProInfoName' style='text-align: center' class=\"form-control\"></input></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>" +
+					"<div class=\"op-btn-box\" ><span class=\"op-btn op-btn-delete\" onclick=\"delListInfoRow(this)\" title=\"删除\"><i class=\"glyphicon glyphicon-remove\"></i>&nbsp;删除</span></div>" +
+					"</td>"+
+					"</tr>"
+			)
+			var ob=$(id).find("tr:last").find("td").eq(4).find("span").eq(0)
+			//文件上传
+			// accordingBtn(ob)
+		}
+		function proInfoType() {
+			var length=$("#file_attachment tr").length;
+			var types=new Array();
+			for (var i=0;i<length;i++){
+				types[i]=$("#file_attachment tr").eq(i).find("td").eq(0).find("input").eq(0).val();
+			}
+			return types;
+		}
+		function proInfoValue() {
+			var length=$("#file_attachment tr").length;
+			var names=new Array();
+			for (var i=0;i<length;i++){
+				names[i]=$("#file_attachment tr").eq(i).find("td").eq(1).find("input").eq(0).val();
+			}
+			return names;
+		}
+		function delListInfoRow(obj, prefix){
+			var tr=$(obj).parent().parent().parent();
+			$(obj).parent().parent().parent().remove();
+		}
+		function proInfoJson(){
+			var proId=$("#proId").val();
+			var filingId=$("#filingId").val();
+			var length=$("#file_attachment tr").length;
+			var proInfo={};
+			var proInfos=new Array();
+			for (var i=0;i<length;i++){
+				proInfo.proId=proId
+				proInfo.filingId=filingId
+				proInfo.names=$("#file_attachment tr").eq(i).find("td").eq(1).find("input").eq(0).val();
+				proInfo.types=$("#file_attachment tr").eq(i).find("td").eq(0).find("input").eq(0).val();
+				proInfos[i]=JSON.stringify(proInfo);
+			}
+			return proInfos
+		}
+	</script>
+</head>
+<body>
+<div class="single-form">
+	<div class="container">
+<%--		<form:form id="inputForm" modelAttribute="projectFilingBatchProInfo" action="${ctx}/projectAccessory/projectAccessory/saveWorkAttachment" method="post" class="form-horizontal">--%>
+<%--			<form:hidden path="id"/>--%>
+<%--			<form:hidden path="proId"/>--%>
+<%--			<form:hidden path="proInfofilingBatch"/>--%>
+			<div class="form-group layui-row">
+				<div class="form-group-label"><h2>信息</h2></div>
+				<div class="layui-item nav-btns">
+					<a onclick="addRowInfo(file_attachment)"  class="nav-btn nav-btn-add" title="添加"><i class="fa fa-plus"></i>&nbsp;添加</a>
+				</div>
+				<div id="addFile_attachment" style="display: none" class="upload-progress">
+					<span id="fileName_attachment" ></span>
+					<b><span id="baifenbi_attachment" ></span></b>
+					<div class="progress">
+						<div id="jindutiao_attachment" class="progress-bar" style="width: 0%" aria-valuenow="0">
+						</div>
+					</div>
+				</div>
+				<input id="attachment_file" type="file" name="attachment_file" multiple="multiple" style="display: none;" onChange="if(this.value)insertTitle(this.value);"/>
+				<span id="attachment_title"></span>
+				<div class="layui-item layui-col-xs12" style="padding:0 16px;">
+					<input type="hidden" id="proId" value="${proid}">
+					<input type="hidden" id="filingId" value="${filingId}">
+					<table id="upTable" cellpadding="0" cellspacing="0" class="table table-bordered table-condensed details">
+						<thead>
+						<tr>
+								<%-- <th>序号</th>--%>
+							<th>文件类型</th>
+							<th>文件描述</th>
+							<th width="150px">操作</th>
+						</tr>
+						</thead>
+						<tbody id="file_attachment">
+<%--						<c:choose>--%>
+<%--							<c:when test="${types != '' and names != ''}">--%>
+								<c:forEach items="${proInfo}" var = "info" varStatus="status">
+									<tr>
+										<td><input name="proInfoType" style="text-align: center;" class="form-control required" value='${info.type}'/></td>
+										<td><input name="proInfoName" style="text-align: center" class="form-control required" value='${info.name}'/></td>
+										<td class="op-td">
+											<div class="op-btn-box" >
+												<span class="op-btn op-btn-delete" onclick="delListInfoRow(this)" title="删除"><i class="glyphicon glyphicon-remove"></i>&nbsp;删除</span>
+											</div>
+										</td>
+									</tr>
+								</c:forEach>
+<%--							</c:when>--%>
+<%--							<c:otherwise>--%>
+
+<%--							</c:otherwise>--%>
+<%--						</c:choose>--%>
+
+						</tbody>
+					</table>
+				</div>
+			</div>
+<%--		</form:form>--%>
+	</div>
+</div>
+</body>
+</html>

+ 181 - 66
src/main/webapp/webpage/modules/projectFilingBatch/projectFilingBatchForm.jsp

@@ -7,6 +7,7 @@
     <script type="text/javascript" src="${ctxStatic}/helloweba_editable-select/jquery.editable-select.min.js"></script>
     <script type="text/javascript" src="${ctxStatic}/iCheck/icheck.min.js"></script>
     <link rel='stylesheet' type="text/css" href="${ctxStatic}/helloweba_editable-select/jquery.editable-select.min.css"/>
+    <link href="${ctxStatic}/layer-v2.3/layui/tableTree/treetable.css" rel="stylesheet" />
     <style>
         #projectDesc-error{
             left:0;
@@ -44,8 +45,10 @@
                     parent.layer.msg("请添加归档项目!", {icon: 5});
                     return false
                 }
+                // var prosize=$()
+                // var proJson=new Array(length);
                 for (var i=0;i<length;i++){
-                    var zhi=$("#projectList tr").eq(i).find("input[name='wType']").val();
+                    var zhi=$("#projectList tr").eq(i).find("input[name='proInfoType']").val();
                     if (zhi==""){
                         parent.layer.msg("信息未填写完整!", {icon: 5});
                         return false
@@ -58,6 +61,21 @@
             }
             return false;
         }
+        function listTr(obj){
+            var name=$(obj).find("td").eq(0).find("input").eq(0).val();
+            var tiao="."+name;
+            var span=$(obj).find("td").eq(0);
+            // var ss=$(span).val().split(" ")[4];
+            $(span).toggle(function () {
+                $(tiao).hide();
+                $(span).find("span").attr("class","treeTable-icon")
+            },function () {
+                $(tiao).show();
+                $(span).find("span").attr("class","treeTable-icon open")
+            });
+        }
+        var edit;
+        var editId;
         $(document).ready(function() {
             var filingId=$("#filingId").val();
             if(filingId!=""){
@@ -72,6 +90,8 @@
                             var id="projectList_"+obj.id;
                             var pid="project_"+obj.id;
                             var tid="project_"+obj.id+"_proId";
+                            editId=id;
+                            edit=tid;
                             var inId="#"+tid;
                             var size=$("#projectList .rowSize").size();
                             var flag=true;
@@ -82,26 +102,30 @@
                                 }
                             }
                             if(flag) {
-                                $("#projectList").append("<tr class='rowSize'>" +
-                                    "<td><input type=\"hidden\" name=\"proId\" id='" + tid + "' value=" + obj.id + ">" + obj.projectId + "</td>" +
+                                $("#projectList").append("<tr class='rowSize' onclick='listTr(this)'>" +
+                                    "<td><input type=\"hidden\" name=\"proId\" id='" + tid + "' value=" + obj.id + "><input type=\"hidden\" name=\"projectid\" value=" + obj.id + "><span><i class=\"layui-icon layui-icon-triangle-d\"></i></span>" + 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-add\" onclick=\"addRowInfoForm("+tid+","+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;'>" +
+                                $("#projectList").append("<tr class='"+obj.id+"' 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 + "'>" +
+                                    "<input type='text' id='" + id + "_len' style='display: none;' name='flags' />"+
                                     "</tbody>" +
+
                                     "</table>" +
                                     "</td></tr>")
-
                                 $.ajax({
                                     type : "POST",
-                                    url : "${ctx}/projectFilingBatch/projectFilingBatchInfo/getAttachmentList",
-                                    data : {'projectId':obj.id},
+                                    url : "${ctx}/projectFilingBatch/projectFilingBatchInfo/getFilingBatchProInfo",
+                                    data : {
+                                        'projectId':obj.id,
+                                        'filingBatch':filingId,
+                                    },
                                     //请求成功
                                     success : function(result) {
                                         var iid="#"+id
@@ -110,17 +134,20 @@
                                         $(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>"+
+                                                "<tr class='listInfo' style='position: relative'>"+
+                                                // "<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+"'/>"+
+                                                // "<input type='hidden' style='display: none;' id='fileUrl' value='"+value.url+"'/>"+
+                                                // "</td>"+
+                                                "<td style=\"text-align: center;position: relative;\" width=\"20%\">" +
+                                                "<input name='proInfoType' onChange='upwType(this)' style='text-align: center' readonly='true' class=\"form-control required\" value='"+value.proInfoType+"'/></td>"+
+                                                "<td style=\"text-align: center\" width=\"20%\"><input  readonly='true' name='proInfoName' style='text-align: center' class=\"form-control required\" value='"+value.proInfoName+"'/></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 href=javascript:void(0); onclick=\"addRowInfoForm("+tid+","+id+")\"   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>" +
+                                                "<input type='text' class='" + id + "_json' style='display: none;' name='proInfos' />"+
                                                 "</td>"+
                                                 "</tr>"
                                             )
@@ -497,6 +524,8 @@
                         var id="projectList_"+d.id;
                         var pid="project_"+d.id;
                         var tid="project_"+d.id+"_proId";
+                        edit=tid;
+                        editId=id;
                         var inId="#"+tid;
                         var size=$("#projectList .rowSize").size();
                         var flag=true;
@@ -507,19 +536,20 @@
                             }
                         }
                         if(flag) {
-                            $("#projectList").append("<tr class='rowSize'>" +
-                                "<td><input type=\"hidden\" name=\"proId\" id='" + tid + "' value=" + d.id + ">" + d.projectId + "</td>" +
+                            $("#projectList").append("<tr class='rowSize' onclick='listTr(this)'>" +
+                                "<td><input type=\"hidden\" name=\"proId\" id='" + tid + "' value=" + d.id + "><input type=\"hidden\" name=\"projectid\" value=" + d.id + "><span class='treeTable-icon'><i class=\"layui-icon layui-icon-triangle-d\"></i></span>" + d.projectId + "</td>" +
                                 "<td>" + d.projectName + "</td>" +
                                 "<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-add\" onclick=\"addRowInfoForm("+tid+","+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;'>" +
+                            $("#projectList").append("<tr class='"+d.id+"' 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>" +
+                                "<input type='text' id='" + id + "_len' style='display: none;' name='flags' />"+
                                 "</table>" +
                                 "</td></tr>")
                         }
@@ -549,48 +579,127 @@
             // var idx1 = $("#projectList tr").length;
             bornTemplete(list, idx, tpl, row, idx);
         }
+        function addRowInfoForm(obj,tbody) {
+            var proid=$(obj).val();
+            var filingId=$("#filingId").val();
+            var len="#"+tbody.id+" tr";
+            var length=$(len).length;
+            var types=new Array();
+            var names=new Array();
+            for (var i=0;i<length;i++){
+                types[i]=$(len).eq(i).find("td").eq(0).find("input").eq(0).val();
+                names[i]=$(len).eq(i).find("td").eq(1).find("input").eq(0).val();
+            }
+            var index = parent.layer.getFrameIndex(window.name);
+            openDialog1('添加信息', '${ctx}/projectFilingBatch/projectFilingBatchInfo/projectFilingBatchProInfoForm?types='+types+'&names='+names+'&proid='+proid+'&filingId='+filingId,'70%', '80%',tbody);
+        }
+        function openDialog1(title,url,width,height,tbody){
+            top.layer.open({
+                type: 2,
+                area: [width, height],
+                title: title,
+                maxmin: true, //开启最大化最小化按钮
+                content: url ,
+                btn: ['确定', '关闭'],
+                yes: function(index, layero){
+                    var body = top.layer.getChildFrame('body', index);
+                    var tbodyId="#"+tbody.id;
+                    var JsonId="."+tbody.id;
+                    var iframeWin = layero.find('iframe')[0]; //得到iframe页的窗口对象,执行iframe页的方法:iframeWin.method();
+                    var types=iframeWin.contentWindow.proInfoType();
+                    var names=iframeWin.contentWindow.proInfoValue();
+                    var proJsons=iframeWin.contentWindow.proInfoJson();
+                    var jsonInput=JsonId+"_json"
+                    // $(jsonInput).val(json);
+                    if(iframeWin.contentWindow.proInfoValue() ){
+                        $(tbodyId).html("")
+                        for (var i=0;i<types.length;i++){
+                            var s=$(body).find("#file_attachment tr").eq(i).html();
+                            var name=names[i];
+                            var type=types[i];
+                            var proJson=proJsons[i];
+                            $(tbodyId).append(
+                                "<tr class='listInfo'>"+
+                                "<td style=\"text-align: center;position: relative;\" width=\"20%\">" +
+                                "<input  readonly='true' name='ProInfoType' style='text-align: center'  class=\"form-control required\" value='"+type+"'></td>"+
+                                "<td style=\"text-align: center\" width=\"20%\"><input  readonly='true' name='ProInfoName' style='text-align: center' class=\"form-control\" value='"+name+"'></input></td>"+
+                                "<td style=\"text-align: center\" width=\"20%\"></td>"+
+                                "<td width=\"20%\">" +
+                                "<span href=javascript:void(0); onclick=\"addRowInfoForm("+edit+","+editId+")\"   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>" +
+                                "<input type='text' class='" + jsonInput + "'  name='proInfos' style='display: none;' value='"+proJson+"' />"+
+                                "</td>"+
+                                "</tr>"
+                            )
+                        }
+                        if(types.length==1){
+                            var lenId=tbodyId+"_len"
+                            $(lenId).val("123");
+                            var ssss=$(lenId).val()
+                        }else{
+                            var lenId=tbodyId+"_len"
+                            $(lenId).val("");
+                        }
+                        top.layer.close(index);//关闭对话框。
+                        // top.window[iframeName].frames.location.reload();//刷新父亲
+                    }
+                },
+                cancel: function(index){
+                }
+            });
+        }
+        //子页面回调方法
+        function addRecord(name,chainName) {
+            alert(name);
+        }
+
         function addRowInfo(obj,d){
             var id="#"+obj.id
             var ss=(obj.id).split("_")
             var sa=ss[1];
             $(id).parent().parent().parent().show();
             $(id).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=''/>"+
-                "</td>"+
-                "<td style=\"text-align: center\" width=\"20%\"><input name='wType' onChange='upwType(this)' class=\"form-control required\"/></td>"+
-                "<td style=\"text-align: center\" width=\"20%\"></td>"+
+                "<tr class='listInfo'>"+
+                // "<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=''/>"+
+                // "<input type='hidden' style='display: none;' id='fileUrl' value=''/>"+
+                // "</td>"+
+                "<td style=\"text-align: center;position: relative;\" width=\"20%\"><input name='ProInfoType'  readonly='true' style='text-align: center' onChange='upwType(this)' class=\"form-control required\"/></td>"+
+                "<td style=\"text-align: center\" width=\"20%\"><input name='ProInfoName'  readonly='true' style='text-align: center' class=\"form-control\"/></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>" +
+                // "<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 ob=$(id).find("tr:last").find("td").eq(4).find("span").eq(0)
+            //文件上传
+            // accordingBtn(ob)
+
         }
         function upwType(obj) {
-            var is=$(obj).parent().parent().find("td").eq(0).find("input").eq(1).val();
-            var id = is.toString()
-            var wtype=$(obj).val()
-            if (is==""){
-                parent.layer.msg("请先上传文件!", {icon: 5});
-                $(obj).val("")
-            }else{
-                $.ajax({
-                    type:"post",
-                    url:"${ctx}/projectFilingBatch/projectFilingBatchInfo/updateByType",
-                    data:{
-                        "id":id,
-                        "remarks":wtype
-                    },
-                    dataType:"json",
-                    success:function (d) {
+            <%--var is=$(obj).parent().parent().find("td").eq(0).find("input").eq(1).val();--%>
+            <%--var id = is.toString()--%>
+            <%--var wtype=$(obj).val()--%>
+            <%--if (is==""){--%>
+            <%--    parent.layer.msg("请先上传文件!", {icon: 5});--%>
+            <%--    $(obj).val("")--%>
+            <%--}else{--%>
+            <%--    $.ajax({--%>
+            <%--        type:"post",--%>
+            <%--        url:"${ctx}/projectFilingBatch/projectFilingBatchInfo/updateByType",--%>
+            <%--        data:{--%>
+            <%--            "id":id,--%>
+            <%--            "remarks":wtype--%>
+            <%--        },--%>
+            <%--        dataType:"json",--%>
+            <%--        success:function (d) {--%>
 
-                    }
-                });
-            }
+            <%--        }--%>
+            <%--    });--%>
+            <%--}--%>
         }
 
         function accordingBtn(obj){
@@ -635,28 +744,33 @@
             });
         }
         function delListRow(o,obj){
-            $(o).parent().parent().remove();
-            $(obj).parent().parent().parent().remove();
-            $(obj).parent().parent().parent().hide();
-            var id=$(obj+" tr").length();
+            var tr=obj.id+" tr"
+            var html=$(tr).html()
+            if(html!="undefined"){
+                $(o).parent().parent().remove();
+                $(obj).parent().parent().parent().remove();
+            }
+
+
+           // var fu= $(obj).parent().parent().parent().html();
+            // if ()
+            // $(obj).parent().parent().parent().hide();
+        }
+        function delListInfoRow(obj, prefix){
+            var tr=$(obj).parent().parent();
+            var id=$(tr).find("td").eq(0).find("#attId").val();
+            var url=$(tr).find("td").eq(0).find("#fileUrl").val();
+            $(obj).parent().parent().remove();
+            $(obj).parent().parent().parent().parent().parent().parent().remove();
             $.ajax({
                 type:"post",
-                url:"${ctx}/projectFilingBatch/projectFilingBatchInfo/deleteById",
-                data:{
-                    "id":id
-                },
+                url:"${ctx}/sys/workattachment/deleteFileFromAliyun?url="+url+"&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().parent().parent().remove();
-        }
         function delEntrustRow(obj, prefix){
             var id = $(prefix+"_id");
             var delFlag = $(prefix+"_delFlag");
@@ -857,7 +971,8 @@
     <div class="container">
         <sys:message content="${message}"/>
         <form:form id="inputForm" modelAttribute="projectFilingBatch" action="${ctx}/projectFilingBatch/projectFilingBatchInfo/save" method="post" class="form-horizontal">
-            <form:input path="id" id="filingId"/>
+            <form:hidden path="id" id="filingId"/>
+            <input type="hidden" value="${projectFilingBatch.id}" name="proInfofilingBatch"/>
             <div class="form-group layui-row">
                 <div class="form-group-label"><h2>归档批次基础信息</h2></div>
                 <div class="layui-item layui-col-sm6 lw7">
@@ -874,7 +989,7 @@
                     </div>
                 </div>
                 <div class="layui-item layui-col-sm6 lw7">
-                    <label class="layui-form-label">归档名称:</label>
+                    <label class="layui-form-label"><span style="color: red">*</span>归档名称:</label>
                     <div class="layui-input-block">
                         <form:input path="filingName" htmlEscape="false" class="form-control  layui-input required"/>
                     </div>
@@ -900,8 +1015,8 @@
                         <tr>
                             <th class="hide"></th>
                             <th style="text-align: center" width="20%">归档项目编号/文件类型</th>
-                            <th style="text-align: center" width="20%">归档项目名称/文件名称</th>
-                            <th style="text-align: center" width="20%">报告号/案卷号</th>
+                            <th style="text-align: center" width="20%">归档项目名称/文件描述</th>
+                            <th style="text-align: center" width="20%">报告号</th>
                             <th width="20%">操作</th>
                         </tr>
                         </thead>