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 shelfProductList = (params) => {
  return axios.request({
    url: `shelf/placeProduct/queryList`,
    data: params,
    method: 'post'
  })
}
//  货架  详情
export const shelfDetail = (params) => {
  return axios.request({
    url: `shelf/queryBySn/${params.sn}`,
    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 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: `bizparam/getShelfPriceShow`,
    data: params,
    method: 'post'
  })
}
// 更新价格显示
export const updateShelfPriceShow = (params) => {
  return axios.request({
    url: `bizparam/updateShelfPriceShow`,
    data: params,
    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'
  })
}