123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179 |
- {extend name="public/container"}
- {block name="content"}
- <div class="layui-fluid">
- <div class="layui-row layui-col-space15" id="app">
- <div class="layui-col-md12">
- </div>
- <div class="ibox-title">
- <div class="input-group">
- <select name="audit_status" id="audit_status" aria-controls="editable" class="input-sm">
- <option value="-1">全部</option>
- <option value="0">待审核</option>
- <option value="1">通过</option>
- <option value="2">拒绝</option>
- </select>
- <input type="text" name="apply_user_name" id="apply_user_name" placeholder="请输入姓名"
- class="input-sm">
- <button id="btn-query" type="button" class="btn btn-sm btn-primary">查询</button>
- </div>
- </div>
- <div class="layui-col-md12">
- <div class="layui-card">
- <div class="layui-card-header">申请列表</div>
- <div class="layui-card-body">
- <table class="layui-hide" id="List" lay-filter="List"></table>
- <script type="text/html" id="dj">
- {{# if(d.audit_status == 0){ }}
- <button type="button" class="layui-btn layui-btn-xs" lay-event='pass'>
- <a lay-event='edit' style="color: #fff !important;" href="javascript:void(0)">
- <text>审核</text>
- </a>
- </button>
- {{# }else { }}
- <button id="msgBtn" type="button" class="layui-btn layui-btn-xs" lay-event='pass'>
- <a lay-event='remark' style="color: #fff !important;" href="javascript:void(0)">
- <text>备注信息</text>
- </a>
- </button>
- {{# } }}
- <button type="button" class="layui-btn layui-btn-xs" lay-event='pass'>
- <a lay-event='freeze' style="color: #fff !important;" href="javascript:void(0)">
- <text>删除</text>
- </a>
- </button>
- </script>
- </div>
- </div>
- </div>
- </div>
- </div>
- <script src="{__ADMIN_PATH}js/layuiList.js"></script>
- {/block}
- {block name="script"}
- <script>
- //实例化form
- layList.form.render();
- //加载列表
- let tableIns = layList.tableList('List', "{:Url('get_apply_list')}", function () {
- return [
- {field: 'id', title: '编号', sort: true, event: 'id', width: '6%', align: "center"},
- {field: 'companyName', title: '企业名称', align: "center"},
- {field: 'apply_user_nickname', title: '昵称', align: "center", width: '12%'},
- {field: 'apply_user_name', title: '申请人姓名', align: "center", width: '12%'},
- {field: 'apply_user_mobile', title: '申请人手机', align: "center", width: '12%'},
- {field: 'job_name', title: '申请的职务', align: "center", width: '12%'},
- {
- field: 'audit_status', title: '状态', align: "center", width: '6%', templet: function (d) {
- let status = {
- 0: '未审核',
- 1: '通过',
- 2: '拒绝',
- };
- return status[d.audit_status];
- }
- },
- {field: 'add_time', title: '申请时间', align: "center", width: '10%'},
- {field: 'right', title: '操作', align: 'center', toolbar: '#dj', width: '16%'},
- ];
- });
- $('#btn-query').click(function (e) {
- var apply_user_name = $('#apply_user_name').val();
- var audit_status = $('#audit_status').val();
- tableIns.reload({
- page: {
- curr: 1 //重新从第 1 页开始
- }
- , url: "{:Url('get_apply_list')}?apply_user_name=" + apply_user_name + "&audit_status=" + audit_status
- , method: 'get'
- });
- });
- //自定义方法
- var action = {
- set_value: function (field, id, value) {
- layList.baseGet(layList.Url({
- a: 'set_value',
- q: {field: field, id: id, value: value}
- }), function (res) {
- layList.msg(res.msg);
- });
- },
- }
- $('.add-filed').on('click', function (e) {
- $eb.createModalFrame(this.innerText, "{:Url('create')}");
- })
- //快速编辑
- layList.edit(function (obj) {
- // var id=obj.data.id,value=obj.value;
- // switch (obj.field) {
- // case 'name':
- // action.set_value('name',id,value);
- // break;
- // case 'grade':
- // action.set_value('grade',id,value);
- // break;
- // case 'discount':
- // action.set_value('discount',id,value);
- // break;
- // }
- });
- //监听并执行排序
- layList.sort(['id', 'sort'], true);
- //点击事件绑定
- layList.tool(function (event, data, obj) {
- switch (event) {
- case 'isput':
- var url = layList.U({a: 'isShow', q: {id: data.id}});
- $eb.axios.get(url).then(function (res) {
- if (res.status == 200 && res.data.code == 200) {
- $eb.$swal('success', res.data.msg || '推荐成功');
- layList.reload();
- } else
- return Promise.reject(res.data.msg || '推荐失败')
- }).catch(function (err) {
- $eb.$swal('error', err);
- });
- break;
- case 'freeze':
- var url = layList.U({a: 'isDel', q: {id: data.id}});
- $eb.axios.get(url).then(function (res) {
- if (res.status == 200 && res.data.code == 200) {
- $eb.$swal('success', res.data.msg || '成功');
- layList.reload();
- } else
- return Promise.reject(res.data.msg || '失败')
- }).catch(function (err) {
- $eb.$swal('error', err);
- });
- break;
- case 'edit':
- $eb.createModalFrame("审核", "{:Url('auditPage')}?id=" + data.id, {w: '40%', h: '35%'});
- break;
- case 'remark':
- let text;
- if (data.audit_status == 1) {
- text = data.pass_text;
- } else {
- text = data.fail_text;
- }
- if (!text) {
- text = '没有备注信息';
- }
- layer.open({
- title: '备注',
- type: 1,
- skin: 'layui-layer-rim', //加上边框
- area: ['35%', '30%'], //宽高
- content: text
- });
- break;
- case 'open_image':
- $eb.openImage(data.headimg);
- break;
- }
- })
- </script>
- {/block}
|