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

export const getWarehouseWaitInList = (params) => {
	return http('/order/pda/warehouse-wait-in', params, {
		method: 'GET',
	})
}

// 订单详情
export const getByWarehouseId = (params) => {
	return http('/ecw/warehouse-area/getByWarehouseId', params, {
		method: 'GET',
	})
}

// 订单详情
export const getOrderInfo = (orderId) => {
	return http(`/ecw/order/info/${orderId}`, {}, {
		method: 'GET',
	})
}

//一键卸柜
export const allUnload = (params) => {
	return http('/ecw/box-load-info/allUnload', params, {
		method: 'post',
		loading: true,
		errorHandle: false,
	})
}

// 获得入仓货物详情
export const getOrderWarehouseIn = (id) => {
	return http('/order/order-warehouse-in/get-order-warehouse-in?orderId=' + id, {}, {
		method: 'GET',
	})
}

/**
 * 卸柜列表
 */
export const unloadPage = (selfNo = '', status, page = 1, rows = 20) => {
	return http('/my/shipment/unloadPage', {
		status: status,
		page: page,
		rows: rows,
    selfNo
	}, {
		method: 'post',
		loading: true,
		errorHandle: false,
	})
}


/**
 * 卸柜详情
 */
export const cabinetUnloadDetail = (shipmentId = 0) => {
	return http('/my/shipment/cabinetUnloadDetail', {
		shipmentId: shipmentId,
	}, {
		method: 'get',
		loading: true,
		errorHandle: false,
	})
}

/**
 * 提交订单异常
 */
export const unloadCabinetOrder = (params) => {
	return http('/ecw/box-cabinet-unload-abnormal/create', params, {
		method: 'post',
		loading: true,
		errorHandle: false,
	})
}

/**
 * 提交转异
 */
export const boxAbnormal = (params) => {
	return http('/ecw/box-abnormal/create', params, {
		method: 'post',
		loading: true,
		errorHandle: false,
	})
}

/**
 * 整体卸柜
 */
export const unloadApply = (params) => {
	return http('/my/shipment/unloadApply', params, {
		method: 'post',
		loading: true,
		errorHandle: true,
	})
}

//单个卸柜
///ecw/box-load-info/batchUnload
export const batchUnload = (params) => {
	return http('/ecw/box-load-info/batchUnload', params, {
		method: 'post',
		loading: true,
		errorHandle: true,
	})
}
