import request from '@/router/axios';

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

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


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

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

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

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


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

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

export const getDictByCode = (code) => {
  return request({
    url: '/api/blade-system/dict/dictionary?code=' + code,
    method: 'get',
  })
}

export const approve = (id) => {
  return request({
    url: '/api/bank/postchange/approve',
    method: 'post',
    params: {
      id
    }
  })
}

export const getLastRecord = () => {
  return request({
    url: '/api/bank/postchange/getLastRecord',
    method: 'get',
  })
}
