父頁面:
function kaipiao(ids) {
layer.open({
type: 2,
title: '開票',
maxmin: true,
shadeClose: false, // 點擊遮罩關閉層
area: ['1200px', '700px'],
content: prefix + '/kaipiao',
afterClose: function (VRetrun) {
layer.msg(VRetrun);
},
otherParams: {
ids: ids
}
});
}
子頁面:在初始加載中獲取
$(function){
var params = parent.layer.getParams();//取參數
if (params) {
unitguids = params.ids;
}
}
子頁面向父頁面傳參 經過layer.open 打開新窗口
var openCustomerselect = function () {
top.layer.open({
type: 2,
title: "選擇客戶",
area: ['1100px', '600px'],
content: "/manage/customer/customerselect",
afterClose: setCustomer,
})
}
function setCustomer(result) { $("#customerguid").val(result.unitguid); $("#customername").val(result.customername);}