289 lines
9.4 KiB
Plaintext
289 lines
9.4 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-27
|
||
Content: 示例详情页面
|
||
History Log:
|
||
*/
|
||
String sPrevUrl = CurPage.getParameter("PrevUrl");
|
||
String customerType = CurPage.getParameter("CustomerType");
|
||
String ProjectId = CurPage.getParameter("ProjectId");
|
||
String flowunid = CurPage.getParameter("FlowUnid");
|
||
String flowName = CurPage.getParameter("FlowName");
|
||
if(sPrevUrl == null) sPrevUrl = "";
|
||
|
||
String falg = "true";
|
||
if("合同制作流程".equals(flowName)){
|
||
falg = "false";
|
||
}
|
||
String sTempletNo = "CustomerFamilyJoinTempInfo";//--模板号--
|
||
ASObjectModel doTemp = new ASObjectModel(sTempletNo);
|
||
doTemp.setColTips("", "");
|
||
doTemp.setDefaultValue("project_id", ProjectId);
|
||
doTemp.setHtmlEvent("tel","onChange","checkTelRepeat");
|
||
doTemp.setHtmlEvent("certId","onChange","checkCertId");
|
||
doTemp.setHtmlEvent("suphone","onChange","checkSuphone");
|
||
doTemp.setHtmlEvent("certtype", "onChange", "setSexRead");
|
||
doTemp.setHtmlEvent("certid","onChange","ValidityCheck");
|
||
ASObjectWindow dwTemp = new ASObjectWindow(CurPage, doTemp,request);
|
||
dwTemp.Style = "2";//freeform
|
||
//dwTemp.ReadOnly = "-2";//只读模式
|
||
String FlowUnid = CurPage.getParameter("FlowUnid");
|
||
String customerid = Sqlca.getString("select customer_id from lb_union_lessee_temp where flowunid='"+FlowUnid+"'");
|
||
// dwTemp.genHTMLObjectWindow(CurPage.getParameter("FlowUnid"));flowunid + "," + customerid
|
||
String Partner = Sqlca.getString("select Partner_ from CUSTOMER_FAMILY_TEMP where flowunid='"+FlowUnid+"'");
|
||
if(Partner==null){
|
||
dwTemp.genHTMLObjectWindow(FlowUnid);
|
||
}else if(Partner.equals("Y")){
|
||
dwTemp.genHTMLObjectWindow(FlowUnid + "," + customerid);
|
||
}else{
|
||
dwTemp.genHTMLObjectWindow(FlowUnid);
|
||
}
|
||
|
||
String sButtons[][] = {
|
||
//{"true","","Button","新增","新增","newRecord()","","","","btn_icon_add"},
|
||
{falg,"","Button","保存","保存","viewAndEdit()","","","","btn_icon_edit"},
|
||
//{"true","All","Button","保存","保存所有修改","save(0)","","","",""},
|
||
{String.valueOf(!com.amarsoft.are.lang.StringX.isSpace(sPrevUrl)),"All","Button","返回","返回列表","returnList()","","","",""}
|
||
};
|
||
//sButtonPosition = "south";
|
||
%><%@ include file="/Frame/resources/include/ui/include_info.jspf"%>
|
||
<script type="text/javascript">
|
||
$(function(){
|
||
var spouse = getItemValue(0,0,"Spouse_");
|
||
if("Y"==spouse){
|
||
$("#ASSURE_RELATION").val("配偶");
|
||
document.getElementById("ASSURE_RELATION").readOnly=true;
|
||
}
|
||
document.getElementById("SEX").readOnly=true;
|
||
})
|
||
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 certId = getItemValue(0,getRow(0),"certid");
|
||
if(certId==""){
|
||
setErrorTips("certId","证件号不能为空!");
|
||
return true;
|
||
}
|
||
if(certId.length!=18){
|
||
setErrorTips("certid","身份证必须是18位!");
|
||
return false;
|
||
}
|
||
if(CheckLicense(certId)){
|
||
setErrorTips("certid","");
|
||
return true;
|
||
}else{
|
||
setErrorTips("certId","身份证格式不正确!");
|
||
return false;
|
||
}
|
||
|
||
}
|
||
|
||
function checkTel(){//校验共同申请人手机号格式
|
||
var tel = getItemValue(0,getRow(0),"tel");
|
||
if(tel==""){
|
||
// setErrorTips("tel","手机号不能为空!");
|
||
//alert("手机号不能为空!");
|
||
return true;
|
||
}
|
||
var phone = /^[1][3,4,5,7,8][0-9]{9}$/;
|
||
if(phone.test(tel)){
|
||
setErrorTips("tel","");
|
||
return true;
|
||
}else{
|
||
setErrorTips("tel","手机号格式不正确!");
|
||
//alert("手机号格式不正确!");
|
||
return false;
|
||
}
|
||
/* if(CheckPhoneCode(tel)){
|
||
setErrorTips("tel","");
|
||
return true;
|
||
}else{
|
||
setErrorTips("tel","手机号格式不正确!");
|
||
//alert("手机号格式不正确!");
|
||
return false;
|
||
} */
|
||
}
|
||
|
||
function checkSuphone(){//校验单位电话格式和不为空
|
||
var suphone = getItemValue(0,getRow(0),"suphone");
|
||
if(suphone==""){
|
||
// setErrorTips("suphone","单位电话不能为空!");
|
||
//alert("单位电话不能为空!");
|
||
return true;
|
||
}
|
||
if(CheckPhoneCode(suphone)){
|
||
setErrorTips("suphone","");
|
||
return true;
|
||
}else{
|
||
setErrorTips("suphone","单位电话格式不正确!");
|
||
//alert("单位电话格式不正确!");
|
||
return false;
|
||
}
|
||
}
|
||
|
||
function checkTelRepeat(){//校验共同申请人手机号重复
|
||
var customerType = "03";
|
||
var tel = getItemValue(0,getRow(),"tel");
|
||
var id = getItemValue(0,getRow(),"id");
|
||
var sParams = "certId="+id+",mobile="+tel+",customerType="+customerType+",flowunid="+"<%=FlowUnid%>";
|
||
var sReturnInfo = RunJavaMethodTrans("com.tenwa.lease.flow.project.businessapply.CustomerInfoCheck","checkMobileRepeat",sParams);
|
||
if(sReturnInfo=="8"){
|
||
setErrorTips("tel","该手机号已重复!");
|
||
//alert("该手机号已重复!");
|
||
return false;
|
||
}else{
|
||
setErrorTips("tel","");
|
||
return true;
|
||
}
|
||
}
|
||
function checkSex(){
|
||
var sexw = getItemValue(0,0,"sex");
|
||
var spouse = getItemValue(0,0,"Spouse_");
|
||
if("Y"==spouse){
|
||
if("<%=customerType%>"=="03"){
|
||
var sParams ="flowunid="+"<%=FlowUnid%>";
|
||
var message = RunJavaMethodTrans("com.tenwa.lease.flow.project.businessapply.CustomerInfoCheck","checkSex",sParams);
|
||
if("error"==message){
|
||
alert("请先填写承租人性别!!");
|
||
return false;
|
||
}else{
|
||
if(sexw==message){
|
||
alert("承租人和配偶性别不能一致!!");
|
||
return false;
|
||
}
|
||
}
|
||
}
|
||
}
|
||
return true;
|
||
}
|
||
function newRecord(){//新增
|
||
var name = getItemValue(0,0,"name");
|
||
var certid = getItemValue(0,0,"certid");
|
||
var tel = getItemValue(0,0,"tel");
|
||
var shukou = getItemValue(0,0,"shukou");
|
||
var suname = getItemValue(0,0,"suname");
|
||
var suphone = getItemValue(0,0,"suphone");
|
||
var sposition = getItemValue(0,0,"sposition");
|
||
var smincome = getItemValue(0,0,"smincome");
|
||
if(name=="" || certid==""){
|
||
alert("请输入信息!");
|
||
return;
|
||
}
|
||
var sResult = RunJavaMethodTrans("com.tenwa.lease.flow.project.businessapply.CustomerFamilyJoin","saveCustomerFamily",
|
||
"customerid=<%=UUIDUtil.getUUID()%>,flowunid=<%=FlowUnid%>,tel="+getItemValue(0,0,"tel")+",name="+getItemValue(0,0,"name")+",certid="+getItemValue(0,0,"certid")+",shukou="+getItemValue(0,0,"shukou")+",suname="+getItemValue(0,0,"suname")+",suphone="+getItemValue(0,getRow(0),"suphone")+",sposition="+getItemValue(0,getRow(0),"sposition")+",smincome="+getItemValue(0,getRow(0),"smincome"));
|
||
if(sResult == "1"){
|
||
alert("新增成功!");
|
||
reloadSelf();
|
||
}
|
||
if(sResult == "2"){
|
||
alert("已存在共同申请人!");
|
||
reloadSelf();
|
||
}
|
||
if(sResult == "3"){
|
||
alert("新增失败!");
|
||
reloadSelf();
|
||
}
|
||
}
|
||
function viewAndEdit(){//保存
|
||
var CertIdResult = checkCertId();
|
||
if(CertIdResult==false){
|
||
return;
|
||
}
|
||
var TelResult = checkTel();
|
||
if(TelResult==false){
|
||
return;
|
||
}
|
||
var SuphoneResult = checkSuphone();
|
||
if(SuphoneResult==false){
|
||
return;
|
||
}
|
||
var falgs = checkTelRepeat();
|
||
if(falgs==false){
|
||
return;
|
||
}
|
||
if(!checkSex()){
|
||
return;
|
||
}
|
||
if(!checkCertidRepeat()){
|
||
return;
|
||
}
|
||
var assurerelation = getItemValue(0,0,"ASSURE_RELATION");
|
||
if(assurerelation.length>10){
|
||
setErrorTips("ASSURE_RELATION","关系输入过长!!");
|
||
return;
|
||
}else{
|
||
setErrorTips("ASSURE_RELATION","");
|
||
}
|
||
/*var ID = getItemValue(0,getRow(0),'ID');
|
||
if("undefined"==ID||""==ID || null==ID){
|
||
AsDebug.showMessage("提示","请选中一条数据!","","",true);
|
||
return;
|
||
}
|
||
var sUrl = "/Tenwa/Lease/Flow/Project/BusinessApplication/CustomerFamilyJoinTempInfo.jsp";
|
||
var sparam = 'ID='+ID;
|
||
AsControl.OpenView(sUrl,sparam,"_self","");
|
||
var name = getItemValue(0,0,"name");
|
||
var certid = getItemValue(0,0,"certid");
|
||
var tel = getItemValue(0,0,"tel");
|
||
var shukou = getItemValue(0,0,"shukou");
|
||
var suname = getItemValue(0,0,"suname");
|
||
var suphone = getItemValue(0,0,"suphone");
|
||
var sposition = getItemValue(0,0,"sposition");
|
||
var smincome = getItemValue(0,0,"smincome");
|
||
if(name=="" || certid=="" || tel==""){
|
||
alert("请输入共同申请人信息!");
|
||
return;
|
||
}else{ */
|
||
var flowunid = getItemValue(0,0,"flowunid");
|
||
var customerid = getItemValue(0,0,"customerid");
|
||
if(null==flowunid||""==flowunid){
|
||
setItemValue(0, 0, "flowunid", "<%=FlowUnid%>");
|
||
setItemValue(0, 0, "Partner_", "Y");
|
||
}
|
||
if(null==customerid||""==customerid){
|
||
setItemValue(0, 0, "customerid","<%=customerid%>");
|
||
}
|
||
as_save(0);
|
||
// }
|
||
}
|
||
function returnList(){
|
||
AsControl.OpenView("<%=sPrevUrl%>", "","_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 id = getItemValue(0,getRow(),"ID");
|
||
var certId = getItemValue(0,getRow(),"CERTID");
|
||
var sParams ="id="+id+",certid="+certId+",flowunid=<%=flowunid%>";
|
||
var sReturnInfo = RunJavaMethodTrans("com.tenwa.lease.flow.project.businessapply.CustomerInfoCheck","checkCertidRepeat",sParams);
|
||
if("success"!=sReturnInfo){
|
||
setErrorTips("CERTID",sReturnInfo);
|
||
return false;
|
||
}
|
||
setErrorTips("CERTID","");
|
||
return true;
|
||
}
|
||
</script>
|
||
<%@ include file="/Frame/resources/include/include_end.jspf"%> |