<%@page import="com.sino.publicclass.base.Memory"%>
<%@ page contentType="text/html" pageEncoding="utf-8"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<%@ page isELIgnored="false" %>
<%@ page import="java.util.*"%>
<html>
<head>
<title>订单管理</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1,user-scalable=0">
<script src="/SinoGYS/js/jquery-1.7.2.js" type="text/javascript"></script>
<link rel="stylesheet" href="/SinoGYS/weixincss/weui.min.css">
<link rel="stylesheet" href="/SinoGYS/weixincss/jquery-weui.css">
<link rel="stylesheet" href="/SinoGYS/css/newCss/reset.css" />
<link rel="stylesheet" href="/SinoGYS/css/newCss/currentOrder.css" />
<script src="/SinoGYS/js/jquery-weui.js"></script>

<script type="text/javascript">
        var ohtml=document.documentElement;
        function getWidth(){
            var screenWidth=ohtml.clientWidth;
            if(screenWidth<320){
                ohtml.style.fontSize="13.3333px";
            }else if(screenWidth>1080){
                ohtml.style.fontSize="45px";
            }else{
                ohtml.style.fontSize=screenWidth/(1080/45)+"px";
            }
        }
        getWidth();
        window.onresize=function(){
            getWidth();
        };
    </script>
</head>

<body>
	<input type="hidden" id="result" name="result" value="${list }">
	<div class="currentOrderWrapper">
		<div class="currentOrderTitle">
			<span class="currentOrderTitleItem">当前接收的工单</span>
		</div>
		<c:if test="${not empty list}">
			<form action="ReceiveOrderAction.do" method=POST name = "frm">
				<input type = "hidden" name = "CMD" value="queryVehicleOrder"/>
				<input type="hidden" id="orderId" name="orderId" value="${list.ORDER_ID}">
				<input type="hidden" id="rescueVehicleId" name="rescueVehicleId" value="${param.rescueVehicleId}">
			</form>
			<div class="currentOrderList" onclick="confirm1()">
				<div class="currentOrderListTitle">
					<span class="line"></span>
					${list.SERVICE_NAME} / 
					<c:choose>
						<c:when test="${list.STATE==7 }">
							接受任务,等待发车
						</c:when>
						<c:when test="${list.STATE==8 }">
							救援车发车,正在赶往现场
						</c:when>
						<c:when test="${list.STATE==9 || list.STATE==91 }">
							救援车到达现场
						</c:when>
						<c:when test="${list.STATE==10 || list.STATE==11}">
							开始作业
						</c:when>
						<c:when test="${list.STATE==12 || list.STATE==121}">
							开始拖车,正在拖往目的地
						</c:when>
						<c:when test="${list.STATE==13 || list.STATE==131 ||list.STATE==132}">
							拖车到达目的地
						</c:when>
						<c:when test="${list.STATE==14 }">
							作业完成待结算
						</c:when>
						<c:when test="${list.STATE==15 }">
							完成救援服务
						</c:when>
						<c:otherwise>
							等待分派中
						</c:otherwise>
					</c:choose>
				</div>
				<div class="currentOrderCon">
					<div><span>订单编号:</span> <span>${list.ORDER_CODE }</span></div>
					<div><span>救援地点:</span> <span>${fn:length(list.ADDRESS)>12?fn:substring(list.ADDRESS,0,12):list.ADDRESS}</span></div>
				</div>
			</div>
		</c:if>
	</div>
</body>

<script type="text/javascript">
	if($("#result").val()==""){
		$.toast("没有了","text");
	}
	
	function confirm1(){
		$("form").submit();
	}
</script>
</html>
