/*************************************************************** *

ProName:EdorInsuredDealInput.js

*

Title:保全人员清单处理

*

Description:保全人员清单处理

*

Copyright:Copyright (c) 2012

*

Company:Sinosoft

* @author : zhoufz * @version : 8.0 * @date : 2014-06-16 ****************************************************************/ var showInfo; var turnPage = new turnPageClass();//系统使用 var turnPage1 = new turnPageClass(); var turnPage2 = new turnPageClass(); var tOperate = "";//操作状态 var tBatchNo = "";//批次号 var tSQLInfo = new SqlClass(); /** * 人员清单查询 */ function queryClick(obj) { tSQLInfo = new SqlClass(); tSQLInfo.setResourceName("g_pos.EdorInsuredDealSql"); tSQLInfo.setSqlId("EdorInsuredDealSql1"); tSQLInfo.addSubPara(tEdorAppNo); tSQLInfo.addSubPara(fm.EdorType.value); tSQLInfo.addSubPara(fm.InsuredName.value); tSQLInfo.addSubPara(fm.InsuredIDNo.value); tSQLInfo.addSubPara(fm.State.value); tSQLInfo.setModule("grp_pa"); turnPage1.queryModal(tSQLInfo.getString(), InsuredListGrid, 1, 1); if(obj === 0){ if (!turnPage1.strQueryResult) { i18nAlert("未查询到符合条件的查询结果!", "LIS-03016"); } } } /** * 选择删除 */ function selDelete() { fm.Operate.value = "SELDEL"; if (!beforeSubmit()) { return false; } tOperate = "SELDEL"; fm.action = "../API/grp_pa/g_pos/EdorInsuredDealSave/SELDEL"; submitForm(fm); tOperate = ""; } /** * 条件删除 */ function conDelete() { fm.Operate.value = "CONDEL"; if (!beforeSubmit()) { return false; } tOperate = "CONDEL"; fm.action = "../API/grp_pa/g_pos/EdorInsuredDealSave/CONDEL"; submitForm(fm); tOperate = ""; } /** * 全部删除 */ function allDelete() { fm.Operate.value = "ALLDEL"; if (!beforeSubmit()) { return false; } tOperate = "ALLDEL"; fm.action = "../API/grp_pa/g_pos/EdorInsuredDealSave/ALLDEL"; submitForm(fm); tOperate = ""; } /** * 人员清单校验 */ function insuredListCheck() { fm.Operate.value = "CHECKLIST"; tOperate = "CHECKLIST"; if (!beforeSubmit()) { return false; } fm.action = "../API/grp_pa/g_pos/EdorInsuredDealSave/CHECKLIST"; submitForm(fm); } /** * 批次信息查询 */ function queryBatchInfo() { tSQLInfo = new SqlClass(); tSQLInfo.setResourceName("g_pos.EdorInsuredDealSql"); tSQLInfo.setSqlId("EdorInsuredDealSql2"); tSQLInfo.addSubPara(tEdorAppNo); tSQLInfo.setModule("grp_pa"); turnPage2.queryModal(tSQLInfo.getString(), BatchGrid, 1, 1); } /** * 导入人员清单 */ function importClick() { if (tContPlanType=="02") {//账户型产品导入 tOperate = "UPLOAD3"; } else { if (tUnFixedAmntFlag) {//非固定保额导入 tOperate = "UPLOAD2"; } else {//一般导入 tOperate = "UPLOAD1"; } } var filePath = fmupload.ImportPath.value; if(filePath == null || filePath == ""){ i18nAlert("请选择导入文件路径!", "LIS-03339"); return false; } var indexFirst = filePath.lastIndexOf("\\"); var indexLast = filePath.lastIndexOf(".xlsx"); if(indexFirst < 0 || indexLast < 0 || indexLast <= indexFirst) { i18nAlert("文件路径不合法或选择的文件格式不正确,请重新选择!", "LIS-03340"); return false; } var fileName = filePath.substring(indexFirst+1,indexLast); var tEdorAppNoIndex = fileName.lastIndexOf("_"); if (tEdorAppNoIndex < 0) { i18nAlert("文件命名格式不正确,请重新命名!", "LIS-03341"); return false; } if (tEdorAppNo != fileName.substring(0,tEdorAppNoIndex)) { i18nAlert("文件命名必须以保全受理号开始,请重新命名!", "LIS-03342"); return false; } var tSubOtherNo = fileName.substring(tEdorAppNoIndex+1, indexLast); if (isNaN(tSubOtherNo)) { i18nAlert("文件命名格式不正确!文件命名以保全受理号开始,加上横杠,再加数字流水序列!", "LIS-03343"); return false; } if (fileName.length>=30) { i18nAlert("文件名长度不能超过30!", "LIS-03344"); return false; } tSQLInfo = new SqlClass(); tSQLInfo.setResourceName("g_pos.EdorInsuredDealSql"); tSQLInfo.setSqlId("EdorInsuredDealSql3"); tSQLInfo.addSubPara(tEdorAppNo); tSQLInfo.addSubPara(fileName); tSQLInfo.setModule("grp_pa"); var havaFile = easyExecSql(tSQLInfo.getString(),1,0); if (havaFile == null) { i18nAlert("文件是否已导入校验失败!", "LIS-03345"); return false; } else if (havaFile[0][0] > 0) { i18nAlert("该批次文件已经导入,请重新命名导入文件!", "LIS-03346"); return false; } fmupload.action="../API/grp_pa/g_pos/EdorInsuredUploadSave/UPLOAD?OtherNoType=LIST&OtherNo="+tEdorAppNo+"&SubOtherNo="+tSubOtherNo+"&UploadNode="+tActivityID+"&Operate="+tOperate+"&AttachType=09"; submitForm(fmupload); } /** * 下载人员清单信息 */ function downloadClick() { var tSelNo = BatchGrid.getSelNo(); if (tSelNo==0) { i18nAlert("请选择一条批次信息!", "LIS-03347"); return false; } var tBatchNo = BatchGrid.getRowColData(tSelNo-1, 2); fm.SheetName[0].value = "变更人员清单"; fm.SheetName[1].value = "受益人清单"; //变更人员清单标题 var tInsuredTitle = "编号^|保全项目^|序号^|原被保险人姓名^|原被保险人证件号码^|主被保险人序号^|与主被保险人关系^|被保险人姓名^|证件类型^|证件号码^|" + "证件是否长期^|证件有效起期^|证件有效止期^|性别^|出生日期^|国籍^|保险方案^|社保标记^|职业代码^|保险责任生效日期^|主被保险人姓名^|" + "主被保险人证件号码^|移动电话^|电子邮箱^|单位负担保费^|个人负担保费^|开户银行^|开户名^|账号^|开户行所在省^|开户行所在市^|账户属性^|" + "账户类型^|开户行细分^|户口所在地^|婚姻状况^|民族^|工作状态^|服务区域^|是否次标准体^|入司时间^|工龄^|月薪^|所在分公司^|所在部门^|" + "工作地^|社保地^|邮政编码^|微信号^|联系电话^|联系地址(省)^|联系地址(市)^|联系地址(区/县)^|详细地址^|备注^|被保险人编码^|职业^|" + "职级名称^|员工号"; //受益人清单标题 var tBnfTitle = "被保险人序号^|受益人顺序^|姓名^|证件类型^|证件号码^|性别^|出生日期^|" + "与被保险人关系^|受益比例(小数)^|导入错误信息"; fm.SheetTitle[0].value = tInsuredTitle; fm.SheetTitle[1].value = tBnfTitle; tSQLInfo = new SqlClass(); tSQLInfo.setResourceName("g_pos.EdorInsuredDealSql"); tSQLInfo.setSqlId("EdorInsuredDealSql4"); tSQLInfo.addSubPara(tBatchNo); tSQLInfo.setModule("grp_pa"); fm.SheetSql[0].value = tSQLInfo.getString(); tSQLInfo = new SqlClass(); tSQLInfo.setResourceName("g_pos.EdorInsuredDealSql"); tSQLInfo.setSqlId("EdorInsuredDealSql5"); tSQLInfo.addSubPara(tBatchNo); tSQLInfo.setModule("grp_pa"); fm.SheetSql[1].value = tSQLInfo.getString(); fm.action = "../API/grp_common/jsp/QueryLargeDataExport/EXPORT"; ajaxSubmit2(fm, null, null, true); } /** * 提交数据 */ function submitForm(tForm) { var showStr = i18nMessage("正在处理数据,请您稍候并且不要修改屏幕上的值或链接其他页面!", "LIS-04535"); 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(); // tForm.submit(); //ajaxSubmit2(tForm,customAfterSubmit,true); //导入上传功能 if(tOperate=='UPLOAD1'||tOperate=='UPLOAD2'||tOperate=='UPLOAD3'){ //非导入上传功能 ajaxSubmit2(tForm,callback2,true); showInfo.close(); initForm(); }else{ ajaxSubmit2(tForm,callback); } } function callback(flagStr,content,result) { afterSubmit(flagStr,content); } function callback2(flagStr,content,result) { alert(content); } /** * 提交后操作,服务器数据返回后执行的操作 */ function afterSubmit(FlagStr, content) { if (typeof(showInfo)=="object") { 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(); initForm(); queryClick(1); } } /** * 提交前的校验、计算 */ function beforeSubmit() { //系统的校验方法 if (!verifyInput2()) { return false; } if (fm.Operate.value=="SELDEL") { var tCount = InsuredListGrid.mulLineCount; var tFlag = false; for (var i=0;i