import request from '@/config/axios'

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

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

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

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

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

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

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