Chinaunix首页 | 论坛 | 博客
  • 博客访问: 26267109
  • 博文数量: 2065
  • 博客积分: 10377
  • 博客等级: 上将
  • 技术积分: 21525
  • 用 户 组: 普通用户
  • 注册时间: 2008-11-04 17:50
文章分类

全部博文(2065)

文章存档

2012年(2)

2011年(19)

2010年(1160)

2009年(969)

2008年(153)

分类: Java

2009-07-17 23:01:51

  1. <%@ page contentType = "text/html; charset=GBK"  import="java.util.*,com.wehave.hyerp.procurement.domain.Cgsqd"%>  
  2. <%@ taglib uri="struts-html" prefix="html" %>  
  3. <%@ taglib uri="struts-logic" prefix="logic" %>  
  4. <%@ taglib uri="struts-bean" prefix="bean" %>  
  5.   
  6.       
  7.            
  8.         "stylesheet" type = "text/css" href = "../css/olstyle.css">      
  9.         "text/javascript">  
  10.         var req;  
  11.         window.onload=function(){  
  12.         }  
  13.           
  14.         function Change_Select()  
  15.         {  
  16.             var zhi=document.getElementById('m_gykfwzlbb_lbbm').value;  
  17.             var url="sqdSelect.go?method=getSkill&id="+zhi;  
  18.             if(zhi=="0"){  
  19.                 alert("请选择您要察看的信息");  
  20.                    return;  
  21.             }else{  
  22.                 if(window.XMLHttpRequest)  
  23.                 {  
  24.                     req=new XMLHttpRequest();  
  25.                 }else if(window.ActiveXObject)  
  26.                 {  
  27.                     req=new ActiveXObject("Microsoft.XMLHTTP");  
  28.                 }  
  29.                   
  30.                 if(req)  
  31.                 {  
  32.                     req.open("GET",url,true);  
  33.                     req.onreadystatechange=callback;  
  34.                     req.send(null);  
  35.                 }  
  36.             }  
  37.         }  
  38.           
  39.         function Change_Select2()  
  40.         {  
  41.             var zhi=document.getElementById('m_lbbm_se').value;  
  42.             //alert(zhi.substring(0,2));  
  43.             if(zhi=="0"){  
  44.                 alert("请选择您要察看的信息");  
  45.                    return;  
  46.                }  
  47.             if(zhi.substring(0,2)=="WY"){  
  48.                 var url="sqdSelect.go?method=getSkill2&id="+zhi;  
  49.                 if(window.XMLHttpRequest)  
  50.                 {  
  51.                     req=new XMLHttpRequest();  
  52.                 }else if(window.ActiveXObject)  
  53.                 {  
  54.                     req=new ActiveXObject("Microsoft.XMLHTTP");  
  55.                 }  
  56.                   
  57.                 if(req)  
  58.                 {  
  59.                     req.open("GET",url,true);  
  60.                     req.onreadystatechange=callback2;  
  61.                     req.send(null);  
  62.                 }  
  63.             }else{  
  64.                 parent.topFram.location ="sqdSelectAll.go?method=getlistAll&id="+zhi;  
  65.             }  
  66.         }  
  67.           
  68.         function Change_Select3()  
  69.         {  
  70.             var zhi=document.getElementById('m_lbbm_th').value;  
  71.             //alert(zhi.substring(0,2));  
  72.             if(zhi=="0"){  
  73.                 alert("请选择您要察看的信息");  
  74.                    return;  
  75.                }else{  
  76.                 parent.topFram.location ="sqdSelectAll.go?method=getlistAll2&id="+zhi;  
  77.             }  
  78.         }  
  79.           
  80.         function callback()  
  81.         {  
  82.             if(req.readyState == 4)  
  83.             {  
  84.                 if(req.status == 200)  
  85.                 {  
  86.                     parseMessage();  
  87.                 }else{  
  88.                     alert("Not able to retrieve description"+req.statusText);  
  89.                 }  
  90.             }  
  91.         }  
  92.           
  93.         function callback2()  
  94.         {  
  95.             if(req.readyState == 4)  
  96.             {  
  97.                 if(req.status == 200)  
  98.                 {  
  99.                     parseMessage2();  
  100.                 }else{  
  101.                     alert("Not able to retrieve description"+req.statusText);  
  102.                 }  
  103.             }  
  104.         }  
  105.           
  106.         function parseMessage()  
  107.         {  
  108.             var xmlDoc=req.responseXML.documentElement;  
  109.             var xSel=xmlDoc.getElementsByTagName('select');  
  110.             var select_root=document.getElementById('m_lbbm_se');  
  111.             select_root.options.length=0;  
  112.               
  113.             for(var i=0;i
  114.             {  
  115.                 var xValue=xSel[i].childNodes[0].firstChild.nodeValue;  
  116.                 var xText=xSel[i].childNodes[1].firstChild.nodeValue;  
  117.                 var option=new Option(xText,xValue);  
  118.                 try{  
  119.                     select_root.add(option);  
  120.                 }catch(e){  
  121.                 }  
  122.             }  
  123.         }  
  124.           
  125.         function parseMessage2()  
  126.         {  
  127.             var xmlDoc=req.responseXML.documentElement;  
  128.             var xSel=xmlDoc.getElementsByTagName('select');  
  129.             var select_root=document.getElementById('m_lbbm_th');  
  130.             select_root.options.length=0;  
  131.               
  132.             for(var i=0;i
  133.             {  
  134.                 var xValue=xSel[i].childNodes[0].firstChild.nodeValue;  
  135.                 var xText=xSel[i].childNodes[1].firstChild.nodeValue;  
  136.                 var option=new Option(xText,xValue);  
  137.                 try{  
  138.                     select_root.add(option);  
  139.                 }catch(e){  
  140.                 }  
  141.             }  
  142.         }  
  143.           
  144.           
  145.           
  146.       
  147.       
  148.   
  149. "#C8D0D4">  
  150.     "/cgsqdNewAction.go">   
  151.     class = "cbToolbar" id = "idToolbar" cellpadding = '0' cellspacing = '0'>  
  152.         "left" valign = "top" >  
  153.              物质类别:    
  154.                 "m_gykfwzlbb_lbbm" onchange="Change_Select()">  
  155.                     "0">请选择  
  156.                        "LbfList" property="m_gykfwzlbb_lbbm" labelProperty="m_gykfwzlbb_lbmc"/>  
  157.                     
  158.                 "m_lbbm_se" styleId="m_lbbm_se" onchange="Change_Select2()">  
  159.                     "0">     
  160.                   
  161.                 "m_lbbm_th" styleId="m_lbbm_th" onchange="Change_Select3()">  
  162.                     "0">     
  163.                   
  164.                   
  165.               
  166.               
  167.           
  168.       
  169.        
  170.   
  171.   
  172. /** 
  173.      *  
  174.      * 查询物质编码类别列表操作(一级) 
  175.      * */  
  176.     public ActionForward doSelectWzlb(  
  177.             ActionMapping mapping,  
  178.             ActionForm form,  
  179.             HttpServletRequest req,  
  180.             HttpServletResponse res) {  
  181.         HttpSession session = req.getSession();  
  182.         UserSession userSession =  
  183.             (UserSession) session.getAttribute("userSession");  
  184.         permission.setUserID(userSession.getUserId());  
  185.         permission.setUserName(userSession.getUserName());  
  186.         permission.setModuleName("m_cgsqd");  
  187.         permission.setActionStr("'m_select'");  
  188.         if(permissionService.checkUserPermission(permission)){  
  189.             int updateSign=0;  
  190.             try{  
  191.                 cgsqdService.updateCgsqwzhzb_sqsl();  
  192.                 updateSign=1;  
  193.             }catch(Exception e){  
  194.                 e.printStackTrace();  
  195.                 updateSign=0;  
  196.             }  
  197.             if(updateSign==1){  
  198.                 List LbfList=cgsqdService.treeListWzlb2();  
  199.                 req.setAttribute("LbfList",LbfList);  
  200.                 return mapping.findForward("tools");  
  201.             }else{  
  202.                 return null;  
  203.             }  
  204.         }else{  
  205.             return mapping.findForward("failure");  
  206.         }  
  207.     }  
  208.       
  209.     /** *//** 
  210.      *  
  211.      * 查询物质编码类别列表操作(二级) 
  212.      * */  
  213.     public ActionForward doSelectWzlb1(  
  214.             ActionMapping mapping,  
  215.             ActionForm form,  
  216.             HttpServletRequest req,  
  217.             HttpServletResponse res) {  
  218.         HttpSession session = req.getSession();  
  219.         UserSession userSession =  
  220.             (UserSession) session.getAttribute("userSession");  
  221.         permission.setUserID(userSession.getUserId());  
  222.         permission.setUserName(userSession.getUserName());  
  223.         permission.setModuleName("m_cgsqd");  
  224.         permission.setActionStr("'m_select'");  
  225.         if(permissionService.checkUserPermission(permission)){  
  226.             int updateSign=0;  
  227.             try{  
  228.                 cgsqdService.updateCgsqwzhzb_sqsl();  
  229.                 updateSign=1;  
  230.             }catch(Exception e){  
  231.                 e.printStackTrace();  
  232.                 updateSign=0;  
  233.             }  
  234.             if(updateSign==1){  
  235.                 List LbfList=cgsqdService.treeListWzlb2();  
  236.                 req.setAttribute("LbfList",LbfList);  
  237.                 return mapping.findForward("tools1");  
  238.             }else{  
  239.                 return null;  
  240.             }  
  241.         }else{  
  242.             return mapping.findForward("failure");  
  243.         }  
  244.     }  
  245.       
  246.     /** *//** 
  247.      *  
  248.      * 查询物质编码类别列表操作(三级) 
  249.      * */  
  250.     public ActionForward getSkill(  
  251.             ActionMapping mapping,  
  252.             ActionForm form,  
  253.             HttpServletRequest req,  
  254.             HttpServletResponse res) {  
  255.         HttpSession session = req.getSession();  
  256.         UserSession userSession =  
  257.             (UserSession) session.getAttribute("userSession");  
  258.         permission.setUserID(userSession.getUserId());  
  259.         permission.setUserName(userSession.getUserName());  
  260.         permission.setModuleName("m_cgsqd");  
  261.         permission.setActionStr("'m_select'");  
  262.         if(permissionService.checkUserPermission(permission)){  
  263.             String id=req.getParameter("id");  
  264.               
  265.             res.setContentType("text/xml;charset=GBK");  
  266.             res.setHeader("Cache-Control","no-cache");  
  267.             String xml_start="";  
  268.             xml_start+="";  
  269.             String xml_end="";  
  270.             String xml="";  
  271.             String m_lbbm_se="";  
  272.             String m_lbmc_se="";  
  273.             List LbfList=null;  
  274.             if(id.equals("WY")){  
  275.                 LbfList=cgsqdService.treeListWzlb3_2(id);  
  276.             }else{  
  277.                 LbfList=cgsqdService.treeListWzlb3_1(id);      
  278.             }  
  279.             Iterator it=LbfList.iterator();  
  280.             while(it.hasNext()){  
  281.                 Cgsqd cgsqd=(Cgsqd)it.next();  
  282.                 m_lbbm_se=cgsqd.getM_gykfwzlbb_lbbm();  
  283.                 m_lbmc_se=cgsqd.getM_gykfwzlbb_lbmc();  
  284.                 xml +="";  
  285.             }  
  286.             String last_xml=xml_start+xml+xml_end;  
  287.             logger.debug("XML是:"+last_xml);  
  288.             try {  
  289.                 res.getWriter().write(last_xml);  
  290.             } catch (IOException e) {  
  291.                 e.printStackTrace();  
  292.             }  
  293.             return null;  
  294.         }else{  
  295.             return null;  
  296.         }  
  297.     } 
阅读(812) | 评论(0) | 转发(0) |
0

上一篇:CI学习篇二

下一篇:PHP版的三级联动选择

给主人留下些什么吧!~~