ComplianceServer/oldcode/WEB/Views/Res/Activity/List.cshtml

67 lines
2.2 KiB
Plaintext

@using WX.CRM.IBLL.Res;
@{
ViewBag.Title = "分配规则列表";
//Layout = "~/Views/Shared/_Layout2.cshtml";
Layout = "~/Views/Shared/_content.cshtml";
}
<div class="bas_datagrid layui-form" style="padding:10px;">
<table class="layui-hide" id="tabl1" lay-filter="tabl1"></table>
</div>
<script>
layui.config({
base: '/layui-v2.5.4/',
}).extend({
excel: 'excel.min',
});
layui.use(['table', 'excel', 'layer'], function () {
var layer = layui.layer;
var table = layui.table;
var $ = layui.jquery;
var excel = layui.excel;
var resTypeId = '@Request["resTypeId"]';
var activityId = '@Request["activityId"]';
var sTime = '@Request["sTime"]';
var eTime = '@Request["eTime"]';
table.render({
id: 'list',//列表别名ID
elem: '#tabl1',//表ID
url: '/Res/Activity/List',
method: 'POST',
toolbar: true,
defaultToolbar: [{
title: '导出' //标题
, layEvent: 'exp' //事件名,用于 toolbar 事件中使用
, icon: 'layui-icon-export' //图标类名
}],
cols: [[
{ field: 'ResId', title: '客户ID' }
, { field: 'ResTypeName', title: '类型' }
, { field: 'ActivityName', title: '活动' }
]]
, where: { resTypeId, activityId, sTime, eTime }
, page: false
});
table.on('toolbar(tabl1)', function (obj) {
//var checkStatus = table.checkStatus(obj.config.id);
//console.log(checkStatus);
if (obj.event == "exp") {
$.r_post('/Res/Activity/List', { resTypeId, activityId, sTime, eTime }, function (res) {
console.log(res);
res.data.unshift({ ResId: '客户ID', ResTypeName: '类型', ActivityName: '活动' });
var data = excel.filterExportData(res.data, ['ResId', 'ResTypeName', 'ActivityName']);
excel.exportExcel({ sheet1: data }, '明细数据.xlsx', 'xlsx');
});
}
});
});
</script>