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

const BASE = 'planning_production/produce/tray_login/'

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

export function getBatchAll (data) {
  return request({
    url: BASE + 'all',
    method: 'get',
    params: apiParams('planning_production_produce_traylogin_all', data)
  })
}

export function getBatchTrayFormatAll (data) {
  return request({
    url: BASE + 'trayformat_all',
    method: 'get',
    params: apiParams('planning_production_produce_trayformat_all', data)
  })
}

export function createBatchTrayFormat (data) {
  return request({
    url: BASE + 'create',
    method: 'get',
    params: apiParams('planning_production_produce_trayformat_create', data)
  })
}

export function deleteBatchTrayFormat (data) {
  return request({
    url: BASE + 'delete',
    method: 'get',
    params: apiParams('planning_production_produce_trayformat_delete', data)
  })
}

export function checkBatteryid (data) {
  return request({
    url: BASE + 'check_batteryid',
    method: 'get',
    params: apiParams('planning_production_produce_trayformat_check_batteryid', data)
  })
}
