|  |  |  | 
|---|
|  |  |  | </div> | 
|---|
|  |  |  |  | 
|---|
|  |  |  | <div class="layui-inline"> | 
|---|
|  |  |  | <label class="layui-form-label layui-form-label-sm">会员生日</label> | 
|---|
|  |  |  | <label class="layui-form-label layui-form-label-sm">是否领取</label> | 
|---|
|  |  |  | <div class="layui-input-inline"> | 
|---|
|  |  |  | <input type="text" name="birthdayStart" id="febs-member-benefits-list-birthday-start" lay-verify="date" | 
|---|
|  |  |  | placeholder="yyyy-MM-dd" autocomplete="off" class="layui-input"> | 
|---|
|  |  |  | </div> | 
|---|
|  |  |  | <div class="layui-input-inline"> | 
|---|
|  |  |  | <input type="text" name="birthdayEnd" id="febs-member-benefits-list-birthday-end" lay-verify="date" | 
|---|
|  |  |  | placeholder="yyyy-MM-dd" autocomplete="off" class="layui-input"> | 
|---|
|  |  |  | <select name="hasReceive"> | 
|---|
|  |  |  | <option value="">请选择</option> | 
|---|
|  |  |  | <option value="1">已领取</option> | 
|---|
|  |  |  | <option value="2">未领取</option> | 
|---|
|  |  |  | </select> | 
|---|
|  |  |  | </div> | 
|---|
|  |  |  | </div> | 
|---|
|  |  |  |  | 
|---|
|  |  |  | <div class="layui-inline"> | 
|---|
|  |  |  | <label class="layui-form-label layui-form-label-sm">领取时间</label> | 
|---|
|  |  |  | <label class="layui-form-label layui-form-label-sm">会员生日</label> | 
|---|
|  |  |  | <div class="layui-input-inline"> | 
|---|
|  |  |  | <input type="text" name="receiveStartTime" id="febs-member-benefits-list-start" lay-verify="date" | 
|---|
|  |  |  | placeholder="yyyy-MM-dd" autocomplete="off" class="layui-input"> | 
|---|
|  |  |  | </div> | 
|---|
|  |  |  | <div class="layui-input-inline"> | 
|---|
|  |  |  | <input type="text" name="receiveEndTime" id="febs-member-benefits-list-end" lay-verify="date" | 
|---|
|  |  |  | placeholder="yyyy-MM-dd" autocomplete="off" class="layui-input"> | 
|---|
|  |  |  | <input type="text" name="birthday" id="febs-member-benefits-list-birthday-start" lay-verify="date" | 
|---|
|  |  |  | placeholder="MM-dd" autocomplete="off" class="layui-input"> | 
|---|
|  |  |  | </div> | 
|---|
|  |  |  | </div> | 
|---|
|  |  |  |  | 
|---|
|  |  |  | </div> | 
|---|
|  |  |  | </div> | 
|---|
|  |  |  | <div class="layui-col-md2 layui-col-sm12 layui-col-xs12 table-action-area"> | 
|---|
|  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | //日期范围 | 
|---|
|  |  |  | laydate.render({ | 
|---|
|  |  |  | elem: '#febs-member-benefits-list-start' | 
|---|
|  |  |  | }); | 
|---|
|  |  |  | laydate.render({ | 
|---|
|  |  |  | elem: '#febs-member-benefits-list-end' | 
|---|
|  |  |  | }); | 
|---|
|  |  |  | laydate.render({ | 
|---|
|  |  |  | elem: '#febs-member-benefits-list-birthday-start' | 
|---|
|  |  |  | }); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | laydate.render({ | 
|---|
|  |  |  | elem: '#febs-member-benefits-list-birthday-end' | 
|---|
|  |  |  | ,value: new Date() | 
|---|
|  |  |  | ,format:'MM-dd' | 
|---|
|  |  |  | }); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | form.render(); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | // 表格初始化 | 
|---|
|  |  |  | initTable(); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | // 初始化表格操作栏各个按钮功能 | 
|---|
|  |  |  | table.on('tool(memberBenefitsTable)', function (obj) { | 
|---|
|  |  |  | 
|---|
|  |  |  | $reset.on('click', function () { | 
|---|
|  |  |  | $searchForm[0].reset(); | 
|---|
|  |  |  | sortObject.type = 'null'; | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | laydate.render({ | 
|---|
|  |  |  | elem: '#febs-member-benefits-list-birthday-start' | 
|---|
|  |  |  | ,format:'MM-dd' | 
|---|
|  |  |  | ,value: new Date() | 
|---|
|  |  |  | }); | 
|---|
|  |  |  | tableIns.reload({where: getQueryParams(), page: {curr: 1}, initSort: sortObject}); | 
|---|
|  |  |  | }); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | function initTable() { | 
|---|
|  |  |  | var data = { birthday: formatDate(new Date()) } | 
|---|
|  |  |  | tableIns = febs.table.init({ | 
|---|
|  |  |  | elem: $view.find('table'), | 
|---|
|  |  |  | id: 'memberBenefitsTable', | 
|---|
|  |  |  | url: ctx + 'admin/mallMember/findMemberBenefitsInPage', | 
|---|
|  |  |  | totalRow : true, | 
|---|
|  |  |  | where :data, | 
|---|
|  |  |  | cols: [[ | 
|---|
|  |  |  | {field: 'memberName', title: '会员名称', minWidth: 100,align:'left'}, | 
|---|
|  |  |  | {field: 'memberPhone', title: '手机号码', minWidth: 150,align:'left'}, | 
|---|
|  |  |  | {field: 'benefitsName', title: '权益', minWidth: 150,align:'left'}, | 
|---|
|  |  |  | {field: 'benefitsType', title: '权益类型', | 
|---|
|  |  |  | {field: 'hasReceive', title: '是否领取', | 
|---|
|  |  |  | templet: function (d) { | 
|---|
|  |  |  | if (d.benefitsType === 1) { | 
|---|
|  |  |  | return '<span>会员日</span>' | 
|---|
|  |  |  | } else if (d.benefitsType === 2) { | 
|---|
|  |  |  | return '<span>生日</span>' | 
|---|
|  |  |  | if (d.hasReceive === 1) { | 
|---|
|  |  |  | return '<span>已领取</span>' | 
|---|
|  |  |  | } else if (d.hasReceive === 2) { | 
|---|
|  |  |  | return '<span>未领取</span>' | 
|---|
|  |  |  | } else { | 
|---|
|  |  |  | return '<span>其他</span>' | 
|---|
|  |  |  | return '<span>-</span>' | 
|---|
|  |  |  | } | 
|---|
|  |  |  | }, minWidth: 80,align:'center'}, | 
|---|
|  |  |  | {field: 'receiveName', title: '领取名称', minWidth: 150,align:'left'}, | 
|---|
|  |  |  | 
|---|
|  |  |  | // 获取查询参数 | 
|---|
|  |  |  | function getQueryParams() { | 
|---|
|  |  |  | return { | 
|---|
|  |  |  | receiveStartTime: $searchForm.find('input[name="receiveStartTime"]').val().trim(), | 
|---|
|  |  |  | receiveEndTime: $searchForm.find('input[name="receiveEndTime"]').val().trim(), | 
|---|
|  |  |  | birthdayStart: $searchForm.find('input[name="birthdayStart"]').val().trim(), | 
|---|
|  |  |  | birthdayEnd: $searchForm.find('input[name="birthdayEnd"]').val().trim(), | 
|---|
|  |  |  | birthday: $searchForm.find('input[name="birthday"]').val().trim(), | 
|---|
|  |  |  | // memberName: $searchForm.find('input[name="memberName"]').val().trim(), | 
|---|
|  |  |  | memberPhone: $searchForm.find('input[name="memberPhone"]').val().trim(), | 
|---|
|  |  |  | status: $searchForm.find("select[name='status']").val(), | 
|---|
|  |  |  | hasReceive: $searchForm.find("select[name='hasReceive']").val(), | 
|---|
|  |  |  | }; | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | function formatDate(date) { | 
|---|
|  |  |  | const month = (date.getMonth() + 1).toString().padStart(2, '0'); | 
|---|
|  |  |  | const day = date.getDate().toString().padStart(2, '0'); | 
|---|
|  |  |  | return `${month}-${day}`; | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | // 表格初始化 | 
|---|
|  |  |  | initTable(); | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | </script> | 
|---|