Przeglądaj źródła

项目归档附件管理功能,附件上传文件树形结构

user5 4 lat temu
rodzic
commit
3cee88a62c
31 zmienionych plików z 3122 dodań i 22 usunięć
  1. 44 0
      src/main/java/com/jeeplus/modules/projectAccessory/dao/ProjectAccessoryDao.java
  2. 137 0
      src/main/java/com/jeeplus/modules/projectAccessory/entity/ProjectAccessoryInfo.java
  3. 77 0
      src/main/java/com/jeeplus/modules/projectAccessory/entity/ProjectAccessoryTree.java
  4. 285 0
      src/main/java/com/jeeplus/modules/projectAccessory/service/ProjectAccessoryService.java
  5. 386 0
      src/main/java/com/jeeplus/modules/projectAccessory/web/ProjectAccessoryController.java
  6. 7 0
      src/main/java/com/jeeplus/modules/projectcontentinfo/dao/ProjectReportRecordDao.java
  7. 5 0
      src/main/java/com/jeeplus/modules/projectcontentinfo/service/ProjectReportRecordService.java
  8. 6 0
      src/main/java/com/jeeplus/modules/ruralprojectrecords/dao/RuralProjectMessageDao.java
  9. 2 0
      src/main/java/com/jeeplus/modules/ruralprojectrecords/service/RuralProjectMessageService.java
  10. 3 0
      src/main/java/com/jeeplus/modules/ruralprojectrecords/web/RuralCostProjectMessageController.java
  11. 3 0
      src/main/java/com/jeeplus/modules/ruralprojectrecords/web/RuralProjectMessageController.java
  12. 9 0
      src/main/java/com/jeeplus/modules/workclientinfo/dao/WorkClientAttachmentDao.java
  13. 9 0
      src/main/java/com/jeeplus/modules/workclientinfo/entity/WorkClientAttachment.java
  14. 1 0
      src/main/java/com/jeeplus/modules/workprojectnotify/web/WorkProjectNotifyController.java
  15. 211 0
      src/main/resources/mappings/modules/projectAccessory/ProjectAccessoryDao.xml
  16. 4 0
      src/main/resources/mappings/modules/projectcontentinfo/ProjectReportRecordDao.xml
  17. 4 0
      src/main/resources/mappings/modules/ruralprojectrecords/RuralProjectMessageDao.xml
  18. 23 0
      src/main/resources/mappings/modules/workclientinfo/WorkClientAttachmentDao.xml
  19. 78 0
      src/main/webapp/WEB-INF/tags/sys/treeselectAccessory.tag
  20. 97 0
      src/main/webapp/webpage/modules/projectAccessory/projectAccessoryForm.jsp
  21. 127 0
      src/main/webapp/webpage/modules/projectAccessory/projectAccessoryList.jsp
  22. 76 0
      src/main/webapp/webpage/modules/projectAccessory/projectAccessoryView.jsp
  23. 131 0
      src/main/webapp/webpage/modules/projectAccessory/workAttachmentForm.jsp
  24. 124 0
      src/main/webapp/webpage/modules/projectAccessory/workAttachmentView.jsp
  25. 168 3
      src/main/webapp/webpage/modules/projectcontentinfo/projectReportRecordAudit.jsp
  26. 182 4
      src/main/webapp/webpage/modules/ruralprojectrecords/cost/projectReportRecord/projectReportRecordForm.jsp
  27. 183 3
      src/main/webapp/webpage/modules/ruralprojectrecords/cost/projectReportRecord/projectReportRecordModify.jsp
  28. 187 3
      src/main/webapp/webpage/modules/ruralprojectrecords/cost/projectReportRecord/projectReportRecordView.jsp
  29. 183 3
      src/main/webapp/webpage/modules/ruralprojectrecords/projectReportRecord/projectReportRecordForm.jsp
  30. 183 3
      src/main/webapp/webpage/modules/ruralprojectrecords/projectReportRecord/projectReportRecordModify.jsp
  31. 187 3
      src/main/webapp/webpage/modules/ruralprojectrecords/projectReportRecord/projectReportRecordView.jsp

+ 44 - 0
src/main/java/com/jeeplus/modules/projectAccessory/dao/ProjectAccessoryDao.java

@@ -0,0 +1,44 @@
+/**
+ * Copyright &copy; 2015-2020 <a href="http://www.jeeplus.org/">JeePlus</a> All rights reserved.
+ */
+package com.jeeplus.modules.projectAccessory.dao;
+
+import com.jeeplus.common.persistence.CrudDao;
+import com.jeeplus.common.persistence.TreeDao;
+import com.jeeplus.common.persistence.annotation.MyBatisDao;
+import com.jeeplus.modules.projectAccessory.entity.ProjectAccessoryInfo;
+import com.jeeplus.modules.projectAccessory.entity.ProjectAccessoryTree;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+import java.util.Set;
+
+/**
+ * 复核标准DAO接口
+ * @author ssrh
+ * @version 2018-06-01
+ */
+@MyBatisDao
+public interface ProjectAccessoryDao extends CrudDao<ProjectAccessoryInfo>,TreeDao<ProjectAccessoryInfo> {
+
+
+    List<ProjectAccessoryInfo> fingIds(@Param("parentIdSet") Set<String> parentIdSet, @Param("companyId") String companyId);
+    List<ProjectAccessoryInfo> fingByIds(@Param("parentIdSet") Set<String> parentIdSet, @Param("companyId") String companyId, @Param("parentIds") String parentIds);
+
+    String selectOrderNum(String parentId);
+
+    List<ProjectAccessoryInfo> getByDetail();
+
+    /**
+     * 获取所有父节点信息
+     * @return
+     */
+    List<ProjectAccessoryTree> projectAccessoryParentList();
+
+    /**
+     * 根据父id获取子信息
+     * @param parentId
+     * @return
+     */
+    List<ProjectAccessoryTree> projectAccessoryListByParentId(String parentId);
+}

+ 137 - 0
src/main/java/com/jeeplus/modules/projectAccessory/entity/ProjectAccessoryInfo.java

@@ -0,0 +1,137 @@
+/**
+ * Copyright &copy; 2015-2020 <a href="http://www.jeeplus.org/">JeePlus</a> All rights reserved.
+ */
+package com.jeeplus.modules.projectAccessory.entity;
+
+
+import com.jeeplus.common.persistence.TreeEntity;
+import com.jeeplus.common.utils.excel.annotation.ExcelField;
+
+/**
+ * 复核标准Entity
+ * @author ssrh
+ * @version 2018-06-01
+ */
+public class ProjectAccessoryInfo extends TreeEntity<ProjectAccessoryInfo>{
+	
+	private static final long serialVersionUID = 1L;
+	private String standardDetail;		// 标准内容
+	private String parentIds;		// 所有父ID
+	private Byte maxDeduct;		// 最多扣分
+	private String orderNum;		// 排序
+	private String companyId;   //公司id
+	private String type;
+    private Integer proofread; //是否是校核
+
+
+	private String number;    //编号
+	private String name;      //名称
+	private String pid;       //父级id
+
+	public ProjectAccessoryInfo() {
+		super();
+	}
+
+	public ProjectAccessoryInfo(String id){
+		super(id);
+	}
+
+	@ExcelField(title="标准内容", align=2, sort=8)
+	public String getStandardDetail() {
+		return standardDetail;
+	}
+
+	public void setStandardDetail(String standardDetail) {
+		this.standardDetail = standardDetail;
+	}
+	
+	@ExcelField(title="所有父ID", align=2, sort=9)
+	public String getParentIds() {
+		return parentIds;
+	}
+
+	public void setParentIds(String parentIds) {
+		this.parentIds = parentIds;
+	}
+	
+	@ExcelField(title="最多扣分", align=2, sort=10)
+	public Byte getMaxDeduct() {
+		return maxDeduct;
+	}
+
+	public void setMaxDeduct(Byte maxDeduct) {
+		this.maxDeduct = maxDeduct;
+	}
+	
+	@ExcelField(title="排序", align=2, sort=11)
+	public String getOrderNum() {
+		return orderNum;
+	}
+
+	public void setOrderNum(String orderNum) {
+		this.orderNum = orderNum;
+	}
+
+    public ProjectAccessoryInfo getParent() {
+        return parent;
+    }
+
+    public void setParent(ProjectAccessoryInfo parent) {
+        this.parent = parent;
+    }
+
+    public int getGrade(){
+        String[] split = this.getParentIds().split(",");
+        return split.length-1;
+    }
+
+	public String getCompanyId() {
+		return companyId;
+	}
+
+	public void setCompanyId(String companyId) {
+		this.companyId = companyId;
+	}
+
+    public Integer getProofread() {
+        return proofread;
+    }
+
+    public void setProofread(Integer proofread) {
+        this.proofread = proofread;
+    }
+
+	public String getType() {
+		return type;
+	}
+
+	public void setType(String type) {
+		this.type = type;
+	}
+
+	public String getNumber() {
+		return number;
+	}
+
+	public void setNumber(String number) {
+		this.number = number;
+	}
+
+	@Override
+	public String getName() {
+		return name;
+	}
+
+	@Override
+	public void setName(String name) {
+		this.name = name;
+	}
+
+	public String getPid() {
+		return pid;
+	}
+
+	public void setPid(String pid) {
+		this.pid = pid;
+	}
+}

+ 77 - 0
src/main/java/com/jeeplus/modules/projectAccessory/entity/ProjectAccessoryTree.java

@@ -0,0 +1,77 @@
+package com.jeeplus.modules.projectAccessory.entity;
+
+import com.google.common.collect.Lists;
+import com.jeeplus.modules.workclientinfo.entity.WorkClientAttachment;
+
+import java.util.Date;
+import java.util.List;
+
+/**
+ * @author: 大猫
+ * @create: 2020-10-26 14:58
+ **/
+public class ProjectAccessoryTree {
+    private String id;        //id
+    private String number;    //编号
+    private String name;      //名称
+    private String type;      //类型
+    private String pid;       //父级id
+    private String projectId; //项目id
+    private List<WorkClientAttachment> workAttachments = Lists.newArrayList();
+
+    public String getId() {
+        return id;
+    }
+
+    public void setId(String id) {
+        this.id = id;
+    }
+
+    public String getNumber() {
+        return number;
+    }
+
+    public void setNumber(String number) {
+        this.number = number;
+    }
+
+    public String getName() {
+        return name;
+    }
+
+    public void setName(String name) {
+        this.name = name;
+    }
+
+    public String getType() {
+        return type;
+    }
+
+    public void setType(String type) {
+        this.type = type;
+    }
+
+    public String getPid() {
+        return pid;
+    }
+
+    public void setPid(String pid) {
+        this.pid = pid;
+    }
+
+    public String getProjectId() {
+        return projectId;
+    }
+
+    public void setProjectId(String projectId) {
+        this.projectId = projectId;
+    }
+
+    public List<WorkClientAttachment> getWorkAttachments() {
+        return workAttachments;
+    }
+
+    public void setWorkAttachments(List<WorkClientAttachment> workAttachments) {
+        this.workAttachments = workAttachments;
+    }
+}

+ 285 - 0
src/main/java/com/jeeplus/modules/projectAccessory/service/ProjectAccessoryService.java

@@ -0,0 +1,285 @@
+/**
+ * Copyright &copy; 2015-2020 <a href="http://www.jeeplus.org/">JeePlus</a> All rights reserved.
+ */
+package com.jeeplus.modules.projectAccessory.service;
+
+import com.google.common.collect.Lists;
+import com.jeeplus.common.persistence.Page;
+import com.jeeplus.common.service.TreeService;
+import com.jeeplus.common.utils.StringUtils;
+import com.jeeplus.modules.projectAccessory.dao.ProjectAccessoryDao;
+import com.jeeplus.modules.projectAccessory.entity.ProjectAccessoryInfo;
+import com.jeeplus.modules.projectAccessory.entity.ProjectAccessoryTree;
+import com.jeeplus.modules.sys.entity.Office;
+import com.jeeplus.modules.sys.utils.UserUtils;
+import com.jeeplus.modules.workclientinfo.dao.WorkClientAttachmentDao;
+import com.jeeplus.modules.workclientinfo.entity.WorkClientAttachment;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+
+import java.util.*;
+
+/**
+ * 复核标准Service
+ * @author ssrh
+ * @version 2018-06-01
+ */
+@Service
+@Transactional(readOnly = true)
+public class ProjectAccessoryService extends TreeService<ProjectAccessoryDao, ProjectAccessoryInfo> {
+
+    @Autowired
+    private WorkClientAttachmentDao workClientAttachmentDao;
+
+	public ProjectAccessoryInfo get(String id) {
+		return super.get(id);
+	}
+
+    /**
+     * 查询所有数据
+     * @param projectAccessoryInfo
+     * @return
+     */
+	public List<ProjectAccessoryInfo> findList(ProjectAccessoryInfo projectAccessoryInfo) {
+        List<ProjectAccessoryInfo> projectAccessoryInfoList = new ArrayList<>();
+        List<ProjectAccessoryInfo> listReturn = Lists.newArrayList();
+        //根据条件查询数据集合
+        List<ProjectAccessoryInfo> listAll = super.findList(projectAccessoryInfo);
+        Office company = UserUtils.getSelectCompany();
+        projectAccessoryInfo.setCompanyId(company.getId());
+        //根据条件查询数据集合
+        List<ProjectAccessoryInfo> list = super.findList(projectAccessoryInfo);
+        //判断,数据不为空则添加到返回集合中
+        if (listAll!=null && listAll.size()!=0){
+            projectAccessoryInfoList.addAll(listAll);
+        }
+        //判断,数据不为空则添加到返回集合中
+        if (list!=null && list.size()!=0){
+            projectAccessoryInfoList.addAll(list);
+        }
+
+        if(projectAccessoryInfoList!=null&&projectAccessoryInfoList.size()>0&&projectAccessoryInfo!=null&& (StringUtils.isNotBlank(projectAccessoryInfo.getStandardDetail())||StringUtils.isNotBlank(projectAccessoryInfo.getOrderNum()))){
+            //标准内容模糊查询,查询所有父节点
+            Set<String> parentIdSet = new HashSet<>();
+            for (ProjectAccessoryInfo projectAccessory : projectAccessoryInfoList) {
+                String parentIds = projectAccessory.getParentIds();
+                if (StringUtils.isNotBlank(parentIds)){
+                    parentIdSet.addAll(Arrays.asList(parentIds.split(",")));
+                }
+            }
+            for (ProjectAccessoryInfo reviewStandard : projectAccessoryInfoList) {
+                parentIdSet.remove(reviewStandard.getId());
+            }
+            projectAccessoryInfoList.addAll(0,this.fingIds(parentIdSet,"0"));
+            projectAccessoryInfoList.addAll(0,this.fingIds(parentIdSet,UserUtils.getSelectCompany().getId()));
+        }
+        sortList(listReturn,projectAccessoryInfoList,"0",true);
+        return listReturn;
+    }
+
+    /**
+     * 无条件查询所有父节点数据
+     * @return
+     */
+    public List<ProjectAccessoryTree> projectAccessoryParentList(){
+	    return dao.projectAccessoryParentList();
+    }
+
+    /**
+     * 根据父id获取子信息
+     * @param parentId
+     * @return
+     */
+    public List<ProjectAccessoryTree> projectAccessoryListByParentId(String parentId){
+	    return dao.projectAccessoryListByParentId(parentId);
+    }
+
+
+    public List<ProjectAccessoryInfo> findListByType(ProjectAccessoryInfo workReviewStandard) {
+        List<ProjectAccessoryInfo> workReviewStandards = new ArrayList<>();
+        List<ProjectAccessoryInfo> listReturn = Lists.newArrayList();
+        List<ProjectAccessoryInfo> listAll = new ArrayList<>();
+        Office company = UserUtils.getSelectCompany();
+        if(workReviewStandard!=null&& StringUtils.isNotBlank(workReviewStandard.getStandardDetail())){
+            //标准内容模糊查询,查询所有父节点
+            Set<String> parentIdSet = new HashSet<>();
+            listAll.addAll(0,this.fingByIds(parentIdSet,"0",workReviewStandard.getParentIds()));
+        }
+        workReviewStandard.setCompanyId(company.getId());
+        List<ProjectAccessoryInfo> list = new ArrayList<>();
+        if(workReviewStandard!=null&& StringUtils.isNotBlank(workReviewStandard.getStandardDetail())){
+            //标准内容模糊查询,查询所有父节点
+            Set<String> parentIdSet = new HashSet<>();
+            list.addAll(0,this.fingByIds(parentIdSet,UserUtils.getSelectCompany().getId(),workReviewStandard.getParentIds()));
+        }
+        if (listAll!=null && listAll.size()!=0){
+            workReviewStandards.addAll(listAll);
+        }
+        if (list!=null && list.size()!=0){
+            workReviewStandards.addAll(list);
+        }
+        if (workReviewStandards!=null && workReviewStandards.size()!=0){
+            workReviewStandards.add(get(workReviewStandard.getType()));
+        }
+        sortList(listReturn,workReviewStandards,"0",true);
+        return listReturn;
+    }
+
+    public static void sortList(List<ProjectAccessoryInfo> list, List<ProjectAccessoryInfo> sourcelist, String parentId, boolean cascade){
+        for (int i=0; i<sourcelist.size(); i++){
+            ProjectAccessoryInfo e = sourcelist.get(i);
+            if (e.getParent()!=null && StringUtils.isNotBlank(e.getParent().getId()) && e.getParent().getId().equals(parentId)){
+                list.add(e);
+                if (cascade){
+                    // 判断是否还有子节点, 有则继续获取子节点
+                    for (int j=0; j<sourcelist.size(); j++){
+                        ProjectAccessoryInfo child = sourcelist.get(j);
+                        if (child.getParent()!=null && StringUtils.isNotBlank(child.getParent().getId()) && child.getParent().getId().equals(e.getId())){
+                            sortList(list, sourcelist, e.getId(), true);
+                            break;
+                        }
+                    }
+                }
+            }
+        }
+    }
+
+    private List<ProjectAccessoryInfo> fingIds(Set<String> parentIdSet, String companyId) {
+        return dao.fingIds(parentIdSet,companyId);
+    }
+    private List<ProjectAccessoryInfo> fingByIds(Set<String> parentIdSet, String companyId, String parentIds) {
+        return dao.fingByIds(parentIdSet,companyId,parentIds);
+    }
+
+    public Page<ProjectAccessoryInfo> findPage(Page<ProjectAccessoryInfo> page, ProjectAccessoryInfo workReviewStandard) {
+		return super.findPage(page, workReviewStandard);
+	}
+
+	@Transactional(readOnly = false)
+	public void save(ProjectAccessoryInfo workReviewStandard) {
+        //设置序号
+        if(workReviewStandard.getIsNewRecord()) {
+            workReviewStandard.setParent(this.get(workReviewStandard.getParent().getId()));
+            String orderNum = null;
+            //判断是否选择了父级节点。没有选择则默认为第一级别
+            if(null != workReviewStandard.getParent()){
+                orderNum = this.selectOrderNum(workReviewStandard.getParent().getId());
+                workReviewStandard.setCompanyId(UserUtils.getSelectCompany().getId());
+            }else{
+                orderNum = this.selectOrderNum("0");
+                workReviewStandard.setCompanyId("0");
+            }
+            //判断是否有数据,没有数据则默认给编号01,有则在最大数据上递增1
+            if (StringUtils.isBlank(orderNum)) {
+                workReviewStandard.setOrderNum(workReviewStandard.getParent().getOrderNum() + "01");
+            } else {
+                workReviewStandard.setOrderNum(String.valueOf(Integer.valueOf(orderNum) + 1));
+            }
+        }
+		super.save(workReviewStandard);
+	}
+
+	@Transactional(readOnly = false)
+	public void delete(ProjectAccessoryInfo workReviewStandard) {
+		super.delete(workReviewStandard);
+	}
+
+
+    public String selectOrderNum(String parentId) {
+        return dao.selectOrderNum(parentId);
+    }
+
+
+    /**
+     * 查询第一级数据信息
+     * @param workReviewStandard
+     * @return
+     */
+    public List<ProjectAccessoryInfo> findTreeList(ProjectAccessoryInfo workReviewStandard) {
+        List<ProjectAccessoryInfo> workReviewStandards = new ArrayList<>();
+        List<ProjectAccessoryInfo> listReturn = Lists.newArrayList();
+        List<ProjectAccessoryInfo> listAll = super.findList(workReviewStandard);
+        Office company = UserUtils.getSelectCompany();
+        /*workReviewStandard.setCompanyId(company.getId());
+        workReviewStandard.setProofread(1);
+        List<ProjectAccessoryInfo> list = super.findList(workReviewStandard);*/
+        if (listAll!=null && listAll.size()!=0){
+            workReviewStandards.addAll(listAll);
+        }
+        /*if (list!=null && list.size()!=0){
+            workReviewStandards.addAll(list);
+        }*/
+        sortList(listReturn,workReviewStandards,"0",true);
+        this.queryProofread(listReturn);
+        return listReturn;
+    }
+
+    public void queryProofread(List<ProjectAccessoryInfo> listReturn){
+	    List<ProjectAccessoryInfo> standards = dao.getByDetail();
+        if(standards==null||listReturn==null){
+            return;
+        }
+        for (ProjectAccessoryInfo standard : standards) {
+            for (ProjectAccessoryInfo reviewStandard : listReturn) {
+                if(reviewStandard!=null&&((reviewStandard.getParent()!=null&&standard.getId().equals(reviewStandard.getParent().getId()))
+                        ||standard.getId().equals(reviewStandard.getId())
+                        || (StringUtils.isNotBlank(reviewStandard.getParentIds())&&reviewStandard.getParentIds().contains(standard.getId()))
+                )){
+                    reviewStandard.setProofread(1);
+                }
+            }
+        }
+
+    }
+
+    /**
+     * 根据信息查询附件信息
+     * @param attachmentId
+     * @param projectId
+     * @return
+     */
+    public List<WorkClientAttachment> getWorkAttachments(String attachmentId,String projectId){
+        WorkClientAttachment attchment = new WorkClientAttachment();
+        attchment.setAttachmentId(attachmentId);
+        attchment.setProjectId(projectId);
+        List<WorkClientAttachment> attachments = workClientAttachmentDao.getList(attchment);
+        return attachments;
+    }
+
+    /**
+     * 新增修改删除附件信息
+     * @param projectAccessory
+     */
+    @Transactional(readOnly = false)
+    public void saveWorkAttachment(ProjectAccessoryTree projectAccessory){
+        //判断附件信息是否为空
+        if(null != projectAccessory.getWorkAttachments()){
+            for (WorkClientAttachment workClientAttachment : projectAccessory.getWorkAttachments()) {
+                //判断附件信息的id是否为空
+                if (workClientAttachment.getId() == null) {
+                    continue;
+                }
+                //判断附件信息是否是删除项
+                if (WorkClientAttachment.DEL_FLAG_NORMAL.equals(workClientAttachment.getDelFlag())) {
+                    //添加附件信息基本信息
+                    workClientAttachment.setAttachmentId(projectAccessory.getId());
+                    workClientAttachment.setProjectId(projectAccessory.getProjectId());
+                    workClientAttachment.setAttachmentUser(UserUtils.getUser().getId());
+                    if (StringUtils.isBlank(workClientAttachment.getId()) || "null".equals(workClientAttachment.getId())) {
+                        //新增附件信息
+                        workClientAttachment.preInsert();
+                        workClientAttachmentDao.insert(workClientAttachment);
+                    } else {
+                        //修改附件信息
+                        workClientAttachment.preUpdate();
+                        workClientAttachmentDao.update(workClientAttachment);
+                    }
+                } else {
+                    //删除附件信息
+                    workClientAttachmentDao.delete(workClientAttachment);
+                }
+            }
+        }
+    }
+}

+ 386 - 0
src/main/java/com/jeeplus/modules/projectAccessory/web/ProjectAccessoryController.java

@@ -0,0 +1,386 @@
+/**
+ * Copyright &copy; 2015-2020 <a href="http://www.jeeplus.org/">JeePlus</a> All rights reserved.
+ */
+package com.jeeplus.modules.projectAccessory.web;
+
+import com.google.common.collect.Lists;
+import com.google.common.collect.Maps;
+import com.jeeplus.common.config.Global;
+import com.jeeplus.common.persistence.Page;
+import com.jeeplus.common.utils.DateUtils;
+import com.jeeplus.common.utils.MyBeanUtils;
+import com.jeeplus.common.utils.StringUtils;
+import com.jeeplus.common.utils.excel.ExportExcel;
+import com.jeeplus.common.utils.excel.ImportExcel;
+import com.jeeplus.common.web.BaseController;
+import com.jeeplus.modules.projectAccessory.entity.ProjectAccessoryInfo;
+import com.jeeplus.modules.projectAccessory.entity.ProjectAccessoryTree;
+import com.jeeplus.modules.projectAccessory.service.ProjectAccessoryService;
+import com.jeeplus.modules.workclientinfo.entity.WorkClientAttachment;
+import org.apache.shiro.authz.annotation.Logical;
+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.*;
+import org.springframework.web.multipart.MultipartFile;
+import org.springframework.web.servlet.mvc.support.RedirectAttributes;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import javax.validation.ConstraintViolationException;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * 附件结构Controller
+ * @author 徐滕
+ * @version 2020-10-23
+ */
+@Controller
+@RequestMapping(value = "${adminPath}/projectAccessory/projectAccessory")
+public class ProjectAccessoryController extends BaseController {
+
+	@Autowired
+	private ProjectAccessoryService projectAccessoryService;
+	
+	@ModelAttribute
+	public ProjectAccessoryInfo get(@RequestParam(required=false) String id) {
+		ProjectAccessoryInfo entity = null;
+		if (StringUtils.isNotBlank(id)){
+			entity = projectAccessoryService.get(id);
+		}
+		if (entity == null){
+			entity = new ProjectAccessoryInfo();
+		}
+		return entity;
+	}
+
+	/**
+	 * 附件结构列表页面
+	 * @param projectAccessoryInfo
+	 * @param model
+	 * @return
+	 */
+	@RequiresPermissions("projectAccessory:projectAccessory:list")
+	@RequestMapping(value = {"list", ""})
+	public String list(ProjectAccessoryInfo projectAccessoryInfo, Model model) {
+		List<ProjectAccessoryInfo> list = projectAccessoryService.findList(projectAccessoryInfo);
+		projectAccessoryService.queryProofread(list);
+		model.addAttribute("list", list);
+		return "modules/projectAccessory/projectAccessoryList";
+	}
+
+	/**
+	 * 查看,增加,编辑附件结构表单页面
+	 * @param projectAccessoryInfo
+	 * @param model
+	 * @return
+	 */
+	@RequiresPermissions(value={"projectAccessory:projectAccessory:view","projectAccessory:projectAccessory:add","projectAccessory:projectAccessory:edit"},logical=Logical.OR)
+	@RequestMapping(value = "form")
+	public String form(ProjectAccessoryInfo projectAccessoryInfo, Model model) {
+	    if(projectAccessoryInfo!=null&&projectAccessoryInfo.getParent()!=null&&StringUtils.isNotBlank(projectAccessoryInfo.getParent().getId())){
+            ProjectAccessoryInfo parent = projectAccessoryService.get(projectAccessoryInfo.getParent().getId());
+			projectAccessoryInfo.setParent(parent);
+            List<ProjectAccessoryInfo> list = new ArrayList<>();
+            list.add(projectAccessoryInfo);
+			projectAccessoryService.queryProofread(list);
+        }
+		model.addAttribute("projectAccessoryInfo", projectAccessoryInfo);
+		return "modules/projectAccessory/projectAccessoryForm";
+	}
+
+	/**
+	 * 查看
+	 * @param projectAccessoryInfo
+	 * @param model
+	 * @return
+	 */
+    @RequiresPermissions(value={"projectAccessory:projectAccessory:view","projectAccessory:projectAccessory:add","projectAccessory:projectAccessory:edit"},logical=Logical.OR)
+    @RequestMapping(value = "view")
+    public String view(ProjectAccessoryInfo projectAccessoryInfo, Model model) {
+        if(projectAccessoryInfo!=null&&projectAccessoryInfo.getParent()!=null&&StringUtils.isNotBlank(projectAccessoryInfo.getParent().getId())){
+            ProjectAccessoryInfo parent = projectAccessoryService.get(projectAccessoryInfo.getParent().getId());
+			projectAccessoryInfo.setParent(parent);
+            List<ProjectAccessoryInfo> list = new ArrayList<>();
+            list.add(projectAccessoryInfo);
+			projectAccessoryService.queryProofread(list);
+        }
+        model.addAttribute("projectAccessoryInfo", projectAccessoryInfo);
+        return "modules/projectAccessory/projectAccessoryView";
+    }
+
+	/**
+	 * 保存附件结构
+	 * @param projectAccessoryInfo
+	 * @param model
+	 * @param redirectAttributes
+	 * @return
+	 * @throws Exception
+	 */
+	@RequiresPermissions(value={"projectAccessory:projectAccessory:add","projectAccessory:projectAccessory:edit"},logical=Logical.OR)
+	@RequestMapping(value = "save")
+	public String save(ProjectAccessoryInfo projectAccessoryInfo, Model model, RedirectAttributes redirectAttributes) throws Exception{
+		if (!beanValidator(model, projectAccessoryInfo)){
+			return form(projectAccessoryInfo, model);
+		}
+		if(!projectAccessoryInfo.getIsNewRecord()){//编辑表单保存
+			ProjectAccessoryInfo t = projectAccessoryService.get(projectAccessoryInfo.getId());//从数据库取出记录的值
+			MyBeanUtils.copyBeanNotNull2Bean(projectAccessoryInfo, t);//将编辑表单中的非NULL值覆盖数据库记录中的值
+			projectAccessoryService.save(t);//保存
+		}else{//新增表单保存
+			projectAccessoryService.save(projectAccessoryInfo);//保存
+		}
+		addMessage(redirectAttributes, "保存附件结构成功");
+		return "redirect:"+Global.getAdminPath()+"/projectAccessory/projectAccessory/?repage";
+	}
+
+	/**
+	 * 删除附件结构
+	 * @param projectAccessoryInfo
+	 * @param redirectAttributes
+	 * @return
+	 */
+	@RequiresPermissions("projectAccessory:projectAccessory:del")
+	@RequestMapping(value = "delete")
+	public String delete(ProjectAccessoryInfo projectAccessoryInfo, RedirectAttributes redirectAttributes) {
+		projectAccessoryService.delete(projectAccessoryInfo);
+		addMessage(redirectAttributes, "删除附件结构成功");
+		return "redirect:"+Global.getAdminPath()+"/projectAccessory/projectAccessory/?repage";
+	}
+
+	/**
+	 * 批量删除附件结构
+	 * @param ids
+	 * @param redirectAttributes
+	 * @return
+	 */
+	@RequiresPermissions("projectAccessory:projectAccessory:del")
+	@RequestMapping(value = "deleteAll")
+	public String deleteAll(String ids, RedirectAttributes redirectAttributes) {
+		String idArray[] =ids.split(",");
+		for(String id : idArray){
+			projectAccessoryService.delete(projectAccessoryService.get(id));
+		}
+		addMessage(redirectAttributes, "删除附件结构成功");
+		return "redirect:"+Global.getAdminPath()+"/projectAccessory/projectAccessory/?repage";
+	}
+
+	/**
+	 * 导出excel文件
+	 * @param projectAccessoryInfo
+	 * @param request
+	 * @param response
+	 * @param redirectAttributes
+	 * @return
+	 */
+	@RequiresPermissions("projectAccessory:projectAccessory:export")
+    @RequestMapping(value = "export", method=RequestMethod.POST)
+    public String exportFile(ProjectAccessoryInfo projectAccessoryInfo, HttpServletRequest request, HttpServletResponse response, RedirectAttributes redirectAttributes) {
+		try {
+            String fileName = "附件结构"+DateUtils.getDate("yyyyMMddHHmmss")+".xlsx";
+            Page<ProjectAccessoryInfo> page = projectAccessoryService.findPage(new Page<ProjectAccessoryInfo>(request, response, -1), projectAccessoryInfo);
+    		new ExportExcel("附件结构", ProjectAccessoryInfo.class).setDataList(page.getList()).write(response, fileName).dispose();
+    		return null;
+		} catch (Exception e) {
+			addMessage(redirectAttributes, "导出附件结构记录失败!失败信息:"+e.getMessage());
+		}
+		return "redirect:"+Global.getAdminPath()+"/projectAccessory/projectAccessory/?repage";
+    }
+
+	/**
+	 * 导入Excel数据
+	 * @param file
+	 * @param redirectAttributes
+	 * @return
+	 */
+	@RequiresPermissions("projectAccessory:projectAccessory:import")
+    @RequestMapping(value = "import", method=RequestMethod.POST)
+    public String importFile(MultipartFile file, RedirectAttributes redirectAttributes) {
+		try {
+			int successNum = 0;
+			int failureNum = 0;
+			StringBuilder failureMsg = new StringBuilder();
+			ImportExcel ei = new ImportExcel(file, 1, 0);
+			List<ProjectAccessoryInfo> list = ei.getDataList(ProjectAccessoryInfo.class);
+			for (ProjectAccessoryInfo projectAccessoryInfo : list){
+				try{
+					projectAccessoryService.save(projectAccessoryInfo);
+					successNum++;
+				}catch(ConstraintViolationException ex){
+					failureNum++;
+				}catch (Exception ex) {
+					failureNum++;
+				}
+			}
+			if (failureNum>0){
+				failureMsg.insert(0, ",失败 "+failureNum+" 条附件结构记录。");
+			}
+			addMessage(redirectAttributes, "已成功导入 "+successNum+" 条附件结构记录"+failureMsg);
+		} catch (Exception e) {
+			addMessage(redirectAttributes, "导入附件结构失败!失败信息:"+e.getMessage());
+		}
+		return "redirect:"+Global.getAdminPath()+"/projectAccessory/projectAccessory/?repage";
+    }
+
+	/**
+	 * 下载导入附件结构数据模板
+	 * @param response
+	 * @param redirectAttributes
+	 * @return
+	 */
+	@RequiresPermissions("projectAccessory:projectAccessory:import")
+    @RequestMapping(value = "import/template")
+    public String importFileTemplate(HttpServletResponse response, RedirectAttributes redirectAttributes) {
+		try {
+            String fileName = "附件结构数据导入模板.xlsx";
+    		List<ProjectAccessoryInfo> list = Lists.newArrayList();
+    		new ExportExcel("附件结构数据", ProjectAccessoryInfo.class, 1).setDataList(list).write(response, fileName).dispose();
+    		return null;
+		} catch (Exception e) {
+			addMessage(redirectAttributes, "导入模板下载失败!失败信息:"+e.getMessage());
+		}
+		return "redirect:"+Global.getAdminPath()+"/projectAccessory/projectAccessory/?repage";
+    }
+
+
+    /**
+     * 获取机构JSON数据。
+     *
+     * @param extId    排除的ID
+     * @return
+     */
+    @RequiresPermissions("user")
+    @ResponseBody
+    @RequestMapping(value = "treeData")
+    public List<Map<String, Object>> treeData(@RequestParam(required = false) String extId) {
+        List<Map<String, Object>> mapList = Lists.newArrayList();
+        List<ProjectAccessoryInfo> list = projectAccessoryService.findTreeList(new ProjectAccessoryInfo());
+        for (int i = 0; i < list.size(); i++) {
+            ProjectAccessoryInfo e = list.get(i);
+            if ((StringUtils.isBlank(extId) || (extId != null && !extId.equals(e.getId()) && e.getParentIds().indexOf("," + extId + ",") == -1)) ) {
+                Map<String, Object> map = Maps.newHashMap();
+                map.put("id", e.getId());
+                map.put("pId", e.getParentId());
+                map.put("pIds", e.getParentIds());
+                map.put("name", e.getStandardDetail());
+                map.put("grade", e.getGrade());
+                mapList.add(map);
+            }
+        }
+        return mapList;
+    }
+
+
+    @ResponseBody
+    @RequestMapping(value = "jsonData")
+    public ProjectAccessoryInfo jsonData(@RequestParam(required = false) String id, HttpServletResponse response) {
+        ProjectAccessoryInfo entity = null;
+        if (StringUtils.isNotBlank(id)){
+            entity = projectAccessoryService.get(id);
+        }
+        if (entity == null){
+            entity = new ProjectAccessoryInfo();
+        }
+        List<ProjectAccessoryInfo> list = new ArrayList<>();
+        list.add(entity);
+		projectAccessoryService.queryProofread(list);
+        return entity;
+    }
+
+	/**
+	 * 根据项目id查询工作内容信息Tree
+	 * 将原列表变更为树形图结构
+	 * @param projectId
+	 * @return
+	 */
+	@RequestMapping("getProjectAccessoryTreeData")
+	@ResponseBody
+	public Map<String,List> getProjectAccessoryTreeData(String projectId){
+		Map<String,List> map = new HashMap<>();
+		List<ProjectAccessoryTree> projectAccessorys = new ArrayList<>();
+		//根据项目id查询工作内容信息Tree(父节点信息)
+		List<ProjectAccessoryTree> projectAccessoryList = projectAccessoryService.projectAccessoryParentList();
+		if (null != projectAccessoryList) {
+			for (ProjectAccessoryTree accessoryInfo : projectAccessoryList) {
+				projectAccessorys.add(accessoryInfo);
+				List<ProjectAccessoryTree> projectAccessoryListByParentId = projectAccessoryService.projectAccessoryListByParentId(accessoryInfo.getId());
+				if(projectAccessoryListByParentId.size()>0){
+					for (ProjectAccessoryTree accessoryData: projectAccessoryListByParentId) {
+						List<WorkClientAttachment> workAttachments = projectAccessoryService.getWorkAttachments(accessoryData.getId(),projectId);
+						if(workAttachments.size()>0){
+							accessoryData.setWorkAttachments(workAttachments);
+						}
+					}
+					projectAccessorys.addAll(projectAccessoryListByParentId);
+				}
+				//判断,只有子节点才会进行查询
+				if(!"0".equals(accessoryInfo.getPid())){
+					//根据id和项目id查询上传附件信息的名称集合
+				}
+			}
+		}
+		//将项目id带回去
+		for (ProjectAccessoryTree info: projectAccessorys) {
+			info.setProjectId(projectId);
+		}
+		map.put("data",projectAccessorys);
+		return map;
+	}
+
+	/**
+	 * 跳转到附件页面
+	 * @param attachmentId
+	 * @param projectId
+	 * @return
+	 */
+	@RequestMapping("workAttachmentForm")
+	public String workAttachmentForm(String attachmentId, String projectId, Model model){
+		ProjectAccessoryTree projectAccessory = new ProjectAccessoryTree();
+		List<WorkClientAttachment> workAttachments = projectAccessoryService.getWorkAttachments(attachmentId,projectId);
+		projectAccessory.setWorkAttachments(workAttachments);
+		projectAccessory.setProjectId(projectId);
+		projectAccessory.setId(attachmentId);
+		model.addAttribute("projectAccessory", projectAccessory);
+		return "modules/projectAccessory/workAttachmentForm";
+	}
+
+	/**
+	 * 跳转到附件详情页面
+	 * @param attachmentId
+	 * @param projectId
+	 * @return
+	 */
+	@RequestMapping("workAttachmentView")
+	public String workAttachmentView(String attachmentId, String projectId, Model model){
+		ProjectAccessoryTree projectAccessory = new ProjectAccessoryTree();
+		List<WorkClientAttachment> workAttachments = projectAccessoryService.getWorkAttachments(attachmentId,projectId);
+		projectAccessory.setWorkAttachments(workAttachments);
+		projectAccessory.setProjectId(projectId);
+		projectAccessory.setId(attachmentId);
+		model.addAttribute("projectAccessory", projectAccessory);
+		return "modules/projectAccessory/workAttachmentView";
+	}
+
+	/**
+	 * 新增修改删除附件信息并返回信息
+	 * @param projectAccessory
+	 * @return
+	 */
+	@RequestMapping("saveWorkAttachment")
+	@ResponseBody
+	public Object saveWorkAttachment(ProjectAccessoryTree projectAccessory){
+		Map<String,Object> map = new HashMap<>();
+		//新增修改删除附件信息
+		projectAccessoryService.saveWorkAttachment(projectAccessory);
+		if(projectAccessory.getWorkAttachments().size()>0){
+			map.put("str","新增附件信息成功!");
+		}else{
+			map.put("str","");
+		}
+		return map;
+	}
+}

+ 7 - 0
src/main/java/com/jeeplus/modules/projectcontentinfo/dao/ProjectReportRecordDao.java

@@ -40,4 +40,11 @@ public interface ProjectReportRecordDao extends CrudDao<ProjectReportRecord> {
     int updateRuralProjectReportRecord(ProjectReportRecord projectReportRecord);
 
     ProjectReportRecord getRecord(ProjectReportRecord projectReportRecord);
+
+    /**
+     * 根据报告id查询项目id
+     * @param reportId
+     * @return
+     */
+    String getProjectId(String reportId);
 }

+ 5 - 0
src/main/java/com/jeeplus/modules/projectcontentinfo/service/ProjectReportRecordService.java

@@ -13,6 +13,7 @@ import com.jeeplus.modules.act.service.ActTaskService;
 import com.jeeplus.modules.projectcontentinfo.dao.ProjectReportRecordDao;
 import com.jeeplus.modules.projectcontentinfo.entity.ProjectReportData;
 import com.jeeplus.modules.projectcontentinfo.entity.ProjectReportRecord;
+import com.jeeplus.modules.ruralprojectrecords.service.RuralProjectMessageService;
 import com.jeeplus.modules.sys.dao.WorkattachmentDao;
 import com.jeeplus.modules.sys.entity.Office;
 import com.jeeplus.modules.sys.entity.User;
@@ -72,11 +73,15 @@ public class ProjectReportRecordService extends CrudService<ProjectReportRecordD
 	@Autowired
 	private ProjectReportDataService projectReportDataService;
 	@Autowired
+	private RuralProjectMessageService ruralProjectMessageService;
+	@Autowired
 	ProjectReportRecordDao projectReportRecordDao;
 	public ProjectReportRecord get(String id) {
 		ProjectReportRecord projectReportRecord= super.get(id);
 		if (null == projectReportRecord){
 			projectReportRecord = dao.getRuralProjectReportRecord(id);
+			ProjectReportData reportData = ruralProjectMessageService.getProjectReportDateByProjectId(dao.getProjectId(projectReportRecord.getReport().getId()));
+			projectReportRecord.setReport(reportData);
 			projectReportRecord.setType(2);
 		}else{
 			projectReportRecord.setType(1);

+ 6 - 0
src/main/java/com/jeeplus/modules/ruralprojectrecords/dao/RuralProjectMessageDao.java

@@ -93,4 +93,10 @@ public interface RuralProjectMessageDao extends CrudDao<RuralProjectRecords> {
      * @param projectReportRecord
      */
     void deleteRecord(ProjectReportRecord projectReportRecord);
+
+    /**
+     * 根据项目id删除归档附件信息
+     * @param projectId
+     */
+    void deleteWorkAttachment(String projectId);
 }

+ 2 - 0
src/main/java/com/jeeplus/modules/ruralprojectrecords/service/RuralProjectMessageService.java

@@ -1375,6 +1375,8 @@ public class RuralProjectMessageService extends CrudService<RuralProjectMessageD
     @Transactional(readOnly = false)
     public void deleteRecord(ProjectReportRecord projectReportRecord){
         dao.deleteRecord(projectReportRecord);
+        //删除附件信息
+        dao.deleteWorkAttachment( projectReportRecord.getReportId());
     }
 
 }

+ 3 - 0
src/main/java/com/jeeplus/modules/ruralprojectrecords/web/RuralCostProjectMessageController.java

@@ -464,6 +464,7 @@ public class RuralCostProjectMessageController extends BaseController {
         reportData.setProject(projectRecords);
         projectReportRecord.setReport(reportData);
         model.addAttribute("projectReportRecord", projectReportRecord);
+        model.addAttribute("project", projectReportRecord.getReport().getProject());
         if(null != projectContractInfo){
             if(null != projectContractInfo.getWorkClientInfoList()){
                 model.addAttribute("workClientInfoName", projectContractInfo.getWorkClientInfoList().get(0).getName());
@@ -501,6 +502,7 @@ public class RuralCostProjectMessageController extends BaseController {
         }
         projectReportRecord.setView("modify");
         model.addAttribute("projectReportRecord", projectReportRecord);
+        model.addAttribute("project", projectReportRecord.getReport().getProject());
         if (StringUtils.isNotBlank(projectReportRecord.getView()) && projectReportRecord.getView().equals("view")){
             return "modules/ruralprojectrecords/projectReportRecord/projectReportRecordView";
         }else if (StringUtils.isNotBlank(projectReportRecord.getView()) && projectReportRecord.getView().equals("modiftApply")){
@@ -622,6 +624,7 @@ public class RuralCostProjectMessageController extends BaseController {
         ProjectReportData reportData = ruralProjectMessageService.getProjectReportDateByProjectId(projectReportRecord.getReportId());
         if(null != reportData){
             ProjectReportRecord projectReportRecordInfo =ruralProjectMessageService.getProjectReportRecord(reportData.getId());
+            projectReportRecordInfo.setReportId(projectReportRecord.getReportId());
             //删除归档信息
             ruralProjectMessageService.deleteRecord(projectReportRecordInfo);
         }

+ 3 - 0
src/main/java/com/jeeplus/modules/ruralprojectrecords/web/RuralProjectMessageController.java

@@ -459,6 +459,7 @@ public class RuralProjectMessageController extends BaseController {
         reportData.setProject(projectRecords);
         projectReportRecord.setReport(reportData);
         model.addAttribute("projectReportRecord", projectReportRecord);
+        model.addAttribute("project", projectReportRecord.getReport().getProject());
         if(null != projectContractInfo){
             if(null != projectContractInfo.getWorkClientInfoList()){
                 model.addAttribute("workClientInfoName", projectContractInfo.getWorkClientInfoList().get(0).getName());
@@ -497,6 +498,7 @@ public class RuralProjectMessageController extends BaseController {
         projectReportRecord.setView("modify");
 
         model.addAttribute("projectReportRecord", projectReportRecord);
+        model.addAttribute("project", projectReportRecord.getReport().getProject());
         if (StringUtils.isNotBlank(projectReportRecord.getView()) && projectReportRecord.getView().equals("view")){
             return "modules/ruralprojectrecords/projectReportRecord/projectReportRecordView";
         }else if (StringUtils.isNotBlank(projectReportRecord.getView()) && projectReportRecord.getView().equals("modiftApply")){
@@ -616,6 +618,7 @@ public class RuralProjectMessageController extends BaseController {
         ProjectReportData reportData = ruralProjectMessageService.getProjectReportDateByProjectId(projectReportRecord.getReportId());
         if(null != reportData){
             ProjectReportRecord projectReportRecordInfo =ruralProjectMessageService.getProjectReportRecord(reportData.getId());
+            projectReportRecordInfo.setReportId(projectReportRecord.getReportId());
             //删除归档信息
             ruralProjectMessageService.deleteRecord(projectReportRecordInfo);
         }

+ 9 - 0
src/main/java/com/jeeplus/modules/workclientinfo/dao/WorkClientAttachmentDao.java

@@ -7,6 +7,7 @@ import com.jeeplus.common.persistence.CrudDao;
 import com.jeeplus.common.persistence.annotation.MyBatisDao;
 import com.jeeplus.modules.workclientinfo.entity.WorkClientAttachment;
 
+import java.util.List;
 import java.util.Map;
 
 /**
@@ -17,4 +18,12 @@ import java.util.Map;
 @MyBatisDao
 public interface WorkClientAttachmentDao extends CrudDao<WorkClientAttachment> {
     int deleteCase(String  attachmentId);
+
+    List<WorkClientAttachment> getList(WorkClientAttachment attchment);
+
+    /**
+     * 新增附件信息
+     * @param attchment
+     */
+    void insertWorkAttachment(WorkClientAttachment attchment);
 }

+ 9 - 0
src/main/java/com/jeeplus/modules/workclientinfo/entity/WorkClientAttachment.java

@@ -22,6 +22,7 @@ public class WorkClientAttachment extends DataEntity<WorkClientAttachment> {
 	private String attachmentId; //外联 客户编号
 	private String attachmentFlag; //附件类别
 	private String companyId; //附件类别
+	private String projectId; //项目id
 
 	public WorkClientAttachment() {
 		super();
@@ -91,4 +92,12 @@ public class WorkClientAttachment extends DataEntity<WorkClientAttachment> {
 	public void setCompanyId(String companyId) {
 		this.companyId = companyId;
 	}
+
+	public String getProjectId() {
+		return projectId;
+	}
+
+	public void setProjectId(String projectId) {
+		this.projectId = projectId;
+	}
 }

+ 1 - 0
src/main/java/com/jeeplus/modules/workprojectnotify/web/WorkProjectNotifyController.java

@@ -1543,6 +1543,7 @@ public class WorkProjectNotifyController extends BaseController {
 					projectReportRecord.setAct(act);
 					projectReportRecord.setHome("home");
 					model.addAttribute("projectReportRecord", projectReportRecord);
+					model.addAttribute("project", projectReportRecord.getReport().getProject());
 					if (workProjectNotify.getRemarks().contains("待审批") && !"1".equals(workProjectNotify.getStatus())) {
 						return "modules/projectcontentinfo/projectReportRecordAudit";
 					} else if (workProjectNotify.getRemarks().contains("重新申请") && !"1".equals(workProjectNotify.getStatus())) {

+ 211 - 0
src/main/resources/mappings/modules/projectAccessory/ProjectAccessoryDao.xml

@@ -0,0 +1,211 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.jeeplus.modules.projectAccessory.dao.ProjectAccessoryDao">
+    
+	<sql id="workReviewStandardColumns">
+		a.id AS "id",
+		a.create_by AS "createBy.id",
+		a.create_date AS "createDate",
+		a.update_by AS "updateBy.id",
+		a.update_date AS "updateDate",
+		a.remarks AS "remarks",
+		a.del_flag AS "delFlag",
+		a.parent_id AS "parent.id",
+		a.standard_detail AS "standardDetail",
+		a.parent_ids AS "parentIds",
+		a.company_id AS "companyId",
+		a.order_num AS "orderNum"
+	</sql>
+	
+    
+	<select id="get" resultType="com.jeeplus.modules.projectAccessory.entity.ProjectAccessoryInfo" >
+		SELECT 
+			<include refid="workReviewStandardColumns"/>
+		FROM project_accessory_structure_info a
+		WHERE a.id = #{id}
+	</select>
+	
+	<select id="findList" resultType="com.jeeplus.modules.projectAccessory.entity.ProjectAccessoryInfo" >
+		SELECT 
+			<include refid="workReviewStandardColumns"/>
+		FROM project_accessory_structure_info a
+		<where>
+            <if test="standardDetail!=null and standardDetail != ''">
+                and a.standard_detail like concat('%',#{standardDetail},'%')
+            </if>
+            <if test="parentIds!=null and parentIds != ''">
+                and a.parent_ids like concat('%',#{parentIds},'%')
+            </if>
+            <choose>
+				<when test="companyId!=null and companyId != ''">
+					and a.company_id = #{companyId}
+				</when>
+				<otherwise>
+					and a.company_id = '0'
+				</otherwise>
+			</choose>
+            <if test="orderNum != null and orderNum!=0">
+                and a.order_num = #{orderNum}
+            </if>
+		</where>
+		<choose>
+			<when test="page !=null and page.orderBy != null and page.orderBy != ''">
+				ORDER BY ${page.orderBy}
+			</when>
+			<otherwise>
+				ORDER BY a.order_num
+			</otherwise>
+		</choose>
+	</select>
+
+	<select id="projectAccessoryParentList" resultType="com.jeeplus.modules.projectAccessory.entity.ProjectAccessoryTree" >
+		SELECT
+			a.id as "id", a.standard_detail as "type",a.parent_id as "pid"
+		FROM project_accessory_structure_info a
+		where a.parent_id ="0"
+	</select>
+
+	<select id="projectAccessoryListByParentId" resultType="com.jeeplus.modules.projectAccessory.entity.ProjectAccessoryTree" >
+		SELECT
+			a.id as "id", a.standard_detail as "type",a.parent_id as "pid"
+		FROM project_accessory_structure_info a
+		where a.parent_id =#{parentId}
+	</select>
+	
+	<select id="findAllList" resultType="com.jeeplus.modules.projectAccessory.entity.ProjectAccessoryInfo" >
+		SELECT 
+			<include refid="workReviewStandardColumns"/>
+		FROM project_accessory_structure_info a
+		<where>
+			a.del_flag = #{DEL_FLAG_NORMAL}
+		</where>		
+		<choose>
+			<when test="page !=null and page.orderBy != null and page.orderBy != ''">
+				ORDER BY ${page.orderBy}
+			</when>
+			<otherwise>
+				ORDER BY a.update_date DESC
+			</otherwise>
+		</choose>
+	</select>
+	
+	<insert id="insert">
+		INSERT INTO project_accessory_structure_info(
+			id,
+			create_by,
+			create_date,
+			update_by,
+			update_date,
+			remarks,
+			del_flag,
+			parent_id,
+			standard_detail,
+			parent_ids,
+			company_id,
+			order_num
+		) VALUES (
+			#{id},
+			#{createBy.id},
+			#{createDate},
+			#{updateBy.id},
+			#{updateDate},
+			#{remarks},
+			#{delFlag},
+			#{parent.id},
+			#{standardDetail},
+			#{parentIds},
+			#{companyId},
+			#{orderNum}
+		)
+	</insert>
+	
+	<update id="update">
+		UPDATE project_accessory_structure_info SET
+			update_by = #{updateBy.id},
+			update_date = #{updateDate},
+			remarks = #{remarks},
+			parent_id = #{parent.id},
+			standard_detail = #{standardDetail},
+			parent_ids = #{parentIds},
+			company_id = #{companyId},
+			order_num = #{orderNum}
+		WHERE id = #{id}
+	</update>
+	
+	
+	<!--物理删除-->
+	<update id="delete">
+		DELETE FROM project_accessory_structure_info
+		WHERE id = #{id} OR find_in_set(#{id},parent_ids)
+	</update>
+	
+	<!--逻辑删除-->
+	<update id="deleteByLogic">
+		UPDATE project_accessory_structure_info SET
+			del_flag = #{DEL_FLAG_DELETE}
+		WHERE id = #{id} OR find_in_set(#{id},parent_ids)
+	</update>
+	
+	
+	<!-- 根据实体名称和字段名称和字段值获取唯一记录 -->
+	<select id="findUniqueByProperty" resultType="com.jeeplus.modules.projectAccessory.entity.ProjectAccessoryInfo" statementType="STATEMENT">
+		select * FROM project_accessory_structure_info  where ${propertyName} = '${value}'
+	</select>
+
+    <select id="fingIds" resultType="com.jeeplus.modules.projectAccessory.entity.ProjectAccessoryInfo">
+        SELECT <include refid="workReviewStandardColumns"/>
+        FROM project_accessory_structure_info a
+        <where>
+            <if test="parentIdSet!=null and parentIdSet.size!=0">
+                a.id in
+                <foreach collection="parentIdSet" item="parentId" separator="," open="(" close=")">
+                      #{parentId}
+                </foreach>
+            </if>
+            AND del_flag ='0'
+			AND company_id = #{companyId}
+        </where>
+        ORDER BY a.order_num
+    </select>
+    <select id="fingByIds" resultType="com.jeeplus.modules.projectAccessory.entity.ProjectAccessoryInfo">
+        SELECT <include refid="workReviewStandardColumns"/>
+        FROM project_accessory_structure_info a
+        <where>
+            <if test="parentIdSet!=null and parentIdSet.size!=0">
+                a.id in
+                <foreach collection="parentIdSet" item="parentId" separator="," open="(" close=")">
+                      #{parentId}
+                </foreach>
+            </if>
+            AND del_flag ='0'
+			AND company_id = #{companyId}
+			AND parent_ids like concat('%',#{parentIds},'%')
+        </where>
+        ORDER BY a.order_num
+    </select>
+
+    <select id="findByParentIdsLike" resultType="com.jeeplus.modules.projectAccessory.entity.ProjectAccessoryInfo">
+        SELECT
+        <include refid="workReviewStandardColumns"/>
+        FROM project_accessory_structure_info a
+        WHERE a.del_flag = #{DEL_FLAG_NORMAL} AND (a.parent_ids LIKE
+        <if test="dbName == 'mysql'">concat('%,',#{parentIds},',%')</if>
+        OR a.id = #{id})
+        ORDER BY a.order_num
+    </select>
+
+    <update id="updateParentIds">
+        UPDATE project_accessory_structure_info SET
+			parent_id = #{parent.id},
+			parent_ids = #{parentIds}
+		WHERE id = #{id}
+    </update>
+
+    <select id="selectOrderNum" resultType="java.lang.String">
+        SELECT MAX(order_num) FROM project_accessory_structure_info WHERE parent_id = #{parentId}
+    </select>
+
+    <select id="getByDetail" resultType="com.jeeplus.modules.projectAccessory.entity.ProjectAccessoryInfo">
+        SELECT * FROM project_accessory_structure_info WHERE standard_detail = '标准部校核'
+    </select>
+</mapper>

+ 4 - 0
src/main/resources/mappings/modules/projectcontentinfo/ProjectReportRecordDao.xml

@@ -322,4 +322,8 @@
 		<include refid="projectReportRecordJoins"/>
 		WHERE a.process_instance_id = #{processInstanceId}
 	</select>
+
+	<select id="getProjectId" resultType="java.lang.String">
+		select project_id as projectId from project_report_data where id = #{reportId}
+	</select>
 </mapper>

+ 4 - 0
src/main/resources/mappings/modules/ruralprojectrecords/RuralProjectMessageDao.xml

@@ -919,4 +919,8 @@
 	<delete id="deleteRecord">
 		delete from rural_project_report_record where id = #{id}
 	</delete>
+
+	<delete id="deleteWorkAttachment">
+		delete from work_attachment where  project_id= #{projectId}
+	</delete>
 </mapper>

+ 23 - 0
src/main/resources/mappings/modules/workclientinfo/WorkClientAttachmentDao.xml

@@ -92,6 +92,9 @@
         attachment_name,
         company_id,
         attachment_flag
+        <if test="projectId != null and projectId != ''">
+            ,project_id
+        </if>
         ) VALUES (
         #{id},
         #{createBy.id},
@@ -107,6 +110,9 @@
         #{attachmentName},
         #{companyId},
         #{attachmentFlag}
+        <if test="projectId != null and projectId != ''">
+            ,#{projectId}
+        </if>
         )
     </insert>
 
@@ -150,4 +156,21 @@
         select * FROM work_attachment  where ${propertyName} = '${value}'
     </select>
 
+    <select id="getList" resultType="WorkClientAttachment" >
+        SELECT
+        <include refid="workClientAttachmentColumns"/>
+        FROM work_attachment a
+        <include refid="workClientAttachmentJoins"/>
+        <where>
+            a.del_flag = #{DEL_FLAG_NORMAL}
+            <if test="attachmentId != null and attachmentId != ''">
+                AND a.attachment_id = #{attachmentId}
+            </if>
+            <if test="projectId != null and projectId != ''">
+                AND project_id = #{projectId}
+            </if>
+        </where>
+
+        ORDER BY a.update_date DESC
+    </select>
 </mapper>

+ 78 - 0
src/main/webapp/WEB-INF/tags/sys/treeselectAccessory.tag

@@ -0,0 +1,78 @@
+<%@ tag language="java" pageEncoding="UTF-8"%>
+<%@ include file="/webpage/include/taglib.jsp"%>
+<%@ attribute name="id" type="java.lang.String" required="true" description="编号"%>
+<%@ attribute name="name" type="java.lang.String" required="true" description="隐藏域名称(ID)"%>
+<%@ attribute name="value" type="java.lang.String" required="true" description="隐藏域值(ID)"%>
+<%@ attribute name="labelName" type="java.lang.String" required="true" description="输入框名称(Name)"%>
+<%@ attribute name="labelValue" type="java.lang.String" required="true" description="输入框值(Name)"%>
+<%@ attribute name="title" type="java.lang.String" required="true" description="选择框标题"%>
+<%@ attribute name="url" type="java.lang.String" required="true" description="树结构数据地址"%>
+<%@ attribute name="checked" type="java.lang.Boolean" required="false" description="是否显示复选框,如果不需要返回父节点,请设置notAllowSelectParent为true"%>
+<%@ attribute name="extId" type="java.lang.String" required="false" description="排除掉的编号(不能选择的编号)"%>
+<%@ attribute name="isAll" type="java.lang.Boolean" required="false" description="是否列出全部数据,设置true则不进行数据权限过滤(目前仅对Office有效)"%>
+<%@ attribute name="notAllowSelectRoot" type="java.lang.Boolean" required="false" description="不允许选择根节点"%>
+<%@ attribute name="notAllowSelectParent" type="java.lang.Boolean" required="false" description="不允许选择父节点"%>
+<%@ attribute name="module" type="java.lang.String" required="false" description="过滤栏目模型(只显示指定模型,仅针对CMS的Category树)"%>
+<%@ attribute name="selectScopeModule" type="java.lang.Boolean" required="false" description="选择范围内的模型(控制不能选择公共模型,不能选择本栏目外的模型)(仅针对CMS的Category树)"%>
+<%@ attribute name="allowClear" type="java.lang.Boolean" required="false" description="是否允许清除"%>
+<%@ attribute name="allowInput" type="java.lang.Boolean" required="false" description="文本框可填写"%>
+<%@ attribute name="cssClass" type="java.lang.String" required="false" description="css样式"%>
+<%@ attribute name="cssStyle" type="java.lang.String" required="false" description="css样式"%>
+<%@ attribute name="smallBtn" type="java.lang.Boolean" required="false" description="缩小按钮显示"%>
+<%@ attribute name="hideBtn" type="java.lang.Boolean" required="false" description="是否显示按钮"%>
+<%@ attribute name="disabled" type="java.lang.String" required="false" description="是否限制选择,如果限制,设置为disabled"%>
+<%@ attribute name="dataMsgRequired" type="java.lang.String" required="false" description=""%>
+	<input id="${id}Id" name="${name}" class="${cssClass}" type="hidden" value="${value}"/>
+	<div class="input-group">
+		<input id="${id}Name" name="${labelName}" ${allowInput?'':'readonly="readonly"'}  type="text" value="${labelValue}" data-msg-required="${dataMsgRequired}"
+		class="${cssClass}" style="${cssStyle}"/>
+       		 <span class="input-group-btn">
+	       		 <button type="button"  id="${id}Button" class="btn <c:if test="${fn:contains(cssClass, 'input-sm')}"> btn-sm </c:if><c:if test="${fn:contains(cssClass, 'input-lg')}"> btn-lg </c:if>  btn-primary ${disabled} ${hideBtn ? 'hide' : ''}"><i class="fa fa-search"></i>
+	             </button> 
+       		 </span>
+       		
+    </div>
+	 <label id="${id}Name-error" class="error" for="${id}Name" style="display:none"></label>
+<script type="text/javascript">
+	$("#${id}Button").click(function(){
+		// 是否限制选择,如果限制,设置为disabled
+		if ($("#${id}Button").hasClass("disabled")){
+			return true;
+		}
+		// 正常打开	
+		top.layer.open({
+		    type: 2, 
+		    area: ['300px', '420px'],
+		    title:"选择${title}",
+		    ajaxData:{selectIds: $("#${id}Id").val()},
+		    content: "${ctx}/tag/treeselect?url="+encodeURIComponent("${url}")+"&module=${module}&checked=${checked}&extId=${extId}&isAll=${isAll}" ,
+		    btn: ['确定', '关闭']
+    	       ,yes: function(index, layero){ //或者使用btn1
+						var tree = layero.find("iframe")[0].contentWindow.tree;//h.find("iframe").contents();
+						var ids = [], names = [], nodes = [];
+						if ("${checked}" == "true"){
+							nodes = tree.getCheckedNodes(true);
+						}else{
+							nodes = tree.getSelectedNodes();
+						}
+						for(var i=0; i<nodes.length; i++) {//<c:if test="${checked && notAllowSelectParent}">
+							if (nodes[i].isParent){
+								continue; // 如果为复选框选择,则过滤掉父节点
+							}//</c:if>
+							ids.push(nodes[i].id);
+							names.push(nodes[i].name);//<c:if test="${!checked}">
+							break; // 如果为非复选框选择,则返回第一个选择  </c:if>
+						}
+						$("#${id}Id").val(ids.join(",").replace(/u_/ig,""));
+						$("#${id}Name").val(names.join(","));
+						$("#${id}Name").focus();
+						setParentInfo($("#${id}Id").val());
+						top.layer.close(index);
+				    	       },
+    	cancel: function(index){ //或者使用btn2
+    	           //按钮【按钮二】的回调
+    	       }
+		}); 
+	
+	});
+</script>

+ 97 - 0
src/main/webapp/webpage/modules/projectAccessory/projectAccessoryForm.jsp

@@ -0,0 +1,97 @@
+<%@ page contentType="text/html;charset=UTF-8" %>
+<%@ include file="/webpage/include/taglib.jsp"%>
+<html>
+<head>
+	<title>复核标准管理</title>
+	<meta name="decorator" content="default"/>
+	<style>
+		label.error{
+			top:40px;
+			left:0;
+		}
+		#standardDetail-error{
+			top:82px;
+			left:0;
+		}
+	</style>
+	<script type="text/javascript">
+		var validateForm;
+		function doSubmit(){//回调函数,在编辑和保存动作时,供openDialog调用提交表单。
+		  if(validateForm.form()){
+			  $("#inputForm").submit();
+			  return true;
+		  }
+	
+		  return false;
+		}
+		$(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);
+					}
+				}
+			});
+            var edit = "${workReviewStandard.id}";
+            if(edit!=null && edit!=''){
+                $("#reviewParentButton").attr("disabled","disabled");
+            }
+            setParentInfo($("#reviewParentId").val());
+		});
+        function setParentInfo(parentId){
+            $.ajax({
+                url:"${ctx}/projectAccessory/projectAccessory/jsonData",
+                dataType:"json",
+                data:{id:parentId},
+                success:function (data) {
+                    if(data.proofread==1&&data.grade==1){
+                        $("#maxDeductTr").show();
+                    }else {
+                        $("#maxDeductTr").hide();
+                    }
+                }
+            })
+        }
+	</script>
+</head>
+<body>
+<div class="single-form">
+	<div class="container">
+		<form:form id="inputForm" modelAttribute="projectAccessoryInfo" action="${ctx}/projectAccessory/projectAccessory/save" method="post" class="form-horizontal">
+		<form:hidden path="id"/>
+		<form:hidden path="companyId"/>
+			<div class="form-group layui-row first">
+				<div class="form-group-label"><h2>附件结构信息</h2></div>
+				<div class="layui-item layui-col-sm6">
+					<label class="layui-form-label">上级节点:</label>
+					<div class="layui-input-block with-icon">
+						<sys:treeselectAccessory id="reviewParent" name="parent.id" value="${projectAccessoryInfo.parent.id}" labelName="parent.name" labelValue="${projectAccessoryInfo.parent.standardDetail}"
+											  title="附件结构" url="/projectAccessory/projectAccessory/treeData" extId="${projectAccessoryInfo.id}"  cssClass="form-control  layui-input" allowClear="${projectAccessoryInfo.currentUser.admin}"/>
+					</div>
+				</div>
+				<div class="layui-item layui-col-sm6">
+					<label class="layui-form-label double-line"><span class="require-item">*</span>附件结构名称:</label>
+					<div class="layui-input-block">
+						<form:input path="standardDetail" htmlEscape="false" class="form-control layui-input required"/>
+					</div>
+				</div>
+				<div class="layui-item layui-col-sm6">
+					<label class="layui-form-label">序号:</label>
+					<div class="layui-input-block">
+						<form:input path="orderNum" htmlEscape="false"  readonly="true"  class="form-control layui-input"/>
+					</div>
+				</div>
+			</div>
+		</form:form>
+	</div>
+</div>
+</body>
+</html>

+ 127 - 0
src/main/webapp/webpage/modules/projectAccessory/projectAccessoryList.jsp

@@ -0,0 +1,127 @@
+<%@ page contentType="text/html;charset=UTF-8" %>
+<%@ include file="/webpage/include/taglib.jsp"%>
+<html>
+<head>
+	<title>复核标准管理</title>
+    <meta name="decorator" content="default"/>
+    <%@include file="/webpage/include/treetable.jsp" %>
+    <script type="text/javascript">
+        $(document).ready(function() {
+            $("#treeTable").treeTable({expandLevel : 5},{ expandable: true });
+        });
+    </script>
+	<style>
+		body{
+			background-color:transparent;
+			filter:progid:DXImageTransform.Microsoft.gradient(startColorstr=#26FFFFFF, endColorstr=#26FFFFFF);
+			color:#ffffff;
+			background-color:rgba(255,255,255,0);
+			height:100%;
+		}
+	</style>
+</head>
+<body >
+	<div class="wrapper wrapper-content">
+		<sys:message content="${message}"/>
+		<div class="layui-row">
+			<div class="full-width fl">
+				<div class="contentShadow layui-row" id="queryDiv">
+				<form:form id="searchForm" modelAttribute="projectAccessoryInfo" action="${ctx}/projectAccessory/projectAccessory/" method="post" class="form-inline">
+
+					<div class="commonQuery">
+						<div class="layui-item query athird">
+							<label class="layui-form-label double-line">附件结构名:</label>
+							<div class="layui-input-block with-icon">
+								<form:input path="standardDetail" htmlEscape="false" class=" form-control layui-input"></form:input>
+							</div>
+						</div>
+						<div class="layui-item query athird">
+							<label class="layui-form-label">序号:</label>
+							<div class="layui-input-block">
+								<form:input path="orderNum" htmlEscape="false" class=" form-control layui-input"></form:input>
+							</div>
+						</div>
+						<div class="layui-item athird">
+							<div class="input-group">
+								<button id="searchReset" style="margin-right: 10px;" class="fixed-btn searchReset fr" onclick="resetSearch()">重置</button>
+								<button id="searchQuery" class="fixed-btn searchQuery fr" onclick="search()">查询</button>
+							</div>
+						</div>
+						<div style="    clear:both;"></div>
+					</div>
+
+					</form:form>
+				</div>
+			</div>
+			<div class="full-width fl">
+				<div class="contentShadow layui-form contentDetails">
+					<div class="nav-btns">
+						<shiro:hasPermission name="projectAccessory:projectAccessory:add">
+							<table:addRow url="${ctx}/projectAccessory/projectAccessory/form" title="项目"></table:addRow><!-- 增加按钮 -->
+						</shiro:hasPermission>
+						<button class="nav-btn nav-btn-refresh" data-toggle="tooltip" data-placement="left" onclick="sortOrRefresh()" title="刷新"><i class="glyphicon glyphicon-repeat"></i>&nbsp;刷新</button>
+						<div style="clear: both;"></div>
+					</div>
+
+	
+					<!-- 表格 -->
+					<table id="treeTable" class="table table-bordered table-hover list-table">
+						<thead>
+							<tr>
+								<th  width="40%">附件结构名称</th>
+								<th >序号</th>
+								<th width="240px">操作</th>
+							</tr>
+						</thead>
+						<tbody>
+						<c:forEach items="${list}" var="projectAccessory">
+							<tr id="${projectAccessory.id}" pid="${projectAccessory.parent.id}">
+								<td><a  href="#" onclick="openDialogView('查看附件结构', '${ctx}/projectAccessory/projectAccessory/view?id=${projectAccessory.id}','80%', '60%')">
+										${projectAccessory.standardDetail}
+								</a></td>
+								<td style="text-align: center">
+									${projectAccessory.orderNum}
+								</td>
+								<td class="op-td text-center">
+									<div class="op-btn-box">
+										<c:if test="${projectAccessory.grade == 0}">
+											<shiro:hasPermission name="projectAccessory:projectAccessory:add">
+												<a href="javascript:void(0);" onclick="openDialog('添加附件结构', '${ctx}/projectAccessory/projectAccessory/form?parent.id=${projectAccessory.id}','80%','60%')" class="op-btn op-btn-add"><i class="fa fa-plus"></i> 添加下级结构</a>
+											</shiro:hasPermission>
+											<shiro:hasPermission name="projectAccessory:projectAccessory:edit">
+												<a href="javascript:void(0);" onclick="openDialog('修改附件结构', '${ctx}/projectAccessory/projectAccessory/form?id=${projectAccessory.id}','80%','60%')" class="op-btn op-btn-edit" ><i class="fa fa-edit"></i> 修改</a>
+											</shiro:hasPermission>
+											<shiro:hasPermission name="projectAccessory:projectAccessory:del">
+												<a href="${ctx}/projectAccessory/projectAccessory/delete?id=${projectAccessory.id}" onclick="return confirmx('确认要删除该复附件结构及其子附件结构吗?', this.href)"   class="op-btn op-btn-delete"><i class="fa fa-trash"></i> 删除</a>
+											</shiro:hasPermission>
+										</c:if>
+										<c:if test="${projectAccessory.grade ==1}">
+										<shiro:hasPermission name="projectAccessory:projectAccessory:edit">
+											<a href="javascript:void(0);" onclick="openDialog('修改附件结构', '${ctx}/projectAccessory/projectAccessory/form?id=${projectAccessory.id}','80%','60%')" class="op-btn op-btn-edit" ><i class="fa fa-edit"></i> 修改</a>
+										</shiro:hasPermission>
+										<shiro:hasPermission name="projectAccessory:projectAccessory:del">
+											<a href="${ctx}/projectAccessory/projectAccessory/delete?id=${projectAccessory.id}" onclick="return confirmx('确认要删除该复附件结构及其子附件结构吗?', this.href)"   class="op-btn op-btn-delete"><i class="fa fa-trash"></i> 删除</a>
+										</shiro:hasPermission>
+										</c:if>
+									</div>
+								</td>
+							</tr>
+						</c:forEach>
+						</tbody>
+					</table>
+	
+		<!-- 分页代码 -->
+	<%--<table:page page="${page}"></table:page>--%>
+
+				</div>
+			</div>
+		</div>
+</div>
+	<script>
+        resizeListWindow1();
+        $(window).resize(function(){
+            resizeListWindow1();
+        });
+	</script>
+</body>
+</html>

+ 76 - 0
src/main/webapp/webpage/modules/projectAccessory/projectAccessoryView.jsp

@@ -0,0 +1,76 @@
+<%@ 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">
+		var validateForm;
+		function doSubmit(){//回调函数,在编辑和保存动作时,供openDialog调用提交表单。
+		  if(validateForm.form()){
+			  $("#inputForm").submit();
+			  return true;
+		  }
+	
+		  return false;
+		}
+		$(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);
+					}
+				}
+			});
+		});
+	</script>
+</head>
+<body>
+<div class="single-form">
+	<div class="container view-form">
+		<form:form id="inputForm" modelAttribute="workReviewStandard" action="#" method="post" class="form-horizontal">
+		<form:hidden path="id"/>
+
+			<div class="form-group layui-row first">
+				<div class="form-group-label"><h2>标准信息</h2></div>
+				<div class="layui-item layui-col-sm12">
+					<label class="layui-form-label"><span class="require-item">*</span>上级节点:</label>
+					<div class="layui-input-block">
+						<input htmlEscape="false" readonly="true" class="form-control layui-input" value="${workReviewStandard.parent.standardDetail}"/>
+					</div>
+				</div>
+				<div class="layui-item layui-col-sm12 with-textarea">
+					<label class="layui-form-label"><span class="require-item">*</span>标准内容:</label>
+					<div class="layui-input-block">
+						<textarea htmlEscape="false" readonly="true" rows="4" style="resize:none;" class="form-control required">${workReviewStandard.standardDetail}</textarea>
+					</div>
+				</div>
+				<c:if test="${workReviewStandard.proofread == 1}">
+					<div class="layui-item layui-col-sm12">
+						<label class="layui-form-label"><span class="require-item">*</span>最多扣分:</label>
+						<div class="layui-input-block">
+							<input htmlEscape="false" readonly="true" class="form-control layui-input" value="${workReviewStandard.maxDeduct}"/>
+						</div>
+					</div>
+				</c:if>
+				<div class="layui-item layui-col-sm12">
+					<label class="layui-form-label">序号:</label>
+					<div class="layui-input-block">
+						<input htmlEscape="false" readonly="true" class="form-control layui-input" value=" ${workReviewStandard.orderNum}"/>
+					</div>
+				</div>
+
+			</div>
+		</form:form>
+	</div>
+</div>
+</body>
+</html>

+ 131 - 0
src/main/webapp/webpage/modules/projectAccessory/workAttachmentForm.jsp

@@ -0,0 +1,131 @@
+<%@ 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">
+		var validateForm;
+		function doSubmit(i){//回调函数,在编辑和保存动作时,供openDialog调用提交表单。
+			if(validateForm.form()){
+				$("#inputForm").submit();
+				return true;
+			}
+
+			return false;
+		}
+		$(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 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 attachmentId = "";
+				var attachmentFlag = "100";
+				console.log(file);
+				var timestamp=new Date().getTime();
+
+				var storeAs = "attachment-file/workIncomingMessage/"+timestamp+"/"+file['name'];
+				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);}
+		}
+	</script>
+</head>
+<body>
+<div class="single-form">
+	<div class="container">
+		<form:form id="inputForm" modelAttribute="projectAccessory" action="${ctx}/projectAccessory/projectAccessory/saveWorkAttachment" method="post" class="form-horizontal">
+			<form:hidden path="id"/>
+			<form:hidden path="projectId"/>
+			<div class="form-group layui-row">
+				<div class="form-group-label"><h2>附件信息</h2></div>
+				<div class="layui-item nav-btns">
+					<a id="attachment_btn" 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;">
+					<table id="upTable" class="table table-bordered table-condensed details">
+						<thead>
+						<tr>
+								<%-- <th>序号</th>--%>
+							<th>文件预览</th>
+							<th>上传人</th>
+							<th>上传时间</th>
+							<th width="150px">操作</th>
+						</tr>
+						</thead>
+						<tbody id="file_attachment">
+						<c:forEach items="${projectAccessory.workAttachments}" var = "workClientAttachment" varStatus="status">
+							<tr>
+									<%-- <td>${status.index + 1}</td>--%>
+								<c:choose>
+									<c:when test="${fn:containsIgnoreCase(workClientAttachment.attachmentName,'jpg')
+                                                           or fn:containsIgnoreCase(workClientAttachment.attachmentName,'png')
+                                                           or fn:containsIgnoreCase(workClientAttachment.attachmentName,'gif')
+                                                           or fn:containsIgnoreCase(workClientAttachment.attachmentName,'bmp')
+                                                           or fn:containsIgnoreCase(workClientAttachment.attachmentName,'jpeg')}">
+										<td><img src="${workClientAttachment.url}" width="50" height="50" onclick="openDialogView('预览','${ctx}/sys/picturepreview/picturePreview?url=${workClientAttachment.url}','90%','90%')" alt="${workClientAttachment.attachmentName}"></td>
+									</c:when>
+									<c:otherwise>
+										<c:choose>
+											<c:when test="${fn:containsIgnoreCase(workClientAttachment.attachmentName,'pdf')}">
+												<td><a class="attention-info" href="javascript:void(0)" onclick="preview('预览','${workClientAttachment.url}','90%','90%','1')">${workClientAttachment.attachmentName}</a></td>
+											</c:when>
+											<c:otherwise>
+												<td><a class="attention-info" href="javascript:void(0)" onclick="preview('预览','${workClientAttachment.url}','90%','90%')">${workClientAttachment.attachmentName}</a></td>
+											</c:otherwise>
+										</c:choose>
+									</c:otherwise>
+								</c:choose>
+								<td>${workClientAttachment.createBy.name}</td>
+								<td><fmt:formatDate value="${workClientAttachment.createDate}" type="both"/></td>
+								<td class="op-td">
+									<div class="op-btn-box" >
+										<a href="javascript:location.href='${ctx}/workfullmanage/workFullManage/downLoadAttach?file='+encodeURIComponent(encodeURIComponent('${workClientAttachment.url}'));" class="op-btn op-btn-download"><i class="fa fa-download"></i>&nbsp;下载</a>
+
+										<c:if test="${workClientAttachment.createBy.id eq fns:getUser().id}">
+											<a href="javascript:void(0)" onclick="deleteFileFromAliyun(this,'${ctx}/sys/workattachment/deleteFileFromAliyun?url=${workClientAttachment.url}&id=${workClientAttachment.id}&type=2','addFile')" class="op-btn op-btn-delete" ><i class="fa fa-trash"></i>&nbsp;删除</a>
+										</c:if>
+									</div>
+								</td>
+							</tr>
+						</c:forEach>
+						</tbody>
+					</table>
+				</div>
+			</div>
+		</form:form>
+	</div>
+</div>
+</body>
+</html>

+ 124 - 0
src/main/webapp/webpage/modules/projectAccessory/workAttachmentView.jsp

@@ -0,0 +1,124 @@
+<%@ 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">
+		var validateForm;
+		function doSubmit(i){//回调函数,在编辑和保存动作时,供openDialog调用提交表单。
+			if(validateForm.form()){
+				$("#inputForm").submit();
+				return true;
+			}
+
+			return false;
+		}
+		$(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 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 attachmentId = "";
+				var attachmentFlag = "100";
+				console.log(file);
+				var timestamp=new Date().getTime();
+
+				var storeAs = "attachment-file/workIncomingMessage/"+timestamp+"/"+file['name'];
+				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);}
+		}
+	</script>
+</head>
+<body>
+<div class="single-form">
+	<div class="container">
+		<form:form id="inputForm" modelAttribute="projectAccessory" action="${ctx}/projectAccessory/projectAccessory/saveWorkAttachment" method="post" class="form-horizontal">
+			<form:hidden path="id"/>
+			<form:hidden path="projectId"/>
+			<div class="form-group layui-row">
+				<div class="form-group-label"><h2>附件信息</h2></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;">
+					<table id="upTable" class="table table-bordered table-condensed details">
+						<thead>
+						<tr>
+								<%-- <th>序号</th>--%>
+							<th>文件预览</th>
+							<th>上传人</th>
+							<th>上传时间</th>
+							<th width="150px">操作</th>
+						</tr>
+						</thead>
+						<tbody id="file_attachment">
+						<c:forEach items="${projectAccessory.workAttachments}" var = "workClientAttachment" varStatus="status">
+							<tr>
+									<%-- <td>${status.index + 1}</td>--%>
+								<c:choose>
+									<c:when test="${fn:containsIgnoreCase(workClientAttachment.attachmentName,'jpg')
+                                                           or fn:containsIgnoreCase(workClientAttachment.attachmentName,'png')
+                                                           or fn:containsIgnoreCase(workClientAttachment.attachmentName,'gif')
+                                                           or fn:containsIgnoreCase(workClientAttachment.attachmentName,'bmp')
+                                                           or fn:containsIgnoreCase(workClientAttachment.attachmentName,'jpeg')}">
+										<td><img src="${workClientAttachment.url}" width="50" height="50" onclick="openDialogView('预览','${ctx}/sys/picturepreview/picturePreview?url=${workClientAttachment.url}','90%','90%')" alt="${workClientAttachment.attachmentName}"></td>
+									</c:when>
+									<c:otherwise>
+										<c:choose>
+											<c:when test="${fn:containsIgnoreCase(workClientAttachment.attachmentName,'pdf')}">
+												<td><a class="attention-info" href="javascript:void(0)" onclick="preview('预览','${workClientAttachment.url}','90%','90%','1')">${workClientAttachment.attachmentName}</a></td>
+											</c:when>
+											<c:otherwise>
+												<td><a class="attention-info" href="javascript:void(0)" onclick="preview('预览','${workClientAttachment.url}','90%','90%')">${workClientAttachment.attachmentName}</a></td>
+											</c:otherwise>
+										</c:choose>
+									</c:otherwise>
+								</c:choose>
+								<td>${workClientAttachment.createBy.name}</td>
+								<td><fmt:formatDate value="${workClientAttachment.createDate}" type="both"/></td>
+								<td class="op-td">
+									<div class="op-btn-box" >
+										<a href="javascript:location.href='${ctx}/workfullmanage/workFullManage/downLoadAttach?file='+encodeURIComponent(encodeURIComponent('${workClientAttachment.url}'));" class="op-btn op-btn-download"><i class="fa fa-download"></i>&nbsp;下载</a>
+									</div>
+								</td>
+							</tr>
+						</c:forEach>
+						</tbody>
+					</table>
+				</div>
+			</div>
+		</form:form>
+	</div>
+</div>
+</body>
+</html>

+ 168 - 3
src/main/webapp/webpage/modules/projectcontentinfo/projectReportRecordAudit.jsp

@@ -179,14 +179,23 @@
 					</div>
 				</div>
 			</div>
+
 			<div class="form-group layui-row">
+				<div class="form-group-label"><h2>附件信息列表</h2></div>
+
+				<div class="layui-item layui-col-xs12 form-table-container">
+					<table id="permissionTable" class="layui-table" lay-filter="permissionTable"></table>
+				</div>
+			</div>
+
+			<%--<div class="form-group layui-row">
 				<div class="form-group-label"><h2>附件信息</h2></div>
 				<span id="attachment_title"></span>
 				<div class="layui-item layui-col-xs12" style="padding:0 16px;">
 					<table id="upTable" class="table table-bordered table-condensed details">
 						<thead>
 						<tr>
-								<%-- <th>序号</th>--%>
+								&lt;%&ndash; <th>序号</th>&ndash;%&gt;
 							<th>文件预览</th>
 							<th>上传人</th>
 							<th>上传时间</th>
@@ -196,7 +205,7 @@
 						<tbody id="file_attachment">
 						<c:forEach items="${projectReportRecord.workAttachments}" var = "workClientAttachment" varStatus="status">
 							<tr>
-									<%-- <td>${status.index + 1}</td>--%>
+									&lt;%&ndash; <td>${status.index + 1}</td>&ndash;%&gt;
 								<c:choose>
 									<c:when test="${fn:containsIgnoreCase(workClientAttachment.attachmentName,'jpg')
                                                            or fn:containsIgnoreCase(workClientAttachment.attachmentName,'png')
@@ -228,7 +237,7 @@
 						</tbody>
 					</table>
 				</div>
-			</div>
+			</div>--%>
 			<div class="form-group layui-row">
 				<div class="form-group-label"><h2>审批意见</h2></div>
 				<div class="layui-item layui-col-xs12 with-textarea" >
@@ -251,5 +260,161 @@
 		</form:form>
 	</div>
 </div>
+<script src="${ctxStatic}/layer-v2.3/layui/layui.all.js" charset="utf-8"></script>
+<script src="${ctxStatic}/layer-v2.3/layui/tableTree/treetable.js" charset="utf-8"></script>
+<script>
+	/*使用模块加载的方式 加载文件*/
+	layui.config({
+		base: '${ctx}/resoueces/css/layui/module/'
+	}).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;
+
+		// 渲染表格
+		window.renderTable = function () {//树桩表格参考文档:https://gitee.com/whvse/treetable-lay
+			layer.load(2);
+			treetable.render({
+				treeColIndex: 1,//树形图标显示在第几列
+				treeSpid: 0,//最上级的父级id
+				treeIdName: 'permissionId',//id字段的名称
+				treePidName: 'pid',//pid字段的名称
+				treeDefaultClose: false,//是否默认折叠
+				treeLinkage: true,//父级展开时是否自动展开所有子级
+				elem: '#permissionTable',
+				url: '${ctx}/projectAccessory/projectAccessory/getProjectAccessoryTreeData?projectId=${project.id}',
+				page: false,
+				cols: [[
+					{type: 'numbers', title: '编号' ,width:80},
+					{field: 'type', title: '电子件名称'},
+					{field: 'workAttachments',title: '附件',templet:function(d){
+							if(d.pid !='0'){
+								if(null == d.workAttachments || '' == d.workAttachments){
+									return "<span style=\"color:red\" title='无附件'>无附件</span>";
+								}else{
+									var html = '';
+									for (var x in d.workAttachments) {
+										html += "<div style='display:inline;float:left;'><a style='width:100px;display:block;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;' class=\"attention-info\" href=\"javascript:void(0)\" onclick=\"preview('预览','"+d.workAttachments[x].url+"','90%','90%')\" title='"+d.workAttachments[x].attachmentName+"'>"+d.workAttachments[x].attachmentName+"</a></div>"
+										if(x != d.workAttachments.length-1){
+											html += "<div style='display:inline;float:left;'> ; </div>";
+										}
+									}
+									return html;
+								}
+							}else{
+								return "";
+							}
+						}},
+					{templet: complain, title: '附件管理',width:80}
+				]],
+				done: function () {
+					layer.closeAll('loading');
+				}
+			});
+		};
+
+		renderTable();
+
+		//触发三个button按钮
+		$('#btn-expand').click(function () {
+			treetable.expandAll('#permissionTable');
+		});
+
+		$('#btn-fold').click(function () {
+			treetable.foldAll('#permissionTable');
+		});
+
+		$('#btn-refresh').click(function () {
+			renderTable();
+		});
+
+
+		function complain(d){//操作中显示的内容
+			if(d.pid !=0){
+				return [
+					'<a href="javascript:void(0)"  onclick="openBill2(\'附件详情\', \'${ctx}/projectAccessory/projectAccessory/workAttachmentView?attachmentId='+d.id+'&projectId='+d.projectId+'\',\'70%\',\'80%\',false,\'inputForm\')" class="op-btn op-btn-edit" ><i class="fa fa-search-plus"></i> 详情</a>',
+				].join('');
+			}else{
+				return[''].join('');
+			}
+		}
+	});
+
+	function openBill2(title,url,width,height,target,formId){
+		var rows = $(this).parent().prevAll().length + 1;
+		var frameIndex = parent.layer.getFrameIndex(window.name);
+		var urls = url+"&index="+frameIndex;
+		if(navigator.userAgent.match(/(iPhone|iPod|Android|ios)/i)){//如果是移动端,就使用自适应大小弹窗
+			width='auto';
+			height='auto';
+		}else{//如果是PC端,根据用户设置的width和height显示。
+
+		}
+		top.layer.open({
+			type: 2,
+			area: [width, height],
+			title: title,
+			skin:"two-btns",
+			maxmin: false, //开启最大化最小化按钮
+			content: urls ,
+			btn: ['确定','关闭'],
+			yes: function(index, layero){
+				var body = top.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中展示
+				inputForm.attr("action","${ctx}/projectAccessory/projectAccessory/saveWorkAttachment");//表单提交成功后,从服务器返回的url在当前tab中展示
+				var $document = iframeWin.contentWindow.document;
+
+				formSubmit2($document,formId,index);
+
+			},
+			cancel: function(index){
+			}
+		});
+	}
+	function formSubmit2($document,inputForm,index){
+
+		var validateForm = $($document.getElementById(inputForm)).validate({
+			submitHandler: function(form){
+				loading('正在提交,请稍等...');
+				form.submit();
+			},
+			errorContainer: "#messageBox",
+			errorPlacement: function(error, element) {
+				$($document.getElementById("#messageBox")).text("输入有误,请先更正。");
+				if (element.is(":checkbox")||element.is(":radio")||element.parent().is(".input-append")){
+					error.appendTo(element.parent().parent());
+				} else {
+					error.insertAfter(element);
+				}
+			}
+		});
+		if(validateForm.form()){
+			$($document.getElementById(inputForm)).ajaxSubmit({
+				success:function(data) {
+					var d = data;
+					//调用layui.use中的renderTable()方法刷新列表
+					renderTable()
+					//输出提示信息
+					if(d.str.length>0){
+						parent.layer.msg(d.str,{icon:1});
+					}
+					//关闭当前页
+					top.layer.close(index)
+				}
+			});
+		}
+	}
+</script>
 </body>
 </html>

+ 182 - 4
src/main/webapp/webpage/modules/ruralprojectrecords/cost/projectReportRecord/projectReportRecordForm.jsp

@@ -4,11 +4,24 @@
 <head>
 	<title>合同归档管理</title>
 	<meta name="decorator" content="default"/>
+	<link href="${ctxStatic}/layer-v2.3/layui/tableTree/treetable.css" rel="stylesheet" />
 	<style>
 		label.error:nth-child(2){
 			top:40px;
 			left:0;
 		}
+		.layui-table th{
+			font-size: 14px;
+			/*表头内容居中显示*/
+			text-align: center;
+		}
+		.layui-table td{
+			/*表头内容居中显示*/
+			text-align: left;
+		}
+		span{
+			font-size: 14px;
+		}
 	</style>
 	<script type="text/javascript">
         var validateForm;
@@ -192,7 +205,17 @@
 					</div>
 				</div>
 			</div>
+
+
 			<div class="form-group layui-row">
+				<div class="form-group-label"><h2>附件信息列表</h2></div>
+
+				<div class="layui-item layui-col-xs12 form-table-container">
+					<table id="permissionTable" class="layui-table" lay-filter="permissionTable"></table>
+				</div>
+			</div>
+
+			<%--<div class="form-group layui-row">
 				<div class="form-group-label"><h2>附件信息</h2></div>
 				<div class="layui-item nav-btns">
 					<a id="attachment_btn" class="nav-btn nav-btn-add" title="添加附件"><i class="fa fa-plus"></i>&nbsp;添加附件</a>
@@ -211,7 +234,7 @@
 					<table id="upTable" class="table table-bordered table-condensed details">
 						<thead>
 						<tr>
-								<%-- <th>序号</th>--%>
+								&lt;%&ndash; <th>序号</th>&ndash;%&gt;
 							<th>文件预览</th>
 							<th>上传人</th>
 							<th>上传时间</th>
@@ -221,7 +244,7 @@
 						<tbody id="file_attachment">
 						<c:forEach items="${projectReportRecord.workAttachments}" var = "workClientAttachment" varStatus="status">
 							<tr>
-									<%-- <td>${status.index + 1}</td>--%>
+									&lt;%&ndash; <td>${status.index + 1}</td>&ndash;%&gt;
 								<c:choose>
 									<c:when test="${fn:containsIgnoreCase(workClientAttachment.attachmentName,'jpg')
                                                            or fn:containsIgnoreCase(workClientAttachment.attachmentName,'png')
@@ -257,10 +280,165 @@
 						</tbody>
 					</table>
 				</div>
-			</div>
+			</div>--%>
 			<div class="form-group layui-row page-end"></div>
 		</form:form>
 	</div>
-</div>
+</div><script src="${ctxStatic}/layer-v2.3/layui/layui.all.js" charset="utf-8"></script>
+<script src="${ctxStatic}/layer-v2.3/layui/tableTree/treetable.js" charset="utf-8"></script>
+<script>
+	/*使用模块加载的方式 加载文件*/
+	layui.config({
+		base: '${ctx}/resoueces/css/layui/module/'
+	}).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;
+
+		// 渲染表格
+		window.renderTable = function () {//树桩表格参考文档:https://gitee.com/whvse/treetable-lay
+			layer.load(2);
+			treetable.render({
+				treeColIndex: 1,//树形图标显示在第几列
+				treeSpid: 0,//最上级的父级id
+				treeIdName: 'permissionId',//id字段的名称
+				treePidName: 'pid',//pid字段的名称
+				treeDefaultClose: false,//是否默认折叠
+				treeLinkage: true,//父级展开时是否自动展开所有子级
+				elem: '#permissionTable',
+				url: '${ctx}/projectAccessory/projectAccessory/getProjectAccessoryTreeData?projectId=${project.id}',
+				page: false,
+				cols: [[
+					{type: 'numbers', title: '编号' ,width:80},
+					{field: 'type', title: '电子件名称'},
+					{field: 'workAttachments',title: '附件',templet:function(d){
+							if(d.pid !='0'){
+								if(null == d.workAttachments || '' == d.workAttachments){
+									return "<span style=\"color:red\" title='无附件'>无附件</span>";
+								}else{
+									var html = '';
+									for (var x in d.workAttachments) {
+										html += "<div style='display:inline;float:left;'><a style='width:100px;display:block;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;' class=\"attention-info\" href=\"javascript:void(0)\" onclick=\"preview('预览','"+d.workAttachments[x].url+"','90%','90%')\" title='"+d.workAttachments[x].attachmentName+"'>"+d.workAttachments[x].attachmentName+"</a></div>"
+										if(x != d.workAttachments.length-1){
+											html += "<div style='display:inline;float:left;'> ; </div>";
+										}
+									}
+									return html;
+								}
+							}else{
+								return "";
+							}
+						}},
+					{templet: complain, title: '附件管理',width:80}
+				]],
+				done: function () {
+					layer.closeAll('loading');
+				}
+			});
+		};
+
+		renderTable();
+
+		//触发三个button按钮
+		$('#btn-expand').click(function () {
+			treetable.expandAll('#permissionTable');
+		});
+
+		$('#btn-fold').click(function () {
+			treetable.foldAll('#permissionTable');
+		});
+
+		$('#btn-refresh').click(function () {
+			renderTable();
+		});
+
+
+		function complain(d){//操作中显示的内容
+			if(d.pid !=0){
+				return [
+					'<a href="javascript:void(0)"  onclick="openBill2(\'编辑附件\', \'${ctx}/projectAccessory/projectAccessory/workAttachmentForm?attachmentId='+d.id+'&projectId='+d.projectId+'\',\'70%\',\'80%\',false,\'inputForm\')" class="op-btn op-btn-edit" ><i class="fa fa-edit"></i> 编辑</a>',
+				].join('');
+			}else{
+				return[''].join('');
+			}
+		}
+	});
+
+	function openBill2(title,url,width,height,target,formId){
+		var rows = $(this).parent().prevAll().length + 1;
+		var frameIndex = parent.layer.getFrameIndex(window.name);
+		var urls = url+"&index="+frameIndex;
+		if(navigator.userAgent.match(/(iPhone|iPod|Android|ios)/i)){//如果是移动端,就使用自适应大小弹窗
+			width='auto';
+			height='auto';
+		}else{//如果是PC端,根据用户设置的width和height显示。
+
+		}
+		top.layer.open({
+			type: 2,
+			area: [width, height],
+			title: title,
+			skin:"two-btns",
+			maxmin: false, //开启最大化最小化按钮
+			content: urls ,
+			btn: ['确定','关闭'],
+			yes: function(index, layero){
+				var body = top.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中展示
+				inputForm.attr("action","${ctx}/projectAccessory/projectAccessory/saveWorkAttachment");//表单提交成功后,从服务器返回的url在当前tab中展示
+				var $document = iframeWin.contentWindow.document;
+
+				formSubmit2($document,formId,index);
+
+			},
+			cancel: function(index){
+			}
+		});
+	}
+	function formSubmit2($document,inputForm,index){
+
+		var validateForm = $($document.getElementById(inputForm)).validate({
+			submitHandler: function(form){
+				loading('正在提交,请稍等...');
+				form.submit();
+			},
+			errorContainer: "#messageBox",
+			errorPlacement: function(error, element) {
+				$($document.getElementById("#messageBox")).text("输入有误,请先更正。");
+				if (element.is(":checkbox")||element.is(":radio")||element.parent().is(".input-append")){
+					error.appendTo(element.parent().parent());
+				} else {
+					error.insertAfter(element);
+				}
+			}
+		});
+		if(validateForm.form()){
+			$($document.getElementById(inputForm)).ajaxSubmit({
+				success:function(data) {
+					var d = data;
+					//调用layui.use中的renderTable()方法刷新列表
+					renderTable()
+					//输出提示信息
+					if(d.str.length>0){
+						parent.layer.msg(d.str,{icon:1});
+					}
+					//关闭当前页
+					top.layer.close(index)
+				}
+			});
+		}
+	}
+</script>
 </body>
 </html>

+ 183 - 3
src/main/webapp/webpage/modules/ruralprojectrecords/cost/projectReportRecord/projectReportRecordModify.jsp

@@ -4,11 +4,24 @@
 <head>
 	<title>合同归档管理</title>
 	<meta name="decorator" content="default"/>
+	<link href="${ctxStatic}/layer-v2.3/layui/tableTree/treetable.css" rel="stylesheet" />
 	<style>
 		label.error:nth-child(2){
 			top:40px;
 			left:0;
 		}
+		.layui-table th{
+			font-size: 14px;
+			/*表头内容居中显示*/
+			text-align: center;
+		}
+		.layui-table td{
+			/*表头内容居中显示*/
+			text-align: left;
+		}
+		span{
+			font-size: 14px;
+		}
 	</style>
 	<script type="text/javascript">
         var validateForm;
@@ -224,7 +237,18 @@
 					</div>
 				</div>
 			</div>
+
+
 			<div class="form-group layui-row">
+				<div class="form-group-label"><h2>附件信息列表</h2></div>
+
+				<div class="layui-item layui-col-xs12 form-table-container">
+					<table id="permissionTable" class="layui-table" lay-filter="permissionTable"></table>
+				</div>
+			</div>
+
+
+			<%--<div class="form-group layui-row">
 				<div class="form-group-label"><h2>附件信息</h2></div>
 				<div class="layui-item nav-btns">
 					<a id="attachment_btn" class="nav-btn nav-btn-add" title="添加附件"><i class="fa fa-plus"></i>&nbsp;添加附件</a>
@@ -243,7 +267,7 @@
 					<table id="upTable" class="table table-bordered table-condensed details">
 						<thead>
 						<tr>
-								<%-- <th>序号</th>--%>
+								&lt;%&ndash; <th>序号</th>&ndash;%&gt;
 							<th>文件预览</th>
 							<th>上传人</th>
 							<th>上传时间</th>
@@ -253,7 +277,7 @@
 						<tbody id="file_attachment">
 						<c:forEach items="${projectReportRecord.workAttachments}" var = "workClientAttachment" varStatus="status">
 							<tr>
-									<%-- <td>${status.index + 1}</td>--%>
+									&lt;%&ndash; <td>${status.index + 1}</td>&ndash;%&gt;
 								<c:choose>
 									<c:when test="${fn:containsIgnoreCase(workClientAttachment.attachmentName,'jpg')
                                                            or fn:containsIgnoreCase(workClientAttachment.attachmentName,'png')
@@ -289,10 +313,166 @@
 						</tbody>
 					</table>
 				</div>
-			</div>
+			</div>--%>
 			<div class="form-group layui-row page-end"></div>
 		</form:form>
 	</div>
 </div>
+<script src="${ctxStatic}/layer-v2.3/layui/layui.all.js" charset="utf-8"></script>
+<script src="${ctxStatic}/layer-v2.3/layui/tableTree/treetable.js" charset="utf-8"></script>
+<script>
+	/*使用模块加载的方式 加载文件*/
+	layui.config({
+		base: '${ctx}/resoueces/css/layui/module/'
+	}).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;
+
+		// 渲染表格
+		window.renderTable = function () {//树桩表格参考文档:https://gitee.com/whvse/treetable-lay
+			layer.load(2);
+			treetable.render({
+				treeColIndex: 1,//树形图标显示在第几列
+				treeSpid: 0,//最上级的父级id
+				treeIdName: 'permissionId',//id字段的名称
+				treePidName: 'pid',//pid字段的名称
+				treeDefaultClose: false,//是否默认折叠
+				treeLinkage: true,//父级展开时是否自动展开所有子级
+				elem: '#permissionTable',
+				url: '${ctx}/projectAccessory/projectAccessory/getProjectAccessoryTreeData?projectId=${project.id}',
+				page: false,
+				cols: [[
+					{type: 'numbers', title: '编号' ,width:80},
+					{field: 'type', title: '电子件名称'},
+					{field: 'workAttachments',title: '附件',templet:function(d){
+							if(d.pid !='0'){
+								if(null == d.workAttachments || '' == d.workAttachments){
+									return "<span style=\"color:red\" title='无附件'>无附件</span>";
+								}else{
+									var html = '';
+									for (var x in d.workAttachments) {
+										html += "<div style='display:inline;float:left;'><a style='width:100px;display:block;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;' class=\"attention-info\" href=\"javascript:void(0)\" onclick=\"preview('预览','"+d.workAttachments[x].url+"','90%','90%')\" title='"+d.workAttachments[x].attachmentName+"'>"+d.workAttachments[x].attachmentName+"</a></div>"
+										if(x != d.workAttachments.length-1){
+											html += "<div style='display:inline;float:left;'> ; </div>";
+										}
+									}
+									return html;
+								}
+							}else{
+								return "";
+							}
+						}},
+					{templet: complain, title: '附件管理',width:80}
+				]],
+				done: function () {
+					layer.closeAll('loading');
+				}
+			});
+		};
+
+		renderTable();
+
+		//触发三个button按钮
+		$('#btn-expand').click(function () {
+			treetable.expandAll('#permissionTable');
+		});
+
+		$('#btn-fold').click(function () {
+			treetable.foldAll('#permissionTable');
+		});
+
+		$('#btn-refresh').click(function () {
+			renderTable();
+		});
+
+
+		function complain(d){//操作中显示的内容
+			if(d.pid !=0){
+				return [
+					'<a href="javascript:void(0)"  onclick="openBill2(\'编辑附件\', \'${ctx}/projectAccessory/projectAccessory/workAttachmentForm?attachmentId='+d.id+'&projectId='+d.projectId+'\',\'70%\',\'80%\',false,\'inputForm\')" class="op-btn op-btn-edit" ><i class="fa fa-edit"></i> 编辑</a>',
+				].join('');
+			}else{
+				return[''].join('');
+			}
+		}
+	});
+
+	function openBill2(title,url,width,height,target,formId){
+		var rows = $(this).parent().prevAll().length + 1;
+		var frameIndex = parent.layer.getFrameIndex(window.name);
+		var urls = url+"&index="+frameIndex;
+		if(navigator.userAgent.match(/(iPhone|iPod|Android|ios)/i)){//如果是移动端,就使用自适应大小弹窗
+			width='auto';
+			height='auto';
+		}else{//如果是PC端,根据用户设置的width和height显示。
+
+		}
+		top.layer.open({
+			type: 2,
+			area: [width, height],
+			title: title,
+			skin:"two-btns",
+			maxmin: false, //开启最大化最小化按钮
+			content: urls ,
+			btn: ['确定','关闭'],
+			yes: function(index, layero){
+				var body = top.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中展示
+				inputForm.attr("action","${ctx}/projectAccessory/projectAccessory/saveWorkAttachment");//表单提交成功后,从服务器返回的url在当前tab中展示
+				var $document = iframeWin.contentWindow.document;
+
+				formSubmit2($document,formId,index);
+
+			},
+			cancel: function(index){
+			}
+		});
+	}
+	function formSubmit2($document,inputForm,index){
+
+		var validateForm = $($document.getElementById(inputForm)).validate({
+			submitHandler: function(form){
+				loading('正在提交,请稍等...');
+				form.submit();
+			},
+			errorContainer: "#messageBox",
+			errorPlacement: function(error, element) {
+				$($document.getElementById("#messageBox")).text("输入有误,请先更正。");
+				if (element.is(":checkbox")||element.is(":radio")||element.parent().is(".input-append")){
+					error.appendTo(element.parent().parent());
+				} else {
+					error.insertAfter(element);
+				}
+			}
+		});
+		if(validateForm.form()){
+			$($document.getElementById(inputForm)).ajaxSubmit({
+				success:function(data) {
+					var d = data;
+					//调用layui.use中的renderTable()方法刷新列表
+					renderTable()
+					//输出提示信息
+					if(d.str.length>0){
+						parent.layer.msg(d.str,{icon:1});
+					}
+					//关闭当前页
+					top.layer.close(index)
+				}
+			});
+		}
+	}
+</script>
 </body>
 </html>

+ 187 - 3
src/main/webapp/webpage/modules/ruralprojectrecords/cost/projectReportRecord/projectReportRecordView.jsp

@@ -4,6 +4,25 @@
 <head>
 	<title>合同归档管理</title>
 	<meta name="decorator" content="default"/>
+	<link href="${ctxStatic}/layer-v2.3/layui/tableTree/treetable.css" rel="stylesheet" />
+	<style>
+		label.error:nth-child(2){
+			top:40px;
+			left:0;
+		}
+		.layui-table th{
+			font-size: 14px;
+			/*表头内容居中显示*/
+			text-align: center;
+		}
+		.layui-table td{
+			/*表头内容居中显示*/
+			text-align: left;
+		}
+		span{
+			font-size: 14px;
+		}
+	</style>
 	<script type="text/javascript">
 
 	</script>
@@ -132,14 +151,23 @@
 				</div>
 			</div>
 		</div>
+
 		<div class="form-group layui-row">
+			<div class="form-group-label"><h2>附件信息列表</h2></div>
+
+			<div class="layui-item layui-col-xs12 form-table-container">
+				<table id="permissionTable" class="layui-table" lay-filter="permissionTable"></table>
+			</div>
+		</div>
+
+		<%--<div class="form-group layui-row">
 			<div class="form-group-label"><h2>附件信息</h2></div>
 			<span id="attachment_title"></span>
 			<div class="layui-item layui-col-xs12" style="padding:0 16px;">
 				<table id="upTable" class="table table-bordered table-condensed details">
 					<thead>
 					<tr>
-						<%-- <th>序号</th>--%>
+						&lt;%&ndash; <th>序号</th>&ndash;%&gt;
 						<th>文件预览</th>
 						<th>上传人</th>
 						<th>上传时间</th>
@@ -149,7 +177,7 @@
 					<tbody id="file_attachment">
 					<c:forEach items="${projectReportRecord.workAttachments}" var = "workClientAttachment" varStatus="status">
 						<tr>
-								<%-- <td>${status.index + 1}</td>--%>
+								&lt;%&ndash; <td>${status.index + 1}</td>&ndash;%&gt;
 							<c:choose>
 								<c:when test="${fn:containsIgnoreCase(workClientAttachment.attachmentName,'jpg')
                                                            or fn:containsIgnoreCase(workClientAttachment.attachmentName,'png')
@@ -181,9 +209,165 @@
 					</tbody>
 				</table>
 			</div>
-		</div>
+		</div>--%>
 			<div class="form-group layui-row page-end"></div>
 	</div>
 </div>
+<script src="${ctxStatic}/layer-v2.3/layui/layui.all.js" charset="utf-8"></script>
+<script src="${ctxStatic}/layer-v2.3/layui/tableTree/treetable.js" charset="utf-8"></script>
+<script>
+	/*使用模块加载的方式 加载文件*/
+	layui.config({
+		base: '${ctx}/resoueces/css/layui/module/'
+	}).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;
+
+		// 渲染表格
+		window.renderTable = function () {//树桩表格参考文档:https://gitee.com/whvse/treetable-lay
+			layer.load(2);
+			treetable.render({
+				treeColIndex: 1,//树形图标显示在第几列
+				treeSpid: 0,//最上级的父级id
+				treeIdName: 'permissionId',//id字段的名称
+				treePidName: 'pid',//pid字段的名称
+				treeDefaultClose: false,//是否默认折叠
+				treeLinkage: true,//父级展开时是否自动展开所有子级
+				elem: '#permissionTable',
+				url: '${ctx}/projectAccessory/projectAccessory/getProjectAccessoryTreeData?projectId=${project.id}',
+				page: false,
+				cols: [[
+					{type: 'numbers', title: '编号' ,width:80},
+					{field: 'type', title: '电子件名称'},
+					{field: 'workAttachments',title: '附件',templet:function(d){
+							if(d.pid !='0'){
+								if(null == d.workAttachments || '' == d.workAttachments){
+									return "<span style=\"color:red\" title='无附件'>无附件</span>";
+								}else{
+									var html = '';
+									for (var x in d.workAttachments) {
+										html += "<div style='display:inline;float:left;'><a style='width:100px;display:block;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;' class=\"attention-info\" href=\"javascript:void(0)\" onclick=\"preview('预览','"+d.workAttachments[x].url+"','90%','90%')\" title='"+d.workAttachments[x].attachmentName+"'>"+d.workAttachments[x].attachmentName+"</a></div>"
+										if(x != d.workAttachments.length-1){
+											html += "<div style='display:inline;float:left;'> ; </div>";
+										}
+									}
+									return html;
+								}
+							}else{
+								return "";
+							}
+						}},
+					{templet: complain, title: '附件管理',width:80}
+				]],
+				done: function () {
+					layer.closeAll('loading');
+				}
+			});
+		};
+
+		renderTable();
+
+		//触发三个button按钮
+		$('#btn-expand').click(function () {
+			treetable.expandAll('#permissionTable');
+		});
+
+		$('#btn-fold').click(function () {
+			treetable.foldAll('#permissionTable');
+		});
+
+		$('#btn-refresh').click(function () {
+			renderTable();
+		});
+
+
+		function complain(d){//操作中显示的内容
+			if(d.pid !=0){
+				return [
+					'<a href="javascript:void(0)"  onclick="openBill2(\'附件详情\', \'${ctx}/projectAccessory/projectAccessory/workAttachmentView?attachmentId='+d.id+'&projectId='+d.projectId+'\',\'70%\',\'80%\',false,\'inputForm\')" class="op-btn op-btn-edit" ><i class="fa fa-search-plus"></i> 详情</a>',
+				].join('');
+			}else{
+				return[''].join('');
+			}
+		}
+	});
+
+	function openBill2(title,url,width,height,target,formId){
+		var rows = $(this).parent().prevAll().length + 1;
+		var frameIndex = parent.layer.getFrameIndex(window.name);
+		var urls = url+"&index="+frameIndex;
+		if(navigator.userAgent.match(/(iPhone|iPod|Android|ios)/i)){//如果是移动端,就使用自适应大小弹窗
+			width='auto';
+			height='auto';
+		}else{//如果是PC端,根据用户设置的width和height显示。
+
+		}
+		top.layer.open({
+			type: 2,
+			area: [width, height],
+			title: title,
+			skin:"two-btns",
+			maxmin: false, //开启最大化最小化按钮
+			content: urls ,
+			btn: ['确定','关闭'],
+			yes: function(index, layero){
+				var body = top.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中展示
+				inputForm.attr("action","${ctx}/projectAccessory/projectAccessory/saveWorkAttachment");//表单提交成功后,从服务器返回的url在当前tab中展示
+				var $document = iframeWin.contentWindow.document;
+
+				formSubmit2($document,formId,index);
+
+			},
+			cancel: function(index){
+			}
+		});
+	}
+	function formSubmit2($document,inputForm,index){
+
+		var validateForm = $($document.getElementById(inputForm)).validate({
+			submitHandler: function(form){
+				loading('正在提交,请稍等...');
+				form.submit();
+			},
+			errorContainer: "#messageBox",
+			errorPlacement: function(error, element) {
+				$($document.getElementById("#messageBox")).text("输入有误,请先更正。");
+				if (element.is(":checkbox")||element.is(":radio")||element.parent().is(".input-append")){
+					error.appendTo(element.parent().parent());
+				} else {
+					error.insertAfter(element);
+				}
+			}
+		});
+		if(validateForm.form()){
+			$($document.getElementById(inputForm)).ajaxSubmit({
+				success:function(data) {
+					var d = data;
+					//调用layui.use中的renderTable()方法刷新列表
+					renderTable()
+					//输出提示信息
+					if(d.str.length>0){
+						parent.layer.msg(d.str,{icon:1});
+					}
+					//关闭当前页
+					top.layer.close(index)
+				}
+			});
+		}
+	}
+</script>
 </body>
 </html>

+ 183 - 3
src/main/webapp/webpage/modules/ruralprojectrecords/projectReportRecord/projectReportRecordForm.jsp

@@ -4,12 +4,26 @@
 <head>
 	<title>合同归档管理</title>
 	<meta name="decorator" content="default"/>
+	<link href="${ctxStatic}/layer-v2.3/layui/tableTree/treetable.css" rel="stylesheet" />
 	<style>
 		label.error:nth-child(2){
 			top:40px;
 			left:0;
 		}
+		.layui-table th{
+			font-size: 14px;
+			/*表头内容居中显示*/
+			text-align: center;
+		}
+		.layui-table td{
+			/*表头内容居中显示*/
+			text-align: left;
+		}
+		span{
+			font-size: 14px;
+		}
 	</style>
+
 	<script type="text/javascript">
         var validateForm;
         function doSubmit(obj){//回调函数,在编辑和保存动作时,供openDialog调用提交表单。
@@ -192,7 +206,17 @@
 					</div>
 				</div>
 			</div>
+
+
 			<div class="form-group layui-row">
+				<div class="form-group-label"><h2>附件信息列表</h2></div>
+
+				<div class="layui-item layui-col-xs12 form-table-container">
+					<table id="permissionTable" class="layui-table" lay-filter="permissionTable"></table>
+				</div>
+			</div>
+
+			<%--<div class="form-group layui-row">
 				<div class="form-group-label"><h2>附件信息</h2></div>
 				<div class="layui-item nav-btns">
 					<a id="attachment_btn" class="nav-btn nav-btn-add" title="添加附件"><i class="fa fa-plus"></i>&nbsp;添加附件</a>
@@ -211,7 +235,7 @@
 					<table id="upTable" class="table table-bordered table-condensed details">
 						<thead>
 						<tr>
-								<%-- <th>序号</th>--%>
+								&lt;%&ndash; <th>序号</th>&ndash;%&gt;
 							<th>文件预览</th>
 							<th>上传人</th>
 							<th>上传时间</th>
@@ -221,7 +245,7 @@
 						<tbody id="file_attachment">
 						<c:forEach items="${projectReportRecord.workAttachments}" var = "workClientAttachment" varStatus="status">
 							<tr>
-									<%-- <td>${status.index + 1}</td>--%>
+									&lt;%&ndash; <td>${status.index + 1}</td>&ndash;%&gt;
 								<c:choose>
 									<c:when test="${fn:containsIgnoreCase(workClientAttachment.attachmentName,'jpg')
                                                            or fn:containsIgnoreCase(workClientAttachment.attachmentName,'png')
@@ -257,10 +281,166 @@
 						</tbody>
 					</table>
 				</div>
-			</div>
+			</div>--%>
 			<div class="form-group layui-row page-end"></div>
 		</form:form>
 	</div>
 </div>
+<script src="${ctxStatic}/layer-v2.3/layui/layui.all.js" charset="utf-8"></script>
+<script src="${ctxStatic}/layer-v2.3/layui/tableTree/treetable.js" charset="utf-8"></script>
+<script>
+	/*使用模块加载的方式 加载文件*/
+	layui.config({
+		base: '${ctx}/resoueces/css/layui/module/'
+	}).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;
+
+		// 渲染表格
+		window.renderTable = function () {//树桩表格参考文档:https://gitee.com/whvse/treetable-lay
+			layer.load(2);
+			treetable.render({
+				treeColIndex: 1,//树形图标显示在第几列
+				treeSpid: 0,//最上级的父级id
+				treeIdName: 'permissionId',//id字段的名称
+				treePidName: 'pid',//pid字段的名称
+				treeDefaultClose: false,//是否默认折叠
+				treeLinkage: true,//父级展开时是否自动展开所有子级
+				elem: '#permissionTable',
+				url: '${ctx}/projectAccessory/projectAccessory/getProjectAccessoryTreeData?projectId=${project.id}',
+				page: false,
+				cols: [[
+					{type: 'numbers', title: '编号' ,width:80},
+					{field: 'type', title: '电子件名称'},
+					{field: 'workAttachments',title: '附件',templet:function(d){
+						if(d.pid !='0'){
+							if(null == d.workAttachments || '' == d.workAttachments){
+								return "<span style=\"color:red\" title='无附件'>无附件</span>";
+							}else{
+								var html = '';
+								for (var x in d.workAttachments) {
+									html += "<div style='display:inline;float:left;'><a style='width:100px;display:block;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;' class=\"attention-info\" href=\"javascript:void(0)\" onclick=\"preview('预览','"+d.workAttachments[x].url+"','90%','90%')\" title='"+d.workAttachments[x].attachmentName+"'>"+d.workAttachments[x].attachmentName+"</a></div>"
+									if(x != d.workAttachments.length-1){
+										html += "<div style='display:inline;float:left;'> ; </div>";
+									}
+								}
+								return html;
+							}
+						}else{
+							return "";
+						}
+						}},
+					{templet: complain, title: '附件管理',width:80}
+				]],
+				done: function () {
+					layer.closeAll('loading');
+				}
+			});
+		};
+
+		renderTable();
+
+		//触发三个button按钮
+		$('#btn-expand').click(function () {
+			treetable.expandAll('#permissionTable');
+		});
+
+		$('#btn-fold').click(function () {
+			treetable.foldAll('#permissionTable');
+		});
+
+		$('#btn-refresh').click(function () {
+			renderTable();
+		});
+
+
+		function complain(d){//操作中显示的内容
+			if(d.pid !=0){
+				return [
+					'<a href="javascript:void(0)"  onclick="openBill2(\'编辑附件\', \'${ctx}/projectAccessory/projectAccessory/workAttachmentForm?attachmentId='+d.id+'&projectId='+d.projectId+'\',\'70%\',\'80%\',false,\'inputForm\')" class="op-btn op-btn-edit" ><i class="fa fa-edit"></i> 编辑</a>',
+				].join('');
+			}else{
+				return[''].join('');
+			}
+		}
+	});
+
+	function openBill2(title,url,width,height,target,formId){
+		var rows = $(this).parent().prevAll().length + 1;
+		var frameIndex = parent.layer.getFrameIndex(window.name);
+		var urls = url+"&index="+frameIndex;
+		if(navigator.userAgent.match(/(iPhone|iPod|Android|ios)/i)){//如果是移动端,就使用自适应大小弹窗
+			width='auto';
+			height='auto';
+		}else{//如果是PC端,根据用户设置的width和height显示。
+
+		}
+		top.layer.open({
+			type: 2,
+			area: [width, height],
+			title: title,
+			skin:"two-btns",
+			maxmin: false, //开启最大化最小化按钮
+			content: urls ,
+			btn: ['确定','关闭'],
+			yes: function(index, layero){
+				var body = top.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中展示
+				inputForm.attr("action","${ctx}/projectAccessory/projectAccessory/saveWorkAttachment");//表单提交成功后,从服务器返回的url在当前tab中展示
+				var $document = iframeWin.contentWindow.document;
+
+				formSubmit2($document,formId,index);
+
+			},
+			cancel: function(index){
+			}
+		});
+	}
+	function formSubmit2($document,inputForm,index){
+
+		var validateForm = $($document.getElementById(inputForm)).validate({
+			submitHandler: function(form){
+				loading('正在提交,请稍等...');
+				form.submit();
+			},
+			errorContainer: "#messageBox",
+			errorPlacement: function(error, element) {
+				$($document.getElementById("#messageBox")).text("输入有误,请先更正。");
+				if (element.is(":checkbox")||element.is(":radio")||element.parent().is(".input-append")){
+					error.appendTo(element.parent().parent());
+				} else {
+					error.insertAfter(element);
+				}
+			}
+		});
+		if(validateForm.form()){
+			$($document.getElementById(inputForm)).ajaxSubmit({
+				success:function(data) {
+					var d = data;
+					//调用layui.use中的renderTable()方法刷新列表
+					renderTable()
+					//输出提示信息
+					if(d.str.length>0){
+						parent.layer.msg(d.str,{icon:1});
+					}
+					//关闭当前页
+					top.layer.close(index)
+				}
+			});
+		}
+	}
+</script>
 </body>
 </html>

+ 183 - 3
src/main/webapp/webpage/modules/ruralprojectrecords/projectReportRecord/projectReportRecordModify.jsp

@@ -4,11 +4,24 @@
 <head>
 	<title>合同归档管理</title>
 	<meta name="decorator" content="default"/>
+	<link href="${ctxStatic}/layer-v2.3/layui/tableTree/treetable.css" rel="stylesheet" />
 	<style>
 		label.error:nth-child(2){
 			top:40px;
 			left:0;
 		}
+		.layui-table th{
+			font-size: 14px;
+			/*表头内容居中显示*/
+			text-align: center;
+		}
+		.layui-table td{
+			/*表头内容居中显示*/
+			text-align: left;
+		}
+		span{
+			font-size: 14px;
+		}
 	</style>
 	<script type="text/javascript">
         var validateForm;
@@ -224,7 +237,18 @@
 					</div>
 				</div>
 			</div>
+
+
 			<div class="form-group layui-row">
+				<div class="form-group-label"><h2>附件信息列表</h2></div>
+
+				<div class="layui-item layui-col-xs12 form-table-container">
+					<table id="permissionTable" class="layui-table" lay-filter="permissionTable"></table>
+				</div>
+			</div>
+
+
+			<%--<div class="form-group layui-row">
 				<div class="form-group-label"><h2>附件信息</h2></div>
 				<div class="layui-item nav-btns">
 					<a id="attachment_btn" class="nav-btn nav-btn-add" title="添加附件"><i class="fa fa-plus"></i>&nbsp;添加附件</a>
@@ -243,7 +267,7 @@
 					<table id="upTable" class="table table-bordered table-condensed details">
 						<thead>
 						<tr>
-								<%-- <th>序号</th>--%>
+								&lt;%&ndash; <th>序号</th>&ndash;%&gt;
 							<th>文件预览</th>
 							<th>上传人</th>
 							<th>上传时间</th>
@@ -253,7 +277,7 @@
 						<tbody id="file_attachment">
 						<c:forEach items="${projectReportRecord.workAttachments}" var = "workClientAttachment" varStatus="status">
 							<tr>
-									<%-- <td>${status.index + 1}</td>--%>
+									&lt;%&ndash; <td>${status.index + 1}</td>&ndash;%&gt;
 								<c:choose>
 									<c:when test="${fn:containsIgnoreCase(workClientAttachment.attachmentName,'jpg')
                                                            or fn:containsIgnoreCase(workClientAttachment.attachmentName,'png')
@@ -289,10 +313,166 @@
 						</tbody>
 					</table>
 				</div>
-			</div>
+			</div>--%>
 			<div class="form-group layui-row page-end"></div>
 		</form:form>
 	</div>
 </div>
+<script src="${ctxStatic}/layer-v2.3/layui/layui.all.js" charset="utf-8"></script>
+<script src="${ctxStatic}/layer-v2.3/layui/tableTree/treetable.js" charset="utf-8"></script>
+<script>
+	/*使用模块加载的方式 加载文件*/
+	layui.config({
+		base: '${ctx}/resoueces/css/layui/module/'
+	}).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;
+
+		// 渲染表格
+		window.renderTable = function () {//树桩表格参考文档:https://gitee.com/whvse/treetable-lay
+			layer.load(2);
+			treetable.render({
+				treeColIndex: 1,//树形图标显示在第几列
+				treeSpid: 0,//最上级的父级id
+				treeIdName: 'permissionId',//id字段的名称
+				treePidName: 'pid',//pid字段的名称
+				treeDefaultClose: false,//是否默认折叠
+				treeLinkage: true,//父级展开时是否自动展开所有子级
+				elem: '#permissionTable',
+				url: '${ctx}/projectAccessory/projectAccessory/getProjectAccessoryTreeData?projectId=${project.id}',
+				page: false,
+				cols: [[
+					{type: 'numbers', title: '编号' ,width:80},
+					{field: 'type', title: '电子件名称'},
+					{field: 'workAttachments',title: '附件',templet:function(d){
+							if(d.pid !='0'){
+								if(null == d.workAttachments || '' == d.workAttachments){
+									return "<span style=\"color:red\" title='无附件'>无附件</span>";
+								}else{
+									var html = '';
+									for (var x in d.workAttachments) {
+										html += "<div style='display:inline;float:left;'><a style='width:100px;display:block;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;' class=\"attention-info\" href=\"javascript:void(0)\" onclick=\"preview('预览','"+d.workAttachments[x].url+"','90%','90%')\" title='"+d.workAttachments[x].attachmentName+"'>"+d.workAttachments[x].attachmentName+"</a></div>"
+										if(x != d.workAttachments.length-1){
+											html += "<div style='display:inline;float:left;'> ; </div>";
+										}
+									}
+									return html;
+								}
+							}else{
+								return "";
+							}
+						}},
+					{templet: complain, title: '附件管理',width:80}
+				]],
+				done: function () {
+					layer.closeAll('loading');
+				}
+			});
+		};
+
+		renderTable();
+
+		//触发三个button按钮
+		$('#btn-expand').click(function () {
+			treetable.expandAll('#permissionTable');
+		});
+
+		$('#btn-fold').click(function () {
+			treetable.foldAll('#permissionTable');
+		});
+
+		$('#btn-refresh').click(function () {
+			renderTable();
+		});
+
+
+		function complain(d){//操作中显示的内容
+			if(d.pid !=0){
+				return [
+					'<a href="javascript:void(0)"  onclick="openBill2(\'编辑附件\', \'${ctx}/projectAccessory/projectAccessory/workAttachmentForm?attachmentId='+d.id+'&projectId='+d.projectId+'\',\'70%\',\'80%\',false,\'inputForm\')" class="op-btn op-btn-edit" ><i class="fa fa-edit"></i> 编辑</a>',
+				].join('');
+			}else{
+				return[''].join('');
+			}
+		}
+	});
+
+	function openBill2(title,url,width,height,target,formId){
+		var rows = $(this).parent().prevAll().length + 1;
+		var frameIndex = parent.layer.getFrameIndex(window.name);
+		var urls = url+"&index="+frameIndex;
+		if(navigator.userAgent.match(/(iPhone|iPod|Android|ios)/i)){//如果是移动端,就使用自适应大小弹窗
+			width='auto';
+			height='auto';
+		}else{//如果是PC端,根据用户设置的width和height显示。
+
+		}
+		top.layer.open({
+			type: 2,
+			area: [width, height],
+			title: title,
+			skin:"two-btns",
+			maxmin: false, //开启最大化最小化按钮
+			content: urls ,
+			btn: ['确定','关闭'],
+			yes: function(index, layero){
+				var body = top.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中展示
+				inputForm.attr("action","${ctx}/projectAccessory/projectAccessory/saveWorkAttachment");//表单提交成功后,从服务器返回的url在当前tab中展示
+				var $document = iframeWin.contentWindow.document;
+
+				formSubmit2($document,formId,index);
+
+			},
+			cancel: function(index){
+			}
+		});
+	}
+	function formSubmit2($document,inputForm,index){
+
+		var validateForm = $($document.getElementById(inputForm)).validate({
+			submitHandler: function(form){
+				loading('正在提交,请稍等...');
+				form.submit();
+			},
+			errorContainer: "#messageBox",
+			errorPlacement: function(error, element) {
+				$($document.getElementById("#messageBox")).text("输入有误,请先更正。");
+				if (element.is(":checkbox")||element.is(":radio")||element.parent().is(".input-append")){
+					error.appendTo(element.parent().parent());
+				} else {
+					error.insertAfter(element);
+				}
+			}
+		});
+		if(validateForm.form()){
+			$($document.getElementById(inputForm)).ajaxSubmit({
+				success:function(data) {
+					var d = data;
+					//调用layui.use中的renderTable()方法刷新列表
+					renderTable()
+					//输出提示信息
+					if(d.str.length>0){
+						parent.layer.msg(d.str,{icon:1});
+					}
+					//关闭当前页
+					top.layer.close(index)
+				}
+			});
+		}
+	}
+</script>
 </body>
 </html>

+ 187 - 3
src/main/webapp/webpage/modules/ruralprojectrecords/projectReportRecord/projectReportRecordView.jsp

@@ -4,6 +4,25 @@
 <head>
 	<title>合同归档管理</title>
 	<meta name="decorator" content="default"/>
+	<link href="${ctxStatic}/layer-v2.3/layui/tableTree/treetable.css" rel="stylesheet" />
+	<style>
+		label.error:nth-child(2){
+			top:40px;
+			left:0;
+		}
+		.layui-table th{
+			font-size: 14px;
+			/*表头内容居中显示*/
+			text-align: center;
+		}
+		.layui-table td{
+			/*表头内容居中显示*/
+			text-align: left;
+		}
+		span{
+			font-size: 14px;
+		}
+	</style>
 	<script type="text/javascript">
 
 	</script>
@@ -132,14 +151,23 @@
 				</div>
 			</div>
 		</div>
+
 		<div class="form-group layui-row">
+			<div class="form-group-label"><h2>附件信息列表</h2></div>
+
+			<div class="layui-item layui-col-xs12 form-table-container">
+				<table id="permissionTable" class="layui-table" lay-filter="permissionTable"></table>
+			</div>
+		</div>
+
+		<%--<div class="form-group layui-row">
 			<div class="form-group-label"><h2>附件信息</h2></div>
 			<span id="attachment_title"></span>
 			<div class="layui-item layui-col-xs12" style="padding:0 16px;">
 				<table id="upTable" class="table table-bordered table-condensed details">
 					<thead>
 					<tr>
-						<%-- <th>序号</th>--%>
+						&lt;%&ndash; <th>序号</th>&ndash;%&gt;
 						<th>文件预览</th>
 						<th>上传人</th>
 						<th>上传时间</th>
@@ -149,7 +177,7 @@
 					<tbody id="file_attachment">
 					<c:forEach items="${projectReportRecord.workAttachments}" var = "workClientAttachment" varStatus="status">
 						<tr>
-								<%-- <td>${status.index + 1}</td>--%>
+								&lt;%&ndash; <td>${status.index + 1}</td>&ndash;%&gt;
 							<c:choose>
 								<c:when test="${fn:containsIgnoreCase(workClientAttachment.attachmentName,'jpg')
                                                            or fn:containsIgnoreCase(workClientAttachment.attachmentName,'png')
@@ -181,9 +209,165 @@
 					</tbody>
 				</table>
 			</div>
-		</div>
+		</div>--%>
 			<div class="form-group layui-row page-end"></div>
 	</div>
 </div>
+<script src="${ctxStatic}/layer-v2.3/layui/layui.all.js" charset="utf-8"></script>
+<script src="${ctxStatic}/layer-v2.3/layui/tableTree/treetable.js" charset="utf-8"></script>
+<script>
+	/*使用模块加载的方式 加载文件*/
+	layui.config({
+		base: '${ctx}/resoueces/css/layui/module/'
+	}).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;
+
+		// 渲染表格
+		window.renderTable = function () {//树桩表格参考文档:https://gitee.com/whvse/treetable-lay
+			layer.load(2);
+			treetable.render({
+				treeColIndex: 1,//树形图标显示在第几列
+				treeSpid: 0,//最上级的父级id
+				treeIdName: 'permissionId',//id字段的名称
+				treePidName: 'pid',//pid字段的名称
+				treeDefaultClose: false,//是否默认折叠
+				treeLinkage: true,//父级展开时是否自动展开所有子级
+				elem: '#permissionTable',
+				url: '${ctx}/projectAccessory/projectAccessory/getProjectAccessoryTreeData?projectId=${project.id}',
+				page: false,
+				cols: [[
+					{type: 'numbers', title: '编号' ,width:80},
+					{field: 'type', title: '电子件名称'},
+					{field: 'workAttachments',title: '附件',templet:function(d){
+							if(d.pid !='0'){
+								if(null == d.workAttachments || '' == d.workAttachments){
+									return "<span style=\"color:red\" title='无附件'>无附件</span>";
+								}else{
+									var html = '';
+									for (var x in d.workAttachments) {
+										html += "<div style='display:inline;float:left;'><a style='width:100px;display:block;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;' class=\"attention-info\" href=\"javascript:void(0)\" onclick=\"preview('预览','"+d.workAttachments[x].url+"','90%','90%')\" title='"+d.workAttachments[x].attachmentName+"'>"+d.workAttachments[x].attachmentName+"</a></div>"
+										if(x != d.workAttachments.length-1){
+											html += "<div style='display:inline;float:left;'> ; </div>";
+										}
+									}
+									return html;
+								}
+							}else{
+								return "";
+							}
+						}},
+					{templet: complain, title: '附件管理',width:80}
+				]],
+				done: function () {
+					layer.closeAll('loading');
+				}
+			});
+		};
+
+		renderTable();
+
+		//触发三个button按钮
+		$('#btn-expand').click(function () {
+			treetable.expandAll('#permissionTable');
+		});
+
+		$('#btn-fold').click(function () {
+			treetable.foldAll('#permissionTable');
+		});
+
+		$('#btn-refresh').click(function () {
+			renderTable();
+		});
+
+
+		function complain(d){//操作中显示的内容
+			if(d.pid !=0){
+				return [
+					'<a href="javascript:void(0)"  onclick="openBill2(\'附件详情\', \'${ctx}/projectAccessory/projectAccessory/workAttachmentView?attachmentId='+d.id+'&projectId='+d.projectId+'\',\'70%\',\'80%\',false,\'inputForm\')" class="op-btn op-btn-edit" ><i class="fa fa-search-plus"></i> 详情</a>',
+				].join('');
+			}else{
+				return[''].join('');
+			}
+		}
+	});
+
+	function openBill2(title,url,width,height,target,formId){
+		var rows = $(this).parent().prevAll().length + 1;
+		var frameIndex = parent.layer.getFrameIndex(window.name);
+		var urls = url+"&index="+frameIndex;
+		if(navigator.userAgent.match(/(iPhone|iPod|Android|ios)/i)){//如果是移动端,就使用自适应大小弹窗
+			width='auto';
+			height='auto';
+		}else{//如果是PC端,根据用户设置的width和height显示。
+
+		}
+		top.layer.open({
+			type: 2,
+			area: [width, height],
+			title: title,
+			skin:"two-btns",
+			maxmin: false, //开启最大化最小化按钮
+			content: urls ,
+			btn: ['确定','关闭'],
+			yes: function(index, layero){
+				var body = top.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中展示
+				inputForm.attr("action","${ctx}/projectAccessory/projectAccessory/saveWorkAttachment");//表单提交成功后,从服务器返回的url在当前tab中展示
+				var $document = iframeWin.contentWindow.document;
+
+				formSubmit2($document,formId,index);
+
+			},
+			cancel: function(index){
+			}
+		});
+	}
+	function formSubmit2($document,inputForm,index){
+
+		var validateForm = $($document.getElementById(inputForm)).validate({
+			submitHandler: function(form){
+				loading('正在提交,请稍等...');
+				form.submit();
+			},
+			errorContainer: "#messageBox",
+			errorPlacement: function(error, element) {
+				$($document.getElementById("#messageBox")).text("输入有误,请先更正。");
+				if (element.is(":checkbox")||element.is(":radio")||element.parent().is(".input-append")){
+					error.appendTo(element.parent().parent());
+				} else {
+					error.insertAfter(element);
+				}
+			}
+		});
+		if(validateForm.form()){
+			$($document.getElementById(inputForm)).ajaxSubmit({
+				success:function(data) {
+					var d = data;
+					//调用layui.use中的renderTable()方法刷新列表
+					renderTable()
+					//输出提示信息
+					if(d.str.length>0){
+						parent.layer.msg(d.str,{icon:1});
+					}
+					//关闭当前页
+					top.layer.close(index)
+				}
+			});
+		}
+	}
+</script>
 </body>
 </html>