import request from '@/router/axios';

export const getList = (current, size, params) => {
  return request({
    url: '/api/distribution/appoint/list',
    method: 'get',
    params: {
      ...params,
      current,
      size,
    }
  })
}

export const exportAppointGoods = (state) => {
  return request({
    url: '/api/distribution/appoint/exportAppointGoods',
    method: 'get',
    responseType: 'blob',
    params: {
      state
    }
  })
}

export const getDetail = (id) => {
  return request({
    url: '/api/distribution/appoint/detail',
    method: 'get',
    params: {
      id
    }
  })
}

export const remove = (ids) => {
  return request({
    url: '/api/distribution/appoint/remove',
    method: 'post',
    params: {
      ids,
    }
  })
}

export const add = (row) => {
  return request({
    url: '/api/distribution/appoint/submit',
    method: 'post',
    data: row
  })
}


export const update = (row) => {
  return request({
    url: '/api/distribution/appoint/submit',
    method: 'post',
    data: row
  })
}

export const shipments = (ids) => {
  return request({
    url: '/api/distribution/appoint/shipments',
    method: 'post',
    params: {
      ids,
    }
  })
}

export const goodsList = (current, size, arrivalCode) => {
  return request({
    url: '/api/finance/appointgoods/appointGoodsList',
    method: 'get',
    params: {
      arrivalCode,
      current,
      size,
    }
  })
}

