2018-06-19 14:56:34 +08:00

147 lines
5.8 KiB
Plaintext

<%@ page contentType="text/html; charset=GBK"%>
<%@page import="com.tenwa.comm.dataRightmanager.DataRightManager"%>
<%@ include file="/Frame/resources/include/include_begin_list.jspf"%><%
String PG_TITLE = "自然人信息列表" ; // 浏览器窗口标题 <title> PG_TITLE </title>
//定义变量
String userId = CurUser.getUserID(); //用户ID
String orgId = CurOrg.getOrgID(); //机构ID
//获得组件参数 :客户类型、客户显示模版号
String sCustomerType = CurPage.getParameter("CustomerType");
String sTempletNo = CurPage.getParameter("CustomerListTemplet");
if(sCustomerType == null) sCustomerType = "";
if(sTempletNo == null) sTempletNo = "";
//通过显示模版产生模型对象doTemp
ASObjectModel doTemp = new ASObjectModel(sTempletNo);
String otherWhere=DataRightManager.getRightCondition(CurUser,"O","cust");
doTemp.appendJboWhere(otherWhere);
ASObjectWindow dwTemp = new ASObjectWindow(CurPage ,doTemp,request);
dwTemp.setPageSize(10);
dwTemp.Style="1"; //设置DW风格 1:Grid 2:Freeform
dwTemp.ReadOnly = "1"; //设置是否只读 1:只读 0:可写
dwTemp.genHTMLObjectWindow(sCustomerType);
String sButtons[][] = {
{"true","","Button","新增","新增一条记录","newRecord()","","","","btn_icon_add"},
{"true","","Button","修改","查看/修改详情","viewAndEdit()","","","","btn_icon_edit"},
{"true","","Button","详情","查看/修改详情","view()","","","","btn_icon_detail"},
{"true","","Button","废弃","废弃","invalid()","","","","btn_icon_delete"},
{"true","","Button","引用为","引用为","quote()","","","","btn_icon_quote"}
// {"true","","Button","分配归属人","分配归属人","allocation()","","","","btn_icon_distribute"},
};
%><%@include file="/Frame/resources/include/ui/include_list.jspf"%>
<script type="text/javascript">
function invalid(){
var userid = "<%=userId%>";
var orgid = "<%=orgId%>";
var customerId = getItemValue(0,getRow(),"customerid");
var sParams = "customerId="+customerId+",userId="+userid;
if (typeof(customerId) == "undefined" || customerId.length == 0){
alert(getMessageText('AWEW1001'));//请选择一条信息!
return;
}
var sReturn=RunJavaMethodTrans("com.tenwa.customer.controller.comm.CustomerCommonController","checkAttribution",sParams);
if(sReturn=="0"){
alert("您不是主归属人,不能修改该客户!");
return;
}
if(confirm("是否确认废弃该客户?")){
var sReturn = RunJavaMethodTrans("com.tenwa.customer.controller.comm.CustomerCommonController","invalid","customerId="+customerId+",userId="+userid+",orgId="+orgid+",custtype="+"cust_type.cust");
if(sReturn=="YES"){
alert("该客户已废弃!");
return;
}else{
reloadSelf();
alert("操作成功!");
}
}
}
function newRecord(){
var sCustomerType='<%=sCustomerType%>'; //--客户类型
AsDialog.PopView("/Tenwa/Customer/Lessee/Person/CustomerPersonRegister.jsp","CustomerType="+sCustomerType,"resizable=yes;dialogWidth=560px;dialogHeight=250px;center:yes;status:no;statusbar:no",function(sReturnValue){
if(typeof(sReturnValue)!=undefined && sReturnValue!=''){
AsDialog.OpenObject("Customer",sReturnValue,"001",null,function(){
reloadSelf();
});
}
},"新增客户信息");
}
function allocation()
{
var customerId = getItemValue(0,getRow(),"customerid");
if (typeof(customerId) == "undefined" || customerId.length == 0){
alert(getMessageText('AWEW1001'));//请选择一条信息!
return;
}
var sParams = "customerId="+customerId+",userId=<%=userId%>";
var sReturn=RunJavaMethodTrans("com.tenwa.customer.controller.comm.CustomerCommonController","checkAttribution",sParams);
if(sReturn=="0"){
alert("您不是主归属人,不能修改该客户!");
return;
}
AsDialog.PopView("/Tenwa/Customer/Lessee/Comm/Attribution/CustomerAttributionList.jsp","customerId="+customerId,"resizable=yes;dialogWidth=1000px;dialogHeight=800px;center:yes;status:no;statusbar:no",function(sReturnValue){
if(typeof(sReturnValue)!="undefined" && sReturnValue.length!=0){
reloadSelf();
}
},"分配归属人");
}
function viewAndEdit(){
var customerid = getItemValue(0,getRow(),"customerid");
var sParams = "customerid="+customerid+",userId=<%=userId%>";
var sReturn=RunJavaMethodTrans("com.tenwa.customer.controller.person.CustomerPersonCommonAction","checkAttribution",sParams);
if(sReturn=="0")
{
alert("您不是主归属人,不能修改客户信息!");
return;
}
AsDialog.OpenObject("Customer",customerid,"001",null,function(){
reloadSelf();
}
);
}
function view(){
var customerid = getItemValue(0,getRow(),"customerid");
if (typeof(customerid) == "undefined" || customerid.length == 0){
alert(getMessageText('AWEW1001'));//请选择一条信息!
return;
}
AsDialog.OpenObject("Customer",customerid,"002",null,function(){
reloadSelf();
}
);
}
function quote(){
var customerId = getItemValue(0,getRow(),"customerid");
var userid = "<%=userId%>";
var orgid = "<%=orgId%>";
if (typeof(customerId) == "undefined" || customerId.length == 0){
alert(getMessageText('AWEW1001'));//请选择一条信息!
return;
}
var sParams = "customerId="+customerId+",userId=<%=userId%>";
var sReturn=RunJavaMethodTrans("com.tenwa.customer.controller.comm.CustomerCommonController","checkAttribution",sParams);
if(sReturn=="0"){
alert("您不是主归属人,不能修改该客户!");
return;
}
AsDialog.PopView("/Tenwa/Customer/Comm/PersonQuoteCustType.jsp","customerId="+customerId+"&userId="+userid+"&orgId="+orgid+"&custType=cust_type.cust","resizable=yes;dialogWidth=450px;dialogHeight=150px;center:yes;status:no;statusbar:no",function(sReturnValue){
if(typeof(sReturnValue)!="undefined" && sReturnValue=='success'){
alert('操作成功!');
reloadSelf();
}
},"选择引用客户类别");
}
</script>
<%@ include file="/Frame/resources/include/include_end.jspf"%>