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 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 = (id) => {
  return request({
    url: '/api/distribution/appoint/shipments',
    method: 'post',
    params: {
      id,
    }
  })
}

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

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

export const appointStoreList = (current, size, grouponId) => {
  return request({
    url: '/api/distribution/appoint/appointAllList',
    method: 'get',
    params: {
      grouponId,
      current,
      size,
    }
  })
}
