日期:2014-05-16  浏览次数:20377 次

javascript Pop画面
// 主页面
	// 窗口打开个数 
	var open_flg = 0;
	// 窗口状态 
	var resultValue = null;
	// 出发地区选择 
	function popupHaisoum() {
		
		// 高度 
		var height = 600;
		// 宽度 
		var width = 1025;
		// 地址 
		var url = "TrnAcceptanceGoodsDetailPop!retrieve.action?selectKbn=Haisoum";
		// 标题 
		var title = "";
		// 没有打开窗口的情况下打开窗口 
		if(open_flg ==0){
			resultValue = window.open(url,title , 'height=' + height + ', width=' + width 
			+ ', top=' + ((window.screen.height - height) / 2 - 15) 
			+ ', left=' + ((window.screen.width - width) / 2 - 5)
			+ ', location=no, toolbar=no, menubar=no, resizable=yes,location=no, status=no');
			
		}else{
		
			// 已打开窗口关闭 
			resultValue.close();
			// 重新打开窗口 
			resultValue = window.open(url,title , 'height=' + height + ', width=' + width 
			+ ', top=' + ((window.screen.height - height) / 2 - 15) 
			+ ', left=' + ((window.screen.width - width) / 2 - 5)
			+ ', location=no, toolbar=no, menubar=no, resizable=yes,location=no, status=no');
		}
		// 窗口个数自增 
		open_flg++;
	}
	// 出发地区选择回调函数  
	function setHaisoum(syozaiCode,syozaiName,zipCode,ninushiAdr,ninushiTel){
		
		// 出发地编码 
		$("mapAcceptanceGoods.haisoumCode").value = syozaiCode;
		// 出发地名称  
		$("mapAcceptanceGoods.haisoumName").value = syozaiName;
		// 出发地邮政编码 
		$("mapAcceptanceGoods.haisoumZipCode").value = zipCode;
		// 出发地地址 
		$("mapAcceptanceGoods.haisoumTel").value = ninushiTel;
		// 出发地电话 
		$("mapAcceptanceGoods.haisoumAdr").value = ninushiAdr;
		
	}
	// 到达地区选择 
	function popupHaisous() {
	
		// 高度 
		var height = 600;
		// 宽度 
		var width = 1025;
		// 地址 
		var url = "TrnAcceptanceGoodsDetailPop!retrieve.action?selectKbn=Haisous";
		// 标题 
		var title = "";
		// 没有打开窗口的情况下打开窗口 
		if(open_flg ==0){
			resultValue = window.open(url,title , 'height=' + height + ', width=' + width 
			+ ', top=' + ((window.screen.height - height) / 2 - 15) 
			+ ', left=' + ((window.screen.width - width) / 2 - 5)
			+ ', location=no, toolbar=no, menubar=no, resizable=yes,location=no, status=no');
		}else{		
			// 已打开窗口关闭 
			resultValue.close();
			// 重新打开窗口 
			resultValue = window.open(url,title , 'height=' + height + ', width=' + width 
			+ ', top=' + ((window.screen.height - height) / 2 - 15) 
			+ ', left=' + ((window.screen.width - width) / 2 - 5)
			+ ', location=no, toolbar=no, menubar=no, resizable=yes,location=no, status=no');
		}
		// 窗口个数自增 
		open_flg++;
	}


// pop页面 

var js_select_syozaiCode = "";
var js_select_syozaiName = "";
var js_select_zipCode = "";
var js_select_ninushiAdr = "";
var js_select_ninushiTel = "";
function doSelect(syozaiCode,syozaiName,zipCode,ninushiAdr,ninushiTel){

	js_select_syozaiCode = syozaiCode;
	js_select_syozaiName = syozaiName;
	js_select_zipCode = zipCode;
	js_select_ninushiAdr = ninushiAdr;
	js_select_ninushiTel = ninushiTel;

	var selectKbn = $("selectKbn").value;

	try{
		if(selectKbn == "Haisoum"){
			window.opener.setHaisoum(js_select_syozaiCode,js_select_syozaiName,
								js_select_zipCode,js_select_ninushiAdr,js_select_ninushiTel);
		}else if( selectKbn == "Haisous"){
			window.opener.setHaisous(js_select_syozaiCode,js_select_syozaiName,
								js_select_zipCode,js_select_ninushiAdr,js_select_ninushiTel);
		}
		}catch(e){alert(e);}
	
	window.close();
	return true;

}