Browse Source

自定义数值统计

seyason 3 years ago
parent
commit
dc85a40a95
29 changed files with 1172 additions and 86 deletions
  1. 6 0
      fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/controller/DepartmentController.java
  2. 15 1
      fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/controller/ProjectController.java
  3. 27 16
      fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/controller/ReportController.java
  4. 7 1
      fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/entity/Report.java
  5. 2 0
      fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/mapper/DepartmentMapper.java
  6. 6 0
      fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/mapper/ProjectMapper.java
  7. 2 0
      fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/DepartmentService.java
  8. 4 0
      fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/ProjectService.java
  9. 89 0
      fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/impl/DepartmentServiceImpl.java
  10. 80 2
      fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/impl/ProjectServiceImpl.java
  11. 4 2
      fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/impl/ReportServiceImpl.java
  12. 27 0
      fhKeeper/formulahousekeeper/management-platform/src/main/resources/mapper/DepartmentMapper.xml
  13. 45 0
      fhKeeper/formulahousekeeper/management-platform/src/main/resources/mapper/ProjectMapper.xml
  14. 12 11
      fhKeeper/formulahousekeeper/management-platform/src/main/resources/mapper/ReportMapper.xml
  15. 10 10
      fhKeeper/formulahousekeeper/timesheet/config/index.js
  16. 13 2
      fhKeeper/formulahousekeeper/timesheet/src/main.js
  17. 12 0
      fhKeeper/formulahousekeeper/timesheet/src/routes.js
  18. 693 0
      fhKeeper/formulahousekeeper/timesheet/src/views/project/custom_data.vue
  19. 43 15
      fhKeeper/formulahousekeeper/timesheet/src/views/settings/timetype.vue
  20. 43 13
      fhKeeper/formulahousekeeper/timesheet/src/views/workReport/daily.vue
  21. 7 3
      fhKeeper/formulahousekeeper/timesheet/src/views/workReport/list.vue
  22. 3 1
      fhKeeper/formulahousekeeper/timesheet/src/views/workReport/list_department.vue
  23. 0 2
      fhKeeper/formulahousekeeper/timesheet/src/views/workReport/list_import.vue
  24. 3 1
      fhKeeper/formulahousekeeper/timesheet/src/views/workReport/list_profession.vue
  25. 15 2
      fhKeeper/formulahousekeeper/timesheet_h5/src/views/edit/index.vue
  26. 1 1
      fhKeeper/formulahousekeeper/timesheet_h5/src/views/review/department_list.vue
  27. 1 2
      fhKeeper/formulahousekeeper/timesheet_h5/src/views/review/index.vue
  28. 1 1
      fhKeeper/formulahousekeeper/timesheet_h5/src/views/review/profession_list.vue
  29. 1 0
      fhKeeper/formulahousekeeper/timesheet_h5/src/views/view/index.vue

+ 6 - 0
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/controller/DepartmentController.java

@@ -99,6 +99,12 @@ public class DepartmentController {
         return departmentService.getUserStatistics(startDate, endDate, departmentId, request);
         return departmentService.getUserStatistics(startDate, endDate, departmentId, request);
     }
     }
 
 
+    @RequestMapping("/getUserCustomDataStatistic")
+    public HttpRespMsg getUserCustomDataStatistic(String startDate, String endDate, Integer departmentId, HttpServletRequest request) {
+        return departmentService.getUserCustomDataStatistic(startDate, endDate, departmentId, request);
+    }
+
+
     /**
     /**
      * 按人员导出工时统计,可选人员
      * 按人员导出工时统计,可选人员
      * departmentId 要查询的项目
      * departmentId 要查询的项目

+ 15 - 1
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/controller/ProjectController.java

@@ -5,6 +5,7 @@ import com.management.platform.entity.Project;
 import com.management.platform.service.ProjectService;
 import com.management.platform.service.ProjectService;
 import com.management.platform.util.HttpRespMsg;
 import com.management.platform.util.HttpRespMsg;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.util.StringUtils;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RequestParam;
 import org.springframework.web.bind.annotation.RequestParam;
 import org.springframework.web.bind.annotation.RestController;
 import org.springframework.web.bind.annotation.RestController;
@@ -134,6 +135,19 @@ public class ProjectController {
         return projectService.exportTimeCost(startDate, endDate, projectId, userId, projectSum, request);
         return projectService.exportTimeCost(startDate, endDate, projectId, userId, projectSum, request);
     }
     }
 
 
+    /**
+     * 获取查询者所在公司每个项目的自定义数值累计
+     */
+    @RequestMapping("/getCustomDataSum")
+    public HttpRespMsg getCustomDataSum(String startDate, String endDate, String userId) {
+        return projectService.getCustomDataSum(startDate, endDate, userId, request);
+    }
+
+    @RequestMapping("/exportCustomDataSum")
+    public HttpRespMsg exportCustomDataSum(String startDate, String endDate, Integer projectId, String userId) {
+        return projectService.exportCustomDataSum(startDate, endDate, projectId, userId, request);
+    }
+
     /**
     /**
      * 获取某个项目每个人分别需要的工时
      * 获取某个项目每个人分别需要的工时
      * id 项目id
      * id 项目id
@@ -332,7 +346,7 @@ public class ProjectController {
         String names = project.getAssociateDegreeNames();
         String names = project.getAssociateDegreeNames();
         HttpRespMsg msg = new HttpRespMsg();
         HttpRespMsg msg = new HttpRespMsg();
         List<HashMap> list = new ArrayList<>();
         List<HashMap> list = new ArrayList<>();
-        if (associateDegrees != null) {
+        if (!StringUtils.isEmpty(associateDegrees)) {
             String[] id = associateDegrees.split("\\,");
             String[] id = associateDegrees.split("\\,");
             String[] n = names.split("\\,");
             String[] n = names.split("\\,");
             for (int i=0;i<id.length; i++) {
             for (int i=0;i<id.length; i++) {

+ 27 - 16
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/controller/ReportController.java

@@ -147,7 +147,8 @@ public class ReportController {
                                   Integer[] multiWorktime,
                                   Integer[] multiWorktime,
                                   Integer[] degreeId,
                                   Integer[] degreeId,
                                   @RequestParam(required = false, defaultValue = "0") Integer draft,
                                   @RequestParam(required = false, defaultValue = "0") Integer draft,
-                                  Integer[] groupId//任务分组id
+                                  Integer[] groupId,//任务分组id
+                                  Double[] customData//自定义的数值
                                     ) {
                                     ) {
         List<Report> reportList = new ArrayList<>();
         List<Report> reportList = new ArrayList<>();
         String token = request.getHeader("Token");
         String token = request.getHeader("Token");
@@ -184,6 +185,12 @@ public class ReportController {
                 groupId[i] = 0;
                 groupId[i] = 0;
             }
             }
         }
         }
+        if (customData == null) {
+            customData = new Double[projectId.length];
+            for(int i=0;i<customData.length; i++) {
+                customData[i] = 0.0;
+            }
+        }
 
 
         //检查项目是否截止
         //检查项目是否截止
         List<Integer> integers = Arrays.asList(projectId);
         List<Integer> integers = Arrays.asList(projectId);
@@ -382,21 +389,22 @@ public class ReportController {
                     //获取当前填报人所在部门的自定义审核流程
                     //获取当前填报人所在部门的自定义审核流程
                     for (LocalDate localStartDate : workDaysListInRange) {
                     for (LocalDate localStartDate : workDaysListInRange) {
                         if (targetUserList == null) {
                         if (targetUserList == null) {
-                            Report report = new Report()
-                                    .setId(id[i] == -1 ? null : id[i])
-                                    .setProjectId(projectId[i])
-                                    .setSubProjectId(subProjectId[i])
-                                    .setGroupId(groupId[i])
-                                    .setReportTimeType(reportTimeType[i])
-                                    .setMultiWorktime(multiWorktime[i])
-                                    .setContent(content[i])
-                                    .setDegreeId(degreeId.length > 0?degreeId[i]:null)
-                                    .setState(draft==0?0:3)
-                                    .setCompanyId(user.getCompanyId())
-                                    .setPicAdd(pics!=null?pics[i]:null)
-                                    .setStage(stage[i])
-                                    .setCreateDate(localStartDate)
-                                    .setCreatorId(token);
+                            Report report = new Report();
+                            report.setId(id[i] == -1 ? null : id[i]);
+                            report.setProjectId(projectId[i]);
+                            report.setSubProjectId(subProjectId[i]);
+                            report.setGroupId(groupId[i]);
+                            report.setReportTimeType(reportTimeType[i]);
+                            report.setMultiWorktime(multiWorktime[i]);
+                            report.setContent(content[i]);
+                            report.setDegreeId(degreeId.length > 0?degreeId[i]:null);
+                            report.setCustomData(customData[i]);
+                            report.setState(draft==0?0:3);
+                            report.setCompanyId(user.getCompanyId());
+                            report.setPicAdd(pics!=null?pics[i]:null);
+                            report.setStage(stage[i]);
+                            report.setCreateDate(localStartDate);
+                            report.setCreatorId(token);
                             report.setProjectAuditState(0);
                             report.setProjectAuditState(0);
                             if (auditWorkflowList.size() == 0) {
                             if (auditWorkflowList.size() == 0) {
                                 //没有自定义审核流,默认的直接是项目负责人审核
                                 //没有自定义审核流,默认的直接是项目负责人审核
@@ -442,6 +450,7 @@ public class ReportController {
                                         .setMultiWorktime(multiWorktime[i])
                                         .setMultiWorktime(multiWorktime[i])
                                         .setContent(content[i])
                                         .setContent(content[i])
                                         .setDegreeId(degreeId.length > 0?degreeId[i]:null)
                                         .setDegreeId(degreeId.length > 0?degreeId[i]:null)
+                                        .setCustomData(customData[i])
                                         .setStage(stage[i])
                                         .setStage(stage[i])
                                         .setState(1)//代填,直接是审核通过状态
                                         .setState(1)//代填,直接是审核通过状态
                                         .setCompanyId(user.getCompanyId())
                                         .setCompanyId(user.getCompanyId())
@@ -493,6 +502,7 @@ public class ReportController {
                         report.setMultiWorktime(multiWorktime.length > 0?multiWorktime[i]:0);
                         report.setMultiWorktime(multiWorktime.length > 0?multiWorktime[i]:0);
                         report.setContent(content.length > 0?content[i]:"-");
                         report.setContent(content.length > 0?content[i]:"-");
                         report.setDegreeId(degreeId.length > 0?degreeId[i]:null);
                         report.setDegreeId(degreeId.length > 0?degreeId[i]:null);
+                        report.setCustomData(customData[i]);
                         report.setStage(stage != null && stage.length>0?stage[i]:"-");
                         report.setStage(stage != null && stage.length>0?stage[i]:"-");
                         report.setState(draft==0?0:3);
                         report.setState(draft==0?0:3);
                         report.setCompanyId(user.getCompanyId());
                         report.setCompanyId(user.getCompanyId());
@@ -548,6 +558,7 @@ public class ReportController {
                                     .setMultiWorktime(multiWorktime[i])
                                     .setMultiWorktime(multiWorktime[i])
                                     .setContent(content[i])
                                     .setContent(content[i])
                                     .setDegreeId(degreeId.length > 0?degreeId[i]:null)
                                     .setDegreeId(degreeId.length > 0?degreeId[i]:null)
+                                    .setCustomData(customData[i])
                                     .setStage(stage[i])
                                     .setStage(stage[i])
 //                                    .setState(auditWorkflowList.size() == 0?1:0)//代填的如果没有自定义审核流程就直接审核通过了
 //                                    .setState(auditWorkflowList.size() == 0?1:0)//代填的如果没有自定义审核流程就直接审核通过了
                                     .setCompanyId(user.getCompanyId())
                                     .setCompanyId(user.getCompanyId())

+ 7 - 1
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/entity/Report.java

@@ -24,7 +24,7 @@ import org.springframework.format.annotation.DateTimeFormat;
  * </p>
  * </p>
  *
  *
  * @author Seyason
  * @author Seyason
- * @since 2022-03-03
+ * @since 2022-03-09
  */
  */
 @Data
 @Data
 @EqualsAndHashCode(callSuper = false)
 @EqualsAndHashCode(callSuper = false)
@@ -265,6 +265,12 @@ public class Report extends Model<Report> {
 
 
     @TableField(exist = false)
     @TableField(exist = false)
     private List<TaskGroup> taskGroups;
     private List<TaskGroup> taskGroups;
+    /**
+     * 自定义的数值
+     */
+    @TableField("custom_data")
+    private Double customData;
+
 
 
     @Override
     @Override
     protected Serializable pkVal() {
     protected Serializable pkVal() {

+ 2 - 0
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/mapper/DepartmentMapper.java

@@ -19,4 +19,6 @@ public interface DepartmentMapper extends BaseMapper<Department> {
     Map<String, Object> getCostByDepartment(@Param("departmentIds") List departmentIds, String startDate, String endDate);
     Map<String, Object> getCostByDepartment(@Param("departmentIds") List departmentIds, String startDate, String endDate);
 
 
     List<Map<String, Object>> getCostByUser(@Param("departmentIds") List departmentIds, String startDate, String endDate, Integer companyId, List<String> userIds);
     List<Map<String, Object>> getCostByUser(@Param("departmentIds") List departmentIds, String startDate, String endDate, Integer companyId, List<String> userIds);
+
+    List<Map<String, Object>> getCustomDataByUser(@Param("departmentIds") List departmentIds, String startDate, String endDate, Integer companyId, List<String> userIds);
 }
 }

+ 6 - 0
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/mapper/ProjectMapper.java

@@ -27,7 +27,13 @@ public interface ProjectMapper extends BaseMapper<Project> {
     List<Map<String, Object>> getTimeCost(@Param("companyId") Integer companyId, @Param("startDate") String startDate, @Param("endDate") String endDate,
     List<Map<String, Object>> getTimeCost(@Param("companyId") Integer companyId, @Param("startDate") String startDate, @Param("endDate") String endDate,
         @Param("projectId") Integer projectId, @Param("userId") String userId);
         @Param("projectId") Integer projectId, @Param("userId") String userId);
 
 
+    List<Map<String, Object>> getCustomDataSum(@Param("companyId") Integer companyId, @Param("startDate") String startDate, @Param("endDate") String endDate,
+                                          @Param("projectId") Integer projectId, @Param("userId") String userId);
+
     List<Map<String, Object>> getProjectCost(@Param("startDate") String startDate, @Param("endDate") String endDate, @Param("projectId") Integer projectId, @Param("userId") String userId);
     List<Map<String, Object>> getProjectCost(@Param("startDate") String startDate, @Param("endDate") String endDate, @Param("projectId") Integer projectId, @Param("userId") String userId);
+
+    List<Map<String, Object>> getProjectCusDataSumItem(@Param("companyId") Integer companyId, @Param("startDate") String startDate, @Param("endDate") String endDate, @Param("projectId") Integer projectId, @Param("userId") String userId);
+
     @Update("update project set status = 1, finish_date = null where id = #{id}")
     @Update("update project set status = 1, finish_date = null where id = #{id}")
     void restartProject(Integer id);
     void restartProject(Integer id);
 
 

+ 2 - 0
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/DepartmentService.java

@@ -34,4 +34,6 @@ public interface DepartmentService extends IService<Department> {
     HttpRespMsg listAllMemb(HttpServletRequest request);
     HttpRespMsg listAllMemb(HttpServletRequest request);
 
 
     HttpRespMsg listMyMembs(HttpServletRequest request);
     HttpRespMsg listMyMembs(HttpServletRequest request);
+
+    HttpRespMsg getUserCustomDataStatistic(String startDate, String endDate, Integer departmentId, HttpServletRequest request);
 }
 }

+ 4 - 0
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/ProjectService.java

@@ -97,4 +97,8 @@ public interface ProjectService extends IService<Project> {
     HttpRespMsg getDegreeCost(String startDate, String endDate, Integer projectId, HttpServletRequest request);
     HttpRespMsg getDegreeCost(String startDate, String endDate, Integer projectId, HttpServletRequest request);
 
 
     HttpRespMsg exportData(HttpServletRequest request);
     HttpRespMsg exportData(HttpServletRequest request);
+
+    HttpRespMsg getCustomDataSum(String startDate, String endDate, String userId, HttpServletRequest request);
+
+    HttpRespMsg exportCustomDataSum(String startDate, String endDate, Integer projectId, String userId, HttpServletRequest request);
 }
 }

+ 89 - 0
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/impl/DepartmentServiceImpl.java

@@ -544,6 +544,95 @@ public class DepartmentServiceImpl extends ServiceImpl<DepartmentMapper, Departm
         return msg;
         return msg;
     }
     }
 
 
+    @Override
+    public HttpRespMsg getUserCustomDataStatistic(String startDate, String endDate, Integer departmentId, HttpServletRequest request) {
+        HttpRespMsg httpRespMsg = new HttpRespMsg();
+        try {
+            Integer companyId = userMapper.selectById(request.getHeader("Token")).getCompanyId();
+
+            List<Integer> deptIds = null;
+            //首先校验有无权限
+            if (departmentId != null) {
+                if (departmentMapper.selectCount(new QueryWrapper<Department>()
+                        .eq("department_id", departmentId)
+                        .eq("company_id", companyId)) == 1) {
+                    List<Department> allDeptList = departmentMapper.selectList(new QueryWrapper<Department>().eq("company_id", companyId));
+                    deptIds = getBranchDepartment(departmentId, allDeptList);
+                } else {
+                    httpRespMsg.setError("部门不存在或无查看权限");
+                    return httpRespMsg;
+                }
+            }
+            List<Map<String, Object>> list = departmentMapper
+                    .getCustomDataByUser(deptIds, startDate, endDate, companyId, null);
+            Map<String, List<Map<String, Object>>> tempMap = new HashMap<>();
+            List<User> userList = new ArrayList<>();
+            Double totalCost = 0.0;
+            for (Map<String, Object> map : list) {
+
+                if (tempMap.containsKey(map.get("user"))) {
+                    //这个名字已经装进数组中了
+                    List<Map<String, Object>> tempList = tempMap.get(map.get("user"));
+                    Map<String, Object> dataMap = new HashMap<>();
+                    dataMap.put("project", map.get("project"));
+                    Double cost = (Double) map.getOrDefault("cost", 0);
+                    totalCost = totalCost + cost;
+                    dataMap.put("cost", cost);
+                    tempList.add(dataMap);
+                } else {
+                    User user = new User();
+                    user.setId((String)map.get(("id")));
+                    user.setName((String)map.get("user"));
+                    userList.add(user);
+                    //这个名字尚未装进数组中
+                    List<Map<String, Object>> tempList = new ArrayList<>();
+                    if (map.containsKey("project")) {
+                        Map<String, Object> dataMap = new HashMap<>();
+                        dataMap.put("project", map.get("project"));
+                        Double cost = (Double) map.getOrDefault("cost", 0);
+                        totalCost = totalCost + cost;
+                        dataMap.put("cost", cost);
+                        tempList.add(dataMap);
+                    }
+                    tempMap.put((String) map.get("user"), tempList);
+                }
+            }
+            Map<String, Object> finalMap = new HashMap<>();
+            List<Map<String, Object>> finalList = new ArrayList<>();
+            for (String key : tempMap.keySet()) {
+                Map<String, Object> map = new HashMap<>();
+                map.put("name", key);
+                List<Map<String, Object>> userProjectTime = tempMap.get(key);
+                map.put("project", userProjectTime);
+                //计算总时间
+                double userTotalTime = 0;
+                for (Map<String, Object> timeItem: userProjectTime) {
+                    double t = (double)timeItem.get("cost");
+                    userTotalTime += t;
+                }
+                map.put("cost", userTotalTime);
+                finalList.add(map);
+            }
+            //排序
+            finalList = finalList.stream().sorted(new Comparator<Map<String, Object>>() {
+                @Override
+                public int compare(Map<String, Object> o1, Map<String, Object> o2) {
+                    return (double)o1.get("cost") > (double)o2.get("cost")?-1:1;
+                }
+            }).collect(Collectors.toList());
+            finalMap.put("totalCost", totalCost);
+            finalMap.put("list", finalList);
+            finalMap.put("userList", userList);
+            httpRespMsg.data = finalMap;
+
+        } catch (NullPointerException e) {
+            e.printStackTrace();
+            httpRespMsg.setError("验证失败");
+            return httpRespMsg;
+        }
+        return httpRespMsg;
+    }
+
 
 
     private void fillDeptUser(List<DepartmentVO> list, List<HashMap> userList) {
     private void fillDeptUser(List<DepartmentVO> list, List<HashMap> userList) {
         list.forEach(l->{
         list.forEach(l->{

+ 80 - 2
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/impl/ProjectServiceImpl.java

@@ -1557,8 +1557,7 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
                     if (code.equals("项目编号") && rowIndex == 0) {
                     if (code.equals("项目编号") && rowIndex == 0) {
                         //检查是否有子项目列
                         //检查是否有子项目列
                         if (!subNameCell.getStringCellValue().trim().startsWith("子项目")) {
                         if (!subNameCell.getStringCellValue().trim().startsWith("子项目")) {
-                            msg.setError("缺少子项目列,请下载最新模板");
-                            return msg;
+                            throw new Exception("缺少子项目列,请下载最新模板");
                         }
                         }
                         //跳过第一行标题
                         //跳过第一行标题
                         continue;
                         continue;
@@ -1761,4 +1760,83 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
 
 
         return httpRespMsg;
         return httpRespMsg;
     }
     }
+
+    @Override
+    public HttpRespMsg getCustomDataSum(String startDate, String endDate, String userId, HttpServletRequest request) {
+        HttpRespMsg httpRespMsg = new HttpRespMsg();
+        try {
+            Integer companyId = userMapper.selectById(request.getHeader("Token")).getCompanyId();
+            Map<String, Object> resultMap = new HashMap<>();
+
+            List<Map<String, Object>> list = projectMapper.getCustomDataSum(companyId, startDate, endDate, null, userId);
+            BigDecimal totalMoneyCost = BigDecimal.valueOf(0);
+            for (Map<String, Object> map : list) {
+                if (!map.containsKey("cost")) {
+                    map.put("cost", 0);
+                }
+                if (!map.containsKey("costMoney")) {
+                    map.put("costMoney", 0);
+                } else {
+                    totalMoneyCost = totalMoneyCost.add((BigDecimal)map.get("costMoney"));
+                }
+            }
+
+            resultMap.put("costList", list);
+            resultMap.put("totalMoneyCost", totalMoneyCost);
+            httpRespMsg.data = resultMap;
+
+        } catch (NullPointerException e) {
+            httpRespMsg.setError("验证失败");
+            return httpRespMsg;
+        }
+        return httpRespMsg;
+    }
+
+    @Override
+    public HttpRespMsg exportCustomDataSum(String startDate, String endDate, Integer projectId, String userId, HttpServletRequest request) {
+        HttpRespMsg httpRespMsg = new HttpRespMsg();
+        try {
+            Integer companyId = userMapper.selectById(request.getHeader("Token")).getCompanyId();
+            TimeType timeType = timeTypeMapper.selectById(companyId);
+            List<Map<String, Object>> list = projectMapper.getCustomDataSum(companyId, startDate, endDate, projectId, userId);
+            List<String> headList = new ArrayList<String>();
+            headList.add("项目编号");
+            headList.add("项目名称");
+            headList.add("人员");
+            headList.add("部门");
+            headList.add(timeType.getCustomDataName());
+            List<List<String>> allList = new ArrayList<List<String>>();
+            allList.add(headList);
+            double totalCostTime = 0;
+            List<Map<String, Object>> membList = projectMapper.getProjectCusDataSumItem(companyId, startDate, endDate, projectId, userId);
+            for (Map<String, Object> membMap : membList) {
+                List<String> membRowData = new ArrayList<String>();
+                membRowData.add((String)membMap.get("projectCode"));
+                membRowData.add((String)membMap.get("projectName"));
+                membRowData.add((String)membMap.get("name"));
+                membRowData.add((String)membMap.get("departmentName"));
+                membRowData.add(((Double)membMap.get("cost")).toString());
+                allList.add(membRowData);
+                totalCostTime += (Double)membMap.get("cost");
+            }
+            //合计
+            List<String> sumRow = new ArrayList<String>();
+            sumRow.add("合计");
+            sumRow.add("");
+            sumRow.add("");
+            sumRow.add("");
+            sumRow.add(""+new BigDecimal(totalCostTime).setScale(1, BigDecimal.ROUND_HALF_UP));
+            allList.add(sumRow);
+            //生成excel文件导出
+            String fileName = timeType.getCustomDataName() + "统计_"+System.currentTimeMillis();
+            String resp = ExcelUtil.exportGeneralExcelByTitleAndList(fileName , allList, path);
+
+            httpRespMsg.data = resp;
+        } catch (NullPointerException e) {
+            e.printStackTrace();
+            httpRespMsg.setError("验证失败");
+            return httpRespMsg;
+        }
+        return httpRespMsg;
+    }
 }
 }

+ 4 - 2
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/impl/ReportServiceImpl.java

@@ -1965,7 +1965,9 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
                     dataCount++;
                     dataCount++;
                     //数据行
                     //数据行
                     for (int i=1;i<projectNameStartIndex+projectList.size(); i++) {
                     for (int i=1;i<projectNameStartIndex+projectList.size(); i++) {
-                        row.getCell(i).setCellType(CellType.STRING);
+                        if (row.getCell(i) != null) {
+                            row.getCell(i).setCellType(CellType.STRING);
+                        }
                     }
                     }
 
 
                     if (row.getCell(0) == null) {
                     if (row.getCell(0) == null) {
@@ -1989,7 +1991,7 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
                     List<SimpleProjectime> timeCostList = new ArrayList<SimpleProjectime>();
                     List<SimpleProjectime> timeCostList = new ArrayList<SimpleProjectime>();
                     double totalTime = 0;
                     double totalTime = 0;
                     for (int i=projectNameStartIndex; i < projectNameStartIndex + projectList.size(); i++) {
                     for (int i=projectNameStartIndex; i < projectNameStartIndex + projectList.size(); i++) {
-                        String stringCellValue = row.getCell(i).getStringCellValue();
+                        String stringCellValue = row.getCell(i)==null?"0":row.getCell(i).getStringCellValue();
                         double time = 0;
                         double time = 0;
                         String pName = projectList.get(i-projectNameStartIndex);
                         String pName = projectList.get(i-projectNameStartIndex);
                         Project project = allProjectList.stream().filter(p -> p.getProjectName().equals(pName)).findFirst().get();
                         Project project = allProjectList.stream().filter(p -> p.getProjectName().equals(pName)).findFirst().get();

+ 27 - 0
fhKeeper/formulahousekeeper/management-platform/src/main/resources/mapper/DepartmentMapper.xml

@@ -62,4 +62,31 @@
         GROUP BY b.project_id, a.id
         GROUP BY b.project_id, a.id
     </select>
     </select>
 
 
+    <!-- 根据人员获取自定义的日报数值 -->
+    <select id="getCustomDataByUser" resultType="java.util.Map">
+        SELECT a.id as id, a.name AS user, c.project_name AS project, IFNULL(SUM(b.custom_data),0) AS cost
+        FROM user AS a
+        LEFT JOIN report AS b ON a.id = b.creator_id
+        LEFT JOIN project AS c ON b.project_id = c.id
+        WHERE b.state = 1
+        <if test="departmentIds != null">
+            AND a.department_id IN
+            <foreach collection="departmentIds" item="departmentId" index="index" open="(" close=")" separator=",">
+                #{departmentId}
+            </foreach>
+        </if>
+        <if test="userIds != null">
+            AND a.id IN
+            <foreach collection="userIds" item="userId" index="index" open="(" close=")" separator=",">
+                #{userId}
+            </foreach>
+        </if>
+        <if test="companyId != null">
+            AND a.company_id = #{companyId}
+        </if>
+        <if test="startDate != null and endDate != null">
+            AND b.create_date between #{startDate} and #{endDate}
+        </if>
+        GROUP BY b.project_id, a.id
+    </select>
 </mapper>
 </mapper>

+ 45 - 0
fhKeeper/formulahousekeeper/management-platform/src/main/resources/mapper/ProjectMapper.xml

@@ -111,6 +111,28 @@
         ORDER BY a.id ASC
         ORDER BY a.id ASC
     </select>
     </select>
 
 
+
+    <!--获取自定义数值的项目统计 -->
+    <select id="getCustomDataSum" resultType="java.util.Map">
+        SELECT a.id, a.project_code as projectCode, a.project_name AS project, IFNULL(SUM(b.custom_data), 0) AS cost
+        FROM project AS a
+        LEFT JOIN report AS b ON b.project_id = a.id
+        JOIN user AS c ON b.creator_id = c.id
+        WHERE a.company_id = #{companyId}
+        <if test="projectId != null">
+            AND a.id = #{projectId}
+        </if>
+        <if test="userId != null">
+            AND b.creator_id = #{userId}
+        </if>
+        <if test="startDate != null and endDate != null">
+            AND b.create_date between #{startDate} and #{endDate}
+        </if>
+        AND b.state = 1
+        GROUP BY a.id
+        ORDER BY SUM(b.custom_data) DESC
+    </select>
+
     <!--获取日报的人员月度工时 -->
     <!--获取日报的人员月度工时 -->
     <select id="getTimeCostReport" resultType="java.util.Map">
     <select id="getTimeCostReport" resultType="java.util.Map">
         SELECT a.working_time as cost, b.id as projectId, b.project_name AS project, a.creator_id as creatorId
         SELECT a.working_time as cost, b.id as projectId, b.project_name AS project, a.creator_id as creatorId
@@ -157,6 +179,29 @@
         ORDER BY b.id ASC
         ORDER BY b.id ASC
     </select>
     </select>
 
 
+
+    <!-- 获取人员在日报填写的自定义数值 -->
+    <select id="getProjectCusDataSumItem" resultType="java.util.Map">
+        SELECT b.id as creatorId,project.project_code as projectCode, project.project_name as projectName,
+            b.name,department.department_name as departmentName, IFNULL(SUM(a.custom_data),0) AS cost
+        FROM report AS a
+        JOIN user AS b ON a.creator_id = b.id
+        left join department on department.department_id = b.department_id
+        left join project on project.id = a.project_id
+        WHERE a.state = 1 and b.company_id = #{companyId}
+        <if test="startDate != null and endDate != null">
+            AND a.create_date between #{startDate} and #{endDate}
+        </if>
+        <if test="projectId != null">
+            AND a.project_id = #{projectId}
+        </if>
+        <if test="userId != null">
+            AND a.creator_id = #{userId}
+        </if>
+        GROUP BY b.id
+        ORDER BY b.id ASC
+    </select>
+
     <!--按照项目内的阶段名称分组统计工时-->
     <!--按照项目内的阶段名称分组统计工时-->
     <select id="getCostInStage" resultType="java.util.Map">
     <select id="getCostInStage" resultType="java.util.Map">
         SELECT IFNULL(a.stage, "未分配") as name, SUM(a.working_time) AS cost, SUM(a.cost) AS costMoney
         SELECT IFNULL(a.stage, "未分配") as name, SUM(a.working_time) AS cost, SUM(a.cost) AS costMoney

+ 12 - 11
fhKeeper/formulahousekeeper/management-platform/src/main/resources/mapper/ReportMapper.xml

@@ -37,11 +37,12 @@
         <result column="is_final_audit" property="isFinalAudit" />
         <result column="is_final_audit" property="isFinalAudit" />
         <result column="project_audit_state" property="projectAuditState" />
         <result column="project_audit_state" property="projectAuditState" />
         <result column="group_id" property="groupId" />
         <result column="group_id" property="groupId" />
+        <result column="custom_data" property="customData" />
     </resultMap>
     </resultMap>
 
 
     <!-- 通用查询结果列 -->
     <!-- 通用查询结果列 -->
     <sql id="Base_Column_List">
     <sql id="Base_Column_List">
-        id, creator_id, project_id, create_date, working_time, content, state, create_time, time_type, cost, start_time, end_time, report_time_type, sub_project_id, task_id, is_overtime, progress, department_audit_state, stage, pic_str, multi_worktime, reject_reason, reject_username, reject_userid, degree_id, company_id, fill_userid, audit_deptid, is_dept_audit, audit_dept_managerid, is_final_audit, project_audit_state, group_id
+        id, creator_id, project_id, create_date, working_time, content, state, create_time, time_type, cost, start_time, end_time, report_time_type, sub_project_id, task_id, is_overtime, progress, department_audit_state, stage, pic_str, multi_worktime, reject_reason, reject_username, reject_userid, degree_id, company_id, fill_userid, audit_deptid, is_dept_audit, audit_dept_managerid, is_final_audit, project_audit_state, group_id, custom_data
     </sql>
     </sql>
 
 
 
 
@@ -52,7 +53,7 @@
         a.state, a.time_type as timeType, a.cost, a.report_time_type as reportTimeType, a.start_time as startTime,
         a.state, a.time_type as timeType, a.cost, a.report_time_type as reportTimeType, a.start_time as startTime,
         a.end_time as endTime, d.name as subProjectName,a.task_id as taskId, task.name as taskName, a.is_overtime as isOvertime,a.progress as progress,
         a.end_time as endTime, d.name as subProjectName,a.task_id as taskId, task.name as taskName, a.is_overtime as isOvertime,a.progress as progress,
         a.department_audit_state as departmentAuditState, a.pic_str as picStr, multi_worktime as multiWorktime
         a.department_audit_state as departmentAuditState, a.pic_str as picStr, multi_worktime as multiWorktime
-        , reject_reason as rejectReason, reject_username as rejectUsername, reject_userid as rejectUserid, degree_id as degree_id,report_extra_degree.name as degreeName,task_group.name as groupName,a.group_id as groupId
+        , reject_reason as rejectReason, reject_username as rejectUsername, reject_userid as rejectUserid, degree_id as degree_id,report_extra_degree.name as degreeName,task_group.name as groupName,a.group_id as groupId, a.custom_data as customData
         FROM report AS a
         FROM report AS a
         JOIN project AS b ON a.project_id=b.id
         JOIN project AS b ON a.project_id=b.id
         LEFT JOIN user AS c ON a.creator_id=c.id
         LEFT JOIN user AS c ON a.creator_id=c.id
@@ -81,7 +82,7 @@
         a.state, a.time_type as timeType, a.cost, a.report_time_type as reportTimeType, a.start_time as startTime,
         a.state, a.time_type as timeType, a.cost, a.report_time_type as reportTimeType, a.start_time as startTime,
         a.end_time as endTime, d.name as subProjectName,a.task_id as taskId, task.name as taskName, a.is_overtime as isOvertime,a.progress as progress,
         a.end_time as endTime, d.name as subProjectName,a.task_id as taskId, task.name as taskName, a.is_overtime as isOvertime,a.progress as progress,
         a.department_audit_state as departmentAuditState, a.pic_str as picStr, multi_worktime as multiWorktime
         a.department_audit_state as departmentAuditState, a.pic_str as picStr, multi_worktime as multiWorktime
-        , reject_reason as rejectReason, reject_username as rejectUsername, reject_userid as rejectUserid, degree_id as degree_id,report_extra_degree.name as degreeName,task_group.name as groupName,a.group_id as groupId
+        , reject_reason as rejectReason, reject_username as rejectUsername, reject_userid as rejectUserid, degree_id as degree_id,report_extra_degree.name as degreeName,task_group.name as groupName,a.group_id as groupId, a.custom_data as customData
         FROM report AS a
         FROM report AS a
         JOIN project AS b ON a.project_id=b.id
         JOIN project AS b ON a.project_id=b.id
         LEFT JOIN user AS c ON a.creator_id=c.id
         LEFT JOIN user AS c ON a.creator_id=c.id
@@ -107,7 +108,7 @@
         a.state, a.time_type as timeType, a.cost, a.report_time_type as reportTimeType, a.start_time as startTime,
         a.state, a.time_type as timeType, a.cost, a.report_time_type as reportTimeType, a.start_time as startTime,
         a.end_time as endTime, d.name as subProjectName,a.task_id as taskId, task.name as taskName, a.is_overtime as isOvertime,a.progress as progress,
         a.end_time as endTime, d.name as subProjectName,a.task_id as taskId, task.name as taskName, a.is_overtime as isOvertime,a.progress as progress,
         a.department_audit_state as departmentAuditState, a.pic_str as picStr, multi_worktime as multiWorktime
         a.department_audit_state as departmentAuditState, a.pic_str as picStr, multi_worktime as multiWorktime
-        , reject_reason as rejectReason, reject_username as rejectUsername, reject_userid as rejectUserid, degree_id as degree_id,report_extra_degree.name as degreeName,task_group.name as groupName,a.group_id as groupId
+        , reject_reason as rejectReason, reject_username as rejectUsername, reject_userid as rejectUserid, degree_id as degree_id,report_extra_degree.name as degreeName,task_group.name as groupName,a.group_id as groupId, a.custom_data as customData
         FROM report AS a
         FROM report AS a
         JOIN project AS b ON a.project_id=b.id
         JOIN project AS b ON a.project_id=b.id
         LEFT JOIN user AS c ON a.creator_id=c.id
         LEFT JOIN user AS c ON a.creator_id=c.id
@@ -133,7 +134,7 @@
         a.state, a.time_type as timeType, a.cost, a.report_time_type as reportTimeType, a.start_time as startTime,
         a.state, a.time_type as timeType, a.cost, a.report_time_type as reportTimeType, a.start_time as startTime,
         a.end_time as endTime, d.name as subProjectName,a.task_id as taskId, task.name as taskName, a.is_overtime as isOvertime,a.progress as progress,
         a.end_time as endTime, d.name as subProjectName,a.task_id as taskId, task.name as taskName, a.is_overtime as isOvertime,a.progress as progress,
         a.department_audit_state as departmentAuditState, a.pic_str as picStr, multi_worktime as multiWorktime
         a.department_audit_state as departmentAuditState, a.pic_str as picStr, multi_worktime as multiWorktime
-        , reject_reason as rejectReason, reject_username as rejectUsername, reject_userid as rejectUserid, degree_id as degree_id,report_extra_degree.name as degreeName,task_group.name as groupName,a.group_id as groupId
+        , reject_reason as rejectReason, reject_username as rejectUsername, reject_userid as rejectUserid, degree_id as degree_id,report_extra_degree.name as degreeName,task_group.name as groupName,a.group_id as groupId, a.custom_data as customData
         FROM report AS a
         FROM report AS a
         JOIN project AS b ON a.project_id=b.id
         JOIN project AS b ON a.project_id=b.id
         LEFT JOIN user AS c ON a.creator_id=c.id
         LEFT JOIN user AS c ON a.creator_id=c.id
@@ -166,7 +167,7 @@
         a.creator_id as creatorId, d.name as subProjectName,a.task_id as taskId, task.name as taskName, a.is_overtime as isOvertime,a.progress as progress,
         a.creator_id as creatorId, d.name as subProjectName,a.task_id as taskId, task.name as taskName, a.is_overtime as isOvertime,a.progress as progress,
         a.department_audit_state as departmentAuditState, a.stage, a.pic_str as picStr, multi_worktime as multiWorktime
         a.department_audit_state as departmentAuditState, a.stage, a.pic_str as picStr, multi_worktime as multiWorktime
         , reject_reason as rejectReason, reject_username as rejectUsername, reject_userid as rejectUserid, degree_id as degree_id,report_extra_degree.name as degreeName,
         , reject_reason as rejectReason, reject_username as rejectUsername, reject_userid as rejectUserid, degree_id as degree_id,report_extra_degree.name as degreeName,
-        department.department_name as auditDeptName, a.is_dept_audit as isDeptAudit, a.project_audit_state as projectAuditState,task_group.name as groupName,a.group_id as groupId
+        department.department_name as auditDeptName, a.is_dept_audit as isDeptAudit, a.project_audit_state as projectAuditState,task_group.name as groupName,a.group_id as groupId, a.custom_data as customData
         FROM report AS a
         FROM report AS a
         JOIN project AS b ON a.project_id=b.id
         JOIN project AS b ON a.project_id=b.id
         left join sub_project as d on d.id = a.sub_project_id
         left join sub_project as d on d.id = a.sub_project_id
@@ -190,7 +191,7 @@
         a.creator_id as creatorId, d.name as subProjectName,a.task_id as taskId, task.name as taskName, a.is_overtime as isOvertime,a.progress as progress,
         a.creator_id as creatorId, d.name as subProjectName,a.task_id as taskId, task.name as taskName, a.is_overtime as isOvertime,a.progress as progress,
         a.department_audit_state as departmentAuditState, a.stage, a.pic_str as picStr, multi_worktime as multiWorktime
         a.department_audit_state as departmentAuditState, a.stage, a.pic_str as picStr, multi_worktime as multiWorktime
         , reject_reason as rejectReason, reject_username as rejectUsername, reject_userid as rejectUserid, degree_id as degree_id,report_extra_degree.name as degreeName,
         , reject_reason as rejectReason, reject_username as rejectUsername, reject_userid as rejectUserid, degree_id as degree_id,report_extra_degree.name as degreeName,
-        department.department_name as auditDeptName, a.is_dept_audit as isDeptAudit, a.project_audit_state as projectAuditState,task_group.name as groupName,a.group_id as groupId
+        department.department_name as auditDeptName, a.is_dept_audit as isDeptAudit, a.project_audit_state as projectAuditState,task_group.name as groupName,a.group_id as groupId, a.custom_data as customData
         FROM report AS a
         FROM report AS a
         JOIN project AS b ON a.project_id=b.id
         JOIN project AS b ON a.project_id=b.id
         left join sub_project as d on d.id = a.sub_project_id
         left join sub_project as d on d.id = a.sub_project_id
@@ -217,7 +218,7 @@
         a.creator_id as creatorId, d.name as subProjectName,a.task_id as taskId, task.name as taskName, a.is_overtime as isOvertime,a.progress as progress,
         a.creator_id as creatorId, d.name as subProjectName,a.task_id as taskId, task.name as taskName, a.is_overtime as isOvertime,a.progress as progress,
         a.department_audit_state as departmentAuditState, a.stage, a.pic_str as picStr, multi_worktime as multiWorktime
         a.department_audit_state as departmentAuditState, a.stage, a.pic_str as picStr, multi_worktime as multiWorktime
         , reject_reason as rejectReason, reject_username as rejectUsername, reject_userid as rejectUserid, degree_id as degree_id,report_extra_degree.name as degreeName,
         , reject_reason as rejectReason, reject_username as rejectUsername, reject_userid as rejectUserid, degree_id as degree_id,report_extra_degree.name as degreeName,
-        department.department_name as auditDeptName, a.is_dept_audit as isDeptAudit, a.project_audit_state as projectAuditState,task_group.name as groupName,a.group_id as groupId
+        department.department_name as auditDeptName, a.is_dept_audit as isDeptAudit, a.project_audit_state as projectAuditState,task_group.name as groupName,a.group_id as groupId, a.custom_data as customData
         FROM report AS a
         FROM report AS a
         left join user on user.id = a.creator_id
         left join user on user.id = a.creator_id
         JOIN project AS b ON a.project_id=b.id
         JOIN project AS b ON a.project_id=b.id
@@ -261,7 +262,7 @@
         a.creator_id as creatorId, d.name as subProjectName,a.task_id as taskId, task.name as taskName,
         a.creator_id as creatorId, d.name as subProjectName,a.task_id as taskId, task.name as taskName,
         a.is_overtime as isOvertime,a.progress as progress, a.stage, a.pic_str as picStr, multi_worktime as multiWorktime
         a.is_overtime as isOvertime,a.progress as progress, a.stage, a.pic_str as picStr, multi_worktime as multiWorktime
         , reject_reason as rejectReason, reject_username as rejectUsername, reject_userid as rejectUserid, degree_id as degree_id,report_extra_degree.name as degreeName,
         , reject_reason as rejectReason, reject_username as rejectUsername, reject_userid as rejectUserid, degree_id as degree_id,report_extra_degree.name as degreeName,
-        task_group.name as groupName,a.group_id as groupId
+        task_group.name as groupName,a.group_id as groupId, a.custom_data as customData
         FROM report AS a
         FROM report AS a
         JOIN project AS b ON a.project_id=b.id
         JOIN project AS b ON a.project_id=b.id
         left join sub_project as d on d.id = a.sub_project_id
         left join sub_project as d on d.id = a.sub_project_id
@@ -287,7 +288,7 @@
         a.is_overtime as isOvertime,a.progress as progress,
         a.is_overtime as isOvertime,a.progress as progress,
         a.department_audit_state as departmentAuditState, a.stage, a.pic_str as picStr, multi_worktime as multiWorktime
         a.department_audit_state as departmentAuditState, a.stage, a.pic_str as picStr, multi_worktime as multiWorktime
         , reject_reason as rejectReason, reject_username as rejectUsername, reject_userid as rejectUserid, degree_id as degree_id,report_extra_degree.name as degreeName,
         , reject_reason as rejectReason, reject_username as rejectUsername, reject_userid as rejectUserid, degree_id as degree_id,report_extra_degree.name as degreeName,
-        department.department_name as auditDeptName, a.is_dept_audit as isDeptAudit, a.project_audit_state as projectAuditState,task_group.name as groupName,a.group_id as groupId
+        department.department_name as auditDeptName, a.is_dept_audit as isDeptAudit, a.project_audit_state as projectAuditState,task_group.name as groupName,a.group_id as groupId, a.custom_data as customData
         FROM report AS a
         FROM report AS a
         JOIN project AS b ON a.project_id=b.id
         JOIN project AS b ON a.project_id=b.id
         left join sub_project as d on d.id = a.sub_project_id
         left join sub_project as d on d.id = a.sub_project_id
@@ -397,7 +398,7 @@
         a.end_time as endTime, b.incharger_id as inchargerId,
         a.end_time as endTime, b.incharger_id as inchargerId,
         a.creator_id as creatorId, d.name as subProjectName,a.task_id as taskId, task.name as taskName, a.is_overtime as isOvertime,a.progress as progress,
         a.creator_id as creatorId, d.name as subProjectName,a.task_id as taskId, task.name as taskName, a.is_overtime as isOvertime,a.progress as progress,
         a.department_audit_state as departmentAuditState, a.stage, a.pic_str as picStr, multi_worktime as multiWorktime
         a.department_audit_state as departmentAuditState, a.stage, a.pic_str as picStr, multi_worktime as multiWorktime
-        , reject_reason as rejectReason, reject_username as rejectUsername, reject_userid as rejectUserid, degree_id as degree_id,report_extra_degree.name as degreeName
+        , reject_reason as rejectReason, reject_username as rejectUsername, reject_userid as rejectUserid, degree_id as degree_id,report_extra_degree.name as degreeName, a.custom_data as customData
         FROM report AS a
         FROM report AS a
         left join user on user.id = a.creator_id
         left join user on user.id = a.creator_id
         JOIN project AS b ON a.project_id=b.id
         JOIN project AS b ON a.project_id=b.id

+ 10 - 10
fhKeeper/formulahousekeeper/timesheet/config/index.js

@@ -4,19 +4,19 @@ var path = require('path')
 // var ip = '192.168.2.36'
 // var ip = '192.168.2.36'
 
 
  
  
-var ip = '47.100.37.243' 
+// var ip = '47.100.37.243' 
 // var ip = '192.168.2.159'
 // var ip = '192.168.2.159'
 
 
-// var os = require('os'), ip = '', ifaces = os.networkInterfaces() // 获取本机ip
+var os = require('os'), ip = '', ifaces = os.networkInterfaces() // 获取本机ip
 
 
-// for (var i in ifaces) {
-//     for (var j in ifaces[i]) {
-//         var val = ifaces[i][j]
-//         if (val.family === 'IPv4' && val.address !== '127.0.0.1') {
-//             ip = val.address
-//         }
-//     }
-// }
+for (var i in ifaces) {
+    for (var j in ifaces[i]) {
+        var val = ifaces[i][j]
+        if (val.family === 'IPv4' && val.address !== '127.0.0.1') {
+            ip = val.address
+        }
+    }
+}
 
 
 module.exports = {
 module.exports = {
   build: {
   build: {

+ 13 - 2
fhKeeper/formulahousekeeper/timesheet/src/main.js

@@ -58,10 +58,10 @@ import 'nprogress/nprogress.css'
 var addRouFlag = false; 
 var addRouFlag = false; 
 //角色权限对应关系
 //角色权限对应关系
 var userModules = [{role:0, modules:["工时报告","专业审核","部门审核","自动计时","费用报销","待办任务", "项目管理", "请假管理"]},
 var userModules = [{role:0, modules:["工时报告","专业审核","部门审核","自动计时","费用报销","待办任务", "项目管理", "请假管理"]},
-            {role:3, modules:["工时报告","工时成本统计","项目报表服务","费用报销","待办任务","项目管理","请假管理"]},
+            {role:3, modules:["工时报告","工时成本统计","自定义数值统计","项目报表服务","费用报销","待办任务","项目管理","请假管理"]},
             {role:4, modules:["财务核算成本", "费用报销", "待办任务","组织架构","请假管理"]},
             {role:4, modules:["财务核算成本", "费用报销", "待办任务","组织架构","请假管理"]},
             {role:5, modules:["工时报告","自动计时","费用报销", "待办任务","项目管理","专业管理","请假管理"]},
             {role:5, modules:["工时报告","自动计时","费用报销", "待办任务","项目管理","专业管理","请假管理"]},
-            {role:6, modules:["工时报告","工时成本统计","财务核算成本","项目报表服务","费用报销","待办任务","项目管理","请假管理"]},];
+            {role:6, modules:["工时报告","工时成本统计","自定义数值统计","财务核算成本","项目报表服务","费用报销","待办任务","项目管理","请假管理"]},];
 
 
 // var userModules = [{role:0, modules:["工时报告","专业审核","部门审核","自动计时","费用报销","待办任务", "项目管理", "请假管理","组织架构"]},
 // var userModules = [{role:0, modules:["工时报告","专业审核","部门审核","自动计时","费用报销","待办任务", "项目管理", "请假管理","组织架构"]},
 //             {role:3, modules:["工时报告","工时成本统计","项目报表服务","费用报销","待办任务","项目管理","请假管理","组织架构"]},
 //             {role:3, modules:["工时报告","工时成本统计","项目报表服务","费用报销","待办任务","项目管理","请假管理","组织架构"]},
@@ -118,6 +118,17 @@ router.beforeEach((to, from, next) => {
                         //没有开启导入日报审核,则不需要
                         //没有开启导入日报审核,则不需要
                         filterRouter = filterRouter.filter(r=>{return r.name != '导入日报审核'});
                         filterRouter = filterRouter.filter(r=>{return r.name != '导入日报审核'});
                     }
                     }
+                    if (user.timeType.customDataActive == 0) {
+                        //没有开启导入日报审核,则不需要
+                        filterRouter = filterRouter.filter(r=>{return r.name != '自定义数值统计'});
+                    } else {
+                        var customMenu = filterRouter.filter(r=>{return r.name == '自定义数值统计'});
+                        if (customMenu.length > 0) {
+                            console.log(customMenu,'111');
+                            customMenu[0].children[0].name = user.timeType.customDataName + '统计';
+                        }
+                        
+                    }
                     
                     
                     if (user.role == 1 || user.role == 2) {
                     if (user.role == 1 || user.role == 2) {
                         getRoutes = filterRouter;
                         getRoutes = filterRouter;

+ 12 - 0
fhKeeper/formulahousekeeper/timesheet/src/routes.js

@@ -63,6 +63,7 @@ import tasks from './views/task/list';
 
 
 // 请假
 // 请假
 import leave from './views/leave/list';
 import leave from './views/leave/list';
+import customData from './views/project/custom_data';
 
 
 // 研究中心
 // 研究中心
 // import research from './views/research/list';
 // import research from './views/research/list';
@@ -194,6 +195,17 @@ export const allRouters = [//组织架构
             { path: '/costDep/:id/:name', component: depDetail, name: '成本详情', hidden: true },
             { path: '/costDep/:id/:name', component: depDetail, name: '成本详情', hidden: true },
         ]
         ]
     },
     },
+    //自定义数值统计
+    {
+        path: '/',
+        component: Home,
+        name: '自定义数值统计',
+        iconCls: 'iconfont firerock-icontongji',
+        leaf: true,
+        children: [
+            { path: '/customData', component: customData, name: '自定义数值统计' }
+        ]
+    },
     
     
     //每月财务成本
     //每月财务成本
     {
     {

+ 693 - 0
fhKeeper/formulahousekeeper/timesheet/src/views/project/custom_data.vue

@@ -0,0 +1,693 @@
+<template>
+    <section>
+        <el-row style="padding-bottom: 0px;text-align:center;margin-top:20px;z-index: 999;">
+        <el-col :span="6" >
+            <div>&nbsp;</div>
+        </el-col>
+        <el-col :span="12" style="">
+            <el-date-picker 
+            v-model="dateRange" :editable="false" 
+            format="yyyy-MM-dd" value-format="yyyy-MM-dd" 
+            @change="getEchart" 
+            :clearable="true" 
+            range-separator="至"
+            type="daterange" 
+            start-placeholder="开始日期"
+            end-placeholder="结束日期"
+            ></el-date-picker>
+
+            <el-radio-group v-model="radio" @change="getEchart" style="margin-left:10px;">
+                <el-radio-button label="项目"></el-radio-button>
+                <!-- <el-radio-button label="部门"></el-radio-button> -->
+                <el-radio-button label="人员"></el-radio-button>
+                <!-- <el-radio-button :label="namess" v-if="jichu.customDegreeActive == 1"></el-radio-button> -->
+            </el-radio-group>
+        </el-col>
+        <el-col :span="6">
+            <el-button @click="showExportDialog">报表导出</el-button>
+        </el-col>
+        </el-row>
+        <div :style="'width:'+widthHtval+'px;position: relative; height:'+containerHeight+'px;'">
+             <div id="container" :style="'height:'+containerHeight+'px;width:100%'"></div>
+        </div>
+        <div style="position:fixed;top:170px;left:600px;" v-show="radio=='部门' && parentDeptId != null">
+            <el-button @click="backToParentDept">返回上级</el-button>
+        </div>
+
+        <!--导出报表条件选择 -->
+        <el-dialog title="工时报表导出" v-if="exportDialog" :visible.sync="exportDialog" :close-on-click-modal="false" customClass="customWidth" width="500px">
+            <el-form ref="form3" :model="exportParam" >
+                <el-form-item prop="projectId" label="选择项目" >
+                    <el-select v-model="exportParam.projectId" placeholder="全部项目"  clearable style="width:350px;" filterable="true">
+                        <el-option v-for="item in projectList"  :key="item.id" :label="item.projectName" :value="item.id"></el-option>
+                    </el-select>
+                </el-form-item>
+                <!-- <el-form-item prop="userIds" label="选择人员" >
+                    <el-select v-model="exportParam.userIds" placeholder="全部人员" multiple="true"  clearable style="width:350px;" filterable="true">
+                        <el-option v-for="item in hasReportUserList"  :key="item.id" :label="item.name" :value="item.id"></el-option>
+                    </el-select>
+                </el-form-item> -->
+
+                <el-form-item prop="projectId" :label="user.timeType.fixMonthcost==0?'日期范围':'选择月份'">
+                    <el-date-picker v-show="user.timeType.fixMonthcost==0"
+                        v-model="exportParam.dateRange" :editable="false" 
+                        format="yyyy-MM-dd" value-format="yyyy-MM-dd" 
+                        :clearable="false" 
+                        range-separator="至"
+                        type="daterange" 
+                        start-placeholder="开始日期"
+                        end-placeholder="结束日期"
+                    ></el-date-picker>
+                </el-form-item>
+                
+                <!-- <el-form-item label="选择人员" v-if="radio == '项目' || radio == '部门'">
+                    <el-select v-model="exportParam.userId"  placeholder="请选择人员" style="width: 350px" filterable="true">
+                        <span v-for="(item, index) in users" :key="index">
+                        <el-option :label="item.name" :value="item.id"></el-option>
+                        </span> 
+                    </el-select>
+                </el-form-item> -->
+            </el-form>
+            <div slot="footer" class="dialog-footer">
+                <el-button type="primary" @click="exportProjectData" style="width:100%;" >导出</el-button>
+            </div>
+        </el-dialog>
+    </section>
+</template>
+
+<script>
+    import util from "../../common/js/util";
+    export default {
+        data() {
+            return {
+                yAxisValue: localStorage.yAxisValue?localStorage.yAxisValue:0,
+                parentDeptStack:[],
+                parentDeptId:null,
+                hasReportUserList:[],
+                projectList:[],
+                exportParam:{projectId:null,dateRange:[],userId: null},
+                exportDialog:false,
+                dateRange:[],
+                user: JSON.parse(sessionStorage.getItem("user")),
+                radio: sessionStorage.radio!=null?sessionStorage.radio:'项目',
+                containerHeight: 0,    
+                myChart: null,
+                params: null,
+                widthHtval: document.body.clientWidth - 230,
+                users: [],
+                jichu: [],
+                namess: '',
+                timers: null, // 点击的时间
+                zhishin: 0
+            };
+        },
+        methods: {
+            //Y轴点击改变显示的数据
+            onYAxisChange() {
+                localStorage.yAxisValue = this.yAxisValue;
+                this.jieliu();
+            },
+            jutishez() {
+                this.http.post('/time-type/getCompanyTimeSetting', {
+                    companyId: this.user.companyId,
+                },
+                res => {
+                    if (res.code == "ok") {
+                        this.jichu = res.data
+                        if(res.data.customDegreeActive == 1) {
+                            this.namess = res.data.customDegreeName
+                        }
+                    } else {
+                        this.$message({
+                        message: res.msg,
+                        type: "error"
+                        });
+                    }
+                },
+                error => {
+                    this.$message({
+                        message: error,
+                        type: "error"
+                    });
+                });
+            },
+            getUsers() {
+                console.log(this.port.manage.list)
+                this.http.post(this.port.manage.list, {
+                        departmentId: -1,
+                        pageIndex: 1,
+                        pageSize: 99999
+                    },
+                    res => {
+                        if (res.code == "ok") {
+                            this.users = res.data.records;
+                        } else {
+                            this.$message({
+                            message: res.msg,
+                            type: "error"
+                            });
+                        }
+                    },
+                    error => {
+                        this.$message({
+                            message: error,
+                            type: "error"
+                        });
+                    });
+                },
+            
+            showExportDialog() {
+                this.exportDialog = true;
+                this.exportParam.dateRange = this.dateRange;
+            },
+            //获取我的项目列表
+            getMyProjectList() {
+                this.http.post('/project/getProjectList', {
+                },
+                res => {
+                    if (res.code == "ok") {
+                        this.projectList = res.data;
+                    } else {
+                        this.$message({
+                        message: res.msg,
+                        type: "error"
+                        });
+                    }
+                },
+                error => {
+                    this.$message({
+                        message: error,
+                        type: "error"
+                    });
+                });
+            },
+            exportProjectData() {
+                 var param = {};
+                 if (this.exportParam.dateRange != null) {
+                    param = {startDate:this.exportParam.dateRange[0], endDate: this.exportParam.dateRange[1]};
+                 }
+                 var url = "/project/exportCustomDataSum";
+                 var fileName = this.user.timeType.customDataName + '统计.xls';
+                //  if (this.radio == '人员' ) {
+                //      console.log(this.exportParam.userIds);
+                //      fileName = '人员工时成本统计.xls';
+                //      url = '/department/exportUserStatistic';
+                //      if (this.exportParam.userIds != null && this.exportParam.userIds.length > 0) {
+                //          var ids = '';
+                //         this.exportParam.userIds.forEach(u=>{
+                //             ids += u+',';
+                //         })
+                //         param.userIds = ids;
+                //      }
+                //  } 
+                
+                if (this.exportParam.projectId != null) {
+                    param.projectId = this.exportParam.projectId;
+                }
+                this.http.post(url, param,
+                    res => {
+                        this.listLoading = false;
+                        if (res.code == "ok") {
+                            this.exportDialog = false;
+                            var aTag = document.createElement('a');
+                            aTag.download = fileName;
+                            aTag.href = res.data;
+                            aTag.click();
+                        } else {
+                            this.$message({
+                                message: res.msg,
+                                type: "error"
+                            });
+                        }
+                    },
+                    error => {
+                        this.listLoading = false;
+                        this.$message({
+                            message: error,
+                            type: "error"
+                        });
+                    });
+            },
+            //获取人员成本统计列表
+            getUserCostList() {
+                this.listLoading = true;
+                this.http.post('/department/getUserCustomDataStatistic', {
+                    startDate:this.user.timeType.fixMonthcost==0?this.dateRange[0]:this.dateRange, 
+                    endDate: this.user.timeType.fixMonthcost==0?this.dateRange[1]:this.dateRange
+                },
+                res => {
+                    this.listLoading = false;
+                    var _this = this;
+                    this.hasReportUserList = [];
+                    if (res.code == "ok") {
+                        //工时总成本
+                        this.hasReportUserList = res.data.userList;
+                        var xList = [] , yList = [] , list = res.data.list, array = [] , series = [];
+                        
+                        var totalHours = 0.0;
+                        if (list.length > 0) {
+                            var num = list.length==0?0:list[0].project.length;
+                            for(var i in list) {
+                                xList.push(list[i].name);
+                                var pro = list[i].project;
+                                for(var j in pro) {
+                                    if(array.indexOf(pro[j].project) == -1) {
+                                        array.push(pro[j].project)
+                                    }
+                                }
+                            }
+
+                            for(var i in array) {
+                                yList.push(array[i]);
+                                var dataList = [];
+                                for(var j in list) {
+                                    var project = list[j].project , num = 0;
+                                    if(project.length != 0) {
+                                        for(var k in project) {
+                                            if(project[k].project == array[i]) {
+                                                dataList.push({
+                                                    "value": project[k].cost,
+                                                    "cost": project[k].cost
+                                                })
+                                                totalHours += parseFloat(project[k].cost);
+                                            } else {
+                                                num++;
+                                            }
+                                            if(k == project.length-1 && num != project.length-1) {
+                                                dataList.push({
+                                                    "value": 0,
+                                                    "cost": 0
+                                                })
+                                            }
+                                        }
+                                    } else {
+                                        dataList.push({
+                                            "value": 0,
+                                            "cost": 0,
+                                        })
+                                    }
+                                }
+                                series.push({
+                                    name: array[i],
+                                    type: 'bar',
+                                    stack:'1',
+                                    barMaxWidth: 30,
+                                    data: dataList,
+                                })
+                            }
+                        } 
+                            
+                            
+                            var myChart = echarts.init(document.getElementById("container"));
+                            totalHours = totalHours.toFixed(1);
+                            _this.myChart = myChart;
+                            var option = {
+                                //总成本
+                                title: {
+                                    text: _this.user.timeType.customDataName + '总计' + totalHours,
+                                    left:'left',
+                                },
+                                
+                                // 工具箱
+                                legend: {
+                                    x: 80,
+                                    y: 10,
+                                    data: yList,
+                                    show: true,
+                               top:"5%",//与上方的距离 可百分比% 可像素px
+                                },
+                                grid : {
+                                    top : 80,    //距离容器上边界40像素
+                                    bottom: 35   //距离容器下边界30像素
+                                },
+                                toolbox: {
+                                    show: true,
+                                    feature:{
+                                        saveAsImage:{
+                                            show:true
+                                        },
+                                        restore:{
+                                            show:true
+                                        },
+                                        // dataView:{
+                                        //     show:true
+                                        // },
+                                        // dataZoom:{
+                                        //     show:true
+                                        // },
+                                        magicType:{
+                                            type:['line','bar']
+                                        }
+                                    }
+                                },
+                                tooltip:{
+                                    trigger:'axis',
+                                    formatter: function (params,ticket,callback) {
+                                        var totalTime = 0;
+                                        var res = "";
+                                        for(var i in params) {
+                                            if (params[i].data.value > 0) {
+                                                res += "<div style='margin-top:3px;font-size:12px;'><font color='#ddd'>项目名称:" + params[i].seriesName 
+                                                    + "</font><br/>"+_this.user.timeType.customDataName+" : " + params[i].data.cost+"</div>";
+                                                totalTime += Number(params[i].data.cost);
+                                            }
+                                        }
+                                        res = res +'<br/>'+ params[0].name+ '<br/>总计: ' + totalTime.toFixed(1);
+                                        return res;
+                                    }
+                                },
+                                xAxis: {
+                                    data: xList,
+                                    axisLabel: {
+                                        interval:0,rotate:20
+                                    }
+                                },
+                                yAxis: [{
+                                    type : 'value',
+                                    axisLabel: {
+                                        formatter:'{value}'
+                                    }
+                                }],
+                                series: series,
+                            };
+                            myChart.setOption(option,{notMerge:true});
+                    } else {
+                        this.$message({
+                        message: res.msg,
+                        type: "error"
+                        });
+                    }
+                },
+                error => {
+                    this.listLoading = false;
+                    this.$message({
+                        message: error,
+                        type: "error"
+                    });
+                });
+            },
+            yanjiu() {
+                console.log('触发')
+            },
+            getEchart(){
+                var that = this
+                // that.timers = setTimeout(()=>{
+                    // clearTimeout(that.timers)
+                    // console.log(that.timers)
+                    that.jieliu()
+                // },100);
+                // this.jieliu()
+            },
+            backToParentDept() {
+                if (this.radio == '部门') {
+                    if (this.parentDeptStack.length > 0) {
+                        this.parentDeptStack.pop();
+                        if (this.parentDeptStack.length > 0) {
+                            this.parentDeptId = this.parentDeptStack[this.parentDeptStack.length -1];
+                        } else {
+                            this.parentDeptId = null;
+                        }
+                        this.jieliu();
+                    }
+                }
+            },
+            // 脱离出来的方法
+            jieliu() {
+                sessionStorage.radio = this.radio;
+                var _this = this;
+                var param = {};
+                if (this.dateRange != null) {
+                    param = {startDate:this.user.timeType.fixMonthcost==0?this.dateRange[0]:this.dateRange, 
+                    endDate: this.user.timeType.fixMonthcost==0?this.dateRange[1]:this.dateRange};
+                    console.log(param);
+                }
+                var url = '';
+                if (this.radio=='项目') {
+                    url = '/project/getCustomDataSum';
+                } else if (this.radio=='部门') {
+                    url = this.port.project.depCost;
+                    param.parentDeptId = this.parentDeptId;
+                } else if (this.radio=='人员') {
+                    this.getUserCostList();
+                    return;
+                } else if (this.radio == this.namess) {
+                    url = '/project/getDegreeCost'
+                }
+                this.http.post(url, param,
+                res => {
+                    if (res.code == "ok") {
+                        for(var i in res.data.costList) {
+                            if(i>20) {
+                                // this.widthHtval = +this.widthHtval + 2
+                                this.widthHtval = +this.widthHtval + 40
+                            } else {
+                                this.widthHtval = document.body.clientWidth - 230
+                            }
+                        }
+                            
+                        // 测试写的
+                        var xList = []
+                        var yList = []
+                        var list
+                        var totalMoneyCost;
+                        var totalHours = 0.0;
+                        if(this.radio == '项目' || this.radio=='部门') {
+                            list = res.data.costList
+                            totalMoneyCost = ((this.radio=='项目')?res.data.totalMoneyCost:res.data.totalCostMoney);
+                            for(var i in list) {
+                                if(this.radio=='项目') {
+                                    xList.push(this.radio=='项目'?list[i].project:list[i].name);
+                                    yList.push({
+                                        "value": list[i].cost.toFixed(1),
+                                        "id": list[i].id || i,
+                                        "cost": list[i].cost
+                                    });
+                                    totalHours += parseFloat(list[i].cost);
+                                } else {
+                                    xList.push(list[i].departmentName);
+                                    yList.push({
+                                        "value": list[i].costTime.toFixed(1),
+                                        "id": list[i].departmentId,
+                                        "cost": list[i].costTime,
+                                        "hasSubDept": list[i].hasSubDept
+                                    });
+                                    totalHours += parseFloat(list[i].costTime);
+                                }
+                            }
+                        } else {
+                            list = res.data
+                            var totalMoneyCost = 0;
+                            for(var i in list) {
+                                console.log(list[i].name, list[i].costMoney, list[i].cost)
+                                xList.push(list[i].name);
+                                yList.push({
+                                    "value": this.yAxisValue==0?list[i].costMoney:list[i].cost,
+                                    "id": list[i].id || i,
+                                    "cost": list[i].cost,
+                                    "money":list[i].costMoney.toFixed(2)
+                                });
+                                totalHours += parseFloat(list[i].cost);
+                                totalMoneyCost += parseFloat(list[i].costMoney);
+                            }
+                        }
+                        totalHours = totalHours.toFixed(1);
+                        
+                        var myChart = echarts.init(document.getElementById("container"));
+                        myChart.resize({
+                            width: this.widthHtval
+                        })
+                        _this.myChart = myChart;
+                        // console.log(totalMoneyCost.toFixed(2), '看看', totalMoneyCost)
+                        // var chengbentongji = totalMoneyCost.toFixed(2) || totalMoneyCost
+                        if(totalMoneyCost) {
+                            this.zhishin = totalMoneyCost.toFixed(2)
+                        } 
+                        if(this.radio == '项目' || this.radio == '人员' || this.radio=='部门') {
+                            var option = {
+                                title: {
+                                    text: _this.user.timeType.customDataName+'总计:' + totalHours,
+                                    left:'left',
+                                },
+                                // 工具箱
+                                toolbox: {
+                                    show: true,
+                                    feature:{
+                                        saveAsImage:{show:true},restore:{show:true}, magicType:{ type:['line','bar']},
+                                    }
+                                },
+                                tooltip:{
+                                    trigger:'axis',
+                                    formatter: function (params,ticket,callback) {
+                                        var res = params[0].name + "<br/>"+_this.user.timeType.customDataName+" : " + params[0].data.cost;
+                                        _this.params = params;
+                                        return res;
+                                    }
+                                },
+                                xAxis: {
+                                    data: xList,
+                                    axisLabel: {
+                                        interval:0,rotate:20
+                                    }
+                                },
+                                yAxis: [{
+                                    type : 'value',
+                                    axisLabel: {
+                                        formatter:'{value}'
+                                    }
+                                }],
+                                series: [{
+                                    name: _this.user.timeType.customDataName,
+                                    type: 'bar',
+                                    barMaxWidth: 30,
+                                    data: yList,
+                                }]
+                            };
+                        } else {
+                            var option = {
+                                title: {
+                                    text: '工时成本总计' + _this.zhishin + '元, 时长'+totalHours+'小时',
+                                    left:'left',
+                                },
+                                // 工具箱
+                                toolbox: {
+                                    show: true,
+                                    feature:{
+                                        saveAsImage:{show:true},restore:{show:true}, magicType:{ type:['line','bar']},
+                                    }
+                                },
+                                tooltip:{
+                                    trigger:'axis',
+                                    formatter: function (params,ticket,callback) {
+                                        var res = params[0].name + "<br/>工作成本"+" : " + params[0].data.money 
+                                        + "元 <br/>工作时长"+" : " + params[0].data.cost + "小时";
+                                        _this.params = params;
+                                        return res;
+                                    }
+                                },
+                                xAxis: {
+                                    data: xList,
+                                    axisLabel: {
+                                        interval:0,rotate:20
+                                    }
+                                },
+                                yAxis: [{
+                                    type : 'value',
+                                    axisLabel: {
+                                        formatter:this.yAxisValue==0?'{value} (元)':'{value}小时'
+                                    }
+                                }],
+                                series: [{
+                                    name: this.yAxisValue==0?'工作成本(元)':'工作时长(小时)',
+                                    type: 'bar',
+                                    barMaxWidth: 30,
+                                    data: yList,
+                                }]
+                            };
+                        }
+                        
+                        myChart.setOption(option,{notMerge: true});
+                        myChart.getZr().on('click', params => {
+                            const pointInPixel = [params.offsetX, params.offsetY];
+                            if (myChart.containPixel('grid', pointInPixel)) {
+                                console.log(_this.params)
+                                if(_this.radio=='项目') {
+                                    if (_this.dateRange != null) {
+                                        if (this.user.timeType.fixMonthcost == 0) {
+                                            _this.$router.push("/cost/" + _this.params[0].data.id + "/" + _this.params[0].name
+                                            +"?startDate="+_this.dateRange[0]+"&endDate="+_this.dateRange[1]);
+                                        } else {
+                                            _this.$router.push("/cost/" + _this.params[0].data.id + "/" + _this.params[0].name
+                                            +"?startDate="+_this.dateRange+"&endDate="+_this.dateRange);
+                                        }
+                                    } else {
+                                        _this.$router.push("/cost/" + _this.params[0].data.id + "/" + _this.params[0].name);
+                                    }
+                                } else if (_this.radio=='部门') {
+                                    if (_this.params[0].data.hasSubDept) {
+                                        if (_this.parentDeptId != _this.params[0].data.id) {
+                                            _this.parentDeptId = _this.params[0].data.id;
+                                            _this.parentDeptStack.push(_this.parentDeptId);
+                                            _this.jieliu();
+                                        }
+                                        // _this.jieliu();
+                                    } else {
+                                        if (_this.dateRange != null) {
+                                            _this.$router.push("/costDep/" + _this.params[0].data.id + "/" + _this.params[0].name
+                                                +"?startDate="+_this.dateRange[0]+"&endDate="+_this.dateRange[1]);
+                                        } else {
+                                            _this.$router.push("/costDep/" + _this.params[0].data.id + "/" + _this.params[0].name);
+                                        }
+                                    }
+                                }
+                            }
+                        });
+                    } else {
+                        this.$message({
+                            message: res.msg,
+                            type: "error"
+                        });
+                    }
+                },
+                error => {
+                    this.$message({
+                        message: error,
+                        type: "error"
+                    });
+                });
+            }
+        },
+        created() {
+        },
+        mounted() {
+            this.containerHeight = window.innerHeight - 200
+            const that = this;
+            window.onresize = function temp() {
+                this.containerHeight = window.innerHeight - 200
+            };
+            if (this.user.timeType.fixMonthcost == 0) {
+                if (this.$route.query.startDate != null) {
+                    this.dateRange = [this.$route.query.startDate, this.$route.query.endDate];
+                } else {
+                    //默认查看本月
+                    var now = new Date();
+                    var t = util.formatDate.format(now, 'yyyy-MM-dd');
+                    var startStr = util.formatDate.format(new Date(), 'yyyy-MM') + "-01";
+                    this.dateRange = [startStr,t];
+                }
+                this.exportParam.dateRange = this.dateRange;
+            } else if (this.user.timeType.fixMonthcost == 1) {
+                if (this.$route.query.startDate != null) {
+                    this.dateRange = this.$route.query.startDate;
+                } else {
+                    //默认查看本月
+                    var startStr = util.formatDate.format(new Date(), 'yyyy-MM');
+                    this.dateRange = startStr;
+                }
+                this.exportParam.dateRange = this.dateRange;
+            }
+            this.radio = '项目'
+            this.getEchart();
+            var _this = this;
+            window.addEventListener("resize", function() {
+                _this.myChart.resize();
+            });
+            // this.getDepartment();
+            this.getMyProjectList();
+            this.getUsers()
+            this.jutishez()
+        },
+    };
+</script>
+
+<style lang="scss" scoped>
+    #container {
+        // display: inline-block;
+        display: block;
+        position: absolute;
+        // width: 100% !important; 
+        margin-top: 60px;
+    } 
+</style>
+
+<style lang="scss">
+</style>

+ 43 - 15
fhKeeper/formulahousekeeper/timesheet/src/views/settings/timetype.vue

@@ -187,17 +187,19 @@
                 </el-form>
                 </el-form>
             </div>
             </div>
         </el-col>
         </el-col>
-        </el-row><!-- 设置研究中心 -->
+        </el-row>
+        <!-- 设置研究中心 -->
         <div class="yanjiu">
         <div class="yanjiu">
-            <p style="margin-left:10px;color:#666;">自定义日报统计维度</p>
+            <p style="margin-left:10px;color:#666;">自定义日报填报列表</p>
             <el-switch style="margin-left: 40px" v-model="timeType.customDegreeActive" active-color="#13ce66" inactive-color="#ff4949"> </el-switch>
             <el-switch style="margin-left: 40px" v-model="timeType.customDegreeActive" active-color="#13ce66" inactive-color="#ff4949"> </el-switch>
+            <span style="margin-left:10px;color:#999;">开启后系统可按该字段数据进行分类统计工时成本</span>
         </div>
         </div>
         <el-row v-if="timeType.customDegreeActive" :gutter="20" style="padding-top:10px;width:100%;margin:0 auto;padding-left:10px;padding-right:10px;">
         <el-row v-if="timeType.customDegreeActive" :gutter="20" style="padding-top:10px;width:100%;margin:0 auto;padding-left:10px;padding-right:10px;">
             <el-col :span="24" >
             <el-col :span="24" >
                 <div class="panel" style="height:60px;">
                 <div class="panel" style="height:60px;">
                     <el-form :inline="true" :model="timeType"  style="margin-top:10px;">
                     <el-form :inline="true" :model="timeType"  style="margin-top:10px;">
-                        <el-form-item label="维度名称 ">
-                            <el-input placeholder="请输入维度名称" maxlength="6" size="small" v-model="timeType.customDegreeName" clearable> </el-input>
+                        <el-form-item label="字段名称 ">
+                            <el-input placeholder="请输入字段名称" maxlength="6" size="small" v-model="timeType.customDegreeName" clearable> </el-input>
                         </el-form-item>
                         </el-form-item>
                         <el-form-item>
                         <el-form-item>
                             <el-button type="primary" size="small" @click="bianji()">数据维护</el-button>
                             <el-button type="primary" size="small" @click="bianji()">数据维护</el-button>
@@ -206,6 +208,23 @@
                 </div>
                 </div>
             </el-col>
             </el-col>
         </el-row>
         </el-row>
+        <!-- 设置数值填报 -->
+        <div class="yanjiu" v-if="user.company.packageProject==1">
+            <p style="margin-left:10px;color:#666;"><span>自定义日报填报数值</span></p>
+            <el-switch style="margin-left: 40px" v-model="timeType.customDataActive" active-color="#13ce66" inactive-color="#ff4949"> </el-switch>
+            <span style="margin-left:10px;color:#999;">开启后可按项目,部门和人员统计该数值</span>
+        </div>
+        <el-row v-if="timeType.customDataActive && user.company.packageProject==1" :gutter="20" style="padding-top:10px;width:100%;margin:0 auto;padding-left:10px;padding-right:10px;">
+            <el-col :span="24" >
+                <div class="panel" style="height:60px;">
+                    <el-form :inline="true" :model="timeType"  style="margin-top:10px;">
+                        <el-form-item label="字段名称 ">
+                            <el-input placeholder="请输入字段名称" maxlength="5" size="small" v-model="timeType.customDataName" clearable> </el-input>
+                        </el-form-item>
+                    </el-form>
+                </div>
+            </el-col>
+        </el-row>
         
         
         <!-- 是否开启导入审核 -->
         <!-- 是否开启导入审核 -->
         <div class="yanjiu">
         <div class="yanjiu">
@@ -435,6 +454,11 @@
                 } else {
                 } else {
                     this.timeType.needDeptAudit = true
                     this.timeType.needDeptAudit = true
                 }
                 }
+                if(this.timeType.customDataActive == 0) {
+                    this.timeType.customDataActive = false
+                } else {
+                    this.timeType.customDataActive = true
+                }
                 // this.customDegreeName = this.timeType.customDegreeName
                 // this.customDegreeName = this.timeType.customDegreeName
             },
             },
             initTime() {
             initTime() {
@@ -448,19 +472,23 @@
             submitInsert() {
             submitInsert() {
                 this.$refs.form1.validate(valid => {
                 this.$refs.form1.validate(valid => {
                     if (valid) {
                     if (valid) {
-                        var spl = this.timeType.customDegreeActive
-                        var sss = this.timeType.needDeptAudit
-                        if(this.timeType.needDeptAudit) {
-                            this.timeType.needDeptAudit = 1
+                        var param = JSON.parse(JSON.stringify(this.timeType));
+                        if(param.needDeptAudit) {
+                            param.needDeptAudit = 1
+                        } else {
+                            param.needDeptAudit = 0
+                        }
+                        if(param.customDegreeActive) {
+                            param.customDegreeActive = 1
                         } else {
                         } else {
-                            this.timeType.needDeptAudit = 0
+                            param.customDegreeActive = 0
                         }
                         }
-                        if(this.timeType.customDegreeActive) {
-                            this.timeType.customDegreeActive = 1
+                        if(param.customDataActive) {
+                            param.customDataActive = 1
                         } else {
                         } else {
-                            this.timeType.customDegreeActive = 0
+                            param.customDataActive = 0
                         }
                         }
-                        this.http.post('/time-type/save',this.timeType,
+                        this.http.post('/time-type/save',param,
                             res => {
                             res => {
                                 this.listLoading = false;
                                 this.listLoading = false;
                                 if (res.code == "ok") {
                                 if (res.code == "ok") {
@@ -468,8 +496,8 @@
                                         message: '保存成功',
                                         message: '保存成功',
                                         type: "success"
                                         type: "success"
                                     });
                                     });
-                                    this.timeType.customDegreeActive = spl
-                                    this.timeType.needDeptAudit = sss
+                                    this.user.timeType = param;
+                                    sessionStorage.user = JSON.stringify(this.user);
                                 } else {
                                 } else {
                                     this.$message({
                                     this.$message({
                                         message: res.msg,
                                         message: res.msg,

+ 43 - 13
fhKeeper/formulahousekeeper/timesheet/src/views/workReport/daily.vue

@@ -158,6 +158,7 @@
                                             <!--任务分组和阶段 -->
                                             <!--任务分组和阶段 -->
                                             <p v-if="item2.groupId != 0">任务分组:{{item2.groupName}} <span v-if="item2.stage != null && item2.stage != '-'" style="margin-left:10px;">投入阶段:{{item2.stage}}</span></p>
                                             <p v-if="item2.groupId != 0">任务分组:{{item2.groupName}} <span v-if="item2.stage != null && item2.stage != '-'" style="margin-left:10px;">投入阶段:{{item2.stage}}</span></p>
                                             <p v-if="user.timeType.customDegreeActive==1 && item2.degree_id != null && item2.degree_id != -1">{{user.timeType.customDegreeName}}:{{item2.degreeName}}</p>
                                             <p v-if="user.timeType.customDegreeActive==1 && item2.degree_id != null && item2.degree_id != -1">{{user.timeType.customDegreeName}}:{{item2.degreeName}}</p>
+                                            <p v-if="user.timeType.customDataActive==1">{{user.timeType.customDataName}}:{{item2.customData}}</p>
 
 
                                             <p v-if="user.company.packageEngineering == 1">
                                             <p v-if="user.company.packageEngineering == 1">
                                                 专业进度:
                                                 专业进度:
@@ -189,7 +190,7 @@
                                                     style="border: 0.5px #ddd solid;margin-bottom:5px;padding:5px;">
                                                     style="border: 0.5px #ddd solid;margin-bottom:5px;padding:5px;">
                                                     <p style="display: inline-block;">时长:
                                                     <p style="display: inline-block;">时长:
                                                         <span v-if="item2.reportTimeType == 2" style="margin-right:10px;">{{timeItem.startTime+'-'+timeItem.endTime}}</span>
                                                         <span v-if="item2.reportTimeType == 2" style="margin-right:10px;">{{timeItem.startTime+'-'+timeItem.endTime}}</span>
-                                                    {{timeItem.time.toFixed(2)}}h  
+                                                    {{timeItem.time.toFixed(1)}}h  
                                                     <el-tag type="danger" size="mini" style="margin-left: 65px" v-if="item2.isOvertime === 1">加班</el-tag>
                                                     <el-tag type="danger" size="mini" style="margin-left: 65px" v-if="item2.isOvertime === 1">加班</el-tag>
                                                     </p>
                                                     </p>
                                                     <p>事项:<span v-html="timeItem.content"></span></p>
                                                     <p>事项:<span v-html="timeItem.content"></span></p>
@@ -235,7 +236,7 @@
                     <span v-if="reportTimeType.type == 3">小时</span>
                     <span v-if="reportTimeType.type == 3">小时</span>
                 </el-form-item>
                 </el-form-item>
                 
                 
-                <div v-for="(domain, index) in workForm.domains" :key="domain.id">
+                <div v-for="(domain, index) in workForm.domains" :key="domain.id" :style="index>0?'margin-top:10px;':''">
                     <div v-if="reportTimeType.multiWorktime==0">
                     <div v-if="reportTimeType.multiWorktime==0">
                     <el-form-item v-if="reportTimeType.type != 3" :label="reportTimeType.type ==2?'工作时间':'工作时长'" :prop="'domains.' + index + '.'+timeFields[reportTimeType.type]"
                     <el-form-item v-if="reportTimeType.type != 3" :label="reportTimeType.type ==2?'工作时间':'工作时长'" :prop="'domains.' + index + '.'+timeFields[reportTimeType.type]"
                         :rules="{ required: true, message: '请选择工作时长', trigger: 'blur' }">
                         :rules="{ required: true, message: '请选择工作时长', trigger: 'blur' }">
@@ -339,6 +340,10 @@
                             </el-option>
                             </el-option>
                         </el-select>
                         </el-select>
                     </el-form-item>
                     </el-form-item>
+                    <!-- 相关数值 -->
+                    <el-form-item :label="yonghuUser.customDataName" v-if="domain.projectId && yonghuUser.customDataActive == 1">
+                        <el-input-number :id="'numberData_'+index" v-model="domain.customData" style="width:200px;" @keyup.native="restrictNumber('numberData_'+index)"></el-input-number>
+                    </el-form-item>
 
 
                     <el-form-item v-if="reportTimeType.type == 3" label="用时占比" :prop="'domains.' + index + '.'+timeFields[reportTimeType.type]"
                     <el-form-item v-if="reportTimeType.type == 3" label="用时占比" :prop="'domains.' + index + '.'+timeFields[reportTimeType.type]"
                         :rules="{ required: true, message: '请设置用时占比', trigger: 'blur' }">
                         :rules="{ required: true, message: '请设置用时占比', trigger: 'blur' }">
@@ -427,6 +432,10 @@
                                 </el-option>
                                 </el-option>
                             </el-select>
                             </el-select>
                         </el-form-item>
                         </el-form-item>
+                        <!-- 相关数值 -->
+                        <el-form-item :label="yonghuUser.customDataName" v-if="domain.projectId && yonghuUser.customDataActive == 1">
+                            <el-input-number :id="'numberData_'+index" v-model="domain.customData" style="width:200px;" @keyup.native="restrictNumber('numberData_'+index)"></el-input-number>
+                        </el-form-item>
                         <!--项目管理专业版模式下,项目下的近期执行的任务 -->
                         <!--项目管理专业版模式下,项目下的近期执行的任务 -->
                         <el-form-item label="相关任务" :prop="'domains.' + index + '.taskId'" v-if="user.company.packageProject==1" >
                         <el-form-item label="相关任务" :prop="'domains.' + index + '.taskId'" v-if="user.company.packageProject==1" >
                             <el-select v-model="domain.taskId" placeholder="请选择" style="width:100%;" filterable="true" 
                             <el-select v-model="domain.taskId" placeholder="请选择" style="width:100%;" filterable="true" 
@@ -496,8 +505,8 @@
             <span slot="footer" class="dialog-footer">
             <span slot="footer" class="dialog-footer">
                 <el-button @click="deleteReport" v-if="workForm.domains[0].id != null">删除</el-button>
                 <el-button @click="deleteReport" v-if="workForm.domains[0].id != null">删除</el-button>
                 <el-button @click="dialogVisible = false">取消</el-button>
                 <el-button @click="dialogVisible = false">取消</el-button>
-                <el-button v-if="!isSubstitude" @click="submitReport(1)" :disabled="workForm.domains.length==0?true:(canEdit?false:true)">暂存</el-button>
-                <el-button type="primary" @click="submitReport(0)"
+                <el-button v-if="!isSubstitude" @click="submitReport(1)" :loading="submitingReport" :disabled="workForm.domains.length==0?true:(canEdit?false:true)">暂存</el-button>
+                <el-button type="primary" @click="submitReport(0)" :loading="submitingReport"
                 :disabled="workForm.domains.length==0?true:(canEdit?false:true)" >提交</el-button>
                 :disabled="workForm.domains.length==0?true:(canEdit?false:true)" >提交</el-button>
             </span>
             </span>
         </el-dialog>
         </el-dialog>
@@ -545,7 +554,7 @@
             </el-form>
             </el-form>
             <span slot="footer" class="dialog-footer">
             <span slot="footer" class="dialog-footer">
                 <el-button @click="diasZho = false">取 消</el-button>
                 <el-button @click="diasZho = false">取 消</el-button>
-                <el-button type="primary" @click="zhoAdd()">提 交</el-button>
+                <el-button type="primary" @click="zhoAdd()" :loading="submitingReport">提 交</el-button>
             </span>
             </span>
         </el-dialog>
         </el-dialog>
         <!-- 选择时间 -->
         <!-- 选择时间 -->
@@ -861,6 +870,7 @@
     export default {
     export default {
         data() {
         data() {
             return {
             return {
+                submitingReport: false,
                 importResultMsg:null,
                 importResultMsg:null,
                 showImportResult:false,
                 showImportResult:false,
                 importingData: false,
                 importingData: false,
@@ -1024,9 +1034,20 @@
                     return 0
                     return 0
                 }
                 }
                 return value
                 return value
-            }
+            },
+            
         },
         },
         methods: {
         methods: {
+            restrictNumber(targetId) {
+                let inpu = document.getElementById(targetId).getElementsByTagName('input')[0];
+                inpu.value = inpu.value.replace(/[^\d.]/g, "");  //仅保留数字和"."
+                inpu.value = inpu.value.replace(/\.{2,}/g, "."); //两个连续的"."仅保留第一个"."
+                inpu.value = inpu.value.replace(".", "$#*").replace(/\./g,'').replace('$#*','.');//去除其他"."
+                inpu.value = inpu.value.replace(/^(\d+)\.(\d\d).*$/, '$1.$2');;//限制只能输入两个小数
+                if (inpu.value.indexOf(".") < 0 && inpu.value != "") { //首位是0的话去掉
+                    inpu.value = parseFloat(inpu.value);
+                }
+            },
             //获取项目下的任务分组
             //获取项目下的任务分组
             getTaskGroups(domain, index) {
             getTaskGroups(domain, index) {
                 this.workForm.domains[index].groupId=null;
                 this.workForm.domains[index].groupId=null;
@@ -2528,7 +2549,8 @@
                                     worktimeList: list.report[i].worktimeList,
                                     worktimeList: list.report[i].worktimeList,
                                     degreeId: list.report[i].degreeId==-1?null:list.report[i].degreeId,
                                     degreeId: list.report[i].degreeId==-1?null:list.report[i].degreeId,
                                     wuduList: list.report[i].degreeList,
                                     wuduList: list.report[i].degreeList,
-                                    taskGroups:list.report[i].taskGroups
+                                    taskGroups:list.report[i].taskGroups,
+                                    customData: list.report[i].customData,//自定义的数值
                                 })
                                 })
                                 if (list.report[i].state >= 2) {
                                 if (list.report[i].state >= 2) {
                                     this.canEdit = true;
                                     this.canEdit = true;
@@ -3414,6 +3436,7 @@
                         this.listLoading = true;
                         this.listLoading = true;
                         let formData = new FormData();
                         let formData = new FormData();
                         formData.append("draft", this.isDraft);
                         formData.append("draft", this.isDraft);
+                        
                         for(var i in this.workForm.domains) {
                         for(var i in this.workForm.domains) {
                             if(this.workForm.domains[i].degreeId) {
                             if(this.workForm.domains[i].degreeId) {
                                 // var sss = this.workForm.domains[i].degreeId.toString()
                                 // var sss = this.workForm.domains[i].degreeId.toString()
@@ -3421,6 +3444,12 @@
                             } else {
                             } else {
                                 formData.append("degreeId", -1);
                                 formData.append("degreeId", -1);
                             }
                             }
+                            if(this.workForm.domains[i].customData) {
+                                // var sss = this.workForm.domains[i].degreeId.toString()
+                                formData.append("customData", this.workForm.domains[i].customData);
+                            } else {
+                                formData.append("customData", 0);
+                            }
                             if (this.workForm.domains[i].id) {
                             if (this.workForm.domains[i].id) {
                                 formData.append("id", this.workForm.domains[i].id);
                                 formData.append("id", this.workForm.domains[i].id);
                             } else {
                             } else {
@@ -3494,9 +3523,9 @@
                                 formData.append("content", m);
                                 formData.append("content", m);
                             } else {
                             } else {
                                 if (this.workForm.domains[i].content) {
                                 if (this.workForm.domains[i].content) {
-                                    formData.append("content", '-');
-                                } else {
                                     formData.append("content", this.workForm.domains[i].content);
                                     formData.append("content", this.workForm.domains[i].content);
+                                } else {
+                                    formData.append("content", '-');
                                 }
                                 }
                             }
                             }
                             
                             
@@ -3508,11 +3537,9 @@
                             }
                             }
                             
                             
                             if(this.workForm.domains[i].isOvertime) {
                             if(this.workForm.domains[i].isOvertime) {
-                                this.workForm.domains[i].isOvertime = '1'
-                                formData.append("isOvertime", this.workForm.domains[i].isOvertime);
+                                formData.append("isOvertime", 1);
                             } else {
                             } else {
-                                this.workForm.domains[i].isOvertime = '0'
-                                formData.append("isOvertime", this.workForm.domains[i].isOvertime);
+                                formData.append("isOvertime", 0);
                             }
                             }
                             
                             
                             if (this.workForm.userId != null) {
                             if (this.workForm.userId != null) {
@@ -3539,9 +3566,11 @@
                                 formData.append("stage", "-");
                                 formData.append("stage", "-");
                             }
                             }
                         }
                         }
+                        this.submitingReport = true;
                         this.http.uploadFile( this.port.report.editPort, formData,
                         this.http.uploadFile( this.port.report.editPort, formData,
                         res => {
                         res => {
                             this.listLoading = false;
                             this.listLoading = false;
+                            this.submitingReport = false;
                             if (res.code == "ok") {
                             if (res.code == "ok") {
                                 this.$message({
                                 this.$message({
                                     message: this.isDraft==0?"提交成功":"暂存成功",
                                     message: this.isDraft==0?"提交成功":"暂存成功",
@@ -3561,6 +3590,7 @@
                         },
                         },
                         error => {
                         error => {
                             this.listLoading = false;
                             this.listLoading = false;
+                            this.submitingReport = false;
                             this.$message({
                             this.$message({
                                 message: error,
                                 message: error,
                                 type: "error"
                                 type: "error"

+ 7 - 3
fhKeeper/formulahousekeeper/timesheet/src/views/workReport/list.vue

@@ -70,6 +70,8 @@
                                 </span>
                                 </span>
                                 </b></p>
                                 </b></p>
                                 <p v-if="user.timeType.customDegreeActive==1 && item.degree_id != null">{{user.timeType.customDegreeName}}:{{item.degreeName}}</p>
                                 <p v-if="user.timeType.customDegreeActive==1 && item.degree_id != null">{{user.timeType.customDegreeName}}:{{item.degreeName}}</p>
+                                <p v-if="user.timeType.customDataActive==1">{{user.timeType.customDataName}}:{{item.customData}}</p>
+
                                 <p v-if="user.company.packageEngineering == 1">
                                 <p v-if="user.company.packageEngineering == 1">
                                     专业进度:
                                     专业进度:
                                     <span style="margin-right:10px;" v-for="progressItem in item.professionProgressList" :key="progressItem.id">
                                     <span style="margin-right:10px;" v-for="progressItem in item.professionProgressList" :key="progressItem.id">
@@ -86,13 +88,15 @@
                                         </span>
                                         </span>
                                 </p>
                                 </p>
                                 <p v-if="item.taskId != null">任务:{{item.taskName}}</p>
                                 <p v-if="item.taskId != null">任务:{{item.taskName}}</p>
+                                <p v-if="item.groupId">
+                                    <span>任务分组:{{item.groupName}}</span>
+                                    <!-- 阶段 -->
+                                    <span v-if="item.stage != null" style="margin-left:10px;"> 投入阶段:{{item.stage}}</span>
+                                </p>
                                 <div v-if="item.multiWorktime==0">
                                 <div v-if="item.multiWorktime==0">
                                 <p>时长:{{item.time}}h <span class="propsbtn" v-if="item.isOvertime === 1">
                                 <p>时长:{{item.time}}h <span class="propsbtn" v-if="item.isOvertime === 1">
                                     <el-tag type="danger" size="mini" style="margin-left: 65px">加班</el-tag></span>
                                     <el-tag type="danger" size="mini" style="margin-left: 65px">加班</el-tag></span>
-                                    <!-- 阶段 -->
-                                    <span v-if="item.stage != null" style="margin-left:10px;"> 投入阶段:{{item.stage}}</span>
                                 </p>
                                 </p>
-                                <p v-if="user.role>=1&&user.role<=3">成本:{{item.cost}}元</p>
                                 <p>事项:<span v-html="item.content"></span></p>
                                 <p>事项:<span v-html="item.content"></span></p>
                                 </div>
                                 </div>
                                 <div v-if="item.multiWorktime==1" >
                                 <div v-if="item.multiWorktime==1" >

+ 3 - 1
fhKeeper/formulahousekeeper/timesheet/src/views/workReport/list_department.vue

@@ -28,6 +28,9 @@
                         <el-timeline-item v-for="(item,index) in props.row.data" :key="index">
                         <el-timeline-item v-for="(item,index) in props.row.data" :key="index">
                             <el-card shadow="never">
                             <el-card shadow="never">
                                 <p>项目:<b>{{item.project}}<span v-if="item.subProjectName != null"> / {{item.subProjectName}}</span>
                                 <p>项目:<b>{{item.project}}<span v-if="item.subProjectName != null"> / {{item.subProjectName}}</span>
+                                <p v-if="user.timeType.customDegreeActive==1 && item.degree_id != null">{{user.timeType.customDegreeName}}:{{item.degreeName}}</p>
+                                <p v-if="user.timeType.customDataActive==1">{{user.timeType.customDataName}}:{{item.customData}}</p>
+
                                 <span v-if="user.company.packageEngineering == 1" style="color:#DAA520;">{{item.departmentAuditState==-1?'待专业审核':'待部门审核'}}</span>
                                 <span v-if="user.company.packageEngineering == 1" style="color:#DAA520;">{{item.departmentAuditState==-1?'待专业审核':'待部门审核'}}</span>
                                 </b></p>
                                 </b></p>
                                 <p v-if="user.company.packageEngineering == 1">
                                 <p v-if="user.company.packageEngineering == 1">
@@ -51,7 +54,6 @@
                                     <!-- 阶段 -->
                                     <!-- 阶段 -->
                                     <span v-if="item.stage != null" style="margin-left:10px;"> 投入阶段:{{item.stage}}</span>
                                     <span v-if="item.stage != null" style="margin-left:10px;"> 投入阶段:{{item.stage}}</span>
                                 </p>
                                 </p>
-                                <p v-if="user.role>=1&&user.role<=3">成本:{{item.cost}}元</p>
                                 <p>事项:<span v-html="item.content"></span></p>
                                 <p>事项:<span v-html="item.content"></span></p>
                                 <!--照片的显示 -->
                                 <!--照片的显示 -->
                                 <p v-if="item.pics != null && item.pics.length > 0"> 
                                 <p v-if="item.pics != null && item.pics.length > 0"> 

+ 0 - 2
fhKeeper/formulahousekeeper/timesheet/src/views/workReport/list_import.vue

@@ -110,8 +110,6 @@
                     <span>{{scope.row.time.toFixed(1)}}</span>
                     <span>{{scope.row.time.toFixed(1)}}</span>
                 </template>
                 </template>
             </el-table-column>
             </el-table-column>
-            <el-table-column prop="cost" label="成本(元)">
-            </el-table-column>
             <el-table-column prop="state" label="状态">
             <el-table-column prop="state" label="状态">
                 <template slot-scope="scope">
                 <template slot-scope="scope">
                     <span v-if="scope.row.state == -1" style="color:#DAA520;">待审核</span>
                     <span v-if="scope.row.state == -1" style="color:#DAA520;">待审核</span>

+ 3 - 1
fhKeeper/formulahousekeeper/timesheet/src/views/workReport/list_profession.vue

@@ -34,6 +34,9 @@
                         <el-timeline-item v-for="(item,index) in props.row.data" :key="index">
                         <el-timeline-item v-for="(item,index) in props.row.data" :key="index">
                             <el-card shadow="never">
                             <el-card shadow="never">
                                 <p>项目:<b>{{item.project}}<span v-if="item.subProjectName != null"> / {{item.subProjectName}}</span></b></p>
                                 <p>项目:<b>{{item.project}}<span v-if="item.subProjectName != null"> / {{item.subProjectName}}</span></b></p>
+                                <p v-if="user.timeType.customDegreeActive==1 && item.degree_id != null">{{user.timeType.customDegreeName}}:{{item.degreeName}}</p>
+                                <p v-if="user.timeType.customDataActive==1">{{user.timeType.customDataName}}:{{item.customData}}</p>
+
                                 <p v-if="user.company.packageEngineering == 1">
                                 <p v-if="user.company.packageEngineering == 1">
                                     专业进度:
                                     专业进度:
                                     <span style="margin-right:10px;" v-for="progressItem in item.professionProgressList" :key="progressItem.id">
                                     <span style="margin-right:10px;" v-for="progressItem in item.professionProgressList" :key="progressItem.id">
@@ -55,7 +58,6 @@
                                     <!-- 阶段 -->
                                     <!-- 阶段 -->
                                     <span v-if="item.stage != null" style="margin-left:10px;"> 投入阶段:{{item.stage}}</span>
                                     <span v-if="item.stage != null" style="margin-left:10px;"> 投入阶段:{{item.stage}}</span>
                                 </p>
                                 </p>
-                                <p v-if="user.role>=1&&user.role<=3">成本:{{item.cost}}元</p>
                                 <p>事项:<span v-html="item.content"></span></p>
                                 <p>事项:<span v-html="item.content"></span></p>
                                 <!--照片的显示 -->
                                 <!--照片的显示 -->
                                 <p v-if="item.pics != null && item.pics.length > 0"> 
                                 <p v-if="item.pics != null && item.pics.length > 0"> 

+ 15 - 2
fhKeeper/formulahousekeeper/timesheet_h5/src/views/edit/index.vue

@@ -2,7 +2,7 @@
     <div>
     <div>
         <van-nav-bar title="填写日报" left-text="返回" @click-left="back" fixed left-arrow/>
         <van-nav-bar title="填写日报" left-text="返回" @click-left="back" fixed left-arrow/>
 
 
-        <van-form class="login_form" @submit="register">
+        <van-form class="login_form" @submit="submitReport">
             <van-field readonly clickable name="datetimePicker" :value="form.createDate" label="时间选择" placeholder="点击选择时间" 
             <van-field readonly clickable name="datetimePicker" :value="form.createDate" label="时间选择" placeholder="点击选择时间" 
             @click="showPicker = true" :rules="rules.createDate" />
             @click="showPicker = true" :rules="rules.createDate" />
             <van-popup v-model="showPicker" position="bottom">
             <van-popup v-model="showPicker" position="bottom">
@@ -66,6 +66,10 @@
                         <van-picker show-toolbar :columns="item.wuduList" value-key="name" @confirm="choseProjects" @cancel="item.showPickDegree = false;$forceUpdate()" />
                         <van-picker show-toolbar :columns="item.wuduList" value-key="name" @confirm="choseProjects" @cancel="item.showPickDegree = false;$forceUpdate()" />
                     </van-popup>
                     </van-popup>
 
 
+                    <!-- 自定义数值 -->
+                    <van-field v-if="user.timeType.customDataActive==1" type="number" :disabled="!canEdit" v-model="item.customData" :label="user.timeType.customDataName" 
+                         placeholder="请输入数字" ></van-field> 
+
                     <van-cell title="专业进度" v-if="user.company.packageEngineering == 1">
                     <van-cell title="专业进度" v-if="user.company.packageEngineering == 1">
                     </van-cell>
                     </van-cell>
                     <van-field :disabled="!canEdit"
                     <van-field :disabled="!canEdit"
@@ -352,6 +356,9 @@
         },
         },
 
 
         methods: {
         methods: {
+            updateTxt() {
+                this.$forceUpdate();
+            },
             // 获取项目
             // 获取项目
             getPeoject() {
             getPeoject() {
                 this.$axios.post("/project/getProjectList", {})
                 this.$axios.post("/project/getProjectList", {})
@@ -816,6 +823,7 @@
                                     taskGroups:list[i].taskGroups,
                                     taskGroups:list[i].taskGroups,
                                     stages:list[i].stages,
                                     stages:list[i].stages,
                                     stage:list[i].stage == '-'?null:list[i].stage,
                                     stage:list[i].stage == '-'?null:list[i].stage,
+                                    customData: list[i].customData,
                                 })
                                 })
                                 if (list[i].state >= 2) {
                                 if (list[i].state >= 2) {
                                     this.canEdit = true;
                                     this.canEdit = true;
@@ -1093,7 +1101,7 @@
             },
             },
 
 
             // 提交日报
             // 提交日报
-            register() {
+            submitReport() {
                 this.dateAr = []
                 this.dateAr = []
                 let alp = []
                 let alp = []
                 if(this.user.timeType.multiWorktime == 1) {
                 if(this.user.timeType.multiWorktime == 1) {
@@ -1178,6 +1186,11 @@
                     } else {
                     } else {
                         formData.append("degreeId", -1);
                         formData.append("degreeId", -1);
                     }
                     }
+                    if(this.form.domains[i].customData) {
+                        formData.append("customData", this.form.domains[i].customData);
+                    } else {
+                        formData.append("customData", "0");
+                    }
                     
                     
                     if (this.form.domains[i].id) {
                     if (this.form.domains[i].id) {
                         formData.append("id", this.form.domains[i].id);
                         formData.append("id", this.form.domains[i].id);

+ 1 - 1
fhKeeper/formulahousekeeper/timesheet_h5/src/views/review/department_list.vue

@@ -23,7 +23,7 @@
                         <div class="project_title" v-if="user.company.packageProject==1&&item1.stage != '-'" >投入阶段:{{item1.stage}}</div>
                         <div class="project_title" v-if="user.company.packageProject==1&&item1.stage != '-'" >投入阶段:{{item1.stage}}</div>
                         <!--自定义维度 -->
                         <!--自定义维度 -->
                         <div class="project_title" v-if="user.timeType.customDegreeActive == 1" >{{user.timeType.customDegreeName}}:{{item1.degreeName}}</div>
                         <div class="project_title" v-if="user.timeType.customDegreeActive == 1" >{{user.timeType.customDegreeName}}:{{item1.degreeName}}</div>
-                        
+                        <div class="project_title" v-if="user.timeType.customDataActive == 1" >{{user.timeType.customDataName}}:{{item1.customData}}</div>
                         <div class="project_title" v-if="user.company.packageEngineering == 1">
                         <div class="project_title" v-if="user.company.packageEngineering == 1">
                             专业进度:
                             专业进度:
                             <span style="margin-right:10px;" v-for="progressItem in item1.professionProgressList" :key="progressItem.id">{{progressItem.professionName}}({{progressItem.progress}}%) 
                             <span style="margin-right:10px;" v-for="progressItem in item1.professionProgressList" :key="progressItem.id">{{progressItem.professionName}}({{progressItem.progress}}%) 

+ 1 - 2
fhKeeper/formulahousekeeper/timesheet_h5/src/views/review/index.vue

@@ -41,7 +41,7 @@
                         <div class="project_title" v-if="user.company.packageProject==1&&item1.stage != '-'" >投入阶段:{{item1.stage}}</div>
                         <div class="project_title" v-if="user.company.packageProject==1&&item1.stage != '-'" >投入阶段:{{item1.stage}}</div>
                         <!--自定义维度 -->
                         <!--自定义维度 -->
                         <div class="project_title" v-if="user.timeType.customDegreeActive == 1" >{{user.timeType.customDegreeName}}:{{item1.degreeName}}</div>
                         <div class="project_title" v-if="user.timeType.customDegreeActive == 1" >{{user.timeType.customDegreeName}}:{{item1.degreeName}}</div>
-                        
+                        <div class="project_title" v-if="user.timeType.customDataActive == 1" >{{user.timeType.customDataName}}:{{item1.customData}}</div>
                         <div class="project_title" v-if="user.company.packageEngineering == 1">
                         <div class="project_title" v-if="user.company.packageEngineering == 1">
                             专业进度:
                             专业进度:
                             <span style="margin-right:10px;" v-for="progressItem in item1.professionProgressList" :key="progressItem.id">{{progressItem.professionName}}({{progressItem.progress}}%) 
                             <span style="margin-right:10px;" v-for="progressItem in item1.professionProgressList" :key="progressItem.id">{{progressItem.professionName}}({{progressItem.progress}}%) 
@@ -57,7 +57,6 @@
                                 <div class="button" v-if="item1.isOvertime == 1">加班</div>
                                 <div class="button" v-if="item1.isOvertime == 1">加班</div>
                             </div>
                             </div>
                             <div class="project_content">事项:<span v-html="item1.content"></span></div>
                             <div class="project_content">事项:<span v-html="item1.content"></span></div>
-                            
                         </div>
                         </div>
                         <div v-if="item1.multiWorktime == 1">
                         <div v-if="item1.multiWorktime == 1">
                             <div style="position:relative;border:#ccc 0.5px solid;padding:3px;margin:5px 0px;" v-for="(timeItem, index) in item1.worktimeList" :key="index" >
                             <div style="position:relative;border:#ccc 0.5px solid;padding:3px;margin:5px 0px;" v-for="(timeItem, index) in item1.worktimeList" :key="index" >

+ 1 - 1
fhKeeper/formulahousekeeper/timesheet_h5/src/views/review/profession_list.vue

@@ -21,7 +21,7 @@
                         <div class="project_title" v-if="user.company.packageProject==1&&item1.stage != '-'" >投入阶段:{{item1.stage}}</div>
                         <div class="project_title" v-if="user.company.packageProject==1&&item1.stage != '-'" >投入阶段:{{item1.stage}}</div>
                         <!--自定义维度 -->
                         <!--自定义维度 -->
                         <div class="project_title" v-if="user.timeType.customDegreeActive == 1" >{{user.timeType.customDegreeName}}:{{item1.degreeName}}</div>
                         <div class="project_title" v-if="user.timeType.customDegreeActive == 1" >{{user.timeType.customDegreeName}}:{{item1.degreeName}}</div>
-                        
+                        <div class="project_title" v-if="user.timeType.customDataActive == 1" >{{user.timeType.customDataName}}:{{item1.customData}}</div>
                         <div class="project_title" v-if="user.company.packageEngineering == 1">
                         <div class="project_title" v-if="user.company.packageEngineering == 1">
                             专业进度:
                             专业进度:
                             <span style="margin-right:10px;" v-for="progressItem in item1.professionProgressList" :key="progressItem.id">{{progressItem.professionName}}({{progressItem.progress}}%) 
                             <span style="margin-right:10px;" v-for="progressItem in item1.professionProgressList" :key="progressItem.id">{{progressItem.professionName}}({{progressItem.progress}}%) 

+ 1 - 0
fhKeeper/formulahousekeeper/timesheet_h5/src/views/view/index.vue

@@ -47,6 +47,7 @@
                         <div class="project_title" v-if="user.company.packageProject==1&&item1.stage != '-'" >投入阶段:{{item1.stage}}</div>
                         <div class="project_title" v-if="user.company.packageProject==1&&item1.stage != '-'" >投入阶段:{{item1.stage}}</div>
                         <!--自定义维度 -->
                         <!--自定义维度 -->
                         <div class="project_title" v-if="user.timeType.customDegreeActive == 1" >{{user.timeType.customDegreeName}}:{{item1.degreeName}}</div>
                         <div class="project_title" v-if="user.timeType.customDegreeActive == 1" >{{user.timeType.customDegreeName}}:{{item1.degreeName}}</div>
+                        <div class="project_title" v-if="user.timeType.customDataActive == 1" >{{user.timeType.customDataName}}:{{item1.customData}}</div>
                         <div class="project_title" v-if="user.company.packageEngineering == 1">
                         <div class="project_title" v-if="user.company.packageEngineering == 1">
                             专业进度:
                             专业进度:
                             <span style="margin-right:10px;" v-for="progressItem in item1.professionProgress" :key="progressItem.id">{{progressItem.professionName}}({{progressItem.progress}}%) 
                             <span style="margin-right:10px;" v-for="progressItem in item1.professionProgress" :key="progressItem.id">{{progressItem.professionName}}({{progressItem.progress}}%)