Ver Fonte

提交车间的颜色

Lijy há 1 ano atrás
pai
commit
6e7333a53c

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

@@ -2,6 +2,9 @@
   <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>
         <div class="planComponent_Item">
           <div class="planComponent_ItemTop">
             <div>{{ item.productName}}</div>
@@ -202,10 +205,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.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)