111 lines
3.5 KiB
Plaintext
111 lines
3.5 KiB
Plaintext
<%@ page contentType="text/html; charset=GBK"%><%@
|
|
include file="/Frame/resources/include/include_begin_info.jspf"%><%
|
|
/*
|
|
页面说明: 节点信息详情页面
|
|
*/
|
|
String PG_TITLE = "节点信息详情页面";
|
|
|
|
//获得页面参数
|
|
String sNodeID = CurPage.getParameter("NodeID");
|
|
if(sNodeID==null) sNodeID="";
|
|
|
|
//通过OW模型产生ASObjectModel对象doTemp
|
|
ASObjectModel doTemp = new ASObjectModel("PRDNodeManageInfo");
|
|
ASObjectWindow dwTemp = new ASObjectWindow(CurPage,doTemp,request);
|
|
dwTemp.Style="2"; //设置OW风格 1:Grid 2:Freeform
|
|
dwTemp.ReadOnly = "0"; //设置是否只读 1:只读 0:可写
|
|
|
|
//生成HTMLDataWindow
|
|
dwTemp.genHTMLObjectWindow(sNodeID);//传入参数,逗号分割
|
|
|
|
String sButtons[][] = {
|
|
{"true","","Button","保存","保存所有修改","saveRecord()","","","",""},
|
|
{"true","","Button","返回","返回列表页面","goBack()","","","",""}
|
|
};
|
|
%><%@include file="/Frame/resources/include/ui/include_info.jspf"%>
|
|
<script type="text/javascript">
|
|
var bIsInsert = false; //标记DW是否处于“新增状态”
|
|
function saveRecord(sPostEvents){
|
|
var sIsInUse = getItemValue(0,getRow(),"IsInUse");
|
|
|
|
if(sIsInUse != 1){
|
|
var sPara = "NodeIDArr=" + "<%=sNodeID%>";
|
|
result = RunJavaMethodTrans("com.amarsoft.app.als.product.ProductHelper", "check4Delete",sPara);
|
|
|
|
if(result != "NOT EXISTS"){
|
|
var prdName = result.split("@").join("|");
|
|
var msg = "无法更改使用状态. 产品 (" + prdName.substring(0,prdName.length-1) + ") 关联到该节点.";
|
|
alert(msg);
|
|
|
|
return;
|
|
}
|
|
}
|
|
|
|
if(bIsInsert){
|
|
if (!ValidityCheck()) return;
|
|
beforeInsert();
|
|
}
|
|
|
|
beforeUpdate();
|
|
as_save("myiframe0",sPostEvents);
|
|
}
|
|
|
|
function goBack(){
|
|
parent.AsDialog.ClosePage();
|
|
}
|
|
|
|
<%/*~[Describe=执行插入操作前执行的代码;]~*/%>
|
|
function beforeInsert(){
|
|
setItemValue(0,0,"InputUserID","<%=CurUser.getUserID()%>");
|
|
setItemValue(0,0,"InputOrgID","<%=CurUser.getOrgID()%>");
|
|
setItemValue(0,0,"InputTime","<%=DateX.format(new java.util.Date(),"yyyy/MM/dd hh:mm:ss")%>");
|
|
bIsInsert = false;
|
|
}
|
|
|
|
<%/*~[Describe=执行更新操作前执行的代码;]~*/%>
|
|
function beforeUpdate(){
|
|
setItemValue(0,0,"UpdateUserID","<%=CurUser.getUserID()%>");
|
|
setItemValue(0,0,"UpdateTime","<%=DateX.format(new java.util.Date(),"yyyy/MM/dd hh:mm:ss")%>");
|
|
var nodeID=getItemValue(0,getRow(),"NodeID");
|
|
var newNodeName=getItemValue(0,getRow(),"NodeName");
|
|
var sPara = "NodeID="+nodeID+",NodeName="+newNodeName;
|
|
|
|
//检查节点名称是否改动
|
|
result = RunJavaMethodTrans("com.amarsoft.app.als.product.ProductHelper", "checkNodeName",sPara);
|
|
if(result=="False"){
|
|
//更新PRD_NODECONFIG
|
|
result = RunJavaMethodTrans("com.amarsoft.app.als.product.ProductHelper", "UpdatePRDNodeConfig",sPara);
|
|
}
|
|
}
|
|
|
|
function initRow(){
|
|
if (getRowCount(0)==0){//如当前无记录,则新增一条
|
|
bIsInsert = true;
|
|
}else{
|
|
setItemDisabled(0,0,'NodeID',true);//非新增状态下节点编号不可编辑
|
|
}
|
|
}
|
|
|
|
/*~[Describe=有效性检查;InputParam=无;OutPutParam=通过true,否则false;]~*/
|
|
function ValidityCheck(){
|
|
//检查录入的代码项编号是否存在
|
|
var sNodeID = getItemValue(0,0,"NodeID");
|
|
if(typeof(sNodeID) != "undefined" && sNodeID != ""){
|
|
var sParam = "nodeID="+sNodeID;
|
|
sReturn = RunJavaMethodTrans("com.amarsoft.app.als.product.CheckNodeID", "checkNodeID", sParam);
|
|
if(typeof(sReturn)!= "undefined" && sReturn != ""){
|
|
alert(getMessageText('ALS71056')); //对不起,已存在该节点编号!
|
|
return false;
|
|
}
|
|
}
|
|
return true;
|
|
}
|
|
|
|
$(document).ready(
|
|
function(){
|
|
bFreeFormMultiCol = false;
|
|
initRow();
|
|
}
|
|
);
|
|
</script>
|
|
<%@ include file="/Frame/resources/include/include_end.jspf"%> |