Files
tms-erp-web/src/option/transit/exception-disposal.js
T
weicw-dshsa d0770c8e83 🎨 详情弹窗按运单/异常拆成两块并统一成描述列表
原「异常信息」一块混了运单字段与上报字段,且用的是 dl/dt/dd 自定义栅格。
现拆成「运单信息」与「异常信息」两个 section-card,都用 el-descriptions,
与编辑弹窗的分区口径和视觉一致。

拆出的两个字段配置与编辑弹窗同源同序,只读展示;原 detailFields 的十个字段
一个不少。同时删掉因此不再使用的 __detail-grid 样式与它的响应式断点。

原先这些字段带 link: true,渲染成 el-link 但没有任何点击行为,
看着可点却没反应,一并去掉。
2026-10-05 08:18:02 +08:00

131 lines
5.5 KiB
JavaScript

// 一级 value 与二级 value 都用中文原文:库里 exception_type 存的是大类中文名、
// exception_reason 存子类中文名(小程序上报即如此),此处必须与之一致,
// 否则按异常类型做精确匹配的查询会一行都查不到。
export const exceptionCategoryOptions = [
{
label: '交通异常',
value: '交通异常',
children: [
{ label: '道路拥堵', value: '道路拥堵' },
{ label: '交通事故', value: '交通事故' },
{ label: '道路封闭', value: '道路封闭' },
{ label: '天气影响', value: '天气影响' },
{ label: '其他', value: '交通异常-其他' },
],
},
{
label: '车辆异常',
value: '车辆异常',
children: [
{ label: '车辆故障维修', value: '车辆故障维修' },
{ label: '车辆事故', value: '车辆事故' },
{ label: '爆胎', value: '爆胎' },
{ label: '设备异常', value: '设备异常' },
{ label: '缺油缺电', value: '缺油缺电' },
{ label: '其他', value: '车辆异常-其他' },
],
},
{
label: '货物异常',
value: '货物异常',
children: [
{ label: '货损', value: '货损' },
{ label: '货差', value: '货差' },
{ label: '货物丢失', value: '货物丢失' },
{ label: '包装异常', value: '包装异常' },
{ label: '其他', value: '货物异常-其他' },
],
},
{
label: '其他异常',
value: '其他异常',
children: [
{ label: '变更路线地址', value: '变更路线地址' },
{ label: '其他', value: '其他异常-其他' },
],
},
];
/** 一级类型的中文名列表,供编辑表单的级联选择使用 */
export const exceptionTypeOptions = exceptionCategoryOptions.map(item => ({
label: item.label,
value: item.value,
}));
/** 按一级类型取二级选项 */
export const exceptionReasonOptions = typeValue =>
exceptionCategoryOptions.find(item => item.value === typeValue)?.children || [];
export const disposalStatusOptions = [
{ label: '待处理', value: 'pending' },
{ label: '处理中', value: 'processing' },
{ label: '已完成', value: 'completed' },
];
export const searchFields = [
{ label: '运单号', prop: 'waybillNo', type: 'input' },
{ label: '车辆', prop: 'vehicleNo', type: 'input' },
{ label: '上报人', prop: 'reporterName', type: 'input' },
{ label: '上报时间', prop: 'reportTimeRange', type: 'daterange' },
{ label: '项目', prop: 'projectName', type: 'input' },
{ label: '承运商', prop: 'carrierName', type: 'input' },
{ label: '异常类型', prop: 'exceptionType', type: 'select', options: exceptionCategoryOptions },
{ label: '状态', prop: 'disposalStatus', type: 'select', options: disposalStatusOptions },
];
export const tableColumns = [
{ label: '运单号', prop: 'waybillNo', minWidth: 160, link: true },
{ label: '项目', prop: 'projectName', minWidth: 160 },
{ label: '车辆', prop: 'vehicleNo', minWidth: 150, link: true },
{ label: '上报人', prop: 'reporterName', minWidth: 120 },
{ label: '上报时间', prop: 'reportTime', minWidth: 170 },
{ label: '异常类型', prop: 'exceptionTypeName', minWidth: 160 },
{ label: '上报说明', prop: 'reportDescription', minWidth: 180 },
{ label: '承运商', prop: 'carrierName', minWidth: 160 },
{ label: '最新跟进说明', prop: 'latestFollowContent', minWidth: 200 },
{ label: '状态', prop: 'disposalStatusName', minWidth: 120 },
];
// 详情/跟进弹窗的只读信息,按来源分两块:
// 「运单信息」是上报时从运单复制的字段,「异常信息」是司机上报的内容。
// 与编辑弹窗的分区口径一致,改动时两处要一起改。
export const detailWaybillFields = [
{ label: '运单号', prop: 'waybillNo' },
{ label: '配载单号/总单号', prop: 'loadingOrMasterNo' },
{ label: '车牌号', prop: 'vehicleNo' },
{ label: '项目', prop: 'projectName' },
{ label: '承运商', prop: 'carrierName' },
];
export const detailExceptionFields = [
{ label: '上报人', prop: 'reporterName' },
{ label: '上报时间', prop: 'reportTime' },
{ label: '异常类型', prop: 'exceptionTypeName' },
{ label: '异常原因', prop: 'exceptionReason' },
{ label: '上报说明', prop: 'reportDescription', span: 2 },
];
export const followColumns = [
{ label: '跟进说明', prop: 'followContent', minWidth: 260 },
{ label: '跟进人', prop: 'followUserName', minWidth: 130 },
{ label: '跟进时间', prop: 'followTime', minWidth: 170 },
];
// 编辑表单只开放上报四件套。车牌、项目、承运商、配载单号由上报时从运单回填,
// 允许手改会让记录与运单脱钩;处置状态由跟进与完成流转,不在此处。
export const editFormFields = [
{ label: '异常类型', prop: 'exceptionType', type: 'select', required: true },
{ label: '异常原因', prop: 'exceptionReason', type: 'select' },
{ label: '上报说明', prop: 'reportDescription', type: 'textarea', required: true, span: 2 },
];
// 编辑弹窗顶部的运单信息,只读展示,帮助运管员确认改的是哪一单。
// 上报人与上报时间属上报行为,放在「异常信息」里,不在此处重复。
export const editWaybillFields = [
{ label: '运单号', prop: 'waybillNo' },
{ label: '配载单号/总单号', prop: 'loadingOrMasterNo' },
{ label: '车牌号', prop: 'vehicleNo' },
{ label: '项目', prop: 'projectName' },
{ label: '承运商', prop: 'carrierName' },
];