easyUI给另一个页面传值并传表头的值和图标(企业信息统计)

1.主JSP

<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ page import="aisino.reportform.model.base.SessionInfo"%>
<%
	String contextPath = request.getContextPath();
	SessionInfo sessionInfo = (SessionInfo) session
			.getAttribute("sessionInfo");
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
    
    <title>增值税发票风险防控系统</title>
	<jsp:include page="../../../inc.jsp"></jsp:include>
	<style type = "text/css">
		.begin{
			align-items: center;
    		justify-content: center;
		}
		.searchTime{
			width:70%
		}
		.buttonTime{
			width:30%
		}
		.datagrid-htable tr{
			rowspan:2;
		}
	</style>
	<script>

		//跳转合同明细界面
		function update(SWJGMC,LB,title){
			var beginTime = $("#dateBoxBegin").datebox("getValue");  
			var endTime = 	$("#dateBoxEnd").datebox("getValue");
			var tabs = top.$("#mainTabs");
			var src = sy.contextPath+'/securityJsp/base/linsa/informationStatistics_contractRecord.jsp?SWJGMC='+encodeURI(encodeURI(SWJGMC))+"&LB="+encodeURI(encodeURI(LB))
			+"&beginTime="+encodeURI(encodeURI(beginTime))+"&endTime="+encodeURI(encodeURI(endTime));
			var opts = {
					title : title,
					closable : true,
					iconCls : "ext-icon-book_open",
					content : sy
							.formatString(
									'<iframe src="{0}" allowTransparency="true" style="border:0;width:100%;height:99%;" frameBorder="0"></iframe>',
									src),
					border : false,
					fit : true
				};
			tabs.tabs('add', opts);
		}
		
		//修改列表数据
		function to_other(src,title,icon){
		
		var tabs = top.$("#mainTabs");
		var opts = {
				title : title,
				closable : true,
				iconCls : icon,
				content : sy
						.formatString(
								'<iframe src="{0}" allowTransparency="true" style="border:0;width:100%;height:99%;" frameBorder="0"></iframe>',
								sy.contextPath+src),
				border : false,
				fit : true
			};
		tabs.tabs('add', opts);
		
	}
		
		/* 在这里书写对应的代码,包括了对应的ajax */
		$(document).ready(function(){  
                $("#searchBtn").click(function(){  
                    var search = $('#searchBox').searchbox('menu');    
                });  
                var datagrid = $('#mainInfo').datagrid({
                   
                    toolbar:'#toolBar',
                    striped:true,			//	配置每一行的颜色为不同
                    fitColumns:false,		//自动宽度
                    rownumbers : true,		//行号
					pagination : true,		//分页
					scrollbarSize :0,
					pageSize : 50,
                    url:sy.contextPath + '/base/information-statistics!doNotNeedSessionAndSecurity_findByType.sy', 
                    columns:[[
							  {field:'ID',rowspan:2,colspan:1,title:'序号',width:100,hidden:true},
                              {field:'',rowspan:1,colspan:1,title:'',width:200,align:'center'},
  			    			  {field:'',rowspan:1,colspan:2,title:'合同份数',width:300,align:'center'},
                              {field:'',rowspan:1,colspan:1,title:'常驻代表机构',width:150,align:'center'},
                              {field:'',rowspan:1,colspan:1,title:'享受税收协定待遇企业',width:150,align:'center'},
                              {field:'',rowspan:1,colspan:1,title:'“走出去”企业',width:150,align:'center'}
                         ],[
                              {field:'SWJGMC',rowspan:1,colspan:1,title:'税务机关',width:200,align:'center'},
                              {field:'ZDKJL',rowspan:1,colspan:1,title:'指定扣缴类',width:150,align:'center',formatter: function(value,row,index){
                					if(value==undefined){
                						value = 0;
                					};
                            	    var str='';
                					str += sy.formatString(
 											'<input type="button" value="'+value+'" onclick="update(\'{0}\',\'指定扣缴类\',\'指定类合同明细\');"/>&nbsp;&nbsp;',
 											row.ZDKJLSWJGMC);
                          	  return str;
                			  }},
                			  {field:'ZDKJLSWJGMC',rowspan:1,colspan:1,title:'指定扣缴类税务机关名称',width:100,align:'center',hidden:true},
                			  {field:'YQKJL',rowspan:1,colspan:1,title:'法定源泉类',width:150,align:'center',formatter: function(value,row,index){
                				if(value==undefined){
              						value = 0;
              					};
                				var str='';
              					str += sy.formatString(
											'<input type="button" value="'+value+'" onclick="update(\'{0}\',\'法定源泉类\',\'源泉类合同明细\');"/>&nbsp;&nbsp;',
											row.YQKJLSWJGMC);
                        	  return str;
              			  	  }},
              			  	  {field:'YQKJLSWJGMC',rowspan:1,colspan:1,title:'法定源泉类合税务机关名称',width:100,align:'center',hidden:true},
              			  	  {field:'CZDBJG',rowspan:1,colspan:1,title:'',width:150,align:'center',formatter: function(value,row,index){
              			  		if(value==undefined){
              						value = 0;
              					};
              			  		var str='';
              					str += sy.formatString(
											'<input type="button" value="'+value+'" onclick="to_other(\'/securityJsp/base/pgxt/ceshiReturn.jsp\',\'常驻代表机构\',\'ext-icon-transmit_blue\');"/>&nbsp;&nbsp;');
                        	  return str;
              			  	  }},
              			  	  {field:'XSSSXDDYQY',rowspan:1,colspan:1,title:'',width:150,align:'center',formatter: function(value,row,index){
              			  		if(value==undefined){
              						value = 0;
              					};
              			  		var str='';
               					str += sy.formatString(
 											'<input type="button" value="'+value+'" onclick="to_other(\'{0}\');"/>&nbsp;&nbsp;');
                         	  return str;
               			  	  }},
               			   	  {field:'ZCQQY',rowspan:1,colspan:1,title:'',width:150,align:'center',formatter: function(value,row,index){
               			   		if(value==undefined){
          							value = 0;
          						};
               			   		var str='';
              					str += sy.formatString(
											'<input type="button" value="'+value+'" onclick="to_other(\'/securityJsp/base/linsa/managementAccount.jsp\',\'走出去企业管理台账\',\'ext-icon-book_open\');"/>&nbsp;&nbsp;');
                        	  return str;
              			  	  }}
                      ]],

      });
                var mydate = new Date();
                var nowTime=mydate.toLocaleString();
                /* 定义时间的搜索 */
                $("#dateBoxBegin").datebox({
                    required:false,
                    currentText:nowTime
                });
                $("#dateBoxEnd").datebox({
                    required:false,
                    currentText:nowTime
                });
            });  
		/*查找所有派单内容的方法*/
		function toFind(type){
			/*这里进行当前查询内容的赋值*/
			var nowType = type;
			if(nowType == "byTime"){
				var beginTime = $("#dateBoxBegin").datebox("getValue");  
				var endTime = 	$("#dateBoxEnd").datebox("getValue");
				$('#mainInfo').datagrid('load',{                          
	                "nowType":nowType,
	                "beginTime":beginTime,
	                "endTime":endTime,
	            }); 
			}
		}
		
	</script>
  </head>
  <body>
   		<!-- 一个大的div,这个div,用来对时间进行布局 -->
   		
   		<div class = "begin easyui-layout">
   			
   			<div id="toolBar">
   			<table>
   				<tr>
   			 	<td>
   				合同备案日期起:
   				<input id="dateBoxBegin"  class="easyui-textbox" ></td>
   				<td>合同备案日期止:
   				<input id="dateBoxEnd" type="text">
   				<a href="javascript:void(0);" class="easyui-linkbutton"
						data-options="iconCls:'ext-icon-zoom'" onclick = "toFind('byTime')">日期搜索合同份数</a>
				</td>
   			 </tr>
   			</table>
   			</div>
   		</div>
   		<!-- 创建分页 beagin -->
        <table id="mainInfo" class="datagrid" style="width: 100%;" data-options="fit:true,border:false">
        	
        </table>
        
  </body>
</html>

2.合同备案中间JSP

<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ page import="aisino.reportform.model.base.SessionInfo"%>
<%
	String contextPath = request.getContextPath();
	SessionInfo sessionInfo = (SessionInfo) session
			.getAttribute("sessionInfo");
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
    
    <title>增值税发票风险防控系统</title>
	<jsp:include page="../../../inc.jsp"></jsp:include>
	<style type = "text/css">
		.begin{
			align-items: center;
    		justify-content: center;
		}
		.searchTime{
			width:70%
		}
		.buttonTime{
			width:30%
		}
		.datagrid-htable tr{
			rowspan:2;
		}
	</style>
	<script>
		
		//修改列表数据
		function to_other(){
		
		var tabs = top.$("#mainTabs");
		var src = sy.contextPath+"/securityJsp/base/linsa/contractRecord.jsp";
		var opts = {
				title : "合同管理台账",
				closable : true,
				iconCls : "ext-icon-book_open",
				content : sy
						.formatString(
								'<iframe src="{0}" allowTransparency="true" style="border:0;width:100%;height:99%;" frameBorder="0"></iframe>',
								src),
				border : false,
				fit : true
			};
		tabs.tabs('add', opts);
		
	}
		
		/* 在这里书写对应的代码,包括了对应的ajax */
		$(document).ready(function(){  
                $("#searchBtn").click(function(){  
                    var search = $('#searchBox').searchbox('menu');    
                }); 
                var ySWJGMC = "<%=java.net.URLDecoder.decode(request.getParameter("SWJGMC").toString(),"UTF-8")%>";
                var yLB = "<%=java.net.URLDecoder.decode(request.getParameter("LB").toString(),"UTF-8")%>";
                var ybeginTime = "<%=java.net.URLDecoder.decode(request.getParameter("beginTime").toString(),"UTF-8")%>";
                var yendTime = "<%=java.net.URLDecoder.decode(request.getParameter("endTime").toString(),"UTF-8")%>";
                var datagrid = $('#mainInfo').datagrid({
                   
                    //toolbar:'#toolBar',
                    striped:true,			//	配置每一行的颜色为不同
                    fitColumns:false,		//自动宽度
                    rownumbers : true,		//行号
					pagination : true,		//分页
					scrollbarSize :0,
					pageSize : 50,
                    url:sy.contextPath + '/base/information-statistics!doNotNeedSessionAndSecurity_findByNSRSBH.sy',
					queryParams: {
						SWJGMC: ySWJGMC,
						LB: yLB,
						beginTime: ybeginTime,
						endTime: yendTime
					},


                    //固定在左边的列
                    frozenColumns: [[
                        {field:'查看明细',rowspan:1,colspan:1,title:'操作',width:100,align:'center',formatter: function(value,row,index){
                					var str='';
                					str=sy.formatString('<input type="button" value="查看明细" style="position:relative;left:0px;" onclick="to_other();"/>');
                          	  return str;
                			  }}
                    ]],
                    columns:[[
							  {field:'ID',rowspan:1,colspan:1,title:'序号',width:100,hidden:true},
                              {field:'SHXYDM',rowspan:1,colspan:1,title:'社会统一信用代码',width:120,align:'center'},
  			    			  {field:'FJMQYMC',rowspan:1,colspan:1,title:'企业名称',width:100,align:'center'},
                              {field:'SWJGMC',rowspan:1,colspan:1,title:'税务机关',width:100,align:'center'},
                              {field:'ZCDJRQ',rowspan:1,colspan:1,title:'注册登记日期',width:100,align:'center'},
                              {field:'HYMC',rowspan:1,colspan:1,title:'行业',width:100,align:'center'},
                              {field:'HTXMMC',rowspan:1,colspan:1,title:'合同名称',width:100,align:'center'},
                              {field:'SDLXDL',rowspan:1,colspan:1,title:'所得类型大类',width:100,align:'center'},
                              {field:'SDLXXL',rowspan:1,colspan:1,title:'所得类型明细',width:100,align:'center'},
                              {field:'YBSEZZS',rowspan:1,colspan:1,title:'合同执行期内增值税',width:150,align:'center'},
                              {field:'YBSESDS',rowspan:1,colspan:1,title:'合同执行期内企业所得税',width:150,align:'center'},
                              {field:'支付进度',rowspan:1,colspan:1,title:'支付进度',width:300,align:'center',formatter: function(value,row,index){
                            	if(row.HTZJK==undefined){
                            		row.HTZJK = 0;
              					};
                            	if(row.YZFJE==undefined){
                            		row.YZFJE = 0;
              					};
                            	var str='';
              					str=sy.formatString('合同总价款:'+row.HTZJK+',已支付金额:'+row.YZFJE);
                        	  return str;
              			  	  }}
                         ]],

      });
      });
		
	</script>
	
  </head>
  <body>
   		<!-- 一个大的div,这个div,用来对时间进行布局 -->
   		
   		<div class = "begin easyui-layout">
   			
   			<div id="toolBar">
   			<table>
   			</table>
   			</div>
   		</div>
   		<!-- 创建分页 beagin -->
        <table id="mainInfo" class="datagrid" style="width: 100%;" data-options="fit:true,border:false">
        	
        </table>
		
  </body>
</html>

3.Java后台

import java.io.UnsupportedEncodingException;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import java.util.List;

import org.apache.struts2.convention.annotation.Action;
import org.apache.struts2.convention.annotation.Namespace;
import org.springframework.beans.factory.annotation.Autowired;

import aisino.reportform.action.BaseAction;
import aisino.reportform.action.qingyang.db.DB;
import aisino.reportform.model.base.TF_pd;
import aisino.reportform.model.easyui.Grid;
import aisino.reportform.model.easyui.Json;
import aisino.reportform.service.base.FindDispatchActionServicel;

/**
 *
 * @Title:InformationStatisticsAction
 * @Description: 企业基本信息统计控制器
 * @author linsa
 * @version V1.04
 * @date 2018年7月18日
 */
@Namespace("/base")
@Action
public class InformationStatisticsAction extends BaseAction<TF_pd> {

    @Autowired
    private FindDispatchActionServicel findDispatchActionServicel;

    public void setFindDispatchActionServicel(
            FindDispatchActionServicel findDispatchActionServicel) {
        this.findDispatchActionServicel = findDispatchActionServicel;
    }

    //企业基本信息统计列表
    public void doNotNeedSessionAndSecurity_findByType() {
        /* 首先new一个json类出来,用来保存json数据 */
        Grid grid = new Grid();
        Json json = new Json();
        try {
            this.getRequest().setCharacterEncoding("utf-8");
            this.getResponse().setCharacterEncoding("utf-8");
            /* 得到当前从页面传递回来的类型参数 */
            String type = this.getRequest().getParameter("nowType");
            String hql = "select SWJGMC from HX_DM_ZDY.DM_GY_SWJG@CDSJFF";
            String sql = "select count(*) from HX_DM_ZDY.DM_GY_SWJG@CDSJFF";
            int number = -1; // 这个是判断查询那种类型的内容
            List<HashMap> list = new ArrayList();
			/*HashMap map1 = new HashMap();
			map1.put("SWJGMC", "第一税务分局");
			HashMap map2 = new HashMap();
			map2.put("SWJGMC", "第二税务分局");
			HashMap map3 = new HashMap();
			map3.put("SWJGMC", "第三税务分局");
			HashMap map4 = new HashMap();
			map4.put("SWJGMC", "国家税务局");
			HashMap map5 = new HashMap();
			map5.put("SWJGMC", "税源管理二科");
			list.add(map1);
			list.add(map2);
			list.add(map3);
			list.add(map4);
			list.add(map5);*/
            long listSize = 0; // 返回页面的大小。
            int number1 = Integer.parseInt(this.getRequest().getParameter(
                    "page")); // 当前页数
            int number2 = Integer.parseInt(this.getRequest().getParameter(
                    "rows")); // 每页大小
            //Long total = 2l;
            list = findDispatchActionServicel.findBySql(hql, number1, number2);
            Long total = findDispatchActionServicel.countBySql(sql);

            //指定扣缴类各税务机关企业户数
            for(int i=0;i<list.size();i++){
                if(list.get(i).get("SWJGMC")!=null&&list.get(i).get("SWJGMC")!=""){
                    String aql = "select count(*) from FHMQYDWZFXX where SWJGMC= '"+list.get(i).get("SWJGMC")+"' and KJYWLX='指定扣缴类'";
                    if ("byTime".equals(type)) {
                        // 根据时间进行查询
                        String beginTime = this.getRequest().getParameter("beginTime"); // 开始查询
                        String endTime = this.getRequest().getParameter("endTime"); // 结束时间
                        aql += " and HTBARQ >= '" + beginTime.replace("-", "")
                                + "' and HTBARQ <= '" + endTime.replace("-", "")
                                + "'";
                    }
                    Long l = findDispatchActionServicel.countBySql(aql);
                    list.get(i).put("ZDKJL", l);
                    list.get(i).put("ZDKJLSWJGMC", list.get(i).get("SWJGMC"));
                }
            }

            //法定源泉类各税务机关企业户数
            for(int i=0;i<list.size();i++){
                if(list.get(i).get("SWJGMC")!=null&&list.get(i).get("SWJGMC")!=""){
                    String aql = "select count(*) from FHMQYDWZFXX where SWJGMC= '"+list.get(i).get("SWJGMC")+"' and KJYWLX='法定源泉类'";
                    if ("byTime".equals(type)) {
                        // 根据时间进行查询
                        String beginTime = this.getRequest().getParameter("beginTime"); // 开始查询
                        String endTime = this.getRequest().getParameter("endTime"); // 结束时间
                        aql += " and HTBARQ >= '" + beginTime.replace("-", "")
                                + "' and HTBARQ <= '" + endTime.replace("-", "")
                                + "'";
                    }
                    Long l = findDispatchActionServicel.countBySql(aql);
                    list.get(i).put("YQKJL", l);
                    list.get(i).put("YQKJLSWJGMC", list.get(i).get("SWJGMC"));
                }
            }

            //常驻代表各税务机关企业户数
            for(int i=0;i<list.size();i++){
                if(list.get(i).get("SWJGMC")!=null&&list.get(i).get("SWJGMC")!=""){
                    DB db = new DB();
                    Integer num;
                    try {
                        num = db.selectCZDBbySWJGMC((String)(list.get(i).get("SWJGMC")));
                        list.get(i).put("CZDBJG", num);
                    } catch (Exception e) {
                        e.printStackTrace();
                    }
                    list.get(i).put("CZDBJG", 0);
                }
            }

            //走出去各税务机关企业户数
            for(int i=0;i<list.size();i++){
                if(list.get(i).get("SWJGMC")!=null&&list.get(i).get("SWJGMC")!=""){
                    String aql = "select count(*) from ZCQQYGLTZ where SWJGMC= '"+list.get(i).get("SWJGMC")+"'";
                    Long l = findDispatchActionServicel.countBySql(aql);
                    list.get(i).put("ZCQQY", l);
                }
            }

            listSize = list.size();
            grid.setRows(list);
            grid.setTotal(total);
            json.setSuccess(true);
            writeJson(grid);
        } catch (UnsupportedEncodingException e) {
            e.printStackTrace();
            BaseAction.LOG.info("企业基本信息统计查询列表:doNotNeedSessionAndSecurity_findByType 时间:"+new Date());
        }

    }

    //合同明细界面列表
    public void doNotNeedSessionAndSecurity_findByNSRSBH() {
        /* 首先new一个json类出来,用来保存json数据 */
        Grid grid = new Grid();
        Json json = new Json();
        try {
            this.getRequest().setCharacterEncoding("utf-8");
            this.getResponse().setCharacterEncoding("utf-8");
            /* 得到当前从页面传递回来的类型参数 */
            String SWJGMC = this.getRequest().getParameter("SWJGMC");
            String LB = this.getRequest().getParameter("LB");
            String hql = "select SHXYDM,FJMQYMC,SWJGMC,DJZCRQ,HYMC,HTXMMC,SDLXDL,SDLXXL,"
                    +"YBSEZZS,YBSESDS,HTZJK,YZFJE from FHMQYDWZFXX where SWJGMC='"
                    +SWJGMC+"' and KJYWLX='"+LB+"'";
            String sql = "select count(*) from FHMQYDWZFXX where SWJGMC='"
                    +SWJGMC+"' and KJYWLX='"+LB+"'";
            int number = -1; // 这个是判断查询那种类型的内容
            List list = new ArrayList();
            long listSize = 0; // 返回页面的大小。
            int number1 = Integer.parseInt(this.getRequest().getParameter(
                    "page")); // 当前页数
            int number2 = Integer.parseInt(this.getRequest().getParameter(
                    "rows")); // 每页大小
            // 根据时间进行查询
            String beginTime = this.getRequest().getParameter("beginTime"); // 开始查询
            String endTime = this.getRequest().getParameter("endTime"); // 结束时间
            if (beginTime!=null&&beginTime!="") {
                hql += " and HTBARQ >= '" + beginTime.replace("-", "")
                        + "' and HTBARQ <= '" + endTime.replace("-", "")
                        + "'";
                sql += " and HTBARQ >= '" + beginTime.replace("-", "")
                        + "' and HTBARQ <= '" + endTime.replace("-", "")
                        + "'";
            }
            hql += " ORDER BY HTBARQ asc";

            list = findDispatchActionServicel.findBySql(hql, number1, number2);
            Long total = findDispatchActionServicel.countBySql(sql);
            listSize = list.size();
            grid.setRows(list);
            grid.setTotal(total);
            json.setSuccess(true);
            writeJson(grid);
        } catch (UnsupportedEncodingException e) {
            e.printStackTrace();
            BaseAction.LOG.info("企业基本信息统计合同明细界面列表:doNotNeedSessionAndSecurity_findByNSRSBH 时间:"+new Date());
        }

    }

}

4.列表借鉴图

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
可以通过easyui的事件和方法来实现这个需求。 1. 在第一个下拉框的onSelect事件中,判断选中的是否需要让第二个下拉框变为可选。如果需要,调用第二个下拉框的enable方法,使其变为可选;如果不需要,调用disable方法,使其变为不可选。 2. 在第二个下拉框的onLoadSuccess事件中,判断当前第一个下拉框的是否需要让第二个下拉框变为不可选。如果需要,调用disable方法,使其变为不可选;如果不需要,调用enable方法,使其变为可选。 具体代码如下: 第一个下拉框的onSelect事件: ```javascript $('#combobox1').combobox({ onSelect: function(record){ if(record.value == 'somevalue'){ // 判断选中的是否需要让第二个下拉框变为可选 $('#combobox2').combobox('enable'); // 如果需要,调用第二个下拉框的enable方法,使其变为可选 } else { $('#combobox2').combobox('disable'); // 如果不需要,调用disable方法,使其变为不可选 } } }); ``` 第二个下拉框的onLoadSuccess事件: ```javascript $('#combobox2').combobox({ onLoadSuccess: function(){ var value1 = $('#combobox1').combobox('getValue'); // 获取第一个下拉框的 if(value1 == 'somevalue'){ // 判断当前第一个下拉框的是否需要让第二个下拉框变为不可选 $('#combobox2').combobox('disable'); // 如果需要,调用disable方法,使其变为不可选 } else { $('#combobox2').combobox('enable'); // 如果不需要,调用enable方法,使其变为可选 } } }); ```
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

linsa_pursuer

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值