76 lines
2.6 KiB
Plaintext

<%@ page contentType="text/html; charset=GBK"%>
<%@ include file="/Frame/resources/include/include_begin_info.jspf"%><%
String rightType = CurPage.getParameter("rightType");
if(rightType ==null)rightType="";
String customer_id = CurPage.getParameter("customer_id");
if(customer_id ==null)customer_id="";
String id = CurPage.getParameter("id");
if(id ==null)id="";
String sTempletNo = "CustomerAccount";//--模板号--
ASObjectModel doTemp = new ASObjectModel(sTempletNo);
ASObjectWindow dwTemp = new ASObjectWindow(CurPage, doTemp,request);
dwTemp.Style = "2";//freeform
if(rightType.equals("ReadOnly")){
dwTemp.ReadOnly = "1";//只读模式
}
doTemp.setDefaultValue("acc_type", "N_Debit");
dwTemp.genHTMLObjectWindow(CurPage.getParameter("id"));
CurPage.getCurComp().setAttribute("RightType", rightType);
String sButtons[][] = {
{"true","All","Button","保存","保存所有修改","saveRecord()","","","","btn_icon_save"},
{"true","","Button","返回","返回列表页面","parent.AsDialog.ClosePage()","","","","btn_icon_return"}
};
sButtonPosition = "south";
%><%@ include file="/Frame/resources/include/ui/include_info.jspf"%>
<script type="text/javascript">
window.onload=function(){
var result = RunJavaMethodTrans("com.tenwa.customer.controller.account.CustomerAccountController","selectAccountName","customer_id="+"<%=customer_id%>");
setItemValue(0,0,"ACCOUNT",result);
}
//保存
function saveRecord(){
if(!iV_all("0")) return;//先检查填写完整性
var is_main = getItemValue(0,getRow(),"is_main");
var acc_number = getItemValue(0,getRow(),"acc_number");
if(isNaN(acc_number)){
alert("银行账号格式错误");
return;
}
//新增时
if('<%=id%>' == ''){
var result = RunJavaMethodTrans("com.tenwa.customer.controller.account.CustomerAccountController","selectAccount","customer_id="+"<%=customer_id%>");
//判断该客户是否已存在主账户
if(result == "true"){
if(is_main == 'yes'){
if(!(confirm('已有一条主账号信息,是否确认设置为主账号?'))){
return;
};
}
}else{
if(is_main != 'yes'){
alert('第一条账户必须设置为主账户');
return;
}
}
}else{//修改时
var result = RunJavaMethodTrans("com.tenwa.customer.controller.account.CustomerAccountController","selectEditAccount","customer_id="+"<%=customer_id%>"+",id="+"<%=id%>");
if(result == "true"){
if(is_main == "yes"){
if(!(confirm('已有一条主账号信息,是否确认设置为主账号?'))){
return;
};
}
}else{
if(is_main != 'yes'){
alert('仅有一条主账号信息,不允许改成非主账户');
return;
}
}
}
as_save("myiframe0","parent.AsDialog.ClosePage()");
}
</script>
<%@ include file="/Frame/resources/include/include_end.jspf"%>