setIsRead.js 2.96 KB
var type = getUrlParam("type");
var opener_windows=null;
function isread(fid){
	$.post(global.contextPath + global.modelctls.document.setIsRead, 
			{fid:fid},
			function (result) {
				refleshList(type);
	});
	
}
function setDisable(){
	//表单输入控件全不可填
	$('input').attr("disabled",true);
	//附件相关控件不可填
//	$('.div-attachment').attr("disabled",true);
//	
//	$("#_fileForm ").before("");
//	$("#originhead").append("");
	
}
function refleshList(type){
	
	opener_windows=window.opener;
	if(opener_windows==null){
		//若跳转到其他页列表刷新在当前页,否则默认刷新在第一页
			if(type=="endorsementdocumentsData")
				refshqp();
			if(type=="circulatedocumentsData")
				refshcy();
			if(type=="documentSearchData")
				refshsy();
			if(type=="supervisionlistData")
				refshdb();
			if(type=="dealedlistData")
				refshyb();
			if(type=="managerlistData")
				refshgw();
			if(type=="archivefileData")
				refshgd();
			if(type=="draftlistData")
				refshcg();
	}else{
		if(type=="endorsementdocumentsData")
			opener_windows.refshqp();
		if(type=="circulatedocumentsData")
			opener_windows.refshcy();
		if(type=="documentSearchData")
			opener_windows.refshsy();
		if(type=="supervisionlistData")
			opener_windows.refshdb();
		if(type=="dealedlistData")
			opener_windows.refshyb();
		if(type=="managerlistData")
			opener_windows.refshgw();
		if(type=="archivefileData")
			opener_windows.refshgd();
		if(type=="draftlistData")
			opener_windows.refshcg();
		if(type==""){
			//控制台报opener_windows.refshcy();不是一个函数的错
			//opener_windows.refshcy();

		}
	}
	
	
	
}
function changegw(obj){
	var pid=$("#pid").val();
	var text = $(obj).text();
	if(text=="全部"){
		$("#selectHtml").html("全部<span class='caret' style=\"margin-left:5px;\"></span>");
		getGWsearch("",pid);
	}
	if(text=="公文"){
		$("#selectHtml").html("公文<span class='caret' style=\"margin-left:5px;\"></span>");
		getGWsearch("GW",pid);
	}
	if(text=="附件"){
		$("#selectHtml").html("附件<span class='caret' style=\"margin-left:5px;\"></span>");
		getGWsearch("FJ",pid);
	}
	if(text=="会议"){
		$("#selectHtml").html("会议<span class='caret' style=\"margin-left:5px;\"></span>");
		getGWsearch("HY",pid);
	}
	if(text=="审批"){
		$("#selectHtml").html("审批<span class='caret' style=\"margin-left:5px;\"></span>");
		getGWsearch("SP",pid);
	}
	if(text=="档案"){
		$("#selectHtml").html("档案<span class='caret' style=\"margin-left:5px;\"></span>");
		getGWsearch("DA",pid);
	}
}

/**
 * 关闭当前标签时调用
 */
$(window).unload(function(){
	if(documenttype!=undefined){
		if(documenttype=="发文"){
			if(numberValue==""){return;}
			var loginUserUnit=logginUnit[0].name;
			//若保存了文号,则更新为在用并且显示1, Y
			if(isSaveNumber){
				
				updateNumber(numberValue,loginUserUnit,"1","Y")
				
			//反之,则更新为在用并且显示 0, N
			}else{
				updateNumber(numberValue,loginUserUnit,"0","N")
			}
		}
	
	}
	
});