소스 검색

Merge remote-tracking branch 'origin/master'

yusm 1 년 전
부모
커밋
5ec03ac2c0

+ 13 - 0
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/controller/ReportController.java

@@ -339,6 +339,19 @@ public class ReportController {
         User user = userService.getById(token);
         Company company = companyService.getById(user.getCompanyId());
         TimeType comTimeType = timeTypeMapper.selectById(user.getCompanyId());
+        if (company.getId() == 1336) {
+            //针对三友反馈的填写的日报内容,但是没有显示出来的问题,打印日志进行追踪
+            System.out.println("user: "+user.getId()+", 填写内容是:");
+            if (content != null) {
+                for (int i=0;i<projectId.length; i++) {
+                    if (i < content.length) {
+                        System.out.println("项目:"+i+", "+projectId[i]+", "+content[i]);
+                    } else {
+                        System.out.println("项目:"+i+", "+projectId[i]+", 内容为空");
+                    }
+                }
+            }
+        }
         if (comTimeType.getStopReport() == 1) {
             HttpRespMsg msg = new HttpRespMsg();
             msg.setError("系统已关闭日报填写功能,请联系管理员");

+ 12 - 1
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/controller/WeiXinCorpController.java

@@ -1714,7 +1714,8 @@ public class WeiXinCorpController {
 
     //获取部门详情
     private JSONObject getDeptDetail(String accessToken, int deptId) {
-        String url = GET_DEPARTMENT_DETAIL_URL.replace("ACCESS_TOKEN", accessToken).replace("ID", ""+deptId);
+        log.info("传参数accessToken="+accessToken+", deptId=="+deptId);
+        String url = GET_DEPARTMENT_DETAIL_URL.replace("ACCESS_TOKEN", accessToken).replace("id=ID", "id="+deptId);
         String result = restTemplate.getForObject(url, String.class);
         log.info("部门详情:"+result);
         JSONObject obj = JSONObject.parseObject(result);
@@ -2664,9 +2665,19 @@ public class WeiXinCorpController {
             } else {
                 //比较是否有更新
                 Department oldDept = first.get();
+                boolean hasUpdate = false;
                 if (oldDept.getCorpwxDeptpid() == null || !oldDept.getCorpwxDeptpid().equals(department.getCorpwxDeptpid())) {
                     //有父部门需要更新
                     oldDept.setCorpwxDeptpid(parentId);
+                    hasUpdate = true;
+                }
+                if ((StringUtils.isEmpty(oldDept.getDepartmentName()) && !StringUtils.isEmpty(department.getDepartmentName()))
+                    ||(!StringUtils.isEmpty(oldDept.getDepartmentName()) && !StringUtils.isEmpty(department.getDepartmentName()) && !oldDept.getDepartmentName().equals(department.getDepartmentName()))) {
+                    //有名称需要更新
+                    oldDept.setDepartmentName(department.getDepartmentName());
+                    hasUpdate = true;
+                }
+                if (hasUpdate) {
                     departmentMapper.updateById(oldDept);
                 }
                 department = oldDept;

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

@@ -29,7 +29,8 @@ public interface ProjectMapper extends BaseMapper<Project> {
 
     List<Map<String, Object>> getTimeCost(@Param("companyId") Integer companyId, @Param("startDate") String startDate, @Param("endDate") String endDate,
                                           @Param("projectId") Integer projectId, @Param("userIdList") List<String> userIdList,
-                                          @Param("deptIds")List<Integer> deptIds,@Param("filterDeptIds")List<Integer> filterDeptIds, @Param("deptRelatedProjectIds") List<Integer> deptRelatedProjectIds, @Param("projectIds") List<Integer> projectIds);
+                                          @Param("deptIds")List<Integer> deptIds,@Param("filterDeptIds")List<Integer> filterDeptIds, @Param("deptRelatedProjectIds") List<Integer> deptRelatedProjectIds,
+                                          @Param("projectIds") List<Integer> projectIds, @Param("inchargeUserIds") List<String> inchargeUserIds);
 
     List<Map<String, Object>> getCustomDataSum(@Param("companyId") Integer companyId, @Param("startDate") String startDate, @Param("endDate") String endDate,
                                           @Param("projectId") Integer projectId, @Param("userId") String userId);
@@ -120,7 +121,7 @@ public interface ProjectMapper extends BaseMapper<Project> {
 
     List<Map<String, Object>> getTimeCostByMainProject(Integer companyId, String startDate, String endDate, Integer projectId, String userId, List<Integer> deptIds);
 
-    List<Map<String, Object>> getCostByGroup(String startDate, String endDate, Integer projectId);
+    List<Map<String, Object>> getCostByGroup(String startDate, String endDate, Integer projectId, List<Integer> gpIds);
 
     List<Map<String, Object>> selectWithGroup(Integer companyId, String startDate, String endDate, Integer startIndex, Integer endIndex, Integer projectId, List<Integer> inchagerIds, Integer groupId, List<Integer> taskGroupIds);
 

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

@@ -10,6 +10,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.github.pagehelper.util.StringUtil;
 import com.management.platform.entity.*;
+import com.management.platform.entity.Task;
 import com.management.platform.entity.vo.*;
 import com.management.platform.mapper.*;
 import com.management.platform.service.*;
@@ -1247,6 +1248,9 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
             List<SysRichFunction> functionCostList = sysFunctionMapper.getRoleFunctions(targetUser.getRoleId(), "查看成本统计");
             List<Integer> deptRelatedProjectIds = new ArrayList<>();
             List<Integer> projectIds = null;
+            //针对威派格,部门的主要和其他负责人需要查看部门下人员负责的项目或者项目下的任务分组的工时
+            boolean containDeptMembInchargeProjects = targetUser.getCompanyId() == 936;
+            List<String> inchargeUserIds = null;
             //判断查看权限
             if(functionAllList.size()==0){
                 deptIds=new ArrayList<>();
@@ -1270,6 +1274,9 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
                     if(functionTimeList.size()>0||functionCostList.size()>0){
                         deptIds.addAll(allMyManagedDeptIds);
                     }
+                    if (containDeptMembInchargeProjects && deptIds.size() > 1) {
+                        inchargeUserIds = userMapper.selectList(new QueryWrapper<User>().select("id").in("department_id", deptIds)).stream().map(User::getId).collect(Collectors.toList());
+                    }
                 } else {
                     //担任项目经理的项目
                     List<Project> projectList = projectMapper.selectList(new QueryWrapper<Project>().select("id").eq("incharger_id", targetUser.getId()));
@@ -1287,7 +1294,7 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
                 String[] split = userIds.split(",");
                 userIdList = Arrays.asList(split);
             }
-            List<Map<String, Object>> list = projectMapper.getTimeCost(companyId, startDate, endDate, projectId, userIdList,deptIds,null, deptRelatedProjectIds, projectIds);
+            List<Map<String, Object>> list = projectMapper.getTimeCost(companyId, startDate, endDate, projectId, userIdList,deptIds,null, deptRelatedProjectIds, projectIds, inchargeUserIds);
             BigDecimal totalMoneyCost = BigDecimal.valueOf(0);
             for (Map<String, Object> map : list) {
                 if (!map.containsKey("cost")) {
@@ -1353,6 +1360,9 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
             List<Integer> manProjectIds = null;
             //判断查看权限
             List<Integer> filterDeptIds=null;
+            //针对威派格,部门的主要和其他负责人需要查看部门下人员负责的项目或者项目下的任务分组的工时
+            boolean containDeptMembInchargeProjects = targetUser.getCompanyId() == 936;
+            List<String> inchargeUserIds = null;
             if(deptId!=null){
                 filterDeptIds= getBranchDepartment(deptId, allDepartmentList);
             }
@@ -1376,6 +1386,9 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
                     if(functionTimeList.size()>0||functionCostList.size()>0){
                         deptIds.addAll(allMyManagedDeptIds);
                     }
+                    if (containDeptMembInchargeProjects && deptIds.size() > 1) {
+                        inchargeUserIds = userMapper.selectList(new QueryWrapper<User>().select("id").in("department_id", deptIds)).stream().map(User::getId).collect(Collectors.toList());
+                    }
                 } else {
                     //担任项目经理的项目
                     List<Project> projectList = projectMapper.selectList(new QueryWrapper<Project>().select("id").eq("incharger_id", targetUser.getId()));
@@ -1405,7 +1418,7 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
                 String[] split = userIds.split(",");
                 userIdList = Arrays.asList(split);
             }
-            List<Map<String, Object>> list = projectMapper.getTimeCost(companyId, startDate, endDate, projectId, userIdList,deptIds,filterDeptIds,deptRelatedProjectIds, manProjectIds);
+            List<Map<String, Object>> list = projectMapper.getTimeCost(companyId, startDate, endDate, projectId, userIdList,deptIds,filterDeptIds,deptRelatedProjectIds, manProjectIds, inchargeUserIds);
             BigDecimal totalMoneyCost = BigDecimal.valueOf(0);
             List<List<String>> allList=null ;
             List<String> sumRow = null;
@@ -8205,14 +8218,64 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
     public HttpRespMsg getCostByGroup(String startDate, String endDate, Integer projectId, HttpServletRequest request) {
         HttpRespMsg httpRespMsg = new HttpRespMsg();
         try {
-            Integer companyId = userMapper.selectById(request.getHeader("Token")).getCompanyId();
+            User targetUser = userMapper.selectById(request.getHeader("Token"));
+            Integer companyId = targetUser.getCompanyId();
             //首先查看有无浏览权限
-            if (!projectMapper.selectById(projectId).getCompanyId().equals(companyId)) {
+            Project project = projectMapper.selectById(projectId);
+            if (!project.getCompanyId().equals(companyId)) {
                 //httpRespMsg.setError("无权查看其他公司的项目详情");
                 httpRespMsg.setError(MessageUtils.message("access.otherCompanyProject"));
             } else {
                 Map<String, Object> resultMap = new HashMap<>();
-                List<Map<String, Object>> list = projectMapper.getCostByGroup(startDate, endDate, projectId);
+                List<Integer> gpIds = null;
+                if (companyId == 936) {
+                    //威派格的工时查看可能是看分组负责人的分组工时,需要过滤筛选
+                    //当前用户管理部门
+                    List<Integer> deptIds=null;
+                    List<Department> allDepartmentList = departmentMapper.selectList(new QueryWrapper<Department>().eq("company_id",companyId));
+                    List<Department> departmentList = departmentMapper.selectList(new QueryWrapper<Department>().eq("manager_id", targetUser.getId()).eq("company_id", companyId));
+                    List<DepartmentOtherManager> departmentOtherManagerList = departmentOtherManagerMapper.selectList(new QueryWrapper<DepartmentOtherManager>().eq("other_manager_id", targetUser.getId()));
+                    List<SysRichFunction> functionAllList = sysFunctionMapper.getRoleFunctions(targetUser.getRoleId(), "查看全公司");
+                    List<SysRichFunction> functionDpartList = sysFunctionMapper.getRoleFunctions(targetUser.getRoleId(), "查看负责部门");
+                    //无查看全公司的权限
+                    if (functionAllList.size() == 0) {
+                        deptIds = new ArrayList<>();
+                        deptIds.add(-1);
+                        //有查看负责部门的权限
+                        if (functionDpartList.size() > 0) {
+                            List<Integer> collect = departmentList.stream().map(dm -> dm.getDepartmentId()).distinct().collect(Collectors.toList());
+                            List<Integer> otherCollect = departmentOtherManagerList.stream().map(dom -> dom.getDepartmentId()).distinct().collect(Collectors.toList());
+                            collect.addAll(otherCollect);
+                            for (Integer integer : collect) {
+                                List<Integer> branchDepartment = getBranchDepartment(integer, allDepartmentList);
+                                deptIds.addAll(branchDepartment);
+                            }
+                            //查找当前项目的负责人
+                            if (project.getInchargerId() != null) {
+                                Integer departmentId = userMapper.selectById(project.getInchargerId()).getDepartmentId();
+                                if (deptIds.contains(departmentId)) {
+                                    //项目经理是管理的部门下面的人,查看全部分组
+                                } else {
+                                    //检查是否是分组负责人,查看部分分组
+                                    List<Integer> fDeptIds = deptIds;
+                                    List<TaskGroup> groupList = taskGroupMapper.selectList(new QueryWrapper<TaskGroup>().eq("project_id", project.getId()));
+                                    gpIds = new ArrayList<>();
+                                    gpIds.add(-1);
+                                    for (TaskGroup g : groupList) {
+                                        if (g.getInchargerId() != null) {
+                                            Integer departmentId1 = userMapper.selectById(g.getInchargerId()).getDepartmentId();
+                                            if (fDeptIds.contains(departmentId1)) {
+                                                //是分组负责人,查看全部
+                                                gpIds.add(g.getId());
+                                            }
+                                        }
+                                    }
+                                }
+                            }
+                        }
+                    }
+                }
+                List<Map<String, Object>> list = projectMapper.getCostByGroup(startDate, endDate, projectId, gpIds);
                 BigDecimal totalMoneyCost = BigDecimal.valueOf(0);
                 for (Map<String, Object> map : list) {
                     if (!map.containsKey("costMoney")) {

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

@@ -5557,13 +5557,17 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
                     map.put("daysTxt", date.format(DateTimeFormatter.ofPattern("MM/dd")));
                     if (!noReportDataList.stream().anyMatch(noItem->noItem.get("corpwxUserid").equals(curUser.getCorpwxUserid()))) {
                         noReportDataList.add(map);
-                    }
-                } else {
-                    Map<String, Object> findUser = noReportDataList.stream().filter(data -> data.get("corpwxUserid").equals(curUser.getCorpwxUserid())).findFirst().get();
-                    Object days = findUser.get("days");
-                    findUser.put("days", (Integer)days + 1);
-                    if ((Integer)days + 1 < 4) {
-                        findUser.put("daysTxt", findUser.get("daysTxt") + "," + date.format(DateTimeFormatter.ofPattern("MM/dd")));
+                    } else {
+                        //已经添加过了,需要更新天数
+                        Optional<Map<String, Object>> optional = noReportDataList.stream().filter(data -> data.get("corpwxUserid").equals(curUser.getCorpwxUserid())).findFirst();
+                        if (optional.isPresent()) {
+                            Map<String, Object> findUser = optional.get();
+                            Object days = findUser.get("days");
+                            findUser.put("days", (Integer)days + 1);
+                            if ((Integer)days + 1 < 4) {
+                                findUser.put("daysTxt", findUser.get("daysTxt") + "," + date.format(DateTimeFormatter.ofPattern("MM/dd")));
+                            }
+                        }
                     }
                 }
             }

+ 20 - 19
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/task/TimingTask.java

@@ -8,6 +8,7 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.injector.methods.SelectById;
 import com.management.platform.controller.WeiXinCorpController;
 import com.management.platform.entity.*;
+import com.management.platform.entity.Task;
 import com.management.platform.entity.vo.TokenVo;
 import com.management.platform.mapper.*;
 import com.management.platform.service.*;
@@ -1286,9 +1287,8 @@ public class TimingTask {
                 }
                 //开通了OA功能,有请假模块的,需要把当前请假的排除掉
                 List<Map<String, Object>> userList = new ArrayList<>();
-                boolean recentlyNotFill;
+                boolean lastWeekNotFill = false;
                 if (t.getAlertType() == 0 || t.getAlertType() == 1) {
-                    recentlyNotFill = false;
                     if (company.getPackageOa() == 1) {
                         userList = userMapper.getPushUserList(t.getCompanyId(),t.getAlertType(), date);
                     } else {
@@ -1313,16 +1313,21 @@ public class TimingTask {
                         }
                         transfDay = transfDay.plusDays(1);
                     }
-                    //如果今天就是最后一个工作日
-                    if (lastWorkDay.isEqual(localDate)) {
-                        recentlyNotFill = false;
+                    //如果今天就是最后一个工作日;或者周六周日,需要提醒本周
+                    if (lastWorkDay.isEqual(localDate) || localDate.getDayOfWeek().getValue() == 6 || localDate.getDayOfWeek().getValue() == 7) {
                         LocalDate startDate = localDate.with(DayOfWeek.MONDAY);
                         userList = reportService.getNotFullReportUserList(company.getId(), startDate, lastDay);
                     } else {
-                        //检查之前10天是否存在未填的
-                        LocalDate startDate = localDate.minusDays(10);
-                        userList = reportService.getNotFullReportUserList(company.getId(), startDate, localDate.minusDays(1));
-                        recentlyNotFill = true;
+                        LocalDate startDate = localDate.minusDays(7);
+                        //从2023-11-10号以后开始算
+                        if (startDate.isAfter(LocalDate.parse("2023-11-05"))) {
+                            //检查上周日报是否漏填
+                            LocalDate lastSunday = localDate.with(DayOfWeek.SUNDAY).minusWeeks(1);
+                            LocalDate lastMonday = lastSunday.minusDays(6);
+                            userList = reportService.getNotFullReportUserList(company.getId(), lastMonday, lastSunday);
+//                            System.out.println("上周未填人员数量="+userList.size());
+                            lastWeekNotFill = true;
+                        }
                     }
                 } else if (t.getAlertType() == 3) {
                     //3--每月固定日期提醒上个月的
@@ -1336,19 +1341,16 @@ public class TimingTask {
                         LocalDate endDate = localDate.minusMonths(1).with(TemporalAdjusters.lastDayOfMonth());
                         userList = reportService.getNotFullReportUserList(company.getId(), startDate, endDate);
                     }
-                    recentlyNotFill = false;
-                } else {
-                    recentlyNotFill = false;
                 }
-
                 List<WxCorpInfo> cpList = wxCorpInfoMapper.selectList(new QueryWrapper<WxCorpInfo>().eq("company_id", t.getCompanyId()));
+                final boolean finalLastWeekNotFill = lastWeekNotFill;
                 userList.forEach(u->{
                     if (u.get("corpwxUserid") != null){
                         //推送到企业微信
                         String corpUid = (String) u.get("corpwxUserid");
                         JSONObject json=new JSONObject();
-                        JSONArray dataJson=new JSONArray();
-                        JSONObject jsonObj=new JSONObject();
+                        JSONArray dataJson = new JSONArray();
+                        JSONObject jsonObj = new JSONObject();
                         jsonObj.put("key", "提示");
                         if (t.getAlertType() == 3) {
                             //每月提醒上个月的
@@ -1358,14 +1360,12 @@ public class TimingTask {
                                 jsonObj.put("value", "您上个月有"+u.get("daysTxt")+"共"+(Integer)u.get("days")+"天未填写工时报告,请尽快填写");
                             }
                         } else {
-                            if (recentlyNotFill) {
-                                jsonObj.put("value", "您近期有"+(Integer)u.get("days")+"天未填写工时报告,请尽快填写");
+                            if (finalLastWeekNotFill) {
+                                jsonObj.put("value", "您上周有"+(Integer)u.get("days")+"天未填写工时报告,请尽快填写");
                             } else {
                                 jsonObj.put("value", StringUtils.isEmpty(t.getAlertMsg())?"":t.getAlertMsg());
                             }
                         }
-
-
                         dataJson.add(jsonObj);
                         if(isPrivateDeploy){
                             json.put("content",StringUtils.isEmpty(t.getAlertMsg())?"":t.getAlertMsg()+"\\n<a href=\\\"https://open.weixin.qq.com/connect/oauth2/authorize?appid="+suitId+"&redirect_uri="+pcUrl+"/api/corpInsideWXAuth&response_type=code&scope=snsapi_base&state=0#wechat_redirect\\\">去填写</a>");
@@ -1375,6 +1375,7 @@ public class TimingTask {
                             json.put("content_item",dataJson);
                         }
                         if (cpList.size() > 0) {
+//                            System.out.println("发送企业微信漏填提醒:" + LocalDateTime.now().toString() + ", corpUid=" + corpUid + ", json=" + json.toJSONString());
                             wxCorpInfoService.sendWXCorpTemplateMsg(cpList.get(0), corpUid, json);
                         }
                     } else if (u.get("wxOpenid") != null) {

+ 5 - 10
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/util/DateTimeUtil.java

@@ -70,15 +70,10 @@ public class DateTimeUtil {
     }
 
     public static void main(String[] args) {
-        double d = getHalfHoursFromDouble(0.26);
-        System.out.println(d);
-        d = getHalfHoursFromDouble(1.2);
-        System.out.println(d);
-        d = getHalfHoursFromDouble(1.24);
-        System.out.println(d);
-        d = getHalfHoursFromDouble(1.25);
-        System.out.println(d);
-        d = getHalfHoursFromDouble(1.26);
-        System.out.println(d);
+        LocalDate localDate = LocalDate.now();
+        System.out.println(localDate);
+        System.out.println(localDate.getDayOfWeek().getValue());
+        localDate = localDate.with(DayOfWeek.SUNDAY);
+        System.out.println(localDate);
     }
 }

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

@@ -186,6 +186,17 @@
                             #{pid}
                         </foreach>
                     </if>
+                    <if test="inchargeUserIds != null and inchargeUserIds.size()>0">
+                        OR a.`incharger_id` IN
+                           <foreach collection="inchargeUserIds" open="(" item="pid" separator="," close=")">
+                            #{pid}
+                        </foreach>
+                        OR b.`group_id` IN(SELECT id FROM task_group WHERE incharger_id IN
+                        <foreach collection="inchargeUserIds" open="(" item="pid" separator="," close=")">
+                            #{pid}
+                        </foreach>
+                         )
+                    </if>
                     )
                 </if>
             </otherwise>
@@ -572,6 +583,12 @@
         <if test="startDate != null and endDate != null">
             AND a.create_date between #{startDate} and #{endDate}
         </if>
+        <if test="gpIds != null">
+            AND a.group_id in
+            <foreach collection="gpIds" open="(" separator="," close=")" item="item">
+                #{item}
+            </foreach>
+        </if>
         GROUP BY a.group_id
         ORDER BY a.group_id ASC
     </select>

+ 8 - 1
fhKeeper/formulahousekeeper/timesheet-workshop-h5/src/views/index/index.vue

@@ -222,7 +222,14 @@ export default {
                 },
             ]
             console.log(routersList, modelNameList)
-            this.routers = routersList.filter(item => item.fixed || modelNameList.includes(item.moudelName))
+            this.routers = routersList.filter(item => item.fixed || modelNameList.includes(item.moudelName));
+            this.routers.push({
+                    name: '我的',
+                    moudelName: '我的',
+                    // url: '/workView',
+                    url: '/my',
+                    icon: 'balance-list-o'
+                });
         },
         // 获取企业微信参数
         agentConfig() {

+ 4 - 0
fhKeeper/formulahousekeeper/timesheet-workshop-h5/src/views/login/index.vue

@@ -196,6 +196,10 @@
                 this.isWX = true;
             }
             let href = window.location.href;
+            //如果是管理员退出后登录,则不自动登录
+            if (href.indexOf('loginAny') > 0) {
+                return;
+            }
             //优先处理企业微信工作台点击进入,后台已经处理过,有userId传过来了
             if (this.isCorpWX && href.indexOf("userId") > 0) {
                 //判断企业微信,是否存在授权

+ 5 - 78
fhKeeper/formulahousekeeper/timesheet-workshop-h5/src/views/my/children/center.vue

@@ -13,36 +13,25 @@
         <!-- 主体 -->
         <main class="mt-10">
             <div class="bg-fff">
-                <!-- <div v-if="userInfo.companyId == '7'"> -->
-
-                <van-cell title="当前版本" :title-style="'flex: 0.5;'" :value="version"></van-cell>
-
                 <div style="height: 20px;background: #f4f4f4"></div>
                 <!-- </div> -->
                 <van-cell title="账号" v-if="userInfo.userNameNeedTranslate != '1'" :title-style="'flex: 0.5;'" :value="userInfo.phone"></van-cell>
                 <van-cell title="工号" v-if="userInfo.jobNumber" :title-style="'flex: 0.5;'" :value="userInfo.jobNumber"></van-cell>
-
+                <van-cell title="角色" v-if="userInfo.roleName" :title-style="'flex: 0.5;'" :value="userInfo.roleName"></van-cell>
                 <div style="height: 20px;background: #f4f4f4"></div>
                 
                 <van-cell title="公司" :title-style="'flex: 0.5;'" :value="userInfo.companyName"></van-cell>
                 <van-cell title="有效日期" :title-style="'flex: 0.5;'" :value="expirationDate"></van-cell> 
 
                 <div style="height: 20px;background: #f4f4f4"></div>
-                <!-- <div v-if="userInfo.companyId == '7'"> -->
-                <van-cell title="使用说明" :title-style="'flex: 1;'" is-link @click="instructions()"></van-cell>
-                <van-cell title="在线客服" :title-style="'flex: 1;'" is-link @click="tokefu()"></van-cell>
-                <van-cell title="添加员工" :title-style="'flex: 1;'" is-link @click="addEmployee()" v-if="wxManager"></van-cell>
-                <!-- </div> -->
-                <!-- <van-cell title="修改密码" isLink to="/my/set"></van-cell> -->
             </div>
-            <van-cell :title="'绑定'+(isCorpWX?'企业':'')+'微信'" v-if="userInfo.userNameNeedTranslate != '1' && (isCorpWX || isWX)" @click="bindWeiXin" style="margin-top:10px;" :title-style="'flex: 2.5;'" label="绑定微信后可接收工时填报提醒">
+            <!-- <van-cell :title="'绑定'+(isCorpWX?'企业':'')+'微信'" v-if="userInfo.userNameNeedTranslate != '1' && (isCorpWX || isWX)" @click="bindWeiXin" style="margin-top:10px;" :title-style="'flex: 2.5;'" label="绑定微信后可接收工时填报提醒">
                 <template>
                     <span v-if="(isCorpWX && userInfo.corpwxUserid == null) || (isWX && userInfo.wxOpenid == null)" style="color:#ff0000;">未绑定</span>
                     <span v-if="(isCorpWX && userInfo.corpwxUserid != null) || (isWX && userInfo.wxOpenid != null)" style="color:#7CCD7C;">已绑定</span>
                 </template>
-            </van-cell>
-            <van-button class="logout" @click="logout" block round type="danger" v-if="!isCorpWX">退出登录</van-button>
-            <!-- <van-button class="logout" @click="logout" block round type="danger" >退出登录</van-button> -->
+            </van-cell> -->
+            <van-button class="logout" @click="logout" block round type="danger" v-if="userInfo.roleName=='超级管理员' || userInfo.roleName=='系统管理员'">退出登录</van-button>
         </main>
 
         <Footer page="my" />
@@ -78,7 +67,7 @@
             logout() {
                 this.$store.commit("updateLogin", false);
                 localStorage.removeItem("userInfo");
-                this.$router.push("/login");
+                this.$router.push({path:"/login", query: {loginAny: true}});
             },
             bindWeiXin(){
                 //企业微信
@@ -99,61 +88,6 @@
                 var weixinUrl="https://open.weixin.qq.com/connect/oauth2/authorize?appid="+appId+"&redirect_uri="+encodeURI(url)+"&response_type=code&scope=snsapi_base&state=0#wechat_redirect";
                 window.location.href = weixinUrl;
             },
-            // 使用说明
-            instructions() {
-                let url = 'http://celiang.oss-cn-hangzhou.aliyuncs.com/measurement/2022-01/18/75it6phpocqYFV1642488558220118.pdf'
-                let name = '使用说明书'
-                // 将要传过去的值
-                this.previewPDF(url, name)
-            },
-            // 预览pdf
-            previewPDF(url, name) {
-                this.$router.push({
-                    path:  '/pdf',
-                    query: {
-                        url: '',
-                        name: name
-                    }
-                })
-            },
-            // 添加员工
-            addEmployee() {
-                wx.invoke('openAppManage', {}, function(res){
-                    console.log(res, '你在看看')
-                    if(res.err_msg == "openAppManage:ok") {
-                        // 调用成功              
-                    }
-                    if(res.err_msg == "openAppManage:fail:no permission") {
-                        // 调用人身份不符合                 
-                        this.$message({message: '调用人身份不符合',type: "error"});
-                    }
-                    if(res.err_msg == "openAppManage:fail:unknown app") {
-                        // 应用信息获取失败
-                        this.$message({message: '应用信息获取失败',type: "error"});
-                    }
-                    if(res.err_msg == "openAppManage:fail:unsupported app type") {
-                        // 应用类型不符合要求
-                        this.$message({message: '应用类型不符合要求',type: "error"});
-                    }
-                    if(res.err_msg == "openAppManage:fail") {
-                        // 其它错误                  
-                        this.$message({message: '其它错误',type: "error"});
-                    }      
-                })
-            },
-            // 跳转客服
-            tokefu(){
-                wx.invoke('openThirdAppServiceChat', {
-                    }, function(res) {
-                        console.log('invoke',res);
-                        if (res.err_msg == "openThirdAppServiceChat:ok" || res.err_msg == "openThirdAppServiceChat:cancel") {
-                        }else{
-                            this.$toast.fail('请联系管理员添加客服');
-                        }
-                        
-                    }
-                );
-            },
             // 判断是否有添加员工的权限
             getWxManager() {
                 this.$axios.post("/user/isManager", {})
@@ -185,13 +119,6 @@
                 userss.company.expirationDate[2] >= 10 ? userss.company.expirationDate[2] : userss.company.expirationDate[1] = '0' + userss.company.expirationDate[2]
                 userss.company.expirationDate[1] >= 10 ? userss.company.expirationDate[1] : userss.company.expirationDate[1] = '0' + userss.company.expirationDate[1]
                 this.expirationDate = userss.company.expirationDate[0] + '-' + userss.company.expirationDate[1] + '-' + userss.company.expirationDate[2]
-
-                // 版本
-                userss.company.packageWorktime == 1 ? this.version = '基础版' : ''
-                userss.company.packageProject == 1 ? this.version = '专业版' : ''
-                userss.company.packageEngineering == 1 ? this.version = '建筑工程版' : ''
-                userss.company.packageOa == 1 ? this.version = '旗舰版' : ''
-
                 console.log(this.version)
             }
 

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

@@ -187,10 +187,10 @@
                         this.routers.push({name: '查看日报',url: '/calendar',icon: 'description'})
                         if(this.user.companyId != '1071') { // 针对物奇公司去掉填写日报
                             this.routers.push({name: '填写日报',url: '/edit',icon: 'edit'})
-                        }
-                        // if (this.user.companyId == 817 || this.user.companyId == 7 || this.user.companyId == 10) {
+                            //物奇临时去掉按周填报
                             this.routers.push({name: '按周填报',url: '/weekEdit',icon: 'records'})
-                        // }
+                        }
+                        // this.routers.push({name: '按周填报',url: '/weekEdit',icon: 'records'})                        }
                     }
                     if(list[i].name == '待办任务') {
                         this.routers.push({