瀏覽代碼

添加造价审核新增方法

user5 4 年之前
父節點
當前提交
71033f3e06

+ 646 - 0
src/main/java/com/jeeplus/modules/ruralprojectrecords/web/RuralCostProjectRecordsController.java

@@ -0,0 +1,646 @@
+/**
+ * Copyright &copy; 2015-2020 <a href="http://www.jeeplus.org/">JeePlus</a> All rights reserved.
+ */
+package com.jeeplus.modules.ruralprojectrecords.web;
+
+import com.google.common.collect.Lists;
+import com.jeeplus.common.config.Global;
+import com.jeeplus.common.oss.OSSClientUtil;
+import com.jeeplus.common.persistence.Page;
+import com.jeeplus.common.utils.DateUtils;
+import com.jeeplus.common.utils.MyBeanUtils;
+import com.jeeplus.common.utils.StringUtils;
+import com.jeeplus.common.utils.excel.ExportExcel;
+import com.jeeplus.common.web.BaseController;
+import com.jeeplus.modules.act.entity.Act;
+import com.jeeplus.modules.act.service.ActTaskService;
+import com.jeeplus.modules.act.utils.ActUtils;
+import com.jeeplus.modules.ruralprojectrecords.entity.RuralProjectRecords;
+import com.jeeplus.modules.ruralprojectrecords.enums.ProjectStatusEnum;
+import com.jeeplus.modules.ruralprojectrecords.service.RuralProjectRecordsService;
+import com.jeeplus.modules.sys.entity.Office;
+import com.jeeplus.modules.sys.entity.Role;
+import com.jeeplus.modules.sys.entity.User;
+import com.jeeplus.modules.sys.utils.DictUtils;
+import com.jeeplus.modules.sys.utils.UserUtils;
+import com.jeeplus.modules.workactivity.entity.Activity;
+import com.jeeplus.modules.workactivity.service.ActivityService;
+import com.jeeplus.modules.workclientinfo.entity.WorkClientInfo;
+import com.jeeplus.modules.workclientinfo.entity.WorkClientLinkman;
+import com.jeeplus.modules.workclientinfo.service.WorkClientInfoService;
+import com.jeeplus.modules.workcontractinfo.entity.WorkContractInfo;
+import com.jeeplus.modules.workcontractinfo.service.WorkContractInfoService;
+import org.activiti.engine.runtime.ProcessInstance;
+import org.activiti.engine.task.Task;
+import org.apache.shiro.authz.annotation.Logical;
+import org.apache.shiro.authz.annotation.RequiresPermissions;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Controller;
+import org.springframework.ui.Model;
+import org.springframework.web.bind.annotation.*;
+import org.springframework.web.multipart.MultipartFile;
+import org.springframework.web.servlet.mvc.support.RedirectAttributes;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import java.io.UnsupportedEncodingException;
+import java.net.URLDecoder;
+import java.util.*;
+
+/**
+ * 造价审核项目登记Controller
+ * @author 徐滕
+ * @version 2020-10-15
+ */
+@Controller
+@RequestMapping(value = "${adminPath}/ruralProject/ruralCostProjectRecords")
+public class RuralCostProjectRecordsController extends BaseController {
+
+    @Autowired
+    private WorkClientInfoService workClientInfoService;
+
+	@Autowired
+	private RuralProjectRecordsService projectRecordsService;
+
+	@Autowired
+	private WorkContractInfoService contractInfoService;
+	@Autowired
+	private ActTaskService actTaskService;
+	@Autowired
+	private ActivityService activityService;
+
+	private static String template_path = Global.getProjectTemplatePath()+"咨询工作方案.xlsx";
+	private static String template_name = "咨询工作方案.xlsx";
+
+	@ModelAttribute
+	public RuralProjectRecords get(@RequestParam(required=false) String id) {
+		RuralProjectRecords entity = null;
+		if (StringUtils.isNotBlank(id)){
+			entity = projectRecordsService.get(id);
+		}
+		if (entity == null){
+			entity = new RuralProjectRecords();
+		}
+		return entity;
+	}
+	
+	/**
+	 * 项目列表页面
+	 */
+	@RequiresPermissions("ruralProject:ruralCostProjectRecords:list")
+	@RequestMapping(value = {"list", ""})
+	public String list(RuralProjectRecords projectRecords, HttpServletRequest request, HttpServletResponse response, Model model) {
+        if(UserUtils.isManager()){
+            model.addAttribute("flag","1");
+        }
+        //添加查询类型(造价审核)
+		projectRecords.setProjectType("2");
+        //获取项目信息
+		Page<RuralProjectRecords> page = projectRecordsService.findPage(new Page<RuralProjectRecords>(request, response), projectRecords);
+        //无合同状态下,获取委托方的名称
+		List<RuralProjectRecords> list = page.getList();
+		for (int i = 0; i < list.size(); i++) {
+			RuralProjectRecords records1 = list.get(i);
+			if (records1.getWorkContractInfo() == null) {
+				projectRecordsService.queryLinkmanInfos(records1);
+				if (records1.getWorkClientLinkmanList() != null && records1.getWorkClientLinkmanList().size() > 0) {
+					WorkClientLinkman linkman = records1.getWorkClientLinkmanList().get(0);
+					WorkContractInfo contractInfo = new WorkContractInfo();
+					contractInfo.setClient(linkman.getClientId());
+					records1.setWorkContractInfo(contractInfo);
+				}
+			}
+		}
+		model.addAttribute("page", page);
+		return "modules/ruralprojectrecords/cost/ruralCostProjectRecordsList";
+	}
+
+	/**
+	 * 查看,增加,编辑项目表单页面
+	 */
+	@RequiresPermissions(value={"ruralProject:ruralCostProjectRecords:add","ruralProject:ruralCostProjectRecords:edit"},logical=Logical.OR)
+	@RequestMapping(value = "form")
+	public String form(RuralProjectRecords projectRecords, Model model) {
+		if (projectRecords!=null&&StringUtils.isNotBlank(projectRecords.getId())) {
+			projectRecords = projectRecordsService.get(projectRecords.getId());
+            projectRecordsService.queryProjectDetail(projectRecords);
+		}else {
+		    projectRecords.setCreateBy(UserUtils.getUser());
+		    projectRecords.setCreateDate(new Date());
+        }
+		model.addAttribute("ruralProjectRecords", projectRecords);
+		return "modules/ruralprojectrecords/cost/ruralCostProjectRecordsForm";
+	}
+
+	/**
+	 * 查看
+	 * @param projectRecords
+	 * @param model
+	 * @return
+	 */
+	@RequiresPermissions(value={"ruralProject:ruralCostProjectRecords:view"})
+	@RequestMapping(value = "view")
+	public String view(RuralProjectRecords projectRecords, Model model) {
+		if (projectRecords!=null&&StringUtils.isNotBlank(projectRecords.getId())) {
+			projectRecordsService.queryProjectDetail(projectRecords);
+		}
+		model.addAttribute("projectRecords", projectRecords);
+		return "modules/ruralprojectrecords/cost/ruralCostProjectRecordsView";
+	}
+
+	/**
+	 * 保存项目
+	 */
+	@RequiresPermissions(value={"ruralProject:ruralCostProjectRecords:add","ruralProject:ruralCostProjectRecords:edit"},logical=Logical.OR)
+	@RequestMapping(value = "save")
+	public String save(RuralProjectRecords projectRecords, Model model, RedirectAttributes redirectAttributes) throws Exception {
+		if (!beanValidator(model, projectRecords)){
+			return form(projectRecords, model);
+		}
+//		try {
+//            projectRecords.setProjectStatus(ProjectStatusEnum.IN_APRL.getValue());
+            if (!projectRecords.getIsNewRecord()) {//编辑表单保存
+                RuralProjectRecords t = projectRecordsService.get(projectRecords.getId());//从数据库取出记录的值
+                MyBeanUtils.copyBeanNotNull2Bean(projectRecords, t);//将编辑表单中的非NULL值覆盖数据库记录中的值
+                projectRecordsService.saveProject(t, ProjectStatusEnum.IN_APRL);//保存
+            } else {//新增表单保存
+				//添加查询类型(造价审核)
+				projectRecords.setProjectType("2");
+                projectRecordsService.saveProject(projectRecords, ProjectStatusEnum.IN_APRL);//保存
+            }
+			addMessage(redirectAttributes, "保存项目成功");
+//        }catch (Exception e){
+//		    logger.error("保存项目异常:",e);
+//            addMessage(redirectAttributes, "保存项目异常:"+e.getMessage());
+//        }
+		return "redirect:"+Global.getAdminPath()+"/ruralProject/ruralCostProjectRecords/?repage";
+	}
+	/**
+	 * 保存项目
+	 */
+	@RequiresPermissions(value={"ruralProject:ruralCostProjectRecords:add","ruralProject:ruralCostProjectRecords:edit"},logical=Logical.OR)
+	@RequestMapping(value = "tstore")
+	public String tStore(RuralProjectRecords projectRecords, Model model, RedirectAttributes redirectAttributes) throws Exception{
+		if (!beanValidator(model, projectRecords)){
+			return form(projectRecords, model);
+		}
+		try {
+//            projectRecords.setProjectStatus(ProjectStatusEnum.TSTORE.getValue());
+            if (!projectRecords.getIsNewRecord()) {//编辑表单保存
+                RuralProjectRecords t = projectRecordsService.get(projectRecords.getId());//从数据库取出记录的值
+                MyBeanUtils.copyBeanNotNull2Bean(projectRecords, t);//将编辑表单中的非NULL值覆盖数据库记录中的值
+                projectRecordsService.saveProject(t, ProjectStatusEnum.TSTORE);//保存
+            } else {//新增表单保存
+            	// 添加查询类型(工程咨询)
+				projectRecords.setProjectType("2");
+                projectRecordsService.saveProject(projectRecords, ProjectStatusEnum.TSTORE);//保存
+            }
+            addMessage(redirectAttributes, "暂存项目成功");
+        }catch (Exception e){
+            logger.error("暂存项目异常:",e);
+            addMessage(redirectAttributes, "暂存项目异常:"+e.getMessage());
+        }
+		return "redirect:"+Global.getAdminPath()+"/ruralProject/ruralCostProjectRecords/?repage";
+	}
+
+    /**
+     * 编辑项目表单页面
+     */
+    @RequiresPermissions(value={"ruralProject:ruralCostProjectRecords:edit"},logical=Logical.OR)
+    @RequestMapping(value = "modify")
+    public String modify(RuralProjectRecords projectRecords, Model model, RedirectAttributes redirectAttributes) {
+        projectRecords=projectRecordsService.get(projectRecords.getId());
+        ProcessInstance processInstance = actTaskService.getProcIns(projectRecords.getProcessInstanceId());
+        if (processInstance!=null) {
+            Task taskInfok = actTaskService.getCurrentTaskInfo(processInstance);
+            Act act = new Act();
+            act.setTaskId(taskInfok.getId());
+            act.setTaskName(taskInfok.getName());
+            act.setTaskDefKey(taskInfok.getTaskDefinitionKey());
+            act.setProcDefId(taskInfok.getProcessDefinitionId());
+            act.setProcInsId(taskInfok.getProcessInstanceId());
+            act.setTask(taskInfok);
+            projectRecords.setAct(act);
+        }
+
+        projectRecordsService.queryProjectDetail(projectRecords);
+        model.addAttribute("projectRecords", projectRecords);
+        return "modules/ruralprojectrecords/cost/ruralCostProjectRecordsModify";
+    }
+
+	/**
+	 * 删除项目
+	 */
+	@RequiresPermissions("ruralProject:ruralCostProjectRecords:del")
+	@RequestMapping(value = "delete")
+	public String delete(RuralProjectRecords projectRecords, RedirectAttributes redirectAttributes) {
+		int status = projectRecords.getProjectStatus();
+		if(status== ProjectStatusEnum.TSTORE.getValue()||status== ProjectStatusEnum.REJECTED.getValue()||status== ProjectStatusEnum.RECALL.getValue()){
+			projectRecordsService.delete(projectRecords);
+			addMessage(redirectAttributes, "删除项目成功");
+			return "redirect:"+Global.getAdminPath()+"/ruralProject/ruralProjectRecords/?repage";
+		}else {
+			addMessage(redirectAttributes, "删除项目失败,只有“暂存”、“驳回”、“撤回”状态的项目才能删除");
+		}
+		return "redirect:"+Global.getAdminPath()+"/ruralProject/ruralCostProjectRecords/?repage";
+	}
+	
+	/**
+	 * 批量删除项目
+	 */
+	@RequiresPermissions("ruralProject:ruralCostProjectRecords:del")
+	@RequestMapping(value = "deleteAll")
+	public String deleteAll(String ids, RedirectAttributes redirectAttributes) {
+		String idArray[] =ids.split(",");
+		for(String id : idArray){
+			projectRecordsService.delete(projectRecordsService.get(id));
+		}
+		addMessage(redirectAttributes, "删除项目成功");
+		return "redirect:"+Global.getAdminPath()+"/ruralProject/ruralCostProjectRecords/?repage";
+	}
+	
+	/**
+	 * 导出excel文件
+	 */
+	@RequiresPermissions("ruralProject:ruralCostProjectRecords:export")
+    @RequestMapping(value = "export", method=RequestMethod.POST)
+    public String exportFile(RuralProjectRecords projectRecords, HttpServletRequest request, HttpServletResponse response, RedirectAttributes redirectAttributes) {
+		try {
+			//添加查询类型(造价审核)
+			projectRecords.setProjectType("2");
+            String fileName = "项目"+DateUtils.getDate("yyyyMMddHHmmss")+".xlsx";
+            Page<RuralProjectRecords> page = projectRecordsService.findPage(new Page<RuralProjectRecords>(request, response, -1), projectRecords);
+    		new ExportExcel("项目", RuralProjectRecords.class).setDataList(page.getList()).write(response, fileName).dispose();
+    		return null;
+		} catch (Exception e) {
+			addMessage(redirectAttributes, "导出项目记录失败!失败信息:"+e.getMessage());
+		}
+		return "redirect:"+Global.getAdminPath()+"/ruralProject/ruralCostProjectRecords/?repage";
+    }
+
+	/**
+	 * 下载导入项目数据模板
+	 */
+	@RequiresPermissions("ruralProject:ruralCostProjectRecords:import")
+    @RequestMapping(value = "import/template")
+    public String importFileTemplate(HttpServletResponse response, RedirectAttributes redirectAttributes) {
+		try {
+            String fileName = "项目数据导入模板.xlsx";
+    		List<RuralProjectRecords> list = Lists.newArrayList();
+    		new ExportExcel("项目数据", RuralProjectRecords.class, 1).setDataList(list).write(response, fileName).dispose();
+    		return null;
+		} catch (Exception e) {
+			addMessage(redirectAttributes, "导入模板下载失败!失败信息:"+e.getMessage());
+		}
+		return "redirect:"+Global.getAdminPath()+"/ruralProject/ruralCostProjectRecords/?repage";
+    }
+	
+	
+	
+	@RequestMapping("getContractInfo")
+	@ResponseBody
+	public WorkContractInfo queryContractInfo(WorkContractInfo  contractInfo){
+		WorkContractInfo workContractInfo = contractInfoService.get(contractInfo.getId());
+		if(workContractInfo==null){
+		    return workContractInfo;
+        }
+		workContractInfo.setConstructionProjectTypeStr(DictUtils.getDictLabel(String.valueOf(workContractInfo.getConstructionProjectType()),"construction_project_type",""));
+		if(workContractInfo.getWorkClientInfoList()!=null&&!workContractInfo.getWorkClientInfoList().isEmpty()){
+            StringBuilder workClinetInfoIds = new StringBuilder();
+            for (WorkClientInfo workClientInfo : workContractInfo.getWorkClientInfoList()) {
+                workClinetInfoIds.append(workClientInfo.getId()).append(",");
+			}
+            workClinetInfoIds.deleteCharAt(workClinetInfoIds.length()-1);
+            workContractInfo.setWorkClinetInfoIds(workClinetInfoIds.toString());
+        }
+		return  workContractInfo;
+	}
+
+	//	审批页面
+	@RequestMapping(value = "projectRecordsAudit")
+	public String workContractInfoAudit(Act act, RuralProjectRecords projectRecords, Model model) {
+
+		if (act.getProcInsId() != null) {
+			if (actTaskService.getProcIns(act.getProcInsId()) != null) {
+				act.setProcIns(actTaskService.getProcIns(act.getProcInsId()));
+			} else {
+				act.setFinishedProcIns(actTaskService.getFinishedProcIns(act.getProcInsId()));
+			}
+		}
+		if (act != null && StringUtils.isNotBlank(act.getTaskId())) {
+			projectRecords.setAct(act);
+			model.addAttribute("processInstanceId", projectRecords.getProcessInstanceId());
+		}
+		if (projectRecords!=null&&StringUtils.isNotBlank(projectRecords.getId())) {
+            projectRecordsService.queryProjectDetail(projectRecords);
+		}
+		model.addAttribute("projectRecords", projectRecords);
+		return "modules/ruralprojectrecords/ruralProjectRecordsAudit";
+	}
+
+	@RequestMapping(value = "getProcess")
+	public String getProcess(RuralProjectRecords projectRecords, Model model, HttpServletRequest request){
+		model.addAttribute("processInstanceId", projectRecords.getProcessInstanceId());
+		return "modules/ruralprojectrecords/ruralProjectRecordsTask";
+	}
+
+	@RequestMapping(value = "revoke")
+	public String revoke(HttpServletRequest request, RedirectAttributes redirectAttributes) {
+		HashMap<String, String> requestMap = findRequestMap(request);
+		String processInstanceId = requestMap.get("processInstanceId");
+		String id = requestMap.get("id");
+		try {
+            RuralProjectRecords projectRecords = projectRecordsService.get(id);
+            if(5==projectRecords.getProjectStatus()){
+                addMessage(redirectAttributes, "项目登记已审批通过,无法撤回");
+                return "redirect:"+Global.getAdminPath()+"/ruralProject/ruralCostProjectRecords/?repage";
+            }
+            projectRecordsService.cancelProcess(projectRecords);
+			addMessage(redirectAttributes, "撤回该项目登记成功");
+		}catch (Exception e){
+			logger.info(e.getMessage());
+			addMessage(redirectAttributes, "撤回该项目登记失败");
+		}
+		return "redirect:" + Global.getAdminPath() + "/ruralProject/ruralCostProjectRecords/?repage";
+	}
+
+	/**
+	 * 查询待办任务
+	 *
+	 * @param act
+	 * @param model
+	 * @return
+	 */
+	@RequestMapping("/toDoList")
+	public String queryToList(Act act, Model model) {
+
+		//合同申请流程
+		act.setProcDefKey(ActUtils.PD_PROJECTRECORD[0]);
+		List<Act> list = actTaskService.todoList(act);
+		Office office = UserUtils.getSelectCompany();
+		String companyId = office==null?"":office.getId();
+		List<Activity> activities = activityService.groupByActivityMenu("7854872f45b84acd893010e66a3db2c8",companyId);
+		for (Activity activity:activities){
+			act.setProcDefKey(activity.getProcessKey());
+			list.addAll(actTaskService.todoList(act));
+		}
+
+		Role role = UserUtils.getSelectRole().get(0);
+		List<RuralProjectRecords> lists = new ArrayList<RuralProjectRecords>();
+		for (Act a : list) {
+			if (a.getTask().getTaskDefinitionKey()!=null) {
+				RuralProjectRecords projectRecords = projectRecordsService.getByProcessInstanceId(a.getProcInsId());
+				if (projectRecords==null){continue;}
+				projectRecordsService.queryContractInfos(projectRecords);
+				projectRecords.setAuditType("项目登记");
+				if(projectRecords.getProjectStatus()!= ProjectStatusEnum.RECALL.getValue()) {
+					User user1 = UserUtils.get(projectRecords.getCreateBy().getId());
+					if (projectRecords != null && user1.getCompany().getId().equals(companyId)) {
+						projectRecords.setCreateBy(user1);
+						if (a.getVars().getMap().get("applyUserId") != null) {
+							User user = UserUtils.get(a.getVars().getMap().get("applyUserId").toString());
+							if (user != null) {
+								a.getVars().getMap().put("applyUserId", UserUtils.get(a.getVars().getMap().get("applyUserId").toString()).getName());
+							}
+						}
+						projectRecords.setAct(a);
+						lists.add(projectRecords);
+					}
+				}
+			}
+		}
+
+		/*------变更--------*/
+		act.setProcDefKey("projectAlter");
+		List<Act> list3 = actTaskService.todoList(act);
+		Office office3 = UserUtils.getSelectCompany();
+		String companyId3 = office3==null?"":office3.getId();
+		List<Activity> activities3 = activityService.groupByActivityMenu("807c6d4b5623474792fe78ff1fd1cdff",companyId3);
+		for (Activity activity:activities3){
+			act.setProcDefKey(activity.getProcessKey());
+			list3.addAll(actTaskService.todoList(act));
+		}
+
+		for (Act a : list3) {
+			RuralProjectRecords projectRecords = projectRecordsService.getByAlterProcessInstanceId(a.getTask().getProcessInstanceId());
+			if (projectRecords!=null){
+				projectRecordsService.queryContractInfos(projectRecords);
+			}
+			if (projectRecords != null && projectRecords.getCompany().getId().equals(companyId3)&& projectRecords.getProjectStatus()== ProjectStatusEnum.ON_CHANGE.getValue()) {
+				if (a.getVars().getMap().get("applyUserId") != null) {
+					User user = UserUtils.get(a.getVars().getMap().get("applyUserId").toString());
+					if (user != null) {
+						a.getVars().getMap().put("applyUserId", UserUtils.get(a.getVars().getMap().get("applyUserId").toString()).getName());
+					}
+				}
+				projectRecords.setAct(a);
+				projectRecords.setAuditType("项目变更");
+				lists.add(projectRecords);
+			}
+		}
+
+		//排除 重新申请|撤销
+		Iterator<RuralProjectRecords> it = lists.iterator();
+		while(it.hasNext()){
+			RuralProjectRecords w = it.next();
+			if(w.getAct()!=null && w.getAct().getTaskDefKey().equals("reapply")){
+				it.remove();
+			}
+		}
+
+		model.addAttribute("list", lists);
+		return "modules/ruralProjectrecord/cost/ruralCostProjectRecordsToDoList";
+	}
+
+	/**
+	 * 审批
+	 * @param projectRecords
+	 * @param model
+	 * @param upload_files
+	 * @param redirectAttributes
+	 * @return
+	 */
+	@RequestMapping("saveAudit")
+	public String saveAudit(RuralProjectRecords projectRecords, Model model,
+							@RequestParam(value = "upload_files", required = false) MultipartFile[] upload_files,
+							RedirectAttributes redirectAttributes)  {
+		String home = projectRecords.getHome();
+		try {
+			String taskDefKey = projectRecords.getAct().getTaskDefKey();
+			//当状态为未通过时,重新修改数据
+			if ("modifyApply".equals(taskDefKey)) {
+				projectRecords.getAct().setComment("重新申请");
+			}
+			List<User> users = UserUtils.getByProssType(projectRecords.getProcessInstanceId(),1);
+			String flag = projectRecords.getAct().getFlag();
+			if ("yes".equals(flag) && (users==null || users.size()==0)){
+				addMessage(redirectAttributes, "审批失败,审批人为空,请联系管理员!");
+			}else {
+				String str = projectRecordsService.auditSave(projectRecords,users);
+				addMessage(redirectAttributes, str);
+			}
+		}catch (Exception e){
+			addMessage(redirectAttributes, "项目登记流程审批失败");
+		}
+
+        if (StringUtils.isNotBlank(home) && "home".equals(home)){
+            return "redirect:" + Global.getAdminPath() + "/home/?repage";
+        }else {
+            return "redirect:" + Global.getAdminPath() + "/ruralProject/ruralCostProjectRecords/?repage";
+        }
+	}
+
+	/**
+	 * 查询已办列表
+	 * @return
+	 */
+	@RequestMapping("/queryCompleteList")
+	public String queryCompleteList(Act act,HttpServletRequest request,HttpServletResponse response,Model model){
+		act.setProcDefKey("projectAudit");
+		List<RuralProjectRecords> list = projectRecordsService.historicList(act);
+		Office office = UserUtils.getSelectCompany();
+		String companyId = office==null?"":office.getId();
+		List<Activity> activities = activityService.groupByActivityMenu("7854872f45b84acd893010e66a3db2c8",companyId);
+		for (Activity activity:activities){
+			act.setProcDefKey(activity.getProcessKey());
+			list.addAll(projectRecordsService.historicList(act));
+		}
+
+		//合同变更
+		act.setProcDefKey("projectAlter");
+		List<Activity> activities3 = activityService.groupByActivityMenu("807c6d4b5623474792fe78ff1fd1cdff",companyId);
+		for (Activity activity:activities3){
+			act.setProcDefKey(activity.getProcessKey());
+			list.addAll(projectRecordsService.historicAlterList(act));
+		}
+		model.addAttribute("list",list);
+		return "modules/ruralprojectrecords/cost/ruralCostProjectRecordsHistoricList";
+	}
+
+	/**
+	 * 选择合同
+	 */
+	@RequestMapping(value = "selectcontract")
+	public String selectcontractId(WorkContractInfo contract, String url,String type,String isTotal, String fieldLabels, String fieldKeys, String searchLabel, String searchKey, HttpServletRequest request, HttpServletResponse response, Model model) {
+		if(!"1".equals(UserUtils.getSelectCompany().getId())){
+			contract.setOfficeId(UserUtils.getSelectOffice().getId());
+			contract.setChargeCompany(UserUtils.getSelectOffice().getId());
+			contract.setCreateBy(UserUtils.getUser());
+		}
+		contract.setContractState("5");
+		Page<WorkContractInfo> page = contractInfoService.findPageReceipts(new Page<WorkContractInfo>(request, response),  contract);
+		try {
+			fieldLabels = URLDecoder.decode(fieldLabels, "UTF-8");
+			fieldKeys = URLDecoder.decode(fieldKeys, "UTF-8");
+			searchLabel = URLDecoder.decode(searchLabel, "UTF-8");
+			searchKey = URLDecoder.decode(searchKey, "UTF-8");
+		} catch (UnsupportedEncodingException e) {
+			e.printStackTrace();
+		}
+		model.addAttribute("labelNames", fieldLabels.split("\\|"));
+		model.addAttribute("labelValues", fieldKeys.split("\\|"));
+		model.addAttribute("fieldLabels", fieldLabels);
+		model.addAttribute("fieldKeys", fieldKeys);
+		model.addAttribute("url", url);
+		model.addAttribute("searchLabel", searchLabel);
+		model.addAttribute("searchKey", searchKey);
+		model.addAttribute("type", type);
+		model.addAttribute("isTotal", isTotal);
+		model.addAttribute("obj", contract);
+		model.addAttribute("page", page);
+		return "modules/sys/gridselectContractDetail";
+	}
+
+	@RequestMapping(value = "detailList")
+    @RequiresPermissions("project:projectRecordsDetail:list")
+    public String detailList(RuralProjectRecords projectRecords, HttpServletRequest request, HttpServletResponse response, Model model) {
+        if(UserUtils.isManager()){
+            model.addAttribute("flag","1");
+        }
+        Page<RuralProjectRecords> page = projectRecordsService.findPageDetail(new Page<RuralProjectRecords>(request, response), projectRecords);
+        model.addAttribute("page", page);
+        return "modules/ruralprojectrecords/ruralCostProjectRecordsDetailList";
+    }
+
+    /**
+     * 导出excel文件
+     */
+    @RequiresPermissions("project:projectRecordsDetail:export")
+    @RequestMapping(value = "exportDetail", method=RequestMethod.POST)
+    public String exportDetailFile(RuralProjectRecords projectRecords, HttpServletRequest request, HttpServletResponse response, RedirectAttributes redirectAttributes) {
+        try {
+            String fileName = "项目"+DateUtils.getDate("yyyyMMddHHmmss")+".xlsx";
+            Page<RuralProjectRecords> page = projectRecordsService.findPageDetail(new Page<RuralProjectRecords>(request, response, -1), projectRecords);
+            new ExportExcel("项目", RuralProjectRecords.class).setDataList(page.getList()).write(response, fileName).dispose();
+            return null;
+        } catch (Exception e) {
+            addMessage(redirectAttributes, "导出项目记录失败!失败信息:"+e.getMessage());
+        }
+        return "redirect:"+Global.getAdminPath()+"/ruralProject/ruralCostProjectRecords/?repage";
+    }
+
+    /**
+     * 下载导入项目数据模板
+     */
+    @RequiresPermissions("project:projectRecords:edit")
+    @RequestMapping(value = "downloadTemplate")
+    public void downloadTemplate(HttpServletRequest request,HttpServletResponse response) {
+        try {
+            new OSSClientUtil().downByStream(template_path,template_name,response,request.getHeader("USER-AGENT"));
+        } catch (Exception e) {
+            logger.error("项目计划模板下载失败!",e);
+        }
+    }
+
+    /**
+     * 项目登记新增客户管理
+     */
+    @RequestMapping(value = "linkManSave")
+    @ResponseBody
+    public Object linkManSave(WorkClientInfo workClientInfo,
+                                               Model model, RedirectAttributes redirectAttributes,
+                                               HttpServletRequest request
+    ) throws Exception{
+    	Map<String,Object> map = new HashMap<>();
+        try {
+            //保存当前人的公司
+            workClientInfo.setCompanyId(UserUtils.getSelectCompany().getId());
+            workClientInfo.setOfficeId(UserUtils.getSelectOffice().getId());
+            workClientInfoService.save(workClientInfo);//保存
+			WorkClientLinkman linkman = workClientInfo.getWorkClientLinkmanList().get(0);
+			map.put("id",linkman.getId());
+			map.put("clientId",workClientInfo.getId());
+			map.put("clientName",workClientInfo.getName());
+			map.put("linkName",linkman.getName());
+			map.put("linkMobile",linkman.getLinkMobile());
+			map.put("linkPhone",linkman.getLinkPhone());
+			map.put("str","新增客户信息成功!");
+        }catch (Exception e){
+            e.printStackTrace();
+        }
+		return map;
+    }
+
+	/**
+	 *选择合同-Ajax自动映射联系人
+	 * @param clientId
+	 * @return
+	 */
+	@ResponseBody
+	@RequestMapping(value = "getLinkManByClientId")
+    public Map<String, Object> queryWorkClientLinkMen(String clientId){
+		WorkClientLinkman linkman = workClientInfoService.queryLinkManByClientId(clientId);
+		if (linkman != null) {
+			WorkClientInfo workClientInfo = workClientInfoService.get(clientId);
+			Map<String, Object> map = new HashMap<>();
+			map.put("id", linkman.getId());
+			map.put("clientId", workClientInfo.getId());
+			map.put("clientName", workClientInfo.getName());
+			map.put("linkName", linkman.getName());
+			map.put("linkMobile", linkman.getLinkMobile());
+			map.put("linkPhone", linkman.getLinkPhone());
+			return map;
+		}
+		return null;
+	}
+}

+ 957 - 0
src/main/webapp/webpage/modules/ruralprojectrecords/cost/ruralCostProjectRecordsForm.jsp

@@ -0,0 +1,957 @@
+<%@ page contentType="text/html;charset=UTF-8" %>
+<%@ include file="/webpage/include/taglib.jsp"%>
+<html>
+<head>
+    <title>项目管理</title>
+    <meta name="decorator" content="default"/>
+    <script type="text/javascript" src="${ctxStatic}/helloweba_editable-select/jquery.editable-select.min.js"></script>
+    <script type="text/javascript" src="${ctxStatic}/iCheck/icheck.min.js"></script>
+    <link rel='stylesheet' type="text/css" href="${ctxStatic}/helloweba_editable-select/jquery.editable-select.min.css"/>
+    <style>
+        #projectDesc-error{
+            left:0;
+            top:82px;
+        }
+        .layui-layer-dialog{
+            background: red;
+        }
+        td input{
+            margin-left:-10px !important;
+            height: 42px !important;
+        }
+    </style>
+    <script type="text/javascript">
+        var validateForm;
+        var isMasterClient = true;//是否是主委托方
+        var clientCount = 0;
+        function doSubmit(i){//回调函数,在编辑和保存动作时,供openDialog调用提交表单。
+            if(validateForm.form()){
+                // if($(".trIdAdds").length==0){
+                //     top.layer.alert('请至少上传一个项目计划表或者实施方案文档!', {icon: 0});
+                //     return;
+                // }
+                if($("#workClientLinkmanList tr").length==0){
+                    top.layer.alert('请至少选择一个委托方联系人!', {icon: 0});
+                    return;
+                }
+                /*if($("#workConstructionLinkmanList tr").length==0){
+                    top.layer.alert('请至少选择一个施工方联系人!', {icon: 0});
+                    return;
+                }*/
+                if(i==2){
+                    $("#inputForm").attr("action","${ctx}/ruralProject/ruralProjectRecords/tstore");
+                }
+                $("#inputForm").submit();
+                return true;
+            }
+
+            return false;
+        }
+        $(document).ready(function() {
+            var radioVal ;
+            validateForm = $("#inputForm").validate({
+                submitHandler: function(form){
+                    loading('正在提交,请稍等...');
+                    form.submit();
+                },
+                errorContainer: "#messageBox",
+                errorPlacement: function(error, element) {
+                    $("#messageBox").text("输入有误,请先更正。");
+                    if (element.is(":checkbox")||element.is(":radio")||element.parent().is(".input-append")){
+                        error.appendTo(element.parent().parent());
+                    } else {
+                        error.insertAfter(element);
+                    }
+                }
+            });
+
+            $("input[name='ext']").on('ifChecked',function(event){
+                radioVal = $(this).val();
+                if(radioVal == 0){
+                    //有合同状态
+                    $("#divv2 input").val("");
+                    // $("#workClientLinkmanList tr").remove();
+                    $("#divv").show();
+                    $("#divv3").show();
+                }else{
+                    $("#divv input").val('');
+                    $("#divv2 input").val("");
+                    $("#divv3 input").val("");
+                    // $("#workClientLinkmanList tr").remove();
+                    $("#divv").hide();
+                    $("#divv3").hide();
+                    $("#linkmanId").val("");
+                }
+            });
+
+            //自动选择合同状态
+            if ($("#projectName").val() != null) {
+                if ($("#contractName").val() == "") {
+                    $("#ext1").iCheck("check");
+                }
+            }
+
+
+            $('#areaId').on("change", function () {
+                var areaId = $("#areaId").val();
+                $("#province").val('');
+                $("#city").val('');
+                $("#county").val('');
+                $.ajax({
+                    type : "POST",
+                    url : "${ctx}/sys/area/getParent",
+                    data : {'areaId':areaId},
+                    //请求成功
+                    success : function(result) {
+                        var pro = result.province;
+                        var city = result.city;
+                        var county  = result.county;
+                        if(pro != '') {
+                            $("#province").val(pro);
+                        }
+                        if(city != '') {
+                            $("#city").val(city);
+                        }
+                        if(county != '') {
+                            $("#county").val(county);
+                        }
+                    },
+
+                });
+            })
+
+        });
+
+
+        function setContractValue(obj){
+            var clientId = $("#contractClientId").val();
+            $.ajax({
+                type:'post',
+                url:'${ctx}/ruralProject/ruralCostProjectRecords/getContractInfo',
+                data:{
+                    "id":obj
+                },
+                success:function(data){
+                    $("#contractName").val(data.name);
+                    $("#contractPrice").val(data.contractPrice);
+                    formatNum($("#contractPrice"));
+                    $("#contractClientName").val(data.client.name);
+                    $("#contractClientId").val(data.client.id);
+                    $("#constructionProjectType").val(data.constructionProjectTypeStr);
+                    $("#linkmanId").val(data.workClinetInfoIds);
+                    //清理之前的联系人
+                    var newClientId  = data.client.id;
+                    if(clientId != newClientId){
+                        $("#workClientLinkmanList tr").remove();
+                        if(isMasterClient){
+                            clientCount++;
+                            setLinkMan(newClientId);
+                            isMasterClient = false;
+                        }
+                    }
+                    // console.log("clientId------newClientId");
+                    // console.log(clientId+"------"+newClientId);
+                }
+            });
+        }
+
+        function getFee() {
+            $("#unitFees").val('');
+            var totalFee = $("#totalFees").val();
+            var count = $("#buildingScale").val();
+            if(count != '' && totalFee != '') {
+                var cFee = Math.round(parseInt(totalFee) / parseInt(count) * 100) / 100 * 10000;
+                $("#unitFees").val(cFee);
+            }
+        }
+
+        function getBudlingFees() {
+            $("#buildingPercent").val('');
+            $("#buildingUnitFees").val('');
+            var totalFee = $("#totalFees").val();
+            var budFee = $("#buildingFees").val();
+            var count = $("#buildingScale").val();
+            if(totalFee != '') {
+                var p = Math.round(parseInt(budFee) / parseInt(totalFee) * 100 * 100) / 100;
+            }
+            if(count != '') {
+                var pp = Math.round(parseInt(budFee) / parseInt(count) * 100) / 100 * 10000;
+            }
+            $("#buildingPercent").val(p);
+            $("#buildingUnitFees").val(pp);
+        }
+
+        function getInstallFees() {
+            $("#installPercent").val('');
+            $("#installUnitFees").val('');
+            var totalFee = $("#totalFees").val();
+            var budFee = $("#installFees").val();
+            var count = $("#buildingScale").val();
+            if(totalFee != '') {
+                var p = Math.round(parseInt(budFee) / parseInt(totalFee) * 100 * 100) / 100;
+            }
+            if(count != '') {
+                var pp = Math.round(parseInt(budFee) / parseInt(count) * 100) / 100 * 10000;
+            }
+            $("#installPercent").val(p);
+            $("#installUnitFees").val(pp);
+        }
+
+        function setLinkMan(newClientId) {
+            $.ajax({
+                url:"${ctx}/ruralProject/ruralCostProjectRecords/getLinkManByClientId",
+                data:{"clientId":newClientId},
+                type:"post",
+                dataType:"json",
+                success:function (d) {
+                    // console.log(d);
+                    addRow('#workClientLinkmanList', workClientLinkmanRowIdx, workClientLinkmanTpl);workClientLinkmanRowIdx = workClientLinkmanRowIdx + 1;
+                    var row = workClientLinkmanRowIdx - 1 ;
+                    $("#workClientLinkmanList"+row+"_id").val(d.id);
+                    $("#workClientLinkmanList"+row+"_clientId_id").val(d.clientId);
+                    $("#workClientLinkmanList"+row+"_clientName").val(d.clientName);
+                    $("#workClientLinkmanList"+row+"_name").val(d.linkName);
+                    $("#workClientLinkmanList"+row+"_linkMobile").val(d.linkMobile);
+                    $("#workClientLinkmanList"+row+"_linkPhone").val(d.linkPhone);
+                    $("#workClientLinkmanList"+row+"_clientName").prop("readonly","readonly");
+                    $("#workClientLinkmanList"+row+"_name").prop("readonly","readonly");
+                    $("#workClientLinkmanList"+row+"_linkMobile").prop("readonly","readonly");
+                    $("#workClientLinkmanList"+row+"_linkPhone").prop("readonly","readonly");
+                }
+            });
+        }
+        function setValuee(obj){
+            var successRows = 0;
+            ss = $("#workClientLinkmanList tr").length;
+            for (var i = 0; i < obj.length; i++) {
+                //没有重复的客户id,就可以插入
+                var canInsert = true;
+                for (var j = 0; j < ss; j++) {
+                    var cid = $("#workClientLinkmanList" + j + "_id").val();
+                    if(cid == obj[i].id){
+                        canInsert = false;
+                        // console.log("重复!!");
+                        break;
+                    }
+                }
+                if(canInsert==true){
+                    var idArr = $("#workClientLinkmanList tr:visible .clientId");
+                    if (obj[i].id != '' && !hasInArr(obj[i].id, idArr)) {
+                        addRow("#workClientLinkmanList", workClientLinkmanRowIdx, workClientLinkmanTpl, obj[i]);
+                        workClientLinkmanRowIdx = workClientLinkmanRowIdx + 1;
+                        successRows++;
+                    }
+                }
+            }
+            clientCount=successRows+clientCount;
+
+            //如果主委托方还没有设置,则将第一个客户设置为主委托方
+            if(obj[0].name != null){
+                if(isMasterClient){
+                    $("#contractClientName").val(obj[0].clientId.name);
+                    isMasterClient = false;
+                }
+            }
+        }
+        function hasInArr(id,idArr) {
+            for(var i=0;i<idArr.length;i++){
+                if(id==$(idArr[i]).val()){
+                    return true;
+                }
+            }
+            return false;
+        }
+        function existLinkman(id,length) {
+            for (var i=0;i<length;i++) {
+                var val = $('#workClientLinkmanList'+i+'_id').val();
+                if(id==val){
+                    return true;
+                }
+            }
+            return false;
+        }
+
+        function setClientInfo(obj) {
+            for(var i=0;i<obj.length;i++){
+                var idArr = $("#workConstructionLinkmanList tr:visible .linkmanId");
+                if(obj[i].id!=''&&!hasInArr(obj[i].id,idArr)){
+                    addRow("#workConstructionLinkmanList",workConstructionLinkmanRowIdx,workConstructionLinkmanTpl,obj[i]);
+                    workConstructionLinkmanRowIdx=workConstructionLinkmanRowIdx+1;
+                }
+            }
+        }
+        function existConstructionLinkman(obj,length) {
+            for (var i=0;i<length;i++) {
+                var val = $('#workConstructionLinkmanList'+i+'_id').val();
+                var cid = $('#workConstructionLinkmanList'+i+'_cid').val();
+                if(obj.id==val&&obj.client.id==cid){
+                    return true;
+                }
+            }
+            return false;
+        }
+
+        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 = "82";
+                /*console.log(file);*/
+                var timestamp=new Date().getTime();
+
+                var storeAs = "attachment-file/projectRecords/"+timestamp+"/"+file['name'];
+                var uploadPath="http://gangwan-app.oss-cn-hangzhou.aliyuncs.com/"+storeAs;/*将这段字符串存到数据库即可*/
+                var divId = "_attachment";
+                $("#addFile"+divId).show();
+                multipartUploadWithSts(storeAs, file,attachmentId,attachmentFlag,uploadPath,divId,0);}
+        }
+
+
+        function addFile() {
+            $("#attachment_file").click();
+        }
+
+        function addRow(list, idx, tpl, row){
+            // var idx1 = $("#workClientLinkmanList tr").length;
+            bornTemplete(list, idx, tpl, row, idx);
+        }
+
+        function bornTemplete(list, idx, tpl, row, idx1){
+            $(list).append(Mustache.render(tpl, {
+                idx: idx, delBtn: true, row: row,
+                order:idx1 + 1
+            }));
+            $(list+idx).find("select").each(function(){
+                $(this).val($(this).attr("data-value"));
+            });
+            $(list+idx).find("input[type='checkbox'], input[type='radio']").each(function(){
+                var ss = $(this).attr("data-value").split(',');
+                for (var i=0; i<ss.length; i++){
+                    if($(this).val() == ss[i]){
+                        $(this).attr("checked","checked");
+                    }
+                }
+            });
+        }
+
+        function delRow(obj, prefix){
+            var id = $(prefix+"_id");
+            var delFlag = $(prefix+"_delFlag");
+            $(obj).parent().parent().remove();
+        }
+        function formatNum(obj) {
+            var val = $(obj).val();
+            if(val==null||val==''|| isNaN(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 openBill2(title,url,width,height,target,formId){
+            var frameIndex = parent.layer.getFrameIndex(window.name);
+            var urls = url+"&index="+frameIndex;
+            if(navigator.userAgent.match(/(iPhone|iPod|Android|ios)/i)){//如果是移动端,就使用自适应大小弹窗
+                width='auto';
+                height='auto';
+            }else{//如果是PC端,根据用户设置的width和height显示。
+
+            }
+            top.layer.open({
+                type: 2,
+                area: [width, height],
+                title: title,
+                skin:"two-btns",
+                maxmin: false, //开启最大化最小化按钮
+                content: urls ,
+                btn: ['确定','关闭'],
+                yes: function(index, layero){
+                    var body = top.layer.getChildFrame('body', index);
+                    var iframeWin = layero.find('iframe')[0]; //得到iframe页的窗口对象,执行iframe页的方法:iframeWin.method();
+                    var inputForm = body.find('#inputForm');
+                    var top_iframe;
+                    if(target){
+                        top_iframe = target;//如果指定了iframe,则在改frame中跳转
+                    }else{
+                        top_iframe = top.getActiveTab().attr("name");//获取当前active的tab的iframe
+                    }
+                    inputForm.attr("target",top_iframe);//表单提交成功后,从服务器返回的url在当前tab中展示
+                    inputForm.attr("action","${ctx}/ruralProject/ruralCostProjectRecords/linkManSave");//表单提交成功后,从服务器返回的url在当前tab中展示
+                    var $document = iframeWin.contentWindow.document;
+
+                    formSubmit2($document,formId,index);
+
+                },
+                cancel: function(index){
+                }
+            });
+
+
+        }
+
+        function formSubmit2($document,inputForm,index){
+            var validateForm = $($document.getElementById(inputForm)).validate({
+                submitHandler: function(form){
+                    loading('正在提交,请稍等...');
+                    form.submit();
+                },
+                errorContainer: "#messageBox",
+                errorPlacement: function(error, element) {
+                    $($document.getElementById("#messageBox")).text("输入有误,请先更正。");
+                    if (element.is(":checkbox")||element.is(":radio")||element.parent().is(".input-append")){
+                        error.appendTo(element.parent().parent());
+                    } else {
+                        error.insertAfter(element);
+                    }
+                }
+            });
+            if(validateForm.form()){
+                $($document.getElementById(inputForm)).ajaxSubmit({
+                    success:function(data) {
+                        var d = data;
+                        if(d.msg == "false"){
+                            parent.layer.msg("保存客户信息异常!",{icon:2});
+                            return false;
+                        }
+
+                        addRow('#workClientLinkmanList', workClientLinkmanRowIdx, workClientLinkmanTpl);workClientLinkmanRowIdx = workClientLinkmanRowIdx + 1;
+                        var row = workClientLinkmanRowIdx - 1 ;
+
+                        $("#"+"workClientLinkmanList"+row+"_id").val(d.id);
+                        $("#"+"workClientLinkmanList"+row+"_clientId_id").val(d.clientId);
+                        $("#"+"workClientLinkmanList"+row+"_clientName").val(d.clientName);
+                        $("#"+"workClientLinkmanList"+row+"_name").val(d.linkName);
+                        $("#"+"workClientLinkmanList"+row+"_linkMobile").val(d.linkMobile);
+                        $("#"+"workClientLinkmanList"+row+"_linkPhone").val(d.linkPhone);
+                        if(isMasterClient){
+                            $("#contractClientName").val(d.clientName);
+                            isMasterClient = false;
+                        }
+                        parent.layer.msg(d.str,{icon:1});
+                        top.layer.close(index)
+                    }
+                });
+            }
+        }
+    </script>
+</head>
+<body>
+<div class="single-form">
+    <div class="container">
+        <sys:message content="${message}"/>
+        <form:form id="inputForm" modelAttribute="ruralProjectRecords" action="${ctx}/ruralProject/ruralCostProjectRecords/save" method="post" class="form-horizontal">
+            <form:hidden path="id"/>
+            <form:hidden path="workContractInfo.client.id" id="contractClientId" value="${workContractInfo.client.id}"/>
+
+            <div class="form-group layui-row first">
+                <div class="form-group layui-row">
+                    <div class="form-group-label"><h2>项目合同信息</h2></div>
+                    <div class="layui-item layui-col-sm6 lw7">
+                        <label class="layui-form-label">合同情况:</label>
+                        <div class="layui-input-block">
+                            <input type="radio" class="i-checks" name="ext" checked id="ext" value="0">
+                            <label for="ext">有合同</label>
+                            <input type="radio" class="i-checks" name="ext" id="ext1" value="1">
+                            <label for="ext1">无合同</label>
+                        </div>
+                    </div>
+                </div>
+               <div class="form-group layui-row">
+                   <div id="divv">
+                       <div class="layui-item layui-col-sm12 lw7" id="d1">
+                           <label class="layui-form-label"><span class="require-item">*</span>选择合同:</label>
+                           <div class="layui-input-block  with-icon">
+                               <sys:gridselectContract url="${ctx}/ruralProject/ruralCostProjectRecords/selectcontract" type="" isTotal="" id="contractId" name="workContractInfo.id"  value="${projectRecords.workContractInfo.id}"  title="选择合同" labelName="workContractInfo.name"
+                                                       labelValue="${ruralrojectRecords.workContractInfo.name}" cssClass="form-control required layui-input" fieldLabels="合同名称" fieldKeys="name" searchLabel="合同名称" searchKey="name" ></sys:gridselectContract>
+                           </div>
+                       </div>
+                       <div class="layui-item layui-col-sm6 lw7">
+                           <label class="layui-form-label">合同名称:</label>
+                           <div class="layui-input-block">
+                               <input  htmlEscape="false"  readonly="true" id="contractName"  class="form-control layui-input" value="${ruralProjectRecords.workContractInfo.name}"/>
+                           </div>
+                       </div>
+                       <div class="layui-item layui-col-sm6 lw7">
+                           <label class="layui-form-label double-line">合同金额(元):</label>
+                           <div class="layui-input-block">
+                               <input htmlEscape="false"  readonly="true" id="contractPrice"  class="form-control layui-input" value="${ruralProjectRecords.workContractInfo.contractPrice}" onchange="formatNum(this);"/>
+                           </div>
+                       </div>
+                   </div>
+                   <div id="divv2">
+                       <div class="layui-item layui-col-sm6 lw7">
+                           <label class="layui-form-label">主委托方:</label>
+                           <div class="layui-input-block">
+                               <input htmlEscape="false"  readonly="true" id="contractClientName" name="workContractInfo.client.name" class="form-control layui-input" value="${ruralProjectRecords.workContractInfo.client.name}"/>
+                           </div>
+                       </div>
+                   </div>
+                   <div id="divv3">
+                       <div class="layui-item layui-col-sm6 lw7">
+                           <label class="layui-form-label">工程分类:</label>
+                           <div class="layui-input-block">
+                               <input htmlEscape="false"  readonly="true" id="constructionProjectType"  class="form-control layui-input" value="${ruralProjectRecords.workContractInfo.constructionProjectTypeStr}"/>
+                           </div>
+                       </div>
+                   </div>
+               </div>
+            </div>
+
+            <div class="form-group layui-row">
+                <div class="form-group-label"><h2>项目基础信息</h2></div>
+                <div class="layui-item layui-col-sm6 lw7">
+                    <label class="layui-form-label"><span class="require-item">*</span>项目名称:</label>
+                    <div class="layui-input-block">
+                        <form:input path="projectName" htmlEscape="false"  class="form-control layui-input required"/>
+                    </div>
+                </div>
+                <div class="layui-item layui-col-sm6 lw7">
+                    <label class="layui-form-label">项目编号:</label>
+                    <div class="layui-input-block">
+                        <div class="input-group">
+                            <form:input path="projectId" htmlEscape="false"  readonly="true" class="form-control layui-input"/>
+                            <span class="input-group-btn">
+                                <label class="form-status"><c:choose><c:when test="${not empty ruralProjectRecords.projectStatus}">${fns:getDictLabel(ruralProjectRecords.projectStatus, 'audit_state', '')}</c:when><c:otherwise>新添</c:otherwise></c:choose></label>
+                             </span>
+                        </div>
+                    </div>
+                </div>
+                <%--<div class="layui-item layui-col-sm6 lw7">--%>
+                    <%--<label class="layui-form-label">规模类型:</label>--%>
+                    <%--<div class="layui-input-block">--%>
+                        <%--<form:select path="scaleType" class="form-control editable-select layui-input" id="scaleType" value="${scaleType}">--%>
+                            <%--<form:option value=""/>--%>
+                            <%--<form:options items="${fns:getMainDictList('scale_type')}" itemLabel="label" itemValue="label" htmlEscape="false"/>--%>
+                        <%--</form:select>--%>
+                    <%--</div>--%>
+                <%--</div>--%>
+                <%--<div class="layui-item layui-col-sm6 lw7">--%>
+                    <%--<label class="layui-form-label">规模单位:</label>--%>
+                    <%--<div class="layui-input-block">--%>
+                        <%--<form:select path="scaleUnit" class="form-control editable-select layui-input" id="scaleUnit" value="${scaleUnit}">--%>
+                            <%--<form:option value=""/>--%>
+                            <%--<form:options items="${fns:getMainDictList('scale_unit')}" itemLabel="label" itemValue="label" htmlEscape="false"/>--%>
+                        <%--</form:select>--%>
+                    <%--</div>--%>
+                <%--</div>--%>
+                <%--<div class="layui-item layui-col-sm6 lw7">--%>
+                    <%--<label class="layui-form-label">规模数量:</label>--%>
+                    <%--<div class="layui-input-block">--%>
+                        <%--<form:input path="scaleQuantity" htmlEscape="false"  class="form-control number layui-input"/>--%>
+                    <%--</div>--%>
+                <%--</div>--%>
+                <div class="layui-item layui-col-sm6 lw7">
+                    <label class="layui-form-label"><span class="require-item">*</span>项目所在地:</label>
+                    <div class="layui-input-block  with-icon">
+                        <sys:treeselect id="area" name="area.id" value="${ruralProjectRecords.area.id}" labelName="area.name" labelValue="${ruralProjectRecords.area.name}"
+                                        title="区域" url="/sys/area/treeData" cssClass="form-control layui-input" allowClear="true" notAllowSelectParent="false"/>
+                    </div>
+                </div>
+                <div class="layui-item layui-col-sm6 lw7">
+                    <label class="layui-form-label">所在省份:</label>
+                    <div class="layui-input-block">
+                        <form:input path="province" htmlEscape="false" id="province" class="form-control layui-input" readonly="true"/>
+                    </div>
+                </div>
+                <div class="layui-item layui-col-sm6 lw7">
+                    <label class="layui-form-label">所在地级市:</label>
+                    <div class="layui-input-block">
+                        <form:input path="city" htmlEscape="false" id="city" class="form-control layui-input" readonly="true"/>
+                    </div>
+                </div>
+                <div class="layui-item layui-col-sm6 lw7">
+                    <label class="layui-form-label">所在区县:</label>
+                    <div class="layui-input-block">
+                        <form:input path="county" htmlEscape="false" id="county" class="form-control layui-input" readonly="true"/>
+                    </div>
+                </div>
+                <div class="layui-item layui-col-sm6 lw7">
+                    <label class="layui-form-label">建设地点:</label>
+                    <div class="layui-input-block">
+                        <form:input path="projectSite" htmlEscape="false"  class="form-control layui-input"/>
+                    </div>
+                </div>
+                <div class="layui-item layui-col-sm6 lw7">
+                    <label class="layui-form-label"><span class="require-item">*</span>项目负责人:</label>
+                    <div class="layui-input-block  with-icon">
+                        <sys:treeselectt id="master" name="projectLeaders" value="${ruralProjectRecords.leaderIds}" labelName="leaderNameStr" labelValue="${ruralProjectRecords.leaderNameStr}"
+                                         title="用户" url="/sys/office/treeDataAll?type=3" checked="true" cssClass="form-control required layui-input" allowClear="true" notAllowSelectParent="true"/>
+                    </div>
+                </div>
+                <div class="layui-item layui-col-sm6 lw7">
+                    <label class="layui-form-label">创建人:</label>
+                    <div class="layui-input-block">
+                        <form:input path="createBy.name" htmlEscape="false"  readonly="true"  class="form-control  layui-input"/>
+                        <form:hidden path="createBy.id" htmlEscape="false"   readonly="true"  class="form-control  layui-input"/>
+                    </div>
+                </div>
+                <div class="layui-item layui-col-sm6 lw7">
+                    <label class="layui-form-label">创建日期:</label>
+                    <div class="layui-input-block">
+                        <input id="createDate" name="createDate" htmlEscape="false"  value="<fmt:formatDate value="${ruralProjectRecords.createDate}" pattern="yyyy-MM-dd"/>" readonly="readonly"  class="form-control required layui-input"/>
+                    </div>
+                </div>
+                <div class="layui-item layui-col-sm6 lw7">
+                    <label class="layui-form-label">工程结构:</label>
+                    <div class="layui-input-block">
+                        <form:select path="projectStructure" class="form-control editable-select layui-input" id="projectStructure" value="${projectStructure}">
+                            <form:option value=""/>
+                            <form:options items="${fns:getMainDictList('project_structure')}" itemLabel="label" itemValue="label" htmlEscape="false"/>
+                        </form:select>
+                    </div>
+                </div>
+                <div class="layui-item layui-col-sm6 lw7">
+                    <label class="layui-form-label">地上层数:</label>
+                    <div class="layui-input-block">
+                        <form:input path="onGroundNum" htmlEscape="false"  class="form-control layui-input number"/>
+                    </div>
+                </div>
+                <div class="layui-item layui-col-sm6 lw7">
+                    <label class="layui-form-label">底下层数:</label>
+                    <div class="layui-input-block">
+                        <form:input path="underGroundNum" htmlEscape="false"  class="form-control layui-input number"/>
+                    </div>
+                </div>
+                <div class="layui-item layui-col-sm6 lw7">
+                    <label class="layui-form-label double-line"><span class="require-item">*</span>建筑面积或规模:</label>
+                    <div class="layui-input-block">
+                        <form:input path="buildingScale" htmlEscape="false"  class="form-control layui-input required number" onchange="getFee()"/>
+                    </div>
+                </div>
+                <div class="layui-item layui-col-sm6 lw7">
+                    <label class="layui-form-label">计量单位:</label>
+                    <div class="layui-input-block">
+                        <form:select path="measuringUnit" class="form-control editable-select layui-input" id="measuringUnit" value="${measuringUnit}">
+                            <form:option value=""/>
+                            <form:options items="${fns:getMainDictList('scale_unit')}" itemLabel="label" itemValue="label" htmlEscape="false"/>
+                        </form:select>
+                    </div>
+                </div>
+                <div class="layui-item layui-col-sm6 lw7">
+                    <label class="layui-form-label">工程用途:</label>
+                    <div class="layui-input-block">
+                        <form:select path="projectUse" class="form-control editable-select layui-input" id="projectUse" value="${projectUse}">
+                            <form:option value=""/>
+                            <form:options items="${fns:getMainDictList('project_use')}" itemLabel="label" itemValue="label" htmlEscape="false"/>
+                        </form:select>
+                    </div>
+                </div>
+                <div class="layui-item layui-col-sm6 lw7">
+                    <label class="layui-form-label double-line"><span class="require-item">*</span>咨询标的额(万元):</label>
+                    <div class="layui-input-block">
+                        <form:input path="totalFees" htmlEscape="false" id="totalFees" class="form-control layui-input required number" onchange="getFee()"/>
+                    </div>
+                </div>
+                <div class="layui-item layui-col-sm6 lw7">
+                    <label class="layui-form-label double-line">其中土建造价(万元):</label>
+                    <div class="layui-input-block">
+                        <form:input path="buildingFees" htmlEscape="false" id="buildingFees" class="form-control layui-input" onchange="getBudlingFees()"/>
+                    </div>
+                </div>
+                <div class="layui-item layui-col-sm6 lw7">
+                    <label class="layui-form-label double-line">其中安装造价(万元):</label>
+                    <div class="layui-input-block">
+                        <form:input path="installFees" htmlEscape="false" id="installFees" class="form-control layui-input" onchange="getInstallFees()"/>
+                    </div>
+                </div>
+                <div class="layui-item layui-col-sm6 lw7">
+                    <label class="layui-form-label double-line">其中土建百分比(%):</label>
+                    <div class="layui-input-block">
+                        <form:input path="buildingPercent" htmlEscape="false" id="buildingPercent" class="form-control layui-input" readonly="true"/>
+                    </div>
+                </div>
+                <div class="layui-item layui-col-sm6 lw7">
+                    <label class="layui-form-label double-line">其中安装百分比(%):</label>
+                    <div class="layui-input-block">
+                        <form:input path="installPercent" htmlEscape="false" id="installPercent" class="form-control layui-input" readonly="true"/>
+                    </div>
+                </div>
+                <div class="layui-item layui-col-sm6 lw7">
+                    <label class="layui-form-label">单位造价(元):</label>
+                    <div class="layui-input-block">
+                        <form:input path="unitFees" htmlEscape="false" id="unitFees" class="form-control layui-input" readonly="true"/>
+                    </div>
+                </div>
+                <div class="layui-item layui-col-sm6 lw7">
+                    <label class="layui-form-label double-line">土建单位造价(元):</label>
+                    <div class="layui-input-block">
+                        <form:input path="buildingUnitFees" htmlEscape="false" id="buildingUnitFees" class="form-control layui-input" readonly="true"/>
+                    </div>
+                </div>
+                <div class="layui-item layui-col-sm6 lw7">
+                    <label class="layui-form-label double-line">安装单位造价(元):</label>
+                    <div class="layui-input-block">
+                        <form:input path="installUnitFees" htmlEscape="false" id="installUnitFees" class="form-control layui-input" readonly="true"/>
+                    </div>
+                </div>
+                <div class="layui-item layui-col-sm6 lw7 with-textarea">
+                    <label class="layui-form-label"><span class="require-item">*</span>工程概况:</label>
+                    <div class="layui-input-block">
+                        <form:textarea path="projectDesc" htmlEscape="false" rows="4"  maxlength="255"  class="form-control required"/>
+                    </div>
+                </div>
+                <div class="layui-item layui-col-sm6 lw7 with-textarea">
+                    <label class="layui-form-label ">特殊要求:</label>
+                    <div class="layui-input-block">
+                        <form:textarea path="remarks" htmlEscape="false" rows="4"  maxlength="255"  class="form-control "/>
+                    </div>
+                </div>
+            </div>
+
+
+            <div>
+                <div class="form-group-label"><h2><span class="require-item">*</span>委托方联系人信息</h2></div>
+                <div class="layui-item nav-btns" style="float: left;width: 155px">
+                    <sys:gridselect1  id="linkman" url="${ctx}/workclientinfo/workClientInfo/linkmanList"
+                                      name="linkman.id"  title="选择客户"
+                                      value="${ruralProjectRecords.workContractInfo.workClinetInfoIds}"
+                                      cssClass="form-control required" fieldLabels="联系人" fieldKeys="name"
+                                      searchLabel="联系人" searchKey="name"></sys:gridselect1>
+                </div>
+                <div class="layui-item nav-btns" style="float: left;">
+                    <a href="javascript:void(0)"
+                       onclick="openBill2('新增客户管理', '${ctx}/workclientinfo/workClientInfo/form?param=2','95%','95%',false,'inputForm')"
+                       class="nav-btn nav-btn-add"><i class="fa fa-plus"></i> 新增客户</a>
+                </div>
+
+                <div class="layui-item layui-col-xs12 form-table-container" style="padding:0px">
+                    <table id="contentTable1" class="table table-bordered table-condensed details">
+                        <thead>
+                        <tr>
+                            <th class="hide"></th>
+                            <th width="20%"><font color="red">*</font>委托方</th>
+                            <th width="20%">联系人姓名</th>
+                            <th width="20%">联系方式1</th>
+                            <th width="20%">联系方式2</th>
+                            <th width="20%">操作</th>
+                        </tr>
+                        </thead>
+                        <tbody id="workClientLinkmanList">
+                        </tbody>
+                    </table>
+                    <script type="text/template" id="workClientLinkmanTpl">//<!--
+            <tr id="workClientLinkmanList{{idx}}">
+                <td class="hide">
+                    <input id="workClientLinkmanList{{idx}}_id" name="workClientLinkmanList[{{idx}}].id" type="hidden" value="{{row.id}}"/>
+                    <input id="workClientLinkmanList{{idx}}_clientId_id" name="workClientLinkmanList[{{idx}}].clientId.id" type="hidden" value="{{row.clientId.id}}"/>
+                    <input id="workClientLinkmanList{{idx}}_delFlag" name="workClientLinkmanList[{{idx}}].delFlag" type="hidden" value="0"/>
+                </td>
+                <td>
+                    <input readonly="true" id="workClientLinkmanList{{idx}}_clientName" name="workClientLinkmanList[{{idx}}].clientId.name" type="text" value="{{row.clientId.name}}"    class="form-control "/>
+                </td>
+                <td>
+                    <input readonly="true" id="workClientLinkmanList{{idx}}_name" name="workClientLinkmanList[{{idx}}].name" type="text" value="{{row.name}}"    class="form-control required"/>
+                </td>
+
+                <td>
+                    <input readonly="true" id="workClientLinkmanList{{idx}}_linkPhone" name="workClientLinkmanList[{{idx}}].linkPhone" type="text" value="{{row.linkPhone}}"    class="form-control isTel"/>
+                </td>
+                <td>
+                    <input readonly="true" id="workClientLinkmanList{{idx}}_linkMobile" name="workClientLinkmanList[{{idx}}].linkMobile" type="text" value="{{row.linkMobile}}"    class="form-control isPhone"/>
+                </td>
+                <td class="text-center op-td" >
+                    {{#delBtn}}<span class="op-btn op-btn-delete" onclick="delRow(this, '#workClientLinkmanList{{idx}}')" title="删除"><i class="glyphicon glyphicon-remove"></i>&nbsp;删除</span>{{/delBtn}}
+                </td>
+            </tr>//-->
+                    </script>
+                    <script type="text/javascript">
+                        var workClientLinkmanRowIdx = 0,
+                            workClientLinkmanTpl = $("#workClientLinkmanTpl").html().replace(/(\/\/\<!\-\-)|(\/\/\-\->)/g, "");
+                        $(document).ready(function () {
+                            var data = ${fns:toJson(workClientInfo.workClientLinkmanList)};
+                            if(data!=null && data.length() > 0){
+                                for (var i = 0; i < data.length; i++) {
+                                    addRow('#workClientLinkmanList', workClientLinkmanRowIdx, workClientLinkmanTpl, data[i]);
+                                    workClientLinkmanRowIdx = workClientLinkmanRowIdx + 1;
+                                }
+                            }
+                        });
+                    </script>
+                </div>
+            </div>
+
+            <div class="form-group layui-row">
+                <div class="form-group-label"><h2>施工方信息</h2></div>
+                <div class="layui-item nav-btns">
+                    <sys:gridselectClientLink url="${ctx}/workclientinfo/workClientInfo/clientInfolist" id="constructionOrgList"   title="选择施工单位"
+                                              cssClass="form-control required" fieldLabels="${fns:urlEncode('客户编号')}" fieldKeys="name"  searchLabel="${fns:urlEncode('客户名称')}" searchKey="name"></sys:gridselectClientLink>
+                </div>
+                <div class="layui-item layui-col-xs12 form-table-container">
+                    <table id="contentTable2" class="table table-bordered table-condensed details">
+                        <thead>
+                        <tr>
+                            <th class="hide"></th>
+                            <th style="text-align: center" width="20%">施工方单位名称</th>
+                            <th style="text-align: center" width="20%">联系人姓名</th>
+                            <th style="text-align: center" width="20%">联系方式1</th>
+                            <th style="text-align: center" width="20%">联系方式2</th>
+                            <th width="20%">操作</th>
+                        </tr>
+                        </thead>
+                        <tbody id="workConstructionLinkmanList">
+                        </tbody>
+                    </table>
+                    <script type="text/template" id="workConstructionLinkmanTpl">//<!--
+					<tr id="workConstructionLinkmanList{{idx}}">
+					<td class="hide">
+						<input id="workConstructionLinkmanList{{idx}}_id" name="workConstructionLinkmanList[{{idx}}].id" type="hidden" value="{{row.id}}" class="linkmanId"/>
+						<input id="workConstructionLinkmanList{{idx}}_delFlag" name="workConstructionLinkmanList[{{idx}}].delFlag" type="hidden" value="0"/>
+					</td>
+					<td style="text-align: center">
+						<input id="workConstructionLinkmanList{{idx}}_cid" name = "workConstructionLinkmanList[{{idx}}].clientId.id" type="hidden" value="{{row.clientId.id}}"/>
+						{{row.clientId.name}}
+					</td>
+					<td style="text-align: center">
+						{{row.name }}
+					</td>
+					<td style="text-align: center">
+						{{row.linkPhone}}
+					</td>
+					<td style="text-align: center">
+						{{row.linkMobile}}
+					</td>
+					<td class="text-center" width="10">
+						{{#delBtn}}<span class="op-btn op-btn-delete" onclick="delRow(this, '#workConstructionLinkmanList{{idx}}')" title="删除"><i class="fa fa-trash"></i>&nbsp;删除</span>{{/delBtn}}
+					</td>
+				</tr>//-->
+                    </script>
+                    <script>
+                        var workClientLinkmanRowIdx = 0, workClientLinkmanTpl = $("#workClientLinkmanTpl").html().replace(/(\/\/\<!\-\-)|(\/\/\-\->)/g,"");
+                        var workConstructionLinkmanRowIdx = 0, workConstructionLinkmanTpl = $("#workConstructionLinkmanTpl").html().replace(/(\/\/\<!\-\-)|(\/\/\-\->)/g,"");
+                        $(document).ready(function() {
+                            var data = ${fns:toJson(ruralProjectRecords.workClientLinkmanList)};
+                            if (data!=null) {
+                                for (var i = 0; i < data.length; i++) {
+                                    addRow('#workClientLinkmanList', workClientLinkmanRowIdx, workClientLinkmanTpl, data[i]);
+                                    workClientLinkmanRowIdx = workClientLinkmanRowIdx + 1;
+                                }
+                            }
+                            var dataBank = ${fns:toJson(ruralProjectRecords.workConstructionLinkmanList)};
+                            if (dataBank!=null) {
+                                for (var i = 0; i < dataBank.length; i++) {
+                                    addRow('#workConstructionLinkmanList', workConstructionLinkmanRowIdx, workConstructionLinkmanTpl, dataBank[i]);
+                                    workConstructionLinkmanRowIdx = workConstructionLinkmanRowIdx + 1;
+                                }
+                            }
+                        });
+
+                    </script>
+                </div>
+            </div>
+
+            <div class="form-group layui-row">
+                <div class="form-group-label"><h2><span class="require-item">*</span>项目计划附件信息</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 class="nav-btn nav-btn-export" title="下载模板"  onclick="window.location.href='${ctx}/ruralProject/ruralCostProjectRecords/downloadTemplate';"><i class="fa fa-download"></i>&nbsp;下载模板</a>
+                </div>
+                <div id="addFile_attachment" style="display: none" class="upload-progress">
+                    <span id="fileName_attachment" ></span>
+                    <b><span id="baifenbi_attachment" ></span></b>
+                    <div class="progress">
+                        <div id="jindutiao_attachment" class="progress-bar" style="width: 0%" aria-valuenow="0">
+                        </div>
+                    </div>
+                </div>
+                <input id="attachment_file" type="file" name="attachment_file" multiple="multiple" style="display: none;" onChange="if(this.value)insertTitle(this.value);"/>
+                <span id="attachment_title"></span>
+                <div class="layui-item layui-col-xs12 form-table-container">
+                    <table id="listAttachment" class="table table-bordered table-condensed details">
+                        <thead>
+                        <tr>
+                                <%-- <th>序号</th>--%>
+                            <th width="25%">文件</th>
+                            <th width="25%">上传人</th>
+                            <th width="25%">上传时间</th>
+                            <th width="150px">操作</th>
+                        </tr>
+                        </thead>
+                        <tbody id="file_attachment">
+                        <c:forEach items="${ruralProjectRecords.workAttachments}" var = "workClientAttachment" varStatus="status">
+                            <tr class="trIdAdds">
+                                    <%-- <td>${status.index + 1}</td>--%>
+                                <c:choose>
+                                    <c:when test="${fn:containsIgnoreCase(workClientAttachment.attachmentName,'jpg')
+                                                           or fn:containsIgnoreCase(workClientAttachment.attachmentName,'png')
+                                                           or fn:containsIgnoreCase(workClientAttachment.attachmentName,'gif')
+                                                           or fn:containsIgnoreCase(workClientAttachment.attachmentName,'bmp')
+                                                           or fn:containsIgnoreCase(workClientAttachment.attachmentName,'jpeg')}">
+                                        <td><img src="${workClientAttachment.url}" width="50" height="50" onclick="openDialogView('预览','${ctx}/sys/picturepreview/picturePreview?url=${workClientAttachment.url}','90%','90%')" alt="${workClientAttachment.attachmentName}">
+                                    </c:when>
+                                    <c:otherwise>
+                                        <c:choose>
+                                            <c:when test="${fn:containsIgnoreCase(workClientAttachment.attachmentName,'pdf')}">
+                                                <td><a class="attention-info" href="javascript:void(0)" onclick="preview('预览','${workClientAttachment.url}','90%','90%','1')">${workClientAttachment.attachmentName}</a></td>
+                                            </c:when>
+                                            <c:otherwise>
+                                                <td><a class="attention-info" href="javascript:void(0)" onclick="preview('预览','${workClientAttachment.url}','90%','90%')">${workClientAttachment.attachmentName}</a></td>
+                                            </c:otherwise>
+                                        </c:choose>
+                                    </c:otherwise>
+                                </c:choose>
+                                <td>${workClientAttachment.createBy.name}</td>
+                                <td><fmt:formatDate value="${workClientAttachment.createDate}" type="both"/></td>
+                                <td class="op-td">
+                                    <div class="op-btn-box" >
+                                        <a href="javascript:location.href='${ctx}/workfullmanage/workFullManage/downLoadAttach?file='+encodeURIComponent(encodeURIComponent('${workClientAttachment.url}'));" class="op-btn op-btn-download"><i class="fa fa-download"></i>&nbsp;下载</a>
+                                        <a href="javascript:void(0)" onclick="deleteFileFromAliyun(this,'${ctx}/sys/workattachment/deleteFileFromAliyun?url=${workClientAttachment.url}&id=${workClientAttachment.id}&type=2','addFile')" class="op-btn op-btn-delete" ><i class="fa fa-trash"></i>&nbsp;删除</a>
+                                    </div>
+                                </td>
+                            </tr>
+                        </c:forEach>
+                        </tbody>
+                    </table>
+                </div>
+            </div>
+
+            <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="usersListTable" class="table table-bordered table-condensed details">
+                        <thead>
+                        <tr>
+                            <th width="25%">姓名</th>
+                            <th width="25%">部门</th>
+                            <th width="25%">职级</th>
+                            <th width="80px;">状态</th>
+                        </tr>
+                        </thead>
+                        <tbody id="usersList">
+                        <c:if test="${not empty ruralProjectRecords.projectMembers}">
+                            <c:forEach items="${ruralProjectRecords.projectMembers}" var="user">
+                                <tr id="${user.id}">
+                                    <td>
+                                            ${user.name}
+                                    </td>
+                                    <td>
+                                            ${user.office.name}
+                                    </td>
+                                    <td>
+                                            ${user.basicInfo.jobGrade.name}
+                                    </td>
+                                    <td>
+                                        <c:choose>
+                                            <c:when test="${user.delFlag == 0}">
+                                                正常
+                                            </c:when>
+                                            <c:otherwise>
+                                                移除
+                                            </c:otherwise>
+                                        </c:choose>
+                                    </td>
+                                </tr>
+                            </c:forEach>
+                        </c:if>
+                        </tbody>
+                    </table>
+                </div>
+            </div>
+            <div class="form-group layui-row page-end"></div>
+        </form:form>
+    </div>
+</div>
+</body>
+</html>

+ 390 - 0
src/main/webapp/webpage/modules/ruralprojectrecords/cost/ruralCostProjectRecordsList.jsp

@@ -0,0 +1,390 @@
+<%@ 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/laydate/laydate.js"></script>--%>
+	<script type="text/javascript">
+        $(document).ready(function() {
+
+            //搜索框收放
+            $('#moresee').click(function(){
+                if($('#moresees').is(':visible'))
+                {
+                    $('#moresees').slideUp(0,resizeListWindow2);
+                    $('#moresee i').removeClass("glyphicon glyphicon-menu-up").addClass("glyphicon glyphicon-menu-down");
+                }else{
+                    $('#moresees').slideDown(0,resizeListWindow2);
+                    $('#moresee i').removeClass("glyphicon glyphicon-menu-down").addClass("glyphicon glyphicon-menu-up");
+                }
+            });
+            laydate.render({
+                elem: '#beginDate', //目标元素。由于laydate.js封装了一个轻量级的选择器引擎,因此elem还允许你传入class、tag但必须按照这种方式 '#id .class'
+                event: 'focus', //响应事件。如果没有传入event,则按照默认的click
+                type : 'date'
+            });
+            laydate.render({
+                elem: '#endDate', //目标元素。由于laydate.js封装了一个轻量级的选择器引擎,因此elem还允许你传入class、tag但必须按照这种方式 '#id .class'
+                event: 'focus', //响应事件。如果没有传入event,则按照默认的click
+                type : 'date'
+            });
+        });
+
+        function reset() {
+            $("#searchForm").resetForm();
+        }
+
+        function openDialog(title,url,width,height,target) {
+
+            if (navigator.userAgent.match(/(iPhone|iPod|Android|ios)/i)) {//如果是移动端,就使用自适应大小弹窗
+                width = 'auto';
+                height = 'auto';
+            } else {//如果是PC端,根据用户设置的width和height显示。
+
+            }
+
+            top.layer.open({
+                type: 2,
+                area: [width, height],
+                title: title,
+                maxmin: true, //开启最大化最小化按钮
+                content: url,
+                skin: 'three-btns',
+                btn: ['送审', '暂存', '关闭'],
+                btn1: function(index, layero){
+                    var body = top.layer.getChildFrame('body', index);
+                    var iframeWin = layero.find('iframe')[0]; //得到iframe页的窗口对象,执行iframe页的方法:iframeWin.method();
+                    var inputForm = body.find('#inputForm');
+                    var top_iframe;
+                    if(target){
+                        top_iframe = target;//如果指定了iframe,则在改frame中跳转
+                    }else{
+                        top_iframe = top.getActiveTab().attr("name");//获取当前active的tab的iframe
+                    }
+                    inputForm.attr("target",top_iframe);//表单提交成功后,从服务器返回的url在当前tab中展示
+                    if(iframeWin.contentWindow.doSubmit(1) ){
+                        // top.layer.close(index);//关闭对话框。
+                        setTimeout(function(){top.layer.close(index)}, 100);//延时0.1秒,对应360 7.1版本bug
+                    }
+                },
+                btn2:function(index,layero){
+                    var body = top.layer.getChildFrame('body', index);
+                    var iframeWin = layero.find('iframe')[0]; //得到iframe页的窗口对象,执行iframe页的方法:iframeWin.method();
+                    var inputForm = body.find('#inputForm');
+                    var top_iframe;
+                    if(target){
+                        top_iframe = target;//如果指定了iframe,则在改frame中跳转
+                    }else{
+                        top_iframe = top.getActiveTab().attr("name");//获取当前active的tab的iframe
+                    }
+                    inputForm.attr("target",top_iframe);//表单提交成功后,从服务器返回的url在当前tab中展示
+                    if(iframeWin.contentWindow.doSubmit(2) ){
+                        // top.layer.close(index);//关闭对话框。
+                        setTimeout(function(){top.layer.close(index)}, 100);//延时0.1秒,对应360 7.1版本bug
+                    }else {
+                        return false;
+                    }
+                },
+                btn3: function (index) {
+                }
+            });
+        }
+
+        function openDialogre(title,url,width,height,target,buttons) {
+
+            if (navigator.userAgent.match(/(iPhone|iPod|Android|ios)/i)) {//如果是移动端,就使用自适应大小弹窗
+                width = 'auto';
+                height = 'auto';
+            } else {//如果是PC端,根据用户设置的width和height显示。
+
+            }
+            var split = buttons.split(",");
+            top.layer.open({
+                type: 2,
+                area: [width, height],
+                title: title,
+                maxmin: true, //开启最大化最小化按钮
+                skin: 'three-btns',
+                content: url,
+                btn: split,
+                btn1: function(index, layero){
+                    var body = top.layer.getChildFrame('body', index);
+                    var iframeWin = layero.find('iframe')[0]; //得到iframe页的窗口对象,执行iframe页的方法:iframeWin.method();
+                    var inputForm = body.find('#inputForm');
+                    var top_iframe;
+                    if(target){
+                        top_iframe = target;//如果指定了iframe,则在改frame中跳转
+                    }else{
+                        top_iframe = top.getActiveTab().attr("name");//获取当前active的tab的iframe
+                    }
+                    inputForm.attr("target",top_iframe);//表单提交成功后,从服务器返回的url在当前tab中展示
+                    if(iframeWin.contentWindow.doSubmit(1) ){
+                        // top.layer.close(index);//关闭对话框。
+                        setTimeout(function(){top.layer.close(index)}, 100);//延时0.1秒,对应360 7.1版本bug
+                    }
+                },
+                btn2:function(index,layero){
+                    if(split.length==2){return}
+                    var body = top.layer.getChildFrame('body', index);
+                    var iframeWin = layero.find('iframe')[0]; //得到iframe页的窗口对象,执行iframe页的方法:iframeWin.method();
+                    var inputForm = body.find('#inputForm');
+                    var top_iframe;
+                    if(target){
+                        top_iframe = target;//如果指定了iframe,则在改frame中跳转
+                    }else{
+                        top_iframe = top.getActiveTab().attr("name");//获取当前active的tab的iframe
+                    }
+                    inputForm.attr("target",top_iframe);//表单提交成功后,从服务器返回的url在当前tab中展示
+                    if(iframeWin.contentWindow.doSubmit(2) ){
+                        // top.layer.close(index);//关闭对话框。
+                        setTimeout(function(){top.layer.close(index)}, 100);//延时0.1秒,对应360 7.1版本bug
+                    }else {
+                        return false;
+                    }
+                },
+                btn3: function (index) {
+                }
+            });
+        }
+	</script>
+	<style>
+		body{
+			background-color:transparent;
+			filter:progid:DXImageTransform.Microsoft.gradient(startColorstr=#26FFFFFF, endColorstr=#26FFFFFF);
+			color:#ffffff;
+			background-color:rgba(255,255,255,0);
+			height:100%;
+		}
+	</style>
+</head>
+<body>
+<div class="wrapper wrapper-content">
+	<sys:message content="${message}"/>
+	<div class="layui-row">
+		<div class="full-width fl">
+			<%--<div class="list-form-tab contentShadow shadowLTR" id="tabDiv">
+				<ul class="list-tabs" >
+					<li class="active"><a href="${ctx}/ruralProject/ruralProjectRecords/list">项目登记列表</a></li>
+					<li><a href="${ctx}/ruralProject/ruralProjectRecordsAlter/list">项目变更列表</a></li>
+				</ul>
+			</div>--%>
+
+		</div>
+		<div class="full-width fl">
+			<div class="layui-row contentShadow shadowLR" id="queryDiv">
+				<form:form id="searchForm" modelAttribute="ruralProjectRecords" action="${ctx}/ruralProject/ruralCostProjectRecords/" method="post" class="form-inline">
+					<input id="pageNo" name="pageNo" type="hidden" value="${page.pageNo}"/>
+					<input id="pageSize" name="pageSize" type="hidden" value="${page.pageSize}"/>
+					<table:sortColumn id="orderBy" name="orderBy" value="${page.orderBy}" callback="sortOrRefresh();"/><!-- 支持排序 -->
+					<div class="commonQuery lw6">
+						<div class="layui-item query athird">
+							<label class="layui-form-label">项目编号:</label>
+							<div class="layui-input-block with-icon">
+								<form:input path="projectId" htmlEscape="false" maxlength="64"  class=" form-control  layui-input"/>
+							</div>
+						</div>
+						<div class="layui-item query athird">
+							<label class="layui-form-label">项目名称:</label>
+							<div class="layui-input-block">
+								<form:input path="projectName" htmlEscape="false" maxlength="64"  class=" form-control  layui-input"/>
+							</div>
+						</div>
+						<div class="layui-item athird">
+							<div class="input-group">
+								<a href="#" id="moresee"><i class="glyphicon glyphicon-menu-down"></i></a>
+								<button id="searchReset" class="fixed-btn searchReset fr" onclick="resetSearch()">重置</button>
+								<button id="searchQuery" class="fixed-btn searchQuery fr" onclick="search()">查询</button>
+							</div>
+						</div>
+						<div style="    clear:both;"></div>
+					</div>
+					<div id="moresees" style="clear:both;display:none;" class="lw6">
+						<div class="layui-item query athird ">
+							<label class="layui-form-label">项目负责人:</label>
+							<div class="layui-input-block">
+								<form:input path="leaderNameStr" htmlEscape="false" maxlength="255"  class=" form-control layui-input"/>
+							</div>
+						</div>
+						<div class="layui-item query athird ">
+							<label class="layui-form-label">合同名称:</label>
+							<div class="layui-input-block">
+								<form:input path="workContractInfo.name" htmlEscape="false" maxlength="255"  class=" form-control layui-input"/>
+							</div>
+						</div>
+						<div class="layui-item query athird ">
+							<label class="layui-form-label">委托方:</label>
+							<div class="layui-input-block">
+								<form:input path="workContractInfo.client.name" htmlEscape="false" maxlength="255"  class=" form-control layui-input"/>
+							</div>
+						</div>
+						<div class="layui-item query athird ">
+							<label class="layui-form-label">创建时间:</label>
+							<div class="layui-input-block">
+								<input id="beginDate" name="beginDate" placeholder="开始时间" type="text" readonly="readonly" maxlength="20" class="laydate-icondate form-control layer-date layui-input laydate-icon query-group"
+									   value="<fmt:formatDate value="${projectRecords.beginDate}" pattern="yyyy-MM-dd"/>"/>
+								</input>
+                                <span class="group-sep">-</span>
+                                <input id="endDate" name="endDate" placeholder="结束时间" type="text" readonly="readonly" maxlength="20" class="laydate-icondate form-control layer-date layui-input laydate-icon query-group"
+                                       value="<fmt:formatDate value="${projectRecords.endDate}" pattern="yyyy-MM-dd"/>"/>
+                                </input>
+							</div>
+						</div>
+						<div class="layui-item query athird ">
+							<label class="layui-form-label">状态:</label>
+							<div class="layui-input-block">
+								<form:select path="projectStatus" class=" form-control  simple-select">
+									<form:option value="" label=""/>
+									<form:options items="${fns:getDictList('audit_state')}" itemLabel="label" itemValue="value" htmlEscape="false"/>
+								</form:select>
+							</div>
+						</div>
+						<div style="clear:both;"></div>
+					</div>
+				</form:form>
+			</div>
+		</div>
+		<div class="full-width fl">
+			<div class="layui-form contentDetails contentShadow shadowLBR">
+				<div class="nav-btns">
+					<shiro:hasPermission name="ruralProject:ruralCostProjectRecords:add">
+						<table:addRow url="${ctx}/ruralProject/ruralCostProjectRecords/form" title="项目"></table:addRow><!-- 增加按钮 -->
+					</shiro:hasPermission>
+					<shiro:hasPermission name="ruralProject:ruralCostProjectRecords:del">
+						<%--<table:delRow url="${ctx}/project/projectRecords/deleteAll" id="contentTable"></table:delRow><!-- 删除按钮 -->--%>
+					</shiro:hasPermission>
+					<shiro:hasPermission name="ruralProject:ruralCostProjectRecords:export">
+						<table:exportExcel url="${ctx}/ruralProject/ruralCostProjectRecords/export"></table:exportExcel><!-- 导出按钮 -->
+					</shiro:hasPermission>
+					<button class="nav-btn nav-btn-refresh" data-toggle="tooltip" data-placement="left" onclick="sortOrRefresh()" title="刷新"><i class="glyphicon glyphicon-repeat"></i>&nbsp;刷新</button>
+					<div style="clear: both;"></div>
+				</div>
+				<table class="oa-table layui-table" id="contentTable1"></table>
+
+				<!-- 分页代码 -->
+				<table:page page="${page}"></table:page>
+				<div style="clear: both;"></div>
+			</div>
+		</div>
+	</div>
+	<div id="changewidth"></div>
+</div>
+
+<script src="${ctxStatic}/layer-v2.3/layui/layui.all.js" charset="utf-8"></script>
+<script>
+
+    layui.use('table', function(){
+        layui.table.render({
+            limit:${ page.pageSize }
+            ,elem: '#contentTable1'
+            ,page: false
+            ,cols: [[
+                // {checkbox: true, fixed: true},
+                {field:'index',align:'center', title: '序号',width:40}
+                ,{field:'projName',align:'center', title: '项目名称',minWidth:200,templet:function(d){
+                        return "<a class=\"attention-info\" title=\"" + d.projName + "\" href=\"javascript:void(0);\" onclick=\"openDialogView('查看项目', '${ctx}/ruralProject/ruralCostProjectRecords/view?id=" + d.id +"','95%', '95%')\">" + d.projName + "</a>";
+                    }}
+                ,{field:'projId',align:'center', title: '项目编号',minWidth:150,templet:function(d){
+                        return "<a class=\"attention-info\" title=\"" + d.projId + "\" href=\"javascript:void(0);\" onclick=\"openDialogView('查看项目', '${ctx}/ruralProject/ruralCostProjectRecords/view?id=" + d.id + "','95%', '95%')\">" + d.projId + "</a>";
+                    }}
+                ,{field:'contract', align:'center',title: '合同名称',minWidth:200,templet:function(d){
+                    	return "<span title='"+ d.contract +"'>" + d.contract + "</span>";
+					}}
+                ,{field:'projMaster', align:'center',title: '负责人', width:65,templet:function(d){
+                        return "<span title=\"" + d.projMaster + "\">" + d.projMaster + "</span>";
+                    }}
+                ,{field:'client',align:'center', title: '主委托方',  width:150,templet:function(d){
+                        return "<span title=\"" + d.client + "\">" + d.client + "</span>";
+                    }}
+                ,{field:'createDate',align:'center', title: '创建日期',  width:80}
+                ,{align:'center', title: '状态',  width:70,templet:function(d){
+                        var st = getAuditState(d.projectStatus);
+                        if(st.action)
+                            var xml = "<span onclick=\"openDialogView('流程追踪', '${ctx}/ruralProject/ruralCostProjectRecords/getProcess?id=" + d.id + "','95%','95%')\" class=\"status-label status-label-" + st.label + "\" >" + st.status + "</span>";
+                        else
+                            var xml = "<span style=\"cursor:default;\" class=\"status-label status-label-" + st.label + "\" >" + st.status + "</span>";
+                        return xml;
+                    }}
+                ,{field:'op',align:'center',title:"操作",width:130,templet:function(d){
+                        ////对操作进行初始化
+                        var xml="";
+                        if(d.canedit1 != undefined && d.canedit1 =="1")
+                        {
+                            xml+="<a href=\"#\" onclick=\"openDialogre('修改项目', '${ctx}/ruralProject/ruralCostProjectRecords/form?id=" + d.id +"','95%', '95%','','送审,暂存,关闭')\" class=\"op-btn op-btn-edit\" ><i class=\"fa fa-edit\"></i> 修改</a>";
+                        }
+                        if(d.canedit2 != undefined && d.canedit2 =="1")
+                        {
+                            xml+="<a href=\"#\" onclick=\"openDialogre('调整项目', '${ctx}/ruralProject/ruralCostProjectRecords/modify?id=" + d.id + "','95%', '95%','','送审,关闭')\" class=\"op-btn op-btn-edit\" ><i class=\"fa fa-edit\"></i> 修改</a>";
+                        }
+                        if(d.canrecall != undefined && d.canrecall =="1")
+                        {
+                            xml+="<a href=\"#\" onclick=\"openDialogre('调整项目', '${ctx}/ruralProject/ruralCostProjectRecords/form?id=" + d.id + "','95%', '95%','','送审,关闭')\" class=\"op-btn op-btn-edit\" ><i class=\"fa fa-edit\"></i> 修改</a>";
+                        }
+                        if(d.candel != undefined && d.candel =="1")
+                        {
+                            xml+="<a href=\"${ctx}/ruralProject/ruralCostProjectRecords/delete?id=" + d.id + "\" onclick=\"return confirmx('确认要删除该项目信息吗?', this.href)\" class=\"op-btn op-btn-delete\"><i class=\"fa fa-trash\"></i> 删除</a>";
+                        }
+                        if(d.cancancel != undefined && d.cancancel =="1")
+                        {
+                            xml+="<a href=\"${ctx}/ruralProject/ruralCostProjectRecords/revoke?id=" + d.id + "&processInstanceId=" + d.procId + "\" onclick=\"return confirmx('确认要撤回该项目审批吗?', this.href)\" class=\"op-btn op-btn-cancel\" ><i class=\"glyphicon glyphicon-share-alt\"></i> 撤回</a>";
+                        }
+                        if(d.canedit3 != undefined && d.canedit3 =="1")
+                        {
+                            xml+="<a href=\"javascript:void(0)\" onclick=\"openDialogre('项目变更管理', '${ctx}/ruralProject/ruralCostProjectRecordsAlter/form?alterBeforeRecords.id='+encodeURIComponent('" + d.id + "'),'95%','95%','','送审,暂存,关闭')\" style=\"color: white;background: darkseagreen\" class=\"op-btn op-btn-op-btn-revert\" ><i class=\"fa fa-edit\"></i> 变更</a>";
+                        }
+                        return xml;
+
+                    }}
+            ]]
+            ,data: [
+                <c:if test="${ not empty page.list}">
+                <c:forEach items="${page.list}" var="projectRecords" varStatus="index">
+                <c:if test="${index.index != 0}">,</c:if>
+                {
+                    "index":"${index.index+1}"
+                    ,"id":"${projectRecords.id}"
+                    ,"projId":"${projectRecords.projectId}"
+                    ,"projName":"<c:out value="${projectRecords.projectName}" escapeXml="true"/>"
+                    ,"projMaster":"<c:forEach items="${projectRecords.projectLeaders}" var="leader" varStatus="status"><c:choose><c:when test="${status.last}">${leader.name}</c:when><c:otherwise>${leader.name},</c:otherwise></c:choose></c:forEach>"
+                    ,"contract":"${projectRecords.workContractInfo.name}"
+                    ,"client":"${projectRecords.workContractInfo.client.name}"
+                    ,"createDate":"<fmt:formatDate value="${projectRecords.createDate}" pattern="yyyy-MM-dd"/>"
+                    ,"projectStatus":"${projectRecords.projectStatus}"
+                    ,"procId":"${projectRecords.processInstanceId}"
+                    <c:choose><c:when test="${flag == '1' or fns:getUser().id == projectRecords.createBy.id}">
+                    <shiro:hasPermission name="project:projectRecords:del">,"candel":	<c:choose><c:when test="${projectRecords.projectStatus == 1 or projectRecords.projectStatus == 3 or projectRecords.projectStatus == 4}">"1"</c:when><c:otherwise>"0"</c:otherwise></c:choose></shiro:hasPermission>
+                    <shiro:hasPermission name="project:projectRecords:edit">,"canedit1":	<c:choose><c:when test="${projectRecords.projectStatus == 1 }">"1"</c:when><c:otherwise>"0"</c:otherwise></c:choose>
+                    ,"canedit2":<c:choose><c:when test="${projectRecords.projectStatus == 4}">"1"</c:when><c:otherwise>"0"</c:otherwise></c:choose>
+                    ,"canrecall":<c:choose><c:when test="${projectRecords.projectStatus == 3}">"1"</c:when><c:otherwise>"0"</c:otherwise></c:choose>
+                    </shiro:hasPermission>
+                    ,"cancancel":<c:choose><c:when test="${projectRecords.projectStatus == 2 && fns:getUser().id == projectRecords.createBy.id}">"1"</c:when><c:otherwise>"0"</c:otherwise></c:choose>
+                    </c:when>
+                    <c:otherwise>
+                    ,"candel":"0"
+                    ,"canedit1":"0"
+                    ,"canedit2":"0"
+                    ,"canrecall":"0"
+                    ,"cancancel":"0"
+                    </c:otherwise>
+                    </c:choose>
+                    <shiro:hasPermission name="project:projectRecords:edit">,"canedit3":<c:choose><c:when test="${projectRecords.projectStatus == 5 && fn:contains(projectRecords.leaderIds,fns:getUser().id)}">"1"</c:when><c:otherwise>"0"</c:otherwise></c:choose></shiro:hasPermission>
+                }
+                </c:forEach>
+                </c:if>
+            ]
+            // ,even: true
+            // ,height: 315
+        });
+    })
+
+    resizeListTable();
+    $("a").on("click",addLinkVisied);
+</script>
+<script>
+    resizeListWindow2();
+    $(window).resize(function(){
+        resizeListWindow2();
+    });
+</script>
+</body>
+</html>

+ 736 - 0
src/main/webapp/webpage/modules/ruralprojectrecords/cost/ruralCostProjectRecordsModify.jsp

@@ -0,0 +1,736 @@
+<%@ page contentType="text/html;charset=UTF-8" %>
+<%@ include file="/webpage/include/taglib.jsp"%>
+<html>
+<head>
+	<title>项目管理</title>
+	<meta name="decorator" content="default"/>
+	<script type="text/javascript" src="${ctxStatic}/helloweba_editable-select/jquery.editable-select.min.js"></script>
+	<link rel='stylesheet' type="text/css" href="${ctxStatic}/helloweba_editable-select/jquery.editable-select.min.css"/>
+	<script type="text/javascript">
+		var validateForm;
+		function doSubmit(i){//回调函数,在编辑和保存动作时,供openDialog调用提交表单。
+		  if(validateForm.form()){
+              if($(".trIdAdds").length==0){
+                  top.layer.alert('请至少上传一个项目计划表或者实施方案文档!', {icon: 0});
+                  return;
+              }
+              if($("#workClientLinkmanList tr").length==0){
+                  top.layer.alert('请至少选择一个委托方联系人!', {icon: 0});
+                  return;
+              }
+		      if(i==2){
+		          $("#inputForm").attr("action","${ctx}/ruralProject/ruralProjectRecords/tstore");
+			  }
+			  $("#inputForm").submit();
+			  return true;
+		  }
+	
+		  return false;
+		}
+		$(document).ready(function() {
+			validateForm = $("#inputForm").validate({
+				submitHandler: function(form){
+					loading('正在提交,请稍等...');
+					form.submit();
+				},
+				errorContainer: "#messageBox",
+				errorPlacement: function(error, element) {
+					$("#messageBox").text("输入有误,请先更正。");
+					if (element.is(":checkbox")||element.is(":radio")||element.parent().is(".input-append")){
+						error.appendTo(element.parent().parent());
+					} else {
+						error.insertAfter(element);
+					}
+				}
+			});
+
+            <%--$('#scaleType').editableSelect({--%>
+                <%--effects: 'slide'--%>
+            <%--});--%>
+            <%--$('#scaleType').val("${projectRecords.scaleType}")--%>
+            <%--$('#scaleUnit').editableSelect({--%>
+                <%--effects: 'slide'--%>
+            <%--});--%>
+            <%--$('#scaleUnit').val("${projectRecords.scaleUnit}")--%>
+            $('#areaId').on("change", function () {
+                var areaId = $("#areaId").val();
+                $("#province").val('');
+                $("#city").val('');
+                $("#county").val('');
+                $.ajax({
+                    type : "POST",
+                    url : "${ctx}/sys/area/getParent",
+                    data : {'areaId':areaId},
+                    //请求成功
+                    success : function(result) {
+                        var pro = result.province;
+                        var city = result.city;
+                        var county  = result.county;
+                        if(pro != '') {
+                            $("#province").val(pro);
+                        }
+                        if(city != '') {
+                            $("#city").val(city);
+                        }
+                        if(county != '') {
+                            $("#county").val(county);
+                        }
+                    },
+
+                });
+            })
+		});
+
+        function setContractValue(obj){
+            var clientId = $("#contractClientId").val();
+            $.ajax({
+                type:'post',
+                url:'${ctx}/ruralProject/ruralProjectRecords/getContractInfo',
+                data:{
+                    "id":obj
+                },
+                success:function(data){
+                    $("#contractName").val(data.name);
+                    $("#contractPrice").val(data.contractPrice);
+                    formatNum($("#contractPrice"));
+                    $("#contractClientName").val(data.client.name);
+                    $("#contractClientId").val(data.client.id);
+                    $("#constructionProjectType").val(data.constructionProjectTypeStr);
+                    $("#linkmanId").val(data.workClinetInfoIds);
+                }
+            })
+            var newClientId  =$("#contractClientId").val();
+            if (clientId != newClientId){
+				$("#workClientLinkmanList tr").remove();
+			}
+        }
+
+        function setValuee(obj){
+            for(var i=0;i<obj.length;i++){
+                var idArr = $("#workClientLinkmanList tr:visible .clientId");
+                if(obj[i].id!=''&&!hasInArr(obj[i].id,idArr)){
+                    addRow("#workClientLinkmanList",workClientLinkmanRowIdx,workClientLinkmanTpl,obj[i]);
+                    workClientLinkmanRowIdx=workClientLinkmanRowIdx+1;
+                }
+            }
+        }
+        function getFee() {
+            $("#unitFees").val('');
+            var totalFee = $("#totalFees").val();
+            var count = $("#buildingScale").val();
+            if(count != '' && totalFee != '') {
+                var cFee = Math.round(parseInt(totalFee) / parseInt(count) * 100) / 100 * 10000;
+                $("#unitFees").val(cFee);
+            }
+        }
+
+        function getBudlingFees() {
+            $("#buildingPercent").val('');
+            $("#buildingUnitFees").val('');
+            var totalFee = $("#totalFees").val();
+            var budFee = $("#buildingFees").val();
+            var count = $("#buildingScale").val();
+            if(totalFee != '') {
+                var p = Math.round(parseInt(budFee) / parseInt(totalFee) * 100 * 100) / 100;
+            }
+            if(count != '') {
+                var pp = Math.round(parseInt(budFee) / parseInt(count) * 100) / 100 * 10000;
+            }
+            $("#buildingPercent").val(p);
+            $("#buildingUnitFees").val(pp);
+        }
+
+        function getInstallFees() {
+            $("#installPercent").val('');
+            $("#installUnitFees").val('');
+            var totalFee = $("#totalFees").val();
+            var budFee = $("#installFees").val();
+            var count = $("#buildingScale").val();
+            if(totalFee != '') {
+                var p = Math.round(parseInt(budFee) / parseInt(totalFee) * 100 * 100) / 100;
+            }
+            if(count != '') {
+                var pp = Math.round(parseInt(budFee) / parseInt(count) * 100) / 100 * 10000;
+            }
+            $("#installPercent").val(p);
+            $("#installUnitFees").val(pp);
+        }
+        function hasInArr(id,idArr) {
+            for(var i=0;i<idArr.length;i++){
+                if(id==$(idArr[i]).val()){
+                    return true;
+                }
+            }
+            return false;
+        }
+
+        function existLinkman(id,length) {
+            for (var i=0;i<length;i++) {
+                var val = $('#workClientLinkmanList'+i+'_id').val();
+                if(id==val){
+                    return true;
+				}
+            }
+            return false;
+        }
+
+        function setClientInfo(obj) {
+            for(var i=0;i<obj.length;i++){
+                var idArr = $("#workConstructionLinkmanList tr:visible .linkmanId");
+                if(obj[i].id!=''&&!hasInArr(obj[i].id,idArr)){
+                    addRow("#workConstructionLinkmanList",workConstructionLinkmanRowIdx,workConstructionLinkmanTpl,obj[i]);
+                    workConstructionLinkmanRowIdx=workConstructionLinkmanRowIdx+1;
+                }
+            }
+        }
+		
+        function existConstructionLinkman(obj,length) {
+            for (var i=0;i<length;i++) {
+                var val = $('#workConstructionLinkmanList'+i+'_id').val();
+                var cid = $('#workConstructionLinkmanList'+i+'_cid').val();
+                if(obj.id==val&&obj.client.id==cid){
+                    return true;
+                }
+            }
+            return false;
+        }
+
+        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 = "82";
+            /*console.log(file);*/
+            var timestamp=new Date().getTime();
+
+            var storeAs = "attachment-file/projectRecords/"+timestamp+"/"+file['name'];
+            var uploadPath="http://gangwan-app.oss-cn-hangzhou.aliyuncs.com/"+storeAs;/*将这段字符串存到数据库即可*/
+            var divId = "_attachment";
+            $("#addFile"+divId).show();
+            multipartUploadWithSts(storeAs, file,attachmentId,attachmentFlag,uploadPath,divId,0);}
+        }
+
+
+        function addFile() {
+            $("#attachment_file").click();
+        }
+        
+        function addRow(list, idx, tpl, row){
+            // var idx1 = $("#workClientLinkmanList tr").length;
+                bornTemplete(list, idx, tpl, row, idx);
+        }
+
+        function bornTemplete(list, idx, tpl, row, idx1){
+            $(list).append(Mustache.render(tpl, {
+                idx: idx, delBtn: true, row: row,
+                order:idx1 + 1
+            }));
+            $(list+idx).find("select").each(function(){
+                $(this).val($(this).attr("data-value"));
+            });
+            $(list+idx).find("input[type='checkbox'], input[type='radio']").each(function(){
+                var ss = $(this).attr("data-value").split(',');
+                for (var i=0; i<ss.length; i++){
+                    if($(this).val() == ss[i]){
+                        $(this).attr("checked","checked");
+                    }
+                }
+            });
+        }
+
+        function delRow(obj, prefix){
+            var id = $(prefix+"_id");
+            var delFlag = $(prefix+"_delFlag");
+            $(obj).parent().parent().remove();
+        }
+
+        function formatNum(obj) {
+            var val = $(obj).val();
+            if(val==null||val==''|| isNaN(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);
+        }
+	</script>
+</head>
+<body >
+<div class="single-form">
+    <div class="container">
+		<form:form id="inputForm" modelAttribute="projectRecords" enctype="multipart/form-data" action="${ctx}/ruralProject/ruralProjectRecords/saveAudit" method="post" class="form-horizontal">
+		<form:hidden path="id"/>
+            <form:hidden path="home"/>
+            <form:hidden path="act.taskId"/>
+            <form:hidden path="act.taskName"/>
+            <form:hidden path="act.taskDefKey"/>
+            <form:hidden path="act.procInsId"/>
+            <form:hidden path="act.procDefId"/>
+            <form:hidden id="flag" path="act.flag"/>
+		    <form:hidden path="workContractInfo.client.id" id="contractClientId" value="${workContractInfo.client.id}"/>
+
+            <div class="form-group layui-row first">
+                <div class="form-group-label"><h2>项目合同信息</h2></div>
+                <div class="layui-item layui-col-sm12 lw7">
+                    <label class="layui-form-label"><span class="require-item">*</span>选择合同:</label>
+                    <div class="layui-input-block  with-icon">
+                        <sys:gridselectContract url="${ctx}/ruralProject/ruralProjectRecords/selectcontract" type="" isTotal="1" id="contractId" name="workContractInfo.id"  value="${projectRecords.workContractInfo.id}"  title="选择合同" labelName="workContractInfo.name"
+                                                labelValue="${projectRecords.workContractInfo.name}" cssClass="form-control required layui-input" fieldLabels="合同名称" fieldKeys="name" searchLabel="合同名称" searchKey="name" ></sys:gridselectContract>
+                    </div>
+                </div>
+                <div class="layui-item layui-col-sm6 lw7">
+                    <label class="layui-form-label">合同名称:</label>
+                    <div class="layui-input-block">
+                        <input  htmlEscape="false"  readonly="true" id="contractName"  class="form-control layui-input" value="${projectRecords.workContractInfo.name}"/>
+                    </div>
+                </div>
+                <div class="layui-item layui-col-sm6 lw7">
+                    <label class="layui-form-label double-line">合同金额(元):</label>
+                    <div class="layui-input-block">
+                        <input  htmlEscape="false"  readonly="true" id="contractPrice"  class="form-control layui-input" value="<fmt:formatNumber value="${projectRecords.workContractInfo.contractPrice}" pattern="#,##0.00#"/>" onchange="formatNum(this);"/>
+                    </div>
+                </div>
+                <div class="layui-item layui-col-sm6 lw7">
+                    <label class="layui-form-label">主委托方:</label>
+                    <div class="layui-input-block">
+                        <input  htmlEscape="false"  readonly="true" id="contractClientName" name="workContractInfo.client.name" class="form-control layui-input" value="${projectRecords.workContractInfo.client.name}"/>
+                    </div>
+                </div>
+                <div class="layui-item layui-col-sm6 lw7">
+                    <label class="layui-form-label">工程分类:</label>
+                    <div class="layui-input-block">
+                        <input  htmlEscape="false"  readonly="true" id="constructionProjectType"  class="form-control layui-input" value="${projectRecords.workContractInfo.constructionProjectTypeStr}"/>
+                    </div>
+                </div>
+            </div>
+
+            <div class="form-group layui-row">
+                <div class="form-group-label"><h2>项目基础信息</h2></div>
+                <div class="layui-item layui-col-sm6 lw7">
+                    <label class="layui-form-label"><span class="require-item">*</span>项目名称</label>
+                    <div class="layui-input-block">
+                        <form:input path="projectName" htmlEscape="false"  class="form-control layui-input required"/>
+                    </div>
+                </div>
+                <div class="layui-item layui-col-sm6 lw7">
+                    <label class="layui-form-label">项目编号:</label>
+                    <div class="layui-input-block">
+                        <div class="input-group">
+                            <form:input path="projectId" htmlEscape="false"  readonly="true" class="form-control layui-input"/>
+                            <span class="input-group-btn">
+                                <label class="form-status"><c:choose><c:when test="${not empty projectRecords.projectStatus}">${fns:getDictLabel(projectRecords.projectStatus, 'audit_state', '')}</c:when><c:otherwise>新添</c:otherwise></c:choose></label>
+                             </span>
+                        </div>
+                    </div>
+                </div>
+                <%--<div class="layui-item layui-col-sm6 lw7">--%>
+                    <%--<label class="layui-form-label">规模类型:</label>--%>
+                    <%--<div class="layui-input-block">--%>
+                        <%--<form:select path="scaleType" class="form-control editable-select layui-input" id="scaleType" value="${scaleType}">--%>
+                            <%--<form:option value=""/>--%>
+                            <%--<form:options items="${fns:getMainDictList('scale_type')}" itemLabel="label" itemValue="label" htmlEscape="false"/>--%>
+                        <%--</form:select>--%>
+                    <%--</div>--%>
+                <%--</div>--%>
+                <%--<div class="layui-item layui-col-sm6 lw7">--%>
+                    <%--<label class="layui-form-label">规模单位:</label>--%>
+                    <%--<div class="layui-input-block">--%>
+                        <%--<form:select path="scaleUnit" class="form-control editable-select layui-input" id="scaleUnit" value="${scaleUnit}">--%>
+                            <%--<form:option value=""/>--%>
+                            <%--<form:options items="${fns:getMainDictList('scale_unit')}" itemLabel="label" itemValue="label" htmlEscape="false"/>--%>
+                        <%--</form:select>--%>
+                    <%--</div>--%>
+                <%--</div>--%>
+                <%--<div class="layui-item layui-col-sm6 lw7">--%>
+                    <%--<label class="layui-form-label">规模数量:</label>--%>
+                    <%--<div class="layui-input-block">--%>
+                        <%--<form:input path="scaleQuantity" htmlEscape="false"  class="form-control number layui-input"/>--%>
+                    <%--</div>--%>
+                <%--</div>--%>
+                <div class="layui-item layui-col-sm6 lw7">
+                    <label class="layui-form-label">项目所在地:</label>
+                    <div class="layui-input-block  with-icon">
+                        <sys:treeselect id="area" name="area.id" value="${projectRecords.area.id}" labelName="area.name" labelValue="${projectRecords.area.name}"
+                                        title="区域" url="/sys/area/treeData" cssClass="form-control layui-input" allowClear="true" notAllowSelectParent="true"/>
+                    </div>
+                </div>
+                <div class="layui-item layui-col-sm6 lw7">
+                    <label class="layui-form-label">所在省份:</label>
+                    <div class="layui-input-block">
+                        <form:input path="province" htmlEscape="false" id="province" class="form-control layui-input" readonly="true"/>
+                    </div>
+                </div>
+                <div class="layui-item layui-col-sm6 lw7">
+                    <label class="layui-form-label">所在地级市:</label>
+                    <div class="layui-input-block">
+                        <form:input path="city" htmlEscape="false" id="city" class="form-control layui-input" readonly="true"/>
+                    </div>
+                </div>
+                <div class="layui-item layui-col-sm6 lw7">
+                    <label class="layui-form-label">所在区县:</label>
+                    <div class="layui-input-block">
+                        <form:input path="county" htmlEscape="false" id="county" class="form-control layui-input" readonly="true"/>
+                    </div>
+                </div>
+                <div class="layui-item layui-col-sm6 lw7">
+                    <label class="layui-form-label">建设地点:</label>
+                    <div class="layui-input-block">
+                        <form:input path="projectSite" htmlEscape="false"  class="form-control layui-input"/>
+                    </div>
+                </div>
+                <div class="layui-item layui-col-sm6 lw7">
+                    <label class="layui-form-label"><span class="require-item">*</span>项目负责人:</label>
+                    <div class="layui-input-block  with-icon">
+                        <sys:treeselectt id="master" name="projectLeaders" value="${projectRecords.leaderIds}" labelName="leaderNameStr" labelValue="${projectRecords.leaderNameStr}"
+                                         title="用户" url="/sys/office/treeDataAll?type=3" checked="true" cssClass="form-control required layui-input" allowClear="true" notAllowSelectParent="true"/>
+                    </div>
+                </div>
+                <div class="layui-item layui-col-sm6 lw7">
+                    <label class="layui-form-label">创建人:</label>
+                    <div class="layui-input-block">
+                        <form:input path="createBy.name" htmlEscape="false"  readonly="true"  class="form-control  layui-input"/>
+                        <form:hidden path="createBy.id" htmlEscape="false"   readonly="true"  class="form-control  layui-input"/>
+                    </div>
+                </div>
+                <div class="layui-item layui-col-sm6 lw7">
+                    <label class="layui-form-label">创建日期:</label>
+                    <div class="layui-input-block">
+                        <input id="createDate" name="createDate" htmlEscape="false"  value="<fmt:formatDate value="${projectRecords.createDate}" pattern="yyyy-MM-dd"/>" readonly="readonly"  class="form-control required layui-input"/>
+                    </div>
+                </div>
+                <div class="layui-item layui-col-sm6 lw7">
+                    <label class="layui-form-label">工程结构:</label>
+                    <div class="layui-input-block">
+                        <form:select path="projectStructure" class="form-control editable-select layui-input" id="projectStructure" value="${projectStructure}">
+                            <form:option value=""/>
+                            <form:options items="${fns:getMainDictList('project_structure')}" itemLabel="label" itemValue="label" htmlEscape="false"/>
+                        </form:select>
+                    </div>
+                </div>
+                <div class="layui-item layui-col-sm6 lw7">
+                    <label class="layui-form-label">地上层数:</label>
+                    <div class="layui-input-block">
+                        <form:input path="onGroundNum" htmlEscape="false"  class="form-control layui-input number"/>
+                    </div>
+                </div>
+                <div class="layui-item layui-col-sm6 lw7">
+                    <label class="layui-form-label">底下层数:</label>
+                    <div class="layui-input-block">
+                        <form:input path="underGroundNum" htmlEscape="false"  class="form-control layui-input number"/>
+                    </div>
+                </div>
+                <div class="layui-item layui-col-sm6 lw7">
+                    <label class="layui-form-label double-line"><span class="require-item">*</span>建筑面积或规模:</label>
+                    <div class="layui-input-block">
+                        <form:input path="buildingScale" htmlEscape="false"  class="form-control layui-input required number" onchange="getFee()"/>
+                    </div>
+                </div>
+                <div class="layui-item layui-col-sm6 lw7">
+                    <label class="layui-form-label">计量单位:</label>
+                    <div class="layui-input-block">
+                        <form:select path="measuringUnit" class="form-control editable-select layui-input" id="measuringUnit" value="${measuringUnit}">
+                            <form:option value=""/>
+                            <form:options items="${fns:getMainDictList('scale_unit')}" itemLabel="label" itemValue="label" htmlEscape="false"/>
+                        </form:select>
+                    </div>
+                </div>
+                <div class="layui-item layui-col-sm6 lw7">
+                    <label class="layui-form-label">工程用途:</label>
+                    <div class="layui-input-block">
+                        <form:select path="projectUse" class="form-control editable-select layui-input" id="projectUse" value="${projectUse}">
+                            <form:option value=""/>
+                            <form:options items="${fns:getMainDictList('project_use')}" itemLabel="label" itemValue="label" htmlEscape="false"/>
+                        </form:select>
+                    </div>
+                </div>
+                <div class="layui-item layui-col-sm6 lw7">
+                    <label class="layui-form-label double-line"><span class="require-item">*</span>咨询标的额(万元):</label>
+                    <div class="layui-input-block">
+                        <form:input path="totalFees" htmlEscape="false" id="totalFees" class="form-control layui-input required number" onchange="getFee()"/>
+                    </div>
+                </div>
+                <div class="layui-item layui-col-sm6 lw7">
+                    <label class="layui-form-label double-line">其中土建造价(万元):</label>
+                    <div class="layui-input-block">
+                        <form:input path="buildingFees" htmlEscape="false" id="buildingFees" class="form-control layui-input" onchange="getBudlingFees()"/>
+                    </div>
+                </div>
+                <div class="layui-item layui-col-sm6 lw7">
+                    <label class="layui-form-label double-line">其中安装造价(万元):</label>
+                    <div class="layui-input-block">
+                        <form:input path="installFees" htmlEscape="false" id="installFees" class="form-control layui-input" onchange="getInstallFees()"/>
+                    </div>
+                </div>
+                <div class="layui-item layui-col-sm6 lw7">
+                    <label class="layui-form-label double-line">其中土建百分比(%):</label>
+                    <div class="layui-input-block">
+                        <form:input path="buildingPercent" htmlEscape="false" id="buildingPercent" class="form-control layui-input" readonly="true"/>
+                    </div>
+                </div>
+                <div class="layui-item layui-col-sm6 lw7">
+                    <label class="layui-form-label double-line">其中安装百分比(%):</label>
+                    <div class="layui-input-block">
+                        <form:input path="installPercent" htmlEscape="false" id="installPercent" class="form-control layui-input" readonly="true"/>
+                    </div>
+                </div>
+                <div class="layui-item layui-col-sm6 lw7">
+                    <label class="layui-form-label">单位造价(元):</label>
+                    <div class="layui-input-block">
+                        <form:input path="unitFees" htmlEscape="false" id="unitFees" class="form-control layui-input" readonly="true"/>
+                    </div>
+                </div>
+                <div class="layui-item layui-col-sm6 lw7">
+                    <label class="layui-form-label double-line">土建单位造价(元):</label>
+                    <div class="layui-input-block">
+                        <form:input path="buildingUnitFees" htmlEscape="false" id="buildingUnitFees" class="form-control layui-input" readonly="true"/>
+                    </div>
+                </div>
+                <div class="layui-item layui-col-sm6 lw7">
+                    <label class="layui-form-label double-line">安装单位造价(元):</label>
+                    <div class="layui-input-block">
+                        <form:input path="installUnitFees" htmlEscape="false" id="installUnitFees" class="form-control layui-input" readonly="true"/>
+                    </div>
+                </div>
+                <div class="layui-item layui-col-sm6 lw7 with-textarea">
+                    <label class="layui-form-label"><span class="require-item">*</span>工程概况:</label>
+                    <div class="layui-input-block">
+                        <form:textarea path="projectDesc" htmlEscape="false" rows="4"  maxlength="255"  class="form-control required"/>
+                    </div>
+                </div>
+                <div class="layui-item layui-col-sm6 lw7 with-textarea">
+                    <label class="layui-form-label ">特殊要求:</label>
+                    <div class="layui-input-block">
+                        <form:textarea path="remarks" htmlEscape="false" rows="4"  maxlength="255"  class="form-control "/>
+                    </div>
+                </div>
+            </div>
+
+            <div class="form-group layui-row">
+                <div class="form-group-label"><h2><span class="require-item">*</span>委托方联系人信息</h2></div>
+                <div class="layui-item nav-btns">
+                    <sys:gridselect1 url="${ctx}/workclientinfo/workClientInfo/linkmanList" id="linkman" name="linkman.id"  title="选择客户" value="${projectRecords.workContractInfo.workClinetInfoIds}"
+                                     cssClass="form-control required" fieldLabels="联系人" fieldKeys="name"  searchLabel="联系人" searchKey="name"></sys:gridselect1>
+                </div>
+                <div class="layui-item layui-col-xs12 form-table-container">
+                    <table id="contentTable" class="table table-bordered table-condensed details">
+                        <thead>
+                    <tr>
+                        <th class="hide"></th>
+                        <th width="20%">委托方</th>
+                        <th width="20%">联系人姓名</th>
+                        <th width="20%">联系方式1</th>
+                        <th width="20%">联系方式2</th>
+                        <th width="20%">操作</th>
+                    </tr>
+                    </thead>
+                        <tbody id="workClientLinkmanList">
+                        </tbody>
+                    </table>
+                    <script type="text/template" id="workClientLinkmanTpl">//<!--
+					<tr id="workClientLinkmanList{{idx}}">
+					<td class="hide">
+						<input id="workClientLinkmanList{{idx}}_id" name="workClientLinkmanList[{{idx}}].id" type="hidden" value="{{row.id}}" class="clientId"/>
+						<input id="workClientLinkmanList{{idx}}_delFlag" name="workClientLinkmanList[{{idx}}].delFlag" type="hidden" value="0"/>
+					</td>
+					<td>
+						<input id="workClientLinkmanList{{idx}}_cid" name = "workClientLinkmanList[{{idx}}].clientId.id" type="hidden" value="{{row.clientId.id}}"/>
+						{{row.clientId.name}}
+					</td>
+					<td>
+						{{row.name}}
+					</td>
+					<td>
+						{{row.linkPhone}}
+					</td>
+					<td>
+						{{row.linkMobile}}
+					</td>
+					<td class="op-td">
+						{{#delBtn}}<span class="op-btn op-btn-delete" onclick="delRow(this, '#workClientLinkmanList{{idx}}')" title="删除"><i class="fa fa-trash"></i>&nbsp;删除</span>{{/delBtn}}
+					</td>
+				</tr>//-->
+                    </script>
+                </div>
+            </div>
+
+            <div class="form-group layui-row">
+                <div class="form-group-label"><h2><span class="require-item">*</span>施工方信息</h2></div>
+                <div class="layui-item nav-btns">
+                    <sys:gridselectClientLink url="${ctx}/workclientinfo/workClientInfo/clientInfolist" id="constructionOrgList"   title="选择施工单位"
+                                              cssClass="form-control required" fieldLabels="客户编号" fieldKeys="name"  searchLabel="客户名称" searchKey="name"></sys:gridselectClientLink>
+                </div>
+                <div class="layui-item layui-col-xs12 form-table-container">
+                    <table id="contentTable2" class="table table-bordered table-condensed details">
+                        <thead>
+                        <tr>
+                            <th class="hide"></th>
+                            <th style="text-align: center" width="20%">施工方单位名称</th>
+                            <th style="text-align: center" width="20%">联系人姓名</th>
+                            <th style="text-align: center" width="20%">联系方式1</th>
+                            <th style="text-align: center" width="20%">联系方式2</th>
+                            <th width="20%">操作</th>
+                        </tr>
+                        </thead>
+                        <tbody id="workConstructionLinkmanList">
+                        </tbody>
+                    </table>
+                    <script type="text/template" id="workConstructionLinkmanTpl">//<!--
+					<tr id="workConstructionLinkmanList{{idx}}">
+					<td class="hide">
+						<input id="workConstructionLinkmanList{{idx}}_id" name="workConstructionLinkmanList[{{idx}}].id" type="hidden" value="{{row.id}}" class="linkmanId"/>
+						<input id="workConstructionLinkmanList{{idx}}_delFlag" name="workConstructionLinkmanList[{{idx}}].delFlag" type="hidden" value="0"/>
+					</td>
+					<td style="text-align: center">
+						<input id="workConstructionLinkmanList{{idx}}_cid" name = "workConstructionLinkmanList[{{idx}}].clientId.id" type="hidden" value="{{row.clientId.id}}"/>
+						{{row.clientId.name}}
+					</td>
+					<td style="text-align: center">
+						{{row.name }}
+					</td>
+					<td style="text-align: center">
+						{{row.linkPhone}}
+					</td>
+					<td style="text-align: center">
+						{{row.linkMobile}}
+					</td>
+					<td class="text-center" width="10">
+						{{#delBtn}}<span class="op-btn op-btn-delete" onclick="delRow(this, '#workConstructionLinkmanList{{idx}}')" title="删除"><i class="fa fa-trash"></i>&nbsp;删除</span>{{/delBtn}}
+					</td>
+				</tr>//-->
+                    </script>
+
+                <script>
+                    var workClientLinkmanRowIdx = 0, workClientLinkmanTpl = $("#workClientLinkmanTpl").html().replace(/(\/\/\<!\-\-)|(\/\/\-\->)/g,"");
+                    var workConstructionLinkmanRowIdx = 0, workConstructionLinkmanTpl = $("#workConstructionLinkmanTpl").html().replace(/(\/\/\<!\-\-)|(\/\/\-\->)/g,"");
+                    $(document).ready(function() {
+                        var data = ${fns:toJson(projectRecords.workClientLinkmanList)};
+                        for (var i=0; i<data.length; i++){
+                            addRow('#workClientLinkmanList', workClientLinkmanRowIdx, workClientLinkmanTpl, data[i]);
+                            workClientLinkmanRowIdx = workClientLinkmanRowIdx + 1;
+                        }
+                        var dataBank = ${fns:toJson(projectRecords.workConstructionLinkmanList)};
+                        for (var i=0; i<dataBank.length; i++){
+                            addRow('#workConstructionLinkmanList', workConstructionLinkmanRowIdx, workConstructionLinkmanTpl, dataBank[i]);
+                            workConstructionLinkmanRowIdx = workConstructionLinkmanRowIdx + 1;
+                        }
+                    });
+                </script>
+                </div>
+            </div>
+
+            <div class="form-group layui-row">
+                <div class="form-group-label"><h2><span class="require-item">*</span>项目计划附件信息</h2></div>
+                <div class="layui-item nav-btns">
+                    <a id="attachment_btn" class="nav-btn nav-btn-add" title="添加附件"  onclick="addFile()"><i class="fa fa-plus"></i>&nbsp;添加附件</a>
+                </div>
+                <div id="addFile_attachment" style="display: none" class="upload-progress">
+                    <span id="fileName_attachment" ></span>
+                    <b><span id="baifenbi_attachment" ></span></b>
+                    <div class="progress">
+                        <div id="jindutiao_attachment" class="progress-bar" style="width: 0%" aria-valuenow="0">
+                        </div>
+                    </div>
+                </div>
+                <input id="attachment_file" type="file" name="attachment_file" multiple="multiple" style="display: none;" onChange="if(this.value)insertTitle(this.value);"/>
+                <span id="attachment_title"></span>
+                <div class="layui-item layui-col-xs12 form-table-container">
+                    <table id="listAttachment" class="table table-bordered table-condensed details">
+                        <thead>
+                        <tr>
+                                <%-- <th>序号</th>--%>
+                            <th width="25%">文件</th>
+                            <th width="25%">上传人</th>
+                            <th width="25%">上传时间</th>
+                            <th width="25%">操作</th>
+                        </tr>
+                        </thead>
+                        <tbody id="file_attachment">
+                        <c:forEach items="${projectRecords.workAttachments}" var = "workClientAttachment" varStatus="status">
+                            <tr class="trIdAdds">
+                                    <%-- <td>${status.index + 1}</td>--%>
+                                <c:choose>
+                                    <c:when test="${fn:containsIgnoreCase(workClientAttachment.attachmentName,'jpg')
+                                                           or fn:containsIgnoreCase(workClientAttachment.attachmentName,'png')
+                                                           or fn:containsIgnoreCase(workClientAttachment.attachmentName,'gif')
+                                                           or fn:containsIgnoreCase(workClientAttachment.attachmentName,'bmp')
+                                                           or fn:containsIgnoreCase(workClientAttachment.attachmentName,'jpeg')}">
+                                        <td><img src="${workClientAttachment.url}" width="50" height="50" onclick="openDialogView('预览','${ctx}/sys/picturepreview/picturePreview?url=${workClientAttachment.url}','90%','90%')" alt="${workClientAttachment.attachmentName}">
+                                    </c:when>
+                                    <c:otherwise>
+                                        <c:choose>
+                                            <c:when test="${fn:containsIgnoreCase(workClientAttachment.attachmentName,'pdf')}">
+                                                <td><a class="attention-info" href="javascript:void(0)" onclick="preview('预览','${workClientAttachment.url}','90%','90%','1')">${workClientAttachment.attachmentName}</a></td>
+                                            </c:when>
+                                            <c:otherwise>
+                                                <td><a class="attention-info" href="javascript:void(0)" onclick="preview('预览','${workClientAttachment.url}','90%','90%')">${workClientAttachment.attachmentName}</a></td>
+                                            </c:otherwise>
+                                        </c:choose>
+                                    </c:otherwise>
+                                </c:choose>
+                                <td>${workClientAttachment.createBy.name}</td>
+                                <td><fmt:formatDate value="${workClientAttachment.createDate}" type="both"/></td>
+                                <td class="op-td">
+                                    <div class="op-btn-box" >
+                                        <a href="javascript:location.href='${ctx}/workfullmanage/workFullManage/downLoadAttach?file='+encodeURIComponent(encodeURIComponent('${workClientAttachment.url}'));" class="op-btn op-btn-download"><i class="fa fa-download"></i>&nbsp;下载</a>
+                                        <a href="javascript:void(0)" onclick="deleteFileFromAliyun(this,'${ctx}/sys/workattachment/deleteFileFromAliyun?url=${workClientAttachment.url}&id=${workClientAttachment.id}&type=2','addFile')" class="op-btn op-btn-delete" ><i class="fa fa-trash"></i>&nbsp;删除</a>
+                                    </div>
+                                </td>
+                            </tr>
+                        </c:forEach>
+                        </tbody>
+                    </table>
+                </div>
+            </div>
+
+            <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="usersListTable" class="table table-bordered table-condensed details">
+                        <thead>
+                        <tr>
+                            <th width="25%">姓名</th>
+                            <th width="25%">部门</th>
+                            <th width="25%">职级</th>
+                            <th width="25%">状态</th>
+                        </tr>
+                        </thead>
+                        <tbody id="usersList">
+                        <c:if test="${not empty projectRecords.projectMembers}">
+                            <c:forEach items="${projectRecords.projectMembers}" var="user">
+                                <tr id="${user.id}">
+                                    <td>
+                                            ${user.name}
+                                    </td>
+                                    <td>
+                                            ${user.office.name}
+                                    </td>
+                                    <td>
+                                            ${user.basicInfo.jobGrade.name}
+                                    </td>
+                                    <td>
+                                        <c:choose>
+                                            <c:when test="${user.delFlag == 0}">
+                                                正常
+                                            </c:when>
+                                            <c:otherwise>
+                                                移除
+                                            </c:otherwise>
+                                        </c:choose>
+                                    </td>
+                                </tr>
+                            </c:forEach>
+                        </c:if>
+                        </tbody>
+                    </table>
+                </div>
+            </div>
+            <div class="form-group layui-row page-end"></div>
+        </form:form>
+    </div>
+</div>
+
+</body>
+</html>

+ 557 - 0
src/main/webapp/webpage/modules/ruralprojectrecords/cost/ruralCostProjectRecordsView.jsp

@@ -0,0 +1,557 @@
+<%@ page contentType="text/html;charset=UTF-8" %>
+<%@ include file="/webpage/include/taglib.jsp"%>
+<html>
+<head>
+	<title>项目审批管理</title>
+	<meta name="decorator" content="default"/>
+	<script>
+		$(document).ready(function () {
+			var tt = $("#contractNum").val();
+			if (tt == null || tt === "") {
+				$("#divv").hide();
+				$("#divv3").hide();
+				setTimeout(function () {
+					var tt = $("#workClientLinkmanList").find("tr").eq(0).find("td").eq(1).text().trim();
+					$("#clientName").val(tt);
+				},100);
+			}
+
+		})
+	</script>
+	<script type="text/javascript">
+        function addRow(list, idx, tpl, row){
+            // var idx1 = $("#workClientLinkmanList tr").length;
+            bornTemplete(list, idx, tpl, row, idx);
+        }
+
+        function bornTemplete(list, idx, tpl, row, idx1){
+            $(list).append(Mustache.render(tpl, {
+                idx: idx, delBtn: true, row: row,
+                order:idx1 + 1
+            }));
+            $(list+idx).find("select").each(function(){
+                $(this).val($(this).attr("data-value"));
+            });
+            $(list+idx).find("input[type='checkbox'], input[type='radio']").each(function(){
+                var ss = $(this).attr("data-value").split(',');
+                for (var i=0; i<ss.length; i++){
+                    if($(this).val() == ss[i]){
+                        $(this).attr("checked","checked");
+                    }
+                }
+            });
+        }
+        function seeFile(fileUrl,fileName) {
+            //   location.href = "/followRecord/seeFile";
+            var index = fileName.lastIndexOf(".");
+            var fileType = fileName.substring(index);
+            // debugger
+            if (".pdf" == fileType) {
+                window.open(fileUrl);
+            } else {
+                window.open("${ctx}/isignature/iSignatureDocument/seeFile?fileUrl="+fileUrl+"&fileName="+fileName);
+            }
+        }
+	</script>
+	<script>
+		function initRecordStatus(index,id,dataid,status)
+		{
+			var elem = document.getElementById("status_td_" + index);
+			var st = getAuditState(status);
+			if(st.action)
+				var xml = "<span onclick=\"openDialogView('流程追踪', '${ctx}/projectcontentinfo/projectcontentinfo/getProcessOne?id=" + id + "&projectReportData.id="+ dataid + "&type="+status+"','95%','95%')\" class=\"status-label status-label-" + st.label + "\" >" + st.status + "</span>";
+			else
+				var xml = "<span style=\"cursor:default;\" class=\"status-label status-label-" + st.label + "\" >" + st.status + "</span>";
+
+			elem.innerHTML = xml;
+		}
+	</script>
+</head>
+<body>
+<div class="single-form">
+	<div class="container view-form">
+		<form:form id="inputForm" modelAttribute="projectRecords" action="${ctx}/ruralProject/ruralProjectRecords/saveAudit" method="post" class="form-horizontal">
+			<div class="form-group layui-row first">
+				<div class="form-group-label"><h2>项目合同信息</h2></div>
+               <div id="divv">
+				   <div class="layui-item layui-col-sm12 lw6">
+					   <label class="layui-form-label">合同编号:</label>
+					   <div class="layui-input-block">
+						   <input htmlEscape="false" id="contractNum" readonly="true" class="form-control layui-input" value="${projectRecords.workContractInfo.contractNum}"/>
+					   </div>
+				   </div>
+				   <div class="layui-item layui-col-sm6 lw6">
+					   <label class="layui-form-label">合同名称:</label>
+					   <div class="layui-input-block">
+						   <input htmlEscape="false"  readonly="true" class="form-control layui-input" value="${projectRecords.workContractInfo.name}"/>
+					   </div>
+				   </div>
+				   <div class="layui-item layui-col-sm6 lw6">
+					   <label class="layui-form-label double-line">合同金额(元):</label>
+					   <div class="layui-input-block">
+						   <input htmlEscape="false"  readonly="true" class="form-control layui-input" value="<fmt:formatNumber value="${projectRecords.workContractInfo.contractPrice}" pattern="#,##0.00#"/>"/>
+					   </div>
+				   </div>
+			   </div>
+				<div class="layui-item layui-col-sm6 lw6">
+					<label class="layui-form-label">主委托方:</label>
+					<div class="layui-input-block">
+						<input htmlEscape="false"  id="clientName" readonly="true" class="form-control layui-input" value="${projectRecords.workContractInfo.client.name}"/>
+					</div>
+				</div>
+				<div id="divv3">
+					<div class="layui-item layui-col-sm6 lw6">
+						<label class="layui-form-label">工程分类:</label>
+						<div class="layui-input-block">
+							<input htmlEscape="false"  readonly="true" class="form-control layui-input" value="${projectRecords.workContractInfo.constructionProjectTypeStr}"/>
+						</div>
+					</div>
+				</div>
+			</div>
+
+			<div class="form-group layui-row first">
+				<div class="form-group-label"><h2>项目基础信息</h2></div>
+                <div class="layui-item layui-col-sm6 lw6">
+                    <label class="layui-form-label">项目名称:</label>
+                    <div class="layui-input-block">
+                        <input htmlEscape="false"  readonly="true" class="form-control layui-input" value="${projectRecords.projectName}"/>
+                    </div>
+                </div>
+				<div class="layui-item layui-col-sm6 lw6">
+					<label class="layui-form-label">项目编号:</label>
+					<div class="layui-input-block">
+                        <div class="input-group">
+                            <form:input path="projectId" htmlEscape="false"  readonly="true" class="form-control layui-input"/>
+                            <span class="input-group-btn">
+                                <label class="form-status"><c:choose><c:when test="${not empty projectRecords.projectStatus}">${fns:getDictLabel(projectRecords.projectStatus, 'audit_state', '')}</c:when><c:otherwise>新添</c:otherwise></c:choose></label>
+                             </span>
+                        </div>
+					</div>
+				</div>
+				<%--<div class="layui-item layui-col-sm6 lw6">--%>
+					<%--<label class="layui-form-label">规模类型:</label>--%>
+					<%--<div class="layui-input-block">--%>
+						<%--<input htmlEscape="false"  readonly="true" class="form-control layui-input" value="${projectRecords.scaleType}"/>--%>
+					<%--</div>--%>
+				<%--</div>--%>
+				<%--<div class="layui-item layui-col-sm6 lw6">--%>
+					<%--<label class="layui-form-label">规模单位:</label>--%>
+					<%--<div class="layui-input-block">--%>
+						<%--<input htmlEscape="false"  readonly="true" class="form-control layui-input" value="${projectRecords.scaleUnit}"/>--%>
+					<%--</div>--%>
+				<%--</div>--%>
+				<%--<div class="layui-item layui-col-sm6 lw6">--%>
+					<%--<label class="layui-form-label">规模数量:</label>--%>
+					<%--<div class="layui-input-block">--%>
+						<%--<input htmlEscape="false"  readonly="true" class="form-control layui-input" value="${projectRecords.scaleQuantity}"/>--%>
+					<%--</div>--%>
+				<%--</div>--%>
+				<div class="layui-item layui-col-sm6 lw6">
+					<label class="layui-form-label">项目所在地:</label>
+					<div class="layui-input-block">
+						<input htmlEscape="false"  readonly="true" class="form-control layui-input" value="${projectRecords.area.name}"/>
+					</div>
+				</div>
+				<div class="layui-item layui-col-sm6 lw7">
+					<label class="layui-form-label">所在省份:</label>
+					<div class="layui-input-block">
+						<form:input path="province" htmlEscape="false" id="province" class="form-control layui-input" readonly="true"/>
+					</div>
+				</div>
+				<div class="layui-item layui-col-sm6 lw7">
+					<label class="layui-form-label">所在地级市:</label>
+					<div class="layui-input-block">
+						<form:input path="city" htmlEscape="false" id="city" class="form-control layui-input" readonly="true"/>
+					</div>
+				</div>
+				<div class="layui-item layui-col-sm6 lw7">
+					<label class="layui-form-label">所在区县:</label>
+					<div class="layui-input-block">
+						<form:input path="county" htmlEscape="false" id="areaName1" class="form-control layui-input" readonly="true"/>
+					</div>
+				</div>
+				<div class="layui-item layui-col-sm6 lw6">
+					<label class="layui-form-label">建设地点:</label>
+					<div class="layui-input-block">
+						<input htmlEscape="false"  readonly="true" class="form-control layui-input" value="${projectRecords.projectSite}"/>
+					</div>
+				</div>
+				<div class="layui-item layui-col-sm6 lw6">
+					<label class="layui-form-label">项目负责人:</label>
+					<div class="layui-input-block">
+						<input htmlEscape="false"  readonly="true" class="form-control layui-input" value="${projectRecords.leaderNameStr}"/>
+					</div>
+				</div>
+				<div class="layui-item layui-col-sm6 lw6">
+					<label class="layui-form-label">创建人:</label>
+					<div class="layui-input-block">
+						<input htmlEscape="false"  readonly="true" class="form-control layui-input" value="${projectRecords.createBy.name}"/>
+					</div>
+				</div>
+				<div class="layui-item layui-col-sm6 lw6">
+					<label class="layui-form-label">创建日期:</label>
+					<div class="layui-input-block">
+						<input htmlEscape="false"  readonly="true" class="form-control layui-input" value="<fmt:formatDate value="${projectRecords.createDate}" pattern="yyyy-MM-dd"/>"/>
+					</div>
+				</div>
+				<div class="layui-item layui-col-sm6 lw7">
+					<label class="layui-form-label">工程结构:</label>
+					<div class="layui-input-block">
+							<input htmlEscape="false"  readonly="true" class="form-control layui-input" value="${projectRecords.projectStructure}"/>
+					</div>
+				</div>
+				<div class="layui-item layui-col-sm6 lw7">
+					<label class="layui-form-label">地上层数:</label>
+					<div class="layui-input-block">
+						<form:input path="onGroundNum" htmlEscape="false"  class="form-control layui-input number" readonly="true"/>
+					</div>
+				</div>
+				<div class="layui-item layui-col-sm6 lw7">
+					<label class="layui-form-label">底下层数:</label>
+					<div class="layui-input-block">
+						<form:input path="underGroundNum" htmlEscape="false"  class="form-control layui-input number" readonly="true"/>
+					</div>
+				</div>
+				<div class="layui-item layui-col-sm6 lw7">
+					<label class="layui-form-label double-line"><span class="require-item">*</span>建筑面积或规模:</label>
+					<div class="layui-input-block">
+						<form:input path="buildingScale" htmlEscape="false"  class="form-control layui-input required number" readonly="true"/>
+					</div>
+				</div>
+				<div class="layui-item layui-col-sm6 lw7">
+					<label class="layui-form-label">计量单位:</label>
+					<div class="layui-input-block">
+						<input htmlEscape="false"  readonly="true" class="form-control layui-input" value="${projectRecords.measuringUnit}"/>
+					</div>
+				</div>
+				<div class="layui-item layui-col-sm6 lw7">
+					<label class="layui-form-label">工程用途:</label>
+					<div class="layui-input-block">
+						<input htmlEscape="false"  readonly="true" class="form-control layui-input" value="${projectRecords.projectUse}"/>
+					</div>
+				</div>
+				<div class="layui-item layui-col-sm6 lw7">
+					<label class="layui-form-label double-line"><span class="require-item">*</span>咨询标的额(万元):</label>
+					<div class="layui-input-block">
+						<input value="<fmt:formatNumber value="${projectRecords.totalFees}" pattern="#,##0.00#"/>" htmlEscape="false" id="totalFees" class="form-control layui-input required number"  readonly="true"/>
+					</div>
+				</div>
+				<div class="layui-item layui-col-sm6 lw7">
+					<label class="layui-form-label double-line">其中土建造价(万元):</label>
+					<div class="layui-input-block">
+						<input   value="<fmt:formatNumber value="${projectRecords.buildingFees}" pattern="#,##0.00#"/>" htmlEscape="false" id="buildingFees" class="form-control layui-input" readonly="true"/>
+					</div>
+				</div>
+				<div class="layui-item layui-col-sm6 lw7">
+					<label class="layui-form-label double-line">其中安装造价(万元):</label>
+					<div class="layui-input-block">
+						<input  value="<fmt:formatNumber value="${projectRecords.installFees}" pattern="#,##0.00#"/>" htmlEscape="false" id="installFees" class="form-control layui-input" readonly="true"/>
+					</div>
+				</div>
+				<div class="layui-item layui-col-sm6 lw7">
+					<label class="layui-form-label double-line">其中土建百分比(%):</label>
+					<div class="layui-input-block">
+						<form:input path="buildingPercent" htmlEscape="false" id="buildingPercent" class="form-control layui-input" readonly="true"/>
+					</div>
+				</div>
+				<div class="layui-item layui-col-sm6 lw7">
+					<label class="layui-form-label double-line">其中安装百分比(%):</label>
+					<div class="layui-input-block">
+						<form:input path="installPercent" htmlEscape="false" id="installPercent" class="form-control layui-input" readonly="true"/>
+					</div>
+				</div>
+				<div class="layui-item layui-col-sm6 lw7">
+					<label class="layui-form-label">单位造价(元):</label>
+					<div class="layui-input-block">
+						<input value="<fmt:formatNumber value="${projectRecords.unitFees}" pattern="#,##0.00#"/>" htmlEscape="false" id="unitFees" class="form-control layui-input" readonly="true"/>
+					</div>
+				</div>
+				<div class="layui-item layui-col-sm6 lw7">
+					<label class="layui-form-label double-line">土建单位造价(元):</label>
+					<div class="layui-input-block">
+						<input  value="<fmt:formatNumber value="${projectRecords.buildingUnitFees}" pattern="#,##0.00#"/>" htmlEscape="false" id="buildingUnitFees" class="form-control layui-input" readonly="true"/>
+					</div>
+				</div>
+				<div class="layui-item layui-col-sm6 lw7">
+					<label class="layui-form-label double-line">安装单位造价(元):</label>
+					<div class="layui-input-block">
+						<input  value="<fmt:formatNumber value="${projectRecords.installUnitFees}" pattern="#,##0.00#"/>" htmlEscape="false" id="installUnitFees" class="form-control layui-input" readonly="readonly"/>
+					</div>
+				</div>
+				<div class="layui-item layui-col-sm6 lw6 with-textarea">
+					<label class="layui-form-label">工程概况:</label>
+					<div class="layui-input-block">
+						<textarea htmlEscape="false" rows="4" readonly="true" maxlength="1000" class="form-control" >${projectRecords.projectDesc}</textarea>
+					</div>
+				</div>
+				<div class="layui-item layui-col-sm6 lw6 with-textarea">
+					<label class="layui-form-label">特殊要求:</label>
+					<div class="layui-input-block">
+						<textarea htmlEscape="false" rows="4" readonly="true" maxlength="1000" class="form-control" >${projectRecords.remarks}</textarea>
+					</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="contentTable" class="table table-bordered table-condensed no-bottom-margin details">
+						<thead>
+						<tr>
+							<th class="hide"></th>
+							<th width="25%">委托方</th>
+							<th width="25%">联系人姓名</th>
+							<th width="25%">联系方式1</th>
+							<th width="25%">联系方式2</th>
+						</tr>
+						</thead>
+						<tbody id="workClientLinkmanList">
+						</tbody>
+					</table>
+					<script type="text/template" id="workClientLinkmanTpl">//<!--
+					<tr id="workClientLinkmanList{{idx}}">
+					<td class="hide">
+						<input id="workClientLinkmanList{{idx}}_id" name="workClientLinkmanList[{{idx}}].id" type="hidden" value="{{row.id}}"/>
+						<input id="workClientLinkmanList{{idx}}_delFlag" name="workClientLinkmanList[{{idx}}].delFlag" type="hidden" value="0"/>
+					</td>
+					<td>
+						{{row.clientId.name}}
+					</td>
+					<td>
+						{{row.name}}
+					</td>
+					<td>
+						{{row.linkPhone}}
+					</td>
+					<td>
+						{{row.linkMobile}}
+					</td>
+				</tr>//-->
+					</script>
+				</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="contentTable1" class="table table-bordered table-condensed no-bottom-margin details">
+						<thead>
+						<tr>
+							<th class="hide"></th>
+							<th width="25%">施工方单位名称</th>
+							<th width="25%">联系人姓名</th>
+							<th width="25%">联系方式1</th>
+							<th width="25%">联系方式2</th>
+						</tr>
+						</thead>
+						<tbody id="workConstructionLinkmanList">
+						</tbody>
+					</table>
+					<script type="text/template" id="workConstructionLinkmanTpl">//<!--
+					<tr id="workConstructionLinkmanList{{idx}}">
+					<td class="hide">
+						<input id="workConstructionLinkmanList{{idx}}_id" name="workConstructionLinkmanList[{{idx}}].id" type="hidden" value="{{row.id}}"/>
+						<input id="workConstructionLinkmanList{{idx}}_delFlag" name="workConstructionLinkmanList[{{idx}}].delFlag" type="hidden" value="0"/>
+					</td>
+					<td>
+						{{row.clientId.name}}
+					</td>
+					<td>
+						{{row.name }}
+					</td>
+					<td>
+						{{row.linkPhone}}
+					</td>
+					<td>
+						{{row.linkMobile}}
+					</td>
+				</tr>//-->
+					</script>
+				</div>
+			</div>
+
+			<c:if test="${not empty projectRecords.workAttachments}">
+			<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="listAttachment" class="table table-bordered table-condensed no-bottom-margin details">
+						<thead>
+						<tr>
+							<th width="25%">文件预览</th>
+							<th width="25%">上传人</th>
+							<th width="25%">上传时间</th>
+							<th width="25%">操作</th>
+						</tr>
+						</thead>
+						<tbody id="file_attachment">
+						<c:forEach items="${projectRecords.workAttachments}" var="workClientAttachment" varStatus="status">
+							<tr>
+									<%--<td>${status.index + 1}</td>--%>
+								<c:choose>
+									<c:when test="${fn:containsIgnoreCase(workClientAttachment.attachmentName,'jpg')
+															   or fn:containsIgnoreCase(workClientAttachment.attachmentName,'png')
+															   or fn:containsIgnoreCase(workClientAttachment.attachmentName,'gif')
+															   or fn:containsIgnoreCase(workClientAttachment.attachmentName,'bmp')
+															   or fn:containsIgnoreCase(workClientAttachment.attachmentName,'jpeg')}">
+										<td><img src="${workClientAttachment.url}" width="50" height="50" onclick="openDialogView('预览','${ctx}/sys/picturepreview/picturePreview?url=${workClientAttachment.url}','90%','90%')" alt="${workClientAttachment.attachmentName}">
+									</c:when>
+									<c:otherwise>
+										<c:choose>
+											<c:when test="${fn:containsIgnoreCase(workClientAttachment.attachmentName,'pdf')}">
+												<td><a href="javascript:void(0)" onclick="preview('预览','${workClientAttachment.url}','95%','95%','1')">${workClientAttachment.attachmentName}</a></td>
+											</c:when>
+											<c:otherwise>
+												<td><a href="javascript:void(0)" onclick="preview('预览','${workClientAttachment.url}','95%','95%')">${workClientAttachment.attachmentName}</a></td>
+											</c:otherwise>
+										</c:choose>
+									</c:otherwise>
+								</c:choose>
+								<td>${workClientAttachment.createBy.name}</td>
+								<td><fmt:formatDate value="${workClientAttachment.createDate}" pattern="yyyy-MM-dd"/></td>
+								<td  class="op-td">
+									<a href="javascript:location.href=encodeURI('${ctx}/workcontractinfo/workContractInfo/downLoadAttach?file=${workClientAttachment.url}');" class="op-btn op-btn-download"><i class="fa fa-download"></i>&nbsp;下载</a>
+									<%--<a href="#" onclick="seeFile('${workClientAttachment.url}','${workClientAttachment.attachmentName}');" class="op-btn op-btn-download"><i class="fa fa-download"></i>&nbsp;查看</a>--%>
+								</td>
+							</tr>
+						</c:forEach>
+						</tbody>
+					</table>
+				</div>
+			</div>
+			</c:if>
+			<script>
+                var workClientLinkmanRowIdx = 0, workClientLinkmanTpl = $("#workClientLinkmanTpl").html().replace(/(\/\/\<!\-\-)|(\/\/\-\->)/g,"");
+                var workConstructionLinkmanRowIdx = 0, workConstructionLinkmanTpl = $("#workConstructionLinkmanTpl").html().replace(/(\/\/\<!\-\-)|(\/\/\-\->)/g,"");
+                $(document).ready(function() {
+                    var data = ${fns:toJson(projectRecords.workClientLinkmanList)};
+                    for (var i=0; i<data.length; i++){
+                        addRow('#workClientLinkmanList', workClientLinkmanRowIdx, workClientLinkmanTpl, data[i]);
+                        workClientLinkmanRowIdx = workClientLinkmanRowIdx + 1;
+                    }
+                    var dataBank = ${fns:toJson(projectRecords.workConstructionLinkmanList)};
+                    for (var i=0; i<dataBank.length; i++){
+                        addRow('#workConstructionLinkmanList', workConstructionLinkmanRowIdx, workConstructionLinkmanTpl, dataBank[i]);
+                        workConstructionLinkmanRowIdx = workConstructionLinkmanRowIdx + 1;
+                    }
+                });
+
+			</script>
+
+			<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="usersListTable" class="table table-bordered table-condensed no-bottom-margin details">
+					<thead>
+					<tr>
+						<th width="25%">姓名</th>
+						<th width="25%">部门</th>
+						<th width="25%">职级</th>
+						<th width="25%">状态</th>
+					</tr>
+					</thead>
+					<tbody id="usersList">
+					<c:if test="${not empty projectRecords.projectMembers}">
+						<c:forEach items="${projectRecords.projectMembers}" var="user">
+							<tr id="${user.id}">
+								<td>
+										${user.name}
+								</td>
+								<td>
+										${user.office.name}
+								</td>
+								<td>
+										${user.basicInfo.jobGrade.name}
+								</td>
+								<td>
+									<c:choose>
+										<c:when test="${user.delFlag == 0}">
+											正常
+										</c:when>
+										<c:otherwise>
+											移除
+										</c:otherwise>
+									</c:choose>
+								</td>
+							</tr>
+						</c:forEach>
+					</c:if>
+					</tbody>
+				</table>
+			</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="upTable" class="table table-bordered table-condensed details">
+						<thead>
+						<tr>
+							<th width="25%">报告编号</th>
+							<th width="25%">报告名称</th>
+							<th width="20%">工作内容类型</th>
+							<th width="10%">签章类型</th>
+							<th width="10%">创建日期</th>
+							<th width="10%">状态</th>
+						</tr>
+						</thead>
+						<tbody>
+						<c:choose>
+							<c:when test="${not empty projectRecords.projectReportData}">
+								<c:forEach items="${projectRecords.projectReportData}" var="projectReportData" varStatus="index">
+									<tr>
+										<td><a title="${projectReportData.number}" href="javascript:void(0)" onclick="openDialogView('查看报告详情', '${ctx}/projectcontentinfo/projectcontentinfo/form1?id=${projectReportData.id}','95%', '95%')">
+												${projectReportData.number}
+										</a></td>
+										<td>
+													${projectReportData.name}
+										</td>
+										<td title="${fns:getContentTypeName(projectReportData.type,"")}">
+												${fns:getContentTypeName(projectReportData.type,"")}
+										</td>
+										<td title="${projectReportData.reportType}">
+												${projectReportData.reportType}
+										</td>
+										<td>
+											<fmt:formatDate value="${projectReportData.reportDate}" pattern="yyyy-MM-dd"/>
+										</td>
+										<td class="op-td">
+												<%--<c:choose>--%>
+												<%--<c:when test="${empty projectReportData.status || projectReportData.status eq 1}">--%>
+												<%--<div style="text-align: center">--%>
+												<%--<a href="javascript:void(0)" class="op-btn op-btn-trace" >${fns:getDictLabel(projectReportData.status, 'audit_state', '')}</a>--%>
+												<%--</div>--%>
+												<%--</c:when>--%>
+												<%--<c:otherwise>--%>
+												<%--<div style="text-align: center">--%>
+												<%--<a href="javascript:void(0)" onclick="openDialogView('流程追踪', '${ctx}/projectcontentinfo/projectcontentinfo/getProcessOne?id=${id}&projectReportData.id=${projectReportData.id}&type=1','95%','95%')" class="op-btn op-btn-trace" >${fns:getDictLabel(projectReportData.status, 'audit_state', '')}</a>--%>
+												<%--</div>--%>
+												<%--</c:otherwise>--%>
+												<%--</c:choose>--%>
+											<div style="text-align: center" id="status_td_${index.index+1}">
+											</div>
+											<script>
+												initRecordStatus(${index.index+1},"${id}","${projectReportData.id}","${projectReportData.status}");
+											</script>
+										</td>
+									</tr>
+								</c:forEach>
+							</c:when>
+							<c:otherwise>
+								<tr>
+									<td colspan="7">
+										暂无数据
+									</td>
+								</tr>
+							</c:otherwise>
+						</c:choose>
+						</tbody>
+					</table>
+				</div>
+			</div>
+
+			<div class="form-group layui-row page-end"></div>
+		</form:form>
+	</div>
+</div>
+</body>
+</html>