import request from '@/utils/request'

// 保存并提交申请
export function saveAndSubmitApply(data) {
  return request({
    url: '/production/apply/saveAndSubmitApply',
    method: 'post',
    data: data
  })
}

// 提交申请
export function submitApply(saiApplyId) {
  return request({
    url: '/production/apply/submit/' + saiApplyId,
    method: 'put',
  })
}

// 申请处理
export function handleApply(data) {
  return request({
    url: '/production/apply/handle',
    method: 'put',
    data: data
  })
}

// 查询SAI开项管理列表
export function listApply(query) {
  return request({
    url: '/production/apply/list',
    method: 'get',
    params: query
  })
}

export function getPersonalAnalysis() {
  return request({
    url: '/production/apply/personalAnalysis',
    method: 'get'
  })
}

export function getTeamAnalysis() {
  return request({
    url: '/production/apply/teamAnalysis',
    method: 'get'
  })
}

// 查询SAI开项管理详细
export function getApply(saiApplyId) {
  return request({
    url: '/production/apply/' + saiApplyId,
    method: 'get'
  })
}

// 新增SAI开项管理
export function addApply(data) {
  return request({
    url: '/production/apply',
    method: 'post',
    data: data
  })
}

// 修改SAI开项管理
export function updateApply(data) {
  return request({
    url: '/production/apply',
    method: 'put',
    data: data
  })
}

// 删除SAI开项管理
export function delApply(saiApplyId) {
  return request({
    url: '/production/apply/' + saiApplyId,
    method: 'delete'
  })
}

// 导出SAI开项管理
export function exportApply(query) {
  return request({
    url: '/production/apply/export',
    method: 'put',
    data: query
  })
}
