import request from './request';

// 查詢門店是否支持数字货架
export const findStoreShelf = (params) => {
  return request({
    url: `shelf/findStoreShelf`,
    method: 'get'
  })
}
// vin 查询 车型code
export const queryPartCodeByVin = (params) => {
  return request({
    url: `vinPart/queryPartCodeByVin/${params.vinNumber}`,
    method: 'get'
  })
}
//数字货架适配vin不分页
export const getShelfQueryList = (params) => {
  return request({
    url: `shelfProduct/queryList`,
    data: params,
    method: 'post'
  })
}
//数字货架产品分页
export const getShelfProductList = (params) => {
  return request({
    url: `shelfProduct/queryPage/${params.pageNo}/${params.pageSize}`,
    data: params,
    method: 'post'
  })
}
//数字货架产品类型查询
export const getShelfProductType = (params) => {
  return request({
    url: `shelfProductType/queryList`,
    data: params,
    method: 'post'
  })
}
// 数字货架订单分页查询
export const getShelfOrderList = (params) => {
  return request({
    url: `shelfOrder/queryPage/${params.pageNo}/${params.pageSize}`,
    data: params,
    method: 'post'
  })
}
// 保存数字货架订单
export const saveShelfOrder = (params) => {
  return request({
    url: `shelfOrder/create`,
    data: params,
    method: 'post'
  })
}
//保存并一键取货
export const shelfOrderFlowCreate = (params) => {
  return request({
    url: `shelfOrder/flowCreate`,
    data: params,
    method: 'post'
  })
}
// 关闭订单
export const cancelShelfOrder = (params) => {
  return request({
    url: `shelfOrder/cancel/${params.sn}`,
    method: 'get'
  })
}
// 数字货架取货单详情
export const findBySnShelfOrder = (params) => {
  return request({
    url: `shelfOrder/findBySn/${params.sn}`,
    method: 'get'
  })
}
// 确认取货
export const outShelfOrder = (params) => {
  return request({
    url: `shelfOrder/out/${params.sn}`,
    method: 'get'
  })
}
// 一键取货
export const takeGoods = (params) => {
  return request({
    url: `shelfOrder/takeGoods/${params.sn}`,
    method: 'get'
  })
}
// 扫码确认
export const scanConfirmShelfOrder = (params) => {
  return request({
    url: `shelfOrder/scanConfirm`,
	data: params,
    method: 'post'
  })
}
// 待结算列表-按月结算
export const waitSettleForMonth = (params) => {
  return request({
    url: `shelfOrder/waitSettleForMonth`,
    method: 'get'
  })
}
// 待结算列表-授信结算
export const waitSettleForSx = (params) => {
  return request({
    url: `shelfOrder/waitSettleForSx/${params.shelfOrderState}`,
    method: 'get'
  })
}

// 数字货架结算单分页查询
export const getShelfSettleBillList = (params) => {
  return request({
    url: `shelfSettleBill/queryPage/${params.pageNo}/${params.pageSize}`,
    data: params,
    method: 'post'
  })
}

// 结算是否支付成功
export const shelfSettleBillPaySuccess = (params) => {
  return request({
    url: `shelfSettleBill/isPay/${params.orderNo}`,
    method: 'get'
  })
}
// 数字货架结算单去支付
export const shelfSettleBillToPay = (params) => {
  return request({
    url: `shelfSettleBill/toPay`,
    data: params,
    method: 'post'
  })
}

// 保证金是否支付成功
export const shelfBondRecordPaySuccess = (params) => {
  return request({
    url: `shelfBondRecord/isPay/${params.orderNo}`,
    method: 'get'
  })
}

//保证金去支付
export const shelfBondRecordToPay = (params) => {
  return request({
    url: `shelfBondRecord/toPay`,
	data: params,
    method: 'post'
  })
}
// 待支付保证金
export const shelfBondRecordWaitPayRecord = (params) => {
  return request({
    url: `shelfBondRecord/waitPayRecord`,
    data: params,
    method: 'post'
  })
}
// 查詢門店数字数字货架
export const findStoreShelfSettleRule = (params) => {
  return request({
    url: `shelf/settleRule/findStoreShelfSettleRule`,
    method: 'get'
  })
}

// 补货入库列表
export const getShelfReplenishBilllList = (params) => {
  return request({
    url: `shelfReplenishBill/queryPage/${params.pageNo}/${params.pageSize}`,
    data: params,
    method: 'post'
  })
}
// 补货入库详情
export const findShelfReplenishBill = (params) => {
  return request({
    url: `shelfReplenishBill/findBySn/${params.sn}`,
    method: 'get'
  })
}

// 临时补货保存
export const shelfTemporarySave = (params) => {
  return request({
    url: `shelfTemporaryDispatching/save`,
	data: params,
    method: 'post'
  })
}

// 取货列表数量合计
export const shelfGetTotalWaitQty = (params) => {
  return request({
    url: `shelfOrder/getTotalWaitQty`,
	data: params,
    method: 'post'
  })
}
// 临配订单待取数量
export const shelfTempTotalWaitQty = (params) => {
  return request({
    url: `shelfTempBill/getQty`,
	data: params,
    method: 'post'
  })
}
// 库存查询
export const getShelfProductStockList = (params) => {
  return request({
    url: `shelfProduct/queryDepot/${params.pageNo}/${params.pageSize}`,
    data: params,
    method: 'post'
  })
}

// 临配订单
export const getShelfTempBillList = (params) => {
  return request({
    url: `shelfTempBill/queryPage/${params.pageNo}/${params.pageSize}`,
    data: params,
    method: 'post'
  })
}
// 临配订单详情
export const getShelfTempBillDetail = (params) => {
  return request({
    url: `shelfTempBill/findBySn/${params.sn}`,
    method: 'get'
  })
}

// 扫描取货
export const getProductfindByScanCode = (params) => {
  return request({
    url: `shelfProduct/findByScanCode`,
    data: params,
    method: 'post'
  })
}

// 确认取货
export const shelfOrderOnceCreate = (params) => {
  return request({
    url: `shelfOrder/atOnceCreate`,
    data: params,
    method: 'post'
  })
}

 // 查找价格显示 GET
export const findPriceShow = (params) => {
  return request({
    url: `shelf/storeParam/findPriceShow`,
    method: 'get'
  })
}
// 保存价格显示 POST
export const savePriceShow = (params) => {
  return request({
    url: `shelf/storeParam/savePriceShow`,
    data: params,
    method: 'post'
  })
}
// 查找价格显示类型 GET
export const findPriceShowType = (params) => {
  return request({
    url: `shelf/storeParam/findPriceShowType`,
    method: 'get'
  })
}
 // 保存价格显示类型 post
export const savePriceShowType = (params) => {
  return request({
    url: `shelf/storeParam/savePriceShowType`,
    data: params,
    method: 'post'
  })
}
// 查找价格显示员工可见 GET
export const findPriceShowEmployee = (params) => {
  return request({
    url: `shelf/storeParam/findPriceShowEmployee`,
    method: 'get'
  })
}
 // POST 保存价格显示员工可见
export const savePriceShowEmployee = (params) => {
  return request({
    url: `shelf/storeParam/savePriceShowEmployee`,
    data: params,
    method: 'post'
  })
}
// 下单后是否有红包奖励
export const rewardOrderFindBySn = (params) => {
  return request({
    url: `shelf/rewardOrder/findByOrderSn`,
    data: params,
    method: 'post'
  })
}

// 用户价格权限配置
export const queryQplsConfig = (params) => {
  return request({
    url: `shelf/storeParam/queryQplsConfig`,
    data: params,
    method: 'post'
  })
}
// 用户价格配置列表
export const queryShelfUserParam = (params) => {
  return request({
    url: `shelf/storeParam/queryShelfUserParam`,
    data: params,
    method: 'post'
  })
}
// 修改货架用户配置  根据id 修改
export const updateShelfUserParam = (params) => {
  return request({
    url: `shelf/storeParam/updateShelfUserParam`,
    data: params,
    method: 'post'
  })
}
// 选中配件价格显示
export const findShelfUserParam = (params) => {
  return request({
    url: `shelf/storeParam/findShelfUserParam`,
    data: params,
    method: 'post'
  })
}