import request from '@/utils/request'

//---------内返记录信息控制器

// 修改详情
export function detail(returnId) {
  return request({
    url: '/internalReturn/detail?returnId='+returnId,
    method: 'GET'
  })
}

// 修改
export function edit(data) {
  return request({
    url: '/internalReturn/edit',
    method: 'PUT',
    data
  })
} 
 
// 批量导出-内返记录信息
export function batchExport(params) {
  return request({
    url: '/internalReturn/export',
    method: 'GET', 
    responseType: "blob",
    timeout: 300000,
    params
  })
}
 
// 修改时-责任小单元,工艺环节,问题分类,返修的工艺环节
export function getEditSelectDatas(params) {
  return request({
    url: '/internalReturn/getEditSelectDatas',
    method: 'GET',
    params
  })
} 
 
// getInternalReturnByUniqueCode 
export function getInternalReturnByUniqueCode(uniqueCode) {
  return request({
    url: '/internalReturn/getInternalReturnByUniqueCode/'+uniqueCode,
    method: 'GET' 
  })
}

// getInternalReturnByProductCodeAndProcedureId
export function getInternalReturnByProductCodeAndProcedureId(uniqueCode,procedureId) {
  return request({
    url: '/internalReturn/getInternalReturnByUniqueCode/'+uniqueCode+'/'+procedureId,
    method: 'GET' 
  })
} 
 
// 内返记录信息列表 
export function list(params) {
  return request({
    url: '/internalReturn/list',
    method: 'GET',
    params
  })
}
// 获取工艺环节
export function internalReturnFindProcesss(params){
  return request ({
    url:'/internalReturn/findProcesss',
    method:'get',
    params
  })
}
// 根据工艺环节获取责任小单元
export function internalReturnFindDutyPostByProcess(params){
  return request({
    url:'/internalReturn/findDutyPostByProcess',
    method:"get",
    params
  })
}
// 根据工艺环节、责任小单元获取问题分类
export function internalReturnFindQuestions(params){
  return request ({
    url:'/internalReturn/findQuestions',
    method:'get',
    params
  })
}