刷新页面调用逻辑

1.在Tab页面里面新增变量detailHasSaved 

//定义变量   var detailHasSaved = false;

//重置变量   function resetStatus() {  detailHasSaved = false; }

//更新变量   function detailSavedNotice() {detailHasSaved = true;}

2.在receivedetailList里面的add新增、edit编辑按钮里面重置变量detailHasSaved 

function addAction() {
if ($("#hidStatus").val() != "1") {
msg.error("非草稿状态的收货单不能新增明细");
return false;
}
parent.resetStatus();
var url = "frmReceiveDetailEdit.aspx?receiveno=" + $("#hidReceiveNo").val() + "&receiveStatus=" + $("#hidStatus").val();
parent.eci.dialog("预收货物信息维护", url, { height: 400, width: 1000, target: "预收货物信息维护", showclose: false });
}

function editAction(obj) {
parent.resetStatus();
var key = $(obj).getKey();
var url = "frmReceiveDetailEdit.aspx?receiveno=" + $("#hidReceiveNo").val() + "&guid=" + key + "&receiveStatus=" + $("#hidStatus").val();
parent.eci.dialog("预收货物信息维护", url, { height:400,width:1000, target: "预收货物信息维护",showclose:false });
}

3.在receiveDetailEdit里面前台新增save函数,在save按钮后台调用

 HtmlWindow.Onload("saved()");

function saved() {
window.parent.detailSavedNotice();
}

4.在receiveDetailEdit关闭按钮刷新页面

function pageClose() {
window.parent.detailSaved();
eci.close();
}

5.在TAB中建立刷新页面

function detailSaved() {
if (detailHasSaved) {
refreshMain();
var win = document.getElementById("tabBody_frame").contentWindow;
win.refreshList();
}
}

function refreshMain() {
$("#tabHead_frame")[0].contentWindow.refresh();
}

posted @ 2018-12-29 10:16  CC小家  阅读(344)  评论(0编辑  收藏  举报