import request, { postBlob, getBlob, handleImport } from '@/utils/request'

export function websitPurchaseInList(data) {
  return request({
    url: `/websit/purchase/in/list?moduleId=${data.moduleId}`,
    method: 'post',
    data
  })
}

export function websitPurchaseInListExport(data, name) {
  return postBlob({
    url: '/websit/purchase/in/list/export',
    data,
    name
  })
}

export function websitPurchaseInAdd(data) {
  return request({
    url: '/websit/purchase/in/add',
    method: 'post',
    data: data
  })
}

export function websitPurchaseInEdit(data) {
  return request({
    url: '/websit/purchase/in/edit',
    method: 'post',
    data: data
  })
}

export function websitPurchaseInConfirm(params) {
  return request({
    url: '/websit/purchase/in/confirm',
    method: 'post',
    params: params
  })
}

export function websitPurchaseInDetail(params) {
  return request({
    url: '/websit/purchase/in/detail',
    method: 'post',
    params: params
  })
}

export function websitPurchaseInImport(data) {
  return handleImport('/websit/purchase/in/import', data.formdata, data.id || '')
}



// ------------------------------------






export function websitPurchaseRetImport(data) {
  return handleImport('/websit/purchase/ret/import', data.formdata, data.id || '')
}




export function websitPurchaseRetList(data) {
  return request({
    url: `/websit/purchase/ret/list?moduleId=${data.moduleId}`,
    method: 'post',
    data
  })
}

export function websitPurchaseRetListExport(data, name) {
  return postBlob({
    url: '/websit/purchase/ret/list/export',
    data,
    name
  })
}



export function websitPurchaseRetAdd(data) {
  return request({
    url: '/websit/purchase/ret/add',
    method: 'post',
    data: data
  })
}

export function websitPurchaseRetEdit(data) {
  return request({
    url: '/websit/purchase/ret/edit',
    method: 'post',
    data: data
  })
}

export function websitPurchaseRetConfirm(params) {
  return request({
    url: '/websit/purchase/ret/confirm',
    method: 'post',
    params: params
  })
}

export function websitPurchaseRetDetail(params) {
  return request({
    url: '/websit/purchase/ret/detail',
    method: 'post',
    params: params
  })
}