<%@page import="com.sino.publicclass.base.Memory"%>
<%@page import="com.sino.rrs.entity.RcRescueVehiclePO"%>
<%@ page contentType="text/html" pageEncoding="utf-8"%>
<%@ page import="java.util.*"%>
<%@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" %>
<html>
<head>
<title>订单管理</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<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" src="http://res.wx.qq.com/open/js/jweixin-1.0.0.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="${fn:length(list)}">
<form action="CurrentOrderAction.do" method=POST name = "frm">
	<input type = "hidden" name = "CMD" value="findCurrentOrderDetail"/>
	<input type="hidden" id="orderId" name="orderId" value=""/>
	<input type="hidden" id="orderCode" name="orderCode" value=""/>
	<input type="hidden" id="rescueCode" name="rescueCode" value="${param.rescueCode }"/>
	<input type="hidden" id="serviceName" name="serviceName" value=""/>
	<input type="hidden" name="acceptFlag" id="acceptFlag" value="1"/>
</form>
 
<div class="currentOrderWrapper">
		<div class="currentOrderTitle">
			<span class="currentOrderTitleItem">当前接收的工单</span>
		</div>
		<c:forEach items="${list}" var="currentOrder" varStatus="s">
			<div class="currentOrderList" onclick="confirm1(${currentOrder.orderId},'${currentOrder.ORDER_CODE }','${currentOrder.SERVICE_NAME}')">
				<div class="currentOrderListTitle">
					<span class="line"></span>
					${currentOrder.SERVICE_NAME} / 
					<c:choose>
						<c:when test="${currentOrder.DISPATCH_FLAG==7 }">
							接受任务,等待发车
						</c:when>
						<c:when test="${currentOrder.DISPATCH_FLAG==8 }">
							救援车发车,正在赶往现场
						</c:when>
						<c:when test="${currentOrder.DISPATCH_FLAG==9 || currentOrder.DISPATCH_FLAG==91 }">
							救援车到达现场
						</c:when>
						<c:when test="${currentOrder.DISPATCH_FLAG==10 || currentOrder.DISPATCH_FLAG==11}">
							开始作业
						</c:when>
						<c:when test="${currentOrder.DISPATCH_FLAG==12 || currentOrder.DISPATCH_FLAG==121}">
							开始拖车,正在拖往目的地
						</c:when>
						<c:when test="${currentOrder.DISPATCH_FLAG==13 || currentOrder.DISPATCH_FLAG==131 ||currentOrder.DISPATCH_FLAG==132}">
							拖车到达目的地
						</c:when>
						<c:when test="${currentOrder.DISPATCH_FLAG==14 }">
							作业完成待结算
						</c:when>
						<c:when test="${currentOrder.DISPATCH_FLAG==15 }">
							完成救援服务
						</c:when>
						<c:otherwise>
							等待分派中
						</c:otherwise>
					</c:choose>
				</div>
				<div class="currentOrderCon">
					<div><span>合同名称:</span> <span>${currentOrder.contractName}</span></div>
					<div><span>订单编号:</span> <span>${currentOrder.ORDER_CODE }</span></div>
					<div><span>救援地点:</span> <span>${fn:length(currentOrder.ADDRESS)>12?fn:substring(currentOrder.ADDRESS,0,12):currentOrder.ADDRESS}</span></div>
				</div>
			</div>
		</c:forEach>
	</div>
</body>

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