102 lines
4.6 KiB
Plaintext
102 lines
4.6 KiB
Plaintext
<%@page import="com.amarsoft.app.base.util.SystemHelper"%>
|
|
<%@page import="com.amarsoft.app.base.util.ObjectWindowHelper"%>
|
|
<%@page import="com.amarsoft.app.base.businessobject.*"%>
|
|
<%@ page contentType="text/html; charset=GBK"%><%@
|
|
include file="/Frame/resources/include/include_begin_info.jspf"%>
|
|
<%
|
|
/*
|
|
页面说明: 示例列表页面
|
|
*/
|
|
String PG_TITLE = "产品详情";
|
|
String type = CurPage.getAttribute("type");
|
|
BusinessObject inputParameter=SystemHelper.getPageComponentParameters(CurPage);
|
|
Map<String,Object> map =inputParameter.convertToMap();
|
|
String typeNo = map.get("TypeNo").toString();
|
|
String serialNo = Sqlca.getString("select serialno from prd_specific_library where businesstype = '" + typeNo + "'");
|
|
serialNo = serialNo == null ? "" : serialNo;
|
|
String catalogNo = (String)map.get("SortNo");
|
|
ASObjectWindow dwTemp =ObjectWindowHelper.createObjectWindow_Info("PRD_ProductInfo", inputParameter, CurPage, request);//模板左边
|
|
ASDataObject doTemp=dwTemp.getDataObject();
|
|
//将ParaID作为参数传给显示模板
|
|
dwTemp.genHTMLObjectWindow("");
|
|
String sButtons[][] = {
|
|
{"true","All","Button","保存","保存所有修改","saveRecord()","","","","btn_icon_save"},
|
|
{"false","","Button","返回","返回","parent.AsDialog.ClosePage()","","","","btn_icon_return"}
|
|
};
|
|
%><%@
|
|
include file="/Frame/resources/include/ui/include_info.jspf"%>
|
|
<script type="text/javascript">
|
|
var oldTypeNo;
|
|
function saveRecord(){
|
|
if(!iV_all(0)) return;
|
|
var typeNo = getItemValue(0,getRow(),"TypeNo");
|
|
var sortNo = getItemValue(0,getRow(),"SortNo");
|
|
var result = AsControl.RunJavaMethodTrans("com.amarsoft.app.als.prd.manager.ProductManager","getSortNo","newProductID="+typeNo+",catalogNo=<%=catalogNo%>,type=<%=type%>,sortNo="+sortNo + ",userId=<%=CurUser.getUserID()%>,orgId=<%=CurUser.getOrgID()%>");
|
|
var results = result.split('@');
|
|
setItemValue(0,getRow(),"sortno",results[1]);
|
|
as_save(0,"specificInfo();");
|
|
}
|
|
|
|
function checkTypeNo(){
|
|
//这个方法被模板配置,给两个单选按钮配置事件,意义在于先进行新增产品的时候,先进行数据库查找产品的编号,有,则执行下面的显示方法,无,不显示,简单说就是判断新增产品的时候保存按钮的点击与否
|
|
var typeNo = getItemValue(0,getRow(),"TypeNo");
|
|
var result = AsControl.RunJavaMethodTrans("com.amarsoft.app.als.prd.manager.ProductManager","checkSave","typeNo="+typeNo);
|
|
if(result){//如果框架方法返回值不为空,说明有数据,是点击过保存按钮的,否则不调用specificInfo()方法,不显示下面的页面
|
|
specificInfo();
|
|
}
|
|
}
|
|
|
|
function specificInfo(){
|
|
var typeNo = getItemValue(0,getRow(),"TypeNo");
|
|
var typeName = getItemValue(0,getRow(),"TypeName");
|
|
AsControl.RunJavaMethodTrans("com.amarsoft.app.als.prd.manager.ProductManager","updateProductName","productID="+typeNo+",productName="+typeName);
|
|
|
|
document.getElementById("sys_sub_page_frame_GGDY").parentNode.parentNode.style.display = "none";
|
|
var typeNo = getItemValue(0,getRow(),"TypeNo");
|
|
var productType1 = getItemValue(0,getRow(),"Attribute1");//产品类型
|
|
var productType2 = getItemValue(0,getRow(),"Attribute2");//产品类型
|
|
if(!typeNo){
|
|
//隐藏规格信息
|
|
document.all("A_Group_0020").style.display = "none";
|
|
return;
|
|
}
|
|
if(!productType1) return;
|
|
if(oldTypeNo && typeNo != oldTypeNo){
|
|
var result = AsControl.RunJavaMethodTrans("com.amarsoft.app.als.prd.manager.ProductManager","updateProduct","ProductID="+oldTypeNo+",NewProductID="+typeNo);
|
|
if(result.split("@")[0] == "false")
|
|
{
|
|
alert(result.split("@")[1]);
|
|
return;
|
|
}
|
|
}
|
|
document.all("A_Group_0020").style.display = "";
|
|
var serialNo = "<%=serialNo %>";
|
|
/* AsControl.OpenView("/ProductManage/ProductConfig/ProductSpecificList.jsp","ProductID="+typeNo+"&ProductType1="+productType1+"&ProductType2="+productType2,"sys_sub_page_frame_GGDY",""); */
|
|
AsControl.OpenView("/ProductManage/ProductConfig/ProductSpecificInfo.jsp","SerialNo=" + serialNo + "&ProductID="+typeNo+"&ProductType1="+productType1+"&ProductType2="+productType2,"sys_sub_page_frame_GGXX","");
|
|
}
|
|
|
|
//打开规格页面
|
|
function openSpecificInfo(para){
|
|
AsControl.OpenView("/ProductManage/ProductConfig/ProductSpecificInfo.jsp",para,"sys_sub_page_frame_GGXX","");
|
|
}
|
|
|
|
|
|
$().ready(function(){
|
|
oldTypeNo = getItemValue(0,getRow(),"TypeNo");
|
|
if(oldTypeNo != null && oldTypeNo != ""){
|
|
setItemReadOnly(0,getRow(),"TypeNo",true);
|
|
}else{
|
|
setItemRequired(0,"ISINUSE",false);
|
|
setItemValue(0, getRow(), "ISINUSE", "");
|
|
}
|
|
if(getItemValue(0,getRow(),"ISINUSE") == ""){
|
|
setItemRequired(0,"ISINUSE",false);
|
|
}
|
|
if('<%=type%>' == 'add'){
|
|
setItemValue(0, getRow(), "ISINUSE", "2");
|
|
}
|
|
//setItemReadOnly(0,getRow(),"ISINUSE",true);
|
|
specificInfo();
|
|
});
|
|
</script>
|
|
<%@ include file="/Frame/resources/include/include_end.jspf"%> |