Min 1 年之前
父节点
当前提交
adf9bcf937

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

@@ -190,6 +190,14 @@ public class PlanServiceImpl extends ServiceImpl<PlanMapper, Plan> implements Pl
                 if(planType==2){
                     totals.forEach(ps->{
                         if(procedureTeams.size()>0){
+                            List<ProdProcedureTeam> collect = procedureTeams.stream().filter(pt -> pt.getPlanProcedureId().equals(ps.getId())).collect(Collectors.toList());
+                            collect.forEach(c->{
+                                Optional<User> optional = userList.stream().filter(u -> u.getId().equals(c.getUserId())).findFirst();
+                                if(optional.isPresent()){
+                                    c.setUser(optional.get());
+                                }
+                            });
+                            ps.setProdProcedureTeamList(collect);
                             ps.setTeamIds(procedureTeams.stream().filter(pt->pt.getPlanProcedureId().equals(ps.getId())).map(ProdProcedureTeam::getUserId).distinct().collect(Collectors.joining(",")));
                             if(!StringUtils.isEmpty(ps.getTeamIds())){
                                 String userNames = userList.stream().filter(ul -> Arrays.asList(ps.getTeamIds().split(",")).contains(ul.getId())).collect(Collectors.toList())
@@ -357,7 +365,8 @@ public class PlanServiceImpl extends ServiceImpl<PlanMapper, Plan> implements Pl
             PlanProcedureTotal p=new PlanProcedureTotal();
             p.setPlanId(plan.getId());
             BigDecimal bigDecimal=new BigDecimal(String.valueOf(plan.getMoneyOfJob()));
-            bigDecimal=bigDecimal.multiply(new BigDecimal(String.valueOf(plan.getPlanWorkHour())));
+            //计划工时是按分钟 计算总工钱需要按照单价 元/小时来算  /60
+            bigDecimal=bigDecimal.multiply(new BigDecimal(String.valueOf(plan.getPlanWorkHour())).divide(new BigDecimal(60),2,RoundingMode.HALF_UP));
             p.setTotalWages(bigDecimal.doubleValue());
             p.setTotalWorkingHours(plan.getPlanWorkHour());
             boolean b = oldPlanProcedureTotals.stream().anyMatch(fs -> fs.getPlanId().equals(plan.getId()));
@@ -965,16 +974,28 @@ public class PlanServiceImpl extends ServiceImpl<PlanMapper, Plan> implements Pl
 //            msg.setError("下午4点之后禁止此操作");
 //            return msg;
 //        }
+        PlanProcedureTotal procedureTotal = planProcedureTotalService.getById(prodProcedureTeam.getPlanProcedureId());
+        List<ProdProcedureTeam> prodProcedureTeams = prodProcedureTeamService.list(new QueryWrapper<ProdProcedureTeam>().eq("plan_procedure_id", prodProcedureTeam.getPlanProcedureId()));
+        Plan plan = planMapper.selectById(procedureTotal.getPlanId());
         List<ProdProcedureTeam> list=new ArrayList<>();
         ProdProcedureTeam p=new ProdProcedureTeam();
         BeanUtils.copyProperties(prodProcedureTeam,p);
         p.setId(null);
         p.setUserId(newPeopleId);
-        p.setStatus(0);
+        if(plan.getPlanType()==0){
+            p.setStatus(0);
+        }else {
+            p.setStatus(1);
+        }
         p.setIsChange(0);
         prodProcedureTeam.setStatus(4);
         list.add(prodProcedureTeam);
-        list.add(p);
+        Optional<ProdProcedureTeam> first = prodProcedureTeams.stream().filter(pl -> pl.getUserId().equals(p.getUserId())).findFirst();
+        if(first.isPresent()){
+            list.add(first.get());
+        }else {
+            list.add(p);
+        }
         if(!prodProcedureTeamService.saveOrUpdateBatch(list)){
             msg.setError("验证失败");
         }

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

@@ -152,7 +152,7 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
             lastProgress = report.getProgress();
         } else {
             //今天之前没有报过工
-            if (todayReport == null) {
+            if (todayReport == null || prodProcedureTeam.getIsChange()==0) {
                 lastProgress = prodProcedureTeam.getProgress();
                 if (report.getProgress() <= lastProgress) {
                     httpRespMsg.setError("进度必须大于上次报工进度("+lastProgress+"%)");

+ 1 - 0
fhKeeper/formulahousekeeper/management-workshop/src/main/java/com/management/platform/test/TestApplicationTests.java

@@ -57,3 +57,4 @@ public class TestApplicationTests {
 //        System.out.println(redisUtil.members("keyWords").toString());
 
     }
+}

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

@@ -5,7 +5,7 @@
     <div class="InsertionPlan flexCoum-box">
       <div class="InsertionPlanBox contentRoll">
         <div v-for="item,index in planList" :key="index" class="InsertionPlanBox_item">
-          <InsertionPlan-Item :planList="item"></InsertionPlan-Item>
+          <InsertionPlan-Item :planList="item" @flashList="flashList"></InsertionPlan-Item>
         </div>
       </div>
     </div>
@@ -36,6 +36,10 @@ export default {
     back() {
       this.$router.go(-1);
     },
+    flashList() {
+      console.log('走了父级')
+      this.getPlanList()
+    },
     // 新建
     add() {
       this.$router.push({
@@ -51,6 +55,7 @@ export default {
       .then(res => {
         if (res.code == "ok") {
           res.data.records.forEach(item => { item.flg = false })
+          console.log('赋值的插单计划', res.data.records)
           this.planList = res.data.records;
         } else {
           this.$toast.clear();

+ 126 - 12
fhKeeper/formulahousekeeper/timesheet-workshop-h5/src/views/planView/InsertionPlan/InsertionPlanItem.vue

@@ -8,8 +8,8 @@
       <div class="item"><p>计划人数:</p><span>{{ planList.planManNum }}人</span></div>
       <div class="item"><div>{{ planList.taskTypeName }}</div></div>
       <div class="item"><p>数量:</p><span>{{ planList.num }}</span></div>
-      <div class="item"><p>工时:</p><span>{{ planList.planWorkHour }} h</span></div>
-      <div class="item" style="width: 100%;">
+      <div class="item"><p>工时:</p><span>{{ planList.planWorkHour }} 分钟</span></div>
+      <!-- <div class="item" style="width: 100%;">
         <p>组员:</p>
         <span :style="`color: #333`" @click.stop="distributionProp()" v-if="planList.planProcedureTotals[0] && planList.planProcedureTotals[0].teamNames">
           {{ planList.planProcedureTotals[0] && planList.planProcedureTotals[0].teamNames }}
@@ -19,18 +19,47 @@
       </div>
       <div class="planItem_conter_icon">
         <van-icon name="arrow" size="20" color="#999" />
+      </div> -->
+
+      <!-- 以下新加的 -->
+      <div class="PlanItem" style="width:100%">
+        <div>组员:</div>
+        <span class="" v-if="planList.planProcedureTotals[0] && planList.planProcedureTotals[0].teamNames">{{ planList.planProcedureTotals[0] && planList.planProcedureTotals[0].teamNames }}</span>
+        <span style="color: #1989fa;" v-if="!(planList.planProcedureTotals[0] && planList.planProcedureTotals[0].teamNames) && beDeptList" @click.stop="distributionProp(planList.planProcedureTotals[0],'add')">分配</span>
+        <div>
+          <!-- <span style="color: #1989fa;"  @click="workShowHide(index)">{{ item.flg ? paiArr[0] : paiArr[1] }}</span> -->
+          <span style="color: #1989fa;" @click.stop="planList.flg = !planList.flg">{{ planList.flg ? '收起' : '展开' }}</span>
+        </div>
+      </div>
+      <div style="width: 100%">
+        <collapse style="width: 100%">
+          <div v-if="planList.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 planList.planProcedureTotals[0].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.stop="distributionProp(planList.planProcedureTotals[0],'change', second_item)"  style="color: #1989fa;">换人</span>
+                      <span class="" v-if="second_item.status==0&&second_item.isChange==1" @click.stop="deletePeople(second_item.id)"  style="color: #1989fa;">删除</span>
+                </div>
+                <p style="margin-top:20px;">
+                  <span class="" v-if="beDeptList" @click.stop="distributionProp(planList.planProcedureTotals[0],'add')"  style="color: #1989fa;">新增</span>
+                </p>
+              </div>
+          </div>
+        </collapse>
       </div>
     </div>
-
     <!-- 弹出层选人 -->
     <van-popup v-model="popupShow" round position="bottom" :style="{ height: '80%',background: '#F4F4F4' }" >
-      <ChooseSomeone ref="ChooseSomeoneOne" :groupView="2" :groupViewBack="true" :peopleList="peopleList" @ChooseSomeoneChanhe="chooseSomeoneChanhe" :peopleListId="peopleListId"></ChooseSomeone>
+      <ChooseSomeone ref="ChooseSomeoneOne" :groupView="this.groupViewNum" :groupViewBack="true" :peopleList="peopleList" @ChooseSomeoneChanhe="chooseSomeoneChanhe" :peopleListId="peopleListId"></ChooseSomeone>
     </van-popup>
   </div>
+  
 </template>
 
 <script>
 import ChooseSomeone from '../../../components/chooseSomeone.vue'
+import collapse from '../../../assets/collapse.js'
 export default {
   name: 'InsertionPlanItem',
   props: {
@@ -40,7 +69,8 @@ export default {
     }
   },
   components: {
-    ChooseSomeone
+    ChooseSomeone,
+    collapse
   },
   data() {
     return {
@@ -50,6 +80,8 @@ export default {
         planProcedureTotals: [{teamNames: ''}]
       },
       peopleListId: [],
+      groupViewNum:2,
+      peopleType:0,
     };
   },
   computed: {},
@@ -68,13 +100,34 @@ export default {
         }
       })
     },
-    distributionProp() {
+    // distributionProp() {
+    //   if(this.beDeptList) {
+    //     console.log(this.planList, '看看你')
+    //     this.peopleListId =  this.planList.planProcedureTotals[0] ? this.planList.planProcedureTotals[0].teamIds ? this.planList.planProcedureTotals[0].teamIds.split(',') : [] : []
+    //     this.popupShow = true
+    //   }
+
+    // },
+      distributionProp(item, 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(this.planList, '看看你')
-        this.peopleListId =  this.planList.planProcedureTotals[0] ? this.planList.planProcedureTotals[0].teamIds ? this.planList.planProcedureTotals[0].teamIds.split(',') : [] : []
         this.popupShow = true
       }
-
     },
     // 获取人员
     getPeople() {
@@ -112,6 +165,7 @@ export default {
         this.$refs.ChooseSomeoneOne['loadingBtn'] = false
         this.popupShow = false
         if (res.code == "ok") {
+          this.$emit('flashList')
           this.planList.planProcedureTotals[0].teamNames = nameArr.join(',')
           this.planList.planProcedureTotals[0].teamIds = teamIds.join(',')
         } else {
@@ -129,9 +183,29 @@ export default {
       let nameArr = item.map(item => {
         return item.name
       })
-      console.log(arr, nameArr)
-      this.teamAllocation(arr, nameArr)
-    }
+      if(this.peopleType == 1) {
+        this.changePeople(this.peopleListIdObj,arr[0])
+      } else {
+        this.teamAllocation(arr, nameArr)
+      }
+    },
+    //换人
+    changePeople(item,newPeopleId){
+        delete item.user
+        this.$axios.post('/plan/changePeople', {
+        ...item,
+        newPeopleId:newPeopleId
+      })
+      .then(res => {
+        this.popupShow = false
+        if (res.code == "ok") {
+          this.$emit('flashList')
+        } else {
+          this.$toast.clear();
+          this.$toast.fail(res.msg);
+        }
+      }).catch(err => { this.$toast.clear(); });
+    },
   },
 };
 </script>
@@ -147,6 +221,15 @@ export default {
     justify-content: space-between;
     margin-bottom: 10px;
   }
+  .disZhuyuan {
+    padding-left: 30px;
+    font-size: 14px;
+    width: 100%;
+    display: flex;
+    padding-right: 100px;
+    justify-content: space-between;
+    margin-top: 10px;
+  }
   .planItem_conter {
     width: 100%;
     padding: 8px;
@@ -156,6 +239,37 @@ export default {
     flex-wrap: wrap;
     position: relative;
 
+    .PlanItem {
+      width: 50%;
+      display: flex;
+      padding-top: 12px;
+      &:first-child {
+        width: 100%;
+        padding-top: 10px;
+        span {
+          font-size: 18px;
+          color: #333;
+        }
+      }
+      &:nth-child(2) {
+        width: 100%;
+        span {
+          width: 230px;
+          word-break: break-all;
+        }
+      }
+      div {
+        width: 80px;
+        text-align: right;
+        color: #666;
+      }
+      span {
+        display: inline-block;
+        color: #333;
+        font-size: 14px;
+      }
+    }
+
     .planItem_conter_icon {
       position: absolute;
       top: 50%;

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

@@ -35,7 +35,7 @@
               {{ item.prodProcedure.checkType == 0 ? '自检' : item.prodProcedure.checkType == 1 ? '互检' : '专检' }}
             </span>
           </div>
-           <div class="PlanItem" v-show="todayAndTomorrow" style="width:100%">
+          <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>

+ 1 - 1
fhKeeper/formulahousekeeper/timesheet-workshop-h5/src/views/workView/fillReport.vue

@@ -13,7 +13,7 @@
           <van-cell v-else title="任务变更通知号" :value="reportForm.task_change_notice_num" />
           <van-cell title="钢印号">
             <template>
-              <div style="float:right;" v-if="reportForm.planSteelStampNumberList.length>0">
+              <div style="float:right;" v-if="reportForm.planSteelStampNumberList&&reportForm.planSteelStampNumberList.length>0">
                 <van-checkbox-group v-model="reportForm.checkedSteelNum" direction="horizontal">
                   <van-checkbox style="padding:5px;" :name="item" @click="onCheckChange"
                     v-for="(item, index) in reportForm.planSteelStampNumberList" :key="index">{{ item }}</van-checkbox>

+ 1 - 1
fhKeeper/formulahousekeeper/timesheet-workshop/src/views/plan/orderInsert.vue

@@ -103,7 +103,7 @@
           <el-form-item label="单价" prop="moneyOfJob">
             <div style="display: flex;">
               <el-input v-model="todayPlanForm.moneyOfJob" type="number" placeholder="请输入" style="flex: 1;" maxlength="5"></el-input>
-              <div style="margin-left: 10px;">元/分钟</div>
+              <div style="margin-left: 10px;">元/小时</div>
             </div>
           </el-form-item>
           <el-form-item label="质检类型" prop="productId">