浏览代码

修改BUG车间系统

Min 1 年之前
父节点
当前提交
8799802a29

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

@@ -826,7 +826,9 @@ public class PlanServiceImpl extends ServiceImpl<PlanMapper, Plan> implements Pl
             Optional<ProdProcedureTeam> first = prodProcedureTeams.stream().filter(ps -> ps.getUserId().equals(userId)).findFirst();
             if(first.isPresent()){
                 ProdProcedureTeam prodProcedureTeam = first.get();
-                prodProcedureTeam.setStatus(0);
+                if(prodProcedureTeam.getStatus()==1){
+                    prodProcedureTeam.setStatus(0);
+                }
                 if(!prodProcedureTeamService.updateById(prodProcedureTeam)){
                     msg.setError("验证失败");
                 }

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

@@ -10,7 +10,7 @@
     <div class="distribution_con contentRoll">
       <div class="distribution_box" v-for="item,index in distributionList" :key="index">
         <div class="distribution_ItemBom">
-          <van-checkbox  v-if="!beDeptList" v-model="item.prodProcedure.isSelected"  @click="itemChecked" shape="square">
+          <van-checkbox :disabled="item.checkboxDisabled"  v-model="item.prodProcedure.isSelected"  @click="itemChecked" shape="square">
           </van-checkbox>
           <div class="PlanItem">
             <span>{{ item.prodProcedure.name }}</span>
@@ -91,6 +91,7 @@ export default {
   },
   data() {
     return {
+      user:JSON.parse(localStorage.getItem("userInfo")),
       isAllChecked:  false,
       activeNames: ['1'],
       beDeptList: JSON.parse(localStorage.getItem('beDeptList')), // 是否为工长
@@ -301,7 +302,21 @@ export default {
       .then(res => {
         if (res.code == "ok") {
           res.data.forEach(item => { item.flg = false })
-          this.distributionList = res.data
+          let arr = res.data 
+          // checkboxDisabled
+          for(var i in arr) {
+            arr[i].checkboxDisabled = true
+            if(arr[i].prodProcedureTeamList.length > 0) {
+              let arrList = arr[i].prodProcedureTeamList.filter(item => item.status == 0 && item.userId==this.user.id)
+              console.log(arrList, 'arrList')
+              if(arrList.length > 0) {
+                arr[i].checkboxDisabled = false
+              }
+            }
+          }
+          // this.distributionList = res.data
+          console.log(arr,'')
+          this.distributionList = arr
         } else {
           this.$toast.clear();
           this.$toast.fail(res.msg);