/*************************************************************** *
ProName:BalanceAppInput.js
*Title:结算申请
*Description:结算申请
*Copyright:Copyright (c) 2012
*Company:Sinosoft
* @author : 蔡云聪 * @version : 8.0 * @date : 2014-06-17 ****************************************************************/ var showInfo; var turnPage = new turnPageClass(); var turnPage1 = new turnPageClass(); var turnPage2 = new turnPageClass(); var turnPage3 = new turnPageClass(); var mOperate = "";//操作状态 var tSQLInfo = new SqlClass(); /** * 查询 */ function queryClick() { fm.SumMoney.value=""; fm.SelectPosMoney.value=""; initPosInfoGrid(); initContInfoGrid(); tSQLInfo = new SqlClass(); tSQLInfo.setResourceName("g_balance.BalanceAppSql"); tSQLInfo.setModule("grp_balance"); tSQLInfo.setSqlId("BalanceAppSql1"); tSQLInfo.addSubPara(fm.GrpContNo.value); tSQLInfo.addSubPara(fm.Managecom.value); tSQLInfo.addSubPara(fm.GrpName.value); tSQLInfo.addSubPara(fm.StartBalanceDate.value); tSQLInfo.addSubPara(fm.EndBalanceDate.value); tSQLInfo.addSubPara(fm.BalancePeriod.value); tSQLInfo.addSubPara(tManageCom); turnPage1.queryModal(tSQLInfo.getString(), ContInfoGrid, 0, 1); if(!turnPage1.strQueryResult){ i18nAlert("未查询到符合条件的查询结果!", "LIS-03011"); return false; } } /** * 提交 */ 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.submit(); ajaxSubmit2(document.getElementById("fm")); initForm(); } /** * 提交后操作,服务器数据返回后执行的操作 */ 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(); fm.SumMoney.value=''; fm.SelectPosMoney.value=''; } } /** *展示保全信息 */ function showPosInfo(){ initPosInfoGrid(); DivPosInfo.style.display=''; var tRow = ContInfoGrid.getSelNo()-1; fm.SumMoney.value=ContInfoGrid.getRowColData(tRow,8); var tGrpContNo=ContInfoGrid.getRowColData(tRow,2); fm.GrpContNoQ.value=tGrpContNo; fm.SelectPosMoney.value=""; tSQLInfo = new SqlClass(); tSQLInfo.setResourceName("g_balance.BalanceAppSql"); tSQLInfo.setModule("grp_balance"); tSQLInfo.setSqlId("BalanceAppSql2"); tSQLInfo.addSubPara(tGrpContNo); tSQLInfo.addSubPara(tGrpContNo); noDiv(turnPage2, PosInfoGrid, tSQLInfo.getString()); //turnPage2.queryModal(tSQLInfo.getString(), PosInfoGrid, 0, 1); queryEdorBankInfo(tGrpContNo); } /** 展示查询结果,赋值到Muline **/ function showMulLineInfo(tResultStr, objGrid ,objPage){ objPage.strQueryResult = tResultStr; if(objPage.strQueryResult==null||objPage.strQueryResult=="") { //initExeTrendsGrid(); i18nAlert("未查询到符合条件的查询结果!", "LIS-03016"); return false; } objPage.decodeEasyQueryResult(objPage.strQueryResult,'0'); objPage.useSimulation = 1; objPage.arrDataCacheSet = decodeEasyQueryResult(turnPage1.strQueryResult, 0, 0, objPage); //设置初始化过的MULTILINE对象,VarGrid为在初始化页中定义的全局变量 objPage.pageDisplayGrid = objGrid; //objGrid.SortPage = objPage;地址页标识 //设置查询起始位置 objPage.pageIndex = 0; //在查询结果数组中取出符合页面显示大小设置的数组 var arrDataSet = turnPage1.getData(objPage.arrDataCacheSet, objPage.pageIndex, 10); //调用MULTILINE对象显示查询结果 displayMultiline(arrDataSet, objPage.pageDisplayGrid, objPage); objGrid.setPageMark(objPage); return true; } function showMoney(){ var rowNum = PosInfoGrid.mulLineCount; var vMoney=0; for(var i=0;i < rowNum;i++){ if(PosInfoGrid.getChkNo(i)){ var vpay = new Number(PosInfoGrid.getRowColData(i,6)); vMoney=Arithmetic(vMoney,'+',vpay,2); } } // fm.SelectPosMoney.value=vMoney; fm.SelectPosMoney.value= Number(vMoney).toFixed(2); } /** *手工结算 */ function handDeal(){ if(!verifyForm("fm")){ return false; } if (fm.SumMoney.value>0) { if(fm.PayType.value == "5"){ i18nAlert("该定期为收费项目,付款方式不能为内部转账!", null); return false; } } if (fm.PayType.value == "4" || fm.PayType.value == "7") { if (fm.AccName.value == "" || fm.BankAccNo.value == "" || fm.BankCode.value == "" ) { i18nAlert("付款方式为4-银行转账(非制返盘)/7-银行转账时,开户名、银行账号、开户银行不能为空!", null); return false; } } var kRow = ContInfoGrid.getSelNo()-1; var tGrpContNo=ContInfoGrid.getRowColData(kRow,2); tSQLInfo = new SqlClass(); tSQLInfo.setResourceName("g_balance.BalanceAppSql"); tSQLInfo.setModule("grp_balance"); tSQLInfo.setSqlId("BalanceAppSql3"); tSQLInfo.addSubPara(tGrpContNo); var tPropEntry = easyExecSql(tSQLInfo.getString(), 1, 0, 1); if(tPropEntry>0){ i18nAlert("该保单下还有未审批的结算单!", "LIS-02333"); return false; } if(!$('#selectAllInput').is(':checked')) { var rowNum = PosInfoGrid.mulLineCount; var tRow = 0; for (var index = 0; index < rowNum; index++) { if (PosInfoGrid.getChkNo(index)) { tRow = 1; } } if (tRow == 0) { i18nAlert("请至少选择一条记录!", "LIS-03027"); return false; }else{ document.all('ALLFlag').value="2"; } }else{ document.all('ALLFlag').value="1"; } fm.action = "../API/grp_balance/g_balance/BalanceAppSave/HANDDEAL?Operate=INSERT"; submitForm(fm,"INSERT"); } function check(){ if($('#selectAllInput').is(':checked')){ fm.all("SelectPosMoney").value = fm.all("SumMoney").value; document.all('ALLFlag').value="1"; }else{ fm.all("SelectPosMoney").value = "0"; document.all('ALLFlag').value="2"; } } /** * 保全银行信息查询 */ function queryEdorBankInfo(tGrpContNo) { tSQLInfo = new SqlClass(); tSQLInfo.setResourceName("g_balance.BalanceAppSql"); tSQLInfo.setModule("grp_balance"); tSQLInfo.setSqlId("BalanceAppSql5"); tSQLInfo.addSubPara(tGrpContNo); var strQueryResult = easyExecSql(tSQLInfo.getString(), 1, 0, 1); if(strQueryResult!=null){ var money = fm.SumMoney.value; if (money >= 0) { fm.PayType.value = '4'; fm.PayTypeName.value = '银行转账(非制返盘)'; } else if (money < 0) { fm.PayType.value = '7'; fm.PayTypeName.value = '银行转账(制返盘)' } // fm.PayType.value=strQueryResult[0][0]; // fm.PayTypeName.value=strQueryResult[0][1]; fm.BankCode.value=strQueryResult[0][2]; fm.BankCodeName.value=strQueryResult[0][3]; fm.BankAccNo.value=strQueryResult[0][4]; fm.AccName.value=strQueryResult[0][5]; fm.AccType2.value="0"; fm.AccTypeName2.value="对公"; fm.AccAttributes.value="2"; fm.AccAttributesName.value="银行卡"; fm.BankProvince.value=strQueryResult[0][10]; fm.BankProvinceName.value=strQueryResult[0][11]; fm.BankCity.value=strQueryResult[0][12]; fm.BankCityName.value=strQueryResult[0][13]; fm.BankAccSub2.value=strQueryResult[0][14]; // if(fm.PayType.value =="1"){ // document.getElementById('AcctName').style.display = 'none'; // document.getElementById('BankAcctNum').style.display = 'none'; // document.getElementById('AcctOpengBank').style.display = 'none'; // document.getElementById('AcctOpengBankProv').style.display = 'none'; // document.getElementById('AcctOpengBankCity').style.display = 'none'; // document.getElementById('AccAttributes1').style.display = 'none'; // document.getElementById('AccType').style.display = 'none'; // document.getElementById('BankAccSub').style.display = 'none'; // document.getElementById('AccName').style.display = 'none'; // document.getElementById('BankAccNo').style.display = 'none'; // document.getElementById('BankCode').style.display = 'none'; // document.getElementById('BankProvince').style.display = 'none'; // document.getElementById('BankCity').style.display = 'none'; // document.getElementById('AccAttributes').style.display = 'none'; // document.getElementById('AccType2').style.display = 'none'; // document.getElementById('BankAccSub2').style.display = 'none'; // // document.getElementById('BankProvinceName').style.display = 'none'; // document.getElementById('BankCityName').style.display = 'none'; // document.getElementById('AccAttributesName').style.display = 'none'; // document.getElementById('AccTypeName2').style.display = 'none'; // document.getElementById('BankCodeName').style.display = 'none'; // } } } function clearBankCity(){ document.all("BankCity").value = ""; document.all("BankCityName").value = ""; } /** * 模拟下拉操作 */ function returnShowCodeList(value1, value2, value3) { returnShowCode(value1, value2, value3, '0'); } function returnShowCodeListKey(value1, value2, value3) { returnShowCode(value1, value2, value3, '1'); } function returnShowCode(value1, value2, value3, returnType) { if (value1=='city') { if (isEmpty(fm.ProvinceName)) { i18nAlert("请选择省!", "LIS-00795"); return false; } var tProvince = document.all("ProvinceCode").value; if (returnType=='0') { return showCodeList('city',value2,value3,null,tProvince,'UpPlaceName','1',180); } else { return showCodeListKey('city',value2,value3,null,tProvince,'UpPlaceName','1',180); } } else if (value1=='bankcity') { if (isEmpty(fm.BankProvinceName)) { i18nAlert("请选择省!", "LIS-00795"); return false; } var tProvince = document.all("BankProvince").value; if (returnType=='0') { return showCodeList('city',value2,value3,null,tProvince,'UpPlaceName','1',180); } else { return showCodeListKey('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 = document.all("CityCode").value; if (returnType=='0') { return showCodeList('district',value2,value3,null,tCity,'UpPlaceName','1',180); } else { return showCodeListKey('district',value2,value3,null,tCity,'UpPlaceName','1',180); } } else if (value1=='bankprovince') { var tSql = "1"; if (returnType=='0') { return showCodeList('province',value2,value3,null,tSql,1,'1',180); } else { return showCodeListKey('province',value2,value3,null,tSql,1,'1',180); } } else if (value1=="agenttype") { // if (isEmpty(fm.ChnlType)) { // if (returnType=='0') { // return showCodeList('agenttype',value2,value3); // } else { // return showCodeListKey('agenttype',value2,value3); // } // } // var tChnlType = document.all("ChnlType").value; // if (returnType=='0') { // return showCodeList('queryexp',value2,value3,null,['agenttype',tChnlType],['CodeType','CodeExp'],'1',180); // } else { // return showCodeListKey('queryexp',value2,value3,null,['agenttype',tChnlType],['CodeType','CodeExp'],'1',180); // } }else if (value1=="comcodeall") { if (returnType=='0') { return showCodeList('comcodeall',value2,value3,null,['03',tManageCom],['ComGrade','ManageCom'],'1',180); } else { return showCodeListKey('comcodeall',value2,value3,null,['03',tManageCom],['ComGrade','ManageCom'],'1',180); } } } /** * 清空关联查询的项目 */ function clearInput(codeInput,nameInput) { codeInput.value = ""; nameInput.value = ""; } //开户银行 function showBankCodeNameList(obj1,obj1Name){ var keycode = event.keyCode; showCodeList('ldbankcom',[obj1,obj1Name],[0,1],null,fm.BankCodeName.value,'BankCodeName',1); } function showBankCodeNameListKey(obj1,obj1Name){ var keycode = event.keyCode; showCodeList('ldbankcom',[obj1,obj1Name],[0,1],null,fm.BankCodeName.value,'BankCodeName',1); } //开户银行 function showBankCodeList(obj1,obj1Name){ var keycode = event.keyCode; showCodeList('ldbankcom',[obj1,obj1Name],[0,1],null,fm.BankCode.value,'BankCode',1); } function showBankCodeListKey(obj1,obj1Name){ var keycode = event.keyCode; showCodeList('ldbankcom',[obj1,obj1Name],[0,1],null,fm.BankCode.value,'BankCode',1); } /** * 选择城市前必须先选择省份 */ function checkBankProvince(){ if(document.all("BankProvince").value == ""){ i18nAlert("请先选择省份", "LIS-03010"); document.all("BankCity").value = ""; document.all("BankCityName").value = ""; } } // function afterCodeSelect(cCodeName, Field) { // // if (cCodeName == "paymode") { // if (Field.value == "1") { // document.getElementById('AcctName').style.display = 'none'; // document.getElementById('BankAcctNum').style.display = 'none'; // document.getElementById('AcctOpengBank').style.display = 'none'; // document.getElementById('AcctOpengBankProv').style.display = 'none'; // document.getElementById('AcctOpengBankCity').style.display = 'none'; // document.getElementById('AccAttributes1').style.display = 'none'; // document.getElementById('AccType').style.display = 'none'; // document.getElementById('BankAccSub').style.display = 'none'; // document.getElementById('AccName').style.display = 'none'; // document.getElementById('BankAccNo').style.display = 'none'; // document.getElementById('BankCode').style.display = 'none'; // document.getElementById('BankProvince').style.display = 'none'; // document.getElementById('BankCity').style.display = 'none'; // document.getElementById('AccAttributes').style.display = 'none'; // document.getElementById('AccType2').style.display = 'none'; // document.getElementById('BankAccSub2').style.display = 'none'; // // document.getElementById('BankProvinceName').style.display = 'none'; // document.getElementById('BankCityName').style.display = 'none'; // document.getElementById('AccAttributesName').style.display = 'none'; // document.getElementById('AccTypeName2').style.display = 'none'; // document.getElementById('BankCodeName').style.display = 'none'; // } // } // } /** * 不分页方法 */ function noDiv(objPage, objGrid, tSql) { //为兼容已允许的程序,容错而增加 objPage = new turnPageClass(); objPage.strQueryResult = easyQueryVer3(tSql, 1, 0, 1, 0, 1); //判断是否查询成功 if (!objPage.strQueryResult) { //清空MULTILINE,使用方法见MULTILINE使用说明 objGrid.clearData(); return false; } //清空数据容器,两个不同查询共用一个turnPage对象时必须使用,最好加上,容错 objPage.arrDataCacheSet = clearArrayElements(objPage.arrDataCacheSet); //清空缓存 objPage.allArrDataCacheSet = clearArrayElements(objPage.allArrDataCacheSet); objPage.allCacheSize = 0; //查询成功则拆分字符串,返回二维数组 objPage.arrDataCacheSet = decodeEasyQueryResult(objPage.strQueryResult, 0, 0, objPage); objPage.pageLineNum = objPage.queryAllRecordCount; var tKey = 1; //cTurnPage.allCacheSize ++; objPage.allArrDataCacheSet[objPage.allCacheSize%objPage.allArrCacheSize] = {id:tKey,value:objPage.arrDataCacheSet}; //设置初始化过的MULTILINE对象,VarGrid为在初始化页中定义的全局变量 objPage.pageDisplayGrid = objGrid; //保存SQL语句 objPage.strQuerySql = tSql; //设置查询起始位置 objPage.pageIndex = 0; //在查询结果数组中取出符合页面显示大小设置的数组 var arrDataSet = objPage.getData(objPage.arrDataCacheSet, objPage.pageIndex, objPage.pageLineNum); //调用MULTILINE对象显示查询结果 displayMultiline(arrDataSet, objPage.pageDisplayGrid, objPage); if (objPage.showTurnPageDiv==1) { try { objGrid.setPageMark(objPage); } catch(ex){} } return true; }