index.blade.php 9.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186
  1. {!! $grid !!}
  2. <link rel="stylesheet" href="{{ theme_asset('app/css/viewer.min.css') }}">
  3. <script type="text/javascript" src="{{ theme_asset('app/js/viewer-jquery.min.js') }}"></script>
  4. <script>
  5. //报名审核必选
  6. $("input[name='flow_path[]']").eq(0).attr("disabled", true);
  7. $("input[name='flow_path[]']").eq(1).attr("disabled", true);
  8. var admin = null;
  9. var paper = null;
  10. var post = null;
  11. var id = {{$id}}
  12. $(function () {
  13. getAdmin();
  14. });
  15. function getAdmin() {
  16. if (id !== 0) {
  17. getPost()
  18. } else {
  19. getView()
  20. }
  21. }
  22. function getPost() {
  23. if (this.post === null) {
  24. $.ajax({
  25. url: "{{route('recruit.getRecruitPost')}}",
  26. data: {id: id,_token:'{{csrf_token()}}'},
  27. success: function ($data) {
  28. post = $data.post;
  29. editView()
  30. },
  31. });
  32. }
  33. }
  34. function getView() {
  35. var job_base = '<div style=" font-weight:700;padding-left:20px;border-bottom:1px #DFEDF7 solid;border-top:1px #DFEDF7 solid;background-color:#F0F8FD;height:30px;line-height:30px;margin-bottom:15px;"><span style="color:#f00">*<\/span>招考岗位<\/div>'
  36. job_base += '<div style="margin-left:20px;margin-bottom:15px;"><input type="button" id="add_post" onclick="addPost()" class="btn btn-warning" value="增行"><span>&nbsp;(注:岗位编号为一位或两位数字)<\/span><\/div>';
  37. job_base += '<div style="background:#F5F7F8;padding:20px;margin-left:20px; "><table id="post_table" border="0" cellpadding="15" cellspacing="3" >' +
  38. ' <tr >' +
  39. ' <th style="text-align: center;">岗位编号<\/th>' +
  40. ' <th style="text-align: center;">岗位名称<\/th>' +
  41. ' <th style="text-align: center;">岗位限制条件(JSON格式)<\/th>' +
  42. ' <th style="text-align: center;"><\/th>' +
  43. ' <\/tr>' +
  44. '<tr>' +
  45. ' <td style="padding:8px 15px;"><input type="text" name="postcode[]" value="" class="form-control postcode" style="width:100px; " onkeyup="value=value.replace(/[^\\d.]/g,\'\')" ><\/td>' +
  46. ' <td style="padding:8px 15px;"><input type="text" name="postname[]" value="" class="form-control postname" style="width:400px;" maxlength="80" ><\/td>' +
  47. ' <td style="padding:8px 15px;"><input type="text" name="postlimit[]" value="" class="form-control limit" style="width:400px;" ><\/td>'
  48. ;
  49. job_base += ' <\/select>' +
  50. ' <\/td>' +
  51. ' <td>' +
  52. ' <\/td>' +
  53. ' <\/tr>' +
  54. ' <\/table><\/div>';
  55. $("form .box-body .fields-group").append(job_base);
  56. }
  57. function editView() {
  58. var job_base = '<div style=" font-weight:700;padding-left:20px;border-bottom:1px #DFEDF7 solid;border-top:1px #DFEDF7 solid;background-color:#F0F8FD;height:30px;line-height:30px;margin-bottom:15px;"><span style="color:#f00">*<\/span>招考岗位<\/div>'
  59. job_base += '<div style="margin-left:20px;margin-bottom:15px;"><input type="button" id="add_post" onclick="addPost()" class="btn btn-warning" value="增行"><span>&nbsp;(注:岗位编号为一位或两位数字)<\/span><\/div>';
  60. job_base += '<div style="background:#F5F7F8;padding:20px;margin-left:20px; "><table id="post_table" border="0" cellpadding="15" cellspacing="3" >' +
  61. ' <tr >' +
  62. ' <th style="text-align: center;">岗位编号<\/th>' +
  63. ' <th style="text-align: center;">岗位名称<\/th>' +
  64. ' <th style="text-align: center;">限制条件<\/th>' +
  65. ' <th style="text-align: center;"><\/th>' +
  66. ' <\/tr>';
  67. for (var c = 0; c < post.length; c++) {
  68. job_base += '<tr>' +
  69. ' <td style="padding:8px 15px;"><input type="text" name="postcode[]" value="' + post[c].code + '" class="form-control postcode" style="width:100px; " onkeyup="value=value.replace(/[^\\d.]/g,\'\')" ><\/td>' +
  70. ' <td style="padding:8px 15px;"><input type="text" name="postname[]" value="' + post[c].name + '" class="form-control postname" style="width:400px;" maxlength="80" ><\/td>' +
  71. ' <td style="padding:8px 15px;"><input type="text" id="post_' + post[c].id + '" name="postlimit[]" value="" class="form-control limit" style="width:400px;" ><\/td>'
  72. ;
  73. job_base += ' <\/select>' +
  74. ' <\/td>' +
  75. ' <td>' +
  76. ' <input type="button" onclick="deltr(this)"class="btn btn-danger" value="删除">' +
  77. ' <input type="hidden" class="btn btn-danger" name="postid_arr[]" value="' + post[c].id + '">' +
  78. ' <\/td>' +
  79. ' <\/tr>';
  80. }
  81. job_base += ' <\/table><\/div>';
  82. $("form .box-body .fields-group").append(job_base);
  83. for (var c = 0; c < post.length; c++) {
  84. $("#post_" + post[c].id).val(post[c].limit);
  85. }
  86. }
  87. function addPost() {
  88. var trtd = '<tr>' +
  89. ' <td style="padding:8px 15px;"><input type="text" name="postcode[]" value="" class="form-control postcode" style="width:100px; " onkeyup="value=value.replace(/[^\\d.]/g,\'\')" ><\/td>' +
  90. ' <td style="padding:8px 15px;"><input type="text" name="postname[]" value="" class="form-control postname" style="width:400px;" maxlength="80" ><\/td>' +
  91. ' <td style="padding:8px 15px;"><input type="text" name="postlimit[]" value="" class="form-control limit" style="width:400px;" ><\/td>'
  92. ;
  93. trtd += ' <\/select>' +
  94. ' <\/td>' +
  95. ' <td><input type="button" onclick="deltr(this)"class="btn btn-danger" value="删除"><\/td>' +
  96. ' <\/tr>';
  97. var tables = $('#post_table');
  98. tables.append(trtd);
  99. }
  100. function deltr(obj) {
  101. $(obj).parent().parent().remove();
  102. }
  103. checkFlowPath();
  104. setInterval(function () {
  105. checkFlowPath();
  106. }, 250);
  107. //判断时间是否显示
  108. function checkFlowPath() {
  109. $('input[name="flow_path[]"]').each(function () {
  110. //笔试时间
  111. if ($(this).val() == 3) {
  112. if ($(this).is(":checked")) {
  113. $("input[name='preliminary_start']").parents(".form-group").css("display", "block");
  114. } else {
  115. $("input[name='preliminary_start']").parents(".form-group").css("display", "none");
  116. }
  117. }
  118. //上机时间
  119. if ($(this).val() == 4) {
  120. if ($(this).is(":checked")) {
  121. $("input[name='computer_start']").parents(".form-group").css("display", "block");
  122. } else {
  123. $("input[name='computer_start']").parents(".form-group").css("display", "none");
  124. }
  125. }
  126. //面试时间
  127. if ($(this).val() == 5) {
  128. if ($(this).is(":checked")) {
  129. $("input[name='interview_start']").parents(".form-group").css("display", "block");
  130. $("textarea[name='expand_id']").parents(".form-group").css("display", "block");
  131. } else {
  132. $("input[name='interview_start']").parents(".form-group").css("display", "none");
  133. $("textarea[name='expand_id']").parents(".form-group").css("display", "none");
  134. }
  135. }
  136. //复试时间
  137. if ($(this).val() == 6) {
  138. if ($(this).is(":checked")) {
  139. $("input[name='reexamine_start']").parents(".form-group").css("display", "block");
  140. } else {
  141. $("input[name='reexamine_start']").parents(".form-group").css("display", "none");
  142. }
  143. }
  144. //体检时间
  145. if ($(this).val() == 7) {
  146. if ($(this).is(":checked")) {
  147. $("input[name='health_start']").parents(".form-group").css("display", "block");
  148. } else {
  149. $("input[name='health_start']").parents(".form-group").css("display", "none");
  150. }
  151. }
  152. })
  153. }
  154. function getCookie(name) {
  155. var arr, reg = new RegExp("(^| )" + name + "=([^;]*)(;|$)");
  156. if (arr = document.cookie.match(reg)) {
  157. return unescape(arr[2]);
  158. } else
  159. return null;
  160. }
  161. function setCookie(name, value) {
  162. var Days = 60000;
  163. var exp = new Date();
  164. exp.setTime(exp.getTime() + Days * 24 * 60 * 60 * 1000);
  165. document.cookie = name + "=" + escape(value) + ";expires=" + exp.toGMTString();
  166. }
  167. </script>