feat(frontend): add inspection/replacement APIs and shared InspectionForm component
- Create inspection.ts with template CRUD and record APIs - Create vehicle-replacement.ts with full CRUD + BPM approval APIs - Update return-order.ts with new fields and 5 new endpoints - Create shared InspectionForm.vue component with category grouping, multi-input-type rendering, auto-save, and image upload - Update barrel exports in index.ts Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
82
apps/web-antd/src/api/asset/vehicle-replacement.ts
Normal file
82
apps/web-antd/src/api/asset/vehicle-replacement.ts
Normal file
@@ -0,0 +1,82 @@
|
||||
import type { PageParam, PageResult } from '@vben/request';
|
||||
|
||||
import { requestClient } from '#/api/request';
|
||||
|
||||
export namespace AssetVehicleReplacementApi {
|
||||
export interface VehicleReplacement {
|
||||
id?: number;
|
||||
replacementCode?: string;
|
||||
replacementType: number;
|
||||
contractId?: number;
|
||||
contractCode?: string;
|
||||
projectName?: string;
|
||||
customerId?: number;
|
||||
customerName?: string;
|
||||
originalVehicleId?: number;
|
||||
originalPlateNo?: string;
|
||||
originalVin?: string;
|
||||
newVehicleId?: number;
|
||||
newPlateNo?: string;
|
||||
newVin?: string;
|
||||
deliveryOrderId?: number;
|
||||
replacementReason?: string;
|
||||
expectedDate?: string;
|
||||
actualDate?: string;
|
||||
returnDate?: string;
|
||||
status?: number;
|
||||
approvalStatus?: number;
|
||||
bpmInstanceId?: string;
|
||||
remark?: string;
|
||||
creator?: string;
|
||||
createTime?: Date;
|
||||
}
|
||||
}
|
||||
|
||||
export function getVehicleReplacementPage(params: PageParam) {
|
||||
return requestClient.get<
|
||||
PageResult<AssetVehicleReplacementApi.VehicleReplacement>
|
||||
>('/asset/vehicle-replacement/page', { params });
|
||||
}
|
||||
|
||||
export function getVehicleReplacement(id: number) {
|
||||
return requestClient.get<AssetVehicleReplacementApi.VehicleReplacement>(
|
||||
`/asset/vehicle-replacement/get?id=${id}`,
|
||||
);
|
||||
}
|
||||
|
||||
export function createVehicleReplacement(
|
||||
data: AssetVehicleReplacementApi.VehicleReplacement,
|
||||
) {
|
||||
return requestClient.post('/asset/vehicle-replacement/create', data);
|
||||
}
|
||||
|
||||
export function updateVehicleReplacement(
|
||||
data: AssetVehicleReplacementApi.VehicleReplacement,
|
||||
) {
|
||||
return requestClient.put('/asset/vehicle-replacement/update', data);
|
||||
}
|
||||
|
||||
export function deleteVehicleReplacement(id: number) {
|
||||
return requestClient.delete(`/asset/vehicle-replacement/delete?id=${id}`);
|
||||
}
|
||||
|
||||
export function submitVehicleReplacementApproval(id: number) {
|
||||
return requestClient.post(
|
||||
`/asset/vehicle-replacement/submit-approval?id=${id}`,
|
||||
{},
|
||||
);
|
||||
}
|
||||
|
||||
export function withdrawVehicleReplacementApproval(id: number) {
|
||||
return requestClient.post(
|
||||
`/asset/vehicle-replacement/withdraw-approval?id=${id}`,
|
||||
{},
|
||||
);
|
||||
}
|
||||
|
||||
export function confirmVehicleReplacementReturn(id: number) {
|
||||
return requestClient.post(
|
||||
`/asset/vehicle-replacement/confirm-return?id=${id}`,
|
||||
{},
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user