import request from '@/utils/request'

//下拉列表
export function getForm(key) {
  return request({
    url: '/leaveNew/processKey/' + key,
    method: 'get'
  })
}

//审核流程表单
export function showForms(instanceId) {
  return request({
    url: '/leaveNew/showForms/' + instanceId,
    method: 'get'
  })
}
//下拉列表
export function select() {
  return request({
    url: '/definition/select',
    method: 'get'
  })
}

// 新增
export function add(data) {
  return request({
    url: '/leaveNew',
    method: 'put',
    data: data
  })
}

// 分页查询
export function list(query) {
  return request({
    url: '/leaveNew/list',
    method: 'get',
    params: query
  })
}

// 查看
export function get(id) {
  return request({
    url: '/leaveNew/' + id,
    method: 'get'
  })
}

// 编辑
export function update(data) {
  return request({
    url: '/leaveNew',
    method: 'post',
    data: data
  })
}

// 删除
export function delTitle(data) {
  return request({
    url: '/leaveNew',
    method: 'delete',
    data: data
  })
}

// 编辑
export function submitApply(id) {
  return request({
    url: '/leaveNew/submitApply/' + id,
    method: 'post'
  })
}
