浏览代码

盖章申请模块修改

wangqiang 2 年之前
父节点
当前提交
cfa1bef842
共有 22 个文件被更改,包括 1804 次插入59 次删除
  1. 1 0
      src/main/java/com/jeeplus/modules/ruralprojectrecords/dao/RuralProjectRecordsDao.java
  2. 6 0
      src/main/java/com/jeeplus/modules/ruralprojectrecords/service/RuralProjectRecordsService.java
  3. 57 0
      src/main/java/com/jeeplus/modules/sealApplyFor/dao/SealApplyForDao.java
  4. 91 0
      src/main/java/com/jeeplus/modules/sealApplyFor/entity/SealApplyForInfo.java
  5. 81 2
      src/main/java/com/jeeplus/modules/sealApplyFor/service/SealApplyForService.java
  6. 136 13
      src/main/java/com/jeeplus/modules/sealApplyFor/web/SealApplyForController.java
  7. 10 0
      src/main/java/com/jeeplus/modules/sealMaterial/entity/SealMaterialInfo.java
  8. 14 4
      src/main/java/com/jeeplus/modules/sealMaterial/entity/SealMaterialInfoImport.java
  9. 1 1
      src/main/java/com/jeeplus/modules/sealMaterial/service/SealMaterialService.java
  10. 84 5
      src/main/java/com/jeeplus/modules/sealMaterial/web/SealMaterialController.java
  11. 5 1
      src/main/java/com/jeeplus/modules/workprojectnotify/web/WorkProjectNotifyController.java
  12. 16 1
      src/main/resources/mappings/modules/ruralprojectrecords/RuralProjectRecordsDao.xml
  13. 74 8
      src/main/resources/mappings/modules/sealApplyFor/SealApplyForDao.xml
  14. 6 3
      src/main/resources/mappings/modules/sealMaterial/sealMaterialDao.xml
  15. 56 0
      src/main/webapp/WEB-INF/tags/sys/gridselectcallproject2.tag
  16. 168 2
      src/main/webapp/webpage/modules/sealApplyFor/sealApplyForAudit.jsp
  17. 543 0
      src/main/webapp/webpage/modules/sealApplyFor/sealApplyForForm2.jsp
  18. 6 3
      src/main/webapp/webpage/modules/sealApplyFor/sealApplyForList.jsp
  19. 168 3
      src/main/webapp/webpage/modules/sealApplyFor/sealApplyForModify.jsp
  20. 103 0
      src/main/webapp/webpage/modules/sealApplyFor/sealApplyForProjectView.jsp
  21. 167 1
      src/main/webapp/webpage/modules/sealApplyFor/sealApplyForView.jsp
  22. 11 12
      src/main/webapp/webpage/modules/sys/gridReimburProjectList.jsp

+ 1 - 0
src/main/java/com/jeeplus/modules/ruralprojectrecords/dao/RuralProjectRecordsDao.java

@@ -23,6 +23,7 @@ import java.util.List;
 @MyBatisDao
 public interface RuralProjectRecordsDao extends CrudDao<RuralProjectRecords> {
 
+    ProjectRecords getRuralProjectRecodes(String id);
 
     void updateProcessIdAndStatus(RuralProjectRecords projectRecords);
 

+ 6 - 0
src/main/java/com/jeeplus/modules/ruralprojectrecords/service/RuralProjectRecordsService.java

@@ -189,6 +189,12 @@ public class RuralProjectRecordsService extends CrudService<RuralProjectRecordsD
 	@Autowired
 	private StatementCompanyComprehensiveService statementCompanyComprehensiveService;
 
+	//盖章用
+	public ProjectRecords getRuralInfo(String id) {
+		ProjectRecords projectRecords = dao.getRuralProjectRecodes(id);
+		return projectRecords;
+	}
+
 	/**
 	 * 获取咨询项目类别
 	 * @return

+ 57 - 0
src/main/java/com/jeeplus/modules/sealApplyFor/dao/SealApplyForDao.java

@@ -4,6 +4,7 @@ import com.jeeplus.common.persistence.CrudDao;
 import com.jeeplus.common.persistence.annotation.MyBatisDao;
 import com.jeeplus.modules.projectrecord.entity.ProjectRecords;
 import com.jeeplus.modules.sealApplyFor.entity.SealApplyForInfo;
+import org.apache.ibatis.annotations.Param;
 
 import java.util.List;
 
@@ -24,4 +25,60 @@ public interface SealApplyForDao extends CrudDao<SealApplyForInfo> {
      * @return
      */
     List<ProjectRecords> ruralFindPageByReimbur(ProjectRecords records);
+
+    /*
+    根据盖章id删除关联关系表中对应的数据
+     */
+    void deleteProjectInfo(@Param("id") String id);
+
+    /*
+    将盖章id与项目id存到关联表中
+     */
+    void insertIntoProjectInfo(@Param("id") String id, @Param("projectId") String projectId);
+
+    /**
+     * 根据盖章id查出所以的项目id
+     * @param id
+     * @return
+     */
+    List<SealApplyForInfo> getByApplyId(String id);
+
+    /**
+     * 获取所有项目的报告文号
+     * @return
+     */
+    List<String> getAllReportNumber();
+
+    /**
+     * 获取与盖章关联的所有的项目id
+     * @return
+     */
+    List<String> getProjectIdById(String id);
+
+    /**
+     * 根据项目id获取项目名称和报告号
+     * @param projectId
+     * @return
+     */
+    SealApplyForInfo getProjectInfoByProId(String projectId);
+
+    /**
+     * 获取所有与项目关联的报告号
+     * @return
+     */
+    List<String> getAllReport();
+
+    /**
+     * 根据id获取所有关联的项目的报告号
+     * @param id
+     * @return
+     */
+    List<String> getReportNumById(String id);
+
+    /**
+     * 根据项目报告号获取其他关联的项目id
+     * @param reportNum
+     * @return
+     */
+    String getProjectInfoByReportNum(String reportNum);
 }

+ 91 - 0
src/main/java/com/jeeplus/modules/sealApplyFor/entity/SealApplyForInfo.java

@@ -15,6 +15,88 @@ import java.util.List;
  */
 public class SealApplyForInfo extends ActEntity<SealApplyForInfo> {
 
+    private String projectName;//项目名称
+    private String createByName;//创建人名称
+    private String createById;//创建人id
+    private String projectMasterName;//项目负责人
+    private String projectMasterId;//项目负责人id
+    private String startDate;//开始时间
+    private String endingDate;//结束时间
+    private String reportDataNum;//报告号
+    private String reviewerPersonId;//审核人
+
+    public String getReviewerPersonId() {
+        return reviewerPersonId;
+    }
+
+    public void setReviewerPersonId(String reviewerPersonId) {
+        this.reviewerPersonId = reviewerPersonId;
+    }
+
+    public String getProjectName() {
+        return projectName;
+    }
+
+    public void setProjectName(String projectName) {
+        this.projectName = projectName;
+    }
+
+    public String getCreateByName() {
+        return createByName;
+    }
+
+    public void setCreateByName(String createByName) {
+        this.createByName = createByName;
+    }
+
+    public String getCreateById() {
+        return createById;
+    }
+
+    public void setCreateById(String createById) {
+        this.createById = createById;
+    }
+
+    public String getProjectMasterName() {
+        return projectMasterName;
+    }
+
+    public void setProjectMasterName(String projectMasterName) {
+        this.projectMasterName = projectMasterName;
+    }
+
+    public String getProjectMasterId() {
+        return projectMasterId;
+    }
+
+    public void setProjectMasterId(String projectMasterId) {
+        this.projectMasterId = projectMasterId;
+    }
+
+    public String getStartDate() {
+        return startDate;
+    }
+
+    public void setStartDate(String startDate) {
+        this.startDate = startDate;
+    }
+
+    public String getEndingDate() {
+        return endingDate;
+    }
+
+    public void setEndingDate(String endingDate) {
+        this.endingDate = endingDate;
+    }
+
+    public String getReportDataNum() {
+        return reportDataNum;
+    }
+
+    public void setReportDataNum(String reportDataNum) {
+        this.reportDataNum = reportDataNum;
+    }
+
     private RuralProjectRecords projectRecords; //项目信息
     private String projectId;   //项目id
     private String sealCompany;  //公司(0:东兴;1:赣能)
@@ -26,6 +108,15 @@ public class SealApplyForInfo extends ActEntity<SealApplyForInfo> {
     private Date endDate;  //结束时间
     private String home;
 
+    private List<SealApplyForInfo> workInvoiceProjectRelationList;
+
+    public List<SealApplyForInfo> getWorkInvoiceProjectRelationList() {
+        return workInvoiceProjectRelationList;
+    }
+
+    public void setWorkInvoiceProjectRelationList(List<SealApplyForInfo> workInvoiceProjectRelationList) {
+        this.workInvoiceProjectRelationList = workInvoiceProjectRelationList;
+    }
 
     private List<SealMaterialInfoImport> sealMaterialInfoList;
 

+ 81 - 2
src/main/java/com/jeeplus/modules/sealApplyFor/service/SealApplyForService.java

@@ -78,6 +78,64 @@ public class SealApplyForService extends CrudService<SealApplyForDao, SealApplyF
     @Autowired
     private SealMaterialService sealMaterialService;
 
+    /**
+     * 根据项目报告号获取项目名称和报告号
+     * @param reportNum
+     * @return
+     */
+    public String getProjectInfoByReportNum(String reportNum){
+        return dao.getProjectInfoByReportNum(reportNum);
+    }
+    /**
+     * 根据项目id获取项目名称和报告号
+     * @param projectId
+     * @return
+     */
+    public SealApplyForInfo getProjectInfoByProId(String projectId){
+        return dao.getProjectInfoByProId(projectId);
+    }
+
+    /**
+     * 获取与盖章关联的项目的报告号
+     * @param id
+     * @return
+     */
+    public List<String> getReportNumById(String id){
+        return dao.getReportNumById(id);
+    }
+
+    /**
+     * 获取与盖章关联的项目id
+     * @return
+     */
+    public List<String> getProjectIdById(String id){
+        return dao.getProjectIdById(id);
+    }
+
+    /**
+     * 获取与盖章关联的所有的项目报告号
+     * @return
+     */
+    public List<String> getAllReport(){
+        return dao.getAllReport();
+    }
+    /**
+     * 获取所有的项目报告文号
+     * @return
+     */
+    public List<String> getAllReportNumber(){
+        return dao.getAllReportNumber();
+    }
+
+    /**
+     * 根据盖章id查出所以的项目信息
+     * @param id
+     * @return
+     */
+    public List<SealApplyForInfo> getByApplyId(String id){
+        return dao.getByApplyId(id);
+    }
+
     public SealApplyForInfo get(String id) {
         SealApplyForInfo sealApplyForInfo = super.get(id);
         if (null !=sealApplyForInfo){
@@ -194,6 +252,12 @@ public class SealApplyForService extends CrudService<SealApplyForDao, SealApplyF
                     sealMaterialService.batchSave(sealMaterialInfoImportList);
                 }
             }
+            //将盖章与项目信息保存到关联表中
+            //插入前先删除关联信息
+            dao.deleteProjectInfo(sealApplyForInfo.getId());
+            sealApplyForInfo.getWorkInvoiceProjectRelationList().forEach(li->{
+                dao.insertIntoProjectInfo(sealApplyForInfo.getId(),li.getProjectId());
+            });
 
             //启动审批流程
             if (sealApplyForInfo.getStatus()== ProjectStatusEnum.IN_APRL.getValue()&&(oldStatus==null|| ProjectStatusEnum.REJECTED.getValue()!=oldStatus)) {
@@ -401,15 +465,22 @@ public class SealApplyForService extends CrudService<SealApplyForDao, SealApplyF
                     }
                 }
             }
-
             sealApplyFor = sealApplyForInfo;
             flag = "yes";
         }
+        //将盖章与项目信息保存到关联表中
+        //插入前先删除关联信息
+        dao.deleteProjectInfo(sealApplyForInfo.getId());
+        sealApplyForInfo.getWorkInvoiceProjectRelationList().forEach(li->{
+            dao.insertIntoProjectInfo(sealApplyForInfo.getId(),li.getProjectId());
+        });
+        RuralProjectRecords projectRecords = projectRecordsService.get(sealApplyFor.getProjectId());
+        sealApplyFor.setProjectRecords(projectRecords);
         User user= UserUtils.get(sealApplyFor.getCreateBy().getId());
         String title =  "盖章申请:项目【"+sealApplyFor.getProjectRecords().getProjectName()+"】待审批,项目编号:"+sealApplyFor.getProjectRecords().getProjectId();
         String str = "盖章申请:项目【"+ sealApplyFor.getProjectRecords().getProjectName()+"】";
 
-        
+
         if (StringUtils.isBlank(act.getComment())){
             act.setComment(flag.equals("yes")?"同意":"驳回");
         }
@@ -766,6 +837,14 @@ public class SealApplyForService extends CrudService<SealApplyForDao, SealApplyF
         super.delete(sealApplyForInfo);
     }
 
+    /**
+     * 根据盖章id删除关联关系表数据
+     * @param id
+     */
+    @Transactional(readOnly = false)
+    public void deleteProjectInfo(String id) {
+        dao.deleteProjectInfo(id);
+    }
 
 
 }

+ 136 - 13
src/main/java/com/jeeplus/modules/sealApplyFor/web/SealApplyForController.java

@@ -1,7 +1,9 @@
 package com.jeeplus.modules.sealApplyFor.web;
 
 import com.google.common.collect.Lists;
+import com.google.common.collect.Maps;
 import com.jeeplus.common.config.Global;
+import com.jeeplus.common.mapper.JsonMapper;
 import com.jeeplus.common.persistence.Page;
 import com.jeeplus.common.utils.MyBeanUtils;
 import com.jeeplus.common.utils.StringUtils;
@@ -37,10 +39,8 @@ import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
 import java.io.UnsupportedEncodingException;
 import java.net.URLDecoder;
-import java.util.Date;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
+import java.text.SimpleDateFormat;
+import java.util.*;
 
 /**
  * 盖章申请Controller
@@ -63,6 +63,8 @@ public class SealApplyForController extends BaseController {
     private ActTaskService actTaskService;
     @Autowired
     private SealMaterialService sealMaterialService;
+    @Autowired
+    private HttpServletRequest request;
 
     @ModelAttribute
     public SealApplyForInfo get(@RequestParam(required=false) String id) {
@@ -134,6 +136,8 @@ public class SealApplyForController extends BaseController {
     @RequestMapping(value = "form")
     public String form(SealApplyForInfo sealApplyForInfo, Model model) {
         List<SealMaterialInfo> sealMaterialInfos = sealMaterialService.getSealMaterialByProjectId(sealApplyForInfo.getProjectId());
+        //根据盖章id获取所以的项目信息
+        List<SealApplyForInfo> workInvoiceProjectRelationList = service.getByApplyId(sealApplyForInfo.getId());
         if(StringUtils.isNotBlank(sealApplyForInfo.getProjectId())){
 
             RuralProjectRecords projectRecords = projectRecordsService.get(sealApplyForInfo.getProjectId());
@@ -191,17 +195,33 @@ public class SealApplyForController extends BaseController {
         if(StringUtils.isBlank(sealApplyForInfo.getSealCompany())){
             sealApplyForInfo.setSealCompany("1");
         }
-
+        if (null != workInvoiceProjectRelationList){
+            sealApplyForInfo.setWorkInvoiceProjectRelationList(workInvoiceProjectRelationList);
+        }
         User user = UserUtils.getUser();
         SealMaterialInfo sealMaterialInfo = new SealMaterialInfo();
         sealMaterialInfo.setAgent(user);
         if(null != sealMaterialInfos){
             sealMaterialInfo.setSealMaterialInfoList(sealMaterialInfos);
         }
+
+        //将项目信息放入到list中
         model.addAttribute("sealMaterialInfo",sealMaterialInfo);
         model.addAttribute("sealApplyForInfo", sealApplyForInfo);
-        return "modules/sealApplyFor/sealApplyForForm";
+        return "modules/sealApplyFor/sealApplyForForm2";
     }
+
+    /**
+     * 开票管理列表页面
+     */
+    @RequestMapping(value = "projectview")
+    public String view(SealApplyForInfo sealApplyForInfo, HttpServletRequest request, HttpServletResponse response, Model model) {
+//        invoice.setWorkInvoiceProjectRelationList(invoiceService.getProjectRelation(invoice));
+        sealApplyForInfo.setWorkInvoiceProjectRelationList(service.getByApplyId(sealApplyForInfo.getId()));
+        model.addAttribute("sealApplyForInfo", sealApplyForInfo);
+        return "modules/sealApplyFor/sealApplyForProjectView";
+    }
+
     /**
      * 查看
      * @param sealApplyForInfo
@@ -213,15 +233,60 @@ public class SealApplyForController extends BaseController {
     public String view(SealApplyForInfo sealApplyForInfo, Model model) {
         model.addAttribute("sealApplyForInfo", sealApplyForInfo);
         List<SealMaterialInfo> sealMaterialInfos = sealMaterialService.getSealMaterialByProjectId(sealApplyForInfo.getProjectId());
+        //根据盖章id获取所以的项目信息
+        List<SealApplyForInfo> workInvoiceProjectRelationList = service.getByApplyId(sealApplyForInfo.getId());
         if(sealMaterialInfos.size()<=0){
 //            addMessage(redirectAttributes, "盖章申请已送审,无法暂存");
 //            return "redirect:"+ Global.getAdminPath()+"/sealApplyFor/sealApplyFor/?repage";
-            logger.error("盖章材料获取失败");
+//            logger.error("盖章材料获取失败");
+            if (null != workInvoiceProjectRelationList){
+                List<String> list = new ArrayList<>();
+                for (int i=0;i<workInvoiceProjectRelationList.size();i++){
+                    list.add(workInvoiceProjectRelationList.get(i).getProjectId());
+                }
+                if (list.contains(sealApplyForInfo.getProjectId())){
+                    list.remove(sealApplyForInfo.getProjectId());
+                }
+                for (int i=0;i<list.size();i++){
+                    sealMaterialInfos = sealMaterialService.getSealMaterialByProjectId(list.get(i));
+                    if (null != sealMaterialInfos){
+                        break;
+                    }
+                }
+            }
+        }
+        if (null != workInvoiceProjectRelationList){
+            sealApplyForInfo.setWorkInvoiceProjectRelationList(workInvoiceProjectRelationList);
         }
         model.addAttribute("sealMaterialInfos",sealMaterialInfos);
         return "modules/sealApplyFor/sealApplyForView";
     }
 
+//    /**
+//     * 查看
+//     * @param sealApplyForInfo
+//     * @param model
+//     * @return
+//     */
+//    @RequiresPermissions(value={"sealApplyFor:sealApplyFor:view"})
+//    @RequestMapping(value = "view")
+//    public String view(SealApplyForInfo sealApplyForInfo, Model model) {
+//        model.addAttribute("sealApplyForInfo", sealApplyForInfo);
+//        List<SealMaterialInfo> sealMaterialInfos = sealMaterialService.getSealMaterialByProjectId(sealApplyForInfo.getProjectId());
+//        //根据盖章id获取所以的项目信息
+//        List<SealApplyForInfo> workInvoiceProjectRelationList = service.getByApplyId(sealApplyForInfo.getId());
+//        if(sealMaterialInfos.size()<=0){
+////            addMessage(redirectAttributes, "盖章申请已送审,无法暂存");
+////            return "redirect:"+ Global.getAdminPath()+"/sealApplyFor/sealApplyFor/?repage";
+//            logger.error("盖章材料获取失败");
+//        }
+//        if (null != workInvoiceProjectRelationList){
+//            sealApplyForInfo.setWorkInvoiceProjectRelationList(workInvoiceProjectRelationList);
+//        }
+//        model.addAttribute("sealMaterialInfos",sealMaterialInfos);
+//        return "modules/sealApplyFor/sealApplyForView";
+//    }
+
     /**
      * 暂存
      * @param sealApplyForInfo
@@ -270,13 +335,27 @@ public class SealApplyForController extends BaseController {
         }
         try {
             Map<String, Object> result = new HashMap<>();
-            if(null != sealApplyForInfo.getProjectRecords() || StringUtils.isNotBlank(sealApplyForInfo.getProjectRecords().getId())){
-                RuralProjectRecords projectRecords = projectRecordsService.get(sealApplyForInfo.getProjectRecords().getId());
-                sealApplyForInfo.setProjectRecords(projectRecords);
-            }
-            if(null == sealApplyForInfo.getProjectRecords() || StringUtils.isBlank(sealApplyForInfo.getProjectRecords().getReviewerPersonId())){
+//            if(null != sealApplyForInfo.getProjectRecords() || StringUtils.isNotBlank(sealApplyForInfo.getProjectRecords().getId())){
+//                RuralProjectRecords projectRecords = projectRecordsService.get(sealApplyForInfo.getProjectRecords().getId());
+//                sealApplyForInfo.setProjectRecords(projectRecords);
+//            }
+//            if(null == sealApplyForInfo.getProjectRecords() || StringUtils.isBlank(sealApplyForInfo.getProjectRecords().getReviewerPersonId())){
+//                addMessage(redirectAttributes, "未选择项目或该项目无审核人,无法申请盖章");
+//                return "redirect:"+Global.getAdminPath()+"/sealApplyFor/sealApplyFor/?repage";
+//            }
+            if(null == sealApplyForInfo.getWorkInvoiceProjectRelationList()){
                 addMessage(redirectAttributes, "未选择项目或该项目无审核人,无法申请盖章");
                 return "redirect:"+Global.getAdminPath()+"/sealApplyFor/sealApplyFor/?repage";
+            } else {
+                List<SealApplyForInfo> list = sealApplyForInfo.getWorkInvoiceProjectRelationList();
+                RuralProjectRecords projectRecords = projectRecordsService.get(list.get(0).getProjectId());
+                sealApplyForInfo.setProjectRecords(projectRecords);
+                for (int i=0;i<list.size();i++){
+                    if (StringUtils.isBlank(list.get(i).getProjectId())){
+                        addMessage(redirectAttributes, "未选择项目或该项目无审核人,无法申请盖章");
+                        return "redirect:"+Global.getAdminPath()+"/sealApplyFor/sealApplyFor/?repage";
+                    }
+                }
             }
             if (!sealApplyForInfo.getIsNewRecord()) {//编辑表单保存
                 SealApplyForInfo t = service.get(sealApplyForInfo.getId());//从数据库取出记录的值
@@ -335,6 +414,29 @@ public class SealApplyForController extends BaseController {
         return "redirect:"+Global.getAdminPath()+"/sealApplyFor/sealApplyFor/?repage";
     }
 
+    /**
+     * 获取项目编号
+     * @return
+     */
+    @RequestMapping(value = "getPNumber")
+    @ResponseBody
+    public String getPNumber() {
+        HashMap<Object, Object> map = Maps.newHashMap();
+        String obj = request.getParameter("obj");
+        RuralProjectRecords projectRecords = projectRecordsService.get(obj);
+        map.put("projectName",projectRecords.getProjectName());//项目名称
+        map.put("projectId",projectRecords.getId());//项目id
+        map.put("createByName",projectRecords.getCreateBy().getName());//创建人名称
+        map.put("createById",projectRecords.getCreateBy().getId());//创建人id
+        map.put("projectMasterName",projectRecords.getProjectMasterName());//项目负责人
+        map.put("projectMasterId",projectRecords.getProjectMasterId());//项目负责人
+        SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd");
+        map.put("startDate",format.format(projectRecords.getStartDate()));//工作开始日期
+        map.put("endingDate",format.format(projectRecords.getEndingDate()));//工作结束日期
+        map.put("reportDataNum",projectRecords.getProjectReportNumber());//报告号
+
+        return JsonMapper.toJsonString(map);
+    }
 
     /**
      * 报销list页面查询框
@@ -345,7 +447,19 @@ public class SealApplyForController extends BaseController {
         project.setProjectStatus(com.jeeplus.modules.projectrecord.enums.ProjectStatusEnum.SIGNED.getValue());//已签状态
         project.setLeaderNameStr(UserUtils.getUser().getName());
         project.setCreateBy(UserUtils.getUser());
+        //获取所有与盖章关联的项目报告号
+        List<String> reportNum = service.getAllReport();
         Page<ProjectRecords> page = service.ruralFindPageByReimbur(new Page<ProjectRecords>(request, response), project,"");
+        List<ProjectRecords> list = page.getList();
+        if (null != list){
+            for (int i=0;i<list.size();i++){
+                if (reportNum.contains(list.get(i).getReportData().getNumber())){
+                    list.remove(list.get(i));
+                }
+            }
+            page.setList(list);
+        }
+
         try {
             fieldLabels = URLDecoder.decode(fieldLabels, "UTF-8");
             fieldKeys = URLDecoder.decode(fieldKeys, "UTF-8");
@@ -384,7 +498,8 @@ public class SealApplyForController extends BaseController {
                 if (users==null ) {
                     users = Lists.newArrayList();
                     //查询总审人员信息(新增报告选择得总审人员)
-                    User zsUser = UserUtils.get(sealApplyForInfo.getProjectRecords().getReviewerPersonId());
+//                    User zsUser = UserUtils.get(sealApplyForInfo.getProjectRecords().getReviewerPersonId());
+                    User zsUser = UserUtils.get(sealApplyForInfo.getReviewerPersonId());
                     users.add(zsUser);
                 }
             }else if ("modifyApply".equals(taskDefKey)){
@@ -415,6 +530,8 @@ public class SealApplyForController extends BaseController {
     @RequiresPermissions(value={"sealApplyFor:sealApplyFor:edit"},logical= Logical.OR)
     @RequestMapping(value = "modify")
     public String modify(SealApplyForInfo sealApplyForInfo, Model model) {
+        //根据盖章id获取所以的项目信息
+        List<SealApplyForInfo> workInvoiceProjectRelationList = service.getByApplyId(sealApplyForInfo.getId());
         if(StringUtils.isNotBlank(sealApplyForInfo.getProjectId())){
             RuralProjectRecords projectRecords = projectRecordsService.get(sealApplyForInfo.getProjectId());
 
@@ -465,6 +582,9 @@ public class SealApplyForController extends BaseController {
             Act act = getByAct(sealApplyForInfo.getProcessInstanceId());
             sealApplyForInfo.setAct(act);
         }
+        if (null != workInvoiceProjectRelationList){
+            sealApplyForInfo.setWorkInvoiceProjectRelationList(workInvoiceProjectRelationList);
+        }
         //如果所属单位为空,则默认为赣能
         if(StringUtils.isBlank(sealApplyForInfo.getSealCompany())){
             sealApplyForInfo.setSealCompany("1");
@@ -528,6 +648,9 @@ public class SealApplyForController extends BaseController {
             addMessage(redirectAttributes, "盖章申请已登记完成,无法删除");
             return "redirect:"+Global.getAdminPath()+"/sealApplyFor/sealApplyFor/?repage";
         }
+        //删除项目与盖章关系表中的数据
+        //插入前先删除关联信息
+        service.deleteProjectInfo(sealApplyForInfo.getId());
         service.delete(sealApplyForInfo);
         addMessage(redirectAttributes, "删除盖章申请成功");
         return "redirect:" + Global.getAdminPath() + "/sealApplyFor/sealApplyFor/?repage";

+ 10 - 0
src/main/java/com/jeeplus/modules/sealMaterial/entity/SealMaterialInfo.java

@@ -13,6 +13,16 @@ import java.util.List;
  */
 public class SealMaterialInfo extends ActEntity<SealMaterialInfo> {
 
+    private String reportNumber;//项目报告号
+
+    public String getReportNumber() {
+        return reportNumber;
+    }
+
+    public void setReportNumber(String reportNumber) {
+        this.reportNumber = reportNumber;
+    }
+
     //用印材料名称
     private String sealMaterialName;
 

+ 14 - 4
src/main/java/com/jeeplus/modules/sealMaterial/entity/SealMaterialInfoImport.java

@@ -8,17 +8,27 @@ import java.util.Date;
 import java.util.List;
 
 public class SealMaterialInfoImport extends ActEntity<SealMaterialInfoImport> {
+    @ExcelField(title="项目报告号", align=2, sort=1)
+    private String reportNumber;//项目报告号
+
+    public String getReportNumber() {
+        return reportNumber;
+    }
+
+    public void setReportNumber(String reportNumber) {
+        this.reportNumber = reportNumber;
+    }
 
     //用印材料名称
-    @ExcelField(title="用印材料名称", align=2, sort=1)
+    @ExcelField(title="用印材料名称", align=2, sort=2)
     private String sealMaterialName;
 
     //    数量
-    @ExcelField(title="数量", align=2, sort=2)
+    @ExcelField(title="数量", align=2, sort=3)
     private Integer amount;
 
     //    主要内容简述
-    @ExcelField(title="主要内容简述", align=2, sort=3)
+    @ExcelField(title="主要内容简述", align=2, sort=4)
     private String mainContents;
 
     //    经办人
@@ -26,7 +36,7 @@ public class SealMaterialInfoImport extends ActEntity<SealMaterialInfoImport> {
 
     private String projectId; //项目id
 
-    @ExcelField(title="备注", align=2, sort=4)
+    @ExcelField(title="备注", align=2, sort=5)
     private String sealMaterialImportRemarks;
 
 //    用印时间

+ 1 - 1
src/main/java/com/jeeplus/modules/sealMaterial/service/SealMaterialService.java

@@ -85,7 +85,7 @@ public class SealMaterialService extends CrudService<SealMaterialDao,SealMateria
     }
 
     /**
-     * 根据项目id获取盖章材料
+     * 根据盖章id获取盖章材料
      */
     public List<SealMaterialInfo> getSealMaterialByProjectId(String projectId){
         return sealMaterialDao.getSealMaterialByProjectId(projectId);

+ 84 - 5
src/main/java/com/jeeplus/modules/sealMaterial/web/SealMaterialController.java

@@ -8,6 +8,8 @@ import com.jeeplus.common.utils.ThisLocalityDownloadUtil;
 import com.jeeplus.common.utils.excel.ExportExcel;
 import com.jeeplus.common.utils.excel.ImportExcel;
 import com.jeeplus.common.web.BaseController;
+import com.jeeplus.modules.sealApplyFor.entity.SealApplyForInfo;
+import com.jeeplus.modules.sealApplyFor.service.SealApplyForService;
 import com.jeeplus.modules.sealMaterial.entity.SealMaterialInfoExport;
 import com.jeeplus.modules.sealMaterial.entity.SealMaterialInfoImport;
 import com.jeeplus.modules.sealMaterial.service.SealMaterialService;
@@ -23,9 +25,7 @@ import org.springframework.web.servlet.mvc.support.RedirectAttributes;
 
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.List;
+import java.util.*;
 
 @Controller
 @RequestMapping(value = "${adminPath}/seal/sealMaterial")
@@ -34,6 +34,9 @@ public class SealMaterialController extends BaseController{
     @Autowired
     private SealMaterialService sealMaterialService;
 
+    @Autowired
+    private SealApplyForService applyForService;
+
     /**
      * 导入Excel数据
      */
@@ -46,13 +49,22 @@ public class SealMaterialController extends BaseController{
             List<SealMaterialInfoImport> list = ei.getDataList(SealMaterialInfoImport.class);
             List<SealMaterialInfoImport> listAll = new ArrayList<>();
 
+            //获取所有项目的报告号
+            List<String> proReportNumber = applyForService.getAllReportNumber();
             for (SealMaterialInfoImport sealMaterialInfoImport : list) {
                 sealMaterialInfoImport.setAgent(UserUtils.getUser());
-                if(StringUtils.isNotBlank(sealMaterialInfoImport.getSealMaterialName()) && null != sealMaterialInfoImport.getSealMaterialImportRemarks()  && null != sealMaterialInfoImport.getAgent() ){
+                if(StringUtils.isNotBlank(sealMaterialInfoImport.getSealMaterialName()) && null != sealMaterialInfoImport.getAmount()
+                        && null != sealMaterialInfoImport.getReportNumber() && null != sealMaterialInfoImport.getAgent() ){
                     listAll.add(sealMaterialInfoImport);
                 }
             }
-            responseEntity.setData(listAll);
+            List<SealMaterialInfoImport> testList = new ArrayList<>();
+            for (int i=0;i<listAll.size();i++){
+                if (proReportNumber.contains(listAll.get(i).getReportNumber())){
+                    testList.add(listAll.get(i));
+                }
+            }
+            responseEntity.setData(testList);
         } catch (Exception e) {
             logger.error("导入印章登记表失败!",e);
             responseEntity.setCode(400);
@@ -80,7 +92,36 @@ public class SealMaterialController extends BaseController{
         try {
             //添加查询类型
             String fileName = "盖章材料表"+ DateUtils.getDate("yyyyMMddHHmmss")+".xlsx";
+            //根据id查出所有与盖章关联的项目id
+            List<String> projectIdList = applyForService.getProjectIdById(sealMaterialInfoExport.getId());
+            if (projectIdList.contains(sealMaterialInfoExport.getProjectId())){
+                projectIdList.remove(sealMaterialInfoExport.getProjectId());
+            }
+            //根据项目id查询项目信息
+            String proName = "";
+            String reportNum = "";
+            for (int i=0;i<projectIdList.size();i++) {
+                SealApplyForInfo forInfo = applyForService.getProjectInfoByProId(projectIdList.get(i));
+                if (StringUtils.isBlank(proName)){
+                    proName = forInfo.getProjectName();
+                } else {
+                    proName = proName + "," + forInfo.getProjectName();
+                }
+                if (StringUtils.isBlank(reportNum)){
+                    reportNum = forInfo.getReportDataNum();
+                } else {
+                    reportNum = reportNum + "," + forInfo.getReportDataNum();
+                }
+
+            }
+
             List<SealMaterialInfoExport> list = sealMaterialService.findPageExport(new Page<SealMaterialInfoExport>(request, response, -1), sealMaterialInfoExport);
+            String finalProName = proName;
+            String finalReportNum = reportNum;
+            list.forEach(li->{
+                li.setProjectName(li.getProjectName() + "," + finalProName);
+                li.setProjectReportNum(li.getProjectReportNum() + "," + finalReportNum);
+            });
             new ExportExcel("盖章材料", SealMaterialInfoExport.class).setDataList(list).write(response, fileName).dispose();
             return null;
         } catch (Exception e) {
@@ -102,7 +143,45 @@ public class SealMaterialController extends BaseController{
             List<String> idList = Arrays.asList(listIds.split(","));
             //添加查询类型
             String fileName = "盖章材料表"+ DateUtils.getDate("yyyyMMddHHmmss")+".xlsx";
+
+            //根据id查出所有与盖章关联的项目的报告号
+            List<String> reportNum = new ArrayList<>();
+            for (int i=0;i<idList.size();i++){
+                List<String> projectIdById = applyForService.getReportNumById(idList.get(i));
+                reportNum.addAll(projectIdById);
+            }
+
+
             List<SealMaterialInfoExport> list = sealMaterialService.findPageExportAll(idList);
+            for (int i=0;i<list.size();i++){
+                //根据报告号去查与盖章关联的项目信息
+                String id = applyForService.getProjectInfoByReportNum(list.get(i).getProjectReportNum());
+                //根据id查其他关联的项目id
+                List<String> projectIdList = applyForService.getProjectIdById(id);
+                String proName = "";
+                String reportNumber = "";
+                for (int j=0;j<projectIdList.size();j++) {
+                    SealApplyForInfo forInfo = applyForService.getProjectInfoByProId(projectIdList.get(j));
+                    if (proName.equals("")){
+                        proName = forInfo.getProjectName();
+                    } else {
+                        proName += "," + forInfo.getProjectName();
+                    }
+                    if (StringUtils.isBlank(reportNumber)){
+                        reportNumber = forInfo.getReportDataNum();
+                    } else {
+                        reportNumber = reportNumber + "," + forInfo.getReportDataNum();
+                    }
+                }
+                list.get(i).setProjectName(proName);
+                list.get(i).setProjectReportNum(reportNumber);
+            }
+//            String finalProName = proName;
+//            String finalReportNum = reportNum;
+//            list.forEach(li->{
+//                li.setProjectName(li.getProjectName() + "," + finalProName);
+//                li.setProjectReportNum(li.getProjectReportNum() + "," + finalReportNum);
+//            });
             new ExportExcel("盖章材料", SealMaterialInfoExport.class).setDataList(list).write(response, fileName).dispose();
             return null;
         } catch (Exception e) {

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

@@ -5070,13 +5070,17 @@ public class WorkProjectNotifyController extends BaseController {
 
 					SealApplyForInfo sealApplyForInfo = sealApplyForService.get(workProjectNotify.getNotifyId());
 					List<SealMaterialInfo> sealMaterialInfos = sealMaterialService.getSealMaterialByProjectId(sealApplyForInfo.getProjectId());
-
+					//根据盖章id获取所以的项目信息
+					List<SealApplyForInfo> workInvoiceProjectRelationList = sealApplyForService.getByApplyId(sealApplyForInfo.getId());
 					User user = UserUtils.getUser();
 					SealMaterialInfo sealMaterialInfo = new SealMaterialInfo();
 					sealMaterialInfo.setAgent(user);
 					if(null != sealMaterialInfos){
 						sealMaterialInfo.setSealMaterialInfoList(sealMaterialInfos);
 					}
+					if (null != workInvoiceProjectRelationList){
+						sealApplyForInfo.setWorkInvoiceProjectRelationList(workInvoiceProjectRelationList);
+					}
 					model.addAttribute("sealMaterialInfo",sealMaterialInfo);
 
 					Act act = getByAct(sealApplyForInfo.getProcessInstanceId());

+ 16 - 1
src/main/resources/mappings/modules/ruralprojectrecords/RuralProjectRecordsDao.xml

@@ -3717,8 +3717,23 @@
 			</if>
 		</where>
 	</select>
+    <select id="getRuralProjectRecodes" resultType="com.jeeplus.modules.projectrecord.entity.ProjectRecords">
+		SELECT
+		<include refid="projectRecordsColumns"/>
+		,a.project_type as "projectType"
+		,su.name AS "createBy.name"
+		,o.top_company AS "office.name"
+		,ifnull(prd.number,'') as "reportData.number"
+		FROM rural_project_records a
+		<include refid="projectRecordsJoins"/>
+		LEFT JOIN sys_user su ON su.id = a.create_by
+		LEFT JOIN sys_office o ON o.id = a.office_id
+		left join project_report_data prd on a.id = prd.project_id
+		WHERE a.id = #{id}
+		limit 1
+	</select>
 
-	<update id="updateCaseBase">
+    <update id="updateCaseBase">
 		update case_base
 		    <set>
 				<if test="#{processInstanceId} != null and #{processInstanceId} != ''">

+ 74 - 8
src/main/resources/mappings/modules/sealApplyFor/SealApplyForDao.xml

@@ -1,7 +1,7 @@
 <?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.sealApplyFor.dao.SealApplyForDao">
-    
+
 	<sql id="sealApplyForColumnss">
 		DISTINCT a.id AS "id",
 		a.create_by AS "createBy.id",
@@ -104,18 +104,31 @@
 	</sql>
 
 	<sql id="projectJoin">
-		left join rural_project_records rpr on rpr.id = a.project_id
+		left join seal_apply_for_project_info safpi on a.id = safpi.id
+		left join rural_project_records rpr on rpr.id = safpi.project_id
 		left join project_report_data prd on prd.project_id = rpr.id
 		left join work_contract_info wci on wci.id = rpr.contract_id
 	</sql>
 
 	<select id="get" resultType="com.jeeplus.modules.sealApplyFor.entity.SealApplyForInfo" >
 		SELECT
-			<include refid="sealApplyForColumnss"/>
-			,
-			<include refid="projectColumnss"/>
+		DISTINCT a.id AS "id",
+		a.create_by AS "createBy.id",
+		(select name from sys_user user where user.id=a.create_by) AS "createBy.name",
+		a.create_date AS "createDate",
+		a.update_by AS "updateBy.id",
+		a.update_date AS "updateDate",
+		a.del_flag AS "delFlag",
+		a.company_id AS "company.id",
+		a.status As "status",
+		a.remarks As "remarks",
+		a.process_instance_id As "processInstanceId" ,
+		a.project_id As "projectId",
+		a.seal_company As "sealCompany"
+		/*,rpr.reviewer_person_id as "reviewerPersonId"*/
+<!--			<include refid="projectColumnss"/>-->
 		FROM seal_apply_for_info a
-		<include refid="sealApplyForJoin"/>
+<!--		<include refid="sealApplyForJoin"/>-->
 		<include refid="projectJoin"/>
 		WHERE a.id = #{id} and a.del_flag = 0
 	</select>
@@ -244,6 +257,9 @@
 			 #{office.id}
 				 )
 	</insert>
+	<insert id="insertIntoProjectInfo">
+		insert into seal_apply_for_project_info (id,project_id) values (#{id},#{projectId})
+	</insert>
 
 	<update id="update">
 		UPDATE seal_apply_for_info SET
@@ -339,7 +355,8 @@
 		LEFT JOIN sys_office s ON s.id = a.company_id
 		LEFT JOIN sys_office o ON o.id = a.office_id
 		LEFT JOIN project_report_data prd ON a.id = prd.project_id
-		left join seal_apply_for_info safi on a.id = safi.project_id
+		left join seal_apply_for_project_info safpi on a.id = safpi.project_id
+		left join seal_apply_for_info safi on safpi.id = safi.id
 		where a.status='5'  and a.del_flag='0' and safi.id is null
 		<if test="projectName != null and projectName != ''">
 			AND a.project_name like concat(concat('%',#{projectName}),'%')
@@ -370,6 +387,52 @@
 			</otherwise>
 		</choose>
 	</select>
+	<select id="getByApplyId" resultType="com.jeeplus.modules.sealApplyFor.entity.SealApplyForInfo">
+		SELECT
+		a.create_by AS "createById",
+		sap.project_id AS "projectId",
+		a.project_name AS "projectName",
+		DATE_FORMAT(a.start_date,'%Y-%m-%d') AS "startDate",
+		DATE_FORMAT(a.ending_date,'%Y-%m-%d') AS "endingDate"
+		,prd.number AS "reportDataNum"
+		,a.project_master_id as "projectMasterId"
+		,supmi.name as "projectMasterName"
+		,su.name as "createByName"
+		,sap.id as "id"
+        FROM rural_project_records a
+        LEFT JOIN sys_area area ON area.id = a.area_id
+        LEFT JOIN sys_user su ON su.id = a.create_by
+        LEFT JOIN sys_user supmi ON supmi.id = a.project_master_id
+		left join project_report_data prd on prd.project_id = a.id
+		LEFT JOIN rural_project_report_record prr on prd.id = prr.report_id
+		LEFT JOIN sys_office o ON o.id = a.office_id
+		left join seal_apply_for_project_info sap on a.id = sap.project_id
+		left join seal_apply_for_info sa on sap.id = sa.id
+
+		WHERE sa.id = #{id}
+	</select>
+	<select id="getAllReportNumber" resultType="java.lang.String">
+		select number from project_report_data where del_flag = 0
+	</select>
+	<select id="getProjectIdById" resultType="java.lang.String">
+		select project_id from seal_apply_for_project_info where id = #{id}
+	</select>
+	<select id="getProjectInfoByProId" resultType="com.jeeplus.modules.sealApplyFor.entity.SealApplyForInfo">
+		select name as "projectName",number as "reportDataNum" from project_report_data where project_id = #{projectId} and del_flag = 0
+	</select>
+	<select id="getAllReport" resultType="java.lang.String">
+		SELECT b.number FROM seal_apply_for_project_info a
+		LEFT JOIN project_report_data b on a.project_id = b.project_id WHERE b.del_flag = 0
+	</select>
+	<select id="getReportNumById" resultType="java.lang.String">
+		SELECT b.number FROM seal_apply_for_project_info a
+		LEFT JOIN project_report_data b on a.project_id = b.project_id WHERE a.id = #{id} and b.del_flag = 0
+	</select>
+	<select id="getProjectInfoByReportNum"
+			resultType="java.lang.String">
+		select a.id FROM seal_apply_for_project_info a LEFT JOIN project_report_data b
+		 on a.project_id = b.project_id where b.number = #{reportNum} and b.del_flag = 0
+	</select>
 
 
 	<!--物理删除-->
@@ -377,4 +440,7 @@
 		delete from seal_apply_for_info
 		WHERE id = #{id}
 	</delete>
-</mapper>
+	<delete id="deleteProjectInfo">
+		delete from seal_apply_for_project_info where id = #{id}
+	</delete>
+</mapper>

+ 6 - 3
src/main/resources/mappings/modules/sealMaterial/sealMaterialDao.xml

@@ -33,6 +33,7 @@
 		main_contents,
 		agent,
 		seal_contents_remarks,
+		report_number,
 		project_id)
 		values
 		<foreach collection="sealMaterialInfoImportList" item="data" separator=",">
@@ -49,6 +50,7 @@
 			#{data.mainContents},
 			#{data.agent.id},
 			#{data.sealMaterialImportRemarks},
+			#{data.reportNumber},
 			#{data.projectId})
 		</foreach>
 	</insert>
@@ -77,7 +79,8 @@
 		seal_contents_remarks as "sealMaterialImportRemarks",
 		su.name as "agent.name",
 		s.agent as "agent.id",
-		s.id as "id"
+		s.id as "id",
+		s.report_number as "reportNumber"
 		from seal_material_info s
 		left join rural_project_records r on s.project_id = r.id
 		left join sys_user u on r.project_master_id = u.id
@@ -119,7 +122,7 @@
 		left join rural_project_records rpr on rpr.id = s.project_id
 		left join project_report_data prd on rpr.id = prd.project_id
 		<where>
-			s.project_id in (select project_id from seal_apply_for_info where id in
+			s.project_id in (select project_id from seal_apply_for_project_info where id in
 				<foreach collection="idList" item="id" separator="," open="(" close=")">
 					#{id}
 				</foreach>
@@ -149,4 +152,4 @@
 	<update id="deleteByProjectId">
 		delete from seal_material_info where project_id = #{projectId}
 	</update>
-</mapper>
+</mapper>

+ 56 - 0
src/main/webapp/WEB-INF/tags/sys/gridselectcallproject2.tag

@@ -0,0 +1,56 @@
+<%@ 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="fieldLabels" type="java.lang.String" required="true" description="表格Th里显示的名字"%>
+<%@ attribute name="fieldKeys" type="java.lang.String" required="true" description="表格Td里显示的值"%>
+<%@ attribute name="searchLabel" type="java.lang.String" required="true" description="表格Td里显示的值"%>
+<%@ attribute name="searchKey" type="java.lang.String" required="true" description="表格Td里显示的值"%>
+<%@ attribute name="title" type="java.lang.String" required="true" description="选择框标题"%>
+<%@ attribute name="url" type="java.lang.String" required="true" 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="disabled" type="java.lang.String" required="false" description="是否限制选择,如果限制,设置为disabled"%>
+<script type="text/javascript">
+function searchGrid${id}(){
+
+	top.layer.open({
+	    type: 2,
+	    area: ['90%','90%'],
+	    title:"${title}",
+	    name:'friend',
+		skin:"two-btns",
+	    content: encodeURI("${url}?fieldLabels=${fieldLabels}&fieldKeys=${fieldKeys}&url=${url}&searchLabel=${searchLabel}&searchKey=${searchKey}"),
+	    btn: ['确定', '关闭'],
+	    yes: function(index, layero){
+	    	 var iframeWin = layero.find('iframe')[0].contentWindow; //得到iframe页的窗口对象,执行iframe页的方法:iframeWin.method();
+	    	 var item = iframeWin.getSelectedItem();
+
+	    	 if(item == "-1"){
+		    	 return;
+	    	 }
+			var idArray= new Array(); //定义一数组
+			idArray=item.split('_item_')[0].split(","); //字符分割
+			$("#${id}Id").val(idArray[0]);
+	    	 <%--$("#${id}Id").val(item.split('_item_')[0]);--%>
+	    	 <%--$("#${id}Name").val(item.split('_item_')[1]);--%>
+			 top.layer.close(index);//关闭对话框。
+             // setValue(item.split('_item_')[0]);
+			newSetPNumber(item.split('_item_')[0],'${id}');
+		  },
+		  cancel: function(index){
+	       }
+	});
+};
+</script>
+
+	<input id="${id}Id" name="${name}"  type="hidden" value="${value}"/>
+	<div class="input-group">
+		<input id="${id}Name"  name="${labelName }" onclick="searchGrid${id}()" ${allowInput?'':'readonly="readonly"'}  type="text" value="${labelValue}" data-msg-required="${dataMsgRequired}"
+		class="${cssClass}" style="${cssStyle}"/>
+
+    </div>
+	 <label id="${id}Name-error" class="error" for="${id}Name" style="display:none"></label>

+ 168 - 2
src/main/webapp/webpage/modules/sealApplyFor/sealApplyForAudit.jsp

@@ -87,6 +87,99 @@
                 }
             });
         });
+        function addRow2(list, idx, tpl, row){
+            var idx1 = $("#workInvoiceProjectRelationList tr").length;
+            if(idx1>0){
+                var count=0;
+                for (var i=1;i<=idx1;i++) {
+                    var delFlag = $("#workInvoiceProjectRelationList").find("tr").eq(i-1).find("input").eq(1).val();
+                    if (delFlag == "1") {
+                        count = i;
+                    }
+                }
+            }
+            if(list == '#workInvoiceProjectRelationList'){
+                bornTemplete1(list, idx, tpl, row, idx1);
+            }
+        }
+        function bornTemplete1(list, idx, tpl, row, idx1){
+            $(list).append(Mustache.render(tpl, {
+                idx: idx, delBtn: true, row: row,
+                order:idx1 + 1
+            }));
+            $(list+idx).find("select").each(function(){
+                $(this).val($(this).attr("data-value"));
+            });
+            $(list+idx).find("input[type='checkbox'], input[type='radio']").each(function(){
+                var ss = $(this).attr("data-value").split(',');
+                for (var i=0; i<ss.length; i++){
+                    if($(this).val() == ss[i]){
+                        $(this).attr("checked","checked");
+                    }
+                }
+            });
+        }
+        function newSetPNumber(obj,ids){
+            var idx=ids.split("_")[0]
+            var idArray= new Array(); //定义一数组
+            idArray=obj.split(","); //字符分割
+            console.log('idArray',idArray)
+
+            for (var k=0;k<idArray.length ;k++ )
+            {
+                $.ajax({
+                    async:false,
+                    type:'post',
+                    url:'${ctx}/sealApplyFor/sealApplyFor/getPNumber',
+                    data:{
+                        "obj":idArray[k]
+                    },
+                    success:function(data){
+                        if(k>=1){
+                            var row = workInvoiceProjectRelationListRowIdx;
+                            addRow2('#workInvoiceProjectRelationList', workInvoiceProjectRelationListRowIdx, workInvoiceProjectRelationListTpl, data[k])
+                            workInvoiceProjectRelationListRowIdx = workInvoiceProjectRelationListRowIdx + 1;
+                            var d = JSON.parse(data);
+                            var projectReportDataNumber="#workInvoiceProjectRelationList"+row+"_projectReportDataNumber";
+                            var projectName="#workInvoiceProjectRelationList"+row+"_projectIdName";
+                            var projectId="#workInvoiceProjectRelationList"+row+"_projectId";
+                            var createByName="#workInvoiceProjectRelationList"+row+"_createByName";
+                            var createById="#workInvoiceProjectRelationList"+row+"_createById";
+                            var projectMasterName="#workInvoiceProjectRelationList"+row+"_projectMasterName";
+                            var startDate="#workInvoiceProjectRelationList"+row+"_startDate";
+                            var endingDate="#workInvoiceProjectRelationList"+row+"_endingDate";
+                            $(projectMasterName).val(d.projectMasterName);
+                            $(startDate).val(d.startDate);
+                            $(endingDate).val(d.endingDate);
+                            $(projectName).val(d.projectName);
+                            $(createByName).val(d.createByName);
+                            $(createById).val(d.createById);
+                            $(projectId).val(d.projectId);
+                            $(projectReportDataNumber).val(d.reportDataNum);
+                        }else{
+                            var d = JSON.parse(data);
+                            var projectReportDataNumber="#"+idx+"_projectReportDataNumber";
+                            var projectName="#"+idx+"_projectIdName";
+                            var projectId="#"+idx+"_projectId";
+                            var createByName="#"+idx+"_createByName";
+                            var createById="#"+idx+"_createById";
+                            var projectMasterName="#"+idx+"_projectMasterName";
+                            var startDate="#"+idx+"_startDate";
+                            var endingDate="#"+idx+"_endingDate";
+                            $(projectMasterName).val(d.projectMasterName);
+                            $(startDate).val(d.startDate);
+                            $(endingDate).val(d.endingDate);
+                            $(projectName).val(d.projectName);
+                            console.log('d.projectId', d.id)
+                            $(projectId).val(d.projectId);
+                            $(createByName).val(d.createByName);
+                            $(createById).val(d.createById);
+                            $(projectReportDataNumber).val(d.reportDataNum);
+                        }
+                    }
+                })
+            }
+        }
     </script>
 </head>
 <body>
@@ -109,7 +202,7 @@
 
 
 
-            <div class="form-group layui-row first">
+            <%--<div class="form-group layui-row first">
                 <div class="form-group-label"><h2>项目基础信息</h2></div>
 
                 <div class="layui-item layui-col-sm6 lw6">
@@ -161,6 +254,75 @@
                         <input class="laydate-icondate form-control layui-input layer-date "  style="background-color: #f1f1f1" readonly="true" id="endingDate" name="endingDate" value="<fmt:formatDate value="${sealApplyForInfo.projectRecords.endingDate}" pattern="yyyy-MM-dd"/>">
                     </div>
                 </div>
+            </div>--%>
+            <div class="form-group layui-row">
+                <div class="form-group-label"><h2>项目基础信息</h2></div>
+                    <%--                <div class="layui-item nav-btns">--%>
+                    <%--                    <a class="nav-btn nav-btn-add" style="pointer-events: none" onclick="addRow2('#workInvoiceProjectRelationList', workInvoiceProjectRelationListRowIdx, workInvoiceProjectRelationListTpl);workInvoiceProjectRelationListRowIdx = workInvoiceProjectRelationListRowIdx + 1;" title="新增"><i class="fa fa-plus"></i>&nbsp;新增</a>--%>
+                    <%--                </div>--%>
+                <div class="layui-table-body layui-item layui-col-xs12 form-table-container"  style="padding:0px">
+                    <table id="contentTables2" class="table table-bordered table-condensed can-edit no-bottom-margin details">
+                        <thead>
+                        <tr>
+                            <th width="300px"><font color="red">*</font>项目名称</th>
+                            <th width="250px">报告号</th>
+                            <th width="80px">创建人</th>
+                            <th width="80px">项目负责人</th>
+                            <th width="150px">工作开始日期</th>
+                            <th width="150px">工作结束日期</th>
+                                <%--                            <th >操作</th>--%>
+                        </tr>
+                        </thead>
+                        <tbody id="workInvoiceProjectRelationList">
+                        </tbody>
+                    </table>
+                    <script type="text/template" id="workInvoiceProjectRelationListTpl">//<!--
+                    <tr id="workInvoiceProjectRelationList{{idx}}">
+                    <td class="hide">
+                            <input id="workInvoiceProjectRelationList{{idx}}_projectId" name="workInvoiceProjectRelationList[{{idx}}].projectId" type="hidden" value="{{row.projectId}}"/>
+							<input id="workInvoiceProjectRelationList{{idx}}_delFlag" name="workInvoiceProjectRelationList[{{idx}}].delFlag" type="hidden" value="0"/>
+							<input id="workInvoiceProjectRelationList{{idx}}_createById" name="workInvoiceProjectRelationList[{{idx}}].createById" type="hidden" value="{{row.createById}}"/>
+							<input id="workInvoiceProjectRelationList{{idx}}_projectMasterId" name="workInvoiceProjectRelationList[{{idx}}].projectMasterId" type="hidden" value="{{row.projectMasterId}}"/>
+                        </td>
+                        <td>
+                        <sys:gridselectcallproject2 url="${ctx}/sealApplyFor/sealApplyFor/selectprojectOnList" id="workInvoiceProjectRelationList{{idx}}_projectId" name="workInvoiceProjectRelationList{{idx}}.projectId"  value="{{row.projectId}}"  title="选择所属项目" labelName="workInvoiceProjectRelationList[{{idx}}].projectName" cssStyle="background-color:#fff"
+                                                       labelValue="{{row.projectName}}" cssClass="form-control required layui-input"  fieldLabels="项目" fieldKeys="projectName" searchLabel="项目名称" searchKey="projectName" ></sys:gridselectcallproject2>
+                        </td>
+                        <td style="text-align:center;">
+							<input id="workInvoiceProjectRelationList{{idx}}_projectReportDataNumber" name="workInvoiceProjectRelationList[{{idx}}].projectReportDataNumber" title="报告号" type="text" value="{{row.reportDataNum}}" readonly="readonly"  class="form-control"/>
+                        </td>
+                        <td>
+							<input id="workInvoiceProjectRelationList{{idx}}_createByName" title="创建人" name="workInvoiceProjectRelationList[{{idx}}].createByName" type="text" value="{{row.createByName}}" readonly="readonly"  class="form-control"/>
+                        </td>
+                        <td>
+							<input id="workInvoiceProjectRelationList{{idx}}_projectMasterName" title="项目负责人" name="workInvoiceProjectRelationList[{{idx}}].projectMasterName" type="text" value="{{row.projectMasterName}}" readonly="readonly"  class="form-control"/>
+                        </td>
+                        <td>
+							<input id="workInvoiceProjectRelationList{{idx}}_startDate" title="工作开始日期" name="workInvoiceProjectRelationList[{{idx}}].startDate" type="text" value="{{row.startDate}}" readonly="readonly"  class="form-control"/>
+                        </td>
+                        <td>
+							<input id="workInvoiceProjectRelationList{{idx}}_endingDate" title="工作结束日期" name="workInvoiceProjectRelationList[{{idx}}].endingDate" type="text" value="{{row.endingDate}}" readonly="readonly"  class="form-control"/>
+                        </td>
+                        <%--<td class="text-center op-td" >
+                            {{#delBtn}}<span class="op-btn op-btn-delete" onclick="delRow(this, '#workInvoiceProjectRelationList{{idx}}')" title="删除"><i class="glyphicon glyphicon-remove"></i>&nbsp;删除</span>{{/delBtn}}
+                        </td>--%>
+                    </tr>//-->
+                    </script>
+                    <script type="text/javascript">
+                        var workInvoiceProjectRelationListRowIdx = 0, workInvoiceProjectRelationListTpl = $("#workInvoiceProjectRelationListTpl").html().replace(/(\/\/\<!\-\-)|(\/\/\-\->)/g,"");
+                        /*if($("#id").val()){
+                            workInvoiceProjectRelationListRowIdx = ${fn:length(workInvoice.workInvoiceProjectRelationList)};
+						}*/
+                        $(document).ready(function() {
+                            var data = ${fns:toJson(sealApplyForInfo.workInvoiceProjectRelationList)};
+                            for (var i=0; i<data.length; i++){
+                                addRow2('#workInvoiceProjectRelationList', workInvoiceProjectRelationListRowIdx, workInvoiceProjectRelationListTpl, data[i])
+                                workInvoiceProjectRelationListRowIdx = workInvoiceProjectRelationListRowIdx + 1;
+                            }
+                        });
+                    </script>
+                </div>
+
             </div>
 
             <div class="form-group layui-row first">
@@ -185,13 +347,14 @@
                 <div class="form-group-label"><h2>盖章材料信息列表</h2></div>
                 <div class="layui-item layui-col-xs12 form-table-container" >
                     <div class="layui-item nav-btns">
-                        <a class="nav-btn nav-btn-export" title="导出"  onclick="return confirmx('确认要导出该盖章材料信息列表吗?', '${ctx}/seal/sealMaterial/export?projectId=${sealApplyForInfo.projectId}');"><i class="fa fa-file-excel-o"></i> 导出</a>
+                        <a class="nav-btn nav-btn-export" title="导出"  onclick="return confirmx('确认要导出该盖章材料信息列表吗?', '${ctx}/seal/sealMaterial/export?projectId=${sealApplyForInfo.projectId} + &id=${sealApplyForInfo.id}');"><i class="fa fa-file-excel-o"></i> 导出</a>
                     </div>
                     <div class="layui-table-body layui-item layui-col-xs12 form-table-container"  style="padding:0px">
                         <table id="contentTable1" class="table table-bordered table-condensed no-bottom-margin details">
                             <thead>
                             <tr>
                                 <th class="hide"></th>
+                                <th >报告号</th>
                                 <th >盖章材料名称</th>
                                 <th >份数</th>
                                 <th >主要内容简述</th>
@@ -202,6 +365,9 @@
                             <tbody id="workConstructionLinkmanList">
                             <c:forEach items="${sealMaterialInfos}" var="info" varStatus="index">
                                 <tr>
+                                    <td title="${info.reportNumber}">
+                                            ${info.reportNumber}
+                                    </td>
                                     <td>
                                             ${info.sealMaterialName}
                                     </td>

+ 543 - 0
src/main/webapp/webpage/modules/sealApplyFor/sealApplyForForm2.jsp

@@ -0,0 +1,543 @@
+<%@ 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" src="${ctxStatic}/helloweba_editable-select/jquery.editable-select.min.js"></script>
+    <script type="text/javascript" src="${ctxStatic}/iCheck/icheck.min.js"></script>
+    <script type="text/javascript" src="${ctxStatic}/layui/layuidown.js"></script>
+    <script src="${ctxStatic}/common/html/js/script.js"></script>
+    <link rel='stylesheet' type="text/css" href="${ctxStatic}/layui/layuidown.css"/>
+    <link rel='stylesheet' type="text/css" href="${ctxStatic}/helloweba_editable-select/jquery.editable-select.min.css"/>
+    <style>
+        #projectDesc-error{
+            left:0;
+            top:82px;
+        }
+        .layui-layer-dialog{
+            background: red;
+        }
+        td input{
+            margin-left:0px !important;
+            height: 42px !important;
+        }
+        .disables {
+            pointer-events: none;
+        }
+        .notDisables {
+            pointer-events: all;
+        }
+        .forbidden{
+             background-color:#c2c2c2;
+         }
+
+        .notForbidden{
+             background-color:#3ca2e0;
+         }
+        .spanzj{
+            color:red;
+            font-size: 12px;
+            padding-left: 10px;
+        }
+        #workInvoiceProjectRelationList td{
+            padding-left: 0px;
+            padding-right: 0px;
+        }
+    </style>
+    <script type="text/javascript">
+        var validateForm;
+        var isMasterClient = true;//是否是委托方
+        var clientCount = 0;
+        function doSubmit(i){//回调函数,在编辑和保存动作时,供openDialog调用提交表单。
+            if(validateForm.form()){
+
+                if(i==2){
+                    $("#inputForm").attr("action","${ctx}/sealApplyFor/sealApplyFor/tstore");
+                }else if(i==1){
+                    var size = $("#workInvoiceProjectRelationList tr").length;
+                    if(size < 1){
+                        parent.layer.msg("项目信息至少存在一条!", {icon: 5});
+                        return false;
+                    }
+                    var size2 = $("#sealMaterialInfoList tr").length;
+                    if(size2 < 1){
+                        parent.layer.msg("盖章文件至少存在一条!", {icon: 5});
+                        return false;
+                    }
+                    console.log('size2', size2)
+                    console.log('size', size)
+                    if (size<size2){
+                        parent.layer.msg("盖章文件数量不能大于项目信息数量!", {icon: 5});
+                        return false;
+                    }
+                    // var val = $("#workInvoiceProjectRelationList").find("tr").eq(0).find("input").eq(6).val();
+                    // console.log('val', val)
+                    // var delFlag = $("#workInvoiceProjectRelationList").find("tr").eq(0).find("input").eq(1).val();
+                    // console.log('delFlag', delFlag)
+                    // var val2 = $("#sealMaterialInfoList").find("tr").eq(0).find("input").eq(3).val();
+                    // console.log('val2', val2)
+                    var arr = [];
+                    for (var j=0;j<size2;j++){
+                        var val = $("#sealMaterialInfoList").find("tr").eq(j).find("input").eq(3).val();
+                        arr.push(val);
+                    }
+                    console.log('arr', arr)
+                    for (var i = 0; i < size; i++) {
+                        // var delFlag = $("#workInvoiceProjectRelationList").val()
+                        var val = $("#workInvoiceProjectRelationList").find("tr").eq(i).find("input").eq(6).val();
+                        if (arr.includes(val)){
+
+                        }else {
+                            parent.layer.msg("盖章文件的报告号必须与项目信息的报告号相同!", {icon: 5});
+                            return false;
+                        }
+                    }
+
+                }
+                $("#inputForm").submit();
+                return true;
+            }else{
+                parent.layer.msg("信息未填写完整!", {icon: 5});
+            }
+
+            return false;
+        }
+        $(document).ready(function() {
+            layui.use(['dropdown', 'util','form', 'layer'], function () {
+                var form = layui.form;
+                var dropdown = layui.dropdown
+                    ,util = layui.util
+                    ,layer = layui.layer
+                    ,$ = layui.jquery;
+            });
+            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);
+                    }
+                }
+            });
+        });
+
+        function setValue(obj){
+            if(location.href.includes("?")){
+                $("#upTable").load(location.href+"&projectId="+obj + " #upTable");
+            }else{
+                $("#upTable").load(location.href+"?projectId="+obj + " #upTable");
+            }
+        }
+
+        function genRow(data) {
+            for (var i = 0; i < data.length; i++) {
+                addRow1('#sealMaterialInfoList', sealMaterialInfoListRowIdx, sealMaterialInfoListTpl, data[i])
+            }
+        }
+
+        function addRow1(list, idx, tpl, row){
+            var idx1 = $("#sealMaterialInfoList tr").length;
+            if(list == '#sealMaterialInfoList'){
+                bornTemplete1(list, idx, tpl, row, idx1);
+                sealMaterialInfoListRowIdx+=1;
+            }
+        }
+        function addRow2(list, idx, tpl, row){
+            var idx1 = $("#workInvoiceProjectRelationList tr").length;
+            if(idx1>0){
+                var count=0;
+                for (var i=1;i<=idx1;i++) {
+                    var delFlag = $("#workInvoiceProjectRelationList").find("tr").eq(i-1).find("input").eq(1).val();
+                    if (delFlag == "1") {
+                        count = i;
+                    }
+                }
+                // if (idx1>1){
+                //     for (var i = 0; i <= idx1; i++) {
+                //         // var delFlag = $("#workInvoiceProjectRelationList").val()
+                //         var val = $("#workInvoiceProjectRelationList").find("tr").eq(i).find("input").eq(6).val();
+                //         for (var j = i+1; j <= idx1; j++) {
+                //             // var delFlag = $("#workInvoiceProjectRelationList").val()
+                //             var val2 = $("#workInvoiceProjectRelationList").find("tr").eq(j).find("input").eq(6).val();
+                //             if (val === val2){
+                //
+                //             }
+                //         }
+                //     }
+                // }
+
+            }
+            if(list == '#workInvoiceProjectRelationList'){
+                bornTemplete1(list, idx, tpl, row, idx1);
+            }
+        }
+
+        function bornTemplete1(list, idx, tpl, row, idx1){
+            $(list).append(Mustache.render(tpl, {
+                idx: idx, delBtn: true, row: row,
+                order:idx1 + 1
+            }));
+            $(list+idx).find("select").each(function(){
+                $(this).val($(this).attr("data-value"));
+            });
+            $(list+idx).find("input[type='checkbox'], input[type='radio']").each(function(){
+                var ss = $(this).attr("data-value").split(',');
+                for (var i=0; i<ss.length; i++){
+                    if($(this).val() == ss[i]){
+                        $(this).attr("checked","checked");
+                    }
+                }
+            });
+        }
+        function delRow(obj, prefix) {
+            var id = $(prefix + "_invoiceId");
+            var delFlag = $(prefix + "_delFlag");
+            if (id.val() == "") {
+                $(obj).parent().parent().remove();
+            } else if (delFlag.val() == "0") {
+                delFlag.val("1");
+                $(obj).html("&divide;").attr("title", "撤回删除");
+                $(obj).parent().parent().addClass("error");
+                $(obj).parent().parent().addClass("hide");
+            } else if (delFlag.val() == "1") {
+                delFlag.val("0");
+                $(obj).html("&times;").attr("title", "删除");
+                $(obj).parent().parent().removeClass("error");
+            }
+            var length=$("#projectMaterialStorageList tr").length;
+            var count=length;
+            for (var i=1;i<=length;i++) {
+                var delFlag = $("#projectMaterialStorageList").find("tr").eq(i-1).find("input").eq(1).val();
+                if (delFlag == "1") {
+                    count =count-1;
+                }
+            }
+            if(count==1){
+                $("#chargeType").val("2")
+                layui.form.render();
+            }else if (count>1){
+                $("#chargeType").val("1")
+                layui.form.render();
+            }else if(count == 0){
+                $("#projectFlag").val("");
+            }
+        }
+        function delRow2(obj, prefix) {
+            var id = $(prefix + "_invoiceId");
+            var delFlag = $(prefix + "_delFlag");
+            if (id.val() == "") {
+                $(obj).parent().parent().remove();
+            } else if (delFlag.val() == "0") {
+                delFlag.val("1");
+                $(obj).html("&divide;").attr("title", "撤回删除");
+                $(obj).parent().parent().addClass("error");
+                $(obj).parent().parent().addClass("hide");
+            } else if (delFlag.val() == "1") {
+                delFlag.val("0");
+                $(obj).html("&times;").attr("title", "删除");
+                $(obj).parent().parent().removeClass("error");
+            }
+            var length=$("#workInvoiceProjectRelationList tr").length;
+            var count=length;
+            for (var i=1;i<=length;i++) {
+                var delFlag = $("#workInvoiceProjectRelationList").find("tr").eq(i-1).find("input").eq(1).val();
+                if (delFlag == "1") {
+                    count =count-1;
+                }
+            }
+        }
+        function num(obj){
+            obj.value = obj.value.replace(/[^\d]/g,""); //清除"数字"以外的字符
+        }
+
+        function newSetPNumber(obj,ids){
+            var idx=ids.split("_")[0]
+            var idArray= new Array(); //定义一数组
+            idArray=obj.split(","); //字符分割
+            console.log('idArray',idArray)
+
+            for (var k=0;k<idArray.length ;k++ )
+            {
+                $.ajax({
+                    async:false,
+                    type:'post',
+                    url:'${ctx}/sealApplyFor/sealApplyFor/getPNumber',
+                    data:{
+                        "obj":idArray[k]
+                    },
+                    success:function(data){
+                        if(k>=1){
+                            var row = workInvoiceProjectRelationListRowIdx;
+                            addRow2('#workInvoiceProjectRelationList', workInvoiceProjectRelationListRowIdx, workInvoiceProjectRelationListTpl, data[k])
+                            workInvoiceProjectRelationListRowIdx = workInvoiceProjectRelationListRowIdx + 1;
+                            var d = JSON.parse(data);
+                            var projectReportDataNumber="#workInvoiceProjectRelationList"+row+"_projectReportDataNumber";
+                            var projectName="#workInvoiceProjectRelationList"+row+"_projectIdName";
+                            var projectId="#workInvoiceProjectRelationList"+row+"_projectId";
+                            var createByName="#workInvoiceProjectRelationList"+row+"_createByName";
+                            var createById="#workInvoiceProjectRelationList"+row+"_createById";
+                            var projectMasterName="#workInvoiceProjectRelationList"+row+"_projectMasterName";
+                            var startDate="#workInvoiceProjectRelationList"+row+"_startDate";
+                            var endingDate="#workInvoiceProjectRelationList"+row+"_endingDate";
+                            $(projectMasterName).val(d.projectMasterName);
+                            $(startDate).val(d.startDate);
+                            $(endingDate).val(d.endingDate);
+                            $(projectName).val(d.projectName);
+                            $(createByName).val(d.createByName);
+                            $(createById).val(d.createById);
+                            $(projectId).val(d.projectId);
+                            $(projectReportDataNumber).val(d.reportDataNum);
+                        }else{
+                            var d = JSON.parse(data);
+                            var projectReportDataNumber="#"+idx+"_projectReportDataNumber";
+                            var projectName="#"+idx+"_projectIdName";
+                            var projectId="#"+idx+"_projectId";
+                            var createByName="#"+idx+"_createByName";
+                            var createById="#"+idx+"_createById";
+                            var projectMasterName="#"+idx+"_projectMasterName";
+                            var startDate="#"+idx+"_startDate";
+                            var endingDate="#"+idx+"_endingDate";
+                            $(projectMasterName).val(d.projectMasterName);
+                            $(startDate).val(d.startDate);
+                            $(endingDate).val(d.endingDate);
+                            $(projectName).val(d.projectName);
+                            console.log('d.projectId', d.id)
+                            $(projectId).val(d.projectId);
+                            $(createByName).val(d.createByName);
+                            $(createById).val(d.createById);
+                            $(projectReportDataNumber).val(d.reportDataNum);
+                        }
+                    }
+                })
+            }
+        }
+
+    </script>
+</head>
+<body>
+<div class="single-form">
+    <div class="container">
+        <sys:message content="${message}"/>
+        <form:form id="inputForm" modelAttribute="sealApplyForInfo" action="${ctx}/sealApplyFor/sealApplyFor/save" method="post" class="form-horizontal layui-form">
+            <form:hidden path="id"/>
+            <input type="hidden" id="flagFile" value="">
+
+            <%--<div  id="upTable" class="form-group layui-row first">
+                <div class="form-group layui-row first">
+                    <div class="form-group-label"><h2>项目基础信息</h2></div>
+                    <div class="layui-item layui-col-sm6 lw6">
+                        <label class="layui-form-label"><span class="require-item">*</span>项目名称:</label>
+                        <div class="layui-input-block with-icon">
+                            <sys:gridselectcallproject url="${ctx}/sealApplyFor/sealApplyFor/selectprojectOnList" id="projectRecords" name="projectRecords.id"  value="${sealApplyForInfo.projectRecords.id}"  title="选择所属项目" labelName="projectRecords.projectName" cssStyle="background-color:#fff"
+                                                       labelValue="${sealApplyForInfo.projectRecords.projectName}" cssClass="form-control required layui-input"  fieldLabels="项目" fieldKeys="projectName" searchLabel="项目名称" searchKey="projectName" ></sys:gridselectcallproject>
+                        </div>
+                    </div>
+
+                    <div class="layui-item layui-col-sm6 lw6">
+                        <label class="layui-form-label">报告号:</label>
+                        <div class="layui-input-block">
+                            <input id="projectReportDataNumber" htmlEscape="false"  readonly="true" class="form-control layui-input" style="background-color: #f1f1f1" value="${sealApplyForInfo.projectRecords.projectReportNumber}"/>
+                        </div>
+                    </div>
+                    <div class="layui-item layui-col-sm6 lw6">
+                        <label class="layui-form-label">项目所在地:</label>
+                        <div class="layui-input-block">
+                            <input id="area" htmlEscape="false" style="background-color: #f1f1f1" readonly="true" class="form-control layui-input" value="${sealApplyForInfo.projectRecords.province}-${sealApplyForInfo.projectRecords.city}-${sealApplyForInfo.projectRecords.county}"/>
+                        </div>
+                    </div>
+                    <div class="layui-item layui-col-sm6 lw6">
+                        <label class="layui-form-label">创建人:</label>
+                        <div class="layui-input-block">
+                            <input htmlEscape="false" style="background-color: #f1f1f1" readonly="true" class="form-control layui-input" value="${sealApplyForInfo.projectRecords.createBy.name}"/>
+                        </div>
+                    </div>
+                    <div class="layui-item layui-col-sm6 lw6">
+                        <label class="layui-form-label">盖章审核人:</label>
+                        <div class="layui-input-block">
+                            <input htmlEscape="false" style="background-color: #f1f1f1" readonly="true" class="form-control layui-input" value="${sealApplyForInfo.projectRecords.reviewerPerson}"/>
+                        </div>
+                    </div>
+                    <div class="layui-item layui-col-sm6 lw6">
+                        <label class="layui-form-label">项目负责人:</label>
+                        <div class="layui-input-block">
+                            <input htmlEscape="false" style="background-color: #f1f1f1" readonly="true" class="form-control layui-input" value="${sealApplyForInfo.projectRecords.projectMasterName}"/>
+                        </div>
+                    </div>
+                    <div class="layui-item layui-col-sm6 lw6">
+                        <label class="layui-form-label double-line">工作开始日期:</label>
+                        <div class="layui-input-block">
+                            <input class="laydate-icondate form-control layui-input layer-date ash"  style="background-color: #f1f1f1" readonly="true" id="startDate" name="startDate" value="<fmt:formatDate value="${sealApplyForInfo.projectRecords.startDate}" pattern="yyyy-MM-dd"/>">
+                        </div>
+                    </div>
+                    <div class="layui-item layui-col-sm6 lw6">
+                        <label class="layui-form-label double-line">工作结束日期:</label>
+                        <div class="layui-input-block">
+                            <input class="laydate-icondate form-control layui-input layer-date "  style="background-color: #f1f1f1" readonly="true" id="endingDate" name="endingDate" value="<fmt:formatDate value="${sealApplyForInfo.projectRecords.endingDate}" pattern="yyyy-MM-dd"/>">
+                        </div>
+                    </div>
+                </div>
+            </div>--%>
+            <div class="form-group layui-row">
+                <div class="form-group-label"><h2>项目基础信息</h2></div>
+                <div class="layui-item nav-btns">
+                    <a class="nav-btn nav-btn-add" onclick="addRow2('#workInvoiceProjectRelationList', workInvoiceProjectRelationListRowIdx, workInvoiceProjectRelationListTpl);workInvoiceProjectRelationListRowIdx = workInvoiceProjectRelationListRowIdx + 1;" title="新增"><i class="fa fa-plus"></i>&nbsp;新增</a>
+                </div>
+                <div class="layui-table-body layui-item layui-col-xs12 form-table-container"  style="padding:0px">
+                    <table id="contentTables2" class="table table-bordered table-condensed can-edit no-bottom-margin details">
+                        <thead>
+                        <tr>
+                            <th width="300px"><font color="red">*</font>项目名称</th>
+                            <th width="250px">报告号</th>
+                            <th width="80px">创建人</th>
+                            <th width="80px">项目负责人</th>
+                            <th width="150px">工作开始日期</th>
+                            <th width="150px">工作结束日期</th>
+                            <th >操作</th>
+                        </tr>
+                        </thead>
+                        <tbody id="workInvoiceProjectRelationList">
+                        </tbody>
+                    </table>
+                    <script type="text/template" id="workInvoiceProjectRelationListTpl">//<!--
+                    <tr id="workInvoiceProjectRelationList{{idx}}">
+                        <td class="hide">
+                            <input id="workInvoiceProjectRelationList{{idx}}_projectId" name="workInvoiceProjectRelationList[{{idx}}].projectId" type="hidden" value="{{row.projectId}}"/>
+							<input id="workInvoiceProjectRelationList{{idx}}_delFlag" name="workInvoiceProjectRelationList[{{idx}}].delFlag" type="hidden" value="0"/>
+							<input id="workInvoiceProjectRelationList{{idx}}_createById" name="workInvoiceProjectRelationList[{{idx}}].createById" type="hidden" value="{{row.createById}}"/>
+							<input id="workInvoiceProjectRelationList{{idx}}_projectMasterId" name="workInvoiceProjectRelationList[{{idx}}].projectMasterId" type="hidden" value="{{row.projectMasterId}}"/>
+                        </td>
+                        <td>
+                        <sys:gridselectcallproject2 url="${ctx}/sealApplyFor/sealApplyFor/selectprojectOnList" id="workInvoiceProjectRelationList{{idx}}_projectId" name="workInvoiceProjectRelationList{{idx}}.projectId"  value="{{row.projectId}}"  title="选择所属项目" labelName="workInvoiceProjectRelationList[{{idx}}].projectName" cssStyle="background-color:#fff"
+                                                       labelValue="{{row.projectName}}" cssClass="form-control required layui-input"  fieldLabels="项目" fieldKeys="projectName" searchLabel="项目名称" searchKey="projectName" ></sys:gridselectcallproject2>
+                        </td>
+                        <td style="text-align:center;">
+							<input id="workInvoiceProjectRelationList{{idx}}_projectReportDataNumber" name="workInvoiceProjectRelationList[{{idx}}].projectReportDataNumber" title="报告号" type="text" value="{{row.reportDataNum}}" readonly="readonly"  class="form-control"/>
+                        </td>
+                        <td>
+							<input id="workInvoiceProjectRelationList{{idx}}_createByName" title="创建人" name="workInvoiceProjectRelationList[{{idx}}].createByName" type="text" value="{{row.createByName}}" readonly="readonly"  class="form-control"/>
+                        </td>
+                        <td>
+							<input id="workInvoiceProjectRelationList{{idx}}_projectMasterName" title="项目负责人" name="workInvoiceProjectRelationList[{{idx}}].projectMasterName" type="text" value="{{row.projectMasterName}}" readonly="readonly"  class="form-control"/>
+                        </td>
+                        <td>
+							<input id="workInvoiceProjectRelationList{{idx}}_startDate" title="工作开始日期" name="workInvoiceProjectRelationList[{{idx}}].startDate" type="text" value="{{row.startDate}}" readonly="readonly"  class="form-control"/>
+                        </td>
+                        <td>
+							<input id="workInvoiceProjectRelationList{{idx}}_endingDate" title="工作结束日期" name="workInvoiceProjectRelationList[{{idx}}].endingDate" type="text" value="{{row.endingDate}}" readonly="readonly"  class="form-control"/>
+                        </td>
+                        <td class="text-center op-td" >
+                            {{#delBtn}}<span class="op-btn op-btn-delete" onclick="delRow2(this, '#workInvoiceProjectRelationList{{idx}}')" title="删除"><i class="glyphicon glyphicon-remove"></i>&nbsp;删除</span>{{/delBtn}}
+                        </td>
+                    </tr>//-->
+                    </script>
+                    <script type="text/javascript">
+                        var workInvoiceProjectRelationListRowIdx = 0, workInvoiceProjectRelationListTpl = $("#workInvoiceProjectRelationListTpl").html().replace(/(\/\/\<!\-\-)|(\/\/\-\->)/g,"");
+                        /*if($("#id").val()){
+                            workInvoiceProjectRelationListRowIdx = ${fn:length(workInvoice.workInvoiceProjectRelationList)};
+						}*/
+                        $(document).ready(function() {
+                            var data = ${fns:toJson(sealApplyForInfo.workInvoiceProjectRelationList)};
+                            for (var i=0; i<data.length; i++){
+                                addRow2('#workInvoiceProjectRelationList', workInvoiceProjectRelationListRowIdx, workInvoiceProjectRelationListTpl, data[i])
+                                workInvoiceProjectRelationListRowIdx = workInvoiceProjectRelationListRowIdx + 1;
+                            }
+                        });
+                    </script>
+                </div>
+
+            </div>
+
+        <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"><span class="require-item">*</span>单位:</label>
+                    <div class="layui-input-block">
+                        <input type="radio" name="sealCompany" value="0" title="东兴" <c:if test="${sealApplyForInfo.sealCompany=='0'}">checked</c:if>>
+                        <input type="radio" name="sealCompany" value="1" title="赣能" <c:if test="${sealApplyForInfo.sealCompany=='1'}">checked</c:if>>
+                        <input type="radio" name="sealCompany" value="2" title="一达" <c:if test="${sealApplyForInfo.sealCompany=='2'}">checked</c:if>>
+                    </div>
+                </div>
+                <div class="layui-item layui-col-sm6 lw6 with-textarea">
+                    <label class="layui-form-label ">盖章说明:</label>
+                    <div class="layui-input-block">
+                        <form:textarea path="remarks" placeholder="请输入盖章说明信息" id="remarks" htmlEscape="false" rows="4"  maxlength="255"  class="form-control "/>
+                    </div>
+                </div>
+
+                <div class="form-group layui-row">
+                    <div class="layui-item nav-btns">
+                    <a class="nav-btn nav-btn-add" onclick="addRow1('#sealMaterialInfoList', sealMaterialInfoListRowIdx, sealMaterialInfoListTpl);sealMaterialInfoListRowIdx = sealMaterialInfoListRowIdx + 1;" title="新增"><i class="fa fa-plus"></i>&nbsp;新增</a>
+                    <table:importExcelA url="${ctx}/seal/sealMaterial/import"></table:importExcelA><!-- 导入按钮 -->
+                </div>
+                    <div class="layui-table-body layui-item layui-col-xs12 form-table-container"  style="padding:0px">
+                        <table id="contentTables" class="table table-bordered table-condensed can-edit no-bottom-margin details">
+                            <thead>
+                            <tr>
+                                <th width="10%"><font color="red" >*</font>报告号</th>
+                                <th width="10%"><font color="red" >*</font>盖章材料名称</th>
+                                <th width="10%"><font color="red">*</font>份数</th>
+                                <th width="40%">主要内容简述</th>
+                                <th width="10%">经办人</th>
+                                <th width="10%">备注</th>
+                                <th width="10%">操作</th>
+                            </tr>
+                            </thead>
+                            <tbody id="sealMaterialInfoList">
+                            </tbody>
+                        </table>
+                        <script type="text/template" id="sealMaterialInfoListTpl">//<!--
+                    <tr id="sealMaterialInfoList{{idx}}">
+                      <td class="hide" >
+							<input id="sealMaterialInfoList{{idx}}_projectId" name="sealMaterialInfoList[{{idx}}].projectId" type="hidden" value="{{row.projectId}}"/>
+							<input id="sealMaterialInfoList{{idx}}_delFlag" name="sealMaterialInfoList[{{idx}}].delFlag" type="hidden" value="0"/>
+							<input id="sealMaterialInfoList{{idx}}_id" name="sealMaterialInfoList[{{idx}}].id" type="hidden" value="{{row.id}}"/>
+                        </td>
+                        <td style="padding:0px">
+							<input id="sealMaterialInfoList{{idx}}_reportNumber" name = "sealMaterialInfoList[{{idx}}].reportNumber"  type="text" value="{{row.reportNumber}}"  class="form-control" style="padding:0px;margin-left:0px;text-align:center;" required/>
+                        </td>
+                        <td style="padding:0px">
+							<input id="sealMaterialInfoList{{idx}}_sealMaterialName" name = "sealMaterialInfoList[{{idx}}].sealMaterialName"  type="text" value="{{row.sealMaterialName}}"  class="form-control" style="padding:0px;margin-left:0px;text-align:center;" required/>
+                        </td>
+                        <td style="padding:0px">
+							<input id="sealMaterialInfoList{{idx}}_amount" name = "sealMaterialInfoList[{{idx}}].amount"   type="text" value="{{row.amount}}"   onkeyup="num(this)" class="form-control" style="padding:0px;margin-left:0px;text-align:center;" required/>
+                        </td>
+                        <td style="padding:0px">
+							<input id="sealMaterialInfoList{{idx}}_mainContents" name = "sealMaterialInfoList[{{idx}}].mainContents"  type="text" value="{{row.mainContents}}"  class="form-control" style="padding:0px;margin-left:0px;text-align:center;"/>
+                        </td>
+                        <td style="padding:0px">
+							<input id="sealMaterialInfoList{{idx}}_agent" name = "sealMaterialInfoList[{{idx}}].agent.name"  type="text" value="${sealMaterialInfo.agent.name}"  class="form-control" style="padding:0px;margin-left:0px;text-align:center;" readonly="true"/>
+                        </td>
+                         <td style="padding:0px">
+							<input id="sealMaterialInfoList{{idx}}sealMaterialImportRemarks" name = "sealMaterialInfoList[{{idx}}].sealMaterialImportRemarks"  type="text" value="{{row.sealMaterialImportRemarks}}"  class="form-control" style="padding:0px;margin-left:0px;text-align:center;"/>
+                        </td>
+                         <td class="text-center op-td" style="padding:0px">
+                            {{#delBtn}}<span class="op-btn op-btn-delete" onclick="delRow(this, '#sealMaterialInfoList{{idx}}')" title="删除"><i class="glyphicon glyphicon-remove" style="padding:0px;margin-left:0px;text-align:center;"></i>&nbsp;删除</span>{{/delBtn}}
+                        </td>
+                    </tr>//-->
+                        </script>
+                        <script type="text/javascript">
+                            var sealMaterialInfoListRowIdx = 0, sealMaterialInfoListTpl = $("#sealMaterialInfoListTpl").html().replace(/(\/\/\<!\-\-)|(\/\/\-\->)/g,"");
+                            $(document).ready(function() {
+                                var data = ${fns:toJson(sealMaterialInfo.sealMaterialInfoList)};
+                                for (var i=0; i<data.length; i++){
+                                    addRow1('#sealMaterialInfoList', sealMaterialInfoListRowIdx, sealMaterialInfoListTpl, data[i])
+                                }
+                            });
+                        </script>
+                    </div>
+                </div>
+
+        </div>
+            <div class="form-group layui-row page-end"></div>
+        </form:form>
+    </div>
+</div>
+</body>
+</html>

+ 6 - 3
src/main/webapp/webpage/modules/sealApplyFor/sealApplyForList.jsp

@@ -266,9 +266,12 @@
             ,cols: [[
 				{checkbox: true, fixed: true},
                 {field:'index',align:'center', title: '序号',width:55}
-                ,{field:'projName',align:'center', title: '项目名称',minWidth:250,templet:function(d){
-						return "<a class=\"attention-info\" title=\"" + d.projName + "\" href=\"javascript:void(0);\" onclick=\"openDialogView('查看信息', '${ctx}/sealApplyFor/sealApplyFor/view?id=" + d.id +"','95%', '95%')\">" + d.projName + "</a>";
-                    }}
+                <%--,{field:'projName',align:'center', title: '项目名称',minWidth:250,templet:function(d){--%>
+				<%--		return "<a class=\"attention-info\" title=\"" + d.projName + "\" href=\"javascript:void(0);\" onclick=\"openDialogView('查看信息', '${ctx}/sealApplyFor/sealApplyFor/view?id=" + d.id +"','95%', '95%')\">" + d.projName + "</a>";--%>
+                <%--    }}--%>
+				,{field:'projName',align:'center', title: '项目名称',minWidth:250,templet:function(d){
+						return "<a class=\"attention-info\" title=\"" + d.projName + "\" href=\"javascript:void(0);\" onclick=\"openDialogView('查看项目信息', '${ctx}/sealApplyFor/sealApplyFor/projectview?id=" + d.id +"','95%', '95%')\">" + d.projName + "</a>";
+					}}
 				/*,{field:'projId',align:'center', title: '项目编号',  width:180}*/
 				,{field: 'projectReportNumber', align:'center', title: '报告号',width:220,templet: function(d){
 						if(""!= d.projectReportNumber){

+ 168 - 3
src/main/webapp/webpage/modules/sealApplyFor/sealApplyForModify.jsp

@@ -163,6 +163,99 @@
         function num(obj){
             obj.value = obj.value.replace(/[^\d]/g,""); //清除"数字"以外的字符
         }
+        function addRow2(list, idx, tpl, row){
+            var idx1 = $("#workInvoiceProjectRelationList tr").length;
+            if(idx1>0){
+                var count=0;
+                for (var i=1;i<=idx1;i++) {
+                    var delFlag = $("#workInvoiceProjectRelationList").find("tr").eq(i-1).find("input").eq(1).val();
+                    if (delFlag == "1") {
+                        count = i;
+                    }
+                }
+            }
+            if(list == '#workInvoiceProjectRelationList'){
+                bornTemplete1(list, idx, tpl, row, idx1);
+            }
+        }
+        function bornTemplete1(list, idx, tpl, row, idx1){
+            $(list).append(Mustache.render(tpl, {
+                idx: idx, delBtn: true, row: row,
+                order:idx1 + 1
+            }));
+            $(list+idx).find("select").each(function(){
+                $(this).val($(this).attr("data-value"));
+            });
+            $(list+idx).find("input[type='checkbox'], input[type='radio']").each(function(){
+                var ss = $(this).attr("data-value").split(',');
+                for (var i=0; i<ss.length; i++){
+                    if($(this).val() == ss[i]){
+                        $(this).attr("checked","checked");
+                    }
+                }
+            });
+        }
+        function newSetPNumber(obj,ids){
+            var idx=ids.split("_")[0]
+            var idArray= new Array(); //定义一数组
+            idArray=obj.split(","); //字符分割
+            console.log('idArray',idArray)
+
+            for (var k=0;k<idArray.length ;k++ )
+            {
+                $.ajax({
+                    async:false,
+                    type:'post',
+                    url:'${ctx}/sealApplyFor/sealApplyFor/getPNumber',
+                    data:{
+                        "obj":idArray[k]
+                    },
+                    success:function(data){
+                        if(k>=1){
+                            var row = workInvoiceProjectRelationListRowIdx;
+                            addRow2('#workInvoiceProjectRelationList', workInvoiceProjectRelationListRowIdx, workInvoiceProjectRelationListTpl, data[k])
+                            workInvoiceProjectRelationListRowIdx = workInvoiceProjectRelationListRowIdx + 1;
+                            var d = JSON.parse(data);
+                            var projectReportDataNumber="#workInvoiceProjectRelationList"+row+"_projectReportDataNumber";
+                            var projectName="#workInvoiceProjectRelationList"+row+"_projectIdName";
+                            var projectId="#workInvoiceProjectRelationList"+row+"_projectId";
+                            var createByName="#workInvoiceProjectRelationList"+row+"_createByName";
+                            var createById="#workInvoiceProjectRelationList"+row+"_createById";
+                            var projectMasterName="#workInvoiceProjectRelationList"+row+"_projectMasterName";
+                            var startDate="#workInvoiceProjectRelationList"+row+"_startDate";
+                            var endingDate="#workInvoiceProjectRelationList"+row+"_endingDate";
+                            $(projectMasterName).val(d.projectMasterName);
+                            $(startDate).val(d.startDate);
+                            $(endingDate).val(d.endingDate);
+                            $(projectName).val(d.projectName);
+                            $(createByName).val(d.createByName);
+                            $(createById).val(d.createById);
+                            $(projectId).val(d.projectId);
+                            $(projectReportDataNumber).val(d.reportDataNum);
+                        }else{
+                            var d = JSON.parse(data);
+                            var projectReportDataNumber="#"+idx+"_projectReportDataNumber";
+                            var projectName="#"+idx+"_projectIdName";
+                            var projectId="#"+idx+"_projectId";
+                            var createByName="#"+idx+"_createByName";
+                            var createById="#"+idx+"_createById";
+                            var projectMasterName="#"+idx+"_projectMasterName";
+                            var startDate="#"+idx+"_startDate";
+                            var endingDate="#"+idx+"_endingDate";
+                            $(projectMasterName).val(d.projectMasterName);
+                            $(startDate).val(d.startDate);
+                            $(endingDate).val(d.endingDate);
+                            $(projectName).val(d.projectName);
+                            console.log('d.projectId', d.id)
+                            $(projectId).val(d.projectId);
+                            $(createByName).val(d.createByName);
+                            $(createById).val(d.createById);
+                            $(projectReportDataNumber).val(d.reportDataNum);
+                        }
+                    }
+                })
+            }
+        }
     </script>
 </head>
 <body>
@@ -179,7 +272,7 @@
             <form:hidden path="act.procDefId"/>
             <form:hidden id="flag" path="act.flag"/>
 
-            <div  id="upTable" class="form-group layui-row first">
+            <%--<div  id="upTable" class="form-group layui-row first">
                 <div class="form-group layui-row first">
                     <div class="form-group-label"><h2>项目基础信息</h2></div>
                     <div class="layui-item layui-col-sm6 lw6">
@@ -233,8 +326,76 @@
                         </div>
                     </div>
                 </div>
-            </div>
+            </div>--%>
+            <div class="form-group layui-row">
+                <div class="form-group-label"><h2>项目基础信息</h2></div>
+                <div class="layui-item nav-btns">
+                    <a class="nav-btn nav-btn-add" onclick="addRow2('#workInvoiceProjectRelationList', workInvoiceProjectRelationListRowIdx, workInvoiceProjectRelationListTpl);workInvoiceProjectRelationListRowIdx = workInvoiceProjectRelationListRowIdx + 1;" title="新增"><i class="fa fa-plus"></i>&nbsp;新增</a>
+                </div>
+                <div class="layui-table-body layui-item layui-col-xs12 form-table-container"  style="padding:0px">
+                    <table id="contentTables2" class="table table-bordered table-condensed can-edit no-bottom-margin details">
+                        <thead>
+                        <tr>
+                            <th width="300px"><font color="red">*</font>项目名称</th>
+                            <th width="250px">报告号</th>
+                            <th width="80px">创建人</th>
+                            <th width="80px">项目负责人</th>
+                            <th width="150px">工作开始日期</th>
+                            <th width="150px">工作结束日期</th>
+                            <th >操作</th>
+                        </tr>
+                        </thead>
+                        <tbody id="workInvoiceProjectRelationList">
+                        </tbody>
+                    </table>
+                    <script type="text/template" id="workInvoiceProjectRelationListTpl">//<!--
+                    <tr id="workInvoiceProjectRelationList{{idx}}">
+                    <td class="hide">
+                            <input id="workInvoiceProjectRelationList{{idx}}_projectId" name="workInvoiceProjectRelationList[{{idx}}].projectId" type="hidden" value="{{row.projectId}}"/>
+							<input id="workInvoiceProjectRelationList{{idx}}_delFlag" name="workInvoiceProjectRelationList[{{idx}}].delFlag" type="hidden" value="0"/>
+							<input id="workInvoiceProjectRelationList{{idx}}_createById" name="workInvoiceProjectRelationList[{{idx}}].createById" type="hidden" value="{{row.createById}}"/>
+							<input id="workInvoiceProjectRelationList{{idx}}_projectMasterId" name="workInvoiceProjectRelationList[{{idx}}].projectMasterId" type="hidden" value="{{row.projectMasterId}}"/>
+                        </td>
+                        <td>
+                        <sys:gridselectcallproject2 url="${ctx}/sealApplyFor/sealApplyFor/selectprojectOnList" id="workInvoiceProjectRelationList{{idx}}_projectId" name="workInvoiceProjectRelationList{{idx}}.projectId"  value="{{row.projectId}}"  title="选择所属项目" labelName="workInvoiceProjectRelationList[{{idx}}].projectName" cssStyle="background-color:#fff"
+                                                       labelValue="{{row.projectName}}" cssClass="form-control required layui-input"  fieldLabels="项目" fieldKeys="projectName" searchLabel="项目名称" searchKey="projectName" ></sys:gridselectcallproject2>
+                        </td>
+                        <td style="text-align:center;">
+							<input id="workInvoiceProjectRelationList{{idx}}_projectReportDataNumber" name="workInvoiceProjectRelationList[{{idx}}].projectReportDataNumber" title="报告号" type="text" value="{{row.reportDataNum}}" readonly="readonly"  class="form-control"/>
+                        </td>
+                        <td>
+							<input id="workInvoiceProjectRelationList{{idx}}_createByName" title="创建人" name="workInvoiceProjectRelationList[{{idx}}].createByName" type="text" value="{{row.createByName}}" readonly="readonly"  class="form-control"/>
+                        </td>
+                        <td>
+							<input id="workInvoiceProjectRelationList{{idx}}_projectMasterName" title="项目负责人" name="workInvoiceProjectRelationList[{{idx}}].projectMasterName" type="text" value="{{row.projectMasterName}}" readonly="readonly"  class="form-control"/>
+                        </td>
+                        <td>
+							<input id="workInvoiceProjectRelationList{{idx}}_startDate" title="工作开始日期" name="workInvoiceProjectRelationList[{{idx}}].startDate" type="text" value="{{row.startDate}}" readonly="readonly"  class="form-control"/>
+                        </td>
+                        <td>
+							<input id="workInvoiceProjectRelationList{{idx}}_endingDate" title="工作结束日期" name="workInvoiceProjectRelationList[{{idx}}].endingDate" type="text" value="{{row.endingDate}}" readonly="readonly"  class="form-control"/>
+                        </td>
+                        <td class="text-center op-td" >
+                            {{#delBtn}}<span class="op-btn op-btn-delete" onclick="delRow(this, '#workInvoiceProjectRelationList{{idx}}')" title="删除"><i class="glyphicon glyphicon-remove"></i>&nbsp;删除</span>{{/delBtn}}
+                        </td>
+                    </tr>//-->
+                    </script>
+                    <script type="text/javascript">
+                        var workInvoiceProjectRelationListRowIdx = 0, workInvoiceProjectRelationListTpl = $("#workInvoiceProjectRelationListTpl").html().replace(/(\/\/\<!\-\-)|(\/\/\-\->)/g,"");
+                        /*if($("#id").val()){
+                            workInvoiceProjectRelationListRowIdx = ${fn:length(workInvoice.workInvoiceProjectRelationList)};
+						}*/
+                        $(document).ready(function() {
+                            var data = ${fns:toJson(sealApplyForInfo.workInvoiceProjectRelationList)};
+                            for (var i=0; i<data.length; i++){
+                                addRow2('#workInvoiceProjectRelationList', workInvoiceProjectRelationListRowIdx, workInvoiceProjectRelationListTpl, data[i])
+                                workInvoiceProjectRelationListRowIdx = workInvoiceProjectRelationListRowIdx + 1;
+                            }
+                        });
+                    </script>
+                </div>
 
+            </div>
 
             <div class="form-group layui-row first">
                 <div class="form-group-label"><h2>盖章信息</h2></div>
@@ -262,7 +423,8 @@
                         <table id="contentTables" class="table table-bordered table-condensed can-edit no-bottom-margin details">
                             <thead>
                             <tr>
-                                <th width="20%"><font color="red" >*</font>盖章材料名称</th>
+                                <th width="10%"><font color="red" >*</font>报告号</th>
+                                <th width="10%"><font color="red" >*</font>盖章材料名称</th>
                                 <th width="10%"><font color="red">*</font>份数</th>
                                 <th width="40%">主要内容简述</th>
                                 <th width="10%">经办人</th>
@@ -281,6 +443,9 @@
 							<input id="sealMaterialInfoList{{idx}}_id" name="sealMaterialInfoList[{{idx}}].id" type="hidden" value="{{row.id}}"/>
                         </td>
                         <td style="padding:0px">
+							<input id="sealMaterialInfoList{{idx}}_reportNumber" name = "sealMaterialInfoList[{{idx}}].reportNumber"  type="text" value="{{row.reportNumber}}"  class="form-control" style="padding:0px;margin-left:0px;text-align:center;" required/>
+                        </td>
+                        <td style="padding:0px">
 							<input id="sealMaterialInfoList{{idx}}_sealMaterialName" name = "sealMaterialInfoList[{{idx}}].sealMaterialName"  type="text" value="{{row.sealMaterialName}}"  class="form-control" style="padding:0px;margin-left:0px;text-align:center;" required/>
                         </td>
                         <td style="padding:0px">

+ 103 - 0
src/main/webapp/webpage/modules/sealApplyFor/sealApplyForProjectView.jsp

@@ -0,0 +1,103 @@
+<%@ page contentType="text/html;charset=UTF-8" %>
+<%@ include file="/webpage/include/taglib.jsp"%>
+<html>
+<head>
+    <title>盖章管理</title>
+    <meta name="decorator" content="default"/>
+    <style>
+        #workInvoiceProjectRelationList td{
+            padding-left: 0px;
+            padding-right: 0px;
+        }
+    </style>
+    <script type="text/javascript">
+        var validateForm;
+        function doSubmit(){//回调函数,在编辑和保存动作时,供openDialog调用提交表单。
+            if(validateForm.form()){
+                $("#inputForm").submit();
+                return true;
+            }
+
+            return false;
+        }
+        $(document).ready(function() {
+            $("#name").focus();
+            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 view-form">
+    <div class="container">
+        <form:form id="inputForm" modelAttribute="sealApplyForInfo" action="${ctx}/workinvoice/workInvoice/saveAudit" method="post" class="form-horizontal">
+            <form:hidden path="id"/>
+            <form:hidden path="act.taskId"/>
+            <form:hidden path="act.taskName"/>
+            <form:hidden path="act.taskDefKey"/>
+            <form:hidden path="act.procInsId"/>
+            <form:hidden path="act.procDefId"/>
+            <form:hidden id="flag" path="act.flag"/>
+
+            <div class="form-group layui-row first lw14">
+                <div class="form-group-label"><h2>盖章项目信息</h2></div>
+                <div class="layui-table-body layui-item layui-col-xs12 form-table-container"  style="padding:0px">
+                    <table id="contentTables" class="table table-bordered table-condensed can-edit no-bottom-margin details">
+                        <thead>
+                        <tr>
+                            <th width="300px"><font color="red">*</font>项目名称</th>
+                            <th width="250px">报告号</th>
+                            <th width="80px">创建人</th>
+                            <th width="80px">项目负责人</th>
+                            <th width="150px">工作开始日期</th>
+                            <th width="150px">工作结束日期</th>
+                        </tr>
+                        </thead>
+                        <tbody id="workInvoiceProjectRelationList">
+                        <c:forEach items="${sealApplyForInfo.workInvoiceProjectRelationList}" var="list">
+                            <tr>
+                                <td>
+<%--                                    <a onclick="openDialogView('查看项目', '${ctx}/sealApplyFor/sealApplyFor/view?projectId=${list.projectId} + &id=${list.id}','95%', '95%')">--%>
+                                    <a onclick="openDialogView('查看项目', '${ctx}/ruralProject/ruralProjectView/view?id=${list.projectId}','95%', '95%')">
+                                        <input type="text" value="${list.projectName}" readonly="readonly"  class="form-control"/></a>
+                                </td>
+                                <td>
+                                    <input type="text" value="${list.reportDataNum}" readonly="readonly"  class="form-control"/>
+                                </td>
+                                <td>
+                                    <input type="text" value="${list.createByName}" readonly="readonly"  class="form-control"/>
+                                </td>
+                                <td>
+                                    <input type="text" value="${list.projectMasterName}" readonly="readonly"  class="form-control"/>
+                                </td>
+                                <td>
+                                    <input type="text" value="${list.startDate}" readonly="readonly"  class="form-control"/>
+                                </td>
+                                <td>
+                                    <input type="text" value="${list.endingDate}" readonly="readonly"  class="form-control"/>
+                                </td>
+                            </tr>
+                        </c:forEach>
+                        </tbody>
+                    </table>
+                </div>
+            </div>
+            <div class="form-group layui-row page-end"></div>
+        </form:form>
+    </div>
+</div>
+</body>
+</html>

+ 167 - 1
src/main/webapp/webpage/modules/sealApplyFor/sealApplyForView.jsp

@@ -72,6 +72,99 @@
                 }
             });
         });
+        function addRow2(list, idx, tpl, row){
+            var idx1 = $("#workInvoiceProjectRelationList tr").length;
+            if(idx1>0){
+                var count=0;
+                for (var i=1;i<=idx1;i++) {
+                    var delFlag = $("#workInvoiceProjectRelationList").find("tr").eq(i-1).find("input").eq(1).val();
+                    if (delFlag == "1") {
+                        count = i;
+                    }
+                }
+            }
+            if(list == '#workInvoiceProjectRelationList'){
+                bornTemplete1(list, idx, tpl, row, idx1);
+            }
+        }
+        function bornTemplete1(list, idx, tpl, row, idx1){
+            $(list).append(Mustache.render(tpl, {
+                idx: idx, delBtn: true, row: row,
+                order:idx1 + 1
+            }));
+            $(list+idx).find("select").each(function(){
+                $(this).val($(this).attr("data-value"));
+            });
+            $(list+idx).find("input[type='checkbox'], input[type='radio']").each(function(){
+                var ss = $(this).attr("data-value").split(',');
+                for (var i=0; i<ss.length; i++){
+                    if($(this).val() == ss[i]){
+                        $(this).attr("checked","checked");
+                    }
+                }
+            });
+        }
+        function newSetPNumber(obj,ids){
+            var idx=ids.split("_")[0]
+            var idArray= new Array(); //定义一数组
+            idArray=obj.split(","); //字符分割
+            console.log('idArray',idArray)
+
+            for (var k=0;k<idArray.length ;k++ )
+            {
+                $.ajax({
+                    async:false,
+                    type:'post',
+                    url:'${ctx}/sealApplyFor/sealApplyFor/getPNumber',
+                    data:{
+                        "obj":idArray[k]
+                    },
+                    success:function(data){
+                        if(k>=1){
+                            var row = workInvoiceProjectRelationListRowIdx;
+                            addRow2('#workInvoiceProjectRelationList', workInvoiceProjectRelationListRowIdx, workInvoiceProjectRelationListTpl, data[k])
+                            workInvoiceProjectRelationListRowIdx = workInvoiceProjectRelationListRowIdx + 1;
+                            var d = JSON.parse(data);
+                            var projectReportDataNumber="#workInvoiceProjectRelationList"+row+"_projectReportDataNumber";
+                            var projectName="#workInvoiceProjectRelationList"+row+"_projectIdName";
+                            var projectId="#workInvoiceProjectRelationList"+row+"_projectId";
+                            var createByName="#workInvoiceProjectRelationList"+row+"_createByName";
+                            var createById="#workInvoiceProjectRelationList"+row+"_createById";
+                            var projectMasterName="#workInvoiceProjectRelationList"+row+"_projectMasterName";
+                            var startDate="#workInvoiceProjectRelationList"+row+"_startDate";
+                            var endingDate="#workInvoiceProjectRelationList"+row+"_endingDate";
+                            $(projectMasterName).val(d.projectMasterName);
+                            $(startDate).val(d.startDate);
+                            $(endingDate).val(d.endingDate);
+                            $(projectName).val(d.projectName);
+                            $(createByName).val(d.createByName);
+                            $(createById).val(d.createById);
+                            $(projectId).val(d.projectId);
+                            $(projectReportDataNumber).val(d.reportDataNum);
+                        }else{
+                            var d = JSON.parse(data);
+                            var projectReportDataNumber="#"+idx+"_projectReportDataNumber";
+                            var projectName="#"+idx+"_projectIdName";
+                            var projectId="#"+idx+"_projectId";
+                            var createByName="#"+idx+"_createByName";
+                            var createById="#"+idx+"_createById";
+                            var projectMasterName="#"+idx+"_projectMasterName";
+                            var startDate="#"+idx+"_startDate";
+                            var endingDate="#"+idx+"_endingDate";
+                            $(projectMasterName).val(d.projectMasterName);
+                            $(startDate).val(d.startDate);
+                            $(endingDate).val(d.endingDate);
+                            $(projectName).val(d.projectName);
+                            console.log('d.projectId', d.id)
+                            $(projectId).val(d.projectId);
+                            $(createByName).val(d.createByName);
+                            $(createById).val(d.createById);
+                            $(projectReportDataNumber).val(d.reportDataNum);
+                        }
+                    }
+                })
+            }
+        }
     </script>
 </head>
 <body>
@@ -82,7 +175,7 @@
             <form:hidden path="id"/>
             <input type="hidden" id="flagFile" value="">
 
-            <div class="form-group layui-row first">
+            <%--<div class="form-group layui-row first">
                 <div class="form-group-label"><h2>项目基础信息</h2></div>
 
                 <div class="layui-item layui-col-sm6 lw6">
@@ -134,6 +227,75 @@
                         <input class="laydate-icondate form-control layui-input layer-date "  style="background-color: #f1f1f1" readonly="true" id="endingDate" name="endingDate" value="<fmt:formatDate value="${sealApplyForInfo.projectRecords.endingDate}" pattern="yyyy-MM-dd"/>">
                     </div>
                 </div>
+            </div>--%>
+            <div class="form-group layui-row">
+                <div class="form-group-label"><h2>项目基础信息</h2></div>
+<%--                <div class="layui-item nav-btns">--%>
+<%--                    <a class="nav-btn nav-btn-add" style="pointer-events: none" onclick="addRow2('#workInvoiceProjectRelationList', workInvoiceProjectRelationListRowIdx, workInvoiceProjectRelationListTpl);workInvoiceProjectRelationListRowIdx = workInvoiceProjectRelationListRowIdx + 1;" title="新增"><i class="fa fa-plus"></i>&nbsp;新增</a>--%>
+<%--                </div>--%>
+                <div class="layui-table-body layui-item layui-col-xs12 form-table-container"  style="padding:0px">
+                    <table id="contentTables2" class="table table-bordered table-condensed can-edit no-bottom-margin details">
+                        <thead>
+                        <tr>
+                            <th width="300px"><font color="red">*</font>项目名称</th>
+                            <th width="250px">报告号</th>
+                            <th width="80px">创建人</th>
+                            <th width="80px">项目负责人</th>
+                            <th width="150px">工作开始日期</th>
+                            <th width="150px">工作结束日期</th>
+<%--                            <th >操作</th>--%>
+                        </tr>
+                        </thead>
+                        <tbody id="workInvoiceProjectRelationList">
+                        </tbody>
+                    </table>
+                    <script type="text/template" id="workInvoiceProjectRelationListTpl">//<!--
+                    <tr id="workInvoiceProjectRelationList{{idx}}">
+                    <td class="hide">
+                            <input id="workInvoiceProjectRelationList{{idx}}_projectId" name="workInvoiceProjectRelationList[{{idx}}].projectId" type="hidden" value="{{row.projectId}}"/>
+							<input id="workInvoiceProjectRelationList{{idx}}_delFlag" name="workInvoiceProjectRelationList[{{idx}}].delFlag" type="hidden" value="0"/>
+							<input id="workInvoiceProjectRelationList{{idx}}_createById" name="workInvoiceProjectRelationList[{{idx}}].createById" type="hidden" value="{{row.createById}}"/>
+							<input id="workInvoiceProjectRelationList{{idx}}_projectMasterId" name="workInvoiceProjectRelationList[{{idx}}].projectMasterId" type="hidden" value="{{row.projectMasterId}}"/>
+                        </td>
+                        <td>
+                        <sys:gridselectcallproject2 url="${ctx}/sealApplyFor/sealApplyFor/selectprojectOnList" id="workInvoiceProjectRelationList{{idx}}_projectId" name="workInvoiceProjectRelationList{{idx}}.projectId"  value="{{row.projectId}}"  title="选择所属项目" labelName="workInvoiceProjectRelationList[{{idx}}].projectName" cssStyle="background-color:#fff"
+                                                       labelValue="{{row.projectName}}" cssClass="form-control required layui-input"  fieldLabels="项目" fieldKeys="projectName" searchLabel="项目名称" searchKey="projectName" ></sys:gridselectcallproject2>
+                        </td>
+                        <td style="text-align:center;">
+							<input id="workInvoiceProjectRelationList{{idx}}_projectReportDataNumber" name="workInvoiceProjectRelationList[{{idx}}].projectReportDataNumber" title="报告号" type="text" value="{{row.reportDataNum}}" readonly="readonly"  class="form-control"/>
+                        </td>
+                        <td>
+							<input id="workInvoiceProjectRelationList{{idx}}_createByName" title="创建人" name="workInvoiceProjectRelationList[{{idx}}].createByName" type="text" value="{{row.createByName}}" readonly="readonly"  class="form-control"/>
+                        </td>
+                        <td>
+							<input id="workInvoiceProjectRelationList{{idx}}_projectMasterName" title="项目负责人" name="workInvoiceProjectRelationList[{{idx}}].projectMasterName" type="text" value="{{row.projectMasterName}}" readonly="readonly"  class="form-control"/>
+                        </td>
+                        <td>
+							<input id="workInvoiceProjectRelationList{{idx}}_startDate" title="工作开始日期" name="workInvoiceProjectRelationList[{{idx}}].startDate" type="text" value="{{row.startDate}}" readonly="readonly"  class="form-control"/>
+                        </td>
+                        <td>
+							<input id="workInvoiceProjectRelationList{{idx}}_endingDate" title="工作结束日期" name="workInvoiceProjectRelationList[{{idx}}].endingDate" type="text" value="{{row.endingDate}}" readonly="readonly"  class="form-control"/>
+                        </td>
+                        <%--<td class="text-center op-td" >
+                            {{#delBtn}}<span class="op-btn op-btn-delete" onclick="delRow(this, '#workInvoiceProjectRelationList{{idx}}')" title="删除"><i class="glyphicon glyphicon-remove"></i>&nbsp;删除</span>{{/delBtn}}
+                        </td>--%>
+                    </tr>//-->
+                    </script>
+                    <script type="text/javascript">
+                        var workInvoiceProjectRelationListRowIdx = 0, workInvoiceProjectRelationListTpl = $("#workInvoiceProjectRelationListTpl").html().replace(/(\/\/\<!\-\-)|(\/\/\-\->)/g,"");
+                        /*if($("#id").val()){
+                            workInvoiceProjectRelationListRowIdx = ${fn:length(workInvoice.workInvoiceProjectRelationList)};
+						}*/
+                        $(document).ready(function() {
+                            var data = ${fns:toJson(sealApplyForInfo.workInvoiceProjectRelationList)};
+                            for (var i=0; i<data.length; i++){
+                                addRow2('#workInvoiceProjectRelationList', workInvoiceProjectRelationListRowIdx, workInvoiceProjectRelationListTpl, data[i])
+                                workInvoiceProjectRelationListRowIdx = workInvoiceProjectRelationListRowIdx + 1;
+                            }
+                        });
+                    </script>
+                </div>
+
             </div>
 
             <div class="form-group layui-row first">
@@ -168,6 +330,7 @@
                             <thead>
                             <tr>
                                 <th class="hide"></th>
+                                <th >报告号</th>
                                 <th >盖章材料名称</th>
                                 <th >份数</th>
                                 <th >主要内容简述</th>
@@ -179,6 +342,9 @@
                             <tbody id="workConstructionLinkmanList">
                             <c:forEach items="${sealMaterialInfos}" var="info" varStatus="index">
                                 <tr>
+                                    <td title="${info.reportNumber}">
+                                            ${info.reportNumber}
+                                    </td>
                                     <td>
                                             ${info.sealMaterialName}
                                     </td>

+ 11 - 12
src/main/webapp/webpage/modules/sys/gridReimburProjectList.jsp

@@ -15,30 +15,29 @@
 			    	  $('#contentTable tbody tr td input.i-checks').iCheck('check');
 			    	});
 
-			    $('#contentTable thead tr th input.i-checks').on('ifUnchecked', function(event){ //ifCreated 事件应该在插件初始化之前绑定 
+			    $('#contentTable thead tr th input.i-checks').on('ifUnchecked', function(event){ //ifCreated 事件应该在插件初始化之前绑定
 			    	  $('#contentTable tbody tr td input.i-checks').iCheck('uncheck');
 			    	});
-			    
-			
+
+
 		});
 
 		function getSelectedItem(){
-
+			var array = new Array();
 			var size = $("#contentTable tbody tr td input.i-checks:checked").size();
+			var sizeChecked = $("#contentTable tbody tr td input.i-checks:checked");
 			  if(size == 0 ){
 					top.layer.alert('请至少选择一条数据!', {icon: 0, title:'警告'});
 					return "-1";
 				  }
-
-			  if(size > 1 ){
-					top.layer.alert('只能选择一条数据!', {icon: 0, title:'警告'});
-					return "-1";
-				  }
+				for (var i=0;i<size;i++){
+					array.push(sizeChecked[i].id);
+				}
 			    var id =  $("#contentTable tbody tr td input.i-checks:checkbox:checked").attr("id");
-			    
+
 				var label = $("#contentTable tbody tr td input.i-checks:checkbox:checked").parent().parent().parent().find(".codelabel").html();
 				var number = $("#contentTable tbody tr td input.i-checks:checkbox:checked").parent().parent().parent().find(".codenumber").html();
-				return id+"_item_"+label+"_item_"+number;
+				return array.toString()+"_item_"+label+"_item_"+number;
 		}
 		function page(n,s){
 			if(n) $("#pageNo").val(n);
@@ -155,4 +154,4 @@
 	</div>
 </div>
 </body>
-</html>
+</html>