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

📄 rule_edit.jsp

📁 自己制作的联通CRM,支持客户分类,管理,升级,积分管理等等..
💻 JSP
字号:
<%@ page language="java" pageEncoding="GBK"%>

<%@ taglib uri="http://struts.apache.org/tags-bean" prefix="bean" %>
<%@ taglib uri="http://struts.apache.org/tags-html" prefix="html" %>
<%@ taglib uri="http://struts.apache.org/tags-logic" prefix="logic" %>
<%@ taglib uri="http://struts.apache.org/tags-tiles" prefix="tiles" %>



<html:html lang="true">
  <head>
  
    <title>分级规则编辑</title>
	
	<link rel="stylesheet" type="text/css" 
		href="${pageContext.request.contextPath}/image/main.css">
	
	<script language="javascript" 
		src="${pageContext.request.contextPath}/js/calendar.js">
	</script>
	
	<script type="text/javascript">
		
	   
		function mycheck(){
			
			
			//规则编码
			var code = document.form1.rulecode.value.replace(/\s/g,"");
			if(code.length==0){
				alert("规则编码不能为空");
				document.form1.rulecode.focus();
				return false;
			}
			
			//规则名称
			var rulename = document.form1.rulename.value.replace(/\s/g,"");
			if(rulename.length==0){
				alert("规则名称不能为空");
				document.form1.rulename.focus();
				return false;
			}
			
			//验证取值范围
			
			var num_one = document.form1.numone.value.replace(/\s/g,"");
			var numone = num_one.replace(/[0-9]/g,"");
			if(numone.length>0){
				alert("请输入数字");
				document.form1.numone.focus();
				return false;
				
			}
			
			var num_two = document.form1.numtwo.value.replace(/\s/g,"");
			var numtwo = num_two.replace(/[0-9]/g,"");
			if(numtwo.length>0){
				alert("请输入数字");
				document.form1.numtwo.focus();
				return false;
				
			}
			
			var num_three = document.form1.numthree.value.replace(/\s/g,"");
			var numthree = num_three.replace(/[0-9]/g,"");
			if(numthree.length>0){
				alert("请输入数字");
				document.form1.numthree.focus();
				return false;
				
			}
			
			var num_four = document.form1.numfour.value.replace(/\s/g,"");
			var numfour = num_four.replace(/[0-9]/g,"");
			if(numfour.length>0){
				alert("请输入数字");
				document.form1.numfour.focus();
				return false;
				
			}
			
			
			var countgene = document.form1.countgene.value;
			if(countgene == '消费积分'){
				
				if(num_one==""){
					alert("请输入符合条件的消费积分的最小值");
					document.form1.numone.focus();
					return false;
					
				}
				
				if(parseInt(num_one,10)>parseInt(num_two,10)){
					alert("范围不对,请检验你输入的数值");
					document.form1.numone.focus();
					return false;
				}
					
			}else{
			
				if(num_one==""){
					alert("请输入符合条件的话费的最小值");
					document.form1.numone.focus();
					return false;
					
				}
			
				
				if(num_three==""){
					alert("请输入符合条件的ARPU的最小值");
					document.form1.numthree.focus();
					return false;
					
				}
			
				if(parseInt(num_three,10)>parseInt(num_four,10)){
					alert("范围不对,请检验你输入的数值");
					document.form1.numthree.focus();
					return false;
				}
			}
			
			//规则有效期
			
			var ruletime = document.form1.ruletime.value.replace(/\s/g,"");
			
			//获取所选时间
			if(ruletime.length==0){
				alert("规则有效期不能为空");
				document.form1.ruletime.focus();
				return false;
			}
			
			//获取系统时间
			var mydate = new Date();
			var sys_year = mydate.getFullYear();
			var sys_month = mydate.getMonth()+1;
			var sys_date = mydate.getDate();
			
			if(sys_month<10)
				sys_month = "0" + sys_month;
			
			if(sys_date<10)
				sys_date = "0" + sys_date;
				
			var str = sys_year+"-"+sys_month+"-"+sys_date;
			
			if(str>ruletime){
				alert("规则有效期不能小于当前日期("+str+")");
				document.form1.ruletime.focus();
				return false;
			
			}
			return true;
		
		}
		
		//改变计算因子
		function mychange(){
			
			var str = document.form1.countgene.value;
			if(str == '消费积分'){
				document.getElementById("arpu").style.display = "none";
				document.getElementById("txt1").innerHTML = "积分大于";
				document.getElementById("txt2").innerHTML = "积分小于";
				document.form1.numone.value = "";
				document.form1.numtwo.value = "";
				document.form1.numthree.value = "";
				document.form1.numfour.value = "";
			}else{
				document.getElementById("arpu").style.display = "block";
				document.getElementById("txt1").innerHTML = "话费大于";
				document.getElementById("txt2").innerHTML = "话费小于";
				document.getElementById("txt3").innerHTML = "ARPU大于";
				document.getElementById("txt4").innerHTML = "ARPU小于";
				document.form1.numone.value = "";
				document.form1.numtwo.value = "";
				document.form1.numthree.value = "";
				document.form1.numfour.value = "";
			}
			
		}
		
		
	</script> 
		
  </head>
  
  <body>
  	<logic:equal value="add" property="tag" name="ruleManageForm">
  		<center><span style="font-size: 14px;font-weight: bold">添加分级规则</span></center>
  	</logic:equal>
  	
  	<logic:equal value="update" property="tag" name="ruleManageForm">
  		<center><span style="font-size: 14px;font-weight: bold">修改分级规则</span></center>
  	</logic:equal>
  
  	<br>
  	
    <table width="80%" border="1" align="center" cellpadding="0" cellspacing="0" bordercolor="#D71920">
        <tr align="center" valign="middle"><td><br>
        <html:form action="/ruleManage" styleId="form1" onsubmit="return mycheck();">
			  <table width="95%" border="1" align="center" cellpadding="0" cellspacing="0" id="ttc">
				  <tr height="30">
				    <td width="30%" align="center" id="ttc">规 则 编 码</td>
				    <td width="70%" id="ttc">
				    	&nbsp;&nbsp;&nbsp;
				    	<html:text property="rulecode"></html:text>
				    </td>
				  </tr>
				  <tr height="30">
				    <td align="center" id="ttc">规 则 名 称</td>
				    <td id="ttc">
				    	&nbsp;&nbsp;&nbsp;
				    	<html:text property="rulename" size="30"></html:text>
				    </td>
				  </tr>
				  <tr height="30">
				    <td align="center" id="ttc">规 则 品 牌</td>
				    <td id="ttc">
				    	&nbsp;&nbsp;&nbsp;
				    	<html:select property="rulebrand">
				    		<html:optionsCollection name="brandlist"  label="sname" value="sname" />
				    	</html:select>
				    </td>
				  </tr>
				  
				  <tr height="30">
				    <td align="center" id="ttc">计 算 因 子</td>
				    <td id="ttc">
				    &nbsp;&nbsp;&nbsp;
				    <html:select property="countgene" onchange="mychange();">
				    		<html:option value="消费积分"></html:option>
				    		<html:option value="话费和ARPU"></html:option>
				    	</html:select>
				    </td>
				  </tr>
				  
				  <tr height="30">
				    <td align="center" id="ttc">取 值 范 围</td>
				    <td id="ttc">
				    	
				    	&nbsp;&nbsp;&nbsp;
				    	<!-- 添加 --> 
						<logic:empty property="countgene" name="ruleManageForm">
				    		<span id="txt1">积分大于</span>
				    		<html:text property="numone" size="10"></html:text>
				    		&nbsp;&nbsp;&nbsp;
				    		<span id="txt2">积分小于</span>
				    		<html:text property="numtwo" size="10"></html:text>
				    		
				    		<div style="display: none" id="arpu">
				    		&nbsp;&nbsp;&nbsp;
				    		<span id="txt3">ARPU大于</span>
				    		<html:text property="numthree" size="10" ></html:text>
				    		&nbsp;&nbsp;&nbsp;
				    		<span id="txt4">ARPU小于</span>
				    		<html:text property="numfour" size="10"></html:text>
				    		</div>
				    	
				    	</logic:empty>
				    	
				    	<!-- 修改 初始因子为消费积分--> 
				    	
				    	<logic:equal value="消费积分" property="countgene" name="ruleManageForm">
				    		<span id="txt1">积分大于</span>
				    		<html:text property="numone" size="10"></html:text>
				    		&nbsp;&nbsp;&nbsp;
				    		<span id="txt2">积分小于</span>
				    		<logic:equal value="0" property="numtwo" name="ruleManageForm">
				    			<html:text property="numtwo" size="10" value=""></html:text>
				    		</logic:equal>
				    		<logic:notEqual value="0"  property="numtwo" name="ruleManageForm">
				    			<html:text property="numtwo" size="10"></html:text>
				    		</logic:notEqual>
				    		
				    		<div style="display: none" id="arpu">
				    		&nbsp;&nbsp;&nbsp;
				    		<span id="txt3">ARPU大于</span>
				    		<html:text property="numthree" size="10" ></html:text>
				    		&nbsp;&nbsp;&nbsp;
				    		<span id="txt4">ARPU小于</span>
				    		<html:text property="numfour" size="10"></html:text>
				    		</div>
				    		
				    	</logic:equal>
				    	
				    	
				    	
				    	<!-- 修改 初始因子为话费和ARPU-->
				    	 
				    	<logic:equal value="话费和ARPU" property="countgene" name="ruleManageForm">
				    		<span id="txt1">话费大于</span>
				    		<html:text property="numone" size="10"></html:text>
				    		&nbsp;&nbsp;&nbsp;
				    		<span id="txt2">话费小于</span>
				    		<logic:equal value="0" property="numtwo" name="ruleManageForm">
				    			<html:text property="numtwo" size="10" value=""></html:text>
				    		</logic:equal>
				    		<logic:notEqual value="0"  property="numtwo" name="ruleManageForm">
				    			<html:text property="numtwo" size="10"></html:text>
				    		</logic:notEqual>
			
				    		
				    		<div style="display: block" id="arpu">
				    		&nbsp;&nbsp;&nbsp;
				    		<span id="txt3">ARPU大于</span>
				    		<html:text property="numthree" size="10"></html:text>
				    		&nbsp;&nbsp;&nbsp;
				    		<span id="txt4">ARPU小于</span>
				    		<logic:equal value="0" property="numfour" name="ruleManageForm">
				    			<html:text property="numfour" size="10" value=""></html:text>
				    		</logic:equal>
				    		<logic:notEqual value="0"  property="numfour" name="ruleManageForm">
				    			<html:text property="numfour" size="10"></html:text>
				    		</logic:notEqual>
				    		</div>
				    	</logic:equal>
				    	
				    </td>
				  </tr>
				  
				  <tr height="30">
				    <td align="center" id="ttc">卡 类 型</td>
				    <td id="ttc">
				    	&nbsp;&nbsp;&nbsp;
				    	<html:select property="cardtype">
				    		<html:optionsCollection name="cardlist" label="sname"  value="sname"/>
				    	</html:select>
				    </td>
				  </tr>
				  
				  <tr>
				    <td align="center" id="ttc">规 则 描 述</td>
				    <td id="ttc">&nbsp;&nbsp;&nbsp;
				    	<html:textarea property="ruledesc" rows="3" cols="45"></html:textarea>
				    
				    </td>
				  </tr>
				  
				  <tr height="30">
				    <td align="center" id="ttc">规 则 有 效 期</td>
				    <td id="ttc">
				    	&nbsp;&nbsp;&nbsp;
				    	<html:text property="ruletime" onclick="show_cele_date(this,'','',this);" readonly="true"></html:text>
				    	&nbsp;&nbsp;&nbsp;<span id="aa"></span>
				    </td>
				  </tr>
				  <tr height="30">
				    <td align="center" id="ttc" colspan="2">
				    
				    <logic:equal value="add" property="tag" name="ruleManageForm">
				    	<input type="hidden" value="addRule" name="tag"/>
				    	<input type="submit" value="添加"/>
				    	 &nbsp;&nbsp;&nbsp;
				    	<input type="reset" value="取消"/>
				    </logic:equal>
				    
				    <logic:equal value="update" property="tag" name="ruleManageForm">
				    	<input type="hidden" value="updateRule" name="tag" />
				    	<html:hidden property="nid"/>
				    	<html:hidden property="checksign"/>
				    	<html:hidden property="freezesign"/>
				    	
				    	<input type="hidden" name="search_rulebrand" value="${requestScope.map.search_rulebrand}">
				    	<input type="hidden" name="currentpage" value="${requestScope.map.currentpage}">
				    	<input type="hidden" name="search_rulename" value="${requestScope.map.search_rulename}">
				    	
				    	<input type="submit" value="修改" />
				    	&nbsp;&nbsp;&nbsp;
				    	<input type="reset" value="重置"/>
				    </logic:equal>
				    </td>
				  </tr>
		  </table>
        </html:form>
        </td></tr>
    </table>
    <br>
    <center>
    <a href="${pageContext.request.contextPath}/ruleManage.do?tag=showRule&currentpage=${requestScope.map.currentpage}&rulebrand=${requestScope.map.search_rulebrand}&rulename=${requestScope.map.search_rulename}">
    返回分级规则管理</a></center>
  </body>
</html:html>

⌨️ 快捷键说明

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