前台的逻辑判断
function addSoftware(){
var pno=$("#po_no_p").val();
var cno=$("#contract_no_c").val();
var url= "/support/pages/poapply/PoApply.do?actionFlag=searchSoftwareList&openWindowFlag=true&pFlag=inner&pno="+pno+"&cno="+cno+
"&editFlag=${editFlag}&productLine=${pl}&product=${pp}&randomFlag="+new Date().getTime();
var verifyurl = "/support/pages/poapply/PoApply.do?actionFlag=verifySoftwareList&pFlag=inner&pno="+pno+"&cno="+cno+"&randomFlag="+new Date().getTime();
var a = "location=no,menubar=no,status=no,toolbar=no,scrollbars=yes,resizables=yes,width="+(parseInt(screen.width)-15)+",height="+(parseInt(screen.height)-80)+",left=0,top=0";
if(pno!=""||cno!=""){
$.ajax({
url:verifyurl,
async: false,
type: "GET",
dataType: "json",
success: function(data){ var str = data.reslut;
if("OK"==str){
window.open(url,null,a);
}else{
alert("<bean:message key="support.po.app.noIsNotExit"/>");
}
},
error: function(){
alert("<bean:message key="sys.err.unknowerror"/>");
}
});
}else{
alert("<bean:message key="support.po.app.enterNo"/>");
return;
}
}
前台能拿到var str = data.reslut;后台的标示是需要在后台作如下的操作的,相关的代码如下:
/**
* @since SPC800
* @throws Exception
* Exception
* @param mapping
* mapping
* @param form
* form
* @param request
* request
* @param response
* 此方法为用户在点击查询按钮的时候调用的Ajax验证方法,如果没有数据则不允许open window
*/
@SuppressWarnings("unchecked")
public ActionForward verifySoftwareList(ActionMapping mapping,
ActionForm form, HttpServletRequest request,
HttpServletResponse response) throws Exception
{
HttpSession session = request.getSession(false);
PrintWriter out = response.getWriter();
//语种
String nls = (String) session.getAttribute(SupportConstants.CFG_NLS);
//界面上获取订单号
String pno = request.getParameter("pno").trim();
//界面上获取合同号
String cno = request.getParameter("cno").trim();
JSONObject jsonObj = new JSONObject();
jsonObj.put(PoApplyConstants.NLS_LANG, nls);
jsonObj.put(PoApplyConstants.CONTRACT_NO, cno);
jsonObj.put(PoApplyConstants.PO_NO, pno);
jsonObj.put(PoApplyConstants.IFSELECTED, "VERIFY");
//调用WebService的后台接口
IPoApplyWs poApplyWs = new IPoApplyWsProxy();
String resultStr =
poApplyWs.getRelatedSwDetailListById(jsonObj.toString());
String str = "";
if (null != resultStr && !"0".equals(resultStr))
{
//"OK "
str = "{\"reslut\":\"OK\"}";
out.write(str);
//out.write("OK");
}
else
{
str = "{\"reslut\":\"FAILED\"}";
out.write(str);
// out.write("FAILED");
}
return null;
}
分享到:
相关推荐
17,注意:由于本次V3.8改动有些超大,因此导致了源data.js文件和V3.8使用的有些小区别,如果您想在V3.8中继续使用您V3.5.1及其以下版本的data.js文件,请在这个文件的最下面加入 “DATALOADEND();” 引号所引的这条...
17,注意:由于本次V3.8改动有些超大,因此导致了源data.js文件和V3.8使用的有些小区别,如果您想在V3.8中继续使用您V3.5.1及其以下版本的data.js文件,请在这个文件的最下面加入 “DATALOADEND();” 引号所引的这条...
17,注意:由于本次V3.8改动有些超大,因此导致了源data.js文件和V3.8使用的有些小区别,如果您想在V3.8中继续使用您V3.5.1及其以下版本的data.js文件,请在这个文件的最下面加入 “DATALOADEND();” 引号所引的这条...
17,注意:由于本次V3.8改动有些超大,因此导致了源data.js文件和V3.8使用的有些小区别,如果您想在V3.8中继续使用您V3.5.1及其以下版本的data.js文件,请在这个文件的最下面加入 “DATALOADEND();” 引号所引的这条...
17,注意:由于本次V3.8改动有些超大,因此导致了源data.js文件和V3.8使用的有些小区别,如果您想在V3.8中继续使用您V3.5.1及其以下版本的data.js文件,请在这个文件的最下面加入 “DATALOADEND();” 引号所引的这条...
17,注意:由于本次V3.8改动有些超大,因此导致了源data.js文件和V3.8使用的有些小区别,如果您想在V3.8中继续使用您V3.5.1及其以下版本的data.js文件,请在这个文件的最下面加入 “DATALOADEND();” 引号所引的这条...