| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196 |
- <div class="layui-fluid">
- <div class="layui-card">
- <div class="layui-form layui-form-pane layui-card-header layuiadmin-card-header-auto" lay-filter="LAY-broker-brokerlist-search">
- <div class="layui-form-item">
- <div class="layui-inline">
- <label class="layui-form-label">手机号</label>
- <div class="layui-input-block">
- <input type="text" name="mobile" placeholder="请输入" autocomplete="off" class="layui-input">
- </div>
- </div>
- <div class="layui-inline">
- <label class="layui-form-label">状态</label>
- <div class="layui-input-block">
- <select name="status">
- <option value="">全部状态</option>
- <option value="1">待审核</option>
- <option value="2">审核通过</option>
- <option value="3">审核拒绝</option>
- </select>
- </div>
- </div>
- <div class="layui-inline">
- <label class="layui-form-label">类型</label>
- <div class="layui-input-block">
- <select name="status">
- <option value="">全部</option>
- <option value="1">经纪人</option>
- <option value="2">红色合伙人</option>
- <option value="3">省外经纪人</option>
- </select>
- </div>
- </div>
- <div class="layui-inline">
- <button class="layui-btn" lay-submit lay-filter="LAY-broker-brokerlist-btn">
- <i class="layui-icon layui-icon-search layuiadmin-button-btn"></i>
- </button>
- </div>
- </div>
- </div>
- <div class="layui-card-body">
- <div style="padding-bottom: 10px;">
- <button class="layui-btn layuiadmin-btn" data-type="batchdel">删除</button>
- </div>
- <table id="LAY-broker-brokerlist-table" lay-filter="LAY-broker-brokerlist-table"></table>
- <script type="text/html" id="address">
- {{d.town}} - {{d.village}}
- </script>
- <script type="text/html" id="workertitleTpl">
- {{d.worker.title}}
- </script>
- <script type="text/html" id="agenttitleTpl">
- {{d.agent.title}}
- </script>
- <script type="text/html" id="setTpl">
- {{# if(d.status == 1){ }}
- <a class="layui-btn layui-btn-normal layui-btn-xs" lay-event="apply"><i class="layui-icon layui-icon-edit"></i>审核通过</a>
- <a class="layui-btn layui-btn-normal layui-btn-xs" lay-event="reject"><i class="layui-icon layui-icon-edit"></i>审核拒绝</a>
- {{# } }}
- <a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="del"><i class="layui-icon layui-icon-delete"></i>删除</a>
- </script>
- </div>
- </div>
- </div>
- <script>
- layui.config({
- base: '/static/echoui/' //静态资源所在路径
- }).extend({
- index: 'lib/index' //主入口模块
- }).use(['index', 'form', 'set', 'table'], function() {
- var $ = layui.$,
- setter = layui.setter,
- admin = layui.admin,
- form = layui.form,
- table = layui.table;
- form.render();
- table.render({
- elem: '#LAY-broker-brokerlist-table',
- url: setter.baseAdminUrl + 'broker/listapply',
- cols: [
- [
- { type: 'checkbox', fixed: 'left' },
- { field: 'id', width: 80, title: '表ID', sort: true },
- { field: 'title', title: '姓名' },
- { field: 'mobile', title: '手机号' },
- { field: 'type_text', title: '类型', width: 100, align: 'center' },
- { field: 'address', title: '镇街', templet: '#address' },
- { field: 'region', title: '区域', width: 100, align: 'center'},
- { field: 'workertitle', title: '劳务公司', templet: '#workertitleTpl' },
- { field: 'agenttitle', title: '代理门店', templet: '#agenttitleTpl' },
- { field: 'status_text', title: '状态', width: 100, align: 'center' },
- { field: 'createtime', title: '申请时间', width: 170 },
- { title: '操作', width: 260, align: 'center', fixed: 'right', toolbar: '#setTpl' }
- ]
- ],
- page: true,
- limit: 50,
- cellMinWidth: 150,
- text: '对不起,加载出现异常!'
- });
- form.on('submit(LAY-broker-brokerlist-btn)', function(data) {
- table.reload('LAY-broker-brokerlist-table', {
- where: data.field,
- page: {
- curr: 1
- }
- });
- });
- var active = {
- batchdel: function() {
- var checkStatus = table.checkStatus('LAY-broker-brokerlist-table'),
- checkData = checkStatus.data; //得到选中的数据
- if (checkData.length === 0) {
- return layer.msg('请选择数据');
- }
- var idarr = [];
- for (var i = 0; i < checkData.length; i++) {
- idarr.push(checkData[i].id);
- }
- layer.confirm('确定删除此申请吗?', function(index) {
- admin.req({
- url: setter.baseAdminUrl + 'broker/delApply',
- data: {
- idarr: idarr
- },
- done: function(res) {
- table.reload('LAY-broker-brokerlist-table');
- layer.msg('已删除');
- }
- });
- layer.close(index);
- });
- },
- };
- table.on('tool(LAY-broker-brokerlist-table)', function(obj) {
- var data = obj.data;
- if (obj.event === 'del') {
- layer.confirm('确定删除此申请吗?', function(index) {
- admin.req({
- url: setter.baseAdminUrl + 'broker/delApply',
- data: {
- idarr: [data.id]
- },
- done: function(res) {
- obj.del();
- layer.msg('已删除');
- }
- });
- layer.close(index);
- });
- } else if (obj.event === 'apply') {
- layer.confirm('确定通过吗?', function(index) {
- admin.req({
- url: setter.baseAdminUrl + 'broker/statusApply',
- data: {
- id: data.id,
- status: 2,
- },
- done: function(res) {
- table.reload('LAY-broker-brokerlist-table');
- layer.msg('操作成功');
- }
- });
- layer.close(index);
- });
- } else if (obj.event === 'reject') {
- layer.confirm('确定拒绝吗?', function(index) {
- admin.req({
- url: setter.baseAdminUrl + 'broker/statusApply',
- data: {
- id: data.id,
- status: 3,
- },
- done: function(res) {
- table.reload('LAY-broker-brokerlist-table');
- layer.msg('操作成功');
- }
- });
- layer.close(index);
- });
- }
- });
- $('.layui-btn.layuiadmin-btn').on('click', function() {
- var type = $(this).data('type');
- active[type] ? active[type].call(this) : '';
- });
- });
- </script>
|