index.php 7.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179
  1. {extend name="public/container"}
  2. {block name="content"}
  3. <div class="layui-fluid">
  4. <div class="layui-row layui-col-space15" id="app">
  5. <div class="layui-col-md12">
  6. </div>
  7. <div class="ibox-title">
  8. <div class="input-group">
  9. <select name="audit_status" id="audit_status" aria-controls="editable" class="input-sm">
  10. <option value="-1">全部</option>
  11. <option value="0">待审核</option>
  12. <option value="1">通过</option>
  13. <option value="2">拒绝</option>
  14. </select>&nbsp;
  15. <input type="text" name="apply_user_name" id="apply_user_name" placeholder="请输入姓名"
  16. class="input-sm">&nbsp;
  17. <button id="btn-query" type="button" class="btn btn-sm btn-primary">查询</button>
  18. </div>
  19. </div>
  20. <div class="layui-col-md12">
  21. <div class="layui-card">
  22. <div class="layui-card-header">申请列表</div>
  23. <div class="layui-card-body">
  24. <table class="layui-hide" id="List" lay-filter="List"></table>
  25. <script type="text/html" id="dj">
  26. {{# if(d.audit_status == 0){ }}
  27. <button type="button" class="layui-btn layui-btn-xs" lay-event='pass'>
  28. <a lay-event='edit' style="color: #fff !important;" href="javascript:void(0)">
  29. <text>审核</text>
  30. </a>
  31. </button>
  32. {{# }else { }}
  33. <button id="msgBtn" type="button" class="layui-btn layui-btn-xs" lay-event='pass'>
  34. <a lay-event='remark' style="color: #fff !important;" href="javascript:void(0)">
  35. <text>备注信息</text>
  36. </a>
  37. </button>
  38. {{# } }}
  39. <button type="button" class="layui-btn layui-btn-xs" lay-event='pass'>
  40. <a lay-event='freeze' style="color: #fff !important;" href="javascript:void(0)">
  41. <text>删除</text>
  42. </a>
  43. </button>
  44. </script>
  45. </div>
  46. </div>
  47. </div>
  48. </div>
  49. </div>
  50. <script src="{__ADMIN_PATH}js/layuiList.js"></script>
  51. {/block}
  52. {block name="script"}
  53. <script>
  54. //实例化form
  55. layList.form.render();
  56. //加载列表
  57. let tableIns = layList.tableList('List', "{:Url('get_apply_list')}", function () {
  58. return [
  59. {field: 'id', title: '编号', sort: true, event: 'id', width: '6%', align: "center"},
  60. {field: 'companyName', title: '企业名称', align: "center"},
  61. {field: 'apply_user_nickname', title: '昵称', align: "center", width: '12%'},
  62. {field: 'apply_user_name', title: '申请人姓名', align: "center", width: '12%'},
  63. {field: 'apply_user_mobile', title: '申请人手机', align: "center", width: '12%'},
  64. {field: 'job_name', title: '申请的职务', align: "center", width: '12%'},
  65. {
  66. field: 'audit_status', title: '状态', align: "center", width: '6%', templet: function (d) {
  67. let status = {
  68. 0: '未审核',
  69. 1: '通过',
  70. 2: '拒绝',
  71. };
  72. return status[d.audit_status];
  73. }
  74. },
  75. {field: 'add_time', title: '申请时间', align: "center", width: '10%'},
  76. {field: 'right', title: '操作', align: 'center', toolbar: '#dj', width: '16%'},
  77. ];
  78. });
  79. $('#btn-query').click(function (e) {
  80. var apply_user_name = $('#apply_user_name').val();
  81. var audit_status = $('#audit_status').val();
  82. tableIns.reload({
  83. page: {
  84. curr: 1 //重新从第 1 页开始
  85. }
  86. , url: "{:Url('get_apply_list')}?apply_user_name=" + apply_user_name + "&audit_status=" + audit_status
  87. , method: 'get'
  88. });
  89. });
  90. //自定义方法
  91. var action = {
  92. set_value: function (field, id, value) {
  93. layList.baseGet(layList.Url({
  94. a: 'set_value',
  95. q: {field: field, id: id, value: value}
  96. }), function (res) {
  97. layList.msg(res.msg);
  98. });
  99. },
  100. }
  101. $('.add-filed').on('click', function (e) {
  102. $eb.createModalFrame(this.innerText, "{:Url('create')}");
  103. })
  104. //快速编辑
  105. layList.edit(function (obj) {
  106. // var id=obj.data.id,value=obj.value;
  107. // switch (obj.field) {
  108. // case 'name':
  109. // action.set_value('name',id,value);
  110. // break;
  111. // case 'grade':
  112. // action.set_value('grade',id,value);
  113. // break;
  114. // case 'discount':
  115. // action.set_value('discount',id,value);
  116. // break;
  117. // }
  118. });
  119. //监听并执行排序
  120. layList.sort(['id', 'sort'], true);
  121. //点击事件绑定
  122. layList.tool(function (event, data, obj) {
  123. switch (event) {
  124. case 'isput':
  125. var url = layList.U({a: 'isShow', q: {id: data.id}});
  126. $eb.axios.get(url).then(function (res) {
  127. if (res.status == 200 && res.data.code == 200) {
  128. $eb.$swal('success', res.data.msg || '推荐成功');
  129. layList.reload();
  130. } else
  131. return Promise.reject(res.data.msg || '推荐失败')
  132. }).catch(function (err) {
  133. $eb.$swal('error', err);
  134. });
  135. break;
  136. case 'freeze':
  137. var url = layList.U({a: 'isDel', q: {id: data.id}});
  138. $eb.axios.get(url).then(function (res) {
  139. if (res.status == 200 && res.data.code == 200) {
  140. $eb.$swal('success', res.data.msg || '成功');
  141. layList.reload();
  142. } else
  143. return Promise.reject(res.data.msg || '失败')
  144. }).catch(function (err) {
  145. $eb.$swal('error', err);
  146. });
  147. break;
  148. case 'edit':
  149. $eb.createModalFrame("审核", "{:Url('auditPage')}?id=" + data.id, {w: '40%', h: '35%'});
  150. break;
  151. case 'remark':
  152. let text;
  153. if (data.audit_status == 1) {
  154. text = data.pass_text;
  155. } else {
  156. text = data.fail_text;
  157. }
  158. if (!text) {
  159. text = '没有备注信息';
  160. }
  161. layer.open({
  162. title: '备注',
  163. type: 1,
  164. skin: 'layui-layer-rim', //加上边框
  165. area: ['35%', '30%'], //宽高
  166. content: text
  167. });
  168. break;
  169. case 'open_image':
  170. $eb.openImage(data.headimg);
  171. break;
  172. }
  173. })
  174. </script>
  175. {/block}