430 lines
15 KiB
Plaintext
430 lines
15 KiB
Plaintext
<%@page import="com.tenwa.reckon.util.UUIDUtil"%>
|
||
<%@ page contentType="text/html; charset=GBK"%>
|
||
<%@ include file="/Frame/resources/include/include_begin_info.jspf"%><%
|
||
/*
|
||
Author: undefined 2018-06-18
|
||
Content: 示例详情页面
|
||
History Log:
|
||
*/
|
||
String sFlowUnid = CurPage.getParameter("FlowUnid");
|
||
System.out.print(sFlowUnid);
|
||
String sPrevUrl = CurPage.getParameter("PrevUrl");
|
||
String RightType= CurPage.getParameter("RightType");
|
||
String ProjectId= CurPage.getParameter("ProjectId");
|
||
String Action= CurPage.getParameter("Action");
|
||
String id = CurPage.getParameter("ID");
|
||
String sPhaseNo=CurPage.getParameter("sPhaseNo");
|
||
String IsHistory = CurPage.getParameter("IsHistory");
|
||
System.out.print(id);
|
||
String userOrgId = CurUser.getOrgID();
|
||
String userId = CurUser.getUserID();
|
||
String customerid = UUIDUtil.getUUID();
|
||
if(sPrevUrl == null) sPrevUrl = "";
|
||
|
||
String sTempletNo = "GuarantorInfo";//--模板号--
|
||
if("view".equals(Action)){
|
||
sTempletNo = "GuarantorQueryInfo";//--模板号--
|
||
}
|
||
ASObjectModel doTemp = new ASObjectModel(sTempletNo);
|
||
// doTemp.setDefaultValue("ASSUROR", customerid);
|
||
doTemp.setDefaultValue("project_id", ProjectId);
|
||
doTemp.setDefaultValue("flowunid", sFlowUnid);
|
||
//doTemp.setHtmlEvent("MOBILE","onChange","checkMobileRepeat");
|
||
doTemp.setHtmlEvent("CERTID","onChange","checkCertidRepeat");
|
||
doTemp.setHtmlEvent("CERTTYPE","onChange","changeCertType");
|
||
doTemp.setHtmlEvent("certid","onChange","ValidityCheck");
|
||
doTemp.setHtmlEvent("IDEXPIRY_TYPE","onChange","changeIdexpiryType");
|
||
// doTemp.setHtmlEvent("certtype","onChange", "setSexRead");
|
||
// doTemp.setDefaultValue("DATA_STATE", "guarantee");//标记该数据是担保人信息
|
||
ASObjectWindow dwTemp = new ASObjectWindow(CurPage, doTemp,request);
|
||
dwTemp.Style = "2";//freeform
|
||
//dwTemp.ReadOnly = "-2";//只读模式
|
||
dwTemp.genHTMLObjectWindow(id);
|
||
String sButtons[][] = {
|
||
{"true","All","Button","保存","保存所有修改","save()","","","",""},
|
||
{"true","","Button","返回","返回列表页面","goBack()","","","","btn_icon_return"},
|
||
};
|
||
sButtonPosition = "north";
|
||
%><%@ include file="/Frame/resources/include/ui/include_info.jspf"%>
|
||
<script type="text/javascript">
|
||
$(function(){
|
||
if("0030"=="<%=sPhaseNo%>" ||"0040"=="<%=sPhaseNo%>"||"0050"=="<%=sPhaseNo%>"||"0060"=="<%=sPhaseNo%>"|| ("0070"=="<%=sPhaseNo%>" && "false"=="<%=IsHistory%>")){//经销商阶段看不见标红,初审、复审、信审可以标红
|
||
var mobile = getItemValue(0,getRow(),"MOBILE");
|
||
var mobileResult = checkMobileAll(mobile);
|
||
if(mobileResult=="6"){
|
||
$("#MOBILE").css("color","red");
|
||
}
|
||
var certResult = checkCertIdAll();
|
||
if(certResult=="4"){
|
||
//$("#FULLNAME").attr("style","color:red;");
|
||
$("#CERTID").css("color","red");
|
||
}
|
||
}
|
||
$("#ID_ADDRESS").css("width",$("#ID_ADDRESS").parent().parent().parent().parent()[0].clientWidth/2+200+"px");
|
||
$("#ID_ADDRESS").attr("ReadOnly","true");
|
||
$("#ADDRESS").css("width",$("#ADDRESS").parent().parent().parent().parent()[0].clientWidth/2+200+"px");
|
||
$("#ADDRESS").attr("ReadOnly","true");
|
||
$("#WORKADD").css("width",$("#WORKADD").parent().parent().parent().parent()[0].clientWidth/2+200+"px");
|
||
$("#WORKADD").attr("ReadOnly","true");
|
||
//页面初始化的时候,判断证件有效期类型,默认为短期
|
||
var idexpiry_type = getItemValue(0,0,"IDEXPIRY_TYPE");
|
||
if(idexpiry_type==""){
|
||
$("#IDEXPIRY_TYPE_0").prop("checked", "checked");
|
||
}
|
||
changeIdexpiryType();
|
||
});
|
||
|
||
function changeIdexpiryType(){
|
||
var idexpiry_type = getItemValue(0,0,"IDEXPIRY_TYPE");
|
||
if("1" == idexpiry_type){//短期
|
||
setItemReadOnly(0,0,"IDEXPIRY",false);
|
||
var idexpiry = getItemValue(0,0,"IDEXPIRY");
|
||
if("0000" == idexpiry){
|
||
setItemValue(0,0,"IDEXPIRY","");
|
||
}
|
||
}else {
|
||
setItemReadOnly(0,0,"IDEXPIRY",true);
|
||
setItemValue(0,0,"IDEXPIRY","0000");
|
||
}
|
||
}
|
||
|
||
function selectPersonContacts(){
|
||
AsDialog.OpenSelector("codeLibraryListByCodeNo","codeno,personContact","dialogWidth=" + parseInt(window.screen.width * 0.4) + "px dialogHeight=" + parseInt(window.screen.height * 0.4) + "px",function(sReturn){
|
||
if(!sReturn || sReturn == "_CANCEL_"){
|
||
return;
|
||
}
|
||
sReturn = sReturn.split("@");
|
||
setItemValue(0,0,"ASSURE_RELATION",sReturn[1]);
|
||
},"请选择与承租人关系");
|
||
}
|
||
function selectDuties(){
|
||
AsDialog.OpenSelector("codeLibraryListByCodeNo","codeno,duties","dialogWidth=" + parseInt(window.screen.width * 0.4) + "px dialogHeight=" + parseInt(window.screen.height * 0.4) + "px",function(sReturn){
|
||
if(!sReturn || sReturn == "_CANCEL_"){
|
||
return;
|
||
}
|
||
sReturn = sReturn.split("@");
|
||
setItemValue(0,0,"TITLE",sReturn[1]);
|
||
},"请选择职务");
|
||
}
|
||
// 风控中台对接相关代码 单位地址
|
||
function selectWorkAddress(){
|
||
let workAddressId = getItemValue(0,0,"work_address_id");
|
||
AsDialog.PopView("/Tenwa/Lease/Flow/Project/BusinessApplication/personAddress.jsp",
|
||
'addressId='+workAddressId,
|
||
"resizable=yes;dialogWidth=600px;dialogHeight=355px;center:yes;status:no;statusbar:no",
|
||
function(result){
|
||
if(result == "cancel"){
|
||
return;
|
||
}
|
||
if(result !== ""){
|
||
setItemValue(0,0,"work_address_id",result.split("@")[0]);
|
||
setItemValue(0,0,"work_address_code",result.split("@")[1]);
|
||
setItemValue(0,0,"WORKADD",result.split("@")[2]);
|
||
}
|
||
},
|
||
(!workAddressId?"新增":"修改")+"单位地址");
|
||
}
|
||
// 风控中台对接相关代码 户籍地址
|
||
function selectIdAddress(){
|
||
let workAddressId = getItemValue(0,0,"id_address_id");
|
||
AsDialog.PopView("/Tenwa/Lease/Flow/Project/BusinessApplication/personAddress.jsp",
|
||
'addressId='+workAddressId,
|
||
"resizable=yes;dialogWidth=600px;dialogHeight=355px;center:yes;status:no;statusbar:no",
|
||
function(result){
|
||
if(result == "cancel"){
|
||
return;
|
||
}
|
||
if(result !== ""){
|
||
setItemValue(0,0,"id_address_id",result.split("@")[0]);
|
||
setItemValue(0,0,"id_address_code",result.split("@")[1]);
|
||
setItemValue(0,0,"id_address",result.split("@")[2]);
|
||
}
|
||
},
|
||
(!workAddressId?"新增":"修改")+"户籍地址");
|
||
}
|
||
// 风控中台对接相关代码 居住地址
|
||
function selectLiveAddress(){
|
||
let workAddressId = getItemValue(0,0,"live_address_id");
|
||
AsDialog.PopView("/Tenwa/Lease/Flow/Project/BusinessApplication/personAddress.jsp",
|
||
'addressId='+workAddressId,
|
||
"resizable=yes;dialogWidth=600px;dialogHeight=355px;center:yes;status:no;statusbar:no",
|
||
function(result){
|
||
if(result == "cancel"){
|
||
return;
|
||
}
|
||
if(result !== ""){
|
||
setItemValue(0,0,"live_address_id",result.split("@")[0]);
|
||
setItemValue(0,0,"live_address_code",result.split("@")[1]);
|
||
setItemValue(0,0,"ADDRESS",result.split("@")[2]);
|
||
}
|
||
},
|
||
(!workAddressId?"新增":"修改")+"居住地址");
|
||
}
|
||
changeCertType();
|
||
function changeCertType(){
|
||
var certType = getItemValue(0,getRow(0),"CERTTYPE");
|
||
//"MOBILE","ADDRESS", 去除电话及地址的隐藏 20200821
|
||
// var arr=["SEX","Marital_status","PROPERTY_TYPE","OTHER_INCOME","TITLE","WORKADD","WORKCORP","WORKTEL"];
|
||
var arr=["SEX","MARITAL_STATUS","PROPERTY_TYPE","OTHER_INCOME","TITLE","WORKADD","WORKCORP","WORKTEL"
|
||
,"BIRTHDAY"
|
||
,"IDEXPIRY"
|
||
,"NATION"
|
||
,"ID_ADDRESS"
|
||
,"CHILDRENS_NUMBER"
|
||
,"RESIDENTIAL_STATUS"
|
||
,"EDUCATION_LEVEL"
|
||
,"INDUSTRY_TYPE"
|
||
,"ENTERPRISE_NATURE"
|
||
,"CAREER_TYPE"
|
||
,"MAJOR_MONTHLY_INCOME"
|
||
,"MONTHLY_EXPENSES"
|
||
,"IDEXPIRY_TYPE"
|
||
];
|
||
var arrRequired=["SEX","MARITAL_STATUS","TITLE","WORKADD","WORKCORP","WORKTEL"
|
||
,"BIRTHDAY"
|
||
,"IDEXPIRY"
|
||
,"NATION"
|
||
,"ID_ADDRESS"
|
||
,"CHILDRENS_NUMBER"
|
||
,"RESIDENTIAL_STATUS"
|
||
,"EDUCATION_LEVEL"
|
||
,"INDUSTRY_TYPE"
|
||
,"ENTERPRISE_NATURE"
|
||
,"CAREER_TYPE"
|
||
,"MAJOR_MONTHLY_INCOME"
|
||
,"MONTHLY_EXPENSES"
|
||
,"START_IDEXPIRY"
|
||
,"IDEXPIRY_TYPE"
|
||
];
|
||
if(certType=="Ent02"){
|
||
showItemRequired(0, "LEGAL_REPRESENTATIVE");
|
||
showItem(0, "LEGAL_REPRESENTATIVE");
|
||
for(var i=0;i<arrRequired.length;i++){
|
||
hideItemRequired(0,arrRequired[i]);
|
||
}
|
||
for(var i=0;i<arr.length;i++){
|
||
hideItem(0,arr[i]);
|
||
setItemValue(0,0,arr[i],"");
|
||
}
|
||
}else{
|
||
hideItemRequired(0, "LEGAL_REPRESENTATIVE");
|
||
hideItem(0, "LEGAL_REPRESENTATIVE");
|
||
setItemValue(0,0,"LEGAL_REPRESENTATIVE","");
|
||
for(var i=0;i<arrRequired.length;i++){
|
||
showItemRequired(0,arrRequired[i]);
|
||
}
|
||
for(var i=0;i<arr.length;i++){
|
||
showItem(0,arr[i]);
|
||
}
|
||
}
|
||
setSexRead()
|
||
}
|
||
function setSexRead(){
|
||
var certtye=getItemValue(0,getRow(0),"certtype");
|
||
if("Ind01"==certtye){
|
||
$('#SEX_0').attr("disabled","disabled"); //男
|
||
$('#SEX_2').attr("disabled","disabled"); //女
|
||
}else{
|
||
$('#SEX_0').attr("disabled",false); //男
|
||
$('#SEX_2').attr("disabled",false); //女
|
||
}
|
||
}
|
||
function checkCertId(){//校验担保人证件号格式
|
||
var certType = getItemValue(0,getRow(0),"CERTTYPE");
|
||
var certId = getItemValue(0,getRow(0),"CERTID");
|
||
if(certType==""){
|
||
//setErrorTips("certType","证件类型不能为空!");
|
||
// alert("证件类型不能为空!");
|
||
return true;
|
||
}
|
||
if(certId==""){
|
||
//setErrorTips("certId","证件号不能为空!");
|
||
alert("证件号不能为空!");
|
||
return false;
|
||
}
|
||
if(certType=="Ent02"){
|
||
if(checkORGRight(certId)){
|
||
return true;
|
||
}else{
|
||
//setErrorTips("certId","组织机构代码格式不正确!");
|
||
alert("统一社会信用代码格式不正确!");
|
||
return false;
|
||
}
|
||
}
|
||
if(certType=="Ind01"){
|
||
if(certId.length!=18){
|
||
alert("身份证必须是18位!");
|
||
return false;
|
||
}
|
||
if(CheckLicense(certId)){
|
||
return true;
|
||
}else{
|
||
//setErrorTips("certId","身份证格式不正确!");
|
||
alert("身份证格式错误!");
|
||
return false;
|
||
}
|
||
}
|
||
if(certType=="Ent03"){
|
||
return true;
|
||
}
|
||
}
|
||
|
||
function checkTel(){//校验担保人手机号格式
|
||
var mobile = getItemValue(0,getRow(0),"mobile");
|
||
//var certid = getItemValue(0,getRow(),"CERTID");
|
||
if(mobile==""){
|
||
//setErrorTips("mobile","手机号不能为空!");
|
||
//alert("手机号不能为空!");
|
||
return true;
|
||
}
|
||
// 判断担保人是否配偶, 配偶不做手机号校验
|
||
//var params1="certid="+certid+",flowunid="+"<%=sFlowUnid%>";
|
||
//var returns = RunJavaMethodTrans("com.tenwa.lease.flow.project.businessapply.CustomerInfoCheck","checkYesOrNoSpouse",params1);
|
||
//if("true"==returns){
|
||
var phone = /^[1][2,3,4,5,6,7,8,9][0-9]{9}$/;
|
||
if(phone.test(mobile)){
|
||
<%-- var customerType = "03";
|
||
var id = getItemValue(0,getRow(),"id");
|
||
var FULLNAME = getItemValue(0,getRow(),"FULLNAME");
|
||
var certid = getItemValue(0,getRow(),"CERTID");
|
||
var sParams = "certId="+id+",certid="+certid+",FULLNAME="+FULLNAME+",mobile="+mobile+",customerType="+customerType+",flowunid="+"<%=sFlowUnid%>";
|
||
var sReturnInfo = RunJavaMethodTrans("com.tenwa.lease.flow.project.businessapply.CustomerInfoCheck","checkMobileRepeat",sParams);
|
||
if("SUCCESS"!=sReturnInfo){
|
||
//setErrorTips("tel","该手机号已重复!");
|
||
setErrorTips("mobile",sReturnInfo);
|
||
//alert("该手机号已重复!");
|
||
return false;
|
||
}else{
|
||
setErrorTips("mobile","");
|
||
return true;
|
||
} --%>
|
||
return true;
|
||
}else{
|
||
setErrorTips("mobile","手机号格式不正确!");
|
||
//alert("手机号格式不正确!");
|
||
return false;
|
||
}
|
||
//}
|
||
|
||
/* if(CheckPhoneCode(mobile)){
|
||
return true;
|
||
}else{
|
||
//setErrorTips("mobile","手机号格式不正确!");
|
||
alert("手机号格式不正确!");
|
||
return false;
|
||
} */
|
||
}
|
||
|
||
function checkWorkTel(){//校验担保人单位电话格式
|
||
var workTel = getItemValue(0,getRow(0),"WORKTEL");
|
||
if(workTel==""){
|
||
//setErrorTips("WORKTEL","单位电话不能为空!");
|
||
// alert("单位电话不能为空!");
|
||
return true;
|
||
}
|
||
if(CheckPhoneCode(workTel)){
|
||
return true;
|
||
}else{
|
||
setErrorTips("WORKTEL","单位电话格式不正确!");
|
||
// alert("单位电话格式不正确!");
|
||
return false;
|
||
}
|
||
}
|
||
|
||
<%-- function checkMobileRepeat(){//校验担保人手机号重复
|
||
var customerType = "03";
|
||
var mobile = getItemValue(0,getRow(),"MOBILE");
|
||
var FULLNAME = getItemValue(0,getRow(),"FULLNAME");
|
||
var certid = getItemValue(0,getRow(),"CERTID");
|
||
var id = getItemValue(0,getRow(),"id");
|
||
var sParams ="certid="+certid+",FULLNAME="+FULLNAME+",certId="+id+ ",mobile="+mobile+",customerType="+customerType+",flowunid="+"<%=sFlowUnid%>";
|
||
var sReturnInfo = RunJavaMethodTrans("com.tenwa.lease.flow.project.businessapply.CustomerInfoCheck","checkMobileRepeat",sParams);
|
||
if(sReturnInfo=="8"){
|
||
/* alert("该手机号已重复!");
|
||
setItemValue(0,0,"MOBILE",""); */
|
||
//setErrorTips("MOBILE","该手机号已重复!");
|
||
return true;
|
||
}else{
|
||
setErrorTips("MOBILE","");
|
||
return true;
|
||
}
|
||
} --%>
|
||
|
||
function save(){
|
||
var sFlowUnid="<%=sFlowUnid%>";
|
||
setItemValue(0,0,"FLOWUNID",sFlowUnid);
|
||
var CertIdResult = checkCertId();
|
||
if(CertIdResult==false){
|
||
return;
|
||
}
|
||
var TelResult = checkTel();
|
||
if(TelResult==false){
|
||
return;
|
||
}
|
||
/* var falgs = checkMobileRepeat();
|
||
if(falgs==false){
|
||
return;
|
||
} */
|
||
var WorkTelResult = checkWorkTel();
|
||
if(WorkTelResult==false){
|
||
return;
|
||
}
|
||
if(!checkCertidRepeat()){
|
||
return;
|
||
}
|
||
as_save(0,"goBack()");
|
||
}
|
||
|
||
function goBack(){
|
||
//要跳转的url
|
||
var url="/Tenwa/Lease/Flow/Comm/LBGuaranteeUnit/LBGuaranteePerUnitList.jsp";
|
||
var sFlowUnid="<%=sFlowUnid%>";
|
||
var sparam="FlowUnid="+sFlowUnid+"&ProjectId="+getItemValue(0,0,"project_id")+"&RightType="+'<%=RightType%>';
|
||
AsControl.OpenView(url,sparam,"_self","");
|
||
}
|
||
//根据身份证号判断性别
|
||
function ValidityCheck(){
|
||
var certType = getItemValue(0,getRow(0),"CERTTYPE");
|
||
var certID = getItemValue(0,getRow(),"CERTID");
|
||
var sex = certID.substring(16,17);
|
||
sex = parseInt(sex);
|
||
if(certType=="Ind01"||certType=="Ind08"){
|
||
if(sex%2==0){//奇男偶女
|
||
setItemValue(0,getRow(),"SEX","2");
|
||
}else if(sex%2==1){
|
||
setItemValue(0,getRow(),"SEX","1");
|
||
}
|
||
}
|
||
checkCertidRepeat();
|
||
}
|
||
function checkCertidRepeat(){
|
||
var certtype = getItemValue(0,getRow(),"CERTTYPE");
|
||
if("Ind01"==certtype){
|
||
var id = getItemValue(0,getRow(),"ID");
|
||
var certId = getItemValue(0,getRow(),"CERTID");
|
||
var FULLNAME = getItemValue(0,getRow(),"FULLNAME");
|
||
var sParams ="id="+id+",FULLNAME="+FULLNAME+",certid="+certId+",flowunid=<%=sFlowUnid%>";
|
||
var sReturnInfo = RunJavaMethodTrans("com.tenwa.lease.flow.project.businessapply.CustomerInfoCheck","checkCertidRepeat",sParams);
|
||
if("success"!=sReturnInfo){
|
||
setErrorTips("CERTID",sReturnInfo);
|
||
return false;
|
||
}
|
||
setErrorTips("CERTID","");
|
||
return true;
|
||
}
|
||
return true;
|
||
}
|
||
|
||
function checkMobileAll(mobile){//检验所有手机号
|
||
var sParams = "mobile="+mobile+",flowunid="+"<%=sFlowUnid%>";
|
||
var sReturnInfo = RunJavaMethodTrans("com.tenwa.lease.flow.project.businessapply.CustomerInfoCheck","checkTel",sParams);
|
||
return sReturnInfo;
|
||
}
|
||
function checkCertIdAll(){//校验证件号
|
||
var certId = getItemValue(0,getRow(),"CERTID");
|
||
var sParams = "certId="+certId+",flowunid="+"<%=sFlowUnid%>";
|
||
var sReturnInfo = RunJavaMethodTrans("com.tenwa.lease.flow.project.businessapply.CustomerInfoCheck","checkCertIdAll",sParams);
|
||
return sReturnInfo;
|
||
}
|
||
</script>
|
||
<%@ include file="/Frame/resources/include/include_end.jspf"%> |