// @ts-ignore
/* eslint-disable */
import request from '../request';

/** 采购订单审核（审核员审核） POST /operation/approveOrder */
export async function approveOrder(
	body: BusinessAPI.OrderApproveCmd,
	options?: { [key: string]: any },
) {
	return request<BusinessAPI.SingleResponseAuditVO>(
		'/operation/approveOrder',
		{
			method: 'POST',
			headers: {
				'Content-Type': 'application/json',
			},
			data: body,
			...(options || {}),
		},
	);
}

/** 获取某个状态的数量 GET /operation/countOrderByState */
export async function countOrderByState(
	// 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
	params: BusinessAPI.countOrderByStateParams,
	options?: { [key: string]: any },
) {
	return request<BusinessAPI.SingleResponseLong>(
		'/operation/countOrderByState',
		{
			method: 'GET',
			params: {
				...params,
				orderCountQry: undefined,
				...params['orderCountQry'],
			},
			...(options || {}),
		},
	);
}

/** 创建采购订单（暂存） POST /operation/createOrder */
export async function createOrder(
	body: BusinessAPI.OrderCreateCmd,
	options?: { [key: string]: any },
) {
	return request<BusinessAPI.SingleResponseOrderVO>(
		'/operation/createOrder',
		{
			method: 'POST',
			headers: {
				'Content-Type': 'application/json',
			},
			data: body,
			...(options || {}),
		},
	);
}

/** 采购订单删除 DELETE /operation/destroyOrder */
export async function destroyOrder(
	body: BusinessAPI.OrderDestroyCmd,
	options?: { [key: string]: any },
) {
	return request<BusinessAPI.Response>('/operation/destroyOrder', {
		method: 'DELETE',
		headers: {
			'Content-Type': 'application/json',
		},
		data: body,
		...(options || {}),
	});
}

/** 采购订单审批（老板审批） POST /operation/finalApproveOrder */
export async function finalApproveOrder(
	body: BusinessAPI.OrderFinalApproveCmd,
	options?: { [key: string]: any },
) {
	return request<BusinessAPI.SingleResponseAuditVO>(
		'/operation/finalApproveOrder',
		{
			method: 'POST',
			headers: {
				'Content-Type': 'application/json',
			},
			data: body,
			...(options || {}),
		},
	);
}

/** 获取上一车车次号 GET /operation/getLastVehicleNo */
export async function getLastVehicleNo(
	// 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
	params: BusinessAPI.getLastVehicleNoParams,
	options?: { [key: string]: any },
) {
	return request<BusinessAPI.SingleResponseString>(
		'/operation/getLastVehicleNo',
		{
			method: 'GET',
			params: {
				...params,
				lastVehicleNoQry: undefined,
				...params['lastVehicleNoQry'],
			},
			...(options || {}),
		},
	);
}

/** 采购订单列表 GET /operation/listOrder */
export async function listOrder(
	// 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
	params: BusinessAPI.listOrderParams,
	options?: { [key: string]: any },
) {
	return request<BusinessAPI.MultiResponseOrderVO>('/operation/listOrder', {
		method: 'GET',
		params: {
			...params,
			orderListQry: undefined,
			...params['orderListQry'],
		},
		...(options || {}),
	});
}

/** 采购订单列表 GET /operation/pageOrder */
export async function pageOrder(
	// 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
	params: BusinessAPI.pageOrderParams,
	options?: { [key: string]: any },
) {
	return request<BusinessAPI.PageResponseOrderVO>('/operation/pageOrder', {
		method: 'GET',
		params: {
			...params,
			orderPageQry: undefined,
			...params['orderPageQry'],
		},
		...(options || {}),
	});
}

/** 采购订单驳回审核（审核员驳回审核） POST /operation/rejectApproveOrder */
export async function rejectApproveOrder(
	body: BusinessAPI.OrderRejectApproveCmd,
	options?: { [key: string]: any },
) {
	return request<BusinessAPI.SingleResponseAuditVO>(
		'/operation/rejectApproveOrder',
		{
			method: 'POST',
			headers: {
				'Content-Type': 'application/json',
			},
			data: body,
			...(options || {}),
		},
	);
}

/** 采购订单驳回审批（老板驳回审批） POST /operation/rejectFinalOrder */
export async function rejectFinalOrder(
	body: BusinessAPI.OrderRejectFinalCmd,
	options?: { [key: string]: any },
) {
	return request<BusinessAPI.SingleResponseAuditVO>(
		'/operation/rejectFinalOrder',
		{
			method: 'POST',
			headers: {
				'Content-Type': 'application/json',
			},
			data: body,
			...(options || {}),
		},
	);
}

/** 采购订单第一步：车辆信息和经销商信息保存 POST /operation/saveOrderStep1 */
export async function saveOrderStep1(
	body: BusinessAPI.OrderStep1Cmd,
	options?: { [key: string]: any },
) {
	return request<BusinessAPI.SingleResponseOrderVO>(
		'/operation/saveOrderStep1',
		{
			method: 'POST',
			headers: {
				'Content-Type': 'application/json',
			},
			data: body,
			...(options || {}),
		},
	);
}

/** 采购订单第二步：供应商信息保存 POST /operation/saveOrderStep2 */
export async function saveOrderStep2(
	body: BusinessAPI.OrderStep2Cmd,
	options?: { [key: string]: any },
) {
	return request<BusinessAPI.Response>('/operation/saveOrderStep2', {
		method: 'POST',
		headers: {
			'Content-Type': 'application/json',
		},
		data: body,
		...(options || {}),
	});
}

/** 采购订单第三步：人工和辅料等费用信息保存 POST /operation/saveOrderStep3 */
export async function saveOrderStep3(
	body: BusinessAPI.OrderStep3Cmd,
	options?: { [key: string]: any },
) {
	return request<BusinessAPI.Response>('/operation/saveOrderStep3', {
		method: 'POST',
		headers: {
			'Content-Type': 'application/json',
		},
		data: body,
		...(options || {}),
	});
}

/** 采购订单详情 GET /operation/showOrder */
export async function showOrder(
	// 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
	params: BusinessAPI.showOrderParams,
	options?: { [key: string]: any },
) {
	return request<BusinessAPI.SingleResponseOrderVO>('/operation/showOrder', {
		method: 'GET',
		params: {
			...params,
			orderShowQry: undefined,
			...params['orderShowQry'],
		},
		...(options || {}),
	});
}

/** 采购订单提审（产地/市场采购员提审） POST /operation/submitReviewOrder */
export async function submitReviewOrder(
	body: BusinessAPI.OrderSubmitReviewCmd,
	options?: { [key: string]: any },
) {
	return request<BusinessAPI.SingleResponseAuditVO>(
		'/operation/submitReviewOrder',
		{
			method: 'POST',
			headers: {
				'Content-Type': 'application/json',
			},
			data: body,
			...(options || {}),
		},
	);
}

/** 采购订单更新 PUT /operation/updateOrder */
export async function updateOrder(
	body: BusinessAPI.OrderUpdateCmd,
	options?: { [key: string]: any },
) {
	return request<BusinessAPI.SingleResponseOrderVO>(
		'/operation/updateOrder',
		{
			method: 'PUT',
			headers: {
				'Content-Type': 'application/json',
			},
			data: body,
			...(options || {}),
		},
	);
}

/** 采购订单更新 PATCH /operation/updateOrder */
export async function updateOrder1(
	body: BusinessAPI.OrderUpdateCmd,
	options?: { [key: string]: any },
) {
	return request<BusinessAPI.SingleResponseOrderVO>(
		'/operation/updateOrder',
		{
			method: 'PATCH',
			headers: {
				'Content-Type': 'application/json',
			},
			data: body,
			...(options || {}),
		},
	);
}

/** 采购订单撤回提审（产地/市场采购员撤回提审） POST /operation/withdrawReviewOrder */
export async function withdrawReviewOrder(
	body: BusinessAPI.OrderWithdrawReviewCmd,
	options?: { [key: string]: any },
) {
	return request<BusinessAPI.SingleResponseAuditVO>(
		'/operation/withdrawReviewOrder',
		{
			method: 'POST',
			headers: {
				'Content-Type': 'application/json',
			},
			data: body,
			...(options || {}),
		},
	);
}
