import request from '@/router/axios';

export const getList = (current, size, params) => {
  return request({
    url: '/api/bank/goodsuse/page',
    method: 'get',
    params: {
      ...params,
      current,
      size,
    }
  })
}

export const getDownloadList = (params) => {
  return request({
    url: '/api/bank/goodsuse/getList',
    method: 'get',
    params: {
      ...params,
    }
  })
}

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

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

export const transfer = (ids, personNo) => {
  return request({
    url: '/api/bank/goodsuse/transfer',
    method: 'post',
    params: {
      ids,
      personNo,
    }
  })
}

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

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


export const settingSave = (row) => {
  return request({
    url: '/api/bank/goodsuse/settingSave',
    method: 'post',
    data: row
  })
}

export const getSetting = () => {
  return request({
    url: '/api/bank/goodsuse/getSetting',
    method: 'get',
    params: {
    }
  })
}

export const sure = (row) => {
  return request({
    url: '/api/bank/goodsuse/sure',
    method: 'post',
    data: row
  })
}

export const getLastByType = (type) => {
  return request({
    url: '/api/bank/goodsuse/getLastByType',
    method: 'get',
    params: {
      type
    }
  })
}

export const getBalanceList = () => {
  return request({
    url: '/api/bank/goodsuse/getBalanceList',
    method: 'get',
    params: {
    }
  })
}


