<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ include file="/WEB-INF/jsp/commons/includes.jsp"%>
<html>
<head>
	<title>${systemName }</title>
	<style type="text/css">
		.header {
			height: 60px;
			text-align: center;
			background-image: url("${contextpath}/images/headbg3.gif");
			background-repeat: repeat-x;
		}
		
		.headerright {
			float: right;
			height: 100%;
			width: 400px;
		}
		
		.headerright .headerrighttext {
			margin-top: 20px;
		}
		
		.headerright .headerrighttext a,.headerright .headerrighttext a:link {
			text-decoration: none;
		}
		.headerright .headerrighttext .tip {
			float: left;
			height: 15px;
			width: 200px;
		}
		.headerright .headerrighttext .updatepwd {
			color:blue;
			height: 15px;
			float: left;
			width: 80px;
			cursor: pointer;
		}
		
		.headerright .headerrighttext .logout {
			float: left;
			height: 15px;
			width: 80px;
		}
		
		.title {
			float: left;
			margin: 16px 0 0 100px;
			font-weight:bold;
			font-size: 28px;
		}
		
		.memu {
			width: 200px;
		}
		
		.iframe {
			border: 0 none;
		}
		
		.footer {
			height: 20px;
			text-align: center;
			background-color: #E6EEF8;
		}
		
		.icon-excel {
			background: url('${contextpath}/images/excel-small.png') no-repeat
				center center;
		}
		
		#pwdForm {
			margin: 0;
			padding-left: 80px;
			padding-top: 20px;
		}
		
		.ftitle {
			font-size: 14px;
			font-weight: bold;
			padding: 5px 0;
			margin-bottom: 10px;
			border-bottom: 1px solid #ccc;
		}
		
		.fitem {
			margin-bottom: 20px;
			padding-top: 10px;
		}
		
		.fitem label {
			display: inline-block;
			width: 90px;
		}
	</style>
    <script>
    	var isCreate=false; 
    	var createDateStr;
		$.extend($.fn.validateBox.defaults.rules,{
		    equals: {
		        validator: function(value,param){
		            return value == $(param[0]).val();
		        },message: '两次输入的密码不一致!'
		    }
		});
		
		function uploadExcel(){
		    $('#uploadExcel').dialog('open').dialog('setTitle','上传文件');
		    $('#uploadExcelForm').form('clear');
		}
		function uploadExcelForm(){
			var option = {
				    type: "post",success : function(data){
				    	createData();
				   }
				  };
				  $("#uploadExcelForm").ajaxSubmit(option);
		}
		
		function update() {
			jQuery("#dlg").dialog('open').dialog('setTitle','修改密码');
		}
		function updatePassword() {
			if(jQuery('#pwdForm').form('validate')==true){
			  jQuery("#pwdForm").submit();
			}
		}
		function createData(){
			var year=jQuery("[name='year']").val();
			var month=jQuery("[name='month']").val();
			jsTool.ajax({
				url:"${contextpath}/tabledata/createData.do",data:{year:year,month:month},success:function(data){
					showTableTree(data.flag);
					$('#save-dlg').dialog('close');
				},error:function(){
					jQuery.messager.alert('数据生成失败','请检查U8数据库后重试','warning');
				}
			});
		}
		function showData(url){
			url+="?year="+jQuery("[name='year']").val()+"&month="+jQuery("[name='month']").val()+"&isCreate="+isCreate+"&createDateStr="+createDateStr;
			jQuery("[name='mainFrame']").attr("src",url);
		}
		function showTableTree(){
			var year=jQuery("[name='year']").val();
			var month=jQuery("[name='month']").val();
			var url="${contextpath}/show/show001Cover.do";
			jsTool.ajax({
				url:"${contextpath}/tabledata/isCreate.do",success:function(data){
					isCreate=data.flag;
					createDateStr=data.createDateStr;
					var node=jQuery('#showTableData').tree("find","show001Cover");
					jQuery("#showTableData").tree("select",node.target);
					showData(url);
		    		if (isCreate) {
		    			jQuery("#showTableData").show();
					}else {
		    			jQuery("#showTableData").hide();
					}
				},error:function(){
					jQuery.messager.alert('数据连接失败','请检查数据库网络后重试','warning');
				}
			});
    	}
		jQuery(function(){
			jsTool.form({
				form : jQuery("#pwdForm"),datatype:'String',success : function(data) {
					jQuery("#dlg").dialog('close');
				}
			});
			jQuery("#RightAccordion").accordion({ //初始化accordion
			    fillSpace:true,fit:true,border:false,animate:false  
			});
			$.post("${contextpath}/list.do",{ "id": "0" },//获取第一层目录
			function (data) {
				if (data == "0") {
		           window.location = "/Account";
		       }
		       $.each(data,function (i,e) {//循环创建手风琴的项
		           var id = e.id;
		           $('#RightAccordion').accordion('add',{
		               title: e.text,content: "<ul id='tree"+id+"' ></ul>",selected: true,iconCls:e.iconCls//e.Icon
		           });
		           $("#tree" + id).tree({
	                   data: e.children
	               });
		           $.parser.parse();
		       });
			},"json");
			jQuery('#showTableData').tree({
				data: [{
					text: '查看报表',children: [{
						id:'show001Cover',text: '封面',iconCls:'icon-excel',attributes:{
							url:"${contextpath}/show/show001Cover.do"
						}
					},{
						text: '资产负债表',attributes:{
							url:"${contextpath}/show/showZcfzb1.do"
						}
					},{
						text: '资产各月比较表',attributes:{
							url:"${contextpath}/show/showZcfzb2.do"
						}
					},{
						text: '负债和所有者权益各月比较表',attributes:{
							url:"${contextpath}/show/showZcfzb3.do"
						}
					},{
						text: '应收账款分析表-按账龄',attributes:{
							url:"${contextpath}/excels2/sheet005.html"
						}
					},{
						text: '应收账款分析表-按风险',attributes:{
							url:"${contextpath}/excels2/sheet006.html"
						}
					},{
						text: '存在风险应收账款变动表',attributes:{
							url:"${contextpath}/excels2/sheet007.html"
						}
					},{
						text: '存货分析表-按类别',attributes:{
							url:"${contextpath}/show/showChfxblb.do"
						}
					},{
						text: '存货分析表-按风险',attributes:{
							url:"${contextpath}/excels2/sheet009.html"
						}
					},{
						text: '存在风险存货变动表',attributes:{
							url:"${contextpath}/excels2/sheet010.html"
						}
					},{
						text: '利润表',attributes:{
							url:"${contextpath}/show/showLrb1.do"
						}
					},{
						text: '利润表各月比较表',attributes:{
							url:"${contextpath}/show/showLrb1ByMonth.do"
						}
					},{
						text: '营业收入分析表-按地区划分',attributes:{
							url:"${contextpath}/excels2/sheet013.html"
						}
					},{
						text: '营业收入分析表-按品种划分',attributes:{
							url:"${contextpath}/show/show014YysrPz.do"
						}
					},{
						text: '营业成本分析表-按品种划分',attributes:{
							url:"${contextpath}/show/show015YycbPz.do"
						}
					},{
						text: '毛利分析表',attributes:{
							url:"${contextpath}/excels2/sheet016.html"
						}
					},{
						text: '毛利率分析表',attributes:{
							url:"${contextpath}/excels2/sheet017.html"
						}
					},{
						text: '各月销售费用比较表',attributes:{
							url:"${contextpath}/excels2/sheet018.html"
						}
					},{
						text: '各月管理费用比较表',attributes:{
							url:"${contextpath}/excels2/sheet019.html"
						}
					},{
						text: '各月财务费用比较表',attributes:{
							url:"${contextpath}/excels2/sheet020.html"
						}
					},{
						text: '现金流量表各月比较表',attributes:{
							url:"${contextpath}/show/showXjllb1.do"
						}
					},{
						text: '经营成果分析表(月度)',attributes:{
							url:"${contextpath}/show/showJycgfxb1.do"
						}
					},{
						text: '利润分析表',attributes:{
							url:"${contextpath}/show/showLrb1Fxb.do"
						}
					},{
						text: '经营成果分析表(累计)',attributes:{
							url:"${contextpath}/excels2/sheet024.html"
						}
					},{
						text: '可比公司指标平均值',attributes:{
							url:"${contextpath}/excels2/sheet025.html"
						}
					},{
						text: '经营成果分析表(年度)',attributes:{
							url:"${contextpath}/show/showJycgfxb2.do"
						}
					},{
						text: '毛利率计算',attributes:{
							url:"${contextpath}/excels2/sheet027.html"
						}
					},{
						text: '显示测试',attributes:{
							url:"${contextpath}/show/show.do"
						}
					},{
						text:'显示测试_存货分析表',attributes:{
							url:"${contextpath}/show/showChfxblb.do"
						}
					}]
				}],onClick:function(node){
					if(node.attributes){
						var url=node.attributes.url;
						showData(url);
					}
				}
			});
			jQuery('#Title2').tree({
				data: [{
					text: '用户管理',attributes:{
						url:"${contextpath}/user/userOperation.do"
					}
				},{
					text: '角色管理',attributes:{
						url:"${contextpath}/roleOperation.do"
					}
				}],onClick:function(node){
					if(node.attributes){
						var url=node.attributes.url;
						jQuery("[name='mainFrame']").attr("src",url);
					}
				}
			});
			jQuery('#Title3').tree({
				data: [{
					text: '报表导出',attributes:{
						url:"${contextpath}/report/report.do"
						}
				}],url);
					}
				}
			});
			showTableTree();
		});
    </script>
	</head>
	<body>
		<div class="easyui-layout" data-options="fit:true" style="width:100%;height:100%;">
			<div class="header" data-options="region:'north'" style="border-bottom:0 none;" >
				<div class="title">${systemName }</div>
					<div class="headerright">
						<div class="headerrighttext">
							<div class="tip">用户名:${sessionScope.curruser.realName}(${sessionScope.curruser.username})</div>
							<div class="updatepwd" onclick="update()">修改密码</div>
							<div class="logout"><a href="${contextpath}/logout.do">退出</a></div>
						</div>
					</div>
			</div>
			<div class="footer" data-options="region:'south'" style="border-top:0 none;">
				&copy;版权所有
			</div>
			<div class="memu" data-options="region:'west',split:true,minWidth:'30',maxWidth:'400'" id="menu">
				<div id="RightAccordion" class="easyui-accordion" data-options="fit:true,border:false">
					<div title="查看表格" data-options="selected:true">
						<div style="text-align: center;">
    						<select id="nian" class="easyui-comboBox" name="year" style="width:80px;" data-options="onSelect: function(rec){
								showTableTree();
	    					}">
    							<option value="${year-5}">${year-5}</option>
    							<option value="${year-4}">${year-4}</option>
    							<option value="${year-3}">${year-3}</option>
    							<option value="${year-2}">${year-2}</option>
    							<option value="${year-1}">${year-1}</option>
    							<option value="${year}" selected>${year}</option>
    							<option value="${year+1}">${year+1}</option>
    							<option value="${year+2}">${year+2}</option>
    							<option value="${year+3}">${year+3}</option>
    							<option value="${year+4}">${year+4}</option>
    							<option value="${year+5}">${year+5}</option>
    						</select>
    						年
    						<select id="yue" class="easyui-comboBox" name="month" style="width:50px;" data-options="onSelect: function(rec){
								showTableTree();
	    					}">
    							<c:forEach begin="1" end="12" var="i">
    								<c:if test="${i==month}">
		    							<option value="${i }" selected="selected">${i }</option>
    								</c:if>
    								<c:if test="${i!=month}">
		    							<option value="${i }">${i }</option>
    								</c:if>
    							</c:forEach>
    						</select>
    						月
						<a href="javascript:void(0)" id="gen" class="easyui-linkbutton" iconCls="icon-add"  onclick="uploadExcel();">生成报告</a>
						</div>
						<div id="showTableData"></div>
					</div>
					<div title="导入导出" data-options="" id="Title3"></div>
					<div title="用户管理" data-options="" id="Title2"></div>
				</div>
			</div>
			<div data-options="region:'center'" style="overflow-y:hidden;border-top:0 none;" >
				<iframe name="mainFrame" src="${contextpath}/show/show001Cover.do" frameborder="0" width="100%" height="100%"></iframe>
			</div>
		</div>
		<div id="dlg" class="easyui-dialog" style="width:500px;height:350px;padding:10px 20px"closed="true" buttons="#dlg-buttons">
	        <div class="ftitle">修改密码</div>
		       <form id="pwdForm" method="post" action="${contextpath}/updatePassword.do" novalidate>
		          <div class="fitem">
		               <input name="id" class="easyui-validateBox" value="${sessionScope.curruser.id}" type="hidden">
		          </div>
		          <div class="fitem">
		               <label>请输入新密码:</label>
		               <input id="password"name="password" type="password" class="easyui-validateBox"  data-options="required:true,validType:['length[6,20]']">
		          </div>
		          <div class="fitem">
		               <label>请重新输入密码:</label>
		               <input id="repassword"name="repassword" type="password" class="easyui-validateBox" required="required" validType="equals['#password']">
		         </div>
		       </form>
	    </div>
	    <div id="uploadExcel" class="easyui-dialog" style="width:500px;height:350px;padding:10px 20px"
            closed="true" buttons="#dlg-save-buttons">
	        <div class="ftitle">上传文件</div>
	        <form id="uploadExcelForm" method="post" action="${contextpath}/excel/import.do" enctype="multipart/form-data">
				<input type="file" name="file" />	  
	        <a href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-ok" onclick="uploadExcelForm()">上传并生成</a>
	        </form>
    	</div>
	    <div id="dlg-buttons">
	        <a href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-ok" onclick="updatePassword()">保存</a>
	        <a href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-cancel" onclick="javascript:$('#dlg').dialog('close')">取消</a>
	    </div>
	</body>
</html>

ajax jquery 上传文件的更多相关文章

  1. 应用程序关闭时的iOS任务

    我正在构建一个应用程序,通过ajax将文件上传到服务器.问题是用户很可能有时不会有互联网连接,并且客户希望在用户重新连接时安排ajax调用.这可能是用户在离线时安排文件上传并关闭应用程序.应用程序关闭时可以进行ajax调用吗?

  2. android – Phonegap本地构建 – jquery ajax错误:readystate 0 responsetext status 0 statustext error

    解决方法您是否在索引文件中包含了内容安全元标记?

  3. Ajax简单的异步交互及Ajax原生编写

    一提到异步交互大家就会说ajax,仿佛ajax这个技术已经成为了异步交互的代名词.那下面将研究ajax的核心对象

  4. Ajax跨域问题的解决办法汇总(推荐)

    本文给大家分享多种方法解决Ajax跨域问题,非常不错具有参考借鉴价值,感兴趣的朋友一起学习吧

  5. ajax编写简单的登录页面

    这篇文章主要为大家详细介绍了ajax编写简单登录页面的具体代码,文中示例代码介绍的非常详细,具有一定的参考价值,感兴趣的小伙伴们可以参考一下

  6. ajax从JSP传递对象数组到后台的方法

    今天小编就为大家分享一篇ajax从JSP传递对象数组到后台的方法,具有很好的参考价值,希望对大家有所帮助。一起跟随小编过来看看吧

  7. 解决ajax返回验证的时候总是弹出error错误的方法

    这篇文章主要介绍了解决ajax返回验证的时候总是弹出error错误的方法,感兴趣的小伙伴们可以参考一下

  8. 使用AJAX完成用户名是否存在异步校验

    这篇文章主要介绍了使用AJAX完成用户名是否存在异步校验的相关资料,需要的朋友可以参考下

  9. ajax实现无刷新省市县三级联动

    这篇文章主要为大家详细介绍了ajax实现无刷新省市县三级联动的相关资料,利用三层架构实现,文中示例代码介绍的非常详细,具有一定的参考价值,感兴趣的小伙伴们可以参考一下

  10. jQuery Ajax 实现分页 kkpager插件实例代码

    本文通过实例代码给大家讲解了jQuery Ajax 实现分页 kkpager插件功能,需要的的朋友参考下吧

随机推荐

  1. xe-ajax-mock 前端虚拟服务

    最新版本见Github,点击查看历史版本基于XEAjax扩展的Mock虚拟服务插件;对于前后端分离的开发模式,ajax+mock使前端不再依赖后端接口开发效率更高。CDN使用script方式安装,XEAjaxMock会定义为全局变量生产环境请使用xe-ajax-mock.min.js,更小的压缩版本,可以带来更快的速度体验。

  2. vue 使用 xe-ajax

    安装完成后自动挂载在vue实例this.$ajaxCDN安装使用script方式安装,VXEAjax会定义为全局变量生产环境请使用vxe-ajax.min.js,更小的压缩版本,可以带来更快的速度体验。cdnjs获取最新版本点击浏览已发布的所有npm包源码unpkg获取最新版本点击浏览已发布的所有npm包源码AMD安装require.js安装示例ES6Module安装通过Vue.use()来全局安装示例./Home.vue

  3. AJAX POST数据中文乱码解决

    前端使用encodeURI进行编码后台java.net.URLDecoder进行解码编解码工具

  4. Koa2框架利用CORS完成跨域ajax请求

    实现跨域ajax请求的方式有很多,其中一个是利用CORS,而这个方法关键是在服务器端进行配置。本文仅对能够完成正常跨域ajax响应的,最基本的配置进行说明。这样OPTIONS请求就能够通过了。至此为止,相当于仅仅完成了预检,还没发送真正的请求呢。

  5. form提交时,ajax上传文件并更新到&lt;input&gt;中的value字段

  6. ajax的cache作用

    filePath="+escape;},error:{alert;}});解决方案:1.加cache:false2.url加随机数正常代码:网上高人解读:cache的作用就是第一次请求完毕之后,如果再次去请求,可以直接从缓存里面读取而不是再到服务器端读取。

  7. 浅谈ajax上传文件属性contentType = false

    默认值为contentType="application/x-www-form-urlencoded".在默认情况下,内容编码类型满足大多数情况。在这里,我们主要谈谈contentType=false.在使用ajax上传文件时:在其中先封装了一个formData对象,然后使用post方法将文件传给服务器。说到这,我们发现在JQueryajax()方法中我们使contentType=false,这不是冲突了吗?这就是因为当我们在form标签中设置了enctype=“multipart/form-data”,

  8. 909422229_ajaxFileUpload上传文件

    ajaxFileUpload.js很多同名的,因为做出来一个很容易。我上github搜AjaxFileUpload出来很多类似js。ajaxFileUpload是一个异步上传文件的jQuery插件传一个不知道什么版本的上来,以后不用到处找了。语法:$.ajaxFileUploadoptions参数说明:1、url上传处理程序地址。2,fileElementId需要上传的文件域的ID,即的ID。3,secureuri是否启用安全提交,默认为false。4,dataType服务器返回的数据类型。6,error

  9. AJAX-Cache:一款好用的Ajax缓存插件

    原文链接AJAX-Cache是什么Ajax是前端开发必不可少的数据获取手段,在频繁的异步请求业务中,我们往往需要利用“缓存”提升界面响应速度,减少网络资源占用。AJAX-Cache是一款jQuery缓存插件,可以为$.ajax()方法扩展缓存功能。

  10. jsf – Ajax update/render在已渲染属性的组件上不起作用

    我试图ajax更新一个有条件渲染的组件。我可以确保#{user}实际上是可用的。这是怎么引起的,我该如何解决呢?必须始终在ajax可以重新呈现之前呈现组件。Ajax正在使用JavaScriptdocument.getElementById()来查找需要更新的组件。但是如果JSF没有将组件放在第一位,那么JavaScript找不到要更新的内容。解决方案是简单地引用总是渲染的父组件。

返回
顶部