From 6411cb7b5a295213e6bfdc5f915c3e130315abaa Mon Sep 17 00:00:00 2001 From: API Changelog Bot Date: Sun, 22 Mar 2026 23:29:06 +0800 Subject: [PATCH] =?UTF-8?q?changelog:=20=E9=85=8D=E8=BD=A6=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3vehicleModel/vehicleBrand=E5=BF=85=E4=BC=A0=E8=AF=B4?= =?UTF-8?q?=E6=98=8E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 前端选车型下拉时需把vehicleModel和vehicleBrand一起传,不能只传ID。 Co-Authored-By: Claude Opus 4.6 (1M context) --- .../2026-03-22_vehicle_assignment_fields.md | 29 +++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 changelogs/2026-03/2026-03-22_vehicle_assignment_fields.md diff --git a/changelogs/2026-03/2026-03-22_vehicle_assignment_fields.md b/changelogs/2026-03/2026-03-22_vehicle_assignment_fields.md new file mode 100644 index 0000000..7afcdf4 --- /dev/null +++ b/changelogs/2026-03/2026-03-22_vehicle_assignment_fields.md @@ -0,0 +1,29 @@ +# 配车接口字段说明 + +**日期**: 2026-03-22 +**接口**: `PUT /admin/order/{orderId}/vehicle-assignment` +**问题**: 前端报错 "vehicleModel: 车型不能为空; vehicleBrand: 品牌不能为空" + +--- + +## 原因 + +前端选择了车型下拉(选到了车型ID),但提交时没有传 `vehicleModel` 和 `vehicleBrand` 字段。 + +## 请求体必传字段 + +```json +{ + "vehicleModel": "小蒙马车(5座)", // 必填:车型名称(从车辆列表选中项中取) + "vehicleBrand": "蒙古马", // 必填:品牌(从车辆列表选中项中取) + "plateNumber": "222", // 选填:车牌号 + "driverName": "2222", // 选填:司机姓名 + "driverPhone": "22222" // 选填:司机电话 +} +``` + +## 前端处理方式 + +选择车型下拉时,从选中的车辆数据中取出 `vehicleModel`(车型名称)和 `vehicleBrand`(品牌),一起放到提交的请求体中。不能只传车型ID。 + +车辆列表接口 `GET /admin/order/{orderId}/available-vehicles` 返回的每项数据都包含 `vehicleModel` 和 `vehicleBrand` 字段。