From d62a5f34ef60949ef6bef74fd9c48c20b4e65d83 Mon Sep 17 00:00:00 2001
From: wangfei <3597712270@qq.com>
Date: 星期五, 09 八月 2024 13:19:37 +0800
Subject: [PATCH] 钢化模块旋转更改,下片台

---
 UI-Project/src/views/StockBasicData/stockBasicData.vue |   99 +++++++++++++++++++++++++++++++++----------------
 1 files changed, 67 insertions(+), 32 deletions(-)

diff --git a/UI-Project/src/views/StockBasicData/stockBasicData.vue b/UI-Project/src/views/StockBasicData/stockBasicData.vue
index 8b0da31..1f798b2 100644
--- a/UI-Project/src/views/StockBasicData/stockBasicData.vue
+++ b/UI-Project/src/views/StockBasicData/stockBasicData.vue
@@ -6,7 +6,7 @@
 const adda = ref(false)
 import { WebSocketHost ,host} from '@/utils/constants'
 import request from "@/utils/request"
-import { ref, onMounted , onBeforeUnmount} from "vue";
+import { ref, onMounted , onBeforeUnmount,onUnmounted} from "vue";
 import { initializeWebSocket, closeWebSocket } from '@/utils/WebSocketService';
 // import { ref } from 'vue'
 import { ElMessage, ElMessageBox } from 'element-plus'
@@ -20,20 +20,40 @@
 const requestData = {  
   line: 2001  
 };  
-request.post("/cacheGlass/taskCache/selectEdgTask",{
-  ...requestData,  
+const timeRange = ref(["2022-01-01", "2025-01-01"])
+const selectValuesa = reactive({});
+// request.post("/cacheGlass/taskCache/selectEdgTask",{
+//   ...requestData,  
 
-}).then((res) => {
-          if (res.code == 200) {
+// }).then((res) => {
+//           if (res.code == 200) {
             
-          console.log(res.data);
-          tableData.value = res.data
-          console.log(res.data[0].slot);
-          } else {
-          ElMessage.warning(res.msg)
+//           console.log(res.data);
+//           tableData.value = res.data
+//           console.log(res.data[0].slot);
+//           } else {
+//           ElMessage.warning(res.msg)
         
-          }
-          });
+//           }
+//           });
+
+// 纾ㄨ竟浠诲姟鏌ヨ
+const setEdgGlassInfoRequest = async () => {
+  
+  const response = await request.post("/cacheGlass/edgGlassTaskInfo/setEdgGlassInfoRequest", {
+    cellList: [selectValuesa[0]],
+    stateList: [selectValuesa[1]],
+    beginDate: timeRange.value[0],
+    endDate: timeRange.value[1],
+  })
+  if (response.code === 200) {
+    ElMessage.success(response.message);
+  } else {
+    ElMessage.error(response.message);
+  }
+
+}
+
 // 鐮存崯
  const open = async(row) => { 
   try {
@@ -49,8 +69,8 @@
     if (confirmResult === 'confirm') {  
       // 鐢ㄦ埛鐐瑰嚮浜嗏�滄槸鈥濓紝鐜板湪璋冪敤鍒犻櫎鎺ュ彛  
       const response = await request.post("/cacheGlass/edgStorageCage/edgReportStatus", {
-        glassId: row.GlassId,
-        controlsId: 300,
+        glassId: row.glass_id,
+        controlsId: 8,
         line: 2001,
         machine: '鍐峰姞宸�',
     })
@@ -82,8 +102,8 @@
     if (confirmResult === 'confirm') {  
       // 鐢ㄦ埛鐐瑰嚮浜嗏�滄槸鈥濓紝鐜板湪璋冪敤鍒犻櫎鎺ュ彛  
       const response = await request.post("/cacheGlass/edgStorageCage/edgReportStatus", {
-        glassId: row.GlassId,
-        controlsId: 301,
+        glassId: row.glass_id,
+        controlsId: 9,
         line: 2001,
         machine: '鍐峰姞宸�',
     })
@@ -100,40 +120,56 @@
     console.error('鍙戠敓閿欒:', error);  
   }  
 };   
-
+let socket = null;
 const socketUrl = `ws://${WebSocketHost}:${host}/api/cacheGlass/api/talk/cacheGlass`;
 // 瀹氫箟娑堟伅澶勭悊鍑芥暟锛屾洿鏂� receivedData 鍙橀噺
 const handleMessage = (data) => {
   // 鏇存柊 tableData 鐨勬暟鎹�
-  tableData.value = data.EdgTasks1[0]
+  tableData.value = data.edgTasks[0]
 };
-// 鍒濆鍖� WebSocket锛屽苟浼犻�掓秷鎭鐞嗗嚱鏁�
 onMounted(() => {
-  // fetchFlowCardId();
-  // fetchTableData(); // 鑾峰彇鏁版嵁
-  initializeWebSocket(socketUrl, handleMessage);
+  socket = initializeWebSocket(socketUrl, handleMessage);
 });
-
+  onUnmounted(() => {
+    if (socket) {
+    closeWebSocket(socket);
+    }
+    });
 onBeforeUnmount(() => {
   console.log("鍏抽棴浜�")
   closeWebSocket();
 });
 </script>
-
 <template>
   <div>
     <el-card style="flex: 1;margin-left: 10px;margin-top: 20px;" v-loading="loading">
+      <el-select v-model="selectValuesa[0]" filterable :placeholder="$t('璇烽�夋嫨绾胯矾')" clearable>
+            <el-option label="纾ㄨ竟涓�绾�" value="2001"></el-option>
+            <el-option label="纾ㄨ竟浜岀嚎" value="2002"></el-option>
+          </el-select>
+
+          <el-select v-model="selectValuesa[1]" filterable :placeholder="$t('璇烽�夋嫨鐘舵��')" clearable >
+            <el-option label="鏈(杈�" value="0"></el-option>
+            <el-option label="纾ㄨ竟涓�" value="1"></el-option>
+            <el-option label="宸茬(杈�" value="2"></el-option>
+          </el-select>
+          <el-date-picker style="margin-left: 10px;" v-model="timeRange" type="daterange" format="YYYY/MM/DD"
+            value-format="YYYY-MM-DD" :start-placeholder="$t('reportmanage.starttime')"
+            :end-placeholder="$t('reportmanage.endtime')" :default-time="defaultTime" />
+          <el-button type="primary" style="margin-left: 10px;" @click="setEdgGlassInfoRequest()">{{
+        $t('reportmanage.inquire')
+      }}</el-button>
+
       <div style="width: 98%; height: calc(100% - 35px); overflow-y: auto;">
         <el-table height="240" ref="table" 
         @selection-change="handleSelectionChange"
         :data="tableData" :header-cell-style="{background:'#F2F3F5 ',color:'#1D2129'}">
-          <el-table-column prop="GlassId" align="center" :label="$t('workOrder.glassID')" min-width="180" />
-          <el-table-column prop="Height" align="center" :label="$t('workOrder.height')" min-width="80" />
-          <el-table-column prop="Width" align="center" :label="$t('workOrder.width')" min-width="120" />
-          <el-table-column prop="Thickness" align="center" :label="$t('workOrder.thickness')" min-width="120" />
-          <el-table-column prop="FilmsId" align="center" :label="$t('workOrder.coatingtypes')" min-width="120" />
-          <el-table-column prop="SerialNumber" align="center" :label="$t('workOrder.productionsequence')" min-width="120" />
-          <el-table-column prop="FlowCardId" align="center" :label="$t('workOrder.cardnumber')" min-width="120" />
+        <el-table-column prop="glassId" align="center" :label="$t('workOrder.glassID')" min-width="180" />
+          <el-table-column prop="width" align="center" :label="$t('workOrder.width')" min-width="120" />
+          <el-table-column prop="height" align="center" :label="$t('workOrder.height')" min-width="80" />
+          <el-table-column prop="thickness" align="center" :label="$t('workOrder.thickness')" min-width="120" />
+          <el-table-column prop="glassType" align="center" :label="$t('workOrder.glasstype')" min-width="120" />
+          <el-table-column prop="line" align="center" :label="$t('workOrder.line')" min-width="120" />
           <el-table-column fixed="right" :label="$t('workOrder.operate')" align="center" width="200">
             <template #default="scope">
               <el-button size="mini" type="text" plain @click="open(scope.row)">{{ $t('workOrder.breakage') }}</el-button>
@@ -147,7 +183,6 @@
 </template>
 
 <style scoped>
-
 #dt { display:block; float:left;line-height: 20px;margin-left: 100px;}
 #dta { display:block; float:left;line-height: 20px;margin-left: 80%;}
 #dialog-footer{

--
Gitblit v1.8.0