Browse Source

Merge remote-tracking branch 'origin/master'

yusm 1 year ago
parent
commit
d5bc45701b

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

@@ -263,7 +263,7 @@ public class Plan extends Model<Plan> {
     private Integer hasAllocation;
 
     @TableField(exist = false)
-    private Integer hasAllAllocation;
+    private String color;
 
     @Override
     protected Serializable pkVal() {

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

@@ -220,14 +220,29 @@ public class PlanServiceImpl extends ServiceImpl<PlanMapper, Plan> implements Pl
                     boolean b = procedureTeams.stream().anyMatch(p -> totalIds.contains(p.getPlanProcedureId()));
                     rs.setHasAllocation(b?1:0);
                     AtomicBoolean allAllocation= new AtomicBoolean(true);
-                    totals.forEach(t->{
+                    AtomicBoolean needSetRed = new AtomicBoolean(false);
+                    for (PlanProcedureTotal t : totals) {
                         Optional<ProdProcedureTeam> team = procedureTeams.stream().filter(p -> p.getPlanProcedureId().equals(t.getId())).findFirst();
-                        if(!team.isPresent()){
+                        if (!team.isPresent()) {
                             allAllocation.set(false);
                         }
-                    });
+                        List<ProdProcedureTeam> targetProdProcedureTeams = procedureTeams.stream().filter(p -> p.getPlanProcedureId().equals(t.getId())).collect(Collectors.toList());
+                        boolean match = targetProdProcedureTeams.stream().allMatch(i->i.getStatus()==2);
+                        if ((t.getTotalProgress()!=null&&t.getTotalProgress() < 100)&&match) {
+                            needSetRed.set(true);
+                        }
+                    }
                     rs.setHasAllocation(b?1:0);
-                    rs.setHasAllAllocation(allAllocation.get()?1:0);
+                    if(allAllocation.get()){
+                        rs.setColor("green");
+                        if(needSetRed.get()){
+                            rs.setColor("red");
+                        }
+                    }else{
+                        if(b){
+                            rs.setColor("blue");
+                        }
+                    }
                 }
                 if(planType==2){
                     totals.forEach(ps->{

+ 30 - 1
fhKeeper/formulahousekeeper/timesheet-workshop-h5/src/views/planView/component/planComponent.vue

@@ -2,6 +2,10 @@
   <div class="planComponent">
     <div class="planComponent_con contentRoll">
       <div class="planComponent_box" v-for="item, index in productList" :key="index">
+        <div v-if="titleText == '今日计划'" class="planComponent_boxAbles">
+          <!-- <div :class="item.backgroundClass"></div> -->
+          <div :class="`${item.color}s`"></div>
+        </div>
         <div class="planComponent_Item">
           <div class="planComponent_ItemTop">
             <div>{{ item.productName}}</div>
@@ -97,6 +101,8 @@ export default {
     this.paiArr = ['收起', '展开']
     this.type = 0
     this.productList = this.planList
+    console.log(this.productList, '<=== 数据来源')
+    console.log(this.planList, '<=== 数据来源')
    },
   methods: {
     workShowHide(index) {
@@ -202,10 +208,33 @@ export default {
     width: 100%;
     background-color: #fff;
     border-radius: 4px;
-    padding: 10px;
+    padding: 10px 10px 10px 15px;
     margin-bottom: 15px;
     overflow: hidden;
     position: relative;
+    .planComponent_boxAbles{
+      width: 6px;
+      height: 100%;
+      position: absolute;
+      top: 0;
+      left: 0;
+      div {
+        width: 100%;
+        height: 100%;
+        position: absolute;
+        top: 0;
+        left: 0;
+      }
+      .reds {
+        background: #FE2010;
+      }
+      .blues {
+        background: #12B3FF;
+      }
+      .greens {
+        background: #60EE00;
+      }
+    }
 
     .planComponent_Item {
       .planComponent_ItemTop {

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

@@ -48,6 +48,26 @@ export default {
           res.data.records.forEach(item => { item.flg = false })
           // this.planList = res.data.records;
           this.planList = []
+          // res.data.records.forEach((item => {
+          //   const newProgress = item.progress && item.progress.split('%')[0]
+          //   const progressFlag = newProgress ? (newProgress > 0 && newProgress < 100) ? true : false : false
+          //   if(item.progress) {
+          //     item.newProgress = newProgress
+          //   }
+          //   const { hasAllocation, hasAllAllocation } = item
+          //   if(hasAllocation && !hasAllAllocation) {
+          //     item.backgroundClass = 'blues'
+          //     return
+          //   }
+          //   if(progressFlag) {
+          //     item.backgroundClass = 'reds'
+          //     return
+          //   }
+          //   if(hasAllocation && hasAllAllocation) {
+          //     item.backgroundClass = 'greens'
+          //     return
+          //   }
+          // }))
           setTimeout(() => {
             this.$set(this, 'planList', res.data.records)
           }, 100)