Просмотр исходного кода

Merge remote-tracking branch 'origin/master'

yusm 6 месяцев назад
Родитель
Сommit
a9a10c5845
23 измененных файлов с 242 добавлено и 396 удалено
  1. 10 2
      fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/controller/UserCorpwxTimeController.java
  2. 8 1
      fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/entity/TimeType.java
  3. 1 1
      fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/impl/DingDingServiceImpl.java
  4. 21 23
      fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/impl/ReportServiceImpl.java
  5. 2 1
      fhKeeper/formulahousekeeper/management-platform/src/main/resources/mapper/TimeTypeMapper.xml
  6. 0 6
      fhKeeper/formulahousekeeper/management-workshop/src/main/java/com/management/platform/controller/UserController.java
  7. 0 21
      fhKeeper/formulahousekeeper/management-workshop/src/main/java/com/management/platform/controller/UserSalaryController.java
  8. 16 6
      fhKeeper/formulahousekeeper/management-workshop/src/main/java/com/management/platform/controller/WeiXinCorpController.java
  9. 0 94
      fhKeeper/formulahousekeeper/management-workshop/src/main/java/com/management/platform/entity/UserSalary.java
  10. 0 16
      fhKeeper/formulahousekeeper/management-workshop/src/main/java/com/management/platform/mapper/UserSalaryMapper.java
  11. 0 16
      fhKeeper/formulahousekeeper/management-workshop/src/main/java/com/management/platform/service/UserSalaryService.java
  12. 0 2
      fhKeeper/formulahousekeeper/management-workshop/src/main/java/com/management/platform/service/UserService.java
  13. 0 20
      fhKeeper/formulahousekeeper/management-workshop/src/main/java/com/management/platform/service/impl/UserSalaryServiceImpl.java
  14. 1 40
      fhKeeper/formulahousekeeper/management-workshop/src/main/java/com/management/platform/service/impl/UserServiceImpl.java
  15. 0 22
      fhKeeper/formulahousekeeper/management-workshop/src/main/resources/mapper/UserSalaryMapper.xml
  16. 18 4
      fhKeeper/formulahousekeeper/timesheet/src/views/contract/components/customContract.vue
  17. 1 1
      fhKeeper/formulahousekeeper/timesheet/src/views/corpreport/list.vue
  18. 1 1
      fhKeeper/formulahousekeeper/timesheet/src/views/deviceManagement/deviceManagement.vue
  19. 7 0
      fhKeeper/formulahousekeeper/timesheet/src/views/project/detail.vue
  20. 12 58
      fhKeeper/formulahousekeeper/timesheet/src/views/workReport/daily.vue
  21. 4 4
      fhKeeper/formulahousekeeper/timesheet/src/views/workReport/list.vue
  22. 81 10
      fhKeeper/formulahousekeeper/timesheet_h5/src/views/edit/index.vue
  23. 59 47
      fhKeeper/formulahousekeeper/timesheet_h5/src/views/review/index.vue

+ 10 - 2
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/controller/UserCorpwxTimeController.java

@@ -97,8 +97,16 @@ public class UserCorpwxTimeController {
     public HttpRespMsg getUserCardTime(String userId, String date) {
         HttpRespMsg msg = new HttpRespMsg();
         User user = userMapper.selectById(userId);
-        UserCorpwxTime userCorpwxTime = userCorpwxTimeMapper.selectOne(new QueryWrapper<UserCorpwxTime>().eq("corpwx_userid", user.getCorpwxUserid()).eq("create_date", date));
-        msg.data = userCorpwxTime;
+        if (user.getCorpwxUserid() != null) {
+            UserCorpwxTime userCorpwxTime = userCorpwxTimeMapper.selectOne(new QueryWrapper<UserCorpwxTime>().eq("corpwx_userid", user.getCorpwxUserid()).eq("create_date", date));
+            msg.data = userCorpwxTime;
+        } else {
+            //按姓名匹配
+            List<UserCorpwxTime> userCorpwxTimes = userCorpwxTimeMapper.selectList(new QueryWrapper<UserCorpwxTime>().eq("company_id", user.getCompanyId()).eq("name", user.getName()).eq("create_date", date));
+            if (userCorpwxTimes.size() > 0) {
+                msg.data = userCorpwxTimes.get(0);
+            }
+        }
         return msg;
     }
     @RequestMapping("/getMyDeptMembsData")

+ 8 - 1
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/entity/TimeType.java

@@ -17,7 +17,7 @@ import lombok.experimental.Accessors;
  * </p>
  *
  * @author Seyason
- * @since 2024-09-23
+ * @since 2024-10-21
  */
 @Data
 @EqualsAndHashCode(callSuper = false)
@@ -622,6 +622,13 @@ public class TimeType extends Model<TimeType> {
     private Integer verifyCardOvertime;
 
 
+    /**
+     * 驳回日报原因是否必填
+     */
+    @TableField("force_reject_reason")
+    private Integer forceRejectReason;
+
+
     @Override
     protected Serializable pkVal() {
         return this.companyId;

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

@@ -2222,7 +2222,7 @@ public class DingDingServiceImpl implements DingDingService {
         OapiAttendanceListRecordRequest req = new OapiAttendanceListRecordRequest();
         List<String> ddIds = userList.stream().map(User::getDingdingUserid).collect(Collectors.toList());
         req.setUserIds(ddIds);
-        req.setCheckDateFrom(startDate+ " 08:00:00");
+        req.setCheckDateFrom(startDate+ " 02:00:00");
         req.setCheckDateTo(endDate+ " 23:59:59");
         req.setIsI18n(false);
         OapiAttendanceListRecordResponse rsp = null;

+ 21 - 23
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/impl/ReportServiceImpl.java

@@ -875,8 +875,15 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
                 showRefresh = true;
             } else if (timeType.getShowCorpwxCardtime() == 1) {
                 User user = userMapper.selectById(userId);
-                List<UserCorpwxTime> corpwxTimes = userCorpwxTimeMapper.selectList(new QueryWrapper<UserCorpwxTime>()
-                        .eq("corpwx_userid", user.getCorpwxUserid()).eq("create_date", date));
+                List<UserCorpwxTime> corpwxTimes = null;
+                if (user.getCorpwxUserid() != null) {
+                    corpwxTimes = userCorpwxTimeMapper.selectList(new QueryWrapper<UserCorpwxTime>()
+                            .eq("corpwx_userid", user.getCorpwxUserid()).eq("create_date", date));
+                } else {
+                    //按姓名匹配
+                    corpwxTimes = userCorpwxTimeMapper.selectList(new QueryWrapper<UserCorpwxTime>().eq("company_id", user.getCompanyId())
+                            .eq("name", user.getName()).eq("create_date", date));
+                }
                 if (corpwxTimes.size() > 0) {
                     UserCorpwxTime time = corpwxTimes.get(0);
                     resultMap.put("time", time);
@@ -1775,22 +1782,21 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
                 }
             }
             DateTimeFormatter dtf = DateTimeFormatter.ofPattern("yyyy-MM-dd");
+            String minDate = null;
+            String maxDate = null;
+            if (nameList.size() > 0) {
+                List<String> dateList = nameList.stream().map(m->(String)m.get("dateStr")).collect(Collectors.toList());
+                //获取最大和最小日期
+                minDate = dateList.stream().min(Comparator.comparing(String::toString)).get();
+                maxDate = dateList.stream().max(Comparator.comparing(String::toString)).get();
+            }
             //设置每人每日考勤打卡时长
             if (timeType.getShowCorpwxCardtime() == 1) {
                 //企业微信的情况
                 QueryWrapper<UserCorpwxTime> userCorpwxTimeQueryWrapper = new QueryWrapper<>();
                 if (nameList.size() > 0) {
-                    for (Map map : nameList) {
-                        String corpwxUserid = (String)map.get("corpwxUserid");
-                        String dateStr = (String)map.get("dateStr");
-                        String name = (String)map.get("name");
-                        if (corpwxUserid != null) {
-                            userCorpwxTimeQueryWrapper.or(wrapper->wrapper.eq("corpwx_userid", corpwxUserid).eq("create_date", dateStr));
-                        } else {
-                            userCorpwxTimeQueryWrapper.or(wrapper->wrapper.eq("name", name).eq("create_date", dateStr));
-                        }
-
-                    }
+                    //获取日期范围
+                    userCorpwxTimeQueryWrapper.between("create_date", minDate, maxDate).eq("company_id", companyId);
                     List<UserCorpwxTime> timeList = userCorpwxTimeMapper.selectList(userCorpwxTimeQueryWrapper);
                     //过滤匹配当前的数据
                     for (Map map : nameList) {
@@ -1809,11 +1815,7 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
                 //钉钉的情况
                 QueryWrapper<UserDingdingTime> userDingdingTimeQueryWrapper = new QueryWrapper<>();
                 if (nameList.size() > 0) {
-                    for (Map map : nameList) {
-                        String itemUid = (String)map.get("userId");
-                        String dateStr = (String)map.get("dateStr");
-                        userDingdingTimeQueryWrapper.or(wrapper->wrapper.eq("user_id", itemUid).eq("work_date", dateStr));
-                    }
+                    userDingdingTimeQueryWrapper.between("work_date", minDate, maxDate).eq("company_id", companyId);
                     List<UserDingdingTime> timeList = userDingdingTimeMapper.selectList(userDingdingTimeQueryWrapper);
                     //过滤匹配当前的数据
                     for (Map map : nameList) {
@@ -1831,11 +1833,7 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
                 //泛微的情况
                 QueryWrapper<UserFvTime> userFvTimeQueryWrapper = new QueryWrapper<>();
                 if (nameList.size() > 0) {
-                    for (Map map : nameList) {
-                        String itemUid = (String)map.get("userId");
-                        String dateStr = (String)map.get("dateStr");
-                        userFvTimeQueryWrapper.or(wrapper->wrapper.eq("user_id", itemUid).eq("work_date", dateStr));
-                    }
+                    userFvTimeQueryWrapper.between("work_date", minDate, maxDate).eq("company_id", companyId);
                     List<UserFvTime> timeList = userFvTimeMapper.selectList(userFvTimeQueryWrapper);
                     //过滤匹配当前的数据
                     for (Map map : nameList) {

Разница между файлами не показана из-за своего большого размера
+ 2 - 1
fhKeeper/formulahousekeeper/management-platform/src/main/resources/mapper/TimeTypeMapper.xml


+ 0 - 6
fhKeeper/formulahousekeeper/management-workshop/src/main/java/com/management/platform/controller/UserController.java

@@ -194,12 +194,6 @@ public class UserController {
         return userService.switchPermission(id, request);
     }
 
-    @RequestMapping("/getUserSalaryList")
-    public HttpRespMsg getUserSalaryList(String id) {
-        return userService.getUserSalaryList(id);
-    }
-
-
     @RequestMapping("/setActive")
     public HttpRespMsg setActive(String id, int isActive) {
         return userService.setActive(id, isActive);

+ 0 - 21
fhKeeper/formulahousekeeper/management-workshop/src/main/java/com/management/platform/controller/UserSalaryController.java

@@ -1,21 +0,0 @@
-package com.management.platform.controller;
-
-
-import org.springframework.web.bind.annotation.RequestMapping;
-
-import org.springframework.web.bind.annotation.RestController;
-
-/**
- * <p>
- *  前端控制器
- * </p>
- *
- * @author Seyason
- * @since 2021-05-19
- */
-@RestController
-@RequestMapping("/user-salary")
-public class UserSalaryController {
-
-}
-

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

@@ -1950,18 +1950,25 @@ public class WeiXinCorpController {
         if (id == 0) {
             cascade.append("0");
         } else {
-            cascade.append(id);
-            id = findById(id, allDeptList).getSuperiorId();
-            while (id != null) {
-                cascade.append(",").append(id);
-                id = findById(id, allDeptList).getSuperiorId();
+
+            Department dept = findById(id, allDeptList);
+            if (dept == null) {
+                cascade.append("0");
+            } else {
+                cascade.append(id);
+                id = dept.getSuperiorId();
+                while (id != null) {
+                    cascade.append(",").append(id);
+                    id = findById(id, allDeptList).getSuperiorId();
+                }
             }
         }
         return cascade.toString();
     }
 
     private Department findById(int id, List<Department> allList) {
-        return allList.stream().filter(all->all.getDepartmentId().intValue() == id).findFirst().get();
+        Optional<Department> first = allList.stream().filter(all -> all.getDepartmentId().intValue() == id).findFirst();
+        return first.isPresent()?first.get():null;
     }
 
     private boolean judgeIsLeader(String userId) {
@@ -2283,6 +2290,9 @@ public class WeiXinCorpController {
                                 .setPassword(MD5Util.getPassword("000000"))
                                 .setJobNumber(corpWxuserid);
                             boolean b = oldUserList.stream().anyMatch(ul -> ul.getCorpwxRealUserid().equals(user.getCorpwxRealUserid()));
+                            if ("黄家雨".equals(userName)) {
+                                System.out.println("黄家雨"+(b?"存在":"不存在"));
+                            }
                             if(!b){
                                 userList.add(user);
                             }

+ 0 - 94
fhKeeper/formulahousekeeper/management-workshop/src/main/java/com/management/platform/entity/UserSalary.java

@@ -1,94 +0,0 @@
-package com.management.platform.entity;
-
-import java.math.BigDecimal;
-import com.baomidou.mybatisplus.annotation.IdType;
-import com.baomidou.mybatisplus.extension.activerecord.Model;
-import com.baomidou.mybatisplus.annotation.TableId;
-import java.time.LocalDateTime;
-import com.baomidou.mybatisplus.annotation.TableField;
-import java.io.Serializable;
-
-import com.fasterxml.jackson.annotation.JsonFormat;
-import lombok.Data;
-import lombok.EqualsAndHashCode;
-import lombok.experimental.Accessors;
-
-/**
- * <p>
- * 
- * </p>
- *
- * @author Seyason
- * @since 2022-10-19
- */
-@Data
-@EqualsAndHashCode(callSuper = false)
-@Accessors(chain = true)
-public class UserSalary extends Model<UserSalary> {
-
-    private static final long serialVersionUID=1L;
-
-    @TableId(value = "id", type = IdType.AUTO)
-    private Integer id;
-
-    /**
-     * 用户id
-     */
-    @TableField("user_id")
-    private String userId;
-
-    /**
-     * 用户姓名
-     */
-    @TableField("user_name")
-    private String userName;
-
-    /**
-     * 月薪
-     */
-    @TableField("month_cost")
-    private BigDecimal monthCost;
-
-    /**
-     * 时薪
-     */
-    @TableField("cost")
-    private BigDecimal cost;
-
-    /**
-     * 薪资类型
-     */
-    @TableField("salary_type")
-    private Integer salaryType;
-
-
-    /**
-     * 更新时间
-     */
-    @TableField("indate")
-    @JsonFormat(pattern = "yyyy-MM-dd HH:mm")
-    private LocalDateTime indate;
-
-
-    /**
-     * 所属月份
-     */
-    @TableField("ymonth")
-    private String ymonth;
-
-    public static UserSalary copyFromUser(User user) {
-        UserSalary userSalary = new UserSalary();
-        userSalary.setUserId(user.getId());
-        userSalary.setSalaryType(user.getSalaryType());
-        userSalary.setMonthCost(user.getMonthCost());
-        userSalary.setCost(user.getCost());
-        userSalary.setUserName(user.getName());
-        return  userSalary;
-    }
-
-    @Override
-    protected Serializable pkVal() {
-        return this.id;
-    }
-
-}

+ 0 - 16
fhKeeper/formulahousekeeper/management-workshop/src/main/java/com/management/platform/mapper/UserSalaryMapper.java

@@ -1,16 +0,0 @@
-package com.management.platform.mapper;
-
-import com.management.platform.entity.UserSalary;
-import com.baomidou.mybatisplus.core.mapper.BaseMapper;
-
-/**
- * <p>
- *  Mapper 接口
- * </p>
- *
- * @author Seyason
- * @since 2021-05-19
- */
-public interface UserSalaryMapper extends BaseMapper<UserSalary> {
-
-}

+ 0 - 16
fhKeeper/formulahousekeeper/management-workshop/src/main/java/com/management/platform/service/UserSalaryService.java

@@ -1,16 +0,0 @@
-package com.management.platform.service;
-
-import com.management.platform.entity.UserSalary;
-import com.baomidou.mybatisplus.extension.service.IService;
-
-/**
- * <p>
- *  服务类
- * </p>
- *
- * @author Seyason
- * @since 2021-05-19
- */
-public interface UserSalaryService extends IService<UserSalary> {
-
-}

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

@@ -46,8 +46,6 @@ public interface UserService extends IService<User> {
 
     HttpRespMsg resetPwd(String userId);
 
-    HttpRespMsg getUserSalaryList(String id);
-
     HttpRespMsg setActive(String id, int isActive);
 
     HttpRespMsg bindWeiXin(String code, String userId);

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

@@ -1,20 +0,0 @@
-package com.management.platform.service.impl;
-
-import com.management.platform.entity.UserSalary;
-import com.management.platform.mapper.UserSalaryMapper;
-import com.management.platform.service.UserSalaryService;
-import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
-import org.springframework.stereotype.Service;
-
-/**
- * <p>
- *  服务实现类
- * </p>
- *
- * @author Seyason
- * @since 2021-05-19
- */
-@Service
-public class UserSalaryServiceImpl extends ServiceImpl<UserSalaryMapper, UserSalary> implements UserSalaryService {
-
-}

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

@@ -128,10 +128,6 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements Us
     @Resource
     private ProjectMapper projectMapper;
     @Resource
-    private UserSalaryMapper userSalaryMapper;
-    @Resource
-    private UserSalaryService userSalaryService;
-    @Resource
     private UserVcodeMapper userVcodeMapper;
     @Resource
     private TaskMapper taskMapper;
@@ -431,14 +427,6 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements Us
             if (updateUserList.size() > 0) {
                 //有人员薪资更新
                 updateBatchById(updateUserList);
-                //记录薪资变动
-                List<UserSalary> salaryChangeList = new ArrayList<>();
-                for (User u : updateUserList) {
-                    UserSalary salary = UserSalary.copyFromUser(u);
-                    salary.setYmonth(yearMonth);
-                    salaryChangeList.add(salary);
-                }
-                userSalaryService.saveBatch(salaryChangeList);
             }
             //更新该月份的日报相关的成本
             if (!StringUtils.isEmpty(yearMonth)) {
@@ -908,7 +896,6 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements Us
                                 httpRespMsg.setError(MessageUtils.message("staff.deleteErrorByProject"));
                             } else {
                                 userMapper.deleteById(userId);
-                                userSalaryMapper.delete(new QueryWrapper<UserSalary>().eq("user_id", userId));
                                 //项目参与人可以直接删除
                                 participationMapper.delete(new QueryWrapper<Participation>().eq("user_id", userId));
                             }
@@ -1165,9 +1152,6 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements Us
                             //httpRespMsg.setError("操作失败");
                             httpRespMsg.setError(MessageUtils.message("other.operationFail"));
                         } else {
-                            //插入人员历史成本表
-                            UserSalary userSalary = UserSalary.copyFromUser(user);
-                            userSalaryMapper.insert(userSalary);
                             //插入人员专业证书表
                             if (!StringUtils.isEmpty(certJson)) {
                                 List<UserCert> certList = JSONArray.parseArray(certJson, UserCert.class);
@@ -1193,18 +1177,6 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements Us
                     return httpRespMsg;
                 }
                 User oldUser = userMapper.selectById(targetId);
-                boolean salaryChange = false;
-
-                if (oldUser.getCost() == null) {
-                    if (costValue.intValue() != 0) {
-                        salaryChange = true;
-                    }
-                } else {
-                    if (oldUser.getCost().compareTo(costValue) != 0) {
-                        salaryChange = true;
-                    }
-                }
-
                 String oldCostApplyDate = oldUser.getCostApplyDate();
                 if(!StringUtils.isEmpty(inductionDate)){
                     oldUser.setInductionDate(LocalDate.parse(inductionDate,dtf));
@@ -1246,10 +1218,6 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements Us
                     userMapper.setSuperiorNull(oldUser.getId());
                 }
 
-                if (salaryChange) {
-                    UserSalary userSalary = UserSalary.copyFromUser(oldUser);
-                    userSalaryMapper.insert(userSalary);
-                }
                 if (superiorChange) {
                     //检查是否有审核中的日报
                     if (timeTypeMapper.selectById(oldUser.getCompanyId()).getReportAuditType() == 5) {
@@ -1298,7 +1266,7 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements Us
                     if (cnt > 0) {
                         shouldChangeOldReport = true;
                     }
-                }  else if (salaryChange && costApplyDate != null) {
+                }  else if (costApplyDate != null) {
                     //成本发生改变
                     int cnt = reportMapper.selectCount(reportQueryWrapper);
                     if (cnt > 0) {
@@ -1605,13 +1573,6 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements Us
         return new HttpRespMsg();
     }
 
-    @Override
-    public HttpRespMsg getUserSalaryList(String id) {
-        List<UserSalary> userSalaries = userSalaryMapper.selectList(new QueryWrapper<UserSalary>().eq("user_id", id).orderByDesc("id"));
-        HttpRespMsg msg = new HttpRespMsg();
-        msg.data = userSalaries;
-        return msg;
-    }
 
     @Override
     public HttpRespMsg setActive(String id, int isActive) {

+ 0 - 22
fhKeeper/formulahousekeeper/management-workshop/src/main/resources/mapper/UserSalaryMapper.xml

@@ -1,22 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
-<mapper namespace="com.management.platform.mapper.UserSalaryMapper">
-
-    <!-- 通用查询映射结果 -->
-    <resultMap id="BaseResultMap" type="com.management.platform.entity.UserSalary">
-        <id column="id" property="id" />
-        <result column="user_id" property="userId" />
-        <result column="user_name" property="userName" />
-        <result column="month_cost" property="monthCost" />
-        <result column="cost" property="cost" />
-        <result column="salary_type" property="salaryType" />
-        <result column="indate" property="indate" />
-        <result column="ymonth" property="ymonth" />
-    </resultMap>
-
-    <!-- 通用查询结果列 -->
-    <sql id="Base_Column_List">
-        id, user_id, user_name, month_cost, cost, salary_type, indate, ymonth
-    </sql>
-
-</mapper>

+ 18 - 4
fhKeeper/formulahousekeeper/timesheet/src/views/contract/components/customContract.vue

@@ -235,7 +235,7 @@
             <el-date-picker v-model="contractForm.filingsDate" :disabled="contractForm.status == 0" value-format="yyyy-MM-dd" type="date" :placeholder="$t('optiondate')"></el-date-picker>
           </el-form-item>
           <el-form-item label="合同金额(元)/含税价">
-            <el-input v-model="contractForm.amounts" :disabled="contractForm.status == 0" :placeholder="$t('peaseenterthe')" @change="chgPayedAmount()" clearable>
+            <el-input v-model="contractForm.amounts" :disabled="contractForm.status == 0 || !contractForm.isAmountFixed" :placeholder="$t('peaseenterthe')" @change="chgPayedAmount()" clearable>
               <span slot="prefix">¥</span>
             </el-input>
           </el-form-item>
@@ -250,7 +250,7 @@
             </el-input>
           </el-form-item>
           <el-form-item label="是否固定金额">
-            <el-select v-model="contractForm.isAmountFixed" :disabled="contractForm.status == 0" placeholder="请选择">
+            <el-select v-model="contractForm.isAmountFixed" :disabled="contractForm.status == 0" placeholder="请选择" @change="processingContractAmount()">
               <el-option label="是" :value="true"></el-option>
               <el-option label="否" :value="false"></el-option>
             </el-select>
@@ -304,7 +304,7 @@
                     <el-input v-model="scope.row.billNumber" :placeholder="$t('peaseenterthe')" clearable  size="small"></el-input>
                   </template>
                 </el-table-column>
-                <el-table-column prop="pendingAmounts" label="待付款金额(元)" width="210">
+                <el-table-column v-if="contractForm.isAmountFixed" prop="pendingAmounts" label="待付款金额(元)" width="210">
                   <template slot-scope="scope">
                     {{ scope.row.pendingAmounts }}
                   </template>
@@ -497,7 +497,7 @@
                     </template>
                   </el-table-column>
                   <el-table-column prop="billNumber" label="凭证号" width="210"></el-table-column>
-                  <el-table-column prop="pendingAmounts" label="待付款金额(元" width="180"></el-table-column>
+                  <el-table-column prop="pendingAmounts" v-if="contractForm.isAmountFixed" label="待付款金额(元" width="180"></el-table-column>
               </el-table>
           </el-form-item>
           
@@ -705,12 +705,26 @@ export default {
     //   console.log('test',row);
     //   // this.$refs.uploadFile.submit()
     // },
+    processingContractAmount() {
+      console.log(this.contractForm.isAmountFixed, '<====== 开始执行')
+      if(this.contractForm.isAmountFixed) {
+        return
+      }
+      const list = this.contractPaymentList || []
+      const totalNum = list.reduce((sum, item) => sum + (item.payedAmount || 0), 0);
+      console.log(list, '<====== 开始执行')
+      console.log(totalNum, '<====== 开始执行')
+      this.contractForm.amounts = totalNum
+    },
     chgPayedAmount() {
       const { amounts } = this.contractForm
       const list = this.contractPaymentList || []
       let totalNum = +amounts || 0
       if(amounts <= 0 || list.length <= 0) {
+        this.processingContractAmount()
         return
+      } else {
+        this.processingContractAmount()
       }
       
       for(let i in list) {

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

@@ -2692,7 +2692,6 @@ export default {
           this.userId ? sl.userId = this.userId : ''
           dept ? sl.deptId = dept : ''
         } else if(this.ins == 24) {
-          this.exportReportLoading = true
           if(this.tabsType == 'all') {
             fName = this.$t('fenZuHaoYongJinDuBiao') + '.xlsx'
             url = "/project/exportGroupExpendProcessList"
@@ -2744,6 +2743,7 @@ export default {
           sl.startDate = this.rangeDatas[0]
           sl.endDate = this.rangeDatas[1]
         }
+        this.exportReportLoading = true
           this.http.post(url, sl,
             res => {
                 this.exportReportLoading = false

+ 1 - 1
fhKeeper/formulahousekeeper/timesheet/src/views/deviceManagement/deviceManagement.vue

@@ -78,7 +78,7 @@
           <div class="deviceManagement-title-right">
             <el-button type="text" @click="displayFileUpload()" style="margin-right: 10px;">成本数据上传</el-button>
             <!-- <el-button type="text">成本模板下载</el-button> -->
-            <el-link type="primary" :underline="false" href="./upload/设备成本.xlsx" download="设备成本.xlsx">成本模板下载</el-link>
+            <el-link type="primary" :underline="false" href="./upload/设备成本模板.xlsx" download="设备成本模板.xlsx">成本模板下载</el-link>
           </div>
         </div>
 

+ 7 - 0
fhKeeper/formulahousekeeper/timesheet/src/views/project/detail.vue

@@ -221,6 +221,13 @@
                         type: 'bar',
                         barMaxWidth: 30,
                         data: yList,
+                        label: {
+                            normal: {
+                                show: true,
+                                position: 'top',
+                                formatter: `{c} ${this.yAxisValue == 0 ? '元' : '小时'}`,
+                            }
+                        }
                     }]
                 };
                 myChart.setOption(option,{notMerge: true});

+ 12 - 58
fhKeeper/formulahousekeeper/timesheet/src/views/workReport/daily.vue

@@ -139,7 +139,7 @@
                                     <el-link v-if="user.timeType.enableNewWeeklyfill == 1" type="primary" style="margin-right:10px;" :underline="false" @click="isSubstitude=false;fillInReportCustom()">{{ $t('textLink.fillInAWeek') }}</el-link>
                                     <!-- <el-link type="primary" style="margin-right:10px;" :underline="false" @click="isSubstitude=false;fillInReportCustom()">按周填报123</el-link> -->
                                     <el-link type="primary" style="margin-right:10px;" :underline="false" @click="isSubstitude=false;weekIndex++,fillWeekDialogVisiCustomTwo=true" v-if="user.timeType.enableNewWeeklyfill==2">按周填报</el-link>
-                                    <el-link type="primary" v-if="user.companyId != 5978 && permissions.reportsFillOut && user.timeType.enableNewWeeklyfill != 1" style="margin-right:10px;" :underline="false" @click="isSubstitude=true; fillInReport(-1,0)">{{$t('textLink.helpToFillIn')}}</el-link>
+                                    <el-link type="primary" v-if="user.companyId != 5978 && permissions.reportsFillOut && user.timeType.enableNewWeeklyfill != 1" style="margin-right:10px;" :underline="false" @click="isSubstitude=true; fillInReport(-1,user.companyId == 5814?2:0)">{{$t('textLink.helpToFillIn')}}</el-link>
                                     <!-- 苏州景昱,按周填报的模式进行代填日报 -->
                                     <el-link type="primary" v-if="user.companyId == 5978 && permissions.reportsFillOut && user.timeType.enableNewWeeklyfill != 1" style="margin-right:10px;" :underline="false" @click="isSubstitude=true; fillInReportss();">{{$t('textLink.helpToFillIn')}}</el-link>
                                     
@@ -205,7 +205,7 @@
                                                         <span v-else>
                                                             <span v-if="item2.isDeptAudit==0">
                                                                 <span v-if="item2.projectAuditState==0">
-                                                                    <!-- 待项目审核人 --> {{user.companyId == 469?(item2.auditorDeptName?('待'+item2.auditorDeptName):"待部门主管"):$t('other.waitForTheProjectReviewer')}}
+                                                                    <!-- 待项目审核人 --> {{user.companyId == 469?(item2.projectAuditorName=='程君健'?('待总经办'):"待部门主管"):$t('other.waitForTheProjectReviewer')}}
                                                                     <span v-if="item2.projectAuditorName != null">(
                                                                         <!-- {{item2.projectAuditorName}} -->
                                                                         <TranslationOpenData :configurationItems="{ openType: 'userName', openId: item2.projectAuditorName, renderIndex: 0 }" />
@@ -213,7 +213,7 @@
                                                                     <!-- 审核 --> {{$t('other.audit')}}
                                                                 </span>
                                                                 <span style="color:#32CD32;" v-else-if="item2.projectAuditState==1">
-                                                                    <!-- 项目审核人 --> {{user.companyId == 469?(item2.auditorDeptName?('待'+item2.auditorDeptName):"待部门主管"):$t('other.projectAuditor')}}
+                                                                    <!-- 项目审核人 --> {{user.companyId == 469?(item2.projectAuditorName=='程君健'?('待总经办'):"待部门主管"):$t('other.projectAuditor')}}
                                                                     <span v-if="item2.projectAuditorName != null">(
                                                                         <!-- {{item2.projectAuditorName}} -->
                                                                         <TranslationOpenData :configurationItems="{ openType: 'userName', openId: item2.projectAuditorName, renderIndex: 0 }" />
@@ -378,7 +378,7 @@
         </el-dialog>
 
         <!-- 填写日报的dialog -->
-        <el-dialog :title="editTitle[isBatch]" :visible.sync="dialogVisible" width="60%" :close-on-click-modal="false" @closed="guanbi()" :top="'5.5vh'" custom-class="editReportDialog" ref="editReportDialog">
+        <el-dialog :title="isSubstitude?$t('textLink.helpToFillIn'):editTitle[isBatch]" :visible.sync="dialogVisible" width="60%" :close-on-click-modal="false" @closed="guanbi()" :top="'5.5vh'" custom-class="editReportDialog" ref="editReportDialog">
             <div style="height: 65vh;overflow: auto;">
                 <el-form ref="workForm" :model="workForm" :rules="workRules" label-width="120px">
                     <el-form-item :label="$t('screening.selectPeople')" v-if="isSubstitude">
@@ -395,6 +395,10 @@
                                 {{$t('defaultText.pleaseSelectAsubstitute')}}
                             </span>
                         </div>
+                        <!-- <el-radio-group v-model="singleDate" style="margin-left:10px;">
+                            <el-radio :label="1">单日代填</el-radio>
+                            <el-radio :label="2">多日代填</el-radio>
+                        </el-radio-group> -->
                     </el-form-item>
                     <el-form-item :label="$t('screening.workingDate')" prop="createDate">
                         <el-date-picker v-model="workForm.createDate" :editable="false" format="yyyy-MM-dd" value-format="yyyy-MM-dd" 
@@ -423,7 +427,7 @@
                         <!--针对明夷,批量填报(不含代填)情况下显示考勤时长-->
                         <span v-if="!isSubstitude && isBatch && user.company.companyName === mingyiName">,{{ $t('workAttendance') }}:{{this.workTimeForMinYi}}{{$t('time.hour')}}</span>
                         <el-button type="default" style="margin-left:5px;" size="small" :loading="syncTimeLoading" 
-                        v-if="!isBatch && user.timeType.syncCorpwxTime==1" icon="el-icon-refresh" 
+                        v-if="!isBatch && user.timeType.syncCorpwxTime==1 && !isSubstitude" icon="el-icon-refresh" 
                                 @click="refreshWXCardTime(workForm.createDate)"></el-button>
                         <el-button type="default" style="margin-left:5px;" size="small" :loading="syncTimeLoading" 
                         v-if="isBatch && user.company.companyName === mingyiName" icon="el-icon-refresh" 
@@ -1901,11 +1905,11 @@
         <!--驳回弹出框 -->
         <el-dialog :title="$t('defaultText.pleaseEnterTheReason')"  v-if="denyReasonDialog" :visible.sync="denyReasonDialog" :close-on-click-modal="false" customClass="customWidth" width="500px">
             <div>
-                <el-input type="textarea" v-model="denyForm.reason" rows="2" :placeholder="$t('defaultText.pleaseEnterYourDecision')+(denyForm.i==0?$t('btn.rejected'):$t('btn.undo'))+$t('other.reason')" />
+                <span style="color:red;">*</span><el-input type="textarea" v-model="denyForm.reason" rows="2" :placeholder="$t('defaultText.pleaseEnterYourDecision')+(denyForm.i==0?$t('btn.rejected'):$t('btn.undo'))+$t('other.reason')" />
             </div>
             <div slot="footer" class="dialog-footer">
                 <el-button  @click="denyReasonDialog = false" >{{$t('btn.cancel')}}</el-button>
-                <el-button type="primary" :loading="isDenying" @click="deny()" >{{$t('btn.submit')}}</el-button>
+                <el-button type="primary" :loading="isDenying" @click="deny()" :disabled="user.timeType.forceRejectReason && !denyForm.reason">{{$t('btn.submit')}}</el-button>
             </div>
         </el-dialog>
         <!--  通过弹出框 -->
@@ -2289,6 +2293,7 @@
         },
         data() {
             return {
+                singleDate:1,
                 subFillProjectList:[],
                 curAuditNode: 1,
                 refreshingTime: false,
@@ -2839,7 +2844,6 @@
                     let sdate = new Date(this.workForm.createDate[0]);
                     let edate = new Date(this.workForm.createDate[1]);
                     let days = (edate.getTime() - sdate.getTime())/(24*3600*1000) + 1;
-                    console.log('days===', days)
                     if (days < 0) {
                         return;
                     } 
@@ -2880,9 +2884,7 @@
                 if (selectPid && domainItem.extraField1) {
                     //是否非项目
                     var isPublic = domainItem.isPublic;//this.fillProjectList.filter(p=>p.id == selectPid)[0].isPublic;
-                    console.log('==========','isPublic=='+isPublic);
                     var filteredRespList = this.jobResponseList.filter(j=>j.timeType == (isPublic?this.$t('fei-xiang-mu-gong-shi'):this.$t('xiangMuGongShi')) && j.role == (this.roleList.filter(r=>r.value==domainItem.extraField1)[0].label));
-                    console.log(filteredRespList);
                     domainItem.filteredRespList = filteredRespList;
                 }
                 
@@ -3107,13 +3109,11 @@
             },
             
             handlePictureCardPreview(file, index) {
-                console.log(file, index)
                 let arr = []
                 let imgArr = this.workForm.domains[index].imgListUrl
                 for(var i in imgArr) {
                     arr.push(imgArr[i].url)
                 }
-                console.log(arr, '图片数据')
                 const $viewer = this.$viewerApi({
                     images: arr
                 });
@@ -3121,7 +3121,6 @@
             },
             // 图片上传
             addImg(e, index) {
-                console.log(e, '数据')
                 let formData = new FormData()
                 formData.append('multipartFile', e.file)
                 this.http.uploadFile('/common/uploadFile', formData,
@@ -3140,7 +3139,6 @@
                     } else {
                         this.$message({message: res.msg,type: "error"});
                     }
-                    console.log(this.workForm.domains[index])
                 },
                 error => {this.$message({message: error,type: "error"});
                 });
@@ -3148,7 +3146,6 @@
 
             // 删除图片
             delImg(file,fileList, index) {
-                console.log(file, fileList)
                 let idx = 0
                 for(let i in fileList) {
                     if(fileList[i].uid == file.uid) {
@@ -3157,7 +3154,6 @@
                 }
                 this.workForm.domains[index].imgList.splice(idx, 1)
                 this.workForm.domains[index].imgListUrl.splice(idx, 1)
-                console.log(this.workForm.domains[index])
             },
             test(){
                 console.log('test',this.workForm.domains);
@@ -3332,7 +3328,6 @@
                             }
                         }
                         this.approvalProcessData = res.data
-                        console.log(this.approvalProcessData, '数据卡看')
                     }else{
                         this.$message({
                             message: res.msg,
@@ -3483,7 +3478,6 @@
                     lastMonth = month - 1;
                 }
                 this.ratioYmonth = lastMonthYear+''+(lastMonth < 10 ? '0' + lastMonth : lastMonth)
-                console.log('赋值 ==>', this.ratioYmonth)
             },
             confirmDownloadRatio() {
                 this.startRatioExporting = true;
@@ -3836,7 +3830,6 @@
                 }
             },
             seleChn(e,domain) {
-                console.log('===========修改时间==========');
                 if(e == 1) {
                     for(var i in this.workForm.domains) {
                         if(this.workForm.domains[i].timeType == 0) {
@@ -3848,15 +3841,12 @@
                 }
                 var quanbu = 0 
                 var spl = this.workForm.domains
-                console.log(spl)
                 var zhi = ''
                 for(var i in spl) {
                     var sp = +spl[i].workingTime + 0
-                    console.log('this.jsDay==='+this.jsDay);
                     zhi = this.jsDay * sp
                     quanbu = +quanbu + zhi
                 }
-                console.log('quanbu========'+quanbu);
                 this.jsTime = quanbu
                 this.totalReportHours = quanbu
                 let worktime = this.jsTime
@@ -4633,7 +4623,6 @@
                     res => {
                         if (res.code == "ok") {
                             this.$set(this.workForm,'time', res.data);
-                            console.log(res.data);
                         } 
                     },
                     error => {
@@ -4811,7 +4800,6 @@
                     let sdate = new Date(this.workForm.createDate[0]);
                     let edate = new Date(this.workForm.createDate[1]);
                     let days = (edate.getTime() - sdate.getTime())/(24*3600*1000) + 1;
-                    console.log('days===', days)
                     if (days < 0) {
                         days = 0;
                     }
@@ -4858,7 +4846,6 @@
                 if(this.yonghuUser.customDegreeActive == 1) {
                     this.selectDegreeId(domain, index)
                 }
-                // console.log('projectId===',domain.projectId);
                 domain.projectName = this.fillProjectList.filter(p=>p.id == domain.projectId)[0].projectName;
                 domain.isPublic = this.fillProjectList.filter(p=>p.id == domain.projectId)[0].isPublic;
                 this.http.post('/sub-project/list',{
@@ -4908,10 +4895,8 @@
                     domain.projectAuditorName = null;
                     domain.auditUserList = null;
                 }
-                console.log('this.reportTimeType.type==='+this.reportTimeType.type);
                 if (this.reportTimeType.type == 3) {
                     //新增项目时,自动计算
-                    console.log('===time====='+this.reportTimeType.allday * domain.progress/100);
                     domain.workingTime = (this.reportTimeType.allday * domain.progress/100).toFixed(1);
                 }
                 //加载昱众的工作职责
@@ -5297,9 +5282,7 @@
                     this.dataLoading = false
                 }
                 // return
-                console.log(textList, '<=== textList')
                 this.seluserforTextin(this.seluserText, newData, textList)
-                console.log(newData, 'Data')
                 this.data = newData;
                 this.calculateMembCount(this.data);
                 this.data[0].membCount = this.membCount;//总人数
@@ -5343,7 +5326,6 @@
                 localStorage.setItem('nodeModelDataKey', JSON.stringify(this.nodeModelData))
             },
             nodeChangeCollapse(data) {
-                console.log(this.nodeModelData)
                 this.nodeModelData.some((item, i) => {
                     if (item === data.id) {
                         this.nodeModelData.length = i
@@ -5438,7 +5420,6 @@
                                 this.setUserToDept(noAllData);
                                 this.deptMembData = noAllData;
                                 this.deptMembDataBackups = JSON.parse(JSON.stringify(this.deptMembData))
-                                console.log(this.deptMembData, '代填人员数据')
                             } else {
                                 this.$message({
                                     message: res.msg,
@@ -5460,9 +5441,7 @@
                 res => {
                     if (res.code == "ok") {
                         var list1 = JSON.parse(JSON.stringify(res.data));
-                        
                         this.deptOptionList = this.changeArr(list1);
-                        console.log(this.deptOptionList, '部门')
                     } else {
                         this.$message({
                             message: res.msg,
@@ -6016,8 +5995,6 @@
                 }
                 param.stateKey = this.stateKey
                 // param.departmentId = this.user.departmentId
-                console.log(param, '《=== 导出传的参数');
-                console.log('开始调用exportReport接口');
                 this.http.post(this.port.report.export, param,
                 res => {
                     this.exportingData = false;
@@ -6157,8 +6134,6 @@
                             }
                         }
                         this.projectList = res.data;
-                        
-                        console.log("项目列表",this.projectList);
                     } else {
                         this.$message({
                             message: res.msg,
@@ -6448,7 +6423,6 @@
                                 time: list.time,
                                 showRefresh: list.showRefresh
                             }
-                            console.log('workForm', this.workForm)
                         } else {
                             this.workForm = {
                                 createDate: this.workForm.createDate,
@@ -6522,7 +6496,6 @@
                 } else {
                     this.falsss = true
                 }
-                console.log('this.isSubstitude=='+this.isSubstitude);
                 if (this.isSubstitude) {
                     this.getSubstitudeUserDeptList();
                 } else {
@@ -6589,7 +6562,6 @@
 
             //按周填报的弹窗口中编辑单项目相关数据
             setWeekFormReportItem(reportId, i, names, row,sss) {
-                console.log(sss)
                 this.http.post('/report/getReportById', {
                     reportId: reportId
                 },
@@ -6669,7 +6641,6 @@
                 sss.progress = item.progress
                 sss.time = item.time
                 sss.content = item.content;
-                console.log('333', sss.content)
                 if (sss.time == '' && this.reportTimeType.type == 2) {
                     //取已填时间范围中最大的一个作为开始时间
                     var startTime = '09:00';
@@ -6708,7 +6679,6 @@
                     sss.subProjectList = item.subProjectList
                     sss.stages = item.stages
                     sss.taskGroups = item.taskGroups;
-                    console.log(sss.taskGroups, '33333');
                     sss.auditUserList = obj.auditUserList;
                     sss.degreeId = item.degreeId;
                     sss.customData = item.customData;
@@ -6728,7 +6698,6 @@
                     this.$forceUpdate();
 
                     this.getWeeklyTaskList(sss)
-                    console.log('最后的周报 ===>', this.zhoBao)
                 } else {
                     //第一次打开,获取数据
                     if (sss.id == -1) {
@@ -7371,7 +7340,6 @@
                         this.dateAr = []
                         var alp = []
                         var zhis = zhi[i]
-                        console.log(zhis)
                         for(var j in zhis) {
                             if(j != 'zhoDataTime' && j != 'he' && zhis[j].time != null && zhis[j].time != 'null' && zhis[j].time != '') {
                                 let objs = {}
@@ -7381,7 +7349,6 @@
                                 alp.push(objs)
                             } 
                         }
-                        console.log(alp)
                         this.dateAr = alp
                         if (this.reportTimeType.timeCanOverlap == 0) {
                             let str = this.$t('message.Filledtimeperiodsoverlap')
@@ -7436,7 +7403,6 @@
                         if(zhi[n].corpTime && parseInt(zhi[n].he) > zhi[n].corpTime.workHours){
                             overcorp += zhi[n].zhoDataTime + ','
                         }
-                        
                     }
                     if(this.user.companyId != 5978 && overcorp != ''){
                         overcorp = overcorp.substring(0,overcorp.length - 1)
@@ -8760,10 +8726,6 @@
                 this.isDenying = false;
                 let day = (this.choseDay+1) > 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
                 var ids = item.id;
-                // var data = item.data;
-                // data.forEach(element => {
-                //     ids +=(element.id+',');
-                // });
                 this.denyForm = {id: id ,i:i, date: this.date +day, reportIds: ids, reason:null};
             },
             // 未通过日报
@@ -8827,7 +8789,6 @@
                 this.workForm.domains[obj.idx].projectAuditorId = obj.id
             },
             vueCasader(obj) {
-                console.log(obj, '看看值', this.departmentList)
                 if(obj.distinction == 1 && obj.item) {
                     let arr = []
                     arr.push(obj.item.value)
@@ -8888,7 +8849,6 @@
             },
             //景昱变更提醒
             changeReminder(item){
-                console.log("============",item)
                 let parameter={
                     startDate: this.WorktimeDatepickValue[0],
                     endDate: this.WorktimeDatepickValue[1],
@@ -8966,7 +8926,6 @@
                 }
             },
             handleThreeData(userList) {
-                console.log(userList, '人员数据')
                 let deptMembDataBackups = JSON.parse(JSON.stringify(this.deptMembDataBackups))
                 this.deptMembData = this.filterTreeNodes(deptMembDataBackups, userList)
             },
@@ -9023,7 +8982,6 @@
                 })
             },
             changeTreeNodeStatus(node) {
-                console.log(node)
                 let allZt = true
                 node.expanded = allZt
                 for (let i = 0; i < node.childNodes.length; i++) {
@@ -9035,16 +8993,13 @@
             },
             // 按周填报获取相关任务
             async getWeeklyTaskList(item) {
-                console.log(item, '<=== 数据')
                 const { projectId, groupId, stage, taskId } = item
-                console.log(projectId, groupId, stage)
                 let parms = { projectId, isSubstitude: 0 }
                 groupId ? parms.groupId = groupId : ''
                 stage ? parms.stage = stage : ''
                 const { data } = await this.postData('/task/getRecentTask', parms)
                 this.zhoBao.taskId = taskId
                 this.$set(this.zhoBao, 'taskList', data)
-                console.log(this.zhoBao)
             },
             // 封装 post 请求
             postData(url, params) {
@@ -9064,7 +9019,6 @@
             },
             // 自定义事件
             selectCal(obj) {
-                console.log(obj, '传数据来源')
                 if(obj.distinction == '1') {
                     this.zhoBao.projectAuditorId = obj.id
                 } else if(obj.distinction == '2') {

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

@@ -322,21 +322,21 @@
         </div>        <!--驳回弹出框 -->
         <el-dialog :title="$t('defaultText.pleaseEnterTheReason')"  v-if="denyReasonDialog" :visible.sync="denyReasonDialog" :close-on-click-modal="false" customClass="customWidth" width="500px">
             <div>
-                <el-input type="textarea" v-model="denyForm.reason" rows="2" :placeholder="$t('defaultText.pleaseEnterYourDecision')+(denyForm.i==0?$t('btn.rejected'):$t('btn.undo'))+$t('other.reason')" />
+                <span style="color:red;">*</span><el-input type="textarea" v-model="denyForm.reason" rows="2" :placeholder="$t('defaultText.pleaseEnterYourDecision')+(denyForm.i==0?$t('btn.rejected'):$t('btn.undo'))+$t('other.reason')" />
             </div>
             <div slot="footer" class="dialog-footer">
                 <el-button  @click="denyReasonDialog = false" >{{ $t('btn.cancel') }}</el-button>
-                <el-button type="primary" @click="deny()" >{{ $t('btn.determine') }}</el-button>
+                <el-button type="primary" @click="deny()" :disabled="user.timeType.forceRejectReason && !denyForm.reason">{{ $t('btn.determine') }}</el-button>
             </div>
         </el-dialog>
         <!--批量驳回弹出框 -->
         <el-dialog :title="$t('defaultText.pleaseEnterTheReason')"  v-if="batchDenyDialog" :visible.sync="batchDenyDialog" :close-on-click-modal="false" customClass="customWidth" width="500px">
             <div>
-                <el-input type="textarea" v-model="batchDenyData.reason" rows="2" :placeholder="$t('reasonforyourdecisiontoreject')" />
+                <span style="color:red;">*</span><el-input type="textarea" v-model="batchDenyData.reason" rows="2" :placeholder="$t('reasonforyourdecisiontoreject')" />
             </div>
             <div slot="footer" class="dialog-footer">
                 <el-button  @click="batchDenyDialog = false" >{{ $t('btn.cancel') }}</el-button>
-                <el-button type="primary" @click="batchDenyClick()" :loading="batchDenyLoading">{{ $t('btn.determine') }}</el-button>
+                <el-button type="primary" @click="batchDenyClick()" :loading="batchDenyLoading" :disabled="user.timeType.forceRejectReason && !batchDenyData.reason">{{ $t('btn.determine') }}</el-button>
             </div>
         </el-dialog>
         <!--工具条-->

+ 81 - 10
fhKeeper/formulahousekeeper/timesheet_h5/src/views/edit/index.vue

@@ -46,7 +46,7 @@
                         <van-button icon="replay" native-type="button" type="default" size="mini"
                             style="height:0.6rem;padding:0 0.16667rem;" :loading="cardRefLoading" loading-size="0.26667rem"
                             @click.stop.native="cardtimeRefresh(form.createDate)"
-                            v-if="user.timeType.syncCorpwxTime == 1 && (user.timeType.syncDingding == 1 || user.timeType.syncCorpwxTime == 1)"></van-button>
+                            v-if="!substitute && user.timeType.syncCorpwxTime == 1 && (user.timeType.syncDingding == 1 || user.timeType.syncCorpwxTime == 1)"></van-button>
                     </template>
                 </van-cell>
                 <!-- <div v-if="report.time" class="attendanceRecord">
@@ -645,7 +645,7 @@ export default {
                 createDate: [{ required: true, message: '请选择填报日期' }],
             },
             project: [],
-            report: "",
+            report: {},
 
             loading: false,
             finished: false,
@@ -906,6 +906,7 @@ export default {
                 const { id, name } = this.auditor.item
                 this.fillingAgent = { id, name }
                 this.getProject(this.fillingAgent.id);
+                this.getTargetUserCardTime();
             }
         },
         getAllUsersList() {
@@ -1425,6 +1426,22 @@ export default {
                 this.showPickerHours = true;
             }
         },
+        getTargetUserCardTime() {
+            if (this.user.timeType.showCorpwxCardtime && this.form.createDate && this.fillingAgent.name) {
+                //获取代填人的考勤
+                var that = this;
+                this.$axios.post('/user-corpwx-time/getUserCardTime', {userId: this.fillingAgent.id, date: this.form.createDate})
+                .then(res => {
+                    if (res.code == "ok") {
+                        // that.report.time = res.data;
+                        this.$set(that.report, 'time', res.data);
+                    } else {
+                        this.$toast.clear();
+                        this.$toast.fail(res.msg);
+                    }
+                }).catch(err => { this.$toast.clear(); });
+            }
+        },
         getTimeType() {
             this.$axios.post('/time-type/getCompanyTimeSetting', { companyId: this.user.companyId })
                 .then(res => {
@@ -1824,12 +1841,51 @@ export default {
                 }).catch(err => { this.$toast.clear(); });
         },
 
+        initFormData() {
+            this.totalReportHours = 0
+            this.canCancel = false;
+            this.canEdit = true;
+            var shuzhi = this.user.timeType.allday + '';
+            var t = this.user.timeType;
+            //没有填报的可以点击提交
+            this.form.domains = [{
+                id: null,
+                projectId: "",
+                projectName: "",
+                // workingTime: t.type==3?(t.allday).toFixed(1):"8.0",
+                workingTime: t.type == 3 ? (t.allday).toFixed(1) : shuzhi.indexOf('.') == '-1' ? shuzhi + '.0' : shuzhi,
+                content: "",
+                state: 2,
+                progress: 100,
+                isOvertime: false,
+                professionProgress: [],
+                multiWorktime: t.multiWorktime,
+                worktimeList: [{}],
+                canEdit: true,
+                auditorFirst: { name: '', id: '' },
+                auditorSec: { name: '', id: '' },
+                auditorThird: { name: '', id: '' },
+                ccUserid: { name: '', id: '' }
+            }]
+            if (this.isWeekend && this.user.timeType.lockWorktime != 1) {
+                this.$set(this.form.domains[0], 'isOvertime', true)
+                if (t.type != 2 && t.type != 0) {
+                    this.$set(this.form.domains[0], 'overtimeHours', t.allday.toFixed(0))
+                }
+            }
+            this.canEdit = true;
+            this.setTotalReportHours()
+        },
         // 改变时间
         changeTime(time) {
             this.form.createDate = this.format(new Date(time), "yyyy-MM-dd");
             this.currentDate = time;
             this.showPicker = false;
-            this.getReport();
+            if (this.substitute) {
+                this.getTargetUserCardTime();
+            } else {
+                this.getReport();
+            }
         },
 
         //点击选择审核人
@@ -2239,6 +2295,20 @@ export default {
                                     }).catch(() => { })
                                 }
                             }).catch(err => { this.$toast.clear(); });
+                        } else if (this.user.companyId == 469) {
+                            //校验填报的与考勤时长
+                            if (this.totalReportHours > this.report.time.workHours) {
+                                this.$toast('填报工时不得超过考勤时长')
+                            } else if (this.totalReportHours < this.report.time.workHours) {
+                                this.$dialog.confirm({
+                                    title: '提示',
+                                    message: '还剩余'+(this.report.time.workHours-this.totalReportHours).toFixed(1)+'h考勤时长尚未分配,是否确定提交'
+                                }).then(() => {
+                                    this.submitReportSon()
+                                }).catch(() => { })
+                            } else {
+                                this.submitReportSon()
+                            }
                         } else {
                             //提交时,做工时时长不足的提醒
                             if (this.totalReportHours < this.user.timeType.allday) {
@@ -2781,7 +2851,14 @@ export default {
             this.form.createDate = this.$route.query.date;
         }
 
-        this.getReport();
+        if (this.substitute) {
+            //代填日报
+            this.initFormData();
+        } else {
+            //个人自己填报
+            this.getReport();
+        }
+        
         this.getAllUsersList()
         this.getTimeType();
 
@@ -2799,12 +2876,6 @@ export default {
         if(this.user.timeType.userWithMultiDept) {
             this.getReportDeptList()
         }
-
-        // if(localStorage.getItem("formVal")) {
-        //     var obj = localStorage.getItem("formVal")
-        //     this.form = JSON.parse(obj)
-        //     localStorage.removeItem('formVal')
-        // }
     },
     beforeDestroy() {
         localStorage.removeItem('formVal')

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

@@ -74,7 +74,7 @@
                 <van-checkbox v-model="isAllChecked" :disabled="report.length == 0" @click="allChecked" shape="square" style="padding-left:3vw"></van-checkbox>
                 <div style="padding:1vh 2vw">
                 <van-button @click="batchAgree(true)" :disabled="!isCanAgree || report.length == 0" type="info" size="small" style="margin-right:6vw">批量通过</van-button>
-                <van-button @click="batchAgree(false)" :disabled="!isCanAgree || report.length == 0" type="danger" size="small" style="margin-left:2vw">批量驳回</van-button>
+                <van-button @click="showBatchDenyDialog()" :disabled="!isCanAgree || report.length == 0" type="danger" size="small" style="margin-left:2vw">批量驳回</van-button>
                 </div>
             </div>
             <van-skeleton  v-for="(item,index) in report" :key="index" title avatar :row="3" :loading="false">
@@ -181,8 +181,8 @@
                         </div>
                     </div>
                     <div class="form_btn" slot="footer">
-                        <van-button size="small" type="info" @click="approve(item.id, item)" style="margin-right: 4vw;">通过</van-button>
-                        <van-button size="small" type="danger" @click="showDenyDialog(item.id,0,item.dateStr, item)">驳回</van-button>
+                        <van-button size="small" type="info" @click="approve(item.userId, item)" style="margin-right: 4vw;">通过</van-button>
+                        <van-button size="small" type="danger" @click="showDenyDialog(item.userId,0,item.dateStr, item)">驳回</van-button>
                     </div>
                     <van-popup v-model="imgShow" position="bottom" closeable >
                         <van-swipe class="my-swipe"  indicator-color="white">
@@ -198,7 +198,7 @@
                 <van-field class="form_input"
                     v-model="denyForm.reason" name="reason" type="textarea" :placeholder="'请输入您决定'+(denyForm.i==0?'驳回':'撤销')+'的原因'"
                     rows="3" autosize  />
-                <van-button style="width:100%;" type="info" @click="deny()">提交</van-button>
+                <van-button style="width:100%;" type="info" @click="deny()" :disabled="this.user.timeType.forceRejectReason && !denyForm.reason">提交</van-button>
             </van-popup>
             <van-popup v-model="approveinDialog" v-if="approveinDialog" position="bottom" closeable >
                 <van-cell>请输入通过评价</van-cell>
@@ -217,6 +217,7 @@
     export default {
         data() {
             return {
+                isBatchDeny: false,
                 yuzhongCompId: 3385,
                 roleList:[{value: 1,label: 'CRC&LM'},{value: 2,label: 'PM'}],
                 isAllChecked: false,
@@ -349,7 +350,6 @@
                 this.isCanAgree = iscan
             },
             batchAgree(bol){
-                
                 let ids = ''
                 for(let i in this.report){
                     if(this.report[i].checked){
@@ -382,28 +382,7 @@
                         }
                     })
                     .catch(() => {});
-                }else{
-                    const toast = this.$toast.loading({
-                        forbidClick: true,
-                        duration: 0
-                    });
-                    let that = this
-                    this.$axios.post('/report/batchDenyReport', {
-                        ids: ids
-                    }).then(res => {
-                        if(res.code == "ok") {
-                            this.$toast.clear();
-                            setTimeout(function() {
-                                that.$toast.success('审核成功');
-                            }, 300);
-                            this.getReport();
-                        } else {
-                            this.$toast.clear();
-                            this.$toast.fail('批量操作失败:'+res.msg);
-                        }
-                    }).catch(err=> {this.$toast.clear();});
                 }
-                
             },
             batchApproveinfun(){
                 let that = this
@@ -498,7 +477,6 @@
             },
 
             approve(id, item) {
-                console.log(item, '<==== 点击')
                 Dialog.confirm({
                     message: `确认通过${item.dateStr}的日报吗?`
                 })
@@ -550,8 +528,8 @@
             },
 
             showDenyDialog(id,i,date, item) {
-                console.log(id, i, date, item)
                 this.denyReasonDialog = true;
+                this.isBatchDeny = false;
                 var ids = '';
                 var data = item.data;
                 data.forEach(element => {
@@ -560,7 +538,22 @@
                     }
                 });
                 this.denyForm = {id: id ,i:i, date: date, reportIds: ids, reason:null};
-                console.log(this.denyForm)
+            },
+            showBatchDenyDialog() {
+                this.isBatchDeny = true;
+                let ids = ''
+                for(let i in this.report){
+                    if(this.report[i].checked){
+                        for(let m in this.report[i].data){
+                            ids += this.report[i].data[m].id + ','
+                        }
+                    }
+                }
+                if(ids.length > 0){
+                    ids = ids.substring(0, ids.length-1);
+                }
+                this.denyForm = {reportIds: ids, reason:null};
+                this.denyReasonDialog = true;
             },
 
             deny() {
@@ -569,24 +562,43 @@
                     duration: 0
                 });
                 let that = this;
-                this.$axios.post("/report/deny", this.denyForm)
-                .then(res => {
-                    if(res.code == "ok") {
-                        this.$toast.clear();
-                        setTimeout(function() {
-                            that.$toast.success(that.denyForm.i==0?'驳回成功':'撤销成功');
-                        }, 300);
-                        
-                        this.getReport();
-                        this.denyReasonDialog = false;
-                    } else {
-                        this.$toast.clear();
-                        setTimeout(function() {
-                            that.$toast.fail(that.denyForm.i==0?'驳回失败':'撤销失败');
-                        }, 300);
-                        
-                    }
-                }).catch(err=> {this.$toast.clear();});
+                if (this.isBatchDeny) {
+                    this.$axios.post('/report/batchDenyReport', {
+                        ids: this.denyForm.reportIds
+                    }).then(res => {
+                        if(res.code == "ok") {
+                            this.$toast.clear();
+                            setTimeout(function() {
+                                that.$toast.success('审核成功');
+                            }, 300);
+                            that.getReport();
+                            that.denyReasonDialog = false;
+                        } else {
+                            that.$toast.clear();
+                            that.$toast.fail('批量操作失败:'+res.msg);
+                        }
+                    }).catch(err=> {this.$toast.clear();});
+                } else {
+                    this.$axios.post("/report/deny", this.denyForm)
+                    .then(res => {
+                        if(res.code == "ok") {
+                            this.$toast.clear();
+                            setTimeout(function() {
+                                that.$toast.success(that.denyForm.i==0?'驳回成功':'撤销成功');
+                            }, 300);
+                            
+                            this.getReport();
+                            this.denyReasonDialog = false;
+                        } else {
+                            this.$toast.clear();
+                            setTimeout(function() {
+                                that.$toast.fail(that.denyForm.i==0?'驳回失败':'撤销失败');
+                            }, 300);
+                            
+                        }
+                    }).catch(err=> {this.$toast.clear();});
+                }
+                
             }
         },