提交
This commit is contained in:
1 parent
6b6c80f182
commit
86450f38a1
53 files changed
+20800
-5339
No files matched your search
@@ -385,6 +385,26 @@ export interface PlanCreateFullPayload {
|
||||
|
||||
export type PlanUpdatePayload = Partial<Omit<PlanCreateFullPayload, 'contractId'>>
|
||||
|
||||
export interface PlanArchiveProductItem {
|
||||
id: string
|
||||
actualQty: number
|
||||
}
|
||||
|
||||
export interface PlanArchiveFreightBlock {
|
||||
hasFreight: number
|
||||
distanceKm?: number
|
||||
freightType?: string
|
||||
freightPrice?: number
|
||||
freightAmount?: number
|
||||
transportQty?: number
|
||||
hasInvoice?: number
|
||||
}
|
||||
|
||||
export interface PlanArchiveBody {
|
||||
products: PlanArchiveProductItem[]
|
||||
freight?: PlanArchiveFreightBlock
|
||||
}
|
||||
|
||||
export const planApi = {
|
||||
list: (params?: PlanQuery) => request.get<PlanListResponse>('/transport/plan/', { params }),
|
||||
get: (id: string) => request.get<Plan>(`/transport/plan/${id}`),
|
||||
@@ -401,7 +421,8 @@ export const planApi = {
|
||||
) => request.patch<Plan>(`/transport/plan/${id}/product-certs`, { products }),
|
||||
cancel: (id: string) => request.post<Plan>(`/transport/plan/${id}/cancel`),
|
||||
getArrangeInfo: (id: string) => request.get<PlanArrangeInfo>(`/transport/plan/${id}/arrange-info`),
|
||||
archive: (id: string) => request.post<Plan>(`/transport/plan/${id}/archive`),
|
||||
archive: (id: string, data?: PlanArchiveBody) =>
|
||||
request.post<Plan>(`/transport/plan/${id}/archive`, data),
|
||||
delete: (id: string) => request.delete(`/transport/plan/${id}`),
|
||||
createFromContract: (data: { contractId: string; planDate: string; followUserId?: string; followUserName?: string }) =>
|
||||
request.post<Plan>('/transport/plan/create-from-contract', data)
|
||||
@@ -539,6 +560,63 @@ export const transportApi = {
|
||||
// 运费结算 API
|
||||
// =============================================================================
|
||||
|
||||
export interface UnsettledPlanItem {
|
||||
id: string
|
||||
planNo: string
|
||||
planDate: string
|
||||
planType: string
|
||||
customerName?: string
|
||||
supplierName?: string
|
||||
licensePlate?: string
|
||||
transportCompany?: string
|
||||
freightAmount: number
|
||||
archiveTime?: string
|
||||
}
|
||||
|
||||
export interface UnsettledPlanQuery {
|
||||
q?: string
|
||||
planType?: string
|
||||
licensePlate?: string
|
||||
page?: number
|
||||
pageSize?: number
|
||||
}
|
||||
|
||||
export interface UnsettledPlanListResponse {
|
||||
total: number
|
||||
list: UnsettledPlanItem[]
|
||||
}
|
||||
|
||||
export interface SettlementPlanSummary {
|
||||
id: string
|
||||
planNo: string
|
||||
planDate?: string
|
||||
licensePlate?: string
|
||||
freightAmount?: number
|
||||
}
|
||||
|
||||
export interface SettlementApprovalFlowItem {
|
||||
id: string
|
||||
step: number
|
||||
stepName?: string
|
||||
approverId: string
|
||||
approverName?: string
|
||||
approvalType?: string
|
||||
approvalResult: string
|
||||
approvalOpinion?: string
|
||||
approvalTime?: string
|
||||
isCurrent: number
|
||||
}
|
||||
|
||||
export interface RemittanceVoucher {
|
||||
id: string
|
||||
settlementId: string
|
||||
remittanceDate?: string
|
||||
remittanceAmount?: number
|
||||
voucherUrls?: string
|
||||
remark?: string
|
||||
createTime?: string
|
||||
}
|
||||
|
||||
export interface FreightSettlement {
|
||||
id: string
|
||||
settlementNo: string
|
||||
@@ -548,13 +626,29 @@ export interface FreightSettlement {
|
||||
invoiceDate?: string
|
||||
settlementStatus: string
|
||||
remark?: string
|
||||
createBy?: string
|
||||
createTime: string
|
||||
updateTime?: string
|
||||
planCount?: number
|
||||
licensePlateSummary?: string
|
||||
currentApproverName?: string
|
||||
canApprove?: boolean
|
||||
canWithdraw?: boolean
|
||||
currentApprovalId?: string
|
||||
approvalFinishedTime?: string
|
||||
disburseTime?: string
|
||||
disburseAmount?: number
|
||||
submitterName?: string
|
||||
transports?: Transport[]
|
||||
plans?: SettlementPlanSummary[]
|
||||
approvalFlow?: SettlementApprovalFlowItem[]
|
||||
vouchers?: RemittanceVoucher[]
|
||||
}
|
||||
|
||||
export interface FreightSettlementQuery {
|
||||
q?: string
|
||||
settlementStatus?: string
|
||||
tab?: 'bills' | 'disburse' | 'settled'
|
||||
page?: number
|
||||
pageSize?: number
|
||||
}
|
||||
@@ -564,15 +658,48 @@ export interface FreightSettlementListResponse {
|
||||
list: FreightSettlement[]
|
||||
}
|
||||
|
||||
export interface FreightSettlementSubmitBody {
|
||||
approvalType: 'sequential' | 'parallel' | 'or'
|
||||
approverIds: string[]
|
||||
remark?: string
|
||||
}
|
||||
|
||||
export interface FreightSettlementApprovalBody {
|
||||
action: 'approve' | 'reject'
|
||||
comment?: string
|
||||
}
|
||||
|
||||
export interface FreightSettlementDisburseBody {
|
||||
remittanceDate: string
|
||||
remittanceAmount: number
|
||||
voucherUrls: string[]
|
||||
remark?: string
|
||||
}
|
||||
|
||||
export const freightApi = {
|
||||
listUnsettledPlans: (params?: UnsettledPlanQuery) =>
|
||||
request.get<UnsettledPlanListResponse>('/transport/freight/unsettled-plans', { params }),
|
||||
list: (params?: FreightSettlementQuery) =>
|
||||
request.get<FreightSettlementListResponse>('/transport/freight/', { params }),
|
||||
get: (id: string) => request.get<FreightSettlement>(`/transport/freight/${id}`),
|
||||
create: (transportIds: string[]) =>
|
||||
request.post<FreightSettlement>('/transport/freight/', { transportIds }),
|
||||
create: (data: { planIds?: string[]; transportIds?: string[] }) =>
|
||||
request.post<FreightSettlement>('/transport/freight/', data),
|
||||
update: (id: string, data: Partial<FreightSettlement>) =>
|
||||
request.put<FreightSettlement>(`/transport/freight/${id}`, data),
|
||||
delete: (id: string) => request.delete(`/transport/freight/${id}`),
|
||||
submitApproval: (id: string, data: FreightSettlementSubmitBody) =>
|
||||
request.post<FreightSettlement>(`/transport/freight/${id}/submit-approval`, data),
|
||||
processApproval: (approvalId: string, data: FreightSettlementApprovalBody) =>
|
||||
request.post<FreightSettlement>(`/transport/freight/approval/${approvalId}`, data),
|
||||
withdrawApproval: (id: string) =>
|
||||
request.post<FreightSettlement>(`/transport/freight/${id}/withdraw-approval`),
|
||||
getApprovalFlow: (id: string) =>
|
||||
request.get<SettlementApprovalFlowItem[]>(`/transport/freight/${id}/approval-flow`),
|
||||
disburse: (id: string, data: FreightSettlementDisburseBody) =>
|
||||
request.post<FreightSettlement>(`/transport/freight/${id}/disburse`, data),
|
||||
/** @deprecated 请使用 submitApproval */
|
||||
submit: (id: string) => request.post<FreightSettlement>(`/transport/freight/${id}/submit`),
|
||||
/** @deprecated 请使用 processApproval */
|
||||
approve: (id: string) => request.post<FreightSettlement>(`/transport/freight/${id}/approve`)
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user