From b365a0879edc787655b908b0dbb65b5e966bb23b Mon Sep 17 00:00:00 2001
From: 严智鑫 <test>
Date: 星期二, 07 五月 2024 09:03:08 +0800
Subject: [PATCH] 公共yml文件 ip  改回10.153.19.150

---
 UI-Project/src/views/PurchaseReturn/purchaseReturn.vue |  252 +++++++++++++++++++++++++++++++++----------------
 1 files changed, 168 insertions(+), 84 deletions(-)

diff --git a/UI-Project/src/views/PurchaseReturn/purchaseReturn.vue b/UI-Project/src/views/PurchaseReturn/purchaseReturn.vue
index 63dbe54..b389719 100644
--- a/UI-Project/src/views/PurchaseReturn/purchaseReturn.vue
+++ b/UI-Project/src/views/PurchaseReturn/purchaseReturn.vue
@@ -2,26 +2,110 @@
 import {Search} from "@element-plus/icons-vue";
 import {reactive} from "vue";
 import {useRouter} from "vue-router"
+import request from "@/utils/request"
 
-import { ref } from 'vue'
+import { ref, onMounted } from 'vue';  
+// import { ref } from 'vue'
 
 const dialogFormVisible = ref(true)
 const dialogFormVisiblea = ref(false)
+const dialogFormVisibleb = ref(false)
+const width = ref(); // 鐢ㄤ簬瀛樺偍process_id鐨勫搷搴斿紡寮曠敤 
+const height = ref(); // 鐢ㄤ簬瀛樺偍process_id鐨勫搷搴斿紡寮曠敤 
+const adjustedRects = ref([]);
+const adjustedRectsa = ref([]);
+const adjustedRectsb = ref([]);
+// 杩涚倝涓�
+onMounted(async () => {  
+  try {  
+    const response = await request.get('/temperingGlass/temperingGlassInfo/SelectIntoGlass'); 
+    if (response.code === 200) {  
+      const rawRects = response.data; // 璁剧疆鐭╁舰鏁版嵁  
+      console.log(response.data);
+      const { height: newheight,width: newwidth  } = response.data; // 鑾峰彇灏哄  
+      height.value = newheight;  
+      width.value = newwidth;  
 
-const getTableRow = (row,type) =>{
-  switch (type) {
-    case 'edit' :{
-      //alert('鎴戞帴鏀跺埌瀛愮粍浠朵紶閫佺殑缂栬緫淇℃伅')
-      router.push({path: '/main/returns/createReturns', query: { ReturnID: 'TH24010101' }})
-      break
-    }
-    case 'delete':{
-      alert('鎴戞帴鏀跺埌瀛愮粍浠朵紶閫佺殑鍒犻櫎淇℃伅')
-      break
-    }
-  }
-}
+      adjustedRects.value = rawRects.map(rect => ({  
+        ...rect, // 澶嶅埗鍘熷瀵硅薄鐨勫叾浠栧睘鎬�  
+        xcoordinate: rect.xcoordinate, // 灏唜鍊奸櫎浠�3  
+        ycoordinate: rect.ycoordinate,
+        width: rect.width ,
+        height: rect.height ,
+      }));  
+        console.log(rect);
 
+      //   console.log( (rect.width*100) / 300 );
+    } else {  
+      // console.error('Failed to fetch rectangles from API.');  
+      console.error('Failed to fetch rects from API.'); 
+    }  
+  } catch (error) {  
+    // console.error('Error fetching rectangles :', error);
+    console.error('Error fetching rects :', error);  
+  }  
+}); 
+// 杩涚倝鍓�
+const handleConfirm = async () => {
+  try {
+    const response = await request.post('/temperingGlass/temperingGlassInfo/SelectWaitingGlass'); 
+    if (response.code === 200) {  
+      const rawRects = response.data; // 璁剧疆鐭╁舰鏁版嵁  
+      console.log(response.data);
+      const { height: newheight,width: newwidth  } = response.data; // 鑾峰彇灏哄  
+      height.value = newheight;  
+      width.value = newwidth;  
+
+      adjustedRectsa.value = rawRects.map(rect => ({  
+        ...rect, // 澶嶅埗鍘熷瀵硅薄鐨勫叾浠栧睘鎬�  
+        xcoordinate: rect.xcoordinate, // 灏唜鍊奸櫎浠�3  
+        ycoordinate: rect.ycoordinate,
+        width: rect.width ,
+        height: rect.height ,
+      }));  
+        console.log(rect);
+
+      //   console.log( (rect.width*100) / 300 );
+    } else {  
+      // console.error('Failed to fetch rectangles from API.');  
+      console.error('Failed to fetch rects from API.'); 
+    }  
+  } catch (error) {  
+    // console.error('Error fetching rectangles :', error);
+    console.error('Error fetching rects :', error);  
+  }  
+}; 
+
+// 宸插嚭鐐�
+const handleConfirma = async () => {
+  try {
+    const response = await request.get('/temperingGlass/temperingGlassInfo/SelectOutGlass'); 
+    if (response.code === 200) {  
+      const rawRects = response.data; // 璁剧疆鐭╁舰鏁版嵁  
+      console.log(response.data);
+      const { height: newheight,width: newwidth  } = response.data; // 鑾峰彇灏哄  
+      height.value = newheight;  
+      width.value = newwidth;  
+
+      adjustedRectsb.value = rawRects.map(rect => ({  
+        ...rect, // 澶嶅埗鍘熷瀵硅薄鐨勫叾浠栧睘鎬�  
+        xcoordinate: rect.xcoordinate, // 灏唜鍊奸櫎浠�3  
+        ycoordinate: rect.ycoordinate,
+        width: rect.width ,
+        height: rect.height ,
+      }));  
+        console.log(rect);
+
+      //   console.log( (rect.width*100) / 300 );
+    } else {  
+      // console.error('Failed to fetch rectangles from API.');  
+      console.error('Failed to fetch rects from API.'); 
+    }  
+  } catch (error) {  
+    // console.error('Error fetching rectangles :', error);
+    console.error('Error fetching rects :', error);  
+  }  
+}; 
 const gridOptions = reactive({
   border:  "full",//琛ㄦ牸鍔犺竟妗�
   keepSource: true,//淇濇寔婧愭暟鎹�
@@ -57,85 +141,70 @@
 })
 </script>
 
-<template>
+<template> 
   <div style="margin-top: 10px;">
-     <el-button style="margin-left: 15px;"   id="searchButton" type="primary" @click="dialogFormVisible = true;dialogFormVisiblea = false">鎽嗙墖鐗堝浘</el-button>
-    <el-button  id="searchButton" type="success" @click="dialogFormVisiblea = true;dialogFormVisible = false">宸插嚭鐐夌幓鐠�</el-button>
+     <el-button style="margin-left: 15px;"   id="searchButton" type="primary" @click="dialogFormVisible = true;dialogFormVisiblea = false;dialogFormVisibleb = false;">杩涚倝涓�</el-button>
+     <el-button style="margin-left: 15px;"   id="searchButton" type="primary" @click="handleConfirm();dialogFormVisiblea = true;dialogFormVisible = false;dialogFormVisibleb = false;" >杩涚倝鍓�</el-button>
+    <el-button  id="searchButton" type="success" @click="handleConfirma();dialogFormVisibleb = true;dialogFormVisible = false;dialogFormVisiblea = false">宸插嚭鐐夌幓鐠�</el-button>
 <div v-if="dialogFormVisible" >
-    <el-card style="margin-left: 10px;margin-top: 10px;margin-right: 10px;" v-loading="loading">
-      <div style="display: flex;margin-bottom: 20px;">
+      <!-- <div style="display: flex;margin-bottom: 20px;">
       <div style="margin-left: 450px;font-size: 20px;">宸ョ▼鍙凤細P20240305001 </div>
       <div style="margin-left: 150px;font-size: 20px;">鐗堝浘缂栧彿锛�1</div>
-    </div>
-    <div>
-            <div id="boxa" style="width: 200px;height: 300px;margin-left: 70px;">
-              <div style="margin-top: 35px;"> NG202405060798A01-1</div> 
-            <div> 500脳1000</div>
-          </div>
-            <div id="boxa" style="width: 200px;height: 300px;">
-              <div style="margin-top: 35px;"> NG202405060798A01-1</div> 
-            <div> 500脳1000</div>
-          </div>
-          <div id="boxa" style="width: 200px;height: 300px;">
-              <div style="margin-top: 35px;"> NG202405060798A01-1</div> 
-            <div> 500脳1000</div>
-          </div>
-          <div id="boxa" style="width: 200px;height: 300px;">
-              <div style="margin-top: 35px;"> NG202405060798A01-1</div> 
-            <div> 500脳1000</div>
-          </div>
-          <div id="boxa" style="width: 200px;height: 300px;">
-              <div style="margin-top: 35px;"> NG202405060798A01-1</div> 
-            <div> 500脳1000</div>
-          </div>
-          <div id="boxa" style="width: 200px;height: 300px;">
-              <div style="margin-top: 35px;"> NG202405060798A01-1</div> 
-            <div> 500脳1000</div>
-          </div>
-    </div>
-    <div style="margin-top: 20px;">
-            <div id="boxa" style="width: 200px;height: 300px;margin-left: 70px;">
-              <div style="margin-top: 35px;"> NG202405060798A01-1</div> 
-            <div> 500脳1000</div>
-          </div>
-          <div id="boxa" style="width: 200px;height: 300px;">
-              <div style="margin-top: 35px;"> NG202405060798A01-1</div> 
-            <div> 500脳1000</div>
-          </div>
-          <div id="boxa" style="width: 200px;height: 300px;">
-              <div style="margin-top: 35px;"> NG202405060798A01-1</div> 
-            <div> 500脳1000</div>
-          </div>
-          <div id="boxa" style="width: 200px;height: 300px;">
-              <div style="margin-top: 35px;"> NG202405060798A01-1</div> 
-            <div> 500脳1000</div>
-          </div>
-          <div id="boxa" style="width: 200px;height: 300px;">
-              <div style="margin-top: 35px;"> NG202405060798A01-1</div> 
-            <div> 500脳1000</div>
-          </div>
-            <div id="boxb" style="width: 200px;height: 300px;">
-              <div style="margin-top: 35px;"> NG202405060798A01-1</div> 
-            <div> 500脳1000</div>
-          </div>
-    </div>
-    </el-card>
-    </div>
-<div v-if="dialogFormVisiblea">
+    </div> -->
     <el-card style="flex: 1;margin-left: 10px;margin-top: 10px;margin-right: 10px;" v-loading="loading">
       <el-scrollbar height="630px">
-      <div id="home-card">
-      <div id="home-item" v-for="n in 20" :key="n">
-            <div id="box" style="width: 100px;height: 165px;">100*65</div>
-            <div id="box" style="width: 107px;height: 150px;">107*60</div>
-            <div id="box" style="width: 107px;height: 155px;">109*60</div>
-      </div>
+    <div  style="position: relative;width: 1400px;">  
+      <div  
+      v-for="(rect, index) in adjustedRects"  
+      :key="index"  
+      class="rect"  
+      :style="{ position: 'absolute',  top: `${rect.ycoordinate}px`, left: `${rect.xcoordinate}px`, width: `${rect.width}px`, height: `${rect.height}px`  }"  
+    >
+     <div  class="centered-text">
+    <div style="margin-top: 50px;margin-left: -85px;">{{ rect.width }}*{{ rect.height }}</div>  
+  </div>
+  </div> 
+   </div>
+   </el-scrollbar>
+   </el-card>
     </div>
-  </el-scrollbar>
-    </el-card>
+<div v-if="dialogFormVisiblea">
+  <el-card style="flex: 1;margin-left: 10px;margin-top: 10px;margin-right: 10px;" v-loading="loading">
+      <el-scrollbar height="630px">
+    <div  style="position: relative;width: 1400px;">  
+      <div  
+      v-for="(rect, index) in adjustedRects"  
+      :key="index"  
+      class="rect"  
+      :style="{ position: 'absolute',  top: `${rect.ycoordinate}px`, left: `${rect.xcoordinate}px`, width: `${rect.width}px`, height: `${rect.height}px`  }"  
+    >
+     <div  class="centered-text">
+    <div style="margin-top: 50px;margin-left: -85px;">{{ rect.width }}*{{ rect.height }}</div>  
+  </div>
+  </div> 
+   </div>
+   </el-scrollbar>
+   </el-card>
+</div>
+<div v-if="dialogFormVisibleb">
+  <el-card style="flex: 1;margin-left: 10px;margin-top: 10px;margin-right: 10px;" v-loading="loading">
+      <el-scrollbar height="630px">
+    <div  style="position: relative;width: 1400px;">  
+      <div  
+      v-for="(rect, index) in adjustedRects"  
+      :key="index"  
+      class="rect"  
+      :style="{ position: 'absolute',  top: `${rect.ycoordinate}px`, left: `${rect.xcoordinate}px`, width: `${rect.width}px`, height: `${rect.height}px`  }"  
+    >
+     <div  class="centered-text">
+    <div style="margin-top: 50px;margin-left: -85px;">{{ rect.width }}*{{ rect.height }}</div>  
+  </div>
+  </div> 
+   </div>
+   </el-scrollbar>
+   </el-card>
 </div>
   </div>
-
 </template>
 
 <style scoped>
@@ -203,4 +272,19 @@
       }
     }
   }
+  .rect {  
+  border: 1px solid black; /* 璁剧疆鐭╁舰鐨勮竟妗� */  
+  background-color: lightblue; /* 璁剧疆鐭╁舰鐨勮儗鏅壊 */  
+} 
+#rect {  
+  position: relative; /* 纭繚绠ご鍙互鐩稿浜庣煩褰㈠畾浣� */  
+  /* 鍏朵粬鏍峰紡 */  
+}  
+.centered-text {
+  /* 璁剧疆鏂囧瓧灞呬腑鏍峰紡 */  
+  display: flex;  
+  justify-content: center;  
+  align-items: center;  
+  height: 100%; /* 纭繚div鍗犳嵁鏁翠釜鐭╁舰鐨勯珮搴� */  
+} 
 </style>
\ No newline at end of file

--
Gitblit v1.8.0