373 lines
13 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 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("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");
});
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"];
if(certType=="Ent02"){
hideItemRequired(0,"SEX");
//hideItemRequired(0,"MOBILE");
for(var i=0;i<arr.length;i++){
hideItem(0,arr[i]);
setItemValue(0,0,arr[i],"");
}
}else{
showItemRequired(0,"SEX");
showItemRequired(0,"MOBILE");
showItemRequired(0,"ADDRESS");
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"%>