index.blade.php 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213
  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. $(document).ready(function () {
  9. $("#preview").on('click',function () {
  10. let num = $("#forms").find(".checked").length;
  11. if(num == 0){
  12. alert("未选中报名表单模块");
  13. return false;
  14. }
  15. let modules = new Array();
  16. $.each($("#forms").find(".checked"),function(index,item){
  17. modules.push($(item).children("input").val())
  18. });
  19. window.open("https://www.jucai.gov.cn/recruit/preview?modules="+modules.join(','));
  20. return false;
  21. });
  22. });
  23. var admin = null;
  24. var paper = null;
  25. var post = null;
  26. var id = {{$id}}
  27. $(function () {
  28. getAdmin();
  29. });
  30. function getAdmin() {
  31. if (id !== 0) {
  32. getPost()
  33. } else {
  34. getView()
  35. }
  36. }
  37. function getPost() {
  38. if (this.post === null) {
  39. $.ajax({
  40. url: "{{route('recruit.getRecruitPost')}}",
  41. data: {id: id,_token:'{{csrf_token()}}'},
  42. success: function ($data) {
  43. post = $data.post;
  44. editView()
  45. },
  46. });
  47. }
  48. }
  49. function getView() {
  50. 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>'
  51. 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>';
  52. job_base += '<div style="background:#F5F7F8;padding:20px;margin-left:20px; "><table id="post_table" border="0" cellpadding="15" cellspacing="3" >' +
  53. ' <tr >' +
  54. ' <th style="text-align: center;">岗位编号<\/th>' +
  55. ' <th style="text-align: center;">岗位名称<\/th>' +
  56. ' <th style="text-align: center;">招聘人数<\/th>' +
  57. ' <th style="text-align: center;">岗位限制条件(JSON格式)<\/th>' +
  58. ' <th style="text-align: center;">岗位加分项(JSON格式)<\/th>' +
  59. ' <th style="text-align: center;"><\/th>' +
  60. ' <\/tr>' +
  61. '<tr>' +
  62. ' <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>' +
  63. ' <td style="padding:8px 15px;"><input type="text" name="postname[]" value="" class="form-control postname" style="width:400px;" maxlength="80" ><\/td>' +
  64. ' <td style="padding:8px 15px;"><input type="text" name="postnumber[]" value="1" class="form-control postname" style="width:100px;" maxlength="80" ><\/td>' +
  65. ' <td style="padding:8px 15px;"><input type="text" name="postlimit[]" value="" class="form-control limit" style="width:400px;" ><\/td>'+
  66. ' <td style="padding:8px 15px;"><input type="text" name="postspecial[]" value="" class="form-control special" style="width:400px;" ><\/td>'
  67. ;
  68. job_base += ' <\/select>' +
  69. ' <\/td>' +
  70. ' <td>' +
  71. ' <\/td>' +
  72. ' <\/tr>' +
  73. ' <\/table><\/div>';
  74. $("form .box-body .fields-group").append(job_base);
  75. }
  76. function editView() {
  77. 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>'
  78. 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>';
  79. job_base += '<div style="background:#F5F7F8;padding:20px;margin-left:20px; "><table id="post_table" border="0" cellpadding="15" cellspacing="3" >' +
  80. ' <tr >' +
  81. ' <th style="text-align: center;">岗位编号<\/th>' +
  82. ' <th style="text-align: center;">岗位名称<\/th>' +
  83. ' <th style="text-align: center;">招聘人数<\/th>' +
  84. ' <th style="text-align: center;">限制条件<\/th>' +
  85. ' <th style="text-align: center;">岗位加分项,多个条件用,隔开<\/th>' +
  86. ' <th style="text-align: center;"><\/th>' +
  87. ' <\/tr>';
  88. for (var c = 0; c < post.length; c++) {
  89. job_base += '<tr>' +
  90. ' <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>' +
  91. ' <td style="padding:8px 15px;"><input type="text" name="postname[]" value="' + post[c].name + '" class="form-control postname" style="width:400px;" maxlength="80" ><\/td>' +
  92. ' <td style="padding:8px 15px;"><input type="text" name="postnumber[]" value="' + post[c].number + '" class="form-control postnumber" style="width:100px;" maxlength="80" ><\/td>' +
  93. ' <td style="padding:8px 15px;"><input type="text" id="post_' + post[c].id + '" name="postlimit[]" value="" class="form-control limit" style="width:400px;" ><\/td>' +
  94. ' <td style="padding:8px 15px;"><input type="text" id="post_' + post[c].id + '" name="postspecial[]" value="' + post[c].special + '" class="form-control special" style="width:400px;" ><\/td>'
  95. ;
  96. job_base += ' <\/select>' +
  97. ' <\/td>' +
  98. ' <td>' +
  99. ' <input type="button" onclick="deltr(this)"class="btn btn-danger" value="删除">' +
  100. ' <input type="hidden" class="btn btn-danger" name="postid_arr[]" value="' + post[c].id + '">' +
  101. ' <\/td>' +
  102. ' <\/tr>';
  103. }
  104. job_base += ' <\/table><\/div>';
  105. $("form .box-body .fields-group").append(job_base);
  106. for (var c = 0; c < post.length; c++) {
  107. $("#post_" + post[c].id).val(post[c].limit);
  108. }
  109. }
  110. function addPost() {
  111. var trtd = '<tr>' +
  112. ' <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>' +
  113. ' <td style="padding:8px 15px;"><input type="text" name="postname[]" value="" class="form-control postname" style="width:400px;" maxlength="80" ><\/td>' +
  114. ' <td style="padding:8px 15px;"><input type="text" name="postnumber[]" value="1" class="form-control postnumber" style="width:100px; " ><\/td>' +
  115. ' <td style="padding:8px 15px;"><input type="text" name="postlimit[]" value="" class="form-control limit" style="width:400px;" ><\/td>' +
  116. ' <td style="padding:8px 15px;"><input type="text" name="postspecial[]" value="" class="form-control special" style="width:400px;" ><\/td>' +
  117. ' <td><input type="button" onclick="deltr(this)"class="btn btn-danger" value="删除"><\/td>' +
  118. ' <\/tr>'
  119. ;
  120. var tables = $('#post_table');
  121. tables.append(trtd);
  122. }
  123. function deltr(obj) {
  124. $(obj).parent().parent().remove();
  125. }
  126. checkFlowPath();
  127. setInterval(function () {
  128. checkFlowPath();
  129. }, 250);
  130. //判断时间是否显示
  131. function checkFlowPath() {
  132. $('input[name="flow_path[]"]').each(function () {
  133. //笔试时间
  134. if ($(this).val() == 3) {
  135. if ($(this).is(":checked")) {
  136. $("input[name='preliminary_start']").parents(".form-group").css("display", "block");
  137. } else {
  138. $("input[name='preliminary_start']").parents(".form-group").css("display", "none");
  139. }
  140. }
  141. //上机时间
  142. if ($(this).val() == 4) {
  143. if ($(this).is(":checked")) {
  144. $("input[name='computer_start']").parents(".form-group").css("display", "block");
  145. } else {
  146. $("input[name='computer_start']").parents(".form-group").css("display", "none");
  147. }
  148. }
  149. //面试时间
  150. if ($(this).val() == 5) {
  151. if ($(this).is(":checked")) {
  152. $("input[name='interview_start']").parents(".form-group").css("display", "block");
  153. $("textarea[name='expand_id']").parents(".form-group").css("display", "block");
  154. } else {
  155. $("input[name='interview_start']").parents(".form-group").css("display", "none");
  156. $("textarea[name='expand_id']").parents(".form-group").css("display", "none");
  157. }
  158. }
  159. //复试时间
  160. if ($(this).val() == 6) {
  161. if ($(this).is(":checked")) {
  162. $("input[name='reexamine_start']").parents(".form-group").css("display", "block");
  163. } else {
  164. $("input[name='reexamine_start']").parents(".form-group").css("display", "none");
  165. }
  166. }
  167. //体检时间
  168. if ($(this).val() == 7) {
  169. if ($(this).is(":checked")) {
  170. $("input[name='health_start']").parents(".form-group").css("display", "block");
  171. } else {
  172. $("input[name='health_start']").parents(".form-group").css("display", "none");
  173. }
  174. }
  175. })
  176. }
  177. function getCookie(name) {
  178. var arr, reg = new RegExp("(^| )" + name + "=([^;]*)(;|$)");
  179. if (arr = document.cookie.match(reg)) {
  180. return unescape(arr[2]);
  181. } else
  182. return null;
  183. }
  184. function setCookie(name, value) {
  185. var Days = 60000;
  186. var exp = new Date();
  187. exp.setTime(exp.getTime() + Days * 24 * 60 * 60 * 1000);
  188. document.cookie = name + "=" + escape(value) + ";expires=" + exp.toGMTString();
  189. }
  190. </script>