Parcourir la source

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

Lijy il y a 1 an
Parent
commit
aeb08b00fe
14 fichiers modifiés avec 433 ajouts et 103 suppressions
  1. 15 0
      fhKeeper/formulahousekeeper/management-workshop/src/main/java/com/management/platform/controller/PlanController.java
  2. 35 17
      fhKeeper/formulahousekeeper/management-workshop/src/main/java/com/management/platform/controller/WeiXinCorpController.java
  3. 2 0
      fhKeeper/formulahousekeeper/management-workshop/src/main/java/com/management/platform/entity/Plan.java
  4. 8 0
      fhKeeper/formulahousekeeper/management-workshop/src/main/java/com/management/platform/entity/PlanProcedureTotal.java
  5. 8 0
      fhKeeper/formulahousekeeper/management-workshop/src/main/java/com/management/platform/entity/ProdProcedureTeam.java
  6. 7 0
      fhKeeper/formulahousekeeper/management-workshop/src/main/java/com/management/platform/service/PlanService.java
  7. 89 9
      fhKeeper/formulahousekeeper/management-workshop/src/main/java/com/management/platform/service/impl/PlanServiceImpl.java
  8. 4 2
      fhKeeper/formulahousekeeper/management-workshop/src/main/java/com/management/platform/service/impl/ReportServiceImpl.java
  9. 52 32
      fhKeeper/formulahousekeeper/timesheet-workshop-h5/src/components/chooseSomeone.vue
  10. 4 5
      fhKeeper/formulahousekeeper/timesheet-workshop-h5/src/views/planView/component/planComponent.vue
  11. 203 32
      fhKeeper/formulahousekeeper/timesheet-workshop-h5/src/views/planView/todayPlan/distribution.vue
  12. 1 1
      fhKeeper/formulahousekeeper/timesheet-workshop-h5/src/views/planView/todayPlan/todayPlan.vue
  13. 1 1
      fhKeeper/formulahousekeeper/timesheet-workshop-h5/src/views/planView/tomorrowPlan/tomorrowPlan.vue
  14. 4 4
      fhKeeper/formulahousekeeper/timesheet-workshop/src/views/workReport/daily.vue

+ 15 - 0
fhKeeper/formulahousekeeper/management-workshop/src/main/java/com/management/platform/controller/PlanController.java

@@ -3,6 +3,7 @@ package com.management.platform.controller;
 
 import com.management.platform.entity.Plan;
 import com.management.platform.entity.PlanProcedureTotal;
+import com.management.platform.entity.ProdProcedureTeam;
 import com.management.platform.service.PlanService;
 import com.management.platform.util.HttpRespMsg;
 import org.apache.ibatis.annotations.Param;
@@ -84,6 +85,20 @@ public class PlanController {
     public HttpRespMsg teamAllocation(PlanProcedureTotal planProcedureTotal, String teamIds,Integer planType) throws Exception {
         return planService.teamAllocation(planProcedureTotal,teamIds,planType);
     }
+    /*换人操作*/
+    @RequestMapping("/changePeople")
+    public HttpRespMsg changePeople(ProdProcedureTeam prodProcedureTeam,String newPeopleId){
+        return planService.changePeople(prodProcedureTeam,newPeopleId);
+    }
+
+    @RequestMapping("/deletePeople")
+    public HttpRespMsg deletePeople(Integer id){
+        return planService.deletePeople(id);
+    }
 
+    @RequestMapping("/receivePlan")
+    public HttpRespMsg receivePlan(String ids){
+        return planService.receivePlan(ids);
+    }
 }
 

+ 35 - 17
fhKeeper/formulahousekeeper/management-workshop/src/main/java/com/management/platform/controller/WeiXinCorpController.java

@@ -2136,21 +2136,39 @@ public class WeiXinCorpController {
                     System.out.println("synchronizationDP========="+departmentName);
                     Integer departmentId = ob.getInteger("id");
                     Integer departmentParentId =ob.getInteger("parentid");
-                    Integer cut = departmentWxMapper.selectCount(new QueryWrapper<DepartmentWx>().eq("corpid",corpid).eq("wx_deptid",departmentId));
-                    if(cut==0&&departmentId!=1){
-                        System.out.println("join===========");
-                        DepartmentWx departmentWx=new DepartmentWx();
-                        departmentWx.setCorpid(corpid)
-                                .setName(departmentName)
-                                .setWxParentid(departmentParentId)
-                                .setWxDeptid(departmentId);
-                        Department department = new Department();
-                        department.setCompanyId(company.getId());
-                        department.setDepartmentName(departmentName);
-                        department.setCorpwxDeptid(departmentId);
-                        departmentMapper.insert(department);
-                        departmentWx.setSysDeptid(department.getDepartmentId());
-                        departmentWxMapper.insert(departmentWx);
+                    if (departmentId != 1) {
+                        //非根部门
+                        DepartmentWx findDepartment = departmentWxMapper.selectOne(new QueryWrapper<DepartmentWx>().eq("corpid",corpid).eq("wx_deptid",departmentId));
+                        if (findDepartment == null) {
+                            DepartmentWx departmentWx=new DepartmentWx();
+                            departmentWx.setCorpid(corpid)
+                                    .setName(departmentName)
+                                    .setWxParentid(departmentParentId)
+                                    .setWxDeptid(departmentId);
+                            Department department = new Department();
+                            department.setCompanyId(company.getId());
+                            department.setDepartmentName(departmentName);
+                            department.setCorpwxDeptid(departmentId);
+                            departmentMapper.insert(department);
+                            departmentWx.setSysDeptid(department.getDepartmentId());
+                            departmentWxMapper.insert(departmentWx);
+                        } else {
+                            //存在的部门,更新
+                            findDepartment.setName(departmentName);
+                            findDepartment.setWxParentid(departmentParentId);
+                            departmentWxMapper.updateById(findDepartment);
+                            Department department = departmentMapper.selectOne(new QueryWrapper<Department>().eq("company_id", company.getId()).eq("corpwx_deptid", departmentId));
+                            if (department == null) {
+                                department = new Department();
+                                department.setCompanyId(company.getId());
+                                department.setDepartmentName(departmentName);
+                                department.setCorpwxDeptid(departmentId);
+                                departmentMapper.insert(department);
+                            } else {
+                                department.setDepartmentName(departmentName);
+                                departmentMapper.updateById(department);
+                            }
+                        }
                     }
                 }
                 SysRole role = sysRoleMapper.selectOne(new QueryWrapper<SysRole>().eq("company_id", company.getId()).eq("rolename","组员"));
@@ -2240,7 +2258,7 @@ public class WeiXinCorpController {
                             //跳过非激活状态的员工
                             if (userInfoOb.getInteger("status") != 1) continue;
                             String userName = String.valueOf(userInfoOb.get("name"));
-//                                String phone = String.valueOf(userInfoOb.get("phone"));
+                                String phone = String.valueOf(userInfoOb.get("phone"));
                             String openUserid = userInfoOb.getString("open_userid");
                             List<Integer> departments = (List<Integer>) userInfoOb.get("department");
                             Integer deptId = departments.get(0);
@@ -2263,7 +2281,7 @@ public class WeiXinCorpController {
                                     .setName(userName)
                                     .setRoleName(role.getRolename())
                                     .setRoleId(role.getId())
-//                                    .setPhone(phone)
+                                    .setPhone(phone)
                                     .setCorpwxRealUserid(corpWxuserid)
                                     .setColor(ColorUtil.randomColor())
                                     .setPassword(MD5Util.getPassword("000000"))

+ 2 - 0
fhKeeper/formulahousekeeper/management-workshop/src/main/java/com/management/platform/entity/Plan.java

@@ -219,6 +219,8 @@ public class Plan extends Model<Plan> {
      * 创建时间
      */
     @TableField("create_time")
+    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    @JsonFormat( pattern="yyyy-MM-dd HH:mm:ss")
     private LocalDateTime createTime;
 
     /**

+ 8 - 0
fhKeeper/formulahousekeeper/management-workshop/src/main/java/com/management/platform/entity/PlanProcedureTotal.java

@@ -5,6 +5,8 @@ import com.baomidou.mybatisplus.extension.activerecord.Model;
 import com.baomidou.mybatisplus.annotation.TableId;
 import com.baomidou.mybatisplus.annotation.TableField;
 import java.io.Serializable;
+import java.util.List;
+
 import lombok.Data;
 import lombok.EqualsAndHashCode;
 import lombok.experimental.Accessors;
@@ -63,6 +65,12 @@ public class PlanProcedureTotal extends Model<PlanProcedureTotal> {
     @TableField(exist = false)
     private Integer totalProgress;
 
+    @TableField(exist = false)
+    private List<ProdProcedureTeam> prodProcedureTeamList;
+
+    @TableField(exist = false)
+    private boolean canReceive;
+
     @Override
     protected Serializable pkVal() {
         return this.id;

+ 8 - 0
fhKeeper/formulahousekeeper/management-workshop/src/main/java/com/management/platform/entity/ProdProcedureTeam.java

@@ -7,9 +7,12 @@ 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;
+import org.springframework.format.annotation.DateTimeFormat;
 
 /**
  * <p>
@@ -69,6 +72,8 @@ public class ProdProcedureTeam extends Model<ProdProcedureTeam> {
      * 最近更新时间
      */
     @TableField("update_time")
+    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
     private LocalDateTime updateTime;
 
     @TableField("plan_procedure_id")
@@ -80,6 +85,9 @@ public class ProdProcedureTeam extends Model<ProdProcedureTeam> {
     @TableField("status")
     private Integer status;
 
+    @TableField(exist = false)
+    private User user;
+
 
     @Override
     protected Serializable pkVal() {

+ 7 - 0
fhKeeper/formulahousekeeper/management-workshop/src/main/java/com/management/platform/service/PlanService.java

@@ -3,6 +3,7 @@ package com.management.platform.service;
 import com.management.platform.entity.Plan;
 import com.baomidou.mybatisplus.extension.service.IService;
 import com.management.platform.entity.PlanProcedureTotal;
+import com.management.platform.entity.ProdProcedureTeam;
 import com.management.platform.util.HttpRespMsg;
 import org.springframework.web.multipart.MultipartFile;
 
@@ -35,4 +36,10 @@ public interface PlanService extends IService<Plan> {
     HttpRespMsg hasSetDeptDetail();
 
     HttpRespMsg teamAllocation(PlanProcedureTotal planProcedureTotal, String teamIds,Integer planType) throws Exception;
+
+    HttpRespMsg changePeople(ProdProcedureTeam prodProcedureTeam, String newPeopleId);
+
+    HttpRespMsg deletePeople(Integer id);
+
+    HttpRespMsg receivePlan(String ids);
 }

+ 89 - 9
fhKeeper/formulahousekeeper/management-workshop/src/main/java/com/management/platform/service/impl/PlanServiceImpl.java

@@ -20,6 +20,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.springframework.beans.BeanUtils;
 import org.springframework.beans.factory.annotation.Value;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
@@ -36,6 +37,7 @@ import java.sql.Wrapper;
 import java.text.SimpleDateFormat;
 import java.time.Instant;
 import java.time.LocalDate;
+import java.time.LocalTime;
 import java.time.ZoneId;
 import java.time.format.DateTimeFormatter;
 import java.util.*;
@@ -792,9 +794,74 @@ public class PlanServiceImpl extends ServiceImpl<PlanMapper, Plan> implements Pl
         return httpRespMsg;
     }
 
+    @Override
+    public HttpRespMsg receivePlan(String ids) {
+        HttpRespMsg msg=new HttpRespMsg();
+        if(StringUtils.isEmpty(ids)){
+            return msg;
+        }
+        List<String> idList =Arrays.asList(ids.split(","));
+        List<ProdProcedureTeam> procedureTeams = prodProcedureTeamService.list(new QueryWrapper<ProdProcedureTeam>().in("id", idList));
+        procedureTeams.forEach(pl->{
+            pl.setStatus(1);
+        });
+        if(!prodProcedureTeamService.updateBatchById(procedureTeams)){
+            msg.setError("验证失败");
+        }
+        return msg;
+    }
+
+    @Override
+    public HttpRespMsg deletePeople(Integer id) {
+        HttpRespMsg msg=new HttpRespMsg();
+        ProdProcedureTeam prodProcedureTeam = prodProcedureTeamService.getById(id);
+        if(prodProcedureTeam.getStatus()!=0){
+            msg.setError("非待接收状态无法删除");
+            return msg;
+        }
+        if(!prodProcedureTeamService.removeById(prodProcedureTeam)){
+            msg.setError("验证失败");
+        }
+        return msg;
+    }
+
+    @Override
+    public HttpRespMsg changePeople(ProdProcedureTeam prodProcedureTeam, String newPeopleId) {
+        HttpRespMsg msg=new HttpRespMsg();
+        String time="16:00:00";
+        DateTimeFormatter df=DateTimeFormatter.ofPattern("HH:mm:ss");
+        LocalTime localTime=LocalTime.now();
+        LocalTime timeParse = LocalTime.parse(time, df);
+        if(localTime.isAfter(timeParse)){
+            msg.setError("下午4点之后禁止此操作");
+            return msg;
+        }
+        List<ProdProcedureTeam> list=new ArrayList<>();
+        ProdProcedureTeam p=new ProdProcedureTeam();
+        BeanUtils.copyProperties(prodProcedureTeam,p);
+        p.setId(null);
+        p.setUserId(newPeopleId);
+        p.setStatus(0);
+        prodProcedureTeam.setStatus(4);
+        list.add(prodProcedureTeam);
+        list.add(p);
+        if(!prodProcedureTeamService.saveOrUpdateBatch(list)){
+            msg.setError("验证失败");
+        }
+        return msg;
+    }
+
     @Override
     public HttpRespMsg teamAllocation(PlanProcedureTotal planProcedureTotal,String teamIds,Integer planType) throws Exception {
         HttpRespMsg msg=new HttpRespMsg();
+        String time="16:00:00";
+        DateTimeFormatter df=DateTimeFormatter.ofPattern("HH:mm:ss");
+        LocalTime localTime=LocalTime.now();
+        LocalTime timeParse = LocalTime.parse(time, df);
+        if(localTime.isAfter(timeParse)){
+            msg.setError("下午4点之后禁止此操作");
+            return msg;
+        }
         Integer companyId = userMapper.selectById(request.getHeader("token")).getCompanyId();
         BigDecimal totalWages=new BigDecimal((planProcedureTotal.getTotalWages()==null||StringUtils.isEmpty(planProcedureTotal.getTotalWages()))?0:planProcedureTotal.getTotalWages());
         BigDecimal totalWorkingHours=new BigDecimal((planProcedureTotal.getTotalWorkingHours()==null||StringUtils.isEmpty(planProcedureTotal.getTotalWorkingHours())?0:planProcedureTotal.getTotalWorkingHours()));
@@ -813,20 +880,21 @@ public class PlanServiceImpl extends ServiceImpl<PlanMapper, Plan> implements Pl
             List<ProdProcedureTeam> procedureTeamList = prodProcedureTeamService.list(new QueryWrapper<ProdProcedureTeam>().eq("plan_procedure_id",planProcedureTotal.getId()));
             List<User> userList = userMapper.selectBatchIds(Arrays.asList(team));
             //处理人员
-            procedureTeamList.stream().forEach(pt->{
-                if(!Arrays.asList(team).contains(pt.getUserId())){
-                    Integer cut = reportMapper.selectCount(new QueryWrapper<Report>().eq("user_procedure_team_id", pt.getId()));
-                    if(cut<1){
-                        prodProcedureTeamService.removeById(pt.getId());
-                    }
-                }
-            });
+//            procedureTeamList.stream().forEach(pt->{
+//                if(!Arrays.asList(team).contains(pt.getUserId())){
+//                    Integer cut = reportMapper.selectCount(new QueryWrapper<Report>().eq("user_procedure_team_id", pt.getId()));
+//                    if(cut<1){
+//                        prodProcedureTeamService.removeById(pt.getId());
+//                    }
+//                }
+//            });
             for (int i = 0; i < team.length; i++) {
                 ProdProcedureTeam prodProcedureTeam=new ProdProcedureTeam();
                 prodProcedureTeam.setCompanyId(companyId);
                 prodProcedureTeam.setPlanProcedureId(planProcedureTotal.getId());
                 prodProcedureTeam.setUserId(team[i]);
                 int finalI = i;
+                //已存在的人员更新处理
                 Optional<ProdProcedureTeam> first = procedureTeamList.stream().filter(pl -> pl.getUserId().equals(team[finalI])).findFirst();
                 if(first.isPresent()){
                     prodProcedureTeam.setId(first.get().getId());
@@ -874,6 +942,7 @@ public class PlanServiceImpl extends ServiceImpl<PlanMapper, Plan> implements Pl
         HttpRespMsg msg=new HttpRespMsg();
         Plan plan = planMapper.selectOne(new QueryWrapper<Plan>().eq("id", id));
         Integer companyId = userMapper.selectById(request.getHeader("token")).getCompanyId();
+        String userId = request.getHeader("token");
         if(plan!=null){
             switch (type){
                 case 0:
@@ -889,7 +958,18 @@ public class PlanServiceImpl extends ServiceImpl<PlanMapper, Plan> implements Pl
                             ps.setProdProcedure(first.get());
                         }
                         if(procedureTeams.size()>0){
-                            ps.setTeamIds(procedureTeams.stream().filter(pt->pt.getPlanProcedureId().equals(ps.getId())).map(ProdProcedureTeam::getUserId).distinct().collect(Collectors.joining(",")));
+                            List<ProdProcedureTeam> procedureTeamList = procedureTeams.stream().filter(pt -> pt.getPlanProcedureId().equals(ps.getId())).collect(Collectors.toList());
+                            ps.setTeamIds(procedureTeamList.stream().map(ProdProcedureTeam::getUserId).distinct().collect(Collectors.joining(",")));
+                            procedureTeamList.forEach(pt->{
+                                Optional<User> user = userList.stream().filter(ul -> ul.getId().equals(pt.getUserId())).findFirst();
+                                if(user.isPresent()){
+                                    pt.setUser(user.get());
+                                }
+                            });
+                            ps.setProdProcedureTeamList(procedureTeamList);
+                            if(procedureTeamList.stream().anyMatch(pl->pl.getStatus()==0&&pl.getUserId().equals(userId))){
+                                ps.setCanReceive(true);
+                            }
                             if(!StringUtils.isEmpty(ps.getTeamIds())){
                                 String userNames = userList.stream().filter(ul -> Arrays.asList(ps.getTeamIds().split(",")).contains(ul.getId())).collect(Collectors.toList())
                                         .stream().map(User::getName).collect(Collectors.joining(","));

+ 4 - 2
fhKeeper/formulahousekeeper/management-workshop/src/main/java/com/management/platform/service/impl/ReportServiceImpl.java

@@ -201,8 +201,10 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
             userList = userMapper.selectList(new QueryWrapper<User>().select("id, name, corpwx_userid").in("department_id", deptIncludeSubDeptIds));
         } else if (checkType == 2) {
             List<DepartmentOtherManager> otherManagers = departmentOtherManagerMapper.selectList(new QueryWrapper<DepartmentOtherManager>().eq("department_id", deptId));
-            List<String> userIds = otherManagers.stream().map(DepartmentOtherManager::getOtherManagerId).collect(Collectors.toList());
-            userList = userMapper.selectList(new QueryWrapper<User>().select("id, name, corpwx_userid").in("id", userIds));
+            if (otherManagers.size() > 0) {
+                List<String> userIds = otherManagers.stream().map(DepartmentOtherManager::getOtherManagerId).collect(Collectors.toList());
+                userList = userMapper.selectList(new QueryWrapper<User>().select("id, name, corpwx_userid").in("id", userIds));
+            }
         }
         httpRespMsg.data = userList;
         return httpRespMsg;

+ 52 - 32
fhKeeper/formulahousekeeper/timesheet-workshop-h5/src/components/chooseSomeone.vue

@@ -6,12 +6,13 @@
     </div>
     <div class="chooseSomeone_Con contentRoll">
       <!-- 单选 -->
-      <van-radio-group v-model="radioVal" class="chooseSomeone_radio_group" v-if="newGroupView == 1">
+      <van-radio-group v-model="radioVal" class="chooseSomeoneo_group" v-if="newGroupView == 1">
         <van-radio :name="item.id" v-for="item, index in personnelList" :key="index">
-          <div class="chooseSomeone_radio_group_item">
+          <div class="chooseSomeone_group_item">
             <div>{{ item.name }}</div>
-            <div class="textBeyondHiding">{{ item.workStation }}</div>
+            <div class="textBeyondHiding">{{ item.jobNumber }}</div>
           </div>
+          <div class="textDepartmentName">{{ item.departmentName }}</div>
         </van-radio>
       </van-radio-group>
 
@@ -22,6 +23,7 @@
             <div>{{ item.name }}</div>
             <div class="textBeyondHiding">{{ item.jobNumber }}</div>
           </div>
+          <div class="textDepartmentName">{{ item.departmentName }}</div>
         </van-checkbox>
       </van-checkbox-group>
 
@@ -32,7 +34,7 @@
         <div class="treeBox_tree">
           <el-tree ref="tree" v-model="treeVal" show-checkbox node-key="id" :data="personnelTree" :props="defaultProps"
             :filter-node-method="filterNode">
-            <span class="custom-tree-node" slot-scope="{ node, data }">
+            <span class="custom-tree-node" slot-scope="{ node }">
               <span>
                 {{ node.label }}
               </span>
@@ -78,6 +80,10 @@ export default {
       type: Array,
       default: () => []
     },
+    type:{
+      type:Number,
+      default:()=> 0//0新增 1换人
+    }
   },
   components: {},
   data() {
@@ -98,7 +104,7 @@ export default {
       newGroupView: '', // 组件传过来的值
       newGroupViewBack: '', // 组件传过来的值
 
-      loadingBtn: false // 确定按钮loading
+      loadingBtn: false, // 确定按钮loading
     };
   },
   computed: {},
@@ -148,24 +154,30 @@ export default {
     },
     newGroupViewBackCli(flg, i) {
       this.newGroupViewBack = flg
+      if(this.type != 1) {
       this.newGroupView = i
       this.$refs.tree.setCheckedKeys(this.groupVal)
+      } else {
+          this.getPeople()
+      }
+      
     },
     // 获取所有人员
     getPeople() {
       this.$axios.post('/user/getSimpleActiveUserList', {})
         .then(res => {
           if (res.code == "ok") {
-            if (!this.peopleList) {
-              this.peopleList = res.data.map(item => {
+            // if (!this.peopleList) {
+              this.personnelList = res.data.map(item => {
                 return {
                   name: item.name,
                   id: item.id,
                   phone: item.phone,
-                  jobNumber: item.jobNumber
+                  jobNumber: item.jobNumber,
+                  departmentName: item.departmentName
                 }
               })
-            }
+            // }
           } else {
             this.$toast.clear();
             this.$toast.fail(res.msg);
@@ -212,31 +224,36 @@ export default {
       let newArr = this.personnelList.filter(item => {
         return arr.includes(item.id)
       })
+      console.log(newArr)
+      // return
       this.loadingBtn = true
       this.$emit('ChooseSomeoneChanhe', newArr)
     },
     treeHandClick() {
-      console.log(this.treeVal)
-      console.log(this.$refs.tree.getCheckedNodes())
-      let arr = this.$refs.tree.getCheckedNodes()
-      arr = arr.filter(item => {
-        return !item.children
-      })
-      console.log(arr)
-      if(arr.length <= 0) {
-        this.$toast('请选择人员');
-        return
-      }
-      let newArr = arr.map(item => {
-        return {
-          id: item.id,
-          name: item.label || '',
-          phone: item.phone || '',
-          jobNumber: item.jobNumber || ''
+      if(this.newGroupView == 3) {
+        let arr = this.$refs.tree.getCheckedNodes()
+        arr = arr.filter(item => {
+          return !item.children
+        })
+        console.log(arr)
+        if(arr.length <= 0) {
+          this.$toast('请选择人员');
+          return
         }
-      })
-      this.loadingBtn = true
-      this.$emit('ChooseSomeoneChanhe', newArr)
+         let newArr = arr.map(item => {
+          return {
+            id: item.id,
+            name: item.label || '',
+            phone: item.phone || '',
+            jobNumber: item.jobNumber || '',
+            departmentName: item.departmentName || ''
+          }
+        })
+        this.loadingBtn = true
+        this.$emit('ChooseSomeoneChanhe', newArr)
+      } else {
+        this.handClick()
+      }
     }
   },
 };
@@ -246,7 +263,10 @@ export default {
 * {
   box-sizing: border-box;
 }
-
+.textDepartmentName {
+  color: #999;
+  font-size: 14px;
+}
 .chooseSomeone {
   display: flex;
   flex-wrap: wrap;
@@ -298,7 +318,7 @@ export default {
     overflow-y: auto;
     padding: 10px;
 
-    .chooseSomeoneo_group {
+    .chooseSomeoneo_group, .chooseSomeone_radio_group {
 
       .van-radio,
       .van-checkbox {
@@ -317,7 +337,7 @@ export default {
         }
       }
 
-      .chooseSomeone_group_item {
+      .chooseSomeone_group_item, .chooseSomeone_radio_group_item {
         display: flex;
         justify-content: space-between;
 

+ 4 - 5
fhKeeper/formulahousekeeper/timesheet-workshop-h5/src/views/planView/component/planComponent.vue

@@ -4,7 +4,7 @@
       <div class="planComponent_box" v-for="item, index in productList" :key="index">
         <div class="planComponent_Item">
           <div class="planComponent_ItemTop">
-            <div>{{ item.productName }}</div>
+            <div>{{ item.productName}}</div>
             <div>{{ item.productSchedulingNum }}</div>
             <div>
               <p>{{ item.startDate }}-{{ item.endDate }}</p><span @click="workShowHide(index)">{{ item.flg ? paiArr[0] : paiArr[1] }}</span>
@@ -143,16 +143,15 @@ export default {
     .planComponent_Item {
       .planComponent_ItemTop {
         div {
-          width: 100%;
+          // width: 100%;
+          width: 325px;
           display: flex;
+          flex-wrap: wrap;
           align-items: center;
           justify-content: space-between;
           font-size: 16px;
           color: #333;
           margin-bottom: 8px;
-          overflow: hidden;
-          text-overflow: ellipsis;
-          white-space: nowrap;
 
           span {
             color: #1989fa;

+ 203 - 32
fhKeeper/formulahousekeeper/timesheet-workshop-h5/src/views/planView/todayPlan/distribution.vue

@@ -1,4 +1,5 @@
 <template>
+<div>
   <div class="distribution">
     <van-nav-bar :title="titleText" left-text="返回" :right-text="!todayAndTomorrow ? '下发计划' : ''" @click-left="back" @click-right="placeAnOrder" fixed left-arrow/>
     <div class="distribution_header">
@@ -9,14 +10,11 @@
     <div class="distribution_con contentRoll">
       <div class="distribution_box" v-for="item,index in distributionList" :key="index">
         <div class="distribution_ItemBom">
+          <van-checkbox v-model="item.prodProcedure.isSelected"  @click="itemChecked" shape="square">
+          </van-checkbox>
           <div class="PlanItem">
             <span>{{ item.prodProcedure.name }}</span>
           </div>
-          <div class="PlanItem" v-show="todayAndTomorrow">
-            <div>组员:</div>
-            <span class="" v-if="item.teamNames" @click="distributionProp(item,index)">{{ item.teamNames }} <van-icon name="edit" color="#1989fa" /> </span>
-            <span style="color: #1989fa;" v-if="!item.teamNames && beDeptList" @click="distributionProp(item,index)">分配</span>
-          </div>
           <div class="PlanItem">
             <div>单件工价:</div><span class="textBeyondHiding">{{ item.prodProcedure.workingTime }}</span>
           </div>
@@ -37,25 +35,63 @@
               {{ item.prodProcedure.checkType == 0 ? '自检' : item.prodProcedure.checkType == 1 ? '互检' : '专检' }}
             </span>
           </div>
+           <div class="PlanItem" v-show="todayAndTomorrow" style="width:100%">
+            <div>组员:</div>
+            <span class="" v-if="item.teamNames">{{ item.teamNames }}</span>
+            <span style="color: #1989fa;" v-if="!item.teamNames && beDeptList" @click="distributionProp(item,index,'add')">分配</span>
+            <div>
+              <span style="color: #1989fa;" v-if="item.prodProcedureTeamList" @click="workShowHide(index)">{{ item.flg ? paiArr[0] : paiArr[1] }}</span>
+            </div>
+          </div>
+          <div style="width: 100%">
+              <collapse style="width: 100%">
+                <div v-if="item.flg" style="width: 100%">
+                    <div style="width: 100%;border-top: 0.02667rem solid #E6E6E6;margin-top: 10px">
+                      <div class="disZhuyuan" v-for="second_item,index in item.prodProcedureTeamList " :key="index">
+                            <span>{{ second_item.user.name }}</span>
+                            <span>{{ second_item.status==0?"待接收":second_item.status==1?"进行中":second_item.status==2?"已完工":second_item.status==3?"已中止":"已换人"}}</span>
+                            <span class="" v-if="second_item.status==3" @click="distributionProp(item,index,'change', second_item)"  style="color: #1989fa;">换人</span>
+                            <span class="" v-if="second_item.status==0" @click="deletePeople(second_item.id)"  style="color: #1989fa;">删除</span>
+                      </div>
+                      <div class="PlanItem">
+                        <span class="" v-if="beDeptList" @click="distributionProp(item,index,'add')"  style="color: #1989fa;">新增</span>
+                      </div>
+                    </div>
+                </div>
+              </collapse>
+          </div>
         </div>
       </div>
     </div>
     <!-- 弹出层选人 -->
     <van-popup v-model="popupShow" round position="bottom" :style="{ height: '80%',background: '#F4F4F4' }" >
-      <ChooseSomeone ref="ChooseSomeone" :groupView="2" :groupViewBack="true" :peopleList="peopleList" @ChooseSomeoneChanhe="chooseSomeoneChanhe" :peopleListId="peopleListId"></ChooseSomeone>
+      <ChooseSomeone ref="ChooseSomeone" :groupView="this.groupViewNum" :type="this.peopleType" :groupViewBack="true" :peopleList="peopleList" @ChooseSomeoneChanhe="chooseSomeoneChanhe" :peopleListId="peopleListId" :key="ChooseSomeoneKey"></ChooseSomeone>
     </van-popup>
   </div>
+<div class="formBatch">
+        <van-checkbox v-model="isAllChecked" :disabled="distributionList.length == 0" @click="allChecked" shape="square" style="padding-left:3vw"></van-checkbox>
+        <div style="padding:1vh 2vw">
+        <van-button @click="batchReceive()" :disabled="!isCanAgree || distributionList.length == 0" type="info" size="small">批量接收</van-button>
+        <!-- <van-button @click="batchAgree(false)" :disabled="!isCanAgree || distributionList.length == 0" type="danger" size="small" style="margin-left:2vw">批量驳回</van-button> -->
+        </div>
+    </div>
+</div>
 </template>
 
 <script>
 import ChooseSomeone from '../../../components/chooseSomeone.vue'
+import collapse from '../../../assets/collapse.js'
+import { CellGroup } from 'vant';
 export default {
   props: {},
   components: {
+    collapse,
     ChooseSomeone
   },
   data() {
     return {
+      isAllChecked:  false,
+      activeNames: ['1'],
       beDeptList: JSON.parse(localStorage.getItem('beDeptList')), // 是否为工长
       distributionList: [],
       distributionIndex: null,
@@ -70,13 +106,22 @@ export default {
 
       dates: '',
       productSchedulingNum: '',
-      productName: ''
+      productName: '',
+      isCanAgree:false,
+      user: JSON.parse(localStorage.userInfo),
+      peopleType:0,
+      groupViewNum:0,
+
+      ChooseSomeoneKey: 1,
+
+      peopleListIdObj: null, // 杯换人的所有信息
     };
   },
   computed: {},
   watch: {},
   created() {},
   mounted() {
+    this.paiArr = ['收起', '展开'],
     this.id = this.$route.query.id
     this.type = this.$route.query.type
     this.departmentId = this.$route.query.departmentId
@@ -94,47 +139,123 @@ export default {
     this.getPeople()
   },
   methods: {
+    // 批量操作
+    allChecked(){
+        if(this.isAllChecked){
+            for(let i in this.distributionList){
+                this.distributionList[i].prodProcedure.isSelected = true
+                console.log('===============');
+            }
+            this.isCanAgree = true
+        }else{
+            for(let i in this.distributionList){
+                this.distributionList[i].prodProcedure.isSelected = false
+            }
+            this.isCanAgree = false
+        }
+        this.$forceUpdate();
+    },
+    itemChecked(){
+        let isall = true
+        let iscan = false
+        for(let i in this.distributionList){
+            if(!this.distributionList[i].prodProcedure.isSelected){
+                isall = false
+            }else {
+                iscan = true
+            }
+        }
+        this.isAllChecked = isall
+        this.isCanAgree = iscan
+    },
+    batchReceive(bol){
+        let ids = ''
+        console.log(this.user)
+        let resArr=  this.distributionList.map(item=>{
+          if(item.prodProcedure.isSelected){
+            if(item.prodProcedureTeamList.filter(i=>i.userId==this.user.id).length>0){
+               return item.prodProcedureTeamList.filter(i=>i.userId==this.user.id)[0].id
+            }else{
+              return ""
+            }
+          }
+         })
+         console.log('res===============',resArr)
+        if(resArr.length > 0){
+            ids = resArr.join(",").trim()
+            this.$axios.post(
+              "/plan/receivePlan",
+              {
+                ids:ids
+              }
+            ).then(res => {
+              if (res.code == "ok") {
+                this.isAllChecked=false
+                this.isCanAgree=false
+                this.getDistributionList()
+              } else {
+                this.$toast.clear();
+                this.$toast.fail(res.msg);
+              }
+            }).catch(err => { this.$toast.clear(); })
+        }
+    },
+    workShowHide(index) {
+      this.distributionList[index].flg = !this.distributionList[index].flg;
+      console.log('=========>',this.distributionList[index].flg)
+    },
     back() {
       this.$router.go(-1);
     },
+    // 删除分配人员
+    deletePeople(item) {
+      const _this=this
+      this.$axios.post(
+        "/plan/deletePeople",
+        {
+          id:item
+        }
+      ).then(res => {
+        if (res.code == "ok") {
+          this.getDistributionList()
+        } else {
+          this.$toast.clear();
+          this.$toast.fail(res.msg);
+        }
+      }).catch(err => { this.$toast.clear(); })
+    },
     // 下单计划
     placeAnOrder() {
       let ids=[this.id];
+
       this.$axios.post(
         "/plan/allocationPlan",
         {
           ids: ids.join(","),
           planType: this.type
-        },
-        (res) => {
-          if (res.code == "ok") {
-            this.$message({
-              message: '下发成功',
-              type: "success",
-            });
-          } else {
-            this.$message({
-              message: res.msg,
-              type: "error",
-            });
-          }
-        },
-        (error) => {
-          this.$message({
-            message: error,
-            type: "error",
-          });
         }
-      );
+      )
     },
-    distributionProp(item, index) {
-      if(this.beDeptList) {
-        console.log(item, index)
+    distributionProp(item, index, str, itemObj) {
+      this.ChooseSomeoneKey++
+      if(str=='add'){
+        this.peopleType=0;
+        this.groupViewNum=2;
         if(item.teamIds) {
           this.peopleListId = item.teamIds.split(',')
         } else {
           this.peopleListId = []
         }
+      }else if(str=='change'){
+        this.peopleType=1;
+        this.groupViewNum=1;
+        // 针对换人存之前人的所有信息
+        this.peopleListId = [itemObj.userId]
+        this.peopleListIdObj = itemObj
+      }
+      if(this.beDeptList) {
+        console.log(item, index)
+        
         this.distributionIndex = index
         this.popupShow = true
       }
@@ -146,6 +267,7 @@ export default {
       })
       .then(res => {
         if (res.code == "ok") {
+          res.data.forEach(item => { item.flg = false })
           this.distributionList = res.data
         } else {
           this.$toast.clear();
@@ -153,6 +275,23 @@ export default {
         }
       }).catch(err => { this.$toast.clear(); });
     },
+    //换人
+    changePeople(item,newPeopleId){
+        delete item.user
+        this.$axios.post('/plan/changePeople', {
+        ...item,
+        newPeopleId:newPeopleId
+      })
+      .then(res => {
+        if (res.code == "ok") {
+            this.getDistributionList()
+            this.popupShow = false
+        } else {
+          this.$toast.clear();
+          this.$toast.fail(res.msg);
+        }
+      }).catch(err => { this.$toast.clear(); });
+    },
     // 获取人员
     getPeople() {
       this.$axios.post('/user/getSimpleActiveUserList', {
@@ -165,7 +304,8 @@ export default {
               name: item.name,
               id: item.id,
               phone: item.phone,
-              jobNumber: item.jobNumber
+              jobNumber: item.jobNumber,
+              departmentName: item.departmentName
             }
           })
         } else {
@@ -177,6 +317,7 @@ export default {
     teamAllocation(item, nameArr){
       let newDistributionList = JSON.parse(JSON.stringify(this.distributionList[this.distributionIndex]))
       delete newDistributionList.prodProcedure
+      delete newDistributionList.prodProcedureTeamList
       this.$axios.post('/plan/teamAllocation', {
         ...newDistributionList,
         teamIds: item.join(","),
@@ -187,6 +328,7 @@ export default {
         this.$refs.ChooseSomeone['loadingBtn'] = false
         if (res.code == "ok") {
           this.distributionList[this.distributionIndex].teamNames = nameArr.join(',')
+          this.getDistributionList()
           this.popupShow = false
         } else {
           this.$toast.clear();
@@ -204,7 +346,13 @@ export default {
       let nameArr = item.map(item => {
         return item.name
       })
-      this.teamAllocation(arr, nameArr)
+      if(this.peopleType == 1) {
+        console.log(arr)
+        console.log('被换人信息', this.peopleListIdObj)
+        this.changePeople(this.peopleListIdObj,arr[0])
+      } else {
+        this.teamAllocation(arr, nameArr)
+      }
     }
   },
 };
@@ -214,6 +362,29 @@ export default {
   * {
     box-sizing: border-box;
   }
+  .formBatch{
+        position: fixed;
+        bottom: 0;
+        width: 100%;
+        z-index: 2;
+        background-color: #fff;
+        display: flex;
+        justify-content: space-between;
+        align-items: center;
+        height: 1.2rem;
+        border-top: 1px solid #ebebeb;
+    }
+
+    .disZhuyuan {
+      padding-left: 30px;
+      font-size: 14px;
+      width: 100%;
+      display: flex;
+      padding-right: 100px;
+      justify-content: space-between;
+      margin-top: 10px;
+      
+    }
   .distribution {
     width: 100%;
     height: 100%;

+ 1 - 1
fhKeeper/formulahousekeeper/timesheet-workshop-h5/src/views/planView/todayPlan/todayPlan.vue

@@ -3,7 +3,7 @@
     <van-nav-bar title="今日计划" left-text="返回" @click-left="back" fixed left-arrow />
     <div class="todayPlan flexCoum-box">
       <PlanComponent :titleText="'今日计划'" :planList="planList" v-if="planList.length > 0"></PlanComponent>
-      <van-empty description="无数据" v-else />
+      <van-empty description="无数据" v-else />
     </div>
   </div>
 </template>

+ 1 - 1
fhKeeper/formulahousekeeper/timesheet-workshop-h5/src/views/planView/tomorrowPlan/tomorrowPlan.vue

@@ -3,7 +3,7 @@
     <van-nav-bar title="明日计划" left-text="返回" @click-left="back" fixed left-arrow/>
     <div class="todayPlan flexCoum-box">
       <PlanComponent :titleText="'明日计划'" :planList="planList" v-if="planList.length > 0"></PlanComponent>
-      <van-empty description="无数据" v-else />
+      <van-empty description="无数据" v-else />
     </div>
   </div>
 </template>

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

@@ -113,9 +113,9 @@
                                     </span>
                                 </span>
                                 <span style="float:right;">
-                                    <el-link type="primary" style="margin-right:10px;" :underline="false" @click="isSubstitude=false;fillInReport(-1,0)">{{$t('textLink.fillInTheWork')}}</el-link>
+                                    <!-- <el-link type="primary" style="margin-right:10px;" :underline="false" @click="isSubstitude=false;fillInReport(-1,0)">{{$t('textLink.fillInTheWork')}}</el-link> -->
                                     <el-link type="primary" v-if="permissions.reportsFillOut" style="margin-right:10px;" :underline="false" @click="isSubstitude=true; fillInReport(-1,2)">{{$t('textLink.helpToFillIn')}}</el-link>
-                                    <el-link type="primary" v-if="permissions.reportSettings" style="margin-right:10px;" :underline="false" @click="fillInReport(-1,2)">补报设置</el-link>
+                                    <!-- <el-link type="primary" v-if="permissions.reportSettings" style="margin-right:10px;" :underline="false" @click="fillInReport(-1,2)">补报设置</el-link> -->
                                     <el-link type="primary" style="margin-right:10px;" :underline="false" @click="showExportDialog" v-if="permissions.reportExport">{{$t('textLink.exportWork')}}</el-link>
                                     <el-link type="primary" style="margin-right:10px;" :underline="false" @click="showWorkTime" >查看报工记录</el-link>
                                     <!--部门负责人给个导出工时的功能 -->
@@ -138,7 +138,7 @@
                                             <!-- 工作总时长: -->
                                             {{$t('other.totalWorkingHours')}}
                                             <!-- <span :style="parseFloat(item1.reportTime)>parseFloat(item1.calculateTime)+0.5?'color:red':''">{{item1.reportTime}}h</span> -->
-                                            <span >{{item1.reportTime | amounts}}</span>h
+                                            <span style="color:goldenrod;font-weight:bold;">{{item1.reportTime | amounts}}</span> 分钟
                                         </span>
                                         <span class="approvalProcessBox" v-if="user.timeType.showFillauditTime == 1">
                                             <i class="iconfont firerock-iconliucheng1"></i>
@@ -158,7 +158,7 @@
                                                 <el-card shadow="never">
                                                     <p v-if="item2.planType == 0">排产工单号:<b>{{item2.productSchedulingNum}}</b></p>
                                                     <p v-if="item2.planType == 1">任务变更通知号:<b>{{item2.taskChangeNoticeNum}}</b></p>
-                                                    <p>工作时长:<b>{{item2.workingTime.toFixed(2)}} h</b></p>
+                                                    <p>工作时长:<b style="color:goldenrod">{{item2.workingTime.toFixed(2)}} </b>分钟</p>
                                                     <p v-if="item2.planType == 0">产品名称:<b>{{item2.productName}}</b></p>
                                                     <p v-if="item2.planType == 0">工序名称:<b>{{item2.procedureName}}</b></p>
                                                     <p v-if="item2.planType == 1">任务名称:<b>{{item2.taskName}}</b></p>