gaoluyang
2026-06-22 bc365ef47ae4e01754aeadbae26170e11c9bb80e
src/views/reportAnalysis/reportManagement/index.vue
@@ -13,7 +13,8 @@
                <span>各类型完成数量</span>
              </div>
            </template>
            <div class="top-container">
            <div class="top-container"
                 :class="{ 'two-cols': !ENABLE_SEMI_FINISHED }">
              <div class="typeNum">
                <div class="typeNum-left">
                  <img src="~@/assets/images/chartCard.svg"
@@ -28,15 +29,17 @@
                <div class="typeNum-right">
                  <div class="typeNum-right-top">
                    <div class="typeNum-right-top-name">总数量</div>
                    <div class="typeNum-right-top-text">2099 <span class="unit">个</span></div>
                    <div class="typeNum-right-top-text">{{ getInspectStatValue(0, 'totalCount') }} <span class="unit">个</span></div>
                  </div>
                  <div class="typeNum-right-bottom">
                    <div class="typeNum-right-top-name">已完成数</div>
                    <div class="typeNum-right-top-text">2099 <span class="unit">个</span></div>
                    <div class="typeNum-right-top-text">{{ getInspectStatValue(0, 'completedCount') }} <span class="unit">个</span>
                    </div>
                  </div>
                </div>
              </div>
              <div class="typeNum">
              <div class="typeNum"
                   v-if="ENABLE_SEMI_FINISHED">
                <div class="typeNum-left">
                  <img src="~@/assets/images/chartCard2.svg"
                       alt="图表"
@@ -51,11 +54,12 @@
                <div class="typeNum-right">
                  <div class="typeNum-right-top">
                    <div class="typeNum-right-top-name">总数量</div>
                    <div class="typeNum-right-top-text">2099 <span class="unit">个</span></div>
                    <div class="typeNum-right-top-text">{{ getInspectStatValue(1, 'totalCount') }} <span class="unit">个</span></div>
                  </div>
                  <div class="typeNum-right-bottom">
                    <div class="typeNum-right-top-name">已完成数</div>
                    <div class="typeNum-right-top-text">2099 <span class="unit">个</span></div>
                    <div class="typeNum-right-top-text">{{ getInspectStatValue(1, 'completedCount') }} <span class="unit">个</span>
                    </div>
                  </div>
                </div>
              </div>
@@ -74,11 +78,12 @@
                <div class="typeNum-right">
                  <div class="typeNum-right-top">
                    <div class="typeNum-right-top-name">总数量</div>
                    <div class="typeNum-right-top-text">2099 <span class="unit">个</span></div>
                    <div class="typeNum-right-top-text">{{ getInspectStatValue(2, 'totalCount') }} <span class="unit">个</span></div>
                  </div>
                  <div class="typeNum-right-bottom">
                    <div class="typeNum-right-top-name">已完成数</div>
                    <div class="typeNum-right-top-text">2099 <span class="unit">个</span></div>
                    <div class="typeNum-right-top-text">{{ getInspectStatValue(2, 'completedCount') }} <span class="unit">个</span>
                    </div>
                  </div>
                </div>
              </div>
@@ -95,7 +100,8 @@
                <span>质检合格率</span>
              </div>
            </template>
            <div class="top-container flex-center">
            <div class="top-container flex-center"
                 :class="{ 'quality-two-cols': !ENABLE_SEMI_FINISHED }">
              <div class="quality-card blue-card">
                <div class="quality-card-title">
                  <img src="~@/assets/images/chartCard.svg"
@@ -108,7 +114,7 @@
                    <div>
                      <div class="quality-item-label blue-label">完成率</div>
                      <div class="quality-item-tip">占比</div>
                      <div class="quality-item-value">80%</div>
                      <div class="quality-item-value">{{ getPassRateStatValue(0, 'completionRate') }}</div>
                    </div>
                    <div class="quality-item-chart"
                         ref="materialCompletionChart"></div>
@@ -117,14 +123,15 @@
                    <div>
                      <div class="quality-item-label green-label">合格率</div>
                      <div class="quality-item-tip">占比</div>
                      <div class="quality-item-value">80%</div>
                      <div class="quality-item-value">{{ getPassRateStatValue(0, 'passRate') }}</div>
                    </div>
                    <div class="quality-item-chart"
                         ref="materialQualityChart"></div>
                  </div>
                </div>
              </div>
              <div class="quality-card green-card">
              <div class="quality-card green-card"
                   v-if="ENABLE_SEMI_FINISHED">
                <div class="quality-card-title">
                  <img src="~@/assets/images/chartCard2.svg"
                       alt="半成品"
@@ -136,7 +143,7 @@
                    <div>
                      <div class="quality-item-label blue-label">完成率</div>
                      <div class="quality-item-tip">占比</div>
                      <div class="quality-item-value">80%</div>
                      <div class="quality-item-value">{{ getPassRateStatValue(1, 'completionRate') }}</div>
                    </div>
                    <div class="quality-item-chart"
                         ref="semiCompletionChart"></div>
@@ -145,7 +152,7 @@
                    <div>
                      <div class="quality-item-label green-label">合格率</div>
                      <div class="quality-item-tip">占比</div>
                      <div class="quality-item-value">80%</div>
                      <div class="quality-item-value">{{ getPassRateStatValue(1, 'passRate') }}</div>
                    </div>
                    <div class="quality-item-chart"
                         ref="semiQualityChart"></div>
@@ -164,7 +171,7 @@
                    <div>
                      <div class="quality-item-label blue-label">完成率</div>
                      <div class="quality-item-tip">占比</div>
                      <div class="quality-item-value">80%</div>
                      <div class="quality-item-value">{{ getPassRateStatValue(2, 'completionRate') }}</div>
                    </div>
                    <div class="quality-item-chart"
                         ref="finalCompletionChart"></div>
@@ -173,7 +180,7 @@
                    <div>
                      <div class="quality-item-label green-label">合格率</div>
                      <div class="quality-item-tip">占比</div>
                      <div class="quality-item-value">80%</div>
                      <div class="quality-item-value">{{ getPassRateStatValue(2, 'passRate') }}</div>
                    </div>
                    <div class="quality-item-chart"
                         ref="finalQualityChart"></div>
@@ -207,18 +214,20 @@
                <div style="height: 80%; width: 100%;"
                     ref="inspectionChartRef">
                </div>
                <div class="container-line-right-bottom">
                <div class="container-line-right-bottom"
                     :class="{ 'two-boxes': !ENABLE_SEMI_FINISHED }">
                  <div class="inspection-chart-box">
                    <div class="chart-box-title">原材料抽检数</div>
                    <div class="chart-box-num">600</div>
                    <div class="chart-box-title">原材料总数</div>
                    <div class="chart-box-num">{{ getYearlyStatValue(0, 'totalCount') }}</div>
                  </div>
                  <div class="inspection-chart-box"
                       v-if="ENABLE_SEMI_FINISHED">
                    <div class="chart-box-title">半成品总数</div>
                    <div class="chart-box-num">{{ getYearlyStatValue(1, 'totalCount') }}</div>
                  </div>
                  <div class="inspection-chart-box">
                    <div class="chart-box-title">半成品抽检数</div>
                    <div class="chart-box-num">200</div>
                  </div>
                  <div class="inspection-chart-box">
                    <div class="chart-box-title">成品抽检数</div>
                    <div class="chart-box-num">200</div>
                    <div class="chart-box-title">成品总数</div>
                    <div class="chart-box-num">{{ getYearlyStatValue(2, 'totalCount') }}</div>
                  </div>
                </div>
              </div>
@@ -271,40 +280,14 @@
              <div class="container-line2-left">
                <div class="info-box">
                  <div class="info-box-header">项目分布</div>
                  <div class="info-line">
                  <div class="info-line"
                       v-for="(item, index) in topParametersData.list"
                       :key="index">
                    <div class="info-icon"
                         style="background-color: #165DFF"></div>
                    <div class="info-line-title">物理性能</div>
                    <div class="info-line-value1">30%</div>
                    <div class="info-line-value2">300</div>
                  </div>
                  <div class="info-line">
                    <div class="info-icon"
                         style="background-color: #14C9C9;"></div>
                    <div class="info-line-title">物理性能</div>
                    <div class="info-line-value1">30%</div>
                    <div class="info-line-value2">300</div>
                  </div>
                  <div class="info-line">
                    <div class="info-icon"
                         style="background-color: #F7BA1E;"></div>
                    <div class="info-line-title">物理性能</div>
                    <div class="info-line-value1">30%</div>
                    <div class="info-line-value2">300</div>
                  </div>
                  <div class="info-line">
                    <div class="info-icon"
                         style="background-color: #722ED1;"></div>
                    <div class="info-line-title">物理性能</div>
                    <div class="info-line-value1">30%</div>
                    <div class="info-line-value2">300</div>
                  </div>
                  <div class="info-line">
                    <div class="info-icon"
                         style="background-color: #3491FA;"></div>
                    <div class="info-line-title">物理性能</div>
                    <div class="info-line-value1">30%</div>
                    <div class="info-line-value2">300</div>
                         :style="{ backgroundColor: getParameterColor(index) }"></div>
                    <div class="info-line-title">{{ item.name }}</div>
                    <div class="info-line-value1">{{ item.percentage }}%</div>
                    <div class="info-line-value2">{{ item.count }}</div>
                  </div>
                </div>
              </div>
@@ -318,6 +301,7 @@
                   :class="{ active: activeTab === 'raw' }"
                   @click="activeTab = 'raw'">原材料</div>
              <div class="tab-item"
                   v-if="ENABLE_SEMI_FINISHED"
                   :class="{ active: activeTab === 'semi' }"
                   @click="activeTab = 'semi'">半成品</div>
              <div class="tab-item"
@@ -332,10 +316,19 @@
</template>
<script setup>
  import { ref, reactive, onMounted, nextTick } from "vue";
  import { ElMessage, ElMessageBox } from "element-plus";
  import { ref, reactive, onMounted, nextTick, watch } from "vue";
  import { ElMessage } from "element-plus";
  import * as echarts from "echarts";
  import { Box, Tools, Document, ShoppingCart } from "@element-plus/icons-vue";
  import {
    getInspectStatistics,
    getPassRateStatistics,
    getMonthlyPassRateStatistics,
    getYearlyPassRateStatistics,
    getMonthlyCompletionDetails,
    getTopParameters,
  } from "@/api/reportAnalysis/qualityReport";
  const ENABLE_SEMI_FINISHED = false;
  // 响应式数据
  const filterForm = reactive({
@@ -343,12 +336,136 @@
    reportType: "sample",
  });
  const statistics = reactive({
    totalSamples: 1250,
    activeEquipment: 45,
    completedInspections: 890,
    totalUsage: 2340,
  });
  const inspectStatisticsData = ref([]);
  const passRateStatisticsData = ref([]);
  const monthlyPassRateData = ref([]);
  const yearlyPassRateData = ref([]);
  const monthlyCompletionDetailsData = ref([]);
  const topParametersData = ref({ totalCount: 0, list: [] });
  const activeTab = ref("raw");
  const getParameterColor = index => {
    const colors = [
      "#165DFF",
      "#14C9C9",
      "#F7BA1E",
      "#722ED1",
      "#3491FA",
      "#FF7D00",
      "#F53F3F",
    ];
    return colors[index % colors.length];
  };
  const getYearlyStatValue = (type, field) => {
    const stat = yearlyPassRateData.value.find(item => item.modelType === type);
    return stat ? stat[field] : 0;
  };
  const getInspectStatValue = (type, field) => {
    const stat = inspectStatisticsData.value.find(
      item => item.modelType === type
    );
    return stat ? stat[field] : 0;
  };
  const getPassRateStatValue = (type, field) => {
    const stat = passRateStatisticsData.value.find(
      item => item.modelType === type
    );
    if (stat) {
      if (field === "completionRate" || field === "passRate") {
        return stat[field] ? Number(stat[field]).toFixed(0) + "%" : "0%";
      }
      return stat[field];
    }
    return field === "completionRate" || field === "passRate" ? "0%" : 0;
  };
  const fetchInspectStatisticsData = async () => {
    try {
      const res = await getInspectStatistics();
      if (res.code === 200) {
        inspectStatisticsData.value = res.data;
      }
    } catch (error) {
      console.error("Failed to fetch inspect statistics:", error);
    }
  };
  const fetchPassRateStatisticsData = async () => {
    try {
      const res = await getPassRateStatistics();
      if (res.code === 200) {
        passRateStatisticsData.value = res.data;
        // 数据获取后重新初始化图表
        initAllQualityCharts();
      }
    } catch (error) {
      console.error("Failed to fetch pass rate statistics:", error);
    }
  };
  const fetchMonthlyPassRateData = async () => {
    try {
      const year = value3.value.getFullYear().toString();
      const res = await getMonthlyPassRateStatistics(year);
      if (res.code === 200) {
        monthlyPassRateData.value = res.data;
        initUsageChart();
      }
    } catch (error) {
      console.error("Failed to fetch monthly pass rate statistics:", error);
    }
  };
  const fetchYearlyPassRateData = async () => {
    try {
      const year = value3.value.getFullYear().toString();
      const res = await getYearlyPassRateStatistics(year);
      if (res.code === 200) {
        yearlyPassRateData.value = res.data;
        initInspectionChart();
      }
    } catch (error) {
      console.error("Failed to fetch yearly pass rate statistics:", error);
    }
  };
  const fetchMonthlyCompletionDetailsData = async () => {
    try {
      const year = value3.value.getFullYear().toString();
      const res = await getMonthlyCompletionDetails(year);
      if (res.code === 200) {
        monthlyCompletionDetailsData.value = res.data;
        initEquipmentChart();
      }
    } catch (error) {
      console.error("Failed to fetch monthly completion details:", error);
    }
  };
  const fetchTopParametersData = async () => {
    try {
      const typeMap = {
        raw: 1,
        final: 3,
        ...(ENABLE_SEMI_FINISHED ? { semi: 2 } : {}),
      };
      const tabKey = ENABLE_SEMI_FINISHED
        ? activeTab.value
        : activeTab.value === "semi"
        ? "raw"
        : activeTab.value;
      const res = await getTopParameters(typeMap[tabKey] ?? 1);
      if (res.code === 200) {
        topParametersData.value = res.data;
        initSampleChart();
      }
    } catch (error) {
      console.error("Failed to fetch top parameters:", error);
    }
  };
  const tableData = ref([]);
  const tableLoading = ref(false);
@@ -368,8 +485,20 @@
    return time.getFullYear() > currentYear;
  };
  // Tab 选择器当前激活项
  const activeTab = ref("raw");
  // 监听年份变化
  watch(value3, () => {
    fetchMonthlyPassRateData();
    fetchYearlyPassRateData();
    fetchMonthlyCompletionDetailsData();
  });
  watch(activeTab, val => {
    if (!ENABLE_SEMI_FINISHED && val === "semi") {
      activeTab.value = "raw";
      return;
    }
    fetchTopParametersData();
  });
  // 图表引用
  const sampleChartRef = ref(null);
@@ -399,60 +528,6 @@
  let finalCompletionChartInstance = null;
  let finalQualityChartInstance = null;
  // 初始化数据
  const initData = () => {
    // 模拟表格数据
    tableData.value = [
      {
        id: "SP001",
        name: "样品A-001",
        type: "金属材料",
        status: "检测中",
        progress: 75,
        createTime: "2025-01-15 09:30:00",
        updateTime: "2025-01-20 14:20:00",
      },
      {
        id: "SP002",
        name: "样品B-002",
        type: "塑料制品",
        status: "已完成",
        progress: 100,
        createTime: "2025-01-10 10:15:00",
        updateTime: "2025-01-18 16:45:00",
      },
      {
        id: "SP003",
        name: "样品C-003",
        type: "电子元件",
        status: "待检测",
        progress: 0,
        createTime: "2025-01-22 08:45:00",
        updateTime: "2025-01-22 08:45:00",
      },
      {
        id: "EQ001",
        name: "检测设备A",
        type: "原材料",
        status: "使用中",
        progress: 60,
        createTime: "2025-01-05 14:20:00",
        updateTime: "2025-01-20 11:30:00",
      },
      {
        id: "EQ002",
        name: "检测设备B",
        type: "半成品",
        status: "空闲",
        progress: 0,
        createTime: "2025-01-08 16:10:00",
        updateTime: "2025-01-19 09:15:00",
      },
    ];
    pagination.total = tableData.value.length;
  };
  // 初始化样品进度图表
  const initSampleChart = () => {
    if (sampleChartRef.value) {
@@ -471,7 +546,7 @@
        // },
        series: [
          {
            name: "样品状态",
            name: "检测项目",
            type: "pie",
            radius: ["40%", "80%"],
            avoidLabelOverlap: false,
@@ -489,12 +564,11 @@
            labelLine: {
              show: false,
            },
            data: [
              { value: 450, name: "已完成" },
              { value: 320, name: "检测中" },
              { value: 280, name: "待检测" },
              { value: 200, name: "已暂停" },
            ],
            data: topParametersData.value.list.map((item, index) => ({
              value: item.count,
              name: item.name,
              itemStyle: { color: getParameterColor(index) },
            })),
          },
        ],
      };
@@ -506,6 +580,49 @@
  const initEquipmentChart = () => {
    if (equipmentChartRef.value) {
      equipmentChart = echarts.init(equipmentChartRef.value);
      const legendData = ENABLE_SEMI_FINISHED
        ? ["原材料", "半成品", "成品"]
        : ["原材料", "成品"];
      const barWidth = ENABLE_SEMI_FINISHED ? "15%" : "20%";
      const series = [
        {
          name: "原材料",
          type: "bar",
          barWidth,
          data: monthlyCompletionDetailsData.value.map(
            item => item.rawMaterialCount
          ),
          itemStyle: {
            color: "#409EFF",
          },
        },
        ...(ENABLE_SEMI_FINISHED
          ? [
              {
                name: "半成品",
                type: "bar",
                barWidth,
                data: monthlyCompletionDetailsData.value.map(
                  item => item.processCount
                ),
                itemStyle: {
                  color: "#67C23A",
                },
              },
            ]
          : []),
        {
          name: "成品",
          type: "bar",
          barWidth,
          data: monthlyCompletionDetailsData.value.map(
            item => item.outgoingCount
          ),
          itemStyle: {
            color: "#E6A23C",
          },
        },
      ];
      const option = {
        title: {
          show: false,
@@ -523,8 +640,8 @@
          containLabel: true,
        },
        legend: {
          data: ["原材料", "半成品", "成品"], // 图例数据
          icon: ["circle", "circle", "circle"],
          data: legendData, // 图例数据
          icon: legendData.map(() => "circle"),
          itemWidth: 10, // 设置图标宽度
          itemHeight: 10,
          itemGap: 30,
@@ -551,37 +668,7 @@
          type: "value",
          name: "数(个)",
        },
        series: [
          {
            name: "原材料",
            type: "bar",
            barWidth: "15%",
            data: [85, 75, 80, 85, 90, 88, 92, 87, 89, 91, 93, 95],
            itemStyle: {
              color: "#409EFF",
            },
          },
          {
            name: "半成品",
            type: "bar",
            barWidth: "15%",
            data: [60, 65, 70, 68, 72, 75, 78, 80, 79, 82, 84, 85],
            itemStyle: {
              color: "#67C23A",
            },
          },
          {
            name: "成品",
            type: "bar",
            barWidth: "15%",
            data: [75, 78, 80, 82, 85, 83, 86, 88, 87, 89, 90, 92],
            itemStyle: {
              color: "#E6A23C",
            },
          },
        ],
        series,
      };
      equipmentChart.setOption(option);
    }
@@ -591,6 +678,27 @@
  const initInspectionChart = () => {
    if (inspectionChartRef.value) {
      inspectionChart = echarts.init(inspectionChartRef.value);
      const data = [
        {
          value: getYearlyStatValue(0, "totalCount"),
          name: "原材料",
          itemStyle: { color: "#1890FF" },
        },
        ...(ENABLE_SEMI_FINISHED
          ? [
              {
                value: getYearlyStatValue(1, "totalCount"),
                name: "半成品",
                itemStyle: { color: "#F7BA1E" },
              },
            ]
          : []),
        {
          value: getYearlyStatValue(2, "totalCount"),
          name: "成品",
          itemStyle: { color: "#14C9C9" },
        },
      ];
      const option = {
        title: {
          show: false,
@@ -601,12 +709,12 @@
        series: [
          {
            type: "pie",
            radius: "80%",
            data: [
              { value: 335, name: "原材料", itemStyle: { color: "#1890FF" } },
              { value: 310, name: "半成品", itemStyle: { color: "#F7BA1E" } },
              { value: 234, name: "成品", itemStyle: { color: "#14C9C9" } },
            ],
            radius: "70%",
            data,
            label: {
              show: true,
              formatter: "{b}: {c}",
            },
            emphasis: {
              itemStyle: {
                shadowBlur: 10,
@@ -627,6 +735,44 @@
    if (usageChartRef.value) {
      // 初始化 ECharts 实例
      usageChart = echarts.init(usageChartRef.value);
      const legendData = ENABLE_SEMI_FINISHED
        ? ["原材料", "半成品", "成品"]
        : ["原材料", "成品"];
      const series = [
        {
          name: "原材料",
          type: "line",
          symbol: "circle",
          itemStyle: {
            color: "#1890FF",
          },
          data: monthlyPassRateData.value.map(item => item.rawMaterial.passRate),
        },
        ...(ENABLE_SEMI_FINISHED
          ? [
              {
                name: "半成品",
                type: "line",
                symbol: "circle",
                itemStyle: {
                  color: "#F7BA1E",
                },
                data: monthlyPassRateData.value.map(
                  item => item.process.passRate
                ),
              },
            ]
          : []),
        {
          name: "成品",
          type: "line",
          symbol: "circle",
          itemStyle: {
            color: "#14C9C9",
          },
          data: monthlyPassRateData.value.map(item => item.outgoing.passRate),
        },
      ];
      // 配置图表选项
      const option = {
        // 标题配置(隐藏)
@@ -648,8 +794,8 @@
        },
        // 图例配置
        legend: {
          data: ["原材料", "半成品", "成品"], // 图例数据
          icon: ["circle", "circle", "circle"],
          data: legendData, // 图例数据
          icon: legendData.map(() => "circle"),
          itemWidth: 10, // 设置图标宽度
          itemHeight: 10,
          itemGap: 30,
@@ -679,38 +825,7 @@
          name: "单位:%",
        },
        // 系列数据
        series: [
          {
            name: "原材料", // 系列名称
            type: "line", // 图表类型为折线图
            stack: "Total", // 堆叠名称
            symbol: "none",
            itemStyle: {
              color: "#1890FF", // 设置这条线的颜色
            },
            data: [120, 132, 101, 134, 90, 230, 210, 182, 191, 234, 290, 330], // 领用次数数据
          },
          {
            name: "半成品", // 系列名称
            type: "line", // 图表类型为折线图
            stack: "Total", // 堆叠名称
            symbol: "none",
            itemStyle: {
              color: "#F7BA1E", // 设置这条线的颜色
            },
            data: [110, 125, 95, 128, 85, 220, 200, 175, 185, 225, 280, 320], // 归还次数数据
          },
          {
            name: "成品", // 系列名称
            type: "line", // 图表类型为折线图
            stack: "Total", // 堆叠名称
            symbol: "none",
            itemStyle: {
              color: "#14C9C9", // 设置这条线的颜色
            },
            data: [110, 125, 95, 128, 85, 220, 200, 175, 185, 225, 280, 320], // 归还次数数据
          },
        ],
        series,
      };
      // 将配置应用到图表
      usageChart.setOption(option);
@@ -718,9 +833,14 @@
  };
  // 初始化质检合格率图表
  const initQualityChart = (chartRef, color) => {
  const initQualityChart = (chartRef, color, value = 0.8) => {
    if (chartRef.value) {
      const chart = echarts.init(chartRef.value);
      let chart = echarts.getInstanceByDom(chartRef.value);
      if (!chart) {
        chart = echarts.init(chartRef.value);
      }
      const numericValue =
        typeof value === "string" ? parseFloat(value) / 100 : value / 100;
      const option = {
        series: [
          {
@@ -734,8 +854,8 @@
              show: false,
            },
            data: [
              { value: 0.8, itemStyle: { color: color } },
              { value: 0.2, itemStyle: { color: "#f5f5f5" } },
              { value: numericValue, itemStyle: { color: color } },
              { value: 1 - numericValue, itemStyle: { color: "#f5f5f5" } },
            ],
          },
        ],
@@ -750,22 +870,39 @@
  const initAllQualityCharts = () => {
    materialCompletionChartInstance = initQualityChart(
      materialCompletionChart,
      "#1890ff"
      "#1890ff",
      getPassRateStatValue(0, "completionRate")
    );
    materialQualityChartInstance = initQualityChart(
      materialQualityChart,
      "#52c41a"
      "#52c41a",
      getPassRateStatValue(0, "passRate")
    );
    semiCompletionChartInstance = initQualityChart(
      semiCompletionChart,
      "#1890ff"
    );
    semiQualityChartInstance = initQualityChart(semiQualityChart, "#52c41a");
    if (ENABLE_SEMI_FINISHED) {
      semiCompletionChartInstance = initQualityChart(
        semiCompletionChart,
        "#1890ff",
        getPassRateStatValue(1, "completionRate")
      );
      semiQualityChartInstance = initQualityChart(
        semiQualityChart,
        "#52c41a",
        getPassRateStatValue(1, "passRate")
      );
    } else {
      semiCompletionChartInstance = null;
      semiQualityChartInstance = null;
    }
    finalCompletionChartInstance = initQualityChart(
      finalCompletionChart,
      "#1890ff"
      "#1890ff",
      getPassRateStatValue(2, "completionRate")
    );
    finalQualityChartInstance = initQualityChart(finalQualityChart, "#722ed1");
    finalQualityChartInstance = initQualityChart(
      finalQualityChart,
      "#722ed1",
      getPassRateStatValue(2, "passRate")
    );
  };
  // 事件处理函数
@@ -855,7 +992,15 @@
  // 生命周期
  onMounted(() => {
    initData();
    if (!ENABLE_SEMI_FINISHED && activeTab.value === "semi") {
      activeTab.value = "raw";
    }
    fetchInspectStatisticsData();
    fetchPassRateStatisticsData();
    fetchMonthlyPassRateData();
    fetchYearlyPassRateData();
    fetchMonthlyCompletionDetailsData();
    fetchTopParametersData();
    nextTick(() => {
      initSampleChart();
      initEquipmentChart();
@@ -873,8 +1018,10 @@
      // 调整质检合格率图表大小
      materialCompletionChartInstance?.resize();
      materialQualityChartInstance?.resize();
      semiCompletionChartInstance?.resize();
      semiQualityChartInstance?.resize();
      if (ENABLE_SEMI_FINISHED) {
        semiCompletionChartInstance?.resize();
        semiQualityChartInstance?.resize();
      }
      finalCompletionChartInstance?.resize();
      finalQualityChartInstance?.resize();
    });
@@ -884,10 +1031,9 @@
<style scoped>
  .report-management {
    padding: 20px;
    background-color: #f5f5f5;
    min-height: 100vh;
    /* height: 87vh;
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              overflow: hidden; */
      overflow: hidden; */
  }
  .page-header {
@@ -978,6 +1124,7 @@
  .chart-card {
    margin-bottom: 20px;
  }
  .container-line-right-bottom {
    height: 20%;
    width: 100%;
@@ -986,6 +1133,7 @@
    align-items: center;
    /* background-color: #5b3f3f; */
  }
  .card-header {
    display: flex;
    justify-content: flex-start;
@@ -999,6 +1147,7 @@
    font-style: normal;
    text-transform: none;
  }
  .chart-title-line {
    width: 6px;
    height: 22px;
@@ -1011,6 +1160,7 @@
    height: 250px;
    width: 100%;
  }
  .chart-container-line {
    height: 250px;
    width: 100%;
@@ -1051,18 +1201,22 @@
    color: #fff;
    background-color: #409eff;
  }
  .container-line-left {
    height: 100%;
    width: 66%;
  }
  .container-line-right {
    height: 100%;
    width: 34%;
  }
  .container-line2-left {
    height: 100%;
    width: 50%;
  }
  .info-box {
    width: 92%;
    margin-left: 4%;
@@ -1073,6 +1227,7 @@
    align-items: center;
    justify-content: space-around;
  }
  .info-box-header {
    width: 100%;
    margin-left: 20px;
@@ -1087,17 +1242,20 @@
    padding-left: 20px;
    align-items: center;
  }
  .info-icon {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    margin-right: 8px;
  }
  .info-line-title {
    font-size: 12px;
    color: #4e5969;
    flex: 1;
  }
  .info-line-value1 {
    font-size: 12px;
    color: #3d3d3d;
@@ -1105,6 +1263,7 @@
    font-weight: 500;
    margin-right: 15%;
  }
  .info-line-value2 {
    font-size: 12px;
    color: #3d3d3d;
@@ -1112,11 +1271,17 @@
    font-weight: 500;
    margin-right: 10%;
  }
  .top-container {
    height: 130px;
    width: 100%;
    display: flex;
  }
  .top-container.two-cols .typeNum {
    width: 50%;
  }
  .typeNum {
    height: 100%;
    width: 33.33%;
@@ -1124,6 +1289,7 @@
    align-items: center;
    justify-content: center;
  }
  .typeNum-left {
    font-size: 12px;
    color: #909399;
@@ -1132,25 +1298,30 @@
    align-items: center;
    justify-content: center;
  }
  .typeNum-left-text {
    font-size: 12px;
    color: #3491fa;
    font-weight: 500;
    margin-top: 5px;
  }
  .table-card {
    margin-bottom: 20px;
  }
  .typeNum-center {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: 10px;
  }
  .typeNum-leftLine {
    color: #3491fa;
    font-size: 12px;
  }
  .typeNum-rightLine {
    border-top: 1px solid #3491fa;
    border-left: 1px solid #3491fa;
@@ -1158,10 +1329,12 @@
    height: 80px;
    width: 8px;
  }
  .typeNum-leftLine2 {
    color: #5eb334;
    font-size: 12px;
  }
  .typeNum-rightLine2 {
    border-top: 1px solid #3491fa;
    border-left: 1px solid #5eb334;
@@ -1169,10 +1342,12 @@
    height: 80px;
    width: 8px;
  }
  .typeNum-leftLine3 {
    color: #8000ff;
    font-size: 12px;
  }
  .typeNum-rightLine3 {
    border-top: 1px solid #8000ff;
    border-left: 1px solid #8000ff;
@@ -1180,6 +1355,7 @@
    height: 80px;
    width: 8px;
  }
  .typeNum-right {
    margin-left: 10px;
    display: flex;
@@ -1187,21 +1363,25 @@
    height: 90%;
    justify-content: space-between;
  }
  .typeNum-right-top-name {
    font-weight: 400;
    font-size: 12px;
    color: #3d3d3d;
  }
  .typeNum-right-top-text {
    font-weight: 400;
    font-size: 16px;
    color: rgba(0, 0, 0, 0.85);
    margin-top: 5px;
  }
  .unit {
    font-size: 12px;
    color: #3d3d3d;
  }
  .inspection-chart-box {
    height: 50px;
    width: 30%;
@@ -1209,21 +1389,25 @@
    border-radius: 8px;
    padding-left: 15px;
  }
  .chart-box-title {
    font-size: 12px;
    color: #4e5969;
    margin-top: 5px;
  }
  .unit {
    font-size: 12px;
    color: #3d3d3d;
  }
  .chart-box-num {
    font-size: 18px;
    color: #000;
    margin-top: 5px;
    font-weight: 500;
  }
  /* 质检合格率卡片样式 */
  .top-container合格率 {
    height: 130px;
@@ -1233,9 +1417,11 @@
    align-items: center;
    justify-content: space-between;
  }
  .flex-center {
    justify-content: space-evenly;
  }
  .quality-card {
    /* flex: 1; */
    width: 32%;
@@ -1244,6 +1430,14 @@
    padding: 12px;
    display: flex;
    flex-direction: column;
  }
  .top-container.quality-two-cols .quality-card {
    width: 48%;
  }
  .container-line-right-bottom.two-boxes .inspection-chart-box {
    width: 45%;
  }
  .blue-card {
@@ -1272,9 +1466,11 @@
    color: #666666;
    margin-bottom: 3px;
  }
  .blue-label {
    color: #1890ff;
  }
  .green-label {
    color: #52c41a;
  }
@@ -1317,9 +1513,10 @@
    height: 60px;
    margin-left: 10px;
  }
  /* .flex-center {
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            justify-content: space-evenly;
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          } */
    justify-content: space-evenly;
    } */
  .blue-chart {
    /* background-color: rgba(24, 144, 255, 0.1); */
@@ -1366,6 +1563,7 @@
    margin-top: 20px;
    text-align: right;
  }
  .yearchange {
    position: absolute;
    right: 40px;
@@ -1396,6 +1594,7 @@
  :deep(.el-tag) {
    margin: 0;
  }
  :deep(.el-input__prefix) {
    display: none !important;
  }