From 48d66a079c307356997fb400d27907ff6d363b7b Mon Sep 17 00:00:00 2001
From: liudl <673013083@qq.com>
Date: 星期一, 20 一月 2025 08:35:37 +0800
Subject: [PATCH] 修改2楼分拣和1楼拆垛时获取拆垛信息接口

---
 Web/src/views/device/sortPallet/index.vue |   36 +++++++++++++++++++++++++-----------
 1 files changed, 25 insertions(+), 11 deletions(-)

diff --git a/Web/src/views/device/sortPallet/index.vue b/Web/src/views/device/sortPallet/index.vue
index 1a8c905..15dc589 100644
--- a/Web/src/views/device/sortPallet/index.vue
+++ b/Web/src/views/device/sortPallet/index.vue
@@ -18,9 +18,8 @@
                 <div class="card-container">
                     <el-card class="other-box-card" v-for="deviceInfo in devicePointData" :key="deviceInfo.id">
                         <div slot="header" class="linefix">
-                            <span>{{ deviceInfo.text }}</span>
-                            <div :class="['lineStatus', 'device-status-0']"></div>
-                            <!-- <div :class="['lineStatus', { 'device-status-0': deviceInfo.status === 0 }, { 'device-status-1': deviceInfo.status === 1 }]"></div> -->
+                            <span>{{ deviceInfo.text }}</span>                            
+                            <div :class="['lineStatus', { 'device-status-0': deviceInfo.plcStatus === true  }, { 'device-status-1': deviceInfo.plcStatus === false }]"></div>
                         </div>
                         <div class="otherValuefix" >
                             <el-form label-position="left" label-width="90px">
@@ -67,8 +66,8 @@
                                     <el-input v-model="deviceInfo.qty" readonly></el-input>
                                 </el-form-item> -->
                                 <el-form-item label="鐘舵��">
-                                    <el-input :value="deviceInfo.status ? '鍦ㄧ嚎' : '绂荤嚎'" readonly></el-input>
-                                </el-form-item>
+                                <el-input :value="deviceInfo.plcStatus ? '鍦ㄧ嚎' : '绂荤嚎'" readonly></el-input>
+                            </el-form-item>
                             </el-form>
                         </div>
                         <!-- 璁惧绫诲瀷涓虹爜鍨涙満鍣ㄤ汉 -->
@@ -109,10 +108,25 @@
 </template>
   
 <script lang="ts" setup>
-import { ref } from 'vue';
+import { ref, onMounted  } from 'vue';
 import { GetWcsPackPlcList,GetWcsPackStationPlcList,BindTaskForPLC,CloseTaskForPLC } from '/@/api/wcs/wcsDevice';
 import { pageWcsOderTask } from '/@/api/device/wcsOderTask';
 import { ElMessageBox,ElMessage } from 'element-plus';
+import { signalR,stopConnection } from './signalR';
+//杩炴帴signalR 鐩戝惉鍙樻洿
+onMounted(async () => {
+    signalR.off('PublicCheckTask');
+    signalR.on('PublicCheckTask', (data: any) => {
+        //todo 闇�瑕佹祴璇�
+        // if (data.type == 0) {
+            
+        // }
+        var index = devicePointData.value.findIndex(s => s.id == data.id);
+        if (index !== -1) {
+            devicePointData.value.splice(index, 1, data);
+        }
+    });
+});
 
 //璁惧鏁版嵁
 const deviceList=ref<any>([]);
@@ -197,15 +211,15 @@
 }
 //缁撴壒鎿嶄綔
 function closeBindDialog(lotNo){
-    if(lotNo==''){
-        ElMessage.error('璇ュ伐浣嶆湭缁戝畾浠诲姟锛�');
-        return;
-    }
+    // if(lotNo==''){
+    //     ElMessage.error('璇ュ伐浣嶆湭缁戝畾浠诲姟锛�');
+    //     return;
+    // }
     ElMessageBox.confirm(`纭畾瀵硅鎵规浠诲姟缁撴壒鍚�?`, '鎻愮ず', {
 		confirmButtonText: '纭畾',
 		cancelButtonText: '鍙栨秷',
 		type: 'warning',
-	})
+	}) 
     .then(async () => {
         closeTaskForPLC(lotNo);
     })

--
Gitblit v1.8.0