yangfeng
2023-12-06 6d040980c2b178241841ef335d4f70cbdb467d4b
src/views/cockpitPage/index.vue
@@ -204,13 +204,18 @@
    },
    // 左中数据统计值
    setLeftBlock3(data) {
      console.log(this.setNumbers(data?.OutPlanProductionAmount ?? 0));
      this.totalObject = {
        InternalDeviceRunningAmount: data?.InternalDeviceRunningAmount ?? 0,
        ExternalDeviceRunningAmount: data?.ExternalDeviceRunningAmount ?? 0,
        OutPlanProductionAmount: data?.OutPlanProductionAmount ?? 0,
        PlanProductionAmount: data?.PlanProductionAmount ?? 0,
        RealExternalProductionAmount: data?.RealExternalProductionAmount ?? 0,
        RealProductionAmount: data?.RealProductionAmount ?? 0,
        OutPlanProductionAmount: this.setNumbers(
          data?.OutPlanProductionAmount ?? 0
        ),
        PlanProductionAmount: this.setNumbers(data?.PlanProductionAmount ?? 0),
        RealExternalProductionAmount: this.setNumbers(
          data?.RealExternalProductionAmount ?? 0
        ),
        RealProductionAmount: this.setNumbers(data?.RealProductionAmount ?? 0),
      };
    },
    // 订单完成比率
@@ -300,6 +305,43 @@
        this.barChartData.datay2.push(parseFloat(item.Defective));
      });
    },
    // 计算加工数 生产数
    setNumbers(val) {
      if (val > 1000 && val < 10000) {
        let count = (val / 1000).toFixed(1);
        return count.toString() + "千";
      } else if (val >= 10000 && val < 100000) {
        let count1 = (val / 10000).toFixed(1);
        return count1.toString() + "万";
      } else if (val >= 100000 && val < 1000000) {
        let count1 = (val / 100000).toFixed(1);
        return count1.toString() + "十万";
      } else if (val >= 1000000 && val < 10000000) {
        let count1 = (val / 1000000).toFixed(1);
        return count1.toString() + "百万";
      } else if (val >= 10000000 && val < 100000000) {
        let count1 = (val / 10000000).toFixed(1);
        return count1.toString() + "千万";
      } else if (val >= 100000000 && val < 1000000000) {
        let count1 = (val / 100000000).toFixed(1);
        return count1.toString() + "亿";
      } else if (val >= 1000000000 && val < 10000000000) {
        let count1 = (val / 1000000000).toFixed(1);
        return count1.toString() + "十亿";
      } else if (val >= 10000000000 && val < 100000000000) {
        let count1 = (val / 10000000000).toFixed(1);
        return count1.toString() + "百亿";
      } else if (val >= 100000000000 && val < 1000000000000) {
        let count1 = (val / 100000000000).toFixed(1);
        return count1.toString() + "千亿";
      } else if (val >= 1000000000000) {
        let count1 = (val / 1000000000000).toFixed(1);
        return count1.toString() + "万亿";
      } else {
        return val;
      }
    },
  },
};
</script>