<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<div id="modal-orderDetail" class="modal fade" tabindex="-1" data-backdrop="static">
	<div class="modal-dialog" style="min-width: 650px;">
		<div class="modal-content">
			<div class="modal-header no-padding">
      			<div class="table-header">
					<button type="button" class="close" data-dismiss="modal" aria-hidden="true">
						<span class="white">&times;</span>
					</button>
					详情
				</div>
	      	</div>
	      	<div class="modal-body" id="modal-orderDetail-body" style="max-height: 500px;overflow-y: scroll;">
      			<div class="row">
      				<input type="hidden" name="orderId" id="mo-orderId"/>
      				<label class="col-sm-3 control-label">申请融资金额:</label>
      				<label class="col-sm-3 control-label text-right" id="mo-moneyReq"></label>
      				<label class="col-sm-3 control-label">申请融资期限:</label>
      				<label class="col-sm-3 control-label text-right" id="mo-termReq"></label>
      			</div>
      			<div class="row">
      				<label class="col-sm-3 control-label">交通责任认定书:</label>
      				<label class="col-sm-3 control-label text-right" id="mo-jtzrrds"></label>
      				<label class="col-sm-3 control-label">主要证据:</label>
      				<label class="col-sm-3 control-label text-right" id="mo-zyzj"></label>
      			</div>
      			<div class="row">
      				<label class="col-sm-3 control-label">审核问题反馈:</label>
      				<label class="col-sm-9 control-label text-right" id="mo-shwtfk">
      					<a class="btn btn-minier btn-primary" href="#" onClick="getFeedbackByType(1)">查看</a>
      				</label>
      			</div>
      			<div class="row">
      				<label class="col-sm-3 control-label">资金用途:</label>
      				<label class="col-sm-9 control-label text-right" id="mo-purpose"></label>
      			</div>
      			<div class="hr-line-dashed"></div>
      			<div class="row">
      				<label class="col-sm-3 control-label">标题:</label>
      				<label class="col-sm-3 control-label text-right" id="mo-title"></label>
      				<label class="col-sm-3 control-label">发生时间:</label>
      				<label class="col-sm-3 control-label text-right" id="mo-occurDate"></label>
      			</div>
      			<div class="row">
      				<label class="col-sm-3 control-label">事故发生概要:</label>
      				<label class="col-sm-9 control-label text-right" id="mo-info"></label>
      			</div>
      			<div class="hr-line-dashed"></div>
      			<div class="row">
      				<label class="col-sm-3 control-label">委托协议:</label>
      				<label class="col-sm-3 control-label text-right" id="mo-wtxy"></label>
      				<label class="col-sm-3 control-label">协议审核反馈:</label>
      				<label class="col-sm-3 control-label text-right" id="mo-wtxyfk">
      					<a class="btn btn-minier btn-primary" href="#" onClick="getFeedbackByType(2)">查看</a>
      				</label>
      			</div>
      			<div class="hr-line-dashed"></div>
      			<div class="row">
      				<label class="col-sm-3 control-label">融资金额:</label>
      				<label class="col-sm-3 control-label text-right" id="mo-moneyPc"></label>
      				<label class="col-sm-3 control-label">利率:</label>
      				<label class="col-sm-3 control-label text-right" id="mo-ratioFc"></label>
      			</div>
      			<div class="row">
      				<label class="col-sm-3 control-label">放款计划:</label>
      				<label class="col-sm-9 control-label text-right" id="mo-conditionDk"></label>
      			</div>
      			<div class="row">
      				<label class="col-sm-3 control-label">融资期限:</label>
      				<label class="col-sm-3 control-label text-right" id="mo-termPc"></label>
      				<label class="col-sm-3 control-label">预期赔偿金额:</label>
      				<label class="col-sm-3 control-label text-right" id="mo-damage"></label>
      			</div>
      			<div class="row">
      				<label class="col-sm-3 control-label">预期回报周期:</label>
      				<label class="col-sm-3 control-label text-right" id="mo-returnCycle"></label>
      				<label class="col-sm-3 control-label">预期年收益率:</label>
      				<label class="col-sm-3 control-label text-right" id="mo-returnRate"></label>
      			</div>
      			<div class="row">
      				<label class="col-sm-3 control-label">风险度:</label>
      				<label class="col-sm-3 control-label text-right" id="mo-rpn"></label>
      				<label class="col-sm-3 control-label">风险提示:</label>
      				<label class="col-sm-3 control-label text-right" id="mo-rpnInfo"></label>
      			</div>
      			<div class="row">
      				<label class="col-sm-3 control-label">起投金额:</label>
      				<label class="col-sm-3 control-label text-right" id="mo-moneyMin"></label>
      				<label class="col-sm-3 control-label">投资最小份额:</label>
      				<label class="col-sm-3 control-label text-right" id="mo-lotMin"></label>
      			</div>
      			<div class="hr-line-dashed"></div>
      			<div class="row">
      				<label class="col-sm-3 control-label">保险公司:</label>
      				<label class="col-sm-3 control-label text-right" id="mo-insurer"></label>
      				<label class="col-sm-3 control-label">保险类型:</label>
      				<label class="col-sm-3 control-label text-right" id="mo-policyType"></label>
      			</div>
      			<div class="row">
      				<label class="col-sm-3 control-label">保险金额:</label>
      				<label class="col-sm-3 control-label text-right" id="mo-policyMoney"></label>
      				<label class="col-sm-3 control-label">保险期限:</label>
      				<label class="col-sm-3 control-label text-right" id="mo-policyTerm"></label>
      			</div>
      			<div class="row">
      				<label class="col-sm-3 control-label">相关证据:</label>
      				<label class="col-sm-3 control-label text-right" id="mo-bxxgzj"></label>
      				<label class="col-sm-6 control-label"></label>
      			</div>
      			<div class="hr-line-dashed"></div>
      			<div class="row">
      				<label class="col-sm-3 control-label">申请人姓名:</label>
      				<label class="col-sm-3 control-label text-right" id="mo-sqname"></label>
      				<label class="col-sm-3 control-label">身份证:</label>
      				<label class="col-sm-3 control-label text-right" id="mo-sqidNum"></label>
      			</div>
      			<div class="row">
      				<label class="col-sm-3 control-label">联系方式:</label>
      				<label class="col-sm-3 control-label text-right" id="mo-sqcontactInfo"></label>
      				<label class="col-sm-3 control-label">病情:</label>
      				<label class="col-sm-3 control-label text-right" id="mo-sqillness"></label>
      			</div>
      			<div class="row">
      				<label class="col-sm-3 control-label">被抚养人:</label>
      				<label class="col-sm-9 control-label text-right" id="mo-sqdependants"></label>
      			</div>
      			<div class="row">
      				<label class="col-sm-3 control-label">户口:</label>
      				<label class="col-sm-3 control-label text-right" id="mo-sqhomeplace"></label>
      				<label class="col-sm-3 control-label">基本信息证据:</label>
      				<label class="col-sm-3 control-label text-right" id="mo-sqpBase"></label>
      			</div>
      			<div class="row">
      				<label class="col-sm-3 control-label">伤情证据:</label>
      				<label class="col-sm-3 control-label text-right" id="mo-sqpInjury"></label>
      				<label class="col-sm-3 control-label">被抚养人证据:</label>
      				<label class="col-sm-3 control-label text-right" id="mo-sqpDependants"></label>
      			</div>
      			<div class="hr-line-dashed"></div>
      			<div class="row">
      				<label class="col-sm-3 control-label">当事人:</label>
      				<label class="col-sm-3 control-label text-right" id="mo-partys">
      					<a class="btn btn-minier btn-primary" href="#" onClick="getPartysInfo()">查看</a>
      				</label>
      				<label class="col-sm-3 control-label">案件进展记录:</label>
      				<label class="col-sm-3 control-label text-right" id="mo-ajjzjl">
      					<a class="btn btn-minier btn-primary" href="#" onClick="getCaseProcess()">查看</a>
      				</label>
      			</div>
      			<div class="row">
      				<label class="col-sm-3 control-label">打款记录:</label>
      				<label class="col-sm-3 control-label text-right" id="mo-dkjl">
      					<a class="btn btn-minier btn-primary" href="#" onClick="getPayRecords()">查看</a>
      				</label>
      				<label class="col-sm-3 control-label">投资律师:</label>
      				<label class="col-sm-3 control-label text-right" id="mo-tzls">
      					<a class="btn btn-minier btn-primary" href="#" onClick="getBuyRecords()">查看</a>
      				</label>
      			</div>
      			<div class="row">
      				<label class="col-sm-3 control-label">取消原因:</label>
      				<label class="col-sm-3 control-label text-right" id="mo-dkjl">
      					<a class="btn btn-minier btn-primary" href="#" onClick="getFeedbackByType(3)">查看</a>
      				</label>
      				<label class="col-sm-6 control-label"></label>
      			</div>
	      	</div>
		</div>
	</div>
</div>

<div id="modal-records" class="modal fade" tabindex="-1" data-backdrop="static">
	<div class="modal-dialog" style="min-width: 650px;">
		<div class="modal-content">
			<div class="modal-header no-padding">
      			<div class="table-header">
					<button type="button" class="close" data-dismiss="modal" aria-hidden="true">
						<span class="white">&times;</span>
					</button>
					记录
				</div>
	      	</div>
	      	<div class="modal-body" id="modal-records-body" style="max-height: 500px;overflow-y: scroll;">
      			
	      	</div>
		</div>
	</div>
</div>

<div id="modal-caseProcess" class="modal fade" tabindex="-1" data-backdrop="static">
	<div class="modal-dialog" style="min-width: 650px;">
		<div class="modal-content">
			<div class="modal-header no-padding">
      			<div class="table-header">
					<button type="button" class="close" data-dismiss="modal" aria-hidden="true">
						<span class="white">&times;</span>
					</button>
					案件进展记录
				</div>
	      	</div>
	      	<div class="modal-body" id="modal-caseProcess-body" style="max-height: 500px;overflow-y: scroll;">
	      		<div class="row">
	      			<label class="col-sm-12 control-label"><h4>调解</h4></label>
	      		</div>
      			<div class="row">
      				<label class="col-sm-3 control-label">调解时间:</label>
      				<label class="col-sm-3 control-label text-right" id="mcp-tj-time"></label>
      				<label class="col-sm-3 control-label">参加人:</label>
      				<label class="col-sm-3 control-label text-right" id="mcp-tj-joinPerson"></label>
      			</div>
      			<div class="row">
      				<label class="col-sm-3 control-label">当事人获得金额:</label>
      				<label class="col-sm-3 control-label text-right" id="mcp-tj-money"></label>
      				<label class="col-sm-3 control-label">调解协议:</label>
      				<label class="col-sm-3 control-label text-right" id="mcp-tj-tjxy"></label>
      			</div>
      			<div class="row">
      				<label class="col-sm-3 control-label">备注:</label>
      				<label class="col-sm-9 control-label text-right" id="mcp-tj-remark"></label>
      			</div>
      			<div class="hr-line-dashed"></div>
	      		<div class="row">
	      			<label class="col-sm-12 control-label"><h4>一审</h4></label>
	      		</div>
      			<div class="row">
      				<label class="col-sm-3 control-label">立案时间:</label>
      				<label class="col-sm-3 control-label text-right" id="mcp-ys-timela"></label>
      				<label class="col-sm-3 control-label">起诉状:</label>
      				<label class="col-sm-3 control-label text-right" id="mcp-ys-qsz"></label>
      			</div>
      			<div class="row">
      				<label class="col-sm-3 control-label">证据清单:</label>
      				<label class="col-sm-3 control-label text-right" id="mcp-ys-zjqd"></label>
      				<label class="col-sm-3 control-label">立案通知书:</label>
      				<label class="col-sm-3 control-label text-right" id="mcp-ys-latzs"></label>
      			</div>
      			<div class="row">
      				<label class="col-sm-3 control-label">诉讼费缴费单:</label>
      				<label class="col-sm-3 control-label text-right" id="mcp-ys-ssfjfd"></label>
      				<label class="col-sm-3 control-label">一审立案备注:</label>
      				<label class="col-sm-3 control-label text-right" id="mcp-ys-remarkla"></label>
      			</div>
      			<div class="row">
      				<label class="col-sm-3 control-label">开庭时间:</label>
      				<label class="col-sm-3 control-label text-right" id="mcp-ys-timekt"></label>
      				<label class="col-sm-3 control-label">开庭传票:</label>
      				<label class="col-sm-3 control-label text-right" id="mcp-ys-ktcp"></label>
      			</div>
      			<div class="row">
      				<label class="col-sm-3 control-label">答辩状:</label>
      				<label class="col-sm-3 control-label text-right" id="mcp-ys-dbz"></label>
      				<label class="col-sm-3 control-label">证据目录:</label>
      				<label class="col-sm-3 control-label text-right" id="mcp-ys-zjml"></label>
      			</div>
      			<div class="row">
      				<label class="col-sm-3 control-label">一审开庭备注:</label>
      				<label class="col-sm-9 control-label text-right" id="mcp-ys-remarkkt"></label>
      			</div>
      			<div class="row">
      				<label class="col-sm-3 control-label">判决时间:</label>
      				<label class="col-sm-3 control-label text-right" id="mcp-ys-timepj"></label>
      				<label class="col-sm-3 control-label">裁决结果:</label>
      				<label class="col-sm-3 control-label text-right" id="mcp-ys-cjjg"></label>
      			</div>
      			<div class="row">
      				<label class="col-sm-3 control-label">当事人获赔金额:</label>
      				<label class="col-sm-3 control-label text-right" id="mcp-ys-money"></label>
      				<label class="col-sm-3 control-label">一审判决备注:</label>
      				<label class="col-sm-3 control-label text-right" id="mcp-ys-remarkpj"></label>
      			</div>
      			<div class="hr-line-dashed"></div>
	      		<div class="row">
	      			<label class="col-sm-12 control-label"><h4>二审</h4></label>
	      		</div>
      			<div class="row">
      				<label class="col-sm-3 control-label">立案时间:</label>
      				<label class="col-sm-3 control-label text-right" id="mcp-es-timela"></label>
      				<label class="col-sm-3 control-label">起诉状:</label>
      				<label class="col-sm-3 control-label text-right" id="mcp-es-qsz"></label>
      			</div>
      			<div class="row">
      				<label class="col-sm-3 control-label">证据清单:</label>
      				<label class="col-sm-3 control-label text-right" id="mcp-es-zjqd"></label>
      				<label class="col-sm-3 control-label">立案答辩状:</label>
      				<label class="col-sm-3 control-label text-right" id="mcp-es-ladbz"></label>
      			</div>
      			<div class="row">
      				<label class="col-sm-3 control-label">立案通知书:</label>
      				<label class="col-sm-3 control-label text-right" id="mcp-es-latzs"></label>
      				<label class="col-sm-3 control-label">缴费单:</label>
      				<label class="col-sm-3 control-label text-right" id="mcp-es-ssfjfd"></label>
      			</div>
      			<div class="row">
      				<label class="col-sm-3 control-label">二审立案备注:</label>
      				<label class="col-sm-9 control-label text-right" id="mcp-es-remarkla"></label>
      			</div>
      			<div class="row">
      				<label class="col-sm-3 control-label">开庭时间:</label>
      				<label class="col-sm-3 control-label text-right" id="mcp-es-timekt"></label>
      				<label class="col-sm-3 control-label">开庭传票:</label>
      				<label class="col-sm-3 control-label text-right" id="mcp-es-ktcp"></label>
      			</div>
      			<div class="row">
      				<label class="col-sm-3 control-label">答辩状:</label>
      				<label class="col-sm-3 control-label text-right" id="mcp-es-dbz"></label>
      				<label class="col-sm-3 control-label">证据目录:</label>
      				<label class="col-sm-3 control-label text-right" id="mcp-es-zjml"></label>
      			</div>
      			<div class="row">
      				<label class="col-sm-3 control-label">二审开庭备注:</label>
      				<label class="col-sm-9 control-label text-right" id="mcp-es-remarkkt"></label>
      			</div>
      			<div class="row">
      				<label class="col-sm-3 control-label">判决时间:</label>
      				<label class="col-sm-3 control-label text-right" id="mcp-es-timepj"></label>
      				<label class="col-sm-3 control-label">裁决结果:</label>
      				<label class="col-sm-3 control-label text-right" id="mcp-es-cjjg"></label>
      			</div>
      			<div class="row">
      				<label class="col-sm-3 control-label">当事人获赔金额:</label>
      				<label class="col-sm-3 control-label text-right" id="mcp-es-money"></label>
      				<label class="col-sm-3 control-label">二审判决备注:</label>
      				<label class="col-sm-3 control-label text-right" id="mcp-es-remarkpj"></label>
      			</div>
      			<div class="hr-line-dashed"></div>
	      		<div class="row">
	      			<label class="col-sm-12 control-label"><h4>执行</h4></label>
	      		</div>
      			<div class="row">
      				<label class="col-sm-3 control-label">立案时间:</label>
      				<label class="col-sm-3 control-label text-right" id="mo-zx-timela"></label>
      				<label class="col-sm-3 control-label">执行申请书:</label>
      				<label class="col-sm-3 control-label text-right" id="mo-zx-zxsqs"></label>
      			</div>
      			<div class="row">
      				<label class="col-sm-3 control-label">执行立案通知书:</label>
      				<label class="col-sm-3 control-label text-right" id="mo-zx-zxlatzs"></label>
      				<label class="col-sm-3 control-label">执行立案备注:</label>
      				<label class="col-sm-3 control-label text-right" id="mo-zx-remarkla"></label>
      			</div>
      			<div class="row">
      				<label class="col-sm-3 control-label">结束时间:</label>
      				<label class="col-sm-3 control-label text-right" id="mo-zx-timejs"></label>
      				<label class="col-sm-3 control-label">执行金额:</label>
      				<label class="col-sm-3 control-label text-right" id="mo-zx-money"></label>
      			</div>
      			<div class="row">
      				<label class="col-sm-3 control-label">执行结束备注:</label>
      				<label class="col-sm-9 control-label text-right" id="mo-zx-remarkjs"></label>
      			</div>
	      	</div>
		</div>
	</div>
</div>

<div id="modal-orderAttachs" class="modal fade" tabindex="-1" data-backdrop="static">
	<div class="modal-dialog" style="min-width: 650px;">
		<div class="modal-content">
			<div class="modal-header no-padding">
      			<div class="table-header">
					<button type="button" class="close" data-dismiss="modal" aria-hidden="true">
						<span class="white">&times;</span>
					</button>
					订单文件
				</div>
	      	</div>
	      	<div class="modal-body" id="modal-orderAttachs-body" style="max-height: 500px;overflow-y: scroll;">
      			
	      	</div>
		</div>
	</div>
</div>

<script type="text/javascript">
	var appServer = null;
	var bucket = null;
	var logoUrl = null;
	var logoThum = null;
	var logoSize = null;
	var region = null;
	
	var modalDetailIds = [{'mo-jtzrrds':['jtzrrds',1],'mo-zyzj':['zyzj',2],'mo-wtxy':['wtxy',3],'mo-bxxgzj':['bxxgzj',5],'mo-sqpBase':['sqpBase',50],
						   'mo-sqpInjury':['sqpInjury',51],'mo-sqpDependants':['sqpDependants',52]},
						  {'mo-moneyReq':'moneyReq','mo-termReq':'termReq','mo-purpose':'purpose','mo-title':'title','mo-occurDate':'occurDate',
						   'mo-info':'info','mo-moneyPc':'moneyPc','mo-ratioFc':'ratioFc','mo-conditionDk':'conditionDk','mo-termPc':'termPc',
						   'mo-damage':'damage','mo-returnCycle':'returnCycle','mo-returnRate':'returnRate','mo-rpn':'rpn','mo-rpnInfo':'rpnInfo',
						   'mo-moneyMin':'moneyMin','mo-lotMin':'lotMin','mo-insurer':'insurer','mo-policyType':'policyType','mo-policyMoney':'policyMoney',
						   'mo-policyTerm':'policyTerm','mo-sqname':'sqname','mo-sqidNum':'sqidNum','mo-sqcontactInfo':'sqcontactInfo',
						   'mo-sqillness':'sqillness','mo-sqdependants':'sqdependants','mo-sqhomeplace':'sqhomeplace'}];
	
	var modalCaseProcessIds = [{'mcp-tj-tjxy':['tjxy',40],'mcp-ys-qsz':['ysqsz',10],'mcp-ys-zjqd':['yszjqd',11],'mcp-ys-latzs':['yslatzs',12],'mcp-ys-ssfjfd':['ysssfjfd',13],
								'mcp-ys-ktcp':['ysktcp',14],'mcp-ys-dbz':['ysdbz',15],'mcp-ys-zjml':['yszjml',16],'mcp-ys-cjjg':['yscjjg',17],'mcp-es-qsz':['esqsz',20],
								'mcp-es-zjqd':['eszjqd',21],'mcp-es-ladbz':['esladbz',27],'mcp-es-latzs':['eslatzs',22],'mcp-es-ssfjfd':['esssfjfd',23],'mcp-es-ktcp':['esktcp',24],
								'mcp-es-dbz':['esdbz',25],'mcp-es-cjjg':['escjjg',26],'mo-zx-zxsqs':['zxsqs',30],'mo-zx-zxlatzs':['zxlatzs',31]},
	                           {'mcp-tj-time':'tjtime','mcp-tj-joinPerson':'tjjoinPerson','mcp-tj-money':'tjmoney','mcp-tj-remark':'tjremark',
								'mcp-ys-timela':'ystimela','mcp-ys-remarkla':'ysremarkla','mcp-ys-timekt':'ystimekt','mcp-ys-remarkkt':'ysremarkkt',
								'mcp-ys-timepj':'ystimepj','mcp-ys-money':'ysmoney','mcp-ys-remarkpj':'ysremarkpj','mcp-es-timela':'estimela',
								'mcp-es-remarkla':'esremarkla','mcp-es-timekt':'estimekt','mcp-es-remarkkt':'esremarkkt','mcp-es-timepj':'estimepj',
								'mcp-es-money':'esmoney','mcp-es-remarkpj':'esremarkpj','mo-zx-timela':'zxtimela','mo-zx-remarkla':'zxremarkla',
								'mo-zx-timejs':'zxtimejs','mo-zx-money':'zxmoney','mo-zx-remarkjs':'zxremarkjs'}];
	
	function caseProcessClear(){
		var objs = null;
		for(var i in modalCaseProcessIds){
			objs = modalCaseProcessIds[i];
			for(var o in objs){
				$('#' + o).html('');
			}
		}
	}
	
	function detailClear(){
		var objs = null;
		for(var i in modalDetailIds){
			objs = modalDetailIds[i];
			for(var o in objs){
				$('#' + o).html('');
			}
		}
	}
	
	function getBuyRecords(){
		var url = contextPath + '/ssrz/ssrzOrder/getBuyRecords';
		var parameters = {'orderId':$('#mo-orderId').val()};
		postData(url, parameters, getBuyRecordsCallback, errorCallbackDefault);
	}
	
	function getBuyRecordsCallback(data){
		if(data.success){
			$('#modal-records-body').html('');
			var html = '';
			var records = data.records;
			var r = null;
			html += '<div class="row">';
			html += 	'<label class="col-sm-3 control-label no-padding-right">时间</label>';
			html += 	'<label class="col-sm-3 control-label no-padding">姓名</label>';
			html += 	'<label class="col-sm-3 control-label no-padding-right">联系方式</label>';
			html += 	'<label class="col-sm-3 control-label no-padding">投资金额</label>';
			html += '</div>';
			for(var i in records){
				r = records[i];
				html += '<div class="row">';
				html += 	'<label class="col-sm-3 control-label no-padding-right">' + r.time + '</label>';
				html += 	'<label class="col-sm-3 control-label no-padding">' + r.name + '</label>';
				html += 	'<label class="col-sm-3 control-label no-padding-right">' + r.phone + '</label>';
				html += 	'<label class="col-sm-3 control-label no-padding">' + r.money + '</label>';
				html += '</div>';
			}
			$('#modal-records-body').html(html);
			$('#modal-records').modal('toggle');
		}else{
			showMsg(data.message);
		}
	}
	
	function getCaseProcess(){
		var orderId = $('#mo-orderId').val();
		var url = contextPath + '/ssrz/ssrzOrder/getCaseProcess';
		var parameters = {'orderId':orderId};
		postData(url, parameters, getCaseProcessCallback, errorCallbackDefault);
	}
	
	function getCaseProcessCallback(data){
		if(data.success){
			caseProcessClear();
			var objs = modalCaseProcessIds[0];
			var value,sum,html = null;
			var id = $('#mo-orderId').val();
			for(var o in objs){
				value = objs[o];
				sum = parseInt(data[value[0]]);
				if(sum > 0){
					html = '<span>共' + sum + '个</span>&emsp;';
					html += '<a class="btn btn-minier btn-primary" href="#" onClick="getOrderFilesByType(\'' + id + '\',\'' + value[1] + '\')">查看</a>&nbsp;';
					html += '<a class="btn btn-minier btn-primary" href="${contextPath}/ssrz/ssrzOrder/downloadOrderAttachsByType?id=' + id + '&key=' + value[1] + '" target="_blank">下载</a>';
				}else{
					html = '<span>共0个</span>';
				}
				$('#' + o).html(html);
			}
			objs = modalCaseProcessIds[1];
			for(var o in objs){
				$('#' + o).html(data[objs[o]]);
			}
			$('#modal-caseProcess').modal('toggle');
		}else{
			showMsg(data.message);
		}
	}
	
	function getFeedbackByType(type){
		var orderId = $('#mo-orderId').val();
		var url = contextPath + '/ssrz/ssrzOrder/getFeedbackByType';
		var parameters = {'orderId':orderId,'type':type};
		postData(url, parameters, getFeedbackByTypeCallback, errorCallbackDefault);
	}

	function getFeedbackByTypeCallback(data){
		if(data.success){
			$('#modal-records-body').html('');
			var html = '';
			var checks = data.checks;
			var c = null;
			for(var i in checks){
				c = checks[i];
				html += '<div class="row">';
				html += 	'<label class="col-sm-3 control-label no-padding-right">' + c.time + '</label>';
				html += 	'<label class="col-sm-9 control-label">' + c.info + '</label>';
				html += '</div>';
			}
			$('#modal-records-body').html(html);
			$('#modal-records').modal('toggle');
		}else{
			showMsg(data.message);
		}
	}
	
	function getOrderDetail(orderId){
		$('#mo-orderId').val(orderId);
		var url = contextPath + '/ssrz/ssrzOrder/getOrderDetail';
		var parameters = {'orderId':orderId};
		postData(url, parameters, getOrderDetailCallback, errorCallbackDefault);
	}
	
	function getOrderDetailCallback(data){
		if(data.success){
			detailClear();
			var objs = modalDetailIds[0];
			var value,sum,html = null;
			var id = $('#mo-orderId').val();
			for(var o in objs){
				value = objs[o];
				sum = parseInt(data[value[0]]);
				if(sum > 0){
					html = '<span>共' + sum + '个</span>&emsp;';
					html += '<a class="btn btn-minier btn-primary" href="#" onClick="getOrderFilesByType(\'' + id + '\',\'' + value[1] + '\')">查看</a>&nbsp;';
					html += '<a class="btn btn-minier btn-primary" href="${contextPath}/ssrz/ssrzOrder/downloadOrderAttachsByType?id=' + id + '&key=' + value[1] + '" target="_blank">下载</a>';
				}else{
					html = '<span>共0个</span>';
				}
				$('#' + o).html(html);
			}
			objs = modalDetailIds[1];
			for(var o in objs){
				$('#' + o).html(data[objs[o]]);
			}
			$('#modal-orderDetail').modal('toggle');
		}else{
			showMsg(data.message);
		}
	}
	
	function getOrderFilesByType(orderId,type){
		var url = contextPath + '/ssrz/ssrzOrder/getOrderFilesByType';
		var parameters = {'orderId' : orderId,'type' : type};
		postData(url, parameters, getOrderFilesByTypeCallback, errorCallbackDefault);
	}

	function getOrderFilesByTypeCallback(data){
		if(data.success){
			$('#modal-orderAttachs-body').html('');
			var attachs = data.attachs;
			var oa = null;
			var html = '<div class="row">'
				      + '<div class="col-md-12">';
			for(var j=0;j<attachs.length;j++){
				oa = attachs[j];
				html +=   '<a href="' + logoUrl + '/' + oa.path + '" target="_blank">';
				html +=    '<img class="lazy" src="${contextPath}/static/img/loading.gif" data-original="' + logoThum + '/' + oa.path + logoSize + '" height="100" width="100">';
				html +=   '</a>&nbsp;';
			}
			html +=     '</div>'
				     + '</div>';
			$('#modal-orderAttachs-body').html(html);
			$("#modal-orderAttachs").modal("toggle");
			setTimeout(function () {
				$("img.lazy").lazyload({
					threshold : 200
				});
			}, 200);
		}else{
			showMsg(data.message);
		}
	}
	
	function getPartysInfo(){
		var orderId = $('#mo-orderId').val();
		var url = contextPath + '/ssrz/ssrzOrder/getPartysInfo';
		var parameters = {'orderId':orderId};
		postData(url, parameters, getPartysInfoCallback, errorCallbackDefault);
	}
	
	function getPartysInfoCallback(data){
		if(data.success){
			$('#modal-records-body').html('');
			var html = '';
			var records = data.partys;
			var r = null;
			for(var i in records){
				r = records[i];
				html += '<div class="row">';
				html += 	'<label class="col-sm-3 control-label no-padding-right">姓名</label>';
				html += 	'<label class="col-sm-3 control-label no-padding">' + r.name + '</label>';
				html += 	'<label class="col-sm-3 control-label no-padding-right">身份证</label>';
				html += 	'<label class="col-sm-3 control-label no-padding">' + r.idNum + '</label>';
				html += '</div>';
				html += '<div class="row">';
				html += 	'<label class="col-sm-3 control-label no-padding-right">联系方式</label>';
				html += 	'<label class="col-sm-3 control-label no-padding">' + r.contactInfo + '</label>';
				html += 	'<label class="col-sm-3 control-label no-padding-right">责任划分</label>';
				html += 	'<label class="col-sm-3 control-label no-padding">' + r.duty + '</label>';
				html += '</div>';
				html += '<div class="row">';
				html += 	'<label class="col-sm-3 control-label no-padding-right">交通方式</label>';
				html += 	'<label class="col-sm-9 control-label no-padding">' + r.trafficType + '</label>';
				html += '</div>';
				if(i < records.length - 1){
					html += '<div class="hr-line-dashed"></div>';
				}
			}
			$('#modal-records-body').html(html);
			$('#modal-records').modal('toggle');
		}else{
			showMsg(data.message);
		}
	}

	function getPayRecords(){
		var orderId = $('#mo-orderId').val();
		var url = contextPath + '/ssrz/ssrzOrder/getPayRecords';
		var parameters = {'orderId':orderId};
		postData(url, parameters, getPayRecordsCallback, errorCallbackDefault);
	}

	function getPayRecordsCallback(data){
		if(data.success){
			$('#modal-records-body').html('');
			var html = '';
			var checks = data.checks;
			var c = null;
			for(var i in checks){
				c = checks[i];
				html += '<div class="row">';
				html += 	'<label class="col-sm-3 control-label no-padding-right">' + c.time + '</label>';
				html += 	'<label class="col-sm-9 control-label">' + c.info + '</label>';
				html += '</div>';
			}
			$('#modal-records-body').html(html);
			$('#modal-records').modal('toggle');
		}else{
			showMsg(data.message);
		}
	}

	function initPicConfig(){
		appServer = 'http://b.duowenlvshi.com/oss/token?name=b';
 		bucket = '${oss_bucket_b}';
 		region = 'oss-cn-shenzhen';
 		logoUrl = '${oss_bucket_b_url}';
 		logoThum = '${oss_bucket_b_url_img}';
 		logoSize = '?x-oss-process=image/resize,w_200,h_200';
	}
	
	jQuery(function($) {

		initPicConfig();

	});
</script>