376 lines
16 KiB
Plaintext
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<%@ 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");
String subjectId=CurPage.getParameter("SubjectId");//获取主体信息,用于是否签约查询
String channel=CurPage.getParameter("channel");
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");
setItemValue(0,0,'bank_code',sReturn[0]);
setItemValue(0,0,'bank_type',sReturn[1]);
setItemValue(0,0,"bank_name",sReturn[1]);
setItemValue(0,0,"collect_type",sReturn[2]);
},"选择银行名称");
}
//根据选择的用户名选择对应的证件号
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");
if("BusinessApplyApply"!="<%=ApplyType%>"){//业务申请不用校验是否签约,因为业务申请没有办法签约。如果是签约状态也是从别的表拷贝的。
//查询该申请号的扣款卡是否签约,如果已签约将对应的数据存入对应的记录表中
RunJavaMethodTrans("com.tenwa.comm.customerfilterlist.DebitCardAction", "checkAccountSignStatus", "projectid="+project_id+",userId=<%=userId%>,orgId=<%=orgId%>,applyType=<%=ApplyType%>");
}
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%>,subjectId=<%=subjectId%>,channel=<%=channel%>,collect_type="+getItemValue(0,getRow(),"collect_type");
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("ZCfalse" == meassge){
alert("该扣款卡信息没有签约,无法保存!");
return ;
}else if("NotFalse" == meassge){
alert("没有匹配到对应的扣款渠道,无法保存!");
return ;
}else{
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 collect_type = getItemValue(0,0,"collect_type");// 后去扣款渠道
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+",collect_type="+collect_type;
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;
}
}
var bool = true;
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");
setItemValue(0,0,'bank_code',res[0]);
setItemValue(0,0,'bank_type',res[1]);
setItemValue(0,getRow(),"bank_name",res[1]);
setItemValue(0,0,"collect_type",res[2]);
bool = false;
}
}
if(bool){
setItemValue(0,0,'bank_code','');
setItemValue(0,0,'bank_type','');
setItemValue(0,0,"bank_name",'');
setItemValue(0,0,"collect_type",'');
}
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"%>