Procházet zdrojové kódy

Merge remote-tracking branch 'origin/master'

# Conflicts:
#	src/main/java/com/jeeplus/modules/projectConstruction/dao/ContractDao.java
user7 před 4 roky
rodič
revize
f04398f178

+ 7 - 0
src/main/java/com/jeeplus/modules/projectConstruction/dao/ContractDao.java

@@ -28,4 +28,11 @@ public interface ContractDao extends CrudDao<ConstructionContract> {
      * @return
      */
     List<ConstructionContract> find(String id);
+
+    /**
+     * 获取工程进度款信息集合
+     * @param constructionContract
+     * @return
+     */
+    List<ConstructionContract> getConstructionContractList(ConstructionContract constructionContract);
 }

+ 5 - 0
src/main/java/com/jeeplus/modules/projectConstruction/service/ContractService.java

@@ -83,6 +83,11 @@ public class ContractService extends CrudService<ContractDao,ConstructionContrac
         return page;
     }
 
+    public List<ConstructionContract> getConstructionContractList(ConstructionContract constructionContract){
+        List<ConstructionContract> list = dao.getConstructionContractList(constructionContract);
+        return list;
+    }
+
 
     /**
      * 新增方法

+ 9 - 0
src/main/java/com/jeeplus/modules/projectVisa/entity/VisaTreeData.java

@@ -19,6 +19,7 @@ public class VisaTreeData extends DataEntity<VisaTreeData> {
     private String procedure;//审批手续合规性
     private Double confirmMoney;//定审金额
     private String type;//汇总类型1是签证2是设计
+    private Integer condition;   //标识 (1:代表第1级,剩下的以此类推)
 
     public String getContractId() {
         return contractId;
@@ -115,4 +116,12 @@ public class VisaTreeData extends DataEntity<VisaTreeData> {
     public void setCnumber(String cnumber) {
         this.cnumber = cnumber;
     }
+
+    public Integer getCondition() {
+        return condition;
+    }
+
+    public void setCondition(Integer condition) {
+        this.condition = condition;
+    }
 }

+ 100 - 34
src/main/java/com/jeeplus/modules/projectVisa/web/ProjectVisaController.java

@@ -15,6 +15,7 @@ import com.jeeplus.modules.projectcontentinfo.entity.Projectcontentinfo;
 import com.jeeplus.modules.projectcontentinfo.service.ProjectContentDataService;
 import com.jeeplus.modules.projectcontentinfo.service.ProjectcontentinfoService;
 import com.jeeplus.modules.projectrecord.entity.ProjectImplementEarly;
+import com.jeeplus.modules.projectrecord.entity.ProjectPaymentTreeData;
 import com.jeeplus.modules.projectrecord.entity.ProjectRecordTreeData;
 import com.jeeplus.modules.projectrecord.entity.ProjectRecords;
 import com.jeeplus.modules.projectrecord.service.ProjectImplementEarlyService;
@@ -171,43 +172,108 @@ public class ProjectVisaController extends BaseController {
     @ResponseBody
     public Map<String,List> getTreeList(ConstructionContract constructionContract, HttpServletRequest request, HttpServletResponse response, Model model){
 
-        Page<ConstructionContract> page = contractService.findPage(new Page<ConstructionContract>(request, response), constructionContract);
-        if(UserUtils.isManager()){
-            model.addAttribute("flag","1");
-        }
-        List<ConstructionContract> contractList=page.getList();
         Map<String,List> map = new HashMap<>();
+        ProjectImplementEarly projectRecords = new ProjectImplementEarly();
+        if(StringUtils.isNotBlank(constructionContract.getProjectName())){
+            projectRecords.setProjectName(constructionContract.getProjectName());
+        }
+        Page<ProjectImplementEarly> recordPage = projectImplementEarlyService.findProjectPage(new Page<ProjectImplementEarly>(request, response), projectRecords);
+        //获取项目信息
+        List<ProjectImplementEarly> recordList = recordPage.getList();
+        //新建树形列表集合
         List<VisaTreeData> treeList=new ArrayList<>();
-        //便利合同把合同给VisaTreeData而且pid为0
-        for(int i=0;i<contractList.size();i++){
-            VisaTreeData visaTreeData=new VisaTreeData();
-            ConstructionContract contract=contractList.get(i);
-            visaTreeData.setContractId(contract.getId());
-            visaTreeData.setId(contract.getId());
-            visaTreeData.setContractName(contract.getContractName());
-            visaTreeData.setDate(contract.getCreateDate());
-            visaTreeData.setNumber("");
-            visaTreeData.setPid("0");
-            visaTreeData.setCnumber(contract.getCnumber());
-
-            treeList.add(visaTreeData);
-            //根据获取的合同的id去查找汇总表获取汇总表信息
-            List<ProjectVisa> projectVisaList=projectVisaService.getVisaList(contract.getId());
-            for (int j=0;j<projectVisaList.size();j++){
-                VisaTreeData visaTreeData2=new VisaTreeData();
-                ProjectVisa visa=projectVisaList.get(j);
-                visaTreeData2.setPid(visa.getContractId());
-                visaTreeData2.setId(visa.getId());
-                visaTreeData2.setContractName(contract.getContractName());
-                visaTreeData2.setContractId(visa.getContractId());
-                visaTreeData2.setConfirmMoney(visa.getConfirmMoney());
-                visaTreeData2.setDate(visa.getDate());
-                visaTreeData2.setSendMoney(visa.getSendMoney());
-                visaTreeData2.setCnumber(contract.getCnumber());
-                visaTreeData2.setNumber(visa.getNumber());
-
-                treeList.add(visaTreeData2);
+        if(recordList.size()>0){
+            for (ProjectImplementEarly record:recordList) {
+                //将项目信息放入树形列表集合中
+                VisaTreeData recordTreeData = new VisaTreeData();
+                //将界面需要展示数据放入类中
+                recordTreeData.setId(record.getId());
+                recordTreeData.setContractName(record.getProjectName());
+                recordTreeData.setCnumber(record.getProjectId());
+                recordTreeData.setNumber("");
+                recordTreeData.setPid("0");
+                //将项目设置为第一级数据
+                recordTreeData.setCondition(1);
+                //将项目信息放入
+                treeList.add(recordTreeData);
+
+                //处理合同信息数据
+                ConstructionContract conditionContract = new ConstructionContract();
+                conditionContract.setProjectId(record.getId());
+
+                if(StringUtils.isNotBlank(constructionContract.getContractName())){
+                    conditionContract.setContractName(constructionContract.getContractName());
+                }
+                //获取合同信息
+                List<ConstructionContract> contractList = contractService.getConstructionContractList(conditionContract);
+                if(contractList.size()>0){
+                    //遍历项目中的合同信息
+                    for (ConstructionContract contract:contractList) {
+                        VisaTreeData visaTreeData=new VisaTreeData();
+                        visaTreeData.setContractId(contract.getId());
+                        visaTreeData.setId(contract.getId());
+                        visaTreeData.setContractName(contract.getContractName());
+                        visaTreeData.setDate(contract.getCreateDate());
+                        visaTreeData.setNumber("");
+                        visaTreeData.setPid(record.getId());
+                        visaTreeData.setCnumber(contract.getCnumber());
+
+                        //将项目设置为第二级数据
+                        visaTreeData.setCondition(2);
+                        //遍历项目负责人信息
+                        List<User> masterUserList = record.getProjectLeaders();
+                        List<String> masterList = new ArrayList<>();
+                        Set masterIdSet = new HashSet();
+                        for (User masterUser:masterUserList) {
+                            masterList.add(masterUser.getName());
+                            masterIdSet.add(masterUser.getId());
+                        }
+                        //Set转List
+                        List<String> masterIdList = new ArrayList<>(masterIdSet);
+                        for (String masterId : masterIdList) {
+                            if(masterId.equals(UserUtils.getUser().getId())){
+                                visaTreeData.setOperationSign(1);
+                                break;
+                            }else{
+                                visaTreeData.setOperationSign(0);
+                            }
+                        }
+
+                        //将项目信息放入
+                        treeList.add(visaTreeData);
+
+                        //根据获取的合同的id去查找汇总表获取汇总表信息
+                        List<ProjectVisa> projectVisaList=projectVisaService.getVisaList(contract.getId());
+                        for (int j=0;j<projectVisaList.size();j++){
+                            VisaTreeData visaTreeData2=new VisaTreeData();
+                            ProjectVisa visa=projectVisaList.get(j);
+                            visaTreeData2.setPid(visa.getContractId());
+                            visaTreeData2.setId(visa.getId());
+                            visaTreeData2.setContractName(contract.getContractName());
+                            visaTreeData2.setContractId(visa.getContractId());
+                            visaTreeData2.setConfirmMoney(visa.getConfirmMoney());
+                            visaTreeData2.setDate(visa.getDate());
+                            visaTreeData2.setSendMoney(visa.getSendMoney());
+                            visaTreeData2.setCnumber(contract.getCnumber());
+                            visaTreeData2.setNumber(visa.getNumber());
+
+                            //将项目设置为第二级数据
+                            visaTreeData2.setCondition(3);
+                            for (String masterId : masterIdList) {
+                                if(masterId.equals(UserUtils.getUser().getId())){
+                                    visaTreeData2.setOperationSign(1);
+                                    break;
+                                }else{
+                                    visaTreeData2.setOperationSign(0);
+                                }
+                            }
+                            treeList.add(visaTreeData2);
+                        }
+
+                    }
+                }
             }
+
         }
         map.put("data",treeList);
         return map;

+ 52 - 0
src/main/java/com/jeeplus/modules/projectrecord/entity/ProjectPaymentTreeData.java

@@ -1,7 +1,11 @@
 package com.jeeplus.modules.projectrecord.entity;
 
+import com.fasterxml.jackson.annotation.JsonFormat;
+import com.google.common.collect.Lists;
 import com.jeeplus.common.persistence.DataEntity;
+import com.jeeplus.modules.workclientinfo.entity.WorkClientAttachment;
 
+import java.util.Date;
 import java.util.List;
 
 /**
@@ -10,6 +14,7 @@ import java.util.List;
  * @version 2020-07-28
  */
 public class ProjectPaymentTreeData extends DataEntity<ProjectPaymentTreeData> {
+    private static final long serialVersionUID = 1L;
     private String projectId;		// 项目id
     private String projectName;		// 项目名称
     private String contractName;    //合同名称
@@ -35,11 +40,25 @@ public class ProjectPaymentTreeData extends DataEntity<ProjectPaymentTreeData> {
 
     private Double trueAmt;    //签约价款
 
+    private String payDate;   //支付时间
+    private String masterUser;   //登记人
+
 
     private String pid;             // 父id
     private String loginId;         //登陆者id
     private String createId;        //创建者id
     private Integer operationSign;   //操作标识
+    private Integer condition;   //标识 (1:代表第1级,剩下的以此类推)
+    private List<WorkClientAttachment> workAttachments = Lists.newArrayList();
+
+
+    public ProjectPaymentTreeData() {
+        super();
+    }
+
+    public ProjectPaymentTreeData(String id){
+        super(id);
+    }
 
     public String getProjectId() {
         return projectId;
@@ -216,4 +235,37 @@ public class ProjectPaymentTreeData extends DataEntity<ProjectPaymentTreeData> {
     public void setTrueAmt(Double trueAmt) {
         this.trueAmt = trueAmt;
     }
+
+    public Integer getCondition() {
+        return condition;
+    }
+
+    public void setCondition(Integer condition) {
+        this.condition = condition;
+    }
+
+    public String getPayDate() {
+        return payDate;
+    }
+
+    public void setPayDate(String payDate) {
+        this.payDate = payDate;
+    }
+
+
+    public String getMasterUser() {
+        return masterUser;
+    }
+
+    public void setMasterUser(String masterUser) {
+        this.masterUser = masterUser;
+    }
+
+    public List<WorkClientAttachment> getWorkAttachments() {
+        return workAttachments;
+    }
+
+    public void setWorkAttachments(List<WorkClientAttachment> workAttachments) {
+        this.workAttachments = workAttachments;
+    }
 }

+ 34 - 0
src/main/java/com/jeeplus/modules/projectrecord/service/implementStage/ProjectInterimPaymentService.java

@@ -3,6 +3,11 @@ package com.jeeplus.modules.projectrecord.service.implementStage;
 import com.jeeplus.common.service.CrudService;
 import com.jeeplus.modules.projectrecord.dao.implementStage.ProjectInterimPaymentDao;
 import com.jeeplus.modules.projectrecord.entity.ProjectPaymentTreeData;
+import com.jeeplus.modules.sys.utils.UserUtils;
+import com.jeeplus.modules.workclientinfo.dao.WorkClientAttachmentDao;
+import com.jeeplus.modules.workclientinfo.entity.WorkClientAttachment;
+import org.apache.commons.lang3.StringUtils;
+import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 
@@ -17,6 +22,10 @@ import java.util.List;
 @Transactional(readOnly = true)
 public class ProjectInterimPaymentService extends CrudService<ProjectInterimPaymentDao, ProjectPaymentTreeData> {
 
+    @Autowired
+    private WorkClientAttachmentDao workClientAttachmentDao;
+
+
     public ProjectPaymentTreeData get(String id) {
         return super.get(id);
     }
@@ -41,5 +50,30 @@ public class ProjectInterimPaymentService extends CrudService<ProjectInterimPaym
             projectPaymentTreeData.preUpdate();
             dao.update(projectPaymentTreeData);
         }
+        if (projectPaymentTreeData.getWorkAttachments()!=null && !projectPaymentTreeData.getWorkAttachments().isEmpty()) {
+            //保存附件信息
+            for (WorkClientAttachment workClientAttachment : projectPaymentTreeData.getWorkAttachments()) {
+                if (StringUtils.isBlank(workClientAttachment.getId())&& StringUtils.isNotBlank(workClientAttachment.getAttachmentId())) {
+                    continue;
+                }
+                if (org.apache.commons.lang3.StringUtils.isBlank(workClientAttachment.getId())&& StringUtils.isBlank(workClientAttachment.getUrl())) {
+                    continue;
+                }
+                if (WorkClientAttachment.DEL_FLAG_NORMAL.equals(workClientAttachment.getDelFlag())) {
+                    workClientAttachment.setAttachmentId(projectPaymentTreeData.getId());
+                    workClientAttachment.setAttachmentFlag("135");
+                    workClientAttachment.setAttachmentUser(UserUtils.getUser().getId());
+                    if (StringUtils.isBlank(workClientAttachment.getId()) || "null".equals(workClientAttachment.getId())) {
+                        workClientAttachment.preInsert();
+                        workClientAttachmentDao.insert(workClientAttachment);
+                    } else {
+                        workClientAttachment.preUpdate();
+                        workClientAttachmentDao.update(workClientAttachment);
+                    }
+                } else {
+                    workClientAttachmentDao.delete(workClientAttachment);
+                }
+            }
+        }
     }
 }

+ 129 - 86
src/main/java/com/jeeplus/modules/projectrecord/web/implementStage/ProjectInterimPaymentController.java

@@ -10,10 +10,13 @@ import com.jeeplus.modules.projectrecord.dao.WorkProjectUserDao;
 import com.jeeplus.modules.projectrecord.entity.ProjectImplementEarly;
 import com.jeeplus.modules.projectrecord.entity.ProjectPaymentTreeData;
 import com.jeeplus.modules.projectrecord.entity.ProjectRecords;
+import com.jeeplus.modules.projectrecord.service.ProjectImplementEarlyService;
 import com.jeeplus.modules.projectrecord.service.ProjectRecordsService;
 import com.jeeplus.modules.projectrecord.service.implementStage.ProjectInterimPaymentService;
 import com.jeeplus.modules.sys.entity.User;
 import com.jeeplus.modules.sys.utils.UserUtils;
+import com.jeeplus.modules.workclientinfo.dao.WorkClientAttachmentDao;
+import com.jeeplus.modules.workclientinfo.entity.WorkClientAttachment;
 import org.apache.shiro.authz.annotation.RequiresPermissions;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Controller;
@@ -40,9 +43,9 @@ public class ProjectInterimPaymentController {
     @Autowired
     private ProjectInterimPaymentService service;
     @Autowired
-    private ProjectRecordsService projectRecordsService;
+    private ProjectImplementEarlyService projectImplementEarlyService;
     @Autowired
-    private WorkProjectUserDao workProjectUserDao;
+    private WorkClientAttachmentDao workClientAttachmentDao;
 
     /**
      * 合同列表页面
@@ -74,102 +77,135 @@ public class ProjectInterimPaymentController {
         if(UserUtils.isManager()){
             model.addAttribute("flag","1");
         }
-        Page<ConstructionContract> page = contractService.findPage(new Page<ConstructionContract>(request, response), constructionContract);
-        //无合同状态下,获取委托方的名称
-        List<ConstructionContract> list = page.getList();
-        List<ProjectPaymentTreeData> projectRecordTreeDataList = new ArrayList<>();
         Map<String,List> map = new HashMap<>();
-        for (int i = 0; i < list.size(); i++) {
-            ProjectPaymentTreeData projectPaymentTreeData = new ProjectPaymentTreeData();
-            ConstructionContract contract = list.get(i);
-
-            ProjectRecords records1 = projectRecordsService.get(list.get(i).getProjectId());
-            List<User> users = workProjectUserDao.queryProjectUsers(records1.getId(), "1");
-            records1.setProjectLeaders(users);
-            records1.setLeaderNameStr(Collections3.extractToString(users, "name", ","));
-            records1.setLeaderIds(Collections3.extractToString(users, "id", ","));
-
-            //遍历项目负责人信息
-            List<User> masterUserList = records1.getProjectLeaders();
-            List<String> masterList = new ArrayList<>();
-            Set masterIdSet = new HashSet();
-            for (User masterUser:masterUserList) {
-                masterList.add(masterUser.getName());
-                masterIdSet.add(masterUser.getId());
-            }
+        ProjectImplementEarly projectRecords = new ProjectImplementEarly();
+        if(StringUtils.isNotBlank(constructionContract.getProjectName())){
+            projectRecords.setProjectName(constructionContract.getProjectName());
+        }
+        Page<ProjectImplementEarly> recordPage = projectImplementEarlyService.findProjectPage(new Page<ProjectImplementEarly>(request, response), projectRecords);
+        //获取项目信息
+        List<ProjectImplementEarly> recordList = recordPage.getList();
+        //新建树形列表集合
+        List<ProjectPaymentTreeData> projectRecordTreeDataList = new ArrayList<>();
+        if(recordList.size()>0){
+            for (ProjectImplementEarly record:recordList) {
+                //将项目信息放入树形列表集合中
+                ProjectPaymentTreeData recordTreeData = new ProjectPaymentTreeData();
+                //将界面需要展示数据放入类中
+                recordTreeData.setId(record.getId());
+                recordTreeData.setCnumber(record.getProjectId());
+                recordTreeData.setProjectName(record.getProjectName());
+                recordTreeData.setProjectId(record.getProjectId());
+                recordTreeData.setCreateDate(record.getCreateDate());
+                recordTreeData.setCreateId(record.getCreateBy().getId());
+                recordTreeData.setContractName(record.getContractName());
+                //父节点的pid设置为0
+                recordTreeData.setPid("0");
+                //将项目设置为第一级数据
+                recordTreeData.setCondition(1);
+                //将项目信息放入
+                projectRecordTreeDataList.add(recordTreeData);
+
+
+                //处理合同信息数据
+                ConstructionContract conditionContract = new ConstructionContract();
+                conditionContract.setProjectId(record.getId());
 
-            //将界面需要展示数据放入类中
-            projectPaymentTreeData.setId(contract.getId());
-            projectPaymentTreeData.setCnumber(contract.getCnumber());
-            projectPaymentTreeData.setProjectName(contract.getProjectName());
-            projectPaymentTreeData.setProjectId(contract.getProjectId());
-            projectPaymentTreeData.setCreateDate(contract.getCreateDate());
-            projectPaymentTreeData.setCreateId(contract.getCreateBy().getId());
-            projectPaymentTreeData.setContractName(contract.getContractName());
-            //父节点的pid设置为0
-            projectPaymentTreeData.setPid("0");
-            //Set转List
-            List<String> masterIdList = new ArrayList<>(masterIdSet);
-            //如果当前登录人为合同创建人则允许其添加子节点信息
-            for (String masterId : masterIdList) {
-                if(masterId.equals(UserUtils.getUser().getId())){
-                    projectPaymentTreeData.setOperationSign(1);
-                    break;
-                }else{
-                    projectPaymentTreeData.setOperationSign(0);
+                if(StringUtils.isNotBlank(constructionContract.getContractName())){
+                    conditionContract.setContractName(constructionContract.getContractName());
                 }
-            }
+                //获取合同信息
+                List<ConstructionContract> contractList = contractService.getConstructionContractList(conditionContract);
+                if(contractList.size()>0){
+                    //遍历项目中的合同信息
+                    for (ConstructionContract contract:contractList) {
+                        //将合同信息放入树形列表集合中
+                        ProjectPaymentTreeData contractTreeData = new ProjectPaymentTreeData();
+                        contractTreeData.setId(contract.getId());
+                        contractTreeData.setCnumber(contract.getCnumber());
+                        contractTreeData.setProjectName(contract.getProjectName());
+                        contractTreeData.setProjectId(contract.getProjectId());
+                        contractTreeData.setCreateDate(contract.getCreateDate());
+                        contractTreeData.setCreateId(contract.getCreateBy().getId());
+                        contractTreeData.setContractName(contract.getContractName());
+                        //父节点的pid设置为0
+                        contractTreeData.setPid(record.getId());
+                        //将项目设置为第二级数据
+                        contractTreeData.setCondition(2);
+
+                        //遍历项目负责人信息
+                        List<User> masterUserList = record.getProjectLeaders();
+                        List<String> masterList = new ArrayList<>();
+                        Set masterIdSet = new HashSet();
+                        for (User masterUser:masterUserList) {
+                            masterList.add(masterUser.getName());
+                            masterIdSet.add(masterUser.getId());
+                        }
+                        //Set转List
+                        List<String> masterIdList = new ArrayList<>(masterIdSet);
+                        for (String masterId : masterIdList) {
+                            if(masterId.equals(UserUtils.getUser().getId())){
+                                contractTreeData.setOperationSign(1);
+                                break;
+                            }else{
+                                contractTreeData.setOperationSign(0);
+                            }
+                        }
+
+                        //将项目信息放入
+                        projectRecordTreeDataList.add(contractTreeData);
+
 
-            //项目负责人list数据转String
-            String projectLeader = masterList.toString().replaceAll("(?:\\[|null|\\]| +)", "");
-            projectPaymentTreeData.setProjectLeader(projectLeader);
-            projectPaymentTreeData.setLoginId(UserUtils.getUser().getId());
-            projectRecordTreeDataList.add(projectPaymentTreeData);
-
-            //根据项目id查询相关的项目阶段内容
-            List<ProjectPaymentTreeData> treeDataList = service.findPage(contract.getId());
-            if(0 != treeDataList.size()){
-                //截至上期末
-                Double totalFinishCost = 0D;  //累计完成价款
-                Double totalPayCost = 0D;     //累计支付价款
-                Double payRatio = 0D;         //支付比例
-
-                for (ProjectPaymentTreeData data:treeDataList) {
-                    data.setCnumber(contract.getTrueAmt().toString());
-
-                    data.setTotalFinishCost(totalFinishCost);
-                    data.setTotalPayCost(totalPayCost);
-                    data.setPayRatio(payRatio);
-                    //截止上期末的已累计完成价款 = 之前所有的加上本期的完成价款
-                    totalFinishCost += data.getCompletePrice();
-                    //截止上期末的累计支付价款 = 之前所有的加上本期的支付价款
-                    totalPayCost += data.getActualPay();
-                    //判定截止上期末的已累计完成价款是否为0 如果不为0 则进行计算支付比例
-                    if(contract.getTrueAmt() !=0){
-                        payRatio = formatDouble(totalFinishCost/contract.getTrueAmt()*100);
-                    }
 
-                    //截至本期末数据信息
-                    data.setNowTotalFinishCost(totalFinishCost);
-                    data.setNowTotalPayCost(totalPayCost);
-                    data.setNowPayRatio(payRatio);
+                        //处理合同中的工程进度款信息数据
+                        List<ProjectPaymentTreeData> treeDataList = service.findPage(contract.getId());
+                        if(0 != treeDataList.size()){
+                            //截至上期末
+                            Double totalFinishCost = 0D;  //累计完成价款
+                            Double totalPayCost = 0D;     //累计支付价款
+                            Double payRatio = 0D;         //支付比例
 
-                    data.setPid(contract.getId());
+                            for (ProjectPaymentTreeData data:treeDataList) {
+                                data.setCnumber(contract.getTrueAmt().toString());
 
-                    //如果当前登录人为项目登记者或项目负责人则允许其添加子节点信息
-                    for (String masterId : masterIdList) {
-                        if(masterId.equals(UserUtils.getUser().getId())){
-                            data.setOperationSign(1);
-                            break;
-                        }else{
-                            data.setOperationSign(0);
+                                data.setTotalFinishCost(totalFinishCost);
+                                data.setTotalPayCost(totalPayCost);
+                                data.setPayRatio(payRatio);
+                                //截止上期末的已累计完成价款 = 之前所有的加上本期的完成价款
+                                totalFinishCost += data.getCompletePrice();
+                                //截止上期末的累计支付价款 = 之前所有的加上本期的支付价款
+                                totalPayCost += data.getActualPay();
+                                //判定截止上期末的已累计完成价款是否为0 如果不为0 则进行计算支付比例
+                                if(contract.getTrueAmt() !=0){
+                                    payRatio = formatDouble(totalFinishCost/contract.getTrueAmt()*100);
+                                }
+
+                                //截至本期末数据信息
+                                data.setNowTotalFinishCost(totalFinishCost);
+                                data.setNowTotalPayCost(totalPayCost);
+                                data.setNowPayRatio(payRatio);
+
+                                data.setPid(contract.getId());
+                                //将项目设置为第三级数据
+                                data.setCondition(3);
+
+                                //如果当前登录人为项目登记者或项目负责人则允许其添加子节点信息
+                                for (String masterId : masterIdList) {
+                                    if(masterId.equals(UserUtils.getUser().getId())){
+                                        data.setOperationSign(1);
+                                        break;
+                                    }else{
+                                        data.setOperationSign(0);
+                                    }
+                                }
+                            }
+                            //将所有工程进度款信息券放入树形列表中
+                            projectRecordTreeDataList.addAll(treeDataList);
                         }
                     }
                 }
 
             }
-            projectRecordTreeDataList.addAll(treeDataList);
-
         }
 
         map.put("data",projectRecordTreeDataList);
@@ -193,9 +229,16 @@ public class ProjectInterimPaymentController {
     public String form(ProjectPaymentTreeData projectPaymentTreeData,Model model) {
         if (projectPaymentTreeData!=null&&StringUtils.isNotBlank(projectPaymentTreeData.getId())) {
             projectPaymentTreeData = service.get(projectPaymentTreeData.getId());
+            projectPaymentTreeData.setMasterUser(UserUtils.get(projectPaymentTreeData.getCreateBy().getId()).getName());
+            WorkClientAttachment attchment = new WorkClientAttachment();
+            attchment.setAttachmentId(projectPaymentTreeData.getId());
+            List<WorkClientAttachment> attachments = workClientAttachmentDao.findList(attchment);
+            projectPaymentTreeData.setWorkAttachments(attachments);
+
         }else {
             projectPaymentTreeData.setCreateBy(UserUtils.getUser());
             projectPaymentTreeData.setCreateDate(new Date());
+            projectPaymentTreeData.setMasterUser(UserUtils.getUser().getName());
         }
         model.addAttribute("projectPaymentTreeData", projectPaymentTreeData);
         return "modules/projectrecord/implementStage/projectInterimPaymentForm";

+ 23 - 0
src/main/resources/mappings/modules/constructionContract/contractDao.xml

@@ -193,6 +193,29 @@
 		</choose>
 	</select>
 
+	<select id="getConstructionContractList" resultType="com.jeeplus.modules.projectConstruction.entity.ConstructionContract" >
+		SELECT
+		pr.project_name as 'projectName',
+		sd.label as 'contCate',
+		<include refid="workContentContractinfoColumns"/>
+		FROM construction_contract a
+		left join sys_dict sd on sd.value = a.cont_cate
+		left join project_records pr on pr.id = a.project_id
+		<where>
+			a.del_flag = 0
+			<if test="contractName != null and contractName !=''">
+				AND a.contract_name LIKE concat('%',#{contractName},'%')
+			</if>
+			<if test="cnumber != null and cnumber != ''">
+				AND a.cnumber like concat('%',#{cnumber},'%')
+			</if>
+			<if test="projectId != null and projectId != ''">
+				AND a.project_id = #{projectId}
+			</if>
+		</where>
+		ORDER BY a.update_date DESC
+	</select>
+
 	<select id="queryCount" resultType="int" >
 		SELECT
 		count(1)

+ 8 - 4
src/main/resources/mappings/modules/projectrecord/implementStage/ProjectInterimPaymentDao.xml

@@ -16,7 +16,8 @@
 		a.advance_deduct as "advanceDeduct",
 		a.rests_deduct as "restsDeduct",
 		a.actual_pay as "actualPay",
-		a.contract_id as "contractId"
+		a.contract_id as "contractId",
+		a.pay_date as "payDate"
 	</sql>
 	
     
@@ -63,7 +64,8 @@
   			advance_deduct,
   			rests_deduct,
   			actual_pay,
-  			contract_id
+  			contract_id,
+  			pay_date
 		) VALUES (
 			#{id},
 			#{createBy.id},
@@ -78,7 +80,8 @@
 			#{advanceDeduct},
 			#{restsDeduct},
 			#{actualPay},
-			#{contractId}
+			#{contractId},
+			#{payDate}
 		)
 	</insert>
 	
@@ -92,7 +95,8 @@
   			appoint_pay = #{appointPay},
   			advance_deduct = #{advanceDeduct},
   			rests_deduct = #{restsDeduct},
-  			actual_pay = #{actualPay}
+  			actual_pay = #{actualPay},
+  			pay_date = #{payDate}
 		WHERE id = #{id}
 	</update>
 	

+ 123 - 0
src/main/webapp/webpage/modules/projectrecord/implementStage/projectInterimPaymentForm.jsp

@@ -50,8 +50,54 @@
                     }
                 }
             });
+            laydate.render({
+                elem: '#payDate',
+                event: 'focus',
+                type : 'date'
+            });
 
         });
+
+        function insertTitle(tValue){
+            var files = $("#attachment_file")[0].files;            for(var i = 0;i<files.length;i++) {                var file = files[i];
+                var attachmentId = $("#id").val();
+                var attachmentFlag = "135";
+                /*console.log(file);*/
+                var timestamp=new Date().getTime();
+
+                var storeAs = "attachment-file/projectRecords/"+timestamp+"/"+file['name'];
+                var uploadPath="http://gangwan-app.oss-cn-hangzhou.aliyuncs.com/"+storeAs;/*将这段字符串存到数据库即可*/
+                var divId = "_attachment";
+                $("#addFile"+divId).show();
+                multipartUploadWithSts(storeAs, file,attachmentId,attachmentFlag,uploadPath,divId,0);}
+        }
+
+
+        function addFile() {
+            $("#attachment_file").click();
+        }
+
+        function addRow(list, idx, tpl, row){
+            bornTemplete(list, idx, tpl, row, idx);
+        }
+
+        function bornTemplete(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");
+                    }
+                }
+            });
+        }
     </script>
 </head>
 <body>
@@ -95,6 +141,83 @@
                         <form:input path="actualPay" htmlEscape="false"    class="form-control layui-input required number"/>
                     </div>
                 </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 class="laydate-icondate layui-input form-control layer-date laydate-icon required" id="payDate" name="payDate" value="${projectPaymentTreeData.payDate}">
+                </div>
+            </div>
+
+                <div class="layui-item layui-col-sm6">
+                    <label class="layui-form-label">登记人</label>
+                    <div class="layui-input-block">
+                        <input class="form-control layui-input" readonly="readonly" id="masterUser" name="masterUser" value="${projectPaymentTreeData.masterUser}">
+                    </div>
+                </div>
+            </div>
+            <div class="form-group layui-row">
+                <div class="form-group-label"><h2>附件信息</h2></div>
+                <div class="layui-item nav-btns">
+                    <a id="attachment_btn" class="nav-btn nav-btn-add" title="添加附件"  onclick="addFile()"><i class="fa fa-plus"></i>&nbsp;添加附件</a>
+                </div>
+                <div id="addFile_attachment" style="display: none" class="upload-progress">
+                    <span id="fileName_attachment" ></span>
+                    <b><span id="baifenbi_attachment" ></span></b>
+                    <div class="progress">
+                        <div id="jindutiao_attachment" class="progress-bar" style="width: 0%" aria-valuenow="0">
+                        </div>
+                    </div>
+                </div>
+                <input id="attachment_file" type="file" name="attachment_file" multiple="multiple" style="display: none;" onChange="if(this.value)insertTitle(this.value);"/>
+                <span id="attachment_title"></span>
+                <div class="layui-item layui-col-xs12 form-table-container">
+                    <table id="listAttachment" class="table table-bordered table-condensed details">
+                        <thead>
+                        <tr>
+                                <%-- <th>序号</th>--%>
+                            <th width="25%">文件</th>
+                            <th width="25%">上传人</th>
+                            <th width="25%">上传时间</th>
+                            <th width="150px">操作</th>
+                        </tr>
+                        </thead>
+                        <tbody id="file_attachment">
+                        <c:forEach items="${projectPaymentTreeData.workAttachments}" var = "workClientAttachment" varStatus="status">
+                            <tr class="trIdAdds">
+                                    <%-- <td>${status.index + 1}</td>--%>
+                                <c:choose>
+                                    <c:when test="${fn:containsIgnoreCase(workClientAttachment.attachmentName,'jpg')
+                                                           or fn:containsIgnoreCase(workClientAttachment.attachmentName,'png')
+                                                           or fn:containsIgnoreCase(workClientAttachment.attachmentName,'gif')
+                                                           or fn:containsIgnoreCase(workClientAttachment.attachmentName,'bmp')
+                                                           or fn:containsIgnoreCase(workClientAttachment.attachmentName,'jpeg')}">
+                                        <td><img src="${workClientAttachment.url}" width="50" height="50" onclick="openDialogView('预览','${ctx}/sys/picturepreview/picturePreview?url=${workClientAttachment.url}','90%','90%')" alt="${workClientAttachment.attachmentName}">
+                                    </c:when>
+                                    <c:otherwise>
+                                        <c:choose>
+                                            <c:when test="${fn:containsIgnoreCase(workClientAttachment.attachmentName,'pdf')}">
+                                                <td><a class="attention-info" href="javascript:void(0)" onclick="preview('预览','${workClientAttachment.url}','90%','90%','1')">${workClientAttachment.attachmentName}</a></td>
+                                            </c:when>
+                                            <c:otherwise>
+                                                <td><a class="attention-info" href="javascript:void(0)" onclick="preview('预览','${workClientAttachment.url}','90%','90%')">${workClientAttachment.attachmentName}</a></td>
+                                            </c:otherwise>
+                                        </c:choose>
+                                    </c:otherwise>
+                                </c:choose>
+                                <td>${workClientAttachment.createBy.name}</td>
+                                <td><fmt:formatDate value="${workClientAttachment.createDate}" type="both"/></td>
+                                <td class="op-td">
+                                    <div class="op-btn-box" >
+                                        <a href="javascript:location.href='${ctx}/workfullmanage/workFullManage/downLoadAttach?file='+encodeURIComponent(encodeURIComponent('${workClientAttachment.url}'));" class="op-btn op-btn-download"><i class="fa fa-download"></i>&nbsp;下载</a>
+                                        <a href="javascript:void(0)" onclick="deleteFileFromAliyun(this,'${ctx}/sys/workattachment/deleteFileFromAliyun?url=${workClientAttachment.url}&id=${workClientAttachment.id}&type=2','addFile')" class="op-btn op-btn-delete" ><i class="fa fa-trash"></i>&nbsp;删除</a>
+                                    </div>
+                                </td>
+                            </tr>
+                        </c:forEach>
+                        </tbody>
+                    </table>
+                </div>
             </div>
         </form:form>
     </div>

+ 35 - 54
src/main/webapp/webpage/modules/projectrecord/implementStage/projectInterimPaymentList.jsp

@@ -201,10 +201,16 @@
 					<input id="pageSize" name="pageSize" type="hidden" value="${page.pageSize}"/>
 					<table:sortColumn id="orderBy" name="orderBy" value="${page.orderBy}" callback="sortOrRefresh();"/><!-- 支持排序 -->
 					<div class="commonQuery lw6">
-						<div class="layui-item query athird ">
+						<div class="layui-item query athird">
+							<label class="layui-form-label">项目名称:</label>
+							<div class="layui-input-block">
+								<form:input path="projectName" htmlEscape="false" maxlength="255"  class=" form-control layui-input"/>
+							</div>
+						</div>
+						<div class="layui-item query athird">
 							<label class="layui-form-label">合同名称:</label>
 							<div class="layui-input-block">
-								<input type="text" id="contractName" name="contractName" value="${contractName}" htmlEscape="false" maxlength="255"  class=" form-control layui-input">
+								<form:input path="contractName" htmlEscape="false" maxlength="255"  class=" form-control layui-input"/>
 							</div>
 						</div>
 						<div class="layui-item athird">
@@ -272,6 +278,10 @@
         	if(undefined == contractName){
 				contractName = "";
 			}
+        	var projectName = $("#projectName").val();
+        	if(undefined == projectName){
+				projectName = "";
+			}
             layer.load(2);
             treetable.render({
                 treeColIndex: 1,//树形图标显示在第几列
@@ -281,23 +291,27 @@
                 treeDefaultClose: true,//是否默认折叠
                 treeLinkage: true,//父级展开时是否自动展开所有子级
                 elem: '#permissionTable',
-                url: '${ctx}/project/projectInterimPayment/getProjectList?projectId=${constructionContract.projectId}&pageNo=${page.pageNo}&contractName='+contractName,
+                url: '${ctx}/project/projectInterimPayment/getProjectList?pageNo=${page.pageNo}&contractName='+contractName+'&projectName='+projectName,
                 page: false,
                 cols: [
 					[
 						{rowspan: 2, type: 'numbers', align:'center', title: '序号' ,width:40},
-						{rowspan: 2, field: 'cnumber', align:'center' , width:200, title: '合同编号/签约合同价款',templet:function(d){
-								if(0 == d.pid){
+						{rowspan: 2, field: 'cnumber', align:'center' , width:200, title: '项目编号/实施合同编号',templet:function(d){
+								if(d.condition ==1){
 									return "<font>"+d.cnumber+"</font>";
-								}else{
+								}else if(d.condition == 2){
 									return "<font>"+d.cnumber+"</font>";
+								}else {
+									return "";
 								}
 							}},
-						{rowspan: 2, field: 'contractName', align:'center' , width:200, title: '合同名称',templet:function(d){
-								if(0 == d.pid){
+						{rowspan: 2, field: 'contractName', align:'center' , width:300, title: '项目名称/实施合同名称/签约合同价款',templet:function(d){
+								if(d.condition ==1){
+									return  "<a class=\"attention-info pid\" title=\"" + d.projectName + "\" href=\"javascript:void(0);\" onclick=\"openDialogView('查看合同信息', '${ctx}/project/constructionContract/view?id=" + d.id +"','95%', '95%')\">" + d.projectName + "</a>";
+								}else if(d.condition == 2){
 									return  "<a class=\"attention-info pid\" title=\"" + d.contractName + "\" href=\"javascript:void(0);\" onclick=\"openDialogView('查看合同信息', '${ctx}/project/constructionContract/view?id=" + d.id +"','95%', '95%')\">" + d.contractName + "</a>";
 								}else{
-									return "";
+									return "<font>"+d.cnumber+"</font>";
 								}
 							}},
 						{ colspan: 3, title: '截至上期末'},
@@ -306,7 +320,9 @@
 						{ rowspan: 2, field: 'createDate', align:'center', title: '登记日期',width:100,templet: function(d){
 							var date=d.createDate;
 							date=date.replace(new RegExp(/-/gm) ,"/");
-							if(0 == d.pid){
+							if(d.condition ==1){
+								return "";
+							}else if(d.condition == 2){
 								return "";
 							}else{
 								return "<font>"+layui.util.toDateString(date,'yyyy-MM-dd')+"</font>";
@@ -353,58 +369,23 @@
 
 
         function complain(d){//操作中显示的内容
-			if(d.pid=="0") {
-				if(1 == d.operationSign) {
-					return [
-						'<a href="javascript:void(0)" onclick="openDialogreAudit(\'新增\', \'${ctx}/project/projectInterimPayment/form?contractId='+d.id+'\',\'70%\',\'65%\')" style=\"color: white;background: darkseagreen\" class="op-btn op-btn-add" ><i class="fa fa-plus"></i> 新增</a>',
-					].join('');
-				}else{
+			if(d.condition ==1) {
 					return [
 						'',
 					].join('');
-				}
-			} else if (d.pid!="0"){
+			} else if (d.condition ==2){
 
-				/*if(1 == d.operationSign) {
-
-					if(d.status == 1){
-						return [
-							'<a href="javascript:void(0)" onclick="openDialogres(\'修改报告\', \'${ctx}/projectcontentinfo/projectcontentinfo/form?view=report&condition=according&flag=edit&dictType=${dictType}&reportType=${reportType}&id='+d.contentPId+'&parentIds=${parentIds}&projectReportData.id='+d.reportId+'\',\'95%\',\'95%\')" class="op-btn op-btn-edit" ><i class="fa fa-edit"></i> 修改</a>',
-							'<a href="${ctx}/projectcontentinfo/projectcontentinfo/delete?infoId='+d.reportId+'&condition=according&id='+d.contentPId+'&type=8" onclick="return confirmxRefresh(\'确认要删除该工作内容报告吗?\', this.href)"   class="op-btn op-btn-delete"><i class="fa fa-trash"></i> 删除</a>',
-						].join('');
-					}else if(d.status == 2){
-						return [
-							'<a href="${ctx}/projectcontentinfo/projectcontentinfo/cancelInvalidate?infoId='+d.reportId+'&id='+d.contentPId+'&type=8" onclick="return confirmxRefresh(\'确认要撤回该工作内容报告吗?\', this.href)"   class="op-btn op-btn-cancel"><i class="glyphicon glyphicon-share-alt"></i> 撤回</a>',
-						].join('');
-					}else if(d.status == 3){
-						return [
-							'<a href="javascript:void(0)" onclick="openDialogreAudit(\'修改报告\', \'${ctx}/projectcontentinfo/projectcontentinfo/form?view=report&condition=according&flag=edit&dictType=${dictType}&reportType=${reportType}&id='+d.contentPId+'&parentIds=${parentIds}&projectReportData.id='+d.reportId+'&projectId='+d.projectId+ '\',\'95%\',\'95%\')" class="op-btn op-btn-edit" ><i class="fa fa-edit"></i> 修改</a>',
-							'<a href="${ctx}/projectcontentinfo/projectcontentinfo/delete?infoId='+d.reportId+'&condition=according&id='+d.contentPId+'&type=8" onclick="return confirmxRefresh(\'确认要删除该工作内容报告吗?\', this.href)"   class="op-btn op-btn-delete"><i class="fa fa-trash"></i> 删除</a>',
-						].join('');
-					}else if(d.status == 4){
-						return [
-							'<a href="javascript:void(0)" onclick="openDialogreAudit(\'修改报告\', \'${ctx}/projectcontentinfo/projectcontentinfo/form?view=reportModify&flag=edit&condition=according&dictType=${dictType}&reportType=${reportType}&id='+d.contentPId+'&parentIds=${parentIds}&projectReportData.id='+d.reportId+'&projectId='+d.projectId+ '\',\'95%\',\'95%\')" class="op-btn op-btn-edit" ><i class="fa fa-edit"></i> 修改</a>',
-							'<a href="${ctx}/projectcontentinfo/projectcontentinfo/delete?infoId='+d.reportId+'&condition=according&id='+d.contentPId+'&type=8" onclick="return confirmxRefresh(\'确认要删除该工作内容报告吗?\', this.href)"   class="op-btn op-btn-delete"><i class="fa fa-trash"></i> 删除</a>',
-						].join('');
-					}else if(d.status == 5){
-						return [
-							/!*'<a href="javascript:void(0)" onclick="openDialogres(\'报告作废\', \'${ctx}/projectcontentinfo/projectcontentinfo/form?view=reportInvalid&dictType=${dictType}&id='+d.contentPId+'&parentIds=${parentIds}&projectReportData.id='+d.reportId+'\',\'95%\',\'95%\')" class="op-btn op-btn-invalid" ><i class="fa fa-trash-o"></i> 作废</a>',*!/
-						].join('');
-					}else if(d.status == null || d.status == '' || d.status == 10){
-						return [
-							'<a href="javascript:void(0)" onclick="openDialogres(\'复核\', \'${ctx}/project/projectEarlyReview/reviewForm?view=report&condition=according&dictType='+d.dictType+'&reportType=${reportType}&project.id='+d.pid+'&id='+d.contentPId+'&parentIds='+d.parentIds+'&infoId='+d.id+'&projectId='+d.projectId+ '\',\'95%\',\'95%\')" class="op-btn op-btn-edit" ><i class="fa fa-plus"></i> 复核</a>',
-						].join('');
-					}else{
-						return[''].join('');
-					}
-				}else{
+				if(1 == d.operationSign) {
 					return [
-						'',
+						'<a href="javascript:void(0)" onclick="openDialogreAudit(\'新增\', \'${ctx}/project/projectInterimPayment/form?contractId='+d.id+'\',\'90%\',\'90%\')" style=\"color: white;background: darkseagreen\" class="op-btn op-btn-add" ><i class="fa fa-plus"></i> 新增</a>',
 					].join('');
-				}*/
+				}else{
+					return[''].join('');
+				}
+			} else if (d.condition ==3){
 				if(1 == d.operationSign) {
 					return [
-						'<a href="javascript:void(0)" onclick="openDialogreAudit(\'修改信息\', \'${ctx}/project/projectInterimPayment/form?id='+d.id+'\',\'95%\',\'95%\')" class="op-btn op-btn-edit" ><i class="fa fa-edit"></i> 修改</a>',
+						'<a href="javascript:void(0)" onclick="openDialogreAudit(\'修改信息\', \'${ctx}/project/projectInterimPayment/form?id='+d.id+'\',\'90%\',\'90%\')" class="op-btn op-btn-edit" ><i class="fa fa-edit"></i> 修改</a>',
 						'<a href="${ctx}/project/projectInterimPayment/delete?id='+d.id+'" onclick="return confirmx(\'确认要删除该工程进度款记录吗?\', this.href)"   class="op-btn op-btn-delete"><i class="fa fa-trash"></i> 删除</a>',
 					].join('');
 				}else{

+ 43 - 38
src/main/webapp/webpage/modules/projectrecord/implementStage/projectVisaList.jsp

@@ -160,11 +160,17 @@
     <div class="layui-row">
         <div class="full-width fl">
             <div class="layui-row contentShadow shadowLR" id="queryDiv">
-                <form:form id="searchForm" modelAttribute="constructionContract" action="${ctx}/project/constructionContract/list" method="post" class="form-inline">
+                <form:form id="searchForm" modelAttribute="constructionContract" action="${ctx}/project/projectVisa/list" method="post" class="form-inline">
                     <input id="pageNo" name="pageNo" type="hidden" value="${page.pageNo}"/>
                     <input id="pageSize" name="pageSize" type="hidden" value="${page.pageSize}"/>
                     <div class="commonQuery lw14">
                         <div class="layui-item query athird">
+                            <label class="layui-form-label">项目名称:</label>
+                            <div class="layui-input-block">
+                                <form:input path="projectName" htmlEscape="false" maxlength="255"  class=" form-control layui-input"/>
+                            </div>
+                        </div>
+                        <div class="layui-item query athird">
                             <label class="layui-form-label">合同名称:</label>
                             <div class="layui-input-block">
                                 <form:input path="contractName" htmlEscape="false" maxlength="255"  class=" form-control layui-input"/>
@@ -180,7 +186,7 @@
                         </div>
                         <div style="    clear:both;"></div>
                     </div>
-                    <div id="moresees" style="clear:both;display:none;" class="lw14">
+                    <%--<div id="moresees" style="clear:both;display:none;" class="lw14">
                         <div class="layui-item query athird">
                             <label class="layui-form-label">创建时间:</label>
                             <div class="layui-input-block">
@@ -193,7 +199,7 @@
                                 </input>
                             </div>
                         </div>
-                    </div>
+                    </div>--%>
                 </form:form>
             </div>
         </div>
@@ -246,13 +252,12 @@
         // 渲染表格
         var renderTable = function () {
             var projectName = $("#projectName").val();
-            var workContractInfoName = $("#workContractInfoName").val();
-            var workContractInfoClientName = $("#workContractInfoClientName").val();
-            if(undefined == workContractInfoName){
-                workContractInfoName = "";
+            if(undefined == projectName){
+                projectName = "";
             }
-            if(undefined == workContractInfoClientName){
-                workContractInfoClientName = "";
+            var contractName = $("#contractName").val();
+            if(undefined == contractName){
+                contractName = "";
             }
             layer.load(2);
             treetable.render({
@@ -263,33 +268,41 @@
                 treeDefaultClose: true,//是否默认折叠
                 treeLinkage: true,//父级展开时是否自动展开所有子级
                 elem: '#permissionTable',
-                url: '${ctx}/project/projectVisa/getVisaList?pageNo=${page.pageNo}',
+                url: '${ctx}/project/projectVisa/getVisaList?pageNo=${page.pageNo}&projectName='+projectName+'&contractName='+contractName,
                 page: false,
                 cols: [[
                     {type: 'numbers', align:'center', title: '序号' ,width:80},
-                    {field: 'contractName', title: '合同编号',templet:function(d){
-                            if(0 == d.pid){
+                    {field: 'cnumber', title: '项目编号/合同编号',templet:function(d){
+                            if(d.condition ==1){
+                                return "<font>"+d.cnumber+"</font>";
+                            }else if(d.condition ==2){
                                 return "<font>"+d.cnumber+"</font>";
                             }else{
                                 return "<font>"+d.cnumber+"</font>";
                             }
                         }},
-                    {field: 'contractName', title: '合同名称/签证编号',templet:function(d){
-                            if(0 == d.pid){
+                    {field: 'contractName', title: '项目名称/合同名称/签证编号',templet:function(d){
+                            if(d.condition ==1){
+                                return  "<a class=\"attention-info pid\" title=\"" + d.contractName + "\" href=\"javascript:void(0);\" onclick=\"openDialogView('查看合同信息', '${ctx}/project/constructionContract/view?id=" + d.projectId +"','95%', '95%')\">" + d.contractName + "</a>";
+                            }else if(d.condition ==2){
                                 return  "<a class=\"attention-info pid\" title=\"" + d.contractName + "\" href=\"javascript:void(0);\" onclick=\"openDialogView('查看合同信息', '${ctx}/project/constructionContract/view?id=" + d.contractId +"','95%', '95%')\">" + d.contractName + "</a>";
                             }else{
                                 return "<a class=\"attention-info\" href=\"javascript:void(0)\" onclick=\"openDialogView('查看签证内容', '${ctx}/project/projectVisa/view?id="+d.id+"','95%', '95%')\">" + d.number + "</a>";
                             }
                         }},
                     {field: 'sendMoney', align:'center', title: '送审金额',templet: function(d){
-                            if(0 == d.pid){
+                            if(d.condition ==1){
+                                return "";
+                            }else if(d.condition ==2){
                                 return "";
                             }else{
                                 return "<font>"+d.sendMoney+"</font>";
                             }
                         }},
                     {field: 'confirmMoney', align:'center', title: '定审金额',templet: function(d){
-                            if(0 == d.pid){
+                            if(d.condition ==1){
+                                return "";
+                            }else if(d.condition ==2){
                                 return "";
                             }else{
                                 return "<font>"+d.confirmMoney+"</font>";
@@ -299,30 +312,14 @@
                             var date=d.date;
                             /*date=date.replace(new RegExp(/-/gm) ,"/");*/
 
-                            if(0 == d.pid){
+                            if(d.condition ==1){
+                                return "<font style = 'font-size:14px;font-weight:500;'>"+layui.util.toDateString(date,'yyyy-MM-dd')+"</font>";
+                            }else if(d.condition ==2){
                                 return "<font style = 'font-size:14px;font-weight:500;'>"+layui.util.toDateString(date,'yyyy-MM-dd')+"</font>";
                             }else{
                                 return "<font>"+layui.util.toDateString(date,'yyyy-MM-dd')+"</font>";
                             }
                         }},
-                    /*{align:'center', title: '状态',  width:70,templet:function(d){
-                            var st = getAuditState(""+d.projectStatus);
-                            if(d.pid ==0){
-                                if(st.action)
-                                    var xml = "<span onclick=\"openDialogView('流程追踪', '${ctx}/project/projectRecords/getProcess?id=" + d.id + "','95%','95%')\" class=\"status-label status-label-" + st.label + "\" >" + st.status + "</span>";
-								else
-									var xml = "<span style=\"cursor:default;\" class=\"status-label status-label-" + st.label + "\" >" + st.status + "</span>";
-								return xml;
-							}else if(d.pid !=0){
-								if(st.action)
-									var xml = "<span onclick=\"openDialogView('流程追踪', '${ctx}/projectcontentinfo/projectcontentinfo/getProcessOne?id=" + d.id + "&projectReportData.id="+ d.id + "&type="+d.projectStatus+"','95%','95%')\" class=\"status-label status-label-" + st.label + "\" >" + st.status + "</span>";
-								else
-									var xml = "<span style=\"cursor:default;\" class=\"status-label status-label-" + st.label + "\" >" + st.status + "</span>";
-								return xml;
-							}else{
-								return '';
-							}
-						}},*/
                     {templet: complain, align:'center', title: '操作',width:130}
                 ]],
                 done: function () {
@@ -348,17 +345,25 @@
 
 
         function complain(d){//操作中显示的内容
-            if(d.pid=="0") {
+            if(d.condition ==1) {
+                return [
+                    '',
+                ].join('');
+            } else if(d.condition ==2) {
                 return [
                     '<a href="javascript:void(0)" onclick="openDialogreAudit(\'新增工作内容\', \'${ctx}/project/projectVisa/form?type=1&contractId='+d.contractId+' \',\'95%\',\'95%\')" style=\"color: white;background: darkseagreen\" class="op-btn op-btn-add" ><i class="fa fa-plus"></i> 新增</a>',
                 ].join('');
-            } else if (d.pid!="0"){
+            } else if (d.condition ==3){
                 return [
                     '<a href="javascript:void(0)" onclick="openDialogreAudit(\'修改工作内容\', \'${ctx}/project/projectVisa/updateTable?type=1&id='+d.id+'&contractId='+d.contractId+'\',\'95%\',\'95%\')" class="op-btn op-btn-edit" ><i class="fa fa-edit"></i> 编辑</a>',
                     '<a href="${ctx}/project/projectVisa/delete?type=1&id='+d.id+'" onclick="return confirmxRefresh(\'确认要删除该签证汇总表吗?\', this.href)"   class="op-btn op-btn-delete"><i class="fa fa-trash"></i> 删除</a>',
                 ].join('');
 
-                }
+            }else{
+                return [
+                    '',
+                ].join('');
+            }
 
         }
         //监听工具条