Parcourir la source

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

 Conflicts:
	fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/impl/ProjectServiceImpl.java
cs il y a 2 ans
Parent
commit
713a6b2a48
34 fichiers modifiés avec 1114 ajouts et 515 suppressions
  1. 42 126
      fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/controller/WeiXinCorpController.java
  2. 7 5
      fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/impl/ExpenseSheetServiceImpl.java
  3. 44 11
      fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/impl/ProjectServiceImpl.java
  4. 1 1
      fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/impl/UserServiceImpl.java
  5. 249 0
      fhKeeper/formulahousekeeper/timesheet/src/components/select.vue
  6. 1 2
      fhKeeper/formulahousekeeper/timesheet/src/i18n/en.json
  7. 1 2
      fhKeeper/formulahousekeeper/timesheet/src/i18n/zh.json
  8. 9 3
      fhKeeper/formulahousekeeper/timesheet/src/views/Home.vue
  9. 155 16
      fhKeeper/formulahousekeeper/timesheet/src/views/corpreport/list.vue
  10. 5 1
      fhKeeper/formulahousekeeper/timesheet/src/views/expense/expense.vue
  11. 98 202
      fhKeeper/formulahousekeeper/timesheet/src/views/project/cost.vue
  12. 67 11
      fhKeeper/formulahousekeeper/timesheet/src/views/project/finance.vue
  13. 44 10
      fhKeeper/formulahousekeeper/timesheet/src/views/task/list.vue
  14. 2 0
      fhKeeper/formulahousekeeper/timesheet/src/views/team/index.vue
  15. 33 6
      fhKeeper/formulahousekeeper/timesheet/src/views/workReport/daily.vue
  16. 97 15
      fhKeeper/formulahousekeeper/timesheet/src/views/workReport/list.vue
  17. 8 1
      fhKeeper/formulahousekeeper/timesheet/src/views/workReport/list_department.vue
  18. 30 6
      fhKeeper/formulahousekeeper/timesheet/src/views/workReport/list_import.vue
  19. 8 1
      fhKeeper/formulahousekeeper/timesheet/src/views/workReport/list_profession.vue
  20. 3 0
      fhKeeper/formulahousekeeper/timesheet_h5/public/index.html
  21. 2 0
      fhKeeper/formulahousekeeper/timesheet_h5/src/main.js
  22. 5 1
      fhKeeper/formulahousekeeper/timesheet_h5/src/views/audit/audit.vue
  23. 2 1
      fhKeeper/formulahousekeeper/timesheet_h5/src/views/count/count.vue
  24. 12 4
      fhKeeper/formulahousekeeper/timesheet_h5/src/views/edit/index.vue
  25. 12 4
      fhKeeper/formulahousekeeper/timesheet_h5/src/views/edit/weekEdit.vue
  26. 10 2
      fhKeeper/formulahousekeeper/timesheet_h5/src/views/exaLeave/exaLeave.vue
  27. 59 61
      fhKeeper/formulahousekeeper/timesheet_h5/src/views/index/index.vue
  28. 1 0
      fhKeeper/formulahousekeeper/timesheet_h5/src/views/my/children/center.vue
  29. 37 10
      fhKeeper/formulahousekeeper/timesheet_h5/src/views/project/index.vue
  30. 6 2
      fhKeeper/formulahousekeeper/timesheet_h5/src/views/review/department_list.vue
  31. 36 6
      fhKeeper/formulahousekeeper/timesheet_h5/src/views/review/index.vue
  32. 5 0
      fhKeeper/formulahousekeeper/timesheet_h5/src/views/review/profession_list.vue
  33. 0 2
      fhKeeper/formulahousekeeper/timesheet_h5/src/views/test/list.vue
  34. 23 3
      fhKeeper/formulahousekeeper/timesheet_h5/src/views/view/index.vue

+ 42 - 126
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/controller/WeiXinCorpController.java

@@ -859,47 +859,26 @@ public class WeiXinCorpController {
                     //获取公司根部门人员,也就是没有分配部门的人员
                     int companyRootDeptId = 1;
                     if (enableNewVersion) {
-                        JSONArray unAssignedUserList = getDeptUserSimple(curCorpAccessToken, companyRootDeptId);
-                        for (int m=0;m<unAssignedUserList.size(); m++) {
-                            JSONObject userJson = unAssignedUserList.getJSONObject(m);
-                            String curUserid = userJson.getString("userid");
-                            log.info("userid="+curUserid+", name=" + userJson.getString("name")+", mobile="+userJson.getString("mobile"));
-                            //不存在的人员, 进行插入
-                            User user = new User();
-
-                            user.setId(SnowFlake.nextId()+"")
-                                    .setRoleId(defaultUserRole.getId())//默认普通员工
-                                    .setRoleName(defaultUserRole.getRolename())
-                                    .setCompanyId(companyId)
-                                    .setName(userJson.getString("name"))
-                                    .setCorpwxUserid(curUserid)
-                                    .setColor(ColorUtil.randomColor())
-                                    .setJobNumber(curUserid);//工号就是企业微信的用户ID
-
-                            //检查用户是否已经存在
-                            if (userMapper.selectCount(new QueryWrapper<User>().eq("corpwx_userid", curUserid)) == 0) {
-                                userMapper.insert(user);
-                            }
-                        }
-
 //                    获取部门
                         JSONObject deptObj = getDepartments(curCorpAccessToken);
                         JSONArray deptObjJSONArray = deptObj.getJSONArray("department");
-
+                        Integer sysDeptId = null;
                         List<Department> sysDeptList = new ArrayList<>();
                         for (int i=0;i<deptObjJSONArray.size(); i++) {
                             int deptId = deptObjJSONArray.getJSONObject(i).getIntValue("id");
-                            int parentId = deptObjJSONArray.getJSONObject(i).getIntValue("parentid");
-
-                            Department department = new Department();
-                            department.setCorpwxDeptid(deptId);
-                            department.setCorpwxDeptpid(parentId);
-                            department.setDepartmentName(deptObjJSONArray.getJSONObject(i).getString("name"));
-                            department.setCompanyId(companyId);
-                            departmentMapper.insert(department);
-                            sysDeptList.add(department);
-                            deptObjJSONArray.getJSONObject(i).put("sys_dept_id", department.getDepartmentId());
-                            Integer departmentId = department.getDepartmentId();
+                            if (deptId != companyRootDeptId) {
+                                int parentId = deptObjJSONArray.getJSONObject(i).getIntValue("parentid");
+                                Department department = new Department();
+                                department.setCorpwxDeptid(deptId);
+                                department.setCorpwxDeptpid(parentId);
+                                department.setDepartmentName(deptObjJSONArray.getJSONObject(i).getString("name"));
+                                department.setCompanyId(companyId);
+                                departmentMapper.insert(department);
+                                sysDeptList.add(department);
+                                sysDeptId = department.getDepartmentId();
+                            }
+                            deptObjJSONArray.getJSONObject(i).put("sys_dept_id", sysDeptId);
+                            Integer departmentId = sysDeptId;
                             JSONArray userList = getDeptUserSimple(curCorpAccessToken, deptId);
                             for (int m=0;m<userList.size(); m++) {
                                 JSONObject userJson = userList.getJSONObject(m);
@@ -912,7 +891,7 @@ public class WeiXinCorpController {
                                         .setRoleId(defaultUserRole.getId())//默认普通员工
                                         .setRoleName(defaultUserRole.getRolename())
                                         .setCompanyId(companyId)
-                                        .setDepartmentId(departmentId)
+                                        .setDepartmentId(departmentId == companyRootDeptId?null:departmentId)
                                         .setName(userJson.getString("name"))
                                         .setCorpwxUserid(curUserid)
                                         .setColor(ColorUtil.randomColor())
@@ -926,35 +905,12 @@ public class WeiXinCorpController {
                                     User oldUser = userMapper.selectList(new QueryWrapper<User>().eq("corpwx_userid", curUserid).eq("company_id", companyId).orderByDesc("create_time")).get(0);
                                     oldUser.setName(userJson.getString("name"));
                                     oldUser.setDepartmentId(departmentId);
-
                                     userMapper.updateById(oldUser);
                                 }
                             }
                         }
-
 //                    再来更新部门的层级关系
-                        List<Department> needUpdateDepts = new ArrayList<>();
-                        for (int i=0;i<deptObjJSONArray.size(); i++) {
-                            JSONObject deptJson = deptObjJSONArray.getJSONObject(i);
-                            int pid = deptJson.getInteger("parentid");
-                            if (pid != 1) {
-                                //根部门Id = 1
-                                int sysDeptId = deptJson.getInteger("sys_dept_id");
-                                Department department = sysDeptList.stream().filter(d -> d.getDepartmentId().equals(sysDeptId)).findFirst().get();
-                                //从deptjson数组中寻找parent item
-                                for (int m=0;m<deptObjJSONArray.size(); m++) {
-                                    JSONObject item = deptObjJSONArray.getJSONObject(m);
-                                    if (item.getInteger("id").equals(pid)) {
-                                        department.setSuperiorId(item.getInteger("sys_dept_id"));
-                                        break;
-                                    }
-                                }
-                                needUpdateDepts.add(department);
-                            }
-                        }
-                        if (needUpdateDepts.size() > 0) {
-                            departmentService.updateBatchById(needUpdateDepts);
-                        }
+                        updateDeptHierachyByCorpWx(companyId);
                     }
                 } else {
                     //企业已经存在
@@ -1509,49 +1465,32 @@ public class WeiXinCorpController {
         //默认普通员工的角色
         //获取公司根部门人员,也就是没有分配部门的人员
         int companyRootDeptId = 1;
-        JSONArray unAssignedUserList = getDeptUserSimple(curCorpAccessToken, companyRootDeptId);
         SysRole defaultRole = sysRoleMapper.selectOne(
                 new QueryWrapper<SysRole>().eq("company_id", companyId).eq("is_default", 1));
 
-        for (int m=0;m<unAssignedUserList.size(); m++) {
-            JSONObject userJson = unAssignedUserList.getJSONObject(m);
-            String curUserid = userJson.getString("userid");
-            System.out.println("userid="+curUserid+", name=" + userJson.getString("name")+", mobile="+userJson.getString("mobile"));
-            //不存在的人员, 进行插入
-            User user = new User();
-
-            user.setId(SnowFlake.nextId()+"")
-                    .setRoleId(defaultRole.getId())//默认普通员工
-                    .setRoleName(defaultRole.getRolename())
-                    .setCompanyId(companyId)
-                    .setName(userJson.getString("name"))
-                    .setCorpwxUserid(curUserid)
-                    .setJobNumber(curUserid)
-                    .setColor(ColorUtil.randomColor());
-
-            //检查用户是否已经存在
-            if (userMapper.selectCount(new QueryWrapper<User>().eq("corpwx_userid", curUserid)) == 0) {
-                userMapper.insert(user);
-            }
-        }
-
         //获取部门
         JSONObject deptObj = getAllDepartments(curCorpAccessToken);
         JSONArray deptObjJSONArray = deptObj.getJSONArray("department");
 
         for (int i=0;i<deptObjJSONArray.size(); i++) {
             int deptId = deptObjJSONArray.getJSONObject(i).getIntValue("id");
-            int parentId = deptObjJSONArray.getJSONObject(i).getIntValue("parentid");
-            //部门不存在的话要生成部门
-            Department curDept = departmentMapper.selectOne(new QueryWrapper<Department>().eq("company_id", companyId).eq("corpwx_deptid", deptId));
-            if (curDept == null) {
-                Department department = new Department();
-                department.setCorpwxDeptid(deptId);
-                department.setCorpwxDeptpid(parentId);
-                department.setDepartmentName(deptObjJSONArray.getJSONObject(i).getString("name"));
-                department.setCompanyId(companyId);
-                departmentMapper.insert(department);
-                curDept = department;
+            Department curDept = null;
+            if (deptId != companyRootDeptId) {
+                int parentId = deptObjJSONArray.getJSONObject(i).getIntValue("parentid");
+                //部门不存在的话要生成部门
+                curDept = departmentMapper.selectOne(new QueryWrapper<Department>().eq("company_id", companyId).eq("corpwx_deptid", deptId));
+                if (curDept == null) {
+                    Department department = new Department();
+                    department.setCorpwxDeptid(deptId);
+                    department.setCorpwxDeptpid(parentId);
+                    department.setDepartmentName(deptObjJSONArray.getJSONObject(i).getString("name"));
+                    department.setCompanyId(companyId);
+                    departmentMapper.insert(department);
+                    curDept = department;
+                } else {
+                    //
+                    System.out.println("找到了已有部门== name=="+curDept.getDepartmentName());
+                }
             }
 
             JSONArray userList = getDeptUserSimple(curCorpAccessToken, deptId);
@@ -1566,46 +1505,27 @@ public class WeiXinCorpController {
                         .setRoleId(defaultRole.getId())//默认普通员工
                         .setRoleName(defaultRole.getRolename())
                         .setCompanyId(companyId)
-                        .setDepartmentId(curDept.getDepartmentId())
+                        .setDepartmentId(deptId == companyRootDeptId?null:curDept.getDepartmentId())
                         .setName(userJson.getString("name"))
                         .setCorpwxUserid(curUserid)
                         .setColor(ColorUtil.randomColor())
                         .setJobNumber(curUserid);
 
                 //检查用户是否已经存在
-                if (userMapper.selectCount(new QueryWrapper<User>().eq("corpwx_userid", curUserid)) == 0) {
+                if (userMapper.selectCount(new QueryWrapper<User>().eq("corpwx_userid", curUserid).eq("company_id", companyId)) == 0) {
                     userMapper.insert(user);
                 } else {
                     //更新信息
-                    User oldUser = userMapper.selectList(new QueryWrapper<User>().eq("corpwx_userid", curUserid).eq("company_id", companyId).orderByDesc("create_time")).get(0);
+                    System.out.println("更新人员信息== 部门id=="+curDept.getDepartmentId());
+                    User oldUser = userMapper.selectList(new QueryWrapper<User>().eq("corpwx_userid", curUserid).eq("company_id", companyId)).get(0);
                     oldUser.setName(userJson.getString("name"));
                     oldUser.setDepartmentId(curDept.getDepartmentId());
                     userMapper.updateById(oldUser);
                 }
             }
         }
-
-        List<Department> needUpdateDepts = new ArrayList<>();
-        List<Department> allDeptList = departmentMapper.selectList(new QueryWrapper<Department>().eq("company_id", companyId));
-        for (int i=0;i<allDeptList.size(); i++) {
-            Department firstLevel = allDeptList.get(i);
-            if (firstLevel.getCorpwxDeptpid() != null) {
-                Optional<Department> first = allDeptList.stream().filter(one -> firstLevel.getCorpwxDeptpid().equals(one.getCorpwxDeptid())).findFirst();
-                if (first.isPresent()) {
-                    if (!first.get().getDepartmentId().equals(firstLevel.getSuperiorId())) {
-                        //结构发生变动,需要更新
-                        Department updateDpt = new Department();
-                        updateDpt.setDepartmentId(firstLevel.getDepartmentId());
-                        updateDpt.setSuperiorId(first.get().getDepartmentId());
-                        needUpdateDepts.add(updateDpt);
-                    }
-                }
-            }
-        }
-        if (needUpdateDepts.size() > 0) {
-            departmentService.updateBatchById(needUpdateDepts);
-        }
-
+        //更新部门层级关系
+        updateDeptHierachyByCorpWx(companyId);
         return new HttpRespMsg();
     }
 
@@ -1976,13 +1896,9 @@ public class WeiXinCorpController {
         List<Department> needUpdateDepts = new ArrayList<>();
         List<Department> allDbDeptList = departmentMapper.selectList(new QueryWrapper<Department>().eq("company_id", companyId));
         for (Department department : allDbDeptList) {
-            int corpwxpid = department.getCorpwxDeptpid();
-            if (corpwxpid == 1) {
-                //父部门是根部门
-//                if (department.getSuperiorId() != null) {
-//                    department.setSuperiorId(0);
-//                    needUpdateDepts.add(department);
-//                }
+            Integer corpwxpid = department.getCorpwxDeptpid();
+            if (corpwxpid != null && corpwxpid == 1) {
+
             } else {
                 Optional<Department> first = allDbDeptList.stream().filter(all -> all.getCorpwxDeptid().intValue() == corpwxpid).findFirst();
                 if (first.isPresent()) {

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

@@ -355,7 +355,7 @@ public class ExpenseSheetServiceImpl extends ServiceImpl<ExpenseSheetMapper, Exp
                         throw new Exception("项目编号/项目名称为[" + codeCell.getStringCellValue() + "]的项目不存在");
                     }
                     expenseItem.setExpenseId(expenseSheet.getId());
-                    if(!happenDateCell.toString().trim().equals("")&&happenDateCell!=null){
+                    if(happenDateCell!=null && !happenDateCell.toString().trim().equals("")){
                         LocalDate happenDate = Instant.ofEpochMilli(happenDateCell.getDateCellValue().getTime())
                                 .atZone(ZoneId.systemDefault()).toLocalDate();
                         expenseItem.setHappenDate(String.valueOf(happenDate));
@@ -388,11 +388,13 @@ public class ExpenseSheetServiceImpl extends ServiceImpl<ExpenseSheetMapper, Exp
                         expenseItem.setAmount(amountCell.getNumericCellValue());
                         //计算税额
                         BigDecimal bd = new BigDecimal(amountCell.getNumericCellValue());
-                        //原始金额
-                        BigDecimal divide = bd.divide(BigDecimal.valueOf((1 + taxPercentCell.getNumericCellValue())),2,BigDecimal.ROUND_HALF_UP);
-                        BigDecimal subtract = bd.subtract(divide);
                         bigDecimal=bigDecimal.add(BigDecimal.valueOf(amountCell.getNumericCellValue()));
-                        expenseItem.setTaxValue(subtract.doubleValue());
+                        if (taxPercentCell != null) {
+                            //原始金额
+                            BigDecimal divide = bd.divide(BigDecimal.valueOf((1 + taxPercentCell.getNumericCellValue())),2,BigDecimal.ROUND_HALF_UP);
+                            BigDecimal subtract = bd.subtract(divide);
+                            expenseItem.setTaxValue(subtract.doubleValue());
+                        }
                     }
                     if(remarkCell!=null){
                         expenseItem.setRemark(remarkCell.getStringCellValue());

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

@@ -33,6 +33,7 @@ import org.apache.poi.xssf.usermodel.XSSFCell;
 import org.apache.poi.xssf.usermodel.XSSFRow;
 import org.apache.poi.xssf.usermodel.XSSFSheet;
 import org.apache.poi.xssf.usermodel.XSSFWorkbook;
+import org.apache.tomcat.jni.Local;
 import org.assertj.core.util.Lists;
 import org.springframework.beans.BeanUtils;
 import org.springframework.beans.factory.annotation.Value;
@@ -50,6 +51,7 @@ import java.sql.Timestamp;
 import java.text.DecimalFormat;
 import java.text.NumberFormat;
 import java.text.SimpleDateFormat;
+import java.time.Duration;
 import java.time.LocalDate;
 import java.time.LocalDateTime;
 import java.time.LocalTime;
@@ -4149,7 +4151,6 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
             //无全部项目权限,只能导出自己相关的(创建或参与)
             userId = user.getId();
         }
-        List<HashMap<String, Object>> list = projectMapper.getExportData(user.getCompanyId(), userId);
         HttpRespMsg projectPage = getProjectPage(null, null, null, null, null, null, null, null,null, null, null,null,null, request);
         List<ProjectKeyNodesSetting> projectKeyNodesSettingList = projectKeyNodesSettingMapper.selectList(new QueryWrapper<ProjectKeyNodesSetting>().eq("company_id", user.getCompanyId()));
         Map<String,Object> resultMap= (Map<String, Object>) projectPage.data;
@@ -4228,8 +4229,8 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
         }
         List<List<String>> allList = new ArrayList<List<String>>();
         allList.add(headList);
-        //String[] levelArray = new String[]{"正常","紧急","重要","重要且紧急","低风险","中风险","高风险"};
-        String[] levelArray = new String[]{MessageUtils.message("excel.normal"),MessageUtils.message("excel.urgent"),MessageUtils.message("excel.important"),MessageUtils.message("excel.impAndUrg"),MessageUtils.message("excel.lowRisk"),MessageUtils.message("excel.MedRisk"),MessageUtils.message("excel.highRisk")};
+        String[] levelArray = new String[]{"正常","紧急","重要","重要且紧急","低风险","中风险","高风险"};
+        LocalDateTime c=LocalDateTime.now();
         //获取项目级别数据
         List<ProjectLevel> projectLevelList = projectLevelMapper.selectList(new QueryWrapper<ProjectLevel>().eq("company_id", user.getCompanyId()));
         DateTimeFormatter sdf =DateTimeFormatter.ofPattern("yyyy-MM-dd");
@@ -4240,6 +4241,9 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
         collect.add(-1);
         List<ProjectSeparate> projectSeparateList= projectSeparateMapper.selectList(new QueryWrapper<ProjectSeparate>().in("id", collect));
         List<ProjectKeyNodes> nodesList = projectKeyNodesMapper.selectList(new QueryWrapper<ProjectKeyNodes>().in("project_id", collect));
+        LocalDateTime d=LocalDateTime.now();
+        Duration between1 = Duration.between(c, d);
+        System.out.println("此处耗时----------------"+between1.toMillis());
         for (ProjectVO projectVO : projectVOList) {
             List<String> rowData = new ArrayList<>();
             rowData.add(projectVO.getProjectCode());
@@ -5481,7 +5485,7 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
         }else {
             userList = userMapper.selectList(queryWrapper);
         }
-        Map<Object, List<Map<String, Object>>> listMap = reportList.stream().collect(Collectors.groupingBy(rp -> rp.get("userName")));
+        Map<Object, List<Map<String, Object>>> listMap = reportList.stream().filter(item->!StringUtils.isEmpty(item.get("userName"))).collect(Collectors.groupingBy(rp -> rp.get("userName")));
         //获取请假数据
         List<LeaveSheet> leaveSheetList = leaveSheetMapper.selectList(new QueryWrapper<LeaveSheet>().eq("company_id", targetUser.getCompanyId()));
         List<TimelinessRateVO> resultList=new ArrayList<>();
@@ -5489,8 +5493,8 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
             List<Map<String,Object>> dataList=new ArrayList<>();
             long days =dateTimeList.size();
             List<LeaveSheet> leaveSheets = leaveSheetList.stream().filter(ls -> ls.getOwnerId().equals(user.getId())
-                    &&(ls.getStartDate().isAfter(ChronoLocalDate.from(sDate))||ls.getStartDate().isEqual(ChronoLocalDate.from(sDate)))
-                    &&(ls.getEndDate().isBefore(ChronoLocalDate.from(eDate))||ls.getEndDate().isEqual(ChronoLocalDate.from(eDate)))).collect(Collectors.toList());
+                    &&(ls.getStartDate().isBefore(ChronoLocalDate.from(sDate))||ls.getStartDate().isEqual(ChronoLocalDate.from(sDate))||ls.getEndDate().isAfter(ChronoLocalDate.from(eDate))||ls.getEndDate().isEqual(ChronoLocalDate.from(eDate)))
+                    &&(ls.getEndDate().isAfter(ChronoLocalDate.from(eDate))||ls.getEndDate().isEqual(ChronoLocalDate.from(eDate))||ls.getEndDate().isAfter(ChronoLocalDate.from(sDate))||ls.getEndDate().isEqual(ChronoLocalDate.from(sDate)))).collect(Collectors.toList());
             TimelinessRateVO timelinessRateVO=new TimelinessRateVO();
             timelinessRateVO.setUserName(user.getName());
             timelinessRateVO.setJobNumber(user.getJobNumber());
@@ -5510,15 +5514,20 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
                         days-=leaveSheet.getTimeDays();
                     }
                     for (LocalDateTime localDateTime : leaveDateList) {
+                        if(localDateTime.isBefore(sDate)||localDateTime.isAfter(eDate)){
+                            days++;
+                            continue;
+                        }
                         if(mapList!=null&&mapList.stream().anyMatch(ml->{
                             Object date = ml.get("createDate");
                             LocalDate createDate = LocalDate.parse(String.valueOf(date));
                             return createDate.isEqual(localDateTime.toLocalDate());
                         })){
+                            days++;
+                        }else{
                             Map<String,Object> map=new HashMap<>();
                             map.put(localDateTime.toLocalDate().format(DateTimeFormatter.ofPattern("yyyy-MM-dd")),MessageUtils.message("leave.leave"));
                             dataList.add(map);
-                            days++;
                         }
                     }
                 }
@@ -5574,7 +5583,6 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
                     }
                     dataList.add(objectMap);
                 }
-                timelinessRateVO.setDataList(dataList);
                 BigDecimal bigDecimal=new BigDecimal(num);
                 BigDecimal divide;
                 if(days!=0){
@@ -5593,7 +5601,30 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
                 }
                 String number = dft.format(divide);
                 timelinessRateVO.setTimelinessRate(String.valueOf(number));
+            }else {
+                int num=0;
+                BigDecimal bigDecimal=new BigDecimal(num);
+                BigDecimal divide;
+                if(days!=0){
+                    divide = bigDecimal.divide(BigDecimal.valueOf(days), 2, BigDecimal.ROUND_HALF_UP);
+                }else if(days==0&&num!=0){
+                    divide=new BigDecimal(1);
+                    //查看当天有请假直接算100%
+                }else if (days==0&&num!=0&&leaveSheetList.size()>0){
+                    divide=new BigDecimal(1);
+                }else if(leaveSheets.size()>0){
+                    divide=new BigDecimal(1);
+                }else{
+                    divide=new BigDecimal(0);
+                }
+                if(divide.compareTo(new BigDecimal(1))==1){
+                    divide=new BigDecimal(1);
+                    log.error("填报及时率数据异常:==="+user.getName());
+                }
+                String number = dft.format(divide);
+                timelinessRateVO.setTimelinessRate(String.valueOf(number));
             }
+            timelinessRateVO.setDataList(dataList);
             resultList.add(timelinessRateVO);
         }
         HashMap map=new HashMap();
@@ -6743,9 +6774,11 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
                     }
                     for (TaskGroup taskGroup : taskGroupList) {
                         taskGroup.setProjectId(project.getId());
-                        Optional<TaskGroup> first = groupList.stream().filter(gl -> gl.getTaskGroupCode() != null && gl.getTaskGroupCode().equals(taskGroup.getTaskGroupCode())).findFirst();
-                        if(first.isPresent()){
-                            taskGroup.setId(first.get().getId());
+                        if(groupList!=null){
+                            Optional<TaskGroup> first = groupList.stream().filter(gl -> gl.getTaskGroupCode() != null && gl.getTaskGroupCode().equals(taskGroup.getTaskGroupCode())).findFirst();
+                            if(first.isPresent()){
+                                taskGroup.setId(first.get().getId());
+                            }
                         }
                     }
                     taskGroupService.saveOrUpdateBatch(taskGroupList);

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

@@ -182,7 +182,7 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements Us
             userVO.setCompany(company);
             WxCorpInfo info = wxCorpInfoMapper.selectOne(new QueryWrapper<WxCorpInfo>().eq("company_id", company.getId()));
             if (info != null) {
-                userVO.setUserNameNeedTranslate(info.getSaasSyncContact());
+                userList.get(0).setUserNameNeedTranslate(info.getSaasSyncContact());
             }
             BeanUtils.copyProperties(userList.get(0), userVO);
             if (userVO.getRoleId() == null || userVO.getRoleId() == 0) {

+ 249 - 0
fhKeeper/formulahousekeeper/timesheet/src/components/select.vue

@@ -0,0 +1,249 @@
+<template>
+  <div tabindex="0" @blur="selectClihide()" style="display: inline-block;">  
+    <div :style="'width:' + selectWidth + 'px;height:' + selectHeight + 'px'" :class="classDiv ? 'select selectDiv' : 'select'" @click="selectCli" ref="selectDiv">
+        <div :class="selectName == $t('defaultText.pleaseChoose') ? 'selecttex selecttexXuan' : 'selecttex'">
+            <ww-open-data type='userName' :openid='selectName'></ww-open-data>
+            <!-- {{selectName}} -->
+        </div>
+        <i class="el-icon-arrow-down iostu"></i>
+    </div>
+    <transition name="el-zoom-in-top">
+      <div v-show="show" style="position: relative;z-index: 99;">
+        <div class="transitionBox">
+            <ul class="transitionBoxUl">
+                <li :class="transitionBoxLiIdx == index ? 'liHover' : ''" v-for="(item, index) in options" :key="index" @mouseover="liMouseOver(index)" @click="liClick(item)"> 
+                    <span v-if="item.name">
+                        <!-- {{item.name || item.auditorName}} -->
+                        <ww-open-data type='userName' :openid='item.name'></ww-open-data>
+                    </span> 
+                    <span v-if="item.auditorName">
+                        <ww-open-data type='userName' :openid='item.auditorName'></ww-open-data>
+                    </span>
+                    <!-- {{item.name || item.auditorName}} -->
+                </li>
+            </ul>
+        </div>
+      </div>
+    </transition>
+  </div>
+</template>
+
+<script>
+export default {
+    props: {
+        subject:{
+            type: Array
+        },
+        size: {
+            type: String
+        },
+        subjectId: {
+            type: String
+        },
+        distinction: {
+            type: String,
+            default: '1',
+        },
+        // 真对填写日报单独处理
+        idx: {
+            type: String
+        },
+        flg: {
+            type: Boolean,
+            default: false, // 默认值,不是填写日报
+        },
+        // 针对查任务的处理
+        index: {
+            type: String
+        }
+    },
+    components: {
+        selectWidth: '150',
+        selectHeight: '28'
+    },
+    data() {
+        return {
+            selectWidth: '150',
+            selectHeight: '28',
+            show: false, // 下拉框
+            options: [], // 列表数据
+            transitionBoxLiIdx: '', // hover 背景色
+            selectName: this.$t('defaultText.pleaseChoose'), // 显示的文字
+            classDiv: false, // 获得焦点样式
+            optionsOId: '', // 选中人的id
+            dailyListObj: null, // 填写日报的数据
+            dailyListIndex: null, // 日报点的索引
+        };
+    },
+    computed: {},
+    watch: {
+        subject: {
+            handler(newValue, oldValue) {
+                this.options = newValue
+                if(this.flg) {
+                    if(newValue) {
+                        this.selectName = newValue[0].name || newValue[0].auditorName
+                        this.optionsOId = newValue[0].id || newValue[0].auditorId
+                    }
+                }
+            },
+        },
+        // 日报点的索引, 真对填写的日报
+        idx: {
+            handler(newValue, oldValue) {
+                console.log(newValue, oldValue)
+                this.dailyListIndex = newValue
+            },
+        }
+    },
+    created() {},
+    mounted() {
+        if(this.size == 'mini') {
+            this.selectWidth = '150'
+            this.selectHeight = '28'
+        } else if(this.size == 'small') {
+            this.selectWidth = '191'
+            this.selectHeight = '32'
+        } 
+        if(this.subject) {
+            this.options = JSON.parse(JSON.stringify(this.subject))
+        }
+        if(this.subjectId) {
+            this.optionsOId = JSON.parse(JSON.stringify(this.subjectId))
+            for(let i in this.options) {
+                if(this.options[i].id == this.optionsOId || this.options[i].auditorId == this.optionsOId) {
+                     this.selectName = this.options[i].name || this.options[i].auditorName
+                }
+            }
+        }
+        console.log(this.options, this.optionsOId)
+        this.dailyListIndex = this.idx
+    },
+    methods: {
+        selectCli() {
+            this.$refs.selectDiv.focus()
+            this.classDiv = !this.classDiv
+            this.show = !this.show
+        },
+        selectClihide() {
+            if(this.classDiv) {
+                this.transitionBoxLiIdx = ''
+                this.show = !this.show
+                this.classDiv = false
+            }
+        },
+        liMouseOver(index) {
+            this.transitionBoxLiIdx = index
+        },
+        liClick(item) {
+            let nameId = item.id || item.auditorId
+            if(this.flg) {
+                let obj = {
+                    id: nameId,
+                    idx: this.dailyListIndex
+                }
+                this.$emit("selectCatCli", obj);
+            } else {
+                let obj = {
+                    id: nameId,
+                    distinction: this.distinction,
+                    index: this.index, // 选中的索引
+                }
+                this.$emit("selectCal", obj)
+            }
+            this.selectName = item.name || item.auditorName
+            this.transitionBoxLiIdx = ''
+            this.show = !this.show
+            this.classDiv = false
+        },
+    },
+    triggerOption(){
+
+    },
+    choose(item,value){
+      
+    },
+
+};
+</script>
+
+<style scoped lang="scss">
+    .selectDiv {
+        border-color: #409EFF !important;
+    }
+    .select {
+        -webkit-appearance: none;
+        background-color: #FFF;
+        background-image: none;
+        border-radius: 4px;
+        border: 1px solid #DCDFE6;
+        -webkit-box-sizing: border-box;
+        box-sizing: border-box;
+        color: #606266;
+        display: inline-block;
+        font-size: inherit;
+        height: 40px;
+        line-height: 40px;
+        outline: 0;
+        padding: 0 15px;
+        -webkit-transition: border-color .2s cubic-bezier(.645,.045,.355,1);
+        transition: border-color .2s cubic-bezier(.645,.045,.355,1);
+        width: 100%;
+        position: relative;
+        cursor: pointer;
+    }
+    .selecttex {
+        height: 28px;
+        line-height: 28px;
+        text-overflow: ellipsis;
+        font-size: 12px;
+    }
+    .iostu {
+        position: absolute;
+        top: 50%;
+        margin-top: -4px;
+        right: 8px;
+        color: #C0C4CC;
+    }
+    .transitionBox {
+        background: #FFF;
+        position: absolute; 
+        width: 100%;
+        border-radius: 2em;
+        border: 1px solid #E4E7ED;
+        border-radius: 4px;
+        background-color: #FFF;
+        box-sizing: border-box;
+        margin: 5px 0;
+        box-shadow: 0 2px 12px #dfdfdf;
+        max-height: 274px;
+        overflow: auto;
+    }
+    .transitionBoxUl {
+        list-style: none;
+        padding: 6px 0;
+        margin: 0;
+        -webkit-box-sizing: border-box;
+        box-sizing: border-box;
+    }
+    .transitionBoxUl li {
+        font-size: 14px;
+        padding: 0 20px;
+        position: relative;
+        white-space: nowrap;
+        overflow: hidden;
+        text-overflow: ellipsis;
+        color: #606266;
+        height: 34px;
+        line-height: 34px;
+        -webkit-box-sizing: border-box;
+        box-sizing: border-box;
+        cursor: pointer;
+    }
+    .liHover {
+        background-color: #F5F7FA;
+    }
+    .selecttexXuan {
+        color: #C0C4CC;;
+    }
+</style>

+ 1 - 2
fhKeeper/formulahousekeeper/timesheet/src/i18n/en.json

@@ -166,8 +166,7 @@
     "nextStep": "Next step",
     "selectAll": "select all",
     "choose": "choose",
-    "previousstep": "Previous step",
-    "nextstep": "Next step"
+    "previousstep": "Previous step"
   },
   "textLink": {
     "fillInTheWork": "Fill out the daily",

+ 1 - 2
fhKeeper/formulahousekeeper/timesheet/src/i18n/zh.json

@@ -166,8 +166,7 @@
     "nextStep": "下一步",
     "selectAll": "全选",
     "choose": "已选中",
-    "previousstep": "上一步",
-    "nextstep": "上一步"
+    "previousstep": "上一步"
   },
   "textLink": {
     "fillInTheWork": "填写日报",

+ 9 - 3
fhKeeper/formulahousekeeper/timesheet/src/views/Home.vue

@@ -12,8 +12,7 @@
                 <div class="tools" @click.prevent="collapse" style="position: relative;">
                     <i class="fa fa-align-justify"></i>
                     <span style="position: absolute;width: 350px;left: 60px;">
-                        <span v-if="user.userNameNeedTranslate == '0'">{{user.companyName}}</span>
-                        <span v-if="user.userNameNeedTranslate == '1'"><ww-open-data type='userName' :openid='user.companyName'></ww-open-data></span>
+                        {{user.companyName}}
                     </span>
                 </div>
             </el-col>
@@ -72,11 +71,18 @@
                 <el-dropdown trigger="hover" style="margin-left:10px;">
                     <span class="el-dropdown-link userinfo-inner">
                         <img src="../assets/image/userHead.png" />
-                        {{sysUserName}}
+                        <span v-if="user.userNameNeedTranslate == 1">
+                            <ww-open-data type='userName' :openid='sysUserName'></ww-open-data>
+                        </span>
+                        <span v-if="user.userNameNeedTranslate != 1">
+                            {{sysUserName}}
+                        </span>
+                        <!-- {{sysUserName}} -->
                     </span>
                     <el-dropdown-menu slot="dropdown">
                         <!-- <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" ></i>{{user.jobNumber}}</span></el-dropdown-item>
                         <el-dropdown-item @click.native="reset">{{$t('other.changeThePassword')}}</el-dropdown-item>
                         <!-- <el-dropdown-item @click.native="editInfoOpen">修改信息</el-dropdown-item> -->
                         <el-dropdown-item divided @click.native="logout">{{$t('other.launchTheLogin')}}</el-dropdown-item>

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

@@ -98,10 +98,13 @@
           </el-select>
 
           <!-- 人员筛选 -->
-          <el-select v-if="ins == 6 || ins == 8 || ins == 9 || ins == 10 || ins == 11" v-model="userId" :placeholder="$t('pleaseselectpersonnel')" @change="selcts()" clearable filterable size="small" style="margin-left:10px;width:150px">
+          <el-select v-if="(ins == 6 || ins == 8 || ins == 9 || ins == 10 || ins == 11)  && user.userNameNeedTranslate != '1'" v-model="userId" :placeholder="$t('pleaseselectpersonnel')" @change="selcts()" clearable filterable size="small" style="margin-left:10px;width:150px">
             <el-option v-for="(item, index) in selUserList" :key="index" :label="item.name" :value="item.id"></el-option>
           </el-select>
 
+          <selectCat :subject="selUserList" :subjectId="userId" :size="mini" @selectCal="selectCal" v-if="(ins == 6 || ins == 8 || ins == 9 || ins == 10 || ins == 11) && user.userNameNeedTranslate == '1'"></selectCat>
+          
+
           <!-- 待审核筛选切换 -->
           <el-radio-group v-model="stateKey" size="small" v-if="ins == 10 && user.timeType.reportWorkflow == 1" style="margin-left:10px;margin-top:-3.33px" @change="stateKeySel">
             <el-radio-button :label="1">{{ $t('projectbereviewed') }}</el-radio-button>
@@ -126,7 +129,12 @@
                 </el-table-column>
                 <el-table-column prop="inchargerName" :label="$t('projectmanager')"  width="130">
                   <template slot-scope="scope" >
-                    {{scope.row.inchargerName}}
+                    <span v-if="user.userNameNeedTranslate == '1'">
+                      <ww-open-data type='userName' :openid='scope.row.inchargerName'></ww-open-data>
+                    </span>
+                    <span v-if="user.userNameNeedTranslate != '1'">
+                      {{scope.row.inchargerName}}
+                    </span>
                   </template>
                 </el-table-column>
                 <el-table-column prop="contractAmount" :label="$t('he-tong-jine-yuan')" align="right">
@@ -171,7 +179,16 @@
                     {{scope.row.name}}
                   </template>
                 </el-table-column>
-                <el-table-column prop="executor_name" :label="$t('zhi-hang-ren')"  width="200"></el-table-column>
+                <el-table-column prop="executor_name" :label="$t('zhi-hang-ren')"  width="200">
+                  <template slot-scope="scope" >
+                    <span v-if="user.userNameNeedTranslate == '1'">
+                      <ww-open-data type='userName' :openid='scope.row.executor_name'></ww-open-data>
+                    </span>
+                    <span v-if="user.userNameNeedTranslate != '1'">
+                      {{scope.row.executor_name}}
+                    </span>
+                  </template>
+                </el-table-column>
                 <el-table-column prop="plan_hours" :label="$t('plantime')+'(h)'"  width="150">
                   <template slot-scope="scope">
                         {{scope.row.plan_hours == null? 0:scope.row.plan_hours.toFixed(1)}}
@@ -399,9 +416,27 @@
                 <el-table-column prop="projectCode" :label="$t('Itemno')" width="220"></el-table-column>
                 <el-table-column prop="projectName" :label="$t('headerTop.projectName')" width="220"></el-table-column>
                 <el-table-column prop="degreeName" :label="user.timeType.customDegreeName" width="180" v-if="user.timeType.customDegreeActive == 1"></el-table-column>
-                <el-table-column prop="username" :label="$t('lable.name')" width="120"></el-table-column>
+                <el-table-column prop="username" :label="$t('lable.name')" width="120">
+                  <template slot-scope="scope" >
+                    <span v-if="user.userNameNeedTranslate == '1'">
+                      <ww-open-data type='userName' :openid='scope.row.username'></ww-open-data>
+                    </span>
+                    <span v-if="user.userNameNeedTranslate != '1'">
+                      {{scope.row.username}}
+                    </span>
+                  </template>
+                </el-table-column>
                 <el-table-column prop="jobNumber" :label="$t('Worknumber')" width="120"></el-table-column>
-                <el-table-column prop="departmentName" :label="$t('lable.department')" width="140"></el-table-column>
+                <el-table-column prop="departmentName" :label="$t('lable.department')" width="140">
+                  <template slot-scope="scope" >
+                    <span v-if="user.userNameNeedTranslate == '1'">
+                      <ww-open-data type='departmentName' :openid='scope.row.departmentName'></ww-open-data>
+                    </span>
+                    <span v-if="user.userNameNeedTranslate != '1'">
+                      {{scope.row.departmentName}}
+                    </span>
+                  </template>
+                </el-table-column>
                 <el-table-column prop="createDate" :label="$t('screening.workingDate')" width="120"></el-table-column>
                 <el-table-column prop="workingTime" :label="$t('screening.workTime')+ '(h)'" width="100" align="right">
                   <template slot-scope="scope">
@@ -422,7 +457,16 @@
 
               <!-- 人员工时分配表 -->
             <el-table v-if="ins == 8" key="8" border :data="userWorkHoursList" highlight-current-row v-loading="listLoading" :height="tableHeight" style="width: 100%;">
-              <el-table-column prop="username" :label="$t('ren-yuan')" width="150"></el-table-column>
+              <el-table-column prop="username" :label="$t('ren-yuan')" width="150">
+                <template slot-scope="scope" >
+                    <span v-if="user.userNameNeedTranslate == '1'">
+                      <ww-open-data type='userName' :openid='scope.row.username'></ww-open-data>
+                    </span>
+                    <span v-if="user.userNameNeedTranslate != '1'">
+                      {{scope.row.username}}
+                    </span>
+                  </template>
+              </el-table-column>
               <el-table-column prop="jobNumber" :label="$t('Worknumber')" width="150"></el-table-column>
               <el-table-column prop="unPublic" :label="$t('ordinaryprojecthours')" min-width="160" align="right">
                 <template slot-scope="scope">
@@ -494,9 +538,27 @@
 
             <!-- 员工填报及时率 -->
             <el-table v-if="ins == 9" key="9" border :data="reportTimelyList" highlight-current-row v-loading="listLoading" :height="tableHeight" style="width: 100%;">
-                <el-table-column prop="userName" :label="$t('ren-yuan')" min-width="200" align="center"></el-table-column>
+                <el-table-column prop="userName" :label="$t('ren-yuan')" min-width="200" align="center">
+                  <template slot-scope="scope" >
+                    <span v-if="user.userNameNeedTranslate == '1'">
+                      <ww-open-data type='userName' :openid='scope.row.userName'></ww-open-data>
+                    </span>
+                    <span v-if="user.userNameNeedTranslate != '1'">
+                      {{scope.row.userName}}
+                    </span>
+                  </template>
+                </el-table-column>
                 <el-table-column prop="jobNumber" :label="$t('Worknumber')" min-width="200" align="center"></el-table-column>
-                <el-table-column prop="departmentName" :label="$t('subordinatedepartments')" min-width="200" align="center"></el-table-column>
+                <el-table-column prop="departmentName" :label="$t('subordinatedepartments')" min-width="200" align="center">
+                  <template slot-scope="scope" >
+                    <span v-if="user.userNameNeedTranslate == '1'">
+                      <ww-open-data type='departmentName' :openid='scope.row.departmentName'></ww-open-data>
+                    </span>
+                    <span v-if="user.userNameNeedTranslate != '1'">
+                      {{scope.row.departmentName}}
+                    </span>
+                  </template>
+                </el-table-column>
                 <el-table-column prop="timelinessRate" :label="$t('timelyreportingrate')" min-width="200" align="center">
                   <template slot-scope="scope">
                     <el-link v-if="scope.row.dataList != null" style="color:#409eff;" @click="timelyDetail(scope.row.dataList)">{{scope.row.timelinessRate}}</el-link>
@@ -512,16 +574,52 @@
 
             <!-- 日报待审核统计 -->
             <el-table v-if="ins == 10" key="10" border :data="auditRateList" highlight-current-row v-loading="listLoading" :height="tableHeight" style="width: 100%;">
-                <el-table-column prop="userName" :label="$t('other.reviewer')" min-width="200" align="center"></el-table-column>
-                <el-table-column prop="departmentName" :label="$t('subordinatedepartments')" min-width="200" align="center"></el-table-column>
+                <el-table-column prop="userName" :label="$t('other.reviewer')" min-width="200" align="center">
+                  <template slot-scope="scope" >
+                    <span v-if="user.userNameNeedTranslate == '1'">
+                      <ww-open-data type='userName' :openid='scope.row.userName'></ww-open-data>
+                    </span>
+                    <span v-if="user.userNameNeedTranslate != '1'">
+                      {{scope.row.userName}}
+                    </span>
+                  </template>
+                </el-table-column>
+                <el-table-column prop="departmentName" :label="$t('subordinatedepartments')" min-width="200" align="center">
+                  <template slot-scope="scope" >
+                    <span v-if="user.userNameNeedTranslate == '1'">
+                      <ww-open-data type='departmentName' :openid='scope.row.departmentName'></ww-open-data>
+                    </span>
+                    <span v-if="user.userNameNeedTranslate != '1'">
+                      {{scope.row.departmentName}}
+                    </span>
+                  </template>
+                </el-table-column>
                 <el-table-column prop="num" :label="$t('numberitemstobereviewed')" min-width="200" align="center"></el-table-column>
             </el-table>
 
             <!-- 人员工时统计表 -->
             <el-table v-if="ins == 11" key="11" border :data="personnelList" highlight-current-row v-loading="listLoading" :height="tableHeight" style="width: 100%;">
-                <el-table-column prop="name" :label="$t('lable.name')" min-width="200" align="center"></el-table-column>
+                <el-table-column prop="name" :label="$t('lable.name')" min-width="200" align="center">
+                  <template slot-scope="scope" >
+                    <span v-if="user.userNameNeedTranslate == '1'">
+                      <ww-open-data type='userName' :openid='scope.row.name'></ww-open-data>
+                    </span>
+                    <span v-if="user.userNameNeedTranslate != '1'">
+                      {{scope.row.name}}
+                    </span>
+                  </template>
+                </el-table-column>
                 <el-table-column prop="jobNumber" :label="$t('Worknumber')" min-width="200" align="center"></el-table-column>
-                <el-table-column prop="departmentName" :label="$t('lable.department')" min-width="200" align="center"></el-table-column>
+                <el-table-column prop="departmentName" :label="$t('lable.department')" min-width="200" align="center">
+                  <template slot-scope="scope" >
+                    <span v-if="user.userNameNeedTranslate == '1'">
+                      <ww-open-data type='departmentName' :openid='scope.row.departmentName'></ww-open-data>
+                    </span>
+                    <span v-if="user.userNameNeedTranslate != '1'">
+                      {{scope.row.departmentName}}
+                    </span>
+                  </template>
+                </el-table-column>
                 <el-table-column prop="planHours" :label="$t('plantime')" min-width="200" align="center">
                   <template slot-scope="scope">
                     <div v-if="scope.row.planHours">
@@ -640,8 +738,26 @@
         </el-dialog>
         <el-dialog :title="curProject.projectName+'-'+$t('detailsofreimbursementexpenses')" show-summary=true v-if="detailVisible" :summary-method="getSummaries" :visible.sync="detailVisible" :close-on-click-modal="false" customClass="customWidth" width="1000px">
         <el-table  :key="ins" border :data="detailList" highlight-current-row v-loading="detailListLoading" :height="500" style="width: 100%;">
-                <el-table-column  prop="username" :label="$t('screening.employeename')"  ></el-table-column>
-                <el-table-column  prop="departmentName" :label="$t('departmentsuod')" ></el-table-column>
+                <el-table-column  prop="username" :label="$t('screening.employeename')"  >
+                  <template slot-scope="scope" >
+                    <span v-if="user.userNameNeedTranslate == '1'">
+                      <ww-open-data type='userName' :openid='scope.row.username'></ww-open-data>
+                    </span>
+                    <span v-if="user.userNameNeedTranslate != '1'">
+                      {{scope.row.username}}
+                    </span>
+                  </template>
+                </el-table-column>
+                <el-table-column  prop="departmentName" :label="$t('departmentsuod')" >
+                  <template slot-scope="scope" >
+                    <span v-if="user.userNameNeedTranslate == '1'">
+                      <ww-open-data type='departmentName' :openid='scope.row.departmentName'></ww-open-data>
+                    </span>
+                    <span v-if="user.userNameNeedTranslate != '1'">
+                      {{scope.row.departmentName}}
+                    </span>
+                  </template>
+                </el-table-column>
                 <el-table-column  prop="happenDate" :label="$t('forthedate')" ></el-table-column>
                 <el-table-column prop="invoiceType" :label="$t('costtype')"    >
                   <template slot-scope="scope">
@@ -686,7 +802,16 @@
         <el-dialog :title="$t('workovertimedetails')" :visible.sync="dialogVisibleDetails" width="800px" v-loading="listLoading" :before-close="handleClose">
           <div>
              <el-table :data="detailsList" style="width: 100%" height="400px">
-                <el-table-column prop="username" :label="$t('lable.name')" width="120"></el-table-column>
+                <el-table-column prop="username" :label="$t('lable.name')" width="120">
+                  <template slot-scope="scope" >
+                    <span v-if="user.userNameNeedTranslate == '1'">
+                      <ww-open-data type='userName' :openid='scope.row.username'></ww-open-data>
+                    </span>
+                    <span v-if="user.userNameNeedTranslate != '1'">
+                      {{scope.row.username}}
+                    </span>
+                  </template>
+                </el-table-column>
                 <el-table-column prop="projectName" :label="$t('headerTop.projectName')" width="200"></el-table-column>
                 <el-table-column prop="projectCode" :label="$t('Itemno')" width="200"></el-table-column>
                 <el-table-column prop="createDate" :label="$t('workovertimedate')" width="120"></el-table-column>
@@ -708,9 +833,15 @@
 </template>
 
 <script>
+
+// 自定义select组件
+import selectCat from "@/components/select.vue"
+
 export default {
   name: "expense",
-  components: {},
+  components: {
+    selectCat
+  },
   props: {},
   data() {
     return {
@@ -1936,6 +2067,13 @@ export default {
               type: "error"
           });
       });
+    },
+    // 自定义点击事件
+    selectCal(obj) {
+      if(obj.distinction == 1) {
+        this.userId = obj.id
+        this.selcts()
+      }
     }
   },
 };
@@ -1955,6 +2093,7 @@ export default {
   display: flex;
   justify-content: space-between;
   align-items: center;
+  z-index: 2;
 }
 .headine h3 {
   margin: 0;

+ 5 - 1
fhKeeper/formulahousekeeper/timesheet/src/views/expense/expense.vue

@@ -524,9 +524,13 @@
 </template>
 
 <script>
+// 自定义select组件
+import selectCat from "@/components/select.vue"
 export default {
   name: "expense",
-  components: {},
+  components: {
+    selectCat
+  },
   props: {},
   data() {
     return {

+ 98 - 202
fhKeeper/formulahousekeeper/timesheet/src/views/project/cost.vue

@@ -58,7 +58,18 @@
              <div id="container" :style="'height:'+containerHeight+'px;width:100%'"></div>
         </div> -->
         <div id="clearfix" :class="radio == $t('ren-yuan') ? 'ryuans' : ''" :style="'overflow-x: auto;width:100%;padding-bottom: 100px; position: relative; height:'+containerHeight+'px;'">
-             <div id="container" :style="'height:'+containerHeight+'px;width:100%'"></div>
+            <div id="container" :style="'height:'+(containerHeight - 20)+'px;width:100%'"></div>
+            <div class="poss">
+                <el-pagination
+                  @size-change="echartsSizeChange"
+                  @current-change="echartsCurrentChange"
+                  :current-page="page"
+                  :page-sizes="[50]"
+                  :page-size="50"
+                  layout="total, sizes, prev, pager, next"
+                  :total="total">
+                </el-pagination>
+            </div>
         </div>
         <!-- <div>
              <div id="container" :style="'height:'+containerHeight+'px;width:100%'"></div>
@@ -154,6 +165,10 @@
     export default {
         data() {
             return {
+                allListData: [],
+                page: 1,
+                size: 50,
+                total: 0,
                 personnelValue: '',
                 personnelAll: [],
                 yAxisValue: localStorage.yAxisValue?localStorage.yAxisValue:0,
@@ -189,6 +204,14 @@
             };
         },
         methods: {
+            echartsCurrentChange(){
+                if(this.radio == this.$t('ren-yuan')){
+                    this.gtff()
+                }else{
+                    this.jieliu_echarts()
+                }
+                
+            },
             //Y轴点击改变显示的数据
             onYAxisChange() {
                 localStorage.yAxisValue = this.yAxisValue;
@@ -366,6 +389,7 @@
             },
             // 人员筛选
             personnel() {
+                this.page = 1
                 if(this.personnelValue) {
                     var arrlist = JSON.parse(JSON.stringify(this.personnelAll))
                     var arr = []
@@ -375,9 +399,11 @@
                         }
                     }
                     arrlist.list = arr
-                    this.gtff(arrlist)
+                    this.allListData = arrlist
+                    this.gtff()
                 } else {
-                    this.gtff(this.personnelAll)
+                    this.allListData = this.personnelAll
+                    this.gtff()
                 }
             },
             //获取人员成本统计列表
@@ -405,169 +431,11 @@
                     this.hasReportUserList = [];
                     if (res.code == "ok") {
                         // 
-                            // var sss = []
-                            // var ddd = []
-                            // for(var i = 0; i < 120; i++) {
-                            //     sss.push(res.data.list[0])
-                            //     ddd.push(res.data.userList[0])
-                            // }
-                            // res.data.list = sss
-                            // res.data.userList = ddd
-                            for(var i in res.data.list) {
-                                if(i>20) {
-                                    // this.widthHtval = +this.widthHtval + 2
-                                    this.widthHtval = +this.widthHtval + 40
-                                } else {
-                                    this.widthHtval = document.body.clientWidth - 230
-                                }
-                            }
+                            
                         // 
                         this.personnelAll = res.data
-                        this.gtff(res.data)
-                        //工时总成本
-                        // this.hasReportUserList = res.data.userList;
-                        // var xList = [] yList = [] , list = res.data.list, array = [] , series = [];
-                        // var totalMoneyCost = res.data.totalCostMoney;
-                        // var totalHours = 0.0;
-                        // if (list.length > 0) {
-                        //     var num = list.length==0?0:list[0].project.length;
-                        //     for(var i in list) {
-                        //         xList.push(list[i].name);
-                        //         var pro = list[i].project;
-                        //         for(var j in pro) {
-                        //             if(array.indexOf(pro[j].project) == -1) {
-                        //                 array.push(pro[j].project)
-                        //             }
-                        //         }
-                        //     }
-
-                        //     for(var i in array) {
-                        //         yList.push(array[i]);
-                        //         var dataList = [];
-                        //         for(var j in list) {
-                        //             var project = list[j].project , num = 0;
-                        //             if(project.length != 0) {
-                        //                 for(var k in project) {
-                        //                     if(project[k].project == array[i]) {
-                        //                         dataList.push({
-                        //                             "value": this.yAxisValue==0?project[k].money:project[k].time,
-                        //                             "cost": project[k].time,
-                        //                              "money":project[k].money
-                        //                         })
-                        //                         totalHours += parseFloat(project[k].time);
-                        //                     } else {
-                        //                         num++;
-                        //                     }
-                        //                     if(k == project.length-1 && num != project.length-1) {
-                        //                         dataList.push({
-                        //                             "value": 0,
-                        //                             "cost": 0,
-                        //                             "money":0,
-                        //                         })
-                        //                     }
-                        //                 }
-                        //             } else {
-                        //                 dataList.push({
-                        //                     "value": 0,
-                        //                     "cost": 0,
-                        //                     "money":0,
-                        //                 })
-                        //             }
-                        //         }
-                        //         series.push({
-                        //             name: array[i],
-                        //             type: 'bar',
-                        //             stack:'1',
-                        //             barMaxWidth: 30,
-                        //             data: dataList,
-                        //         })
-                        //     }
-                        // } 
-                            
-                            
-                        //     var myChart = echarts.init(document.getElementById("container"));
-                        //     totalHours = totalHours.toFixed(1);
-                        //     // 设置宽度
-                        //     myChart.resize({
-                        //         width: this.widthHtval
-                        //     })
-                        //     // 设置宽度
-                        //     _this.myChart = myChart;
-                        //     var option = {
-                        //         //总成本
-                        //         title: {
-                        //             text: '工时成本总计' + totalMoneyCost.toFixed(2) + '元, 时长'+totalHours+'小时',
-                        //             left:'left',
-                        //         },
-                        //         // 工具箱
-                        //         legend: {
-                        //             x: 80,
-                        //             y: 10,
-                        //             data: yList,
-                        //             show: true,
-                        //        top:"5%",//与上方的距离 可百分比% 可像素px
-                        //         },
-                        //         grid : {
-                        //             top : 80,    //距离容器上边界40像素
-                        //             // bottom: 100,   //距离容器下边界30像素
-                        //             bottom: 35,   //距离容器下边界30像素
-                        //             left: 150,
-                        //             right: 150
-                        //         },
-                        //         toolbox: {
-                        //             show: true,
-                        //             feature:{
-                        //                 saveAsImage:{
-                        //                     show:true
-                        //                 },
-                        //                 restore:{
-                        //                     show:true
-                        //                 },
-                        //                 // dataView:{
-                        //                 //     show:true
-                        //                 // },
-                        //                 // dataZoom:{
-                        //                 //     show:true
-                        //                 // },
-                        //                 magicType:{
-                        //                     type:['line','bar']
-                        //                 }
-                        //             }
-                        //         },
-                        //         tooltip:{
-                        //             trigger:'axis',
-                        //             formatter: function (params,ticket,callback) {
-                        //                 var totalTime = 0;
-                        //                 var totalCost = 0;
-                        //                 var res = "";
-                        //                 for(var i in params) {
-                        //                     if (params[i].data.value > 0) {
-                        //                         res += "<div style='margin-top:3px;font-size:12px;'><font color='#ddd'>项目名称:" + params[i].seriesName 
-                        //                             + "</font><br/>工作成本 : " + params[i].data.money
-                        //                             + "元 <br/>工作时长"+" : " + params[i].data.cost + "小时</br></div>";
-                        //                         totalTime += Number(params[i].data.cost);
-                        //                         totalCost += Number(params[i].data.money);
-                        //                     }
-                        //                 }
-                        //                 res = res +'<br/>'+ params[0].name+ '<br/>总计: ' + totalTime.toFixed(1)+'小时 '+totalCost.toFixed(2) + "元<br/>";
-                        //                 return res;
-                        //             }
-                        //         },
-                        //         xAxis: {
-                        //             data: xList,
-                        //             axisLabel: {
-                        //                 interval:0,rotate:20
-                        //             }
-                        //         },
-                        //         yAxis: [{
-                        //             type : 'value',
-                        //             axisLabel: {
-                        //                 formatter:this.yAxisValue==0?'{value} (元)':'{value} (小时)'
-                        //             }
-                        //         }],
-                        //         series: series,
-                        //     };
-                        //     myChart.setOption(option,{notMerge:true});
+                        this.allListData = res.data
+                        this.gtff()
                     } else {
                         this.$message({
                         message: res.msg,
@@ -584,14 +452,23 @@
                 });
             },
             // 共同方法
-            gtff(data) {
+            gtff() {
+                let data = this.allListData
                 var _this = this;
                 this.hasReportUserList = data.userList;
-                var xList = [] , yList = [] , list = data.list, array = [] , series = [];
+                var xList = [] , yList = [] , list = data.list.slice(0+50*(this.page-1),49+50*(this.page-1)), array = [] , series = [];
                 var totalMoneyCost = data.totalCostMoney;
                 var totalHours = 0.0;
+                for(var i in list) {
+                    if(i>20) {
+                        this.widthHtval = +this.widthHtval + 60
+                    } else {
+                        this.widthHtval = document.body.clientWidth - 230
+                    }
+                }
                 if (list.length > 0) {
                     var num = list.length==0?0:list[0].project.length;
+                    console.log('for 1');
                     for(var i in list) {
                         xList.push(list[i].name);
                         var pro = list[i].project;
@@ -601,12 +478,15 @@
                             }
                         }
                     }
+                    console.log('for 2');
                     for(var i in array) {
                         yList.push(array[i]);
                         var dataList = [];
+                        console.log('for 2 1');
                         for(var j in list) {
                             var project = list[j].project , num = 0;
                             if(project.length != 0) {
+                                console.log('for 2 1 1');
                                 for(var k in project) {
                                     if(project[k].project == array[i]) {
                                         let item = {
@@ -657,6 +537,7 @@
                     myChart.resize({
                         width: this.widthHtval
                     })
+                    console.log('设置宽度');
                     // 设置宽度
                     _this.myChart = myChart;
                     var option = { 
@@ -741,6 +622,7 @@
                         }],
                         series: series,
                     };
+                    console.log('setoption');
                     myChart.setOption(option,{notMerge:true});
             },
             yanjiu() {
@@ -820,7 +702,7 @@
             // 脱离出来的方法
             jieliu() {
                 sessionStorage.radio = this.radio;
-                var _this = this;
+                
                 var param = {};
                 if (this.dateRange != null) {
                     param = {
@@ -857,22 +739,28 @@
                 this.http.post(url, param,
                 res => {
                     if (res.code == "ok") {
-                        // 更具数据的长度去加每个柱子的间距
-                        for(var i in res.data.costList) {
-                            if(i>20) {
-                                this.widthHtval = +this.widthHtval + 40
-                            } else {
-                                this.widthHtval = document.body.clientWidth - 230
-                            }
-                        }
-                        // console.log(this.dayjs().add('0','day').format("YYYY-MM-DD HH:mm:ss"), '结束处理')
-                        // if(res.data.costList.length > 20) {
-                        //     for(var i in res.data.costList) {
-                        //         this.widthHtval = +this.widthHtval + 40
-                        //     }
-                        // } else {
-                        //     this.widthHtval = document.body.clientWidth - 230
-                        // }
+                        this.allListData = res.data
+                        this.page = 1
+                        
+                        this.jieliu_echarts()
+                    } else {
+                        this.$message({
+                            message: res.msg,
+                            type: "error"
+                        });
+                    }
+                },
+                error => {
+                    this.$message({
+                        message: error,
+                        type: "error"
+                    });
+                });
+            },
+            jieliu_echarts(){
+                var _this = this;
+                // 更具数据的长度去加每个柱子的间距
+                        
 
                         var xList = []
                         var yList = []
@@ -880,8 +768,18 @@
                         var totalMoneyCost;
                         var totalHours = 0.0;
                         if(this.radio == this.$t('other.project') || this.radio == this.$t('projectclassification') || this.radio==this.$t('lable.department') || this.radio == this.$t('zhu-xiang-mu')) {
-                            list = res.data.costList
-                            totalMoneyCost = ((this.radio==this.$t('other.project') || this.radio == this.$t('projectclassification'))?res.data.totalMoneyCost:res.data.totalCostMoney);
+                            // this.allListData = res.data.costList
+                            this.total = this.allListData.costList.length
+                            list = this.allListData.costList.slice(0+50*(this.page-1),49+50*(this.page-1))
+                            for(var i in list) {
+                                if(i>20) {
+                                    this.widthHtval = +this.widthHtval + 60
+                                } else {
+                                    this.widthHtval = document.body.clientWidth - 230
+                                }
+                            }
+                            // list = res.data.costList
+                            totalMoneyCost = ((this.radio==this.$t('other.project') || this.radio == this.$t('projectclassification'))?this.allListData.totalMoneyCost:this.allListData.totalCostMoney);
 
                             for(var i in list) {
                                 if(this.radio==this.$t('other.project') || this.radio == this.$t('zhu-xiang-mu')) {
@@ -943,7 +841,10 @@
                             }
                         } 
                         else if(this.theCustomListFlg) {
-                            list = res.data.list
+                            // this.allListData = res.data.list
+                            this.total = this.allListData.list.length
+                            list = this.allListData.list.slice(0+50*(this.page-1),49+50*(this.page-1))
+                            // list = res.data.list
                             
                             for(var i in list) {
                                 // console.log(list[i].name, list[i].costMoney, list[i].cost)
@@ -966,7 +867,10 @@
                             }
                         } 
                         else {
-                            list = res.data
+                            // list = res.data
+                            // this.allListData = res.data
+                            this.total = this.allListData.length
+                            list = this.allListData.slice(0+50*(this.page-1),49+50*(this.page-1))
                             
                             for(var i in list) {
                                 // console.log(list[i].name, list[i].costMoney, list[i].cost)
@@ -989,8 +893,7 @@
                             }
                         }
                         totalHours = totalHours.toFixed(1);
-                                            
-                        var myChart = echarts.init(document.getElementById("container"));
+                var myChart = echarts.init(document.getElementById("container"));
                         myChart.resize({
                             width: this.widthHtval
                         })
@@ -1142,19 +1045,6 @@
                                 }
                             }
                         });
-                    } else {
-                        this.$message({
-                            message: res.msg,
-                            type: "error"
-                        });
-                    }
-                },
-                error => {
-                    this.$message({
-                        message: error,
-                        type: "error"
-                    });
-                });
             },
 
             // 左右滚动
@@ -1313,6 +1203,12 @@
         right: 10px;
         top: 0;
     }
+    .poss {
+        position: fixed;
+        bottom: -10px;
+        right: 1%;
+        box-sizing: border-box;
+    }
 </style>
 
 <style lang="scss">

+ 67 - 11
fhKeeper/formulahousekeeper/timesheet/src/views/project/finance.vue

@@ -44,7 +44,14 @@
         <el-dialog :title="$t('Salaryuploadrecord')" :visible.sync="xzImportVisible" width="1100px" :before-close="handleClose">
             <div>
                 <el-table :data="xzList" style="width: 100%" :height="400">
-                    <el-table-column prop="userName" :label="$t('other.operator')"></el-table-column>
+                    <el-table-column prop="userName" :label="$t('other.operator')">
+                        <template slot-scope="scope">
+                            <div>
+                                <span v-if="user.userNameNeedTranslate == '1'"><ww-open-data type='userName' :openid='scope.row.userName'></ww-open-data></span>
+                                <span v-if="user.userNameNeedTranslate != '1'">{{scope.row.userName}}</span>
+                            </div>
+                        </template>
+                    </el-table-column>
                     <el-table-column prop="ymonth" :label="$t('BelongsIn')"></el-table-column>
                     <el-table-column prop="fileName" :label="$t('filename')">
                         <template slot-scope="scope">
@@ -91,7 +98,14 @@
                 </el-radio-group>
                 
                 <el-table :data="reviewLis" style="width: 100%" :height="400">
-                    <el-table-column prop="userName" :label="$t('other.operator')"></el-table-column>
+                    <el-table-column prop="userName" :label="$t('other.operator')">
+                        <template slot-scope="scope">
+                            <div>
+                                <span v-if="user.userNameNeedTranslate == '1'"><ww-open-data type='userName' :openid='scope.row.userName'></ww-open-data></span>
+                                <span v-if="user.userNameNeedTranslate != '1'">{{scope.row.userName}}</span>
+                            </div>
+                        </template>
+                    </el-table-column>
                     <el-table-column prop="ymonth" :label="$t('BelongsIn')"></el-table-column>
                     <el-table-column prop="fileName" :label="$t('filename')">
                         <template slot-scope="scope">
@@ -132,9 +146,13 @@
         <el-dialog :title="$t('Setupauditor')" :visible.sync="reviewerVisible" width="350px" :before-close="handleCloses">
             <el-form :model="reviewerRuleForm" ref="reviewerRuleForm" label-width="100px" class="demo-ruleForm">
                 <el-form-item :label="$t('SelectionofAuditor')" prop="auditorId" :rules="{required: true, message: $t('reviewercannotbeempty'), trigger: 'blur'}">
-                    <el-select v-model="reviewerRuleForm.auditorId" clearable :placeholder="$t('SelectionofAuditor')" >
+
+                    <el-select v-model="reviewerRuleForm.auditorId" clearable :placeholder="$t('SelectionofAuditor')" v-if="user.userNameNeedTranslate != '1'" >
                         <el-option v-for="(item, index) in people" :key="index" :label="item.name" :value="item.id"></el-option>
                     </el-select>
+
+                    <selectCat v-if="user.userNameNeedTranslate == '1'" @selectCal="selectCal" :subject="people" :subjectId="reviewerRuleForm.auditorId" :distinction="'1'" :size="'mini'"></selectCat>
+
                 </el-form-item>
                 <el-form-item>
                     <el-button type="primary" @click="submitreviewerRuleForm('reviewerRuleForm')">{{ $t('btn.submit') }}</el-button>
@@ -167,7 +185,14 @@
         :height="300" style="width: 100%;">
             <el-table-column type="selection" width="80" fixed="left"></el-table-column>
             <el-table-column prop="jobNumber" v-if="user.timeType.financeJobnumEnabled==1" :label="$t('Worknumber')" sortable width="100" fixed="left"></el-table-column>
-            <el-table-column prop="name" :label="$t('lable.name')" sortable width="150" fixed="left"></el-table-column>
+            <el-table-column prop="name" :label="$t('lable.name')" sortable width="150" fixed="left">
+                <template slot-scope="scope">
+                    <div>
+                        <span v-if="user.userNameNeedTranslate == '1'"><ww-open-data type='userName' :openid='scope.row.name'></ww-open-data></span>
+                        <span v-if="user.userNameNeedTranslate != '1'">{{scope.row.name}}</span>
+                    </div>
+                </template>
+            </el-table-column>
             <template v-if="user.timeType.isSecretSalary==0">
                 <el-table-column :prop="headerCols[index]" :label="item" sortable show-overflow-tooltip v-for="(item, index) in tblCols" :key="index" width="130px" align="right">
                 <template slot-scope="scope">
@@ -246,10 +271,16 @@
 
         <!--用户详细信息弹出框-->
         <el-dialog :title="$t('Checkthedetails')" v-if="userDetailVisible" :visible.sync="userDetailVisible" :close-on-click-modal="false" customClass="customWidth" width="400px">
-            <div class="line"><span>{{ $t('lable.name') }}</span><span>{{userDetail.name}}</span></div>
+            <div class="line"><span>{{ $t('lable.name') }}</span>
+                <span v-if="user.userNameNeedTranslate == '1'"><ww-open-data type='userName' :openid='userDetail.name'></ww-open-data></span>
+                <span v-if="user.userNameNeedTranslate != '1'">{{userDetail.name}}</span>
+            </div>
             <div class="line"><span>{{ $t('Worknumber') }}</span><span>{{userDetail.jobNumber}}</span></div>
             <div class="line"><span>{{ $t('lable.phone') }}</span><span>{{userDetail.phone}}</span></div>
-            <div class="line"><span>{{ $t('lable.department') }}</span><span>{{userDetail.departmentName}}</span></div>
+            <div class="line"><span>{{ $t('lable.department') }}</span>
+                <span v-if="user.userNameNeedTranslate == '1'"><ww-open-data type='departmentName' :openid='userDetail.departmentName'></ww-open-data></span>
+                <span v-if="user.userNameNeedTranslate != '1'">{{userDetail.departmentName}}</span>
+            </div>
             <div class="line"><span>{{ $t('costof') }}</span><span>{{userDetail.cost}}{{$t('Yuananhour')}}</span></div>
             <div slot="footer" class="dialog-footer">
                 <el-button type="primary" @click="userDetailVisible = false" >{{ $t('btn.determine') }}</el-button>
@@ -411,7 +442,14 @@
                      ref="settingTable"  @selection-change="handleSelectionChange" 
                     :height="400" style="width: 100%;">
                     <el-table-column type="selection" width="55"></el-table-column>
-                    <el-table-column prop="name" :label="$t('lable.name')" sortable width="90" fixed="left"></el-table-column>
+                    <el-table-column prop="name" :label="$t('lable.name')" sortable width="90" fixed="left">
+                        <template slot-scope="scope">
+                            <div>
+                                <span v-if="user.userNameNeedTranslate == '1'"><ww-open-data type='userName' :openid='scope.row.name'></ww-open-data></span>
+                                <span v-if="user.userNameNeedTranslate != '1'">{{scope.row.name}}</span>
+                            </div>
+                        </template>
+                    </el-table-column>
                     
                     <el-table-column :label="item.projectName" v-for="(item) in projectCols" width="180" size="small"
                         :key="item.id" align="center">
@@ -458,10 +496,14 @@
             :close-on-click-modal="false" customClass="customWidth" width="600px" >
             <div style="margin:0px 10px 10px 10px;">
                 <span>{{ $t('Selecttheemployee') }}</span>
-                <el-select v-model="chosenNoReportUserIds" multiple filterable clearable style="width:330px;" collapse-tags>
-                        <el-option v-for="item in noReportUserList" :label="item.name" :key="item.id" :value="item.userId"></el-option>
-                    </el-select>
-                    <el-button @click="averageCost" >{{ $t('Automaticallocation') }}</el-button>
+
+                <el-select v-if="user.userNameNeedTranslate != '1'" v-model="chosenNoReportUserIds" multiple filterable clearable style="width:330px;" collapse-tags>
+                    <el-option v-for="item in noReportUserList" :label="item.name" :key="item.id" :value="item.userId"></el-option>
+                </el-select>
+
+                <selectCat v-if="user.userNameNeedTranslate == '1'" @selectCal="selectCal" :subject="noReportUserList" :subjectId="chosenNoReportUserIds" :distinction="'2'" :size="'mini'"></selectCat>
+
+                <el-button @click="averageCost" >{{ $t('Automaticallocation') }}</el-button>
             </div>
             <el-divider ></el-divider>
             <!--项目列表 -->
@@ -526,7 +568,13 @@
 import { error } from 'dingtalk-jsapi';
     import util from "../../common/js/util";
 
+// 自定义select组件
+    import selectCat from "@/components/select.vue"
+    
     export default {
+        components: {
+            selectCat
+        },
         data() {
             return {
                 groupByCategory:0,
@@ -1632,6 +1680,14 @@ import { error } from 'dingtalk-jsapi';
                 event.preventDefault() // 阻止浏览器默认事件
                 this.domObj.scrollLeft = this.domObj.scrollLeft + step
             },
+            // 自定义组件事件
+            selectCal(obj) {
+                if(obj.distinction == '1') {
+                    this.reviewerRuleForm.auditorId = obj.id
+                } else if(obj.distinction == '2') {
+                    this.chosenNoReportUserIds = obj.id
+                }
+            }
 
         },
         created() {

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

@@ -119,7 +119,14 @@
                         </template>
                     </el-table-column>
                     <!-- <el-table-column prop="projectCategorySub" label="项目分组" sortable width="300" v-if="user.companyId == '428'"></el-table-column> -->
-                    <el-table-column prop="departmentName" :label="$t('subordinatedepartments')" sortable width="300" v-if="user.timeType.projectWithDept"></el-table-column>
+                    <el-table-column prop="departmentName" :label="$t('subordinatedepartments')" sortable width="300" v-if="user.timeType.projectWithDept">
+                        <template slot-scope="scope">
+                            <div>
+                                <span v-if="user.userNameNeedTranslate == '1'"><ww-open-data type='departmentName' :openid='scope.row.departmentName'></ww-open-data></span>
+                                <span v-if="user.userNameNeedTranslate != '1'">{{departmentName}}</span>
+                            </div>
+                        </template>
+                    </el-table-column>
                     <el-table-column prop="projectName" :label="$t('headerTop.projectName')" sortable width="260" show-overflow-tooltip>
                         <template slot-scope="scope">
                             <el-link type="primary" :href="'#/projectInside/'+scope.row.projectId">{{scope.row.projectName}}</el-link>
@@ -128,7 +135,8 @@
                     <el-table-column prop="executorName" :label="$t('zhi-hang-ren')" sortable width="130">
                         <template slot-scope="scope">
                             <!-- <el-link type="primary" @click="showUser(scope.row.executorId)">{{scope.row.executorName}}</el-link> -->
-                            <span>{{scope.row.executorName}}</span>
+                            <span v-if="user.userNameNeedTranslate == '1'"><ww-open-data type='userName' :openid='scope.row.departmentName'></ww-open-data></span>
+                            <span v-if="user.userNameNeedTranslate != '1'">{{scope.row.executorName}}</span>
                         </template>
                     </el-table-column>
                     
@@ -163,10 +171,16 @@
         </div>
         <!--用户详细信息弹出框-->
         <el-dialog :title="$t('Checkthedetails')" v-if="userDetailVisible" :visible.sync="userDetailVisible" :close-on-click-modal="false" customClass="customWidth" width="400px">
-            <div class="line"><span>{{ $t('lable.name') }}</span><span>{{userDetail.name}}</span></div>
+            <div class="line"><span>{{ $t('lable.name') }}</span>
+                <span v-if="user.userNameNeedTranslate == '1'"><ww-open-data type='userName' :openid='userDetail.name'></ww-open-data></span>
+                <span v-if="user.userNameNeedTranslate != '1'">{{userDetail.name}}</span>
+            </div>
             <div class="line"><span>{{ $t('Worknumber') }}</span><span>{{userDetail.jobNumber}}</span></div>
             <div class="line"><span>{{ $t('lable.phone') }}</span><span>{{userDetail.phone}}</span></div>
-            <div class="line"><span>{{ $t('lable.department') }}</span><span>{{userDetail.departmentName}}</span></div>
+            <div class="line"><span>{{ $t('lable.department') }}</span>
+                <span v-if="user.userNameNeedTranslate == '1'"><ww-open-data type='departmentName' :openid='userDetail.name'></ww-open-data></span>
+                <span v-if="user.userNameNeedTranslate != '1'">{{userDetail.departmentName}}</span>
+            </div>
             <div class="line"><span>{{ $t('costof') }}</span><span>{{userDetail.cost}}{{ $t('Yuananhour') }}</span></div>
             <div slot="footer" class="dialog-footer">
                 <el-button type="primary" @click="userDetailVisible = false" >{{ $t('btn.determine') }}</el-button>
@@ -227,12 +241,16 @@
                     </el-form-item>
                 <div style="border: 1px solid #ddd;margin:5px 0;padding:5px 0;">
                 <el-form-item :label="$t('zhi-hang-ren')+(index+1)" v-for="(executorItem, index) in addForm.executorListFront" :key="index">
-                    <el-select v-model="executorItem.executorId" :disabled="(addForm.id != null && user.id != addForm.createrId && currentProject.inchargerId != user.id) && !permissions.projectManagement" size="small" filterable clearable :placeholder="$t('pleaseselectanexecutor')" style="width:40%;" @change="$forceUpdate()">
+
+                    <el-select v-if="user.userNameNeedTranslate != '1'" v-model="executorItem.executorId" :disabled="(addForm.id != null && user.id != addForm.createrId && currentProject.inchargerId != user.id) && !permissions.projectManagement" size="small" filterable clearable :placeholder="$t('pleaseselectanexecutor')" style="width:40%;" @change="$forceUpdate()">
                         <el-option v-for="item in users" :key="item.id" :label="item.name" :value="item.id">
                             <span style="float: left">{{ item.name }}</span>
                             <span style="float: right; color: #8492a6; font-size: 13px;margin-left: 20px" v-if="item.jobNumber">{{ item.jobNumber }}</span>
                         </el-option>
                     </el-select>
+                    
+                    <selectCat :subject="users" :subjectId="executorItem.executorId" :index="index" @selectCal="selectCal" :size="'mini'" v-if="user.userNameNeedTranslate == '1'"></selectCat>
+
                     <span style="margin-left:30px;margin-right:10px;">{{ $t('plantime') }}</span>
                     <el-input-number size="small" :disabled="(addForm.id != null && user.id != addForm.createrId && currentProject.inchargerId != user.id) && !permissions.projectManagement" v-model="executorItem.planHours" style="width:30%;" :min="1" :max="100"  :placeholder="$t('pleaseentertheplannedworking')" ></el-input-number ><span style="margin-left:10px;">{{ $t('time.hour') }}</span>
                     <!--移除执行人 -->
@@ -379,8 +397,8 @@
                             <p @click="chan">{{ $t('participantin') }}</p>
                             <span  v-for="(pl, i) in critic" :key="i">
                             <div class="bj" style="width: 14%">
-                                <span style="background: #778899">{{pl.length > 2 ? pl.substring(pl.length - 2, pl.length) : pl}}</span>
-                                <!-- <span style="background: #778899">{{pl.length}}</span> -->
+                                <span style="background: #778899" v-if="user.userNameNeedTranslate != '1'">{{pl.length > 2 ? pl.substring(pl.length - 2, pl.length) : pl}}</span>
+                                <span style="background: #778899" v-if="user.userNameNeedTranslate == '1'"><ww-open-data type='userName' :openid='pl'></ww-open-data></span>
                             </div>
                             </span>
                         </div>
@@ -399,11 +417,17 @@
                                     <!-- <el-image style="width: 30px; height: 30px" :src="url" :fit="fit"></el-image> -->
                                     <!-- <i :style="'background' + item.userColor"> -->
                                     <i :style="'background' + item.userColor">
-                                        {{item.userName.length > 2 ? item.userName.substring(item.userName.length - 2, item.userName.length) : item.userName}}
+                                        <i v-if="user.userNameNeedTranslate != '1'">
+                                            {{item.userName.length > 2 ? item.userName.substring(item.userName.length - 2, item.userName.length) : item.userName}}
+                                        </i>
+                                        <i v-if="user.userNameNeedTranslate == '1'">
+                                            <ww-open-data type='userName' :openid='item.userName'></ww-open-data>
+                                        </i>
                                     </i>
                                     <div>
                                         <!-- <p>{{item.userName}}</p> -->
-                                        <p>{{item.userName}}</p>
+                                        <p v-if="user.userNameNeedTranslate != '1'">{{item.userName}}</p>
+                                        <p v-if="user.userNameNeedTranslate == '1'"><ww-open-data type='userName' :openid='item.userName'></ww-open-data></p>
                                         <em>{{item.content}}</em>
                                     </div>
                                     <span>{{item.createTime | relativeTime}}</span>
@@ -598,6 +622,10 @@
 <script>
 import { error } from 'dingtalk-jsapi';
     import util from "../../common/js/util";
+
+    // 引入自定义组件
+    import selectCat from "@/components/select.vue"
+
         // 富文本样式
     import 'quill/dist/quill.core.css'
     import 'quill/dist/quill.snow.css'
@@ -616,7 +644,8 @@ import { error } from 'dingtalk-jsapi';
             // ProjectInfo,
             // Summary,
             // Earning,
-            quillEditor // 富文本
+            quillEditor, // 富文本
+            selectCat
         },
         data() {
             return {
@@ -1683,6 +1712,11 @@ import { error } from 'dingtalk-jsapi';
                 }
                 return arr;
             },
+            selectCal(obj) {
+                if(obj.distinction == '1') {
+                    this.addForm.executorListFront[obj.index].executorId = obj.id
+                }
+            }
         },
         created() {
             let height = window.innerHeight;

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

@@ -1088,6 +1088,8 @@ export default {
               message: '同步成功',
               type: "success",
             });
+            this.getUser();
+            this.getUsers();
           } else {
             this.$message({
               message: res.msg,

+ 33 - 6
fhKeeper/formulahousekeeper/timesheet/src/views/workReport/daily.vue

@@ -119,6 +119,7 @@
                                     <!-- 未填写 -->
                                     {{$t('state.DidNotFillIn')}}
                                     <el-link :underline="false" @click="showMembList(0)"><span style="margin-left:5px;margin-right:5px;color:red;">{{(depData == null?data[0].membCount:(depData.isUser == 1?1:depData.membCount))-reportList.length | numbers}}</span></el-link>{{$t('other.people')}}
+                                    <span v-if="leaveAllNum">{{'(全天请假' + leaveAllNum + '人)'}}</span>
                                     </span>
                                     </span>
                                 </span>
@@ -167,7 +168,7 @@
                                         <el-timeline>
                                             <el-timeline-item v-for="(item2,index2) in item1.data" :key="index2">
                                                 <el-card shadow="never">
-                                                    <p><!-- 项目 -->{{$t('other.project')}}:<b>{{item2.project}}</b><span v-if="item2.subProjectName != null"> / {{item2.subProjectName}}</span>
+                                                    <p><!-- 项目 -->{{$t('other.project')}}:<b v-if="item2.projectCode">{{item2.projectCode + '/'}}</b><b>{{item2.project}}</b><span v-if="item2.subProjectName != null"> / {{item2.subProjectName}}</span>
                                                     
                                                     <span v-if="user.company.packageEngineering == 0">
                                                     <span style="margin-left:15px;color:#DAA520;"  v-if="item2.state == 0">[ 
@@ -438,13 +439,16 @@
                         </el-select>
                     </el-form-item>
                     <el-form-item :label="user.companyId==781? $t('other.reviewer') : $t('other.projectAuditor')">
-                        <el-select v-model="domain.projectAuditorId" :disabled="!domain.canEdit" @change="$forceUpdate()">
+
+                        <el-select v-model="domain.projectAuditorId" :disabled="!domain.canEdit" @change="$forceUpdate()" v-if="user.userNameNeedTranslate != '1'">
                             <el-option v-for="item in domain.auditUserList" :label="item.auditorName" :value="item.auditorId" :key="item.id">
-                                <!-- <span style="float: left">{{ item.auditorName }}</span> -->
                                 <span style="float: left" v-if="user.userNameNeedTranslate == '1'"><ww-open-data type='userName' :openid='item.auditorName'></ww-open-data></span>
                                 <span style="float: left" v-if="user.userNameNeedTranslate != '1'">{{item.auditorName}}</span>
                             </el-option>
                         </el-select>
+
+                        <selectCat v-if="user.userNameNeedTranslate == '1'" :size="'small'" :subject="domain.auditUserList" :idx="index" :subjectId="domain.projectAuditorId" ref="selectCat" :flg="true" @selectCatCli="selectCatCli"></selectCat>
+
                     </el-form-item>
                     <!-- 相关维度/自定义维度 -->
                     <el-form-item :label="yonghuUser.customDegreeName" v-if="domain.projectId && yonghuUser.customDegreeActive == 1" :rules="user.timeType.customDegreeStatus == 1 && domain.wuduList != undefined && domain.wuduList.length != 0 ? { required: true, message: $t('defaultText.pleaseChoose') + yonghuUser.customDegreeName, trigger: ['change','blur'] } : null" :prop="'domains.' + index + '.degreeId'">
@@ -555,14 +559,17 @@
                             </el-select>
                         </el-form-item>
                         <el-form-item :label="$t('other.projectAuditor')" >
-                            <el-select v-model="domain.projectAuditorId" :disabled="!domain.canEdit" @change="$forceUpdate()">
+                            <el-select v-model="domain.projectAuditorId" :disabled="!domain.canEdit" @change="$forceUpdate()" v-if="user.userNameNeedTranslate != '1'">
                                 <el-option v-for="item in domain.auditUserList" :label="item.auditorName" :value="item.auditorId" :key="item.id">
-                                    <!-- <span style="float: left">{{ item.auditorName }}</span> -->
                                     <span style="float: left" v-if="user.userNameNeedTranslate == '1'"><ww-open-data type='userName' :openid='item.auditorName'></ww-open-data></span>
                                     <span style="float: left" v-if="user.userNameNeedTranslate != '1'">{{item.auditorName}}</span>
                                 </el-option>
                             </el-select>
+
+                            <selectCat v-if="user.userNameNeedTranslate == '1'" :size="'small'" :subject="domain.auditUserList" :idx="index" :subjectId="domain.projectAuditorId" ref="selectCat" :flg="true" @selectCatCli="selectCatCli"></selectCat>
                         </el-form-item>
+                        
+
                         <!--工程专业版本模式下, 各个专业的进度填报 -->
                         <el-form-item :label="$t('other.professionalProgress')" :prop="'domains.' + index + '.professionProgress'" v-if="user.company.packageEngineering==1">
                             <span v-for="item in domain.professionProgress" :key="item.professionId" style="margin-right:10px;">
@@ -1449,9 +1456,16 @@
     // 左右滑动
     import dragMixin from "@/common/js/tensile.js";
     import util from "../../common/js/util";
+
+    // 自定义select组件
+    import selectCat from "@/components/select.vue"
+    
     let _that = this
     export default {
         mixins: [dragMixin],
+        components: {
+            selectCat
+        },
         data() {
             return {
                 translation: '1', // 1、文字, 2、部门, 3、人员
@@ -1568,6 +1582,7 @@
                         multiWorktime:0,
                         worktimeList:[],
                         degreeId: null,
+                        auditUserList: []
                     }],
                 },
                 workRules: {
@@ -1690,7 +1705,8 @@
                 weeklyFilledTimeLoading: false,
                 workReportStateString: [this.$t('state.WaitingAudit'),this.$t('state.alreadyPassed'),this.$t('state.rejected'),this.$t('state.waitingsubmit')],
                 weeklyFilledTimeCanDelete: false,
-                weeklyFilledTimeDate: null
+                weeklyFilledTimeDate: null,
+                leaveAllNum: 0
             };
         },
         watch: {
@@ -3475,6 +3491,12 @@
                                 this.fillMembList = this.unFillList;
                             }
                         }
+                        this.leaveAllNum = 0
+                        for(let i in this.unFillList){
+                            if(this.unFillList[i].leaveDays >= 1 || this.unFillList[i].leaveTimes >= this.user.timeType.allday){
+                                this.leaveAllNum += 1
+                            }
+                        }
                         this.stateChange()
                     } else {
                         this.$message({
@@ -5701,6 +5723,11 @@
                     }
                 })
             },
+            // 触发 selectCat 组件更改他的值
+            selectCatCli(obj) {
+                // obj.id 是 选中人员的id, obj.idx 是 当前的索引
+                this.workForm.domains[obj.idx].projectAuditorId = obj.id
+            },
             //分页
             handleCurrentChange(val) {
                 this.toViewForm.pageIndex = val;

+ 97 - 15
fhKeeper/formulahousekeeper/timesheet/src/views/workReport/list.vue

@@ -6,15 +6,23 @@
                 <el-form-item :label="$t('lable.department')" style="width: 165px">
                     <el-cascader v-model="search.departmentIdArray" :placeholder="$t('defaultText.pleaseChoose')" style="width: 125px"
                     :options="option" :props="{ checkStrictly: false,expandTrigger: 'hover' }" :show-all-levels="false" clearable
-                    @change="getList(1)" size="mini"
-                    ></el-cascader>
-                    <!-- <el-button @click="test" size="mini">test</el-button> -->
+                    @change="getList(1)" size="mini">
+                        <template slot-scope="{ data }">
+                            <span v-if="user.userNameNeedTranslate == '1'"><ww-open-data type='departmentName' :openid='data.label'></ww-open-data></span>
+                            <span v-if="user.userNameNeedTranslate != '1'">{{data.label}}</span>
+                        </template>
+                    </el-cascader>
                 </el-form-item>
+
                 <el-form-item :label="$t('ren-yuan')" style="width: 210px">
-                        <el-select v-model="search.userIdArray" :placeholder="$t('defaultText.pleaseChoose')" clearable @visible-change="usersSearch" @remove-tag="usersSearch(false)" @clear="usersSearch(false)" filterable="true" size="mini" style="width: 150px" multiple collapse-tags>
-                            <el-option v-for="item in searchUsersList" :key="item.id" :label="item.name" :value="item.id"></el-option>
-                        </el-select>
-                    </el-form-item>
+                    <el-select v-model="search.userIdArray" :placeholder="$t('defaultText.pleaseChoose')" clearable @visible-change="usersSearch" @remove-tag="usersSearch(false)" @clear="usersSearch(false)" filterable="true" size="mini" style="width: 150px" multiple collapse-tags>
+                        <el-option v-for="item in searchUsersList" :key="item.id" :label="item.name" :value="item.id">
+                            <span style="float: left" v-if="user.userNameNeedTranslate == '1'"><ww-open-data type='userName' :openid='item.name'></ww-open-data></span>
+                            <span style="float: left" v-if="user.userNameNeedTranslate != '1'">{{item.name}}</span>
+                        </el-option>
+                    </el-select>
+                </el-form-item>
+
                 <el-form-item :label="$t('other.project')" style="width: 215px">
                     <el-select v-model="search.projectId" :placeholder="$t('defaultText.pleaseChoose')" clearable @change="getList()" filterable="true" size="mini" style="width: 175px" popper-class="projectSelectPopperClass">
                         <el-option v-for="item in projectList" :key="item.id" :label="item.projectName + item.projectCode" :value="item.id">
@@ -49,6 +57,11 @@
                     <el-form-item style="margin-left:20px;">
                     <el-link type="primary" @click="recordList(),recordDialogVisible = true,pageIndexList = 1,pageSizeList = 20">{{ $t('Auditrecords') }}</el-link>
                     </el-form-item>
+
+                    <!-- 调试 -->
+                    <!-- <el-form-item :label="$t('ren-yuan')" style="width: 215px">
+                        <selectCat :size="'mini'" :subject="searchUsersList"/>
+                    </el-form-item> -->
                 <!-- </div> -->
             </el-form>
         </el-col>
@@ -65,14 +78,28 @@
                                 <span style="margin-left:15px;color:#DAA520;" >[ 
                                                 <span v-if="item.isDeptAudit==0">
                                                     <span v-if="item.projectAuditState==0">
-                                                        {{ $t('other.waitForTheProjectReviewer') }}<span v-if="item.projectAuditorName != null">({{item.projectAuditorName}})</span>{{ $t('other.audit') }}
+                                                        {{ $t('other.waitForTheProjectReviewer') }}<span v-if="item.projectAuditorName != null">(
+                                                            <!-- {{item.projectAuditorName}} -->
+                                                            <span v-if="user.userNameNeedTranslate == '1'"><ww-open-data type='userName' :openid='item.projectAuditorName'></ww-open-data></span>
+                                                            <span v-if="user.userNameNeedTranslate != '1'">{{item.projectAuditorName}}</span>
+                                                            )</span>{{ $t('other.audit') }}
                                                     </span>
                                                     <span style="color:#32CD32;" v-else-if="item.projectAuditState==1">
-                                                        {{ $t('other.projectAuditor') }}<span v-if="item.projectAuditorName != null">({{item.projectAuditorName}})</span>{{ $t('state.approved') }}
+                                                        {{ $t('other.projectAuditor') }}<span v-if="item.projectAuditorName != null">(
+                                                            <!-- {{item.projectAuditorName}} -->
+                                                            <span v-if="user.userNameNeedTranslate == '1'"><ww-open-data type='userName' :openid='item.projectAuditorName'></ww-open-data></span>
+                                                            <span v-if="user.userNameNeedTranslate != '1'">{{item.projectAuditorName}}</span>
+                                                        )</span>{{ $t('state.approved') }}
                                                     </span>
                                                 </span>
                                                 <span v-else-if="item.isDeptAudit==1">
-                                                    {{($t('other.await') +item.auditDeptName+('('+item.deptAuditorName+')')+ $t('other.audit'))}}
+                                                    <!-- {{($t('other.await') +item.auditDeptName+('('+item.deptAuditorName+')')+ $t('other.audit'))}} -->
+                                                    ({{$t('other.await')}}
+                                                    <span v-if="user.userNameNeedTranslate == '1'"><ww-open-data type='departmentName' :openid='item.auditDeptName'></ww-open-data></span>
+                                                    <span v-if="user.userNameNeedTranslate != '1'">{{item.auditDeptName}}</span>
+                                                    (<span v-if="user.userNameNeedTranslate == '1'"><ww-open-data type='userName' :openid='item.deptAuditorName'></ww-open-data></span>
+                                                    <span v-if="user.userNameNeedTranslate != '1'">{{item.deptAuditorName}}</span>)
+                                                    {{$t('other.audit')}})
                                                 </span>
                                                  ]
                                 </span>
@@ -131,8 +158,30 @@
                 </template>
             </el-table-column>
             
-            <el-table-column prop="name" :label="$t('lable.name')" sortable></el-table-column>
-            <el-table-column prop="departmentName" :label="$t('lable.department')" sortable></el-table-column>
+            <el-table-column prop="name" :label="$t('lable.name')" sortable>
+                <template slot-scope="scope">
+                    <div>
+                        <span v-if="user.userNameNeedTranslate == '1'">
+                            <ww-open-data type='userName' :openid='scope.row.name'></ww-open-data>
+                        </span>
+                        <span v-else>
+                            {{scope.row.name}}
+                        </span>
+                    </div>
+                </template>
+            </el-table-column>
+            <el-table-column prop="departmentName" :label="$t('lable.department')" sortable>
+                <template slot-scope="scope">
+                    <div>
+                        <span v-if="user.userNameNeedTranslate == '1'">
+                            <ww-open-data type='departmentName' :openid='scope.row.departmentName'></ww-open-data>
+                        </span>
+                        <span v-else>
+                            {{scope.row.departmentName}}
+                        </span>
+                    </div>
+                </template>
+            </el-table-column>
             <el-table-column prop="dateStr" :label="$t('weekDay.date')" sortable>
             </el-table-column>
             <el-table-column prop="reportTime" :label="$t('screening.workTime') + '(h)'" >
@@ -147,7 +196,20 @@
             </el-table-column>
             <el-table-column prop="state" :label="$t('state.states')" sortable>
                 <template slot-scope="scope">
-                    <span v-if="scope.row.state == 0" style="color:#DAA520;">{{scope.row.isDeptAudit==0?$t('other.Tobereviewedbytheprojectreviewer'):($t('other.await')+scope.row.auditDeptName+('('+scope.row.deptAuditorName+')')+$t('other.audit'))}}</span>
+                    <span v-if="scope.row.state == 0" style="color:#DAA520;">
+                        <span v-if="user.userNameNeedTranslate != '1'">
+                            {{scope.row.isDeptAudit==0?$t('other.Tobereviewedbytheprojectreviewer'):($t('other.await')+scope.row.auditDeptName+('('+scope.row.deptAuditorName+')')+$t('other.audit'))}}
+                        </span>
+                        <span v-if="user.userNameNeedTranslate == '1'">
+                            <span v-if="scope.row.isDeptAudit==0">{{$t('other.Tobereviewedbytheprojectreviewer')}}</span>
+                            <span v-else>
+                                {{$t('other.await')}}
+                                <ww-open-data type='departmentName' :openid='scope.row.auditDeptName'></ww-open-data>
+                                (<ww-open-data type='userName' :openid='scope.row.deptAuditorName'></ww-open-data>)
+                                {{$t('other.audit')}}
+                            </span>
+                        </span>
+                    </span>
                     <span v-else-if="scope.row.state == 1" style="color:#32CD32;">{{ $t('state.alreadyPassed') }}</span>
                     <span v-else-if="scope.row.state == 2" style="color:#FF0000;">{{ $t('state.rejected') }}</span>
                 </template>
@@ -197,7 +259,16 @@
         <el-dialog :title="$t('Auditrecords')" :visible.sync="recordDialogVisible" width="1000px" :before-close="handleClose">
             <div style="height: 430px">
                 <el-table :data="recordLists" style="width: 100%" height="400">
-                    <el-table-column prop="userName" :label="$t('other.operator')" width="120"></el-table-column>
+                    <el-table-column prop="userName" :label="$t('other.operator')" width="120">
+                        <template slot-scope="scope">
+                            <div>
+                                <span v-if="user.userNameNeedTranslate == '1'">
+                                    <ww-open-data type='userName' :openid='scope.row.userName'></ww-open-data>
+                                </span>
+                                <span v-else>{{scope.row.userName}}</span>
+                            </div>
+                        </template>
+                    </el-table-column>
                     
                     <el-table-column prop="indate" :label="$t('AuditTime')"></el-table-column>
                     <el-table-column prop="result" :label="$t('Reviewtheresults')" width="120" show-overflow-tooltip></el-table-column>
@@ -269,7 +340,12 @@
                     <el-table-column prop="userName" :label="$t('EmployeeDate')">
                         <template slot-scope="scope">
                             <div>
-                                {{scope.row.userName}}/{{scope.row.createDate}}
+                                <span v-if="user.userNameNeedTranslate == '1'">
+                                    <ww-open-data type='userName' :openid='scope.row.userName'></ww-open-data>
+                                </span>
+                                <span v-if="user.userNameNeedTranslate != '1'">{{scope.row.userName}}</span>
+                                <!-- {{scope.row.userName}} -->
+                                /{{scope.row.createDate}}
                             </div>
                         </template>
                     </el-table-column>
@@ -306,7 +382,13 @@
 <script>
     import util from "../../common/js/util";
 
+    // 引入自定义组件
+    import selectCat from "@/components/select.vue"
+
     export default {
+        components: {
+            selectCat
+        },
         data() {
             return {
                 batchDenyLoading: false,

+ 8 - 1
fhKeeper/formulahousekeeper/timesheet/src/views/workReport/list_department.vue

@@ -69,7 +69,14 @@
                 </template>
             </el-table-column>
             
-            <el-table-column prop="name" label="姓名" sortable></el-table-column>
+            <el-table-column prop="name" label="姓名" sortable>
+                <template slot-scope="scope">
+                    <div>
+                        <span v-if="user.userNameNeedTranslate == '1'"><ww-open-data type='userName' :openid='scope.row.name'></ww-open-data></span>
+                        <span v-if="user.userNameNeedTranslate != '1'">{{scope.row.name}}</span>
+                    </div>
+                </template>
+            </el-table-column>
             <el-table-column prop="dateStr" label="日期" sortable>
             </el-table-column>
             <el-table-column prop="reportTime" label="工作时长(h)" >

+ 30 - 6
fhKeeper/formulahousekeeper/timesheet/src/views/workReport/list_import.vue

@@ -106,7 +106,18 @@
                 </template>
             </el-table-column> -->
             
-            <el-table-column prop="name" :label="$t('lable.name')" sortable></el-table-column>
+            <el-table-column prop="name" :label="$t('lable.name')" sortable>
+                <template slot-scope="scope">
+                    <div>
+                        <span v-if="user.userNameNeedTranslate == '1'">
+                            <ww-open-data type='userName' :openid='scope.row.name'></ww-open-data>
+                        </span>
+                        <span v-if="user.userNameNeedTranslate != '1'">
+                            {{scope.row.name}}
+                        </span>
+                    </div>
+                </template>
+            </el-table-column>
             <el-table-column prop="date" :label="$t('weekDay.date')" sortable>
             </el-table-column>
             <el-table-column prop="project" :label="$t('other.project')" >
@@ -155,10 +166,17 @@
         </el-col>
 
         <!-- 审核记录弹窗 -->
-        <el-dialog title="$t('Auditrecords')" :visible.sync="recordDialogVisible" width="800px" :before-close="handleClose">
+        <el-dialog :title="$t('Auditrecords')" :visible.sync="recordDialogVisible" width="800px" :before-close="handleClose">
             <div style="height: 430px">
                 <el-table :data="recordLists" style="width: 100%" height="400" v-loading="recordLoading">
-                    <el-table-column prop="userName" :label="$t('other.operator')" width="150"></el-table-column>
+                    <el-table-column prop="userName" :label="$t('other.operator')" width="150">
+                        <template slot-scope="scope">
+                            <div>
+                                <span v-if="user.userNameNeedTranslate == '1'"><ww-open-data type='userName' :openid='scope.row.userName'></ww-open-data></span>
+                                <span v-if="user.userNameNeedTranslate != '1'">{{scope.row.userName}}</span>
+                            </div>
+                        </template>
+                    </el-table-column>
                     <el-table-column prop="indate" :label="$t('AuditTime')"></el-table-column>
                     <el-table-column prop="result" :label="$t('Reviewtheresults')"></el-table-column>
                     <el-table-column prop="date" :label="$t('EmployeeDate')" width="200">
@@ -168,19 +186,25 @@
                                     <el-popover placement="top" width="400" trigger="hover">
                                     <div>
                                         <span v-for="(item, index) in scope.row.membdateList" :key="index">
-                                            {{item.userName}}/{{item.createDate}} <span v-if="scope.row.membdateList.length > 1 && scope.row.membdateList.length - 1 != index">,</span>
+                                            <span v-if="user.userNameNeedTranslate == '1'"><ww-open-data type='userName' :openid='item.userName'></ww-open-data></span>
+                                            <span v-if="user.userNameNeedTranslate != '1'">{{item.userName}}</span>
+                                            /{{item.createDate}} <span v-if="scope.row.membdateList.length > 1 && scope.row.membdateList.length - 1 != index">,</span>
                                         </span>
                                     </div>
                                     <div slot="reference" style="overflow:hidden;text-overflow:ellipsis;white-space:nowrap;width: 180px;">
                                         <span v-for="(item, index) in scope.row.membdateList" :key="index">
-                                            {{item.userName}}/{{item.createDate}} <span v-if="scope.row.membdateList.length > 1 && scope.row.membdateList.length - 1 != index">,</span>
+                                            <span v-if="user.userNameNeedTranslate == '1'"><ww-open-data type='userName' :openid='item.userName'></ww-open-data></span>
+                                            <span v-if="user.userNameNeedTranslate != '1'">{{item.userName}}</span>
+                                            /{{item.createDate}} <span v-if="scope.row.membdateList.length > 1 && scope.row.membdateList.length - 1 != index">,</span>
                                         </span>
                                     </div>
                                     </el-popover>
                                 </div>
                                 <div style="overflow:hidden;text-overflow:ellipsis;white-space:nowrap;width: 180px;" v-else>
                                     <span v-for="(item, index) in scope.row.membdateList" :key="index">
-                                        {{item.userName}}/{{item.createDate}} <span v-if="scope.row.membdateList.length > 1 && scope.row.membdateList.length - 1 != index">,</span>
+                                        <span v-if="user.userNameNeedTranslate == '1'"><ww-open-data type='userName' :openid='item.userName'></ww-open-data></span>
+                                        <span v-if="user.userNameNeedTranslate != '1'">{{item.userName}}</span>
+                                        /{{item.createDate}} <span v-if="scope.row.membdateList.length > 1 && scope.row.membdateList.length - 1 != index">,</span>
                                     </span>
                                 </div>
                             </div>

+ 8 - 1
fhKeeper/formulahousekeeper/timesheet/src/views/workReport/list_profession.vue

@@ -73,7 +73,14 @@
                 </template>
             </el-table-column>
             
-            <el-table-column prop="name" label="姓名" sortable></el-table-column>
+            <el-table-column prop="name" label="姓名" sortable>
+                <template slot-scope="scope">
+                    <div>
+                        <span v-if="user.userNameNeedTranslate == '1'"><ww-open-data type='userName' :openid='scope.row.name'></ww-open-data></span>
+                        <span v-if="user.userNameNeedTranslate != '1'">{{scope.row.name}}</span>
+                    </div>
+                </template>
+            </el-table-column>
             <el-table-column prop="dateStr" label="日期" sortable>
             </el-table-column>
             <el-table-column prop="reportTime" label="工作时长(h)" >

+ 3 - 0
fhKeeper/formulahousekeeper/timesheet_h5/public/index.html

@@ -14,6 +14,9 @@
     <!-- <script src="../src/assets/axios.min.js"></script> -->
     <!-- <script src="https://unpkg.com/axios/dist/axios.min.js"></script> -->
     <script src="./axios.min.js"></script> 
+    <!-- 引入企业微信js -->
+    <script src="https://res.wx.qq.com/open/js/jweixin-1.2.0.js" referrerpolicy="origin"></script>
+    <script src="https://open.work.weixin.qq.com/wwopen/js/jwxwork-1.0.0.js" referrerpolicy="origin"></script>
     <script>
         window.onerror = function(err) {
             return true

+ 2 - 0
fhKeeper/formulahousekeeper/timesheet_h5/src/main.js

@@ -27,6 +27,8 @@ Vue.use(Form).use(Toast).use(Grid).use(GridItem).use(DatetimePicker)
 // rem
 import "amfe-flexible";
 
+import wx from 'weixin-js-sdk'
+Vue.prototype.wx = wx
 // 把变量挂载到vue的原型上
 axios.defaults.baseURL="http://localhost:10010"
 Vue.prototype.$axios = $axios;

+ 5 - 1
fhKeeper/formulahousekeeper/timesheet_h5/src/views/audit/audit.vue

@@ -4,7 +4,11 @@
         <div style="height: 46px"></div>
         <div class="lis" v-for="item in list" :key="item.id">
             <div class="lis_til">
-                <p>{{item.name}}<span style="margin-left:30px;">{{item.date}}</span></p>
+                <p>
+                    <span v-if="user.userNameNeedTranslate == '1'"><ww-open-data type='userName' :openid='item.name'></ww-open-data></span>
+                    <span v-else>{{item.name}}</span>
+                    <span style="margin-left:30px;">{{item.date}}</span>
+                </p>
                 <p style="color: #C03131">待审核</p>
             </div>
             <div class="lis_con">

+ 2 - 1
fhKeeper/formulahousekeeper/timesheet_h5/src/views/count/count.vue

@@ -94,7 +94,8 @@
                     <div style="text-align:left;margin-left:0.42667rem;" v-else>{{item.name}}</div>
                 </template>
                 <template #default>
-                    <div style="text-align:right;margin-right:0.42667rem;">{{item.department}}</div>
+                    <div style="text-align:right;margin-right:0.42667rem;" v-if="user.userNameNeedTranslate == '1'"><ww-open-data type='departmentName' :openid='item.department'></ww-open-data></div>
+                    <div style="text-align:right;margin-right:0.42667rem;" v-else>{{item.department}}</div>
                 </template>
             </van-cell>
         </template>

+ 12 - 4
fhKeeper/formulahousekeeper/timesheet_h5/src/views/edit/index.vue

@@ -77,10 +77,20 @@
                     <!-- 审核人 -->
                     <van-field  readonly  name="projectAuditorId" v-if="item.auditUserList != null && item.auditUserList.length > 0" clickable
                         :value="item.projectAuditorName" :label="user.companyId==781?'审核人':'项目审核人'" placeholder="请选择审核人" 
-                    @click="clickPickAuditor(index, item)" />
+                    @click="clickPickAuditor(index, item)">
+                        <template #input>
+                            <span v-if="user.userNameNeedTranslate == '1'"><ww-open-data type='userName' :openid='item.projectAuditorName'></ww-open-data></span>
+                            <span v-else>{{item.projectAuditorName}}</span>
+                        </template>
+                    </van-field>
                     <van-popup v-model="item.showPickerAuditor" position="bottom">
                         <van-picker show-toolbar :columns="item.auditUserList" value-key="auditorName" @confirm="choseAuditor" 
-                            @cancel="item.showPickerAuditor = false;$forceUpdate();" />
+                        @cancel="item.showPickerAuditor = false;$forceUpdate();">
+                            <template #option="item">
+                                <span v-if="user.userNameNeedTranslate == '1'"><ww-open-data type='userName' :openid='item.auditorName'></ww-open-data></span>
+                                <span v-else>{{item.auditorName}}</span>
+                            </template>
+                        </van-picker>
                     </van-popup>
 
 
@@ -320,9 +330,7 @@
         </van-popup> 
     </div>
 </template>
-<script src="//res.wx.qq.com/open/js/jweixin-1.2.0.js"></script>
 <script>
-    import wx from 'weixin-js-sdk'
 import timetoolVue from '../timetool/timetool.vue';
     // Vue.prototype.$wx = wx
     export default {

+ 12 - 4
fhKeeper/formulahousekeeper/timesheet_h5/src/views/edit/weekEdit.vue

@@ -82,10 +82,20 @@
                     <!-- 审核人 -->
                     <van-field  readonly  name="projectAuditorId" v-if="item.auditUserList != null && item.auditUserList.length > 0" clickable
                         :value="item.projectAuditorName" :label="user.companyId==781?'审核人':'项目审核人'" placeholder="请选择审核人" 
-                    @click="clickPickAuditor(index, item)" />
+                    @click="clickPickAuditor(index, item)">
+                        <template #input>
+                            <span v-if="user.userNameNeedTranslate == '1'"><ww-open-data type='userName' :openid='item.projectAuditorName'></ww-open-data></span>
+                            <span v-else>{{item.projectAuditorName}}</span>
+                        </template>
+                    </van-field>
                     <van-popup v-model="item.showPickerAuditor" position="bottom">
                         <van-picker show-toolbar :columns="item.auditUserList" value-key="auditorName" @confirm="choseAuditor" 
-                            @cancel="item.showPickerAuditor = false;$forceUpdate();" />
+                        @cancel="item.showPickerAuditor = false;$forceUpdate();">
+                            <template #option="item">
+                                <span v-if="user.userNameNeedTranslate == '1'"><ww-open-data type='userName' :openid='item.auditorName'></ww-open-data></span>
+                                <span v-else>{{item.auditorName}}</span>
+                            </template>
+                        </van-picker>
                     </van-popup>
 
 
@@ -296,9 +306,7 @@
         </van-popup> 
     </div>
 </template>
-<script src="//res.wx.qq.com/open/js/jweixin-1.2.0.js"></script>
 <script>
-    import wx from 'weixin-js-sdk'
     // Vue.prototype.$wx = wx
     export default {
         data() {

+ 10 - 2
fhKeeper/formulahousekeeper/timesheet_h5/src/views/exaLeave/exaLeave.vue

@@ -15,11 +15,19 @@
                 <div class="item_text">
                     <div class="text_list">
                         <div class="text_left">申请人</div>
-                        <div class="text_right">{{item.ownerName}}</div>
+                        <div class="text_right">
+                            {{item.ownerName}}
+                            <span v-if="user.userNameNeedTranslate == '1'"><ww-open-data type='userName' :openid='item.ownerName'></ww-open-data></span>
+                            <span v-else>{{item.ownerName}}</span>
+                        </div>
                     </div>
                     <div class="text_list">
                         <div class="text_left">所在部门</div>
-                        <div class="text_right">{{item.dept}}</div>
+                        <div class="text_right">
+                            {{item.dept}}
+                            <span v-if="user.userNameNeedTranslate == '1'"><ww-open-data type='departmentName' :openid='item.dept'></ww-open-data></span>
+                            <span v-else>{{item.dept}}</span>
+                        </div>
                     </div>
                     <div class="text_list">
                         <div class="text_left">请假类型</div>

+ 59 - 61
fhKeeper/formulahousekeeper/timesheet_h5/src/views/index/index.vue

@@ -21,10 +21,8 @@
         <Footer page="index"></Footer>
     </div>
 </template>
-
 <script>
     import Footer from "@/components/Footer";
-
     export default {
         data() {
             return {
@@ -43,6 +41,18 @@
         created() {
         },
         mounted() {
+            // if(this.user.companyName == '比基尼小镇'){
+            //     let consoleScript = document.createElement("script");
+            //     consoleScript.src = "https://cdn.bootcss.com/vConsole/3.3.4/vconsole.min.js";
+            //     consoleScript.onload = function () {
+            //         new VConsole()
+            //     }
+            //     document.head.appendChild(consoleScript);
+            // }
+            // console.log('userNameNeedTranslate',window.location.href);
+            if(this.user.userNameNeedTranslate == '1'){
+                this.agentConfig()
+            }
             var ua = navigator.userAgent.toLowerCase();
             if (ua.indexOf("wxwork") > 0) {
                 this.isCorpWX = true;
@@ -97,29 +107,14 @@
             if (localStorage.userInfo != null) {
                 this.getAccountInfo();
             }
-            // this.routers.push({
-            //                     name: '自动计时',
-            //                     url: '/timetool',
-            //                     icon: 'clock-o',
-            //                     info: this.unreadNum
-            //                 });
-            // if (this.user.companyId==634 || this.user.companyId==7 || this.user.companyId==431) {
-                // this.routers.push({
-                //                 name: '请假审批',
-                //                 url: '/exaLeave',
-                //                 icon: 'todo-list-o',
-                //             });
-            // }
             
             this.getMessage();
             this.bindIfNessary();
             if (localStorage.userInfo != null) {
                 this.getAccountInfo();
             }
-            console.log('userNameNeedTranslate',window.location.href);
-            if(this.user.userNameNeedTranslate == '1'){
-                this.agentConfig()
-            }
+            
+            
         },
         components: {
             Footer
@@ -132,49 +127,52 @@
                     url: curUrl,
                     token: this.user.id
                 }).then(res => {
-                    wx.config({
-                        beta: true,
-                        debug: false, // 开启调试模式,调用的所有api的返回值会在客户端alert出来,若要查看传入的参数,可以在pc端打开,参数信息会通过log打出,仅在pc端时才会打印。
-                        appId: res.data.appid, // 必填,公众号的唯一标识 
-                        timestamp: res.data.timestamp, // 必填,生成签名的时间戳 
-                        nonceStr: res.data.noncestr, // 必填,生成签名的随机串 
-                        signature: res.data.sign, // 必填,签名,见附录1 
-                        jsApiList: ['chooseImage','previewImage','uploadImage','downloadImage','previewFile','getLocation','agentConfig'] 
-                    })
-                    let that = this
-                    wx.ready(function(){
-                    // config信息验证后会执行ready方法,所有接口调用都必须在config接口获得结果之后,config是一个客户端的异步操作,所以如果需要在页面加载时就调用相关接口,则须把相关接口放在ready函数中调用来确保正确执行。对于用户触发时才调用的接口,则可以直接调用,不需要放在ready函数中。
-                        that.http.post("/wxcorp/getCorpWXAgentConfig", {url: curUrl, token: that.user.id}, (res) => {
-                            if (res.code == "ok") {
-                            console.log()
-                                wx.agentConfig({
-                                    corpid: res.data.corpid, // 必填,企业微信的corpid,必须与当前登录的企业一致
-                                    agentid: res.data.agentid, // 必填,企业微信的应用id (e.g. 1000247)
-                                    timestamp: res.data.timestamp, // 必填,生成签名的时间戳
-                                    nonceStr: res.data.nonceStr, // 必填,生成签名的随机串
-                                    signature: res.data.signature, // 必填,签名,见附录-JS-SDK使用权限签名算法
-                                    jsApiList: ['selectExternalContact'], //必填,传入需要使用的接口名称
-                                    success: function (result) {
-                                        // console.log(result, '请求微信成功')
-                                        // console.log(window, 'window')
-                                        //  wx.agentConfig成功回调后,WWOpenData 才会注入到 window 对象上面
-                                        window.WWOpenData.bind(document.querySelector('ww-open-data'))
-                                    },
-                                    fail: function (res) {
-                                        // console.log('查看错误信息', res)
-                                        if (res.errMsg.indexOf('function not exist') > -1) {
-                                            alert('版本过低请升级')
-                                        }
-                                    },
-                                })
-                            }
-                        }, (error) => {
-                            console.log('查看错误信息' + res)
-                            if (error.errMsg.indexOf('function not exist') > -1) {
-                                alert('版本过低请升级')
-                            }
+                    if(res.code == 'ok'){
+                        wx.config({
+                            beta: true,
+                            debug: false, // 开启调试模式,调用的所有api的返回值会在客户端alert出来,若要查看传入的参数,可以在pc端打开,参数信息会通过log打出,仅在pc端时才会打印。
+                            appId: res.data.appid, // 必填,公众号的唯一标识 
+                            timestamp: res.data.timestamp, // 必填,生成签名的时间戳 
+                            nonceStr: res.data.noncestr, // 必填,生成签名的随机串 
+                            signature: res.data.sign, // 必填,签名,见附录1 
+                            jsApiList: ['chooseImage','previewImage','uploadImage','downloadImage','previewFile','getLocation','agentConfig'] 
                         })
-                    });
+                        let that = this
+                        wx.ready(function(){
+                        // config信息验证后会执行ready方法,所有接口调用都必须在config接口获得结果之后,config是一个客户端的异步操作,所以如果需要在页面加载时就调用相关接口,则须把相关接口放在ready函数中调用来确保正确执行。对于用户触发时才调用的接口,则可以直接调用,不需要放在ready函数中。
+                            that.$axios.post('/wxcorp/getCorpWXAgentConfig', {
+                                url: curUrl,
+                                token: that.user.id
+                            }).then(res => {
+                                if(res.code == 'ok'){
+                                    wx.agentConfig({
+                                        corpid: res.data.corpid, // 必填,企业微信的corpid,必须与当前登录的企业一致
+                                        agentid: res.data.agentid, // 必填,企业微信的应用id (e.g. 1000247)
+                                        timestamp: res.data.timestamp, // 必填,生成签名的时间戳
+                                        nonceStr: res.data.nonceStr, // 必填,生成签名的随机串
+                                        signature: res.data.signature, // 必填,签名,见附录-JS-SDK使用权限签名算法
+                                        jsApiList: ['selectExternalContact'], //必填,传入需要使用的接口名称
+                                        success: function (result) {
+                                            // console.log(result, '请求微信成功')
+                                            // console.log(window, 'window')
+                                            //  wx.agentConfig成功回调后,WWOpenData 才会注入到 window 对象上面
+                                            window.WWOpenData.bind(document.querySelector('ww-open-data'))
+                                        },
+                                        fail: function (res) {
+                                            // console.log('查看错误信息', res)
+                                            if (res.errMsg.indexOf('function not exist') > -1) {
+                                                alert('版本过低请升级')
+                                            }
+                                        },
+                                    })
+                                }
+                            }).catch(err => {
+                                if (err.errMsg.indexOf('function not exist') > -1) {
+                                    alert('版本过低请升级')
+                                }
+                            })
+                        });
+                    }
                 }).catch(err => {
 
                 })

+ 1 - 0
fhKeeper/formulahousekeeper/timesheet_h5/src/views/my/children/center.vue

@@ -14,6 +14,7 @@
         <main class="mt-10">
             <div class="bg-fff">
                 <van-cell title="账号" :title-style="'flex: 0.5;'" :value="userInfo.phone"></van-cell>
+                <van-cell title="工号" :title-style="'flex: 0.5;'" :value="userInfo.jobNumber"></van-cell>
                 <van-cell title="公司" :title-style="'flex: 0.5;'" :value="userInfo.companyName"></van-cell>
                 <van-cell title="修改密码" isLink to="/my/set"></van-cell>
             </div>

+ 37 - 10
fhKeeper/formulahousekeeper/timesheet_h5/src/views/project/index.vue

@@ -58,24 +58,49 @@
                 <van-form style="margin: 0.4rem 0;">
                     <van-field v-model="form.projectCode" name="项目编号" label="项目编号" placeholder="请填写项目编号" />
                     <van-field v-model="form.projectName" name="项目名称" label="项目名称" placeholder="请填写项目名称" :rules="[{ required: true, message: '请填写项目名称' }]"/>
-                    <van-field readonly clickable name="userNames" v-model="form.userNames"  label="参与人" 
-                    placeholder="请选择参与人" @click="clickPicker()" />
+                    <van-field readonly clickable v-model="form.userNames"  label="参与人" 
+                    placeholder="请选择参与人" @click="clickPicker()">
+                        <template #input>
+                            <span v-if="user.userNameNeedTranslate == '1'">
+                                <span v-for="item,index in form.userNames.split(',')" :key="item">
+                                    <ww-open-data type='userName' :openid='item'></ww-open-data>
+                                    <span v-if="index != (form.userNames.split(',').length - 1)">,</span>
+                                </span>
+                            </span>
+                            <span v-else>{{form.userNames}}</span>
+                        </template>
+                    </van-field>
                     <van-field readonly clickable  v-model="form.inchargerName"  label="项目经理" 
-                    placeholder="请选择项目经理" @click="showPickerIncharger = true" />
+                    placeholder="请选择项目经理" @click="showPickerIncharger = true">
+                        <template #input>
+                            <span v-if="user.userNameNeedTranslate == '1'"><ww-open-data type='userName' :openid='form.inchargerName'></ww-open-data></span>
+                            <span v-else></span>
+                        </template>
+                    </van-field>
                     <!-- 研究中心 -->
                     <van-field v-if="user.timeType.customDegreeActive == 1" readonly clickable name="userNames" v-model="form.associateDegreeNames"  label="研究中心" 
                     placeholder="请选择" @click="clikls()"/>
                 </van-form>
             </van-dialog>
             <van-popup v-model="showPickerUser" position="bottom" ref="usersPopup">
-                <van-search v-model="userName" placeholder="输入员工姓名搜索" @search="onSearch"></van-search>
+                <van-search v-model="userName" placeholder="输入员工姓名搜索" @search="onSearch" v-if="user.userNameNeedTranslate != '1'"></van-search>
                 <div style="minHeight:300px;">
-                <van-checkbox class="userCheckbox" v-for="(item) in userList" :key="item.id" v-model="item.isChecked" >{{item.name}}</van-checkbox>
+                <template v-if="user.userNameNeedTranslate == '1'">
+                    <van-checkbox class="userCheckbox" v-for="(item) in userList" :key="item.id" v-model="item.isChecked" ><ww-open-data type='userName' :openid='item.name'></ww-open-data></van-checkbox>
+                </template>
+                <template v-else>
+                    <van-checkbox class="userCheckbox" v-for="(item) in userList" :key="item.id" v-model="item.isChecked" >{{item.name}}</van-checkbox>
+                </template>
                 <van-button style="width:100%;position: -webkit-sticky;position: sticky;bottom: 0;" @click="refreshParticipate();showPickerUser=false">确定</van-button>
                 </div>
             </van-popup>
             <van-popup v-model="showPickerIncharger" position="bottom">
-                <van-picker show-toolbar :columns="inchargerUserList" value-key="name" @confirm="choseIncharger" @cancel="showPickerIncharger = false" />
+                <van-picker show-toolbar :columns="inchargerUserList" value-key="name" @confirm="choseIncharger" @cancel="showPickerIncharger = false">
+                    <template #option="item">
+                        <span v-if="user.userNameNeedTranslate == '1'"><ww-open-data type='userName' :openid='item.name'></ww-open-data></span>
+                        <span v-else>{{item.name}}</span>
+                    </template>
+                </van-picker>
             </van-popup>
             <!-- 研究中心 -->
             <van-popup v-model="cliklss" position="bottom">
@@ -190,18 +215,20 @@
             },
             //刷新参与人
             refreshParticipate() {
-                this.form.userNames = '';
                 var that = this;
                 that.inchargerUserList = [];
                 that.form.userId = [];
+                let userNames = ''
                 this.userList.filter(u=>u.isChecked).forEach(u=>{
-                    that.form.userNames+=(u.name+',');
+                    userNames+=(u.name+',');
                     that.form.userId.push(u.id);
                     that.inchargerUserList.push(u);
                 });
-                if (this.form.userNames.length > 0) {
-                    this.form.userNames = this.form.userNames.substring(0, this.form.userNames.length-1);
+                // this.form.userNames = userNames
+                if (userNames.length > 0) {
+                    userNames = userNames.substring(0, userNames.length-1);
                 }
+                this.$set(this.form,'userNames',userNames)
             },
             // 刷新研究中心
             refreshParticipatess() {

+ 6 - 2
fhKeeper/formulahousekeeper/timesheet_h5/src/views/review/department_list.vue

@@ -4,6 +4,10 @@
         <div class="login_form">
             <van-skeleton  v-for="(item,index) in report" :key="index" title avatar :row="3" :loading="false">
                 <van-panel class="one_report" :title="item.name" status="待部门审核">
+                    <template #header>
+                        <span v-if="user.userNameNeedTranslate == '1'"><ww-open-data type='userName' :openid='item.name'></ww-open-data></span>
+                        <span v-else>{{item.name}}</span>
+                    </template>
                     <div class="form_text">
                         <span style="margin-left:5px;">工作日期: {{item.dateStr}}</span>
                         <span style="float:right;">
@@ -15,9 +19,9 @@
                     </div>
                     <div v-for="(item1,index1) in item.data" :key="index1" class="one_report_data">
                         <div class="project_title">项目:{{item1.project}}
-                        <span v-if="user.company.packageEngineering == 1" 
-                            style="color:#DAA520;">{{item1.departmentAuditState==-1?'待专业审核':'待部门审核'}}</span>
+                        <span v-if="user.company.packageEngineering == 1" style="color:#DAA520;">{{item1.departmentAuditState==-1?'待专业审核':'待部门审核'}}</span>
                         </div>
+                        <div class="project_title" v-if="item1.projectCode != null" >子项目:{{item1.projectCode}}</div>
                         <div class="project_title" v-if="item1.subProjectName != null" >子项目:{{item1.subProjectName}}</div>
                         <div class="project_title" v-if="user.company.packageProject==1&&item1.groupName != null" >任务分组:{{item1.groupName}}</div>
                         <div class="project_title" v-if="user.company.packageProject==1&&item1.stage != '-'" >投入阶段:{{item1.stage}}</div>

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

@@ -14,11 +14,29 @@
                     <template #extra>
                         <van-icon v-if="userNameValue" name="close" style="line-height:0.64rem;position:relative;left:5px;" @click.stop="selectUserClear"/>
                     </template>
+                    <template #default>
+                        <span v-if="user.userNameNeedTranslate == '1'">
+                            <span v-for="item,index in userNameValue.split(',')" :key="item">
+                                <ww-open-data type='userName' :openid='item'></ww-open-data>
+                                <span v-if="index != (userNameValue.split(',').length - 1)">,</span>
+                            </span>
+                        </span>
+                        <span v-else>{{userNameValue}}</span>
+                    </template>
                 </van-cell>
                 <van-popup v-model="selectUserShow" position="bottom">
-                    <van-search v-model="searchInputValue" placeholder="输入员工姓名搜索" @search="userListSearch"></van-search>
+                    <van-search v-model="searchInputValue" placeholder="输入员工姓名搜索" @search="userListSearch" v-if="user.userNameNeedTranslate != '1'"></van-search>
                     <div style="minHeight:300px;">
-                        <van-checkbox class="userCheckbox" v-for="(item) in showUserList" :key="item.id" v-model="item.isChecked" >{{item.name}}</van-checkbox>
+                        <template v-if="user.userNameNeedTranslate == '1'">
+                            <van-checkbox class="userCheckbox" v-for="(item) in showUserList" :key="item.id" v-model="item.isChecked" >
+                                <ww-open-data type='userName' :openid='item.name'></ww-open-data>
+                            </van-checkbox>
+                        </template>
+                        <template v-else>
+                            <van-checkbox class="userCheckbox" v-for="(item) in showUserList" :key="item.id" v-model="item.isChecked" >
+                                <span>{{item.name}}</span>
+                            </van-checkbox>
+                        </template>
                         <van-button style="width:100%;position: -webkit-sticky;position: sticky;bottom: 0;" @click="selectUserConfirm()">确定</van-button>
                     </div>
                 </van-popup>
@@ -37,7 +55,8 @@
                         <div class="van-cell van-panel__header">
                             <div class="van-cell__title" style="display:flex;algin-items:center">
                                 <van-checkbox v-model="item.checked" @click="itemChecked" shape="square" style="margin-right:2vw"></van-checkbox>
-                                <span>{{item.name}}</span>
+                                <span v-if="user.userNameNeedTranslate == '1'"><ww-open-data type='userName' :openid='item.name'></ww-open-data></span>
+                                <span v-else>{{item.name}}</span>
                             </div>
                             <div class="van-cell__value van-panel__header-value">{{item.state==0?(user.company.packageEngineering == 1 ? (item.data[0].departmentAuditState==-1?'待专业审核': (item.data[0].departmentAuditState==0?'待部门审核': '待项目经理审核')) : '待审核'):item.state==1?'已通过':'已驳回'}}</div>
                         </div>
@@ -56,18 +75,28 @@
                             [
                             <span v-if="item1.isDeptAudit==0">
                                 <span v-if="item1.projectAuditState==0">
-                                    待项目审核人<span v-if="item1.projectAuditorName != null">({{item1.projectAuditorName}})</span>审核
+                                    待项目审核人<span v-if="item1.projectAuditorName != null">(
+                                        <span v-if="user.userNameNeedTranslate == '1'"><ww-open-data type='userName' :openid='item1.projectAuditorName'></ww-open-data></span>
+                                        <span v-else>{{item1.projectAuditorName}}</span>
+                                    )</span>审核
                                 </span>
                                 <span style="color:#32CD32;" v-else-if="item1.projectAuditState==1">
-                                    项目审核人<span v-if="item1.projectAuditorName != null">({{item1.projectAuditorName}})</span>审核通过
+                                    项目审核人<span v-if="item1.projectAuditorName != null">(
+                                        <span v-if="user.userNameNeedTranslate == '1'"><ww-open-data type='userName' :openid='item1.projectAuditorName'></ww-open-data></span>
+                                        <span v-else>{{item1.projectAuditorName}}</span>
+                                    )</span>审核通过
                                 </span>
                             </span>
                             <span v-else-if="item1.isDeptAudit==1">
-                                {{('待'+item1.auditDeptName+'审核')}}
+                                待
+                                <span v-if="user.userNameNeedTranslate == '1'"><ww-open-data type='userName' :openid='item1.auditDeptName'></ww-open-data></span>
+                                <span v-else>{{item1.auditDeptName}}</span>
+                                审核
                             </span>
                             ]
 
                         </div>
+                        <div class="project_title" v-if="item1.projectCode != null" >项目编号:{{item1.projectCode}}</div>
                         <div class="project_title" v-if="item1.subProjectName != null" >子项目:{{item1.subProjectName}}</div>
                         <div class="project_title" v-if="user.company.packageProject==1&&item1.groupName != null" >任务分组:{{item1.groupName}}</div>
                         <div class="project_title" v-if="user.company.packageProject==1&&item1.stage != '-'" >投入阶段:{{item1.stage}}</div>
@@ -224,6 +253,7 @@
                     this.userNameValue = this.userNameValue.substring(0, this.userNameValue.length-1);
                     this.userIdList = this.userIdList.substring(0, this.userIdList.length-1);
                 }
+                this.$forceUpdate()
                 this.selectUserShow = false
                 this.getReport()
                 

+ 5 - 0
fhKeeper/formulahousekeeper/timesheet_h5/src/views/review/profession_list.vue

@@ -5,6 +5,10 @@
         <div class="login_form">
             <van-skeleton  v-for="(item,index) in report" :key="index" title avatar :row="3" :loading="false">
                 <van-panel class="one_report" :title="item.name" status="待专业审核">
+                    <template #header>
+                        <span v-if="user.userNameNeedTranslate == '1'"><ww-open-data type='userName' :openid='item.name'></ww-open-data></span>
+                        <span v-else>{{item.name}}</span>
+                    </template>
                     <div class="form_text">
                         <span style="margin-left:5px;">工作日期: {{item.dateStr}}</span>
                         <span style="float:right;">
@@ -16,6 +20,7 @@
                     </div>
                     <div v-for="(item1,index1) in item.data" :key="index1" class="one_report_data">
                         <div class="project_title">项目:{{item1.project}}</div>
+                        <div class="project_title" v-if="item1.projectCode != null">项目:{{item1.projectCode}}</div>
                         <div class="project_title" v-if="item1.subProjectName != null" >子项目:{{item1.subProjectName}}</div>
                         <div class="project_title" v-if="user.company.packageProject==1&&item1.groupName != null" >任务分组:{{item1.groupName}}</div>
                         <div class="project_title" v-if="user.company.packageProject==1&&item1.stage != '-'" >投入阶段:{{item1.stage}}</div>

+ 0 - 2
fhKeeper/formulahousekeeper/timesheet_h5/src/views/test/list.vue

@@ -283,9 +283,7 @@
         </van-popup> 
     </div>
 </template>
-<script src="//res.wx.qq.com/open/js/jweixin-1.2.0.js"></script>
 <script>
-    import wx from 'weixin-js-sdk'
     // Vue.prototype.$wx = wx
     export default {
         data() {

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

@@ -11,6 +11,17 @@
             </van-popup>
             <van-skeleton  :v-if="report.length!=0" v-for="(item,index) in report" title avatar :row="3" :loading="false" :key="index">
                 <van-panel class="one_report" :title="item.name" :status="statusTxt[item.state]">
+                    <template #header>
+                        <div class="van-cell van-panel__header">
+                            <div class="van-cell__title">
+                                <span v-if="user.userNameNeedTranslate == '1'"><ww-open-data type='userName' :openid='item.name'></ww-open-data></span>
+                                <span v-else>{{item.name}}</span>
+                            </div>
+                            <div class="van-cell__value van-panel__header-value">
+                                <span>{{statusTxt[item.state]}}</span>
+                            </div>
+                        </div>
+                    </template>
                     <div class="form_text">
                         <span style="margin-right:20px;margin-left:5px;font-size:14px;">
                             总填报:
@@ -22,14 +33,23 @@
                             <span v-if="item1.state==0">
                             <span v-if="item1.isDeptAudit==0">
                                 <span v-if="item1.projectAuditState==0">
-                                    待项目审核人<span v-if="item1.projectAuditorName != null">({{item1.projectAuditorName}})</span>审核
+                                    待项目审核人<span v-if="item1.projectAuditorName != null">(
+                                        <span v-if="user.userNameNeedTranslate == '1'"><ww-open-data type='userName' :openid='item1.projectAuditorName'></ww-open-data></span>
+                                        <span v-else>{{item1.projectAuditorName}}</span>
+                                    )</span>审核
                                 </span>
                                 <span style="color:#32CD32;" v-else-if="item1.projectAuditState==1">
-                                    项目审核人<span v-if="item1.projectAuditorName != null">({{item1.projectAuditorName}})</span>审核通过
+                                    项目审核人<span v-if="item1.projectAuditorName != null">(
+                                        <span v-if="user.userNameNeedTranslate == '1'"><ww-open-data type='userName' :openid='item1.projectAuditorName'></ww-open-data></span>
+                                        <span v-else>{{item1.projectAuditorName}}</span>
+                                    )</span>审核通过
                                 </span>
                             </span>
                             <span v-else-if="item1.isDeptAudit==1">
-                                {{('待'+item1.auditDeptName+'审核')}}
+                                待
+                                <span v-if="user.userNameNeedTranslate == '1'"><ww-open-data type='userName' :openid='item1.auditDeptName'></ww-open-data></span>
+                                <span v-else>{{item1.auditDeptName}}</span>
+                                审核
                             </span>
                             </span>
                             <span v-else>