$.post提交完数据之后,关闭弹窗
var index = parent.layer.getFrameIndex(window.name);
parent.layer.close(index);
关闭弹窗,刷新表格
layer.open({
type: 2,
title: '添加活动',
area: [width, height],
content: '{:U("show_add")}?type=' + 2 ,
end: function () {
//window.parent.location.reload();//刷新父页面
location.reload();
}
});
layer.ui
layui.use(['table', 'layer', 'upload','laydate','form', 'element'], function () {
var form = layui.form;
var table = layui.table;
//核销记录
var hxjl = table.render({
elem: '#card',
height: 'full-113',
url: "{:U('cardList')}",
page: true,//开启分页
cols: [[
{field: 'id', title: '编号'}
, {field: 'name', title: '卡券名称'}
, {field: 'create_time', title: '创建时间'}
, {field: 'status', title: '卡券状态'}
, {field: 'cav_times', title: '核销次数'}
, {field: 'amountval', title: '卡券面额'}
]]
});
//添加卡券
$('#mch_add').click(function(){
var width=$(this).attr("data-width");
var height=$(this).attr("data-height");
layer.open({
type: 2,
title: '添加活动',
area: [width, height],
content: '{:U("show_add")}?type=' + 2 ,
end: function () {
//window.parent.location.reload();//刷新父页面
location.reload();
}
});
});
});