import request from '@/utils/request'

export function getSencondeGoodList(params) {
  return request({
    url: '/api/seconde/getsencondegoodlist',
    method: 'get',
    params: params
  })
}

export function saveSencondOrder(data, record_date, storehouse_in_id, storehouse_out_id) {
  return request({
    url: '/api/senconde/savesencondorder?record_date=' + record_date + '&storehouse_in_id=' + storehouse_in_id + '&storehouse_out_id=' + storehouse_out_id,
    method: 'post',
    data: data
  })
}

export function getAllSecondOrderList(params) {
  return request({
    url: '/api/senconde/getallsecondeorderlist',
    method: 'get',
    params: params
  })
}

export function getSencondOrderDetail(id, params) {
  return request({
    url: '/api/senconde/getsencondorderdetail?id=' + id,
    method: 'get',
    params: params
  })
}

export function updateSencondOrder(data, warehousing_time, storehouse_in_id, storehouse_out_id, id) {
  return request({
    url: '/api/senconde/updatesencondorder?id=' + id + '&record_date=' + warehousing_time + '&storehouse_in_id=' + storehouse_in_id + '&storehouse_out_id=' + storehouse_out_id,
    method: 'post',
    data: data
  })
}

export function getSecondOrderDetailList(id, params) {
  return request({
    url: '/api/sencond/getsecondorderbyid?id=' + id,
    method: 'get',
    params: params
  })
}

export function checkSecondOrder(ids, params) {
  return request({
    url: '/api/sencond/checksecondorder?ids=' + ids,
    method: 'get',
    params: params
  })
}

export function deleteStoreHouseList(id, params) {
  return request({
    url: '/api/sencond/deletestorehouselist?id=' + id,
    method: 'get',
    params: params
  })
}

export function returnCheckSecondOrder(ids, params) {
  return request({
    url: '/api/sencond/returnchecksecondeorder?ids=' + ids,
    method: 'get',
    params: params
  })
}

export function getStoreHouseGoodList(params) {
  return request({
    url: '/api/second/getstorehousegoodlist',
    method: 'get',
    params: params
  })
}

export function getSumSecondeCount(params) {
  return request({
    url: '/api/second/getsumsecondecount',
    method: 'get',
    params: params
  })
}

export function deleteSecondeOrderInfo(id, params) {
  return request({
    url: '/api/second/deletesecondorderinfo?id=' + id,
    method: 'get',
    params: params
  })
}
