浏览代码

pms 保养预警

zhangcl 2 月之前
父节点
当前提交
494646e140
共有 1 个文件被更改,包括 16 次插入9 次删除
  1. 16 9
      src/views/pms/iotmainworkorder/IotDeviceMainAlarm.vue

+ 16 - 9
src/views/pms/iotmainworkorder/IotDeviceMainAlarm.vue

@@ -85,17 +85,16 @@
             </template>
           </el-table-column>
           <el-table-column label="操作" align="center" min-width="120px">
-            <!-- <template #default="scope">
-
+            <template #default="scope">
               <el-button
                 link
                 type="primary"
-                @click="handleView(scope.row.id)"
+                @click="detail(scope.row)"
                 v-hasPermi="['rq:iot-device:query']"
               >
-                调整记录
+                详情
               </el-button>
-            </template> -->
+            </template>
           </el-table-column>
         </el-table>
         <!-- 分页 -->
@@ -286,10 +285,18 @@ const handleUpload = (id: number) => {
 const currentDeviceId = ref() // 设备id
 const drawerVisible = ref<boolean>(false)
 const showDrawer = ref()
-const handleView = async (deviceId) => {
-  currentDeviceId.value = deviceId
-  drawerVisible.value = true
-  showDrawer.value.openDrawer()
+
+const detail = (row: any) => {
+  // 如果有工单ID,跳转到保养工单详情页
+  if (row.workOrderId) {
+    push({ name: 'IotMainWorkOrderDetail', params: { id: row.workOrderId } })
+  } else if (row.planId) {
+    // 如果有计划ID,跳转到保养计划详情页
+    push({ name: 'IotMaintenancePlanDetail', params: { id: row.planId } })
+  }else {
+    // 两者都为空的情况处理
+    message.warning('当前设备无保养工单或保养计划')
+  }
 }
 
 /** 导出按钮操作 */