import request from '@/axios';

export const getList = (current, size, params) => {
  return request({
    url: '/pl-productBatch/productBatch/list',
    method: 'get',
    params: {
      ...params,
      current,
      size,
    }
  })
}

export const getDetail = (id) => {
  return request({
    url: '/pl-productBatch/productBatch/detail',
    method: 'get',
    params: {
      id
    }
  })
}

export const remove = (ids) => {
  return request({
    url: '/pl-productBatch/productBatch/remove',
    method: 'post',
    params: {
      ids,
    }
  })
}

export const add = (row) => {
  return request({
    url: '/pl-productBatch/productBatch/submit',
    method: 'post',
    data: row
  })
}

export const update = (isChange,row) => {
  let url = isChange?'/pl-productBatch/productBatch/change':'/pl-productBatch/productBatch/submit'
  return request({
    url: url,
    method: 'post',
    data: row
  })
}

