/**
 * 工单受理
 */
var winId	= $.getUrlParam("winId");
var records = top.$("#"+winId).panel("options").data;
$(function(){
	renderOrder();
	$('#faultpictureurl').click(function(){
		$('#pic').show();
	})
	$('img').click(function(){
		$('#pic').hide();
	})
});

//初始化工单
function renderOrder(){
	//初始化页面数据
	$("#jobid").text(transEmptyObj(records.jobnum));
	$("#alarmgradename").text(transEmptyObj(records.faultgradename));
	$("#faultdevicetypename").text(transEmptyObj(records.faultdevicetypename));
	$("#faultdevicename").text(transEmptyObj(records.faultdevicename));
	$("#faultdeviceid").text(transEmptyObj(records.faultdeviceid));
	$("#faultoccurtime").text(transEmptyObj(records.faultoccurtime));
	$("#faulttype").text(transEmptyObj(records.faulttypename));
	$("#jobprocessstatename").text(transEmptyObj(records.jobprocessstatename));
	$("#jobreportcompanyname").text(transEmptyObj(records.jobreportcompanyname));
	$("#jobreportpeoplename").text(transEmptyObj(records.jobreportpeople));
	$("#jobreportphone").text(transEmptyObj(records.jobreportphone));
	$("#jobreportcompanyname").text(records.faultdevicename)
	if (records.jobreportphone = null || records.jobreportphone == "") {
		$("#jobreportphone").text("-");
	} else {
		$("#jobreportphone").text(transEmptyObj(records.jobreportphone));
	}
	$("#jobreporttime").text(transEmptyObj(records.jobreporttime));
	$("#faultdescription").text(transEmptyObj(records.faultdescription));
	$("#faultpictureurl").html(transEmptyObj(records.faultpictureurl));//todo
	$("#confirmtime").text(records.confirmtime );
	$("#confirmdescription").text(records.confirmdescription );
	$("#confirmdescription").text(records.confirmdescription );
	var picUrl = records.faultpictureurl;
	if(picUrl != null){
		var proName = window.location.pathname.split("/")[1];
		var sysUrl = "http://"+window.location.host+"/"+proName;
		var picProxyGetUrl = sysUrl+"/sourceProxy?fileType=picUrlProxy&picUrl="+picUrl;
		$('#pic img').attr("src",picProxyGetUrl);
	}
	$("#jobacceptcompanyname").text(transEmptyObj(records.feedbackcompanyname));
	$("#jobacceptpeople").text(transEmptyObj(records.feedbackpeople));
	$("#jobacceptphone").text(transEmptyObj(records.feedbackphone));
	$("#jobaccepttime").text(transEmptyObj(records.jobaccepttime));
	$("#requirefinishtime").text(transEmptyObj(records.requirefinishtime));
	$("#faultacceptinfo").text(transEmptyObj(records.faultacceptinfo));
	$("#isdelay").text(transEmptyObj(records.isdelay)=="1"?"是":"否");
	$("#delaytime").text(transEmptyObj(records.delaytime));
	$("#delayfordescription").text(transEmptyObj(records.delayfordescription));
	$("#feedbackcompanyname").text(transEmptyObj(records.confirmcompanyname));
	$("#feedbackpeople").text(transEmptyObj(records.confirmpeople));
	$("#feedbackphone").text(transEmptyObj(records.confirmphone));
	$("#feedbacktime").text(transEmptyObj(records.feedbacktime));
	$("#feedbackinfo").text(transEmptyObj(records.feedbackinfo));
	$("#confirmfaulttype").text(records.confirmfaulttype=='1'?'监控告警':records.confirmfaulttype=='2'?'服务器告警':records.confirmfaulttype=='3'?'应用系统告警':'存储告警');
	$("#faultdevicename1").text(records.faultdevicename);

//	$("#xx7").combobox("setValue",records.xx7);
}function transEmptyObj(data){
	var result = "";
	if(data){
		result = data;
	}else{
		result = "-";
	}
	return result;
}