2020-12-10 09:34:12 +08:00

363 lines
15 KiB
Plaintext

<%@ page contentType="text/html; charset=GBK"%>
<%@page import="jbo.app.tenwa.doc.LB_DOC_CONTRACT_LIST"%>
<%@ include file="/Frame/resources/include/include_begin_info.jspf"%>
<script type="text/javascript" src="<%=sWebRootPath%>/Frame/page/js/bankBin.js"></script><%
/*
Author: undefined 2017-07-10
Content: ʾÀýÏêÇéÒ³Ãæ
History Log:
*/
String userId = CurUser.getUserID();
String orgId = CurUser.getOrgID();
String projectId = CurPage.getParameter("ProjectId");
String customerId = CurPage.getParameter("customerId");
String contractId = CurPage.getParameter("ContractId");
String sPrevUrl = CurPage.getParameter("PrevUrl");
if(sPrevUrl == null) sPrevUrl = "";
String RightType=CurPage.getParameter("RightType");
String ishistory=CurPage.getParameter("IsHistory");
String FlowUnid=CurPage.getParameter("FlowUnid");
String flowName=CurPage.getParameter("FlowName");
String flowNo=CurPage.getParameter("FlowNo");
String CustomerType=CurPage.getParameter("CustomerType");
String ApplyType=CurPage.getParameter("ApplyType");
String PhaseNo=CurPage.getParameter("PhaseNo");
BizObjectManager ldclManager = JBOFactory.getBizObjectManager(LB_DOC_CONTRACT_LIST.CLASS_NAME);
BizObject ldcls = ldclManager.createQuery("select * from O where file_flag='yes' and ( flow_unid=:flowunid or contract_id=:contractid ) ").setParameter("flowunid", FlowUnid).setParameter("contractid", contractId).getSingleResult(false);
System.out.print("=========="+ldcls+"==========");
/* System.out.print("\n\n\n\t--FlowUnid "+FlowUnid+"\t\n\n\n"); */
String sTempletNo = "DebitCardInfo";//--Ä£°åºÅ--
if("ºÏÍ¬ÖÆ×÷Á÷³Ì".equals(flowName)||"ºÏͬ±ä¸üÁ÷³Ì".equals(flowName)){
sTempletNo = "DebitCardInfoMcontract";//--Ä£°åºÅ--
}
ASObjectModel doTemp = new ASObjectModel(sTempletNo);
//doTemp.setColTips("", "²âÊÔ");
doTemp.setHtmlEvent("acc_number", "onchange", "getNameOfBank");
if(PhaseNo.equals("0030")||PhaseNo.equals("0040")||PhaseNo.equals("0050")){
doTemp.setColInnerBtEvent("ACCOUNT", "");
}
//doTemp.setHtmlEvent("MOBILE", "onchange", "checkMobile");
ASObjectWindow dwTemp = new ASObjectWindow(CurPage, doTemp,request);
dwTemp.Style = "2";//freeform
if(PhaseNo.equals("0030")||PhaseNo.equals("0040")||PhaseNo.equals("0050")){
dwTemp.ReadOnly = "-2";//Ö»¶Áģʽ
}
if((null!=RightType&&RightType.equals("ReadOnly"))||(null!=ishistory&&ishistory.equals("true"))){
dwTemp.ReadOnly = "-2";//Ö»¶Áģʽ
RightType="ReadOnly";
isShowButton=false;
}else{
isShowButton=true;
}
if("ºÏÍ¬ÖÆ×÷Á÷³Ì".equals(flowName)||"ºÏͬ±ä¸üÁ÷³Ì".equals(flowName)){
dwTemp.genHTMLObjectWindow(projectId);
}else{
dwTemp.genHTMLObjectWindow(FlowUnid);
}
dwTemp.replaceColumn("PaymentCard", "<iframe type='iframe' name=\"frame_list\" width=\"100%\" height=\"120\" frameborder=\"0\" src=\""+sWebRootPath+"/Tenwa/Lease/Flow/Comm/LBDebitCard/PaymentCardInfo.jsp?FlowUnid="+FlowUnid+"&RightType="+RightType+"&ishistory="+ishistory+"&CompClientID="+sCompClientID+"\"></iframe>", CurPage.getObjectWindowOutput());
dwTemp.replaceColumn("S_PaymentCard", "<iframe type='iframe' name=\"frame_lists\" width=\"100%\" height=\"250\" frameborder=\"0\" src=\""+sWebRootPath+"/Tenwa/Lease/Flow/Comm/LBDebitCard/S_PaymentCardInfo.jsp?FlowUnid="+FlowUnid+"&RightType="+RightType+"&ishistory="+ishistory+"&CompClientID="+sCompClientID+"\"></iframe>", CurPage.getObjectWindowOutput());
String sButtons[][] = {
{"true","","Button","±£´æ","±£´æËùÓÐÐÞ¸Ä","save()","","","",""},
{"false","All","Button","УÑéÒøÐп¨ÐÅÏ¢","УÑéÒøÐп¨ËÄÒªËØ","verifyFourelementBank()","","","","btn_icon_return"}
}
/* {String.valueOf(!com.amarsoft.are.lang.StringX.isSpace(sPrevUrl)),"All","Button","·µ»Ø","·µ»ØÁбí","returnList()","","","",""}
} */;
sButtonPosition = "north";
%><%@ include file="/Frame/resources/include/ui/include_info.jspf"%>
<script type="text/javascript">
function selectBankType(){
AsDialog.OpenSelector("selectBankType","","dialogWidth=" + parseInt(window.screen.width * 0.4) + "px dialogHeight=" + parseInt(window.screen.height * 0.6) + "px",function(sReturn){
if(!sReturn||sReturn=="_CANCEL_"){
return;
}
sReturn = sReturn.split("@");
var bankCode = getItemValue(0, 0, "bank_code");
if("<%=flowNo%>"=="BusinessApplyFlow"||(bankCode!=null&&bankCode!="")){
setItemValue(0,0,'bank_code',sReturn[0]);
}
setItemValue(0,0,'bank_type',sReturn[1]);
setItemValue(0,0,"bank_name",sReturn[1]);
},"Ñ¡ÔñÒøÐÐÃû³Æ");
}
//¸ù¾ÝÑ¡ÔñµÄÓû§ÃûÑ¡Ôñ¶ÔÓ¦µÄÖ¤¼þºÅ
function autoSetCustId(){
var param1 = "";
var param2 = "";
if('AccountChangeApply'=='<%=ApplyType%>'){
param1 = "selectAccountForChange";
param2 = "ProjectId,<%=projectId%>,customerType,<%=CustomerType%>,ProjectId,<%=projectId%>,CustomerId,<%=customerId%>";
}else{
param1 = "selectAccountByCusts";
param2 = "flowunid,<%=FlowUnid%>";
}
param2=param2+",customerType,"+"<%=CustomerType%>";
AsDialog.OpenSelector(param1,param2,"dialogWidth=" + parseInt(window.screen.width * 0.4) + "px dialogHeight=" + parseInt(window.screen.height * 0.6) + "px",function(sReturn){
if(!sReturn||sReturn=="_CANCEL_"){
alert(getHtmlMessage('1'));//ÇëÑ¡ÔñÒ»ÌõÐÅÏ¢£¡
return;
}
sReturn = sReturn.split("@");
setItemValue(0,0,'CERTID',sReturn[0]);
setItemValue(0,0,'ACCOUNT',sReturn[1]);
setItemValue(0,0,'CUSTTYPE',sReturn[2]);
setItemValue(0,0,'MOBILE',sReturn[3]);
},"Ñ¡Ôñ¿Û¿î¿¨Ãû³Æ");
}
function checkMobile(){
if("<%=CustomerType%>"=="03"){//УÑé×ÔÈ»È˿ۿÐÅÏ¢ÊÖ»úºÅÊÇ·ñÊÇÉêÇëÈË»ò¹²Í¬ÉêÇëÈË
var customerType = "03";
var mobile = getItemValue(0,getRow(),"MOBILE");
var sParams = "mobile="+mobile+",customerType="+customerType+",flowunid="+"<%=FlowUnid%>";
var sReturnInfo = RunJavaMethodTrans("com.tenwa.lease.flow.project.businessapply.CustomerInfoCheck","checkDebitCardMobile",sParams);
if(sReturnInfo=="10"){
alert("Ô¤ÁôÊÖ»úºÅ²»ÊÇÉêÇëÈËÊÖ»úºÅ»ò¹²Í¬ÉêÇëÈËÊÖ»úºÅ!");
}
return sReturnInfo;
}else if("<%=CustomerType%>"=="01"){//УÑé·¨È˿ۿÐÅÏ¢ÊÖ»úºÅÊÇ·ñÊǵ£±£ÈË»ò¹²Í¬ÉêÇëÈË
var customerType = "01";
var mobile = getItemValue(0,getRow(),"MOBILE");
var sParams = "mobile="+mobile+",customerType="+customerType+",flowunid="+"<%=FlowUnid%>";
var sReturnInfo = RunJavaMethodTrans("com.tenwa.lease.flow.project.businessapply.CustomerInfoCheck","checkDebitCardMobile",sParams);
if(sReturnInfo=="10"){
alert("Ô¤ÁôÊÖ»úºÅ²»Êǵ£±£ÈËÊÖ»úºÅ»ò¹²Í¬ÉêÇëÈËÊÖ»úºÅ!");
}
return sReturnInfo;
}
}
function checkTel(){//УÑéÔ¤ÁôÊÖ»úºÅ¸ñʽ
var mobile = getItemValue(0,getRow(0),"MOBILE");
if(mobile==""){
//setErrorTips("mobile","ÊÖ»úºÅ²»ÄÜΪ¿Õ!");
// alert("Ô¤ÁôÊÖ»úºÅ²»ÄÜΪ¿Õ!");
return true;
}
var phone = /^[1][2,3,4,5,6,7,8,9][0-9]{9}$/;
if(phone.test(mobile)){
setErrorTips("MOBILE","");
return true;
}else{
setErrorTips("MOBILE","ÊÖ»úºÅ¸ñʽ²»ÕýÈ·!");
return false;
}
/* if(CheckPhoneCode(mobile)){
return true;
}else{
//setErrorTips("mobile","ÊÖ»úºÅ¸ñʽ²»ÕýÈ·!");
alert("Ô¤ÁôÊÖ»úºÅ¸ñʽ²»ÕýÈ·!");
return false;
} */
}
function save(){
var TelRes=checkTel();
if(TelRes==false){
return;
}
setItemValue(0,0,"flowunid","<%=FlowUnid%>");
setItemValue(0,0,"acc_type","Debit");
var res=true;
if('BusinessApplyApply'=='<%=ApplyType%>'){
res = RunJavaMethodTrans("com.tenwa.comm.customerfilterlist.DebitCardAction", "getCustIdByFlowunid", "FlowUnid=<%=FlowUnid%>");
var strarry=res.split(",");
var customerid=strarry[0];
var projectid=strarry[1];
var contractid=strarry[2];
if(res=="false"){
alert("ÇëÏÈÌîд¸öÈË»ù±¾ÐÅÏ¢£¡");
return;
}
var contract_id= getItemValue(0,0,"contract_id");
if(null!=contract_id&&contract_id!=""){
contractid=contract_id;
}
setItemValue(0,0,"customerid",customerid);
setItemValue(0,0,"project_id",projectid);
if(contractid==""||contractid=="null"||contractid==null){
setItemValue(0,0,"contract_id","");
}else{
setItemValue(0,0,"contract_id",contractid);
}
}
var project_id = getItemValue(0,0,"project_id");
//УÑé¶ÔÓ¦µÄ¿Û¿î¿¨ÊÇ·ñǩԼ£¬Èç¹ûǩԼ
RunJavaMethodTrans("com.tenwa.comm.customerfilterlist.DebitCardAction", "checkAccountSignStatus", "projectid="+project_id+",userId=<%=userId%>,orgId=<%=orgId%>");
if("BusinessApplyApply"=="<%=ApplyType%>"||"BusinessChangeApply"=="<%=ApplyType%>"||"BContractApproveApply"=="<%=ApplyType%>"||"BContractChangeApply"=="<%=ApplyType%>"){
var sparams = "account="+getItemValue(0,getRow(),"ACCOUNT")+",acc_number="+getItemValue(0,getRow(),"ACC_NUMBER")+",bank_name="+getItemValue(0,getRow(),"BANK_NAME")+",mobile="+getItemValue(0,getRow(),"MOBILE")+",projectid=<%=projectId%>,FlowUnid=<%=FlowUnid%>,contractid=<%=contractId%>,certId="+getItemValue(0,getRow(),"CERTID")+",applyType=<%=ApplyType%>";
var meassge = RunJavaMethodTrans("com.tenwa.comm.customerfilterlist.DebitCardAction", "checkSign", sparams);
if("false"==meassge){
alert("ºÏͬÒÑÉú³É£¬ÇëÏÈɾ³ýºÏͬÔÙÐ޸ĿۿÐÅÏ¢£¡");
return ;
}else if("Y"==meassge){
setItemValue(0,0,"sign_status","Y");
}else if("N"==meassge){
setItemValue(0,0,"sign_status","");
}
}
iV_all("0");
setItemValue(0,0,"ACC_NUMBER",allTrim(getItemValue(0,0,"ACC_NUMBER")));
var flowName="<%=flowName%>";
if("ÒµÎñ±ä¸üÁ÷³Ì"==flowName||"ºÏÍ¬ÖÆ×÷Á÷³Ì"==flowName || "ºÏͬ±ä¸üÁ÷³Ì"==flowName){
// ÅжÏÊÇ·ñ±ä¸ü£¬ Èç¹û±ä¸üÁË£¬ ½«±ä¸üÄÚÈݲåÈëÖмä±í
var account = getItemValue(0,0,"account"); // ÕË»§Ãû³Æ
var acc_number = getItemValue(0,0,"acc_number"); // ÒøÐÐÕ˺Å
var bank_name = getItemValue(0,0,"bank_name"); // ¿ª»§ÒøÐÐ
var MOBILE = getItemValue(0,0,"MOBILE"); // Ô¤ÁôÊÖ»úºÅ
var project_id = getItemValue(0,0,"project_id"); // ÏîÄ¿id
var contract_id = getItemValue(0,0,"contract_id");// Ô¤ÁôÊÖ»úºÅ
var sign_status = getItemValue(0,0,"sign_status");// ǩԼÐÅÏ¢
var flowunid = "<%=FlowUnid%>" ;
var sparams ="FlowUnid="+flowunid+",account="+account+",acc_number="+acc_number+",bank_name="+bank_name+",mobile="+MOBILE+",projectid="+project_id+",contractid="+contract_id+",sign_status="+sign_status+"";
var result = RunJavaMethodTrans("com.tenwa.comm.customerfilterlist.DebitCardAction", "savaCustomerAccountTomiddle", sparams);
if("true"==result){
as_save("0","re");
}else{
alert("±£´æÊ§°Ü£¬ ÇëÁªÏµ¹ÜÀíÔ± £¡");
return;
}
}else{
as_save("0","re");
}
}
function re(){
var param="CompClientID=<%=sCompClientID%>&FlowUnid=<%=FlowUnid%>&RightType=<%=RightType%>&ishistory=<%=ishistory%>";
AsControl.OpenView("/Tenwa/Lease/Flow/Comm/LBDebitCard/PaymentCardInfo.jsp",param,"frame_list");
}
function CheckBank_name(){
var bank_name=getItemValue(0, getRow(0), "bank_name");
if(bank_name==null||bank_name==""){
setErrorTips("bank_name","ÇëÊäÈ뿪»§ÒøÐУ¡");
return false;
}else{
setErrorTips("bank_name","");
return true;
}
}
function CheckAccount(){
var account=getItemValue(0, getRow(0), "account");
if(account==null||account==""){
setErrorTips("account","ÇëÊäÈëÕË»§Ãû³Æ£¡");
return false;
}else{
setErrorTips("account","");
return true;
}
}
/* ÒøÐÐÕ˺ŸñʽУÑé */
function CheckAcc_number(){
var acc=getItemValue(0, getRow(0), "acc_number");
if(acc!=null&&acc!=""){
/* var reg = /^(\d{16}|\d{19})$/;
if(!reg.test(acc)){
setErrorTips("acc_number","ÒøÐÐÕ˺Ÿñʽ´íÎó£¡");
return false;
}else{ */
setErrorTips("acc_number","");
return true;
}else{
setErrorTips("acc_number","ÇëÊäÈëÒøÐÐÕ˺ţ¡");
return false;
}
}
function getNameOfBank(){
var sflag=-1;
var number=getItemValue(0, getRow(0), "acc_number");
/* var reg = /^(\d{14}|\d{16}|\d{19})$/;
if(!reg.test(number)){
setErrorTips("acc_number","ÒøÐÐÕ˺Ÿñʽ´íÎó£¡");
return false;
}else{ */
var cardbin = number.substring(0, 6);
for (var i=0;i<bankBin.length;i++) {
if(cardbin==bankBin[i]){
sflag = i;
}
}
if (sflag != -1) {
var name=bankName[sflag].substring(0,bankName[sflag].indexOf("¡¤"));
if(name.indexOf("ÓÊ´¢") != -1 || name.indexOf("ÓÊÕþ") != -1){
name = "ÓÊÕþÒøÐÐ";
}
var res = RunJavaMethodTrans("com.tenwa.comm.customerfilterlist.DebitCardAction", "selectBankName", "bank_name="+name);
if("error"!= res){
res = res.split("@");
var bankCode = getItemValue(0, 0, "bank_code");
if("<%=flowNo%>"=="BusinessApplyFlow"||(bankCode!=null&&bankCode!="")){
setItemValue(0,0,'bank_code',res[0]);
}
setItemValue(0,0,'bank_type',res[1]);
setItemValue(0,getRow(),"bank_name",res[1]);
}
}else{
setItemValue(0,0,'bank_code','');
setItemValue(0,0,'bank_type','');
setItemValue(0,getRow(),"bank_name",'');
}
setErrorTips("acc_number","");
return true;
}
//УÑéÒøÐп¨ËÄÒªËØ
function verifyFourelementBank(){
var parm = "FlowUnid=<%=FlowUnid%>";
var res = RunJavaMethodTrans("com.tenwa.comm.customerfilterlist.DebitCardAction", "verifyFourelementBank", parm);
if (res == "ERROR") {
alert("УÑéʧ°Ü");
}else if(res == 'SUCCESS'){
alert('УÑéÍê³É');
reloadSelf();
}else{
alert(res);
}
}
//ÌáʾÊÇ·ñΪָ¶¨ÒøÐÐ
function vertifyBankIsValid(){
var parm = "bank_name="+getItemValue(0,getRow(0),"bank_name");
var res = RunJavaMethodTrans("com.tenwa.comm.customerfilterlist.DebitCardAction", "vertifyBankIsValid", parm);
if (res == "error") {
alert("¸ÃÒøÐп¨ºÅ,·ÇÖ¸¶¨ÒøÐУ¬ÇëºË¶Ô");
}
}
//Ñ¡Ôñ¿ª»§ÐÐËùÊôÊ¡·Ý
function selectProvince(){
AsDialog.OpenSelector("selectProvince","","dialogWidth=" + parseInt(window.screen.width * 0.50) + "px dialogHeight=" + parseInt(window.screen.height * 0.45) + "px",function(sReturn){
if(!sReturn||sReturn=="_CANCEL_"||sReturn==""){
//alert(getHtmlMessage('1'));//ÇëÑ¡ÔñÒ»ÌõÐÅÏ¢£¡
return;
}
sReturn = sReturn.split("@");
if (sReturn[0].indexOf("Ê¡") != -1) {
sReturn[0] = sReturn[0].substring(0,sReturn[0].indexOf("Ê¡"));
}else if (sReturn[0].indexOf("ÊÐ") != -1){
sReturn[0] = sReturn[0].substring(0,sReturn[0].indexOf("ÊÐ"));
}else if (sReturn[0].indexOf("׳×å×ÔÖÎÇø") != -1){
sReturn[0] = sReturn[0].substring(0,sReturn[0].indexOf("׳×å×ÔÖÎÇø"));
}else if (sReturn[0].indexOf("»Ø×å×ÔÖÎÇø") != -1){
sReturn[0] = sReturn[0].substring(0,sReturn[0].indexOf("»Ø×å×ÔÖÎÇø"));
}else if (sReturn[0].indexOf("×ÔÖÎÇø") != -1){
sReturn[0] = sReturn[0].substring(0,sReturn[0].indexOf("×ÔÖÎÇø"));
}else if (sReturn[0].indexOf("ÌØ±ðÐÐÕþÇø") != -1){
sReturn[0] = sReturn[0].substring(0,sReturn[0].indexOf("ÌØ±ðÐÐÕþÇø"));
}
setItemValue(0,0,"ACCOUNT_PROVINCE",sReturn[0]);
},"ÇëÑ¡Ôñ¿ª»§ÐÐËùÊôÊ¡·Ý",'');
}
function returnList(){
AsControl.OpenView("<%=sPrevUrl%>", "","_self","");
}
</script>
<%@ include file="/Frame/resources/include/include_end.jspf"%>