chenlu
2025-03-07 3ab330b8aefb3cd781c9b8730b4ab7ac65e7e9d7
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
<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 {ref} from "vue";
let dialogVisible = ref(false)
let detailPage = ref(0)
const changeDialog = (value) => {
  dialogVisible.value = true
  detailPage.value = value
}
 
//从工程管理获取工程号,并跳转
const projectNumber = ref('');
const switchDialog = (number) => {
  projectNumber.value = number;
  detailPage.value = 3;
};
 
//工程管理关闭弹窗
const handlePopupClose = () => {
  dialogVisible.value = false;
};
 
//获取SetTrimming的值
const dataForGlassInventory = ref();
const handleProjectDetailData = (data) => {
  dataForGlassInventory.value = data;
};
 
//获取GlassInventory的值(查询库存)
const sendDataGlassInventory = ref()
const handleInventoyData = (selectedLabel1,selectedLabel2) => {
  sendDataGlassInventory.value = {
    selectedLabel1, selectedLabel2
  };
};
 
//右键菜单打开修边
const isTrimmingDialogVisible = ref(false);
const sendTrimming = (value) => {
    isTrimmingDialogVisible.value = value;
  };
 
</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"
                     :TrimmingDialogVisible="isTrimmingDialogVisible" />
   </div>
   <div id="main-footer">
     <glass-inventory :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"
       z-index="100"
   >
     <project-create v-if="detailPage===1" />
     <project-mange  v-if="detailPage===2" @switch-dialog="switchDialog" @closeDetailPage="handlePopupClose"/>
     <glass-computed v-if="detailPage===3" :project-no="projectNumber"/>
     <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%;
  //padding: 0;
}
 
</style>