import request from '@/utils/request'

// 查询员工花名册列表
export function listSalaryemploye(query) {
  return request({
    url: '/system/salaryemploye/list',
    method: 'get',
    params: query
  })
}

// 查询员工花名册列表
export function listSalaryemployeApply(query) {
  return request({
    url: '/system/salaryemploye/listapply',
    method: 'get',
    params: query
  })
}

// 查询员工花名册列表
export function listSalaryemployeApprove(query) {
  return request({
    url: '/system/salaryemploye/listapprove',
    method: 'get',
    params: query
  })
}

// 查询员工花名册详细
export function getSalaryemploye(employeId) {
  return request({
    url: '/system/salaryemploye/' + employeId,
    method: 'get'
  })
}

// 新增员工花名册
export function addSalaryemploye(data) {
  return request({
    url: '/system/salaryemploye',
    method: 'post',
    data: data
  })
}

// // 新增员工花名册
// export function addApplySalaryemploye(data) {
//   return request({
//     url: '/system/salaryemploye/addApply',
//     method: 'post',
//     data: data
//   })
// }

// 新增员工花名册
export function addApplySalaryemploye(data) {
  return request({
    url: '/system/salaryemploye/submitAddApply',
    method: 'post',
    data: data
  })
}



// 修改员工花名册
export function updateSalaryemploye(data) {
  return request({
    url: '/system/salaryemploye',
    method: 'put',
    data: data
  })
}

// 修改员工花名册
export function updateApplySalaryemploye(data) {
  return request({
    url: '/system/salaryemploye/editApply',
    method: 'put',
    data: data
  })
}

// 删除员工花名册
export function delSalaryemploye(employeId) {
  return request({
    url: '/system/salaryemploye/' + employeId,
    method: 'delete'
  })
}

// 删除员工花名册
export function delApplySalaryemploye(employeId) {
  return request({
    url: '/system/salaryemploye/submitRemoveApply/' + employeId,
    method: 'delete'
  })
}

// 离职
export function leave(data) {
  return request({
    url: '/system/salaryemploye/leave',
    method: 'put',
    data: data
  })
}

// 离职申请
export function leaveApply(data) {
  return request({
    url: '/system/salaryemploye/submitLeaveApply',
    method: 'put',
    data: data
  })
}

// 调动部门申请
export function transferApply(data) {
  return request({
    url: '/system/salaryemploye/submitTransferApply',
    method: 'put',
    data: data
  })
}

// 导出员工花名册
export function exportSalaryemploye(query) {
  return request({
    url: '/system/salaryemploye/export',
    method: 'get',
    params: query
  })
}

// 撤回申请
export function rebackApply(employeId) {
  return request({
    url: '/system/salaryemploye/rebackApply/' + employeId,
    method: 'delete'
  })
}

// 审核并更新
export function approve(employeId,status) {
  return request({
    url: '/system/salaryemploye/approve/' + employeId + '/' + status,
    method: 'delete'
  })
}
