| | |
| | | <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;"> |
| | |
| | | .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); |
| | | } |
| | |
| | | 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, |