From 59449d859531b41d1413460468ebf8927587d8bd Mon Sep 17 00:00:00 2001
From: wangfei <3597712270@qq.com>
Date: 星期四, 01 八月 2024 11:16:25 +0800
Subject: [PATCH] 钢化模块进行宽高判断,报工管理模块页面样式及接口功能,仓储中心样式调整

---
 UI-Project/src/views/Slicecage/slicecage.vue |  246 +++++++++++++++++++++++++++++++++++++++----------
 1 files changed, 195 insertions(+), 51 deletions(-)

diff --git a/UI-Project/src/views/Slicecage/slicecage.vue b/UI-Project/src/views/Slicecage/slicecage.vue
index 5fd9087..7aa6477 100644
--- a/UI-Project/src/views/Slicecage/slicecage.vue
+++ b/UI-Project/src/views/Slicecage/slicecage.vue
@@ -14,13 +14,16 @@
 const dialogFormVisible = ref(false)
 const dialogFormVisiblea = ref(false)
 const dialogFormVisibleb = ref(false)
+const dialogFormVisiblec = ref(false)
 const tableData = ref([])
+const tableDatagh = ref([])
 const tableDatab = ref([])
 const tableDatac = ref([])
 const tableDatad = ref([])
 const tableDataf = ref([])
 const tableDatae = ref([])
 const carPosition = ref([])
+const ganghua = ref('')
 const adjustedRects = ref([]);
 const project = ref([]);
 const adjust = ref([]);
@@ -69,57 +72,68 @@
 const cell8=ref(true);
 const cell9=ref(true);
 const selectedRow = ref(null); // 瀛樺偍閫変腑鐨勮鏁版嵁  
-
-
+ 
+onMounted(async () => {  
+  try {  
+    const response = await request.post('/cacheVerticalGlass/bigStorageCageDetails/selectTemperingGlass');
+    if (response.code === 200) {  
+      tableDatagh.value = response.data
+    } else {  
+      ElMessage.warning(response.msg)
+    }  
+  } catch (error) {  
+    // console.error('Error fetching rects :', error);  
+  }  
+}); 
     // 褰撳墠椤电爜鍜屾瘡椤垫樉绀虹殑鏉℃暟
     const currentPage = ref(1);
     const itemsPerPage = computed(() => {
       if (currentPage.value === 1) {
-        return 21;
+        return 55;
       } else if (currentPage.value === 2) {
-        return 21;
+        return 55;
       } else if (currentPage.value === 3) {
-        return 21;
+        return 55;
       } else if (currentPage.value === 4) {
-        return 20;
+        return 55;
       } else if (currentPage.value === 5) {
-        return 21;
+        return 55;
       } else if (currentPage.value === 6) {
         return 25;
       } else if (currentPage.value === 7) {
-        return 51;
+        return 30;
       } else if (currentPage.value === 8) {
         return 25;
       } else {
         return 25; // 榛樿鍊硷紝鍙互鏍规嵁瀹為檯闇�姹備慨鏀�
       }
     });
-
+ 
     // 璁$畻鍒嗛〉鍚庣殑鏁版嵁
     const paginatedUsers = computed(() => {
       const startIndex = calculateStartIndex();
       const endIndex = startIndex + itemsPerPage.value;
       return tableData.value.slice(startIndex, endIndex);
     });
-
+ 
     // 璁$畻褰撳墠椤电殑璧峰绱㈠紩
     function calculateStartIndex() {
       let index = 0;
       for (let i = 1; i < currentPage.value; i++) {
         if (i === 1) {
-          index += 21;
+          index += 55;
         } else if (i === 2) {
-          index += 21;
+          index += 55;
         } else if (i === 3) {
-          index += 21;
+          index += 55;
         }else if (i === 4) {
-          index += 20;
+          index += 55;
         }else if (i === 5) {
-          index += 21;
+          index += 55;
         }else if (i === 6) {
           index += 25;
         }else if (i === 7) {
-          index += 51;
+          index += 30;
         }else if (i === 8) {
           index += 25;
         } else {
@@ -145,7 +159,7 @@
         currentPage.value++;
       }
     };
-
+ 
     // 鎬婚〉鏁拌绠�
     const totalPages = computed(() => {
       // let total = 0;
@@ -162,9 +176,16 @@
       // }
       return 9;
     });
-
-
-
+    setInterval(() => {  
+    localStorage.clear(); // 娓呴櫎鎵�鏈塴ocalStorage鏁版嵁  
+    console.log(11111);
+}, 60000);
+//  function cleanUp() {
+//     console.log('鎵ц娓呯悊鎿嶄綔');  
+// }
+// // 鍋囪鎴戜滑姣�2鍒嗛挓鎵ц涓�娆℃竻鐞�  
+// setInterval(cleanUp, 1 * 60 * 1000);
+ 
 const getTableRow = (row,type) =>{
   switch (type) {
     case 'edit' :{
@@ -349,6 +370,33 @@
     console.error('鍙戠敓閿欒:', error);  
   }  
 }; 
+ // 鎸囧畾閽㈠寲
+ const brokee = async(row) => {  
+  try {
+    const confirmResult = await ElMessageBox.confirm(  
+      t('searchOrder.specifytemperinga'), 
+      t('searchOrder.prompt'),  
+      {  
+        confirmButtonText: t('searchOrder.yes'), 
+        cancelButtonText: t('searchOrder.cancel'),
+        type: 'warning',  
+      } 
+    ); 
+    if (confirmResult === 'confirm') {  
+      const response = await request.post("/cacheVerticalGlass/bigStorageCageDetails/TemperingGlass",{
+        engineerId: row.engineer_id,
+        temperingLayoutId: row.tempering_layout_id,
+    });
+    if (response.code === 200) {
+      ElMessage.success(response.message);
+      } else {  
+      ElMessage.error(response.message);
+      }  
+    }  
+  } catch (error) {  
+    console.error('鍙戠敓閿欒:', error);  
+  }  
+}; 
 // 鍑虹墖闃熷垪鎷胯蛋
 const brokeb = async(row) => {  
   try {
@@ -452,7 +500,7 @@
       ElMessage.success(response.message);
       glassId.value = '';
       tableDataf.value = '';
-
+ 
       } else {  
       ElMessage.error(response.message);
       }  
@@ -462,28 +510,102 @@
     console.error('鍙戠敓閿欒:', error);  
   }  
 }; 
+// const handleBindRack = (row) => {
+//   fetchFlowCardId(); 
+//   dialogFormVisiblea.value = true; // 鎵撳紑缁戝畾鏋跺瓙瀵硅瘽妗�
+// };
+const fetchFlowCardId = async () => {
+  try {
+    const response = await request.get('unLoadGlass/downWorkStation/getflowCardId');
+    console.log(response)
+    if (response.code === 200) {
+
+}
+ else {
+      ElMessage.error(response.msg);
+    }
+  } catch (error) {
+    console.error(error);
+  }
+};
 function handleRowClick(row) {  
   selectedRow.value = row; // 鏇存柊閫変腑鐨勮鏁版嵁  
 }  
+  const handleChange = async () => {
+  try  {
+    const body = {  
+      flag: ganghua.value, // 浣跨敤 ganghua.value 鑾峰彇褰撳墠寮�鍏崇殑鐘舵��  
+    }; 
+    
+    var url="/cacheVerticalGlass/bigStorageCageDetails/temperingSwitch?flag="+ganghua.value;
+  const response = await request.post(url)
+    if (response.code == 200) {
+      // 缁戝畾鎴愬姛锛屽鐞嗛�昏緫
+      ElMessage.success(response.message);
+      ganghua.value = response.data
+    }else {  
+      ElMessage.error(response.message);
+      }  
+}
+catch (error) {
+    // 澶勭悊閿欒
+    console.error(error);
+  }
+}
 const socketUrl = `ws://${WebSocketHost}:${host}/api/cacheVerticalGlass/api/talk/slicecage`;
 // 瀹氫箟娑堟伅澶勭悊鍑芥暟锛屾洿鏂� receivedData 鍙橀噺
 const handleMessage = (data) => {
   // 鏇存柊 tableData 鐨勬暟鎹�
-  tableDatac.value = data.bigStorageCageDetailsOutTask[0]
-  tableDatad.value = data.bigStorageCageDetailsFeedTask[0]
+  console.log(data.temperingSwitch[0]);
+  if(data.bigStorageCageDetailsOutTask!=null){
+    tableDatac.value = data.bigStorageCageDetailsOutTask[0]
+    adjusta.value = data.bigStorageCageDetailsOutTask[0].filter(rect => rect.slot !== null && rect.slot !== undefined);
+  } else {
+    tableDatac.value = '',
+    adjusta.value = ''
+  }
+  if(data.bigStorageCageDetailsFeedTask!=null){
+    tableDatad.value = data.bigStorageCageDetailsFeedTask[0]
+    adjust.value = data.bigStorageCageDetailsFeedTask[0].filter(rect => rect.slot !== null && rect.slot !== undefined); 
+  }else{
+    tableDatad.value = ''
+      }
+  
   // adjust.value = data.bigStorageCageDetailsFeedTask[0].map(rect => ({  
   //           ...rect, 
   //         })); 
-  adjusta.value = data.bigStorageCageDetailsOutTask[0].filter(rect => rect.slot !== null && rect.slot !== undefined);  
-  adjust.value = data.bigStorageCageDetailsFeedTask[0].filter(rect => rect.slot !== null && rect.slot !== undefined);  
+     
 //   const adjust = computed(() => {  
 //   return data.value.bigStorageCageDetailsFeedTask[0].filter(rect => rect.slot !== null && rect.slot !== undefined);  
 // }); 
+if(data.bigStorageCageInfo!=null){
   tableData.value = data.bigStorageCageInfo[0]
+}else{
+    tableData.value = ''
+   }
+if(data.temperingGlassInfoList!=null){
   tableDatab.value = data.temperingGlassInfoList[0]
+}else{
+    tableDatab.value = ''
+      }
+if(data.bigStorageCageUsage!=null){
   tableDatae.value = data.bigStorageCageUsage[0]
+}else{
+    tableDatae.value = ''
+      }
+if(data.carPostion!=null){
   carPosition.value = data.carPostion[0]
-  window.localStorage.setItem('length', data.bigStorageCageInfos[0][1].length)
+}else{
+  carPosition.value = ''
+  }
+if(data.temperingSwitch!=null){
+  ganghua.value = data.temperingSwitch[0]
+}else{
+  ganghua.value = ''
+  }
+console.log(data.temperingSwitch[0]);
+  if(data.bigStorageCageInfos!=null){
+    window.localStorage.setItem('length', data.bigStorageCageInfos[0][1].length)
   let length = window.localStorage.getItem('length')
   adjustedRects.value = data.bigStorageCageInfos[0][1].map(rect => ({  
             ...rect, 
@@ -530,12 +652,17 @@
             height: 20/length,
             top: 29/length
           })); 
+  }else{
+    adjustedRects.value = ''
+  }
+ 
+  
 };
 // 鍒濆鍖� WebSocket锛屽苟浼犻�掓秷鎭鐞嗗嚱鏁�
 onMounted(() => {
   // fetchFlowCardId();
   initializeWebSocket(socketUrl, handleMessage);
-
+ 
 });
 function getStatusType(enableState: number) {  
   switch (enableState) {  
@@ -595,11 +722,14 @@
  
 <template>
   <div style="height: 600px;">
-    <el-button style="margin-top: 5px;margin-left: 10px;"   id="searchButton" type="primary" @click="dialogFormVisiblea = true">{{ $t('searchOrder.cageinformation') }}</el-button>
-    <el-button style="margin-top: 5px;margin-left: 10px;"   id="searchButton" type="success" @click="dialogFormVisibleb = true">{{ $t('searchOrder.productionqueue') }}</el-button>
+    <el-button style="margin-top: 5px;margin-left: 10px;" id="searchButton" type="primary" @click="dialogFormVisiblea = true">{{ $t('searchOrder.cageinformation') }}</el-button>
+    <el-button style="margin-top: 5px;margin-left: 10px;" id="searchButton" type="success" @click="dialogFormVisibleb = true">{{ $t('searchOrder.productionqueue') }}</el-button>
+    <el-button style="margin-top: 5px;margin-left: 10px;" id="searchButton" type="warning" @click="dialogFormVisiblec = true">{{ $t('searchOrder.temperingqueries') }}</el-button>
+    <el-button style="margin-top: 5px;margin-left: 10px;" id="searchButton" type="info" @click="dialogFormVisiblec = true">{{ $t('searchOrder.dutyinformation') }}</el-button>
+    <el-switch style="margin-top: 5px;margin-left: 10px;" v-model="ganghua" class="mb-2" :inactive-text="$t('searchOrder.temperedswitch')" @change="handleChange" />
     <el-card style="flex: 1;margin-left: 10px;margin-top: 5px;" v-loading="loading">
       <div style="width: 98%; height: calc(100% - 35px); overflow-y: auto;max-height: 100px;">
-        <el-table height="100%" ref="table" 
+        <el-table height="100px" ref="table" 
         :data="tableDatac" :header-cell-style="{background:'#F2F3F5 ',color:'#1D2129'}">
           <el-table-column prop="bigStorageCageOutTask.glassId" align="center" :label="$t('searchOrder.outputglassID')" min-width="120" />
           <el-table-column prop="bigStorageCageOutTask.startSlot" align="center" :label="$t('searchOrder.startposition')" min-width="120" />
@@ -634,7 +764,7 @@
     </el-card>
     <el-card style="flex: 1;margin-left: 10px;margin-top: 3px;" v-loading="loading">
       <div style="width: 98%; height: calc(100% - 35px); overflow-y: auto;max-height: 100px;">
-        <el-table height="100%" ref="table" 
+        <el-table height="100px" ref="table" 
         @selection-change="handleSelectionChange"
         :data="tableDatad" :header-cell-style="{background:'#F2F3F5 ',color:'#1D2129'}">
           <el-table-column prop="bigStorageCageFeedTask.glassId" align="center" :label="$t('searchOrder.intoglassid')" min-width="120" />
@@ -667,7 +797,7 @@
         </el-table>
       </div>
     </el-card>
-    <div style="padding: 10px;display: flex;height:110px;">
+    <div style="padding: 10px;display: flex;height:130px;">
             <div v-for="(item, index) in tableDatae" :key="index" id="occupy">  
                <el-col style="text-align:left;font-weight: bold;">#{{ item.device_id }}</el-col>  
                <el-col style="text-align:left;display:flex;justify-content: space-between;align-items: center;">  
@@ -681,7 +811,7 @@
     </div>
 <!-- // 鐖剁骇妗� -->
 <div class="img-dlpl" >
-    <div class="img-car1" :style="'z-index:999;left:247px;top:' + 350*carPosition[0] + 'px;position:absolute;'">
+    <div class="img-car1" :style="'z-index:999;left:270px;top:' + 350*carPosition[0] + 'px;position:absolute;'">
       <div  
       v-for="(rect, index) in adjusta"  
       :key="rect.id"  
@@ -689,13 +819,13 @@
        width: '30px',
        height: '5px',
        backgroundColor: '#409EFF',
-       marginLeft: index * 5+ `px`,
+       marginLeft: 5+ `px`,
        top: '10px',
        }"  
     >
     </div>
     </div>
-    <div class="img-car4" :style="'z-index:999;left:704px;top:' + 350*carPosition[1] + 'px;position:absolute;'">
+    <div class="img-car4" :style="'z-index:999;left:740px;top:' + 350*carPosition[1] + 'px;position:absolute;'">
       <div  
       v-for="(rect, index) in adjust"  
       :key="rect.id"  
@@ -703,14 +833,14 @@
        width: '30px',
        height: '5px',
        backgroundColor: '#409EFF',
-       marginLeft: index * 5+ `px`,
+       marginLeft: 5+ `px`,
        top: '10px',
        }"  
     >
     </div>
     </div>
     <div style="position: relative;">
-    <div v-show="cell1" style="width: 227px;height: 29px;position: relative;top:55px;left: 465px;">
+    <div v-show="cell1" style="width: 227px;height: 29px;position: relative;top:50px;left: 495px;">
       <div  
       v-for="(rect, index) in adjustedRects"  
       :key="rect"  
@@ -741,7 +871,7 @@
       </div>
     </div>
     </div>
- <div v-show="cell2" style="width: 227px;height: 29px;position: relative;top:56px;left: 465px;">
+ <div v-show="cell2" style="width: 227px;height: 29px;position: relative;top:51px;left: 495px;">
   <div  
       v-for="(rect, index) in adjustedRectsa"  
       :key="rect.id"  
@@ -772,7 +902,7 @@
       </div>
     </div>
     </div>
-  <div v-show="cell3" style="width: 227px;height: 29px;position: absolute;top:117px;left: 465px;">
+  <div v-show="cell3" style="width: 227px;height: 29px;position: absolute;top:110px;left: 495px;">
     <div  
       v-for="(rect, index) in adjustedRectsb"  
       :key="rect.id"  
@@ -802,7 +932,7 @@
       </div>
     </div>
     </div>
-  <div v-show="cell4" style="width: 227px;height: 29px;position: absolute;top:148px;left: 465px;">
+  <div v-show="cell4" style="width: 227px;height: 29px;position: absolute;top:140px;left: 495px;">
     <div  
       v-for="(rect, index) in adjustedRectsc"  
       :key="rect.id"  
@@ -833,7 +963,7 @@
       </div>
     </div>
     </div>
-  <div v-show="cell5" style="width: 227px;height: 29px;position: absolute;top:208px;left: 465px;">
+  <div v-show="cell5" style="width: 227px;height: 29px;position: absolute;top:170px;left: 495px;">
     <div  
       v-for="(rect, index) in adjustedRectsd"  
       :key="rect.id"  
@@ -864,7 +994,7 @@
       </div>
     </div>
     </div>
-  <div v-show="cell6" style="width: 227px;height: 29px;position: absolute;top:238px;left: 465px;">
+  <div v-show="cell6" style="width: 227px;height: 29px;position: absolute;top:241px;left: 495px;">
     <div  
       v-for="(rect, index) in adjustedRectse"  
       :key="rect.id"  
@@ -895,7 +1025,7 @@
       </div>
     </div>
     </div>
-  <div v-show="cell7" style="width: 227px;height: 29px;position: absolute;top:269px;left: 465px;">
+  <div v-show="cell7" style="width: 227px;height: 29px;position: absolute;top:271px;left: 495px;">
     <div  
       v-for="(rect, index) in adjustedRectsf"  
       :key="rect.id"  
@@ -926,7 +1056,7 @@
       </div>
     </div>
     </div>
-  <div v-show="cell8" style="width: 227px;height: 29px;position: absolute;top:300px;left: 465px;">
+  <div v-show="cell8" style="width: 227px;height: 29px;position: absolute;top:301px;left: 495px;">
     <div  
       v-for="(rect, index) in adjustedRectsg"  
       :key="rect.id"  
@@ -957,7 +1087,7 @@
       </div>
     </div>
     </div>
-  <div v-show="cell9" style="width: 227px;height: 29px;position: absolute;top:300px;left: 465px;">
+  <div v-show="cell9" style="width: 227px;height: 29px;position: absolute;top:332px;left: 495px;">
     <div  
       v-for="(rect, index) in adjustedRectsh"  
       :key="rect.id"  
@@ -1019,8 +1149,8 @@
           </el-input>
           <el-button type="primary" plain style="margin-left: 10px;" @click="searchout">{{ $t('searchOrder.search') }}</el-button>
     </div>
-
-    <div style="width: 98%; height: calc(100% - 35px); overflow-y: auto;max-height: 500px;">
+ 
+    <div style="width: 98%; height: calc(100% - 35px); overflow-y: auto;max-height: 200px;">
         <el-table height="100%" ref="table"
         :data="tableDataf" :header-cell-style="{background:'#F2F3F5 ',color:'#1D2129'}">
           <el-table-column prop="glassId" align="center" :label="$t('searchOrder.glassID')" min-width="120" />
@@ -1219,6 +1349,19 @@
         </el-table-column>
         </el-table>
 </el-dialog>
+<el-dialog v-model="dialogFormVisiblec" top="5vh" width="85%" :title="$t('searchOrder.temperingqueries')">
+    <el-table  ref="table" style="margin-top: 20px;height: 500px;"
+        :data="tableDatagh" :header-cell-style="{background:'#F2F3F5 ',color:'#1D2129'}">
+          <el-table-column prop="engineer_id" fixed align="center" :label="$t('searchOrder.projectnumber')" min-width="150"/>
+          <el-table-column prop="tempering_layout_id" fixed align="center" :label="$t('searchOrder.layoutnumber')" min-width="120" />
+          <el-table-column prop="count" align="center" :label="$t('searchOrder.numberglasses')" min-width="150" />
+          <el-table-column fixed="right" :label="$t('searchOrder.operate')" align="center" width="150">
+            <template #default="scope">
+              <el-button size="mini" type="text" plain @click="brokee(scope.row)">{{ $t('searchOrder.specifytempering') }}</el-button>
+            </template>
+        </el-table-column>
+        </el-table>
+</el-dialog>
  
 </template>
 <style scoped>
@@ -1320,8 +1463,9 @@
 }
  
 .img-dlpl{
-  margin-left: 80px;
-  background-image:url('../../assets/dlpl.png');
+  margin-left: 20px;
+  margin-top: 20px;
+  background-image:url('../../assets/dlpl9.png');
   background-repeat: no-repeat;
     background-attachment: local;
     min-height: 400px;
@@ -1333,7 +1477,7 @@
 }
 .img-car1{
   display: flex;
-  background-image:url('../../assets/lp.png');
+  background-image:url('../../assets/lp9.png');
   position: absolute;
   background-repeat: no-repeat;
     background-attachment: local;
@@ -1346,7 +1490,7 @@
 }
 .img-car4{
   display: flex;
-  background-image:url('../../assets/lpa.png');
+  background-image:url('../../assets/lpa9.png');
   position: absolute;
   background-repeat: no-repeat;
     background-attachment: local;

--
Gitblit v1.8.0