소스 검색

我处理的工单。数据权限BUG修复

ouyj 5 달 전
부모
커밋
f43e28e5ef

+ 9 - 7
ygtx-gxt/src/main/java/com/ygtx/gxt/service/impl/GxtOrderHourServiceImpl.java

@@ -549,6 +549,15 @@ public class GxtOrderHourServiceImpl implements IGxtOrderHourService {
             return;
         }
 
+        // 检查是否有"全部数据"权限的角色,如果有则不过滤
+        boolean hasAllDataPermission = roles.stream()
+                .anyMatch(role -> DataScopeAspect.DATA_SCOPE_ALL.equals(role.getDataScope()));
+
+        // 如果有任何一个角色有全部数据权限,则不过滤
+        if (hasAllDataPermission) {
+            return;
+        }
+
         // 构建业务特定的数据权限SQL
         StringBuilder orderBusinessSql = new StringBuilder();
         StringBuilder repairBusinessSql = new StringBuilder();
@@ -557,13 +566,6 @@ public class GxtOrderHourServiceImpl implements IGxtOrderHourService {
         for (SysRole role : roles) {
             String dataScope = role.getDataScope();
 
-            // 如果是全部数据权限,则不过滤
-            if (DataScopeAspect.DATA_SCOPE_ALL.equals(dataScope)) {
-                orderBusinessSql.setLength(0); // 清空之前的条件
-                repairBusinessSql.setLength(0); // 清空之前的条件
-                break; // 全部数据权限,跳出循环
-            }
-
             // 自定义数据权限 - 根据角色的数据范围值来控制查询条件
             if (DataScopeAspect.DATA_SCOPE_CUSTOM.equals(dataScope)) {
                 // 获取具有自定义数据权限的角色ID列表

+ 23 - 13
ygtx-gxt/src/main/java/com/ygtx/gxt/service/impl/GxtOrderMineServiceImpl.java

@@ -74,19 +74,29 @@ public class GxtOrderMineServiceImpl implements IGxtOrderMineService {
 
     @Override
     public List<OrderScoreInfo> selectUnionOrderListMyDone(GxtRepairOrder repairOrder, GxtWorkOrder workOrder) {
-        // 添加业务特定的数据权限过滤
-        addBusinessDataScopeFilter(repairOrder, workOrder);
-
-        // 设置创建人,用于数据权限过滤
-        if(!Constants.SUPER_ADMIN.equals(SecurityUtils.getUsername())){
-            if (repairOrder.getCreateBy() == null || repairOrder.getCreateBy().isEmpty()) {
-                repairOrder.setCreateBy(SecurityUtils.getUsername());
-            }
-
-            if (workOrder.getCreateBy() == null || workOrder.getCreateBy().isEmpty()) {
-                workOrder.setCreateBy(SecurityUtils.getUsername());
-            }
-        }
+        //添加处理人员过滤,GxtRepairOrder从对应的GxtRepairOrderPerson取userId和GxtRepairOrderFlow取operatorId即是对应的处理人员,
+        // GxtWorkOrder从对应的GxtWorkOrderPerson取userId和GxtWorkOrderFlow即是对应的处理人员,
+        // 只要能对应当前登录用户,就查询出来,
+        Long currentUserId = SecurityUtils.getUserId();
+        
+        // 构建维修工单的处理人员过滤条件
+        StringBuilder repairFilterSql = new StringBuilder();
+        repairFilterSql.append(" AND (EXISTS(SELECT 1 FROM gxt_repair_order_person p WHERE p.order_id = t.id AND p.user_id = ")
+                .append(currentUserId)
+                .append(") OR EXISTS(SELECT 1 FROM gxt_repair_order_flow f WHERE f.order_id = t.id AND f.operator_id = ")
+                .append(currentUserId)
+                .append("))");
+        repairOrder.getParams().put("businessDataScope", repairFilterSql.toString());
+        
+        // 构建维保工单的处理人员过滤条件
+        StringBuilder workFilterSql = new StringBuilder();
+        workFilterSql.append(" AND (EXISTS(SELECT 1 FROM gxt_work_order_person p WHERE p.order_id = t.id AND p.user_id = ")
+                .append(currentUserId)
+                .append(") OR EXISTS(SELECT 1 FROM gxt_work_order_flow f WHERE f.order_id = t.id AND f.operator_id = ")
+                .append(currentUserId)
+                .append("))");
+        workOrder.getParams().put("businessDataScope", workFilterSql.toString());
+        
         // 查询工单列表
         List<OrderScoreInfo> orderList = gxtOrderMineMapper.selectUnionOrderList(repairOrder, workOrder);
 

+ 9 - 7
ygtx-gxt/src/main/java/com/ygtx/gxt/service/impl/GxtOrderScoreServiceImpl.java

@@ -837,6 +837,15 @@ public class GxtOrderScoreServiceImpl implements IGxtOrderScoreService {
             return;
         }
 
+        // 检查是否有"全部数据"权限的角色,如果有则不过滤
+        boolean hasAllDataPermission = roles.stream()
+                .anyMatch(role -> DataScopeAspect.DATA_SCOPE_ALL.equals(role.getDataScope()));
+
+        // 如果有任何一个角色有全部数据权限,则不过滤
+        if (hasAllDataPermission) {
+            return;
+        }
+
         // 构建业务特定的数据权限SQL
         StringBuilder orderBusinessSql = new StringBuilder();
         StringBuilder repairBusinessSql = new StringBuilder();
@@ -845,13 +854,6 @@ public class GxtOrderScoreServiceImpl implements IGxtOrderScoreService {
         for (SysRole role : roles) {
             String dataScope = role.getDataScope();
 
-            // 如果是全部数据权限,则不过滤
-            if (DataScopeAspect.DATA_SCOPE_ALL.equals(dataScope)) {
-                orderBusinessSql.setLength(0); // 清空之前的条件
-                repairBusinessSql.setLength(0); // 清空之前的条件
-                break; // 全部数据权限,跳出循环
-            }
-
             // 自定义数据权限 - 根据角色的数据范围值来控制查询条件
             if (DataScopeAspect.DATA_SCOPE_CUSTOM.equals(dataScope)) {
                 // 获取具有自定义数据权限的角色ID列表

+ 27 - 24
ygtx-gxt/src/main/java/com/ygtx/gxt/service/impl/GxtRepairOrderServiceImpl.java

@@ -923,19 +923,22 @@ public class GxtRepairOrderServiceImpl implements IGxtRepairOrderService
             return;
         }
 
+        // 检查是否有"全部数据"权限的角色,如果有则不过滤
+        boolean hasAllDataPermission = roles.stream()
+                .anyMatch(role -> DataScopeAspect.DATA_SCOPE_ALL.equals(role.getDataScope()));
+    
+        // 如果有任何一个角色有全部数据权限,则不过滤
+        if (hasAllDataPermission) {
+            return;
+        }
+
         // 构建业务特定的数据权限SQL
         StringBuilder businessSql = new StringBuilder();
-        
+    
         // 遍历用户角色,根据角色的数据范围添加业务特定的权限控制
         for (SysRole role : roles) {
             String dataScope = role.getDataScope();
             
-            // 如果是全部数据权限,则不过滤
-            if (DataScopeAspect.DATA_SCOPE_ALL.equals(dataScope)) {
-                businessSql.setLength(0); // 清空之前的条件
-                break; // 全部数据权限,跳出循环
-            }
-            
             // 自定义数据权限 - 根据角色的数据范围值来控制查询条件
             if (DataScopeAspect.DATA_SCOPE_CUSTOM.equals(dataScope)) {
                 // 获取具有自定义数据权限的角色ID列表
@@ -998,23 +1001,23 @@ public class GxtRepairOrderServiceImpl implements IGxtRepairOrderService
                     businessSql.append(" OR ");
                 }
                 businessSql.append("(t.pcs_station_id IN ")
-                          .append("(SELECT dept_id FROM sys_dept WHERE dept_id = ")
-                          .append(currentUser.getDeptId())
-                          .append(" OR FIND_IN_SET(")
-                          .append(currentUser.getDeptId())
-                          .append(", ancestors))")
-                          .append(" OR t.pcs_station_pid IN ")
-                          .append("(SELECT dept_id FROM sys_dept WHERE dept_id = ")
-                          .append(currentUser.getDeptId())
-                          .append(" OR FIND_IN_SET(")
-                          .append(currentUser.getDeptId())
-                          .append(", ancestors))")
-                          .append(" OR t.gxt_center_id IN ")
-                          .append("(SELECT dept_id FROM sys_dept WHERE dept_id = ")
-                          .append(currentUser.getDeptId())
-                          .append(" OR FIND_IN_SET(")
-                          .append(currentUser.getDeptId())
-                          .append(", ancestors)))");
+                              .append("(SELECT dept_id FROM sys_dept WHERE dept_id = ")
+                              .append(currentUser.getDeptId())
+                              .append(" OR FIND_IN_SET(")
+                              .append(currentUser.getDeptId())
+                              .append(", ancestors))")
+                              .append(" OR t.pcs_station_pid IN ")
+                              .append("(SELECT dept_id FROM sys_dept WHERE dept_id = ")
+                              .append(currentUser.getDeptId())
+                              .append(" OR FIND_IN_SET(")
+                              .append(currentUser.getDeptId())
+                              .append(", ancestors))")
+                              .append(" OR t.gxt_center_id IN ")
+                              .append("(SELECT dept_id FROM sys_dept WHERE dept_id = ")
+                              .append(currentUser.getDeptId())
+                              .append(" OR FIND_IN_SET(")
+                              .append(currentUser.getDeptId())
+                              .append(", ancestors)))");
                 continue;
             }
             

+ 56 - 20
ygtx-gxt/src/main/java/com/ygtx/gxt/service/impl/GxtWorkOrderServiceImpl.java

@@ -1267,6 +1267,15 @@ public class GxtWorkOrderServiceImpl implements IGxtWorkOrderService
             return;
         }
 
+        // 检查是否有"全部数据"权限的角色,如果有则不过滤
+        boolean hasAllDataPermission = roles.stream()
+                .anyMatch(role -> DataScopeAspect.DATA_SCOPE_ALL.equals(role.getDataScope()));
+
+        // 如果有任何一个角色有全部数据权限,则不过滤
+        if (hasAllDataPermission) {
+            return;
+        }
+
         // 构建业务特定的数据权限SQL
         StringBuilder businessSql = new StringBuilder();
 
@@ -1274,12 +1283,6 @@ public class GxtWorkOrderServiceImpl implements IGxtWorkOrderService
         for (SysRole role : roles) {
             String dataScope = role.getDataScope();
 
-            // 如果是全部数据权限,则不过滤
-            if (DataScopeAspect.DATA_SCOPE_ALL.equals(dataScope)) {
-                businessSql.setLength(0); // 清空之前的条件
-                break; // 全部数据权限,跳出循环
-            }
-
             // 自定义数据权限 - 根据角色的数据范围值来控制查询条件
             if (DataScopeAspect.DATA_SCOPE_CUSTOM.equals(dataScope)) {
                 // 获取具有自定义数据权限的角色ID列表
@@ -1502,6 +1505,15 @@ public class GxtWorkOrderServiceImpl implements IGxtWorkOrderService
             return;
         }
 
+        // 检查是否有"全部数据"权限的角色,如果有则不过滤
+        boolean hasAllDataPermission = roles.stream()
+                .anyMatch(role -> DataScopeAspect.DATA_SCOPE_ALL.equals(role.getDataScope()));
+
+        // 如果有任何一个角色有全部数据权限,则不过滤
+        if (hasAllDataPermission) {
+            return;
+        }
+
         // 构建业务特定的数据权限SQL
         StringBuilder businessSql = new StringBuilder();
 
@@ -1509,12 +1521,6 @@ public class GxtWorkOrderServiceImpl implements IGxtWorkOrderService
         for (SysRole role : roles) {
             String dataScope = role.getDataScope();
 
-            // 如果是全部数据权限,则不过滤
-            if (DataScopeAspect.DATA_SCOPE_ALL.equals(dataScope)) {
-                businessSql.setLength(0); // 清空之前的条件
-                break; // 全部数据权限,跳出循环
-            }
-
             // 自定义数据权限 - 根据角色的数据范围值来控制查询条件
             if (DataScopeAspect.DATA_SCOPE_CUSTOM.equals(dataScope)) {
                 // 获取具有自定义数据权限的角色ID列表
@@ -1596,7 +1602,17 @@ public class GxtWorkOrderServiceImpl implements IGxtWorkOrderService
                 continue;
             }
         }
-
+        String selfData = configService.selectConfigByKey("gxt.oder.selfData");
+        if (StringUtils.isNotEmpty(selfData) && "1".equals(selfData)) {
+            if (businessSql.length() > 0) {
+                businessSql.append(" OR ");
+            }
+            businessSql.append("(t.dept_id = ")
+                    .append(currentUser.getDeptId())
+                    .append(" OR t.parent_id = ")
+                    .append(currentUser.getDeptId())
+                    .append(")");
+        }
         // 如果构建了业务特定的过滤条件,则添加到查询参数中
         if (businessSql.length() > 0) {
             String businessDataScopeSql = " AND (" + businessSql.toString() + ")";
@@ -1633,6 +1649,15 @@ public class GxtWorkOrderServiceImpl implements IGxtWorkOrderService
             return;
         }
 
+        // 检查是否有"全部数据"权限的角色,如果有则不过滤
+        boolean hasAllDataPermission = roles.stream()
+                .anyMatch(role -> DataScopeAspect.DATA_SCOPE_ALL.equals(role.getDataScope()));
+
+        // 如果有任何一个角色有全部数据权限,则不过滤
+        if (hasAllDataPermission) {
+            return;
+        }
+
         // 构建业务特定的数据权限SQL
         StringBuilder businessSql = new StringBuilder();
 
@@ -1640,12 +1665,6 @@ public class GxtWorkOrderServiceImpl implements IGxtWorkOrderService
         for (SysRole role : roles) {
             String dataScope = role.getDataScope();
 
-            // 如果是全部数据权限,则不过滤
-            if (DataScopeAspect.DATA_SCOPE_ALL.equals(dataScope)) {
-                businessSql.setLength(0); // 清空之前的条件
-                break; // 全部数据权限,跳出循环
-            }
-
             // 自定义数据权限 - 根据角色的数据范围值来控制查询条件
             if (DataScopeAspect.DATA_SCOPE_CUSTOM.equals(dataScope)) {
                 // 获取具有自定义数据权限的角色ID列表
@@ -1748,7 +1767,24 @@ public class GxtWorkOrderServiceImpl implements IGxtWorkOrderService
                 continue;
             }
         }
-
+        String selfData = configService.selectConfigByKey("gxt.oder.selfData");
+        if (StringUtils.isNotEmpty(selfData) && "1".equals(selfData)) {
+            if (businessSql.length() > 0) {
+                businessSql.append(" OR ");
+            }
+            businessSql.append("(wo.team_leader_id = ")
+                    .append(currentUser.getUserId())
+                    .append(" OR wo.assign_user_id = ")
+                    .append(currentUser.getUserId())
+                    .append(" OR wo.accept_user_id = ")
+                    .append(currentUser.getUserId())
+                    .append(" OR wo.id IN (SELECT order_id FROM gxt_work_order_person WHERE user_id = ")
+                    .append(currentUser.getUserId())
+                    .append(") ")
+                    .append(" OR wo.create_by = '")
+                    .append(currentUser.getUserName())
+                    .append("')");
+        }
         // 如果构建了业务特定的过滤条件,则添加到查询参数中
         if (businessSql.length() > 0) {
             String businessDataScopeSql = " AND (" + businessSql.toString() + ")";

+ 704 - 0
ygtx-ui/src/views/gxt/orderMyDone/index.vue

@@ -0,0 +1,704 @@
+<template>
+  <div class="app-container">
+    <!-- 查询条件区域 -->
+    <el-form :model="queryParams" ref="queryRef" :inline="true" v-show="showSearch" label-width="100px" label-position="top">
+      <el-form-item label="工单编码" prop="workOrderProjectNo" label-position="top">
+        <el-input
+            v-model="queryParams.workOrderProjectNo"
+            placeholder="请输入工单编码"
+            clearable
+            @keyup.enter="handleQuery"
+        />
+      </el-form-item>
+      <el-form-item label="风机编号" prop="pcsDeviceName" label-position="top">
+        <el-input
+            v-model="queryParams.pcsDeviceName"
+            placeholder="请输入风机编号"
+            clearable
+            @keyup.enter="handleQuery"
+        />
+      </el-form-item>
+      <el-form-item label="维保中心" prop="gxtCenter" label-position="top">
+        <el-select
+            v-model="queryParams.gxtCenter"
+            placeholder="请选择维保中心"
+            clearable
+            @change="handleMaintenanceCenterChange"
+        >
+          <el-option
+              v-for="item in maintenanceCenterOptions"
+              :key="item.deptId"
+              :label="item.deptName"
+              :value="item.deptName">
+          </el-option>
+        </el-select>
+      </el-form-item>
+      <el-form-item label="场站" prop="pcsStationName" label-position="top">
+        <el-select
+            v-model="queryParams.pcsStationName"
+            placeholder="请选择场站"
+            clearable
+            :disabled="!queryParams.gxtCenter"
+        >
+          <el-option
+              v-for="item in stationOptions"
+              :key="item.deptId"
+              :label="item.deptName"
+              :value="item.deptName">
+          </el-option>
+        </el-select>
+      </el-form-item>
+      <el-form-item label="工单状态" prop="workOrderStatus" label-position="top">
+        <el-select v-model="queryParams.workOrderStatus" placeholder="请选择工单状态" clearable>
+          <el-option
+              v-for="dict in gxt_work_order_status"
+              :key="dict.value"
+              :label="dict.label"
+              :value="dict.value"
+          />
+        </el-select>
+      </el-form-item>
+    </el-form>
+    <div style="float: right;margin-bottom: 10px;">
+      <el-button icon="Refresh" @click="resetQuery">重置</el-button>
+      <el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
+    </div>
+
+    <!-- 操作按钮区域 -->
+    <el-row :gutter="10" class="mb8">
+      <!-- 空的按钮区域,保持与其他页面一致的间距 -->
+    </el-row>
+
+    <!-- 工单列表 -->
+    <el-table
+        v-loading="loading"
+        :data="orderList"
+        style="width: 100%"
+        :max-height="tableHeight"
+    >
+      <el-table-column label="工单类型" align="center" prop="orderType" width="100">
+        <template #default="scope">
+          <el-tag v-if="scope.row.orderType === 1" type="danger">维修工单</el-tag>
+          <el-tag v-else type="success">维保工单</el-tag>
+        </template>
+      </el-table-column>
+      <el-table-column label="工单编码" align="center" prop="workOrderProjectNo" width="160" fixed>
+        <template #default="scope">
+          <el-button link type="primary" @click="handleView(scope.row)">
+            {{ scope.row.workOrderProjectNo }}
+          </el-button>
+        </template>
+      </el-table-column>
+      <el-table-column label="风机编号" align="center" prop="pcsDeviceName" width="120" :show-overflow-tooltip="true">
+        <template #default="scope">
+          {{ scope.row.pcsDeviceName || '-' }}
+        </template>
+      </el-table-column>
+      <el-table-column label="工单状态" align="center" prop="workOrderStatus" min-width="100">
+        <template #default="scope">
+          <dict-tag :options="gxt_work_order_status" :value="scope.row.workOrderStatus" />
+        </template>
+      </el-table-column>
+      <el-table-column label="维保中心" align="center" prop="gxtCenter"  width="150" :show-overflow-tooltip="true">
+        <template #default="scope">
+          {{ scope.row.gxtCenter || '-' }}
+        </template>
+      </el-table-column>
+      <el-table-column label="场站" align="center" prop="pcsStationName" width="150" :show-overflow-tooltip="true">
+        <template #default="scope">
+          {{ scope.row.pcsStationName || '-' }}
+        </template>
+      </el-table-column>
+      <el-table-column label="品牌" align="center" prop="brand" width="120" :show-overflow-tooltip="true">
+        <template #default="scope">
+          {{ scope.row.brand || '-' }}
+        </template>
+      </el-table-column>
+      <el-table-column label="机型" align="center" prop="model" width="120" :show-overflow-tooltip="true">
+        <template #default="scope">
+          {{ scope.row.model || '-' }}
+        </template>
+      </el-table-column>
+      <el-table-column label="接单人" align="center" prop="acceptUserName" width="100" >
+        <template #default="scope">
+          {{ scope.row.acceptUserName || '-' }}
+        </template>
+      </el-table-column>
+      <el-table-column label="接单时间" align="center" prop="acceptTime" width="150">
+        <template #default="scope">
+          <span>{{ scope.row.acceptTime ? parseTime(scope.row.acceptTime, '{y}-{m}-{d} {h}:{i}') : '-' }}</span>
+        </template>
+      </el-table-column>
+      <el-table-column label="工作负责人" align="center" prop="teamLeaderName" width="100" >
+        <template #default="scope">
+          {{ scope.row.teamLeaderName || '-' }}
+        </template>
+      </el-table-column>
+      <el-table-column label="开始时间" align="center" prop="realStartTime" width="150">
+        <template #default="scope">
+          <span>{{ scope.row.realStartTime ? parseTime(scope.row.realStartTime, '{y}-{m}-{d} {h}:{i}') : '-' }}</span>
+        </template>
+      </el-table-column>
+      <el-table-column label="结束时间" align="center" prop="realEndTime" width="150">
+        <template #default="scope">
+          <span>{{ scope.row.realEndTime ? parseTime(scope.row.realEndTime, '{y}-{m}-{d} {h}:{i}') : '-' }}</span>
+        </template>
+      </el-table-column>
+      <el-table-column label="操作" align="center" class-name="small-padding fixed-width" min-width="150" fixed="right">
+        <template #default="scope">
+          <el-button
+              type="info"
+              link
+              @click="handleView(scope.row)"
+              v-hasPermi="['gxt:orderMine:query']"
+          ><i class="fa fa-eye"></i>查看</el-button>
+        </template>
+      </el-table-column>
+    </el-table>
+
+    <pagination
+        v-show="total>0"
+        :total="total"
+        v-model:page="queryParams.pageNum"
+        v-model:limit="queryParams.pageSize"
+        @pagination="getList"
+    />
+
+    <!-- 维修工单详情对话框 -->
+    <el-dialog title="维修工单详情" v-model="repairDetailDialogVisible" width="1000px" append-to-body>
+      <el-row :gutter="20">
+        <!-- 工单信息 -->
+        <el-col :span="8">
+          <div class="info-section">
+            <h3 class="section-title">工单信息</h3>
+            <div class="info-content">
+              <el-form label-width="100px" label-position="top">
+                <el-row :gutter="20">
+                  <el-col :span="24">
+                    <el-form-item label="工单编码">{{ detailData.workOrderProjectNo }}</el-form-item>
+                  </el-col>
+                  <el-col :span="24">
+                    <el-form-item label="工单状态">
+                      <dict-tag :options="gxt_work_order_status" :value="detailData.workOrderStatus" />
+                    </el-form-item>
+                  </el-col>
+                  <el-col :span="24">
+                    <el-form-item label="风机编号">{{ detailData.pcsDeviceName || '-' }}</el-form-item>
+                  </el-col>
+                  <el-col :span="24">
+                    <el-form-item label="维保中心">{{ detailData.gxtCenter || '-' }}</el-form-item>
+                  </el-col>
+                  <el-col :span="24">
+                    <el-form-item label="场站">{{ detailData.pcsStationName || '-' }}</el-form-item>
+                  </el-col>
+                  <el-col :span="24">
+                    <el-form-item label="品牌">{{ detailData.brand || '-' }}</el-form-item>
+                  </el-col>
+                  <el-col :span="24">
+                    <el-form-item label="机型">{{ detailData.model || '-' }}</el-form-item>
+                  </el-col>
+                  <el-col :span="24">
+                    <el-form-item label="发生时间">{{ parseTime(detailData.occurTime, '{y}-{m}-{d} {h}:{i}') || '-' }}</el-form-item>
+                  </el-col>
+                  <el-col :span="24">
+                    <el-form-item label="故障代码">{{ detailData.faultCode || '-' }}</el-form-item>
+                  </el-col>
+                </el-row>
+              </el-form>
+            </div>
+          </div>
+        </el-col>
+
+        <!-- 处理信息 -->
+        <el-col :span="8">
+          <div class="info-section">
+            <h3 class="section-title">处理信息</h3>
+            <div class="info-content">
+              <el-form label-width="100px" label-position="top">
+                <el-row :gutter="20">
+                  <el-col :span="24">
+                    <el-form-item label="下发人">{{ detailData.assignUserName || '-' }}</el-form-item>
+                  </el-col>
+                  <el-col :span="24">
+                    <el-form-item label="下发时间">{{ parseTime(detailData.assignTime, '{y}-{m}-{d} {h}:{i}') || '-' }}</el-form-item>
+                  </el-col>
+                  <el-col :span="24">
+                    <el-form-item label="接单人">{{ detailData.acceptUserName || '-'}}</el-form-item>
+                  </el-col>
+                  <el-col :span="24">
+                    <el-form-item label="接单时间">{{ parseTime(detailData.acceptTime, '{y}-{m}-{d} {h}:{i}') || '-' }}</el-form-item>
+                  </el-col>
+                  <el-col :span="24">
+                    <el-form-item label="工作负责人">{{ detailData.teamLeaderName || '-' }}</el-form-item>
+                  </el-col>
+                  <el-col :span="24">
+                    <el-form-item label="检修人员">{{ detailData.workGroupMemberName || '-' }}</el-form-item>
+                  </el-col>
+                  <el-col :span="24">
+                    <el-form-item label="MIS工单编码">{{ detailData.misOrderNo || '-' }}</el-form-item>
+                  </el-col>
+                  <el-col :span="24">
+                    <el-form-item label="开始时间">{{ parseTime(detailData.realStartTime, '{y}-{m}-{d} {h}:{i}') || '-' }}</el-form-item>
+                  </el-col>
+                  <el-col :span="24">
+                    <el-form-item label="结束时间">{{ parseTime(detailData.realEndTime, '{y}-{m}-{d} {h}:{i}') || '-' }}</el-form-item>
+                  </el-col>
+                  <el-col :span="24">
+                    <el-form-item label="恢复运行时间">{{ parseTime(detailData.restartTime, '{y}-{m}-{d} {h}:{i}') || '-' }}</el-form-item>
+                  </el-col>
+                </el-row>
+              </el-form>
+            </div>
+          </div>
+        </el-col>
+
+        <!-- 工单流转记录 -->
+        <el-col :span="8">
+          <div class="info-section">
+            <h3 class="section-title">工单流转</h3>
+            <div class="flow-history">
+              <el-timeline>
+                <el-timeline-item type="primary"
+                                  v-for="(flow, index) in flowList"
+                                  :key="index"
+                                  :timestamp="parseTime(flow.actionTime, '{y}-{m}-{d} {h}:{i}')"
+                >
+                  <div class="flow-item">
+                    <h4><dict-tag :options="gxt_repair_order_flow_action_type" :value="flow.actionType" /></h4>
+                    <p>
+                      {{ flow.operatorName }}
+                    </p>
+                  </div>
+                </el-timeline-item>
+              </el-timeline>
+            </div>
+          </div>
+        </el-col>
+      </el-row>
+      <el-form label-position="top">
+        <el-row>
+          <el-col :span="24">
+            <el-form-item label="故障信息">
+              <div class="content-text">{{ detailData.faultBarcode || '-' }}</div>
+            </el-form-item>
+          </el-col>
+        </el-row>
+      </el-form>
+      <!-- 附件信息 -->
+      <div class="info-section" v-if="detailData.attachmentUrls">
+        <h3 class="section-title">结单附件</h3>
+        <el-row>
+          <el-col :span="24">
+            <el-form-item label="附件">
+              <preview :limit="8" v-model="detailData.attachmentUrls" :filesize="5" disabled></preview>
+            </el-form-item>
+          </el-col>
+        </el-row>
+      </div>
+      <template #footer>
+        <div class="dialog-footer">
+          <el-button @click="repairDetailDialogVisible = false">关 闭</el-button>
+        </div>
+      </template>
+    </el-dialog>
+
+    <!-- 维保工单详情对话框 -->
+    <el-dialog title="维保工单详情" v-model="workDetailDialogVisible" width="1000px" append-to-body>
+      <el-row :gutter="20">
+        <!-- 工单信息 -->
+        <el-col :span="8">
+          <div class="info-section">
+            <h3 class="section-title">工单信息</h3>
+            <div class="info-content">
+              <el-form label-width="100px" label-position="top">
+                <el-row :gutter="20">
+                  <el-col :span="24">
+                    <el-form-item label="工单编码">{{ detailData.workOrderProjectNo }}</el-form-item>
+                  </el-col>
+                  <el-col :span="24">
+                    <el-form-item label="工单状态">
+                      <dict-tag :options="gxt_work_order_status" :value="detailData.workOrderStatus" />
+                    </el-form-item>
+                  </el-col>
+                  <el-col :span="24">
+                    <el-form-item label="风机编号">{{ detailData.pcsDeviceName || '-' }}</el-form-item>
+                  </el-col>
+                  <el-col :span="24">
+                    <el-form-item label="维保中心">{{ detailData.gxtCenter || '-' }}</el-form-item>
+                  </el-col>
+                  <el-col :span="24">
+                    <el-form-item label="场站">{{ detailData.pcsStationName || '-' }}</el-form-item>
+                  </el-col>
+                  <el-col :span="24">
+                    <el-form-item label="品牌">{{ detailData.brand || '-' }}</el-form-item>
+                  </el-col>
+                  <el-col :span="24">
+                    <el-form-item label="机型">{{ detailData.model || '-' }}</el-form-item>
+                  </el-col>
+                  <el-col :span="24">
+                    <el-form-item label="维保类型">
+                      <dict-tag :options="gxt_inspection_type" :value="detailData.inspectionType" />
+                    </el-form-item>
+                  </el-col>
+                </el-row>
+              </el-form>
+            </div>
+          </div>
+        </el-col>
+
+        <!-- 处理信息 -->
+        <el-col :span="8">
+          <div class="info-section">
+            <h3 class="section-title">处理信息</h3>
+            <div class="info-content">
+              <el-form label-width="100px" label-position="top">
+                <el-row :gutter="20">
+                  <el-col :span="24">
+                    <el-form-item label="下发人">{{ detailData.assignUserName || '-' }}</el-form-item>
+                  </el-col>
+                  <el-col :span="24">
+                    <el-form-item label="下发时间">{{ parseTime(detailData.assignTime, '{y}-{m}-{d} {h}:{i}') || '-' }}</el-form-item>
+                  </el-col>
+                  <el-col :span="24">
+                    <el-form-item label="接单人">{{ detailData.acceptUserName || '-'}}</el-form-item>
+                  </el-col>
+                  <el-col :span="24">
+                    <el-form-item label="接单时间">{{ parseTime(detailData.acceptTime, '{y}-{m}-{d} {h}:{i}') || '-' }}</el-form-item>
+                  </el-col>
+                  <el-col :span="24">
+                    <el-form-item label="工作负责人">{{ detailData.teamLeaderName || '-' }}</el-form-item>
+                  </el-col>
+                  <el-col :span="24">
+                    <el-form-item label="检修人员">{{ detailData.workGroupMemberName || '-' }}</el-form-item>
+                  </el-col>
+                  <el-col :span="24">
+                    <el-form-item label="MIS工单编码">{{ detailData.misNo || '-' }}</el-form-item>
+                  </el-col>
+                  <el-col :span="24">
+                    <el-form-item label="开始时间">{{ parseTime(detailData.realStartTime, '{y}-{m}-{d} {h}:{i}') || '-' }}</el-form-item>
+                  </el-col>
+                  <el-col :span="24">
+                    <el-form-item label="结束时间">{{ parseTime(detailData.realEndTime, '{y}-{m}-{d} {h}:{i}') || '-' }}</el-form-item>
+                  </el-col>
+                  <el-col :span="24">
+                    <el-form-item label="恢复运行时间">{{ parseTime(detailData.restartTime, '{y}-{m}-{d} {h}:{i}') || '-' }}</el-form-item>
+                  </el-col>
+                </el-row>
+              </el-form>
+            </div>
+          </div>
+        </el-col>
+
+        <!-- 工单流转记录 -->
+        <el-col :span="8">
+          <div class="info-section">
+            <h3 class="section-title">工单流转</h3>
+            <div class="flow-history">
+              <el-timeline>
+                <el-timeline-item type="primary"
+                                  v-for="(flow, index) in flowList"
+                                  :key="index"
+                                  :timestamp="parseTime(flow.actionTime, '{y}-{m}-{d} {h}:{i}')"
+                >
+                  <div class="flow-item">
+                    <h4><dict-tag :options="gxt_repair_order_flow_action_type" :value="flow.actionType" /></h4>
+                    <p>
+                      {{ flow.operatorName }}
+                    </p>
+                  </div>
+                </el-timeline-item>
+              </el-timeline>
+            </div>
+          </div>
+        </el-col>
+      </el-row>
+      <el-form label-position="top">
+        <el-row>
+          <el-col :span="24">
+            <el-form-item label="维保内容">
+              <div class="content-text">{{ detailData.content || '-' }}</div>
+            </el-form-item>
+          </el-col>
+        </el-row>
+      </el-form>
+      <!-- 附件信息 -->
+      <div class="info-section" v-if="detailData.attachmentUrls">
+        <h3 class="section-title">结单附件</h3>
+        <el-row>
+          <el-col :span="24">
+            <el-form-item label="附件">
+              <preview :limit="8" v-model="detailData.attachmentUrls" :filesize="5" disabled></preview>
+            </el-form-item>
+          </el-col>
+        </el-row>
+      </div>
+      <template #footer>
+        <div class="dialog-footer">
+          <el-button @click="workDetailDialogVisible = false">关 闭</el-button>
+        </div>
+      </template>
+    </el-dialog>
+  </div>
+</template>
+
+<script setup>
+import { getCurrentInstance, reactive, ref, toRefs, onMounted } from "vue";
+import { listMyDone, getOrderInfo } from "@/api/gxt/orderMine.js";
+import { listMaintenanceCenters, listStationsByMaintenanceCenter } from "@/api/gxt/equipment.js";
+import preview from '@/components/FileUpload/preview.vue'
+
+const { proxy } = getCurrentInstance();
+
+// 显示搜索栏
+const showSearch = ref(true);
+
+// 加载状态
+const loading = ref(false);
+
+// 表格高度
+const tableHeight = ref(window.innerHeight - 300);
+
+// 数据总数
+const total = ref(0);
+
+// 维修工单详情对话框可见性
+const repairDetailDialogVisible = ref(false);
+
+// 维保工单详情对话框可见性
+const workDetailDialogVisible = ref(false);
+
+// 维保中心选项
+const maintenanceCenterOptions = ref([]);
+
+// 场站选项
+const stationOptions = ref([]);
+
+// 工单列表
+const orderList = ref([]);
+
+// 详情数据
+const detailData = ref({});
+
+// 工单流转记录
+const flowList = ref([]);
+
+// 查询参数
+const data = reactive({
+  queryParams: {
+    pageNum: 1,
+    pageSize: 10,
+    workOrderProjectNo: undefined,
+    workOrderStatus: undefined,
+    gxtCenter: undefined,
+    pcsStationName: undefined,
+    pcsDeviceName: undefined
+  }
+});
+
+const { queryParams } = toRefs(data);
+
+// 获取字典数据
+const { gxt_maintenance_type, gxt_work_order_status, gxt_order_priority_type,gxt_repair_order_flow_action_type,gxt_order_suspend_reason,gxt_inspection_type,gxt_pause_reasons } = proxy.useDict("gxt_maintenance_type", "gxt_work_order_status", "gxt_order_priority_type","gxt_repair_order_flow_action_type","gxt_order_suspend_reason","gxt_inspection_type","gxt_pause_reasons")
+
+// 页面加载时执行
+onMounted(() => {
+  getList();
+  getMaintenanceCenterAndStationList();
+  window.addEventListener('resize', handleResize);
+});
+
+// 获取列表数据
+function getList() {
+  loading.value = true;
+  listMyDone(queryParams.value).then(response => {
+    orderList.value = response.rows;
+    total.value = response.total;
+    loading.value = false;
+  });
+}
+
+// 获取维保中心和场站列表
+function getMaintenanceCenterAndStationList() {
+  listMaintenanceCenters().then(response => {
+    maintenanceCenterOptions.value = response.data.map(item => {
+      return { deptName: item, deptId: item };
+    });
+
+    // 如果已选择维保中心,则筛选出该维保中心下的场站
+    if (queryParams.value.gxtCenter) {
+      listStationsByMaintenanceCenter(queryParams.value.gxtCenter).then(res => {
+        stationOptions.value = res.data.map(item => {
+          return { deptName: item, deptId: item };
+        });
+      });
+    } else {
+      // 如果未选择维保中心,则清空场站选项
+      stationOptions.value = [];
+    }
+  });
+}
+
+// 处理维保中心变更
+function handleMaintenanceCenterChange(selectedCenter) {
+  // 清空场站选择
+  queryParams.value.pcsStationName = null;
+
+  // 如果选择了维保中心,则加载对应的场站
+  if (selectedCenter) {
+    listStationsByMaintenanceCenter(selectedCenter).then(response => {
+      stationOptions.value = response.data.map(item => {
+        return { deptName: item, deptId: item };
+      });
+    });
+  } else {
+    // 如果未选择维保中心,则清空场站选项
+    stationOptions.value = [];
+  }
+}
+
+// 搜索按钮操作
+function handleQuery() {
+  queryParams.value.pageNum = 1;
+  getList();
+}
+
+// 重置按钮操作
+function resetQuery() {
+  proxy.resetForm("queryRef");
+  handleQuery();
+}
+
+// 查看详情
+function handleView(row) {
+  // 调用后端接口获取详细信息
+  getOrderInfo(row.orderType, row.id).then(response => {
+    detailData.value = response.data;
+    // 从工单详情中获取流转记录
+    flowList.value = response.data.workOrderFlowList || response.data.repairOrderFlowList || [];
+    
+    if (row.orderType === 1) {
+      // 维修工单
+      repairDetailDialogVisible.value = true;
+    } else {
+      // 维保工单
+      workDetailDialogVisible.value = true;
+    }
+  }).catch(error => {
+    proxy.$modal.msgError("获取工单详情失败:" + error.message);
+  });
+}
+
+// 处理窗口大小变化
+function handleResize() {
+  tableHeight.value = window.innerHeight - 300;
+}
+</script>
+
+<style scoped>
+/* 表单字段间距调整 */
+.el-form-item {
+  margin-bottom: 18px;
+}
+
+.text-gray-500 {
+  color: #6b7280;
+}
+
+.card-header {
+  font-weight: bold;
+  font-size: 16px;
+}
+
+.info-section {
+  padding: 16px 0;
+  height: 100%;
+  box-sizing: border-box;
+}
+
+.section-title {
+  font-weight: bold;
+  font-size: 16px;
+  margin-bottom: 15px;
+  padding-bottom: 10px;
+  border-bottom: 1px solid #ebeef5;
+}
+
+.info-content {
+  height: calc(100% - 30px);
+  overflow-y: auto;
+  overflow-x: hidden; /* 防止横向滚动 */
+  padding: 0 10px; /* 添加内边距防止内容贴边 */
+}
+
+.info-item {
+  margin-bottom: 12px;
+}
+
+.info-item label {
+  display: block;
+  font-size: 12px;
+  color: #999;
+  margin-bottom: 4px;
+}
+
+.info-item p {
+  font-size: 14px;
+  color: #333;
+  margin: 0;
+  line-height: 1.4;
+}
+
+.flow-history {
+  height: 100%;
+  padding: 0 10px; /* 添加内边距防止内容贴边 */
+}
+
+.flow-history .el-timeline {
+  margin-left: 0;
+  padding-left: 0;
+}
+
+.flow-item {
+  /*padding: 10px;
+  border-radius: 4px;*/
+}
+
+.flow-item h4 {
+  margin: 0 0 5px 0;
+  font-size: 14px;
+  font-weight: bold;
+}
+
+.flow-item p {
+  margin: 0;
+  font-size: 12px;
+  line-height: 1.4;
+  color: #606266;
+}
+
+/* 修复对话框底部按钮点击区域问题 */
+:deep(.el-dialog__footer) {
+  padding: 20px !important;
+  position: relative;
+  z-index: 10;
+}
+
+/* 确保关闭按钮有完整的点击区域 */
+.dialog-footer :deep(.el-button) {
+  padding: 12px 20px;
+  min-width: 80px;
+  z-index: 20;
+  position: relative;
+}
+
+/* 表单字段间距调整 */
+:deep(.el-form-item) {
+  margin-bottom: 18px;
+}
+
+.content-text {
+  white-space: pre-wrap;
+  word-break: break-word;
+  line-height: 1.5;
+}
+</style>