holiday-vacation.html 6.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208
  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="#addVacation" 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><select><option>2017</option></select> <select><option>1月</option><option>2月</option></select></li>-->
  33. </ul>
  34. </div>
  35. <div class="saeaList">
  36. <div class="entry">
  37. <table class="table table-bordered table-condensed table-hover">
  38. <tbody>
  39. <tr>
  40. <th class="taC" width="50"></th>
  41. <th class="taC">员工</th>
  42. <th class="taC">年假周期</th>
  43. <th class="taC">年假<sub>(可用)</sub></th>
  44. <th class="taC">婚假<sub>(可用)</sub></th>
  45. <th class="taC">产假<sub>(可用)</sub></th>
  46. <!--<th class="taC">存假<sub>(可用)</sub></th>-->
  47. <th class="taC">丧假<sub>(可用)</sub></th>
  48. <th class="taC">工伤假<sub>(可用)</sub></th>
  49. </tr>
  50. <!-- loop stafflist -->
  51. <!-- loop stafflist' value.cidstafflist -->
  52. <tr>
  53. <!-- if !empty({{stafflist' cidstafflist' value.first}}) -->
  54. <th rowspan="{{stafflist' value.count}}">{{stafflist' value.categoryname}}</th>
  55. <!-- endif -->
  56. <th>{{stafflist' cidstafflist' value.username}}</th>
  57. <td class="taC">{{stafflist' cidstafflist' value.yearround}}</td>
  58. <td class="taC">{{stafflist' cidstafflist' value.yearnum}}</td>
  59. <td class="taC">{{stafflist' cidstafflist' value.hunjianum}}</td>
  60. <td class="taC">{{stafflist' cidstafflist' value.chanjianum}}</td>
  61. <td class="taC">{{stafflist' cidstafflist' value.sangjianum}}</td>
  62. <td class="taC">{{stafflist' cidstafflist' value.gongjianum}}</td>
  63. <!--<td class="taC">{{stafflist' cidstafflist' value.username}}</td>-->
  64. </tr>
  65. <!-- endloop -->
  66. <!-- endloop -->
  67. </tbody>
  68. </table>
  69. </div>
  70. </div>
  71. </div>
  72. </div>
  73. </div>
  74. <!--弹出-->
  75. <div class="modal hide fade" id="addVacation">
  76. <div class="modal-dialog ">
  77. <div class="modal-content">
  78. <div class="modal-header">
  79. <h3>休假登记</h3>
  80. </div>
  81. <form action="/setstaffholiday" method="post" onsubmit="return setholidaynum();">
  82. <div class="modal-body saeaList">
  83. <table class="table table-bordered table-condensed">
  84. <tbody>
  85. <tr>
  86. <th class="taC" width="100"><span class="colRed">*</span>员工</th>
  87. <td>
  88. <select id="category">
  89. <!-- loop category -->
  90. <option value="{{category' value.cid}}">{{category' value.title}}</option>
  91. <!-- endloop -->
  92. </select>
  93. <select id="cidstaff" name="uid">
  94. <option value="0">选择员工</option>
  95. <!-- loop zongbu -->
  96. <option value="{{zongbu' value.sid}}">{{zongbu' value.username}}</option>
  97. <!-- endloop -->
  98. </select>
  99. </td>
  100. </tr>
  101. <tr>
  102. <th class="taC" width="100"><span class="colRed">*</span>登记类型</th>
  103. <td>
  104. <select id="selectholiday" name="typeholiday">
  105. <option value="yearnum">年假</option>
  106. <option value="hunjianum">婚假</option>
  107. <option value="chanjianum">产假</option>
  108. <option value="sangjianum">丧假</option>
  109. <option value="gongjianum">工伤假</option>
  110. </select>
  111. </td>
  112. </tr>
  113. <tr>
  114. <th class="taC" width="100">当前天数</th><td><span id="thisnum">{{thisnum}}</span> 天</td>
  115. </tr>
  116. <tr>
  117. <th class="taC" width="100"><span class="colRed">*</span>增加天数</th><td><input placeholder="请输入天数" id="addnum" name="addnum" type="number" step="0.5"></td>
  118. </tr>
  119. <tr>
  120. <th class="taC" width="100">备注</th><td><textarea class="span4" name="description" placeholder="选填"></textarea></td>
  121. </tr>
  122. </tbody>
  123. </table>
  124. </div>
  125. <div class="modal-footer">
  126. <a href="#" class="button btn-gray" data-dismiss="modal" aria-hidden="true">取消</a>
  127. <button type="submit" class="button">确定</button>
  128. </div>
  129. </form>
  130. </div>
  131. </div>
  132. </div>
  133. <!--弹出内容-->
  134. <script type="text/javascript">autoFlashHeight();</script>
  135. <script>
  136. $(function(){
  137. $('#selectcid').change(function(){
  138. var html = '';
  139. if($(this).val() != 'all'){
  140. html += '/'+$(this).val();
  141. }
  142. window.location.href = '/holidayvacation'+html;
  143. });
  144. $('#category').change(function(){
  145. $.ajax({
  146. type: 'post',
  147. url: '/getstaffcategory',
  148. data: {cid:$(this).val()},
  149. dataType: 'json',
  150. success: function(result){
  151. if(result.code == 200){
  152. $('#cidstaff').html('');
  153. var html = '<option value="0">选择员工</option>';
  154. $.each(result.stafflist,function(k,v){
  155. html +='<option value="'+v.sid+'">'+v.username+'</option>';
  156. });
  157. $('#cidstaff').html(html);
  158. $('#selectholiday option[value="yearnum"]').prop('selected',true);
  159. $('#thisnum').text(result.thisnum);
  160. }
  161. }
  162. })
  163. });
  164. $('#cidstaff').change(function(){
  165. $.ajax({
  166. type: 'post',
  167. url: '/getholidaystaff',
  168. data: {uid:$(this).val(),type:$('#selectholiday').val()},
  169. dataType: 'json',
  170. success: function(result){
  171. if(result.code == 200){
  172. $('#thisnum').text(0);
  173. $('#thisnum').text(result.thisnum);
  174. }
  175. }
  176. })
  177. });
  178. $('#selectholiday').change(function(){
  179. $.ajax({
  180. type: 'post',
  181. url: '/getholidaystaff',
  182. data: {uid:$('#cidstaff').val(),type:$(this).val()},
  183. dataType: 'json',
  184. success: function(result){
  185. if(result.code == 200){
  186. $('#thisnum').text(0);
  187. $('#thisnum').text(result.thisnum);
  188. }
  189. }
  190. })
  191. });
  192. });
  193. function setholidaynum(){
  194. if($('#cidstaff').val() == 0){
  195. alert('请选择员工');
  196. return false;
  197. }
  198. if($('#addnum').val() == ''){
  199. alert('请输入增加天数');
  200. return false;
  201. }
  202. }
  203. </script>
  204. </body>
  205. </html>