2023-09-27 09:57:58 +08:00

65 lines
2.9 KiB
Plaintext

<%@ page import="org.apache.commons.lang3.StringUtils" %>
<%@ page contentType="text/html; charset=GBK"%>
<%@ include file="/Frame/resources/include/include_begin_info.jspf"%><%
String addressId = CurPage.getParameter("addressId");
String areaCode = "";
ASObjectModel doTemp = new ASObjectModel("HouseholdSelectAddr");
if(StringUtils.isNotEmpty(addressId)){
ASResultSet as2 = Sqlca.getASResultSet(new SqlObject("select address_detail as address ,itemname as area_name, cpt.ap_address_code " +
" from rc_address_info cpt join code_library cl on cpt.ap_address_code = cl.itemno and cl.codeno = 'ZXAreaCode' where cpt.address_id = :addressId ").setParameter("addressId", addressId));
if(as2.next()){
doTemp.setDefaultValue("provincename", as2.getString("area_name"));
doTemp.setDefaultValue("dressdetail", as2.getString("address"));
areaCode = as2.getString("ap_address_code");
doTemp.setDefaultValue("province", areaCode);
}
}
ASObjectWindow dwTemp = new ASObjectWindow(CurPage, doTemp,request);
dwTemp.Style = "2";//freeform
dwTemp.genHTMLObjectWindow("");
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">
//省市(户籍选择)
function selectRegionCodeZX(){
AsDialog.PopView("/Common/ToolsA/AreaVFrame.jsp","sourceForm=zx&AreaCode=<%=areaCode%>","dialogWidth=850px;dialogHeight=450px;center:yes;status:no;statusbar:no",function(sAreaCodeInfo){
if( sAreaCodeInfo == '_CANCEL_'){
return;
}
//增加清空功能的判断
if( sAreaCodeInfo == '_CLEAR_'){
setItemValue(0,0,"provincename",'');
return;
}
if(sAreaCodeInfo !== ""){
setItemValue(0,0,"province",sAreaCodeInfo.split("@")[0]);
setItemValue(0,0,"provincename",sAreaCodeInfo.split("@")[1]);
}
},'选择户籍行政区划');
}
function saveRecord(){
if(!iV_all("0")) return;//先检查填写完整性
let province = getItemValue(0,getRow(0),"province");
let provinceName = getItemValue(0,getRow(0),"provincename");
let dressDetail = getItemValue(0,getRow(0),"dressdetail");
var sReturnInfo = RunJavaMethodTrans("com.ample.esb.common.address.PersonAddressController","saveOrUpdate",
"id="+"<%=addressId%>"+",provinceName="+provinceName+",dressDetail="+dressDetail+",province="+province);
if(sReturnInfo == ''){
alert("保存地址异常!")
return;
}
if(sReturnInfo.split("@")[0] == "false"){
alert("保存地址异常!")
return;
}
let returnVal = sReturnInfo.split("@")[1] +'@'+ getItemValue(0,getRow(0),"province")+'@'+getItemValue(0,getRow(0),"provincename")+getItemValue(0,getRow(0),"dressdetail");
parent.AsDialog.ClosePage(returnVal);
}
</script>
<%@ include file="/Frame/resources/include/include_end.jspf"%>