ソースを参照

Merge remote-tracking branch 'origin/master'

user7 4 年 前
コミット
6f25df2a2d

+ 54 - 10
src/main/java/com/jeeplus/modules/projectConstruction/web/ContractController.java

@@ -27,6 +27,7 @@ import com.jeeplus.modules.projectcontentinfo.service.*;
 import com.jeeplus.modules.projectcontroltable.entity.ProjectControlTable;
 import com.jeeplus.modules.projectcontroltable.service.ProjectControlTableService;
 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.enums.ProjectStatusEnum;
@@ -42,6 +43,8 @@ import com.jeeplus.modules.sys.utils.DictUtils;
 import com.jeeplus.modules.sys.utils.UserUtils;
 import com.jeeplus.modules.workactivity.entity.Activity;
 import com.jeeplus.modules.workactivity.service.ActivityService;
+import com.jeeplus.modules.workclientinfo.dao.WorkClientAttachmentDao;
+import com.jeeplus.modules.workclientinfo.entity.WorkClientAttachment;
 import com.jeeplus.modules.workclientinfo.entity.WorkClientInfo;
 import com.jeeplus.modules.workclientinfo.entity.WorkClientLinkman;
 import com.jeeplus.modules.workclientinfo.service.WorkClientInfoService;
@@ -83,7 +86,11 @@ public class ContractController extends BaseController {
     @Autowired
     private ContractService contractService;
     @Autowired
+    private ProjectRecordsService projectRecordsService;
+    @Autowired
     private ProjectImplementEarlyService projectImplementEarlyService;
+    @Autowired
+    private WorkClientAttachmentDao workClientAttachmentDao;
 
     @ModelAttribute
     public ConstructionContract get(@RequestParam(required=false) String id) {
@@ -119,20 +126,47 @@ public class ContractController extends BaseController {
      * 跳转添加合同页面
      */
     @RequestMapping(value = "form")
-    public String form(ProjectRecords projectRecords, Model model) {
-        ConstructionContract constructionContract =  new ConstructionContract();
-        model.addAttribute("constructionContract", constructionContract);
-        /*if (projectRecords!=null&&StringUtils.isNotBlank(projectRecords.getId())) {
-            projectRecords = projectRecordsService.get(projectRecords.getId());
-            projectRecordsService.queryProjectDetail(projectRecords);
+    public String form(ConstructionContract constructionContract, Model model) {
+        if (constructionContract!=null&&StringUtils.isNotBlank(constructionContract.getId())) {
+            constructionContract = contractService.get(constructionContract.getId());
+            ProjectRecords projectRecords = projectRecordsService.get(constructionContract.getProjectId());
+            constructionContract.setProjectName(projectRecords.getProjectName());
+
+            WorkClientAttachment attchment = new WorkClientAttachment();
+            attchment.setAttachmentId(constructionContract.getId());
+            List<WorkClientAttachment> attachments = workClientAttachmentDao.findList(attchment);
+            constructionContract.setWorkAttachments(attachments);
         }else {
-            projectRecords.setCreateBy(UserUtils.getUser());
-            projectRecords.setCreateDate(new Date());
+            constructionContract.setCreateBy(UserUtils.getUser());
+            constructionContract.setCreateDate(new Date());
         }
-        model.addAttribute("projectRecords", projectRecords);*/
+        model.addAttribute("constructionContract", constructionContract);
         return "modules/projectConstruction/projectConstructionForm";
     }
 
+
+
+    /**
+     * 查看
+     * @param
+     * @param model
+     * @return
+     */
+    @RequiresPermissions(value={"project:constructionContract:view"})
+    @RequestMapping(value = "view")
+    public String view(ConstructionContract constructionContract, Model model) {
+        constructionContract = contractService.get(constructionContract.getId());
+        ProjectRecords projectRecords = projectRecordsService.get(constructionContract.getProjectId());
+        constructionContract.setProjectName(projectRecords.getProjectName());
+
+        WorkClientAttachment attchment = new WorkClientAttachment();
+        attchment.setAttachmentId(constructionContract.getId());
+        List<WorkClientAttachment> attachments = workClientAttachmentDao.findList(attchment);
+        constructionContract.setWorkAttachments(attachments);
+        model.addAttribute("constructionContract", constructionContract);
+        return "modules/projectConstruction/projectConstructionView";
+    }
+
     /**
      * 添加合同数据
      */
@@ -140,7 +174,7 @@ public class ContractController extends BaseController {
     @RequestMapping(value = "save")
     public String save(ConstructionContract constructionContract, Model model, RedirectAttributes redirectAttributes) {
         contractService.insertContract(constructionContract);
-        return "redirect:"+Global.getAdminPath()+"//project/constructionContract/?repage";
+        return "redirect:"+Global.getAdminPath()+"/project/constructionContract/?repage";
     }
 
     @RequestMapping("selectcontent")
@@ -152,4 +186,14 @@ public class ContractController extends BaseController {
         model.addAttribute("searchLabel",searchLabel);
         return "modules/sys/gridselectProjectList";
     }
+
+
+    /**
+     * 删除工程款信息
+     */
+    @RequestMapping(value = "delete")
+    public String delete(ConstructionContract constructionContract) {
+        contractService.delete(constructionContract);
+        return "redirect:"+ Global.getAdminPath()+"/project/constructionContract/?repage";
+    }
 }

+ 23 - 0
src/main/java/com/jeeplus/modules/projectrecord/dao/implementStage/ProjectInterimPaymentDao.java

@@ -0,0 +1,23 @@
+package com.jeeplus.modules.projectrecord.dao.implementStage;
+
+import com.jeeplus.common.persistence.CrudDao;
+import com.jeeplus.common.persistence.annotation.MyBatisDao;
+import com.jeeplus.modules.projectrecord.entity.ProjectPaymentTreeData;
+
+import java.util.List;
+
+/**
+ * 实施阶段-工程进度款管理Dao
+ * @author 徐滕
+ * @version 2020-07-28
+ */
+@MyBatisDao
+public interface ProjectInterimPaymentDao  extends CrudDao<ProjectPaymentTreeData> {
+
+    /**
+     * 根据合同id查询数据信息
+     * @param contractId
+     * @return
+     */
+    List<ProjectPaymentTreeData> projectPaymentFindList(String contractId);
+}

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

@@ -0,0 +1,219 @@
+package com.jeeplus.modules.projectrecord.entity;
+
+import com.jeeplus.common.persistence.DataEntity;
+
+import java.util.List;
+
+/**
+ * 工程进度款树形图实体类
+ * @author 徐滕
+ * @version 2020-07-28
+ */
+public class ProjectPaymentTreeData extends DataEntity<ProjectPaymentTreeData> {
+    private String projectId;		// 项目id
+    private String projectName;		// 项目名称
+    private String contractName;    //合同名称
+    private String cnumber;		    // 合同编号
+    private String contractId;		    // 合同id
+    private String projectLeader;   // 负责人
+
+    //截至上期末
+    private Double totalFinishCost;    //累计完成价款
+    private Double totalPayCost;    //累计支付价款
+    private Double payRatio;    //支付比例
+    //本期
+    private Double completePrice;   //完成价款
+    private Double appointPay;   //按约定比例应支付价款
+    private Double advanceDeduct;   //应扣预付款
+    private Double restsDeduct;   //其他应扣款
+    private Double actualPay;   //实际应支付
+
+    //截至本期末
+    private Double nowTotalFinishCost; //累计完成价款
+    private Double nowTotalPayCost;    //累计支付价款
+    private Double nowPayRatio;    //支付比例
+
+    private Double trueAmt;    //签约价款
+
+
+    private String pid;             // 父id
+    private String loginId;         //登陆者id
+    private String createId;        //创建者id
+    private Integer operationSign;   //操作标识
+
+    public String getProjectId() {
+        return projectId;
+    }
+
+    public void setProjectId(String projectId) {
+        this.projectId = projectId;
+    }
+
+    public String getProjectName() {
+        return projectName;
+    }
+
+    public void setProjectName(String projectName) {
+        this.projectName = projectName;
+    }
+
+    public String getContractName() {
+        return contractName;
+    }
+
+    public void setContractName(String contractName) {
+        this.contractName = contractName;
+    }
+
+    public String getCnumber() {
+        return cnumber;
+    }
+
+    public void setCnumber(String cnumber) {
+        this.cnumber = cnumber;
+    }
+
+    public String getProjectLeader() {
+        return projectLeader;
+    }
+
+    public void setProjectLeader(String projectLeader) {
+        this.projectLeader = projectLeader;
+    }
+
+    public Double getTotalFinishCost() {
+        return totalFinishCost;
+    }
+
+    public void setTotalFinishCost(Double totalFinishCost) {
+        this.totalFinishCost = totalFinishCost;
+    }
+
+    public Double getTotalPayCost() {
+        return totalPayCost;
+    }
+
+    public void setTotalPayCost(Double totalPayCost) {
+        this.totalPayCost = totalPayCost;
+    }
+
+    public Double getPayRatio() {
+        return payRatio;
+    }
+
+    public void setPayRatio(Double payRatio) {
+        this.payRatio = payRatio;
+    }
+
+    public Double getCompletePrice() {
+        return completePrice;
+    }
+
+    public void setCompletePrice(Double completePrice) {
+        this.completePrice = completePrice;
+    }
+
+    public Double getAppointPay() {
+        return appointPay;
+    }
+
+    public void setAppointPay(Double appointPay) {
+        this.appointPay = appointPay;
+    }
+
+    public Double getAdvanceDeduct() {
+        return advanceDeduct;
+    }
+
+    public void setAdvanceDeduct(Double advanceDeduct) {
+        this.advanceDeduct = advanceDeduct;
+    }
+
+    public Double getRestsDeduct() {
+        return restsDeduct;
+    }
+
+    public void setRestsDeduct(Double restsDeduct) {
+        this.restsDeduct = restsDeduct;
+    }
+
+    public Double getActualPay() {
+        return actualPay;
+    }
+
+    public void setActualPay(Double actualPay) {
+        this.actualPay = actualPay;
+    }
+
+    public Double getNowTotalFinishCost() {
+        return nowTotalFinishCost;
+    }
+
+    public void setNowTotalFinishCost(Double nowTotalFinishCost) {
+        this.nowTotalFinishCost = nowTotalFinishCost;
+    }
+
+    public Double getNowTotalPayCost() {
+        return nowTotalPayCost;
+    }
+
+    public void setNowTotalPayCost(Double nowTotalPayCost) {
+        this.nowTotalPayCost = nowTotalPayCost;
+    }
+
+    public Double getNowPayRatio() {
+        return nowPayRatio;
+    }
+
+    public void setNowPayRatio(Double nowPayRatio) {
+        this.nowPayRatio = nowPayRatio;
+    }
+
+    public String getPid() {
+        return pid;
+    }
+
+    public void setPid(String pid) {
+        this.pid = pid;
+    }
+
+    public String getLoginId() {
+        return loginId;
+    }
+
+    public void setLoginId(String loginId) {
+        this.loginId = loginId;
+    }
+
+    public String getCreateId() {
+        return createId;
+    }
+
+    public void setCreateId(String createId) {
+        this.createId = createId;
+    }
+
+    public Integer getOperationSign() {
+        return operationSign;
+    }
+
+    public void setOperationSign(Integer operationSign) {
+        this.operationSign = operationSign;
+    }
+
+    public String getContractId() {
+        return contractId;
+    }
+
+    public void setContractId(String contractId) {
+        this.contractId = contractId;
+    }
+
+    public Double getTrueAmt() {
+        return trueAmt;
+    }
+
+    public void setTrueAmt(Double trueAmt) {
+        this.trueAmt = trueAmt;
+    }
+}

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

@@ -0,0 +1,45 @@
+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 org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+
+import java.util.List;
+
+/**
+ * 实施阶段-工程进度款管理service
+ * @author 徐滕
+ * @version 2020-07-28
+ */
+@Service
+@Transactional(readOnly = true)
+public class ProjectInterimPaymentService extends CrudService<ProjectInterimPaymentDao, ProjectPaymentTreeData> {
+
+    public ProjectPaymentTreeData get(String id) {
+        return super.get(id);
+    }
+
+    public List<ProjectPaymentTreeData> findPage(String contractId) {
+        List<ProjectPaymentTreeData> recordsList = dao.projectPaymentFindList(contractId);
+        return recordsList;
+    }
+
+    /**
+     * 新增方法
+     * @param projectPaymentTreeData
+     * @return
+     */
+    @Transactional(readOnly = false)
+    public void save(ProjectPaymentTreeData projectPaymentTreeData) {
+        //判断是否为修改信息
+        if (projectPaymentTreeData.getIsNewRecord()){
+            projectPaymentTreeData.preInsert();
+            dao.insert(projectPaymentTreeData);
+        }else{
+            projectPaymentTreeData.preUpdate();
+            dao.update(projectPaymentTreeData);
+        }
+    }
+}

+ 224 - 0
src/main/java/com/jeeplus/modules/projectrecord/web/implementStage/ProjectInterimPaymentController.java

@@ -0,0 +1,224 @@
+package com.jeeplus.modules.projectrecord.web.implementStage;
+
+import com.jeeplus.common.config.Global;
+import com.jeeplus.common.persistence.Page;
+import com.jeeplus.common.utils.Collections3;
+import com.jeeplus.common.utils.StringUtils;
+import com.jeeplus.modules.projectConstruction.entity.ConstructionContract;
+import com.jeeplus.modules.projectConstruction.service.ContractService;
+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.ProjectRecordsService;
+import com.jeeplus.modules.projectrecord.service.implementStage.ProjectInterimPaymentService;
+import com.jeeplus.modules.sys.entity.User;
+import com.jeeplus.modules.sys.utils.UserUtils;
+import org.apache.shiro.authz.annotation.RequiresPermissions;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Controller;
+import org.springframework.ui.Model;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.ResponseBody;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import java.math.BigDecimal;
+import java.math.RoundingMode;
+import java.util.*;
+
+/**
+ * 实施阶段-工程进度款管理controller
+ * @author 徐滕
+ * @version 2020-07-27
+ */
+@Controller
+@RequestMapping(value = "${adminPath}/project/projectInterimPayment")
+public class ProjectInterimPaymentController {
+    @Autowired
+    private ContractService contractService;
+    @Autowired
+    private ProjectInterimPaymentService service;
+    @Autowired
+    private ProjectRecordsService projectRecordsService;
+    @Autowired
+    private WorkProjectUserDao workProjectUserDao;
+
+    /**
+     * 合同列表页面
+     */
+    @RequiresPermissions("project:projectInterimPayment:list")
+    @RequestMapping(value = {"list", ""})
+    public String list(ConstructionContract constructionContract, HttpServletRequest request, HttpServletResponse response, Model model) {
+        if(UserUtils.isManager()){
+            model.addAttribute("flag","1");
+        }
+        Page<ConstructionContract> page = contractService.findPage(new Page<ConstructionContract>(request, response), constructionContract);
+        //无合同状态下,获取委托方的名称
+        List<ConstructionContract> list = page.getList();
+        model.addAttribute("page", page);
+        model.addAttribute("reportType","2");
+        model.addAttribute("contractName",constructionContract.getContractName());
+        return "modules/projectrecord/implementStage/projectInterimPaymentList";
+    }
+
+    /**
+     * 项目列表页面
+     */
+    @RequestMapping(value = "getProjectList")
+    @ResponseBody
+    public Map<String,List> getProjectList(ConstructionContract constructionContract, HttpServletRequest request, HttpServletResponse response, Model model) {
+        if(StringUtils.isBlank(constructionContract.getContractName()) || "undefined".equals(constructionContract.getContractName())){
+            constructionContract.setContractName("");
+        }
+        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());
+            }
+
+            //将界面需要展示数据放入类中
+            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);
+                }
+            }
+
+            //项目负责人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);
+
+                    data.setPid(contract.getId());
+
+                    //如果当前登录人为项目登记者或项目负责人则允许其添加子节点信息
+                    for (String masterId : masterIdList) {
+                        if(masterId.equals(UserUtils.getUser().getId())){
+                            data.setOperationSign(1);
+                            break;
+                        }else{
+                            data.setOperationSign(0);
+                        }
+                    }
+                }
+
+            }
+            projectRecordTreeDataList.addAll(treeDataList);
+
+        }
+
+        map.put("data",projectRecordTreeDataList);
+        return map;
+    }
+
+    private static Double formatDouble(Double value) {
+        BigDecimal bd = new BigDecimal(value);
+        bd = bd.setScale(2, RoundingMode.HALF_UP);
+        return bd.doubleValue();
+    }
+
+
+    /**
+     * 跳转方法
+     * @param projectPaymentTreeData
+     * @param model
+     * @return
+     */
+    @RequestMapping(value = {"form"})
+    public String form(ProjectPaymentTreeData projectPaymentTreeData,Model model) {
+        if (projectPaymentTreeData!=null&&StringUtils.isNotBlank(projectPaymentTreeData.getId())) {
+            projectPaymentTreeData = service.get(projectPaymentTreeData.getId());
+        }else {
+            projectPaymentTreeData.setCreateBy(UserUtils.getUser());
+            projectPaymentTreeData.setCreateDate(new Date());
+        }
+        model.addAttribute("projectPaymentTreeData", projectPaymentTreeData);
+        return "modules/projectrecord/implementStage/projectInterimPaymentForm";
+    }
+
+
+    /**
+     * 添加工程款信息
+     */
+    @RequestMapping(value = "save")
+    public String save(ProjectPaymentTreeData projectPaymentTreeData) {
+        service.save(projectPaymentTreeData);
+        return "redirect:"+ Global.getAdminPath()+"/project/projectInterimPayment/?repage";
+    }
+
+
+    /**
+     * 删除工程款信息
+     */
+    @RequestMapping(value = "delete")
+    public String delete(ProjectPaymentTreeData projectPaymentTreeData) {
+        service.delete(projectPaymentTreeData);
+        return "redirect:"+ Global.getAdminPath()+"/project/projectInterimPayment/?repage";
+    }
+
+}

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

@@ -113,7 +113,7 @@
 	</insert>
 
 	<update id="update">
-		UPDATE work_content_contractinfo SET
+		UPDATE construction_contract SET
 			update_by = #{updateBy.id},
 			update_date = #{updateDate},
 			remarks = #{remarks},
@@ -121,7 +121,7 @@
 			content_id = #{contentId},
 			program_id = #{program.id},
 			cnumber = #{cnumber},
-			/*cont_cate = #{contCate},*/
+			cont_cate = #{contCate},
 			cont_attr = #{contAttr},
 			letting_agent = #{lettingAgent},
 			contractor = #{contractor},
@@ -140,20 +140,20 @@
 			pay_amt = #{payAmt},
 			start_date = #{startDate},
 			end_date = #{endDate},
-			contract_name=#{contractName}
+			contract_name = #{contractName}
 		WHERE id = #{id}
 	</update>
 
 
 	<!--物理删除-->
 	<update id="delete">
-		DELETE FROM work_content_contractinfo
+		DELETE FROM construction_contract
 		WHERE id = #{id}
 	</update>
 
 	<!--逻辑删除-->
 	<update id="deleteByLogic">
-		UPDATE work_content_contractinfo SET
+		UPDATE construction_contract SET
 			del_flag = #{DEL_FLAG_DELETE}
 		WHERE id = #{id}
 	</update>

+ 114 - 0
src/main/resources/mappings/modules/projectrecord/implementStage/ProjectInterimPaymentDao.xml

@@ -0,0 +1,114 @@
+<?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.projectrecord.dao.implementStage.ProjectInterimPaymentDao">
+
+	<sql id="projectRecordsColumns">
+		a.id AS "id",
+		a.create_by AS "createBy.id",
+		a.create_date AS "createDate",
+		a.update_by AS "updateBy.id",
+		a.update_date AS "updateDate",
+		a.del_flag AS "delFlag",
+		a.remarks AS "remarks",
+
+		a.complete_price as "completePrice",
+		a.appoint_pay as "appointPay",
+		a.advance_deduct as "advanceDeduct",
+		a.rests_deduct as "restsDeduct",
+		a.actual_pay as "actualPay",
+		a.contract_id as "contractId"
+	</sql>
+	
+    
+	<select id="get" resultType="com.jeeplus.modules.projectrecord.entity.ProjectPaymentTreeData" >
+		SELECT
+			<include refid="projectRecordsColumns"/>
+        FROM project_interim_payment a
+		WHERE a.id = #{id}
+	</select>
+
+	<select id="projectPaymentFindList" resultType="com.jeeplus.modules.projectrecord.entity.ProjectPaymentTreeData" >
+		SELECT
+			<include refid="projectRecordsColumns"/>
+		FROM project_interim_payment a
+		<where>
+			a.contract_id = #{contractId}
+			AND a.del_flag = 0
+		</where>
+            GROUP BY a.id
+			ORDER BY a.update_date asc
+	</select>
+
+    <select id="queryCount" resultType="int" >
+        SELECT count(DISTINCT a.id)
+        FROM project_interim_payment a
+		<where>
+			a.contract_id = #{contractId}
+			AND a.del_flag = 0
+		</where>
+    </select>
+	
+	<insert id="insert">
+		INSERT INTO project_interim_payment(
+			id,
+			create_by,
+			create_date,
+			update_by,
+			update_date,
+			del_flag,
+			remarks,
+
+  			complete_price,
+  			appoint_pay,
+  			advance_deduct,
+  			rests_deduct,
+  			actual_pay,
+  			contract_id
+		) VALUES (
+			#{id},
+			#{createBy.id},
+			#{createDate},
+			#{updateBy.id},
+			#{updateDate},
+			#{delFlag},
+			#{remarks},
+
+			#{completePrice},
+			#{appointPay},
+			#{advanceDeduct},
+			#{restsDeduct},
+			#{actualPay},
+			#{contractId}
+		)
+	</insert>
+	
+	<update id="update">
+		UPDATE project_interim_payment SET
+			update_by = #{updateBy.id},
+			update_date = #{updateDate},
+			remarks = #{remarks},
+
+			complete_price = #{completePrice},
+  			appoint_pay = #{appointPay},
+  			advance_deduct = #{advanceDeduct},
+  			rests_deduct = #{restsDeduct},
+  			actual_pay = #{actualPay}
+		WHERE id = #{id}
+	</update>
+	
+	
+	<!--物理删除-->
+	<update id="delete">
+		UPDATE project_interim_payment SET
+			del_flag = #{DEL_FLAG_DELETE}
+		WHERE id = #{id}
+	</update>
+	
+	<!--逻辑删除-->
+	<update id="deleteByLogic">
+		UPDATE project_interim_payment SET
+			del_flag = #{DEL_FLAG_DELETE}
+		WHERE id = #{id}
+	</update>
+
+</mapper>

+ 56 - 0
src/main/webapp/WEB-INF/tags/sys/gridselectProjectList.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="projectId" type="java.lang.String" required="true" description="项目ID"%>
+<%@ attribute name="type" type="java.lang.String" required="true" description="内容类型"%>
+<%@ attribute name="extId" type="java.lang.String" required="false" description="内容类型"%>
+<%@ attribute name="cssClass" type="java.lang.String" required="false" description="css样式"%>
+<%@ attribute name="cssStyle" type="java.lang.String" required="false" description="css样式"%>
+<%@ attribute name="disabled" type="java.lang.String" required="false" description="是否限制选择,如果限制,设置为disabled"%>
+<script type="text/javascript">
+function searchGrid${id}(){
+	top.layer.open({
+	    type: 2,  
+	    area: ['95%','95%'],
+	    title:"${title}",
+	    name:'friend',
+	    content: encodeURI("${url}?project.id=${projectId}&type=${type}&extId=${extId}&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;
+	    	 }
+	    	 $("#${id}Id").val(item.split('_item_')[0]);
+	    	 $("#${id}Name").val(item.split('_item_')[1]);
+			 top.layer.close(index);//关闭对话框。
+		  },
+		  cancel: function(index){ 
+	       }
+	}); 
+};
+</script>
+
+	<input id="${id}Id" name="${name}"  type="hidden" value="${value}"/>
+	<div class="input-group" style="width: 100%">
+		<input id="${id}Name"  name="${labelName }" ${allowInput?'':'readonly="readonly"'}  type="text" value="${labelValue}" data-msg-required="${dataMsgRequired}"
+		class="${cssClass}" style="${cssStyle}"/>
+       		 <span class="input-group-btn">
+	       		 <button type="button" onclick="searchGrid${id}()" id="${id}Button" class="btn <c:if test="${fn:contains(cssClass, 'input-sm')}"> btn-sm </c:if><c:if test="${fn:contains(cssClass, 'input-lg')}"> btn-lg </c:if>  btn-primary ${disabled} ${hideBtn ? 'hide' : ''}"><i class="fa fa-search"></i>
+	             </button> 
+       		 </span>
+       		
+    </div>
+	 <label id="${id}Name-error" class="error" for="${id}Name" style="display:none"></label>

+ 6 - 7
src/main/webapp/webpage/modules/projectConstruction/projectConstructionForm.jsp

@@ -229,14 +229,13 @@
         <sys:message content="${message}"/>
         <form:form id="inputForm" modelAttribute="constructionContract" action="${ctx}/project/constructionContract/save" method="post" class="form-horizontal">
             <form:hidden path="id"/>
-            <input type="hidden" id="programIdId" name="projectId" value="">
         <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 with-icon">
-                        <sys:gridselectProjcontent url="${ctx}/project/constructionContract/selectcontent" id="programId" name="program.id"  value="${constructionContract.program.id}"  title="选择项目名称" labelName="program.name"
-                                                   labelValue="${constructionContract.program.name}" cssClass="form-control layui-input required" projectId="${constructionContract.projectId}" type="31" fieldLabels="" fieldKeys="" searchLabel="${fns:urlEncode('项目名称')}" searchKey="" ></sys:gridselectProjcontent>
+                        <sys:gridselectProjcontent url="${ctx}/project/constructionContract/selectcontent" id="projectId" name="projectId"  value="${constructionContract.projectId}"  title="选择项目名称" labelName="projectName"
+                                                   labelValue="${constructionContract.projectName}" cssClass="form-control layui-input required" projectId="${constructionContract.projectId}" type="31" fieldLabels="" fieldKeys="" searchLabel="${fns:urlEncode('项目名称')}" searchKey="" ></sys:gridselectProjcontent>
                     </div>
                 </div>
                 <div class="layui-item layui-col-sm6">
@@ -306,13 +305,13 @@
                 <div class="layui-item layui-col-sm6">
                     <label class="layui-form-label ">目标成本(元):</label>
                     <div class="layui-input-block">
-                        <input name="titularAmt" htmlEscape="false"  value="<fmt:formatNumber value="${constructionContract.titularAmt}" pattern="#,##0.00#"/>" class="form-control layui-input number"/>
+                        <input name="titularAmt" htmlEscape="false"  value="${constructionContract.titularAmt}" class="form-control layui-input number"/>
                     </div>
                 </div>
                 <div class="layui-item layui-col-sm6">
                     <label class="layui-form-label double-line"><span class="require-item">*</span>有效合同金额(元):</label>
                     <div class="layui-input-block">
-                        <input name="trueAmt" htmlEscape="false"  value="<fmt:formatNumber value="${constructionContract.trueAmt}" pattern="#,##0.00#"/>" class="form-control layui-input number required"/>
+                        <input name="trueAmt" htmlEscape="false"  value="${constructionContract.trueAmt}" class="form-control layui-input number required"/>
                     </div>
                 </div>
                 <div class="layui-item layui-col-sm6">
@@ -344,7 +343,7 @@
                 <div class="layui-item layui-col-sm6">
                     <label class="layui-form-label">止付金额:</label>
                     <div class="layui-input-block">
-                        <input name="stopAmt" htmlEscape="false"  value="<fmt:formatNumber value="${constructionContract.stopAmt}" pattern="#,##0.00#"/>"  class="form-control layui-input  number"/>
+                        <input name="stopAmt" htmlEscape="false"  value="${constructionContract.stopAmt}"  class="form-control layui-input  number"/>
                     </div>
                 </div>
                 <div class="layui-item layui-col-sm6">
@@ -368,7 +367,7 @@
                 <div class="layui-item layui-col-sm6">
                     <label class="layui-form-label"><span class="require-item">*</span>支付金额:</label>
                     <div class="layui-input-block">
-                        <input name="payAmt" htmlEscape="false"  value="<fmt:formatNumber value="${constructionContract.payAmt}" pattern="#,##0.00#"/>" class="form-control layui-input required number"/>
+                        <input name="payAmt" htmlEscape="false"  value="${constructionContract.payAmt}" class="form-control layui-input required number"/>
                     </div>
                 </div>
                 <div class="layui-item layui-col-sm6">

+ 16 - 16
src/main/webapp/webpage/modules/projectConstruction/projectConstructionList.jsp

@@ -88,17 +88,6 @@
 								<form:input path="contractName" htmlEscape="false" maxlength="255"  class=" form-control layui-input"/>
 							</div>
 						</div>
-
-						<div class="layui-item athird">
-							<div class="input-group">
-								<a href="#" id="moresee"><i class="glyphicon glyphicon-menu-down"></i></a>
-								<button id="searchReset" class="fixed-btn searchReset fr" onclick="resetSearch()">重置</button>
-								<button id="searchQuery" class="fixed-btn searchQuery fr" onclick="search()">查询</button>
-							</div>
-						</div>
-						<div style="    clear:both;"></div>
-					</div>
-					<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">
@@ -111,6 +100,17 @@
 								</input>
 							</div>
 						</div>
+						<div class="layui-item athird">
+							<div class="input-group">
+								<a href="#" id="moresee"><i class="glyphicon glyphicon-menu-down"></i></a>
+								<button id="searchReset" class="fixed-btn searchReset fr" onclick="resetSearch()">重置</button>
+								<button id="searchQuery" class="fixed-btn searchQuery fr" onclick="search()">查询</button>
+							</div>
+						</div>
+						<div style="    clear:both;"></div>
+					</div>
+					<div id="moresees" style="clear:both;display:none;" class="lw14">
+
 					</div>
 				</form:form>
 			</div>
@@ -152,12 +152,11 @@
 			,cols: [[
 				{field:'index',align:'center', title: '序号',width:40}
 				,{field:'projectName',align:'center', title: '项目名称',minWidth:200,templet:function(d){
-						var xml = "<a class=\"attention-info\" href=\"javascript:void(0);\" onclick=\"openDialogView('查看项目信息', '${ctx}/workclientinfo/workClientInfo/detail?id=" + d.id + "&wlId=" + d.linkman + "','95%','95%')\">" +
-								"<span title=" + d.projectName + ">" + d.projectName.substr(0,40) + "</span></a>";
+						return "<a class=\"attention-info\" title=\"" + d.projectName + "\" href=\"javascript:void(0);\" onclick=\"openDialogView('查看项目', '${ctx}/project/projectRecords/view?id=" + d.projectId +"','95%', '95%')\">" + d.projectName + "</a>";
 						return xml;
 					}}
 				,{field:'contractName',align:'center', title: '合同名称',minWidth:200,templet:function(d){
-						var xml = "<a class=\"attention-info\" href=\"javascript:void(0);\" onclick=\"openDialogView('查看合同信息', '${ctx}/workclientinfo/workClientInfo/detail?id=" + d.id + "&wlId=" + d.linkman + "','95%','95%')\">" +
+						var xml = "<a class=\"attention-info\" href=\"javascript:void(0);\" onclick=\"openDialogView('查看合同信息', '${ctx}/project/constructionContract/view?id=" + d.id + "','95%','95%')\">" +
 								"<span title=" + d.contractName + ">" + d.contractName.substr(0,40) + "</span></a>";
 						return xml;
 					}}
@@ -170,10 +169,10 @@
 						var xml = "";
 
 						if(d.canedit != undefined && d.canedit == "1")
-							xml +="<a href=\"javascript:void(0)\" onclick=\"openDialog('修改客户信息', '${ctx}/workclientinfo/workClientInfo/form?id=" + d.id + "&param=1','95%','95%')\" class=\"op-btn op-btn-edit\" ><i class=\"fa fa-edit\"></i>修改</a>"
+							xml +="<a href=\"javascript:void(0)\" onclick=\"openDialog('修改客户信息', '${ctx}/project/constructionContract/form?id=" + d.id + "&param=1','95%','95%')\" class=\"op-btn op-btn-edit\" ><i class=\"fa fa-edit\"></i>修改</a>"
 
 						if(d.candelete != undefined && d.candelete == "1")
-							xml +="<a href=\"${ctx}/workclientinfo/workClientInfo/delete?id=" + d.id + "\" onclick=\"return confirmx('确认要删除该客户信息吗?', this.href)\"   class=\"op-btn op-btn-delete\"><i class=\"fa fa-trash\"></i> 删除</a>";
+							xml +="<a href=\"${ctx}/project/constructionContract/delete?id=" + d.id + "\" onclick=\"return confirmx('确认要删除该客户信息吗?', this.href)\"   class=\"op-btn op-btn-delete\"><i class=\"fa fa-trash\"></i> 删除</a>";
 						return xml;
 					}}
 			]]
@@ -184,6 +183,7 @@
 				{
 					"index":"${index.index+1}"
 					,"id":"${constructionContract.id}"
+					,"projectId":"${constructionContract.projectId}"
 					,"contractName":"${constructionContract.contractName}"
 					,"cnumber":"${constructionContract.cnumber}"
 					,"contCate":"${constructionContract.contCate}"

+ 424 - 0
src/main/webapp/webpage/modules/projectConstruction/projectConstructionView.jsp

@@ -0,0 +1,424 @@
+<%@ 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/layui.js"></script>
+
+    <link rel='stylesheet' type="text/css" href="${ctxStatic}/helloweba_editable-select/jquery.editable-select.min.css"/>
+    <link rel='stylesheet' type="text/css" href="${ctxStatic}/layui/css/layui.css"/>
+
+    <style>
+        #projectDesc-error{
+            left:0;
+            top:82px;
+        }
+        .layui-layer-dialog{
+            background: #ff0000;
+        }
+        td input{
+            margin-left:-10px !important;
+            height: 42px !important;
+        }
+    </style>
+</head>
+<body>
+<div class="single-form">
+    <div class="container">
+        <sys:message content="${message}"/>
+        <form:form id="inputForm" modelAttribute="constructionContract" action="${ctx}/project/constructionContract/save" method="post" class="form-horizontal">
+            <form:hidden path="id"/>
+        <div class="form-group layui-row first">
+                <div class="form-group-label"><h2>合同信息</h2></div>
+
+                <div class="layui-item layui-col-sm6">
+                    <label class="layui-form-label">项目名称:</label>
+                    <div class="layui-input-block">
+                        <form:input path="projectName" htmlEscape="false"    readonly="true"  class="form-control layui-input required"/>
+                    </div>
+                </div>
+                <div class="layui-item layui-col-sm6">
+                    <label class="layui-form-label">合同名称:</label>
+                    <div class="layui-input-block">
+                        <form:input path="contractName" htmlEscape="false"    readonly="true"  class="form-control layui-input required"/>
+                    </div>
+                </div>
+                <div class="layui-item layui-col-sm6">
+                    <label class="layui-form-label">合同编号:</label>
+                    <div class="layui-input-block">
+                        <form:input path="cnumber" htmlEscape="false"  readonly="true"   class="form-control layui-input required"/>
+                    </div>
+                </div>
+                <div class="layui-item layui-col-sm6">
+                    <label class="layui-form-label">合同分类:</label>
+                    <div class="layui-input-block">
+                        <form:select path="contCate" disabled="true" class="form-control layui-input required">
+                            <option value="" label=""/>
+                            <c:forEach items="${fns:getDictList('content_contract_type')}" var="item">
+                                <optgroup value="${item.value}" label="${item.label}"/>
+                                <c:set var="typename" value="content_contract_type_${item.value}"></c:set>
+                                <form:options items="${fns:getDictList(typename)}" itemValue="value" itemLabel="label"/>
+                            </c:forEach>
+                        </form:select>
+                    </div>
+                </div>
+                <div class="layui-item layui-col-sm6">
+                    <label class="layui-form-label">合同属性:</label>
+                    <div class="layui-input-block">
+                        <form:select path="contAttr"  disabled="true"   class="form-control layui-input required">
+                            <form:option value="" label=""/>
+                            <form:options items="${fns:getMainDictList('content_contract_attr')}" itemLabel="label" itemValue="value" htmlEscape="false"/>
+                        </form:select>
+                    </div>
+                </div>
+                <div class="layui-item layui-col-sm6">
+                    <label class="layui-form-label">发包人:</label>
+                    <div class="layui-input-block">
+                        <form:input path="lettingAgent" htmlEscape="false"  readonly="true"   class="form-control layui-input required"/>
+                    </div>
+                </div>
+                <div class="layui-item layui-col-sm6">
+                    <label class="layui-form-label">承包人:</label>
+                    <div class="layui-input-block">
+                        <form:input path="contractor" htmlEscape="false" readonly="true"    class="form-control layui-input required"/>
+                    </div>
+                </div>
+            </div>
+
+            <div class="form-group layui-row lw12">
+                <div class="form-group-label"><h2>详情信息</h2></div>
+                <div class="layui-item layui-col-sm6">
+                    <label class="layui-form-label">签约日期:</label>
+                    <div class="layui-input-block">
+                        <input id="signDate" name="signDate" readonly="true"  type="text" maxlength="20" class="laydate-icondate form-control layui-input layer-date laydate-icon required"
+                               value="<fmt:formatDate value="${constructionContract.signDate}" pattern="yyyy-MM-dd"/>"/>
+                    </div>
+                </div>
+                <div class="layui-item layui-col-sm6">
+                    <label class="layui-form-label">生效日期:</label>
+                    <div class="layui-input-block">
+                        <input id="effectDate" name="effectDate" readonly="true"  type="text" maxlength="20" class="laydate-icondate form-control layui-input layer-date laydate-icon "
+                               value="<fmt:formatDate value="${constructionContract.effectDate}" pattern="yyyy-MM-dd"/>"/>
+                    </div>
+                </div>
+                <div class="layui-item layui-col-sm6">
+                    <label class="layui-form-label ">目标成本(元):</label>
+                    <div class="layui-input-block">
+                        <input name="titularAmt" htmlEscape="false" readonly="true" value="${constructionContract.titularAmt}" class="form-control layui-input number"/>
+                    </div>
+                </div>
+                <div class="layui-item layui-col-sm6">
+                    <label class="layui-form-label double-line">有效合同金额(元):</label>
+                    <div class="layui-input-block">
+                        <input name="trueAmt" htmlEscape="false" readonly="true"  value="${constructionContract.trueAmt}" class="form-control layui-input number required"/>
+                    </div>
+                </div>
+                <div class="layui-item layui-col-sm6">
+                    <label class="layui-form-label">保修金比例(%):</label>
+                    <div class="layui-input-block">
+                        <form:input path="pledgePercent" htmlEscape="false"  readonly="true"   class="form-control layui-input  number"/>
+                    </div>
+                </div>
+                <div class="layui-item layui-col-sm6">
+                    <label class="layui-form-label">合同开工日期:</label>
+                    <div class="layui-input-block">
+                        <input id="startWorkDate" name="startWorkDate" readonly="true"  type="text" maxlength="20" class="laydate-icondate form-control layui-input layer-date laydate-icon required"
+                               value="<fmt:formatDate value="${constructionContract.startWorkDate}" pattern="yyyy-MM-dd"/>"/>
+                    </div>
+                </div>
+                <div class="layui-item layui-col-sm6">
+                    <label class="layui-form-label">合同竣工日期:</label>
+                    <div class="layui-input-block">
+                        <input id="endWorkDate" name="endWorkDate" readonly="true" type="text" maxlength="20" class="laydate-icondate form-control layui-input layer-date laydate-icon "
+                               value="<fmt:formatDate value="${constructionContract.endWorkDate}" pattern="yyyy-MM-dd"/>"/>
+                    </div>
+                </div>
+                <div class="layui-item layui-col-sm6">
+                    <label class="layui-form-label">止付比例(%):</label>
+                    <div class="layui-input-block">
+                        <form:input path="stopPercent" htmlEscape="false"  readonly="true"   class="form-control layui-input  number"/>
+                    </div>
+                </div>
+                <div class="layui-item layui-col-sm6">
+                    <label class="layui-form-label">支付金额:</label>
+                    <div class="layui-input-block">
+                        <input name="stopAmt" htmlEscape="false" readonly="true"  value="${constructionContract.stopAmt}"  class="form-control layui-input  number"/>
+                    </div>
+                </div>
+                <div class="layui-item layui-col-sm6">
+                    <label class="layui-form-label">合同执行状态:</label>
+                    <div class="layui-input-block">
+                        <form:select path="status" readonly="true"  class="form-control layui-input required">
+                            <form:option value="" label=""/>
+                            <form:options items="${fns:getDictList('content_contract_status')}" itemLabel="label" itemValue="value" htmlEscape="false"/>
+                        </form:select>
+                    </div>
+                </div>
+            </div>
+            <div class="form-group layui-row lw12">
+                <div class="form-group-label"><h2>履约保证金</h2></div>
+                <div class="layui-item layui-col-sm6">
+                    <label class="layui-form-label">支付方式:</label>
+                    <div class="layui-input-block">
+                        <form:input path="payType" htmlEscape="false"  readonly="true"   class="form-control layui-input "/>
+                    </div>
+                </div>
+                <div class="layui-item layui-col-sm6">
+                    <label class="layui-form-label">支付金额:</label>
+                    <div class="layui-input-block">
+                        <input name="payAmt" htmlEscape="false" readonly="true"  value="${constructionContract.payAmt}" class="form-control layui-input required number"/>
+                    </div>
+                </div>
+                <div class="layui-item layui-col-sm6">
+                    <label class="layui-form-label">开始日期:</label>
+                    <div class="layui-input-block">
+                        <input id="startDate" name="startDate" readonly="true"  type="text" maxlength="20" class="laydate-icondate form-control layui-input layer-date laydate-icon "
+                               value="<fmt:formatDate value="${constructionContract.startDate}" pattern="yyyy-MM-dd"/>"/>
+                    </div>
+                </div>
+                <div class="layui-item layui-col-sm6">
+                    <label class="layui-form-label">结束日期:</label>
+                    <div class="layui-input-block">
+                        <input id="endDate" name="endDate" readonly="true"  type="text" maxlength="20" class="laydate-icondate form-control layui-input layer-date laydate-icon "
+                               value="<fmt:formatDate value="${constructionContract.endDate}" 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">
+                </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="${constructionContract.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>
+                                    </div>
+                                </td>
+                            </tr>
+                        </c:forEach>
+                        </tbody>
+                    </table>
+                </div>
+            </div>
+        </form:form>
+
+        <%--<form id="termForm" action="#" onsubmit="return false;" method="post" class="form-horizontal">
+            <div class="form-group layui-row lw12">
+                <div class="form-group-label"><h2>合同条款</h2></div>
+                <div class="layui-item nav-btns">
+                    <a href="javascript:void(0)" onclick="addRowTerm('#termTableList',termIdx,termTpl)" class="nav-btn nav-btn-add" ><i class="fa fa-plus"></i> 新增</a>
+                </div>
+                <table id="termsTable" class="table table-bordered table-condensed can-edit">
+                    <thead>
+                    <tr>
+                        <th class="hide"></th>
+                        <th>摘要项</th>
+                        <th>摘要内容</th>
+                        <th>对应条款序号</th>
+                        <th>操作</th>
+                    </tr>
+                    </thead>
+                    <tbody id="termTableList">
+                    </tbody>
+                </table>
+            </div>
+        </form>--%>
+        <script type="text/template" id="termTpl">//<!--
+        <tr id="termList{{idx}}">
+            <td class="hide">
+                <input id="termList{{idx}}_id" subName="id" class="contentDetail" type="hidden" value="{{row.id}}"/>
+                <input id="termList{{idx}}_delFlag" subName="delFlag" class="contentDetail" type="hidden" value="0"/>
+                <input id="termList{{idx}}_contractId" subName="contractId" class="contentDetail" type="hidden" value="{{row.contractId}}"/>
+            </td>
+            <td>
+                <input id="termList{{idx}}_title" subName="title"  value="{{row.title}}" type="text" class="form-control contentDetail"/>
+            </td>
+            <td>
+                <input id="termList{{idx}}_content" subName="content" value="{{row.content}}" type="text" class="form-control contentDetail"/>
+            </td>
+            <td>
+                <input id="termList{{idx}}_tnumber" subName="tnumber" value="{{row.tnumber}}" type="text" class="form-control contentDetail"/>
+            </td>
+            <td class="text-center op-td">
+                        <a href=javascript:void(0); onclick="delRow(this, '#termList{{idx}}')"   class="op-btn op-btn-delete"><i class="fa fa-trash"></i> 取消</a>
+            </td>
+        </tr>//-->
+        </script>
+
+    </div>
+</div>
+
+<script type="text/javascript">
+    var termIdx = 0, termTpl = $("#termTpl").html().replace(/(\/\/\<!\-\-)|(\/\/\-\->)/g,"");
+    var validateForm;
+    var validateForm2;
+    jQuery.validator.addMethod("percent", function(value, element) {
+        var length = value.length;
+        var phone = /^(100|[1-9]?\d(\.\d\d?)?)%$/;
+        return this.optional(element) || (phone.test(value));
+    }, "请填写正确的百分数");
+    $(document).ready(function() {
+        validateForm = $("#subForm").validate({
+            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);
+                }
+            }
+        });
+
+        validateForm2 = $("#termForm").validate({
+            errorContainer: "#messageBox",
+            errorPlacement: function(error, element) {
+                $("#messageBox").text("输入有误,请先更正。");
+                if (element.is(":checkbox")||element.is(":radio")||element.parent().is(".input-append")){
+                    error.appendTo(element.parent().parent());
+                } else {
+                    error.insertAfter(element);
+                }
+            }
+        });
+
+
+
+        var data = ${fns:toJson(workContentContractinfo.termList)};
+        if(data!=null) {
+            for (var i = 0; i < data.length; i++) {
+                addRowTerm('#termTableList', termIdx, termTpl, data[i]);
+            }
+        }
+    });
+
+    function addRowTerm(list, idx, tpl, row){
+        bornTemplete(list, idx, tpl, row, idx);
+        termIdx +=1;
+    }
+
+    function bornTemplete(list, idx, tpl, row, idx1){
+        var idx1 = $("#termTableList tr").length +1;
+        $(list).append(Mustache.render(tpl, {
+            idx: idx, delBtn: true, row: row,
+            order:idx1 + 1, idx1:idx1
+        }));
+        $(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,idx){
+        var id = $(prefix+"_id");
+        var delFlag = $(prefix+"_delFlag");
+        if(id.val()==null||id.val()==''){
+            $(obj).parent().parent().remove();
+        }else {
+            delFlag.val("1");
+            $(obj).parent().parent().hide();
+        }
+    }
+
+    function genDetailStr(){
+        var contractJson = $("#subForm").serializeJson();
+        var termJson = genTermJson();
+        if(termJson!=null){
+            console.log(termJson);
+            contractJson["termList"]=JSON.parse(termJson);
+        }
+        console.log(contractJson);
+        return JSON.stringify(contractJson);
+    }
+
+    function genTermJson(){
+        var costList = $("#termTableList tr");
+        if(costList.length==0){
+            return null;
+        }
+        var contentStr = "[";
+        for(var j=0; j<costList.length;j++){
+            contentStr+="{"
+            var idstr = $(costList[j]).attr("id");
+            var detail = $("tr[id="+idstr+"] .contentDetail");
+            for(var i=0; i<detail.length;i++){
+                contentStr+='"'
+                contentStr+=$(detail[i]).attr("subName");
+                contentStr+='"'
+                contentStr+=":";
+                contentStr+='"'
+                contentStr+=$(detail[i]).val();
+                contentStr+='"'
+                if(i!=detail.length-1){
+                    contentStr+=","
+                }
+            }
+            contentStr+="}"
+            if(j!=costList.length-1){
+                contentStr+=","
+            }
+        }
+        contentStr += "]";
+        return contentStr;
+    }
+    function genSecondDetailStr(){
+        return '';
+    }
+</script>
+</body>
+</html>

+ 103 - 0
src/main/webapp/webpage/modules/projectrecord/implementStage/projectInterimPaymentForm.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"/>
+    <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/layui.js"></script>
+
+    <link rel='stylesheet' type="text/css" href="${ctxStatic}/helloweba_editable-select/jquery.editable-select.min.css"/>
+    <link rel='stylesheet' type="text/css" href="${ctxStatic}/layui/css/layui.css"/>
+
+    <style>
+        #projectDesc-error{
+            left:0;
+            top:82px;
+        }
+        .layui-layer-dialog{
+            background: #ff0000;
+        }
+        td input{
+            margin-left:-10px !important;
+            height: 42px !important;
+        }
+    </style>
+    <script type="text/javascript">
+        var validateForm;
+        var isMasterClient = true;//是否是主委托方
+        var clientCount = 0;
+        function doSubmit(i){//回调函数,在编辑和保存动作时,供openDialog调用提交表单。
+            $("#inputForm").submit();
+            return true;
+        }
+        $(document).ready(function() {
+            var radioVal ;
+            validateForm = $("#inputForm").validate({
+                submitHandler: function(form){
+                    loading('正在提交,请稍等...');
+                    form.submit();
+                },
+                errorContainer: "#messageBox",
+                errorPlacement: function(error, element) {
+                    $("#messageBox").text("输入有误,请先更正。");
+                    if (element.is(":checkbox")||element.is(":radio")||element.parent().is(".input-append")){
+                        error.appendTo(element.parent().parent());
+                    } else {
+                        error.insertAfter(element);
+                    }
+                }
+            });
+
+        });
+    </script>
+</head>
+<body>
+<div class="single-form">
+    <div class="container">
+        <sys:message content="${message}"/>
+        <form:form id="inputForm" modelAttribute="projectPaymentTreeData" action="${ctx}/project/projectInterimPayment/save" method="post" class="form-horizontal">
+            <form:hidden path="id"/>
+            <input type="hidden" id="contractId" name="contractId" value="${projectPaymentTreeData.contractId}">
+        <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">
+                        <form:input path="completePrice" htmlEscape="false" class="form-control layui-input required number"/>
+                    </div>
+                </div>
+                <div class="layui-item layui-col-sm6">
+                    <label class="layui-form-label double-line"><span class="require-item">*</span>按约定比例应支付价款:</label>
+                    <div class="layui-input-block">
+                        <form:input path="appointPay" htmlEscape="false"    class="form-control layui-input required number"/>
+                    </div>
+                </div>
+
+
+                <div class="layui-item layui-col-sm6">
+                    <label class="layui-form-label double-line"><span class="require-item">*</span>应扣预付款:</label>
+                    <div class="layui-input-block">
+                        <form:input path="advanceDeduct" htmlEscape="false"    class="form-control layui-input required number"/>
+                    </div>
+                </div>
+                <div class="layui-item layui-col-sm6">
+                    <label class="layui-form-label double-line"><span class="require-item">*</span>其他应扣款:</label>
+                    <div class="layui-input-block">
+                        <form:input path="restsDeduct" htmlEscape="false"    class="form-control layui-input required number"/>
+                    </div>
+                </div>
+                <div class="layui-item layui-col-sm6">
+                    <label class="layui-form-label double-line"><span class="require-item">*</span>实际应支付:</label>
+                    <div class="layui-input-block">
+                        <form:input path="actualPay" htmlEscape="false"    class="form-control layui-input required number"/>
+                    </div>
+                </div>
+            </div>
+        </form:form>
+    </div>
+</div>
+</body>
+</html>

+ 565 - 0
src/main/webapp/webpage/modules/projectrecord/implementStage/projectInterimPaymentList.jsp

@@ -0,0 +1,565 @@
+<%@ page contentType="text/html;charset=UTF-8" %>
+<%@ include file="/webpage/include/taglib.jsp"%>
+<html>
+<head>
+	<title>工程进度款信息</title>
+	<meta name="decorator" content="default"/>
+    <link href="${ctxStatic}/layer-v2.3/layui/tableTree/treetable.css" rel="stylesheet" />
+	<%--<script src="${ctxStatic}/layer-v2.3/laydate/laydate.js"></script>--%>
+    <style>
+        .layui-table th{
+            font-size: 14px;
+            /*表头内容居中显示*/
+            text-align: center;
+        }
+		.pid{
+			font-size:14px;
+			font-weight:400;
+		}
+    </style>
+	<script type="text/javascript">
+        $(document).ready(function() {
+
+            //搜索框收放
+            $('#moresee').click(function(){
+                if($('#moresees').is(':visible'))
+                {
+                    $('#moresees').slideUp(0,resizeListWindow2);
+                    $('#moresee i').removeClass("glyphicon glyphicon-menu-up").addClass("glyphicon glyphicon-menu-down");
+                }else{
+                    $('#moresees').slideDown(0,resizeListWindow2);
+                    $('#moresee i').removeClass("glyphicon glyphicon-menu-down").addClass("glyphicon glyphicon-menu-up");
+                }
+            });
+            laydate.render({
+                elem: '#beginDate', //目标元素。由于laydate.js封装了一个轻量级的选择器引擎,因此elem还允许你传入class、tag但必须按照这种方式 '#id .class'
+                event: 'focus', //响应事件。如果没有传入event,则按照默认的click
+                type : 'date'
+            });
+            laydate.render({
+                elem: '#endDate', //目标元素。由于laydate.js封装了一个轻量级的选择器引擎,因此elem还允许你传入class、tag但必须按照这种方式 '#id .class'
+                event: 'focus', //响应事件。如果没有传入event,则按照默认的click
+                type : 'date'
+            });
+        });
+
+        function reset() {
+            $("#searchForm").resetForm();
+        }
+
+        function openDialog(title,url,width,height,target) {
+
+            if (navigator.userAgent.match(/(iPhone|iPod|Android|ios)/i)) {//如果是移动端,就使用自适应大小弹窗
+                width = 'auto';
+                height = 'auto';
+            } else {//如果是PC端,根据用户设置的width和height显示。
+
+            }
+
+            top.layer.open({
+                type: 2,
+                area: [width, height],
+                title: title,
+                maxmin: true, //开启最大化最小化按钮
+                content: url,
+                skin: 'three-btns',
+                btn: ['送审', '暂存', '关闭'],
+                /*yes: function (index, layero) {
+                    var body = top.layer.getChildFrame('body', index);
+                    var iframeWin = layero.find('iframe')[0]; //得到iframe页的窗口对象,执行iframe页的方法:iframeWin.method();
+                    var inputForm = body.find('#inputForm');
+                    var top_iframe;
+                    if (target) {
+                        top_iframe = target;//如果指定了iframe,则在改frame中跳转
+                    } else {
+                        top_iframe = top.getActiveTab().attr("name");//获取当前active的tab的iframe
+                    }
+                    inputForm.attr("target", top_iframe);//表单提交成功后,从服务器返回的url在当前tab中展示
+
+                    if (iframeWin.contentWindow.doSubmit()) {
+                        // top.layer.close(index);//关闭对话框。
+                        setTimeout(function () {
+                            top.layer.close(index)
+                        }, 100);//延时0.1秒,对应360 7.1版本bug
+                    }
+
+                },*/
+                btn1: function(index, layero){
+                    var body = top.layer.getChildFrame('body', index);
+                    var iframeWin = layero.find('iframe')[0]; //得到iframe页的窗口对象,执行iframe页的方法:iframeWin.method();
+                    var inputForm = body.find('#inputForm');
+                    var top_iframe;
+                    if(target){
+                        top_iframe = target;//如果指定了iframe,则在改frame中跳转
+                    }else{
+                        top_iframe = top.getActiveTab().attr("name");//获取当前active的tab的iframe
+                    }
+                    inputForm.attr("target",top_iframe);//表单提交成功后,从服务器返回的url在当前tab中展示
+                    if(iframeWin.contentWindow.doSubmit(1) ){
+                        // top.layer.close(index);//关闭对话框。
+                        setTimeout(function(){top.layer.close(index)}, 100);//延时0.1秒,对应360 7.1版本bug
+                    }
+                },
+                btn2:function(index,layero){
+                    var body = top.layer.getChildFrame('body', index);
+                    var iframeWin = layero.find('iframe')[0]; //得到iframe页的窗口对象,执行iframe页的方法:iframeWin.method();
+                    var inputForm = body.find('#inputForm');
+                    var top_iframe;
+                    if(target){
+                        top_iframe = target;//如果指定了iframe,则在改frame中跳转
+                    }else{
+                        top_iframe = top.getActiveTab().attr("name");//获取当前active的tab的iframe
+                    }
+                    inputForm.attr("target",top_iframe);//表单提交成功后,从服务器返回的url在当前tab中展示
+                    if(iframeWin.contentWindow.doSubmit(2) ){
+                        // top.layer.close(index);//关闭对话框。
+                        setTimeout(function(){top.layer.close(index)}, 100);//延时0.1秒,对应360 7.1版本bug
+                    }else {
+                        return false;
+                    }
+                },
+                btn3: function (index) {
+                }
+            });
+        }
+
+        function openDialogre(title,url,width,height,target,buttons) {
+
+            if (navigator.userAgent.match(/(iPhone|iPod|Android|ios)/i)) {//如果是移动端,就使用自适应大小弹窗
+                width = 'auto';
+                height = 'auto';
+            } else {//如果是PC端,根据用户设置的width和height显示。
+
+            }
+            var split = buttons.split(",");
+            top.layer.open({
+                type: 2,
+                area: [width, height],
+                title: title,
+                maxmin: true, //开启最大化最小化按钮
+                skin: 'three-btns',
+                content: url,
+                btn: split,
+                btn1: function(index, layero){
+                    var body = top.layer.getChildFrame('body', index);
+                    var iframeWin = layero.find('iframe')[0]; //得到iframe页的窗口对象,执行iframe页的方法:iframeWin.method();
+                    var inputForm = body.find('#inputForm');
+                    var top_iframe;
+                    if(target){
+                        top_iframe = target;//如果指定了iframe,则在改frame中跳转
+                    }else{
+                        top_iframe = top.getActiveTab().attr("name");//获取当前active的tab的iframe
+                    }
+                    inputForm.attr("target",top_iframe);//表单提交成功后,从服务器返回的url在当前tab中展示
+                    if(iframeWin.contentWindow.doSubmit(1) ){
+                        // top.layer.close(index);//关闭对话框。
+                        setTimeout(function(){top.layer.close(index)}, 100);//延时0.1秒,对应360 7.1版本bug
+                    }
+                },
+                btn2:function(index,layero){
+                    if(split.length==2){return}
+                    var body = top.layer.getChildFrame('body', index);
+                    var iframeWin = layero.find('iframe')[0]; //得到iframe页的窗口对象,执行iframe页的方法:iframeWin.method();
+                    var inputForm = body.find('#inputForm');
+                    var top_iframe;
+                    if(target){
+                        top_iframe = target;//如果指定了iframe,则在改frame中跳转
+                    }else{
+                        top_iframe = top.getActiveTab().attr("name");//获取当前active的tab的iframe
+                    }
+                    inputForm.attr("target",top_iframe);//表单提交成功后,从服务器返回的url在当前tab中展示
+                    if(iframeWin.contentWindow.doSubmit(2) ){
+                        // top.layer.close(index);//关闭对话框。
+                        setTimeout(function(){top.layer.close(index)}, 100);//延时0.1秒,对应360 7.1版本bug
+                    }else {
+                        return false;
+                    }
+                },
+                btn3: function (index) {
+                }
+            });
+        }
+	</script>
+	<style>
+		body{
+			background-color:transparent;
+			filter:progid:DXImageTransform.Microsoft.gradient(startColorstr=#26FFFFFF, endColorstr=#26FFFFFF);
+			color:#ffffff;
+			background-color:rgba(255,255,255,0);
+			height:100%;
+		}
+	</style>
+</head>
+<body>
+<div class="wrapper wrapper-content">
+	<sys:message content="${message}"/>
+	<div class="layui-row">
+		<div class="full-width fl">
+			<div class="layui-row contentShadow shadowLR" id="queryDiv">
+				<form:form id="searchForm" modelAttribute="constructionContract" action="${ctx}/project/projectInterimPayment/" 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}"/>
+					<table:sortColumn id="orderBy" name="orderBy" value="${page.orderBy}" callback="sortOrRefresh();"/><!-- 支持排序 -->
+					<div class="commonQuery lw6">
+						<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">
+							</div>
+						</div>
+						<div class="layui-item athird">
+							<div class="input-group">
+								<a href="#" id="moresee"><i class="glyphicon glyphicon-menu-down"></i></a>
+								<button id="searchReset" class="fixed-btn searchReset fr" onclick="resetSearch()">重置</button>
+								<button id="searchQuery" class="fixed-btn searchQuery fr" onclick="search()">查询</button>
+							</div>
+						</div>
+						<div style="    clear:both;"></div>
+					</div>
+					<div id="moresees" style="clear:both;display:none;" class="lw6">
+						<div style="clear:both;"></div>
+					</div>
+				</form:form>
+			</div>
+		</div>
+		<div class="full-width fl">
+			<div class="layui-form contentDetails contentShadow shadowLBR">
+				<div class="nav-btns">
+					<button class="nav-btn layui-btn" id="btn-expand">全部展开</button>
+					<button class="nav-btn layui-btn-warm" id="btn-fold">全部折叠</button>
+					<button class="nav-btn nav-btn-refresh" data-toggle="tooltip" data-placement="left" onclick="sortOrRefresh()" title="刷新"><i class="glyphicon glyphicon-repeat"></i>&nbsp;刷新</button>
+                    <div style="clear: both;"></div>
+				</div>
+                <table id="permissionTable" class="layui-table" lay-filter="permissionTable"></table>
+				<!-- 分页代码 -->
+				<table:page page="${page}"></table:page>
+				<div style="clear: both;"></div>
+			</div>
+		</div>
+	</div>
+	<div id="changewidth"></div>
+</div>
+
+<script src="${ctxStatic}/layer-v2.3/layui/layui.all.js" charset="utf-8"></script>
+<script>
+
+    resizeListTable();
+    $("a").on("click",addLinkVisied);
+</script>
+<script>
+    resizeListWindow2();
+    $(window).resize(function(){
+        resizeListWindow2();
+    });
+</script>
+<script src="${ctxStatic}/layer-v2.3/layui/layui.all.js" charset="utf-8"></script>
+<script src="${ctxStatic}/layer-v2.3/layui/tableTree/treetable.js" charset="utf-8"></script>
+<script>
+    /*使用模块加载的方式 加载文件*/
+    layui.config({
+        base: '${ctx}/resoueces/css/layui/module/'
+    }).extend({
+        treetable: 'treetable-lay/treetable'
+    }).use(['layer', 'table', 'treetable'], function () {
+        var $ = layui.jquery;
+        var table = layui.table;
+        var layer = layui.layer;
+        var treetable = layui.treetable;
+
+        // 渲染表格
+        var renderTable = function () {
+        	var contractName = $("#contractName").val();
+        	if(undefined == contractName){
+				contractName = "";
+			}
+            layer.load(2);
+            treetable.render({
+                treeColIndex: 1,//树形图标显示在第几列
+                treeSpid: 0,//最上级的父级id
+                treeIdName: 'permissionId',//id字段的名称
+                treePidName: 'pid',//pid字段的名称
+                treeDefaultClose: true,//是否默认折叠
+                treeLinkage: true,//父级展开时是否自动展开所有子级
+                elem: '#permissionTable',
+                url: '${ctx}/project/projectInterimPayment/getProjectList?projectId=${constructionContract.projectId}&pageNo=${page.pageNo}&contractName='+contractName,
+                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){
+									return "<font>"+d.cnumber+"</font>";
+								}else{
+									return "<font>"+d.cnumber+"</font>";
+								}
+							}},
+						{rowspan: 2, field: 'contractName', align:'center' , width:200, title: '合同名称',templet:function(d){
+								if(0 == d.pid){
+									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 "";
+								}
+							}},
+						{ colspan: 3, title: '截至上期末'},
+						{ colspan: 5, title: '本期', field: 'option'},
+						{ colspan: 3, title: '截止本期末', field: 'option'},
+						{ 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){
+								return "";
+							}else{
+								return "<font>"+layui.util.toDateString(date,'yyyy-MM-dd')+"</font>";
+							}
+						}},
+						{ rowspan: 2, templet: complain, align:'center', title: '操作',width:130},
+					],
+                		[
+						{field: 'totalFinishCost', align:'center', title: '已累计完成价款' , width:100},
+						{field: 'totalPayCost', align:'center', title: '已累计支付价款' , width:100},
+						{field: 'payRatio', align:'center', title: '支付比例(%)' , width:100},
+
+						{field: 'completePrice', align:'center', title: '完成价款' , width:100},
+						{field: 'appointPay', align:'center', title: '按约定比例应支付价款' , width:150},
+						{field: 'advanceDeduct', align:'center', title: '应扣预付款' , width:100},
+						{field: 'restsDeduct', align:'center', title: '其他应扣款' , width:100},
+						{field: 'actualPay', align:'center', title: '实际应用支付' , width:100},
+
+						{field: 'nowTotalFinishCost', align:'center', title: '已累计完成价款' , width:100},
+						{field: 'nowTotalPayCost', align:'center', title: '已累计支付价款' , width:100},
+						{field: 'nowPayRatio', align:'center', title: '支付比例(%)' , width:100},
+					]
+				],
+                done: function () {
+                    layer.closeAll('loading');
+                }
+            });
+        };
+
+        renderTable();
+
+        //触发三个button按钮
+        $('#btn-expand').click(function () {
+            treetable.expandAll('#permissionTable');
+        });
+
+        $('#btn-fold').click(function () {
+            treetable.foldAll('#permissionTable');
+        });
+
+        $('#btn-refresh').click(function () {
+            renderTable();
+        });
+
+
+        function complain(d){//操作中显示的内容
+			if(d.pid=="0") {
+				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{
+					return [
+						'',
+					].join('');
+				}
+			} else if (d.pid!="0"){
+
+				/*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{
+					return [
+						'',
+					].join('');
+				}*/
+				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="${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{
+					return[''].join('');
+				}
+			}else{
+				return[''].join('');
+			}
+        }
+        //监听工具条
+        table.on('tool(permissionTable)', function (obj) {
+            var data = obj.data;
+            var layEvent = obj.event;
+            if(data.permissionName!=null){
+                if (layEvent === 'del') {
+                    layer.msg('删除' + data.id);
+                } else if (layEvent === 'edit') {
+                    layer.msg('修改' + data.id);
+                }
+            }
+        });
+    });
+
+</script>
+<script>
+	function openDialogres(title,url,width,height,target){
+
+		if(navigator.userAgent.match(/(iPhone|iPod|Android|ios)/i)){//如果是移动端,就使用自适应大小弹窗
+			width='auto';
+			height='auto';
+		}else{//如果是PC端,根据用户设置的width和height显示。
+
+		}
+		top.layer.open({
+			type: 2,
+			area: [width, height],
+			title: title,
+			skin: 'three-btns',
+			maxmin: true, //开启最大化最小化按钮
+			content: url ,
+			btn: ['提交','暂存','关闭'],
+			btn1: function(index, layero){
+				var body = top.layer.getChildFrame('body', index);
+				var iframeWin = layero.find('iframe')[0]; //得到iframe页的窗口对象,执行iframe页的方法:iframeWin.method();
+				var inputForm = body.find('#inputForm');
+				var top_iframe;
+				if(target){
+					top_iframe = target;//如果指定了iframe,则在改frame中跳转
+				}else{
+					top_iframe = top.getActiveTab().attr("name");//获取当前active的tab的iframe
+				}
+				inputForm.attr("target",top_iframe);//表单提交成功后,从服务器返回的url在当前tab中展示
+				if(iframeWin.contentWindow.doSubmit(1) ){
+					//top.layer.close(index);//关闭对话框。
+					setTimeout(function(){top.layer.close(index)}, 100);//延时0.1秒,对应360 7.1版本bug
+				}
+			},
+			btn2:function(index,layero){
+				var body = top.layer.getChildFrame('body', index);
+				var iframeWin = layero.find('iframe')[0]; //得到iframe页的窗口对象,执行iframe页的方法:iframeWin.method();
+				var inputForm = body.find('#inputForm');
+				var top_iframe;
+				if(target){
+					top_iframe = target;//如果指定了iframe,则在改frame中跳转
+				}else{
+					top_iframe = top.getActiveTab().attr("name");//获取当前active的tab的iframe
+				}
+				inputForm.attr("target",top_iframe);//表单提交成功后,从服务器返回的url在当前tab中展示
+				if(iframeWin.contentWindow.doSubmit(2) ){
+					// top.layer.close(index);//关闭对话框。
+					setTimeout(function(){top.layer.close(index)}, 100);//延时0.1秒,对应360 7.1版本bug
+				}
+				return false;
+			},
+			btn3: function(index){
+			}
+		});
+	}
+	function openDialogreAudit(title,url,width,height,target){
+
+		if(navigator.userAgent.match(/(iPhone|iPod|Android|ios)/i)){//如果是移动端,就使用自适应大小弹窗
+			width='auto';
+			height='auto';
+		}else{//如果是PC端,根据用户设置的width和height显示。
+
+		}
+		top.layer.open({
+			type: 2,
+			area: [width, height],
+			title: title,
+			skin: 'three-btns',
+			maxmin: true, //开启最大化最小化按钮
+			content: url ,
+			btn: ['提交','关闭'],
+			btn1: function(index, layero){
+				var body = top.layer.getChildFrame('body', index);
+				var iframeWin = layero.find('iframe')[0]; //得到iframe页的窗口对象,执行iframe页的方法:iframeWin.method();
+				var inputForm = body.find('#inputForm');
+				var top_iframe;
+				if(target){
+					top_iframe = target;//如果指定了iframe,则在改frame中跳转
+				}else{
+					top_iframe = top.getActiveTab().attr("name");//获取当前active的tab的iframe
+				}
+				inputForm.attr("target",top_iframe);//表单提交成功后,从服务器返回的url在当前tab中展示
+				if(iframeWin.contentWindow.doSubmit(1) ){
+					top.layer.close(index);//关闭对话框。
+					setTimeout(function(){top.layer.close(index)}, 100);//延时0.1秒,对应360 7.1版本bug
+				}
+			},
+			btn2: function(index){
+			}
+		});
+	}
+	// 确认对话框
+	function confirmxRefresh(mess, href){
+		top.layer.confirm(mess, {icon: 3, title:'系统提示'}, function(index){
+			//do something
+			if (typeof href == 'function') {
+				href();
+			}else{
+				resetTip(); //loading();
+				$.ajax({
+					url:href,
+					data:$('#loginForm').serialize(),
+					type:"post",
+					success:function(data){
+						if(data.status){
+							parent.layer.msg(data.msg,{icon:1});
+						}else {
+							parent.layer.msg(data.msg,{icon:2});
+						}
+						//parent.refreshTrees();
+						location = '${ctx}/project/projectEarlyReview/list';
+					}
+				});
+			}
+			top.layer.close(index);
+		});
+		return false;
+	}
+
+	function openDialogWork1(title,url,width,height,target){
+		top.layer.open({
+			type: 2,
+			area: [width, height],
+			title: title,
+			maxmin: true, //开启最大化最小化按钮
+			content: url ,
+			btn: ['关闭'],
+			end:function(index){
+				top.layer.close(index)
+			}
+		});
+	}
+</script>
+</body>
+</html>

+ 120 - 0
src/main/webapp/webpage/modules/sys/gridselectProjectList.jsp

@@ -0,0 +1,120 @@
+<%@ page contentType="text/html;charset=UTF-8" %>
+<%@ include file="/webpage/include/taglib.jsp"%>
+<html>
+<head>
+	<meta name="decorator" content="default"/>
+	<script type="text/javascript">
+		$(document).ready(function() {
+			
+		
+
+			    $('#contentTable thead tr th input.i-checks').on('ifChecked', function(event){ //ifCreated 事件应该在插件初始化之前绑定 
+			    	  $('#contentTable tbody tr td input.i-checks').iCheck('check');
+			    	});
+
+			    $('#contentTable thead tr th input.i-checks').on('ifUnchecked', function(event){ //ifCreated 事件应该在插件初始化之前绑定 
+			    	  $('#contentTable tbody tr td input.i-checks').iCheck('uncheck');
+			    	});
+			    
+			
+		});
+
+		function getSelectedItem(){
+
+			var size = $("#contentTable tbody tr td input.i-checks:checked").size();
+			  if(size == 0 ){
+					top.layer.alert('请至少选择一条数据!', {icon: 0, title:'警告'});
+					return "-1";
+				  }
+
+			  if(size > 1 ){
+					top.layer.alert('只能选择一条数据!', {icon: 0, title:'警告'});
+					return "-1";
+				  }
+			    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();
+                return id+"_item_"+label;
+		}
+		function page(n,s){
+			if(n) $("#pageNo").val(n);
+			if(s) $("#pageSize").val(s);
+			$("#searchForm").attr("action","${url}");
+			$("#searchForm").submit();
+	    	return false;
+	    }
+	</script>
+</head>
+<body class="gray-bg">
+	<div class="">
+    <div class="ibox-content">
+		<!-- 查询条件 -->
+	<div class="row">
+	<div class="col-sm-12">
+	<form:form id="searchForm" modelAttribute="obj" action="${url}" method="post" class="form-inline">
+		<input type="hidden" name="url" value="${url}"/>
+		<input type="hidden" name="fieldLabels" value="${fieldLabels}"/>
+		<input type="hidden" name="fieldKeys" value="${fieldKeys}"/>
+		<input type="hidden" name="searchKey" value="${searchKey}"/>
+		<input id="pageNo" name="pageNo" type="hidden" value="${page.pageNo}"/>
+		<input id="pageSize" name="pageSize" type="hidden" value="${page.pageSize}"/>
+		<table:sortColumn id="orderBy" name="orderBy" value="${page.orderBy}" callback="sortOrRefresh();"/><!-- 支持排序 -->
+		<div class="form-group">
+			<span>${searchLabel}:</span>
+				<form:input path="projectName" htmlEscape="false" maxlength="50" class=" form-control input-sm"/>
+		
+		 </div>	
+	</form:form>
+	<br/>
+	</div>
+	</div>
+	
+	<!-- 工具栏 -->
+	<div class="row">
+	<div class="col-sm-12">
+		<div class="pull-right">
+			<button  class="btn btn-primary btn-rounded btn-outline btn-sm " style="margin-right:10px;border:none;background:#0f92fb;border-radius: 0;color:#fff;width:40px" onclick="search()" >查询</button>
+			<button  class="btn btn-primary btn-rounded btn-outline btn-sm " style="margin-right:30px;border:none;background:#34bf49;border-radius: 0;color:#fff;width:40px" onclick="reset()" >重置</button>
+		</div>
+	</div>
+	</div>
+	
+	<table id="contentTable" class="table table-striped table-bordered table-hover table-condensed dataTables-example dataTable">
+		<thead>
+			<tr>
+				<th></th>
+				<th>项目编号</th>
+				<th>项目名称</th>
+				<th>负责人</th>
+			</tr>
+		</thead>
+		<tbody>
+		<c:choose>
+		<c:when test="${not empty page.list}">
+		<c:forEach items="${page.list}" var="obj2">
+				<tr>
+					<td style="text-align:center;"> <input type="checkbox" id="${fns:getValue(obj2, 'id')}" class="i-checks"></td>
+					<td style="text-align:center;" class="codelabel4">${fns:getValue(obj2, 'projectId')}</td>
+					<td style="text-align:center;" class="codelabel">${fns:getValue(obj2, 'projectName')}</td>
+                    <td style="text-align:center;" class="codelabel3">${obj2.leaderNameStr}</td>
+				</tr>
+		</c:forEach>
+		</c:when>
+			<c:otherwise>
+				<tr>
+					<td colspan="15" align="center">
+						暂无数据
+					</td>
+				</tr>
+			</c:otherwise>
+		</c:choose>
+
+		</tbody>
+	</table>
+	<table:page page="${page}"></table:page>
+	<br/>
+	<br/>
+	</div>
+</div>
+</body>
+</html>