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

📄 dev_plan.jsp

📁 J2EE客户关系管理系统!!!!!!!!!!!!!!!!!!!!
💻 JSP
字号:
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>jb-aptech毕业设计项目</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link href="<%=request.getContextPath()%>/css/style.css" rel="stylesheet" type="text/css">
<script type='text/javascript' src='<%=request.getContextPath()%>/js/Date.js'></script>
<script type='text/javascript' src='<%=request.getContextPath()%>/dwr/engine.js'></script>
<script type='text/javascript' src='<%=request.getContextPath()%>/dwr/util.js'></script>
<script type='text/javascript' src='<%=request.getContextPath()%>/dwr/interface/UserService.js'></script>
<script type='text/javascript' src='<%=request.getContextPath()%>/dwr/interface/Pager.js'></script>
<script type='text/javascript' src='<%=request.getContextPath()%>/dwr/interface/SalChanceService.js'></script>
<script type='text/javascript' src='<%=request.getContextPath()%>/dwr/interface/SalPlanService.js'></script>
<script type="text/javascript" src='<%=request.getContextPath()%>/js/sale.js'></script>
<script type="text/javascript" src='<%=request.getContextPath()%>/js/s1.js'></script> 
<script type="text/javascript">
function ss(){
	var id = document.getElementById('id0').value;
		SalChanceService.searchId(id, function(data)
	             							{
	             								//alert(DWRUtil.toDescriptiveString(data,'chcId'));
	             								dwr.util.setValues(data);             								
	                                       	}
                                  );
                                  
        
}

function dd(){
	var id = document.getElementById('id0').value;
	SalPlanService.searchId(id, function(data)
        									{
        										//alert(DWRUtil.toDescriptiveString(data,'chcId'));
        										dwr.util.setValues(data);
        										dwr.util.removeAllRows("tablebody", { filter:function(tr) 
	                                           {
                                                 return (tr.id != "template");
                                               }
                                            }
                               ); 
                 
				 //list.sort( function(p1, p2) { return p1.id > p2.id;} ); //排序
			  	 //alert(DWRUtil.toDescriptiveString(list,'id'));
			  	 for (var i = 0; i < data.length; i++) {
			  	       line = data[i];
			  	       id = line.plaId;
			  	       //复制模板行,并加上后缀比如id变成id0, id1... type变成type0,type1, edit变成 edit0,edit1
			  	       dwr.util.cloneNode("template", { idSuffix:id });
			  	       dwr.util.setValue("plaId"+id, line.plaId);
			  	       dwr.util.setValue("plaDateString2"+id, line.plaDateString2);
			           dwr.util.setValue("plaDateString" + id, line.plaDateString);
			           dwr.util.setValue("plaTodo" + id, line.plaTodo);
			           //dwr.util.setValue("tabbikeName" + id, line.bikeName);
			           $("template" + id).style.display = "block"; //把被复制的行显示打开
			  	    } 
			        									});
}

function insertSalplan(){
	if(if5()){
		var rowobj = {
	     			  salChance:{chcId:$('chcId').innerHTML},
	     			  plaTodo:null
	     			  };
	     			  rowobj.plaTodo=document.getElementById('plaTodoText').value;
	     			  var da = document.getElementById('plaDate').value;
	      			  dwr.util.setValues(rowobj);
	      			  //alert(DWRUtil.toDescriptiveString(rowobj, 'salChance'));
	      			  //新增
	      			  SalPlanService.insertSalplan(rowobj,da, function(data)
	                                       		 {
	                                       		 	if(data ==true){
	                                       			 	alert("新建成功!");
	                                       			 	var idid = document.getElementById('id0').value;
	                                       			 	//window.location.href='dev_plan.jsp?id='+idid;
	                                       			 	window.location.href='dev_plan.jsp?pa='+$('pa0').value+'&id='+idid;
	                                       			 }else{
	                                       			 	alert("新建失败!");
	                                       			 }
	                                       		 }
	      									 );
		}
}

function edit(id){
	var c =	document.getElementById('plaTodo'+id).value
	if(c.length ==0 ){
		alert("计划项的修改不能保存,不能为空!");
		document.getElementById('plaTodo'+id).focus();
	}else{
		var rowobj = {
	     			  salChance:{chcId:$('chcId').innerHTML},
	     			  plaTodo:null
	     			  };
	     			  rowobj.plaId = document.getElementById('plaId'+id).value; 
	     			  rowobj.plaTodo = document.getElementById('plaTodo'+id).value;
	     			  var da = document.getElementById('plaDateString2'+id).value;
	      			  dwr.util.setValues(rowobj);
	      			  //alert(DWRUtil.toDescriptiveString(rowobj, 'plaId'));
	      			  //新增
	      			  SalPlanService.updateSalplan(rowobj,da, function(data)
	                                       		 {
	                                       		 	if(data ==true){
	                                       			 	alert("保存成功!");
	                                       			 	var idid = document.getElementById('id0').value;
	                                       			 	//window.location.href='dev_plan.jsp?id='+idid;
	                                       			 	window.location.href='dev_plan.jsp?pa='+$('pa0').value+'&id='+idid;
	                                       			 }else{
	                                       			 	alert("保存失败!");
	                                       			 }
	                                       		 }
	      									 );
	  }
}

function delte(id){				//删除
             	if (window.confirm("确认删除?")){
             			SalPlanService.deleteSalPlan(id, function(data)
	             												{
	             														dwr.engine.beginBatch();
	                                       			 					alert(data);
																	    dwr.engine.endBatch();
																	    var idid = document.getElementById('id0').value;
                                       			 						//window.location.href='dev_plan.jsp?id='+idid;
                                       			 						window.location.href='dev_plan.jsp?pa='+$('pa0').value+'&id='+idid;
	                                       		 				}
                                       		 			)
            		 }
             }

function devexecute(){
	if($('status').value == '2'){
		var id = document.getElementById('id0').value;
		//window.location.href='dev_execute.jsp?id='+id;
		//window.location.href='dev_execute.jsp?pa='+tab1.pageno+'&id='+id;
		window.location.href='dev_execute.jsp?pa='+$('pa0').value+'&id='+id;
	}else{
		alert('对不起,您没有这个权限!');
	}
}

function retu(){
	//window.location.href='dev.jsp';
	window.location.href='dev.jsp?pa='+$('pa0').value;
}
</script>
</head>
<body onload="ss();dd()">
<input type="hidden" value="${param.id}" id="id0"/>
<input type="hidden" value="${param.pa}" id="pa0"/>
<input type="hidden" id="status" value="${sessionScope.usrFlagIndex}">
<div class="page_title">客户开发计划 &gt; 制定计划</div>
<div class="button_bar">
	<button class="common_button" onclick="helpq2();">帮助</button>
	<button class="common_button" onclick="devexecute()">执行计划</button>
	<button class="common_button" onclick="retu()">返回</button>
</div>
<table class="query_form_table">
	<tr>
		<th>编号</th>
		<td><span id="chcId" /></td>
		<th>机会来源</th>
		<td><span id="chcSource" /></td>
	</tr>
	<tr>
		<th>客户名称</th>
		<td><span id="chcCustName" /></td>
		<th>成功机率(%)</th>
		<td>&nbsp;<span id="chcRate" /></td>
	</tr>	
	<tr>
		<th>概要</th>
		<td colspan="3"><span id="chcTitle" /></td>
	</tr>
	<tr>
		<th>联系人</th>
		<td><span id="chcLinkman" /></td>
		<th>联系人电话</th>
		<td><span id="chcTel" /></td>
	</tr>
	<tr>
		<th>机会描述</th>
		<td colspan="3"><span id="chcDesc" /></td>
	</tr>
	<tr>
		<th>创建人</th>
		<td><span id="chcCreateBy" /></td>
		<th>创建时间</th>
		<td><span id="chcCreateStringString" /></td>
		<input type="hidden" id="chcCreateString"/>
	</tr>
	<tr>
		<th>指派给</th>
		<td><span id="chcDueTo" /></td>
		<th>指派时间</th>
		<td><span id="chcDueDateStringString" /></td>
		<input type="hidden" id="chcDueDateString"/>
	</tr>
</table>
<br />

<table class="data_list_table" id="table1">
	<tr>
		<th width="150px">日期</th>
		<th height="31">计划项</th>
	</tr>

	<tbody id="tablebody">
	      <!-- 模板行 -->
	      <tr id="template" style="display:none">
	      	 <input type="hidden" id="plaId"/>
	      	 <input type="hidden" id="plaDateString2"/>
	         <td class="list_data_text" height="24"><span id="plaDateString" /></td>
	         <td class="list_data_ltext" height="24"><input size="50" id="plaTodo"/>
	         <button class="common_button" onclick="edit(this.id.substring(4))" id="edit">保存</button>
			 <button class="common_button" onclick="delte(this.id.substring(5))" id="delte">删除</button>
			 </td>
	   	  </tr>
     </tbody>
</table>
<div class="button_bar">
	<button class="common_button" onclick="insertSalplan()">保存</button>
	</div>
<table class="query_form_table" id="table2">
	<tr>
		<th>日期</th>
	    <td><input id="plaDate" type="text" onclick="setday(this)" name="plaDate" /><span class="red_star">*</span></td>
		<th>计划项</th>
		<td>
			<input size="50" id="plaTodoText" /><span class="red_star">*</span>
		</td>
	</tr>
</table>
</body>
</html>

⌨️ 快捷键说明

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