确认保存,关闭新开页面,返回旧页面操作
作者:互联网
比如实现审核功能,开启一个审核页面,在审核成功之后,返回到原有的页面
原有list页面:
//审核
function toEdit() {
var selected = getSelectedRowsArr('FeedingRecordsHealthList');
if (selected.length > 0 && selected.length < 2) {
var row = getSelectedRows('FeedingRecordsHealthList')[0];
if (row.dstatus != "C20"){
var pageid=getResourceId();
openManaDialogForTab('${path}/feedingRecordsHealthController/editById.do?id='+selected+'&pageid='+pageid, '保健记录-审核','保健记录-审核');
<%--window.location='${path}/feedingRecordsHealthController/editById.do?id=' + selected;--%>
} else{
top.showArtDiaglog('提示', '只有待审核的记录才能进行审核', null, function () {
top.closeDialog();
});
}
} else {
//提示信息
top.showArtDiaglog('提示', '请选择一条数据进行操作', null, function () {
top.closeDialog();
});
}
}
重点是在这句话
openManaDialogForTab('${path}/feedingRecordsHealthController/editById.do?id='+selected+'&pageid='+pageid, '保健记录-审核','保健记录-审核');
审核页面:
//返回列表
function goBackList(){
var options = new Object();
options.id = '${pageid}';
options.title = '保健记录';
options.close = true;
options.url = '${path}/feedingRecordsHealthController/toList.do';
parent.refreshFrame('保健记录-审核', options);
}
然后需要将pageid id通过后台接受
controller页面具体实现方法
/**
* 打开审核页面
*
* @return
* @throws Exception
*/
@RequestMapping("/editById")
public ModelAndView toCheckOneM(@ModelAttribute FeedingRecordsHealth po,String pageid) throws Exception {
log.debug("打开审核页面");
ModelAndView mv = new ModelAndView("feeding/feedingrecordshealth/feedingrecordshealth_edit");
po = this.feedingRecordsHealthService.selectByPrimaryKey(po.getId());
mv.addObject("vo", po);
mv.addObject("pageid", pageid);
return mv;
}
标签:pageid,selected,保健,新开,关闭,审核,options,页面 来源: https://www.cnblogs.com/snail8698428/p/11138748.html