更新代码
This commit is contained in:
parent
90cd3db06c
commit
cc3c2cb389
@ -8,7 +8,7 @@
|
||||
String id = CurPage.getParameter("id");//账号id
|
||||
String sflowunid = CurPage.getParameter("flowunid");
|
||||
String flowunid=CurPage.getParameter("ObjectNo");
|
||||
// String righttrpe=CurPage.getParameter("righttrpe");
|
||||
String righttrpe=CurPage.getParameter("RightType");
|
||||
if(id == null) id="";
|
||||
String sTempletNo = "LDistributorAccountInfo"; //模板号
|
||||
// if(sTempletNo == null) sTempletNo = "LDistributorAccountInfo";
|
||||
@ -21,21 +21,30 @@
|
||||
doTemp.setDefaultValue("DISTRIBUTOR_ID", DISTRIBUTOR_NO);
|
||||
ASObjectWindow dwTemp = new ASObjectWindow(CurPage,doTemp,request);
|
||||
dwTemp.Style="2"; //--设置为Grid风格--
|
||||
/* if(righttrpe=="ReadOnly"){
|
||||
dwTemp.ReadOnly = "1"; //只读模式
|
||||
}
|
||||
*/
|
||||
/* if("ReadOnly".equals(righttrpe)){
|
||||
//dwTemp.ReadOnly = "1"; //只读模式
|
||||
} */
|
||||
|
||||
dwTemp.genHTMLObjectWindow(id);
|
||||
|
||||
//0、是否展示 1、 权限控制 2、 展示类型 3、按钮显示名称 4、按钮解释文字 5、按钮触发事件代码 6、 7、 8、 9、图标,CSS层叠样式 10、风格
|
||||
String sButtons[][] = {
|
||||
{"true","","Button","保存","保存所有修改","save()","","","","btn_icon_save"},
|
||||
/* {"ReadOnly".equals(righttrpe)?"false":"true","","Button","保存","保存所有修改","save()","","","","btn_icon_save"}, */
|
||||
{"true","","Button","返回","返回","returnList()","","","","btn_icon_return"}
|
||||
};
|
||||
%><%@ include file="/Frame/resources/include/ui/include_info.jspf"%>
|
||||
<script type="text/javascript">
|
||||
function save(){
|
||||
setItemValue(0,0,"sPara","<%=sflowunid%>");
|
||||
var partner = getItemValue(0,getRow(0),"IS_MAIN");
|
||||
|
||||
if(partner=="Y"){
|
||||
var result = RunJavaMethodTrans("com.tenwa.lease.flow.project.businessapply.AccountInfoManage","CheckPartnerInfo","flowunid=<%=flowunid%>");
|
||||
if(result=="1"){
|
||||
alert("主账户已存在!");
|
||||
return;
|
||||
}
|
||||
}
|
||||
as_save(0,"returnList()");
|
||||
}
|
||||
function returnList(){
|
||||
|
||||
@ -6,6 +6,10 @@
|
||||
History Log:
|
||||
*/
|
||||
String sFlowUnid = CurPage.getParameter("FlowUnid");//Á÷³Ì±àºÅ
|
||||
String PhaseNo=CurPage.getParameter("PhaseNo");
|
||||
String RightType=CurPage.getParameter("RightType");
|
||||
// String PhaseNo=CurPage.getParameter("PhaseNo");
|
||||
// System.out.print("==============="+RightType);
|
||||
if(sFlowUnid == null) sFlowUnid="";
|
||||
String sTempletNo = CurPage.getParameter("TempletNo");//Ä£°åºÅ
|
||||
if(sTempletNo == null) sTempletNo = "LDistributorInfo";
|
||||
@ -15,13 +19,22 @@
|
||||
ASObjectModel doTemp = new ASObjectModel(sTempletNo);
|
||||
doTemp.setDefaultValue("FLOWUNID", sFlowUnid);
|
||||
doTemp.setDefaultValue("DISTRIBUTOR_NO", DISTRIBUTOR_NO);
|
||||
|
||||
if("0020".equals(PhaseNo)){
|
||||
doTemp.setRequired("RETAIL_OPEN_DATE",true);//(0, "RETAIL_OPEN_DATE", true);
|
||||
doTemp.setReadOnly("",true);//先把页面所有字段设为只读状态
|
||||
doTemp.setReadOnly("RETAIL_OPEN_DATE",false);//唯独把这个字段设为必填
|
||||
// dwTemp.getDataObject().set.setReadOnly("RETAIL_OPEN_DATE", false);
|
||||
// dwTemp.getDataObject().setRequired("RETAIL_OPEN_DATE", true);
|
||||
}
|
||||
//doTemp.setColTips("", "²âÊÔ");
|
||||
ASObjectWindow dwTemp = new ASObjectWindow(CurPage, doTemp,request);
|
||||
dwTemp.Style = "2";//freeform
|
||||
//dwTemp.ReadOnly = "1";//Ö»¶Áģʽ
|
||||
//dwTemp.ReadOnly = "1";//只读模式
|
||||
ASDataObject ado = dwTemp.getDataObject();
|
||||
ado.setHtmlEvent("LIMIT_APPROVAL_DATE", "onchange", "getenddate");
|
||||
ado.setHtmlEvent("LIMIT_EFFECTIVE_DATE", "onchange", "getenddate");
|
||||
//ado.setReadOnly("BUSINESS_PROPERTY,DISTRIBUTORER",true);
|
||||
dwTemp.genHTMLObjectWindow(sFlowUnid);
|
||||
|
||||
String sButtons[][] = {
|
||||
@ -32,13 +45,20 @@
|
||||
%><%@ include file="/Frame/resources/include/ui/include_info.jspf"%>
|
||||
<script type="text/javascript">
|
||||
|
||||
function save(){
|
||||
as_save(0,"saveproj_name()");
|
||||
}
|
||||
function saveproj_name(){
|
||||
var sReturnInfo = RunJavaMethodTrans("com.tenwa.lease.flow.project.businesspply.CustomerInfoManage","saveDistributorInfo","flowunid=<%=sFlowUnid%>");
|
||||
<%-- $(function(){
|
||||
if("<%=PhaseNo%>"=="0020"){
|
||||
setItemRequired(0, "RETAIL_OPEN_DATE", true);
|
||||
$("#RETAIL_OPEN_DATE")
|
||||
}
|
||||
}) --%>
|
||||
|
||||
}
|
||||
function save(){
|
||||
as_save(0,"saveproj_name()");
|
||||
}
|
||||
function saveproj_name(){
|
||||
var sReturnInfo = RunJavaMethodTrans("com.tenwa.lease.flow.project.businesspply.CustomerInfoManage","saveDistributorInfo","flowunid=<%=sFlowUnid%>");
|
||||
|
||||
}
|
||||
|
||||
function getenddate(){
|
||||
var limit_approval_date=getItemValue(0,0,"LIMIT_APPROVAL_DATE");
|
||||
|
||||
@ -0,0 +1,52 @@
|
||||
package com.tenwa.lease.flow.project.businessapply;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
import jbo.app.tenwa.customer.CUSTOMER_FAMILY_TEMP;
|
||||
import jbo.app.tenwa.customer.DISTRIBUTOR_ACCOUNT_TEMP;
|
||||
|
||||
import com.amarsoft.are.jbo.BizObject;
|
||||
import com.amarsoft.are.jbo.BizObjectManager;
|
||||
import com.amarsoft.are.jbo.JBOException;
|
||||
import com.amarsoft.are.jbo.JBOFactory;
|
||||
import com.amarsoft.are.jbo.JBOTransaction;
|
||||
|
||||
public class AccountInfoManage {
|
||||
|
||||
private String flowunid;
|
||||
|
||||
public String CheckPartnerInfo(JBOTransaction tx) throws JBOException{
|
||||
BizObjectManager bm = JBOFactory.getBizObjectManager(DISTRIBUTOR_ACCOUNT_TEMP.CLASS_NAME,tx);
|
||||
List<BizObject> bos = bm.createQuery("flowunid=:flowunid").setParameter("flowunid",this.flowunid).getResultList(false);
|
||||
if(bos==null){
|
||||
return "2";
|
||||
}
|
||||
Map<String, String> partners = new HashMap<String, String>();
|
||||
for(BizObject bo:bos){
|
||||
String partner = bo .getAttribute("IS_MAIN").toString();
|
||||
partners.put(partner, partner);
|
||||
}
|
||||
|
||||
Set<String> set = partners.keySet();
|
||||
|
||||
boolean res = set.contains("Y");
|
||||
if(res==true){
|
||||
return "1";
|
||||
}else{
|
||||
return "2";
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public String getFlowunid() {
|
||||
return flowunid;
|
||||
}
|
||||
|
||||
public void setFlowunid(String flowunid) {
|
||||
this.flowunid = flowunid;
|
||||
}
|
||||
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user