You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

199 lines
7.6 KiB

/***************************************************************
* <p>ProName:EdorBEInput.js</p>
* <p>Title:被保险人复效</p>
* <p>Description:被保险人复效</p>
* <p>Copyright:Copyright (c) 2012</p>
* <p>Company:Sinosoft</p>
* @author : 蔡云聪
* @version : 8.0
* @date : 2014-06-23
****************************************************************/
var showInfo;
var turnPage = new turnPageClass();
var turnPage1 = new turnPageClass();
var turnPage2 = new turnPageClass();
var mOperate = "";//操作状态
var tSQLInfo = new SqlClass();
//撤销操作
function deleteOperate() {
if(!verifyForm("fm")){
return false;
}
var ReStartDate = new Date(fm.ReStartDate.value);
var EndDate = new Date(fm.EndDate.value);
if (ReStartDate > EndDate) {
i18nAlert("复效日期不能在终止日期之后!")
return false;
}
tSQLInfo = new SqlClass();
tSQLInfo.setResourceName("g_pos.EdorBESql");
tSQLInfo.setModule("grp_pa");
tSQLInfo.setSqlId("EdorBESql4");
tSQLInfo.addSubPara(tGrpContNo);
var endResult = easyExecSql(tSQLInfo.getString(), 1, 0, 1);
var tStartDate = "";
var tReStartDate = document.all('ReStartDate').value;
if(endResult != null){
tStartDate = endResult[0][0];
if(tReStartDate <= tStartDate ){
i18nAlert("输入的恢复日期应该在当前保单的中止日期之后,请核实!", "LIS-BQ-0055");
return false;
}
}
var mySql = wrapSql("g_pos.EdorBESql", "EdorBESql7", [tGrpContNo], "grp_pa");
var upArrResul = easyExecSql(mySql);
var tCvailDate = "";
if(upArrResul != null){
tCvailDate = upArrResul[0][0];
if(ReStartDate < tCvailDate ){
i18nAlert("输入的保全恢复日期小于保单生效日期,请核实!", "LIS-13894");
return false;
}
}
mOperate = "DELETE";
fm.action = "../API/grp_pa/g_pos/EdorBESave/ADD?Operate=" + mOperate + "&EdorNo=" + tEdorNo + "&EdorType=" + tEdorType + "&EdorAppNo=" + tEdorAppNo + "&GrpContNo=" + tGrpContNo + "&MissionID=" + tMissionID + "&SubMissionID=" + tSubMissionID + "&ActivityID=" + tActivityID;
submitFunc()
ajaxSubmit2(document.getElementById("fm"));
}
function submitFunc() {
var showStr = i18nMessage("正在保存数据,请您稍候并且不要修改屏幕上的值或链接其他页面", "LIS-04525");
var urlStr = "../common/jsp/MessagePage.jsp?picture=C&content=" + encodeURIComponent(showStr);
//showInfo=window.showModelessDialog(urlStr,window,"status:no;help:0;close:0;dialogWidth:550px;dialogHeight:250px");
var name = '提示'; //网页名称,可为空;
var iWidth = 550; //弹出窗口的宽度;
var iHeight = 250; //弹出窗口的高度;
var iTop = (window.screen.availHeight - iHeight) / 2; //获得窗口的垂直位置
var iLeft = (window.screen.availWidth - iWidth) / 2; //获得窗口的水平位置
showInfo = window.open(urlStr, name, "status=no,toolbar=no,menubar=no,location=no,resizable=no,scrollbars=0,titlebar=no,height=" + iHeight + ",width=" + iWidth + ",innerHeight=" + iHeight + ",innerWidth=" + iWidth + ",left=" + iLeft + ",top=" + iTop, false);
showInfo.focus();
}
function returnbak() {
top.opener.initForm();
top.close();
}
/**
* 提交数据后返回操作
*/
function afterSubmit(FlagStr, content) {
if (typeof (showInfo) == "object" && typeof (showInfo) != "unknown") {
showInfo.close();
}
if (FlagStr == "Fail") {
var urlStr = "../common/jsp/MessagePage.jsp?picture=C&content=" + encodeURIComponent(content);
//showModalDialog(urlStr,window,"status:no;help:0;close:0;dialogWidth:550px;dialogHeight:250px");
var name = '提示'; //网页名称,可为空;
var iWidth = 550; //弹出窗口的宽度;
var iHeight = 250; //弹出窗口的高度;
var iTop = (window.screen.availHeight - iHeight) / 2; //获得窗口的垂直位置
var iLeft = (window.screen.availWidth - iWidth) / 2; //获得窗口的水平位置
showInfo = window.open(urlStr, name, "status=no,toolbar=no,menubar=no,location=no,resizable=no,scrollbars=0,titlebar=no,height=" + iHeight + ",width=" + iWidth + ",innerHeight=" + iHeight + ",innerWidth=" + iWidth + ",left=" + iLeft + ",top=" + iTop, false);
showInfo.focus();
} else {
var urlStr = "../common/jsp/MessagePage.jsp?picture=S&content=" + encodeURIComponent(content);
//showModalDialog(urlStr,window,"status:no;help:0;close:0;dialogWidth:550px;dialogHeight:250px");
var name = '提示'; //网页名称,可为空;
var iWidth = 550; //弹出窗口的宽度;
var iHeight = 250; //弹出窗口的高度;
var iTop = (window.screen.availHeight - iHeight) / 2; //获得窗口的垂直位置
var iLeft = (window.screen.availWidth - iWidth) / 2; //获得窗口的水平位置
showInfo = window.open(urlStr, name, "status=no,toolbar=no,menubar=no,location=no,resizable=no,scrollbars=0,titlebar=no,height=" + iHeight + ",width=" + iWidth + ",innerHeight=" + iHeight + ",innerWidth=" + iWidth + ",left=" + iLeft + ",top=" + iTop, false);
showInfo.focus();
}
// queryOldClick();
// queryUpClick();
}
/**
* 输入框的初始化
*/
function initInputBox() {
var arrResult;
tSQLInfo = new SqlClass();
tSQLInfo.setResourceName("g_pos.EdorBESql");
tSQLInfo.setModule("grp_pa");
tSQLInfo.setSqlId("EdorBESql2");
tSQLInfo.addSubPara(tEdorAppNo);
tSQLInfo.addSubPara(tEdorType);
try {
arrResult = easyExecSql(tSQLInfo.getString(), 1, 0);
//alert(arrResult.length);
} catch (ex) {
alert("在 GEdorTypeRDInit.jsp --> initInputBox 函数中发生异常: 初始化界面错误!");
return;
}
if (arrResult != null) {
//文本框
if (arrResult[0][0] != null && arrResult[0][0] != "") {
document.getElementsByName("Reason")[0].value = arrResult[0][0];
document.getElementsByName("ReasonName")[0].value = "保单效力恢复";
}
if ((arrResult[0][1] != null && arrResult[0][1] != "")) {
document.getElementsByName("ReStartDate")[0].value = arrResult[0][1];
queryRemainingDays();
}
document.getElementsByName("EndDate")[0].value = arrResult[0][2];
}
}
function queryRemainingDays() {
var arrResult;
if(tActivityID=='1800401002'){
tSQLInfo = new SqlClass();
tSQLInfo.setResourceName("g_pos.EdorBESql");
tSQLInfo.setModule("grp_pa");
tSQLInfo.setSqlId("EdorBESql3");
tSQLInfo.addSubPara(tGrpContNo);
tSQLInfo.addSubPara(fm.ReStartDate.value);
}else{
tSQLInfo = new SqlClass();
tSQLInfo.setResourceName("g_pos.EdorBESql");
tSQLInfo.setModule("grp_pa");
tSQLInfo.setSqlId("EdorBESql5");
tSQLInfo.addSubPara(tGrpContNo);
tSQLInfo.addSubPara(tEdorAppNo);
}
try {
arrResult = easyExecSql(tSQLInfo.getString(), 1, 0);
//alert(arrResult.length);
} catch (ex) {
alert("在 GEdorTypeRDInit.jsp --> initInputBox 函数中发生异常: 初始化界面错误!");
return;
}
if (arrResult != null) {
//文本框
document.getElementsByName("RemainingDays")[0].value = arrResult[0][0];
document.all("OldEndDate").value = arrResult[0][1];
}
}
function queryEndDate(){
var mySql = wrapSql("g_pos.EdorBESql", "EdorBESql6", [tGrpContNo], "grp_pa");
var strTemp = easyExecSql(mySql, 1, 0, 1);
if(strTemp != null) {
document.all("StopDate").value = strTemp[0][0];
}
}