import request from '@/utils/request'
import { download, downloadPdf } from '@/utils/request'
const baseUrl = import.meta.env.VITE_APP_PRODUCTION_API

// 查询报工废品记录列表
export function listReject(query) {
  return request({
    url:  baseUrl +'/business/reject/list',
    method: 'get',
    params: query
  })
}

// 查询报工废品报表列表
export function rejectReport(query) {
  return request({
    url:  baseUrl +'/business/reject/rejectReport',
    method: 'get',
    params: query
  })
}
// 查询报工废品报表列表
export function rejectReportList(query) {
  return request({
    url:  baseUrl +'/business/reject/rejectReportList',
    method: 'get',
    params: query
  })
}
//查询分选废品分选标准表
export function getSortCheckStandard(query) {
  return request({
    url:  baseUrl +'/business/reject/getSortCheckStandard',
    method: 'get',
    params: query
  })
}
//打印
export function printSortReject(data) {
	download(
		baseUrl + "/business/reject/printDetailExport",
		{
			...data,
		},
		`德迈仕质量检查不良原因数据查询报表_${new Date().getTime()}.xlsx` 
	)
}
export function getSortRejectList(query) {
  return request({
    url:  baseUrl +'/business/reject/getSortRejectList',
    method: 'get',
    params: query
  })
}
// 查询报工废品报表列表
export function rejectRecords(query) {
  return request({
    url:  baseUrl +'/business/reject/rejectRecords',
    method: 'get',
    params: query
  })
}

// 查询报工废品记录详细
export function getReject(id) {
  return request({
    url: baseUrl + '/business/reject/' + id,
    method: 'get'
  })
}

// 新增报工废品记录
export function addReject(data) {
  return request({
    url: baseUrl + '/business/reject',
    method: 'post',
    data: data
  })
}

// 修改报工废品记录
export function updateReject(data) {
  return request({
    url: baseUrl + '/business/reject',
    method: 'put',
    data: data
  })
}

// 删除报工废品记录
export function delReject(id) {
  return request({
    url:  baseUrl +'/business/reject/' + id,
    method: 'delete'
  })
}
