holiday-overtime.html 8.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239
  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 id="tr_day">
  128. <th class="taC" width="100"><span class="colRed">*</span>时间</th>
  129. <td>
  130. <select name="daytype">
  131. <option value="1">全天(1天)</option>
  132. <option value="2">上午(0.5天)</option>
  133. <option value="3">下午(0.5天)</option>
  134. </select>
  135. </td>
  136. </tr>
  137. <tr>
  138. <th class="taC" width="100">备注</th><td><textarea class="span4" name="description" placeholder="选填"></textarea></td>
  139. </tr>
  140. </tbody>
  141. </table>
  142. </div>
  143. <div class="modal-footer">
  144. <a href="#" class="button btn-gray" data-dismiss="modal" aria-hidden="true">取消</a>
  145. <button type="submit" class="button">确定</button>
  146. </div>
  147. </form>
  148. </div>
  149. </div>
  150. </div>
  151. <!--弹出内容-->
  152. <script type="text/javascript">autoFlashHeight();</script>
  153. <script>
  154. $(function() {
  155. $('#selectcid').change(function () {
  156. var html = '';
  157. if ($(this).val() != 'all') {
  158. html += '/' + $(this).val();
  159. }
  160. html += '/year/'+$('#year').val()+'/month/'+$('#month').val();
  161. window.location.href = '/holidayovertime' + html;
  162. });
  163. $('#year').change(function(){
  164. var html = '';
  165. if($('#selectcid').val() != 'all') {
  166. html += '/' + $('#selectcid').val();
  167. }
  168. html += '/year/'+$(this).val()+'/month/'+$('#month').val();
  169. window.location.href = '/holidayovertime' + html;
  170. });
  171. $('#month').change(function(){
  172. var html = '';
  173. if($('#selectcid').val() != 'all') {
  174. html += '/' + $('#selectcid').val();
  175. }
  176. html += '/year/'+$('#year').val()+'/month/'+$(this).val();
  177. window.location.href = '/holidayovertime' + html;
  178. })
  179. $('#category').change(function(){
  180. $.ajax({
  181. type: 'post',
  182. url: '/getstaffcategory',
  183. data: {cid:$(this).val()},
  184. dataType: 'json',
  185. success: function(result){
  186. if(result.code == 200){
  187. $('#cidstaff').html('');
  188. var html = '<option value="0">选择员工</option>';
  189. $.each(result.stafflist,function(k,v){
  190. html +='<option value="'+v.sid+'">'+v.username+'</option>';
  191. });
  192. $('#cidstaff').html(html);
  193. }
  194. }
  195. })
  196. });
  197. $('#selecttype').change(function(){
  198. $('.changetr').hide();
  199. $('.changetr input').attr('disabled',true);
  200. $('#tr_'+$(this).val()).show();
  201. $('#tr_'+$(this).val()+' input').removeAttr('disabled');
  202. if($(this).val() == 13){
  203. $('#tr_day').hide();
  204. $('#tr_day').find('select').attr('disabled',true);
  205. }else{
  206. $('#tr_day').show();
  207. $('#tr_day').find('select').removeAttr('disabled');
  208. }
  209. })
  210. });
  211. function addholiday(){
  212. if($('#cidstaff').val() == 0){
  213. alert('请选择员工');
  214. return false;
  215. }
  216. if($('#selecttype').val() == 4){
  217. if($('#jiaban').val() == ''){
  218. alert('请选择加班日期');
  219. return false;
  220. }
  221. }else if($('#selecttype').val() == 5){
  222. if($('#zhiban').val() == ''){
  223. alert('请选择值班日期');
  224. return false;
  225. }
  226. }else if($('#selecttype').val() == 13) {
  227. if ($('#tixian').val() == '') {
  228. alert('请输入提现天数');
  229. return false;
  230. }
  231. }
  232. }
  233. </script>
  234. </body>