经销商分类
This commit is contained in:
parent
77a4f8fd6d
commit
577fbeb3fb
@ -3,6 +3,7 @@
|
||||
String rightType = CurPage.getParameter("rightType");
|
||||
if(rightType ==null)rightType="";
|
||||
String group_no = CurPage.getParameter("group_no");
|
||||
String id = CurPage.getParameter("id");
|
||||
if(group_no ==null)group_no="";
|
||||
String group_name = CurPage.getParameter("group_name");
|
||||
if(group_name ==null)group_name="";
|
||||
@ -13,10 +14,10 @@
|
||||
if(rightType.equals("ReadOnly")){
|
||||
dwTemp.ReadOnly = "1";//Ö»¶Áģʽ
|
||||
}
|
||||
dwTemp.genHTMLObjectWindow(CurPage.getParameter("group_no"));
|
||||
dwTemp.genHTMLObjectWindow(id);
|
||||
CurPage.getCurComp().setAttribute("RightType", rightType);
|
||||
String compClientID = request.getParameter("CompClientID");
|
||||
dwTemp.replaceColumn("groupList", "<iframe type='iframe' name=\"frame_list_group\" width=\"100%\" height=\"250\" frameborder=\"0\" src=\""+sWebRootPath+"/Tenwa/Customer/Group/Subcompany/DistributorCustomerGroupRelationList.jsp?group_no="+group_no+"&CompClientID="+sCompClientID+"\"></iframe>", CurPage.getObjectWindowOutput());
|
||||
dwTemp.replaceColumn("groupList", "<iframe type='iframe' name=\"frame_list_group\" width=\"100%\" height=\"250\" frameborder=\"0\" src=\""+sWebRootPath+"/Tenwa/Customer/Group/Subcompany/DistributorCustomerGroupRelationList.jsp?group_no="+group_no+"&id="+id+"&CompClientID="+sCompClientID+"\"></iframe>", CurPage.getObjectWindowOutput());
|
||||
String sButtons[][] = {
|
||||
{"true","All","Button","±£´æ","±£´æ","saveRecord()","","","","btn_icon_save"},
|
||||
{"true","","Button","·µ»Ø","·µ»ØÁбí","goBack()","","","","btn_icon_return"}
|
||||
|
||||
@ -22,6 +22,7 @@
|
||||
var group_no = getItemValue(0,getRow(0),'group_no');
|
||||
setItemValue(0, 0, "productid", "<%=typeno%>");
|
||||
var group_name = getItemValue(0,getRow(0),'group_name');
|
||||
var id=getItemValue(0,getRow(0),'id');
|
||||
for(var i = 0;i < group_name.length;i++){
|
||||
if(group_name.charAt(i) == "'" || group_name.charAt(i) == "<" || group_name.charAt(i) == ">"){
|
||||
alert("集团名称含有非法字符");
|
||||
|
||||
@ -25,8 +25,9 @@
|
||||
if(typeof(sReturnValue)!=undefined && sReturnValue!=''){
|
||||
var result = sReturnValue.split('&');
|
||||
var group_no = result[0];
|
||||
var sId=RunJavaMethodTrans("com.tenwa.customer.controller.group.CustomerGroupCompanyController","getNewId","group_no="+group_no);
|
||||
var group_name = result[1];
|
||||
AsControl.OpenView("/Tenwa/Customer/Group/GroupCompany/DistributorCustomerGroupCompany.jsp","group_no="+group_no+'&group_name='+group_name,"_self","");
|
||||
AsControl.OpenView("/Tenwa/Customer/Group/GroupCompany/DistributorCustomerGroupCompany.jsp","id="+sId+"&group_no="+group_no+'&group_name='+group_name,"_self","");
|
||||
}
|
||||
},"新增集团");
|
||||
}
|
||||
@ -34,21 +35,23 @@
|
||||
function view(){
|
||||
var sUrl = "/Tenwa/Customer/Group/GroupCompany/DistributorCustomerGroupCompany.jsp";
|
||||
var group_no = getItemValue(0,getRow(0),'group_no');
|
||||
var id = getItemValue(0,getRow(0),'id');
|
||||
if(typeof(group_no)=="undefined" || group_no.length==0 ){
|
||||
alert("请选择一条信息!");
|
||||
return ;
|
||||
}
|
||||
AsControl.OpenView(sUrl,"group_no="+group_no+'&rightType=ReadOnly',"_self","");
|
||||
AsControl.OpenView(sUrl,"group_no="+group_no+"&id="+id+'&rightType=ReadOnly',"_self","");
|
||||
}
|
||||
//修改
|
||||
function edit(){
|
||||
var sUrl = "/Tenwa/Customer/Group/GroupCompany/DistributorCustomerGroupCompany.jsp";
|
||||
var group_no = getItemValue(0,getRow(0),'group_no');
|
||||
var id = getItemValue(0,getRow(0),'id');
|
||||
if(typeof(group_no)=="undefined" || group_no.length==0 ){
|
||||
alert("请选择一条信息!");
|
||||
return ;
|
||||
}
|
||||
AsControl.OpenView(sUrl,"group_no="+group_no,"_self","");
|
||||
AsControl.OpenView(sUrl,"group_no="+group_no+"&id="+id,"_self","");
|
||||
}
|
||||
//废弃
|
||||
function del(){
|
||||
|
||||
@ -3,6 +3,7 @@
|
||||
String rightType = CurPage.getParameter("rightType");
|
||||
if(rightType == null) rightType = "";
|
||||
String group_id = CurPage.getParameter("group_id");
|
||||
String id = CurPage.getParameter("id");
|
||||
if(group_id == null) group_id = "";
|
||||
String sTempletNo = "DistributorGroupRelation";//--模板号--
|
||||
ASObjectModel doTemp = new ASObjectModel(sTempletNo);
|
||||
@ -40,7 +41,7 @@ function selectCustomerName(){
|
||||
setItemValue(0,0,"distributor_id",sReturn[0]);
|
||||
setItemValue(0,0,"DISTRIBUTOR_NO",sReturn[1]);
|
||||
setItemValue(0,0,"DISTRIBUTOR_NAME",sReturn[2]);
|
||||
setItemValue(0,0,"group_id",'<%=group_id%>');
|
||||
setItemValue(0,0,"group_id",'<%=id%>');
|
||||
},"请选择集团客户成员",'');
|
||||
}
|
||||
|
||||
|
||||
@ -4,11 +4,12 @@
|
||||
ASObjectModel doTemp = new ASObjectModel("DistributorGroupRelationList");
|
||||
ASObjectWindow dwTemp = new ASObjectWindow(CurPage,doTemp,request);
|
||||
String group_id = CurPage.getParameter("group_no");
|
||||
String id = CurPage.getParameter("id");
|
||||
if(group_id == null)group_id ="";
|
||||
dwTemp.Style="1"; //--设置为Grid风格--
|
||||
dwTemp.ReadOnly = "1"; //只读模式
|
||||
dwTemp.setPageSize(10);
|
||||
dwTemp.genHTMLObjectWindow(group_id);
|
||||
dwTemp.genHTMLObjectWindow(id);
|
||||
String sButtons[][] = {
|
||||
{"true","All","Button","新增成员","新增成员","newRecord()","","","","btn_icon_add",""},
|
||||
{"true","All","Button","修改","查看/修改详情","viewAndEdit()","","","","btn_icon_edit"},
|
||||
@ -42,8 +43,8 @@ function viewAndEdit(){
|
||||
}
|
||||
AsDialog.PopView(sUrl,"id="+id+"&flag="+flag+"&group_id="+'<%=group_id%>',"resizable=yes;dialogWidth=600px;dialogHeight=250px;center:yes;status:no;statusbar:no",function(){
|
||||
// reloadSelf();
|
||||
},"修改集团下属公司信息");
|
||||
window.location.reload();
|
||||
},"修改集团下属公司信息");
|
||||
}
|
||||
//详情
|
||||
function view(){
|
||||
@ -55,8 +56,8 @@ function view(){
|
||||
}
|
||||
AsDialog.PopView(sUrl,'id=' +id+'&rightType=ReadOnly',"resizable=yes;dialogWidth=600px;dialogHeight=250px;center:yes;status:no;statusbar:no",function(){
|
||||
// reloadSelf();
|
||||
},"集团下属公司详细信息");
|
||||
window.location.reload();
|
||||
},"集团下属公司详细信息");
|
||||
}
|
||||
// 删除
|
||||
function deleteRecord(){
|
||||
@ -67,10 +68,13 @@ function deleteRecord(){
|
||||
}else {
|
||||
if(confirm("确定要删除?"))
|
||||
{
|
||||
as_delete('myiframe0');
|
||||
var sReturnInfo = RunJavaMethodTrans("com.tenwa.customer.controller.group.CustomerGroupCompanyController","deleterelation","id="+id);
|
||||
if(sReturnInfo=="false") {alert("删除失败"); return;}
|
||||
//as_delete(0,'');
|
||||
}
|
||||
}
|
||||
parent.reloadSelf();
|
||||
//parent.reloadSelf();
|
||||
window.location.reload();
|
||||
}
|
||||
function detail(){
|
||||
var customerId=getItemValue(0, getRow(), "customer_id");
|
||||
|
||||
@ -12,7 +12,7 @@
|
||||
String ishistory=CurPage.getParameter("IsHistory");
|
||||
String RightType=CurPage.getParameter("RightType");
|
||||
String disno="";
|
||||
List<BizObject> nolist=JBOFactory.getBizObjectManager("jbo.com.tenwa.entity.comm.flow.FLOW_BUSSINESS_OBJECT").createQuery("select di.distributor_no from O ,jbo.app.tenwa.customer.DISTRIBUTOR_INFO di where flow_unid=:flowunid")
|
||||
List<BizObject> nolist=JBOFactory.getBizObjectManager("jbo.com.tenwa.entity.comm.flow.FLOW_BUSSINESS_OBJECT").createQuery("select di.distributor_no from O ,jbo.app.tenwa.customer.DISTRIBUTOR_INFO di where di.id=O.flow_key and flow_unid=:flowunid")
|
||||
.setParameter("flowunid",sFlowUnid).getResultList(false);
|
||||
if(nolist.size()>0){
|
||||
disno=nolist.get(0).getAttribute("distributor_no").getString();
|
||||
|
||||
@ -2,6 +2,7 @@ package com.tenwa.customer.controller.group;
|
||||
|
||||
import jbo.app.tenwa.customer.CUSTOMER_GROUP_COMPANY;
|
||||
import jbo.app.tenwa.customer.DISTRIBUTOR_GROUP_COMPANY;
|
||||
import jbo.app.tenwa.customer.DISTRIBUTOR_GROUP_RELATION;
|
||||
import jbo.com.tenwa.entity.comm.own.COUNTRY_DISTRICT_INFO;
|
||||
|
||||
import com.amarsoft.are.jbo.BizObject;
|
||||
@ -71,6 +72,18 @@ public class CustomerGroupCompanyController {
|
||||
}
|
||||
return "false";
|
||||
}
|
||||
public String deleterelation(JBOTransaction tx)throws Exception{
|
||||
BizObjectManager bom = JBOFactory.getBizObjectManager(DISTRIBUTOR_GROUP_RELATION.CLASS_NAME);
|
||||
tx.join(bom);
|
||||
//将此集团信息设置为废弃状态
|
||||
BizObjectQuery boq = bom.createQuery("delete from O where id=:id ");
|
||||
boq.setParameter("id",id);
|
||||
int i = boq.executeUpdate();
|
||||
if(i == 1){
|
||||
return "true";
|
||||
}
|
||||
return "false";
|
||||
}
|
||||
|
||||
/**
|
||||
* 集团名称不可重复
|
||||
@ -123,4 +136,14 @@ public class CustomerGroupCompanyController {
|
||||
return "false";
|
||||
}
|
||||
}
|
||||
|
||||
public String getNewId(JBOTransaction tx) throws Exception{
|
||||
String id="";
|
||||
BizObjectManager dgcm = JBOFactory.getBizObjectManager(DISTRIBUTOR_GROUP_COMPANY.CLASS_NAME);
|
||||
BizObject dgc = dgcm.createQuery("group_no=:group_no").setParameter("group_no", group_no).getSingleResult(false);
|
||||
if(dgc != null){
|
||||
id= dgc.getAttribute("ID").getString();
|
||||
}
|
||||
return id;
|
||||
}
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user