import request from '@/utils/request'
const baseUrl = import.meta.env.VITE_APP_PRODUCTION_API

// 查询外协单从列表
export function listDetail(query) {
  return request({
    url: baseUrl + '/business/detail/list',
    method: 'get',
    params: query
  })
}
// 获取已完成的外协单从表
export function listDetailForReceipt(query) {
  return request({
    url: baseUrl + '/business/outsourceDetail/listDetailForReceipt',
    method: 'get',
    params: query
  })
}

export function getNotFinishedOutsourceDetailList(query) {
  return request({
    url: baseUrl + '/business/outsourceDetail/getNotFinishedOutsourceDetailList',
    method: 'get',
    params: query
  })
}
// 获取所有的外协单从表
export function listDetailForAllReceipt(query) {
  return request({
    url: baseUrl + '/business/outsourceDetail/listDetailForAllReceipt',
    method: 'get',
    params: query
  })
}

// 查询外协单从详细
export function getDetail(id) {
  return request({
    url: baseUrl + '/business/detail/' + id,
    method: 'get'
  })
}

// 新增外协单从
export function addDetail(data) {
  return request({
    url: baseUrl + '/business/detail',
    method: 'post',
    data: data
  })
}

// 修改外协单从
export function updateDetail(data) {
  return request({
    url: baseUrl + '/business/detail',
    method: 'put',
    data: data
  })
}

// 删除外协单从
export function delDetail(id) {
  return request({
    url: baseUrl + '/business/detail/' + id,
    method: 'delete'
  })
}
//获取报工完成的发出单明细
// 获取已完成的外协单从表
export function getFinishedOutsourceDetailList(query) {
  return request({
    url: baseUrl + '/business/outsourceDetail/getFinishedOutsourceDetailList',
    method: 'get',
    params: query
  })
}

// 获取工序列表
export function getProcessList(query) {
  return request({
    url: baseUrl + '/business/technologicalProcess/list',
    method: 'get',
    params: query
  })
}
