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.
 
 
 

1708 lines
49 KiB

/***************************************************************
* <p>ProName:EdorIRInput.js</p>
* <p>Title:替换被保险人</p>
* <p>Description:替换被保险人</p>
* <p>Copyright:Copyright (c) 2012</p>
* <p>Company:Sinosoft</p>
* @author : weigh
* @version : 8.0
* @date : 2014-06-24
****************************************************************/
var showInfo;
var turnPage = new turnPageClass();
var turnPage1 = new turnPageClass();
var turnPage2 = new turnPageClass();
var turnPage3 = new turnPageClass();
var turnPage4 = new turnPageClass();
var mOperate = "";//操作状态
var tSQLInfo = new SqlClass();
var tQuerFlag;
var Hidrelatomain=null;
/**
* 提交数据后返回操作
*/
function resultAfterSubmit(tFlagStr,tContent,result) {
afterSubmit(tFlagStr,tContent,result.Insuredid);
}
function afterSubmit(tFlagStr, tContent,tInsuredid) {
if (typeof(showInfo) == "object" && typeof(showInfo) != "unknown") {
showInfo.close();
}
if (tFlagStr == "Fail") {
var urlStr = "../common/jsp/MessagePage.jsp?picture=C&content=" + encodeURIComponent(tContent);
//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(tContent);
//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();
if(mOperate == "INSERT"){
clearPage();
queryOldClick();
initBnfGrid();
initQueryInfoGrid();
queryUpdateClick(2);
}else if(mOperate == "UPDATE"){
clearPage();
initQueryInfoGrid();
initBnfGrid();
//queryBnf01(tInsuredid);
queryUpdateClick(2);
divQueryPage.style.display="";
divQuerybnf.style.display="none";
}else if(mOperate=="DELETE"){
queryOldClick();
queryUpdateClick(2);
clearPage();
initQueryInfoGrid();
initBnfGrid();
}
}
}
/**
* 人员清单校验
*/
function insuredListCheck() {
fm.Operate.value = "CHECKLIST";
tOperate = "CHECKLIST";
fm.action = "../API/grp_pa/g_pos/EdorInsuredDealSave/ADD";
ajaxSubmit2(document.getElementById("fm"));
initForm();
fm.action ="../API/grp_pa/g_pos/EdorIRSave/ADD";
}
/**
* 提交
*/
function submitForm() {
var i = 0;
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();
fm.Operate.value = mOperate;
// fm.submit();
ajaxSubmit2(document.getElementById("fm"), resultAfterSubmit);
}
/**
* 查询原被保人信息
*/
function queryOldClick(){
tSQLInfo = new SqlClass();
tSQLInfo.setResourceName("g_pos.EdorIRSql");
tSQLInfo.setSqlId("EdorIRSql6");
tSQLInfo.addSubPara(fm.GrpPropNo.value);
tSQLInfo.addSubPara(fm.OldInsuredName.value);
tSQLInfo.addSubPara(fm.OldInsuredIDNo.value);
tSQLInfo.addSubPara(fm.ContPlanCodeOld.value);
tSQLInfo.addSubPara(tEdorAppNo);
tSQLInfo.setModule("grp_pa");
initOldInsuredInfoGrid();
initUpdateInsuredInfoGrid();
divQuerySpe.style.display="none";
fm.Serialno.value="";
turnPage1.queryModal(tSQLInfo.getString(), OldInsuredInfoGrid, 1, 1,10);
if (!turnPage1.strQueryResult) {
i18nAlert("未查询到符合条件的查询结果!", "LIS-03016");
}
}
/**
* 查询修改后被保人信息
*/
function queryUpdateClick(o){
tSQLInfo = new SqlClass();
tSQLInfo.setResourceName("g_pos.EdorIRSql");
tSQLInfo.setSqlId("EdorIRSql12");
tSQLInfo.addSubPara(fm.GrpPropNo.value);
tSQLInfo.addSubPara(fm.EdorType.value);
tSQLInfo.addSubPara(fm.EdorAppNo.value);
tSQLInfo.addSubPara(NullToEmpty(fm.EdorNo.value));
tSQLInfo.addSubPara(fm.InsuredNameOld.value);
tSQLInfo.addSubPara(fm.InsuredIDNoOld.value);
tSQLInfo.addSubPara("");
tSQLInfo.addSubPara(fm.InsuredNameUp.value);
tSQLInfo.addSubPara(fm.InsuredIDNoUp.value);
tSQLInfo.setModule("grp_pa");
initOldInsuredInfoGrid();
initUpdateInsuredInfoGrid();
clearPage();
initBnfGrid();
divQuerySpe.style.display="none";
turnPage2.queryModal(tSQLInfo.getString(), UpdateInsuredInfoGrid, 1, 1,10);
if(o=='1'){
if (!turnPage2.strQueryResult) {
i18nAlert("未查询到符合条件的查询结果!", "LIS-03016");
}
}
}
/**
* 新增
*/
function addRecord() {
var tSelNo = OldInsuredInfoGrid.getSelNo();
if(tSelNo=='0'){
i18nAlert("请选择一条原被保人信息进行保存!", "LIS-03829");
return false;
}
mOperate = "INSERT";
if (!beforeSubmit()) {
return false;
}
submitForm();
}
/**
* 修改
*/
function modifyRecord() {
var tSelNo = UpdateInsuredInfoGrid.getSelNo();
if(tSelNo=='0'){
i18nAlert("请选择一条修改过的被保人信息进行修改!", "LIS-03830");
return false;
}
mOperate = "UPDATE";
if (!beforeSubmit()) {
return false;
}
fm.action = "../API/grp_pa/g_pos/EdorIRSave/UPDATE";
submitForm();
}
/**
* 撤销
*/
function deleteRecord(){
var tSelNo = UpdateInsuredInfoGrid.getSelNo();
if(tSelNo=='0'){
i18nAlert("请选择一条修改过的被保人信息进行删除!", "LIS-03831");
return false;
}
mOperate = "DELETE";
fm.action = "../API/grp_pa/g_pos/EdorIRSave/DELETE";
submitForm();
}
/**
* 根据前台页面进行下拉控制
**/
function returnShowCodeList (value1, value2, value3) {
if (value1=='city') {
if (isEmpty(fm.ProvinceName)) {
i18nAlert("请选择省!", "LIS-00795");
return false;
}
var tProvince = fm.ProvinceCode.value;
return showCodeList('city',value2,value3,null,tProvince,'UpPlaceName','1',180);
} else if (value1=='district') {
if (isEmpty(fm.ProvinceName)) {
i18nAlert("请选择省!", "LIS-00795");
return false;
}
if (isEmpty(fm.CityName)) {
i18nAlert("请选择市!", "LIS-00796");
return false;
}
var tCity = fm.CityCode.value;
return showCodeList('district',value2,value3,null,tCity,'UpPlaceName','1',180);
}
}
function returnShowCodeLisKey (value1, value2, value3) {
if (value1=='city') {
if (isEmpty(fm2.ProvinceName)) {
i18nAlert("请选择省!", "LIS-00795");
return false;
}
var tProvince = fm.ProvinceCode.value;
return showCodeList('city',value2,value3,null,tProvince,'UpPlaceName','1',180);
} else if (value1=='district') {
if (isEmpty(fm.ProvinceName)) {
i18nAlert("请选择省!", "LIS-00795");
return false;
}
if (isEmpty(fm.CityName)) {
i18nAlert("请选择市!", "LIS-00796");
return false;
}
var tCity = fm.CityCode.value;
return showCodeList('district',value2,value3,null,tCity,'UpPlaceName','1',180);
}
}
/**
* 下拉框选择后处理
*/
function afterCodeSelect(tSelectValue, tObj) {
if(tSelectValue=='bnftype'){
if(tObj.value == "法定受益人"){
var rowNumber = BnfGrid.lastFocusRowNo;
BnfGrid.setRowColData(rowNumber, 14, "1");
}
}
if(tSelectValue=='relation'){
if(Hidrelatomain !='00'){
if(fm.relatomain.value=='00'){
i18nAlert("附属被保险人不能替换为本人", "LIS-03832");
fm.relatomain.value ="";
fm.relatomainName.value ="";
return false;
}
}
if (fm.relatomain.value!='00') {
document.getElementById("mainname").style.display="";
document.getElementById("mainname1").style.display="";
document.getElementById("mainIDNo").style.display="";
document.getElementById("mainCustNo1").style.display="";
}else{
document.getElementById("mainname").style.display="none";
document.getElementById("mainname1").style.display="none";
document.getElementById("mainIDNo").style.display="none";
document.getElementById("mainCustNo1").style.display="none";
}
}
}
/**
* 清空 市 和 区/县
*/
function clearCityAndCounty(){
document.all("CityName").value = "";
document.all("CityCode").value = "";
document.all("CountyName").value = "";
document.all("CountyCode").value = "";
}
/**
* 清空 区/县
*/
function clearCounty(){
document.all("CountyName").value = "";
document.all("CountyCode").value = "";
}
/**
* 校验身份证以及返回出生日期和性别、年龄
*/
function checkidtype(){
if(fm.IDNo.value.length>0 && fm.IDType.value=="") {
i18nAlert("请先选择证件类型!", "LIS-00574");
return false;
}
if(fm.IDType.value=="0"&&fm.IDNo.value.length>0) {
if((fm.IDNo.value.length!=18)){
i18nAlert("输入的身份证号位数错误", "LIS-00575");
document.all('IDNo').className = "warn";
return false;
}
if(!checkIdCard(fm.IDNo.value)) {
// document.all('IDNo').value="";
document.all('IDNo').className = "warn";
return false;
}else {
fm.InsuredBirthDay.value =getBirthdatByIdNo(fm.IDNo.value);
fm.InsuredGender.value = getSexByIDNo(fm.IDNo.value);
if(fm.InsuredGender.value=='0'){
fm.InsuredGenderName.value ='男';
}else if(fm.InsuredGender.value=='1'){
fm.InsuredGenderName.value ='女';
}
fm.InsuredAppAge.value = calAge(fm.InsuredBirthDay.value);
document.all('IDNo').className = "common";
}
}
}
/**
* 选择城市前必须先选择省份
*/
function checkProvince(){
if(fm.Province.value == ""){
i18nAlert("请先选择省份", "LIS-03010");
fm.City.value = "";
fm.CityName.value = "";
}
}
/**
* 清空关联查询的项目
*/
function clearInput(codeInput,nameInput) {
codeInput.value = "";
nameInput.value = "";
}
/**
* 查询方案信息
*/
function showContPlanCode(cObj,cObjName,cObjCode){
return showCodeList('contplan',[cObj,cObjName,cObjCode],[0,1,2],null, document.all('GrpPropNo').value ,'GrpContNo',1,null);
}
function showContPlanCodeName(cObj,cObjName,cObjCode){
return showCodeListKey('contplan',[cObj,cObjName,cObjCode],[0,1,2],null, document.all('GrpPropNo').value ,'GrpContNo',1,null);
}
//初始化职级的下拉内容
function initPosition(cObj,cName){
showCodeList('position',[cObj,cName], [0,1], null,document.all('GrpPropNo').value,'GrpContNo', 1,null);
}
// //职业类别
// function showOccupationCodeList(obj1,obj1Name,obj2,obj2Name){
// var keycode = event.keyCode;
// //回车的ascii码是13
// if(keycode!="13" && keycode!="9") {
// return;
// }
// showCodeList('occupationcode',[obj1,obj1Name,obj2,obj2Name],[0,1,2,3],null,fm.OccupationCodeName.value,'OccupationName',1);
// }
//
// function showOccupationCodeListKey(obj1,obj1Name,obj2,obj2Name){
// var keycode = event.keyCode;
// //回车的ascii码是13
// if(keycode!="13" && keycode!="9") {
// return;
// }
// showCodeList('occupationcode',[obj1,obj1Name,obj2,obj2Name],[0,1,2,3],null,fm.OccupationCodeName.value,'OccupationName',1);
// }
//职业类别
function showOccupationNameList(obj1,obj1Name,obj2,obj2Name){
var keycode = event.keyCode;
//回车的ascii码是13
// if(keycode!="13" && keycode!="9") {
// return;
// }
showCodeList('occupationcode2',[obj1,obj1Name,obj2,obj2Name],[0,1,2,3],null,fm.OccupationCodeName.value,'OccupationName',1);
}
function showOccupationNameListKey(obj1,obj1Name,obj2,obj2Name){
var keycode = event.keyCode;
//回车的ascii码是13
// if(keycode!="13" && keycode!="9") {
// return;
// }
showCodeList('occupationcode2',[obj1,obj1Name,obj2,obj2Name],[0,1,2,3],null,fm.OccupationCodeName.value,'OccupationName',1);
}
//职业类别
function showOccupationCodeList(obj1,obj1Name,obj2,obj2Name){
var keycode = event.keyCode;
//回车的ascii码是13
// if(keycode!="13" && keycode!="9") {
// return;
// }
showCodeList('occupationcode2',[obj1,obj1Name,obj2,obj2Name],[0,1,2,3],null,fm.OccupationCode.value,'OccupationCode',1);
}
function showOccupationCodeListKey(obj1,obj1Name,obj2,obj2Name){
var keycode = event.keyCode;
//回车的ascii码是13
// if(keycode!="13" && keycode!="9") {
// return;
// }
showCodeList('occupationcode2',[obj1,obj1Name,obj2,obj2Name],[0,1,2,3],null,fm.OccupationCode.value,'OccupationCode',1);
}
/**
* 选择主客户 --按回车键和Tab键时触发
*/
function selectMainUser() {
var keyCode = event.keyCode;
if (keyCode=="13"|| keyCode=="9") {
if (!selectMainUserInfo()) {
return false;
}
}
}
/**
* 选择主客户详细方法
*/
function selectMainUserInfo(){
fm.mainCustNameTemp.value = fm.mainCustName.value;
if(fm.mainCustNameTemp.value != fm.mainCustName.value.trim()){
i18nAlert("录入主被保人姓名不能带空格!", "LIS-03508");
return false;
}
if(fm.mainCustName.value !=null && fm.mainCustName.value !=''){
var arrResult = new Array();
tSQLInfo = new SqlClass();
tSQLInfo.setResourceName("g_pos.EdorIRSql");
tSQLInfo.setSqlId("EdorIRSql4");
tSQLInfo.addSubPara(fm.GrpPropNo.value);
tSQLInfo.addSubPara(fm.mainCustName.value);
tSQLInfo.addSubPara(fm.mainIDNo.value);
tSQLInfo.addSubPara(fm.mainCustName.value);
tSQLInfo.addSubPara(fm.mainIDNo.value);
tSQLInfo.addSubPara(fm.GrpPropNo.value);
tSQLInfo.addSubPara(fm.EdorType.value);
tSQLInfo.addSubPara(fm.EdorAppNo.value);
tSQLInfo.addSubPara(fm.BatchNo.value);
tSQLInfo.setModule("grp_pa");
arrResult = easyExecSql(tSQLInfo.getString());
if(arrResult=='0'){
i18nAlert("没有查询到主被保人,请先录入主被保人信息!", "LIS-03833");
fm.mainInsuredNo.value="";
fm.mainCustName.value="";
fm.mainIDNo.value="";
return false;
}
var n=arrResult[0];
if (n>1) {
showMainLCInsuredInfo();//主被保人查询
fm.mainInsuredNo.value="";
fm.mainCustName.value="";
fm.mainIDNo.value="";
}else if(n==1){
var arrResult = new Array();
tSQLInfo = new SqlClass();
tSQLInfo.setResourceName("g_pos.EdorIRSql");
tSQLInfo.setSqlId("EdorIRSql7");
tSQLInfo.addSubPara(fm.GrpPropNo.value);
tSQLInfo.addSubPara(fm.mainCustName.value);
tSQLInfo.addSubPara(fm.mainIDNo.value);
tSQLInfo.addSubPara(fm.mainCustName.value);
tSQLInfo.addSubPara(fm.mainIDNo.value);
tSQLInfo.addSubPara(fm.GrpPropNo.value);
tSQLInfo.addSubPara(fm.EdorType.value);
tSQLInfo.addSubPara(fm.EdorAppNo.value);
tSQLInfo.setModule("grp_pa");
fm.mainInsuredNo.value="";
fm.mainCustName.value="";
fm.mainIDNo.value="";
arrResult = new Array();
arrResult = easyExecSql(tSQLInfo.getString());
fm.mainInsuredNo.value = arrResult[0][1];
fm.mainCustName.value= arrResult[0][2];
fm.mainIDNo.value= arrResult[0][3];
}
}
}
/**
* 检查主被保人信息
*/
function checkMain(){
if(fm.relatomain.value !='00'){
if(fm.mainCustName.value==''){
i18nAlert("请先录入主被保险人姓名!", "LIS-03510");
fm.InsuredName.value="";
return false;
}
}
}
/**
* 选择客户 --按回车键和Tab键时触发
*/
function selectUser() {
var keyCode = event.keyCode;
if (keyCode=="13"|| keyCode=="9") {
if (!selectUserInfo()) {
return false;
}
}
}
/**
* 选择客户详细方法
*/
function selectUserInfo() {
fm.InsuredNameTemp.value = fm.InsuredName.value;
if (fm.InsuredNameTemp.value != fm.InsuredName.value.trim()) {
i18nAlert("录入被保人姓名不能带空格!", "LIS-03351");
return false;
}
if (fm.InsuredName.value!=null && fm.InsuredName.value!='') {
var arrResult = new Array();
tSQLInfo = new SqlClass();
tSQLInfo.setResourceName("g_pos.EdorIRSql");
tSQLInfo.setSqlId("EdorIRSql13");
tSQLInfo.addSubPara(fm.GrpPropNo.value);
tSQLInfo.addSubPara(fm.InsuredName.value);
tSQLInfo.setModule("grp_pa");
arrResult = easyExecSql(tSQLInfo.getString());
if(arrResult==0){
emptyCustInfo();
return ;
}
var n=arrResult[0];
if (n>1) {
showLCInsuredInfo();//客户查询
emptyCustInfo();//清空被保人客户页面信息
} else if(n==1) {
var arrResult = new Array();
tSQLInfo = new SqlClass();
tSQLInfo.setResourceName("g_pos.EdorIRSql");
tSQLInfo.setSqlId("EdorIRSql5");
tSQLInfo.addSubPara(fm.GrpPropNo.value);
tSQLInfo.addSubPara(fm.InsuredName.value);
tSQLInfo.setModule("grp_pa");
emptyCustInfo();
arrResult = new Array();
arrResult = easyExecSql(tSQLInfo.getString());
fm.InsuredName.value = arrResult[0][0];
fm.IDType.value = arrResult[0][1];
fm.IDTypeName.value = arrResult[0][2];
fm.IDNo.value = arrResult[0][3];
fm.InsuredGender.value = arrResult[0][4];
fm.InsuredGenderName.value = arrResult[0][5];
fm.InsuredBirthDay.value = arrResult[0][6];
fm.InsuredAppAge.value = arrResult[0][7];
} else {
return;
}
}
}
/**
* 清空被保人基本信息
*/
function emptyCustInfo(){
fm.IDType.value="";
fm.IDTypeName.value="";
fm.IDNo.value="";
fm.InsuredGender.value="";
fm.InsuredGenderName.value="";
fm.InsuredBirthDay.value="";
fm.InsuredAppAge.value="";
}
/**
* 客户姓名查出多条时,跳转到客户查询页面
*/
function showLCInsuredInfo() {
var tGrpPropNo=fm.GrpPropNo.value;
var tInsuredName=fm.InsuredName.value;
window.open("./EdorNIQueryMain.jsp?GrpPropNo="+tGrpPropNo+"&InsuredName="+tInsuredName+"&ManageCom="+tManageCom,"查询被保人信息",'width=950,height=520,top=0,left=0,toolbar=0,location=0,directories=0,menubar=0,scrollbars=1,resizable=1,status=0');
}
/**
* 主被保人客户姓名查出多条时,跳转到主被保人客户查询页面
*/
function showMainLCInsuredInfo() {
var tGrpPropNo=fm.GrpPropNo.value;
var tmainCustName=fm.mainCustName.value;
var tmainIDNO = fm.mainIDNo.value;
window.open("./EdorMQueryMain.jsp?GrpPropNo="+tGrpPropNo+"&mainCustName="+tmainCustName+"&ManageCom="+tManageCom+"&MainIDNO="+tmainIDNO,"查询主被保人信息",'width=950,height=520,top=0,left=0,toolbar=0,location=0,directories=0,menubar=0,scrollbars=1,resizable=1,status=0');
}
/**
* 获取返回的客户数据
*/
function showUserInfo(tArr) {
if (tArr!=null) {
var Result=new Array();
Result=tArr;
fm.InsuredName.value = Result[0];
fm.InsuredGenderName.value = Result[1];
fm.InsuredGender.value = Result[6];
fm.InsuredBirthDay.value= Result[2];
fm.IDTypeName.value = Result[3];
fm.IDType.value = Result[5];
fm.IDNo.value = Result[4];
fm.InsuredNoS.value = Result[7];
}
}
/**
* 获取返回的主客户数据
*/
function showMainUserInfo(tArr){
if (tArr!=null) {
var Result=new Array();
Result=tArr;
fm.mainInsuredNo.value=Result[7];
fm.mainIDNo.value=Result[4];
fm.mainCustName.value=Result[0];
}
}
/**
* 提交前的校验、计算
*/
function beforeSubmit() {
//不允许对附属被保险人进行替换
if(fm.relatomain.value!='00'){
// if(fm.mainCustName.value==''){
// i18nAlert("请先录入主被保人信息!", "LIS-03648");
// return false;
// }
i18nAlert("不允许对附属被保险人进行替换", "LIS-03834") ;
return false ;
}
if(!verifyForm("fm")){
return false;
}
if(checkName(fm.InsuredName.value.replace(/\s+/g,""))){
document.getElementById("InsuredName").value=fm.InsuredName.value.trim().replace(/\./g,"·").replace(/\./g,"·").replace(/\ /g,"");//前中后去空格
}else{
i18nAlert("被保险人姓名录入有误,请确认!", "LIS-BQ-0084");
return false;
}
if(fm.IDType.value!="0"&&fm.IDNo.value.length>0){
var reg2=/^[\u4e00-\u9fa5a-zA-Z0-9_]+$/;
var idstr = fm.IDNo.value;
if(!reg2.test(idstr)){
i18nAlert("证件号码中不能含有特殊字符!", "LIS-BQ-0085");
return false;
}
}
if(fm.ContPlanCode.value==""){
i18nAlert("方案编码不能为空!", "LIS-02724");
return false;
}
tSQLInfo = new SqlClass();
tSQLInfo.setResourceName("g_pos.EdorIRSql");
tSQLInfo.setSqlId("EdorIRSql10");
tSQLInfo.addSubPara(fm.GrpPropNo.value);
tSQLInfo.addSubPara(fm.ContPlanCode.value);
tSQLInfo.addSubPara(fm.sysPlanCode.value);
tSQLInfo.setModule("grp_pa");
var arrResult = easyExecSql(tSQLInfo.getString(), 1, 0, 1);
if(arrResult !=null){
i18nAlert("被保险人方案月薪计算保额不允许替换!", "LIS-03835");
return false ;
}
if (mOperate=="INSERT" || mOperate=="UPDATE") {
// if(fm.edorValDate.value ==''){
// i18nAlert("请录入保全生效日期!", "LIS-03650");
// return false ;
// }
if(fm.IDType.value == "0") {
if (fm.IDNo.value != "" && fm.IDNo.value != null) {
var tBirthday = getBirthdatByIdNo(fm.IDNo.value);
var tsex = getSexByIDNo(fm.IDNo.value);
if (tBirthday != fm.InsuredBirthDay.value) {
i18nAlert("输入的出生日期与证件号码不一致!", "");
return false;
}
if (tsex != fm.InsuredGender.value) {
i18nAlert("输入的性别与证件号码不一致!", "");
return false;
}
}
var IDType = fm.all("IDType").value;
var IDNo = fm.all("IDNo").value;
var IDStartDate = fm.all("IDStartDate").value;
var IDExpDate = fm.all("IDExpDate").value;
var Birthday = fm.all("InsuredBirthDay").value;
var InsuredAppAge = fm.all("InsuredAppAge").value;
if (IDNo != "" && IDNo != null) {
var tBirthday = getBirthdatByIdNo(IDNo);
var tsex = getSexByIDNo(IDNo);
if (tBirthday != Birthday) {
i18nAlert("输入的出生日期与证件号码不一致!", "");
return false;
}
if (tsex != fm.all("InsuredGender").value) {
i18nAlert("输入的性别与证件号码不一致!", "");
return false;
}
}
//证件有效止期校验
if (IDStartDate != "") {
var isLongValid = fm.IsLongValid.value;
var YStartDate = IDStartDate.substring(0, 4);
var YEndDate = IDExpDate.substring(0, 4);
var MStartDate = IDStartDate.substring(5, 7);
var MEndDate = IDExpDate.substring(5, 7);
var DStartDate = IDStartDate.substring(8, 10);
var DEndDate = IDExpDate.substring(8, 10);
var YSub = YEndDate - YStartDate;
var MSub = MEndDate - MStartDate;
var DSub = DEndDate - DStartDate;
var ttAppAge = calAgeNew(Birthday, IDStartDate);
if (ttAppAge < 16) {
if (YSub != 5 || MSub != 0 || DSub != 0) {
i18nAlert("客户年龄范围为小于16周岁,起止年-起期年应等于5", "LIS-BQ-0079");
return false;
}
} else if (ttAppAge >= 16 && ttAppAge <= 25) {
if (YSub != 10 || MSub != 0 || DSub != 0) {
i18nAlert("客户年龄范围为大于等于16周岁并且小于等于25周岁,起止年-起期年应等于10", "LIS-BQ-0080");
return false;
}
} else if (ttAppAge >= 26 && ttAppAge <= 45) {
if (YSub != 20 || MSub != 0 || DSub != 0) {
i18nAlert("客户年龄范围为大于等于26周岁并且小于等于45周岁,起止年-起期年应等于20", "LIS-BQ-0081");
return false;
}
} else {
if (isLongValid != "1") {
i18nAlert("客户年龄范围为大于45周岁,证件是否长期应选择【是】", "LIS-BQ-0082");
return false;
}
}
}
}
// 校验生效日期
var CurrentDate = fm.CurrentDate.value;
var birthday = fm.InsuredBirthDay.value;
var LiscenceValidDate = fm.IDExpDate.value;// 证件是否长期有效
if(birthday>CurrentDate){
i18nAlert("出生日期必须小于当前日期!", "LIS-03651");
return false ;
}
// 校验证件有效期
if(LiscenceValidDate !=""){
if(LiscenceValidDate<CurrentDate){
i18nAlert("证件有效期需大于当前日期", "LIS-03653");
return false ;
}
}
// 校验详细信息录入
if(fm.ProvinceCode.value !=""){
if(fm.CityCode.value=="" || fm.CountyCode.value ==""|| fm.DetailAddress.value=="" ){
i18nAlert("详细信息中省信息不为空,需要录入市/县/详细信息!", "LIS-03659");
return false ;
}
}
// 校验详细地址
if(!checkCity()){
return false;
}
// 校验银行信息
var tflag1 = true;
var bankFlag = 0;
// if(fm.HeadBankCode.value!=null || fm.HeadBankCode.value!=""){
// tSQLInfo = new SqlClass();
// tSQLInfo.setResourceName("g_app.LCContCommonSql");
// tSQLInfo.setSqlId("LCContCommonSql9");
// tSQLInfo.addSubPara(fm.HeadBankCode.value);
// tSQLInfo.setModule("grp_common");
//
// bankFlag = easyExecSql(tSQLInfo.getString(), 1, 0, 1);
// }
// if(bankFlag =='1'){
// if(fm.HeadBankCode.value==''&& fm.Province.value==''&& fm.City.value=='' && fm.AccName.value=='' && trim(fm.BankAccNo.value)==''){
// tflag1= true;
// }else if(fm.HeadBankCode.value !=''&& fm.Province.value!=''&& fm.City.value!='' && fm.AccName.value!='' && trim(fm.BankAccNo.value)!=''){
// tflag1= true;
// }else{
// tflag1=false;
// }
//
// } else {
// if(fm.HeadBankCode.value=='' && fm.AccName.value=='' && trim(fm.BankAccNo.value)==''){
// tflag1= true;
// }else if(fm.HeadBankCode.value !='' && fm.AccName.value!='' && trim(fm.BankAccNo.value)!=''){
// tflag1= true;
// }else{
// tflag1=false;
// }
// }
// if(tflag1==false){
// i18nAlert("请填写银行相关信息!", "LIS-03014");
// return false;
//
// }
// if(fm.HeadBankCode.value != ''){
// tSQLInfo = new SqlClass();
// tSQLInfo.setResourceName("g_pos.EdorCommonSql");
// tSQLInfo.setSqlId("EdorCommonSql7");
// tSQLInfo.addSubPara(fm.HeadBankCode.value);
// tSQLInfo.setModule("grp_pa");
//
// var arrReslut = easyExecSql(tSQLInfo.getString(), 1, 0, 1);
// if(arrReslut==null){
// i18nAlert("请选择有效的开户银行 !", "LIS-03336");
// fm.HeadBankCode.focus();
// return false;
// }
// }
if(fm.Province.value != ''){
tSQLInfo = new SqlClass();
tSQLInfo.setResourceName("g_pos.EdorCommonSql");
tSQLInfo.setSqlId("EdorCommonSql8");
tSQLInfo.addSubPara(fm.Province.value);
tSQLInfo.setModule("grp_pa");
var arrReslut = easyExecSql(tSQLInfo.getString(), 1, 0, 1);
if(arrReslut==null){
i18nAlert("请选择有效的开户行所在省!", "LIS-03337");
fm.Province.focus();
return false;
}
}
if(fm.City.value != ''){
tSQLInfo = new SqlClass();
tSQLInfo.setResourceName("g_pos.EdorCommonSql");
tSQLInfo.setSqlId("EdorCommonSql9");
tSQLInfo.addSubPara(fm.Province.value);
tSQLInfo.addSubPara(fm.City.value);
tSQLInfo.setModule("grp_pa");
var arrReslut = easyExecSql(tSQLInfo.getString(), 1, 0, 1);
if(arrReslut==null){
i18nAlert("请选择有效的开户行所在市!", "LIS-03338");
fm.City.focus();
return false;
}
}
// 校验增加受益人信息
BnfGrid.delBlankLine();
if(!valBnfInfo()){
return false;
}
var arrResult = new Array();
tSQLInfo = new SqlClass();
tSQLInfo.setResourceName("g_pos.EdorIRSql");
tSQLInfo.setSqlId("EdorIRSql4");
tSQLInfo.addSubPara(fm.GrpPropNo.value);
tSQLInfo.addSubPara(fm.mainCustName.value);
tSQLInfo.addSubPara(fm.mainIDNo.value);
tSQLInfo.addSubPara(fm.mainCustName.value);
tSQLInfo.addSubPara(fm.mainIDNo.value);
tSQLInfo.addSubPara(fm.GrpPropNo.value);
tSQLInfo.addSubPara(fm.EdorType.value);
tSQLInfo.addSubPara(fm.EdorAppNo.value);
tSQLInfo.addSubPara(fm.BatchNo.value);
tSQLInfo.setModule("grp_pa");
arrResult = easyExecSql(tSQLInfo.getString());
if(arrResult=='0'){
i18nAlert("没有查询到主被保人,请先录入主被保人信息!", "LIS-03833");
fm.mainInsuredNo.value="";
fm.mainCustName.value="";
fm.mainIDNo.value="";
return false;
}
document.all("relatomain").disabled=false;
document.all("ContPlanCode").disabled=false;
if (fm.Seniority.value!="" && fm.Seniority.value<0) {
i18nAlert("工龄必须大于等于0!", "LIS-03656");
}
if (fm.Salary.value!="" ||fm.Salary.value != null) {
var tSalary = fm.Salary.value;
if (!checkDecimalFormat(tSalary, 10, 2)) {
i18nAlert("月薪整数位不应超过10位,小数位不应超过2位!", "LIS-BQ-0086");
return false;
}
}
}
return true;
}
/**
*校验受益人信息
*/
function valBnfInfo(){
var tCount = BnfGrid.mulLineCount;
var sumRate = 0;
if(parseInt(tCount)>0){
if(!BnfGrid.checkValue("BnfGrid")){
return false;
}
for (var i=0; i<tCount;i++){
for(var j=i+1;j<tCount;j++){
if(BnfGrid.getRowColData(i,2)!=BnfGrid.getRowColData(j,2)){
i18nAlert("受益人类别只能录入一种!", "LIS-03327");
return false;
}
}
if(BnfGrid.getRowColData(i,4)==''){
if(BnfGrid.getRowColData(i,2)!='00'||BnfGrid.getRowColData(i,5)!=''||
BnfGrid.getRowColData(i,7)!=''||
BnfGrid.getRowColData(i,8)!=''||
BnfGrid.getRowColData(i,10)!=''||
BnfGrid.getRowColData(i,11)!=''||
BnfGrid.getRowColData(i,13)!=''){
i18nAlert("受益人顺序不能为空!", "LIS-03328");
return false;
}
}else{
if(BnfGrid.getRowColData(i,5)==''){
i18nAlert("受益人姓名不能为空!", "LIS-03329");
return false;
}
if(BnfGrid.getRowColData(i,2)!='02'){
if(BnfGrid.getRowColData(i,10)==''){
i18nAlert("受益人证件类型不能为空!", "LIS-03330");
return false;
}
if(BnfGrid.getRowColData(i,11)==''){
i18nAlert("受益人证件号码不能为空!", "LIS-03331");
return false;
}
if(BnfGrid.getRowColData(i,10) !=''){
if(BnfGrid.getRowColData(i,10)!='0' ){
if(BnfGrid.getRowColData(i,7)==null || BnfGrid.getRowColData(i,7) =='' && BnfGrid.getRowColData(i,8)==null || BnfGrid.getRowColData(i,8) =='' ){
i18nAlert("请输入受益人性别/出生日期!", "LIS-03332");
return false;
}
}else if(BnfGrid.getRowColData(i,10)=='0'){
if( BnfGrid.getRowColData(i,11).length!='18'){
i18nAlert("受益人身份证号码必须为18位!", "LIS-03333");
return false;
}
}
}
if(BnfGrid.getRowColData(i,13)==''){
i18nAlert("与被保险人关系不能为空!", "LIS-03334");
return false;
}
}
if(BnfGrid.getRowColData(i,14)==''){
i18nAlert("受益比例不能为空!", "LIS-03335");
return false;
}
}
}
}
return true;
}
/**
* 银行信息4为隔开
*/
function FormatString(Field){
var oldStr = Field.value;
var newStr = transformStr(oldStr,4);
Field.value = newStr;
}
function transformStr(Str,tLimit){
var newStr = "";
if(Str==null||Str==""){
return newStr;
}
if(!isInteger(tLimit)){
tLimit = 4;
}
Str = Str.replace(/\s/g,"");
var i=0;
while(i<Str.length){
newStr+=Str.charAt(i);
if((i+1)%tLimit==0){
newStr+=" ";
}
i++;
}
return newStr;
}
/**
* 获取页面信息
*/
function getCustomerInfo(){
clearPage();
initUpdateInsuredInfoGrid();
initQueryInfoGrid();
initBnfGrid();
var tSelNo= OldInsuredInfoGrid.getSelNo();
var tContNo = OldInsuredInfoGrid.getRowColData(tSelNo-1,1);
var tInsuredNo = OldInsuredInfoGrid.getRowColData(tSelNo-1,15);
var tInsuredName = OldInsuredInfoGrid.getRowColData(tSelNo-1,2);
var tIDNO = OldInsuredInfoGrid.getRowColData(tSelNo-1,8);
fm.ChInsuredName.value = tInsuredName;
fm.ChIdNo.value = tIDNO;
var querySql = "";
tSQLInfo = new SqlClass();
tSQLInfo.setResourceName("g_pos.EdorIRSql");
tSQLInfo.setSqlId("EdorIRSql1");
tSQLInfo.addSubPara(fm.GrpPropNo.value);
tSQLInfo.addSubPara(tContNo);
tSQLInfo.addSubPara(tInsuredNo);
tSQLInfo.setModule("grp_pa");
var arrResult = easyExecSql(tSQLInfo.getString(), 1, 0, 1);
if(arrResult !=null){
fm.relatomain.value = arrResult[0][1];
fm.relatomainName.value =arrResult[0][2];
Hidrelatomain = arrResult[0][1];
fm.ContPlanCode.value = arrResult[0][3];
fm.ContPlanCodeName.value = arrResult[0][4];
document.all("ContPlanCode").disabled=true;
fm.Social.value = arrResult[0][5];
fm.SocialName.value = arrResult[0][6];
if(arrResult[0][1]!='00'){
document.all("relatomain").disabled=false;
mainname.style.display="";
mainname1.style.display="";
mainIDNo.style.display="";
mainCustNo1.style.display="";
if(arrResult[0][0]==''){
i18nAlert("查询主被保人信息失败!", "LIS-03836");
return false;
}
var querySql = "";
tSQLInfo = new SqlClass();
tSQLInfo.setResourceName("g_pos.EdorIRSql");
tSQLInfo.setSqlId("EdorIRSql2");
tSQLInfo.addSubPara(fm.GrpPropNo.value);
tSQLInfo.addSubPara(tContNo);
tSQLInfo.addSubPara(arrResult[0][0]);
tSQLInfo.setModule("grp_pa");
var arrResult01 = easyExecSql(tSQLInfo.getString(), 1, 0, 1);
if(arrResult01 !=null){
fm.mainCustName.value = arrResult01[0][0];
fm.mainIDNo.value = arrResult01[0][1];
}
}else {
document.all("relatomain").disabled=true;
document.getElementById("mainname").style.display="none";
document.getElementById("mainname1").style.display="none";
document.getElementById("mainIDNo").style.display="none";
document.getElementById("mainCustNo1").style.display="none";
}
}
}
/**
* 返回上一页面
*/
function returnBack(){
top.close();
}
/**
* 清除页面信息
*/
function clearPage(){
fm.ContPlanCode.value="";
fm.ContPlanCodeName.value="";
fm.relatomain.value="00";
fm.relatomainName.value="本人";
fm.mainCustName.value="";
fm.mainIDNo.value="";
fm.InsuredName.value="";
fm.IDType.value="";
fm.IDTypeName.value="";
fm.IDNo.value="";
fm.InsuredGender.value="";
fm.InsuredGenderName.value="";
fm.InsuredBirthDay.value="";
fm.InsuredAppAge.value="";
fm.IsLongValid.value="";
fm.IsLongValidName.value="";
fm.OccupationCode.value="";
fm.OccupationCodeName.value="";
fm.OccupationType.value="";
fm.OccupationTypeName.value="";
fm.ZipCode.value="";
fm.EMail.value="";
fm.MicroNo.value="";
fm.Phone.value="";
fm.Mobile.value="";
fm.ProvinceName.value="";
fm.ProvinceCode.value="";
fm.CityName.value="";
fm.CityCode.value="";
fm.CountyName.value="";
fm.CountyCode.value="";
fm.DetailAddress.value="";
fm.ServerArea.value="";
fm.ServiceArName.value="";
fm.Substandard.value="";
fm.SubstandardName.value="";
fm.Social.value="0";
fm.SocialName.value="无";
fm.JoinCompDate.value="";
fm.Seniority.value="";
fm.Salary.value="";
fm.HeadBankCode.value="";
fm.BankCodeName.value="";
fm.AccName.value="";
fm.BankAccNo.value="";
fm.Province.value="";
fm.ProvinceName1.value="";
fm.City.value="";
fm.CityName1.value="";
// fm.ISLongValid.value="";
// fm.ISLongValidName.value="";
fm.IDExpDate.value="";
// fm.ComponyName.value="";
// fm.DeptCode.value="";
// fm.InsureCode.value="";
// fm.SubCustomerNo.value="";
// fm.SubCustomerName.value="";
fm.WorkAddress.value="";
fm.SocialAddress.value="";
fm.mainCustNameTemp.value="";
fm.InsuredNameTemp.value ="";
fm.edorValDate.value="";
fm.ChInsuredName.value ="";
fm.ChIdNo.value ="";
fm.Serialno.value ="";
fm.InsuredID.value ="";
fm.ComponyName.value ="";
fm.DeptCode.value ="";
fm.Marriage.value ="";
fm.MarriageName.value ="";
fm.WorkState.value ="";
fm.WorkStateName.value ="";
fm.AccType.value ="";
fm.AccTypeName.value ="";
fm.BankAccSub.value ="";
fm.IDStartDate.value ="";
fm.EnterPriseBurden.value ="";
fm.PersonBurden.value ="";
fm.Social.value ="";
fm.SocialName.value ="";
fm.Nationality.value ="";
fm.NationalityName.value ="";
fm.PoliticalSecuCoopFlag.value ="";
fm.PoliticalSecuCoopFlagName.value ="";
fm.IndividualBusOperFlag.value ="";
fm.IndividualBusOperFlagName.value ="";
fm.DisabledPersonFlag.value ="";
fm.DisabledPersonFlagName.value ="";
fm.NativePlace.value = "";
fm.NativePlaceName.value = "";
}
/**
* 展示替换后的被保人信息
*/
function showUpdateInsuredList(){
initOldInsuredInfoGrid();
var tSelNo = UpdateInsuredInfoGrid.getSelNo();
var tSerialno = UpdateInsuredInfoGrid.getRowColData(tSelNo-1,1);
var tInsuredID = UpdateInsuredInfoGrid.getRowColData(tSelNo-1,2);
var tChInsuredName = UpdateInsuredInfoGrid.getRowColData(tSelNo-1,3);
var tChIdNo = UpdateInsuredInfoGrid.getRowColData(tSelNo-1,4);
var ttBatchno = UpdateInsuredInfoGrid.getRowColData(tSelNo-1,14);
fm.ChInsuredName.value = tChInsuredName;
fm.ChIdNo.value = tChIdNo;
fm.Serialno.value = tSerialno;
fm.InsuredID.value = tInsuredID;
//queryBnf01(tInsuredID);
var querySql = "";
tSQLInfo = new SqlClass();
tSQLInfo.setResourceName("g_pos.EdorIRSql");
tSQLInfo.setSqlId("EdorIRSql14");
tSQLInfo.addSubPara(tSerialno);
tSQLInfo.addSubPara(tInsuredID);
tSQLInfo.addSubPara(fm.GrpPropNo.value);
tSQLInfo.addSubPara(fm.EdorAppNo.value);
tSQLInfo.addSubPara(fm.EdorType.value);
tSQLInfo.addSubPara(ttBatchno);
tSQLInfo.setModule("grp_pa");
var arrResult = easyExecSql(tSQLInfo.getString(), 1, 0, 1);
if(arrResult != null){
divQueryPage.style.display="";
divQuerybnf.style.display="none";
document.all("ContPlanCode").disabled=true;
fm.relatomain.value = arrResult[0][4];
Hidrelatomain = arrResult[0][4];
if(arrResult[0][4] != '00'){
document.all("relatomain").disabled=false;
document.getElementById("mainname").style.display="";
document.getElementById("mainname1").style.display="";
document.getElementById("mainIDNo").style.display="";
document.getElementById("mainCustNo1").style.display="";
}else{
document.all("relatomain").disabled=true;
document.getElementById("mainname").style.display="none";
document.getElementById("mainname1").style.display="none";
document.getElementById("mainIDNo").style.display="none";
document.getElementById("mainCustNo1").style.display="none";
}
showRelationtoMain01(arrResult[0][8], arrResult[0][11]);
fm.relatomainName.value = arrResult[0][5];
fm.mainCustName.value = arrResult[0][6];
fm.mainIDNo.value = arrResult[0][7];
fm.InsuredName.value = arrResult[0][8];
fm.IDType.value = arrResult[0][9];
fm.IDTypeName.value = arrResult[0][10];
fm.IDNo.value = arrResult[0][11];
fm.InsuredGender.value = arrResult[0][12];
fm.InsuredGenderName.value = arrResult[0][13];
fm.InsuredBirthDay.value = arrResult[0][14];
fm.InsuredAppAge.value = calAge(arrResult[0][14]);
fm.edorValDate.value = arrResult[0][15];
fm.ContPlanCode.value = arrResult[0][16];
fm.ContPlanCodeName.value = arrResult[0][17];
fm.OccupationCode.value = arrResult[0][18];
fm.OccupationCodeName.value = arrResult[0][19];
fm.HeadBankCode.value = arrResult[0][20];
fm.BankCodeName.value = arrResult[0][21];
fm.AccName.value = arrResult[0][22];
fm.BankAccNo.value = arrResult[0][23];
fm.Province.value = arrResult[0][24];
fm.ProvinceName1.value = arrResult[0][25];
fm.City.value = arrResult[0][26];
fm.CityName1.value = arrResult[0][27];
fm.ServerArea.value = arrResult[0][28];
fm.ServiceArName.value = arrResult[0][29];
fm.Substandard.value = arrResult[0][30];
fm.SubstandardName.value = arrResult[0][31];
fm.Social.value = arrResult[0][32];
fm.SocialName.value = arrResult[0][33];
// fm.Position.value = arrResult[0][34];
fm.JoinCompDate.value = arrResult[0][35];
fm.Seniority.value = arrResult[0][36];
fm.Salary.value = arrResult[0][37];
// fm.WorkIDNo.value = arrResult[0][38];
// fm.ISLongValid.value = arrResult[0][39];
// fm.ISLongValidName.value = arrResult[0][40];
fm.IDExpDate.value = arrResult[0][41];
fm.ComponyName.value = arrResult[0][42];
fm.DeptCode.value = arrResult[0][43];
// fm.InsureCode.value = arrResult[0][44];
//fm.SubCustomerNo.value = arrResult[0][45];
fm.WorkAddress.value = arrResult[0][46];
fm.SocialAddress.value = arrResult[0][47];
fm.ZipCode.value = arrResult[0][48];
fm.EMail.value = arrResult[0][49];
fm.MicroNo.value = arrResult[0][50];
fm.Phone.value = arrResult[0][51];
fm.Mobile.value = arrResult[0][52];
fm.ProvinceCode.value = arrResult[0][53];
fm.ProvinceName.value = arrResult[0][54];
fm.CityCode.value = arrResult[0][55];
fm.CityName.value = arrResult[0][56];
fm.CountyCode.value = arrResult[0][57];
fm.CountyName.value = arrResult[0][58];
fm.DetailAddress.value = arrResult[0][59];
//fm.SubCustomerName.value = arrResult[0][61];
fm.AccType.value = arrResult[0][62];
fm.AccTypeName.value = arrResult[0][63];
fm.BankAccSub.value = arrResult[0][64];
fm.AccAttributes.value = arrResult[0][65];
fm.AccAttributesName.value = arrResult[0][66];
fm.Marriage.value = arrResult[0][67];
fm.MarriageName.value = arrResult[0][68];
fm.WorkState.value = arrResult[0][69];
fm.WorkStateName.value = arrResult[0][70];
fm.EnterPriseBurden.value = arrResult[0][71];
fm.PersonBurden.value = arrResult[0][72];
fm.IDStartDate.value = arrResult[0][73];
fm.IDExpDate.value = arrResult[0][74];
fm.Nationality.value = arrResult[0][75];
fm.NationalityName.value = arrResult[0][76];
fm.IsLongValid.value = arrResult[0][77];
fm.IsLongValidName.value = arrResult[0][78];
fm.PoliticalSecuCoopFlag.value =arrResult[0][79];
fm.PoliticalSecuCoopFlagName.value =arrResult[0][80];
fm.IndividualBusOperFlag.value =arrResult[0][81];
fm.IndividualBusOperFlagName.value =arrResult[0][82];
fm.DisabledPersonFlag.value =arrResult[0][83];
fm.DisabledPersonFlagName.value =arrResult[0][84];
fm.NativePlace.value = arrResult[0][85];
fm.NativePlaceName.value = arrResult[0][86];
// fm.SubCustomerName.value = arrResult[0][75];
// 查询职业类别
tSQLInfo = new SqlClass();
tSQLInfo.setResourceName("g_pos.EdorIRSql");
tSQLInfo.setSqlId("EdorIRSql18");
tSQLInfo.addSubPara(arrResult[0][18]);
tSQLInfo.setModule("grp_pa");
var oarrResult = easyExecSql(tSQLInfo.getString(), 1, 0, 1);
if(oarrResult !=null){
fm.OccupationType.value = oarrResult[0][0];
fm.OccupationTypeName.value = oarrResult[0][1];
}
// fm.PositionName.value = '';
}
}
// function QueryOnKeyDown(tObject) {
//
// var keycode = event.keyCode;
// //回车的ascii码是13
// if (keycode != "13" && keycode != "9") {
// return;
// }
// var tObjectName = tObject.name;
// var tObjectValue = tObject.value;
// if (tObjectName == "OccupationTypeName") {
//
// var tOccupationTypeName = tObjectValue;
//
// tSQLInfo = new SqlClass();
// tSQLInfo.setModule("grp_pa");
// tSQLInfo.setResourceName("g_pos.EdorIRSql");
// tSQLInfo.setSqlId("EdorIRSql20");
// tSQLInfo.addSubPara(OccupationCode);
// tSQLInfo.addSubPara(fm.HospitalCode.value);
//
// var tArr = easyExecSql(tSQLInfo.getString(), 1, 0, 1);
// if (tArr==null || tArr.length==0) {
// i18nAlert("未查询到符合条件的查询结果!", "LIS-03016");
// fm.HospitalCode.value = "";
// fm.HospitalName.value = "";
// return false;
// } else {
//
// if (tArr.length==1) {
// fm.OccupationCode.value = tArr[0][0];
// fm.tOccupationTypeName.value = tArr[0][1];
//
// } else {
// showCodeList('llhospital', [fm.OccupationCode,fm.HospitalName], [0,1], null,[tHospitalName,fm.HospitalCode.value], ['HospitalName','HospitalCode'], 1);
// }
// }
//
// }
// }
/**
* 查询受益人信息
*/
function queryBnf01(insuredid){
var querySql = "";
tSQLInfo = new SqlClass();
tSQLInfo.setResourceName("g_pos.EdorIRSql");
tSQLInfo.setSqlId("EdorIRSql15");
tSQLInfo.addSubPara(fm.EdorAppNo.value);
tSQLInfo.addSubPara(insuredid);
tSQLInfo.addSubPara(fm.BatchNo.value);
tSQLInfo.setModule("grp_pa");
turnPage3.queryModal(tSQLInfo.getString(), BnfGrid, 1,0,10);
}
/**
* 查询附属被保人信息
*/
function showRelationtoMain01(mainName,mainIDNO){
var querySql = "";
tSQLInfo = new SqlClass();
tSQLInfo.setResourceName("g_pos.EdorIRSql");
tSQLInfo.setSqlId("EdorIRSql16");
tSQLInfo.addSubPara(mainName);
tSQLInfo.addSubPara(mainIDNO);
tSQLInfo.addSubPara(fm.GrpPropNo.value);
tSQLInfo.addSubPara(fm.EdorAppNo.value);
tSQLInfo.addSubPara(fm.BatchNo.value);
tSQLInfo.setModule("grp_pa");
var arrResult = easyExecSql(tSQLInfo.getString(), 1, 0, 1);
if(arrResult !='0'){
divQuerySpe.style.display="";
var querySql = "";
tSQLInfo = new SqlClass();
tSQLInfo.setResourceName("g_pos.EdorIRSql");
tSQLInfo.setSqlId("EdorIRSql17");
tSQLInfo.addSubPara(fm.GrpPropNo.value);
tSQLInfo.addSubPara(fm.EdorAppNo.value);
tSQLInfo.addSubPara(mainName);
tSQLInfo.addSubPara(mainIDNO);
tSQLInfo.addSubPara(fm.BatchNo.value);
tSQLInfo.setModule("grp_pa");
turnPage4.queryModal(tSQLInfo.getString(), QueryInfoGrid, 1, 0);
}else{
divQuerySpe.style.display="none";
}
}
function getAge() {
if (fm.InsuredBirthDay.value == "") {
return;
}
if (fm.InsuredBirthDay.value.indexOf('-') == -1) {
var Year = fm.InsuredBirthDay.value.substring(0, 4);
var Month = fm.InsuredBirthDay.value.substring(4, 6);
var Day = fm.InsuredBirthDay.value.substring(6, 8);
fm.InsuredBirthDay.value = Year + "-" + Month + "-" + Day;
if (calAge(fm.InsuredBirthDay.value) < 0) {
alert("出生日期只能为当前日期以前");
fm.InsuredAppAge.value = "";
return;
}
fm.InsuredAppAge.value = calAge(fm.InsuredBirthDay.value);
return;
}
if (calAge(fm.InsuredBirthDay.value) < 0) {
alert("出生日期只能为当前日期以前");
fm.InsuredAppAge.value = "";
return;
}
fm.InsuredAppAge.value = calAge(fm.InsuredBirthDay.value);
return;
}
function checkName(tName){
var trimName=tName.trim().replace(/\./g,"·").replace(/\./g,"·").replace(/\ /g,"");
var tCheckcValueFirst =trimName.substr(0,1);
var tCheckcValueLast = trimName.substr(trimName.length-1,trimName.length);
var tNameStr2 = /^([a-zA-Z]|[0-9]|[\u4e00-\u9fa5]|[\s]|·|★)*$/;
var tNameStr3 = /^[·]+$/;
if(trim(trimName).length < 2)
{
return false;
}
else if(/^[0-9]+$/.test(trimName))
{
return false;
}
else if(tNameStr3.test(tCheckcValueFirst) ||tNameStr3.test(tCheckcValueLast))
{
return false;
}
else if(!tNameStr2.test(trimName))
{
return false;
}
return true;
}
/**
* 校验数据整数位于小数位长度
*/
function checkDecimalFormat(cValue, cLen1, cLen2) {
if (cValue=='' || cValue==null) {//为空,
return true;
}
var tLen = (""+cValue+"").length;
var tLen1 = (""+cValue+"").indexOf(".");
var tLen2 = 0;
if (tLen1==-1) {
tLen1 = tLen;
} else {
tLen2 = tLen - tLen1 - 1;
}
if (Number(tLen1)>Number(cLen1)) {
return false;
}
if (Number(tLen2)>Number(cLen2)) {
return false;
}
return true;
}
function calEndDate(code,type){
if (type == "IDType" && fm.IDType.value == '0'){
var tapage = calAgeNew(fm.InsuredBirthDay.value,fm.IDStartDate.value);
if(tapage<16){
var tyear=caldateYear(fm.IDStartDate.value,5);
fm.IDExpDate.value = tyear;
}
if(16<=tapage&&tapage<=25){
var tyear=caldateYear(fm.IDStartDate.value,10);
fm.IDExpDate.value = tyear;
}
if(26<=tapage&&tapage<=45){
var tyear=caldateYear(fm.IDStartDate.value,20);
fm.IDExpDate.value = tyear;
}
if(tapage>=46){
fm.IDExpDate.value = '9999-01-01';
fm.IsLongValid.value ='1';
fm.IsLongValidName.value ='是';
}
}
}
function caldateYear(tdate,tyear){
tSQLInfo = new SqlClass();
tSQLInfo.setResourceName("g_pos.EdorIRSql");
tSQLInfo.setSqlId("EdorIRSql19");
tSQLInfo.setModule("grp_pa");
tSQLInfo.addSubPara(tdate);
tSQLInfo.addSubPara(tyear);
return easyExecSql(tSQLInfo.getString());
}
function checkIDEndDate(){
if(fm.IsLongValid.value.length>0 && fm.IsLongValid.value=="1") {
fm.IDExpDate.value ="9999-01-01";
}
}
/**
* 校验详细地址信息
*/
function checkCity(){
var ProvinceCode =document.all('ProvinceCode').value;
var CityCode =document.all('CityCode').value;
var CountyCode =document.all('CountyCode').value;
if(ProvinceCode !=""){
if(CityCode ==''){
CityCode ='0';
}
if(CountyCode ==''){
CountyCode ='0';
}
tSQLInfo = new SqlClass();
tSQLInfo.setResourceName("g_pos.EdorBBSql");
tSQLInfo.setSqlId("EdorBBSql4");
tSQLInfo.addSubPara(ProvinceCode);
tSQLInfo.addSubPara(CityCode);
tSQLInfo.addSubPara(CountyCode);
tSQLInfo.setModule("grp_pa");
var arrResult = easyExecSql(tSQLInfo.getString());
if(arrResult =='0'){
i18nAlert("联系地址不存在或者关联不正确", "LIS-03657");
return false;
}
}
return true;
}