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

const BASE = 'planning_production/produce/traceability/'

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

export function getTrayTraceList (data) {
  return request({
    url: BASE + 'tray',
    method: 'get',
    params: apiParams('planning_production_produce_traceability_tray', data)
  })
}

export function getTrayTraceDetail (data) {
  return request({
    url: BASE + 'traydetail',
    method: 'get',
    params: apiParams('planning_production_produce_traceability_traydetail', data)
  })
}

export function cancelTraceBatteryActive (data) {
  return request({
    url: BASE + 'batteryactive',
    method: 'get',
    params: apiParams('planning_production_produce_traceability_batteryactive', data)
  })
}
