2018-11-20 11:29:54 +08:00

139 lines
6.2 KiB
Plaintext

<%@ page contentType="text/html; charset=GBK"%>
<%@ include file="/Frame/resources/include/include_begin_info.jspf"%><%
String customer_id = CurPage.getParameter("customer_id");
String flowunid = CurPage.getParameter("flowunid");
String fulladdress = CurPage.getParameter("fulladdress");
String country = CurPage.getParameter("country");
String province = CurPage.getParameter("province");
String dressdetail = CurPage.getParameter("dressdetail");
String zipcode = CurPage.getParameter("zipcode");
String provincename = CurPage.getParameter("provincename");
String id = CurPage.getParameter("id");
if(customer_id == null) customer_id = "";
String flag = CurPage.getParameter("flag");
if(flag == null) flag = "";
String rightType = CurPage.getParameter("rightType");
if(rightType ==null)rightType="";
String sTempletNo = "CustomerPersonAddress";//--模板号--
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()","","","","btn_icon_save"},
{"true","","Button","返回","返回列表页面","parent.AsDialog.ClosePage('cancel')","","","","btn_icon_return"}
};
sButtonPosition = "south";
%><%@ include file="/Frame/resources/include/ui/include_info.jspf"%>
<script type="text/javascript">
window.onload=function(){
var countryname = getItemValue(0,getRow(),"countryname");
if(countryname != "中华人民共和国"){
setItemRequired(0,"provincename",false);
hideItem(0,"provincename");
}
if("<%=id%>" == "null" || "<%=id%>" == ""){
setItemValue(0,0,"fulladdress","<%=fulladdress%>"=="null"?"":"<%=fulladdress%>");
setItemValue(0,0,"country","<%=country%>"=="null"?"":"<%=country%>");
setItemValue(0,0,"province","<%=province%>"=="null"?"":"<%=province%>");
setItemValue(0,0,"dressdetail","<%=dressdetail%>"=="null"?"":"<%=dressdetail%>");
setItemValue(0,0,"zipcode","<%=zipcode%>"=="null"?"":"<%=zipcode%>");
setItemValue(0,0,"provincename","<%=provincename%>"=="null"?"":"<%=provincename%>");
}
}
//国家/地区
function selectCountryCode(){
var sParaString = "CodeNo"+",CountryCode";
AsDialog.setObjectValue("SelectCountry",sParaString,"@country@0@countryname@1",0,0,"resizable=yes;dialogWidth=560px;dialogHeight=355px;center:yes;status:no;statusbar:no",function(sReturn){
if(typeof(sReturn)!=undefined && sReturn!=''){
var results = sReturn.split('@');
if(results[0] != 'CHN'){
setItemRequired(0,"provincename",false);
hideItem(0,"provincename");
}else{
setItemRequired(0,"provincename",true);
showItem(0,"provincename");
}
}
});
}
//省市
function selectRegionCode(){
var sCity = getItemValue(0,getRow(),"province");
AsDialog.PopView("/Common/ToolsA/AreaVFrame.jsp","AreaCode="+sCity,"dialogWidth=850px;dialogHeight=450px;center:yes;status:no;statusbar:no",function(sAreaCodeInfo){
//增加清空功能的判断
if( sAreaCodeInfo == '_CANCEL_'){
return;
}
if(sAreaCodeInfo == "NO" || sAreaCodeInfo == '_CLEAR_'){
setItemValue(0,getRow(),"province","");
setItemValue(0,getRow(),"provincename","");
}else{
if(typeof(sAreaCodeInfo) != "undefined" && sAreaCodeInfo != ""){
sAreaCodeInfo = sAreaCodeInfo.split('@');
sAreaCodeValue = sAreaCodeInfo[0];//-- 行政区划代码
sAreaCodeName = sAreaCodeInfo[1];//--行政区划名称
setItemValue(0,getRow(),"province",sAreaCodeValue);
setItemValue(0,getRow(),"provincename",sAreaCodeName);
}
}
},'请选择省市');
}
function saveRecord(){
if(!iV_all("0")) return;//先检查填写完整性
var flag = "<%=flag%>";
//var isadd = getItemValue(0,getRow(),"isadd");//是否通讯地址
var isadd = "yes";
var isnew = getItemValue(0,getRow(),"isnew");//是否最新
var addtype = getItemValue(0,getRow(),"addtype");//地址类型
var id = getItemValue(0,getRow(),"id");
var dressdetail = getItemValue(0,0,"dressdetail");
setItemValue(0,0,"dressdetail",dressdetail);
setItemValue(0,0,"fulladdress",getItemValue(0,0,"provincename")+getItemValue(0,0,"dressdetail"));
setItemValue(0,0,"flowunid","<%=flowunid%>");
if(flag == "edit"){
var result = RunJavaMethodTrans("com.tenwa.customer.controller.address.CustomerAddressController","selectEditAddress","customer_id="+"<%=customer_id%>"+",id="+id);
if(result == "false"){
if(isadd != "yes"){
alert("该联系地址为通讯地址,不能进行操作!");
return;
}
}else{
if(isadd == "yes"){
if(!confirm('已有通讯地址,是否确认设置该信息为通讯地址?')){
return;
};
var sReturnInfo = RunJavaMethodTrans("com.tenwa.customer.controller.address.CustomerAddressController","updateisadd","id="+id+",customer_id="+"<%=customer_id%>");
}
}
}else{
var result = RunJavaMethodTrans("com.tenwa.customer.controller.address.CustomerAddressController","selectAddress","customer_id="+"<%=customer_id%>");
if(result == "false"){
if(isadd != "yes"){
alert("第一条联系地址必须设置为通讯地址");
return;
}
}else{
if(isadd == "yes"){
var sReturnInfo = RunJavaMethodTrans("com.tenwa.customer.controller.address.CustomerAddressController","getAddress","customer_id="+"<%=customer_id%>");
if(sReturnInfo == "true"){
if(!confirm('已有通讯地址,是否确认设置该信息为通讯地址?')){
return;
};
}
var sReturnInfo = RunJavaMethodTrans("com.tenwa.customer.controller.address.CustomerAddressController","updateisadd","id="+id+",customer_id="+"<%=customer_id%>");
}
}
}
if(isnew == "yes"){
var sReturnInfo = RunJavaMethodTrans("com.tenwa.customer.controller.address.CustomerAddressController","updateisnew","id="+id+",addtype="+addtype+",customer_id="+"<%=customer_id%>");
}
parent.AsDialog.ClosePage(getItemValue(0,0,"id")+"@"+getItemValue(0,0,"fulladdress")+"@"+getItemValue(0,0,"country")+"@"+getItemValue(0,0,"province")+"@"+getItemValue(0,0,"dressdetail")+"@"+getItemValue(0,0,"zipcode")+"@"+getItemValue(0,0,"provincename"));
}
</script>
<%@ include file="/Frame/resources/include/include_end.jspf"%>