⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 crm_customer_contact.jsp

📁 java开发的办公系统 1.系统管理 (地区管理,部门管理,菜单管理,用户管理,角色管理,权限) 2.工作流管理 (流程类别,流程) 3.字典管理 (国家,省份,城市,公共数据字典) 4.项目
💻 JSP
字号:
<%@ include file="../../include/configuration.jsp"%>
<%@ include file="../../include/authorizemanager.jsp"%>
<%@ page import="com.vere.crm.customer.bean.*"%>
<%@ page import="com.vere.crm.customer.item.*"%>
<%@ page contentType="text/html; charset=gb2312" %>
<%
	ParameterUtils.setCharacterEncoding(request);
	String status=ParameterUtils.getString(request,"status");
	//删除
	if(status.equals("remove"))
	{
		Crm_customer_contactItem item=new Crm_customer_contactItem();
		item.setId(ParameterUtils.getString(request,"id"));
		Crm_customer_contactBean bean=new Crm_customer_contactBean();
		boolean b=bean.removeItem(item);
	}
	//删除全部选择的

	if(status.equals("removeSelect"))
	{
		String ids=ParameterUtils.getString(request,"ids");
		Crm_customer_contactBean bean=new Crm_customer_contactBean();
		String[] idArray=ids.split(",");
		int flag=bean.removeItems(idArray);
		if(flag==2)
		{
			out.print("<script language='javascript'>alert('存在项目信息,请先删除该客户联系人下的项目信息');</script>");
		}
	}
	int pageNo=ParameterUtils.getInt(request,"page");
	if(pageNo<=0)
	{
		pageNo=1;
	}
	Crm_customer_contactItem item=new Crm_customer_contactItem();
	String customer_id=ParameterUtils.getString(request,"customer_id");//客户名
	String contact_name=ParameterUtils.getString(request,"contact_name");//联系人姓名
	String sex=ParameterUtils.getString(request,"sex");//性别
	String register_date=ParameterUtils.getString(request,"register_date");//登记日期
	String register_name=ParameterUtils.getString(request,"register_name");//登记人
	SessionFactory sessionFactory=(SessionFactory)session.getAttribute("sessionFactory");
	 Manager_usersItem usersItem=sessionFactory.getManager_usersItem();
	String register_area_nodepath=usersItem.getArea_id();//地区
	Crm_customer_infoItem crm_customer_infoFindItem=new Crm_customer_infoItem();
	item.setCrm_customer_infoItem(crm_customer_infoFindItem);
	
	item.setCustomer_id(customer_id);
	item.setContact_name(contact_name);
	item.setSex(sex);
	item.setRegister_date(register_date);
	item.setRegister_name(register_name);
	//item.setRegister_area_nodepath(register_area_nodepath);
	Crm_customer_contactBean bean=new Crm_customer_contactBean();
	List list=bean.find(item,pageNo,pageSize);
	int totalRecord=bean.getTotalRecord();
	int page_num=(int)Math.ceil((double)totalRecord/pageSize);

	Oa_dictionaryXmlBean oa_dictionaryXmlBean=new Oa_dictionaryXmlBean();
	List oa_dictionaryXmlList=oa_dictionaryXmlBean.findXmlByArray("17,18");
%>
<html>
<head>
<title><%=titleName%></title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link href="../../css/css.css" rel="stylesheet" type="text/css">
<script language="javascript" src="../../js/check.js"></script>
<link href="../../css/date.css" rel="stylesheet" type="text/css">
<script src="../../js/ShowDate.js"></script>
<script language="javascript">
    init();
</script>
</head>
<body>
<form name="form1" method="post" action="">
	<table border="0" cellpadding="0"  cellspacing="0" class="firsttable">
		<tr>
			<td align="center" valign="top">
				<table  class="centertable">
					<tr>
						<td>
						</td>
					</tr>
					<tr>
						<td align="center" valign="top">
							<table class="containContentsTable">
								<tr>
									<td align="right" colspan=2 >
									客户名:<select name="customer_id" id="customer_id">
									<option value=''></option>
									<%
										Crm_customer_infoBean crm_customer_infoBean=new Crm_customer_infoBean();
										Crm_customer_infoItem crm_customer_infoItem=new Crm_customer_infoItem();
										crm_customer_infoItem.setRegister_area_nodepath(usersItem.getArea_id());
										List crm_customer_infoList=crm_customer_infoBean.find(crm_customer_infoItem);
										for(int i=0;i<crm_customer_infoList.size();i++){
											crm_customer_infoItem=(Crm_customer_infoItem)crm_customer_infoList.get(i);
											if(ParameterUtils.getString(request,"customer_id").equals(crm_customer_infoItem.getId()))
												out.println("<option value='"+crm_customer_infoItem.getId()+"' selected>"+crm_customer_infoItem.getCustomer_name()+"</option>");
											else
												out.println("<option value='"+crm_customer_infoItem.getId()+"' >"+crm_customer_infoItem.getCustomer_name()+"</option>");
										}
									%>
									</select>
									联系人姓名:<input type="text" size=10 name="contact_name" value="<%=ParameterUtils.getString(request,"contact_name")%>">
									性别:<select name="sex" id="sex">
									<option value=''></option>
									<%
										for(int i=0;i<oa_dictionaryXmlList.size();i++){
											Oa_dictionaryItem oa_dictionaryItem=(Oa_dictionaryItem)oa_dictionaryXmlList.get(i);
											if(oa_dictionaryItem.getNum().equals("17"))
											{
												if(ParameterUtils.getString(request,"sex").equals(oa_dictionaryItem.getCode()))
													out.println("<option value='"+oa_dictionaryItem.getCode()+"' selected>"+oa_dictionaryItem.getCode_name()+"</option>");
												else
													out.println("<option value='"+oa_dictionaryItem.getCode()+"' >"+oa_dictionaryItem.getCode_name()+"</option>");
											}
										}
									%>
									</select>
									登记日期:<input name="register_date" type="text"  size="10"  value="<%=ParameterUtils.getString(request,"register_date")%>"><a href="javascript:" onClick="show_cele_date(register_date,'','',register_date)"><img src='../../icon/cal.gif' border=0></a>
									登记人:<input type="text" size=10 name="register_name" value="<%=ParameterUtils.getString(request,"register_name")%>">
									</td>
								</tr>
								<tr>
									<td  colspan="2" align='center'><input name="Submit" type="button" class="button" value="添加" onClick="javascript:add()">
										<input name="Submit2" type="button" class="button" value="删除" onClick="javascript:removeSelect()">
										<input name="Submit3" type="button" class="button" value="修改" onClick="javascript:edit()">
										<input name="Submit3" type="button" class="button" value="浏览" onClick="javascript:look()">
										<input name="Submit32" type="button" class="button" value="查询" onClick="javascript:query()">
									</td>
								</tr>
								<tr>
									<td colspan="2">
									<%
										out.println("<table  class='contentsTable'   border='0' cellpadding='0'  cellspacing='1'>");
										out.println("<tr class='tr1'  align=center ><td width=5% ></td><td>客户名</td><td>联系人姓名</td><td>性别</td><td>所在部门</td><td>职务</td><td>办公电话</td><td>手机</td><td>电子邮箱</td><td>QQ</td><td>MSN</td><td>skype</td><td>是否主联系人</td><td>登记人</td><td>登记地区</td></tr>");
										Iterator e=list.iterator();
										while(e.hasNext()){
											Crm_customer_contactItem rItem=(Crm_customer_contactItem)e.next();
											out.println("<tr align='center' onMouseOver=\"old_bg=this.getAttribute('bgcolor');this.setAttribute('bgcolor', '"+Constants.T_BGCOLOR_OVER+"', 0);\" onMouseOut=\"this.setAttribute('bgcolor', old_bg, 0);\" bgColor='"+Constants.T_BGCOLOR+"' >");
											out.println("<td><input type='checkbox' name=checkvalue value='"+rItem.getId()+"'></td>");
											out.println("<td>");
											out.println(rItem.getCrm_customer_infoItem().getCustomer_name());
											out.println("</td>");
											out.println("<td>"+rItem.getContact_name()+"</td>");//联系人姓名
											out.println("<td>");
											out.println(rItem.getSex_dictionaryname());//性别
											out.println("</td>");
											out.println("<td>"+rItem.getDepartment()+"</td>");//所在部门
											out.println("<td>"+rItem.getDuty()+"</td>");//职务
											out.println("<td>"+rItem.getOffice_telephone()+"</td>");//办公电话
											out.println("<td>"+rItem.getMobie()+"</td>");//手机
											out.println("<td>"+rItem.getEmail()+"</td>");//电子邮箱
											out.println("<td>"+rItem.getQq()+"</td>");//QQ
											out.println("<td>"+rItem.getMsm()+"</td>");//MSN
											out.println("<td>"+rItem.getSkype()+"</td>");//skype
											out.println("<td>");
											out.println(rItem.getIs_main_dictionaryname());//是否主联系人
											out.println("</td>");
											out.println("<td>"+rItem.getRegister_name()+"</td>");//登记人
											out.println("<td>"+rItem.getRegister_area()+"</td>");//登记地区
											out.println("</tr>");
										}
										out.println("</table>");
									%>
									</td>
								</tr>
								<tr>
									<td>
										<input name="cboAll" type="checkbox" id="cboAll" value="checkbox" onClick="checkBoxAll()"> 全选
									</td>
									<td align="right" class="pagelink" > 共 <%=totalRecord%> 条, 共 <%=page_num%> 页, 第 <%=pageNo%> 页 <a href="javascript:first()">第一页</a> <a href="javascript:next()">下一页</a> <a  href="javascript:pre()">上一页</a> <a  href="javascript:last()" >最后一页</a>
									<select name="position" id="position"  onChange="goposition()">
										<option value=""></option>
										<%
											for(int i=1;i<=page_num;i++)
											{
												out.println("<option ");
												if(pageNo==i){out.println("selected");}
													out.println(" value="+i+">");
												out.println(i);
												out.println("</option>");
											}
										%>
									</select>
									</td>
								</tr>
							</table>
						</td>
					</tr>
					<tr>
						<td></td>
					</tr>
				</table>
			</td>
		</tr>
</table>
	<input type="hidden" name="status" value="">
	<input type="hidden" name="page" value=<%=pageNo%>>
	<input type="hidden" name="totalpage" value=<%=page_num%>>
	<input type="hidden" name="id" value="">
	<input type="hidden" name="ids" value="">
</form>
</body>
</html>
<script language="JavaScript" >
	function checkBoxAll()//全选
	{
		var form = form1;
		for(i=0; i<form.elements.length; i++)
		{
			if(form.elements[i].type=="checkbox" &&  form.elements[i].name=="checkvalue")
			{
				form.elements[i].checked = form.cboAll.checked;
			}
		}
	}

	function edit()
	{
		var form=form1;
		var j=0;
		for(i=0; i<form.elements.length; i++)
		{
			if(form.elements[i].type=="checkbox" &&  form.elements[i].name=="checkvalue")
			{
				if(form.elements[i].checked==true)
				{
					form.id.value=form.elements[i].value;
					j++;
				}
			}
		}
		if(form.id.value=="")
		{
			alert("请选择要修改的一条记录");
			return;
		}
		if(j>1)
		{
			alert("一次只能修改一条记录");
			return;
		}
		location="crm_customer_contactedit.jsp?id="+form.id.value;
	}


	function look()
	{
		var form=form1;
		var j=0;
		for(i=0; i<form.elements.length; i++)
		{
			if(form.elements[i].type=="checkbox" &&  form.elements[i].name=="checkvalue")
			{
				if(form.elements[i].checked==true)
				{
					form.id.value=form.elements[i].value;
					j++;
				}
			}
		}
		if(form.id.value=="")
		{
			alert("请选择要浏览的一条记录");
			return;
		}
		if(j>1)
		{
			alert("一次只能浏览一条记录");
			return;
		}
		location="crm_customer_contactlook.jsp?id="+form.id.value;
	}

	function remove(id)
	{
		if(confirm("是否要删除选择的记录")==true)
		{
			var form=form1;
			form.id.value=id;
			form.status.value="remove";
			form.submit();
		}
	}

	function removeSelect()
	{
		var form=form1;
		for(i=0; i<form.elements.length; i++)
		{
			if(form.elements[i].type=="checkbox" &&  form.elements[i].name=="checkvalue")
			{
				if(form.elements[i].checked==true)
				{
					form.ids.value+=form.elements[i].value+",";
				}
			}
		}
		if(form.ids.value=="")
		{
			alert("请选择要删除的记录");
			return;
		}
		if(confirm("是否要删除选择的记录")==false)
			return;
		form.status.value="removeSelect";
		form.submit();
	}

	function add()
	{
		location="crm_customer_contactadd.jsp";
	}

	function query()
	{
		var form=form1;
		if(form.register_date.value!=""&&!isDateTime(form.register_date.value))
		{
			alert("登记日期只能是短日期,形如 (2003-12-05)!");
			form.register_date.focus();
			return;
		}
		form.submit();
	}

	function first()
	{
		var form=form1;
		if(eval(form.page.value)==1)
			return;
		form.page.value=1;
		form.submit();
	}

	function next()
	{
		var form=form1;
		if(eval(form.page.value)>=eval(form.totalpage.value))
			return;
		form.page.value=eval(form.page.value)+1;
		form.submit();
	}

	function last()
	{
		var form=form1;
		if(eval(form.page.value)>=eval(form.totalpage.value))
			return;
		form.page.value=eval(form.totalpage.value);
		form.submit();
	}

	function pre()
	{
		var form=form1;
		if(form.page.value<=1)
			return;
		form.page.value=eval(form.page.value)-1;
		form.submit();
	}

	function  goposition()
	{
		var form=form1;
		form.page.value=form.position.value;
		form.submit();
	}
</script>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -