<%@ page language="java" contentType="text/html;charset=gb2312"%>
<%@ taglib uri="/tags/struts-html" prefix="html" %>
<%@ taglib uri="/tags/struts-logic" prefix="logic" %>
<%@ taglib uri="/tags/struts-bean" prefix="bean" %>
<%@ taglib uri="/tags/mytaglib-pager" prefix="p" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>营销活动管理---新增活动解释内容</title>
<link href="<%=request.getContextPath()%>/css/css.css" rel="stylesheet" type="text/css">
<link href="<%=request.getContextPath()%>/calendar/calendar-blue.css" rel="stylesheet" type="text/css">
<script type="text/javascript" src="<%=request.getContextPath()%>/calendar/calendar.js"></script>
<script type="text/javascript" src="<%=request.getContextPath()%>/calendar/lang/calendar-zh.js"></script>
<script type="text/javascript" src="<%=request.getContextPath()%>/calendar/calendar-setup.js"></script>
</head>
<Script language="javascript" src="<%=request.getContextPath()%>/js/common.js"></Script>
<Script language="javascript" src="<%=request.getContextPath()%>/dwr/engine.js"></Script>
<Script language="javascript" src="<%=request.getContextPath()%>/dwr/util.js"></Script>
<Script language="javascript" src="<%=request.getContextPath()%>/dwr/interface/activityHelperDao.js"></Script>
<Script language="javascript">
<!--
//通过DWR来实现Ajax功能。
function loadSpBusiness(trader){
DWRUtil.removeAllOptions("spBusinessId");
if (trader.value=="")
return;
activityHelperDao.getSpBusiness(trader.value,fillSpBusiness);
}
function fillSpBusiness(result){
DWRUtil.addOptions("spBusinessId",result,"id","businessName");
}
function checkIfExists(activityId,groupId){
if (activityId.value == null || activityId.value == ""
|| groupId.value == null || groupId.value == "")
return;
activityHelperDao.checkAccountExists(activityId.value,groupId.value,showMsg);
}
function showMsg(result){
var spanText = $("checkResult");
if(result){
spanText.innerHTML = "<font color='red'>活动编号已经存在!请重新输入。</font>";
}else{
spanText.innerHTML = "";
}
}
function checkBatchNo(batchNo){
if (batchNo.value != null && batchNo.value!=""){
activityHelperDao.checkBatchNoAdd(batchNo.value,showBatchNoMsg);
}
}
function showBatchNoMsg(result){
var spanText = $("checkBatchNoResult");
if(result){
spanText.innerHTML = "<font color='red'>批次号已经存在!请重新输入。</font>";
}else{
spanText.innerHTML = "";
}
}
//-->
</Script>
<Script language="javascript">
<!--
function addActivityInfo(){
if(document.form1.activityId.value == ""){
alert("请输入活动编号!");
document.form1.activityId.focus();
return false;
}
if(!isId(document.form1.activityId.value)){
alert("活动编号只能为英文字母或数字!");
document.form1.activityId.focus();
return false;
}
if(document.form1.activityName.value == "" || getStrLen(document.form1.activityName.value) > 40){
alert("请按要求输入活动名称!");
document.form1.activityName.focus();
return false;
}
if(document.form1.markAmount.value == ""){
alert("请输入条码额度!");
document.form1.markAmount.focus();
return false;
}
if(!isMoney(document.form1.markAmount.value)){
alert("条码额度格式不正确,整数位是〔1-5〕位并小数点数只能两位!");
document.form1.markAmount.focus();
return false;
}
if(document.form1.printTitle.value == ""){
alert("请输入打印标题!");
document.form1.printTitle.focus();
return false;
}
if(document.form1.purposeCode.value == ""){
alert("请输入用途代码!");
document.form1.purposeCode.focus();
return false;
}
if(!isId(document.form1.purposeCode.value) || getStrLen(document.form1.purposeCode.value) > 1){
alert("用途代码必须为数字或英文!");
document.form1.purposeCode.focus();
return false;
}
if(document.form1.purposeDesc.value == "" || getStrLen(document.form1.purposeDesc.value) > 40){
alert("请按要求输入用途说明!");
document.form1.purposeDesc.focus();
return false;
}
if(document.form1.sendSpId.value == ""){
alert("请办条码发送SP标识!");
document.form1.sendSpId.focus();
return false;
}
if(!isId(document.form1.sendSpId.value)){
alert("验证条码发送SP标识必须为英文或数字!");
document.form1.sendSpId.focus();
return false;
}
if(document.form1.batchNo.value == "" || getStrLen(document.form1.batchNo.value) > 11){
alert("请按要求输入批次号!");
document.form1.batchNo.focus();
return false;
}
if(!isId(document.form1.batchNo.value)){
alert("批次号必须为英文或数字!");
document.form1.batchNo.focus();
return false;
}
if(document.form1.sendBussinessCode.value == ""){
alert("请条码发送业务代码!");
document.form1.sendBussinessCode.focus();
return false;
}
if(!isId(document.form1.sendBussinessCode.value)){
alert("条码发送业务代码必须为英文或数字!");
document.form1.sendBussinessCode.focus();
return false;
}
if(document.form1.startDate.value == ""){
alert("请输入有效期-起始!");
document.form1.startDate.focus();
return false;
}
if(document.form1.sendLocationId.value == ""){
alert("请输入发送场地标识!");
document.form1.sendLocationId.focus();
return false;
}
if(!isId(document.form1.sendLocationId.value)){
alert("发送场地标识必须为英文或数字!");
document.form1.sendLocationId.focus();
return false;
}
if(document.form1.endDate.value == ""){
alert("请输入有效期-结束!");
document.form1.endDate.focus();
return false;
}
if(document.form1.verifyStartTime.value == ""){
alert("请输入验证开始时间!");
document.form1.verifyStartTime.focus();
return false;
}
if(document.form1.verifyEndTime.value == ""){
alert("请输入验证结束时间!");
document.form1.verifyEndTime.focus();
return false;
}
//len
if (getStrLen(document.form1.printTitle.value)>12){
alert("打印标题不能超过6个汉字!");
document.form1.printTitle.focus();
return false;
}
if (getStrLen(document.form1.printText.value)>200){
alert("打印文本不能超过100个汉字!");
document.form1.printText.focus();
return false;
}
if (document.form1.infoTitle.value == "" || getStrLen(document.form1.infoTitle.value)>20){
alert("彩信标题不能为空并且不能超过10个汉字!");
document.form1.infoTitle.focus();
return false;
}
if (getStrLen(document.form1.notesMms.value)>1024){
alert("彩信内容最长不能超过500个汉字!");
document.form1.notesMms.focus();
return false;
}
if (getStrLen(document.form1.notesSms.value)>100){
alert("短信内容最长不能超过50个汉字!");
document.form1.notesSms.focus();
return false;
}
if (getStrLen(document.form1.sendBussinessCode.value)>12){
alert("条码发送业务代码不能大于12位数字!");
document.form1.sendBussinessCode.focus();
return false;
}
if (getStrLen(document.form1.sendSpId.value)>8){
alert("条码发送SP标识不能大于8位数字!");
document.form1.sendSpId.focus();
return false;
}
if (getStrLen(document.form1.sendLocationId.value)>12){
alert("条码发送场地标识不能大于12位数字!");
document.form1.sendLocationId.focus();
return false;
}
if (getStrLen(document.form1.memo.value)>200){
alert("备注不超过100个汉字!");
document.form1.memo.focus();
return false;
}
activityHelperDao.checkAccountExists(document.form1.activityId.value,document.form1.groupId.value,checkBathNoAdd);
}
function checkBathNoAdd(result){
if(result){
alert("活动编号已经存在!请重新输入。");
}else{
activityHelperDao.checkBatchNoAdd(document.form1.batchNo.value,getNextValidate);
}
}
function getNextValidate(result){
if(result){
alert("批次号已经存在!请重新输入。");
}else{
document.form1.submit();
//activityHelperDao.checkBussinessExist(document.form1.spBusinessId.value,submitData);
}
}
function submitData(result){
if (result){
var ans;
ans=window.confirm("业务编号存在另外的活动,系统将另外的活动锁定,请确认。点击“否”退出放弃增加。");
if (ans){
//set tag value
document.form1.tag.value="1";
document.form1.submit();
}else{
return false;
}
}else{
document.form1.submit();
}
}
function setDefalutValue(){
if (document.form1.checkDefault.checked){
document.form1.isDefault.value = "1";
}else{
document.form1.isDefault.value = "0";
}
}
function setNote(source,target,len){
var sourceValue = source.value;
var strLen = getStrLen(sourceValue);
if(strLen>len){
source.value = sourceValue.subStr(0,len);
target.innerHTML = "<font color='red'>0</font>";
}else{
target.innerHTML = "<font color='red'>"+(len - strLen)+"</font>";
}
}
-->
</Script>
<%
String generaterId = (String)request.getAttribute("AutoGeneraterId");
%>
<body>
<table width="100%" height="100%" border="0" cellpadding="0" cellspacing="0">
<form name="form1" action="<%=request.getContextPath()%>/markActivityInfo.do?function=add" method="post">
<tr>
<td width="19" height="19"><img src="<%=request.getContextPath()%>/image/openbg_dd11.gif" width="19" height="19"></td>
<td width="100%" background="<%=request.getContextPath()%>/image/openbg_dd12.gif"></td>
<td width="19"><img src="<%=request.getContextPath()%>/image/openbg_dd13.gif" width="19" height="19"></td>
</tr>
<tr valign="top">
<td height="100%" colspan="3">
<table width="100%" height="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="9" background="<%=request.getContextPath()%>/image/openbg_dd21.gif"> </td>
<td align="center"><table width="100%" height="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td height="100%" align="center" valign="top"><div style="overflow:auto;width:100%;height:100%;">
<table width="97%" border="0" height="100%" cellspacing="0" cellpadding="0">
<tr>
<td height="2"></td>
</tr>
<tr>
<td class="td_opentit">活动解释内容详请</td>
</tr>
<tr>
<td height="100%" valign="top" class="td4">
<table width="100%" border="0" cellpadding="0" cellspacing="1" bgcolor="#90B3DB">
<tr>
<td width="15%" height="22" class="td_subject">活动编号<font color="red">*
<input type="hidden" name="operate" value="add">
<input type="hidden" name="tag" value="0">
<input type="hidden" name="cmcc" value="1">
<input type="hidden" name="spBusinessId" value="0">
<input type="hidden" name="groupId" value="01">
<input type="hidden" name="groupName" value="">
</font></td>
<td width="35%" height="22" class="td_content"><input name="activityId" readonly="true" type="text" class="input1" id="activityId" maxlength="10" value="<%=generaterId%>" onblur="checkIfExists(this,document.form1.groupId);"></td>
<td width="15%" height="22" class="td_subject">活动名称(不能超过20个汉字)<font color="red">*</font></td>
<td width="35%" height="22" class="td_content"><input name="activityName" type="text" class="input1" id="activityName" maxlength="20" value="" onkeyup="setNote(this,$('activityNameNote'),20)">(<span name="activityNameNote" id="activityNameNote"><font color="red">20</font></span>)</td>
</tr>
<tr>
<td width="15%" height="22" class="td_subject">条码额度<font color="red">*</font></td>
<td width="35%" height="22" class="td_content"><input name="markAmount" type="text" class="input1" id="markAmount" maxlength="15" value="" onBlur="formatS(this)"></td>
<td width="15%" class="td_subject">打印标题(不能超过6个汉字)<font color="red">*</font></td>
<td width="35%" class="td_content"><input name="printTitle" type="text" class="input1" id="printTitle" maxlength="6" value=""></td>
</tr>
<tr>
<td width="15%" height="22" class="td_subject">用途代码(不能超过1位数字)<font color="red">*</font></td>
<td width="35%" height="22" class="td_content"><input maxlength = "1" name="purposeCode" type="text" class="input1" id="purposeCode" maxlength="10" value=""></td>
<td width="15%" class="td_subject">用途说明(不能超过20个汉字)<font color="red">*</font></td>
<td width="35%" class="td_content"><input name="purposeDesc" type="text" class="input1" id="purposeDesc" maxlength="20" value=""></td>
</tr>
<tr>
<td height="22" colspan="4" class="td_content">
<!-- 凭证验证帐户信息 (<a href="#" onClick="checkAccountExists();"><font color="red">检查帐户是否存在</font></a>) -->
凭证结果:
<span id="checkResult"> </span><span id="checkBatchNoResult"></span>
</td>
</tr>
<tr>
<td width="15%" height="22" nowrap class="td_subject">条码发送SP标识(不能超过8位数字)<font color="red">*</font></td>
<td width="35%" height="22" class="td_content"><input name="sendSpId" type="text" class="input1" id="sendSpId" maxlength="8" value=""></td>
<td width="15%" class="td_subject">批次号(不能超过11位数字)<font color="red">*</font></td>
<td width="35%" class="td_content"><input name="batchNo" type="text" class="input1" id="batchNo" maxlength="11" value="" onblur="checkBatchNo(this);"></td>
</tr>
<tr>
<td width="15%" height="22" nowrap class="td_subject">条码发送业务代码(不能超过12位数字)<font color="red">*</font></td>
<td width="35%" height="22" class="td_content"><input name="sendBussinessCode" type="text" class="input1" id="sendBussinessCode" maxlength="12" value=""></td>
<td width="15%" height="22" nowrap class="td_subject">条码发送场地标识(不能超过12位数字)<font color="red">*</font></td>
<td width="35%" height="22" class="td_content"><input name="sendLocationId" type="text" class="input1" id="sendLocationId" maxlength="12" value=""></td>
</tr>
<tr>
<td width="15%" class="td_subject">活动有效期-起始<font color="red">*</font></td>
<td width="35%" class="td_content">
<input name="startDate" type="text" class="input1" id="startDate" maxlength="15" value="" readonly="true">
<script type="text/javascript">
Calendar.setup({
inputField : "startDate",
ifFormat : "%Y-%m-%d"
});
</script>
</td>
<td width="15%" class="td_subject">活动有效期-结束<font color="red">*</font></td>
<td width="35%" class="td_content">
<input name="endDate" type="text" class="input1" id="endDate" maxlength="4" value="" readonly="true">
<script type="text/javascript">
Calendar.setup({
inputField : "endDate",
ifFormat : "%Y-%m-%d"
});
</script>
</td>
</tr>
<tr>
<td width="15%" height="22" nowrap class="td_subject">条码验证开始时间<font color="red">*</font></td>
<td width="35%" height="22" class="td_content">
<input name="verifyStartTime" type="text" class="input1" id="verifyStartTime" maxlength="10" value="" readonly="true">
<script type="text/javascript">
Calendar.setup({
inputField : "verifyStartTime",
ifFormat : "%Y-%m-%d"
});
</script>
</td>
<td width="15%" class="td_subject">条码验证结束时间<font color="red">*</font></td>
<td width="35%" class="td_content">
<input name="verifyEndTime" type="text" class="input1" id="verifyEndTime" maxlength="10" value="" readonly="true">
<script type="text/javascript">
Calendar.setup({
inputField : "verifyEndTime",
ifFormat : "%Y-%m-%d"
});
</script>
</td>
</tr>
<tr>
<td width="15%" height="22" class="td_subject">彩信标题(不能超过10个汉字)<font color="red">*</font></td>
<td height="22" colspan="3" class="td_content"><input name="infoTitle" type="text" maxlength="10" class="input1" id="infoTitle" style="width:475px;" value=""></td>
</tr>
<tr>
<td height="22" class="td_subject">短信内容(不能超过50个汉字)</td>
<td height="22" class="td_content"><textarea name="notesSms" maxlength="50" class="textarea" cols="30" id="notesSms"></textarea></td>
<td height="22" class="td_subject">彩信内容(不能超过500个汉字)</td>
<td height="22" class="td_content"><textarea maxlength="500" name="notesMms" class="textarea" cols="30" id="notesMms"></textarea></td>
</tr>
<tr>
<td width="15%" height="22" class="td_subject">打印文本(不能超过100个汉字)</td>
<td height="22" class="td_content"><textarea maxlength="100" name="printText" class="textarea" cols="30" id="printText"></textarea></td>
<td height="22" class="td_subject">备注(不能超过100个汉字)</td>
<td height="22" class="td_content"><textarea maxlength="100" name="memo" class="textarea" cols="30" id="textarea"></textarea></td>
</tr>
<tr>
<td width="15%" height="22" class="td_subject">支持手工群发</td>
<td height="22" class="td_content">
<input type="hidden" name="isDefault" value="1">
<input type="checkbox" name="checkDefault" checked value="checkbox" onClick="setDefalutValue();">
支持</td>
<td height="22" class="td_subject">活动用户类型</td>
<td height="22" class="td_content">
<select name="customerType">
<option value="1" selected>本市用户</option>
<option value="0">全省用户</option>
</select></td>
</tr>
</table>
</td>
</tr>
</table>
</div></td>
</tr>
<tr>
<td height="1"> <table width="98%" height="1" align="center" bgcolor="#5588aa" border="0" cellspacing="0" cellpadding="0">
<tr>
<td></td>
</tr>
</table></td>
</tr>
<tr>
<td height="25" valign="bottom" align="center">
<input name="Submit2222" type="button" onClick="addActivityInfo();" onMouseOver="this.className='button1_on'" onMouseOut="this.className='button1'" class="button1" value="提 交">
<input name="Submit222" type="button" onClick="javascript:window.close()" onMouseOver="this.className='button1_on'" onMouseOut="this.className='button1'" class="button1" value="关闭窗口"> </td>
</tr>
</table></td>
<td width="9" background="<%=request.getContextPath()%>/image/openbg_dd23.gif"> </td>
</tr>
</table></td>
</tr>
<tr>
<td height="19"><img src="<%=request.getContextPath()%>/image/openbg_dd31.gif" width="19" height="19"></td>
<td background="<%=request.getContextPath()%>/image/openbg_dd32.gif"></td>
<td><img src="<%=request.getContextPath()%>/image/openbg_dd33.gif" width="19" height="19"></td>
</tr>
</form>
</table>
</body>
</html>