import request from './request';

// 促销活动采购单保存
export const purchaseSave = params => {
  return request({
    url: `purchase/create`,
    method: 'post',
    data: params
  })
}
// 采购单校验
export const purchaseCheck = params => {
  return request({
    url: `purchase/createVerify`,
    method: 'post',
    data: params
  })
}
// 采购单-分页
export const purchaseQueryPage = params => {
  return request({
    url: `purchase/queryPage/${params.pageNo}/${params.pageSize}`,
    method: 'post',
    data: params
  })
}
// 采购单产品明细-分页
export const purchaseQueryDetailPage = params => {
  return request({
    url: `purchase/queryDetailPage/${params.pageNo}/${params.pageSize}`,
    method: 'post',
    data: params
  })
}
// 采购单-详情
export const purchaseDetail = params => {
  return request({
    url: `purchase/findBySn/${params.purchaseSn}`,
    method: 'get',
  })
}
// 采购单-取消
export const purchaseCancel = params => {
  return request({
    url: `purchase/cancel`,
    method: 'post',
    data: params
  })
}
// 采购单-收货
export const purchaseReceive = params => {
  return request({
    url: `purchase/receive`,
    method: 'post',
    data: params
  })
}
// 支付接口
export const purchasePay = params => {
  return request({
    url: `payInfo/toPay`,
    method: 'post',
    data: params
  })
}