Pārlūkot izejas kodu

Merge branch 'master' of http://47.100.37.243:10080/wutt/manHourHousekeeper into master

seyason 3 gadi atpakaļ
vecāks
revīzija
3e96d25b59
26 mainītis faili ar 2487 papildinājumiem un 685 dzēšanām
  1. 2 3
      fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/controller/ProjectController.java
  2. 2 6
      fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/controller/ReportController.java
  3. 1 5
      fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/entity/vo/GanttDataItem.java
  4. 3 1
      fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/mapper/ProjectMapper.java
  5. 5 4
      fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/mapper/ReportMapper.java
  6. 1 1
      fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/ProjectService.java
  7. 1 1
      fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/ReportService.java
  8. 226 110
      fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/impl/ProjectServiceImpl.java
  9. 5 5
      fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/impl/ReportServiceImpl.java
  10. 26 4
      fhKeeper/formulahousekeeper/management-platform/src/main/resources/mapper/ProjectMapper.xml
  11. 9 0
      fhKeeper/formulahousekeeper/management-platform/src/main/resources/mapper/ReportMapper.xml
  12. 3 2
      fhKeeper/formulahousekeeper/timesheet/src/views/centerManage/centerManage.vue
  13. 1 1
      fhKeeper/formulahousekeeper/timesheet/src/views/corpreport/list.vue
  14. 37 1
      fhKeeper/formulahousekeeper/timesheet/src/views/leave/list.vue
  15. 4 1
      fhKeeper/formulahousekeeper/timesheet/src/views/project/cost.vue
  16. 213 121
      fhKeeper/formulahousekeeper/timesheet/src/views/project/project_gantt.vue
  17. 16 25
      fhKeeper/formulahousekeeper/timesheet/src/views/workReport/daily.vue
  18. 1261 231
      fhKeeper/formulahousekeeper/timesheet_h5/src/assets/style/font/demo_index.html
  19. 221 47
      fhKeeper/formulahousekeeper/timesheet_h5/src/assets/style/font/iconfont.css
  20. 1 1
      fhKeeper/formulahousekeeper/timesheet_h5/src/assets/style/font/iconfont.js
  21. 413 105
      fhKeeper/formulahousekeeper/timesheet_h5/src/assets/style/font/iconfont.json
  22. BIN
      fhKeeper/formulahousekeeper/timesheet_h5/src/assets/style/font/iconfont.ttf
  23. BIN
      fhKeeper/formulahousekeeper/timesheet_h5/src/assets/style/font/iconfont.woff
  24. BIN
      fhKeeper/formulahousekeeper/timesheet_h5/src/assets/style/font/iconfont.woff2
  25. 27 0
      fhKeeper/formulahousekeeper/timesheet_h5/src/views/edit/index.vue
  26. 9 10
      fhKeeper/formulahousekeeper/timesheet_h5/vue.config.js

+ 2 - 3
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/controller/ProjectController.java

@@ -14,7 +14,6 @@ import org.springframework.web.multipart.MultipartFile;
 import javax.annotation.Resource;
 import javax.servlet.http.HttpServletRequest;
 import java.time.LocalDate;
-import java.time.LocalDateTime;
 import java.util.ArrayList;
 import java.util.HashMap;
 import java.util.List;
@@ -156,8 +155,8 @@ public class ProjectController {
      * 导出查询者所在公司每个项目的工时成本
      */
     @RequestMapping("/exportTimeCost")
-    public HttpRespMsg exportTimeCost(String startDate, String endDate, Integer projectId, String userId, Boolean projectSum) {
-        return projectService.exportTimeCost(startDate, endDate, projectId, userId, projectSum, request);
+    public HttpRespMsg exportTimeCost(String startDate, String endDate, Integer projectId, String userId, Boolean projectSum,Integer type) {
+        return projectService.exportTimeCost(startDate, endDate, projectId, userId, projectSum,type, request);
     }
 
     /**

+ 2 - 6
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/controller/ReportController.java

@@ -14,9 +14,7 @@ import com.management.platform.service.ReportService;
 import com.management.platform.service.UserSalaryService;
 import com.management.platform.service.UserService;
 import com.management.platform.util.HttpRespMsg;
-import com.management.platform.util.ListUtil;
 import com.management.platform.util.WorkDayCalculateUtils;
-import org.apache.log4j.helpers.DateTimeDateFormat;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RequestParam;
@@ -28,9 +26,7 @@ import javax.servlet.http.HttpServletRequest;
 import java.math.BigDecimal;
 import java.text.ParseException;
 import java.text.SimpleDateFormat;
-import java.time.DayOfWeek;
 import java.time.LocalDate;
-import java.time.LocalDateTime;
 import java.time.format.DateTimeFormatter;
 import java.util.*;
 import java.util.stream.Collectors;
@@ -96,8 +92,8 @@ public class ReportController {
      * date 日期 格式yyyy-mm-dd
      */
     @RequestMapping("/exportReport")
-    public HttpRespMsg exportReport(String startDate, String endDate, Integer projectId) {
-        return reportService.exportReport(startDate, endDate, projectId, request);
+    public HttpRespMsg exportReport(String startDate, String endDate, Integer projectId,@RequestParam(defaultValue = "0") Integer stateKey) {
+        return reportService.exportReport(startDate, endDate, projectId,stateKey, request);
     }
 
 

+ 1 - 5
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/entity/vo/GanttDataItem.java

@@ -1,11 +1,6 @@
 package com.management.platform.entity.vo;
 
-import com.fasterxml.jackson.annotation.JsonFormat;
-import com.fasterxml.jackson.databind.annotation.JsonSerialize;
 import lombok.Data;
-import org.springframework.format.annotation.DateTimeFormat;
-
-import java.util.Date;
 
 @Data
 public class GanttDataItem {
@@ -20,4 +15,5 @@ public class GanttDataItem {
     public String parent;
     public Integer projectId;
     public String render;
+    public String type;
 }

+ 3 - 1
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/mapper/ProjectMapper.java

@@ -30,7 +30,7 @@ public interface ProjectMapper extends BaseMapper<Project> {
     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("companyId")Integer companyId,@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);
 
@@ -80,4 +80,6 @@ public interface ProjectMapper extends BaseMapper<Project> {
     List<HashMap> getProjectCostAlarm(Integer companyId, Integer pageStart, Integer pageSize);
 
     List getBaseCostAndRealCost(Integer companyId, Integer pageStart, Integer pageSize);
+
+    List<Map<String, Object>> getProjectCostGroupByProject(Integer companyId, String startDate, String endDate, Integer projectId);
 }

+ 5 - 4
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/mapper/ReportMapper.java

@@ -5,7 +5,6 @@ import com.management.platform.entity.Report;
 import org.apache.ibatis.annotations.Param;
 
 import java.time.LocalDate;
-import java.time.LocalDateTime;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
@@ -23,20 +22,22 @@ public interface ReportMapper extends BaseMapper<Report> {
                                                      @Param("companyId") Integer companyId,
                                                      @Param("userId") String userId,
                                                      @Param("endDate") String endDate,
-                                                     @Param("projectId") Integer projectId
+                                                     @Param("projectId") Integer projectId,
+                                                     @Param("stateKey") Integer stateKey
                                                  );
 
     List<HashMap<String, Object>> getProjectMembReportByDate(@Param("startDate") String startDate,
                                                      @Param("companyId") Integer companyId,
                                                      @Param("leaderId") String leaderId,
                                                      @Param("endDate") String endDate,
-                                                     @Param("projectId") Integer projectId);
+                                                     @Param("projectId") Integer projectId,
+                                                     @Param("stateKey") Integer stateKey);
 
     //获取部门下的人员的日报
     List<HashMap<String, Object>> getDeptMembReportByDate(@Param("startDate") String startDate,
                                                              @Param("companyId") Integer companyId,
                                                              @Param("deptIds") List<Integer> deptIds,
-                                                             @Param("endDate") String endDate, @Param("projectId") Integer projectId);
+                                                             @Param("endDate") String endDate, @Param("projectId") Integer projectId,@Param("stateKey")Integer stateKey);
 
     //按当前人员获取本人报告
     List<Map<String, Object>> getReportByDate(@Param("date") String date, @Param("id") String id);

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

@@ -50,7 +50,7 @@ public interface ProjectService extends IService<Project> {
 
     HttpRespMsg getAllMembCost(String startDate, String endDate, Integer projectId, HttpServletRequest request);
 
-    HttpRespMsg exportTimeCost(String startDate, String endDate, Integer projectId,String userId, Boolean projectSum, HttpServletRequest request);
+    HttpRespMsg exportTimeCost(String startDate, String endDate, Integer projectId,String userId, Boolean projectSum,Integer type,HttpServletRequest request);
 
     HttpRespMsg updateProgress(Integer id, Integer progress, HttpServletRequest request);
 

+ 1 - 1
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/ReportService.java

@@ -23,7 +23,7 @@ import java.util.List;
 public interface ReportService extends IService<Report> {
     HttpRespMsg getReportList(String date, Integer deptId, String userId, HttpServletRequest request);
 
-    HttpRespMsg exportReport(@RequestParam String startDate, @RequestParam String endDate, Integer projectId, HttpServletRequest request);
+    HttpRespMsg exportReport(@RequestParam String startDate, @RequestParam String endDate, Integer projectId,Integer stateKey, HttpServletRequest request);
 
     HttpRespMsg getReport(String date, HttpServletRequest request);
 

+ 226 - 110
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/impl/ProjectServiceImpl.java

@@ -117,6 +117,8 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
     LeaveSheetMapper leaveSheetMapper;
     @Resource
     BusinessTripMapper businessTripMapper;
+    @Resource
+    BustripProjectMapper bustripProjectMapper;
 
     @Resource
     private HttpServletResponse response;
@@ -725,83 +727,132 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
 
     //导出查询者所在公司每个项目的工时成本,包括项目人员明细统计
     @Override
-    public HttpRespMsg exportTimeCost(String startDate, String endDate,Integer projectId, String userId, Boolean projectSum, HttpServletRequest request) {
+    public HttpRespMsg exportTimeCost(String startDate, String endDate,Integer projectId, String userId, Boolean projectSum,Integer type, 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.getTimeCost(companyId, startDate, endDate, projectId, userId);
             BigDecimal totalMoneyCost = BigDecimal.valueOf(0);
-            List<String> headList = new ArrayList<String>();
-            headList.add("项目编号");
-            headList.add("项目名称");
-            headList.add("项目分类");
-            headList.add("人员");
-            headList.add("部门");
-            headList.add("工时(h)");
-            headList.add("成本(元)");
-            List<List<String>> allList = new ArrayList<List<String>>();
-            allList.add(headList);
-            double totalCostTime = 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"));
-                }
-                totalCostTime += (Double)map.get("cost");
-                List<String> rowData = new ArrayList<String>();
-                rowData.add((String)map.get("projectCode"));
-                rowData.add((String)map.get("project"));
-                rowData.add((String)map.get("categoryName"));
-                rowData.add("");
-                rowData.add("");
-                rowData.add(((Double)map.get("cost")).toString());
-                rowData.add(((BigDecimal)map.get("costMoney")).toString());
-                if (projectSum != null && projectSum == true) {
-                    allList.add(rowData);
-                }
-
-                //统计每个项目中的人员时间成本投入
-                int curProjectId = (Integer)map.get("id");
-                List<Map<String, Object>> membList = projectMapper.getProjectCost(startDate, endDate, curProjectId, userId);
-                map.put("membList", membList);
-                for (Map<String, Object> membMap : membList) {
-                    List<String> membRowData = new ArrayList<String>();
-                    if (projectSum == null || projectSum == false) {
-                        membRowData.add((String)map.get("projectCode"));
-                        membRowData.add((String)map.get("project"));
-                        membRowData.add((String)map.get("categoryName"));
+            List<List<String>> allList=null ;
+            List<String> sumRow = null;
+            if(type==0){
+                List<String> headList = new ArrayList<String>();
+                headList.add("项目编号");
+                headList.add("项目名称");
+                headList.add("项目分类");
+                headList.add("人员");
+                headList.add("部门");
+                headList.add("工时(h)");
+                headList.add("成本(元)");
+                allList=new ArrayList<>();
+                allList.add(headList);
+                double totalCostTime = 0;
+                for (Map<String, Object> map : list) {
+                    if (!map.containsKey("cost")) {
+                        map.put("cost", 0);
+                    }
+                    if (!map.containsKey("costMoney")) {
+                        map.put("costMoney", 0);
                     } else {
-                        membRowData.add("");
-                        membRowData.add("");
-                        membRowData.add("");
+                        totalMoneyCost = totalMoneyCost.add((BigDecimal)map.get("costMoney"));
                     }
+                    totalCostTime += (Double)map.get("cost");
+                    List<String> rowData = new ArrayList<String>();
+                    rowData.add((String)map.get("projectCode"));
+                    rowData.add((String)map.get("project"));
+                    rowData.add((String)map.get("categoryName"));
+                    rowData.add("");
+                    rowData.add("");
+                    rowData.add(((Double)map.get("cost")).toString());
+                    rowData.add(((BigDecimal)map.get("costMoney")).toString());
+                    if (projectSum != null && projectSum == true) {
+                        allList.add(rowData);
+                    }
+                    //统计每个项目中的人员时间成本投入
+                    int curProjectId = (Integer)map.get("id");
+                    List<Map<String, Object>> membList = projectMapper.getProjectCost(companyId,startDate, endDate, curProjectId, userId);
+                    map.put("membList", membList);
+                    for (Map<String, Object> membMap : membList) {
+                        List<String> membRowData = new ArrayList<String>();
+                        if (projectSum == null || projectSum == false) {
+                            membRowData.add((String)map.get("projectCode"));
+                            membRowData.add((String)map.get("project"));
+                            membRowData.add((String)map.get("categoryName"));
+                        } else {
+                            membRowData.add("");
+                            membRowData.add("");
+                            membRowData.add("");
+                        }
 
-                    membRowData.add((String)membMap.get("name"));
-                    membRowData.add((String)membMap.get("departmentName"));
-                    membRowData.add(((Double)membMap.get("cost")).toString());
-                    membRowData.add(((BigDecimal)membMap.get("costMoney")).toString());
-                    allList.add(membRowData);
+                        membRowData.add((String)membMap.get("name"));
+                        membRowData.add((String)membMap.get("departmentName"));
+                        membRowData.add(((Double)membMap.get("cost")).toString());
+                        membRowData.add(((BigDecimal)membMap.get("costMoney")).toString());
+                        allList.add(membRowData);
+                    }
                 }
+                //合计
+                sumRow=new ArrayList<>();
+                sumRow.add("合计");
+                sumRow.add("");
+                sumRow.add("");
+                sumRow.add("");
+                sumRow.add("");
+                sumRow.add(""+new BigDecimal(totalCostTime).setScale(1, BigDecimal.ROUND_HALF_UP));
+                sumRow.add(totalMoneyCost.toString());
+                allList.add(sumRow);
+            }else{
+                List<User> userList = userMapper.selectList(new QueryWrapper<User>().eq("company_id", companyId).eq("is_active", 1));
+                List<Object> projectNames = list.stream().map(mp -> mp.get("project")).collect(Collectors.toList());
+                List<Object> projectIds = list.stream().map(mp -> mp.get("id")).collect(Collectors.toList());
+                List<String> headList = new ArrayList<String>();
+                headList.add("人员");
+                projectNames.forEach(pn->{
+                    headList.add(String.valueOf(pn)+"/工时");
+                    headList.add(String.valueOf(pn)+"/成本");
+                });
+                allList=new ArrayList<>();
+                allList.add(headList);
+                //统计当前所有项目所有人的时间成本投入
+                List<Map<String, Object>> membList = projectMapper.getProjectCostGroupByProject(companyId,startDate, endDate, projectId);
+                double lineCostTime=0;
+                BigDecimal lineMoneyCost = BigDecimal.valueOf(0);
+                for (User user : userList) {
+                    boolean flag=false;
+                    List<Map<String, Object>> mapList = membList.stream().filter(mb -> mb.get("creatorId").equals(user.getId())).collect(Collectors.toList());
+                    List<String> membRowData=new ArrayList<>();
+                    membRowData.add(user.getName());
+                        for(Map<String, Object> membMap :mapList){
+                            for(Object i:projectIds){
+                                if(membMap.get("projectId").equals(i)){
+                                    membRowData.add(String.valueOf(membMap.get("cost")));
+                                    membRowData.add(String.valueOf(membMap.get("costMoney")));
+                                    flag=true;
+                                }
+                            }
+                            lineCostTime += (Double)membMap.get("cost");
+                            lineMoneyCost = lineMoneyCost.add((BigDecimal)membMap.get("costMoney"));
+                    }
+                        if(flag){
+                            allList.add(membRowData);
+                        }
+                }
+                //合计
+                /*sumRow=new ArrayList<>();
+                sumRow.add("合计");
+                List<String> finalSumRow = sumRow;
+                BigDecimal finalLineMoneyCost = lineMoneyCost;
+                double finalLineCostTime = lineCostTime;
+                projectNames.forEach(pn->{
+                    finalSumRow.add(""+new BigDecimal(String.valueOf(finalLineCostTime)).setScale(1, BigDecimal.ROUND_HALF_UP));
+                    finalSumRow.add(finalLineMoneyCost.toString());
+                });
+                allList.add(sumRow);*/
             }
-            //合计
-            List<String> sumRow = new ArrayList<String>();
-            sumRow.add("合计");
-            sumRow.add("");
-            sumRow.add("");
-            sumRow.add("");
-            sumRow.add("");
-            sumRow.add(""+new BigDecimal(totalCostTime).setScale(1, BigDecimal.ROUND_HALF_UP));
-            sumRow.add(totalMoneyCost.toString());
-            allList.add(sumRow);
             //生成excel文件导出
-            String fileName = "项目成本统计_"+System.currentTimeMillis();
+            String fileName = "项目成本工时统计_"+System.currentTimeMillis();
             String resp = ExcelUtil.exportGeneralExcelByTitleAndList(fileName , allList, path);
-
             httpRespMsg.data = resp;
         } catch (NullPointerException e) {
             httpRespMsg.setError("验证失败");
@@ -966,7 +1017,7 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
                 TimeType timeType = timeTypeMapper.selectById(companyId);
                 if (timeType.getFixMonthcost() == 0) {
                     Map<String, Object> resultMap = new HashMap<>();
-                    List<Map<String, Object>> list = projectMapper.getProjectCost(startDate, endDate, projectId, null);
+                    List<Map<String, Object>> list = projectMapper.getProjectCost(companyId,startDate, endDate, projectId, null);
                     BigDecimal totalMoneyCost = BigDecimal.valueOf(0);
                     for (Map<String, Object> map : list) {
                         if (!map.containsKey("costMoney")) {
@@ -983,7 +1034,7 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
                     endDate = endDate + "-31";
                     List<Map<String, Object>> userMonthTimeCostList = projectMapper.getUserMonthTimeCost(companyId, startDate+"-01", endDate+"-31");
 
-                    List<Map<String, Object>> list = projectMapper.getProjectCost(startDate, endDate, projectId, null);
+                    List<Map<String, Object>> list = projectMapper.getProjectCost(companyId,startDate, endDate, projectId, null);
 
                     //检查财务表中是否已经导入成本
                     List<Finance> financeList = financeMapper.selectList(new QueryWrapper<Finance>().eq("ymonth", startDate).eq("company_id", companyId));
@@ -1402,6 +1453,8 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
         User user = userMapper.selectById(token);
         List<String> userIds = new ArrayList<>();
         List<SysRichFunction> functionList = sysFunctionMapper.getRoleFunctions(user.getRoleId(), "查看全部项目");
+        List<Department> departmentList = departmentMapper.selectList(new QueryWrapper<Department>().eq("company_id", user.getCompanyId()));
+        List<User> AllUser = userMapper.selectList(new QueryWrapper<User>().eq("company_id", user.getCompanyId()));
         if (functionList.size() == 0) {
             //看看是部门经理还是项目负责人
             if (user.getManageDeptId() != null && user.getManageDeptId() != 0) {
@@ -1464,10 +1517,32 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
                     btQueryWrapper.le("start_date", endDate).ge("end_date", startDate);
                 }
                 List<BusinessTrip> businessTripList = businessTripMapper.selectList(btQueryWrapper);
+                for(Department department:departmentList){
+                    GanttDataItem parent = new GanttDataItem();
+                    parent.id=department.getDepartmentId().toString();
+                    parent.time = 0;
+                    parent.text=department.getDepartmentName();
+                    parent.type="";
+                    if(department.getSuperiorId()!=null){
+                       parent.parent=String.valueOf(department.getSuperiorId());
+                       parent.type="milestone";
+                    }
+                    Set set=new HashSet();
+                    if(set.add(parent.id)){
+                        itemList.add(parent);
+                    }
+                }
                 for(int i=0;i<leaveSheetList.size();i++){
                     GanttDataItem curItem = new GanttDataItem();;
                     if (!leaveSheetList.get(i).getOwnerId().equals(lsLastItemId)) {
                         //抽取父级对象,人员名称
+                        int finalI = i;
+                        Optional<User> first = AllUser.stream().filter(us -> us.getId().equals(leaveSheetList.get(finalI).getOwnerId())).findFirst();
+                        Integer departmentId =null;
+                        if(first.isPresent()){
+                            departmentId=first.get().getDepartmentId();
+                        }
+                        System.out.println("====================="+departmentId+"======================");
                         GanttDataItem parent = new GanttDataItem();
                         parent.id = leaveSheetList.get(i).getOwnerId();
                         parent.userId = leaveSheetList.get(i).getOwnerId();
@@ -1476,10 +1551,10 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
                         parent.start_date = leaveSheetList.get(i).getStartDate().toString();
                         parent.end_date = leaveSheetList.get(i).getEndDate().toString();
                         parent.time = 0;
+                        parent.parent=String.valueOf(departmentId);
                         itemList.add(parent);
                         lsLastItemId =leaveSheetList.get(i).getOwnerId();
                     }
-
                     curItem.id = "请假_"+leaveSheetList.get(i).getId();
                     curItem.userId = leaveSheetList.get(i).getOwnerId();
                     curItem.text = "请假";
@@ -1494,6 +1569,12 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
                     GanttDataItem curItem = new GanttDataItem();;
                     if (!businessTripList.get(i).getOwnerId().equals(btLastItemId)) {
                         //抽取父级对象,人员名称
+                        int finalI = i;
+                        Optional<User> first = AllUser.stream().filter(us -> us.getId().equals(businessTripList.get(finalI).getOwnerId())).findFirst();
+                        Integer departmentId =null;
+                        if(first.isPresent()){
+                            departmentId=first.get().getDepartmentId();
+                        }
                         GanttDataItem parent = new GanttDataItem();
                         parent.id = businessTripList.get(i).getOwnerId();
                         parent.userId = businessTripList.get(i).getOwnerId();
@@ -1502,6 +1583,7 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
                         parent.start_date = businessTripList.get(i).getStartDate().toString();
                         parent.end_date = businessTripList.get(i).getEndDate().toString();
                         parent.time = 0;
+                        parent.parent=String.valueOf(departmentId);
                         itemList.add(parent);
                         btLastItemId =businessTripList.get(i).getOwnerId();
                     }
@@ -1516,43 +1598,56 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
                     btLastItemId = businessTripList.get(i).getOwnerId();
                 }
             } else {
+                //按照项目获取
                 String btLastItemId = null;
                 GanttDataItem btLastParentItem=null;
                 ganttData = projectMapper.getTaskPlanByProject(projectIds, startDate ,endDate, user.getCompanyId());
                 QueryWrapper<BusinessTrip> btQueryWrapper =new QueryWrapper<>();
+                QueryWrapper<BustripProject> bpQueryWrapper =new QueryWrapper<>();
                 btQueryWrapper.in("owner_id", userIds);
                 if (startDate != null && endDate != null) {
-                    btQueryWrapper.le("start_date", endDate).ge("end_date", startDate);
+                    bpQueryWrapper.le("start_date", endDate).ge("end_date", startDate);
+                }
+                List<Integer> btIdList=new ArrayList<>();
+                List<BusinessTrip> businessTripList = businessTripMapper.selectList(btQueryWrapper);
+                if(businessTripList.size()>0){
+                    businessTripList.forEach(bt->{
+                        btIdList.add(bt.getId());
+                    });
+                    bpQueryWrapper.in("bustrip_id", btIdList);
+                }
+                List<BustripProject> bustripProjectList = bustripProjectMapper.selectList(bpQueryWrapper);
+                List<Project> projectList = projectMapper.selectList(new QueryWrapper<Project>().eq("company_id", user.getCompanyId()));
+                for(BusinessTrip businessTrip:businessTripList){
+                    List<BustripProject> collect = bustripProjectList.stream().filter(bp -> bp.getBustripId().equals(businessTrip.getId())).collect(Collectors.toList());
+                    for(BustripProject bustripProject:collect){
+                        GanttDataItem curItem = new GanttDataItem();
+                        if(bustripProject.getProjectId()!=null) {
+                            Project project = projectList.stream().filter(pro -> pro.getId().equals(bustripProject.getProjectId())).collect(Collectors.toList()).get(0);
+                            if (!bustripProject.getProjectId().equals(btLastItemId)) {
+                                //抽取父级对象,项目名称
+                                GanttDataItem parent = new GanttDataItem();
+                                parent.id = String.valueOf(bustripProject.getProjectId());
+                                parent.userId = businessTrip.getOwnerId();
+                                parent.text = project.getProjectName();
+                                parent.render = "split";
+                                parent.start_date = bustripProject.getStartDate().toString();
+                                parent.end_date = bustripProject.getEndDate().toString();
+                                parent.time = 0;
+                                itemList.add(parent);
+                                btLastItemId = String.valueOf(bustripProject.getProjectId());
+                            }
+                            curItem.id = "出差_" + businessTrip.getId();
+                            curItem.userId = businessTrip.getOwnerId();
+                            curItem.text = "出差/" + businessTrip.getOwnerName();
+                            curItem.start_date = bustripProject.getStartDate().toString();
+                            curItem.end_date = bustripProject.getEndDate().toString();
+                            curItem.parent = btLastItemId;
+                            itemList.add(curItem);
+                            btLastItemId = String.valueOf(bustripProject.getProjectId());
+                        }
+                    }
                 }
-//                List<BusinessTrip> businessTripList = businessTripMapper.selectList(btQueryWrapper);
-//                for(int i=0;i<businessTripList.size();i++){
-//                    GanttDataItem curItem = new GanttDataItem();
-//                    if(businessTripList.get(i).getProjectId()!=null) {
-//                        Project project = projectMapper.selectById(businessTripList.get(i).getProjectId());
-//                        businessTripList.get(i).setProjectName(project.getProjectName());
-//                        if (!businessTripList.get(i).getProjectId().equals(btLastItemId)) {
-//                            //抽取父级对象,项目名称
-//                            GanttDataItem parent = new GanttDataItem();
-//                            parent.id = String.valueOf(businessTripList.get(i).getProjectId());
-//                            parent.userId = businessTripList.get(i).getOwnerId();
-//                            parent.text = businessTripList.get(i).getProjectName();
-//                            parent.render = "split";
-//                            parent.start_date = businessTripList.get(i).getStartDate().toString();
-//                            parent.end_date = businessTripList.get(i).getEndDate().toString();
-//                            parent.time = 0;
-//                            itemList.add(parent);
-//                            btLastItemId = String.valueOf(businessTripList.get(i).getProjectId());
-//                        }
-//                        curItem.id = "出差_" + businessTripList.get(i).getId();
-//                        curItem.userId = businessTripList.get(i).getOwnerId();
-//                        curItem.text = "出差/" + businessTripList.get(i).getOwnerName();
-//                        curItem.start_date = businessTripList.get(i).getStartDate().toString();
-//                        curItem.end_date = businessTripList.get(i).getEndDate().toString();
-//                        curItem.parent = btLastItemId;
-//                        itemList.add(curItem);
-//                        btLastItemId = String.valueOf(businessTripList.get(i).getProjectId());
-//                    }
-//                }
             }
             String lastItemId = null;
             GanttDataItem lastParentItem = null;
@@ -1560,10 +1655,17 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
             for (int i=0;i<ganttData.size(); i++) {
                 Map map = ganttData.get(i);
                 String userId = (String) map.get("user_id");
+                List<Map> finalGanttData = ganttData;
+                int finalI = i;
+                Optional<User> first = AllUser.stream().filter(us -> us.getId().equals(finalGanttData.get(finalI).get("user_id"))).findFirst();
+                Integer departmentId =null;
+                if(first.isPresent()){
+                    departmentId=first.get().getDepartmentId();
+                }
                 String start_date = sdf.format((Date) map.get("start_date"));
                 String end_date = sdf.format((Date) map.get("end_date"));
                 String projectId = ""+ (Integer) map.get("id");
-                String exeId = ""+ (Integer) map.get("exe_id");
+                String exeId = "任务"+ (Integer) map.get("exe_id");
                 String taskId = ""+ (Integer) map.get("task_id");
 
                 GanttDataItem curItem = new GanttDataItem();;
@@ -1578,6 +1680,7 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
                         parent.start_date = start_date;
                         parent.end_date = end_date;
                         parent.time = 0;
+                        parent.parent=String.valueOf(departmentId);
                         itemList.add(parent);
                         lastItemId = userId;
                         lastParentItem = parent;
@@ -1817,18 +1920,22 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
                 }
                 //项目编号	项目名称 参与人 负责人 级别 开始日期 截止日期 合同金额
                 XSSFCell codeCell = row.getCell(0);
-                XSSFCell nameCell = row.getCell(1);
-                XSSFCell subNameCell = row.getCell(2);
-                XSSFCell participatorCell = row.getCell(3);
-                XSSFCell inchargerCell = row.getCell(4);
-                XSSFCell levelCell = row.getCell(5);
-                XSSFCell startDateCell = row.getCell(6);
-                XSSFCell endDateCell = row.getCell(7);
-                XSSFCell amountCell = row.getCell(8);
-                XSSFCell isPublicCell = row.getCell(9);
+                XSSFCell categoryCell = row.getCell(1);
+                XSSFCell isPublicCell = row.getCell(2);
+                XSSFCell nameCell = row.getCell(3);
+                XSSFCell subNameCell = row.getCell(4);
+                XSSFCell participatorCell = row.getCell(5);
+                XSSFCell inchargerCell = row.getCell(6);
+                XSSFCell levelCell = row.getCell(7);
+                XSSFCell startDateCell = row.getCell(8);
+                XSSFCell endDateCell = row.getCell(9);
+                XSSFCell amountCell = row.getCell(10);
+
 
                 if (codeCell != null)codeCell.setCellType(CellType.STRING);
                 if (nameCell != null)nameCell.setCellType(CellType.STRING);
+                if (categoryCell != null)categoryCell.setCellType(CellType.STRING);
+                if (isPublicCell != null)isPublicCell.setCellType(CellType.STRING);
                 if (subNameCell != null)subNameCell.setCellType(CellType.STRING);
                 if (participatorCell != null)participatorCell.setCellType(CellType.STRING);
                 if (inchargerCell != null)inchargerCell.setCellType(CellType.STRING);
@@ -1836,11 +1943,9 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
                 if (startDateCell != null)startDateCell.setCellType(CellType.NUMERIC);
                 if (endDateCell != null)endDateCell.setCellType(CellType.NUMERIC);
                 if (amountCell != null)amountCell.setCellType(CellType.STRING);
-                if (isPublicCell != null)isPublicCell.setCellType(CellType.STRING);
                 if (nameCell == null) {//项目名称为空的直接跳过
                     throw new Exception("项目名称不能为空");
                 }
-
                 Project project = new Project();
                 if (codeCell != null) {
                     String code = codeCell.getStringCellValue().trim().replaceAll("\\u00a0", "");
@@ -1852,6 +1957,14 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
                         //跳过第一行标题
                         continue;
                     }
+                    //检查项目是否存在
+                    List<ProjectCategory> projectCategoryList = projectCategoryMapper.selectList(new QueryWrapper<ProjectCategory>().eq("company_id", user.getCompanyId()));
+                    Optional<ProjectCategory> category = projectCategoryList.stream().filter(pc -> pc.getName().equals(categoryCell.getStringCellValue())).findFirst();
+                    if(!category.isPresent()){
+                        throw  new Exception("项目分类["+categoryCell.getStringCellValue()+"]不存在");
+                    }
+                    project.setCategory(category.get().getId());
+                    project.setCategoryName(categoryCell.getStringCellValue());
                     //检查编号是否已经存在
                     if (!StringUtils.isEmpty(code)) {
                         int cnt = projectMapper.selectCount(new QueryWrapper<Project>().eq("project_code", code).eq("company_id", user.getCompanyId()));
@@ -1861,7 +1974,6 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
                     }
                     project.setProjectCode(code);
                 }
-
                 String name = nameCell.getStringCellValue().trim().replaceAll("\\u00a0", "");
                 project.setCompanyId(user.getCompanyId());
                 project.setCreatorId(userId);
@@ -1991,6 +2103,8 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
         Company company = companyMapper.selectById(user.getCompanyId());
         List<String> headList = new ArrayList<String>();
         headList.add("项目编号");
+        headList.add("项目分类");
+        headList.add("是否为公共项目");
         headList.add("项目名称");
         headList.add("负责人");
         headList.add("参与人");
@@ -2017,6 +2131,8 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
         for (Map<String, Object> map : list) {
             List<String> rowData = new ArrayList<>();
             rowData.add((String)map.get("project_code"));
+            rowData.add((String)map.get("category_name"));
+            rowData.add(("1".equals(map.get("is_public").toString())?"是":"否"));
             rowData.add((String)map.get("project_name"));
             rowData.add((String)map.get("incharger_name"));
             rowData.add((String)map.get("participators"));

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

@@ -2493,7 +2493,7 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
 
     //导出报告
     @Override
-    public HttpRespMsg exportReport(@RequestParam String startDate, @RequestParam String endDate, Integer projectId, HttpServletRequest request) {
+    public HttpRespMsg exportReport(@RequestParam String startDate, @RequestParam String endDate, Integer projectId,Integer stateKey, HttpServletRequest request) {
         HttpRespMsg httpRespMsg = new HttpRespMsg();
         try {
             String userId = request.getHeader("Token");
@@ -2591,17 +2591,17 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
                         allSubDepts.addAll(getSubDepts(dept, allDeptList));
                     }
                     List<Integer> collect = allSubDepts.stream().map(Department::getDepartmentId).collect(Collectors.toList());
-                    allReportByDate = reportMapper.getDeptMembReportByDate(startDate, null, collect, endDate, projectId);
+                    allReportByDate = reportMapper.getDeptMembReportByDate(startDate, null, collect, endDate, projectId,stateKey);
                 }
 
                 List<HashMap<String, Object>> reportsFromProjects = null;
                 //检查是否是项目负责人
                 int cnt = projectMapper.selectCount(new QueryWrapper<Project>().eq("incharger_id", user.getId()));
                 if (cnt > 0) {
-                    reportsFromProjects = reportMapper.getProjectMembReportByDate(startDate, null, user.getId(), endDate, projectId);
+                    reportsFromProjects = reportMapper.getProjectMembReportByDate(startDate, null, user.getId(), endDate, projectId,stateKey);
                 } else {
                     //普通员工只能看自己的
-                    reportsFromProjects = reportMapper.getAllReportByDate(startDate, null, user.getId(), endDate, projectId);
+                    reportsFromProjects = reportMapper.getAllReportByDate(startDate, null, user.getId(), endDate, projectId,stateKey);
                 }
                 if (allReportByDate == null) {
                     allReportByDate = reportsFromProjects;
@@ -2621,7 +2621,7 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
 //            }
             else {
                 //看公司所有人的
-                allReportByDate = reportMapper.getAllReportByDate(startDate, user.getCompanyId(), null, endDate, projectId);
+                allReportByDate = reportMapper.getAllReportByDate(startDate, user.getCompanyId(), null, endDate, projectId,stateKey);
             }
             if (timeType.getMultiWorktime() == 1) {
                 java.text.DecimalFormat df = new java.text.DecimalFormat("#0.00");

+ 26 - 4
fhKeeper/formulahousekeeper/management-platform/src/main/resources/mapper/ProjectMapper.xml

@@ -124,6 +124,9 @@
     </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
@@ -175,12 +178,14 @@
 
     <!--获取某个项目每个人分别需要的工时-->
     <select id="getProjectCost" resultType="java.util.Map">
-        SELECT b.id as creatorId, b.name,a.dept_id as deptId, IFNULL(department.department_name, '未分配') as departmentName, SUM(a.working_time) AS cost, SUM(a.cost) AS costMoney
+        SELECT b.id as creatorId,a.project_id as projectId, b.name,a.dept_id as deptId, IFNULL(department.department_name, '未分配') as departmentName, SUM(a.working_time) AS cost, SUM(a.cost) AS costMoney
         FROM report AS a
         JOIN user AS b ON a.creator_id = b.id
         left join department on department.department_id = a.dept_id
-        WHERE a.project_id = #{projectId}
-        AND a.state = 1
+        WHERE a.company_id=#{companyId} and a.state = 1
+        <if test="projectId != null">
+            and a.project_id = #{projectId}
+        </if>
         <if test="startDate != null and endDate != null">
             AND a.create_date between #{startDate} and #{endDate}
         </if>
@@ -191,6 +196,23 @@
         ORDER BY b.id ASC, a.dept_id ASC
     </select>
 
+    <!--获取个人每个项目分别需要的工时-->
+    <select id="getProjectCostGroupByProject" resultType="java.util.Map">
+        SELECT b.id as creatorId,a.creator_id as creatorId,a.project_id as projectId, b.name,a.dept_id as deptId, IFNULL(department.department_name, '未分配') as departmentName, SUM(a.working_time) AS cost, SUM(a.cost) AS costMoney
+        FROM report AS a
+        JOIN user AS b ON a.creator_id = b.id
+        left join department on department.department_id = a.dept_id
+        WHERE a.company_id=#{companyId} and a.state = 1
+        <if test="projectId != null">
+            and a.project_id = #{projectId}
+        </if>
+        <if test="startDate != null and endDate != null">
+            AND a.create_date between #{startDate} and #{endDate}
+        </if>
+        GROUP BY b.id, a.dept_id,a.project_id
+        ORDER BY b.id ASC, a.dept_id ASC
+    </select>
+
 
     <!-- 获取人员在日报填写的自定义数值 -->
     <select id="getProjectCusDataSumItem" resultType="java.util.Map">
@@ -408,7 +430,7 @@
     </select>
     <!--项目导出数据-->
     <select id="getExportData" resultType="java.util.HashMap" >
-        SELECT project.id, project_name, project_code, plan_start_date, d.name AS incharger_name,GROUP_CONCAT(u.name) AS participators,
+        SELECT project.id, project_name, project_code,category_name,is_public,plan_start_date, d.name AS incharger_name,GROUP_CONCAT(u.name) AS participators,
         plan_end_date, progress, LEVEL, STATUS, finish_date, creator_id, creator_name, create_date, contract_amount,
         customer_name, associate_degree_names
         FROM project LEFT JOIN sub_project ON sub_project.id = project.`id`

+ 9 - 0
fhKeeper/formulahousekeeper/management-platform/src/main/resources/mapper/ReportMapper.xml

@@ -82,6 +82,9 @@
         <if test="userId != null">
             AND a.creator_id = #{userId}
         </if>
+        <if test="stateKey!=null and stateKey==1">
+            or a.state =0
+        </if>
         ORDER BY a.creator_id, a.create_date desc
     </select>
 
@@ -142,6 +145,9 @@
         <if test="leaderId != null">
             AND b.incharger_id = #{leaderId}
         </if>
+        <if test="stateKey!=null and stateKey==1">
+            or a.state=0
+        </if>
         ORDER BY a.creator_id, a.create_date desc
     </select>
 
@@ -171,6 +177,9 @@
         <if test="projectId != null">
             AND a.project_id = #{projectId}
         </if>
+        <if test="stateKey!=null and stateKey==0">
+            AND a.state in (1,2,3)
+        </if>
         <if test="deptIds != null">
             AND c.department_id in
             <foreach collection="deptIds" item="deptId" separator="," close=")" open="(" index="index">

+ 3 - 2
fhKeeper/formulahousekeeper/timesheet/src/views/centerManage/centerManage.vue

@@ -14,8 +14,9 @@
                     {{scope.$index + 1}}
                 </template>
             </el-table-column>
-            <el-table-column prop="name" label="名称" ></el-table-column>
-            <el-table-column label="操作" width="150">
+            <el-table-column prop="name" label="名称" min-width="120" show-overflow-tooltip></el-table-column>
+            <el-table-column prop="projects" label="相关项目" min-width="180" show-overflow-tooltip></el-table-column>
+            <el-table-column label="操作" width="170">
                 <template slot-scope="scope" >
                     <el-button size="small" type="primary" @click="addNewSubProject(scope.row)">编辑</el-button>
                     <el-button size="small" type="danger" @click="deleteSubPro(scope.row)">删除</el-button>

+ 1 - 1
fhKeeper/formulahousekeeper/timesheet/src/views/corpreport/list.vue

@@ -48,7 +48,7 @@
                     {{scope.row.projectName}}
                   </template>
                 </el-table-column>
-                <el-table-column prop="inchargerName" label="负责人"  width="80">
+                <el-table-column prop="inchargerName" label="负责人"  width="130">
                   <template slot-scope="scope" >
                     {{scope.row.inchargerName}}
                   </template>

+ 37 - 1
fhKeeper/formulahousekeeper/timesheet/src/views/leave/list.vue

@@ -526,6 +526,9 @@
                   </span> 
               </el-select>
             </div>
+            <div style="margin:0 10px 0 40px">
+              <el-button size="small" type="primary" @click="listSynchronize" :loading="synchronizeLoading">从钉钉同步</el-button>
+            </div>
             
           </div>
             <el-table key="apk2is8" v-loading="loading" :data="vacationList" style="width: 100%" height="90%">
@@ -817,7 +820,8 @@ export default {
       leaveTypeItem: '',
       departmentOptions: [],
       departmentSel: [],
-      userSelId: ''
+      userSelId: '',
+      synchronizeLoading: false
     };
   },
   computed: {},
@@ -847,7 +851,39 @@ export default {
   },
   filters: {},
   methods: {
+    // 从钉钉同步假期剩余表
+    listSynchronize(){
+      this.synchronizeLoading = true
+      this.http.post('/dingding/syncLeaveQuotaData',{
+        companyId: this.user.companyId
+      },res => {
+        if(res.code == 'ok'){
+          this.synchronizeLoading = false
+          this.$message({
+            message: '同步成功',
+            type: 'success'
+          })
+          this.getVacationList()
+          this.page = 1
+          this.departmentSel = []
+          this.userSelId = ''
+        }else {
+          this.synchronizeLoading = false
+          this.$message({
+            message: res.msg,
+            type: 'error'
+          })
+        }
+      },err => {
+        this.synchronizeLoading = false
+        this.$message({
+          message: err,
+          type: 'error'
+        })
+      })
+    },
 
+    // 获取部门列表
     getDepartmentOptions(){
       this.http.post(this.port.manage.depList,{
       },res =>{

+ 4 - 1
fhKeeper/formulahousekeeper/timesheet/src/views/project/cost.vue

@@ -9,6 +9,7 @@
             </el-radio-group></div>
         </el-col>
         <el-col :span="14" style="display: flex;flex-wrap: wrap;">
+            <div style="width:100%;display:flex">
             <el-date-picker v-show="user.timeType.fixMonthcost==0"
             v-model="dateRange" :editable="false" 
             format="yyyy-MM-dd" value-format="yyyy-MM-dd" 
@@ -34,10 +35,12 @@
                 <el-radio-button label="人员"></el-radio-button>
                 <el-radio-button :label="namess" v-if="jichu.customDegreeActive == 1"></el-radio-button>
             </el-radio-group>
-
+            </div>
+            <div style="width:100%;display:flex">
             <el-select v-model="personnelValue" filterable clearable placeholder="请选择人员" style="margin-top: 10px;width: 350px" v-if="radio == '人员'" @change="personnel()">
                 <el-option v-for="item in hasReportUserList" :key="item.id" :label="item.name" :value="item.name"></el-option>
             </el-select>
+            </div>
         </el-col>
         <el-col :span="4">
             <el-button @click="showExportDialog">报表导出</el-button>

Failā izmaiņas netiks attēlotas, jo tās ir par lielu
+ 213 - 121
fhKeeper/formulahousekeeper/timesheet/src/views/project/project_gantt.vue


+ 16 - 25
fhKeeper/formulahousekeeper/timesheet/src/views/workReport/daily.vue

@@ -20,7 +20,7 @@
                          <el-button style="margin-left:10px;" icon="iconfont firerock-icongongshitongji" size="mini"  @click="showWorkTime"></el-button>
                     </div> -->
                         <span v-for="(item,index) in allDate" :id="'day'+index" :class="index==choseDay?'chooseDate date_item':'date_item'"
-                        @click="choseDate(index, item)" :key="index" style="padding:0 6px;display: inline-block;width: 46px;text-align: center;">
+                        @click="choseDate(index, item)" :key="index" :style="'padding:0 6px;display: inline-block;width: 46px;text-align: center;' + (canClick(index,item) == false ? 'color:#c0c0c0;cursor:not-allowed;' : '') ">
                         <div :style="'display:inline-block;text-align: center;'+(item.state == null?'':'')" >
                             <div style="text-align:center;position:relative;"><span>{{item.showDate}}</span>
                             <br>
@@ -3200,7 +3200,18 @@
 
             // 选择日期
             choseDate(i, item) {
-                
+                if(this.canClick(i,item) == false){
+                    return
+                }
+                // console.log(nowDateYear,nowDateMonth,nowDateDay,'..',itemYear,itemMonth,itemDay);
+                this.choseDay = i;
+                let day = (this.choseDay +1)> 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
+                sessionStorage.msg = this.date + day,
+                this.getReportList();
+                this.getDepartment();
+                this.curDate = item.date;
+            },
+            canClick(i, item){
                 let nowDate = new Date()
                 let nowDateYear = nowDate.getFullYear()
                 let itemYear = parseInt(this.date.split('-')[0])
@@ -3209,36 +3220,16 @@
                 let nowDateDay = nowDate.getDate()
                 let itemDay = parseInt(item.showDate.split('.')[1])
                 if(nowDateYear < itemYear){
-                    this.$message({
-                        message: '无法填报',
-                        type: 'warning'
-                    })
-                    return
+                    return false
                 }else if(nowDateYear == itemYear){
                     if(nowDateMonth < itemMonth){
-                        this.$message({
-                            message: '无法填报',
-                            type: 'warning'
-                        })
-                        return
+                        return false
                     }else if(nowDateMonth == itemMonth){
                         if(nowDateDay < itemDay){
-                            this.$message({
-                                message: '无法填报',
-                                type: 'warning'
-                            })
-                            return
+                            return false
                         }
                     }
                 }
-
-                console.log(nowDateYear,nowDateMonth,nowDateDay,'..',itemYear,itemMonth,itemDay);
-                this.choseDay = i;
-                let day = (this.choseDay +1)> 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
-                sessionStorage.msg = this.date + day,
-                this.getReportList();
-                this.getDepartment();
-                this.curDate = item.date;
             },
 
             // 获取日期列表

Failā izmaiņas netiks attēlotas, jo tās ir par lielu
+ 1261 - 231
fhKeeper/formulahousekeeper/timesheet_h5/src/assets/style/font/demo_index.html


Failā izmaiņas netiks attēlotas, jo tās ir par lielu
+ 221 - 47
fhKeeper/formulahousekeeper/timesheet_h5/src/assets/style/font/iconfont.css


Failā izmaiņas netiks attēlotas, jo tās ir par lielu
+ 1 - 1
fhKeeper/formulahousekeeper/timesheet_h5/src/assets/style/font/iconfont.js


+ 413 - 105
fhKeeper/formulahousekeeper/timesheet_h5/src/assets/style/font/iconfont.json

@@ -1,163 +1,471 @@
 {
-  "id": "1456778",
-  "name": "苏打优选",
+  "id": "2390497",
+  "name": "seyaproject",
   "font_family": "iconfont",
-  "css_prefix_text": "icon-",
+  "css_prefix_text": "firerock-icon",
   "description": "",
   "glyphs": [
     {
-      "icon_id": "91804",
-      "name": "待收货",
-      "font_class": "daishouhuo",
-      "unicode": "e601",
-      "unicode_decimal": 58881
+      "icon_id": "15673407",
+      "name": "打卡记录",
+      "font_class": "dakajilu",
+      "unicode": "e6e1",
+      "unicode_decimal": 59105
     },
     {
-      "icon_id": "908503",
-      "name": "搜索",
-      "font_class": "sousuo",
-      "unicode": "e678",
-      "unicode_decimal": 59000
+      "icon_id": "5651484",
+      "name": "关联",
+      "font_class": "guanlian",
+      "unicode": "e674",
+      "unicode_decimal": 58996
     },
     {
-      "icon_id": "915611",
-      "name": "首页",
-      "font_class": "shouye",
-      "unicode": "e677",
-      "unicode_decimal": 58999
+      "icon_id": "14949575",
+      "name": "users",
+      "font_class": "users",
+      "unicode": "e70a",
+      "unicode_decimal": 59146
     },
     {
-      "icon_id": "1085722",
-      "name": "设置",
-      "font_class": "shezhi",
-      "unicode": "e65c",
-      "unicode_decimal": 58972
+      "icon_id": "736503",
+      "name": "权限",
+      "font_class": "quanxian1",
+      "unicode": "e615",
+      "unicode_decimal": 58901
     },
     {
-      "icon_id": "1110582",
-      "name": "购物车—线",
-      "font_class": "gouwuchexian",
-      "unicode": "e60d",
-      "unicode_decimal": 58893
+      "icon_id": "7987507",
+      "name": "系统",
+      "font_class": "xitong-",
+      "unicode": "e616",
+      "unicode_decimal": 58902
     },
     {
-      "icon_id": "1162363",
-      "name": "待发货",
-      "font_class": "1111113",
-      "unicode": "e60c",
-      "unicode_decimal": 58892
+      "icon_id": "11111002",
+      "name": "客户",
+      "font_class": "kehu",
+      "unicode": "e67e",
+      "unicode_decimal": 59006
     },
     {
-      "icon_id": "1215021",
-      "name": "反馈",
-      "font_class": "iconfontfankui",
-      "unicode": "e6b4",
-      "unicode_decimal": 59060
+      "icon_id": "6517457",
+      "name": "文件-请假单",
+      "font_class": "wj-qjd",
+      "unicode": "e70e",
+      "unicode_decimal": 59150
     },
     {
-      "icon_id": "1382060",
-      "name": "礼物",
-      "font_class": "liwu",
-      "unicode": "e694",
-      "unicode_decimal": 59028
+      "icon_id": "5961300",
+      "name": "待办事项",
+      "font_class": "daibanshixiang",
+      "unicode": "ec4e",
+      "unicode_decimal": 60494
     },
     {
-      "icon_id": "1577002",
-      "name": "客服",
-      "font_class": "kefu",
-      "unicode": "e618",
-      "unicode_decimal": 58904
+      "icon_id": "11465003",
+      "name": "待办",
+      "font_class": "daiban",
+      "unicode": "e64b",
+      "unicode_decimal": 58955
     },
     {
-      "icon_id": "1610138",
-      "name": "钱包",
-      "font_class": "qianbao",
+      "icon_id": "6023953",
+      "name": "工时统计",
+      "font_class": "gongshitongji",
       "unicode": "e614",
       "unicode_decimal": 58900
     },
     {
-      "icon_id": "1833855",
-      "name": "下箭头",
-      "font_class": "xiajiantou",
-      "unicode": "e733",
-      "unicode_decimal": 59187
+      "icon_id": "2318254",
+      "name": "审核通过",
+      "font_class": "shenhetongguo",
+      "unicode": "e6a0",
+      "unicode_decimal": 59040
     },
     {
-      "icon_id": "2076312",
-      "name": " 我的",
-      "font_class": "wode",
-      "unicode": "e8a0",
-      "unicode_decimal": 59552
+      "icon_id": "9144552",
+      "name": "审核驳回",
+      "font_class": "shenhebohui",
+      "unicode": "e6c6",
+      "unicode_decimal": 59078
     },
     {
-      "icon_id": "2392549",
-      "name": "打勾",
-      "font_class": "dagou",
-      "unicode": "e670",
-      "unicode_decimal": 58992
+      "icon_id": "17483402",
+      "name": "待办  等待 审核",
+      "font_class": "daibandengdaishenhe",
+      "unicode": "e612",
+      "unicode_decimal": 58898
+    },
+    {
+      "icon_id": "5149104",
+      "name": "建筑工程类",
+      "font_class": "jianzhugongchenglei",
+      "unicode": "e61e",
+      "unicode_decimal": 58910
+    },
+    {
+      "icon_id": "16187171",
+      "name": "甘特图",
+      "font_class": "gantetu",
+      "unicode": "e6a1",
+      "unicode_decimal": 59041
+    },
+    {
+      "icon_id": "3686260",
+      "name": "客户管理",
+      "font_class": "kehuguanli",
+      "unicode": "e60f",
+      "unicode_decimal": 58895
+    },
+    {
+      "icon_id": "1868952",
+      "name": "流程",
+      "font_class": "liucheng",
+      "unicode": "e634",
+      "unicode_decimal": 58932
+    },
+    {
+      "icon_id": "9651039",
+      "name": "长箭头",
+      "font_class": "right",
+      "unicode": "e60e",
+      "unicode_decimal": 58894
+    },
+    {
+      "icon_id": "17223736",
+      "name": "App_New_Line",
+      "font_class": "App_New_Line",
+      "unicode": "e6e3",
+      "unicode_decimal": 59107
+    },
+    {
+      "icon_id": "261001",
+      "name": "line",
+      "font_class": "0",
+      "unicode": "e609",
+      "unicode_decimal": 58889
+    },
+    {
+      "icon_id": "17197893",
+      "name": "Insert Line",
+      "font_class": "InsertLine",
+      "unicode": "e61d",
+      "unicode_decimal": 58909
+    },
+    {
+      "icon_id": "19410111",
+      "name": "密 码",
+      "font_class": "mima",
+      "unicode": "e611",
+      "unicode_decimal": 58897
     },
     {
-      "icon_id": "2488741",
-      "name": "home",
-      "font_class": "home",
-      "unicode": "e641",
-      "unicode_decimal": 58945
+      "icon_id": "16842350",
+      "name": "密 码",
+      "font_class": "mima1",
+      "unicode": "e608",
+      "unicode_decimal": 58888
     },
     {
-      "icon_id": "3670096",
-      "name": "购物车",
-      "font_class": "tubiaolunkuo-",
+      "icon_id": "20915138",
+      "name": "验证码",
+      "font_class": "yanzhengma",
+      "unicode": "e60d",
+      "unicode_decimal": 58893
+    },
+    {
+      "icon_id": "11640993",
+      "name": "dot",
+      "font_class": "dot",
+      "unicode": "e60b",
+      "unicode_decimal": 58891
+    },
+    {
+      "icon_id": "9382963",
+      "name": "dot",
+      "font_class": "dot2",
+      "unicode": "e607",
+      "unicode_decimal": 58887
+    },
+    {
+      "icon_id": "7171606",
+      "name": "报表管理",
+      "font_class": "baobiao",
+      "unicode": "e636",
+      "unicode_decimal": 58934
+    },
+    {
+      "icon_id": "4426098",
+      "name": "组织架构",
+      "font_class": "zuzhijiagou1",
+      "unicode": "e698",
+      "unicode_decimal": 59032
+    },
+    {
+      "icon_id": "13100227",
+      "name": "填报",
+      "font_class": "tianbao1",
+      "unicode": "e60a",
+      "unicode_decimal": 58890
+    },
+    {
+      "icon_id": "4469651",
+      "name": "组织架构",
+      "font_class": "zuzhijiagou",
       "unicode": "e606",
       "unicode_decimal": 58886
     },
     {
-      "icon_id": "5294023",
-      "name": "红包",
-      "font_class": "hongbao",
-      "unicode": "e72f",
-      "unicode_decimal": 59183
+      "icon_id": "4231111",
+      "name": "组织结构",
+      "font_class": "zuzhijiegou",
+      "unicode": "e670",
+      "unicode_decimal": 58992
+    },
+    {
+      "icon_id": "12860884",
+      "name": "权限",
+      "font_class": "quanxian",
+      "unicode": "e663",
+      "unicode_decimal": 58979
+    },
+    {
+      "icon_id": "2101853",
+      "name": "报销",
+      "font_class": "baoxiao",
+      "unicode": "e788",
+      "unicode_decimal": 59272
+    },
+    {
+      "icon_id": "5207594",
+      "name": "报销单",
+      "font_class": "baoxiaodan",
+      "unicode": "e644",
+      "unicode_decimal": 58948
+    },
+    {
+      "icon_id": "19236386",
+      "name": "填报",
+      "font_class": "tianbao",
+      "unicode": "e726",
+      "unicode_decimal": 59174
+    },
+    {
+      "icon_id": "12000587",
+      "name": "记录",
+      "font_class": "record",
+      "unicode": "e605",
+      "unicode_decimal": 58885
+    },
+    {
+      "icon_id": "20147073",
+      "name": "导入",
+      "font_class": "daoru",
+      "unicode": "e613",
+      "unicode_decimal": 58899
     },
     {
-      "icon_id": "5452460",
-      "name": "缓存",
-      "font_class": "huancun",
+      "icon_id": "20154661",
+      "name": "导出",
+      "font_class": "daochu",
+      "unicode": "e6ab",
+      "unicode_decimal": 59051
+    },
+    {
+      "icon_id": "19441448",
+      "name": "export",
+      "font_class": "export",
+      "unicode": "e72d",
+      "unicode_decimal": 59181
+    },
+    {
+      "icon_id": "8796451",
+      "name": "启动",
+      "font_class": "qidong",
+      "unicode": "e63c",
+      "unicode_decimal": 58940
+    },
+    {
+      "icon_id": "19037188",
+      "name": "完 成 ",
+      "font_class": "wancheng",
+      "unicode": "e610",
+      "unicode_decimal": 58896
+    },
+    {
+      "icon_id": "20134686",
+      "name": "菜单",
+      "font_class": "caidan",
+      "unicode": "e6b7",
+      "unicode_decimal": 59063
+    },
+    {
+      "icon_id": "8524192",
+      "name": "审核",
+      "font_class": "shenhe",
       "unicode": "e604",
       "unicode_decimal": 58884
     },
     {
-      "icon_id": "5460006",
-      "name": "定位",
-      "font_class": "yuejuan_Location",
-      "unicode": "e619",
-      "unicode_decimal": 58905
+      "icon_id": "3590688",
+      "name": "里程碑",
+      "font_class": "icon-",
+      "unicode": "e6ad",
+      "unicode_decimal": 59053
     },
     {
-      "icon_id": "5849780",
-      "name": "右箭头",
-      "font_class": "iconfontyoujiantou-copy-copy-copy-copy",
-      "unicode": "e600",
-      "unicode_decimal": 58880
+      "icon_id": "5112963",
+      "name": "任务",
+      "font_class": "renwu",
+      "unicode": "e64c",
+      "unicode_decimal": 58956
+    },
+    {
+      "icon_id": "10368440",
+      "name": "风险",
+      "font_class": "fengxian",
+      "unicode": "e6a2",
+      "unicode_decimal": 59042
+    },
+    {
+      "icon_id": "17156568",
+      "name": "ok",
+      "font_class": "normal-ico-ok",
+      "unicode": "e70f",
+      "unicode_decimal": 59151
+    },
+    {
+      "icon_id": "1161198",
+      "name": "棱形",
+      "font_class": "icon2",
+      "unicode": "e603",
+      "unicode_decimal": 58883
+    },
+    {
+      "icon_id": "10202911",
+      "name": "file",
+      "font_class": "file",
+      "unicode": "e60c",
+      "unicode_decimal": 58892
+    },
+    {
+      "icon_id": "2078615",
+      "name": "excel",
+      "font_class": "ex",
+      "unicode": "e65c",
+      "unicode_decimal": 58972
+    },
+    {
+      "icon_id": "4073514",
+      "name": "Zip",
+      "font_class": "Zip",
+      "unicode": "e9ec",
+      "unicode_decimal": 59884
     },
     {
-      "icon_id": "7400719",
-      "name": "退货",
-      "font_class": "tuihuo",
-      "unicode": "e624",
-      "unicode_decimal": 58916
+      "icon_id": "4863362",
+      "name": "JPG",
+      "font_class": "JPG",
+      "unicode": "e6ed",
+      "unicode_decimal": 59117
     },
     {
-      "icon_id": "9031364",
-      "name": "标准待分享2",
-      "font_class": "biaozhundaifenxiang",
+      "icon_id": "5173010",
+      "name": "audio",
+      "font_class": "audio",
       "unicode": "e602",
       "unicode_decimal": 58882
     },
     {
-      "icon_id": "9173301",
-      "name": "下箭头",
-      "font_class": "xiajiantou-copy",
-      "unicode": "e8a1",
-      "unicode_decimal": 59553
+      "icon_id": "8469709",
+      "name": "txt",
+      "font_class": "txt",
+      "unicode": "e741",
+      "unicode_decimal": 59201
+    },
+    {
+      "icon_id": "19705514",
+      "name": "video",
+      "font_class": "video",
+      "unicode": "e771",
+      "unicode_decimal": 59249
+    },
+    {
+      "icon_id": "20213818",
+      "name": "PDF",
+      "font_class": "PDF",
+      "unicode": "e61a",
+      "unicode_decimal": 58906
+    },
+    {
+      "icon_id": "20651005",
+      "name": "word",
+      "font_class": "word",
+      "unicode": "eecf",
+      "unicode_decimal": 61135
+    },
+    {
+      "icon_id": "17781647",
+      "name": "上 传",
+      "font_class": "shangchuan",
+      "unicode": "e6fd",
+      "unicode_decimal": 59133
+    },
+    {
+      "icon_id": "7337849",
+      "name": "秒表",
+      "font_class": "miaobiao",
+      "unicode": "ecfa",
+      "unicode_decimal": 60666
+    },
+    {
+      "icon_id": "8659928",
+      "name": "task",
+      "font_class": "task",
+      "unicode": "e600",
+      "unicode_decimal": 58880
+    },
+    {
+      "icon_id": "13530978",
+      "name": "time",
+      "font_class": "meditor-time",
+      "unicode": "e601",
+      "unicode_decimal": 58881
+    },
+    {
+      "icon_id": "9339879",
+      "name": "tree",
+      "font_class": "tree",
+      "unicode": "e691",
+      "unicode_decimal": 59025
+    },
+    {
+      "icon_id": "807967",
+      "name": "统计",
+      "font_class": "tongji",
+      "unicode": "e631",
+      "unicode_decimal": 58929
+    },
+    {
+      "icon_id": "1778691",
+      "name": "项目",
+      "font_class": "xiangmu",
+      "unicode": "e617",
+      "unicode_decimal": 58903
+    },
+    {
+      "icon_id": "14417643",
+      "name": "财务",
+      "font_class": "caiwu",
+      "unicode": "e89c",
+      "unicode_decimal": 59548
+    },
+    {
+      "icon_id": "11673579",
+      "name": "setting",
+      "font_class": "setting",
+      "unicode": "e672",
+      "unicode_decimal": 58994
     }
   ]
 }

BIN
fhKeeper/formulahousekeeper/timesheet_h5/src/assets/style/font/iconfont.ttf


BIN
fhKeeper/formulahousekeeper/timesheet_h5/src/assets/style/font/iconfont.woff


BIN
fhKeeper/formulahousekeeper/timesheet_h5/src/assets/style/font/iconfont.woff2


+ 27 - 0
fhKeeper/formulahousekeeper/timesheet_h5/src/views/edit/index.vue

@@ -3,8 +3,15 @@
         <van-nav-bar title="填写日报" left-text="返回" @click-left="back" fixed left-arrow/>
 
         <van-form class="login_form" @submit="submitReport">
+            <div>
             <van-field readonly clickable name="datetimePicker" :value="form.createDate" label="时间选择" placeholder="点击选择时间" 
             @click="showPicker = true" :rules="rules.createDate" />
+                <div v-if="report.time" class="attendanceRecord">
+                    <i class="iconfont firerock-icondakajilu" style="font-size:0.35rem;margin-right:0.12rem"></i>
+                    <span v-if="user.timeType.syncDingding==1&&!report.time">暂无考勤记录</span>
+                    <span v-else>{{report.time.startTime}}-{{report.time.endTime}}, {{report.time.workHours}}小时</span>
+                </div>
+            </div>
             <van-popup v-model="showPicker" position="bottom">
                 <van-datetime-picker v-model="currentDate" type="date" :min-date="minDate" :max-date="maxDate" @confirm="changeTime" @cancel="showPicker = false"/>
             </van-popup>
@@ -1221,6 +1228,7 @@
                         }
                     }
                 }
+                
                 // return
                 const toast = this.$toast.loading({
                     forbidClick: true,
@@ -1271,6 +1279,16 @@
                         return;
                     }
                 }
+                if (this.reportTimeType.type == 1 && this.report.time) {
+                            var totalTime = 0;
+                            for (var t=0;t<this.form.domains.length; t++) {
+                                totalTime += parseFloat(this.form.domains[t].workingTime);
+                            }
+                            if (this.report.time.workHours && totalTime > parseFloat(this.report.time.workHours)) {
+                                this.$toast.fail("填报工时之和"+(totalTime)+"h不能超过考勤总工时("+this.report.time.workHours.toFixed(1)+"h)");
+                                return;
+                            }
+                        }
                 
                 //填字段
                 for(var i in this.form.domains) {
@@ -1550,6 +1568,15 @@
     }
     .login_form {
         margin-top: 46px;
+        position: relative;
+    }
+    .attendanceRecord{
+        position: absolute;
+        top: 0.26667rem;
+        right: 0.42667rem;
+        color: #969799;
+        font-size: 0.35rem;
+        line-height: 0.64rem;
     }
 
     .form_domains {

+ 9 - 10
fhKeeper/formulahousekeeper/timesheet_h5/vue.config.js

@@ -4,16 +4,15 @@ const path = require('path');
 const themePath = path.resolve(__dirname,'src/assets/style/theme.less');
 
 // var ip = '127.0.0.1'
-var ip = '192.168.2.4'
-// 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
-//         }
-//     }
-// }
+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
+        }
+    }
+}
 
 module.exports = {
     // 关闭eslint检查