| | |
| | | <el-button id="button" type="primary" @click="handlePrint" style="position: fixed; top: 90px; right: 20px; padding: 20px; background: #4CAF50; color: white; border: none; border-radius: 5px; cursor: pointer;"> |
| | | 打印 |
| | | </el-button> |
| | | |
| | | |
| | | <div style="display: flex; align-items: center; gap: 20px; margin-bottom: 20px;"> |
| | | <span>工程编号:</span> |
| | | <el-input readonly placeholder="" style="width: 150px" v-model="processId"></el-input> |
| | | <el-checkbox v-model="config.plain"> |
| | | 切材率 |
| | | </el-checkbox> |
| | | <div style="margin-right: 30px;"></div> |
| | | <span>布局选择:</span> |
| | | <el-select v-model="config.type" style="width: 120px;"> |
| | | <el-option v-for="type in linkTypes" :key="type" :value="type" /> |
| | | </el-select> |
| | | <el-button id="button" type="primary" @click="handlePrint" style="background: #4CAF50; color: white; border: none; cursor: pointer;"> |
| | | 预览 |
| | | </el-button> |
| | | </div> |
| | | |
| | | <div ref="printContainer" style="position: relative;"> |
| | | <RectRenderer |
| | | ref="rectRenderer" |
| | |
| | | /> |
| | | </div> |
| | | </div> |
| | | <div style="width: 400px;margin: auto;"> |
| | | <h1 style="margin: auto;text-align: center;">上海北玻自动化</h1> |
| | | <h2 style="margin: auto;text-align: center;">优化报告</h2> |
| | | 优化报工 |
| | | <el-table :data="layoutDetails"> |
| | | <el-table-column prop="avgCutRate" label="切裁率"></el-table-column> |
| | | <el-table-column prop="validCutRate" label="有效切割"></el-table-column> |
| | | <el-table-column prop="lastCutRate" label="尾片"></el-table-column> |
| | | <el-table-column prop="" label="原片类型"></el-table-column> |
| | | <el-table-column prop="totalQuantity" label="版面数量"></el-table-column> |
| | | </el-table> |
| | | <br> |
| | | 物料信息 |
| | | <el-table :data="materialDetails"> |
| | | <el-table-column prop="width" label="原片宽"></el-table-column> |
| | | <el-table-column prop="height" label="原片高"></el-table-column> |
| | | <el-table-column prop="processingQuantity" label="数量"></el-table-column> |
| | | </el-table> |
| | | </div> |
| | | |
| | | </template> |
| | | |
| | | <script setup> |
| | | import { ref, onMounted, watch } from 'vue'; |
| | | import { ref, onMounted, watch, reactive, inject } from 'vue'; |
| | | import RectRenderer from './page/RectRenderer.vue'; |
| | | import request from "@/utils/request"; |
| | | |
| | |
| | | const printLayout = ref('2rows-2cols'); |
| | | const rectRenderer = ref(null); |
| | | const savedProjectNo = localStorage.getItem('projectNo'); |
| | | let processId = null; |
| | | const processId = ref(''); |
| | | const layoutData = ref(); |
| | | const dataLoaded = ref(false); |
| | | const materialDetails = ref(); |
| | | const injectedProjectNo = inject('projectNo', null); |
| | | const state = ref(); |
| | | const linkTypes = ['一列', '两列', '三列'] |
| | | |
| | | // 定义不同布局对应的尺寸 |
| | | const layoutDimensions = { |
| | | '4rows-2cols': { width: 1000, height: 1000 }, |
| | |
| | | const currentPrintHeight = ref(layoutDimensions[printLayout.value].height); |
| | | |
| | | const selectLayout = () => { |
| | | request.post(`/glassOptimize/selectOptimizeResult/${processId}`) |
| | | request.post(`/glassOptimize/selectOptimizeResult/${processId.value}`) |
| | | .then((res) => { |
| | | if (res.code == 200) { |
| | | try { |
| | |
| | | }); |
| | | }; |
| | | |
| | | const config = reactive({ |
| | | type: '两列', |
| | | plain: true, |
| | | }) |
| | | |
| | | onMounted(() => { |
| | | if (props.project) { |
| | | processId=props.project.projectNumber; |
| | | state.value=props.state; |
| | | // 优先使用注入的 projectNo,其次使用 props,最后使用 localStorage |
| | | if (injectedProjectNo) { |
| | | processId.value = injectedProjectNo.value || injectedProjectNo; |
| | | } else if (props.project) { |
| | | processId.value = props.project.projectNumber || ''; |
| | | state.value = props.state; |
| | | } else if (savedProjectNo) { |
| | | processId.value = savedProjectNo; |
| | | } |
| | | |
| | | if (processId.value) { |
| | | selectLayout(); |
| | | } |
| | | }); |