atsCardRuleEdit.jsp 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293
  1. <%--
  2. time:2015-05-18 16:16:16
  3. desc:edit the 取卡规则
  4. --%>
  5. <%@page language="java" pageEncoding="UTF-8"%>
  6. <%@include file="/commons/include/html_doctype.html"%>
  7. <html>
  8. <head>
  9. <title>编辑 取卡规则</title>
  10. <%@include file="/commons/include/form.jsp" %>
  11. <f:link href="listEdit.css"></f:link>
  12. <script type="text/javascript" src="${ctx}/js/hotent/CustomValid.js"></script>
  13. <script type="text/javascript">
  14. $(function() {
  15. $("a.save").click(function() {
  16. $("#atsCardRuleForm").attr("action","save.ht");
  17. submitForm();
  18. });
  19. changeSegmentNum();
  20. setSegFirAssignSegmentShow();
  21. $(".toggle").click();
  22. });
  23. //提交表单
  24. function submitForm(){
  25. var options={};
  26. if(showResponse){
  27. options.success=showResponse;
  28. }
  29. var frm=$('#atsCardRuleForm').form();
  30. frm.ajaxForm(options);
  31. if(frm.valid()){
  32. frm.submit();
  33. }
  34. }
  35. function showResponse(responseText) {
  36. var obj = new com.hotent.form.ResultMessage(responseText);
  37. if (obj.isSuccess()) {
  38. $.ligerDialog.confirm(obj.getMessage()+",是否继续操作","提示信息", function(rtn) {
  39. if(rtn){
  40. window.location.href = window.location.href;
  41. }else{
  42. window.location.href = "${ctx}/platform/ats/atsCardRule/list.ht";
  43. }
  44. });
  45. } else {
  46. $.ligerDialog.err("提示信息","取卡规则保存失败!",obj.getMessage());
  47. }
  48. }
  49. function changeSegmentNum(){
  50. var val = $("#segmentNum").val();
  51. if(val == 1){
  52. $('#segFirAssign').hide();
  53. $('#segSecAssign').hide();
  54. }else if(val == 2){
  55. $('#segFirAssign').show();
  56. $('#segSecAssign').hide();
  57. }else if(val == 3){
  58. $('#segFirAssign').show();
  59. $('#segSecAssign').show();
  60. }
  61. }
  62. function setSegFirAssignSegmentShow(i){
  63. function a(){
  64. if($("#segFirAssignType").val()==2){
  65. $(".segFirAssignSegment").hide();
  66. }else{
  67. $(".segFirAssignSegment").show();
  68. }
  69. }
  70. function b(){
  71. if($("#segSecAssignType").val()==2){
  72. $(".segSecAssignSegment").hide();
  73. }else{
  74. $(".segSecAssignSegment").show();
  75. }
  76. }
  77. if(i == 0 ){
  78. a();
  79. }else if ( i == 1){
  80. b();
  81. }else{
  82. a();
  83. b();
  84. }
  85. }
  86. </script>
  87. </head>
  88. <body>
  89. <div class="panel">
  90. <div class="panel-top">
  91. <div class="tbar-title">
  92. <c:choose>
  93. <c:when test="${atsCardRule.id !=null}">
  94. <span class="tbar-label"><span></span>编辑取卡规则</span>
  95. </c:when>
  96. <c:otherwise>
  97. <span class="tbar-label"><span></span>添加取卡规则</span>
  98. </c:otherwise>
  99. </c:choose>
  100. </div>
  101. <div class="panel-toolbar">
  102. <div class="toolBar">
  103. <div class="group"><a class="link save" id="dataFormSave" href="javaScript:void(0)"><span></span>保存</a></div>
  104. <div class="l-bar-separator"></div>
  105. <div class="group"><a class="link back" href="list.ht"><span></span>返回</a></div>
  106. </div>
  107. </div>
  108. </div>
  109. <div class="panel-body">
  110. <form id="atsCardRuleForm" method="post" action="save.ht">
  111. <table class="table-detail" cellpadding="0" cellspacing="0" border="0">
  112. <tr>
  113. <th width="20%">编码: </th>
  114. <td><input type="text" id="code" name="code" value="${atsCardRule.code}" class="inputText" validate="{required:true,maxlength:384}" /></td>
  115. <th width="20%">名称: </th>
  116. <td><input type="text" id="name" name="name" value="${atsCardRule.name}" class="inputText" validate="{required:true,maxlength:384}" /></td>
  117. </tr>
  118. <tr>
  119. <th width="20%">上班取卡提前(小时): </th>
  120. <td><input type="text" id="startNum" name="startNum" value="${atsCardRule.startNum}" class="inputText" validate="{required:true,number:true,maxIntLen:10}" /></td>
  121. <th width="20%">下班取卡延后(小时): </th>
  122. <td><input type="text" id="endNum" name="endNum" value="${atsCardRule.endNum}" class="inputText" validate="{required:true,number:true,maxIntLen:10}" /></td>
  123. </tr>
  124. <tr>
  125. <th width="20%">最短取卡间隔(分钟): </th>
  126. <td><input type="text" id="timeInterval" name="timeInterval" value="${atsCardRule.timeInterval}" class="inputText" validate="{required:true,number:true,maxIntLen:10}" /></td>
  127. <th width="20%">适用段次: </th>
  128. <td>
  129. <select id="segmentNum" name="segmentNum" onchange="changeSegmentNum(this)">
  130. <option value="1" <c:if test="${atsCardRule.segmentNum == 1}">selected="selected"</c:if>>一段</option>
  131. <option value="2" <c:if test="${atsCardRule.segmentNum == 2}">selected="selected"</c:if>>二段</option>
  132. <option value="3" <c:if test="${atsCardRule.segmentNum == 3}">selected="selected"</c:if>>三段</option>
  133. </select>
  134. </td>
  135. </tr>
  136. <tr>
  137. <th width="20%">是否默认: </th>
  138. <td colspan="3">
  139. <input type="checkbox" id="isDefault" name="isDefault" value="1" <c:if test="${atsCardRule.isDefault ==1}"> checked="checked"</c:if> />
  140. </td>
  141. </tr>
  142. </table>
  143. <fieldset>
  144. <legend>上班取卡规则</legend>
  145. <fieldset>
  146. <legend>上班第一次取卡</legend>
  147. <table class="table-detail" cellpadding="0" cellspacing="0" border="0">
  148. <tr>
  149. <th width="20%">取卡范围开始时数: </th>
  150. <td><input type="text" id="segBefFirStartNum" name="segBefFirStartNum" value="${atsCardRule.segBefFirStartNum}" class="inputText" validate="{number:true,maxIntLen:10}" /></td>
  151. <th width="20%">取卡范围结束时数: </th>
  152. <td><input type="text" id="segBefFirEndNum" name="segBefFirEndNum" value="${atsCardRule.segBefFirEndNum}" class="inputText" validate="{number:true,maxIntLen:10}" /></td>
  153. </tr>
  154. <tr>
  155. <th width="20%">取卡方式: </th>
  156. <td colspan="3">
  157. <select id="segBefFirTakeCardType" name="segBefFirTakeCardType" >
  158. <option value="1" <c:if test="${atsCardRule.segBefFirTakeCardType == 1}">selected="selected"</c:if>>该段最早卡</option>
  159. <option value="2" <c:if test="${atsCardRule.segBefFirTakeCardType == 2}">selected="selected"</c:if>>该段最晚卡</option>
  160. </select>
  161. </td>
  162. </tr>
  163. </table>
  164. </fieldset>
  165. <a href="javascript:void(0);" onclick="$(this).next().toggle();$(this).text($(this).text()=='收起'?'展开':'收起')" class="toggle">收起</a>
  166. <fieldset>
  167. <legend >上班第二次取卡</legend>
  168. <table class="table-detail" cellpadding="0" cellspacing="0" border="0" >
  169. <tr>
  170. <th width="20%">取卡范围开始时数: </th>
  171. <td><input type="text" id="segBefSecStartNum" name="segBefSecStartNum" value="${atsCardRule.segBefSecStartNum}" class="inputText" validate="{number:true,maxIntLen:10}" /></td>
  172. <th width="20%">取卡范围结束时数: </th>
  173. <td ><input type="text" id="segBefSecEndNum" name="segBefSecEndNum" value="${atsCardRule.segBefSecEndNum}" class="inputText" validate="{number:true,maxIntLen:10}" /></td>
  174. </tr>
  175. <tr>
  176. <th width="20%">取卡方式: </th>
  177. <td colspan="3">
  178. <select id="segBefSecTakeCardType" name="segBefSecTakeCardType" >
  179. <option value="1" <c:if test="${atsCardRule.segBefSecTakeCardType == 1}">selected="selected"</c:if>>该段最早卡</option>
  180. <option value="2" <c:if test="${atsCardRule.segBefSecTakeCardType == 2}">selected="selected"</c:if>>该段最晚卡</option>
  181. </select>
  182. </td>
  183. </tr>
  184. </table>
  185. </fieldset>
  186. </fieldset>
  187. <!-- 上班end -->
  188. <!-- 下班start-->
  189. <fieldset>
  190. <legend>下班取卡规则</legend>
  191. <fieldset>
  192. <legend>下班第一次取卡</legend>
  193. <table class="table-detail" cellpadding="0" cellspacing="0" border="0">
  194. <tr>
  195. <th width="20%">取卡范围开始时数: </th>
  196. <td><input type="text" id="segAftFirStartNum" name="segAftFirStartNum" value="${atsCardRule.segAftFirStartNum}" class="inputText" validate="{number:true,maxIntLen:10}" /></td>
  197. <th width="20%">取卡范围结束时数: </th>
  198. <td ><input type="text" id="segAftFirEndNum" name="segAftFirEndNum" value="${atsCardRule.segAftFirEndNum}" class="inputText" validate="{number:true,maxIntLen:10}" /></td>
  199. </tr>
  200. <tr>
  201. <th width="20%">取卡方式: </th>
  202. <td colspan="3">
  203. <select id="segAftFirTakeCardType" name="segAftFirTakeCardType" >
  204. <option value="1" <c:if test="${atsCardRule.segAftFirTakeCardType == 1}">selected="selected"</c:if>>该段最早卡</option>
  205. <option value="2" <c:if test="${atsCardRule.segAftFirTakeCardType == 2}">selected="selected"</c:if>>该段最晚卡</option>
  206. </select>
  207. </td>
  208. </tr>
  209. </table>
  210. </fieldset>
  211. <a href="javascript:void(0);" onclick="$(this).next().toggle();$(this).text($(this).text()=='收起'?'展开':'收起')" class="toggle">收起</a>
  212. <fieldset>
  213. <legend>下班第二次取卡</legend>
  214. <table class="table-detail" cellpadding="0" cellspacing="0" border="0">
  215. <tr>
  216. <th width="20%">取卡范围开始时数: </th>
  217. <td><input type="text" id="segAftSecStartNum" name="segAftSecStartNum" value="${atsCardRule.segAftSecStartNum}" class="inputText" validate="{number:true,maxIntLen:10}" /></td>
  218. <th width="20%">取卡范围结束时数: </th>
  219. <td><input type="text" id="segAftSecEndNum" name="segAftSecEndNum" value="${atsCardRule.segAftSecEndNum}" class="inputText" validate="{number:true,maxIntLen:10}" /></td>
  220. </tr>
  221. <tr>
  222. <th width="20%">取卡方式: </th>
  223. <td colspan="3">
  224. <select id="segAftSecTakeCardType" name="segAftSecTakeCardType" >
  225. <option value="1" <c:if test="${atsCardRule.segAftSecTakeCardType == 1}">selected="selected"</c:if>>该段最早卡</option>
  226. <option value="2" <c:if test="${atsCardRule.segAftSecTakeCardType == 2}">selected="selected"</c:if>>该段最晚卡</option>
  227. </select>
  228. </td>
  229. </tr>
  230. </table>
  231. </fieldset>
  232. </fieldset>
  233. <fieldset id="segFirAssign" style="display: none">
  234. <legend>第一段间</legend>
  235. <table class="table-detail" cellpadding="0" cellspacing="0" border="0">
  236. <tr>
  237. <th width="20%">分配类型: </th>
  238. <td>
  239. <select id="segFirAssignType" name="segFirAssignType" onchange="setSegFirAssignSegmentShow(0)">
  240. <option value=""></option>
  241. <option value="1" <c:if test="${atsCardRule.segFirAssignType == 1}">selected="selected"</c:if>>手工分配</option>
  242. <option value="2" <c:if test="${atsCardRule.segFirAssignType == 2}">selected="selected"</c:if>>最近打卡点</option>
  243. </select>
  244. </td>
  245. <th width="20%" class="segFirAssignSegment">分配段次: </th>
  246. <td class="segFirAssignSegment">
  247. <select id="segFirAssignSegment" name="segFirAssignSegment" validate="{required:true,maxlength:384}" >
  248. <option value="1" <c:if test="${atsCardRule.segFirAssignSegment == 1}">selected="selected"</c:if>>第一段下班</option>
  249. <option value="2" <c:if test="${atsCardRule.segFirAssignSegment == 2}">selected="selected"</c:if>>第二段上班</option>
  250. </select>
  251. </td>
  252. </tr>
  253. </table>
  254. </fieldset>
  255. <fieldset id="segSecAssign" style="display: none">
  256. <legend>第二段间</legend>
  257. <table class="table-detail" cellpadding="0" cellspacing="0" border="0">
  258. <tr>
  259. <th width="20%">分配类型: </th>
  260. <td>
  261. <select id="segSecAssignType" name="segSecAssignType" onchange="setSegFirAssignSegmentShow(1)">
  262. <option value=""></option>
  263. <option value="1" <c:if test="${atsCardRule.segSecAssignType == 1}">selected="selected"</c:if>>手工分配</option>
  264. <option value="2" <c:if test="${atsCardRule.segSecAssignType == 2}">selected="selected"</c:if>>最近打卡点</option>
  265. </select>
  266. </td>
  267. <th width="20%" class="segSecAssignSegment">分配段次: </th>
  268. <td class="segSecAssignSegment">
  269. <select id="segSecAssignSegment" name="segSecAssignSegment" validate="{required:true,maxlength:384}">
  270. <option value=""></option>
  271. <option value="1" <c:if test="${atsCardRule.segSecAssignSegment == 1}">selected="selected"</c:if>>第二段下班</option>
  272. <option value="2" <c:if test="${atsCardRule.segSecAssignSegment == 2}">selected="selected"</c:if>>第三段上班</option>
  273. </select>
  274. </td>
  275. </tr>
  276. </table>
  277. </fieldset>
  278. <input type="hidden" name="id" value="${atsCardRule.id}" />
  279. </form>
  280. </div>
  281. </div>
  282. </body>
  283. </html>