import request from '@/utils/request'

export function createDealer(params) {
  return request({
    url: '/api/stock/dealer/create',
    method: 'post',
    params: params
  })
}

export function modifyDealer(params) {
  return request({
    url: '/api/stock/dealer/modify',
    method: 'post',
    params: params
  })
}

export function getDealersList(params) {
  return request({
    url: '/api/stock/dealer/list',
    method: 'get',
    params: params
  })
}

export function deleteDealer(params) {
  return request({
    url: '/api/stock/dealer/delete',
    method: 'post',
    params: params
  })
}

export function GetDealer(params) {
  return request({
    url: '/api/stock/dealer/get',
    method: 'get',
    params: params
  })
}

export function createManufacturer(params) {
  return request({
    url: '/api/stock/manufacturer/create',
    method: 'post',
    params: params
  })
}

export function modifyManufacturer(params) {
  return request({
    url: '/api/stock/manufacturer/modify',
    method: 'post',
    params: params
  })
}

export function getManufacturerList(params) {
  return request({
    url: '/api/stock/manufacturer/list',
    method: 'get',
    params: params
  })
}

export function deleteManufacturer(params) {
  return request({
    url: '/api/stock/manufacturer/delete',
    method: 'post',
    params: params
  })
}

export function GetManufacturer(params) {
  return request({
    url: '/api/stock/manufacturer/get',
    method: 'get',
    params: params
  })
}

export function createGoodType(params) {
  return request({
    url: '/api/stock/good/type/create',
    method: 'post',
    params: params
  })
}

export function modifyGoodType(params) {
  return request({
    url: '/api/stock/good/type/modify',
    method: 'post',
    params: params
  })
}

export function getGoodTypeList(params) {
  return request({
    url: '/api/stock/good/type/list',
    method: 'get',
    params: params
  })
}

export function deleteGoodType(params) {
  return request({
    url: '/api/type/delete',
    method: 'post',
    params: params
  })
}

export function GetGoodType(params) {
  return request({
    url: '/api/stock/good/type/get',
    method: 'get',
    params: params
  })
}

export function createGoodInfo(params) {
  return request({
    url: '/api/stock/good/info/create',
    method: 'post',
    params: params
  })
}

export function modifyGoodInfo(params) {
  return request({
    url: '/api/stock/good/info/modify',
    method: 'post',
    params: params
  })
}

export function getGoodInfoList(params) {
  return request({
    url: '/api/stock/good/info/list',
    method: 'get',
    params: params
  })
}

export function deleteGoodInfo(params) {
  return request({
    url: '/api/info/delete',
    method: 'post',
    params: params
  })
}

export function GetGoodInfoByGoodId(params) {
  return request({
    url: '/api/stock/good/info/get',
    method: 'get',
    params: params
  })
}

export function GetGoodInfo(params) {
  return request({
    url: '/api/stock/good/info',
    method: 'get',
    params: params
  })
}

export function GetAllDeals(params) {
  return request({
    url: '/api/stock/dealer/all',
    method: 'get',
    params: params
  })
}

export function GetAllManufacturer(params) {
  return request({
    url: '/api/stock/manufacturer/all',
    method: 'get',
    params: params
  })
}

export function GetAllGoodType(params) {
  return request({
    url: '/api/stock/good/type/all',
    method: 'get',
    params: params
  })
}

export function GetAllGoodInfo(params) {
  return request({
    url: '/api/stock/good/info/all',
    method: 'get',
    params: params
  })
}

export function postWarehouse(params, warehousing_time, manufacturer_id, dealer_id, type) {
  return request({
    url: '/api/warehouse/create?warehousing_time=' + warehousing_time + '&manufacturer_id=' + manufacturer_id + '&dealer_id=' + dealer_id + '&type=' + type,
    method: 'post',
    data: params
  })
}

export function getWarehouseList(params) {
  return request({
    url: '/api/warehouse/list',
    method: 'get',
    params: params
  })
}

export function getWarehouseInfoList(params) {
  return request({
    url: '/api/warehouseinfo/list',
    method: 'get',
    params: params
  })
}

export function postSalesReturn(params, salesReturnTime, salesReturnTotal, dealer_id, manufacturer_id, type) {
  return request({
    url: '/api/salesreturn/create?time=' + salesReturnTime + '&total=' + salesReturnTotal + '&dealer_id=' + dealer_id + '&manufacturer_id=' + manufacturer_id + '&type=' + type,
    method: 'post',
    data: params
  })
}

export function getWarehouseInfo(params) {
  return request({
    url: '/api/info/get',
    method: 'get',
    params: params
  })
}

export function getSalesReturnList(params) {
  return request({
    url: '/api/salesreturn/list',
    method: 'get',
    params: params
  })
}

export function getSalesReturnInfoList(params) {
  return request({
    url: '/api/return/info',
    method: 'get',
    params: params
  })
}

export function getAllWarehouseInfo(params) {
  return request({
    url: '/api/warehouseinfo',
    method: 'get',
    params: params
  })
}

export function getWarehouseOutInfoList(params) {
  return request({
    url: '/api/stock/out/info',
    method: 'get',
    params: params
  })
}

export function postWarehouseOut(params, warehousing_time, dealer_id, manufacturer_id, type) {
  return request({
    url: '/api/warehouseout/create?warehousing_out_time=' + warehousing_time + '&dealer_id=' + dealer_id + '&manufacturer_id=' + manufacturer_id + '&type=' + type,
    method: 'post',
    data: params
  })
}

export function getWarehouseInfoCountByGoodId(params) {
  return request({
    url: '/api/info/count',
    method: 'get',
    params: params
  })
}

export function getWarehouseInfoByGoodTypeId(params) {
  return request({
    url: '/api/warehouse/type',
    method: 'get',
    params: params
  })
}

export function getCancelStockInfoList(params) {
  return request({
    url: '/api/cancel/info',
    method: 'get',
    params: params
  })
}

export function getAllStockOutList(params) {
  return request({
    url: '/api/out/list',
    method: 'get',
    params: params
  })
}

export function getAllStockQueryList(params) {
  return request({
    url: '/api/stock/query',
    method: 'get',
    params: params
  })
}

export function getWarehouseInfoByOrdeNumber(params) {
  return request({
    url: '/api/stock/warehouse/get',
    method: 'get',
    params: params
  })
}

export function modifyWarehouseInfo(params) {
  return request({
    url: '/api/warehouse/edit',
    method: 'post',
    params: params
  })
}

export function deleteWarehouseInfo(params) {
  return request({
    url: '/api/warehouse/delete',
    method: 'post',
    params: params
  })
}

export function getWarehouseOutInfoByOrdeNumber(params) {
  return request({
    url: '/api/stock/out/get',
    method: 'get',
    params: params
  })
}

export function modifyWarehouseOutInfo(params) {
  return request({
    url: '/api/stock/out/edit',
    method: 'post',
    params: params
  })
}

export function GetAllConfig() {
  return request({
    url: '/api/stock/config',
    method: 'get'
  })
}

export function GetAllGoodInfoByID(params) {
  return request({
    url: '/api/good/get',
    method: 'get',
    params: params

  })
}

export function DeleteWarehouseInfoItem(params) {
  return request({
    url: '/api/warehouseinfo/delete',
    method: 'post',
    params: params

  })
}

export function EditWarehouse(params, warehousing_time, id,type,manufacturer_id,dealer_id) {
  return request({
    url: '/api/warehouse/edit?warehousing_time=' + warehousing_time + '&id=' + id+"&type="+type+"&manufacturer_id="+manufacturer_id+"&dealer_id="+dealer_id,
    method: 'post',
    data: params
  })
}

export function getSalesReturnConfig(params) {
  return request({
    url: '/api/return/config',
    method: 'get',
    params: params

  })
}

export function deleteSalesReturn(params) {
  return request({
    url: '/api/salesreturn/delete',
    method: 'post',
    params: params
  })
}

export function getSaleReturnInfoList(params) {
  return request({
    url: '/api/stock/salesReturn/list',
    method: 'get',
    params: params
  })
}

export function getReturnList(params) {
  return request({
    url: '/api/salesreturninfo/list',
    method: 'get',
    params: params
  })
}
export function deleteSalesReturnInfo(params) {
  return request({
    url: '/api/salesreturninfo/delete',
    method: 'post',
    params: params
  })
}

export function editSalesReturnInfo(params, return_time, id,type,manufacturer_id,dealer_id) {
  return request({
    url: '/api/salesreturn/edit?return_time=' + return_time + '&id=' + id+"&type="+type+"&manufacturer_id="+manufacturer_id+"&dealer_id="+dealer_id,
    method: 'post',
    data: params
  })
}

export function deleteWarehouseOut(params) {
  return request({
    url: '/api/warehouseout/delete',
    method: 'post',
    params: params
  })
}

export function deleteWarehouseOutInfo(params) {
  return request({
    url: '/api/warehouseoutinfo/delete',
    method: 'post',
    params: params
  })
}

export function getWarehouseOutList(params) {
  return request({
    url: '/api/warehouseout/list',
    method: 'get',
    params: params
  })
}

export function getWarehouseOutInfo(params) {
  return request({
    url: '/api/warehouseout/info',
    method: 'get',
    params: params
  })
}

export function editWarehouseoutInfo(params, warehouse_out_time, id,type,manufacturer_id,dealer_id) {
  return request({
    url: '/api/warehouseout/edit?warehouse_out_time=' + warehouse_out_time + '&id=' + id+"&type="+type+"&manufacturer_id="+manufacturer_id+"&dealer_id="+dealer_id,
    method: 'post',
    data: params
  })
}

export function getCancelStockList(params) {
  return request({
    url: '/api/cancelstock/list',
    method: 'get',
    params: params
  })
}

export function editCancelStockInfo(params, cancel_stock_time, id,type,manufacturer_id,dealer_id) {
  return request({
    url: '/api/cancelstockinfo/edit?cancel_time=' + cancel_stock_time + '&id=' + id+"&type="+type+"&manufacturer_id="+manufacturer_id+"&dealer_id=" + dealer_id,
    method: 'post',
    data: params
  })
}

export function getCancelStockInfo(params) {
  return request({
    url: '/api/cancelstock/info',
    method: 'get',
    params: params
  })
}

export function deleteCancelStock(params) {
  return request({
    url: '/api/cancelstock/delete',
    method: 'post',
    params: params
  })
}

export function deleteCancelStockInfo(params) {
  return request({
    url: '/api/cancelstockinfo/delete',
    method: 'post',
    params: params
  })
}

export function postCancelStock(params, cancelStockTime, manufacturer_id, dealer_id, type) {
  return request({
    url: '/api/cancelstock/create?time=' + cancelStockTime + '&manufacturer_id=' + manufacturer_id + '&dealer_id=' + dealer_id + '&type=' + type,
    method: 'post',
    data: params
  })
}
export function getCancelStockConfig(params) {
  return request({
    url: '/api/cancelstockinfo/config',
    method: 'get',
    params: params
  })
}

export function getStockDetail(params) {
  return request({
    url: '/api/stock/detail',
    method: 'get',
    params: params
  })
}



export function getPrintStockGood(params) {
  return request({
    url: '/api/print/stock',
    method: 'get',
    params: params
  })
}


export function getWarehouseOutUser(params) {
  return request({
    url: '/api/warehouseout/user',
    method: 'get',
    params: params
  })
}
