index.blade.php 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214
  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;">岗位加分项(JSON格式)<\/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 + '_limit" 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 + '_special" name="postspecial[]" value="" 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 + '_limit').val(post[c].limit);
  108. $("#post_" + post[c].id + '_special').val(post[c].special);
  109. }
  110. }
  111. function addPost() {
  112. var trtd = '<tr>' +
  113. ' <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>' +
  114. ' <td style="padding:8px 15px;"><input type="text" name="postname[]" value="" class="form-control postname" style="width:400px;" maxlength="80" ><\/td>' +
  115. ' <td style="padding:8px 15px;"><input type="text" name="postnumber[]" value="1" class="form-control postnumber" style="width:100px; " ><\/td>' +
  116. ' <td style="padding:8px 15px;"><input type="text" name="postlimit[]" value="" class="form-control limit" style="width:400px;" ><\/td>' +
  117. ' <td style="padding:8px 15px;"><input type="text" name="postspecial[]" value="" class="form-control special" style="width:400px;" ><\/td>' +
  118. ' <td><input type="button" onclick="deltr(this)"class="btn btn-danger" value="删除"><\/td>' +
  119. ' <\/tr>'
  120. ;
  121. var tables = $('#post_table');
  122. tables.append(trtd);
  123. }
  124. function deltr(obj) {
  125. $(obj).parent().parent().remove();
  126. }
  127. checkFlowPath();
  128. setInterval(function () {
  129. checkFlowPath();
  130. }, 250);
  131. //判断时间是否显示
  132. function checkFlowPath() {
  133. $('input[name="flow_path[]"]').each(function () {
  134. //笔试时间
  135. if ($(this).val() == 3) {
  136. if ($(this).is(":checked")) {
  137. $("input[name='preliminary_start']").parents(".form-group").css("display", "block");
  138. } else {
  139. $("input[name='preliminary_start']").parents(".form-group").css("display", "none");
  140. }
  141. }
  142. //上机时间
  143. if ($(this).val() == 4) {
  144. if ($(this).is(":checked")) {
  145. $("input[name='computer_start']").parents(".form-group").css("display", "block");
  146. } else {
  147. $("input[name='computer_start']").parents(".form-group").css("display", "none");
  148. }
  149. }
  150. //面试时间
  151. if ($(this).val() == 5) {
  152. if ($(this).is(":checked")) {
  153. $("input[name='interview_start']").parents(".form-group").css("display", "block");
  154. $("textarea[name='expand_id']").parents(".form-group").css("display", "block");
  155. } else {
  156. $("input[name='interview_start']").parents(".form-group").css("display", "none");
  157. $("textarea[name='expand_id']").parents(".form-group").css("display", "none");
  158. }
  159. }
  160. //复试时间
  161. if ($(this).val() == 6) {
  162. if ($(this).is(":checked")) {
  163. $("input[name='reexamine_start']").parents(".form-group").css("display", "block");
  164. } else {
  165. $("input[name='reexamine_start']").parents(".form-group").css("display", "none");
  166. }
  167. }
  168. //体检时间
  169. if ($(this).val() == 7) {
  170. if ($(this).is(":checked")) {
  171. $("input[name='health_start']").parents(".form-group").css("display", "block");
  172. } else {
  173. $("input[name='health_start']").parents(".form-group").css("display", "none");
  174. }
  175. }
  176. })
  177. }
  178. function getCookie(name) {
  179. var arr, reg = new RegExp("(^| )" + name + "=([^;]*)(;|$)");
  180. if (arr = document.cookie.match(reg)) {
  181. return unescape(arr[2]);
  182. } else
  183. return null;
  184. }
  185. function setCookie(name, value) {
  186. var Days = 60000;
  187. var exp = new Date();
  188. exp.setTime(exp.getTime() + Days * 24 * 60 * 60 * 1000);
  189. document.cookie = name + "=" + escape(value) + ";expires=" + exp.toGMTString();
  190. }
  191. </script>