index.html 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166
  1. <div class="layui-fluid">
  2. <div class="layui-card">
  3. <div class="layui-form layui-form-pane layui-card-header layuiadmin-card-header-auto" lay-filter="LAY-outjob-list-search">
  4. <div class="layui-form-item">
  5. <div class="layui-inline">
  6. <label class="layui-form-label">岗位标题</label>
  7. <div class="layui-input-block">
  8. <input type="text" name="keywords" placeholder="请输入" autocomplete="off" class="layui-input">
  9. </div>
  10. </div>
  11. <div class="layui-inline">
  12. <label class="layui-form-label">状态</label>
  13. <div class="layui-input-block">
  14. <select name="status">
  15. <option value="">全部状态</option>
  16. <option value="1">审核通过</option>
  17. <option value="2">待审核</option>
  18. <option value="3">审核不通过</option>
  19. </select>
  20. </div>
  21. </div>
  22. <div class="layui-inline">
  23. <label class="layui-form-label">来源</label>
  24. <div class="layui-input-block">
  25. <select name="source">
  26. <option value="">全部</option>
  27. <option value="admin">总后台</option>
  28. <option value="worker">企业</option>
  29. </select>
  30. </div>
  31. </div>
  32. <div class="layui-inline">
  33. <button class="layui-btn" lay-submit lay-filter="LAY-outjob-list-btn">
  34. <i class="layui-icon layui-icon-search layuiadmin-button-btn"></i>
  35. </button>
  36. </div>
  37. </div>
  38. </div>
  39. <div class="layui-card-body">
  40. <div style="padding-bottom: 10px;">
  41. <button class="layui-btn layuiadmin-btn" data-type="add">添加</button>
  42. </div>
  43. <table id="LAY-outjob-list-table" lay-filter="LAY-outjob-list-table"></table>
  44. <script type="text/html" id="setTpl">
  45. <a class="layui-btn layui-btn-normal layui-btn-xs" lay-event="edit"><i class="layui-icon layui-icon-edit"></i>编辑</a>
  46. <a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="del"><i class="layui-icon layui-icon-delete"></i>删除</a>
  47. <a class="layui-btn layui-btn-normal layui-btn-xs" lay-event="report"><i class="layui-icon layui-icon-edit"></i>报备记录</a>
  48. </script>
  49. <script type="text/html" id="setSource">
  50. {{d.worker_id == 0 ? '总后台' : '企业'}}
  51. </script>
  52. </div>
  53. </div>
  54. </div>
  55. <script>
  56. layui.config({
  57. base: '/static/echoui/' //静态资源所在路径
  58. }).extend({
  59. index: 'lib/index' //主入口模块
  60. }).use(['index', 'form', 'set', 'laydate', 'table'], function() {
  61. var $ = layui.$,
  62. setter = layui.setter,
  63. admin = layui.admin,
  64. form = layui.form,
  65. table = layui.table;
  66. form.render();
  67. table.render({
  68. elem: '#LAY-outjob-list-table',
  69. url: setter.baseAdminUrl + 'outjob/index',
  70. cols: [
  71. [
  72. { field: 'id', width: 80, title: '表ID', sort: true },
  73. { field: 'title', title: '岗位标题', minWidth: 300},
  74. { field: 'company_name', title: '公司名称', width: 250 },
  75. { field: 'worker_id', title: '来源', minWidth: 80, toolbar: '#setSource'},
  76. { field: 'num', title: '招聘人数', width: 100 },
  77. { field: 'province', title: '省', width: 100 },
  78. { field: 'city', title: '市', width: 100 },
  79. { field: 'district', title: '区县', width: 100 },
  80. { field: 'address', title: '地址', width: 100 },
  81. { field: 'agegroup', title: '招工年龄', edit: 'text', width: 120 },
  82. { field: 'salary', title: '工资' },
  83. { field: 'telephone', title: '咨询电话'},
  84. { field: 'status_text', title: '状态', width: 80, align: 'center' },
  85. { field: 'volume', title: '浏览量', width: 100, align: 'right' },
  86. { field: 'priority', width: 100, title: '排序', sort: true},
  87. { title: '操作', width: 250, align: 'center', fixed: 'right', toolbar: '#setTpl' }
  88. ]
  89. ],
  90. page: true,
  91. limit: 50,
  92. toolbar: true,
  93. cellMinWidth: 150,
  94. text: '对不起,加载出现异常!'
  95. });
  96. form.on('submit(LAY-outjob-list-btn)', function(data) {
  97. table.reload('LAY-outjob-list-table', {
  98. where: data.field,
  99. page: {
  100. curr: 1
  101. }
  102. });
  103. });
  104. var active = {
  105. add: function() {
  106. var index = layer.open({
  107. type: 2,
  108. title: '添加招聘信息',
  109. content: 'recruitform.html?id=0',
  110. maxmin: true,
  111. area: ['750px', '480px']
  112. });
  113. layer.full(index);
  114. }
  115. };
  116. table.on('tool(LAY-outjob-list-table)', function(obj) {
  117. var data = obj.data;
  118. if (obj.event === 'del') {
  119. layer.confirm('确定删除此招聘信息吗?', function(index) {
  120. admin.req({
  121. url: setter.baseAdminUrl + 'outjob/delrecruit',
  122. data: {
  123. id: data.id
  124. },
  125. done: function(res) {
  126. obj.del();
  127. layer.msg('已删除');
  128. }
  129. });
  130. layer.close(index);
  131. });
  132. } else if (obj.event === 'edit') {
  133. var index = layer.open({
  134. type: 2,
  135. title: '编辑招聘信息',
  136. content: 'recruitform.html?id=' + data.id,
  137. maxmin: true,
  138. area: ['750px', '480px']
  139. });
  140. layer.full(index);
  141. }else if (obj.event === 'report') {
  142. var index = layer.open({
  143. type: 2,
  144. title: data.title + '的报备记录',
  145. content: 'report.html?id=' + data.id,
  146. maxmin: true,
  147. area: ['750px', '480px']
  148. });
  149. layer.full(index);
  150. }
  151. });
  152. $('.layui-btn.layuiadmin-btn').on('click', function() {
  153. var type = $(this).data('type');
  154. active[type] ? active[type].call(this) : '';
  155. });
  156. });
  157. </script>