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

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

// // 获得订单的入仓货物详情
// export const getOrderWarehouseIn = (params) => {
// 	return http('/order/order-warehouse-in/get-order-warehouse-in', params, {
// 		method: 'GET',
// 	})
// }

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

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

// 订单详情
export const getChannel = (id) => {
	return http('/ecw/channel/get?channelId=' + id, {}, {
		method: 'GET',
	})
}
/**
 * 币种获取接口
 *
 * @param {*} params
 * @returns
 */
export const getCurrencyList = (params) => {
  return http('/ecw/currency/list', params, {
    method: 'GET',
    loading: true,
  });
};
// 入仓-追加
export const createWarehouseIn = (params) => {
	return http('/order/order-warehouse-in/create', params, {
		method: 'POST',
	})
}

// 入仓完成-转异
export const finishWarehouseIn = (params) => {
	return http('/order/order-warehouse-in/finish', params, {
		method: 'POST',
	})
}

// 获取特需
export const getSpecialListByOrderId = (params) => {
	return http('/ecw/order-special-need/getListByOrderId', params, {
		method: 'GET',
	})
}

// 获取品名-精简
export const getProductSimpleList = (params) => {
	return http('/ecw/product/simpleList', params, {
		method: 'GET',
	})
}


// 获取品名-精简
export const getProductList = (params) => {
	return http('/ecw/product/page', params, {
		method: 'GET',
	})
}


// 获得产品类型
export const getProductTypeList = (params) => {
  return http('/ecw/product-type/list', params, {
    method: 'GET',
  })
}

// 创建商品
export const addProduct = (params) => {
  return http('/ecw/product/add', params, {
    method: 'POST',
  })
}

// 获取品牌
export const getProductBrankPage = (params) => {
	return http('/ecw/product-brank/page', params, {
		method: 'GET',
	})
}

// 根据id获取品牌
export const getProductBrankById = (params) => {
  return http('/ecw/product-brank/get', params, {
    method: 'GET',
  })
}

// 获取备案信息、
export const getFeeTypeByCustomerProduct = (params) => {
	return http('/ecw/product-brank/getFeeTypeByOrderProduct', params, {
		method: 'POST',
	})
}

// 入仓
export const orderWarehouseIn = (params) => {
	return http('/order/order-warehouse-in/create', params, {
		method: 'POST',
	})
}

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

// 退仓-订单项退仓（不审批）
export const rollbackDelete = (params) => {
	return http('/order/order-warehouse-in/rollback-order-item', params, {
		method: 'PUT',
	})
}

// 入仓修改
export const orderWarehouseInUpdate = (params) => {
  return http('/order/order-warehouse-in/update', params, {
    method: 'PUT',
  })
}

// 入仓修改-工作流
export const orderWarehouseInUpdateApply = (params) => {
  return http('/order/order-warehouse-in/update-or-updateApply', params, {
    method: 'PUT',
  })
}

// // 入仓删除
export const orderWarehouseInDelete = (params) => {
	return http('/order/order-warehouse-in/delete?orderWarehouseInId=' + params.orderWarehouseInId, {}, {
		method: 'POST',
	})
}
// 入仓删除
// export const orderWarehouseInDelete = (params) => {
// 	return http('/order/order-warehouse-in/rollback-order-item', params, {
// 		method: 'PUT',
// 	})
// }
// 订单储位信息
export const listByOrderId = (params) => {
	return http('/order/location/list-by-order-id', params, {
		method: 'GET',
	})
}

// 入仓完成
export const warehouseAdjustArrived = (params) => {
	return http('/order/order-warehouse-in/warehouse-adjust-arrived', params, {
		method: 'PUT',
	})
}

// 调仓-查看最近的调仓纪录和审核状态
export const adjustLastWithStatus = (id,lang) => {
	return http('/order/order-warehouse-in/adjust-last-with-status?orderId=' + id+'&lang='+lang, {}, {
		method: 'GET',
	})
}

// 入仓修改储位
export function updateWarehouseInLocation(data){
  return http(
    '/order/location/update-warehouse-in-location',
    data,
    {
      method: 'put',
    }
  )
}


export function geLabelByOrderId(orderId) {
	return http('/order/order-warehouse-in/get-label-by-order', {orderId}, {method: 'GET'})
}
