lxf 1 anno fa
parent
commit
20ffc286d2
1 ha cambiato i file con 11 aggiunte e 2 eliminazioni
  1. 11 2
      src/views/production/schedule/production-order/index.vue

+ 11 - 2
src/views/production/schedule/production-order/index.vue

@@ -36,8 +36,10 @@
                 type="circle"
                 v-for="(row, index) in item.productionOrderScheduleVoList"
                 :key="index"
-                :percentage="Math.round((row.productionQuantity / row.completeQuantity) * 100)"
-                :status="Math.round((row.productionQuantity / row.completeQuantity) * 100) == 100 ? 'success' : ''" />
+                :percentage="computePercent(row)"
+                :status="computePercent(row) === 100 ? 'success' : ''"
+                :width="80"
+                style="margin-right: 10px;" />
             </div>
           </div>
         </template>
@@ -482,6 +484,13 @@ const submitForm = () => {
     }
   });
 };
+const computePercent = (item) => {
+  let num = 0;
+  if (item.productionQuantity && item.completeQuantity) {
+    num = Number(Math.round((item.completeQuantity / item.productionQuantity) * 100));
+  }
+  return num;
+};
 </script>
 
 <style lang="scss" scoped>