index.blade.php 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209
  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('special.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;"><\/th>' +
  59. ' <\/tr>' +
  60. '<tr>' +
  61. ' <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>' +
  62. ' <td style="padding:8px 15px;"><input type="text" name="postname[]" value="" class="form-control postname" style="width:400px;" maxlength="80" ><\/td>' +
  63. ' <td style="padding:8px 15px;"><input type="text" name="postnumber[]" value="1" class="form-control postname" style="width:100px;" maxlength="80" ><\/td>' +
  64. ' <td style="padding:8px 15px;"><input type="text" name="postlimit[]" value="" class="form-control limit" style="width:400px;" ><\/td>'
  65. ;
  66. job_base += ' <\/select>' +
  67. ' <\/td>' +
  68. ' <td>' +
  69. ' <\/td>' +
  70. ' <\/tr>' +
  71. ' <\/table><\/div>';
  72. $("form .box-body .fields-group").append(job_base);
  73. }
  74. function editView() {
  75. 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>'
  76. 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>';
  77. job_base += '<div style="background:#F5F7F8;padding:20px;margin-left:20px; "><table id="post_table" border="0" cellpadding="15" cellspacing="3" >' +
  78. ' <tr >' +
  79. ' <th style="text-align: center;">岗位编号<\/th>' +
  80. ' <th style="text-align: center;">岗位名称<\/th>' +
  81. ' <th style="text-align: center;">限制条件<\/th>' +
  82. ' <th style="text-align: center;"><\/th>' +
  83. ' <\/tr>';
  84. for (var c = 0; c < post.length; c++) {
  85. job_base += '<tr>' +
  86. ' <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>' +
  87. ' <td style="padding:8px 15px;"><input type="text" name="postname[]" value="' + post[c].name + '" class="form-control postname" style="width:400px;" maxlength="80" ><\/td>' +
  88. ' <td style="padding:8px 15px;"><input type="text" name="postnumber[]" value="' + post[c].number + '" class="form-control postnumber" style="width:100px;" maxlength="80" ><\/td>' +
  89. ' <td style="padding:8px 15px;"><input type="text" id="post_' + post[c].id + '" name="postlimit[]" value="" class="form-control limit" style="width:400px;" ><\/td>'
  90. ;
  91. job_base += ' <\/select>' +
  92. ' <\/td>' +
  93. ' <td>' +
  94. ' <input type="button" onclick="deltr(this)"class="btn btn-danger" value="删除">' +
  95. ' <input type="hidden" class="btn btn-danger" name="postid_arr[]" value="' + post[c].id + '">' +
  96. ' <\/td>' +
  97. ' <\/tr>';
  98. }
  99. job_base += ' <\/table><\/div>';
  100. $("form .box-body .fields-group").append(job_base);
  101. for (var c = 0; c < post.length; c++) {
  102. $("#post_" + post[c].id).val(post[c].limit);
  103. }
  104. }
  105. function addPost() {
  106. var trtd = '<tr>' +
  107. ' <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>' +
  108. ' <td style="padding:8px 15px;"><input type="text" name="postname[]" value="" class="form-control postname" style="width:400px;" maxlength="80" ><\/td>' +
  109. ' <td style="padding:8px 15px;"><input type="text" name="postnumber[]" value="1" class="form-control postnumber" style="width:100px; " ><\/td>' +
  110. ' <td style="padding:8px 15px;"><input type="text" name="postlimit[]" value="" class="form-control limit" style="width:400px;" ><\/td>'
  111. ;
  112. trtd += ' <\/select>' +
  113. ' <\/td>' +
  114. ' <td><input type="button" onclick="deltr(this)"class="btn btn-danger" value="删除"><\/td>' +
  115. ' <\/tr>';
  116. var tables = $('#post_table');
  117. tables.append(trtd);
  118. }
  119. function deltr(obj) {
  120. $(obj).parent().parent().remove();
  121. }
  122. checkFlowPath();
  123. setInterval(function () {
  124. checkFlowPath();
  125. }, 250);
  126. //判断时间是否显示
  127. function checkFlowPath() {
  128. $('input[name="flow_path[]"]').each(function () {
  129. //笔试时间
  130. if ($(this).val() == 3) {
  131. if ($(this).is(":checked")) {
  132. $("input[name='preliminary_start']").parents(".form-group").css("display", "block");
  133. } else {
  134. $("input[name='preliminary_start']").parents(".form-group").css("display", "none");
  135. }
  136. }
  137. //上机时间
  138. if ($(this).val() == 4) {
  139. if ($(this).is(":checked")) {
  140. $("input[name='computer_start']").parents(".form-group").css("display", "block");
  141. } else {
  142. $("input[name='computer_start']").parents(".form-group").css("display", "none");
  143. }
  144. }
  145. //面试时间
  146. if ($(this).val() == 5) {
  147. if ($(this).is(":checked")) {
  148. $("input[name='interview_start']").parents(".form-group").css("display", "block");
  149. $("textarea[name='expand_id']").parents(".form-group").css("display", "block");
  150. } else {
  151. $("input[name='interview_start']").parents(".form-group").css("display", "none");
  152. $("textarea[name='expand_id']").parents(".form-group").css("display", "none");
  153. }
  154. }
  155. //复试时间
  156. if ($(this).val() == 6) {
  157. if ($(this).is(":checked")) {
  158. $("input[name='reexamine_start']").parents(".form-group").css("display", "block");
  159. } else {
  160. $("input[name='reexamine_start']").parents(".form-group").css("display", "none");
  161. }
  162. }
  163. //体检时间
  164. if ($(this).val() == 7) {
  165. if ($(this).is(":checked")) {
  166. $("input[name='health_start']").parents(".form-group").css("display", "block");
  167. } else {
  168. $("input[name='health_start']").parents(".form-group").css("display", "none");
  169. }
  170. }
  171. })
  172. }
  173. function getCookie(name) {
  174. var arr, reg = new RegExp("(^| )" + name + "=([^;]*)(;|$)");
  175. if (arr = document.cookie.match(reg)) {
  176. return unescape(arr[2]);
  177. } else
  178. return null;
  179. }
  180. function setCookie(name, value) {
  181. var Days = 60000;
  182. var exp = new Date();
  183. exp.setTime(exp.getTime() + Days * 24 * 60 * 60 * 1000);
  184. document.cookie = name + "=" + escape(value) + ";expires=" + exp.toGMTString();
  185. }
  186. </script>