2018-06-03 22:26:41 +08:00

105 lines
3.5 KiB
Plaintext

<%@ page contentType="text/html; charset=GBK"%>
<%@ include file="/Frame/resources/include/include_begin_info.jspf"%><%
/*
Author: undefined 2017-03-21
Content: 示例详情页面
History Log:
*/
String flag = CurPage.getParameter("flag");
if(flag == null)flag="";
String customerId = CurPage.getParameter("customerId");
if(customerId == null) customerId ="";
String rightType = CurPage.getParameter("rightType");
if(rightType ==null)rightType="";
String sTempletNo = "CustomerRelatedParty";//--模板号--
ASObjectModel doTemp = new ASObjectModel(sTempletNo);
ASObjectWindow dwTemp = new ASObjectWindow(CurPage, doTemp,request);
dwTemp.Style = "2";//freeform
if(rightType.equals("ReadOnly")){
dwTemp.ReadOnly = "1";//只读模式
}
dwTemp.genHTMLObjectWindow(CurPage.getParameter("id"));
CurPage.getCurComp().setAttribute("RightType", rightType);
String sButtons[][] = {
{"true","All","Button","保存","保存所有修改","save()","","","",""},
{"true","All","Button","保存并新增","保存并新增","saveAndView()","","","","btn_icon_save"},
{"true","","Button","返回","返回列表页面","goBack()","","","","btn_icon_return"}
};
%><%@ include file="/Frame/resources/include/ui/include_info.jspf"%>
<script type="text/javascript">
function newRecord(){
var customerId='<%=customerId%>';
CHANGED=false; //跳转新页面时是否弹框提示已修改本页。
AsControl.OpenView("/Tenwa/Customer/Lessee/Comm/RelatedParty/CustomerRelatedPartyInfo.jsp","customerId="+customerId,"_self","");
}
function setErrorTips(colName,tips){
if(tips==""){
setItemUnit(0,getRow(),colName,"");
return ;
}
setItemUnit(0,getRow(),colName,"<font color=red>"+tips+"</font>");
}
function checkCertInfo(flag){
if(typeof(flag)=="undefined") flag=false;
var certType = getItemValue(0,getRow(),"certtype");
var certid = getItemValue(0,getRow(),"certid");
//判断组织机构代码合法性
if(certType =='Ent02'){
if(!checkORGRight(certid) ){
setErrorTips("certid","组织机构代码格式错误!");
return false;
}else{
setErrorTips("certid","");
}
}else if(certType =='Ent01'){
if(!isValidSocialCreditIdentifier(certid) ){
setErrorTips("certid","社会统一信用代码格式错误!");
return false;
}else{
setErrorTips("certid","");
}
}else{
setErrorTips("certid","");
}
//关系建立时间检验
var investdate = getItemValue(0,getRow(0),'INVESTDATE');
var s = investdate.split("/");
var date = new Date(s[0],s[1]-1,s[2]);
if(date.getFullYear() > (new Date()).getFullYear()){
alert("关系建立时间不正确,必须小于当前时间,请重新填写!");
return false;
}else if(date.getFullYear() == (new Date()).getFullYear()){
if(date.getMonth() > (new Date()).getMonth()){
alert("关系建立时间不正确,必须小于当前时间,请重新填写!");
return false;
}else if(date.getMonth() == (new Date()).getMonth()){
if(date.getDate() > (new Date()).getDate() || date.getDate() == (new Date()).getDate()){
alert("关系建立时间不正确,必须小于当前时间,请重新填写!");
return false;
}
}
}
return true;
}
//保存
function save(){
if(!checkCertInfo(true))return;
as_save("myiframe0");
}
//保存并新增
function saveAndView(){
if(!checkCertInfo()) return ;
as_save("myiframe0","newRecord()");
}
//返回
function goBack(){
CHANGED=false;//跳转新页面时是否弹框提示已修改本页。
var customerId='<%=customerId%>';
AsControl.OpenView("/Tenwa/Customer/Lessee/Comm/RelatedParty/CusotmerRelatedPartyList.jsp","customerId="+customerId,"_self","");
}
</script>
<%@ include file="/Frame/resources/include/include_end.jspf"%>