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

📄 crm_project_infoadd.jsp

📁 java开发的办公系统 1.系统管理 (地区管理,部门管理,菜单管理,用户管理,角色管理,权限) 2.工作流管理 (流程类别,流程) 3.字典管理 (国家,省份,城市,公共数据字典) 4.项目
💻 JSP
📖 第 1 页 / 共 2 页
字号:
<%@ 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 import="com.vere.crm.project.bean.*"%>
<%@ page import="com.vere.crm.project.item.*"%>
<%@ page contentType="text/html; charset=gb2312" %>
<%
	
	ParameterUtils.setCharacterEncoding(request);
	SessionFactory sessionFactory=(SessionFactory)session.getAttribute("sessionFactory");
	String status=ParameterUtils.getString(request,"status");
	String message="";
	//添加
	if(status.equals("add"))
	{
		String pathState=Configuration.getInstance().xmlUpload+"/crm_project_info/workflow_xml/workflow_state.xml";
   		String pathLine=Configuration.getInstance().xmlUpload+"/crm_project_info/workflow_xml/workflow_line.xml";

		//工作流
		String workflow_id="13";
	  //取得工作流的状态list
	  Workflow_stateXmlBean stateBean =new Workflow_stateXmlBean(pathState);
	  List stateList=stateBean.findByWorkflow_id(workflow_id);
	  //取得开始状态
	  Workflow_stateItem start_stateItem=new Workflow_stateItem();
	  for(int i=0;i<stateList.size();i++)
	  {
	  	Workflow_stateItem stateItem=(Workflow_stateItem)stateList.get(i);
		if(stateItem.getState_type().equals("0"))
			start_stateItem=stateItem;
	  }
	  
	  
		message="1";
		String project_name=ParameterUtils.getString(request,"project_name");//项目名称
		String customer_id=ParameterUtils.getString(request,"customer_id");//客户名称
		String customer_contact_id=ParameterUtils.getString(request,"customer_contact_id");//客户联系人
		String project_rake=ParameterUtils.getString(request,"project_rake");//项目等级
		String develop_language=ParameterUtils.getString(request,"develop_language");//开发语言
		String develop_database=ParameterUtils.getString(request,"develop_database");//开发数据库
		String project_language=ParameterUtils.getString(request,"project_language");//项目语种
		String refer_website=ParameterUtils.getString(request,"refer_website");//参考网址
		String project_price=ParameterUtils.getString(request,"project_price");//项目金额
		String project_type=ParameterUtils.getString(request,"project_type");//项目类型
		String project_origin=ParameterUtils.getString(request,"project_origin");//项目来源
		String project_business=ParameterUtils.getString(request,"project_business");//所属行业
		String country_id=ParameterUtils.getString(request,"country_id");//国家
		String province_id=ParameterUtils.getString(request,"province_id");//省份/地区
		String city_id=ParameterUtils.getString(request,"city_id");//城市
		String project_introduction=ParameterUtils.getString(request,"project_introduction");//项目要求
		String related_doc=ParameterUtils.getString(request,"related_doc");//相关文档
		String project_status="1";//项目状态
		String register_date=DateUtils.getDateTime();//登记日期
		String register_username=sessionFactory.getManager_usersItem().getUsername();//登记用户
		String register_name=sessionFactory.getManager_usersItem().getName();//登记人
		String register_department_id=sessionFactory.getManager_usersItem().getDepartment_id();//登记部门编号
		String register_department_nodepath=sessionFactory.getManager_usersItem().getDepartment_nodepath();//登记部门路径
		String register_department=sessionFactory.getManager_usersItem().getManager_departmentItem().getName();//登记部门
		String register_area_id=sessionFactory.getManager_usersItem().getArea_id();//登记地区编号
		String register_area_nodepath=sessionFactory.getManager_usersItem().getArea_nodepath();//登记地区路径
		String register_area=sessionFactory.getManager_usersItem().getManager_areaItem().getName();//登记地区
		String appraisal_result="1";//审批结果

		//工作流
		String workflow_state_id=start_stateItem.getId();
	  if(workflow_state_id.equals("")) workflow_state_id="0";
      String workflow_state_name=start_stateItem.getName();
      String approval_type=start_stateItem.getApproval_type();
	   if(approval_type.equals("")) approval_type="0";
      String appraisal_method=start_stateItem.getAppraisal_method();
	  if(appraisal_method.equals("")) appraisal_method="0";
      String approval_user=start_stateItem.getApproval_user();
      String approval_name=start_stateItem.getApproval_name();
      String approval_departmentid=start_stateItem.getApproval_departmentid();
	  if(approval_departmentid.equals("")) approval_departmentid="0";
      String approval_department=start_stateItem.getApproval_department();
      String receive_user=start_stateItem.getReceive_user();
      String receive_name=start_stateItem.getReceive_name();
	  String func_id=start_stateItem.getFunc_id();
	  String state_type=start_stateItem.getState_type();
		if(customer_id==null||customer_id.equals("")){
			out.print("customer_id 客户名称不能为空");
			return;
		}
		if(customer_contact_id==null||customer_contact_id.equals("")){
			out.print("customer_contact_id 客户联系人不能为空");
			return;
		}
		if(project_rake==null||project_rake.equals("")){
			out.print("project_rake 项目等级不能为空");
			return;
		}
		
		if(project_price==null||!Check.isFloat(project_price)){
			out.print("project_price 项目金额必须为浮点数字");
			return;
		}
		Crm_project_infoItem item=new Crm_project_infoItem();
		item.setProject_name(project_name);
		item.setCustomer_id(customer_id);
		item.setCustomer_contact_id(customer_contact_id);
		item.setProject_rake(project_rake);
		item.setDevelop_language(develop_language);
		item.setDevelop_database(develop_database);
		item.setProject_language(project_language);
		item.setRefer_website(refer_website);
		item.setProject_price(project_price);
		item.setProject_type(project_type);
		item.setProject_origin(project_origin);
		item.setProject_business(project_business);
		item.setCountry_id(country_id);
		item.setProvince_id(province_id);
		item.setCity_id(city_id);
		item.setProject_introduction(project_introduction);
		item.setRelated_doc(related_doc);
		item.setProject_status(project_status);
		item.setRegister_date(register_date);
		item.setRegister_username(register_username);
		item.setRegister_name(register_name);
		item.setRegister_department_id(register_department_id);
		item.setRegister_department_nodepath(register_department_nodepath);
		item.setRegister_department(register_department);
		item.setRegister_area_id(register_area_id);
		item.setRegister_area_nodepath(register_area_nodepath);
		item.setRegister_area(register_area);
		item.setAppraisal_result(appraisal_result);
		item.setWorkflow_id(workflow_id);
		item.setWorkflow_state_id(workflow_state_id);
		item.setWorkflow_state_name(workflow_state_name);
		item.setApproval_type(approval_type);
		item.setAppraisal_method(appraisal_method);
		item.setApproval_user(approval_user);
		item.setApproval_name(approval_name);
		item.setApproval_departmentid(approval_departmentid);
		item.setApproval_department(approval_department);
		item.setReceive_user(receive_user);
		item.setReceive_name(receive_name);
		item.setFunc_id(func_id);
		item.setState_type(state_type);
		Crm_project_infoBean bean=new Crm_project_infoBean();
		 int keyId=bean.addItemAndMaxId(item);
		 if(keyId>0)
	    {
			
			message="1";
		}
	}
      Oa_dictionaryXmlBean oa_dictionaryXmlBean=new Oa_dictionaryXmlBean();
      List oa_dictionaryXmlList=oa_dictionaryXmlBean.findXmlByArray("19,20,21,22,15,16,23,27");
%>
<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>
<script language="javascript">
	function back()
	{
		location="crm_project_info.jsp";
	}

	function Check()
	{
		var form=form1;
		if(form.customer_id.value=="")
		{
			alert("请输入客户名称!");
			form.customer_id.focus();
			return;
		}
		if(form.customer_contact_id.value=="")
		{
			alert("请输入客户联系人!");
			form.customer_contact_id.focus();
			return;
		}
		if(form.project_rake.value=="")
		{
			alert("请输入项目等级!");
			form.project_rake.focus();
			return;
		}
		
		if(!isFloat(form.project_price.value))
		{
			alert("项目金额必须为浮点数字!");
			form.project_price.focus();
			return;
		}
		if(form.country_id.value=="")
		{
			alert("请选择国家!");
			form.country_id.focus();
			return;
		}
		if(form.province_id.value=="")
		{
			alert("请选择省份!");
			form.province_id.focus();
			return;
		}
		if(form.city_id.value=="")
		{
			alert("请选择城市!");
			form.city_id.focus();
			return;
		}
		form.status.value="add";
		form.submit();
	}
</script>
<body>
<form action=""  method="post"  name="form1" >
	<table class="firsttable">
		<tr>
			<td align="center" valign="top">
				<table class="centertable">
					<tr>
						<td></td>
					</tr>
					<tr>
						<td align="center" class="addborder">
							<table  class="addTable">
								<tr align="center" >
									<td colspan="2">
                  						<font  class="message">
										<%
											if(message.equals("1"))
											{
												out.println("您的项目添加成功:继续");
											}
										%>
										</font>									</td>
								</tr>
								
								<tr >
									<td >项目名称:</td>
									<td ><input name="project_name" type="text" id="project_name"  value="" ></td>
								</tr>
								<tr >
									<td >客户名称:</td>
								  <td ><input readonly="true" name="customer_name" type="text" id="customer_name">
								  <input  style="display:none;" name="customer_id" type="text" id="customer_id">
								  </td>
								</tr>
								<tr >
									<td >客户联系人:</td>
								  <td >
									<input   readonly="true" name="customer_contact_name" type="text" id="customer_contact_name">
									<input  style="display:none;" name="customer_contact_id" type="text" id="customer_contact_id">
									
									<input  type="button" class="button" onClick="selectContact()" value="选择">
									<script language='javascript'>
									function selectContact()
									{
										var url="../crm_customer/select_customer_contact.jsp?field_customer_id=customer_id&field_customer_name=customer_name&field_contact_id=customer_contact_id&field_contact_name=customer_contact_name";
										open(url,'win','scrollbars=no,width=500,height=600,resizable=no,left=200,top=100,resizable=false');
									}
									</script>
									</td>
								</tr>
								<tr >
									<td >项目等级:</td>
									<td >
									
									<%
										String  project_rake="0";
										if(!ParameterUtils.getString(request,"project_rake").equals(""))
											project_rake=ParameterUtils.getString(request,"project_rake");
										for(int i=0;i<oa_dictionaryXmlList.size();i++){
											Oa_dictionaryItem oa_dictionaryItem=(Oa_dictionaryItem)oa_dictionaryXmlList.get(i);
											if(oa_dictionaryItem.getNum().equals("19"))
											{
												if(project_rake.equals("0")||project_rake.equals(oa_dictionaryItem.getCode()))
													out.println("<input type='radio' name='project_rake' value='"+oa_dictionaryItem.getCode()+"' checked>"+oa_dictionaryItem.getCode_name());
												else
													out.println("<input type='radio' name='project_rake' value='"+oa_dictionaryItem.getCode()+"' >"+oa_dictionaryItem.getCode_name());
											}
										}
									%>
																	</td>
								</tr>
								<tr >
									<td >开发语言:</td>
									<td >
									<%
										String  develop_language="0";
										if(!ParameterUtils.getString(request,"develop_language").equals(""))
											develop_language=ParameterUtils.getString(request,"develop_language");
										for(int i=0;i<oa_dictionaryXmlList.size();i++){
											Oa_dictionaryItem oa_dictionaryItem=(Oa_dictionaryItem)oa_dictionaryXmlList.get(i);
											if(oa_dictionaryItem.getNum().equals("20"))

⌨️ 快捷键说明

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