import request from '@/utils/request'

// 材料员确认-列表
export function getCompleteOutTaskList(query) {
  return request({
    url: '/material/lease_apply_info/getCompleteOutTaskList',
    method: 'get',
    params: query
  })
}

// 材料员确认查询-列表
export function getCompleteTaskList(query) {
  return request({
    url: '/material/lease_apply_info/getConfirmTaskList',
    method: 'get',
    params: query
  })
}

//领料出库-列表
export function getListLeaseOut(query) {
  return request({
    url: '/material/lease_out_details/list',
    method: 'get',
    params: query
  })
}

// 领料出库-出库详情信息
export function outInfoList(id, query) {
  return request({
    url: '/material/lease_apply_info/' + id,
    method: 'get',
    params: query
  })
}

// 领料出库-编码出库详情信息
export function getDetailsByTypeId(query) {
  return request({
    url: '/material/ma_machine/list',
    method: 'get',
    params: query
  })
}

// 领料出库-编码出库
export function submitOut(data) {
  return request({
    url: '/material/lease_apply_info/leaseOut',
    method: 'post',
    data: data
  })
}

//-------暂未用到-----------
// 领料出库-新增
export function addApplyInfo(data) {
  return request({
    url: '/material/lease_apply_info',
    method: 'post',
    data: data
  })
}

// 领料出库-编辑
export function updateApplyInfo(data) {
  return request({
    url: '/material/lease_apply_info',
    method: 'put',
    data: data
  })
}

// 领料出库-详情信息
export function getLeaseOutInfo(id) {
  return request({
    url: '/material/lease_apply_info/' + id,
    method: 'get'
  })
}

// 领料出库-数量出库
export function submitNumOut(data) {
  return request({
    url: '/material/lease_apply_info/leaseOut',
    method: 'post',
    data: data
  })
}

// 材料员确认
export function confirmMaterial(data) {
  return request({
    url: '/material/lease_apply_info/confirmMaterial',
    method: 'post',
    data: data
  })
}

// 确认列表
export function getInfoApi(data) {
  return request({
    url: '/material/lease_apply_info/getInfoById',
    method: 'get',
    params: data
  })
}

// 领料单
export function getLeaseRequestVoApi(data) {
  return request({
    url: '/material/lease_apply_info/getLeaseRequestVo',
    method: 'get',
    params: data
  })
}

// 领料出库-驳回
export function rejectLeaseOut(data) {
  return request({
    url: '/material/leaseTask/leasePublishReject',
    method: 'post',
    data: data
  })
}

// 领料出库-删除
export function deleteLeaseOut(data) {
  return request({
    url: '/material/leaseTask/delLeaseDetails',
    method: 'post',
    data: data
  })
}

// 领料出库-修改预领数量
export function updatePreNum(data) {
  return request({
    url: '/material/lease_apply_info/updateLeaseNum',
    method: 'post',
    data: data
  })
}
// 出库数量
export function getOutNumApi(data) {
  return request({
    url: '/material/lease_apply_info/getOutNum',
    method: 'get',
    params: data
  })
}