import request from '@/utils/request'

/**
* 接口管理/SAP交验单记录表分页查询
* @param {查询条件} data
*/
export function listSapDeliverRecord(query) {
  return request({
    url: 'business/SapDeliverRecord/list',
    method: 'get',
    params: query,
  })
}

// 获取未质检的交验单号
export function listSapDeliverNoCheck(query) {
  return request({
    url: 'business/SapDeliverRecord/QuerySapDeliverData',
    method: 'post',
    data: query,
  })
}
export function GetSapDeliverRecordSumList(query) {
  return request({
    url: 'business/SapDeliverRecord/GetSapDeliverRecordSumList',
    method: 'get',
    params: query,
  })
}

/**
* 新增接口管理/SAP交验单记录表
* @param data
*/
export function addSapDeliverRecord(data) {
  return request({
    url: 'business/SapDeliverRecord',
    method: 'post',
    data: data,
  })
}

/**
* 修改接口管理/SAP交验单记录表
* @param data
*/
export function updateSapDeliverRecord(data) {
  return request({
    url: 'business/SapDeliverRecord',
    method: 'PUT',
    data: data,
  })
}

/**
* 获取接口管理/SAP交验单记录表详情
* @param {Id}
*/
export function getSapDeliverRecord(id) {
  return request({
    url: 'business/SapDeliverRecord/' + id,
    method: 'get'
  })
}

/**
* 删除接口管理/SAP交验单记录表
* @param {主键} pid
*/
export function delSapDeliverRecord(pid) {
  return request({
    url: 'business/SapDeliverRecord/' + pid,
    method: 'delete'
  })
}

// 清空接口管理/SAP交验单记录表
export function clearSapDeliverRecord() {
  return request({
    url: 'business/SapDeliverRecord/clean',
    method: 'delete'
  })
}

// 导出接口管理/SAP交验单记录表
export async function exportSapDeliverRecord(query) {
  await downFile('business/SapDeliverRecord/export', { ...query })
}

//提交质检完成得交验单
export function SubmitInspectResult(deliverNo) {
  return request({
    url: 'business/SapDeliverRecord/SubmitInspectResult',
    method: 'get',
    params: { deliverNo: deliverNo },
  })
}

