Просмотр исходного кода

修改工程进度款增删改查信息和施工合同管理信息

user5 4 лет назад
Родитель
Сommit
12e957c3ea

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

@@ -2,7 +2,11 @@ package com.jeeplus.modules.projectrecord.dao.implementStage;
 
 import com.jeeplus.common.persistence.CrudDao;
 import com.jeeplus.common.persistence.annotation.MyBatisDao;
+import com.jeeplus.modules.projectcontentinfo.entity.ProjectContentData;
+import com.jeeplus.modules.projectcontentinfo.entity.Projectcontentinfo;
+import com.jeeplus.modules.projectrecord.entity.ConcealProjectInfo;
 import com.jeeplus.modules.projectrecord.entity.ProjectPaymentTreeData;
+import org.apache.ibatis.annotations.Param;
 
 import java.util.List;
 
@@ -20,4 +24,43 @@ public interface ProjectInterimPaymentDao  extends CrudDao<ProjectPaymentTreeDat
      * @return
      */
     List<ProjectPaymentTreeData> projectPaymentFindList(String contractId);
+
+    /**
+     * 获取工程进度款基本信息
+     * @param contractId
+     * @return
+     */
+    List<ProjectContentData> getInterimPaymentList(String contractId);
+    /**
+     * 根据id查询信息
+     * @param id
+     * @return
+     */
+    ProjectContentData getInterimPaymentData(String id);
+
+    List<Projectcontentinfo> findListByProject(Projectcontentinfo projectcontentinfo);
+
+
+    /**
+     * 添加工程进度款管理信息
+     * @param projectContentData
+     * @return
+     */
+    Integer saveInterimPayment(ProjectContentData projectContentData);
+    /**
+     * 修改工程进度款管理信息
+     * @param projectContentData
+     * @return
+     */
+    Integer upodateInterimPayment(ProjectContentData projectContentData);
+
+    int deleteBasedData(@Param("contentId") String contentId, @Param("basedId") String basedId);
+
+
+    /**
+     * 删除文件
+     * @param concealProjectInfo
+     * @return
+     */
+    Integer deleteInterimPayment(ConcealProjectInfo concealProjectInfo);
 }

+ 122 - 2
src/main/java/com/jeeplus/modules/projectrecord/service/implementStage/ProjectInterimPaymentService.java

@@ -1,16 +1,27 @@
 package com.jeeplus.modules.projectrecord.service.implementStage;
 
 import com.jeeplus.common.service.CrudService;
+import com.jeeplus.common.utils.MyBeanUtils;
+import com.jeeplus.common.utils.StringUtils;
+import com.jeeplus.modules.projectcontentinfo.entity.ProjectBasedData;
+import com.jeeplus.modules.projectcontentinfo.entity.ProjectContentData;
+import com.jeeplus.modules.projectcontentinfo.entity.Projectcontentinfo;
+import com.jeeplus.modules.projectcontentinfo.service.ProjectContentDataService;
 import com.jeeplus.modules.projectrecord.dao.implementStage.ProjectInterimPaymentDao;
+import com.jeeplus.modules.projectrecord.entity.ConcealProjectInfo;
 import com.jeeplus.modules.projectrecord.entity.ProjectPaymentTreeData;
+import com.jeeplus.modules.sys.dao.WorkattachmentDao;
+import com.jeeplus.modules.sys.entity.Workattachment;
 import com.jeeplus.modules.sys.utils.UserUtils;
 import com.jeeplus.modules.workclientinfo.dao.WorkClientAttachmentDao;
 import com.jeeplus.modules.workclientinfo.entity.WorkClientAttachment;
-import org.apache.commons.lang3.StringUtils;
+import com.jeeplus.modules.workcontent.service.WorkScheduleService;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 
+import java.net.URLDecoder;
+import java.util.ArrayList;
 import java.util.List;
 
 /**
@@ -24,6 +35,12 @@ public class ProjectInterimPaymentService extends CrudService<ProjectInterimPaym
 
     @Autowired
     private WorkClientAttachmentDao workClientAttachmentDao;
+    @Autowired
+    private WorkattachmentDao workattachmentDao;
+    @Autowired
+    private WorkScheduleService workScheduleService;
+    @Autowired
+    private ProjectContentDataService projectContentDataService;
 
 
     public ProjectPaymentTreeData get(String id) {
@@ -36,11 +53,100 @@ public class ProjectInterimPaymentService extends CrudService<ProjectInterimPaym
     }
 
     /**
+     * 获取工程进度款基本信息
+     * @param id
+     * @return
+     */
+    @Transactional(readOnly = true)
+    public List<ProjectContentData> getInterimPaymentList(String id) {
+        List<ProjectContentData> projectVisaList=dao.getInterimPaymentList(id);
+        return projectVisaList;
+    }
+
+    public ProjectContentData getInterimPaymentData(String id) {
+        ProjectContentData projectContentData = dao.getInterimPaymentData(id);
+        if(projectContentData!=null){
+            Workattachment workattachment = new Workattachment();
+            workattachment.setAttachmentId(id);
+            projectContentData.setWorkAttachments(workattachmentDao.findList(workattachment));
+        }
+        return projectContentData;
+    }
+
+    /**
      * 新增方法
-     * @param projectPaymentTreeData
+     * @param concealProjectInfo
      * @return
      */
     @Transactional(readOnly = false)
+    public String saveData(ConcealProjectInfo concealProjectInfo) throws Exception {
+        Projectcontentinfo s = new Projectcontentinfo();
+        s.setParentIds("0,");
+        s.setProject(concealProjectInfo.getProject());
+        //根据项目id查询相关工作内容信息的数据 并将其存为父级数据
+        Projectcontentinfo contentinfo = dao.findListByProject(s).get(0);
+        //保存工作内容相关数据
+        ProjectContentData projectContentData = concealProjectInfo.getProjectContentData();
+        if(com.jeeplus.common.utils.StringUtils.isNotBlank(projectContentData.getId())){
+            ProjectContentData oldData = dao.getInterimPaymentData(projectContentData.getId());
+            MyBeanUtils.copyBeanNotNull2Bean(projectContentData, oldData);
+            projectContentData = oldData;
+        }
+        projectContentData.setCompanyId(contentinfo.getCompanyId());
+        projectContentData.setOfficeId(contentinfo.getOfficeId());
+        projectContentData.setContractId(concealProjectInfo.getContract().getId());
+        if(com.jeeplus.common.utils.StringUtils.isNotBlank(projectContentData.getId())){
+            projectContentData.preUpdate();
+            dao.upodateInterimPayment(projectContentData);
+        }else{
+            projectContentData.preInsert();
+            dao.saveInterimPayment(projectContentData);
+        }
+        //保存工作内容详情
+        if(com.jeeplus.common.utils.StringUtils.isNotBlank(projectContentData.getContentDetail())) {
+            workScheduleService.saveDetails(URLDecoder.decode(projectContentData.getContentDetail(),"UTF-8"), concealProjectInfo.getProject().getId(), projectContentData.getId());
+        }
+        //保存依据资料信息
+        if(projectContentData.getProjectBasedDataList()!=null&&!projectContentData.getProjectBasedDataList().isEmpty()){
+            for (ProjectBasedData data:projectContentData.getProjectBasedDataList()) {
+                if (data.getDelFlag().equals("0")){
+                    List<ProjectBasedData> projectBasedData = new ArrayList<>();
+                    if(com.jeeplus.common.utils.StringUtils.isNotBlank(data.getName())){
+                        projectBasedData.add(data);
+                        projectContentDataService.saveBasedData(projectContentData.getId(),projectBasedData);
+                    }
+                }
+            }
+        }
+
+        if (concealProjectInfo.getWorkAttachments()!=null && !concealProjectInfo.getWorkAttachments().isEmpty()) {
+            //保存附件信息
+            for (WorkClientAttachment workClientAttachment : concealProjectInfo.getWorkAttachments()) {
+                if (com.jeeplus.common.utils.StringUtils.isBlank(workClientAttachment.getId())&& com.jeeplus.common.utils.StringUtils.isNotBlank(workClientAttachment.getAttachmentId())) {
+                    continue;
+                }
+                if (com.jeeplus.common.utils.StringUtils.isBlank(workClientAttachment.getId())&& com.jeeplus.common.utils.StringUtils.isBlank(workClientAttachment.getUrl())) {
+                    continue;
+                }
+                if (WorkClientAttachment.DEL_FLAG_NORMAL.equals(workClientAttachment.getDelFlag())) {
+                    workClientAttachment.setAttachmentId(projectContentData.getId());
+                    workClientAttachment.setAttachmentFlag("135");
+                    workClientAttachment.setAttachmentUser(UserUtils.getUser().getId());
+                    if (StringUtils.isBlank(workClientAttachment.getId()) || "null".equals(workClientAttachment.getId())) {
+                        workClientAttachment.preInsert();
+                        workClientAttachmentDao.insert(workClientAttachment);
+                    } else {
+                        workClientAttachment.preUpdate();
+                        workClientAttachmentDao.update(workClientAttachment);
+                    }
+                } else {
+                    workClientAttachmentDao.delete(workClientAttachment);
+                }
+            }
+        }
+        return "true";
+    }
+    /*@Transactional(readOnly = false)
     public void save(ProjectPaymentTreeData projectPaymentTreeData) {
         //判断是否为修改信息
         if (projectPaymentTreeData.getIsNewRecord()){
@@ -75,5 +181,19 @@ public class ProjectInterimPaymentService extends CrudService<ProjectInterimPaym
                 }
             }
         }
+    }*/
+
+    @Transactional(readOnly = false)
+    public void deleteBased(String contentId,String basedId) {
+        int i = dao.deleteBasedData(contentId, basedId);
+        if(i==0){
+            return;
+        }
+    }
+
+
+    @Transactional(readOnly = false)
+    public void deleteInterimPayment(ConcealProjectInfo concealProjectInfo){
+        dao.deleteInterimPayment(concealProjectInfo);
     }
 }

+ 195 - 11
src/main/java/com/jeeplus/modules/projectrecord/web/implementStage/ProjectInterimPaymentController.java

@@ -1,24 +1,31 @@
 package com.jeeplus.modules.projectrecord.web.implementStage;
 
 import com.jeeplus.common.config.Global;
+import com.jeeplus.common.json.AjaxJson;
 import com.jeeplus.common.persistence.Page;
 import com.jeeplus.common.utils.StringUtils;
+import com.jeeplus.common.web.BaseController;
 import com.jeeplus.modules.projectConstruction.entity.ConstructionContract;
 import com.jeeplus.modules.projectConstruction.service.ContractService;
+import com.jeeplus.modules.projectVisa.entity.VisaTreeData;
+import com.jeeplus.modules.projectcontentinfo.entity.ProjectContentData;
+import com.jeeplus.modules.projectcontentinfo.service.ProjectContentDataService;
+import com.jeeplus.modules.projectcontroltable.entity.ProjectControlTable;
+import com.jeeplus.modules.projectcontroltable.service.ProjectControlTableService;
+import com.jeeplus.modules.projectrecord.entity.ConcealProjectInfo;
 import com.jeeplus.modules.projectrecord.entity.ProjectImplementEarly;
 import com.jeeplus.modules.projectrecord.entity.ProjectPaymentTreeData;
 import com.jeeplus.modules.projectrecord.service.ProjectImplementEarlyService;
 import com.jeeplus.modules.projectrecord.service.implementStage.ProjectInterimPaymentService;
 import com.jeeplus.modules.sys.entity.User;
 import com.jeeplus.modules.sys.utils.UserUtils;
-import com.jeeplus.modules.workclientinfo.dao.WorkClientAttachmentDao;
-import com.jeeplus.modules.workclientinfo.entity.WorkClientAttachment;
 import org.apache.shiro.authz.annotation.RequiresPermissions;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Controller;
 import org.springframework.ui.Model;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.ResponseBody;
+import org.springframework.web.servlet.mvc.support.RedirectAttributes;
 
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
@@ -33,7 +40,7 @@ import java.util.*;
  */
 @Controller
 @RequestMapping(value = "${adminPath}/project/projectInterimPayment")
-public class ProjectInterimPaymentController {
+public class ProjectInterimPaymentController extends BaseController {
     @Autowired
     private ContractService contractService;
     @Autowired
@@ -41,7 +48,9 @@ public class ProjectInterimPaymentController {
     @Autowired
     private ProjectImplementEarlyService projectImplementEarlyService;
     @Autowired
-    private WorkClientAttachmentDao workClientAttachmentDao;
+    private ProjectControlTableService projectControlTableService;
+    @Autowired
+    private ProjectContentDataService projectContentDataService;
 
     /**
      * 合同列表页面
@@ -61,9 +70,119 @@ public class ProjectInterimPaymentController {
         return "modules/projectrecord/implementStage/projectInterimPaymentList";
     }
 
+    //获取树状图
+    @RequestMapping(value = "getProjectList")
+    @ResponseBody
+    public Map<String, List> getTreeList(ConstructionContract constructionContract, HttpServletRequest request, HttpServletResponse response, Model model){
+
+        Map<String,List> map = new HashMap<>();
+        ProjectImplementEarly projectRecords = new ProjectImplementEarly();
+        if(StringUtils.isNotBlank(constructionContract.getProjectName())){
+            projectRecords.setProjectName(constructionContract.getProjectName());
+        }
+        Page<ProjectImplementEarly> recordPage = projectImplementEarlyService.findProjectPage(new Page<ProjectImplementEarly>(request, response), projectRecords);
+        //获取项目信息
+        List<ProjectImplementEarly> recordList = recordPage.getList();
+        //新建树形列表集合
+        List<VisaTreeData> treeList=new ArrayList<>();
+        if(recordList.size()>0){
+            for (ProjectImplementEarly record:recordList) {
+                //将项目信息放入树形列表集合中
+                VisaTreeData recordTreeData = new VisaTreeData();
+                //将界面需要展示数据放入类中
+                recordTreeData.setId(record.getId());
+                recordTreeData.setContractName(record.getProjectName());
+                recordTreeData.setCnumber(record.getProjectId());
+                recordTreeData.setNumber("");
+                recordTreeData.setPid("0");
+                //将项目设置为第一级数据
+                recordTreeData.setCondition(1);
+                //将项目信息放入
+                treeList.add(recordTreeData);
+
+                //处理合同信息数据
+                ConstructionContract conditionContract = new ConstructionContract();
+                conditionContract.setProjectId(record.getId());
+
+                if(StringUtils.isNotBlank(constructionContract.getContractName())){
+                    conditionContract.setContractName(constructionContract.getContractName());
+                }
+                //获取合同信息
+                List<ConstructionContract> contractList = contractService.getConstructionContractList(conditionContract);
+                if(contractList.size()>0){
+                    //遍历项目中的合同信息
+                    for (ConstructionContract contract:contractList) {
+                        VisaTreeData visaTreeData=new VisaTreeData();
+                        visaTreeData.setContractId(contract.getId());
+                        visaTreeData.setId(contract.getId());
+                        visaTreeData.setContractName(contract.getContractName());
+                        visaTreeData.setDate(contract.getCreateDate());
+                        visaTreeData.setNumber("");
+                        visaTreeData.setPid(record.getId());
+                        visaTreeData.setCnumber(contract.getCnumber());
+
+                        //将项目设置为第二级数据
+                        visaTreeData.setCondition(2);
+                        //遍历项目负责人信息
+                        List<User> masterUserList = record.getProjectLeaders();
+                        List<String> masterList = new ArrayList<>();
+                        Set masterIdSet = new HashSet();
+                        for (User masterUser:masterUserList) {
+                            masterList.add(masterUser.getName());
+                            masterIdSet.add(masterUser.getId());
+                        }
+                        //Set转List
+                        List<String> masterIdList = new ArrayList<>(masterIdSet);
+                        for (String masterId : masterIdList) {
+                            if(masterId.equals(UserUtils.getUser().getId())){
+                                visaTreeData.setOperationSign(1);
+                                break;
+                            }else{
+                                visaTreeData.setOperationSign(0);
+                            }
+                        }
+
+                        //将项目信息放入
+                        treeList.add(visaTreeData);
+
+
+                        //根据获取的合同的id去查找汇总表获取汇总表信息
+                        List<ProjectContentData> contentDataList=service.getInterimPaymentList(contract.getId());
+                        for (int j=0;j<contentDataList.size();j++){
+                            VisaTreeData contentData=new VisaTreeData();
+                            ProjectContentData data=contentDataList.get(j);
+                            contentData.setPid(data.getContractId());
+                            contentData.setId(data.getId());
+                            contentData.setContractName(data.getName());
+                            contentData.setCnumber(contract.getCnumber());
+                            contentData.setNumber(data.getNumber());
+                            contentData.setProjectId(record.getId());
+
+                            //将项目设置为第二级数据
+                            contentData.setCondition(3);
+                            for (String masterId : masterIdList) {
+                                if(masterId.equals(UserUtils.getUser().getId())){
+                                    contentData.setOperationSign(1);
+                                    break;
+                                }else{
+                                    contentData.setOperationSign(0);
+                                }
+                            }
+                            treeList.add(contentData);
+                        }
+
+                    }
+                }
+            }
+
+        }
+        map.put("data",treeList);
+        return map;
+    }
+
     /**
      * 项目列表页面
-     */
+     *//*
     @RequestMapping(value = "getProjectList")
     @ResponseBody
     public Map<String,List> getProjectList(ConstructionContract constructionContract, HttpServletRequest request, HttpServletResponse response, Model model) {
@@ -209,8 +328,13 @@ public class ProjectInterimPaymentController {
 
         map.put("data",projectRecordTreeDataList);
         return map;
-    }
+    }*/
 
+    /**
+     * double保存两位小数
+     * @param value
+     * @return
+     */
     private static Double formatDouble(Double value) {
         BigDecimal bd = new BigDecimal(value);
         bd = bd.setScale(2, RoundingMode.HALF_UP);
@@ -220,11 +344,36 @@ public class ProjectInterimPaymentController {
 
     /**
      * 跳转方法
-     * @param projectPaymentTreeData
+     * @param concealProjectInfo
      * @param model
      * @return
      */
-    @RequestMapping(value = {"form"})
+    @RequestMapping(value = "form")
+    public String form(ConcealProjectInfo concealProjectInfo, Model model) {
+
+        ProjectContentData projectContentData = new ProjectContentData();
+        projectContentData.setType("");
+        if (StringUtils.isNotBlank(concealProjectInfo.getInfoId())){
+            projectContentData = service.getInterimPaymentData(concealProjectInfo.getInfoId());
+        }else if (concealProjectInfo.getProjectContentData()!=null && StringUtils.isNotBlank(concealProjectInfo.getProjectContentData().getId())) {
+            projectContentData = service.getInterimPaymentData(concealProjectInfo.getProjectContentData().getId());
+        }
+        projectContentData.setMaster(UserUtils.getUser());
+        if(StringUtils.isNotBlank(projectContentData.getId())){
+            List<ProjectControlTable> controlData = projectControlTableService.getControlData(projectContentData.getId(),"");
+            projectContentData.setProjectControlTableList(controlData);
+            projectContentDataService.queryBasedData(projectContentData);
+        }
+
+        concealProjectInfo.setProjectContentData(projectContentData);
+        model.addAttribute("concealProjectInfo", concealProjectInfo);
+        if("view".equals(concealProjectInfo.getType())){
+            return "modules/projectrecord/implementStage/projectInterimPaymentFormView";
+        }
+        return "modules/projectrecord/implementStage/projectInterimPaymentForm";
+    }
+
+    /*@RequestMapping(value = {"form"})
     public String form(ProjectPaymentTreeData projectPaymentTreeData,Model model) {
         if (projectPaymentTreeData!=null&&StringUtils.isNotBlank(projectPaymentTreeData.getId())) {
             projectPaymentTreeData = service.get(projectPaymentTreeData.getId());
@@ -241,14 +390,20 @@ public class ProjectInterimPaymentController {
         }
         model.addAttribute("projectPaymentTreeData", projectPaymentTreeData);
         return "modules/projectrecord/implementStage/projectInterimPaymentForm";
-    }
+    }*/
 
 
     /**
      * 添加工程款信息
      */
     @RequestMapping(value = "save")
-    public String save(ProjectPaymentTreeData projectPaymentTreeData) {
+    public String save(ConcealProjectInfo concealProjectInfo, RedirectAttributes redirectAttributes) throws Exception {
+
+        String str = service.saveData(concealProjectInfo);
+        addMessage(redirectAttributes, "保存工程进度款信息"+(str.equals("true")?"成功":"失败"));
+        return "redirect:"+Global.getAdminPath()+"/project/projectInterimPayment/?repage";
+    }
+    /*public String save(ProjectPaymentTreeData projectPaymentTreeData) {
         projectPaymentTreeData.setCompletePrice(shiftDouble(projectPaymentTreeData.getCompletePriceStr()));
         projectPaymentTreeData.setAppointPay(shiftDouble(projectPaymentTreeData.getAppointPayStr()));
         projectPaymentTreeData.setAdvanceDeduct(shiftDouble(projectPaymentTreeData.getAdvanceDeductStr()));
@@ -256,7 +411,7 @@ public class ProjectInterimPaymentController {
         projectPaymentTreeData.setActualPay(shiftDouble(projectPaymentTreeData.getActualPayStr()));
         service.save(projectPaymentTreeData);
         return "redirect:"+ Global.getAdminPath()+"/project/projectInterimPayment/?repage";
-    }
+    }*/
 
 
     private static Double shiftDouble(String moneyStr){
@@ -268,6 +423,35 @@ public class ProjectInterimPaymentController {
         return null;
     }
 
+    @RequestMapping("ajaxdelete")
+    @ResponseBody
+    public AjaxJson deleteBased(String contentId, String basedId){
+        AjaxJson ajaxJson = new AjaxJson();
+        try {
+            if (StringUtils.isNotBlank(contentId)) {
+                service.deleteBased(contentId, basedId);
+            }
+            Integer count = projectContentDataService.countBased(basedId);
+            ajaxJson.getBody().put("inuse", count == null ? true : count > 0);
+        }catch (Exception e){
+            logger.error("删除依据资料异常!",e);
+            ajaxJson.setSuccess(false);
+            ajaxJson.setMsg("删除依据资料失败");
+        }
+        return  ajaxJson;
+    }
+
+    /**
+     * 工程进度款删除方法
+     * @param concealProjectInfo
+     * @return
+     */
+    @RequestMapping(value = {"deleteInterimPayment"})
+    public String deleteInterimPayment(ConcealProjectInfo concealProjectInfo) {
+        service.deleteInterimPayment(concealProjectInfo);
+        return "redirect:"+ Global.getAdminPath()+"/project/projectInterimPayment/?repage";
+    }
+
     /**
      * 删除工程款信息
      */

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

@@ -19,6 +19,42 @@
 		a.contract_id as "contractId",
 		a.pay_date as "payDate"
 	</sql>
+
+
+	<sql id="projectInterimPaymentColumns">
+		a.id AS "id",
+		a.create_by AS "createBy.id",
+		a.create_date AS "createDate",
+		a.update_by AS "updateBy.id",
+		a.update_date AS "updateDate",
+		a.remarks AS "remarks",
+		a.del_flag AS "delFlag",
+		a.company_id AS "companyId",
+		a.office_id AS "officeId",
+		a.name as "name",
+		a.contract_id as "contractId"
+	</sql>
+
+	<sql id="projectcontentinfoColumns">
+		a.id AS "id",
+		a.create_by AS "createBy.id",
+		a.create_date AS "createDate",
+		a.update_by AS "updateBy.id",
+		a.update_date AS "updateDate",
+		a.remarks AS "remarks",
+		a.del_flag AS "delFlag",
+		a.parent_id AS "parent.id",
+		a.parent_ids AS "parentIds",
+		a.sort AS "sort",
+		a.project_id AS "project.id",
+		a.company_id AS "companyId",
+		a.office_id AS "officeId",
+		a.type AS "type",
+		a.info_id AS "infoId",
+		a.dict_type AS "dictType",
+		a.name AS "name",
+		a.link_id AS "linkId"
+	</sql>
 	
     
 	<select id="get" resultType="com.jeeplus.modules.projectrecord.entity.ProjectPaymentTreeData" >
@@ -28,6 +64,97 @@
 		WHERE a.id = #{id}
 	</select>
 
+	<select id="getInterimPaymentList" resultType="ProjectContentData">
+		SELECT
+		<include refid="projectInterimPaymentColumns"/>
+		from project_interim_payment_info a
+		where a.contract_id = #{contractId}  and del_flag=0
+		ORDER BY a.update_date DESC
+	</select>
+
+	<select id="getInterimPaymentData" resultType="ProjectContentData">
+		SELECT
+		<include refid="projectInterimPaymentColumns"/>
+		from project_interim_payment_info a
+		where a.id = #{id} and del_flag=0
+	</select>
+
+	<select id="findListByProject" resultType="Projectcontentinfo" >
+		SELECT
+		<include refid="projectcontentinfoColumns"/>
+		FROM project_content_info a
+		<where>
+			a.del_flag = #{DEL_FLAG_NORMAL}
+			AND a.parent_ids = #{parentIds}
+			AND a.project_id = #{project.id}
+		</where>
+		<choose>
+			<when test="page !=null and page.orderBy != null and page.orderBy != ''">
+				ORDER BY ${page.orderBy}
+			</when>
+			<otherwise>
+				ORDER BY a.sort DESC
+			</otherwise>
+		</choose>
+	</select>
+
+	<insert id="saveInterimPayment">
+		insert into project_interim_payment_info (
+			id,
+			create_by,
+			create_date,
+			update_by,
+			update_date,
+			remarks,
+			del_flag,
+			company_id,
+			office_id,
+			contract_id,
+			`name`,
+			`number`,
+			master
+			)
+		values
+			(
+			#{id},
+			#{createBy.id},
+			#{createDate},
+			#{updateBy.id},
+			#{updateDate},
+			#{remarks},
+			#{delFlag},
+			#{companyId},
+			#{officeId},
+			#{contractId},
+			#{name},
+			#{number},
+			#{master.id}
+			)
+	</insert>
+
+	<update id="upodateInterimPayment">
+		update
+		  project_interim_payment_info
+		set
+		  update_by = #{updateBy.id},
+		  update_date = #{updateDate},
+		  remarks = #{remarks},
+		  name = #{name},
+		  master = #{master.id}
+		where id = #{id}
+	</update>
+
+	<update id="deleteBasedData">
+        DELETE FROM project_content_based WHERE content_id = #{contentId} and based_id = #{basedId}
+    </update>
+
+
+	<delete id="deleteInterimPayment">
+		update project_interim_payment_info
+		set del_flag = 1
+		where id = #{id}
+	</delete>
+
 	<select id="projectPaymentFindList" resultType="com.jeeplus.modules.projectrecord.entity.ProjectPaymentTreeData" >
 		SELECT
 			<include refid="projectRecordsColumns"/>

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

@@ -452,7 +452,7 @@
 </div>
 
 <script type="text/javascript">
-    var termIdx = 0, termTpl = $("#termTpl").html().replace(/(\/\/\<!\-\-)|(\/\/\-\->)/g,"");
+    //var termIdx = 0, termTpl = $("#termTpl").html().replace(/(\/\/\<!\-\-)|(\/\/\-\->)/g,"");
     var validateForm;
     var validateForm2;
     jQuery.validator.addMethod("percent", function(value, element) {
@@ -473,7 +473,7 @@
             }
         });
 
-        validateForm2 = $("#termForm").validate({
+        /*validateForm2 = $("#termForm").validate({
             errorContainer: "#messageBox",
             errorPlacement: function(error, element) {
                 $("#messageBox").text("输入有误,请先更正。");
@@ -483,7 +483,7 @@
                     error.insertAfter(element);
                 }
             }
-        });
+        });*/
 
         laydate.render({
             elem: '#signDate', //目标元素。由于laydate.js封装了一个轻量级的选择器引擎,因此elem还允许你传入class、tag但必须按照这种方式 '#id .class'
@@ -510,12 +510,12 @@
             event: 'focus' //响应事件。如果没有传入event,则按照默认的click
         });
 
-        var data = ${fns:toJson(workContentContractinfo.termList)};
+        /*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){

+ 5 - 0
src/main/webapp/webpage/modules/projectrecord/armorForMaterials/armorForMaterialsForm.jsp

@@ -55,6 +55,11 @@
                     }
                 }
 
+                var idArr = $("#workBaseDataList tr:visible .clientId").length;
+                if(idArr == 0){
+                    layer.msg('请添加甲供物资审核所需依据性文件', {icon: 5});
+                    return false;
+                }
 
                 beforeSubmit();
                 $("#inputForm").submit();

+ 6 - 0
src/main/webapp/webpage/modules/projectrecord/concealProject/workContentForm.jsp

@@ -64,6 +64,12 @@
                     }
                 }
 
+                var idArr = $("#workBaseDataList tr:visible .clientId").length;
+                if(idArr == 0){
+                    layer.msg('请添加隐蔽工程量所需依据性文件', {icon: 5});
+                    return false;
+                }
+
 
                 beforeSubmit();
                 $("#inputForm").submit();

+ 6 - 0
src/main/webapp/webpage/modules/projectrecord/contractMaterial/workMaterialForm.jsp

@@ -52,6 +52,12 @@
                     }
                 }
 
+                var idArr = $("#workBaseDataList tr:visible .clientId").length;
+                if(idArr == 0){
+                    layer.msg('请添加暂定材料价审核所需依据性文件', {icon: 5});
+                    return false;
+                }
+
                 beforeSubmit();
                 $("#inputForm").submit();
                 return true;

+ 6 - 0
src/main/webapp/webpage/modules/projectrecord/distributionSettlement/distributionSettlementForm.jsp

@@ -54,6 +54,12 @@
                     }
                 }
 
+                var idArr = $("#workBaseDataList tr:visible .clientId").length;
+                if(idArr == 0){
+                    layer.msg('请添加分部结算审核所需依据性文件', {icon: 5});
+                    return false;
+                }
+
                 beforeSubmit();
                 $("#inputForm").submit();
                 return true;

+ 736 - 114
src/main/webapp/webpage/modules/projectrecord/implementStage/projectInterimPaymentForm.jsp

@@ -1,40 +1,94 @@
 <%@ page contentType="text/html;charset=UTF-8" %>
 <%@ include file="/webpage/include/taglib.jsp"%>
-
 <html>
 <head>
-    <title>工程支付款信息</title>
+    <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"/>
-
+    <script src="${ctxStatic}/layer-v2.3/layui/xmSelect.js" charset="utf-8"></script>
     <style>
-        #projectDesc-error{
+        #projectContentDataType-error{
             left:0;
-            top:82px;
-        }
-        .layui-layer-dialog{
-            background: #ff0000;
-        }
-        td input{
-            margin-left:-10px !important;
-            height: 42px !important;
+            top:40px;
         }
     </style>
     <script type="text/javascript">
+        $.fn.serializeJson=function(){
+            var serializeObj={};
+            var array=this.serializeArray();
+            var str=this.serialize();
+            $(array).each(function(){
+                if(serializeObj[this.name]){
+                    if($.isArray(serializeObj[this.name])){
+                        serializeObj[this.name].push(this.value);
+                    }else{
+                        serializeObj[this.name]=[serializeObj[this.name],this.value];
+                    }
+                }else{
+                    serializeObj[this.name]=this.value;
+                }
+            });
+            return serializeObj;
+        };
+
         var validateForm;
-        var isMasterClient = true;//是否是主委托方
-        var clientCount = 0;
-        function doSubmit(i){//回调函数,在编辑和保存动作时,供openDialog调用提交表单。
-            $("#inputForm").submit();
-            return true;
-        }
-        $(document).ready(function() {
-            var radioVal ;
+        var detailFlag =0;
+        function doSubmit(){//回调函数,在编辑和保存动作时,供openDialog调用提交表单。
+            if(validateForm.form()){
+
+
+
+                var length = document.getElementById("fiveDirectionsAffirmList");
+                if(null != length){
+                    var rows = length.rows.length;
+                    for (var i=1;i<=rows;i++){
+                        var costPart = $("#fiveDirectionsAffirmList"+i+"_ownerPurchasingRequisitionNum").val();
+                        var ownerMaterialCode = $("#fiveDirectionsAffirmList"+i+"_ownerMaterialCode").val();
+                        var ownerMaterialDescription = $("#fiveDirectionsAffirmList"+i+"_ownerMaterialDescription").val();
+                        var ownerUnits = $("#fiveDirectionsAffirmList"+i+"_ownerUnits").val();
+                        var ownerTenderNum = $("#fiveDirectionsAffirmList"+i+"_ownerTenderNum").val();
+                        var designMaterialName = $("#fiveDirectionsAffirmList"+i+"_designMaterialName").val();
+                        var designDrawingAmount = $("#fiveDirectionsAffirmList"+i+"_designDrawingAmount").val();
+                        if(null == costPart ||'' == costPart || null == ownerMaterialCode || ''==ownerMaterialCode || null == ownerMaterialDescription || '' == ownerMaterialDescription || null == ownerUnits || '' == ownerUnits || null == ownerTenderNum || '' == ownerTenderNum || null == designMaterialName || '' == designMaterialName || null == designDrawingAmount || '' == designDrawingAmount){
+                            layer.msg('请填写完工程款支付明细表', {icon: 5});
+                            return false;
+                        }
+                    }
+                }
+
+                /*var idArr = $("#workBaseDataList tr:visible .clientId").length;
+                if(idArr == 0){
+                    layer.msg('请添加工程进度款所需依据性文件', {icon: 5});
+                    return false;
+                }*/
+
+                beforeSubmit();
+                $("#inputForm").submit();
+                return true;
+            }
+
+            return false;
+        }
+
+        function beforeSubmit() {
+            var contentDetaStr = '';
+            if(null !=encodeURIComponent(genDetailStr()) && '' != encodeURIComponent(genDetailStr())){
+                contentDetaStr += encodeURIComponent(genDetailStr());
+            }
+            if(null !=encodeURIComponent(genSecondDetailStr()) && '' != encodeURIComponent(genSecondDetailStr())){
+                contentDetaStr += encodeURIComponent(genSecondDetailStr());
+            }
+            if(detailFlag==1){
+                $("#contentDeta").val(contentDetaStr);
+            }
+            $(document.getElementById("projectContentDataType")).removeAttr("disabled");
+        }
+
+        $(function() {
+            var editVal = '${concealProjectInfo.edit}';
+
+            if($("#createDate").val()==null || $("#createDate").val()==''){
+                $("#createDate").val(getNowFormatDate());
+            }
             validateForm = $("#inputForm").validate({
                 submitHandler: function(form){
                     loading('正在提交,请稍等...');
@@ -50,57 +104,298 @@
                     }
                 }
             });
-            laydate.render({
-                elem: '#payDate',
-                event: 'focus',
-                type : 'date'
+            changeContentDetail(document.getElementById("projectContentDataType"));
+            var tp = "${concealProjectInfo.dictType}";
+            var tp2 = "${concealProjectInfo.projectContentData.id}"
+            if((tp!=null && tp!='')||(tp2!=null && tp2!='')){
+                $(document.getElementById("projectContentDataType")).attr("disabled","disabled");
+            }
+            initControlData("1");
+            $("#attachment_btn").click(function () {
+                $("#attachment_file").click();
             });
-
         });
 
+
+        function openDialogre(title,url,width,height,formId){
+
+            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;
+                    inputForm.attr("action","${ctx}/projectcontentinfo/projectcontentinfo/ajaxsaveBaseData");//表单提交成功后,从服务器返回的url在当前tab中展示
+                    var $document = iframeWin.contentWindow.document;
+                    formSubmitAjax($document,formId,index);
+                },
+                btn2: function(index){
+                }
+            });
+        }
+
+        function formSubmitAjax($document,inputForm,index){
+            var validateForm = $($document.getElementById(inputForm)).validate({
+                submitHandler: function(form){
+                    loading('正在提交,请稍等...');
+                    form.submit();
+                },
+                errorContainer: "#messageBox",
+                errorPlacement: function(error, element) {
+                    $($document.getElementById("#messageBox")).text("输入有误,请先更正。");
+                    if (element.is(":checkbox")||element.is(":radio")||element.parent().is(".input-append")){
+                        error.appendTo(element.parent().parent());
+                    } else {
+                        error.insertAfter(element);
+                    }
+                }
+            });
+            if(validateForm.form()){
+                $($document.getElementById(inputForm)).ajaxSubmit({
+                    success:function(data) {
+                        if(!data.success){
+                            top.layer.msg("保存依据资料信息异常!",{icon:2});
+                            return false;
+                        }
+                        var idx = $("#workBaseDataList tr").length;
+                        addRowBaseData("#workBaseDataList",idx,workBaseDataTpl,data.body.workBasedData);
+                        parent.layer.msg(data.msg,{icon:1});
+                        top.layer.close(index)
+                    }
+                });
+            }
+        }
+
+        function getNowFormatDate() {
+            var date = new Date();
+            var seperator1 = "-";
+            var month = date.getMonth() + 1;
+            var strDate = date.getDate();
+            month = (month < 10)?"0"+month:month;
+            strDate = (strDate < 10)?"0"+strDate:strDate;
+            var currentdate = date.getFullYear() + seperator1 + month + seperator1 + strDate;
+            return currentdate;
+        }
+
+        function changeContentDetail(obj) {
+            $("#contentDetail").empty();
+            var val = "420";
+            contentDetailTypeShow(val);
+            $("#contentDetailTypeDiv").show();
+            $("#projectContentDataSign").val(val);
+            var param2 = {'contentId':"${concealProjectInfo.projectContentData.id}",'projectId':"${concealProjectInfo.project.id}"};
+            detailFlag=1;
+            $("#contentDetail").load("${ctx}/workSchedule/workSchedule/list",param2);
+        }
+
+        function addFile() {
+            $("#attachment_file").click();
+        }
+
         function insertTitle(tValue){
             var files = $("#attachment_file")[0].files;            for(var i = 0;i<files.length;i++) {                var file = files[i];
-                var attachmentId = $("#id").val();
-                var attachmentFlag = "135";
-                /*console.log(file);*/
+                var attachmentId = "";
+                var attachmentFlag = "94";
                 var timestamp=new Date().getTime();
 
-                var storeAs = "attachment-file/projectRecords/"+timestamp+"/"+file['name'];
+                var storeAs = "attachment-file/projectContentData/"+timestamp+"/"+file['name'];
                 var uploadPath="http://gangwan-app.oss-cn-hangzhou.aliyuncs.com/"+storeAs;/*将这段字符串存到数据库即可*/
                 var divId = "_attachment";
                 $("#addFile"+divId).show();
                 multipartUploadWithSts(storeAs, file,attachmentId,attachmentFlag,uploadPath,divId,0);}
         }
 
+        function openDialogreControl(title,url,width,height,target){
+            if(navigator.userAgent.match(/(iPhone|iPod|Android|ios)/i)){//如果是移动端,就使用自适应大小弹窗
+                width='auto';
+                height='auto';
+            }else{//如果是PC端,根据用户设置的width和height显示。
 
-        function addFile() {
-            $("#attachment_file").click();
+            }
+            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中展示
+                    var $document = iframeWin.contentWindow.document;
+                    var index1 = parent.layer.load(0, {shade: [0.1, 'tranparent']});
+                    formSubmit($document,"inputForm",index,index1);
+                },
+                btn2: function(index){
+                    parent.layer.close(index)
+                },
+                end:function(index){
+                    parent.layer.close(index)
+                }
+            });
+        }
+        function formSubmit($document,inputForm,index,index1){
+            var validateForm = $($document.getElementById(inputForm)).validate({
+                submitHandler: function(form){
+                    loading('正在提交,请稍等...');
+                    form.submit();
+                },
+                errorContainer: "#messageBox",
+                errorPlacement: function(error, element) {
+                    $($document.getElementById("#messageBox")).text("输入有误,请先更正。");
+                    if (element.is(":checkbox")||element.is(":radio")||element.parent().is(".input-append")){
+                        error.appendTo(element.parent().parent());
+                    } else {
+                        error.insertAfter(element);
+                    }
+                }
+            });
+            if(validateForm.form()){
+                $($document.getElementById(inputForm)).ajaxSubmit({
+                    success:function(data) {
+                        parent.parent.layer.msg("操作成功",{icon:1})
+                        parent.parent.layer.close(index1)
+                        parent.layer.close(index1)
+                        parent.parent.layer.close(index)
+                        parent.layer.close(index)
+                        initGetControlData();
+                    },error:function(){
+                        parent.parent.layer.msg("操作失败",{icon:2})
+                        parent.parent.layer.close(index1)
+                        parent.layer.close(index1)
+                        parent.parent.layer.close(index)
+                        parent.layer.close(index)
+                        initControlData("1");
+                    }
+                });
+            }else {
+                parent.parent.layer.msg("信息未填写完整!", {icon: 2});
+                parent.layer.close(index1)
+                parent.parent.layer.close(index1)
+            }
+        }
+        /**
+         * 删除临时数据
+         */
+        function initControlData(obj,othis,del,tableId){
+            if(del == "del"){
+                proId = tableId;
+            }else{
+                proId = "";
+            }
+            $.ajax({
+                type:'post',
+                url:'${ctx}/projectcontroltable/projectControlTable/delControlData',
+                data:{
+                    "projectId":"${concealProjectInfo.project.id}",
+                    "projectContentId":proId,
+                    "flag":del
+                },
+                success:function(data){
+                    if(obj != "1"){
+                        if(data.flag){
+                            //$(othis).parent().parent().parent().remove();
+                            parent.layer.msg("数据删除成功",{icon:1})
+                            $(othis).remove()
+                        }else{
+                            parent.layer.msg("数据删除失败",{icon:2})
+                        }
+                    }
+                }
+            })
         }
 
-        function addRow(list, idx, tpl, row){
-            bornTemplete(list, idx, tpl, row, idx);
+        function getMatchDate(str){
+//            var reDateTime = /^(?:19|20)[0-9][0-9]-(?:(?:0[1-9])|(?:1[0-2]))-(?:(?:[0-2][1-9])|(?:[1-3][0-1])) (?:(?:[0-2][0-3])|(?:[0-1][0-9])):[0-5][0-9]:[0-5][0-9]$/;
+            var reDateTime = /^(?:19|20)[0-9][0-9]-(?:(?:0[1-9])|(?:1[0-2]))-(?:(?:[0-2][1-9])|(?:[1-3][0-1]))/
+            var date = (""+str).match(reDateTime);
+            if(date){
+                return date[0]
+            }else{
+                return "";
+            }
         }
 
-        function bornTemplete(list, idx, tpl, row, idx1){
-            $(list).append(Mustache.render(tpl, {
-                idx: idx, delBtn: true, row: row,
-                order:idx1 + 1
-            }));
-            $(list+idx).find("select").each(function(){
-                $(this).val($(this).attr("data-value"));
-            });
-            $(list+idx).find("input[type='checkbox'], input[type='radio']").each(function(){
-                var ss = $(this).attr("data-value").split(',');
-                for (var i=0; i<ss.length; i++){
-                    if($(this).val() == ss[i]){
-                        $(this).attr("checked","checked");
+        /**
+         * 获取临时数据
+         * @param obj
+         * @param othis
+         */
+        function initGetControlData(){
+            $.ajax({
+                type:'post',
+                url:'${ctx}/projectcontroltable/projectControlTable/getControlData',
+                data:{
+                    "projectId":"${concealProjectInfo.project.id}",
+                    "proId":"${concealProjectInfo.projectContentData.id}"
+                },
+                success:function(data){
+                    if(data){
+                        var htmlStr = '';
+                        data = data.list.projectControlTableList;
+                        for(var i=0;i<data.length;i++){
+                            htmlStr += "<tr id='tr"+i+"'>"+
+                                "   <td style='text-align:center;'>"+
+                                "	   "+data[i].tName+
+                                "	   <input type='hidden' name='projectContentData.projectControlTableList["+i+"].id' value='"+data[i].id+"'>"+
+                                "	   <input type='hidden' name='projectContentData.projectControlTableList["+i+"].tName' value='"+data[i].tName+"'>"+
+                                "	   <input type='hidden' name='projectContentData.projectControlTableList["+i+"].processName' value='"+data[i].processName+"'>"+
+                                "	   <input type='hidden' name='projectContentData.projectControlTableList["+i+"].pfId' value='"+data[i].pfId+"'>"+
+                                "   </td>"+
+                                "   <td style='text-align:center;'>" +
+                                "  			"+data[i].processName+
+                                "	   		<input type='hidden' name='projectContentData.projectControlTableList["+i+"].tType' value='"+data[i].tType+"'>"+
+                                "	</td>"+
+                                "   <td style='text-align:center;'>"+
+                                "  		"+data[i].tUser.name+
+                                "   </td>"+
+                                "   <td style='text-align:center;'>"+
+                                "  "+ getMatchDate(data[i].createDate)+
+                                //										"	    <input type='hidden' name='projectControlTableList["+i+"].createDate' value='"+data[i].createDate+"'>"+
+                                //										"	    <input type='hidden' name='projectControlTableList["+i+"].updateDate' value='"+data[i].updateDate+"'>"+
+                                //										"	    <input type='hidden' name='projectControlTableList["+i+"].delFlag' value='"+data[i].delFlag+"'>"+
+                                //										"	    <input type='hidden' name='projectControlTableList["+i+"].createBy.id' value='"+data[i].createBy.id+"'>"+
+                                "   </td>"+
+                                "   <td style='text-align:center;'>"+
+                                "   	<a href='javascript:void(0)' onclick=\"openDialogView('查看过程控制明细', '${ctx}/projectcontroltable/projectControlTable/form?view=view&id="+data[i].id+"','90%', '90%')\" class='btn btn-info btn-xs' ><i class='fa fa-search-plus'></i> 查看</a>"+
+                                "  		<a href=\"javascript:initControlData('0','#tr"+i+"','del','"+data[i].id+"')\" onclick=\"return confirmx('确认要删除该过程控制数据吗?', this.href)\"   class='btn btn-danger btn-xs'><i class='fa fa-trash'></i> 删除</a>"+
+                                "  </td>"+
+                                "</tr>";
+                        }
+                        if(htmlStr){
+                            $("#projectControlTables").html(htmlStr);
+                        }
                     }
                 }
-            });
+            })
         }
+
         function formatNum(obj) {
             var val = $(obj).val();
-            if(val==null||val==''|| isNaN(val))return;
+            console.log("-----------val"+val);
+            if(!isNumber(val))return;
             var money = parseFloat((val + "").replace(/[^\d\.-]/g, "")).toFixed(2) + "";
             var l = money.split(".")[0].split("").reverse(),
                 r = money.split(".")[1];
@@ -111,73 +406,271 @@
             }
             $(obj).val(t.split("").reverse().join("") + "." + r);
         }
+        function isNumber(val){
+            if(val === "" || val ==null){
+                return false;
+            }
+            var regPos = /^\d+(\.\d+)?$/; //非负浮点数
+            var regNeg = /^(-(([0-9]+\.[0-9]*[1-9][0-9]*)|([0-9]*[1-9][0-9]*\.[0-9]+)|([0-9]*[1-9][0-9]*)))$/; //负浮点数
+            if(regPos.test(val) || regNeg.test(val)){
+                return true;
+            }else{
+                return false;
+            }
+
+        }
     </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">
+    <div class="container${container}">
+        <form:form id="inputForm" modelAttribute="concealProjectInfo" 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>
+            <form:hidden path="edit"/>
+            <form:hidden path="parentIds"/>
+            <form:hidden path="condition"/>
+            <form:hidden path="project.id"/>
+            <form:hidden path="contract.id"/>
+            <form:hidden path="projectContentData.id"/>
+            <input type="hidden" id="projectId" value="${concealProjectInfo.project.id}">
+            <input type="hidden" id="contentDeta" name="projectContentData.contentDetail">
+            <input type="hidden" id="dataBodyList" name="dataBodyList" value="">
+            <input type="hidden" id="projectContentDataSign" name="projectContentDataSign" value="">
+            <sys:message content="${message}"/>
+            <div class="form-group layui-row first 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="projectContentData.number" htmlEscape="false" readonly="true" class="form-control layui-input"/>
+                        </div>
+                    </div>--%>
                 <div class="layui-item layui-col-sm6">
-                    <label class="layui-form-label"><span class="require-item">*</span>完成价款:</label>
+                    <label class="layui-form-label"><span class="require-item">*</span>工程进度款名称:</label>
                     <div class="layui-input-block">
-                        <input name="completePriceStr" htmlEscape="false" value="<fmt:formatNumber value="${projectPaymentTreeData.completePrice}" pattern="#,##0.00#"/>" onchange="formatNum(this);" class="form-control layui-input number"/>
-                        <%--<form:input path="completePrice"  htmlEscape="false" class="form-control layui-input required number"/>--%>
+                        <form:input path="projectContentData.name" value="${concealProjectInfo.contract.contractName}" htmlEscape="false" class="form-control required layui-input"/>
                     </div>
                 </div>
                 <div class="layui-item layui-col-sm6">
-                    <label class="layui-form-label double-line"><span class="require-item">*</span>按约定比例应支付价款:</label>
+                    <label class="layui-form-label"><span class="require-item">*</span>负责人:</label>
                     <div class="layui-input-block">
-                        <input name="appointPayStr" htmlEscape="false" value="<fmt:formatNumber value="${projectPaymentTreeData.appointPay}" pattern="#,##0.00#"/>" onchange="formatNum(this);" class="form-control layui-input number"/>
-                        <%--<form:input path="appointPay" htmlEscape="false"    class="form-control layui-input required number"/>--%>
+                        <form:input path="projectContentData.master.name" htmlEscape="false"  readonly="true"  class="form-control layui-input required"/>
+                        <form:hidden path="projectContentData.master.id" htmlEscape="false"  readonly="true"  class="form-control layui-input required"/>
                     </div>
                 </div>
-
-
                 <div class="layui-item layui-col-sm6">
-                    <label class="layui-form-label double-line"><span class="require-item">*</span>应扣预付款:</label>
+                    <label class="layui-form-label"><span class="require-item">*</span>创建日期:</label>
                     <div class="layui-input-block">
-                        <input name="advanceDeductStr" htmlEscape="false" value="<fmt:formatNumber value="${projectPaymentTreeData.advanceDeduct}" pattern="#,##0.00#"/>" onchange="formatNum(this);" class="form-control layui-input number"/>
-                        <%--<form:input path="advanceDeduct" htmlEscape="false"    class="form-control layui-input required number"/>--%>
+                        <input id="createDate" name="projectContentData.createDate" type="text" readonly="true" maxlength="20" class="form-control layui-input required"
+                               value="<fmt:formatDate value="${concealProjectInfo.projectContentData.createDate}" pattern="yyyy-MM-dd"/>"/>
                     </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-item layui-col-sm6" id="contentDetailTypeDiv" style="display: none">
+                    <label class="layui-form-label">选择类型:</label>
                     <div class="layui-input-block">
-                        <input name="restsDeductStr" htmlEscape="false" value="<fmt:formatNumber value="${projectPaymentTreeData.restsDeduct}" pattern="#,##0.00#"/>" onchange="formatNum(this);" class="form-control layui-input number"/>
-                        <%--<form:input path="restsDeduct" htmlEscape="false"    class="form-control layui-input required number"/>--%>
+                        <div class="input-group">
+                            <div >
+                                <div id="contentDetailType" class="xm-select-demo" tabindex="0" contenteditable="true"></div>
+                            </div>
+                            <span class="input-group-btn" onclick="getDetailsNum()">
+								<label class="form-status">生成表格</label>
+							 </span>
+                        </div>
                     </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="actualPayStr" htmlEscape="false" value="<fmt:formatNumber value="${projectPaymentTreeData.actualPay}" pattern="#,##0.00#"/>" onchange="formatNum(this);" class="form-control layui-input number"/>
-                        <%--<form:input path="actualPay" htmlEscape="false"    class="form-control layui-input required number"/>--%>
-                    </div>
+            </div>
+            <div class="form-group layui-row">
+                <div class="form-group-label"><h2>内容详情</h2></div>
+                <div style="padding: 0 15px;">
+                    <div id="contentDetail"></div>
                 </div>
+            </div>
+            <div class="form-group layui-row">
+                <div class="form-group-label"><h2>依据性资料明细</h2></div>
+                <div class="layui-item nav-btns">
+                    <a href="javascript:void(0)" onclick="openDialogre('新增依据性资料', '${ctx}/projectcontentinfo/projectcontentinfo/form?view=basedData&dictType=${concealProjectInfo.dictType}&project.id=${concealProjectInfo.project.id}&parentIds=${concealProjectInfo.parentIds}','90%','90%','inputForm')" class="nav-btn nav-btn-add" ><i class="fa fa-plus"></i> 新增</a>
 
-            <div class="layui-item layui-col-sm6">
-                <label class="layui-form-label"><span class="require-item">*</span>支付日期:</label>
-                <div class="layui-input-block">
-                    <input class="laydate-icondate layui-input form-control layer-date laydate-icon required" id="payDate" name="payDate" value="${projectPaymentTreeData.payDate}">
+                    <sys:gridselectBaseData url="${ctx}/projectcontentinfo/projectBasedData/selectList" id="baseData" title="选择依据资料"
+                                            cssClass="form-control" projectId="${concealProjectInfo.project.id}" fieldLabels="" fieldKeys=""  searchLabel="${fns:urlEncode('依据资料名称')}" searchKey="name"></sys:gridselectBaseData>
                 </div>
-            </div>
+                <div class="layui-item layui-col-xs12 form-table-container">
+                    <table id="contentTableBase" class="table table-bordered table-condensed details">
+                        <thead>
+                        <tr>
+                            <th class="hide"></th>
+                            <th >资料编号</th>
+                            <th >资料名称</th>
+                            <th >资料类别</th>
+                            <th >上传人</th>
+                            <th >上传日期</th>
+                            <th>操作</th>
+                        </tr>
+                        </thead>
+                        <tbody id="workBaseDataList">
+                        <c:forEach items="${concealProjectInfo.projectContentData.projectBasedDataList}" var="projectBasedData" varStatus="idx">
+                            <tr>
+                                <td class="hide">
+                                    <input type="hidden" id="workBaseDataList${idx.index}_id" value="${projectBasedData.id}" class="clientId">
+                                </td>
+                                <td style="text-align:center;">
+                                        ${projectBasedData.number}
+                                </td>
+                                <td style="text-align:center;">
+                                        ${projectBasedData.name}
+                                </td>
+                                <td style="text-align:center;">
+                                        ${fns:getDictLabel(projectBasedData.type, 'project_document_type', '')}
+                                </td>
+                                <td style="text-align:center;">
+                                        ${projectBasedData.uploadUser.name}
+                                </td>
+                                <td style="text-align:center;">
+                                    <fmt:formatDate value="${projectBasedData.uploadDate}" pattern="yyyy-MM-dd"/>
+                                </td>
 
-                <div class="layui-item layui-col-sm6">
-                    <label class="layui-form-label">登记人</label>
-                    <div class="layui-input-block">
-                        <input class="form-control layui-input" readonly="readonly" id="masterUser" name="masterUser" value="${projectPaymentTreeData.masterUser}">
-                    </div>
+                                <td class="text-center op-td">
+                                    <a href=javascript:void(0); onclick="delRowBaseData(this, '#workBaseDataList${idx.index}','${projectBasedData.uploadUser.id}')"   class="op-btn op-btn-delete"><i class="fa fa-trash"></i> 删除</a>
+                                </td>
+                            </tr>
+                        </c:forEach>
+                        </tbody>
+                    </table>
                 </div>
             </div>
+            <script type="text/template" id="workBaseDataTpl">//<!--
+                <tr id="budgetList{{idx}}">
+                    <td class="hide">
+                        <input id="workBaseDataList{{idx}}_id" name="projectContentData.projectBasedDataList[{{idx}}].id" type="hidden" value="{{row.id}}" class="clientId"/>
+                        <input id="workBaseDataList{{idx}}_number" name="projectContentData.projectBasedDataList[{{idx}}].number" type="hidden" value="{{row.number}}"/>
+                        <input id="workBaseDataList{{idx}}_name" name="projectContentData.projectBasedDataList[{{idx}}].name" type="hidden" value="{{row.name}}"/>
+                        <input id="workBaseDataList{{idx}}_type" name="projectContentData.projectBasedDataList[{{idx}}].type" type="hidden" value="{{row.type}}"/>
+                    </td>
+                    <td style="text-align:center;">
+                        {{row.number}}
+                    </td>
+                    <td style="text-align:center;">
+                        {{row.name}}
+                    </td>
+                    <td style="text-align:center;">
+                        {{row.typeLabel}}
+                    </td>
+                    <td style="text-align:center;">
+                        {{row.uploadUser.name}}
+                    </td>
+                    <td style="text-align:center;">
+                        {{row.uploadDate}}
+                    </td>
+                    <td class="text-center op-td">
+                        <a href=javascript:void(0); onclick="delRowBaseData(this, '#workBaseDataList{{idx}}','{{row.uploadUser.id}}')"   class="op-btn op-btn-delete"><i class="fa fa-trash"></i> 取消</a>
+                    </td>
+                </tr>//-->
+            </script>
+            <script type="text/javascript">
+                var workBaseDataTpl = $("#workBaseDataTpl").html().replace(/(\/\/\<!\-\-)|(\/\/\-\->)/g,"");
+                var workBaseDataRowIdx = ${fn:length(concealProjectInfo.projectReportData.projectBasedDataList)};
+                function setValuee(obj){
+                    for(var i=0;i<obj.length;i++){
+                        var idArr = $("#workBaseDataList tr:visible .clientId");
+                        if(obj[i].id!=''&&!hasInArr(obj[i].id,idArr)){
+                            addRowBaseData("#workBaseDataList",workBaseDataRowIdx,workBaseDataTpl,obj[i]);
+                            workBaseDataRowIdx=workBaseDataRowIdx+1;
+                        }
+                    }
+                }
+                function hasInArr(id,idArr) {
+                    for(var i=0;i<idArr.length;i++){
+                        if(id==$(idArr[i]).val()){
+                            return true;
+                        }
+                    }
+                    return false;
+                }
+                function existBaseData(id,length) {
+                    for (var i=0;i<length;i++) {
+                        var val = $('#workBaseDataList'+i+'_id').val();
+                        if(id==val){
+                            return true;
+                        }
+                    }
+                    return false;
+                }
+
+                function addRowBaseData(list, idx, tpl, row){
+                    bornTemplete(list, idx, tpl, row, idx);
+                }
+
+                function bornTemplete(list, idx, tpl, row, idx1){
+                    var idx1 = $("#workBaseDataList 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 delRowBaseData(obj, prefix,userId){
+                    var id = $(prefix+"_id").val();
+                    /* var createBy = $(prefix+"_userId").val();*/
+                    var currentUser = '${fns:getUser().id}';
+                    var contentId = '${concealProjectInfo.projectContentData.id}';
+                    console.log(contentId);
+
+                    $.ajax({
+                        type:"post",
+                        url:'${ctx}/project/concealProject/ajaxdelete',
+                        data:{"contentId":contentId,"basedId":id},
+                        dataType:"json",
+                        success:function(data){
+                            if(data.success) {
+                                $(obj).parent().parent().remove();
+                                if(data.body.inuse){
+                                    return;
+                                }
+                                if (currentUser == userId) {
+                                    confirmDelete('是否同步删除资料库的文件?','${ctx}/projectcontentinfo/projectcontentinfo/delete?infoId='+id+'&id=${concealProjectInfo.id}&type=1');
+                                }
+                            }else {
+                                top.layer.msg("删除依据资料失败!", {icon: 0});
+                            }
+                        }
+                    })
+                    return;
+                }
+
+                function confirmDelete(mess, href){
+                    top.layer.confirm(mess, {icon: 3, title:'系统提示'}, function(index){
+                        //do something
+                        if (typeof href == 'function') {
+                            href();
+                        }else{
+                            $.ajax({
+                                url:href,
+                                type:"post",
+                                success:function(data){
+                                    if(data.success){
+                                        top.layer.msg("删除依据资料成功!", {icon: 0});
+                                    }
+                                }
+                            });
+                        }
+                        top.layer.close(index);
+                    });
+                    return false;
+                }
+            </script>
             <div class="form-group layui-row">
                 <div class="form-group-label"><h2>附件信息</h2></div>
                 <div class="layui-item nav-btns">
-                    <a id="attachment_btn" class="nav-btn nav-btn-add" title="添加附件"  onclick="addFile()"><i class="fa fa-plus"></i>&nbsp;添加附件</a>
+                    <a id="attachment_btn" class="nav-btn nav-btn-add" title="添加附件"><i class="fa fa-plus"></i>&nbsp;添加附件</a>
                 </div>
                 <div id="addFile_attachment" style="display: none" class="upload-progress">
                     <span id="fileName_attachment" ></span>
@@ -189,46 +682,47 @@
                 </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">
+                <div class="layui-item layui-col-xs12" style="padding:0 16px;">
+                    <table id="upTable" class="table table-bordered table-condensed details">
                         <thead>
                         <tr>
-                                <%-- <th>序号</th>--%>
-                            <th width="25%">文件</th>
-                            <th width="25%">上传人</th>
-                            <th width="25%">上传时间</th>
+                            <th>文件名称</th>
+                            <th>上传人</th>
+                            <th>上传时间</th>
                             <th width="150px">操作</th>
                         </tr>
                         </thead>
                         <tbody id="file_attachment">
-                        <c:forEach items="${projectPaymentTreeData.workAttachments}" var = "workClientAttachment" varStatus="status">
-                            <tr class="trIdAdds">
-                                    <%-- <td>${status.index + 1}</td>--%>
+                        <c:forEach items="${concealProjectInfo.projectContentData.workAttachments}" var = "workAttachment" varStatus="status">
+                            <tr>
                                 <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 test="${fn:containsIgnoreCase(workAttachment.attachmentName,'jpg')
+                                                                           or fn:containsIgnoreCase(workAttachment.attachmentName,'png')
+                                                                           or fn:containsIgnoreCase(workAttachment.attachmentName,'gif')
+                                                                           or fn:containsIgnoreCase(workAttachment.attachmentName,'bmp')
+                                                                           or fn:containsIgnoreCase(workAttachment.attachmentName,'jpeg')}">
+                                        <td><img src="${workAttachment.url}" width="50" height="50" alt="${workAttachment.attachmentName}"/></td>
                                     </c:when>
                                     <c:otherwise>
                                         <c:choose>
-                                            <c:when test="${fn:containsIgnoreCase(workClientAttachment.attachmentName,'pdf')}">
-                                                <td><a class="attention-info" href="javascript:void(0)" onclick="preview('预览','${workClientAttachment.url}','90%','90%','1')">${workClientAttachment.attachmentName}</a></td>
+                                            <c:when test="${fn:containsIgnoreCase(workAttachment.attachmentName,'pdf')}">
+                                                <td><a href="javascript:void(0)" onclick="preview('预览','${workAttachment.url}','90%','90%','1')">${workAttachment.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>
+                                                <td><a href="javascript:void(0)" onclick="preview('预览','${workAttachment.url}','90%','90%')">${workAttachment.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>${workAttachment.createBy.name}</td>
+                                <td><fmt:formatDate value="${workAttachment.createDate}" type="both"/></td>
                                 <td class="op-td">
                                     <div class="op-btn-box" >
-                                        <a href="javascript:location.href='${ctx}/workfullmanage/workFullManage/downLoadAttach?file='+encodeURIComponent(encodeURIComponent('${workClientAttachment.url}'));" class="op-btn op-btn-download"><i class="fa fa-download"></i>&nbsp;下载</a>
-                                        <a href="javascript:void(0)" onclick="deleteFileFromAliyun(this,'${ctx}/sys/workattachment/deleteFileFromAliyun?url=${workClientAttachment.url}&id=${workClientAttachment.id}&type=2','addFile')" class="op-btn op-btn-delete" ><i class="fa fa-trash"></i>&nbsp;删除</a>
+                                        <a href="javascript:location.href='${ctx}/workfullmanage/workFullManage/downLoadAttach?file='+encodeURIComponent('${workAttachment.url}');" class="op-btn op-btn-download"><i class="fa fa-download"></i>&nbsp;下载</a>
+
+                                        <c:if test="${workAttachment.createBy.id eq fns:getUser().id}">
+                                            <a href="javascript:void(0)" onclick="deleteFileFromAliyun(this,'${ctx}/sys/workattachment/deleteFileFromAliyun?url=${workAttachment.url}&id=${workAttachment.id}&type=2','addFile')" class="op-btn op-btn-delete" ><i class="fa fa-trash"></i> 删除</a>
+                                        </c:if>
                                     </div>
                                 </td>
                             </tr>
@@ -237,8 +731,136 @@
                     </table>
                 </div>
             </div>
+            <c:if test="${concealProjectInfo.infoId !=null and concealProjectInfo.edit  == 'edit'}">
+                <div class="pull-right">
+                    <button id="btnSubmit" class="nav-btn nav-btn-add" type="submit" onclick="$('#edit').val('edit');beforeSubmit();"><i class="fa fa-chevron-up"></i> 提 交</button>
+                </div>
+            </c:if>
+            <div class="form-group layui-row page-end">
+                <br>
+                <br>
+                <br>
+            </div>
         </form:form>
     </div>
 </div>
+<script src="${ctxStatic}/layer-v2.3/layui/layui.all.js" charset="utf-8"></script>
+<script>
+    function contentDetailTypeShow(obj) {
+        var projectContentDataId = '${concealProjectInfo.projectContentData.id}';
+        $.ajax({
+            type:'post',
+            url:'${ctx}/projectcontentinfo/projectcontentinfo/getAchievementTypeList2',
+            data:{
+                "achievementParentId":obj,
+                "type":2
+            },
+            success:function(data){
+                if(data.success) {
+                    if (null != obj && "" != obj) {
+                        if(null !=projectContentDataId && ""!= projectContentDataId) {
+                            $.ajax({
+                                type: 'post',
+                                url: getExistingDataOnPath(obj),
+                                data: {
+                                    "contentId": "${concealProjectInfo.projectContentData.id}"
+                                },
+                                success: function (tableTypeList) {
+                                    var dataList = data.body.list;
+                                    var newDataList = [];
+                                    var holdDataList = data.body.list;
+                                    if (0 != dataList.length) {
+                                        for (i in holdDataList) {
+                                            newDataList.push(holdDataList[i])
+                                        }
+                                    }
+                                    if (0 != newDataList.length && 0 !=tableTypeList.length){
+                                        for (i in newDataList) {
+                                            for (j in tableTypeList) {
+                                                if (newDataList[i].value == tableTypeList[j]) {
+                                                    var newData = {
+                                                        "name": newDataList[i].name,
+                                                        "value": newDataList[i].value,
+                                                        "selected": true
+                                                    }
+                                                    holdDataList.splice(i,1,newData);
+                                                }
+                                                modifyGetDetailsNum(tableTypeList);
+                                            }
+                                        }
+                                        xmSelect.render({
+                                            el: '#contentDetailType',
+                                            language: 'zn',
+                                            data: holdDataList
+                                        })
+                                        $("#dataBodyList").val(holdDataList);
+                                    }else{
+                                        xmSelect.render({
+                                            el: '#contentDetailType',
+                                            language: 'zn',
+                                            data: dataList
+                                        })
+                                        $("#dataBodyList").val(holdDataList);
+                                    }
+                                }
+                            })
+                        }else{
+                            xmSelect.render({
+                                el: '#contentDetailType',
+                                language: 'zn',
+                                data: data.body.list
+                            })
+                            $("#dataBodyList").val(data.body.list);
+                        }
+                    }else {
+                        xmSelect.render({
+                            el: '#contentDetailType',
+                            language: 'zn',
+                            data: data.body.list
+                        })
+                        $("#dataBodyList").val(data.body.list);
+                    }
+                }
+            }
+        })
+    }
+
+    var contentDetailType = xmSelect.render({
+        el: '#contentDetailType',
+        language: 'zn',
+        data: [
+        ]
+    })
+
+    function getExistingDataOnPath(val) {
+        return "${ctx}/workSchedule/workSchedule/getTableType";
+    }
+
+
+    function getDetailsNum(){
+        var list = [];
+        //获取当前多选选中的值
+        var selectArr = contentDetailType.getValue();
+        for (var i in selectArr){
+            list.push(selectArr[i].value);
+        }
+        $("#contentDetail").val("");
+        console.log(list);
+        var val = $("#projectContentDataSign").val();
+        var param2 = {'contentId':"${concealProjectInfo.projectContentData.id}",'projectId':"${concealProjectInfo.project.id}",'sign':list.toString(),'achievementParentId':val};
+        detailFlag=1;
+        $("#contentDetail").load("${ctx}/workSchedule/workSchedule/list",param2);
+
+    }
+
+    function modifyGetDetailsNum(list){
+        $("#contentDetailType").empty();
+        console.log(list);
+        var val = $("#projectContentDataSign").val();
+        var param2 = {'contentId':"${concealProjectInfo.projectContentData.id}",'projectId':"${concealProjectInfo.project.id}",'sign':list.toString(),'achievementParentId':val};
+        detailFlag=1;
+        $("#contentDetail").load("${ctx}/workSchedule/workSchedule/list",param2);
+    }
+</script>
 </body>
 </html>

+ 800 - 0
src/main/webapp/webpage/modules/projectrecord/implementStage/projectInterimPaymentFormView.jsp

@@ -0,0 +1,800 @@
+<%@ page contentType="text/html;charset=UTF-8" %>
+<%@ include file="/webpage/include/taglib.jsp"%>
+<html>
+<head>
+    <title>工作内容详情管理</title>
+    <meta name="decorator" content="default"/>
+    <script src="${ctxStatic}/layer-v2.3/layui/xmSelect.js" charset="utf-8"></script>
+    <style>
+        #projectContentDataType-error{
+            left:0;
+            top:40px;
+        }
+    </style>
+    <script type="text/javascript">
+        $.fn.serializeJson=function(){
+            var serializeObj={};
+            var array=this.serializeArray();
+            var str=this.serialize();
+            $(array).each(function(){
+                if(serializeObj[this.name]){
+                    if($.isArray(serializeObj[this.name])){
+                        serializeObj[this.name].push(this.value);
+                    }else{
+                        serializeObj[this.name]=[serializeObj[this.name],this.value];
+                    }
+                }else{
+                    serializeObj[this.name]=this.value;
+                }
+            });
+            return serializeObj;
+        };
+
+        var validateForm;
+        var detailFlag =0;
+        function doSubmit(){//回调函数,在编辑和保存动作时,供openDialog调用提交表单。
+            if(validateForm.form()){
+                beforeSubmit();
+                $("#inputForm").submit();
+                return true;
+            }
+
+            return false;
+        }
+
+        function beforeSubmit() {
+            var contentDetaStr = '';
+            if(null !=encodeURIComponent(genDetailStr()) && '' != encodeURIComponent(genDetailStr())){
+                contentDetaStr += encodeURIComponent(genDetailStr());
+            }
+            if(null !=encodeURIComponent(genSecondDetailStr()) && '' != encodeURIComponent(genSecondDetailStr())){
+                contentDetaStr += encodeURIComponent(genSecondDetailStr());
+            }
+            if(detailFlag==1){
+                $("#contentDeta").val(contentDetaStr);
+            }
+            $(document.getElementById("projectContentDataType")).removeAttr("disabled");
+        }
+
+        $(function() {
+            var editVal = '${concealProjectInfo.edit}';
+
+            if($("#createDate").val()==null || $("#createDate").val()==''){
+                $("#createDate").val(getNowFormatDate());
+            }
+            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);
+                    }
+                }
+            });
+            changeContentDetail(document.getElementById("projectContentDataType"));
+            var tp = "${concealProjectInfo.dictType}";
+            var tp2 = "${concealProjectInfo.projectContentData.id}"
+            if((tp!=null && tp!='')||(tp2!=null && tp2!='')){
+                $(document.getElementById("projectContentDataType")).attr("disabled","disabled");
+            }
+            initControlData("1");
+            $("#attachment_btn").click(function () {
+                $("#attachment_file").click();
+            });
+        });
+
+
+        function openDialogre(title,url,width,height,formId){
+
+            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;
+                    inputForm.attr("action","${ctx}/projectcontentinfo/projectcontentinfo/ajaxsaveBaseData");//表单提交成功后,从服务器返回的url在当前tab中展示
+                    var $document = iframeWin.contentWindow.document;
+                    formSubmitAjax($document,formId,index);
+                },
+                btn2: function(index){
+                }
+            });
+        }
+
+        function formSubmitAjax($document,inputForm,index){
+            var validateForm = $($document.getElementById(inputForm)).validate({
+                submitHandler: function(form){
+                    loading('正在提交,请稍等...');
+                    form.submit();
+                },
+                errorContainer: "#messageBox",
+                errorPlacement: function(error, element) {
+                    $($document.getElementById("#messageBox")).text("输入有误,请先更正。");
+                    if (element.is(":checkbox")||element.is(":radio")||element.parent().is(".input-append")){
+                        error.appendTo(element.parent().parent());
+                    } else {
+                        error.insertAfter(element);
+                    }
+                }
+            });
+            if(validateForm.form()){
+                $($document.getElementById(inputForm)).ajaxSubmit({
+                    success:function(data) {
+                        if(!data.success){
+                            top.layer.msg("保存依据资料信息异常!",{icon:2});
+                            return false;
+                        }
+                        var idx = $("#workBaseDataList tr").length;
+                        addRowBaseData("#workBaseDataList",idx,workBaseDataTpl,data.body.workBasedData);
+                        parent.layer.msg(data.msg,{icon:1});
+                        top.layer.close(index)
+                    }
+                });
+            }
+        }
+
+        function getNowFormatDate() {
+            var date = new Date();
+            var seperator1 = "-";
+            var month = date.getMonth() + 1;
+            var strDate = date.getDate();
+            month = (month < 10)?"0"+month:month;
+            strDate = (strDate < 10)?"0"+strDate:strDate;
+            var currentdate = date.getFullYear() + seperator1 + month + seperator1 + strDate;
+            return currentdate;
+        }
+
+        function changeContentDetail(obj) {
+            $("#contentDetail").empty();
+            var val = "420";
+            contentDetailTypeShow(val);
+            $("#contentDetailTypeDiv").show();
+            $("#projectContentDataSign").val(val);
+            var param2 = {'contentId':"${concealProjectInfo.projectContentData.id}",'projectId':"${concealProjectInfo.project.id}",view:"view"};
+            detailFlag=1;
+            $("#contentDetail").load("${ctx}/workSchedule/workSchedule/list",param2);
+        }
+
+        function addFile() {
+            $("#attachment_file").click();
+        }
+
+        function insertTitle(tValue){
+            var files = $("#attachment_file")[0].files;            for(var i = 0;i<files.length;i++) {                var file = files[i];
+                var attachmentId = "";
+                var attachmentFlag = "94";
+                var timestamp=new Date().getTime();
+
+                var storeAs = "attachment-file/projectContentData/"+timestamp+"/"+file['name'];
+                var uploadPath="http://gangwan-app.oss-cn-hangzhou.aliyuncs.com/"+storeAs;/*将这段字符串存到数据库即可*/
+                var divId = "_attachment";
+                $("#addFile"+divId).show();
+                multipartUploadWithSts(storeAs, file,attachmentId,attachmentFlag,uploadPath,divId,0);}
+        }
+
+        function openDialogreControl(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中展示
+                    var $document = iframeWin.contentWindow.document;
+                    var index1 = parent.layer.load(0, {shade: [0.1, 'tranparent']});
+                    formSubmit($document,"inputForm",index,index1);
+                },
+                btn2: function(index){
+                    parent.layer.close(index)
+                },
+                end:function(index){
+                    parent.layer.close(index)
+                }
+            });
+        }
+        function formSubmit($document,inputForm,index,index1){
+            var validateForm = $($document.getElementById(inputForm)).validate({
+                submitHandler: function(form){
+                    loading('正在提交,请稍等...');
+                    form.submit();
+                },
+                errorContainer: "#messageBox",
+                errorPlacement: function(error, element) {
+                    $($document.getElementById("#messageBox")).text("输入有误,请先更正。");
+                    if (element.is(":checkbox")||element.is(":radio")||element.parent().is(".input-append")){
+                        error.appendTo(element.parent().parent());
+                    } else {
+                        error.insertAfter(element);
+                    }
+                }
+            });
+            if(validateForm.form()){
+                $($document.getElementById(inputForm)).ajaxSubmit({
+                    success:function(data) {
+                        parent.parent.layer.msg("操作成功",{icon:1})
+                        parent.parent.layer.close(index1)
+                        parent.layer.close(index1)
+                        parent.parent.layer.close(index)
+                        parent.layer.close(index)
+                        initGetControlData();
+                    },error:function(){
+                        parent.parent.layer.msg("操作失败",{icon:2})
+                        parent.parent.layer.close(index1)
+                        parent.layer.close(index1)
+                        parent.parent.layer.close(index)
+                        parent.layer.close(index)
+                        initControlData("1");
+                    }
+                });
+            }else {
+                parent.parent.layer.msg("信息未填写完整!", {icon: 2});
+                parent.layer.close(index1)
+                parent.parent.layer.close(index1)
+            }
+        }
+        /**
+         * 删除临时数据
+         */
+        function initControlData(obj,othis,del,tableId){
+            if(del == "del"){
+                proId = tableId;
+            }else{
+                proId = "";
+            }
+            $.ajax({
+                type:'post',
+                url:'${ctx}/projectcontroltable/projectControlTable/delControlData',
+                data:{
+                    "projectId":"${concealProjectInfo.project.id}",
+                    "projectContentId":proId,
+                    "flag":del
+                },
+                success:function(data){
+                    if(obj != "1"){
+                        if(data.flag){
+                            //$(othis).parent().parent().parent().remove();
+                            parent.layer.msg("数据删除成功",{icon:1})
+                            $(othis).remove()
+                        }else{
+                            parent.layer.msg("数据删除失败",{icon:2})
+                        }
+                    }
+                }
+            })
+        }
+
+        function getMatchDate(str){
+//            var reDateTime = /^(?:19|20)[0-9][0-9]-(?:(?:0[1-9])|(?:1[0-2]))-(?:(?:[0-2][1-9])|(?:[1-3][0-1])) (?:(?:[0-2][0-3])|(?:[0-1][0-9])):[0-5][0-9]:[0-5][0-9]$/;
+            var reDateTime = /^(?:19|20)[0-9][0-9]-(?:(?:0[1-9])|(?:1[0-2]))-(?:(?:[0-2][1-9])|(?:[1-3][0-1]))/
+            var date = (""+str).match(reDateTime);
+            if(date){
+                return date[0]
+            }else{
+                return "";
+            }
+        }
+
+        /**
+         * 获取临时数据
+         * @param obj
+         * @param othis
+         */
+        function initGetControlData(){
+            $.ajax({
+                type:'post',
+                url:'${ctx}/projectcontroltable/projectControlTable/getControlData',
+                data:{
+                    "projectId":"${concealProjectInfo.project.id}",
+                    "proId":"${concealProjectInfo.projectContentData.id}"
+                },
+                success:function(data){
+                    if(data){
+                        var htmlStr = '';
+                        data = data.list.projectControlTableList;
+                        for(var i=0;i<data.length;i++){
+                            htmlStr += "<tr id='tr"+i+"'>"+
+                                "   <td style='text-align:center;'>"+
+                                "	   "+data[i].tName+
+                                "	   <input type='hidden' name='projectContentData.projectControlTableList["+i+"].id' value='"+data[i].id+"'>"+
+                                "	   <input type='hidden' name='projectContentData.projectControlTableList["+i+"].tName' value='"+data[i].tName+"'>"+
+                                "	   <input type='hidden' name='projectContentData.projectControlTableList["+i+"].processName' value='"+data[i].processName+"'>"+
+                                "	   <input type='hidden' name='projectContentData.projectControlTableList["+i+"].pfId' value='"+data[i].pfId+"'>"+
+                                "   </td>"+
+                                "   <td style='text-align:center;'>" +
+                                "  			"+data[i].processName+
+                                "	   		<input type='hidden' name='projectContentData.projectControlTableList["+i+"].tType' value='"+data[i].tType+"'>"+
+                                "	</td>"+
+                                "   <td style='text-align:center;'>"+
+                                "  		"+data[i].tUser.name+
+                                "   </td>"+
+                                "   <td style='text-align:center;'>"+
+                                "  "+ getMatchDate(data[i].createDate)+
+                                //										"	    <input type='hidden' name='projectControlTableList["+i+"].createDate' value='"+data[i].createDate+"'>"+
+                                //										"	    <input type='hidden' name='projectControlTableList["+i+"].updateDate' value='"+data[i].updateDate+"'>"+
+                                //										"	    <input type='hidden' name='projectControlTableList["+i+"].delFlag' value='"+data[i].delFlag+"'>"+
+                                //										"	    <input type='hidden' name='projectControlTableList["+i+"].createBy.id' value='"+data[i].createBy.id+"'>"+
+                                "   </td>"+
+                                "   <td style='text-align:center;'>"+
+                                "   	<a href='javascript:void(0)' onclick=\"openDialogView('查看过程控制明细', '${ctx}/projectcontroltable/projectControlTable/form?view=view&id="+data[i].id+"','90%', '90%')\" class='btn btn-info btn-xs' ><i class='fa fa-search-plus'></i> 查看</a>"+
+                                "  		<a href=\"javascript:initControlData('0','#tr"+i+"','del','"+data[i].id+"')\" onclick=\"return confirmx('确认要删除该过程控制数据吗?', this.href)\"   class='btn btn-danger btn-xs'><i class='fa fa-trash'></i> 删除</a>"+
+                                "  </td>"+
+                                "</tr>";
+                        }
+                        if(htmlStr){
+                            $("#projectControlTables").html(htmlStr);
+                        }
+                    }
+                }
+            })
+        }
+
+        function formatNum(obj) {
+            var val = $(obj).val();
+            console.log("-----------val"+val);
+            if(!isNumber(val))return;
+            var money = parseFloat((val + "").replace(/[^\d\.-]/g, "")).toFixed(2) + "";
+            var l = money.split(".")[0].split("").reverse(),
+                r = money.split(".")[1];
+            t = "";
+            for(i = 0; i < l.length; i ++ )
+            {
+                t += l[i] + ((i + 1) % 3 == 0 && (i + 1) != l.length ? "," : "");
+            }
+            $(obj).val(t.split("").reverse().join("") + "." + r);
+        }
+        function isNumber(val){
+            if(val === "" || val ==null){
+                return false;
+            }
+            var regPos = /^\d+(\.\d+)?$/; //非负浮点数
+            var regNeg = /^(-(([0-9]+\.[0-9]*[1-9][0-9]*)|([0-9]*[1-9][0-9]*\.[0-9]+)|([0-9]*[1-9][0-9]*)))$/; //负浮点数
+            if(regPos.test(val) || regNeg.test(val)){
+                return true;
+            }else{
+                return false;
+            }
+
+        }
+    </script>
+</head>
+<body>
+<div class="single-form">
+    <div class="container${container}">
+        <form:form id="inputForm" modelAttribute="concealProjectInfo" action="#" method="post" class="form-horizontal">
+            <form:hidden path="id"/>
+            <form:hidden path="edit"/>
+            <form:hidden path="parentIds"/>
+            <form:hidden path="condition"/>
+            <form:hidden path="project.id"/>
+            <form:hidden path="contract.id"/>
+            <form:hidden path="projectContentData.id"/>
+            <input type="hidden" id="contentDeta" name="projectContentData.contentDetail">
+            <input type="hidden" id="dataBodyList" name="dataBodyList" value="">
+            <input type="hidden" id="projectContentDataSign" name="projectContentDataSign" value="">
+            <sys:message content="${message}"/>
+            <div class="form-group layui-row first 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="projectContentData.number" htmlEscape="false" readonly="true" class="form-control layui-input"/>
+                        </div>
+                    </div>--%>
+                <div class="layui-item layui-col-sm6">
+                    <label class="layui-form-label"><span class="require-item">*</span>工程进度款名称:</label>
+                    <div class="layui-input-block">
+                        <form:input path="projectContentData.name" readonly="true" value="${concealProjectInfo.contract.contractName}" htmlEscape="false" class="form-control required layui-input"/>
+                    </div>
+                </div>
+                <div class="layui-item layui-col-sm6">
+                    <label class="layui-form-label"><span class="require-item">*</span>负责人:</label>
+                    <div class="layui-input-block">
+                        <form:input path="projectContentData.master.name"  htmlEscape="false"  readonly="true"  class="form-control layui-input required"/>
+                        <form:hidden path="projectContentData.master.id" htmlEscape="false"  readonly="true"  class="form-control layui-input required"/>
+                    </div>
+                </div>
+                <div class="layui-item layui-col-sm6">
+                    <label class="layui-form-label"><span class="require-item">*</span>创建日期:</label>
+                    <div class="layui-input-block">
+                        <input id="createDate" name="projectContentData.createDate"  type="text" readonly="true" maxlength="20" class="form-control layui-input required"
+                               value="<fmt:formatDate value="${concealProjectInfo.projectContentData.createDate}" pattern="yyyy-MM-dd"/>"/>
+                    </div>
+                </div>
+                <div class="layui-item layui-col-sm6" id="contentDetailTypeDiv" style="display: none">
+                    <label class="layui-form-label">选择类型:</label>
+                    <div class="layui-input-block">
+                        <div class="input-group">
+                            <div >
+                                <div id="contentDetailType" style="pointer-events: none;" class="xm-select-demo" tabindex="0" contenteditable="true"></div>
+                            </div>
+                        </div>
+                    </div>
+                </div>
+            </div>
+            <div class="form-group layui-row">
+                <div class="form-group-label"><h2>内容详情</h2></div>
+                <div style="padding: 0 15px;">
+                    <div id="contentDetail"></div>
+                </div>
+            </div>
+            <div class="form-group layui-row">
+                <div class="form-group-label"><h2>依据性资料明细</h2></div>
+                <div class="layui-item layui-col-xs12 form-table-container">
+                    <table id="contentTableBase" class="table table-bordered table-condensed details">
+                        <thead>
+                        <tr>
+                            <th class="hide"></th>
+                            <th >资料编号</th>
+                            <th >资料名称</th>
+                            <th >资料类别</th>
+                            <th >上传人</th>
+                            <th >上传日期</th>
+                        </tr>
+                        </thead>
+                        <tbody id="workBaseDataList">
+                        <c:forEach items="${concealProjectInfo.projectContentData.projectBasedDataList}" var="projectBasedData" varStatus="idx">
+                            <tr>
+                                <td class="hide">
+                                    <input type="hidden" id="workBaseDataList${idx.index}_id" value="${projectBasedData.id}" class="clientId">
+                                </td>
+                                <td style="text-align:center;">
+                                        ${projectBasedData.number}
+                                </td>
+                                <td style="text-align:center;">
+                                        ${projectBasedData.name}
+                                </td>
+                                <td style="text-align:center;">
+                                        ${fns:getDictLabel(projectBasedData.type, 'project_document_type', '')}
+                                </td>
+                                <td style="text-align:center;">
+                                        ${projectBasedData.uploadUser.name}
+                                </td>
+                                <td style="text-align:center;">
+                                    <fmt:formatDate value="${projectBasedData.uploadDate}" pattern="yyyy-MM-dd"/>
+                                </td>
+                            </tr>
+                        </c:forEach>
+                        </tbody>
+                    </table>
+                </div>
+            </div>
+            <script type="text/template" id="workBaseDataTpl">//<!--
+                <tr id="budgetList{{idx}}">
+                    <td class="hide">
+                        <input id="workBaseDataList{{idx}}_id" name="projectContentData.projectBasedDataList[{{idx}}].id" type="hidden" value="{{row.id}}" class="clientId"/>
+                        <input id="workBaseDataList{{idx}}_number" name="projectContentData.projectBasedDataList[{{idx}}].number" type="hidden" value="{{row.number}}"/>
+                        <input id="workBaseDataList{{idx}}_name" name="projectContentData.projectBasedDataList[{{idx}}].name" type="hidden" value="{{row.name}}"/>
+                        <input id="workBaseDataList{{idx}}_type" name="projectContentData.projectBasedDataList[{{idx}}].type" type="hidden" value="{{row.type}}"/>
+                    </td>
+                    <td style="text-align:center;">
+                        {{row.number}}
+                    </td>
+                    <td style="text-align:center;">
+                        {{row.name}}
+                    </td>
+                    <td style="text-align:center;">
+                        {{row.typeLabel}}
+                    </td>
+                    <td style="text-align:center;">
+                        {{row.uploadUser.name}}
+                    </td>
+                    <td style="text-align:center;">
+                        {{row.uploadDate}}
+                    </td>
+                    <td class="text-center op-td">
+                        <a href=javascript:void(0); onclick="delRowBaseData(this, '#workBaseDataList{{idx}}','{{row.uploadUser.id}}')"   class="op-btn op-btn-delete"><i class="fa fa-trash"></i> 取消</a>
+                    </td>
+                </tr>//-->
+            </script>
+            <script type="text/javascript">
+                var workBaseDataTpl = $("#workBaseDataTpl").html().replace(/(\/\/\<!\-\-)|(\/\/\-\->)/g,"");
+                var workBaseDataRowIdx = ${fn:length(concealProjectInfo.projectReportData.projectBasedDataList)};
+                function setValuee(obj){
+                    for(var i=0;i<obj.length;i++){
+                        var idArr = $("#workBaseDataList tr:visible .clientId");
+                        if(obj[i].id!=''&&!hasInArr(obj[i].id,idArr)){
+                            addRowBaseData("#workBaseDataList",workBaseDataRowIdx,workBaseDataTpl,obj[i]);
+                            workBaseDataRowIdx=workBaseDataRowIdx+1;
+                        }
+                    }
+                }
+                function hasInArr(id,idArr) {
+                    for(var i=0;i<idArr.length;i++){
+                        if(id==$(idArr[i]).val()){
+                            return true;
+                        }
+                    }
+                    return false;
+                }
+                function existBaseData(id,length) {
+                    for (var i=0;i<length;i++) {
+                        var val = $('#workBaseDataList'+i+'_id').val();
+                        if(id==val){
+                            return true;
+                        }
+                    }
+                    return false;
+                }
+
+                function addRowBaseData(list, idx, tpl, row){
+                    bornTemplete(list, idx, tpl, row, idx);
+                }
+
+                function bornTemplete(list, idx, tpl, row, idx1){
+                    var idx1 = $("#workBaseDataList 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 delRowBaseData(obj, prefix,userId){
+                    var id = $(prefix+"_id").val();
+                    /* var createBy = $(prefix+"_userId").val();*/
+                    var currentUser = '${fns:getUser().id}';
+                    var contentId = '${concealProjectInfo.projectContentData.id}';
+                    console.log(contentId);
+
+                    $.ajax({
+                        type:"post",
+                        url:'${ctx}/project/concealProject/ajaxdelete',
+                        data:{"contentId":contentId,"basedId":id},
+                        dataType:"json",
+                        success:function(data){
+                            if(data.success) {
+                                $(obj).parent().parent().remove();
+                                if(data.body.inuse){
+                                    return;
+                                }
+                                if (currentUser == userId) {
+                                    confirmDelete('是否同步删除资料库的文件?','${ctx}/projectcontentinfo/projectcontentinfo/delete?infoId='+id+'&id=${concealProjectInfo.id}&type=1');
+                                }
+                            }else {
+                                top.layer.msg("删除依据资料失败!", {icon: 0});
+                            }
+                        }
+                    })
+                    return;
+                }
+
+                function confirmDelete(mess, href){
+                    top.layer.confirm(mess, {icon: 3, title:'系统提示'}, function(index){
+                        //do something
+                        if (typeof href == 'function') {
+                            href();
+                        }else{
+                            $.ajax({
+                                url:href,
+                                type:"post",
+                                success:function(data){
+                                    if(data.success){
+                                        top.layer.msg("删除依据资料成功!", {icon: 0});
+                                    }
+                                }
+                            });
+                        }
+                        top.layer.close(index);
+                    });
+                    return false;
+                }
+            </script>
+            <div class="form-group layui-row">
+                <div class="form-group-label"><h2>附件信息</h2></div>
+                <div id="addFile_attachment" style="display: none" class="upload-progress">
+                    <span id="fileName_attachment" ></span>
+                    <b><span id="baifenbi_attachment" ></span></b>
+                    <div class="progress">
+                        <div id="jindutiao_attachment" class="progress-bar" style="width: 0%" aria-valuenow="0">
+                        </div>
+                    </div>
+                </div>
+                <input id="attachment_file" type="file" name="attachment_file" multiple="multiple" style="display: none;" onChange="if(this.value)insertTitle(this.value);"/>
+                <span id="attachment_title"></span>
+                <div class="layui-item layui-col-xs12" style="padding:0 16px;">
+                    <table id="upTable" class="table table-bordered table-condensed details">
+                        <thead>
+                        <tr>
+                            <th>文件名称</th>
+                            <th>上传人</th>
+                            <th>上传时间</th>
+                            <th width="150px">操作</th>
+                        </tr>
+                        </thead>
+                        <tbody id="file_attachment">
+                        <c:forEach items="${concealProjectInfo.projectContentData.workAttachments}" var = "workAttachment" varStatus="status">
+                            <tr>
+                                <c:choose>
+                                    <c:when test="${fn:containsIgnoreCase(workAttachment.attachmentName,'jpg')
+                                                                           or fn:containsIgnoreCase(workAttachment.attachmentName,'png')
+                                                                           or fn:containsIgnoreCase(workAttachment.attachmentName,'gif')
+                                                                           or fn:containsIgnoreCase(workAttachment.attachmentName,'bmp')
+                                                                           or fn:containsIgnoreCase(workAttachment.attachmentName,'jpeg')}">
+                                        <td><img src="${workAttachment.url}" width="50" height="50" alt="${workAttachment.attachmentName}"/></td>
+                                    </c:when>
+                                    <c:otherwise>
+                                        <c:choose>
+                                            <c:when test="${fn:containsIgnoreCase(workAttachment.attachmentName,'pdf')}">
+                                                <td><a href="javascript:void(0)" onclick="preview('预览','${workAttachment.url}','90%','90%','1')">${workAttachment.attachmentName}</a></td>
+                                            </c:when>
+                                            <c:otherwise>
+                                                <td><a href="javascript:void(0)" onclick="preview('预览','${workAttachment.url}','90%','90%')">${workAttachment.attachmentName}</a></td>
+                                            </c:otherwise>
+                                        </c:choose>
+                                    </c:otherwise>
+                                </c:choose>
+                                <td>${workAttachment.createBy.name}</td>
+                                <td><fmt:formatDate value="${workAttachment.createDate}" type="both"/></td>
+                                <td class="op-td">
+                                    <div class="op-btn-box" >
+                                        <a href="javascript:location.href='${ctx}/workfullmanage/workFullManage/downLoadAttach?file='+encodeURIComponent('${workAttachment.url}');" class="op-btn op-btn-download"><i class="fa fa-download"></i>&nbsp;下载</a>
+                                    </div>
+                                </td>
+                            </tr>
+                        </c:forEach>
+                        </tbody>
+                    </table>
+                </div>
+            </div>
+            <c:if test="${concealProjectInfo.infoId !=null and concealProjectInfo.edit  == 'edit'}">
+                <div class="pull-right">
+                    <button id="btnSubmit" class="nav-btn nav-btn-add" type="submit" onclick="$('#edit').val('edit');beforeSubmit();"><i class="fa fa-chevron-up"></i> 提 交</button>
+                </div>
+            </c:if>
+            <div class="form-group layui-row page-end">
+                <br>
+                <br>
+                <br>
+            </div>
+        </form:form>
+    </div>
+</div>
+<script src="${ctxStatic}/layer-v2.3/layui/layui.all.js" charset="utf-8"></script>
+<script>
+    function contentDetailTypeShow(obj) {
+        var projectContentDataId = '${concealProjectInfo.projectContentData.id}';
+        $.ajax({
+            type:'post',
+            url:'${ctx}/projectcontentinfo/projectcontentinfo/getAchievementTypeList2',
+            data:{
+                "achievementParentId":obj,
+                "type":2
+            },
+            success:function(data){
+                if(data.success) {
+                    if (null != obj && "" != obj) {
+                        if(null !=projectContentDataId && ""!= projectContentDataId) {
+                            $.ajax({
+                                type: 'post',
+                                url: getExistingDataOnPath(obj),
+                                data: {
+                                    "contentId": "${concealProjectInfo.projectContentData.id}"
+                                },
+                                success: function (tableTypeList) {
+                                    var dataList = data.body.list;
+                                    var newDataList = [];
+                                    var holdDataList = data.body.list;
+                                    if (0 != dataList.length) {
+                                        for (i in holdDataList) {
+                                            newDataList.push(holdDataList[i])
+                                        }
+                                    }
+                                    if (0 != newDataList.length && 0 !=tableTypeList.length){
+                                        for (i in newDataList) {
+                                            for (j in tableTypeList) {
+                                                if (newDataList[i].value == tableTypeList[j]) {
+                                                    var newData = {
+                                                        "name": newDataList[i].name,
+                                                        "value": newDataList[i].value,
+                                                        "selected": true
+                                                    }
+                                                    holdDataList.splice(i,1,newData);
+                                                }
+                                                modifyGetDetailsNum(tableTypeList);
+                                            }
+                                        }
+                                        xmSelect.render({
+                                            el: '#contentDetailType',
+                                            language: 'zn',
+                                            data: holdDataList
+                                        })
+                                        $("#dataBodyList").val(holdDataList);
+                                    }else{
+                                        xmSelect.render({
+                                            el: '#contentDetailType',
+                                            language: 'zn',
+                                            data: dataList
+                                        })
+                                        $("#dataBodyList").val(holdDataList);
+                                    }
+                                }
+                            })
+                        }else{
+                            xmSelect.render({
+                                el: '#contentDetailType',
+                                language: 'zn',
+                                data: data.body.list
+                            })
+                            $("#dataBodyList").val(data.body.list);
+                        }
+                    }else {
+                        xmSelect.render({
+                            el: '#contentDetailType',
+                            language: 'zn',
+                            data: data.body.list
+                        })
+                        $("#dataBodyList").val(data.body.list);
+                    }
+                }
+            }
+        })
+    }
+
+    var contentDetailType = xmSelect.render({
+        el: '#contentDetailType',
+        language: 'zn',
+        data: [
+        ]
+    })
+
+    function getExistingDataOnPath(val) {
+        return "${ctx}/workSchedule/workSchedule/getTableType";
+    }
+
+    function modifyGetDetailsNum(list){
+        $("#contentDetailType").empty();
+        console.log(list);
+        var val = $("#projectContentDataSign").val();
+        var param2 = {'contentId':"${concealProjectInfo.projectContentData.id}",'projectId':"${concealProjectInfo.project.id}",'sign':list.toString(),'achievementParentId':val,view:"view"};
+        detailFlag=1;
+        $("#contentDetail").load("${ctx}/workSchedule/workSchedule/list",param2);
+    }
+</script>
+</body>
+</html>

+ 37 - 5
src/main/webapp/webpage/modules/projectrecord/implementStage/projectInterimPaymentList.jsp

@@ -293,7 +293,39 @@
                 elem: '#permissionTable',
                 url: '${ctx}/project/projectInterimPayment/getProjectList?pageNo=${page.pageNo}&contractName='+contractName+'&projectName='+projectName,
                 page: false,
-                cols: [
+				cols: [[
+					{type: 'numbers', align:'center', title: '序号' ,width:80},
+					{field: 'cnumber', title: '项目编号/实施合同编号',templet:function(d){
+							if(d.condition ==1){
+								return "<font>"+d.cnumber+"</font>";
+							}else if(d.condition ==2){
+								return "<font>"+d.cnumber+"</font>";
+							}else{
+								return "<font>"+d.cnumber+"</font>";
+							}
+						}},
+					{field: 'contractName',align:'center', title: '项目名称/实施合同名称/工程进度款名称',templet:function(d){
+							if(d.condition ==1){
+								return  "<a class=\"attention-info pid\" title=\"" + d.contractName + "\" href=\"javascript:void(0);\" onclick=\"openDialogView('查看项目信息', '${ctx}/project/projectRecords/view?id=" + d.id +"','95%', '95%')\">" + d.contractName + "</a>";
+							}else if(d.condition ==2){
+								return  "<a class=\"attention-info pid\" title=\"" + d.contractName + "\" href=\"javascript:void(0);\" onclick=\"openDialogView('查看合同信息', '${ctx}/project/constructionContract/view?id=" + d.contractId +"','95%', '95%')\">" + d.contractName + "</a>";
+							}else{
+								return "<a class=\"attention-info\" href=\"javascript:void(0)\" onclick=\"openDialogView('查看隐蔽工程量信息', '${ctx}/project/projectInterimPayment/form?type=view&infoId="+d.id+"&contractId="+d.contractId+"&project.id="+d.projectId+"&contract.id="+d.pid+"','95%', '95%')\">" + d.contractName + "</a>";
+							}
+						}},
+					{field: 'date', align:'center', title: '创建日期',width:100,templet: function(d){
+							var date=d.createDate;
+							if(d.condition ==1){
+								return "";
+							}else if(d.condition ==2){
+								return "";
+							}else{
+								return "<font>"+layui.util.toDateString(date,'yyyy-MM-dd')+"</font>";
+							}
+						}},
+					{templet: complain, align:'center', title: '操作',width:130}
+				]],
+                /*cols: [
 					[
 						{rowspan: 2, type: 'numbers', align:'center', title: '序号' ,width:40},
 						{rowspan: 2, field: 'cnumber', align:'center' , width:200, title: '项目编号/实施合同编号',templet:function(d){
@@ -345,7 +377,7 @@
 						{field: 'nowTotalPayCost', align:'center', title: '已累计支付价款' , width:100},
 						{field: 'nowPayRatio', align:'center', title: '支付比例(%)' , width:100},
 					]
-				],
+				],*/
                 done: function () {
                     layer.closeAll('loading');
                 }
@@ -377,7 +409,7 @@
 
 				if(1 == d.operationSign) {
 					return [
-						'<a href="javascript:void(0)" onclick="openDialogreAudit(\'新增\', \'${ctx}/project/projectInterimPayment/form?contractId='+d.id+'\',\'90%\',\'90%\')" style=\"color: white;background: darkseagreen\" class="op-btn op-btn-add" ><i class="fa fa-plus"></i> 新增</a>',
+						'<a href="javascript:void(0)" onclick="openDialogreAudit(\'新增工程进度款信息\', \'${ctx}/project/projectInterimPayment/form?project.id='+d.pid+'&contract.id='+d.id+'&contract.contractName='+d.contractName+' \',\'95%\',\'95%\')" style=\"color: white;background: darkseagreen\" class="op-btn op-btn-add" ><i class="fa fa-plus"></i> 新增</a>',
 					].join('');
 				}else{
 					return[''].join('');
@@ -385,8 +417,8 @@
 			} else if (d.condition ==3){
 				if(1 == d.operationSign) {
 					return [
-						'<a href="javascript:void(0)" onclick="openDialogreAudit(\'修改信息\', \'${ctx}/project/projectInterimPayment/form?id='+d.id+'\',\'90%\',\'90%\')" class="op-btn op-btn-edit" ><i class="fa fa-edit"></i> 修改</a>',
-						'<a href="${ctx}/project/projectInterimPayment/delete?id='+d.id+'" onclick="return confirmx(\'确认要删除该工程进度款记录吗?\', this.href)"   class="op-btn op-btn-delete"><i class="fa fa-trash"></i> 删除</a>',
+						'<a href="javascript:void(0)" onclick="openDialogreAudit(\'修改工程进度款信息\', \'${ctx}/project/projectInterimPayment/form?infoId='+d.id+'&contractId='+d.contractId+'&project.id='+d.projectId+'&contract.id='+d.pid+'\',\'95%\',\'95%\')" class="op-btn op-btn-edit" ><i class="fa fa-edit"></i> 编辑</a>',
+						'<a href="${ctx}/project/projectInterimPayment/deleteInterimPayment?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('');

+ 2 - 2
src/main/webapp/webpage/modules/projectrecord/projectRecordsList.jsp

@@ -296,8 +296,8 @@
 					<shiro:hasPermission name="project:projectRecords:export">
 						<table:exportExcel url="${ctx}/project/projectRecords/export"></table:exportExcel><!-- 导出按钮 -->
 					</shiro:hasPermission>
-					<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 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>