فهرست منبع

ly 预防性维修流程

ly 1 ماه پیش
والد
کامیت
b2f0e5c017
36فایلهای تغییر یافته به همراه4576 افزوده شده و 603 حذف شده
  1. 17 0
      master/src/main/java/com/ruoyi/project/ehs/controller/TApproveDangerController.java
  2. 99 0
      master/src/main/java/com/ruoyi/project/reliability/controller/TRelMaintMemoController.java
  3. 179 8
      master/src/main/java/com/ruoyi/project/reliability/controller/TRelMaintPlanController.java
  4. 217 5
      master/src/main/java/com/ruoyi/project/reliability/controller/TRelMaintRecordController.java
  5. 13 0
      master/src/main/java/com/ruoyi/project/reliability/domain/TRelCompo.java
  6. 321 0
      master/src/main/java/com/ruoyi/project/reliability/domain/TRelMaintMemo.java
  7. 39 0
      master/src/main/java/com/ruoyi/project/reliability/domain/TRelMaintPlan.java
  8. 132 0
      master/src/main/java/com/ruoyi/project/reliability/domain/TRelMaintRecord.java
  9. 8 0
      master/src/main/java/com/ruoyi/project/reliability/mapper/TRelDeviceMapper.java
  10. 63 0
      master/src/main/java/com/ruoyi/project/reliability/mapper/TRelMaintMemoMapper.java
  11. 16 8
      master/src/main/java/com/ruoyi/project/reliability/mapper/TRelMaintRecordMapper.java
  12. 61 0
      master/src/main/java/com/ruoyi/project/reliability/service/ITRelMaintMemoService.java
  13. 8 0
      master/src/main/java/com/ruoyi/project/reliability/service/ITRelMaintRecordService.java
  14. 93 0
      master/src/main/java/com/ruoyi/project/reliability/service/impl/TRelMaintMemoServiceImpl.java
  15. 45 1
      master/src/main/java/com/ruoyi/project/reliability/service/impl/TRelMaintPlanServiceImpl.java
  16. 85 2
      master/src/main/java/com/ruoyi/project/reliability/service/impl/TRelMaintRecordServiceImpl.java
  17. 6 0
      master/src/main/resources/mybatis/reliability/TRelDeviceMapper.xml
  18. 161 0
      master/src/main/resources/mybatis/reliability/TRelMaintMemoMapper.xml
  19. 1 1
      master/src/main/resources/mybatis/reliability/TRelMaintPlanMapper.xml
  20. 49 1
      master/src/main/resources/mybatis/reliability/TRelMaintRecordMapper.xml
  21. 53 0
      ui/src/api/reliability/rel_maint_memo.js
  22. 9 0
      ui/src/api/reliability/rel_maint_plan.js
  23. 9 0
      ui/src/api/reliability/rel_maint_record.js
  24. 6 0
      ui/src/router/index.js
  25. 277 0
      ui/src/views/approve/approveDetail/rel-maintPlan-detaill.vue
  26. 9 1
      ui/src/views/approve/myapprove/index.vue
  27. 10 1
      ui/src/views/approve/pending/index.vue
  28. 9 1
      ui/src/views/approve/taskdone/index.vue
  29. 2 1
      ui/src/views/plant/EOEGorganization/branch.vue
  30. 487 0
      ui/src/views/reliability/rel_maint_memo/index.vue
  31. 192 0
      ui/src/views/reliability/rel_maint_plan/MaintPlanDetail.vue
  32. 195 0
      ui/src/views/reliability/rel_maint_plan/MaintPlanDetailContent.vue
  33. 693 0
      ui/src/views/reliability/rel_maint_plan/MaintPlanForm.vue
  34. 78 522
      ui/src/views/reliability/rel_maint_plan/index.vue
  35. 87 51
      ui/src/views/reliability/rel_maint_record/index.vue
  36. 847 0
      ui/src/views/reliability/rel_maint_record/myRecord.vue

+ 17 - 0
master/src/main/java/com/ruoyi/project/ehs/controller/TApproveDangerController.java

@@ -46,7 +46,9 @@ import com.ruoyi.project.pssr.service.ITPssrAboveallService;
 import com.ruoyi.project.pssr.service.ITPssrApproveService;
 import com.ruoyi.project.pssr.service.ITPssrSubcontentService;
 import com.ruoyi.project.reliability.domain.TKekaoApprove;
+import com.ruoyi.project.reliability.domain.TRelMaintPlan;
 import com.ruoyi.project.reliability.service.ITKekaoApproveService;
+import com.ruoyi.project.reliability.service.ITRelMaintPlanService;
 import com.ruoyi.project.sems.domain.TApprove;
 import com.ruoyi.project.sems.his.domain.TApproveSpecModify;
 import com.ruoyi.project.sems.his.service.ITApproveSpecModifyService;
@@ -132,6 +134,8 @@ public class TApproveDangerController extends BaseController {
     @Autowired
     private ITKekaoApproveService tKekaoApproveService;
     @Autowired
+    private ITRelMaintPlanService tRelMaintPlanService;
+    @Autowired
     private ITApproveReserveInvoiceService tApproveReserveInvoiceService;
 
     @Autowired
@@ -389,6 +393,10 @@ public class TApproveDangerController extends BaseController {
                         devProcess.setProcessName(pi.getProcessDefinitionName());
                         devProcess.setApNo(t.getApNo());
                         devProcess.setApproveObject(t);
+                    } else if (pi.getProcessDefinitionName().equals("可靠性设备维修计划申请")) {
+                        TRelMaintPlan plan = tRelMaintPlanService.selectTRelMaintPlanById(Long.parseLong(pi.getBusinessKey()));
+                        devProcess.setApproveObject(plan);
+                        devProcess.setApNo(plan.getPlanId().toString());
                     }
                 } catch (Exception e) {
                     logger.error(e.toString());
@@ -559,6 +567,10 @@ public class TApproveDangerController extends BaseController {
                         devTask.setProcessName(pi.getProcessDefinitionName());
                         devTask.setApNo(t.getApNo());
                         devTask.setApproveObject(t);
+                    } else if (pi.getProcessDefinitionName().equals("可靠性设备维修计划申请")) {
+                        TRelMaintPlan plan = tRelMaintPlanService.selectTRelMaintPlanById(Long.parseLong(pi.getBusinessKey()));
+                        devTask.setApproveObject(plan);
+                        devTask.setApNo(plan.getPlanId().toString());
                     }
                     list.add(devTask);
                 }
@@ -662,6 +674,11 @@ public class TApproveDangerController extends BaseController {
                     devProcess.setApNo(approve.getApNo());
                     devProcess.setApName(user.getNickName());
                     devProcess.setApproveObject(approve);
+                } else if (pi.getProcessDefinitionName().equals("可靠性设备维修计划申请")) {
+                    TRelMaintPlan plan = tRelMaintPlanService.selectTRelMaintPlanById(Long.parseLong(pi.getBusinessKey()));
+                    SysUser user = sysUserService.selectUserById(Long.parseLong(plan.getCreaterCode()));
+                    devProcess.setApName(user.getNickName());
+                    devProcess.setApproveObject(plan);
                 } else if (pi.getProcessDefinitionName().equals("预约开票审批流程")) {
                     TApproveReserveInvoice approve = tApproveReserveInvoiceService.selectTApproveReserveInvoiceById(Long.parseLong(pi.getBusinessKey()));
                     SysUser user = sysUserService.selectUserById(approve.getUserId());

+ 99 - 0
master/src/main/java/com/ruoyi/project/reliability/controller/TRelMaintMemoController.java

@@ -0,0 +1,99 @@
+package com.ruoyi.project.reliability.controller;
+
+import java.util.List;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.PutMapping;
+import org.springframework.web.bind.annotation.DeleteMapping;
+import org.springframework.web.bind.annotation.PathVariable;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+import com.ruoyi.framework.aspectj.lang.annotation.Log;
+import com.ruoyi.framework.aspectj.lang.enums.BusinessType;
+import com.ruoyi.project.reliability.domain.TRelMaintMemo;
+import com.ruoyi.project.reliability.service.ITRelMaintMemoService;
+import com.ruoyi.framework.web.controller.BaseController;
+import com.ruoyi.framework.web.domain.AjaxResult;
+import com.ruoyi.common.utils.poi.ExcelUtil;
+import com.ruoyi.framework.web.page.TableDataInfo;
+
+/**
+ * 维修备忘录Controller
+ *
+ * @author ssy
+ * @date 2025-11-06
+ */
+@RestController
+@RequestMapping("/reliability/rel_maint_memo")
+public class TRelMaintMemoController extends BaseController
+{
+    @Autowired
+    private ITRelMaintMemoService tRelMaintMemoService;
+
+    /**
+     * 查询维修备忘录列表
+     */
+    @GetMapping("/list")
+    public TableDataInfo list(TRelMaintMemo tRelMaintMemo)
+    {
+        startPage();
+        List<TRelMaintMemo> list = tRelMaintMemoService.selectTRelMaintMemoList(tRelMaintMemo);
+        return getDataTable(list);
+    }
+
+    /**
+     * 导出维修备忘录列表
+     */
+    @Log(title = "维修备忘录", businessType = BusinessType.EXPORT)
+    @GetMapping("/export")
+    public AjaxResult export(TRelMaintMemo tRelMaintMemo)
+    {
+        List<TRelMaintMemo> list = tRelMaintMemoService.selectTRelMaintMemoList(tRelMaintMemo);
+        ExcelUtil<TRelMaintMemo> util = new ExcelUtil<TRelMaintMemo>(TRelMaintMemo.class);
+        return util.exportExcel(list, "rel_maint_memo");
+    }
+
+    /**
+     * 获取维修备忘录详细信息
+     */
+    @GetMapping(value = "/{memoId}")
+    public AjaxResult getInfo(@PathVariable("memoId") Long memoId)
+    {
+        return AjaxResult.success(tRelMaintMemoService.selectTRelMaintMemoById(memoId));
+    }
+
+    /**
+     * 新增维修备忘录
+     */
+    @Log(title = "维修备忘录", businessType = BusinessType.INSERT)
+    @PostMapping
+    public AjaxResult add(@RequestBody TRelMaintMemo tRelMaintMemo)
+    {
+        return toAjax(tRelMaintMemoService.insertTRelMaintMemo(tRelMaintMemo));
+    }
+
+    /**
+     * 修改维修备忘录
+     */
+    @PreAuthorize("@ss.hasPermi('reliability:rel_maint_record:edit')")
+    @Log(title = "维修备忘录", businessType = BusinessType.UPDATE)
+    @PutMapping
+    public AjaxResult edit(@RequestBody TRelMaintMemo tRelMaintMemo)
+    {
+        return toAjax(tRelMaintMemoService.updateTRelMaintMemo(tRelMaintMemo));
+    }
+
+    /**
+     * 删除维修备忘录
+     */
+    @PreAuthorize("@ss.hasPermi('reliability:rel_maint_record:remove')")
+    @Log(title = "维修备忘录", businessType = BusinessType.DELETE)
+	@DeleteMapping("/{memoIds}")
+    public AjaxResult remove(@PathVariable Long[] memoIds)
+    {
+        return toAjax(tRelMaintMemoService.deleteTRelMaintMemoByIds(memoIds));
+    }
+}

+ 179 - 8
master/src/main/java/com/ruoyi/project/reliability/controller/TRelMaintPlanController.java

@@ -3,11 +3,14 @@ package com.ruoyi.project.reliability.controller;
 import java.util.*;
 import com.alibaba.fastjson.JSON;
 import com.ruoyi.project.system.domain.SysMessage;
+import com.ruoyi.project.system.domain.SysUser;
 import com.ruoyi.project.system.mapper.SysUserMapper;
 import com.ruoyi.project.system.service.ISysMessageService;
 import org.activiti.engine.*;
 import org.activiti.engine.impl.identity.Authentication;
 import org.activiti.engine.runtime.ProcessInstance;
+import org.activiti.engine.task.Task;
+import com.ruoyi.project.approve.damain.DevTask;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.springframework.security.access.prepost.PreAuthorize;
@@ -58,6 +61,9 @@ public class TRelMaintPlanController extends BaseController
     @Autowired
     private RuntimeService runtimeService;
 
+    @Autowired
+    private TaskService taskService;
+
     /**
      * 查询设备维修计划列表
      */
@@ -86,7 +92,6 @@ public class TRelMaintPlanController extends BaseController
     /**
      * 获取设备维修计划详细信息
      */
-    @PreAuthorize("@ss.hasPermi('reliability:rel_maint_plan:query')")
     @GetMapping(value = "/{planId}")
     public AjaxResult getInfo(@PathVariable("planId") Long planId)
     {
@@ -133,7 +138,16 @@ public class TRelMaintPlanController extends BaseController
 
             // 设置流程变量
             Map<String, Object> variables = new HashMap<>();
-            variables.put("zzjlusers", tRelMaintPlan.getApprover());
+            // 通过员工号查询sys_user的ID
+            String approverStaffId = tRelMaintPlan.getApprover();
+            SysUser approverUser = sysUserMapper.selectUserByStaffId(approverStaffId);
+            if (approverUser != null && approverUser.getUserId() != null) {
+                variables.put("zzjlusers", approverUser.getUserId().toString());
+                logger.info("审批人员工号: " + approverStaffId + ", sys_user ID: " + approverUser.getUserId());
+            } else {
+                logger.error("未找到审批人,员工号: " + approverStaffId);
+                return AjaxResult.error("未找到审批人信息,请检查审批人选择是否正确");
+            }
 
             long businessKey = tRelMaintPlan.getPlanId();
             logger.info("businessKey:" + businessKey);
@@ -158,13 +172,13 @@ public class TRelMaintPlanController extends BaseController
             // 发送邮件通知审批人
             try {
                 SysMessage message = new SysMessage();
-                String email = sysUserMapper.selectUserById(Long.parseLong(tRelMaintPlan.getApprover())).getEmail();
-                String username = sysUserMapper.selectUserById(Long.parseLong(tRelMaintPlan.getApprover())).getNickName();
+                String email = approverUser.getEmail();
+                String username = approverUser.getNickName();
 
                 logger.info("email:" + email);
                 logger.info("username:" + username);
 
-                message.setUserId(Long.parseLong(tRelMaintPlan.getApprover()));
+                message.setUserId(approverUser.getUserId());
                 message.setMsgTitle("您有一条维修计划待审核");
                 message.setMsgContent("您有一条维修计划待审核,请及时处理");
 
@@ -210,6 +224,101 @@ public class TRelMaintPlanController extends BaseController
         return toAjax(tRelMaintPlanService.deleteTRelMaintPlanByIds(planIds));
     }
 
+    /**
+     * 维修计划审批处理
+     */
+    @PreAuthorize("@ss.hasPermi('reliability:rel_maint_plan:edit')")
+    @Log(title = "维修计划审批处理", businessType = BusinessType.UPDATE)
+    @PutMapping("/handle")
+    public AjaxResult handle(@RequestBody DevTask devTask) {
+        try {
+            // 流程审批意见
+            String symbol = "";
+            if (devTask.getComment() != null && !devTask.getComment().isEmpty()) {
+                symbol = ",";
+            }
+
+            // 使用任务服务完成任务(提交任务)
+            String taskId = devTask.getTaskId();
+            // 使用任务id,获取任务对象,获取流程实例id
+            Task task = taskService.createTaskQuery().taskId(taskId).singleResult();
+            if (task == null) {
+                return AjaxResult.error("任务不存在或已完成");
+            }
+
+            // 利用任务对象,获取流程实例id
+            String processInstancesId = task.getProcessInstanceId();
+
+            // 获取维修计划
+            TRelMaintPlan tRelMaintPlan = tRelMaintPlanService.selectTRelMaintPlanById(Long.parseLong(devTask.getBusinessKey()));
+            if (tRelMaintPlan == null) {
+                return AjaxResult.error("维修计划不存在");
+            }
+
+            // 设置流程变量
+            Map<String, Object> param = new HashMap<>();
+
+            // 根据审批条件设置审批状态和意见
+            String condition = devTask.getCondition();
+            if ("1".equals(condition)) {
+                // 通过
+                String comment = devTask.getComment();
+                devTask.setComment("通过" + symbol + (comment != null && !comment.isEmpty() ? comment : ""));
+                tRelMaintPlan.setApprovalStatus("1"); // 已通过
+                param.put("condition", "1");
+            } else if ("0".equals(condition)) {
+                // 拒绝
+                String comment = devTask.getComment();
+                devTask.setComment("拒绝" + symbol + (comment != null && !comment.isEmpty() ? comment : ""));
+                tRelMaintPlan.setApprovalStatus("-1"); // 未通过
+                param.put("condition", "0");
+            } else {
+                return AjaxResult.error("审批条件参数错误");
+            }
+
+            // 更新维修计划状态
+            tRelMaintPlanService.updateTRelMaintPlan(tRelMaintPlan);
+
+            // 处理维修记录状态
+            processRecordsAfterApprove(tRelMaintPlan.getPlanId(), condition);
+
+            // 认领任务
+            Long userId = getUserId();
+            Authentication.setAuthenticatedUserId(userId.toString());
+            taskService.claim(taskId, userId.toString());
+
+            // 添加审批意见
+            taskService.addComment(taskId, processInstancesId, devTask.getComment());
+
+            // 完成任务
+            taskService.complete(taskId, param);
+
+            // 发送系统消息通知申请人
+            try {
+                SysMessage message = new SysMessage();
+                Long createrId = Long.parseLong(tRelMaintPlan.getCreaterCode());
+                SysUser creater = sysUserMapper.selectUserById(createrId);
+                if (creater != null) {
+                    message.setUserId(createrId);
+                    message.setMsgTitle("维修计划审批结果通知");
+                    if ("1".equals(condition)) {
+                        message.setMsgContent("您的维修计划申请已通过审批");
+                    } else {
+                        message.setMsgContent("您的维修计划申请未通过审批");
+                    }
+                    sysMessageService.insertSysMessage(message);
+                }
+            } catch (Exception e) {
+                logger.error("发送系统消息失败", e);
+            }
+
+            return AjaxResult.success();
+        } catch (Exception e) {
+            logger.error("审批处理失败", e);
+            return AjaxResult.error("审批处理失败:" + e.getMessage());
+        }
+    }
+
     /**
      * 处理部件维修记录
      */
@@ -219,16 +328,19 @@ public class TRelMaintPlanController extends BaseController
             Date now = new Date();
             for (TRelMaintRecord maintRecord : maintComponents) {
                 logger.info("处理部件: " + maintRecord.getCompoName() + ", 维修类型: " + maintRecord.getMaintType());
-                
+
                 // 设置基本信息
                 maintRecord.setPlant(tRelMaintPlan.getPlant());
                 maintRecord.setDevName(tRelMaintPlan.getDevName());
                 maintRecord.setDevTag(tRelMaintPlan.getDevTag());
-                
+                maintRecord.setRecordStatus(0);
+                // 设置计划ID
+                maintRecord.setPlanId(planId);
+
                 // 设置创建信息
                 maintRecord.setCreaterCode(tRelMaintPlan.getCreaterCode());
                 maintRecord.setCreatedate(now);
-                
+
                 // 保存维修记录
                 int result = tRelMaintRecordService.insertTRelMaintRecord(maintRecord);
                 logger.info("保存维修记录结果: " + result + ", 部件: " + maintRecord.getCompoName());
@@ -238,4 +350,63 @@ public class TRelMaintPlanController extends BaseController
             logger.error("处理部件维修记录失败", e);
         }
     }
+
+    /**
+     * 审批后处理维修记录状态
+     * @param planId 计划ID
+     * @param condition 审批条件 "1"通过 "0"拒绝
+     */
+    private void processRecordsAfterApprove(Long planId, String condition) {
+        try {
+            logger.info("开始处理维修记录状态,计划ID: " + planId + ", 审批结果: " + condition);
+
+            // 查询该计划下的所有维修记录
+            TRelMaintRecord recordQuery = new TRelMaintRecord();
+            recordQuery.setPlanId(planId);
+            List<TRelMaintRecord> recordList = tRelMaintRecordService.selectTRelMaintRecordList(recordQuery);
+
+            if (recordList == null || recordList.isEmpty()) {
+                logger.info("该计划下没有维修记录");
+                return;
+            }
+
+            if ("1".equals(condition)) {
+                // 审批通过
+                for (TRelMaintRecord record : recordList) {
+                    if (record.getRecordStatus() != null) {
+                        if (record.getRecordStatus() == 0) {
+                            // recordStatus 为 0 的记录,改为 1
+                            record.setRecordStatus(1);
+                            tRelMaintRecordService.updateTRelMaintRecord(record);
+                            logger.info("维修记录状态更新:recordId=" + record.getRecordId() + ", 从0改为1");
+                        } else if (record.getRecordStatus() == -1) {
+                            // recordStatus 为 -1 的记录,删除
+                            tRelMaintRecordService.deleteTRelMaintRecordById(record.getRecordId());
+                            logger.info("维修记录已删除:recordId=" + record.getRecordId());
+                        }
+                    }
+                }
+            } else if ("0".equals(condition)) {
+                // 审批不通过
+                for (TRelMaintRecord record : recordList) {
+                    if (record.getRecordStatus() != null) {
+                        if (record.getRecordStatus() == 0) {
+                            // recordStatus 为 0 的记录,删除
+                            tRelMaintRecordService.deleteTRelMaintRecordById(record.getRecordId());
+                            logger.info("维修记录已删除:recordId=" + record.getRecordId());
+                        } else if (record.getRecordStatus() == -1) {
+                            // recordStatus 为 -1 的记录,改为 1
+                            record.setRecordStatus(1);
+                            tRelMaintRecordService.updateTRelMaintRecord(record);
+                            logger.info("维修记录状态更新:recordId=" + record.getRecordId() + ", 从-1改为1");
+                        }
+                    }
+                }
+            }
+
+            logger.info("完成处理维修记录状态");
+        } catch (Exception e) {
+            logger.error("处理维修记录状态失败", e);
+        }
+    }
 }

+ 217 - 5
master/src/main/java/com/ruoyi/project/reliability/controller/TRelMaintRecordController.java

@@ -1,5 +1,6 @@
 package com.ruoyi.project.reliability.controller;
 
+import java.util.Date;
 import java.util.List;
 import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -14,11 +15,17 @@ import org.springframework.web.bind.annotation.RestController;
 import com.ruoyi.framework.aspectj.lang.annotation.Log;
 import com.ruoyi.framework.aspectj.lang.enums.BusinessType;
 import com.ruoyi.project.reliability.domain.TRelMaintRecord;
+import com.ruoyi.project.reliability.domain.TRelMaintPlan;
+import com.ruoyi.project.reliability.domain.TRelMaintMemo;
 import com.ruoyi.project.reliability.service.ITRelMaintRecordService;
+import com.ruoyi.project.reliability.service.ITRelMaintPlanService;
+import com.ruoyi.project.reliability.service.ITRelMaintMemoService;
 import com.ruoyi.framework.web.controller.BaseController;
 import com.ruoyi.framework.web.domain.AjaxResult;
 import com.ruoyi.common.utils.poi.ExcelUtil;
 import com.ruoyi.framework.web.page.TableDataInfo;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 /**
  * 部件维修记录Controller
@@ -30,13 +37,20 @@ import com.ruoyi.framework.web.page.TableDataInfo;
 @RequestMapping("/reliability/rel_maint_record")
 public class TRelMaintRecordController extends BaseController
 {
+    private static final Logger logger = LoggerFactory.getLogger(TRelMaintRecordController.class);
+
     @Autowired
     private ITRelMaintRecordService tRelMaintRecordService;
 
+    @Autowired
+    private ITRelMaintPlanService tRelMaintPlanService;
+
+    @Autowired
+    private ITRelMaintMemoService tRelMaintMemoService;
+
     /**
      * 查询部件维修记录列表
      */
-    @PreAuthorize("@ss.hasPermi('reliability:rel_maint_record:list')")
     @GetMapping("/list")
     public TableDataInfo list(TRelMaintRecord tRelMaintRecord)
     {
@@ -45,6 +59,27 @@ public class TRelMaintRecordController extends BaseController
         return getDataTable(list);
     }
 
+    /**
+     * 查询我的维修任务列表(根据当前登录用户员工ID)
+     * 只查询 recordStatus 为 1 和 2 的数据,并排序(1 在前)
+     */
+    @GetMapping("/myList")
+    public TableDataInfo myList(TRelMaintRecord tRelMaintRecord)
+    {
+        // 获取当前登录用户的员工ID
+        String staffId = getBaseStaffId();
+        if (staffId != null && !staffId.isEmpty())
+        {
+            // 设置查询条件为当前用户的员工ID
+            tRelMaintRecord.setResponsible(staffId);
+        }
+        // 只查询 recordStatus 为 1 和 2 的数据
+        // 注意:这里不设置 recordStatus,让 Mapper 中的 SQL 直接处理
+        startPage();
+        List<TRelMaintRecord> list = tRelMaintRecordService.selectTRelMaintRecordListByCurrentUser(tRelMaintRecord);
+        return getDataTable(list);
+    }
+
     /**
      * 导出部件维修记录列表
      */
@@ -61,7 +96,6 @@ public class TRelMaintRecordController extends BaseController
     /**
      * 获取部件维修记录详细信息
      */
-    @PreAuthorize("@ss.hasPermi('reliability:rel_maint_record:query')")
     @GetMapping(value = "/{recordId}")
     public AjaxResult getInfo(@PathVariable("recordId") Long recordId)
     {
@@ -70,24 +104,202 @@ public class TRelMaintRecordController extends BaseController
 
     /**
      * 新增部件维修记录
+     * 注意:从检查任务创建维修/更换任务时,不需要权限验证,因为这是业务逻辑的一部分
      */
-    @PreAuthorize("@ss.hasPermi('reliability:rel_maint_record:add')")
     @Log(title = "部件维修记录", businessType = BusinessType.INSERT)
     @PostMapping
     public AjaxResult add(@RequestBody TRelMaintRecord tRelMaintRecord)
     {
+        // 设置默认值
+        if (tRelMaintRecord.getRecordStatus() == null) {
+            // 如果没有设置状态,默认为待完成(1)
+            tRelMaintRecord.setRecordStatus(1);
+        }
+        if (tRelMaintRecord.getDelFlag() == null) {
+            // 删除标志默认为0(未删除)
+            tRelMaintRecord.setDelFlag(0L);
+        }
+        // 设置创建人(如果未设置)
+        if (tRelMaintRecord.getCreaterCode() == null || tRelMaintRecord.getCreaterCode().isEmpty()) {
+            String staffId = getBaseStaffId();
+            if (staffId != null && !staffId.isEmpty()) {
+                tRelMaintRecord.setCreaterCode(staffId);
+            }
+        }
         return toAjax(tRelMaintRecordService.insertTRelMaintRecord(tRelMaintRecord));
     }
 
     /**
      * 修改部件维修记录
      */
-    @PreAuthorize("@ss.hasPermi('reliability:rel_maint_record:edit')")
     @Log(title = "部件维修记录", businessType = BusinessType.UPDATE)
     @PutMapping
     public AjaxResult edit(@RequestBody TRelMaintRecord tRelMaintRecord)
     {
-        return toAjax(tRelMaintRecordService.updateTRelMaintRecord(tRelMaintRecord));
+        // 如果传入了recordId,说明是处理维修任务,自动将状态设置为2(已完成)
+        if (tRelMaintRecord.getRecordId() != null) {
+            tRelMaintRecord.setRecordStatus(2);
+        }
+        
+        // 保存是否需要创建新记录的信息(在更新前保存,因为更新后这些字段可能被清空)
+        Boolean needMaintOrReplace = tRelMaintRecord.getNeedMaintOrReplace();
+        String newMaintType = tRelMaintRecord.getNewMaintType();
+        String newResponsible = tRelMaintRecord.getNewResponsible();
+        String maintType = tRelMaintRecord.getMaintType();
+        Boolean cannotMaintOrReplace = tRelMaintRecord.getCannotMaintOrReplace();
+        String memoReason = tRelMaintRecord.getMemoReason();
+        Date memoTime = tRelMaintRecord.getMemoTime();
+        
+        int result = tRelMaintRecordService.updateTRelMaintRecord(tRelMaintRecord);
+        
+        // 如果是检查任务(maintType = "1")且选择了需要维修/更换,创建新的维修或更换记录
+        if (result > 0 && "1".equals(maintType) && needMaintOrReplace != null && needMaintOrReplace 
+            && newMaintType != null && !newMaintType.isEmpty() 
+            && newResponsible != null && !newResponsible.isEmpty()) {
+            createNewMaintRecordFromInspect(tRelMaintRecord, newMaintType, newResponsible);
+        }
+        
+        // 如果是维修/更换任务(maintType = "2" 或 "3")且选择了无法维修/更换,创建备忘录记录
+        if (result > 0 && ("2".equals(maintType) || "3".equals(maintType)) 
+            && cannotMaintOrReplace != null && cannotMaintOrReplace
+            && memoReason != null && !memoReason.isEmpty()
+            && memoTime != null) {
+            createMaintMemoFromRecord(tRelMaintRecord, memoReason, memoTime);
+        }
+        
+        // 更新记录后,检查该记录所属的计划是否所有记录都已完成
+        if (result > 0 && tRelMaintRecord.getPlanId() != null) {
+            checkAndUpdatePlanCompletionStatus(tRelMaintRecord.getPlanId());
+        }
+        
+        return toAjax(result);
+    }
+
+    /**
+     * 从检查任务创建新的维修或更换记录
+     * @param inspectRecord 检查任务记录
+     * @param newMaintType 新的维修类型(2-维修,3-更换)
+     * @param newResponsible 新的负责人
+     */
+    private void createNewMaintRecordFromInspect(TRelMaintRecord inspectRecord, String newMaintType, String newResponsible) {
+        try {
+            TRelMaintRecord newRecord = new TRelMaintRecord();
+            // 复制基本信息
+            newRecord.setPlant(inspectRecord.getPlant());
+            newRecord.setDevName(inspectRecord.getDevName());
+            newRecord.setDevTag(inspectRecord.getDevTag());
+            newRecord.setCompoName(inspectRecord.getCompoName());
+            newRecord.setCompoId(inspectRecord.getCompoId());
+            newRecord.setMaintType(newMaintType);
+            newRecord.setResponsible(newResponsible);
+            newRecord.setPlanId(inspectRecord.getPlanId());
+            newRecord.setRecordStatus(1); // 待完成
+            newRecord.setDelFlag(0L); // 未删除
+            newRecord.setDeptId(inspectRecord.getDeptId());
+            newRecord.setRemarks("由检查任务自动创建");
+            
+            // 设置创建人
+            String staffId = getBaseStaffId();
+            if (staffId != null && !staffId.isEmpty()) {
+                newRecord.setCreaterCode(staffId);
+            }
+            
+            // 创建新记录
+            tRelMaintRecordService.insertTRelMaintRecord(newRecord);
+            logger.info("从检查任务创建新的维修/更换记录成功,检查记录ID: {}, 新维修类型: {}, 负责人: {}", 
+                inspectRecord.getRecordId(), newMaintType, newResponsible);
+        } catch (Exception e) {
+            logger.error("从检查任务创建新的维修/更换记录失败,检查记录ID: " + inspectRecord.getRecordId(), e);
+            // 不抛出异常,避免影响主流程
+        }
+    }
+
+    /**
+     * 从维修/更换记录创建备忘录
+     * @param record 维修/更换记录
+     * @param memoReason 备忘原因
+     * @param memoTime 备忘时间
+     */
+    private void createMaintMemoFromRecord(TRelMaintRecord record, String memoReason, Date memoTime) {
+        try {
+            TRelMaintMemo memo = new TRelMaintMemo();
+            // 复制基本信息
+            memo.setPlant(record.getPlant());
+            memo.setDevName(record.getDevName());
+            memo.setDevTag(record.getDevTag());
+            memo.setCompoName(record.getCompoName());
+            memo.setCompoId(record.getCompoId());
+            memo.setMaintType(record.getMaintType());
+            memo.setResponsible(record.getResponsible());
+            memo.setMaintContent(record.getMaintContent());
+            memo.setMemoReason(memoReason);
+            memo.setMemoTime(memoTime);
+            memo.setPlanId(record.getPlanId());
+            memo.setRecordId(record.getRecordId());
+            memo.setDelFlag(0L); // 未删除
+            memo.setDeptId(record.getDeptId());
+            
+            // 设置创建人
+            String staffId = getBaseStaffId();
+            if (staffId != null && !staffId.isEmpty()) {
+                memo.setCreaterCode(staffId);
+            }
+            
+            // 创建备忘录记录
+            tRelMaintMemoService.insertTRelMaintMemo(memo);
+            logger.info("从维修/更换记录创建备忘录成功,记录ID: {}, 备忘原因: {}", record.getRecordId(), memoReason);
+        } catch (Exception e) {
+            logger.error("从维修/更换记录创建备忘录失败,记录ID: " + record.getRecordId(), e);
+            // 不抛出异常,避免影响主流程
+        }
+    }
+
+    /**
+     * 检查并更新维修计划的完成状态
+     * 如果计划下的所有记录都已完成(recordStatus = 2),则将计划状态更新为已完成
+     * @param planId 计划ID
+     */
+    private void checkAndUpdatePlanCompletionStatus(Long planId) {
+        try {
+            // 查询该计划下的所有记录(排除删除标志为2的记录)
+            TRelMaintRecord queryRecord = new TRelMaintRecord();
+            queryRecord.setPlanId(planId);
+            List<TRelMaintRecord> recordList = tRelMaintRecordService.selectTRelMaintRecordList(queryRecord);
+            
+            if (recordList == null || recordList.isEmpty()) {
+                // 如果没有记录,不需要更新计划状态
+                return;
+            }
+            
+            // 过滤掉申请中的记录(recordStatus 为 -1 和 0 的记录不参与完成状态判断)
+            boolean allCompleted = true;
+            boolean hasValidRecord = false;
+            
+            for (TRelMaintRecord record : recordList) {
+                Integer status = record.getRecordStatus();
+                // 只考虑有效的记录(status 为 1 或 2)
+                if (status != null && (status == 1 || status == 2)) {
+                    hasValidRecord = true;
+                    if (status != 2) {
+                        // 如果有记录不是已完成状态,则计划未完成
+                        allCompleted = false;
+                        break;
+                    }
+                }
+            }
+            
+            // 如果有有效记录且所有记录都已完成,则更新计划状态为已完成
+            if (hasValidRecord && allCompleted) {
+                TRelMaintPlan plan = tRelMaintPlanService.selectTRelMaintPlanById(planId);
+                if (plan != null && !"1".equals(plan.getCompletionStatus())) {
+                    plan.setCompletionStatus("1");
+                    tRelMaintPlanService.updateTRelMaintPlan(plan);
+                }
+            }
+        } catch (Exception e) {
+            // 记录错误但不影响主流程
+            logger.error("检查并更新维修计划完成状态失败,计划ID: " + planId, e);
+        }
     }
 
     /**

+ 13 - 0
master/src/main/java/com/ruoyi/project/reliability/domain/TRelCompo.java

@@ -146,6 +146,9 @@ public class TRelCompo extends BaseEntity
     /** 维修更换人姓名 */
     private String fixerName;
 
+    /** 设备区域负责人(不存储到数据库,通过设备关联查询) */
+    private String areaResponsible;
+
     public void setCompoId(Long compoId)
     {
         this.compoId = compoId;
@@ -435,6 +438,16 @@ public class TRelCompo extends BaseEntity
         return fixerName;
     }
 
+    public void setAreaResponsible(String areaResponsible)
+    {
+        this.areaResponsible = areaResponsible;
+    }
+
+    public String getAreaResponsible()
+    {
+        return areaResponsible;
+    }
+
     @Override
     public String toString() {
         return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)

+ 321 - 0
master/src/main/java/com/ruoyi/project/reliability/domain/TRelMaintMemo.java

@@ -0,0 +1,321 @@
+package com.ruoyi.project.reliability.domain;
+
+import java.util.Date;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import com.ruoyi.framework.aspectj.lang.annotation.Excel;
+import com.ruoyi.framework.web.domain.BaseEntity;
+import org.apache.commons.lang3.builder.ToStringBuilder;
+import org.apache.commons.lang3.builder.ToStringStyle;
+
+/**
+ * 维修备忘录对象 t_rel_maint_memo
+ *
+ * @author ssy
+ * @date 2025-11-06
+ */
+public class TRelMaintMemo extends BaseEntity
+{
+    private static final long serialVersionUID = 1L;
+
+    /** 备忘录ID */
+    private Long memoId;
+
+    /** 装置 */
+    @Excel(name = "装置")
+    private String plant;
+
+    /** 设备名称 */
+    @Excel(name = "设备名称")
+    private String devName;
+
+    /** 设备位号 */
+    @Excel(name = "设备位号")
+    private String devTag;
+
+    /** 部件名称 */
+    @Excel(name = "部件名称")
+    private String compoName;
+
+    /** 部件ID */
+    @Excel(name = "部件ID")
+    private String compoId;
+
+    /** 维修类型 */
+    @Excel(name = "维修类型")
+    private String maintType;
+
+    /** 维修责任人 */
+    @Excel(name = "维修责任人")
+    private String responsible;
+
+    /** 维修内容 */
+    @Excel(name = "维修内容")
+    private String maintContent;
+
+    /** 备忘原因 */
+    @Excel(name = "备忘原因")
+    private String memoReason;
+
+    /** 备忘时间 */
+    @JsonFormat(pattern = "yyyy-MM-dd" , timezone = "GMT+8")
+    @Excel(name = "备忘时间", width = 30, dateFormat = "yyyy-MM-dd")
+    private Date memoTime;
+
+    /** 维修费用 */
+    @Excel(name = "维修费用")
+    private Long maintCost;
+
+    /** 删除标志(0代表存在 2代表删除) */
+    private Long delFlag;
+
+    /** 创建人 */
+    @Excel(name = "创建人")
+    private String createrCode;
+
+    /** 创建时间 */
+    @JsonFormat(pattern = "yyyy-MM-dd" , timezone = "GMT+8")
+    @Excel(name = "创建时间", width = 30, dateFormat = "yyyy-MM-dd")
+    private Date createdate;
+
+    /** 修改人 */
+    @Excel(name = "修改人")
+    private String updaterCode;
+
+    /** 修改时间 */
+    @JsonFormat(pattern = "yyyy-MM-dd" , timezone = "GMT+8")
+    @Excel(name = "修改时间", width = 30, dateFormat = "yyyy-MM-dd")
+    private Date updatedate;
+
+    /** 部门编号 */
+    @Excel(name = "部门编号")
+    private Long deptId;
+
+    /** 备注 */
+    @Excel(name = "备注")
+    private String remarks;
+
+    /** 计划id */
+    @Excel(name = "计划id")
+    private Long planId;
+
+    /** 维修记录id  */
+    @Excel(name = "维修记录id ")
+    private Long recordId;
+
+    public void setMemoId(Long memoId)
+    {
+        this.memoId = memoId;
+    }
+
+    public Long getMemoId()
+    {
+        return memoId;
+    }
+    public void setPlant(String plant)
+    {
+        this.plant = plant;
+    }
+
+    public String getPlant()
+    {
+        return plant;
+    }
+    public void setDevName(String devName)
+    {
+        this.devName = devName;
+    }
+
+    public String getDevName()
+    {
+        return devName;
+    }
+    public void setDevTag(String devTag)
+    {
+        this.devTag = devTag;
+    }
+
+    public String getDevTag()
+    {
+        return devTag;
+    }
+    public void setCompoName(String compoName)
+    {
+        this.compoName = compoName;
+    }
+
+    public String getCompoName()
+    {
+        return compoName;
+    }
+    public void setCompoId(String compoId)
+    {
+        this.compoId = compoId;
+    }
+
+    public String getCompoId()
+    {
+        return compoId;
+    }
+    public void setMaintType(String maintType)
+    {
+        this.maintType = maintType;
+    }
+
+    public String getMaintType()
+    {
+        return maintType;
+    }
+    public void setResponsible(String responsible)
+    {
+        this.responsible = responsible;
+    }
+
+    public String getResponsible()
+    {
+        return responsible;
+    }
+    public void setMaintContent(String maintContent)
+    {
+        this.maintContent = maintContent;
+    }
+
+    public String getMaintContent()
+    {
+        return maintContent;
+    }
+    public void setMemoReason(String memoReason)
+    {
+        this.memoReason = memoReason;
+    }
+
+    public String getMemoReason()
+    {
+        return memoReason;
+    }
+    public void setMemoTime(Date memoTime)
+    {
+        this.memoTime = memoTime;
+    }
+
+    public Date getMemoTime()
+    {
+        return memoTime;
+    }
+    public void setMaintCost(Long maintCost)
+    {
+        this.maintCost = maintCost;
+    }
+
+    public Long getMaintCost()
+    {
+        return maintCost;
+    }
+    public void setDelFlag(Long delFlag)
+    {
+        this.delFlag = delFlag;
+    }
+
+    public Long getDelFlag()
+    {
+        return delFlag;
+    }
+    public void setCreaterCode(String createrCode)
+    {
+        this.createrCode = createrCode;
+    }
+
+    public String getCreaterCode()
+    {
+        return createrCode;
+    }
+    public void setCreatedate(Date createdate)
+    {
+        this.createdate = createdate;
+    }
+
+    public Date getCreatedate()
+    {
+        return createdate;
+    }
+    public void setUpdaterCode(String updaterCode)
+    {
+        this.updaterCode = updaterCode;
+    }
+
+    public String getUpdaterCode()
+    {
+        return updaterCode;
+    }
+    public void setUpdatedate(Date updatedate)
+    {
+        this.updatedate = updatedate;
+    }
+
+    public Date getUpdatedate()
+    {
+        return updatedate;
+    }
+    public void setDeptId(Long deptId)
+    {
+        this.deptId = deptId;
+    }
+
+    public Long getDeptId()
+    {
+        return deptId;
+    }
+    public void setRemarks(String remarks)
+    {
+        this.remarks = remarks;
+    }
+
+    public String getRemarks()
+    {
+        return remarks;
+    }
+    public void setPlanId(Long planId)
+    {
+        this.planId = planId;
+    }
+
+    public Long getPlanId()
+    {
+        return planId;
+    }
+    public void setRecordId(Long recordId)
+    {
+        this.recordId = recordId;
+    }
+
+    public Long getRecordId()
+    {
+        return recordId;
+    }
+
+    @Override
+    public String toString() {
+        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
+            .append("memoId", getMemoId())
+            .append("plant", getPlant())
+            .append("devName", getDevName())
+            .append("devTag", getDevTag())
+            .append("compoName", getCompoName())
+            .append("compoId", getCompoId())
+            .append("maintType", getMaintType())
+            .append("responsible", getResponsible())
+            .append("maintContent", getMaintContent())
+            .append("memoReason", getMemoReason())
+            .append("memoTime", getMemoTime())
+            .append("maintCost", getMaintCost())
+            .append("delFlag", getDelFlag())
+            .append("createrCode", getCreaterCode())
+            .append("createdate", getCreatedate())
+            .append("updaterCode", getUpdaterCode())
+            .append("updatedate", getUpdatedate())
+            .append("deptId", getDeptId())
+            .append("remarks", getRemarks())
+            .append("planId", getPlanId())
+            .append("recordId", getRecordId())
+            .toString();
+    }
+}

+ 39 - 0
master/src/main/java/com/ruoyi/project/reliability/domain/TRelMaintPlan.java

@@ -90,6 +90,15 @@ public class TRelMaintPlan extends BaseEntity
     /** 维修部件列表(用于接收前端传递的部件数据,不存储到数据库) */
     private List<TRelMaintRecord> maintComponents;
 
+    /** 设备信息(根据装置和位号查询,不存储到数据库) */
+    private TRelDevice relDevice;
+
+    /** 维修记录列表(根据planId查询,不存储到数据库) */
+    private List<TRelMaintRecord> maintRecordsList;
+
+    /** 部件列表(根据设备位号查询,不存储到数据库) */
+    private List<TRelCompo> compoList;
+
     public void setPlanId(Long planId)
     {
         this.planId = planId;
@@ -254,6 +263,36 @@ public class TRelMaintPlan extends BaseEntity
         return maintComponents;
     }
 
+    public void setRelDevice(TRelDevice relDevice)
+    {
+        this.relDevice = relDevice;
+    }
+
+    public TRelDevice getRelDevice()
+    {
+        return relDevice;
+    }
+
+    public void setMaintRecordsList(List<TRelMaintRecord> maintRecordsList)
+    {
+        this.maintRecordsList = maintRecordsList;
+    }
+
+    public List<TRelMaintRecord> getMaintRecordsList()
+    {
+        return maintRecordsList;
+    }
+
+    public void setCompoList(List<TRelCompo> compoList)
+    {
+        this.compoList = compoList;
+    }
+
+    public List<TRelCompo> getCompoList()
+    {
+        return compoList;
+    }
+
     @Override
     public String toString() {
         return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)

+ 132 - 0
master/src/main/java/com/ruoyi/project/reliability/domain/TRelMaintRecord.java

@@ -123,6 +123,118 @@ public class TRelMaintRecord extends BaseEntity
     @Excel(name = "备注")
     private String remarks;
 
+    /** 计划ID */
+    @Excel(name = "计划ID")
+    private Long planId;
+
+    /** 维修状态:-1-删除申请中 0-新增申请中 1-待完成 2-已完成 */
+    @Excel(name = "维修状态")
+    private Integer recordStatus;
+
+    /** 维修计划信息(不存储到数据库) */
+    private TRelMaintPlan maintPlan;
+
+    /** 部件信息(不存储到数据库) */
+    private TRelCompo compo;
+
+    /** 是否需要创建新的维修/更换记录(不存储到数据库) */
+    private Boolean needMaintOrReplace;
+
+    /** 新的维修类型(不存储到数据库) */
+    private String newMaintType;
+
+    /** 新的负责人(不存储到数据库) */
+    private String newResponsible;
+
+    /** 是否无法维修/更换(不存储到数据库) */
+    private Boolean cannotMaintOrReplace;
+
+    /** 备忘原因(不存储到数据库) */
+    private String memoReason;
+
+    /** 备忘时间(不存储到数据库) */
+    private Date memoTime;
+
+    public void setMaintPlan(TRelMaintPlan maintPlan)
+    {
+        this.maintPlan = maintPlan;
+    }
+
+    public TRelMaintPlan getMaintPlan()
+    {
+        return maintPlan;
+    }
+
+    public void setCompo(TRelCompo compo)
+    {
+        this.compo = compo;
+    }
+
+    public TRelCompo getCompo()
+    {
+        return compo;
+    }
+
+    public void setNeedMaintOrReplace(Boolean needMaintOrReplace)
+    {
+        this.needMaintOrReplace = needMaintOrReplace;
+    }
+
+    public Boolean getNeedMaintOrReplace()
+    {
+        return needMaintOrReplace;
+    }
+
+    public void setNewMaintType(String newMaintType)
+    {
+        this.newMaintType = newMaintType;
+    }
+
+    public String getNewMaintType()
+    {
+        return newMaintType;
+    }
+
+    public void setNewResponsible(String newResponsible)
+    {
+        this.newResponsible = newResponsible;
+    }
+
+    public String getNewResponsible()
+    {
+        return newResponsible;
+    }
+
+    public void setCannotMaintOrReplace(Boolean cannotMaintOrReplace)
+    {
+        this.cannotMaintOrReplace = cannotMaintOrReplace;
+    }
+
+    public Boolean getCannotMaintOrReplace()
+    {
+        return cannotMaintOrReplace;
+    }
+
+    public void setMemoReason(String memoReason)
+    {
+        this.memoReason = memoReason;
+    }
+
+    public String getMemoReason()
+    {
+        return memoReason;
+    }
+
+    public void setMemoTime(Date memoTime)
+    {
+        this.memoTime = memoTime;
+    }
+
+    public Date getMemoTime()
+    {
+        return memoTime;
+    }
+
     public void setRecordId(Long recordId)
     {
         this.recordId = recordId;
@@ -357,6 +469,24 @@ public class TRelMaintRecord extends BaseEntity
     {
         return remarks;
     }
+    public void setPlanId(Long planId)
+    {
+        this.planId = planId;
+    }
+
+    public Long getPlanId()
+    {
+        return planId;
+    }
+    public void setRecordStatus(Integer recordStatus)
+    {
+        this.recordStatus = recordStatus;
+    }
+
+    public Integer getRecordStatus()
+    {
+        return recordStatus;
+    }
 
     @Override
     public String toString() {
@@ -387,6 +517,8 @@ public class TRelMaintRecord extends BaseEntity
             .append("updatedate", getUpdatedate())
             .append("deptId", getDeptId())
             .append("remarks", getRemarks())
+            .append("planId", getPlanId())
+            .append("recordStatus", getRecordStatus())
             .toString();
     }
 }

+ 8 - 0
master/src/main/java/com/ruoyi/project/reliability/mapper/TRelDeviceMapper.java

@@ -29,6 +29,14 @@ public interface TRelDeviceMapper
     @DataScope(deptAlias = "d")
     public List<TRelDevice> selectTRelDeviceList(TRelDevice tRelDevice);
 
+    /**
+     * 根据设备位号查询可靠性设备清单
+     *
+     * @param devTag 设备位号
+     * @return 可靠性设备清单
+     */
+    public TRelDevice selectTRelDeviceByDevTag(String devTag);
+
     /**
      * 新增可靠性设备清单
      *

+ 63 - 0
master/src/main/java/com/ruoyi/project/reliability/mapper/TRelMaintMemoMapper.java

@@ -0,0 +1,63 @@
+package com.ruoyi.project.reliability.mapper;
+
+import java.util.List;
+import com.ruoyi.framework.aspectj.lang.annotation.DataScope;
+import com.ruoyi.project.reliability.domain.TRelMaintMemo;
+
+/**
+ * 维修备忘录Mapper接口
+ *
+ * @author ssy
+ * @date 2025-11-06
+ */
+public interface TRelMaintMemoMapper
+{
+    /**
+     * 查询维修备忘录
+     *
+     * @param memoId 维修备忘录ID
+     * @return 维修备忘录
+     */
+    public TRelMaintMemo selectTRelMaintMemoById(Long memoId);
+
+    /**
+     * 查询维修备忘录列表
+     *
+     * @param tRelMaintMemo 维修备忘录
+     * @return 维修备忘录集合
+     */
+    @DataScope(deptAlias = "d")
+    public List<TRelMaintMemo> selectTRelMaintMemoList(TRelMaintMemo tRelMaintMemo);
+
+    /**
+     * 新增维修备忘录
+     *
+     * @param tRelMaintMemo 维修备忘录
+     * @return 结果
+     */
+    public int insertTRelMaintMemo(TRelMaintMemo tRelMaintMemo);
+
+    /**
+     * 修改维修备忘录
+     *
+     * @param tRelMaintMemo 维修备忘录
+     * @return 结果
+     */
+    public int updateTRelMaintMemo(TRelMaintMemo tRelMaintMemo);
+
+    /**
+     * 删除维修备忘录
+     *
+     * @param memoId 维修备忘录ID
+     * @return 结果
+     */
+    public int deleteTRelMaintMemoById(Long memoId);
+
+    /**
+     * 批量删除维修备忘录
+     *
+     * @param memoIds 需要删除的数据ID
+     * @return 结果
+     */
+    public int deleteTRelMaintMemoByIds(Long[] memoIds);
+}

+ 16 - 8
master/src/main/java/com/ruoyi/project/reliability/mapper/TRelMaintRecordMapper.java

@@ -6,15 +6,15 @@ import com.ruoyi.project.reliability.domain.TRelMaintRecord;
 
 /**
  * 部件维修记录Mapper接口
- * 
+ *
  * @author ssy
  * @date 2025-10-28
  */
-public interface TRelMaintRecordMapper 
+public interface TRelMaintRecordMapper
 {
     /**
      * 查询部件维修记录
-     * 
+     *
      * @param recordId 部件维修记录ID
      * @return 部件维修记录
      */
@@ -22,7 +22,7 @@ public interface TRelMaintRecordMapper
 
     /**
      * 查询部件维修记录列表
-     * 
+     *
      * @param tRelMaintRecord 部件维修记录
      * @return 部件维修记录集合
      */
@@ -31,7 +31,7 @@ public interface TRelMaintRecordMapper
 
     /**
      * 新增部件维修记录
-     * 
+     *
      * @param tRelMaintRecord 部件维修记录
      * @return 结果
      */
@@ -39,7 +39,7 @@ public interface TRelMaintRecordMapper
 
     /**
      * 修改部件维修记录
-     * 
+     *
      * @param tRelMaintRecord 部件维修记录
      * @return 结果
      */
@@ -47,7 +47,7 @@ public interface TRelMaintRecordMapper
 
     /**
      * 删除部件维修记录
-     * 
+     *
      * @param recordId 部件维修记录ID
      * @return 结果
      */
@@ -55,9 +55,17 @@ public interface TRelMaintRecordMapper
 
     /**
      * 批量删除部件维修记录
-     * 
+     *
      * @param recordIds 需要删除的数据ID
      * @return 结果
      */
     public int deleteTRelMaintRecordByIds(Long[] recordIds);
+
+    /**
+     * 根据当前登录用户员工ID查询部件维修记录列表
+     *
+     * @param tRelMaintRecord 部件维修记录
+     * @return 部件维修记录集合
+     */
+    public List<TRelMaintRecord> selectTRelMaintRecordListByCurrentUser(TRelMaintRecord tRelMaintRecord);
 }

+ 61 - 0
master/src/main/java/com/ruoyi/project/reliability/service/ITRelMaintMemoService.java

@@ -0,0 +1,61 @@
+package com.ruoyi.project.reliability.service;
+
+import java.util.List;
+import com.ruoyi.project.reliability.domain.TRelMaintMemo;
+
+/**
+ * 维修备忘录Service接口
+ * 
+ * @author ssy
+ * @date 2025-11-06
+ */
+public interface ITRelMaintMemoService 
+{
+    /**
+     * 查询维修备忘录
+     * 
+     * @param memoId 维修备忘录ID
+     * @return 维修备忘录
+     */
+    public TRelMaintMemo selectTRelMaintMemoById(Long memoId);
+
+    /**
+     * 查询维修备忘录列表
+     * 
+     * @param tRelMaintMemo 维修备忘录
+     * @return 维修备忘录集合
+     */
+    public List<TRelMaintMemo> selectTRelMaintMemoList(TRelMaintMemo tRelMaintMemo);
+
+    /**
+     * 新增维修备忘录
+     * 
+     * @param tRelMaintMemo 维修备忘录
+     * @return 结果
+     */
+    public int insertTRelMaintMemo(TRelMaintMemo tRelMaintMemo);
+
+    /**
+     * 修改维修备忘录
+     * 
+     * @param tRelMaintMemo 维修备忘录
+     * @return 结果
+     */
+    public int updateTRelMaintMemo(TRelMaintMemo tRelMaintMemo);
+
+    /**
+     * 批量删除维修备忘录
+     * 
+     * @param memoIds 需要删除的维修备忘录ID
+     * @return 结果
+     */
+    public int deleteTRelMaintMemoByIds(Long[] memoIds);
+
+    /**
+     * 删除维修备忘录信息
+     * 
+     * @param memoId 维修备忘录ID
+     * @return 结果
+     */
+    public int deleteTRelMaintMemoById(Long memoId);
+}

+ 8 - 0
master/src/main/java/com/ruoyi/project/reliability/service/ITRelMaintRecordService.java

@@ -58,4 +58,12 @@ public interface ITRelMaintRecordService
      * @return 结果
      */
     public int deleteTRelMaintRecordById(Long recordId);
+
+    /**
+     * 根据当前登录用户员工ID查询部件维修记录列表
+     * 
+     * @param tRelMaintRecord 部件维修记录
+     * @return 部件维修记录集合
+     */
+    public List<TRelMaintRecord> selectTRelMaintRecordListByCurrentUser(TRelMaintRecord tRelMaintRecord);
 }

+ 93 - 0
master/src/main/java/com/ruoyi/project/reliability/service/impl/TRelMaintMemoServiceImpl.java

@@ -0,0 +1,93 @@
+package com.ruoyi.project.reliability.service.impl;
+
+import java.util.List;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import com.ruoyi.project.reliability.mapper.TRelMaintMemoMapper;
+import com.ruoyi.project.reliability.domain.TRelMaintMemo;
+import com.ruoyi.project.reliability.service.ITRelMaintMemoService;
+
+/**
+ * 维修备忘录Service业务层处理
+ *
+ * @author ssy
+ * @date 2025-11-06
+ */
+@Service
+public class TRelMaintMemoServiceImpl implements ITRelMaintMemoService
+{
+    @Autowired
+    private TRelMaintMemoMapper tRelMaintMemoMapper;
+
+    /**
+     * 查询维修备忘录
+     *
+     * @param memoId 维修备忘录ID
+     * @return 维修备忘录
+     */
+    @Override
+    public TRelMaintMemo selectTRelMaintMemoById(Long memoId)
+    {
+        return tRelMaintMemoMapper.selectTRelMaintMemoById(memoId);
+    }
+
+    /**
+     * 查询维修备忘录列表
+     *
+     * @param tRelMaintMemo 维修备忘录
+     * @return 维修备忘录
+     */
+    @Override
+    public List<TRelMaintMemo> selectTRelMaintMemoList(TRelMaintMemo tRelMaintMemo)
+    {
+        return tRelMaintMemoMapper.selectTRelMaintMemoList(tRelMaintMemo);
+    }
+
+    /**
+     * 新增维修备忘录
+     *
+     * @param tRelMaintMemo 维修备忘录
+     * @return 结果
+     */
+    @Override
+    public int insertTRelMaintMemo(TRelMaintMemo tRelMaintMemo)
+    {
+        return tRelMaintMemoMapper.insertTRelMaintMemo(tRelMaintMemo);
+    }
+
+    /**
+     * 修改维修备忘录
+     *
+     * @param tRelMaintMemo 维修备忘录
+     * @return 结果
+     */
+    @Override
+    public int updateTRelMaintMemo(TRelMaintMemo tRelMaintMemo)
+    {
+        return tRelMaintMemoMapper.updateTRelMaintMemo(tRelMaintMemo);
+    }
+
+    /**
+     * 批量删除维修备忘录
+     *
+     * @param memoIds 需要删除的维修备忘录ID
+     * @return 结果
+     */
+    @Override
+    public int deleteTRelMaintMemoByIds(Long[] memoIds)
+    {
+        return tRelMaintMemoMapper.deleteTRelMaintMemoByIds(memoIds);
+    }
+
+    /**
+     * 删除维修备忘录信息
+     *
+     * @param memoId 维修备忘录ID
+     * @return 结果
+     */
+    @Override
+    public int deleteTRelMaintMemoById(Long memoId)
+    {
+        return tRelMaintMemoMapper.deleteTRelMaintMemoById(memoId);
+    }
+}

+ 45 - 1
master/src/main/java/com/ruoyi/project/reliability/service/impl/TRelMaintPlanServiceImpl.java

@@ -5,7 +5,13 @@ import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import com.ruoyi.project.reliability.mapper.TRelMaintPlanMapper;
 import com.ruoyi.project.reliability.domain.TRelMaintPlan;
+import com.ruoyi.project.reliability.domain.TRelDevice;
+import com.ruoyi.project.reliability.domain.TRelMaintRecord;
+import com.ruoyi.project.reliability.domain.TRelCompo;
 import com.ruoyi.project.reliability.service.ITRelMaintPlanService;
+import com.ruoyi.project.reliability.service.ITRelDeviceService;
+import com.ruoyi.project.reliability.service.ITRelMaintRecordService;
+import com.ruoyi.project.reliability.service.ITRelCompoService;
 
 /**
  * 设备维修计划Service业务层处理
@@ -19,6 +25,15 @@ public class TRelMaintPlanServiceImpl implements ITRelMaintPlanService
     @Autowired
     private TRelMaintPlanMapper tRelMaintPlanMapper;
 
+    @Autowired
+    private ITRelDeviceService tRelDeviceService;
+
+    @Autowired
+    private ITRelMaintRecordService tRelMaintRecordService;
+
+    @Autowired
+    private ITRelCompoService tRelCompoService;
+
     /**
      * 查询设备维修计划
      *
@@ -28,7 +43,36 @@ public class TRelMaintPlanServiceImpl implements ITRelMaintPlanService
     @Override
     public TRelMaintPlan selectTRelMaintPlanById(Long planId)
     {
-        return tRelMaintPlanMapper.selectTRelMaintPlanById(planId);
+        TRelMaintPlan plan = tRelMaintPlanMapper.selectTRelMaintPlanById(planId);
+        
+        if (plan != null) {
+            // 根据装置和位号查询设备信息
+            if (plan.getPlant() != null && plan.getDevTag() != null) {
+                TRelDevice deviceQuery = new TRelDevice();
+                deviceQuery.setPlant(plan.getPlant());
+                deviceQuery.setDevTag(plan.getDevTag());
+                List<TRelDevice> deviceList = tRelDeviceService.selectTRelDeviceList(deviceQuery);
+                if (deviceList != null && !deviceList.isEmpty()) {
+                    plan.setRelDevice(deviceList.get(0));
+                }
+            }
+            
+            // 根据设备位号查询部件列表
+            if (plan.getDevTag() != null) {
+                TRelCompo compoQuery = new TRelCompo();
+                compoQuery.setDevTag(plan.getDevTag());
+                List<TRelCompo> compoList = tRelCompoService.selectTRelCompoList(compoQuery);
+                plan.setCompoList(compoList);
+            }
+            
+            // 根据planId查询维修记录列表
+            TRelMaintRecord recordQuery = new TRelMaintRecord();
+            recordQuery.setPlanId(planId);
+            List<TRelMaintRecord> recordList = tRelMaintRecordService.selectTRelMaintRecordList(recordQuery);
+            plan.setMaintRecordsList(recordList);
+        }
+        
+        return plan;
     }
 
     /**

+ 85 - 2
master/src/main/java/com/ruoyi/project/reliability/service/impl/TRelMaintRecordServiceImpl.java

@@ -4,8 +4,12 @@ import java.util.List;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import com.ruoyi.project.reliability.mapper.TRelMaintRecordMapper;
+import com.ruoyi.project.reliability.mapper.TRelMaintPlanMapper;
+import com.ruoyi.project.reliability.mapper.TRelCompoMapper;
 import com.ruoyi.project.reliability.domain.TRelMaintRecord;
 import com.ruoyi.project.reliability.service.ITRelMaintRecordService;
+import com.ruoyi.project.reliability.domain.TRelMaintPlan;
+import com.ruoyi.project.reliability.domain.TRelCompo;
 
 /**
  * 部件维修记录Service业务层处理
@@ -19,6 +23,12 @@ public class TRelMaintRecordServiceImpl implements ITRelMaintRecordService
     @Autowired
     private TRelMaintRecordMapper tRelMaintRecordMapper;
 
+    @Autowired
+    private TRelMaintPlanMapper tRelMaintPlanMapper;
+
+    @Autowired
+    private TRelCompoMapper tRelCompoMapper;
+
     /**
      * 查询部件维修记录
      *
@@ -28,7 +38,21 @@ public class TRelMaintRecordServiceImpl implements ITRelMaintRecordService
     @Override
     public TRelMaintRecord selectTRelMaintRecordById(Long recordId)
     {
-        return tRelMaintRecordMapper.selectTRelMaintRecordById(recordId);
+        TRelMaintRecord record = tRelMaintRecordMapper.selectTRelMaintRecordById(recordId);
+        if (record != null) {
+            // 如果记录存在且有planId,则查询维修计划信息(直接从Mapper查询,避免循环)
+            if (record.getPlanId() != null) {
+                TRelMaintPlan plan = tRelMaintPlanMapper.selectTRelMaintPlanById(record.getPlanId());
+                // 清空计划中的记录列表,避免循环引用
+                if (plan != null) {
+                    plan.setMaintRecordsList(null);
+                }
+                record.setMaintPlan(plan);
+            }
+            // 填充部件信息
+            fillCompoInfo(record);
+        }
+        return record;
     }
 
     /**
@@ -40,7 +64,38 @@ public class TRelMaintRecordServiceImpl implements ITRelMaintRecordService
     @Override
     public List<TRelMaintRecord> selectTRelMaintRecordList(TRelMaintRecord tRelMaintRecord)
     {
-        return tRelMaintRecordMapper.selectTRelMaintRecordList(tRelMaintRecord);
+        List<TRelMaintRecord> list = tRelMaintRecordMapper.selectTRelMaintRecordList(tRelMaintRecord);
+        // 为每个记录填充维修计划信息和部件信息
+        if (list != null && !list.isEmpty()) {
+            for (TRelMaintRecord record : list) {
+                if (record.getPlanId() != null) {
+                    TRelMaintPlan plan = tRelMaintPlanMapper.selectTRelMaintPlanById(record.getPlanId());
+                    // 清空计划中的记录列表,避免循环引用
+                    if (plan != null) {
+                        plan.setMaintRecordsList(null);
+                    }
+                    record.setMaintPlan(plan);
+                }
+                // 填充部件信息
+                fillCompoInfo(record);
+            }
+        }
+        return list;
+    }
+
+    /**
+     * 填充部件信息
+     */
+    private void fillCompoInfo(TRelMaintRecord record) {
+        if (record.getCompoId() != null && !record.getCompoId().isEmpty()) {
+            try {
+                Long compoId = Long.parseLong(record.getCompoId());
+                TRelCompo compo = tRelCompoMapper.selectTRelCompoById(compoId);
+                record.setCompo(compo);
+            } catch (NumberFormatException e) {
+                // compoId不是数字,忽略
+            }
+        }
     }
 
     /**
@@ -90,4 +145,32 @@ public class TRelMaintRecordServiceImpl implements ITRelMaintRecordService
     {
         return tRelMaintRecordMapper.deleteTRelMaintRecordById(recordId);
     }
+
+    /**
+     * 根据当前登录用户员工ID查询部件维修记录列表
+     *
+     * @param tRelMaintRecord 部件维修记录
+     * @return 部件维修记录
+     */
+    @Override
+    public List<TRelMaintRecord> selectTRelMaintRecordListByCurrentUser(TRelMaintRecord tRelMaintRecord)
+    {
+        List<TRelMaintRecord> list = tRelMaintRecordMapper.selectTRelMaintRecordListByCurrentUser(tRelMaintRecord);
+        // 为每个记录填充维修计划信息和部件信息
+        if (list != null && !list.isEmpty()) {
+            for (TRelMaintRecord record : list) {
+                if (record.getPlanId() != null) {
+                    TRelMaintPlan plan = tRelMaintPlanMapper.selectTRelMaintPlanById(record.getPlanId());
+                    // 清空计划中的记录列表,避免循环引用
+                    if (plan != null) {
+                        plan.setMaintRecordsList(null);
+                    }
+                    record.setMaintPlan(plan);
+                }
+                // 填充部件信息
+                fillCompoInfo(record);
+            }
+        }
+        return list;
+    }
 }

+ 6 - 0
master/src/main/resources/mybatis/reliability/TRelDeviceMapper.xml

@@ -61,6 +61,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         ${params.dataScope}
     </select>
 
+    <select id="selectTRelDeviceByDevTag" parameterType="String" resultMap="TRelDeviceResult">
+        <include refid="selectTRelDeviceVo"/>
+        where d.dev_tag = #{devTag} and d.del_flag = 0
+        and rownum = 1
+    </select>
+
     <select id="selectTRelDeviceById" parameterType="Long" resultMap="TRelDeviceDetailResult">
         <include refid="selectTRelDeviceVo"/>
         where d.dev_id = #{devId}

+ 161 - 0
master/src/main/resources/mybatis/reliability/TRelMaintMemoMapper.xml

@@ -0,0 +1,161 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper
+PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
+"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.ruoyi.project.reliability.mapper.TRelMaintMemoMapper">
+
+    <resultMap type="TRelMaintMemo" id="TRelMaintMemoResult">
+        <result property="memoId"    column="memo_id"    />
+        <result property="plant"    column="plant"    />
+        <result property="devName"    column="dev_name"    />
+        <result property="devTag"    column="dev_tag"    />
+        <result property="compoName"    column="compo_name"    />
+        <result property="compoId"    column="compo_id"    />
+        <result property="maintType"    column="maint_type"    />
+        <result property="responsible"    column="responsible"    />
+        <result property="maintContent"    column="maint_content"    />
+        <result property="memoReason"    column="memo_reason"    />
+        <result property="memoTime"    column="memo_time"    />
+        <result property="maintCost"    column="maint_cost"    />
+        <result property="delFlag"    column="del_flag"    />
+        <result property="createrCode"    column="creater_code"    />
+        <result property="createdate"    column="createdate"    />
+        <result property="updaterCode"    column="updater_code"    />
+        <result property="updatedate"    column="updatedate"    />
+        <result property="deptId"    column="dept_id"    />
+        <result property="remarks"    column="remarks"    />
+        <result property="planId"    column="plan_id"    />
+        <result property="recordId"    column="record_id"    />
+        <result property="deptName" column="dept_name" />
+    </resultMap>
+
+    <sql id="selectTRelMaintMemoVo">
+        select d.memo_id, d.plant, d.dev_name, d.dev_tag, d.compo_name, d.compo_id, d.maint_type, d.responsible, d.maint_content, d.memo_reason, d.memo_time, d.maint_cost, d.del_flag, d.creater_code, d.createdate, d.updater_code, d.updatedate, d.dept_id, d.remarks, d.plan_id, d.record_id from t_rel_maint_memo d
+      left join sys_dept s on s.dept_id = d.dept_id
+    </sql>
+
+    <select id="selectTRelMaintMemoList" parameterType="TRelMaintMemo" resultMap="TRelMaintMemoResult">
+        <include refid="selectTRelMaintMemoVo"/>
+        <where>
+            <if test="plant != null  and plant != ''"> and plant = #{plant}</if>
+            <if test="devName != null  and devName != ''"> and dev_name like concat(concat('%', #{devName}), '%')</if>
+            <if test="devTag != null  and devTag != ''"> and dev_tag = #{devTag}</if>
+            <if test="compoName != null  and compoName != ''"> and compo_name like concat(concat('%', #{compoName}), '%')</if>
+            <if test="compoId != null  and compoId != ''"> and compo_id = #{compoId}</if>
+            <if test="maintType != null  and maintType != ''"> and maint_type = #{maintType}</if>
+            <if test="responsible != null  and responsible != ''"> and responsible = #{responsible}</if>
+            <if test="maintContent != null  and maintContent != ''"> and maint_content = #{maintContent}</if>
+            <if test="memoReason != null  and memoReason != ''"> and memo_reason = #{memoReason}</if>
+            <if test="memoTime != null "> and memo_time = #{memoTime}</if>
+            <if test="maintCost != null "> and maint_cost = #{maintCost}</if>
+            <if test="createrCode != null  and createrCode != ''"> and creater_code = #{createrCode}</if>
+            <if test="createdate != null "> and createdate = #{createdate}</if>
+            <if test="updaterCode != null  and updaterCode != ''"> and updater_code = #{updaterCode}</if>
+            <if test="updatedate != null "> and updatedate = #{updatedate}</if>
+            <if test="deptId != null "> and dept_id = #{deptId}</if>
+            <if test="remarks != null  and remarks != ''"> and remarks = #{remarks}</if>
+            <if test="planId != null "> and plan_id = #{planId}</if>
+            <if test="recordId != null "> and record_id = #{recordId}</if>
+            and d.del_flag = 0
+        </where>
+        <!-- 数据范围过滤 -->
+        ${params.dataScope}
+    </select>
+
+    <select id="selectTRelMaintMemoById" parameterType="Long" resultMap="TRelMaintMemoResult">
+        <include refid="selectTRelMaintMemoVo"/>
+        where memo_id = #{memoId}
+    </select>
+
+    <insert id="insertTRelMaintMemo" parameterType="TRelMaintMemo">
+        <selectKey keyProperty="memoId" resultType="long" order="BEFORE">
+            SELECT seq_t_rel_maint_memo.NEXTVAL as memoId FROM DUAL
+        </selectKey>
+        insert into t_rel_maint_memo
+        <trim prefix="(" suffix=")" suffixOverrides=",">
+            <if test="memoId != null">memo_id,</if>
+            <if test="plant != null">plant,</if>
+            <if test="devName != null">dev_name,</if>
+            <if test="devTag != null">dev_tag,</if>
+            <if test="compoName != null">compo_name,</if>
+            <if test="compoId != null">compo_id,</if>
+            <if test="maintType != null">maint_type,</if>
+            <if test="responsible != null">responsible,</if>
+            <if test="maintContent != null">maint_content,</if>
+            <if test="memoReason != null">memo_reason,</if>
+            <if test="memoTime != null">memo_time,</if>
+            <if test="maintCost != null">maint_cost,</if>
+            <if test="delFlag != null">del_flag,</if>
+            <if test="createrCode != null">creater_code,</if>
+            <if test="createdate != null">createdate,</if>
+            <if test="updaterCode != null">updater_code,</if>
+            <if test="updatedate != null">updatedate,</if>
+            <if test="deptId != null">dept_id,</if>
+            <if test="remarks != null">remarks,</if>
+            <if test="planId != null">plan_id,</if>
+            <if test="recordId != null">record_id,</if>
+         </trim>
+        <trim prefix="values (" suffix=")" suffixOverrides=",">
+            <if test="memoId != null">#{memoId},</if>
+            <if test="plant != null">#{plant},</if>
+            <if test="devName != null">#{devName},</if>
+            <if test="devTag != null">#{devTag},</if>
+            <if test="compoName != null">#{compoName},</if>
+            <if test="compoId != null">#{compoId},</if>
+            <if test="maintType != null">#{maintType},</if>
+            <if test="responsible != null">#{responsible},</if>
+            <if test="maintContent != null">#{maintContent},</if>
+            <if test="memoReason != null">#{memoReason},</if>
+            <if test="memoTime != null">#{memoTime},</if>
+            <if test="maintCost != null">#{maintCost},</if>
+            <if test="delFlag != null">#{delFlag},</if>
+            <if test="createrCode != null">#{createrCode},</if>
+            <if test="createdate != null">#{createdate},</if>
+            <if test="updaterCode != null">#{updaterCode},</if>
+            <if test="updatedate != null">#{updatedate},</if>
+            <if test="deptId != null">#{deptId},</if>
+            <if test="remarks != null">#{remarks},</if>
+            <if test="planId != null">#{planId},</if>
+            <if test="recordId != null">#{recordId},</if>
+         </trim>
+    </insert>
+
+    <update id="updateTRelMaintMemo" parameterType="TRelMaintMemo">
+        update t_rel_maint_memo
+        <trim prefix="SET" suffixOverrides=",">
+            <if test="plant != null">plant = #{plant},</if>
+            <if test="devName != null">dev_name = #{devName},</if>
+            <if test="devTag != null">dev_tag = #{devTag},</if>
+            <if test="compoName != null">compo_name = #{compoName},</if>
+            <if test="compoId != null">compo_id = #{compoId},</if>
+            <if test="maintType != null">maint_type = #{maintType},</if>
+            <if test="responsible != null">responsible = #{responsible},</if>
+            <if test="maintContent != null">maint_content = #{maintContent},</if>
+            <if test="memoReason != null">memo_reason = #{memoReason},</if>
+            <if test="memoTime != null">memo_time = #{memoTime},</if>
+            <if test="maintCost != null">maint_cost = #{maintCost},</if>
+            <if test="delFlag != null">del_flag = #{delFlag},</if>
+            <if test="createrCode != null">creater_code = #{createrCode},</if>
+            <if test="createdate != null">createdate = #{createdate},</if>
+            <if test="updaterCode != null">updater_code = #{updaterCode},</if>
+            <if test="updatedate != null">updatedate = #{updatedate},</if>
+            <if test="deptId != null">dept_id = #{deptId},</if>
+            <if test="remarks != null">remarks = #{remarks},</if>
+            <if test="planId != null">plan_id = #{planId},</if>
+            <if test="recordId != null">record_id = #{recordId},</if>
+        </trim>
+        where memo_id = #{memoId}
+    </update>
+
+    <update id="deleteTRelMaintMemoById" parameterType="Long">
+        update t_rel_maint_memo set del_flag = 2 where memo_id = #{memoId}
+    </update>
+
+    <update id="deleteTRelMaintMemoByIds" parameterType="String">
+        update t_rel_maint_memo set del_flag = 2 where memo_id in
+        <foreach item="memoId" collection="array" open="(" separator="," close=")">
+            #{memoId}
+        </foreach>
+    </update>
+
+</mapper>

+ 1 - 1
master/src/main/resources/mybatis/reliability/TRelMaintPlanMapper.xml

@@ -26,7 +26,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     </resultMap>
 
     <sql id="selectTRelMaintPlanVo">
-        select d.plan_id, d.plant, d.dev_name, d.dev_tag, d.plan_time, d.approval_status, d.responsible, d.completion_status, d.process_id, d.approver, d.del_flag, d.creater_code, d.createdate, d.updater_code, d.updatedate, d.dept_id, d.remarks ,s.dept_name from t_rel_maint_plan d
+        select d.plan_id, d.plant, d.dev_name, d.dev_tag, d.plan_time, d.approval_status, d.responsible, d.completion_status, d.process_id, d.approver, d.del_flag, d.creater_code, d.createdate, d.updater_code, d.updatedate, d.dept_id, d.remarks  from t_rel_maint_plan d
       left join sys_dept s on s.dept_id = d.dept_id
     </sql>
 

+ 49 - 1
master/src/main/resources/mybatis/reliability/TRelMaintRecordMapper.xml

@@ -31,11 +31,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <result property="updatedate"    column="updatedate"    />
         <result property="deptId"    column="dept_id"    />
         <result property="remarks"    column="remarks"    />
+        <result property="planId"    column="plan_id"    />
+        <result property="recordStatus"    column="record_status"    />
         <result property="deptName" column="dept_name" />
     </resultMap>
 
     <sql id="selectTRelMaintRecordVo">
-        select d.record_id, d.plant, d.dev_name, d.dev_tag, d.compo_name, d.compo_id, d.maint_type, d.maint_dept, d.inspector, d.inspect_content, d.inspect_time, d.responsible, d.maint_content, d.maint_result, d.maint_time, d.maint_cost, d.maint_duration, d.process_loss, d.attachments, d.del_flag, d.creater_code, d.createdate, d.updater_code, d.updatedate, d.dept_id, d.remarks ,s.dept_name from t_rel_maint_record d
+        select d.record_id, d.plant, d.dev_name, d.dev_tag, d.compo_name, d.compo_id, d.maint_type, d.maint_dept, d.inspector, d.inspect_content, d.inspect_time, d.responsible, d.maint_content, d.maint_result, d.maint_time, d.maint_cost, d.maint_duration, d.process_loss, d.attachments, d.del_flag, d.creater_code, d.createdate, d.updater_code, d.updatedate, d.dept_id, d.remarks, d.plan_id, d.record_status  from t_rel_maint_record d
       left join sys_dept s on s.dept_id = d.dept_id
     </sql>
 
@@ -66,6 +68,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="updatedate != null "> and updatedate = #{updatedate}</if>
             <if test="deptId != null "> and dept_id = #{deptId}</if>
             <if test="remarks != null  and remarks != ''"> and remarks = #{remarks}</if>
+            <if test="planId != null "> and plan_id = #{planId}</if>
+            <if test="recordStatus != null"> and record_status = #{recordStatus}</if>
             and d.del_flag = 0
         </where>
         <!-- 数据范围过滤 -->
@@ -77,6 +81,44 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         where record_id = #{recordId}
     </select>
 
+    <select id="selectTRelMaintRecordListByCurrentUser" parameterType="TRelMaintRecord" resultMap="TRelMaintRecordResult">
+        <include refid="selectTRelMaintRecordVo"/>
+        <where>
+            <if test="plant != null  and plant != ''"> and plant = #{plant}</if>
+            <if test="devName != null  and devName != ''"> and dev_name like concat(concat('%', #{devName}), '%')</if>
+            <if test="devTag != null  and devTag != ''"> and dev_tag = #{devTag}</if>
+            <if test="compoName != null  and compoName != ''"> and compo_name like concat(concat('%', #{compoName}), '%')</if>
+            <if test="compoId != null  and compoId != ''"> and compo_id = #{compoId}</if>
+            <if test="maintType != null  and maintType != ''"> and maint_type = #{maintType}</if>
+            <if test="maintDept != null  and maintDept != ''"> and maint_dept = #{maintDept}</if>
+            <if test="inspector != null  and inspector != ''"> and inspector = #{inspector}</if>
+            <if test="inspectContent != null  and inspectContent != ''"> and inspect_content = #{inspectContent}</if>
+            <if test="inspectTime != null "> and inspect_time = #{inspectTime}</if>
+            <if test="maintContent != null  and maintContent != ''"> and maint_content = #{maintContent}</if>
+            <if test="maintResult != null  and maintResult != ''"> and maint_result = #{maintResult}</if>
+            <if test="maintTime != null "> and maint_time = #{maintTime}</if>
+            <if test="maintCost != null "> and maint_cost = #{maintCost}</if>
+            <if test="maintDuration != null "> and maint_duration = #{maintDuration}</if>
+            <if test="processLoss != null  and processLoss != ''"> and process_loss = #{processLoss}</if>
+            <if test="attachments != null  and attachments != ''"> and attachments = #{attachments}</if>
+            <if test="createrCode != null  and createrCode != ''"> and creater_code = #{createrCode}</if>
+            <if test="createdate != null "> and createdate = #{createdate}</if>
+            <if test="updaterCode != null  and updaterCode != ''"> and updater_code = #{updaterCode}</if>
+            <if test="updatedate != null "> and updatedate = #{updatedate}</if>
+            <if test="deptId != null "> and dept_id = #{deptId}</if>
+            <if test="remarks != null  and remarks != ''"> and remarks = #{remarks}</if>
+            <if test="planId != null "> and plan_id = #{planId}</if>
+            <!-- 只查询 recordStatus 为 1 和 2 的数据 -->
+            and (d.record_status = 1 or d.record_status = 2)
+            and d.del_flag = 0
+            and d.responsible = #{responsible}
+        </where>
+        <!-- 数据范围过滤 -->
+        ${params.dataScope}
+        <!-- 排序:recordStatus 为 1 的排在前面 -->
+        order by d.record_status asc
+    </select>
+
     <insert id="insertTRelMaintRecord" parameterType="TRelMaintRecord">
         <selectKey keyProperty="recordId" resultType="long" order="BEFORE">
             SELECT seq_t_rel_maint_record.NEXTVAL as recordId FROM DUAL
@@ -109,6 +151,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="updatedate != null">updatedate,</if>
             <if test="deptId != null">dept_id,</if>
             <if test="remarks != null">remarks,</if>
+            <if test="planId != null">plan_id,</if>
+            <if test="recordStatus != null">record_status,</if>
          </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
             <if test="recordId != null">#{recordId},</if>
@@ -137,6 +181,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="updatedate != null">#{updatedate},</if>
             <if test="deptId != null">#{deptId},</if>
             <if test="remarks != null">#{remarks},</if>
+            <if test="planId != null">#{planId},</if>
+            <if test="recordStatus != null">#{recordStatus},</if>
          </trim>
     </insert>
 
@@ -168,6 +214,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="updatedate != null">updatedate = #{updatedate},</if>
             <if test="deptId != null">dept_id = #{deptId},</if>
             <if test="remarks != null">remarks = #{remarks},</if>
+            <if test="planId != null">plan_id = #{planId},</if>
+            <if test="recordStatus != null">record_status = #{recordStatus},</if>
         </trim>
         where record_id = #{recordId}
     </update>

+ 53 - 0
ui/src/api/reliability/rel_maint_memo.js

@@ -0,0 +1,53 @@
+import request from '@/utils/request'
+
+// 查询维修备忘录列表
+export function listRel_maint_memo(query) {
+  return request({
+    url: '/reliability/rel_maint_memo/list',
+    method: 'get',
+    params: query
+  })
+}
+
+// 查询维修备忘录详细
+export function getRel_maint_memo(memoId) {
+  return request({
+    url: '/reliability/rel_maint_memo/' + memoId,
+    method: 'get'
+  })
+}
+
+// 新增维修备忘录
+export function addRel_maint_memo(data) {
+  return request({
+    url: '/reliability/rel_maint_memo',
+    method: 'post',
+    data: data
+  })
+}
+
+// 修改维修备忘录
+export function updateRel_maint_memo(data) {
+  return request({
+    url: '/reliability/rel_maint_memo',
+    method: 'put',
+    data: data
+  })
+}
+
+// 删除维修备忘录
+export function delRel_maint_memo(memoId) {
+  return request({
+    url: '/reliability/rel_maint_memo/' + memoId,
+    method: 'delete'
+  })
+}
+
+// 导出维修备忘录
+export function exportRel_maint_memo(query) {
+  return request({
+    url: '/reliability/rel_maint_memo/export',
+    method: 'get',
+    params: query
+  })
+}

+ 9 - 0
ui/src/api/reliability/rel_maint_plan.js

@@ -60,3 +60,12 @@ export function submitApprove(data) {
     data: data
   })
 }
+
+// 维修计划审批处理
+export function handleRelMaintPlanApprove(data) {
+  return request({
+    url: '/reliability/rel_maint_plan/handle',
+    method: 'put',
+    data: data
+  })
+}

+ 9 - 0
ui/src/api/reliability/rel_maint_record.js

@@ -51,3 +51,12 @@ export function exportRel_maint_record(query) {
     params: query
   })
 }
+
+// 查询我的维修任务列表(根据当前登录用户员工ID)
+export function listMyRel_maint_record(query) {
+  return request({
+    url: '/reliability/rel_maint_record/myList',
+    method: 'get',
+    params: query
+  })
+}

+ 6 - 0
ui/src/router/index.js

@@ -822,6 +822,12 @@ export const constantRoutes = [
         component: (resolve) => require(['@/views/reliability/rel_device/detail'], resolve),
         name: 'RelDeviceDetail',
         meta: {title: '设备详情'}
+      },
+      {
+        path: 'rel_maint_memo',
+        component: (resolve) => require(['@/views/reliability/rel_maint_memo/index'], resolve),
+        name: 'RelMaintMemo',
+        meta: {title: '维修备忘录'}
       }
     ]
   },

+ 277 - 0
ui/src/views/approve/approveDetail/rel-maintPlan-detaill.vue

@@ -0,0 +1,277 @@
+<template>
+  <el-dialog
+    :close-on-click-modal="false"
+    :title="this.taskForm.taskId !== '' ? $t('处理') : $t('详情')"
+    :visible.sync="visible"
+    width="1200px"
+    append-to-body>
+
+    <div v-loading="loading">
+      <!-- 使用 MaintPlanDetailContent 组件显示基础信息和维修列表 -->
+      <maint-plan-detail-content
+        :plan-data="planData"
+        :device-info="deviceInfo"
+        :maint-records="maintRecords"
+        :records-loading="recordsLoading"
+        :staff-options="staffOptions" />
+
+      <!-- 审批意见 -->
+      <el-form v-if="this.taskForm.taskId !== ''" :model="taskForm" :rules="dataRule" ref="dataForm" label-width="120px" style="margin-top: 20px;">
+        <el-form-item :label="$t('审批意见')" prop="comment">
+          <el-input
+            v-model="taskForm.comment"
+            type="textarea"
+            :rows="3"
+            :placeholder="$t('请输入') + $t('审批意见')"
+            maxlength="200"
+            show-word-limit>
+          </el-input>
+        </el-form-item>
+      </el-form>
+
+      <!-- 流转详情 -->
+      <div class="form-section">
+        <div class="section-header">
+          <i class="el-icon-s-order"></i>
+          <span class="section-title">{{ $t('流转详情') }}</span>
+        </div>
+        <el-table :data="historyList" border v-loading="historyLoading" style="width: 100%;">
+          <el-table-column prop="taskName" header-align="center" align="center"
+                           :label="$t('流程进度')"></el-table-column>
+          <el-table-column prop="userName" header-align="center" align="center" :label="$t('姓名')"></el-table-column>
+          <el-table-column prop="taskCreateTime" header-align="center" align="center"
+                           :label="$t('开始时间')"></el-table-column>
+          <el-table-column prop="taskEndTime" header-align="center" align="center"
+                           :label="$t('结束时间')"></el-table-column>
+          <el-table-column prop="comment" header-align="center" align="center"
+                           :label="$t('审批意见')"></el-table-column>
+        </el-table>
+      </div>
+    </div>
+
+    <span slot="footer" class="dialog-footer">
+      <el-button v-if="this.taskForm.taskId === ''" @click="visible = false">返回</el-button>
+      <el-button v-if="this.taskForm.taskId !== ''" type="primary" @click="dataFormSubmit(1)" :disabled="submitDisabled">{{$t('通过')}}</el-button>
+      <el-button v-if="this.taskForm.taskId !== ''" type="danger" @click="dataFormSubmit(0)" :disabled="submitDisabled">{{$t('拒绝')}}</el-button>
+    </span>
+  </el-dialog>
+</template>
+
+<script>
+import { getRel_maint_plan, handleRelMaintPlanApprove } from "@/api/reliability/rel_maint_plan";
+import { getRel_device } from "@/api/reliability/rel_device";
+import { listRel_maint_record } from "@/api/reliability/rel_maint_record";
+import { listStaffmgrAll } from "@/api/plant/staffmgr";
+import { parseTime as formatTime } from "@/utils/ruoyi";
+import { getHistorylist } from "@/api/ehs/approvedanger";
+import MaintPlanDetailContent from "@/views/reliability/rel_maint_plan/MaintPlanDetailContent";
+
+export default {
+  name: "MaintPlanDeal",
+  components: {
+    MaintPlanDetailContent
+  },
+  data() {
+    return {
+      visible: false,
+      loading: false,
+      recordsLoading: false,
+      submitDisabled: false,
+      planId: null,
+      processId: null,
+      planData: {},
+      deviceInfo: null,
+      maintRecords: [],
+      staffOptions: [],
+      historyList: [],
+      historyLoading: false,
+      taskForm: {
+        comment: '',
+        taskId: '',
+        businessKey: '',
+        condition: ''
+      },
+      dataRule: {
+        comment: [
+          { max: 200, message: this.$t('审批意见') + this.$t('不能超过200个字符'), trigger: 'blur' }
+        ]
+      }
+    };
+  },
+  created() {
+    this.getStaffList();
+  },
+  methods: {
+    /** 查询人员列表 */
+    getStaffList() {
+      listStaffmgrAll().then(response => {
+        this.staffOptions = response.rows || response.data || [];
+      }).catch(error => {
+        console.error('加载人员数据失败:', error);
+      });
+    },
+    /** 根据员工号获取员工姓名 */
+    getStaffNameById(staffid) {
+      if (!staffid) return '';
+      const staff = this.staffOptions.find(s => s.staffid === staffid);
+      return staff ? staff.name : staffid;
+    },
+    init(planId, taskId, processId, taskName) {
+      this.planId = planId;
+      this.processId = processId;
+      this.taskForm.taskId = taskId || '';
+      this.taskForm.businessKey = planId ? planId.toString() : '';
+      this.visible = true;
+      this.submitDisabled = false;
+      this.taskForm.comment = '';
+      this.planData = {};
+      this.deviceInfo = null;
+      this.maintRecords = [];
+      this.historyList = [];
+
+      // 加载流转详情
+      if (processId) {
+        this.loadHistoryList();
+      }
+
+      this.loadPlanDetail();
+    },
+    /** 加载流转详情 */
+    loadHistoryList() {
+      if (!this.processId) {
+        return;
+      }
+
+      this.historyLoading = true;
+      getHistorylist({ processId: this.processId })
+        .then(response => {
+          this.historyList = response.rows || [];
+          this.historyLoading = false;
+        })
+        .catch(error => {
+          console.error('加载流转详情失败:', error);
+          this.historyLoading = false;
+        });
+    },
+    /** 加载计划详情 */
+    loadPlanDetail() {
+      if (!this.planId) {
+        return;
+      }
+
+      this.loading = true;
+      getRel_maint_plan(this.planId)
+        .then(response => {
+          this.planData = response.data || {};
+
+          // 如果有设备ID,加载设备信息
+          if (this.planData.devId) {
+            this.loadDeviceInfo(this.planData.devId);
+          }
+
+          // 加载维修记录
+          if (this.planData.planId) {
+            this.loadMaintRecords();
+          }
+
+          this.loading = false;
+        })
+        .catch(error => {
+          console.error('加载计划详情失败:', error);
+          this.$message.error('加载计划详情失败');
+          this.loading = false;
+        });
+    },
+    /** 加载设备信息 */
+    loadDeviceInfo(devId) {
+      getRel_device(devId)
+        .then(response => {
+          this.deviceInfo = response.data;
+        })
+        .catch(error => {
+          console.error('加载设备信息失败:', error);
+        });
+    },
+    /** 加载维修记录 */
+    loadMaintRecords() {
+      if (!this.planData.planId) {
+        return;
+      }
+
+      this.recordsLoading = true;
+      listRel_maint_record({
+        planId: this.planData.planId,
+        pageNum: 1,
+        pageSize: 1000
+      })
+        .then(response => {
+          this.maintRecords = response.rows || [];
+          this.recordsLoading = false;
+        })
+        .catch(error => {
+          console.error('加载维修记录失败:', error);
+          this.recordsLoading = false;
+        });
+    },
+    /** 时间格式化 */
+    parseTime(time, pattern) {
+      return formatTime(time, pattern);
+    },
+    /** 提交审批 */
+    dataFormSubmit(condition) {
+      // condition: 1-通过, 0-拒绝
+      this.taskForm.condition = condition.toString();
+
+      this.submitDisabled = true;
+
+      // 调用审批接口
+      this.handleApprove();
+    },
+    /** 调用审批接口 */
+    handleApprove() {
+      handleRelMaintPlanApprove(this.taskForm).then(response => {
+        this.submitDisabled = false;
+        this.msgSuccess(this.$t('处理成功'));
+        this.visible = false;
+        this.$emit('refreshDataList');
+      }).catch(error => {
+        this.submitDisabled = false;
+        this.msgError(this.$t('处理失败') + ':' + (error.message || '未知错误'));
+      });
+    }
+  }
+};
+</script>
+
+<style scoped lang="scss">
+.form-section {
+  margin-bottom: 20px;
+
+  .section-header {
+    display: flex;
+    align-items: center;
+    margin-bottom: 15px;
+    padding-bottom: 10px;
+    border-bottom: 1px solid #e4e7ed;
+
+    .el-icon-info,
+    .el-icon-s-platform,
+    .el-icon-s-grid,
+    .el-icon-s-order {
+      font-size: 18px;
+      color: #409EFF;
+      margin-right: 8px;
+    }
+
+    .section-title {
+      font-size: 16px;
+      font-weight: 600;
+      color: #303133;
+    }
+  }
+}
+
+.dialog-footer {
+  text-align: right;
+}
+</style>

+ 9 - 1
ui/src/views/approve/myapprove/index.vue

@@ -64,6 +64,7 @@
     <pssr-mgr-approve-detail v-if="pssrMgrApproveDetailVisible" ref="pssrMgrApproveDetail" @refreshDataList="getList"></pssr-mgr-approve-detail>
     <EoegLockChangeDetail v-if="eoegLockApproveDetailVisible" ref="eoegLockApproveDetail" @refreshDataList="getList"></EoegLockChangeDetail>
     <eoeg-sai-apply-detail v-if="eoegSaiApplyVisible" ref="saiApplyDetail" @refreshDataList="getList"></eoeg-sai-apply-detail>
+    <maint-plan-deal v-if="maintPlanDealVisible" ref="maintPlanDeal" @refreshDataList="getList"></maint-plan-deal>
   </div>
 </template>
 
@@ -90,6 +91,7 @@
   import PssrMgrApproveDetail from "@/views/approve/approveDetail/pssrMgrApprove-detail.vue";
   import EoegLockChangeDetail from "@/views/approve/approveDetail/eoegLockChange-detail.vue";
   import EoegSaiApplyDetail from "@/views/approve/approveDetail/eoeg-sai-apply-detail";
+  import MaintPlanDeal from "@/views/approve/approveDetail/rel-maintPlan-detaill";
 
   export default {
     name: "Myapprove",
@@ -104,7 +106,7 @@
       SaiApplyDetail,
       SafetychangeDetail,
       OfflinevalveDetail,
-      Treeselect,ProcessImg,AddOrUpdate,SpecModify,SpecTrainingPlan,SpecMaintenance,IntactDetail,KekaoDetail,InvoiceDetail},
+      Treeselect,ProcessImg,AddOrUpdate,SpecModify,SpecTrainingPlan,SpecMaintenance,IntactDetail,KekaoDetail,InvoiceDetail,MaintPlanDeal},
     data() {
       return {
         // 遮罩层
@@ -127,6 +129,7 @@
         pssrApproveDetailVisible: false,
         pssrMgrApproveDetailVisible: false,
         eoegLockApproveDetailVisible: false,
+        maintPlanDealVisible: false,
         // 选中数组
         ids: [],
         // 非单个禁用
@@ -303,6 +306,11 @@
           this.$nextTick(() => {
             this.$refs.eoegLockApproveDetail.init(row.approveObject.changeId, row.taskId, row.processId, row.taskName,false)
           })
+        } else if (row.processName == "可靠性设备维修计划申请") {
+          this.maintPlanDealVisible = true
+          this.$nextTick(() => {
+            this.$refs.maintPlanDeal.init(row.approveObject.planId, row.taskId, row.processId, row.taskName)
+          })
         } else {
           this.approveInfo = row;
           this.infoTaskName = row.taskName;

+ 10 - 1
ui/src/views/approve/pending/index.vue

@@ -139,6 +139,7 @@
     <pssr-mgr-approve-detail v-if="pssrMgrApproveDetailVisible" ref="pssrMgrApproveDetail" @refreshDataList="getList"></pssr-mgr-approve-detail>
     <EoegLockChangeDetail v-if="eoegLockApproveDetailVisible" ref="eoegLockApproveDetail" @refreshDataList="getList"></EoegLockChangeDetail>
     <eoeg-sai-apply-detail v-if="eoegSaiApplyVisible" ref="saiApplyDetail" @refreshDataList="getList"></eoeg-sai-apply-detail>
+    <maint-plan-deal v-if="maintPlanDealVisible" ref="maintPlanDeal" @refreshDataList="getList"></maint-plan-deal>
   </div>
 </template>
 
@@ -167,6 +168,7 @@ import PssrApproveDetail from "@/views/approve/approveDetail/pssrApprove-detail.
 import PssrMgrApproveDetail from "@/views/approve/approveDetail/pssrMgrApprove-detail.vue";
 import EoegLockChangeDetail from "@/views/approve/approveDetail/eoegLockChange-detail.vue";
 import EoegSaiApplyDetail from "@/views/approve/approveDetail/eoeg-sai-apply-detail";
+import MaintPlanDeal from "../approveDetail/rel-maintPlan-detaill";
 
 export default {
     name: "Pending",
@@ -190,7 +192,8 @@ export default {
       IntactResolve,
       SpecMaintenance,
       KekaoResolve,
-      InvoiceDetail
+      InvoiceDetail,
+      MaintPlanDeal
     },
     data() {
       return {
@@ -216,6 +219,7 @@ export default {
         pssrApproveDetailVisible: false,
         pssrMgrApproveDetailVisible: false,
         eoegLockApproveDetailVisible: false,
+        maintPlanDealVisible: false,
         // 选中数组
         ids: [],
         // 非单个禁用
@@ -481,6 +485,11 @@ export default {
           this.$nextTick(() => {
             this.$refs.eoegLockApproveDetail.init(row.approveObject.changeId, row.taskId, row.processId, row.taskName,true)
           })
+        } else if (row.processName == "可靠性设备维修计划申请") {
+          this.maintPlanDealVisible = true
+          this.$nextTick(() => {
+            this.$refs.maintPlanDeal.init(row.approveObject.planId, row.taskId, row.processId, row.taskName)
+          })
         } else {
           this.approveInfo = row;
           this.infoTaskName = row.taskName;

+ 9 - 1
ui/src/views/approve/taskdone/index.vue

@@ -68,6 +68,7 @@
     <pssr-mgr-approve-detail v-if="pssrMgrApproveDetailVisible" ref="pssrMgrApproveDetail" @refreshDataList="getList"></pssr-mgr-approve-detail>
     <EoegLockChangeDetail v-if="eoegLockApproveDetailVisible" ref="eoegLockApproveDetail" @refreshDataList="getList"></EoegLockChangeDetail>
     <eoeg-sai-apply-detail v-if="eoegSaiApplyVisible" ref="saiApplyDetail" @refreshDataList="getList"></eoeg-sai-apply-detail>
+    <maint-plan-deal v-if="maintPlanDealVisible" ref="maintPlanDeal" @refreshDataList="getList"></maint-plan-deal>
   </div>
 </template>
 
@@ -95,6 +96,7 @@
   import PssrMgrApproveDetail from "@/views/approve/approveDetail/pssrMgrApprove-detail.vue";
   import EoegLockChangeDetail from "@/views/approve/approveDetail/eoegLockChange-detail.vue";
   import EoegSaiApplyDetail from "@/views/approve/approveDetail/eoeg-sai-apply-detail";
+  import MaintPlanDeal from "@/views/approve/approveDetail/rel-maintPlan-detaill";
 
   export default {
     name: "Taskdone",
@@ -109,7 +111,7 @@
       SaiApplyDetail,
       SafetychangeDetail,
       OfflinevalveDetail,
-      Treeselect, AddOrUpdate,ProcessImg,SpecModify,SpecTrainingPlan,SpecMaintenance,IntactDetail,KekaoDetail,InvoiceDetail
+      Treeselect, AddOrUpdate,ProcessImg,SpecModify,SpecTrainingPlan,SpecMaintenance,IntactDetail,KekaoDetail,InvoiceDetail,MaintPlanDeal
     },
     data() {
       return {
@@ -133,6 +135,7 @@
         pssrApproveDetailVisible: false,
         pssrMgrApproveDetailVisible: false,
         eoegLockApproveDetailVisible: false,
+        maintPlanDealVisible: false,
         // 选中数组
         ids: [],
         // 非单个禁用
@@ -316,6 +319,11 @@
           this.$nextTick(() => {
             this.$refs.eoegLockApproveDetail.init(row.approveObject.changeId, row.taskId, row.processId, row.taskName,false)
           })
+        } else if (row.processName == "可靠性设备维修计划申请") {
+          this.maintPlanDealVisible = true
+          this.$nextTick(() => {
+            this.$refs.maintPlanDeal.init(row.approveObject.planId, row.taskId, row.processId, row.taskName)
+          })
         }  else {
           this.approveInfo = row;
           this.infoTaskName = row.taskName;

+ 2 - 1
ui/src/views/plant/EOEGorganization/branch.vue

@@ -176,7 +176,8 @@ export default {
       if (!post) return ''
       const postMap = {
         '片区工长': '工长',
-        '职员': '计划员/文员'
+        '职员': '计划员/文员',
+        '首席专家': '可靠性管理/工艺经理'
       }
       return postMap[post.trim()] || post
     }

+ 487 - 0
ui/src/views/reliability/rel_maint_memo/index.vue

@@ -0,0 +1,487 @@
+<template>
+  <div class="app-container">
+    <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
+      <el-form-item label="装置" prop="plant">
+        <el-input
+          v-model="queryParams.plant"
+          placeholder="请输入装置"
+          clearable
+          size="small"
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
+      <el-form-item label="设备名称" prop="devName">
+        <el-input
+          v-model="queryParams.devName"
+          placeholder="请输入设备名称"
+          clearable
+          size="small"
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
+      <el-form-item label="设备位号" prop="devTag">
+        <el-input
+          v-model="queryParams.devTag"
+          placeholder="请输入设备位号"
+          clearable
+          size="small"
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
+      <el-form-item label="部件名称" prop="compoName">
+        <el-input
+          v-model="queryParams.compoName"
+          placeholder="请输入部件名称"
+          clearable
+          size="small"
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
+
+      <el-form-item label="维修类型" prop="maintType">
+        <el-select v-model="queryParams.maintType" placeholder="请选择维修类型" clearable size="small">
+          <el-option label="检查" value="1" />
+          <el-option label="维修" value="2" />
+          <el-option label="更换" value="3" />
+        </el-select>
+      </el-form-item>
+      <el-form-item label="维修责任人" prop="responsible">
+        <el-input
+          v-model="queryParams.responsible"
+          placeholder="请输入维修责任人"
+          clearable
+          size="small"
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
+      <el-form-item>
+        <el-button type="cyan" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
+        <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
+      </el-form-item>
+    </el-form>
+
+    <el-row :gutter="10" class="mb8">
+      <el-col :span="1.5">
+        <el-button
+          type="danger"
+          icon="el-icon-delete"
+          size="mini"
+          :disabled="multiple"
+          @click="handleDelete"
+          v-hasPermi="['reliability:rel_maint_record:remove']"
+        >删除</el-button>
+      </el-col>
+
+	  <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
+    </el-row>
+
+    <el-table v-loading="loading" :data="rel_maint_memoList" @selection-change="handleSelectionChange" :height="clientHeight" border>
+      <el-table-column type="selection" width="55" align="center" />
+      <el-table-column label="装置" align="center" prop="plant" :show-overflow-tooltip="true"/>
+      <el-table-column label="设备名称" align="center" prop="devName" :show-overflow-tooltip="true"/>
+      <el-table-column label="设备位号" align="center" prop="devTag" :show-overflow-tooltip="true"/>
+      <el-table-column label="部件名称" align="center" prop="compoName" :show-overflow-tooltip="true"/>
+      <el-table-column label="维修类型" align="center" width="100">
+        <template slot-scope="scope">
+          <span v-if="scope.row.maintType === '1'">检查</span>
+          <span v-else-if="scope.row.maintType === '2'">维修</span>
+          <span v-else-if="scope.row.maintType === '3'">更换</span>
+          <span v-else>{{ scope.row.maintType || '-' }}</span>
+        </template>
+      </el-table-column>
+      <el-table-column label="维修责任人" align="center" width="120">
+        <template slot-scope="scope">
+          <span>{{ getStaffNameById(scope.row.responsible) || '-' }}</span>
+        </template>
+      </el-table-column>
+      <el-table-column label="维修内容" align="center" prop="maintContent" :show-overflow-tooltip="true"/>
+      <el-table-column label="备忘原因" align="center" prop="memoReason" :show-overflow-tooltip="true"/>
+      <el-table-column label="备忘时间" align="center" prop="memoTime" width="100">
+        <template slot-scope="scope">
+          <span>{{ parseTime(scope.row.memoTime, '{y}-{m}-{d}') }}</span>
+        </template>
+      </el-table-column>
+      <el-table-column label="操作" align="center" fixed="right" width="120" class-name="small-padding fixed-width">
+        <template slot-scope="scope">
+          <el-button
+            size="mini"
+            type="text"
+            icon="el-icon-delete"
+            @click="handleDelete(scope.row)"
+            v-hasPermi="['reliability:rel_maint_record:remove']"
+          >删除</el-button>
+        </template>
+      </el-table-column>
+    </el-table>
+
+    <pagination
+      v-show="total>0"
+      :total="total"
+      :page.sync="queryParams.pageNum"
+      :limit.sync="queryParams.pageSize"
+      @pagination="getList"
+    />
+
+    <!-- 添加或修改维修备忘录对话框 -->
+    <el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
+      <el-form ref="form" :model="form" :rules="rules" label-width="80px">
+        <el-form-item label="装置" prop="plant">
+          <el-input v-model="form.plant" placeholder="请输入装置" />
+        </el-form-item>
+        <el-form-item label="设备名称" prop="devName">
+          <el-input v-model="form.devName" placeholder="请输入设备名称" />
+        </el-form-item>
+        <el-form-item label="设备位号" prop="devTag">
+          <el-input v-model="form.devTag" placeholder="请输入设备位号" />
+        </el-form-item>
+        <el-form-item label="部件名称" prop="compoName">
+          <el-input v-model="form.compoName" placeholder="请输入部件名称" />
+        </el-form-item>
+        <el-form-item label="部件ID" prop="compoId">
+          <el-input v-model="form.compoId" placeholder="请输入部件ID" />
+        </el-form-item>
+        <el-form-item label="维修类型" prop="maintType">
+          <el-select v-model="form.maintType" placeholder="请选择维修类型" clearable style="width: 100%">
+            <el-option label="检查" value="1" />
+            <el-option label="维修" value="2" />
+            <el-option label="更换" value="3" />
+          </el-select>
+        </el-form-item>
+        <el-form-item label="维修责任人" prop="responsible">
+          <el-select
+            v-model="form.responsible"
+            placeholder="请选择维修责任人"
+            style="width: 100%"
+            clearable
+            filterable>
+            <el-option
+              v-for="staff in staffOptions"
+              :key="staff.staffid"
+              :label="staff.name"
+              :value="staff.staffid">
+            </el-option>
+          </el-select>
+        </el-form-item>
+        <el-form-item label="维修内容">
+          <editor v-model="form.maintContent" :min-height="192"/>
+        </el-form-item>
+        <el-form-item label="备忘原因" prop="memoReason">
+          <el-input v-model="form.memoReason" placeholder="请输入备忘原因" />
+        </el-form-item>
+        <el-form-item label="备忘时间" prop="memoTime">
+          <el-date-picker clearable size="small" style="width: 200px"
+            v-model="form.memoTime"
+            type="date"
+            value-format="yyyy-MM-dd"
+            placeholder="选择备忘时间">
+          </el-date-picker>
+        </el-form-item>
+      </el-form>
+      <div slot="footer" class="dialog-footer">
+        <el-button type="primary" @click="submitForm">确 定</el-button>
+        <el-button @click="cancel">取 消</el-button>
+      </div>
+    </el-dialog>
+      <!-- 用户导入对话框 -->
+      <el-dialog :title="upload.title" :visible.sync="upload.open" width="400px" append-to-body>
+          <el-upload
+                  ref="upload"
+                  :limit="1"
+                  accept=".xlsx, .xls"
+                  :headers="upload.headers"
+                  :action="upload.url + '?updateSupport=' + upload.updateSupport"
+                  :disabled="upload.isUploading"
+                  :on-progress="handleFileUploadProgress"
+                  :on-success="handleFileSuccess"
+                  :auto-upload="false"
+                  drag
+          >
+              <i class="el-icon-upload"></i>
+              <div class="el-upload__text">
+                  将文件拖到此处,或
+                  <em>点击上传</em>
+              </div>
+              <div class="el-upload__tip" slot="tip">
+                  <el-checkbox v-model="upload.updateSupport" />是否更新已经存在的用户数据
+                  <el-link type="info" style="font-size:12px" @click="importTemplate">下载模板</el-link>
+              </div>
+              <div class="el-upload__tip" style="color:red" slot="tip">提示:仅允许导入“xls”或“xlsx”格式文件!</div>
+          </el-upload>
+          <div slot="footer" class="dialog-footer">
+              <el-button type="primary" @click="submitFileForm">确 定</el-button>
+              <el-button @click="upload.open = false">取 消</el-button>
+          </div>
+      </el-dialog>
+  </div>
+</template>
+
+<script>
+import { listRel_maint_memo, getRel_maint_memo, delRel_maint_memo, addRel_maint_memo, updateRel_maint_memo, exportRel_maint_memo, importTemplate} from "@/api/reliability/rel_maint_memo";
+import { treeselect } from "@/api/system/dept";
+import { getToken } from "@/utils/auth";
+import { listStaffmgrAll } from "@/api/plant/staffmgr";
+import Treeselect from "@riophae/vue-treeselect";
+import "@riophae/vue-treeselect/dist/vue-treeselect.css";
+import Editor from '@/components/Editor';
+
+export default {
+  name: "Rel_maint_memo",
+  components: { Treeselect },
+  // components: { Editor },
+  data() {
+    return {
+      // 遮罩层
+      loading: true,
+      // 选中数组
+      ids: [],
+      // 非单个禁用
+      single: true,
+      // 非多个禁用
+      multiple: true,
+      // 显示搜索条件
+      showSearch: false,
+      // 总条数
+      total: 0,
+      // 维修备忘录表格数据
+      rel_maint_memoList: [],
+      // 弹出层标题
+      title: "",
+      // 部门树选项
+      deptOptions: undefined,
+      clientHeight:300,
+      // 是否显示弹出层
+      open: false,
+        // 用户导入参数
+        upload: {
+            // 是否显示弹出层(用户导入)
+            open: false,
+            // 弹出层标题(用户导入)
+            title: "",
+            // 是否禁用上传
+            isUploading: false,
+            // 是否更新已经存在的用户数据
+            updateSupport: 0,
+            // 设置上传的请求头部
+            headers: { Authorization: "Bearer " + getToken() },
+            // 上传的地址
+            url: process.env.VUE_APP_BASE_API + "/reliability/rel_maint_memo/importData"
+        },
+      // 查询参数
+      queryParams: {
+        pageNum: 1,
+        pageSize: 20,
+        plant: null,
+        devName: null,
+        devTag: null,
+        compoName: null,
+        compoId: null,
+        maintType: null,
+        responsible: null,
+        maintContent: null,
+        memoReason: null,
+        memoTime: null,
+        maintCost: null,
+        createrCode: null,
+        createdate: null,
+        updaterCode: null,
+        updatedate: null,
+        deptId: null,
+        remarks: null,
+        planId: null,
+        recordId: null
+      },
+      // 表单参数
+      form: {},
+      // 表单校验
+      rules: {
+      },
+      // 人员选项
+      staffOptions: []
+    };
+  },
+  watch: {
+        // 根据名称筛选部门树
+        deptName(val) {
+            this.$refs.tree.filter(val);
+        }
+   },
+  created() {
+      //设置表格高度对应屏幕高度
+      this.$nextTick(() => {
+          this.clientHeight = document.body.clientHeight -250
+      })
+    this.getList();
+    this.getTreeselect();
+    this.getStaffList();
+  },
+  methods: {
+    /** 查询维修备忘录列表 */
+    getList() {
+      this.loading = true;
+      listRel_maint_memo(this.queryParams).then(response => {
+        this.rel_maint_memoList = response.rows;
+        this.total = response.total;
+        this.loading = false;
+      });
+    },
+     /** 查询部门下拉树结构 */
+     getTreeselect() {
+          treeselect().then(response => {
+              this.deptOptions = response.data;
+          });
+     },
+    /** 查询人员列表 */
+    getStaffList() {
+      listStaffmgrAll().then(response => {
+        this.staffOptions = response.rows || response.data || [];
+      }).catch(error => {
+        console.error('加载人员数据失败:', error);
+      });
+    },
+    /** 根据员工ID获取姓名 */
+    getStaffNameById(staffid) {
+      if (!staffid) return '';
+      const staff = this.staffOptions.find(s => s.staffid === staffid);
+      return staff ? staff.name : '';
+    },
+    // 取消按钮
+    cancel() {
+      this.open = false;
+      this.reset();
+    },
+    // 表单重置
+    reset() {
+      this.form = {
+        memoId: null,
+        plant: null,
+        devName: null,
+        devTag: null,
+        compoName: null,
+        compoId: null,
+        maintType: null,
+        responsible: null,
+        maintContent: null,
+        memoReason: null,
+        memoTime: null,
+        maintCost: null,
+        delFlag: null,
+        createrCode: null,
+        createdate: null,
+        updaterCode: null,
+        updatedate: null,
+        deptId: null,
+        remarks: null,
+        planId: null,
+        recordId: null
+      };
+      this.resetForm("form");
+    },
+    /** 搜索按钮操作 */
+    handleQuery() {
+      this.queryParams.pageNum = 1;
+      this.getList();
+    },
+    /** 重置按钮操作 */
+    resetQuery() {
+      this.resetForm("queryForm");
+      this.handleQuery();
+    },
+    // 多选框选中数据
+    handleSelectionChange(selection) {
+      this.ids = selection.map(item => item.memoId)
+      this.single = selection.length!==1
+      this.multiple = !selection.length
+    },
+    /** 新增按钮操作 */
+    handleAdd() {
+      this.reset();
+      this.open = true;
+      this.title = "添加维修备忘录";
+    },
+    /** 修改按钮操作 */
+    handleUpdate(row) {
+      this.reset();
+      const memoId = row.memoId || this.ids
+      getRel_maint_memo(memoId).then(response => {
+        this.form = response.data;
+        this.open = true;
+        this.title = "修改维修备忘录";
+      });
+    },
+    /** 提交按钮 */
+    submitForm() {
+      this.$refs["form"].validate(valid => {
+        if (valid) {
+          if (this.form.memoId != null) {
+            updateRel_maint_memo(this.form).then(response => {
+              this.msgSuccess("修改成功");
+              this.open = false;
+              this.getList();
+            });
+          } else {
+            addRel_maint_memo(this.form).then(response => {
+              this.msgSuccess("新增成功");
+              this.open = false;
+              this.getList();
+            });
+          }
+        }
+      });
+    },
+    /** 删除按钮操作 */
+    handleDelete(row) {
+      const memoIds = row.memoId || this.ids;
+      this.$confirm('是否确认删除?', "警告", {
+          confirmButtonText: "确定",
+          cancelButtonText: "取消",
+          type: "warning"
+        }).then(function() {
+          return delRel_maint_memo(memoIds);
+        }).then(() => {
+          this.getList();
+          this.msgSuccess("删除成功");
+        })
+    },
+    /** 导出按钮操作 */
+    handleExport() {
+      const queryParams = this.queryParams;
+      this.$confirm('是否确认导出所有维修备忘录数据项?', "警告", {
+          confirmButtonText: "确定",
+          cancelButtonText: "取消",
+          type: "warning"
+        }).then(function() {
+          return exportRel_maint_memo(queryParams);
+        }).then(response => {
+          this.download(response.msg);
+        })
+    },
+      /** 导入按钮操作 */
+      handleImport() {
+          this.upload.title = "用户导入";
+          this.upload.open = true;
+      },
+      /** 下载模板操作 */
+      importTemplate() {
+          importTemplate().then(response => {
+              this.download(response.msg);
+          });
+      },
+      // 文件上传中处理
+      handleFileUploadProgress(event, file, fileList) {
+          this.upload.isUploading = true;
+      },
+      // 文件上传成功处理
+      handleFileSuccess(response, file, fileList) {
+          this.upload.open = false;
+          this.upload.isUploading = false;
+          this.$refs.upload.clearFiles();
+          this.$alert(response.msg, "导入结果", { dangerouslyUseHTMLString: true });
+          this.getList();
+      },
+      // 提交上传文件
+      submitFileForm() {
+          this.$refs.upload.submit();
+      }
+  }
+};
+</script>

+ 192 - 0
ui/src/views/reliability/rel_maint_plan/MaintPlanDetail.vue

@@ -0,0 +1,192 @@
+<template>
+  <el-dialog
+    :title="title"
+    :visible.sync="dialogVisible"
+    width="1200px"
+    append-to-body
+    @close="handleClose">
+
+    <div v-loading="loading">
+      <!-- 使用 MaintPlanDetailContent 组件显示基础信息和维修列表 -->
+      <maint-plan-detail-content
+        :plan-data="planData"
+        :device-info="deviceInfo"
+        :maint-records="maintRecords"
+        :records-loading="recordsLoading"
+        :staff-options="staffOptions" />
+    </div>
+
+    <div slot="footer" class="dialog-footer">
+      <el-button @click="handleClose">关 闭</el-button>
+    </div>
+  </el-dialog>
+</template>
+
+<script>
+import { getRel_maint_plan } from "@/api/reliability/rel_maint_plan";
+import { getRel_device } from "@/api/reliability/rel_device";
+import { listRel_maint_record } from "@/api/reliability/rel_maint_record";
+import { listStaffmgrAll } from "@/api/plant/staffmgr";
+import MaintPlanDetailContent from "./MaintPlanDetailContent";
+
+export default {
+  name: "MaintPlanDetail",
+  components: {
+    MaintPlanDetailContent
+  },
+  props: {
+    visible: {
+      type: Boolean,
+      default: false
+    },
+    planId: {
+      type: [Number, String],
+      default: null
+    }
+  },
+  data() {
+    return {
+      dialogVisible: this.visible,
+      loading: false,
+      recordsLoading: false,
+      title: "维修计划详情",
+      planData: {},
+      deviceInfo: null,
+      maintRecords: [],
+      staffOptions: [] // 员工列表
+    };
+  },
+  watch: {
+    visible(newVal) {
+      this.dialogVisible = newVal;
+      if (newVal && this.planId) {
+        this.loadPlanDetail();
+      }
+    },
+    dialogVisible(newVal) {
+      if (!newVal) {
+        this.$emit('update:visible', false);
+      }
+    },
+    planId(newVal) {
+      if (newVal && this.visible) {
+        this.loadPlanDetail();
+      }
+    }
+  },
+  created() {
+    this.getStaffList();
+  },
+  methods: {
+    /** 查询人员列表 */
+    getStaffList() {
+      listStaffmgrAll().then(response => {
+        this.staffOptions = response.rows || response.data || [];
+      }).catch(error => {
+        console.error('加载人员数据失败:', error);
+      });
+    },
+    /** 加载计划详情 */
+    loadPlanDetail() {
+      if (!this.planId) {
+        return;
+      }
+
+      this.loading = true;
+      getRel_maint_plan(this.planId)
+        .then(response => {
+          this.planData = response.data || {};
+
+          // 如果有设备ID,加载设备信息
+          if (this.planData.devId) {
+            this.loadDeviceInfo(this.planData.devId);
+          }
+
+          // 加载维修记录
+          if (this.planData.planId) {
+            this.loadMaintRecords();
+          }
+
+          this.loading = false;
+        })
+        .catch(error => {
+          console.error('加载计划详情失败:', error);
+          this.$message.error('加载计划详情失败');
+          this.loading = false;
+        });
+    },
+    /** 加载设备信息 */
+    loadDeviceInfo(devId) {
+      getRel_device(devId)
+        .then(response => {
+          this.deviceInfo = response.data;
+        })
+        .catch(error => {
+          console.error('加载设备信息失败:', error);
+        });
+    },
+    /** 加载维修记录 */
+    loadMaintRecords() {
+      if (!this.planData.planId) {
+        return;
+      }
+
+      this.recordsLoading = true;
+      // 根据计划ID查询该计划下的维修记录
+      listRel_maint_record({
+        planId: this.planData.planId,
+        pageNum: 1,
+        pageSize: 1000
+      })
+        .then(response => {
+          this.maintRecords = response.rows || [];
+          this.recordsLoading = false;
+        })
+        .catch(error => {
+          console.error('加载维修记录失败:', error);
+          this.recordsLoading = false;
+        });
+    },
+    /** 关闭弹窗 */
+    handleClose() {
+      this.planData = {};
+      this.deviceInfo = null;
+      this.maintRecords = [];
+      this.$emit('update:visible', false);
+      this.$emit('close');
+    }
+  }
+};
+</script>
+
+<style scoped lang="scss">
+.form-section {
+  margin-bottom: 20px;
+
+  .section-header {
+    display: flex;
+    align-items: center;
+    margin-bottom: 15px;
+    padding-bottom: 10px;
+    border-bottom: 1px solid #e4e7ed;
+
+    .el-icon-info,
+    .el-icon-s-platform,
+    .el-icon-s-grid {
+      font-size: 18px;
+      color: #409EFF;
+      margin-right: 8px;
+    }
+
+    .section-title {
+      font-size: 16px;
+      font-weight: 600;
+      color: #303133;
+    }
+  }
+}
+
+.dialog-footer {
+  text-align: right;
+}
+</style>

+ 195 - 0
ui/src/views/reliability/rel_maint_plan/MaintPlanDetailContent.vue

@@ -0,0 +1,195 @@
+<template>
+  <div>
+    <!-- 基础信息区域 -->
+    <div class="form-section">
+      <div class="section-header">
+        <i class="el-icon-info"></i>
+        <span class="section-title">基础信息</span>
+      </div>
+      <el-descriptions :column="2" border size="small">
+        <el-descriptions-item label="装置">{{ planData.plant || '-' }}</el-descriptions-item>
+        <el-descriptions-item label="设备名称">{{ planData.devName || '-' }}</el-descriptions-item>
+        <el-descriptions-item label="设备位号">{{ planData.devTag || '-' }}</el-descriptions-item>
+        <el-descriptions-item label="计划维修时间">
+          <span v-if="planData.planTime">{{ parseTime(planData.planTime, '{y}-{m}-{d}') }}</span>
+          <span v-else>-</span>
+        </el-descriptions-item>
+        <el-descriptions-item label="责任人">{{ getStaffNameById(planData.responsible) || '-' }}</el-descriptions-item>
+        <el-descriptions-item label="审批人">{{ getStaffNameById(planData.approver) || '-' }}</el-descriptions-item>
+        <el-descriptions-item label="计划审批状态">
+          <el-tag v-if="planData.approvalStatus === '0'" type="warning" size="mini">待审批</el-tag>
+          <el-tag v-else-if="planData.approvalStatus === '1'" type="success" size="mini">已通过</el-tag>
+          <el-tag v-else-if="planData.approvalStatus === '-1'" type="danger" size="mini">未通过</el-tag>
+          <span v-else>{{ planData.approvalStatus || '-' }}</span>
+        </el-descriptions-item>
+        <el-descriptions-item label="计划完成状态">
+          <el-tag v-if="planData.completionStatus === '0'" type="info" size="mini">未完成</el-tag>
+          <el-tag v-else-if="planData.completionStatus === '1'" type="success" size="mini">已完成</el-tag>
+          <span v-else>{{ planData.completionStatus || '-' }}</span>
+        </el-descriptions-item>
+        <el-descriptions-item label="创建人">{{ planData.createrCode || '-' }}</el-descriptions-item>
+        <el-descriptions-item label="创建时间">
+          <span v-if="planData.createdate">{{ parseTime(planData.createdate, '{y}-{m}-{d} {h}:{i}:{s}') }}</span>
+          <span v-else>-</span>
+        </el-descriptions-item>
+        <el-descriptions-item label="备注" :span="2">{{ planData.remarks || '-' }}</el-descriptions-item>
+      </el-descriptions>
+    </div>
+
+    <!-- 设备信息展示 -->
+    <div class="form-section" v-if="deviceInfo">
+      <div class="section-header">
+        <i class="el-icon-s-platform"></i>
+        <span class="section-title">设备信息</span>
+      </div>
+      <el-descriptions :column="3" border size="small">
+        <el-descriptions-item label="装置">{{ deviceInfo.plant || '-' }}</el-descriptions-item>
+        <el-descriptions-item label="设备位号">{{ deviceInfo.devTag || '-' }}</el-descriptions-item>
+        <el-descriptions-item label="设备名称">{{ deviceInfo.devName || '-' }}</el-descriptions-item>
+        <el-descriptions-item label="位置">{{ deviceInfo.devLoc || '-' }}</el-descriptions-item>
+        <el-descriptions-item label="设备类型">{{ deviceInfo.devType || '-' }}</el-descriptions-item>
+        <el-descriptions-item label="区域负责人">{{ deviceInfo.areaResponsible || '-' }}</el-descriptions-item>
+      </el-descriptions>
+    </div>
+
+    <!-- 维修记录列表 -->
+    <div class="form-section">
+      <div class="section-header">
+        <i class="el-icon-s-grid"></i>
+        <span class="section-title">维修列表</span>
+      </div>
+      <el-table
+        :data="maintRecords"
+        border
+        size="small"
+        style="margin-top: 10px"
+        v-loading="recordsLoading">
+        <el-table-column type="index" label="序号" width="60" align="center" />
+        <el-table-column label="部件名称" prop="compoName" width="150" :show-overflow-tooltip="true" />
+        <el-table-column label="维修类型" width="100" align="center">
+          <template slot-scope="scope">
+            <span v-if="scope.row.maintType === '1'">检查</span>
+            <span v-else-if="scope.row.maintType === '2'">维修</span>
+            <span v-else-if="scope.row.maintType === '3'">更换</span>
+            <span v-else>{{ scope.row.maintType || '-' }}</span>
+          </template>
+        </el-table-column>
+        <el-table-column label="负责人" width="100" align="center">
+          <template slot-scope="scope">
+            <span>{{ getStaffNameById(scope.row.responsible) || '-' }}</span>
+          </template>
+        </el-table-column>
+        <el-table-column label="维修状态" width="120" align="center">
+          <template slot-scope="scope">
+            <span>{{ getRecordStatusText(scope.row.recordStatus) }}</span>
+          </template>
+        </el-table-column>
+        <el-table-column label="检查内容" prop="inspectContent" :show-overflow-tooltip="true" />
+        <el-table-column label="维修内容" prop="maintContent" :show-overflow-tooltip="true" />
+        <el-table-column label="维修结果" prop="maintResult" width="100" :show-overflow-tooltip="true" />
+        <el-table-column label="维修时间" width="120" align="center">
+          <template slot-scope="scope">
+            <span v-if="scope.row.maintTime">{{ parseTime(scope.row.maintTime, '{y}-{m}-{d}') }}</span>
+            <span v-else>-</span>
+          </template>
+        </el-table-column>
+        <el-table-column label="维修费用" prop="maintCost" width="100" align="right">
+          <template slot-scope="scope">
+            <span v-if="scope.row.maintCost">{{ scope.row.maintCost }}</span>
+            <span v-else>-</span>
+          </template>
+        </el-table-column>
+        <el-table-column label="维修时长" prop="maintDuration" width="100" align="center">
+          <template slot-scope="scope">
+            <span v-if="scope.row.maintDuration">{{ scope.row.maintDuration }}</span>
+            <span v-else>-</span>
+          </template>
+        </el-table-column>
+        <el-table-column label="工艺损失" prop="processLoss" :show-overflow-tooltip="true" />
+        <el-table-column label="备注" prop="remarks" :show-overflow-tooltip="true" />
+      </el-table>
+      <div v-if="maintRecords.length === 0 && !recordsLoading" style="text-align: center; padding: 20px; color: #909399;">
+        暂无维修记录
+      </div>
+    </div>
+  </div>
+</template>
+
+<script>
+import { parseTime as formatTime } from "@/utils/ruoyi";
+
+export default {
+  name: "MaintPlanDetailContent",
+  props: {
+    planData: {
+      type: Object,
+      default: () => ({})
+    },
+    deviceInfo: {
+      type: Object,
+      default: null
+    },
+    maintRecords: {
+      type: Array,
+      default: () => []
+    },
+    recordsLoading: {
+      type: Boolean,
+      default: false
+    },
+    staffOptions: {
+      type: Array,
+      default: () => []
+    }
+  },
+  methods: {
+    /** 根据员工号获取员工姓名 */
+    getStaffNameById(staffid) {
+      if (!staffid) return '';
+      const staff = this.staffOptions.find(s => s.staffid === staffid);
+      return staff ? staff.name : staffid;
+    },
+    /** 时间格式化 */
+    parseTime(time, pattern) {
+      return formatTime(time, pattern);
+    },
+    /** 获取维修状态文本 */
+    getRecordStatusText(status) {
+      if (status === -1 || status === '-1') return '删除申请中';
+      if (status === 0 || status === '0') return '新增申请中';
+      if (status === 1 || status === '1') return '待完成';
+      if (status === 2 || status === '2') return '已完成';
+      return status != null ? status : '-';
+    }
+  }
+};
+</script>
+
+<style scoped lang="scss">
+.form-section {
+  margin-bottom: 20px;
+
+  .section-header {
+    display: flex;
+    align-items: center;
+    margin-bottom: 15px;
+    padding-bottom: 10px;
+    border-bottom: 1px solid #e4e7ed;
+
+    .el-icon-info,
+    .el-icon-s-platform,
+    .el-icon-s-grid {
+      font-size: 18px;
+      color: #409EFF;
+      margin-right: 8px;
+    }
+
+    .section-title {
+      font-size: 16px;
+      font-weight: 600;
+      color: #303133;
+    }
+  }
+}
+</style>
+

+ 693 - 0
ui/src/views/reliability/rel_maint_plan/MaintPlanForm.vue

@@ -0,0 +1,693 @@
+<template>
+  <el-dialog :title="title" :visible.sync="dialogVisible" width="1200px" append-to-body @close="handleClose">
+    <el-form ref="form" :model="formData" :rules="rules" label-width="120px">
+      <!-- 基础信息区域 -->
+      <div class="form-section">
+        <div class="section-header">
+          <i class="el-icon-info"></i>
+          <span class="section-title">基础信息</span>
+        </div>
+        <el-row :gutter="20">
+          <el-col :span="12">
+            <el-form-item label="选择设备" prop="devId">
+              <el-select
+                v-model="formData.devId"
+                filterable
+                remote
+                :remote-method="searchDevice"
+                :loading="deviceLoading"
+                placeholder="请输入设备位号或名称搜索"
+                style="width: 100%"
+                @change="handleDeviceChange"
+                @focus="handleDeviceFocus"
+                :disabled="!!formData.planId"
+                clearable>
+                <el-option
+                  v-for="device in deviceOptions"
+                  :key="device.devId"
+                  :label="`${device.devTag} - ${device.devName}`"
+                  :value="device.devId">
+                  <span style="float: left">{{ device.devTag }}</span>
+                  <span style="float: right; color: #8492a6; font-size: 13px">{{ device.devName }}</span>
+                </el-option>
+                <div v-if="deviceOptions.length === 0 && !deviceLoading" style="padding: 10px; text-align: center; color: #909399;">
+                  请输入设备位号或名称进行搜索
+                </div>
+              </el-select>
+            </el-form-item>
+          </el-col>
+          <el-col :span="12">
+            <el-form-item label="计划维修时间" prop="planTime">
+              <el-date-picker
+                v-model="formData.planTime"
+                type="date"
+                value-format="yyyy-MM-dd"
+                placeholder="选择计划维修时间"
+                style="width: 100%">
+              </el-date-picker>
+            </el-form-item>
+          </el-col>
+        </el-row>
+        <el-row :gutter="20">
+          <el-col :span="12">
+            <el-form-item label="责任人" prop="responsible">
+              <el-select
+                v-model="formData.responsible"
+                placeholder="请选择责任人"
+                style="width: 100%"
+                clearable
+                filterable>
+                <el-option
+                  v-for="staff in staffOptions"
+                  :key="staff.staffid"
+                  :label="staff.name"
+                  :value="staff.name">
+                </el-option>
+                <div v-if="staffOptions.length === 0" style="padding: 10px; text-align: center; color: #909399;">
+                  暂无人员数据
+                </div>
+              </el-select>
+            </el-form-item>
+          </el-col>
+          <el-col :span="12">
+            <el-form-item label="审批人" prop="approver">
+              <el-select
+                v-model="formData.approver"
+                placeholder="请选择审批人"
+                style="width: 100%"
+                clearable
+                filterable>
+                <el-option
+                  v-for="staff in staffOptions"
+                  :key="staff.staffid"
+                  :label="staff.name"
+                  :value="staff.name">
+                </el-option>
+                <div v-if="staffOptions.length === 0" style="padding: 10px; text-align: center; color: #909399;">
+                  暂无人员数据
+                </div>
+              </el-select>
+            </el-form-item>
+          </el-col>
+        </el-row>
+        <el-row :gutter="20">
+          <el-col :span="24">
+            <el-form-item label="备注" prop="remarks">
+              <el-input v-model="formData.remarks" type="textarea" :rows="2" placeholder="请输入备注" />
+            </el-form-item>
+          </el-col>
+        </el-row>
+      </div>
+
+      <!-- 设备信息展示 -->
+      <div class="form-section" v-if="selectedDevice">
+        <div class="section-header">
+          <i class="el-icon-s-platform"></i>
+          <span class="section-title">设备信息</span>
+        </div>
+        <el-descriptions :column="3" border size="small">
+          <el-descriptions-item label="装置">{{ selectedDevice.plant }}</el-descriptions-item>
+          <el-descriptions-item label="设备位号">{{ selectedDevice.devTag }}</el-descriptions-item>
+          <el-descriptions-item label="设备名称">{{ selectedDevice.devName }}</el-descriptions-item>
+          <el-descriptions-item label="位置">{{ selectedDevice.devLoc }}</el-descriptions-item>
+          <el-descriptions-item label="设备类型">{{ selectedDevice.devType }}</el-descriptions-item>
+          <el-descriptions-item label="区域负责人">{{ selectedDevice.areaResponsible }}</el-descriptions-item>
+        </el-descriptions>
+      </div>
+
+      <!-- 部件列表及维修记录选择 -->
+      <div class="form-section" v-if="compoList.length > 0">
+        <div class="section-header">
+          <i class="el-icon-s-grid"></i>
+          <span class="section-title">部件维修选择</span>
+        </div>
+        <el-table
+          :data="compoList"
+          border
+          size="small"
+          :height="500"
+          style="margin-top: 10px">
+          <el-table-column type="index" label="序号" width="60" align="center" />
+          <el-table-column label="部件名称" prop="compoName" width="150" :show-overflow-tooltip="true" />
+          <el-table-column label="检查频率/日期" width="120" align="center">
+            <template slot-scope="scope">
+              <div style="line-height: 1.2;">
+                <div style="font-weight: bold; margin-bottom: 2px;">{{ translateFrequency(scope.row.checkFreq) || '-' }}</div>
+                <div style="font-size: 12px; color: #666;">{{ scope.row.lastCheckDate ? parseTime(scope.row.lastCheckDate, '{y}-{m}-{d}') : '-' }}</div>
+              </div>
+            </template>
+          </el-table-column>
+          <el-table-column label="维修频率/日期" width="120" align="center">
+            <template slot-scope="scope">
+              <div style="line-height: 1.2;">
+                <div style="font-weight: bold; margin-bottom: 2px;">{{ translateFrequency(scope.row.maintFreq) || '-' }}</div>
+                <div style="font-size: 12px; color: #666;">{{ scope.row.lastMaintDate ? parseTime(scope.row.lastMaintDate, '{y}-{m}-{d}') : '-' }}</div>
+              </div>
+            </template>
+          </el-table-column>
+          <el-table-column label="更换频率/日期" width="120" align="center">
+            <template slot-scope="scope">
+              <div style="line-height: 1.2;">
+                <div style="font-weight: bold; margin-bottom: 2px;">{{ translateFrequency(scope.row.replaceFreq) || '-' }}</div>
+                <div style="font-size: 12px; color: #666;">{{ scope.row.lastReplaceDate ? parseTime(scope.row.lastReplaceDate, '{y}-{m}-{d}') : '-' }}</div>
+              </div>
+            </template>
+          </el-table-column>
+          <el-table-column label="本次维修" width="100" align="center">
+            <template slot-scope="scope">
+              <el-checkbox v-model="scope.row.needMaint" @change="handleMaintCheckChange(scope.row)">需要维修</el-checkbox>
+            </template>
+          </el-table-column>
+          <el-table-column label="维修形式" width="200" align="center">
+            <template slot-scope="scope">
+              <el-radio-group
+                v-model="scope.row.maintType"
+                :disabled="!scope.row.needMaint"
+                @change="handleMaintTypeChange(scope.row)"
+                style="display: flex; flex-direction: row; gap: 0px;">
+                <el-radio label="1" style="margin-right: 0; margin-left: 0;">检查</el-radio>
+                <el-radio label="2" style="margin-right: 0; margin-left: 0;">维修</el-radio>
+                <el-radio label="3" style="margin-right: 0; margin-left: 0;">更换</el-radio>
+              </el-radio-group>
+            </template>
+          </el-table-column>
+          <el-table-column label="负责人" width="150" align="center">
+            <template slot-scope="scope">
+              <el-select
+                v-model="scope.row.maintResponsible"
+                :placeholder="getResponsiblePlaceholder(scope.row.maintType)"
+                style="width: 100%"
+                :disabled="!scope.row.needMaint"
+                clearable
+                filterable>
+                <el-option
+                  v-for="staff in staffOptions"
+                  :key="staff.staffid"
+                  :label="staff.name"
+                  :value="staff.name">
+                </el-option>
+              </el-select>
+            </template>
+          </el-table-column>
+        </el-table>
+      </div>
+    </el-form>
+    <div slot="footer" class="dialog-footer">
+      <el-button type="primary" @click="handleSubmit" v-if="!formData.planId">提交申请</el-button>
+      <el-button type="primary" @click="handleSubmit" v-else>确 定</el-button>
+      <el-button @click="handleCancel">取 消</el-button>
+    </div>
+  </el-dialog>
+</template>
+
+<script>
+import { listRel_device, getRel_device } from "@/api/reliability/rel_device";
+import { listRel_compo } from "@/api/reliability/rel_compo";
+import { listStaffmgrAll } from "@/api/plant/staffmgr";
+import { parseTime as formatTime } from "@/utils/ruoyi";
+
+export default {
+  name: "MaintPlanForm",
+  props: {
+    visible: {
+      type: Boolean,
+      default: false
+    },
+    title: {
+      type: String,
+      default: "设备维修计划"
+    },
+    form: {
+      type: Object,
+      default: () => ({})
+    }
+  },
+  data() {
+    return {
+      dialogVisible: this.visible,
+      formData: {},
+      rules: {
+        devId: [
+          { required: true, message: "请选择设备", trigger: "change" }
+        ],
+        planTime: [
+          { required: true, message: "请选择计划维修时间", trigger: "change" }
+        ],
+        approver: [
+          { required: true, message: "请选择审批人", trigger: "change" }
+        ]
+      },
+      // 设备相关
+      deviceOptions: [],
+      deviceLoading: false,
+      selectedDevice: null,
+      // 部件相关
+      compoList: [],
+      // 所有人员选项
+      staffOptions: []
+    };
+  },
+  watch: {
+    visible(newVal) {
+      this.dialogVisible = newVal;
+      if (newVal) {
+        this.initForm();
+      }
+    },
+    dialogVisible(newVal) {
+      if (!newVal) {
+        this.$emit('update:visible', false);
+      }
+    },
+    form: {
+      handler(newVal) {
+        if (newVal && Object.keys(newVal).length > 0) {
+          this.formData = { ...newVal };
+
+          if (this.formData.relDevice) {
+            this.selectedDevice = this.formData.relDevice;
+            if (this.formData.relDevice.devId && !this.formData.devId) {
+              this.formData.devId = this.formData.relDevice.devId;
+            }
+            if (this.formData.planId && this.formData.relDevice.devId) {
+              this.deviceOptions = [this.formData.relDevice];
+            }
+
+            // 自动填充设备负责人(如果还没有设置责任人)
+            if (this.formData.relDevice.areaResponsible && this.staffOptions.length > 0 && !this.formData.responsible) {
+              const staff = this.staffOptions.find(s => s.staffid === this.formData.relDevice.areaResponsible);
+              if (staff) {
+                this.formData.responsible = staff.name;
+              }
+            }
+
+            if (this.formData.compoList && this.formData.compoList.length > 0) {
+              this.initCompoListFromData(this.formData.compoList);
+            } else if (this.selectedDevice.devTag) {
+              this.loadCompoList(this.selectedDevice.devTag);
+            }
+          } else if (this.formData.devId) {
+            this.loadDeviceInfo(this.formData.devId);
+          }
+
+          const convertIdsToNames = () => {
+            if (this.formData.approver && this.staffOptions.length > 0) {
+              const staff = this.staffOptions.find(s => s.staffid === this.formData.approver);
+              if (staff) {
+                this.formData.approver = staff.name;
+              }
+            }
+
+            if (this.formData.responsible && typeof this.formData.responsible !== 'string' && this.staffOptions.length > 0) {
+              const staff = this.staffOptions.find(s => s.staffid === this.formData.responsible);
+              if (staff) {
+                this.formData.responsible = staff.name;
+              }
+            }
+          };
+
+          if (this.staffOptions.length > 0) {
+            this.$nextTick(convertIdsToNames);
+          } else {
+            const checkStaffOptions = () => {
+              if (this.staffOptions.length > 0) {
+                this.$nextTick(convertIdsToNames);
+              } else {
+                setTimeout(checkStaffOptions, 100);
+              }
+            };
+            checkStaffOptions();
+          }
+        } else if (!newVal || Object.keys(newVal).length === 0) {
+          this.resetForm();
+        }
+      },
+      deep: true,
+      immediate: true
+    }
+  },
+  created() {
+    this.getStaffList();
+  },
+  methods: {
+    /** 查询人员列表 */
+    getStaffList() {
+      listStaffmgrAll().then(response => {
+        this.staffOptions = response.rows || response.data || [];
+      }).catch(error => {
+        console.error('加载人员数据失败:', error);
+      });
+    },
+    /** 初始化表单 */
+    initForm() {
+      if (!this.formData.planId && (!this.formData.devId && !this.formData.planTime)) {
+        this.resetForm();
+      }
+    },
+    /** 表单重置 */
+    resetForm() {
+      this.formData = {
+        planId: null,
+        devId: null,
+        plant: null,
+        devName: null,
+        devTag: null,
+        planTime: null,
+        approvalStatus: "0",
+        responsible: null,
+        completionStatus: "0",
+        processId: null,
+        approver: null,
+        delFlag: null,
+        createrCode: null,
+        createdate: null,
+        updaterCode: null,
+        updatedate: null,
+        deptId: null,
+        remarks: null,
+        maintComponents: []
+      };
+      this.selectedDevice = null;
+      this.compoList = [];
+      this.deviceOptions = [];
+      this.$nextTick(() => {
+        if (this.$refs.form) {
+          this.$refs.form.clearValidate();
+        }
+      });
+    },
+    /** 设备下拉框获得焦点 */
+    handleDeviceFocus() {
+      // 预留方法,可在此处加载默认设备列表
+    },
+    /** 设备选择改变 */
+    handleDeviceChange(devId) {
+      if (!devId) {
+        this.selectedDevice = null;
+        this.compoList = [];
+        return;
+      }
+
+      // 获取设备详情
+      getRel_device(devId).then(response => {
+        this.selectedDevice = response.data;
+        this.formData.plant = response.data.plant;
+        this.formData.devName = response.data.devName;
+        this.formData.devTag = response.data.devTag;
+
+        // 自动填充设备负责人(areaResponsible)
+        if (response.data.areaResponsible && this.staffOptions.length > 0) {
+          const staff = this.staffOptions.find(s => s.staffid === response.data.areaResponsible);
+          if (staff) {
+            this.formData.responsible = staff.name;
+          }
+        }
+
+        // 加载该设备的部件列表(使用devTag)
+        if (this.selectedDevice.devTag) {
+          this.loadCompoList(this.selectedDevice.devTag);
+        }
+      });
+    },
+    /** 搜索设备 */
+    searchDevice(query) {
+      if (query !== '') {
+        this.deviceLoading = true;
+        listRel_device({
+          devTag: query,
+          devName: query,
+          pageNum: 1,
+          pageSize: 50
+        }).then(response => {
+          this.deviceOptions = response.rows || [];
+          this.deviceLoading = false;
+        }).catch(() => {
+          this.deviceLoading = false;
+          this.deviceOptions = [];
+        });
+      } else {
+        this.deviceOptions = [];
+      }
+    },
+    /** 加载设备信息 */
+    loadDeviceInfo(devId) {
+      getRel_device(devId).then(response => {
+        this.selectedDevice = response.data;
+
+        // 修改模式下,将当前设备添加到deviceOptions中,以便下拉框显示
+        if (this.formData.planId && devId) {
+          const deviceExists = this.deviceOptions.find(d => d.devId === devId);
+          if (!deviceExists) {
+            this.deviceOptions = [response.data];
+          }
+        }
+
+        // 自动填充设备负责人(areaResponsible),如果还没有设置责任人
+        if (response.data.areaResponsible && this.staffOptions.length > 0 && !this.formData.responsible) {
+          const staff = this.staffOptions.find(s => s.staffid === response.data.areaResponsible);
+          if (staff) {
+            this.formData.responsible = staff.name;
+          }
+        }
+
+        // 使用selectedDevice的devTag来加载部件列表
+        if (this.selectedDevice && this.selectedDevice.devTag) {
+          this.loadCompoList(this.selectedDevice.devTag);
+        }
+      });
+    },
+    /** 从后端数据初始化部件列表 */
+    initCompoListFromData(compoListData) {
+      this.compoList = compoListData.map(compo => ({
+        ...compo,
+        needMaint: false,
+        maintType: '',
+        maintResponsible: '',
+        checkFreq: compo.inspFreq || '',
+        lastCheckDate: compo.lastInspDate || '',
+        maintFreq: compo.fixFreq || '',
+        lastMaintDate: compo.lastFixDate || '',
+        replaceFreq: compo.replaceFreq || '',
+        lastReplaceDate: compo.lastReplaceDate || '',
+        inspector: compo.inspector || '',
+        fixer: compo.fixer || '',
+        inspectorName: compo.inspectorName || '',
+        fixerName: compo.fixerName || '',
+      }));
+
+      this.$nextTick(() => {
+        setTimeout(() => {
+          this.markSelectedComponents();
+        }, 100);
+      });
+    },
+    /** 加载部件列表 */
+    loadCompoList(devTag) {
+      const targetDevTag = devTag || (this.selectedDevice ? this.selectedDevice.devTag : null);
+      if (!targetDevTag) {
+        return;
+      }
+
+      listRel_compo({
+        devTag: targetDevTag,
+        pageNum: 1,
+        pageSize: 1000
+      }).then(response => {
+        const compos = response.rows || [];
+        this.initCompoListFromData(compos);
+      });
+    },
+    /** 标记已选择的部件(根据维修记录) */
+    markSelectedComponents() {
+      if (!this.compoList || this.compoList.length === 0) {
+        return;
+      }
+
+      const maintRecords = this.formData.maintRecordsList || this.formData.maintRecords || [];
+
+      if (!this.formData.planId || !maintRecords || maintRecords.length === 0) {
+        return;
+      }
+
+      const markComponents = () => {
+        this.compoList.forEach(compo => {
+          const record = maintRecords.find(r => r.compoId == compo.compoId);
+
+          if (record) {
+            compo.needMaint = true;
+            compo.maintType = record.maintType;
+
+            if (record.responsible && this.staffOptions.length > 0) {
+              const staff = this.staffOptions.find(s => s.staffid === record.responsible);
+              compo.maintResponsible = staff ? staff.name : '';
+            } else {
+              if (compo.maintType === '1') {
+                compo.maintResponsible = compo.inspectorName || '';
+              } else if (compo.maintType === '2' || compo.maintType === '3') {
+                compo.maintResponsible = compo.fixerName || '';
+              }
+            }
+          }
+        });
+      };
+
+      if (this.staffOptions.length > 0) {
+        this.$nextTick(markComponents);
+      } else {
+        const checkStaffOptions = () => {
+          if (this.staffOptions.length > 0) {
+            this.$nextTick(markComponents);
+          } else {
+            setTimeout(checkStaffOptions, 100);
+          }
+        };
+        checkStaffOptions();
+      }
+    },
+    /** 维修选择改变 */
+    handleMaintCheckChange(compo) {
+      if (!compo.needMaint) {
+        compo.maintType = '';
+        compo.maintResponsible = '';
+      }
+    },
+    /** 维修形式改变 */
+    handleMaintTypeChange(compo) {
+      if (compo.maintType === '1') {
+        compo.maintResponsible = compo.inspectorName || '';
+      } else if (compo.maintType === '2' || compo.maintType === '3') {
+        compo.maintResponsible = compo.fixerName || '';
+      } else {
+        compo.maintResponsible = '';
+      }
+    },
+    /** 根据姓名获取工号 */
+    getStaffIdByName(name) {
+      if (!name) return '';
+      const staff = this.staffOptions.find(s => s.name === name);
+      return staff ? staff.staffid : '';
+    },
+    getResponsiblePlaceholder(maintType) {
+      switch(maintType) {
+        case '1': return '选择检查人';
+        case '2': return '选择维修人';
+        case '3': return '选择更换人';
+        default: return '选择负责人';
+      }
+    },
+    /** 翻译频率字段 */
+    translateFrequency(frequency) {
+      if (!frequency) return '';
+
+      const match = frequency.match(/^(\d+)([ym])$/);
+      if (match) {
+        const number = match[1];
+        const unit = match[2];
+
+        switch (unit) {
+          case 'y':
+            return `${number}年一次`;
+          case 'm':
+            return `${number}月一次`;
+          default:
+            return frequency;
+        }
+      }
+
+      return frequency;
+    },
+    /** 时间格式化 */
+    parseTime(time, pattern) {
+      return formatTime(time, pattern);
+    },
+    /** 提交表单 */
+    handleSubmit() {
+      this.$refs.form.validate(valid => {
+        if (valid) {
+          if (this.compoList.length > 0) {
+            const maintComponents = this.compoList
+              .filter(compo => compo.needMaint)
+              .map(compo => ({
+                compoId: compo.compoId,
+                compoName: compo.compoName,
+                maintType: compo.maintType,
+                responsible: this.getStaffIdByName(compo.maintResponsible),
+                inspectContent: '',
+                maintContent: '',
+                maintResult: '',
+                maintCost: null,
+                maintDuration: null,
+                processLoss: '',
+                attachments: '',
+                remarks: ''
+              }));
+
+            this.formData.maintComponents = maintComponents;
+          }
+
+          if (this.formData.approver) {
+            this.formData.approver = this.getStaffIdByName(this.formData.approver);
+          }
+
+          if (this.formData.responsible && typeof this.formData.responsible === 'string') {
+            const staffId = this.getStaffIdByName(this.formData.responsible);
+            if (staffId) {
+              this.formData.responsible = staffId;
+            }
+          }
+
+          this.$emit('submit', this.formData);
+        }
+      });
+    },
+    /** 取消 */
+    handleCancel() {
+      this.handleClose();
+    },
+    /** 关闭弹窗 */
+    handleClose() {
+      this.resetForm();
+      this.$emit('update:visible', false);
+      this.$emit('cancel');
+    }
+  }
+};
+</script>
+
+<style scoped lang="scss">
+.form-section {
+  margin-bottom: 20px;
+
+  .section-header {
+    display: flex;
+    align-items: center;
+    margin-bottom: 15px;
+    padding-bottom: 10px;
+    border-bottom: 1px solid #e4e7ed;
+
+    .el-icon-info,
+    .el-icon-s-platform,
+    .el-icon-s-grid,
+    .el-icon-setting {
+      font-size: 18px;
+      color: #409EFF;
+      margin-right: 8px;
+    }
+
+    .section-title {
+      font-size: 16px;
+      font-weight: 600;
+      color: #303133;
+    }
+  }
+}
+
+.dialog-footer {
+  text-align: right;
+}
+
+// 紧凑的radio按钮样式
+::v-deep .el-table .el-radio__label {
+  padding-left: 2px !important;
+}
+</style>

+ 78 - 522
ui/src/views/reliability/rel_maint_plan/index.vue

@@ -117,7 +117,11 @@
           <span v-else>{{ scope.row.approvalStatus }}</span>
         </template>
       </el-table-column>
-      <el-table-column label="责任人" align="center" prop="responsible" width="100" :show-overflow-tooltip="true"/>
+      <el-table-column label="责任人" align="center" width="100" :show-overflow-tooltip="true">
+        <template slot-scope="scope">
+          <span>{{ getStaffNameById(scope.row.responsible) || '-' }}</span>
+        </template>
+      </el-table-column>
       <el-table-column label="计划完成状态" align="center" prop="completionStatus" width="120" :show-overflow-tooltip="true">
         <template slot-scope="scope">
           <el-tag v-if="scope.row.completionStatus === '0'" type="info" size="mini">未完成</el-tag>
@@ -125,10 +129,21 @@
           <span v-else>{{ scope.row.completionStatus }}</span>
         </template>
       </el-table-column>
-      <el-table-column label="审批人" align="center" prop="approver" width="100" :show-overflow-tooltip="true"/>
+      <el-table-column label="审批人" align="center" width="100" :show-overflow-tooltip="true">
+        <template slot-scope="scope">
+          <span>{{ getStaffNameById(scope.row.approver) || '-' }}</span>
+        </template>
+      </el-table-column>
       <el-table-column label="备注" align="center" prop="remarks"  :show-overflow-tooltip="true"/>
-      <el-table-column label="操作" align="center" fixed="right" width="120" class-name="small-padding fixed-width">
+      <el-table-column label="操作" align="center" fixed="right" width="180" class-name="small-padding fixed-width">
         <template slot-scope="scope">
+          <el-button
+            size="mini"
+            type="text"
+            icon="el-icon-view"
+            @click="handleView(scope.row)"
+            v-hasPermi="['reliability:rel_maint_plan:query']"
+          >查看</el-button>
           <el-button
             size="mini"
             type="text"
@@ -157,217 +172,20 @@
     />
 
     <!-- 添加或修改设备维修计划对话框 -->
-    <el-dialog :title="title" :visible.sync="open" width="1200px" append-to-body>
-      <el-form ref="form" :model="form" :rules="rules" label-width="120px">
-        <!-- 基础信息区域 -->
-        <div class="form-section">
-          <div class="section-header">
-            <i class="el-icon-info"></i>
-            <span class="section-title">基础信息</span>
-          </div>
-          <el-row :gutter="20">
-            <el-col :span="12">
-              <el-form-item label="选择设备" prop="devId">
-                <el-select
-                  v-model="form.devId"
-                  filterable
-                  remote
-                  :remote-method="searchDevice"
-                  :loading="deviceLoading"
-                  placeholder="请输入设备位号或名称搜索"
-                  style="width: 100%"
-                  @change="handleDeviceChange"
-                  @focus="handleDeviceFocus"
-                  :disabled="!!form.planId"
-                  clearable>
-                  <el-option
-                    v-for="device in deviceOptions"
-                    :key="device.devId"
-                    :label="`${device.devTag} - ${device.devName}`"
-                    :value="device.devId">
-                    <span style="float: left">{{ device.devTag }}</span>
-                    <span style="float: right; color: #8492a6; font-size: 13px">{{ device.devName }}</span>
-                  </el-option>
-                  <div v-if="deviceOptions.length === 0 && !deviceLoading" style="padding: 10px; text-align: center; color: #909399;">
-                    请输入设备位号或名称进行搜索
-                  </div>
-                </el-select>
-              </el-form-item>
-            </el-col>
-            <el-col :span="12">
-              <el-form-item label="计划维修时间" prop="planTime">
-                <el-date-picker
-                  v-model="form.planTime"
-                  type="date"
-                  value-format="yyyy-MM-dd"
-                  placeholder="选择计划维修时间"
-                  style="width: 100%">
-                </el-date-picker>
-              </el-form-item>
-            </el-col>
-          </el-row>
-          <el-row :gutter="20">
-            <el-col :span="12">
-              <el-form-item label="责任人" prop="responsible">
-                <el-input v-model="form.responsible" placeholder="请输入责任人" />
-              </el-form-item>
-            </el-col>
-            <el-col :span="12">
-              <el-form-item label="审批人" prop="approver">
-                <el-select
-                  v-model="form.approver"
-                  placeholder="请选择审批人"
-                  style="width: 100%"
-                  clearable
-                  filterable>
-                  <el-option
-                    v-for="staff in staffOptions"
-                    :key="staff.staffid"
-                    :label="staff.name"
-                    :value="staff.name">
-                  </el-option>
-                  <div v-if="staffOptions.length === 0" style="padding: 10px; text-align: center; color: #909399;">
-                    暂无人员数据
-                  </div>
-                </el-select>
-              </el-form-item>
-            </el-col>
-          </el-row>
-          <el-row :gutter="20">
-            <el-col :span="24">
-              <el-form-item label="备注" prop="remarks">
-                <el-input v-model="form.remarks" type="textarea" :rows="2" placeholder="请输入备注" />
-              </el-form-item>
-            </el-col>
-          </el-row>
-        </div>
-
-        <!-- 设备信息展示 -->
-        <div class="form-section" v-if="selectedDevice">
-          <div class="section-header">
-            <i class="el-icon-s-platform"></i>
-            <span class="section-title">设备信息</span>
-          </div>
-          <el-descriptions :column="3" border size="small">
-            <el-descriptions-item label="装置">{{ selectedDevice.plant }}</el-descriptions-item>
-            <el-descriptions-item label="设备位号">{{ selectedDevice.devTag }}</el-descriptions-item>
-            <el-descriptions-item label="设备名称">{{ selectedDevice.devName }}</el-descriptions-item>
-            <el-descriptions-item label="位置">{{ selectedDevice.devLoc }}</el-descriptions-item>
-            <el-descriptions-item label="设备类型">{{ selectedDevice.devType }}</el-descriptions-item>
-            <el-descriptions-item label="区域负责人">{{ selectedDevice.areaResponsible }}</el-descriptions-item>
-          </el-descriptions>
-        </div>
-
-        <!-- 部件列表及维修记录选择 -->
-        <div class="form-section" v-if="compoList.length > 0">
-          <div class="section-header">
-            <i class="el-icon-s-grid"></i>
-            <span class="section-title">部件维修选择</span>
-          </div>
-          <el-table
-            :data="compoList"
-            border
-            size="small"
-            :height="500"
-            style="margin-top: 10px">
-            <el-table-column type="index" label="序号" width="60" align="center" />
-            <el-table-column label="部件名称" prop="compoName" width="150" :show-overflow-tooltip="true" />
-            <el-table-column label="检查频率/日期" width="120" align="center">
-              <template slot-scope="scope">
-                <div style="line-height: 1.2;">
-                  <div style="font-weight: bold; margin-bottom: 2px;">{{ translateFrequency(scope.row.checkFreq) || '-' }}</div>
-                  <div style="font-size: 12px; color: #666;">{{ scope.row.lastCheckDate ? parseTime(scope.row.lastCheckDate, '{y}-{m}-{d}') : '-' }}</div>
-                </div>
-              </template>
-            </el-table-column>
-            <el-table-column label="维修频率/日期" width="120" align="center">
-              <template slot-scope="scope">
-                <div style="line-height: 1.2;">
-                  <div style="font-weight: bold; margin-bottom: 2px;">{{ translateFrequency(scope.row.maintFreq) || '-' }}</div>
-                  <div style="font-size: 12px; color: #666;">{{ scope.row.lastMaintDate ? parseTime(scope.row.lastMaintDate, '{y}-{m}-{d}') : '-' }}</div>
-                </div>
-              </template>
-            </el-table-column>
-            <el-table-column label="更换频率/日期" width="120" align="center">
-              <template slot-scope="scope">
-                <div style="line-height: 1.2;">
-                  <div style="font-weight: bold; margin-bottom: 2px;">{{ translateFrequency(scope.row.replaceFreq) || '-' }}</div>
-                  <div style="font-size: 12px; color: #666;">{{ scope.row.lastReplaceDate ? parseTime(scope.row.lastReplaceDate, '{y}-{m}-{d}') : '-' }}</div>
-                </div>
-              </template>
-            </el-table-column>
-            <el-table-column label="本次维修" width="100" align="center">
-              <template slot-scope="scope">
-                <el-checkbox v-model="scope.row.needMaint" @change="handleMaintCheckChange(scope.row)">需要维修</el-checkbox>
-              </template>
-            </el-table-column>
-            <el-table-column label="维修形式" width="200" align="center">
-              <template slot-scope="scope">
-                <el-radio-group
-                  v-model="scope.row.maintType"
-                  :disabled="!scope.row.needMaint"
-                  @change="handleMaintTypeChange(scope.row)"
-                  style="display: flex; flex-direction: row; gap: 0px;">
-                  <el-radio label="1" style="margin-right: 0; margin-left: 0;">检查</el-radio>
-                  <el-radio label="2" style="margin-right: 0; margin-left: 0;">维修</el-radio>
-                  <el-radio label="3" style="margin-right: 0; margin-left: 0;">更换</el-radio>
-                </el-radio-group>
-              </template>
-            </el-table-column>
-            <el-table-column label="负责人" width="150" align="center">
-              <template slot-scope="scope">
-                <el-select
-                  v-model="scope.row.maintResponsible"
-                  :placeholder="getResponsiblePlaceholder(scope.row.maintType)"
-                  style="width: 100%"
-                  :disabled="!scope.row.needMaint"
-                  clearable
-                  filterable>
-                  <el-option
-                    v-for="staff in staffOptions"
-                    :key="staff.staffid"
-                    :label="staff.name"
-                    :value="staff.name">
-                  </el-option>
-                </el-select>
-              </template>
-            </el-table-column>
-          </el-table>
-        </div>
+    <maint-plan-form
+      :visible.sync="open"
+      :title="title"
+      :form="form"
+      @submit="handleFormSubmit"
+      @cancel="cancel"
+    />
 
-        <!-- 修改模式额外字段 -->
-        <div class="form-section" v-if="form.planId">
-          <div class="section-header">
-            <i class="el-icon-setting"></i>
-            <span class="section-title">状态管理</span>
-          </div>
-          <el-row :gutter="20">
-            <el-col :span="12">
-              <el-form-item label="计划审批状态">
-                <el-radio-group v-model="form.approvalStatus">
-                  <el-radio label="0">待审批</el-radio>
-                  <el-radio label="1">已通过</el-radio>
-                  <el-radio label="-1">未通过</el-radio>
-                </el-radio-group>
-              </el-form-item>
-            </el-col>
-            <el-col :span="12">
-              <el-form-item label="计划完成状态">
-                <el-radio-group v-model="form.completionStatus">
-                  <el-radio label="0">未完成</el-radio>
-                  <el-radio label="1">已完成</el-radio>
-                </el-radio-group>
-              </el-form-item>
-            </el-col>
-          </el-row>
-        </div>
-      </el-form>
-      <div slot="footer" class="dialog-footer">
-        <el-button type="primary" @click="submitForm" v-if="!form.planId">提交申请</el-button>
-        <el-button type="primary" @click="submitForm" v-else>确 定</el-button>
-        <el-button @click="cancel">取 消</el-button>
-      </div>
-    </el-dialog>
+    <!-- 查看维修计划详情对话框 -->
+    <maint-plan-detail
+      :visible.sync="detailOpen"
+      :plan-id="viewPlanId"
+      @close="handleDetailClose"
+    />
       <!-- 用户导入对话框 -->
       <el-dialog :title="upload.title" :visible.sync="upload.open" width="400px" append-to-body>
           <el-upload
@@ -403,19 +221,18 @@
 
 <script>
 import { listRel_maint_plan, getRel_maint_plan, delRel_maint_plan, addRel_maint_plan, updateRel_maint_plan, exportRel_maint_plan, importTemplate, submitApprove} from "@/api/reliability/rel_maint_plan";
-import { listRel_device, getRel_device } from "@/api/reliability/rel_device";
-import { listRel_compo } from "@/api/reliability/rel_compo";
 import { listRel_maint_record } from "@/api/reliability/rel_maint_record";
-import { listUser } from "@/api/system/user";
-import { listStaffmgr, listStaffmgrAll } from "@/api/plant/staffmgr";
 import { treeselect } from "@/api/system/dept";
 import { getToken } from "@/utils/auth";
+import { listStaffmgrAll } from "@/api/plant/staffmgr";
 import Treeselect from "@riophae/vue-treeselect";
 import "@riophae/vue-treeselect/dist/vue-treeselect.css";
+import MaintPlanForm from "./MaintPlanForm.vue";
+import MaintPlanDetail from "./MaintPlanDetail.vue";
 
 export default {
   name: "Rel_maint_plan",
-  components: { Treeselect },
+  components: { Treeselect, MaintPlanForm, MaintPlanDetail },
   data() {
     return {
       // 遮罩层
@@ -439,6 +256,10 @@ export default {
       clientHeight:300,
       // 是否显示弹出层
       open: false,
+      // 是否显示详情弹出层
+      detailOpen: false,
+      // 查看的计划ID
+      viewPlanId: null,
         // 用户导入参数
         upload: {
             // 是否显示弹出层(用户导入)
@@ -476,27 +297,6 @@ export default {
       },
       // 表单参数
       form: {},
-      // 表单校验
-      rules: {
-        devId: [
-          { required: true, message: "请选择设备", trigger: "change" }
-        ],
-        planTime: [
-          { required: true, message: "请选择计划维修时间", trigger: "change" }
-        ],
-        approver: [
-          { required: true, message: "请选择审批人", trigger: "change" }
-        ]
-      },
-      // 设备相关
-      deviceOptions: [],
-      deviceLoading: false,
-      selectedDevice: null,
-      // 部件相关
-      compoList: [],
-      // 审批人相关
-      approverOptions: [],
-      approverLoading: false,
       // 所有人员选项
       staffOptions: []
     };
@@ -529,13 +329,17 @@ export default {
     /** 查询人员列表 */
     getStaffList() {
       listStaffmgrAll().then(response => {
-        console.log('人员数据响应:', response);
         this.staffOptions = response.rows || response.data || [];
-        console.log('staffOptions:', this.staffOptions);
       }).catch(error => {
         console.error('加载人员数据失败:', error);
       });
     },
+    /** 根据员工号获取员工姓名 */
+    getStaffNameById(staffid) {
+      if (!staffid) return '';
+      const staff = this.staffOptions.find(s => s.staffid === staffid);
+      return staff ? staff.name : staffid; // 如果找不到,返回原始值
+    },
     getList() {
       this.loading = true;
       listRel_maint_plan(this.queryParams).then(response => {
@@ -576,13 +380,8 @@ export default {
         updatedate: null,
         deptId: null,
         remarks: null,
-        // 维修记录关联
-        compoRecords: []
+        maintComponents: []
       };
-      this.selectedDevice = null;
-      this.compoList = [];
-      this.deviceOptions = [];
-      this.approverOptions = [];
       this.resetForm("form");
     },
     /** 搜索按钮操作 */
@@ -607,239 +406,52 @@ export default {
       this.open = true;
       this.title = "添加设备维修计划";
     },
+    /** 查看按钮操作 */
+    handleView(row) {
+      this.viewPlanId = row.planId;
+      this.detailOpen = true;
+    },
+    /** 关闭详情弹窗 */
+    handleDetailClose() {
+      this.detailOpen = false;
+      this.viewPlanId = null;
+    },
     /** 修改按钮操作 */
     handleUpdate(row) {
       this.reset();
       const planId = row.planId || this.ids
       getRel_maint_plan(planId).then(response => {
-        this.form = response.data;
-
-        // 如果有设备ID,加载设备信息和部件列表
-        if (this.form.devId) {
-          this.loadDeviceInfo(this.form.devId);
+        const planData = response.data;
+        // 后端已经返回了 relDevice 和 maintRecordsList,直接使用
+        // 将 maintRecordsList 映射为 maintRecords(保持前端兼容性)
+        if (planData.maintRecordsList) {
+          planData.maintRecords = planData.maintRecordsList;
         }
-
+        this.form = planData;
         this.open = true;
         this.title = "修改设备维修计划";
       });
     },
-    /** 设备下拉框获得焦点 */
-    handleDeviceFocus() {
-      // 如果没有数据且没有在加载,可以加载一些初始数据
-      if (this.deviceOptions.length === 0 && !this.deviceLoading) {
-        // 可以加载最近的设备或空列表
-        // this.searchDevice('');
-      }
-    },
-    /** 设备选择改变 */
-    handleDeviceChange(devId) {
-      if (!devId) {
-        this.selectedDevice = null;
-        this.compoList = [];
-        return;
-      }
-
-      // 获取设备详情
-      getRel_device(devId).then(response => {
-        this.selectedDevice = response.data;
-        this.form.plant = response.data.plant;
-        this.form.devName = response.data.devName;
-        this.form.devTag = response.data.devTag;
-
-        // 加载该设备的部件列表
-        this.loadCompoList(devId);
-      });
-    },
-    /** 搜索设备 */
-    searchDevice(query) {
-      if (query !== '') {
-        this.deviceLoading = true;
-        listRel_device({
-          devTag: query,
-          devName: query,
-          pageNum: 1,
-          pageSize: 50
-        }).then(response => {
-          this.deviceOptions = response.rows || [];
-          this.deviceLoading = false;
-        }).catch(() => {
-          this.deviceLoading = false;
-          this.deviceOptions = [];
+    /** 处理表单提交 */
+    handleFormSubmit(formData) {
+      if (formData.planId != null) {
+        // 修改模式
+        updateRel_maint_plan(formData).then(response => {
+          this.msgSuccess("修改成功");
+          this.open = false;
+          this.getList();
         });
       } else {
-        this.deviceOptions = [];
-      }
-    },
-    /** 加载设备信息 */
-    loadDeviceInfo(devId) {
-      // 获取设备详情
-      getRel_device(devId).then(response => {
-        this.selectedDevice = response.data;
-
-        // 加载该设备的部件列表
-        this.loadCompoList(devId);
-      });
-    },
-    /** 加载部件列表 */
-    loadCompoList(devId) {
-      listRel_compo({
-        devTag: this.selectedDevice.devTag,
-        pageNum: 1,
-        pageSize: 1000
-      }).then(response => {
-        const compos = response.rows || [];
-        // 为每个部件初始化维修记录数组
-        this.compoList = compos.map(compo => ({
-          ...compo,
-          // 维修计划相关字段
-          needMaint: false,
-          maintType: '',
-          maintResponsible: '',
-          // 频率和日期字段 - 使用正确的字段名
-          checkFreq: compo.inspFreq || '',
-          lastCheckDate: compo.lastInspDate || '',
-          maintFreq: compo.fixFreq || '',
-          lastMaintDate: compo.lastFixDate || '',
-          replaceFreq: compo.replaceFreq || '',
-          lastReplaceDate: compo.lastReplaceDate || '',
-          // 负责人字段
-          inspector: compo.inspector || '',  // 检查人
-          fixer: compo.fixer || '',          // 维修更换人
-          inspectorName: compo.inspectorName || '',  // 检查人姓名
-          fixerName: compo.fixerName || '',          // 维修更换人姓名
-          // 负责人搜索相关
-          responsibleOptions: [],
-          responsibleLoading: false,
-          // 原有的维修记录相关(保留用于修改模式)
-          selectedRecords: [],
-          maintRecords: [],
-          recordLoading: false
-        }));
-
-        // 为每个部件加载可选的维修记录(修改模式)
-        if (this.form.planId) {
-          this.compoList.forEach(compo => {
-            this.loadMaintRecords(compo);
-          });
-        }
-      });
-    },
-    /** 加载维修记录 */
-    loadMaintRecords(compo) {
-      compo.recordLoading = true;
-      listRel_maint_record({
-        compoId: compo.compoId,
-        pageNum: 1,
-        pageSize: 1000
-      }).then(response => {
-        compo.maintRecords = (response.rows || []).map(record => ({
-          ...record,
-          // 确保maintContent是纯文本(去除HTML标签)
-          maintContent: record.maintContent ? String(record.maintContent).replace(/<[^>]+>/g, '').trim() : ''
-        }));
-        compo.recordLoading = false;
-      }).catch(() => {
-        compo.recordLoading = false;
-        compo.maintRecords = [];
-      });
-    },
-    /** 维修记录选择改变 */
-    handleRecordChange(compo) {
-      // 可以在这里添加其他逻辑
-    },
-    /** 维修负责人搜索 */
-    /** 维修选择改变 */
-    handleMaintCheckChange(compo) {
-      if (!compo.needMaint) {
-        // 如果取消维修,清空相关字段
-        compo.maintType = '';
-        compo.maintResponsible = '';
-      }
-    },
-    /** 维修形式改变 */
-    handleMaintTypeChange(compo) {
-      // 根据维修形式自动设置负责人
-      if (compo.maintType === '1') {
-        // 检查 - 使用检查人姓名
-        compo.maintResponsible = compo.inspectorName || '';
-      } else if (compo.maintType === '2' || compo.maintType === '3') {
-        // 维修或更换 - 使用维修更换人姓名
-        compo.maintResponsible = compo.fixerName || '';
-      } else {
-        // 其他情况清空负责人选择
-        compo.maintResponsible = '';
-      }
-    },
-    /** 根据姓名获取工号 */
-    getStaffIdByName(name) {
-      if (!name) return '';
-      const staff = this.staffOptions.find(s => s.name === name);
-      return staff ? staff.staffid : '';
-    },
-    getResponsiblePlaceholder(maintType) {
-      switch(maintType) {
-        case '1': return '选择检查人';
-        case '2': return '选择维修人';
-        case '3': return '选择更换人';
-        default: return '选择负责人';
+        // 新增模式 - 提交申请
+        submitApprove(formData).then(response => {
+          this.msgSuccess("维修计划申请提交成功");
+          this.open = false;
+          this.getList();
+        }).catch(error => {
+          this.msgError("提交失败:" + (error.message || "未知错误"));
+        });
       }
     },
-    /** 提交按钮 */
-    submitForm() {
-      this.$refs["form"].validate(valid => {
-        if (valid) {
-          // 收集需要维修的部件信息
-          if (!this.form.planId && this.compoList.length > 0) {
-            // 收集需要维修的部件,转换为TRelMaintRecord格式
-            const maintComponents = this.compoList
-              .filter(compo => compo.needMaint)
-              .map(compo => ({
-                compoId: compo.compoId,
-                compoName: compo.compoName,
-                maintType: compo.maintType,
-                responsible: this.getStaffIdByName(compo.maintResponsible), // 转换为工号
-                // 可以添加其他需要的字段
-                inspectContent: '', // 检查内容
-                maintContent: '', // 维修内容
-                maintResult: '', // 维修结果
-                maintCost: null, // 维修费用
-                maintDuration: null, // 维修时长
-                processLoss: '', // 工艺损失
-                attachments: '', // 附件
-                remarks: '' // 备注
-              }));
-
-            this.form.maintComponents = maintComponents;
-            console.log('收集到的维修部件:', maintComponents);
-          }
-
-          console.log('提交的表单数据:', this.form);
-
-          // 转换审批人姓名为工号
-          if (this.form.approver) {
-            this.form.approver = this.getStaffIdByName(this.form.approver);
-          }
-
-          if (this.form.planId != null) {
-            // 修改模式
-            updateRel_maint_plan(this.form).then(response => {
-              this.msgSuccess("修改成功");
-              this.open = false;
-              this.getList();
-            });
-          } else {
-            // 新增模式 - 提交申请
-            submitApprove(this.form).then(response => {
-              this.msgSuccess("维修计划申请提交成功");
-              this.open = false;
-              this.getList();
-            }).catch(error => {
-              this.msgError("提交失败:" + (error.message || "未知错误"));
-            });
-          }
-        }
-      });
-    },
     /** 删除按钮操作 */
     handleDelete(row) {
       const planIds = row.planId || this.ids;
@@ -893,66 +505,10 @@ export default {
       // 提交上传文件
       submitFileForm() {
           this.$refs.upload.submit();
-      },
-      /** 翻译频率字段 */
-      translateFrequency(frequency) {
-        if (!frequency) return '';
-
-        // 匹配数字和单位
-        const match = frequency.match(/^(\d+)([ym])$/);
-        if (match) {
-          const number = match[1];
-          const unit = match[2];
-
-          switch (unit) {
-            case 'y':
-              return `${number}年一次`;
-            case 'm':
-              return `${number}月一次`;
-            default:
-              return frequency;
-          }
-        }
-
-        return frequency;
       }
   }
 };
 </script>
 
 <style scoped lang="scss">
-.form-section {
-  margin-bottom: 20px;
-
-  .section-header {
-    display: flex;
-    align-items: center;
-    margin-bottom: 15px;
-    padding-bottom: 10px;
-    border-bottom: 1px solid #e4e7ed;
-
-    .el-icon-info,
-    .el-icon-s-platform,
-    .el-icon-s-grid {
-      font-size: 18px;
-      color: #409EFF;
-      margin-right: 8px;
-    }
-
-    .section-title {
-      font-size: 16px;
-      font-weight: 600;
-      color: #303133;
-    }
-  }
-}
-
-.dialog-footer {
-  text-align: right;
-}
-
-// 紧凑的radio按钮样式 - 仅影响维修计划页面的维修形式列
-.rel-maint-plan-page ::v-deep .el-table .el-radio__label {
-  padding-left: 2px !important;
-}
 </style>

+ 87 - 51
ui/src/views/reliability/rel_maint_record/index.vue

@@ -39,20 +39,22 @@
       </el-form-item>
       <el-form-item label="维修类型" prop="maintType">
         <el-select v-model="queryParams.maintType" placeholder="请选择维修类型" clearable size="small">
-          <el-option label="请选择字典生成" value="" />
+          <el-option label="检查" value="1" />
+          <el-option label="维修" value="2" />
+          <el-option label="更换" value="3" />
         </el-select>
       </el-form-item>
-      <el-form-item label="维修部门" prop="maintDept">
-        <el-input
-          v-model="queryParams.maintDept"
-          placeholder="请输入维修部门"
-          clearable
-          size="small"
-          @keyup.enter.native="handleQuery"
-        />
+      <el-form-item label="维修状态" prop="recordStatus">
+        <el-select v-model="queryParams.recordStatus" placeholder="请选择维修状态" clearable size="small">
+          <el-option label="删除申请中" value="-1" />
+          <el-option label="新增申请中" value="0" />
+          <el-option label="待完成" value="1" />
+          <el-option label="已完成" value="2" />
+        </el-select>
       </el-form-item>
 
 
+
       <el-form-item>
         <el-button type="cyan" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
         <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
@@ -60,15 +62,6 @@
     </el-form>
 
     <el-row :gutter="10" class="mb8">
-      <el-col :span="1.5">
-        <el-button
-          type="primary"
-          icon="el-icon-plus"
-          size="mini"
-          @click="handleAdd"
-          v-hasPermi="['reliability:rel_maint_record:add']"
-        >新增</el-button>
-      </el-col>
       <el-col :span="1.5">
         <el-button
           type="success"
@@ -89,15 +82,6 @@
           v-hasPermi="['reliability:rel_maint_record:remove']"
         >删除</el-button>
       </el-col>
-        <el-col :span="1.5">
-            <el-button
-                    type="info"
-                    icon="el-icon-upload2"
-                    size="mini"
-                    @click="handleImport"
-                    v-hasPermi="['reliability:rel_maint_record:edit']"
-            >导入</el-button>
-        </el-col>
       <el-col :span="1.5">
         <el-button
           type="warning"
@@ -106,28 +90,50 @@
           @click="handleExport"
           v-hasPermi="['reliability:rel_maint_record:list']"
         >导出</el-button>
+      </el-col>
+      <el-col :span="1.5">
+        <el-button
+          type="info"
+          icon="el-icon-document"
+          size="mini"
+          @click="handleViewMemo"
+        >查看维修备忘录</el-button>
       </el-col>
 	  <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
     </el-row>
 
     <el-table v-loading="loading" :data="rel_maint_recordList" @selection-change="handleSelectionChange" :height="clientHeight" border>
       <el-table-column type="selection" width="55" align="center" />
-      <el-table-column label="记录ID" align="center" prop="recordId" :show-overflow-tooltip="true"/>
       <el-table-column label="装置" align="center" prop="plant" :show-overflow-tooltip="true"/>
       <el-table-column label="设备名称" align="center" prop="devName" :show-overflow-tooltip="true"/>
       <el-table-column label="设备位号" align="center" prop="devTag" :show-overflow-tooltip="true"/>
       <el-table-column label="部件名称" align="center" prop="compoName" :show-overflow-tooltip="true"/>
-      <el-table-column label="部件ID" align="center" prop="compoId" :show-overflow-tooltip="true"/>
-      <el-table-column label="维修类型" align="center" prop="maintType" :show-overflow-tooltip="true"/>
-      <el-table-column label="维修部门" align="center" prop="maintDept" :show-overflow-tooltip="true"/>
-      <el-table-column label="检查人" align="center" prop="inspector" :show-overflow-tooltip="true"/>
+      <el-table-column label="维修类型" align="center" width="100">
+        <template slot-scope="scope">
+          <span v-if="scope.row.maintType === '1'">检查</span>
+          <span v-else-if="scope.row.maintType === '2'">维修</span>
+          <span v-else-if="scope.row.maintType === '3'">更换</span>
+          <span v-else>{{ scope.row.maintType || '-' }}</span>
+        </template>
+      </el-table-column>
+      <el-table-column label="维修人" align="center" width="120">
+        <template slot-scope="scope">
+          <span>{{ getStaffNameById(scope.row.responsible) || '-' }}</span>
+        </template>
+      </el-table-column>
+      <el-table-column label="维修状态" align="center" width="120">
+        <template slot-scope="scope">
+          <span>{{ getRecordStatusText(scope.row.recordStatus) }}</span>
+        </template>
+      </el-table-column>
       <el-table-column label="检查内容" align="center" prop="inspectContent" :show-overflow-tooltip="true"/>
       <el-table-column label="检查时间" align="center" prop="inspectTime" width="100">
         <template slot-scope="scope">
           <span>{{ parseTime(scope.row.inspectTime, '{y}-{m}-{d}') }}</span>
         </template>
       </el-table-column>
-      <el-table-column label="维修责任人" align="center" prop="responsible" :show-overflow-tooltip="true"/>
+
+      <el-table-column label="维修部门" align="center" prop="maintDept" :show-overflow-tooltip="true"/>
       <el-table-column label="维修内容" align="center" prop="maintContent" :show-overflow-tooltip="true"/>
       <el-table-column label="维修结果" align="center" prop="maintResult" :show-overflow-tooltip="true"/>
       <el-table-column label="维修时间" align="center" prop="maintTime" width="100">
@@ -139,19 +145,7 @@
       <el-table-column label="维修时长" align="center" prop="maintDuration" :show-overflow-tooltip="true"/>
       <el-table-column label="工艺损失" align="center" prop="processLoss" :show-overflow-tooltip="true"/>
       <el-table-column label="附件" align="center" prop="attachments" :show-overflow-tooltip="true"/>
-      <el-table-column label="创建人" align="center" prop="createrCode" :show-overflow-tooltip="true"/>
-      <el-table-column label="创建时间" align="center" prop="createdate" width="100">
-        <template slot-scope="scope">
-          <span>{{ parseTime(scope.row.createdate, '{y}-{m}-{d}') }}</span>
-        </template>
-      </el-table-column>
-      <el-table-column label="修改人" align="center" prop="updaterCode" :show-overflow-tooltip="true"/>
-      <el-table-column label="修改时间" align="center" prop="updatedate" width="100">
-        <template slot-scope="scope">
-          <span>{{ parseTime(scope.row.updatedate, '{y}-{m}-{d}') }}</span>
-        </template>
-      </el-table-column>
-      <el-table-column label="部门编号" align="center" prop="deptId" :show-overflow-tooltip="true"/>
+
       <el-table-column label="备注" align="center" prop="remarks" :show-overflow-tooltip="true"/>
       <el-table-column label="操作" align="center" fixed="right" width="120" class-name="small-padding fixed-width">
         <template slot-scope="scope">
@@ -200,8 +194,18 @@
           <el-input v-model="form.compoId" placeholder="请输入部件ID" />
         </el-form-item>
         <el-form-item label="维修类型" prop="maintType">
-          <el-select v-model="form.maintType" placeholder="请选择维修类型">
-            <el-option label="请选择字典生成" value="" />
+          <el-select v-model="form.maintType" placeholder="请选择维修类型" clearable>
+            <el-option label="检查" value="1" />
+            <el-option label="维修" value="2" />
+            <el-option label="更换" value="3" />
+          </el-select>
+        </el-form-item>
+        <el-form-item label="维修状态" prop="recordStatus">
+          <el-select v-model="form.recordStatus" placeholder="请选择维修状态" clearable>
+            <el-option label="删除申请中" value="-1" />
+            <el-option label="新增申请中" value="0" />
+            <el-option label="待完成" value="1" />
+            <el-option label="已完成" value="2" />
           </el-select>
         </el-form-item>
         <el-form-item label="维修部门" prop="maintDept">
@@ -327,6 +331,7 @@
 import { listRel_maint_record, getRel_maint_record, delRel_maint_record, addRel_maint_record, updateRel_maint_record, exportRel_maint_record, importTemplate} from "@/api/reliability/rel_maint_record";
 import { treeselect } from "@/api/system/dept";
 import { getToken } from "@/utils/auth";
+import { listStaffmgrAll } from "@/api/plant/staffmgr";
 import Treeselect from "@riophae/vue-treeselect";
 import "@riophae/vue-treeselect/dist/vue-treeselect.css";
 import Editor from '@/components/Editor';
@@ -400,13 +405,16 @@ export default {
         updaterCode: null,
         updatedate: null,
         deptId: null,
-        remarks: null
+        remarks: null,
+        recordStatus: null
       },
       // 表单参数
       form: {},
       // 表单校验
       rules: {
-      }
+      },
+      // 所有人员选项
+      staffOptions: []
     };
   },
   watch: {
@@ -422,6 +430,7 @@ export default {
       })
     this.getList();
     this.getTreeselect();
+    this.getStaffList();
   },
   methods: {
     /** 查询部件维修记录列表 */
@@ -439,6 +448,28 @@ export default {
               this.deptOptions = response.data;
           });
      },
+    /** 查询人员列表 */
+    getStaffList() {
+      listStaffmgrAll().then(response => {
+        this.staffOptions = response.rows || response.data || [];
+      }).catch(error => {
+        console.error('加载人员数据失败:', error);
+      });
+    },
+    /** 根据员工ID获取姓名 */
+    getStaffNameById(staffid) {
+      if (!staffid) return '';
+      const staff = this.staffOptions.find(s => s.staffid === staffid);
+      return staff ? staff.name : '';
+    },
+    /** 获取维修状态文本 */
+    getRecordStatusText(status) {
+      if (status === -1 || status === '-1') return '删除申请中';
+      if (status === 0 || status === '0') return '新增申请中';
+      if (status === 1 || status === '1') return '待完成';
+      if (status === 2 || status === '2') return '已完成';
+      return status != null ? status : '-';
+    },
     // 取消按钮
     cancel() {
       this.open = false;
@@ -472,7 +503,8 @@ export default {
         updaterCode: null,
         updatedate: null,
         deptId: null,
-        remarks: null
+        remarks: null,
+        recordStatus: null
       };
       this.resetForm("form");
     },
@@ -554,6 +586,10 @@ export default {
         }).then(response => {
           this.download(response.msg);
         })
+    },
+    /** 查看维修备忘录 */
+    handleViewMemo() {
+      this.$router.push({ path: '/reliability/rel_maint_memo' });
     },
       /** 导入按钮操作 */
       handleImport() {

+ 847 - 0
ui/src/views/reliability/rel_maint_record/myRecord.vue

@@ -0,0 +1,847 @@
+<template>
+  <div class="app-container">
+    <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
+      <el-form-item label="装置" prop="plant">
+        <el-input
+          v-model="queryParams.plant"
+          placeholder="请输入装置"
+          clearable
+          size="small"
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
+      <el-form-item label="设备名称" prop="devName">
+        <el-input
+          v-model="queryParams.devName"
+          placeholder="请输入设备名称"
+          clearable
+          size="small"
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
+      <el-form-item label="设备位号" prop="devTag">
+        <el-input
+          v-model="queryParams.devTag"
+          placeholder="请输入设备位号"
+          clearable
+          size="small"
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
+      <el-form-item label="部件名称" prop="compoName">
+        <el-input
+          v-model="queryParams.compoName"
+          placeholder="请输入部件名称"
+          clearable
+          size="small"
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
+      <el-form-item label="维修类型" prop="maintType">
+        <el-select v-model="queryParams.maintType" placeholder="请选择维修类型" clearable size="small">
+          <el-option label="检查" value="1" />
+          <el-option label="维修" value="2" />
+          <el-option label="更换" value="3" />
+        </el-select>
+      </el-form-item>
+      <el-form-item label="维修状态" prop="recordStatus">
+        <el-select v-model="queryParams.recordStatus" placeholder="请选择维修状态" clearable size="small">
+          <el-option label="删除申请中" value="-1" />
+          <el-option label="新增申请中" value="0" />
+          <el-option label="待完成" value="1" />
+          <el-option label="已完成" value="2" />
+        </el-select>
+      </el-form-item>
+
+
+
+      <el-form-item>
+        <el-button type="cyan" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
+        <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
+      </el-form-item>
+    </el-form>
+
+    <el-row :gutter="10" class="mb8">
+
+	  <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
+    </el-row>
+
+    <el-table v-loading="loading" :data="rel_maint_recordList" @selection-change="handleSelectionChange" :height="clientHeight" border>
+      <el-table-column type="selection" width="55" align="center" />
+      <el-table-column label="装置" align="center" prop="plant" :show-overflow-tooltip="true"/>
+      <el-table-column label="设备名称" align="center" prop="devName" :show-overflow-tooltip="true"/>
+      <el-table-column label="设备位号" align="center" prop="devTag" :show-overflow-tooltip="true"/>
+      <el-table-column label="部件名称" align="center" prop="compoName" :show-overflow-tooltip="true"/>
+      <el-table-column label="维修类型" align="center" width="100">
+        <template slot-scope="scope">
+          <span v-if="scope.row.maintType === '1'">检查</span>
+          <span v-else-if="scope.row.maintType === '2'">维修</span>
+          <span v-else-if="scope.row.maintType === '3'">更换</span>
+          <span v-else>{{ scope.row.maintType || '-' }}</span>
+        </template>
+      </el-table-column>
+      <el-table-column label="维修人" align="center" width="120">
+        <template slot-scope="scope">
+          <span>{{ getStaffNameById(scope.row.responsible) || '-' }}</span>
+        </template>
+      </el-table-column>
+      <el-table-column label="维修状态" align="center" width="120">
+        <template slot-scope="scope">
+          <el-tag v-if="scope.row.recordStatus === -1 || scope.row.recordStatus === '-1'" type="danger" size="small">删除申请中</el-tag>
+          <el-tag v-else-if="scope.row.recordStatus === 0 || scope.row.recordStatus === '0'" type="warning" size="small">新增申请中</el-tag>
+          <el-tag v-else-if="scope.row.recordStatus === 1 || scope.row.recordStatus === '1'" type="info" size="small">待完成</el-tag>
+          <el-tag v-else-if="scope.row.recordStatus === 2 || scope.row.recordStatus === '2'" type="success" size="small">已完成</el-tag>
+          <span v-else>{{ scope.row.recordStatus || '-' }}</span>
+        </template>
+      </el-table-column>
+      <el-table-column label="维修计划" align="center" width="120">
+        <template slot-scope="scope">
+          <el-link
+            v-if="scope.row.maintPlan && scope.row.maintPlan.planTime && scope.row.maintPlan.planId"
+            type="primary"
+            :underline="false"
+            style="font-size: 14px;"
+            @click="handleViewPlan(scope.row.maintPlan.planId)">
+            {{ parseTime(scope.row.maintPlan.planTime, '{y}-{m}-{d}') }}
+            <i class="el-icon-view" style="margin-right: 4px;"></i>
+          </el-link>
+          <span v-else>-</span>
+        </template>
+      </el-table-column>
+      <el-table-column label="检查内容" align="center" prop="inspectContent" :show-overflow-tooltip="true"/>
+      <el-table-column label="检查时间" align="center" prop="inspectTime" width="100">
+        <template slot-scope="scope">
+          <span>{{ parseTime(scope.row.inspectTime, '{y}-{m}-{d}') }}</span>
+        </template>
+      </el-table-column>
+
+      <el-table-column label="维修部门" align="center" prop="maintDept" :show-overflow-tooltip="true"/>
+      <el-table-column label="维修内容" align="center" prop="maintContent" :show-overflow-tooltip="true"/>
+      <el-table-column label="维修结果" align="center" prop="maintResult" :show-overflow-tooltip="true"/>
+      <el-table-column label="维修时间" align="center" prop="maintTime" width="100">
+        <template slot-scope="scope">
+          <span>{{ parseTime(scope.row.maintTime, '{y}-{m}-{d}') }}</span>
+        </template>
+      </el-table-column>
+      <el-table-column label="维修费用" align="center" prop="maintCost" :show-overflow-tooltip="true"/>
+      <el-table-column label="维修时长" align="center" prop="maintDuration" :show-overflow-tooltip="true"/>
+      <el-table-column label="工艺损失" align="center" prop="processLoss" :show-overflow-tooltip="true"/>
+      <el-table-column label="附件" align="center" prop="attachments" :show-overflow-tooltip="true"/>
+
+      <el-table-column label="备注" align="center" prop="remarks" :show-overflow-tooltip="true"/>
+      <el-table-column label="操作" align="center" fixed="right" width="120" class-name="small-padding fixed-width">
+        <template slot-scope="scope">
+          <el-button
+            size="mini"
+            type="text"
+            icon="el-icon-edit"
+            @click="handleProcess(scope.row)"
+            :disabled="scope.row.recordStatus === 2 || scope.row.recordStatus === '2'"
+          >处理</el-button>
+        </template>
+      </el-table-column>
+    </el-table>
+
+    <pagination
+      v-show="total>0"
+      :total="total"
+      :page.sync="queryParams.pageNum"
+      :limit.sync="queryParams.pageSize"
+      @pagination="getList"
+    />
+
+    <!-- 处理检查任务对话框 -->
+    <el-dialog title="处理检查任务" :visible.sync="processInspectOpen" width="900px" append-to-body>
+      <el-form ref="processInspectForm" :model="processForm" :rules="processRules" label-width="120px" style="margin-top: 0;">
+        <!-- 基本信息 - 只读显示 -->
+        <div class="info-section">
+          <el-divider content-position="left" style="margin: 10px 0;">
+            <span style="font-size: 16px; font-weight: bold; color: #303133;">基本信息</span>
+          </el-divider>
+          <el-descriptions :column="2" border style="margin-top: 5px;">
+            <el-descriptions-item label="装置">{{ processForm.plant || '-' }}</el-descriptions-item>
+            <el-descriptions-item label="设备名称">{{ processForm.devName || '-' }}</el-descriptions-item>
+            <el-descriptions-item label="设备位号">{{ processForm.devTag || '-' }}</el-descriptions-item>
+            <el-descriptions-item label="部件名称">{{ processForm.compoName || '-' }}</el-descriptions-item>
+            <el-descriptions-item label="维修类型">{{ getMaintTypeText(processForm.maintType) }}</el-descriptions-item>
+            <el-descriptions-item label="负责人">{{ getStaffNameById(processForm.responsible) || '-' }}</el-descriptions-item>
+            <el-descriptions-item label="计划时间" v-if="processForm.maintPlan && processForm.maintPlan.planTime">
+              {{ parseTime(processForm.maintPlan.planTime, '{y}-{m}-{d}') || '-' }}
+            </el-descriptions-item>
+            <el-descriptions-item label="责任人" v-if="processForm.maintPlan && processForm.maintPlan.responsible">
+              {{ getStaffNameById(processForm.maintPlan.responsible) || '-' }}
+            </el-descriptions-item>
+          </el-descriptions>
+        </div>
+
+        <!-- 处理信息 - 可填写 -->
+        <div style="margin-top: 30px;">
+          <el-divider content-position="left">
+            <span style="font-size: 16px; font-weight: bold; color: #303133;">处理信息</span>
+          </el-divider>
+          <el-form-item label="检查时间" prop="inspectTime">
+            <el-date-picker
+              clearable
+              style="width: 100%"
+              v-model="processForm.inspectTime"
+              type="date"
+              value-format="yyyy-MM-dd"
+              placeholder="选择检查时间">
+            </el-date-picker>
+          </el-form-item>
+          <el-form-item label="检查内容" prop="inspectContent">
+            <el-input v-model="processForm.inspectContent" type="textarea" :rows="5" placeholder="请输入检查内容" />
+          </el-form-item>
+          <el-form-item label="是否需要维修/更换">
+            <el-checkbox v-model="processForm.needMaintOrReplace">发现需要维修或更换</el-checkbox>
+          </el-form-item>
+          <template v-if="processForm.needMaintOrReplace">
+            <el-form-item label="维修类型" prop="newMaintType">
+              <el-select v-model="processForm.newMaintType" placeholder="请选择维修类型" clearable style="width: 100%">
+                <el-option label="维修" value="2" />
+                <el-option label="更换" value="3" />
+              </el-select>
+            </el-form-item>
+            <el-form-item label="负责人" prop="newResponsible">
+              <el-select
+                v-model="processForm.newResponsible"
+                placeholder="请选择负责人"
+                style="width: 100%"
+                clearable
+                filterable>
+                <el-option
+                  v-for="staff in staffOptions"
+                  :key="staff.staffid"
+                  :label="staff.name"
+                  :value="staff.staffid">
+                </el-option>
+              </el-select>
+            </el-form-item>
+          </template>
+          <el-form-item label="附件" prop="attachments">
+            <el-input v-model="processForm.attachments" placeholder="请输入附件" />
+          </el-form-item>
+          <el-form-item label="备注" prop="remarks">
+            <el-input v-model="processForm.remarks" type="textarea" :rows="3" placeholder="请输入备注" />
+          </el-form-item>
+        </div>
+      </el-form>
+      <div slot="footer" class="dialog-footer">
+        <el-button type="primary" @click="submitProcessForm">提 交</el-button>
+        <el-button @click="cancelProcess">取 消</el-button>
+      </div>
+    </el-dialog>
+
+    <!-- 处理维修/更换任务对话框 -->
+    <el-dialog title="处理维修任务" :visible.sync="processMaintOpen" width="900px" append-to-body>
+      <el-form ref="processMaintForm" :model="processForm" :rules="processRules" label-width="120px" style="margin-top: 0;">
+        <!-- 基本信息 - 只读显示 -->
+        <div class="info-section">
+          <el-divider content-position="left" style="margin: 10px 0;">
+            <span style="font-size: 16px; font-weight: bold; color: #303133;">基本信息</span>
+          </el-divider>
+          <el-descriptions :column="2" border style="margin-top: 5px;">
+            <el-descriptions-item label="装置">{{ processForm.plant || '-' }}</el-descriptions-item>
+            <el-descriptions-item label="设备名称">{{ processForm.devName || '-' }}</el-descriptions-item>
+            <el-descriptions-item label="设备位号">{{ processForm.devTag || '-' }}</el-descriptions-item>
+            <el-descriptions-item label="部件名称">{{ processForm.compoName || '-' }}</el-descriptions-item>
+            <el-descriptions-item label="维修类型">{{ getMaintTypeText(processForm.maintType) }}</el-descriptions-item>
+            <el-descriptions-item label="负责人">{{ getStaffNameById(processForm.responsible) || '-' }}</el-descriptions-item>
+            <el-descriptions-item label="计划时间" v-if="processForm.maintPlan && processForm.maintPlan.planTime">
+              {{ parseTime(processForm.maintPlan.planTime, '{y}-{m}-{d}') || '-' }}
+            </el-descriptions-item>
+            <el-descriptions-item label="责任人" v-if="processForm.maintPlan && processForm.maintPlan.responsible">
+              {{ getStaffNameById(processForm.maintPlan.responsible) || '-' }}
+            </el-descriptions-item>
+          </el-descriptions>
+        </div>
+
+        <!-- 处理信息 - 可填写 -->
+        <div style="margin-top: 30px;">
+          <el-divider content-position="left">
+            <span style="font-size: 16px; font-weight: bold; color: #303133;">处理信息</span>
+          </el-divider>
+          <el-form-item label="无法维修/更换">
+            <el-checkbox v-model="processForm.cannotMaintOrReplace">无法维修或更换</el-checkbox>
+          </el-form-item>
+          <template v-if="processForm.cannotMaintOrReplace">
+            <el-form-item label="备忘原因" prop="memoReason">
+              <el-input v-model="processForm.memoReason" type="textarea" :rows="3" placeholder="请输入备忘原因" />
+            </el-form-item>
+            <el-form-item label="备忘时间" prop="memoTime">
+              <el-date-picker
+                clearable
+                style="width: 100%"
+                v-model="processForm.memoTime"
+                type="date"
+                value-format="yyyy-MM-dd"
+                placeholder="选择备忘时间">
+              </el-date-picker>
+            </el-form-item>
+          </template>
+          <template v-else>
+            <el-form-item label="维修内容" prop="maintContent">
+              <el-input v-model="processForm.maintContent" type="textarea" :rows="5" placeholder="请输入维修内容" />
+            </el-form-item>
+            <el-form-item label="维修结果" prop="maintResult">
+              <el-input v-model="processForm.maintResult" type="textarea" :rows="3" placeholder="请输入维修结果" />
+            </el-form-item>
+            <el-row :gutter="20">
+              <el-col :span="12">
+                <el-form-item label="维修时间" prop="maintTime">
+                  <el-date-picker
+                    clearable
+                    style="width: 100%"
+                    v-model="processForm.maintTime"
+                    type="date"
+                    value-format="yyyy-MM-dd"
+                    placeholder="选择维修时间">
+                  </el-date-picker>
+                </el-form-item>
+              </el-col>
+              <el-col :span="12">
+                <el-form-item label="维修费用" prop="maintCost">
+                  <el-input-number
+                    v-model="processForm.maintCost"
+                    :min="0"
+                    :precision="1"
+                    :step="0.1"
+                    style="width: 100%"
+                    placeholder="请输入维修费用" />
+                </el-form-item>
+              </el-col>
+            </el-row>
+            <el-row :gutter="20">
+              <el-col :span="12">
+                <el-form-item label="维修时长" prop="maintDuration">
+                  <el-input-number
+                    v-model="processForm.maintDuration"
+                    :min="0"
+                    :precision="1"
+                    :step="1"
+                    style="width: 100%"
+                    placeholder="请输入维修时长(小时)" />
+                </el-form-item>
+              </el-col>
+              <el-col :span="12">
+                <el-form-item label="工艺损失" prop="processLoss">
+                  <el-input-number
+                    v-model="processForm.processLoss"
+                    :min="0"
+                    :precision="1"
+                    :step="0.1"
+                    style="width: 100%"
+                    placeholder="请输入工艺损失" />
+                </el-form-item>
+              </el-col>
+            </el-row>
+          </template>
+          <el-form-item label="附件" prop="attachments">
+            <el-input v-model="processForm.attachments" placeholder="请输入附件" />
+          </el-form-item>
+          <el-form-item label="备注" prop="remarks">
+            <el-input v-model="processForm.remarks" type="textarea" :rows="3" placeholder="请输入备注" />
+          </el-form-item>
+        </div>
+      </el-form>
+      <div slot="footer" class="dialog-footer">
+        <el-button type="primary" @click="submitProcessForm">提 交</el-button>
+        <el-button @click="cancelProcess">取 消</el-button>
+      </div>
+    </el-dialog>
+
+
+
+    <!-- 维修计划详情对话框 -->
+    <maint-plan-detail
+      :visible.sync="planDetailVisible"
+      :plan-id="planDetailId"
+      @close="planDetailVisible = false"
+    />
+
+
+  </div>
+</template>
+
+<script>
+import { listMyRel_maint_record, getRel_maint_record, delRel_maint_record, updateRel_maint_record, exportRel_maint_record, importTemplate} from "@/api/reliability/rel_maint_record";
+import { treeselect } from "@/api/system/dept";
+import { getToken } from "@/utils/auth";
+import { listStaffmgrAll } from "@/api/plant/staffmgr";
+import Treeselect from "@riophae/vue-treeselect";
+import "@riophae/vue-treeselect/dist/vue-treeselect.css";
+import MaintPlanDetail from "@/views/reliability/rel_maint_plan/MaintPlanDetail";
+
+export default {
+  name: "MyRecord",
+  components: { Treeselect, MaintPlanDetail },
+  data() {
+    return {
+      // 遮罩层
+      loading: true,
+      // 选中数组
+      ids: [],
+      // 非单个禁用
+      single: true,
+      // 非多个禁用
+      multiple: true,
+      // 显示搜索条件
+      showSearch: false,
+      // 总条数
+      total: 0,
+      // 部件维修记录表格数据
+      rel_maint_recordList: [],
+      // 弹出层标题
+      title: "",
+      // 部门树选项
+      deptOptions: undefined,
+      clientHeight:300,
+      // 是否显示弹出层
+      open: false,
+      // 处理对话框相关
+      processInspectOpen: false, // 检查类型处理对话框
+      processMaintOpen: false, // 维修/更换类型处理对话框
+      processForm: {},
+      processRules: {},
+      // 维修计划详情对话框
+      planDetailVisible: false,
+      planDetailId: null,
+        // 用户导入参数
+        upload: {
+            // 是否显示弹出层(用户导入)
+            open: false,
+            // 弹出层标题(用户导入)
+            title: "",
+            // 是否禁用上传
+            isUploading: false,
+            // 是否更新已经存在的用户数据
+            updateSupport: 0,
+            // 设置上传的请求头部
+            headers: { Authorization: "Bearer " + getToken() },
+            // 上传的地址
+            url: process.env.VUE_APP_BASE_API + "/reliability/rel_maint_record/importData"
+        },
+      // 查询参数
+      queryParams: {
+        pageNum: 1,
+        pageSize: 20,
+        plant: null,
+        devName: null,
+        devTag: null,
+        compoName: null,
+        compoId: null,
+        maintType: null,
+        maintDept: null,
+        inspector: null,
+        inspectContent: null,
+        inspectTime: null,
+        responsible: null,
+        maintContent: null,
+        maintResult: null,
+        maintTime: null,
+        maintCost: null,
+        maintDuration: null,
+        processLoss: null,
+        attachments: null,
+        createrCode: null,
+        createdate: null,
+        updaterCode: null,
+        updatedate: null,
+        deptId: null,
+        remarks: null,
+        recordStatus: null
+      },
+      // 表单参数
+      form: {},
+      // 表单校验
+      rules: {
+      },
+      // 所有人员选项
+      staffOptions: []
+    };
+  },
+  watch: {
+        // 根据名称筛选部门树
+        deptName(val) {
+            this.$refs.tree.filter(val);
+        },
+        // 监听是否需要维修/更换,自动填充负责人
+        'processForm.needMaintOrReplace'(newVal) {
+          if (newVal && this.processForm.compo && this.processForm.compo.fixer) {
+            // 使用部件信息中的维修更换人(fixer)作为负责人
+            this.processForm.newResponsible = this.processForm.compo.fixer;
+          }
+        }
+   },
+  created() {
+      //设置表格高度对应屏幕高度
+      this.$nextTick(() => {
+          this.clientHeight = document.body.clientHeight -250
+      })
+    this.getList();
+    this.getTreeselect();
+    this.getStaffList();
+  },
+  methods: {
+    /** 查询我的维修任务列表 */
+    getList() {
+      this.loading = true;
+      listMyRel_maint_record(this.queryParams).then(response => {
+        this.rel_maint_recordList = response.rows;
+        this.total = response.total;
+        this.loading = false;
+      });
+    },
+     /** 查询部门下拉树结构 */
+     getTreeselect() {
+          treeselect().then(response => {
+              this.deptOptions = response.data;
+          });
+     },
+    /** 查询人员列表 */
+    getStaffList() {
+      listStaffmgrAll().then(response => {
+        this.staffOptions = response.rows || response.data || [];
+      }).catch(error => {
+        console.error('加载人员数据失败:', error);
+      });
+    },
+    /** 根据员工ID获取姓名 */
+    getStaffNameById(staffid) {
+      if (!staffid) return '';
+      const staff = this.staffOptions.find(s => s.staffid === staffid);
+      return staff ? staff.name : '';
+    },
+    /** 获取维修状态文本 */
+    getRecordStatusText(status) {
+      if (status === -1 || status === '-1') return '删除申请中';
+      if (status === 0 || status === '0') return '新增申请中';
+      if (status === 1 || status === '1') return '待完成';
+      if (status === 2 || status === '2') return '已完成';
+      return status != null ? status : '-';
+    },
+    /** 获取维修类型文本 */
+    getMaintTypeText(type) {
+      if (type === '1') return '检查';
+      if (type === '2') return '维修';
+      if (type === '3') return '更换';
+      return type || '-';
+    },
+    /** 获取审批状态文本 */
+    getApprovalStatusText(status) {
+      if (status === '0') return '待审批';
+      if (status === '1') return '已通过';
+      if (status === '-1') return '未通过';
+      return status || '-';
+    },
+    /** 获取完成状态文本 */
+    getCompletionStatusText(status) {
+      if (status === '0') return '未完成';
+      if (status === '1') return '已完成';
+      return status || '-';
+    },
+    /** 处理按钮操作 */
+    handleProcess(row) {
+      this.resetProcessForm();
+      const recordId = row.recordId;
+      getRel_maint_record(recordId).then(response => {
+        this.processForm = response.data;
+        // 初始化新增的字段
+        this.processForm.needMaintOrReplace = false;
+        this.processForm.newMaintType = null;
+        this.processForm.newResponsible = null;
+        this.processForm.cannotMaintOrReplace = false;
+        this.processForm.memoReason = null;
+        this.processForm.memoTime = null;
+        // 将数字字段的 null 值转换为 undefined,并确保是数字类型,以便 el-input-number 正常工作
+        if (this.processForm.maintCost === null || this.processForm.maintCost === '' || this.processForm.maintCost === undefined) {
+          this.processForm.maintCost = undefined;
+        } else {
+          this.processForm.maintCost = Number(this.processForm.maintCost);
+        }
+        if (this.processForm.maintDuration === null || this.processForm.maintDuration === '' || this.processForm.maintDuration === undefined) {
+          this.processForm.maintDuration = undefined;
+        } else {
+          this.processForm.maintDuration = Number(this.processForm.maintDuration);
+        }
+        if (this.processForm.processLoss === null || this.processForm.processLoss === '' || this.processForm.processLoss === undefined) {
+          this.processForm.processLoss = undefined;
+        } else {
+          this.processForm.processLoss = Number(this.processForm.processLoss);
+        }
+        // 根据维修类型打开对应的对话框
+        if (this.processForm.maintType === '1') {
+          this.processInspectOpen = true;
+        } else if (this.processForm.maintType === '2' || this.processForm.maintType === '3') {
+          this.processMaintOpen = true;
+        }
+      });
+    },
+    /** 重置处理表单 */
+    resetProcessForm() {
+      this.processForm = {
+        recordId: null,
+        plant: null,
+        devName: null,
+        devTag: null,
+        compoName: null,
+        maintType: null,
+        responsible: null,
+        inspector: null,
+        inspectTime: null,
+        inspectContent: null,
+        maintDept: null,
+        maintContent: null,
+        maintResult: null,
+        maintTime: null,
+        maintCost: null,
+        maintDuration: null,
+        processLoss: null,
+        attachments: null,
+        remarks: null,
+        needMaintOrReplace: false,
+        newMaintType: null,
+        newResponsible: null,
+        cannotMaintOrReplace: false,
+        memoReason: null,
+        memoTime: null
+      };
+      if (this.$refs.processInspectForm) {
+        this.$refs.processInspectForm.resetFields();
+      }
+      if (this.$refs.processMaintForm) {
+        this.$refs.processMaintForm.resetFields();
+      }
+    },
+    /** 取消处理 */
+    cancelProcess() {
+      this.processInspectOpen = false;
+      this.processMaintOpen = false;
+      this.resetProcessForm();
+    },
+    /** 提交处理表单 */
+    submitProcessForm() {
+      // 根据维修类型动态设置验证规则
+      const rules = {};
+      let formRef = null;
+
+      if (this.processForm.maintType === '1') {
+        // 检查类型:验证检查时间必填
+        rules.inspectTime = [{ required: true, message: "检查时间不能为空", trigger: "change" }];
+        // 如果选择了需要维修/更换,验证维修类型和负责人
+        if (this.processForm.needMaintOrReplace) {
+          rules.newMaintType = [{ required: true, message: "请选择维修类型", trigger: "change" }];
+          rules.newResponsible = [{ required: true, message: "请选择负责人", trigger: "change" }];
+        }
+        formRef = this.$refs.processInspectForm;
+      } else if (this.processForm.maintType === '2' || this.processForm.maintType === '3') {
+        // 维修/更换类型:验证维修时间必填(如果未选择无法维修/更换)
+        if (!this.processForm.cannotMaintOrReplace) {
+          rules.maintTime = [{ required: true, message: "维修时间不能为空", trigger: "change" }];
+        }
+        // 如果选择了无法维修/更换,验证备忘原因和备忘时间
+        if (this.processForm.cannotMaintOrReplace) {
+          rules.memoReason = [{ required: true, message: "备忘原因不能为空", trigger: "change" }];
+          rules.memoTime = [{ required: true, message: "备忘时间不能为空", trigger: "change" }];
+        }
+        formRef = this.$refs.processMaintForm;
+      }
+
+      // 动态添加验证规则
+      Object.keys(rules).forEach(key => {
+        this.processRules[key] = rules[key];
+      });
+
+      if (!formRef) {
+        this.$message.error("无法确定表单引用");
+        return;
+      }
+
+      formRef.validate(valid => {
+        if (valid) {
+          // 更新维修状态为已完成
+          this.processForm.recordStatus = 2;
+          // 将是否需要创建新记录的信息传递给后端
+          updateRel_maint_record(this.processForm).then(response => {
+            // 如果检查任务中选择了需要维修/更换,后端会自动创建新记录
+            if (this.processForm.maintType === '1' && this.processForm.needMaintOrReplace && this.processForm.newMaintType && this.processForm.newResponsible) {
+              this.msgSuccess("处理成功,已创建新的维修/更换任务");
+            } else {
+              this.msgSuccess("处理成功");
+            }
+            this.processInspectOpen = false;
+            this.processMaintOpen = false;
+            this.getList();
+          }).catch(error => {
+            this.msgError("处理失败:" + (error.message || "未知错误"));
+          });
+        }
+      });
+    },
+    // 取消按钮
+    cancel() {
+      this.open = false;
+      this.reset();
+    },
+    // 表单重置
+    reset() {
+      this.form = {
+        recordId: null,
+        plant: null,
+        devName: null,
+        devTag: null,
+        compoName: null,
+        compoId: null,
+        maintType: null,
+        maintDept: null,
+        inspector: null,
+        inspectContent: null,
+        inspectTime: null,
+        responsible: null,
+        maintContent: null,
+        maintResult: null,
+        maintTime: null,
+        maintCost: null,
+        maintDuration: null,
+        processLoss: null,
+        attachments: null,
+        delFlag: null,
+        createrCode: null,
+        createdate: null,
+        updaterCode: null,
+        updatedate: null,
+        deptId: null,
+        remarks: null,
+        recordStatus: null
+      };
+      this.resetForm("form");
+    },
+    /** 搜索按钮操作 */
+    handleQuery() {
+      this.queryParams.pageNum = 1;
+      this.getList();
+    },
+    /** 重置按钮操作 */
+    resetQuery() {
+      this.resetForm("queryForm");
+      this.handleQuery();
+    },
+    // 多选框选中数据
+    handleSelectionChange(selection) {
+      this.ids = selection.map(item => item.recordId)
+      this.single = selection.length!==1
+      this.multiple = !selection.length
+    },
+    /** 新增按钮操作 */
+    handleAdd() {
+      this.reset();
+      this.open = true;
+      this.title = "添加部件维修记录";
+    },
+    /** 修改按钮操作 */
+    handleUpdate(row) {
+      this.reset();
+      const recordId = row.recordId || this.ids
+      getRel_maint_record(recordId).then(response => {
+        this.form = response.data;
+        this.open = true;
+        this.title = "修改部件维修记录";
+      });
+    },
+    /** 提交按钮 */
+    submitForm() {
+      this.$refs["form"].validate(valid => {
+        if (valid) {
+          if (this.form.recordId != null) {
+            updateRel_maint_record(this.form).then(response => {
+              this.msgSuccess("修改成功");
+              this.open = false;
+              this.getList();
+            });
+          } else {
+            addRel_maint_record(this.form).then(response => {
+              this.msgSuccess("新增成功");
+              this.open = false;
+              this.getList();
+            });
+          }
+        }
+      });
+    },
+    /** 删除按钮操作 */
+    handleDelete(row) {
+      const recordIds = row.recordId || this.ids;
+      this.$confirm('是否确认删除?', "警告", {
+          confirmButtonText: "确定",
+          cancelButtonText: "取消",
+          type: "warning"
+        }).then(function() {
+          return delRel_maint_record(recordIds);
+        }).then(() => {
+          this.getList();
+          this.msgSuccess("删除成功");
+        })
+    },
+    /** 导出按钮操作 */
+    handleExport() {
+      const queryParams = this.queryParams;
+      this.$confirm('是否确认导出所有部件维修记录数据项?', "警告", {
+          confirmButtonText: "确定",
+          cancelButtonText: "取消",
+          type: "warning"
+        }).then(function() {
+          return exportRel_maint_record(queryParams);
+        }).then(response => {
+          this.download(response.msg);
+        })
+    },
+      /** 导入按钮操作 */
+      handleImport() {
+          this.upload.title = "用户导入";
+          this.upload.open = true;
+      },
+      /** 下载模板操作 */
+      importTemplate() {
+          importTemplate().then(response => {
+              this.download(response.msg);
+          });
+      },
+      // 文件上传中处理
+      handleFileUploadProgress(event, file, fileList) {
+          this.upload.isUploading = true;
+      },
+      // 文件上传成功处理
+      handleFileSuccess(response, file, fileList) {
+          this.upload.open = false;
+          this.upload.isUploading = false;
+          this.$refs.upload.clearFiles();
+          this.$alert(response.msg, "导入结果", { dangerouslyUseHTMLString: true });
+          this.getList();
+      },
+      // 提交上传文件
+      submitFileForm() {
+          this.$refs.upload.submit();
+      },
+    /** 查看维修计划详情 */
+    handleViewPlan(planId) {
+      this.planDetailId = planId;
+      this.planDetailVisible = true;
+    }
+  }
+};
+</script>
+
+<style scoped>
+.info-section {
+  margin-bottom: 20px;
+  margin-top: 0;
+}
+
+::v-deep .el-dialog__body {
+  padding-top: 15px;
+}
+
+::v-deep .el-form {
+  padding-top: 0;
+}
+</style>