Sfoglia il codice sorgente

Merge remote-tracking branch 'origin/master'

[user3] 3 anni fa
parent
commit
cf55896289
16 ha cambiato i file con 2505 aggiunte e 13 eliminazioni
  1. 24 0
      src/main/java/com/jeeplus/modules/pojectMaterialsWarehouse/dao/ProjectMaterialCollectDao.java
  2. 128 0
      src/main/java/com/jeeplus/modules/pojectMaterialsWarehouse/entity/ProjectMaterialCollectInfo.java
  3. 143 0
      src/main/java/com/jeeplus/modules/pojectMaterialsWarehouse/service/ProjectMaterialCollectService.java
  4. 291 0
      src/main/java/com/jeeplus/modules/pojectMaterialsWarehouse/web/PojectMaterialsWarehouseController.java
  5. 45 12
      src/main/java/com/jeeplus/modules/ruralprojectrecords/service/RuralProjectMessageElectronicSealService.java
  6. 28 0
      src/main/java/com/jeeplus/modules/workmaterialcollect/entity/WorkMaterialCollectType.java
  7. 1 1
      src/main/resources/freemarker/projectSignature.ftl
  8. 239 0
      src/main/resources/mappings/modules/pojectMaterialsWarehouse/ProjectMaterialsWarehouseDao.xml
  9. 18 0
      src/main/webapp/WEB-INF/tags/table/projectMaterialsWarehouseAddRow.tag
  10. 18 0
      src/main/webapp/WEB-INF/tags/table/singleProjectAddRow.tag
  11. 157 0
      src/main/webapp/webpage/modules/pojectMaterialsWarehouse/projectMaterialCollectForm.jsp
  12. 478 0
      src/main/webapp/webpage/modules/pojectMaterialsWarehouse/projectMaterialCollectInfoList.jsp
  13. 398 0
      src/main/webapp/webpage/modules/pojectMaterialsWarehouse/projectMaterialCollectInfoView.jsp
  14. 155 0
      src/main/webapp/webpage/modules/pojectMaterialsWarehouse/projectMaterialsWarehouseForm.jsp
  15. 381 0
      src/main/webapp/webpage/modules/pojectMaterialsWarehouse/projectMaterialsWarehouseList.jsp
  16. 1 0
      src/main/webapp/webpage/modules/workcontractinfo/workContractInfoAdminForm.jsp

+ 24 - 0
src/main/java/com/jeeplus/modules/pojectMaterialsWarehouse/dao/ProjectMaterialCollectDao.java

@@ -0,0 +1,24 @@
+package com.jeeplus.modules.pojectMaterialsWarehouse.dao;
+
+import com.jeeplus.common.persistence.CrudDao;
+import com.jeeplus.common.persistence.annotation.MyBatisDao;
+import com.jeeplus.modules.pojectMaterialsWarehouse.entity.ProjectMaterialCollectInfo;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+
+/**
+ * @author: 徐滕
+ * @create: 2021-11-22 14:08
+ **/
+@MyBatisDao
+public interface ProjectMaterialCollectDao extends CrudDao<ProjectMaterialCollectInfo> {
+    /**
+     * 批量导入数据信息
+     * @param materialCollectList
+     * @return
+     */
+    Integer insertList(@Param("list") List<ProjectMaterialCollectInfo> materialCollectList);
+
+    void deleteListById(@Param("list") List<String> idList);
+}

+ 128 - 0
src/main/java/com/jeeplus/modules/pojectMaterialsWarehouse/entity/ProjectMaterialCollectInfo.java

@@ -0,0 +1,128 @@
+package com.jeeplus.modules.pojectMaterialsWarehouse.entity;
+
+import com.jeeplus.common.persistence.DataEntity;
+import com.jeeplus.common.utils.excel.annotation.ExcelField;
+
+import java.util.Date;
+
+/**
+ * @author: 徐滕
+ * @create: 2021-11-22 13:59
+ **/
+public class ProjectMaterialCollectInfo extends DataEntity<ProjectMaterialCollectInfo> {
+    private String projectId;       //项目id
+    private String projectName;     //项目名称
+    private String materialName;    //材料名称
+    private String specifications;  //规格
+    private String unit;            //单位
+    private String userTheParts;    //使用部位
+    private String excludingTax;    //除税市场价
+    private String projectType;     //工程类型
+    private String projectPart;     //工程部位
+    private String projectSite;     //工程地点
+    private Date startDate;         //工程开始时间
+    private Date endDate;           //工程结束时间
+
+    public String getProjectId() {
+        return projectId;
+    }
+
+    public void setProjectId(String projectId) {
+        this.projectId = projectId;
+    }
+
+    public String getProjectName() {
+        return projectName;
+    }
+
+    public void setProjectName(String projectName) {
+        this.projectName = projectName;
+    }
+
+    @ExcelField(title="材料名称", align=2, sort=1)
+    public String getMaterialName() {
+        return materialName;
+    }
+
+    public void setMaterialName(String materialName) {
+        this.materialName = materialName;
+    }
+
+    @ExcelField(title="规格", align=2, sort=2)
+    public String getSpecifications() {
+        return specifications;
+    }
+
+    public void setSpecifications(String specifications) {
+        this.specifications = specifications;
+    }
+
+    @ExcelField(title="单位", align=2, sort=3)
+    public String getUnit() {
+        return unit;
+    }
+
+    public void setUnit(String unit) {
+        this.unit = unit;
+    }
+
+    @ExcelField(title="使用部位", align=2, sort=5)
+    public String getUserTheParts() {
+        return userTheParts;
+    }
+
+    public void setUserTheParts(String userTheParts) {
+        this.userTheParts = userTheParts;
+    }
+
+    @ExcelField(title="除税市场价", align=2, sort=4)
+    public String getExcludingTax() {
+        return excludingTax;
+    }
+
+    public void setExcludingTax(String excludingTax) {
+        this.excludingTax = excludingTax;
+    }
+
+    //@ExcelField(title="工程类型", align=2, sort=6,mainDictType = "work_material_engineer_type")
+    public String getProjectType() {
+        return projectType;
+    }
+
+    public void setProjectType(String projectType) {
+        this.projectType = projectType;
+    }
+
+    //@ExcelField(title="工程部位", align=2, sort=7,mainDictType = "work_material_engineer_part1")
+    public String getProjectPart() {
+        return projectPart;
+    }
+
+    public void setProjectPart(String projectPart) {
+        this.projectPart = projectPart;
+    }
+
+    public Date getStartDate() {
+        return startDate;
+    }
+
+    public void setStartDate(Date startDate) {
+        this.startDate = startDate;
+    }
+
+    public Date getEndDate() {
+        return endDate;
+    }
+
+    public void setEndDate(Date endDate) {
+        this.endDate = endDate;
+    }
+
+    public String getProjectSite() {
+        return projectSite;
+    }
+
+    public void setProjectSite(String projectSite) {
+        this.projectSite = projectSite;
+    }
+}

+ 143 - 0
src/main/java/com/jeeplus/modules/pojectMaterialsWarehouse/service/ProjectMaterialCollectService.java

@@ -0,0 +1,143 @@
+package com.jeeplus.modules.pojectMaterialsWarehouse.service;
+
+import com.jeeplus.common.persistence.Page;
+import com.jeeplus.common.service.CrudService;
+import com.jeeplus.common.utils.StringUtils;
+import com.jeeplus.modules.pojectMaterialsWarehouse.dao.ProjectMaterialCollectDao;
+import com.jeeplus.modules.pojectMaterialsWarehouse.entity.ProjectMaterialCollectInfo;
+import com.jeeplus.modules.sys.utils.DictUtils;
+import com.jeeplus.modules.workmaterialcollect.entity.WorkMaterialCollectType;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+
+import java.util.List;
+
+/**
+ * @author: 徐滕
+ * @create: 2021-11-22 14:07
+ **/
+
+@Service
+@Transactional(readOnly = true)
+public class ProjectMaterialCollectService extends CrudService<ProjectMaterialCollectDao, ProjectMaterialCollectInfo> {
+
+    public Page<ProjectMaterialCollectInfo> findPage(Page<ProjectMaterialCollectInfo> page, ProjectMaterialCollectInfo projectMaterialCollectInfo) {
+        Integer queryCount = dao.queryCount(projectMaterialCollectInfo);
+        page.setCount(queryCount);
+        page.setCountFlag(false);
+        projectMaterialCollectInfo.setPage(page);
+        List<ProjectMaterialCollectInfo> list = dao.findList(projectMaterialCollectInfo);
+        for (ProjectMaterialCollectInfo info : list) {
+            info.setProjectType(DictUtils.getMainDictLabel(info.getProjectType(), "work_material_engineer_type", ""));
+            info.setProjectPart(DictUtils.getMainDictLabel(info.getProjectPart(), "work_material_engineer_part1", ""));
+        }
+        page.setList(list);
+        return page;
+    }
+
+    /**
+     * 新增数据
+     * @param workMaterialCollectType
+     * @param materialCollects
+     */
+    @Transactional(readOnly = false)
+    public String save(WorkMaterialCollectType workMaterialCollectType, List<ProjectMaterialCollectInfo> materialCollects){
+        //根据项目id查询项目信息
+        for (ProjectMaterialCollectInfo info: materialCollects) {
+            if(StringUtils.isNotBlank(info.getMaterialName())
+                    && StringUtils.isNotBlank(info.getMaterialName())
+                    && StringUtils.isNotBlank(info.getSpecifications())
+                    && StringUtils.isNotBlank(info.getUnit())
+                    && StringUtils.isNotBlank(info.getUserTheParts())
+                    && StringUtils.isNotBlank(info.getExcludingTax())){
+                info.setProjectType(workMaterialCollectType.getProjectType());
+                info.setProjectPart(workMaterialCollectType.getProjectPart());
+                info.setProjectId(workMaterialCollectType.getProjectId());
+                info.setStartDate(workMaterialCollectType.getStartDate());
+                info.setEndDate(workMaterialCollectType.getEndDate());
+                info.preInsert();
+            }else {
+                return "输变电项目材料文件数据填写不正确";
+            }
+        }
+        insertAllProjectMaterialCollectInfo(materialCollects);
+        return "保存成功!";
+    }
+
+    /**
+     * 新增数据(单条)
+     * @param info
+     */
+    @Transactional(readOnly = false)
+    public String singleSave(ProjectMaterialCollectInfo info){
+        //根据项目id查询项目信息
+        if(StringUtils.isNotBlank(info.getMaterialName())
+                && StringUtils.isNotBlank(info.getMaterialName())
+                && StringUtils.isNotBlank(info.getSpecifications())
+                && StringUtils.isNotBlank(info.getUnit())
+                && StringUtils.isNotBlank(info.getUserTheParts())
+                && StringUtils.isNotBlank(info.getExcludingTax())){
+            if(StringUtils.isBlank(info.getId())){
+                info.preInsert();
+                dao.insert(info);
+            }else{
+                info.preUpdate();
+                dao.update(info);
+            }
+        }else {
+            return "输变电项目材料文件数据填写不正确";
+        }
+        return "保存成功!";
+    }
+
+    /**
+     * 批量新增数据信息
+     * @param materialCollectList
+     * @return
+     */
+    @Transactional(readOnly = false)
+    public String insertAllProjectMaterialCollectInfo(List<ProjectMaterialCollectInfo> materialCollectList){
+        //分批处理
+        if(null!=materialCollectList && materialCollectList.size()>0){
+            int pointsDataLimit = 100;//限制条数
+            Integer size = materialCollectList.size();
+            //判断是否有必要分批
+            if(pointsDataLimit<size){
+                int part = size/pointsDataLimit;//分批数
+                //
+                for (int i = 0; i < part; i++) {
+                    //100条
+                    List<ProjectMaterialCollectInfo> listPage = materialCollectList.subList(0, pointsDataLimit);
+                    dao.insertList(listPage);
+                    //剔除
+                    materialCollectList.subList(0, pointsDataLimit).clear();
+                }
+                if(!materialCollectList.isEmpty()){
+                    dao.insertList(materialCollectList);
+                }
+            }else{
+                dao.insertList(materialCollectList);
+            }
+        }
+        return null;
+    }
+
+    /**
+     * 单条数据删除
+     * @param projectMaterialCollectInfo
+     */
+    @Transactional(readOnly = false)
+    public void delete(ProjectMaterialCollectInfo projectMaterialCollectInfo){
+        dao.delete(projectMaterialCollectInfo);
+    }
+
+    /**
+     * 多条数据删除
+     * @param idList
+     */
+    @Transactional(readOnly = false)
+    public void deleteListById(List<String> idList){
+        dao.deleteListById(idList);
+    }
+
+}

+ 291 - 0
src/main/java/com/jeeplus/modules/pojectMaterialsWarehouse/web/PojectMaterialsWarehouseController.java

@@ -0,0 +1,291 @@
+package com.jeeplus.modules.pojectMaterialsWarehouse.web;
+
+import com.google.common.collect.Lists;
+import com.jeeplus.common.config.Global;
+import com.jeeplus.common.json.AjaxJson;
+import com.jeeplus.common.persistence.Page;
+import com.jeeplus.common.utils.StringUtils;
+import com.jeeplus.common.utils.excel.ExportExcel;
+import com.jeeplus.common.utils.excel.ImportExcel;
+import com.jeeplus.common.web.BaseController;
+import com.jeeplus.modules.pojectMaterialsWarehouse.entity.ProjectMaterialCollectInfo;
+import com.jeeplus.modules.pojectMaterialsWarehouse.service.ProjectMaterialCollectService;
+import com.jeeplus.modules.projectcontentinfo.entity.Projectcontentinfo;
+import com.jeeplus.modules.projectcontentinfo.service.ProjectcontentinfoService;
+import com.jeeplus.modules.projectrecord.entity.ProjectRecords;
+import com.jeeplus.modules.projectrecord.service.ProjectRecordsService;
+import com.jeeplus.modules.sys.utils.UserUtils;
+import com.jeeplus.modules.workclientinfo.entity.WorkClientLinkman;
+import com.jeeplus.modules.workcontractinfo.entity.WorkContractInfo;
+import com.jeeplus.modules.workmaterialcollect.entity.WorkMaterialCollectTotal;
+import com.jeeplus.modules.workmaterialcollect.entity.WorkMaterialCollectType;
+import org.activiti.engine.HistoryService;
+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.util.Arrays;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * @author: 徐滕
+ * @create: 2021-11-22 09:12
+ **/
+@Controller
+@RequestMapping(value = "${adminPath}/project/projectMaterialsWarehouse")
+public class PojectMaterialsWarehouseController extends BaseController {
+
+    @Autowired
+    private ProjectRecordsService projectRecordsService;
+    @Autowired
+    protected HistoryService historyService;
+    @Autowired
+    private ProjectcontentinfoService projectcontentinfoService;
+    @Autowired
+    private ProjectMaterialCollectService projectMaterialCollectService;
+
+
+    /**
+     * 项目列表页面
+     * @param projectRecords
+     * @param request
+     * @param response
+     * @param model
+     * @return
+     */
+    @RequiresPermissions("project:pojectMaterialsWarehouse:list")
+    @RequestMapping(value = {"list", ""})
+    public String list(ProjectRecords projectRecords, HttpServletRequest request, HttpServletResponse response, Model model) {
+        if(UserUtils.isManager()){
+            model.addAttribute("flag","1");
+        }
+        projectRecords.setProjectStatus(5);
+        Page<ProjectRecords> page = projectRecordsService.findPage(new Page<ProjectRecords>(request, response), projectRecords);
+        //无合同状态下,获取委托方的名称
+        List<ProjectRecords> list = page.getList();
+        for (int i = 0; i < list.size(); i++) {
+            ProjectRecords 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);
+                }
+            }
+        }
+        for (ProjectRecords record : list) {
+            Projectcontentinfo select = new Projectcontentinfo();
+            ProjectRecords project = new ProjectRecords();
+            project.setId(record.getId());
+            select.setParentIds("0,");
+            select.setProject(project);
+            List<Projectcontentinfo> p = projectcontentinfoService.findListByProject(select);
+            //添加工作内容id
+            if(p.size()>0){
+                record.setContentPId(p.get(0).getId());
+                record.setParentIds("0,");
+                record.setDictType("");
+            }
+        }
+        model.addAttribute("page", page);
+        return "modules/pojectMaterialsWarehouse/projectMaterialsWarehouseList";
+    }
+
+    /**
+     * 子项目信息查看
+     * @param projectMaterialCollectInfo
+     * @param request
+     * @param response
+     * @param model
+     * @return
+     */
+    @RequestMapping(value = "particularsList")
+    public String particularsList(ProjectMaterialCollectInfo projectMaterialCollectInfo, HttpServletRequest request, HttpServletResponse response, Model model) {
+        Page<ProjectMaterialCollectInfo> page = projectMaterialCollectService.findPage(new Page<ProjectMaterialCollectInfo>(request, response), projectMaterialCollectInfo);
+
+        model.addAttribute("page", page);
+        model.addAttribute("projectId", projectMaterialCollectInfo.getProjectId());
+        model.addAttribute("startDate", projectMaterialCollectInfo.getStartDate());
+        model.addAttribute("endDate", projectMaterialCollectInfo.getEndDate());
+        return "modules/pojectMaterialsWarehouse/projectMaterialCollectInfoList";
+    }
+
+    /**
+     * 子项目信息查看
+     * @param projectMaterialCollectInfo
+     * @param request
+     * @param response
+     * @param model
+     * @return
+     */
+    @RequestMapping(value = "particularsListView")
+    public String particularsListView(ProjectMaterialCollectInfo projectMaterialCollectInfo, HttpServletRequest request, HttpServletResponse response, Model model) {
+        Page<ProjectMaterialCollectInfo> page = projectMaterialCollectService.findPage(new Page<ProjectMaterialCollectInfo>(request, response), projectMaterialCollectInfo);
+
+        model.addAttribute("page", page);
+        model.addAttribute("projectId", projectMaterialCollectInfo.getProjectId());
+        model.addAttribute("startDate", projectMaterialCollectInfo.getStartDate());
+        model.addAttribute("endDate", projectMaterialCollectInfo.getEndDate());
+        return "modules/pojectMaterialsWarehouse/projectMaterialCollectInfoView";
+    }
+
+    /**
+     * 跳转导入上传页面
+     * @param workMaterialCollectType
+     * @param model
+     * @return
+     */
+    @RequestMapping(value = "form")
+    public String form(WorkMaterialCollectType workMaterialCollectType, Model model) {
+        model.addAttribute("workMaterialCollectType", workMaterialCollectType);
+        return "modules/pojectMaterialsWarehouse/projectMaterialsWarehouseForm";
+    }
+
+    /**
+     * 跳转单条数据添加页面
+     * @param projectMaterialCollectInfo
+     * @param model
+     * @return
+     */
+    @RequestMapping(value = "singleForm")
+    public String singleForm(ProjectMaterialCollectInfo projectMaterialCollectInfo, Model model) {
+        if(StringUtils.isNotBlank(projectMaterialCollectInfo.getId())){
+            projectMaterialCollectInfo = projectMaterialCollectService.get(projectMaterialCollectInfo.getId());
+        }
+        model.addAttribute("projectMaterialCollectInfo", projectMaterialCollectInfo);
+        return "modules/pojectMaterialsWarehouse/projectMaterialCollectForm";
+    }
+
+
+    @RequestMapping(value = "save",method= RequestMethod.POST)
+    @ResponseBody
+    public Object save(WorkMaterialCollectType workMaterialCollectType, @RequestParam(value = "file",required = false) MultipartFile file, Model model, RedirectAttributes redirectAttributes) {
+        Map<String,Object> map = new HashMap<>();
+        map.put("success",false);
+        try {
+            if(null == file){
+                map.put("str","没有上传输变电项目材料文件");
+                return map;
+            }
+            if(StringUtils.isBlank(workMaterialCollectType.getProjectId())){
+                map.put("str","没有找到关联项目信息");
+                return map;
+            }
+            if(StringUtils.isBlank(workMaterialCollectType.getProjectType())){
+                map.put("str","工程类型未选择");
+                return map;
+            }
+            if(StringUtils.isBlank(workMaterialCollectType.getProjectPart())){
+                map.put("str","工程部位未选择");
+                return map;
+            }
+            if(null == workMaterialCollectType.getStartDate() || null == workMaterialCollectType.getEndDate()){
+                map.put("str","工程日期未填写");
+                return map;
+            }
+            ImportExcel ei = new ImportExcel(file, 1, 0);
+            List<ProjectMaterialCollectInfo> materialCollects = ei.getDataList(ProjectMaterialCollectInfo.class);
+            String saveResult = projectMaterialCollectService.save(workMaterialCollectType, materialCollects);
+            map.put("str",saveResult);
+            map.put("success",true);
+        } catch (Exception e) {
+            addMessage(redirectAttributes, "上传输变电项目材料信息失败!失败信息:"+e.getMessage());
+            map.put("str","保存输变电项目材料信息失败");
+            map.put("success",false);
+        }
+        return map;
+    }
+
+    @RequestMapping(value = "singleSave",method= RequestMethod.POST)
+    @ResponseBody
+    public Object singleSave(ProjectMaterialCollectInfo projectMaterialCollectInfo, RedirectAttributes redirectAttributes) {
+        Map<String,Object> map = new HashMap<>();
+        map.put("success",false);
+        try {
+            if(StringUtils.isBlank(projectMaterialCollectInfo.getProjectId())){
+                map.put("str","没有找到关联项目信息");
+                return map;
+            }
+            if(StringUtils.isBlank(projectMaterialCollectInfo.getProjectType())){
+                map.put("str","工程类型未选择");
+                return map;
+            }
+            if(StringUtils.isBlank(projectMaterialCollectInfo.getProjectPart())){
+                map.put("str","工程部位未选择");
+                return map;
+            }
+            if(null == projectMaterialCollectInfo.getStartDate() || null == projectMaterialCollectInfo.getEndDate()){
+                map.put("str","工程日期未填写");
+                return map;
+            }
+            String saveResult = projectMaterialCollectService.singleSave(projectMaterialCollectInfo);
+            map.put("str",saveResult);
+            map.put("success",true);
+        } catch (Exception e) {
+            addMessage(redirectAttributes, "保存输变电项目材料信息失败!失败信息:"+e.getMessage());
+            map.put("str","保存输变电项目材料信息失败");
+            map.put("success",false);
+        }
+        return map;
+    }
+
+    /**
+     * 单个删除
+     * @param projectMaterialCollectInfo
+     * @param redirectAttributes
+     * @return
+     */
+    @RequestMapping(value = "delete")
+    @ResponseBody
+    public Object delete(ProjectMaterialCollectInfo projectMaterialCollectInfo, RedirectAttributes redirectAttributes){
+        Map<String,Object> map = new HashMap<>();
+        projectMaterialCollectService.delete(projectMaterialCollectInfo);
+        map.put("success",true);
+        map.put("str","输变电项目材料信息删除成功");
+        return map;
+    }
+
+    /**
+     * 批量删除
+     * @param listId
+     * @return
+     */
+    @RequestMapping(value = "deleteAll")
+    @ResponseBody
+    public Object deleteAll(String listId){
+        List<String> idList = Arrays.asList(listId.split(","));
+        Map<String,Object> map = new HashMap<>();
+        projectMaterialCollectService.deleteListById(idList);
+        map.put("success",true);
+        map.put("str","输变电项目材料信息删除成功");
+        return map;
+    }
+
+
+    /**
+     * 下载导入领用申请数据模板
+     */
+    @RequiresPermissions("project:pojectMaterialsWarehouse:import")
+    @RequestMapping(value = "import/template")
+    public String importFileTemplate(HttpServletResponse response, RedirectAttributes redirectAttributes) {
+        try {
+            String fileName = "输变电项目材料确认单模板.xlsx";
+            List<ProjectMaterialCollectInfo> list = Lists.newArrayList();
+            new ExportExcel("输变电项目材料确认单", ProjectMaterialCollectInfo.class, 1).setDataList(list).write(response, fileName).dispose();
+            return null;
+        } catch (Exception e) {
+            addMessage(redirectAttributes, "下载模板下载失败!失败信息:"+e.getMessage());
+        }
+        return "redirect:"+ Global.getAdminPath()+"/project/projectMaterialsWarehouse/?repage";
+    }
+}

+ 45 - 12
src/main/java/com/jeeplus/modules/ruralprojectrecords/service/RuralProjectMessageElectronicSealService.java

@@ -65,6 +65,8 @@ import java.math.BigDecimal;
 import java.text.DecimalFormat;
 import java.text.SimpleDateFormat;
 import java.util.*;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
 
 /**
  * @author: 徐滕
@@ -1893,12 +1895,16 @@ public class RuralProjectMessageElectronicSealService extends CrudService<RuralP
         }
         //合同总价
         if(null != projectReportSignatureInfo && StringUtils.isNotBlank(projectReportSignatureInfo.getTotalContractPrice())){
-            // 四舍五入
-            BigDecimal value = new BigDecimal(projectReportSignatureInfo.getTotalContractPrice()).setScale(2,BigDecimal.ROUND_HALF_UP);
-            // 不足两位小数补0
-            DecimalFormat decimalFormat = new DecimalFormat("0.00#");
-            String strVal = decimalFormat.format(value);
-            data.put("contractAllMoney",strVal);
+            if(isNumeric(projectReportSignatureInfo.getTotalContractPrice())){
+                // 四舍五入
+                BigDecimal value = new BigDecimal(projectReportSignatureInfo.getTotalContractPrice()).setScale(2,BigDecimal.ROUND_HALF_UP);
+                // 不足两位小数补0
+                DecimalFormat decimalFormat = new DecimalFormat("0.00#");
+                String strVal = decimalFormat.format(value);
+                data.put("contractAllMoney",strVal);
+            }else{
+                data.put("contractAllMoney",projectReportSignatureInfo.getTotalContractPrice());
+            }
         }else{
             data.put("contractAllMoney","");
         }
@@ -2042,12 +2048,16 @@ public class RuralProjectMessageElectronicSealService extends CrudService<RuralP
         }
         //合同金额
         if(null != projectReportSignatureInfo && StringUtils.isNotBlank(projectReportSignatureInfo.getTotalContractPrice())){
-            // 四舍五入
-            BigDecimal value = new BigDecimal(projectReportSignatureInfo.getTotalContractPrice()).setScale(2,BigDecimal.ROUND_HALF_UP);
-            // 不足两位小数补0
-            DecimalFormat decimalFormat = new DecimalFormat("0.00#");
-            String strVal = decimalFormat.format(value);
-            data.put("contractMoney",strVal);
+            if(isNumeric(projectReportSignatureInfo.getTotalContractPrice())){
+                // 四舍五入
+                BigDecimal value = new BigDecimal(projectReportSignatureInfo.getTotalContractPrice()).setScale(2,BigDecimal.ROUND_HALF_UP);
+                // 不足两位小数补0
+                DecimalFormat decimalFormat = new DecimalFormat("0.00#");
+                String strVal = decimalFormat.format(value);
+                data.put("contractMoney",strVal);
+            }else{
+                data.put("contractMoney",projectReportSignatureInfo.getTotalContractPrice());
+            }
         }else{
             data.put("contractMoney","");
         }
@@ -2239,6 +2249,21 @@ public class RuralProjectMessageElectronicSealService extends CrudService<RuralP
     }
 
     /**
+     * 判断字符串是不是double型
+     * @param str
+     * @return
+     */
+    public static boolean isNumeric(String str){
+        Pattern pattern = Pattern.compile("[0-9]+[.]{0,1}[0-9]*[dD]{0,1}");
+        Matcher isNum = pattern.matcher(str);
+        if( !isNum.matches() ){
+            return false;
+        }
+        return true;
+    }
+
+
+    /**
      * 将文件上传到阿里云中
      * @param projectReportData
      */
@@ -2482,6 +2507,14 @@ public class RuralProjectMessageElectronicSealService extends CrudService<RuralP
     * */
     public void updateProjectReportSignatureInfo(ProjectReportSignatureInfo projectReportSignatureInfo){
         dao.updateProjectReportSignatureInfo(projectReportSignatureInfo);
+        //删除对应文件的附件信息
+        //根据报告号查询项目信息
+        ProjectReportData reportInfo = projectReportDataService.findByNum(projectReportSignatureInfo.getProjectReportId());
+        Workattachment workClientAttachment = new Workattachment();
+        workClientAttachment.setAttachmentFlag("145");
+        workClientAttachment.setAttachmentId(projectReportSignatureInfo.getId());
+        workClientAttachment.setProjectId(reportInfo.getProject().getId());
+        workattachmentService.deleteWorkattachment(workClientAttachment);
     }
 
     /*

+ 28 - 0
src/main/java/com/jeeplus/modules/workmaterialcollect/entity/WorkMaterialCollectType.java

@@ -4,6 +4,7 @@ import com.jeeplus.common.persistence.DataEntity;
 import com.jeeplus.modules.sys.entity.Workattachment;
 import com.jeeplus.modules.workclientinfo.entity.WorkClientAttachment;
 
+import java.util.Date;
 import java.util.List;
 
 public class WorkMaterialCollectType extends DataEntity<WorkMaterialCollectType> {
@@ -12,6 +13,9 @@ public class WorkMaterialCollectType extends DataEntity<WorkMaterialCollectType>
     private String attachmentId;//文件上传id;
     private String status;//状态;
     private String engineerId;//关联id;
+    private String projectId;//项目id;
+    private Date startDate;//开始时间;
+    private Date endDate;//结束时间;
 
     private WorkMaterialCollectEngineer workMaterialCollectEngineer;
 
@@ -74,4 +78,28 @@ public class WorkMaterialCollectType extends DataEntity<WorkMaterialCollectType>
     public void setWorkattachment(Workattachment workattachment) {
         this.workattachment = workattachment;
     }
+
+    public String getProjectId() {
+        return projectId;
+    }
+
+    public void setProjectId(String projectId) {
+        this.projectId = projectId;
+    }
+
+    public Date getStartDate() {
+        return startDate;
+    }
+
+    public void setStartDate(Date startDate) {
+        this.startDate = startDate;
+    }
+
+    public Date getEndDate() {
+        return endDate;
+    }
+
+    public void setEndDate(Date endDate) {
+        this.endDate = endDate;
+    }
 }

+ 1 - 1
src/main/resources/freemarker/projectSignature.ftl

@@ -5727,7 +5727,7 @@
 						<w:spacing w:val="34"/>
 						<w:sz w:val="30"/>
 					</w:rPr>
-					<w:t>:   </w:t>
+					<w:t></w:t>
 				</w:r>
 				<w:r>
 					<w:rPr>

+ 239 - 0
src/main/resources/mappings/modules/pojectMaterialsWarehouse/ProjectMaterialsWarehouseDao.xml

@@ -0,0 +1,239 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.jeeplus.modules.pojectMaterialsWarehouse.dao.ProjectMaterialCollectDao">
+
+	<sql id="workMaterialCollectTotal">
+		a.id AS "id",
+		a.create_by AS "createBy.id",
+		a.create_date AS "createDate",
+		a.update_by AS "updateBy.id",
+		a.update_date AS "updateDate",
+		a.remarks AS "remarks",
+		a.del_flag AS "delFlag",
+		a.projectId AS "projectId",
+		a.materialName AS "materialName",
+		a.specifications AS "specifications",
+		a.unit AS "unit",
+		a.userTheParts AS "userTheParts",
+		a.excludingTax AS "excludingTax",
+		a.projectType AS "projectType",
+		a.projectPart AS "projectPart",
+		a.start_date as "startDate",
+		a.end_date as "endDate"
+	</sql>
+
+	<select id="get" resultType="com.jeeplus.modules.pojectMaterialsWarehouse.entity.ProjectMaterialCollectInfo" >
+		SELECT
+			<include refid="workMaterialCollectTotal"/>
+		FROM project_material_collect_info a
+		WHERE a.id = #{id}
+	</select>
+
+	<select id="findList" resultType="com.jeeplus.modules.pojectMaterialsWarehouse.entity.ProjectMaterialCollectInfo" >
+		SELECT
+			<include refid="workMaterialCollectTotal"/>
+			,rpr.project_name as "projectName"
+			,area.name AS "projectSite"
+		FROM project_material_collect_info a
+		left join rural_project_records rpr on rpr.id = a.projectId
+		LEFT JOIN sys_area area ON area.id = rpr.area_id
+		<where>
+			a.del_flag = #{DEL_FLAG_NORMAL}
+			<if test="materialName != null and materialName != ''">
+				AND a.materialName LIKE
+				<if test="dbName == 'oracle'">'%'||#{materialName}||'%'</if>
+				<if test="dbName == 'mssql'">'%'+#{materialName}+'%'</if>
+				<if test="dbName == 'mysql'">concat('%',#{materialName},'%')</if>
+			</if>
+			<if test="projectType != null and projectType != ''">
+				AND a.projectType = #{projectType}
+			</if>
+			<if test="projectPart != null and projectPart != ''">
+				AND a.projectPart = #{projectPart}
+			</if>
+			<if test="projectId != null and projectId != ''">
+				AND a.projectId = #{projectId}
+			</if>
+			<if test="projectName != null and projectName != ''">
+				AND rpr.project_name LIKE
+				<if test="dbName == 'oracle'">'%'||#{projectName}||'%'</if>
+				<if test="dbName == 'mssql'">'%'+#{projectName}+'%'</if>
+				<if test="dbName == 'mysql'">concat('%',#{projectName},'%')</if>
+			</if>
+			<if test="startDate != null and startDate != ''">
+				AND a.start_date &gt;= #{startDate}
+			</if>
+			<if test="endDate != null and endDate != ''">
+				AND a.end_date &lt;= #{endDate}
+			</if>
+		</where>
+		<choose>
+			<when test="page !=null and page.orderBy != null and page.orderBy != ''">
+				ORDER BY ${page.orderBy}
+			</when>
+			<otherwise>
+				ORDER BY a.update_date DESC
+			</otherwise>
+		</choose>
+	</select>
+
+	<select id="queryCount" resultType="java.lang.Integer" >
+		SELECT
+			count(1)
+		FROM project_material_collect_info a
+		left join rural_project_records rpr on rpr.id = a.projectId
+		LEFT JOIN sys_area area ON area.id = rpr.area_id
+		<where>
+			a.del_flag = #{DEL_FLAG_NORMAL}
+			<if test="materialName != null and materialName != ''">
+				AND a.materialName LIKE
+				<if test="dbName == 'oracle'">'%'||#{materialName}||'%'</if>
+				<if test="dbName == 'mssql'">'%'+#{materialName}+'%'</if>
+				<if test="dbName == 'mysql'">concat('%',#{materialName},'%')</if>
+			</if>
+			<if test="projectType != null and projectType != ''">
+				AND a.projectType = #{projectType}
+			</if>
+			<if test="projectPart != null and projectPart != ''">
+				AND a.projectPart = #{projectPart}
+			</if>
+			<if test="projectId != null and projectId != ''">
+				AND a.projectId = #{projectId}
+			</if>
+			<if test="projectName != null and projectName != ''">
+				AND rpr.project_name LIKE
+				<if test="dbName == 'oracle'">'%'||#{projectName}||'%'</if>
+				<if test="dbName == 'mssql'">'%'+#{projectName}+'%'</if>
+				<if test="dbName == 'mysql'">concat('%',#{projectName},'%')</if>
+			</if>
+			<if test="startDate != null and startDate != ''">
+				AND a.start_date &gt;= #{startDate}
+			</if>
+			<if test="endDate != null and endDate != ''">
+				AND a.end_date &lt;= #{endDate}
+			</if>
+		</where>
+	</select>
+
+	<insert id="insert">
+		INSERT INTO project_material_collect_info(
+			id,
+			create_by,
+			create_date,
+			update_by,
+			update_date,
+			remarks,
+			del_flag,
+			projectId,
+			materialName,
+			specifications,
+			unit,
+			userTheParts,
+			excludingTax,
+			projectType,
+			projectPart,
+			start_date,
+			end_date
+		) VALUES (
+			#{id},
+			#{createBy.id},
+			#{createDate},
+			#{updateBy.id},
+			#{updateDate},
+			#{remarks},
+			#{delFlag},
+			#{projectId},
+			#{materialName},
+			#{specifications},
+			#{unit},
+			#{userTheParts},
+			#{excludingTax},
+			#{projectType},
+			#{projectPart},
+			#{startDate},
+			#{endDate}
+		)
+	</insert>
+
+	<insert id="insertList">
+		insert INTO project_material_collect_info(
+			id,
+			create_by,
+			create_date,
+			update_by,
+			update_date,
+			remarks,
+			del_flag,
+			projectId,
+			materialName,
+			specifications,
+			unit,
+			userTheParts,
+			excludingTax,
+			projectType,
+			projectPart,
+			start_date,
+			end_date
+		) VALUES
+		<foreach collection="list" item="item" index="index" separator="," >
+			(
+			#{item.id},
+			#{item.createBy.id},
+			#{item.createDate},
+			#{item.updateBy.id},
+			#{item.updateDate},
+			#{item.remarks},
+			#{item.delFlag},
+			#{item.projectId},
+			#{item.materialName},
+			#{item.specifications},
+			#{item.unit},
+			#{item.userTheParts},
+			#{item.excludingTax},
+			#{item.projectType},
+			#{item.projectPart},
+			#{item.startDate},
+			#{item.endDate}
+			)
+		</foreach>
+	</insert>
+
+
+	<update id="update">
+		UPDATE project_material_collect_info SET
+			update_by = #{updateBy.id},
+			update_date = #{updateDate},
+			remarks = #{remarks},
+			materialName = #{materialName},
+			specifications = #{specifications},
+			unit = #{unit},
+			userTheParts = #{userTheParts},
+			excludingTax = #{excludingTax},
+			projectType = #{projectType},
+			projectPart = #{projectPart},
+			start_date = #{startDate},
+			end_date = #{endDate}
+		WHERE id = #{id}
+	</update>
+
+
+	<update id="updateRemarks">
+		UPDATE project_material_collect_info SET
+			remarks = #{remarks}
+		WHERE projectTypeId = #{id}
+	</update>
+
+	<!-- 批量删除确认单 -->
+	<delete id="deleteListById">
+		delete from project_material_collect_info where id in
+		<foreach collection="list" item="item" index="no" open="(" separator="," close=")">
+			  #{item}
+		</foreach>
+	</delete>
+	<!--物理删除-->
+	<update id="delete">
+		DELETE FROM project_material_collect_info
+		WHERE id = #{id}
+	</update>
+
+</mapper>

+ 18 - 0
src/main/webapp/WEB-INF/tags/table/projectMaterialsWarehouseAddRow.tag

@@ -0,0 +1,18 @@
+<%@ tag language="java" pageEncoding="UTF-8"%>
+<%@ include file="/webpage/include/taglib.jsp"%>
+<%@ attribute name="url" type="java.lang.String" required="true"%>
+<%@ attribute name="title" type="java.lang.String" required="true"%>
+<%@ attribute name="width" type="java.lang.String" required="false"%>
+<%@ attribute name="height" type="java.lang.String" required="false"%>
+<%@ attribute name="target" type="java.lang.String" required="false"%>
+<%@ attribute name="label" type="java.lang.String" required="false"%>
+<button class="layui-btn layui-btn-sm layui-bg-blue" data-toggle="tooltip" data-placement="left" onclick="add()" title="添加">
+<%--    <i class="fa fa-plus"></i> --%>
+    ${label==null?'添加':label}
+</button>
+<%-- 使用方法: 1.将本tag写在查询的form之前;2.传入table的id和controller的url --%>
+<script type="text/javascript">
+	function add(){
+		openDialog('${title}'+"登记",encodeURI("${url}"),"${width==null?'95%':width}", "${height==null?'95%':height}","${target}","inputForm"," layui-border-box");
+	}
+</script>

+ 18 - 0
src/main/webapp/WEB-INF/tags/table/singleProjectAddRow.tag

@@ -0,0 +1,18 @@
+<%@ tag language="java" pageEncoding="UTF-8"%>
+<%@ include file="/webpage/include/taglib.jsp"%>
+<%@ attribute name="url" type="java.lang.String" required="true"%>
+<%@ attribute name="title" type="java.lang.String" required="true"%>
+<%@ attribute name="width" type="java.lang.String" required="false"%>
+<%@ attribute name="height" type="java.lang.String" required="false"%>
+<%@ attribute name="target" type="java.lang.String" required="false"%>
+<%@ attribute name="label" type="java.lang.String" required="false"%>
+<button class="layui-btn layui-btn-sm layui-bg-blue" data-toggle="tooltip" data-placement="left" onclick="addSingle()" title="添加">
+<%--    <i class="fa fa-plus"></i> --%>
+    ${label==null?'添加':label}
+</button>
+<%-- 使用方法: 1.将本tag写在查询的form之前;2.传入table的id和controller的url --%>
+<script type="text/javascript">
+	function addSingle(){
+		openDialogSingle('${title}'+"登记",encodeURI("${url}"),"${width==null?'95%':width}", "${height==null?'95%':height}","${target}","inputForm"," layui-border-box");
+	}
+</script>

+ 157 - 0
src/main/webapp/webpage/modules/pojectMaterialsWarehouse/projectMaterialCollectForm.jsp

@@ -0,0 +1,157 @@
+<%@ page contentType="text/html;charset=UTF-8" %>
+<%@ include file="/webpage/include/taglib.jsp"%>
+
+<html>
+<head>
+    <title>项目管理</title>
+    <meta name="decorator" content="default"/>
+    <script type="text/javascript" src="${ctxStatic}/helloweba_editable-select/jquery.editable-select.min.js"></script>
+    <script type="text/javascript" src="${ctxStatic}/iCheck/icheck.min.js"></script>
+    <script type="text/javascript" src="${ctxStatic}/layui/layui.js"></script>
+    <script src="${ctxStatic}/common/html/js/script.js"></script>
+
+    <link rel='stylesheet' type="text/css" href="${ctxStatic}/helloweba_editable-select/jquery.editable-select.min.css"/>
+    <link rel='stylesheet' type="text/css" href="${ctxStatic}/layui/css/layui.css"/>
+
+    <style>
+        #projectDesc-error{
+            left:0;
+            top:82px;
+        }
+        .layui-layer-dialog{
+            background: #ff0000;
+        }
+        td input{
+            margin-left:-10px !important;
+            height: 42px !important;
+        }
+    </style>
+    <script type="text/javascript">
+        var validateForm;
+        var isMasterClient = true;//是否是委托方
+        var clientCount = 0;
+        function doSubmit(i){//回调函数,在编辑和保存动作时,供openDialog调用提交表单。
+            if(validateForm.form()){
+                if(i==2){
+                    $("#inputForm").attr("action","${ctx}/project/projectRecords/tstore");
+                }else if (i==1){
+                    var flags=judgment();
+                    if (!flags){
+                        return flags;
+                    }
+                }
+                $("#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);
+                    }
+                }
+            });
+
+            laydate.render({
+                elem: '#startDate', //目标元素。由于laydate.js封装了一个轻量级的选择器引擎,因此elem还允许你传入class、tag但必须按照这种方式 '#id .class'
+                event: 'focus', //响应事件。如果没有传入event,则按照默认的click
+                type : 'date'
+                , trigger: 'click'
+            });
+            laydate.render({
+                elem: '#endDate', //目标元素。由于laydate.js封装了一个轻量级的选择器引擎,因此elem还允许你传入class、tag但必须按照这种方式 '#id .class'
+                event: 'focus', //响应事件。如果没有传入event,则按照默认的click
+                type : 'date'
+                , trigger: 'click'
+            });
+        });
+    </script>
+</head>
+<body>
+<div class="single-form">
+    <div class="container">
+        <sys:message content="${message}"/>
+        <form:form id="inputForm" modelAttribute="projectMaterialCollectInfo" action="${ctx}/project/projectMaterialsWarehouse/singleSave" method="post" class="form-horizontal">
+            <form:hidden path="id"/>
+            <input type="hidden" id="projectId" name="projectId" value="${projectMaterialCollectInfo.projectId}">
+            <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:select id="projectType" path="projectType" class="form-control simple-select required">
+                            <form:option value="" label=""/>
+                            <form:options id="test" items="${fns:getMainDictList('work_material_engineer_type')}" itemLabel="label" itemValue="value" htmlEscape="false"/>
+                        </form:select>
+                    </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">
+                        <form:select path="projectPart" id="projectPart" class="form-control simple-select required">
+                            <form:option value="" label=""/>
+                            <form:options items="${fns:getMainDictList('work_material_engineer_part1')}" itemLabel="label" itemValue="value" htmlEscape="false"/>
+                        </form:select>
+                    </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 readOnlyFFF">
+                        <input id="startDate" name="startDate" placeholder="开始时间" type="text" readonly="readonly" maxlength="20" value="<fmt:formatDate value="${projectMaterialCollectInfo.startDate}" pattern="yyyy-MM-dd"/>" class="laydate-icondate required form-control layer-date layui-input laydate-icon query-group"
+                        />
+                        </input>
+                        <span class="group-sep">-</span>
+                        <input id="endDate" name="endDate" placeholder="结束时间" type="text" readonly="readonly" maxlength="20" value="<fmt:formatDate value="${projectMaterialCollectInfo.endDate}" pattern="yyyy-MM-dd"/>" class="laydate-icondate required form-control layer-date layui-input laydate-icon query-group"
+                        />
+                        </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">
+                        <form:input path="materialName" placeholder="请输入材料名称" htmlEscape="false" maxlength="64"  class="form-control layui-input required"/>
+                    </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">
+                        <form:input path="specifications" placeholder="请输入材料规格" htmlEscape="false" maxlength="64"  class="form-control layui-input required"/>
+                    </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">
+                        <form:input path="unit" placeholder="请输入材料单位" htmlEscape="false" maxlength="64" class="form-control layui-input required"/>
+                    </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">
+                        <form:input path="excludingTax" placeholder="请输入材料除税市场价" htmlEscape="false" onkeyup="wirteNum(this)" maxlength="64" class="form-control layui-input required"/>
+                    </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">
+                        <form:input path="userTheParts" placeholder="请输入材料使用部位" htmlEscape="false" maxlength="64" class="form-control layui-input required"/>
+                    </div>
+                </div>
+
+            </div>
+            <div class="form-group layui-row page-end"></div>
+        </form:form>
+    </div>
+</div>
+</body>
+</html>

+ 478 - 0
src/main/webapp/webpage/modules/pojectMaterialsWarehouse/projectMaterialCollectInfoList.jsp

@@ -0,0 +1,478 @@
+<%@ 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'
+				, trigger: 'click'
+            });
+            laydate.render({
+                elem: '#endDate', //目标元素。由于laydate.js封装了一个轻量级的选择器引擎,因此elem还允许你传入class、tag但必须按照这种方式 '#id .class'
+                event: 'focus', //响应事件。如果没有传入event,则按照默认的click
+                type : 'date'
+				, trigger: 'click'
+            });
+        });
+
+        function reset() {
+            $("#searchForm").resetForm();
+        }
+        function openDialog(title,url,width,height,target,formId,tableId) {
+
+            if (navigator.userAgent.match(/(iPhone|iPod|Android|ios)/i)) {//如果是移动端,就使用自适应大小弹窗
+                width = 'auto';
+                height = 'auto';
+            } else {//如果是PC端,根据用户设置的width和height显示。
+
+            }
+
+			top.layer.open({
+				type: 2,
+				area: [width, height],
+				title: title,
+				skin:"three-btns",
+				maxmin: false, //开启最大化最小化按钮
+				content: url ,
+				btn: ['下载模板','提交','关闭'],
+				btn1: function(index, layero){
+					window.location.href='${ctx}/project/projectMaterialsWarehouse/import/template';
+				},
+				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中展示
+					inputForm.attr("action","${ctx}/project/projectMaterialsWarehouse/save");//表单提交成功后,从服务器返回的url在当前tab中展示
+					var $document = iframeWin.contentWindow.document;
+					formSubmit2($document,formId,index,tableId);
+					return false;
+				},
+				btn3: function(index){
+				}
+			});
+        }
+        function openDialogSingle(title,url,width,height,target,formId,tableId) {
+
+            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: url ,
+				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}/project/projectMaterialsWarehouse/singleSave");//表单提交成功后,从服务器返回的url在当前tab中展示
+					var $document = iframeWin.contentWindow.document;
+					formSubmit2($document,formId,index,tableId);
+					return false;
+				},
+				cancel: function(index){
+				}
+			});
+        }
+		function openDialogreModify(title,url,width,height,target){
+
+			if(navigator.userAgent.match(/(iPhone|iPod|Android|ios)/i)){//如果是移动端,就使用自适应大小弹窗
+				width='auto';
+				height='auto';
+			}else{//如果是PC端,根据用户设置的width和height显示。
+
+			}
+			top.layer.open({
+				type: 2,
+				area: [width, height],
+				title: title,
+				skin: 'two-btns',
+				maxmin: true, //开启最大化最小化按钮
+				content: url ,
+				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}/project/projectMaterialsWarehouse/singleSave");//表单提交成功后,从服务器返回的url在当前tab中展示
+					var $document = iframeWin.contentWindow.document;
+					formSubmit2($document,"inputForm",index," layui-border-box");
+					return false;
+				},
+				cancel: function(index){
+				}
+			});
+		}
+
+			function formSubmit2($document,inputForm,index,tableId){
+
+				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.success){
+								parent.layer.msg(d.str,{icon:1});
+								window.location.reload();
+								//关闭当前页
+								top.layer.close(index)
+							}else{
+								parent.layer.msg(d.str,{icon:0});
+							}
+						}
+					});
+				}
+			}
+        function openDialogre(title,url,width,height,target,formId,tableId) {
+			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: url ,
+				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}/subProject/subProject/save");//表单提交成功后,从服务器返回的url在当前tab中展示
+					var $document = iframeWin.contentWindow.document;
+
+					formSubmit2($document,formId,index,tableId);
+
+				},
+				cancel: function(index){
+				}
+			});
+        }
+
+		// 确认对话框
+		function subConfirmx(mess, href, closed){
+
+			top.layer.confirm(mess, {icon: 3, title:'系统提示'}, function(index){
+				//do something
+				if (typeof href == 'function') {
+					href();
+				}else{
+					$.ajax({
+						type:"post",
+						url:href,
+						dataType:"json",
+						success:function(data){
+							if(data.success) {
+								top.layer.msg(data.str, {icon: 1});
+								window.location.reload();
+							}else {
+								top.layer.msg(data.str, {icon: 0});
+							}
+						}
+					})
+				}
+				top.layer.close(index);
+			});
+			return false;
+		}
+
+
+
+
+	</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%;
+		}*/
+		#margin{
+			margin-left: 1px;
+		}
+	</style>
+</head>
+<body>
+<div class="wrapper wrapper-content">
+	<sys:message content="${message}"/>
+	<div class="layui-row">
+		<div class="full-width fl">
+			<div class="layui-row contentShadow shadowLR" id="queryDiv">
+				<form:form id="searchForm" modelAttribute="projectMaterialCollectInfo" action="${ctx}/project/projectMaterialsWarehouse/particularsList?projectId=${projectId}" method="post" class="form-inline">
+					<input id="projectId" type="hidden" value="${projectId}"/>
+					<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="materialName" 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">
+								<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="${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="${endDate}" pattern="yyyy-MM-dd"/>"/>
+								</input>
+							</div>
+						</div>
+						<div class="layui-item fr">
+							<div class="input-group">
+								<a href="#" id="moresee"><i class="glyphicon glyphicon-menu-down"></i></a>
+								<div class="layui-btn-group search-spacing">
+									<button id="searchQuery" class="layui-btn layui-btn-sm  layui-bg-blue" onclick="search()">查询</button>
+									<button id="searchReset" class="layui-btn layui-btn-sm" onclick="resetSearch()">重置</button>
+								</div>
+							</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 with-icon">
+								<form:select path="projectType" class="form-control simple-select">
+									<form:option value="" label=""/>
+									<form:options items="${fns:getMainDictList('work_material_engineer_type')}" itemLabel="label" itemValue="value" htmlEscape="false"/>
+								</form:select>
+							</div>
+						</div>
+						<div class="layui-item query athird">
+							<label class="layui-form-label">工程部位:</label>
+							<div class="layui-input-block with-icon">
+								<form:select path="projectPart" class="form-control simple-select">
+									<form:option value="" label=""/>
+									<form:options items="${fns:getMainDictList('work_material_engineer_part1')}" 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">
+					<div class="layui-btn-group ">
+
+						<shiro:hasPermission name="project:pojectMaterialsWarehouse:list">
+							<table:singleProjectAddRow url="${ctx}/project/projectMaterialsWarehouse/singleForm?projectId=${projectId}" label="新增" title="新增"></table:singleProjectAddRow><!-- 增加按钮 -->
+						</shiro:hasPermission>
+						<shiro:hasPermission name="project:pojectMaterialsWarehouse:list">
+							<table:subProjectAddRow url="${ctx}/project/projectMaterialsWarehouse/form?projectId=${projectId}" width="500px" height="500px" label="导入" title="导入"></table:subProjectAddRow><!-- 增加按钮 -->
+						</shiro:hasPermission>
+						<shiro:hasPermission name="project:pojectMaterialsWarehouse:list">
+							<button type="button" data-toggle="tooltip" data-placement="top" class="layui-btn layui-btn-sm layui-bg-red" id="delUser"> 批量删除</button>
+						</shiro:hasPermission>
+						<button class="layui-btn layui-btn-sm" data-toggle="tooltip" data-placement="left" onclick="sortOrRefresh()" title="刷新">&nbsp;刷新</button>
+					</div>
+					<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:'projectName',align:'center', title: '项目名称',templet:function(d){
+                        return "<a class=\"attention-info\" title=\"" + d.projectName + "\" href=\"javascript:void(0);\" onclick=\"openDialogView('查看项目信息', '${ctx}/project/projectRecords/view?id=" + d.projectId +"','95%', '95%')\">" + d.projectName + "</a>";
+                    }}
+                ,{field:'materialName', align:'center',title: '材料名称',templet:function(d){
+                    	return "<span title='"+ d.materialName +"'>" + d.materialName + "</span>";
+					}}
+                ,{field:'specifications', align:'center',title: '规格',templet:function(d){
+                    	return "<span title='"+ d.specifications +"'>" + d.specifications + "</span>";
+					}}
+                ,{field:'unit', align:'center',title: '单位',templet:function(d){
+                        return "<span title=\"" + d.unit + "\">" + d.unit + "</span>";
+                    }}
+                ,{field:'excludingTax',align:'center', title: '除税市场价', templet:function(d){
+                        return "<span title=\"" + d.excludingTax + "\">" + d.excludingTax + "</span>";
+                    }}
+                ,{field:'userTheParts',align:'center', title: '使用部位', width:100}
+                ,{field:'projectDate',align:'center', title: '工程日期', width:180}
+                ,{field:'projectType',align:'center', title: '工程类型', width:100}
+                ,{field:'projectSite',align:'center', title: '工程地点', width:100}
+                ,{field:'projectPart',align:'center', title: '工程部位', width:100}
+                ,{field:'op',align:'center',title:"操作",width:130,templet:function(d){
+                        ////对操作进行初始化
+                        var xml="";
+                        if(d.canedit1 != undefined && d.canedit1 =="1")
+                        {
+							xml+="<a href=\"#\" onclick=\"openDialogreModify('修改信息', '${ctx}/project/projectMaterialsWarehouse/singleForm?id=" + d.id + "','95%', '95%','')\" class=\"layui-btn layui-btn-xs\" >修改</a>",
+							xml+="<a id=\"margin\" href=\"${ctx}/project/projectMaterialsWarehouse/delete?id=" + d.id + "\" onclick=\"return subConfirmx('确认要删除该信息吗?', this.href)\" class=\"layui-btn layui-btn-xs layui-bg-red \">删除</a>"
+                        }
+                        return xml;
+                    }}
+            ]]
+            ,data: [
+                <c:if test="${ not empty page.list}">
+                <c:forEach items="${page.list}" var="projectMaterial" varStatus="index">
+                <c:if test="${index.index != 0}">,</c:if>
+                {
+                    "index":"${index.index+1}"
+					,"id":"${projectMaterial.id}"
+					,"materialName":"${projectMaterial.materialName}"
+					,"projectName":"${projectMaterial.projectName}"
+					,"projectId":"${projectMaterial.projectId}"
+					,"specifications":"${projectMaterial.specifications}"
+					,"unit":"${projectMaterial.unit}"
+					,"excludingTax":"${projectMaterial.excludingTax}"
+					,"userTheParts":"${projectMaterial.userTheParts}"
+					,"projectDate":"<fmt:formatDate value="${projectMaterial.startDate}" pattern="yyyy-MM-dd"/>"+"/"+"<fmt:formatDate value="${projectMaterial.endDate}" pattern="yyyy-MM-dd"/>"
+					,"projectType":"${projectMaterial.projectType}"
+					,"projectSite":"${projectMaterial.projectSite}"
+					,"projectPart":"${projectMaterial.projectPart}"
+					,"canedit1":
+							<c:choose>
+								<c:when test="${fns:getUser().id == projectMaterial.createBy.id}">"1"</c:when>
+								<c:otherwise>"0"</c:otherwise>
+							</c:choose>
+				}
+                </c:forEach>
+                </c:if>
+            ]
+            // ,even: true
+            // ,height: 315
+        });
+
+		$("#delUser").bind("click",function () {
+			//获得表格CheckBox已经选中的行的信息
+			var checkList = layui.table.checkStatus('contentTable1').data;
+			//定义数组存放批量删除的行的id
+			var listId = [];
+			//进行遍历所有选中行数据,拿出每一行的id存储到数组中
+			$.each(checkList, function (i, data) {
+				listId.push(data.id);
+			});
+			if (listId.length <= 0) {
+				layer.msg("请选择需要删除的信息", {icon: 2})
+			} else {
+				$.ajax({
+					type:"post",
+					url:"${ctx}/project/projectMaterialsWarehouse/deleteAll?listId="+ listId,
+					dataType:"json",
+					success:function(data){
+						if(data.success) {
+							top.layer.msg(data.str, {icon: 1});
+							window.location.reload();
+						}else {
+							top.layer.msg(data.str, {icon: 0});
+						}
+					}
+				})
+				return true;
+			}
+		});
+    })
+
+    resizeListTable();
+    $("a").on("click",addLinkVisied);
+</script>
+<script>
+    resizeListWindow2();
+    $(window).resize(function(){
+        resizeListWindow2();
+    });
+</script>
+</body>
+</html>

+ 398 - 0
src/main/webapp/webpage/modules/pojectMaterialsWarehouse/projectMaterialCollectInfoView.jsp

@@ -0,0 +1,398 @@
+<%@ 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'
+				, trigger: 'click'
+            });
+            laydate.render({
+                elem: '#endDate', //目标元素。由于laydate.js封装了一个轻量级的选择器引擎,因此elem还允许你传入class、tag但必须按照这种方式 '#id .class'
+                event: 'focus', //响应事件。如果没有传入event,则按照默认的click
+                type : 'date'
+				, trigger: 'click'
+            });
+        });
+
+        function reset() {
+            $("#searchForm").resetForm();
+        }
+        function openDialog(title,url,width,height,target,formId,tableId) {
+
+            if (navigator.userAgent.match(/(iPhone|iPod|Android|ios)/i)) {//如果是移动端,就使用自适应大小弹窗
+                width = 'auto';
+                height = 'auto';
+            } else {//如果是PC端,根据用户设置的width和height显示。
+
+            }
+
+			top.layer.open({
+				type: 2,
+				area: [width, height],
+				title: title,
+				skin:"three-btns",
+				maxmin: false, //开启最大化最小化按钮
+				content: url ,
+				btn: ['下载模板','提交','关闭'],
+				btn1: function(index, layero){
+					window.location.href='${ctx}/project/projectMaterialsWarehouse/import/template';
+				},
+				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中展示
+					inputForm.attr("action","${ctx}/project/projectMaterialsWarehouse/save");//表单提交成功后,从服务器返回的url在当前tab中展示
+					var $document = iframeWin.contentWindow.document;
+					formSubmit2($document,formId,index,tableId);
+					return false;
+				},
+				btn3: function(index){
+				}
+			});
+        }
+
+			function formSubmit2($document,inputForm,index,tableId){
+
+				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.success){
+								parent.layer.msg(d.str,{icon:1});
+								window.location.reload();
+								//关闭当前页
+								top.layer.close(index)
+							}else{
+								parent.layer.msg(d.str,{icon:0});
+							}
+						}
+					});
+				}
+			}
+        function openDialogre(title,url,width,height,target,formId,tableId) {
+			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: url ,
+				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}/subProject/subProject/save");//表单提交成功后,从服务器返回的url在当前tab中展示
+					var $document = iframeWin.contentWindow.document;
+
+					formSubmit2($document,formId,index,tableId);
+
+				},
+				cancel: function(index){
+				}
+			});
+        }
+
+		// 确认对话框
+		function subConfirmx(mess, href, closed){
+
+			top.layer.confirm(mess, {icon: 3, title:'系统提示'}, function(index){
+				//do something
+				if (typeof href == 'function') {
+					href();
+				}else{
+					$.ajax({
+						type:"post",
+						url:href,
+						dataType:"json",
+						success:function(data){
+							if(data.success) {
+								top.layer.msg(data.str, {icon: 1});
+								window.location.reload();
+							}else {
+								top.layer.msg(data.str, {icon: 0});
+							}
+						}
+					})
+				}
+				top.layer.close(index);
+			});
+			return false;
+		}
+
+
+
+
+	</script>
+	<style>
+		body{
+			background-color:transparent;
+			filter:progid:DXImageTransform.Microsoft.gradient(startColorstr=#26FFFFFF, endColorstr=#26FFFFFF);
+			color:#ffffff;
+			background-color:rgba(255,255,255,0);
+			height:100%;
+		}
+	</style>
+</head>
+<body>
+<div class="wrapper wrapper-content">
+	<sys:message content="${message}"/>
+	<div class="layui-row">
+		<div class="full-width fl">
+			<div class="layui-row contentShadow shadowLR" id="queryDiv">
+				<form:form id="searchForm" modelAttribute="projectMaterialCollectInfo" action="${ctx}/project/projectMaterialsWarehouse/particularsListView?projectId=${projectId}" method="post" class="form-inline">
+					<input id="projectId" type="hidden" value="${projectId}"/>
+					<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="materialName" 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">
+								<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="${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="${endDate}" pattern="yyyy-MM-dd"/>"/>
+								</input>
+							</div>
+						</div>
+						<div class="layui-item fr">
+							<div class="input-group">
+								<a href="#" id="moresee"><i class="glyphicon glyphicon-menu-down"></i></a>
+								<div class="layui-btn-group search-spacing">
+									<button id="searchQuery" class="layui-btn layui-btn-sm  layui-bg-blue" onclick="search()">查询</button>
+									<button id="searchReset" class="layui-btn layui-btn-sm" onclick="resetSearch()">重置</button>
+								</div>
+							</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 with-icon">
+								<form:select path="projectType" class="form-control simple-select">
+									<form:option value="" label=""/>
+									<form:options items="${fns:getMainDictList('work_material_engineer_type')}" itemLabel="label" itemValue="value" htmlEscape="false"/>
+								</form:select>
+							</div>
+						</div>
+						<div class="layui-item query athird">
+							<label class="layui-form-label">工程部位:</label>
+							<div class="layui-input-block with-icon">
+								<form:select path="projectPart" class="form-control simple-select">
+									<form:option value="" label=""/>
+									<form:options items="${fns:getMainDictList('work_material_engineer_part1')}" 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">
+					<div class="layui-btn-group ">
+
+						<%--<shiro:hasPermission name="ruralProject:ruralProjectRecords:add">
+							<table:subProjectAddRow url="${ctx}/project/projectMaterialsWarehouse/form?projectId=${projectId}" width="500px" height="500px" label="导入" title="输变电项目材料信息"></table:subProjectAddRow><!-- 增加按钮 -->
+						</shiro:hasPermission>
+						<shiro:hasPermission name="project:pojectMaterialsWarehouse:list">
+							<button type="button" data-toggle="tooltip" data-placement="top" class="layui-btn layui-btn-sm layui-bg-red" id="delUser"> 批量删除</button>
+						</shiro:hasPermission>--%>
+						<button class="layui-btn layui-btn-sm" data-toggle="tooltip" data-placement="left" onclick="sortOrRefresh()" title="刷新">&nbsp;刷新</button>
+					</div>
+					<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:'projectName',align:'center', title: '项目名称',templet:function(d){
+                        return "<a class=\"attention-info\" title=\"" + d.projectName + "\" href=\"javascript:void(0);\" onclick=\"openDialogView('查看项目信息', '${ctx}/project/projectRecords/view?id=" + d.projectId +"','95%', '95%')\">" + d.projectName + "</a>";
+                    }}
+                ,{field:'materialName', align:'center',title: '材料名称',templet:function(d){
+                    	return "<span title='"+ d.materialName +"'>" + d.materialName + "</span>";
+					}}
+                ,{field:'specifications', align:'center',title: '规格',templet:function(d){
+                    	return "<span title='"+ d.specifications +"'>" + d.specifications + "</span>";
+					}}
+                ,{field:'unit', align:'center',title: '单位',templet:function(d){
+                        return "<span title=\"" + d.unit + "\">" + d.unit + "</span>";
+                    }}
+                ,{field:'excludingTax',align:'center', title: '除税市场价', templet:function(d){
+                        return "<span title=\"" + d.excludingTax + "\">" + d.excludingTax + "</span>";
+                    }}
+                ,{field:'userTheParts',align:'center', title: '使用部位', width:100}
+                ,{field:'projectDate',align:'center', title: '工程日期', width:180}
+                ,{field:'projectType',align:'center', title: '工程类型', width:100}
+                ,{field:'projectSite',align:'center', title: '工程地点', width:100}
+                ,{field:'projectPart',align:'center', title: '工程部位', width:100}
+                /*,{field:'op',align:'center',title:"操作",width:130,templet:function(d){
+                        ////对操作进行初始化
+                        var xml="";
+                        if(d.canedit1 != undefined && d.canedit1 =="1")
+                        {
+							xml+="<a href=\"${ctx}/project/projectMaterialsWarehouse/delete?id=" + d.id + "\" onclick=\"return subConfirmx('确认要删除该信息吗?', this.href)\" class=\"layui-btn layui-btn-xs layui-bg-red\"> 删除</a>";
+                        }
+                        return xml;
+                    }}*/
+            ]]
+            ,data: [
+                <c:if test="${ not empty page.list}">
+                <c:forEach items="${page.list}" var="projectMaterial" varStatus="index">
+                <c:if test="${index.index != 0}">,</c:if>
+                {
+                    "index":"${index.index+1}"
+					,"id":"${projectMaterial.id}"
+					,"materialName":"${projectMaterial.materialName}"
+					,"projectName":"${projectMaterial.projectName}"
+					,"projectId":"${projectMaterial.projectId}"
+					,"specifications":"${projectMaterial.specifications}"
+					,"unit":"${projectMaterial.unit}"
+					,"excludingTax":"${projectMaterial.excludingTax}"
+					,"userTheParts":"${projectMaterial.userTheParts}"
+					,"projectDate":"<fmt:formatDate value="${projectMaterial.startDate}" pattern="yyyy-MM-dd"/>"+"/"+"<fmt:formatDate value="${projectMaterial.endDate}" pattern="yyyy-MM-dd"/>"
+					,"projectType":"${projectMaterial.projectType}"
+					,"projectSite":"${projectMaterial.projectSite}"
+					,"projectPart":"${projectMaterial.projectPart}"
+					/*,"canedit1":
+							<c:choose>
+								<c:when test="${fns:getUser().id == projectMaterial.createBy.id}">"1"</c:when>
+								<c:otherwise>"0"</c:otherwise>
+							</c:choose>*/
+				}
+                </c:forEach>
+                </c:if>
+            ]
+            // ,even: true
+            // ,height: 315
+        });
+
+		/*$("#delUser").bind("click",function () {
+			//获得表格CheckBox已经选中的行的信息
+			var checkList = layui.table.checkStatus('contentTable1').data;
+			//定义数组存放批量删除的行的id
+			var listId = [];
+			//进行遍历所有选中行数据,拿出每一行的id存储到数组中
+			$.each(checkList, function (i, data) {
+				listId.push(data.id);
+			});
+			if (listId.length <= 0) {
+				layer.msg("请选择需要删除的信息", {icon: 2})
+			} else {
+				$.ajax({
+					type:"post",
+					url:"${ctx}/project/projectMaterialsWarehouse/deleteAll?listId="+ listId,
+					dataType:"json",
+					success:function(data){
+						if(data.success) {
+							top.layer.msg(data.str, {icon: 1});
+							window.location.reload();
+						}else {
+							top.layer.msg(data.str, {icon: 0});
+						}
+					}
+				})
+				return true;
+			}
+		});*/
+    })
+
+    resizeListTable();
+    $("a").on("click",addLinkVisied);
+</script>
+<script>
+    resizeListWindow2();
+    $(window).resize(function(){
+        resizeListWindow2();
+    });
+</script>
+</body>
+</html>

+ 155 - 0
src/main/webapp/webpage/modules/pojectMaterialsWarehouse/projectMaterialsWarehouseForm.jsp

@@ -0,0 +1,155 @@
+<%@ page contentType="text/html;charset=UTF-8" %>
+<%@ include file="/webpage/include/taglib.jsp"%>
+<html>
+<head>
+	<meta name="decorator" content="default"/>
+	<script type="text/javascript">
+        var validateForm;
+        function doSubmit(obj){//回调函数,在编辑和保存动作时,供openDialog调用提交表单。
+            /*if($("#file_attachment tr").length==0){
+                top.layer.alert('请上传采集文件!', {icon: 0});
+                return false;
+            }*/
+			$("#inputForm").submit();
+            return true;
+        }
+        var url = "";
+        var name = "";
+        function insertTitle(tValue){
+            var files = $("#attachment_file")[0].files;
+            if (files.length>1){
+                top.layer.alert('最多上传一个文件!', {icon: 0});
+                return false;
+			}
+            for(var i = 0;i<files.length;i++) {
+                var file = files[i];
+                var attachmentId = $("#id").val();
+                var attachmentFlag = "91";
+                /*console.log(file);*/
+                var timestamp=new Date().getTime();
+
+                var storeAs = "workMaterialCollect/collectFile/attachment-file/workMaterialCollectType/"+timestamp+"/"+file['name'];
+                var uploadPath="http://newxgccpm.su.bcebos.com/"+storeAs;/*将这段字符串存到数据库即可*/
+                url = uploadPath;
+                var divId = "_attachment";
+                var names =  storeAs.split("/");
+                name = names[names.length-1];
+                $("#addFile"+divId).show();
+                multipartUploadWithSts(storeAs, file,attachmentId,attachmentFlag,uploadPath,divId,0);}
+        }
+		$(document).ready(function() {
+			    $('#contentTable thead tr th input.i-checks').on('ifChecked', function(event){ //ifCreated 事件应该在插件初始化之前绑定
+			    	  $('#contentTable tbody tr td input.i-checks').iCheck('check');
+			    	});
+			    $('#contentTable thead tr th input.i-checks').on('ifUnchecked', function(event){ //ifCreated 事件应该在插件初始化之前绑定
+			    	  $('#contentTable tbody tr td input.i-checks').iCheck('uncheck');
+			    	});
+
+			laydate.render({
+				elem: '#startDate', //目标元素。由于laydate.js封装了一个轻量级的选择器引擎,因此elem还允许你传入class、tag但必须按照这种方式 '#id .class'
+				event: 'focus', //响应事件。如果没有传入event,则按照默认的click
+				type : 'date'
+				, trigger: 'click'
+			});
+			laydate.render({
+				elem: '#endDate', //目标元素。由于laydate.js封装了一个轻量级的选择器引擎,因此elem还允许你传入class、tag但必须按照这种方式 '#id .class'
+				event: 'focus', //响应事件。如果没有传入event,则按照默认的click
+				type : 'date'
+				, trigger: 'click'
+			});
+		});
+        function addFile() {
+            var files = $("#attachment_file")[0].files;
+            if (files.length<1){
+                $("#attachment_file").click();
+            }else {
+                top.layer.alert('最多上传一个文件!', {icon: 0});
+			}
+        }
+
+		function getSelectedItem(){
+			var projectType = $("#projectType").val();
+			// alert(projectType);
+			var projectPart = $("#projectPart").val();
+			// var size = $("#contentTable tbody tr td input.i-checks:checked").size();
+			//   if(size == 0 ){
+			// 		top.layer.alert('请至少选择一条数据!', {icon: 0, title:'警告'});
+			// 		return "-1";
+			// 	  }
+			//   /*if(size > 1 ){
+			// 		top.layer.alert('只能选择一条数据!', {icon: 0, title:'警告'});
+			// 		return "-1";
+			// 	  }*/
+            var arr=new Array();
+            // var id =  $(this).attr("id");
+            var itemName = projectType;
+            var itemNumber = projectPart;
+            var engineerId = url;
+            var uploadName = name;
+            var data= {'projectType':itemName,'projectPart':itemNumber,'attachmentName':uploadName,'url':engineerId};
+            arr.push(data);
+            // $("#contentTable tbody tr td input.i-checks:checkbox:checked").each(function () {
+            //     var id =  $(this).attr("id");
+            //     var itemName = $(this).parent().parent().parent().find(".codelabe2").html();
+            //     var itemNumber = $(this).parent().parent().parent().find(".codelabe3").html();
+            //     var data= {'id':id,'name':itemName,'number':itemNumber,'type':type,'model':model,'primaryUnit':primaryUnit,'isAssets':isAssets};
+            //     arr.push(data);
+			// })
+            return arr;
+		}
+
+		function changeProjectTypess(obj) {
+			// alert(obj);
+        }
+	</script>
+</head>
+<body>
+<div class="">
+	<div class="">
+		<form:form id="inputForm" modelAttribute="workMaterialCollectType" action="${ctx}/project/projectMaterialsWarehouse/save" method="post" class="form-horizontal" enctype="multipart/form-data" >
+			<form:hidden path="id"/>
+			<input type="hidden" id="projectId" name="projectId" value="${workMaterialCollectType.projectId}">
+			<div class="form-group-label"><h2>基础信息</h2></div>
+			<div class="layui-item layui-col-sm12">
+				<label class="layui-form-label"><span class="require-item">*</span>工程类型:</label>
+				<div class="layui-input-block">
+					<form:select id="projectType" path="projectType" class="form-control simple-select required">
+						<%--<form:option value="" label=""/>--%>
+						<form:options id="test" items="${fns:getMainDictList('work_material_engineer_type')}" itemLabel="label" itemValue="value" htmlEscape="false"/>
+					</form:select>
+				</div>
+			</div>
+			<div class="layui-item layui-col-sm12">
+				<label class="layui-form-label"><span class="require-item">*</span>工程部位:</label>
+				<div class="layui-input-block">
+					<form:select path="projectPart" id="projectPart" class="form-control simple-select required">
+						<%--<form:option value="" label=""/>--%>
+						<form:options items="${fns:getMainDictList('work_material_engineer_part1')}" itemLabel="label" itemValue="value" htmlEscape="false"/>
+					</form:select>
+				</div>
+			</div>
+			<div class="layui-item layui-col-sm12">
+				<label class="layui-form-label"><span class="require-item">*</span>工程日期:</label>
+				<div class="layui-input-block readOnlyFFF">
+					<input id="startDate" name="startDate" placeholder="开始时间" type="text" readonly="readonly" maxlength="20" class="laydate-icondate required form-control layer-date layui-input laydate-icon query-group"
+					/>
+					</input>
+					<span class="group-sep">-</span>
+					<input id="endDate" name="endDate" placeholder="结束时间" type="text" readonly="readonly" maxlength="20" class="laydate-icondate required form-control layer-date layui-input laydate-icon query-group"
+					/>
+					</input>
+				</div>
+			</div>
+			<div class="layui-item layui-col-sm12">
+				<div class="form-group-label"><h2><span class="require-item">*</span>输变电项目材料文件上传</h2></div>
+				<div class="layui-item nav-btns">
+					<input  value="" id="file" name="file"  type="file"  style="width:330px"/>导入文件不能超过5M,仅允许导入“xls”或“xlsx”格式文件!<br/>  
+				</div>
+
+			</div>
+
+		</form:form>
+	</div>
+</div>
+</body>
+</html>

+ 381 - 0
src/main/webapp/webpage/modules/pojectMaterialsWarehouse/projectMaterialsWarehouseList.jsp

@@ -0,0 +1,381 @@
+<%@ page contentType="text/html;charset=UTF-8" %>
+<%@ include file="/webpage/include/taglib.jsp"%>
+<html>
+<head>
+	<title>项目登记</title>
+	<meta name="decorator" content="default"/>
+    <link href="${ctxStatic}/layer-v2.3/layui/tableTree/treetable.css" rel="stylesheet" />
+	<%--<script src="${ctxStatic}/layer-v2.3/laydate/laydate.js"></script>--%>
+    <style>
+        .layui-table th{
+            font-size: 14px;
+            /*表头内容居中显示*/
+            text-align: center;
+        }
+		.pid{
+			font-size:14px;
+			font-weight:400;
+		}
+    </style>
+	<script type="text/javascript">
+        $(document).ready(function() {
+
+            //搜索框收放
+            $('#moresee').click(function(){
+                if($('#moresees').is(':visible'))
+                {
+                    $('#moresees').slideUp(0,resizeListWindow2);
+                    $('#moresee i').removeClass("glyphicon glyphicon-menu-up").addClass("glyphicon glyphicon-menu-down");
+                }else{
+                    $('#moresees').slideDown(0,resizeListWindow2);
+                    $('#moresee i').removeClass("glyphicon glyphicon-menu-down").addClass("glyphicon glyphicon-menu-up");
+                }
+            });
+            laydate.render({
+                elem: '#beginDate', //目标元素。由于laydate.js封装了一个轻量级的选择器引擎,因此elem还允许你传入class、tag但必须按照这种方式 '#id .class'
+                event: 'focus', //响应事件。如果没有传入event,则按照默认的click
+                type : 'date'
+, trigger: 'click'
+            });
+            laydate.render({
+                elem: '#endDate', //目标元素。由于laydate.js封装了一个轻量级的选择器引擎,因此elem还允许你传入class、tag但必须按照这种方式 '#id .class'
+                event: 'focus', //响应事件。如果没有传入event,则按照默认的click
+                type : 'date'
+, trigger: 'click'
+            });
+        });
+
+        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) {
+                }
+            });
+        }
+
+        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) {
+                }
+            });
+        }
+
+		function uploadFile(id){
+			$("#projectTypeId").val(id);
+			top.layer.open({
+				type: 1,
+				area: [500, 300],
+				title:"上传确认单",
+				skin: 'three-btns with-demo',
+				content:$("#importBox").html() ,
+				btn: ['下载模板','确定', '关闭'],
+				btn1: function(index, layero){
+					window.location.href='${ctx}/project/projectMaterialsWarehouse/import/template';
+				},
+				btn2: function(index, layero){
+					$.ajax({
+						url : '${ctx}/project/projectMaterialsWarehouse/import',
+						type : "post",
+						async:false,
+						cache: false,        // 不缓存数据
+						processData: false,  // 不处理数据
+						contentType: false,   // 不设置内容类型
+						data : new FormData(top.$("#importForm")[0]),
+						success : function(data) {
+							if (data.success){
+								parent.layer.msg(data.msg, {icon: 1});
+							}else {
+								parent.layer.msg(data.msg, {icon: 2});
+							}
+						}
+					});
+				},
+
+				btn3: function(index){
+					top.layer.close(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 id="importBox" class="hide">
+	<form id="importForm" style="padding-left:20px;text-align:center;" method="post" enctype="multipart/form-data"><br/>
+		<input  value="" id="file" name="file"  type="file"  style="width:330px"/>导入文件不能超过5M,仅允许导入“xls”或“xlsx”格式文件!<br/>  
+		<div>
+			<input type="hidden"  name ="id" id="id"/>
+		</div>
+	</form>
+</div>
+<div class="wrapper wrapper-content">
+	<sys:message content="${message}"/>
+	<div class="layui-row">
+		<div class="full-width fl">
+			<div class="layui-row contentShadow shadowLR" id="queryDiv">
+				<form:form id="searchForm" modelAttribute="projectRecords" action="${ctx}/project/projectMaterialsWarehouse" 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">
+								<form:input path="projectName" 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="leaderNameStr" htmlEscape="false" maxlength="255"  class=" form-control layui-input"/>
+							</div>
+						</div>
+						<div class="layui-item athird">
+							<div class="input-group">
+								<a href="#" id="moresee"><i class="glyphicon glyphicon-menu-down"></i></a>
+								<div class="layui-btn-group search-spacing">
+									<button id="searchQuery" class="layui-btn layui-btn-sm layui-bg-blue" onclick="search()">查询</button>
+									<button id="searchReset" class="layui-btn layui-btn-sm " onclick="resetSearch()">重置</button>
+								</div>
+							</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">
+								<input type="text" input="workContractInfoName" name="workContractInfo.name" value="" htmlEscape="false" maxlength="255"  class=" form-control layui-input">
+							</div>
+						</div>
+						<div class="layui-item query athird ">
+							<label class="layui-form-label">委托方:</label>
+							<div class="layui-input-block">
+								<input type="text" input="workContractInfoClientName" name="workContractInfo.client.name" value="" 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 readOnlyFFF">
+								<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 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">
+					<div class="layui-btn-group">
+						<button class="layui-btn layui-btn-sm" data-toggle="tooltip" data-placement="left" onclick="sortOrRefresh()" title="刷新"> 刷新</button>
+					</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: [[
+                {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}/project/projectRecords/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}/project/interimPaymentSummarizing/form?view=contentView&condition=interim&type=420&infoId="+d.id+"&id="+d.contentPId+"','95%', '95%')\">" + d.projId + "</a>";
+                    }}
+                ,{field:'contract', align:'center',title: '合同名称',minWidth:150,templet:function(d){
+						if(null == d.contract || '' == d.contract){
+							return "<span style=\"color:red\" title='无合同'>无合同</span>";
+						}else{
+							return "<span title='"+ d.contract +"'>" + d.contract + "</span>";
+						}
+					}}
+                ,{field:'projMaster', align:'center',title: '负责人', width:85,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}
+                ,{field:'op',align:'center',title:"操作",width:130,templet:function(d){
+                        ////对操作进行初始化
+                        var xml="<div class=\"layui-btn-group\">";
+                        /*if(d.canedit3 != undefined && d.canedit3 =="1")
+                        {*/
+							xml+="<a href=\"javascript:void(0)\" onclick=\"openDialogView('编辑输变电项目材料信息', '${ctx}/project/projectMaterialsWarehouse/particularsList?projectId="+d.id+"','95%','95%')\" style=\"color: white;background: darkseagreen\" class=\"layui-btn layui-btn-xs \" >编辑</a>",
+							xml+="<a href=\"javascript:void(0)\" onclick=\"openDialogView('查看输变电项目材料信息', '${ctx}/project/projectMaterialsWarehouse/particularsListView?projectId="+d.id+"','95%','95%')\" style=\"color: white;background: #1E9FFF\" class=\"layui-btn layui-btn-xs \" >查看</a>"
+						/*}*/
+						xml+="</div>";
+                        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}"
+                    ,"contentPId":"${projectRecords.contentPId}"
+                    ,"dictType":"${projectRecords.dictType}"
+                    <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>
+            ]
+        });
+    })
+
+    resizeListTable();
+    $("a").on("click",addLinkVisied);
+</script>
+<script>
+    resizeListWindow2();
+    $(window).resize(function(){
+        resizeListWindow2();
+    });
+</script>
+<script src="${ctxStatic}/layer-v2.3/layui/layui.all.js" charset="utf-8"></script>
+<script src="${ctxStatic}/layer-v2.3/layui/tableTree/treetable.js" charset="utf-8"></script>
+</body>
+</html>

+ 1 - 0
src/main/webapp/webpage/modules/workcontractinfo/workContractInfoAdminForm.jsp

@@ -552,6 +552,7 @@
             }
         }
         //千位符号,保留两位小数
+        //千位符号,保留两位小数
         function toThousands(s){
             if(/[^0-9\.]/.test(s)) return "无效值";
             s=s.replace(/^(\d*)$/,"$1.");