diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/tyre/BaseCarController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/tyre/BaseCarController.java index 299722a8..f9513e6d 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/tyre/BaseCarController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/tyre/BaseCarController.java @@ -1,6 +1,7 @@ package com.ruoyi.web.controller.tyre; import java.util.List; +import java.util.Map; import com.ruoyi.common.utils.ShiroUtils; import org.apache.shiro.authz.annotation.RequiresPermissions; @@ -13,7 +14,6 @@ import com.ruoyi.common.annotation.Log; import com.ruoyi.common.enums.BusinessType; import com.ruoyi.system.domain.BaseCar; import com.ruoyi.system.domain.CarCheckLifecycleDTO; -import com.ruoyi.system.domain.CarLatestMaintenanceDTO; import com.ruoyi.system.domain.CarLifecycleDTO; import com.ruoyi.system.domain.CarLifecycleQuery; import com.ruoyi.system.domain.CarMileageLifecycleDTO; @@ -206,14 +206,14 @@ public class BaseCarController extends BaseController } /** - * 查询车辆最近一次维保前后对比。 + * 查询车辆轮位最新维护数据。 */ @RequiresPermissions("system:car:view") @GetMapping("/lifecycle/{carNo}/latest-maintenance") @ResponseBody public AjaxResult latestMaintenance(@PathVariable("carNo") String carNo) { - CarLatestMaintenanceDTO latestMaintenance = baseCarLifecycleService.selectLatestMaintenance(buildLifecycleQuery(carNo)); + List latestMaintenance = baseCarLifecycleService.selectLatestWheelPositionMaintenance(buildLifecycleQuery(carNo)); return AjaxResult.success(latestMaintenance); } diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/tyre/BaseTyreController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/tyre/BaseTyreController.java index 84136f6a..07a036e8 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/tyre/BaseTyreController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/tyre/BaseTyreController.java @@ -406,8 +406,8 @@ public class BaseTyreController extends BaseController return "error/404"; } - // 与 PDA 时间线接口保持同一个 service 返回结构;列表页传 tyreId,PDA 仍可传 keyParam。 - Map resultMap = baseTyreService.pdaQueryTyreTimeLine(baseTyre); + // Web 详情抽屉在 PDA 原时间线外补充里程/花纹统计,避免改动老 PDA 接口返回契约。 + Map resultMap = baseTyreService.selectTyreDetailForWeb(baseTyre); if (resultMap == null || resultMap.isEmpty()) { return "error/404"; } diff --git a/ruoyi-admin/src/main/resources/templates/tyre/car/car.html b/ruoyi-admin/src/main/resources/templates/tyre/car/car.html index 801f4f6b..dd081d9d 100644 --- a/ruoyi-admin/src/main/resources/templates/tyre/car/car.html +++ b/ruoyi-admin/src/main/resources/templates/tyre/car/car.html @@ -152,7 +152,7 @@
-
车辆全生命周期
+
车辆详情
@@ -234,7 +234,7 @@ $.modal.alertWarning("车牌号为空,无法查看生命周期报表"); return; } - $("#lifecycleDrawerTitle").text("车辆全生命周期 - " + carNo); + $("#lifecycleDrawerTitle").text("车辆详情 - " + carNo); $("#lifecycleFrame").attr("src", prefix + "/lifecycle/view/" + encodeURIComponent(carNo)); $("#lifecycleDrawerMask").show(); $("#lifecycleDrawer").addClass("open"); @@ -247,6 +247,28 @@ $("#lifecycleFrame").attr("src", "about:blank"); } + function openMaintenanceOrderDetailTabFromLifecycle(orderId, orderNo) { + var normalizedOrderId = $.common.nullToStr(orderId); + if (!/^\d+$/.test(normalizedOrderId)) { + // 子 iframe 传来的主键只作为导航参数使用,父页再校验一次避免拼接异常详情地址。 + $.modal.alertWarning("工单ID无效,无法打开维保工单详情"); + return; + } + var tabTitle = buildMaintenanceOrderDetailTitle(orderNo); + // 页签必须由车辆列表所在主 iframe 发起,RuoYi 才能把详情页挂到后台主框架,而不是抽屉 iframe 内部。 + $.modal.openTab(tabTitle, ctx + "tyre/order/edit/" + encodeURIComponent(normalizedOrderId)); + closeLifecycleDrawer(); + } + + function buildMaintenanceOrderDetailTitle(orderNo) { + var text = $.common.nullToStr(orderNo); + if (!text || text === "-") { + return "维保工单详情"; + } + // 页签标题不承载 HTML,去掉尖括号可避免异常工单号影响主框架页签 DOM。 + return "维保工单详情 - " + text.replace(/[<>]/g, ""); + } + function escapeHtml(value) { return String(value) .replace(/&/g, "&") diff --git a/ruoyi-admin/src/main/resources/templates/tyre/car/lifecycle.html b/ruoyi-admin/src/main/resources/templates/tyre/car/lifecycle.html index 991706b7..3e19bbce 100644 --- a/ruoyi-admin/src/main/resources/templates/tyre/car/lifecycle.html +++ b/ruoyi-admin/src/main/resources/templates/tyre/car/lifecycle.html @@ -1,7 +1,7 @@ - +