228 lines
7.0 KiB
Plaintext
228 lines
7.0 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 id = CurPage.getParameter("ID");
|
||
System.out.print(id);
|
||
String userOrgId = CurUser.getOrgID();
|
||
String userId = CurUser.getUserID();
|
||
String customerid = UUIDUtil.getUUID();
|
||
if(sPrevUrl == null) sPrevUrl = "";
|
||
|
||
String sTempletNo = "GuarantorInfo";//--模板号--
|
||
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">
|
||
changeCertType();
|
||
function changeCertType(){
|
||
var certType = getItemValue(0,getRow(0),"CERTTYPE");
|
||
var arr=["SEX","Marital_status","MOBILE","ADDRESS","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");
|
||
for(var i=0;i<arr.length;i++){
|
||
showItem(0,arr[i]);
|
||
}
|
||
}
|
||
}
|
||
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(checkORGRight1(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");
|
||
if(mobile==""){
|
||
//setErrorTips("mobile","手机号不能为空!");
|
||
// alert("手机号不能为空!");
|
||
return true;
|
||
}
|
||
var phone = /^[1][3,4,5,7,8][0-9]{9}$/;
|
||
if(phone.test(mobile)){
|
||
setErrorTips("mobile","");
|
||
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 id = getItemValue(0,getRow(),"id");
|
||
var sParams ="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 false;
|
||
}else{
|
||
setErrorTips("MOBILE","");
|
||
return true;
|
||
}
|
||
}
|
||
|
||
function save(){
|
||
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 sparam="FlowUnid="+getItemValue(0,0,"FLOWUNID")+"&ProjectId="+getItemValue(0,0,"project_id")+"&RightType="+'<%=RightType%>';
|
||
AsControl.OpenView(url,sparam,"_self","");
|
||
}
|
||
//根据身份证号判断性别
|
||
function ValidityCheck(){
|
||
var certID = getItemValue(0,getRow(),"CERTID");
|
||
sex = certID.substring(16,17);
|
||
sex = parseInt(sex);
|
||
if(sex%2==0){//奇男偶女
|
||
setItemValue(0,getRow(),"SEX","2");
|
||
}else{
|
||
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 sParams ="id="+id+",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;
|
||
}
|
||
</script>
|
||
<%@ include file="/Frame/resources/include/include_end.jspf"%> |