import request from '@/utils/request'

// 查询报送额度限制列表
export function listSalarycredit(query) {
  return request({
    url: '/system/salarycredit/list',
    method: 'get',
    params: query
  })
}

// 查询报送额度限制详细
export function getSalarycredit(id) {
  return request({
    url: '/system/salarycredit/' + id,
    method: 'get'
  })
}

// 查询报送额度限制详细
export function getInfoByDeptAndMonth(deptId, reportCode) {
  return request({
    url: '/system/salarycredit/getInfoByDeptAndMonth/' + deptId + '/' + reportCode,
    method: 'get'
  })
}


// 新增报送额度限制
export function addSalarycredit(data) {
  return request({
    url: '/system/salarycredit',
    method: 'post',
    data: data
  })
}

// 初始化报送额度限制
export function addBatchSalarycredit(reportCode) {
  return request({
    url: '/system/salarycredit/addBatchSalarycredit/' + reportCode,
    method: 'post'
  })
}

// 修改报送额度限制
export function updateSalarycredit(data) {
  return request({
    url: '/system/salarycredit',
    method: 'put',
    data: data
  })
}

// 删除报送额度限制
export function delSalarycredit(id) {
  return request({
    url: '/system/salarycredit/' + id,
    method: 'delete'
  })
}

// 导出 模板
export function exportImportTemplate(query) {
  return request({
    url: '/system/salarycredit/importTemplate',
    method: 'get',
    params: query
  })
}

// 导出报送额度限制
export function exportSalarycredit(query) {
  return request({
    url: '/system/salarycredit/export',
    method: 'get',
    params: query
  })
}

//事业部考核评分界面，查询接口
export function listByDept(query) {
  return request({
    url: '/system/salarycredit/listByDept',
    method: 'get',
    params: query
  })
}

//查询本事业部下的
export function listByParent(query) {
  return request({
    url: '/system/salarycredit/listByParent',
    method: 'get',
    params: query
  })
}

// 下发事业部
export function issueSYB(reportUid) {
  return request({
    url: '/system/salarycredit/issueSYB/' + reportUid,
    method: 'post'
  })
}

// 下发子公司
export function issueZGS(reportUid) {
  return request({
    url: '/system/salarycredit/issueZGS/' + reportUid,
    method: 'post'
  })
}
