import axios from '@/libs/axios.js'

// 货架分页列表
export const getShelfList = (params) => {
	let url = `shelf/queryPage/${params.pageNo}/${params.pageSize}`
	delete params.pageNo
	delete params.pageSize
	return axios.request({
		url: url,
		data: params,
		method: 'post'
	})
}

//  货架  保存
export const shelfSave = (params) => {
  return axios.request({
    url: `shelf/save`,
    data: params,
    method: 'post'
  })
}
// 货架启用停用
export const shelfModifState = (params) => {
  return axios.request({
    url: `shelf/modifState`,
    data: params,
    method: 'post'
  })
}
//  货架  货位产品 列表 不分页
export const shelfProductList = (params) => {
  return axios.request({
    url: `shelf/placeProduct/queryList`,
    data: params,
    method: 'post'
  })
}
// 禁用货架产品 
export const shelfProductEnable = (params) => {
  return axios.request({
    url: `shelfProduct/updateEnableFlag`,
    data: params,
    method: 'post'
  })
}
//  货架  详情
export const shelfDetail = (params) => {
  return axios.request({
    url: `shelf/queryBySn/${params.sn}`,
    data: params,
    method: 'post'
  })
}
//待补货产品列表
export const queryListForReplenish = (params) => {
  return axios.request({
    url: `shelf/queryListForReplenish`,
    data: params,
    method: 'post'
  })
}
// 补货产品明细
export const queryProductListForReplenish = (params) => {
  return axios.request({
    url: `shelf/queryProductListForReplenish `,
    data: params,
    method: 'post'
  })
}
// 货架  货位产品 列表 分页
export const getShelfProductList = (params) => {
	let url = `shelf/placeProduct/queryPage/${params.pageNo}/${params.pageSize}`
	delete params.pageNo
	delete params.pageSize
	return axios.request({
		url: url,
		data: params,
		method: 'post'
	})
}
// 货位产品 列表 
export const queryShelfProductList = (params) => {
	let url = `shelf/placeProduct/queryShelfProductList`
	return axios.request({
		url: url,
		data: params,
		method: 'post'
	})
}
// 修改完成标识
export const modifFinishFlag = (params) => {
  return axios.request({
    url: `shelf/modifFinishFlag `,
    data: params,
    method: 'post'
  })
}
// 新增货位
export const addPlaceAndProduct = (params) => {
  return axios.request({
    url: `shelf/placeAndProduct/save`,
    data: params,
    method: 'post'
  })
}
// 删除货位
export const delShelfPlaceSn = (params) => {
  return axios.request({
    url: `shelf/place/deleteBySn/${params.shelfPlaceSn}`,
    data: params,
    method: 'post'
  })
}
//  新增回调单 列表 不分页
export const controlQueryList = (params) => {
  return axios.request({
    url: `shelf/control/queryList`,
    data: params,
    method: 'post'
  })
}

// 绑定产品
export const bindProductList = (params) => {
	let url = `product/queryPageForXPRH/${params.pageNo}/${params.pageSize}`
	delete params.pageNo
	delete params.pageSize
	return axios.request({
		url: url,
		data: params,
		method: 'post'
	})
}
// 查询货位
export const getProductPlace = (params) => {
  return axios.request({
    url: `shelf/app/placeProduct/queryList`,
    data: params,
    method: 'post'
  })
}
//  货架  货位产品 详情
export const shelfProductDetail = (params) => {
  return axios.request({
    url: `shelf/placeProduct/queryByPlaceSn/${params.shelfPlaceSn}`,
    data: params,
    method: 'get'
  })
}
//  货架  货位产品 保存
export const shelfProductSave = (params) => {
  return axios.request({
    url: `shelf/placeProduct/save`,
    data: params,
    method: 'post'
  })
}
// 获取价格显示
export const getShelfPriceShow = (params) => {
  return axios.request({
    url: `shelf/queryShelfPriceShowParam/${params.shelfSn}`,
    method: 'get'
  })
}
// 更新价格显示
export const updateShelfPriceShow = (params) => {
  return axios.request({
    url: `shelf/updateShelfPriceShowParam/${params.shelfSn}`,
    data: params.paramValue,
    method: 'post'
  })
}

// 货架订单-分页列表
export const orderBillQueryPage = (params) => {
  const url = `orderBill/queryPage/${params.pageNo}/${params.pageSize}`
  delete params.pageNo
  delete params.pageSize
  return axios.request({
    url: url,
    data: params,
    method: 'post'
  })
}

// 货架订单明细-合计
export const orderBillDetailCount = (params) => {
  return axios.request({
    url: `orderBill/queryDetailCount`,
    data: params,
    method: 'post'
  })
}

// 货架订单-合计
export const orderBillQueryCount = (params) => {
  return axios.request({
    url: `orderBill/queryCount`,
    data: params,
    method: 'post'
  })
}

// 新增回调单
export const insert = (params) => {
  return axios.request({
    url: `shelfRecall/insert`,
    data: params,
    method: 'post'
  })
}

// 货架模板 列表  分页
export const shelfTemplateList = (params) => {
  const url = `shelfTemplate/queryPage/${params.pageNo}/${params.pageSize}`
  delete params.pageNo
  delete params.pageSize
  return axios.request({
    url: url,
    data: params,
    method: 'post'
  })
}
// 导入货架模板
export const importShelfTemplate = params => {
  return axios.request({
    url: 'shelfTemplate/importShelfTemplate',
    data: params,
    method: 'post'
  })
}