index.html 4.7 KB

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