
import http from '../../util/http'

// 备货订单列表(管理端-订单管理/管理后台 - 空运订单相关管理)
export const canReadyStockPage = (params) => {
	return http('/air/order/can-ready-stock/shipment/page', params, {
		method: 'GET',
	})
}

// 无需打包(管理端-订单管理/管理后台 - 订单仓库相关接口)
export const noNeedPack = (orderItemId) => {
	return http('/order/order-warehouse-in/no-need-to-pack', {orderItemId}, {
		method: 'GET',
	})
}

// 完成打包(管理端-订单管理/管理后台 - 订单仓库相关接口)
export const finishPack = (data) => {
	return http('/order/order-warehouse-in/finish-packed', data, {
		method: 'POST',
	})
}

// 完成备货(管理端-订单管理/管理后台 - 订单仓库相关接口)
export const finishStock = (data) => {
	return http('/order/order-warehouse-in/finish-stocked', data, {
		method: 'PUT',
	})
}

// 获得入仓项打包记录
export const getPackRecord = (params) => {
	return http('/order/item-pack-log/page', params, {
		method: 'GET',
	})
}

// 获得订单特需
export const getOrderSpecialNeed = (orderId) => {
	return http('/ecw/order-special-need/getListByOrderId', {orderId}, {
		method: 'GET',
	})
}

// 获取订单打包后首次入仓数据
export const getFirstWarehouseIn = (orderId) => {
	return http('/order/order-warehouse-in/statistics-first-finished-after-packed/' + orderId)
}

// 获取统计数据
export const getPackStatistics = (orderId) => {
	return http('/ecw/order/order-packed-page-statistics/' + orderId)
}

export function getOrderItemCommonAttr(orderId, excludeOrderWarehouseInId){
	return http( `/order/order-warehouse-in/get-order-warehouse-in-common-attr-list?orderId=${orderId}&excludeOrderWarehouseInId=${excludeOrderWarehouseInId}`)
}
