From 4e3b8155722b66e25df3c6fd42cc586b68dea391 Mon Sep 17 00:00:00 2001
From: zhoushihao <zsh19950802@163.com>
Date: 星期五, 06 六月 2025 13:55:39 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/master'

---
 UI-Project/src/views/PurchaseReturn/purchaseStorage.vue |   63 ++++++++++++++++---------------
 1 files changed, 33 insertions(+), 30 deletions(-)

diff --git a/UI-Project/src/views/PurchaseReturn/purchaseStorage.vue b/UI-Project/src/views/PurchaseReturn/purchaseStorage.vue
index 868c247..befea3a 100644
--- a/UI-Project/src/views/PurchaseReturn/purchaseStorage.vue
+++ b/UI-Project/src/views/PurchaseReturn/purchaseStorage.vue
@@ -1,7 +1,7 @@
 <template>
   <div style="height: 500px;">
     <div style="display: flex;">
-      <el-input v-model="engineerId" style="margin-left: 15px;margin-top: 10px;width: 240px" :placeholder="$t('order.projectnumber')" @blur="handleBlur"/>
+      <el-input v-model="engineerId" style="margin-left: 15px;margin-top: 10px;width: 240px" :placeholder="$t('order.projectnumber')"/>
           <el-button type="primary" style="margin-left: 10px;margin-top: 10px;" @click="sethistorical()">{{$t('reportmanage.inquire')}}</el-button>
        <el-pagination
           v-model:current-page="currentPage"
@@ -14,7 +14,7 @@
           style="margin-top: 10px;"
       />
       </div>
-    <el-card style="flex: 1;margin-left: 10px;margin-top: 10px;margin-right: 10px;height: 800px;" v-loading="loading">
+    <el-card style="flex: 1;margin-left: 10px;margin-top: 10px;margin-right: 10px;height: 800px;">
       <el-scrollbar height="750px" width="1400px" style="background-color: #e9e9eb;">
   <div style="position: relative;">  
     <div
@@ -24,7 +24,7 @@
       @click="showDialog(rect.glassId)"  
       :style="{ position: 'absolute', 
       top: `${rect.y}px`, left: `${rect.x}px`, width: `${rect.width}px`, height: `${rect.height}px`,
-      backgroundColor: rect.isActive ? '#ADFF2F' : getRectColor(rect.status)
+      backgroundColor: rect.isActive ? '#ADFF2F' : getRectColor(rect.state)
        }"  
     >
      <div  class="centered-text">
@@ -36,11 +36,11 @@
    </div>
       </el-scrollbar>
       <el-dialog v-model="blind" top="30vh" width="15%" style="text-align: center;" @close="handleDialogClose">
-        <el-button :disabled="currentGlassRect?.status === 8 || currentGlassRect?.status === 9" type="warning"
-                   plain :icon="Delete" @click="handleDamage(currentGlassId)" style="width: 140px;margin-left: 10px;">
+        <el-button :disabled="currentGlassRect?.state === 8 || currentGlassRect?.state === 9" type="warning"
+                   plain @click="handleDamage(currentGlassId)" style="width: 140px;margin-left: 10px;">
           {{ $t('order.dilapidation') }}
         </el-button>
-        <el-button :disabled="currentGlassRect?.status === 9 || currentGlassRect?.status === 8" type="danger"
+        <el-button :disabled="currentGlassRect?.state === 9 || currentGlassRect?.state === 8" type="danger"
                    plain @click="handleManualTake(currentGlassId)" style="width: 140px;margin-top: 10px;">
           <el-icon class="el-icon--right">
             <Upload/>
@@ -62,7 +62,7 @@
 const blind = ref(false)
 const engineerId = ref();
 const currentGlassId = ref(null); 
-const currentstate = ref(null);
+const temperingLayoutId = ref(null); 
 const adjustedRects = ref([]);
 const raw = ref([]);
 let webSocket: WebSocket | null = null;  
@@ -74,9 +74,9 @@
 const rawData = ref([]);
 // 鏄剧ず瀵硅瘽妗嗗苟璁剧疆褰撳墠 glassId  
 const currentGlassRect = computed(() => {
-  return adjustedRects.value.find(rect => rect.glassId === currentGlassId.value);  
+  return adjustedRects.value.find(rect => rect.glassId === currentGlassId.value);
 }); 
-function showDialog(glassId: number) {
+  function showDialog(glassId: number) {
   currentGlassId.value = glassId;  
   blind.value = true;  
   adjustedRects.value = adjustedRects.value.map(rect =>  
@@ -95,13 +95,15 @@
   const response = await request.post('/temperingGlass/temperingGlassInfo/updateTemperingState', {
       glassId: currentGlassId.value,
       line: 4001,
-      status: 8,
+      state: 8,
       workingProcedure: '閽㈠寲',
+      temperingLayoutId: currentPage.value,
+      engineerId: engineerId.value,
     })
     if (response.code == 200) {
       ElMessage.success(response.message);
       blind.value = false;
-      updateRectStatus(currentGlassId.value, 8); 
+      updateRectstate(currentGlassId.value, 8); 
     } else {
       ElMessage.error(response.msg);
     }
@@ -117,13 +119,15 @@
   const response = await request.post('/temperingGlass/temperingGlassInfo/updateTemperingState', {
       glassId: currentGlassId.value,
       line: 4001,
-      status: 9,
+      state: 9,
       workingProcedure: '閽㈠寲',
+      temperingLayoutId: currentPage.value,
+      engineerId: engineerId.value,
     })
     if (response.code == 200) {
       ElMessage.success(response.message);
       blind.value = false;
-      updateRectStatus(currentGlassId.value, 9); 
+      updateRectstate(currentGlassId.value, 9); 
   } else {
       ElMessage.error(response.msg);
     }
@@ -145,7 +149,6 @@
     totalPages.value = response.data.id;
 }
   } catch (error) {
-    ElMessage.error(response.message);
   }
 };
 const search = async () => {
@@ -193,8 +196,6 @@
 };
 const handleCurrentChange = async(val: number) => {  
   currentPage.value = val;
-  console.log(currentPage.value);
-  
     const response = await request.post('/temperingGlass/temperingGlassInfo/selectTemperingGlass', {
       engineerId: engineerId.value,
       temperingLayoutId: currentPage.value
@@ -236,31 +237,33 @@
     adjustedRects.value = adjustedRectsData;
     } 
 };
-function getRectColor(status: number): string {
-  switch (status) {
-    case -1:
-      return '#CDAF95';
-    case 0:
-      return '#7AC5CD';
-    case 1:
-      return '#95d475';
-    case 2:
-      return 'lightblue';
-    case 3:
-      return '#eebe77';
+function getRectColor(state: number): string {
+  switch (state) {
+    // case -1:
+    //   return '#CDAF95';
+    // case 0:
+    //   return '#7AC5CD';
+    // case 1:
+    //   return '#95d475';
+    // case 2:
+    //   return 'lightblue';
+    // case 3:
+    //   return '#eebe77';
     case 4:
       return '#CD6090';
     case 8:
       return '#911005';
     case 9:
       return '#4682B4';
+    default:
+      return '#CDAF95'; 
   }
 }
 // 鏇存柊鐭╁舰鐘舵��  
-function updateRectStatus(glassId: string, status: number) {  
+function updateRectstate(glassId: string, state: number) {  
   adjustedRects.value.forEach(rect => {  
     if (rect.glassId === glassId) {  
-      rect.status = status; // 鏇存柊鐭╁舰鐨勭姸鎬�  
+      rect.state = state; // 鏇存柊鐭╁舰鐨勭姸鎬�  
     }  
   });  
 }

--
Gitblit v1.8.0