guoyujie
2025-10-14 81cad8df0f1b33700e7fc80f271eda7f1180efb0
north-glass-erp/northglass-erp/src/views/pp/glassOptimize/OptimizationRectPrint.vue
@@ -1,6 +1,6 @@
<template>
  <div>
    <el-button id="button" type="primary" @click="printReports" style="background: #409eff; position: fixed; top: 90px; right: 100px; padding: 20px; color: white; border: none; cursor: pointer; margin-right: 10px;">
    <el-button id="button" type="primary" @click="printReports" style="background: #409eff; position: fixed; top: 90px; right: 90px; padding: 20px; color: white; border: none; cursor: pointer; margin-right: 10px;">
      预览
    </el-button>
    <el-button id="button" type="primary" @click="handlePrint" style="position: fixed; top: 90px; right: 20px; padding: 20px; background: #409eff; color: white; border: none; border-radius: 5px; cursor: pointer;">
@@ -147,8 +147,8 @@
      .then((res) => {
        if (res.code == 200) {
          try {
            materialList.value = res.data.materialList[0];
            console.log('reportData:', materialList.value);
            materialList.value = res.data.materialList;
            console.log('materialList:', materialList.value);
          } catch (error) {
            console.error("解析布局数据失败:", error);
          }
@@ -225,9 +225,16 @@
      printLayouts : config.printLayouts ? '1' : '0',
      printReport : config.printReport ? '1' : '0',
      layouts : layoutData.value,
      reportData: reportData.value,
      materialList: materialList.value,
      productList: productList.value,
      reportData:{
        rectangleQuantity: reportData.value.rectangleQuantity,
        otherShapeQuantity: reportData.value.otherShapeQuantity,
        rectangleArea: reportData.value.rectangleArea,
        otherShapeArea: reportData.value.otherShapeArea,
        rectanglePerimeter: reportData.value.rectanglePerimeter,
        otherShapePerimeter: reportData.value.otherShapePerimeter,
        materialList: materialList.value,
        productList: productList.value,
      },
      layoutSet: {
        layoutRows: layoutRowsMap[config.rowTypes] || 1,
        layoutColumns: layoutColumnsMap[config.columnTypes] || 1,