Files
shanxia2.0/docs/superpowers/specs/2026-09-08-pl-date-column-sort-design.md
T

39 lines
2.4 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# 运输管理日期列头双三角排序(方案 A)
**日期**:2026-09-08
**状态**:已确认
**对齐**:CRM / 报销 / 地磅日期列排序设计
**交互**:`docs/crm-date-column-sort-demo.html`(双三角)
---
## 1. 目标
仅为运输管理下**已有 `ColumnHeaderFilter` 且 `type==='datetime'`** 的列增加双三角整库排序;参数与交互同 CRM(`sortField`/`sortOrder`,同向再点取消,空值升序前/降序后)。
## 2. 范围(方案 A)
| 菜单 | 前端 | 日期列 | 后端映射 |
|------|------|--------|---------|
| 运输计划 | `views/pl/plan/index.vue` | `planDate` | `PlPlan.plan_date` |
| 运输计划归档 | `views/pl/plan-archive/index.vue` | `planDate` | 同上(`planApi.list`) |
| 危化品证上传 | `views/pl/plan-cert/index.vue` | `planDate` | 同上 |
| 运输计划合同完善 | `views/pl/plan-contract/index.vue` | `planDate` | `list_plan_contract_gaps` → `PlPlan.plan_date` |
| 证件提醒 | `views/pl/inventory/document-reminder.vue` | `expireDate` | `PlDocumentReminder.expire_date`(默认仍 `expire_date ASC`) |
| ETC加油申请 | `views/pl/vehicle-recharge-apply/index.vue` | `applyDate` | `PlVehicleRechargeApply.apply_date` |
| ETC加油发放登记 | `views/pl/vehicle-recharge-record/index.vue` | `applyDate`、`rechargeDate` | apply / record 列(disburse-board) |
| 车辆维保申请 | `views/pl/vehicle-maintenance-apply/index.vue` | `applyDate` | `PlVehicleMaintenanceApply.apply_date` |
| 车辆维保处理登记 | `views/pl/vehicle-maintenance-process/index.vue` | `applyDate`、`processDate` | apply / process(process-board) |
**本批跳过**:入库单、出库单、运费结算/审批/发放、承运商、三方/自有车辆与驾押、运输地址库等无 datetime 漏斗页。
## 3. 架构
- 前端:已有 `ColumnHeaderFilter` inject;各页 `useColumnSort` + `provide('crmColumnSort')`;查询/导出合并 `toSortQueryParams()`;藏列清排序。
- 后端:`app/services/pl/list_sort.py` 封装白名单 + `parse_sort_params`;复用 `resolve_datetime_order_by`。
- 默认序:无合法 sort 时保持现网(计划类多为 `create_time DESC`;合同缺口 `plan_date DESC`;证件提醒 `expire_date ASC`;维保/ETC 申请与 board 为 `create_time DESC`)。
## 4. 验收
各范围内页日期列有双三角;升/降/取消正确;导出与列表一致;跳过页无三角。