createSchedule.jsp 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238
  1. <%@ page language="java" contentType="text/html;charset=GBK"
  2. pageEncoding="GBK"%>
  3. <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
  4. <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
  5. <html>
  6. <head>
  7. <meta http-equiv="Content-Type" content="text/html;charset=GBK">
  8. <title>创建日程 </title>
  9. <link href="${pageContext.request.contextPath }/liger/lib/ligerUI/skins/Aqua/css/ligerui-all.css" rel="stylesheet" type="text/css" />
  10. <link href="/shares/css/yw/master1/reset.css" rel="stylesheet" type="text/css" />
  11. <script type="text/javascript" src="/shares/js/jquery-1.6.4.min.js">
  12. <script type="text/javascript" src="/shares/js/constant.js"></script>
  13. <script type="text/javascript" src="/shares/js/common.js"></script>
  14. <script type="text/javascript" src="/shares/js/yw/oa/scheduleManager.js"></script>
  15. <script src="${pageContext.request.contextPath }/liger/lib/ligerUI/js/core/base.js" type="text/javascript"></script>
  16. <script src="${pageContext.request.contextPath }/liger/lib/ligerUI/js/plugins/ligerDateEditor.js" type="text/javascript"></script>
  17. <script src="${pageContext.request.contextPath }/liger/lib/ligerUI/js/plugins/ligerComboBox.js" type="text/javascript"></script>
  18. <script type="text/javascript" src="/shares/js/yw/master1/common.js"></script>
  19. <link rel="stylesheet" type="text/css" href="/shares/css/yw/master1/${sessionScope.loginFrom}/jquery.jscrollpane.codrops1.css" />
  20. <!-- the mousewheel plugin -->
  21. <script type="text/javascript" src="/shares/js/yw/master1/jquery.mousewheel.js"></script>
  22. <!-- the jScrollPane script -->
  23. <script type="text/javascript" src="/shares/js/yw/master1/jquery.jscrollpane.min.js"></script>
  24. <script type="text/javascript" src="/shares/js/yw/master1/scroll-startstop.events.jquery.js"></script>
  25. <script type="text/javascript" src="/shares/js/yw/master1/scroll.js"></script>
  26. <script type="text/javascript">
  27. $(function () {
  28. $("#schedule_level").ligerComboBox({
  29. isShowCheckBox: true,
  30. initText:'${requestScope.schedule.schedule_level}',
  31. initValue:'${requestScope.schedule.schedule_level_}',
  32. data: [
  33. { text: '重要/紧急', id: '1' },
  34. { text: '重要/不紧急', id: '2' },
  35. { text: '不重要/紧急', id: '3' },
  36. { text: '不重要/不紧急', id: '4' },
  37. { text: '未指定', id: '0' }
  38. ], valueFieldID: 'schedule_level_'
  39. });
  40. $("#schedule_type").ligerComboBox({
  41. selectBoxHeight:50,
  42. initText:'${requestScope.schedule.schedule_type}',
  43. initValue:'${requestScope.schedule.schedule_type_}',
  44. data: [
  45. { text: '工作事务', id: '2' },
  46. { text: '个人事务', id: '1' }
  47. ], valueFieldID: 'schedule_type_'
  48. });
  49. $("#schedule_start_date").ligerDateEditor({ showTime: true, labelAlign: 'left', showTime:true, width:131,height:21});
  50. $("#schedule_end_date").ligerDateEditor({ showTime: true, labelAlign: 'left', showTime:true, width:131,height:21});
  51. });
  52. function getDate(){
  53. var d=new Date();
  54. return d.getYear()+( d.getMonth()+1)+d.getDate()+'08:00';
  55. alert(d.getYear()+( d.getMonth()+1)+d.getDate()+'08:00');
  56. }
  57. function checkForm(){
  58. $("#timeMsgBox").empty();
  59. $("#schedule_end_date_msg").empty();
  60. $("#error_date_msg").empty();
  61. $("#error_date_msg_").empty();
  62. clearMsg();
  63. var rs = $.validate({
  64. name : "schedule_title",
  65. model : [ {
  66. type : "require",
  67. msg : "日程标题不能为空!"
  68. }, {
  69. type : "len",
  70. min : 1,
  71. max : 20,
  72. msg : "日程标题称长度不能超过20个字!"
  73. } ]
  74. });
  75. var rs = $.validate({
  76. name : "schedule_start_date",
  77. model : [ {
  78. type : "require",
  79. msg : "请选择正确的开始时间格式!",
  80. msgBox : "schedule_start_date_msg"
  81. } ]
  82. }) && rs;
  83. var rs = $.validate({
  84. name : "schedule_end_date",
  85. model : [ {
  86. type : "require",
  87. msg : "请选择正确的结束时间格式!",
  88. msgBox : "schedule_end_date_msg"
  89. } ]
  90. }) && rs;
  91. var rs = $.validate({
  92. name : "schedule_detail",
  93. model : [ {
  94. type : "len",
  95. min:0,
  96. max:270,
  97. msg : "事务内容长度不能超过270个字!"
  98. } ]
  99. }) && rs;
  100. if (rs) {
  101. if ($("#_day").val().match(/^[1-9]\d*$/) == null && $("#_day").val().replace(/(^\s*)|(\s*$)/g, "") != ""){
  102. $("#timeMsgBox").append("<font color=\"red\"> 提前提醒天数应为正整数!</font>");
  103. document.all._day.focus();
  104. return false;
  105. }else if ($("#_hour").val().match(/^[1-9]\d*$/) == null && $("#_hour").val().replace(/(^\s*)|(\s*$)/g, "") != ""){
  106. $("#timeMsgBox").append("<font color=\"red\"> 提前提醒小时应为正整数!</font>");
  107. document.all._hour.focus();
  108. return false;
  109. }else if ($("#_minute").val().match(/^[1-9]\d*$/) == null && $("#_minute").val().replace(/(^\s*)|(\s*$)/g, "") != ""){
  110. $("#timeMsgBox").append("<font color=\"red\"> 提前提醒分钟应为正整数!</font>");
  111. document.all._minute.focus();
  112. return false;
  113. //}else if (new Date(Date.parse($("#schedule_start_date").val().replace("-","/"))).getHours() <= 7 || new Date(Date.parse($("#schedule_start_date").val().replace("-","/"))).getHours() >= 22){
  114. //$("#error_date_msg_").append("<font color=\"red\"> 开始时间应在8:00 - 22:00之间!</font>");
  115. //document.all.schedule_start_date.focus();
  116. //return false;
  117. //}else if (new Date(Date.parse($("#schedule_end_date").val().replace("-","/"))).getHours() >= 22 || new Date(Date.parse($("#schedule_end_date").val().replace("-","/"))).getHours() <= 7){
  118. //$("#error_date_msg").append("<font color=\"red\"> 结束时间应在8:00 - 22:00之间!</font>");
  119. //document.all.schedule_end_date.focus();
  120. //return false;
  121. }else if (new Date(Date.parse($("#schedule_end_date").val().replace("-","/"))) <= new Date(Date.parse($("#schedule_start_date").val().replace("-","/")))){
  122. $("#error_date_msg").append("<font color=\"red\">结束时间不能早于或等于开始时间!</font>");
  123. document.all.schedule_end_date.focus();
  124. return false;
  125. } else {
  126. document.getElementById("sub_id").disabled="true";
  127. return true;
  128. }
  129. } else {
  130. return false;
  131. }
  132. }
  133. function refresh(type,userId){
  134. //alert(type + "==" + userId);
  135. if(type == "1"){
  136. if(userId != null && userId != ""){
  137. window.parent.window.$('#calendar').empty();
  138. window.parent.window.loadSelect(userId,"text");
  139. window.parent.dialog3.hidden();
  140. } else {
  141. //window.parent.$.ligerDialog.close();
  142. //parent.location.loadSelect($("#userId").val(),"text");
  143. parent.location.reload();
  144. }
  145. }
  146. }
  147. function back_(){
  148. var backType = $('#backType').val();
  149. if("0" == backType){
  150. window.location.href="MTScheduleAction.do?task=schedule&viewName=${viewName}";
  151. }else{
  152. window.location.href="MTScheduleAction.do?task=operate&viewName=${viewName}&userId=${requestScope.schedule.userId }";
  153. }
  154. }
  155. </script>
  156. </head> <style type="text/css">
  157. body {
  158. overflow:hidden;
  159. background:#fff;
  160. }
  161. </style>
  162. <body onload="refresh('${type}', '${userId}');" ontouchmove="event.preventDefault();">
  163. <form action="MTScheduleAction.do" method="post" onsubmit="return checkForm();" >
  164. <input type="hidden" id="task" name="task" value="create">
  165. <input type="hidden" id="userId" name="userId" value="${requestScope.schedule.userId }">
  166. <div class="s_title b10 f6">
  167. <img src="/shares/images/master1/gg_ico.png" width="27" height="26" />&nbsp;创建日程
  168. <div class="article_title"><input class="art_back" name="" title="返回" onclick="back_();" type="button" />&nbsp;&nbsp;
  169. <input class="art_sub" title="提交" name="" type="submit" value="" id="sub_id"/></div></div>
  170. <input type="hidden" id="viewName" name="viewName" value="${viewName}"/>
  171. <input type="hidden" id="backType" name="backType" value="${backType}"/>
  172. <div id="jp-container" class="jp-container liuyan">
  173. <ul><li></li>
  174. <li>
  175. <span class="span_l f7">日程标题<FONT COLOR="red">*</FONT>:</span>
  176. <input class="text_input1" name="schedule_title" id="schedule_title" value="${requestScope.schedule.schedule_title }" type="text" />
  177. </li>
  178. <li>
  179. <span class="span_l f7">开始时间<FONT COLOR="red">*</FONT>:</span><span class="span_l f7">
  180. <input style="color: #737373;" name="schedule_start_date" id="schedule_start_date" value="${requestScope.schedule.schedule_start_date }" type="text" />
  181. <input type="hidden" id="schedule_start_date_msg" name="schedule_start_date_msg" /> &nbsp;
  182. <div id="error_date_msg_" style="display: inline;"></span></div>
  183. </li>
  184. <li>
  185. <span class="span_l f7">结束时间<FONT COLOR="red">*</FONT>:</span><span class="span_l f7">
  186. <input style="color: #737373;" name="schedule_end_date" id="schedule_end_date" value="${requestScope.schedule.schedule_end_date }" type="text" />
  187. <input type="hidden" id="schedule_end_date_msg" name="schedule_end_date_msg" /> &nbsp;
  188. <div id="error_date_msg" style="display: inline;"></div></span>
  189. </li>
  190. <li>
  191. <span class="span_l f7">优先级:</span><span class="span_l f7">
  192. <input style="color: #737373;" name="schedule_level" style="width: 121px;" id="schedule_level" value="${requestScope.schedule.schedule_level }" type="text" />
  193. <input type="hidden" id="schedule_level_" name="schedule_level_" /></span>
  194. </li>
  195. <li>
  196. <span class="span_l f7">日程事务类型:</span><span class="span_l f7">
  197. <input style="color: #737373;" name="schedule_type" id="schedule_type" style="width: 121px;" value="${requestScope.schedule.schedule_type }" type="text" />
  198. <input type="hidden" id="schedule_type_" name="schedule_type_" /></span>
  199. </li>
  200. <li>
  201. <span class="span_l f7">事务内容:</span>
  202. <textarea class="textarea1" id="schedule_detail" name="schedule_detail" rows="4" cols="85">${requestScope.schedule.schedule_detail }</textarea>
  203. </li>
  204. <li>
  205. <span class="span_l f7">提醒时间:</span><span class="span_c f7" >
  206. 提前 <input type="text" class="select_input1" style="width:20px;height:24px;" name="_day" id="_day" value="${requestScope.schedule._day }"> 天
  207. <input type="text" class="text_input1" style="width:20px;height:24px;" id="_hour" name="_hour" value="${requestScope.schedule._hour }"> 小时
  208. <input type="text" class="select_input1" style="width:20px;height:24px;" id="_minute" name="_minute" value="${requestScope.schedule._minute }"> 分钟提醒
  209. <div id="timeMsgBox" style="display: inline;"></div></span>
  210. </li>
  211. <li>
  212. <span class="span_l f7">提醒方式:</span><span class="span_r f7" >
  213. <input type="checkbox" class="radio_input1" name="alarm_type1" id="alarm_type1" <c:if test="${requestScope.schedule.alarm_type1 == 1 }"> checked="checked"</c:if> > 短信
  214. <input type="checkbox" class="radio_input1" name="alarm_type2" id="alarm_type2" <c:if test="${requestScope.schedule.alarm_type2 == 1 }"> checked="checked"</c:if> > 邮件
  215. </span>
  216. </li>
  217. </ul>
  218. </div>
  219. </form><%@ include file="/include/message.jsp"%>
  220. </body>
  221. </html>