import request from '@/benyun/utils/request'

// 获取树形导航分类
function treeList(url : any) {
	return request({
		url: '/supply/' + url + '/treeList',
		method: 'GET',
	})
}
// 树形查询不包含禁用
function treeUseList(url : any) {
	return request({
		url: '/supply/' + url + '/treeUseList',
		method: 'GET',
	})
}
// 分页查询数据
function pageList(data : any, url : any) {
	return request({
		url: '/supply/' + url + '/page',
		method: 'GET',
		params: data
	})
}
// 保存数据
function saveList(data : any, url : any) {
	return request({
		url: '/supply/' + url + '/save',
		method: 'POST',
		data: data
	})
}
// 出库
function outbound(data : any, url : any) {
	return request({
		url: '/supply/' + url + '/outbound',
		method: 'POST',
		data: data
	})
}
// 提交数据
function submitTo(data : any, url : any) {
	return request({
		url: '/supply/' + url + '/submitTo',
		method: 'POST',
		params: data
	})
}
// 反提交数据
function cancelSubmission(data : any, url : any) {
	return request({
		url: '/supply/' + url + '/cancelSubmission',
		method: 'POST',
		params: data
	})
}
// 修改数据
function updateList(data : any, url : any) {
	return request({
		url: '/supply/' + url + '/update',
		method: 'POST',
		data: data
	})
}
// 删除数据
function deleteList(data : any, url : any) {
	return request({
		url: '/supply/' + url + '/delete',
		method: 'POST',
		params: data
	})
}
// 回收站数据
function selectDeleteList(data : any, url : any) {
	return request({
		url: '/supply/' + url + '/selectDeleteList',
		method: 'GET',
		params: data
	})
}
// 接单
function ordersaccepting(data : any, url : any) {
	return request({
		url: '/supply/' + url + '/ordersaccepting',
		method: 'GET',
		params: data
	})
}
// 拆单
function splitOrder(data : any, url : any) {
	return request({
		url: '/supply/' + url + '/splitOrder',
		method: 'POST',
		data: data
	})
}
// 终止订单
function stoporder(data : any, url : any) {
	return request({
		url: '/supply/' + url + '/stoporder',
		method: 'POST',
		params: data
	})
}
// 业务类型
function getbusinessType(url : any) {
	return request({
		url: '/supply/' + url + '/getbusinessType',
		method: 'GET'
	})
}
// 根据仓位id、物料SKUid获取库存
function getInventoryByStoridAndSkuid(data : any) {
	return request({
		url: '/supply/supplyInventory/getInventoryByStoridAndSkuid',
		method: 'GET',
		params: data
	})
}
// 批量根据获取仓位主键和物料SKU主键获取对应库存数量
function getInventoryByStoridsAndSkuids(data : any) {
	return request({
		url: '/supply/supplyInventory/getInventoryByStoridsAndSkuids',
		method: 'POST',
		data: data
	})
}
// 详情
function single(data : any, url : any) {
	return request({
		url: '/supply/' + url + '/single',
		method: 'GET',
		params: data
	})
}

// 详情
function getSingle(url : any) {
	return request({
		url: '/supply/' + url + '/getSingle',
		method: 'GET',
	})
}

// 同步销售订单到财务系统
function addSaleOrder(data : any) {
	return request({
		url: '/supply/financeApi/addSaleOrder',
		method: 'GET',
		params: data
	})
}
// 同步入库单到财务系统
function getFinanceEntryOrder(data : any) {
	return request({
		url: '/supply/financeApi/getFinanceEntryOrder',
		method: 'GET',
		params: data
	})
}
// 同步出库单到财务系统
function addOutStock(data : any) {
	return request({
		url: '/supply/financeApi/addOutStock',
		method: 'GET',
		params: data
	})
}
// 任务清单派单（运营端）
function dispatch(data : any) {
	return request({
		url: '/supply/supplyTaskOrder/dispatch',
		method: 'POST',
		data: data
	})
}
export default {
	treeList,
	treeUseList,
	pageList,
	saveList,
	outbound,
	updateList,
	deleteList,
	selectDeleteList,
	ordersaccepting,
	splitOrder,
	stoporder,
	submitTo,
	cancelSubmission,
	getbusinessType,
	getInventoryByStoridAndSkuid,
	single,
	getSingle,
	getInventoryByStoridsAndSkuids,
	addSaleOrder,
	getFinanceEntryOrder,
	addOutStock,
	dispatch
}