import request from '@/utils/request'
import qs from 'qs'
import { upcloud_base_gsp } from '@/config/serviceSettings'

export const api = {
  addItem: upcloud_base_gsp + '/gspUnqualifiedLoss/add',
  updateItem: upcloud_base_gsp + '/registry/update',
  delItem: upcloud_base_gsp + '/gspUnqualifiedLoss/delIds',
  batchAuditYes: upcloud_base_gsp + '/gspUnqualifiedLoss/batchAuditYes',
  batchAuditNo: upcloud_base_gsp + '/gspUnqualifiedLoss/batchAuditNo',
  DestroyAdd: upcloud_base_gsp + '/gspUnqualifiedDestroy/add',
  DestroybatchAuditYes: upcloud_base_gsp + '/gspUnqualifiedDestroy/batchAuditYes',
  DestroybatchAuditNo: upcloud_base_gsp + '/gspUnqualifiedDestroy/batchAuditNo',
  DestroydelIds: upcloud_base_gsp + '/gspUnqualifiedDestroy/delIds',
  batchDestroy: upcloud_base_gsp + '/gspUnqualifiedDestroy/batchDestroy',
  DestroygetById: upcloud_base_gsp + '/gspUnqualifiedDestroy/getById'
}

// /gspUnqualifiedLoss/batchAuditConfirm
//不合格品破损批量审核确认 POST
DestroybatchAuditConfirm

export function DestroybatchAuditConfirm(data) {
  //  批量录入销毁信息 POST
  return request({
    method: 'post',
    url: upcloud_base_gsp + '/gspUnqualifiedDestroy/batchAuditConfirm',
    data: data
  })
}
export function batchAuditConfirm(data) {
  //  批量录入销毁信息 POST
  return request({
    method: 'post',
    url: upcloud_base_gsp + '/gspUnqualifiedLoss/batchAuditConfirm',
    data: data
  })
}
export function DestroygetById(parameter) {
  //  批量录入销毁信息 POST
  return request({
    method: 'get',
    url: api.DestroygetById,
    params: parameter
  })
}

export function batchDestroy(parameter) {
  //  批量录入销毁信息 POST
  return request({
    method: 'post',
    url: api.batchDestroy,
    data: parameter
  })
}

export function DestroydelIds(parameter) {
  // 批量删除待审核销毁申请 POST
  return request({
    method: 'post',
    url: api.DestroydelIds,
    data: parameter
  })
}

export function DestroybatchAuditNo(parameter) {
  //不合格品销毁批量审核 POST
  return request({
    method: 'post',
    url: api.DestroybatchAuditNo,
    data: parameter
  })
}
export function DestroybatchAuditYes(parameter) {
  //不合格品销毁批量审核 POST
  return request({
    method: 'post',
    url: api.DestroybatchAuditYes,
    data: parameter
  })
}
export function batchAuditNo(parameter) {
  // 不合格品破损批量审核 POST
  return request({
    method: 'post',
    url: api.batchAuditNo,
    data: parameter
  })
}
export function batchAuditYes(parameter) {
  // 不合格品破损批量审核 POST
  return request({
    method: 'post',
    url: api.batchAuditYes,
    data: parameter
  })
}
export function addItem(parameter) {
  return request({
    method: 'post',
    url: api.addItem,
    data: parameter
  })
}

export function delItem(parameter) {
  return request({
    method: 'post',
    url: api.delItem,
    data: parameter
  })
}
export function DestroyAdd(parameter) {
  return request({
    method: 'post',
    url: api.DestroyAdd,
    data: parameter
  })
}
