Browse Source

Merge remote-tracking branch 'origin/master'

yusm 1 year ago
parent
commit
7f49948ecc
23 changed files with 733 additions and 128 deletions
  1. 21 0
      fhKeeper/formulahousekeeper/management-crm/src/main/java/com/management/platform/controller/BusinessItemProductController.java
  2. 57 1
      fhKeeper/formulahousekeeper/management-crm/src/main/java/com/management/platform/controller/BusinessOpportunityController.java
  3. 3 8
      fhKeeper/formulahousekeeper/management-crm/src/main/java/com/management/platform/controller/ClueController.java
  4. 69 0
      fhKeeper/formulahousekeeper/management-crm/src/main/java/com/management/platform/entity/BusinessItemProduct.java
  5. 10 1
      fhKeeper/formulahousekeeper/management-crm/src/main/java/com/management/platform/entity/BusinessOpportunity.java
  6. 16 0
      fhKeeper/formulahousekeeper/management-crm/src/main/java/com/management/platform/mapper/BusinessItemProductMapper.java
  7. 3 0
      fhKeeper/formulahousekeeper/management-crm/src/main/java/com/management/platform/mapper/BusinessOpportunityMapper.java
  8. 16 0
      fhKeeper/formulahousekeeper/management-crm/src/main/java/com/management/platform/service/BusinessItemProductService.java
  9. 3 0
      fhKeeper/formulahousekeeper/management-crm/src/main/java/com/management/platform/service/BusinessOpportunityService.java
  10. 20 0
      fhKeeper/formulahousekeeper/management-crm/src/main/java/com/management/platform/service/impl/BusinessItemProductServiceImpl.java
  11. 9 0
      fhKeeper/formulahousekeeper/management-crm/src/main/java/com/management/platform/service/impl/BusinessOpportunityServiceImpl.java
  12. 3 1
      fhKeeper/formulahousekeeper/management-crm/src/main/java/com/management/platform/service/impl/ClueServiceImpl.java
  13. 19 0
      fhKeeper/formulahousekeeper/management-crm/src/main/resources/mapper/BusinessItemProductMapper.xml
  14. 20 0
      fhKeeper/formulahousekeeper/management-crm/src/main/resources/mapper/BusinessOpportunityMapper.xml
  15. 24 0
      fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/controller/GroupBudgetReviewController.java
  16. 99 1
      fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/controller/TaskController.java
  17. 28 0
      fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/impl/ProjectServiceImpl.java
  18. 4 3
      fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/impl/TaskServiceImpl.java
  19. 4 0
      fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/impl/WxCorpInfoServiceImpl.java
  20. 2 3
      fhKeeper/formulahousekeeper/management-platform/src/main/resources/mapper/TaskMapper.xml
  21. 150 97
      fhKeeper/formulahousekeeper/timesheet/src/views/project/summary.vue
  22. 150 10
      fhKeeper/formulahousekeeper/timesheet/src/views/task/list.vue
  23. 3 3
      fhKeeper/formulahousekeeper/timesheet_h5/src/views/review/index.vue

+ 21 - 0
fhKeeper/formulahousekeeper/management-crm/src/main/java/com/management/platform/controller/BusinessItemProductController.java

@@ -0,0 +1,21 @@
+package com.management.platform.controller;
+
+
+import org.springframework.web.bind.annotation.RequestMapping;
+
+import org.springframework.web.bind.annotation.RestController;
+
+/**
+ * <p>
+ *  前端控制器
+ * </p>
+ *
+ * @author Seyason
+ * @since 2024-03-07
+ */
+@RestController
+@RequestMapping("/business-item-product")
+public class BusinessItemProductController {
+
+}
+

+ 57 - 1
fhKeeper/formulahousekeeper/management-crm/src/main/java/com/management/platform/controller/BusinessOpportunityController.java

@@ -1,13 +1,26 @@
 package com.management.platform.controller;
 
 
+import com.management.platform.entity.BusinessOpportunity;
+import com.management.platform.entity.User;
+import com.management.platform.mapper.UserMapper;
+import com.management.platform.service.BusinessOpportunityService;
+import com.management.platform.service.SysFunctionService;
+import com.management.platform.service.UserService;
+import com.management.platform.util.HttpRespMsg;
+import org.springframework.web.bind.annotation.RequestBody;
 import org.springframework.web.bind.annotation.RequestMapping;
 
 import org.springframework.web.bind.annotation.RestController;
 
+import javax.annotation.Resource;
+import javax.servlet.http.HttpServletRequest;
+import java.util.ArrayList;
+import java.util.List;
+
 /**
  * <p>
- *  前端控制器
+ * 前端控制器
  * </p>
  *
  * @author Seyason
@@ -17,5 +30,48 @@ import org.springframework.web.bind.annotation.RestController;
 @RequestMapping("/business-opportunity")
 public class BusinessOpportunityController {
 
+    @Resource
+    private UserMapper userMapper;
+    @Resource
+    private SysFunctionService sysFunctionService;
+
+    @Resource
+    private BusinessOpportunityService bOservice;
+
+
+    @RequestMapping("insertAndUpdate")
+    public HttpRespMsg insertAndUpdate(@RequestBody BusinessOpportunity bo) {
+        HttpRespMsg msg = new HttpRespMsg();
+        msg.setMsg("操作成功");
+        return msg;
+
+    }
+
+    @RequestMapping("list")
+    public HttpRespMsg list(@RequestBody BusinessOpportunity bo, HttpServletRequest request) {
+        HttpRespMsg msg = new HttpRespMsg();
+        User user = userMapper.selectById(request.getHeader("Token"));
+        bo.setCompanyId(user.getCompanyId());
+        List<BusinessOpportunity> list = new ArrayList<>();
+        boolean isAll = sysFunctionService.hasPriviledge(user.getRoleId(), "查看全部商机");
+        boolean isNotAll = sysFunctionService.hasPriviledge(user.getRoleId(), "查看全部商机");
+        if (!isAll) {
+            list = bOservice.getAll(bo);
+        } else if (!isNotAll) {
+            list = bOservice.getAll(bo);
+        }
+        return msg;
+
+    }
+
+    @RequestMapping("getAllProduct")
+    public HttpRespMsg getAllProduct(@RequestBody BusinessOpportunity bo) {
+        HttpRespMsg msg = new HttpRespMsg();
+        msg.setMsg("操作成功");
+        return msg;
+
+    }
+
+
 }
 

+ 3 - 8
fhKeeper/formulahousekeeper/management-crm/src/main/java/com/management/platform/controller/ClueController.java

@@ -47,12 +47,7 @@ public class ClueController {
     private SysDictMapper sysDictMapper;
 
 
-    //    @RequestMapping("getClueSources")
-//    public Object getClueSources(){
-//        QueryWrapper<SysDict> queryWrapper = new QueryWrapper<>();
-//        queryWrapper.eq("code", "ClueSources");
-//        return sysDictMapper.selectList(queryWrapper);
-//    }
+
     @RequestMapping("getDetail")
     public Object getDetail(@RequestBody Clue clue) {
         HttpRespMsg msg = new HttpRespMsg();
@@ -87,8 +82,8 @@ public class ClueController {
     @RequestMapping("listDeleterClue")
     public Object listDeleterClue(@RequestBody Clue clue, HttpServletRequest request) {
         //TODO token待定
-        // User user = userMapper.selectById(request.getHeader(  "Token"));
-        // clue.setCompanyId(user.getCompanyId());
+         User user = userMapper.selectById(request.getHeader(  "Token"));
+         clue.setCompanyId(user.getCompanyId());
         List<Clue> list = clueService.getDeleterList(clue);
         HashMap<Object, Object> map = new HashMap<>();
         map.put("data", list);

+ 69 - 0
fhKeeper/formulahousekeeper/management-crm/src/main/java/com/management/platform/entity/BusinessItemProduct.java

@@ -0,0 +1,69 @@
+package com.management.platform.entity;
+
+import java.math.BigDecimal;
+import com.baomidou.mybatisplus.extension.activerecord.Model;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableField;
+import java.io.Serializable;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+
+/**
+ * <p>
+ * 
+ * </p>
+ *
+ * @author Seyason
+ * @since 2024-03-07
+ */
+@Data
+@EqualsAndHashCode(callSuper = false)
+@Accessors(chain = true)
+public class BusinessItemProduct extends Model<BusinessItemProduct> {
+
+    private static final long serialVersionUID=1L;
+
+    /**
+     *  
+     */
+    @TableId("id")
+    private Integer id;
+
+    /**
+     * 产品id
+     */
+    @TableField("product_id")
+    private Integer productId;
+
+    /**
+     * 商机id
+     */
+    @TableField("business_id")
+    private Integer businessId;
+
+    /**
+     * 数量
+     */
+    @TableField("quantity")
+    private Integer quantity;
+
+    /**
+     * 折扣率
+     */
+    @TableField("discount")
+    private Integer discount;
+
+    /**
+     * 合计价格
+     */
+    @TableField("total_price")
+    private BigDecimal totalPrice;
+
+
+    @Override
+    protected Serializable pkVal() {
+        return this.id;
+    }
+
+}

+ 10 - 1
fhKeeper/formulahousekeeper/management-crm/src/main/java/com/management/platform/entity/BusinessOpportunity.java

@@ -6,6 +6,8 @@ import com.baomidou.mybatisplus.annotation.TableId;
 import java.time.LocalDateTime;
 import com.baomidou.mybatisplus.annotation.TableField;
 import java.io.Serializable;
+import java.util.Date;
+
 import lombok.Data;
 import lombok.EqualsAndHashCode;
 import lombok.experimental.Accessors;
@@ -30,6 +32,8 @@ public class BusinessOpportunity extends Model<BusinessOpportunity> {
 
     @TableField("company_id")
     private Integer companyId;
+    private Integer productId;
+    private String inchargerId;
 
     /**
      * 商机名称
@@ -65,7 +69,9 @@ public class BusinessOpportunity extends Model<BusinessOpportunity> {
      * 创建时间
      */
     @TableField("create_time")
-    private LocalDateTime createTime;
+    private Date createTime;
+    private Date startTime;
+    private Date endTIme;
 
     /**
      * 创建人
@@ -84,6 +90,8 @@ public class BusinessOpportunity extends Model<BusinessOpportunity> {
      */
     @TableField("is_delete")
     private Integer isDelete;
+    private Integer pageIndex;
+    private Integer pageFrom;
 
     /**
      * 自定义字段存值
@@ -116,6 +124,7 @@ public class BusinessOpportunity extends Model<BusinessOpportunity> {
     private String plate5;
 
 
+
     @Override
     protected Serializable pkVal() {
         return this.id;

+ 16 - 0
fhKeeper/formulahousekeeper/management-crm/src/main/java/com/management/platform/mapper/BusinessItemProductMapper.java

@@ -0,0 +1,16 @@
+package com.management.platform.mapper;
+
+import com.management.platform.entity.BusinessItemProduct;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+
+/**
+ * <p>
+ *  Mapper 接口
+ * </p>
+ *
+ * @author Seyason
+ * @since 2024-03-07
+ */
+public interface BusinessItemProductMapper extends BaseMapper<BusinessItemProduct> {
+
+}

+ 3 - 0
fhKeeper/formulahousekeeper/management-crm/src/main/java/com/management/platform/mapper/BusinessOpportunityMapper.java

@@ -3,6 +3,8 @@ package com.management.platform.mapper;
 import com.management.platform.entity.BusinessOpportunity;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 
+import java.util.List;
+
 /**
  * <p>
  *  Mapper 接口
@@ -13,4 +15,5 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
  */
 public interface BusinessOpportunityMapper extends BaseMapper<BusinessOpportunity> {
 
+    List<BusinessOpportunity> selectAllList(BusinessOpportunity bo);
 }

+ 16 - 0
fhKeeper/formulahousekeeper/management-crm/src/main/java/com/management/platform/service/BusinessItemProductService.java

@@ -0,0 +1,16 @@
+package com.management.platform.service;
+
+import com.management.platform.entity.BusinessItemProduct;
+import com.baomidou.mybatisplus.extension.service.IService;
+
+/**
+ * <p>
+ *  服务类
+ * </p>
+ *
+ * @author Seyason
+ * @since 2024-03-07
+ */
+public interface BusinessItemProductService extends IService<BusinessItemProduct> {
+
+}

+ 3 - 0
fhKeeper/formulahousekeeper/management-crm/src/main/java/com/management/platform/service/BusinessOpportunityService.java

@@ -3,6 +3,8 @@ package com.management.platform.service;
 import com.management.platform.entity.BusinessOpportunity;
 import com.baomidou.mybatisplus.extension.service.IService;
 
+import java.util.List;
+
 /**
  * <p>
  *  服务类
@@ -13,4 +15,5 @@ import com.baomidou.mybatisplus.extension.service.IService;
  */
 public interface BusinessOpportunityService extends IService<BusinessOpportunity> {
 
+    List<BusinessOpportunity> getAll(BusinessOpportunity bo);
 }

+ 20 - 0
fhKeeper/formulahousekeeper/management-crm/src/main/java/com/management/platform/service/impl/BusinessItemProductServiceImpl.java

@@ -0,0 +1,20 @@
+package com.management.platform.service.impl;
+
+import com.management.platform.entity.BusinessItemProduct;
+import com.management.platform.mapper.BusinessItemProductMapper;
+import com.management.platform.service.BusinessItemProductService;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.springframework.stereotype.Service;
+
+/**
+ * <p>
+ *  服务实现类
+ * </p>
+ *
+ * @author Seyason
+ * @since 2024-03-07
+ */
+@Service
+public class BusinessItemProductServiceImpl extends ServiceImpl<BusinessItemProductMapper, BusinessItemProduct> implements BusinessItemProductService {
+
+}

+ 9 - 0
fhKeeper/formulahousekeeper/management-crm/src/main/java/com/management/platform/service/impl/BusinessOpportunityServiceImpl.java

@@ -6,6 +6,9 @@ import com.management.platform.service.BusinessOpportunityService;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import org.springframework.stereotype.Service;
 
+import javax.annotation.Resource;
+import java.util.List;
+
 /**
  * <p>
  *  服务实现类
@@ -17,4 +20,10 @@ import org.springframework.stereotype.Service;
 @Service
 public class BusinessOpportunityServiceImpl extends ServiceImpl<BusinessOpportunityMapper, BusinessOpportunity> implements BusinessOpportunityService {
 
+    @Resource
+    private BusinessOpportunityMapper bOMapper;
+    @Override
+    public List<BusinessOpportunity> getAll(BusinessOpportunity bo) {
+        return bOMapper.selectAllList(bo);
+    }
 }

+ 3 - 1
fhKeeper/formulahousekeeper/management-crm/src/main/java/com/management/platform/service/impl/ClueServiceImpl.java

@@ -161,15 +161,17 @@ public class ClueServiceImpl extends ServiceImpl<ClueMapper, Clue> implements Cl
         ClueLog clueLog = new ClueLog();
         clueLog.setUserId(user.getId());
         clueLog.setClueId(clue.getId());
+        clueLog.setCreatTime(new Date());
         if (inchargerId == null ){
             //认领
             clueLog.setName("认领了线索");
             clue.setInchargerId(user.getId());
+            clueLogMapper.insert(clueLog);
         }else {
             //转移
             clueLog.setName("转移了线索");
             clue.setInchargerId(clue.getInchargerId());
-
+            clueLogMapper.insert(clueLog);
         }
         clueMapper.update(clue, updateWrapper);
 

+ 19 - 0
fhKeeper/formulahousekeeper/management-crm/src/main/resources/mapper/BusinessItemProductMapper.xml

@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.management.platform.mapper.BusinessItemProductMapper">
+
+    <!-- 通用查询映射结果 -->
+    <resultMap id="BaseResultMap" type="com.management.platform.entity.BusinessItemProduct">
+        <id column="id" property="id" />
+        <result column="product_id" property="productId" />
+        <result column="quantity" property="quantity" />
+        <result column="discount" property="discount" />
+        <result column="total_price" property="totalPrice" />
+    </resultMap>
+
+    <!-- 通用查询结果列 -->
+    <sql id="Base_Column_List">
+        id, product_id, quantity, discount, total_price
+    </sql>
+
+</mapper>

+ 20 - 0
fhKeeper/formulahousekeeper/management-crm/src/main/resources/mapper/BusinessOpportunityMapper.xml

@@ -26,5 +26,25 @@
     <sql id="Base_Column_List">
         id, company_id, name, customer_id, amount_of_money, expected_transaction_date, stage, create_time, creator_id, remark, is_delete, plate1, plate2, plate3, plate4, plate5
     </sql>
+    <select id="selectAllList" resultType="com.management.platform.entity.BusinessOpportunity">
+        select * FROM business_opportunity b
+                 left join business_item_product ip ON ip.business_id = b.id
+                 left join product p on p.id = ip.product_id
+        WHERE b.company_id = #{companyId}
+        <if test="name != null and name != ''" >
+         and b.name = #{name}
+        </if>
+        <if test="stage != null " >
+            and b.stage = #{stage}
+        </if>
+        <if test="startTime != null and endTime != null " >
+            and b.expected_transaction_date BETWEEN #{startTime} and #{endTime}
+        </if>
+        <if test="productId != null ">
+            and p.id = #{productId}
+        </if>
+        GROUP BY b.id
+        LIMIT #{pageIndex},#{pageSize}
+    </select>
 
 </mapper>

+ 24 - 0
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/controller/GroupBudgetReviewController.java

@@ -2,6 +2,7 @@ package com.management.platform.controller;
 
 
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.management.platform.entity.*;
 import com.management.platform.mapper.ProjectMapper;
 import com.management.platform.mapper.TaskGroupMapper;
@@ -10,6 +11,8 @@ import com.management.platform.mapper.WxCorpInfoMapper;
 import com.management.platform.service.ExcelExportService;
 import com.management.platform.service.GroupBudgetReviewService;
 import com.management.platform.service.TaskService;
+import com.management.platform.service.WxCorpInfoService;
+import com.management.platform.service.impl.WxCorpInfoServiceImpl;
 import com.management.platform.util.HttpRespMsg;
 import org.springframework.beans.factory.annotation.Value;
 import org.springframework.util.StringUtils;
@@ -56,6 +59,8 @@ public class GroupBudgetReviewController {
     private WxCorpInfoMapper wxCorpInfoMapper;
     @Resource
     private ExcelExportService excelExportService;
+    @Resource
+    private WxCorpInfoService wxCorpInfoService;
 
     @RequestMapping("/add")
     public HttpRespMsg add(Integer groupId,Integer oldManDay,Integer changeManDay,Integer nowManDay,String remark){
@@ -95,6 +100,7 @@ public class GroupBudgetReviewController {
     public HttpRespMsg check(Integer id,Integer checkType,String rejectReason){
         HttpRespMsg httpRespMsg=new HttpRespMsg();
         GroupBudgetReview groupBudgetReview=groupBudgetReviewService.getById(id);
+        User checker = userMapper.selectById(request.getHeader("token"));
         if(rejectReason!=null&&!StringUtils.isEmpty(rejectReason)){
             groupBudgetReview.setRejectReason(rejectReason);
         }
@@ -119,6 +125,24 @@ public class GroupBudgetReviewController {
             project.setManDay(day);
             projectMapper.updateById(project);
         }
+        if(checkType!=0){
+            User user = userMapper.selectById(groupBudgetReview.getCreatorId());
+            StringBuilder sb=new StringBuilder();
+            sb.append("$userName="+checker.getCorpwxUserid()+"$");
+            if(checkType==1){
+                sb.append("通过了");
+                sb.append("您预估工时修改申请");
+            }else{
+                sb.append("驳回了");
+                sb.append("您预估工时修改申请");
+                sb.append(",驳回理由:"+groupBudgetReview.getRejectReason());
+            }
+            String corpwxUserid = user.getCorpwxUserid();
+            if (corpwxUserid != null) {
+                WxCorpInfo info = wxCorpInfoMapper.selectOne(new QueryWrapper<WxCorpInfo>().eq("company_id",checker.getCompanyId()));
+                wxCorpInfoService.sendWXCorpMsg(info, corpwxUserid,sb.toString(), "groupBudget", WxCorpInfoServiceImpl.TEXT_CARD_MSG_REPORT_DENY);
+            }
+        }
         return  httpRespMsg;
     }
 

+ 99 - 1
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/controller/TaskController.java

@@ -15,6 +15,7 @@ import com.management.platform.service.*;
 import com.management.platform.util.HttpRespMsg;
 import com.management.platform.util.MessageUtils;
 import org.assertj.core.util.Lists;
+import org.springframework.beans.factory.annotation.Value;
 import org.springframework.transaction.annotation.Transactional;
 import org.springframework.util.StringUtils;
 import org.springframework.web.bind.annotation.RequestMapping;
@@ -98,6 +99,10 @@ public class TaskController {
     private TaskPersonLiableMapper taskPersonLiableMapper;
     @Resource
     private SapProjectServiceService sapProjectServiceService;
+    @Resource
+    private ExcelExportService excelExportService;
+    @Value(value = "${upload.path}")
+    private String path;
 
     @RequestMapping("/save")
     @Transactional
@@ -1045,7 +1050,11 @@ public class TaskController {
             List<Department> departmentList=departmentService.list(new QueryWrapper<Department>().eq("company_id",companyId));
             branchDepartment= getBranchDepartment(deptId, departmentList);
         }
-        List<Task> list = taskMapper.getTaskWithProjectName(queryWrapper, (pageIndex-1)*pageSize, pageSize,companyId,branchDepartment);
+        Integer pageStart=null;
+        if(pageIndex!=null&&pageSize!=null){
+            pageStart = (pageIndex - 1) * pageSize;
+        }
+        List<Task> list = taskMapper.getTaskWithProjectName(queryWrapper,pageStart, pageSize,companyId,branchDepartment);
         List<Integer> collect = list.stream().map(l -> l.getId()).distinct().collect(Collectors.toList());
         collect.add(-1);
         List<TaskExecutor> taskExecutorList = taskExecutorMapper.selectList(new QueryWrapper<TaskExecutor>().in("task_id", collect));
@@ -1162,5 +1171,94 @@ public class TaskController {
     }
 
 
+    @RequestMapping("exportTaskList")
+    public HttpRespMsg exportTaskList(Integer status, Integer viewId,Integer type,Integer dateType,String startDate,String endDate,Integer deptId,Integer projectId,Integer groupId,String targetUserId){
+        HttpRespMsg msg=new HttpRespMsg();
+        Integer companyId = userMapper.selectById(request.getHeader("token")).getCompanyId();
+        DateTimeFormatter df=DateTimeFormatter.ofPattern("yyyy-MM-dd");
+        List<Department> departmentList = departmentService.list(new LambdaQueryWrapper<Department>().eq(Department::getCompanyId, companyId));
+        WxCorpInfo wxCorpInfo = wxCorpInfoService.getOne(new LambdaQueryWrapper<WxCorpInfo>().eq(WxCorpInfo::getCompanyId, companyId));
+        HttpRespMsg respMsg = listByPage(status, viewId, null, null, type, dateType, startDate, endDate, deptId, projectId, groupId, targetUserId);
+        Map<String, Object> msgData = (Map<String, Object>) respMsg.getData();
+        List<Task> taskList = (List<Task>) msgData.get("records");
+        List<Integer> projectIds = taskList.stream().map(Task::getProjectId).distinct().collect(Collectors.toList());
+        projectIds.add(-1);
+        List<Project> projectList = projectService.list(new LambdaQueryWrapper<Project>().in(Project::getId, projectIds));
+        List<List<String>> dataList=new ArrayList<>();
+        List<String> titleList=new ArrayList<>();
+        titleList.add("序号");
+        titleList.add("项目名称");
+        titleList.add("任务阶段");
+        titleList.add("优先级");
+        titleList.add("任务名称");
+        titleList.add("执行人");
+        titleList.add("开始时间");
+        titleList.add("截止时间");
+        boolean anyMatch = projectList.stream().anyMatch(p -> p.getDeptId() != null && !StringUtils.isEmpty(p.getDeptId()));
+        if(anyMatch){
+            titleList.add("所属部门");
+        }
+        dataList.add(titleList);
+        int no=0;
+        for (Task task : taskList) {
+            no++;
+            List<String> item=new ArrayList<>();
+            item.add(no+"");
+            Optional<Project> first = projectList.stream().filter(p -> p.getId().equals(task.getProjectId())).findFirst();
+            if(first.isPresent()){
+                item.add(first.get().getProjectName());
+            }else {
+                item.add("");
+            }
+            item.add(task.getStagesName());
+            switch (task.getTaskLevel()){
+                case 0:item.add("一般");
+                    break;
+                case 1:item.add("重要");
+                    break;
+                case 2:item.add("紧急");
+                    break;
+            }
+            item.add(task.getName());
+            List<TaskExecutor> executorList = task.getExecutorList();
+            String executorString = executorList.stream().map(t->{
+                if(wxCorpInfo!=null&&wxCorpInfo.getSaasSyncContact()==1){
+                    return "$userName="+t.getExecutorName()+"$";
+                }else {
+                    return t.getExecutorName();
+                }
+            }).collect(Collectors.joining(","));
+            item.add(executorString);
+            item.add(task.getStartDate()==null?"":df.format(task.getStartDate()));
+            item.add(task.getEndDate()==null?"":df.format(task.getEndDate()));
+            if(anyMatch){
+                if(first.isPresent()){
+                    Project project = first.get();
+                    Optional<Department> department = departmentList.stream().filter(d -> d.getDepartmentId().equals(project.getDeptId())).findFirst();
+                    if(department.isPresent()){
+                        if(wxCorpInfo!=null&&wxCorpInfo.getSaasSyncContact()==1){
+                            item.add("$departmentName="+department.get().getCorpwxDeptid()+"$");
+                        }else {
+                            item.add(department.get().getDepartmentName());
+                        }
+                    }else {
+                        item.add("");
+                    }
+                }else {
+                    item.add("");
+                }
+            }
+            dataList.add(item);
+        }
+        String fileName = "待办任务导出_"+System.currentTimeMillis();
+        try {
+            return excelExportService.exportGeneralExcelByTitleAndList(wxCorpInfo,fileName , dataList, path);
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+        return msg;
+    }
+
+
 }
 

+ 28 - 0
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/impl/ProjectServiceImpl.java

@@ -11736,6 +11736,10 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
                 saveOrUpdate(project);
                 //处理项目下任务 ----> 工时管家生成任务分组
                 List<ProjectTask> projectTasks = item.getProjectTasks();
+                //todo:SAP已同步项目下 删除的任务分组需要删除
+                List<Integer> needRemoveTaskGroupIds=new ArrayList<>();
+                //当前项目下本次获取到的分组数据
+                List<TaskGroup> nowAddTaskGroupList=new ArrayList<>();
                 if(projectTasks!=null&&projectTasks.size()>0){
                     //找到任务列表中 作为项目出现的第一级列表
                     Optional<ProjectTask> targetProject = projectTasks.stream().filter(p -> p.getProjectElementID().equals(project.getProjectCode())).findFirst();
@@ -11762,6 +11766,7 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
                                     taskGroup.setId(one.getId());
                                 }
                                 taskGroupService.saveOrUpdate(taskGroup);
+                                nowAddTaskGroupList.add(taskGroup);
                                 Stages stage = new Stages();
                                 stage.setSequence(1);
                                 stage.setProjectId(project.getId());
@@ -11796,6 +11801,7 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
                                     taskGroup.setId(one.getId());
                                 }
                                 taskGroupService.saveOrUpdate(taskGroup);
+                                nowAddTaskGroupList.add(taskGroup);
                                 Map<String,Object> map=new HashMap<>();
                                 map.put("groupId",taskGroup.getId());
                                 map.put("UUID",group.getUUID());
@@ -11889,6 +11895,28 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
                         taskService.saveOrUpdateBatch(tasks);
                     }
                 }
+                //已经同步过的分组数据
+                List<TaskGroup> hadSyncTaskGroups = taskGroupMapper.selectList(new LambdaQueryWrapper<TaskGroup>().eq(TaskGroup::getProjectId, project.getId()));
+                hadSyncTaskGroups.forEach(h->{
+                    if(h.getTaskGroupCode()!=null){
+                        boolean anyMatch = nowAddTaskGroupList.stream().anyMatch(m ->m.getTaskGroupCode()!=null&&m.getTaskGroupCode().equals(h.getTaskGroupCode()));
+                        if(!anyMatch){
+                            needRemoveTaskGroupIds.add(h.getId());
+                        }
+                    }
+                });
+                //删除SAP已删除的任务分组 已存在填报数据的跳过
+                if(needRemoveTaskGroupIds.size()>0){
+                    for (Integer needRemoveTaskGroupId : needRemoveTaskGroupIds) {
+                        Integer count = reportMapper.selectCount(new LambdaQueryWrapper<Report>().eq(Report::getGroupId, needRemoveTaskGroupId));
+                        if(count>0){
+                            continue;
+                        }
+                        taskService.remove(new LambdaQueryWrapper<Task>().eq(Task::getGroupId,needRemoveTaskGroupId));
+                        stagesService.remove(new LambdaQueryWrapper<Stages>().eq(Stages::getGroupId,needRemoveTaskGroupId));
+                        taskGroupService.removeById(needRemoveTaskGroupId);
+                    }
+                }
             }
         }
         //处理项目下服务数据 ------->工时管家相关项目下任务分组下创建任务数据

+ 4 - 3
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/impl/TaskServiceImpl.java

@@ -28,6 +28,7 @@ import org.springframework.web.multipart.MultipartFile;
 import javax.annotation.Resource;
 import javax.servlet.http.HttpServletRequest;
 import java.io.*;
+import java.math.BigDecimal;
 import java.text.SimpleDateFormat;
 import java.time.LocalDate;
 import java.time.format.DateTimeFormatter;
@@ -178,10 +179,10 @@ public class TaskServiceImpl extends ServiceImpl<TaskMapper, Task> implements Ta
                 row.createCell(0).setCellValue(rowNum);
                 row.createCell(1).setCellValue((String) map.get("name"));
                 row.createCell(2).setCellValue((Double) map.get("workHours"));
-                row.createCell(3).setCellValue((Integer) map.get("planHours"));
+                row.createCell(3).setCellValue(new BigDecimal(String.valueOf(map.get("planHours"))).doubleValue());
                 HSSFCell percentCell = row.createCell(4);
-                if ((Integer) map.get("planHours") != null) {
-                    int percent = (int)(double) map.get("workHours")*100/(Integer) map.get("planHours");
+                if (map.get("planHours") != null) {
+                    int percent = (int)(double) map.get("workHours")*100/new BigDecimal(String.valueOf(map.get("planHours"))).intValue();
                     percent = (percent - 100);
                     String sign = "";
                     if (percent > 0) {

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

@@ -310,6 +310,10 @@ public class WxCorpInfoServiceImpl extends ServiceImpl<WxCorpInfoMapper, WxCorpI
                     //费用报销
                     title = "工时管家:任务到期通知";
                 }
+                else if ("groupBudget".equals(pageRouter)) {
+                    //预估工时审核
+                    title = "预估工时审核通知";
+                }
             }
             cardJson.put("title", title);
             cardJson.put("description", msg);

+ 2 - 3
fhKeeper/formulahousekeeper/management-platform/src/main/resources/mapper/TaskMapper.xml

@@ -150,11 +150,10 @@
 
     <!-- 查询任务实际工时和计划工时对比,仅查询有实际工时的数据 -->
     <select id="getTaskTimeCompare" resultType="java.util.Map">
-        SELECT t.id , t.name AS name ,IFNULL(SUM(te.plan_hours),0) AS planHours, IFNULL(SUM(r.`working_time`),0) AS workHours FROM
+        SELECT t.id , t.name AS name ,IFNULL(SUM(te.plan_hours),0) AS planHours, IFNULL((SELECT SUM(r.`working_time`) FROM report r WHERE r.task_id=t.id AND r.state=1),0) AS workHours FROM
         task_executor te
-        LEFT JOIN USER u ON te.executor_id=u.id
+        LEFT JOIN user u ON te.executor_id=u.id
         LEFT JOIN task t ON t.id=te.task_id
-        LEFT JOIN report r ON r.task_id=t.id AND r.state=1
         LEFT JOIN project p ON p.id=t.project_id
         WHERE p.id= #{projectId}
         <if test="deptId!=null and deptId">

+ 150 - 97
fhKeeper/formulahousekeeper/timesheet/src/views/project/summary.vue

@@ -99,6 +99,17 @@
                         </div>
                         <el-divider></el-divider>
                         <div id="taskTimeComparePanel" :style="`height: ${echartsHeight}px;width:1100px`"></div>
+                        <div class="dataPaging">
+                            <el-pagination
+                                @size-change="handleSizeChange"
+                                @current-change="handleCurrentChange"
+                                :current-page="dataPagingPage"
+                                :page-sizes="[5, 10, 15, 20, 30, 40]"
+                                :page-size="dataPagingSize"
+                                layout="total, sizes, prev, pager, next"
+                                :total="dataPagingTotal">
+                            </el-pagination>
+                        </div>
                     </div>
                 </el-col>
             </el-row>
@@ -158,6 +169,11 @@
     align-items: center;
     min-width: 400px;
 }
+.dataPaging {
+    width: 100%;
+    display: flex;
+    justify-content: flex-end;
+}
 </style>
 <script>
 import vueCascader from "@/components/cascader.vue"
@@ -192,10 +208,137 @@ export default {
             departmentOption: [], // 部门
             departmentOptionValue: '',
             echartsHeight: 500,
-            departmentOptionLoading: false
+            departmentOptionLoading: false,
+            dataPagingPage: 1,
+            dataPagingSize: 10,
+            dataPagingTotal: 0,
+            dataPagingData: [],
         };
     },
     methods: {
+        handleSizeChange(val) {
+            this.dataPagingPage = 1
+            this.dataPagingSize = val
+            this.setTaskTimeCompare()
+        },
+        handleCurrentChange(val) {
+            this.dataPagingPage = val
+            this.setTaskTimeCompare()
+        },
+        setTaskTimeCompare() {
+            this.departmentOptionLoading = true
+            let newList = this.dataPagingData
+            let list = newList.slice((this.dataPagingPage - 1) * this.dataPagingSize, this.dataPagingPage * this.dataPagingSize)
+            this.taskTimeComparePublic(list)
+        },
+        taskTimeComparePublic(list) {
+            var _this = this;
+            var xList1 = [], xList2 = []
+            if(list.length > 10) {
+                this.echartsHeight = list.length * 60
+            } else {
+                this.echartsHeight = 500
+            }
+
+            var xList1 = [], xList2 = []
+            if(list.length > 10) {
+                this.echartsHeight = list.length * 60
+            } else {
+                this.echartsHeight = 500
+            }
+            
+            setTimeout(() => {
+                var taskNames = [];
+                for (var i in list) {
+                    xList1.push({
+                        "value": list[i].workHours,
+                        "id": list[i].id,
+                        "fullName": list[i].name,
+                    });
+                    xList2.push({
+                        "value": list[i].planHours,
+                        "id": list[i].id,
+                        "fullName": list[i].name,
+                    });
+                    console.log(list[i], list[i].name)
+                    taskNames.push(list[i].name.length > 12 ? list[i].name.substring(0, 12) + '..' : list[i].name);
+                }
+                var myChart = echarts.init(document.getElementById("taskTimeComparePanel"));
+                _this.compareChart = myChart;
+                var option = {
+                    // 全局调色盘。
+                    color: ["#409EFF", "#71C671"],
+                    title: {
+                        show: list.length == 0,
+                        textStyle: {
+                            color: "#666666",
+                            fontSize: 18,
+                            fontWeight: 'normal',
+                        },
+                        text: list.length == 0 ? this.$t('nodata') : this.$t('gong-shi-dui-bi'),
+                        left: "center",
+                        top: "center"
+                    },
+                    toolbox: {
+                        right: 25,
+                        show: true,
+                        feature: {
+                            saveAsImage: {
+                                show: true
+                            },
+                            restore: {
+                                show: true
+                            },
+                            magicType: {
+                                type: ['line', 'bar']
+                            },
+                        }
+                    },
+                    legend: {
+                        data: [this.$t('shi-ji-gong-shi'), this.$t('plantime')]
+                    },
+                    grid: {
+                        left: '3%',
+                        right: '4%',
+                        bottom: '3%',
+                        containLabel: true
+                    },
+                    tooltip: {
+                        trigger: 'axis',
+                        axisPointer: {
+                            type: 'shadow'
+                        },
+                    },
+                    xAxis: {
+                        type: 'value',
+                        boundaryGap: [0, 1],
+                        axisLabel: {
+                            formatter: '{value} ' + this.$t('time.hour')
+                        }
+                    },
+                    yAxis: [{
+                        type: 'category',
+                        data: taskNames
+                    }],
+                    series: [{
+                        name: this.$t('shi-ji-gong-shi'),
+                        type: 'bar',
+                        data: xList1
+                    },
+                    {
+                        name: this.$t('plantime'),
+                        type: 'bar',
+                        data: xList2
+                    }]
+                };
+                
+                myChart.setOption(option, { notMerge: true });
+                this.$nextTick(() => {
+                    myChart.resize(); // 在DOM更新后,调用resize方法更新图表大小
+                });
+                this.departmentOptionLoading = false
+            }, 1000);
+        },
         vueCasader(obj) {
             if(obj.distinction == '1') {
                 if(obj.id != '') {
@@ -278,103 +421,13 @@ export default {
             this.http.post('/task/getTaskTimeCompare', { ...obj },
                 res => {
                     if (res.code == "ok") {
-                        var xList1 = [], xList2 = [], list = res.data.reverse();
-                        if(list.length > 10) {
-                            this.echartsHeight = list.length * 60
-                        } else {
-                            this.echartsHeight = 500
-                        }
-                        setTimeout(() => {
-                            var taskNames = [];
-                            for (var i in list) {
-                                xList1.push({
-                                    "value": list[i].workHours,
-                                    "id": list[i].id,
-                                    "fullName": list[i].name,
-                                });
-                                xList2.push({
-                                    "value": list[i].planHours,
-                                    "id": list[i].id,
-                                    "fullName": list[i].name,
-                                });
-                                taskNames.push(list[i].name.length > 12 ? list[i].name.substring(0, 12) + '..' : list[i].name);
-                            }
-                            var myChart = echarts.init(document.getElementById("taskTimeComparePanel"));
-                            _this.compareChart = myChart;
-                            var option = {
-                                // 全局调色盘。
-                                color: ["#409EFF", "#71C671"],
-                                title: {
-                                    show: list.length == 0,
-                                    textStyle: {
-                                        color: "#666666",
-                                        fontSize: 18,
-                                        fontWeight: 'normal',
-                                    },
-                                    text: list.length == 0 ? this.$t('nodata') : this.$t('gong-shi-dui-bi'),
-                                    left: "center",
-                                    top: "center"
-                                },
-                                toolbox: {
-                                    right: 25,
-                                    show: true,
-                                    feature: {
-                                        saveAsImage: {
-                                            show: true
-                                        },
-                                        restore: {
-                                            show: true
-                                        },
-                                        magicType: {
-                                            type: ['line', 'bar']
-                                        },
-                                    }
-                                },
-                                legend: {
-                                    data: [this.$t('shi-ji-gong-shi'), this.$t('plantime')]
-                                },
-                                grid: {
-                                    left: '3%',
-                                    right: '4%',
-                                    bottom: '3%',
-                                    containLabel: true
-                                },
-                                tooltip: {
-                                    trigger: 'axis',
-                                    axisPointer: {
-                                        type: 'shadow'
-                                    },
-                                },
-                                xAxis: {
-                                    type: 'value',
-                                    boundaryGap: [0, 1],
-                                    axisLabel: {
-                                        formatter: '{value} ' + this.$t('time.hour')
-                                    }
-                                },
-                                yAxis: [{
-                                    type: 'category',
-                                    data: taskNames
-                                }],
-                                series: [{
-                                    name: this.$t('shi-ji-gong-shi'),
-                                    type: 'bar',
-                                    data: xList1
-                                },
-                                {
-                                    name: this.$t('plantime'),
-                                    type: 'bar',
-                                    data: xList2
-                                }]
-                            };
-                            
-                            myChart.setOption(option, { notMerge: true });
-                            this.$nextTick(() => {
-                                myChart.resize(); // 在DOM更新后,调用resize方法更新图表大小
-                            });
-                            this.departmentOptionLoading = false
-                        }, 1000);
+                        let newList = res.data.reverse()
+                        this.dataPagingData = newList
+                        this.dataPagingTotal = newList.length
+
+                        let list = newList.slice((this.dataPagingPage - 1) * this.dataPagingSize, this.dataPagingPage * this.dataPagingSize)
                         
+                        this.taskTimeComparePublic(list)
                     } else {
                         this.departmentOptionLoading = false
                         this.$message({

+ 150 - 10
fhKeeper/formulahousekeeper/timesheet/src/views/task/list.vue

@@ -33,12 +33,22 @@
 
                 <el-form-item :label="'项目'">
                     <div style="margin-left: 8px">
-                        <el-select v-model="screenProjectId" style="width:150px;" size="small" slot="prepend" :placeholder="$t('defaultText.pleaseChoose')" clearable @change="screenProjectChange">
+                        <el-select v-model="screenProjectId" filterable style="width:150px;" size="small" slot="prepend" :placeholder="$t('defaultText.pleaseChoose')" clearable @change="screenProjectChange">
                             <el-option v-for="item in allProjectList" :key="item.id"  :label="item.projectName" :value="item.id"></el-option>
                         </el-select>
                     </div>
                 </el-form-item>
 
+                <el-form-item :label="'部门'">
+                    <div style="margin-left: 8px">
+                        <el-cascader v-if="user.userNameNeedTranslate != 1" v-model="screenDeptId" :placeholder="$t('defaultText.pleaseChoose')" style="width: 125px"
+                        :options="departmentList" :props="{ checkStrictly: false,expandTrigger: 'hover' }" :show-all-levels="false" clearable
+                        @change="getList()" size="mini"></el-cascader>
+
+                        <vueCascader :size="'mini'" :widthStr="'125'" :clearable="true" :subject="departmentList" :radios="false" :distinction="'1'" @vueCasader="vueCasader" v-if="user.userNameNeedTranslate == 1"></vueCascader>
+                    </div>
+                </el-form-item>
+
                 <el-form-item :label="'任务分组'">
                     <div style="margin-left: 8px">
                         <el-select v-model="screenTaskGroupingId" style="width:150px;" size="small" :disabled="!screenProjectId" slot="prepend" :placeholder="$t('defaultText.pleaseChoose')" clearable @change="hiddens()">
@@ -82,6 +92,7 @@
                 </el-form-item>
                 <el-form-item style="float: right;" v-if="user.companyId != '3092'">
                      <el-link type="primary" icon="el-icon-circle-plus-outline" :underline="false" @click="addTask()">新建任务</el-link>
+                     <el-link type="primary" :underline="false" @click="exportTaskList()" style="margin-left: 20px;" v-loading="exportTaskLoading">导出</el-link>
                 </el-form-item>
             </el-form>
         </el-col>
@@ -103,7 +114,7 @@
                     </el-table-column>
                     <el-table-column prop="stagesName" :label="$t('taskstage')" sortable width="180" @mouseover="mouseOver">
                     </el-table-column>
-                    <el-table-column prop="taskLevel" label="优先级" sortable width="180">
+                    <el-table-column prop="taskLevel" label="优先级" sortable width="100">
                         <template slot-scope="scope">
                             <div>
                                 <span v-if="scope.row.taskLevel == 0">一般</span>
@@ -140,11 +151,6 @@
                             </div>
                         </template>
                     </el-table-column>
-                    <el-table-column prop="projectName" :label="$t('headerTop.projectName')" sortable width="260" show-overflow-tooltip>
-                        <template slot-scope="scope">
-                            <el-link type="primary" :href="'#/projectInside/'+scope.row.projectId">{{scope.row.projectName}}</el-link>
-                        </template>
-                    </el-table-column>
                     <el-table-column prop="executorName" :label="$t('zhi-hang-ren')" sortable width="130">
                         <template slot-scope="scope">
                             <!-- <el-link type="primary" @click="showUser(scope.row.executorId)">{{scope.row.executorName}}</el-link> -->
@@ -159,6 +165,11 @@
                     </el-table-column>
                     
                     <el-table-column prop="startDate" :label="$t('starttimes')" sortable width="180"></el-table-column>
+                    <el-table-column prop="projectName" :label="$t('headerTop.projectName')" sortable width="260" show-overflow-tooltip>
+                        <template slot-scope="scope">
+                            <el-link type="primary" :href="'#/projectInside/'+scope.row.projectId">{{scope.row.projectName}}</el-link>
+                        </template>
+                    </el-table-column>
                     <el-table-column prop="endDate" :label="$t('deadline')" width="310" fixed="right" sortable>
                         <template slot-scope="scope">
                             <div style="display: flex;justify-content: space-between;padding-right: 40px">
@@ -468,6 +479,9 @@ import { error } from 'dingtalk-jsapi';
 
     // 引入自定义组件
     import selectCat from "@/components/select.vue"
+    // 引入自定义级联组件
+    import vueCascader from "@/components/cascader.vue"
+    import cascaderOption from "@/components/cascaderOption.vue"
 
     import taskComponent from "@/components/taskComponent.vue"
 
@@ -491,7 +505,9 @@ import { error } from 'dingtalk-jsapi';
             // Earning,
             quillEditor, // 富文本
             selectCat,
-            taskComponent
+            taskComponent,
+            vueCascader,
+            cascaderOption
         },
         data() {
             return {
@@ -639,7 +655,9 @@ import { error } from 'dingtalk-jsapi';
                 screenProjectId: '',
                 screenTaskGroupingId: '',
                 screenPersonnelId: '',
-                allProjectList: []
+                allProjectList: [],
+                exportTaskLoading: false,
+                screenDeptId: [],
             };
         },
         methods: {
@@ -782,6 +800,57 @@ import { error } from 'dingtalk-jsapi';
                 }
                 this.addSubProject = true;
             },
+            exportTaskList(){
+                let parameter = {
+                    status: this.searchField,
+                    viewId: this.idx,
+                    pageIndex: this.page,
+                    pageSize: this.size,
+                    // type: this.typeField
+                    projectId: this.screenProjectId,
+                    groupId: this.screenTaskGroupingId,
+                    targetUserId: this.screenPersonnelId
+                }
+                if(this.typeField != 'null' && this.typeField != null && this.typeField != '') {
+                    parameter.type = this.typeField
+                }
+                if(this.dateSelect != null && this.dateSelect.length != 0){
+                    parameter.dateType = this.dateType
+                    parameter.startDate = this.dateSelect[0]
+                    parameter.endDate = this.dateSelect[1]
+                }
+                if(this.deptId.length > 0) {
+                    parameter.deptId = this.deptId[this.deptId.length - 1]
+                } else {
+                    parameter.deptId = ''
+                }
+                this.http.post('/task/exportTaskList', parameter,
+                    res => {
+                    if (res.code == "ok") {
+                        var filePath = res.data;
+                        var fName = '待办任务导出.xlsx'
+                        const a = document.createElement('a'); // 创建a标签
+                        a.setAttribute('download', fName);// download属性
+                        a.setAttribute('href', filePath);// href链接
+                        a.click(); //自执行点击事件
+                        a.remove();
+                        this.exportLoading = false
+                        this.byQuarterDialog  = false
+                        
+                    } else {
+                        this.$message({
+                        message: res.msg,
+                        type: "error"
+                        });
+                    }
+                    },
+                    error => {
+                        this.$message({
+                            message: error,
+                            type: "error"
+                        });
+                    });
+                },
             //显示子项目
             subProject(item) {
                 this.subProjectVisible = true;
@@ -902,7 +971,7 @@ import { error } from 'dingtalk-jsapi';
 
             //获取项目列表
             getList() {
-                console.log('执行函数')
+                console.log('执行函数', this.screenDeptId)
                 this.listLoading = true;
                 let parameter = {
                     status: this.searchField,
@@ -914,6 +983,7 @@ import { error } from 'dingtalk-jsapi';
                     groupId: this.screenTaskGroupingId,
                     targetUserId: this.screenPersonnelId
                 }
+                console.log(parameter)
                 if(this.typeField != 'null' && this.typeField != null && this.typeField != '') {
                     parameter.type = this.typeField
                 }
@@ -930,6 +1000,9 @@ import { error } from 'dingtalk-jsapi';
                 } else {
                     parameter.deptId = ''
                 }
+                if(this.screenDeptId.length > 0) {
+                    parameter.deptId = this.screenDeptId[this.screenDeptId.length - 1]
+                }
                 this.http.post('/task/listByPage', parameter,
                 res => {
                     this.listLoading = false;
@@ -962,6 +1035,59 @@ import { error } from 'dingtalk-jsapi';
                 })
             },
 
+            // 导出任务
+            exportTask() {
+                // console.log('执行代码')
+                this.exportTaskLoading = true
+                let url = '' // 导出连接
+                let parameter = {
+                    status: this.searchField,
+                    viewId: this.idx,
+                    pageIndex: this.page,
+                    pageSize: this.size,
+                    // type: this.typeField
+                    projectId: this.screenProjectId,
+                    groupId: this.screenTaskGroupingId,
+                    targetUserId: this.screenPersonnelId
+                }
+                if(this.typeField != 'null' && this.typeField != null && this.typeField != '') {
+                    parameter.type = this.typeField
+                }
+                if(this.dateSelect != null && this.dateSelect.length != 0){
+                    parameter.dateType = this.dateType
+                    parameter.startDate = this.dateSelect[0]
+                    parameter.endDate = this.dateSelect[1]
+                }
+                if(this.deptId.length > 0) {
+                    parameter.deptId = this.deptId[this.deptId.length - 1]
+                } else {
+                    parameter.deptId = ''
+                }
+                this.http.post(url, parameter,
+                res => {
+                    if (res.code == "ok") {
+                        this.exportTaskLoading = false;
+                        var aTag = document.createElement('a');
+                        aTag.download = '待办任务';
+                        aTag.href = res.data;
+                        aTag.click();
+                    } else {
+                        this.exportTaskLoading = false;
+                        this.$message({
+                            message: res.msg,
+                            type: "error"
+                        });
+                    }
+                },
+                error => {
+                    this.$message({
+                        message: error,
+                        type: "error"
+                    });
+                    this.exportTaskLoading = false;
+                });
+            },  
+
             //显示新增界面
             handleAdd(i, item) {
                 if(i == -1) {
@@ -1875,6 +2001,19 @@ import { error } from 'dingtalk-jsapi';
                         type: "error"
                     });
                 });
+            },
+
+            vueCasader() {
+                if(obj.distinction == '1') {
+                    if(obj.id != '') {
+                        let arr = []
+                        arr.push(obj.id)
+                        this.screenDeptId = arr
+                    } else {
+                        this.screenDeptId = []
+                    }
+                    this.getList()
+                }
             }
         },
         created() {
@@ -1892,6 +2031,7 @@ import { error } from 'dingtalk-jsapi';
             if(this.user.timeType.projectWithDept) {
                 this.getDepartmentList()
             }
+            this.getDepartmentList()
             this.getAllProjectlist()
             // if(this.user.companyId == '428') {
             //     this.getSthForSb()

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

@@ -73,7 +73,7 @@
             <div class="formBatch">
                 <van-checkbox v-model="isAllChecked" :disabled="report.length == 0" @click="allChecked" shape="square" style="padding-left:3vw"></van-checkbox>
                 <div style="padding:1vh 2vw">
-                <van-button @click="batchAgree(true)" :disabled="!isCanAgree || report.length == 0" type="info" size="small">批量通过</van-button>
+                <van-button @click="batchAgree(true)" :disabled="!isCanAgree || report.length == 0" type="info" size="small" style="margin-right:6vw">批量通过</van-button>
                 <van-button @click="batchAgree(false)" :disabled="!isCanAgree || report.length == 0" type="danger" size="small" style="margin-left:2vw">批量驳回</van-button>
                 </div>
             </div>
@@ -171,7 +171,7 @@
                         </div>
                     </div>
                     <div class="form_btn" slot="footer">
-                        <van-button size="small" type="info" @click="approve(item.id, item)">通过</van-button>
+                        <van-button size="small" type="info" @click="approve(item.id, item)" style="margin-right: 4vw;">通过</van-button>
                         <van-button size="small" type="danger" @click="showDenyDialog(item.id,0,item.dateStr, item)">驳回</van-button>
                     </div>
                     <van-popup v-model="imgShow" position="bottom" closeable >
@@ -605,7 +605,7 @@
     }
     .login_form {
         margin-top: 46px;
-        padding-bottom: 1.2rem;
+        margin-bottom: 65px;
     }
 
     .one_report {