chenlu
2025-11-21 d473c7b2b07cfeee3740f40dfdc95d722d8da3c2
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
<script setup>
import GlassInventory from "@/views/pp/glassOptimize/page/GlassInventory.vue"
import ProjectDetail from "@/views/pp/glassOptimize/page/ProjectDetail.vue"
import ProjectCreate from "@/views/pp/glassOptimize/ProjectCreate.vue"
import GlassComputed from "@/views/pp/glassOptimize/GlassComputed.vue";
import ProjectMange from "@/views/pp/glassOptimize/ProjectMange.vue";
import OptimizationRectPrint from "@/views/pp/glassOptimize/OptimizationRectPrint.vue";
 
import {ref} from "vue";
import {ElMessage} from "element-plus";
let dialogVisible = ref(false)
let detailPage = ref(0)
let state = ref(1)
const changeDialog = (value) => {
  dialogVisible.value = true
  detailPage.value = value
}
 
//从工程管理获取工程号,并跳转
const projectNumber = ref();
 
const  glassInventoryRef=ref(null)
const switchDialog = (number) => {
  projectNumber.value = number;
  detailPage.value = 3;
};
 
const switchDialog1 = (number) => {
  projectNumber.value = number;
  detailPage.value = 4;
  state.value=1;
};
 
const switchDialog2 = (number) => {
  projectNumber.value = number;
  detailPage.value = 4;
  state.value=2;
};
 
//工程管理关闭弹窗
const handlePopupClose = () => {
  dialogVisible.value = false;
};
 
//获取SetTrimming的值
const dataForGlassInventory = ref();
const handleProjectDetailData = (data) => {
  dataForGlassInventory.value = data;
};
 
//获取GlassInventory的值(查询库存)
const sendDataGlassInventory = ref()
const handleInventoyData = (selectedLabel1,selectedLabel2,type) => {
  sendDataGlassInventory.value = {
    selectedLabel1, selectedLabel2,type
  };
};
 
//右键菜单打开修边
const isTrimmingDialogVisible = ref(false);
const sendTrimming = (value) => {
    isTrimmingDialogVisible.value = value;
  };
 
let checkboxChangeData = ref('');
const getSmallPieceData = () => {
    checkboxChangeData.value=glassInventoryRef.value.checkboxChanges();
};
 
 
 
 
</script>
 
<template >
 <div style="width: 100%;height: 100%">
   <div id="main-body">
     <project-detail @changeDialog="changeDialog"
                     @forward-data-to-grandparent="handleProjectDetailData"
                     @send-inventory-to-op="handleInventoyData"
                     @getSmallPieceData="getSmallPieceData"
                     :TrimmingDialogVisible="isTrimmingDialogVisible" :CheckboxChangeData="checkboxChangeData" />
   </div>
   <div id="main-footer">
     <glass-inventory ref="glassInventoryRef"
         :receivedData="dataForGlassInventory"
                      :InventoryData="sendDataGlassInventory"
                      @select-trimming="sendTrimming"/>
   </div>
 
 
   <el-dialog
       v-model="dialogVisible"
       :title="detailPage ===1? '创建工程' : detailPage ===2? '工程管理' : detailPage ===3? '模拟计算':''"
       destroy-on-close
       style="width: 90%;height:90%;margin-top: 3vh;overflow: auto"
       z-index="100"
   >
     <project-create v-if="detailPage===1" @switch-dialog="switchDialog"/>
     <project-mange  v-if="detailPage===2" @switch-dialog="switchDialog" @switch-dialog-print="switchDialog1"
                     @switch-dialog-print2="switchDialog2" @closeDetailPage="handlePopupClose"/>
     <glass-computed v-if="detailPage===3" :project="projectNumber"/>
     <optimization-rect-print  v-if="detailPage===4"  :project="projectNumber" :state="state"/>
     <div v-else></div>
   </el-dialog>
 
 </div>
</template>
 
<style scoped>
#main-body{
  width: 100%;
  height: 60%;
}
#main-footer{
  margin-top: 10px;
  width: 100%;
  height: calc(40% - 10px);
}
:deep( .el-dialog__body){
  height: calc(100% - 55px);
  width: 100%;
  margin-top: 30px;
   /* padding: 0; */
}
 
</style>