feat: add vehicle recharge approval workflow and pending UI
Wire configurable workflow config, approval todo with approve/reject/disburse, apply submit and history, and block disburse board for in-approval rows. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
1 parent
a1fbbac370
commit
7b99040f9c
9 files changed
+1166
-9
No files matched your search
@@ -1687,6 +1687,19 @@ export const menuBadgeApi = {
|
||||
// ETC/加油充值 API
|
||||
// =============================================================================
|
||||
|
||||
export interface VehicleRechargeApproval {
|
||||
id: string
|
||||
applyId: string
|
||||
approvalRound: number
|
||||
nodeId?: string
|
||||
nodeName?: string
|
||||
approverId: string
|
||||
approverName: string
|
||||
approvalStatus: 'approved' | 'rejected' | 'disbursed' | string
|
||||
approvalOpinion?: string
|
||||
approvalTime: string
|
||||
}
|
||||
|
||||
export interface VehicleRechargeApply {
|
||||
id: string
|
||||
applyNo: string
|
||||
@@ -1697,7 +1710,14 @@ export interface VehicleRechargeApply {
|
||||
attachmentUrls?: string
|
||||
applicantId: string
|
||||
applicantName?: string
|
||||
status: 'pending' | 'disbursed' | 'cancelled'
|
||||
status: 'draft' | 'pending' | 'in_approval' | 'rejected' | 'disbursed' | 'cancelled' | string
|
||||
wfId?: string
|
||||
currentNode?: string
|
||||
currentNodeName?: string
|
||||
currentNodeActionType?: 'approve' | 'disburse' | string
|
||||
approvalRound?: number
|
||||
approvals?: VehicleRechargeApproval[]
|
||||
record?: VehicleRechargeRecord | null
|
||||
remark?: string
|
||||
createTime?: string
|
||||
updateTime?: string
|
||||
@@ -1751,7 +1771,7 @@ export interface VehicleRechargeDisburseBoardItem {
|
||||
applyDate: string
|
||||
odometerKm?: number | null
|
||||
applicantName?: string
|
||||
applyStatus: 'pending' | 'disbursed' | 'cancelled'
|
||||
applyStatus: 'draft' | 'pending' | 'in_approval' | 'rejected' | 'disbursed' | 'cancelled' | string
|
||||
applyRemark?: string
|
||||
recordId?: string
|
||||
rechargeOrderNo?: string
|
||||
@@ -1780,6 +1800,8 @@ export const vehicleRechargeApplyApi = {
|
||||
request.post<VehicleRechargeApply>('/transport/vehicle-recharge-apply/', data),
|
||||
update: (id: string, data: Partial<VehicleRechargeApply>) =>
|
||||
request.put<VehicleRechargeApply>(`/transport/vehicle-recharge-apply/${id}`, data),
|
||||
submit: (id: string) =>
|
||||
request.post<VehicleRechargeApply>(`/transport/vehicle-recharge-apply/${id}/submit`),
|
||||
cancel: (id: string) =>
|
||||
request.post<VehicleRechargeApply>(`/transport/vehicle-recharge-apply/${id}/cancel`),
|
||||
delete: (ids: string) => request.delete(`/transport/vehicle-recharge-apply/${ids}`),
|
||||
@@ -1787,6 +1809,26 @@ export const vehicleRechargeApplyApi = {
|
||||
request.get<VehicleRechargeApplyOption[]>('/transport/vehicle-recharge-apply/pending-options')
|
||||
}
|
||||
|
||||
export const vehicleRechargeApprovalApi = {
|
||||
pending: (params?: Record<string, unknown>) =>
|
||||
request.get<VehicleRechargeApplyListResponse>('/transport/vehicle-recharge-approval/pending', {
|
||||
params
|
||||
}),
|
||||
done: (params?: Record<string, unknown>) =>
|
||||
request.get<VehicleRechargeApplyListResponse>('/transport/vehicle-recharge-approval/done', {
|
||||
params
|
||||
}),
|
||||
approve: (id: string, data?: { opinion?: string }) =>
|
||||
request.post<VehicleRechargeApply>(
|
||||
`/transport/vehicle-recharge-approval/${id}/approve`,
|
||||
data || {}
|
||||
),
|
||||
reject: (id: string, data: { opinion?: string }) =>
|
||||
request.post<VehicleRechargeApply>(`/transport/vehicle-recharge-approval/${id}/reject`, data),
|
||||
disburse: (id: string, data: Partial<VehicleRechargeRecord>) =>
|
||||
request.post<VehicleRechargeApply>(`/transport/vehicle-recharge-approval/${id}/disburse`, data)
|
||||
}
|
||||
|
||||
export const vehicleRechargeRecordApi = {
|
||||
disburseBoard: (params?: Record<string, unknown>) =>
|
||||
request.get<VehicleRechargeDisburseBoardListResponse>(
|
||||
|
||||
Reference in new issue
Block a user