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

113 lines
3.6 KiB
Plaintext

<%@ page contentType="text/html; charset=GBK"%>
<%@ include file="/Frame/resources/include/include_begin_info.jspf"%><%
/*
Author: undefined 2017-03-17
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 = "CustomerTelInfo";//--模板号--
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","保存","保存所有修改","saveRecord()","","","",""},
{"true","","Button","返回","返回列表页面","goBack()","","","","btn_icon_return"},
};
sButtonPosition = "south";
%><%@ include file="/Frame/resources/include/ui/include_info.jspf"%>
<script type="text/javascript">
$(document.ready=function(){
checkAreaVisible();
})
setDialogTitle("联系电话");
function saveRecord(){
if(!checkAreaCode()) return;
if(!check())return;
var result=check();
var isnew = getItemValue(0,getRow(),"isnew");//是否最新
var teltype = getItemValue(0,getRow(),"teltype");//电话类型
var id = getItemValue(0,getRow(),"id");
if(isnew == "yes"){
var sReturnInfo = RunJavaMethodTrans("com.tenwa.customer.controller.tell.CustomerTelAction","updateisnew","id="+id+",teltype="+teltype+",customerId="+"<%=customerId%>");
}else{
var sReturnInfo = RunJavaMethodTrans("com.tenwa.customer.controller.tell.CustomerTelAction","checkNoNew","id="+id+",teltype="+teltype+",customerId="+"<%=customerId%>");
}
as_save("myiframe0","parent.AsDialog.ClosePage()");
}
function goBack(){
parent.AsDialog.ClosePage();
reloadSelf();
}
function check(){
var telephone = getItemValue(0,getRow(),"telephone");//电话
if(typeof(telephone) != undefined && telephone!= "" ){
if(!CheckPhoneCode(telephone)){
alert("电话号码格式错误");
return false;
}
}
return true;
}
function checkAreaVisible(){
var area = getItemValue(0,getRow(),"ext");//分机号
var area = getItemValue(0,getRow(),"area");//区号
var teltype = getItemValue(0,getRow(),"teltype");//电话类型
if (teltype == "010"){
hideItem(0,"area");
hideItem(0,"ext");
setItemValue(0,getRow(),"area","");//区号
setItemValue(0,getRow(),"ext","");//分机号
}else{
showItem(0,"area");
showItem(0,"ext");
}
}
/* [Describe=如果电话类型为手机则不需要输入区号,如果为固话则要求输入区号;InputParam=无;OutPutParam=无;]
*/
function checkAreaCode(){
var intarea = getItemValue(0, getRow(), "intarea");
var area = getItemValue(0, getRow(), "area");
var ext = getItemValue(0, getRow(), "ext");
if(intarea != ""){
var intareaRegexp = new RegExp("^([0-9]*)$");
if(intareaRegexp.test(intarea)==false){
alert("国际区号有误,请重新输入!"); //国际区号有误,请重新输入!
return;
}
}
if(area != ""){
var areaRegexp = new RegExp("^([0-9]{3,4})$");
if(areaRegexp.test(area)==false){
alert("区号有误,请重新输入!"); //区号有误,请重新输入!
return;
}
}
if(ext != ""){
var extRegexp = new RegExp("^([0-9]*)$");
if(extRegexp.test(ext)==false){
alert("分机号有误,请重新输入!"); //分机号有误,请重新输入!
return;
}
}
return true;
}
//初始化接收语言类型是否显示
/* selectFlag(); */
checkAreaVisible();
</script>
<%@ include file="/Frame/resources/include/include_end.jspf"%>