projects/mescc/zhp #56
@@ -1,7 +1,7 @@
 | 
			
		||||
/*
 | 
			
		||||
 * @Author: zhp
 | 
			
		||||
 * @Date: 2024-06-17 09:41:03
 | 
			
		||||
 * @LastEditTime: 2024-06-18 13:47:36
 | 
			
		||||
 * @LastEditTime: 2024-06-20 15:39:21
 | 
			
		||||
 * @LastEditors: zhp
 | 
			
		||||
 * @Description:
 | 
			
		||||
 */
 | 
			
		||||
@@ -9,11 +9,21 @@ import request from '@/utils/request'
 | 
			
		||||
export function getComprehensiveDataPage(data) {
 | 
			
		||||
  return request({
 | 
			
		||||
    url: 'ip/comprehensive/data/get/comprehensive/data',
 | 
			
		||||
    method: 'get',
 | 
			
		||||
    params: data
 | 
			
		||||
    method: 'post',
 | 
			
		||||
    data: data
 | 
			
		||||
  })
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
export function exportComprehensiveDataPage(data) {
 | 
			
		||||
   return request({
 | 
			
		||||
    url: 'ip/comprehensive/data/export/comprehensive/data',
 | 
			
		||||
    method: 'post',
 | 
			
		||||
    data: data,
 | 
			
		||||
    responseType: 'blob',
 | 
			
		||||
  })
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
export function getProduceTransData(data) {
 | 
			
		||||
   return request({
 | 
			
		||||
    url: 'ip/prod-output/queryYCEReportByDateRange',
 | 
			
		||||
@@ -21,3 +31,65 @@ export function getProduceTransData(data) {
 | 
			
		||||
    data: data
 | 
			
		||||
  })
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
export function exportProduceTransData(data) {
 | 
			
		||||
   return request({
 | 
			
		||||
    url: 'ip/prod-output/queryYCEReportByDateRangeExcel',
 | 
			
		||||
    method: 'post',
 | 
			
		||||
    data: data,
 | 
			
		||||
    responseType: 'blob',
 | 
			
		||||
  })
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
export function getProduceSituationData(data) {
 | 
			
		||||
   return request({
 | 
			
		||||
    url: 'ip/production/situation/get/production/situation',
 | 
			
		||||
    method: 'post',
 | 
			
		||||
    data: data
 | 
			
		||||
  })
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
export function exportProduceSituationData(data) {
 | 
			
		||||
   return request({
 | 
			
		||||
    url: 'ip/production/situation/export/production/situation',
 | 
			
		||||
    method: 'post',
 | 
			
		||||
     data: data,
 | 
			
		||||
      responseType: 'blob',
 | 
			
		||||
  })
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
export function getProductionSituationMWData(data) {
 | 
			
		||||
   return request({
 | 
			
		||||
    url: 'ip/production/situation/power/get/production/situation',
 | 
			
		||||
    method: 'post',
 | 
			
		||||
    data: data
 | 
			
		||||
  })
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
export function exportProductionSituationMWData(data) {
 | 
			
		||||
   return request({
 | 
			
		||||
    url: 'ip/production/situation/power/export/production/situation',
 | 
			
		||||
    method: 'post',
 | 
			
		||||
     data: data,
 | 
			
		||||
      responseType: 'blob',
 | 
			
		||||
  })
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
export function getProductionYieldSituationMWData(data) {
 | 
			
		||||
   return request({
 | 
			
		||||
    url: 'ip/product/yield/get/production/situation',
 | 
			
		||||
    method: 'post',
 | 
			
		||||
    data: data
 | 
			
		||||
  })
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
export function exportProductionYieldSituationMWData(data) {
 | 
			
		||||
   return request({
 | 
			
		||||
    url: 'ip/product/yield/export/production/situation',
 | 
			
		||||
    method: 'post',
 | 
			
		||||
    data: data,
 | 
			
		||||
    responseType: 'blob',
 | 
			
		||||
  })
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										245
									
								
								src/views/report/components/produceLineBar.vue
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										245
									
								
								src/views/report/components/produceLineBar.vue
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,245 @@
 | 
			
		||||
<!--
 | 
			
		||||
 * @Author: zhp
 | 
			
		||||
 * @Date: 2024-06-19 15:28:34
 | 
			
		||||
 * @LastEditTime: 2024-06-20 20:49:07
 | 
			
		||||
 * @LastEditors: zhp
 | 
			
		||||
 * @Description:
 | 
			
		||||
-->
 | 
			
		||||
<template>
 | 
			
		||||
  <div>
 | 
			
		||||
    <!-- 暂无数据 -->
 | 
			
		||||
    <div class="no-data-bg" style="position: relative; left: 50%; transform: translateX(-50%)"
 | 
			
		||||
      v-show="this.chartMsg.series.length === 0"></div>
 | 
			
		||||
    <!-- 图例 -->
 | 
			
		||||
    <div v-show="this.chartMsg.series.length > 0">
 | 
			
		||||
      <div class="legendData" v-if="show">
 | 
			
		||||
        <span class="itemData" v-for="item in legendList" :key="item.id">
 | 
			
		||||
          <span v-if="item.type === 1" class="block" :style="{ backgroundColor: item.color }"></span>
 | 
			
		||||
          <span v-if="item.type === 2" class="line" :style="{ backgroundColor: item.color }">
 | 
			
		||||
            <span class="line-block" :style="{ backgroundColor: item.color }"></span>
 | 
			
		||||
          </span>
 | 
			
		||||
          {{ item.name }}</span>
 | 
			
		||||
      </div>
 | 
			
		||||
      <div :id="chartId" :style="{ width: '100%', height: chartHeight + 'px' }"></div>
 | 
			
		||||
    </div>
 | 
			
		||||
  </div>
 | 
			
		||||
</template>
 | 
			
		||||
<script>
 | 
			
		||||
import * as echarts from "echarts";
 | 
			
		||||
import { debounce } from "@/utils/debounce";
 | 
			
		||||
export default {
 | 
			
		||||
  name: "bmLineBar",
 | 
			
		||||
  data() {
 | 
			
		||||
    return {
 | 
			
		||||
      myChart: "",
 | 
			
		||||
      option: {
 | 
			
		||||
        color: [],
 | 
			
		||||
        // color: ["#8EF0AB", "#63BDFF", "#288AFF"],
 | 
			
		||||
        grid: {
 | 
			
		||||
          left: 30,
 | 
			
		||||
          right: 0,
 | 
			
		||||
          bottom: 30,
 | 
			
		||||
          top: 30,
 | 
			
		||||
          containLabel:true,
 | 
			
		||||
        },
 | 
			
		||||
        tooltip: {
 | 
			
		||||
          trigger: "axis",
 | 
			
		||||
          axisPointer: {
 | 
			
		||||
            // type: "cross",
 | 
			
		||||
            crossStyle: {
 | 
			
		||||
              color: "rgba(237,237,237,0.5)",
 | 
			
		||||
            },
 | 
			
		||||
          },
 | 
			
		||||
          formatter: function (params) {
 | 
			
		||||
            console.log('params', params);
 | 
			
		||||
            var res = `<span style='color:rgba(0,0,0,0.8)'>${params[0].axisValueLabel}</span>`;
 | 
			
		||||
            for (var i = 0, l = params.length; i < l; i++) {
 | 
			
		||||
              res +=
 | 
			
		||||
                "<br/>" +
 | 
			
		||||
                `<span style='display:inline-block;margin-right:4px;border-radius:10px;width:10px;height:10px;background-color:${params[i].color}'></span>` +
 | 
			
		||||
                `<span style='display:inline-block;width:150px;color:rgba(0,0,0,0.8);font-size:14px;'>${params[i].seriesName}</span>` +
 | 
			
		||||
              `<span style='color:rgba(0,0,0,0.48);font-size:14px;'>${params[i].seriesName === "综合良率"
 | 
			
		||||
                  ? (params[i].value ? params[i].value.toFixed(2) : 0.0) + "%"
 | 
			
		||||
                : params[i].seriesName === "转化效率"
 | 
			
		||||
                    ? (params[i].value ? params[i].value.toFixed(2) : 0.0) + "%"
 | 
			
		||||
                  : params[i].seriesName.search('总功率') != -1
 | 
			
		||||
                      ? (params[i].value ? params[i].value.toFixed(2) : 0.0) + "MW"
 | 
			
		||||
                      : params[i].value + "片"
 | 
			
		||||
                }</span>`;
 | 
			
		||||
            }
 | 
			
		||||
            return res;
 | 
			
		||||
          },
 | 
			
		||||
        },
 | 
			
		||||
        xAxis: {
 | 
			
		||||
          type: "category",
 | 
			
		||||
          data: [],
 | 
			
		||||
          axisTick: {
 | 
			
		||||
            show: false,
 | 
			
		||||
          },
 | 
			
		||||
          axisPointer: {
 | 
			
		||||
            type: "shadow",
 | 
			
		||||
          },
 | 
			
		||||
        },
 | 
			
		||||
        dataZoom: [//滚动条
 | 
			
		||||
          {
 | 
			
		||||
            // 设置滚动条的隐藏与显示
 | 
			
		||||
            show: true,
 | 
			
		||||
            // 设置滚动条类型
 | 
			
		||||
            type: "slider",
 | 
			
		||||
            // 设置背景颜色
 | 
			
		||||
            backgroundColor: "rgb(19, 63, 100)",
 | 
			
		||||
            // 设置选中范围的填充颜色
 | 
			
		||||
            fillerColor: "rgb(16, 171, 198)",
 | 
			
		||||
            // 设置边框颜色
 | 
			
		||||
            borderColor: "rgb(19, 63, 100)",
 | 
			
		||||
            // 是否显示detail,即拖拽时候显示详细数值信息
 | 
			
		||||
            showDetail: false,
 | 
			
		||||
            // 数据窗口范围的起始数值
 | 
			
		||||
            startValue: 0,
 | 
			
		||||
            // 数据窗口范围的结束数值(一页显示多少条数据)
 | 
			
		||||
            endValue: 5,
 | 
			
		||||
            // empty:当前数据窗口外的数据,被设置为空。
 | 
			
		||||
            // 即不会影响其他轴的数据范围
 | 
			
		||||
            filterMode: "empty",
 | 
			
		||||
            // 设置滚动条宽度,相对于盒子宽度
 | 
			
		||||
            width: "50%",
 | 
			
		||||
            // 设置滚动条高度
 | 
			
		||||
            height: 8,
 | 
			
		||||
            // 设置滚动条显示位置
 | 
			
		||||
            left: "center",
 | 
			
		||||
            // 是否锁定选择区域(或叫做数据窗口)的大小
 | 
			
		||||
            zoomLoxk: true,
 | 
			
		||||
            // 控制手柄的尺寸
 | 
			
		||||
            handleSize: 0,
 | 
			
		||||
            // dataZoom-slider组件离容器下侧的距离
 | 
			
		||||
            bottom: 3,
 | 
			
		||||
          },
 | 
			
		||||
          {
 | 
			
		||||
            // 没有下面这块的话,只能拖动滚动条,
 | 
			
		||||
            // 鼠标滚轮在区域内不能控制外部滚动条
 | 
			
		||||
            type: "inside",
 | 
			
		||||
            // 滚轮是否触发缩放
 | 
			
		||||
            zoomOnMouseWheel: false,
 | 
			
		||||
            // 鼠标滚轮触发滚动
 | 
			
		||||
            moveOnMouseMove: true,
 | 
			
		||||
            moveOnMouseWheel: true,
 | 
			
		||||
          },
 | 
			
		||||
 | 
			
		||||
        ],
 | 
			
		||||
        yAxis:undefined,
 | 
			
		||||
        series: [],
 | 
			
		||||
      },
 | 
			
		||||
    };
 | 
			
		||||
  },
 | 
			
		||||
  props: {
 | 
			
		||||
    chartHeight: {
 | 
			
		||||
      type: Number,
 | 
			
		||||
      default: 300,
 | 
			
		||||
    },
 | 
			
		||||
    type: {
 | 
			
		||||
      type: Number,
 | 
			
		||||
      default: 2,
 | 
			
		||||
    },
 | 
			
		||||
    show: {
 | 
			
		||||
      type: Boolean,
 | 
			
		||||
      default: true,
 | 
			
		||||
    },
 | 
			
		||||
    legendList: {
 | 
			
		||||
      type: Array,
 | 
			
		||||
      default: () => [],
 | 
			
		||||
    },
 | 
			
		||||
    chartMsg: {
 | 
			
		||||
      type: Object,
 | 
			
		||||
      default: () => {},
 | 
			
		||||
    },
 | 
			
		||||
    chartId: {
 | 
			
		||||
      type: String,
 | 
			
		||||
      default: "bmChart",
 | 
			
		||||
    },
 | 
			
		||||
    chartNum: {
 | 
			
		||||
      type: Number,
 | 
			
		||||
      default: 1,
 | 
			
		||||
    },
 | 
			
		||||
  },
 | 
			
		||||
  watch: {
 | 
			
		||||
    chartHeight: {
 | 
			
		||||
      handler(newVal) {
 | 
			
		||||
        this.chartHeight = newVal;
 | 
			
		||||
      },
 | 
			
		||||
    },
 | 
			
		||||
    type() {
 | 
			
		||||
      this.canvasReset();
 | 
			
		||||
    },
 | 
			
		||||
    chartNum(val) {
 | 
			
		||||
      this.canvasReset();
 | 
			
		||||
    },
 | 
			
		||||
    chartMsg: {
 | 
			
		||||
      handler(newVal) {
 | 
			
		||||
        this.canvasReset();
 | 
			
		||||
      },
 | 
			
		||||
      deep: true,
 | 
			
		||||
    },
 | 
			
		||||
  },
 | 
			
		||||
  mounted() {
 | 
			
		||||
    this.canvasReset();
 | 
			
		||||
  },
 | 
			
		||||
  methods: {
 | 
			
		||||
    canvasReset() {
 | 
			
		||||
      debounce(() => {
 | 
			
		||||
        this.getMes();
 | 
			
		||||
      }, 500)();
 | 
			
		||||
    },
 | 
			
		||||
    getMes() {
 | 
			
		||||
      if (this.myChart) {
 | 
			
		||||
        this.myChart.dispose();
 | 
			
		||||
      }
 | 
			
		||||
      var chartDom = document.getElementById(this.chartId);
 | 
			
		||||
      this.myChart = echarts.init(chartDom);
 | 
			
		||||
      this.option.color = this.chartMsg.color;
 | 
			
		||||
      this.option.xAxis.data = this.chartMsg.xData;
 | 
			
		||||
      // this.option.yAxis.name = this.chartMsg.yName;
 | 
			
		||||
 | 
			
		||||
      // this.option.yAxis.axisLabel = this.chartMsg.yAxisLabel;
 | 
			
		||||
      this.option.series = this.chartMsg.series;
 | 
			
		||||
      this.option.yAxis = this.chartMsg.yAxis;
 | 
			
		||||
 | 
			
		||||
      this.myChart.setOption(this.option);
 | 
			
		||||
    },
 | 
			
		||||
  },
 | 
			
		||||
};
 | 
			
		||||
</script>
 | 
			
		||||
<style lang="scss">
 | 
			
		||||
.legendData {
 | 
			
		||||
  text-align: right;
 | 
			
		||||
  position: relative;
 | 
			
		||||
  // right: 30;
 | 
			
		||||
  // top: 10px;
 | 
			
		||||
  .itemData {
 | 
			
		||||
    display: inline-block;
 | 
			
		||||
    margin-right: 10px;
 | 
			
		||||
    font-size: 14px;
 | 
			
		||||
    color: #8c8c8c;
 | 
			
		||||
    .block {
 | 
			
		||||
      width: 10px;
 | 
			
		||||
      height: 10px;
 | 
			
		||||
      display: inline-block;
 | 
			
		||||
      margin-right: 4px;
 | 
			
		||||
    }
 | 
			
		||||
    .line {
 | 
			
		||||
      width: 10px;
 | 
			
		||||
      height: 10px;
 | 
			
		||||
      border-radius: 5px;
 | 
			
		||||
      display: inline-block;
 | 
			
		||||
      margin-right: 4px;
 | 
			
		||||
      position: relative;
 | 
			
		||||
      .line-block {
 | 
			
		||||
        position: absolute;
 | 
			
		||||
        width: 20px;
 | 
			
		||||
        height: 2px;
 | 
			
		||||
        left: -5px;
 | 
			
		||||
        top: 4px;
 | 
			
		||||
      }
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
</style>
 | 
			
		||||
							
								
								
									
										252
									
								
								src/views/report/components/produceLineBarTarget.vue
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										252
									
								
								src/views/report/components/produceLineBarTarget.vue
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,252 @@
 | 
			
		||||
<!--
 | 
			
		||||
 * @Author: zhp
 | 
			
		||||
 * @Date: 2024-06-20 16:13:36
 | 
			
		||||
 * @LastEditTime: 2024-06-20 20:49:23
 | 
			
		||||
 * @LastEditors: zhp
 | 
			
		||||
 * @Description:
 | 
			
		||||
-->
 | 
			
		||||
<!--
 | 
			
		||||
 * @Author: zhp
 | 
			
		||||
 * @Date: 2024-06-19 15:28:34
 | 
			
		||||
 * @LastEditTime: 2024-06-20 16:02:21
 | 
			
		||||
 * @LastEditors: zhp
 | 
			
		||||
 * @Description:
 | 
			
		||||
-->
 | 
			
		||||
<template>
 | 
			
		||||
  <div>
 | 
			
		||||
    <!-- 暂无数据 -->
 | 
			
		||||
    <div class="no-data-bg" style="position: relative; left: 50%; transform: translateX(-50%)"
 | 
			
		||||
      v-show="this.chartMsg.series.length === 0"></div>
 | 
			
		||||
    <!-- 图例 -->
 | 
			
		||||
    <div v-show="this.chartMsg.series.length > 0">
 | 
			
		||||
      <div class="legendData" v-if="show">
 | 
			
		||||
        <span class="itemData" v-for="item in legendList" :key="item.id">
 | 
			
		||||
          <span v-if="item.type === 1" class="block" :style="{ backgroundColor: item.color }"></span>
 | 
			
		||||
          <span v-if="item.type === 2" class="line" :style="{ backgroundColor: item.color }">
 | 
			
		||||
            <span class="line-block" :style="{ backgroundColor: item.color }"></span>
 | 
			
		||||
          </span>
 | 
			
		||||
          {{ item.name }}</span>
 | 
			
		||||
      </div>
 | 
			
		||||
      <div :id="chartId" :style="{ width: '100%', height: chartHeight + 'px' }"></div>
 | 
			
		||||
    </div>
 | 
			
		||||
  </div>
 | 
			
		||||
</template>
 | 
			
		||||
<script>
 | 
			
		||||
import * as echarts from "echarts";
 | 
			
		||||
import { debounce } from "@/utils/debounce";
 | 
			
		||||
export default {
 | 
			
		||||
  name: "bmLineBar",
 | 
			
		||||
  data() {
 | 
			
		||||
    return {
 | 
			
		||||
      myChart: "",
 | 
			
		||||
      option: {
 | 
			
		||||
        color: [],
 | 
			
		||||
        // color: ["#8EF0AB", "#63BDFF", "#288AFF"],
 | 
			
		||||
        grid: {
 | 
			
		||||
          left: -30,
 | 
			
		||||
          right: 0,
 | 
			
		||||
          bottom: 30,
 | 
			
		||||
          top: 30,
 | 
			
		||||
          containLabel:true,
 | 
			
		||||
        },
 | 
			
		||||
        tooltip: {
 | 
			
		||||
          trigger: "axis",
 | 
			
		||||
          axisPointer: {
 | 
			
		||||
            // type: "cross",
 | 
			
		||||
            crossStyle: {
 | 
			
		||||
              color: "rgba(237,237,237,0.5)",
 | 
			
		||||
            },
 | 
			
		||||
          },
 | 
			
		||||
          formatter: function (params) {
 | 
			
		||||
            // console.log('params', params);
 | 
			
		||||
            var res = `<span style='color:rgba(0,0,0,0.8)'>${params[0].axisValueLabel}</span>`;
 | 
			
		||||
            for (var i = 0, l = params.length; i < l; i++) {
 | 
			
		||||
              res +=
 | 
			
		||||
                "<br/>" +
 | 
			
		||||
                `<span style='display:inline-block;margin-right:4px;border-radius:10px;width:10px;height:10px;background-color:${params[i].color}'></span>` +
 | 
			
		||||
                `<span style='display:inline-block;width:150px;color:rgba(0,0,0,0.8);font-size:14px;'>${params[i].seriesName}</span>` +
 | 
			
		||||
              `<span style='color:rgba(0,0,0,0.48);font-size:14px;'>${params[i].seriesName === "综合良率"
 | 
			
		||||
                  ? (params[i].value ? params[i].value.toFixed(2) : 0.0) + "%"
 | 
			
		||||
                : params[i].seriesName === "转化效率"
 | 
			
		||||
                    ? (params[i].value ? params[i].value.toFixed(2) : 0.0) + "%"
 | 
			
		||||
                  : params[i].seriesName.search('总功率') != -1
 | 
			
		||||
                      ? (params[i].value ? params[i].value.toFixed(2) : 0.0) + "MW"
 | 
			
		||||
                      : params[i].value + "片"
 | 
			
		||||
                }</span>`;
 | 
			
		||||
            }
 | 
			
		||||
            return res;
 | 
			
		||||
          },
 | 
			
		||||
        },
 | 
			
		||||
        xAxis: {
 | 
			
		||||
          type: "category",
 | 
			
		||||
          data: [],
 | 
			
		||||
          axisTick: {
 | 
			
		||||
            show: false,
 | 
			
		||||
          },
 | 
			
		||||
          axisPointer: {
 | 
			
		||||
            type: "shadow",
 | 
			
		||||
          },
 | 
			
		||||
        },
 | 
			
		||||
        dataZoom: [//滚动条
 | 
			
		||||
          {
 | 
			
		||||
            // 设置滚动条的隐藏与显示
 | 
			
		||||
            show: true,
 | 
			
		||||
            // 设置滚动条类型
 | 
			
		||||
            type: "slider",
 | 
			
		||||
            // 设置背景颜色
 | 
			
		||||
            backgroundColor: "rgb(19, 63, 100)",
 | 
			
		||||
            // 设置选中范围的填充颜色
 | 
			
		||||
            fillerColor: "rgb(16, 171, 198)",
 | 
			
		||||
            // 设置边框颜色
 | 
			
		||||
            borderColor: "rgb(19, 63, 100)",
 | 
			
		||||
            // 是否显示detail,即拖拽时候显示详细数值信息
 | 
			
		||||
            showDetail: false,
 | 
			
		||||
            // 数据窗口范围的起始数值
 | 
			
		||||
            startValue: 0,
 | 
			
		||||
            // 数据窗口范围的结束数值(一页显示多少条数据)
 | 
			
		||||
            endValue: 5,
 | 
			
		||||
            // empty:当前数据窗口外的数据,被设置为空。
 | 
			
		||||
            // 即不会影响其他轴的数据范围
 | 
			
		||||
            filterMode: "empty",
 | 
			
		||||
            // 设置滚动条宽度,相对于盒子宽度
 | 
			
		||||
            width: "50%",
 | 
			
		||||
            // 设置滚动条高度
 | 
			
		||||
            height: 8,
 | 
			
		||||
            // 设置滚动条显示位置
 | 
			
		||||
            left: "center",
 | 
			
		||||
            // 是否锁定选择区域(或叫做数据窗口)的大小
 | 
			
		||||
            zoomLoxk: true,
 | 
			
		||||
            // 控制手柄的尺寸
 | 
			
		||||
            handleSize: 0,
 | 
			
		||||
            // dataZoom-slider组件离容器下侧的距离
 | 
			
		||||
            bottom: 3,
 | 
			
		||||
          },
 | 
			
		||||
          {
 | 
			
		||||
            // 没有下面这块的话,只能拖动滚动条,
 | 
			
		||||
            // 鼠标滚轮在区域内不能控制外部滚动条
 | 
			
		||||
            type: "inside",
 | 
			
		||||
            // 滚轮是否触发缩放
 | 
			
		||||
            zoomOnMouseWheel: false,
 | 
			
		||||
            // 鼠标滚轮触发滚动
 | 
			
		||||
            moveOnMouseMove: true,
 | 
			
		||||
            moveOnMouseWheel: true,
 | 
			
		||||
          },
 | 
			
		||||
 | 
			
		||||
        ],
 | 
			
		||||
        yAxis:undefined,
 | 
			
		||||
        series: [],
 | 
			
		||||
      },
 | 
			
		||||
    };
 | 
			
		||||
  },
 | 
			
		||||
  props: {
 | 
			
		||||
    chartHeight: {
 | 
			
		||||
      type: Number,
 | 
			
		||||
      default: 300,
 | 
			
		||||
    },
 | 
			
		||||
    type: {
 | 
			
		||||
      type: Number,
 | 
			
		||||
      default: 2,
 | 
			
		||||
    },
 | 
			
		||||
    show: {
 | 
			
		||||
      type: Boolean,
 | 
			
		||||
      default: true,
 | 
			
		||||
    },
 | 
			
		||||
    legendList: {
 | 
			
		||||
      type: Array,
 | 
			
		||||
      default: () => [],
 | 
			
		||||
    },
 | 
			
		||||
    chartMsg: {
 | 
			
		||||
      type: Object,
 | 
			
		||||
      default: () => { },
 | 
			
		||||
    },
 | 
			
		||||
    chartId: {
 | 
			
		||||
      type: String,
 | 
			
		||||
      default: "bmChart",
 | 
			
		||||
    },
 | 
			
		||||
    chartNum: {
 | 
			
		||||
      type: Number,
 | 
			
		||||
      default: 1,
 | 
			
		||||
    },
 | 
			
		||||
  },
 | 
			
		||||
  watch: {
 | 
			
		||||
    chartHeight: {
 | 
			
		||||
      handler(newVal) {
 | 
			
		||||
        this.chartHeight = newVal;
 | 
			
		||||
      },
 | 
			
		||||
    },
 | 
			
		||||
    type() {
 | 
			
		||||
      this.canvasReset();
 | 
			
		||||
    },
 | 
			
		||||
    chartNum(val) {
 | 
			
		||||
      this.canvasReset();
 | 
			
		||||
    },
 | 
			
		||||
    chartMsg: {
 | 
			
		||||
      handler(newVal) {
 | 
			
		||||
        this.canvasReset();
 | 
			
		||||
      },
 | 
			
		||||
      deep: true,
 | 
			
		||||
    },
 | 
			
		||||
  },
 | 
			
		||||
  mounted() {
 | 
			
		||||
    this.canvasReset();
 | 
			
		||||
  },
 | 
			
		||||
  methods: {
 | 
			
		||||
    canvasReset() {
 | 
			
		||||
      debounce(() => {
 | 
			
		||||
        this.getMes();
 | 
			
		||||
      }, 500)();
 | 
			
		||||
    },
 | 
			
		||||
    getMes() {
 | 
			
		||||
      if (this.myChart) {
 | 
			
		||||
        this.myChart.dispose();
 | 
			
		||||
      }
 | 
			
		||||
      var chartDom = document.getElementById(this.chartId);
 | 
			
		||||
      this.myChart = echarts.init(chartDom);
 | 
			
		||||
      this.option.color = this.chartMsg.color;
 | 
			
		||||
      this.option.xAxis.data = this.chartMsg.xData;
 | 
			
		||||
      // this.option.yAxis.name = this.chartMsg.yName;
 | 
			
		||||
 | 
			
		||||
      // this.option.yAxis.axisLabel = this.chartMsg.yAxisLabel;
 | 
			
		||||
      this.option.series = this.chartMsg.series;
 | 
			
		||||
      this.option.yAxis = this.chartMsg.yAxis;
 | 
			
		||||
 | 
			
		||||
      this.myChart.setOption(this.option);
 | 
			
		||||
    },
 | 
			
		||||
  },
 | 
			
		||||
};
 | 
			
		||||
</script>
 | 
			
		||||
<style lang="scss">
 | 
			
		||||
.legendData {
 | 
			
		||||
  text-align: right;
 | 
			
		||||
  position: relative;
 | 
			
		||||
  // right: 30;
 | 
			
		||||
  // top: 10px;
 | 
			
		||||
  .itemData {
 | 
			
		||||
    display: inline-block;
 | 
			
		||||
    margin-right: 10px;
 | 
			
		||||
    font-size: 14px;
 | 
			
		||||
    color: #8c8c8c;
 | 
			
		||||
    .block {
 | 
			
		||||
      width: 10px;
 | 
			
		||||
      height: 10px;
 | 
			
		||||
      display: inline-block;
 | 
			
		||||
      margin-right: 4px;
 | 
			
		||||
    }
 | 
			
		||||
    .line {
 | 
			
		||||
      width: 10px;
 | 
			
		||||
      height: 10px;
 | 
			
		||||
      border-radius: 5px;
 | 
			
		||||
      display: inline-block;
 | 
			
		||||
      margin-right: 4px;
 | 
			
		||||
      position: relative;
 | 
			
		||||
      .line-block {
 | 
			
		||||
        position: absolute;
 | 
			
		||||
        width: 20px;
 | 
			
		||||
        height: 2px;
 | 
			
		||||
        left: -5px;
 | 
			
		||||
        top: 4px;
 | 
			
		||||
      }
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
</style>
 | 
			
		||||
							
								
								
									
										245
									
								
								src/views/report/components/produceLineBarYearTarget.vue
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										245
									
								
								src/views/report/components/produceLineBarYearTarget.vue
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,245 @@
 | 
			
		||||
<!--
 | 
			
		||||
 * @Author: zhp
 | 
			
		||||
 * @Date: 2024-06-20 16:13:52
 | 
			
		||||
 * @LastEditTime: 2024-06-20 20:49:28
 | 
			
		||||
 * @LastEditors: zhp
 | 
			
		||||
 * @Description:
 | 
			
		||||
-->
 | 
			
		||||
<template>
 | 
			
		||||
  <div>
 | 
			
		||||
    <!-- 暂无数据 -->
 | 
			
		||||
    <div class="no-data-bg" style="position: relative; left: 50%; transform: translateX(-50%)"
 | 
			
		||||
      v-show="this.chartMsg.series.length === 0"></div>
 | 
			
		||||
    <!-- 图例 -->
 | 
			
		||||
    <div v-show="this.chartMsg.series.length > 0">
 | 
			
		||||
      <div class="legendData" v-if="show">
 | 
			
		||||
        <span class="itemData" v-for="item in legendList" :key="item.id">
 | 
			
		||||
          <span v-if="item.type === 1" class="block" :style="{ backgroundColor: item.color }"></span>
 | 
			
		||||
          <span v-if="item.type === 2" class="line" :style="{ backgroundColor: item.color }">
 | 
			
		||||
            <span class="line-block" :style="{ backgroundColor: item.color }"></span>
 | 
			
		||||
          </span>
 | 
			
		||||
          {{ item.name }}</span>
 | 
			
		||||
      </div>
 | 
			
		||||
      <div :id="chartId" :style="{ width: '100%', height: chartHeight + 'px' }"></div>
 | 
			
		||||
    </div>
 | 
			
		||||
  </div>
 | 
			
		||||
</template>
 | 
			
		||||
<script>
 | 
			
		||||
import * as echarts from "echarts";
 | 
			
		||||
import { debounce } from "@/utils/debounce";
 | 
			
		||||
export default {
 | 
			
		||||
  name: "bmLineBar",
 | 
			
		||||
  data() {
 | 
			
		||||
    return {
 | 
			
		||||
      myChart: "",
 | 
			
		||||
      option: {
 | 
			
		||||
        color: [],
 | 
			
		||||
        // color: ["#8EF0AB", "#63BDFF", "#288AFF"],
 | 
			
		||||
        grid: {
 | 
			
		||||
          left: 30,
 | 
			
		||||
          right: 0,
 | 
			
		||||
          bottom: 30,
 | 
			
		||||
          top: 30,
 | 
			
		||||
          containLabel:true,
 | 
			
		||||
        },
 | 
			
		||||
        tooltip: {
 | 
			
		||||
          trigger: "axis",
 | 
			
		||||
          axisPointer: {
 | 
			
		||||
            // type: "cross",
 | 
			
		||||
            crossStyle: {
 | 
			
		||||
              color: "rgba(237,237,237,0.5)",
 | 
			
		||||
            },
 | 
			
		||||
          },
 | 
			
		||||
          formatter: function (params) {
 | 
			
		||||
            console.log('params', params);
 | 
			
		||||
            var res = `<span style='color:rgba(0,0,0,0.8)'>${params[0].axisValueLabel}</span>`;
 | 
			
		||||
            for (var i = 0, l = params.length; i < l; i++) {
 | 
			
		||||
              res +=
 | 
			
		||||
                "<br/>" +
 | 
			
		||||
                `<span style='display:inline-block;margin-right:4px;border-radius:10px;width:10px;height:10px;background-color:${params[i].color}'></span>` +
 | 
			
		||||
                `<span style='display:inline-block;width:150px;color:rgba(0,0,0,0.8);font-size:14px;'>${params[i].seriesName}</span>` +
 | 
			
		||||
              `<span style='color:rgba(0,0,0,0.48);font-size:14px;'>${params[i].seriesName === "综合良率"
 | 
			
		||||
                  ? (params[i].value ? params[i].value.toFixed(2) : 0.0) + "%"
 | 
			
		||||
                : params[i].seriesName === "转化效率"
 | 
			
		||||
                    ? params[i].value+ "%"
 | 
			
		||||
                  : params[i].seriesName.search('总功率') != -1
 | 
			
		||||
                      ? params[i].value + "MW"
 | 
			
		||||
                      : params[i].value + "片"
 | 
			
		||||
                }</span>`;
 | 
			
		||||
            }
 | 
			
		||||
            return res;
 | 
			
		||||
          },
 | 
			
		||||
        },
 | 
			
		||||
        xAxis: {
 | 
			
		||||
          type: "category",
 | 
			
		||||
          data: [],
 | 
			
		||||
          axisTick: {
 | 
			
		||||
            show: false,
 | 
			
		||||
          },
 | 
			
		||||
          axisPointer: {
 | 
			
		||||
            type: "shadow",
 | 
			
		||||
          },
 | 
			
		||||
        },
 | 
			
		||||
        dataZoom: [//滚动条
 | 
			
		||||
          {
 | 
			
		||||
            // 设置滚动条的隐藏与显示
 | 
			
		||||
            show: true,
 | 
			
		||||
            // 设置滚动条类型
 | 
			
		||||
            type: "slider",
 | 
			
		||||
            // 设置背景颜色
 | 
			
		||||
            backgroundColor: "rgb(19, 63, 100)",
 | 
			
		||||
            // 设置选中范围的填充颜色
 | 
			
		||||
            fillerColor: "rgb(16, 171, 198)",
 | 
			
		||||
            // 设置边框颜色
 | 
			
		||||
            borderColor: "rgb(19, 63, 100)",
 | 
			
		||||
            // 是否显示detail,即拖拽时候显示详细数值信息
 | 
			
		||||
            showDetail: false,
 | 
			
		||||
            // 数据窗口范围的起始数值
 | 
			
		||||
            startValue: 0,
 | 
			
		||||
            // 数据窗口范围的结束数值(一页显示多少条数据)
 | 
			
		||||
            endValue: 5,
 | 
			
		||||
            // empty:当前数据窗口外的数据,被设置为空。
 | 
			
		||||
            // 即不会影响其他轴的数据范围
 | 
			
		||||
            filterMode: "empty",
 | 
			
		||||
            // 设置滚动条宽度,相对于盒子宽度
 | 
			
		||||
            width: "50%",
 | 
			
		||||
            // 设置滚动条高度
 | 
			
		||||
            height: 8,
 | 
			
		||||
            // 设置滚动条显示位置
 | 
			
		||||
            left: "center",
 | 
			
		||||
            // 是否锁定选择区域(或叫做数据窗口)的大小
 | 
			
		||||
            zoomLoxk: true,
 | 
			
		||||
            // 控制手柄的尺寸
 | 
			
		||||
            handleSize: 0,
 | 
			
		||||
            // dataZoom-slider组件离容器下侧的距离
 | 
			
		||||
            bottom: 3,
 | 
			
		||||
          },
 | 
			
		||||
          {
 | 
			
		||||
            // 没有下面这块的话,只能拖动滚动条,
 | 
			
		||||
            // 鼠标滚轮在区域内不能控制外部滚动条
 | 
			
		||||
            type: "inside",
 | 
			
		||||
            // 滚轮是否触发缩放
 | 
			
		||||
            zoomOnMouseWheel: false,
 | 
			
		||||
            // 鼠标滚轮触发滚动
 | 
			
		||||
            moveOnMouseMove: true,
 | 
			
		||||
            moveOnMouseWheel: true,
 | 
			
		||||
          },
 | 
			
		||||
 | 
			
		||||
        ],
 | 
			
		||||
        yAxis:undefined,
 | 
			
		||||
        series: [],
 | 
			
		||||
      },
 | 
			
		||||
    };
 | 
			
		||||
  },
 | 
			
		||||
  props: {
 | 
			
		||||
    chartHeight: {
 | 
			
		||||
      type: Number,
 | 
			
		||||
      default: 300,
 | 
			
		||||
    },
 | 
			
		||||
    type: {
 | 
			
		||||
      type: Number,
 | 
			
		||||
      default: 2,
 | 
			
		||||
    },
 | 
			
		||||
    show: {
 | 
			
		||||
      type: Boolean,
 | 
			
		||||
      default: true,
 | 
			
		||||
    },
 | 
			
		||||
    legendList: {
 | 
			
		||||
      type: Array,
 | 
			
		||||
      default: () => [],
 | 
			
		||||
    },
 | 
			
		||||
    chartMsg: {
 | 
			
		||||
      type: Object,
 | 
			
		||||
      default: () => { },
 | 
			
		||||
    },
 | 
			
		||||
    chartId: {
 | 
			
		||||
      type: String,
 | 
			
		||||
      default: "bmChart",
 | 
			
		||||
    },
 | 
			
		||||
    chartNum: {
 | 
			
		||||
      type: Number,
 | 
			
		||||
      default: 1,
 | 
			
		||||
    },
 | 
			
		||||
  },
 | 
			
		||||
  watch: {
 | 
			
		||||
    chartHeight: {
 | 
			
		||||
      handler(newVal) {
 | 
			
		||||
        this.chartHeight = newVal;
 | 
			
		||||
      },
 | 
			
		||||
    },
 | 
			
		||||
    type() {
 | 
			
		||||
      this.canvasReset();
 | 
			
		||||
    },
 | 
			
		||||
    chartNum(val) {
 | 
			
		||||
      this.canvasReset();
 | 
			
		||||
    },
 | 
			
		||||
    chartMsg: {
 | 
			
		||||
      handler(newVal) {
 | 
			
		||||
        this.canvasReset();
 | 
			
		||||
      },
 | 
			
		||||
      deep: true,
 | 
			
		||||
    },
 | 
			
		||||
  },
 | 
			
		||||
  mounted() {
 | 
			
		||||
    this.canvasReset();
 | 
			
		||||
  },
 | 
			
		||||
  methods: {
 | 
			
		||||
    canvasReset() {
 | 
			
		||||
      debounce(() => {
 | 
			
		||||
        this.getMes();
 | 
			
		||||
      }, 500)();
 | 
			
		||||
    },
 | 
			
		||||
    getMes() {
 | 
			
		||||
      if (this.myChart) {
 | 
			
		||||
        this.myChart.dispose();
 | 
			
		||||
      }
 | 
			
		||||
      var chartDom = document.getElementById(this.chartId);
 | 
			
		||||
      this.myChart = echarts.init(chartDom);
 | 
			
		||||
      this.option.color = this.chartMsg.color;
 | 
			
		||||
      this.option.xAxis.data = this.chartMsg.xData;
 | 
			
		||||
      // this.option.yAxis.name = this.chartMsg.yName;
 | 
			
		||||
 | 
			
		||||
      // this.option.yAxis.axisLabel = this.chartMsg.yAxisLabel;
 | 
			
		||||
      this.option.series = this.chartMsg.series;
 | 
			
		||||
      this.option.yAxis = this.chartMsg.yAxis;
 | 
			
		||||
 | 
			
		||||
      this.myChart.setOption(this.option);
 | 
			
		||||
    },
 | 
			
		||||
  },
 | 
			
		||||
};
 | 
			
		||||
</script>
 | 
			
		||||
<style lang="scss">
 | 
			
		||||
.legendData {
 | 
			
		||||
  text-align: right;
 | 
			
		||||
  position: relative;
 | 
			
		||||
  // right: 30;
 | 
			
		||||
  // top: 10px;
 | 
			
		||||
  .itemData {
 | 
			
		||||
    display: inline-block;
 | 
			
		||||
    margin-right: 10px;
 | 
			
		||||
    font-size: 14px;
 | 
			
		||||
    color: #8c8c8c;
 | 
			
		||||
    .block {
 | 
			
		||||
      width: 10px;
 | 
			
		||||
      height: 10px;
 | 
			
		||||
      display: inline-block;
 | 
			
		||||
      margin-right: 4px;
 | 
			
		||||
    }
 | 
			
		||||
    .line {
 | 
			
		||||
      width: 10px;
 | 
			
		||||
      height: 10px;
 | 
			
		||||
      border-radius: 5px;
 | 
			
		||||
      display: inline-block;
 | 
			
		||||
      margin-right: 4px;
 | 
			
		||||
      position: relative;
 | 
			
		||||
      .line-block {
 | 
			
		||||
        position: absolute;
 | 
			
		||||
        width: 20px;
 | 
			
		||||
        height: 2px;
 | 
			
		||||
        left: -5px;
 | 
			
		||||
        top: 4px;
 | 
			
		||||
      }
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
</style>
 | 
			
		||||
@@ -1,7 +1,7 @@
 | 
			
		||||
<!--
 | 
			
		||||
 * @Author: zhp
 | 
			
		||||
 * @Date: 2024-04-15 10:49:13
 | 
			
		||||
 * @LastEditTime: 2024-06-18 13:41:03
 | 
			
		||||
 * @LastEditTime: 2024-06-20 20:46:53
 | 
			
		||||
 * @LastEditors: zhp
 | 
			
		||||
 * @Description:
 | 
			
		||||
-->
 | 
			
		||||
@@ -13,59 +13,48 @@
 | 
			
		||||
    </div>
 | 
			
		||||
    <div class="app-container" style="margin-top: 8px;flex-grow: 1; height: auto;">
 | 
			
		||||
      <el-form :model="listQuery" :inline="true" ref="dataForm" class="blueTip">
 | 
			
		||||
        <el-form-item label="时间维度" prop="date">
 | 
			
		||||
        <el-form-item label="时间维度" prop="type">
 | 
			
		||||
          <el-select size="small" clearable v-model="listQuery.type" placeholder="请选择">
 | 
			
		||||
            <el-option v-for="item in timeList" :key="item.value" :label="item.label" :value="item.value">
 | 
			
		||||
            </el-option>
 | 
			
		||||
          </el-select>
 | 
			
		||||
        </el-form-item>
 | 
			
		||||
        <el-form-item v-show="listQuery.type === 0 || listQuery.type === ''" label="时间范围" prop="reportTime">
 | 
			
		||||
          <el-date-picker size="small" clearable v-model="listQuery.reportTime" type="daterange" range-separator="至"
 | 
			
		||||
            start-placeholder="开始日期" value-format="yyyy-MM-dd HH:mm:ss" @change="changeDayTime" end-placeholder="结束日期">
 | 
			
		||||
          <el-date-picker size="small" clearable v-model="listQuery.reportTime" type="datetimerange" range-separator="至"
 | 
			
		||||
            start-placeholder="开始日期" value-format="yyyy-MM-dd" format="yyyy-MM-dd" @change="changeDayTime"
 | 
			
		||||
            end-placeholder="结束日期">
 | 
			
		||||
          </el-date-picker>
 | 
			
		||||
        </el-form-item>
 | 
			
		||||
        <el-form-item v-show="listQuery.type === 1" label="时间范围" prop="reportTime">
 | 
			
		||||
          <el-date-picker size="small" clearable v-model="start" type="week" format="yyyy 第 WW 周" placeholder="选择周"
 | 
			
		||||
            style="width: 180px" @change="onValueChange">
 | 
			
		||||
          <el-date-picker size="small" clearable v-model="listQuery.start" type="week" format="yyyy 第 WW 周"
 | 
			
		||||
            placeholder="选择周" style="width: 180px" @change="onValueChange">
 | 
			
		||||
          </el-date-picker>
 | 
			
		||||
          至
 | 
			
		||||
          <el-date-picker size="small" clearable v-model="end" type="week" format="yyyy 第 WW 周" placeholder="选择周"
 | 
			
		||||
            style="width: 180px" @change="onValueChange">
 | 
			
		||||
          <el-date-picker size="small" clearable v-model="listQuery.end" type="week" format="yyyy 第 WW 周"
 | 
			
		||||
            placeholder="选择周" style="width: 180px" @change="onValueChange">
 | 
			
		||||
          </el-date-picker>
 | 
			
		||||
          <!-- <span v-if="listQuery.start && listQuery.end" style="margin-left: 10px">
 | 
			
		||||
            {{ date1 }} 至 {{ date2 }},共 {{ weekNum }} 周
 | 
			
		||||
          </span> -->
 | 
			
		||||
        </el-form-item>
 | 
			
		||||
        <el-form-item v-show="listQuery.type === 2" label="时间值" prop="reportTime">
 | 
			
		||||
          <el-date-picker size="small" v-model="listQuery.reportTime" type="monthrange"
 | 
			
		||||
            value-format="yyyy-MM-DD HH:mm:ss" range-separator="至" start-placeholder="开始月份" end-placeholder="结束月份"
 | 
			
		||||
        <el-form-item v-show="listQuery.type === 2" label="时间范围" prop="reportTime">
 | 
			
		||||
          <el-date-picker size="small" clearable v-model="listQuery.reportTime" type="monthrange"
 | 
			
		||||
            value-format="yyyy-MM-dd" range-separator="至" start-placeholder="开始月份" end-placeholder="结束月份"
 | 
			
		||||
            @change="changeTime">
 | 
			
		||||
          </el-date-picker>
 | 
			
		||||
        </el-form-item>
 | 
			
		||||
        <el-form-item v-show="listQuery.type === 3" label="时间值" prop="reportTime">
 | 
			
		||||
          <el-date-picker size="small" clearable v-model="listQuery.reportTime[0]" value-format="yyyy" type="year"
 | 
			
		||||
        <el-form-item v-show="listQuery.type === 3" label="时间范围" prop="reportTime">
 | 
			
		||||
          <el-date-picker size="small" clearable v-model="listQuery.start" value-format="yyyy-MM-dd" type="year"
 | 
			
		||||
            placeholder="开始时间">
 | 
			
		||||
          </el-date-picker>
 | 
			
		||||
          ~
 | 
			
		||||
          <el-date-picker size="small" clearable v-model="listQuery.reportTime[1]" value-format="yyyy" type="year"
 | 
			
		||||
          <el-date-picker size="small" clearable v-model="listQuery.end" value-format="yyyy-MM-dd" type="year"
 | 
			
		||||
            placeholder="结束时间" @change="getYear">
 | 
			
		||||
          </el-date-picker>
 | 
			
		||||
        </el-form-item>
 | 
			
		||||
        <!-- <el-form-item label="玻璃类型" prop="type">
 | 
			
		||||
          <el-select v-model="listQuery.type" placeholder="请选择玻璃类型">
 | 
			
		||||
            <el-option v-for="item in typeList" :key="item.id" :label="item.name" :value="item.id">
 | 
			
		||||
            </el-option>
 | 
			
		||||
          </el-select>
 | 
			
		||||
        </el-form-item> -->
 | 
			
		||||
        <!-- <el-form-item label="玻璃类型" prop="type">
 | 
			
		||||
          <el-select v-model="listQuery.type" placeholder="请选择玻璃类型">
 | 
			
		||||
            <el-option v-for="item in typeList" :key="item.id" :label="item.name" :value="item.id">
 | 
			
		||||
            </el-option>
 | 
			
		||||
          </el-select>
 | 
			
		||||
        </el-form-item> -->
 | 
			
		||||
        <el-form-item>
 | 
			
		||||
          <el-button type="primary" size="small" @click="getDataList">查询</el-button>
 | 
			
		||||
          <el-divider direction="vertical"></el-divider>
 | 
			
		||||
          <!-- <el-button type="primary" size="small" plain @click="handleImport">导入</el-button> -->
 | 
			
		||||
          <el-button type="primary" size="small" plain @click="handleExport">导出</el-button>
 | 
			
		||||
          <!-- <el-button type="success" size="small" plain @click="addFactory">新增</el-button> -->
 | 
			
		||||
        </el-form-item>
 | 
			
		||||
      </el-form>
 | 
			
		||||
      <base-table :table-props="tableProps" :page="listQuery.pageNo" :limit="listQuery.pageSize"
 | 
			
		||||
@@ -77,7 +66,7 @@
 | 
			
		||||
 | 
			
		||||
<script>
 | 
			
		||||
// import { parseTime } from '../../core/mixins/code-filter';
 | 
			
		||||
import { getComprehensiveDataPage } from '@/api/report';
 | 
			
		||||
import { getComprehensiveDataPage, exportComprehensiveDataPage } from '@/api/report';
 | 
			
		||||
// import { getWorkOrderPage, exportExcel, getOverView } from '@/components/buttonNav'
 | 
			
		||||
// import inputTable from './inputTable.vue';
 | 
			
		||||
// import lineChart from './lineChart';
 | 
			
		||||
@@ -97,16 +86,19 @@ export default {
 | 
			
		||||
    return {
 | 
			
		||||
      factoryList,
 | 
			
		||||
      factoryArray,
 | 
			
		||||
      start: undefined,
 | 
			
		||||
      end: undefined,
 | 
			
		||||
 | 
			
		||||
      listQuery: {
 | 
			
		||||
        pageNo: 1,
 | 
			
		||||
        pageSize: 999,
 | 
			
		||||
        // size: 10,
 | 
			
		||||
        // current: 1,
 | 
			
		||||
        factory: null,
 | 
			
		||||
        factory: undefined,
 | 
			
		||||
        // total: 0,
 | 
			
		||||
        type: 2,
 | 
			
		||||
        startDate: undefined,
 | 
			
		||||
        endDate: undefined,
 | 
			
		||||
        start: undefined,
 | 
			
		||||
        end: undefined,
 | 
			
		||||
        reportTime: []
 | 
			
		||||
      },
 | 
			
		||||
      timeList: [
 | 
			
		||||
@@ -152,68 +144,7 @@ export default {
 | 
			
		||||
          id: 2,
 | 
			
		||||
        },
 | 
			
		||||
      ],
 | 
			
		||||
      tableProps: [
 | 
			
		||||
        {
 | 
			
		||||
          prop: 'factory',
 | 
			
		||||
          label: '玻璃类型',
 | 
			
		||||
          fixed:true,
 | 
			
		||||
          // filter: (val) => factoryList[val],
 | 
			
		||||
          // minWidth: 200,
 | 
			
		||||
          // showOverflowtooltip: true
 | 
			
		||||
        },
 | 
			
		||||
        {
 | 
			
		||||
          prop: 'workOrderNumber',
 | 
			
		||||
          label: '科目/日期',
 | 
			
		||||
          fixed: true,
 | 
			
		||||
          // filter: (val) => ['玻璃芯片', '标准组件', 'BIPV', '定制组件'][val]
 | 
			
		||||
        },
 | 
			
		||||
        {
 | 
			
		||||
          prop: 'workOrderType',
 | 
			
		||||
          label: '单位',
 | 
			
		||||
          fixed: true,
 | 
			
		||||
          // filter: publicFormatter('workorder_status')
 | 
			
		||||
          // filter: (val) => ['', '芯片工单', '组件类型', 'bipv类型'][val],
 | 
			
		||||
        },
 | 
			
		||||
        // {
 | 
			
		||||
        //   prop: 'plannedInvestment',
 | 
			
		||||
        //   label: '计划投入',
 | 
			
		||||
        // },
 | 
			
		||||
        // {
 | 
			
		||||
        //   prop: 'actualInvestment',
 | 
			
		||||
        //   label: '实际投入',
 | 
			
		||||
        // },
 | 
			
		||||
        // {
 | 
			
		||||
        //   prop: 'targetProduction',
 | 
			
		||||
        //   label: '目标产量',
 | 
			
		||||
        // },
 | 
			
		||||
        // {
 | 
			
		||||
        //   prop: 'actualProduction',
 | 
			
		||||
        //   label: '实际产量',
 | 
			
		||||
        // },
 | 
			
		||||
        // {
 | 
			
		||||
        //   prop: 'productionProgress',
 | 
			
		||||
        //   label: '生产进度',
 | 
			
		||||
        //   filter: (val) => (val * 100) + '%'
 | 
			
		||||
        // },
 | 
			
		||||
        // {
 | 
			
		||||
        //   prop: 'orderStatus',
 | 
			
		||||
        //   label: '工单状态',
 | 
			
		||||
        //   filter: publicFormatter('workorder_status')
 | 
			
		||||
        //   // filter: (val) => ['未开始', '生产中', '已完成'][val],
 | 
			
		||||
        // },
 | 
			
		||||
        // {
 | 
			
		||||
        //   prop: 'startTime',
 | 
			
		||||
        //   label: '开始时间',
 | 
			
		||||
        //   minWidth: 100,
 | 
			
		||||
        //   showOverflowtooltip: true
 | 
			
		||||
        // },
 | 
			
		||||
        // {
 | 
			
		||||
        //   prop: 'endTime',
 | 
			
		||||
        //   label: '完成时间',
 | 
			
		||||
        //   minWidth: 100,
 | 
			
		||||
        //   showOverflowtooltip: true
 | 
			
		||||
        // }
 | 
			
		||||
      ],
 | 
			
		||||
      otherProps:[],
 | 
			
		||||
      tableData: [],
 | 
			
		||||
      xAxis: [],
 | 
			
		||||
      currentMenu:null,
 | 
			
		||||
@@ -227,6 +158,32 @@ export default {
 | 
			
		||||
    weekNum() {
 | 
			
		||||
      return Math.round((this.end - this.start) / (24 * 60 * 60 * 1000 * 7)) + 1
 | 
			
		||||
    },
 | 
			
		||||
    tableProps() {
 | 
			
		||||
      return [
 | 
			
		||||
        {
 | 
			
		||||
          prop: 'type',
 | 
			
		||||
          label: '玻璃类型',
 | 
			
		||||
          fixed: true,
 | 
			
		||||
          // filter: (val) => factoryList[val],
 | 
			
		||||
          // minWidth: 200,
 | 
			
		||||
          // showOverflowtooltip: true
 | 
			
		||||
        },
 | 
			
		||||
        {
 | 
			
		||||
          prop: 'item',
 | 
			
		||||
          label: '科目/日期',
 | 
			
		||||
          fixed: true,
 | 
			
		||||
          // filter: (val) => ['玻璃芯片', '标准组件', 'BIPV', '定制组件'][val]
 | 
			
		||||
        },
 | 
			
		||||
        {
 | 
			
		||||
          prop: 'unit',
 | 
			
		||||
          label: '单位',
 | 
			
		||||
          fixed: true,
 | 
			
		||||
          // filter: publicFormatter('workorder_status')
 | 
			
		||||
          // filter: (val) => ['', '芯片工单', '组件类型', 'bipv类型'][val],
 | 
			
		||||
        },
 | 
			
		||||
        ...this.otherProps
 | 
			
		||||
      ]
 | 
			
		||||
    },
 | 
			
		||||
  },
 | 
			
		||||
  // created() {
 | 
			
		||||
  //   const currentMonth = new Date()
 | 
			
		||||
@@ -235,67 +192,40 @@ export default {
 | 
			
		||||
  // },
 | 
			
		||||
  mounted() {
 | 
			
		||||
    // this.getOverView()
 | 
			
		||||
    const currentMonth = new Date()
 | 
			
		||||
    this.listQuery.reportTime = [moment(currentMonth).format('yyyy-MM-DD HH:mm:ss'), moment(currentMonth).format('yyyy-MM-DD HH:mm:ss')]
 | 
			
		||||
    this.changeTime()
 | 
			
		||||
    const today = new Date()
 | 
			
		||||
    const sevenDaysAgo = new Date(today.getTime() - (7 * 24 * 60 * 60 * 1000))
 | 
			
		||||
    this.listQuery.startDate = moment(sevenDaysAgo).format('yyyy-MM-DD')
 | 
			
		||||
    this.listQuery.endDate = moment(today).format('yyyy-MM-DD')
 | 
			
		||||
    this.listQuery.reportTime = [this.listQuery.startDate, this.listQuery.endDate]
 | 
			
		||||
    this.getDataList()
 | 
			
		||||
  },
 | 
			
		||||
  methods: {
 | 
			
		||||
    getYear(e) {
 | 
			
		||||
      if (this.end && Number(this.end) - Number(this.start) > 10) {
 | 
			
		||||
      if (this.listQuery.end - this.listQuery.start > 10 * 365 * 24 * 60 * 60 * 1000) {
 | 
			
		||||
        this.$message({
 | 
			
		||||
          message: '年份起止时间不能超过十年',
 | 
			
		||||
          type: 'warning'
 | 
			
		||||
        });
 | 
			
		||||
        this.start = undefined
 | 
			
		||||
        this.end = undefined
 | 
			
		||||
        this.listQuery.reportTime = []
 | 
			
		||||
        this.listQuery.start = undefined
 | 
			
		||||
        this.listQuery.end = undefined
 | 
			
		||||
        // console.log();
 | 
			
		||||
      } else {
 | 
			
		||||
        if (Number(this.end) < Number(this.start)) {
 | 
			
		||||
          this.$message({
 | 
			
		||||
            message: '结束年份不能小于开始年份',
 | 
			
		||||
            type: 'warning'
 | 
			
		||||
          });
 | 
			
		||||
          this.start = undefined
 | 
			
		||||
          this.end = undefined
 | 
			
		||||
        } else {
 | 
			
		||||
          this.listQuery.startDate = Number(this.start)
 | 
			
		||||
          this.listQuery.endDate = Number(this.end)
 | 
			
		||||
        }
 | 
			
		||||
        this.listQuery.startDate = this.listQuery.start
 | 
			
		||||
        this.listQuery.endDate = this.listQuery.end
 | 
			
		||||
      }
 | 
			
		||||
      if (!this.start && !this.end) {
 | 
			
		||||
      if (!this.listQuery.start && !this.listQuery.end) {
 | 
			
		||||
        this.listQuery.startDate = undefined
 | 
			
		||||
        this.listQuery.endDate = undefined
 | 
			
		||||
      }
 | 
			
		||||
      // console.log(e);
 | 
			
		||||
    },
 | 
			
		||||
    changeTime() {
 | 
			
		||||
      if (this.listQuery.reportTime) {
 | 
			
		||||
        console.log(this.listQuery.reportTime)
 | 
			
		||||
        let start = new Date(this.listQuery.reportTime[0])
 | 
			
		||||
        let end = new Date(this.listQuery.reportTime[1])
 | 
			
		||||
        // const years = Number(this.listQuery.reportTime[1].slice(0, 4)) - Number(this.listQuery.reportTime[0].slice(0, 4))
 | 
			
		||||
        // const months = Number(this.listQuery.reportTime[1].slice(4)) - Number(this.listQuery.reportTime[0].slice(4))
 | 
			
		||||
        // console.log(years);
 | 
			
		||||
        if ((end - start) > 31104000000) {
 | 
			
		||||
          this.$message({
 | 
			
		||||
            message: '时间范围不能超过24个月',
 | 
			
		||||
            type: 'warning'
 | 
			
		||||
          });
 | 
			
		||||
          this.listQuery.reportTime = [];
 | 
			
		||||
        } else {
 | 
			
		||||
          this.listQuery.startDate = this.listQuery.reportTime[0]
 | 
			
		||||
          this.listQuery.endDate = this.listQuery.reportTime[1]
 | 
			
		||||
        }
 | 
			
		||||
      } else {
 | 
			
		||||
        this.listQuery.startDate = undefined
 | 
			
		||||
        this.listQuery.endDate = undefined
 | 
			
		||||
      }
 | 
			
		||||
    },
 | 
			
		||||
    onValueChange(picker, k) { // 选中近k周后触发的操作
 | 
			
		||||
      if (this.start && this.end) {
 | 
			
		||||
        this.date1 = moment(this.start.getTime() - 24 * 60 * 60 * 1000).format('YYYY-MM-DD HH:mm:ss')
 | 
			
		||||
        this.date2 = moment(this.end.getTime() + 5 * 24 * 60 * 60 * 1000).format('YYYY-MM-DD HH:mm:ss')
 | 
			
		||||
      // console.log(this.listQuery.reportTime[0], this.listQuery.reportTime[1])
 | 
			
		||||
      if (this.listQuery.start && this.listQuery.end) {
 | 
			
		||||
        console.log(this.listQuery.reportTime)
 | 
			
		||||
        this.date1 = moment(this.listQuery.start.getTime() - 24 * 60 * 60 * 1000).format('YYYY-MM-DD HH:mm:ss')
 | 
			
		||||
        this.date2 = moment(this.listQuery.end.getTime() + 5 * 24 * 60 * 60 * 1000).format('YYYY-MM-DD HH:mm:ss')
 | 
			
		||||
        const numDays = (new Date(this.date2).getTime() - new Date(this.date1).getTime()) / (24 * 3600 * 1000);
 | 
			
		||||
        if (numDays > 168) {
 | 
			
		||||
          console.log(numDays)
 | 
			
		||||
@@ -304,20 +234,21 @@ export default {
 | 
			
		||||
            type: 'warning'
 | 
			
		||||
          });
 | 
			
		||||
        } else {
 | 
			
		||||
          this.listQuery.startDate = this.date1
 | 
			
		||||
          this.listQuery.endDate = this.date2
 | 
			
		||||
          // this.listQuery.startDate = Number(moment(this.start.getTime()).format('YYYYWW'))
 | 
			
		||||
          // this.listQuery.endDate = Number(moment(this.end.getTime()).format('YYYYWW'))
 | 
			
		||||
          this.listQuery.startDate = moment(this.listQuery.start.getTime() - 24 * 60 * 60 * 1000).format('YYYY-MM-DD')
 | 
			
		||||
          this.listQuery.endDate = moment(this.listQuery.end.getTime() + 5 * 24 * 60 * 60 * 1000).format('YYYY-MM-DD')
 | 
			
		||||
        }
 | 
			
		||||
      }
 | 
			
		||||
      if (!this.start && !this.end) {
 | 
			
		||||
      if (!this.listQuery.start && !this.listQuery.end) {
 | 
			
		||||
        this.listQuery.startDate = undefined
 | 
			
		||||
        this.listQuery.endDate = undefined
 | 
			
		||||
      }
 | 
			
		||||
    },
 | 
			
		||||
    changeDayTime() {
 | 
			
		||||
      if (this.listQuery.reportTime) {
 | 
			
		||||
        const numDays = Number(this.listQuery.reportTime[1]) - Number(this.listQuery.reportTime[0])
 | 
			
		||||
        // this.createStartDate = moment(new Date(this.listQuery.reportTime[0]), 'yyyy-MM-dd hh:mm:ss');
 | 
			
		||||
        // this.createEndDate = moment(new Date(this.listQuery.reportTime[1]), 'yyyy-MM-dd hh:mm:ss');
 | 
			
		||||
        console.log(this.listQuery.reportTime[1])
 | 
			
		||||
        const numDays = (this.listQuery.reportTime[1] - this.listQuery.reportTime[0]) / (24 * 3600 * 1000);
 | 
			
		||||
        if (numDays > 30) {
 | 
			
		||||
          this.$message({
 | 
			
		||||
            message: '时间范围不能超过30天',
 | 
			
		||||
@@ -333,30 +264,209 @@ export default {
 | 
			
		||||
        this.listQuery.endDate = undefined
 | 
			
		||||
      }
 | 
			
		||||
    },
 | 
			
		||||
    getOverView() {
 | 
			
		||||
      // getOverView().then(res => {
 | 
			
		||||
      //   this.data = res.data
 | 
			
		||||
      //   console.log('aa', res.data)
 | 
			
		||||
      // })
 | 
			
		||||
    },
 | 
			
		||||
    otherMethods(val) {
 | 
			
		||||
      this.detailOrUpdateVisible = true;
 | 
			
		||||
      // this.addOrEditTitle = "详情";
 | 
			
		||||
      this.$nextTick(() => {
 | 
			
		||||
        // this.$refs.detailOrUpdate.init(val.data.id);
 | 
			
		||||
      });
 | 
			
		||||
    changeTime(value) {
 | 
			
		||||
      if (this.listQuery.reportTime) {
 | 
			
		||||
        const numDays = this.listQuery.reportTime[1] - this.listQuery.reportTime[0];
 | 
			
		||||
        if (numDays > 2 * 365 * 24 * 60 * 60 * 1000) {
 | 
			
		||||
          this.$message({
 | 
			
		||||
            message: '时间范围不能超过24个月',
 | 
			
		||||
            type: 'warning'
 | 
			
		||||
          });
 | 
			
		||||
          this.listQuery.reportTime = [];
 | 
			
		||||
        } else {
 | 
			
		||||
          this.listQuery.startDate = this.listQuery.reportTime[0]
 | 
			
		||||
          this.listQuery.endDate = this.listQuery.reportTime[1]
 | 
			
		||||
        }
 | 
			
		||||
      } else {
 | 
			
		||||
        this.listQuery.startDate = undefined
 | 
			
		||||
        this.listQuery.endDate = undefined
 | 
			
		||||
      }
 | 
			
		||||
    },
 | 
			
		||||
    async getDataList() {
 | 
			
		||||
      console.log(this.listQuery);
 | 
			
		||||
      if (this.listQuery.type == 3) {
 | 
			
		||||
        this.listQuery.startDate = this.listQuery.reportTime[0] + '-01-01 00:00:00'
 | 
			
		||||
        this.listQuery.endDate = this.listQuery.reportTime[1] + '-12-31 23:59:59'
 | 
			
		||||
      }
 | 
			
		||||
      this.otherProps = []
 | 
			
		||||
      let arr  = []
 | 
			
		||||
      this.currentMenu === '邯郸' ? arr.push(1) : arr.push(2)
 | 
			
		||||
      this.listQuery.factory = arr
 | 
			
		||||
      const res = await getComprehensiveDataPage(this.listQuery)
 | 
			
		||||
      this.tableData = res.data.list
 | 
			
		||||
      let dataArr = [{
 | 
			
		||||
        type: '芯片',
 | 
			
		||||
        item: 'FTO投入',
 | 
			
		||||
        unit: '片'
 | 
			
		||||
      },
 | 
			
		||||
      {
 | 
			
		||||
        type: '芯片',
 | 
			
		||||
        item: '芯片产量',
 | 
			
		||||
        unit: '片'
 | 
			
		||||
        }, {
 | 
			
		||||
        type: '芯片',
 | 
			
		||||
          item: '芯片平均功率',
 | 
			
		||||
          unit: 'W'
 | 
			
		||||
        },
 | 
			
		||||
        {
 | 
			
		||||
          type: '芯片',
 | 
			
		||||
          item: '芯片良率',
 | 
			
		||||
          unit: '%'
 | 
			
		||||
        }, {
 | 
			
		||||
          type: '芯片',
 | 
			
		||||
          item: '芯片产量',
 | 
			
		||||
          unit: '片'
 | 
			
		||||
        }, {
 | 
			
		||||
          type: '芯片',
 | 
			
		||||
          item: '芯片总功率',
 | 
			
		||||
          unit: 'MW'
 | 
			
		||||
        }, {
 | 
			
		||||
          type: '芯片',
 | 
			
		||||
          item: 'CSS稼动率',
 | 
			
		||||
          unit: '%'
 | 
			
		||||
        }, {
 | 
			
		||||
          type: '芯片',
 | 
			
		||||
          item: '芯片段OEE',
 | 
			
		||||
          unit: '%'
 | 
			
		||||
        }, {
 | 
			
		||||
          type: '芯片',
 | 
			
		||||
          item: '芯片产能利用率',
 | 
			
		||||
          unit: '%'
 | 
			
		||||
        }, {
 | 
			
		||||
          type: '芯片',
 | 
			
		||||
          item: '芯片人均产量',
 | 
			
		||||
          unit: '片/人'
 | 
			
		||||
        }, {
 | 
			
		||||
          type: '芯片',
 | 
			
		||||
          item: '芯片BOM',
 | 
			
		||||
          unit: '元/片'
 | 
			
		||||
        }, {
 | 
			
		||||
          type: '标准组件',
 | 
			
		||||
          item: '标准组件产量',
 | 
			
		||||
          unit: '片'
 | 
			
		||||
        }, {
 | 
			
		||||
          type: '标准组件',
 | 
			
		||||
          item: '标准组件平均功率',
 | 
			
		||||
          unit: 'W'
 | 
			
		||||
        }, {
 | 
			
		||||
          type: '标准组件',
 | 
			
		||||
          item: '标准组件良率',
 | 
			
		||||
          unit: '%'
 | 
			
		||||
        }, {
 | 
			
		||||
          type: '标准组件',
 | 
			
		||||
          item: '标准组件总功率',
 | 
			
		||||
          unit: 'MW'
 | 
			
		||||
        }, {
 | 
			
		||||
          type: '标准组件',
 | 
			
		||||
          item: '封装线OEE',
 | 
			
		||||
          unit: '%'
 | 
			
		||||
        },
 | 
			
		||||
        {
 | 
			
		||||
          type: '标准组件',
 | 
			
		||||
          item: '封装线产能利用率',
 | 
			
		||||
          unit: '%'
 | 
			
		||||
        },
 | 
			
		||||
        {
 | 
			
		||||
          type: '标准组件',
 | 
			
		||||
          item: '标准组件人均产量',
 | 
			
		||||
          unit: '片/人'
 | 
			
		||||
        },
 | 
			
		||||
        {
 | 
			
		||||
          type: '标准组件',
 | 
			
		||||
          item: '封装BOM',
 | 
			
		||||
          unit: '元/片'
 | 
			
		||||
        },
 | 
			
		||||
        {
 | 
			
		||||
          type: 'BIPV',
 | 
			
		||||
          item: '芯片使用量',
 | 
			
		||||
          unit: '%'
 | 
			
		||||
        },
 | 
			
		||||
        {
 | 
			
		||||
          type: 'BIPV',
 | 
			
		||||
          item: 'BIPV产量',
 | 
			
		||||
          unit: 'm2'
 | 
			
		||||
        },
 | 
			
		||||
        {
 | 
			
		||||
          type: 'BIPV',
 | 
			
		||||
          item: '芯片使用率',
 | 
			
		||||
          unit: '%'
 | 
			
		||||
        },
 | 
			
		||||
          {
 | 
			
		||||
          type: 'BIPV',
 | 
			
		||||
          item: '人均产量',
 | 
			
		||||
          unit: 'm2/人'
 | 
			
		||||
        },
 | 
			
		||||
        {
 | 
			
		||||
          type: 'BIPV',
 | 
			
		||||
          item: 'OEM及委外材料成本',
 | 
			
		||||
          unit: '元/片'
 | 
			
		||||
        },
 | 
			
		||||
        {
 | 
			
		||||
          type: 'BIPV',
 | 
			
		||||
          item: '内部材料成本',
 | 
			
		||||
          unit: '元/片'
 | 
			
		||||
        },
 | 
			
		||||
        {
 | 
			
		||||
          type: 'BIPV',
 | 
			
		||||
          item: '综合材料成本',
 | 
			
		||||
          unit: '元/片'
 | 
			
		||||
        },
 | 
			
		||||
      ]
 | 
			
		||||
      res.data.forEach((ele, index) => {
 | 
			
		||||
        let i = index + 1
 | 
			
		||||
        // this.chartMsg.xData.push(ele.titleValue)
 | 
			
		||||
        this.otherProps.push({
 | 
			
		||||
          label: ele.titleValue,
 | 
			
		||||
          props: 'value' + i
 | 
			
		||||
        })
 | 
			
		||||
      })
 | 
			
		||||
      console.log(this.otherProps)
 | 
			
		||||
      res.data.forEach((item, index) => {
 | 
			
		||||
        let i = index + 1
 | 
			
		||||
        let m = 'value' + i
 | 
			
		||||
        // ele.productYieldDataVOList.forEach((item) => {
 | 
			
		||||
         dataArr[0]['' + m + ''] = item.ftoInput
 | 
			
		||||
          // dataArr[0].factory = item.factory === 1 ? '邯郸' : '瑞昌'
 | 
			
		||||
          // dataArr[1].factory = item.factory === 1 ? '邯郸' : '瑞昌'
 | 
			
		||||
          // dataArr[2].factory = item.factory === 1 ? '邯郸' : '瑞昌'
 | 
			
		||||
          // dataArr[3].factory = item.factory === 1 ? '邯郸' : '瑞昌'
 | 
			
		||||
          dataArr[1]['' + m + ''] = item.chipYield
 | 
			
		||||
          dataArr[2]['' + m + ''] = item.chipAveragePower
 | 
			
		||||
          dataArr[4]['' + m + ''] = item.chipTotalPower
 | 
			
		||||
          dataArr[5]['' + m + ''] = item.chipCssMarriageRate
 | 
			
		||||
          dataArr[6]['' + m + ''] = item.chipOee
 | 
			
		||||
          dataArr[7]['' + m + ''] = item.chipCapacityUtilizationRate
 | 
			
		||||
          dataArr[8]['' + m + ''] = item.chipAnnualAverageProduction
 | 
			
		||||
          dataArr[9]['' + m + ''] = item.chipBom
 | 
			
		||||
          dataArr[10]['' + m + ''] = item.componentYield
 | 
			
		||||
          dataArr[11]['' + m + ''] = item.componentAveragePower
 | 
			
		||||
          dataArr[12]['' + m + ''] = item.componentYieldRate
 | 
			
		||||
          dataArr[13]['' + m + ''] = item.componentTotalPower
 | 
			
		||||
          dataArr[14]['' + m + ''] = item.componentOee
 | 
			
		||||
          dataArr[15]['' + m + ''] = item.componentCapacityUtilizationRate
 | 
			
		||||
          dataArr[16]['' + m + ''] = item.componentAnnualAverageProduction
 | 
			
		||||
          dataArr[17]['' + m + ''] = item.componentBom
 | 
			
		||||
          dataArr[18]['' + m + ''] = item.bipvChipUsage
 | 
			
		||||
          dataArr[19]['' + m + ''] = item.bipvProductOutput
 | 
			
		||||
          dataArr[20]['' + m + ''] = item.bipvChipUtilizationRate
 | 
			
		||||
          dataArr[21]['' + m + ''] = item.bipvAnnualAverageProduction
 | 
			
		||||
          dataArr[22]['' + m + ''] = item.bipvOeeMaterialCost
 | 
			
		||||
          dataArr[23]['' + m + ''] = item.bipvInsideMaterialCost
 | 
			
		||||
          dataArr[24]['' + m + ''] = item.bipvComprehensiveMaterialCost
 | 
			
		||||
 | 
			
		||||
        // })
 | 
			
		||||
        // ele.titleValue
 | 
			
		||||
        // .push({
 | 
			
		||||
        //   label: ele.titleValue,
 | 
			
		||||
        //   props: 'value' + index + 1,
 | 
			
		||||
        // })
 | 
			
		||||
      })
 | 
			
		||||
      if (res.data.length === 0) {
 | 
			
		||||
        this.tableData = []
 | 
			
		||||
      } else {
 | 
			
		||||
        if (this.currentMenu !== '瑞昌') {
 | 
			
		||||
          this.tableData = dataArr
 | 
			
		||||
        } else {
 | 
			
		||||
          this.tableData = dataArr.filter(function (item) {
 | 
			
		||||
            return item.type !== "BIPV"
 | 
			
		||||
          });
 | 
			
		||||
        }
 | 
			
		||||
      }
 | 
			
		||||
      this.listQuery.total = res.data.total
 | 
			
		||||
      if (this.listQuery.total > 0) {
 | 
			
		||||
        this.tableData.forEach(item => {
 | 
			
		||||
@@ -392,6 +502,14 @@ export default {
 | 
			
		||||
    },
 | 
			
		||||
    /** 导出按钮操作 */
 | 
			
		||||
    handleExport() {
 | 
			
		||||
 | 
			
		||||
      let fileName = "综合数据.xls";
 | 
			
		||||
      exportComprehensiveDataPage(this.listQuery)
 | 
			
		||||
        .then((response) => {
 | 
			
		||||
          this.$download.excel(response, fileName);
 | 
			
		||||
          this.$message.success("导出成功");
 | 
			
		||||
        })
 | 
			
		||||
        .catch(() => { });
 | 
			
		||||
      // this.$modal.confirm('是否确认导出工单数据?').then(() => {
 | 
			
		||||
      //   // 处理查询参数
 | 
			
		||||
      //   // let params = {...this.listQuery};
 | 
			
		||||
 
 | 
			
		||||
@@ -4,7 +4,7 @@
 | 
			
		||||
    <ButtonNav style="padding: 0;" :menus="['邯郸', '瑞昌']" :button-mode="true" @change="currentMenu = $event">
 | 
			
		||||
    </ButtonNav>
 | 
			
		||||
    <!-- </div> -->
 | 
			
		||||
    <div class="containerTop">
 | 
			
		||||
    <div class="search">
 | 
			
		||||
      <el-form :model="listQuery" :inline="true" ref="dataForm" class="blueTip">
 | 
			
		||||
        <el-form-item label="时间维度" prop="date">
 | 
			
		||||
          <el-select size="small" clearable v-model="listQuery.date" placeholder="请选择">
 | 
			
		||||
@@ -12,9 +12,9 @@
 | 
			
		||||
            </el-option>
 | 
			
		||||
          </el-select>
 | 
			
		||||
        </el-form-item>
 | 
			
		||||
        <el-form-item v-show="listQuery.date === 0 || listQuery.type === ''" label="时间范围" prop="reportTime">
 | 
			
		||||
        <el-form-item v-show="listQuery.date === 0 || listQuery.date === ''" label="时间范围" prop="reportTime">
 | 
			
		||||
          <el-date-picker size="small" clearable v-model="listQuery.reportTime" type="daterange" range-separator="至"
 | 
			
		||||
            start-placeholder="开始日期" value-format="yyyy-MM-dd HH:mm:ss" @change="changeDayTime" end-placeholder="结束日期">
 | 
			
		||||
            start-placeholder="开始日期" value-format="yyyy-MM-dd" @change="changeDayTime" end-placeholder="结束日期">
 | 
			
		||||
          </el-date-picker>
 | 
			
		||||
        </el-form-item>
 | 
			
		||||
        <el-form-item v-show="listQuery.date === 1" label="时间范围" prop="reportTime">
 | 
			
		||||
@@ -30,9 +30,8 @@
 | 
			
		||||
          </span> -->
 | 
			
		||||
        </el-form-item>
 | 
			
		||||
        <el-form-item v-show="listQuery.date === 2" label="时间值" prop="reportTime">
 | 
			
		||||
          <el-date-picker size="small" v-model="listQuery.reportTime" type="monthrange"
 | 
			
		||||
            value-format="yyyy-MM-DD HH:mm:ss" range-separator="至" start-placeholder="开始月份" end-placeholder="结束月份"
 | 
			
		||||
            @change="changeTime">
 | 
			
		||||
          <el-date-picker size="small" v-model="listQuery.reportTime" type="monthrange" value-format="yyyy-MM-DD"
 | 
			
		||||
            range-separator="至" start-placeholder="开始月份" end-placeholder="结束月份" @change="changeTime">
 | 
			
		||||
          </el-date-picker>
 | 
			
		||||
        </el-form-item>
 | 
			
		||||
        <el-form-item v-show="listQuery.date === 3" label="时间值" prop="reportTime">
 | 
			
		||||
@@ -64,11 +63,40 @@
 | 
			
		||||
          <!-- <el-button type="success" size="small" plain @click="addFactory">新增</el-button> -->
 | 
			
		||||
        </el-form-item>
 | 
			
		||||
      </el-form>
 | 
			
		||||
      <!-- <div class="smallTitle">产量转化效率</div> -->
 | 
			
		||||
 | 
			
		||||
      <!-- <bmSearchBar @getSearch="getSearch" @handleExport="handleExport" /> -->
 | 
			
		||||
      <bm-line-bar :chartHeight="chartHeight" :legendList="legendList" :chartMsg="chartMsg" :chartId="chartId"
 | 
			
		||||
        :chartNum="chartNum" />
 | 
			
		||||
    </div>
 | 
			
		||||
    <div class="containerTop">
 | 
			
		||||
      <el-row v-if="listQuery.date === 2">
 | 
			
		||||
        <el-col :span="16">
 | 
			
		||||
          <div class="blueTip">
 | 
			
		||||
            产量转化效率
 | 
			
		||||
          </div>
 | 
			
		||||
          <bm-line-bar :chartHeight="chartHeight" :legendList="legendList" :chartMsg="chartMsg" :chartId="chartId"
 | 
			
		||||
            :chartNum="chartNum" />
 | 
			
		||||
        </el-col>
 | 
			
		||||
        <el-col :span="8">
 | 
			
		||||
          <div class="blueTip">
 | 
			
		||||
            {{ title }}
 | 
			
		||||
          </div>
 | 
			
		||||
          <produce-line-bar-year-target :chartHeight="chartHeight" :legendList="legendList"
 | 
			
		||||
            :chartMsg="chartMsgYearTarget" :chartId=" 'yearData'" :chartNum="chartNum" />
 | 
			
		||||
        </el-col>
 | 
			
		||||
      </el-row>
 | 
			
		||||
      <el-row v-else>
 | 
			
		||||
        <!-- <el-col :span="24"> -->
 | 
			
		||||
        <div class="blueTip">
 | 
			
		||||
          产量转化效率
 | 
			
		||||
        </div>
 | 
			
		||||
        <bm-line-bar :chartHeight="chartHeight" :legendList="legendList" :chartMsg="chartMsg" :chartId="chartId"
 | 
			
		||||
          :chartNum="chartNum" />
 | 
			
		||||
        <!-- </el-col> -->
 | 
			
		||||
        <!-- <el-col :span="8">
 | 
			
		||||
          <div class="blueTip">
 | 
			
		||||
            {{ title }}
 | 
			
		||||
          </div>
 | 
			
		||||
          <produce-line-bar-year-target :chartHeight="chartHeight" :legendList="legendList"
 | 
			
		||||
            :chartMsg="chartMsgYearTarget" :chartId=" 'yearData'" :chartNum="chartNum" />
 | 
			
		||||
        </el-col> -->
 | 
			
		||||
      </el-row>
 | 
			
		||||
      <base-table :table-props="tableProps" :page="listQuery.current" :limit="listQuery.size" :table-data="tableData"
 | 
			
		||||
        :max-height="tableH" />
 | 
			
		||||
    </div>
 | 
			
		||||
@@ -79,58 +107,23 @@
 | 
			
		||||
</template>
 | 
			
		||||
 | 
			
		||||
<script>
 | 
			
		||||
import bmSearchBar from "./components/bmSearchBar.vue";
 | 
			
		||||
import BmLineBar from "./components/bmLineBar.vue";
 | 
			
		||||
import { getProduceTransData, exportProduceTransData } from '@/api/report';
 | 
			
		||||
import bmSearchBar from "./components/bmSearchBar";
 | 
			
		||||
import BmLineBar from "./components/produceLineBar.vue";
 | 
			
		||||
import produceLineBarYearTarget from "./components/produceLineBarYearTarget.vue";
 | 
			
		||||
 | 
			
		||||
import ButtonNav from '@/components/ButtonNav'
 | 
			
		||||
import moment from 'moment'
 | 
			
		||||
import { getProduceTransData } from '@/api/report';
 | 
			
		||||
const tableProps = [
 | 
			
		||||
  {
 | 
			
		||||
    prop: "factory",
 | 
			
		||||
    label: "玻璃类型",
 | 
			
		||||
    // filter: (val) => factoryList[val],
 | 
			
		||||
    minWidth: 200,
 | 
			
		||||
    showOverflowtooltip: true,
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
    prop: "name",
 | 
			
		||||
    label: "科目",
 | 
			
		||||
    minWidth: 120,
 | 
			
		||||
    showOverflowtooltip: true,
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
    prop: "unit",
 | 
			
		||||
    label: "单位",
 | 
			
		||||
    minWidth: 80,
 | 
			
		||||
    showOverflowtooltip: true,
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
    prop: "time1",
 | 
			
		||||
    label: "时间1",
 | 
			
		||||
    minWidth: 150,
 | 
			
		||||
    showOverflowtooltip: true,
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
    prop: "time2",
 | 
			
		||||
    label: "时间2",
 | 
			
		||||
    minWidth: 150,
 | 
			
		||||
    showOverflowtooltip: true,
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
    prop: "mubiao",
 | 
			
		||||
    label: "目标值",
 | 
			
		||||
    minWidth: 150,
 | 
			
		||||
    showOverflowtooltip: true,
 | 
			
		||||
  },
 | 
			
		||||
];
 | 
			
		||||
export default {
 | 
			
		||||
  name: "ChipYieldBM",
 | 
			
		||||
  data() {
 | 
			
		||||
    return {
 | 
			
		||||
      tableProps,
 | 
			
		||||
      otherProps: [],
 | 
			
		||||
      start: undefined,
 | 
			
		||||
      end: undefined,
 | 
			
		||||
      listQuery: {
 | 
			
		||||
        pageNo: 1,
 | 
			
		||||
        pageSize: 999,
 | 
			
		||||
        // size: 10,
 | 
			
		||||
        // current: 1,
 | 
			
		||||
        factorys: null,
 | 
			
		||||
@@ -158,67 +151,137 @@ export default {
 | 
			
		||||
          label: '年'
 | 
			
		||||
        }
 | 
			
		||||
      ],
 | 
			
		||||
      tableData: [
 | 
			
		||||
        { factory: "工厂1" },
 | 
			
		||||
        { factory: "工厂1" },
 | 
			
		||||
        { factory: "工厂1" },
 | 
			
		||||
        { factory: "工厂1" },
 | 
			
		||||
        { factory: "工厂1" },
 | 
			
		||||
        { factory: "工厂1" },
 | 
			
		||||
        { factory: "工厂1" },
 | 
			
		||||
        { factory: "工厂1" },
 | 
			
		||||
        { factory: "工厂1" },
 | 
			
		||||
        { factory: "工厂1" },
 | 
			
		||||
        { factory: "工厂1" },
 | 
			
		||||
        { factory: "工厂1" },
 | 
			
		||||
        { factory: "工厂1" },
 | 
			
		||||
        { factory: "工厂1" },
 | 
			
		||||
        { factory: "工厂1" },
 | 
			
		||||
        { factory: "工厂1" },
 | 
			
		||||
        { factory: "工厂1" },
 | 
			
		||||
        { factory: "工厂1" },
 | 
			
		||||
        { factory: "工厂1" },
 | 
			
		||||
        { factory: "工厂1" },
 | 
			
		||||
        { factory: "工厂1" },
 | 
			
		||||
        { factory: "工厂1" },
 | 
			
		||||
        { factory: "工厂1" },
 | 
			
		||||
        { factory: "工厂1" },
 | 
			
		||||
        { factory: "工厂1" },
 | 
			
		||||
        { factory: "工厂1" },
 | 
			
		||||
        { factory: "工厂1" },
 | 
			
		||||
      ],
 | 
			
		||||
      tableData: [],
 | 
			
		||||
      chartHeight: this.tableHeight(137) / 2 - 111,
 | 
			
		||||
      tableH: this.tableHeight(137) / 2 - 70,
 | 
			
		||||
      legendList: [
 | 
			
		||||
        { id: 1, name: "2024年4月目标值", type: 2, color: "#FFCE6A" },
 | 
			
		||||
        { id: 2, name: "2023年4月", type: 1, color: "#8EF0AB" },
 | 
			
		||||
        { id: 3, name: "2024年4月", type: 1, color: "#288AFF" },
 | 
			
		||||
        {
 | 
			
		||||
          id: 1, name: "综合良率", type: 2, color: "#FFCE6A"
 | 
			
		||||
        },
 | 
			
		||||
        {
 | 
			
		||||
          id: 2, name: "FTO投入", type: 1, color: "#8EF0AB"
 | 
			
		||||
        },
 | 
			
		||||
        { id: 3, name: "芯片产量", type: 1, color: "#288AFF" },
 | 
			
		||||
        {
 | 
			
		||||
          id: 3, name: "标准组件产量", type: 1, color: "#288AFF"
 | 
			
		||||
        },
 | 
			
		||||
      ],
 | 
			
		||||
      chartMsg: {
 | 
			
		||||
        color: ["#FFCE6A", "#8EF0AB", "#288AFF"],
 | 
			
		||||
        xData: ["成都", "邯郸", "瑞昌"],
 | 
			
		||||
        yName: "单位/%",
 | 
			
		||||
      chartMsgYearTarget: {
 | 
			
		||||
        color: ["#8EF0AB", "#288AFF", '#64BDFF', "#FFCE6A",],
 | 
			
		||||
        xData: [],
 | 
			
		||||
        // yName: "单位/%",
 | 
			
		||||
        yAxis: [
 | 
			
		||||
          {
 | 
			
		||||
            type: "value",
 | 
			
		||||
            name: "单位/片",
 | 
			
		||||
            nameTextStyle: {
 | 
			
		||||
              fontSize: 12,
 | 
			
		||||
              align: "right",
 | 
			
		||||
            },
 | 
			
		||||
            axisLabel: {},
 | 
			
		||||
          },
 | 
			
		||||
          {
 | 
			
		||||
            type: 'value',
 | 
			
		||||
            // inverse: true,
 | 
			
		||||
            name: "单位/%",
 | 
			
		||||
            nameTextStyle: {
 | 
			
		||||
              fontSize: 12,
 | 
			
		||||
              align: "right",
 | 
			
		||||
            },
 | 
			
		||||
            axisLabel: {},
 | 
			
		||||
          }
 | 
			
		||||
        ],
 | 
			
		||||
        series: [
 | 
			
		||||
          {
 | 
			
		||||
            name: "2024年4月目标值",
 | 
			
		||||
            name: "",
 | 
			
		||||
            // yAxisIndex: 0,
 | 
			
		||||
            data: [
 | 
			
		||||
              { name: "%", value: 85 },
 | 
			
		||||
              { name: "%", value: 85 },
 | 
			
		||||
              { name: "%", value: 85 },
 | 
			
		||||
            ],
 | 
			
		||||
            type: "line",
 | 
			
		||||
            symbol: "circle",
 | 
			
		||||
            symbolSize: 6,
 | 
			
		||||
              {
 | 
			
		||||
                value: 1,
 | 
			
		||||
                itemStyle: {
 | 
			
		||||
                  color: '#8EF0AB'
 | 
			
		||||
                }
 | 
			
		||||
              },
 | 
			
		||||
              {
 | 
			
		||||
                value: 2,
 | 
			
		||||
                itemStyle: {
 | 
			
		||||
                  color: '#288AFF'
 | 
			
		||||
                }
 | 
			
		||||
              },
 | 
			
		||||
              {
 | 
			
		||||
                value: 3,
 | 
			
		||||
                itemStyle: {
 | 
			
		||||
                  color: '#64BDFF'
 | 
			
		||||
                }
 | 
			
		||||
              },
 | 
			
		||||
              {
 | 
			
		||||
                value: 0,
 | 
			
		||||
                yAxisIndex: 1,
 | 
			
		||||
                itemStyle: {
 | 
			
		||||
                  color: '#FFCE6A'
 | 
			
		||||
                }
 | 
			
		||||
              }],
 | 
			
		||||
            type: "bar",
 | 
			
		||||
            barWidth: 20,
 | 
			
		||||
            label: {
 | 
			
		||||
              show: true,
 | 
			
		||||
              color: "#FFAE17",
 | 
			
		||||
              position: [-18, -16],
 | 
			
		||||
              color: "#68C483",
 | 
			
		||||
              formatter: function (params) {
 | 
			
		||||
                return params.value.toFixed(2) + "%";
 | 
			
		||||
                return params.value + "片";
 | 
			
		||||
              },
 | 
			
		||||
            },
 | 
			
		||||
          },
 | 
			
		||||
          {
 | 
			
		||||
            name: "2023年4月",
 | 
			
		||||
            name: '销量折线图',
 | 
			
		||||
            type: 'bar',
 | 
			
		||||
            data: [0, 0, 0,
 | 
			
		||||
              {
 | 
			
		||||
                value: 5,
 | 
			
		||||
                itemStyle: {
 | 
			
		||||
                  color: '#FFCE6A'
 | 
			
		||||
                }
 | 
			
		||||
              }],
 | 
			
		||||
            barWith: "40%",
 | 
			
		||||
            label: {
 | 
			
		||||
              show: true,
 | 
			
		||||
              position: "top",
 | 
			
		||||
              formatter: "{c}%"
 | 
			
		||||
            },
 | 
			
		||||
            lineStyle: {
 | 
			
		||||
              color: "#ffb122"
 | 
			
		||||
            },
 | 
			
		||||
            yAxisIndex: 1
 | 
			
		||||
          }
 | 
			
		||||
        ],
 | 
			
		||||
      },
 | 
			
		||||
      chartMsg: {
 | 
			
		||||
        color: ["#8EF0AB", "#288AFF", '#64BDFF', "#FFCE6A",],
 | 
			
		||||
        xData: [],
 | 
			
		||||
        yName: "",
 | 
			
		||||
        yAxis: [
 | 
			
		||||
          {
 | 
			
		||||
            type: "value",
 | 
			
		||||
          name: "单位/片",
 | 
			
		||||
            nameTextStyle: {
 | 
			
		||||
              fontSize: 12,
 | 
			
		||||
              align: "right",
 | 
			
		||||
            },
 | 
			
		||||
            axisLabel: {},
 | 
			
		||||
          },
 | 
			
		||||
          {
 | 
			
		||||
            type: "value",
 | 
			
		||||
            name: "单位/%",
 | 
			
		||||
            nameTextStyle: {
 | 
			
		||||
              fontSize: 12,
 | 
			
		||||
              align: "right",
 | 
			
		||||
            },
 | 
			
		||||
            axisLabel: {},
 | 
			
		||||
          }
 | 
			
		||||
        ],
 | 
			
		||||
        series: [
 | 
			
		||||
          {
 | 
			
		||||
            name: "FTO投入",
 | 
			
		||||
            data: [
 | 
			
		||||
              { name: "%", value: 57.5 },
 | 
			
		||||
              { name: "%", value: 21.66 },
 | 
			
		||||
@@ -236,7 +299,7 @@ export default {
 | 
			
		||||
            },
 | 
			
		||||
          },
 | 
			
		||||
          {
 | 
			
		||||
            name: "2024年4月",
 | 
			
		||||
            name: "芯片产量",
 | 
			
		||||
            data: [
 | 
			
		||||
              { name: "%", value: 23.33 },
 | 
			
		||||
              { name: "%", value: 7.02 },
 | 
			
		||||
@@ -253,6 +316,44 @@ export default {
 | 
			
		||||
              },
 | 
			
		||||
            },
 | 
			
		||||
          },
 | 
			
		||||
          {
 | 
			
		||||
            name: "标准组件产量",
 | 
			
		||||
            data: [
 | 
			
		||||
              { name: "%", value: 23.33 },
 | 
			
		||||
              { name: "%", value: 7.02 },
 | 
			
		||||
              { name: "%", value: 80.2 },
 | 
			
		||||
            ],
 | 
			
		||||
            type: "bar",
 | 
			
		||||
            barWidth: 20,
 | 
			
		||||
            label: {
 | 
			
		||||
              show: true,
 | 
			
		||||
              position: [0, -16],
 | 
			
		||||
              color: "#64BDFF",
 | 
			
		||||
              formatter: function (params) {
 | 
			
		||||
                return params.value.toFixed(2) + "%";
 | 
			
		||||
              },
 | 
			
		||||
            },
 | 
			
		||||
          },
 | 
			
		||||
          {
 | 
			
		||||
            name: "综合良率",
 | 
			
		||||
            data: [
 | 
			
		||||
              { name: "%", value: 85 },
 | 
			
		||||
              { name: "%", value: 85 },
 | 
			
		||||
              { name: "%", value: 85 },
 | 
			
		||||
            ],
 | 
			
		||||
            type: "line",
 | 
			
		||||
            symbol: "circle",
 | 
			
		||||
            // barWidth: 20,
 | 
			
		||||
            symbolSize: 6,
 | 
			
		||||
            yAxisIndex: 1,
 | 
			
		||||
            label: {
 | 
			
		||||
              show: true,
 | 
			
		||||
              color: "#FFAE17",
 | 
			
		||||
              formatter: function (params) {
 | 
			
		||||
                return params.value.toFixed(2) + "%";
 | 
			
		||||
              },
 | 
			
		||||
            },
 | 
			
		||||
          },
 | 
			
		||||
        ],
 | 
			
		||||
      },
 | 
			
		||||
      chartId: "chipYieldBMChart",
 | 
			
		||||
@@ -262,9 +363,35 @@ export default {
 | 
			
		||||
  components: {
 | 
			
		||||
    bmSearchBar,
 | 
			
		||||
    BmLineBar,
 | 
			
		||||
    produceLineBarYearTarget,
 | 
			
		||||
    ButtonNav
 | 
			
		||||
  },
 | 
			
		||||
  computed: {
 | 
			
		||||
    tableProps() {
 | 
			
		||||
      return [
 | 
			
		||||
        {
 | 
			
		||||
          prop: "factory",
 | 
			
		||||
          label: "工厂名称",
 | 
			
		||||
          // filter: (val) => factoryList[val],
 | 
			
		||||
          minWidth: 200,
 | 
			
		||||
          showOverflowtooltip: true,
 | 
			
		||||
        },
 | 
			
		||||
        {
 | 
			
		||||
          prop: "item",
 | 
			
		||||
          label: "科目",
 | 
			
		||||
          // filter: (val) => factoryList[val],
 | 
			
		||||
          minWidth: 200,
 | 
			
		||||
          showOverflowtooltip: true,
 | 
			
		||||
        },
 | 
			
		||||
        {
 | 
			
		||||
          prop: "unit",
 | 
			
		||||
          label: "单位",
 | 
			
		||||
          minWidth: 120,
 | 
			
		||||
          showOverflowtooltip: true,
 | 
			
		||||
        },
 | 
			
		||||
        ...this.otherProps
 | 
			
		||||
      ]
 | 
			
		||||
    },
 | 
			
		||||
    weekNum() {
 | 
			
		||||
      return Math.round((this.end - this.start) / (24 * 60 * 60 * 1000 * 7)) + 1
 | 
			
		||||
    },
 | 
			
		||||
@@ -297,7 +424,7 @@ export default {
 | 
			
		||||
  mounted() {
 | 
			
		||||
    // this.getOverView()
 | 
			
		||||
    const currentMonth = new Date()
 | 
			
		||||
    this.listQuery.reportTime = [moment(currentMonth).format('yyyy-MM-DD HH:mm:ss'), moment(currentMonth).format('yyyy-MM-DD HH:mm:ss')]
 | 
			
		||||
    this.listQuery.reportTime = [moment(currentMonth).format('yyyy-MM-DD'), moment(currentMonth).format('yyyy-MM-DD')]
 | 
			
		||||
    this.changeTime()
 | 
			
		||||
    this.getDataList()
 | 
			
		||||
  },
 | 
			
		||||
@@ -355,8 +482,8 @@ export default {
 | 
			
		||||
    },
 | 
			
		||||
    onValueChange(picker, k) { // 选中近k周后触发的操作
 | 
			
		||||
      if (this.start && this.end) {
 | 
			
		||||
        this.date1 = moment(this.start.getTime() - 24 * 60 * 60 * 1000).format('YYYY-MM-DD HH:mm:ss')
 | 
			
		||||
        this.date2 = moment(this.end.getTime() + 5 * 24 * 60 * 60 * 1000).format('YYYY-MM-DD HH:mm:ss')
 | 
			
		||||
        this.date1 = moment(this.start.getTime() - 24 * 60 * 60 * 1000).format('YYYY-MM-DD')
 | 
			
		||||
        this.date2 = moment(this.end.getTime() + 5 * 24 * 60 * 60 * 1000).format('YYYY-MM-DD')
 | 
			
		||||
        const numDays = (new Date(this.date2).getTime() - new Date(this.date1).getTime()) / (24 * 3600 * 1000);
 | 
			
		||||
        if (numDays > 168) {
 | 
			
		||||
          console.log(numDays)
 | 
			
		||||
@@ -408,20 +535,177 @@ export default {
 | 
			
		||||
      });
 | 
			
		||||
    },
 | 
			
		||||
    async getDataList() {
 | 
			
		||||
      this.otherProps = []
 | 
			
		||||
      this.chartMsg.xData = []
 | 
			
		||||
      console.log(this.listQuery);
 | 
			
		||||
      if (this.listQuery.date == 3) {
 | 
			
		||||
        this.listQuery.beginTime = this.listQuery.reportTime[0] + '-01-01 00:00:00'
 | 
			
		||||
        this.listQuery.endTime = this.listQuery.reportTime[1] + '-12-31 23:59:59'
 | 
			
		||||
      if (this.listQuery.type == 3) {
 | 
			
		||||
        this.listQuery.beginTime = this.listQuery.reportTime[0]
 | 
			
		||||
        this.listQuery.endTime = this.listQuery.reportTime[1]
 | 
			
		||||
      }
 | 
			
		||||
      let arr = []
 | 
			
		||||
      this.currentMenu === '邯郸' ? arr.push(1) : arr.push(2)
 | 
			
		||||
      this.currentMenu === '邯郸' ? arr.push(1) : arr.push(0)
 | 
			
		||||
      this.listQuery.factorys = arr
 | 
			
		||||
      const res = await getProduceTransData(this.listQuery)
 | 
			
		||||
      this.tableData = res.data.list
 | 
			
		||||
      let dataArr = [{
 | 
			
		||||
        factory: null,
 | 
			
		||||
        item: '芯片总功率',
 | 
			
		||||
        unit: 'MW'
 | 
			
		||||
      },
 | 
			
		||||
      {
 | 
			
		||||
        factory: null,
 | 
			
		||||
        item: '标准组件总功率',
 | 
			
		||||
        unit: 'MW'
 | 
			
		||||
      },
 | 
			
		||||
      {
 | 
			
		||||
        factory: null,
 | 
			
		||||
        item: '转化效率',
 | 
			
		||||
        unit: '%'
 | 
			
		||||
      }
 | 
			
		||||
      ]
 | 
			
		||||
      res.data.forEach(element => {
 | 
			
		||||
        element.list.forEach((ele, index) => {
 | 
			
		||||
          let i = index + 1
 | 
			
		||||
          this.chartMsg.xData.push(ele.reportTimep)
 | 
			
		||||
          this.otherProps.push({
 | 
			
		||||
            label: ele.reportTimep,
 | 
			
		||||
            props: 'value' + i
 | 
			
		||||
          })
 | 
			
		||||
        })
 | 
			
		||||
      });
 | 
			
		||||
      console.log(this.otherProps)
 | 
			
		||||
      res.data.forEach((ele, index) => {
 | 
			
		||||
        let i = index + 1
 | 
			
		||||
        let m = 'value' + i
 | 
			
		||||
        ele.list.forEach((item, index) => {
 | 
			
		||||
            let i = index + 1
 | 
			
		||||
            let m = 'value' + i
 | 
			
		||||
            // ele.productionSituationDataVOList.forEach((item) => {
 | 
			
		||||
            dataArr[0]['' + m + ''] = item.chipTotalPowers
 | 
			
		||||
            dataArr[0].factory = ele.factory === 1 ? '邯郸' : '瑞昌'
 | 
			
		||||
            dataArr[1].factory = ele.factory === 1 ? '邯郸' : '瑞昌'
 | 
			
		||||
            dataArr[2].factory = ele.factory === 1 ? '邯郸' : '瑞昌'
 | 
			
		||||
            dataArr[3].factory = ele.factory === 1 ? '邯郸' : '瑞昌'
 | 
			
		||||
            dataArr[1]['' + m + ''] = ele.scTotalPowers
 | 
			
		||||
            dataArr[2]['' + m + ''] = ele.conversionEfficiency
 | 
			
		||||
            // dataArr[3]['' + m + ''] = ele.comprehensiveYieldRate
 | 
			
		||||
            // })
 | 
			
		||||
            // ele.titleValue
 | 
			
		||||
            // .push({
 | 
			
		||||
            //   label: ele.titleValue,
 | 
			
		||||
            //   props: 'value' + index + 1,
 | 
			
		||||
            // })
 | 
			
		||||
          })
 | 
			
		||||
        // ele.productionSituationDataVOList.forEach((item) => {
 | 
			
		||||
        // dataArr[0]['' + m + ''] = item.chipTotalPowers
 | 
			
		||||
        // dataArr[0].factory = ele.factory === 1 ? '邯郸' : '瑞昌'
 | 
			
		||||
        // dataArr[1].factory = ele.factory === 1 ? '邯郸' : '瑞昌'
 | 
			
		||||
        // dataArr[2].factory = ele.factory === 1 ? '邯郸' : '瑞昌'
 | 
			
		||||
        // dataArr[3].factory = ele.factory === 1 ? '邯郸' : '瑞昌'
 | 
			
		||||
        // dataArr[1]['' + m + ''] = ele.scTotalPowers
 | 
			
		||||
        // dataArr[2]['' + m + ''] = ele.conversionEfficiency
 | 
			
		||||
        // dataArr[3]['' + m + ''] = ele.comprehensiveYieldRate
 | 
			
		||||
        // })
 | 
			
		||||
        // ele.titleValue
 | 
			
		||||
        // .push({
 | 
			
		||||
        //   label: ele.titleValue,
 | 
			
		||||
        //   props: 'value' + index + 1,
 | 
			
		||||
        // })
 | 
			
		||||
      })
 | 
			
		||||
      for (let i in dataArr[0]) {
 | 
			
		||||
        this.chartMsg.series[0].name = dataArr[0]['item']
 | 
			
		||||
        if (i.search('value') === 0) {
 | 
			
		||||
          this.chartMsg.series[0].data.push({
 | 
			
		||||
            name: dataArr[0]['item'],
 | 
			
		||||
            name: dataArr[0][i]
 | 
			
		||||
          })
 | 
			
		||||
        }
 | 
			
		||||
      }
 | 
			
		||||
      for (let i in dataArr[1]) {
 | 
			
		||||
        this.chartMsg.series[1].name = dataArr[1]['item']
 | 
			
		||||
        if (i.search('value') === 0) {
 | 
			
		||||
          this.chartMsg.series[1].data.push({
 | 
			
		||||
            name: dataArr[1]['item'],
 | 
			
		||||
            name: dataArr[1][i]
 | 
			
		||||
          })
 | 
			
		||||
        }
 | 
			
		||||
      }
 | 
			
		||||
      for (let i in dataArr[2]) {
 | 
			
		||||
        this.chartMsg.series[2].name = dataArr[2]['item']
 | 
			
		||||
        if (i.search('value') === 0) {
 | 
			
		||||
          this.chartMsg.series[2].data.push({
 | 
			
		||||
            name: dataArr[2]['item'],
 | 
			
		||||
            name: dataArr[2][i]
 | 
			
		||||
          })
 | 
			
		||||
        }
 | 
			
		||||
      }
 | 
			
		||||
      for (let i in dataArr[3]) {
 | 
			
		||||
        this.chartMsg.series[3].name = dataArr[3]['item']
 | 
			
		||||
        if (i.search('value') === 0) {
 | 
			
		||||
          this.chartMsg.series[3].data.push({
 | 
			
		||||
            name: dataArr[3]['item'],
 | 
			
		||||
            name: dataArr[3][i]
 | 
			
		||||
          })
 | 
			
		||||
        }
 | 
			
		||||
      }
 | 
			
		||||
 | 
			
		||||
      // this.tableProps = otherProps
 | 
			
		||||
      // res.data.list.forEach((ele) => {
 | 
			
		||||
      //   console.log(ele);
 | 
			
		||||
      //   ele.productionSituationDataVOList.forEach((item) => {
 | 
			
		||||
      //     let obj = {
 | 
			
		||||
      //       bipvProductOutput: item.bipvProductOutput,
 | 
			
		||||
      //       chipYield: item.chipYield,
 | 
			
		||||
      //       componentYield: item.componentYield,
 | 
			
		||||
      //       factory: item.factory,
 | 
			
		||||
      //       ftoInput: item.ftoInput,
 | 
			
		||||
      //       titleValue:ele.titleValue
 | 
			
		||||
      //     }
 | 
			
		||||
      //     dataArr.push(obj)
 | 
			
		||||
      //   })
 | 
			
		||||
      // })
 | 
			
		||||
      for (let i in dataArr[0]) {
 | 
			
		||||
        this.chartMsg.series[0].name = dataArr[0]['item']
 | 
			
		||||
        if (i.search('value') === 0) {
 | 
			
		||||
          this.chartMsg.series[0].data.push({
 | 
			
		||||
            name: dataArr[0]['item'],
 | 
			
		||||
            value: dataArr[0][i]
 | 
			
		||||
          })
 | 
			
		||||
        }
 | 
			
		||||
      }
 | 
			
		||||
      for (let i in dataArr[1]) {
 | 
			
		||||
        this.chartMsg.series[1].name = dataArr[1]['item']
 | 
			
		||||
        if (i.search('value') === 0) {
 | 
			
		||||
          this.chartMsg.series[1].data.push({
 | 
			
		||||
            name: dataArr[1]['item'],
 | 
			
		||||
            value: dataArr[1][i]
 | 
			
		||||
          })
 | 
			
		||||
        }
 | 
			
		||||
      }
 | 
			
		||||
      for (let i in dataArr[2]) {
 | 
			
		||||
        this.chartMsg.series[2].name = dataArr[2]['item']
 | 
			
		||||
        if (i.search('value') === 0) {
 | 
			
		||||
          this.chartMsg.series[2].data.push({
 | 
			
		||||
            name: dataArr[2]['item'],
 | 
			
		||||
            value: dataArr[2][i]
 | 
			
		||||
          })
 | 
			
		||||
        }
 | 
			
		||||
      }
 | 
			
		||||
      // for (let i in dataArr[3]) {
 | 
			
		||||
      //   this.chartMsg.series[3].name = dataArr[3]['item']
 | 
			
		||||
      //   if (i.search('value') === 0) {
 | 
			
		||||
      //     this.chartMsg.series[3].data.push({
 | 
			
		||||
      //       name: dataArr[3]['item'],
 | 
			
		||||
      //       name: dataArr[3][i]
 | 
			
		||||
      //     })
 | 
			
		||||
      //   }
 | 
			
		||||
      // }
 | 
			
		||||
      console.log(dataArr)
 | 
			
		||||
      this.tableData = dataArr
 | 
			
		||||
      // this.tableProps.push()
 | 
			
		||||
      this.listQuery.total = res.data.total
 | 
			
		||||
      if (this.listQuery.total > 0) {
 | 
			
		||||
        this.tableData.forEach(item => {
 | 
			
		||||
          item.startTime = item.beginTime ? item.beginTime[0] + '-' + item.beginTime[1] + '-' + item.beginTime[2] : '--'
 | 
			
		||||
          item.beginTime = item.beginTime ? item.beginTime[0] + '-' + item.beginTime[1] + '-' + item.beginTime[2] : '--'
 | 
			
		||||
          item.endTime = item.endTime ? item.endTime[0] + '-' + item.endTime[1] + '-' + item.endTime[2] : '--'
 | 
			
		||||
        })
 | 
			
		||||
      }
 | 
			
		||||
@@ -438,6 +722,13 @@ export default {
 | 
			
		||||
      console.log("=========================");
 | 
			
		||||
    },
 | 
			
		||||
    handleExport() {
 | 
			
		||||
      let fileName = "产量转化效率.xls";
 | 
			
		||||
      exportProduceTransData(this.listQuery)
 | 
			
		||||
        .then((response) => {
 | 
			
		||||
          this.$download.excel(response, fileName);
 | 
			
		||||
          this.$message.success("导出成功");
 | 
			
		||||
        })
 | 
			
		||||
        .catch(() => { });
 | 
			
		||||
      console.log("导出");
 | 
			
		||||
    },
 | 
			
		||||
  },
 | 
			
		||||
@@ -450,9 +741,10 @@ export default {
 | 
			
		||||
  background-color: #fff;
 | 
			
		||||
  border-radius: 8px;
 | 
			
		||||
  padding: 16px 16px 0 16px;
 | 
			
		||||
  margin-bottom: 8px;
 | 
			
		||||
  margin: 8px 0px;
 | 
			
		||||
}
 | 
			
		||||
.containerTop{
 | 
			
		||||
 | 
			
		||||
.containerTop {
 | 
			
		||||
  height: calc((100vh - 170px));
 | 
			
		||||
  background-color: #fff;
 | 
			
		||||
  border-radius: 8px;
 | 
			
		||||
@@ -469,6 +761,7 @@ export default {
 | 
			
		||||
  margin-right: 8PX;
 | 
			
		||||
  margin-top: 8px;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
.containerTop {
 | 
			
		||||
  margin-top: 8px;
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
										
											
												Filskillnaden har hållits tillbaka eftersom den är för stor
												Load Diff
											
										
									
								
							
										
											
												Filskillnaden har hållits tillbaka eftersom den är för stor
												Load Diff
											
										
									
								
							@@ -4,71 +4,86 @@
 | 
			
		||||
    <ButtonNav style="padding: 0;" :menus="['邯郸', '瑞昌']" :button-mode="true" @change="currentMenu = $event">
 | 
			
		||||
    </ButtonNav>
 | 
			
		||||
    <!-- </div> -->
 | 
			
		||||
    <div class="containerTop">
 | 
			
		||||
    <div class="search">
 | 
			
		||||
      <el-form :model="listQuery" :inline="true" ref="dataForm" class="blueTip">
 | 
			
		||||
        <el-form-item label="时间维度" prop="date">
 | 
			
		||||
        <el-form-item label="时间维度" prop="type">
 | 
			
		||||
          <el-select size="small" clearable v-model="listQuery.type" placeholder="请选择">
 | 
			
		||||
            <el-option v-for="item in timeList" :key="item.value" :label="item.label" :value="item.value">
 | 
			
		||||
            </el-option>
 | 
			
		||||
          </el-select>
 | 
			
		||||
        </el-form-item>
 | 
			
		||||
        <el-form-item v-show="listQuery.type === 0 || listQuery.type === ''" label="时间范围" prop="reportTime">
 | 
			
		||||
          <el-date-picker size="small" clearable v-model="listQuery.reportTime" type="daterange" range-separator="至"
 | 
			
		||||
            start-placeholder="开始日期" value-format="yyyy-MM-dd HH:mm:ss" @change="changeDayTime" end-placeholder="结束日期">
 | 
			
		||||
          <el-date-picker size="small" clearable v-model="listQuery.reportTime" type="datetimerange" range-separator="至"
 | 
			
		||||
            start-placeholder="开始日期" value-format="yyyy-MM-dd" format="yyyy-MM-dd" @change="changeDayTime"
 | 
			
		||||
            end-placeholder="结束日期">
 | 
			
		||||
          </el-date-picker>
 | 
			
		||||
        </el-form-item>
 | 
			
		||||
        <el-form-item v-show="listQuery.type === 1" label="时间范围" prop="reportTime">
 | 
			
		||||
          <el-date-picker size="small" clearable v-model="start" type="week" format="yyyy 第 WW 周" placeholder="选择周"
 | 
			
		||||
            style="width: 180px" @change="onValueChange">
 | 
			
		||||
          <el-date-picker size="small" clearable v-model="listQuery.start" type="week" format="yyyy 第 WW 周"
 | 
			
		||||
            placeholder="选择周" style="width: 180px" @change="onValueChange">
 | 
			
		||||
          </el-date-picker>
 | 
			
		||||
          至
 | 
			
		||||
          <el-date-picker size="small" clearable v-model="end" type="week" format="yyyy 第 WW 周" placeholder="选择周"
 | 
			
		||||
            style="width: 180px" @change="onValueChange">
 | 
			
		||||
          <el-date-picker size="small" clearable v-model="listQuery.end" type="week" format="yyyy 第 WW 周"
 | 
			
		||||
            placeholder="选择周" style="width: 180px" @change="onValueChange">
 | 
			
		||||
          </el-date-picker>
 | 
			
		||||
          <!-- <span v-if="start && end" style="margin-left: 10px">
 | 
			
		||||
          <!-- <span v-if="listQuery.start && listQuery.end" style="margin-left: 10px">
 | 
			
		||||
            {{ date1 }} 至 {{ date2 }},共 {{ weekNum }} 周
 | 
			
		||||
          </span> -->
 | 
			
		||||
        </el-form-item>
 | 
			
		||||
        <el-form-item v-show="listQuery.type === 2" label="时间值" prop="reportTime">
 | 
			
		||||
          <el-date-picker size="small" v-model="listQuery.reportTime" type="monthrange"
 | 
			
		||||
            value-format="yyyy-MM-DD HH:mm:ss" range-separator="至" start-placeholder="开始月份" end-placeholder="结束月份"
 | 
			
		||||
        <el-form-item v-show="listQuery.type === 2" label="时间范围" prop="reportTime">
 | 
			
		||||
          <el-date-picker size="small" clearable v-model="listQuery.reportTime" type="monthrange"
 | 
			
		||||
            value-format="yyyy-MM-dd" range-separator="至" start-placeholder="开始月份" end-placeholder="结束月份"
 | 
			
		||||
            @change="changeTime">
 | 
			
		||||
          </el-date-picker>
 | 
			
		||||
        </el-form-item>
 | 
			
		||||
        <el-form-item v-show="listQuery.type === 3" label="时间值" prop="reportTime">
 | 
			
		||||
          <el-date-picker size="small" clearable v-model="listQuery.reportTime[0]" value-format="yyyy" type="year"
 | 
			
		||||
        <el-form-item v-show="listQuery.type === 3" label="时间范围" prop="reportTime">
 | 
			
		||||
          <el-date-picker size="small" clearable v-model="listQuery.start" value-format="yyyy-MM-dd" type="year"
 | 
			
		||||
            placeholder="开始时间">
 | 
			
		||||
          </el-date-picker>
 | 
			
		||||
          ~
 | 
			
		||||
          <el-date-picker size="small" clearable v-model="listQuery.reportTime[1]" value-format="yyyy" type="year"
 | 
			
		||||
          <el-date-picker size="small" clearable v-model="listQuery.end" value-format="yyyy-MM-dd" type="year"
 | 
			
		||||
            placeholder="结束时间" @change="getYear">
 | 
			
		||||
          </el-date-picker>
 | 
			
		||||
        </el-form-item>
 | 
			
		||||
        <!-- <el-form-item label="玻璃类型" prop="type">
 | 
			
		||||
          <el-select v-model="listQuery.type" placeholder="请选择玻璃类型">
 | 
			
		||||
            <el-option v-for="item in typeList" :key="item.id" :label="item.name" :value="item.id">
 | 
			
		||||
            </el-option>
 | 
			
		||||
          </el-select>
 | 
			
		||||
        </el-form-item> -->
 | 
			
		||||
        <!-- <el-form-item label="玻璃类型" prop="type">
 | 
			
		||||
          <el-select v-model="listQuery.type" placeholder="请选择玻璃类型">
 | 
			
		||||
            <el-option v-for="item in typeList" :key="item.id" :label="item.name" :value="item.id">
 | 
			
		||||
            </el-option>
 | 
			
		||||
          </el-select>
 | 
			
		||||
        </el-form-item> -->
 | 
			
		||||
        <el-form-item>
 | 
			
		||||
          <el-button type="primary" size="small" @click="getDataList">查询</el-button>
 | 
			
		||||
          <el-divider direction="vertical"></el-divider>
 | 
			
		||||
          <!-- <el-button type="primary" size="small" plain @click="handleImport">导入</el-button> -->
 | 
			
		||||
          <el-button type="primary" size="small" plain @click="handleExport">导出</el-button>
 | 
			
		||||
          <!-- <el-button type="success" size="small" plain @click="addFactory">新增</el-button> -->
 | 
			
		||||
        </el-form-item>
 | 
			
		||||
      </el-form>
 | 
			
		||||
      <!-- <div class="smallTitle">产量转化效率</div> -->
 | 
			
		||||
 | 
			
		||||
      <!-- <bmSearchBar @getSearch="getSearch" @handleExport="handleExport" /> -->
 | 
			
		||||
      <bm-line-bar :chartHeight="chartHeight" :legendList="legendList" :chartMsg="chartMsg" :chartId="chartId"
 | 
			
		||||
        :chartNum="chartNum" />
 | 
			
		||||
    </div>
 | 
			
		||||
    <div class="containerTop">
 | 
			
		||||
      <el-row v-if="listQuery.type === 2">
 | 
			
		||||
        <el-col :span="16">
 | 
			
		||||
          <div class="blueTip">
 | 
			
		||||
            产量及良率对比
 | 
			
		||||
          </div>
 | 
			
		||||
          <bm-line-bar :chartHeight="chartHeight" :legendList="legendList" :chartMsg="chartMsg" :chartId="chartId"
 | 
			
		||||
            :chartNum="chartNum" />
 | 
			
		||||
        </el-col>
 | 
			
		||||
        <el-col :span="8">
 | 
			
		||||
          <div class="blueTip">
 | 
			
		||||
            {{ title }}
 | 
			
		||||
          </div>
 | 
			
		||||
          <produce-line-bar-year-target :chartHeight="chartHeight" :legendList="legendList"
 | 
			
		||||
            :chartMsg="chartMsgYearTarget" :chartId=" 'yearData'" :chartNum="chartNum" />
 | 
			
		||||
        </el-col>
 | 
			
		||||
      </el-row>
 | 
			
		||||
      <el-row v-else>
 | 
			
		||||
        <!-- <el-col :span="24"> -->
 | 
			
		||||
        <div class="blueTip">
 | 
			
		||||
          产量及良率对比
 | 
			
		||||
        </div>
 | 
			
		||||
        <bm-line-bar :chartHeight="chartHeight" :legendList="legendList" :chartMsg="chartMsg" :chartId="chartId"
 | 
			
		||||
          :chartNum="chartNum" />
 | 
			
		||||
        <!-- </el-col> -->
 | 
			
		||||
        <!-- <el-col :span="8">
 | 
			
		||||
          <div class="blueTip">
 | 
			
		||||
            {{ title }}
 | 
			
		||||
          </div>
 | 
			
		||||
          <produce-line-bar-year-target :chartHeight="chartHeight" :legendList="legendList"
 | 
			
		||||
            :chartMsg="chartMsgYearTarget" :chartId=" 'yearData'" :chartNum="chartNum" />
 | 
			
		||||
        </el-col> -->
 | 
			
		||||
      </el-row>
 | 
			
		||||
      <base-table :table-props="tableProps" :page="listQuery.current" :limit="listQuery.size" :table-data="tableData"
 | 
			
		||||
        :max-height="tableH" />
 | 
			
		||||
    </div>
 | 
			
		||||
@@ -79,60 +94,28 @@
 | 
			
		||||
</template>
 | 
			
		||||
 | 
			
		||||
<script>
 | 
			
		||||
import bmSearchBar from "./components/bmSearchBar.vue";
 | 
			
		||||
import BmLineBar from "./components/bmLineBar.vue";
 | 
			
		||||
import { getProductionYieldSituationMWData, exportProductionYieldSituationMWData } from '@/api/report';
 | 
			
		||||
import bmSearchBar from "./components/bmSearchBar";
 | 
			
		||||
import BmLineBar from "./components/produceLineBar.vue";
 | 
			
		||||
import produceLineBarYearTarget from "./components/produceLineBarYearTarget.vue";
 | 
			
		||||
import ButtonNav from '@/components/ButtonNav'
 | 
			
		||||
import moment from 'moment'
 | 
			
		||||
const tableProps = [
 | 
			
		||||
  {
 | 
			
		||||
    prop: "factory",
 | 
			
		||||
    label: "玻璃类型",
 | 
			
		||||
    // filter: (val) => factoryList[val],
 | 
			
		||||
    minWidth: 200,
 | 
			
		||||
    showOverflowtooltip: true,
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
    prop: "name",
 | 
			
		||||
    label: "科目",
 | 
			
		||||
    minWidth: 120,
 | 
			
		||||
    showOverflowtooltip: true,
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
    prop: "unit",
 | 
			
		||||
    label: "单位",
 | 
			
		||||
    minWidth: 80,
 | 
			
		||||
    showOverflowtooltip: true,
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
    prop: "time1",
 | 
			
		||||
    label: "时间1",
 | 
			
		||||
    minWidth: 150,
 | 
			
		||||
    showOverflowtooltip: true,
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
    prop: "time2",
 | 
			
		||||
    label: "时间2",
 | 
			
		||||
    minWidth: 150,
 | 
			
		||||
    showOverflowtooltip: true,
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
    prop: "mubiao",
 | 
			
		||||
    label: "目标值",
 | 
			
		||||
    minWidth: 150,
 | 
			
		||||
    showOverflowtooltip: true,
 | 
			
		||||
  },
 | 
			
		||||
];
 | 
			
		||||
export default {
 | 
			
		||||
  name: "ChipYieldBM",
 | 
			
		||||
  data() {
 | 
			
		||||
    return {
 | 
			
		||||
      tableProps,
 | 
			
		||||
      otherProps: [],
 | 
			
		||||
      start: undefined,
 | 
			
		||||
      end: undefined,
 | 
			
		||||
      title: '',
 | 
			
		||||
      listQuery: {
 | 
			
		||||
        pageNo: 1,
 | 
			
		||||
        pageSize: 999,
 | 
			
		||||
        // size: 10,
 | 
			
		||||
        // current: 1,
 | 
			
		||||
        factory: null,
 | 
			
		||||
        start: undefined,
 | 
			
		||||
        end: undefined,
 | 
			
		||||
        // total: 0,
 | 
			
		||||
        type: 2,
 | 
			
		||||
        startDate: undefined,
 | 
			
		||||
@@ -157,67 +140,136 @@ export default {
 | 
			
		||||
          label: '年'
 | 
			
		||||
        }
 | 
			
		||||
      ],
 | 
			
		||||
      tableData: [
 | 
			
		||||
        { factory: "工厂1" },
 | 
			
		||||
        { factory: "工厂1" },
 | 
			
		||||
        { factory: "工厂1" },
 | 
			
		||||
        { factory: "工厂1" },
 | 
			
		||||
        { factory: "工厂1" },
 | 
			
		||||
        { factory: "工厂1" },
 | 
			
		||||
        { factory: "工厂1" },
 | 
			
		||||
        { factory: "工厂1" },
 | 
			
		||||
        { factory: "工厂1" },
 | 
			
		||||
        { factory: "工厂1" },
 | 
			
		||||
        { factory: "工厂1" },
 | 
			
		||||
        { factory: "工厂1" },
 | 
			
		||||
        { factory: "工厂1" },
 | 
			
		||||
        { factory: "工厂1" },
 | 
			
		||||
        { factory: "工厂1" },
 | 
			
		||||
        { factory: "工厂1" },
 | 
			
		||||
        { factory: "工厂1" },
 | 
			
		||||
        { factory: "工厂1" },
 | 
			
		||||
        { factory: "工厂1" },
 | 
			
		||||
        { factory: "工厂1" },
 | 
			
		||||
        { factory: "工厂1" },
 | 
			
		||||
        { factory: "工厂1" },
 | 
			
		||||
        { factory: "工厂1" },
 | 
			
		||||
        { factory: "工厂1" },
 | 
			
		||||
        { factory: "工厂1" },
 | 
			
		||||
        { factory: "工厂1" },
 | 
			
		||||
        { factory: "工厂1" },
 | 
			
		||||
      ],
 | 
			
		||||
      tableData: [],
 | 
			
		||||
      chartHeight: this.tableHeight(137) / 2 - 111,
 | 
			
		||||
      tableH: this.tableHeight(137) / 2 - 70,
 | 
			
		||||
      legendList: [
 | 
			
		||||
        { id: 1, name: "2024年4月目标值", type: 2, color: "#FFCE6A" },
 | 
			
		||||
        { id: 2, name: "2023年4月", type: 1, color: "#8EF0AB" },
 | 
			
		||||
        { id: 3, name: "2024年4月", type: 1, color: "#288AFF" },
 | 
			
		||||
        {
 | 
			
		||||
          id: 1, name: "综合良率", type: 1, color: "#FFCE6A" },
 | 
			
		||||
        {
 | 
			
		||||
          id: 2, name: "FTO投入", type: 1, color: "#8EF0AB" },
 | 
			
		||||
        { id: 3, name: "芯片产量", type: 1, color: "#288AFF" },
 | 
			
		||||
        {
 | 
			
		||||
          id: 4, name: "标准组件产量", type: 1, color: "#64BDFF" },
 | 
			
		||||
      ],
 | 
			
		||||
      chartMsg: {
 | 
			
		||||
        color: ["#FFCE6A", "#8EF0AB", "#288AFF"],
 | 
			
		||||
        xData: ["成都", "邯郸", "瑞昌"],
 | 
			
		||||
        yName: "单位/%",
 | 
			
		||||
      chartMsgYearTarget: {
 | 
			
		||||
        color: ["#8EF0AB", "#288AFF", '#64BDFF', "#FFCE6A",],
 | 
			
		||||
        xData: [],
 | 
			
		||||
        // yName: "单位/%",
 | 
			
		||||
        yAxis: [
 | 
			
		||||
          {
 | 
			
		||||
            type: "value",
 | 
			
		||||
            name: "单位/片",
 | 
			
		||||
            nameTextStyle: {
 | 
			
		||||
              fontSize: 12,
 | 
			
		||||
              align: "right",
 | 
			
		||||
            },
 | 
			
		||||
            axisLabel: {},
 | 
			
		||||
          },
 | 
			
		||||
          {
 | 
			
		||||
            type: 'value',
 | 
			
		||||
            // inverse: true,
 | 
			
		||||
            name: "单位/%",
 | 
			
		||||
            nameTextStyle: {
 | 
			
		||||
              fontSize: 12,
 | 
			
		||||
              align: "right",
 | 
			
		||||
            },
 | 
			
		||||
            axisLabel: {},
 | 
			
		||||
          }
 | 
			
		||||
        ],
 | 
			
		||||
        series: [
 | 
			
		||||
          {
 | 
			
		||||
            name: "2024年4月目标值",
 | 
			
		||||
            name: "",
 | 
			
		||||
            // yAxisIndex: 0,
 | 
			
		||||
            data: [
 | 
			
		||||
              { name: "%", value: 85 },
 | 
			
		||||
              { name: "%", value: 85 },
 | 
			
		||||
              { name: "%", value: 85 },
 | 
			
		||||
            ],
 | 
			
		||||
            type: "line",
 | 
			
		||||
            symbol: "circle",
 | 
			
		||||
            symbolSize: 6,
 | 
			
		||||
              {
 | 
			
		||||
                value: 1,
 | 
			
		||||
                itemStyle: {
 | 
			
		||||
                  color: '#8EF0AB'
 | 
			
		||||
                }
 | 
			
		||||
              },
 | 
			
		||||
              {
 | 
			
		||||
                value: 2,
 | 
			
		||||
                itemStyle: {
 | 
			
		||||
                  color: '#288AFF'
 | 
			
		||||
                }
 | 
			
		||||
              },
 | 
			
		||||
              {
 | 
			
		||||
                value: 3,
 | 
			
		||||
                itemStyle: {
 | 
			
		||||
                  color: '#64BDFF'
 | 
			
		||||
                }
 | 
			
		||||
              },
 | 
			
		||||
              {
 | 
			
		||||
                value: 0,
 | 
			
		||||
                yAxisIndex: 1,
 | 
			
		||||
                itemStyle: {
 | 
			
		||||
                  color: '#FFCE6A'
 | 
			
		||||
                }
 | 
			
		||||
              }],
 | 
			
		||||
            type: "bar",
 | 
			
		||||
            barWidth: 20,
 | 
			
		||||
            label: {
 | 
			
		||||
              show: true,
 | 
			
		||||
              color: "#FFAE17",
 | 
			
		||||
              position: [-18, -16],
 | 
			
		||||
              color: "#68C483",
 | 
			
		||||
              formatter: function (params) {
 | 
			
		||||
                return params.value.toFixed(2) + "%";
 | 
			
		||||
                return params.value + "片";
 | 
			
		||||
              },
 | 
			
		||||
            },
 | 
			
		||||
          },
 | 
			
		||||
          // {
 | 
			
		||||
          //   name: '销量折线图',
 | 
			
		||||
          //   type: 'bar',
 | 
			
		||||
          //   data: [ 0,0,0,
 | 
			
		||||
          //     {
 | 
			
		||||
          //       value: 5,
 | 
			
		||||
          //       itemStyle: {
 | 
			
		||||
          //         color: '#FFCE6A'
 | 
			
		||||
          //       }
 | 
			
		||||
          //     }],
 | 
			
		||||
          //   barWith: "40%",
 | 
			
		||||
          //   label: {
 | 
			
		||||
          //     show: true,
 | 
			
		||||
          //     position: "top",
 | 
			
		||||
          //     formatter: "{c}%"
 | 
			
		||||
          //   },
 | 
			
		||||
          //   lineStyle: {
 | 
			
		||||
          //     color: "#ffb122"
 | 
			
		||||
          //   },
 | 
			
		||||
          //   yAxisIndex: 1
 | 
			
		||||
          // }
 | 
			
		||||
        ],
 | 
			
		||||
      },
 | 
			
		||||
      chartMsg: {
 | 
			
		||||
        color: ["#8EF0AB", "#288AFF", '#64BDFF', "#FFCE6A",],
 | 
			
		||||
        xData: [],
 | 
			
		||||
        // yName: "单位/%",
 | 
			
		||||
        yAxis: [
 | 
			
		||||
          {
 | 
			
		||||
            name: "2023年4月",
 | 
			
		||||
            type: "value",
 | 
			
		||||
            name: "单位/片",
 | 
			
		||||
            nameTextStyle: {
 | 
			
		||||
              fontSize: 12,
 | 
			
		||||
              align: "right",
 | 
			
		||||
            },
 | 
			
		||||
            axisLabel: {},
 | 
			
		||||
          },
 | 
			
		||||
          {
 | 
			
		||||
            type: 'value',
 | 
			
		||||
            // inverse: true,
 | 
			
		||||
            name: "单位/%",
 | 
			
		||||
            nameTextStyle: {
 | 
			
		||||
              fontSize: 12,
 | 
			
		||||
              align: "right",
 | 
			
		||||
            },
 | 
			
		||||
            axisLabel: {},
 | 
			
		||||
          }
 | 
			
		||||
        ],
 | 
			
		||||
        series: [
 | 
			
		||||
          {
 | 
			
		||||
            name: "",
 | 
			
		||||
            // yAxisIndex: 0,
 | 
			
		||||
            data: [
 | 
			
		||||
              { name: "%", value: 57.5 },
 | 
			
		||||
              { name: "%", value: 21.66 },
 | 
			
		||||
@@ -230,12 +282,13 @@ export default {
 | 
			
		||||
              position: [-18, -16],
 | 
			
		||||
              color: "#68C483",
 | 
			
		||||
              formatter: function (params) {
 | 
			
		||||
                return params.value.toFixed(2) + "%";
 | 
			
		||||
                return params.value + "片";
 | 
			
		||||
              },
 | 
			
		||||
            },
 | 
			
		||||
          },
 | 
			
		||||
          {
 | 
			
		||||
            name: "2024年4月",
 | 
			
		||||
            name: "",
 | 
			
		||||
            // yAxisIndex: 0,
 | 
			
		||||
            data: [
 | 
			
		||||
              { name: "%", value: 23.33 },
 | 
			
		||||
              { name: "%", value: 7.02 },
 | 
			
		||||
@@ -247,6 +300,46 @@ export default {
 | 
			
		||||
              show: true,
 | 
			
		||||
              position: [0, -16],
 | 
			
		||||
              color: "#288AFF",
 | 
			
		||||
              formatter: function (params) {
 | 
			
		||||
                return params.value + "片";
 | 
			
		||||
              },
 | 
			
		||||
            },
 | 
			
		||||
          },
 | 
			
		||||
            {
 | 
			
		||||
              name: "",
 | 
			
		||||
              // yAxisIndex: 0,
 | 
			
		||||
            data: [
 | 
			
		||||
              { name: "%", value: 23.33 },
 | 
			
		||||
              { name: "%", value: 7.02 },
 | 
			
		||||
              { name: "%", value: 80.2 },
 | 
			
		||||
            ],
 | 
			
		||||
            type: "bar",
 | 
			
		||||
            barWidth: 20,
 | 
			
		||||
            label: {
 | 
			
		||||
              show: true,
 | 
			
		||||
              position: [0, -16],
 | 
			
		||||
              stack: '标准组件产量',
 | 
			
		||||
              color: "#64BDFF",
 | 
			
		||||
              formatter: function (params) {
 | 
			
		||||
                return params.value+ "片";
 | 
			
		||||
              },
 | 
			
		||||
            },
 | 
			
		||||
          },
 | 
			
		||||
          {
 | 
			
		||||
            name: "",
 | 
			
		||||
            data: [
 | 
			
		||||
              { name: "%", value: 115 },
 | 
			
		||||
              { name: "%", value: 5 },
 | 
			
		||||
              { name: "%", value: 8 },
 | 
			
		||||
            ],
 | 
			
		||||
            type: "line",
 | 
			
		||||
            // barWidth: 20,
 | 
			
		||||
            symbol: "circle",
 | 
			
		||||
            symbolSize: 6,
 | 
			
		||||
            yAxisIndex: 1,
 | 
			
		||||
            label: {
 | 
			
		||||
              show: true,
 | 
			
		||||
              color: "#FFAE17",
 | 
			
		||||
              formatter: function (params) {
 | 
			
		||||
                return params.value.toFixed(2) + "%";
 | 
			
		||||
              },
 | 
			
		||||
@@ -261,18 +354,50 @@ export default {
 | 
			
		||||
  components: {
 | 
			
		||||
    bmSearchBar,
 | 
			
		||||
    BmLineBar,
 | 
			
		||||
    produceLineBarYearTarget,
 | 
			
		||||
    ButtonNav
 | 
			
		||||
  },
 | 
			
		||||
  computed: {
 | 
			
		||||
    tableProps() {
 | 
			
		||||
      return [
 | 
			
		||||
        {
 | 
			
		||||
          prop: "factory",
 | 
			
		||||
          label: "工厂名称",
 | 
			
		||||
          // filter: (val) => factoryList[val],
 | 
			
		||||
          minWidth: 200,
 | 
			
		||||
          showOverflowtooltip: true,
 | 
			
		||||
        },
 | 
			
		||||
        {
 | 
			
		||||
          prop: "item",
 | 
			
		||||
          label: "科目",
 | 
			
		||||
          // filter: (val) => factoryList[val],
 | 
			
		||||
          minWidth: 200,
 | 
			
		||||
          showOverflowtooltip: true,
 | 
			
		||||
        },
 | 
			
		||||
        {
 | 
			
		||||
          prop: "unit",
 | 
			
		||||
          label: "单位",
 | 
			
		||||
          minWidth: 120,
 | 
			
		||||
          showOverflowtooltip: true,
 | 
			
		||||
        },
 | 
			
		||||
        ...this.otherProps
 | 
			
		||||
      ]
 | 
			
		||||
    },
 | 
			
		||||
    weekNum() {
 | 
			
		||||
      return Math.round((this.end - this.start) / (24 * 60 * 60 * 1000 * 7)) + 1
 | 
			
		||||
    },
 | 
			
		||||
    isOpen() {
 | 
			
		||||
      return this.$store.getters.sidebar.opened;
 | 
			
		||||
    },
 | 
			
		||||
    type() {
 | 
			
		||||
      return this.listQuery.type
 | 
			
		||||
    }
 | 
			
		||||
  },
 | 
			
		||||
  watch: {
 | 
			
		||||
    // 监听左侧菜单栏是否展开
 | 
			
		||||
    type(val) {
 | 
			
		||||
 | 
			
		||||
    },
 | 
			
		||||
    isOpen(val) {
 | 
			
		||||
      if (this.$route.name === "ChipYieldBM") {
 | 
			
		||||
        this.chartNum++;
 | 
			
		||||
@@ -289,73 +414,46 @@ export default {
 | 
			
		||||
  },
 | 
			
		||||
  activated() {
 | 
			
		||||
    // 图重新加载,为了防止窗口变化后尺寸图显示不佳,数据不更新
 | 
			
		||||
    if (this.$route.name === "ChipYieldBM") {
 | 
			
		||||
    if (this.$route.name === "productionYield") {
 | 
			
		||||
      this.chartNum++;
 | 
			
		||||
    }
 | 
			
		||||
  },
 | 
			
		||||
  mounted() {
 | 
			
		||||
    // this.getOverView()
 | 
			
		||||
    const currentMonth = new Date()
 | 
			
		||||
    this.listQuery.reportTime = [moment(currentMonth).format('yyyy-MM-DD HH:mm:ss'), moment(currentMonth).format('yyyy-MM-DD HH:mm:ss')]
 | 
			
		||||
    this.changeTime()
 | 
			
		||||
    const today = new Date()
 | 
			
		||||
    const sevenDaysAgo = new Date(today.getTime() - (7 * 24 * 60 * 60 * 1000))
 | 
			
		||||
    this.listQuery.startDate = moment(sevenDaysAgo).format('yyyy-MM-DD')
 | 
			
		||||
    this.listQuery.endDate = moment(today).format('yyyy-MM-DD')
 | 
			
		||||
    this.listQuery.reportTime = [this.listQuery.startDate, this.listQuery.endDate]
 | 
			
		||||
    this.getDataList()
 | 
			
		||||
  },
 | 
			
		||||
  methods: {
 | 
			
		||||
    getYear(e) {
 | 
			
		||||
      if (this.end && Number(this.end) - Number(this.start) > 10) {
 | 
			
		||||
      if (this.listQuery.end - this.listQuery.start > 10 * 365 * 24 * 60 * 60 * 1000) {
 | 
			
		||||
        this.$message({
 | 
			
		||||
          message: '年份起止时间不能超过十年',
 | 
			
		||||
          type: 'warning'
 | 
			
		||||
        });
 | 
			
		||||
        this.start = undefined
 | 
			
		||||
        this.end = undefined
 | 
			
		||||
        this.listQuery.reportTime = []
 | 
			
		||||
        this.listQuery.start = undefined
 | 
			
		||||
        this.listQuery.end = undefined
 | 
			
		||||
        // console.log();
 | 
			
		||||
      } else {
 | 
			
		||||
        if (Number(this.end) < Number(this.start)) {
 | 
			
		||||
          this.$message({
 | 
			
		||||
            message: '结束年份不能小于开始年份',
 | 
			
		||||
            type: 'warning'
 | 
			
		||||
          });
 | 
			
		||||
          this.start = undefined
 | 
			
		||||
          this.end = undefined
 | 
			
		||||
        } else {
 | 
			
		||||
          this.listQuery.startDate = Number(this.start)
 | 
			
		||||
          this.listQuery.endDate = Number(this.end)
 | 
			
		||||
        }
 | 
			
		||||
        this.listQuery.startDate = this.listQuery.start
 | 
			
		||||
        this.listQuery.endDate = this.listQuery.end
 | 
			
		||||
      }
 | 
			
		||||
      if (!this.start && !this.end) {
 | 
			
		||||
      if (!this.listQuery.start && !this.listQuery.end) {
 | 
			
		||||
        this.listQuery.startDate = undefined
 | 
			
		||||
        this.listQuery.endDate = undefined
 | 
			
		||||
      }
 | 
			
		||||
      // console.log(e);
 | 
			
		||||
    },
 | 
			
		||||
    changeTime() {
 | 
			
		||||
      if (this.listQuery.reportTime) {
 | 
			
		||||
        console.log(this.listQuery.reportTime)
 | 
			
		||||
        let start = new Date(this.listQuery.reportTime[0])
 | 
			
		||||
        let end = new Date(this.listQuery.reportTime[1])
 | 
			
		||||
        // const years = Number(this.listQuery.reportTime[1].slice(0, 4)) - Number(this.listQuery.reportTime[0].slice(0, 4))
 | 
			
		||||
        // const months = Number(this.listQuery.reportTime[1].slice(4)) - Number(this.listQuery.reportTime[0].slice(4))
 | 
			
		||||
        // console.log(years);
 | 
			
		||||
        if ((end - start) > 31104000000) {
 | 
			
		||||
          this.$message({
 | 
			
		||||
            message: '时间范围不能超过24个月',
 | 
			
		||||
            type: 'warning'
 | 
			
		||||
          });
 | 
			
		||||
          this.listQuery.reportTime = [];
 | 
			
		||||
        } else {
 | 
			
		||||
          this.listQuery.startDate = this.listQuery.reportTime[0]
 | 
			
		||||
          this.listQuery.endDate = this.listQuery.reportTime[1]
 | 
			
		||||
        }
 | 
			
		||||
      } else {
 | 
			
		||||
        this.listQuery.startDate = undefined
 | 
			
		||||
        this.listQuery.endDate = undefined
 | 
			
		||||
      }
 | 
			
		||||
    },
 | 
			
		||||
    onValueChange(picker, k) { // 选中近k周后触发的操作
 | 
			
		||||
      if (this.start && this.end) {
 | 
			
		||||
        this.date1 = moment(this.start.getTime() - 24 * 60 * 60 * 1000).format('YYYY-MM-DD HH:mm:ss')
 | 
			
		||||
        this.date2 = moment(this.end.getTime() + 5 * 24 * 60 * 60 * 1000).format('YYYY-MM-DD HH:mm:ss')
 | 
			
		||||
      // console.log(this.listQuery.reportTime[0], this.listQuery.reportTime[1])
 | 
			
		||||
      if (this.listQuery.start && this.listQuery.end) {
 | 
			
		||||
        console.log(this.listQuery.reportTime)
 | 
			
		||||
        this.date1 = moment(this.listQuery.start.getTime() - 24 * 60 * 60 * 1000).format('YYYY-MM-DD HH:mm:ss')
 | 
			
		||||
        this.date2 = moment(this.listQuery.end.getTime() + 5 * 24 * 60 * 60 * 1000).format('YYYY-MM-DD HH:mm:ss')
 | 
			
		||||
        const numDays = (new Date(this.date2).getTime() - new Date(this.date1).getTime()) / (24 * 3600 * 1000);
 | 
			
		||||
        if (numDays > 168) {
 | 
			
		||||
          console.log(numDays)
 | 
			
		||||
@@ -364,20 +462,21 @@ export default {
 | 
			
		||||
            type: 'warning'
 | 
			
		||||
          });
 | 
			
		||||
        } else {
 | 
			
		||||
          this.listQuery.startDate = this.date1
 | 
			
		||||
          this.listQuery.endDate = this.date2
 | 
			
		||||
          // this.listQuery.startDate = Number(moment(this.start.getTime()).format('YYYYWW'))
 | 
			
		||||
          // this.listQuery.endDate = Number(moment(this.end.getTime()).format('YYYYWW'))
 | 
			
		||||
          this.listQuery.startDate = moment(this.listQuery.start.getTime() - 24 * 60 * 60 * 1000).format('YYYY-MM-DD')
 | 
			
		||||
          this.listQuery.endDate = moment(this.listQuery.end.getTime() + 5 * 24 * 60 * 60 * 1000).format('YYYY-MM-DD')
 | 
			
		||||
        }
 | 
			
		||||
      }
 | 
			
		||||
      if (!this.start && !this.end) {
 | 
			
		||||
      if (!this.listQuery.start && !this.listQuery.end) {
 | 
			
		||||
        this.listQuery.startDate = undefined
 | 
			
		||||
        this.listQuery.endDate = undefined
 | 
			
		||||
      }
 | 
			
		||||
    },
 | 
			
		||||
    changeDayTime() {
 | 
			
		||||
      if (this.listQuery.reportTime) {
 | 
			
		||||
        const numDays = Number(this.listQuery.reportTime[1]) - Number(this.listQuery.reportTime[0])
 | 
			
		||||
        // this.createStartDate = moment(new Date(this.listQuery.reportTime[0]), 'yyyy-MM-dd hh:mm:ss');
 | 
			
		||||
        // this.createEndDate = moment(new Date(this.listQuery.reportTime[1]), 'yyyy-MM-dd hh:mm:ss');
 | 
			
		||||
        console.log(this.listQuery.reportTime[1])
 | 
			
		||||
        const numDays = (this.listQuery.reportTime[1] - this.listQuery.reportTime[0]) / (24 * 3600 * 1000);
 | 
			
		||||
        if (numDays > 30) {
 | 
			
		||||
          this.$message({
 | 
			
		||||
            message: '时间范围不能超过30天',
 | 
			
		||||
@@ -393,28 +492,222 @@ export default {
 | 
			
		||||
        this.listQuery.endDate = undefined
 | 
			
		||||
      }
 | 
			
		||||
    },
 | 
			
		||||
    getOverView() {
 | 
			
		||||
      // getOverView().then(res => {
 | 
			
		||||
      //   this.data = res.data
 | 
			
		||||
      //   console.log('aa', res.data)
 | 
			
		||||
      // })
 | 
			
		||||
    },
 | 
			
		||||
    otherMethods(val) {
 | 
			
		||||
      this.detailOrUpdateVisible = true;
 | 
			
		||||
      // this.addOrEditTitle = "详情";
 | 
			
		||||
      this.$nextTick(() => {
 | 
			
		||||
        // this.$refs.detailOrUpdate.init(val.data.id);
 | 
			
		||||
      });
 | 
			
		||||
    changeTime(value) {
 | 
			
		||||
      if (this.listQuery.reportTime) {
 | 
			
		||||
        const numDays = this.listQuery.reportTime[1] - this.listQuery.reportTime[0];
 | 
			
		||||
        if (numDays > 2 * 365 * 24 * 60 * 60 * 1000) {
 | 
			
		||||
          this.$message({
 | 
			
		||||
            message: '时间范围不能超过24个月',
 | 
			
		||||
            type: 'warning'
 | 
			
		||||
          });
 | 
			
		||||
          this.listQuery.reportTime = [];
 | 
			
		||||
        } else {
 | 
			
		||||
          this.listQuery.startDate = this.listQuery.reportTime[0]
 | 
			
		||||
          this.listQuery.endDate = this.listQuery.reportTime[1]
 | 
			
		||||
        }
 | 
			
		||||
      } else {
 | 
			
		||||
        this.listQuery.startDate = undefined
 | 
			
		||||
        this.listQuery.endDate = undefined
 | 
			
		||||
      }
 | 
			
		||||
    },
 | 
			
		||||
    async getDataList() {
 | 
			
		||||
      console.log(this.listQuery);
 | 
			
		||||
      if (this.listQuery.type == 3) {
 | 
			
		||||
        this.listQuery.startDate = this.listQuery.reportTime[0] + '-01-01 00:00:00'
 | 
			
		||||
        this.listQuery.endDate = this.listQuery.reportTime[1] + '-12-31 23:59:59'
 | 
			
		||||
      this.otherProps = []
 | 
			
		||||
      this.chartMsg.xData = []
 | 
			
		||||
      let arr = []
 | 
			
		||||
      this.currentMenu === '邯郸' ? arr.push(1) : arr.push(0)
 | 
			
		||||
      this.listQuery.factory = arr
 | 
			
		||||
      const res = await getProductionYieldSituationMWData(this.listQuery)
 | 
			
		||||
       let dataArr = [{
 | 
			
		||||
          factory: null,
 | 
			
		||||
          item: 'FTO投入',
 | 
			
		||||
          unit: '片'
 | 
			
		||||
        },
 | 
			
		||||
        {
 | 
			
		||||
          factory: null,
 | 
			
		||||
          item: '芯片产量',
 | 
			
		||||
          unit: '片'
 | 
			
		||||
        },
 | 
			
		||||
        {
 | 
			
		||||
          factory: null,
 | 
			
		||||
          item: '标准组件产量',
 | 
			
		||||
          unit: '片'
 | 
			
		||||
        },
 | 
			
		||||
        {
 | 
			
		||||
          factory: null,
 | 
			
		||||
          item: '综合良率',
 | 
			
		||||
          unit: '%'
 | 
			
		||||
        },]
 | 
			
		||||
      if (this.listQuery.type == 2) {
 | 
			
		||||
        res.data.list.forEach((ele, index) => {
 | 
			
		||||
          let i = index + 1
 | 
			
		||||
          this.chartMsg.xData.push(ele.titleValue)
 | 
			
		||||
          this.otherProps.push({
 | 
			
		||||
            label: ele.titleValue,
 | 
			
		||||
            props: 'value' + i
 | 
			
		||||
          })
 | 
			
		||||
        })
 | 
			
		||||
        this.chartMsgYearTarget.xData.push('FTO投入', '芯片产量', '标准组件产量', '综合良率')
 | 
			
		||||
        res.data.list.slice(res.data.list.length - 1, res.data.list.length).forEach((ele) => {
 | 
			
		||||
          this.title = ele.titleValue
 | 
			
		||||
          ele.productYieldDataVOList.forEach((item) => {
 | 
			
		||||
            // this.chartMsgYearTarget.series[0].name = 'FTO投入目标值',
 | 
			
		||||
              // this.chartMsgYearTarget.series[1].name = '芯片产量目标值',
 | 
			
		||||
              // this.chartMsgYearTarget.series[2].name = '标准组件产量目标值',
 | 
			
		||||
              // this.chartMsgYearTarget.series[3].name = '综合良率目标值',
 | 
			
		||||
            // this.chartMsgYearTarget.series[0].data = [
 | 
			
		||||
            //   {
 | 
			
		||||
            //     value: item.ftoInput,
 | 
			
		||||
            //     itemStyle: {
 | 
			
		||||
            //       color: '#8EF0AB'
 | 
			
		||||
            //     }
 | 
			
		||||
            //   },
 | 
			
		||||
            //   {
 | 
			
		||||
            //     value: item.chipYield,
 | 
			
		||||
            //     itemStyle: {
 | 
			
		||||
            //       color: '#288AFF'
 | 
			
		||||
            //     }
 | 
			
		||||
            //   },
 | 
			
		||||
            //   {
 | 
			
		||||
            //     value: item.componentYield,
 | 
			
		||||
            //     itemStyle: {
 | 
			
		||||
            //       color: '#64BDFF'
 | 
			
		||||
            //     }
 | 
			
		||||
            //   },
 | 
			
		||||
            //   {
 | 
			
		||||
            //     value: item.ftoInput,
 | 
			
		||||
            //     itemStyle: {
 | 
			
		||||
            //       color: '#FFCE6A'
 | 
			
		||||
            //     }
 | 
			
		||||
            //   }]
 | 
			
		||||
            // dataArr[0]['' + m + ''] = item.ftoInput
 | 
			
		||||
            // dataArr[0].factory = item.factory == 1 ? '邯郸' : '瑞昌'
 | 
			
		||||
            // dataArr[1].factory = item.factory == 1 ? '邯郸' : '瑞昌'
 | 
			
		||||
            // dataArr[2].factory = item.factory == 1 ? '邯郸' : '瑞昌'
 | 
			
		||||
            // dataArr[3].factory = item.factory == 1 ? '邯郸' : '瑞昌'
 | 
			
		||||
            // dataArr[1]['' + m + ''] = item.chipYield
 | 
			
		||||
            // dataArr[2]['' + m + ''] = item.componentYield
 | 
			
		||||
            // dataArr[3]['' + m + ''] = item.comprehensiveYieldRate
 | 
			
		||||
          })
 | 
			
		||||
        })
 | 
			
		||||
        console.log(this.otherProps)
 | 
			
		||||
        res.data.list.forEach((ele, index) => {
 | 
			
		||||
          let i = index + 1
 | 
			
		||||
          let m = 'value' + i
 | 
			
		||||
          ele.productYieldDataVOList.forEach((item) => {
 | 
			
		||||
            dataArr[0]['' + m + ''] = item.ftoInput
 | 
			
		||||
            dataArr[0].factory = item.factory == 1 ? '邯郸' : '瑞昌'
 | 
			
		||||
            dataArr[1].factory = item.factory == 1 ? '邯郸' : '瑞昌'
 | 
			
		||||
            dataArr[2].factory = item.factory == 1 ? '邯郸' : '瑞昌'
 | 
			
		||||
            dataArr[3].factory = item.factory == 1 ? '邯郸' : '瑞昌'
 | 
			
		||||
            dataArr[1]['' + m + ''] = item.chipYield
 | 
			
		||||
            dataArr[2]['' + m + ''] = item.componentYield
 | 
			
		||||
            dataArr[3]['' + m + ''] = item.comprehensiveYieldRate
 | 
			
		||||
          })
 | 
			
		||||
        })
 | 
			
		||||
        for (let i in dataArr[0]) {
 | 
			
		||||
          this.chartMsg.series[0].name = dataArr[0]['item']
 | 
			
		||||
          if (i.search('value') === 0) {
 | 
			
		||||
            this.chartMsg.series[0].data.push({
 | 
			
		||||
              name: dataArr[0]['item'],
 | 
			
		||||
              value: dataArr[0][i]
 | 
			
		||||
            })
 | 
			
		||||
          }
 | 
			
		||||
        }
 | 
			
		||||
        for (let i in dataArr[1]) {
 | 
			
		||||
          this.chartMsg.series[1].name = dataArr[1]['item']
 | 
			
		||||
          if (i.search('value') === 0) {
 | 
			
		||||
            this.chartMsg.series[1].data.push({
 | 
			
		||||
              name: dataArr[1]['item'],
 | 
			
		||||
              value: dataArr[1][i]
 | 
			
		||||
            })
 | 
			
		||||
          }
 | 
			
		||||
        }
 | 
			
		||||
        for (let i in dataArr[2]) {
 | 
			
		||||
          this.chartMsg.series[2].name = dataArr[2]['item']
 | 
			
		||||
          if (i.search('value') === 0) {
 | 
			
		||||
            this.chartMsg.series[2].data.push({
 | 
			
		||||
              name: dataArr[2]['item'],
 | 
			
		||||
              value: dataArr[2][i]
 | 
			
		||||
            })
 | 
			
		||||
          }
 | 
			
		||||
        }
 | 
			
		||||
        for (let i in dataArr[3]) {
 | 
			
		||||
          this.chartMsg.series[3].name = dataArr[3]['item']
 | 
			
		||||
          if (i.search('value') === 0) {
 | 
			
		||||
            this.chartMsg.series[3].data.push({
 | 
			
		||||
              name: dataArr[3]['item'],
 | 
			
		||||
              value: dataArr[3][i]
 | 
			
		||||
            })
 | 
			
		||||
          }
 | 
			
		||||
        }
 | 
			
		||||
      } else {
 | 
			
		||||
        res.data.list.slice.forEach((ele, index) => {
 | 
			
		||||
          let i = index + 1
 | 
			
		||||
          this.chartMsg.xData.push(ele.titleValue)
 | 
			
		||||
          this.otherProps.push({
 | 
			
		||||
            label: ele.titleValue,
 | 
			
		||||
            props: 'value' + i
 | 
			
		||||
          })
 | 
			
		||||
        })
 | 
			
		||||
        console.log(this.otherProps)
 | 
			
		||||
        if (this.listQuery.type == 2) {
 | 
			
		||||
 | 
			
		||||
        }
 | 
			
		||||
        res.data.list.forEach((ele, index) => {
 | 
			
		||||
          let i = index + 1
 | 
			
		||||
          let m = 'value' + i
 | 
			
		||||
          ele.productYieldDataVOList.forEach((item) => {
 | 
			
		||||
            dataArr[0]['' + m + ''] = item.ftoInput
 | 
			
		||||
            dataArr[0].factory = item.factory == 1 ? '邯郸' : '瑞昌'
 | 
			
		||||
            dataArr[1].factory = item.factory == 1 ? '邯郸' : '瑞昌'
 | 
			
		||||
            dataArr[2].factory = item.factory == 1 ? '邯郸' : '瑞昌'
 | 
			
		||||
            dataArr[3].factory = item.factory == 1 ? '邯郸' : '瑞昌'
 | 
			
		||||
            dataArr[1]['' + m + ''] = item.chipYield
 | 
			
		||||
            dataArr[2]['' + m + ''] = item.componentYield
 | 
			
		||||
            dataArr[3]['' + m + ''] = item.comprehensiveYieldRate
 | 
			
		||||
          })
 | 
			
		||||
        })
 | 
			
		||||
        for (let i in dataArr[0]) {
 | 
			
		||||
          this.chartMsg.series[0].name = dataArr[0]['item']
 | 
			
		||||
          if (i.search('value') === 0) {
 | 
			
		||||
            this.chartMsg.series[0].data.push({
 | 
			
		||||
              name: dataArr[0]['item'],
 | 
			
		||||
              value: dataArr[0][i]
 | 
			
		||||
            })
 | 
			
		||||
          }
 | 
			
		||||
        }
 | 
			
		||||
        for (let i in dataArr[1]) {
 | 
			
		||||
          this.chartMsg.series[1].name = dataArr[1]['item']
 | 
			
		||||
          if (i.search('value') === 0) {
 | 
			
		||||
            this.chartMsg.series[1].data.push({
 | 
			
		||||
              name: dataArr[1]['item'],
 | 
			
		||||
              value: dataArr[1][i]
 | 
			
		||||
            })
 | 
			
		||||
          }
 | 
			
		||||
        }
 | 
			
		||||
        for (let i in dataArr[2]) {
 | 
			
		||||
          this.chartMsg.series[2].name = dataArr[2]['item']
 | 
			
		||||
          if (i.search('value') === 0) {
 | 
			
		||||
            this.chartMsg.series[2].data.push({
 | 
			
		||||
              name: dataArr[2]['item'],
 | 
			
		||||
              value: dataArr[2][i]
 | 
			
		||||
            })
 | 
			
		||||
          }
 | 
			
		||||
        }
 | 
			
		||||
        for (let i in dataArr[3]) {
 | 
			
		||||
          this.chartMsg.series[3].name = dataArr[3]['item']
 | 
			
		||||
          if (i.search('value') === 0) {
 | 
			
		||||
            this.chartMsg.series[3].data.push({
 | 
			
		||||
              name: dataArr[3]['item'],
 | 
			
		||||
              value: dataArr[3][i]
 | 
			
		||||
            })
 | 
			
		||||
          }
 | 
			
		||||
        }
 | 
			
		||||
      }
 | 
			
		||||
      this.listQuery.factory = this.currentMenu === '邯郸' ? 1 : 2
 | 
			
		||||
      const res = await getComprehensiveDataPage(this.listQuery)
 | 
			
		||||
      this.tableData = res.data.list
 | 
			
		||||
 | 
			
		||||
      console.log(dataArr)
 | 
			
		||||
      this.tableData = dataArr
 | 
			
		||||
      // this.tableProps.push()
 | 
			
		||||
      this.listQuery.total = res.data.total
 | 
			
		||||
      if (this.listQuery.total > 0) {
 | 
			
		||||
        this.tableData.forEach(item => {
 | 
			
		||||
@@ -435,7 +728,16 @@ export default {
 | 
			
		||||
      console.log("=========================");
 | 
			
		||||
    },
 | 
			
		||||
    handleExport() {
 | 
			
		||||
      console.log("导出");
 | 
			
		||||
      // this.listQuery.type = val.type;
 | 
			
		||||
      // this.listQuery.startDate = val.startDate;
 | 
			
		||||
      // this.listQuery.factory = val.factory;
 | 
			
		||||
      let fileName = "产品良率.xls";
 | 
			
		||||
      exportProductionYieldSituationMWData(this.listQuery)
 | 
			
		||||
        .then((response) => {
 | 
			
		||||
          this.$download.excel(response, fileName);
 | 
			
		||||
          this.$message.success("导出成功");
 | 
			
		||||
        })
 | 
			
		||||
        .catch(() => { });
 | 
			
		||||
    },
 | 
			
		||||
  },
 | 
			
		||||
};
 | 
			
		||||
@@ -447,7 +749,7 @@ export default {
 | 
			
		||||
  background-color: #fff;
 | 
			
		||||
  border-radius: 8px;
 | 
			
		||||
  padding: 16px 16px 0 16px;
 | 
			
		||||
  margin-bottom: 8px;
 | 
			
		||||
  margin:8px 0 8px 0px;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
.containerTop {
 | 
			
		||||
 
 | 
			
		||||
		Referens i nytt ärende
	
	Block a user