import request from '@/utils/request'

// 退料申请列表
export function ApiGetBackApplyList(query) {
  return request({
    url: '/material/backApply/getBackApplyList',
    method: 'get',
    params: query
  })
}

// 退料审核列表
export function getBackAuditList(query) {
  return request({
    url: '/material/backApply/getBackAuditList',
    method: 'get',
    params: query
  })
}

// 退料申请新增
export function ApiSubmitBackApply(query) {
  return request({
    url: '/material/backApply/submitBackApply',
    method: 'post',
    params: query
  })
}

// 申请页面 详情查看
export function getViewByApply(query) {
  return request({
    url: '/material/backApply/getViewByApply',
    method: 'get',
    params: query
  })
}
// 审批页面 详情查看或编辑
export function getViewByExamine(query) {
  return request({
    url: '/material/backApply/getViewByExamine',
    method: 'get',
    params: query
  })
}


// 详情查看或编辑
export function ApiSetModify(query) {
  return request({
    url: '/material/backApply/setModify',
    method: 'post',
    params: query
  })
}


// 详情查看或编辑
export function ApiGetMaterialList(query) {
  return request({
    url: '/material/backApply/getMaterialList',
    method: 'get',
    params: query
  })
}

// 删除
export function backApplyDelApi(query) {
  return request({
    url: '/material/backApply/del',
    method: 'get',
    params: query
  })
}






//审核-同意
export function ApiBackApplyAudit(data) {
  return request({
    url: '/material/backApply/audit',
    method: 'post',
    data: data
  })
}
//审核-拒绝R
export function ApiBackApplyRefuse(data) {
  return request({
    url: '/material/backApply/refuse',
    method: 'post',
    data: data
  })
}
// 退料审核新增
export function submitBackApplyApi(data) {
  return request({
    url: '/material/backApply/submitBackApply',
    method: 'post',
    data: data
  })
}

// 退料审核新增
export function submitBackApplyApiByCq(data) {
  return request({
    url: '/material/backApply/submitBackApplyByCq',
    method: 'post',
    data: data
  })
}
// 退料审核-驳回重新提交
export function submitRefuseBackApply(data) {
  return request({
    url: '/material/backApply/submitRefuseBackApply',
    method: 'post',
    data: data
  })
}


// 退料申请-详情
export function materialReturnNoteByApply(query) {
  return request({
    url: '/material/backApply/materialReturnNoteByApply',
    method: 'get',
    params: query
  })
}

// 退料管理-退料单详情
export function materialReturnNoteByExamine(query) {
  return request({
    url: '/material/backApply/materialReturnNoteByExamine',
    method: 'get',
    params: query
  })
}


// 退料接收列表
export function getBackReceiveList(query) {
  return request({
    url: '/material/base/backReceive/getbackReceiveList',
    method: 'get',
    params: query
  })
}
// 退料接收详情列表
export function receiveView(data) {
  return request({
    url: '/material/base/backReceive/receiveViewWeb',
    method: 'post',
    data: data
  })
}

// 退料接收弹窗详情
export function getBackMachine(query) {
  return request({
    url: '/material/base/backReceive/getBackMachine',
    method: 'get',
    params: query
  })
}

// 退料接收 查看记录
export function backReceiveRecordWeb(data) {
  return request({
    url: 'base/backReceive/backReceiveRecordWeb ',
    method: 'post',
    data: data
  })
}

export function backReceiveRecordWebPt(data) {
  return request({
    url: 'base/backReceive/backReceiveRecordWebPt ',
    method: 'post',
    data: data
  })
}

// 退料接收 数量接收
export function setNumBack(data) {
  return request({
    url: 'base/backReceive/setNumBack',
    method: 'post',
    data: data
  })
}

// 退料接收 编码接收
export function setCodeBack(data) {
  return request({
    url: 'base/backReceive/setCodeBack',
    method: 'post',
    data: data
  })
}

// 退料接收 完成前判断是否存在记录
export function getRecord(query) {
  return request({
    url: 'base/backReceive/getRecord',
    method: 'get',
    params: query
  })
}

// 退料接收 撤回操作
export function revoke(data) {
  return request({
    url: 'base/backReceive/revoke',
    method: 'post',
    data: data
  })
}

// 退料接收 完成接收
export function endBack(data) {
  return request({
    url: 'base/backReceive/endBack',
    method: 'post',
    data: data
  })
}

