Sfoglia il codice sorgente

调整车间管家的进度

Lijy 1 anno fa
parent
commit
3acf002c6c

+ 8 - 2
fhKeeper/formulahousekeeper/timesheet-workshop/src/views/statistic/index.vue

@@ -221,7 +221,7 @@
                                 <div>计划数:{{items.planNum}} {{items.planHour}}分钟  {{items.planCost}}元 </div>
                                 <div>实际数:{{items.nowNum}} {{items.nowHour}}分钟  {{items.nowCost}}元</div>
                                 <div v-if="!isViewUser">进度:{{items.progress}}</div>
-                                <div v-if="isViewUser">进度:{{ (((items.nowNum || 0) / (items.planNum || 0) ) * 100).toFixed(0) }}%</div>
+                                <div v-if="isViewUser">进度:{{ comSchedule(items.nowNum, items.planNum) }}</div>
                             </div>
                         </div>
                     </template>
@@ -231,7 +231,7 @@
                       <div>计划数:{{scope.row.totalPlanNum}}  {{scope.row.totalPlanHour}}分钟  {{scope.row.totalPlanCost}}元 </div>
                       <div>实际数:{{scope.row.totalNowNum}}  {{scope.row.totalNowHour}}分钟  {{scope.row.totalNowCost}}元</div>
                       <div v-if="!isViewUser">进度:{{scope.row.totalProgress}}</div>
-                      <div v-if="isViewUser">进度:{{ (((scope.row.totalNowNum || 0) / (scope.row.totalPlanNum || 0) ) * 100).toFixed(0) }}%</div>
+                      <div v-if="isViewUser">进度:{{ comSchedule(scope.row.totalNowNum, scope.row.totalPlanNum) }}</div>
                   </template>
                 </el-table-column>
             </el-table>
@@ -1351,6 +1351,12 @@ export default {
         this.selcts(9)
       }
     },
+    comSchedule(divisor, dividend) {
+      if(!dividend) {
+        return  '0%'
+      }
+      return Math.ceil((divisor / dividend) * 100)) + '%'
+    }
   },
 };
 </script>