holiday-overtime.html 8.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222
  1. <!-- include 'header' -->
  2. <body>
  3. <div class="mainLayout">
  4. <div class="mainMenu">
  5. <div class="menuItem">
  6. <a href="#" class="mLogo">CLD</a>
  7. <ul>
  8. <!-- include 'menu' -->
  9. </ul>
  10. </div>
  11. </div>
  12. <div class="warpContent">
  13. <div class="subMenu fL">
  14. <div class="menuItem">
  15. <ul>
  16. <!-- include 'holiday_menu' -->
  17. </ul>
  18. </div>
  19. </div>
  20. <div class="adminContent autoHeight" style="height: 821px;">
  21. <legend><div class="fR"><a class="button" href="#addOvertime" data-toggle="modal">加班登记</a></div>加班调休管理</legend>
  22. <div class="demandCate">
  23. <ul class="cateList">
  24. <li>
  25. <select id="selectcid">
  26. <option value="all">所有办事处</option>
  27. <!-- loop category -->
  28. <option value="{{category' value.cid}}" <!-- if isset({{thiscid}}) && {{category' value.cid}} == {{thiscid}} -->selected<!-- endif -->>{{category' value.title}}</option>
  29. <!-- endloop -->
  30. </select>
  31. </li>
  32. <li>
  33. <select id="year">
  34. {{option}}
  35. </select>
  36. <select id="month">
  37. <option value="1" <!-- if {{thismonth}} == 1 -->selected<!-- endif -->>1月</option>
  38. <option value="2" <!-- if {{thismonth}} == 2 -->selected<!-- endif -->>2月</option>
  39. <option value="3" <!-- if {{thismonth}} == 3 -->selected<!-- endif -->>3月</option>
  40. <option value="4" <!-- if {{thismonth}} == 4 -->selected<!-- endif -->>4月</option>
  41. <option value="5" <!-- if {{thismonth}} == 5 -->selected<!-- endif -->>5月</option>
  42. <option value="6" <!-- if {{thismonth}} == 6 -->selected<!-- endif -->>6月</option>
  43. <option value="7" <!-- if {{thismonth}} == 7 -->selected<!-- endif -->>7月</option>
  44. <option value="8" <!-- if {{thismonth}} == 8 -->selected<!-- endif -->>8月</option>
  45. <option value="9" <!-- if {{thismonth}} == 9 -->selected<!-- endif -->>9月</option>
  46. <option value="10" <!-- if {{thismonth}} == 10 -->selected<!-- endif -->>10月</option>
  47. <option value="11" <!-- if {{thismonth}} == 11 -->selected<!-- endif -->>11月</option>
  48. <option value="12" <!-- if {{thismonth}} == 12 -->selected<!-- endif -->>12月</option>
  49. </select>
  50. </li>
  51. </ul>
  52. </div>
  53. <div class="saeaList">
  54. <div class="entry">
  55. <table class="table table-bordered table-condensed table-hover">
  56. <tbody>
  57. <tr><th class="taC" width="50"></th><th class="taC">员工</th><th class="taC colGreen">加班</th><th class="taC colGreen">值班</th><th class="taC colRed">补休</th><th class="taC">调休</th><th class="taC">累计存假 <span class="icon- colBlue" data-placement="bottom" data-toggle="ctooltip" data-original-title="累计存假=加班+值班">h</span></th><th class="taC">剩余存假 <span class="icon- colBlue" data-placement="bottom" data-toggle="ctooltip" data-original-title="剩余存假=累计存假-补休-提现">h</span></th></tr>
  58. <!-- loop stafflist -->
  59. <!-- loop stafflist' value.cidstafflist -->
  60. <tr>
  61. <!-- if !empty({{stafflist' cidstafflist' value.first}}) -->
  62. <th rowspan="{{stafflist' value.count}}">{{stafflist' value.categoryname}}</th>
  63. <!-- endif -->
  64. <th>{{stafflist' cidstafflist' value.username}}</th>
  65. <td class="taC">{{stafflist' cidstafflist' value.4}}</td>
  66. <td class="taC">{{stafflist' cidstafflist' value.5}}</td>
  67. <td class="taC">{{stafflist' cidstafflist' value.10}}</td>
  68. <td class="taC">{{stafflist' cidstafflist' value.11}}</td>
  69. <td class="taC">{{stafflist' cidstafflist' value.countnum}}</td>
  70. <td class="taC">{{stafflist' cidstafflist' value.addnum}}</td>
  71. </tr>
  72. <!-- endloop -->
  73. <!-- endloop -->
  74. </table>
  75. </div>
  76. </div>
  77. </div>
  78. </div>
  79. </div>
  80. <!--弹出-->
  81. <div class="modal hide fade" id="addOvertime">
  82. <div class="modal-dialog ">
  83. <div class="modal-content">
  84. <div class="modal-header">
  85. <h3>加班登记</h3>
  86. </div>
  87. <form method="post" action="/addholiday" onsubmit="return addholiday();">
  88. <div class="modal-body saeaList">
  89. <table class="table table-bordered table-condensed">
  90. <tbody>
  91. <tr>
  92. <th class="taC" width="100"><span class="colRed">*</span>员工</th>
  93. <td>
  94. <select id="category">
  95. <!-- loop category -->
  96. <option value="{{category' value.cid}}">{{category' value.title}}</option>
  97. <!-- endloop -->
  98. </select>
  99. <select id="cidstaff" name="uid">
  100. <option value="0">选择员工</option>
  101. <!-- loop zongbu -->
  102. <option value="{{zongbu' value.sid}}">{{zongbu' value.username}}</option>
  103. <!-- endloop -->
  104. </select>
  105. </td>
  106. </tr>
  107. <tr>
  108. <th class="taC" width="100"><span class="colRed">*</span>登记类型</th><td>
  109. <select id="selecttype" name="type">
  110. <option value="5">值班登记</option>
  111. <option value="4">加班登记</option>
  112. <option value="13">存假提现</option>
  113. </select></td>
  114. </tr>
  115. <!--值班-->
  116. <tr id="tr_5" class="changetr">
  117. <th class="taC" width="100"><span class="colRed">*</span>值班日期</th><td><input id="zhiban" name="day" placeholder="请选择值班日期" type="date"></td>
  118. </tr>
  119. <!--加班-->
  120. <tr id="tr_4" class="changetr" style="display: none">
  121. <th class="taC" width="100"><span class="colRed">*</span>加班日期</th><td><input id="jiaban" name="day" placeholder="请选择加班日期" type="date" disabled="true"></td>
  122. </tr>
  123. <!--提现-->
  124. <tr id="tr_13" class="changetr" style="display: none">
  125. <th class="taC" width="100"><span class="colRed">*</span>提现天数</th><td><input id="tixian" name="tixian" placeholder="请输入提现天数" type="number" step="0.5" disabled="true"></td>
  126. </tr>
  127. <tr>
  128. <th class="taC" width="100">备注</th><td><textarea class="span4" name="description" placeholder="选填"></textarea></td>
  129. </tr>
  130. </tbody>
  131. </table>
  132. </div>
  133. <div class="modal-footer">
  134. <a href="#" class="button btn-gray" data-dismiss="modal" aria-hidden="true">取消</a>
  135. <button type="submit" class="button">确定</button>
  136. </div>
  137. </form>
  138. </div>
  139. </div>
  140. </div>
  141. <!--弹出内容-->
  142. <script type="text/javascript">autoFlashHeight();</script>
  143. <script>
  144. $(function() {
  145. $('#selectcid').change(function () {
  146. var html = '';
  147. if ($(this).val() != 'all') {
  148. html += '/' + $(this).val();
  149. }
  150. html += '/year/'+$('#year').val()+'/month/'+$('#month').val();
  151. window.location.href = '/holidayovertime' + html;
  152. });
  153. $('#year').change(function(){
  154. var html = '';
  155. if($('#selectcid').val() != 'all') {
  156. html += '/' + $('#selectcid').val();
  157. }
  158. html += '/year/'+$(this).val()+'/month/'+$('#month').val();
  159. window.location.href = '/holidayovertime' + html;
  160. });
  161. $('#month').change(function(){
  162. var html = '';
  163. if($('#selectcid').val() != 'all') {
  164. html += '/' + $('#selectcid').val();
  165. }
  166. html += '/year/'+$('#year').val()+'/month/'+$(this).val();
  167. window.location.href = '/holidayovertime' + html;
  168. })
  169. $('#category').change(function(){
  170. $.ajax({
  171. type: 'post',
  172. url: '/getstaffcategory',
  173. data: {cid:$(this).val()},
  174. dataType: 'json',
  175. success: function(result){
  176. if(result.code == 200){
  177. $('#cidstaff').html('');
  178. var html = '<option value="0">选择员工</option>';
  179. $.each(result.stafflist,function(k,v){
  180. html +='<option value="'+v.sid+'">'+v.username+'</option>';
  181. });
  182. $('#cidstaff').html(html);
  183. }
  184. }
  185. })
  186. });
  187. $('#selecttype').change(function(){
  188. $('.changetr').hide();
  189. $('.changetr input').attr('disabled',true);
  190. $('#tr_'+$(this).val()).show();
  191. $('#tr_'+$(this).val()+' input').removeAttr('disabled');
  192. })
  193. });
  194. function addholiday(){
  195. if($('#cidstaff').val() == 0){
  196. alert('请选择员工');
  197. return false;
  198. }
  199. if($('#selecttype').val() == 4){
  200. if($('#jiaban').val() == ''){
  201. alert('请选择加班日期');
  202. return false;
  203. }
  204. }else if($('#selecttype').val() == 5){
  205. if($('#zhiban').val() == ''){
  206. alert('请选择值班日期');
  207. return false;
  208. }
  209. }else if($('#selecttype').val() == 13) {
  210. if ($('#tixian').val() == '') {
  211. alert('请输入提现天数');
  212. return false;
  213. }
  214. }
  215. }
  216. </script>
  217. </body>