import request from '@/config/axios'

export interface CarVO {
  id?: number
  driverName: string
  licensePlate: string
  contactPhone?: string
  carLength?: number
  carWidth?: number
  ratedTonnage?: number
  remark?: string
  status: number
  createTime?: Date
}

// 查询车辆管理列表
export const getCarPage = (params: any) => {
  return request.get({ url: '/erp/car/page', params })
}

// 查询车辆管理详情
export const getCar = (id: number) => {
  return request.get({ url: '/erp/car/get?id=' + id })
}

// 新增车辆管理
export const createCar = (data: CarVO) => {
  return request.post({ url: '/erp/car/create', data })
}

// 修改车辆管理
export const updateCar = (data: CarVO) => {
  return request.put({ url: '/erp/car/update', data })
}

// 删除车辆管理
export const deleteCar = (id: number) => {
  return request.delete({ url: '/erp/car/delete?id=' + id })
}

// 导出车辆管理
export const exportCar = (params: any) => {
  return request.download({ url: '/erp/car/export-excel', params })
}

// 获取车辆导入模板
export const importCarTemplate = () => {
  return request.download({ url: '/erp/car/get-import-template' })
} 