解决工程信息界面跳转模拟计算,工程编号丢失的bug,完成保存OPT文件接口对接数据组装工作。
| | |
| | | |
| | | onMounted(() => { |
| | | if (props.project) { |
| | | console.log(props.project) |
| | | console.log('ceshiyixia',props.project) |
| | | handleFetchData(props.project.projectNumber); |
| | | //handleTableData(data); |
| | | //handleDataReceive(data); |
| | |
| | | <div style="width: 100%; height: 100%;"> |
| | | |
| | | <div id="compute"> |
| | | <compute :data="computedData" :state="state" @fetch-data="handleFetchData" :project="props.project" @sendData="handleData" @simulate-click="handleSimulation" /> |
| | | <compute :data="computedData" :state="state" |
| | | @fetch-data="handleFetchData" |
| | | :project="props.project" |
| | | @sendData="handleData" |
| | | @simulate-click="handleSimulation" /> |
| | | </div> |
| | | |
| | | <div id="computeCard"> |
| | |
| | | /> |
| | | </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 request from "@/utils/request";
|
| | | import { useI18n } from "vue-i18n";
|
| | | import { ElMessage } from "element-plus";
|
| | | import requestOptimize from "@/utils/requestOptimize";
|
| | |
|
| | | const { t } = useI18n();
|
| | |
|
| | | const savedProjectNo = localStorage.getItem('projectNo');
|
| | | const processId = savedProjectNo;
|
| | | const layoutData = ref(null);
|
| | | const layoutCutData = ref(null);
|
| | | const dataLoaded = ref(false);
|
| | | // 添加用于存储库存数据的响应式变量
|
| | | const inventoryData = ref([]);
|
| | |
|
| | |
|
| | | // 从 localStorage 读取库存数据
|
| | | const loadInventoryData = () => {
|
| | | const storedData = localStorage.getItem('glassInventoryData');
|
| | | if (storedData) {
|
| | | try {
|
| | | inventoryData.value = JSON.parse(storedData);
|
| | | console.log('从 localStorage 读取到库存数据:', inventoryData.value);
|
| | | console.log('取玻璃厚度',inventoryData.value[0].thickness);
|
| | | } catch (e) {
|
| | | console.error('解析库存数据失败:', e);
|
| | | }
|
| | | } else {
|
| | | console.log('localStorage 中没有找到库存数据');
|
| | | }
|
| | | };
|
| | |
|
| | |
|
| | | const selectLayout = () => {
|
| | | request.post(`/glassOptimize/selectOptimizeResult/${processId}`)
|
| | |
| | | projectNo: processId,
|
| | | projectNumber: processId
|
| | | };
|
| | |
|
| | | const cutDataTemp = {
|
| | | ...parsedData
|
| | | };
|
| | | layoutData.value = dataWithProjectId;
|
| | | dataLoaded.value = true;
|
| | | layoutCutData.value = cutDataTemp;
|
| | | } else {
|
| | | ElMessage.warning("数据格式不正确");
|
| | | }
|
| | |
| | | };
|
| | |
|
| | | onMounted(() => {
|
| | | // 读取库存数据
|
| | | loadInventoryData();
|
| | | selectLayout();
|
| | | });
|
| | |
|
| | |
| | | ElMessage.warning('没有可保存的数据');
|
| | | return;
|
| | | }
|
| | |
|
| | | const response = await request.post('/glassOptimize/generateOpt', {
|
| | | Layouts: JSON.stringify(layoutData.value) // 序列化整个layoutData对象
|
| | | console.log("提交数据:", layoutCutData.value);
|
| | | const response = await requestOptimize.post('api/cutFiles', {
|
| | | fileName: processId,
|
| | | glassThickness:inventoryData.value[0].thickness,
|
| | | glassType:inventoryData.value[0].model,
|
| | | quantity: inventoryData.value[0].processingQuantity,
|
| | | fileType:"OPT",
|
| | | fileSaveMode:1,
|
| | | glassIdMode:1,
|
| | | layouts: layoutCutData.value.layouts
|
| | | }, {
|
| | | headers: {
|
| | | 'Content-Type': 'application/json'
|
| | |
| | | <script setup> |
| | | import {onMounted, reactive, ref, watch} from "vue"; |
| | | import {onMounted, reactive, ref, watch, inject} from "vue"; |
| | | import {useI18n} from "vue-i18n"; |
| | | import {Platform, Search, SuccessFilled} from "@element-plus/icons-vue"; |
| | | import useUserInfoStore from "@/stores/userInfo"; |
| | |
| | | } |
| | | }); |
| | | |
| | | // 注入 projectNo |
| | | const injectedProjectNo = inject('projectNo', null); |
| | | |
| | | const selectOptions = [ |
| | | { |
| | |
| | | // 定义响应式数据,用于绑定工程号输入框的值 |
| | | let inputValue=ref(null) |
| | | if(props.project!==undefined){ |
| | | inputValue= ref(props.project.projectNumber); |
| | | quantity.value=props.project.quantity |
| | | inputValue = ref(props.project.projectNumber); |
| | | quantity.value = props.project.quantity |
| | | } else if(props.projectNo) { |
| | | inputValue.value = props.projectNo; |
| | | } else if(injectedProjectNo) { |
| | | // 从 provide/inject 获取 projectNo |
| | | inputValue.value = injectedProjectNo.value || injectedProjectNo; |
| | | }else { |
| | | // 从 localStorage 获取 |
| | | const storedProjectNo = localStorage.getItem('currentProjectNo'); |
| | | if (storedProjectNo) { |
| | | inputValue.value = storedProjectNo; |
| | | } |
| | | } |
| | | |
| | | // 添加 watch 监听注入的 projectNo |
| | | watch(() => injectedProjectNo, (newVal) => { |
| | | if(newVal && !inputValue.value) { |
| | | inputValue.value = newVal.value || newVal; |
| | | } |
| | | }, { immediate: true }); |
| | | |
| | | const fetchSettings = async (username) => { |
| | | try { |
| | | const response = await request.post(`/glassOptimize/selectOptimizeParms/${username}`); |
| | |
| | | } |
| | | xGrid.value.loadData(formattedData); |
| | | gridOptions.data = formattedData; |
| | | |
| | | // 将 formattedData 保存到 localStorage |
| | | localStorage.setItem('glassInventoryData', JSON.stringify(formattedData)); |
| | | console.log('已将库存数据保存到 localStorage'); |
| | | } else { |
| | | } |
| | | } else { |
| | |
| | | <script setup> |
| | | import {nextTick, onMounted, reactive, ref, watch,onBeforeUnmount } from "vue"; |
| | | import {nextTick, onMounted, reactive, ref, watch,onBeforeUnmount, provide } from "vue"; |
| | | import {useI18n} from "vue-i18n"; |
| | | import {Folder, Plus, Setting, Operation,} from "@element-plus/icons-vue"; |
| | | import OptimizeCompute from "@/views/pp/glassOptimize/page/OptimizeCompute.vue"; |
| | |
| | | const route = useRoute(); |
| | | //工程号 |
| | | const projectNo = ref(route.params.projectNo); |
| | | provide('projectNo', projectNo); |
| | | const projectName = ref(''); |
| | | const thickNess = ref(route.params.thickNess); |
| | | const model = ref(route.params.model); |
| | |
| | | |
| | | onMounted(() => { |
| | | if (projectNo.value) { |
| | | localStorage.setItem('currentProjectNo', projectNo.value); |
| | | orderInfo.projectNo=route.params |
| | | fetchData(); |
| | | firstLoading(); |
| | |
| | | <div ref="layoutPanel" id="printFlowCard" :class="panelClass" :style="panelStyle">
|
| | | <div v-if="dataLoadeds">
|
| | | <h3>工程号【{{ processId }}】</h3>
|
| | | <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>
|
| | | </div>
|
| | |
|
| | | <div
|
| | | v-for="(layout, layoutIndex) in layouts"
|
| | | :key="layoutIndex"
|