一、list主页数据获取统一调配
打开list主页
@FunctionDesc("[贷款审批主页面]=========审批")
public String listSp(Model model) {
Mean(model);
return "syfh_zcd/dksp/SyzcdDksqSpList";
}
list主页
url="<%=request.getContextPath()%>/syzcdDksqxxb/queryShow.do?show=spList"
分页数据获取
@ResponseBody
@RequestMapping(value = "/queryShow", method = RequestMethod.POST)
public Map<String, Object> queryShow(HttpServletRequest request, SyzcdDksqxxbVO vo, Pagination page) {
String show = request.getParameter("show");
switch (show) {
case "spList" : {
logger.info("审批页面数据获取");
/* System.out.println(vo.getAllotnotesid()); */
// 已分配
vo.setAllotstate("1");
// 未反馈
vo.setFeedbacktype("0");
Map<String, Object> map = iSyzcdDksqxxbService.queryShow(vo, page);
return map;
}
case "listAll" : {
logger.info("贷款申请信息查询数据获取");
Map<String, Object> map = iSyzcdDksqxxbService.queryShow(vo, page);
return map;
}
default : {
throw new BusinessException("数据获取统一调配异常");
}
}
}
二、弹窗页面统一调配、业务逻辑统一调配
renderer事件
<div name="onCheckAction" headerAlign="center" align="center" renderer="onCheckAction" cellStyle="padding:0;" width="130px">审批操作</div>
添加链接效果
function onCheckAction(e) {
var record = e.record;
//处理标志
var handlestate = record.handlestate;
//项目id
var projectid = record.projectid;
//组包id
var planitemid = record.planitemid;
//供应商id
var supplierid = record.supplierid;
var view = "";
var vback = "";
var datastr = projectid + "," + planitemid + "," + supplierid + "," + handlestate;
if (handlestate == 1) {
view = '<a>已通过</a> ';
} else {
//录入
view = '<a href="javascript:enter(\'' + datastr + '\')" style="color:red">通过</a> ';
// 退回后allotstate=0
view += '<a href="javascript:vback(\'' + datastr + '\')" style="color:red">退回</a> ';
}
return view;
}
js弹窗函数
//录入 function enter(datastr) { var dataArr = datastr.split(","); var urlStr = appContext + "/syzcdDksqxxb/show.do?show=spList"; var bizData = { pageType : "edit", "projectid" : dataArr[0], "planitemid" : dataArr[1], "supplierid" : dataArr[2] } $J.showmodaldialog("审批录入", urlStr, 350, 200, bizData, function(action) { grid.reload(); }); }
弹窗统一调配
@ResponseBody public void conter(HttpServletRequest request, SyzcdDksqxxbVO vo) { String op = request.getParameter("option"); switch (op) { case "back" :// 审批退回,通过js声明的json字符串取得数据 this.back(vo); break; case "enter" : // 已分配 vo.setHandlestate("1"); update(vo); break; /* case "total": */ default : throw new BusinessException("控制层统一调配异常"); } }
js业务函数
/* 退回 */ function vback(datastr) { $J.cap4jConfirm("确定退回此条项目?", "退回提示", function(action) { if (action == 'ok') { var dataArr = datastr.split(","); var ajaxConf = new Cap4jAjaxConf(); ajaxConf.setSuccessFunc(refresh); ajaxConf.setIsShowSuccMsg(false); var params = { "projectid" : dataArr[0], "planitemid" : dataArr[1], "supplierid" : dataArr[2] }; $J.postByAjax(params, appContext + "/syzcdDksqxxb/conter.do?option=back", ajaxConf); } }); }}
业务逻辑统一调配
@ResponseBody public void conter(HttpServletRequest request, SyzcdDksqxxbVO vo) { String op = request.getParameter("option"); switch (op) { case "back" :// 审批退回,通过js声明的json字符串取得数据 this.back(vo); break; case "enter" : // 已分配 vo.setHandlestate("1"); update(vo); break; /* case "total": */ default : throw new BusinessException("控制层统一调配异常"); } }