소스 검색

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

cs 2 년 전
부모
커밋
c30bb856a9
20개의 변경된 파일415개의 추가작업 그리고 180개의 파일을 삭제
  1. 98 2
      fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/controller/AuthRedirectController.java
  2. 2 6
      fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/controller/WeiXinCorpController.java
  3. 0 2
      fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/UserService.java
  4. 64 0
      fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/impl/ExpenseSheetServiceImpl.java
  5. 0 79
      fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/impl/UserServiceImpl.java
  6. 10 1
      fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/impl/WxCorpInfoServiceImpl.java
  7. 2 2
      fhKeeper/formulahousekeeper/management-platform/src/main/resources/application.yml
  8. 7 7
      fhKeeper/formulahousekeeper/octopus/src/views/customer/list.vue
  9. 2 2
      fhKeeper/formulahousekeeper/ops-platform/src/main/java/com/management/platform/controller/CompanyController.java
  10. 1 1
      fhKeeper/formulahousekeeper/ops-platform/src/main/java/com/management/platform/service/CompanyService.java
  11. 9 3
      fhKeeper/formulahousekeeper/ops-platform/src/main/java/com/management/platform/service/impl/CompanyServiceImpl.java
  12. BIN
      fhKeeper/formulahousekeeper/timesheet/src/assets/image/qiyeweix.png
  13. 1 0
      fhKeeper/formulahousekeeper/timesheet/src/assets/js/wwLogin.js
  14. 5 4
      fhKeeper/formulahousekeeper/timesheet/src/components/select.vue
  15. 7 2
      fhKeeper/formulahousekeeper/timesheet/src/views/Home.vue
  16. 147 45
      fhKeeper/formulahousekeeper/timesheet/src/views/Login.vue
  17. 21 3
      fhKeeper/formulahousekeeper/timesheet/src/views/project/info.vue
  18. 4 0
      fhKeeper/formulahousekeeper/timesheet/src/views/project/summary.vue
  19. 34 20
      fhKeeper/formulahousekeeper/timesheet/src/views/project/vueGantt.vue
  20. 1 1
      fhKeeper/formulahousekeeper/timesheet/src/views/team/index.vue

+ 98 - 2
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/controller/AuthRedirectController.java

@@ -141,9 +141,105 @@ public class AuthRedirectController {
             }
         }
         if (isMobile) {
-            redirecUrl = "http://mobworktime.ttkuaiban.com/#/" + router;
+            redirecUrl = "https://mobworktime.ttkuaiban.com/#/" + router;
         } else {
-            redirecUrl = "http://worktime.ttkuaiban.com/#/" + router;
+            redirecUrl = "https://worktime.ttkuaiban.com/#/" + router;
+        }
+        ModelAndView modelAndView = new ModelAndView(
+                new RedirectView(redirecUrl), reqParam);
+
+        return modelAndView;
+    }
+
+    @RequestMapping("/corpWXScanningAuth")
+    public ModelAndView scanningAuth(String auth_code, String state)throws Exception {
+        Map<String,Object> reqParam = new HashMap<String,Object>(16);
+        String userAgent = request.getHeader("User-Agent");
+        //获取设备类型
+        String deviceType = UserAgentUtils.getDeviceType(userAgent);
+        boolean isMobile = "MOBILE".equals(deviceType);
+        String url = WeiXinCorpController.GET_CORP_SCANNING_CODE_LOGININFO_URL.replace("PROVIDER_ACCESS_TOKEN",wxCorpInfoService.getProviderAccessToken());
+        HttpHeaders headers = new HttpHeaders();
+        RestTemplate restTemplate = new RestTemplate();
+        MediaType type = MediaType.parseMediaType("application/json; charset=UTF-8");
+        headers.setContentType(type);
+        headers.add("Accept", MediaType.APPLICATION_JSON.toString());
+        JSONObject ob = new JSONObject();
+        ob.put("auth_code", auth_code);
+        HttpEntity<JSONObject> Entity = new HttpEntity<>(ob, headers);
+        ResponseEntity<String> responseEntity = restTemplate.postForEntity(url, Entity, String.class);
+        String redirecUrl = null;
+        if (responseEntity.getStatusCode() == HttpStatus.OK) {
+            String resp = responseEntity.getBody();
+            System.err.println(resp);
+            JSONObject obj = JSONObject.parseObject(resp);
+            if (obj.getIntValue("errcode") == 0) {
+                JSONObject userInfo = obj.getJSONObject("user_info");
+                System.out.println(obj.toString());
+                String wxUserId = userInfo.getString("userid");
+                String openUserId = userInfo.getString("open_userid");
+                JSONObject corpInfo = obj.getJSONObject("corp_info");
+                String corpId = corpInfo.getString("corpid");
+                System.out.println("登录 wxUserId="+wxUserId+", openUserId="+openUserId);
+                List<User> userList = userMapper.selectList(new QueryWrapper<User>().eq("corpwx_userid", openUserId));
+                Integer companyId = 0;
+                if (userList.size() > 0) {
+                    //该用户已存在
+                    User curUser = userList.get(0);
+                    System.out.println("找到用户corpwxUserid=="+curUser.getCorpwxUserid());
+                    companyId = curUser.getCompanyId();
+                    if (curUser.getIsActive() == 1) {
+                        reqParam.put("userId", curUser.getId());
+                    } else {
+                        //提示账号已停用
+                        //reqParam.put("errorMsg", "您的账号已停用,无法登录");
+                        reqParam.put("errorMsg", MessageUtils.message("user.inactive"));
+                    }
+                } else {
+                    //使用UserId比对,之前有的老用户存的是UserId
+                    WxCorpInfo wxCorpInfo = wxCorpInfoMapper.selectById(corpId);
+                    if (wxCorpInfo == null) {
+                        reqParam.put("errorMsg", MessageUtils.message("user.accountNoExist"));
+                    } else {
+                        User curUser = userMapper.selectOne(new QueryWrapper<User>().eq("company_id", wxCorpInfo.getCompanyId()).eq("corpwx_userid", wxUserId));
+                        if (curUser == null) {
+//                    reqParam.put("errorMsg", MessageUtils.message("user.accountNoExist"));
+                            //用户不存在,去生成该用户
+                            if (wxCorpInfo.getSaasSyncContact() == 1) {
+                                curUser = wxCorpInfoService.generateUserInfo(wxCorpInfo.getCompanyId(), openUserId);
+                            }
+                        }
+                        if (curUser != null) {
+                            if (curUser.getIsActive() == 1) {
+                                companyId = curUser.getCompanyId();
+                                reqParam.put("userId", curUser.getId());
+                            } else {
+                                //提示账号已停用
+                                //reqParam.put("errorMsg", "您的账号已停用,无法登录");
+                                reqParam.put("errorMsg", MessageUtils.message("user.inactive"));
+                            }
+                        } else {
+                            System.err.println("==生成企业微信User失败==");
+                            reqParam.put("errorMsg", MessageUtils.message("user.accountNoExist"));
+                        }
+
+                    }
+                }
+                if (!StringUtils.isEmpty(state) && state.length() > 1) {
+                    reqParam.put("path", state);
+                }
+                String router = "login";
+                if (companyId > 0) {
+                    HashMap compExpireInfo = getCompExpireInfo(companyId);
+                    if (compExpireInfo != null) {
+                        //过期了
+                        router = "expire";
+                        reqParam.put("expDate", compExpireInfo.get("expDate"));
+                        reqParam.put("version", compExpireInfo.get("version"));
+                    }
+                }
+                redirecUrl = "https://worktime.ttkuaiban.com/#/" + router;
+            }
         }
         ModelAndView modelAndView = new ModelAndView(
                 new RedirectView(redirecUrl), reqParam);

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

@@ -82,6 +82,8 @@ public class WeiXinCorpController {
     public static final String GET_LIST_MEMB_AUTH = "https://qyapi.weixin.qq.com/cgi-bin/user/list_member_auth?access_token=ACCESS_TOKEN";
     //网页获取企业内部用户信息
     public static final String GET_CORP_INSIDE_USERINFO_URL = "https://qyapi.weixin.qq.com/cgi-bin/auth/getuserinfo?access_token=ACCESS_TOKEN&code=CODE";
+    //扫码获取企业用户信息
+    public static final String GET_CORP_SCANNING_CODE_LOGININFO_URL = "https://qyapi.weixin.qq.com/cgi-bin/service/get_login_info?access_token=PROVIDER_ACCESS_TOKEN";
     //获取员工打卡日报统计信息
     public static final String GET_CHECKIN_DAYDATA = "https://qyapi.weixin.qq.com/cgi-bin/checkin/getcheckin_daydata?access_token=ACCESS_TOKEN";
 
@@ -1848,12 +1850,6 @@ public class WeiXinCorpController {
         return msg;
     }
 
-    //企业微信用户扫码登录
-    @RequestMapping(value = "/corpWeiXinScanningCodeLogin", method = RequestMethod.GET)
-    public HttpRespMsg corpWeiXinScanningCodeLogin(String code) {
-       return userService.corpWeiXinScanningCodeLogin(code);
-    }
-
     //获取企业微信考勤打卡统计数据
     @RequestMapping("/getUserCheckInDayData")
     public HttpRespMsg getUserCheckInDayData(int companyId, String userId, String startDate, String endDate) {

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

@@ -75,6 +75,4 @@ public interface UserService extends IService<User> {
     HttpRespMsg loginAdminByThirdParty(String jobNumber, String token);
 
     HttpRespMsg importMonthCost(MultipartFile file, String ymonth, HttpServletRequest request);
-
-    HttpRespMsg corpWeiXinScanningCodeLogin(String code);
 }

+ 64 - 0
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/impl/ExpenseSheetServiceImpl.java

@@ -54,9 +54,13 @@ import java.util.stream.Collectors;
 @Service
 @Transactional
 public class ExpenseSheetServiceImpl extends ServiceImpl<ExpenseSheetMapper, ExpenseSheet> implements ExpenseSheetService {
+    @Resource
+    private HttpServletRequest request;
     @Resource
     private UserMapper userMapper;
     @Resource
+    private InformationMapper informationMapper;
+    @Resource
     private ExpenseSheetMapper expenseSheetMapper;
     @Resource
     private ExpenseItemService expenseItemService;
@@ -262,23 +266,83 @@ public class ExpenseSheetServiceImpl extends ServiceImpl<ExpenseSheetMapper, Exp
 
     @Override
     public HttpRespMsg approve(Integer id) {
+        String token = request.getHeader("TOKEN");
+        User user = userMapper.selectById(token);
         ExpenseSheet sheet = new ExpenseSheet();
         sheet.setId(id);
         sheet.setStatus(0);
         expenseSheetMapper.updateById(sheet);
+
+        sheet = expenseSheetMapper.selectById(id);
+        WxCorpInfo wxCorpInfo = wxCorpInfoMapper.selectOne(new QueryWrapper<WxCorpInfo>().eq("company_id", user.getCompanyId()));
+        if (wxCorpInfo != null) {
+            sendAuditResult(wxCorpInfo, user, sheet, null);
+        }
+        saveNotifyToApplier(sheet, user);
+
         return new HttpRespMsg();
     }
 
     @Override
     public HttpRespMsg deny(Integer id,String denyReason) {
+        String token = request.getHeader("TOKEN");
+        User user = userMapper.selectById(token);
         ExpenseSheet sheet = new ExpenseSheet();
         sheet.setId(id);
         sheet.setStatus(2);
         sheet.setDenyReason(denyReason);
         expenseSheetMapper.updateById(sheet);
+
+        //给填报人发送消息
+        sheet = expenseSheetMapper.selectById(id);
+        WxCorpInfo wxCorpInfo = wxCorpInfoMapper.selectOne(new QueryWrapper<WxCorpInfo>().eq("company_id", user.getCompanyId()));
+        if (wxCorpInfo != null) {
+            sendAuditResult(wxCorpInfo, user, sheet, denyReason);
+        }
+        saveNotifyToApplier(sheet, user);
+
         return new HttpRespMsg();
     }
 
+
+    //发送审核结果消息提醒
+    private void sendAuditResult(WxCorpInfo wxCorpInfo, User auditor, ExpenseSheet sheet, String denyReason) {
+        //推送到企业微信
+        StringBuilder stringBuilder = new StringBuilder();
+        DateTimeFormatter dateTimeFormatter = DateTimeFormatter.ofPattern("M月d日");
+        stringBuilder.append("$userName="+auditor.getCorpwxUserid()+"$")
+                .append(sheet.getStatus() == 0?"通过":"驳回")
+                .append("了您")
+                .append(dateTimeFormatter.format(sheet.getCreateDate()))
+                .append("的费用报销申请。");
+        if (sheet.getStatus() == 2) {
+            //驳回加原因
+            stringBuilder.append("原因: ").append(denyReason);
+        }
+
+        String ownerId = sheet.getOwnerId();
+        User owner = userMapper.selectById(ownerId);
+        wxCorpInfoService.sendWXCorpMsg(wxCorpInfo,owner.getCorpwxUserid(), stringBuilder.toString(), "expense",
+                sheet.getStatus() == 0?WxCorpInfoServiceImpl.TEXT_CARD_MSG_EXPENSE_AGREE:WxCorpInfoServiceImpl.TEXT_CARD_MSG_EXPENSE_DENY);
+
+    }
+
+
+    private void saveNotifyToApplier(ExpenseSheet sheet, User auditor) {
+        DateTimeFormatter dateTimeFormatter = DateTimeFormatter.ofPattern("M月d日");
+        String ownerId = sheet.getOwnerId();
+        User owner = userMapper.selectById(ownerId);
+        //系统内消息
+        Information information=new Information();
+        information.setUserId(owner.getId());
+        information.setTime(LocalDateTime.now());
+        information.setMsg("您"+dateTimeFormatter.format(sheet.getCreateDate()) + "费用报销申请审核"+(sheet.getStatus() == 0?"已通过":"已驳回")+", 审核人:"
+                +(auditor.getCorpwxUserid() != null ? ("$userName="+auditor.getCorpwxUserid()+"$"):auditor.getName()));
+        information.setType(3);//费用报销模块
+        information.setContent(sheet.getId()+"");
+        informationMapper.insert(information);
+    }
+
     @Override
     public HttpRespMsg importData(HttpServletRequest request,MultipartFile[] files) {
         HttpRespMsg msg = new HttpRespMsg();

+ 0 - 79
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/impl/UserServiceImpl.java

@@ -72,8 +72,6 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements Us
     private String providerSecret;
     public static final String GET_TOKEN_URL = "https://api.weixin.qq.com/sns/oauth2/access_token?appid=APPID&secret=SECRET&code=CODE&grant_type=authorization_code";
     public static final String GET_USERINFO_URL = "https://api.weixin.qq.com/sns/userinfo?access_token=accessToken&openid=openId&lang=zh_CN";
-    //扫码获取企业内部用户信息
-    public static final String GET_CORP_SCANNING_CODE_LOGININFO_URL = " https://qyapi.weixin.qq.com/cgi-bin/service/get_login_info?access_token=PROVIDER_ACCESS_TOKEN";
 
     //用于控制线程锁
     public static HashMap<String, CorpwxJobResult> corpwxJobCenter = new HashMap();
@@ -418,83 +416,6 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements Us
         return msg;
     }
 
-    @Override
-    public HttpRespMsg corpWeiXinScanningCodeLogin(String code) {
-        HttpRespMsg msg = new HttpRespMsg();
-
-        String url = null;
-        try {
-            url = GET_CORP_SCANNING_CODE_LOGININFO_URL.replace("PROVIDER_ACCESS_TOKEN", getProviderAccessToken());
-        } catch (Exception exception) {
-            exception.printStackTrace();
-            msg.setError(exception.getMessage());
-            return msg;
-        }
-        HttpHeaders headers = new HttpHeaders();
-        RestTemplate restTemplate = new RestTemplate();
-        MediaType type = MediaType.parseMediaType("application/json; charset=UTF-8");
-        headers.setContentType(type);
-        headers.add("Accept", MediaType.APPLICATION_JSON.toString());
-        JSONObject reqParam = new JSONObject();
-        reqParam.put("auth_code", code);
-        HttpEntity<JSONObject> Entity = new HttpEntity<>(reqParam, headers);
-        ResponseEntity<String> responseEntity = restTemplate.postForEntity(url, Entity, String.class);
-        if (responseEntity.getStatusCode() == HttpStatus.OK) {
-            String resp = responseEntity.getBody();
-            System.err.println(resp);
-            JSONObject obj = JSONObject.parseObject(resp);
-            if (obj.getIntValue("errcode") == 0) {
-                JSONObject userInfo = obj.getJSONObject("user_info");
-                String wxUserId = userInfo.getString("open_userid");
-                List<User> userList = userMapper.selectList(new QueryWrapper<User>().eq("corpwx_userid", wxUserId));
-                if (userList.size() > 0) {
-                    //该用户已存在
-                    User curUser = userList.get(0);
-
-                    //写死进行测试
-//            if (curUser.getName().equals("屈跃庭")) {
-//                curUser = userMapper.selectById("7913998191517310976");
-//            }
-                    Company company = companyMapper.selectOne(new QueryWrapper<Company>().eq("id", curUser.getCompanyId()));
-                    WxCorpInfo info = wxCorpInfoMapper.selectOne(new QueryWrapper<WxCorpInfo>().eq("company_id", curUser.getCompanyId()));
-                    curUser.setUserNameNeedTranslate(info.getSaasSyncContact());
-                    //检测密码正确时
-                    UserVO userVO = new UserVO().setCompanyName(company.getCompanyName());
-                    userVO.setCompany(company);
-                    BeanUtils.copyProperties(curUser, userVO);
-                    if (userVO.getRoleId() == null || userVO.getRoleId() == 0) {
-                        //msg.setError("请先联系管理员为您分配角色");
-                        msg.setError(MessageUtils.message("user.noRole"));
-                        return msg;
-                    }
-                    //还要多返回一个公司名字
-                    userVO.setPassword("");
-                    LocalDateTime remainingTime = company.getExpirationDate() == null ? LocalDateTime.now() : company.getExpirationDate();
-                    userVO.setRemainingTime(remainingTime.toInstant(ZoneOffset.of("+8")).toEpochMilli() -
-                            LocalDateTime.now().toInstant(ZoneOffset.of("+8")).toEpochMilli());
-                    //检测是否是项目经理,项目经理有审核功能权限
-                    userVO.setLeader(judgeIsLeader(userVO.getId()));
-                    userVO.setTimeType(timeTypeMapper.selectById(company.getId()));
-                    List<Department> manageDeptList = departmentMapper.selectList(new QueryWrapper<Department>().eq("manager_id", userVO.getId()));
-                    List<Integer> deptIds = manageDeptList.stream().map(Department::getDepartmentId).collect(Collectors.toList());
-                    int num = 0;
-                    if (deptIds.size() > 0) {
-                        num = auditWorkflowTimeSettingMapper.selectCount(new QueryWrapper<AuditWorkflowTimeSetting>().in("audit_dept_id", deptIds));
-                    }
-                    userVO.setHasAuditDept(num>0);
-                    setUserRoleMenu(userVO);
-                    msg.data = userVO;
-                } else {
-                    //msg.setError("该用户尚未绑定企业微信,需要通过账号密码登录");
-                    msg.setError(MessageUtils.message("wx.bindError"));
-                }
-            }else{
-                System.err.println("====================用户信息获取获取失败======================");
-            }
-        }
-        return msg;
-    }
-
 
     public void setUserRoleMenu(UserVO user) {
         Integer roleId = user.getRoleId();

+ 10 - 1
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/impl/WxCorpInfoServiceImpl.java

@@ -76,7 +76,8 @@ public class WxCorpInfoServiceImpl extends ServiceImpl<WxCorpInfoMapper, WxCorpI
     public static final int TEXT_CARD_MSG_REPORT_DENY = 10;//日报驳回
     public static final int TEXT_CARD_MSG_REPORT_AGREE = 11; //日报审核通过
 
-    public static final HashMap CURSOR=new HashMap();
+    public static final int TEXT_CARD_MSG_EXPENSE_AGREE = 21;//费用报销审核通过
+    public static final int TEXT_CARD_MSG_EXPENSE_DENY = 22;//费用报销审核驳回
 
     @Value("${suitId}")
     private String suitId;
@@ -269,6 +270,14 @@ public class WxCorpInfoServiceImpl extends ServiceImpl<WxCorpInfoMapper, WxCorpI
                     } else if (msgType.equals(TEXT_CARD_MSG_BUSTRIP_DENY)) {
                         title = "出差审核驳回";
                     }
+                } else if ("expense".equals(pageRouter)) {
+                    //费用报销
+                    title = "费用报销通知";
+                    if (msgType.equals(TEXT_CARD_MSG_EXPENSE_AGREE)) {
+                        title = "费用报销审核通过";
+                    } else if (msgType.equals(TEXT_CARD_MSG_EXPENSE_DENY)) {
+                        title = "费用报销审核驳回";
+                    }
                 }
             }
             cardJson.put("title", title);

+ 2 - 2
fhKeeper/formulahousekeeper/management-platform/src/main/resources/application.yml

@@ -15,7 +15,7 @@ spring:
       location: C:/upload/
   datasource:
     driver-class-name: com.mysql.cj.jdbc.Driver
-    url: jdbc:mysql://47.101.180.183:3306/man_dev?useUnicode=true&characterEncoding=utf8&serverTimezone=GMT%2B8&rewriteBatchedStatements=true&useSSL=false
+    url: jdbc:mysql://47.101.180.183:3306/man_mld?useUnicode=true&characterEncoding=utf8&serverTimezone=GMT%2B8&rewriteBatchedStatements=true&useSSL=false
     username: root
     password: HuoshiDB@2022
     hikari:
@@ -131,7 +131,7 @@ referer:
     - mldworktime.ttkuaiban.com
     - gs.farben.com.cn
     - 47.101.180.183
-excludeUrls: /wxcorp/*,/wxcorp/*/*,/dingding/*,/error,/testClient,/corpWXAuth,/corpInsideWXAuth,/wx-corp-info/*,/clean/*,/innerRoles/*,/report/getReportListByToken,/report/getProcessErrorData,/project/synchronizationProject
+excludeUrls: /wxcorp/*,/wxcorp/*/*,/dingding/*,/error,/testClient,/corpWXAuth,/corpWXScanningAuth,/corpInsideWXAuth,/wx-corp-info/*,/clean/*,/innerRoles/*,/report/getReportListByToken,/report/getProcessErrorData,/project/synchronizationProject
 
 #企业微信相关参数
 suitId: ww4e237fd6abb635af

+ 7 - 7
fhKeeper/formulahousekeeper/octopus/src/views/customer/list.vue

@@ -66,7 +66,7 @@
                     <el-button size="mini"  @click="editClick('B', scope.row)">修改有效期</el-button>
                     <el-button size="mini"  @click="editClick('F', scope.row)" :disabled="!(scope.row.dingdingCorpid || scope.row.wxCorpid)">考勤同步设置</el-button>
                     <el-button size="mini"  @click="editClick('C', scope.row)">修改版本</el-button>
-                    <el-button size="mini"  @click="editClick('D', scope.row)" :disabled="scope.row.setMeal">设为已签约</el-button>
+                    <el-button size="mini"  @click="editClick('D', scope.row)">{{scope.row.setMeal ? '设为未签约' : '设为已签约'}}</el-button>
                     <el-button size="mini"  @click="editClick('G', scope.row)">其他设置</el-button>
                     <el-button size="mini"  @click="editClick('H', scope.row)">报表配置</el-button>
                     <el-button size="mini"  @click="editClick('E', scope.row)" v-loading="dingdingSync" v-if="scope.row.dingdingCorpid">同步钉钉人员</el-button>
@@ -159,15 +159,15 @@
             </span>
         </el-dialog>
         <!-- 设为已签约 -->
-        <el-dialog v-if="editDialogD" :visible.sync="editDialogD" title="设为已签约">
+        <el-dialog v-if="editDialogD" :visible.sync="editDialogD" :title="dialogData.setMeal ? '设为未签约' : '设为已签约'">
             <el-form label-width="150px">
                 <el-form-item label="企业名称">{{dialogData.companyName}}</el-form-item>
                 <el-form-item label="当前是否签约">{{dialogData.setMeal ? "已签约" : "未签约"}}</el-form-item>
-                <el-form-item label="即将设置为">已签约</el-form-item>
+                <el-form-item label="即将设置为">{{dialogData.setMeal ? "未签约" : "已签约"}}</el-form-item>
             </el-form>
             <span slot="footer" class="dialog-footer">
                 <el-button @click="editDialogD = false">取 消</el-button>
-                <el-button type="primary" @click="ConfirmD()">确 定</el-button>
+                <el-button type="primary" @click="ConfirmD(dialogData.setMeal)">确 定</el-button>
             </span>
         </el-dialog>
         <!-- 考勤同步 -->
@@ -567,15 +567,15 @@
                 });
             },
             // 设为已签约
-            ConfirmD(){
+            ConfirmD(setMeal){
                 this.listLoading = true;
-                this.http.post('/company/setMeal', { companyId:this.dialogData.id },
+                this.http.post('/company/setMeal', { companyId:this.dialogData.id,meal: setMeal ? 0 : 1 },
                 res => {
                     this.listLoading = false;
                     if (res.code == "ok") {
                         this.editDialogD = false
                         this.$message({
-                            message: "签约成功",
+                            message: setMeal ? "取消签约成功" : "签约成功",
                             type: "success"
                         })
                         this.getList()

+ 2 - 2
fhKeeper/formulahousekeeper/ops-platform/src/main/java/com/management/platform/controller/CompanyController.java

@@ -124,8 +124,8 @@ public class CompanyController {
      * @return
      */
     @RequestMapping("/setMeal")
-    public HttpRespMsg setMeal(Integer companyId) {
-        return companyService.setMeal(companyId);
+    public HttpRespMsg setMeal(Integer companyId,Integer meal) {
+        return companyService.setMeal(companyId,meal);
     }
 
     /**

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

@@ -19,7 +19,7 @@ public interface CompanyService extends IService<Company> {
 
     HttpRespMsg addMembCount(Integer companyId, int addCount);
 
-    HttpRespMsg setMeal(Integer companyId);
+    HttpRespMsg setMeal(Integer companyId,Integer meal);
 
     HttpRespMsg setExpDate(Integer companyId, String date);
 

+ 9 - 3
fhKeeper/formulahousekeeper/ops-platform/src/main/java/com/management/platform/service/impl/CompanyServiceImpl.java

@@ -84,14 +84,20 @@ public class CompanyServiceImpl extends ServiceImpl<CompanyMapper, Company> impl
     }
 
     @Override
-    public HttpRespMsg setMeal(Integer companyId) {
+    public HttpRespMsg setMeal(Integer companyId,Integer meal) {
         HttpRespMsg msg = new HttpRespMsg();
         Company company = new Company();
         company.setId(companyId);
-        company.setSetMeal(1);
+        company.setSetMeal(meal);
         companyMapper.updateById(company);
         String name = companyMapper.selectById(companyId).getCompanyName();
-        saveLog("设置["+name+"]为已签约");
+        switch (meal){
+            case 0:saveLog("["+name+"]取消签约");
+            break;
+            case 1:saveLog("设置["+name+"]为已签约");
+            break;
+        }
+
         return msg;
     }
 

BIN
fhKeeper/formulahousekeeper/timesheet/src/assets/image/qiyeweix.png


파일 크기가 너무 크기때문에 변경 상태를 표시하지 않습니다.
+ 1 - 0
fhKeeper/formulahousekeeper/timesheet/src/assets/js/wwLogin.js


+ 5 - 4
fhKeeper/formulahousekeeper/timesheet/src/components/select.vue

@@ -264,10 +264,11 @@ export default {
                     }
                 }
             }
-            if(this.multiSelect) {
+            console.log(this.options, this.subjectId)
+            if(this.multiSelect) { 
                 for(var i in this.options) {
-                    for(var j in this.optionsOId) {
-                        if( this.options[i].auditorId == this.optionsOId[j] || this.options[i].id == this.optionsOId[j]) {
+                    for(var j in this.subjectId) {
+                        if(this.options[i].id == this.subjectId[j] || this.options[i].auditorId == this.subjectId[j]) {
                             this.multiSelectList.push(this.options[i])
                             this.options[i].flg = true
                         }
@@ -275,7 +276,7 @@ export default {
                 }
             }
         }
-        console.log(this.subject)
+        console.log(this.subject, this.subjectId)
         this.dailyListIndex = this.idx
     },
     methods: {

+ 7 - 2
fhKeeper/formulahousekeeper/timesheet/src/views/Home.vue

@@ -112,7 +112,7 @@
                         <!-- <el-dropdown-item disabled ><span style="font-size:12px;"><i class="el-icon-view" ></i>{{roleArray[user.role]}}</span></el-dropdown-item> -->
                         <el-dropdown-item disabled ><span style="font-size:12px;"><i class="el-icon-view" ></i>{{user.roleName}}</span></el-dropdown-item>
                         <el-dropdown-item disabled ><span style="font-size:12px;"><i class="el-icon-medal" v-if="user.jobNumber"></i>{{user.jobNumber}}</span></el-dropdown-item>
-                        <el-dropdown-item @click.native="reset" v-if="!isCorpWX">{{$t('other.changeThePassword')}}</el-dropdown-item>
+                        <el-dropdown-item @click.native="reset" v-if="user.userNameNeedTranslate != 1">{{$t('other.changeThePassword')}}</el-dropdown-item>
                         <!-- <el-dropdown-item @click.native="editInfoOpen">修改信息</el-dropdown-item> -->
                         <el-dropdown-item divided @click.native="logout" v-if="!isCorpWX" >{{$t('other.launchTheLogin')}}</el-dropdown-item>
                     </el-dropdown-menu>
@@ -547,12 +547,17 @@
 
             // 获取企业微信的参数
             agentConfig() {
+                var isCorpWX = true
+                var ua = navigator.userAgent.toLowerCase();
+                if (ua.indexOf("wxwork") > 0) {
+                    isCorpWX = false;
+                } 
                 var curUrl = location.href.split("#")[0];
                 this.http.post("/wxcorp/getCorpWXConfig", {url: curUrl, token: this.user.id}, (res) => {
                     if (res.code == "ok") {
                         wx.config({ 
                         beta: true,
-                        debug: false, // 开启调试模式,调用的所有api的返回值会在客户端alert出来,若要查看传入的参数,可以在pc端打开,参数信息会通过log打出,仅在pc端时才会打印。
+                        debug: isCorpWX, // 开启调试模式,调用的所有api的返回值会在客户端alert出来,若要查看传入的参数,可以在pc端打开,参数信息会通过log打出,仅在pc端时才会打印。
                         appId: res.data.appid, // 必填,公众号的唯一标识 
                         timestamp: res.data.timestamp, // 必填,生成签名的时间戳 
                         nonceStr: res.data.noncestr, // 必填,生成签名的随机串 

+ 147 - 45
fhKeeper/formulahousekeeper/timesheet/src/views/Login.vue

@@ -1,53 +1,73 @@
 <template>
-    <div class="login">
-        <div class="login-par">
-            <el-form :model="ruleForm" :rules="rules" ref="ruleForm" label-position="left" label-width="0px" class="demo-ruleForm login-container">
-                <div class="login-logo">
-                    <img src="../assets/image/login_logo.png" style="width:80px;height:80px;"/>
-                </div>
-                <h3 class="title">{{ $t('workingHoursHousekeeper') }}</h3>
-                <el-form-item class="login-input" prop="username">
-                    <el-input type="text" v-model="ruleForm.username" autocomplete="off" :placeholder="$t('zhang-hao-shou-ji-hao')" clearable prefix-icon="el-icon-user-solid"></el-input>
-                </el-form-item>
-                <el-form-item class="login-input" prop="password">
-                    <el-input type="password" v-model="ruleForm.password" @keyup.enter.native="handleSubmit" autocomplete="off" :placeholder="$t('mi-ma')" show-password prefix-icon="el-icon-lock"></el-input>
-                </el-form-item>
-                <el-form-item class="login-button" style="width:100%;">
-                    <el-button type="primary" style="width:100%;" @click.native.prevent="handleSubmit" :loading="logining">{{ $t('login') }}</el-button>
-                </el-form-item>
-                <div class="toRegister">
-                    <el-link type="primary" class="btn" style="float:left;" :underline="false">{{ $t('lian-xi-ke-fu') }}
-                        <div class="service">
-                            <p style="color: #333">{{ $t('sao-ma-jia-ke-fu-wei-xin') }}</p>
-                            <img src="../assets/image/code.jpg">
-                            <p><span style="color: #333">QQ:</span><span id="QQ">3052894409</span></p>
+    <div>
+        <div class="login" v-if="!isCorpWX">
+            <div class="login-par">
+                <el-form :model="ruleForm" :rules="rules" ref="ruleForm" label-position="left" label-width="0px" class="demo-ruleForm login-container">
+                    <div class="login-logo">
+                        <img src="../assets/image/login_logo.png" style="width:80px;height:80px;"/>
+                    </div>
+                    <h3 class="title">{{ $t('workingHoursHousekeeper') }}</h3>
+                    <el-form-item class="login-input" prop="username">
+                        <el-input type="text" v-model="ruleForm.username" autocomplete="off" :placeholder="$t('zhang-hao-shou-ji-hao')" clearable prefix-icon="el-icon-user-solid"></el-input>
+                    </el-form-item>
+                    <el-form-item class="login-input" prop="password">
+                        <el-input type="password" v-model="ruleForm.password" @keyup.enter.native="handleSubmit" autocomplete="off" :placeholder="$t('mi-ma')" show-password prefix-icon="el-icon-lock"></el-input>
+                    </el-form-item>
+                    <el-form-item class="login-button" style="width:100%;">
+                        <el-button type="primary" style="width:100%;" @click.native.prevent="handleSubmit" :loading="logining">{{ $t('login') }}</el-button>
+                    </el-form-item>
+                    <div class="additional">
+                        <el-divider content-position="center">或</el-divider>
+                    </div>
+                    <div class="externalLanding">
+                        <div class="externalLanding_img" @click="wxworkCli()">
+                            <img src="../assets/image/qiyeweix.png" alt="">
                         </div>
-                    </el-link>
-                    <el-link type="primary" style="margin-right:5px;" @click="dialogVisible=true" :underline="false">
-                        {{ $t('shi-yong-shuo-ming') }} </el-link>
-                    <el-link type="primary" v-if="!isCorpWX" @click="jumpTo" :underline="false">{{ $t('qi-ye-zhu-ce') }}</el-link>
+                    </div>
+                    <div class="toRegister">
+                        <el-link type="primary" class="btn" style="float:left;" :underline="false">{{ $t('lian-xi-ke-fu') }}
+                            <div class="service">
+                                <p style="color: #333">{{ $t('sao-ma-jia-ke-fu-wei-xin') }}</p>
+                                <img src="../assets/image/code.jpg">
+                                <p><span style="color: #333">QQ:</span><span id="QQ">3052894409</span></p>
+                            </div>
+                        </el-link>
+                        <el-link type="primary" style="margin-right:5px;" @click="dialogVisible=true" :underline="false">
+                            {{ $t('shi-yong-shuo-ming') }} </el-link>
+                        <el-link type="primary" v-if="!isCorpWX" @click="jumpTo" :underline="false">{{ $t('qi-ye-zhu-ce') }}</el-link>
+                    </div>
+                </el-form>
+            </div>
+            <el-dialog :title="$t('shi-yong-shuo-ming')" :visible.sync="dialogVisible" width="500px">
+                <p><a style="color:#409EFF;text-decoration:none" href="upload/工时管家使用说明_基础版.docx" download="工时管家使用说明_基础版.docx" 
+                            target="_blank">工时管家使用说明_基础版.docx</a></p>
+                <p><a style="color:#409EFF;text-decoration:none" href="upload/工时管家使用说明_项目管理专业版.docx" download="工时管家使用说明_项目管理专业版.docx" 
+                            target="_blank">工时管家使用说明_项目管理专业版.docx</a></p>
+                <p><a style="color:#409EFF;text-decoration:none" href="upload/工时管家使用说明_建筑工程专业版.docx" download="工时管家使用说明_建筑工程专业版.docx" 
+                            target="_blank">工时管家使用说明_建筑工程专业版.docx</a></p>
+                <!-- <p><a style="color:#409EFF;text-decoration:none" href="upload/工时管家使用说明_项目经理.docx" download="工时管家使用说明_项目经理.docx" 
+                            target="_blank">工时管家使用说明_项目经理.docx</a></p>
+                <p><a style="color:#409EFF;text-decoration:none" href="upload/工时管家使用说明_普通员工.docx" download="工时管家使用说明_普通员工.docx" 
+                            target="_blank">工时管家使用说明_普通员工.docx</a></p> -->
+                
+            </el-dialog>
+            <el-dialog title="企业微信扫码登陆" :visible.sync="wxworkFlg" width="500px">
+                <div>
+                    <div id="wxcode"></div>
                 </div>
-            </el-form>
+            </el-dialog>
+        </div>
+        <!-- 企业微信的话 -->
+        <div class="qiweix" v-if="isCorpWX">
+            正在进入系统...
         </div>
-        <el-dialog :title="$t('shi-yong-shuo-ming')" :visible.sync="dialogVisible" width="500px">
-            <p><a style="color:#409EFF;text-decoration:none" href="upload/工时管家使用说明_基础版.docx" download="工时管家使用说明_基础版.docx" 
-                        target="_blank">工时管家使用说明_基础版.docx</a></p>
-            <p><a style="color:#409EFF;text-decoration:none" href="upload/工时管家使用说明_项目管理专业版.docx" download="工时管家使用说明_项目管理专业版.docx" 
-                        target="_blank">工时管家使用说明_项目管理专业版.docx</a></p>
-            <p><a style="color:#409EFF;text-decoration:none" href="upload/工时管家使用说明_建筑工程专业版.docx" download="工时管家使用说明_建筑工程专业版.docx" 
-                        target="_blank">工时管家使用说明_建筑工程专业版.docx</a></p>
-            <!-- <p><a style="color:#409EFF;text-decoration:none" href="upload/工时管家使用说明_项目经理.docx" download="工时管家使用说明_项目经理.docx" 
-                        target="_blank">工时管家使用说明_项目经理.docx</a></p>
-            <p><a style="color:#409EFF;text-decoration:none" href="upload/工时管家使用说明_普通员工.docx" download="工时管家使用说明_普通员工.docx" 
-                        target="_blank">工时管家使用说明_普通员工.docx</a></p> -->
-            
-        </el-dialog>
     </div>
 </template>
 
 <script>
     import * as dd from 'dingtalk-jsapi';
     import "../permissions.js"
+    import WxLogin from "../assets/js/wwLogin.js"
     export default {
         inject:['reloads'],
         data() {
@@ -63,9 +83,17 @@
                 rules: {
                     username: [{ required: true, message: this.$t('peaseenterthe'), trigger: 'blur' },],
                     password: [{ required: true, message: this.$t('peaseenterthe'), trigger: 'blur' },]
-                }
+                },
+                wxworkFlg: false
             };
         },
+        watch: {
+            $route(to) {
+				if (to.query.code) {
+					this.getStaffInfo(to.query.code)
+				}
+			}
+        },
         created() {
             // this.langChange()
             if (localStorage.userInfo != null) {
@@ -82,13 +110,14 @@
             }
         },
         mounted() {
+            // this.wxworkCli()
             var ua = navigator.userAgent.toLowerCase();
             if (ua.indexOf("wxwork") > 0) {
                 this.isCorpWX = true;
             } 
+            let href = window.location.href;
             if (this.isCorpWX) {
                 //企业微信环境下,尝试自动登录
-                let href = window.location.href;
                 //判断企业微信,是否存在授权
                 //尝试自动登录
                 if (href.indexOf('hasTriedAutoLogin') == -1) {
@@ -124,7 +153,19 @@
                     }
                 }
             } else {
-                if (localStorage.userInfo != null) {
+                //浏览器上使用扫码登录
+                if (href.indexOf("userId") > 0) {
+                    //后台经过验证后,重定向过来带上了userId
+                    var loginUserId = href.substring(href.indexOf("userId=")+"userId=".length);
+                    if (loginUserId.includes('#/')) {
+                        loginUserId = loginUserId.substring(0, loginUserId.indexOf('#/'));
+                    }
+                    var path = null;
+                    if (href.indexOf('path') > 0) {
+                        path = href.split('path=')[1].split('&')[0];
+                    }
+                    this.loginByUserId(loginUserId, path);
+                } else if (localStorage.userInfo != null) {
                     var user = JSON.parse(localStorage.userInfo);
                     if (user.company.packageSimple == 1) {
                         //简易模式,直接进入工时统计表
@@ -176,6 +217,24 @@
             }
         },
         methods: {
+            wxworkCli() {
+                // this.wxworkFlg = true
+                // this.$nextTick(()=>{
+                //     var obj = new WxLogin({
+                //         id: 'wxcode', // 登录页面显示二维码的容器id
+                //         appid: 'wwf11426cf618e1703', // 企业微信的CorpID,在企业微信管理端查看
+                //         redirect_uri: encodeURIComponent('http://localhost:10086/#/login'), // 重定向的地址,需要进行encode
+                //         usertype: 'member'
+                //     })
+                // })
+                var appId = "wwf11426cf618e1703";//企业微信第三方的SUIT ID
+                var url = "https://worktime.ttkuaiban.com/api/corpWXScanningAuth";//授权回调页面
+                var weixinUrl=`https://open.work.weixin.qq.com/wwopen/sso/3rd_qrConnect?appid=${appId}&redirect_uri=${url}&state=0&usertype=member`;
+                window.location.href = weixinUrl;
+            },
+            getStaffInfo() {
+                console.log('执行了没')
+            },
             setlangChange() {
                 localStorage.setItem("lang", 'en')
             },
@@ -251,7 +310,7 @@
             },
             tryAutoLogin() {
                 var appId = "ww4e237fd6abb635af";//企业微信第三方的SUIT ID
-                var url = "http://worktime.ttkuaiban.com/api/corpWXAuth";//授权回调页面
+                var url = "https://worktime.ttkuaiban.com/api/corpWXAuth";//授权回调页面
                 var weixinUrl="https://open.weixin.qq.com/connect/oauth2/authorize?appid="+appId+"&redirect_uri="+encodeURI(url)+"&response_type=code&scope=snsapi_base&state=1#wechat_redirect";
                 window.location.href = weixinUrl;
             },
@@ -268,6 +327,14 @@
                                     } else {
                                         this.$router.push({ path: user.moduleList[0].path })
                                     }
+                                    if (!path) {
+                                        path = user.moduleList[0].path;
+                                    }
+                                    //去掉链接上存在的参数
+                                    if (location.href.indexOf("?")>0) {
+                                        var newHref = location.href.split("?")[0] + '#' + (path.indexOf('/')>-1?path:('/'+path));
+                                        location.href = newHref;
+                                    }
                                 }
                             } else {
                                 this.$message({
@@ -429,6 +496,41 @@
 </script>
 
 <style lang="scss" scoped>
+    .qiweix {
+        width: 100%;
+        display: flex;
+        justify-content: center;
+        padding: 50px 0;
+        font-size: 40px;
+        color: #505458;
+    }
+    .additional {
+        width: 100%;
+        text-align: center;
+        padding: 20px 0;
+        color: #505458;
+    }
+    .externalLanding {
+        width: 100%;
+        display: flex;
+        justify-content: center;
+        .externalLanding_img {
+            width: 30px;
+            height: 30px;
+            border: 1px solid #409EFF;
+            border-radius: 50%;
+            position: relative;
+            overflow: hidden;
+            cursor: pointer;
+            display: flex;
+            justify-content: center;
+            align-items: center;
+            img {
+                width: 80%;
+                height: 80%;
+            }
+        }
+    }
     .login {
         height: 100%;
         .login-par {
@@ -449,7 +551,7 @@
                 -moz-border-radius: 5px;
                 background-clip: padding-box;
                 width: 315px;
-                height: 380px;
+                // height: 380px;
                 padding: 25px 35px 25px 35px;
                 background: #fff;
                 border: 1px solid #eaeaea;

+ 21 - 3
fhKeeper/formulahousekeeper/timesheet/src/views/project/info.vue

@@ -448,15 +448,17 @@
         <el-dialog :title="$t('editParticipants')" v-if="pVisible" :visible.sync="pVisible" :close-on-click-modal="false" customClass="customWidth" width="600px">
             <el-form ref="participForm" :model="addForm" :rules="rules" label-width="120px">
                 <el-form-item :label="$t('Allparticipants')">
-                    <el-select v-model="addForm.userId" multiple filterable :placeholder="$t('defaultText.pleaseChoose')" style="width:100%;" @change="changeParticipator">
+                    <el-select v-model="addForm.userId" multiple filterable :placeholder="$t('defaultText.pleaseChoose')" style="width:100%;" @change="changeParticipator" v-if="user.userNameNeedTranslate != 1">
                         <el-option v-for="item in users" :key="item.id" :label="item.name" :value="item.id"></el-option>
                     </el-select>
+
+                    <selectCat v-if="user.userNameNeedTranslate == 1" :multiSelect="true" :widthStr="'430'" :size="'medium'" :subject="users" :subjectId="addForm.userId" :distinction="'12'" @selectCal="selectCal"></selectCat>
                 </el-form-item>
                 <el-form-item :label="$t('projectmanager')" >
                     <el-select v-if="user.userNameNeedTranslate != 1" v-model="addForm.inchargerId"  filterable :placeholder="$t('defaultText.pleaseChoose')" style="width:100%;" >
                         <el-option v-for="item in project.participationList" :key="item.id" :label="item.name" :value="item.id"></el-option>
                     </el-select>
-                    <selectCat v-if="user.userNameNeedTranslate == 1" :size="'mini'" :subject="project.participationList" :subjectId="addForm.inchargerId" :distinction="'1'" @selectCal="selectCal"></selectCat>
+                    <selectCat v-if="user.userNameNeedTranslate == 1" :widthStr="'430'" :size="'medium'" :subject="project.participationList" :subjectId="addForm.inchargerId" :distinction="'1'" @selectCal="selectCal"></selectCat>
                 </el-form-item>
             </el-form>
             <div slot="footer" class="dialog-footer">
@@ -469,9 +471,11 @@
         <el-dialog :title="$t('addingParticipant')" v-if="addMembVisible" :visible.sync="addMembVisible" :close-on-click-modal="false" customClass="customWidth" width="600px">
             <el-form ref="addMembForm" :model="addMembForm"  label-width="120px">
                 <el-form-item :label="$t('addAdding')">
-                    <el-select v-model="addMembForm.userId" multiple filterable :placeholder="$t('defaultText.pleaseChoose')" style="width:100%;" >
+                    <el-select v-model="addMembForm.userId" multiple filterable :placeholder="$t('defaultText.pleaseChoose')" style="width:100%;" v-if="user.userNameNeedTranslate != 1">
                         <el-option v-for="item in users" :key="item.id" :label="item.name" :value="item.id"></el-option>
                     </el-select>
+
+                    <selectCat v-if="user.userNameNeedTranslate == 1" :multiSelect="true" :widthStr="'430'" :size="'medium'" :subject="users" :subjectId="addMembForm.userId" :distinction="'13'" @selectCal="selectCal"></selectCat>
                 </el-form-item>
             </el-form>
             <div slot="footer" class="dialog-footer">
@@ -1998,6 +2002,20 @@
                 } else if(obj.distinction == '3') {
                     let userList = obj.id
                     this.curProfessionRow.membList[obj.other].membId = userList
+                } else if(obj.distinction == '12') {
+                    let arrList = obj.arrUserList
+                    let arr = []
+                    for(var i in arrList) {
+                        arr.push(arrList[i].id)
+                    }
+                    this.addForm.userId = arr
+                } else if(obj.distinction == '13') {
+                    let arrList = obj.arrUserList
+                    let arr = []
+                    for(var i in arrList) {
+                        arr.push(arrList[i].id)
+                    }
+                    this.addMembForm.userId = arr
                 }
             }
         },

+ 4 - 0
fhKeeper/formulahousekeeper/timesheet/src/views/project/summary.vue

@@ -202,6 +202,7 @@
                               top: "center"
                             },
                             toolbox: {
+                                right: 25,
                                 show: true,
                                 feature:{
                                     saveAsImage:{
@@ -296,6 +297,7 @@
                               top: "center"
                             },
                             toolbox: {
+                                right: 25,
                                 show: true,
                                 feature:{
                                     saveAsImage:{
@@ -373,6 +375,7 @@
                               top: "center"
                             },
                             toolbox: {
+                                right: 25,
                                 show: true,
                                 feature:{
                                     saveAsImage:{
@@ -501,6 +504,7 @@
                       top: "center"
                     },
                     toolbox: {
+                        right: 25,
                         show: true,
                         feature:{
                             saveAsImage:{

+ 34 - 20
fhKeeper/formulahousekeeper/timesheet/src/views/project/vueGantt.vue

@@ -74,7 +74,11 @@ export default {
       if(endDate) {
         let biaoto = item.label.split(' ')[0]
         if(biaoto == value.end_date) {
-          // return value.text
+          if(value.text.indexOf('/') != '-1') {
+            return value.text.split('/')[1]
+          } else {
+            return value.text
+          }
         }
       }
     }
@@ -97,6 +101,8 @@ export default {
     allDataList = this.getdiffdate(this.valueDate[0], this.valueDate[1])
     this.combination(dataList, allDataList)
     // 递归加颜色
+    console.log(this.tasks.data, '芜湖')
+
     this.treeDataList = this.recursive(this.tasks.data);
 
     // this.treeDataList = this.integrationTree(this.tasks.data)
@@ -143,8 +149,7 @@ export default {
             }
             if(data[i].end_date) {
               let day = this.dayjs(data[i].end_date).diff(data[i].start_date, 'day') // 和并多少行
-              let column = this.dayjs(data[i].end_date).diff(this.valueDateList[0], 'day') // 从多少列开始
-              console.log(day)
+              let column = +this.dayjs(data[i].end_date).diff(this.valueDateList[0], 'day') + 1 // 从多少列开始
               if(day >= 1) {
                 if(day >= 3) {
                   if(this.valueDateList[0] > data[i].start_date) {
@@ -161,6 +166,10 @@ export default {
                 }
               }
             }
+            if(data[i].end_date != data[i].start_date && data[i].end_date != this.valueDateList[0]) {
+              data[i].end_date = this.dayjs(this.valueDateList[0]).add('1','day').format('YYYY-MM-DD')
+            }
+
             this.mergeList.push(obj)
             if(data[i].id.indexOf(this.$t('chu-cha')) != '-1') {
               data[i].color = '#E6A23C'
@@ -168,6 +177,17 @@ export default {
             if(data[i].id.indexOf(this.$t('other.AskForLeave')) != '-1') {
               data[i].color = '#F56C6C'
             }
+            if(data[i].id.indexOf('任务') != '-1') {
+              if(data[i].level == 0) {
+                data[i].color = '#409EFF'
+              }
+              if(data[i].level == 1) {
+                data[i].color = '#F56C6C'
+              }
+              if(data[i].level == 2) {
+                data[i].color = '#E6A23C'
+              }
+            }
             if (data[i].children) {
                 this.recursive(data[i].children);
             }
@@ -267,28 +287,22 @@ export default {
        return treeData;
     },
     arraySpanMethod({ row, column, rowIndex, columnIndex }) {
-        // if (rowIndex == 0) {
-        //   if (columnIndex == 2) {
-        //     return [1, 18];
-        //   } else if(columnIndex == 1){
-        //     return [0, 0];
-        //   }
-        // }
-
-        // if (rowIndex == +this.mergeList[rowIndex].ins -1) {
-        //   if (columnIndex == +this.mergeList[rowIndex].column + 1) {
-        //     return [1, +this.mergeList[rowIndex].numDay + 1];
-        //   } else if(columnIndex == 1){
-        //     return [0, 0];
-        //   }
-        // }
+        if (rowIndex == +this.mergeList[rowIndex].ins -1) {
+          if(this.mergeList[rowIndex].numDay > 1) {
+            if (columnIndex == +this.mergeList[rowIndex].column + 1) {
+              return [1, +this.mergeList[rowIndex].numDay];
+            } else if(columnIndex == 1){
+              return [0, 0];
+            }
+          }
+        }
     },
     // 设置每一个单元格的样式
     TableCellStyle(row) {
       if(row.row.color) {
         let biaoto = row.column.label.split(' ')[0]
-        // if(biaoto >= row.row.end_date || biaoto <= row.row.start_date) {
-        if(biaoto >= row.row.start_date && biaoto <= row.row.end_date) {
+        // if(biaoto >= row.row.start_date && biaoto <= row.row.end_date) {
+        if(biaoto == row.row.end_date) {
           if(row.row.color) {
             return 'background-color: '+ row.row.color +' !important;color: #fff'
           }

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

@@ -215,7 +215,7 @@
                 </el-table-column>
                 <el-table-column :label="$t('state.states')" width="100">
                     <template slot-scope="scope">
-                        <span>{{scope.row.isActive==0 ? $t('ting-yong')+'(' + scope.row.inactiveDate + ')' : $t('zai-zhi')}}</span>
+                        <span>{{scope.row.isActive==0 ? $t('ting-yong')+(scope.row.inactiveDate != null? '(' + scope.row.inactiveDate + ')':''): $t('zai-zhi')}}</span>
                     </template>
                 </el-table-column>
                 <el-table-column :label="$t('creationtime')" width="150" prop="createTime">