| <div class="layui-fluid layui-anim febs-anim" id="febs-shop-apply" lay-title="申请通道列表"> | 
|     <div class="layui-row febs-container"> | 
|         <div class="layui-col-md12"> | 
|             <div class="layui-card"> | 
|                 <div class="layui-card-body febs-table-full"> | 
|                     <form class="layui-form layui-table-form" lay-filter="shop-apply-table-form"> | 
|                         <div class="layui-row"> | 
|                             <div class="layui-col-md10"> | 
|                                 <div class="layui-form-item"> | 
|                                     <div class="layui-inline"> | 
|                                         <div class="layui-input-inline"> | 
|                                             <input type="text" name="name" autocomplete="off" class="layui-input" placeholder="法人名称/邀请码"> | 
|                                         </div> | 
|                                     </div> | 
|                                     <div class="layui-inline"> | 
|                                         <label class="layui-form-label layui-form-label-sm">状态</label> | 
|                                         <div class="layui-input-inline"> | 
|                                             <select name="status"> | 
|                                                 <option value=""></option> | 
|                                                 <option value="2">等待审核</option> | 
|                                                 <option value="1">申请通过</option> | 
|                                                 <option value="3">申请驳回</option> | 
|                                             </select> | 
|                                         </div> | 
|                                     </div> | 
|                                 </div> | 
|                             </div> | 
|                             <div class="layui-col-md2 layui-col-sm12 layui-col-xs12 table-action-area"> | 
|                                 <div class="layui-btn layui-btn-sm layui-btn-primary febs-button-blue-plain table-action" id="query"> | 
|                                     <i class="layui-icon"></i> | 
|                                 </div> | 
|                                 <div class="layui-btn layui-btn-sm layui-btn-primary febs-button-green-plain table-action" id="reset"> | 
|                                     <i class="layui-icon"></i> | 
|                                 </div> | 
|                             </div> | 
|                         </div> | 
|                     </form> | 
|                     <table lay-filter="shopApplyTable" lay-data="{id: 'shopApplyTable'}"></table> | 
|                 </div> | 
|             </div> | 
|         </div> | 
|     </div> | 
| </div> | 
| <style> | 
|     .layui-table-cell { height:auto; } | 
| </style> | 
| <!-- 表格操作栏 start --> | 
| <script type="text/html" id="user-option"> | 
|     <span shiro:lacksPermission="user:view,user:update,user:delete"> | 
|         <span class="layui-badge-dot febs-bg-orange"></span> 无权限 | 
|     </span> | 
|     <a lay-event="edit" shiro:hasPermission="user:update"><i | 
|             class="layui-icon febs-edit-area febs-blue"></i></a> | 
| </script> | 
| <script type="text/html" id="card-url"> | 
|     {{# | 
|         var imgUrl = d.idcard; | 
|         if(imgUrl) { | 
|             imgUrl = imgUrl.substring(imgUrl.indexOf(',') + 1); | 
|         } | 
|     }} | 
|     <img src="{{ imgUrl }}" alt="" /> | 
| </script> | 
| <script type="text/html" id="license-url"> | 
|     {{# | 
|         var imgUrl = d.businessLicense; | 
|         if(imgUrl) { | 
|             imgUrl = imgUrl.substring(imgUrl.indexOf(',') + 1); | 
|         } | 
|     }} | 
|     <img src="{{ imgUrl }}" alt="" /> | 
| </script> | 
| <script type="text/html" id="area-url"> | 
|     {{# | 
|         var imgUrl = d.saleArea; | 
|         if(imgUrl) { | 
|             imgUrl = imgUrl.substring(imgUrl.indexOf(',') + 1); | 
|         } | 
|     }} | 
|     <img src="{{ imgUrl }}" alt="" /> | 
| </script> | 
| <script type="text/html" id="apply-status"> | 
|     {{# | 
|     var status = { | 
|         1: {title: '审核通过'}, | 
|         2: {title: '等待审核'}, | 
|         3: {title: '审核驳回'} | 
|         }[d.status]; | 
|     }} | 
|     <span>{{ status.title }}</span> | 
| </script> | 
| <!-- 表格操作栏 end --> | 
| <script data-th-inline="none" type="text/javascript"> | 
|     // 引入组件并初始化 | 
|     layui.use([ 'jquery', 'form', 'table', 'febs'], function () { | 
|         var $ = layui.jquery, | 
|             febs = layui.febs, | 
|             form = layui.form, | 
|             table = layui.table, | 
|             $view = $('#febs-shop-apply'), | 
|             $query = $view.find('#query'), | 
|             $reset = $view.find('#reset'), | 
|             $searchForm = $view.find('form'), | 
|             sortObject = {field: '', type: null}, | 
|             tableIns; | 
|   | 
|         form.render(); | 
|   | 
|         // 表格初始化 | 
|         initTable(); | 
|   | 
|         // 初始化表格操作栏各个按钮功能 | 
|         table.on('tool(shopApplyTable)', function (obj) { | 
|             var data = obj.data, | 
|                 layEvent = obj.event; | 
|   | 
|             if (layEvent === 'shopApplyInfo') { | 
|                 febs.modal.open('查看详情', 'modules/mallMember/applyDetail/' + data.id, { | 
|                     btn: ['通过申请', '驳回申请','保存'], | 
|                     area:['100%','100%'], | 
|                     // area : $(window).width() <= 750 ? '95%' : '660px', | 
|                     yes: function (index, layero) { | 
|                         $('#shop-apply-detail').find('#agree').trigger('click'); | 
|                     }, | 
|                     btn2: function () { | 
|                         $('#shop-apply-detail').find('#disagree').trigger('click'); | 
|                     }, | 
|                     btn3: function () { | 
|                         $('#shop-apply-detail').find('#applyUpdate').trigger('click'); | 
|                     } | 
|                 }); | 
|             } | 
|   | 
|         }); | 
|   | 
|         // 查询按钮 | 
|         $query.on('click', function () { | 
|             var params = $.extend(getQueryParams(), {field: sortObject.field, order: sortObject.type}); | 
|             tableIns.reload({where: params, page: {curr: 1}}); | 
|         }); | 
|   | 
|         // 刷新按钮 | 
|         $reset.on('click', function () { | 
|             $searchForm[0].reset(); | 
|             sortObject.type = 'null'; | 
|             tableIns.reload({where: getQueryParams(), page: {curr: 1}, initSort: sortObject}); | 
|         }); | 
|   | 
|         function initTable() { | 
|             tableIns = febs.table.init({ | 
|                 elem: $view.find('table'), | 
|                 id: 'shopApplyTable', | 
|                 url: ctx + 'admin/mallMember/shopApplyList', | 
|                 cols: [[ | 
|                     {field: 'vipName', title: '会员名称', minWidth: 100}, | 
|                     {field: 'inviteId', title: '邀请码', minWidth: 100}, | 
|                     {field: 'name', title: '法人姓名', minWidth: 100}, | 
|                     {field: 'phone', title: '联系方式', minWidth: 100}, | 
|                     {templet: '#card-url', title: '身份证', minWidth: 100}, | 
|                     {templet: '#license-url', title: '营业执照', minWidth: 100}, | 
|                     {templet: '#area-url', title: '经营场地', minWidth: 100}, | 
|                     {templet: '#apply-status', title: '状态', minWidth: 100}, | 
|                     {title: '操作', | 
|                         templet: function (d) { | 
|                             return '<button class="layui-btn layui-btn-normal layui-btn-xs" lay-event="shopApplyInfo" shiro:hasPermission="user:update">审核</button>' | 
|                         },align:'center'} | 
|                 ]] | 
|             }); | 
|         } | 
|   | 
|         // 获取查询参数 | 
|         function getQueryParams() { | 
|              return { | 
|                 username: $searchForm.find('input[name="name"]').val().trim(), | 
|                 status: $searchForm.find("select[name='status']").val(), | 
|                 invalidate_ie_cache: new Date() | 
|             };; | 
|         } | 
|   | 
|     }) | 
| </script> |