Quellcode durchsuchen

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

seyason vor 2 Jahren
Ursprung
Commit
411e5a5e00

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

@@ -73,7 +73,7 @@ public interface ProjectMapper extends BaseMapper<Project> {
 
 //    List<Map<String, Object>> getOvertimeList(String userId, Integer companyId, String startDate, String endDate, Integer projectId);
 
-    List<Map<String, Object>> getDegreeCost(@Param("startDate") String startDate, @Param("endDate") String endDate, @Param("projectId") Integer projectId, @Param("companyId") Integer companyId);
+    List<Map<String, Object>> getDegreeCost(@Param("startDate") String startDate, @Param("endDate") String endDate, @Param("projectId") Integer projectId, @Param("companyId") Integer companyId,List<Integer> departmentIds);
 
     //获取导出的项目数据
     List<HashMap<String, Object>> getExportData(Integer companyId, String userId);

+ 4 - 7
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/impl/DepartmentServiceImpl.java

@@ -334,6 +334,8 @@ public class DepartmentServiceImpl extends ServiceImpl<DepartmentMapper, Departm
             //判断查看权限
             if(functionAllList.size()==0){
                 deptIds=new ArrayList<>();
+                //是不是要加
+                deptIds.add(-1);
                 if(functionDpartList.size()>0){
                     if(functionTimeList.size()>0||functionCostList.size()>0){
                         List<Integer> collect = departmentList.stream().map(dp -> dp.getDepartmentId()).distinct().collect(Collectors.toList());
@@ -341,9 +343,6 @@ public class DepartmentServiceImpl extends ServiceImpl<DepartmentMapper, Departm
                         collect.addAll(otherCollect);
                         deptIds.addAll(collect);
                     }
-                }else {
-                    //是不是要加
-                    deptIds.add(-1);
                 }
             }
             QueryWrapper<Department> queryWrapper = new QueryWrapper<Department>()
@@ -426,6 +425,7 @@ public class DepartmentServiceImpl extends ServiceImpl<DepartmentMapper, Departm
             //判断查看权限
             if(functionAllList.size()==0){
                 deptIds=new ArrayList<>();
+                deptIds.add(-1);
                 if(functionDpartList.size()>0){
                     if(functionTimeList.size()>0||functionCostList.size()>0){
                         List<Integer> collect = departmentList.stream().distinct().map(dm -> dm.getDepartmentId()).collect(Collectors.toList());
@@ -436,8 +436,6 @@ public class DepartmentServiceImpl extends ServiceImpl<DepartmentMapper, Departm
                             deptIds.addAll(branchDepartment);
                         }
                     }
-                }else {
-                    deptIds.add(-1);
                 }
             }
             //首先校验有无权限
@@ -542,6 +540,7 @@ public class DepartmentServiceImpl extends ServiceImpl<DepartmentMapper, Departm
             //判断查看权限
             if(functionAllList.size()==0){
                 deptIds=new ArrayList<>();
+                deptIds.add(-1);
                 if(functionDpartList.size()>0){
                     if(functionTimeList.size()>0||functionCostList.size()>0){
                         List<Integer> collect = departmentList.stream().map(dp -> dp.getDepartmentId()).distinct().collect(Collectors.toList());
@@ -549,8 +548,6 @@ public class DepartmentServiceImpl extends ServiceImpl<DepartmentMapper, Departm
                         collect.addAll(otherCollect);
                         deptIds.addAll(collect);
                     }
-                }else {
-                    deptIds.add(-1);
                 }
             }
             List<String> allUserIds = null;

+ 44 - 40
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/impl/ProjectServiceImpl.java

@@ -770,8 +770,9 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
             List<SysRichFunction> functionCostList = sysFunctionMapper.getRoleFunctions(targetUser.getRoleId(), "查看成本统计");
             //判断查看权限
             if(functionAllList.size()==0){
+                deptIds=new ArrayList<>();
+                deptIds.add(-1);
                 if(functionDpartList.size()>0){
-                    deptIds=new ArrayList<>();
                     if(functionTimeList.size()>0||functionCostList.size()>0){
                         List<Integer> collect = departmentList.stream().distinct().map(dm -> dm.getDepartmentId()).collect(Collectors.toList());
                         List<Integer> otherCollect = departmentOtherManagerList.stream().distinct().map(dom -> dom.getDepartmentId()).collect(Collectors.toList());
@@ -781,9 +782,6 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
                             deptIds.addAll(branchDepartment);
                         }
                     }
-                }else {
-                    deptIds=new ArrayList<>();
-                    deptIds.add(-1);
                 }
             }
             TimeType timeType = timeTypeMapper.selectById(companyId);
@@ -917,6 +915,7 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
             //判断查看权限
             if(functionAllList.size()==0){
                 deptIds=new ArrayList<>();
+                deptIds.add(-1);
                 if(functionDpartList.size()>0){
                     if(functionTimeList.size()>0||functionCostList.size()>0){
                         List<Integer> collect = departmentList.stream().map(dp -> dp.getDepartmentId()).distinct().collect(Collectors.toList());
@@ -924,8 +923,6 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
                         collect.addAll(otherCollect);
                         deptIds.addAll(otherCollect);
                     }
-                }else {
-                    deptIds.add(-1);
                 }
             }
             List<Map<String, Object>> list = projectMapper.getTimeCost(companyId, startDate, endDate, projectId, userId,deptIds);
@@ -2285,6 +2282,7 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
         if(functionAllList.size()==0){
             if(functionDeptList.size()>0){
                 deptIds=new ArrayList<>();
+                deptIds.add(-1);
                 List<Integer> collect = departmentList.stream().distinct().map(dm -> dm.getDepartmentId()).collect(Collectors.toList());
                 List<Integer> otherCollect = departmentOtherManagerList.stream().distinct().map(dom -> dom.getDepartmentId()).collect(Collectors.toList());
                 collect.addAll(otherCollect);
@@ -2292,9 +2290,6 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
                     List<Integer> branchDepartment = getBranchDepartment(integer, allDepartmentList);
                     deptIds.addAll(branchDepartment);
                 }
-            }else {
-                deptIds=new ArrayList<>();
-                deptIds.add(-1);
             }
         }
         List<Map<String, Object>> list = projectMapper.getOvertimeDetail(userId, user.getCompanyId(), startDate, endDate, projectId,departmentId,deptIds);
@@ -2328,6 +2323,7 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
             if(functionAllList.size()==0){
                 if(functionDeptList.size()>0){
                     deptIds=new ArrayList<>();
+                    deptIds.add(-1);
                     List<Integer> collect = departmentList.stream().distinct().map(dm -> dm.getDepartmentId()).collect(Collectors.toList());
                     List<Integer> otherCollect = departmentOtherManagerList.stream().distinct().map(dom -> dom.getDepartmentId()).collect(Collectors.toList());
                     collect.addAll(otherCollect);
@@ -2335,9 +2331,6 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
                         List<Integer> branchDepartment = getBranchDepartment(integer, allDepartmentList);
                         deptIds.addAll(branchDepartment);
                     }
-                }else {
-                    deptIds=new ArrayList<>();
-                    deptIds.add(-1);
                 }
             }
             List<Map<String, Object>> list = projectMapper.getOvertimeDetail(userId, user.getCompanyId(), startDate, endDate, projectId,null,deptIds);
@@ -3016,7 +3009,32 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
         HttpRespMsg msg = new HttpRespMsg();
         String token = request.getHeader("TOKEN");
         User user = userMapper.selectById(token);
-        msg.data = projectMapper.getDegreeCost(startDate, endDate, projectId, user.getCompanyId());
+        //当前用户管理部门
+        List<Integer> deptIds=null;
+        List<Department> allDepartmentList=departmentMapper.selectList(new QueryWrapper<Department>().eq("company_id",user.getCompanyId()));
+        List<Department> departmentList = departmentMapper.selectList(new QueryWrapper<Department>().eq("manager_id", user.getId()).eq("company_id", user.getCompanyId()));
+        List<DepartmentOtherManager> departmentOtherManagerList = departmentOtherManagerMapper.selectList(new QueryWrapper<DepartmentOtherManager>().eq("other_manager_id", user.getId()));
+        List<SysRichFunction> functionAllList = sysFunctionMapper.getRoleFunctions(user.getRoleId(), "查看全公司");
+        List<SysRichFunction> functionDpartList = sysFunctionMapper.getRoleFunctions(user.getRoleId(), "查看负责部门");
+        List<SysRichFunction> functionTimeList = sysFunctionMapper.getRoleFunctions(user.getRoleId(), "查看工时统计");
+        List<SysRichFunction> functionCostList = sysFunctionMapper.getRoleFunctions(user.getRoleId(), "查看成本统计");
+        //判断查看权限
+        if(functionAllList.size()==0){
+            deptIds=new ArrayList<>();
+            deptIds.add(-1);
+            if(functionDpartList.size()>0){
+                if(functionTimeList.size()>0||functionCostList.size()>0){
+                    List<Integer> collect = departmentList.stream().distinct().map(dm -> dm.getDepartmentId()).collect(Collectors.toList());
+                    List<Integer> otherCollect = departmentOtherManagerList.stream().distinct().map(dom -> dom.getDepartmentId()).collect(Collectors.toList());
+                    collect.addAll(otherCollect);
+                    for (Integer integer : collect) {
+                        List<Integer> branchDepartment = getBranchDepartment(integer, allDepartmentList);
+                        deptIds.addAll(branchDepartment);
+                    }
+                }
+            }
+        }
+        msg.data = projectMapper.getDegreeCost(startDate, endDate, projectId, user.getCompanyId(),deptIds);
         return msg;
     }
 
@@ -3329,8 +3347,9 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
         List<DepartmentOtherManager> departmentOtherManagerList = departmentOtherManagerMapper.selectList(new QueryWrapper<DepartmentOtherManager>().eq("other_manager_id", user.getId()));
         //判断查看权限
         if(functionAllList.size()==0){
+            deptIds=new ArrayList<>();
+            deptIds.add(-1);
             if(functionDeptList.size()>0){
-                deptIds=new ArrayList<>();
                 List<Integer> collect = departmentList.stream().distinct().map(dm -> dm.getDepartmentId()).collect(Collectors.toList());
                 List<Integer> otherCollect = departmentOtherManagerList.stream().distinct().map(dom -> dom.getDepartmentId()).collect(Collectors.toList());
                 collect.addAll(otherCollect);
@@ -3339,9 +3358,6 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
                     deptIds.addAll(branchDepartment);
                 }
 
-            }else {
-                deptIds=new ArrayList<>();
-                deptIds.add(-1);
             }
         }
         List<Map<String, Object>> list = projectMapper.getOvertimeDetail(userId, user.getCompanyId(), startDate, endDate, projectId,null,deptIds);
@@ -3730,8 +3746,9 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
             List<SysRichFunction> functionCostList = sysFunctionMapper.getRoleFunctions(targetUser.getRoleId(), "查看成本统计");
             //判断查看权限
             if(functionAllList.size()==0){
+                deptIds=new ArrayList<>();
+                deptIds.add(-1);
                 if(functionDpartList.size()>0){
-                    deptIds=new ArrayList<>();
                     if(functionTimeList.size()>0||functionCostList.size()>0){
                         List<Integer> collect = departmentList.stream().distinct().map(dm -> dm.getDepartmentId()).collect(Collectors.toList());
                         List<Integer> otherCollect = departmentOtherManagerList.stream().distinct().map(dom -> dom.getDepartmentId()).collect(Collectors.toList());
@@ -3741,9 +3758,6 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
                             deptIds.addAll(branchDepartment);
                         }
                     }
-                }else {
-                    deptIds=new ArrayList<>();
-                    deptIds.add(-1);
                 }
             }
             TimeType timeType = timeTypeMapper.selectById(companyId);
@@ -3877,6 +3891,7 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
             //判断查看权限
             if(functionAllList.size()==0){
                 deptIds=new ArrayList<>();
+                deptIds.add(-1);
                 if(functionDpartList.size()>0){
                     if(functionTimeList.size()>0||functionCostList.size()>0){
                         List<Integer> collect  = departmentList.stream().map(dp -> dp.getDepartmentId()).distinct().collect(Collectors.toList());
@@ -3884,8 +3899,6 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
                         collect.addAll(otherCollect);
                         deptIds.addAll(collect);
                     }
-                }else {
-                    deptIds.add(-1);
                 }
             }
             List<Map<String, Object>> list = projectMapper.getTimeCostByCategory(companyId, startDate, endDate, projectCategoryId, userId,deptIds);
@@ -4023,8 +4036,9 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
         List<DepartmentOtherManager> departmentOtherManagerList = departmentOtherManagerMapper.selectList(new QueryWrapper<DepartmentOtherManager>().eq("other_manager_id", user.getId()));
         //判断查看权限
         if(functionAllList.size()==0){
+            deptIds=new ArrayList<>();
+            deptIds.add(-1);
             if(functionDeptList.size()>0){
-                deptIds=new ArrayList<>();
                 List<Integer> collect = departmentList.stream().distinct().map(dm -> dm.getDepartmentId()).collect(Collectors.toList());
                 List<Integer> otherCollect = departmentOtherManagerList.stream().distinct().map(dom -> dom.getDepartmentId()).collect(Collectors.toList());
                 collect.addAll(otherCollect);
@@ -4032,9 +4046,6 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
                     List<Integer> branchDepartment = getBranchDepartment(integer, allDepartmentList);
                     deptIds.addAll(branchDepartment);
                 }
-            }else {
-                deptIds=new ArrayList<>();
-                deptIds.add(-1);
             }
         }
         List<Map<String, Object>> list = projectMapper.getUserWorkingTimeList(userId, user.getCompanyId(), startDate, endDate, projectId,start,size,departmentId,deptIds);
@@ -4067,8 +4078,9 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
         List<DepartmentOtherManager> departmentOtherManagerList = departmentOtherManagerMapper.selectList(new QueryWrapper<DepartmentOtherManager>().eq("other_manager_id", user.getId()));
         //判断查看权限
         if(functionAllList.size()==0){
+            deptIds=new ArrayList<>();
+            deptIds.add(-1);
             if(functionDeptList.size()>0){
-                deptIds=new ArrayList<>();
                 List<Integer> collect = departmentList.stream().distinct().map(dm -> dm.getDepartmentId()).collect(Collectors.toList());
                 List<Integer> otherCollect = departmentOtherManagerList.stream().distinct().map(dom -> dom.getDepartmentId()).collect(Collectors.toList());
                 collect.addAll(otherCollect);
@@ -4076,9 +4088,6 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
                     List<Integer> branchDepartment = getBranchDepartment(integer, allDepartmentList);
                     deptIds.addAll(branchDepartment);
                 }
-            }else {
-                deptIds=new ArrayList<>();
-                deptIds.add(-1);
             }
         }
         List<Map<String, Object>> list = projectMapper.getUserWorkingTimeList(userId, user.getCompanyId(), startDate, endDate, projectId,null,null,null,deptIds);
@@ -4124,8 +4133,9 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
         List<DepartmentOtherManager> departmentOtherManagerList = departmentOtherManagerMapper.selectList(new QueryWrapper<DepartmentOtherManager>().eq("other_manager_id", targetUser.getId()));
         //判断查看权限
         if(functionAllList.size()==0){
+            deptIds=new ArrayList<>();
+            deptIds.add(-1);
             if(functionDeptList.size()>0){
-                deptIds=new ArrayList<>();
                 List<Integer> collect = userDepartmentList.stream().distinct().map(dm -> dm.getDepartmentId()).collect(Collectors.toList());
                 List<Integer> otherCollect = departmentOtherManagerList.stream().distinct().map(dom -> dom.getDepartmentId()).collect(Collectors.toList());
                 collect.addAll(otherCollect);
@@ -4133,10 +4143,6 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
                     List<Integer> branchDepartment = getBranchDepartment(integer, allDepartmentList);
                     deptIds.addAll(branchDepartment);
                 }
-
-            }else {
-                deptIds=new ArrayList<>();
-                deptIds.add(-1);
             }
         }
         List<Map<String,Object>> reportList=reportMapper.getUserReportTimelinessRate(targetUser.getCompanyId(),startDate,endDate);
@@ -4364,8 +4370,9 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
         List<DepartmentOtherManager> departmentOtherManagerList = departmentOtherManagerMapper.selectList(new QueryWrapper<DepartmentOtherManager>().eq("other_manager_id", targetUser.getId()));
         //判断查看权限
         if(functionAllList.size()==0){
+            deptIds=new ArrayList<>();
+            deptIds.add(-1);
             if(functionDeptList.size()>0){
-                deptIds=new ArrayList<>();
                 List<Integer> collect = userDepartmentList.stream().distinct().map(dm -> dm.getDepartmentId()).collect(Collectors.toList());
                 List<Integer> otherCollect = departmentOtherManagerList.stream().distinct().map(dom -> dom.getDepartmentId()).collect(Collectors.toList());
                 collect.addAll(otherCollect);
@@ -4373,9 +4380,6 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
                     List<Integer> branchDepartment = getBranchDepartment(integer, allDepartmentList);
                     deptIds.addAll(branchDepartment);
                 }
-            }else {
-                deptIds=new ArrayList<>();
-                deptIds.add(-1);
             }
         }
         long total;

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

@@ -158,6 +158,8 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
     private ReportLogMapper reportLogMapper;
     @Resource
     private ThirdPartyInterfaceMapper thirdPartyInterfaceMapper;
+    @Resource
+    private DepartmentOtherManagerMapper departmentOtherManagerMapper;
 
     @Value(value = "${upload.path}")
     private String path;
@@ -218,13 +220,22 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
                 if (hasDeptWorktimePriv || (user.getManageDeptId() != null &&  user.getManageDeptId() > 0)) {
                     //找到该部门的所有子部门
                     List<Department> allDepts = departmentMapper.selectList(new QueryWrapper<Department>().eq("company_id", user.getCompanyId()));
-                    //查找当前部门经理负责的部门
+                    //查找当前部门经理负责的部门 或者作为其他负责人的部分
                     List<Department> queryDeptList = null;
                     if (deptId != null) {
                         queryDeptList = allDepts.stream().filter(dp->dp.getDepartmentId().equals(deptId)).collect(Collectors.toList());
                     } else {
                         queryDeptList = allDepts.stream().filter(
                                 dp -> user.getId().equals(dp.getManagerId()) || (hasDeptWorktimePriv && dp.getDepartmentId().equals(user.getDepartmentId()))).collect(Collectors.toList());
+                        List<DepartmentOtherManager> departmentOtherManagerList = departmentOtherManagerMapper.selectList(new QueryWrapper<DepartmentOtherManager>().eq("other_manager_id", user.getId()));
+                        List<Integer> otherCollect = departmentOtherManagerList.stream().distinct().map(dom -> dom.getDepartmentId()).collect(Collectors.toList());
+                        for (Integer integer : otherCollect) {
+                            Optional<Department> first = allDepts.stream().filter(ad -> ad.getDepartmentId().equals(integer)).findFirst();
+                            if(first.isPresent()){
+                                queryDeptList.add(first.get());
+                            }
+                        }
+
                     }
 
                     if (queryDeptList.size() > 0) {

+ 7 - 5
fhKeeper/formulahousekeeper/management-platform/src/main/resources/mapper/DepartmentMapper.xml

@@ -24,10 +24,12 @@
         SELECT SUM(b.working_time) AS time, SUM(b.cost) AS money
         FROM report AS b
         WHERE b.state = 1
-        AND b.dept_id IN
-        <foreach collection="departmentIds" item="departmentId" index="index" open="(" close=")" separator=",">
-            #{departmentId}
-        </foreach>
+        <if test="departmentIds != null and departmentIds.size()>0">
+            AND b.dept_id IN
+            <foreach collection="departmentIds" item="departmentId" index="index" open="(" close=")" separator=",">
+                #{departmentId}
+            </foreach>
+        </if>
         <if test="startDate != null and endDate != null">
             AND b.create_date between #{startDate} and #{endDate}
         </if>
@@ -41,7 +43,7 @@
         LEFT JOIN report AS b ON a.id = b.creator_id
         LEFT JOIN project AS c ON b.project_id = c.id
         WHERE b.state = 1
-        <if test="departmentIds != null">
+        <if test="departmentIds != null and departmentIds.size()>0">
             AND b.dept_id IN
             <foreach collection="departmentIds" item="departmentId" index="index" open="(" close=")" separator=",">
                 #{departmentId}

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

@@ -662,6 +662,12 @@
         WHERE
         a.state = 1
         and a.company_id = #{companyId}
+        <if test="departmentIds!=null and departmentIds.size()>0">
+            and a.dept_id in
+            <foreach collection="departmentIds" open="(" item="item" separator="," close=")">
+                #{item}
+            </foreach>
+        </if>
         <if test="projectId != null">
             and a.project_id = #{projectId}
         </if>

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

@@ -606,7 +606,7 @@
 
 
             <div slot="footer" class="dialog-footer">
-                <el-button v-if="user.id == this.addForm.createrId || currentProject.inchargerId == user.id" @click.native="deleteTask" style="float:left;">删除</el-button>
+                <el-button v-if="user.id == addForm.createrId || currentProject.inchargerId == user.id || currentProject.creatorId == user.id || permissions.projectManagement" @click.native="deleteTask()" style="float:left;">删除</el-button>
                 <el-button @click.native="addFormVisible = false">取消</el-button>
                 <el-button type="primary" @click="submitInsert" :loading="addLoading">提交</el-button>
             </div>

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

@@ -418,7 +418,7 @@
                     </div>
             </el-form>
             <div slot="footer" class="dialog-footer">
-                <el-button v-if="user.id == this.addForm.createrId || currentProject.inchargerId == user.id" @click.native="deleteTask" style="float:left;">删除</el-button>
+                <el-button v-if="user.id == addForm.createrId || currentProject.inchargerId == user.id || currentProject.creatorId == user.id || permissions.projectManagement" @click.native="deleteTask" style="float:left;">删除</el-button>
                 <el-button @click.native="addFormVisible = false">取消</el-button>
                 <el-button type="primary" @click="submitInsert" :loading="addLoading">提交</el-button>
             </div>

+ 1 - 1
fhKeeper/formulahousekeeper/timesheet/src/views/team/index.vue

@@ -159,7 +159,7 @@
                 </el-table-column>
                 <el-table-column label="状态" width="160">
                     <template slot-scope="scope">
-                        <span>{{scope.row.isActive==0 ? '离职(' + scope.row.inactiveDate + ')' : '在职'}}</span>
+                        <span>{{scope.row.isActive==0 ? '停用(' + scope.row.inactiveDate + ')' : '活跃'}}</span>
                     </template>
                 </el-table-column>
                 <el-table-column label="操作" width="300">

+ 66 - 32
fhKeeper/formulahousekeeper/timesheet_h5/src/views/count/count.vue

@@ -1,12 +1,9 @@
 <template>
   <div>
-    <div style="position:">
-    <!-- <van-cell>
-        <template #default>
-            <div style="text-align:center">团队填报统计</div>
-        </template>
-    </van-cell> -->
+    <div>
+
     <div class="title111">
+    <van-sticky offset-top="-0.9rem">
     <van-cell :title="'选择月份:' + nowMonthTitle" @click="monthSelectShow = true" class="monthSel" />
     <van-action-sheet v-model="monthSelectShow">
         <div class="monthSelectContent">
@@ -21,7 +18,8 @@
             />
         </div>
     </van-action-sheet>
-    <van-tabs background="#20a0ff" title-active-color="#fff" title-inactive-color="#3c3c45" @change="dateChange" v-model="nowDay">
+    
+    <van-tabs background="#20a0ff" title-active-color="#fff" title-inactive-color="#3c3c45" @change="dateChange" v-model="nowDay" style="height:1.17333rem">
         <van-tab v-for="item in dateArray" :key="item.day" :name="item.day">
             <template #title>
                 <div style="text-align:center;width:0.6rem;padding-bottom:10px">
@@ -31,28 +29,42 @@
             </template>
         </van-tab>
     </van-tabs>
+    </van-sticky>
     </div>
 
 
     <div id="main" style="width:250px;height:250px;margin:0 auto"></div>
-
-    <van-tabbar v-model="stateActive" :fixed="false" @change="stateChange" class="stateActiveClass">
-        <van-tabbar-item name="submit">已提交
-            <template #icon>
-                <span style="color:#409eff;font-size:0.58rem">{{submitList.length}}</span><span style="font-size:0.32rem;color:#333">人</span>
+    <van-sticky offset-top="1.35333rem">
+        <div style="background:#fff;">
+    <van-tabs v-model="stateActive" :fixed="false" @change="stateChange" class="stateActiveClass" color="#20a0ff">
+        <van-tab name="submit">
+            <template #title>
+                <div style="text-align:center">
+                    <span style="color:#409eff;font-size:0.58rem">{{submitList.length}}</span>
+                    <span style="font-size:0.32rem;color:#333">人</span>
+                </div>
+                <div style="font-size:0.32rem;color:#333">已提交</div>
             </template>
-        </van-tabbar-item>
-        <van-tabbar-item name="unsubmit">待提交
-            <template #icon>
-                <span style="color:#ffa366;font-size:0.58rem">{{unSubmitList.length}}</span><span style="font-size:0.32rem;color:#333">人</span>
+        </van-tab>
+        <van-tab name="unsubmit">
+            <template #title>
+                <div style="text-align:center">
+                    <span style="color:#ffa366;font-size:0.58rem">{{unSubmitList.length}}</span>
+                    <span style="font-size:0.32rem;color:#333">人</span>
+                </div>
+                <div style="font-size:0.32rem;color:#333">待提交</div>
             </template>
-        </van-tabbar-item>
-        <van-tabbar-item name="unfill">未填写
-            <template #icon>
-                <span style="color:#ff4500;font-size:0.58rem">{{unFillList.length + unFillLeaveList.length}}</span><span style="font-size:0.32rem;color:#333">人</span>
+        </van-tab>
+        <van-tab name="unfill">
+            <template #title>
+                <div style="text-align:center">
+                    <span style="color:#ff4500;font-size:0.58rem">{{unFillList.length + unFillLeaveList.length}}</span>
+                    <span style="font-size:0.32rem;color:#333">人</span>
+                </div>
+                <div style="font-size:0.32rem;color:#333">未填写</div>
             </template>
-        </van-tabbar-item>
-    </van-tabbar>
+        </van-tab>
+    </van-tabs>
     <van-cell v-if="stateActive == 'unfill' && (user.timeType.syncCorpwxTime == 1 || user.timeType.syncDingding == 1 || user.company.packageOa == 1)">
         <template #default>
             <van-tabs type="card" @change="unfillSelect" v-model="unfillSelKey" color="#20a0ff">
@@ -61,16 +73,23 @@
             </van-tabs>
         </template>
     </van-cell>
+        </div>
+    </van-sticky>
     </div>
-    <van-cell-group v-if="showList.length">
-        <van-cell v-for="item in showList" :key="item.id" :title="item.name" :value="item.department" title-style="color:#666"></van-cell>
-    </van-cell-group>
-    <van-cell-group v-else>
-        <van-cell>
+    <van-cell-group>
+        <van-cell v-if="listLoading">
+            <template #default>
+                <van-loading color="#1989fa" size="24" text-size="12" style="text-align:center;">加载中...</van-loading>
+            </template>
+        </van-cell>
+        <van-cell v-if="showList.length == 0">
             <template #default>
                 <div style="text-align:center;color:#7d7e80;font-size:13px">暂无数据</div>
             </template>
         </van-cell>
+        <template v-else>
+            <van-cell v-for="item in showList" :key="item.id" :title="item.name" :value="item.department" title-style="color:#666"></van-cell>
+        </template>
     </van-cell-group>
     <Footer page="index"></Footer>
   </div>
@@ -103,6 +122,7 @@ export default {
             unFillList:[],  //未填写人员列表
             unFillLeaveList:[],
             showList:[],
+            listLoading: false,
 
             stateActive: 'submit'
         }
@@ -174,21 +194,25 @@ export default {
             if (this.user.manageDeptId != 0 && !this.reportsCompany && !this.reportsDept) {
                 parameter.manageDeptId = this.user.manageDeptId; 
             }
+            this.listLoading = true
+            this.submitList = []
+            this.unSubmitList = []
+            this.unFillList = []
+            this.unFillLeaveList = []
             this.$axios.post('/report/getMembList', parameter)
             .then(res => {
                 if(res.code == 'ok'){
-                    this.submitList = []
-                    this.unSubmitList = []
-                    this.unFillList = []
-                    this.unFillLeaveList = []
                     this.extractUser(res.data)
                     this.drawChart()
+                    this.listLoading = false
                     this.stateChange('submit')
                 }else {
+                    this.listLoading = false
                     this.$toast.clear();
                     this.$toast.fail('获取失败:'+res.msg);
                 } 
             }).catch(err=> {
+                this.listLoading = false
                 this.$toast.clear();
             });
         },
@@ -220,6 +244,7 @@ export default {
         },
 
         drawChart(){
+            this.$echarts.init(document.getElementById('main')).dispose()
             var myChart = this.$echarts.init(document.getElementById('main'));
             // 绘制图表
             myChart.setOption({
@@ -235,6 +260,15 @@ export default {
                     }
                 ]
             });
+            myChart.on('click',(params)=>{
+                if(params.dataIndex == 0){
+                    this.stateChange('submit')
+                }else if(params.dataIndex == 1){
+                    this.stateChange('unsubmit')
+                }else{
+                    this.stateChange('unfill')
+                }
+            })
         }
     },
     mounted() {
@@ -286,6 +320,6 @@ body{
     overflow: hidden;
 }
 .title111 .van-tabs__line{
-    background-color: #eee;
+    background-color: #f7f7f7;
 }
 </style>