import request from '@/config/axios'

export interface CombinationReocrdVO {
  id: number
  combinationId: number
  productId: number
  unitPrice: number
  totalPrice: number
  quantity: number
  executeStatus: number
  submitTime: Date
}

// 查询连单记录列表
export const getCombinationReocrdPage = async (params) => {
  return await request.get({ url: `/member/combination-reocrd/page`, params })
}

// 查询连单记录详情
export const getCombinationReocrd = async (id: number) => {
  return await request.get({ url: `/member/combination-reocrd/get?id=` + id })
}

// 新增连单记录
export const createCombinationReocrd = async (data: CombinationReocrdVO) => {
  return await request.post({ url: `/member/combination-reocrd/create`, data })
}

// 修改连单记录
export const updateCombinationReocrd = async (data: CombinationReocrdVO) => {
  return await request.put({ url: `/member/combination-reocrd/update`, data })
}

// 删除连单记录
export const deleteCombinationReocrd = async (id: number) => {
  return await request.delete({ url: `/member/combination-reocrd/delete?id=` + id })
}

// 导出连单记录 Excel
export const exportCombinationReocrd = async (params) => {
  return await request.download({ url: `/member/combination-reocrd/export-excel`, params })
}
