33 lines
833 B
TypeScript
33 lines
833 B
TypeScript
import { http } from '@/utils/request'
|
|
import type { Report, ReportForm, ReportAuditForm, PageQuery, PageResult } from '@/types'
|
|
|
|
// 分页查询报备
|
|
export const getReportPage = (params: PageQuery & {
|
|
dealerId?: number
|
|
dealerName?: string
|
|
customerName?: string
|
|
status?: number
|
|
}) => {
|
|
return http.get<PageResult<Report>>('/report/page', { params })
|
|
}
|
|
|
|
// 根据ID获取报备详情
|
|
export const getReportById = (id: number) => {
|
|
return http.get<Report>(`/report/${id}`)
|
|
}
|
|
|
|
// 创建报备
|
|
export const createReport = (data: ReportForm) => {
|
|
return http.post('/report', data)
|
|
}
|
|
|
|
// 审核报备
|
|
export const auditReport = (id: number, data: ReportAuditForm) => {
|
|
return http.put(`/report/${id}/audit`, data)
|
|
}
|
|
|
|
// 撤回报备
|
|
export const withdrawReport = (id: number) => {
|
|
return http.delete(`/report/${id}`)
|
|
}
|