index.blade.php 11 KB

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