import request from '@/router/axios';

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

export const getDetail = (id) => {
  return request({
    url: '/api/cyzh-person/allowancespeople/detail',
    method: 'get',
    params: {
      id
    }
  })
}

export const remove = (ids) => {
  return request({
    url: '/api/cyzh-person/allowancespeople/remove',
    method: 'post',
    params: {
      ids,
    }
  })
}

export const add = (row) => {
  return request({
    url: '/api/cyzh-person/allowancespeople/submit',
    method: 'post',
    data: row
  })
}

export const update = (row) => {
  return request({
    url: '/api/cyzh-person/allowancespeople/submit',
    method: 'post',
    data: row
  })
}

// export const addAllowances = (form1,form2) => {
//   return request({
//     url: '/api/cyzh-person/allowancespeople/addAllowances',
//     method: 'post',
//     data: form1,form2
//   })
// }

export const addAllowances = (list) => {
  return request({
    url: '/api/cyzh-person/allowancespeople/addAllowances',
    method: 'post',
    data: list
  })
}

export const generatedetail = (id) => {
  return request({
    url: '/api/cyzh-person/allowancespeople/generatedetail',
    method: 'get',
    params: {
      id
    }
  })
}
