Commit 2054b07f authored by 季圣华's avatar 季圣华
Browse files

升级代码结构,采用Maven来管理jar包(14)

parent 9bad12b0
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" version="2.5">
<context-param>
<param-name>webAppRootKey</param-name>
<param-value>webApp.log4j.path</param-value>
</context-param>
<context-param>
<param-name>log4jConfigLocation</param-name>
<param-value>classpath:log4j/log4j.properties</param-value>
</context-param>
<context-param>
<param-name>log4jRefreshInterval</param-name>
<param-value>60000</param-value>
</context-param>
<listener>
<listener-class>org.springframework.web.util.Log4jConfigListener</listener-class>
</listener>
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>classpath:spring/*-applicationContext.xml</param-value>
</context-param>
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>
<filter>
<description>session的过滤器</description>
<filter-name>SessionValidateFilter</filter-name>
<filter-class>com.jsh.util.SessionFilter</filter-class>
</filter>
<filter-mapping>
<filter-name>SessionValidateFilter</filter-name>
<url-pattern>/pages/*</url-pattern>
</filter-mapping>
<filter>
<filter-name>encodingFilter</filter-name>
<filter-class>org.springframework.web.filter.CharacterEncodingFilter</filter-class>
<init-param>
<param-name>encoding</param-name>
<param-value>UTF-8</param-value>
</init-param>
<init-param>
<param-name>forceEncoding</param-name>
<param-value>true</param-value>
</init-param>
</filter>
<filter-mapping>
<filter-name>encodingFilter</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
<filter>
<filter-name>hibernateFilter</filter-name>
<filter-class>com.jsh.util.OpenSessionInViewFilterExtend</filter-class>
<init-param>
<param-name>singleSession</param-name>
<param-value>true</param-value>
</init-param>
</filter>
<filter-mapping>
<filter-name>hibernateFilter</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
<filter>
<filter-name>struts2</filter-name>
<filter-class>org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter</filter-class>
<init-param>
<param-name>config</param-name>
<param-value>struts2/struts.xml</param-value>
</init-param>
</filter>
<filter-mapping>
<filter-name>struts2</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
<session-config>
<session-timeout>60</session-timeout>
</session-config>
<display-name></display-name>
<welcome-file-list>
<welcome-file>login.jsp</welcome-file>
</welcome-file-list>
</web-app>
\ No newline at end of file
<%@page import="com.jsh.util.Tools"%>
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
String clientIp = Tools.getCurrentUserIP();
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>ERP系统</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<!-- 指定以IE8的方式来渲染 -->
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE8"/>
<link rel="shortcut icon" href="<%=path%>/images/favicon.ico" type="image/x-icon" />
<link type="text/css" rel="stylesheet" href="<%=path %>/css/css.css" />
<script type="text/javascript" src="<%=path %>/js/jquery-1.8.0.min.js"></script>
<script type="text/javascript" src="<%=path %>/js/common/common.js"></script>
</head>
<body id="login_body">
<form action="admin.html">
<div id="login_main">
<!-- <div id="login_logo"><img src="<%=path%>/images/logo.png" height="18" alt="深圳市风向标信息技术有限公司" />&nbsp;资产管理系统</div>-->
<div id="login">
<p id="login_signal"><img src="<%=path%>/images/login_tip.jpg" width="108" height="29" alt="login" /></p>
<p id="txt_username">
<label for="user_name">用户名:</label>
</p>
<p id="txt_userpwd">
<label for="user_vcode" id="user_vcodepwd">&nbsp;&nbsp;&nbsp;&nbsp;码:</label>
</p>
<!-- <p id="txt_vcode">
<label for="user_pwd">验证码:</label>
</p> -->
<input type="text" id="user_name" />
<input type="password" id="user_pwd" />
<%-- <input type="text" id="vcode" />
<p id="vcode_pic"><img src="<%=path%>/images/valid_code.jpg" width="59" height="22" alt="vpic" /></p> --%>
<p id="tip_username" style="display: none"><span class="error_input">用户名不正确</span></p>
<p id="tip_userpwd" style="display: none">密码不能为空</p>
<!-- <p id="tip_vcode">验证码不能为空</p> -->
<input type="button" value=" " id="btn_login" />
</div>
<p id="login_tip">如果忘记密码,请与管理员联系。</p>
<!-- <p id="copyright">Copyright © 2015 季圣华 jishenghua V1.0</p> -->
</div>
</form>
<script type="text/javascript">
//初始化界面
$(function()
{
//进入页面聚焦在username输入框,方便 用户输入
$("#user_name").focus();
browserFit();
});
//浏览器适配
function browserFit()
{
if(getOs()=='MSIE')
$("#user_vcodepwd").empty().append("密&nbsp;&nbsp;&nbsp;&nbsp;码:");
else
$("#user_vcodepwd").empty().append("密&nbsp;&nbsp;&nbsp;&nbsp;码:");
}
//初始化键盘enter事件
$(document).keydown(function(event)
{
//兼容 IE和firefox 事件
var e = window.event || event;
var k = e.keyCode||e.which||e.charCode;
//兼容 IE,firefox 兼容
var obj = e.srcElement ? e.srcElement : e.target;
//绑定键盘事件为 id是usename 和password的输入框才可以触发键盘事件 13键盘事件
if(k == "13"&&(obj.id=="user_name"||obj.id=="user_pwd"))
checkUserInput();
});
//登录按钮绑定处理事件
$('#btn_login').bind({
click:checkUserInput
});
//检测用户输入数据
function checkUserInput ()
{
var username = $.trim($('#user_name').val());
var password = $.trim($('#user_pwd').val());
if(null == username ||0 == username.length)
{
$("#user_name").val("").focus();
$("#tip_userpwd").hide();
$("#tip_username").empty().append('<span class="error_input">用户名不能为空</span>').show();
return;
}
else
$("#tip_username").hide();
if(null == password || 0 == password.length)
{
$("#user_pwd").val("").focus();
$("#tip_userpwd").empty().append('<span class="error_input">密码不能为空</span>').show();
return;
}
else
$("#tip_userpwd").hide();
if(username != null&& username.length != 0
&&password != null&&password.length != 0)
{
$("#user_name").focus();
$("#tip_username").hide();
$("#tip_userpwd").hide();
$.ajax({
type:"post",
url: "<%=path%>/user/login.action",
dataType: "json",
data: ({
loginame : username,
password : password,
clientIp:"<%=clientIp%>"
}),
success: function (loginInfo){
var loginInfoTip = loginInfo.showModel.msgTip;
//用户名不存在,清空输入框并定位到用户名输入框
if(loginInfoTip.indexOf("user is not exist") != -1)
{
$("#user_pwd").val("");
$("#user_name").val("").focus();
$("#tip_userpwd").hide();
$("#tip_username").empty().append('<span class="error_input">用户名不存在</span>').show();
return;
}
else if(loginInfoTip.indexOf("user password error") != -1)
{
$("#user_pwd").val("").focus();
$("#tip_userpwd").empty().append('<span class="error_input">用户密码错误</span>').show();
return;
}
else if(loginInfoTip.indexOf("access service error") != -1)
{
//$("#user_name").val("").focus();
$("#tip_userpwd").hide();
$("#tip_username").empty().append('<span class="error_input">后台访问错误</span>').show();
return;
}
//跳转到用户管理界面
else if(loginInfoTip.indexOf("user can login") != -1||loginInfoTip == "user already login")
{
window.location.href="<%=path%>/login.action";
}
},
//此处添加错误处理
error:function()
{
alert("后台访问错误,请联系管理员!");
}
});
}
}
//处理tip提示
//定义变量控制密码提示显示
var temp_value = "";
$("#user_name").add("#user_pwd").unbind().bind({
'click keyup':function()
{
var value = $.trim($(this).val());
if(value.length >0)
{
$("#tip_username").hide();
$("#tip_userpwd").hide();
}
},
blur:function()
{
//兼容 IE和firefox 事件
var e = window.event || event;
//兼容 IE,firefox 兼容
var obj = e.srcElement ? e.srcElement : e.target;
var value = $.trim($(this).val());
if(obj.id=="user_name")
temp_value = value;
if(value.length ==0)
{
if(obj.id=="user_name")
$("#tip_username").empty().append('<span class="error_input">用户名不能为空</span>').show();
if(obj.id=="user_pwd" &&temp_value.length>0)
$("#tip_userpwd").empty().append('<span class="error_input">密码不能为空</span>').show();;
}
else
{
if(obj.id=="user_pwd"&&value.length>0&&temp_value.length ==0)
{
$("#tip_username").show();
$("#tip_userpwd").hide();
}
else
{
$("#tip_username").hide();
$("#tip_userpwd").hide();
}
}
}
});
</script>
</body>
</html>
\ No newline at end of file
<%@ page language="java" pageEncoding="utf-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<base href="<%=basePath%>">
<title>+</title>
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="This is my page">
<!--
<link rel="stylesheet" type="text/css" href="styles.css">
-->
</head>
<body>
<script type="text/javascript">
top.location.href="<%=basePath%>";
</script>
<br></body>
</html>
<%@page import="com.jsh.util.Tools"%>
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
String clientIp = Tools.getCurrentUserIP();
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>资产管理</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<!-- 指定以IE8的方式来渲染 -->
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE8"/>
<link rel="shortcut icon" href="<%=path%>/images/favicon.ico" type="image/x-icon" />
<link rel="stylesheet" type="text/css" href="<%=path %>/js/easyui-1.3.5/themes/default/easyui.css"/>
<link rel="stylesheet" type="text/css" href="<%=path %>/js/easyui-1.3.5/themes/icon.css"/>
<link type="text/css" rel="stylesheet" href="<%=path %>/css/common.css" />
<script type="text/javascript" src="<%=path %>/js/jquery-1.8.0.min.js"></script>
<script type="text/javascript" src="<%=path %>/js/easyui-1.3.5/jquery.easyui.min.js"></script>
<script type="text/javascript" src="<%=path %>/js/easyui-1.3.5/locale/easyui-lang-zh_CN.js"></script>
<script type="text/javascript" src="<%=path %>/js/common/common.js"></script>
</head>
<body>
<div id="position" class="easyui-panel" title="当前位置:资产管理 &gt; 资产管理" collapsible="false" closable="false"/>
<!-- 查询 -->
<div id = "searchPanel" class="easyui-panel" style="padding:10px;" title="查询窗口" iconCls="icon-search" collapsible="true" closable="false">
<table id="searchTable">
<tr>
<td>资产名称:</td>
<td alt="选项卡中内容为:资产类型-->资产名称">
<select name="searchAssetNameID" id="searchAssetNameID" style="width:230px;"></select>
</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>资产类型:</td>
<td>
<select name="searchCategoryID" id="searchCategoryID" style="width:230px;"></select>
</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>用户姓名:</td>
<td>
<select name="searchuserID" id="searchuserID" style="width:230px;"></select>
</td>
</tr>
<tr>
<td id="searchStatusLabel">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;态:</td>
<td>
<select name="searchStatus" id="searchStatus" style="width:230px;">
<option value="">请选择</option>
<option value="0">在库</option>
<option value="1">在用</option>
<option value="2">消费</option>
</select>
</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td id="searchSupplierIDLabel">&nbsp;&nbsp;&nbsp;&nbsp;商:</td>
<td>
<select name="searchSupplierID" id="searchSupplierID" style="width:230px;"></select>
</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>
<a href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-search" id="searchBtn">查询</a>&nbsp;&nbsp;
<a href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-redo" id="searchResetBtn">重置</a>
</td>
</tr>
</table>
</div>
<!-- 数据显示table -->
<div id = "tablePanel" class="easyui-panel" style="padding:1px;top:300px;" title="资产列表" iconCls="icon-list" collapsible="true" closable="false">
<table id="tableData" style="top:300px;border-bottom-color:#FFFFFF"></table>
</div>
<div id="assetDlg" style="padding:10px 20px;">
<form id="assetFM" method="post" novalidate>
<table>
<tr>
<td>资产名称:</td>
<td>
<select id="assetNameID" name="assetNameID" style="width:200px;height: 21px"></select>
&nbsp;&nbsp;<img id="addAssetName" src="<%=path %>/js/easyui-1.3.5/themes/icons/edit_add.png" style="cursor: pointer;" alt="增加资产" />
</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td id="statusLabel">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;态:</td>
<td>
<select id="status" name="status" style="width:230px;height: 21px">
<option value="0">在库</option>
<option value="1">在用</option>
<option value="2">消费</option>
</select>
</td>
</tr>
<tr>
<td colspan="6">&nbsp;</td>
</tr>
<tr>
<td id="locationLabel">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;置:</td>
<td>
<input type="text" name="location" id="location" style="width:230px;height: 21px"/>
</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td id="userIDLabel">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;户:</td>
<td>
<select id="userID" name="userID" style="width:230px;height: 21px"></select>
&nbsp;&nbsp;<img id="addUserName" src="<%=path %>/js/easyui-1.3.5/themes/icons/edit_add.png" style="cursor: pointer;display: none;" alt="增加用户" />
</td>
</tr>
<tr >
<td colspan="6">&nbsp;</td>
</tr>
<tr>
<td>订购单价:</td>
<td>
<input type="text" name="price" id="price" class="easyui-numberbox" style="width:200px;height: 21px" data-options="min:0,precision:2"/>&nbsp;&nbsp;
</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>购买日期:</td>
<td>
<input type="text" name="purchasedate" id="purchasedate" class="easyui-datebox" style="width:230px;height: 21px"/>
</td>
</tr>
<tr>
<td colspan="6">&nbsp;</td>
</tr>
<tr>
<td>有效日期:</td>
<td>
<input type="text" name="periodofvalidity" id="periodofvalidity" class="easyui-datebox" style="width:230px;height: 21px"/>
</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>保修日期:</td>
<td>
<input type="text" name="warrantydate" id="warrantydate" class="easyui-datebox" style="width:230px;height: 21px"/>
</td>
</tr>
<tr>
<td colspan="6">&nbsp;</td>
</tr>
<tr>
<td>资产编号:</td>
<td>
<input type="text" name="assetnum" id="assetnum" style="width:230px;height: 21px"/>
</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td id="serialnumLabel">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;号:</td>
<td>
<input type="text" name="serialnum" id="serialnum" style="width:230px;height: 21px"/>
</td>
</tr>
<tr>
<td colspan="6">&nbsp;</td>
</tr>
<tr>
<td>资产标签:</td>
<td>
<input type="text" name="labels" id="labels" style="width:230px;height: 21px"/>
</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td id="supplierIDLabel">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;商:</td>
<td>
<select id="supplierID" name="supplierID" style="width:200px;height: 21px"></select>
&nbsp;&nbsp;<img id="addSupplerName" src="<%=path %>/js/easyui-1.3.5/themes/icons/edit_add.png" style="cursor: pointer;" alt="增加供应商" />
</td>
</tr>
<tr>
<td colspan="6">&nbsp;</td>
</tr>
<tr>
<td id="descriptionLabel">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;述:</td>
<td colspan="5">
<textarea name="description" id="description" cols="2" rows="2" style="width:550px;"></textarea>
</td>
</tr>
</table>
<input type="hidden" name="clientIp" id="clientIp" value="<%=clientIp %>"/>
</form>
</div>
<div id="dlg-buttons0">
<a href="javascript:void(0)" id="saveAsset" class="easyui-linkbutton" iconCls="icon-ok">保存</a>
<a href="javascript:void(0)" id="saveKeepAsset" class="easyui-linkbutton" iconCls="icon-save">保存并新建</a>
<a href="javascript:void(0)" id="cancelSupplier" class="easyui-linkbutton" iconCls="icon-cancel" onclick="javascript:$('#assetDlg').dialog('close')">取消</a>
</div>
<!-- 增加资产名称 -->
<div id="assetnameDlg" style="padding:10px 20px">
<form id="assetnameFM" method="post" novalidate>
<div class="fitem" style="padding:5px">
<label id="assetNameLabel">资产名称&nbsp;&nbsp;</label>
<input name="assetName" id="assetName" class="easyui-validatebox" data-options="required:true,validType:'length[2,30]'" style="width: 230px;height: 20px"/>
</div>
<div class="fitem" style="padding:5px">
<label id="categoryLabel">资产类型&nbsp;&nbsp;</label>
<select name="category" id="category" style="width:230px;height: 20px"></select>
</div>
<div class="fitem" style="padding:5px">
<label id="consumableLabel">是否耗材&nbsp;&nbsp;</label>
<select name="consumable" id="consumable" style="width: 230px;height: 20px">
<option value="0"></option>
<option value="1"></option>
</select>
</div>
<div class="fitem" style="padding:5px;">
<label id="namedescriptionLabel">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</label>
<textarea name="description" id="descriptioname" rows="2" cols="2" style="width: 230px;"></textarea>
</div>
<input type="hidden" name="clientIp" id="clientIp" value="<%=clientIp %>"/>
</form>
</div>
<div id="dlg-buttons1">
<a href="javascript:void(0)" id="saveAssetName" class="easyui-linkbutton" iconCls="icon-ok">保存</a>
<a href="javascript:void(0)" id="cancelAssetName" class="easyui-linkbutton" iconCls="icon-cancel" onclick="javascript:$('#assetnameDlg').dialog('close')">取消</a>
</div>
<div id="supplierDlg" style="padding:10px 20px">
<form id="supplierFM" method="post" novalidate>
<div class="fitem" style="padding:5px">
<label id="supplierLabel">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</label>
<input name="supplier" id="supplier" class="easyui-validatebox" data-options="required:true,validType:'length[2,30]'" style="width: 230px;height: 20px"/>
</div>
<div class="fitem" style="padding:5px">
<label id="contactsLabel">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</label>
<input name="contacts" id="contacts" class="easyui-validatebox" style="width: 230px;height: 20px"/>
</div>
<div class="fitem" style="padding:5px">
<label id="phonenumLabel">联系电话&nbsp;&nbsp;</label>
<input name="phonenum" id="phonenum" class="easyui-numberbox" style="width: 230px;height: 20px"/>
</div>
<div class="fitem" style="padding:5px">
<label id="emailLabel">电子邮箱&nbsp;&nbsp;</label>
<input name="email" id="email" class="easyui-validatebox" validType="email" style="width: 230px;height: 20px"/>
</div>
<div class="fitem" style="padding:5px">
<label id="supplierdescriptionLabel">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</label>
<textarea name="description" id="descriptionSupplier" rows="2" cols="2" style="width: 230px;"></textarea>
</div>
<input type="hidden" name="clientIp" id="clientIp" value="<%=clientIp %>"/>
</form>
</div>
<div id="dlg-buttons2">
<a href="javascript:void(0)" id="saveSupplier" class="easyui-linkbutton" iconCls="icon-ok">保存</a>
<a href="javascript:void(0)" id="cancelSupplier" class="easyui-linkbutton" iconCls="icon-cancel" onclick="javascript:$('#supplierDlg').dialog('close')">取消</a>
</div>
<div id="userDlg" style="padding:10px 20px">
<form id="usernameFM" method="post" novalidate>
<div class="fitem" style="padding:5px">
<label id="usernameLabel">用户名称&nbsp;&nbsp;</label>
<input name="username" id="username" class="easyui-validatebox" data-options="required:true,validType:'length[2,30]'" style="width: 230px;height: 20px"/>
</div>
<div class="fitem" style="padding:5px">
<label id="departmentLabel">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</label>
<input name="department" id="department" style="width: 230px;height: 20px"/>
</div>
<div class="fitem" style="padding:5px">
<label id="userpositionLabel">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</label>
<input name="position" id="position" style="width: 230px;height: 20px"/>
</div>
<div class="fitem" style="padding:5px">
<label id="userphonenumLabel">联系电话&nbsp;&nbsp;</label>
<input name="phonenum" id="phonenum" class="easyui-numberbox" style="width: 230px;height: 20px"/>
</div>
<div class="fitem" style="padding:5px">
<label id="useremailLabel">电子邮箱&nbsp;&nbsp;</label>
<input name="email" id="email" class="easyui-validatebox" validType="email" style="width: 230px;height: 20px"/>
</div>
<div class="fitem" style="padding:5px">
<label id="userdescriptionLabel">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</label>
<textarea name="description" id="descriptionUser" rows="2" cols="2" style="width: 230px;"></textarea>
</div>
<input type="hidden" name="clientIp" id="clientIp" value="<%=clientIp %>"/>
</form>
<div id="dlg-buttons3">
<a href="javascript:void(0)" id="saveusername" class="easyui-linkbutton" iconCls="icon-ok">保存</a>
<a href="javascript:void(0)" id="cancelusername" class="easyui-linkbutton" iconCls="icon-cancel" onclick="javascript:$('#userDlg').dialog('close')">取消</a>
</div>
</div>
<!-- 导出excel表格 -->
<div id="exportExcelDlg" style="padding:10px 20px">
<div class="fitem" style="padding:5px">
<label>文件名称&nbsp;&nbsp;</label>
<input name="fileName" id="fileName" type="text" class="easyui-validatebox" data-options="required:true,validType:'length[2,30]'" style="width: 230px;height: 20px" maxlength="20"/>
</div>
<div class="fitem" style="padding:5px">
<label>是否全部&nbsp;&nbsp;</label>
<select style="width: 230px;height: 20px" id="isAllData" name="isAllData">
<option value="currentPage" selected="selected">当前页</option>
<option value="allPage">全部页</option>
</select>
</div>
<input type="hidden" name="clientIp" id="clientIp" value="<%=clientIp %>"/>
<div id="dlg-buttons4">
<a href="javascript:void(0)" id="saveexport" class="easyui-linkbutton" iconCls="icon-ok">保存</a>
<a href="javascript:void(0)" id="cancelexport" class="easyui-linkbutton" iconCls="icon-cancel" onclick="javascript:$('#exportExcelDlg').dialog('close')">取消</a>
</div>
</div>
<!-- 导入excel表格 -->
<div id="importExcelDlg" style="padding:10px 20px">
<form id="importExcelFM" method="post" enctype="multipart/form-data" action="<%=path%>/asset/importExcel.action">
<div class="fitem" style="padding:5px">
<label>文件名称&nbsp;&nbsp;</label>
<input name="assetFile" id="assetFile" type="file" style="width: 230px;height: 20px"/>
</div>
<div class="fitem" style="padding:5px;display: none;">
<label>是否审查&nbsp;&nbsp;</label>
<select id ="isCheck" name="isCheck" style="width: 230px;height: 20px">
<option value="0"></option>
<option value="1" selected="selected"></option>
</select>
</div>
<input type="hidden" name="clientIp" id="clientIp" value="<%=clientIp %>"/>
<div id="dlg-buttons5">
<a href="javascript:void(0)" id="saveimport" class="easyui-linkbutton" iconCls="icon-ok">导入</a>
<a href="javascript:void(0)" id="cancelimport" class="easyui-linkbutton" iconCls="icon-cancel" onclick="javascript:$('#importExcelDlg').dialog('close')">取消</a>
</div>
</form>
</div>
<div id="rightMenu" class="easyui-menu" style="width:120px;">
<div data-options="iconCls:'icon-edit'" id="rightEdit">编辑</div>
<div data-options="iconCls:'icon-remove'" id="rightDelete">删除</div>
<div class="menu-sep"></div>
<div data-options="iconCls:'icon-cancel'" id="rightCancel">取消</div>
</div>
<script type="text/javascript">
var userList = null;
var categoryList = null;
var supplierList = null;
var nameList = null;
//界面selet选显卡有问题解决方案
var nameID = null;
var userID = null;
var categoryID = null;
var supplierID = null;
//右键编辑信息
var rightRowInfo;
var rightRowID;
var rightRowIndex;
//初始化界面
$(function()
{
$.messager.progress({
title:'请稍候',
msg:'数据加载ing...'
});
initTableData();
ininPager();
//初始化系统基础信息
initSystemData();
//初始化页面系统基础信息选项卡
initSelectInfo();
//隐藏操作按钮
hideOperation();
//防止表格刷新
//initForm();
browserFit();
$.messager.progress('close');
});
//资产对话框
$('#assetDlg').dialog({
width: 700,
closed: true,
cache: false,
modal: true,
collapsible:false,
closable: true,
buttons:'#dlg-buttons0'
});
//资产名称对话框
$('#assetnameDlg').dialog({
width: 390,
closed: true,
cache: false,
modal: true,
collapsible:false,
closable: true,
buttons:'#dlg-buttons1'
});
//供应商对话框
$('#supplierDlg').dialog({
width: 380,
closed: true,
cache: false,
modal: true,
collapsible:false,
closable: true,
buttons:'#dlg-buttons2'
});
//用户对话框
$('#userDlg').dialog({
width: 380,
closed: true,
cache: false,
modal: true,
collapsible:false,
closable: true,
buttons:'#dlg-buttons3'
});
//导出excel对话框
$('#exportExcelDlg').dialog({
width: 400,
closed: true,
cache: false,
modal: true,
collapsible:false,
closable: true,
buttons:'#dlg-buttons4'
});
//导入excel对话框
$('#importExcelDlg').dialog({
width: 400,
closed: true,
cache: false,
modal: true,
collapsible:false,
closable: true,
buttons:'#dlg-buttons5'
});
//浏览器适配
function browserFit()
{
if(getOs()=='MSIE')
{
$("#searchStatusLabel").empty().append("状&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;态:");
$("#searchSupplierIDLabel").empty().append("供&nbsp;&nbsp;应&nbsp;&nbsp;商:");
$("#statusLabel").empty().append("状&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;态:");
$("#locationLabel").empty().append("位&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;置:");
$("#userIDLabel").empty().append("用&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;户:");
$("#serialnumLabel").empty().append("序&nbsp;&nbsp;&nbsp;列&nbsp;&nbsp;&nbsp;号:");
$("#supplierIDLabel").empty().append("供&nbsp;&nbsp;&nbsp;应&nbsp;&nbsp;&nbsp;商:");
$("#descriptionLabel").empty().append("描&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;述:");
//供应商
$("#supplierLabel").empty().append("供&nbsp;&nbsp;应&nbsp;&nbsp;商 &nbsp;");
$("#contactsLabel").empty().append("联&nbsp;&nbsp;系&nbsp;&nbsp;人&nbsp;&nbsp;");
$("#phonenumLabel").empty().append("联系电话&nbsp;&nbsp;");
$("#emailLabel").empty().append("电子邮箱&nbsp;&nbsp;");
$("#supplierdescriptionLabel").empty().append("描&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;述&nbsp;&nbsp;");
//资产名称
$("#namedescriptionLabel").empty().append("描&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;述&nbsp;&nbsp;");
$("#assetNameLabel").empty().append("资产名称&nbsp;&nbsp;");
$("#categoryLabel").empty().append("资产类型&nbsp;&nbsp;");
$("#consumableLabel").empty().append("是否耗材&nbsp;&nbsp;");
//用户
$("#usernameLabel").empty().append("用户名称&nbsp;&nbsp;");
$("#departmentLabel").empty().append("部&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;门&nbsp;&nbsp;");
$("#userpositionLabel").empty().append("职&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;位&nbsp;&nbsp;");
$("#userphonenumLabel").empty().append("联系电话&nbsp;&nbsp;");
$("#useremailLabel").empty().append("电子邮箱&nbsp;&nbsp;");
$("#userdescriptionLabel").empty().append("描&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;述&nbsp;&nbsp;");
}
else
{
$("#searchStatusLabel").empty().append("状&nbsp;&nbsp;&nbsp;&nbsp;态:");
$("#searchSupplierIDLabel").empty().append("供&nbsp;应&nbsp;商:");
$("#statusLabel").empty().append("状&nbsp;&nbsp;&nbsp;&nbsp;态:");
$("#locationLabel").empty().append("位&nbsp;&nbsp;&nbsp;&nbsp;置:");
$("#userIDLabel").empty().append("用&nbsp;&nbsp;&nbsp;&nbsp;户:");
$("#serialnumLabel").empty().append("序&nbsp;&nbsp;列&nbsp;&nbsp;号:");
$("#supplierIDLabel").empty().append("供&nbsp;&nbsp;应&nbsp;&nbsp;商:");
$("#descriptionLabel").empty().append("描&nbsp;&nbsp;&nbsp;&nbsp;述:");
//供应商
$("#supplierLabel").empty().append("供&nbsp;应&nbsp;商 ");
$("#contactsLabel").empty().append("联&nbsp;系&nbsp;人");
$("#phonenumLabel").empty().append("联系电话");
$("#emailLabel").empty().append("电子邮箱");
$("#supplierdescriptionLabel").empty().append("描&nbsp;&nbsp;&nbsp;&nbsp;述");
//资产名称
$("#namedescriptionLabel").empty().append("描&nbsp;&nbsp;&nbsp;&nbsp;述&nbsp;");
$("#assetNameLabel").empty().append("资产名称&nbsp;");
$("#categoryLabel").empty().append("资产类型&nbsp;");
$("#consumableLabel").empty().append("是否耗材&nbsp;");
//用户
$("#usernameLabel").empty().append("用户名称&nbsp;");
$("#departmentLabel").empty().append("部&nbsp;&nbsp;&nbsp;&nbsp;门&nbsp;");
$("#userpositionLabel").empty().append("职&nbsp;&nbsp;&nbsp;&nbsp;位&nbsp;");
$("#userphonenumLabel").empty().append("联系电话&nbsp;");
$("#useremailLabel").empty().append("电子邮箱&nbsp;");
$("#userdescriptionLabel").empty().append("描&nbsp;&nbsp;&nbsp;&nbsp;述&nbsp;");
}
}
//隐藏操作按钮
function hideOperation()
{
if('${sessionScope.user.loginame}'== 'guest')
$("#addAsset").add("#deleteAsset").add("#importAsset").add("#exportAsset").add("#editAsset").hide();
else
$("#addAsset").add("#deleteAsset").add("#importAsset").add("#exportAsset").add("#editAsset").show();
}
//防止表单提交重复
function initForm()
{
$('#importExcelFM').form({
onSubmit: function(){
return false;
}
});
}
//导入excel表格
$("#saveimport").unbind().bind({
click:function()
{
if($("#assetFile").val().length == 0)
{
$.messager.alert('提示','请选择文件!','info');
return;
}
$("#importExcelFM").submit();
$('#importExcelDlg').dialog('close');
$.messager.progress({
title:'请稍候',
msg:'数据处理ing...'
});
setTimeout(function(){
$.messager.progress('close');
var opts = $("#tableData").datagrid('options');
showAssetDetails(opts.pageNumber,opts.pageSize);
},3300);
}
});
//初始化表格数据
function initTableData()
{
$('#tableData').datagrid({
//title:'资产列表',
//iconCls:'icon-save',
//width:700,
height:heightInfo,
nowrap: false,
rownumbers: false,
//动画效果
animate:false,
//选中单行
singleSelect : true,
collapsible:false,
selectOnCheck:false,
//fitColumns:true,
//单击行是否选中
checkOnSelect : false,
//交替出现背景
striped : true,
url:'<%=path %>/asset/findBy.action?pageSize=' + initPageSize,
pagination: true,
//loadFilter: pagerFilter,
pageSize: initPageSize,
pageList: initPageNum,
rowStyler: function(index,row){
return 'cursor: pointer;';
},
frozenColumns:[[
{ field: 'id',width:35,align:"center",checkbox:true},
{ title: '资产名称',field: 'assetname',width:100},
{ title: '资产类型', field: 'category',width:115,align:"center"},
{ title: '单价', field: 'price',width:70,align:"center",formatter:function(value,row)
{
if(value == '0.0')
return '';
return value;
}}
]],
columns:[[
{ title: '用户',field: 'username',width:100,align:"center"},
{ title: '购买日期',field: 'purchasedate',width:90,align:"center"},
{ title: '状态',field: 'status',width:50,align:"center"},
{ title: '位置',field: 'location',width:100,align:"center"},
{ title: '资产编号',field: 'assetnum',width:120,align:"center"},
{ title: '序列号',field: 'serialnum',width:120,align:"center"},
{ title: '有效日期',field: 'periodofvalidity',width:90,align:"center"},
{ title: '保修日期',field: 'warrantydate',width:90,align:"center"},
{ title: '供应商',field: 'supplier',width:100,align:"center"},
{ title: '标签',field: 'labels',width:180,align:"center"},
{ title: '描述',field: 'description',width:300},
{ title: '操作',field: 'op',align:"center",width:130,formatter:function(value,rec)
{
var price;
if(rec.price == '0.0')
price = '';
else
price = rec.price;
var str = '';
var rowInfo = rec.id + 'AaBb' + rec.assetnameID +'AaBb' + price
+ 'AaBb'+ rec.categoryID + 'AaBb'+ rec.userID + 'AaBb' + rec.purchasedate
+ 'AaBb'+ rec.statushort + 'AaBb'+ rec.location + 'AaBb' + rec.periodofvalidity
+ 'AaBb'+ rec.warrantydate + 'AaBb'+ rec.supplierID + 'AaBb' + rec.labels
+ 'AaBb' + rec.description + 'AaBb' + rec.assetnum + 'AaBb' + rec.serialnum;
if(1 == value && '${sessionScope.user.loginame}'!= 'guest')
{
str += '<img src="<%=path%>/js/easyui-1.3.5/themes/icons/pencil.png" style="cursor: pointer;" onclick="editAsset(\'' + rowInfo + '\');"/>&nbsp;<a onclick="editAsset(\'' + rowInfo + '\');" style="text-decoration:none;color:black;" href="javascript:void(0)">编辑</a>&nbsp;&nbsp;';
str += '<img src="<%=path%>/js/easyui-1.3.5/themes/icons/edit_remove.png" style="cursor: pointer;" onclick="deleteAsset('+ rec.id +');"/>&nbsp;<a onclick="deleteAsset('+ rec.id +');" style="text-decoration:none;color:black;" href="javascript:void(0)">删除</a>&nbsp;&nbsp;';
}
return str;
}
}
]],
toolbar:[
{
id:'addAsset',
text:'增加',
iconCls:'icon-add',
handler:function()
{
addAsset();
}
}
,'-',
{
id:'deleteAsset',
text:'删除',
iconCls:'icon-remove',
handler:function()
{
batDeleteAsset();
}
}
,'-',
{
id:'exportAsset',
text:'导出',
iconCls:'icon-excel',
handler:function()
{
$("#fileName").val("").focus();
$("#isAllData").val("currentPage");
$('#exportExcelDlg').dialog('open').dialog('setTitle','导出资产信息');
$(".window-mask").css({ width: webW-20 ,height: webH});
$("#fileName").focus();
}
}
,'-',
{
id:'importAsset',
text:'导入',
iconCls:'icon-excel',
handler:function()
{
//IE下不允许编辑 input=file的值 解决思路:重新克隆input=file,把这个input元素复制一个,然后将原来的删除。
//在IE下复制元素的时候,其中的值是不会被复制的,所以就达到了清空文件域的目的了。
//而在Firefox下,其中的值也会被一同复制,清空一下就做到兼容
var fileUploadInput = $("#assetFile");
fileUploadInput.after(fileUploadInput.clone().val(""));
fileUploadInput.remove();
$("#isCheck").val(1);
//$("#assetFile").val("").focus();
//$("#isAllData").val("currentPage");
$('#importExcelDlg').dialog('open').dialog('setTitle','导入资产信息');
$(".window-mask").css({ width: webW-20 ,height: webH});
$("#assetFile").focus();
}
}
],
onLoadError:function()
{
$.messager.alert('页面加载提示','页面加载异常,请稍后再试!','error');
return;
},
onRowContextMenu:function(e, rowIndex, rec)
{
e.preventDefault();
$(this).datagrid('selectRow',rowIndex);
$('#rightMenu').menu('show', {
left:e.pageX,
top:e.pageY
});
//$("#" + rec.id).click();
rightRowInfo = rec.id + 'AaBb' + rec.assetnameID +'AaBb' + rec.price
+ 'AaBb'+ rec.categoryID + 'AaBb'+ rec.userID + 'AaBb' + rec.purchasedate
+ 'AaBb'+ rec.statushort + 'AaBb'+ rec.location + 'AaBb' + rec.periodofvalidity
+ 'AaBb'+ rec.warrantydate + 'AaBb'+ rec.supplierID + 'AaBb' + rec.labels
+ 'AaBb' + rec.description + 'AaBb' + rec.assetnum + 'AaBb' + rec.serialnum;
rightRowID = rec.id;
rightRowIndex = rowIndex;
},
onDblClickRow:function(rowIndex, rec)
{
var rowDBInfo = rec.id + 'AaBb' + rec.assetnameID +'AaBb' + rec.price
+ 'AaBb'+ rec.categoryID + 'AaBb'+ rec.userID + 'AaBb' + rec.purchasedate
+ 'AaBb'+ rec.statushort + 'AaBb'+ rec.location + 'AaBb' + rec.periodofvalidity
+ 'AaBb'+ rec.warrantydate + 'AaBb'+ rec.supplierID + 'AaBb' + rec.labels
+ 'AaBb' + rec.description + 'AaBb' + rec.assetnum + 'AaBb' + rec.serialnum;
editAsset(rowDBInfo);
}
});
}
//获取编辑条目
function showEditInfo()
{
var rec = $("#tableData").datagrid('getSelected');
if(null == rec)
{
$.messager.alert('提示','没有资产信息被选中!','info');
return;
}
var rowDBInfo = rec.id + 'AaBb' + rec.assetnameID +'AaBb' + rec.price
+ 'AaBb'+ rec.categoryID + 'AaBb'+ rec.userID + 'AaBb' + rec.purchasedate
+ 'AaBb'+ rec.statushort + 'AaBb'+ rec.location + 'AaBb' + rec.periodofvalidity
+ 'AaBb'+ rec.warrantydate + 'AaBb'+ rec.supplierID + 'AaBb' + rec.labels
+ 'AaBb' + rec.description + 'AaBb' + rec.assetnum + 'AaBb' + rec.serialnum;
editAsset(rowDBInfo);
}
//右键编辑
$("#rightEdit").unbind().bind({
click:function()
{
editAsset(rightRowInfo);
}
});
//右键删除
$("#rightDelete").unbind().bind({
click:function()
{
deleteAsset(rightRowID);
}
});
//右键取消
$("#rightCancel").unbind().bind({
click:function()
{
//$("#searchBtn").click();
$("#tableData").datagrid('unselectRow',rightRowIndex);
}
});
//导出资产为excel表格
$("#saveexport").unbind().bind({
click:function()
{
var fileName = $.trim($("#fileName").val());
var isAllData = $("#isAllData").val();
if(!$(this).form('validate'))
return;
var opts = $("#tableData").datagrid('options');
window.location.href = "<%=path%>/asset/exportExcel.action?fileName=" + encodeURI(fileName) + "&isAllData=" + isAllData + "&browserType=" + getOs() + "&pageSize=" + opts.pageSize + "&pageNo=" + opts.pageNumber ;
$('#exportExcelDlg').dialog('close');
}
});
//初始化键盘enter事件
$(document).keydown(function(event)
{
//兼容 IE和firefox 事件
var e = window.event || event;
var k = e.keyCode||e.which||e.charCode;
//兼容 IE,firefox 兼容
var obj = e.srcElement ? e.srcElement : e.target;
//绑定键盘事件为 id是指定的输入框才可以触发键盘事件 13键盘事件
if(k == "13"&&(obj.id=="assetNameID"|| obj.id=="location"
|| obj.id=="status" || obj.id=="userID" || obj.id=="price" || obj.id=="purchasedate"
|| obj.id=="supplierID" || obj.id=="periodofvalidity" || obj.id=="warrantydate"
|| obj.id=="assetnum" || obj.id=="serialnum" || obj.id=="labels"
|| obj.id=="supplierID" || obj.id=="description"))
{
$("#saveAsset").click();
}
//绑定键盘事件为 id是指定的输入框才可以触发键盘事件 13键盘事件
if(k == "13"&&(obj.id=="supplier" || obj.id=="contacts"|| obj.id=="phonenum"
|| obj.id=="email" || obj.id=="descriptionSupplier" ))
{
$("#saveSupplier").click();
}
//绑定键盘事件为 id是指定的输入框才可以触发键盘事件 13键盘事件 ---遗留问题 enter键效验 对话框会关闭问题
if(k == "13"&&(obj.id=="assetName"|| obj.id=="descriptioname"|| obj.id=="consumable" || obj.id=="category" ))
{
$("#saveAssetName").click();
}
//绑定键盘事件为 id是指定的输入框才可以触发键盘事件 13键盘事件
if(k == "13"&&(obj.id=="username" || obj.id=="department"|| obj.id=="phonenum0"
|| obj.id=="email" || obj.id=="descriptionUser" || obj.id=="position"))
{
$("#saveusername").click();
}
//搜索按钮添加快捷键
if(k == "13"&&(obj.id=="searchSupplier" || obj.id=="searchCategoryID"|| obj.id=="searchuserID"
|| obj.id=="searchStatus" || obj.id=="searchSupplierID" ))
{
$("#searchBtn").click();
}
//导出添加快捷键
if(k == "13"&&(obj.id=="fileName" || obj.id=="isAllData" ))
{
$("#saveexport").click();
}
});
//增加资产名称
$("#addAssetName").unbind().bind({
click:function()
{
$('#assetnameDlg').dialog('open').dialog('setTitle','<img src="<%=path%>/js/easyui-1.3.5/themes/icons/edit_add.png"/>&nbsp;增加资产名称信息');
$('#assetnameFM').form('clear');
var row = {
consumable:0,
clientIp:'<%=clientIp %>',
category:categoryID
};
$('#assetnameFM').form('load',row);
$("#assetName").focus();
}
});
//保存信息
$("#saveAssetName").unbind().bind({
click:function()
{
if(!$('#assetnameFM').form('validate'))
return;
else if(checkAssetName())
return;
else
{
$.ajax({
type:"post",
url: '<%=path %>/assetname/create.action',
dataType: "json",
async : false,
data: ({
assetName : $.trim($("#assetName").val()),
consumable : $("#consumable").val(),
description : $.trim($("#descriptioname").val()),
clientIp:'<%=clientIp %>',
categoryID: $.trim($("#category").val())
}),
success: function (tipInfo)
{
if(tipInfo)
{
$('#assetnameDlg').dialog('close');
//初始化系统基础信息
initSystemData();
//初始化页面系统基础信息选项卡
initSelectInfo();
}
else
{
$.messager.show({
title: '错误提示',
msg: '保存资产名称信息失败,请稍后重试!'
});
}
},
//此处添加错误处理
error:function()
{
$.messager.alert('提示','保存资产名称信息异常,请稍后再试!','error');
return;
}
});
}
}
});
//检查名称是否存在 ++ 重名无法提示问题需要跟进
function checkAssetName()
{
var assetName = $.trim($("#assetName").val());
//表示是否存在 true == 存在 false = 不存在
var flag = false;
//开始ajax名称检验,不能重名
if(assetName.length > 0)
{
$.ajax({
type:"post",
url: "<%=path %>/assetname/checkIsNameExist.action",
dataType: "json",
async : false,
data: ({
assetNameID : 0,
assetName : assetName
}),
success: function (tipInfo)
{
flag = tipInfo;
if(tipInfo)
{
$.messager.alert('提示','资产名称已经存在','info');
return;
}
},
//此处添加错误处理
error:function()
{
$.messager.alert('提示','检查资产名称是否存在异常,请稍后再试!','error');
return;
}
});
}
return flag;
}
//增加用户名称
$("#addUserName").unbind().bind({
click:function()
{
$('#userDlg').dialog('open').dialog('setTitle','<img src="<%=path%>/js/easyui-1.3.5/themes/icons/edit_add.png"/>&nbsp;增加用户');
$('#usernameFM').form('clear');
var row = {
clientIp:'<%=clientIp %>'
};
$('#usernameFM').form('load',row);
$("#username").focus();
}
});
//保存用户信息
$("#saveusername").unbind().bind({
click:function()
{
if(checkusernameName())
return;
var reg = /^([0-9])+$/;
var phonenum = $.trim($("#phonenum0").val());
if(phonenum.length>0 && !reg.test(phonenum))
{
$.messager.alert('提示','电话号码只能是数字','info');
$("#phonenum").val("").focus();
return;
}
$('#usernameFM').form('submit',{
url: '<%=path %>/user/create.action',
onSubmit: function()
{
return $(this).form('validate');
},
success: function(result)
{
var result = eval('('+result+')');
if (!result)
{
$.messager.show({
title: '错误提示',
msg: '保存用户信息失败,请稍后重试!'
});
}
else
{
$('#userDlg').dialog('close');
//初始化系统基础信息
initSystemData();
//初始化页面系统基础信息选项卡
initSelectInfo();
}
}
});
}
});
//检查用户 名称是否存在 ++ 重名无法提示问题需要跟进
function checkusernameName()
{
var usernameName = $.trim($("#username").val());
//表示是否存在 true == 存在 false = 不存在
var flag = false;
//开始ajax名称检验,不能重名
if(usernameName.length > 0)
{
$.ajax({
type:"post",
url: "<%=path %>/user/checkIsNameExist.action",
dataType: "json",
async : false,
data: ({
userID : 0,
username : usernameName
}),
success: function (tipInfo)
{
flag = tipInfo;
if(tipInfo)
{
$.messager.alert('提示','用户名称已经存在','info');
return;
}
},
//此处添加错误处理
error:function()
{
$.messager.alert('提示','检查用户名称是否存在异常,请稍后再试!','error');
return;
}
});
}
return flag;
}
//增加供应商名称
$("#addSupplerName").unbind().bind({
click:function()
{
$('#supplierDlg').dialog('open').dialog('setTitle','<img src="<%=path%>/js/easyui-1.3.5/themes/icons/edit_add.png"/>&nbsp;增加供应商');
$('#supplierFM').form('clear');
var row = {
clientIp:'<%=clientIp %>'
};
$('#supplierFM').form('load',row);
$("#supplier").focus();
}
});
//保存供应商信息
$("#saveSupplier").unbind().bind({
click:function()
{
if(checkSupplierName())
return;
var reg = /^([0-9])+$/;
var phonenum = $.trim($("#phonenum").val());
if(phonenum.length>0 && !reg.test(phonenum))
{
$.messager.alert('提示','电话号码只能是数字','info');
$("#phonenum").val("").focus();
return;
}
$('#supplierFM').form('submit',{
url: '<%=path %>/supplier/create.action',
onSubmit: function()
{
return $(this).form('validate');
},
success: function(result)
{
var result = eval('('+result+')');
if (!result)
{
$.messager.show({
title: '错误提示',
msg: '保存供应商信息失败,请稍后重试!'
});
}
else
{
$('#supplierDlg').dialog('close');
//初始化系统基础信息
initSystemData();
//初始化页面系统基础信息选项卡
initSelectInfo();
}
}
});
}
});
//检查供应商 名称是否存在 ++ 重名无法提示问题需要跟进
function checkSupplierName()
{
var supplierName = $.trim($("#supplier").val());
//表示是否存在 true == 存在 false = 不存在
var flag = false;
//开始ajax名称检验,不能重名
if(supplierName.length > 0)
{
$.ajax({
type:"post",
url: "<%=path %>/supplier/checkIsNameExist.action",
dataType: "json",
async : false,
data: ({
supplierID : 0,
supplier : supplierName
}),
success: function (tipInfo)
{
flag = tipInfo;
if(tipInfo)
{
$.messager.alert('提示','供应商名称已经存在','info');
//alert("供应商名称已经存在");
//$("#supplier").val("");
return;
}
},
//此处添加错误处理
error:function()
{
$.messager.alert('提示','检查供应商名称是否存在异常,请稍后再试!','error');
return;
}
});
}
return flag;
}
//分页信息处理
function ininPager()
{
try
{
var opts = $("#tableData").datagrid('options');
var pager = $("#tableData").datagrid('getPager');
pager.pagination({
onSelectPage:function(pageNum, pageSize)
{
opts.pageNumber = pageNum;
opts.pageSize = pageSize;
pager.pagination('refresh',
{
pageNumber:pageNum,
pageSize:pageSize
});
showAssetDetails(pageNum,pageSize);
}
});
}
catch (e)
{
$.messager.alert('异常处理提示',"分页信息异常 : " + e.name + ": " + e.message,'error');
}
}
//初始化系统基础信息
function initSystemData()
{
$.ajax({
type:"post",
url: "<%=path%>/asset/getBasicData.action",
//设置为同步
async:false,
dataType: "json",
success: function (systemInfo)
{
//成功关闭loading
userList = systemInfo.showModel.map.userList;
categoryList = systemInfo.showModel.map.categoryList;
supplierList = systemInfo.showModel.map.supplierList;
nameList = systemInfo.showModel.map.assetnameList;
var msgTip = systemInfo.showModel.msgTip;
if(msgTip == "exceptoin")
{
$.messager.alert('提示','查找系统基础信息异常,请与管理员联系!','error');
return;
}
}
});
}
//初始化页面选项卡
function initSelectInfo()
{
var options = "";
if(nameList !=null)
{
for(var i = 0 ;i < nameList.length;i ++)
{
var nameInfo = nameList[i];
if(0== i)
{
nameID = nameInfo.id;
}
options += '<option value="' + nameInfo.id + '">' + nameInfo.assetname + '</option>';
}
$("#assetNameID").empty().append(options);
$("#searchAssetNameID").empty().append('<option value="">请选择</option>').append(options);
}
if(userList !=null)
{
options = "";
for(var i = 0 ;i < userList.length;i ++)
{
var user = userList[i];
if(0 == i)
{
userID = user.id
}
options += '<option value="' + user.id + '">' + user.username + '</option>';
}
$("#userID").empty().append(options);
$("#searchuserID").empty().append('<option value="">请选择</option>').append(options);
}
if(categoryList !=null)
{
options = "";
for(var i = 0 ;i < categoryList.length;i ++)
{
var category = categoryList[i];
if(0 == i)
{
categoryID = category.id;
}
options += '<option value="' + category.id + '">' + category.assetname + '</option>';
}
$("#searchCategoryID").empty().append('<option value="">请选择</option>').append(options);
$("#category").empty().append(options);
}
if(supplierList !=null)
{
options = "";
for(var i = 0 ;i < supplierList.length;i ++)
{
var supplier = supplierList[i];
if(0 == i)
{
supplierID = supplier.id;
}
options += '<option value="' + supplier.id + '">' + supplier.supplier + '</option>';
}
$("#supplierID").empty().append(options);
$("#searchSupplierID").empty().append('<option value="">请选择</option>').append(options);
}
}
//控制用户数据是否可用
$("#status").unbind().bind({
change:function()
{
if($(this).val() == 1 || $(this).val() == 2)
{
$("#userID").removeAttr("disabled").css({width:"200px"});
$("#addUserName").show();
}
else
{
$("#userID").attr("disabled","true").css({width:"230px"});
$("#addUserName").hide();
}
}
});
//删除资产信息
function deleteAsset(assetID)
{
$.messager.confirm('删除确认','确定要删除此资产信息吗?',function(r)
{
if (r)
{
$.ajax({
type:"post",
url: "<%=path %>/asset/delete.action",
dataType: "json",
data: ({
assetID : assetID,
clientIp:'<%=clientIp %>'
}),
success: function (tipInfo)
{
var msg = tipInfo.showModel.msgTip;
if(msg == '成功')
{
//$('#tableData').datagrid('reload');
//加载完以后重新初始化
$("#searchBtn").click();
//var opts = $("#tableData").datagrid('options');
//showAssetDetails(opts.pageNumber,opts.pageSize);
}
else
$.messager.alert('删除提示','删除资产信息失败,请稍后再试!','error');
},
//此处添加错误处理
error:function()
{
$.messager.alert('删除提示','删除资产信息异常,请稍后再试!','error');
return;
}
});
}
});
}
//批量删除资产
function batDeleteAsset()
{
var row = $('#tableData').datagrid('getChecked');
if(row.length == 0)
{
$.messager.alert('删除提示','没有记录被选中!','info');
return;
}
if(row.length > 0)
{
$.messager.confirm('删除确认','确定要删除选中的' + row.length + '条资产信息吗?',function(r)
{
if (r)
{
var ids = "";
for(var i = 0;i < row.length; i ++)
{
if(i == row.length-1)
{
ids += row[i].id;
break;
}
//alert(row[i].id);
ids += row[i].id + ",";
}
$.ajax({
type:"post",
url: "<%=path %>/asset/batchDelete.action",
dataType: "json",
async : false,
data: ({
assetIDs : ids,
clientIp:'<%=clientIp %>'
}),
success: function (tipInfo)
{
var msg = tipInfo.showModel.msgTip;
if(msg == '成功')
{
//$('#tableData').datagrid('reload');
//加载完以后重新初始化
$("#searchBtn").click();
$(":checkbox").attr("checked",false);
}
else
$.messager.alert('删除提示','删除资产信息失败,请稍后再试!','error');
},
//此处添加错误处理
error:function()
{
$.messager.alert('删除提示','删除资产信息异常,请稍后再试!','error');
return;
}
});
}
});
}
}
//增加资产
var url;
var assetID = 0;
function addAsset()
{
$('#assetDlg').dialog('open').dialog('setTitle','<img src="<%=path%>/js/easyui-1.3.5/themes/icons/edit_add.png"/>&nbsp;增加资产');
$(".window-mask").css({ width: webW-20 ,height: webH});
$('#assetFM').form('clear');
$("#userID").attr("disabled","true");
$("#assetNameID").focus();
var row = {
assetNameID : nameID,
assetCategoryID :categoryID,
userID:userID,
supplierID:supplierID,
status:0,
clientIp:'<%=clientIp %>'
};
$('#assetFM').form('load',row);
$("#saveKeepAsset").show();
assetID = 0;
url = '<%=path %>/asset/create.action';
}
//保存资产信息
$("#saveKeepAsset").unbind().bind({
click:function()
{
$('#assetFM').form('submit',{
url: url,
onSubmit: function()
{
return $(this).form('validate');
},
success: function(result)
{
var result = eval('('+result+')');
if (!result)
{
$.messager.show({
title: '错误提示',
msg: '保存资产信息失败,请稍后重试!'
});
}
else
{
$("#serialnum").val("");
$("#assetnum").val("").focus();
var opts = $("#tableData").datagrid('options');
showAssetDetails(opts.pageNumber,opts.pageSize);
}
}
});
}
});
//保存资产信息
$("#saveAsset").unbind().bind({
click:function()
{
$('#assetFM').form('submit',{
url: url,
onSubmit: function()
{
return $(this).form('validate');
},
success: function(result)
{
var result = eval('('+result+')');
if (!result)
{
$.messager.show({
title: '错误提示',
msg: '保存资产信息失败,请稍后重试!'
});
}
else
{
$('#assetDlg').dialog('close');
var opts = $("#tableData").datagrid('options');
showAssetDetails(opts.pageNumber,opts.pageSize);
}
}
});
}
});
//编辑资产信息
function editAsset(assetTotalInfo)
{
$("#saveKeepAsset").hide();
var assetInfo = assetTotalInfo.split("AaBb");
var row = {
assetNameID : assetInfo[1],
assetCategoryID : assetInfo[3],
location:assetInfo[7],
status:assetInfo[6],
userID:assetInfo[4],
price:assetInfo[2],
purchasedate:assetInfo[5],
supplierID:assetInfo[10],
periodofvalidity:assetInfo[8],
warrantydate:assetInfo[9],
assetnum:assetInfo[13],
serialnum:assetInfo[14],
labels:assetInfo[11],
supplierID:assetInfo[10],
description:assetInfo[12],
clientIp:'<%=clientIp %>'
};
if(assetInfo[6] == 1 || assetInfo[6] == 2)
$("#userID").removeAttr("disabled");
else
$("#userID").attr("disabled","true");
$('#assetDlg').dialog('open').dialog('setTitle','<img src="<%=path%>/js/easyui-1.3.5/themes/icons/pencil.png"/>&nbsp;编辑资产信息');
$(".window-mask").css({ width: webW-20 ,height: webH});
$('#assetFM').form('load',row);
assetID = assetInfo[0];
$("#assetNameID").focus();
url = '<%=path %>/asset/update.action?assetID=' + assetInfo[0];
}
//搜索处理
$("#searchBtn").unbind().bind({
click:function()
{
showAssetDetails(1,initPageSize);
var opts = $("#tableData").datagrid('options');
var pager = $("#tableData").datagrid('getPager');
opts.pageNumber = 1;
opts.pageSize = initPageSize;
pager.pagination('refresh',
{
pageNumber:1,
pageSize:initPageSize
});
}
});
function showAssetDetails(pageNo,pageSize)
{
$.ajax({
type:"post",
url: "<%=path %>/asset/findBy.action",
dataType: "json",
data: ({
assetNameID:$.trim($("#searchAssetNameID").val()),
assetCategoryID:$.trim($("#searchCategoryID").val()),
userID:$.trim($("#searchuserID").val()),
status:$.trim($("#searchStatus").val()),
supplierID:$.trim($("#searchSupplierID").val()),
pageNo:pageNo,
pageSize:pageSize
}),
success: function (data)
{
$("#tableData").datagrid('loadData',data);
//$('#tableData').datagrid('reload');
},
//此处添加错误处理
error:function()
{
$.messager.alert('查询提示','查询数据后台异常,请稍后再试!','error');
return;
}
});
}
//重置按钮
$("#searchResetBtn").unbind().bind({
click:function(){
$("#searchAssetNameID").val("");
$("#searchCategoryID").val("");
$("#searchuserID").val("");
$("#searchStatus").val("");
$("#searchSupplierID").val("");
//加载完以后重新初始化
$("#searchBtn").click();
}
});
</script>
</body>
</html>
\ No newline at end of file
<%@page language="java" contentType="text/html; charset=utf-8" pageEncoding="utf-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<meta http-equiv=Content-Type content="text/html; charset=utf-8">
<!-- 指定以IE8的方式来渲染 -->
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE8"/>
<link rel="shortcut icon" href="<%=path%>/images/favicon.ico" type="image/x-icon" />
<link href="css/admin.css" type="text/css" rel="stylesheet">
<title>首页说明</title>
<style type="text/css">
<!--
body {
margin-left: 0px;
margin-top: 0px;
margin-right: 0px;
margin-bottom: 0px;
background-color: #EAF2FD;
}
.STYLE1 {font-size: 12px}
.STYLE4 {
font-size: 12px;
color: #1F4A65;
font-weight: bold;
}
a:link {
font-size: 12px;
color: #06482a;
text-decoration: none;
}
a:visited {
font-size: 12px;
color: #06482a;
text-decoration: none;
}
a:hover {
font-size: 12px;
color: #FF0000;
text-decoration: underline;
}
a:active {
font-size: 12px;
color: #FF0000;
text-decoration: none;
}
.STYLE7 {font-size: 12}
-->
</style>
</head>
<body>
<table cellSpacing=0 cellPadding=0 width="100%" align=center border=0>
<tr height=28>
<td width="1101" class="STYLE4">
&nbsp;&nbsp;<img src="<%=path%>/images/computer.png" width="16" height="16" />
<span >资产管理</span>
</td>
</tr>
<tr>
<td bgColor=#b1ceef height=1></td>
</tr>
<tr height="5px">
<td background=images/shadow_bg.jpg></td>
</tr>
</table>
<p style="font-size: 12px;color: #1F4A65;padding: 10px">
&nbsp;&nbsp;&nbsp;&nbsp;
资产管理是记录资产明细,包括资产名称、资产类型、供应商、使用用户等信息,通过资产管理,可以记录平时资产明细,管理资产信息。资产管理包括增加,修改,删除、搜索消费信息等功能点。报表图表最多显示十条报表记录。
</p>
</body>
</html>
\ No newline at end of file
<%@page import="com.jsh.util.Tools"%>
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
String clientIp = Tools.getCurrentUserIP();
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>资产管理</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<!-- 指定以IE8的方式来渲染 -->
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE8"/>
<link rel="shortcut icon" href="<%=path%>/images/favicon.ico" type="image/x-icon" />
<link rel="stylesheet" type="text/css" href="<%=path %>/js/easyui-1.3.5/themes/default/easyui.css"/>
<link rel="stylesheet" type="text/css" href="<%=path %>/js/easyui-1.3.5/themes/icon.css"/>
<script type="text/javascript" src="<%=path %>/js/jquery-1.8.0.min.js"></script>
<script type="text/javascript" src="<%=path %>/js/easyui-1.3.5/jquery.easyui.min.js"></script>
<script type="text/javascript" src="<%=path %>/js/easyui-1.3.5/locale/easyui-lang-zh_CN.js"></script>
<script type="text/javascript" src="<%=path%>/js/highcharts/highcharts.js"></script>
<script type="text/javascript" src="<%=path%>/js/highcharts/exporting.js"></script>
<script type="text/javascript" src="<%=path%>/js/StringBuffer.js"></script>
<script type="text/javascript" src="<%=path %>/js/common/common.js"></script>
<style>
body{ margin:0; height:100%}
html{ height:100%} /*兼容firefox的div高度100%*/
#left{ width:150px; height:100%; float:left; _margin-right:-3px;}
#right{ height:100%;}
<!--页面展示特殊要求-->
.datagrid-body,.datagrid-footer,.datagrid-pager ,.datagrid-view
{
background-color:#EAF2FD;
}
</style>
</head>
<body>
<div id="position" class="easyui-panel" title="当前位置:资产管理 &gt; 资产报表" collapsible="false" closable="false"/>
<!-- 查询 -->
<div id = "searchPanel" class="easyui-panel" style="padding:10px;" title="查询窗口" iconCls="icon-search" collapsible="true" closable="false">
<table id="searchTable">
<tr>
<td>资产名称:</td>
<td>
<select name="searchAssetNameID" id="searchAssetNameID" style="width:200px;"></select>
</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>资产类型:</td>
<td>
<select name="searchCategoryID" id="searchCategoryID" style="width:200px;"></select>
</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>用户姓名:</td>
<td>
<select name="searchUsernameID" id="searchUsernameID" style="width:200px;"></select>
</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td id="searchStatusLabel">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;态:</td>
<td>
<select name="searchStatus" id="searchStatus" style="width:200px;">
<option value="">请选择</option>
<option value="0">在库</option>
<option value="1">在用</option>
<option value="2">消费</option>
</select>
</td>
</tr>
<tr>
<td id="searchSupplierIDLabel">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;商:</td>
<td>
<select name="searchSupplierID" id="searchSupplierID" style="width:200px;"></select>
</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>统计类型:</td>
<td>
<select name="searchReportType" id="searchReportType" style="width:200px;">
<option value="0">资产状态</option>
<option value="1">资产类型</option>
<option value="2">供应商</option>
<option value="3">资产名称</option>
<option value="4">所属用户</option>
</select>
</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>是否前十:</td>
<td>
<select name="searchTopten" id="searchTopten" style="width:200px;">
<option value="0"></option>
<option value="1"></option>
</select>
</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>
<a href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-search" id="searchBtn">查询</a>&nbsp;&nbsp;
<a href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-redo" id="searchResetBtn">重置</a>
</td>
</tr>
</table>
</div>
<!-- 数据显示table -->
<%-- <div id = "tablePanel" class="easyui-panel" style="padding:1px;top:300px;" title="资产列表" iconCls="icon-chart-column" collapsible="true" closable="false">--%>
<%-- <table id="tableData" style="height:360px;top:300px;border-bottom-color:#FFFFFF"></table>--%>
<%-- </div>--%>
<div id = "tablePanel" class="easyui-panel" style="padding:1px;top:300px;" title="资产报表" iconCls="icon-chart-column" collapsible="true" maximizable="false" closable="false">
<div id="left" class="easyui-tabs" style="padding:1px;">
<div title="综合图" style="padding:10px;background-color: #EAF2FD;height:340px;top:300px;" data-options="iconCls:'icon-chart-zonghe'">
<div id="zongheContainer">综合图</div>
</div>
<div title="柱状图" style="padding:10px;background-color: #EAF2FD;height:340px;top:300px;" data-options="iconCls:'icon-chart-statistics'">
<div id="culumnContainer" >柱状图</div>
</div>
<div title="饼状图" data-options="iconCls:'icon-chart-pie'" style="padding:10px;background-color: #EAF2FD;height:340px;top:300px;">
<div id="pieContainer">饼状图</div>
</div>
<div title="折线图" data-options="iconCls:'icon-chart-polygram'" style="padding:10px;background-color: #EAF2FD;height:340px;top:300px;">
<div id="zxianContainer">折现图</div>
</div>
</div>
<div id="right" class="easyui-tabs" style="padding:1px;">
<div title="表格" data-options="iconCls:'icon-list'" style="padding:10px;background-color: #EAF2FD;top:300px;">
<table id="tableData" style="top:300px;border-bottom-color:#FFFFFF;background-color: #EAF2FD;"></table>
</div>
</div>
</div>
<script type="text/javascript">
var userList = null;
var categoryList = null;
var supplierList = null;
var nameList = null;
//界面selet选显卡有问题解决方案
var nameID = null;
var userID = null;
var categoryID = null;
var supplierID = null;
//报表数据
var pageData = null;
//报表显示个数
var showNum = 10;
//初始化界面
$(function()
{
//progress();
//页面自定义高度
heightInfo = heightInfo - 50;
//是否限制条件 默认限制
initShowDataNum();
//initTableData();
//ininPager();
//初始化系统基础信息
initSystemData();
//初始化页面系统基础信息选项卡
initSelectInfo();
//获取报表数据
getDataInfo();
//初始化报表高度
initChartsHight();
//初始化表格数据
initTableData();
//综合图
showComboChart();
//饼状图
showPieChart();
//折线图
showSpline();
//显示柱状图
showHistogram();
browserFit();
});
//浏览器适配
function browserFit()
{
if(getOs()=='MSIE')
{
$("#searchStatusLabel").empty().append("状&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;态:");
$("#searchSupplierIDLabel").empty().append("供&nbsp;&nbsp;&nbsp;&nbsp;应&nbsp;&nbsp;&nbsp;&nbsp;商:");
}
else
{
$("#searchStatusLabel").empty().append("状&nbsp;&nbsp;&nbsp;&nbsp;态:");
$("#searchSupplierIDLabel").empty().append("供&nbsp;&nbsp;应&nbsp;&nbsp;商:");
}
}
$("#left").tabs({width:630});
var chartHight;
function initChartsHight()
{
$("#zxianContainer").add("#pieContainer").add("#culumnContainer")
.add("#zongheContainer").css({height: heightInfo});
chartHight = $("#zxianContainer").outerHeight();
}
//是否限制条件
function initShowDataNum()
{
var type = $("#searchTopten").val();
if(0 == type)
showNum = 10;
else
//表示不限制
showNum = 10000000000;
}
//加载进度条
function progress()
{
$.messager.progress({
title:'请稍候',
msg:'数据加载ing...'
});
setTimeout(function(){
$.messager.progress('close');
},3300)
}
//获取查询数据
function getDataInfo()
{
$.ajax({
type:"post",
url: "<%=path%>/report/find.action",
dataType: "json",
//取消异步机制,保证页面数据返回再进行处理
async: false,
data: ({
assetNameID:$.trim($("#searchAssetNameID").val()),
assetCategoryID:$.trim($("#searchCategoryID").val()),
usernameID:$.trim($("#searchUsernameID").val()),
status:$.trim($("#searchStatus").val()),
supplierID:$.trim($("#searchSupplierID").val()),
reportType : $.trim($("#searchReportType").val()),
}),
success: function (reportInfo)
{
pageData = reportInfo.showModel.reportData;
var msgTip = reportInfo.showModel.msgTip;
if(msgTip == "get report data exception")
{
alert("查找报表信息异常,请与管理员联系!");
return;
}
}
});
}
//初始化表格数据
function initTableData()
{
$('#tableData').datagrid({
//title:'资产列表',
//iconCls:'icon-save',
//width:700,
height : chartHight,
nowrap: false,
rownumbers: false,
//动画效果
animate:false,
//选中单行
singleSelect : true,
collapsible:false,
selectOnCheck:false,
//列宽自适应
//fitColumns:true,
//单击行是否选中
checkOnSelect : false,
url: null,
//pagination: true,
//loadFilter: pagerFilter,
//交替出现背景
striped : true,
//pageSize: 10,
//pageList: [10,20,30,50],
rowStyler:function(index,row){
return 'background-color:#EAF2FD;';
},
showFooter: true,
columns:[[
{ title: getReportType() + '类型',id:"dataTypeColumn",width:300,field: 'name',align:"center"},
{ title: '总数',field: 'sum',width:130,align:"center"}
]],
onLoadError:function()
{
$.messager.alert('页面加载提示','页面加载异常,请稍后再试!','error');
return;
}
});
$('#tableData').datagrid('loadData',initTableDetails());
}
//初始化键盘enter事件
$(document).keydown(function(event)
{
//兼容 IE和firefox 事件
var e = window.event || event;
var k = e.keyCode||e.which||e.charCode;
//兼容 IE,firefox 兼容
var obj = e.srcElement ? e.srcElement : e.target;
//搜索按钮添加快捷键
if(k == "13"&&(obj.id=="searchSupplier" || obj.id=="searchCategoryID"|| obj.id=="searchUsernameID"
|| obj.id=="searchStatus" || obj.id=="searchSupplierID" ))
{
$("#searchBtn").click();
}
});
//初始化系统基础信息
function initSystemData()
{
$.ajax({
type:"post",
url: "<%=path%>/asset/getBasicData.action",
//设置为同步
async:false,
dataType: "json",
success: function (systemInfo)
{
userList = systemInfo.showModel.map.userList;
categoryList = systemInfo.showModel.map.categoryList;
supplierList = systemInfo.showModel.map.supplierList;
nameList = systemInfo.showModel.map.assetnameList;
var msgTip = systemInfo.showModel.msgTip;
if(msgTip == "exceptoin")
{
$.messager.alert('提示','查找系统基础信息异常,请与管理员联系!','error');
return;
}
}
});
}
//初始化页面选项卡
function initSelectInfo()
{
var options = "";
if(nameList !=null)
{
for(var i = 0 ;i < nameList.length;i ++)
{
var nameInfo = nameList[i];
if(0== i)
{
nameID = nameInfo.id;
}
options += '<option value="' + nameInfo.id + '">' + nameInfo.assetname + '</option>';
}
$("#searchAssetNameID").empty().append('<option value="">请选择</option>').append(options);
}
if(userList !=null)
{
options = "";
for(var i = 0 ;i < userList.length;i ++)
{
var user = userList[i];
if(0 == i)
{
userID = user.id
}
options += '<option value="' + user.id + '">' + user.username + '</option>';
}
$("#searchUsernameID").empty().append('<option value="">请选择</option>').append(options);
}
if(categoryList !=null)
{
options = "";
for(var i = 0 ;i < categoryList.length;i ++)
{
var category = categoryList[i];
if(0 == i)
{
categoryID = category.id;
}
options += '<option value="' + category.id + '">' + category.assetname + '</option>';
}
$("#searchCategoryID").empty().append('<option value="">请选择</option>').append(options);
}
if(supplierList !=null)
{
options = "";
for(var i = 0 ;i < supplierList.length;i ++)
{
var supplier = supplierList[i];
if(0 == i)
{
supplierID = supplier.id;
}
options += '<option value="' + supplier.id + '">' + supplier.supplier + '</option>';
}
$("#searchSupplierID").empty().append('<option value="">请选择</option>').append(options);
}
}
//搜索处理
$("#searchBtn").unbind().bind({
click:function()
{
//是否限制条件 默认限制
initShowDataNum();
//系统基础数据
getDataInfo();
//综合图
showComboChart();
//饼状图
showPieChart();
//折线图
showSpline();
//显示柱状图
showHistogram();
//表格数据
initTableData();
}
});
//重置按钮
$("#searchResetBtn").unbind().bind({
click:function(){
$("#searchAssetNameID").val("");
$("#searchCategoryID").val("");
$("#searchUsernameID").val("");
$("#searchStatus").val("");
$("#searchSupplierID").val("");
//加载完以后重新初始化
$("#searchBtn").click();
}
});
//设置饼状图为渐变色
Highcharts.getOptions().colors = $.map(Highcharts.getOptions().colors, function(color) {
return {
radialGradient: { cx: 0.5, cy: 0.3, r: 0.7 },
stops: [
[0, color],
[1, Highcharts.Color(color).brighten(-0.3).get('rgb')] // darken
]
};
});
//饼状图
function showPieChart()
{
//解决初始化范围变小问题
$("#pieContainer").empty();
var getReportTypeInfo = getReportType();
var reportType = $("#searchReportType").val();
//封装数据到数组中
var allDataInfo = new Array();
var showNumInfo = 0;
if(pageData.length >= showNum)
showNumInfo = 10;
else
showNumInfo = pageData.length;
for(var i = 0;i < showNumInfo; i++)
{
var dataInfo = new Array();
var totalInfo = pageData[i]
if(reportType == 0)
{
if(0 == totalInfo[1])
dataInfo.push("在库");
else if(1 == totalInfo[1])
dataInfo.push("在用");
else if(2 == totalInfo[1])
dataInfo.push("消费");
}
else
dataInfo.push(totalInfo[1]);
dataInfo.push(totalInfo[0]);
allDataInfo.push(dataInfo);
}
new Highcharts.Chart({
chart: {
renderTo: 'pieContainer',
plotBackgroundColor: null,
plotBorderWidth: null,
backgroundColor:'#EAF2FD',
plotShadow: false
},
title: {
text: getReportTypeInfo + "饼状图"
},
tooltip: {
formatter: function() {
return this.point.name +':'+ this.y + "";
}
},
plotOptions: {
pie: {
allowPointSelect: true,
cursor: 'pointer',
dataLabels: {
enabled: true,
color: '#000000',
connectorColor: '#000000',
formatter: function() {
if(this.point.name.length >10)
return '<b>' + this.point.name.substr(0,10) + "</b>...:"+ this.y + "";
return '<b>' + this.point.name +'</b>:'+ this.y + "";
}
}
}
},
series: [{
type: 'pie',
name: '',
data: allDataInfo
}]
});
}
//综合图
function showComboChart()
{
//解决初始化范围变小问题
$("#zongheContainer").empty();
var getReportTypeInfo = getReportType();
var reportType = $("#searchReportType").val();
//按照统计数据封装显示数据
var xName = new Array();
var columnData = new Array();
var columnDataForm = null;
var averageDataForm = null;
var allDataSum = 0;
var showNumInfo = 0;
if(pageData.length >= showNum)
showNumInfo = 10;
else
showNumInfo = pageData.length;
for(var i = 0 ;i < showNumInfo;i ++)
{
var eachData = pageData[i];
var sum = eachData[0];
var totalInfo = eachData[1];
if(reportType == 0)
{
if(0 == totalInfo)
xName.push("在库");
else if(1 == totalInfo)
xName.push("在用");
else if(2 == totalInfo)
xName.push("消费");
}
else
xName.push(totalInfo);
columnData.push(sum);
allDataSum += sum;
}
columnDataForm =
{
type: 'column',
name: "资产总数",
data: columnData
};
averageDataForm = {
type: 'spline',
name: getReportTypeInfo + '资产概况曲线',
data: columnData,
marker: {
lineWidth: 2,
lineColor: Highcharts.getOptions().colors[3],
fillColor: 'white'
}
};
sumDataForm =
{
type: 'pie',
name: '总数',
data: [{
name: '资产总数',
y: allDataSum
}],
center: [450, 1],
size: 80,
showInLegend: false,
dataLabels: {
enabled: true,
align:'center'
}
}
new Highcharts.Chart({
chart: {
renderTo: 'zongheContainer',
backgroundColor:'#EAF2FD'
},
title: {
text: getReportTypeInfo + "综合图"
},
xAxis: {
categories: xName,
labels: {
rotation: -45, //逆时针旋转45°,标签名称太长。
align: 'right', //设置右对齐
formatter: function() {
if(this.value.length >10)
return this.value.substr(0,10) + "...";
return this.value ;
}
}
},
yAxis: {
title: {
text: ''
},
labels: {
formatter: function() {
return this.value;
}
}
},
plotOptions: {
column: {
cursor: 'pointer',
dataLabels: {
enabled: true,
style: {
fontWeight: 'bold'
},
formatter: function() {
return this.y;
}
},
//设置是否显示最下面选项
showInLegend: false
},
spline: {
marker: {
radius: 4,
lineColor: '#666666',
lineWidth: 1
},
showInLegend: false
},
line: {
dataLabels: {
enabled: false
},
enableMouseTracking: true,
showInLegend: false
},
pie: {
allowPointSelect: true,
cursor: 'pointer',
dataLabels: {
color: '#000000',
connectorColor: '#000000',
formatter: function() {
return '资产总数: '+ this.y;
}
},
showInLegend: false
}
},
tooltip: {
formatter: function() {
var s;
if(this.x == 0)
s = '在库:'+ this.y +'';
else if(this.x ==1)
s = '在用:'+ this.y +'';
else if(this.x ==2)
s = '消费:'+ this.y +'';
else
s = this.x +':'+ this.y +'';
return s;
}
},
labels: {
items: [{
html: '',
style: {
left: '40px',
top: '8px',
color: 'black'
}
}]
},
series: [columnDataForm,averageDataForm,sumDataForm]
});
}
//折线图
function showSpline()
{
//解决初始化范围变小问题
$("#zxianContainer").empty();
var getReportTypeInfo = getReportType();
var reportType = $("#searchReportType").val();
var dataInfo = new Array();
var nameData = new Array();
var consumeSumInfo= null;
var showNumInfo = 0;
if(pageData.length >= showNum)
showNumInfo = 10;
else
showNumInfo = pageData.length;
for(var i = 0 ;i < showNumInfo;i ++)
{
var totalInfo = pageData[i]
dataInfo.push(totalInfo[0]);
if(reportType == 0)
{
if(0 == totalInfo[1])
nameData.push("在库");
else if(1 == totalInfo[1])
nameData.push("在用");
else if(2 == totalInfo[1])
nameData.push("消费");
}
else
nameData.push(totalInfo[1]);
}
consumeSumInfo= {
name: getReportTypeInfo + '总额',
marker: {
symbol: 'square',
labels: {
formatter: function()
{
return this.value +'';
}
}
},
data: dataInfo
};
new Highcharts.Chart({
chart: {
renderTo: 'zxianContainer',
type: 'line',
backgroundColor:'#EAF2FD'
},
title: {
text: getReportTypeInfo + "曲线图"
},
subtitle: {
text: ''
},
xAxis: {
categories: nameData,
allowDecimals:false,
labels: {
rotation: -45, //逆时针旋转45°,标签名称太长。
align: 'right', //设置右对齐
formatter: function() {
if(this.value.length >10)
return this.value.substr(0,10) + "...";
return this.value ;
}
}
},
yAxis: {
title: {
text: ''
},
labels: {
formatter: function() {
return this.value;
}
}
},
tooltip: {
crosshairs: false,
shared: true,
formatter: function() { //格式化提示框的内容样式
return this.x +': '+ this.y +'';
}
},
plotOptions: {
spline: {
marker: {
radius: 4,
lineColor: '#666666',
lineWidth: 1
},
showInLegend: false
},
line: {
dataLabels: {
enabled: true
},
enableMouseTracking: true,
showInLegend: false
}
},
series: [consumeSumInfo]
});
}
//柱状图
function showHistogram()
{
//解决初始化范围变小问题
$("#culumnContainer").empty();
var getReportTypeInfo = getReportType();
var reportType = $("#searchReportType").val();
var dataInfo = new Array();
var nameData = new Array();
var consumeSumInfo= null;
var showNumInfo = 0;
if(pageData.length >= showNum)
showNumInfo = 10;
else
showNumInfo = pageData.length;
for(var i = 0 ;i < showNumInfo;i ++)
{
var totalInfo = pageData[i]
dataInfo.push(totalInfo[0]);
if(reportType == 0)
{
if(0 == totalInfo[1])
nameData.push("在库");
else if(1 == totalInfo[1])
nameData.push("在用");
else if(2 == totalInfo[1])
nameData.push("消费");
}
else
nameData.push(totalInfo[1]);
}
consumeSumInfo= {
name: getReportTypeInfo + "柱状图",
data: dataInfo
}
new Highcharts.Chart({
chart: {
renderTo: 'culumnContainer',
type: 'column',
backgroundColor:'#EAF2FD'
},
title: {
text: getReportTypeInfo + "柱状图"
},
xAxis: {
categories: nameData,
labels: {
rotation: -45, //逆时针旋转45°,标签名称太长。
align: 'right', //设置右对齐
formatter: function() {
if(this.value.length >10)
return this.value.substr(0,10) + "...";
return this.value ;
}
}
},
yAxis: {
title: {
text: ''
},
labels: {
formatter: function() {
return this.value;
}
}
},
plotOptions: {
column: {
cursor: 'pointer',
dataLabels: {
enabled: true,
style: {
fontWeight: 'bold'
},
formatter: function() {
return this.y;
}
},
showInLegend: false
}
},
tooltip: {
formatter: function() {
return this.x +':'+ this.y +'';
}
},
credits: {
enabled: false
},
series: [consumeSumInfo]
});
}
//填充表格数据
function initTableDetails()
{
var reportType = $("#searchReportType").val();
var dataJson = {};
dataJson.total = pageData.length;
var dataArray = [];
var totalSum = 0;
var typeSum = 0;
var footerArray = [];
var showNumInfo = 0;
if(pageData.length >= showNum)
showNumInfo = 10;
else
showNumInfo = pageData.length;
for(var i = 0 ;i < showNumInfo;i ++)
{
var totalInfo = pageData[i];
var name = "";
if(reportType == 0)
{
if(0 == totalInfo[1])
name = "在库";
else if(1 == totalInfo[1])
name = "在用";
else if(2 == totalInfo[1])
name = "消费";
}
else
name = totalInfo[1];
var dataInfo = {};
dataInfo.name = name;
dataInfo.sum = totalInfo[0];
totalSum += totalInfo[0];
dataArray.push(dataInfo);
typeSum ++;
}
var footerInfo = {
sum : totalSum,
name:getReportType()+ ' ' + typeSum + ' 种类型总数'
};
footerArray.push(footerInfo);
dataJson.rows = dataArray;
dataJson.footer = footerArray;
return dataJson;
}
//返回统计类型字符串
function getReportType()
{
var reportType = $("#searchReportType").val();
if(reportType==0)
{
return '按资产状态统计';
}
else if(reportType==1)
{
return '按资产类型统计';
}
else if(reportType==2)
{
return '按供应商统计';
}
else if(reportType==3)
{
return '按资产名称统计';
}
else if(reportType==4)
{
return '按所属用户统计';
}
}
</script>
</body>
</html>
\ No newline at end of file
<%@page import="com.jsh.util.Tools"%>
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
String clientIp = Tools.getCurrentUserIP();
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>ERP系统</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<!-- 指定以IE8的方式来渲染 -->
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE8"/>
<link rel="shortcut icon" href="<%=path%>/images/favicon.ico" type="image/x-icon" />
<link type="text/css" rel="stylesheet" href="<%=path %>/css/css.css" />
</head>
<frameset frameborder="no" border="0" framespacing="0" id="framesetList">
<frame src="<%=path %>/pages/common/main.jsp" name="mainFrame" id="mainFrame" title="mainFrame" />
</frameset>
<body>
</body>
</noframes>
</html>
\ No newline at end of file
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>资产管理</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<!-- 指定以IE8的方式来渲染 -->
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE8"/>
<link rel="shortcut icon" href="<%=path%>/images/favicon.ico" type="image/x-icon" />
<link type="text/css" rel="stylesheet" href="<%=path %>/css/css.css" />
</head>
<body>
<div id="foot">Copyright © 2015 季圣华 版权所有 版本号 V1.0</div>
</body>
</html>
\ No newline at end of file
<%@page import="com.jsh.util.Tools"%>
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
String clientIp = Tools.getCurrentUserIP();
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>资产管理</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<!-- 指定以IE8的方式来渲染 -->
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE8"/>
<link rel="shortcut icon" href="<%=path%>/images/favicon.ico" type="image/x-icon" />
<link type="text/css" rel="stylesheet" href="<%=path %>/css/css.css" />
<script type="text/javascript" src="<%=path %>/js/jquery-1.8.0.min.js"></script>
</head>
<body>
<div id="header">
<div id="logo"><img src="<%=path%>/images/windvane.png" height="50" alt="资产管理" title="资产管理"/></div>
<!-- <div id="logo"><img src="<%=path%>/images/suma_logo.png" height="45" alt="资产管理系统" title="资产管理系统"/></div> -->
<div id="nav_top">
<ul>
<li><a href="<%=path%>/pages/other/clock.jsp" style="background:url(<%=path %>/images/clock.png) 0 1px no-repeat;color:#333;text-decoration:none;" target="mainFrame"><span id="showNowTime"></span></a></li>
<li>|</li>
<li><a href="javascript:void(0)" style="background:url(<%=path %>/images/user_business_boss.png) 0 1px no-repeat;color:#333;text-decoration:none;">用户名:${sessionScope.user.loginame}</a></li>
<li>|</li>
<li id="1"><a href="<%=path %>/pages/common/home.jsp" id="navtop_home" target="mainFrame" style="color:#333;text-decoration:none;">首页</a></li>
<li id="2">|</li>
<li id="3"><a href="<%=path %>/pages/user/userinfo.jsp" id="person_file" target="mainFrame" style="background:url(<%=path %>/images/comment.png) 0 1px no-repeat;color:#333;text-decoration:none;">个人资料</a></li>
<li id="4">|</li>
<li id="5"><a href="<%=path %>/pages/user/password.jsp" target="mainFrame" id="navtop_editpwd" style="background:url(<%=path %>/images/lock_unlock.png) 0 1px no-repeat;color:#333;text-decoration:none;">修改密码</a></li>
<!--<li>|</li>
<li><a href="javascript:void(0)" id="navtop_help">帮助</a></li>
-->
<li id="6">|</li>
<li><a href="javascript:void(0)" id="navtop_logout">注销</a></li>
</ul>
</div>
</div>
<script type="text/javascript">
$(init);
//页面初始化
function init()
{
//初始化时间
showTime();
if('${sessionScope.user.loginame}'!= 'guest')
$("#1").add("#2").add("#3").add("#4").add("#5").add("#6").show();
else
$("#1").add("#2").add("#3").add("#4").add("#5").add("#6").hide();
}
function showDate()
{
var calendar = new Date();
var day = calendar.getDay();
var month = calendar.getMonth();
var date = calendar.getDate();
var year = calendar.getYear();
if (year< 1900)
{
year = 1900 + year;
}
var cent = parseInt(year/100);
var g = year % 19;
var k = parseInt((cent - 17)/25);
var i = (cent - parseInt(cent/4) - parseInt((cent - k)/3) + 19*g + 15) % 30;
i = i - parseInt(i/28)*(1 - parseInt(i/28)*parseInt(29/(i+1))*parseInt((21-g)/11));
var j = (year + parseInt(year/4) + i + 2 - cent + parseInt(cent/4)) % 7;
var l = i - j;
var emonth = 3 + parseInt((l + 40)/44);
var edate = l + 28 - 31*parseInt((emonth/4));
emonth--;
var dayname = new Array ("星期日", "星期一", "星期二", "星期三", "星期四", "星期五", "星期六");
var monthname =new Array ("1月","2月","3月","4月","5月","6月","7月","8月","9月","10月","11月","12月" );
var message = "";
if(getOs().indexOf("MSIE")!= -1)
{
//控制时间和图片之间的距离
$("#blankSpace").empty().append("&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;");
message = year + "" + monthname[month]+ date + "日&nbsp;&nbsp;" + dayname[day]+"&nbsp;&nbsp;";
}
else if(getOs().indexOf("Firefox") != -1)
{
$("#blankSpace").empty().append("&nbsp;&nbsp;&nbsp;");
message = year + "" + monthname[month]+ date + "日&nbsp;&nbsp;" + dayname[day]+"&nbsp;&nbsp;";
}
else
{
$("#blankSpace").empty().append("&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;");
message = year + "" + monthname[month]+ date + "日&nbsp;&nbsp; " + dayname[day] + "&nbsp;&nbsp;";
}
return message;
}
function showTime()
{
var Digital=new Date();
var hours=Digital.getHours();
var minutes=Digital.getMinutes();
var seconds=Digital.getSeconds();
if(hours==0)
{
hours="00";
}
if(hours <= 9 && hours > 0)
{
hours="0"+hours;
}
if(minutes<=9)
minutes="0"+minutes;
if(seconds<=9)
seconds="0"+seconds;
var myclock=hours+":"+minutes+":"+seconds;
//定时器
setTimeout("showTime()",1000);
var message = showDate()+" "+myclock;
$("#showNowTime").empty().append(message);
}
//判断浏览器的类型
function getOs()
{
var OsObject = "";
if(navigator.userAgent.indexOf("MSIE")>0)
{
return "MSIE";
}
else if(navigator.userAgent.indexOf("Firefox")>0)
{
return "Firefox";
}
else if(navigator.userAgent.indexOf("Safari")>0)
{
return "Safari";
}
else if(navigator.userAgent.indexOf("Camino")>0)
{
return "Camino";
}
else if(navigator.userAgent.indexOf("Gecko/")>0)
{
return "Gecko";
}
else if(navigator.userAgent.indexOf("Opera/")>0)
{
return "Opera";
}
else
{
return "unknown";
}
}
//退出系统
$("#navtop_logout").bind({
click:function()
{
if(confirm("确认要退出系统吗?"))
{
window.location.href ="<%=path%>/user/logout.action?clientIp=<%=clientIp%>" ;
}
}
});
</script>
</body>
</html>
\ No newline at end of file
<%@page import="com.jsh.util.Tools"%>
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
String clientIp = Tools.getCurrentUserIP();
String type = request.getParameter("type");
String location = "首页";
if(null != type)
location = "资产管理 &gt;资产概况";
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>erp</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<!-- 指定以IE8的方式来渲染 -->
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE8"/>
<link rel="shortcut icon" href="<%=path%>/images/favicon.ico" type="image/x-icon" />
<link rel="stylesheet" type="text/css" href="<%=path %>/js/easyui-1.3.5/themes/default/easyui.css"/>
<link rel="stylesheet" type="text/css" href="<%=path %>/js/easyui-1.3.5/themes/icon.css"/>
<script type="text/javascript" src="<%=path %>/js/jquery-1.8.0.min.js"></script>
<script type="text/javascript" src="<%=path %>/js/easyui-1.3.5/jquery.easyui.min.js"></script>
<script type="text/javascript" src="<%=path %>/js/easyui-1.3.5/locale/easyui-lang-zh_CN.js"></script>
<script type="text/javascript" src="<%=path%>/js/highcharts/highcharts.js"></script>
<script type="text/javascript" src="<%=path%>/js/highcharts/exporting.js"></script>
<style>
body{ margin:0; height:100%}
html{ height:100%} /*兼容firefox的div高度100%*/
#left{ width:150px; height:100%; float:left; _margin-right:-3px;}
#right{ height:100%;}
#leftdown{ width:150px; height:100%; float:left; _margin-right:-3px;}
#rightdown{ height:100%;}
<!--页面展示特殊要求-->
.datagrid-body,.datagrid-footer,.datagrid-pager ,.datagrid-view
{
background-color:#EAF2FD;
}
</style>
</head>
<body>
<div id="position" class="easyui-panel" title="当前位置: <%=location %>" collapsible="false" closable="false"/>
<!--按月统计资产柱状图 -->
<div id = "tablePanel0" class="easyui-panel" style="padding:1px;top:300px;" title="资产报表" iconCls="icon-chart-column" collapsible="true" maximizable="false" closable="false">
<div id="left" class="easyui-tabs" style="width:630px;height:auto;padding:1px;">
<div title="综合图" style="padding:10px;background-color: #EAF2FD;height:340px;top:300px;" data-options="iconCls:'icon-chart-zonghe'">
<div id="zongheContainer" style="height: 340px;">综合图</div>
</div>
</div>
<div id="right" class="easyui-tabs" style="height:auto;padding:1px;">
<div title="柱状图" style="padding:10px;background-color: #EAF2FD;height:340px;top:300px;" data-options="iconCls:'icon-chart-statistics'">
<div id="culumnContainer" style="height: 340px;">柱状图</div>
</div>
</div>
<div id="leftdown" class="easyui-tabs" style="width:630px;height:auto;padding:1px;">
<div title="折线图" data-options="iconCls:'icon-chart-polygram'" style="padding:10px;background-color: #EAF2FD;height:340px;top:300px;">
<div id="zxianContainer" style="height: 340px;">折现图</div>
</div>
</div>
<div id="rightdown" class="easyui-tabs" style="height:auto;padding:1px;">
<div title="饼状图" data-options="iconCls:'icon-chart-pie'" style="padding:10px;background-color: #EAF2FD;height:340px;top:300px;">
<div id="pieContainer" style="height: 340px;">饼状图</div>
</div>
</div>
</div>
<!-- 数据显示table -->
<div id = "tablePanel" class="easyui-panel" style="padding:1px;top:300px;" title="资产列表" iconCls="icon-list" collapsible="true" closable="false">
<table id="tableData" style="height:360px;top:300px;border-bottom-color:#FFFFFF"></table>
</div>
<script type="text/javascript">
//控制图表显示个数
var showNum = 10;
//初始化界面
$(function()
{
//progress();
$.messager.progress({
title:'请稍候',
msg:'数据加载ing...'
});
//综合图
showComboChart();
//显示柱状图
showHistogram();
//折线图
showSpline();
//饼状图
showPieChart();
initTableData();
ininPager();
$.messager.progress('close');
});
//加载进度条
function progress()
{
var win = $.messager.progress({
title:'请稍候',
msg:'数据加载ing...'
});
setTimeout(function(){
$.messager.progress('close');
},3300);
}
//初始化表格数据
function initTableData()
{
$('#tableData').datagrid({
//title:'资产列表',
//iconCls:'icon-save',
//width:700,
//height:480,
nowrap: false,
rownumbers: false,
//动画效果
animate:false,
//选中单行
singleSelect : true,
collapsible:false,
selectOnCheck:false,
//fitColumns:true,
//单击行是否选中
checkOnSelect : false,
//交替出现背景
striped : true,
url:'<%=path %>/asset/findBy.action',
pagination: true,
//loadFilter: pagerFilter,
pageSize: 10,
pageList: [10,20,30,50],
frozenColumns:[[
{ field: 'id',width:35,align:"center",checkbox:true},
{ title: '资产名称',field: 'assetname',width:100},
{ title: '单价', field: 'price',width:70,align:"center"},
{ title: '资产类型', field: 'category',width:115,align:"center"},
{ title: '用户',field: 'username',width:100,align:"center"},
{ title: '购买日期',field: 'purchasedate',width:90,align:"center"},
{ title: '状态',field: 'status',width:50,align:"center"},
{ title: '位置',field: 'location',width:100,align:"center"},
{ title: '资产编号',field: 'assetnum',width:120,align:"center"},
{ title: '序列号',field: 'serialnum',width:120,align:"center"}
]],
columns:[[
{ title: '有效日期',field: 'periodofvalidity',width:90,align:"center"},
{ title: '保修日期',field: 'warrantydate',width:90,align:"center"},
{ title: '供应商',field: 'supplier',width:100,align:"center"},
{ title: '标签',field: 'labels',width:180,align:"center"},
{ title: '描述',field: 'description',width:300}
]],
onLoadError:function()
{
$.messager.alert('页面加载提示','页面加载异常,请稍后再试!','error');
return;
}
});
}
//分页信息处理
function ininPager()
{
try
{
var opts = $("#tableData").datagrid('options');
var pager = $("#tableData").datagrid('getPager');
pager.pagination({
onSelectPage:function(pageNum, pageSize)
{
opts.pageNumber = pageNum;
opts.pageSize = pageSize;
pager.pagination('refresh',
{
pageNumber:pageNum,
pageSize:pageSize
});
showAssetDetails(pageNum,pageSize);
}
});
}
catch (e)
{
$.messager.alert('异常处理提示',"分页信息异常 : " + e.name + ": " + e.message,'error');
}
}
function showAssetDetails(pageNo,pageSize)
{
$.ajax({
type:"post",
url: "<%=path %>/asset/findBy.action",
dataType: "json",
data: ({
assetNameID:$.trim($("#searchAssetNameID").val()),
assetCategoryID:$.trim($("#searchCategoryID").val()),
usernameID:$.trim($("#searchUsernameID").val()),
status:$.trim($("#searchStatus").val()),
supplierID:$.trim($("#searchSupplierID").val()),
pageNo:pageNo,
pageSize:pageSize
}),
success: function (data)
{
$("#tableData").datagrid('loadData',data);
//$('#tableData').datagrid('reload');
},
//此处添加错误处理
error:function()
{
$.messager.alert('查询提示','查询数据后台异常,请稍后再试!','error');
return;
}
});
}
//设置饼状图为渐变色
Highcharts.getOptions().colors = $.map(Highcharts.getOptions().colors, function(color) {
return {
radialGradient: { cx: 0.5, cy: 0.3, r: 0.7 },
stops: [
[0, color],
[1, Highcharts.Color(color).brighten(-0.3).get('rgb')] // darken
]
};
});
//饼状图
function showPieChart()
{
var pageData = null;
$.ajax({
type:"post",
url: "<%=path%>/report/find.action",
dataType: "json",
//取消异步机制,保证页面数据返回再进行处理
async: false,
data: ({
reportType : 2,
}),
success: function (reportInfo)
{
pageData = reportInfo.showModel.reportData;
var msgTip = reportInfo.showModel.msgTip;
if(msgTip == "get report data exception")
{
alert("查找报表信息异常,请与管理员联系!");
return;
}
}
});
//解决初始化范围变小问题
$("#pieContainer").empty();
var getReportTypeInfo = "按供应商统计";
//封装数据到数组中
var allDataInfo = new Array();
for(var i = 0;i < pageData.length; i++)
{
var dataInfo = new Array();
var totalInfo = pageData[i]
dataInfo.push(totalInfo[1]);
dataInfo.push(totalInfo[0]);
allDataInfo.push(dataInfo);
}
new Highcharts.Chart({
chart: {
renderTo: 'pieContainer',
plotBackgroundColor: null,
plotBorderWidth: null,
backgroundColor:'#EAF2FD',
plotShadow: false
},
title: {
text: getReportTypeInfo + "饼状图"
},
tooltip: {
formatter: function() {
return this.point.name +':'+ this.y + "";
}
},
plotOptions: {
pie: {
allowPointSelect: true,
cursor: 'pointer',
dataLabels: {
enabled: true,
color: '#000000',
connectorColor: '#000000',
formatter: function() {
if(this.point.name.length >10)
return '<b>' + this.point.name.substr(0,10) + "</b>...:"+ this.y + "";
return '<b>' + this.point.name +'</b>:'+ this.y + "";
}
}
}
},
series: [{
type: 'pie',
name: '',
data: allDataInfo
}]
});
}
//综合图
function showComboChart()
{
var pageData = null;
$.ajax({
type:"post",
url: "<%=path%>/report/find.action",
dataType: "json",
//取消异步机制,保证页面数据返回再进行处理
async: false,
data: ({
reportType : 0
}),
success: function (reportInfo)
{
pageData = reportInfo.showModel.reportData;
var msgTip = reportInfo.showModel.msgTip;
if(msgTip == "get report data exception")
{
alert("查找报表信息异常,请与管理员联系!");
return;
}
}
});
//解决初始化范围变小问题
$("#zongheContainer").empty();
var getReportTypeInfo = "按资产状态统计";
//按照统计数据封装显示数据
var xName = new Array();
var columnData = new Array();
var columnDataForm = null;
var averageDataForm = null;
var allDataSum = 0;
var showNumInfo = 0;
if(pageData.length >= showNum)
showNumInfo = 10;
else
showNumInfo = pageData.length;
for(var i = 0 ;i < showNumInfo;i ++)
{
var eachData = pageData[i];
var sum = eachData[0];
var totalInfo = eachData[1];
if(0 == totalInfo)
xName.push("在库");
else if(1 == totalInfo)
xName.push("在用");
else if(2 == totalInfo)
xName.push("消费");
columnData.push(sum);
allDataSum += sum;
}
columnDataForm =
{
type: 'column',
name: "资产总数",
data: columnData
};
averageDataForm = {
type: 'spline',
name: getReportTypeInfo + '资产概况曲线',
data: columnData,
marker: {
lineWidth: 2,
lineColor: Highcharts.getOptions().colors[3],
fillColor: 'white'
}
};
sumDataForm =
{
type: 'pie',
name: '总数',
data: [{
name: '资产总数',
y: allDataSum
}],
center: [450, 1],
size: 80,
showInLegend: false,
dataLabels: {
enabled: true,
align:'center'
}
}
new Highcharts.Chart({
chart: {
renderTo: 'zongheContainer',
backgroundColor:'#EAF2FD'
},
title: {
text: getReportTypeInfo + "综合图"
},
xAxis: {
categories: xName
},
yAxis: {
title: {
text: ''
},
labels: {
formatter: function() {
return this.value;
}
}
},
plotOptions: {
column: {
cursor: 'pointer',
dataLabels: {
enabled: true,
style: {
fontWeight: 'bold'
},
formatter: function() {
return this.y;
}
},
//设置是否显示最下面选项
showInLegend: false
},
spline: {
marker: {
radius: 4,
lineColor: '#666666',
lineWidth: 1
},
showInLegend: false
},
line: {
dataLabels: {
enabled: false
},
enableMouseTracking: true,
showInLegend: false
},
pie: {
allowPointSelect: false,
dataLabels: {
color: '#000000',
connectorColor: '#000000',
formatter: function() {
return '资产总数: '+ this.y;
}
}
}
},
tooltip: {
formatter: function() {
return this.key +':'+ this.y +'';
}
},
labels: {
items: [{
html: '',
style: {
left: '40px',
top: '8px',
color: 'black'
}
}]
},
series: [columnDataForm,averageDataForm,sumDataForm]
});
}
//折线图
function showSpline()
{
var pageData = null;
$.ajax({
type:"post",
url: "<%=path%>/report/find.action",
dataType: "json",
//取消异步机制,保证页面数据返回再进行处理
async: false,
data: ({
reportType : 1
}),
success: function (reportInfo)
{
pageData = reportInfo.showModel.reportData;
var msgTip = reportInfo.showModel.msgTip;
if(msgTip == "get report data exception")
{
alert("查找报表信息异常,请与管理员联系!");
return;
}
}
});
//解决初始化范围变小问题
$("#zxianContainer").empty();
var getReportTypeInfo = "按资产类型统计";
var dataInfo = new Array();
var nameData = new Array();
var consumeSumInfo= null;
var showNumInfo = 0;
if(pageData.length >= showNum)
showNumInfo = 10;
else
showNumInfo = pageData.length;
for(var i = 0 ;i < showNumInfo;i ++)
{
var totalInfo = pageData[i]
dataInfo.push(totalInfo[0]);
nameData.push(totalInfo[1]);
}
consumeSumInfo= {
name: getReportTypeInfo + '总共',
marker: {
symbol: 'square',
labels: {
formatter: function()
{
return this.value +'';
}
}
},
data: dataInfo
};
new Highcharts.Chart({
chart: {
renderTo: 'zxianContainer',
type: 'line',
backgroundColor:'#EAF2FD'
},
title: {
text: getReportTypeInfo + "曲线图"
},
subtitle: {
text: ''
},
xAxis: {
categories: nameData,
labels: {
rotation: -45, //逆时针旋转45°,标签名称太长。
align: 'right', //设置右对齐
formatter: function() {
if(this.value.length >10)
return this.value.substr(0,10) + "...";
return this.value ;
}
}
},
yAxis: {
title: {
text: ''
},
labels: {
formatter: function() {
return this.value ;
}
}
},
tooltip: {
crosshairs: false,
shared: true,
formatter: function() {
return this.x + ":" +this.y +'';
}
},
plotOptions: {
spline: {
marker: {
radius: 4,
lineColor: '#666666',
lineWidth: 1
},
showInLegend: false
},
line: {
dataLabels: {
enabled: true
},
enableMouseTracking: true,
showInLegend: false
}
},
series: [consumeSumInfo]
});
}
//柱状图
function showHistogram()
{
var pageData = null;
$.ajax({
type:"post",
url: "<%=path%>/report/find.action",
dataType: "json",
//取消异步机制,保证页面数据返回再进行处理
async: false,
data: ({
reportType : 3,
}),
success: function (reportInfo)
{
pageData = reportInfo.showModel.reportData;
var msgTip = reportInfo.showModel.msgTip;
if(msgTip == "get report data exception")
{
alert("查找报表信息异常,请与管理员联系!");
return;
}
}
});
//解决初始化范围变小问题
$("#culumnContainer").empty();
var getReportTypeInfo = "按资产名称统计";
var dataInfo = new Array();
var nameData = new Array();
var consumeSumInfo= null;
var showNumInfo = 0;
if(pageData.length >= showNum)
showNumInfo = 10;
else
showNumInfo = pageData.length;
for(var i = 0 ;i < showNumInfo;i ++)
{
var totalInfo = pageData[i];
dataInfo.push(totalInfo[0]);
nameData.push(totalInfo[1]);
}
consumeSumInfo= {
name: getReportTypeInfo + "柱状图",
data: dataInfo
}
new Highcharts.Chart({
chart: {
renderTo: 'culumnContainer',
type: 'column',
backgroundColor:'#EAF2FD'
},
title: {
text: getReportTypeInfo + "柱状图"
},
xAxis: {
categories: nameData,
labels: {
rotation: -45, //逆时针旋转45°,标签名称太长。
align: 'right', //设置右对齐
formatter: function() {
if(this.value.length >10)
return this.value.substr(0,10) + "...";
return this.value ;
}
}
},
yAxis: {
title: {
text: ''
},
labels: {
formatter: function() {
return this.value;
}
}
},
plotOptions: {
column: {
cursor: 'pointer',
dataLabels: {
enabled: true,
style: {
fontWeight: 'bold'
},
formatter: function() {
return this.y;
}
},
showInLegend: false
}
},
tooltip: {
formatter: function() {
return this.x + ":" +this.y +'';
}
},
credits: {
enabled: false
},
series: [consumeSumInfo]
});
}
//返回统计类型字符串
function getReportType()
{
var reportType = $("#searchReportType").val();
if(reportType==0)
{
return '按资产状态统计';
}
else if(reportType==1)
{
return '按资产类型统计';
}
else if(reportType==2)
{
return '按供应商统计';
}
else if(reportType==3)
{
return '按资产名称统计';
}
else if(reportType==4)
{
return '按所属用户统计';
}
}
</script>
</body>
</html>
\ No newline at end of file
<%@page import="com.jsh.util.Tools"%>
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
String clientIp = Tools.getCurrentUserIP();
%>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>ERP系统</title>
<link href="<%=path%>/js/HoorayOS_mini/js/HoorayLibs/hooraylibs.css" rel="stylesheet" />
<link href="<%=path%>/js/HoorayOS_mini/img/ui/index.css" rel="stylesheet" />
</head>
<body>
<div class="loading"></div>
<!-- 浏览器升级提示 -->
<div class="update_browser_box">
<div class="update_browser">
<div class="subtitle">您正在使用的IE浏览器版本过低,<br>我们建议您升级或者更换浏览器,以便体验顺畅、兼容、安全的互联网。</div>
<div class="title">选择一款<span></span>浏览器吧</div>
<div class="browser">
<a href="http://windows.microsoft.com/zh-CN/internet-explorer/downloads/ie" class="ie" target="_blank" title="ie浏览器">ie浏览器</a>
<a href="http://www.google.cn/chrome/" class="chrome" target="_blank" title="谷歌浏览器">谷歌浏览器</a>
<a href="http://www.firefox.com.cn" class="firefox" target="_blank" title="火狐浏览器">火狐浏览器</a>
<a href="http://www.opera.com" class="opera" target="_blank" title="opera浏览器">opera浏览器</a>
<a href="http://www.apple.com.cn/safari" class="safari" target="_blank" title="safari浏览器">safari浏览器</a>
</div>
<div class="bottomtitle">[&nbsp;<a href="http://www.baidu.com/search/theie6countdown.html" target="_blank">对IE6说再见</a>&nbsp;]</div>
</div>
</div>
<!-- 桌面 -->
<div id="desktop">
<div id="zoom-tip"><div><i></i><span></span></div><a href="javascript:;" class="close" onclick="HROS.zoom.close();">×</a></div>
<div id="desk">
<div id="desk-1" class="desktop-container"><div class="scrollbar scrollbar-x"></div><div class="scrollbar scrollbar-y"></div></div>
<div id="dock-bar">
<div id="dock-container">
<div class="dock-middle">
<div class="dock-applist"></div>
<div class="dock-toollist">
<a id="loginOut" href="#">
<img src="<%=path%>/js/HoorayOS_mini/img/exit.png" style="height:50px;width:50px;">
</a>
<span style="text-align:center;color:white; position:absolute;top:435px; left:15px;">
${sessionScope.user.username}
</span>
</div>
</div>
</div>
</div>
</div>
<div id="task-bar-bg1"></div>
<div id="task-bar-bg2"></div>
<div id="task-bar">
<div id="task-next"><a href="javascript:;" id="task-next-btn" hidefocus="true"></a></div>
<div id="task-content">
<div id="task-content-inner"></div>
</div>
<div id="task-pre"><a href="javascript:;" id="task-pre-btn" hidefocus="true"></a></div>
</div>
</div>
<script src="<%=path%>/js/HoorayOS_mini/js/jquery-1.8.3.min.js"></script>
<script src="<%=path%>/js/HoorayOS_mini/js/HoorayLibs/hooraylibs.js"></script>
<script src="<%=path%>/js/HoorayOS_mini/js/templates.js"></script>
<script src="<%=path%>/js/HoorayOS_mini/js/core.js"></script>
<script src="<%=path%>/js/HoorayOS_mini/js/hros.app.js"></script>
<script src="<%=path%>/js/HoorayOS_mini/js/hros.base.js"></script>
<script src="<%=path%>/js/HoorayOS_mini/js/hros.desktop.js"></script>
<script src="<%=path%>/js/HoorayOS_mini/js/hros.dock.js"></script>
<script src="<%=path%>/js/HoorayOS_mini/js/hros.grid.js"></script>
<script src="<%=path%>/js/HoorayOS_mini/js/hros.maskBox.js"></script>
<script src="<%=path%>/js/HoorayOS_mini/js/hros.taskbar.js"></script>
<script src="<%=path%>/js/HoorayOS_mini/js/hros.popupMenu.js"></script>
<script src="<%=path%>/js/HoorayOS_mini/js/hros.wallpaper.js"></script>
<script src="<%=path%>/js/HoorayOS_mini/js/hros.widget.js"></script>
<script src="<%=path%>/js/HoorayOS_mini/js/hros.window.js"></script>
<script src="<%=path%>/js/HoorayOS_mini/js/hros.zoom.js"></script>
<script type="text/javascript" src="<%=path%>/js/easyui-1.3.5/jquery.easyui.min.js"></script>
<link href="<%=path%>/js/easyui-1.3.5/themes/default/easyui.css" rel="stylesheet" type="text/css" />
<script>
$(function () {
$('#loginOut').click(function () {
if (confirm("确认要退出系统吗?"))
location.href = '<%=path%>/user/logout.action?clientIp=<%=clientIp%>';
})
//IE下禁止选中
document.body.onselectstart = document.body.ondrag = function () { return false; }
//隐藏加载遮罩层
$('.loading').hide();
//IE6升级提示
if ($.browser.msie && $.browser.version < 7) {
if ($.browser.version < 7) {
//虽然不支持IE6,但还是得修复PNG图片透明的问题
DD_belatedPNG.fix('.update_browser .browser');
}
$('.update_browser_box').show();
} else {
$('#desktop').show();
//初始化一些桌面信息
HROS.CONFIG.wallpaper = '<%=path%>/js/HoorayOS_mini/img/wallpaper/wallpaper.jpg';
//加载桌面
HROS.base.init();
}
//判断是否存在session,如果不存在就跳到登录界面
function UserOut() {
var kid = ${sessionScope.user.id};
if (!kid){
top.location.href = '../../';
}
}
setInterval(UserOut, 5000); //每5秒检测一次
});
</script>
</body>
</html>
\ No newline at end of file
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE html>
<html>
<head>
<title></title>
<meta charset="utf-8">
<!-- 指定以IE8的方式来渲染 -->
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE8"/>
<link rel="shortcut icon" href="<%=path%>/images/favicon.ico" type="image/x-icon" />
<link rel="stylesheet" type="text/css" href="<%=path %>/js/easyui-1.3.5/themes/default/easyui.css"/>
<link rel="stylesheet" type="text/css" href="<%=path %>/js/easyui-1.3.5/themes/icon.css"/>
<link type="text/css" rel="stylesheet" href="<%=path %>/css/common.css" />
<script type="text/javascript" src="<%=path %>/js/jquery-1.8.0.min.js"></script>
<script type="text/javascript" src="<%=path %>/js/easyui-1.3.5/jquery.easyui.min.js"></script>
<script type="text/javascript" src="<%=path %>/js/easyui-1.3.5/locale/easyui-lang-zh_CN.js"></script>
<script type="text/javascript" src="<%=path %>/js/easyui-1.3.5/outlook.js"></script>
<script type="text/javascript" src="<%=path %>/js/common/common.js"></script>
<script type="text/javascript">
function NewTab(name, url) {
addTab(name, url, '');
}
</script>
</head>
<body class="easyui-layout" style="overflow-y: hidden" scroll="no">
<script>
var pageid = getUrlParam('id'); //获取传值id
var id=${sessionScope.user.id};
//alert(pageid);
var userBusinessList = null;
var userBusinessID = null;
var type=null;
var options = "";
var kid=null;
var lei=null;
var last="";
var functions="";
//初始化界面
$(function()
{
//初始化系统基础信息
initSystemData(id,'UserRole');
initSelectInfo(0);
initSelect();
//ceshi();
});
//初始化系统基础信息
function initSystemData(kid,type)
{
$.ajax({
type:"post",
url: "<%=path%>/userBusiness/getBasicData.action",
data: ({
KeyId:kid,
Type:type
}),
//设置为同步
async:false,
dataType: "json",
success: function (systemInfo)
{
if(systemInfo)
{
userBusinessList = systemInfo.showModel.map.userBusinessList;
var msgTip = systemInfo.showModel.msgTip;
if(msgTip == "exceptoin")
{
$.messager.alert('提示','查找UserBusiness异常,请与管理员联系!','error');
return;
}
}
else
{
userBusinessList=null;
}
}
});
}
//初始化页面选项卡
function initSelectInfo(lei)
{
if(userBusinessList !=null)
{
if(userBusinessList.length>0)
{
options =userBusinessList[0].value;
if(options!="")
{
options=options.substring(1,options.length-1);
}
if(lei==1)
{
last+=options+'][';
}
else if(lei==2)
{
functions+=options+'][';
}
}
}
}
//初始化页面
function initSelect()
{
var arr = options.split('][');
for(var i in arr){
initSystemData(arr[i],'RoleAPP'); //根据角色找app
initSelectInfo(1);
initSystemData(arr[i],'RoleFunctions'); //根据角色找functions
initSelectInfo(2);
}
if(last!="")
{
last="["+last.substring(0,last.length-1);
//alert(last);
if(last.indexOf("["+pageid+"]")!=-1)
{
//alert("存在");
$("#west").show();
$("#mainPanle").show();
$("#mm").show();
}
else
{
//alert("不存在");
$("div").remove();
$("<div style='width:100%;text-align:center;padding-top:20px'><b>抱歉,您没有该权限!</b></div>").appendTo("body");
}
}
if(functions!="")
{
functions="["+functions.substring(0,functions.length-1);
//alert(functions);
}
}
//测试自定义hql
function ceshi()
{
$.ajax({
type:"post",
url: "<%=path%>/userBusiness/getceshi.action",
data: ({
Type:"UserRole"
}),
//设置为同步
async:false,
dataType: "json",
success: function (systemInfo)
{
if(systemInfo)
{
userBusinessList = systemInfo.showModel.map.userBusinessList;
var msgTip = systemInfo.showModel.msgTip;
if(msgTip == "exceptoin")
{
$.messager.alert('提示','查找UserBusiness异常,请与管理员联系!','error');
return;
}
}
else
{
userBusinessList=null;
}
}
});
if(userBusinessList !=null)
{
if(userBusinessList.length>0)
{
alert(userBusinessList[0][0]);
alert(userBusinessList[0][1]);
}
}
}
</script>
<div region="west" hide="true" split="true" title="导航菜单" style="width:155px;" id="west">
<div id="nav" fit="true" border="false">
<!-- 导航内容 -->
<div>
<ul id="tt"></ul>
<script type="text/javascript">
var PNumber = getUrlParam('appID'); //获取传值appid
$(function () {
$('#tt').tree({
url:'<%=path%>/functions/findMenu.action?PNumber='+PNumber+'&hasFunctions='+functions,
animate:true,
});
});
</script>
</div>
</div>
</div>
<div id="mainPanle" region="center" style="background: #eee; overflow-y: hidden">
<div id="tabs" class="easyui-tabs" fit="true" border="false"></div>
</div>
<div id="mm" class="easyui-menu" style="width: 150px;">
<div id="mm-tabupdate">
刷新
</div>
<div class="menu-sep">
</div>
<div id="mm-tabclose">
关闭
</div>
<div id="mm-tabcloseall">
全部关闭
</div>
<div id="mm-tabcloseother">
除此之外全部关闭
</div>
<div class="menu-sep">
</div>
<div id="mm-tabcloseright">
当前页右侧全部关闭
</div>
<div id="mm-tabcloseleft">
当前页左侧全部关闭
</div>
<div class="menu-sep">
</div>
<div id="mm-exit">
退出
</div>
</div>
</body>
</html>
\ No newline at end of file
<%@page import="com.jsh.util.Tools"%>
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
String clientIp = Tools.getCurrentUserIP();
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>资产管理</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<!-- 指定以IE8的方式来渲染 -->
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE8"/>
<link rel="shortcut icon" href="<%=path%>/images/favicon.ico" type="image/x-icon" />
<link type="text/css" rel="stylesheet" href="<%=path %>/css/css.css" />
<script type="text/javascript" src="<%=path %>/js/jquery-1.8.0.min.js"></script>
</head>
<body>
<script type="text/javascript">
//初始化界面
$(function()
{
init();
});
function init()
{
}
</script>
</body>
</html>
\ No newline at end of file
<%@page import="com.jsh.util.Tools"%>
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%
String path = request.getContextPath();
String clientIp = Tools.getCurrentUserIP();
%>
<!DOCTYPE html>
<html>
<head>
<title>转账单</title>
<meta charset="utf-8">
<!-- 指定以IE8的方式来渲染 -->
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE8"/>
<link rel="shortcut icon" href="<%=path%>/images/favicon.ico" type="image/x-icon" />
<link rel="stylesheet" type="text/css" href="<%=path %>/js/easyui-1.3.5/themes/default/easyui.css"/>
<link rel="stylesheet" type="text/css" href="<%=path %>/js/easyui-1.3.5/themes/icon.css"/>
<link type="text/css" rel="stylesheet" href="<%=path %>/css/common.css" />
<script src="<%=path %>/js/jquery-1.8.0.min.js"></script>
<script src="<%=path %>/js/easyui-1.3.5/jquery.easyui.min.js"></script>
<script src="<%=path %>/js/easyui-1.3.5/locale/easyui-lang-zh_CN.js"></script>
<script src="<%=path %>/js/My97DatePicker/WdatePicker.js"></script>
<script src="<%=path %>/js/common/common.js"></script>
<script src="<%=path %>/js/pages/financial/financial_base.js"></script>
<script>
var kid = ${sessionScope.user.id};
var path = "<%=path%>";
var clientIp = "<%=clientIp%>";
</script>
</head>
<body>
<!-- 查询 -->
<div id = "searchPanel" class="easyui-panel" style="padding:3px;" title="查询窗口" iconCls="icon-search" collapsible="true" closable="false">
<table id="searchTable">
<tr>
<td>单据编号:</td>
<td>
<input type="text" name="searchBillNo" id="searchBillNo" style="width:60px;"/>
</td>
<td>单据日期:</td>
<td>
<input type="text" name="searchBeginTime" id="searchBeginTime" onClick="WdatePicker({dateFmt:'yyyy-MM-dd'})" class="txt Wdate" style="width:80px;"/>
</td>
<td>-</td>
<td>
<input type="text" name="searchEndTime" id="searchEndTime" onClick="WdatePicker({dateFmt:'yyyy-MM-dd'})" class="txt Wdate" style="width:80px;"/>
</td>
<td>&nbsp;</td>
<td>
<a href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-search" id="searchBtn">查询</a>&nbsp;
<a href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-redo" id="searchResetBtn">重置</a>
</td>
</tr>
</table>
</div>
<!-- 数据显示table -->
<div id = "tablePanel" class="easyui-panel" style="padding:1px;top:300px;" title="转账单列表" iconCls="icon-list" collapsible="true" closable="false">
<table id="tableData" style="top:300px;border-bottom-color:#FFFFFF"></table>
</div>
<div id="accountHeadDlg" class="easyui-dialog" style="width:850px;padding:10px 20px;top:20px"
closed="true" buttons="#dlg-buttons" modal="true" cache="false" collapsible="false" closable="true">
<form id="accountHeadFM" method="post" novalidate>
<table>
<tr>
<td>单据编号:</td>
<td style="padding:5px">
<input name="BillNo" id="BillNo" class="easyui-validatebox" data-options="required:true,validType:'length[2,30]'" style="width: 110px;"/>
</td>
<td>单据日期:</td>
<td style="padding:5px">
<input type="text" name="BillTime" id="BillTime" onClick="WdatePicker({dateFmt:'yyyy-MM-dd'})" class="txt Wdate" style="width:110px;"/>
</td>
<td>经手人:</td>
<td style="padding:5px">
<select name="HandsPersonId" id="HandsPersonId" style="width:110px;"></select>
</td>
<td style="width:50px;"></td>
<td style="padding:5px;width:110px;"></td>
</tr>
<tr>
<td>付款账户:</td>
<td style="padding:5px">
<select id="AccountId" name="AccountId" style="width:110px;"></select>
</td>
<td>实付金额:</td>
<td style="padding:5px">
<input type="text" name="ChangeAmount" id="ChangeAmount" class="easyui-numberbox" data-options="min:0,precision:2" style="width: 110px;"></input>
</td>
<td>单据备注:</td>
<td style="padding:5px">
<input name="Remark" id="Remark" class="easyui-validatebox" style="width: 110px;"/>
</td>
<td></td>
<td></td>
</tr>
<tr>
<td>单据明细:</td>
<td colspan="7">
<!-- 单据列表table -->
<table id="accountData" style="top:100px;border-bottom-color:#FFFFFF"></table>
</td>
</tr>
</table>
<input type="hidden" name="clientIp" id="clientIp" value="<%=clientIp %>"/>
</form>
</div>
<div id="dlg-buttons">
<a href="javascript:void(0)" id="saveAccountHead" class="easyui-linkbutton" iconCls="icon-ok">保存</a>
<a href="javascript:void(0)" id="cancelAccountHead" class="easyui-linkbutton" iconCls="icon-cancel" onclick="javascript:$('#accountHeadDlg').dialog('close')">取消</a>
</div>
<div id="accountHeadDlgShow" class="easyui-dialog" style="width:850px;padding:10px 20px;top:20px"
closed="true" modal="true" cache="false" collapsible="false" closable="true">
<table>
<tr>
<td>单据编号:</td>
<td style="padding:5px;width:110px;">
<span id="BillNoShow"></span>
</td>
<td>单据日期:</td>
<td style="padding:5px;width:110px;">
<span id="BillTimeShow"></span>
</td>
<td>经手人:</td>
<td style="padding:5px;width:110px;">
<span id="HandsPersonIdShow"></span>
</td>
<td style="width:50px;"></td>
<td style="padding:5px;width:110px;">
</tr>
<tr>
<td>付款账户:</td>
<td style="padding:5px">
<span id="AccountIdShow"></span>
</td>
<td>实付金额:</td>
<td style="padding:5px">
<span id="ChangeAmountShow"></span>
</td>
<td>单据备注:</td>
<td style="padding:5px">
<span id="RemarkShow"></span>
</td>
<td></td>
<td></td>
</tr>
<tr>
<td>单据明细:</td>
<td colspan="7">
<!-- 单据列表table -->
<table id="accountDataShow" style="top:100px;border-bottom-color:#FFFFFF"></table>
</td>
</tr>
</table>
</div>
</body>
</html>
<%@page import="com.jsh.util.Tools"%>
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%
String path = request.getContextPath();
String clientIp = Tools.getCurrentUserIP();
%>
<!DOCTYPE html>
<html>
<head>
<title>收入单</title>
<meta charset="utf-8">
<!-- 指定以IE8的方式来渲染 -->
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE8"/>
<link rel="shortcut icon" href="<%=path%>/images/favicon.ico" type="image/x-icon" />
<link rel="stylesheet" type="text/css" href="<%=path %>/js/easyui-1.3.5/themes/default/easyui.css"/>
<link rel="stylesheet" type="text/css" href="<%=path %>/js/easyui-1.3.5/themes/icon.css"/>
<link type="text/css" rel="stylesheet" href="<%=path %>/css/common.css" />
<script src="<%=path %>/js/jquery-1.8.0.min.js"></script>
<script src="<%=path %>/js/easyui-1.3.5/jquery.easyui.min.js"></script>
<script src="<%=path %>/js/easyui-1.3.5/locale/easyui-lang-zh_CN.js"></script>
<script src="<%=path %>/js/My97DatePicker/WdatePicker.js"></script>
<script src="<%=path %>/js/common/common.js"></script>
<script src="<%=path %>/js/pages/financial/financial_base.js"></script>
<script>
var kid = ${sessionScope.user.id};
var path = "<%=path%>";
var clientIp = "<%=clientIp%>";
</script>
</head>
<body>
<!-- 查询 -->
<div id = "searchPanel" class="easyui-panel" style="padding:3px;" title="查询窗口" iconCls="icon-search" collapsible="true" closable="false">
<table id="searchTable">
<tr>
<td>单据编号:</td>
<td>
<input type="text" name="searchBillNo" id="searchBillNo" style="width:60px;"/>
</td>
<td>单据日期:</td>
<td>
<input type="text" name="searchBeginTime" id="searchBeginTime" onClick="WdatePicker({dateFmt:'yyyy-MM-dd'})" class="txt Wdate" style="width:80px;"/>
</td>
<td>-</td>
<td>
<input type="text" name="searchEndTime" id="searchEndTime" onClick="WdatePicker({dateFmt:'yyyy-MM-dd'})" class="txt Wdate" style="width:80px;"/>
</td>
<td>&nbsp;</td>
<td>
<a href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-search" id="searchBtn">查询</a>&nbsp;
<a href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-redo" id="searchResetBtn">重置</a>
</td>
</tr>
</table>
</div>
<!-- 数据显示table -->
<div id = "tablePanel" class="easyui-panel" style="padding:1px;top:300px;" title="收入单列表" iconCls="icon-list" collapsible="true" closable="false">
<table id="tableData" style="top:300px;border-bottom-color:#FFFFFF"></table>
</div>
<div id="accountHeadDlg" class="easyui-dialog" style="width:850px;padding:10px 20px;top:20px"
closed="true" buttons="#dlg-buttons" modal="true" cache="false" collapsible="false" closable="true">
<form id="accountHeadFM" method="post" novalidate>
<table>
<tr>
<td>单据编号:</td>
<td style="padding:5px">
<input name="BillNo" id="BillNo" class="easyui-validatebox" data-options="required:true,validType:'length[2,30]'" style="width: 110px;"/>
</td>
<td>单据日期:</td>
<td style="padding:5px">
<input type="text" name="BillTime" id="BillTime" onClick="WdatePicker({dateFmt:'yyyy-MM-dd'})" class="txt Wdate" style="width:110px;"/>
</td>
<td>收款账户:</td>
<td style="padding:5px">
<select id="AccountId" name="AccountId" style="width:110px;"></select>
</td>
<td>收款金额:</td>
<td>
<input type="text" name="ChangeAmount" id="ChangeAmount" class="easyui-numberbox" data-options="min:0,precision:2" style="width: 60px;"></input>
</td>
</tr>
<tr>
<td>往来单位:</td>
<td style="padding:5px">
<select name="OrganId" id="OrganId" style="width:110px;"></select>
</td>
<td>经手人:</td>
<td style="padding:5px">
<select name="HandsPersonId" id="HandsPersonId" style="width:110px;"></select>
</td>
<td>单据备注:</td>
<td style="padding:5px">
<input name="Remark" id="Remark" class="easyui-validatebox" style="width: 110px;"/>
</td>
<td></td>
<td></td>
</tr>
<tr>
<td>单据明细:</td>
<td colspan="7">
<!-- 单据列表table -->
<table id="accountData" style="top:100px;border-bottom-color:#FFFFFF"></table>
</td>
</tr>
</table>
<input type="hidden" name="clientIp" id="clientIp" value="<%=clientIp %>"/>
</form>
</div>
<div id="dlg-buttons">
<a href="javascript:void(0)" id="saveAccountHead" class="easyui-linkbutton" iconCls="icon-ok">保存</a>
<a href="javascript:void(0)" id="cancelAccountHead" class="easyui-linkbutton" iconCls="icon-cancel" onclick="javascript:$('#accountHeadDlg').dialog('close')">取消</a>
</div>
<div id="accountHeadDlgShow" class="easyui-dialog" style="width:850px;padding:10px 20px;top:20px"
closed="true" modal="true" cache="false" collapsible="false" closable="true">
<table>
<tr>
<td>单据编号:</td>
<td style="padding:5px;width:110px;">
<span id="BillNoShow"></span>
</td>
<td>单据日期:</td>
<td style="padding:5px;width:110px;">
<span id="BillTimeShow"></span>
</td>
<td>收款账户:</td>
<td style="padding:5px;width:110px;">
<span id="AccountIdShow"></span>
</td>
<td>收款金额:</td>
<td style="padding:5px;width:110px;">
<span id="ChangeAmountShow"></span>
</td>
</tr>
<tr>
<td>往来单位:</td>
<td style="padding:5px">
<span id="OrganIdShow"></span>
</td>
<td>经手人:</td>
<td style="padding:5px">
<span id="HandsPersonIdShow"></span>
</td>
<td>单据备注:</td>
<td style="padding:5px">
<span id="RemarkShow"></span>
</td>
<td></td>
<td></td>
</tr>
<tr>
<td>单据明细:</td>
<td colspan="7">
<!-- 单据列表table -->
<table id="accountDataShow" style="top:100px;border-bottom-color:#FFFFFF"></table>
</td>
</tr>
</table>
</div>
</body>
</html>
<%@page import="com.jsh.util.Tools"%>
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%
String path = request.getContextPath();
String clientIp = Tools.getCurrentUserIP();
%>
<!DOCTYPE html>
<html>
<head>
<title>支出单</title>
<meta charset="utf-8">
<!-- 指定以IE8的方式来渲染 -->
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE8"/>
<link rel="shortcut icon" href="<%=path%>/images/favicon.ico" type="image/x-icon" />
<link rel="stylesheet" type="text/css" href="<%=path %>/js/easyui-1.3.5/themes/default/easyui.css"/>
<link rel="stylesheet" type="text/css" href="<%=path %>/js/easyui-1.3.5/themes/icon.css"/>
<link type="text/css" rel="stylesheet" href="<%=path %>/css/common.css" />
<script src="<%=path %>/js/jquery-1.8.0.min.js"></script>
<script src="<%=path %>/js/easyui-1.3.5/jquery.easyui.min.js"></script>
<script src="<%=path %>/js/easyui-1.3.5/locale/easyui-lang-zh_CN.js"></script>
<script src="<%=path %>/js/My97DatePicker/WdatePicker.js"></script>
<script src="<%=path %>/js/common/common.js"></script>
<script src="<%=path %>/js/pages/financial/financial_base.js"></script>
<script>
var kid = ${sessionScope.user.id};
var path = "<%=path%>";
var clientIp = "<%=clientIp%>";
</script>
</head>
<body>
<!-- 查询 -->
<div id = "searchPanel" class="easyui-panel" style="padding:3px;" title="查询窗口" iconCls="icon-search" collapsible="true" closable="false">
<table id="searchTable">
<tr>
<td>单据编号:</td>
<td>
<input type="text" name="searchBillNo" id="searchBillNo" style="width:60px;"/>
</td>
<td>单据日期:</td>
<td>
<input type="text" name="searchBeginTime" id="searchBeginTime" onClick="WdatePicker({dateFmt:'yyyy-MM-dd'})" class="txt Wdate" style="width:80px;"/>
</td>
<td>-</td>
<td>
<input type="text" name="searchEndTime" id="searchEndTime" onClick="WdatePicker({dateFmt:'yyyy-MM-dd'})" class="txt Wdate" style="width:80px;"/>
</td>
<td>&nbsp;</td>
<td>
<a href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-search" id="searchBtn">查询</a>&nbsp;
<a href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-redo" id="searchResetBtn">重置</a>
</td>
</tr>
</table>
</div>
<!-- 数据显示table -->
<div id = "tablePanel" class="easyui-panel" style="padding:1px;top:300px;" title="支出单列表" iconCls="icon-list" collapsible="true" closable="false">
<table id="tableData" style="top:300px;border-bottom-color:#FFFFFF"></table>
</div>
<div id="accountHeadDlg" class="easyui-dialog" style="width:850px;padding:10px 20px;top:20px"
closed="true" buttons="#dlg-buttons" modal="true" cache="false" collapsible="false" closable="true">
<form id="accountHeadFM" method="post" novalidate>
<table>
<tr>
<td>单据编号:</td>
<td style="padding:5px">
<input name="BillNo" id="BillNo" class="easyui-validatebox" data-options="required:true,validType:'length[2,30]'" style="width: 110px;"/>
</td>
<td>单据日期:</td>
<td style="padding:5px">
<input type="text" name="BillTime" id="BillTime" onClick="WdatePicker({dateFmt:'yyyy-MM-dd'})" class="txt Wdate" style="width:110px;"/>
</td>
<td>付款账户:</td>
<td style="padding:5px">
<select id="AccountId" name="AccountId" style="width:110px;"></select>
</td>
<td>付款金额:</td>
<td>
<input type="text" name="ChangeAmount" id="ChangeAmount" class="easyui-numberbox" data-options="min:0,precision:2" style="width: 60px;"></input>
</td>
</tr>
<tr>
<td>往来单位:</td>
<td style="padding:5px">
<select name="OrganId" id="OrganId" style="width:110px;"></select>
</td>
<td>经手人:</td>
<td style="padding:5px">
<select name="HandsPersonId" id="HandsPersonId" style="width:110px;"></select>
</td>
<td>单据备注:</td>
<td style="padding:5px">
<input name="Remark" id="Remark" class="easyui-validatebox" style="width: 110px;"/>
</td>
<td></td>
<td></td>
</tr>
<tr>
<td>单据明细:</td>
<td colspan="7">
<!-- 单据列表table -->
<table id="accountData" style="top:100px;border-bottom-color:#FFFFFF"></table>
</td>
</tr>
</table>
<input type="hidden" name="clientIp" id="clientIp" value="<%=clientIp %>"/>
</form>
</div>
<div id="dlg-buttons">
<a href="javascript:void(0)" id="saveAccountHead" class="easyui-linkbutton" iconCls="icon-ok">保存</a>
<a href="javascript:void(0)" id="cancelAccountHead" class="easyui-linkbutton" iconCls="icon-cancel" onclick="javascript:$('#accountHeadDlg').dialog('close')">取消</a>
</div>
<div id="accountHeadDlgShow" class="easyui-dialog" style="width:850px;padding:10px 20px;top:20px"
closed="true" modal="true" cache="false" collapsible="false" closable="true">
<table>
<tr>
<td>单据编号:</td>
<td style="padding:5px;width:110px;">
<span id="BillNoShow"></span>
</td>
<td>单据日期:</td>
<td style="padding:5px;width:110px;">
<span id="BillTimeShow"></span>
</td>
<td>付款账户:</td>
<td style="padding:5px;width:110px;">
<span id="AccountIdShow"></span>
</td>
<td>付款金额:</td>
<td style="padding:5px;width:110px;">
<span id="ChangeAmountShow"></span>
</td>
</tr>
<tr>
<td>往来单位:</td>
<td style="padding:5px">
<span id="OrganIdShow"></span>
</td>
<td>经手人:</td>
<td style="padding:5px">
<span id="HandsPersonIdShow"></span>
</td>
<td>单据备注:</td>
<td style="padding:5px">
<span id="RemarkShow"></span>
</td>
<td></td>
<td></td>
</tr>
<tr>
<td>单据明细:</td>
<td colspan="7">
<!-- 单据列表table -->
<table id="accountDataShow" style="top:100px;border-bottom-color:#FFFFFF"></table>
</td>
</tr>
</table>
</div>
</body>
</html>
<%@page import="com.jsh.util.Tools"%>
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%
String path = request.getContextPath();
String clientIp = Tools.getCurrentUserIP();
%>
<!DOCTYPE html>
<html>
<head>
<title>收款单</title>
<meta charset="utf-8">
<!-- 指定以IE8的方式来渲染 -->
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE8"/>
<link rel="shortcut icon" href="<%=path%>/images/favicon.ico" type="image/x-icon" />
<link rel="stylesheet" type="text/css" href="<%=path %>/js/easyui-1.3.5/themes/default/easyui.css"/>
<link rel="stylesheet" type="text/css" href="<%=path %>/js/easyui-1.3.5/themes/icon.css"/>
<link type="text/css" rel="stylesheet" href="<%=path %>/css/common.css" />
<script src="<%=path %>/js/jquery-1.8.0.min.js"></script>
<script src="<%=path %>/js/easyui-1.3.5/jquery.easyui.min.js"></script>
<script src="<%=path %>/js/easyui-1.3.5/locale/easyui-lang-zh_CN.js"></script>
<script src="<%=path %>/js/My97DatePicker/WdatePicker.js"></script>
<script src="<%=path %>/js/common/common.js"></script>
<script src="<%=path %>/js/pages/financial/financial_base.js"></script>
<script>
var kid = ${sessionScope.user.id};
var path = "<%=path%>";
var clientIp = "<%=clientIp%>";
</script>
</head>
<body>
<!-- 查询 -->
<div id = "searchPanel" class="easyui-panel" style="padding:3px;" title="查询窗口" iconCls="icon-search" collapsible="true" closable="false">
<table id="searchTable">
<tr>
<td>单据编号:</td>
<td>
<input type="text" name="searchBillNo" id="searchBillNo" style="width:60px;"/>
</td>
<td>单据日期:</td>
<td>
<input type="text" name="searchBeginTime" id="searchBeginTime" onClick="WdatePicker({dateFmt:'yyyy-MM-dd'})" class="txt Wdate" style="width:80px;"/>
</td>
<td>-</td>
<td>
<input type="text" name="searchEndTime" id="searchEndTime" onClick="WdatePicker({dateFmt:'yyyy-MM-dd'})" class="txt Wdate" style="width:80px;"/>
</td>
<td>&nbsp;</td>
<td>
<a href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-search" id="searchBtn">查询</a>&nbsp;
<a href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-redo" id="searchResetBtn">重置</a>
</td>
</tr>
</table>
</div>
<!-- 数据显示table -->
<div id = "tablePanel" class="easyui-panel" style="padding:1px;top:300px;" title="收款单列表" iconCls="icon-list" collapsible="true" closable="false">
<table id="tableData" style="top:300px;border-bottom-color:#FFFFFF"></table>
</div>
<div id="accountHeadDlg" class="easyui-dialog" style="width:850px;padding:10px 20px;top:20px"
closed="true" buttons="#dlg-buttons" modal="true" cache="false" collapsible="false" closable="true">
<form id="accountHeadFM" method="post" novalidate>
<table>
<tr>
<td>单据编号:</td>
<td style="padding:5px">
<input name="BillNo" id="BillNo" class="easyui-validatebox" data-options="required:true,validType:'length[2,30]'" style="width: 110px;"/>
</td>
<td>单据日期:</td>
<td style="padding:5px">
<input type="text" name="BillTime" id="BillTime" onClick="WdatePicker({dateFmt:'yyyy-MM-dd'})" class="txt Wdate" style="width:110px;"/>
</td>
<td>优惠金额:</td>
<td style="padding:5px">
<input type="text" name="ChangeAmount" id="ChangeAmount" class="easyui-numberbox" data-options="min:0,precision:2" style="width: 110px;"></input>
</td>
<td style="width:50px;"></td>
<td style="padding:5px;width:110px;"></td>
</tr>
<tr>
<td>付款单位:</td>
<td style="padding:5px">
<select name="OrganId" id="OrganId" style="width:110px;"></select>
</td>
<td>经手人:</td>
<td style="padding:5px">
<select name="HandsPersonId" id="HandsPersonId" style="width:110px;"></select>
</td>
<td>单据备注:</td>
<td style="padding:5px">
<input name="Remark" id="Remark" class="easyui-validatebox" style="width: 110px;"/>
</td>
<td></td>
<td></td>
</tr>
<tr>
<td>单据明细:</td>
<td colspan="7">
<!-- 单据列表table -->
<table id="accountData" style="top:100px;border-bottom-color:#FFFFFF"></table>
</td>
</tr>
</table>
<input type="hidden" name="clientIp" id="clientIp" value="<%=clientIp %>"/>
</form>
</div>
<div id="dlg-buttons">
<a href="javascript:void(0)" id="saveAccountHead" class="easyui-linkbutton" iconCls="icon-ok">保存</a>
<a href="javascript:void(0)" id="cancelAccountHead" class="easyui-linkbutton" iconCls="icon-cancel" onclick="javascript:$('#accountHeadDlg').dialog('close')">取消</a>
</div>
<div id="accountHeadDlgShow" class="easyui-dialog" style="width:850px;padding:10px 20px;top:20px"
closed="true" modal="true" cache="false" collapsible="false" closable="true">
<table>
<tr>
<td>单据编号:</td>
<td style="padding:5px;width:120px;">
<span id="BillNoShow"></span>
</td>
<td>单据日期:</td>
<td style="padding:5px;width:120px;">
<span id="BillTimeShow"></span>
</td>
<td>优惠金额:</td>
<td style="padding:5px;width:120px;">
<span id="ChangeAmountShow"></span>
</td>
<td style="width:50px;"></td>
<td style="padding:5px;width:120px;">
</tr>
<tr>
<td>付款单位:</td>
<td style="padding:5px">
<span id="OrganIdShow"></span>
</td>
<td>经手人:</td>
<td style="padding:5px">
<span id="HandsPersonIdShow"></span>
</td>
<td>单据备注:</td>
<td style="padding:5px">
<span id="RemarkShow"></span>
</td>
<td></td>
<td></td>
</tr>
<tr>
<td>单据明细:</td>
<td colspan="7">
<!-- 单据列表table -->
<table id="accountDataShow" style="top:100px;border-bottom-color:#FFFFFF"></table>
</td>
</tr>
</table>
</div>
</body>
</html>
<%@page import="com.jsh.util.Tools"%>
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%
String path = request.getContextPath();
String clientIp = Tools.getCurrentUserIP();
%>
<!DOCTYPE html>
<html>
<head>
<title>付款单</title>
<meta charset="utf-8">
<!-- 指定以IE8的方式来渲染 -->
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE8"/>
<link rel="shortcut icon" href="<%=path%>/images/favicon.ico" type="image/x-icon" />
<link rel="stylesheet" type="text/css" href="<%=path %>/js/easyui-1.3.5/themes/default/easyui.css"/>
<link rel="stylesheet" type="text/css" href="<%=path %>/js/easyui-1.3.5/themes/icon.css"/>
<link type="text/css" rel="stylesheet" href="<%=path %>/css/common.css" />
<script src="<%=path %>/js/jquery-1.8.0.min.js"></script>
<script src="<%=path %>/js/easyui-1.3.5/jquery.easyui.min.js"></script>
<script src="<%=path %>/js/easyui-1.3.5/locale/easyui-lang-zh_CN.js"></script>
<script src="<%=path %>/js/My97DatePicker/WdatePicker.js"></script>
<script src="<%=path %>/js/common/common.js"></script>
<script src="<%=path %>/js/pages/financial/financial_base.js"></script>
<script>
var kid = ${sessionScope.user.id};
var path = "<%=path%>";
var clientIp = "<%=clientIp%>";
</script>
</head>
<body>
<!-- 查询 -->
<div id = "searchPanel" class="easyui-panel" style="padding:3px;" title="查询窗口" iconCls="icon-search" collapsible="true" closable="false">
<table id="searchTable">
<tr>
<td>单据编号:</td>
<td>
<input type="text" name="searchBillNo" id="searchBillNo" style="width:60px;"/>
</td>
<td>单据日期:</td>
<td>
<input type="text" name="searchBeginTime" id="searchBeginTime" onClick="WdatePicker({dateFmt:'yyyy-MM-dd'})" class="txt Wdate" style="width:80px;"/>
</td>
<td>-</td>
<td>
<input type="text" name="searchEndTime" id="searchEndTime" onClick="WdatePicker({dateFmt:'yyyy-MM-dd'})" class="txt Wdate" style="width:80px;"/>
</td>
<td>&nbsp;</td>
<td>
<a href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-search" id="searchBtn">查询</a>&nbsp;
<a href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-redo" id="searchResetBtn">重置</a>
</td>
</tr>
</table>
</div>
<!-- 数据显示table -->
<div id = "tablePanel" class="easyui-panel" style="padding:1px;top:300px;" title="付款单列表" iconCls="icon-list" collapsible="true" closable="false">
<table id="tableData" style="top:300px;border-bottom-color:#FFFFFF"></table>
</div>
<div id="accountHeadDlg" class="easyui-dialog" style="width:850px;padding:10px 20px;top:20px"
closed="true" buttons="#dlg-buttons" modal="true" cache="false" collapsible="false" closable="true">
<form id="accountHeadFM" method="post" novalidate>
<table>
<tr>
<td>单据编号:</td>
<td style="padding:5px">
<input name="BillNo" id="BillNo" class="easyui-validatebox" data-options="required:true,validType:'length[2,30]'" style="width: 110px;"/>
</td>
<td>单据日期:</td>
<td style="padding:5px">
<input type="text" name="BillTime" id="BillTime" onClick="WdatePicker({dateFmt:'yyyy-MM-dd'})" class="txt Wdate" style="width:110px;"/>
</td>
<td>优惠金额:</td>
<td style="padding:5px">
<input type="text" name="ChangeAmount" id="ChangeAmount" class="easyui-numberbox" data-options="min:0,precision:2" style="width: 110px;"></input>
</td>
<td style="width:50px;"></td>
<td style="padding:5px;width:110px;"></td>
</tr>
<tr>
<td>收款单位:</td>
<td style="padding:5px">
<select name="OrganId" id="OrganId" style="width:110px;"></select>
</td>
<td>经手人:</td>
<td style="padding:5px">
<select name="HandsPersonId" id="HandsPersonId" style="width:110px;"></select>
</td>
<td>单据备注:</td>
<td style="padding:5px">
<input name="Remark" id="Remark" class="easyui-validatebox" style="width: 110px;"/>
</td>
<td></td>
<td></td>
</tr>
<tr>
<td>单据明细:</td>
<td colspan="7">
<!-- 单据列表table -->
<table id="accountData" style="top:100px;border-bottom-color:#FFFFFF"></table>
</td>
</tr>
</table>
<input type="hidden" name="clientIp" id="clientIp" value="<%=clientIp %>"/>
</form>
</div>
<div id="dlg-buttons">
<a href="javascript:void(0)" id="saveAccountHead" class="easyui-linkbutton" iconCls="icon-ok">保存</a>
<a href="javascript:void(0)" id="cancelAccountHead" class="easyui-linkbutton" iconCls="icon-cancel" onclick="javascript:$('#accountHeadDlg').dialog('close')">取消</a>
</div>
<div id="accountHeadDlgShow" class="easyui-dialog" style="width:850px;padding:10px 20px;top:20px"
closed="true" modal="true" cache="false" collapsible="false" closable="true">
<table>
<tr>
<td>单据编号:</td>
<td style="padding:5px;width:110px;">
<span id="BillNoShow"></span>
</td>
<td>单据日期:</td>
<td style="padding:5px;width:110px;">
<span id="BillTimeShow"></span>
</td>
<td>优惠金额:</td>
<td style="padding:5px;width:110px;">
<span id="ChangeAmountShow"></span>
</td>
<td style="width:50px;"></td>
<td style="padding:5px;width:110px;">
</tr>
<tr>
<td>收款单位:</td>
<td style="padding:5px">
<span id="OrganIdShow"></span>
</td>
<td>经手人:</td>
<td style="padding:5px">
<span id="HandsPersonIdShow"></span>
</td>
<td>单据备注:</td>
<td style="padding:5px">
<span id="RemarkShow"></span>
</td>
<td></td>
<td></td>
</tr>
<tr>
<td>单据明细:</td>
<td colspan="7">
<!-- 单据列表table -->
<table id="accountDataShow" style="top:100px;border-bottom-color:#FFFFFF"></table>
</td>
</tr>
</table>
</div>
</body>
</html>
<%@page import="com.jsh.util.Tools"%>
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
String clientIp = Tools.getCurrentUserIP();
%>
<!DOCTYPE html>
<html>
<head>
<title>结算账户</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<!-- 指定以IE8的方式来渲染 -->
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE8"/>
<link rel="shortcut icon" href="<%=path%>/images/favicon.ico" type="image/x-icon" />
<link rel="stylesheet" type="text/css" href="<%=path %>/js/easyui-1.3.5/themes/default/easyui.css"/>
<link rel="stylesheet" type="text/css" href="<%=path %>/js/easyui-1.3.5/themes/icon.css"/>
<link type="text/css" rel="stylesheet" href="<%=path %>/css/common.css" />
<script type="text/javascript" src="<%=path %>/js/jquery-1.8.0.min.js"></script>
<script type="text/javascript" src="<%=path %>/js/easyui-1.3.5/jquery.easyui.min.js"></script>
<script type="text/javascript" src="<%=path %>/js/easyui-1.3.5/locale/easyui-lang-zh_CN.js"></script>
<script type="text/javascript" src="<%=path %>/js/common/common.js"></script>
</head>
<body>
<!-- 查询 -->
<div id = "searchPanel" class="easyui-panel" style="padding:10px;" title="查询窗口" iconCls="icon-search" collapsible="true" closable="false">
<table id="searchTable">
<tr>
<td>&nbsp;&nbsp;&nbsp;&nbsp;称:</td>
<td>
<input type="text" name="searchName" id="searchName" style="width:70px;"/>
</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td id="searchSerialNoLabel">&nbsp;&nbsp;&nbsp;&nbsp;号:</td>
<td>
<input type="text" name="searchSerialNo" id="searchSerialNo" style="width:70px;"/>
</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td id="searchRemarkLabel">&nbsp;&nbsp;&nbsp;&nbsp;注:</td>
<td>
<input type="text" name="searchRemark" id="searchRemark" style="width:70px;"/>
</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>
<a href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-search" id="searchBtn">查询</a>&nbsp;&nbsp;
<a href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-redo" id="searchResetBtn">重置</a>
</td>
</tr>
</table>
</div>
<!-- 数据显示table -->
<div id = "tablePanel" class="easyui-panel" style="padding:1px;top:300px;" title="结算账户" iconCls="icon-list" collapsible="true" closable="false">
<table id="tableData" style="top:300px;border-bottom-color:#FFFFFF"></table>
</div>
<div id="accountDlg" class="easyui-dialog" style="width:380px;padding:10px 20px"
closed="true" buttons="#dlg-buttons" modal="true" collapsible="false" closable="true">
<form id="accountFM" method="post" novalidate>
<div class="fitem" style="padding:5px">
<label id="nameLabel">&nbsp;&nbsp;&nbsp;&nbsp;</label>
<input name="name" id="name" class="easyui-validatebox" data-options="required:true,validType:'length[2,30]'" style="width: 230px;height: 20px"/>
</div>
<div class="fitem" style="padding:5px">
<label id="serialNoLabel">&nbsp;&nbsp;&nbsp;&nbsp;</label>
<input name="serialNo" id="serialNo" class="easyui-validatebox" data-options="required:true,validType:'length[2,30]'" style="width: 230px;height: 20px"/>
</div>
<div class="fitem" style="padding:5px">
<label id="initialAmountLabel">期初金额</label>
<input name="initialAmount" id="initialAmount" type="text" class="easyui-numberbox" data-options="min:0,precision:2" style="width: 230px;height: 20px"></input>
</div>
<div class="fitem" style="padding:5px">
<label id="currentAmountLabel">当前余额</label>
<input name="currentAmount" id="currentAmount" type="text" disabled="disabled" class="easyui-numberbox" data-options="min:0,precision:2" style="width: 230px;height: 20px"></input>
</div>
<div class="fitem" style="padding:5px">
<label id="remarkLabel">&nbsp;&nbsp;&nbsp;&nbsp;</label>
<textarea name="remark" id="remark" rows="2" cols="2" style="width: 230px;"></textarea>
</div>
<input type="hidden" name="clientIp" id="clientIp" value="<%=clientIp %>"/>
</form>
</div>
<div id="dlg-buttons">
<a href="javascript:void(0)" id="saveAccount" class="easyui-linkbutton" iconCls="icon-ok">保存</a>
<a href="javascript:void(0)" id="cancelAccount" class="easyui-linkbutton" iconCls="icon-cancel" onclick="javascript:$('#accountDlg').dialog('close')">取消</a>
</div>
<script type="text/javascript">
//初始化界面
$(function()
{
initTableData();
ininPager();
browserFit();
});
//浏览器适配
function browserFit()
{
if(getOs()=='MSIE')
{
$("#searchSerialNoLabel").empty().append("编&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;号:");
$("#searchRemarkLabel").empty().append("备&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;注:");
$("#nameLabel").empty().append("名&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;称");
$("#serialNoLabel").empty().append("编&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;号");
$("#initialAmountLabel").empty().append("期初金额");
$("#currentAmountLabel").empty().append("当前余额");
$("#remarkLabel").empty().append("备&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;注");
}
else
{
$("#searchSerialNoLabel").empty().append("编&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;号:");
$("#searchRemarkLabel").empty().append("备&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;注:");
$("#nameLabel").empty().append("名&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;称");
$("#serialNoLabel").empty().append("编&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;号");
$("#initialAmountLabel").empty().append("期初金额");
$("#currentAmountLabel").empty().append("当前余额");
$("#remarkLabel").empty().append("备&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;注");
}
}
//初始化表格数据
function initTableData()
{
$('#tableData').datagrid({
//title:'结算账户',
//iconCls:'icon-save',
//width:700,
height:heightInfo,
nowrap: false,
rownumbers: false,
//动画效果
animate:false,
//选中单行
singleSelect : true,
collapsible:false,
selectOnCheck:false,
//fitColumns:true,
//单击行是否选中
checkOnSelect : false,
//交替出现背景
striped : true,
url:'<%=path %>/account/findBy.action?pageSize=' + initPageSize,
pagination: true,
//自动截取数据
//nowrap : true,
//loadFilter: pagerFilter,
pageSize: initPageSize,
pageList: initPageNum,
columns:[[
{ field: 'id',width:35,align:"center",checkbox:true},
{ title: '名称',field: 'name',width:100},
{ title: '编号', field: 'serialNo',width:100,align:"center"},
{ title: '期初金额', field: 'initialAmount',width:100,align:"center"},
{ title: '当前余额', field: 'currentAmount',width:100,align:"center"},
{ title: '备注',field: 'remark',width:100},
{ title: '操作',field: 'op',align:"center",width:130,formatter:function(value,rec)
{
var str = '';
var rowInfo = rec.id + 'AaBb' + rec.name +'AaBb' + rec.serialNo +'AaBb' + rec.initialAmount +'AaBb' + rec.currentAmount + 'AaBb'+ rec.remark;
if(1 == value)
{
str += '<img src="<%=path%>/js/easyui-1.3.5/themes/icons/pencil.png" style="cursor: pointer;" onclick="editAccount(\'' + rowInfo + '\');"/>&nbsp;<a onclick="editAccount(\'' + rowInfo + '\');" style="text-decoration:none;color:black;" href="javascript:void(0)">编辑</a>&nbsp;&nbsp;';
str += '<img src="<%=path%>/js/easyui-1.3.5/themes/icons/edit_remove.png" style="cursor: pointer;" onclick="deleteAccount(\'' + rowInfo + '\');"/>&nbsp;<a onclick="deleteAccount(\'' + rowInfo + '\');" style="text-decoration:none;color:black;" href="javascript:void(0)">删除</a>&nbsp;&nbsp;';
}
return str;
}
}
]],
toolbar:[
{
id:'addAccount',
text:'增加',
iconCls:'icon-add',
handler:function()
{
addAccount();
}
},
{
id:'deleteAccount',
text:'删除',
iconCls:'icon-remove',
handler:function()
{
batDeleteAccount();
}
}
],
onLoadError:function()
{
$.messager.alert('页面加载提示','页面加载异常,请稍后再试!','error');
return;
}
});
}
//初始化键盘enter事件
$(document).keydown(function(event)
{
//兼容 IE和firefox 事件
var e = window.event || event;
var k = e.keyCode||e.which||e.charCode;
//兼容 IE,firefox 兼容
var obj = e.srcElement ? e.srcElement : e.target;
//绑定键盘事件为 id是指定的输入框才可以触发键盘事件 13键盘事件
if(k == "13"&&(obj.id=="name" || obj.id=="serialNo" || obj.id=="initialAmount" || obj.id=="currentAmount" || obj.id=="remark"))
{
$("#saveAccount").click();
}
//搜索按钮添加快捷键
if(k == "13"&&(obj.id=="searchName" || obj.id=="searchSerialNo" || obj.id=="searchRemark"))
{
$("#searchBtn").click();
}
});
//分页信息处理
function ininPager()
{
try
{
var opts = $("#tableData").datagrid('options');
var pager = $("#tableData").datagrid('getPager');
pager.pagination({
onSelectPage:function(pageNum, pageSize)
{
opts.pageNumber = pageNum;
opts.pageSize = pageSize;
pager.pagination('refresh',
{
pageNumber:pageNum,
pageSize:pageSize
});
showAccountDetails(pageNum,pageSize);
}
});
}
catch (e)
{
$.messager.alert('异常处理提示',"分页信息异常 : " + e.name + ": " + e.message,'error');
}
}
//删除结算账户
function deleteAccount(accountInfo)
{
$.messager.confirm('删除确认','确定要删除此结算账户吗?',function(r)
{
if (r)
{
var accountTotalInfo = accountInfo.split("AaBb");
$.ajax({
type:"post",
url: "<%=path %>/account/delete.action",
dataType: "json",
data: ({
accountID : accountTotalInfo[0],
name:accountTotalInfo[1],
clientIp:'<%=clientIp %>'
}),
success: function (tipInfo)
{
var msg = tipInfo.showModel.msgTip;
if(msg == '成功')
//加载完以后重新初始化
$("#searchBtn").click();
else
$.messager.alert('删除提示','删除结算账户失败,请稍后再试!','error');
},
//此处添加错误处理
error:function()
{
$.messager.alert('删除提示','删除结算账户异常,请稍后再试!','error');
return;
}
});
}
});
}
//批量删除结算账户
function batDeleteAccount()
{
var row = $('#tableData').datagrid('getChecked');
if(row.length == 0)
{
$.messager.alert('删除提示','没有记录被选中!','info');
return;
}
if(row.length > 0)
{
$.messager.confirm('删除确认','确定要删除选中的' + row.length + '条结算账户吗?',function(r)
{
if (r)
{
var ids = "";
for(var i = 0;i < row.length; i ++)
{
if(i == row.length-1)
{
ids += row[i].id;
break;
}
ids += row[i].id + ",";
}
$.ajax({
type:"post",
url: "<%=path %>/account/batchDelete.action",
dataType: "json",
async : false,
data: ({
accountIDs : ids,
clientIp:'<%=clientIp %>'
}),
success: function (tipInfo)
{
var msg = tipInfo.showModel.msgTip;
if(msg == '成功')
{
//加载完以后重新初始化
$("#searchBtn").click();
$(":checkbox").attr("checked",false);
}
else
$.messager.alert('删除提示','删除结算账户失败,请稍后再试!','error');
},
//此处添加错误处理
error:function()
{
$.messager.alert('删除提示','删除结算账户异常,请稍后再试!','error');
return;
}
});
}
});
}
}
//增加结算账户
var url;
var accountID = 0;
//保存编辑前的名称
var orgaccount = "";
function addAccount()
{
$('#accountDlg').dialog('open').dialog('setTitle','<img src="<%=path%>/js/easyui-1.3.5/themes/icons/edit_add.png"/>&nbsp;增加结算账户');
$(".window-mask").css({ width: webW ,height: webH});
$('#accountFM').form('clear');
var row = {
clientIp:'<%=clientIp %>'
};
$('#accountFM').form('load',row);
$("#account").focus();
orgAccount = "";
accountID = 0;
url = '<%=path %>/account/create.action';
}
//保存结算账户
$("#saveAccount").unbind().bind({
click:function()
{
if(checkAccountName())
return;
$('#accountFM').form('submit',{
url: url,
onSubmit: function()
{
return $(this).form('validate');
},
success: function(result)
{
var result = eval('('+result+')');
if (!result)
{
$.messager.show({
title: '错误提示',
msg: '保存结算账户失败,请稍后重试!'
});
}
else
{
$('#accountDlg').dialog('close');
//$('#tableData').datagrid('reload');
//加载完以后重新初始化
//$("#searchBtn").click();
var opts = $("#tableData").datagrid('options');
showAccountDetails(opts.pageNumber,opts.pageSize);
}
}
});
}
});
//编辑结算账户
function editAccount(accountTotalInfo)
{
var accountInfo = accountTotalInfo.split("AaBb");
var row = {
name : accountInfo[1],
serialNo : accountInfo[2],
initialAmount : accountInfo[3],
currentAmount : accountInfo[4],
remark : accountInfo[5],
clientIp:'<%=clientIp %>'
};
orgAccount = accountInfo[1];
$('#accountDlg').dialog('open').dialog('setTitle','<img src="<%=path%>/js/easyui-1.3.5/themes/icons/pencil.png"/>&nbsp;编辑结算账户');
$(".window-mask").css({ width: webW ,height: webH});
$('#accountFM').form('load',row);
accountID = accountInfo[0];
//焦点在名称输入框==定焦在输入文字后面
$("#account").val("").focus().val(accountInfo[1]);
url = '<%=path %>/account/update.action?accountID=' + accountInfo[0];
}
//检查结算账户 名称是否存在 ++ 重名无法提示问题需要跟进
function checkAccountName()
{
var accountName = $.trim($("#name").val());
//表示是否存在 true == 存在 false = 不存在
var flag = false;
//开始ajax名称检验,不能重名
if(accountName.length > 0 &&( orgAccount.length ==0 || accountName != orgAccount))
{
$.ajax({
type:"post",
url: "<%=path %>/account/checkIsNameExist.action",
dataType: "json",
async : false,
data: ({
accountID : accountID,
name : accountName
}),
success: function (tipInfo)
{
flag = tipInfo;
if(tipInfo)
{
$.messager.alert('提示','结算账户名称已经存在','info');
return;
}
},
//此处添加错误处理
error:function()
{
$.messager.alert('提示','检查结算账户名称是否存在异常,请稍后再试!','error');
return;
}
});
}
return flag;
}
//搜索处理
$("#searchBtn").unbind().bind({
click:function()
{
showAccountDetails(1,initPageSize);
var opts = $("#tableData").datagrid('options');
var pager = $("#tableData").datagrid('getPager');
opts.pageNumber = 1;
opts.pageSize = initPageSize;
pager.pagination('refresh',
{
pageNumber:1,
pageSize:initPageSize
});
}
});
function showAccountDetails(pageNo,pageSize)
{
$.ajax({
type:"post",
url: "<%=path %>/account/findBy.action",
dataType: "json",
data: ({
name:$.trim($("#searchName").val()),
serialNo:$.trim($("#searchSerialNo").val()),
remark:$.trim($("#searchRemark").val()),
pageNo:pageNo,
pageSize:pageSize
}),
success: function (data)
{
$("#tableData").datagrid('loadData',data);
},
//此处添加错误处理
error:function()
{
$.messager.alert('查询提示','查询数据后台异常,请稍后再试!','error');
return;
}
});
}
//重置按钮
$("#searchResetBtn").unbind().bind({
click:function(){
$("#searchName").val("");
$("#searchSerialNo").val("");
$("#searchRemark").val("");
//加载完以后重新初始化
$("#searchBtn").click();
}
});
</script>
</body>
</html>
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment