import { request } from '@/api/_service'

const BASE = 'planning_production/produce/tray_manage/'

function apiParams (method, data = {}) {
  return {
    method,
    platform: 'background',
    ...data
  }
}

export function getTrayManageInfo (data) {
  return request({
    url: BASE + 'list',
    method: 'get',
    params: apiParams('planning_production_produce_traymanage_list', data)
  })
}

export function changeFlowProcess (data) {
  return request({
    url: BASE + 'change',
    method: 'put',
    params: apiParams('planning_production_produce_traymanage_change', data)
  })
}

export function inactiveTray (data) {
  return request({
    url: BASE + 'inactive',
    method: 'put',
    params: apiParams('planning_production_produce_traymanage_inactive', data)
  })
}

export function trayNg (data) {
  return request({
    url: BASE + 'ng',
    method: 'put',
    params: apiParams('planning_production_produce_traymanage_ng', data)
  })
}

export function rangeNgAndRC (data) {
  return request({
    url: BASE + 'ngrc',
    method: 'put',
    params: apiParams('planning_production_produce_traymanage_ngrc', data)
  })
}

export function rangeFx (data) {
  return request({
    url: BASE + 'fenx',
    method: 'put',
    params: apiParams('planning_production_produce_traymanage_fenx', data)
  })
}

export function cleanTrayNg (data) {
  return request({
    url: BASE + 'clean',
    method: 'put',
    params: apiParams('planning_production_produce_traymanage_clean', data)
  })
}
