var windowId,proName = window.location.pathname.split("/")[1],sysUrl = "http://"+window.location.host+"/"+proName,toEdit;
var myFlag=true,acceptFlag=true ,feedbackFlag=true,confirmFlag=true,delayFlag=true;
var jobid = $.getUrlParam("jobid");
$(function(){
	initDetailTab();
	//initOrder();
});
function initOrder(){
	$.ajax({
		url : "ywrepairjobinfoAction!get_Ywrepairjobinfo.do",
		type : "POST",
		dataType : "JSON",
		async:false,
		data : {jobid:jobid},
		success : function(res){
			if(res){
				faultdevicetypename=res.faultdevicetypename;
				if(faultdevicetypename=='服务器'){
					console.log($("#detailtab .tabs li:eq(1)"))
					$("#detailtab .tabs li:eq(1)").hide();
					$("#detailtab .tabs li:eq(2)").hide();
					$("#detailtab .tabs li:eq(3)").hide();
				}
			}
			else{
				$.showMsg("未关联到工单！")
			}
		},
		error : function(res){ }
	});
}
function initDetailTab(){
	detailtab = $("#detailtab").tabs({
		onSelect:function(title,index){
			displayTabs(index);
		}
	});
	
}
//tab切换
function displayTabs(index){
	switch(index){
		case 0:
			if(myFlag){  //我的工单
				myFlag = false;
				$("#my").prop("src",'../myWorkOrder/ywrepairmypage.jsp');
			}
			break;
		case 1:
			if(acceptFlag){	//待受理工单
				acceptFlag = false;
				$("#accept").prop("src",'../acceptWorkOrder/ywrepairacceptpage.jsp');
			}
			break;
		case 2:
			if(feedbackFlag){	//待反馈工单
				feedbackFlag = false;
				$("#feedback").prop("src",'../feedback/ywrepairjobinfo.jsp');
			}
			break;
		case 3:
			if(confirmFlag){	//反馈待确认工单
				confirmFlag = false;
				$("#confirm").prop("src",'../confirmWorkOrder/ywrepairconfirmpage.jsp');
			}
			break;
		case 4:
			if(delayFlag){		//延期审批工单
				delayFlag = false;
				$("#delay").prop("src",'../dodelayjob/ywdelayjobinfo.jsp');
			}
		case 5:
			flag = "reject";
			break;
		case 6:
			flag = "end";
			break;
		case 7:
			flag = "general";
			break;
	}
}

