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

// 盘点完成
export const stockCheckConfirm = (params) => {
	let url = `shelfStockCheck/confirm`
	return axios.request({
		url: url,
		data: params,
		method: 'post'
	})
}
// 盘点-删除
export const stockCheckDeleteBySn = (params) => {
	let url = `shelfStockCheck/deleteBySn/${params.stockCheckSn}`
	return axios.request({
		url: url,
		data: params,
		method: 'post'
	})
}
// 盘点明细-删除
export const stockCheckDetailDelete = (params) => {
	let url = `shelfStockCheck/detail/deleteByStockCheckDetailSn/${params.stockCheckDetailSn}`
	return axios.request({
		url: url,
		method: 'post'
	})
}
// 整单删除
export const deleteByStockCheckSn = (params) => {
	let url = `shelfStockCheck/detail/deleteByStockCheckSn/${params.stockCheckSn}`
	return axios.request({
		url: url,
		data: params,
		method: 'post'
	})
}
// 盘点明细-详情
export const stockCheckDetailBySn = (params) => {
	let url = `shelfStockCheck/detail/queryBySn/${params.stockCheckDetailSn}`
	return axios.request({
		url: url,
		method: 'get'
	})
}
// 盘点明细-分页列表
export const stockCheckDetailQueryPage = (params) => {
	let url = `shelfStockCheck/detail/queryPage/${params.pageNo}/${params.pageSize}`
	delete params.pageNo
	delete params.pageSize
	return axios.request({
		url: url,
		data: params,
		method: 'post'
	})
}
// 盘点明细-列表
export const stockCheckDetailQueryList = (params) => {
	let url = `shelfStockCheck/detail/queryList/${params.stockCheckSn}`
	return axios.request({
		url: url,
		data: params,
		method: 'post'
	})
}
// 盘点明细-保存
export const stockCheckDetailSave = (params) => {
	let url = `shelfStockCheck/detail/save`
	return axios.request({
		url: url,
		data: params,
		method: 'post'
	})
}
// 盘点-详情
export const stockCheckBySn = (params) => {
	let url = `shelfStockCheck/queryBySn/${params.stockCheckSn}`
	return axios.request({
		url: url,
		method: 'get'
	})
}
// 盘点-分页列表
export const stockCheckQueryPage = (params) => {
	let url = `shelfStockCheck/queryPage/${params.pageNo}/${params.pageSize}`
	delete params.pageNo
	delete params.pageSize
	return axios.request({
		url: url,
		data: params,
		method: 'post'
	})
}

// 查询货架待取货状态的订单明细
export const queryWaitListByShelfSn = (params) => {
	let url = `shelfStockCheck/queryWaitListByShelfSn`
	return axios.request({
		url: url,
		data: params,
		method: 'post'
	})
}

// 查看经销商未完结的盘点单数量
export const queryStockCheckWaitStateNum = (params) => {
	let url = `shelfStockCheck/queryWaitStateNum`
	return axios.request({
		url: url,
		method: 'get'
	})
}
// 盘点-保存
export const stockCheckSave = (params) => {
	let url = `shelfStockCheck/save`
	return axios.request({
		url: url,
		data: params,
		method: 'post'
	})
}
// 选择货架盘点单
export const selectShelfStockCheck = (params) => {
	let url = `shelfStockCheck/selectShelfStockCheck`
	return axios.request({
		url: url,
		method: 'get'
	})
}