format jsp

This commit is contained in:
AlanGao
2018-04-07 14:02:24 +08:00
parent 072599953e
commit 13c790147a
74 changed files with 22152 additions and 22659 deletions

View File

@@ -1,85 +1,82 @@
<%@page import="com.jsh.util.Tools"%> <%@page import="com.jsh.util.Tools" %>
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%> <%@ page language="java" pageEncoding="utf-8" %>
<% <%
String path = request.getContextPath(); String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/"; String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + path + "/";
String clientIp = Tools.getLocalIp(request); String clientIp = Tools.getLocalIp(request);
%> %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <!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"> <html xmlns="http://www.w3.org/1999/xhtml">
<head> <head>
<title>ERP系统</title> <title>ERP系统</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<!-- 指定以IE8的方式来渲染 --> <!-- 指定以IE8的方式来渲染 -->
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE8"/> <meta http-equiv="X-UA-Compatible" content="IE=EmulateIE8"/>
<link rel="shortcut icon" href="<%=path%>/images/favicon.ico" type="image/x-icon" /> <link rel="shortcut icon" href="<%=path%>/images/favicon.ico" type="image/x-icon"/>
<link type="text/css" rel="stylesheet" href="<%=path %>/css/css.css" /> <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/jquery-1.8.0.min.js"></script>
<script type="text/javascript" src="<%=path %>/js/common/common.js"></script> <script type="text/javascript" src="<%=path %>/js/common/common.js"></script>
</head> </head>
<body id="login_body"> <body id="login_body">
<form action="admin.html"> <form action="admin.html">
<div id="login_main"> <div id="login_main">
<div id="login"> <div id="login">
<p id="login_signal"><img src="<%=path%>/images/login_tip.jpg" width="108" height="29" alt="login" /></p> <p id="login_signal"><img src="<%=path%>/images/login_tip.jpg" width="108" height="29" alt="login"/></p>
<p id="txt_username"> <p id="txt_username">
<label for="user_name">用户名:</label> <label for="user_name">用户名:</label>
</p> </p>
<p id="txt_userpwd"> <p id="txt_userpwd">
<label for="user_vcode" id="user_vcodepwd">密&nbsp;&nbsp;&nbsp;&nbsp;码:</label> <label for="user_vcode" id="user_vcodepwd">密&nbsp;&nbsp;&nbsp;&nbsp;码:</label>
</p> </p>
<input type="text" id="user_name" /> <input type="text" id="user_name"/>
<input type="password" id="user_pwd" /> <input type="password" id="user_pwd"/>
<p id="tip_username" style="display: none"><span class="error_input">用户名不正确</span></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_userpwd" style="display: none">密码不能为空</p>
<input type="button" value=" " id="btn_login" /> <input type="button" value=" " id="btn_login"/>
</div> </div>
<p id="copyright">Copyright © 2017-2020 季圣华(jishenghua) <a style="color:#00458a;" href="https://gitee.com/jishenghua/JSH_ERP" target="_blank">华夏ERP_v1.0</a></p> <p id="copyright">Copyright © 2017-2020 季圣华(jishenghua) <a style="color:#00458a;"
href="https://gitee.com/jishenghua/JSH_ERP"
target="_blank">华夏ERP_v1.0</a></p>
</div> </div>
</form> </form>
<script type="text/javascript"> <script type="text/javascript">
//初始化界面 //初始化界面
$(function() $(function () {
{
//进入页面聚焦在username输入框,方便 用户输入 //进入页面聚焦在username输入框,方便 用户输入
$("#user_name").focus(); $("#user_name").focus();
browserFit(); browserFit();
}); });
//浏览器适配 //浏览器适配
function browserFit() function browserFit() {
{ if (getOs() == 'MSIE')
if(getOs()=='MSIE')
$("#user_vcodepwd").empty().append("密&nbsp;&nbsp;&nbsp;&nbsp;码:"); $("#user_vcodepwd").empty().append("密&nbsp;&nbsp;&nbsp;&nbsp;码:");
else else
$("#user_vcodepwd").empty().append("密&nbsp;&nbsp;&nbsp;&nbsp;码:"); $("#user_vcodepwd").empty().append("密&nbsp;&nbsp;&nbsp;&nbsp;码:");
} }
//初始化键盘enter事件 //初始化键盘enter事件
$(document).keydown(function(event) $(document).keydown(function (event) {
{
//兼容 IE和firefox 事件 //兼容 IE和firefox 事件
var e = window.event || event; var e = window.event || event;
var k = e.keyCode||e.which||e.charCode; var k = e.keyCode || e.which || e.charCode;
//兼容 IE,firefox 兼容 //兼容 IE,firefox 兼容
var obj = e.srcElement ? e.srcElement : e.target; var obj = e.srcElement ? e.srcElement : e.target;
//绑定键盘事件为 id是usename 和password的输入框才可以触发键盘事件 13键盘事件 //绑定键盘事件为 id是usename 和password的输入框才可以触发键盘事件 13键盘事件
if(k == "13"&&(obj.id=="user_name"||obj.id=="user_pwd")) if (k == "13" && (obj.id == "user_name" || obj.id == "user_pwd"))
checkUserInput(); checkUserInput();
}); });
//登录按钮绑定处理事件 //登录按钮绑定处理事件
$('#btn_login').bind({ $('#btn_login').bind({
click:checkUserInput click: checkUserInput
}); });
//检测用户输入数据 //检测用户输入数据
function checkUserInput () function checkUserInput() {
{
var username = $.trim($('#user_name').val()); var username = $.trim($('#user_name').val());
var password = $.trim($('#user_pwd').val()); var password = $.trim($('#user_pwd').val());
if(null == username ||0 == username.length) if (null == username || 0 == username.length) {
{
$("#user_name").val("").focus(); $("#user_name").val("").focus();
$("#tip_userpwd").hide(); $("#tip_userpwd").hide();
$("#tip_username").empty().append('<span class="error_input">用户名不能为空</span>').show(); $("#tip_username").empty().append('<span class="error_input">用户名不能为空</span>').show();
@@ -88,62 +85,55 @@
else else
$("#tip_username").hide(); $("#tip_username").hide();
if(null == password || 0 == password.length) if (null == password || 0 == password.length) {
{
$("#user_pwd").val("").focus(); $("#user_pwd").val("").focus();
$("#tip_userpwd").empty().append('<span class="error_input">密码不能为空</span>').show(); $("#tip_userpwd").empty().append('<span class="error_input">密码不能为空</span>').show();
return; return;
} }
else else
$("#tip_userpwd").hide(); $("#tip_userpwd").hide();
if(username != null&& username.length != 0 if (username != null && username.length != 0
&&password != null&&password.length != 0) && password != null && password.length != 0) {
{
$("#user_name").focus(); $("#user_name").focus();
$("#tip_username").hide(); $("#tip_username").hide();
$("#tip_userpwd").hide(); $("#tip_userpwd").hide();
$.ajax({ $.ajax({
type:"post", type: "post",
url: "<%=path%>/user/login.action", url: "<%=path%>/user/login.action",
dataType: "json", dataType: "json",
data: ({ data: ({
loginame : username, loginame: username,
password : password, password: password,
clientIp:"<%=clientIp%>" clientIp: "<%=clientIp%>"
}), }),
success: function (loginInfo){ success: function (loginInfo) {
var loginInfoTip = loginInfo.showModel.msgTip; var loginInfoTip = loginInfo.showModel.msgTip;
//用户名不存在,清空输入框并定位到用户名输入框 //用户名不存在,清空输入框并定位到用户名输入框
if(loginInfoTip.indexOf("user is not exist") != -1) if (loginInfoTip.indexOf("user is not exist") != -1) {
{
$("#user_pwd").val(""); $("#user_pwd").val("");
$("#user_name").val("").focus(); $("#user_name").val("").focus();
$("#tip_userpwd").hide(); $("#tip_userpwd").hide();
$("#tip_username").empty().append('<span class="error_input">用户名不存在</span>').show(); $("#tip_username").empty().append('<span class="error_input">用户名不存在</span>').show();
return; return;
} }
else if(loginInfoTip.indexOf("user password error") != -1) else if (loginInfoTip.indexOf("user password error") != -1) {
{
$("#user_pwd").val("").focus(); $("#user_pwd").val("").focus();
$("#tip_userpwd").empty().append('<span class="error_input">用户密码错误</span>').show(); $("#tip_userpwd").empty().append('<span class="error_input">用户密码错误</span>').show();
return; return;
} }
else if(loginInfoTip.indexOf("access service error") != -1) else if (loginInfoTip.indexOf("access service error") != -1) {
{
//$("#user_name").val("").focus(); //$("#user_name").val("").focus();
$("#tip_userpwd").hide(); $("#tip_userpwd").hide();
$("#tip_username").empty().append('<span class="error_input">后台访问错误</span>').show(); $("#tip_username").empty().append('<span class="error_input">后台访问错误</span>').show();
return; return;
} }
//跳转到用户管理界面 //跳转到用户管理界面
else if(loginInfoTip.indexOf("user can login") != -1||loginInfoTip == "user already login") else if (loginInfoTip.indexOf("user can login") != -1 || loginInfoTip == "user already login") {
{ window.location.href = "<%=path%>/login.action";
window.location.href="<%=path%>/login.action";
} }
}, },
//此处添加错误处理 //此处添加错误处理
error:function() error: function () {
{
alert("后台访问错误,请联系管理员!"); alert("后台访问错误,请联系管理员!");
} }
}); });
@@ -154,47 +144,41 @@
//定义变量控制密码提示显示 //定义变量控制密码提示显示
var temp_value = ""; var temp_value = "";
$("#user_name").add("#user_pwd").unbind().bind({ $("#user_name").add("#user_pwd").unbind().bind({
'click keyup':function() 'click keyup': function () {
{
var value = $.trim($(this).val()); var value = $.trim($(this).val());
if(value.length >0) if (value.length > 0) {
{
$("#tip_username").hide(); $("#tip_username").hide();
$("#tip_userpwd").hide(); $("#tip_userpwd").hide();
} }
}, },
blur:function() blur: function () {
{
//兼容 IE和firefox 事件 //兼容 IE和firefox 事件
var e = window.event || event; var e = window.event || event;
//兼容 IE,firefox 兼容 //兼容 IE,firefox 兼容
var obj = e.srcElement ? e.srcElement : e.target; var obj = e.srcElement ? e.srcElement : e.target;
var value = $.trim($(this).val()); var value = $.trim($(this).val());
if(obj.id=="user_name") if (obj.id == "user_name")
temp_value = value; temp_value = value;
if(value.length ==0) if (value.length == 0) {
{ if (obj.id == "user_name")
if(obj.id=="user_name")
$("#tip_username").empty().append('<span class="error_input">用户名不能为空</span>').show(); $("#tip_username").empty().append('<span class="error_input">用户名不能为空</span>').show();
if(obj.id=="user_pwd" &&temp_value.length>0) if (obj.id == "user_pwd" && temp_value.length > 0)
$("#tip_userpwd").empty().append('<span class="error_input">密码不能为空</span>').show();; $("#tip_userpwd").empty().append('<span class="error_input">密码不能为空</span>').show();
;
} }
else else {
{ if (obj.id == "user_pwd" && value.length > 0 && temp_value.length == 0) {
if(obj.id=="user_pwd"&&value.length>0&&temp_value.length ==0)
{
$("#tip_username").show(); $("#tip_username").show();
$("#tip_userpwd").hide(); $("#tip_userpwd").hide();
} }
else else {
{
$("#tip_username").hide(); $("#tip_username").hide();
$("#tip_userpwd").hide(); $("#tip_userpwd").hide();
} }
} }
} }
}); });
</script> </script>
</body> </body>
</html> </html>

View File

@@ -1,12 +1,12 @@
<%@ page language="java" pageEncoding="utf-8"%> <%@ page language="java" pageEncoding="utf-8" %>
<% <%
String path = request.getContextPath(); String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/"; String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + path + "/";
%> %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html> <html>
<head> <head>
<base href="<%=basePath%>"> <base href="<%=basePath%>">
<title>+</title> <title>+</title>
<meta http-equiv="pragma" content="no-cache"> <meta http-equiv="pragma" content="no-cache">
@@ -17,10 +17,10 @@ String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.
<!-- <!--
<link rel="stylesheet" type="text/css" href="styles.css"> <link rel="stylesheet" type="text/css" href="styles.css">
--> -->
</head> </head>
<body> <body>
<script type="text/javascript"> <script type="text/javascript">
top.location.href="<%=basePath%>"; top.location.href = "<%=basePath%>";
</script> </script>
<br></body> <br></body>
</html> </html>

File diff suppressed because it is too large Load Diff

View File

@@ -1,15 +1,15 @@
<%@page language="java" contentType="text/html; charset=utf-8" pageEncoding="utf-8"%> <%@page language="java" contentType="text/html; charset=utf-8" pageEncoding="utf-8" %>
<% <%
String path = request.getContextPath(); String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/"; String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + path + "/";
%> %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html> <html>
<head> <head>
<meta http-equiv=Content-Type content="text/html; charset=utf-8"> <meta http-equiv=Content-Type content="text/html; charset=utf-8">
<!-- 指定以IE8的方式来渲染 --> <!-- 指定以IE8的方式来渲染 -->
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE8"/> <meta http-equiv="X-UA-Compatible" content="IE=EmulateIE8"/>
<link rel="shortcut icon" href="<%=path%>/images/favicon.ico" type="image/x-icon" /> <link rel="shortcut icon" href="<%=path%>/images/favicon.ico" type="image/x-icon"/>
<link href="css/admin.css" type="text/css" rel="stylesheet"> <link href="css/admin.css" type="text/css" rel="stylesheet">
<title>首页说明</title> <title>首页说明</title>
<style type="text/css"> <style type="text/css">
@@ -21,7 +21,11 @@ String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.
margin-bottom: 0px; margin-bottom: 0px;
background-color: #EAF2FD; background-color: #EAF2FD;
} }
.STYLE1 {font-size: 12px}
.STYLE1 {
font-size: 12px
}
.STYLE4 { .STYLE4 {
font-size: 12px; font-size: 12px;
color: #1F4A65; color: #1F4A65;
@@ -34,31 +38,38 @@ String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.
text-decoration: none; text-decoration: none;
} }
a:visited { a:visited {
font-size: 12px; font-size: 12px;
color: #06482a; color: #06482a;
text-decoration: none; text-decoration: none;
} }
a:hover { a:hover {
font-size: 12px; font-size: 12px;
color: #FF0000; color: #FF0000;
text-decoration: underline; text-decoration: underline;
} }
a:active { a:active {
font-size: 12px; font-size: 12px;
color: #FF0000; color: #FF0000;
text-decoration: none; text-decoration: none;
} }
.STYLE7 {font-size: 12}
.STYLE7 {
font-size: 12
}
--> -->
</style> </style>
</head> </head>
<body> <body>
<table cellSpacing=0 cellPadding=0 width="100%" align=center border=0> <table cellSpacing=0 cellPadding=0 width="100%" align=center border=0>
<tr height=28> <tr height=28>
<td width="1101" class="STYLE4"> <td width="1101" class="STYLE4">
&nbsp;&nbsp;<img src="<%=path%>/images/computer.png" width="16" height="16" /> &nbsp;&nbsp;<img src="<%=path%>/images/computer.png" width="16" height="16"/>
<span >资产管理</span> <span>资产管理</span>
</td> </td>
</tr> </tr>
<tr> <tr>
@@ -67,10 +78,10 @@ String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.
<tr height="5px"> <tr height="5px">
<td background=images/shadow_bg.jpg></td> <td background=images/shadow_bg.jpg></td>
</tr> </tr>
</table> </table>
<p style="font-size: 12px;color: #1F4A65;padding: 10px"> <p style="font-size: 12px;color: #1F4A65;padding: 10px">
&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;
资产管理是记录资产明细,包括资产名称、资产类型、供应商、使用用户等信息,通过资产管理,可以记录平时资产明细,管理资产信息。资产管理包括增加,修改,删除、搜索消费信息等功能点。报表图表最多显示十条报表记录。 资产管理是记录资产明细,包括资产名称、资产类型、供应商、使用用户等信息,通过资产管理,可以记录平时资产明细,管理资产信息。资产管理包括增加,修改,删除、搜索消费信息等功能点。报表图表最多显示十条报表记录。
</p> </p>
</body> </body>
</html> </html>

View File

@@ -1,18 +1,18 @@
<%@page import="com.jsh.util.Tools"%> <%@page import="com.jsh.util.Tools" %>
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%> <%@ page language="java" pageEncoding="utf-8" %>
<% <%
String path = request.getContextPath(); String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/"; String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + path + "/";
String clientIp = Tools.getLocalIp(request); String clientIp = Tools.getLocalIp(request);
%> %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <!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"> <html xmlns="http://www.w3.org/1999/xhtml">
<head> <head>
<title>资产管理</title> <title>资产管理</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<!-- 指定以IE8的方式来渲染 --> <!-- 指定以IE8的方式来渲染 -->
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE8"/> <meta http-equiv="X-UA-Compatible" content="IE=EmulateIE8"/>
<link rel="shortcut icon" href="<%=path%>/images/favicon.ico" type="image/x-icon" /> <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/default/easyui.css"/>
<link rel="stylesheet" type="text/css" href="<%=path %>/js/easyui-1.3.5/themes/icon.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/jquery-1.8.0.min.js"></script>
@@ -23,21 +23,39 @@
<script type="text/javascript" src="<%=path%>/js/StringBuffer.js"></script> <script type="text/javascript" src="<%=path%>/js/StringBuffer.js"></script>
<script type="text/javascript" src="<%=path %>/js/common/common.js"></script> <script type="text/javascript" src="<%=path %>/js/common/common.js"></script>
<style> <style>
body{ margin:0; height:100%} body {
html{ height:100%} /*兼容firefox的div高度100%*/ margin: 0;
#left{ width:150px; height:100%; float:left; _margin-right:-3px;} height: 100%
#right{ height:100%;} }
<!--页面展示特殊要求-->
.datagrid-body,.datagrid-footer,.datagrid-pager ,.datagrid-view html {
{ height: 100%
background-color:#EAF2FD; }
/*兼容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> </style>
</head> </head>
<body> <body>
<div id="position" class="easyui-panel" title="当前位置:资产管理 &gt; 资产报表" collapsible="false" closable="false"/> <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"> <div id="searchPanel" class="easyui-panel" style="padding:10px;" title="查询窗口" iconCls="icon-search" collapsible="true"
closable="false">
<table id="searchTable"> <table id="searchTable">
<tr> <tr>
<td>资产名称:</td> <td>资产名称:</td>
@@ -103,25 +121,30 @@
</td> </td>
</tr> </tr>
</table> </table>
</div> </div>
<!-- 数据显示table --> <!-- 数据显示table -->
<%-- <div id = "tablePanel" class="easyui-panel" style="padding:1px;top:300px;" title="资产列表" iconCls="icon-chart-column" collapsible="true" closable="false">--%> <%-- <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>--%> <%-- <table id="tableData" style="height:360px;top:300px;border-bottom-color:#FFFFFF"></table>--%>
<%-- </div>--%> <%-- </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="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 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 title="综合图" style="padding:10px;background-color: #EAF2FD;height:340px;top:300px;"
data-options="iconCls:'icon-chart-zonghe'">
<div id="zongheContainer">综合图</div> <div id="zongheContainer">综合图</div>
</div> </div>
<div title="柱状图" style="padding:10px;background-color: #EAF2FD;height:340px;top:300px;" data-options="iconCls:'icon-chart-statistics'"> <div title="柱状图" style="padding:10px;background-color: #EAF2FD;height:340px;top:300px;"
<div id="culumnContainer" >柱状图</div> data-options="iconCls:'icon-chart-statistics'">
<div id="culumnContainer">柱状图</div>
</div> </div>
<div title="饼状图" data-options="iconCls:'icon-chart-pie'" style="padding:10px;background-color: #EAF2FD;height:340px;top:300px;"> <div title="饼状图" data-options="iconCls:'icon-chart-pie'"
style="padding:10px;background-color: #EAF2FD;height:340px;top:300px;">
<div id="pieContainer">饼状图</div> <div id="pieContainer">饼状图</div>
</div> </div>
<div title="折线图" data-options="iconCls:'icon-chart-polygram'" style="padding:10px;background-color: #EAF2FD;height:340px;top:300px;"> <div title="折线图" data-options="iconCls:'icon-chart-polygram'"
style="padding:10px;background-color: #EAF2FD;height:340px;top:300px;">
<div id="zxianContainer">折现图</div> <div id="zxianContainer">折现图</div>
</div> </div>
</div> </div>
@@ -130,9 +153,9 @@
<table id="tableData" style="top:300px;border-bottom-color:#FFFFFF;background-color: #EAF2FD;"></table> <table id="tableData" style="top:300px;border-bottom-color:#FFFFFF;background-color: #EAF2FD;"></table>
</div> </div>
</div> </div>
</div> </div>
<script type="text/javascript"> <script type="text/javascript">
var userList = null; var userList = null;
var categoryList = null; var categoryList = null;
@@ -150,8 +173,7 @@
//报表显示个数 //报表显示个数
var showNum = 10; var showNum = 10;
//初始化界面 //初始化界面
$(function() $(function () {
{
//progress(); //progress();
//页面自定义高度 //页面自定义高度
heightInfo = heightInfo - 50; heightInfo = heightInfo - 50;
@@ -181,25 +203,22 @@
}); });
//浏览器适配 //浏览器适配
function browserFit() function browserFit() {
{ if (getOs() == 'MSIE') {
if(getOs()=='MSIE')
{
$("#searchStatusLabel").empty().append("状&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;态:"); $("#searchStatusLabel").empty().append("状&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;态:");
$("#searchSupplierIDLabel").empty().append("供&nbsp;&nbsp;&nbsp;&nbsp;应&nbsp;&nbsp;&nbsp;&nbsp;商:"); $("#searchSupplierIDLabel").empty().append("供&nbsp;&nbsp;&nbsp;&nbsp;应&nbsp;&nbsp;&nbsp;&nbsp;商:");
} }
else else {
{
$("#searchStatusLabel").empty().append("状&nbsp;&nbsp;&nbsp;&nbsp;态:"); $("#searchStatusLabel").empty().append("状&nbsp;&nbsp;&nbsp;&nbsp;态:");
$("#searchSupplierIDLabel").empty().append("供&nbsp;&nbsp;应&nbsp;&nbsp;商:"); $("#searchSupplierIDLabel").empty().append("供&nbsp;&nbsp;应&nbsp;&nbsp;商:");
} }
} }
$("#left").tabs({width:630}); $("#left").tabs({width: 630});
var chartHight; var chartHight;
function initChartsHight()
{ function initChartsHight() {
$("#zxianContainer").add("#pieContainer").add("#culumnContainer") $("#zxianContainer").add("#pieContainer").add("#culumnContainer")
.add("#zongheContainer").css({height: heightInfo}); .add("#zongheContainer").css({height: heightInfo});
@@ -208,10 +227,9 @@
} }
//是否限制条件 //是否限制条件
function initShowDataNum() function initShowDataNum() {
{
var type = $("#searchTopten").val(); var type = $("#searchTopten").val();
if(0 == type) if (0 == type)
showNum = 10; showNum = 10;
else else
//表示不限制 //表示不限制
@@ -219,39 +237,36 @@
} }
//加载进度条 //加载进度条
function progress() function progress() {
{
$.messager.progress({ $.messager.progress({
title:'请稍候', title: '请稍候',
msg:'数据加载ing...' msg: '数据加载ing...'
}); });
setTimeout(function(){ setTimeout(function () {
$.messager.progress('close'); $.messager.progress('close');
},3300) }, 3300)
} }
//获取查询数据 //获取查询数据
function getDataInfo() function getDataInfo() {
{
$.ajax({ $.ajax({
type:"post", type: "post",
url: "<%=path%>/report/find.action", url: "<%=path%>/report/find.action",
dataType: "json", dataType: "json",
//取消异步机制,保证页面数据返回再进行处理 //取消异步机制,保证页面数据返回再进行处理
async: false, async: false,
data: ({ data: ({
assetNameID:$.trim($("#searchAssetNameID").val()), assetNameID: $.trim($("#searchAssetNameID").val()),
assetCategoryID:$.trim($("#searchCategoryID").val()), assetCategoryID: $.trim($("#searchCategoryID").val()),
usernameID:$.trim($("#searchUsernameID").val()), usernameID: $.trim($("#searchUsernameID").val()),
status:$.trim($("#searchStatus").val()), status: $.trim($("#searchStatus").val()),
supplierID:$.trim($("#searchSupplierID").val()), supplierID: $.trim($("#searchSupplierID").val()),
reportType : $.trim($("#searchReportType").val()), reportType: $.trim($("#searchReportType").val()),
}), }),
success: function (reportInfo) success: function (reportInfo) {
{
pageData = reportInfo.showModel.reportData; pageData = reportInfo.showModel.reportData;
var msgTip = reportInfo.showModel.msgTip; var msgTip = reportInfo.showModel.msgTip;
if(msgTip == "get report data exception") if (msgTip == "get report data exception") {
{
alert("查找报表信息异常,请与管理员联系!"); alert("查找报表信息异常,请与管理员联系!");
return; return;
} }
@@ -260,86 +275,79 @@
} }
//初始化表格数据 //初始化表格数据
function initTableData() function initTableData() {
{
$('#tableData').datagrid({ $('#tableData').datagrid({
//title:'资产列表', //title:'资产列表',
//iconCls:'icon-save', //iconCls:'icon-save',
//width:700, //width:700,
height : chartHight, height: chartHight,
nowrap: false, nowrap: false,
rownumbers: false, rownumbers: false,
//动画效果 //动画效果
animate:false, animate: false,
//选中单行 //选中单行
singleSelect : true, singleSelect: true,
collapsible:false, collapsible: false,
selectOnCheck:false, selectOnCheck: false,
//列宽自适应 //列宽自适应
//fitColumns:true, //fitColumns:true,
//单击行是否选中 //单击行是否选中
checkOnSelect : false, checkOnSelect: false,
url: null, url: null,
//pagination: true, //pagination: true,
//loadFilter: pagerFilter, //loadFilter: pagerFilter,
//交替出现背景 //交替出现背景
striped : true, striped: true,
//pageSize: 10, //pageSize: 10,
//pageList: [10,20,30,50], //pageList: [10,20,30,50],
rowStyler:function(index,row){ rowStyler: function (index, row) {
return 'background-color:#EAF2FD;'; return 'background-color:#EAF2FD;';
}, },
showFooter: true, showFooter: true,
columns:[[ columns: [[
{ title: getReportType() + '类型',id:"dataTypeColumn",width:300,field: 'name',align:"center"}, {title: getReportType() + '类型', id: "dataTypeColumn", width: 300, field: 'name', align: "center"},
{ title: '总数',field: 'sum',width:130,align:"center"} {title: '总数', field: 'sum', width: 130, align: "center"}
]], ]],
onLoadError:function() onLoadError: function () {
{ $.messager.alert('页面加载提示', '页面加载异常,请稍后再试!', 'error');
$.messager.alert('页面加载提示','页面加载异常,请稍后再试!','error');
return; return;
} }
}); });
$('#tableData').datagrid('loadData',initTableDetails()); $('#tableData').datagrid('loadData', initTableDetails());
} }
//初始化键盘enter事件 //初始化键盘enter事件
$(document).keydown(function(event) $(document).keydown(function (event) {
{
//兼容 IE和firefox 事件 //兼容 IE和firefox 事件
var e = window.event || event; var e = window.event || event;
var k = e.keyCode||e.which||e.charCode; var k = e.keyCode || e.which || e.charCode;
//兼容 IE,firefox 兼容 //兼容 IE,firefox 兼容
var obj = e.srcElement ? e.srcElement : e.target; var obj = e.srcElement ? e.srcElement : e.target;
//搜索按钮添加快捷键 //搜索按钮添加快捷键
if(k == "13"&&(obj.id=="searchSupplier" || obj.id=="searchCategoryID"|| obj.id=="searchUsernameID" if (k == "13" && (obj.id == "searchSupplier" || obj.id == "searchCategoryID" || obj.id == "searchUsernameID"
|| obj.id=="searchStatus" || obj.id=="searchSupplierID" )) || obj.id == "searchStatus" || obj.id == "searchSupplierID")) {
{
$("#searchBtn").click(); $("#searchBtn").click();
} }
}); });
//初始化系统基础信息 //初始化系统基础信息
function initSystemData() function initSystemData() {
{
$.ajax({ $.ajax({
type:"post", type: "post",
url: "<%=path%>/asset/getBasicData.action", url: "<%=path%>/asset/getBasicData.action",
//设置为同步 //设置为同步
async:false, async: false,
dataType: "json", dataType: "json",
success: function (systemInfo) success: function (systemInfo) {
{
userList = systemInfo.showModel.map.userList; userList = systemInfo.showModel.map.userList;
categoryList = systemInfo.showModel.map.categoryList; categoryList = systemInfo.showModel.map.categoryList;
supplierList = systemInfo.showModel.map.supplierList; supplierList = systemInfo.showModel.map.supplierList;
nameList = systemInfo.showModel.map.assetnameList; nameList = systemInfo.showModel.map.assetnameList;
var msgTip = systemInfo.showModel.msgTip; var msgTip = systemInfo.showModel.msgTip;
if(msgTip == "exceptoin") if (msgTip == "exceptoin") {
{ $.messager.alert('提示', '查找系统基础信息异常,请与管理员联系!', 'error');
$.messager.alert('提示','查找系统基础信息异常,请与管理员联系!','error');
return; return;
} }
} }
@@ -347,16 +355,12 @@
} }
//初始化页面选项卡 //初始化页面选项卡
function initSelectInfo() function initSelectInfo() {
{
var options = ""; var options = "";
if(nameList !=null) if (nameList != null) {
{ for (var i = 0; i < nameList.length; i++) {
for(var i = 0 ;i < nameList.length;i ++)
{
var nameInfo = nameList[i]; var nameInfo = nameList[i];
if(0== i) if (0 == i) {
{
nameID = nameInfo.id; nameID = nameInfo.id;
} }
options += '<option value="' + nameInfo.id + '">' + nameInfo.assetname + '</option>'; options += '<option value="' + nameInfo.id + '">' + nameInfo.assetname + '</option>';
@@ -364,14 +368,11 @@
$("#searchAssetNameID").empty().append('<option value="">请选择</option>').append(options); $("#searchAssetNameID").empty().append('<option value="">请选择</option>').append(options);
} }
if(userList !=null) if (userList != null) {
{
options = ""; options = "";
for(var i = 0 ;i < userList.length;i ++) for (var i = 0; i < userList.length; i++) {
{
var user = userList[i]; var user = userList[i];
if(0 == i) if (0 == i) {
{
userID = user.id userID = user.id
} }
options += '<option value="' + user.id + '">' + user.username + '</option>'; options += '<option value="' + user.id + '">' + user.username + '</option>';
@@ -380,14 +381,11 @@
} }
if(categoryList !=null) if (categoryList != null) {
{
options = ""; options = "";
for(var i = 0 ;i < categoryList.length;i ++) for (var i = 0; i < categoryList.length; i++) {
{
var category = categoryList[i]; var category = categoryList[i];
if(0 == i) if (0 == i) {
{
categoryID = category.id; categoryID = category.id;
} }
options += '<option value="' + category.id + '">' + category.assetname + '</option>'; options += '<option value="' + category.id + '">' + category.assetname + '</option>';
@@ -395,14 +393,11 @@
$("#searchCategoryID").empty().append('<option value="">请选择</option>').append(options); $("#searchCategoryID").empty().append('<option value="">请选择</option>').append(options);
} }
if(supplierList !=null) if (supplierList != null) {
{
options = ""; options = "";
for(var i = 0 ;i < supplierList.length;i ++) for (var i = 0; i < supplierList.length; i++) {
{
var supplier = supplierList[i]; var supplier = supplierList[i];
if(0 == i) if (0 == i) {
{
supplierID = supplier.id; supplierID = supplier.id;
} }
options += '<option value="' + supplier.id + '">' + supplier.supplier + '</option>'; options += '<option value="' + supplier.id + '">' + supplier.supplier + '</option>';
@@ -414,8 +409,7 @@
//搜索处理 //搜索处理
$("#searchBtn").unbind().bind({ $("#searchBtn").unbind().bind({
click:function() click: function () {
{
//是否限制条件 默认限制 //是否限制条件 默认限制
initShowDataNum(); initShowDataNum();
//系统基础数据 //系统基础数据
@@ -436,7 +430,7 @@
//重置按钮 //重置按钮
$("#searchResetBtn").unbind().bind({ $("#searchResetBtn").unbind().bind({
click:function(){ click: function () {
$("#searchAssetNameID").val(""); $("#searchAssetNameID").val("");
$("#searchCategoryID").val(""); $("#searchCategoryID").val("");
$("#searchUsernameID").val(""); $("#searchUsernameID").val("");
@@ -449,9 +443,9 @@
}); });
//设置饼状图为渐变色 //设置饼状图为渐变色
Highcharts.getOptions().colors = $.map(Highcharts.getOptions().colors, function(color) { Highcharts.getOptions().colors = $.map(Highcharts.getOptions().colors, function (color) {
return { return {
radialGradient: { cx: 0.5, cy: 0.3, r: 0.7 }, radialGradient: {cx: 0.5, cy: 0.3, r: 0.7},
stops: [ stops: [
[0, color], [0, color],
[1, Highcharts.Color(color).brighten(-0.3).get('rgb')] // darken [1, Highcharts.Color(color).brighten(-0.3).get('rgb')] // darken
@@ -461,8 +455,7 @@
//饼状图 //饼状图
function showPieChart() function showPieChart() {
{
//解决初始化范围变小问题 //解决初始化范围变小问题
$("#pieContainer").empty(); $("#pieContainer").empty();
var getReportTypeInfo = getReportType(); var getReportTypeInfo = getReportType();
@@ -471,22 +464,20 @@
var allDataInfo = new Array(); var allDataInfo = new Array();
var showNumInfo = 0; var showNumInfo = 0;
if(pageData.length >= showNum) if (pageData.length >= showNum)
showNumInfo = 10; showNumInfo = 10;
else else
showNumInfo = pageData.length; showNumInfo = pageData.length;
for(var i = 0;i < showNumInfo; i++) for (var i = 0; i < showNumInfo; i++) {
{
var dataInfo = new Array(); var dataInfo = new Array();
var totalInfo = pageData[i] var totalInfo = pageData[i]
if(reportType == 0) if (reportType == 0) {
{ if (0 == totalInfo[1])
if(0 == totalInfo[1])
dataInfo.push("在库"); dataInfo.push("在库");
else if(1 == totalInfo[1]) else if (1 == totalInfo[1])
dataInfo.push("在用"); dataInfo.push("在用");
else if(2 == totalInfo[1]) else if (2 == totalInfo[1])
dataInfo.push("消费"); dataInfo.push("消费");
} }
else else
@@ -501,15 +492,15 @@
renderTo: 'pieContainer', renderTo: 'pieContainer',
plotBackgroundColor: null, plotBackgroundColor: null,
plotBorderWidth: null, plotBorderWidth: null,
backgroundColor:'#EAF2FD', backgroundColor: '#EAF2FD',
plotShadow: false plotShadow: false
}, },
title: { title: {
text: getReportTypeInfo + "饼状图" text: getReportTypeInfo + "饼状图"
}, },
tooltip: { tooltip: {
formatter: function() { formatter: function () {
return this.point.name +':'+ this.y + "个"; return this.point.name + ':' + this.y + "个";
} }
}, },
plotOptions: { plotOptions: {
@@ -520,10 +511,10 @@
enabled: true, enabled: true,
color: '#000000', color: '#000000',
connectorColor: '#000000', connectorColor: '#000000',
formatter: function() { formatter: function () {
if(this.point.name.length >10) if (this.point.name.length > 10)
return '<b>' + this.point.name.substr(0,10) + "</b>...:"+ this.y + "个"; return '<b>' + this.point.name.substr(0, 10) + "</b>...:" + this.y + "个";
return '<b>' + this.point.name +'</b>:'+ this.y + "个"; return '<b>' + this.point.name + '</b>:' + this.y + "个";
} }
} }
} }
@@ -537,8 +528,7 @@
} }
//综合图 //综合图
function showComboChart() function showComboChart() {
{
//解决初始化范围变小问题 //解决初始化范围变小问题
$("#zongheContainer").empty(); $("#zongheContainer").empty();
var getReportTypeInfo = getReportType(); var getReportTypeInfo = getReportType();
@@ -551,22 +541,20 @@
var allDataSum = 0; var allDataSum = 0;
var showNumInfo = 0; var showNumInfo = 0;
if(pageData.length >= showNum) if (pageData.length >= showNum)
showNumInfo = 10; showNumInfo = 10;
else else
showNumInfo = pageData.length; showNumInfo = pageData.length;
for(var i = 0 ;i < showNumInfo;i ++) for (var i = 0; i < showNumInfo; i++) {
{
var eachData = pageData[i]; var eachData = pageData[i];
var sum = eachData[0]; var sum = eachData[0];
var totalInfo = eachData[1]; var totalInfo = eachData[1];
if(reportType == 0) if (reportType == 0) {
{ if (0 == totalInfo)
if(0 == totalInfo)
xName.push("在库"); xName.push("在库");
else if(1 == totalInfo) else if (1 == totalInfo)
xName.push("在用"); xName.push("在用");
else if(2 == totalInfo) else if (2 == totalInfo)
xName.push("消费"); xName.push("消费");
} }
else else
@@ -604,13 +592,13 @@
showInLegend: false, showInLegend: false,
dataLabels: { dataLabels: {
enabled: true, enabled: true,
align:'center' align: 'center'
} }
} }
new Highcharts.Chart({ new Highcharts.Chart({
chart: { chart: {
renderTo: 'zongheContainer', renderTo: 'zongheContainer',
backgroundColor:'#EAF2FD' backgroundColor: '#EAF2FD'
}, },
title: { title: {
text: getReportTypeInfo + "综合图" text: getReportTypeInfo + "综合图"
@@ -620,10 +608,10 @@
labels: { labels: {
rotation: -45, //逆时针旋转45°标签名称太长。 rotation: -45, //逆时针旋转45°标签名称太长。
align: 'right', //设置右对齐 align: 'right', //设置右对齐
formatter: function() { formatter: function () {
if(this.value.length >10) if (this.value.length > 10)
return this.value.substr(0,10) + "..."; return this.value.substr(0, 10) + "...";
return this.value ; return this.value;
} }
} }
}, },
@@ -632,7 +620,7 @@
text: '' text: ''
}, },
labels: { labels: {
formatter: function() { formatter: function () {
return this.value; return this.value;
} }
} }
@@ -645,7 +633,7 @@
style: { style: {
fontWeight: 'bold' fontWeight: 'bold'
}, },
formatter: function() { formatter: function () {
return this.y; return this.y;
} }
}, },
@@ -673,24 +661,24 @@
dataLabels: { dataLabels: {
color: '#000000', color: '#000000',
connectorColor: '#000000', connectorColor: '#000000',
formatter: function() { formatter: function () {
return '资产总数: '+ this.y; return '资产总数: ' + this.y;
} }
}, },
showInLegend: false showInLegend: false
} }
}, },
tooltip: { tooltip: {
formatter: function() { formatter: function () {
var s; var s;
if(this.x == 0) if (this.x == 0)
s = '在库:'+ this.y +' 个'; s = '在库:' + this.y + ' 个';
else if(this.x ==1) else if (this.x == 1)
s = '在用:'+ this.y +' 个'; s = '在用:' + this.y + ' 个';
else if(this.x ==2) else if (this.x == 2)
s = '消费:'+ this.y +' 个'; s = '消费:' + this.y + ' 个';
else else
s = this.x +':'+ this.y +' 个'; s = this.x + ':' + this.y + ' 个';
return s; return s;
} }
}, },
@@ -704,50 +692,46 @@
} }
}] }]
}, },
series: [columnDataForm,averageDataForm,sumDataForm] series: [columnDataForm, averageDataForm, sumDataForm]
}); });
} }
//折线图 //折线图
function showSpline() function showSpline() {
{
//解决初始化范围变小问题 //解决初始化范围变小问题
$("#zxianContainer").empty(); $("#zxianContainer").empty();
var getReportTypeInfo = getReportType(); var getReportTypeInfo = getReportType();
var reportType = $("#searchReportType").val(); var reportType = $("#searchReportType").val();
var dataInfo = new Array(); var dataInfo = new Array();
var nameData = new Array(); var nameData = new Array();
var consumeSumInfo= null; var consumeSumInfo = null;
var showNumInfo = 0; var showNumInfo = 0;
if(pageData.length >= showNum) if (pageData.length >= showNum)
showNumInfo = 10; showNumInfo = 10;
else else
showNumInfo = pageData.length; showNumInfo = pageData.length;
for(var i = 0 ;i < showNumInfo;i ++) for (var i = 0; i < showNumInfo; i++) {
{
var totalInfo = pageData[i] var totalInfo = pageData[i]
dataInfo.push(totalInfo[0]); dataInfo.push(totalInfo[0]);
if(reportType == 0) if (reportType == 0) {
{ if (0 == totalInfo[1])
if(0 == totalInfo[1])
nameData.push("在库"); nameData.push("在库");
else if(1 == totalInfo[1]) else if (1 == totalInfo[1])
nameData.push("在用"); nameData.push("在用");
else if(2 == totalInfo[1]) else if (2 == totalInfo[1])
nameData.push("消费"); nameData.push("消费");
} }
else else
nameData.push(totalInfo[1]); nameData.push(totalInfo[1]);
} }
consumeSumInfo= { consumeSumInfo = {
name: getReportTypeInfo + '总额', name: getReportTypeInfo + '总额',
marker: { marker: {
symbol: 'square', symbol: 'square',
labels: { labels: {
formatter: function() formatter: function () {
{ return this.value + '个';
return this.value +'个';
} }
} }
}, },
@@ -758,7 +742,7 @@
chart: { chart: {
renderTo: 'zxianContainer', renderTo: 'zxianContainer',
type: 'line', type: 'line',
backgroundColor:'#EAF2FD' backgroundColor: '#EAF2FD'
}, },
title: { title: {
text: getReportTypeInfo + "曲线图" text: getReportTypeInfo + "曲线图"
@@ -768,14 +752,14 @@
}, },
xAxis: { xAxis: {
categories: nameData, categories: nameData,
allowDecimals:false, allowDecimals: false,
labels: { labels: {
rotation: -45, //逆时针旋转45°标签名称太长。 rotation: -45, //逆时针旋转45°标签名称太长。
align: 'right', //设置右对齐 align: 'right', //设置右对齐
formatter: function() { formatter: function () {
if(this.value.length >10) if (this.value.length > 10)
return this.value.substr(0,10) + "..."; return this.value.substr(0, 10) + "...";
return this.value ; return this.value;
} }
} }
}, },
@@ -784,7 +768,7 @@
text: '' text: ''
}, },
labels: { labels: {
formatter: function() { formatter: function () {
return this.value; return this.value;
} }
} }
@@ -792,8 +776,8 @@
tooltip: { tooltip: {
crosshairs: false, crosshairs: false,
shared: true, shared: true,
formatter: function() { //格式化提示框的内容样式 formatter: function () { //格式化提示框的内容样式
return this.x +': '+ this.y +'个'; return this.x + ': ' + this.y + '个';
} }
}, },
plotOptions: { plotOptions: {
@@ -818,39 +802,36 @@
} }
//柱状图 //柱状图
function showHistogram() function showHistogram() {
{
//解决初始化范围变小问题 //解决初始化范围变小问题
$("#culumnContainer").empty(); $("#culumnContainer").empty();
var getReportTypeInfo = getReportType(); var getReportTypeInfo = getReportType();
var reportType = $("#searchReportType").val(); var reportType = $("#searchReportType").val();
var dataInfo = new Array(); var dataInfo = new Array();
var nameData = new Array(); var nameData = new Array();
var consumeSumInfo= null; var consumeSumInfo = null;
var showNumInfo = 0; var showNumInfo = 0;
if(pageData.length >= showNum) if (pageData.length >= showNum)
showNumInfo = 10; showNumInfo = 10;
else else
showNumInfo = pageData.length; showNumInfo = pageData.length;
for(var i = 0 ;i < showNumInfo;i ++) for (var i = 0; i < showNumInfo; i++) {
{
var totalInfo = pageData[i] var totalInfo = pageData[i]
dataInfo.push(totalInfo[0]); dataInfo.push(totalInfo[0]);
if(reportType == 0) if (reportType == 0) {
{ if (0 == totalInfo[1])
if(0 == totalInfo[1])
nameData.push("在库"); nameData.push("在库");
else if(1 == totalInfo[1]) else if (1 == totalInfo[1])
nameData.push("在用"); nameData.push("在用");
else if(2 == totalInfo[1]) else if (2 == totalInfo[1])
nameData.push("消费"); nameData.push("消费");
} }
else else
nameData.push(totalInfo[1]); nameData.push(totalInfo[1]);
} }
consumeSumInfo= { consumeSumInfo = {
name: getReportTypeInfo + "柱状图", name: getReportTypeInfo + "柱状图",
data: dataInfo data: dataInfo
} }
@@ -859,7 +840,7 @@
chart: { chart: {
renderTo: 'culumnContainer', renderTo: 'culumnContainer',
type: 'column', type: 'column',
backgroundColor:'#EAF2FD' backgroundColor: '#EAF2FD'
}, },
title: { title: {
text: getReportTypeInfo + "柱状图" text: getReportTypeInfo + "柱状图"
@@ -869,10 +850,10 @@
labels: { labels: {
rotation: -45, //逆时针旋转45°标签名称太长。 rotation: -45, //逆时针旋转45°标签名称太长。
align: 'right', //设置右对齐 align: 'right', //设置右对齐
formatter: function() { formatter: function () {
if(this.value.length >10) if (this.value.length > 10)
return this.value.substr(0,10) + "..."; return this.value.substr(0, 10) + "...";
return this.value ; return this.value;
} }
} }
}, },
@@ -881,7 +862,7 @@
text: '' text: ''
}, },
labels: { labels: {
formatter: function() { formatter: function () {
return this.value; return this.value;
} }
} }
@@ -894,7 +875,7 @@
style: { style: {
fontWeight: 'bold' fontWeight: 'bold'
}, },
formatter: function() { formatter: function () {
return this.y; return this.y;
} }
}, },
@@ -902,8 +883,8 @@
} }
}, },
tooltip: { tooltip: {
formatter: function() { formatter: function () {
return this.x +':'+ this.y +'个'; return this.x + ':' + this.y + '个';
} }
}, },
credits: { credits: {
@@ -914,8 +895,7 @@
} }
//填充表格数据 //填充表格数据
function initTableDetails() function initTableDetails() {
{
var reportType = $("#searchReportType").val(); var reportType = $("#searchReportType").val();
var dataJson = {}; var dataJson = {};
dataJson.total = pageData.length; dataJson.total = pageData.length;
@@ -925,21 +905,19 @@
var footerArray = []; var footerArray = [];
var showNumInfo = 0; var showNumInfo = 0;
if(pageData.length >= showNum) if (pageData.length >= showNum)
showNumInfo = 10; showNumInfo = 10;
else else
showNumInfo = pageData.length; showNumInfo = pageData.length;
for(var i = 0 ;i < showNumInfo;i ++) for (var i = 0; i < showNumInfo; i++) {
{
var totalInfo = pageData[i]; var totalInfo = pageData[i];
var name = ""; var name = "";
if(reportType == 0) if (reportType == 0) {
{ if (0 == totalInfo[1])
if(0 == totalInfo[1])
name = "在库"; name = "在库";
else if(1 == totalInfo[1]) else if (1 == totalInfo[1])
name = "在用"; name = "在用";
else if(2 == totalInfo[1]) else if (2 == totalInfo[1])
name = "消费"; name = "消费";
} }
else else
@@ -949,43 +927,38 @@
dataInfo.sum = totalInfo[0]; dataInfo.sum = totalInfo[0];
totalSum += totalInfo[0]; totalSum += totalInfo[0];
dataArray.push(dataInfo); dataArray.push(dataInfo);
typeSum ++; typeSum++;
} }
var footerInfo = { var footerInfo = {
sum : totalSum, sum: totalSum,
name:getReportType()+ ' ' + typeSum + ' 种类型总数' name: getReportType() + ' ' + typeSum + ' 种类型总数'
}; };
footerArray.push(footerInfo); footerArray.push(footerInfo);
dataJson.rows = dataArray; dataJson.rows = dataArray;
dataJson.footer = footerArray; dataJson.footer = footerArray;
return dataJson; return dataJson;
} }
//返回统计类型字符串 //返回统计类型字符串
function getReportType() function getReportType() {
{
var reportType = $("#searchReportType").val(); var reportType = $("#searchReportType").val();
if(reportType==0) if (reportType == 0) {
{
return '按资产状态统计'; return '按资产状态统计';
} }
else if(reportType==1) else if (reportType == 1) {
{
return '按资产类型统计'; return '按资产类型统计';
} }
else if(reportType==2) else if (reportType == 2) {
{
return '按供应商统计'; return '按供应商统计';
} }
else if(reportType==3) else if (reportType == 3) {
{
return '按资产名称统计'; return '按资产名称统计';
} }
else if(reportType==4) else if (reportType == 4) {
{
return '按所属用户统计'; return '按所属用户统计';
} }
} }
</script> </script>
</body> </body>
</html> </html>

View File

@@ -1,24 +1,24 @@
<%@page import="com.jsh.util.Tools"%> <%@page import="com.jsh.util.Tools" %>
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%> <%@ page language="java" pageEncoding="utf-8" %>
<% <%
String path = request.getContextPath(); String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/"; String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + path + "/";
String clientIp = Tools.getLocalIp(request); String clientIp = Tools.getLocalIp(request);
%> %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <!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"> <html xmlns="http://www.w3.org/1999/xhtml">
<head> <head>
<title>ERP系统</title> <title>ERP系统</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<!-- 指定以IE8的方式来渲染 --> <!-- 指定以IE8的方式来渲染 -->
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE8"/> <meta http-equiv="X-UA-Compatible" content="IE=EmulateIE8"/>
<link rel="shortcut icon" href="<%=path%>/images/favicon.ico" type="image/x-icon" /> <link rel="shortcut icon" href="<%=path%>/images/favicon.ico" type="image/x-icon"/>
<link type="text/css" rel="stylesheet" href="<%=path %>/css/css.css" /> <link type="text/css" rel="stylesheet" href="<%=path %>/css/css.css"/>
</head> </head>
<frameset frameborder="no" border="0" framespacing="0" id="framesetList"> <frameset frameborder="no" border="0" framespacing="0" id="framesetList">
<frame src="<%=path %>/pages/common/main.jsp" name="mainFrame" id="mainFrame" title="mainFrame" /> <frame src="<%=path %>/pages/common/main.jsp" name="mainFrame" id="mainFrame" title="mainFrame"/>
</frameset> </frameset>
<body> <body>
</body> </body>
</noframes> </noframes>
</html> </html>

View File

@@ -1,19 +1,19 @@
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%> <%@ page language="java" pageEncoding="utf-8" %>
<% <%
String path = request.getContextPath(); String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/"; 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"> <!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"> <html xmlns="http://www.w3.org/1999/xhtml">
<head> <head>
<title>资产管理</title> <title>资产管理</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<!-- 指定以IE8的方式来渲染 --> <!-- 指定以IE8的方式来渲染 -->
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE8"/> <meta http-equiv="X-UA-Compatible" content="IE=EmulateIE8"/>
<link rel="shortcut icon" href="<%=path%>/images/favicon.ico" type="image/x-icon" /> <link rel="shortcut icon" href="<%=path%>/images/favicon.ico" type="image/x-icon"/>
<link type="text/css" rel="stylesheet" href="<%=path %>/css/css.css" /> <link type="text/css" rel="stylesheet" href="<%=path %>/css/css.css"/>
</head> </head>
<body> <body>
<div id="foot">Copyright © 2015 季圣华 版权所有 版本号 V1.0</div> <div id="foot">Copyright © 2015 季圣华 版权所有 版本号 V1.0</div>
</body> </body>
</html> </html>

View File

@@ -1,36 +1,45 @@
<%@page import="com.jsh.util.Tools"%> <%@page import="com.jsh.util.Tools" %>
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%> <%@ page language="java" pageEncoding="utf-8" %>
<% <%
String path = request.getContextPath(); String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/"; String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + path + "/";
String clientIp = Tools.getLocalIp(request); String clientIp = Tools.getLocalIp(request);
%> %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <!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"> <html xmlns="http://www.w3.org/1999/xhtml">
<head> <head>
<title>资产管理</title> <title>资产管理</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<!-- 指定以IE8的方式来渲染 --> <!-- 指定以IE8的方式来渲染 -->
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE8"/> <meta http-equiv="X-UA-Compatible" content="IE=EmulateIE8"/>
<link rel="shortcut icon" href="<%=path%>/images/favicon.ico" type="image/x-icon" /> <link rel="shortcut icon" href="<%=path%>/images/favicon.ico" type="image/x-icon"/>
<link type="text/css" rel="stylesheet" href="<%=path %>/css/css.css" /> <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/jquery-1.8.0.min.js"></script>
</head> </head>
<body> <body>
<div id="header"> <div id="header">
<div id="logo"><img src="<%=path%>/images/windvane.png" height="50" alt="资产管理" title="资产管理"/></div> <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="logo"><img src="<%=path%>/images/suma_logo.png" height="45" alt="资产管理系统" title="资产管理系统"/></div> -->
<div id="nav_top"> <div id="nav_top">
<ul> <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><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>|</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><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>|</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="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="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="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="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 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>|</li>
<li><a href="javascript:void(0)" id="navtop_help">帮助</a></li> <li><a href="javascript:void(0)" id="navtop_help">帮助</a></li>
--> -->
@@ -38,130 +47,115 @@
<li><a href="javascript:void(0)" id="navtop_logout">注销</a></li> <li><a href="javascript:void(0)" id="navtop_logout">注销</a></li>
</ul> </ul>
</div> </div>
</div> </div>
<script type="text/javascript"> <script type="text/javascript">
$(init); $(init);
//页面初始化 //页面初始化
function init() function init() {
{
//初始化时间 //初始化时间
showTime(); showTime();
if('${sessionScope.user.loginame}'!= 'guest') if ('${sessionScope.user.loginame}' != 'guest')
$("#1").add("#2").add("#3").add("#4").add("#5").add("#6").show(); $("#1").add("#2").add("#3").add("#4").add("#5").add("#6").show();
else else
$("#1").add("#2").add("#3").add("#4").add("#5").add("#6").hide(); $("#1").add("#2").add("#3").add("#4").add("#5").add("#6").hide();
} }
function showDate() function showDate() {
{
var calendar = new Date(); var calendar = new Date();
var day = calendar.getDay(); var day = calendar.getDay();
var month = calendar.getMonth(); var month = calendar.getMonth();
var date = calendar.getDate(); var date = calendar.getDate();
var year = calendar.getYear(); var year = calendar.getYear();
if (year< 1900) if (year < 1900) {
{
year = 1900 + year; year = 1900 + year;
} }
var cent = parseInt(year/100); var cent = parseInt(year / 100);
var g = year % 19; var g = year % 19;
var k = parseInt((cent - 17)/25); var k = parseInt((cent - 17) / 25);
var i = (cent - parseInt(cent/4) - parseInt((cent - k)/3) + 19*g + 15) % 30; 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)); 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 j = (year + parseInt(year / 4) + i + 2 - cent + parseInt(cent / 4)) % 7;
var l = i - j; var l = i - j;
var emonth = 3 + parseInt((l + 40)/44); var emonth = 3 + parseInt((l + 40) / 44);
var edate = l + 28 - 31*parseInt((emonth/4)); var edate = l + 28 - 31 * parseInt((emonth / 4));
emonth--; emonth--;
var dayname = new Array ("星期日", "星期一", "星期二", "星期三", "星期四", "星期五", "星期六"); var dayname = new Array("星期日", "星期一", "星期二", "星期三", "星期四", "星期五", "星期六");
var monthname =new Array ("1月","2月","3月","4月","5月","6月","7月","8月","9月","10月","11月","12月" ); var monthname = new Array("1月", "2月", "3月", "4月", "5月", "6月", "7月", "8月", "9月", "10月", "11月", "12月");
var message = ""; var message = "";
if(getOs().indexOf("MSIE")!= -1) if (getOs().indexOf("MSIE") != -1) {
{
//控制时间和图片之间的距离 //控制时间和图片之间的距离
$("#blankSpace").empty().append("&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"); $("#blankSpace").empty().append("&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;");
message = year + "年" + monthname[month]+ date + "日&nbsp;&nbsp;" + dayname[day]+"&nbsp;&nbsp;"; message = year + "年" + monthname[month] + date + "日&nbsp;&nbsp;" + dayname[day] + "&nbsp;&nbsp;";
} }
else if(getOs().indexOf("Firefox") != -1) else if (getOs().indexOf("Firefox") != -1) {
{
$("#blankSpace").empty().append("&nbsp;&nbsp;&nbsp;"); $("#blankSpace").empty().append("&nbsp;&nbsp;&nbsp;");
message = year + "年 " + monthname[month]+ date + "日&nbsp;&nbsp;" + dayname[day]+"&nbsp;&nbsp;"; message = year + "年 " + monthname[month] + date + "日&nbsp;&nbsp;" + dayname[day] + "&nbsp;&nbsp;";
} }
else else {
{
$("#blankSpace").empty().append("&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"); $("#blankSpace").empty().append("&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;");
message = year + "年 " + monthname[month]+ date + "日&nbsp;&nbsp; " + dayname[day] + "&nbsp;&nbsp;"; message = year + "年 " + monthname[month] + date + "日&nbsp;&nbsp; " + dayname[day] + "&nbsp;&nbsp;";
} }
return message; return message;
} }
function showTime()
{ function showTime() {
var Digital=new Date(); var Digital = new Date();
var hours=Digital.getHours(); var hours = Digital.getHours();
var minutes=Digital.getMinutes(); var minutes = Digital.getMinutes();
var seconds=Digital.getSeconds(); var seconds = Digital.getSeconds();
if(hours==0) if (hours == 0) {
{ hours = "00";
hours="00";
} }
if(hours <= 9 && hours > 0) if (hours <= 9 && hours > 0) {
{ hours = "0" + hours;
hours="0"+hours;
} }
if(minutes<=9) if (minutes <= 9)
minutes="0"+minutes; minutes = "0" + minutes;
if(seconds<=9) if (seconds <= 9)
seconds="0"+seconds; seconds = "0" + seconds;
var myclock=hours+":"+minutes+":"+seconds; var myclock = hours + ":" + minutes + ":" + seconds;
//定时器 //定时器
setTimeout("showTime()",1000); setTimeout("showTime()", 1000);
var message = showDate()+" "+myclock; var message = showDate() + " " + myclock;
$("#showNowTime").empty().append(message); $("#showNowTime").empty().append(message);
} }
//判断浏览器的类型 //判断浏览器的类型
function getOs() function getOs() {
{
var OsObject = ""; var OsObject = "";
if(navigator.userAgent.indexOf("MSIE")>0) if (navigator.userAgent.indexOf("MSIE") > 0) {
{
return "MSIE"; return "MSIE";
} }
else if(navigator.userAgent.indexOf("Firefox")>0) else if (navigator.userAgent.indexOf("Firefox") > 0) {
{
return "Firefox"; return "Firefox";
} }
else if(navigator.userAgent.indexOf("Safari")>0) else if (navigator.userAgent.indexOf("Safari") > 0) {
{
return "Safari"; return "Safari";
} }
else if(navigator.userAgent.indexOf("Camino")>0) else if (navigator.userAgent.indexOf("Camino") > 0) {
{
return "Camino"; return "Camino";
} }
else if(navigator.userAgent.indexOf("Gecko/")>0) else if (navigator.userAgent.indexOf("Gecko/") > 0) {
{
return "Gecko"; return "Gecko";
} }
else if(navigator.userAgent.indexOf("Opera/")>0) else if (navigator.userAgent.indexOf("Opera/") > 0) {
{
return "Opera"; return "Opera";
} }
else else {
{
return "unknown"; return "unknown";
} }
} }
//退出系统 //退出系统
$("#navtop_logout").bind({ $("#navtop_logout").bind({
click:function() click: function () {
{ if (confirm("确认要退出系统吗?")) {
if(confirm("确认要退出系统吗?")) window.location.href = "<%=path%>/user/logout.action?clientIp=<%=clientIp%>";
{
window.location.href ="<%=path%>/user/logout.action?clientIp=<%=clientIp%>" ;
} }
} }
}); });
</script> </script>
</body> </body>
</html> </html>

View File

@@ -1,22 +1,22 @@
<%@page import="com.jsh.util.Tools"%> <%@page import="com.jsh.util.Tools" %>
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%> <%@ page language="java" pageEncoding="utf-8" %>
<% <%
String path = request.getContextPath(); String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/"; String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + path + "/";
String clientIp = Tools.getLocalIp(request); String clientIp = Tools.getLocalIp(request);
String type = request.getParameter("type"); String type = request.getParameter("type");
String location = "首页"; String location = "首页";
if(null != type) if (null != type)
location = "资产管理 &gt;资产概况"; location = "资产管理 &gt;资产概况";
%> %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <!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"> <html xmlns="http://www.w3.org/1999/xhtml">
<head> <head>
<title>erp</title> <title>erp</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<!-- 指定以IE8的方式来渲染 --> <!-- 指定以IE8的方式来渲染 -->
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE8"/> <meta http-equiv="X-UA-Compatible" content="IE=EmulateIE8"/>
<link rel="shortcut icon" href="<%=path%>/images/favicon.ico" type="image/x-icon" /> <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/default/easyui.css"/>
<link rel="stylesheet" type="text/css" href="<%=path %>/js/easyui-1.3.5/themes/icon.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/jquery-1.8.0.min.js"></script>
@@ -25,60 +25,91 @@
<script type="text/javascript" src="<%=path%>/js/highcharts/highcharts.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/highcharts/exporting.js"></script>
<style> <style>
body{ margin:0; height:100%} body {
html{ height:100%} /*兼容firefox的div高度100%*/ margin: 0;
#left{ width:150px; height:100%; float:left; _margin-right:-3px;} height: 100%
#right{ height:100%;} }
#leftdown{ width:150px; height:100%; float:left; _margin-right:-3px;}
#rightdown{ height:100%;} html {
<!--页面展示特殊要求--> height: 100%
.datagrid-body,.datagrid-footer,.datagrid-pager ,.datagrid-view }
{
background-color:#EAF2FD; /*兼容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> </style>
</head> </head>
<body> <body>
<div id="position" class="easyui-panel" title="当前位置: <%=location %>" collapsible="false" closable="false"/> <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="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 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 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 id="zongheContainer" style="height: 340px;">综合图</div>
</div> </div>
</div> </div>
<div id="right" class="easyui-tabs" style="height:auto;padding:1px;"> <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 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 id="culumnContainer" style="height: 340px;">柱状图</div>
</div> </div>
</div> </div>
<div id="leftdown" class="easyui-tabs" style="width:630px;height:auto;padding:1px;"> <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 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 id="zxianContainer" style="height: 340px;">折现图</div>
</div> </div>
</div> </div>
<div id="rightdown" class="easyui-tabs" style="height:auto;padding:1px;"> <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 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 id="pieContainer" style="height: 340px;">饼状图</div>
</div> </div>
</div> </div>
</div> </div>
<!-- 数据显示table --> <!-- 数据显示table -->
<div id = "tablePanel" class="easyui-panel" style="padding:1px;top:300px;" title="资产列表" iconCls="icon-list" collapsible="true" closable="false"> <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> <table id="tableData" style="height:360px;top:300px;border-bottom-color:#FFFFFF"></table>
</div> </div>
<script type="text/javascript"> <script type="text/javascript">
//控制图表显示个数 //控制图表显示个数
var showNum = 10; var showNum = 10;
//初始化界面 //初始化界面
$(function() $(function () {
{
//progress(); //progress();
$.messager.progress({ $.messager.progress({
title:'请稍候', title: '请稍候',
msg:'数据加载ing...' msg: '数据加载ing...'
}); });
//综合图 //综合图
showComboChart(); showComboChart();
@@ -94,20 +125,18 @@
}); });
//加载进度条 //加载进度条
function progress() function progress() {
{
var win = $.messager.progress({ var win = $.messager.progress({
title:'请稍候', title: '请稍候',
msg:'数据加载ing...' msg: '数据加载ing...'
}); });
setTimeout(function(){ setTimeout(function () {
$.messager.progress('close'); $.messager.progress('close');
},3300); }, 3300);
} }
//初始化表格数据 //初始化表格数据
function initTableData() function initTableData() {
{
$('#tableData').datagrid({ $('#tableData').datagrid({
//title:'资产列表', //title:'资产列表',
//iconCls:'icon-save', //iconCls:'icon-save',
@@ -116,108 +145,100 @@
nowrap: false, nowrap: false,
rownumbers: false, rownumbers: false,
//动画效果 //动画效果
animate:false, animate: false,
//选中单行 //选中单行
singleSelect : true, singleSelect: true,
collapsible:false, collapsible: false,
selectOnCheck:false, selectOnCheck: false,
//fitColumns:true, //fitColumns:true,
//单击行是否选中 //单击行是否选中
checkOnSelect : false, checkOnSelect: false,
//交替出现背景 //交替出现背景
striped : true, striped: true,
url:'<%=path %>/asset/findBy.action', url: '<%=path %>/asset/findBy.action',
pagination: true, pagination: true,
//loadFilter: pagerFilter, //loadFilter: pagerFilter,
pageSize: 10, pageSize: 10,
pageList: [10,20,30,50], pageList: [10, 20, 30, 50],
frozenColumns:[[ frozenColumns: [[
{ field: 'id',width:35,align:"center",checkbox:true}, {field: 'id', width: 35, align: "center", checkbox: true},
{ title: '资产名称',field: 'assetname',width:100}, {title: '资产名称', field: 'assetname', width: 100},
{ title: '单价', field: 'price',width:70,align:"center"}, {title: '单价', field: 'price', width: 70, align: "center"},
{ title: '资产类型', field: 'category',width:115,align:"center"}, {title: '资产类型', field: 'category', width: 115, align: "center"},
{ title: '用户',field: 'username',width:100,align:"center"}, {title: '用户', field: 'username', width: 100, align: "center"},
{ title: '购买日期',field: 'purchasedate',width:90,align:"center"}, {title: '购买日期', field: 'purchasedate', width: 90, align: "center"},
{ title: '状态',field: 'status',width:50,align:"center"}, {title: '状态', field: 'status', width: 50, align: "center"},
{ title: '位置',field: 'location',width:100,align:"center"}, {title: '位置', field: 'location', width: 100, align: "center"},
{ title: '资产编号',field: 'assetnum',width:120,align:"center"}, {title: '资产编号', field: 'assetnum', width: 120, align: "center"},
{ title: '序列号',field: 'serialnum',width:120,align:"center"} {title: '序列号', field: 'serialnum', width: 120, align: "center"}
]], ]],
columns:[[ columns: [[
{ title: '有效日期',field: 'periodofvalidity',width:90,align:"center"}, {title: '有效日期', field: 'periodofvalidity', width: 90, align: "center"},
{ title: '保修日期',field: 'warrantydate',width:90,align:"center"}, {title: '保修日期', field: 'warrantydate', width: 90, align: "center"},
{ title: '供应商',field: 'supplier',width:100,align:"center"}, {title: '供应商', field: 'supplier', width: 100, align: "center"},
{ title: '标签',field: 'labels',width:180,align:"center"}, {title: '标签', field: 'labels', width: 180, align: "center"},
{ title: '描述',field: 'description',width:300} {title: '描述', field: 'description', width: 300}
]], ]],
onLoadError:function() onLoadError: function () {
{ $.messager.alert('页面加载提示', '页面加载异常,请稍后再试!', 'error');
$.messager.alert('页面加载提示','页面加载异常,请稍后再试!','error');
return; return;
} }
}); });
} }
//分页信息处理 //分页信息处理
function ininPager() function ininPager() {
{ try {
try
{
var opts = $("#tableData").datagrid('options'); var opts = $("#tableData").datagrid('options');
var pager = $("#tableData").datagrid('getPager'); var pager = $("#tableData").datagrid('getPager');
pager.pagination({ pager.pagination({
onSelectPage:function(pageNum, pageSize) onSelectPage: function (pageNum, pageSize) {
{
opts.pageNumber = pageNum; opts.pageNumber = pageNum;
opts.pageSize = pageSize; opts.pageSize = pageSize;
pager.pagination('refresh', pager.pagination('refresh',
{ {
pageNumber:pageNum, pageNumber: pageNum,
pageSize:pageSize pageSize: pageSize
}); });
showAssetDetails(pageNum,pageSize); showAssetDetails(pageNum, pageSize);
} }
}); });
} }
catch (e) catch (e) {
{ $.messager.alert('异常处理提示', "分页信息异常 : " + e.name + ": " + e.message, 'error');
$.messager.alert('异常处理提示',"分页信息异常 : " + e.name + ": " + e.message,'error');
} }
} }
function showAssetDetails(pageNo,pageSize) function showAssetDetails(pageNo, pageSize) {
{
$.ajax({ $.ajax({
type:"post", type: "post",
url: "<%=path %>/asset/findBy.action", url: "<%=path %>/asset/findBy.action",
dataType: "json", dataType: "json",
data: ({ data: ({
assetNameID:$.trim($("#searchAssetNameID").val()), assetNameID: $.trim($("#searchAssetNameID").val()),
assetCategoryID:$.trim($("#searchCategoryID").val()), assetCategoryID: $.trim($("#searchCategoryID").val()),
usernameID:$.trim($("#searchUsernameID").val()), usernameID: $.trim($("#searchUsernameID").val()),
status:$.trim($("#searchStatus").val()), status: $.trim($("#searchStatus").val()),
supplierID:$.trim($("#searchSupplierID").val()), supplierID: $.trim($("#searchSupplierID").val()),
pageNo:pageNo, pageNo: pageNo,
pageSize:pageSize pageSize: pageSize
}), }),
success: function (data) success: function (data) {
{ $("#tableData").datagrid('loadData', data);
$("#tableData").datagrid('loadData',data);
//$('#tableData').datagrid('reload'); //$('#tableData').datagrid('reload');
}, },
//此处添加错误处理 //此处添加错误处理
error:function() error: function () {
{ $.messager.alert('查询提示', '查询数据后台异常,请稍后再试!', 'error');
$.messager.alert('查询提示','查询数据后台异常,请稍后再试!','error');
return; return;
} }
}); });
} }
//设置饼状图为渐变色 //设置饼状图为渐变色
Highcharts.getOptions().colors = $.map(Highcharts.getOptions().colors, function(color) { Highcharts.getOptions().colors = $.map(Highcharts.getOptions().colors, function (color) {
return { return {
radialGradient: { cx: 0.5, cy: 0.3, r: 0.7 }, radialGradient: {cx: 0.5, cy: 0.3, r: 0.7},
stops: [ stops: [
[0, color], [0, color],
[1, Highcharts.Color(color).brighten(-0.3).get('rgb')] // darken [1, Highcharts.Color(color).brighten(-0.3).get('rgb')] // darken
@@ -227,24 +248,21 @@
//饼状图 //饼状图
function showPieChart() function showPieChart() {
{
var pageData = null; var pageData = null;
$.ajax({ $.ajax({
type:"post", type: "post",
url: "<%=path%>/report/find.action", url: "<%=path%>/report/find.action",
dataType: "json", dataType: "json",
//取消异步机制,保证页面数据返回再进行处理 //取消异步机制,保证页面数据返回再进行处理
async: false, async: false,
data: ({ data: ({
reportType : 2, reportType: 2,
}), }),
success: function (reportInfo) success: function (reportInfo) {
{
pageData = reportInfo.showModel.reportData; pageData = reportInfo.showModel.reportData;
var msgTip = reportInfo.showModel.msgTip; var msgTip = reportInfo.showModel.msgTip;
if(msgTip == "get report data exception") if (msgTip == "get report data exception") {
{
alert("查找报表信息异常,请与管理员联系!"); alert("查找报表信息异常,请与管理员联系!");
return; return;
} }
@@ -255,8 +273,7 @@
var getReportTypeInfo = "按供应商统计"; var getReportTypeInfo = "按供应商统计";
//封装数据到数组中 //封装数据到数组中
var allDataInfo = new Array(); var allDataInfo = new Array();
for(var i = 0;i < pageData.length; i++) for (var i = 0; i < pageData.length; i++) {
{
var dataInfo = new Array(); var dataInfo = new Array();
var totalInfo = pageData[i] var totalInfo = pageData[i]
@@ -271,15 +288,15 @@
renderTo: 'pieContainer', renderTo: 'pieContainer',
plotBackgroundColor: null, plotBackgroundColor: null,
plotBorderWidth: null, plotBorderWidth: null,
backgroundColor:'#EAF2FD', backgroundColor: '#EAF2FD',
plotShadow: false plotShadow: false
}, },
title: { title: {
text: getReportTypeInfo + "饼状图" text: getReportTypeInfo + "饼状图"
}, },
tooltip: { tooltip: {
formatter: function() { formatter: function () {
return this.point.name +':'+ this.y + "个"; return this.point.name + ':' + this.y + "个";
} }
}, },
plotOptions: { plotOptions: {
@@ -290,10 +307,10 @@
enabled: true, enabled: true,
color: '#000000', color: '#000000',
connectorColor: '#000000', connectorColor: '#000000',
formatter: function() { formatter: function () {
if(this.point.name.length >10) if (this.point.name.length > 10)
return '<b>' + this.point.name.substr(0,10) + "</b>...:"+ this.y + "个"; return '<b>' + this.point.name.substr(0, 10) + "</b>...:" + this.y + "个";
return '<b>' + this.point.name +'</b>:'+ this.y + "个"; return '<b>' + this.point.name + '</b>:' + this.y + "个";
} }
} }
} }
@@ -307,24 +324,21 @@
} }
//综合图 //综合图
function showComboChart() function showComboChart() {
{
var pageData = null; var pageData = null;
$.ajax({ $.ajax({
type:"post", type: "post",
url: "<%=path%>/report/find.action", url: "<%=path%>/report/find.action",
dataType: "json", dataType: "json",
//取消异步机制,保证页面数据返回再进行处理 //取消异步机制,保证页面数据返回再进行处理
async: false, async: false,
data: ({ data: ({
reportType : 0 reportType: 0
}), }),
success: function (reportInfo) success: function (reportInfo) {
{
pageData = reportInfo.showModel.reportData; pageData = reportInfo.showModel.reportData;
var msgTip = reportInfo.showModel.msgTip; var msgTip = reportInfo.showModel.msgTip;
if(msgTip == "get report data exception") if (msgTip == "get report data exception") {
{
alert("查找报表信息异常,请与管理员联系!"); alert("查找报表信息异常,请与管理员联系!");
return; return;
} }
@@ -341,20 +355,19 @@
var allDataSum = 0; var allDataSum = 0;
var showNumInfo = 0; var showNumInfo = 0;
if(pageData.length >= showNum) if (pageData.length >= showNum)
showNumInfo = 10; showNumInfo = 10;
else else
showNumInfo = pageData.length; showNumInfo = pageData.length;
for(var i = 0 ;i < showNumInfo;i ++) for (var i = 0; i < showNumInfo; i++) {
{
var eachData = pageData[i]; var eachData = pageData[i];
var sum = eachData[0]; var sum = eachData[0];
var totalInfo = eachData[1]; var totalInfo = eachData[1];
if(0 == totalInfo) if (0 == totalInfo)
xName.push("在库"); xName.push("在库");
else if(1 == totalInfo) else if (1 == totalInfo)
xName.push("在用"); xName.push("在用");
else if(2 == totalInfo) else if (2 == totalInfo)
xName.push("消费"); xName.push("消费");
columnData.push(sum); columnData.push(sum);
allDataSum += sum; allDataSum += sum;
@@ -389,13 +402,13 @@
showInLegend: false, showInLegend: false,
dataLabels: { dataLabels: {
enabled: true, enabled: true,
align:'center' align: 'center'
} }
} }
new Highcharts.Chart({ new Highcharts.Chart({
chart: { chart: {
renderTo: 'zongheContainer', renderTo: 'zongheContainer',
backgroundColor:'#EAF2FD' backgroundColor: '#EAF2FD'
}, },
title: { title: {
text: getReportTypeInfo + "综合图" text: getReportTypeInfo + "综合图"
@@ -408,7 +421,7 @@
text: '' text: ''
}, },
labels: { labels: {
formatter: function() { formatter: function () {
return this.value; return this.value;
} }
} }
@@ -421,7 +434,7 @@
style: { style: {
fontWeight: 'bold' fontWeight: 'bold'
}, },
formatter: function() { formatter: function () {
return this.y; return this.y;
} }
}, },
@@ -448,15 +461,15 @@
dataLabels: { dataLabels: {
color: '#000000', color: '#000000',
connectorColor: '#000000', connectorColor: '#000000',
formatter: function() { formatter: function () {
return '资产总数: '+ this.y; return '资产总数: ' + this.y;
} }
} }
} }
}, },
tooltip: { tooltip: {
formatter: function() { formatter: function () {
return this.key +':'+ this.y +' 个'; return this.key + ':' + this.y + ' 个';
} }
}, },
labels: { labels: {
@@ -469,29 +482,26 @@
} }
}] }]
}, },
series: [columnDataForm,averageDataForm,sumDataForm] series: [columnDataForm, averageDataForm, sumDataForm]
}); });
} }
//折线图 //折线图
function showSpline() function showSpline() {
{
var pageData = null; var pageData = null;
$.ajax({ $.ajax({
type:"post", type: "post",
url: "<%=path%>/report/find.action", url: "<%=path%>/report/find.action",
dataType: "json", dataType: "json",
//取消异步机制,保证页面数据返回再进行处理 //取消异步机制,保证页面数据返回再进行处理
async: false, async: false,
data: ({ data: ({
reportType : 1 reportType: 1
}), }),
success: function (reportInfo) success: function (reportInfo) {
{
pageData = reportInfo.showModel.reportData; pageData = reportInfo.showModel.reportData;
var msgTip = reportInfo.showModel.msgTip; var msgTip = reportInfo.showModel.msgTip;
if(msgTip == "get report data exception") if (msgTip == "get report data exception") {
{
alert("查找报表信息异常,请与管理员联系!"); alert("查找报表信息异常,请与管理员联系!");
return; return;
} }
@@ -502,28 +512,26 @@
var getReportTypeInfo = "按资产类型统计"; var getReportTypeInfo = "按资产类型统计";
var dataInfo = new Array(); var dataInfo = new Array();
var nameData = new Array(); var nameData = new Array();
var consumeSumInfo= null; var consumeSumInfo = null;
var showNumInfo = 0; var showNumInfo = 0;
if(pageData.length >= showNum) if (pageData.length >= showNum)
showNumInfo = 10; showNumInfo = 10;
else else
showNumInfo = pageData.length; showNumInfo = pageData.length;
for(var i = 0 ;i < showNumInfo;i ++) for (var i = 0; i < showNumInfo; i++) {
{
var totalInfo = pageData[i] var totalInfo = pageData[i]
dataInfo.push(totalInfo[0]); dataInfo.push(totalInfo[0]);
nameData.push(totalInfo[1]); nameData.push(totalInfo[1]);
} }
consumeSumInfo= { consumeSumInfo = {
name: getReportTypeInfo + '总共', name: getReportTypeInfo + '总共',
marker: { marker: {
symbol: 'square', symbol: 'square',
labels: { labels: {
formatter: function() formatter: function () {
{ return this.value + '个';
return this.value +'个';
} }
} }
}, },
@@ -534,7 +542,7 @@
chart: { chart: {
renderTo: 'zxianContainer', renderTo: 'zxianContainer',
type: 'line', type: 'line',
backgroundColor:'#EAF2FD' backgroundColor: '#EAF2FD'
}, },
title: { title: {
text: getReportTypeInfo + "曲线图" text: getReportTypeInfo + "曲线图"
@@ -547,10 +555,10 @@
labels: { labels: {
rotation: -45, //逆时针旋转45°标签名称太长。 rotation: -45, //逆时针旋转45°标签名称太长。
align: 'right', //设置右对齐 align: 'right', //设置右对齐
formatter: function() { formatter: function () {
if(this.value.length >10) if (this.value.length > 10)
return this.value.substr(0,10) + "..."; return this.value.substr(0, 10) + "...";
return this.value ; return this.value;
} }
} }
}, },
@@ -559,16 +567,16 @@
text: '' text: ''
}, },
labels: { labels: {
formatter: function() { formatter: function () {
return this.value ; return this.value;
} }
} }
}, },
tooltip: { tooltip: {
crosshairs: false, crosshairs: false,
shared: true, shared: true,
formatter: function() { formatter: function () {
return this.x + ":" +this.y +'个'; return this.x + ":" + this.y + '个';
} }
}, },
plotOptions: { plotOptions: {
@@ -593,24 +601,21 @@
} }
//柱状图 //柱状图
function showHistogram() function showHistogram() {
{
var pageData = null; var pageData = null;
$.ajax({ $.ajax({
type:"post", type: "post",
url: "<%=path%>/report/find.action", url: "<%=path%>/report/find.action",
dataType: "json", dataType: "json",
//取消异步机制,保证页面数据返回再进行处理 //取消异步机制,保证页面数据返回再进行处理
async: false, async: false,
data: ({ data: ({
reportType : 3, reportType: 3,
}), }),
success: function (reportInfo) success: function (reportInfo) {
{
pageData = reportInfo.showModel.reportData; pageData = reportInfo.showModel.reportData;
var msgTip = reportInfo.showModel.msgTip; var msgTip = reportInfo.showModel.msgTip;
if(msgTip == "get report data exception") if (msgTip == "get report data exception") {
{
alert("查找报表信息异常,请与管理员联系!"); alert("查找报表信息异常,请与管理员联系!");
return; return;
} }
@@ -621,20 +626,19 @@
var getReportTypeInfo = "按资产名称统计"; var getReportTypeInfo = "按资产名称统计";
var dataInfo = new Array(); var dataInfo = new Array();
var nameData = new Array(); var nameData = new Array();
var consumeSumInfo= null; var consumeSumInfo = null;
var showNumInfo = 0; var showNumInfo = 0;
if(pageData.length >= showNum) if (pageData.length >= showNum)
showNumInfo = 10; showNumInfo = 10;
else else
showNumInfo = pageData.length; showNumInfo = pageData.length;
for(var i = 0 ;i < showNumInfo;i ++) for (var i = 0; i < showNumInfo; i++) {
{
var totalInfo = pageData[i]; var totalInfo = pageData[i];
dataInfo.push(totalInfo[0]); dataInfo.push(totalInfo[0]);
nameData.push(totalInfo[1]); nameData.push(totalInfo[1]);
} }
consumeSumInfo= { consumeSumInfo = {
name: getReportTypeInfo + "柱状图", name: getReportTypeInfo + "柱状图",
data: dataInfo data: dataInfo
} }
@@ -643,7 +647,7 @@
chart: { chart: {
renderTo: 'culumnContainer', renderTo: 'culumnContainer',
type: 'column', type: 'column',
backgroundColor:'#EAF2FD' backgroundColor: '#EAF2FD'
}, },
title: { title: {
text: getReportTypeInfo + "柱状图" text: getReportTypeInfo + "柱状图"
@@ -653,10 +657,10 @@
labels: { labels: {
rotation: -45, //逆时针旋转45°标签名称太长。 rotation: -45, //逆时针旋转45°标签名称太长。
align: 'right', //设置右对齐 align: 'right', //设置右对齐
formatter: function() { formatter: function () {
if(this.value.length >10) if (this.value.length > 10)
return this.value.substr(0,10) + "..."; return this.value.substr(0, 10) + "...";
return this.value ; return this.value;
} }
} }
}, },
@@ -665,7 +669,7 @@
text: '' text: ''
}, },
labels: { labels: {
formatter: function() { formatter: function () {
return this.value; return this.value;
} }
} }
@@ -678,7 +682,7 @@
style: { style: {
fontWeight: 'bold' fontWeight: 'bold'
}, },
formatter: function() { formatter: function () {
return this.y; return this.y;
} }
}, },
@@ -686,8 +690,8 @@
} }
}, },
tooltip: { tooltip: {
formatter: function() { formatter: function () {
return this.x + ":" +this.y +'个'; return this.x + ":" + this.y + '个';
} }
}, },
credits: { credits: {
@@ -698,30 +702,24 @@
} }
//返回统计类型字符串 //返回统计类型字符串
function getReportType() function getReportType() {
{
var reportType = $("#searchReportType").val(); var reportType = $("#searchReportType").val();
if(reportType==0) if (reportType == 0) {
{
return '按资产状态统计'; return '按资产状态统计';
} }
else if(reportType==1) else if (reportType == 1) {
{
return '按资产类型统计'; return '按资产类型统计';
} }
else if(reportType==2) else if (reportType == 2) {
{
return '按供应商统计'; return '按供应商统计';
} }
else if(reportType==3) else if (reportType == 3) {
{
return '按资产名称统计'; return '按资产名称统计';
} }
else if(reportType==4) else if (reportType == 4) {
{
return '按所属用户统计'; return '按所属用户统计';
} }
} }
</script> </script>
</body> </body>
</html> </html>

View File

@@ -1,8 +1,8 @@
<%@page import="com.jsh.util.Tools"%> <%@page import="com.jsh.util.Tools" %>
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%> <%@ page language="java" pageEncoding="utf-8" %>
<% <%
String path = request.getContextPath(); String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/"; String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + path + "/";
String clientIp = Tools.getLocalIp(request); String clientIp = Tools.getLocalIp(request);
%> %>
<!DOCTYPE html> <!DOCTYPE html>
@@ -10,31 +10,38 @@
<head> <head>
<meta charset="utf-8"> <meta charset="utf-8">
<title>ERP系统</title> <title>ERP系统</title>
<link href="<%=path%>/js/HoorayOS_mini/js/HoorayLibs/hooraylibs.css" rel="stylesheet" /> <link href="<%=path%>/js/HoorayOS_mini/js/HoorayLibs/hooraylibs.css" rel="stylesheet"/>
<link href="<%=path%>/js/HoorayOS_mini/img/ui/index.css" rel="stylesheet" /> <link href="<%=path%>/js/HoorayOS_mini/img/ui/index.css" rel="stylesheet"/>
</head> </head>
<body> <body>
<div class="loading"></div> <div class="loading"></div>
<!-- 浏览器升级提示 --> <!-- 浏览器升级提示 -->
<div class="update_browser_box"> <div class="update_browser_box">
<div class="update_browser"> <div class="update_browser">
<div class="subtitle">您正在使用的IE浏览器版本过低<br>我们建议您升级或者更换浏览器,以便体验顺畅、兼容、安全的互联网。</div> <div class="subtitle">您正在使用的IE浏览器版本过低<br>我们建议您升级或者更换浏览器,以便体验顺畅、兼容、安全的互联网。</div>
<div class="title">选择一款<span>新</span>浏览器吧</div> <div class="title">选择一款<span>新</span>浏览器吧</div>
<div class="browser"> <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://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.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.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.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> <a href="http://www.apple.com.cn/safari" class="safari" target="_blank" title="safari浏览器">safari浏览器</a>
</div> </div>
<div class="bottomtitle">[&nbsp;<a href="http://www.baidu.com/search/theie6countdown.html" target="_blank">对IE6说再见</a>&nbsp;]</div> <div class="bottomtitle">[&nbsp;<a href="http://www.baidu.com/search/theie6countdown.html" target="_blank">对IE6说再见</a>&nbsp;]
</div> </div>
</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="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">
<div id="desk-1" class="desktop-container"><div class="scrollbar scrollbar-x"></div><div class="scrollbar scrollbar-y"></div></div> <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-bar">
<div id="dock-container"> <div id="dock-container">
<div class="dock-middle"> <div class="dock-middle">
@@ -60,35 +67,37 @@
</div> </div>
<div id="task-pre"><a href="javascript:;" id="task-pre-btn" hidefocus="true"></a></div> <div id="task-pre"><a href="javascript:;" id="task-pre-btn" hidefocus="true"></a></div>
</div> </div>
</div> </div>
<script src="<%=path%>/js/HoorayOS_mini/js/jquery-1.8.3.min.js"></script> <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/HoorayLibs/hooraylibs.js"></script>
<script src="<%=path%>/js/HoorayOS_mini/js/templates.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/core.js"></script>
<script src="<%=path%>/js/HoorayOS_mini/js/hros.app.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.base.js"></script>
<script src="<%=path%>/js/HoorayOS_mini/js/hros.desktop.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.dock.js"></script>
<script src="<%=path%>/js/HoorayOS_mini/js/hros.grid.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.maskBox.js"></script>
<script src="<%=path%>/js/HoorayOS_mini/js/hros.taskbar.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.popupMenu.js"></script>
<script src="<%=path%>/js/HoorayOS_mini/js/hros.wallpaper.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.widget.js"></script>
<script src="<%=path%>/js/HoorayOS_mini/js/hros.window.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 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> <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" /> <link href="<%=path%>/js/easyui-1.3.5/themes/default/easyui.css" rel="stylesheet" type="text/css"/>
<script> <script>
$(function () { $(function () {
$('#loginOut').click(function () { $('#loginOut').click(function () {
if (confirm("确认要退出系统吗?")) if (confirm("确认要退出系统吗?"))
location.href = '<%=path%>/user/logout.action?clientIp=<%=clientIp%>'; location.href = '<%=path%>/user/logout.action?clientIp=<%=clientIp%>';
}) })
//IE下禁止选中 //IE下禁止选中
document.body.onselectstart = document.body.ondrag = function () { return false; } document.body.onselectstart = document.body.ondrag = function () {
return false;
}
//隐藏加载遮罩层 //隐藏加载遮罩层
$('.loading').hide(); $('.loading').hide();
//IE6升级提示 //IE6升级提示
@@ -105,16 +114,18 @@
//加载桌面 //加载桌面
HROS.base.init(); HROS.base.init();
} }
//判断是否存在session如果不存在就跳到登录界面 //判断是否存在session如果不存在就跳到登录界面
function UserOut() { function UserOut() {
var kid = ${sessionScope.user.id}; var kid = ${sessionScope.user.id};
if (!kid){ if (!kid) {
top.location.href = '../../'; top.location.href = '../../';
} }
} }
setInterval(UserOut, 5000); //每5秒检测一次 setInterval(UserOut, 5000); //每5秒检测一次
}); });
</script> </script>
</body> </body>
</html> </html>

View File

@@ -1,7 +1,7 @@
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%> <%@ page language="java" pageEncoding="utf-8" %>
<% <%
String path = request.getContextPath(); String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/"; String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + path + "/";
%> %>
<!DOCTYPE html> <!DOCTYPE html>
<html> <html>
@@ -10,10 +10,10 @@
<meta charset="utf-8"> <meta charset="utf-8">
<!-- 指定以IE8的方式来渲染 --> <!-- 指定以IE8的方式来渲染 -->
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE8"/> <meta http-equiv="X-UA-Compatible" content="IE=EmulateIE8"/>
<link rel="shortcut icon" href="<%=path%>/images/favicon.ico" type="image/x-icon" /> <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/default/easyui.css"/>
<link rel="stylesheet" type="text/css" href="<%=path %>/js/easyui-1.3.5/themes/icon.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" /> <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/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/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/locale/easyui-lang-zh_CN.js"></script>
@@ -28,200 +28,183 @@
</head> </head>
<body class="easyui-layout" style="overflow-y: hidden" scroll="no"> <body class="easyui-layout" style="overflow-y: hidden" scroll="no">
<script> <script>
var pageid = getUrlParam('id'); //获取传值id var pageid = getUrlParam('id'); //获取传值id
var id=${sessionScope.user.id}; var id =${sessionScope.user.id};
//alert(pageid); //alert(pageid);
var userBusinessList = null; var userBusinessList = null;
var userBusinessID = null; var userBusinessID = null;
var type=null; var type = null;
var options = ""; var options = "";
var kid=null; var kid = null;
var lei=null; var lei = null;
var last=""; var last = "";
var functions=""; var functions = "";
var btnStrList = []; //按钮权限列表 var btnStrList = []; //按钮权限列表
//初始化界面 //初始化界面
$(function() $(function () {
{
//初始化系统基础信息 //初始化系统基础信息
initSystemData(id,'UserRole'); initSystemData(id, 'UserRole');
initSelectInfo(0); initSelectInfo(0);
initSelect(); initSelect();
//ceshi(); //ceshi();
}); });
//初始化系统基础信息 //初始化系统基础信息
function initSystemData(kid,type) function initSystemData(kid, type) {
{
$.ajax({ $.ajax({
type:"post", type: "post",
url: "<%=path%>/userBusiness/getBasicData.action", url: "<%=path%>/userBusiness/getBasicData.action",
data: ({ data: ({
KeyId:kid, KeyId: kid,
Type:type Type: type
}), }),
//设置为同步 //设置为同步
async:false, async: false,
dataType: "json", dataType: "json",
success: function (systemInfo) success: function (systemInfo) {
{ if (systemInfo) {
if(systemInfo)
{
userBusinessList = systemInfo.showModel.map.userBusinessList; userBusinessList = systemInfo.showModel.map.userBusinessList;
var msgTip = systemInfo.showModel.msgTip; var msgTip = systemInfo.showModel.msgTip;
if(msgTip == "exceptoin") if (msgTip == "exceptoin") {
{ $.messager.alert('提示', '查找UserBusiness异常,请与管理员联系!', 'error');
$.messager.alert('提示','查找UserBusiness异常,请与管理员联系!','error');
return; return;
} }
} }
else else {
{ userBusinessList = null;
userBusinessList=null;
} }
} }
}); });
} }
//初始化页面选项卡
function initSelectInfo(lei) { //初始化页面选项卡
if(userBusinessList !=null) { function initSelectInfo(lei) {
if(userBusinessList.length>0) { if (userBusinessList != null) {
options =userBusinessList[0].value; if (userBusinessList.length > 0) {
if(options!="") { options = userBusinessList[0].value;
options=options.substring(1,options.length-1); if (options != "") {
options = options.substring(1, options.length - 1);
} }
//app内列表赋值 //app内列表赋值
if(lei==1) { if (lei == 1) {
last+=options+']['; last += options + '][';
} }
//功能菜单列表 //功能菜单列表
else if(lei==2) { else if (lei == 2) {
functions+=options+']['; functions += options + '][';
} }
//按钮权限列表 //按钮权限列表
else if(lei==3) { else if (lei == 3) {
var btnStr =userBusinessList[0].btnStr; var btnStr = userBusinessList[0].btnStr;
if(btnStr!=null){ if (btnStr != null) {
btnStr = JSON.parse(btnStr); btnStr = JSON.parse(btnStr);
for(var j=0; j<btnStr.length; j++){ for (var j = 0; j < btnStr.length; j++) {
btnStrList.push(btnStr[j]); btnStrList.push(btnStr[j]);
} }
} }
} }
} }
} }
} }
//初始化页面 //初始化页面
function initSelect() function initSelect() {
{
var arr = options.split(']['); var arr = options.split('][');
for(var i in arr){ for (var i in arr) {
initSystemData(arr[i],'RoleAPP'); //根据角色找app initSystemData(arr[i], 'RoleAPP'); //根据角色找app
initSelectInfo(1);//app内列表赋值 initSelectInfo(1);//app内列表赋值
initSystemData(arr[i],'RoleFunctions'); //根据角色找functions initSystemData(arr[i], 'RoleFunctions'); //根据角色找functions
initSelectInfo(2); //功能菜单列表 initSelectInfo(2); //功能菜单列表
initSelectInfo(3); //查询角色对应的按钮权限 initSelectInfo(3); //查询角色对应的按钮权限
} }
if(last!="") if (last != "") {
{ last = "[" + last.substring(0, last.length - 1);
last="["+last.substring(0,last.length-1);
//alert(last); //alert(last);
if(last.indexOf("["+pageid+"]")!=-1) if (last.indexOf("[" + pageid + "]") != -1) {
{
//alert("存在"); //alert("存在");
$("#west").show(); $("#west").show();
$("#mainPanle").show(); $("#mainPanle").show();
$("#mm").show(); $("#mm").show();
} }
else else {
{
//alert("不存在"); //alert("不存在");
$("div").remove(); $("div").remove();
$("<div style='width:100%;text-align:center;padding-top:20px'><b>抱歉,您没有该权限!</b></div>").appendTo("body"); $("<div style='width:100%;text-align:center;padding-top:20px'><b>抱歉,您没有该权限!</b></div>").appendTo("body");
} }
} }
if(functions!="") if (functions != "") {
{ functions = "[" + functions.substring(0, functions.length - 1);
functions="["+functions.substring(0,functions.length-1);
//alert(functions); //alert(functions);
} }
if(btnStrList.length>0){ if (btnStrList.length > 0) {
window.winBtnStrList = JSON.stringify(btnStrList); //将按钮功能列表存为全局变量 window.winBtnStrList = JSON.stringify(btnStrList); //将按钮功能列表存为全局变量
} }
} }
//测试自定义hql //测试自定义hql
function ceshi() function ceshi() {
{
$.ajax({ $.ajax({
type:"post", type: "post",
url: "<%=path%>/userBusiness/getceshi.action", url: "<%=path%>/userBusiness/getceshi.action",
data: ({ data: ({
Type:"UserRole" Type: "UserRole"
}), }),
//设置为同步 //设置为同步
async:false, async: false,
dataType: "json", dataType: "json",
success: function (systemInfo) success: function (systemInfo) {
{ if (systemInfo) {
if(systemInfo)
{
userBusinessList = systemInfo.showModel.map.userBusinessList; userBusinessList = systemInfo.showModel.map.userBusinessList;
var msgTip = systemInfo.showModel.msgTip; var msgTip = systemInfo.showModel.msgTip;
if(msgTip == "exceptoin") if (msgTip == "exceptoin") {
{ $.messager.alert('提示', '查找UserBusiness异常,请与管理员联系!', 'error');
$.messager.alert('提示','查找UserBusiness异常,请与管理员联系!','error');
return; return;
} }
} }
else else {
{ userBusinessList = null;
userBusinessList=null;
} }
} }
}); });
if(userBusinessList !=null) if (userBusinessList != null) {
{ if (userBusinessList.length > 0) {
if(userBusinessList.length>0)
{
alert(userBusinessList[0][0]); alert(userBusinessList[0][0]);
alert(userBusinessList[0][1]); alert(userBusinessList[0][1]);
} }
} }
} }
</script> </script>
<div region="west" hide="true" split="true" title="导航菜单" style="width:125px;" id="west"> <div region="west" hide="true" split="true" title="导航菜单" style="width:125px;" id="west">
<div id="nav" fit="true" border="false"> <div id="nav" fit="true" border="false">
<!-- 导航内容 --> <!-- 导航内容 -->
<div> <div>
<ul id="tt"></ul> <ul id="tt"></ul>
<script> <script>
var PNumber = getUrlParam('appID'); //获取传值appid var PNumber = getUrlParam('appID'); //获取传值appid
$(function(){ $(function () {
$('#tt').tree({ $('#tt').tree({
url:'<%=path%>/functions/findMenu.action?PNumber='+PNumber+'&hasFunctions='+functions, url: '<%=path%>/functions/findMenu.action?PNumber=' + PNumber + '&hasFunctions=' + functions,
animate:true animate: true
}); });
}); });
</script> </script>
</div> </div>
</div> </div>
</div> </div>
<div id="mainPanle" region="center" style="background: #eee; overflow-y: hidden"> <div id="mainPanle" region="center" style="background: #eee; overflow-y: hidden">
<div id="tabs" class="easyui-tabs" fit="true" border="false"></div> <div id="tabs" class="easyui-tabs" fit="true" border="false"></div>
</div> </div>
<div id="mm" class="easyui-menu" style="width: 120px;"> <div id="mm" class="easyui-menu" style="width: 120px;">
<div id="mm-tabupdate"> <div id="mm-tabupdate">
刷新 刷新
</div> </div>
@@ -249,6 +232,6 @@ function ceshi()
<div id="mm-version"> <div id="mm-version">
华夏ERP官网 华夏ERP官网
</div> </div>
</div> </div>
</body> </body>
</html> </html>

View File

@@ -1,34 +1,32 @@
<%@page import="com.jsh.util.Tools"%> <%@page import="com.jsh.util.Tools" %>
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%> <%@ page language="java" pageEncoding="utf-8" %>
<% <%
String path = request.getContextPath(); String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/"; String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + path + "/";
String clientIp = Tools.getLocalIp(request); String clientIp = Tools.getLocalIp(request);
%> %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <!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"> <html xmlns="http://www.w3.org/1999/xhtml">
<head> <head>
<title>资产管理</title> <title>资产管理</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<!-- 指定以IE8的方式来渲染 --> <!-- 指定以IE8的方式来渲染 -->
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE8"/> <meta http-equiv="X-UA-Compatible" content="IE=EmulateIE8"/>
<link rel="shortcut icon" href="<%=path%>/images/favicon.ico" type="image/x-icon" /> <link rel="shortcut icon" href="<%=path%>/images/favicon.ico" type="image/x-icon"/>
<link type="text/css" rel="stylesheet" href="<%=path %>/css/css.css" /> <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/jquery-1.8.0.min.js"></script>
</head> </head>
<body> <body>
<script type="text/javascript"> <script type="text/javascript">
//初始化界面 //初始化界面
$(function() $(function () {
{
init(); init();
}); });
function init() function init() {
{
} }
</script> </script>
</body> </body>
</html> </html>

View File

@@ -1,20 +1,20 @@
<%@page import="com.jsh.util.Tools"%> <%@page import="com.jsh.util.Tools" %>
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%> <%@ page language="java" pageEncoding="utf-8" %>
<% <%
String path = request.getContextPath(); String path = request.getContextPath();
String clientIp = Tools.getLocalIp(request); String clientIp = Tools.getLocalIp(request);
%> %>
<!DOCTYPE html> <!DOCTYPE html>
<html> <html>
<head> <head>
<title>收预付款</title> <title>收预付款</title>
<meta charset="utf-8"> <meta charset="utf-8">
<!-- 指定以IE8的方式来渲染 --> <!-- 指定以IE8的方式来渲染 -->
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE8"/> <meta http-equiv="X-UA-Compatible" content="IE=EmulateIE8"/>
<link rel="shortcut icon" href="<%=path%>/images/favicon.ico" type="image/x-icon" /> <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/default/easyui.css"/>
<link rel="stylesheet" type="text/css" href="<%=path %>/js/easyui-1.3.5/themes/icon.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" /> <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/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/jquery.easyui.min.js"></script>
<script src="<%=path %>/js/easyui-1.3.5/locale/easyui-lang-zh_CN.js"></script> <script src="<%=path %>/js/easyui-1.3.5/locale/easyui-lang-zh_CN.js"></script>
@@ -26,10 +26,11 @@
var path = "<%=path%>"; var path = "<%=path%>";
var clientIp = "<%=clientIp%>"; var clientIp = "<%=clientIp%>";
</script> </script>
</head> </head>
<body> <body>
<!-- 查询 --> <!-- 查询 -->
<div id = "searchPanel" class="easyui-panel" style="padding:3px;" title="查询窗口" iconCls="icon-search" collapsible="true" closable="false"> <div id="searchPanel" class="easyui-panel" style="padding:3px;" title="查询窗口" iconCls="icon-search" collapsible="true"
closable="false">
<table id="searchTable"> <table id="searchTable">
<tr> <tr>
<td>单据编号:</td> <td>单据编号:</td>
@@ -38,11 +39,13 @@
</td> </td>
<td>单据日期:</td> <td>单据日期:</td>
<td> <td>
<input type="text" name="searchBeginTime" id="searchBeginTime" onClick="WdatePicker({dateFmt:'yyyy-MM-dd'})" class="txt Wdate" style="width:100px;"/> <input type="text" name="searchBeginTime" id="searchBeginTime"
onClick="WdatePicker({dateFmt:'yyyy-MM-dd'})" class="txt Wdate" style="width:100px;"/>
</td> </td>
<td>-</td> <td>-</td>
<td> <td>
<input type="text" name="searchEndTime" id="searchEndTime" onClick="WdatePicker({dateFmt:'yyyy-MM-dd'})" class="txt Wdate" style="width:100px;"/> <input type="text" name="searchEndTime" id="searchEndTime" onClick="WdatePicker({dateFmt:'yyyy-MM-dd'})"
class="txt Wdate" style="width:100px;"/>
</td> </td>
<td>&nbsp;</td> <td>&nbsp;</td>
<td> <td>
@@ -51,14 +54,15 @@
</td> </td>
</tr> </tr>
</table> </table>
</div> </div>
<!-- 数据显示table --> <!-- 数据显示table -->
<div id = "tablePanel" class="easyui-panel" style="padding:1px;top:300px;" title="收预付款列表" iconCls="icon-list" collapsible="true" closable="false"> <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> <table id="tableData" style="top:300px;border-bottom-color:#FFFFFF"></table>
</div> </div>
<div id="accountHeadDlg" class="easyui-dialog" style="width:1200px;padding:10px 20px;top:20px" <div id="accountHeadDlg" class="easyui-dialog" style="width:1200px;padding:10px 20px;top:20px"
closed="true" buttons="#dlg-buttons" modal="true" cache="false" collapsible="false" closable="true"> closed="true" buttons="#dlg-buttons" modal="true" cache="false" collapsible="false" closable="true">
<form id="accountHeadFM" method="post" novalidate> <form id="accountHeadFM" method="post" novalidate>
<table> <table>
@@ -73,11 +77,14 @@
</td> </td>
<td style="width:70px;">单据日期:</td> <td style="width:70px;">单据日期:</td>
<td style="padding:5px;width:170px;"> <td style="padding:5px;width:170px;">
<input type="text" name="BillTime" id="BillTime" onClick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'})" class="txt Wdate" style="width:140px;"/> <input type="text" name="BillTime" id="BillTime"
onClick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'})" class="txt Wdate"
style="width:140px;"/>
</td> </td>
<td style="width:80px;">单据编号:</td> <td style="width:80px;">单据编号:</td>
<td style="padding:5px;width:170px;"> <td style="padding:5px;width:170px;">
<input name="BillNo" id="BillNo" class="easyui-validatebox" data-options="required:true,validType:'length[2,30]'" style="width: 140px;"/> <input name="BillNo" id="BillNo" class="easyui-validatebox"
data-options="required:true,validType:'length[2,30]'" style="width: 140px;"/>
</td> </td>
<td style="width:100px;"></td> <td style="width:100px;"></td>
</tr> </tr>
@@ -89,24 +96,27 @@
</tr> </tr>
<tr> <tr>
<td colspan="9"> <td colspan="9">
<textarea name="Remark" id="Remark" rows="2" cols="2" placeholder="暂无备注信息" style="width: 1130px; height:35px;"></textarea> <textarea name="Remark" id="Remark" rows="2" cols="2" placeholder="暂无备注信息"
style="width: 1130px; height:35px;"></textarea>
</td> </td>
</tr> </tr>
<tr> <tr>
<td>优惠金额:</td> <td>优惠金额:</td>
<td style="padding:5px"> <td style="padding:5px">
<input type="text" name="ChangeAmount" id="ChangeAmount" class="easyui-numberbox" data-options="min:0,precision:2" style="width: 110px;" /> <input type="text" name="ChangeAmount" id="ChangeAmount" class="easyui-numberbox"
data-options="min:0,precision:2" style="width: 110px;"/>
</td> </td>
</tr> </tr>
</table> </table>
<input type="hidden" name="clientIp" id="clientIp" value="<%=clientIp %>"/> <input type="hidden" name="clientIp" id="clientIp" value="<%=clientIp %>"/>
</form> </form>
</div> </div>
<div id="dlg-buttons"> <div id="dlg-buttons">
<a href="javascript:void(0)" id="saveAccountHead" class="easyui-linkbutton" iconCls="icon-ok">保存</a> <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> <a href="javascript:void(0)" id="cancelAccountHead" class="easyui-linkbutton" iconCls="icon-cancel"
</div> onclick="javascript:$('#accountHeadDlg').dialog('close')">取消</a>
<div id="accountHeadDlgShow" class="easyui-dialog" style="width:1200px;padding:10px 20px;top:20px" </div>
<div id="accountHeadDlgShow" class="easyui-dialog" style="width:1200px;padding:10px 20px;top:20px"
closed="true" modal="true" cache="false" collapsible="false" closable="true"> closed="true" modal="true" cache="false" collapsible="false" closable="true">
<table> <table>
<tr> <tr>
@@ -147,6 +157,6 @@
</td> </td>
</tr> </tr>
</table> </table>
</div> </div>
</body> </body>
</html> </html>

View File

@@ -1,20 +1,20 @@
<%@page import="com.jsh.util.Tools"%> <%@page import="com.jsh.util.Tools" %>
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%> <%@ page language="java" pageEncoding="utf-8" %>
<% <%
String path = request.getContextPath(); String path = request.getContextPath();
String clientIp = Tools.getLocalIp(request); String clientIp = Tools.getLocalIp(request);
%> %>
<!DOCTYPE html> <!DOCTYPE html>
<html> <html>
<head> <head>
<title>转账单</title> <title>转账单</title>
<meta charset="utf-8"> <meta charset="utf-8">
<!-- 指定以IE8的方式来渲染 --> <!-- 指定以IE8的方式来渲染 -->
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE8"/> <meta http-equiv="X-UA-Compatible" content="IE=EmulateIE8"/>
<link rel="shortcut icon" href="<%=path%>/images/favicon.ico" type="image/x-icon" /> <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/default/easyui.css"/>
<link rel="stylesheet" type="text/css" href="<%=path %>/js/easyui-1.3.5/themes/icon.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" /> <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/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/jquery.easyui.min.js"></script>
<script src="<%=path %>/js/easyui-1.3.5/locale/easyui-lang-zh_CN.js"></script> <script src="<%=path %>/js/easyui-1.3.5/locale/easyui-lang-zh_CN.js"></script>
@@ -26,10 +26,11 @@
var path = "<%=path%>"; var path = "<%=path%>";
var clientIp = "<%=clientIp%>"; var clientIp = "<%=clientIp%>";
</script> </script>
</head> </head>
<body> <body>
<!-- 查询 --> <!-- 查询 -->
<div id = "searchPanel" class="easyui-panel" style="padding:3px;" title="查询窗口" iconCls="icon-search" collapsible="true" closable="false"> <div id="searchPanel" class="easyui-panel" style="padding:3px;" title="查询窗口" iconCls="icon-search" collapsible="true"
closable="false">
<table id="searchTable"> <table id="searchTable">
<tr> <tr>
<td>单据编号:</td> <td>单据编号:</td>
@@ -38,11 +39,13 @@
</td> </td>
<td>单据日期:</td> <td>单据日期:</td>
<td> <td>
<input type="text" name="searchBeginTime" id="searchBeginTime" onClick="WdatePicker({dateFmt:'yyyy-MM-dd'})" class="txt Wdate" style="width:100px;"/> <input type="text" name="searchBeginTime" id="searchBeginTime"
onClick="WdatePicker({dateFmt:'yyyy-MM-dd'})" class="txt Wdate" style="width:100px;"/>
</td> </td>
<td>-</td> <td>-</td>
<td> <td>
<input type="text" name="searchEndTime" id="searchEndTime" onClick="WdatePicker({dateFmt:'yyyy-MM-dd'})" class="txt Wdate" style="width:100px;"/> <input type="text" name="searchEndTime" id="searchEndTime" onClick="WdatePicker({dateFmt:'yyyy-MM-dd'})"
class="txt Wdate" style="width:100px;"/>
</td> </td>
<td>&nbsp;</td> <td>&nbsp;</td>
<td> <td>
@@ -51,14 +54,15 @@
</td> </td>
</tr> </tr>
</table> </table>
</div> </div>
<!-- 数据显示table --> <!-- 数据显示table -->
<div id = "tablePanel" class="easyui-panel" style="padding:1px;top:300px;" title="转账单列表" iconCls="icon-list" collapsible="true" closable="false"> <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> <table id="tableData" style="top:300px;border-bottom-color:#FFFFFF"></table>
</div> </div>
<div id="accountHeadDlg" class="easyui-dialog" style="width:1200px;padding:10px 20px;top:20px" <div id="accountHeadDlg" class="easyui-dialog" style="width:1200px;padding:10px 20px;top:20px"
closed="true" buttons="#dlg-buttons" modal="true" cache="false" collapsible="false" closable="true"> closed="true" buttons="#dlg-buttons" modal="true" cache="false" collapsible="false" closable="true">
<form id="accountHeadFM" method="post" novalidate> <form id="accountHeadFM" method="post" novalidate>
<table> <table>
@@ -69,11 +73,14 @@
</td> </td>
<td style="width:70px;">单据日期:</td> <td style="width:70px;">单据日期:</td>
<td style="padding:5px;width:170px;"> <td style="padding:5px;width:170px;">
<input type="text" name="BillTime" id="BillTime" onClick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'})" class="txt Wdate" style="width:140px;"/> <input type="text" name="BillTime" id="BillTime"
onClick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'})" class="txt Wdate"
style="width:140px;"/>
</td> </td>
<td style="width:80px;">单据编号:</td> <td style="width:80px;">单据编号:</td>
<td style="padding:5px;width:170px;"> <td style="padding:5px;width:170px;">
<input name="BillNo" id="BillNo" class="easyui-validatebox" data-options="required:true,validType:'length[2,30]'" style="width: 140px;"/> <input name="BillNo" id="BillNo" class="easyui-validatebox"
data-options="required:true,validType:'length[2,30]'" style="width: 140px;"/>
</td> </td>
<td style="width:70px;"></td> <td style="width:70px;"></td>
<td style="padding:5px"> <td style="padding:5px">
@@ -88,7 +95,8 @@
</tr> </tr>
<tr> <tr>
<td colspan="9"> <td colspan="9">
<textarea name="Remark" id="Remark" rows="2" cols="2" placeholder="暂无备注信息" style="width: 1130px; height:35px;"></textarea> <textarea name="Remark" id="Remark" rows="2" cols="2" placeholder="暂无备注信息"
style="width: 1130px; height:35px;"></textarea>
</td> </td>
</tr> </tr>
<tr> <tr>
@@ -98,18 +106,20 @@
</td> </td>
<td>实付金额:</td> <td>实付金额:</td>
<td style="padding:5px"> <td style="padding:5px">
<input type="text" name="ChangeAmount" id="ChangeAmount" class="easyui-numberbox" data-options="min:0,precision:2" style="width: 110px;"></input> <input type="text" name="ChangeAmount" id="ChangeAmount" class="easyui-numberbox"
data-options="min:0,precision:2" style="width: 110px;"></input>
</td> </td>
</tr> </tr>
</table> </table>
<input type="hidden" name="clientIp" id="clientIp" value="<%=clientIp %>"/> <input type="hidden" name="clientIp" id="clientIp" value="<%=clientIp %>"/>
</form> </form>
</div> </div>
<div id="dlg-buttons"> <div id="dlg-buttons">
<a href="javascript:void(0)" id="saveAccountHead" class="easyui-linkbutton" iconCls="icon-ok">保存</a> <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> <a href="javascript:void(0)" id="cancelAccountHead" class="easyui-linkbutton" iconCls="icon-cancel"
</div> onclick="javascript:$('#accountHeadDlg').dialog('close')">取消</a>
<div id="accountHeadDlgShow" class="easyui-dialog" style="width:1200px;padding:10px 20px;top:20px" </div>
<div id="accountHeadDlgShow" class="easyui-dialog" style="width:1200px;padding:10px 20px;top:20px"
closed="true" modal="true" cache="false" collapsible="false" closable="true"> closed="true" modal="true" cache="false" collapsible="false" closable="true">
<table> <table>
<tr> <tr>
@@ -152,6 +162,6 @@
</td> </td>
</tr> </tr>
</table> </table>
</div> </div>
</body> </body>
</html> </html>

View File

@@ -1,20 +1,20 @@
<%@page import="com.jsh.util.Tools"%> <%@page import="com.jsh.util.Tools" %>
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%> <%@ page language="java" pageEncoding="utf-8" %>
<% <%
String path = request.getContextPath(); String path = request.getContextPath();
String clientIp = Tools.getLocalIp(request); String clientIp = Tools.getLocalIp(request);
%> %>
<!DOCTYPE html> <!DOCTYPE html>
<html> <html>
<head> <head>
<title>收入单</title> <title>收入单</title>
<meta charset="utf-8"> <meta charset="utf-8">
<!-- 指定以IE8的方式来渲染 --> <!-- 指定以IE8的方式来渲染 -->
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE8"/> <meta http-equiv="X-UA-Compatible" content="IE=EmulateIE8"/>
<link rel="shortcut icon" href="<%=path%>/images/favicon.ico" type="image/x-icon" /> <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/default/easyui.css"/>
<link rel="stylesheet" type="text/css" href="<%=path %>/js/easyui-1.3.5/themes/icon.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" /> <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/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/jquery.easyui.min.js"></script>
<script src="<%=path %>/js/easyui-1.3.5/locale/easyui-lang-zh_CN.js"></script> <script src="<%=path %>/js/easyui-1.3.5/locale/easyui-lang-zh_CN.js"></script>
@@ -26,10 +26,11 @@
var path = "<%=path%>"; var path = "<%=path%>";
var clientIp = "<%=clientIp%>"; var clientIp = "<%=clientIp%>";
</script> </script>
</head> </head>
<body> <body>
<!-- 查询 --> <!-- 查询 -->
<div id = "searchPanel" class="easyui-panel" style="padding:3px;" title="查询窗口" iconCls="icon-search" collapsible="true" closable="false"> <div id="searchPanel" class="easyui-panel" style="padding:3px;" title="查询窗口" iconCls="icon-search" collapsible="true"
closable="false">
<table id="searchTable"> <table id="searchTable">
<tr> <tr>
<td>单据编号:</td> <td>单据编号:</td>
@@ -38,11 +39,13 @@
</td> </td>
<td>单据日期:</td> <td>单据日期:</td>
<td> <td>
<input type="text" name="searchBeginTime" id="searchBeginTime" onClick="WdatePicker({dateFmt:'yyyy-MM-dd'})" class="txt Wdate" style="width:100px;"/> <input type="text" name="searchBeginTime" id="searchBeginTime"
onClick="WdatePicker({dateFmt:'yyyy-MM-dd'})" class="txt Wdate" style="width:100px;"/>
</td> </td>
<td>-</td> <td>-</td>
<td> <td>
<input type="text" name="searchEndTime" id="searchEndTime" onClick="WdatePicker({dateFmt:'yyyy-MM-dd'})" class="txt Wdate" style="width:100px;"/> <input type="text" name="searchEndTime" id="searchEndTime" onClick="WdatePicker({dateFmt:'yyyy-MM-dd'})"
class="txt Wdate" style="width:100px;"/>
</td> </td>
<td>&nbsp;</td> <td>&nbsp;</td>
<td> <td>
@@ -51,14 +54,15 @@
</td> </td>
</tr> </tr>
</table> </table>
</div> </div>
<!-- 数据显示table --> <!-- 数据显示table -->
<div id = "tablePanel" class="easyui-panel" style="padding:1px;top:300px;" title="收入单列表" iconCls="icon-list" collapsible="true" closable="false"> <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> <table id="tableData" style="top:300px;border-bottom-color:#FFFFFF"></table>
</div> </div>
<div id="accountHeadDlg" class="easyui-dialog" style="width:1200px;padding:10px 20px;top:20px" <div id="accountHeadDlg" class="easyui-dialog" style="width:1200px;padding:10px 20px;top:20px"
closed="true" buttons="#dlg-buttons" modal="true" cache="false" collapsible="false" closable="true"> closed="true" buttons="#dlg-buttons" modal="true" cache="false" collapsible="false" closable="true">
<form id="accountHeadFM" method="post" novalidate> <form id="accountHeadFM" method="post" novalidate>
<table> <table>
@@ -73,11 +77,14 @@
</td> </td>
<td style="width:70px;">单据日期:</td> <td style="width:70px;">单据日期:</td>
<td style="padding:5px;width:170px;"> <td style="padding:5px;width:170px;">
<input type="text" name="BillTime" id="BillTime" onClick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'})" class="txt Wdate" style="width:140px;"/> <input type="text" name="BillTime" id="BillTime"
onClick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'})" class="txt Wdate"
style="width:140px;"/>
</td> </td>
<td style="width:70px;">单据编号:</td> <td style="width:70px;">单据编号:</td>
<td style="padding:5px;width:170px;"> <td style="padding:5px;width:170px;">
<input name="BillNo" id="BillNo" class="easyui-validatebox" data-options="required:true,validType:'length[2,30]'" style="width: 140px;"/> <input name="BillNo" id="BillNo" class="easyui-validatebox"
data-options="required:true,validType:'length[2,30]'" style="width: 140px;"/>
</td> </td>
<td style="width:100px;"></td> <td style="width:100px;"></td>
</tr> </tr>
@@ -89,7 +96,8 @@
</tr> </tr>
<tr> <tr>
<td colspan="9"> <td colspan="9">
<textarea name="Remark" id="Remark" rows="2" cols="2" placeholder="暂无备注信息" style="width: 1130px; height:35px;"></textarea> <textarea name="Remark" id="Remark" rows="2" cols="2" placeholder="暂无备注信息"
style="width: 1130px; height:35px;"></textarea>
</td> </td>
</tr> </tr>
<tr> <tr>
@@ -99,18 +107,20 @@
</td> </td>
<td>收款金额:</td> <td>收款金额:</td>
<td> <td>
<input type="text" name="ChangeAmount" id="ChangeAmount" class="easyui-numberbox" data-options="min:0,precision:2" style="width: 120px;" /> <input type="text" name="ChangeAmount" id="ChangeAmount" class="easyui-numberbox"
data-options="min:0,precision:2" style="width: 120px;"/>
</td> </td>
</tr> </tr>
</table> </table>
<input type="hidden" name="clientIp" id="clientIp" value="<%=clientIp %>"/> <input type="hidden" name="clientIp" id="clientIp" value="<%=clientIp %>"/>
</form> </form>
</div> </div>
<div id="dlg-buttons"> <div id="dlg-buttons">
<a href="javascript:void(0)" id="saveAccountHead" class="easyui-linkbutton" iconCls="icon-ok">保存</a> <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> <a href="javascript:void(0)" id="cancelAccountHead" class="easyui-linkbutton" iconCls="icon-cancel"
</div> onclick="javascript:$('#accountHeadDlg').dialog('close')">取消</a>
<div id="accountHeadDlgShow" class="easyui-dialog" style="width:1200px;padding:10px 20px;top:20px" </div>
<div id="accountHeadDlgShow" class="easyui-dialog" style="width:1200px;padding:10px 20px;top:20px"
closed="true" modal="true" cache="false" collapsible="false" closable="true"> closed="true" modal="true" cache="false" collapsible="false" closable="true">
<table> <table>
<tr> <tr>
@@ -155,6 +165,6 @@
</td> </td>
</tr> </tr>
</table> </table>
</div> </div>
</body> </body>
</html> </html>

View File

@@ -1,20 +1,20 @@
<%@page import="com.jsh.util.Tools"%> <%@page import="com.jsh.util.Tools" %>
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%> <%@ page language="java" pageEncoding="utf-8" %>
<% <%
String path = request.getContextPath(); String path = request.getContextPath();
String clientIp = Tools.getLocalIp(request); String clientIp = Tools.getLocalIp(request);
%> %>
<!DOCTYPE html> <!DOCTYPE html>
<html> <html>
<head> <head>
<title>支出单</title> <title>支出单</title>
<meta charset="utf-8"> <meta charset="utf-8">
<!-- 指定以IE8的方式来渲染 --> <!-- 指定以IE8的方式来渲染 -->
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE8"/> <meta http-equiv="X-UA-Compatible" content="IE=EmulateIE8"/>
<link rel="shortcut icon" href="<%=path%>/images/favicon.ico" type="image/x-icon" /> <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/default/easyui.css"/>
<link rel="stylesheet" type="text/css" href="<%=path %>/js/easyui-1.3.5/themes/icon.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" /> <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/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/jquery.easyui.min.js"></script>
<script src="<%=path %>/js/easyui-1.3.5/locale/easyui-lang-zh_CN.js"></script> <script src="<%=path %>/js/easyui-1.3.5/locale/easyui-lang-zh_CN.js"></script>
@@ -26,10 +26,11 @@
var path = "<%=path%>"; var path = "<%=path%>";
var clientIp = "<%=clientIp%>"; var clientIp = "<%=clientIp%>";
</script> </script>
</head> </head>
<body> <body>
<!-- 查询 --> <!-- 查询 -->
<div id = "searchPanel" class="easyui-panel" style="padding:3px;" title="查询窗口" iconCls="icon-search" collapsible="true" closable="false"> <div id="searchPanel" class="easyui-panel" style="padding:3px;" title="查询窗口" iconCls="icon-search" collapsible="true"
closable="false">
<table id="searchTable"> <table id="searchTable">
<tr> <tr>
<td>单据编号:</td> <td>单据编号:</td>
@@ -38,11 +39,13 @@
</td> </td>
<td>单据日期:</td> <td>单据日期:</td>
<td> <td>
<input type="text" name="searchBeginTime" id="searchBeginTime" onClick="WdatePicker({dateFmt:'yyyy-MM-dd'})" class="txt Wdate" style="width:100px;"/> <input type="text" name="searchBeginTime" id="searchBeginTime"
onClick="WdatePicker({dateFmt:'yyyy-MM-dd'})" class="txt Wdate" style="width:100px;"/>
</td> </td>
<td>-</td> <td>-</td>
<td> <td>
<input type="text" name="searchEndTime" id="searchEndTime" onClick="WdatePicker({dateFmt:'yyyy-MM-dd'})" class="txt Wdate" style="width:100px;"/> <input type="text" name="searchEndTime" id="searchEndTime" onClick="WdatePicker({dateFmt:'yyyy-MM-dd'})"
class="txt Wdate" style="width:100px;"/>
</td> </td>
<td>&nbsp;</td> <td>&nbsp;</td>
<td> <td>
@@ -51,14 +54,15 @@
</td> </td>
</tr> </tr>
</table> </table>
</div> </div>
<!-- 数据显示table --> <!-- 数据显示table -->
<div id = "tablePanel" class="easyui-panel" style="padding:1px;top:300px;" title="支出单列表" iconCls="icon-list" collapsible="true" closable="false"> <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> <table id="tableData" style="top:300px;border-bottom-color:#FFFFFF"></table>
</div> </div>
<div id="accountHeadDlg" class="easyui-dialog" style="width:1200px;padding:10px 20px;top:20px" <div id="accountHeadDlg" class="easyui-dialog" style="width:1200px;padding:10px 20px;top:20px"
closed="true" buttons="#dlg-buttons" modal="true" cache="false" collapsible="false" closable="true"> closed="true" buttons="#dlg-buttons" modal="true" cache="false" collapsible="false" closable="true">
<form id="accountHeadFM" method="post" novalidate> <form id="accountHeadFM" method="post" novalidate>
<table> <table>
@@ -69,11 +73,14 @@
</td> </td>
<td style="width:70px;">单据日期:</td> <td style="width:70px;">单据日期:</td>
<td style="padding:5px;width:170px;"> <td style="padding:5px;width:170px;">
<input type="text" name="BillTime" id="BillTime" onClick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'})" class="txt Wdate" style="width:140px;"/> <input type="text" name="BillTime" id="BillTime"
onClick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'})" class="txt Wdate"
style="width:140px;"/>
</td> </td>
<td style="width:70px;">单据编号:</td> <td style="width:70px;">单据编号:</td>
<td style="padding:5px;width:170px;"> <td style="padding:5px;width:170px;">
<input name="BillNo" id="BillNo" class="easyui-validatebox" data-options="required:true,validType:'length[2,30]'" style="width: 140px;"/> <input name="BillNo" id="BillNo" class="easyui-validatebox"
data-options="required:true,validType:'length[2,30]'" style="width: 140px;"/>
</td> </td>
<td style="width:70px;"></td> <td style="width:70px;"></td>
<td style="padding:5px"> <td style="padding:5px">
@@ -88,7 +95,8 @@
</tr> </tr>
<tr> <tr>
<td colspan="9"> <td colspan="9">
<textarea name="Remark" id="Remark" rows="2" cols="2" placeholder="暂无备注信息" style="width: 1130px; height:35px;"></textarea> <textarea name="Remark" id="Remark" rows="2" cols="2" placeholder="暂无备注信息"
style="width: 1130px; height:35px;"></textarea>
</td> </td>
</tr> </tr>
<tr> <tr>
@@ -98,18 +106,20 @@
</td> </td>
<td>付款金额:</td> <td>付款金额:</td>
<td> <td>
<input type="text" name="ChangeAmount" id="ChangeAmount" class="easyui-numberbox" data-options="min:0,precision:2" style="width: 120px;" /> <input type="text" name="ChangeAmount" id="ChangeAmount" class="easyui-numberbox"
data-options="min:0,precision:2" style="width: 120px;"/>
</td> </td>
</tr> </tr>
</table> </table>
<input type="hidden" name="clientIp" id="clientIp" value="<%=clientIp %>"/> <input type="hidden" name="clientIp" id="clientIp" value="<%=clientIp %>"/>
</form> </form>
</div> </div>
<div id="dlg-buttons"> <div id="dlg-buttons">
<a href="javascript:void(0)" id="saveAccountHead" class="easyui-linkbutton" iconCls="icon-ok">保存</a> <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> <a href="javascript:void(0)" id="cancelAccountHead" class="easyui-linkbutton" iconCls="icon-cancel"
</div> onclick="javascript:$('#accountHeadDlg').dialog('close')">取消</a>
<div id="accountHeadDlgShow" class="easyui-dialog" style="width:1200px;padding:10px 20px;top:20px" </div>
<div id="accountHeadDlgShow" class="easyui-dialog" style="width:1200px;padding:10px 20px;top:20px"
closed="true" modal="true" cache="false" collapsible="false" closable="true"> closed="true" modal="true" cache="false" collapsible="false" closable="true">
<table> <table>
<tr> <tr>
@@ -152,6 +162,6 @@
</td> </td>
</tr> </tr>
</table> </table>
</div> </div>
</body> </body>
</html> </html>

View File

@@ -1,20 +1,20 @@
<%@page import="com.jsh.util.Tools"%> <%@page import="com.jsh.util.Tools" %>
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%> <%@ page language="java" pageEncoding="utf-8" %>
<% <%
String path = request.getContextPath(); String path = request.getContextPath();
String clientIp = Tools.getLocalIp(request); String clientIp = Tools.getLocalIp(request);
%> %>
<!DOCTYPE html> <!DOCTYPE html>
<html> <html>
<head> <head>
<title>收款单</title> <title>收款单</title>
<meta charset="utf-8"> <meta charset="utf-8">
<!-- 指定以IE8的方式来渲染 --> <!-- 指定以IE8的方式来渲染 -->
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE8"/> <meta http-equiv="X-UA-Compatible" content="IE=EmulateIE8"/>
<link rel="shortcut icon" href="<%=path%>/images/favicon.ico" type="image/x-icon" /> <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/default/easyui.css"/>
<link rel="stylesheet" type="text/css" href="<%=path %>/js/easyui-1.3.5/themes/icon.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" /> <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/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/jquery.easyui.min.js"></script>
<script src="<%=path %>/js/easyui-1.3.5/locale/easyui-lang-zh_CN.js"></script> <script src="<%=path %>/js/easyui-1.3.5/locale/easyui-lang-zh_CN.js"></script>
@@ -26,10 +26,11 @@
var path = "<%=path%>"; var path = "<%=path%>";
var clientIp = "<%=clientIp%>"; var clientIp = "<%=clientIp%>";
</script> </script>
</head> </head>
<body> <body>
<!-- 查询 --> <!-- 查询 -->
<div id = "searchPanel" class="easyui-panel" style="padding:3px;" title="查询窗口" iconCls="icon-search" collapsible="true" closable="false"> <div id="searchPanel" class="easyui-panel" style="padding:3px;" title="查询窗口" iconCls="icon-search" collapsible="true"
closable="false">
<table id="searchTable"> <table id="searchTable">
<tr> <tr>
<td>单据编号:</td> <td>单据编号:</td>
@@ -38,11 +39,13 @@
</td> </td>
<td>单据日期:</td> <td>单据日期:</td>
<td> <td>
<input type="text" name="searchBeginTime" id="searchBeginTime" onClick="WdatePicker({dateFmt:'yyyy-MM-dd'})" class="txt Wdate" style="width:100px;"/> <input type="text" name="searchBeginTime" id="searchBeginTime"
onClick="WdatePicker({dateFmt:'yyyy-MM-dd'})" class="txt Wdate" style="width:100px;"/>
</td> </td>
<td>-</td> <td>-</td>
<td> <td>
<input type="text" name="searchEndTime" id="searchEndTime" onClick="WdatePicker({dateFmt:'yyyy-MM-dd'})" class="txt Wdate" style="width:100px;"/> <input type="text" name="searchEndTime" id="searchEndTime" onClick="WdatePicker({dateFmt:'yyyy-MM-dd'})"
class="txt Wdate" style="width:100px;"/>
</td> </td>
<td>&nbsp;</td> <td>&nbsp;</td>
<td> <td>
@@ -51,14 +54,15 @@
</td> </td>
</tr> </tr>
</table> </table>
</div> </div>
<!-- 数据显示table --> <!-- 数据显示table -->
<div id = "tablePanel" class="easyui-panel" style="padding:1px;top:300px;" title="收款单列表" iconCls="icon-list" collapsible="true" closable="false"> <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> <table id="tableData" style="top:300px;border-bottom-color:#FFFFFF"></table>
</div> </div>
<div id="accountHeadDlg" class="easyui-dialog" style="width:1200px;padding:10px 20px;top:20px" <div id="accountHeadDlg" class="easyui-dialog" style="width:1200px;padding:10px 20px;top:20px"
closed="true" buttons="#dlg-buttons" modal="true" cache="false" collapsible="false" closable="true"> closed="true" buttons="#dlg-buttons" modal="true" cache="false" collapsible="false" closable="true">
<form id="accountHeadFM" method="post" novalidate> <form id="accountHeadFM" method="post" novalidate>
<table> <table>
@@ -73,11 +77,14 @@
</td> </td>
<td style="width:70px;">单据日期:</td> <td style="width:70px;">单据日期:</td>
<td style="padding:5px;width:170px;"> <td style="padding:5px;width:170px;">
<input type="text" name="BillTime" id="BillTime" onClick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'})" class="txt Wdate" style="width:140px;"/> <input type="text" name="BillTime" id="BillTime"
onClick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'})" class="txt Wdate"
style="width:140px;"/>
</td> </td>
<td style="width:70px;">单据编号:</td> <td style="width:70px;">单据编号:</td>
<td style="padding:5px;width:170px;"> <td style="padding:5px;width:170px;">
<input name="BillNo" id="BillNo" class="easyui-validatebox" data-options="required:true,validType:'length[2,30]'" style="width: 140px;"/> <input name="BillNo" id="BillNo" class="easyui-validatebox"
data-options="required:true,validType:'length[2,30]'" style="width: 140px;"/>
</td> </td>
<td style="width:100px;"></td> <td style="width:100px;"></td>
</tr> </tr>
@@ -89,24 +96,27 @@
</tr> </tr>
<tr> <tr>
<td colspan="9"> <td colspan="9">
<textarea name="Remark" id="Remark" rows="2" cols="2" placeholder="暂无备注信息" style="width: 1130px; height:35px;"></textarea> <textarea name="Remark" id="Remark" rows="2" cols="2" placeholder="暂无备注信息"
style="width: 1130px; height:35px;"></textarea>
</td> </td>
</tr> </tr>
<tr> <tr>
<td>优惠金额:</td> <td>优惠金额:</td>
<td style="padding:5px"> <td style="padding:5px">
<input type="text" name="ChangeAmount" id="ChangeAmount" class="easyui-numberbox" data-options="min:0,precision:2" style="width: 110px;" /> <input type="text" name="ChangeAmount" id="ChangeAmount" class="easyui-numberbox"
data-options="min:0,precision:2" style="width: 110px;"/>
</td> </td>
</tr> </tr>
</table> </table>
<input type="hidden" name="clientIp" id="clientIp" value="<%=clientIp %>"/> <input type="hidden" name="clientIp" id="clientIp" value="<%=clientIp %>"/>
</form> </form>
</div> </div>
<div id="dlg-buttons"> <div id="dlg-buttons">
<a href="javascript:void(0)" id="saveAccountHead" class="easyui-linkbutton" iconCls="icon-ok">保存</a> <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> <a href="javascript:void(0)" id="cancelAccountHead" class="easyui-linkbutton" iconCls="icon-cancel"
</div> onclick="javascript:$('#accountHeadDlg').dialog('close')">取消</a>
<div id="accountHeadDlgShow" class="easyui-dialog" style="width:1200px;padding:10px 20px;top:20px" </div>
<div id="accountHeadDlgShow" class="easyui-dialog" style="width:1200px;padding:10px 20px;top:20px"
closed="true" modal="true" cache="false" collapsible="false" closable="true"> closed="true" modal="true" cache="false" collapsible="false" closable="true">
<table> <table>
<tr> <tr>
@@ -147,6 +157,6 @@
</td> </td>
</tr> </tr>
</table> </table>
</div> </div>
</body> </body>
</html> </html>

View File

@@ -1,20 +1,20 @@
<%@page import="com.jsh.util.Tools"%> <%@page import="com.jsh.util.Tools" %>
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%> <%@ page language="java" pageEncoding="utf-8" %>
<% <%
String path = request.getContextPath(); String path = request.getContextPath();
String clientIp = Tools.getLocalIp(request); String clientIp = Tools.getLocalIp(request);
%> %>
<!DOCTYPE html> <!DOCTYPE html>
<html> <html>
<head> <head>
<title>付款单</title> <title>付款单</title>
<meta charset="utf-8"> <meta charset="utf-8">
<!-- 指定以IE8的方式来渲染 --> <!-- 指定以IE8的方式来渲染 -->
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE8"/> <meta http-equiv="X-UA-Compatible" content="IE=EmulateIE8"/>
<link rel="shortcut icon" href="<%=path%>/images/favicon.ico" type="image/x-icon" /> <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/default/easyui.css"/>
<link rel="stylesheet" type="text/css" href="<%=path %>/js/easyui-1.3.5/themes/icon.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" /> <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/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/jquery.easyui.min.js"></script>
<script src="<%=path %>/js/easyui-1.3.5/locale/easyui-lang-zh_CN.js"></script> <script src="<%=path %>/js/easyui-1.3.5/locale/easyui-lang-zh_CN.js"></script>
@@ -26,10 +26,11 @@
var path = "<%=path%>"; var path = "<%=path%>";
var clientIp = "<%=clientIp%>"; var clientIp = "<%=clientIp%>";
</script> </script>
</head> </head>
<body> <body>
<!-- 查询 --> <!-- 查询 -->
<div id = "searchPanel" class="easyui-panel" style="padding:3px;" title="查询窗口" iconCls="icon-search" collapsible="true" closable="false"> <div id="searchPanel" class="easyui-panel" style="padding:3px;" title="查询窗口" iconCls="icon-search" collapsible="true"
closable="false">
<table id="searchTable"> <table id="searchTable">
<tr> <tr>
<td>单据编号:</td> <td>单据编号:</td>
@@ -38,11 +39,13 @@
</td> </td>
<td>单据日期:</td> <td>单据日期:</td>
<td> <td>
<input type="text" name="searchBeginTime" id="searchBeginTime" onClick="WdatePicker({dateFmt:'yyyy-MM-dd'})" class="txt Wdate" style="width:100px;"/> <input type="text" name="searchBeginTime" id="searchBeginTime"
onClick="WdatePicker({dateFmt:'yyyy-MM-dd'})" class="txt Wdate" style="width:100px;"/>
</td> </td>
<td>-</td> <td>-</td>
<td> <td>
<input type="text" name="searchEndTime" id="searchEndTime" onClick="WdatePicker({dateFmt:'yyyy-MM-dd'})" class="txt Wdate" style="width:100px;"/> <input type="text" name="searchEndTime" id="searchEndTime" onClick="WdatePicker({dateFmt:'yyyy-MM-dd'})"
class="txt Wdate" style="width:100px;"/>
</td> </td>
<td>&nbsp;</td> <td>&nbsp;</td>
<td> <td>
@@ -51,14 +54,15 @@
</td> </td>
</tr> </tr>
</table> </table>
</div> </div>
<!-- 数据显示table --> <!-- 数据显示table -->
<div id = "tablePanel" class="easyui-panel" style="padding:1px;top:300px;" title="付款单列表" iconCls="icon-list" collapsible="true" closable="false"> <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> <table id="tableData" style="top:300px;border-bottom-color:#FFFFFF"></table>
</div> </div>
<div id="accountHeadDlg" class="easyui-dialog" style="width:1200px;padding:10px 20px;top:20px" <div id="accountHeadDlg" class="easyui-dialog" style="width:1200px;padding:10px 20px;top:20px"
closed="true" buttons="#dlg-buttons" modal="true" cache="false" collapsible="false" closable="true"> closed="true" buttons="#dlg-buttons" modal="true" cache="false" collapsible="false" closable="true">
<form id="accountHeadFM" method="post" novalidate> <form id="accountHeadFM" method="post" novalidate>
<table> <table>
@@ -73,11 +77,13 @@
</td> </td>
<td style="width:70px;">单据日期:</td> <td style="width:70px;">单据日期:</td>
<td style="padding:5px;width:170px;"> <td style="padding:5px;width:170px;">
<input type="text" name="BillTime" id="BillTime" onClick="WdatePicker({dateFmt:'yyyy-MM-dd'})" class="txt Wdate" style="width:140px;"/> <input type="text" name="BillTime" id="BillTime" onClick="WdatePicker({dateFmt:'yyyy-MM-dd'})"
class="txt Wdate" style="width:140px;"/>
</td> </td>
<td style="width:70px;">单据编号:</td> <td style="width:70px;">单据编号:</td>
<td style="padding:5px;width:170px;"> <td style="padding:5px;width:170px;">
<input name="BillNo" id="BillNo" class="easyui-validatebox" data-options="required:true,validType:'length[2,30]'" style="width: 140px;"/> <input name="BillNo" id="BillNo" class="easyui-validatebox"
data-options="required:true,validType:'length[2,30]'" style="width: 140px;"/>
</td> </td>
<td style="width:100px;"></td> <td style="width:100px;"></td>
</tr> </tr>
@@ -89,24 +95,27 @@
</tr> </tr>
<tr> <tr>
<td colspan="9"> <td colspan="9">
<textarea name="Remark" id="Remark" rows="2" cols="2" placeholder="暂无备注信息" style="width: 1130px; height:35px;"></textarea> <textarea name="Remark" id="Remark" rows="2" cols="2" placeholder="暂无备注信息"
style="width: 1130px; height:35px;"></textarea>
</td> </td>
</tr> </tr>
<tr> <tr>
<td>优惠金额:</td> <td>优惠金额:</td>
<td style="padding:5px"> <td style="padding:5px">
<input type="text" name="ChangeAmount" id="ChangeAmount" class="easyui-numberbox" data-options="min:0,precision:2" style="width: 110px;" /> <input type="text" name="ChangeAmount" id="ChangeAmount" class="easyui-numberbox"
data-options="min:0,precision:2" style="width: 110px;"/>
</td> </td>
</tr> </tr>
</table> </table>
<input type="hidden" name="clientIp" id="clientIp" value="<%=clientIp %>"/> <input type="hidden" name="clientIp" id="clientIp" value="<%=clientIp %>"/>
</form> </form>
</div> </div>
<div id="dlg-buttons"> <div id="dlg-buttons">
<a href="javascript:void(0)" id="saveAccountHead" class="easyui-linkbutton" iconCls="icon-ok">保存</a> <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> <a href="javascript:void(0)" id="cancelAccountHead" class="easyui-linkbutton" iconCls="icon-cancel"
</div> onclick="javascript:$('#accountHeadDlg').dialog('close')">取消</a>
<div id="accountHeadDlgShow" class="easyui-dialog" style="width:1200px;padding:10px 20px;top:20px" </div>
<div id="accountHeadDlgShow" class="easyui-dialog" style="width:1200px;padding:10px 20px;top:20px"
closed="true" modal="true" cache="false" collapsible="false" closable="true"> closed="true" modal="true" cache="false" collapsible="false" closable="true">
<table> <table>
<tr> <tr>
@@ -147,6 +156,6 @@
</td> </td>
</tr> </tr>
</table> </table>
</div> </div>
</body> </body>
</html> </html>

View File

@@ -1,29 +1,30 @@
<%@page import="com.jsh.util.Tools"%> <%@page import="com.jsh.util.Tools" %>
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%> <%@ page language="java" pageEncoding="utf-8" %>
<% <%
String path = request.getContextPath(); String path = request.getContextPath();
String clientIp = Tools.getLocalIp(request); String clientIp = Tools.getLocalIp(request);
%> %>
<!DOCTYPE html> <!DOCTYPE html>
<html> <html>
<head> <head>
<title>结算账户</title> <title>结算账户</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<!-- 指定以IE8的方式来渲染 --> <!-- 指定以IE8的方式来渲染 -->
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE8"/> <meta http-equiv="X-UA-Compatible" content="IE=EmulateIE8"/>
<link rel="shortcut icon" href="<%=path%>/images/favicon.ico" type="image/x-icon" /> <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/default/easyui.css"/>
<link rel="stylesheet" type="text/css" href="<%=path %>/js/easyui-1.3.5/themes/icon.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" /> <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/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/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/locale/easyui-lang-zh_CN.js"></script>
<script type="text/javascript" src="<%=path %>/js/common/outlook_in.js"></script> <script type="text/javascript" src="<%=path %>/js/common/outlook_in.js"></script>
<script type="text/javascript" src="<%=path %>/js/common/common.js"></script> <script type="text/javascript" src="<%=path %>/js/common/common.js"></script>
</head> </head>
<body> <body>
<!-- 查询 --> <!-- 查询 -->
<div id = "searchPanel" class="easyui-panel" style="padding:10px;" title="查询窗口" iconCls="icon-search" collapsible="true" closable="false"> <div id="searchPanel" class="easyui-panel" style="padding:10px;" title="查询窗口" iconCls="icon-search" collapsible="true"
closable="false">
<table id="searchTable"> <table id="searchTable">
<tr> <tr>
<td>名&nbsp;&nbsp;&nbsp;&nbsp;称:</td> <td>名&nbsp;&nbsp;&nbsp;&nbsp;称:</td>
@@ -51,30 +52,35 @@
</td> </td>
</tr> </tr>
</table> </table>
</div> </div>
<!-- 数据显示table --> <!-- 数据显示table -->
<div id = "tablePanel" class="easyui-panel" style="padding:1px;top:300px;" title="结算账户" iconCls="icon-list" collapsible="true" closable="false"> <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> <table id="tableData" style="top:300px;border-bottom-color:#FFFFFF"></table>
</div> </div>
<div id="accountDlg" class="easyui-dialog" style="width:380px;padding:10px 20px" <div id="accountDlg" class="easyui-dialog" style="width:380px;padding:10px 20px"
closed="true" buttons="#dlg-buttons" modal="true" collapsible="false" closable="true"> closed="true" buttons="#dlg-buttons" modal="true" collapsible="false" closable="true">
<form id="accountFM" method="post" novalidate> <form id="accountFM" method="post" novalidate>
<div class="fitem" style="padding:5px"> <div class="fitem" style="padding:5px">
<label id="nameLabel">名称</label> <label id="nameLabel">名称</label>
<input name="name" id="name" class="easyui-validatebox" data-options="required:true,validType:'length[2,30]'" style="width: 230px;height: 20px"/> <input name="name" id="name" class="easyui-validatebox"
data-options="required:true,validType:'length[2,30]'" style="width: 230px;height: 20px"/>
</div> </div>
<div class="fitem" style="padding:5px"> <div class="fitem" style="padding:5px">
<label id="serialNoLabel">编号</label> <label id="serialNoLabel">编号</label>
<input name="serialNo" id="serialNo" class="easyui-validatebox" data-options="required:true,validType:'length[2,30]'" style="width: 230px;height: 20px"/> <input name="serialNo" id="serialNo" class="easyui-validatebox"
data-options="required:true,validType:'length[2,30]'" style="width: 230px;height: 20px"/>
</div> </div>
<div class="fitem" style="padding:5px"> <div class="fitem" style="padding:5px">
<label id="initialAmountLabel">期初金额</label> <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> <input name="initialAmount" id="initialAmount" type="text" class="easyui-numberbox"
data-options="min:0,precision:2" style="width: 230px;height: 20px"></input>
</div> </div>
<div class="fitem" style="padding:5px"> <div class="fitem" style="padding:5px">
<label id="currentAmountLabel">当前余额</label> <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> <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>
<div class="fitem" style="padding:5px"> <div class="fitem" style="padding:5px">
<label id="remarkLabel">备注</label> <label id="remarkLabel">备注</label>
@@ -82,48 +88,51 @@
</div> </div>
<input type="hidden" name="clientIp" id="clientIp" value="<%=clientIp %>"/> <input type="hidden" name="clientIp" id="clientIp" value="<%=clientIp %>"/>
</form> </form>
</div> </div>
<div id="dlg-buttons"> <div id="dlg-buttons">
<a href="javascript:void(0)" id="saveAccount" class="easyui-linkbutton" iconCls="icon-ok">保存</a> <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> <a href="javascript:void(0)" id="cancelAccount" class="easyui-linkbutton" iconCls="icon-cancel"
</div> onclick="javascript:$('#accountDlg').dialog('close')">取消</a>
<div id="accountDetailListDlg" class="easyui-dialog" style="width:900px;height:500px;padding:10px 20px" closed="true" modal="true" collapsible="false" closable="true"> </div>
<div id="accountDetailListDlg" class="easyui-dialog" style="width:900px;height:500px;padding:10px 20px" closed="true"
modal="true" collapsible="false" closable="true">
<table id="accountTableData" style="top:50px;border-bottom-color:#FFFFFF"></table> <table id="accountTableData" style="top:50px;border-bottom-color:#FFFFFF"></table>
</div> </div>
<script type="text/javascript"> <script type="text/javascript">
//初始化界面 //初始化界面
$(function(){ $(function () {
initTableData(); initTableData();
ininPager(); ininPager();
}); });
//初始化表格数据 //初始化表格数据
function initTableData(){ function initTableData() {
$('#tableData').datagrid({ $('#tableData').datagrid({
height:heightInfo, height: heightInfo,
nowrap: false, nowrap: false,
rownumbers: false, rownumbers: false,
//动画效果 //动画效果
animate:false, animate: false,
//选中单行 //选中单行
singleSelect : true, singleSelect: true,
collapsible:false, collapsible: false,
//交替出现背景 //交替出现背景
striped : true, striped: true,
url:'<%=path %>/account/findBy.action?pageSize=' + initPageSize, url: '<%=path %>/account/findBy.action?pageSize=' + initPageSize,
pagination: true, pagination: true,
pageSize: initPageSize, pageSize: initPageSize,
pageList: initPageNum, pageList: initPageNum,
columns:[[ columns: [[
{ field: 'id',width:35,align:"center",checkbox:true}, {field: 'id', width: 35, align: "center", checkbox: true},
{ title: '名称',field: 'name',width:100}, {title: '名称', field: 'name', width: 100},
{ title: '编号', field: 'serialNo',width:150,align:"center"}, {title: '编号', field: 'serialNo', width: 150, align: "center"},
{ title: '期初金额', field: 'initialAmount',width:100,align:"center"}, {title: '期初金额', field: 'initialAmount', width: 100, align: "center"},
{ title: '当前余额', field: 'currentAmount',width:100,align:"center"}, {title: '当前余额', field: 'currentAmount', width: 100, align: "center"},
{ title: '是否默认', field: 'isDefault',width:100,align:"center", {
formatter:function(value,rec){ title: '是否默认', field: 'isDefault', width: 100, align: "center",
if(rec.isDefault) { formatter: function (value, rec) {
if (rec.isDefault) {
return "<b style='color:green'>是</b>"; return "<b style='color:green'>是</b>";
} }
else { else {
@@ -131,13 +140,12 @@
} }
} }
}, },
{ title: '备注',field: 'remark',width:100}, {title: '备注', field: 'remark', width: 100},
{ title: '操作',field: 'op',align:"center",width:180,formatter:function(value,rec)
{ {
title: '操作', field: 'op', align: "center", width: 180, formatter: function (value, rec) {
var str = ''; var str = '';
var rowInfo = rec.id + 'AaBb' + rec.name +'AaBb' + rec.serialNo +'AaBb' + rec.initialAmount +'AaBb' + rec.currentAmount + 'AaBb'+ rec.remark; var rowInfo = rec.id + 'AaBb' + rec.name + 'AaBb' + rec.serialNo + 'AaBb' + rec.initialAmount + 'AaBb' + rec.currentAmount + 'AaBb' + rec.remark;
if(1 == value) if (1 == value) {
{
str += '<img src="<%=path%>/js/easyui-1.3.5/themes/icons/list.png" style="cursor: pointer;" onclick="showAccountInOutList(\'' + rowInfo + '\');"/>&nbsp;<a onclick="showAccountInOutList(\'' + 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/list.png" style="cursor: pointer;" onclick="showAccountInOutList(\'' + rowInfo + '\');"/>&nbsp;<a onclick="showAccountInOutList(\'' + 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/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/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;'; 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;';
@@ -146,117 +154,105 @@
} }
} }
]], ]],
toolbar:[ toolbar: [
{
id:'addAccount',
text:'增加',
iconCls:'icon-add',
handler:function()
{ {
id: 'addAccount',
text: '增加',
iconCls: 'icon-add',
handler: function () {
addAccount(); addAccount();
} }
}, },
{ {
id:'deleteAccount', id: 'deleteAccount',
text:'删除', text: '删除',
iconCls:'icon-remove', iconCls: 'icon-remove',
handler:function() handler: function () {
{
batDeleteAccount(); batDeleteAccount();
} }
}, },
{ {
id:'setAccountIsDefault', id: 'setAccountIsDefault',
text:'设为默认', text: '设为默认',
iconCls:'icon-ok', iconCls: 'icon-ok',
handler:function() handler: function () {
{
setAccountIsDefault(); setAccountIsDefault();
} }
} }
], ],
onLoadError:function() onLoadError: function () {
{ $.messager.alert('页面加载提示', '页面加载异常,请稍后再试!', 'error');
$.messager.alert('页面加载提示','页面加载异常,请稍后再试!','error');
return; return;
} }
}); });
} }
//初始化键盘enter事件 //初始化键盘enter事件
$(document).keydown(function(event){ $(document).keydown(function (event) {
//兼容 IE和firefox 事件 //兼容 IE和firefox 事件
var e = window.event || event; var e = window.event || event;
var k = e.keyCode||e.which||e.charCode; var k = e.keyCode || e.which || e.charCode;
//兼容 IE,firefox 兼容 //兼容 IE,firefox 兼容
var obj = e.srcElement ? e.srcElement : e.target; var obj = e.srcElement ? e.srcElement : e.target;
//绑定键盘事件为 id是指定的输入框才可以触发键盘事件 13键盘事件 //绑定键盘事件为 id是指定的输入框才可以触发键盘事件 13键盘事件
if(k == "13"&&(obj.id=="name" || obj.id=="serialNo" || obj.id=="initialAmount" || obj.id=="currentAmount" || obj.id=="remark")) if (k == "13" && (obj.id == "name" || obj.id == "serialNo" || obj.id == "initialAmount" || obj.id == "currentAmount" || obj.id == "remark")) {
{
$("#saveAccount").click(); $("#saveAccount").click();
} }
//搜索按钮添加快捷键 //搜索按钮添加快捷键
if(k == "13"&&(obj.id=="searchName" || obj.id=="searchSerialNo" || obj.id=="searchRemark")) if (k == "13" && (obj.id == "searchName" || obj.id == "searchSerialNo" || obj.id == "searchRemark")) {
{
$("#searchBtn").click(); $("#searchBtn").click();
} }
}); });
//分页信息处理 //分页信息处理
function ininPager(){ function ininPager() {
try try {
{
var opts = $("#tableData").datagrid('options'); var opts = $("#tableData").datagrid('options');
var pager = $("#tableData").datagrid('getPager'); var pager = $("#tableData").datagrid('getPager');
pager.pagination({ pager.pagination({
onSelectPage:function(pageNum, pageSize) onSelectPage: function (pageNum, pageSize) {
{
opts.pageNumber = pageNum; opts.pageNumber = pageNum;
opts.pageSize = pageSize; opts.pageSize = pageSize;
pager.pagination('refresh', pager.pagination('refresh',
{ {
pageNumber:pageNum, pageNumber: pageNum,
pageSize:pageSize pageSize: pageSize
}); });
showAccountDetails(pageNum,pageSize); showAccountDetails(pageNum, pageSize);
} }
}); });
} }
catch (e) catch (e) {
{ $.messager.alert('异常处理提示', "分页信息异常 : " + e.name + ": " + e.message, 'error');
$.messager.alert('异常处理提示',"分页信息异常 : " + e.name + ": " + e.message,'error');
} }
} }
//删除结算账户 //删除结算账户
function deleteAccount(accountInfo){ function deleteAccount(accountInfo) {
$.messager.confirm('删除确认','确定要删除此结算账户吗?',function(r) $.messager.confirm('删除确认', '确定要删除此结算账户吗?', function (r) {
{ if (r) {
if (r)
{
var accountTotalInfo = accountInfo.split("AaBb"); var accountTotalInfo = accountInfo.split("AaBb");
$.ajax({ $.ajax({
type:"post", type: "post",
url: "<%=path %>/account/delete.action", url: "<%=path %>/account/delete.action",
dataType: "json", dataType: "json",
data: ({ data: ({
accountID : accountTotalInfo[0], accountID: accountTotalInfo[0],
name:accountTotalInfo[1], name: accountTotalInfo[1],
clientIp:'<%=clientIp %>' clientIp: '<%=clientIp %>'
}), }),
success: function (tipInfo) success: function (tipInfo) {
{
var msg = tipInfo.showModel.msgTip; var msg = tipInfo.showModel.msgTip;
if(msg == '成功') if (msg == '成功')
//加载完以后重新初始化 //加载完以后重新初始化
$("#searchBtn").click(); $("#searchBtn").click();
else else
$.messager.alert('删除提示','删除结算账户失败,请稍后再试!','error'); $.messager.alert('删除提示', '删除结算账户失败,请稍后再试!', 'error');
}, },
//此处添加错误处理 //此处添加错误处理
error:function() error: function () {
{ $.messager.alert('删除提示', '删除结算账户异常,请稍后再试!', 'error');
$.messager.alert('删除提示','删除结算账户异常,请稍后再试!','error');
return; return;
} }
}); });
@@ -265,54 +261,45 @@
} }
//批量删除结算账户 //批量删除结算账户
function batDeleteAccount(){ function batDeleteAccount() {
var row = $('#tableData').datagrid('getChecked'); var row = $('#tableData').datagrid('getChecked');
if(row.length == 0) if (row.length == 0) {
{ $.messager.alert('删除提示', '没有记录被选中!', 'info');
$.messager.alert('删除提示','没有记录被选中!','info');
return; return;
} }
if(row.length > 0) if (row.length > 0) {
{ $.messager.confirm('删除确认', '确定要删除选中的' + row.length + '条结算账户吗?', function (r) {
$.messager.confirm('删除确认','确定要删除选中的' + row.length + '条结算账户吗?',function(r) if (r) {
{
if (r)
{
var ids = ""; var ids = "";
for(var i = 0;i < row.length; i ++) for (var i = 0; i < row.length; i++) {
{ if (i == row.length - 1) {
if(i == row.length-1)
{
ids += row[i].id; ids += row[i].id;
break; break;
} }
ids += row[i].id + ","; ids += row[i].id + ",";
} }
$.ajax({ $.ajax({
type:"post", type: "post",
url: "<%=path %>/account/batchDelete.action", url: "<%=path %>/account/batchDelete.action",
dataType: "json", dataType: "json",
async : false, async: false,
data: ({ data: ({
accountIDs : ids, accountIDs: ids,
clientIp:'<%=clientIp %>' clientIp: '<%=clientIp %>'
}), }),
success: function (tipInfo) success: function (tipInfo) {
{
var msg = tipInfo.showModel.msgTip; var msg = tipInfo.showModel.msgTip;
if(msg == '成功') if (msg == '成功') {
{
//加载完以后重新初始化 //加载完以后重新初始化
$("#searchBtn").click(); $("#searchBtn").click();
$(":checkbox").attr("checked",false); $(":checkbox").attr("checked", false);
} }
else else
$.messager.alert('删除提示','删除结算账户失败,请稍后再试!','error'); $.messager.alert('删除提示', '删除结算账户失败,请稍后再试!', 'error');
}, },
//此处添加错误处理 //此处添加错误处理
error:function() error: function () {
{ $.messager.alert('删除提示', '删除结算账户异常,请稍后再试!', 'error');
$.messager.alert('删除提示','删除结算账户异常,请稍后再试!','error');
return; return;
} }
}); });
@@ -327,15 +314,15 @@
//保存编辑前的名称 //保存编辑前的名称
var orgaccount = ""; var orgaccount = "";
function addAccount(){ function addAccount() {
$('#accountDlg').dialog('open').dialog('setTitle','<img src="<%=path%>/js/easyui-1.3.5/themes/icons/edit_add.png"/>&nbsp;增加结算账户'); $('#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}); $(".window-mask").css({width: webW, height: webH});
$('#accountFM').form('clear'); $('#accountFM').form('clear');
var row = { var row = {
clientIp:'<%=clientIp %>' clientIp: '<%=clientIp %>'
}; };
$('#accountFM').form('load',row); $('#accountFM').form('load', row);
$("#account").focus(); $("#account").focus();
orgAccount = ""; orgAccount = "";
@@ -344,29 +331,27 @@
} }
//设为默认操作事件 //设为默认操作事件
function setAccountIsDefault(){ function setAccountIsDefault() {
var allRow = $('#tableData').datagrid('getRows'); var allRow = $('#tableData').datagrid('getRows');
var row = $('#tableData').datagrid('getChecked'); var row = $('#tableData').datagrid('getChecked');
if(row.length == 0) if (row.length == 0) {
{ $.messager.alert('设置提示', '没有记录被选中!', 'info');
$.messager.alert('设置提示','没有记录被选中!','info');
return; return;
} }
if(row.length > 0) if (row.length > 0) {
{
function setDefault(accountID, isDefault) { function setDefault(accountID, isDefault) {
$.ajax({ $.ajax({
type:"post", type: "post",
url: "<%=path %>/account/updateAmountIsDefault.action", url: "<%=path %>/account/updateAmountIsDefault.action",
dataType: "json", dataType: "json",
async : false, async: false,
data: ({ data: ({
AccountID : accountID, AccountID: accountID,
IsDefault : isDefault, IsDefault: isDefault,
clientIp:'<%=clientIp %>' clientIp: '<%=clientIp %>'
}), }),
success: function (res) { success: function (res) {
if(res == "true" && isDefault) { if (res == "true" && isDefault) {
} }
else { else {
@@ -374,23 +359,23 @@
} }
}, },
//此处添加错误处理 //此处添加错误处理
error:function() error: function () {
{ $.messager.alert('删除提示', '删除结算账户异常,请稍后再试!', 'error');
$.messager.alert('删除提示','删除结算账户异常,请稍后再试!','error');
return; return;
} }
}); });
} }
if(row.length == 1) {
if (row.length == 1) {
setDefault(row[0].id, true); //设置默认 setDefault(row[0].id, true); //设置默认
for(var i = 0;i < allRow.length; i++) { for (var i = 0; i < allRow.length; i++) {
if(allRow[i].id != row[0].id) { if (allRow[i].id != row[0].id) {
setDefault(allRow[i].id, false); setDefault(allRow[i].id, false);
} }
} }
setTimeout(function(){ setTimeout(function () {
$("#searchBtn").click(); $("#searchBtn").click();
},1000); }, 1000);
} }
return; return;
@@ -399,35 +384,30 @@
//保存结算账户 //保存结算账户
$("#saveAccount").unbind().bind({ $("#saveAccount").unbind().bind({
click:function() click: function () {
{ if (checkAccountName())
if(checkAccountName())
return; return;
$('#accountFM').form('submit',{ $('#accountFM').form('submit', {
url: url, url: url,
onSubmit: function() onSubmit: function () {
{
return $(this).form('validate'); return $(this).form('validate');
}, },
success: function(result) success: function (result) {
{ var result = eval('(' + result + ')');
var result = eval('('+result+')'); if (!result) {
if (!result)
{
$.messager.show({ $.messager.show({
title: '错误提示', title: '错误提示',
msg: '保存结算账户失败,请稍后重试!' msg: '保存结算账户失败,请稍后重试!'
}); });
} }
else else {
{
$('#accountDlg').dialog('close'); $('#accountDlg').dialog('close');
//$('#tableData').datagrid('reload'); //$('#tableData').datagrid('reload');
//加载完以后重新初始化 //加载完以后重新初始化
//$("#searchBtn").click(); //$("#searchBtn").click();
var opts = $("#tableData").datagrid('options'); var opts = $("#tableData").datagrid('options');
showAccountDetails(opts.pageNumber,opts.pageSize); showAccountDetails(opts.pageNumber, opts.pageSize);
} }
} }
}); });
@@ -435,20 +415,20 @@
}); });
//编辑结算账户 //编辑结算账户
function editAccount(accountTotalInfo){ function editAccount(accountTotalInfo) {
var accountInfo = accountTotalInfo.split("AaBb"); var accountInfo = accountTotalInfo.split("AaBb");
var row = { var row = {
name : accountInfo[1], name: accountInfo[1],
serialNo : accountInfo[2], serialNo: accountInfo[2],
initialAmount : accountInfo[3], initialAmount: accountInfo[3],
currentAmount : accountInfo[4], currentAmount: accountInfo[4],
remark : accountInfo[5], remark: accountInfo[5],
clientIp:'<%=clientIp %>' clientIp: '<%=clientIp %>'
}; };
orgAccount = accountInfo[1]; orgAccount = accountInfo[1];
$('#accountDlg').dialog('open').dialog('setTitle','<img src="<%=path%>/js/easyui-1.3.5/themes/icons/pencil.png"/>&nbsp;编辑结算账户'); $('#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}); $(".window-mask").css({width: webW, height: webH});
$('#accountFM').form('load',row); $('#accountFM').form('load', row);
accountID = accountInfo[0]; accountID = accountInfo[0];
//焦点在名称输入框==定焦在输入文字后面 //焦点在名称输入框==定焦在输入文字后面
$("#account").val("").focus().val(accountInfo[1]); $("#account").val("").focus().val(accountInfo[1]);
@@ -456,35 +436,31 @@
} }
//检查结算账户 名称是否存在 ++ 重名无法提示问题需要跟进 //检查结算账户 名称是否存在 ++ 重名无法提示问题需要跟进
function checkAccountName(){ function checkAccountName() {
var accountName = $.trim($("#name").val()); var accountName = $.trim($("#name").val());
//表示是否存在 true == 存在 false = 不存在 //表示是否存在 true == 存在 false = 不存在
var flag = false; var flag = false;
//开始ajax名称检验不能重名 //开始ajax名称检验不能重名
if(accountName.length > 0 &&( orgAccount.length ==0 || accountName != orgAccount)) if (accountName.length > 0 && (orgAccount.length == 0 || accountName != orgAccount)) {
{
$.ajax({ $.ajax({
type:"post", type: "post",
url: "<%=path %>/account/checkIsNameExist.action", url: "<%=path %>/account/checkIsNameExist.action",
dataType: "json", dataType: "json",
async : false, async: false,
data: ({ data: ({
accountID : accountID, accountID: accountID,
name : accountName name: accountName
}), }),
success: function (tipInfo) success: function (tipInfo) {
{
flag = tipInfo; flag = tipInfo;
if(tipInfo) if (tipInfo) {
{ $.messager.alert('提示', '结算账户名称已经存在', 'info');
$.messager.alert('提示','结算账户名称已经存在','info');
return; return;
} }
}, },
//此处添加错误处理 //此处添加错误处理
error:function() error: function () {
{ $.messager.alert('提示', '检查结算账户名称是否存在异常,请稍后再试!', 'error');
$.messager.alert('提示','检查结算账户名称是否存在异常,请稍后再试!','error');
return; return;
} }
}); });
@@ -494,93 +470,92 @@
//搜索处理 //搜索处理
$("#searchBtn").unbind().bind({ $("#searchBtn").unbind().bind({
click:function() click: function () {
{ showAccountDetails(1, initPageSize);
showAccountDetails(1,initPageSize);
var opts = $("#tableData").datagrid('options'); var opts = $("#tableData").datagrid('options');
var pager = $("#tableData").datagrid('getPager'); var pager = $("#tableData").datagrid('getPager');
opts.pageNumber = 1; opts.pageNumber = 1;
opts.pageSize = initPageSize; opts.pageSize = initPageSize;
pager.pagination('refresh', pager.pagination('refresh',
{ {
pageNumber:1, pageNumber: 1,
pageSize:initPageSize pageSize: initPageSize
}); });
} }
}); });
function showAccountDetails(pageNo,pageSize){ function showAccountDetails(pageNo, pageSize) {
$.ajax({ $.ajax({
type:"post", type: "post",
url: "<%=path %>/account/findBy.action", url: "<%=path %>/account/findBy.action",
dataType: "json", dataType: "json",
data: ({ data: ({
name:$.trim($("#searchName").val()), name: $.trim($("#searchName").val()),
serialNo:$.trim($("#searchSerialNo").val()), serialNo: $.trim($("#searchSerialNo").val()),
remark:$.trim($("#searchRemark").val()), remark: $.trim($("#searchRemark").val()),
pageNo:pageNo, pageNo: pageNo,
pageSize:pageSize pageSize: pageSize
}), }),
success: function (data) success: function (data) {
{ $("#tableData").datagrid('loadData', data);
$("#tableData").datagrid('loadData',data);
}, },
//此处添加错误处理 //此处添加错误处理
error:function() error: function () {
{ $.messager.alert('查询提示', '查询数据后台异常,请稍后再试!', 'error');
$.messager.alert('查询提示','查询数据后台异常,请稍后再试!','error');
return; return;
} }
}); });
} }
function showAccountInOutList(accountInfo){ function showAccountInOutList(accountInfo) {
var info = accountInfo.split("AaBb"); var info = accountInfo.split("AaBb");
var accountId = info[0]; var accountId = info[0];
var initialAmount = info[3]; var initialAmount = info[3];
$('#accountDetailListDlg').dialog('open').dialog('setTitle','<img src="<%=path%>/js/easyui-1.3.5/themes/icons/pencil.png"/>&nbsp;查看账户流水'); $('#accountDetailListDlg').dialog('open').dialog('setTitle', '<img src="<%=path%>/js/easyui-1.3.5/themes/icons/pencil.png"/>&nbsp;查看账户流水');
$(".window-mask").css({ width: webW ,height: webH}); $(".window-mask").css({width: webW, height: webH});
initAccountDetailData(accountId); initAccountDetailData(accountId);
getAccountInOutList(accountId,initialAmount,1,initPageSize); getAccountInOutList(accountId, initialAmount, 1, initPageSize);
ininAccountDetailPager(accountId,initialAmount); ininAccountDetailPager(accountId, initialAmount);
} }
//初始化表格数据 //初始化表格数据
function initAccountDetailData(accountId){ function initAccountDetailData(accountId) {
$('#accountTableData').datagrid({ $('#accountTableData').datagrid({
height:heightInfo, height: heightInfo,
nowrap: false, nowrap: false,
rownumbers: false, rownumbers: false,
//动画效果 //动画效果
animate:false, animate: false,
//选中单行 //选中单行
singleSelect : true, singleSelect: true,
collapsible:false, collapsible: false,
selectOnCheck:false, selectOnCheck: false,
//单击行是否选中 //单击行是否选中
checkOnSelect : false, checkOnSelect: false,
//交替出现背景 //交替出现背景
striped : true, striped: true,
pagination: true, pagination: true,
pageSize: initPageSize, pageSize: initPageSize,
pageList: initPageNum, pageList: initPageNum,
columns:[[ columns: [[
{ title: '单据编号',field: 'number',width:150, {
title: '单据编号', field: 'number', width: 150,
formatter: function (value, row) { formatter: function (value, row) {
return "<a class='n-link' onclick=\"newTab('" + row.number + "','../materials/bill_detail.jsp?n=" + row.number + "&type=" + row.type + "','')\">" return "<a class='n-link' onclick=\"newTab('" + row.number + "','../materials/bill_detail.jsp?n=" + row.number + "&type=" + row.type + "','')\">"
+ row.number + "</a>"; + row.number + "</a>";
} }
}, },
{ title: '类型', field: 'type',width:100}, {title: '类型', field: 'type', width: 100},
{ title: '单位信息', field: 'supplierName',width:150}, {title: '单位信息', field: 'supplierName', width: 150},
{ title: '金额', field: 'changeAmount',width:80, {
title: '金额', field: 'changeAmount', width: 80,
formatter: function (value, row) { formatter: function (value, row) {
if(row.aList && row.amList) { if (row.aList && row.amList) {
var aListArr = row.aList.toString().split(","); var aListArr = row.aList.toString().split(",");
var amListArr = row.amList.toString().split(","); var amListArr = row.amList.toString().split(",");
var res = ""; var res = "";
for(var i=0; i<aListArr.length; i++) { for (var i = 0; i < aListArr.length; i++) {
if(aListArr[i] == accountId) { if (aListArr[i] == accountId) {
res = amListArr[i]; res = amListArr[i];
} }
} }
@@ -591,55 +566,55 @@
} }
} }
}, },
{ title: '余额', field: 'balance',width:80}, {title: '余额', field: 'balance', width: 80},
{ title: '入库出库日期',field: 'operTime',width:180} {title: '入库出库日期', field: 'operTime', width: 180}
]], ]],
onLoadError:function() { onLoadError: function () {
$.messager.alert('页面加载提示','页面加载异常,请稍后再试!','error'); $.messager.alert('页面加载提示', '页面加载异常,请稍后再试!', 'error');
return; return;
} }
}); });
} }
//分页信息处理 //分页信息处理
function ininAccountDetailPager(accountId,initialAmount){ function ininAccountDetailPager(accountId, initialAmount) {
try { try {
var opts = $("#accountTableData").datagrid('options'); var opts = $("#accountTableData").datagrid('options');
var pager = $("#accountTableData").datagrid('getPager'); var pager = $("#accountTableData").datagrid('getPager');
pager.pagination({ pager.pagination({
onSelectPage:function(pageNum, pageSize) { onSelectPage: function (pageNum, pageSize) {
opts.pageNumber = pageNum; opts.pageNumber = pageNum;
opts.pageSize = pageSize; opts.pageSize = pageSize;
pager.pagination('refresh', { pager.pagination('refresh', {
pageNumber:pageNum, pageNumber: pageNum,
pageSize:pageSize pageSize: pageSize
}); });
getAccountInOutList(accountId,initialAmount,pageNum,pageSize); getAccountInOutList(accountId, initialAmount, pageNum, pageSize);
} }
}); });
} }
catch (e) { catch (e) {
$.messager.alert('异常处理提示',"分页信息异常 : " + e.name + ": " + e.message,'error'); $.messager.alert('异常处理提示', "分页信息异常 : " + e.name + ": " + e.message, 'error');
} }
} }
function getAccountInOutList(accountId,initialAmount,pageNo,pageSize){ function getAccountInOutList(accountId, initialAmount, pageNo, pageSize) {
$.ajax({ $.ajax({
type:"get", type: "get",
url: "<%=path %>/account/findAccountInOutList.action", url: "<%=path %>/account/findAccountInOutList.action",
dataType: "json", dataType: "json",
data: ({ data: ({
accountID: accountId, accountID: accountId,
initialAmount:initialAmount, initialAmount: initialAmount,
pageNo:pageNo, pageNo: pageNo,
pageSize:pageSize pageSize: pageSize
}), }),
success: function (res) { success: function (res) {
$("#accountTableData").datagrid('loadData',res); $("#accountTableData").datagrid('loadData', res);
}, },
//此处添加错误处理 //此处添加错误处理
error:function() { error: function () {
$.messager.alert('查询提示','查询数据后台异常,请稍后再试!','error'); $.messager.alert('查询提示', '查询数据后台异常,请稍后再试!', 'error');
return; return;
} }
}); });
@@ -647,7 +622,7 @@
//重置按钮 //重置按钮
$("#searchResetBtn").unbind().bind({ $("#searchResetBtn").unbind().bind({
click:function(){ click: function () {
$("#searchName").val(""); $("#searchName").val("");
$("#searchSerialNo").val(""); $("#searchSerialNo").val("");
$("#searchRemark").val(""); $("#searchRemark").val("");
@@ -655,6 +630,6 @@
$("#searchBtn").click(); $("#searchBtn").click();
} }
}); });
</script> </script>
</body> </body>
</html> </html>

View File

@@ -1,32 +1,33 @@
<%@page import="com.jsh.util.Tools"%> <%@page import="com.jsh.util.Tools" %>
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%> <%@ page language="java" pageEncoding="utf-8" %>
<% <%
String path = request.getContextPath(); String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/"; String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + path + "/";
String clientIp = Tools.getLocalIp(request); String clientIp = Tools.getLocalIp(request);
%> %>
<!DOCTYPE html> <!DOCTYPE html>
<html> <html>
<head> <head>
<title>应用管理</title> <title>应用管理</title>
<meta charset="utf-8"> <meta charset="utf-8">
<!-- 指定以IE8的方式来渲染 --> <!-- 指定以IE8的方式来渲染 -->
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE8"/> <meta http-equiv="X-UA-Compatible" content="IE=EmulateIE8"/>
<link rel="shortcut icon" href="<%=path%>/images/favicon.ico" type="image/x-icon" /> <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/default/easyui.css"/>
<link rel="stylesheet" type="text/css" href="<%=path %>/js/easyui-1.3.5/themes/icon.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" /> <link type="text/css" rel="stylesheet" href="<%=path %>/css/common.css"/>
<link href="<%=path %>/js/fileUploadQT/css/iconfont.css" rel="stylesheet" type="text/css" /> <link href="<%=path %>/js/fileUploadQT/css/iconfont.css" rel="stylesheet" type="text/css"/>
<link href="<%=path %>/js/fileUploadQT/css/fileUpload.css" rel="stylesheet" type="text/css" /> <link href="<%=path %>/js/fileUploadQT/css/fileUpload.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="<%=path %>/js/jquery-1.8.0.min.js"></script> <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/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/locale/easyui-lang-zh_CN.js"></script>
<script src="<%=path %>/js/fileUploadQT/js/fileUpload.js"></script> <script src="<%=path %>/js/fileUploadQT/js/fileUpload.js"></script>
<script type="text/javascript" src="<%=path %>/js/common/common.js"></script> <script type="text/javascript" src="<%=path %>/js/common/common.js"></script>
</head> </head>
<body> <body>
<!-- 查询 --> <!-- 查询 -->
<div id = "searchPanel" class="easyui-panel" style="padding:10px;" title="查询窗口" iconCls="icon-search" collapsible="true" closable="false"> <div id="searchPanel" class="easyui-panel" style="padding:10px;" title="查询窗口" iconCls="icon-search" collapsible="true"
closable="false">
<table id="searchTable"> <table id="searchTable">
<tr> <tr>
<td>名称:</td> <td>名称:</td>
@@ -48,70 +49,87 @@
</td> </td>
</tr> </tr>
</table> </table>
</div> </div>
<!-- 数据显示table --> <!-- 数据显示table -->
<div id = "tablePanel" class="easyui-panel" style="padding:1px;top:300px;" title="应用列表" iconCls="icon-list" collapsible="true" closable="false"> <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> <table id="tableData" style="top:300px;border-bottom-color:#FFFFFF"></table>
</div> </div>
<div id="appDlg" class="easyui-dialog" style="width:600px;padding:10px 20px;top:20px" <div id="appDlg" class="easyui-dialog" style="width:600px;padding:10px 20px;top:20px"
closed="true" buttons="#dlg-buttons" modal="true" cache="false" collapsible="false" closable="true"> closed="true" buttons="#dlg-buttons" modal="true" cache="false" collapsible="false" closable="true">
<form id="appFM" method="post" enctype="multipart/form-data"> <form id="appFM" method="post" enctype="multipart/form-data">
<table> <table>
<tr> <tr>
<td style="width: 50px;height: 20px">代号</td> <td style="width: 50px;height: 20px">代号</td>
<td style="padding:1px"><input name="Number" id="Number" class="easyui-textbox" style="width: 150px;height: 20px"/></td> <td style="padding:1px"><input name="Number" id="Number" class="easyui-textbox"
style="width: 150px;height: 20px"/></td>
<td style="width: 50px;height: 20px">名称</td> <td style="width: 50px;height: 20px">名称</td>
<td style="padding:1px"><input name="Name" id="Name" class="easyui-validatebox" data-options="required:true,validType:'length[2,30]'" style="width: 150px;height: 20px"/></td> <td style="padding:1px"><input name="Name" id="Name" class="easyui-validatebox"
data-options="required:true,validType:'length[2,30]'"
style="width: 150px;height: 20px"/></td>
<td style="width: 50px;height: 20px">拉伸</td> <td style="width: 50px;height: 20px">拉伸</td>
<td style="padding:1px"><input name="ReSize" id="ReSize" type="checkbox" style="width: 50px;height: 20px"/></td> <td style="padding:1px"><input name="ReSize" id="ReSize" type="checkbox"
style="width: 50px;height: 20px"/></td>
</tr> </tr>
<tr> <tr>
<td>类型</td> <td>类型</td>
<td style="padding:1px"><input name="Type" id="Type" class="easyui-textbox" style="width: 150px;height: 20px"/></td> <td style="padding:1px"><input name="Type" id="Type" class="easyui-textbox"
style="width: 150px;height: 20px"/></td>
<td>链接</td> <td>链接</td>
<td style="padding:1px"><input name="URL" id="URL" class="easyui-textbox" style="width: 150px;height: 20px"/></td> <td style="padding:1px"><input name="URL" id="URL" class="easyui-textbox"
style="width: 150px;height: 20px"/></td>
<td>最大化</td> <td>最大化</td>
<td style="padding:1px"><input name="OpenMax" id="OpenMax" type="checkbox" style="width: 50px;height: 20px"/></td> <td style="padding:1px"><input name="OpenMax" id="OpenMax" type="checkbox"
style="width: 50px;height: 20px"/></td>
</tr> </tr>
<tr> <tr>
<td>宽度</td> <td>宽度</td>
<td style="padding:1px"><input name="Width" id="Width" class="easyui-textbox" style="width: 150px;height: 20px"/></td> <td style="padding:1px"><input name="Width" id="Width" class="easyui-textbox"
style="width: 150px;height: 20px"/></td>
<td>高度</td> <td>高度</td>
<td style="padding:1px"><input name="Height" id="Height" class="easyui-textbox" style="width: 150px;height: 20px"/></td> <td style="padding:1px"><input name="Height" id="Height" class="easyui-textbox"
style="width: 150px;height: 20px"/></td>
<td>Flash</td> <td>Flash</td>
<td style="padding:1px"><input name="Flash" id="Flash" type="checkbox" style="width: 50px;height: 20px"/></td> <td style="padding:1px"><input name="Flash" id="Flash" type="checkbox"
style="width: 50px;height: 20px"/></td>
</tr> </tr>
<tr> <tr>
<td>排序号</td> <td>排序号</td>
<td style="padding:1px"><input name="Sort" id="Sort" class="easyui-textbox" style="width: 150px;height: 20px"/></td> <td style="padding:1px"><input name="Sort" id="Sort" class="easyui-textbox"
style="width: 150px;height: 20px"/></td>
<td>种类</td> <td>种类</td>
<td style="padding:1px"><input name="ZL" id="ZL" class="easyui-textbox" style="width: 150px;height: 20px"/></td> <td style="padding:1px"><input name="ZL" id="ZL" class="easyui-textbox"
style="width: 150px;height: 20px"/></td>
<td>启用</td> <td>启用</td>
<td style="padding:1px"><input name="Enabled" id="Enabled" type="checkbox" style="width: 50px;height: 20px"/></td> <td style="padding:1px"><input name="Enabled" id="Enabled" type="checkbox"
style="width: 50px;height: 20px"/></td>
</tr> </tr>
<tr> <tr>
<td>备注</td> <td>备注</td>
<td style="padding:1px" colspan="5"><input name="Remark" id="Remark" class="easyui-textbox" style="width: 480px;height: 20px"/></td> <td style="padding:1px" colspan="5"><input name="Remark" id="Remark" class="easyui-textbox"
style="width: 480px;height: 20px"/></td>
</tr> </tr>
<tr> <tr>
<td>图标</td> <td>图标</td>
<td style="padding:1px" colspan="5"><div id="Icon" class="fileUploadContent"></div></td> <td style="padding:1px" colspan="5">
<div id="Icon" class="fileUploadContent"></div>
</td>
</tr> </tr>
</table> </table>
<input type="hidden" name="clientIp" id="clientIp" value="<%=clientIp %>"/> <input type="hidden" name="clientIp" id="clientIp" value="<%=clientIp %>"/>
</form> </form>
</div> </div>
<div id="dlg-buttons"> <div id="dlg-buttons">
<a href="javascript:void(0)" id="saveApp" class="easyui-linkbutton" iconCls="icon-ok">保存</a> <a href="javascript:void(0)" id="saveApp" class="easyui-linkbutton" iconCls="icon-ok">保存</a>
<a href="javascript:void(0)" id="cancelApp" class="easyui-linkbutton" iconCls="icon-cancel" onclick="javascript:$('#appDlg').dialog('close')">取消</a> <a href="javascript:void(0)" id="cancelApp" class="easyui-linkbutton" iconCls="icon-cancel"
</div> onclick="javascript:$('#appDlg').dialog('close')">取消</a>
</div>
<script type="text/javascript"> <script type="text/javascript">
//初始化界面 //初始化界面
$(function() $(function () {
{
initTableData(); initTableData();
ininPager(); ininPager();
initForm(); initForm();
@@ -119,193 +137,181 @@
//防止表单提交重复 //防止表单提交重复
function initForm() function initForm() {
{
$('#appFM').form({ $('#appFM').form({
onSubmit: function(){ onSubmit: function () {
return false; return false;
} }
}); });
} }
//初始化表格数据 //初始化表格数据
function initTableData() function initTableData() {
{
$('#tableData').datagrid({ $('#tableData').datagrid({
//title:'应用列表', //title:'应用列表',
//iconCls:'icon-save', //iconCls:'icon-save',
//width:700, //width:700,
height:heightInfo, height: heightInfo,
nowrap: false, nowrap: false,
rownumbers: false, rownumbers: false,
//动画效果 //动画效果
animate:false, animate: false,
//选中单行 //选中单行
singleSelect : true, singleSelect: true,
collapsible:false, collapsible: false,
selectOnCheck:false, selectOnCheck: false,
//fitColumns:true, //fitColumns:true,
//单击行是否选中 //单击行是否选中
checkOnSelect : false, checkOnSelect: false,
url:'<%=path %>/app/findBy.action?pageSize=' + initPageSize, url: '<%=path %>/app/findBy.action?pageSize=' + initPageSize,
pagination: true, pagination: true,
//交替出现背景 //交替出现背景
striped : true, striped: true,
//loadFilter: pagerFilter, //loadFilter: pagerFilter,
pageSize: initPageSize, pageSize: initPageSize,
pageList: initPageNum, pageList: initPageNum,
columns:[[ columns: [[
{ field: 'Id',width:35,align:"center",checkbox:true}, {field: 'Id', width: 35, align: "center", checkbox: true},
{ title: '代号',field: 'Number',width:50}, {title: '代号', field: 'Number', width: 50},
{ title: '应用名称',field: 'Name',width:100}, {title: '应用名称', field: 'Name', width: 100},
{ title: '类型',field: 'Type',width:50}, {title: '类型', field: 'Type', width: 50},
{ title: '图标',field: 'Icon',width:100,formatter:function(value,row)
{ {
if (value!= null) title: '图标', field: 'Icon', width: 100, formatter: function (value, row) {
{ if (value != null) {
return "<img alt='图标' style='width:32px;height:32px;' src=\"../../upload/images/deskIcon/"+value+"\" />"; return "<img alt='图标' style='width:32px;height:32px;' src=\"../../upload/images/deskIcon/" + value + "\" />";
} }
} }
}, },
{ title: '链接',field: 'URL',width:100}, {title: '链接', field: 'URL', width: 100},
{ title: '宽度',field: 'Width',width:50}, {title: '宽度', field: 'Width', width: 50},
{ title: '高度',field: 'Height',width:50}, {title: '高度', field: 'Height', width: 50},
{ title: '拉伸',field: 'ReSize',width:50,formatter:function(value){
return value? "开":"关";
}},
{ title: '最大化',field: 'OpenMax',width:50,formatter:function(value){
return value? "开":"关";
}},
{ title: 'Flash',field: 'Flash',width:50,formatter:function(value){
return value? "开":"关";
}},
{ title: '种类',field: 'ZL',width:50},
{ title: '排序号',field: 'Sort',width:50},
{ title: '备注',field: 'Remark',width:50},
{ title: '启用',field: 'Enabled',width:50,formatter:function(value){
return value? "开":"关";
}},
{ title: '操作',field: 'op',align:"center",width:130,formatter:function(value,rec)
{ {
title: '拉伸', field: 'ReSize', width: 50, formatter: function (value) {
return value ? "开" : "关";
}
},
{
title: '最大化', field: 'OpenMax', width: 50, formatter: function (value) {
return value ? "开" : "关";
}
},
{
title: 'Flash', field: 'Flash', width: 50, formatter: function (value) {
return value ? "开" : "关";
}
},
{title: '种类', field: 'ZL', width: 50},
{title: '排序号', field: 'Sort', width: 50},
{title: '备注', field: 'Remark', width: 50},
{
title: '启用', field: 'Enabled', width: 50, formatter: function (value) {
return value ? "开" : "关";
}
},
{
title: '操作', field: 'op', align: "center", width: 130, formatter: function (value, rec) {
var str = ''; var str = '';
var rowInfo = rec.Id + 'AaBb' + rec.Number + 'AaBb' + rec.Name + 'AaBb' + rec.Type + 'AaBb' + rec.Icon var rowInfo = rec.Id + 'AaBb' + rec.Number + 'AaBb' + rec.Name + 'AaBb' + rec.Type + 'AaBb' + rec.Icon
+ 'AaBb' + rec.URL + 'AaBb' + rec.Width + 'AaBb' + rec.Height + 'AaBb' + rec.ReSize + 'AaBb' + rec.OpenMax + 'AaBb' + rec.URL + 'AaBb' + rec.Width + 'AaBb' + rec.Height + 'AaBb' + rec.ReSize + 'AaBb' + rec.OpenMax
+ 'AaBb' + rec.Flash + 'AaBb' + rec.ZL + 'AaBb' + rec.Sort + 'AaBb' + rec.Remark + 'AaBb' + rec.Enabled; + 'AaBb' + rec.Flash + 'AaBb' + rec.ZL + 'AaBb' + rec.Sort + 'AaBb' + rec.Remark + 'AaBb' + rec.Enabled;
if(1 == value) if (1 == value) {
{
str += '<img src="<%=path%>/js/easyui-1.3.5/themes/icons/pencil.png" style="cursor: pointer;" onclick="editApp(\'' + rowInfo + '\');"/>&nbsp;<a onclick="editApp(\'' + 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/pencil.png" style="cursor: pointer;" onclick="editApp(\'' + rowInfo + '\');"/>&nbsp;<a onclick="editApp(\'' + 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="deleteApp('+ rec.Id +');"/>&nbsp;<a onclick="deleteApp('+ rec.Id +');" 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="deleteApp(' + rec.Id + ');"/>&nbsp;<a onclick="deleteApp(' + rec.Id + ');" style="text-decoration:none;color:black;" href="javascript:void(0)">删除</a>&nbsp;&nbsp;';
} }
return str; return str;
} }
} }
]], ]],
toolbar:[ toolbar: [
{
id:'addApp',
text:'增加',
iconCls:'icon-add',
handler:function()
{ {
id: 'addApp',
text: '增加',
iconCls: 'icon-add',
handler: function () {
addApp(); addApp();
} }
}, },
{ {
id:'deleteApp', id: 'deleteApp',
text:'删除', text: '删除',
iconCls:'icon-remove', iconCls: 'icon-remove',
handler:function() handler: function () {
{
batDeleteApp(); batDeleteApp();
} }
} }
], ],
onLoadError:function() onLoadError: function () {
{ $.messager.alert('页面加载提示', '页面加载异常,请稍后再试!', 'error');
$.messager.alert('页面加载提示','页面加载异常,请稍后再试!','error');
return; return;
} }
}); });
} }
//初始化键盘enter事件 //初始化键盘enter事件
$(document).keydown(function(event) $(document).keydown(function (event) {
{
//兼容 IE和firefox 事件 //兼容 IE和firefox 事件
var e = window.event || event; var e = window.event || event;
var k = e.keyCode||e.which||e.charCode; var k = e.keyCode || e.which || e.charCode;
//兼容 IE,firefox 兼容 //兼容 IE,firefox 兼容
var obj = e.srcElement ? e.srcElement : e.target; var obj = e.srcElement ? e.srcElement : e.target;
//绑定键盘事件为 id是指定的输入框才可以触发键盘事件 13键盘事件 ---遗留问题 enter键效验 对话框会关闭问题 //绑定键盘事件为 id是指定的输入框才可以触发键盘事件 13键盘事件 ---遗留问题 enter键效验 对话框会关闭问题
if(k == "13"&&(obj.id=="Number"||obj.id=="Name"|| obj.id=="Type"||obj.id=="Icon"|| obj.id=="URL" if (k == "13" && (obj.id == "Number" || obj.id == "Name" || obj.id == "Type" || obj.id == "Icon" || obj.id == "URL"
||obj.id=="Width"|| obj.id=="Height"||obj.id=="ZL"|| obj.id=="Sort"||obj.id=="Remark")) || obj.id == "Width" || obj.id == "Height" || obj.id == "ZL" || obj.id == "Sort" || obj.id == "Remark")) {
{
$("#saveApp").click(); $("#saveApp").click();
} }
//搜索按钮添加快捷键 //搜索按钮添加快捷键
if(k == "13"&&(obj.id=="searchName" || obj.id=="searchType" )) if (k == "13" && (obj.id == "searchName" || obj.id == "searchType")) {
{
$("#searchBtn").click(); $("#searchBtn").click();
} }
}); });
//分页信息处理 //分页信息处理
function ininPager() function ininPager() {
{ try {
try
{
var opts = $("#tableData").datagrid('options'); var opts = $("#tableData").datagrid('options');
var pager = $("#tableData").datagrid('getPager'); var pager = $("#tableData").datagrid('getPager');
pager.pagination({ pager.pagination({
onSelectPage:function(pageNum, pageSize) onSelectPage: function (pageNum, pageSize) {
{
opts.pageNumber = pageNum; opts.pageNumber = pageNum;
opts.pageSize = pageSize; opts.pageSize = pageSize;
pager.pagination('refresh', pager.pagination('refresh',
{ {
pageNumber:pageNum, pageNumber: pageNum,
pageSize:pageSize pageSize: pageSize
}); });
showAppDetails(pageNum,pageSize); showAppDetails(pageNum, pageSize);
} }
}); });
} }
catch (e) catch (e) {
{ $.messager.alert('异常处理提示', "分页信息异常 : " + e.name + ": " + e.message, 'error');
$.messager.alert('异常处理提示',"分页信息异常 : " + e.name + ": " + e.message,'error');
} }
} }
//删除应用信息 //删除应用信息
function deleteApp(appID) function deleteApp(appID) {
{ $.messager.confirm('删除确认', '确定要删除此应用信息吗?', function (r) {
$.messager.confirm('删除确认','确定要删除此应用信息吗?',function(r) if (r) {
{
if (r)
{
$.ajax({ $.ajax({
type:"post", type: "post",
url: "<%=path %>/app/delete.action", url: "<%=path %>/app/delete.action",
dataType: "json", dataType: "json",
data: ({ data: ({
appID : appID, appID: appID,
clientIp:'<%=clientIp %>' clientIp: '<%=clientIp %>'
}), }),
success: function (tipInfo) success: function (tipInfo) {
{
var msg = tipInfo.showModel.msgTip; var msg = tipInfo.showModel.msgTip;
if(msg == '成功') if (msg == '成功') {
{
//加载完以后重新初始化 //加载完以后重新初始化
$("#searchBtn").click(); $("#searchBtn").click();
} }
else else
$.messager.alert('删除提示','删除应用信息失败,请稍后再试!','error'); $.messager.alert('删除提示', '删除应用信息失败,请稍后再试!', 'error');
}, },
//此处添加错误处理 //此处添加错误处理
error:function() error: function () {
{ $.messager.alert('删除提示', '删除应用信息异常,请稍后再试!', 'error');
$.messager.alert('删除提示','删除应用信息异常,请稍后再试!','error');
return; return;
} }
}); });
@@ -314,25 +320,18 @@
} }
//批量删除 //批量删除
function batDeleteApp() function batDeleteApp() {
{
var row = $('#tableData').datagrid('getChecked'); var row = $('#tableData').datagrid('getChecked');
if(row.length == 0) if (row.length == 0) {
{ $.messager.alert('删除提示', '没有记录被选中!', 'info');
$.messager.alert('删除提示','没有记录被选中!','info');
return; return;
} }
if(row.length > 0) if (row.length > 0) {
{ $.messager.confirm('删除确认', '确定要删除选中的' + row.length + '条应用信息吗?', function (r) {
$.messager.confirm('删除确认','确定要删除选中的' + row.length + '条应用信息吗?',function(r) if (r) {
{
if (r)
{
var ids = ""; var ids = "";
for(var i = 0;i < row.length; i ++) for (var i = 0; i < row.length; i++) {
{ if (i == row.length - 1) {
if(i == row.length-1)
{
ids += row[i].Id; ids += row[i].Id;
break; break;
} }
@@ -340,30 +339,27 @@
ids += row[i].Id + ","; ids += row[i].Id + ",";
} }
$.ajax({ $.ajax({
type:"post", type: "post",
url: "<%=path %>/app/batchDelete.action", url: "<%=path %>/app/batchDelete.action",
dataType: "json", dataType: "json",
async : false, async: false,
data: ({ data: ({
appIDs : ids, appIDs: ids,
clientIp:'<%=clientIp %>' clientIp: '<%=clientIp %>'
}), }),
success: function (tipInfo) success: function (tipInfo) {
{
var msg = tipInfo.showModel.msgTip; var msg = tipInfo.showModel.msgTip;
if(msg == '成功') if (msg == '成功') {
{
//加载完以后重新初始化 //加载完以后重新初始化
$("#searchBtn").click(); $("#searchBtn").click();
$(":checkbox").attr("checked",false); $(":checkbox").attr("checked", false);
} }
else else
$.messager.alert('删除提示','删除应用信息失败,请稍后再试!','error'); $.messager.alert('删除提示', '删除应用信息失败,请稍后再试!', 'error');
}, },
//此处添加错误处理 //此处添加错误处理
error:function() error: function () {
{ $.messager.alert('删除提示', '删除应用信息异常,请稍后再试!', 'error');
$.messager.alert('删除提示','删除应用信息异常,请稍后再试!','error');
return; return;
} }
}); });
@@ -378,12 +374,11 @@
//保存编辑前的名称 //保存编辑前的名称
var orgApp = ""; var orgApp = "";
function addApp() function addApp() {
{
$("#clientIp").val('<%=clientIp %>'); $("#clientIp").val('<%=clientIp %>');
$('#appFM').form('clear'); $('#appFM').form('clear');
$('#appDlg').dialog('open').dialog('setTitle','<img src="<%=path%>/js/easyui-1.3.5/themes/icons/edit_add.png"/>&nbsp;增加应用信息'); $('#appDlg').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}); $(".window-mask").css({width: webW, height: webH});
$("#name").val("").focus(); $("#name").val("").focus();
orgApp = ""; orgApp = "";
@@ -392,62 +387,57 @@
$("#Icon").empty();//清除上传控件数据 $("#Icon").empty();//清除上传控件数据
$(".fileUploadContent").initUpload({ $(".fileUploadContent").initUpload({
"uploadUrl": "<%=path %>/app/uploadImg.action",//上传文件信息地址 "uploadUrl": "<%=path %>/app/uploadImg.action",//上传文件信息地址
"progressUrl":"#",//获取进度信息地址可选注意需要返回的data格式如下{bytesRead: 102516060, contentLength: 102516060, items: 1, percent: 100, startTime: 1489223136317, useTime: 2767} "progressUrl": "#",//获取进度信息地址可选注意需要返回的data格式如下{bytesRead: 102516060, contentLength: 102516060, items: 1, percent: 100, startTime: 1489223136317, useTime: 2767}
//"showSummerProgress":false,//总进度条,默认限制 //"showSummerProgress":false,//总进度条,默认限制
//"size":350,//文件大小限制单位kb,默认不限制 //"size":350,//文件大小限制单位kb,默认不限制
"maxFileNumber":1,//文件个数限制,为整数 "maxFileNumber": 1,//文件个数限制,为整数
//"filelSavePath":"",//文件上传地址,后台设置的根目录 //"filelSavePath":"",//文件上传地址,后台设置的根目录
//"beforeUpload":beforeUploadFun,//在上传前执行的函数 //"beforeUpload":beforeUploadFun,//在上传前执行的函数
//"onUpload":onUploadFun, //在上传后执行的函数 //"onUpload":onUploadFun, //在上传后执行的函数
autoCommit:true, //文件是否自动上传 autoCommit: true, //文件是否自动上传
"fileType":['png','jpg']//文件类型限制,默认不限制,注意写的是文件后缀 "fileType": ['png', 'jpg']//文件类型限制,默认不限制,注意写的是文件后缀
}); });
} }
//保存信息 //保存信息
$("#saveApp").unbind().bind({ $("#saveApp").unbind().bind({
click:function() click: function () {
{ if (!$('#appFM').form('validate'))
if(!$('#appFM').form('validate'))
return; return;
else if(checkAppName()) else if (checkAppName())
return; return;
else else {
{
$.ajax({ $.ajax({
type:"post", type: "post",
url: url, url: url,
dataType: "json", dataType: "json",
async : false, async: false,
fileElementId:'Icon', fileElementId: 'Icon',
data: ({ data: ({
Number : $.trim($("#Number").val()), Number: $.trim($("#Number").val()),
Name : $.trim($("#Name").val()), Name: $.trim($("#Name").val()),
Type : $.trim($("#Type").val()), Type: $.trim($("#Type").val()),
Icon : $.trim($("#Icon .fileItem .fileName").text()), Icon: $.trim($("#Icon .fileItem .fileName").text()),
URL : $.trim($("#URL").val()), URL: $.trim($("#URL").val()),
Width : $.trim($("#Width").val()), Width: $.trim($("#Width").val()),
Height : $.trim($("#Height").val()), Height: $.trim($("#Height").val()),
ReSize : $("#ReSize").is(':checked'), ReSize: $("#ReSize").is(':checked'),
OpenMax : $("#OpenMax").is(':checked'), OpenMax: $("#OpenMax").is(':checked'),
Flash : $("#Flash").is(':checked'), Flash: $("#Flash").is(':checked'),
ZL : $.trim($("#ZL").val()), ZL: $.trim($("#ZL").val()),
Sort : $.trim($("#Sort").val()), Sort: $.trim($("#Sort").val()),
Remark : $.trim($("#Remark").val()), Remark: $.trim($("#Remark").val()),
Enabled : $("#Enabled").is(':checked'), Enabled: $("#Enabled").is(':checked'),
clientIp:'<%=clientIp %>' clientIp: '<%=clientIp %>'
}), }),
success: function (tipInfo) success: function (tipInfo) {
{ if (tipInfo) {
if(tipInfo)
{
$('#appDlg').dialog('close'); $('#appDlg').dialog('close');
var opts = $("#tableData").datagrid('options'); var opts = $("#tableData").datagrid('options');
showAppDetails(opts.pageNumber,opts.pageSize); showAppDetails(opts.pageNumber, opts.pageSize);
} }
else else {
{
$.messager.show({ $.messager.show({
title: '错误提示', title: '错误提示',
msg: '保存应用信息失败,请稍后重试!' msg: '保存应用信息失败,请稍后重试!'
@@ -455,9 +445,8 @@
} }
}, },
//此处添加错误处理 //此处添加错误处理
error:function() error: function () {
{ $.messager.alert('提示', '保存应用信息异常,请稍后再试!', 'error');
$.messager.alert('提示','保存应用信息异常,请稍后再试!','error');
return; return;
} }
}); });
@@ -466,8 +455,7 @@
}); });
//编辑信息 //编辑信息
function editApp(appTotalInfo) function editApp(appTotalInfo) {
{
var appInfo = appTotalInfo.split("AaBb"); var appInfo = appTotalInfo.split("AaBb");
$("#clientIp").val('<%=clientIp %>'); $("#clientIp").val('<%=clientIp %>');
$("#Number").focus().val(appInfo[1]); $("#Number").focus().val(appInfo[1]);
@@ -477,17 +465,17 @@
$("#URL").val(appInfo[5]); $("#URL").val(appInfo[5]);
$("#Width").val(appInfo[6]); $("#Width").val(appInfo[6]);
$("#Height").val(appInfo[7]); $("#Height").val(appInfo[7]);
$("#ReSize").attr("checked",appInfo[8]=='true'?true:false); $("#ReSize").attr("checked", appInfo[8] == 'true' ? true : false);
$("#OpenMax").attr("checked",appInfo[9]=='true'?true:false); $("#OpenMax").attr("checked", appInfo[9] == 'true' ? true : false);
$("#Flash").attr("checked",appInfo[10]=='true'?true:false); $("#Flash").attr("checked", appInfo[10] == 'true' ? true : false);
$("#ZL").val(appInfo[11]); $("#ZL").val(appInfo[11]);
$("#Sort").val(appInfo[12]); $("#Sort").val(appInfo[12]);
$("#Remark").val(appInfo[13]); $("#Remark").val(appInfo[13]);
$("#Enabled").attr("checked",appInfo[14]=='true'?true:false); $("#Enabled").attr("checked", appInfo[14] == 'true' ? true : false);
orgApp = appInfo[2]; orgApp = appInfo[2];
$('#appDlg').dialog('open').dialog('setTitle','<img src="<%=path%>/js/easyui-1.3.5/themes/icons/pencil.png"/>&nbsp;编辑应用信息'); $('#appDlg').dialog('open').dialog('setTitle', '<img src="<%=path%>/js/easyui-1.3.5/themes/icons/pencil.png"/>&nbsp;编辑应用信息');
$(".window-mask").css({ width: webW ,height: webH}); $(".window-mask").css({width: webW, height: webH});
appID = appInfo[0]; appID = appInfo[0];
//焦点在名称输入框==定焦在输入文字后面 //焦点在名称输入框==定焦在输入文字后面
$("#name").val("").focus().val(appInfo[1]); $("#name").val("").focus().val(appInfo[1]);
@@ -495,38 +483,33 @@
} }
//检查名称是否存在 ++ 重名无法提示问题需要跟进 //检查名称是否存在 ++ 重名无法提示问题需要跟进
function checkAppName() function checkAppName() {
{
var name = $.trim($("#Name").val()); var name = $.trim($("#Name").val());
//表示是否存在 true == 存在 false = 不存在 //表示是否存在 true == 存在 false = 不存在
var flag = false; var flag = false;
//开始ajax名称检验不能重名 //开始ajax名称检验不能重名
if(name.length > 0 &&( orgApp.length ==0 || name != orgApp)) if (name.length > 0 && (orgApp.length == 0 || name != orgApp)) {
{
$.ajax({ $.ajax({
type:"post", type: "post",
url: "<%=path %>/app/checkIsNameExist.action", url: "<%=path %>/app/checkIsNameExist.action",
dataType: "json", dataType: "json",
async : false, async: false,
data: ({ data: ({
appID : appID, appID: appID,
name : name name: name
}), }),
success: function (tipInfo) success: function (tipInfo) {
{
flag = tipInfo; flag = tipInfo;
if(tipInfo) if (tipInfo) {
{ $.messager.alert('提示', '应用名称已经存在', 'info');
$.messager.alert('提示','应用名称已经存在','info');
//alert("应用名称已经存在"); //alert("应用名称已经存在");
//$("#name").val(""); //$("#name").val("");
return; return;
} }
}, },
//此处添加错误处理 //此处添加错误处理
error:function() error: function () {
{ $.messager.alert('提示', '检查应用名称是否存在异常,请稍后再试!', 'error');
$.messager.alert('提示','检查应用名称是否存在异常,请稍后再试!','error');
return; return;
} }
}); });
@@ -536,41 +519,37 @@
//搜索处理 //搜索处理
$("#searchBtn").unbind().bind({ $("#searchBtn").unbind().bind({
click:function() click: function () {
{ showAppDetails(1, initPageSize);
showAppDetails(1,initPageSize);
var opts = $("#tableData").datagrid('options'); var opts = $("#tableData").datagrid('options');
var pager = $("#tableData").datagrid('getPager'); var pager = $("#tableData").datagrid('getPager');
opts.pageNumber = 1; opts.pageNumber = 1;
opts.pageSize = initPageSize; opts.pageSize = initPageSize;
pager.pagination('refresh', pager.pagination('refresh',
{ {
pageNumber:1, pageNumber: 1,
pageSize:initPageSize pageSize: initPageSize
}); });
} }
}); });
function showAppDetails(pageNo,pageSize) function showAppDetails(pageNo, pageSize) {
{
$.ajax({ $.ajax({
type:"post", type: "post",
url: "<%=path %>/app/findBy.action", url: "<%=path %>/app/findBy.action",
dataType: "json", dataType: "json",
data: ({ data: ({
Name:$.trim($("#searchName").val()), Name: $.trim($("#searchName").val()),
Type:$.trim($("#searchType").val()), Type: $.trim($("#searchType").val()),
pageNo:pageNo, pageNo: pageNo,
pageSize:pageSize pageSize: pageSize
}), }),
success: function (data) success: function (data) {
{ $("#tableData").datagrid('loadData', data);
$("#tableData").datagrid('loadData',data);
}, },
//此处添加错误处理 //此处添加错误处理
error:function() error: function () {
{ $.messager.alert('查询提示', '查询数据后台异常,请稍后再试!', 'error');
$.messager.alert('查询提示','查询数据后台异常,请稍后再试!','error');
return; return;
} }
}); });
@@ -578,7 +557,7 @@
//重置按钮 //重置按钮
$("#searchResetBtn").unbind().bind({ $("#searchResetBtn").unbind().bind({
click:function(){ click: function () {
$("#searchName").val(""); $("#searchName").val("");
$("#searchType").val(""); $("#searchType").val("");
@@ -586,6 +565,6 @@
$("#searchBtn").click(); $("#searchBtn").click();
} }
}); });
</script> </script>
</body> </body>
</html> </html>

View File

@@ -1,30 +1,31 @@
<%@page import="com.jsh.util.Tools"%> <%@page import="com.jsh.util.Tools" %>
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%> <%@ page language="java" pageEncoding="utf-8" %>
<% <%
String path = request.getContextPath(); String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/"; String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + path + "/";
String clientIp = Tools.getLocalIp(request); String clientIp = Tools.getLocalIp(request);
%> %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <!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"> <html xmlns="http://www.w3.org/1999/xhtml">
<head> <head>
<title>资产管理</title> <title>资产管理</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<!-- 指定以IE8的方式来渲染 --> <!-- 指定以IE8的方式来渲染 -->
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE8"/> <meta http-equiv="X-UA-Compatible" content="IE=EmulateIE8"/>
<link rel="shortcut icon" href="<%=path%>/images/favicon.ico" type="image/x-icon" /> <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/default/easyui.css"/>
<link rel="stylesheet" type="text/css" href="<%=path %>/js/easyui-1.3.5/themes/icon.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" /> <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/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/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/locale/easyui-lang-zh_CN.js"></script>
<script type="text/javascript" src="<%=path %>/js/common/common.js"></script> <script type="text/javascript" src="<%=path %>/js/common/common.js"></script>
</head> </head>
<body> <body>
<div id="position" class="easyui-panel" title="当前位置:系统管理 &gt; 资产名称" collapsible="false" closable="false"/> <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"> <div id="searchPanel" class="easyui-panel" style="padding:10px;" title="查询窗口" iconCls="icon-search" collapsible="true"
closable="false">
<table id="searchTable"> <table id="searchTable">
<tr> <tr>
<td>类型名称:</td> <td>类型名称:</td>
@@ -66,24 +67,28 @@
<td colspan="7">&nbsp;</td> <td colspan="7">&nbsp;</td>
</tr> </tr>
</table> </table>
</div> </div>
<!-- 数据显示table --> <!-- 数据显示table -->
<div id = "tablePanel" class="easyui-panel" style="padding:1px;top:300px;" title="资产名称列表" iconCls="icon-list" collapsible="true" closable="false"> <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> <table id="tableData" style="top:300px;border-bottom-color:#FFFFFF"></table>
</div> </div>
<div id="assetnameDlg" class="easyui-dialog" style="padding: 10px 20px;" closed="true" buttons="#dlg-buttons" modal="true" cache="false" collapsible="false" closable="true"> <div id="assetnameDlg" class="easyui-dialog" style="padding: 10px 20px;" closed="true" buttons="#dlg-buttons"
modal="true" cache="false" collapsible="false" closable="true">
<form id="assetnameFM" method="post" novalidate> <form id="assetnameFM" method="post" novalidate>
<div class="fitem" style="padding:5px"> <div class="fitem" style="padding:5px">
<label id="assetNameLabel">资产名称&nbsp;&nbsp;</label> <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"/> <input name="assetName" id="assetName" class="easyui-validatebox"
data-options="required:true,validType:'length[2,30]'" style="width: 230px;height: 20px"/>
</div> </div>
<div class="fitem" style="padding:5px"> <div class="fitem" style="padding:5px">
<label id="categoryLabel">资产类型&nbsp;&nbsp;</label> <label id="categoryLabel">资产类型&nbsp;&nbsp;</label>
<select name="category" id="category" style="width:230px;height: 20px"> <select name="category" id="category" style="width:230px;height: 20px">
</select> </select>
&nbsp;&nbsp;<img id="addCategory" src="<%=path %>/js/easyui-1.3.5/themes/icons/edit_add.png" style="cursor: pointer;" alt="增加资产类型" title="增加资产类型" /> &nbsp;&nbsp;<img id="addCategory" src="<%=path %>/js/easyui-1.3.5/themes/icons/edit_add.png"
style="cursor: pointer;" alt="增加资产类型" title="增加资产类型"/>
</div> </div>
<div class="fitem" style="padding:5px"> <div class="fitem" style="padding:5px">
<label id="consumableLabel">是否耗材&nbsp;&nbsp;</label> <label id="consumableLabel">是否耗材&nbsp;&nbsp;</label>
@@ -98,17 +103,20 @@
</div> </div>
<input type="hidden" name="clientIp" id="clientIp" value="<%=clientIp %>"/> <input type="hidden" name="clientIp" id="clientIp" value="<%=clientIp %>"/>
</form> </form>
</div> </div>
<div id="dlg-buttons"> <div id="dlg-buttons">
<a href="javascript:void(0)" id="saveAssetName" class="easyui-linkbutton" iconCls="icon-ok">保存</a> <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> <a href="javascript:void(0)" id="cancelAssetName" class="easyui-linkbutton" iconCls="icon-cancel"
</div> onclick="javascript:$('#assetnameDlg').dialog('close')">取消</a>
<!--增加类型信息 --> </div>
<div id="categoryDlg" class="easyui-dialog" style="padding: 10px 20px;" closed="true" buttons="#dlg-buttons1" modal="true" cache="false" collapsible="false" closable="true"> <!--增加类型信息 -->
<div id="categoryDlg" class="easyui-dialog" style="padding: 10px 20px;" closed="true" buttons="#dlg-buttons1"
modal="true" cache="false" collapsible="false" closable="true">
<form id="categoryFM" method="post" novalidate> <form id="categoryFM" method="post" novalidate>
<div class="fitem" style="padding:5px"> <div class="fitem" style="padding:5px">
<label id="categoryNameLabel">类型名称&nbsp;&nbsp;</label> <label id="categoryNameLabel">类型名称&nbsp;&nbsp;</label>
<input name="categoryName" id="categoryName" class="easyui-validatebox" data-options="required:true,validType:'length[2,30]'" style="width: 230px;height: 20px"/> <input name="categoryName" id="categoryName" class="easyui-validatebox"
data-options="required:true,validType:'length[2,30]'" style="width: 230px;height: 20px"/>
</div> </div>
<div class="fitem" style="padding:5px;"> <div class="fitem" style="padding:5px;">
<label id="catedescriptionLabel">描&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;述&nbsp;&nbsp;</label> <label id="catedescriptionLabel">描&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;述&nbsp;&nbsp;</label>
@@ -116,17 +124,17 @@
</div> </div>
<input type="hidden" name="clientIp" id="clientIp" value="<%=clientIp %>"/> <input type="hidden" name="clientIp" id="clientIp" value="<%=clientIp %>"/>
</form> </form>
</div> </div>
<div id="dlg-buttons1"> <div id="dlg-buttons1">
<a href="javascript:void(0)" id="saveCategory" class="easyui-linkbutton" iconCls="icon-ok">保存</a> <a href="javascript:void(0)" id="saveCategory" class="easyui-linkbutton" iconCls="icon-ok">保存</a>
<a href="javascript:void(0)" id="cancelCategory" class="easyui-linkbutton" iconCls="icon-cancel" onclick="javascript:$('#categoryDlg').dialog('close')">取消</a> <a href="javascript:void(0)" id="cancelCategory" class="easyui-linkbutton" iconCls="icon-cancel"
</div> onclick="javascript:$('#categoryDlg').dialog('close')">取消</a>
<script type="text/javascript"> </div>
<script type="text/javascript">
var categoryList = null; var categoryList = null;
var categoryID = null; var categoryID = null;
//初始化界面 //初始化界面
$(function() $(function () {
{
//初始化系统基础信息 //初始化系统基础信息
initSystemData(); initSystemData();
initSelectInfo(); initSelectInfo();
@@ -137,10 +145,8 @@
}); });
//浏览器适配 //浏览器适配
function browserFit() function browserFit() {
{ if (getOs() == 'MSIE') {
if(getOs()=='MSIE')
{
$("#searchDescLabel").empty().append("描&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;述:"); $("#searchDescLabel").empty().append("描&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;述:");
$("#descriptionLabel").empty().append("描&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;述&nbsp;&nbsp;"); $("#descriptionLabel").empty().append("描&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;述&nbsp;&nbsp;");
$("#assetNameLabel").empty().append("资产名称&nbsp;&nbsp;"); $("#assetNameLabel").empty().append("资产名称&nbsp;&nbsp;");
@@ -151,8 +157,7 @@
$("#catedescriptionLabel").empty().append("描&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;述&nbsp;&nbsp;"); $("#catedescriptionLabel").empty().append("描&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;述&nbsp;&nbsp;");
} }
else else {
{
$("#searchDescLabel").empty().append("描&nbsp;&nbsp;&nbsp;&nbsp;述:"); $("#searchDescLabel").empty().append("描&nbsp;&nbsp;&nbsp;&nbsp;述:");
$("#descriptionLabel").empty().append("描&nbsp;&nbsp;&nbsp;&nbsp;述&nbsp;"); $("#descriptionLabel").empty().append("描&nbsp;&nbsp;&nbsp;&nbsp;述&nbsp;");
$("#assetNameLabel").empty().append("资产名称&nbsp;"); $("#assetNameLabel").empty().append("资产名称&nbsp;");
@@ -165,39 +170,33 @@
} }
//初始化系统基础信息 //初始化系统基础信息
function initSystemData() function initSystemData() {
{
$.ajax({ $.ajax({
type:"post", type: "post",
url: "<%=path%>/asset/getBasicData.action", url: "<%=path%>/asset/getBasicData.action",
//设置为同步 //设置为同步
async:false, async: false,
dataType: "json", dataType: "json",
success: function (systemInfo) success: function (systemInfo) {
{
categoryList = systemInfo.showModel.map.categoryList; categoryList = systemInfo.showModel.map.categoryList;
var msgTip = systemInfo.showModel.msgTip; var msgTip = systemInfo.showModel.msgTip;
if(msgTip == "exceptoin") if (msgTip == "exceptoin") {
{ $.messager.alert('提示', '查找系统基础信息异常,请与管理员联系!', 'error');
$.messager.alert('提示','查找系统基础信息异常,请与管理员联系!','error');
return; return;
} }
} }
}); });
} }
//初始化页面选项卡 //初始化页面选项卡
function initSelectInfo() function initSelectInfo() {
{
var options = ""; var options = "";
if(categoryList !=null) if (categoryList != null) {
{
options = ""; options = "";
for(var i = 0 ;i < categoryList.length;i ++) for (var i = 0; i < categoryList.length; i++) {
{
var category = categoryList[i]; var category = categoryList[i];
if(0 == i) if (0 == i) {
{
categoryID = category.id; categoryID = category.id;
} }
options += '<option value="' + category.id + '">' + category.assetname + '</option>'; options += '<option value="' + category.id + '">' + category.assetname + '</option>';
@@ -206,164 +205,149 @@
$("#searchCategory").empty().append('<option value="">请选择</option>').append(options); $("#searchCategory").empty().append('<option value="">请选择</option>').append(options);
} }
} }
//防止表单提交重复 //防止表单提交重复
function initForm() function initForm() {
{
$('#assetnameFM').form({ $('#assetnameFM').form({
onSubmit: function(){ onSubmit: function () {
return false; return false;
} }
}); });
$('#categoryFM').form({ $('#categoryFM').form({
onSubmit: function(){ onSubmit: function () {
return false; return false;
} }
}); });
} }
//初始化表格数据 //初始化表格数据
function initTableData() function initTableData() {
{
$('#tableData').datagrid({ $('#tableData').datagrid({
//title:'资产名称列表', //title:'资产名称列表',
//iconCls:'icon-save', //iconCls:'icon-save',
//width:700, //width:700,
height:heightInfo, height: heightInfo,
nowrap: false, nowrap: false,
rownumbers: false, rownumbers: false,
//动画效果 //动画效果
animate:false, animate: false,
//选中单行 //选中单行
singleSelect : true, singleSelect: true,
collapsible:false, collapsible: false,
selectOnCheck:false, selectOnCheck: false,
//fitColumns:true, //fitColumns:true,
//单击行是否选中 //单击行是否选中
checkOnSelect : false, checkOnSelect: false,
//交替出现背景 //交替出现背景
striped : true, striped: true,
url:'<%=path %>/assetname/findBy.action?pageSize=' + initPageSize, url: '<%=path %>/assetname/findBy.action?pageSize=' + initPageSize,
pagination: true, pagination: true,
//loadFilter: pagerFilter, //loadFilter: pagerFilter,
pageSize: initPageSize, pageSize: initPageSize,
pageList: initPageNum, pageList: initPageNum,
columns:[[ columns: [[
{ field: 'id',width:35,align:"center",checkbox:true}, {field: 'id', width: 35, align: "center", checkbox: true},
{ title: '资产名称',field: 'assetname',width:200}, {title: '资产名称', field: 'assetname', width: 200},
{ title: '资产类型',field: 'category',width:200}, {title: '资产类型', field: 'category', width: 200},
{ title: '是否耗材',field: 'consumable',width:100,align:"center"}, {title: '是否耗材', field: 'consumable', width: 100, align: "center"},
{ title: '描述',field: 'description',width:400}, {title: '描述', field: 'description', width: 400},
{ title: '操作',field: 'op',align:"center",width:130,formatter:function(value,rec)
{ {
title: '操作', field: 'op', align: "center", width: 130, formatter: function (value, rec) {
var str = ''; var str = '';
var rowInfo = rec.id + 'AaBb' + rec.assetname + 'AaBb' + rec.consumableStatus + 'AaBb' + rec.isystem + 'AaBb' + rec.description + 'AaBb' + rec.categoryID; var rowInfo = rec.id + 'AaBb' + rec.assetname + 'AaBb' + rec.consumableStatus + 'AaBb' + rec.isystem + 'AaBb' + rec.description + 'AaBb' + rec.categoryID;
if(1 == value) if (1 == value) {
{
str += '<img src="<%=path%>/js/easyui-1.3.5/themes/icons/pencil.png" style="cursor: pointer;" onclick="editAssetName(\'' + rowInfo + '\');"/>&nbsp;<a onclick="editAssetName(\'' + 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/pencil.png" style="cursor: pointer;" onclick="editAssetName(\'' + rowInfo + '\');"/>&nbsp;<a onclick="editAssetName(\'' + 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="deleteAssetName('+ rec.id +');"/>&nbsp;<a onclick="deleteAssetName('+ rec.id +');" 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="deleteAssetName(' + rec.id + ');"/>&nbsp;<a onclick="deleteAssetName(' + rec.id + ');" style="text-decoration:none;color:black;" href="javascript:void(0)">删除</a>&nbsp;&nbsp;';
} }
return str; return str;
} }
} }
]], ]],
toolbar:[ toolbar: [
{
id:'addAssetName',
text:'增加',
iconCls:'icon-add',
handler:function()
{ {
id: 'addAssetName',
text: '增加',
iconCls: 'icon-add',
handler: function () {
addAssetName(); addAssetName();
} }
}, },
{ {
id:'deleteAssetName', id: 'deleteAssetName',
text:'删除', text: '删除',
iconCls:'icon-remove', iconCls: 'icon-remove',
handler:function() handler: function () {
{
batDeleteAssetName(); batDeleteAssetName();
} }
} }
], ],
onLoadError:function() onLoadError: function () {
{ $.messager.alert('页面加载提示', '页面加载异常,请稍后再试!', 'error');
$.messager.alert('页面加载提示','页面加载异常,请稍后再试!','error');
return; return;
} }
}); });
} }
//初始化键盘enter事件 //初始化键盘enter事件
$(document).keydown(function(event) $(document).keydown(function (event) {
{
//兼容 IE和firefox 事件 //兼容 IE和firefox 事件
var e = window.event || event; var e = window.event || event;
var k = e.keyCode||e.which||e.charCode; var k = e.keyCode || e.which || e.charCode;
//兼容 IE,firefox 兼容 //兼容 IE,firefox 兼容
var obj = e.srcElement ? e.srcElement : e.target; var obj = e.srcElement ? e.srcElement : e.target;
//绑定键盘事件为 id是指定的输入框才可以触发键盘事件 13键盘事件 ---遗留问题 enter键效验 对话框会关闭问题 //绑定键盘事件为 id是指定的输入框才可以触发键盘事件 13键盘事件 ---遗留问题 enter键效验 对话框会关闭问题
if(k == "13"&&(obj.id=="assetName"|| obj.id=="description"|| obj.id=="consumable" || obj.id=="category" )) if (k == "13" && (obj.id == "assetName" || obj.id == "description" || obj.id == "consumable" || obj.id == "category")) {
{
$("#saveAssetName").click(); $("#saveAssetName").click();
} }
//绑定键盘事件为 id是指定的输入框才可以触发键盘事件 13键盘事件 ---遗留问题 enter键效验 对话框会关闭问题 //绑定键盘事件为 id是指定的输入框才可以触发键盘事件 13键盘事件 ---遗留问题 enter键效验 对话框会关闭问题
if(k == "13"&&(obj.id=="categoryName"|| obj.id=="description" )) if (k == "13" && (obj.id == "categoryName" || obj.id == "description")) {
{
$("#saveCategory").click(); $("#saveCategory").click();
} }
//搜索按钮添加快捷键 //搜索按钮添加快捷键
if(k == "13"&&(obj.id=="searchAssetName" || obj.id=="searchDesc" || obj.id=="searchCategory" )) if (k == "13" && (obj.id == "searchAssetName" || obj.id == "searchDesc" || obj.id == "searchCategory")) {
{
$("#searchBtn").click(); $("#searchBtn").click();
} }
}); });
$("#addCategory").unbind().bind({ $("#addCategory").unbind().bind({
click:function() click: function () {
{
$("#clientIp").val('<%=clientIp %>'); $("#clientIp").val('<%=clientIp %>');
$("#categoryName").val("").focus(); $("#categoryName").val("").focus();
$("#descriptioncate").val(""); $("#descriptioncate").val("");
$('#categoryDlg').dialog({width : 390}).dialog('open').dialog('setTitle','<img src="<%=path%>/js/easyui-1.3.5/themes/icons/edit_add.png"/>&nbsp;增加资产类型信息'); $('#categoryDlg').dialog({width: 390}).dialog('open').dialog('setTitle', '<img src="<%=path%>/js/easyui-1.3.5/themes/icons/edit_add.png"/>&nbsp;增加资产类型信息');
$("#categoryName").focus(); $("#categoryName").focus();
} }
}); });
//保存信息 //保存信息
$("#saveCategory").unbind().bind({ $("#saveCategory").unbind().bind({
click:function() click: function () {
{ if (!$('#categoryFM').form('validate'))
if(!$('#categoryFM').form('validate'))
return; return;
else if(checkCategoryName()) else if (checkCategoryName())
return; return;
else else {
{
$.ajax({ $.ajax({
type:"post", type: "post",
url: '<%=path %>/category/create.action', url: '<%=path %>/category/create.action',
dataType: "json", dataType: "json",
async : false, async: false,
data: ({ data: ({
categoryName : $.trim($("#categoryName").val()), categoryName: $.trim($("#categoryName").val()),
description : $.trim($("#descriptioncate").val()), description: $.trim($("#descriptioncate").val()),
clientIp:'<%=clientIp %>' clientIp: '<%=clientIp %>'
}), }),
success: function (tipInfo) success: function (tipInfo) {
{ if (tipInfo) {
if(tipInfo)
{
$('#categoryDlg').dialog('close'); $('#categoryDlg').dialog('close');
//初始化系统基础信息 //初始化系统基础信息
initSystemData(); initSystemData();
initSelectInfo(); initSelectInfo();
} }
else else {
{
$.messager.show({ $.messager.show({
title: '错误提示', title: '错误提示',
msg: '保存资产类别信息失败,请稍后重试!' msg: '保存资产类别信息失败,请稍后重试!'
@@ -371,9 +355,8 @@
} }
}, },
//此处添加错误处理 //此处添加错误处理
error:function() error: function () {
{ $.messager.alert('提示', '保存资产类型信息异常,请稍后再试!', 'error');
$.messager.alert('提示','保存资产类型信息异常,请稍后再试!','error');
return; return;
} }
}); });
@@ -382,38 +365,33 @@
}); });
//检查名称是否存在 ++ 重名无法提示问题需要跟进 //检查名称是否存在 ++ 重名无法提示问题需要跟进
function checkCategoryName() function checkCategoryName() {
{
var categoryName = $.trim($("#categoryName").val()); var categoryName = $.trim($("#categoryName").val());
//表示是否存在 true == 存在 false = 不存在 //表示是否存在 true == 存在 false = 不存在
var flag = false; var flag = false;
//开始ajax名称检验不能重名 //开始ajax名称检验不能重名
if(categoryName.length > 0) if (categoryName.length > 0) {
{
$.ajax({ $.ajax({
type:"post", type: "post",
url: "<%=path %>/category/checkIsNameExist.action", url: "<%=path %>/category/checkIsNameExist.action",
dataType: "json", dataType: "json",
async : false, async: false,
data: ({ data: ({
categoryID : 0, categoryID: 0,
categoryName : categoryName categoryName: categoryName
}), }),
success: function (tipInfo) success: function (tipInfo) {
{
flag = tipInfo; flag = tipInfo;
if(tipInfo) if (tipInfo) {
{ $.messager.alert('提示', '资产类型名称已经存在', 'info');
$.messager.alert('提示','资产类型名称已经存在','info');
//alert("资产名称名称已经存在"); //alert("资产名称名称已经存在");
//$("#supplier").val(""); //$("#supplier").val("");
return; return;
} }
}, },
//此处添加错误处理 //此处添加错误处理
error:function() error: function () {
{ $.messager.alert('提示', '检查资产类型名称是否存在异常,请稍后再试!', 'error');
$.messager.alert('提示','检查资产类型名称是否存在异常,请稍后再试!','error');
return; return;
} }
}); });
@@ -422,62 +400,52 @@
} }
//分页信息处理 //分页信息处理
function ininPager() function ininPager() {
{ try {
try
{
var opts = $("#tableData").datagrid('options'); var opts = $("#tableData").datagrid('options');
var pager = $("#tableData").datagrid('getPager'); var pager = $("#tableData").datagrid('getPager');
pager.pagination({ pager.pagination({
onSelectPage:function(pageNum, pageSize) onSelectPage: function (pageNum, pageSize) {
{
opts.pageNumber = pageNum; opts.pageNumber = pageNum;
opts.pageSize = pageSize; opts.pageSize = pageSize;
pager.pagination('refresh', pager.pagination('refresh',
{ {
pageNumber:pageNum, pageNumber: pageNum,
pageSize:pageSize pageSize: pageSize
}); });
showAssetNameDetails(pageNum,pageSize); showAssetNameDetails(pageNum, pageSize);
} }
}); });
} }
catch (e) catch (e) {
{ $.messager.alert('异常处理提示', "分页信息异常 : " + e.name + ": " + e.message, 'error');
$.messager.alert('异常处理提示',"分页信息异常 : " + e.name + ": " + e.message,'error');
} }
} }
//删除资产名称信息 //删除资产名称信息
function deleteAssetName(assetNameID) function deleteAssetName(assetNameID) {
{ $.messager.confirm('删除确认', '确定要删除此资产名称信息吗?', function (r) {
$.messager.confirm('删除确认','确定要删除此资产名称信息吗?',function(r) if (r) {
{
if (r)
{
$.ajax({ $.ajax({
type:"post", type: "post",
url: "<%=path %>/assetname/delete.action", url: "<%=path %>/assetname/delete.action",
dataType: "json", dataType: "json",
data: ({ data: ({
assetNameID : assetNameID, assetNameID: assetNameID,
clientIp:'<%=clientIp %>' clientIp: '<%=clientIp %>'
}), }),
success: function (tipInfo) success: function (tipInfo) {
{
var msg = tipInfo.showModel.msgTip; var msg = tipInfo.showModel.msgTip;
if(msg == '成功') if (msg == '成功') {
{
//加载完以后重新初始化 //加载完以后重新初始化
$("#searchBtn").click(); $("#searchBtn").click();
} }
else else
$.messager.alert('删除提示','删除资产名称信息失败,请稍后再试!','error'); $.messager.alert('删除提示', '删除资产名称信息失败,请稍后再试!', 'error');
}, },
//此处添加错误处理 //此处添加错误处理
error:function() error: function () {
{ $.messager.alert('删除提示', '删除资产名称信息异常,请稍后再试!', 'error');
$.messager.alert('删除提示','删除资产名称信息异常,请稍后再试!','error');
return; return;
} }
}); });
@@ -486,25 +454,18 @@
} }
//批量删除资产名称 //批量删除资产名称
function batDeleteAssetName() function batDeleteAssetName() {
{
var row = $('#tableData').datagrid('getChecked'); var row = $('#tableData').datagrid('getChecked');
if(row.length == 0) if (row.length == 0) {
{ $.messager.alert('删除提示', '没有记录被选中!', 'info');
$.messager.alert('删除提示','没有记录被选中!','info');
return; return;
} }
if(row.length > 0) if (row.length > 0) {
{ $.messager.confirm('删除确认', '确定要删除选中的' + row.length + '条资产名称信息吗?', function (r) {
$.messager.confirm('删除确认','确定要删除选中的' + row.length + '条资产名称信息吗?',function(r) if (r) {
{
if (r)
{
var ids = ""; var ids = "";
for(var i = 0;i < row.length; i ++) for (var i = 0; i < row.length; i++) {
{ if (i == row.length - 1) {
if(i == row.length-1)
{
ids += row[i].id; ids += row[i].id;
break; break;
} }
@@ -512,30 +473,27 @@
ids += row[i].id + ","; ids += row[i].id + ",";
} }
$.ajax({ $.ajax({
type:"post", type: "post",
url: "<%=path %>/assetname/batchDelete.action", url: "<%=path %>/assetname/batchDelete.action",
dataType: "json", dataType: "json",
async : false, async: false,
data: ({ data: ({
assetNameIDs : ids, assetNameIDs: ids,
clientIp:'<%=clientIp %>' clientIp: '<%=clientIp %>'
}), }),
success: function (tipInfo) success: function (tipInfo) {
{
var msg = tipInfo.showModel.msgTip; var msg = tipInfo.showModel.msgTip;
if(msg == '成功') if (msg == '成功') {
{
//加载完以后重新初始化 //加载完以后重新初始化
$("#searchBtn").click(); $("#searchBtn").click();
$(":checkbox").attr("checked",false); $(":checkbox").attr("checked", false);
} }
else else
$.messager.alert('删除提示','删除资产名称信息失败,请稍后再试!','error'); $.messager.alert('删除提示', '删除资产名称信息失败,请稍后再试!', 'error');
}, },
//此处添加错误处理 //此处添加错误处理
error:function() error: function () {
{ $.messager.alert('删除提示', '删除资产名称信息异常,请稍后再试!', 'error');
$.messager.alert('删除提示','删除资产名称信息异常,请稍后再试!','error');
return; return;
} }
}); });
@@ -550,18 +508,17 @@
//保存编辑前的名称 //保存编辑前的名称
var orgAssetName = ""; var orgAssetName = "";
function addAssetName() function addAssetName() {
{ $('#assetnameDlg').dialog({width: 390}).dialog('open')
$('#assetnameDlg').dialog({width : 390}).dialog('open') .dialog('setTitle', '<img src="<%=path%>/js/easyui-1.3.5/themes/icons/edit_add.png"/>&nbsp;增加资产名称信息');
.dialog('setTitle','<img src="<%=path%>/js/easyui-1.3.5/themes/icons/edit_add.png"/>&nbsp;增加资产名称信息'); $(".window-mask").css({width: webW, height: webH});
$(".window-mask").css({ width: webW ,height: webH});
$('#assetnameFM').form('clear'); $('#assetnameFM').form('clear');
var row = { var row = {
consumable:0, consumable: 0,
clientIp:'<%=clientIp %>', clientIp: '<%=clientIp %>',
category:categoryID category: categoryID
}; };
$('#assetnameFM').form('load',row); $('#assetnameFM').form('load', row);
$("#assetName").focus(); $("#assetName").focus();
orgAssetName = ""; orgAssetName = "";
assetNameID = 0; assetNameID = 0;
@@ -570,37 +527,32 @@
//保存信息 //保存信息
$("#saveAssetName").unbind().bind({ $("#saveAssetName").unbind().bind({
click:function() click: function () {
{ if (!$('#assetnameFM').form('validate'))
if(!$('#assetnameFM').form('validate'))
return; return;
else if(checkAssetName()) else if (checkAssetName())
return; return;
else else {
{
$.ajax({ $.ajax({
type:"post", type: "post",
url: url, url: url,
dataType: "json", dataType: "json",
async : false, async: false,
data: ({ data: ({
assetName : $.trim($("#assetName").val()), assetName: $.trim($("#assetName").val()),
consumable : $("#consumable").val(), consumable: $("#consumable").val(),
description : $.trim($("#description").val()), description: $.trim($("#description").val()),
clientIp:'<%=clientIp %>', clientIp: '<%=clientIp %>',
categoryID: $.trim($("#category").val()), categoryID: $.trim($("#category").val()),
}), }),
success: function (tipInfo) success: function (tipInfo) {
{ if (tipInfo) {
if(tipInfo)
{
$('#assetnameDlg').dialog('close'); $('#assetnameDlg').dialog('close');
var opts = $("#tableData").datagrid('options'); var opts = $("#tableData").datagrid('options');
showAssetNameDetails(opts.pageNumber,opts.pageSize); showAssetNameDetails(opts.pageNumber, opts.pageSize);
} }
else else {
{
$.messager.show({ $.messager.show({
title: '错误提示', title: '错误提示',
msg: '保存资产名称信息失败,请稍后重试!' msg: '保存资产名称信息失败,请稍后重试!'
@@ -608,9 +560,8 @@
} }
}, },
//此处添加错误处理 //此处添加错误处理
error:function() error: function () {
{ $.messager.alert('提示', '保存资产名称信息异常,请稍后再试!', 'error');
$.messager.alert('提示','保存资产名称信息异常,请稍后再试!','error');
return; return;
} }
}); });
@@ -619,23 +570,22 @@
}); });
//编辑信息 //编辑信息
function editAssetName(assetNameTotalInfo) function editAssetName(assetNameTotalInfo) {
{
var assetnameInfo = assetNameTotalInfo.split("AaBb"); var assetnameInfo = assetNameTotalInfo.split("AaBb");
var row = { var row = {
assetName : assetnameInfo[1], assetName: assetnameInfo[1],
consumable : assetnameInfo[2], consumable: assetnameInfo[2],
description : assetnameInfo[4], description: assetnameInfo[4],
clientIp:'<%=clientIp %>', clientIp: '<%=clientIp %>',
category:assetnameInfo[5] category: assetnameInfo[5]
}; };
orgAssetName = assetnameInfo[1]; orgAssetName = assetnameInfo[1];
$('#assetnameDlg').dialog({width : 390}).dialog('open') $('#assetnameDlg').dialog({width: 390}).dialog('open')
.dialog('setTitle','<img src="<%=path%>/js/easyui-1.3.5/themes/icons/pencil.png"/>&nbsp;编辑资产名称信息'); .dialog('setTitle', '<img src="<%=path%>/js/easyui-1.3.5/themes/icons/pencil.png"/>&nbsp;编辑资产名称信息');
$(".window-mask").css({ width: webW ,height: webH}); $(".window-mask").css({width: webW, height: webH});
$('#assetnameFM').form('load',row); $('#assetnameFM').form('load', row);
assetNameID = assetnameInfo[0]; assetNameID = assetnameInfo[0];
//焦点在名称输入框==定焦在输入文字后面 //焦点在名称输入框==定焦在输入文字后面
$("#assetName").val("").focus().val(assetnameInfo[1]); $("#assetName").val("").focus().val(assetnameInfo[1]);
@@ -643,36 +593,31 @@
} }
//检查名称是否存在 ++ 重名无法提示问题需要跟进 //检查名称是否存在 ++ 重名无法提示问题需要跟进
function checkAssetName() function checkAssetName() {
{
var assetName = $.trim($("#assetName").val()); var assetName = $.trim($("#assetName").val());
//表示是否存在 true == 存在 false = 不存在 //表示是否存在 true == 存在 false = 不存在
var flag = false; var flag = false;
//开始ajax名称检验不能重名 //开始ajax名称检验不能重名
if(assetName.length > 0 &&( orgAssetName.length ==0 || assetName != orgAssetName)) if (assetName.length > 0 && (orgAssetName.length == 0 || assetName != orgAssetName)) {
{
$.ajax({ $.ajax({
type:"post", type: "post",
url: "<%=path %>/assetname/checkIsNameExist.action", url: "<%=path %>/assetname/checkIsNameExist.action",
dataType: "json", dataType: "json",
async : false, async: false,
data: ({ data: ({
assetNameID : assetNameID, assetNameID: assetNameID,
assetName : assetName assetName: assetName
}), }),
success: function (tipInfo) success: function (tipInfo) {
{
flag = tipInfo; flag = tipInfo;
if(tipInfo) if (tipInfo) {
{ $.messager.alert('提示', '资产名称已经存在', 'info');
$.messager.alert('提示','资产名称已经存在','info');
return; return;
} }
}, },
//此处添加错误处理 //此处添加错误处理
error:function() error: function () {
{ $.messager.alert('提示', '检查资产名称是否存在异常,请稍后再试!', 'error');
$.messager.alert('提示','检查资产名称是否存在异常,请稍后再试!','error');
return; return;
} }
}); });
@@ -682,43 +627,39 @@
//搜索处理 //搜索处理
$("#searchBtn").unbind().bind({ $("#searchBtn").unbind().bind({
click:function() click: function () {
{ showAssetNameDetails(1, initPageSize);
showAssetNameDetails(1,initPageSize);
var opts = $("#tableData").datagrid('options'); var opts = $("#tableData").datagrid('options');
var pager = $("#tableData").datagrid('getPager'); var pager = $("#tableData").datagrid('getPager');
opts.pageNumber = 1; opts.pageNumber = 1;
opts.pageSize = initPageSize; opts.pageSize = initPageSize;
pager.pagination('refresh', pager.pagination('refresh',
{ {
pageNumber:1, pageNumber: 1,
pageSize:initPageSize pageSize: initPageSize
}); });
} }
}); });
function showAssetNameDetails(pageNo,pageSize) function showAssetNameDetails(pageNo, pageSize) {
{
$.ajax({ $.ajax({
type:"post", type: "post",
url: "<%=path %>/assetname/findBy.action", url: "<%=path %>/assetname/findBy.action",
dataType: "json", dataType: "json",
data: ({ data: ({
assetName:$.trim($("#searchAssetName").val()), assetName: $.trim($("#searchAssetName").val()),
description:$.trim($("#searchDesc").val()), description: $.trim($("#searchDesc").val()),
categoryID : $("#searchCategory").val(), categoryID: $("#searchCategory").val(),
consumable : $("#searchConsume").val(), consumable: $("#searchConsume").val(),
pageNo:pageNo, pageNo: pageNo,
pageSize:pageSize pageSize: pageSize
}), }),
success: function (data) success: function (data) {
{ $("#tableData").datagrid('loadData', data);
$("#tableData").datagrid('loadData',data);
}, },
//此处添加错误处理 //此处添加错误处理
error:function() error: function () {
{ $.messager.alert('查询提示', '查询数据后台异常,请稍后再试!', 'error');
$.messager.alert('查询提示','查询数据后台异常,请稍后再试!','error');
return; return;
} }
}); });
@@ -726,7 +667,7 @@
//重置按钮 //重置按钮
$("#searchResetBtn").unbind().bind({ $("#searchResetBtn").unbind().bind({
click:function(){ click: function () {
$("#searchAssetName").val(""); $("#searchAssetName").val("");
$("#searchDesc").val(""); $("#searchDesc").val("");
$("#searchCategory").val(""); $("#searchCategory").val("");
@@ -736,6 +677,6 @@
$("#searchBtn").click(); $("#searchBtn").click();
} }
}); });
</script> </script>
</body> </body>
</html> </html>

View File

@@ -1,30 +1,31 @@
<%@page import="com.jsh.util.Tools"%> <%@page import="com.jsh.util.Tools" %>
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%> <%@ page language="java" pageEncoding="utf-8" %>
<% <%
String path = request.getContextPath(); String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/"; String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + path + "/";
String clientIp = Tools.getLocalIp(request); String clientIp = Tools.getLocalIp(request);
%> %>
<!DOCTYPE html> <!DOCTYPE html>
<html> <html>
<head> <head>
<title>资产管理</title> <title>资产管理</title>
<meta charset="utf-8" /> <meta charset="utf-8"/>
<!-- 指定以IE8的方式来渲染 --> <!-- 指定以IE8的方式来渲染 -->
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE8"/> <meta http-equiv="X-UA-Compatible" content="IE=EmulateIE8"/>
<link rel="shortcut icon" href="<%=path%>/images/favicon.ico" type="image/x-icon" /> <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/default/easyui.css"/>
<link rel="stylesheet" type="text/css" href="<%=path %>/js/easyui-1.3.5/themes/icon.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" /> <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/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/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/locale/easyui-lang-zh_CN.js"></script>
<script type="text/javascript" src="<%=path %>/js/common/common.js"></script> <script type="text/javascript" src="<%=path %>/js/common/common.js"></script>
</head> </head>
<body> <body>
<div id="position" class="easyui-panel" title="当前位置:系统管理 &gt; 资产类型" collapsible="false" closable="false"/> <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"> <div id="searchPanel" class="easyui-panel" style="padding:10px;" title="查询窗口" iconCls="icon-search" collapsible="true"
closable="false">
<table id="searchTable"> <table id="searchTable">
<tr> <tr>
<td>类型名称:</td> <td>类型名称:</td>
@@ -46,19 +47,21 @@
</td> </td>
</tr> </tr>
</table> </table>
</div> </div>
<!-- 数据显示table --> <!-- 数据显示table -->
<div id = "tablePanel" class="easyui-panel" style="padding:1px;top:300px;" title="类型列表" iconCls="icon-list" collapsible="true" closable="false"> <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> <table id="tableData" style="top:300px;border-bottom-color:#FFFFFF"></table>
</div> </div>
<div id="categoryDlg" class="easyui-dialog" style="width:380px;padding:10px 20px" <div id="categoryDlg" class="easyui-dialog" style="width:380px;padding:10px 20px"
closed="true" buttons="#dlg-buttons" modal="true" cache="false" collapsible="false" closable="true"> closed="true" buttons="#dlg-buttons" modal="true" cache="false" collapsible="false" closable="true">
<form id="categoryFM" method="post" novalidate> <form id="categoryFM" method="post" novalidate>
<div class="fitem" style="padding:5px"> <div class="fitem" style="padding:5px">
<label id="categoryNameLabel">类型名称&nbsp;&nbsp;</label> <label id="categoryNameLabel">类型名称&nbsp;&nbsp;</label>
<input name="categoryName" id="categoryName" class="easyui-validatebox" data-options="required:true,validType:'length[2,30]'" style="width: 230px;height: 20px"/> <input name="categoryName" id="categoryName" class="easyui-validatebox"
data-options="required:true,validType:'length[2,30]'" style="width: 230px;height: 20px"/>
</div> </div>
<div class="fitem" style="padding:5px;"> <div class="fitem" style="padding:5px;">
<label id="descriptionLabel">描&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;述&nbsp;&nbsp;</label> <label id="descriptionLabel">描&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;述&nbsp;&nbsp;</label>
@@ -66,16 +69,16 @@
</div> </div>
<input type="hidden" name="clientIp" id="clientIp" value="<%=clientIp %>"/> <input type="hidden" name="clientIp" id="clientIp" value="<%=clientIp %>"/>
</form> </form>
</div> </div>
<div id="dlg-buttons"> <div id="dlg-buttons">
<a href="javascript:void(0)" id="saveCategory" class="easyui-linkbutton" iconCls="icon-ok">保存</a> <a href="javascript:void(0)" id="saveCategory" class="easyui-linkbutton" iconCls="icon-ok">保存</a>
<a href="javascript:void(0)" id="cancelCategory" class="easyui-linkbutton" iconCls="icon-cancel" onclick="javascript:$('#categoryDlg').dialog('close')">取消</a> <a href="javascript:void(0)" id="cancelCategory" class="easyui-linkbutton" iconCls="icon-cancel"
</div> onclick="javascript:$('#categoryDlg').dialog('close')">取消</a>
</div>
<script type="text/javascript"> <script type="text/javascript">
//初始化界面 //初始化界面
$(function() $(function () {
{
initTableData(); initTableData();
ininPager(); ininPager();
initForm(); initForm();
@@ -83,16 +86,13 @@
}); });
//浏览器适配 //浏览器适配
function browserFit() function browserFit() {
{ if (getOs() == 'MSIE') {
if(getOs()=='MSIE')
{
$("#searchDescLabel").empty().append("描&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;述:"); $("#searchDescLabel").empty().append("描&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;述:");
$("#categoryNameLabel").empty().append("类型名称&nbsp;&nbsp;"); $("#categoryNameLabel").empty().append("类型名称&nbsp;&nbsp;");
$("#descriptionLabel").empty().append("描&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;述&nbsp;&nbsp;"); $("#descriptionLabel").empty().append("描&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;述&nbsp;&nbsp;");
} }
else else {
{
$("#searchDescLabel").empty().append("描&nbsp;&nbsp;&nbsp;&nbsp;述:"); $("#searchDescLabel").empty().append("描&nbsp;&nbsp;&nbsp;&nbsp;述:");
$("#categoryNameLabel").empty().append("类型名称&nbsp;"); $("#categoryNameLabel").empty().append("类型名称&nbsp;");
$("#descriptionLabel").empty().append("描&nbsp;&nbsp;&nbsp;&nbsp;述&nbsp;"); $("#descriptionLabel").empty().append("描&nbsp;&nbsp;&nbsp;&nbsp;述&nbsp;");
@@ -100,162 +100,144 @@
} }
//防止表单提交重复 //防止表单提交重复
function initForm() function initForm() {
{
$('#categoryFM').form({ $('#categoryFM').form({
onSubmit: function(){ onSubmit: function () {
return false; return false;
} }
}); });
} }
//初始化表格数据 //初始化表格数据
function initTableData() function initTableData() {
{
$('#tableData').datagrid({ $('#tableData').datagrid({
//title:'供应商列表', //title:'供应商列表',
//iconCls:'icon-save', //iconCls:'icon-save',
//width:700, //width:700,
height:heightInfo, height: heightInfo,
nowrap: false, nowrap: false,
rownumbers: false, rownumbers: false,
//动画效果 //动画效果
animate:false, animate: false,
//选中单行 //选中单行
singleSelect : true, singleSelect: true,
collapsible:false, collapsible: false,
selectOnCheck:false, selectOnCheck: false,
//fitColumns:true, //fitColumns:true,
//单击行是否选中 //单击行是否选中
checkOnSelect : false, checkOnSelect: false,
url:'<%=path %>/category/findBy.action?pageSize=' + initPageSize, url: '<%=path %>/category/findBy.action?pageSize=' + initPageSize,
pagination: true, pagination: true,
//交替出现背景 //交替出现背景
striped : true, striped: true,
//loadFilter: pagerFilter, //loadFilter: pagerFilter,
pageSize: initPageSize, pageSize: initPageSize,
pageList: initPageNum, pageList: initPageNum,
columns:[[ columns: [[
{ field: 'id',width:35,align:"center",checkbox:true}, {field: 'id', width: 35, align: "center", checkbox: true},
{ title: '资产类型',field: 'categoryname',width:200}, {title: '资产类型', field: 'categoryname', width: 200},
{ title: '描述',field: 'description',width:400}, {title: '描述', field: 'description', width: 400},
{ title: '操作',field: 'op',align:"center",width:130,formatter:function(value,rec)
{ {
title: '操作', field: 'op', align: "center", width: 130, formatter: function (value, rec) {
var str = ''; var str = '';
var rowInfo = rec.id + 'AaBb' + rec.categoryname + 'AaBb' + rec.isystem + 'AaBb' + rec.description; var rowInfo = rec.id + 'AaBb' + rec.categoryname + 'AaBb' + rec.isystem + 'AaBb' + rec.description;
if(1 == value) if (1 == value) {
{
str += '<img src="<%=path%>/js/easyui-1.3.5/themes/icons/pencil.png" style="cursor: pointer;" onclick="editCategory(\'' + rowInfo + '\');"/>&nbsp;<a onclick="editCategory(\'' + 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/pencil.png" style="cursor: pointer;" onclick="editCategory(\'' + rowInfo + '\');"/>&nbsp;<a onclick="editCategory(\'' + 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="deleteCategory('+ rec.id +');"/>&nbsp;<a onclick="deleteCategory('+ rec.id +');" 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="deleteCategory(' + rec.id + ');"/>&nbsp;<a onclick="deleteCategory(' + rec.id + ');" style="text-decoration:none;color:black;" href="javascript:void(0)">删除</a>&nbsp;&nbsp;';
} }
return str; return str;
} }
} }
]], ]],
toolbar:[ toolbar: [
{
id:'addSupplier',
text:'增加',
iconCls:'icon-add',
handler:function()
{ {
id: 'addSupplier',
text: '增加',
iconCls: 'icon-add',
handler: function () {
addCategory(); addCategory();
} }
}, },
{ {
id:'deleteSupplier', id: 'deleteSupplier',
text:'删除', text: '删除',
iconCls:'icon-remove', iconCls: 'icon-remove',
handler:function() handler: function () {
{
batDeleteCategory(); batDeleteCategory();
} }
} }
], ],
onLoadError:function() onLoadError: function () {
{ $.messager.alert('页面加载提示', '页面加载异常,请稍后再试!', 'error');
$.messager.alert('页面加载提示','页面加载异常,请稍后再试!','error');
return; return;
} }
}); });
} }
//初始化键盘enter事件 //初始化键盘enter事件
$(document).keydown(function(event) $(document).keydown(function (event) {
{
//兼容 IE和firefox 事件 //兼容 IE和firefox 事件
var e = window.event || event; var e = window.event || event;
var k = e.keyCode||e.which||e.charCode; var k = e.keyCode || e.which || e.charCode;
//兼容 IE,firefox 兼容 //兼容 IE,firefox 兼容
var obj = e.srcElement ? e.srcElement : e.target; var obj = e.srcElement ? e.srcElement : e.target;
//绑定键盘事件为 id是指定的输入框才可以触发键盘事件 13键盘事件 ---遗留问题 enter键效验 对话框会关闭问题 //绑定键盘事件为 id是指定的输入框才可以触发键盘事件 13键盘事件 ---遗留问题 enter键效验 对话框会关闭问题
if(k == "13"&&(obj.id=="categoryName"|| obj.id=="description" )) if (k == "13" && (obj.id == "categoryName" || obj.id == "description")) {
{
$("#saveCategory").click(); $("#saveCategory").click();
} }
//搜索按钮添加快捷键 //搜索按钮添加快捷键
if(k == "13"&&(obj.id=="searchCategory" || obj.id=="searchDesc" )) if (k == "13" && (obj.id == "searchCategory" || obj.id == "searchDesc")) {
{
$("#searchBtn").click(); $("#searchBtn").click();
} }
}); });
//分页信息处理 //分页信息处理
function ininPager() function ininPager() {
{ try {
try
{
var opts = $("#tableData").datagrid('options'); var opts = $("#tableData").datagrid('options');
var pager = $("#tableData").datagrid('getPager'); var pager = $("#tableData").datagrid('getPager');
pager.pagination({ pager.pagination({
onSelectPage:function(pageNum, pageSize) onSelectPage: function (pageNum, pageSize) {
{
opts.pageNumber = pageNum; opts.pageNumber = pageNum;
opts.pageSize = pageSize; opts.pageSize = pageSize;
pager.pagination('refresh', pager.pagination('refresh',
{ {
pageNumber:pageNum, pageNumber: pageNum,
pageSize:pageSize pageSize: pageSize
}); });
showCategoryDetails(pageNum,pageSize); showCategoryDetails(pageNum, pageSize);
} }
}); });
} }
catch (e) catch (e) {
{ $.messager.alert('异常处理提示', "分页信息异常 : " + e.name + ": " + e.message, 'error');
$.messager.alert('异常处理提示',"分页信息异常 : " + e.name + ": " + e.message,'error');
} }
} }
//删除供应商信息 //删除供应商信息
function deleteCategory(categoryID) function deleteCategory(categoryID) {
{ $.messager.confirm('删除确认', '确定要删除此资产类型信息吗?', function (r) {
$.messager.confirm('删除确认','确定要删除此资产类型信息吗?',function(r) if (r) {
{
if (r)
{
$.ajax({ $.ajax({
type:"post", type: "post",
url: "<%=path %>/category/delete.action", url: "<%=path %>/category/delete.action",
dataType: "json", dataType: "json",
data: ({ data: ({
categoryID : categoryID, categoryID: categoryID,
clientIp:'<%=clientIp %>' clientIp: '<%=clientIp %>'
}), }),
success: function (tipInfo) success: function (tipInfo) {
{
var msg = tipInfo.showModel.msgTip; var msg = tipInfo.showModel.msgTip;
if(msg == '成功') if (msg == '成功') {
{
//加载完以后重新初始化 //加载完以后重新初始化
$("#searchBtn").click(); $("#searchBtn").click();
} }
else else
$.messager.alert('删除提示','删除资产类别信息失败,请稍后再试!','error'); $.messager.alert('删除提示', '删除资产类别信息失败,请稍后再试!', 'error');
}, },
//此处添加错误处理 //此处添加错误处理
error:function() error: function () {
{ $.messager.alert('删除提示', '删除资产类别信息异常,请稍后再试!', 'error');
$.messager.alert('删除提示','删除资产类别信息异常,请稍后再试!','error');
return; return;
} }
}); });
@@ -264,25 +246,18 @@
} }
//批量删除供应商 //批量删除供应商
function batDeleteCategory() function batDeleteCategory() {
{
var row = $('#tableData').datagrid('getChecked'); var row = $('#tableData').datagrid('getChecked');
if(row.length == 0) if (row.length == 0) {
{ $.messager.alert('删除提示', '没有记录被选中!', 'info');
$.messager.alert('删除提示','没有记录被选中!','info');
return; return;
} }
if(row.length > 0) if (row.length > 0) {
{ $.messager.confirm('删除确认', '确定要删除选中的' + row.length + '条资产类别信息吗?', function (r) {
$.messager.confirm('删除确认','确定要删除选中的' + row.length + '条资产类别信息吗?',function(r) if (r) {
{
if (r)
{
var ids = ""; var ids = "";
for(var i = 0;i < row.length; i ++) for (var i = 0; i < row.length; i++) {
{ if (i == row.length - 1) {
if(i == row.length-1)
{
ids += row[i].id; ids += row[i].id;
break; break;
} }
@@ -290,30 +265,27 @@
ids += row[i].id + ","; ids += row[i].id + ",";
} }
$.ajax({ $.ajax({
type:"post", type: "post",
url: "<%=path %>/category/batchDelete.action", url: "<%=path %>/category/batchDelete.action",
dataType: "json", dataType: "json",
async : false, async: false,
data: ({ data: ({
categoryIDs : ids, categoryIDs: ids,
clientIp:'<%=clientIp %>' clientIp: '<%=clientIp %>'
}), }),
success: function (tipInfo) success: function (tipInfo) {
{
var msg = tipInfo.showModel.msgTip; var msg = tipInfo.showModel.msgTip;
if(msg == '成功') if (msg == '成功') {
{
//加载完以后重新初始化 //加载完以后重新初始化
$("#searchBtn").click(); $("#searchBtn").click();
$(":checkbox").attr("checked",false); $(":checkbox").attr("checked", false);
} }
else else
$.messager.alert('删除提示','删除资产类别信息失败,请稍后再试!','error'); $.messager.alert('删除提示', '删除资产类别信息失败,请稍后再试!', 'error');
}, },
//此处添加错误处理 //此处添加错误处理
error:function() error: function () {
{ $.messager.alert('删除提示', '删除资产类别信息异常,请稍后再试!', 'error');
$.messager.alert('删除提示','删除资产类别信息异常,请稍后再试!','error');
return; return;
} }
}); });
@@ -328,12 +300,11 @@
//保存编辑前的名称 //保存编辑前的名称
var orgCategory = ""; var orgCategory = "";
function addCategory() function addCategory() {
{
$("#clientIp").val('<%=clientIp %>'); $("#clientIp").val('<%=clientIp %>');
$("#description").val(""); $("#description").val("");
$('#categoryDlg').dialog('open').dialog('setTitle','<img src="<%=path%>/js/easyui-1.3.5/themes/icons/edit_add.png"/>&nbsp;增加资产类型信息'); $('#categoryDlg').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}); $(".window-mask").css({width: webW, height: webH});
$("#categoryName").val("").focus(); $("#categoryName").val("").focus();
//$('#categoryFM').form('clear'); //$('#categoryFM').form('clear');
@@ -344,35 +315,30 @@
//保存信息 //保存信息
$("#saveCategory").unbind().bind({ $("#saveCategory").unbind().bind({
click:function() click: function () {
{ if (!$('#categoryFM').form('validate'))
if(!$('#categoryFM').form('validate'))
return; return;
else if(checkCategoryName()) else if (checkCategoryName())
return; return;
else else {
{
$.ajax({ $.ajax({
type:"post", type: "post",
url: url, url: url,
dataType: "json", dataType: "json",
async : false, async: false,
data: ({ data: ({
categoryName : $.trim($("#categoryName").val()), categoryName: $.trim($("#categoryName").val()),
description : $.trim($("#description").val()), description: $.trim($("#description").val()),
clientIp:'<%=clientIp %>' clientIp: '<%=clientIp %>'
}), }),
success: function (tipInfo) success: function (tipInfo) {
{ if (tipInfo) {
if(tipInfo)
{
$('#categoryDlg').dialog('close'); $('#categoryDlg').dialog('close');
var opts = $("#tableData").datagrid('options'); var opts = $("#tableData").datagrid('options');
showCategoryDetails(opts.pageNumber,opts.pageSize); showCategoryDetails(opts.pageNumber, opts.pageSize);
} }
else else {
{
$.messager.show({ $.messager.show({
title: '错误提示', title: '错误提示',
msg: '保存资产类别信息失败,请稍后重试!' msg: '保存资产类别信息失败,请稍后重试!'
@@ -380,9 +346,8 @@
} }
}, },
//此处添加错误处理 //此处添加错误处理
error:function() error: function () {
{ $.messager.alert('提示', '保存资产类型信息异常,请稍后再试!', 'error');
$.messager.alert('提示','保存资产类型信息异常,请稍后再试!','error');
return; return;
} }
}); });
@@ -391,8 +356,7 @@
}); });
//编辑信息 //编辑信息
function editCategory(categoryTotalInfo) function editCategory(categoryTotalInfo) {
{
var categoryInfo = categoryTotalInfo.split("AaBb"); var categoryInfo = categoryTotalInfo.split("AaBb");
$("#clientIp").val('<%=clientIp %>'); $("#clientIp").val('<%=clientIp %>');
@@ -400,8 +364,8 @@
$("#description").val(categoryInfo[3]); $("#description").val(categoryInfo[3]);
orgCategory = categoryInfo[1]; orgCategory = categoryInfo[1];
$('#categoryDlg').dialog('open').dialog('setTitle','<img src="<%=path%>/js/easyui-1.3.5/themes/icons/pencil.png"/>&nbsp;编辑资产类型信息'); $('#categoryDlg').dialog('open').dialog('setTitle', '<img src="<%=path%>/js/easyui-1.3.5/themes/icons/pencil.png"/>&nbsp;编辑资产类型信息');
$(".window-mask").css({ width: webW ,height: webH}); $(".window-mask").css({width: webW, height: webH});
categoryID = categoryInfo[0]; categoryID = categoryInfo[0];
//焦点在名称输入框==定焦在输入文字后面 //焦点在名称输入框==定焦在输入文字后面
$("#categoryName").val("").focus().val(categoryInfo[1]); $("#categoryName").val("").focus().val(categoryInfo[1]);
@@ -409,38 +373,33 @@
} }
//检查名称是否存在 ++ 重名无法提示问题需要跟进 //检查名称是否存在 ++ 重名无法提示问题需要跟进
function checkCategoryName() function checkCategoryName() {
{
var categoryName = $.trim($("#categoryName").val()); var categoryName = $.trim($("#categoryName").val());
//表示是否存在 true == 存在 false = 不存在 //表示是否存在 true == 存在 false = 不存在
var flag = false; var flag = false;
//开始ajax名称检验不能重名 //开始ajax名称检验不能重名
if(categoryName.length > 0 &&( orgCategory.length ==0 || categoryName != orgCategory)) if (categoryName.length > 0 && (orgCategory.length == 0 || categoryName != orgCategory)) {
{
$.ajax({ $.ajax({
type:"post", type: "post",
url: "<%=path %>/category/checkIsNameExist.action", url: "<%=path %>/category/checkIsNameExist.action",
dataType: "json", dataType: "json",
async : false, async: false,
data: ({ data: ({
categoryID : categoryID, categoryID: categoryID,
categoryName : categoryName categoryName: categoryName
}), }),
success: function (tipInfo) success: function (tipInfo) {
{
flag = tipInfo; flag = tipInfo;
if(tipInfo) if (tipInfo) {
{ $.messager.alert('提示', '资产类型名称已经存在', 'info');
$.messager.alert('提示','资产类型名称已经存在','info');
//alert("供应商名称已经存在"); //alert("供应商名称已经存在");
//$("#supplier").val(""); //$("#supplier").val("");
return; return;
} }
}, },
//此处添加错误处理 //此处添加错误处理
error:function() error: function () {
{ $.messager.alert('提示', '检查资产类型名称是否存在异常,请稍后再试!', 'error');
$.messager.alert('提示','检查资产类型名称是否存在异常,请稍后再试!','error');
return; return;
} }
}); });
@@ -450,41 +409,37 @@
//搜索处理 //搜索处理
$("#searchBtn").unbind().bind({ $("#searchBtn").unbind().bind({
click:function() click: function () {
{ showCategoryDetails(1, initPageSize);
showCategoryDetails(1,initPageSize);
var opts = $("#tableData").datagrid('options'); var opts = $("#tableData").datagrid('options');
var pager = $("#tableData").datagrid('getPager'); var pager = $("#tableData").datagrid('getPager');
opts.pageNumber = 1; opts.pageNumber = 1;
opts.pageSize = initPageSize; opts.pageSize = initPageSize;
pager.pagination('refresh', pager.pagination('refresh',
{ {
pageNumber:1, pageNumber: 1,
pageSize:initPageSize pageSize: initPageSize
}); });
} }
}); });
function showCategoryDetails(pageNo,pageSize) function showCategoryDetails(pageNo, pageSize) {
{
$.ajax({ $.ajax({
type:"post", type: "post",
url: "<%=path %>/category/findBy.action", url: "<%=path %>/category/findBy.action",
dataType: "json", dataType: "json",
data: ({ data: ({
categoryName:$.trim($("#searchCategory").val()), categoryName: $.trim($("#searchCategory").val()),
description:$.trim($("#searchDesc").val()), description: $.trim($("#searchDesc").val()),
pageNo:pageNo, pageNo: pageNo,
pageSize:pageSize pageSize: pageSize
}), }),
success: function (data) success: function (data) {
{ $("#tableData").datagrid('loadData', data);
$("#tableData").datagrid('loadData',data);
}, },
//此处添加错误处理 //此处添加错误处理
error:function() error: function () {
{ $.messager.alert('查询提示', '查询数据后台异常,请稍后再试!', 'error');
$.messager.alert('查询提示','查询数据后台异常,请稍后再试!','error');
return; return;
} }
}); });
@@ -492,7 +447,7 @@
//重置按钮 //重置按钮
$("#searchResetBtn").unbind().bind({ $("#searchResetBtn").unbind().bind({
click:function(){ click: function () {
$("#searchCategory").val(""); $("#searchCategory").val("");
$("#searchDesc").val(""); $("#searchDesc").val("");
@@ -500,6 +455,6 @@
$("#searchBtn").click(); $("#searchBtn").click();
} }
}); });
</script> </script>
</body> </body>
</html> </html>

View File

@@ -1,20 +1,20 @@
<%@page import="com.jsh.util.Tools"%> <%@page import="com.jsh.util.Tools" %>
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%> <%@ page language="java" pageEncoding="utf-8" %>
<% <%
String path = request.getContextPath(); String path = request.getContextPath();
String clientIp = Tools.getLocalIp(request); String clientIp = Tools.getLocalIp(request);
%> %>
<!DOCTYPE html> <!DOCTYPE html>
<html> <html>
<head> <head>
<title>客户信息</title> <title>客户信息</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<!-- 指定以IE8的方式来渲染 --> <!-- 指定以IE8的方式来渲染 -->
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE8"/> <meta http-equiv="X-UA-Compatible" content="IE=EmulateIE8"/>
<link rel="shortcut icon" href="<%=path%>/images/favicon.ico" type="image/x-icon" /> <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/default/easyui.css"/>
<link rel="stylesheet" type="text/css" href="<%=path %>/js/easyui-1.3.5/themes/icon.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" /> <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/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/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/locale/easyui-lang-zh_CN.js"></script>
@@ -25,10 +25,11 @@
var path = "<%=path%>"; var path = "<%=path%>";
var clientIp = "<%=clientIp%>"; var clientIp = "<%=clientIp%>";
</script> </script>
</head> </head>
<body> <body>
<!-- 查询 --> <!-- 查询 -->
<div id = "searchPanel" class="easyui-panel" style="padding:10px;" title="查询窗口" iconCls="icon-search" collapsible="true" closable="false"> <div id="searchPanel" class="easyui-panel" style="padding:10px;" title="查询窗口" iconCls="icon-search" collapsible="true"
closable="false">
<table id="searchTable"> <table id="searchTable">
<tr> <tr>
<td>名&nbsp;&nbsp;&nbsp;&nbsp;称:</td> <td>名&nbsp;&nbsp;&nbsp;&nbsp;称:</td>
@@ -57,20 +58,22 @@
</td> </td>
</tr> </tr>
</table> </table>
</div> </div>
<!-- 数据显示table --> <!-- 数据显示table -->
<div id = "tablePanel" class="easyui-panel" style="padding:1px;top:300px;" title="客户信息列表" iconCls="icon-list" collapsible="true" closable="false"> <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> <table id="tableData" style="top:300px;border-bottom-color:#FFFFFF"></table>
</div> </div>
<div id="supplierDlg" class="easyui-dialog" style="width:580px;padding:10px 20px" <div id="supplierDlg" class="easyui-dialog" style="width:580px;padding:10px 20px"
closed="true" buttons="#dlg-buttons" modal="true" collapsible="false" closable="true"> closed="true" buttons="#dlg-buttons" modal="true" collapsible="false" closable="true">
<form id="supplierFM"> <form id="supplierFM">
<table> <table>
<tr> <tr>
<td style="width: 80px;height: 20px">名称</td> <td style="width: 80px;height: 20px">名称</td>
<td style="width: 180px;padding:1px"> <td style="width: 180px;padding:1px">
<input name="supplier" id="supplier" class="easyui-validatebox" data-options="required:true,validType:'length[2,30]'" style="width: 160px;height: 20px"/> <input name="supplier" id="supplier" class="easyui-validatebox"
data-options="required:true,validType:'length[2,30]'" style="width: 160px;height: 20px"/>
</td> </td>
<td style="width: 60px;height: 20px">联系人</td> <td style="width: 60px;height: 20px">联系人</td>
<td style="width:180px;padding:1px;"> <td style="width:180px;padding:1px;">
@@ -80,11 +83,13 @@
<tr> <tr>
<td>手机号码</td> <td>手机号码</td>
<td style="padding:1px;"> <td style="padding:1px;">
<input name="telephone" id="telephone" class="easyui-validatebox" style="width: 160px;height: 20px"/> <input name="telephone" id="telephone" class="easyui-validatebox"
style="width: 160px;height: 20px"/>
</td> </td>
<td>电子邮箱</td> <td>电子邮箱</td>
<td style="padding:1px"> <td style="padding:1px">
<input name="email" id="email" class="easyui-validatebox" validType="email" style="width: 160px;height: 20px"/> <input name="email" id="email" class="easyui-validatebox" validType="email"
style="width: 160px;height: 20px"/>
</td> </td>
</tr> </tr>
<tr> <tr>
@@ -100,21 +105,25 @@
<tr> <tr>
<td>期初应收</td> <td>期初应收</td>
<td style="padding:1px"> <td style="padding:1px">
<input name="BeginNeedGet" id="BeginNeedGet" type="text" class="easyui-numberbox" data-options="min:0,precision:2" style="width: 160px;height: 20px" /> <input name="BeginNeedGet" id="BeginNeedGet" type="text" class="easyui-numberbox"
data-options="min:0,precision:2" style="width: 160px;height: 20px"/>
</td> </td>
<td>期初应付</td> <td>期初应付</td>
<td style="padding:1px"> <td style="padding:1px">
<input name="BeginNeedPay" id="BeginNeedPay" type="text" class="easyui-numberbox" data-options="min:0,precision:2" style="width: 160px;height: 20px" /> <input name="BeginNeedPay" id="BeginNeedPay" type="text" class="easyui-numberbox"
data-options="min:0,precision:2" style="width: 160px;height: 20px"/>
</td> </td>
</tr> </tr>
<tr> <tr>
<td>累计应收</td> <td>累计应收</td>
<td style="padding:1px"> <td style="padding:1px">
<input name="AllNeedGet" id="AllNeedGet" type="text" style="width: 160px;height: 20px" readonly="readonly" /> <input name="AllNeedGet" id="AllNeedGet" type="text" style="width: 160px;height: 20px"
readonly="readonly"/>
</td> </td>
<td>累计应付</td> <td>累计应付</td>
<td style="padding:1px"> <td style="padding:1px">
<input name="AllNeedPay" id="AllNeedPay" type="text" style="width: 160px;height: 20px" readonly="readonly" /> <input name="AllNeedPay" id="AllNeedPay" type="text" style="width: 160px;height: 20px"
readonly="readonly"/>
</td> </td>
</tr> </tr>
<tr> <tr>
@@ -134,7 +143,8 @@
</td> </td>
<td>账号</td> <td>账号</td>
<td style="padding:1px"> <td style="padding:1px">
<input name="accountNumber" id="accountNumber" class="easyui-validatebox" style="width: 160px;height: 20px"/> <input name="accountNumber" id="accountNumber" class="easyui-validatebox"
style="width: 160px;height: 20px"/>
</td> </td>
</tr> </tr>
<tr> <tr>
@@ -151,15 +161,17 @@
</tr> </tr>
</table> </table>
</form> </form>
</div> </div>
<div id="dlg-buttons"> <div id="dlg-buttons">
<a href="javascript:void(0)" id="saveSupplier" class="easyui-linkbutton" iconCls="icon-ok">保存</a> <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> <a href="javascript:void(0)" id="cancelSupplier" class="easyui-linkbutton" iconCls="icon-cancel"
</div> onclick="javascript:$('#supplierDlg').dialog('close')">取消</a>
</div>
<!-- 导入excel表格 --> <!-- 导入excel表格 -->
<div id="importExcelDlg" style="padding:10px 20px"> <div id="importExcelDlg" style="padding:10px 20px">
<form id="importExcelFM" method="post" enctype="multipart/form-data" action="<%=path%>/supplier/importExcelCustomer.action"> <form id="importExcelFM" method="post" enctype="multipart/form-data"
action="<%=path%>/supplier/importExcelCustomer.action">
<div class="fitem" style="padding:5px"> <div class="fitem" style="padding:5px">
<label>文件名称&nbsp;&nbsp;</label> <label>文件名称&nbsp;&nbsp;</label>
<input name="supplierFile" id="supplierFile" type="file" style="width: 230px;height: 20px"/> <input name="supplierFile" id="supplierFile" type="file" style="width: 230px;height: 20px"/>
@@ -169,7 +181,7 @@
</div> </div>
<div class="fitem" style="padding:5px;display: none;"> <div class="fitem" style="padding:5px;display: none;">
<label>是否审查&nbsp;&nbsp;</label> <label>是否审查&nbsp;&nbsp;</label>
<select id ="isCheck" name="isCheck" style="width: 230px;height: 20px"> <select id="isCheck" name="isCheck" style="width: 230px;height: 20px">
<option value="0">是</option> <option value="0">是</option>
<option value="1" selected="selected">否</option> <option value="1" selected="selected">否</option>
</select> </select>
@@ -177,9 +189,10 @@
<input type="hidden" name="clientIp" id="clientIp" value="<%=clientIp %>"/> <input type="hidden" name="clientIp" id="clientIp" value="<%=clientIp %>"/>
<div id="dlg-buttons5"> <div id="dlg-buttons5">
<a href="javascript:void(0)" id="saveimport" class="easyui-linkbutton" iconCls="icon-ok">导入</a> <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> <a href="javascript:void(0)" id="cancelimport" class="easyui-linkbutton" iconCls="icon-cancel"
onclick="javascript:$('#importExcelDlg').dialog('close')">取消</a>
</div> </div>
</form> </form>
</div> </div>
</body> </body>
</html> </html>

View File

@@ -1,28 +1,29 @@
<%@page import="com.jsh.util.Tools"%> <%@page import="com.jsh.util.Tools" %>
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%> <%@ page language="java" pageEncoding="utf-8" %>
<% <%
String path = request.getContextPath(); String path = request.getContextPath();
String clientIp = Tools.getLocalIp(request); String clientIp = Tools.getLocalIp(request);
%> %>
<!DOCTYPE html> <!DOCTYPE html>
<html> <html>
<head> <head>
<title>仓库管理</title> <title>仓库管理</title>
<meta charset="utf-8"> <meta charset="utf-8">
<!-- 指定以IE8的方式来渲染 --> <!-- 指定以IE8的方式来渲染 -->
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE8"/> <meta http-equiv="X-UA-Compatible" content="IE=EmulateIE8"/>
<link rel="shortcut icon" href="<%=path%>/images/favicon.ico" type="image/x-icon" /> <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/default/easyui.css"/>
<link rel="stylesheet" type="text/css" href="<%=path %>/js/easyui-1.3.5/themes/icon.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" /> <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/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/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/locale/easyui-lang-zh_CN.js"></script>
<script type="text/javascript" src="<%=path %>/js/common/common.js"></script> <script type="text/javascript" src="<%=path %>/js/common/common.js"></script>
</head> </head>
<body> <body>
<!-- 查询 --> <!-- 查询 -->
<div id = "searchPanel" class="easyui-panel" style="padding:10px;" title="查询窗口" iconCls="icon-search" collapsible="true" closable="false"> <div id="searchPanel" class="easyui-panel" style="padding:10px;" title="查询窗口" iconCls="icon-search" collapsible="true"
closable="false">
<table id="searchTable"> <table id="searchTable">
<tr> <tr>
<td>仓库名称:</td> <td>仓库名称:</td>
@@ -41,39 +42,44 @@
</td> </td>
</tr> </tr>
</table> </table>
</div> </div>
<!-- 数据显示table --> <!-- 数据显示table -->
<div id = "tablePanel" class="easyui-panel" style="padding:1px;top:300px;" title="仓库列表" iconCls="icon-list" collapsible="true" closable="false"> <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> <table id="tableData" style="top:300px;border-bottom-color:#FFFFFF"></table>
</div> </div>
<div id="depotDlg" class="easyui-dialog" style="width:380px;padding:10px 20px" <div id="depotDlg" class="easyui-dialog" style="width:380px;padding:10px 20px"
closed="true" buttons="#dlg-buttons" modal="true" cache="false" collapsible="false" closable="true"> closed="true" buttons="#dlg-buttons" modal="true" cache="false" collapsible="false" closable="true">
<form id="depotFM" method="post" novalidate> <form id="depotFM" method="post" novalidate>
<table> <table>
<tr> <tr>
<td>仓库名称</td> <td>仓库名称</td>
<td style="padding:5px"> <td style="padding:5px">
<input name="name" id="name" class="easyui-validatebox" data-options="required:true,validType:'length[2,30]'" style="width: 230px;height: 20px"/> <input name="name" id="name" class="easyui-validatebox"
data-options="required:true,validType:'length[2,30]'" style="width: 230px;height: 20px"/>
</td> </td>
</tr> </tr>
<tr> <tr>
<td>仓库地址</td> <td>仓库地址</td>
<td style="padding:5px"> <td style="padding:5px">
<input name="address" id="address" class="easyui-validatebox" data-options="validType:'length[2,30]'" style="width: 230px;height: 20px"/> <input name="address" id="address" class="easyui-validatebox"
data-options="validType:'length[2,30]'" style="width: 230px;height: 20px"/>
</td> </td>
</tr> </tr>
<tr> <tr>
<td>仓储费</td> <td>仓储费</td>
<td style="padding:5px"> <td style="padding:5px">
<input name="warehousing" id="warehousing" class="easyui-numberbox" data-options="min:0,precision:2" style="width: 175px;height: 20px"/>&nbsp;元/天/KG <input name="warehousing" id="warehousing" class="easyui-numberbox" data-options="min:0,precision:2"
style="width: 175px;height: 20px"/>&nbsp;元/天/KG
</td> </td>
</tr> </tr>
<tr> <tr>
<td>搬运费</td> <td>搬运费</td>
<td style="padding:5px"> <td style="padding:5px">
<input name="truckage" id="truckage" class="easyui-numberbox" placeholder="如上下搬运20元,则填写10元" data-options="min:0,precision:2" style="width: 215px;height: 20px"/>&nbsp;元 <input name="truckage" id="truckage" class="easyui-numberbox" placeholder="如上下搬运20元,则填写10元"
data-options="min:0,precision:2" style="width: 215px;height: 20px"/>&nbsp;元
</td> </td>
</tr> </tr>
<tr> <tr>
@@ -91,24 +97,25 @@
</table> </table>
<input type="hidden" name="clientIp" id="clientIp" value="<%=clientIp %>"/> <input type="hidden" name="clientIp" id="clientIp" value="<%=clientIp %>"/>
</form> </form>
</div> </div>
<div id="dlg-buttons"> <div id="dlg-buttons">
<a href="javascript:void(0)" id="saveDepot" class="easyui-linkbutton" iconCls="icon-ok">保存</a> <a href="javascript:void(0)" id="saveDepot" class="easyui-linkbutton" iconCls="icon-ok">保存</a>
<a href="javascript:void(0)" id="cancelDepot" class="easyui-linkbutton" iconCls="icon-cancel" onclick="javascript:$('#depotDlg').dialog('close')">取消</a> <a href="javascript:void(0)" id="cancelDepot" class="easyui-linkbutton" iconCls="icon-cancel"
</div> onclick="javascript:$('#depotDlg').dialog('close')">取消</a>
</div>
<script type="text/javascript"> <script type="text/javascript">
//初始化界面 //初始化界面
$(function(){ $(function () {
initTableData(); initTableData();
ininPager(); ininPager();
initForm(); initForm();
}); });
//防止表单提交重复 //防止表单提交重复
function initForm(){ function initForm() {
$('#depotFM').form({ $('#depotFM').form({
onSubmit: function(){ onSubmit: function () {
return false; return false;
} }
}); });
@@ -120,135 +127,135 @@
//title:'仓库列表', //title:'仓库列表',
//iconCls:'icon-save', //iconCls:'icon-save',
//width:700, //width:700,
height:heightInfo, height: heightInfo,
nowrap: false, nowrap: false,
rownumbers: false, rownumbers: false,
//动画效果 //动画效果
animate:false, animate: false,
//选中单行 //选中单行
singleSelect : true, singleSelect: true,
collapsible:false, collapsible: false,
selectOnCheck:false, selectOnCheck: false,
//fitColumns:true, //fitColumns:true,
//单击行是否选中 //单击行是否选中
checkOnSelect : false, checkOnSelect: false,
url:'<%=path %>/depot/findBy.action?pageSize=' + initPageSize, url: '<%=path %>/depot/findBy.action?pageSize=' + initPageSize,
pagination: true, pagination: true,
//交替出现背景 //交替出现背景
striped : true, striped: true,
//loadFilter: pagerFilter, //loadFilter: pagerFilter,
pageSize: initPageSize, pageSize: initPageSize,
pageList: initPageNum, pageList: initPageNum,
columns:[[ columns: [[
{ field: 'id',width:35,align:"center",checkbox:true}, {field: 'id', width: 35, align: "center", checkbox: true},
{ title: '操作',field: 'op',align:"center",width:60, {
formatter:function(value,rec) { title: '操作', field: 'op', align: "center", width: 60,
formatter: function (value, rec) {
var str = ''; var str = '';
var rowInfo = rec.id + 'AaBb' + rec.name + 'AaBb' + rec.sort + 'AaBb' + rec.remark + 'AaBb' var rowInfo = rec.id + 'AaBb' + rec.name + 'AaBb' + rec.sort + 'AaBb' + rec.remark + 'AaBb'
+ rec.address + 'AaBb' + rec.warehousing + 'AaBb' + rec.truckage; + rec.address + 'AaBb' + rec.warehousing + 'AaBb' + rec.truckage;
if(1 == value) if (1 == value) {
{
str += '<img title="编辑" src="<%=path%>/js/easyui-1.3.5/themes/icons/pencil.png" style="cursor: pointer;" onclick="editDepot(\'' + rowInfo + '\');"/>&nbsp;&nbsp;&nbsp;'; str += '<img title="编辑" src="<%=path%>/js/easyui-1.3.5/themes/icons/pencil.png" style="cursor: pointer;" onclick="editDepot(\'' + rowInfo + '\');"/>&nbsp;&nbsp;&nbsp;';
str += '<img title="删除" src="<%=path%>/js/easyui-1.3.5/themes/icons/edit_remove.png" style="cursor: pointer;" onclick="deleteDepot('+ rec.id +');"/>'; str += '<img title="删除" src="<%=path%>/js/easyui-1.3.5/themes/icons/edit_remove.png" style="cursor: pointer;" onclick="deleteDepot(' + rec.id + ');"/>';
} }
return str; return str;
} }
}, },
{ title: '仓库名称',field: 'name',width:200}, {title: '仓库名称', field: 'name', width: 200},
{ title: '仓库地址',field: 'address',width:200}, {title: '仓库地址', field: 'address', width: 200},
{ title: '仓储费',field: 'warehousing',width:60}, {title: '仓储费', field: 'warehousing', width: 60},
{ title: '搬运费',field: 'truckage',width:60}, {title: '搬运费', field: 'truckage', width: 60},
{ title: '排序',field: 'sort',width:60}, {title: '排序', field: 'sort', width: 60},
{ title: '描述',field: 'remark',width:120} {title: '描述', field: 'remark', width: 120}
]], ]],
toolbar:[ toolbar: [
{ {
id:'addDepot', id: 'addDepot',
text:'增加', text: '增加',
iconCls:'icon-add', iconCls: 'icon-add',
handler:function() { handler: function () {
addDepot(); addDepot();
} }
},'-', }, '-',
{ {
id:'deleteDepot', id: 'deleteDepot',
text:'删除', text: '删除',
iconCls:'icon-remove', iconCls: 'icon-remove',
handler:function() { handler: function () {
batDeleteDepot(); batDeleteDepot();
} }
} }
], ],
onLoadError:function() { onLoadError: function () {
$.messager.alert('页面加载提示','页面加载异常,请稍后再试!','error'); $.messager.alert('页面加载提示', '页面加载异常,请稍后再试!', 'error');
return; return;
} }
}); });
} }
//初始化键盘enter事件 //初始化键盘enter事件
$(document).keydown(function(event) { $(document).keydown(function (event) {
//兼容 IE和firefox 事件 //兼容 IE和firefox 事件
var e = window.event || event; var e = window.event || event;
var k = e.keyCode||e.which||e.charCode; var k = e.keyCode || e.which || e.charCode;
//兼容 IE,firefox 兼容 //兼容 IE,firefox 兼容
var obj = e.srcElement ? e.srcElement : e.target; var obj = e.srcElement ? e.srcElement : e.target;
//绑定键盘事件为 id是指定的输入框才可以触发键盘事件 13键盘事件 ---遗留问题 enter键效验 对话框会关闭问题 //绑定键盘事件为 id是指定的输入框才可以触发键盘事件 13键盘事件 ---遗留问题 enter键效验 对话框会关闭问题
if(k == "13"&&(obj.id=="name"||obj.id=="sort"|| obj.id=="remark" )) { if (k == "13" && (obj.id == "name" || obj.id == "sort" || obj.id == "remark")) {
$("#saveDepot").click(); $("#saveDepot").click();
} }
//搜索按钮添加快捷键 //搜索按钮添加快捷键
if(k == "13"&&(obj.id=="searchName" || obj.id=="searchRemark" )) { if (k == "13" && (obj.id == "searchName" || obj.id == "searchRemark")) {
$("#searchBtn").click(); $("#searchBtn").click();
} }
}); });
//分页信息处理 //分页信息处理
function ininPager() { function ininPager() {
try { try {
var opts = $("#tableData").datagrid('options'); var opts = $("#tableData").datagrid('options');
var pager = $("#tableData").datagrid('getPager'); var pager = $("#tableData").datagrid('getPager');
pager.pagination({ pager.pagination({
onSelectPage:function(pageNum, pageSize) { onSelectPage: function (pageNum, pageSize) {
opts.pageNumber = pageNum; opts.pageNumber = pageNum;
opts.pageSize = pageSize; opts.pageSize = pageSize;
pager.pagination('refresh', { pager.pagination('refresh', {
pageNumber:pageNum, pageNumber: pageNum,
pageSize:pageSize pageSize: pageSize
}); });
showDepotDetails(pageNum,pageSize); showDepotDetails(pageNum, pageSize);
} }
}); });
} }
catch (e) { catch (e) {
$.messager.alert('异常处理提示',"分页信息异常 : " + e.name + ": " + e.message,'error'); $.messager.alert('异常处理提示', "分页信息异常 : " + e.name + ": " + e.message, 'error');
} }
} }
//删除供应商信息 //删除供应商信息
function deleteDepot(depotID) { function deleteDepot(depotID) {
$.messager.confirm('删除确认','确定要删除此仓库信息吗?',function(r) { $.messager.confirm('删除确认', '确定要删除此仓库信息吗?', function (r) {
if (r) { if (r) {
$.ajax({ $.ajax({
type:"post", type: "post",
url: "<%=path %>/depot/delete.action", url: "<%=path %>/depot/delete.action",
dataType: "json", dataType: "json",
data: ({ data: ({
depotID : depotID, depotID: depotID,
clientIp:'<%=clientIp %>' clientIp: '<%=clientIp %>'
}), }),
success: function (tipInfo) { success: function (tipInfo) {
var msg = tipInfo.showModel.msgTip; var msg = tipInfo.showModel.msgTip;
if(msg == '成功') if (msg == '成功') {
{
//加载完以后重新初始化 //加载完以后重新初始化
$("#searchBtn").click(); $("#searchBtn").click();
} }
else else
$.messager.alert('删除提示','删除仓库信息失败,请稍后再试!','error'); $.messager.alert('删除提示', '删除仓库信息失败,请稍后再试!', 'error');
}, },
//此处添加错误处理 //此处添加错误处理
error:function() { error: function () {
$.messager.alert('删除提示','删除仓库信息异常,请稍后再试!','error'); $.messager.alert('删除提示', '删除仓库信息异常,请稍后再试!', 'error');
return; return;
} }
}); });
@@ -259,19 +266,16 @@
//批量删除供应商 //批量删除供应商
function batDeleteDepot() { function batDeleteDepot() {
var row = $('#tableData').datagrid('getChecked'); var row = $('#tableData').datagrid('getChecked');
if(row.length == 0) { if (row.length == 0) {
$.messager.alert('删除提示','没有记录被选中!','info'); $.messager.alert('删除提示', '没有记录被选中!', 'info');
return; return;
} }
if(row.length > 0) { if (row.length > 0) {
$.messager.confirm('删除确认','确定要删除选中的' + row.length + '条仓库信息吗?',function(r) { $.messager.confirm('删除确认', '确定要删除选中的' + row.length + '条仓库信息吗?', function (r) {
if (r) if (r) {
{
var ids = ""; var ids = "";
for(var i = 0;i < row.length; i ++) for (var i = 0; i < row.length; i++) {
{ if (i == row.length - 1) {
if(i == row.length-1)
{
ids += row[i].id; ids += row[i].id;
break; break;
} }
@@ -279,30 +283,27 @@
ids += row[i].id + ","; ids += row[i].id + ",";
} }
$.ajax({ $.ajax({
type:"post", type: "post",
url: "<%=path %>/depot/batchDelete.action", url: "<%=path %>/depot/batchDelete.action",
dataType: "json", dataType: "json",
async : false, async: false,
data: ({ data: ({
depotIDs : ids, depotIDs: ids,
clientIp:'<%=clientIp %>' clientIp: '<%=clientIp %>'
}), }),
success: function (tipInfo) success: function (tipInfo) {
{
var msg = tipInfo.showModel.msgTip; var msg = tipInfo.showModel.msgTip;
if(msg == '成功') if (msg == '成功') {
{
//加载完以后重新初始化 //加载完以后重新初始化
$("#searchBtn").click(); $("#searchBtn").click();
$(":checkbox").attr("checked",false); $(":checkbox").attr("checked", false);
} }
else else
$.messager.alert('删除提示','删除仓库信息失败,请稍后再试!','error'); $.messager.alert('删除提示', '删除仓库信息失败,请稍后再试!', 'error');
}, },
//此处添加错误处理 //此处添加错误处理
error:function() error: function () {
{ $.messager.alert('删除提示', '删除仓库信息异常,请稍后再试!', 'error');
$.messager.alert('删除提示','删除仓库信息异常,请稍后再试!','error');
return; return;
} }
}); });
@@ -317,11 +318,10 @@
//保存编辑前的名称 //保存编辑前的名称
var orgDepot = ""; var orgDepot = "";
function addDepot() function addDepot() {
{
$("#clientIp").val('<%=clientIp %>'); $("#clientIp").val('<%=clientIp %>');
$('#depotDlg').dialog('open').dialog('setTitle','<img src="<%=path%>/js/easyui-1.3.5/themes/icons/edit_add.png"/>&nbsp;增加仓库信息'); $('#depotDlg').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}); $(".window-mask").css({width: webW, height: webH});
$('#depotFM').form('clear'); $('#depotFM').form('clear');
$("#name").focus(); $("#name").focus();
@@ -331,39 +331,35 @@
} }
//保存信息 //保存信息
$("#saveDepot").off("click").on("click",function() { $("#saveDepot").off("click").on("click", function () {
if(!$('#depotFM').form('validate')) if (!$('#depotFM').form('validate'))
return; return;
else if(checkDepotName()) else if (checkDepotName())
return; return;
else else {
{
$.ajax({ $.ajax({
type:"post", type: "post",
url: url, url: url,
dataType: "json", dataType: "json",
async : false, async: false,
data: ({ data: ({
name : $.trim($("#name").val()), name: $.trim($("#name").val()),
address: $.trim($("#address").val()), address: $.trim($("#address").val()),
warehousing: $.trim($("#warehousing").val()), warehousing: $.trim($("#warehousing").val()),
truckage: $.trim($("#truckage").val()), truckage: $.trim($("#truckage").val()),
type : 0, type: 0,
sort : $.trim($("#sort").val()), sort: $.trim($("#sort").val()),
remark : $.trim($("#remark").val()), remark: $.trim($("#remark").val()),
clientIp:'<%=clientIp %>' clientIp: '<%=clientIp %>'
}), }),
success: function (tipInfo) success: function (tipInfo) {
{ if (tipInfo) {
if(tipInfo)
{
$('#depotDlg').dialog('close'); $('#depotDlg').dialog('close');
var opts = $("#tableData").datagrid('options'); var opts = $("#tableData").datagrid('options');
showDepotDetails(opts.pageNumber,opts.pageSize); showDepotDetails(opts.pageNumber, opts.pageSize);
} }
else else {
{
$.messager.show({ $.messager.show({
title: '错误提示', title: '错误提示',
msg: '保存仓库信息失败,请稍后重试!' msg: '保存仓库信息失败,请稍后重试!'
@@ -371,9 +367,8 @@
} }
}, },
//此处添加错误处理 //此处添加错误处理
error:function() error: function () {
{ $.messager.alert('提示', '保存仓库信息异常,请稍后再试!', 'error');
$.messager.alert('提示','保存仓库信息异常,请稍后再试!','error');
return; return;
} }
}); });
@@ -381,8 +376,7 @@
}); });
//编辑信息 //编辑信息
function editDepot(depotTotalInfo) function editDepot(depotTotalInfo) {
{
var depotInfo = depotTotalInfo.split("AaBb"); var depotInfo = depotTotalInfo.split("AaBb");
$("#clientIp").val('<%=clientIp %>'); $("#clientIp").val('<%=clientIp %>');
@@ -394,8 +388,8 @@
$("#truckage").val(depotInfo[6]); $("#truckage").val(depotInfo[6]);
orgDepot = depotInfo[1]; orgDepot = depotInfo[1];
$('#depotDlg').dialog('open').dialog('setTitle','<img src="<%=path%>/js/easyui-1.3.5/themes/icons/pencil.png"/>&nbsp;编辑仓库信息'); $('#depotDlg').dialog('open').dialog('setTitle', '<img src="<%=path%>/js/easyui-1.3.5/themes/icons/pencil.png"/>&nbsp;编辑仓库信息');
$(".window-mask").css({ width: webW ,height: webH}); $(".window-mask").css({width: webW, height: webH});
depotID = depotInfo[0]; depotID = depotInfo[0];
//焦点在名称输入框==定焦在输入文字后面 //焦点在名称输入框==定焦在输入文字后面
$("#name").val("").focus().val(depotInfo[1]); $("#name").val("").focus().val(depotInfo[1]);
@@ -403,38 +397,33 @@
} }
//检查名称是否存在 ++ 重名无法提示问题需要跟进 //检查名称是否存在 ++ 重名无法提示问题需要跟进
function checkDepotName() function checkDepotName() {
{
var name = $.trim($("#name").val()); var name = $.trim($("#name").val());
//表示是否存在 true == 存在 false = 不存在 //表示是否存在 true == 存在 false = 不存在
var flag = false; var flag = false;
//开始ajax名称检验不能重名 //开始ajax名称检验不能重名
if(name.length > 0 &&( orgDepot.length ==0 || name != orgDepot)) if (name.length > 0 && (orgDepot.length == 0 || name != orgDepot)) {
{
$.ajax({ $.ajax({
type:"post", type: "post",
url: "<%=path %>/depot/checkIsNameExist.action", url: "<%=path %>/depot/checkIsNameExist.action",
dataType: "json", dataType: "json",
async : false, async: false,
data: ({ data: ({
depotID : depotID, depotID: depotID,
name : name name: name
}), }),
success: function (tipInfo) success: function (tipInfo) {
{
flag = tipInfo; flag = tipInfo;
if(tipInfo) if (tipInfo) {
{ $.messager.alert('提示', '仓库名称已经存在', 'info');
$.messager.alert('提示','仓库名称已经存在','info');
//alert("仓库名称已经存在"); //alert("仓库名称已经存在");
//$("#name").val(""); //$("#name").val("");
return; return;
} }
}, },
//此处添加错误处理 //此处添加错误处理
error:function() error: function () {
{ $.messager.alert('提示', '检查仓库名称是否存在异常,请稍后再试!', 'error');
$.messager.alert('提示','检查仓库名称是否存在异常,请稍后再试!','error');
return; return;
} }
}); });
@@ -444,42 +433,38 @@
//搜索处理 //搜索处理
$("#searchBtn").unbind().bind({ $("#searchBtn").unbind().bind({
click:function() click: function () {
{ showDepotDetails(1, initPageSize);
showDepotDetails(1,initPageSize);
var opts = $("#tableData").datagrid('options'); var opts = $("#tableData").datagrid('options');
var pager = $("#tableData").datagrid('getPager'); var pager = $("#tableData").datagrid('getPager');
opts.pageNumber = 1; opts.pageNumber = 1;
opts.pageSize = initPageSize; opts.pageSize = initPageSize;
pager.pagination('refresh', pager.pagination('refresh',
{ {
pageNumber:1, pageNumber: 1,
pageSize:initPageSize pageSize: initPageSize
}); });
} }
}); });
function showDepotDetails(pageNo,pageSize) function showDepotDetails(pageNo, pageSize) {
{
$.ajax({ $.ajax({
type:"post", type: "post",
url: "<%=path %>/depot/findBy.action", url: "<%=path %>/depot/findBy.action",
dataType: "json", dataType: "json",
data: ({ data: ({
name:$.trim($("#searchName").val()), name: $.trim($("#searchName").val()),
type: 0, //仓库 type: 0, //仓库
remark:$.trim($("#searchRemark").val()), remark: $.trim($("#searchRemark").val()),
pageNo:pageNo, pageNo: pageNo,
pageSize:pageSize pageSize: pageSize
}), }),
success: function (data) success: function (data) {
{ $("#tableData").datagrid('loadData', data);
$("#tableData").datagrid('loadData',data);
}, },
//此处添加错误处理 //此处添加错误处理
error:function() error: function () {
{ $.messager.alert('查询提示', '查询数据后台异常,请稍后再试!', 'error');
$.messager.alert('查询提示','查询数据后台异常,请稍后再试!','error');
return; return;
} }
}); });
@@ -487,7 +472,7 @@
//重置按钮 //重置按钮
$("#searchResetBtn").unbind().bind({ $("#searchResetBtn").unbind().bind({
click:function(){ click: function () {
$("#searchName").val(""); $("#searchName").val("");
$("#searchRemark").val(""); $("#searchRemark").val("");
@@ -506,6 +491,6 @@
parent.addTab(currentRow[0].id + "单元", "<%=path %>/pages/materials/building.jsp?ProjectId=" + currentRow[0].id, ""); parent.addTab(currentRow[0].id + "单元", "<%=path %>/pages/materials/building.jsp?ProjectId=" + currentRow[0].id, "");
}); });
</script> </script>
</body> </body>
</html> </html>

View File

@@ -1,29 +1,30 @@
<%@page import="com.jsh.util.Tools"%> <%@page import="com.jsh.util.Tools" %>
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%> <%@ page language="java" pageEncoding="utf-8" %>
<% <%
String path = request.getContextPath(); String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/"; String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + path + "/";
String clientIp = Tools.getLocalIp(request); String clientIp = Tools.getLocalIp(request);
%> %>
<!DOCTYPE html> <!DOCTYPE html>
<html> <html>
<head> <head>
<title>礼品卡管理</title> <title>礼品卡管理</title>
<meta charset="utf-8"> <meta charset="utf-8">
<!-- 指定以IE8的方式来渲染 --> <!-- 指定以IE8的方式来渲染 -->
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE8"/> <meta http-equiv="X-UA-Compatible" content="IE=EmulateIE8"/>
<link rel="shortcut icon" href="<%=path%>/images/favicon.ico" type="image/x-icon" /> <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/default/easyui.css"/>
<link rel="stylesheet" type="text/css" href="<%=path %>/js/easyui-1.3.5/themes/icon.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" /> <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/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/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/locale/easyui-lang-zh_CN.js"></script>
<script type="text/javascript" src="<%=path %>/js/common/common.js"></script> <script type="text/javascript" src="<%=path %>/js/common/common.js"></script>
</head> </head>
<body> <body>
<!-- 查询 --> <!-- 查询 -->
<div id = "searchPanel" class="easyui-panel" style="padding:10px;" title="查询窗口" iconCls="icon-search" collapsible="true" closable="false"> <div id="searchPanel" class="easyui-panel" style="padding:10px;" title="查询窗口" iconCls="icon-search" collapsible="true"
closable="false">
<table id="searchTable"> <table id="searchTable">
<tr> <tr>
<td>礼品卡名称:</td> <td>礼品卡名称:</td>
@@ -45,42 +46,47 @@
</td> </td>
</tr> </tr>
</table> </table>
</div> </div>
<!-- 数据显示table --> <!-- 数据显示table -->
<div id = "tablePanel" class="easyui-panel" style="padding:1px;top:300px;" title="礼品卡列表" iconCls="icon-list" collapsible="true" closable="false"> <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> <table id="tableData" style="top:300px;border-bottom-color:#FFFFFF"></table>
</div> </div>
<div id="depotDlg" class="easyui-dialog" style="width:380px;padding:10px 20px" <div id="depotDlg" class="easyui-dialog" style="width:380px;padding:10px 20px"
closed="true" buttons="#dlg-buttons" modal="true" cache="false" collapsible="false" closable="true"> closed="true" buttons="#dlg-buttons" modal="true" cache="false" collapsible="false" closable="true">
<form id="depotFM" method="post" novalidate> <form id="depotFM" method="post" novalidate>
<table> <table>
<tr> <tr>
<td><label id="nameLabel">礼品卡名称&nbsp;&nbsp;</label></td> <td><label id="nameLabel">礼品卡名称&nbsp;&nbsp;</label></td>
<td style="padding:5px"><input name="name" id="name" class="easyui-validatebox" data-options="required:true,validType:'length[2,30]'" style="width: 230px;height: 20px"/></td> <td style="padding:5px"><input name="name" id="name" class="easyui-validatebox"
data-options="required:true,validType:'length[2,30]'"
style="width: 230px;height: 20px"/></td>
</tr> </tr>
<tr> <tr>
<td><label id="sortLabel">排&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;序&nbsp;&nbsp;</label></td> <td><label id="sortLabel">排&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;序&nbsp;&nbsp;</label></td>
<td style="padding:5px"><input name="sort" id="sort" class="easyui-textbox" style="width: 230px;height: 20px"/></td> <td style="padding:5px"><input name="sort" id="sort" class="easyui-textbox"
style="width: 230px;height: 20px"/></td>
</tr> </tr>
<tr> <tr>
<td><label id="remarkLabel">描&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;述&nbsp;&nbsp;</label></td> <td><label id="remarkLabel">描&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;述&nbsp;&nbsp;</label></td>
<td style="padding:5px"><textarea name="remark" id="remark" rows="2" cols="2" style="width: 230px;"></textarea></td> <td style="padding:5px"><textarea name="remark" id="remark" rows="2" cols="2"
style="width: 230px;"></textarea></td>
</tr> </tr>
</table> </table>
<input type="hidden" name="clientIp" id="clientIp" value="<%=clientIp %>"/> <input type="hidden" name="clientIp" id="clientIp" value="<%=clientIp %>"/>
</form> </form>
</div> </div>
<div id="dlg-buttons"> <div id="dlg-buttons">
<a href="javascript:void(0)" id="saveDepot" class="easyui-linkbutton" iconCls="icon-ok">保存</a> <a href="javascript:void(0)" id="saveDepot" class="easyui-linkbutton" iconCls="icon-ok">保存</a>
<a href="javascript:void(0)" id="cancelDepot" class="easyui-linkbutton" iconCls="icon-cancel" onclick="javascript:$('#depotDlg').dialog('close')">取消</a> <a href="javascript:void(0)" id="cancelDepot" class="easyui-linkbutton" iconCls="icon-cancel"
</div> onclick="javascript:$('#depotDlg').dialog('close')">取消</a>
</div>
<script type="text/javascript"> <script type="text/javascript">
//初始化界面 //初始化界面
$(function() $(function () {
{
initTableData(); initTableData();
ininPager(); ininPager();
initForm(); initForm();
@@ -88,17 +94,14 @@
}); });
//浏览器适配 //浏览器适配
function browserFit() function browserFit() {
{ if (getOs() == 'MSIE') {
if(getOs()=='MSIE')
{
$("#searchRemarkLabel").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;"); $("#nameLabel").empty().append("礼品卡名称&nbsp;&nbsp;");
$("#sortLabel").empty().append("排&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;序&nbsp;&nbsp;"); $("#sortLabel").empty().append("排&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;序&nbsp;&nbsp;");
$("#remarkLabel").empty().append("描&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;述&nbsp;&nbsp;"); $("#remarkLabel").empty().append("描&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;述&nbsp;&nbsp;");
} }
else else {
{
$("#searchRemarkLabel").empty().append("描&nbsp;&nbsp;&nbsp;&nbsp;述:"); $("#searchRemarkLabel").empty().append("描&nbsp;&nbsp;&nbsp;&nbsp;述:");
$("#nameLabel").empty().append("礼品卡名称&nbsp;"); $("#nameLabel").empty().append("礼品卡名称&nbsp;");
$("#sortLabel").empty().append("排&nbsp;&nbsp;&nbsp;&nbsp;序&nbsp;"); $("#sortLabel").empty().append("排&nbsp;&nbsp;&nbsp;&nbsp;序&nbsp;");
@@ -107,163 +110,145 @@
} }
//防止表单提交重复 //防止表单提交重复
function initForm() function initForm() {
{
$('#depotFM').form({ $('#depotFM').form({
onSubmit: function(){ onSubmit: function () {
return false; return false;
} }
}); });
} }
//初始化表格数据 //初始化表格数据
function initTableData() function initTableData() {
{
$('#tableData').datagrid({ $('#tableData').datagrid({
//title:'仓库列表', //title:'仓库列表',
//iconCls:'icon-save', //iconCls:'icon-save',
//width:700, //width:700,
height:heightInfo, height: heightInfo,
nowrap: false, nowrap: false,
rownumbers: false, rownumbers: false,
//动画效果 //动画效果
animate:false, animate: false,
//选中单行 //选中单行
singleSelect : true, singleSelect: true,
collapsible:false, collapsible: false,
selectOnCheck:false, selectOnCheck: false,
//fitColumns:true, //fitColumns:true,
//单击行是否选中 //单击行是否选中
checkOnSelect : false, checkOnSelect: false,
url:'<%=path %>/depot/findBy.action?type=1&pageSize=' + initPageSize, url: '<%=path %>/depot/findBy.action?type=1&pageSize=' + initPageSize,
pagination: true, pagination: true,
//交替出现背景 //交替出现背景
striped : true, striped: true,
//loadFilter: pagerFilter, //loadFilter: pagerFilter,
pageSize: initPageSize, pageSize: initPageSize,
pageList: initPageNum, pageList: initPageNum,
columns:[[ columns: [[
{ field: 'id',width:35,align:"center",checkbox:true}, {field: 'id', width: 35, align: "center", checkbox: true},
{ title: '礼品卡名称',field: 'name',width:200}, {title: '礼品卡名称', field: 'name', width: 200},
{ title: '排序',field: 'sort',width:200}, {title: '排序', field: 'sort', width: 200},
{ title: '描述',field: 'remark',width:200}, {title: '描述', field: 'remark', width: 200},
{ title: '操作',field: 'op',align:"center",width:130,formatter:function(value,rec)
{ {
title: '操作', field: 'op', align: "center", width: 130, formatter: function (value, rec) {
var str = ''; var str = '';
var rowInfo = rec.id + 'AaBb' + rec.name + 'AaBb' + rec.sort + 'AaBb' + rec.remark; var rowInfo = rec.id + 'AaBb' + rec.name + 'AaBb' + rec.sort + 'AaBb' + rec.remark;
if(1 == value) if (1 == value) {
{
str += '<img src="<%=path%>/js/easyui-1.3.5/themes/icons/pencil.png" style="cursor: pointer;" onclick="editDepot(\'' + rowInfo + '\');"/>&nbsp;<a onclick="editDepot(\'' + 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/pencil.png" style="cursor: pointer;" onclick="editDepot(\'' + rowInfo + '\');"/>&nbsp;<a onclick="editDepot(\'' + 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="deleteDepot('+ rec.id +');"/>&nbsp;<a onclick="deleteDepot('+ rec.id +');" 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="deleteDepot(' + rec.id + ');"/>&nbsp;<a onclick="deleteDepot(' + rec.id + ');" style="text-decoration:none;color:black;" href="javascript:void(0)">删除</a>&nbsp;&nbsp;';
} }
return str; return str;
} }
} }
]], ]],
toolbar:[ toolbar: [
{
id:'addDepot',
text:'增加',
iconCls:'icon-add',
handler:function()
{ {
id: 'addDepot',
text: '增加',
iconCls: 'icon-add',
handler: function () {
addDepot(); addDepot();
} }
}, },
{ {
id:'deleteDepot', id: 'deleteDepot',
text:'删除', text: '删除',
iconCls:'icon-remove', iconCls: 'icon-remove',
handler:function() handler: function () {
{
batDeleteDepot(); batDeleteDepot();
} }
} }
], ],
onLoadError:function() onLoadError: function () {
{ $.messager.alert('页面加载提示', '页面加载异常,请稍后再试!', 'error');
$.messager.alert('页面加载提示','页面加载异常,请稍后再试!','error');
return; return;
} }
}); });
} }
//初始化键盘enter事件 //初始化键盘enter事件
$(document).keydown(function(event) $(document).keydown(function (event) {
{
//兼容 IE和firefox 事件 //兼容 IE和firefox 事件
var e = window.event || event; var e = window.event || event;
var k = e.keyCode||e.which||e.charCode; var k = e.keyCode || e.which || e.charCode;
//兼容 IE,firefox 兼容 //兼容 IE,firefox 兼容
var obj = e.srcElement ? e.srcElement : e.target; var obj = e.srcElement ? e.srcElement : e.target;
//绑定键盘事件为 id是指定的输入框才可以触发键盘事件 13键盘事件 ---遗留问题 enter键效验 对话框会关闭问题 //绑定键盘事件为 id是指定的输入框才可以触发键盘事件 13键盘事件 ---遗留问题 enter键效验 对话框会关闭问题
if(k == "13"&&(obj.id=="name"||obj.id=="sort"|| obj.id=="remark" )) if (k == "13" && (obj.id == "name" || obj.id == "sort" || obj.id == "remark")) {
{
$("#saveDepot").click(); $("#saveDepot").click();
} }
//搜索按钮添加快捷键 //搜索按钮添加快捷键
if(k == "13"&&(obj.id=="searchName" || obj.id=="searchRemark" )) if (k == "13" && (obj.id == "searchName" || obj.id == "searchRemark")) {
{
$("#searchBtn").click(); $("#searchBtn").click();
} }
}); });
//分页信息处理 //分页信息处理
function ininPager() function ininPager() {
{ try {
try
{
var opts = $("#tableData").datagrid('options'); var opts = $("#tableData").datagrid('options');
var pager = $("#tableData").datagrid('getPager'); var pager = $("#tableData").datagrid('getPager');
pager.pagination({ pager.pagination({
onSelectPage:function(pageNum, pageSize) onSelectPage: function (pageNum, pageSize) {
{
opts.pageNumber = pageNum; opts.pageNumber = pageNum;
opts.pageSize = pageSize; opts.pageSize = pageSize;
pager.pagination('refresh', pager.pagination('refresh',
{ {
pageNumber:pageNum, pageNumber: pageNum,
pageSize:pageSize pageSize: pageSize
}); });
showDepotDetails(pageNum,pageSize); showDepotDetails(pageNum, pageSize);
} }
}); });
} }
catch (e) catch (e) {
{ $.messager.alert('异常处理提示', "分页信息异常 : " + e.name + ": " + e.message, 'error');
$.messager.alert('异常处理提示',"分页信息异常 : " + e.name + ": " + e.message,'error');
} }
} }
//删除供应商信息 //删除供应商信息
function deleteDepot(depotID) function deleteDepot(depotID) {
{ $.messager.confirm('删除确认', '确定要删除此仓库信息吗?', function (r) {
$.messager.confirm('删除确认','确定要删除此仓库信息吗?',function(r) if (r) {
{
if (r)
{
$.ajax({ $.ajax({
type:"post", type: "post",
url: "<%=path %>/depot/delete.action", url: "<%=path %>/depot/delete.action",
dataType: "json", dataType: "json",
data: ({ data: ({
depotID : depotID, depotID: depotID,
clientIp:'<%=clientIp %>' clientIp: '<%=clientIp %>'
}), }),
success: function (tipInfo) success: function (tipInfo) {
{
var msg = tipInfo.showModel.msgTip; var msg = tipInfo.showModel.msgTip;
if(msg == '成功') if (msg == '成功') {
{
//加载完以后重新初始化 //加载完以后重新初始化
$("#searchBtn").click(); $("#searchBtn").click();
} }
else else
$.messager.alert('删除提示','删除仓库信息失败,请稍后再试!','error'); $.messager.alert('删除提示', '删除仓库信息失败,请稍后再试!', 'error');
}, },
//此处添加错误处理 //此处添加错误处理
error:function() error: function () {
{ $.messager.alert('删除提示', '删除仓库信息异常,请稍后再试!', 'error');
$.messager.alert('删除提示','删除仓库信息异常,请稍后再试!','error');
return; return;
} }
}); });
@@ -272,25 +257,18 @@
} }
//批量删除供应商 //批量删除供应商
function batDeleteDepot() function batDeleteDepot() {
{
var row = $('#tableData').datagrid('getChecked'); var row = $('#tableData').datagrid('getChecked');
if(row.length == 0) if (row.length == 0) {
{ $.messager.alert('删除提示', '没有记录被选中!', 'info');
$.messager.alert('删除提示','没有记录被选中!','info');
return; return;
} }
if(row.length > 0) if (row.length > 0) {
{ $.messager.confirm('删除确认', '确定要删除选中的' + row.length + '条仓库信息吗?', function (r) {
$.messager.confirm('删除确认','确定要删除选中的' + row.length + '条仓库信息吗?',function(r) if (r) {
{
if (r)
{
var ids = ""; var ids = "";
for(var i = 0;i < row.length; i ++) for (var i = 0; i < row.length; i++) {
{ if (i == row.length - 1) {
if(i == row.length-1)
{
ids += row[i].id; ids += row[i].id;
break; break;
} }
@@ -298,30 +276,27 @@
ids += row[i].id + ","; ids += row[i].id + ",";
} }
$.ajax({ $.ajax({
type:"post", type: "post",
url: "<%=path %>/depot/batchDelete.action", url: "<%=path %>/depot/batchDelete.action",
dataType: "json", dataType: "json",
async : false, async: false,
data: ({ data: ({
depotIDs : ids, depotIDs: ids,
clientIp:'<%=clientIp %>' clientIp: '<%=clientIp %>'
}), }),
success: function (tipInfo) success: function (tipInfo) {
{
var msg = tipInfo.showModel.msgTip; var msg = tipInfo.showModel.msgTip;
if(msg == '成功') if (msg == '成功') {
{
//加载完以后重新初始化 //加载完以后重新初始化
$("#searchBtn").click(); $("#searchBtn").click();
$(":checkbox").attr("checked",false); $(":checkbox").attr("checked", false);
} }
else else
$.messager.alert('删除提示','删除仓库信息失败,请稍后再试!','error'); $.messager.alert('删除提示', '删除仓库信息失败,请稍后再试!', 'error');
}, },
//此处添加错误处理 //此处添加错误处理
error:function() error: function () {
{ $.messager.alert('删除提示', '删除仓库信息异常,请稍后再试!', 'error');
$.messager.alert('删除提示','删除仓库信息异常,请稍后再试!','error');
return; return;
} }
}); });
@@ -336,13 +311,12 @@
//保存编辑前的名称 //保存编辑前的名称
var orgDepot = ""; var orgDepot = "";
function addDepot() function addDepot() {
{
$("#clientIp").val('<%=clientIp %>'); $("#clientIp").val('<%=clientIp %>');
$("#sort").val(""); $("#sort").val("");
$("#remark").val(""); $("#remark").val("");
$('#depotDlg').dialog('open').dialog('setTitle','<img src="<%=path%>/js/easyui-1.3.5/themes/icons/edit_add.png"/>&nbsp;增加仓库信息'); $('#depotDlg').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}); $(".window-mask").css({width: webW, height: webH});
$("#name").val("").focus(); $("#name").val("").focus();
//$('#depotFM').form('clear'); //$('#depotFM').form('clear');
@@ -353,37 +327,32 @@
//保存信息 //保存信息
$("#saveDepot").unbind().bind({ $("#saveDepot").unbind().bind({
click:function() click: function () {
{ if (!$('#depotFM').form('validate'))
if(!$('#depotFM').form('validate'))
return; return;
else if(checkDepotName()) else if (checkDepotName())
return; return;
else else {
{
$.ajax({ $.ajax({
type:"post", type: "post",
url: url, url: url,
dataType: "json", dataType: "json",
async : false, async: false,
data: ({ data: ({
name : $.trim($("#name").val()), name: $.trim($("#name").val()),
type : 1, type: 1,
sort : $.trim($("#sort").val()), sort: $.trim($("#sort").val()),
remark : $.trim($("#remark").val()), remark: $.trim($("#remark").val()),
clientIp:'<%=clientIp %>' clientIp: '<%=clientIp %>'
}), }),
success: function (tipInfo) success: function (tipInfo) {
{ if (tipInfo) {
if(tipInfo)
{
$('#depotDlg').dialog('close'); $('#depotDlg').dialog('close');
var opts = $("#tableData").datagrid('options'); var opts = $("#tableData").datagrid('options');
showDepotDetails(opts.pageNumber,opts.pageSize); showDepotDetails(opts.pageNumber, opts.pageSize);
} }
else else {
{
$.messager.show({ $.messager.show({
title: '错误提示', title: '错误提示',
msg: '保存仓库信息失败,请稍后重试!' msg: '保存仓库信息失败,请稍后重试!'
@@ -391,9 +360,8 @@
} }
}, },
//此处添加错误处理 //此处添加错误处理
error:function() error: function () {
{ $.messager.alert('提示', '保存仓库信息异常,请稍后再试!', 'error');
$.messager.alert('提示','保存仓库信息异常,请稍后再试!','error');
return; return;
} }
}); });
@@ -402,8 +370,7 @@
}); });
//编辑信息 //编辑信息
function editDepot(depotTotalInfo) function editDepot(depotTotalInfo) {
{
var depotInfo = depotTotalInfo.split("AaBb"); var depotInfo = depotTotalInfo.split("AaBb");
$("#clientIp").val('<%=clientIp %>'); $("#clientIp").val('<%=clientIp %>');
@@ -412,8 +379,8 @@
$("#remark").val(depotInfo[3]); $("#remark").val(depotInfo[3]);
orgDepot = depotInfo[1]; orgDepot = depotInfo[1];
$('#depotDlg').dialog('open').dialog('setTitle','<img src="<%=path%>/js/easyui-1.3.5/themes/icons/pencil.png"/>&nbsp;编辑仓库信息'); $('#depotDlg').dialog('open').dialog('setTitle', '<img src="<%=path%>/js/easyui-1.3.5/themes/icons/pencil.png"/>&nbsp;编辑仓库信息');
$(".window-mask").css({ width: webW ,height: webH}); $(".window-mask").css({width: webW, height: webH});
depotID = depotInfo[0]; depotID = depotInfo[0];
//焦点在名称输入框==定焦在输入文字后面 //焦点在名称输入框==定焦在输入文字后面
$("#name").val("").focus().val(depotInfo[1]); $("#name").val("").focus().val(depotInfo[1]);
@@ -421,38 +388,33 @@
} }
//检查名称是否存在 ++ 重名无法提示问题需要跟进 //检查名称是否存在 ++ 重名无法提示问题需要跟进
function checkDepotName() function checkDepotName() {
{
var name = $.trim($("#name").val()); var name = $.trim($("#name").val());
//表示是否存在 true == 存在 false = 不存在 //表示是否存在 true == 存在 false = 不存在
var flag = false; var flag = false;
//开始ajax名称检验不能重名 //开始ajax名称检验不能重名
if(name.length > 0 &&( orgDepot.length ==0 || name != orgDepot)) if (name.length > 0 && (orgDepot.length == 0 || name != orgDepot)) {
{
$.ajax({ $.ajax({
type:"post", type: "post",
url: "<%=path %>/depot/checkIsNameExist.action", url: "<%=path %>/depot/checkIsNameExist.action",
dataType: "json", dataType: "json",
async : false, async: false,
data: ({ data: ({
depotID : depotID, depotID: depotID,
name : name name: name
}), }),
success: function (tipInfo) success: function (tipInfo) {
{
flag = tipInfo; flag = tipInfo;
if(tipInfo) if (tipInfo) {
{ $.messager.alert('提示', '仓库名称已经存在', 'info');
$.messager.alert('提示','仓库名称已经存在','info');
//alert("仓库名称已经存在"); //alert("仓库名称已经存在");
//$("#name").val(""); //$("#name").val("");
return; return;
} }
}, },
//此处添加错误处理 //此处添加错误处理
error:function() error: function () {
{ $.messager.alert('提示', '检查仓库名称是否存在异常,请稍后再试!', 'error');
$.messager.alert('提示','检查仓库名称是否存在异常,请稍后再试!','error');
return; return;
} }
}); });
@@ -462,42 +424,38 @@
//搜索处理 //搜索处理
$("#searchBtn").unbind().bind({ $("#searchBtn").unbind().bind({
click:function() click: function () {
{ showDepotDetails(1, initPageSize);
showDepotDetails(1,initPageSize);
var opts = $("#tableData").datagrid('options'); var opts = $("#tableData").datagrid('options');
var pager = $("#tableData").datagrid('getPager'); var pager = $("#tableData").datagrid('getPager');
opts.pageNumber = 1; opts.pageNumber = 1;
opts.pageSize = initPageSize; opts.pageSize = initPageSize;
pager.pagination('refresh', pager.pagination('refresh',
{ {
pageNumber:1, pageNumber: 1,
pageSize:initPageSize pageSize: initPageSize
}); });
} }
}); });
function showDepotDetails(pageNo,pageSize) function showDepotDetails(pageNo, pageSize) {
{
$.ajax({ $.ajax({
type:"post", type: "post",
url: "<%=path %>/depot/findBy.action", url: "<%=path %>/depot/findBy.action",
dataType: "json", dataType: "json",
data: ({ data: ({
name:$.trim($("#searchName").val()), name: $.trim($("#searchName").val()),
type: 1, // 礼品卡 type: 1, // 礼品卡
remark:$.trim($("#searchRemark").val()), remark: $.trim($("#searchRemark").val()),
pageNo:pageNo, pageNo: pageNo,
pageSize:pageSize pageSize: pageSize
}), }),
success: function (data) success: function (data) {
{ $("#tableData").datagrid('loadData', data);
$("#tableData").datagrid('loadData',data);
}, },
//此处添加错误处理 //此处添加错误处理
error:function() error: function () {
{ $.messager.alert('查询提示', '查询数据后台异常,请稍后再试!', 'error');
$.messager.alert('查询提示','查询数据后台异常,请稍后再试!','error');
return; return;
} }
}); });
@@ -505,7 +463,7 @@
//重置按钮 //重置按钮
$("#searchResetBtn").unbind().bind({ $("#searchResetBtn").unbind().bind({
click:function(){ click: function () {
$("#searchName").val(""); $("#searchName").val("");
$("#searchRemark").val(""); $("#searchRemark").val("");
@@ -524,6 +482,6 @@
parent.addTab(currentRow[0].id + "单元", "<%=path %>/pages/materials/building.jsp?ProjectId=" + currentRow[0].id, ""); parent.addTab(currentRow[0].id + "单元", "<%=path %>/pages/materials/building.jsp?ProjectId=" + currentRow[0].id, "");
}); });
</script> </script>
</body> </body>
</html> </html>

View File

@@ -1,29 +1,30 @@
<%@page import="com.jsh.util.Tools"%> <%@page import="com.jsh.util.Tools" %>
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%> <%@ page language="java" pageEncoding="utf-8" %>
<% <%
String path = request.getContextPath(); String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/"; String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + path + "/";
String clientIp = Tools.getLocalIp(request); String clientIp = Tools.getLocalIp(request);
%> %>
<!DOCTYPE html> <!DOCTYPE html>
<html> <html>
<head> <head>
<title>功能管理</title> <title>功能管理</title>
<meta charset="utf-8"> <meta charset="utf-8">
<!-- 指定以IE8的方式来渲染 --> <!-- 指定以IE8的方式来渲染 -->
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE8"/> <meta http-equiv="X-UA-Compatible" content="IE=EmulateIE8"/>
<link rel="shortcut icon" href="<%=path%>/images/favicon.ico" type="image/x-icon" /> <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/default/easyui.css"/>
<link rel="stylesheet" type="text/css" href="<%=path %>/js/easyui-1.3.5/themes/icon.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" /> <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/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/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/locale/easyui-lang-zh_CN.js"></script>
<script type="text/javascript" src="<%=path %>/js/common/common.js"></script> <script type="text/javascript" src="<%=path %>/js/common/common.js"></script>
</head> </head>
<body> <body>
<!-- 查询 --> <!-- 查询 -->
<div id = "searchPanel" class="easyui-panel" style="padding:10px;" title="查询窗口" iconCls="icon-search" collapsible="true" closable="false"> <div id="searchPanel" class="easyui-panel" style="padding:10px;" title="查询窗口" iconCls="icon-search" collapsible="true"
closable="false">
<table id="searchTable"> <table id="searchTable">
<tr> <tr>
<td>名称:</td> <td>名称:</td>
@@ -32,7 +33,7 @@
</td> </td>
<td>&nbsp;</td> <td>&nbsp;</td>
<td>&nbsp;</td> <td>&nbsp;</td>
<td>类型: </td> <td>类型:</td>
<td>&nbsp;</td> <td>&nbsp;</td>
<td> <td>
<select name="searchType" id="searchType" style="width:100px; height:20px"> <select name="searchType" id="searchType" style="width:100px; height:20px">
@@ -49,71 +50,81 @@
</td> </td>
</tr> </tr>
</table> </table>
</div> </div>
<!-- 数据显示table --> <!-- 数据显示table -->
<div id = "tablePanel" class="easyui-panel" style="padding:1px;top:300px;" title="功能列表" iconCls="icon-list" collapsible="true" closable="false"> <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> <table id="tableData" style="top:300px;border-bottom-color:#FFFFFF"></table>
</div> </div>
<div id="functionsDlg" class="easyui-dialog" style="width:380px;padding:10px 20px" <div id="functionsDlg" class="easyui-dialog" style="width:380px;padding:10px 20px"
closed="true" buttons="#dlg-buttons" modal="true" cache="false" collapsible="false" closable="true"> closed="true" buttons="#dlg-buttons" modal="true" cache="false" collapsible="false" closable="true">
<form id="functionsFM" method="post" novalidate> <form id="functionsFM" method="post" novalidate>
<table> <table>
<tr> <tr>
<td style="width:65px;">编号</td> <td style="width:65px;">编号</td>
<td style="padding:5px"><input name="Number" id="Number" class="easyui-textbox" style="width: 230px;height: 20px"/></td> <td style="padding:5px"><input name="Number" id="Number" class="easyui-textbox"
style="width: 230px;height: 20px"/></td>
</tr> </tr>
<tr> <tr>
<td>名称</td> <td>名称</td>
<td style="padding:5px"><input name="Name" id="Name" class="easyui-validatebox" data-options="required:true,validType:'length[2,20]'" style="width: 230px;height: 20px"/></td> <td style="padding:5px"><input name="Name" id="Name" class="easyui-validatebox"
data-options="required:true,validType:'length[2,20]'"
style="width: 230px;height: 20px"/></td>
</tr> </tr>
<tr> <tr>
<td>上级编号</td> <td>上级编号</td>
<td style="padding:5px"><input name="PNumber" id="PNumber" class="easyui-textbox" style="width: 230px;height: 20px"/></td> <td style="padding:5px"><input name="PNumber" id="PNumber" class="easyui-textbox"
style="width: 230px;height: 20px"/></td>
</tr> </tr>
<tr> <tr>
<td>链接</td> <td>链接</td>
<td style="padding:5px"><input name="URL" id="URL" class="easyui-textbox" style="width: 230px;height: 20px"/></td> <td style="padding:5px"><input name="URL" id="URL" class="easyui-textbox"
style="width: 230px;height: 20px"/></td>
</tr> </tr>
<tr> <tr>
<td>排序</td> <td>排序</td>
<td style="padding:5px"><input name="Sort" id="Sort" class="easyui-textbox" style="width: 230px;height: 20px"/></td> <td style="padding:5px"><input name="Sort" id="Sort" class="easyui-textbox"
style="width: 230px;height: 20px"/></td>
</tr> </tr>
<tr> <tr>
<td>功能按钮</td> <td>功能按钮</td>
<td style="padding:5px"> <td style="padding:5px">
<input id="PushBtn" name="PushBtn" style="width:230px;" /> <input id="PushBtn" name="PushBtn" style="width:230px;"/>
</td> </td>
</tr> </tr>
<tr> <tr>
<td>收缩</td> <td>收缩</td>
<td style="padding:5px"><input name="State" id="State" type="checkbox" style="width: 230px;height: 20px"/></td> <td style="padding:5px"><input name="State" id="State" type="checkbox"
style="width: 230px;height: 20px"/></td>
</tr> </tr>
<tr> <tr>
<td>启用</td> <td>启用</td>
<td style="padding:5px"><input name="Enabled" id="Enabled" type="checkbox" style="width: 230px;height: 20px"/></td> <td style="padding:5px"><input name="Enabled" id="Enabled" type="checkbox"
style="width: 230px;height: 20px"/></td>
</tr> </tr>
<tr> <tr>
<td>类型</td> <td>类型</td>
<td style="padding:5px"><select name="Type" id="Type" style="width: 230px;height: 20px"> <td style="padding:5px"><select name="Type" id="Type" style="width: 230px;height: 20px">
<option value="电脑版">电脑版</option> <option value="电脑版">电脑版</option>
<option value="手机版">手机版</option></select> <option value="手机版">手机版</option>
</select>
</td> </td>
</tr> </tr>
</table> </table>
<input type="hidden" name="clientIp" id="clientIp" value="<%=clientIp %>"/> <input type="hidden" name="clientIp" id="clientIp" value="<%=clientIp %>"/>
</form> </form>
</div> </div>
<div id="dlg-buttons"> <div id="dlg-buttons">
<a href="javascript:void(0)" id="saveFunctions" class="easyui-linkbutton" iconCls="icon-ok">保存</a> <a href="javascript:void(0)" id="saveFunctions" class="easyui-linkbutton" iconCls="icon-ok">保存</a>
<a href="javascript:void(0)" id="cancelFunctions" class="easyui-linkbutton" iconCls="icon-cancel" onclick="javascript:$('#functionsDlg').dialog('close')">取消</a> <a href="javascript:void(0)" id="cancelFunctions" class="easyui-linkbutton" iconCls="icon-cancel"
</div> onclick="javascript:$('#functionsDlg').dialog('close')">取消</a>
</div>
<script type="text/javascript"> <script type="text/javascript">
//初始化界面 //初始化界面
$(function() $(function () {
{
initTableData(); initTableData();
ininPager(); ininPager();
initForm(); initForm();
@@ -121,183 +132,169 @@
}); });
//防止表单提交重复 //防止表单提交重复
function initForm() function initForm() {
{
$('#functionsFM').form({ $('#functionsFM').form({
onSubmit: function(){ onSubmit: function () {
return false; return false;
} }
}); });
} }
//初始化表格数据 //初始化表格数据
function initTableData() function initTableData() {
{
$('#tableData').datagrid({ $('#tableData').datagrid({
//title:'功能列表', //title:'功能列表',
//iconCls:'icon-save', //iconCls:'icon-save',
//width:700, //width:700,
height:heightInfo, height: heightInfo,
rownumbers: false, rownumbers: false,
//动画效果 //动画效果
animate:false, animate: false,
//选中单行 //选中单行
singleSelect : true, singleSelect: true,
collapsible:false, collapsible: false,
selectOnCheck:false, selectOnCheck: false,
//fitColumns:true, //fitColumns:true,
//单击行是否选中 //单击行是否选中
checkOnSelect : false, checkOnSelect: false,
url:'<%=path %>/functions/findBy.action?pageSize=' + initPageSize, url: '<%=path %>/functions/findBy.action?pageSize=' + initPageSize,
pagination: true, pagination: true,
//交替出现背景 //交替出现背景
striped : true, striped: true,
//loadFilter: pagerFilter, //loadFilter: pagerFilter,
pageSize: initPageSize, pageSize: initPageSize,
pageList: initPageNum, pageList: initPageNum,
columns:[[ columns: [[
{ field: 'Id',width:35,align:"center",checkbox:true}, {field: 'Id', width: 35, align: "center", checkbox: true},
{ title: '编号 ',field: 'Number',width:60}, {title: '编号 ', field: 'Number', width: 60},
{ title: '名称',field: 'Name',width:80}, {title: '名称', field: 'Name', width: 80},
{ title: '上级编号',field: 'PNumber',width:60}, {title: '上级编号', field: 'PNumber', width: 60},
{ title: '链接',field: 'URL',width:200}, {title: '链接', field: 'URL', width: 200},
{ title: '排序',field: 'Sort',width:50}, {title: '排序', field: 'Sort', width: 50},
{ title: '收缩',field: 'State',width:50,formatter:function(value){
return value? "开":"关";
}},
{ title: '启用',field: 'Enabled',width:50,formatter:function(value){
return value? "开":"关";
}},
{ title: '类型',field: 'Type',width:50},
{ title: '操作',field: 'op',align:"center",width:130,formatter:function(value,rec)
{ {
title: '收缩', field: 'State', width: 50, formatter: function (value) {
return value ? "开" : "关";
}
},
{
title: '启用', field: 'Enabled', width: 50, formatter: function (value) {
return value ? "开" : "关";
}
},
{title: '类型', field: 'Type', width: 50},
{
title: '操作', field: 'op', align: "center", width: 130, formatter: function (value, rec) {
var str = ''; var str = '';
var rowInfo = rec.Id + 'AaBb' + rec.Number+ 'AaBb' + rec.Name+ 'AaBb' + rec.PNumber+ 'AaBb' + rec.URL var rowInfo = rec.Id + 'AaBb' + rec.Number + 'AaBb' + rec.Name + 'AaBb' + rec.PNumber + 'AaBb' + rec.URL
+ 'AaBb' + rec.State+ 'AaBb' + rec.Sort+ 'AaBb' + rec.Enabled+ 'AaBb' + rec.Type + 'AaBb' + rec.PushBtn; + 'AaBb' + rec.State + 'AaBb' + rec.Sort + 'AaBb' + rec.Enabled + 'AaBb' + rec.Type + 'AaBb' + rec.PushBtn;
if(1 == value) if (1 == value) {
{
str += '<img src="<%=path%>/js/easyui-1.3.5/themes/icons/pencil.png" style="cursor: pointer;" onclick="editFunctions(\'' + rowInfo + '\');"/>&nbsp;<a onclick="editFunctions(\'' + 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/pencil.png" style="cursor: pointer;" onclick="editFunctions(\'' + rowInfo + '\');"/>&nbsp;<a onclick="editFunctions(\'' + 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="deleteFunctions('+ rec.Id +');"/>&nbsp;<a onclick="deleteFunctions('+ rec.Id +');" 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="deleteFunctions(' + rec.Id + ');"/>&nbsp;<a onclick="deleteFunctions(' + rec.Id + ');" style="text-decoration:none;color:black;" href="javascript:void(0)">删除</a>&nbsp;&nbsp;';
} }
return str; return str;
} }
} }
]], ]],
toolbar:[ toolbar: [
{
id:'addFunctions',
text:'增加',
iconCls:'icon-add',
handler:function()
{ {
id: 'addFunctions',
text: '增加',
iconCls: 'icon-add',
handler: function () {
addFunctions(); addFunctions();
} }
}, },
{ {
id:'deleteFunctions', id: 'deleteFunctions',
text:'删除', text: '删除',
iconCls:'icon-remove', iconCls: 'icon-remove',
handler:function() handler: function () {
{
batDeleteFunctions(); batDeleteFunctions();
} }
} }
], ],
onLoadError:function() onLoadError: function () {
{ $.messager.alert('页面加载提示', '页面加载异常,请稍后再试!', 'error');
$.messager.alert('页面加载提示','页面加载异常,请稍后再试!','error');
return; return;
} }
}); });
} }
//初始化键盘enter事件 //初始化键盘enter事件
$(document).keydown(function(event) $(document).keydown(function (event) {
{
//兼容 IE和firefox 事件 //兼容 IE和firefox 事件
var e = window.event || event; var e = window.event || event;
var k = e.keyCode||e.which||e.charCode; var k = e.keyCode || e.which || e.charCode;
//兼容 IE,firefox 兼容 //兼容 IE,firefox 兼容
var obj = e.srcElement ? e.srcElement : e.target; var obj = e.srcElement ? e.srcElement : e.target;
//绑定键盘事件为 id是指定的输入框才可以触发键盘事件 13键盘事件 ---遗留问题 enter键效验 对话框会关闭问题 //绑定键盘事件为 id是指定的输入框才可以触发键盘事件 13键盘事件 ---遗留问题 enter键效验 对话框会关闭问题
if(k == "13"&&(obj.id=="Name"||obj.id=="PNumber"|| obj.id=="URL" )) if (k == "13" && (obj.id == "Name" || obj.id == "PNumber" || obj.id == "URL")) {
{
$("#saveFunctions").click(); $("#saveFunctions").click();
} }
//搜索按钮添加快捷键 //搜索按钮添加快捷键
if(k == "13"&&(obj.id=="searchName" || obj.id=="searchType" )) if (k == "13" && (obj.id == "searchName" || obj.id == "searchType")) {
{
$("#searchBtn").click(); $("#searchBtn").click();
} }
}); });
//分页信息处理 //分页信息处理
function ininPager() function ininPager() {
{ try {
try
{
var opts = $("#tableData").datagrid('options'); var opts = $("#tableData").datagrid('options');
var pager = $("#tableData").datagrid('getPager'); var pager = $("#tableData").datagrid('getPager');
pager.pagination({ pager.pagination({
onSelectPage:function(pageNum, pageSize) onSelectPage: function (pageNum, pageSize) {
{
opts.pageNumber = pageNum; opts.pageNumber = pageNum;
opts.pageSize = pageSize; opts.pageSize = pageSize;
pager.pagination('refresh', pager.pagination('refresh',
{ {
pageNumber:pageNum, pageNumber: pageNum,
pageSize:pageSize pageSize: pageSize
}); });
showFunctionsDetails(pageNum,pageSize); showFunctionsDetails(pageNum, pageSize);
} }
}); });
} }
catch (e) catch (e) {
{ $.messager.alert('异常处理提示', "分页信息异常 : " + e.name + ": " + e.message, 'error');
$.messager.alert('异常处理提示',"分页信息异常 : " + e.name + ": " + e.message,'error');
} }
} }
//绑定事件 //绑定事件
function bindEvent(){ function bindEvent() {
$('#PushBtn').combobox({ $('#PushBtn').combobox({
url: '<%=path %>/js/pages/manage/pushBtn.json', url: '<%=path %>/js/pages/manage/pushBtn.json',
valueField:'id', valueField: 'id',
textField:'text', textField: 'text',
panelHeight:120, panelHeight: 120,
multiple:true multiple: true
}); });
} }
//删除供应商信息 //删除供应商信息
function deleteFunctions(functionsID) function deleteFunctions(functionsID) {
{ $.messager.confirm('删除确认', '确定要删除此功能信息吗?', function (r) {
$.messager.confirm('删除确认','确定要删除此功能信息吗?',function(r) if (r) {
{
if (r)
{
$.ajax({ $.ajax({
type:"post", type: "post",
url: "<%=path %>/functions/delete.action", url: "<%=path %>/functions/delete.action",
dataType: "json", dataType: "json",
data: ({ data: ({
functionsID : functionsID, functionsID: functionsID,
clientIp:'<%=clientIp %>' clientIp: '<%=clientIp %>'
}), }),
success: function (tipInfo) success: function (tipInfo) {
{
var msg = tipInfo.showModel.msgTip; var msg = tipInfo.showModel.msgTip;
if(msg == '成功') if (msg == '成功') {
{
//加载完以后重新初始化 //加载完以后重新初始化
$("#searchBtn").click(); $("#searchBtn").click();
} }
else else
$.messager.alert('删除提示','删除功能信息失败,请稍后再试!','error'); $.messager.alert('删除提示', '删除功能信息失败,请稍后再试!', 'error');
}, },
//此处添加错误处理 //此处添加错误处理
error:function() error: function () {
{ $.messager.alert('删除提示', '删除功能信息异常,请稍后再试!', 'error');
$.messager.alert('删除提示','删除功能信息异常,请稍后再试!','error');
return; return;
} }
}); });
@@ -306,25 +303,18 @@
} }
//批量删除 //批量删除
function batDeleteFunctions() function batDeleteFunctions() {
{
var row = $('#tableData').datagrid('getChecked'); var row = $('#tableData').datagrid('getChecked');
if(row.length == 0) if (row.length == 0) {
{ $.messager.alert('删除提示', '没有记录被选中!', 'info');
$.messager.alert('删除提示','没有记录被选中!','info');
return; return;
} }
if(row.length > 0) if (row.length > 0) {
{ $.messager.confirm('删除确认', '确定要删除选中的' + row.length + '条功能信息吗?', function (r) {
$.messager.confirm('删除确认','确定要删除选中的' + row.length + '条功能信息吗?',function(r) if (r) {
{
if (r)
{
var ids = ""; var ids = "";
for(var i = 0;i < row.length; i ++) for (var i = 0; i < row.length; i++) {
{ if (i == row.length - 1) {
if(i == row.length-1)
{
ids += row[i].Id; ids += row[i].Id;
break; break;
} }
@@ -332,30 +322,27 @@
ids += row[i].Id + ","; ids += row[i].Id + ",";
} }
$.ajax({ $.ajax({
type:"post", type: "post",
url: "<%=path %>/functions/batchDelete.action", url: "<%=path %>/functions/batchDelete.action",
dataType: "json", dataType: "json",
async : false, async: false,
data: ({ data: ({
functionsIDs : ids, functionsIDs: ids,
clientIp:'<%=clientIp %>' clientIp: '<%=clientIp %>'
}), }),
success: function (tipInfo) success: function (tipInfo) {
{
var msg = tipInfo.showModel.msgTip; var msg = tipInfo.showModel.msgTip;
if(msg == '成功') if (msg == '成功') {
{
//加载完以后重新初始化 //加载完以后重新初始化
$("#searchBtn").click(); $("#searchBtn").click();
$(":checkbox").attr("checked",false); $(":checkbox").attr("checked", false);
} }
else else
$.messager.alert('删除提示','删除功能信息失败,请稍后再试!','error'); $.messager.alert('删除提示', '删除功能信息失败,请稍后再试!', 'error');
}, },
//此处添加错误处理 //此处添加错误处理
error:function() error: function () {
{ $.messager.alert('删除提示', '删除功能信息异常,请稍后再试!', 'error');
$.messager.alert('删除提示','删除功能信息异常,请稍后再试!','error');
return; return;
} }
}); });
@@ -370,11 +357,10 @@
//保存编辑前的名称 //保存编辑前的名称
var orgFunctions = ""; var orgFunctions = "";
function addFunctions() function addFunctions() {
{
$("#clientIp").val('<%=clientIp %>'); $("#clientIp").val('<%=clientIp %>');
$('#functionsDlg').dialog('open').dialog('setTitle','<img src="<%=path%>/js/easyui-1.3.5/themes/icons/edit_add.png"/>&nbsp;增加功能信息'); $('#functionsDlg').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}); $(".window-mask").css({width: webW, height: webH});
$("#Name").val("").focus(); $("#Name").val("").focus();
$('#functionsFM').form('clear'); $('#functionsFM').form('clear');
@@ -385,46 +371,41 @@
//保存信息 //保存信息
$("#saveFunctions").unbind().bind({ $("#saveFunctions").unbind().bind({
click:function() click: function () {
{ if (!$('#functionsFM').form('validate'))
if(!$('#functionsFM').form('validate'))
return; return;
else if(checkFunctionsName()) else if (checkFunctionsName())
return; return;
else else {
{ if (!$("#Type").val()) {
if(!$("#Type").val()){ $.messager.alert('提示', '请选择类型!', 'warning');
$.messager.alert('提示','请选择类型!','warning');
return; return;
} }
$.ajax({ $.ajax({
type:"post", type: "post",
url: url, url: url,
dataType: "json", dataType: "json",
async : false, async: false,
data: ({ data: ({
Number : $.trim($("#Number").val()), Number: $.trim($("#Number").val()),
Name : $.trim($("#Name").val()), Name: $.trim($("#Name").val()),
PNumber : $.trim($("#PNumber").val()), PNumber: $.trim($("#PNumber").val()),
URL : $.trim($("#URL").val()), URL: $.trim($("#URL").val()),
State : $("#State").is(':checked'), State: $("#State").is(':checked'),
Sort : $.trim($("#Sort").val()), Sort: $.trim($("#Sort").val()),
Enabled : $("#Enabled").is(':checked'), Enabled: $("#Enabled").is(':checked'),
Type : $.trim($("#Type").val()), Type: $.trim($("#Type").val()),
PushBtn : $('#PushBtn').combobox('getValues').toString(), //功能按钮 PushBtn: $('#PushBtn').combobox('getValues').toString(), //功能按钮
clientIp:'<%=clientIp %>' clientIp: '<%=clientIp %>'
}), }),
success: function (tipInfo) success: function (tipInfo) {
{ if (tipInfo) {
if(tipInfo)
{
$('#functionsDlg').dialog('close'); $('#functionsDlg').dialog('close');
var opts = $("#tableData").datagrid('options'); var opts = $("#tableData").datagrid('options');
showFunctionsDetails(opts.pageNumber,opts.pageSize); showFunctionsDetails(opts.pageNumber, opts.pageSize);
} }
else else {
{
$.messager.show({ $.messager.show({
title: '错误提示', title: '错误提示',
msg: '保存功能信息失败,请稍后重试!' msg: '保存功能信息失败,请稍后重试!'
@@ -432,9 +413,8 @@
} }
}, },
//此处添加错误处理 //此处添加错误处理
error:function() error: function () {
{ $.messager.alert('提示', '保存功能信息异常,请稍后再试!', 'error');
$.messager.alert('提示','保存功能信息异常,请稍后再试!','error');
return; return;
} }
}); });
@@ -443,8 +423,7 @@
}); });
//编辑信息 //编辑信息
function editFunctions(functionsTotalInfo) function editFunctions(functionsTotalInfo) {
{
var functionsInfo = functionsTotalInfo.split("AaBb"); var functionsInfo = functionsTotalInfo.split("AaBb");
$("#clientIp").val('<%=clientIp %>'); $("#clientIp").val('<%=clientIp %>');
@@ -452,19 +431,19 @@
$("#Name").focus().val(functionsInfo[2]); $("#Name").focus().val(functionsInfo[2]);
$("#PNumber").focus().val(functionsInfo[3]); $("#PNumber").focus().val(functionsInfo[3]);
$("#URL").focus().val(functionsInfo[4]); $("#URL").focus().val(functionsInfo[4]);
$("#State").attr("checked",functionsInfo[5]=='true'?true:false); $("#State").attr("checked", functionsInfo[5] == 'true' ? true : false);
$("#Sort").focus().val(functionsInfo[6]); $("#Sort").focus().val(functionsInfo[6]);
$("#Enabled").attr("checked",functionsInfo[7]=='true'?true:false); $("#Enabled").attr("checked", functionsInfo[7] == 'true' ? true : false);
$("#Type").focus().val(functionsInfo[8]); $("#Type").focus().val(functionsInfo[8]);
if(functionsInfo[9] !== "undefined" && functionsInfo[9] !== ""){ if (functionsInfo[9] !== "undefined" && functionsInfo[9] !== "") {
var arr = functionsInfo[9].split(","); var arr = functionsInfo[9].split(",");
var pushBtnArray = []; var pushBtnArray = [];
for(var i=0;i<arr.length;i++){ for (var i = 0; i < arr.length; i++) {
if(arr[i]){ if (arr[i]) {
pushBtnArray.push(arr[i]); pushBtnArray.push(arr[i]);
} }
} }
if(pushBtnArray.length){ if (pushBtnArray.length) {
$("#PushBtn").combobox('setValues', pushBtnArray); $("#PushBtn").combobox('setValues', pushBtnArray);
} }
} }
@@ -473,8 +452,8 @@
} }
orgFunctions = functionsInfo[2]; orgFunctions = functionsInfo[2];
$('#functionsDlg').dialog('open').dialog('setTitle','<img src="<%=path%>/js/easyui-1.3.5/themes/icons/pencil.png"/>&nbsp;编辑功能信息'); $('#functionsDlg').dialog('open').dialog('setTitle', '<img src="<%=path%>/js/easyui-1.3.5/themes/icons/pencil.png"/>&nbsp;编辑功能信息');
$(".window-mask").css({ width: webW ,height: webH}); $(".window-mask").css({width: webW, height: webH});
functionsID = functionsInfo[0]; functionsID = functionsInfo[0];
//焦点在名称输入框==定焦在输入文字后面 //焦点在名称输入框==定焦在输入文字后面
$("#Name").val("").focus().val(functionsInfo[2]); $("#Name").val("").focus().val(functionsInfo[2]);
@@ -482,38 +461,33 @@
} }
//检查名称是否存在 ++ 重名无法提示问题需要跟进 //检查名称是否存在 ++ 重名无法提示问题需要跟进
function checkFunctionsName() function checkFunctionsName() {
{
var Name = $.trim($("#Name").val()); var Name = $.trim($("#Name").val());
//表示是否存在 true == 存在 false = 不存在 //表示是否存在 true == 存在 false = 不存在
var flag = false; var flag = false;
//开始ajax名称检验不能重名 //开始ajax名称检验不能重名
if(name.length > 0 &&( orgFunctions.length ==0 || name != orgFunctions)) if (name.length > 0 && (orgFunctions.length == 0 || name != orgFunctions)) {
{
$.ajax({ $.ajax({
type:"post", type: "post",
url: "<%=path %>/functions/checkIsNameExist.action", url: "<%=path %>/functions/checkIsNameExist.action",
dataType: "json", dataType: "json",
async : false, async: false,
data: ({ data: ({
functionsID : functionsID, functionsID: functionsID,
Name : Name Name: Name
}), }),
success: function (tipInfo) success: function (tipInfo) {
{
flag = tipInfo; flag = tipInfo;
if(tipInfo) if (tipInfo) {
{ $.messager.alert('提示', '功能名称已经存在', 'info');
$.messager.alert('提示','功能名称已经存在','info');
//alert("功能名称已经存在"); //alert("功能名称已经存在");
//$("#name").val(""); //$("#name").val("");
return; return;
} }
}, },
//此处添加错误处理 //此处添加错误处理
error:function() error: function () {
{ $.messager.alert('提示', '检查功能名称是否存在异常,请稍后再试!', 'error');
$.messager.alert('提示','检查功能名称是否存在异常,请稍后再试!','error');
return; return;
} }
}); });
@@ -523,41 +497,37 @@
//搜索处理 //搜索处理
$("#searchBtn").unbind().bind({ $("#searchBtn").unbind().bind({
click:function() click: function () {
{ showFunctionsDetails(1, initPageSize);
showFunctionsDetails(1,initPageSize);
var opts = $("#tableData").datagrid('options'); var opts = $("#tableData").datagrid('options');
var pager = $("#tableData").datagrid('getPager'); var pager = $("#tableData").datagrid('getPager');
opts.pageNumber = 1; opts.pageNumber = 1;
opts.pageSize = initPageSize; opts.pageSize = initPageSize;
pager.pagination('refresh', pager.pagination('refresh',
{ {
pageNumber:1, pageNumber: 1,
pageSize:initPageSize pageSize: initPageSize
}); });
} }
}); });
function showFunctionsDetails(pageNo,pageSize) function showFunctionsDetails(pageNo, pageSize) {
{
$.ajax({ $.ajax({
type:"post", type: "post",
url: "<%=path %>/functions/findBy.action", url: "<%=path %>/functions/findBy.action",
dataType: "json", dataType: "json",
data: ({ data: ({
Name:$.trim($("#searchName").val()), Name: $.trim($("#searchName").val()),
Type:$.trim($("#searchType").val()), Type: $.trim($("#searchType").val()),
pageNo:pageNo, pageNo: pageNo,
pageSize:pageSize pageSize: pageSize
}), }),
success: function (data) success: function (data) {
{ $("#tableData").datagrid('loadData', data);
$("#tableData").datagrid('loadData',data);
}, },
//此处添加错误处理 //此处添加错误处理
error:function() error: function () {
{ $.messager.alert('查询提示', '查询数据后台异常,请稍后再试!', 'error');
$.messager.alert('查询提示','查询数据后台异常,请稍后再试!','error');
return; return;
} }
}); });
@@ -565,13 +535,13 @@
//重置按钮 //重置按钮
$("#searchResetBtn").unbind().bind({ $("#searchResetBtn").unbind().bind({
click:function(){ click: function () {
$("#searchName").val(""); $("#searchName").val("");
//加载完以后重新初始化 //加载完以后重新初始化
$("#searchBtn").click(); $("#searchBtn").click();
} }
}); });
</script> </script>
</body> </body>
</html> </html>

View File

@@ -1,15 +1,15 @@
<%@page language="java" contentType="text/html; charset=utf-8" pageEncoding="utf-8"%> <%@page language="java" contentType="text/html; charset=utf-8" pageEncoding="utf-8" %>
<% <%
String path = request.getContextPath(); String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/"; String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + path + "/";
%> %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html> <html>
<head> <head>
<meta http-equiv=Content-Type content="text/html; charset=utf-8"> <meta http-equiv=Content-Type content="text/html; charset=utf-8">
<!-- 指定以IE8的方式来渲染 --> <!-- 指定以IE8的方式来渲染 -->
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE8"/> <meta http-equiv="X-UA-Compatible" content="IE=EmulateIE8"/>
<link rel="shortcut icon" href="<%=path%>/images/favicon.ico" type="image/x-icon" /> <link rel="shortcut icon" href="<%=path%>/images/favicon.ico" type="image/x-icon"/>
<link href="css/admin.css" type="text/css" rel="stylesheet"> <link href="css/admin.css" type="text/css" rel="stylesheet">
<title>首页说明</title> <title>首页说明</title>
<style type="text/css"> <style type="text/css">
@@ -21,7 +21,11 @@ String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.
margin-bottom: 0px; margin-bottom: 0px;
background-color: #EAF2FD; background-color: #EAF2FD;
} }
.STYLE1 {font-size: 12px}
.STYLE1 {
font-size: 12px
}
.STYLE4 { .STYLE4 {
font-size: 12px; font-size: 12px;
color: #1F4A65; color: #1F4A65;
@@ -34,31 +38,38 @@ String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.
text-decoration: none; text-decoration: none;
} }
a:visited { a:visited {
font-size: 12px; font-size: 12px;
color: #06482a; color: #06482a;
text-decoration: none; text-decoration: none;
} }
a:hover { a:hover {
font-size: 12px; font-size: 12px;
color: #FF0000; color: #FF0000;
text-decoration: underline; text-decoration: underline;
} }
a:active { a:active {
font-size: 12px; font-size: 12px;
color: #FF0000; color: #FF0000;
text-decoration: none; text-decoration: none;
} }
.STYLE7 {font-size: 12}
.STYLE7 {
font-size: 12
}
--> -->
</style> </style>
</head> </head>
<body> <body>
<table cellSpacing=0 cellPadding=0 width="100%" align=center border=0> <table cellSpacing=0 cellPadding=0 width="100%" align=center border=0>
<tr height=28> <tr height=28>
<td width="1101" class="STYLE4"> <td width="1101" class="STYLE4">
&nbsp;&nbsp;<img src="<%=path%>/images/preferences1.png" width="16" height="16" /> &nbsp;&nbsp;<img src="<%=path%>/images/preferences1.png" width="16" height="16"/>
<span >系统管理</span> <span>系统管理</span>
</td> </td>
</tr> </tr>
<tr> <tr>
@@ -67,10 +78,10 @@ String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.
<tr height="5px"> <tr height="5px">
<td background=images/shadow_bg.jpg></td> <td background=images/shadow_bg.jpg></td>
</tr> </tr>
</table> </table>
<p style="font-size: 12px;color: #1F4A65;padding: 10px"> <p style="font-size: 12px;color: #1F4A65;padding: 10px">
&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;
系统管理是管理系统中的基础数据设置信息,包括供应商、资产类型、资产名称、用户管理等,通过系统管理,可以为系统提供基础数据支持。日志管理主要包括供应商、资产类型、资产名称、用户管理等的增删改查等功能点。 系统管理是管理系统中的基础数据设置信息,包括供应商、资产类型、资产名称、用户管理等,通过系统管理,可以为系统提供基础数据支持。日志管理主要包括供应商、资产类型、资产名称、用户管理等的增删改查等功能点。
</p> </p>
</body> </body>
</html> </html>

View File

@@ -1,30 +1,31 @@
<%@page import="com.jsh.util.Tools"%> <%@page import="com.jsh.util.Tools" %>
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%> <%@ page language="java" pageEncoding="utf-8" %>
<% <%
String path = request.getContextPath(); String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/"; String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + path + "/";
String clientIp = Tools.getLocalIp(request); String clientIp = Tools.getLocalIp(request);
%> %>
<!DOCTYPE html> <!DOCTYPE html>
<html> <html>
<head> <head>
<title>收支项目</title> <title>收支项目</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<!-- 指定以IE8的方式来渲染 --> <!-- 指定以IE8的方式来渲染 -->
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE8"/> <meta http-equiv="X-UA-Compatible" content="IE=EmulateIE8"/>
<link rel="shortcut icon" href="<%=path%>/images/favicon.ico" type="image/x-icon" /> <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/default/easyui.css"/>
<link rel="stylesheet" type="text/css" href="<%=path %>/js/easyui-1.3.5/themes/icon.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" /> <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/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/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/locale/easyui-lang-zh_CN.js"></script>
<script type="text/javascript" src="<%=path %>/js/common/common.js"></script> <script type="text/javascript" src="<%=path %>/js/common/common.js"></script>
</head> </head>
<body> <body>
<!-- 查询 --> <!-- 查询 -->
<div id = "searchPanel" class="easyui-panel" style="padding:10px;" title="查询窗口" iconCls="icon-search" collapsible="true" closable="false"> <div id="searchPanel" class="easyui-panel" style="padding:10px;" title="查询窗口" iconCls="icon-search" collapsible="true"
closable="false">
<table id="searchTable"> <table id="searchTable">
<tr> <tr>
<td>名&nbsp;&nbsp;&nbsp;&nbsp;称:</td> <td>名&nbsp;&nbsp;&nbsp;&nbsp;称:</td>
@@ -56,18 +57,20 @@
</td> </td>
</tr> </tr>
</table> </table>
</div> </div>
<!-- 数据显示table --> <!-- 数据显示table -->
<div id = "tablePanel" class="easyui-panel" style="padding:1px;top:300px;" title="收支项目" iconCls="icon-list" collapsible="true" closable="false"> <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> <table id="tableData" style="top:300px;border-bottom-color:#FFFFFF"></table>
</div> </div>
<div id="inOutItemDlg" class="easyui-dialog" style="width:380px;padding:10px 20px" <div id="inOutItemDlg" class="easyui-dialog" style="width:380px;padding:10px 20px"
closed="true" buttons="#dlg-buttons" modal="true" collapsible="false" closable="true"> closed="true" buttons="#dlg-buttons" modal="true" collapsible="false" closable="true">
<form id="inOutItemFM" method="post" novalidate> <form id="inOutItemFM" method="post" novalidate>
<div class="fitem" style="padding:5px"> <div class="fitem" style="padding:5px">
<label id="nameLabel">名&nbsp;&nbsp;&nbsp;&nbsp;称</label> <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"/> <input name="name" id="name" class="easyui-validatebox"
data-options="required:true,validType:'length[2,30]'" style="width: 230px;height: 20px"/>
</div> </div>
<div class="fitem" style="padding:5px"> <div class="fitem" style="padding:5px">
<label id="typeLabel">类&nbsp;&nbsp;&nbsp;&nbsp;型</label> <label id="typeLabel">类&nbsp;&nbsp;&nbsp;&nbsp;型</label>
@@ -82,34 +85,31 @@
</div> </div>
<input type="hidden" name="clientIp" id="clientIp" value="<%=clientIp %>"/> <input type="hidden" name="clientIp" id="clientIp" value="<%=clientIp %>"/>
</form> </form>
</div> </div>
<div id="dlg-buttons"> <div id="dlg-buttons">
<a href="javascript:void(0)" id="saveInOutItem" class="easyui-linkbutton" iconCls="icon-ok">保存</a> <a href="javascript:void(0)" id="saveInOutItem" class="easyui-linkbutton" iconCls="icon-ok">保存</a>
<a href="javascript:void(0)" id="cancelInOutItem" class="easyui-linkbutton" iconCls="icon-cancel" onclick="javascript:$('#inOutItemDlg').dialog('close')">取消</a> <a href="javascript:void(0)" id="cancelInOutItem" class="easyui-linkbutton" iconCls="icon-cancel"
</div> onclick="javascript:$('#inOutItemDlg').dialog('close')">取消</a>
</div>
<script type="text/javascript"> <script type="text/javascript">
//初始化界面 //初始化界面
$(function() $(function () {
{
initTableData(); initTableData();
ininPager(); ininPager();
browserFit(); browserFit();
}); });
//浏览器适配 //浏览器适配
function browserFit() function browserFit() {
{ if (getOs() == 'MSIE') {
if(getOs()=='MSIE')
{
$("#searchTypeLabel").empty().append("类&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;型:"); $("#searchTypeLabel").empty().append("类&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;型:");
$("#searchRemarkLabel").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;称"); $("#nameLabel").empty().append("名&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;称");
$("#typeLabel").empty().append("类&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;型"); $("#typeLabel").empty().append("类&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;型");
$("#remarkLabel").empty().append("备&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;注"); $("#remarkLabel").empty().append("备&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;注");
} }
else else {
{
$("#searchTypeLabel").empty().append("类&nbsp;&nbsp;&nbsp;&nbsp;型:"); $("#searchTypeLabel").empty().append("类&nbsp;&nbsp;&nbsp;&nbsp;型:");
$("#searchRemarkLabel").empty().append("备&nbsp;&nbsp;&nbsp;&nbsp;注:"); $("#searchRemarkLabel").empty().append("备&nbsp;&nbsp;&nbsp;&nbsp;注:");
$("#nameLabel").empty().append("名&nbsp;&nbsp;&nbsp;&nbsp;称"); $("#nameLabel").empty().append("名&nbsp;&nbsp;&nbsp;&nbsp;称");
@@ -119,44 +119,42 @@
} }
//初始化表格数据 //初始化表格数据
function initTableData() function initTableData() {
{
$('#tableData').datagrid({ $('#tableData').datagrid({
//title:'收支项目', //title:'收支项目',
//iconCls:'icon-save', //iconCls:'icon-save',
//width:700, //width:700,
height:heightInfo, height: heightInfo,
nowrap: false, nowrap: false,
rownumbers: false, rownumbers: false,
//动画效果 //动画效果
animate:false, animate: false,
//选中单行 //选中单行
singleSelect : true, singleSelect: true,
collapsible:false, collapsible: false,
selectOnCheck:false, selectOnCheck: false,
//fitColumns:true, //fitColumns:true,
//单击行是否选中 //单击行是否选中
checkOnSelect : false, checkOnSelect: false,
//交替出现背景 //交替出现背景
striped : true, striped: true,
url:'<%=path %>/inOutItem/findBy.action?pageSize=' + initPageSize, url: '<%=path %>/inOutItem/findBy.action?pageSize=' + initPageSize,
pagination: true, pagination: true,
//自动截取数据 //自动截取数据
//nowrap : true, //nowrap : true,
//loadFilter: pagerFilter, //loadFilter: pagerFilter,
pageSize: initPageSize, pageSize: initPageSize,
pageList: initPageNum, pageList: initPageNum,
columns:[[ columns: [[
{ field: 'id',width:35,align:"center",checkbox:true}, {field: 'id', width: 35, align: "center", checkbox: true},
{ title: '名称',field: 'name',width:200}, {title: '名称', field: 'name', width: 200},
{ title: '类型', field: 'type',width:100,align:"center"}, {title: '类型', field: 'type', width: 100, align: "center"},
{ title: '描述',field: 'remark',width:200}, {title: '描述', field: 'remark', width: 200},
{ title: '操作',field: 'op',align:"center",width:130,formatter:function(value,rec)
{ {
title: '操作', field: 'op', align: "center", width: 130, formatter: function (value, rec) {
var str = ''; var str = '';
var rowInfo = rec.id + 'AaBb' + rec.name +'AaBb' + rec.type + 'AaBb'+ rec.remark; var rowInfo = rec.id + 'AaBb' + rec.name + 'AaBb' + rec.type + 'AaBb' + rec.remark;
if(1 == value) if (1 == value) {
{
str += '<img src="<%=path%>/js/easyui-1.3.5/themes/icons/pencil.png" style="cursor: pointer;" onclick="editInOutItem(\'' + rowInfo + '\');"/>&nbsp;<a onclick="editInOutItem(\'' + 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/pencil.png" style="cursor: pointer;" onclick="editInOutItem(\'' + rowInfo + '\');"/>&nbsp;<a onclick="editInOutItem(\'' + 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="deleteInOutItem(\'' + rowInfo + '\');"/>&nbsp;<a onclick="deleteInOutItem(\'' + 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="deleteInOutItem(\'' + rowInfo + '\');"/>&nbsp;<a onclick="deleteInOutItem(\'' + rowInfo + '\');" style="text-decoration:none;color:black;" href="javascript:void(0)">删除</a>&nbsp;&nbsp;';
} }
@@ -164,111 +162,97 @@
} }
} }
]], ]],
toolbar:[ toolbar: [
{
id:'addInOutItem',
text:'增加',
iconCls:'icon-add',
handler:function()
{ {
id: 'addInOutItem',
text: '增加',
iconCls: 'icon-add',
handler: function () {
addInOutItem(); addInOutItem();
} }
}, },
{ {
id:'deleteInOutItem', id: 'deleteInOutItem',
text:'删除', text: '删除',
iconCls:'icon-remove', iconCls: 'icon-remove',
handler:function() handler: function () {
{
batDeleteInOutItem(); batDeleteInOutItem();
} }
} }
], ],
onLoadError:function() onLoadError: function () {
{ $.messager.alert('页面加载提示', '页面加载异常,请稍后再试!', 'error');
$.messager.alert('页面加载提示','页面加载异常,请稍后再试!','error');
return; return;
} }
}); });
} }
//初始化键盘enter事件 //初始化键盘enter事件
$(document).keydown(function(event) $(document).keydown(function (event) {
{
//兼容 IE和firefox 事件 //兼容 IE和firefox 事件
var e = window.event || event; var e = window.event || event;
var k = e.keyCode||e.which||e.charCode; var k = e.keyCode || e.which || e.charCode;
//兼容 IE,firefox 兼容 //兼容 IE,firefox 兼容
var obj = e.srcElement ? e.srcElement : e.target; var obj = e.srcElement ? e.srcElement : e.target;
//绑定键盘事件为 id是指定的输入框才可以触发键盘事件 13键盘事件 //绑定键盘事件为 id是指定的输入框才可以触发键盘事件 13键盘事件
if(k == "13"&&(obj.id=="name" || obj.id=="remark")) if (k == "13" && (obj.id == "name" || obj.id == "remark")) {
{
$("#saveInOutItem").click(); $("#saveInOutItem").click();
} }
//搜索按钮添加快捷键 //搜索按钮添加快捷键
if(k == "13"&&(obj.id=="searchName" || obj.id=="searchRemark")) if (k == "13" && (obj.id == "searchName" || obj.id == "searchRemark")) {
{
$("#searchBtn").click(); $("#searchBtn").click();
} }
}); });
//分页信息处理 //分页信息处理
function ininPager() function ininPager() {
{ try {
try
{
var opts = $("#tableData").datagrid('options'); var opts = $("#tableData").datagrid('options');
var pager = $("#tableData").datagrid('getPager'); var pager = $("#tableData").datagrid('getPager');
pager.pagination({ pager.pagination({
onSelectPage:function(pageNum, pageSize) onSelectPage: function (pageNum, pageSize) {
{
opts.pageNumber = pageNum; opts.pageNumber = pageNum;
opts.pageSize = pageSize; opts.pageSize = pageSize;
pager.pagination('refresh', pager.pagination('refresh',
{ {
pageNumber:pageNum, pageNumber: pageNum,
pageSize:pageSize pageSize: pageSize
}); });
showInOutItemDetails(pageNum,pageSize); showInOutItemDetails(pageNum, pageSize);
} }
}); });
} }
catch (e) catch (e) {
{ $.messager.alert('异常处理提示', "分页信息异常 : " + e.name + ": " + e.message, 'error');
$.messager.alert('异常处理提示',"分页信息异常 : " + e.name + ": " + e.message,'error');
} }
} }
//删除收支项目 //删除收支项目
function deleteInOutItem(inOutItemInfo) function deleteInOutItem(inOutItemInfo) {
{ $.messager.confirm('删除确认', '确定要删除此收支项目吗?', function (r) {
$.messager.confirm('删除确认','确定要删除此收支项目吗?',function(r) if (r) {
{
if (r)
{
var inOutItemTotalInfo = inOutItemInfo.split("AaBb"); var inOutItemTotalInfo = inOutItemInfo.split("AaBb");
$.ajax({ $.ajax({
type:"post", type: "post",
url: "<%=path %>/inOutItem/delete.action", url: "<%=path %>/inOutItem/delete.action",
dataType: "json", dataType: "json",
data: ({ data: ({
inOutItemID : inOutItemTotalInfo[0], inOutItemID: inOutItemTotalInfo[0],
name:inOutItemTotalInfo[1], name: inOutItemTotalInfo[1],
clientIp:'<%=clientIp %>' clientIp: '<%=clientIp %>'
}), }),
success: function (tipInfo) success: function (tipInfo) {
{
var msg = tipInfo.showModel.msgTip; var msg = tipInfo.showModel.msgTip;
if(msg == '成功') if (msg == '成功')
//加载完以后重新初始化 //加载完以后重新初始化
$("#searchBtn").click(); $("#searchBtn").click();
else else
$.messager.alert('删除提示','删除收支项目失败,请稍后再试!','error'); $.messager.alert('删除提示', '删除收支项目失败,请稍后再试!', 'error');
}, },
//此处添加错误处理 //此处添加错误处理
error:function() error: function () {
{ $.messager.alert('删除提示', '删除收支项目异常,请稍后再试!', 'error');
$.messager.alert('删除提示','删除收支项目异常,请稍后再试!','error');
return; return;
} }
}); });
@@ -277,55 +261,45 @@
} }
//批量删除收支项目 //批量删除收支项目
function batDeleteInOutItem() function batDeleteInOutItem() {
{
var row = $('#tableData').datagrid('getChecked'); var row = $('#tableData').datagrid('getChecked');
if(row.length == 0) if (row.length == 0) {
{ $.messager.alert('删除提示', '没有记录被选中!', 'info');
$.messager.alert('删除提示','没有记录被选中!','info');
return; return;
} }
if(row.length > 0) if (row.length > 0) {
{ $.messager.confirm('删除确认', '确定要删除选中的' + row.length + '条收支项目吗?', function (r) {
$.messager.confirm('删除确认','确定要删除选中的' + row.length + '条收支项目吗?',function(r) if (r) {
{
if (r)
{
var ids = ""; var ids = "";
for(var i = 0;i < row.length; i ++) for (var i = 0; i < row.length; i++) {
{ if (i == row.length - 1) {
if(i == row.length-1)
{
ids += row[i].id; ids += row[i].id;
break; break;
} }
ids += row[i].id + ","; ids += row[i].id + ",";
} }
$.ajax({ $.ajax({
type:"post", type: "post",
url: "<%=path %>/inOutItem/batchDelete.action", url: "<%=path %>/inOutItem/batchDelete.action",
dataType: "json", dataType: "json",
async : false, async: false,
data: ({ data: ({
inOutItemIDs : ids, inOutItemIDs: ids,
clientIp:'<%=clientIp %>' clientIp: '<%=clientIp %>'
}), }),
success: function (tipInfo) success: function (tipInfo) {
{
var msg = tipInfo.showModel.msgTip; var msg = tipInfo.showModel.msgTip;
if(msg == '成功') if (msg == '成功') {
{
//加载完以后重新初始化 //加载完以后重新初始化
$("#searchBtn").click(); $("#searchBtn").click();
$(":checkbox").attr("checked",false); $(":checkbox").attr("checked", false);
} }
else else
$.messager.alert('删除提示','删除收支项目失败,请稍后再试!','error'); $.messager.alert('删除提示', '删除收支项目失败,请稍后再试!', 'error');
}, },
//此处添加错误处理 //此处添加错误处理
error:function() error: function () {
{ $.messager.alert('删除提示', '删除收支项目异常,请稍后再试!', 'error');
$.messager.alert('删除提示','删除收支项目异常,请稍后再试!','error');
return; return;
} }
}); });
@@ -340,16 +314,15 @@
//保存编辑前的名称 //保存编辑前的名称
var orgInOutItem = ""; var orgInOutItem = "";
function addInOutItem() function addInOutItem() {
{ $('#inOutItemDlg').dialog('open').dialog('setTitle', '<img src="<%=path%>/js/easyui-1.3.5/themes/icons/edit_add.png"/>&nbsp;增加收支项目');
$('#inOutItemDlg').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});
$(".window-mask").css({ width: webW ,height: webH});
$('#inOutItemFM').form('clear'); $('#inOutItemFM').form('clear');
var row = { var row = {
clientIp:'<%=clientIp %>' clientIp: '<%=clientIp %>'
}; };
$('#inOutItemFM').form('load',row); $('#inOutItemFM').form('load', row);
$("#inOutItem").focus(); $("#inOutItem").focus();
orgInOutItem = ""; orgInOutItem = "";
@@ -359,38 +332,33 @@
//保存收支项目 //保存收支项目
$("#saveInOutItem").unbind().bind({ $("#saveInOutItem").unbind().bind({
click:function() click: function () {
{ if (checkInOutItemName())
if(checkInOutItemName())
return; return;
if(!$("#type").val()){ if (!$("#type").val()) {
$.messager.alert('提示','请选择类型!','warning'); $.messager.alert('提示', '请选择类型!', 'warning');
return; return;
} }
$('#inOutItemFM').form('submit',{ $('#inOutItemFM').form('submit', {
url: url, url: url,
onSubmit: function() onSubmit: function () {
{
return $(this).form('validate'); return $(this).form('validate');
}, },
success: function(result) success: function (result) {
{ var result = eval('(' + result + ')');
var result = eval('('+result+')'); if (!result) {
if (!result)
{
$.messager.show({ $.messager.show({
title: '错误提示', title: '错误提示',
msg: '保存收支项目失败,请稍后重试!' msg: '保存收支项目失败,请稍后重试!'
}); });
} }
else else {
{
$('#inOutItemDlg').dialog('close'); $('#inOutItemDlg').dialog('close');
//$('#tableData').datagrid('reload'); //$('#tableData').datagrid('reload');
//加载完以后重新初始化 //加载完以后重新初始化
//$("#searchBtn").click(); //$("#searchBtn").click();
var opts = $("#tableData").datagrid('options'); var opts = $("#tableData").datagrid('options');
showInOutItemDetails(opts.pageNumber,opts.pageSize); showInOutItemDetails(opts.pageNumber, opts.pageSize);
} }
} }
}); });
@@ -398,19 +366,18 @@
}); });
//编辑收支项目 //编辑收支项目
function editInOutItem(inOutItemTotalInfo) function editInOutItem(inOutItemTotalInfo) {
{
var inOutItemInfo = inOutItemTotalInfo.split("AaBb"); var inOutItemInfo = inOutItemTotalInfo.split("AaBb");
var row = { var row = {
name : inOutItemInfo[1], name: inOutItemInfo[1],
type : inOutItemInfo[2], type: inOutItemInfo[2],
remark : inOutItemInfo[3], remark: inOutItemInfo[3],
clientIp:'<%=clientIp %>' clientIp: '<%=clientIp %>'
}; };
orgInOutItem = inOutItemInfo[1]; orgInOutItem = inOutItemInfo[1];
$('#inOutItemDlg').dialog('open').dialog('setTitle','<img src="<%=path%>/js/easyui-1.3.5/themes/icons/pencil.png"/>&nbsp;编辑收支项目'); $('#inOutItemDlg').dialog('open').dialog('setTitle', '<img src="<%=path%>/js/easyui-1.3.5/themes/icons/pencil.png"/>&nbsp;编辑收支项目');
$(".window-mask").css({ width: webW ,height: webH}); $(".window-mask").css({width: webW, height: webH});
$('#inOutItemFM').form('load',row); $('#inOutItemFM').form('load', row);
inOutItemID = inOutItemInfo[0]; inOutItemID = inOutItemInfo[0];
//焦点在名称输入框==定焦在输入文字后面 //焦点在名称输入框==定焦在输入文字后面
$("#inOutItem").val("").focus().val(inOutItemInfo[1]); $("#inOutItem").val("").focus().val(inOutItemInfo[1]);
@@ -418,36 +385,31 @@
} }
//检查收支项目 名称是否存在 ++ 重名无法提示问题需要跟进 //检查收支项目 名称是否存在 ++ 重名无法提示问题需要跟进
function checkInOutItemName() function checkInOutItemName() {
{
var inOutItemName = $.trim($("#name").val()); var inOutItemName = $.trim($("#name").val());
//表示是否存在 true == 存在 false = 不存在 //表示是否存在 true == 存在 false = 不存在
var flag = false; var flag = false;
//开始ajax名称检验不能重名 //开始ajax名称检验不能重名
if(inOutItemName.length > 0 &&( orgInOutItem.length ==0 || inOutItemName != orgInOutItem)) if (inOutItemName.length > 0 && (orgInOutItem.length == 0 || inOutItemName != orgInOutItem)) {
{
$.ajax({ $.ajax({
type:"post", type: "post",
url: "<%=path %>/inOutItem/checkIsNameExist.action", url: "<%=path %>/inOutItem/checkIsNameExist.action",
dataType: "json", dataType: "json",
async : false, async: false,
data: ({ data: ({
inOutItemID : inOutItemID, inOutItemID: inOutItemID,
name : inOutItemName name: inOutItemName
}), }),
success: function (tipInfo) success: function (tipInfo) {
{
flag = tipInfo; flag = tipInfo;
if(tipInfo) if (tipInfo) {
{ $.messager.alert('提示', '收支项目名称已经存在', 'info');
$.messager.alert('提示','收支项目名称已经存在','info');
return; return;
} }
}, },
//此处添加错误处理 //此处添加错误处理
error:function() error: function () {
{ $.messager.alert('提示', '检查收支项目名称是否存在异常,请稍后再试!', 'error');
$.messager.alert('提示','检查收支项目名称是否存在异常,请稍后再试!','error');
return; return;
} }
}); });
@@ -457,42 +419,38 @@
//搜索处理 //搜索处理
$("#searchBtn").unbind().bind({ $("#searchBtn").unbind().bind({
click:function() click: function () {
{ showInOutItemDetails(1, initPageSize);
showInOutItemDetails(1,initPageSize);
var opts = $("#tableData").datagrid('options'); var opts = $("#tableData").datagrid('options');
var pager = $("#tableData").datagrid('getPager'); var pager = $("#tableData").datagrid('getPager');
opts.pageNumber = 1; opts.pageNumber = 1;
opts.pageSize = initPageSize; opts.pageSize = initPageSize;
pager.pagination('refresh', pager.pagination('refresh',
{ {
pageNumber:1, pageNumber: 1,
pageSize:initPageSize pageSize: initPageSize
}); });
} }
}); });
function showInOutItemDetails(pageNo,pageSize) function showInOutItemDetails(pageNo, pageSize) {
{
$.ajax({ $.ajax({
type:"post", type: "post",
url: "<%=path %>/inOutItem/findBy.action", url: "<%=path %>/inOutItem/findBy.action",
dataType: "json", dataType: "json",
data: ({ data: ({
name:$.trim($("#searchName").val()), name: $.trim($("#searchName").val()),
type:$.trim($("#searchType").val()), type: $.trim($("#searchType").val()),
remark:$.trim($("#searchRemark").val()), remark: $.trim($("#searchRemark").val()),
pageNo:pageNo, pageNo: pageNo,
pageSize:pageSize pageSize: pageSize
}), }),
success: function (data) success: function (data) {
{ $("#tableData").datagrid('loadData', data);
$("#tableData").datagrid('loadData',data);
}, },
//此处添加错误处理 //此处添加错误处理
error:function() error: function () {
{ $.messager.alert('查询提示', '查询数据后台异常,请稍后再试!', 'error');
$.messager.alert('查询提示','查询数据后台异常,请稍后再试!','error');
return; return;
} }
}); });
@@ -500,7 +458,7 @@
//重置按钮 //重置按钮
$("#searchResetBtn").unbind().bind({ $("#searchResetBtn").unbind().bind({
click:function(){ click: function () {
$("#searchName").val(""); $("#searchName").val("");
$("#searchType").val(""); $("#searchType").val("");
$("#searchRemark").val(""); $("#searchRemark").val("");
@@ -508,6 +466,6 @@
$("#searchBtn").click(); $("#searchBtn").click();
} }
}); });
</script> </script>
</body> </body>
</html> </html>

View File

@@ -1,29 +1,30 @@
<%@page import="com.jsh.util.Tools"%> <%@page import="com.jsh.util.Tools" %>
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%> <%@ page language="java" pageEncoding="utf-8" %>
<% <%
String path = request.getContextPath(); String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/"; String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + path + "/";
String clientIp = Tools.getLocalIp(request); String clientIp = Tools.getLocalIp(request);
%> %>
<!DOCTYPE html> <!DOCTYPE html>
<html> <html>
<head> <head>
<title>资产管理</title> <title>资产管理</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<!-- 指定以IE8的方式来渲染 --> <!-- 指定以IE8的方式来渲染 -->
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE8"/> <meta http-equiv="X-UA-Compatible" content="IE=EmulateIE8"/>
<link rel="shortcut icon" href="<%=path%>/images/favicon.ico" type="image/x-icon" /> <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/default/easyui.css"/>
<link rel="stylesheet" type="text/css" href="<%=path %>/js/easyui-1.3.5/themes/icon.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" /> <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/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/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/locale/easyui-lang-zh_CN.js"></script>
<script type="text/javascript" src="<%=path %>/js/common/common.js"></script> <script type="text/javascript" src="<%=path %>/js/common/common.js"></script>
</head> </head>
<body> <body>
<!-- 查询 --> <!-- 查询 -->
<div id = "searchPanel" class="easyui-panel" style="padding:10px;position: center;" title="查询窗口" iconCls="icon-search" collapsible="true" closable="false"> <div id="searchPanel" class="easyui-panel" style="padding:10px;position: center;" title="查询窗口" iconCls="icon-search"
collapsible="true" closable="false">
<table id="searchTable"> <table id="searchTable">
<tr> <tr>
<td>操作模块:</td> <td>操作模块:</td>
@@ -35,7 +36,7 @@
<td>&nbsp;</td> <td>&nbsp;</td>
<td>操作人员:</td> <td>操作人员:</td>
<td> <td>
<select name="searchUsernameID" id="searchUsernameID" style="width:90px;" /> <select name="searchUsernameID" id="searchUsernameID" style="width:90px;"/>
</td> </td>
<td>&nbsp;</td> <td>&nbsp;</td>
<td>&nbsp;</td> <td>&nbsp;</td>
@@ -57,7 +58,8 @@
<tr> <tr>
<td>开始时间:</td> <td>开始时间:</td>
<td> <td>
<input type="text" name="searchBeginTime" id="searchBeginTime" class="easyui-datebox" style="width:90px;"/> <input type="text" name="searchBeginTime" id="searchBeginTime" class="easyui-datebox"
style="width:90px;"/>
</td> </td>
<td>&nbsp;</td> <td>&nbsp;</td>
<td>&nbsp;</td> <td>&nbsp;</td>
@@ -78,17 +80,17 @@
</td> </td>
</tr> </tr>
</table> </table>
</div> </div>
<!-- 数据显示table --> <!-- 数据显示table -->
<div id = "tablePanel" class="easyui-panel" style="padding:1px;top:300px;" title="操作日志列表" iconCls="icon-list" collapsible="true" closable="false"> <div id="tablePanel" class="easyui-panel" style="padding:1px;top:300px;" title="操作日志列表" iconCls="icon-list"
collapsible="true" closable="false">
<table id="tableData" style="height:340px;top:300px;border-bottom-color:#FFFFFF"></table> <table id="tableData" style="height:340px;top:300px;border-bottom-color:#FFFFFF"></table>
</div> </div>
<script type="text/javascript"> <script type="text/javascript">
var userList = null; var userList = null;
//初始化界面 //初始化界面
$(function() $(function () {
{
initTableData(); initTableData();
ininPager(); ininPager();
//初始化系统基础信息 //初始化系统基础信息
@@ -98,110 +100,100 @@
}); });
//初始化表格数据 //初始化表格数据
function initTableData() function initTableData() {
{
$('#tableData').datagrid({ $('#tableData').datagrid({
//title:'供应商列表', //title:'供应商列表',
//iconCls:'icon-save', //iconCls:'icon-save',
//width:700, //width:700,
height:heightInfo, height: heightInfo,
nowrap: false, nowrap: false,
rownumbers: true, rownumbers: true,
//动画效果 //动画效果
animate:false, animate: false,
//选中单行 //选中单行
singleSelect : true, singleSelect: true,
collapsible:false, collapsible: false,
selectOnCheck:false, selectOnCheck: false,
//fitColumns:true, //fitColumns:true,
//单击行是否选中 //单击行是否选中
checkOnSelect : false, checkOnSelect: false,
//交替出现背景 //交替出现背景
striped : true, striped: true,
url:'<%=path %>/log/findBy.action?pageSize=' + initPageSize, url: '<%=path %>/log/findBy.action?pageSize=' + initPageSize,
pagination: true, pagination: true,
//loadFilter: pagerFilter, //loadFilter: pagerFilter,
pageSize: initPageSize, pageSize: initPageSize,
pageList: initPageNum, pageList: initPageNum,
columns:[[ columns: [[
{ title: '操作模块',field: 'operation',width:120}, {title: '操作模块', field: 'operation', width: 120},
{ title: '操作人员', field: 'username',width:100,align:"center"}, {title: '操作人员', field: 'username', width: 100, align: "center"},
{ title: '操作IP', field: 'clientIP',width:90,align:"center"}, {title: '操作IP', field: 'clientIP', width: 90, align: "center"},
{ title: '操作时间',field: 'createTime',width:150,align:"center"}, {title: '操作时间', field: 'createTime', width: 150, align: "center"},
{ title: '操作详情',field: 'details',width:380}, {title: '操作详情', field: 'details', width: 380},
{ title: '操作状态',field: 'status',width:70}, {title: '操作状态', field: 'status', width: 70},
{ title: '备注',field: 'remark',width:180} {title: '备注', field: 'remark', width: 180}
]], ]],
onLoadError:function() onLoadError: function () {
{ $.messager.alert('页面加载提示', '页面加载异常,请稍后再试!', 'error');
$.messager.alert('页面加载提示','页面加载异常,请稍后再试!','error');
return; return;
} }
}); });
} }
//初始化键盘enter事件 //初始化键盘enter事件
$(document).keydown(function(event) $(document).keydown(function (event) {
{
//兼容 IE和firefox 事件 //兼容 IE和firefox 事件
var e = window.event || event; var e = window.event || event;
var k = e.keyCode||e.which||e.charCode; var k = e.keyCode || e.which || e.charCode;
//兼容 IE,firefox 兼容 //兼容 IE,firefox 兼容
var obj = e.srcElement ? e.srcElement : e.target; var obj = e.srcElement ? e.srcElement : e.target;
//绑定键盘事件为 id是指定的输入框才可以触发键盘事件 13键盘事件 //绑定键盘事件为 id是指定的输入框才可以触发键盘事件 13键盘事件
//搜索按钮添加快捷键 //搜索按钮添加快捷键
if(k == "13"&&(obj.id=="searchOperation" || obj.id=="searchUsernameID"|| obj.id=="searchIP" if (k == "13" && (obj.id == "searchOperation" || obj.id == "searchUsernameID" || obj.id == "searchIP"
|| obj.id=="searchStatus" || obj.id=="searchBeginTime" || obj.id=="searchEndTime" || obj.id == "searchStatus" || obj.id == "searchBeginTime" || obj.id == "searchEndTime"
|| obj.id=="searchDesc")) || obj.id == "searchDesc")) {
{
$("#searchBtn").click(); $("#searchBtn").click();
} }
}); });
//分页信息处理 //分页信息处理
function ininPager() function ininPager() {
{ try {
try
{
var opts = $("#tableData").datagrid('options'); var opts = $("#tableData").datagrid('options');
var pager = $("#tableData").datagrid('getPager'); var pager = $("#tableData").datagrid('getPager');
pager.pagination({ pager.pagination({
onSelectPage:function(pageNum, pageSize) onSelectPage: function (pageNum, pageSize) {
{
opts.pageNumber = pageNum; opts.pageNumber = pageNum;
opts.pageSize = pageSize; opts.pageSize = pageSize;
pager.pagination('refresh', pager.pagination('refresh',
{ {
pageNumber:pageNum, pageNumber: pageNum,
pageSize:pageSize pageSize: pageSize
}); });
showLogDetails(pageNum,pageSize); showLogDetails(pageNum, pageSize);
} }
}); });
} }
catch (e) catch (e) {
{ $.messager.alert('异常处理提示', "分页信息异常 : " + e.name + ": " + e.message, 'error');
$.messager.alert('异常处理提示',"分页信息异常 : " + e.name + ": " + e.message,'error');
} }
} }
//初始化系统基础信息 //初始化系统基础信息
function initSystemData() function initSystemData() {
{
$.ajax({ $.ajax({
type:"post", type: "post",
url: "<%=path%>/log/getBasicData.action", url: "<%=path%>/log/getBasicData.action",
//设置为同步 //设置为同步
async:false, async: false,
dataType: "json", dataType: "json",
success: function (systemInfo) success: function (systemInfo) {
{
//成功关闭loading //成功关闭loading
userList = systemInfo.showModel.map.userList; userList = systemInfo.showModel.map.userList;
var msgTip = systemInfo.showModel.msgTip; var msgTip = systemInfo.showModel.msgTip;
if(msgTip == "exceptoin") if (msgTip == "exceptoin") {
{ $.messager.alert('提示', '查找系统基础信息异常,请与管理员联系!', 'error');
$.messager.alert('提示','查找系统基础信息异常,请与管理员联系!','error');
return; return;
} }
} }
@@ -209,18 +201,14 @@
} }
//初始化页面选项卡 //初始化页面选项卡
function initSelectInfo() function initSelectInfo() {
{
var options = ""; var options = "";
if(userList !=null) if (userList != null) {
{
options = ""; options = "";
for(var i = 0 ;i < userList.length;i ++) for (var i = 0; i < userList.length; i++) {
{
var user = userList[i]; var user = userList[i];
if(0 == i) if (0 == i) {
{
userID = user.id userID = user.id
} }
options += '<option value="' + user.id + '">' + user.username + '</option>'; options += '<option value="' + user.id + '">' + user.username + '</option>';
@@ -231,47 +219,43 @@
//搜索处理 //搜索处理
$("#searchBtn").unbind().bind({ $("#searchBtn").unbind().bind({
click:function() click: function () {
{ showLogDetails(1, initPageSize);
showLogDetails(1,initPageSize);
var opts = $("#tableData").datagrid('options'); var opts = $("#tableData").datagrid('options');
var pager = $("#tableData").datagrid('getPager'); var pager = $("#tableData").datagrid('getPager');
opts.pageNumber = 1; opts.pageNumber = 1;
opts.pageSize = initPageSize; opts.pageSize = initPageSize;
pager.pagination('refresh', pager.pagination('refresh',
{ {
pageNumber:1, pageNumber: 1,
pageSize:initPageSize pageSize: initPageSize
}); });
} }
}); });
function showLogDetails(pageNo,pageSize) function showLogDetails(pageNo, pageSize) {
{
$.ajax({ $.ajax({
type:"post", type: "post",
url: "<%=path %>/log/findBy.action", url: "<%=path %>/log/findBy.action",
dataType: "json", dataType: "json",
data: ({ data: ({
operation:$.trim($("#searchOperation").val()), operation: $.trim($("#searchOperation").val()),
usernameID:$.trim($("#searchUsernameID").val()), usernameID: $.trim($("#searchUsernameID").val()),
clientIp:$.trim($("#searchIP").val()), clientIp: $.trim($("#searchIP").val()),
status:$.trim($("#searchStatus").val()), status: $.trim($("#searchStatus").val()),
beginTime:$.trim($("#searchBeginTime").datebox("getValue")), beginTime: $.trim($("#searchBeginTime").datebox("getValue")),
endTime:$.trim($("#searchEndTime").datebox("getValue")), endTime: $.trim($("#searchEndTime").datebox("getValue")),
contentdetails:$.trim($("#searchDesc").val()), contentdetails: $.trim($("#searchDesc").val()),
pageNo:pageNo, pageNo: pageNo,
pageSize:pageSize pageSize: pageSize
}), }),
success: function (data) success: function (data) {
{ $("#tableData").datagrid('loadData', data);
$("#tableData").datagrid('loadData',data);
//$('#tableData').datagrid('reload'); //$('#tableData').datagrid('reload');
}, },
//此处添加错误处理 //此处添加错误处理
error:function() error: function () {
{ $.messager.alert('查询提示', '查询数据后台异常,请稍后再试!', 'error');
$.messager.alert('查询提示','查询数据后台异常,请稍后再试!','error');
return; return;
} }
}); });
@@ -279,8 +263,7 @@
//重置按钮 //重置按钮
$("#searchResetBtn").unbind().bind({ $("#searchResetBtn").unbind().bind({
click:function() click: function () {
{
$("#searchOperation").val(""); $("#searchOperation").val("");
$("#searchUsernameID").val(""); $("#searchUsernameID").val("");
$("#searchIP").val(""); $("#searchIP").val("");
@@ -293,6 +276,6 @@
$("#searchBtn").click(); $("#searchBtn").click();
} }
}); });
</script> </script>
</body> </body>
</html> </html>

View File

@@ -1,20 +1,20 @@
<%@page import="com.jsh.util.Tools"%> <%@page import="com.jsh.util.Tools" %>
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%> <%@ page language="java" pageEncoding="utf-8" %>
<% <%
String path = request.getContextPath(); String path = request.getContextPath();
String clientIp = Tools.getLocalIp(request); String clientIp = Tools.getLocalIp(request);
%> %>
<!DOCTYPE html> <!DOCTYPE html>
<html> <html>
<head> <head>
<title>会员信息</title> <title>会员信息</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<!-- 指定以IE8的方式来渲染 --> <!-- 指定以IE8的方式来渲染 -->
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE8"/> <meta http-equiv="X-UA-Compatible" content="IE=EmulateIE8"/>
<link rel="shortcut icon" href="<%=path%>/images/favicon.ico" type="image/x-icon" /> <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/default/easyui.css"/>
<link rel="stylesheet" type="text/css" href="<%=path %>/js/easyui-1.3.5/themes/icon.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" /> <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/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/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/locale/easyui-lang-zh_CN.js"></script>
@@ -25,10 +25,11 @@
var path = "<%=path%>"; var path = "<%=path%>";
var clientIp = "<%=clientIp%>"; var clientIp = "<%=clientIp%>";
</script> </script>
</head> </head>
<body> <body>
<!-- 查询 --> <!-- 查询 -->
<div id = "searchPanel" class="easyui-panel" style="padding:10px;" title="查询窗口" iconCls="icon-search" collapsible="true" closable="false"> <div id="searchPanel" class="easyui-panel" style="padding:10px;" title="查询窗口" iconCls="icon-search" collapsible="true"
closable="false">
<table id="searchTable"> <table id="searchTable">
<tr> <tr>
<td>名&nbsp;&nbsp;&nbsp;&nbsp;称:</td> <td>名&nbsp;&nbsp;&nbsp;&nbsp;称:</td>
@@ -57,20 +58,22 @@
</td> </td>
</tr> </tr>
</table> </table>
</div> </div>
<!-- 数据显示table --> <!-- 数据显示table -->
<div id = "tablePanel" class="easyui-panel" style="padding:1px;top:300px;" title="会员信息列表" iconCls="icon-list" collapsible="true" closable="false"> <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> <table id="tableData" style="top:300px;border-bottom-color:#FFFFFF"></table>
</div> </div>
<div id="supplierDlg" class="easyui-dialog" style="width:600px;padding:10px 20px" <div id="supplierDlg" class="easyui-dialog" style="width:600px;padding:10px 20px"
closed="true" buttons="#dlg-buttons" modal="true" collapsible="false" closable="true"> closed="true" buttons="#dlg-buttons" modal="true" collapsible="false" closable="true">
<form id="supplierFM"> <form id="supplierFM">
<table> <table>
<tr> <tr>
<td style="width: 80px;height: 20px">名称</td> <td style="width: 80px;height: 20px">名称</td>
<td style="width: 180px;padding:1px"> <td style="width: 180px;padding:1px">
<input name="supplier" id="supplier" class="easyui-validatebox" data-options="required:true,validType:'length[2,30]'" style="width: 160px;height: 20px"/> <input name="supplier" id="supplier" class="easyui-validatebox"
data-options="required:true,validType:'length[2,30]'" style="width: 160px;height: 20px"/>
</td> </td>
<td style="width: 60px;height: 20px">联系人</td> <td style="width: 60px;height: 20px">联系人</td>
<td style="width:180px;padding:1px;"> <td style="width:180px;padding:1px;">
@@ -80,11 +83,13 @@
<tr> <tr>
<td>手机号码</td> <td>手机号码</td>
<td style="padding:1px;"> <td style="padding:1px;">
<input name="telephone" id="telephone" class="easyui-validatebox" style="width: 160px;height: 20px"/> <input name="telephone" id="telephone" class="easyui-validatebox"
style="width: 160px;height: 20px"/>
</td> </td>
<td>电子邮箱</td> <td>电子邮箱</td>
<td style="padding:1px"> <td style="padding:1px">
<input name="email" id="email" class="easyui-validatebox" validType="email" style="width: 160px;height: 20px"/> <input name="email" id="email" class="easyui-validatebox" validType="email"
style="width: 160px;height: 20px"/>
</td> </td>
</tr> </tr>
<tr> <tr>
@@ -100,21 +105,25 @@
<tr> <tr>
<td>期初应收</td> <td>期初应收</td>
<td style="padding:1px"> <td style="padding:1px">
<input name="BeginNeedGet" id="BeginNeedGet" type="text" class="easyui-numberbox" data-options="min:0,precision:2" style="width: 160px;height: 20px" /> <input name="BeginNeedGet" id="BeginNeedGet" type="text" class="easyui-numberbox"
data-options="min:0,precision:2" style="width: 160px;height: 20px"/>
</td> </td>
<td>期初应付</td> <td>期初应付</td>
<td style="padding:1px"> <td style="padding:1px">
<input name="BeginNeedPay" id="BeginNeedPay" type="text" class="easyui-numberbox" data-options="min:0,precision:2" style="width: 160px;height: 20px" /> <input name="BeginNeedPay" id="BeginNeedPay" type="text" class="easyui-numberbox"
data-options="min:0,precision:2" style="width: 160px;height: 20px"/>
</td> </td>
</tr> </tr>
<tr> <tr>
<td>累计应收</td> <td>累计应收</td>
<td style="padding:1px"> <td style="padding:1px">
<input name="AllNeedGet" id="AllNeedGet" type="text" style="width: 160px;height: 20px" readonly="readonly" /> <input name="AllNeedGet" id="AllNeedGet" type="text" style="width: 160px;height: 20px"
readonly="readonly"/>
</td> </td>
<td>累计应付</td> <td>累计应付</td>
<td style="padding:1px"> <td style="padding:1px">
<input name="AllNeedPay" id="AllNeedPay" type="text" style="width: 160px;height: 20px" readonly="readonly" /> <input name="AllNeedPay" id="AllNeedPay" type="text" style="width: 160px;height: 20px"
readonly="readonly"/>
</td> </td>
</tr> </tr>
<tr> <tr>
@@ -134,7 +143,8 @@
</td> </td>
<td>账号</td> <td>账号</td>
<td style="padding:1px"> <td style="padding:1px">
<input name="accountNumber" id="accountNumber" class="easyui-validatebox" style="width: 160px;height: 20px"/> <input name="accountNumber" id="accountNumber" class="easyui-validatebox"
style="width: 160px;height: 20px"/>
</td> </td>
</tr> </tr>
<tr> <tr>
@@ -151,15 +161,17 @@
</tr> </tr>
</table> </table>
</form> </form>
</div> </div>
<div id="dlg-buttons"> <div id="dlg-buttons">
<a href="javascript:void(0)" id="saveSupplier" class="easyui-linkbutton" iconCls="icon-ok">保存</a> <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> <a href="javascript:void(0)" id="cancelSupplier" class="easyui-linkbutton" iconCls="icon-cancel"
</div> onclick="javascript:$('#supplierDlg').dialog('close')">取消</a>
</div>
<!-- 导入excel表格 --> <!-- 导入excel表格 -->
<div id="importExcelDlg" style="padding:10px 20px"> <div id="importExcelDlg" style="padding:10px 20px">
<form id="importExcelFM" method="post" enctype="multipart/form-data" action="<%=path%>/supplier/importExcelMember.action"> <form id="importExcelFM" method="post" enctype="multipart/form-data"
action="<%=path%>/supplier/importExcelMember.action">
<div class="fitem" style="padding:5px"> <div class="fitem" style="padding:5px">
<label>文件名称&nbsp;&nbsp;</label> <label>文件名称&nbsp;&nbsp;</label>
<input name="supplierFile" id="supplierFile" type="file" style="width: 230px;height: 20px"/> <input name="supplierFile" id="supplierFile" type="file" style="width: 230px;height: 20px"/>
@@ -169,7 +181,7 @@
</div> </div>
<div class="fitem" style="padding:5px;display: none;"> <div class="fitem" style="padding:5px;display: none;">
<label>是否审查&nbsp;&nbsp;</label> <label>是否审查&nbsp;&nbsp;</label>
<select id ="isCheck" name="isCheck" style="width: 230px;height: 20px"> <select id="isCheck" name="isCheck" style="width: 230px;height: 20px">
<option value="0">是</option> <option value="0">是</option>
<option value="1" selected="selected">否</option> <option value="1" selected="selected">否</option>
</select> </select>
@@ -177,9 +189,10 @@
<input type="hidden" name="clientIp" id="clientIp" value="<%=clientIp %>"/> <input type="hidden" name="clientIp" id="clientIp" value="<%=clientIp %>"/>
<div id="dlg-buttons5"> <div id="dlg-buttons5">
<a href="javascript:void(0)" id="saveimport" class="easyui-linkbutton" iconCls="icon-ok">导入</a> <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> <a href="javascript:void(0)" id="cancelimport" class="easyui-linkbutton" iconCls="icon-cancel"
onclick="javascript:$('#importExcelDlg').dialog('close')">取消</a>
</div> </div>
</form> </form>
</div> </div>
</body> </body>
</html> </html>

View File

@@ -1,32 +1,33 @@
<%@page import="com.jsh.util.Tools"%> <%@page import="com.jsh.util.Tools" %>
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%> <%@ page language="java" pageEncoding="utf-8" %>
<% <%
String path = request.getContextPath(); String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/"; String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + path + "/";
String clientIp = Tools.getLocalIp(request); String clientIp = Tools.getLocalIp(request);
%> %>
<!DOCTYPE html> <!DOCTYPE html>
<html> <html>
<head> <head>
<title>角色管理</title> <title>角色管理</title>
<meta charset="utf-8"> <meta charset="utf-8">
<!-- 指定以IE8的方式来渲染 --> <!-- 指定以IE8的方式来渲染 -->
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE8"/> <meta http-equiv="X-UA-Compatible" content="IE=EmulateIE8"/>
<link rel="shortcut icon" href="<%=path%>/images/favicon.ico" type="image/x-icon" /> <link rel="shortcut icon" href="<%=path%>/images/favicon.ico" type="image/x-icon"/>
<script type="text/javascript" src="<%=path %>/js/jquery-1.8.0.min.js"></script> <script type="text/javascript" src="<%=path %>/js/jquery-1.8.0.min.js"></script>
<script type="text/javascript" src="<%=path %>/js/colorbox/jquery.colorbox-min.js"></script> <script type="text/javascript" src="<%=path %>/js/colorbox/jquery.colorbox-min.js"></script>
<script type="text/javascript" src="<%=path %>/js/colorbox/colorboxSet.js"></script> <script type="text/javascript" src="<%=path %>/js/colorbox/colorboxSet.js"></script>
<link href="<%=path %>/js/colorbox/colorbox.css" rel="stylesheet" type="text/css" /> <link href="<%=path %>/js/colorbox/colorbox.css" rel="stylesheet" type="text/css"/>
<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/default/easyui.css"/>
<link rel="stylesheet" type="text/css" href="<%=path %>/js/easyui-1.3.5/themes/icon.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" /> <link type="text/css" rel="stylesheet" href="<%=path %>/css/common.css"/>
<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/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/locale/easyui-lang-zh_CN.js"></script>
<script type="text/javascript" src="<%=path %>/js/common/common.js"></script> <script type="text/javascript" src="<%=path %>/js/common/common.js"></script>
</head> </head>
<body> <body>
<!-- 查询 --> <!-- 查询 -->
<div id = "searchPanel" class="easyui-panel" style="padding:10px;" title="查询窗口" iconCls="icon-search" collapsible="true" closable="false"> <div id="searchPanel" class="easyui-panel" style="padding:10px;" title="查询窗口" iconCls="icon-search" collapsible="true"
closable="false">
<table id="searchTable"> <table id="searchTable">
<tr> <tr>
<td>角色名称:</td> <td>角色名称:</td>
@@ -45,34 +46,37 @@
</td> </td>
</tr> </tr>
</table> </table>
</div> </div>
<!-- 数据显示table --> <!-- 数据显示table -->
<div id = "tablePanel" class="easyui-panel" style="padding:1px;top:300px;" title="角色列表" iconCls="icon-list" collapsible="true" closable="false"> <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> <table id="tableData" style="top:300px;border-bottom-color:#FFFFFF"></table>
</div> </div>
<div id="roleDlg" class="easyui-dialog" style="width:380px;padding:10px 20px" <div id="roleDlg" class="easyui-dialog" style="width:380px;padding:10px 20px"
closed="true" buttons="#dlg-buttons" modal="true" cache="false" collapsible="false" closable="true"> closed="true" buttons="#dlg-buttons" modal="true" cache="false" collapsible="false" closable="true">
<form id="roleFM" method="post" novalidate> <form id="roleFM" method="post" novalidate>
<table> <table>
<tr> <tr>
<td><label id="nameLabel">角色名称&nbsp;&nbsp;</label></td> <td><label id="nameLabel">角色名称&nbsp;&nbsp;</label></td>
<td style="padding:5px"><input name="name" id="name" class="easyui-validatebox" data-options="required:true,validType:'length[2,30]'" style="width: 230px;height: 20px"/></td> <td style="padding:5px"><input name="name" id="name" class="easyui-validatebox"
data-options="required:true,validType:'length[2,30]'"
style="width: 230px;height: 20px"/></td>
</tr> </tr>
</table> </table>
<input type="hidden" name="clientIp" id="clientIp" value="<%=clientIp %>"/> <input type="hidden" name="clientIp" id="clientIp" value="<%=clientIp %>"/>
</form> </form>
</div> </div>
<div id="dlg-buttons"> <div id="dlg-buttons">
<a href="javascript:void(0)" id="saveRole" class="easyui-linkbutton" iconCls="icon-ok">保存</a> <a href="javascript:void(0)" id="saveRole" class="easyui-linkbutton" iconCls="icon-ok">保存</a>
<a href="javascript:void(0)" id="cancelRole" class="easyui-linkbutton" iconCls="icon-cancel" onclick="javascript:$('#roleDlg').dialog('close')">取消</a> <a href="javascript:void(0)" id="cancelRole" class="easyui-linkbutton" iconCls="icon-cancel"
</div> onclick="javascript:$('#roleDlg').dialog('close')">取消</a>
</div>
<script type="text/javascript"> <script type="text/javascript">
//初始化界面 //初始化界面
$(function() $(function () {
{
initTableData(); initTableData();
ininPager(); ininPager();
initForm(); initForm();
@@ -80,176 +84,155 @@
}); });
//浏览器适配 //浏览器适配
function browserFit() function browserFit() {
{ if (getOs() == 'MSIE') {
if(getOs()=='MSIE')
{
$("#searchRemarkLabel").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;"); $("#nameLabel").empty().append("角色名称&nbsp;&nbsp;");
} }
else else {
{
$("#searchRemarkLabel").empty().append("描&nbsp;&nbsp;&nbsp;&nbsp;述:"); $("#searchRemarkLabel").empty().append("描&nbsp;&nbsp;&nbsp;&nbsp;述:");
$("#nameLabel").empty().append("角色名称&nbsp;"); $("#nameLabel").empty().append("角色名称&nbsp;");
} }
} }
//防止表单提交重复 //防止表单提交重复
function initForm() function initForm() {
{
$('#roleFM').form({ $('#roleFM').form({
onSubmit: function(){ onSubmit: function () {
return false; return false;
} }
}); });
} }
//初始化表格数据 //初始化表格数据
function initTableData() function initTableData() {
{
$('#tableData').datagrid({ $('#tableData').datagrid({
//title:'角色列表', //title:'角色列表',
//iconCls:'icon-save', //iconCls:'icon-save',
//width:700, //width:700,
height:heightInfo, height: heightInfo,
nowrap: false, nowrap: false,
rownumbers: false, rownumbers: false,
//动画效果 //动画效果
animate:false, animate: false,
//选中单行 //选中单行
singleSelect : true, singleSelect: true,
collapsible:false, collapsible: false,
//selectOnCheck:false, //selectOnCheck:false,
//fitColumns:true, //fitColumns:true,
//单击行是否选中 //单击行是否选中
//checkOnSelect : false, //checkOnSelect : false,
url:'<%=path %>/role/findBy.action?pageSize=' + initPageSize, url: '<%=path %>/role/findBy.action?pageSize=' + initPageSize,
pagination: true, pagination: true,
//交替出现背景 //交替出现背景
striped : true, striped: true,
//loadFilter: pagerFilter, //loadFilter: pagerFilter,
pageSize: initPageSize, pageSize: initPageSize,
pageList: initPageNum, pageList: initPageNum,
columns:[[ columns: [[
{ field: 'Id',width:35,align:"center",checkbox:true}, {field: 'Id', width: 35, align: "center", checkbox: true},
{ title: '角色名称',field: 'Name',width:200}, {title: '角色名称', field: 'Name', width: 200},
{ title: '操作',field: 'op',align:"center",width:130,formatter:function(value,rec)
{ {
title: '操作', field: 'op', align: "center", width: 130, formatter: function (value, rec) {
var str = ''; var str = '';
var rowInfo = rec.Id + 'AaBb' + rec.Name; var rowInfo = rec.Id + 'AaBb' + rec.Name;
if(1 == value) if (1 == value) {
{
str += '<img src="<%=path%>/js/easyui-1.3.5/themes/icons/pencil.png" style="cursor: pointer;" onclick="editRole(\'' + rowInfo + '\');"/>&nbsp;<a onclick="editRole(\'' + 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/pencil.png" style="cursor: pointer;" onclick="editRole(\'' + rowInfo + '\');"/>&nbsp;<a onclick="editRole(\'' + 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="deleteRole('+ rec.Id +');"/>&nbsp;<a onclick="deleteRole('+ rec.Id +');" 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="deleteRole(' + rec.Id + ');"/>&nbsp;<a onclick="deleteRole(' + rec.Id + ');" style="text-decoration:none;color:black;" href="javascript:void(0)">删除</a>&nbsp;&nbsp;';
} }
return str; return str;
} }
} }
]], ]],
toolbar:[ toolbar: [
{
id:'addRole',
text:'增加',
iconCls:'icon-add',
handler:function()
{ {
id: 'addRole',
text: '增加',
iconCls: 'icon-add',
handler: function () {
addRole(); addRole();
} }
}, },
{ {
id:'deleteRole', id: 'deleteRole',
text:'删除', text: '删除',
iconCls:'icon-remove', iconCls: 'icon-remove',
handler:function() handler: function () {
{
batDeleteRole(); batDeleteRole();
} }
} }
], ],
onLoadError:function() onLoadError: function () {
{ $.messager.alert('页面加载提示', '页面加载异常,请稍后再试!', 'error');
$.messager.alert('页面加载提示','页面加载异常,请稍后再试!','error');
return; return;
} }
}); });
} }
//初始化键盘enter事件 //初始化键盘enter事件
$(document).keydown(function(event) $(document).keydown(function (event) {
{
//兼容 IE和firefox 事件 //兼容 IE和firefox 事件
var e = window.event || event; var e = window.event || event;
var k = e.keyCode||e.which||e.charCode; var k = e.keyCode || e.which || e.charCode;
//兼容 IE,firefox 兼容 //兼容 IE,firefox 兼容
var obj = e.srcElement ? e.srcElement : e.target; var obj = e.srcElement ? e.srcElement : e.target;
//绑定键盘事件为 id是指定的输入框才可以触发键盘事件 13键盘事件 ---遗留问题 enter键效验 对话框会关闭问题 //绑定键盘事件为 id是指定的输入框才可以触发键盘事件 13键盘事件 ---遗留问题 enter键效验 对话框会关闭问题
if(k == "13"&&(obj.id=="name"||obj.id=="sort"|| obj.id=="remark" )) if (k == "13" && (obj.id == "name" || obj.id == "sort" || obj.id == "remark")) {
{
$("#saveRole").click(); $("#saveRole").click();
} }
//搜索按钮添加快捷键 //搜索按钮添加快捷键
if(k == "13"&&(obj.id=="searchName" || obj.id=="searchRemark" )) if (k == "13" && (obj.id == "searchName" || obj.id == "searchRemark")) {
{
$("#searchBtn").click(); $("#searchBtn").click();
} }
}); });
//分页信息处理 //分页信息处理
function ininPager() function ininPager() {
{ try {
try
{
var opts = $("#tableData").datagrid('options'); var opts = $("#tableData").datagrid('options');
var pager = $("#tableData").datagrid('getPager'); var pager = $("#tableData").datagrid('getPager');
pager.pagination({ pager.pagination({
onSelectPage:function(pageNum, pageSize) onSelectPage: function (pageNum, pageSize) {
{
opts.pageNumber = pageNum; opts.pageNumber = pageNum;
opts.pageSize = pageSize; opts.pageSize = pageSize;
pager.pagination('refresh', pager.pagination('refresh',
{ {
pageNumber:pageNum, pageNumber: pageNum,
pageSize:pageSize pageSize: pageSize
}); });
showRoleDetails(pageNum,pageSize); showRoleDetails(pageNum, pageSize);
} }
}); });
} }
catch (e) catch (e) {
{ $.messager.alert('异常处理提示', "分页信息异常 : " + e.name + ": " + e.message, 'error');
$.messager.alert('异常处理提示',"分页信息异常 : " + e.name + ": " + e.message,'error');
} }
} }
//删除供应商信息 //删除供应商信息
function deleteRole(roleID) function deleteRole(roleID) {
{ $.messager.confirm('删除确认', '确定要删除此角色信息吗?', function (r) {
$.messager.confirm('删除确认','确定要删除此角色信息吗?',function(r) if (r) {
{
if (r)
{
$.ajax({ $.ajax({
type:"post", type: "post",
url: "<%=path %>/role/delete.action", url: "<%=path %>/role/delete.action",
dataType: "json", dataType: "json",
data: ({ data: ({
roleID : roleID, roleID: roleID,
clientIp:'<%=clientIp %>' clientIp: '<%=clientIp %>'
}), }),
success: function (tipInfo) success: function (tipInfo) {
{
var msg = tipInfo.showModel.msgTip; var msg = tipInfo.showModel.msgTip;
if(msg == '成功') if (msg == '成功') {
{
//加载完以后重新初始化 //加载完以后重新初始化
$("#searchBtn").click(); $("#searchBtn").click();
} }
else else
$.messager.alert('删除提示','删除角色信息失败,请稍后再试!','error'); $.messager.alert('删除提示', '删除角色信息失败,请稍后再试!', 'error');
}, },
//此处添加错误处理 //此处添加错误处理
error:function() error: function () {
{ $.messager.alert('删除提示', '删除角色信息异常,请稍后再试!', 'error');
$.messager.alert('删除提示','删除角色信息异常,请稍后再试!','error');
return; return;
} }
}); });
@@ -258,25 +241,18 @@
} }
//批量删除供应商 //批量删除供应商
function batDeleteRole() function batDeleteRole() {
{
var row = $('#tableData').datagrid('getChecked'); var row = $('#tableData').datagrid('getChecked');
if(row.length == 0) if (row.length == 0) {
{ $.messager.alert('删除提示', '没有记录被选中!', 'info');
$.messager.alert('删除提示','没有记录被选中!','info');
return; return;
} }
if(row.length > 0) if (row.length > 0) {
{ $.messager.confirm('删除确认', '确定要删除选中的' + row.length + '条角色信息吗?', function (r) {
$.messager.confirm('删除确认','确定要删除选中的' + row.length + '条角色信息吗?',function(r) if (r) {
{
if (r)
{
var ids = ""; var ids = "";
for(var i = 0;i < row.length; i ++) for (var i = 0; i < row.length; i++) {
{ if (i == row.length - 1) {
if(i == row.length-1)
{
ids += row[i].Id; ids += row[i].Id;
break; break;
} }
@@ -284,30 +260,27 @@
ids += row[i].Id + ","; ids += row[i].Id + ",";
} }
$.ajax({ $.ajax({
type:"post", type: "post",
url: "<%=path %>/role/batchDelete.action", url: "<%=path %>/role/batchDelete.action",
dataType: "json", dataType: "json",
async : false, async: false,
data: ({ data: ({
roleIDs : ids, roleIDs: ids,
clientIp:'<%=clientIp %>' clientIp: '<%=clientIp %>'
}), }),
success: function (tipInfo) success: function (tipInfo) {
{
var msg = tipInfo.showModel.msgTip; var msg = tipInfo.showModel.msgTip;
if(msg == '成功') if (msg == '成功') {
{
//加载完以后重新初始化 //加载完以后重新初始化
$("#searchBtn").click(); $("#searchBtn").click();
$(":checkbox").attr("checked",false); $(":checkbox").attr("checked", false);
} }
else else
$.messager.alert('删除提示','删除角色信息失败,请稍后再试!','error'); $.messager.alert('删除提示', '删除角色信息失败,请稍后再试!', 'error');
}, },
//此处添加错误处理 //此处添加错误处理
error:function() error: function () {
{ $.messager.alert('删除提示', '删除角色信息异常,请稍后再试!', 'error');
$.messager.alert('删除提示','删除角色信息异常,请稍后再试!','error');
return; return;
} }
}); });
@@ -322,13 +295,12 @@
//保存编辑前的名称 //保存编辑前的名称
var orgRole = ""; var orgRole = "";
function addRole() function addRole() {
{
$("#clientIp").val('<%=clientIp %>'); $("#clientIp").val('<%=clientIp %>');
$("#sort").val(""); $("#sort").val("");
$("#remark").val(""); $("#remark").val("");
$('#roleDlg').dialog('open').dialog('setTitle','<img src="<%=path%>/js/easyui-1.3.5/themes/icons/edit_add.png"/>&nbsp;增加角色信息'); $('#roleDlg').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}); $(".window-mask").css({width: webW, height: webH});
$("#name").val("").focus(); $("#name").val("").focus();
//$('#roleFM').form('clear'); //$('#roleFM').form('clear');
@@ -339,34 +311,29 @@
//保存信息 //保存信息
$("#saveRole").unbind().bind({ $("#saveRole").unbind().bind({
click:function() click: function () {
{ if (!$('#roleFM').form('validate'))
if(!$('#roleFM').form('validate'))
return; return;
else if(checkRoleName()) else if (checkRoleName())
return; return;
else else {
{
$.ajax({ $.ajax({
type:"post", type: "post",
url: url, url: url,
dataType: "json", dataType: "json",
async : false, async: false,
data: ({ data: ({
name : $.trim($("#name").val()), name: $.trim($("#name").val()),
clientIp:'<%=clientIp %>' clientIp: '<%=clientIp %>'
}), }),
success: function (tipInfo) success: function (tipInfo) {
{ if (tipInfo) {
if(tipInfo)
{
$('#roleDlg').dialog('close'); $('#roleDlg').dialog('close');
var opts = $("#tableData").datagrid('options'); var opts = $("#tableData").datagrid('options');
showRoleDetails(opts.pageNumber,opts.pageSize); showRoleDetails(opts.pageNumber, opts.pageSize);
} }
else else {
{
$.messager.show({ $.messager.show({
title: '错误提示', title: '错误提示',
msg: '保存角色信息失败,请稍后重试!' msg: '保存角色信息失败,请稍后重试!'
@@ -374,9 +341,8 @@
} }
}, },
//此处添加错误处理 //此处添加错误处理
error:function() error: function () {
{ $.messager.alert('提示', '保存角色信息异常,请稍后再试!', 'error');
$.messager.alert('提示','保存角色信息异常,请稍后再试!','error');
return; return;
} }
}); });
@@ -385,16 +351,15 @@
}); });
//编辑信息 //编辑信息
function editRole(roleTotalInfo) function editRole(roleTotalInfo) {
{
var roleInfo = roleTotalInfo.split("AaBb"); var roleInfo = roleTotalInfo.split("AaBb");
$("#clientIp").val('<%=clientIp %>'); $("#clientIp").val('<%=clientIp %>');
$("#name").focus().val(roleInfo[1]); $("#name").focus().val(roleInfo[1]);
orgRole = roleInfo[1]; orgRole = roleInfo[1];
$('#roleDlg').dialog('open').dialog('setTitle','<img src="<%=path%>/js/easyui-1.3.5/themes/icons/pencil.png"/>&nbsp;编辑角色信息'); $('#roleDlg').dialog('open').dialog('setTitle', '<img src="<%=path%>/js/easyui-1.3.5/themes/icons/pencil.png"/>&nbsp;编辑角色信息');
$(".window-mask").css({ width: webW ,height: webH}); $(".window-mask").css({width: webW, height: webH});
roleID = roleInfo[0]; roleID = roleInfo[0];
//焦点在名称输入框==定焦在输入文字后面 //焦点在名称输入框==定焦在输入文字后面
$("#name").val("").focus().val(roleInfo[1]); $("#name").val("").focus().val(roleInfo[1]);
@@ -402,38 +367,33 @@
} }
//检查名称是否存在 ++ 重名无法提示问题需要跟进 //检查名称是否存在 ++ 重名无法提示问题需要跟进
function checkRoleName() function checkRoleName() {
{
var name = $.trim($("#name").val()); var name = $.trim($("#name").val());
//表示是否存在 true == 存在 false = 不存在 //表示是否存在 true == 存在 false = 不存在
var flag = false; var flag = false;
//开始ajax名称检验不能重名 //开始ajax名称检验不能重名
if(name.length > 0 &&( orgRole.length ==0 || name != orgRole)) if (name.length > 0 && (orgRole.length == 0 || name != orgRole)) {
{
$.ajax({ $.ajax({
type:"post", type: "post",
url: "<%=path %>/role/checkIsNameExist.action", url: "<%=path %>/role/checkIsNameExist.action",
dataType: "json", dataType: "json",
async : false, async: false,
data: ({ data: ({
roleID : roleID, roleID: roleID,
name : name name: name
}), }),
success: function (tipInfo) success: function (tipInfo) {
{
flag = tipInfo; flag = tipInfo;
if(tipInfo) if (tipInfo) {
{ $.messager.alert('提示', '角色名称已经存在', 'info');
$.messager.alert('提示','角色名称已经存在','info');
//alert("角色名称已经存在"); //alert("角色名称已经存在");
//$("#name").val(""); //$("#name").val("");
return; return;
} }
}, },
//此处添加错误处理 //此处添加错误处理
error:function() error: function () {
{ $.messager.alert('提示', '检查角色名称是否存在异常,请稍后再试!', 'error');
$.messager.alert('提示','检查角色名称是否存在异常,请稍后再试!','error');
return; return;
} }
}); });
@@ -443,40 +403,36 @@
//搜索处理 //搜索处理
$("#searchBtn").unbind().bind({ $("#searchBtn").unbind().bind({
click:function() click: function () {
{ showRoleDetails(1, initPageSize);
showRoleDetails(1,initPageSize);
var opts = $("#tableData").datagrid('options'); var opts = $("#tableData").datagrid('options');
var pager = $("#tableData").datagrid('getPager'); var pager = $("#tableData").datagrid('getPager');
opts.pageNumber = 1; opts.pageNumber = 1;
opts.pageSize = initPageSize; opts.pageSize = initPageSize;
pager.pagination('refresh', pager.pagination('refresh',
{ {
pageNumber:1, pageNumber: 1,
pageSize:initPageSize pageSize: initPageSize
}); });
} }
}); });
function showRoleDetails(pageNo,pageSize) function showRoleDetails(pageNo, pageSize) {
{
$.ajax({ $.ajax({
type:"post", type: "post",
url: "<%=path %>/role/findBy.action", url: "<%=path %>/role/findBy.action",
dataType: "json", dataType: "json",
data: ({ data: ({
name:$.trim($("#searchName").val()), name: $.trim($("#searchName").val()),
pageNo:pageNo, pageNo: pageNo,
pageSize:pageSize pageSize: pageSize
}), }),
success: function (data) success: function (data) {
{ $("#tableData").datagrid('loadData', data);
$("#tableData").datagrid('loadData',data);
}, },
//此处添加错误处理 //此处添加错误处理
error:function() error: function () {
{ $.messager.alert('查询提示', '查询数据后台异常,请稍后再试!', 'error');
$.messager.alert('查询提示','查询数据后台异常,请稍后再试!','error');
return; return;
} }
}); });
@@ -484,7 +440,7 @@
//重置按钮 //重置按钮
$("#searchResetBtn").unbind().bind({ $("#searchResetBtn").unbind().bind({
click:function(){ click: function () {
$("#searchName").val(""); $("#searchName").val("");
//加载完以后重新初始化 //加载完以后重新初始化
@@ -521,6 +477,6 @@
} }
this.href = "<%=path %>/pages/manage/rolePushBtn.jsp?id=" + currentRow.Id; this.href = "<%=path %>/pages/manage/rolePushBtn.jsp?id=" + currentRow.Id;
}); });
</script> </script>
</body> </body>
</html> </html>

View File

@@ -1,38 +1,38 @@
<%@page import="com.jsh.util.Tools"%> <%@page import="com.jsh.util.Tools" %>
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%> <%@ page language="java" pageEncoding="utf-8" %>
<% <%
String path = request.getContextPath(); String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/"; String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + path + "/";
String clientIp = Tools.getLocalIp(request); String clientIp = Tools.getLocalIp(request);
%> %>
<!DOCTYPE html> <!DOCTYPE html>
<html> <html>
<head> <head>
<title>角色对应应用</title> <title>角色对应应用</title>
<meta charset="utf-8"> <meta charset="utf-8">
<!-- 指定以IE8的方式来渲染 --> <!-- 指定以IE8的方式来渲染 -->
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE8" /> <meta http-equiv="X-UA-Compatible" content="IE=EmulateIE8"/>
<link rel="shortcut icon" href="<%=path%>/images/favicon.ico" type="image/x-icon" /> <link rel="shortcut icon" href="<%=path%>/images/favicon.ico" type="image/x-icon"/>
<script type="text/javascript" src="<%=path%>/js/jquery-1.8.0.min.js"></script> <script type="text/javascript" src="<%=path%>/js/jquery-1.8.0.min.js"></script>
<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/default/easyui.css"/>
<link rel="stylesheet" type="text/css" href="<%=path%>/js/easyui-1.3.5/themes/icon.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" /> <link type="text/css" rel="stylesheet" href="<%=path%>/css/common.css"/>
<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/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/locale/easyui-lang-zh_CN.js"></script>
<script type="text/javascript" src="<%=path%>/js/common/common.js"></script> <script type="text/javascript" src="<%=path%>/js/common/common.js"></script>
</head> </head>
<body> <body>
<!-- 数据显示table --> <!-- 数据显示table -->
<div style="padding-bottom: 10px;"> <div style="padding-bottom: 10px;">
<a id="btnOK" class="easyui-linkbutton" iconCls="icon-ok">保存</a> <a id="btnOK" class="easyui-linkbutton" iconCls="icon-ok">保存</a>
</div> </div>
<div> <div>
<ul id="tt"></ul> <ul id="tt"></ul>
</div> </div>
<script type="text/javascript"> <script type="text/javascript">
var url_id = getUrlParam('id'); //获取传值id角色id var url_id = getUrlParam('id'); //获取传值id角色id
var type="RoleAPP"; var type = "RoleAPP";
var url;//定义链接地址 var url;//定义链接地址
function GetNode(ctype) { function GetNode(ctype) {
@@ -57,27 +57,30 @@
//cnodes = cnodes.substring(0, cnodes.length - 1); //cnodes = cnodes.substring(0, cnodes.length - 1);
pnodes = pnodes.substring(0, pnodes.length - 1); pnodes = pnodes.substring(0, pnodes.length - 1);
if (ctype == 'child') { return cnodes; } if (ctype == 'child') {
else { return pnodes }; return cnodes;
}
else {
return pnodes
}
;
}; };
$(function () { $(function () {
$('#tt').tree({ $('#tt').tree({
url:'<%=path%>/app/findRoleAPP.action?UBType='+type+'&UBKeyId='+url_id, url: '<%=path%>/app/findRoleAPP.action?UBType=' + type + '&UBKeyId=' + url_id,
animate:true, animate: true,
checkbox:true checkbox: true
}); });
$("#btnOK").click( $("#btnOK").click(
function() { function () {
if(!checkRoleAPP()) if (!checkRoleAPP()) {
{
url = '<%=path%>/userBusiness/create.action'; url = '<%=path%>/userBusiness/create.action';
} }
else else {
{
url = '<%=path%>/userBusiness/update.action'; url = '<%=path%>/userBusiness/update.action';
} }
@@ -85,11 +88,12 @@
$.ajax({ $.ajax({
type: "post", type: "post",
url:url, url: url,
data: { Type: type, KeyId: url_id, Value: GetNode('child'),clientIp:'<%=clientIp %>' data: {
Type: type, KeyId: url_id, Value: GetNode('child'), clientIp: '<%=clientIp %>'
}, },
dataType: "json", dataType: "json",
async : false, async: false,
success: function (tipInfo) { success: function (tipInfo) {
if (tipInfo) { if (tipInfo) {
self.parent.$.colorbox.close(); self.parent.$.colorbox.close();
@@ -106,33 +110,30 @@
}); });
//检查记录是否存在 //检查记录是否存在
function checkRoleAPP() function checkRoleAPP() {
{
//表示是否存在 true == 存在 false = 不存在 //表示是否存在 true == 存在 false = 不存在
var flag = false; var flag = false;
//开始ajax名称检验是否存在 //开始ajax名称检验是否存在
$.ajax({ $.ajax({
type:"post", type: "post",
url: "<%=path %>/userBusiness/checkIsValueExist.action", url: "<%=path %>/userBusiness/checkIsValueExist.action",
dataType: "json", dataType: "json",
async : false, async: false,
data: ({ data: ({
Type : type, Type: type,
KeyId : url_id KeyId: url_id
}), }),
success: function (tipInfo) success: function (tipInfo) {
{
flag = tipInfo; flag = tipInfo;
}, },
//此处添加错误处理 //此处添加错误处理
error:function() error: function () {
{ $.messager.alert('提示', '检查角色对应应用是否存在异常,请稍后再试!', 'error');
$.messager.alert('提示','检查角色对应应用是否存在异常,请稍后再试!','error');
return; return;
} }
}); });
return flag; return flag;
} }
</script> </script>
</body> </body>
</html> </html>

View File

@@ -1,38 +1,38 @@
<%@page import="com.jsh.util.Tools"%> <%@page import="com.jsh.util.Tools" %>
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%> <%@ page language="java" pageEncoding="utf-8" %>
<% <%
String path = request.getContextPath(); String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/"; String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + path + "/";
String clientIp = Tools.getLocalIp(request); String clientIp = Tools.getLocalIp(request);
%> %>
<!DOCTYPE html> <!DOCTYPE html>
<html> <html>
<head> <head>
<title>角色对应应用</title> <title>角色对应应用</title>
<meta charset="utf-8"> <meta charset="utf-8">
<!-- 指定以IE8的方式来渲染 --> <!-- 指定以IE8的方式来渲染 -->
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE8" /> <meta http-equiv="X-UA-Compatible" content="IE=EmulateIE8"/>
<link rel="shortcut icon" href="<%=path%>/images/favicon.ico" type="image/x-icon" /> <link rel="shortcut icon" href="<%=path%>/images/favicon.ico" type="image/x-icon"/>
<script type="text/javascript" src="<%=path%>/js/jquery-1.8.0.min.js"></script> <script type="text/javascript" src="<%=path%>/js/jquery-1.8.0.min.js"></script>
<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/default/easyui.css"/>
<link rel="stylesheet" type="text/css" href="<%=path%>/js/easyui-1.3.5/themes/icon.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" /> <link type="text/css" rel="stylesheet" href="<%=path%>/css/common.css"/>
<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/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/locale/easyui-lang-zh_CN.js"></script>
<script type="text/javascript" src="<%=path%>/js/common/common.js"></script> <script type="text/javascript" src="<%=path%>/js/common/common.js"></script>
</head> </head>
<body> <body>
<!-- 数据显示table --> <!-- 数据显示table -->
<div style="padding-bottom: 10px;"> <div style="padding-bottom: 10px;">
<a id="btnOK" class="easyui-linkbutton" iconCls="icon-ok">保存</a> <a id="btnOK" class="easyui-linkbutton" iconCls="icon-ok">保存</a>
</div> </div>
<div> <div>
<ul id="tt"></ul> <ul id="tt"></ul>
</div> </div>
<script type="text/javascript"> <script type="text/javascript">
var url_id = getUrlParam('id'); //获取传值id角色id var url_id = getUrlParam('id'); //获取传值id角色id
var type="RoleFunctions"; var type = "RoleFunctions";
var url;//定义链接地址 var url;//定义链接地址
function GetNode(ctype) { function GetNode(ctype) {
@@ -57,26 +57,29 @@
//cnodes = cnodes.substring(0, cnodes.length - 1); //cnodes = cnodes.substring(0, cnodes.length - 1);
pnodes = pnodes.substring(0, pnodes.length - 1); pnodes = pnodes.substring(0, pnodes.length - 1);
if (ctype == 'child') { return cnodes; } if (ctype == 'child') {
else { return pnodes }; return cnodes;
}
else {
return pnodes
}
;
}; };
$(function () { $(function () {
$('#tt').tree({ $('#tt').tree({
url:'<%=path%>/functions/findRoleFunctions.action?UBType='+type+'&UBKeyId='+url_id, url: '<%=path%>/functions/findRoleFunctions.action?UBType=' + type + '&UBKeyId=' + url_id,
animate:true, animate: true,
checkbox:true checkbox: true
}); });
$("#btnOK").click( $("#btnOK").click(
function() { function () {
if(!checkRoleFunctions()) if (!checkRoleFunctions()) {
{
url = '<%=path%>/userBusiness/create.action'; url = '<%=path%>/userBusiness/create.action';
} }
else else {
{
url = '<%=path%>/userBusiness/update.action'; url = '<%=path%>/userBusiness/update.action';
} }
@@ -84,11 +87,12 @@
$.ajax({ $.ajax({
type: "post", type: "post",
url:url, url: url,
data: { Type: type, KeyId: url_id, Value: GetNode('child'),clientIp:'<%=clientIp %>' data: {
Type: type, KeyId: url_id, Value: GetNode('child'), clientIp: '<%=clientIp %>'
}, },
dataType: "json", dataType: "json",
async : false, async: false,
success: function (tipInfo) { success: function (tipInfo) {
if (tipInfo) { if (tipInfo) {
self.parent.$.colorbox.close(); self.parent.$.colorbox.close();
@@ -105,33 +109,30 @@
}); });
//检查记录是否存在 //检查记录是否存在
function checkRoleFunctions() function checkRoleFunctions() {
{
//表示是否存在 true == 存在 false = 不存在 //表示是否存在 true == 存在 false = 不存在
var flag = false; var flag = false;
//开始ajax名称检验是否存在 //开始ajax名称检验是否存在
$.ajax({ $.ajax({
type:"post", type: "post",
url: "<%=path %>/userBusiness/checkIsValueExist.action", url: "<%=path %>/userBusiness/checkIsValueExist.action",
dataType: "json", dataType: "json",
async : false, async: false,
data: ({ data: ({
Type : type, Type: type,
KeyId : url_id KeyId: url_id
}), }),
success: function (tipInfo) success: function (tipInfo) {
{
flag = tipInfo; flag = tipInfo;
}, },
//此处添加错误处理 //此处添加错误处理
error:function() error: function () {
{ $.messager.alert('提示', '检查角色对应功能是否存在异常,请稍后再试!', 'error');
$.messager.alert('提示','检查角色对应功能是否存在异常,请稍后再试!','error');
return; return;
} }
}); });
return flag; return flag;
} }
</script> </script>
</body> </body>
</html> </html>

View File

@@ -1,89 +1,93 @@
<%@page import="com.jsh.util.Tools"%> <%@page import="com.jsh.util.Tools" %>
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%> <%@ page language="java" pageEncoding="utf-8" %>
<% <%
String path = request.getContextPath(); String path = request.getContextPath();
String clientIp = Tools.getLocalIp(request); String clientIp = Tools.getLocalIp(request);
%> %>
<!DOCTYPE html> <!DOCTYPE html>
<html> <html>
<head> <head>
<title>角色分配按钮</title> <title>角色分配按钮</title>
<meta charset="utf-8"> <meta charset="utf-8">
<!-- 指定以IE8的方式来渲染 --> <!-- 指定以IE8的方式来渲染 -->
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE8" /> <meta http-equiv="X-UA-Compatible" content="IE=EmulateIE8"/>
<link rel="shortcut icon" href="<%=path%>/images/favicon.ico" type="image/x-icon" /> <link rel="shortcut icon" href="<%=path%>/images/favicon.ico" type="image/x-icon"/>
<script type="text/javascript" src="<%=path%>/js/jquery-1.8.0.min.js"></script> <script type="text/javascript" src="<%=path%>/js/jquery-1.8.0.min.js"></script>
<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/default/easyui.css"/>
<link rel="stylesheet" type="text/css" href="<%=path%>/js/easyui-1.3.5/themes/icon.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" /> <link type="text/css" rel="stylesheet" href="<%=path%>/css/common.css"/>
<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/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/locale/easyui-lang-zh_CN.js"></script>
<script type="text/javascript" src="<%=path%>/js/common/common.js"></script> <script type="text/javascript" src="<%=path%>/js/common/common.js"></script>
</head> </head>
<body> <body>
<!-- 数据显示table --> <!-- 数据显示table -->
<div style="padding-bottom: 10px;"> <div style="padding-bottom: 10px;">
<a id="btnOK" class="easyui-linkbutton" iconCls="icon-ok">保存</a> <a id="btnOK" class="easyui-linkbutton" iconCls="icon-ok">保存</a>
</div> </div>
<div id="pushList"> <div id="pushList">
<!-- 数据显示table --> <!-- 数据显示table -->
<div id = "tablePanel" class="easyui-panel" style="padding:1px; top:300px;" title="功能列表-选择按钮权限" iconCls="icon-list" closable="false"> <div id="tablePanel" class="easyui-panel" style="padding:1px; top:300px;" title="功能列表-选择按钮权限" iconCls="icon-list"
closable="false">
<table id="tableData" style="top:300px;border-bottom-color:#FFFFFF"></table> <table id="tableData" style="top:300px;border-bottom-color:#FFFFFF"></table>
</div> </div>
</div> </div>
<script type="text/javascript"> <script type="text/javascript">
var keyId = getUrlParam('id'); //获取传值id角色id var keyId = getUrlParam('id'); //获取传值id角色id
var pushBtnJSON; var pushBtnJSON;
var userBusinessId = 0; //关系id var userBusinessId = 0; //关系id
var roleBtnStr = ""; //角色按钮权限 var roleBtnStr = ""; //角色按钮权限
//初始化界面 //初始化界面
$(function() { $(function () {
initJSON(); initJSON();
initTableData(); initTableData();
ininPager(); ininPager();
showDetails(1,initPageSize); showDetails(1, initPageSize);
bindEvent(); bindEvent();
}); });
//初始化JSON //初始化JSON
function initJSON(){ function initJSON() {
var url = '<%=path %>/js/pages/manage/pushBtn.json'; var url = '<%=path %>/js/pages/manage/pushBtn.json';
$.ajax({ $.ajax({
url: url, url: url,
type: "get", type: "get",
async: false, async: false,
success: function(res){ success: function (res) {
if(res){ if (res) {
pushBtnJSON = res; pushBtnJSON = res;
} }
}, },
error: function(){ error: function () {
} }
}); });
} }
//初始化表格数据 //初始化表格数据
function initTableData() { function initTableData() {
$('#tableData').datagrid({ $('#tableData').datagrid({
height:360, height: 360,
rownumbers: true, rownumbers: true,
//动画效果 //动画效果
animate:false, animate: false,
//交替出现背景 //交替出现背景
striped : true, striped: true,
columns:[[ columns: [[
{ field: 'Id',align:"center",hidden:true}, {field: 'Id', align: "center", hidden: true},
{ title: '名称',field: 'Name',width:100}, {title: '名称', field: 'Name', width: 100},
{ title: '按钮列表',field: 'PushBtnList',width:400,formatter:function(value,rec) { {
title: '按钮列表', field: 'PushBtnList', width: 400, formatter: function (value, rec) {
var btnStr = rec.PushBtn; var btnStr = rec.PushBtn;
if(btnStr != undefined){ if (btnStr != undefined) {
var arr = btnStr.split(","); var arr = btnStr.split(",");
if(arr.length){ if (arr.length) {
var str = ""; var str = "";
for(var i=0; i<arr.length; i++){ for (var i = 0; i < arr.length; i++) {
for(var j=0; j<pushBtnJSON.length; j++){ for (var j = 0; j < pushBtnJSON.length; j++) {
if(pushBtnJSON[j].id === arr[i]-0){ if (pushBtnJSON[j].id === arr[i] - 0) {
str += "<input type='checkbox' value='" + pushBtnJSON[j].id + "' />" +pushBtnJSON[j].text; str += "<input type='checkbox' value='" + pushBtnJSON[j].id + "' />" + pushBtnJSON[j].text;
} }
} }
} }
@@ -97,9 +101,8 @@
} }
} }
]], ]],
onLoadError:function() onLoadError: function () {
{ $.messager.alert('页面加载提示', '页面加载异常,请稍后再试!', 'error');
$.messager.alert('页面加载提示','页面加载异常,请稍后再试!','error');
return; return;
} }
}); });
@@ -107,31 +110,28 @@
//分页信息处理 //分页信息处理
function ininPager() { function ininPager() {
try try {
{
var opts = $("#tableData").datagrid('options'); var opts = $("#tableData").datagrid('options');
var pager = $("#tableData").datagrid('getPager'); var pager = $("#tableData").datagrid('getPager');
pager.pagination({ pager.pagination({
onSelectPage:function(pageNum, pageSize) onSelectPage: function (pageNum, pageSize) {
{
opts.pageNumber = pageNum; opts.pageNumber = pageNum;
opts.pageSize = pageSize; opts.pageSize = pageSize;
pager.pagination('refresh', pager.pagination('refresh',
{ {
pageNumber:pageNum, pageNumber: pageNum,
pageSize:pageSize pageSize: pageSize
}); });
showDetails(pageNum,pageSize); showDetails(pageNum, pageSize);
} }
}); });
} }
catch (e) catch (e) {
{ $.messager.alert('异常处理提示', "分页信息异常 : " + e.name + ": " + e.message, 'error');
$.messager.alert('异常处理提示',"分页信息异常 : " + e.name + ": " + e.message,'error');
} }
} }
function showDetails(pageNo,pageSize){ function showDetails(pageNo, pageSize) {
$.ajax({ $.ajax({
url: "<%=path%>/userBusiness/getBasicData.action", url: "<%=path%>/userBusiness/getBasicData.action",
type: "get", type: "get",
@@ -139,13 +139,13 @@
Type: 'RoleFunctions', Type: 'RoleFunctions',
KeyId: keyId KeyId: keyId
}, },
success: function(res){ success: function (res) {
if(res && res.showModel && res.showModel.map && res.showModel.map.userBusinessList && res.showModel.map.userBusinessList[0]){ if (res && res.showModel && res.showModel.map && res.showModel.map.userBusinessList && res.showModel.map.userBusinessList[0]) {
userBusinessId = res.showModel.map.userBusinessList[0].id; userBusinessId = res.showModel.map.userBusinessList[0].id;
roleBtnStr = res.showModel.map.userBusinessList[0].btnStr; roleBtnStr = res.showModel.map.userBusinessList[0].btnStr;
var getValue = res.showModel.map.userBusinessList[0].value; var getValue = res.showModel.map.userBusinessList[0].value;
getValue = getValue.substring(1,getValue.length-1); getValue = getValue.substring(1, getValue.length - 1);
if(getValue.indexOf("][")){ if (getValue.indexOf("][")) {
var arr = getValue.split("]["); var arr = getValue.split("][");
arr = arr.toString(); arr = arr.toString();
$.ajax({ $.ajax({
@@ -154,41 +154,42 @@
data: { data: {
FunctionsIDs: arr FunctionsIDs: arr
}, },
success: function(rec){ success: function (rec) {
$("#tableData").datagrid('loadData',JSON.parse(rec)); $("#tableData").datagrid('loadData', JSON.parse(rec));
}, },
error: function(){ error: function () {
$.messager.alert('提示','查询数据异常,请稍后再试!','error'); $.messager.alert('提示', '查询数据异常,请稍后再试!', 'error');
return; return;
} }
}); });
} }
} }
}, },
error: function(){ error: function () {
$.messager.alert('提示','查询数据异常,请稍后再试!','error'); $.messager.alert('提示', '查询数据异常,请稍后再试!', 'error');
return; return;
} }
}); });
} }
function bindEvent() { function bindEvent() {
setTimeout(function(){ setTimeout(function () {
var bindBody = $("#pushList .datagrid-view2 .datagrid-body"); var bindBody = $("#pushList .datagrid-view2 .datagrid-body");
//加载按钮信息到缓存中 //加载按钮信息到缓存中
if(roleBtnStr){ if (roleBtnStr) {
var roleBtnStrArr = JSON.parse(roleBtnStr); var roleBtnStrArr = JSON.parse(roleBtnStr);
bindBody.find(".datagrid-row").each(function() { bindBody.find(".datagrid-row").each(function () {
for(var i= 0; i<roleBtnStrArr.length; i++){ for (var i = 0; i < roleBtnStrArr.length; i++) {
if(roleBtnStrArr[i] && roleBtnStrArr[i].funId){ if (roleBtnStrArr[i] && roleBtnStrArr[i].funId) {
var thisId = $(this).find("[field='Id']").text()-0; var thisId = $(this).find("[field='Id']").text() - 0;
if(roleBtnStrArr[i].funId == thisId){ if (roleBtnStrArr[i].funId == thisId) {
$(this).find("[field='Id']").attr("data-btn", roleBtnStrArr[i].btnStr); $(this).find("[field='Id']").attr("data-btn", roleBtnStrArr[i].btnStr);
//加载勾选状态 //加载勾选状态
$(this).find("[field='PushBtnList']").find("input").each(function () { $(this).find("[field='PushBtnList']").find("input").each(function () {
var thisValue = $(this).val(); //勾选的值 var thisValue = $(this).val(); //勾选的值
if(roleBtnStrArr[i].btnStr.indexOf(thisValue)>-1){ if (roleBtnStrArr[i].btnStr.indexOf(thisValue) > -1) {
$(this).prop("checked","checked"); $(this).prop("checked", "checked");
} }
}); });
} }
@@ -214,7 +215,7 @@
}); });
}, 500); }, 500);
$("#btnOK").off("click").on("click", function() { $("#btnOK").off("click").on("click", function () {
if (confirm("您确定要保存吗?")) { if (confirm("您确定要保存吗?")) {
var bindList = $("#pushList .datagrid-view2 .datagrid-body .datagrid-row"); var bindList = $("#pushList .datagrid-view2 .datagrid-body .datagrid-row");
var bindArr = []; var bindArr = [];
@@ -259,6 +260,6 @@
} }
}); });
} }
</script> </script>
</body> </body>
</html> </html>

View File

@@ -1,47 +1,47 @@
<%@page import="com.jsh.util.Tools"%> <%@page import="com.jsh.util.Tools" %>
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%> <%@ page language="java" pageEncoding="utf-8" %>
<% <%
String path = request.getContextPath(); String path = request.getContextPath();
String clientIp = Tools.getLocalIp(request); String clientIp = Tools.getLocalIp(request);
%> %>
<!DOCTYPE html> <!DOCTYPE html>
<html> <html>
<head> <head>
<title>系统配置</title> <title>系统配置</title>
<meta charset="utf-8"> <meta charset="utf-8">
<!-- 指定以IE8的方式来渲染 --> <!-- 指定以IE8的方式来渲染 -->
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE8"/> <meta http-equiv="X-UA-Compatible" content="IE=EmulateIE8"/>
<link rel="shortcut icon" href="<%=path%>/images/favicon.ico" type="image/x-icon" /> <link rel="shortcut icon" href="<%=path%>/images/favicon.ico" type="image/x-icon"/>
<script type="text/javascript" src="<%=path %>/js/jquery-1.8.0.min.js"></script> <script type="text/javascript" src="<%=path %>/js/jquery-1.8.0.min.js"></script>
<script type="text/javascript" src="<%=path %>/js/colorbox/jquery.colorbox-min.js"></script> <script type="text/javascript" src="<%=path %>/js/colorbox/jquery.colorbox-min.js"></script>
<script type="text/javascript" src="<%=path %>/js/colorbox/colorboxSet.js"></script> <script type="text/javascript" src="<%=path %>/js/colorbox/colorboxSet.js"></script>
<link href="<%=path %>/js/colorbox/colorbox.css" rel="stylesheet" type="text/css" /> <link href="<%=path %>/js/colorbox/colorbox.css" rel="stylesheet" type="text/css"/>
<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/default/easyui.css"/>
<link rel="stylesheet" type="text/css" href="<%=path %>/js/easyui-1.3.5/themes/icon.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" /> <link type="text/css" rel="stylesheet" href="<%=path %>/css/common.css"/>
<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/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/locale/easyui-lang-zh_CN.js"></script>
<script type="text/javascript" src="<%=path %>/js/common/common.js"></script> <script type="text/javascript" src="<%=path %>/js/common/common.js"></script>
<script> <script>
$(function(){ $(function () {
//加载信息 //加载信息
function loadInfo() { function loadInfo() {
$.ajax({ $.ajax({
type:"get", type: "get",
url: "<%=path %>/systemConfig/findBy.action", url: "<%=path %>/systemConfig/findBy.action",
dataType: "json", dataType: "json",
success: function (res) { success: function (res) {
if(res && res.rows) { if (res && res.rows) {
var array = res.rows; var array = res.rows;
for(var i=0; i<array.length; i++){ for (var i = 0; i < array.length; i++) {
var name = array[i].name; var name = array[i].name;
$("." + name).val(array[i].value).attr("data-value",array[i].value).attr("data-id",array[i].id); $("." + name).val(array[i].value).attr("data-value", array[i].value).attr("data-id", array[i].id);
} }
} }
}, },
//此处添加错误处理 //此处添加错误处理
error:function() { error: function () {
$.messager.alert('查询失败','查询系统配置信息异常,请稍后再试!','error'); $.messager.alert('查询失败', '查询系统配置信息异常,请稍后再试!', 'error');
return; return;
} }
}); });
@@ -49,12 +49,12 @@
loadInfo(); //加载信息 loadInfo(); //加载信息
$("#saveSystemConfig").off("click").on("click",function(){ $("#saveSystemConfig").off("click").on("click", function () {
var status = false; var status = false;
$("#searchTable input").each(function(){ $("#searchTable input").each(function () {
var thisId = $(this).attr("data-id"); var thisId = $(this).attr("data-id");
var thisValue = $(this).attr("data-value"); var thisValue = $(this).attr("data-value");
if($(this).val() != thisValue){ if ($(this).val() != thisValue) {
//更新修改过的单行信息 //更新修改过的单行信息
$.ajax({ $.ajax({
type: "post", type: "post",
@@ -65,7 +65,7 @@
value: $(this).val() value: $(this).val()
}, },
success: function (res) { success: function (res) {
if(res) { if (res) {
status = true; status = true;
} }
}, },
@@ -77,26 +77,27 @@
}); });
} }
}); });
setTimeout(function(){ setTimeout(function () {
if(status) { if (status) {
$.messager.alert('保存成功','保存系统配置信息成功!','info'); $.messager.alert('保存成功', '保存系统配置信息成功!', 'info');
loadInfo(); //加载信息 loadInfo(); //加载信息
} }
else { else {
$.messager.alert('提示','信息未修改,无需保存!','info'); $.messager.alert('提示', '信息未修改,无需保存!', 'info');
} }
},1000); }, 1000);
}); });
}) })
</script> </script>
</head> </head>
<body> <body>
<div class="system-config"> <div class="system-config">
<table id="searchTable"> <table id="searchTable">
<tr> <tr>
<td>公司名称:</td> <td>公司名称:</td>
<td> <td>
<input type="text" class="company_name easyui-validatebox" data-options="required:true,validType:'length[2,30]'" style="width:250px;"/> <input type="text" class="company_name easyui-validatebox"
data-options="required:true,validType:'length[2,30]'" style="width:250px;"/>
</td> </td>
</tr> </tr>
<tr> <tr>
@@ -136,6 +137,6 @@
</td> </td>
</tr> </tr>
</table> </table>
</div> </div>
</body> </body>
</html> </html>

View File

@@ -1,28 +1,29 @@
<%@page import="com.jsh.util.Tools"%> <%@page import="com.jsh.util.Tools" %>
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%> <%@ page language="java" pageEncoding="utf-8" %>
<% <%
String path = request.getContextPath(); String path = request.getContextPath();
String clientIp = Tools.getLocalIp(request); String clientIp = Tools.getLocalIp(request);
%> %>
<!DOCTYPE html> <!DOCTYPE html>
<html> <html>
<head> <head>
<title>计量单位管理</title> <title>计量单位管理</title>
<meta charset="utf-8"> <meta charset="utf-8">
<!-- 指定以IE8的方式来渲染 --> <!-- 指定以IE8的方式来渲染 -->
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE8"/> <meta http-equiv="X-UA-Compatible" content="IE=EmulateIE8"/>
<link rel="shortcut icon" href="<%=path%>/images/favicon.ico" type="image/x-icon" /> <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/default/easyui.css"/>
<link rel="stylesheet" type="text/css" href="<%=path %>/js/easyui-1.3.5/themes/icon.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" /> <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/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/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/locale/easyui-lang-zh_CN.js"></script>
<script type="text/javascript" src="<%=path %>/js/common/common.js"></script> <script type="text/javascript" src="<%=path %>/js/common/common.js"></script>
</head> </head>
<body> <body>
<!-- 查询 --> <!-- 查询 -->
<div id = "searchPanel" class="easyui-panel" style="padding:10px;" title="查询窗口" iconCls="icon-search" collapsible="true" closable="false"> <div id="searchPanel" class="easyui-panel" style="padding:10px;" title="查询窗口" iconCls="icon-search" collapsible="true"
closable="false">
<table id="searchTable"> <table id="searchTable">
<tr> <tr>
<td>计量单位:</td> <td>计量单位:</td>
@@ -36,56 +37,59 @@
</td> </td>
</tr> </tr>
</table> </table>
</div> </div>
<!-- 数据显示table --> <!-- 数据显示table -->
<div id = "tablePanel" class="easyui-panel" style="padding:1px;top:300px;" title="计量单位列表" iconCls="icon-list" collapsible="true" closable="false"> <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> <table id="tableData" style="top:300px;border-bottom-color:#FFFFFF"></table>
</div> </div>
<div id="unitDlg" class="easyui-dialog" style="width:380px;padding:10px 20px" <div id="unitDlg" class="easyui-dialog" style="width:380px;padding:10px 20px"
closed="true" buttons="#dlg-buttons" modal="true" cache="false" collapsible="false" closable="true"> closed="true" buttons="#dlg-buttons" modal="true" cache="false" collapsible="false" closable="true">
<form id="unitFM" method="post" novalidate> <form id="unitFM" method="post" novalidate>
<table> <table>
<tr> <tr>
<td>基本单位</td> <td>基本单位</td>
<td style="padding:5px"> <td style="padding:5px">
<input name="basicName" id="basicName" class="easyui-validatebox" data-options="required:true,validType:'length[1,10]'" style="width: 100px;height: 20px"/> <input name="basicName" id="basicName" class="easyui-validatebox"
data-options="required:true,validType:'length[1,10]'" style="width: 100px;height: 20px"/>
基本单位应为最小度量单位 基本单位应为最小度量单位
</td> </td>
</tr> </tr>
<tr> <tr>
<td>副单位</td> <td>副单位</td>
<td style="padding:5px"> <td style="padding:5px">
<input name="otherName" id="otherName" class="easyui-validatebox" data-options="required:true,validType:'length[1,5]'" style="width: 100px;height: 20px"/> <input name="otherName" id="otherName" class="easyui-validatebox"
data-options="required:true,validType:'length[1,5]'" style="width: 100px;height: 20px"/>
= =
<input name="otherNum" id="otherNum" class="easyui-validatebox" data-options="required:true,validType:'length[1,5]'" style="width: 50px;height: 20px"/> <input name="otherNum" id="otherNum" class="easyui-validatebox"
data-options="required:true,validType:'length[1,5]'" style="width: 50px;height: 20px"/>
<span id="unitName"></span> <span id="unitName"></span>
</td> </td>
</tr> </tr>
</table> </table>
<input type="hidden" name="clientIp" id="clientIp" value="<%=clientIp %>"/> <input type="hidden" name="clientIp" id="clientIp" value="<%=clientIp %>"/>
</form> </form>
</div> </div>
<div id="dlg-buttons"> <div id="dlg-buttons">
<a href="javascript:void(0)" id="saveUnit" class="easyui-linkbutton" iconCls="icon-ok">保存</a> <a href="javascript:void(0)" id="saveUnit" class="easyui-linkbutton" iconCls="icon-ok">保存</a>
<a href="javascript:void(0)" id="cancelUnit" class="easyui-linkbutton" iconCls="icon-cancel" onclick="javascript:$('#unitDlg').dialog('close')">取消</a> <a href="javascript:void(0)" id="cancelUnit" class="easyui-linkbutton" iconCls="icon-cancel"
</div> onclick="javascript:$('#unitDlg').dialog('close')">取消</a>
</div>
<script type="text/javascript"> <script type="text/javascript">
//初始化界面 //初始化界面
$(function() $(function () {
{
initTableData(); initTableData();
ininPager(); ininPager();
initForm(); initForm();
}); });
//防止表单提交重复 //防止表单提交重复
function initForm() function initForm() {
{
$('#unitFM').form({ $('#unitFM').form({
onSubmit: function(){ onSubmit: function () {
return false; return false;
} }
}); });
@@ -97,129 +101,129 @@
//title:'计量单位列表', //title:'计量单位列表',
//iconCls:'icon-save', //iconCls:'icon-save',
//width:700, //width:700,
height:heightInfo, height: heightInfo,
nowrap: false, nowrap: false,
rownumbers: false, rownumbers: false,
//动画效果 //动画效果
animate:false, animate: false,
//选中单行 //选中单行
singleSelect : true, singleSelect: true,
collapsible:false, collapsible: false,
selectOnCheck:false, selectOnCheck: false,
//fitColumns:true, //fitColumns:true,
//单击行是否选中 //单击行是否选中
checkOnSelect : false, checkOnSelect: false,
url:'<%=path %>/unit/findBy.action?pageSize=' + initPageSize, url: '<%=path %>/unit/findBy.action?pageSize=' + initPageSize,
pagination: true, pagination: true,
//交替出现背景 //交替出现背景
striped : true, striped: true,
//loadFilter: pagerFilter, //loadFilter: pagerFilter,
pageSize: initPageSize, pageSize: initPageSize,
pageList: initPageNum, pageList: initPageNum,
columns:[[ columns: [[
{ field: 'id',width:35,align:"center",checkbox:true}, {field: 'id', width: 35, align: "center", checkbox: true},
{ title: '操作',field: 'op',align:"center",width:60, {
formatter:function(value,rec) { title: '操作', field: 'op', align: "center", width: 60,
formatter: function (value, rec) {
var str = ''; var str = '';
var rowInfo = rec.id + 'AaBb' + rec.UName; var rowInfo = rec.id + 'AaBb' + rec.UName;
if(1 == value) if (1 == value) {
{
str += '<img title="编辑" src="<%=path%>/js/easyui-1.3.5/themes/icons/pencil.png" style="cursor: pointer;" onclick="editUnit(\'' + rowInfo + '\');"/>&nbsp;&nbsp;&nbsp;'; str += '<img title="编辑" src="<%=path%>/js/easyui-1.3.5/themes/icons/pencil.png" style="cursor: pointer;" onclick="editUnit(\'' + rowInfo + '\');"/>&nbsp;&nbsp;&nbsp;';
str += '<img title="删除" src="<%=path%>/js/easyui-1.3.5/themes/icons/edit_remove.png" style="cursor: pointer;" onclick="deleteUnit('+ rec.id +');"/>'; str += '<img title="删除" src="<%=path%>/js/easyui-1.3.5/themes/icons/edit_remove.png" style="cursor: pointer;" onclick="deleteUnit(' + rec.id + ');"/>';
} }
return str; return str;
} }
}, },
{ title: '计量单位',field: 'UName',width:200} {title: '计量单位', field: 'UName', width: 200}
]], ]],
toolbar:[ toolbar: [
{ {
id:'addUnit', id: 'addUnit',
text:'增加', text: '增加',
iconCls:'icon-add', iconCls: 'icon-add',
handler:function() { handler: function () {
addUnit(); addUnit();
} }
},'-', }, '-',
{ {
id:'deleteUnit', id: 'deleteUnit',
text:'删除', text: '删除',
iconCls:'icon-remove', iconCls: 'icon-remove',
handler:function() { handler: function () {
batDeleteUnit(); batDeleteUnit();
} }
} }
], ],
onLoadError:function() { onLoadError: function () {
$.messager.alert('页面加载提示','页面加载异常,请稍后再试!','error'); $.messager.alert('页面加载提示', '页面加载异常,请稍后再试!', 'error');
return; return;
} }
}); });
} }
//初始化键盘enter事件 //初始化键盘enter事件
$(document).keydown(function(event) { $(document).keydown(function (event) {
//兼容 IE和firefox 事件 //兼容 IE和firefox 事件
var e = window.event || event; var e = window.event || event;
var k = e.keyCode||e.which||e.charCode; var k = e.keyCode || e.which || e.charCode;
//兼容 IE,firefox 兼容 //兼容 IE,firefox 兼容
var obj = e.srcElement ? e.srcElement : e.target; var obj = e.srcElement ? e.srcElement : e.target;
//绑定键盘事件为 id是指定的输入框才可以触发键盘事件 13键盘事件 ---遗留问题 enter键效验 对话框会关闭问题 //绑定键盘事件为 id是指定的输入框才可以触发键盘事件 13键盘事件 ---遗留问题 enter键效验 对话框会关闭问题
if(k == "13"&&(obj.id=="name")) { if (k == "13" && (obj.id == "name")) {
$("#saveUnit").click(); $("#saveUnit").click();
} }
//搜索按钮添加快捷键 //搜索按钮添加快捷键
if(k == "13"&&(obj.id=="searchName")) { if (k == "13" && (obj.id == "searchName")) {
$("#searchBtn").click(); $("#searchBtn").click();
} }
}); });
//分页信息处理 //分页信息处理
function ininPager() { function ininPager() {
try { try {
var opts = $("#tableData").datagrid('options'); var opts = $("#tableData").datagrid('options');
var pager = $("#tableData").datagrid('getPager'); var pager = $("#tableData").datagrid('getPager');
pager.pagination({ pager.pagination({
onSelectPage:function(pageNum, pageSize) { onSelectPage: function (pageNum, pageSize) {
opts.pageNumber = pageNum; opts.pageNumber = pageNum;
opts.pageSize = pageSize; opts.pageSize = pageSize;
pager.pagination('refresh', { pager.pagination('refresh', {
pageNumber:pageNum, pageNumber: pageNum,
pageSize:pageSize pageSize: pageSize
}); });
showUnitDetails(pageNum,pageSize); showUnitDetails(pageNum, pageSize);
} }
}); });
} }
catch (e) { catch (e) {
$.messager.alert('异常处理提示',"分页信息异常 : " + e.name + ": " + e.message,'error'); $.messager.alert('异常处理提示', "分页信息异常 : " + e.name + ": " + e.message, 'error');
} }
} }
//删除计量单位 //删除计量单位
function deleteUnit(unitID) { function deleteUnit(unitID) {
$.messager.confirm('删除确认','确定要删除此计量单位吗?',function(r) { $.messager.confirm('删除确认', '确定要删除此计量单位吗?', function (r) {
if (r) { if (r) {
$.ajax({ $.ajax({
type:"post", type: "post",
url: "<%=path %>/unit/delete.action", url: "<%=path %>/unit/delete.action",
dataType: "json", dataType: "json",
data: ({ data: ({
unitID : unitID, unitID: unitID,
clientIp:'<%=clientIp %>' clientIp: '<%=clientIp %>'
}), }),
success: function (tipInfo) { success: function (tipInfo) {
var msg = tipInfo.showModel.msgTip; var msg = tipInfo.showModel.msgTip;
if(msg == '成功') if (msg == '成功') {
{
//加载完以后重新初始化 //加载完以后重新初始化
$("#searchBtn").click(); $("#searchBtn").click();
} }
else else
$.messager.alert('删除提示','删除计量单位失败,请稍后再试!','error'); $.messager.alert('删除提示', '删除计量单位失败,请稍后再试!', 'error');
}, },
//此处添加错误处理 //此处添加错误处理
error:function() { error: function () {
$.messager.alert('删除提示','删除计量单位异常,请稍后再试!','error'); $.messager.alert('删除提示', '删除计量单位异常,请稍后再试!', 'error');
return; return;
} }
}); });
@@ -230,19 +234,16 @@
//批量删除计量单位 //批量删除计量单位
function batDeleteUnit() { function batDeleteUnit() {
var row = $('#tableData').datagrid('getChecked'); var row = $('#tableData').datagrid('getChecked');
if(row.length == 0) { if (row.length == 0) {
$.messager.alert('删除提示','没有记录被选中!','info'); $.messager.alert('删除提示', '没有记录被选中!', 'info');
return; return;
} }
if(row.length > 0) { if (row.length > 0) {
$.messager.confirm('删除确认','确定要删除选中的' + row.length + '条计量单位信息吗?',function(r) { $.messager.confirm('删除确认', '确定要删除选中的' + row.length + '条计量单位信息吗?', function (r) {
if (r) if (r) {
{
var ids = ""; var ids = "";
for(var i = 0;i < row.length; i ++) for (var i = 0; i < row.length; i++) {
{ if (i == row.length - 1) {
if(i == row.length-1)
{
ids += row[i].id; ids += row[i].id;
break; break;
} }
@@ -250,27 +251,27 @@
ids += row[i].id + ","; ids += row[i].id + ",";
} }
$.ajax({ $.ajax({
type:"post", type: "post",
url: "<%=path %>/unit/batchDelete.action", url: "<%=path %>/unit/batchDelete.action",
dataType: "json", dataType: "json",
async : false, async: false,
data: ({ data: ({
unitIDs : ids, unitIDs: ids,
clientIp:'<%=clientIp %>' clientIp: '<%=clientIp %>'
}), }),
success: function (tipInfo) { success: function (tipInfo) {
var msg = tipInfo.showModel.msgTip; var msg = tipInfo.showModel.msgTip;
if(msg == '成功'){ if (msg == '成功') {
//加载完以后重新初始化 //加载完以后重新初始化
$("#searchBtn").click(); $("#searchBtn").click();
$(":checkbox").attr("checked",false); $(":checkbox").attr("checked", false);
} }
else else
$.messager.alert('删除提示','删除计量单位失败,请稍后再试!','error'); $.messager.alert('删除提示', '删除计量单位失败,请稍后再试!', 'error');
}, },
//此处添加错误处理 //此处添加错误处理
error:function(){ error: function () {
$.messager.alert('删除提示','删除计量单位异常,请稍后再试!','error'); $.messager.alert('删除提示', '删除计量单位异常,请稍后再试!', 'error');
return; return;
} }
}); });
@@ -285,10 +286,10 @@
//保存编辑前的名称 //保存编辑前的名称
var orgUnit = ""; var orgUnit = "";
function addUnit(){ function addUnit() {
$("#clientIp").val('<%=clientIp %>'); $("#clientIp").val('<%=clientIp %>');
$('#unitDlg').dialog('open').dialog('setTitle','<img src="<%=path%>/js/easyui-1.3.5/themes/icons/edit_add.png"/>&nbsp;增加计量单位'); $('#unitDlg').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}); $(".window-mask").css({width: webW, height: webH});
$('#unitFM').form('clear'); $('#unitFM').form('clear');
$("#name").focus(); $("#name").focus();
$("#unitName").text(""); $("#unitName").text("");
@@ -299,38 +300,33 @@
//保存信息 //保存信息
$("#saveUnit").unbind().bind({ $("#saveUnit").unbind().bind({
click:function() click: function () {
{ if (!$('#unitFM').form('validate'))
if(!$('#unitFM').form('validate'))
return; return;
else if(checkUnitName()) else if (checkUnitName())
return; return;
else else {
{
var basicName = $.trim($("#basicName").val()); var basicName = $.trim($("#basicName").val());
var otherName = $.trim($("#otherName").val()); var otherName = $.trim($("#otherName").val());
var otherNum = $.trim($("#otherNum").val()); var otherNum = $.trim($("#otherNum").val());
var name = basicName + "," + otherName + "(1:" + otherNum + ")"; var name = basicName + "," + otherName + "(1:" + otherNum + ")";
$.ajax({ $.ajax({
type:"post", type: "post",
url: url, url: url,
dataType: "json", dataType: "json",
async : false, async: false,
data: ({ data: ({
UName : name, UName: name,
clientIp:'<%=clientIp %>' clientIp: '<%=clientIp %>'
}), }),
success: function (tipInfo) success: function (tipInfo) {
{ if (tipInfo) {
if(tipInfo)
{
$('#unitDlg').dialog('close'); $('#unitDlg').dialog('close');
var opts = $("#tableData").datagrid('options'); var opts = $("#tableData").datagrid('options');
showUnitDetails(opts.pageNumber,opts.pageSize); showUnitDetails(opts.pageNumber, opts.pageSize);
} }
else else {
{
$.messager.show({ $.messager.show({
title: '错误提示', title: '错误提示',
msg: '保存计量单位失败,请稍后重试!' msg: '保存计量单位失败,请稍后重试!'
@@ -338,9 +334,8 @@
} }
}, },
//此处添加错误处理 //此处添加错误处理
error:function() error: function () {
{ $.messager.alert('提示', '保存计量单位异常,请稍后再试!', 'error');
$.messager.alert('提示','保存计量单位异常,请稍后再试!','error');
return; return;
} }
}); });
@@ -355,53 +350,49 @@
$("#clientIp").val('<%=clientIp %>'); $("#clientIp").val('<%=clientIp %>');
orgUnit = unitInfo[1]; orgUnit = unitInfo[1];
$('#unitDlg').dialog('open').dialog('setTitle','<img src="<%=path%>/js/easyui-1.3.5/themes/icons/pencil.png"/>&nbsp;编辑计量单位'); $('#unitDlg').dialog('open').dialog('setTitle', '<img src="<%=path%>/js/easyui-1.3.5/themes/icons/pencil.png"/>&nbsp;编辑计量单位');
$(".window-mask").css({ width: webW ,height: webH}); $(".window-mask").css({width: webW, height: webH});
unitID = unitInfo[0]; unitID = unitInfo[0];
//焦点在名称输入框==定焦在输入文字后面 //焦点在名称输入框==定焦在输入文字后面
var name = unitInfo[1]; var name = unitInfo[1];
var basicName = name.substring(0, name.indexOf(",")); //基础单位 var basicName = name.substring(0, name.indexOf(",")); //基础单位
$("#basicName").val(basicName); $("#basicName").val(basicName);
var otherItem = name.substring(name.indexOf(",")+1); var otherItem = name.substring(name.indexOf(",") + 1);
var otherName = otherItem.substring(0,otherItem.indexOf("(")); var otherName = otherItem.substring(0, otherItem.indexOf("("));
$("#otherName").val(otherName); $("#otherName").val(otherName);
var lastNum = otherItem.substring(otherItem.indexOf(":")+1); var lastNum = otherItem.substring(otherItem.indexOf(":") + 1);
lastNum = lastNum.replace(")",""); lastNum = lastNum.replace(")", "");
$("#otherNum").val(lastNum); $("#otherNum").val(lastNum);
$("#unitName").text(basicName); $("#unitName").text(basicName);
url = '<%=path %>/unit/update.action?unitID=' + unitInfo[0]; url = '<%=path %>/unit/update.action?unitID=' + unitInfo[0];
} }
//检查名称是否存在 ++ 重名无法提示问题需要跟进 //检查名称是否存在 ++ 重名无法提示问题需要跟进
function checkUnitName() function checkUnitName() {
{
var name = $.trim($("#name").val()); var name = $.trim($("#name").val());
//表示是否存在 true == 存在 false = 不存在 //表示是否存在 true == 存在 false = 不存在
var flag = false; var flag = false;
//开始ajax名称检验不能重名 //开始ajax名称检验不能重名
if(name.length > 0 &&( orgUnit.length ==0 || name != orgUnit)) if (name.length > 0 && (orgUnit.length == 0 || name != orgUnit)) {
{
$.ajax({ $.ajax({
type:"post", type: "post",
url: "<%=path %>/unit/checkIsNameExist.action", url: "<%=path %>/unit/checkIsNameExist.action",
dataType: "json", dataType: "json",
async : false, async: false,
data: ({ data: ({
unitID : unitID, unitID: unitID,
UName : name UName: name
}), }),
success: function (tipInfo){ success: function (tipInfo) {
flag = tipInfo; flag = tipInfo;
if(tipInfo) if (tipInfo) {
{ $.messager.alert('提示', '计量单位名称已经存在', 'info');
$.messager.alert('提示','计量单位名称已经存在','info');
return; return;
} }
}, },
//此处添加错误处理 //此处添加错误处理
error:function() error: function () {
{ $.messager.alert('提示', '检查计量单位名称是否存在异常,请稍后再试!', 'error');
$.messager.alert('提示','检查计量单位名称是否存在异常,请稍后再试!','error');
return; return;
} }
}); });
@@ -411,40 +402,36 @@
//搜索处理 //搜索处理
$("#searchBtn").unbind().bind({ $("#searchBtn").unbind().bind({
click:function() click: function () {
{ showUnitDetails(1, initPageSize);
showUnitDetails(1,initPageSize);
var opts = $("#tableData").datagrid('options'); var opts = $("#tableData").datagrid('options');
var pager = $("#tableData").datagrid('getPager'); var pager = $("#tableData").datagrid('getPager');
opts.pageNumber = 1; opts.pageNumber = 1;
opts.pageSize = initPageSize; opts.pageSize = initPageSize;
pager.pagination('refresh', pager.pagination('refresh',
{ {
pageNumber:1, pageNumber: 1,
pageSize:initPageSize pageSize: initPageSize
}); });
} }
}); });
function showUnitDetails(pageNo,pageSize) function showUnitDetails(pageNo, pageSize) {
{
$.ajax({ $.ajax({
type:"post", type: "post",
url: "<%=path %>/unit/findBy.action", url: "<%=path %>/unit/findBy.action",
dataType: "json", dataType: "json",
data: ({ data: ({
UName:$.trim($("#searchName").val()), UName: $.trim($("#searchName").val()),
pageNo:pageNo, pageNo: pageNo,
pageSize:pageSize pageSize: pageSize
}), }),
success: function (data) success: function (data) {
{ $("#tableData").datagrid('loadData', data);
$("#tableData").datagrid('loadData',data);
}, },
//此处添加错误处理 //此处添加错误处理
error:function() error: function () {
{ $.messager.alert('查询提示', '查询数据后台异常,请稍后再试!', 'error');
$.messager.alert('查询提示','查询数据后台异常,请稍后再试!','error');
return; return;
} }
}); });
@@ -452,7 +439,7 @@
//重置按钮 //重置按钮
$("#searchResetBtn").unbind().bind({ $("#searchResetBtn").unbind().bind({
click:function(){ click: function () {
$("#searchName").val(""); $("#searchName").val("");
//加载完以后重新初始化 //加载完以后重新初始化
$("#searchBtn").click(); $("#searchBtn").click();
@@ -460,9 +447,9 @@
}); });
//单位名称事件 //单位名称事件
$("#basicName").off("keyup").on("keyup", function(){ $("#basicName").off("keyup").on("keyup", function () {
$("#unitName").text($(this).val()); $("#unitName").text($(this).val());
}); });
</script> </script>
</body> </body>
</html> </html>

View File

@@ -1,32 +1,33 @@
<%@page import="com.jsh.util.Tools"%> <%@page import="com.jsh.util.Tools" %>
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%> <%@ page language="java" pageEncoding="utf-8" %>
<% <%
String path = request.getContextPath(); String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/"; String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + path + "/";
String clientIp = Tools.getLocalIp(request); String clientIp = Tools.getLocalIp(request);
%> %>
<!DOCTYPE html> <!DOCTYPE html>
<html> <html>
<head> <head>
<title>用户管理</title> <title>用户管理</title>
<meta charset="utf-8"> <meta charset="utf-8">
<!-- 指定以IE8的方式来渲染 --> <!-- 指定以IE8的方式来渲染 -->
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE8"/> <meta http-equiv="X-UA-Compatible" content="IE=EmulateIE8"/>
<link rel="shortcut icon" href="<%=path%>/images/favicon.ico" type="image/x-icon" /> <link rel="shortcut icon" href="<%=path%>/images/favicon.ico" type="image/x-icon"/>
<script type="text/javascript" src="<%=path %>/js/jquery-1.8.0.min.js"></script> <script type="text/javascript" src="<%=path %>/js/jquery-1.8.0.min.js"></script>
<script type="text/javascript" src="<%=path %>/js/colorbox/jquery.colorbox-min.js"></script> <script type="text/javascript" src="<%=path %>/js/colorbox/jquery.colorbox-min.js"></script>
<script type="text/javascript" src="<%=path %>/js/colorbox/colorboxSet.js"></script> <script type="text/javascript" src="<%=path %>/js/colorbox/colorboxSet.js"></script>
<link href="<%=path %>/js/colorbox/colorbox.css" rel="stylesheet" type="text/css" /> <link href="<%=path %>/js/colorbox/colorbox.css" rel="stylesheet" type="text/css"/>
<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/default/easyui.css"/>
<link rel="stylesheet" type="text/css" href="<%=path %>/js/easyui-1.3.5/themes/icon.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" /> <link type="text/css" rel="stylesheet" href="<%=path %>/css/common.css"/>
<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/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/locale/easyui-lang-zh_CN.js"></script>
<script type="text/javascript" src="<%=path %>/js/common/common.js"></script> <script type="text/javascript" src="<%=path %>/js/common/common.js"></script>
</head> </head>
<body> <body>
<!-- 查询 --> <!-- 查询 -->
<div id = "searchPanel" class="easyui-panel" style="padding:10px;" title="查询窗口" iconCls="icon-search" collapsible="true" closable="false"> <div id="searchPanel" class="easyui-panel" style="padding:10px;" title="查询窗口" iconCls="icon-search" collapsible="true"
closable="false">
<table id="searchTable"> <table id="searchTable">
<tr> <tr>
<td>用户名称:</td> <td>用户名称:</td>
@@ -51,23 +52,26 @@
</td> </td>
</tr> </tr>
</table> </table>
</div> </div>
<!-- 数据显示table --> <!-- 数据显示table -->
<div id = "tablePanel" class="easyui-panel" style="padding:1px;top:300px;" title="用户列表" iconCls="icon-list" collapsible="true" closable="false"> <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> <table id="tableData" style="top:300px;border-bottom-color:#FFFFFF"></table>
</div> </div>
<div id="userDlg" class="easyui-dialog" style="width:380px;padding:10px 20px" <div id="userDlg" class="easyui-dialog" style="width:380px;padding:10px 20px"
closed="true" buttons="#dlg-buttons" modal="true" collapsible="false" closable="true"> closed="true" buttons="#dlg-buttons" modal="true" collapsible="false" closable="true">
<form id="usernameFM" method="post" novalidate> <form id="usernameFM" method="post" novalidate>
<div class="fitem" style="padding:5px"> <div class="fitem" style="padding:5px">
<label id="usernameLabel">用户名称&nbsp;&nbsp;</label> <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"/> <input name="username" id="username" class="easyui-validatebox"
data-options="required:true,validType:'length[2,30]'" style="width: 230px;height: 20px"/>
</div> </div>
<div class="fitem" style="padding:5px"> <div class="fitem" style="padding:5px">
<label id="loginameLabel">登录名称 &nbsp;&nbsp;</label> <label id="loginameLabel">登录名称 &nbsp;&nbsp;</label>
<input name="loginame" id="loginame" class="easyui-validatebox" data-options="required:true,validType:'length[2,15]'" style="width: 120px;height: 20px"/> <input name="loginame" id="loginame" class="easyui-validatebox"
data-options="required:true,validType:'length[2,15]'" style="width: 120px;height: 20px"/>
初始密码123456 初始密码123456
</div> </div>
<div class="fitem" style="padding:5px"> <div class="fitem" style="padding:5px">
@@ -84,7 +88,8 @@
</div> </div>
<div class="fitem" style="padding:5px"> <div class="fitem" style="padding:5px">
<label id="emailLabel">电子邮箱&nbsp;&nbsp;</label> <label id="emailLabel">电子邮箱&nbsp;&nbsp;</label>
<input name="email" id="email" class="easyui-validatebox" validType="email" style="width: 230px;height: 20px"/> <input name="email" id="email" class="easyui-validatebox" validType="email"
style="width: 230px;height: 20px"/>
</div> </div>
<div class="fitem" style="padding:5px"> <div class="fitem" style="padding:5px">
<label id="descriptionLabel">描&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;述&nbsp;&nbsp;</label> <label id="descriptionLabel">描&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;述&nbsp;&nbsp;</label>
@@ -92,26 +97,24 @@
</div> </div>
<input type="hidden" name="clientIp" id="clientIp" value="<%=clientIp %>"/> <input type="hidden" name="clientIp" id="clientIp" value="<%=clientIp %>"/>
</form> </form>
</div> </div>
<div id="dlg-buttons"> <div id="dlg-buttons">
<a href="javascript:void(0)" id="resetPwd" class="easyui-linkbutton" iconCls="icon-redo">重置密码</a> <a href="javascript:void(0)" id="resetPwd" class="easyui-linkbutton" iconCls="icon-redo">重置密码</a>
<a href="javascript:void(0)" id="saveusername" class="easyui-linkbutton" iconCls="icon-ok">保存</a> <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> <a href="javascript:void(0)" id="cancelusername" class="easyui-linkbutton" iconCls="icon-cancel"
</div> onclick="javascript:$('#userDlg').dialog('close')">取消</a>
<script type="text/javascript"> </div>
<script type="text/javascript">
//初始化界面 //初始化界面
$(function() $(function () {
{
initTableData(); initTableData();
ininPager(); ininPager();
browserFit(); browserFit();
}); });
//浏览器适配 //浏览器适配
function browserFit() function browserFit() {
{ if (getOs() == 'MSIE') {
if(getOs()=='MSIE')
{
$("#usernameLabel").empty().append("用户名称&nbsp;&nbsp;"); $("#usernameLabel").empty().append("用户名称&nbsp;&nbsp;");
$("#loginameLabel").empty().append("登录名称&nbsp;&nbsp;"); $("#loginameLabel").empty().append("登录名称&nbsp;&nbsp;");
$("#departmentLabel").empty().append("部&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;门&nbsp;&nbsp;"); $("#departmentLabel").empty().append("部&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;门&nbsp;&nbsp;");
@@ -123,8 +126,7 @@
$("#searchDeptLabel").empty().append("部&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;门:"); $("#searchDeptLabel").empty().append("部&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;门:");
$("#searchDescLabel").empty().append("描&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;述:"); $("#searchDescLabel").empty().append("描&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;述:");
} }
else else {
{
$("#usernameLabel").empty().append("用户名称&nbsp;"); $("#usernameLabel").empty().append("用户名称&nbsp;");
$("#loginameLabel").empty().append("登录名称&nbsp;"); $("#loginameLabel").empty().append("登录名称&nbsp;");
$("#departmentLabel").empty().append("部&nbsp;&nbsp;&nbsp;&nbsp;门&nbsp;"); $("#departmentLabel").empty().append("部&nbsp;&nbsp;&nbsp;&nbsp;门&nbsp;");
@@ -139,43 +141,41 @@
} }
//初始化表格数据 //初始化表格数据
function initTableData() function initTableData() {
{
$('#tableData').datagrid({ $('#tableData').datagrid({
height:heightInfo, height: heightInfo,
nowrap: false, nowrap: false,
rownumbers: false, rownumbers: false,
//动画效果 //动画效果
animate:false, animate: false,
//选中单行 //选中单行
singleSelect : true, singleSelect: true,
collapsible:false, collapsible: false,
url:'<%=path %>/user/findBy.action?pageSize=' + initPageSize, url: '<%=path %>/user/findBy.action?pageSize=' + initPageSize,
pagination: true, pagination: true,
//交替出现背景 //交替出现背景
striped : true, striped: true,
pageSize: initPageSize, pageSize: initPageSize,
pageList: initPageNum, pageList: initPageNum,
columns:[[ columns: [[
{ field: 'id',width:35,align:"center",checkbox:true}, {field: 'id', width: 35, align: "center", checkbox: true},
{ title: '用户名称',field: 'username',width:80}, {title: '用户名称', field: 'username', width: 80},
{ title: '登录名称', field: 'loginame',width:80,align:"center"}, {title: '登录名称', field: 'loginame', width: 80, align: "center"},
{ title: '职位', field: 'position',width:115,align:"center"}, {title: '职位', field: 'position', width: 115, align: "center"},
{ title: '部门',field: 'department',width:115,align:"center"}, {title: '部门', field: 'department', width: 115, align: "center"},
{ title: '电子邮箱',field: 'email',width:150,align:"center"}, {title: '电子邮箱', field: 'email', width: 150, align: "center"},
{ title: '电话号码',field: 'phonenum',width:150,align:"center"}, {title: '电话号码', field: 'phonenum', width: 150, align: "center"},
{ title: '描述',field: 'description',width:150}, {title: '描述', field: 'description', width: 150},
{ title: '操作',field: 'op',width:160,formatter:function(value,rec)
{ {
title: '操作', field: 'op', width: 160, formatter: function (value, rec) {
var str = ''; var str = '';
var rowInfo = rec.id + 'AaBb' + rec.username +'AaBb' + rec.loginame + 'AaBb'+ rec.position var rowInfo = rec.id + 'AaBb' + rec.username + 'AaBb' + rec.loginame + 'AaBb' + rec.position
+ 'AaBb'+ rec.department + 'AaBb'+ rec.email + 'AaBb'+ rec.phonenum + 'AaBb'+ rec.ismanager + 'AaBb' + rec.department + 'AaBb' + rec.email + 'AaBb' + rec.phonenum + 'AaBb' + rec.ismanager
+ 'AaBb' + rec.isystem + 'AaBb' + rec.description; + 'AaBb' + rec.isystem + 'AaBb' + rec.description;
if(1 == value) if (1 == value) {
{
str += '<img src="<%=path%>/js/easyui-1.3.5/themes/icons/pencil.png" style="cursor: pointer;" onclick="editUser(\'' + rowInfo + '\');"/>&nbsp;<a onclick="editUser(\'' + 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/pencil.png" style="cursor: pointer;" onclick="editUser(\'' + rowInfo + '\');"/>&nbsp;<a onclick="editUser(\'' + 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="deleteUser('+ rec.id +');"/>&nbsp;<a onclick="deleteUser('+ rec.id +');" 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="deleteUser(' + rec.id + ');"/>&nbsp;<a onclick="deleteUser(' + rec.id + ');" style="text-decoration:none;color:black;" href="javascript:void(0)">删除</a>&nbsp;&nbsp;';
//str += '<img src="<%=path%>/images/user.png" style="cursor: pointer;width: 16px;height: 16px" onclick="editUser(\'' + rowInfo + '\');"/>&nbsp;<a onclick="editUser(\'' + rowInfo + '\');" style="text-decoration:none;color:black;" href="javascript:void(0)">用户</a>&nbsp;&nbsp;'; //str += '<img src="<%=path%>/images/user.png" style="cursor: pointer;width: 16px;height: 16px" onclick="editUser(\'' + rowInfo + '\');"/>&nbsp;<a onclick="editUser(\'' + rowInfo + '\');" style="text-decoration:none;color:black;" href="javascript:void(0)">用户</a>&nbsp;&nbsp;';
} }
//else //else
@@ -186,103 +186,89 @@
} }
} }
]], ]],
toolbar:[ toolbar: [
{
id:'addUser',
text:'增加',
iconCls:'icon-add',
handler:function()
{ {
id: 'addUser',
text: '增加',
iconCls: 'icon-add',
handler: function () {
addUser(); addUser();
} }
}, },
{ {
id:'deleteUser', id: 'deleteUser',
text:'删除', text: '删除',
iconCls:'icon-remove', iconCls: 'icon-remove',
handler:function() handler: function () {
{
batDeleteUser(); batDeleteUser();
} }
} }
], ],
onLoadError:function() onLoadError: function () {
{ $.messager.alert('页面加载提示', '页面加载异常,请稍后再试!', 'error');
$.messager.alert('页面加载提示','页面加载异常,请稍后再试!','error');
return; return;
} }
}); });
} }
//初始化键盘enter事件 //初始化键盘enter事件
$(document).keydown(function(event) $(document).keydown(function (event) {
{
//兼容 IE和firefox 事件 //兼容 IE和firefox 事件
var e = window.event || event; var e = window.event || event;
var k = e.keyCode||e.which||e.charCode; var k = e.keyCode || e.which || e.charCode;
//兼容 IE,firefox 兼容 //兼容 IE,firefox 兼容
var obj = e.srcElement ? e.srcElement : e.target; var obj = e.srcElement ? e.srcElement : e.target;
//绑定键盘事件为 id是指定的输入框才可以触发键盘事件 13键盘事件 //绑定键盘事件为 id是指定的输入框才可以触发键盘事件 13键盘事件
if(k == "13"&&(obj.id=="username" || obj.id=="department"|| obj.id=="phonenum" if (k == "13" && (obj.id == "username" || obj.id == "department" || obj.id == "phonenum"
|| obj.id=="email" || obj.id=="description" || obj.id=="position")) || obj.id == "email" || obj.id == "description" || obj.id == "position")) {
{
$("#saveusername").click(); $("#saveusername").click();
} }
//搜索按钮添加快捷键 //搜索按钮添加快捷键
if(k == "13"&&(obj.id=="searchUsername" || obj.id=="searchLoginame"|| obj.id=="searchPhonenum" if (k == "13" && (obj.id == "searchUsername" || obj.id == "searchLoginame" || obj.id == "searchPhonenum"
|| obj.id=="searchPosition"|| obj.id=="searchEmail" || obj.id=="searchDesc" || obj.id=="searchDept" )) || obj.id == "searchPosition" || obj.id == "searchEmail" || obj.id == "searchDesc" || obj.id == "searchDept")) {
{
$("#searchBtn").click(); $("#searchBtn").click();
} }
}); });
//分页信息处理 //分页信息处理
function ininPager() function ininPager() {
{ try {
try
{
var opts = $("#tableData").datagrid('options'); var opts = $("#tableData").datagrid('options');
var pager = $("#tableData").datagrid('getPager'); var pager = $("#tableData").datagrid('getPager');
pager.pagination({ pager.pagination({
onSelectPage:function(pageNum, pageSize) onSelectPage: function (pageNum, pageSize) {
{
opts.pageNumber = pageNum; opts.pageNumber = pageNum;
opts.pageSize = pageSize; opts.pageSize = pageSize;
pager.pagination('refresh', pager.pagination('refresh',
{ {
pageNumber:pageNum, pageNumber: pageNum,
pageSize:pageSize pageSize: pageSize
}); });
showUserDetails(pageNum,pageSize); showUserDetails(pageNum, pageSize);
} }
}); });
} }
catch (e) catch (e) {
{ $.messager.alert('异常处理提示', "分页信息异常 : " + e.name + ": " + e.message, 'error');
$.messager.alert('异常处理提示',"分页信息异常 : " + e.name + ": " + e.message,'error');
} }
} }
//删除用户信息 //删除用户信息
function deleteUser(userID) function deleteUser(userID) {
{ $.messager.confirm('删除确认', '确定要删除此用户信息吗?', function (r) {
$.messager.confirm('删除确认','确定要删除此用户信息吗?',function(r) if (r) {
{
if (r)
{
$.ajax({ $.ajax({
type:"post", type: "post",
url: "<%=path %>/user/delete.action", url: "<%=path %>/user/delete.action",
dataType: "json", dataType: "json",
data: ({ data: ({
userID : userID, userID: userID,
clientIp:'<%=clientIp %>' clientIp: '<%=clientIp %>'
}), }),
success: function (tipInfo) success: function (tipInfo) {
{
var msg = tipInfo.showModel.msgTip; var msg = tipInfo.showModel.msgTip;
if(msg == '成功') if (msg == '成功') {
{
//$('#tableData').datagrid('reload'); //$('#tableData').datagrid('reload');
//加载完以后重新初始化 //加载完以后重新初始化
$("#searchBtn").click(); $("#searchBtn").click();
@@ -290,12 +276,11 @@
//showUserDetails(opts.pageNumber,opts.pageSize); //showUserDetails(opts.pageNumber,opts.pageSize);
} }
else else
$.messager.alert('删除提示','删除用户信息失败,请稍后再试!','error'); $.messager.alert('删除提示', '删除用户信息失败,请稍后再试!', 'error');
}, },
//此处添加错误处理 //此处添加错误处理
error:function() error: function () {
{ $.messager.alert('删除提示', '删除用户信息异常,请稍后再试!', 'error');
$.messager.alert('删除提示','删除用户信息异常,请稍后再试!','error');
return; return;
} }
}); });
@@ -304,56 +289,46 @@
} }
//批量删除用户 //批量删除用户
function batDeleteUser() function batDeleteUser() {
{
var row = $('#tableData').datagrid('getChecked'); var row = $('#tableData').datagrid('getChecked');
if(row.length == 0) if (row.length == 0) {
{ $.messager.alert('删除提示', '没有记录被选中!', 'info');
$.messager.alert('删除提示','没有记录被选中!','info');
return; return;
} }
if(row.length > 0) if (row.length > 0) {
{ $.messager.confirm('删除确认', '确定要删除选中的' + row.length + '条用户信息吗?', function (r) {
$.messager.confirm('删除确认','确定要删除选中的' + row.length + '条用户信息吗?',function(r) if (r) {
{
if (r)
{
var ids = ""; var ids = "";
for(var i = 0;i < row.length; i ++) for (var i = 0; i < row.length; i++) {
{ if (i == row.length - 1) {
if(i == row.length-1)
{
ids += row[i].id; ids += row[i].id;
break; break;
} }
ids += row[i].id + ","; ids += row[i].id + ",";
} }
$.ajax({ $.ajax({
type:"post", type: "post",
url: "<%=path %>/user/batchDelete.action", url: "<%=path %>/user/batchDelete.action",
dataType: "json", dataType: "json",
async : false, async: false,
data: ({ data: ({
userIDs : ids, userIDs: ids,
clientIp:'<%=clientIp %>' clientIp: '<%=clientIp %>'
}), }),
success: function (tipInfo) success: function (tipInfo) {
{
var msg = tipInfo.showModel.msgTip; var msg = tipInfo.showModel.msgTip;
if(msg == '成功') if (msg == '成功') {
{
//$('#tableData').datagrid('reload'); //$('#tableData').datagrid('reload');
//加载完以后重新初始化 //加载完以后重新初始化
$("#searchBtn").click(); $("#searchBtn").click();
$(":checkbox").attr("checked",false); $(":checkbox").attr("checked", false);
} }
else else
$.messager.alert('删除提示','删除用户信息失败,请稍后再试!','error'); $.messager.alert('删除提示', '删除用户信息失败,请稍后再试!', 'error');
}, },
//此处添加错误处理 //此处添加错误处理
error:function() error: function () {
{ $.messager.alert('删除提示', '删除用户信息异常,请稍后再试!', 'error');
$.messager.alert('删除提示','删除用户信息异常,请稍后再试!','error');
return; return;
} }
}); });
@@ -368,15 +343,14 @@
//保存编辑前的名称 //保存编辑前的名称
var orgusername = ""; var orgusername = "";
function addUser() function addUser() {
{ $('#userDlg').dialog('open').dialog('setTitle', '<img src="<%=path%>/js/easyui-1.3.5/themes/icons/edit_add.png"/>&nbsp;增加用户');
$('#userDlg').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});
$(".window-mask").css({ width: webW ,height: webH});
$('#usernameFM').form('clear'); $('#usernameFM').form('clear');
var row = { var row = {
clientIp:'<%=clientIp %>' clientIp: '<%=clientIp %>'
}; };
$('#usernameFM').form('load',row); $('#usernameFM').form('load', row);
$("#username").focus(); $("#username").focus();
orgusername = ""; orgusername = "";
userID = 0; userID = 0;
@@ -384,7 +358,7 @@
} }
//重置用户密码 //重置用户密码
$("#resetPwd").off("click").on("click",function() { $("#resetPwd").off("click").on("click", function () {
$.messager.confirm('重置用户密码', '确定重置该用户的密码为123456吗', function (r) { $.messager.confirm('重置用户密码', '确定重置该用户的密码为123456吗', function (r) {
if (r) { if (r) {
$.ajax({ $.ajax({
@@ -414,44 +388,38 @@
//保存用户信息 //保存用户信息
$("#saveusername").unbind().bind({ $("#saveusername").unbind().bind({
click:function() click: function () {
{ if (checkusernameName())
if(checkusernameName())
return; return;
var reg = /^([0-9])+$/; var reg = /^([0-9])+$/;
var phonenum = $.trim($("#phonenum").val()); var phonenum = $.trim($("#phonenum").val());
if(phonenum.length>0 && !reg.test(phonenum)) if (phonenum.length > 0 && !reg.test(phonenum)) {
{ $.messager.alert('提示', '电话号码只能是数字', 'info');
$.messager.alert('提示','电话号码只能是数字','info');
$("#phonenum").val("").focus(); $("#phonenum").val("").focus();
return; return;
} }
$('#usernameFM').form('submit',{ $('#usernameFM').form('submit', {
url: url, url: url,
onSubmit: function() onSubmit: function () {
{
return $(this).form('validate'); return $(this).form('validate');
}, },
success: function(result) success: function (result) {
{ var result = eval('(' + result + ')');
var result = eval('('+result+')'); if (!result) {
if (!result)
{
$.messager.show({ $.messager.show({
title: '错误提示', title: '错误提示',
msg: '保存用户信息失败,请稍后重试!' msg: '保存用户信息失败,请稍后重试!'
}); });
} }
else else {
{
$('#userDlg').dialog('close'); $('#userDlg').dialog('close');
//$('#tableData').datagrid('reload'); //$('#tableData').datagrid('reload');
//加载完以后重新初始化 //加载完以后重新初始化
//$("#searchBtn").click(); //$("#searchBtn").click();
var opts = $("#tableData").datagrid('options'); var opts = $("#tableData").datagrid('options');
showUserDetails(opts.pageNumber,opts.pageSize); showUserDetails(opts.pageNumber, opts.pageSize);
} }
} }
}); });
@@ -459,23 +427,22 @@
}); });
//编辑用户信息 //编辑用户信息
function editUser(usernameTotalInfo) function editUser(usernameTotalInfo) {
{
var usernameInfo = usernameTotalInfo.split("AaBb"); var usernameInfo = usernameTotalInfo.split("AaBb");
var row = { var row = {
username : usernameInfo[1], username: usernameInfo[1],
loginame : usernameInfo[2], loginame: usernameInfo[2],
position : usernameInfo[3], position: usernameInfo[3],
department : usernameInfo[4], department: usernameInfo[4],
email : usernameInfo[5], email: usernameInfo[5],
phonenum : usernameInfo[6], phonenum: usernameInfo[6],
description : usernameInfo[9], description: usernameInfo[9],
clientIp:'<%=clientIp %>' clientIp: '<%=clientIp %>'
}; };
orgusername = usernameInfo[1]; orgusername = usernameInfo[1];
$('#userDlg').dialog('open').dialog('setTitle','<img src="<%=path%>/js/easyui-1.3.5/themes/icons/pencil.png"/>&nbsp;编辑用户信息'); $('#userDlg').dialog('open').dialog('setTitle', '<img src="<%=path%>/js/easyui-1.3.5/themes/icons/pencil.png"/>&nbsp;编辑用户信息');
$(".window-mask").css({ width: webW ,height: webH}); $(".window-mask").css({width: webW, height: webH});
$('#usernameFM').form('load',row); $('#usernameFM').form('load', row);
userID = usernameInfo[0]; userID = usernameInfo[0];
//焦点在名称输入框==定焦在输入文字后面 //焦点在名称输入框==定焦在输入文字后面
$("#username").val("").focus().val(usernameInfo[1]); $("#username").val("").focus().val(usernameInfo[1]);
@@ -487,38 +454,33 @@
//}); //});
//检查用户 名称是否存在 ++ 重名无法提示问题需要跟进 //检查用户 名称是否存在 ++ 重名无法提示问题需要跟进
function checkusernameName() function checkusernameName() {
{
var usernameName = $.trim($("#username").val()); var usernameName = $.trim($("#username").val());
//表示是否存在 true == 存在 false = 不存在 //表示是否存在 true == 存在 false = 不存在
var flag = false; var flag = false;
//开始ajax名称检验不能重名 //开始ajax名称检验不能重名
if(usernameName.length > 0 &&( orgusername.length ==0 || usernameName != orgusername)) if (usernameName.length > 0 && (orgusername.length == 0 || usernameName != orgusername)) {
{
$.ajax({ $.ajax({
type:"post", type: "post",
url: "<%=path %>/user/checkIsNameExist.action", url: "<%=path %>/user/checkIsNameExist.action",
dataType: "json", dataType: "json",
async : false, async: false,
data: ({ data: ({
userID : userID, userID: userID,
username : usernameName username: usernameName
}), }),
success: function (tipInfo) success: function (tipInfo) {
{
flag = tipInfo; flag = tipInfo;
if(tipInfo) if (tipInfo) {
{ $.messager.alert('提示', '用户名称已经存在', 'info');
$.messager.alert('提示','用户名称已经存在','info');
//alert("用户名称已经存在"); //alert("用户名称已经存在");
//$("#username").val(""); //$("#username").val("");
return; return;
} }
}, },
//此处添加错误处理 //此处添加错误处理
error:function() error: function () {
{ $.messager.alert('提示', '检查用户名称是否存在异常,请稍后再试!', 'error');
$.messager.alert('提示','检查用户名称是否存在异常,请稍后再试!','error');
return; return;
} }
}); });
@@ -528,42 +490,38 @@
//搜索处理 //搜索处理
$("#searchBtn").unbind().bind({ $("#searchBtn").unbind().bind({
click:function() click: function () {
{ showUserDetails(1, initPageSize);
showUserDetails(1,initPageSize);
var opts = $("#tableData").datagrid('options'); var opts = $("#tableData").datagrid('options');
var pager = $("#tableData").datagrid('getPager'); var pager = $("#tableData").datagrid('getPager');
opts.pageNumber = 1; opts.pageNumber = 1;
opts.pageSize = initPageSize; opts.pageSize = initPageSize;
pager.pagination('refresh', pager.pagination('refresh',
{ {
pageNumber:1, pageNumber: 1,
pageSize:initPageSize pageSize: initPageSize
}); });
} }
}); });
function showUserDetails(pageNo,pageSize) function showUserDetails(pageNo, pageSize) {
{
$.ajax({ $.ajax({
type:"post", type: "post",
url: "<%=path %>/user/findBy.action", url: "<%=path %>/user/findBy.action",
dataType: "json", dataType: "json",
data: ({ data: ({
username:$.trim($("#searchUsername").val()), username: $.trim($("#searchUsername").val()),
loginame:$.trim($("#searchLoginame").val()), loginame: $.trim($("#searchLoginame").val()),
pageNo:pageNo, pageNo: pageNo,
pageSize:pageSize pageSize: pageSize
}), }),
success: function (data) success: function (data) {
{ $("#tableData").datagrid('loadData', data);
$("#tableData").datagrid('loadData',data);
//$('#tableData').datagrid('reload'); //$('#tableData').datagrid('reload');
}, },
//此处添加错误处理 //此处添加错误处理
error:function() error: function () {
{ $.messager.alert('查询提示', '查询数据后台异常,请稍后再试!', 'error');
$.messager.alert('查询提示','查询数据后台异常,请稍后再试!','error');
return; return;
} }
}); });
@@ -571,7 +529,7 @@
//重置按钮 //重置按钮
$("#searchResetBtn").unbind().bind({ $("#searchResetBtn").unbind().bind({
click:function(){ click: function () {
$("#searchUsername").val(""); $("#searchUsername").val("");
$("#searchLoginame").val(""); $("#searchLoginame").val("");
$("#searchPhonenum").val(""); $("#searchPhonenum").val("");
@@ -615,6 +573,6 @@
} }
this.href = "<%=path %>/pages/user/userCustomer.jsp?id=" + currentRow.id; this.href = "<%=path %>/pages/user/userCustomer.jsp?id=" + currentRow.id;
}); });
</script> </script>
</body> </body>
</html> </html>

View File

@@ -1,20 +1,20 @@
<%@page import="com.jsh.util.Tools"%> <%@page import="com.jsh.util.Tools" %>
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%> <%@ page language="java" pageEncoding="utf-8" %>
<% <%
String path = request.getContextPath(); String path = request.getContextPath();
String clientIp = Tools.getLocalIp(request); String clientIp = Tools.getLocalIp(request);
%> %>
<!DOCTYPE html> <!DOCTYPE html>
<html> <html>
<head> <head>
<title>供应商信息</title> <title>供应商信息</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<!-- 指定以IE8的方式来渲染 --> <!-- 指定以IE8的方式来渲染 -->
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE8"/> <meta http-equiv="X-UA-Compatible" content="IE=EmulateIE8"/>
<link rel="shortcut icon" href="<%=path%>/images/favicon.ico" type="image/x-icon" /> <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/default/easyui.css"/>
<link rel="stylesheet" type="text/css" href="<%=path %>/js/easyui-1.3.5/themes/icon.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" /> <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/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/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/locale/easyui-lang-zh_CN.js"></script>
@@ -25,10 +25,11 @@
var path = "<%=path%>"; var path = "<%=path%>";
var clientIp = "<%=clientIp%>"; var clientIp = "<%=clientIp%>";
</script> </script>
</head> </head>
<body> <body>
<!-- 查询 --> <!-- 查询 -->
<div id = "searchPanel" class="easyui-panel" style="padding:10px;" title="查询窗口" iconCls="icon-search" collapsible="true" closable="false"> <div id="searchPanel" class="easyui-panel" style="padding:10px;" title="查询窗口" iconCls="icon-search" collapsible="true"
closable="false">
<table id="searchTable"> <table id="searchTable">
<tr> <tr>
<td>名&nbsp;&nbsp;&nbsp;&nbsp;称:</td> <td>名&nbsp;&nbsp;&nbsp;&nbsp;称:</td>
@@ -57,20 +58,22 @@
</td> </td>
</tr> </tr>
</table> </table>
</div> </div>
<!-- 数据显示table --> <!-- 数据显示table -->
<div id = "tablePanel" class="easyui-panel" style="padding:1px;top:300px;" title="供应商信息列表" iconCls="icon-list" collapsible="true" closable="false"> <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> <table id="tableData" style="top:300px;border-bottom-color:#FFFFFF"></table>
</div> </div>
<div id="supplierDlg" class="easyui-dialog" style="width:580px;padding:10px 20px" <div id="supplierDlg" class="easyui-dialog" style="width:580px;padding:10px 20px"
closed="true" buttons="#dlg-buttons" modal="true" collapsible="false" closable="true"> closed="true" buttons="#dlg-buttons" modal="true" collapsible="false" closable="true">
<form id="supplierFM"> <form id="supplierFM">
<table> <table>
<tr> <tr>
<td style="width: 80px;height: 20px">名称</td> <td style="width: 80px;height: 20px">名称</td>
<td style="width: 180px;padding:1px"> <td style="width: 180px;padding:1px">
<input name="supplier" id="supplier" class="easyui-validatebox" data-options="required:true,validType:'length[2,30]'" style="width: 160px;height: 20px"/> <input name="supplier" id="supplier" class="easyui-validatebox"
data-options="required:true,validType:'length[2,30]'" style="width: 160px;height: 20px"/>
</td> </td>
<td style="width: 60px;height: 20px">联系人</td> <td style="width: 60px;height: 20px">联系人</td>
<td style="width:180px;padding:1px;"> <td style="width:180px;padding:1px;">
@@ -80,11 +83,13 @@
<tr> <tr>
<td>手机号码</td> <td>手机号码</td>
<td style="padding:1px;"> <td style="padding:1px;">
<input name="telephone" id="telephone" class="easyui-validatebox" style="width: 160px;height: 20px"/> <input name="telephone" id="telephone" class="easyui-validatebox"
style="width: 160px;height: 20px"/>
</td> </td>
<td>电子邮箱</td> <td>电子邮箱</td>
<td style="padding:1px"> <td style="padding:1px">
<input name="email" id="email" class="easyui-validatebox" validType="email" style="width: 160px;height: 20px"/> <input name="email" id="email" class="easyui-validatebox" validType="email"
style="width: 160px;height: 20px"/>
</td> </td>
</tr> </tr>
<tr> <tr>
@@ -100,21 +105,25 @@
<tr> <tr>
<td>期初应收</td> <td>期初应收</td>
<td style="padding:1px"> <td style="padding:1px">
<input name="BeginNeedGet" id="BeginNeedGet" type="text" class="easyui-numberbox" data-options="min:0,precision:2" style="width: 160px;height: 20px" /> <input name="BeginNeedGet" id="BeginNeedGet" type="text" class="easyui-numberbox"
data-options="min:0,precision:2" style="width: 160px;height: 20px"/>
</td> </td>
<td>期初应付</td> <td>期初应付</td>
<td style="padding:1px"> <td style="padding:1px">
<input name="BeginNeedPay" id="BeginNeedPay" type="text" class="easyui-numberbox" data-options="min:0,precision:2" style="width: 160px;height: 20px" /> <input name="BeginNeedPay" id="BeginNeedPay" type="text" class="easyui-numberbox"
data-options="min:0,precision:2" style="width: 160px;height: 20px"/>
</td> </td>
</tr> </tr>
<tr> <tr>
<td>累计应收</td> <td>累计应收</td>
<td style="padding:1px"> <td style="padding:1px">
<input name="AllNeedGet" id="AllNeedGet" type="text" style="width: 160px;height: 20px" readonly="readonly" /> <input name="AllNeedGet" id="AllNeedGet" type="text" style="width: 160px;height: 20px"
readonly="readonly"/>
</td> </td>
<td>累计应付</td> <td>累计应付</td>
<td style="padding:1px"> <td style="padding:1px">
<input name="AllNeedPay" id="AllNeedPay" type="text" style="width: 160px;height: 20px" readonly="readonly" /> <input name="AllNeedPay" id="AllNeedPay" type="text" style="width: 160px;height: 20px"
readonly="readonly"/>
</td> </td>
</tr> </tr>
<tr> <tr>
@@ -134,7 +143,8 @@
</td> </td>
<td>账号</td> <td>账号</td>
<td style="padding:1px"> <td style="padding:1px">
<input name="accountNumber" id="accountNumber" class="easyui-validatebox" style="width: 160px;height: 20px"/> <input name="accountNumber" id="accountNumber" class="easyui-validatebox"
style="width: 160px;height: 20px"/>
</td> </td>
</tr> </tr>
<tr> <tr>
@@ -151,15 +161,17 @@
</tr> </tr>
</table> </table>
</form> </form>
</div> </div>
<div id="dlg-buttons"> <div id="dlg-buttons">
<a href="javascript:void(0)" id="saveSupplier" class="easyui-linkbutton" iconCls="icon-ok">保存</a> <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> <a href="javascript:void(0)" id="cancelSupplier" class="easyui-linkbutton" iconCls="icon-cancel"
</div> onclick="javascript:$('#supplierDlg').dialog('close')">取消</a>
</div>
<!-- 导入excel表格 --> <!-- 导入excel表格 -->
<div id="importExcelDlg" style="padding:10px 20px"> <div id="importExcelDlg" style="padding:10px 20px">
<form id="importExcelFM" method="post" enctype="multipart/form-data" action="<%=path%>/supplier/importExcelVendor.action"> <form id="importExcelFM" method="post" enctype="multipart/form-data"
action="<%=path%>/supplier/importExcelVendor.action">
<div class="fitem" style="padding:5px"> <div class="fitem" style="padding:5px">
<label>文件名称&nbsp;&nbsp;</label> <label>文件名称&nbsp;&nbsp;</label>
<input name="supplierFile" id="supplierFile" type="file" style="width: 230px;height: 20px"/> <input name="supplierFile" id="supplierFile" type="file" style="width: 230px;height: 20px"/>
@@ -169,7 +181,7 @@
</div> </div>
<div class="fitem" style="padding:5px;display: none;"> <div class="fitem" style="padding:5px;display: none;">
<label>是否审查&nbsp;&nbsp;</label> <label>是否审查&nbsp;&nbsp;</label>
<select id ="isCheck" name="isCheck" style="width: 230px;height: 20px"> <select id="isCheck" name="isCheck" style="width: 230px;height: 20px">
<option value="0">是</option> <option value="0">是</option>
<option value="1" selected="selected">否</option> <option value="1" selected="selected">否</option>
</select> </select>
@@ -177,10 +189,11 @@
<input type="hidden" name="clientIp" id="clientIp" value="<%=clientIp %>"/> <input type="hidden" name="clientIp" id="clientIp" value="<%=clientIp %>"/>
<div id="dlg-buttons5"> <div id="dlg-buttons5">
<a href="javascript:void(0)" id="saveimport" class="easyui-linkbutton" iconCls="icon-ok">导入</a> <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> <a href="javascript:void(0)" id="cancelimport" class="easyui-linkbutton" iconCls="icon-cancel"
onclick="javascript:$('#importExcelDlg').dialog('close')">取消</a>
</div> </div>
</form> </form>
</div> </div>
</body> </body>
</html> </html>

View File

@@ -1,21 +1,21 @@
<%@page import="com.jsh.util.Tools"%> <%@page import="com.jsh.util.Tools" %>
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%> <%@ page language="java" pageEncoding="utf-8" %>
<% <%
String path = request.getContextPath(); String path = request.getContextPath();
String clientIp = Tools.getLocalIp(request); String clientIp = Tools.getLocalIp(request);
%> %>
<!DOCTYPE html> <!DOCTYPE html>
<html> <html>
<head> <head>
<title>调拨出库</title> <title>调拨出库</title>
<meta charset="utf-8"> <meta charset="utf-8">
<!-- 指定以IE8的方式来渲染 --> <!-- 指定以IE8的方式来渲染 -->
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE8"/> <meta http-equiv="X-UA-Compatible" content="IE=EmulateIE8"/>
<link rel="shortcut icon" href="<%=path%>/images/favicon.ico" type="image/x-icon" /> <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/default/easyui.css"/>
<link rel="stylesheet" type="text/css" href="<%=path %>/js/easyui-1.3.5/themes/icon.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" /> <link type="text/css" rel="stylesheet" href="<%=path %>/css/common.css"/>
<link type="text/css" rel="stylesheet" href="<%=path %>/css/in_out.css" /> <link type="text/css" rel="stylesheet" href="<%=path %>/css/in_out.css"/>
<script src="<%=path %>/js/jquery-1.8.0.min.js"></script> <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/jquery.easyui.min.js"></script>
<script src="<%=path %>/js/easyui-1.3.5/locale/easyui-lang-zh_CN.js"></script> <script src="<%=path %>/js/easyui-1.3.5/locale/easyui-lang-zh_CN.js"></script>
@@ -27,10 +27,11 @@
var path = "<%=path%>"; var path = "<%=path%>";
var clientIp = "<%=clientIp%>"; var clientIp = "<%=clientIp%>";
</script> </script>
</head> </head>
<body> <body>
<!-- 查询 --> <!-- 查询 -->
<div id = "searchPanel" class="easyui-panel" style="padding:3px;" title="查询窗口" iconCls="icon-search" collapsible="true" closable="false"> <div id="searchPanel" class="easyui-panel" style="padding:3px;" title="查询窗口" iconCls="icon-search" collapsible="true"
closable="false">
<table id="searchTable"> <table id="searchTable">
<tr> <tr>
<td>单据编号:</td> <td>单据编号:</td>
@@ -43,11 +44,13 @@
</td> </td>
<td>单据日期:</td> <td>单据日期:</td>
<td> <td>
<input type="text" name="searchBeginTime" id="searchBeginTime" onClick="WdatePicker({dateFmt:'yyyy-MM-dd'})" class="txt Wdate" style="width:100px;"/> <input type="text" name="searchBeginTime" id="searchBeginTime"
onClick="WdatePicker({dateFmt:'yyyy-MM-dd'})" class="txt Wdate" style="width:100px;"/>
</td> </td>
<td>-</td> <td>-</td>
<td> <td>
<input type="text" name="searchEndTime" id="searchEndTime" onClick="WdatePicker({dateFmt:'yyyy-MM-dd'})" class="txt Wdate" style="width:100px;"/> <input type="text" name="searchEndTime" id="searchEndTime" onClick="WdatePicker({dateFmt:'yyyy-MM-dd'})"
class="txt Wdate" style="width:100px;"/>
</td> </td>
<td>&nbsp;</td> <td>&nbsp;</td>
<td> <td>
@@ -56,25 +59,29 @@
</td> </td>
</tr> </tr>
</table> </table>
</div> </div>
<!-- 数据显示table --> <!-- 数据显示table -->
<div id = "tablePanel" class="easyui-panel" style="padding:1px;top:300px;" title="调拨出库列表" iconCls="icon-list" collapsible="true" closable="false"> <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> <table id="tableData" style="top:300px;border-bottom-color:#FFFFFF"></table>
</div> </div>
<div id="depotHeadDlg" class="easyui-dialog" style="width:1200px;padding:10px 20px;top:60px" <div id="depotHeadDlg" class="easyui-dialog" style="width:1200px;padding:10px 20px;top:60px"
closed="true" buttons="#dlg-buttons" modal="true" cache="false" collapsible="false" closable="true"> closed="true" buttons="#dlg-buttons" modal="true" cache="false" collapsible="false" closable="true">
<form id="depotHeadFM" method="post" novalidate> <form id="depotHeadFM" method="post" novalidate>
<table> <table>
<tr> <tr>
<td style="width:60px;">单据日期:</td> <td style="width:60px;">单据日期:</td>
<td style="padding:5px;width:170px;"> <td style="padding:5px;width:170px;">
<input type="text" name="OperTime" id="OperTime" onClick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'})" class="txt Wdate" style="width:140px;"/> <input type="text" name="OperTime" id="OperTime"
onClick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'})" class="txt Wdate"
style="width:140px;"/>
</td> </td>
<td style="width:70px;">单据编号:</td> <td style="width:70px;">单据编号:</td>
<td style="padding:5px"> <td style="padding:5px">
<input name="Number" id="Number" class="easyui-validatebox" data-options="required:true,validType:'length[2,30]'" style="width:140px;"/> <input name="Number" id="Number" class="easyui-validatebox"
data-options="required:true,validType:'length[2,30]'" style="width:140px;"/>
</td> </td>
<td style="width:80px;"></td> <td style="width:80px;"></td>
<td style="padding:5px;width:170px;"></td> <td style="padding:5px;width:170px;"></td>
@@ -90,18 +97,20 @@
</tr> </tr>
<tr> <tr>
<td colspan="9"> <td colspan="9">
<textarea name="Remark" id="Remark" rows="2" cols="2" placeholder="暂无备注信息" style="width: 1130px; height:35px;"></textarea> <textarea name="Remark" id="Remark" rows="2" cols="2" placeholder="暂无备注信息"
style="width: 1130px; height:35px;"></textarea>
</td> </td>
</tr> </tr>
</table> </table>
<input type="hidden" name="clientIp" id="clientIp" value="<%=clientIp %>"/> <input type="hidden" name="clientIp" id="clientIp" value="<%=clientIp %>"/>
</form> </form>
</div> </div>
<div id="dlg-buttons"> <div id="dlg-buttons">
<a href="javascript:void(0)" id="saveDepotHead" class="easyui-linkbutton" iconCls="icon-ok">保存</a> <a href="javascript:void(0)" id="saveDepotHead" class="easyui-linkbutton" iconCls="icon-ok">保存</a>
<a href="javascript:void(0)" id="cancelDepotHead" class="easyui-linkbutton" iconCls="icon-cancel" onclick="javascript:$('#depotHeadDlg').dialog('close')">取消</a> <a href="javascript:void(0)" id="cancelDepotHead" class="easyui-linkbutton" iconCls="icon-cancel"
</div> onclick="javascript:$('#depotHeadDlg').dialog('close')">取消</a>
<div id="depotHeadDlgShow" class="easyui-dialog" style="width:1200px;padding:10px 20px;top:70px" </div>
<div id="depotHeadDlgShow" class="easyui-dialog" style="width:1200px;padding:10px 20px;top:70px"
closed="true" modal="true" cache="false" collapsible="false" closable="true"> closed="true" modal="true" cache="false" collapsible="false" closable="true">
<table> <table>
<tr> <tr>
@@ -132,6 +141,6 @@
</td> </td>
</tr> </tr>
</table> </table>
</div> </div>
</body> </body>
</html> </html>

View File

@@ -1,21 +1,21 @@
<%@page import="com.jsh.util.Tools"%> <%@page import="com.jsh.util.Tools" %>
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%> <%@ page language="java" pageEncoding="utf-8" %>
<% <%
String path = request.getContextPath(); String path = request.getContextPath();
String clientIp = Tools.getLocalIp(request); String clientIp = Tools.getLocalIp(request);
%> %>
<!DOCTYPE html> <!DOCTYPE html>
<html> <html>
<head> <head>
<title>组装单</title> <title>组装单</title>
<meta charset="utf-8"> <meta charset="utf-8">
<!-- 指定以IE8的方式来渲染 --> <!-- 指定以IE8的方式来渲染 -->
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE8"/> <meta http-equiv="X-UA-Compatible" content="IE=EmulateIE8"/>
<link rel="shortcut icon" href="<%=path%>/images/favicon.ico" type="image/x-icon" /> <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/default/easyui.css"/>
<link rel="stylesheet" type="text/css" href="<%=path %>/js/easyui-1.3.5/themes/icon.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" /> <link type="text/css" rel="stylesheet" href="<%=path %>/css/common.css"/>
<link type="text/css" rel="stylesheet" href="<%=path %>/css/in_out.css" /> <link type="text/css" rel="stylesheet" href="<%=path %>/css/in_out.css"/>
<script src="<%=path %>/js/jquery-1.8.0.min.js"></script> <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/jquery.easyui.min.js"></script>
<script src="<%=path %>/js/easyui-1.3.5/locale/easyui-lang-zh_CN.js"></script> <script src="<%=path %>/js/easyui-1.3.5/locale/easyui-lang-zh_CN.js"></script>
@@ -27,10 +27,11 @@
var path = "<%=path%>"; var path = "<%=path%>";
var clientIp = "<%=clientIp%>"; var clientIp = "<%=clientIp%>";
</script> </script>
</head> </head>
<body> <body>
<!-- 查询 --> <!-- 查询 -->
<div id = "searchPanel" class="easyui-panel" style="padding:3px;" title="查询窗口" iconCls="icon-search" collapsible="true" closable="false"> <div id="searchPanel" class="easyui-panel" style="padding:3px;" title="查询窗口" iconCls="icon-search" collapsible="true"
closable="false">
<table id="searchTable"> <table id="searchTable">
<tr> <tr>
<td>单据编号:</td> <td>单据编号:</td>
@@ -43,11 +44,13 @@
</td> </td>
<td>单据日期:</td> <td>单据日期:</td>
<td> <td>
<input type="text" name="searchBeginTime" id="searchBeginTime" onClick="WdatePicker({dateFmt:'yyyy-MM-dd'})" class="txt Wdate" style="width:100px;"/> <input type="text" name="searchBeginTime" id="searchBeginTime"
onClick="WdatePicker({dateFmt:'yyyy-MM-dd'})" class="txt Wdate" style="width:100px;"/>
</td> </td>
<td>-</td> <td>-</td>
<td> <td>
<input type="text" name="searchEndTime" id="searchEndTime" onClick="WdatePicker({dateFmt:'yyyy-MM-dd'})" class="txt Wdate" style="width:100px;"/> <input type="text" name="searchEndTime" id="searchEndTime" onClick="WdatePicker({dateFmt:'yyyy-MM-dd'})"
class="txt Wdate" style="width:100px;"/>
</td> </td>
<td>&nbsp;</td> <td>&nbsp;</td>
<td> <td>
@@ -56,25 +59,29 @@
</td> </td>
</tr> </tr>
</table> </table>
</div> </div>
<!-- 数据显示table --> <!-- 数据显示table -->
<div id = "tablePanel" class="easyui-panel" style="padding:1px;top:300px;" title="组装单列表" iconCls="icon-list" collapsible="true" closable="false"> <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> <table id="tableData" style="top:300px;border-bottom-color:#FFFFFF"></table>
</div> </div>
<div id="depotHeadDlg" class="easyui-dialog" style="width:1200px;padding:10px 20px;top:60px" <div id="depotHeadDlg" class="easyui-dialog" style="width:1200px;padding:10px 20px;top:60px"
closed="true" buttons="#dlg-buttons" modal="true" cache="false" collapsible="false" closable="true"> closed="true" buttons="#dlg-buttons" modal="true" cache="false" collapsible="false" closable="true">
<form id="depotHeadFM" method="post" novalidate> <form id="depotHeadFM" method="post" novalidate>
<table> <table>
<tr> <tr>
<td style="width:60px;">单据日期:</td> <td style="width:60px;">单据日期:</td>
<td style="padding:5px;width:170px;"> <td style="padding:5px;width:170px;">
<input type="text" name="OperTime" id="OperTime" onClick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'})" class="txt Wdate" style="width:140px;"/> <input type="text" name="OperTime" id="OperTime"
onClick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'})" class="txt Wdate"
style="width:140px;"/>
</td> </td>
<td style="width:70px;">单据编号:</td> <td style="width:70px;">单据编号:</td>
<td style="padding:5px"> <td style="padding:5px">
<input name="Number" id="Number" class="easyui-validatebox" data-options="required:true,validType:'length[2,30]'" style="width:140px;"/> <input name="Number" id="Number" class="easyui-validatebox"
data-options="required:true,validType:'length[2,30]'" style="width:140px;"/>
</td> </td>
<td style="width:80px;"></td> <td style="width:80px;"></td>
<td style="padding:5px;width:170px;"></td> <td style="padding:5px;width:170px;"></td>
@@ -90,18 +97,20 @@
</tr> </tr>
<tr> <tr>
<td colspan="9"> <td colspan="9">
<textarea name="Remark" id="Remark" rows="2" cols="2" placeholder="暂无备注信息" style="width: 1130px; height:35px;"></textarea> <textarea name="Remark" id="Remark" rows="2" cols="2" placeholder="暂无备注信息"
style="width: 1130px; height:35px;"></textarea>
</td> </td>
</tr> </tr>
</table> </table>
<input type="hidden" name="clientIp" id="clientIp" value="<%=clientIp %>"/> <input type="hidden" name="clientIp" id="clientIp" value="<%=clientIp %>"/>
</form> </form>
</div> </div>
<div id="dlg-buttons"> <div id="dlg-buttons">
<a href="javascript:void(0)" id="saveDepotHead" class="easyui-linkbutton" iconCls="icon-ok">保存</a> <a href="javascript:void(0)" id="saveDepotHead" class="easyui-linkbutton" iconCls="icon-ok">保存</a>
<a href="javascript:void(0)" id="cancelDepotHead" class="easyui-linkbutton" iconCls="icon-cancel" onclick="javascript:$('#depotHeadDlg').dialog('close')">取消</a> <a href="javascript:void(0)" id="cancelDepotHead" class="easyui-linkbutton" iconCls="icon-cancel"
</div> onclick="javascript:$('#depotHeadDlg').dialog('close')">取消</a>
<div id="depotHeadDlgShow" class="easyui-dialog" style="width:1200px;padding:10px 20px;top:70px" </div>
<div id="depotHeadDlgShow" class="easyui-dialog" style="width:1200px;padding:10px 20px;top:70px"
closed="true" modal="true" cache="false" collapsible="false" closable="true"> closed="true" modal="true" cache="false" collapsible="false" closable="true">
<table> <table>
<tr> <tr>
@@ -132,6 +141,6 @@
</td> </td>
</tr> </tr>
</table> </table>
</div> </div>
</body> </body>
</html> </html>

View File

@@ -1,21 +1,21 @@
<%@page import="com.jsh.util.Tools"%> <%@page import="com.jsh.util.Tools" %>
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%> <%@ page language="java" pageEncoding="utf-8" %>
<% <%
String path = request.getContextPath(); String path = request.getContextPath();
String clientIp = Tools.getLocalIp(request); String clientIp = Tools.getLocalIp(request);
%> %>
<!DOCTYPE html> <!DOCTYPE html>
<html> <html>
<head> <head>
<title>单据明细</title> <title>单据明细</title>
<meta charset="utf-8"> <meta charset="utf-8">
<!-- 指定以IE8的方式来渲染 --> <!-- 指定以IE8的方式来渲染 -->
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE8"/> <meta http-equiv="X-UA-Compatible" content="IE=EmulateIE8"/>
<link rel="shortcut icon" href="<%=path%>/images/favicon.ico" type="image/x-icon" /> <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/default/easyui.css"/>
<link rel="stylesheet" type="text/css" href="<%=path %>/js/easyui-1.3.5/themes/icon.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" /> <link type="text/css" rel="stylesheet" href="<%=path %>/css/common.css"/>
<link type="text/css" rel="stylesheet" href="<%=path %>/css/bill_detail.css" /> <link type="text/css" rel="stylesheet" href="<%=path %>/css/bill_detail.css"/>
<script src="<%=path %>/js/jquery-1.8.0.min.js"></script> <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/jquery.easyui.min.js"></script>
<script src="<%=path %>/js/easyui-1.3.5/locale/easyui-lang-zh_CN.js"></script> <script src="<%=path %>/js/easyui-1.3.5/locale/easyui-lang-zh_CN.js"></script>
@@ -26,9 +26,10 @@
var path = "<%=path%>"; var path = "<%=path%>";
var clientIp = "<%=clientIp%>"; var clientIp = "<%=clientIp%>";
</script> </script>
</head> </head>
<body> <body>
<div id="bill" class="easyui-panel" style="padding:10px;height:500px;" title="单据明细" iconCls="icon-list" collapsible="true" closable="false"> <div id="bill" class="easyui-panel" style="padding:10px;height:500px;" title="单据明细" iconCls="icon-list"
collapsible="true" closable="false">
<%--零售出库--%> <%--零售出库--%>
<div class="retail_out" style="width:1100px;padding:10px 20px;top:50px" <div class="retail_out" style="width:1100px;padding:10px 20px;top:50px"
closed="true" modal="true" cache="false" collapsible="false" closable="true"> closed="true" modal="true" cache="false" collapsible="false" closable="true">

View File

@@ -1,21 +1,21 @@
<%@page import="com.jsh.util.Tools"%> <%@page import="com.jsh.util.Tools" %>
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%> <%@ page language="java" pageEncoding="utf-8" %>
<% <%
String path = request.getContextPath(); String path = request.getContextPath();
String clientIp = Tools.getLocalIp(request); String clientIp = Tools.getLocalIp(request);
%> %>
<!DOCTYPE html> <!DOCTYPE html>
<html> <html>
<head> <head>
<title>拆卸单</title> <title>拆卸单</title>
<meta charset="utf-8"> <meta charset="utf-8">
<!-- 指定以IE8的方式来渲染 --> <!-- 指定以IE8的方式来渲染 -->
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE8"/> <meta http-equiv="X-UA-Compatible" content="IE=EmulateIE8"/>
<link rel="shortcut icon" href="<%=path%>/images/favicon.ico" type="image/x-icon" /> <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/default/easyui.css"/>
<link rel="stylesheet" type="text/css" href="<%=path %>/js/easyui-1.3.5/themes/icon.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" /> <link type="text/css" rel="stylesheet" href="<%=path %>/css/common.css"/>
<link type="text/css" rel="stylesheet" href="<%=path %>/css/in_out.css" /> <link type="text/css" rel="stylesheet" href="<%=path %>/css/in_out.css"/>
<script src="<%=path %>/js/jquery-1.8.0.min.js"></script> <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/jquery.easyui.min.js"></script>
<script src="<%=path %>/js/easyui-1.3.5/locale/easyui-lang-zh_CN.js"></script> <script src="<%=path %>/js/easyui-1.3.5/locale/easyui-lang-zh_CN.js"></script>
@@ -27,10 +27,11 @@
var path = "<%=path%>"; var path = "<%=path%>";
var clientIp = "<%=clientIp%>"; var clientIp = "<%=clientIp%>";
</script> </script>
</head> </head>
<body> <body>
<!-- 查询 --> <!-- 查询 -->
<div id = "searchPanel" class="easyui-panel" style="padding:3px;" title="查询窗口" iconCls="icon-search" collapsible="true" closable="false"> <div id="searchPanel" class="easyui-panel" style="padding:3px;" title="查询窗口" iconCls="icon-search" collapsible="true"
closable="false">
<table id="searchTable"> <table id="searchTable">
<tr> <tr>
<td>单据编号:</td> <td>单据编号:</td>
@@ -43,11 +44,13 @@
</td> </td>
<td>单据日期:</td> <td>单据日期:</td>
<td> <td>
<input type="text" name="searchBeginTime" id="searchBeginTime" onClick="WdatePicker({dateFmt:'yyyy-MM-dd'})" class="txt Wdate" style="width:100px;"/> <input type="text" name="searchBeginTime" id="searchBeginTime"
onClick="WdatePicker({dateFmt:'yyyy-MM-dd'})" class="txt Wdate" style="width:100px;"/>
</td> </td>
<td>-</td> <td>-</td>
<td> <td>
<input type="text" name="searchEndTime" id="searchEndTime" onClick="WdatePicker({dateFmt:'yyyy-MM-dd'})" class="txt Wdate" style="width:100px;"/> <input type="text" name="searchEndTime" id="searchEndTime" onClick="WdatePicker({dateFmt:'yyyy-MM-dd'})"
class="txt Wdate" style="width:100px;"/>
</td> </td>
<td>&nbsp;</td> <td>&nbsp;</td>
<td> <td>
@@ -56,25 +59,29 @@
</td> </td>
</tr> </tr>
</table> </table>
</div> </div>
<!-- 数据显示table --> <!-- 数据显示table -->
<div id = "tablePanel" class="easyui-panel" style="padding:1px;top:300px;" title="拆卸单列表" iconCls="icon-list" collapsible="true" closable="false"> <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> <table id="tableData" style="top:300px;border-bottom-color:#FFFFFF"></table>
</div> </div>
<div id="depotHeadDlg" class="easyui-dialog" style="width:1200px;padding:10px 20px;top:60px" <div id="depotHeadDlg" class="easyui-dialog" style="width:1200px;padding:10px 20px;top:60px"
closed="true" buttons="#dlg-buttons" modal="true" cache="false" collapsible="false" closable="true"> closed="true" buttons="#dlg-buttons" modal="true" cache="false" collapsible="false" closable="true">
<form id="depotHeadFM" method="post" novalidate> <form id="depotHeadFM" method="post" novalidate>
<table> <table>
<tr> <tr>
<td style="width:60px;">单据日期:</td> <td style="width:60px;">单据日期:</td>
<td style="padding:5px;width:170px;"> <td style="padding:5px;width:170px;">
<input type="text" name="OperTime" id="OperTime" onClick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'})" class="txt Wdate" style="width:140px;"/> <input type="text" name="OperTime" id="OperTime"
onClick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'})" class="txt Wdate"
style="width:140px;"/>
</td> </td>
<td style="width:70px;">单据编号:</td> <td style="width:70px;">单据编号:</td>
<td style="padding:5px"> <td style="padding:5px">
<input name="Number" id="Number" class="easyui-validatebox" data-options="required:true,validType:'length[2,30]'" style="width:140px;"/> <input name="Number" id="Number" class="easyui-validatebox"
data-options="required:true,validType:'length[2,30]'" style="width:140px;"/>
</td> </td>
<td style="width:80px;"></td> <td style="width:80px;"></td>
<td style="padding:5px;width:170px;"></td> <td style="padding:5px;width:170px;"></td>
@@ -90,18 +97,20 @@
</tr> </tr>
<tr> <tr>
<td colspan="9"> <td colspan="9">
<textarea name="Remark" id="Remark" rows="2" cols="2" placeholder="暂无备注信息" style="width: 1130px; height:35px;"></textarea> <textarea name="Remark" id="Remark" rows="2" cols="2" placeholder="暂无备注信息"
style="width: 1130px; height:35px;"></textarea>
</td> </td>
</tr> </tr>
</table> </table>
<input type="hidden" name="clientIp" id="clientIp" value="<%=clientIp %>"/> <input type="hidden" name="clientIp" id="clientIp" value="<%=clientIp %>"/>
</form> </form>
</div> </div>
<div id="dlg-buttons"> <div id="dlg-buttons">
<a href="javascript:void(0)" id="saveDepotHead" class="easyui-linkbutton" iconCls="icon-ok">保存</a> <a href="javascript:void(0)" id="saveDepotHead" class="easyui-linkbutton" iconCls="icon-ok">保存</a>
<a href="javascript:void(0)" id="cancelDepotHead" class="easyui-linkbutton" iconCls="icon-cancel" onclick="javascript:$('#depotHeadDlg').dialog('close')">取消</a> <a href="javascript:void(0)" id="cancelDepotHead" class="easyui-linkbutton" iconCls="icon-cancel"
</div> onclick="javascript:$('#depotHeadDlg').dialog('close')">取消</a>
<div id="depotHeadDlgShow" class="easyui-dialog" style="width:1200px;padding:10px 20px;top:70px" </div>
<div id="depotHeadDlgShow" class="easyui-dialog" style="width:1200px;padding:10px 20px;top:70px"
closed="true" modal="true" cache="false" collapsible="false" closable="true"> closed="true" modal="true" cache="false" collapsible="false" closable="true">
<table> <table>
<tr> <tr>
@@ -132,6 +141,6 @@
</td> </td>
</tr> </tr>
</table> </table>
</div> </div>
</body> </body>
</html> </html>

View File

@@ -1,21 +1,21 @@
<%@page import="com.jsh.util.Tools"%> <%@page import="com.jsh.util.Tools" %>
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%> <%@ page language="java" pageEncoding="utf-8" %>
<% <%
String path = request.getContextPath(); String path = request.getContextPath();
String clientIp = Tools.getLocalIp(request); String clientIp = Tools.getLocalIp(request);
%> %>
<!DOCTYPE html> <!DOCTYPE html>
<html> <html>
<head> <head>
<title>礼品销售</title> <title>礼品销售</title>
<meta charset="utf-8"> <meta charset="utf-8">
<!-- 指定以IE8的方式来渲染 --> <!-- 指定以IE8的方式来渲染 -->
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE8"/> <meta http-equiv="X-UA-Compatible" content="IE=EmulateIE8"/>
<link rel="shortcut icon" href="<%=path%>/images/favicon.ico" type="image/x-icon" /> <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/default/easyui.css"/>
<link rel="stylesheet" type="text/css" href="<%=path %>/js/easyui-1.3.5/themes/icon.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" /> <link type="text/css" rel="stylesheet" href="<%=path %>/css/common.css"/>
<link type="text/css" rel="stylesheet" href="<%=path %>/css/in_out.css" /> <link type="text/css" rel="stylesheet" href="<%=path %>/css/in_out.css"/>
<script src="<%=path %>/js/jquery-1.8.0.min.js"></script> <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/jquery.easyui.min.js"></script>
<script src="<%=path %>/js/easyui-1.3.5/locale/easyui-lang-zh_CN.js"></script> <script src="<%=path %>/js/easyui-1.3.5/locale/easyui-lang-zh_CN.js"></script>
@@ -27,10 +27,11 @@
var path = "<%=path%>"; var path = "<%=path%>";
var clientIp = "<%=clientIp%>"; var clientIp = "<%=clientIp%>";
</script> </script>
</head> </head>
<body> <body>
<!-- 查询 --> <!-- 查询 -->
<div id = "searchPanel" class="easyui-panel" style="padding:3px;" title="查询窗口" iconCls="icon-search" collapsible="true" closable="false"> <div id="searchPanel" class="easyui-panel" style="padding:3px;" title="查询窗口" iconCls="icon-search" collapsible="true"
closable="false">
<table id="searchTable"> <table id="searchTable">
<tr> <tr>
<td>单据编号:</td> <td>单据编号:</td>
@@ -43,11 +44,13 @@
</td> </td>
<td>单据日期:</td> <td>单据日期:</td>
<td> <td>
<input type="text" name="searchBeginTime" id="searchBeginTime" onClick="WdatePicker({dateFmt:'yyyy-MM-dd'})" class="txt Wdate" style="width:100px;"/> <input type="text" name="searchBeginTime" id="searchBeginTime"
onClick="WdatePicker({dateFmt:'yyyy-MM-dd'})" class="txt Wdate" style="width:100px;"/>
</td> </td>
<td>-</td> <td>-</td>
<td> <td>
<input type="text" name="searchEndTime" id="searchEndTime" onClick="WdatePicker({dateFmt:'yyyy-MM-dd'})" class="txt Wdate" style="width:100px;"/> <input type="text" name="searchEndTime" id="searchEndTime" onClick="WdatePicker({dateFmt:'yyyy-MM-dd'})"
class="txt Wdate" style="width:100px;"/>
</td> </td>
<td>&nbsp;</td> <td>&nbsp;</td>
<td> <td>
@@ -56,25 +59,29 @@
</td> </td>
</tr> </tr>
</table> </table>
</div> </div>
<!-- 数据显示table --> <!-- 数据显示table -->
<div id="tablePanel" class="easyui-panel" style="padding:1px; top:300px;" title="礼品销售列表" iconCls="icon-list" collapsible="true" closable="false"> <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> <table id="tableData" style="top:300px;border-bottom-color:#FFFFFF"></table>
</div> </div>
<div id="depotHeadDlg" class="easyui-dialog" style="width:1200px;padding:10px 20px;top:50px" <div id="depotHeadDlg" class="easyui-dialog" style="width:1200px;padding:10px 20px;top:50px"
closed="true" buttons="#dlg-buttons" modal="true" cache="false" collapsible="false" closable="true"> closed="true" buttons="#dlg-buttons" modal="true" cache="false" collapsible="false" closable="true">
<form id="depotHeadFM" method="post" novalidate> <form id="depotHeadFM" method="post" novalidate>
<table> <table>
<tr> <tr>
<td style="width:70px;">单据日期:</td> <td style="width:70px;">单据日期:</td>
<td style="padding:5px"> <td style="padding:5px">
<input type="text" name="OperTime" id="OperTime" onClick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'})" class="txt Wdate" style="width:140px;"/> <input type="text" name="OperTime" id="OperTime"
onClick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'})" class="txt Wdate"
style="width:140px;"/>
</td> </td>
<td style="width:70px;">单据编号:</td> <td style="width:70px;">单据编号:</td>
<td style="padding:5px"> <td style="padding:5px">
<input name="Number" id="Number" class="easyui-validatebox" data-options="required:true,validType:'length[2,30]'" style="width: 140px;"/> <input name="Number" id="Number" class="easyui-validatebox"
data-options="required:true,validType:'length[2,30]'" style="width: 140px;"/>
</td> </td>
<td></td> <td></td>
<td></td> <td></td>
@@ -90,18 +97,20 @@
</tr> </tr>
<tr> <tr>
<td colspan="9"> <td colspan="9">
<textarea name="Remark" id="Remark" rows="2" cols="2" placeholder="暂无备注信息" style="width: 1130px; height:35px;"></textarea> <textarea name="Remark" id="Remark" rows="2" cols="2" placeholder="暂无备注信息"
style="width: 1130px; height:35px;"></textarea>
</td> </td>
</tr> </tr>
</table> </table>
<input type="hidden" name="clientIp" id="clientIp" value="<%=clientIp %>"/> <input type="hidden" name="clientIp" id="clientIp" value="<%=clientIp %>"/>
</form> </form>
</div> </div>
<div id="dlg-buttons"> <div id="dlg-buttons">
<a href="javascript:void(0)" id="saveDepotHead" class="easyui-linkbutton" iconCls="icon-ok">保存</a> <a href="javascript:void(0)" id="saveDepotHead" class="easyui-linkbutton" iconCls="icon-ok">保存</a>
<a href="javascript:void(0)" id="cancelDepotHead" class="easyui-linkbutton" iconCls="icon-cancel" onclick="javascript:$('#depotHeadDlg').dialog('close')">取消</a> <a href="javascript:void(0)" id="cancelDepotHead" class="easyui-linkbutton" iconCls="icon-cancel"
</div> onclick="javascript:$('#depotHeadDlg').dialog('close')">取消</a>
<div id="depotHeadDlgShow" class="easyui-dialog" style="width:1200px;padding:10px 20px;top:60px" </div>
<div id="depotHeadDlgShow" class="easyui-dialog" style="width:1200px;padding:10px 20px;top:60px"
closed="true" modal="true" cache="false" collapsible="false" closable="true"> closed="true" modal="true" cache="false" collapsible="false" closable="true">
<table> <table>
<tr> <tr>
@@ -132,6 +141,6 @@
</td> </td>
</tr> </tr>
</table> </table>
</div> </div>
</body> </body>
</html> </html>

View File

@@ -1,21 +1,21 @@
<%@page import="com.jsh.util.Tools"%> <%@page import="com.jsh.util.Tools" %>
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%> <%@ page language="java" pageEncoding="utf-8" %>
<% <%
String path = request.getContextPath(); String path = request.getContextPath();
String clientIp = Tools.getLocalIp(request); String clientIp = Tools.getLocalIp(request);
%> %>
<!DOCTYPE html> <!DOCTYPE html>
<html> <html>
<head> <head>
<title>礼品充值</title> <title>礼品充值</title>
<meta charset="utf-8"> <meta charset="utf-8">
<!-- 指定以IE8的方式来渲染 --> <!-- 指定以IE8的方式来渲染 -->
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE8"/> <meta http-equiv="X-UA-Compatible" content="IE=EmulateIE8"/>
<link rel="shortcut icon" href="<%=path%>/images/favicon.ico" type="image/x-icon" /> <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/default/easyui.css"/>
<link rel="stylesheet" type="text/css" href="<%=path %>/js/easyui-1.3.5/themes/icon.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" /> <link type="text/css" rel="stylesheet" href="<%=path %>/css/common.css"/>
<link type="text/css" rel="stylesheet" href="<%=path %>/css/in_out.css" /> <link type="text/css" rel="stylesheet" href="<%=path %>/css/in_out.css"/>
<script src="<%=path %>/js/jquery-1.8.0.min.js"></script> <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/jquery.easyui.min.js"></script>
<script src="<%=path %>/js/easyui-1.3.5/locale/easyui-lang-zh_CN.js"></script> <script src="<%=path %>/js/easyui-1.3.5/locale/easyui-lang-zh_CN.js"></script>
@@ -27,10 +27,11 @@
var path = "<%=path%>"; var path = "<%=path%>";
var clientIp = "<%=clientIp%>"; var clientIp = "<%=clientIp%>";
</script> </script>
</head> </head>
<body> <body>
<!-- 查询 --> <!-- 查询 -->
<div id = "searchPanel" class="easyui-panel" style="padding:3px;" title="查询窗口" iconCls="icon-search" collapsible="true" closable="false"> <div id="searchPanel" class="easyui-panel" style="padding:3px;" title="查询窗口" iconCls="icon-search" collapsible="true"
closable="false">
<table id="searchTable"> <table id="searchTable">
<tr> <tr>
<td>单据编号:</td> <td>单据编号:</td>
@@ -43,11 +44,13 @@
</td> </td>
<td>单据日期:</td> <td>单据日期:</td>
<td> <td>
<input type="text" name="searchBeginTime" id="searchBeginTime" onClick="WdatePicker({dateFmt:'yyyy-MM-dd'})" class="txt Wdate" style="width:100px;"/> <input type="text" name="searchBeginTime" id="searchBeginTime"
onClick="WdatePicker({dateFmt:'yyyy-MM-dd'})" class="txt Wdate" style="width:100px;"/>
</td> </td>
<td>-</td> <td>-</td>
<td> <td>
<input type="text" name="searchEndTime" id="searchEndTime" onClick="WdatePicker({dateFmt:'yyyy-MM-dd'})" class="txt Wdate" style="width:100px;"/> <input type="text" name="searchEndTime" id="searchEndTime" onClick="WdatePicker({dateFmt:'yyyy-MM-dd'})"
class="txt Wdate" style="width:100px;"/>
</td> </td>
<td>&nbsp;</td> <td>&nbsp;</td>
<td> <td>
@@ -56,25 +59,29 @@
</td> </td>
</tr> </tr>
</table> </table>
</div> </div>
<!-- 数据显示table --> <!-- 数据显示table -->
<div id = "tablePanel" class="easyui-panel" style="padding:1px;top:300px;" title="礼品充值列表" iconCls="icon-list" collapsible="true" closable="false"> <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> <table id="tableData" style="top:300px;border-bottom-color:#FFFFFF"></table>
</div> </div>
<div id="depotHeadDlg" class="easyui-dialog" style="width:1200px;padding:10px 20px;top:50px" <div id="depotHeadDlg" class="easyui-dialog" style="width:1200px;padding:10px 20px;top:50px"
closed="true" buttons="#dlg-buttons" modal="true" cache="false" collapsible="false" closable="true"> closed="true" buttons="#dlg-buttons" modal="true" cache="false" collapsible="false" closable="true">
<form id="depotHeadFM" method="post" novalidate> <form id="depotHeadFM" method="post" novalidate>
<table> <table>
<tr> <tr>
<td style="width:70px;">单据日期:</td> <td style="width:70px;">单据日期:</td>
<td style="padding:5px"> <td style="padding:5px">
<input type="text" name="OperTime" id="OperTime" onClick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'})" class="txt Wdate" style="width: 140px;"/> <input type="text" name="OperTime" id="OperTime"
onClick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'})" class="txt Wdate"
style="width: 140px;"/>
</td> </td>
<td style="width:70px;">单据编号:</td> <td style="width:70px;">单据编号:</td>
<td style="padding:5px"> <td style="padding:5px">
<input name="Number" id="Number" class="easyui-validatebox" data-options="required:true,validType:'length[2,30]'" style="width: 140px;"/> <input name="Number" id="Number" class="easyui-validatebox"
data-options="required:true,validType:'length[2,30]'" style="width: 140px;"/>
</td> </td>
<td></td> <td></td>
<td></td> <td></td>
@@ -90,18 +97,20 @@
</tr> </tr>
<tr> <tr>
<td colspan="9"> <td colspan="9">
<textarea name="Remark" id="Remark" rows="2" cols="2" placeholder="暂无备注信息" style="width: 1130px; height:35px;"></textarea> <textarea name="Remark" id="Remark" rows="2" cols="2" placeholder="暂无备注信息"
style="width: 1130px; height:35px;"></textarea>
</td> </td>
</tr> </tr>
</table> </table>
<input type="hidden" name="clientIp" id="clientIp" value="<%=clientIp %>"/> <input type="hidden" name="clientIp" id="clientIp" value="<%=clientIp %>"/>
</form> </form>
</div> </div>
<div id="dlg-buttons"> <div id="dlg-buttons">
<a href="javascript:void(0)" id="saveDepotHead" class="easyui-linkbutton" iconCls="icon-ok">保存</a> <a href="javascript:void(0)" id="saveDepotHead" class="easyui-linkbutton" iconCls="icon-ok">保存</a>
<a href="javascript:void(0)" id="cancelDepotHead" class="easyui-linkbutton" iconCls="icon-cancel" onclick="javascript:$('#depotHeadDlg').dialog('close')">取消</a> <a href="javascript:void(0)" id="cancelDepotHead" class="easyui-linkbutton" iconCls="icon-cancel"
</div> onclick="javascript:$('#depotHeadDlg').dialog('close')">取消</a>
<div id="depotHeadDlgShow" class="easyui-dialog" style="width:1200px;padding:10px 20px;top:60px" </div>
<div id="depotHeadDlgShow" class="easyui-dialog" style="width:1200px;padding:10px 20px;top:60px"
closed="true" modal="true" cache="false" collapsible="false" closable="true"> closed="true" modal="true" cache="false" collapsible="false" closable="true">
<table> <table>
<tr> <tr>
@@ -132,6 +141,6 @@
</td> </td>
</tr> </tr>
</table> </table>
</div> </div>
</body> </body>
</html> </html>

File diff suppressed because it is too large Load Diff

View File

@@ -1,5 +1,5 @@
<%@page import="com.jsh.util.Tools"%> <%@page import="com.jsh.util.Tools" %>
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%> <%@ page language="java" pageEncoding="utf-8" %>
<% <%
String path = request.getContextPath(); String path = request.getContextPath();
String clientIp = Tools.getLocalIp(request); String clientIp = Tools.getLocalIp(request);
@@ -11,18 +11,19 @@
<meta charset="utf-8"> <meta charset="utf-8">
<!-- 指定以IE8的方式来渲染 --> <!-- 指定以IE8的方式来渲染 -->
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE8"/> <meta http-equiv="X-UA-Compatible" content="IE=EmulateIE8"/>
<link rel="shortcut icon" href="<%=path%>/images/favicon.ico" type="image/x-icon" /> <link rel="shortcut icon" href="<%=path%>/images/favicon.ico" type="image/x-icon"/>
<script type="text/javascript" src="<%=path %>/js/jquery-1.8.0.min.js"></script> <script type="text/javascript" src="<%=path %>/js/jquery-1.8.0.min.js"></script>
<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/default/easyui.css"/>
<link rel="stylesheet" type="text/css" href="<%=path %>/js/easyui-1.3.5/themes/icon.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" /> <link type="text/css" rel="stylesheet" href="<%=path %>/css/common.css"/>
<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/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/locale/easyui-lang-zh_CN.js"></script>
<script type="text/javascript" src="<%=path %>/js/common/common.js"></script> <script type="text/javascript" src="<%=path %>/js/common/common.js"></script>
</head> </head>
<body> <body>
<!-- 查询 --> <!-- 查询 -->
<div id = "searchPanel" class="easyui-panel" style="padding:10px;" title="查询窗口" iconCls="icon-search" collapsible="true" closable="false"> <div id="searchPanel" class="easyui-panel" style="padding:10px;" title="查询窗口" iconCls="icon-search" collapsible="true"
closable="false">
<table id="searchTable"> <table id="searchTable">
<tr> <tr>
<td>名称:</td> <td>名称:</td>
@@ -39,7 +40,8 @@
</div> </div>
<!-- 数据显示table --> <!-- 数据显示table -->
<div id = "tablePanel" class="easyui-panel" style="padding:1px;top:300px;" title="商品属性列表" iconCls="icon-list" collapsible="true" closable="false"> <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> <table id="tableData" style="top:300px;border-bottom-color:#FFFFFF"></table>
</div> </div>
@@ -50,7 +52,7 @@
<tr> <tr>
<td>名称</td> <td>名称</td>
<td style="padding:5px"> <td style="padding:5px">
<span id="nativeName" /> <span id="nativeName"/>
</td> </td>
</tr> </tr>
<tr> <tr>
@@ -62,13 +64,15 @@
<tr> <tr>
<td>排序</td> <td>排序</td>
<td style="padding:5px"> <td style="padding:5px">
<input name="sort" id="sort" class="easyui-validatebox" data-options="required:true,validType:'length[2,30]'" style="width: 230px;height: 20px"/> <input name="sort" id="sort" class="easyui-validatebox"
data-options="required:true,validType:'length[2,30]'" style="width: 230px;height: 20px"/>
</td> </td>
</tr> </tr>
<tr> <tr>
<td>别名</td> <td>别名</td>
<td style="padding:5px"> <td style="padding:5px">
<input name="anotherName" id="anotherName" class="easyui-validatebox" data-options="validType:'length[2,30]'" style="width: 230px;height: 20px"/> <input name="anotherName" id="anotherName" class="easyui-validatebox"
data-options="validType:'length[2,30]'" style="width: 230px;height: 20px"/>
</td> </td>
</tr> </tr>
</table> </table>
@@ -77,12 +81,13 @@
</div> </div>
<div id="dlg-buttons"> <div id="dlg-buttons">
<a href="javascript:void(0)" id="saveMaterialProperty" class="easyui-linkbutton" iconCls="icon-ok">保存</a> <a href="javascript:void(0)" id="saveMaterialProperty" class="easyui-linkbutton" iconCls="icon-ok">保存</a>
<a href="javascript:void(0)" id="cancelMaterialProperty" class="easyui-linkbutton" iconCls="icon-cancel" onclick="javascript:$('#materialPropertyDlg').dialog('close')">取消</a> <a href="javascript:void(0)" id="cancelMaterialProperty" class="easyui-linkbutton" iconCls="icon-cancel"
onclick="javascript:$('#materialPropertyDlg').dialog('close')">取消</a>
</div> </div>
<script type="text/javascript"> <script type="text/javascript">
//初始化界面 //初始化界面
$(function() { $(function () {
initTableData(); initTableData();
ininPager(); ininPager();
initForm(); initForm();
@@ -91,7 +96,7 @@
//防止表单提交重复 //防止表单提交重复
function initForm() { function initForm() {
$('#materialPropertyFM').form({ $('#materialPropertyFM').form({
onSubmit: function(){ onSubmit: function () {
return false; return false;
} }
}); });
@@ -100,38 +105,40 @@
//初始化表格数据 //初始化表格数据
function initTableData() { function initTableData() {
$('#tableData').datagrid({ $('#tableData').datagrid({
height:heightInfo, height: heightInfo,
nowrap: false, nowrap: false,
rownumbers: true, rownumbers: true,
//动画效果 //动画效果
animate:false, animate: false,
//选中单行 //选中单行
singleSelect : true, singleSelect: true,
collapsible:false, collapsible: false,
selectOnCheck:false, selectOnCheck: false,
//fitColumns:true, //fitColumns:true,
//单击行是否选中 //单击行是否选中
//checkOnSelect : false, //checkOnSelect : false,
url:'<%=path %>/materialProperty/findBy.action?pageSize=' + initPageSize, url: '<%=path %>/materialProperty/findBy.action?pageSize=' + initPageSize,
pagination: false, pagination: false,
//交替出现背景 //交替出现背景
striped : true, striped: true,
//loadFilter: pagerFilter, //loadFilter: pagerFilter,
columns:[[ columns: [[
{ field: 'id',width:10,align:"center",hidden:true}, {field: 'id', width: 10, align: "center", hidden: true},
{ title: '名称',field: 'nativeName',width:100}, {title: '名称', field: 'nativeName', width: 100},
{ title: '是否启用',field: 'enabled',width:100,formatter:function(value,rec){ {
if(rec.enabled){ title: '是否启用', field: 'enabled', width: 100, formatter: function (value, rec) {
if (rec.enabled) {
return "启用"; return "启用";
} }
else { else {
return "禁用"; return "禁用";
} }
}}, }
{ title: '排序',field: 'sort',width:100}, },
{ title: '别名',field: 'anotherName',width:100}, {title: '排序', field: 'sort', width: 100},
{ title: '操作',field: 'op',align:"center",width:80,formatter:function(value,rec) {title: '别名', field: 'anotherName', width: 100},
{ {
title: '操作', field: 'op', align: "center", width: 80, formatter: function (value, rec) {
var str = ''; var str = '';
var rowInfo = rec.id + 'AaBb' + rec.nativeName + 'AaBb' + rec.enabled + 'AaBb' + rec.sort + 'AaBb' + rec.anotherName; var rowInfo = rec.id + 'AaBb' + rec.nativeName + 'AaBb' + rec.enabled + 'AaBb' + rec.sort + 'AaBb' + rec.anotherName;
str += '<img src="<%=path%>/js/easyui-1.3.5/themes/icons/pencil.png" style="cursor: pointer;" onclick="editMaterialProperty(\'' + rowInfo + '\');"/>&nbsp;<a onclick="editMaterialProperty(\'' + 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/pencil.png" style="cursor: pointer;" onclick="editMaterialProperty(\'' + rowInfo + '\');"/>&nbsp;<a onclick="editMaterialProperty(\'' + rowInfo + '\');" style="text-decoration:none;color:black;" href="javascript:void(0)">编辑</a>&nbsp;&nbsp;';
@@ -139,51 +146,49 @@
} }
} }
]], ]],
onLoadError:function() onLoadError: function () {
{ $.messager.alert('页面加载提示', '页面加载异常,请稍后再试!', 'error');
$.messager.alert('页面加载提示','页面加载异常,请稍后再试!','error');
return; return;
} }
}); });
} }
//初始化键盘enter事件 //初始化键盘enter事件
$(document).keydown(function(event) { $(document).keydown(function (event) {
//兼容 IE和firefox 事件 //兼容 IE和firefox 事件
var e = window.event || event; var e = window.event || event;
var k = e.keyCode||e.which||e.charCode; var k = e.keyCode || e.which || e.charCode;
//兼容 IE,firefox 兼容 //兼容 IE,firefox 兼容
var obj = e.srcElement ? e.srcElement : e.target; var obj = e.srcElement ? e.srcElement : e.target;
//绑定键盘事件为 id是指定的输入框才可以触发键盘事件 13键盘事件 ---遗留问题 enter键效验 对话框会关闭问题 //绑定键盘事件为 id是指定的输入框才可以触发键盘事件 13键盘事件 ---遗留问题 enter键效验 对话框会关闭问题
if(k == "13"&&(obj.id=="nativeName")) { if (k == "13" && (obj.id == "nativeName")) {
$("#saveMaterialProperty").click(); $("#saveMaterialProperty").click();
} }
//搜索按钮添加快捷键 //搜索按钮添加快捷键
if(k == "13"&&(obj.id=="searchNativeName")) { if (k == "13" && (obj.id == "searchNativeName")) {
$("#searchBtn").click(); $("#searchBtn").click();
} }
}); });
//分页信息处理 //分页信息处理
function ininPager() { function ininPager() {
try try {
{
var opts = $("#tableData").datagrid('options'); var opts = $("#tableData").datagrid('options');
var pager = $("#tableData").datagrid('getPager'); var pager = $("#tableData").datagrid('getPager');
pager.pagination({ pager.pagination({
onSelectPage:function(pageNum, pageSize) { onSelectPage: function (pageNum, pageSize) {
opts.pageNumber = pageNum; opts.pageNumber = pageNum;
opts.pageSize = pageSize; opts.pageSize = pageSize;
pager.pagination('refresh', { pager.pagination('refresh', {
pageNumber:pageNum, pageNumber: pageNum,
pageSize:pageSize pageSize: pageSize
}); });
showMaterialPropertyDetails(pageNum,pageSize); showMaterialPropertyDetails(pageNum, pageSize);
} }
}); });
} }
catch (e) catch (e) {
{ $.messager.alert('异常处理提示', "分页信息异常 : " + e.name + ": " + e.message, 'error');
$.messager.alert('异常处理提示',"分页信息异常 : " + e.name + ": " + e.message,'error');
} }
} }
@@ -192,27 +197,27 @@
//保存信息 //保存信息
$("#saveMaterialProperty").unbind().bind({ $("#saveMaterialProperty").unbind().bind({
click:function() { click: function () {
if(!$('#materialPropertyFM').form('validate')) if (!$('#materialPropertyFM').form('validate'))
return; return;
else { else {
$.ajax({ $.ajax({
type:"post", type: "post",
url: url, url: url,
dataType: "json", dataType: "json",
async : false, async: false,
data: ({ data: ({
nativeName : $.trim($("#nativeName").val()), nativeName: $.trim($("#nativeName").val()),
enabled : $("#enabled").is(':checked'), enabled: $("#enabled").is(':checked'),
sort : $.trim($("#sort").val()), sort: $.trim($("#sort").val()),
anotherName : $.trim($("#anotherName").val()), anotherName: $.trim($("#anotherName").val()),
clientIp:'<%=clientIp %>' clientIp: '<%=clientIp %>'
}), }),
success: function (tipInfo) { success: function (tipInfo) {
if(tipInfo) { if (tipInfo) {
$('#materialPropertyDlg').dialog('close'); $('#materialPropertyDlg').dialog('close');
var opts = $("#tableData").datagrid('options'); var opts = $("#tableData").datagrid('options');
showMaterialPropertyDetails(opts.pageNumber,opts.pageSize); showMaterialPropertyDetails(opts.pageNumber, opts.pageSize);
} }
else { else {
$.messager.show({ $.messager.show({
@@ -222,8 +227,8 @@
} }
}, },
//此处添加错误处理 //此处添加错误处理
error:function() { error: function () {
$.messager.alert('提示','保存商品属性异常,请稍后再试!','error'); $.messager.alert('提示', '保存商品属性异常,请稍后再试!', 'error');
return; return;
} }
}); });
@@ -237,12 +242,12 @@
$("#clientIp").val('<%=clientIp %>'); $("#clientIp").val('<%=clientIp %>');
$("#nativeName").text(materialPropertyInfo[1]); $("#nativeName").text(materialPropertyInfo[1]);
$("#enabled").attr("checked",materialPropertyInfo[2]=='true'?true:false); $("#enabled").attr("checked", materialPropertyInfo[2] == 'true' ? true : false);
$("#sort").val(materialPropertyInfo[3]); $("#sort").val(materialPropertyInfo[3]);
$("#anotherName").val(materialPropertyInfo[4]); $("#anotherName").val(materialPropertyInfo[4]);
$('#materialPropertyDlg').dialog('open').dialog('setTitle','<img src="<%=path%>/js/easyui-1.3.5/themes/icons/pencil.png"/>&nbsp;编辑商品属性'); $('#materialPropertyDlg').dialog('open').dialog('setTitle', '<img src="<%=path%>/js/easyui-1.3.5/themes/icons/pencil.png"/>&nbsp;编辑商品属性');
$(".window-mask").css({ width: webW ,height: webH}); $(".window-mask").css({width: webW, height: webH});
//焦点在名称输入框==定焦在输入文字后面 //焦点在名称输入框==定焦在输入文字后面
$("#nativeName").val("").focus().val(materialPropertyInfo[1]); $("#nativeName").val("").focus().val(materialPropertyInfo[1]);
url = '<%=path %>/materialProperty/update.action?id=' + materialPropertyInfo[0]; url = '<%=path %>/materialProperty/update.action?id=' + materialPropertyInfo[0];
@@ -250,44 +255,42 @@
//搜索处理 //搜索处理
$("#searchBtn").unbind().bind({ $("#searchBtn").unbind().bind({
click:function() click: function () {
{ showMaterialPropertyDetails(1, initPageSize);
showMaterialPropertyDetails(1,initPageSize);
var opts = $("#tableData").datagrid('options'); var opts = $("#tableData").datagrid('options');
var pager = $("#tableData").datagrid('getPager'); var pager = $("#tableData").datagrid('getPager');
opts.pageNumber = 1; opts.pageNumber = 1;
opts.pageSize = initPageSize; opts.pageSize = initPageSize;
pager.pagination('refresh', { pager.pagination('refresh', {
pageNumber:1, pageNumber: 1,
pageSize:initPageSize pageSize: initPageSize
}); });
} }
}); });
function showMaterialPropertyDetails(pageNo,pageSize) { function showMaterialPropertyDetails(pageNo, pageSize) {
$.ajax({ $.ajax({
type:"post", type: "post",
url: "<%=path %>/materialProperty/findBy.action", url: "<%=path %>/materialProperty/findBy.action",
dataType: "json", dataType: "json",
data: ({ data: ({
nativeName:$.trim($("#searchNativeName").val()), nativeName: $.trim($("#searchNativeName").val()),
pageNo:pageNo, pageNo: pageNo,
pageSize:pageSize pageSize: pageSize
}), }),
success: function (data) { success: function (data) {
$("#tableData").datagrid('loadData',data); $("#tableData").datagrid('loadData', data);
}, },
//此处添加错误处理 //此处添加错误处理
error:function() error: function () {
{ $.messager.alert('查询提示', '查询数据后台异常,请稍后再试!', 'error');
$.messager.alert('查询提示','查询数据后台异常,请稍后再试!','error');
return; return;
} }
}); });
} }
//重置按钮 //重置按钮
$("#searchResetBtn").off().on("click",function(){ $("#searchResetBtn").off().on("click", function () {
$("#searchNativeName").val(""); $("#searchNativeName").val("");
//加载完以后重新初始化 //加载完以后重新初始化
$("#searchBtn").click(); $("#searchBtn").click();

View File

@@ -1,29 +1,30 @@
<%@page import="com.jsh.util.Tools"%> <%@page import="com.jsh.util.Tools" %>
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%> <%@ page language="java" pageEncoding="utf-8" %>
<% <%
String path = request.getContextPath(); String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/"; String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + path + "/";
String clientIp = Tools.getLocalIp(request); String clientIp = Tools.getLocalIp(request);
%> %>
<!DOCTYPE html> <!DOCTYPE html>
<html> <html>
<head> <head>
<title>商品类别管理</title> <title>商品类别管理</title>
<meta charset="utf-8"> <meta charset="utf-8">
<!-- 指定以IE8的方式来渲染 --> <!-- 指定以IE8的方式来渲染 -->
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE8"/> <meta http-equiv="X-UA-Compatible" content="IE=EmulateIE8"/>
<link rel="shortcut icon" href="<%=path%>/images/favicon.ico" type="image/x-icon" /> <link rel="shortcut icon" href="<%=path%>/images/favicon.ico" type="image/x-icon"/>
<script type="text/javascript" src="<%=path %>/js/jquery-1.8.0.min.js"></script> <script type="text/javascript" src="<%=path %>/js/jquery-1.8.0.min.js"></script>
<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/default/easyui.css"/>
<link rel="stylesheet" type="text/css" href="<%=path %>/js/easyui-1.3.5/themes/icon.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" /> <link type="text/css" rel="stylesheet" href="<%=path %>/css/common.css"/>
<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/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/locale/easyui-lang-zh_CN.js"></script>
<script type="text/javascript" src="<%=path %>/js/common/common.js"></script> <script type="text/javascript" src="<%=path %>/js/common/common.js"></script>
</head> </head>
<body> <body>
<!-- 查询 --> <!-- 查询 -->
<div id = "searchPanel" class="easyui-panel" style="padding:10px;" title="查询窗口" iconCls="icon-search" collapsible="true" closable="false"> <div id="searchPanel" class="easyui-panel" style="padding:10px;" title="查询窗口" iconCls="icon-search" collapsible="true"
closable="false">
<table id="searchTable"> <table id="searchTable">
<tr> <tr>
<td>名称:</td> <td>名称:</td>
@@ -44,20 +45,23 @@
</td> </td>
</tr> </tr>
</table> </table>
</div> </div>
<!-- 数据显示table --> <!-- 数据显示table -->
<div id = "tablePanel" class="easyui-panel" style="padding:1px;top:300px;" title="商品类别列表" iconCls="icon-list" collapsible="true" closable="false"> <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> <table id="tableData" style="top:300px;border-bottom-color:#FFFFFF"></table>
</div> </div>
<div id="materialCategoryDlg" class="easyui-dialog" style="width:380px;padding:10px 20px" <div id="materialCategoryDlg" class="easyui-dialog" style="width:380px;padding:10px 20px"
closed="true" buttons="#dlg-buttons" modal="true" cache="false" collapsible="false" closable="true"> closed="true" buttons="#dlg-buttons" modal="true" cache="false" collapsible="false" closable="true">
<form id="materialCategoryFM" method="post" novalidate> <form id="materialCategoryFM" method="post" novalidate>
<table> <table>
<tr> <tr>
<td>名称</td> <td>名称</td>
<td style="padding:5px"><input name="Name" id="Name" class="easyui-validatebox" data-options="required:true,validType:'length[2,30]'" style="width: 100px;height: 20px"/></td> <td style="padding:5px"><input name="Name" id="Name" class="easyui-validatebox"
data-options="required:true,validType:'length[2,30]'"
style="width: 100px;height: 20px"/></td>
</tr> </tr>
<tr> <tr>
<td>层次</td> <td>层次</td>
@@ -79,20 +83,20 @@
</table> </table>
<input type="hidden" name="clientIp" id="clientIp" value="<%=clientIp %>"/> <input type="hidden" name="clientIp" id="clientIp" value="<%=clientIp %>"/>
</form> </form>
</div> </div>
<div id="dlg-buttons"> <div id="dlg-buttons">
<a href="javascript:void(0)" id="saveMaterialCategory" class="easyui-linkbutton" iconCls="icon-ok">保存</a> <a href="javascript:void(0)" id="saveMaterialCategory" class="easyui-linkbutton" iconCls="icon-ok">保存</a>
<a href="javascript:void(0)" id="cancelMaterialCategory" class="easyui-linkbutton" iconCls="icon-cancel" onclick="javascript:$('#materialCategoryDlg').dialog('close')">取消</a> <a href="javascript:void(0)" id="cancelMaterialCategory" class="easyui-linkbutton" iconCls="icon-cancel"
</div> onclick="javascript:$('#materialCategoryDlg').dialog('close')">取消</a>
</div>
<script type="text/javascript"> <script type="text/javascript">
var materialCategoryList = null; var materialCategoryList = null;
var materialCategoryID = null; var materialCategoryID = null;
var parentid_search=null; var parentid_search = null;
var lei=null; var lei = null;
//初始化界面 //初始化界面
$(function() $(function () {
{
//初始化系统基础信息 //初始化系统基础信息
initSystemData(1); initSystemData(1);
initSelectInfo(1); initSelectInfo(1);
@@ -102,75 +106,63 @@
}); });
//初始化系统基础信息 //初始化系统基础信息
function initSystemData(parentid_search) function initSystemData(parentid_search) {
{
$.ajax({ $.ajax({
type:"post", type: "post",
url: "<%=path%>/materialCategory/getBasicData.action", url: "<%=path%>/materialCategory/getBasicData.action",
data: ({ data: ({
ParentId:parentid_search ParentId: parentid_search
}), }),
//设置为同步 //设置为同步
async:false, async: false,
dataType: "json", dataType: "json",
success: function (systemInfo) success: function (systemInfo) {
{
materialCategoryList = systemInfo.showModel.map.materialCategoryList; materialCategoryList = systemInfo.showModel.map.materialCategoryList;
var msgTip = systemInfo.showModel.msgTip; var msgTip = systemInfo.showModel.msgTip;
if(msgTip == "exceptoin") if (msgTip == "exceptoin") {
{ $.messager.alert('提示', '查找商品类别异常,请与管理员联系!', 'error');
$.messager.alert('提示','查找商品类别异常,请与管理员联系!','error');
return; return;
} }
} }
}); });
} }
//初始化页面选项卡 //初始化页面选项卡
function initSelectInfo(lei) function initSelectInfo(lei) {
{
var options = ""; var options = "";
if(materialCategoryList !=null) if (materialCategoryList != null) {
{
options = ""; options = "";
for(var i = 0 ;i < materialCategoryList.length;i ++) for (var i = 0; i < materialCategoryList.length; i++) {
{
var materialCategory = materialCategoryList[i]; var materialCategory = materialCategoryList[i];
if(0 == i) if (0 == i) {
{
materialCategoryID = materialCategory.id; materialCategoryID = materialCategory.id;
} }
options += '<option value="' + materialCategory.id + '">' + materialCategory.name + '</option>'; options += '<option value="' + materialCategory.id + '">' + materialCategory.name + '</option>';
} }
//$("#ParentId").empty().append(options); //$("#ParentId").empty().append(options);
if(lei==1) if (lei == 1) {
{
$("#searchParentId_f").empty().append('<option value="">全部</option>').append(options); $("#searchParentId_f").empty().append('<option value="">全部</option>').append(options);
} }
else if(lei==2) else if (lei == 2) {
{
$("#searchParentId_s").empty().append('<option value="">全部</option>').append(options); $("#searchParentId_s").empty().append('<option value="">全部</option>').append(options);
} }
else if(lei==3) else if (lei == 3) {
{
$("#searchParentId_t").empty().append('<option value="">全部</option>').append(options); $("#searchParentId_t").empty().append('<option value="">全部</option>').append(options);
} }
else if(lei==11) else if (lei == 11) {
{
$("#ParentId_f").empty().append('<option value="">全部</option>').append(options); $("#ParentId_f").empty().append('<option value="">全部</option>').append(options);
} }
else if(lei==12) else if (lei == 12) {
{
$("#ParentId_s").empty().append('<option value="">全部</option>').append(options); $("#ParentId_s").empty().append('<option value="">全部</option>').append(options);
} }
} }
} }
$("#searchParentId_f").change( $("#searchParentId_f").change(
function(){ function () {
var parentid_search=$("#searchParentId_f").val(); var parentid_search = $("#searchParentId_f").val();
if(parentid_search!='') if (parentid_search != '') {
{
initSystemData(parentid_search); initSystemData(parentid_search);
initSelectInfo(2); initSelectInfo(2);
} }
@@ -178,10 +170,9 @@
); );
$("#searchParentId_s").change( $("#searchParentId_s").change(
function(){ function () {
var parentid_search=$("#searchParentId_s").val(); var parentid_search = $("#searchParentId_s").val();
if(parentid_search!='') if (parentid_search != '') {
{
initSystemData(parentid_search); initSystemData(parentid_search);
initSelectInfo(3); initSelectInfo(3);
} }
@@ -189,21 +180,18 @@
); );
$("#CategoryLevel").change( $("#CategoryLevel").change(
function(){ function () {
var CategoryLevel=$("#CategoryLevel").val(); var CategoryLevel = $("#CategoryLevel").val();
if(CategoryLevel==1) if (CategoryLevel == 1) {
{
$("#ParentId_f").empty(); $("#ParentId_f").empty();
$("#ParentId_s").empty(); $("#ParentId_s").empty();
} }
else if(CategoryLevel==2) else if (CategoryLevel == 2) {
{
initSystemData(1); initSystemData(1);
initSelectInfo(11); initSelectInfo(11);
$("#ParentId_s").enabled=false; $("#ParentId_s").enabled = false;
} }
else if(CategoryLevel==3) else if (CategoryLevel == 3) {
{
initSystemData(1); initSystemData(1);
initSelectInfo(11); initSelectInfo(11);
} }
@@ -211,170 +199,152 @@
); );
$("#ParentId_f").change( $("#ParentId_f").change(
function(){ function () {
var ParentId_f=$("#ParentId_f").val(); var ParentId_f = $("#ParentId_f").val();
initSystemData(ParentId_f); initSystemData(ParentId_f);
initSelectInfo(12); initSelectInfo(12);
} }
); );
//防止表单提交重复 //防止表单提交重复
function initForm() function initForm() {
{
$('#materialCategoryFM').form({ $('#materialCategoryFM').form({
onSubmit: function(){ onSubmit: function () {
return false; return false;
} }
}); });
} }
//初始化表格数据 //初始化表格数据
function initTableData() function initTableData() {
{
$('#tableData').datagrid({ $('#tableData').datagrid({
//title:'商品类别列表', //title:'商品类别列表',
//iconCls:'icon-save', //iconCls:'icon-save',
//width:700, //width:700,
height:heightInfo, height: heightInfo,
nowrap: false, nowrap: false,
rownumbers: false, rownumbers: false,
//动画效果 //动画效果
animate:false, animate: false,
//选中单行 //选中单行
singleSelect : true, singleSelect: true,
collapsible:false, collapsible: false,
selectOnCheck:false, selectOnCheck: false,
//fitColumns:true, //fitColumns:true,
//单击行是否选中 //单击行是否选中
//checkOnSelect : false, //checkOnSelect : false,
url:'<%=path %>/materialCategory/findBy.action?pageSize=' + initPageSize+'&ParentId=1', url: '<%=path %>/materialCategory/findBy.action?pageSize=' + initPageSize + '&ParentId=1',
pagination: true, pagination: true,
//交替出现背景 //交替出现背景
striped : true, striped: true,
//loadFilter: pagerFilter, //loadFilter: pagerFilter,
pageSize: initPageSize, pageSize: initPageSize,
pageList: initPageNum, pageList: initPageNum,
columns:[[ columns: [[
{ field: 'Id',width:35,align:"center",checkbox:true}, {field: 'Id', width: 35, align: "center", checkbox: true},
{ title: '名称',field: 'Name',width:250}, {title: '名称', field: 'Name', width: 250},
{ title: '操作',field: 'op',align:"center",width:130,formatter:function(value,rec)
{ {
title: '操作', field: 'op', align: "center", width: 130, formatter: function (value, rec) {
var str = ''; var str = '';
var rowInfo = rec.Id + 'AaBb' + rec.ParentId+ 'AaBb' + rec.CategoryLevel+ 'AaBb' + rec.Name; var rowInfo = rec.Id + 'AaBb' + rec.ParentId + 'AaBb' + rec.CategoryLevel + 'AaBb' + rec.Name;
if(1 == value) if (1 == value) {
{
str += '<img src="<%=path%>/js/easyui-1.3.5/themes/icons/pencil.png" style="cursor: pointer;" onclick="editMaterialCategory(\'' + rowInfo + '\');"/>&nbsp;<a onclick="editMaterialCategory(\'' + 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/pencil.png" style="cursor: pointer;" onclick="editMaterialCategory(\'' + rowInfo + '\');"/>&nbsp;<a onclick="editMaterialCategory(\'' + 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="deleteMaterialCategory('+ rec.Id +');"/>&nbsp;<a onclick="deleteMaterialCategory('+ rec.Id +');" 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="deleteMaterialCategory(' + rec.Id + ');"/>&nbsp;<a onclick="deleteMaterialCategory(' + rec.Id + ');" style="text-decoration:none;color:black;" href="javascript:void(0)">删除</a>&nbsp;&nbsp;';
} }
return str; return str;
} }
} }
]], ]],
toolbar:[ toolbar: [
{
id:'addMaterialCategory',
text:'增加',
iconCls:'icon-add',
handler:function()
{ {
id: 'addMaterialCategory',
text: '增加',
iconCls: 'icon-add',
handler: function () {
addMaterialCategory(); addMaterialCategory();
} }
}, },
'-', '-',
{ {
id:'deleteMaterialCategory', id: 'deleteMaterialCategory',
text:'删除', text: '删除',
iconCls:'icon-remove', iconCls: 'icon-remove',
handler:function() handler: function () {
{
batDeleteMaterialCategory(); batDeleteMaterialCategory();
} }
} }
], ],
onLoadError:function() onLoadError: function () {
{ $.messager.alert('页面加载提示', '页面加载异常,请稍后再试!', 'error');
$.messager.alert('页面加载提示','页面加载异常,请稍后再试!','error');
return; return;
} }
}); });
} }
//初始化键盘enter事件 //初始化键盘enter事件
$(document).keydown(function(event) $(document).keydown(function (event) {
{
//兼容 IE和firefox 事件 //兼容 IE和firefox 事件
var e = window.event || event; var e = window.event || event;
var k = e.keyCode||e.which||e.charCode; var k = e.keyCode || e.which || e.charCode;
//兼容 IE,firefox 兼容 //兼容 IE,firefox 兼容
var obj = e.srcElement ? e.srcElement : e.target; var obj = e.srcElement ? e.srcElement : e.target;
//绑定键盘事件为 id是指定的输入框才可以触发键盘事件 13键盘事件 ---遗留问题 enter键效验 对话框会关闭问题 //绑定键盘事件为 id是指定的输入框才可以触发键盘事件 13键盘事件 ---遗留问题 enter键效验 对话框会关闭问题
if(k == "13"&&(obj.id=="CategoryLevel"||obj.id=="Name")) if (k == "13" && (obj.id == "CategoryLevel" || obj.id == "Name")) {
{
$("#saveMaterialCategory").click(); $("#saveMaterialCategory").click();
} }
//搜索按钮添加快捷键 //搜索按钮添加快捷键
if(k == "13"&&(obj.id=="searchParentId"||(obj.id=="searchName"))) if (k == "13" && (obj.id == "searchParentId" || (obj.id == "searchName"))) {
{
$("#searchBtn").click(); $("#searchBtn").click();
} }
}); });
//分页信息处理 //分页信息处理
function ininPager() function ininPager() {
{ try {
try
{
var opts = $("#tableData").datagrid('options'); var opts = $("#tableData").datagrid('options');
var pager = $("#tableData").datagrid('getPager'); var pager = $("#tableData").datagrid('getPager');
pager.pagination({ pager.pagination({
onSelectPage:function(pageNum, pageSize) onSelectPage: function (pageNum, pageSize) {
{
opts.pageNumber = pageNum; opts.pageNumber = pageNum;
opts.pageSize = pageSize; opts.pageSize = pageSize;
pager.pagination('refresh', pager.pagination('refresh',
{ {
pageNumber:pageNum, pageNumber: pageNum,
pageSize:pageSize pageSize: pageSize
}); });
showMaterialCategoryDetails(pageNum,pageSize); showMaterialCategoryDetails(pageNum, pageSize);
} }
}); });
} }
catch (e) catch (e) {
{ $.messager.alert('异常处理提示', "分页信息异常 : " + e.name + ": " + e.message, 'error');
$.messager.alert('异常处理提示',"分页信息异常 : " + e.name + ": " + e.message,'error');
} }
} }
//删除商品类别信息 //删除商品类别信息
function deleteMaterialCategory(materialCategoryID) function deleteMaterialCategory(materialCategoryID) {
{ $.messager.confirm('删除确认', '确定要删除此商品类别信息吗?', function (r) {
$.messager.confirm('删除确认','确定要删除此商品类别信息吗?',function(r) if (r) {
{
if (r)
{
$.ajax({ $.ajax({
type:"post", type: "post",
url: "<%=path %>/materialCategory/delete.action", url: "<%=path %>/materialCategory/delete.action",
dataType: "json", dataType: "json",
data: ({ data: ({
materialCategoryID : materialCategoryID, materialCategoryID: materialCategoryID,
clientIp:'<%=clientIp %>' clientIp: '<%=clientIp %>'
}), }),
success: function (tipInfo) success: function (tipInfo) {
{
var msg = tipInfo.showModel.msgTip; var msg = tipInfo.showModel.msgTip;
if(msg == '成功') if (msg == '成功') {
{
//加载完以后重新初始化 //加载完以后重新初始化
$("#searchBtn").click(); $("#searchBtn").click();
} }
else else
$.messager.alert('删除提示','删除商品类别信息失败,请稍后再试!','error'); $.messager.alert('删除提示', '删除商品类别信息失败,请稍后再试!', 'error');
}, },
//此处添加错误处理 //此处添加错误处理
error:function() error: function () {
{ $.messager.alert('删除提示', '删除商品类别信息异常,请稍后再试!', 'error');
$.messager.alert('删除提示','删除商品类别信息异常,请稍后再试!','error');
return; return;
} }
}); });
@@ -383,25 +353,18 @@
} }
//批量删除商品类别 //批量删除商品类别
function batDeleteMaterialCategory() function batDeleteMaterialCategory() {
{
var row = $('#tableData').datagrid('getChecked'); var row = $('#tableData').datagrid('getChecked');
if(row.length == 0) if (row.length == 0) {
{ $.messager.alert('删除提示', '没有记录被选中!', 'info');
$.messager.alert('删除提示','没有记录被选中!','info');
return; return;
} }
if(row.length > 0) if (row.length > 0) {
{ $.messager.confirm('删除确认', '确定要删除选中的' + row.length + '条商品类别信息吗?', function (r) {
$.messager.confirm('删除确认','确定要删除选中的' + row.length + '条商品类别信息吗?',function(r) if (r) {
{
if (r)
{
var ids = ""; var ids = "";
for(var i = 0;i < row.length; i ++) for (var i = 0; i < row.length; i++) {
{ if (i == row.length - 1) {
if(i == row.length-1)
{
ids += row[i].Id; ids += row[i].Id;
break; break;
} }
@@ -409,30 +372,27 @@
ids += row[i].Id + ","; ids += row[i].Id + ",";
} }
$.ajax({ $.ajax({
type:"post", type: "post",
url: "<%=path %>/materialCategory/batchDelete.action", url: "<%=path %>/materialCategory/batchDelete.action",
dataType: "json", dataType: "json",
async : false, async: false,
data: ({ data: ({
materialCategoryIDs : ids, materialCategoryIDs: ids,
clientIp:'<%=clientIp %>' clientIp: '<%=clientIp %>'
}), }),
success: function (tipInfo) success: function (tipInfo) {
{
var msg = tipInfo.showModel.msgTip; var msg = tipInfo.showModel.msgTip;
if(msg == '成功') if (msg == '成功') {
{
//加载完以后重新初始化 //加载完以后重新初始化
$("#searchBtn").click(); $("#searchBtn").click();
$(":checkbox").attr("checked",false); $(":checkbox").attr("checked", false);
} }
else else
$.messager.alert('删除提示','删除商品类别信息失败,请稍后再试!','error'); $.messager.alert('删除提示', '删除商品类别信息失败,请稍后再试!', 'error');
}, },
//此处添加错误处理 //此处添加错误处理
error:function() error: function () {
{ $.messager.alert('删除提示', '删除商品类别信息异常,请稍后再试!', 'error');
$.messager.alert('删除提示','删除商品类别信息异常,请稍后再试!','error');
return; return;
} }
}); });
@@ -447,12 +407,11 @@
//保存编辑前的名称 //保存编辑前的名称
var orgMaterialCategory = ""; var orgMaterialCategory = "";
function addMaterialCategory() function addMaterialCategory() {
{
$("#clientIp").val('<%=clientIp %>'); $("#clientIp").val('<%=clientIp %>');
$('#materialCategoryFM').form('clear'); $('#materialCategoryFM').form('clear');
$('#materialCategoryDlg').dialog('open').dialog('setTitle','<img src="<%=path%>/js/easyui-1.3.5/themes/icons/edit_add.png"/>&nbsp;增加商品类别信息'); $('#materialCategoryDlg').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}); $(".window-mask").css({width: webW, height: webH});
$("#Name").val("").focus(); $("#Name").val("").focus();
orgMaterialCategory = ""; orgMaterialCategory = "";
@@ -462,43 +421,36 @@
//保存信息 //保存信息
$("#saveMaterialCategory").unbind().bind({ $("#saveMaterialCategory").unbind().bind({
click:function() click: function () {
{ if (!$('#materialCategoryFM').form('validate'))
if(!$('#materialCategoryFM').form('validate'))
return; return;
else else {
{ var parent = 1;
var parent=1; if ($("#ParentId_f").val() != "" && $("#ParentId_f").val() != null) {
if($("#ParentId_f").val()!=""&&$("#ParentId_f").val()!=null) parent = $("#ParentId_f").val();
{
parent=$("#ParentId_f").val();
} }
if($("#ParentId_s").val()!=""&&$("#ParentId_s").val()!=null) if ($("#ParentId_s").val() != "" && $("#ParentId_s").val() != null) {
{ parent = $("#ParentId_s").val();
parent=$("#ParentId_s").val();
} }
$.ajax({ $.ajax({
type:"post", type: "post",
url: url, url: url,
dataType: "json", dataType: "json",
async : false, async: false,
data: ({ data: ({
ParentId : parent, ParentId: parent,
CategoryLevel : $("#CategoryLevel").val(), CategoryLevel: $("#CategoryLevel").val(),
Name : $.trim($("#Name").val()), Name: $.trim($("#Name").val()),
clientIp:'<%=clientIp %>' clientIp: '<%=clientIp %>'
}), }),
success: function (tipInfo) success: function (tipInfo) {
{ if (tipInfo) {
if(tipInfo)
{
$('#materialCategoryDlg').dialog('close'); $('#materialCategoryDlg').dialog('close');
var opts = $("#tableData").datagrid('options'); var opts = $("#tableData").datagrid('options');
showMaterialCategoryDetails(opts.pageNumber,opts.pageSize); showMaterialCategoryDetails(opts.pageNumber, opts.pageSize);
} }
else else {
{
$.messager.show({ $.messager.show({
title: '错误提示', title: '错误提示',
msg: '保存商品类别信息失败,请稍后重试!' msg: '保存商品类别信息失败,请稍后重试!'
@@ -506,9 +458,8 @@
} }
}, },
//此处添加错误处理 //此处添加错误处理
error:function() error: function () {
{ $.messager.alert('提示', '保存商品类别信息异常,请稍后再试!', 'error');
$.messager.alert('提示','保存商品类别信息异常,请稍后再试!','error');
return; return;
} }
}); });
@@ -517,8 +468,7 @@
}); });
//编辑信息 //编辑信息
function editMaterialCategory(materialCategoryTotalInfo) function editMaterialCategory(materialCategoryTotalInfo) {
{
var materialCategoryInfo = materialCategoryTotalInfo.split("AaBb"); var materialCategoryInfo = materialCategoryTotalInfo.split("AaBb");
$("#clientIp").val('<%=clientIp %>'); $("#clientIp").val('<%=clientIp %>');
@@ -527,8 +477,8 @@
$("#Name").val(materialCategoryInfo[3]); $("#Name").val(materialCategoryInfo[3]);
//orgMaterialCategory = materialCategoryInfo[1]; //orgMaterialCategory = materialCategoryInfo[1];
$('#materialCategoryDlg').dialog('open').dialog('setTitle','<img src="<%=path%>/js/easyui-1.3.5/themes/icons/pencil.png"/>&nbsp;编辑商品类别信息'); $('#materialCategoryDlg').dialog('open').dialog('setTitle', '<img src="<%=path%>/js/easyui-1.3.5/themes/icons/pencil.png"/>&nbsp;编辑商品类别信息');
$(".window-mask").css({ width: webW ,height: webH}); $(".window-mask").css({width: webW, height: webH});
materialCategoryID = materialCategoryInfo[0]; materialCategoryID = materialCategoryInfo[0];
//焦点在名称输入框==定焦在输入文字后面 //焦点在名称输入框==定焦在输入文字后面
$("#Name").val("").focus().val(materialCategoryInfo[3]); $("#Name").val("").focus().val(materialCategoryInfo[3]);
@@ -537,56 +487,49 @@
//搜索处理 //搜索处理
$("#searchBtn").unbind().bind({ $("#searchBtn").unbind().bind({
click:function() click: function () {
{ showMaterialCategoryDetails(1, initPageSize);
showMaterialCategoryDetails(1,initPageSize);
var opts = $("#tableData").datagrid('options'); var opts = $("#tableData").datagrid('options');
var pager = $("#tableData").datagrid('getPager'); var pager = $("#tableData").datagrid('getPager');
opts.pageNumber = 1; opts.pageNumber = 1;
opts.pageSize = initPageSize; opts.pageSize = initPageSize;
pager.pagination('refresh', pager.pagination('refresh',
{ {
pageNumber:1, pageNumber: 1,
pageSize:initPageSize pageSize: initPageSize
}); });
} }
}); });
function showMaterialCategoryDetails(pageNo,pageSize) function showMaterialCategoryDetails(pageNo, pageSize) {
{ var parent = 1;
var parent=1; if ($("#searchParentId_f").val() != "" && $("#searchParentId_f").val() != null) {
if($("#searchParentId_f").val()!=""&&$("#searchParentId_f").val()!=null) parent = $("#searchParentId_f").val();
{
parent=$("#searchParentId_f").val();
} }
if($("#searchParentId_s").val()!=""&&$("#searchParentId_s").val()!=null) if ($("#searchParentId_s").val() != "" && $("#searchParentId_s").val() != null) {
{ parent = $("#searchParentId_s").val();
parent=$("#searchParentId_s").val();
} }
if($("#searchParentId_t").val()!=""&&$("#searchParentId_t").val()!=null) if ($("#searchParentId_t").val() != "" && $("#searchParentId_t").val() != null) {
{ parent = $("#searchParentId_t").val();
parent=$("#searchParentId_t").val();
} }
$.ajax({ $.ajax({
type:"post", type: "post",
url: "<%=path %>/materialCategory/findBy.action", url: "<%=path %>/materialCategory/findBy.action",
dataType: "json", dataType: "json",
data: ({ data: ({
Name: $.trim($("#searchName").val()), Name: $.trim($("#searchName").val()),
ParentId:parent, ParentId: parent,
pageNo:pageNo, pageNo: pageNo,
pageSize:pageSize pageSize: pageSize
}), }),
success: function (data) success: function (data) {
{ $("#tableData").datagrid('loadData', data);
$("#tableData").datagrid('loadData',data);
}, },
//此处添加错误处理 //此处添加错误处理
error:function() error: function () {
{ $.messager.alert('查询提示', '查询数据后台异常,请稍后再试!', 'error');
$.messager.alert('查询提示','查询数据后台异常,请稍后再试!','error');
return; return;
} }
}); });
@@ -594,7 +537,7 @@
//重置按钮 //重置按钮
$("#searchResetBtn").unbind().bind({ $("#searchResetBtn").unbind().bind({
click:function(){ click: function () {
$("#searchParentId_f").val(""); $("#searchParentId_f").val("");
$("#searchParentId_s").val(""); $("#searchParentId_s").val("");
$("#searchParentId_t").val(""); $("#searchParentId_t").val("");
@@ -603,6 +546,6 @@
} }
}); });
</script> </script>
</body> </body>
</html> </html>

View File

@@ -1,21 +1,21 @@
<%@page import="com.jsh.util.Tools"%> <%@page import="com.jsh.util.Tools" %>
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%> <%@ page language="java" pageEncoding="utf-8" %>
<% <%
String path = request.getContextPath(); String path = request.getContextPath();
String clientIp = Tools.getLocalIp(request); String clientIp = Tools.getLocalIp(request);
%> %>
<!DOCTYPE html> <!DOCTYPE html>
<html> <html>
<head> <head>
<title>其它入库</title> <title>其它入库</title>
<meta charset="utf-8"> <meta charset="utf-8">
<!-- 指定以IE8的方式来渲染 --> <!-- 指定以IE8的方式来渲染 -->
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE8"/> <meta http-equiv="X-UA-Compatible" content="IE=EmulateIE8"/>
<link rel="shortcut icon" href="<%=path%>/images/favicon.ico" type="image/x-icon" /> <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/default/easyui.css"/>
<link rel="stylesheet" type="text/css" href="<%=path %>/js/easyui-1.3.5/themes/icon.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" /> <link type="text/css" rel="stylesheet" href="<%=path %>/css/common.css"/>
<link type="text/css" rel="stylesheet" href="<%=path %>/css/in_out.css" /> <link type="text/css" rel="stylesheet" href="<%=path %>/css/in_out.css"/>
<script src="<%=path %>/js/jquery-1.8.0.min.js"></script> <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/jquery.easyui.min.js"></script>
<script src="<%=path %>/js/easyui-1.3.5/locale/easyui-lang-zh_CN.js"></script> <script src="<%=path %>/js/easyui-1.3.5/locale/easyui-lang-zh_CN.js"></script>
@@ -27,10 +27,11 @@
var path = "<%=path%>"; var path = "<%=path%>";
var clientIp = "<%=clientIp%>"; var clientIp = "<%=clientIp%>";
</script> </script>
</head> </head>
<body> <body>
<!-- 查询 --> <!-- 查询 -->
<div id = "searchPanel" class="easyui-panel" style="padding:3px;" title="查询窗口" iconCls="icon-search" collapsible="true" closable="false"> <div id="searchPanel" class="easyui-panel" style="padding:3px;" title="查询窗口" iconCls="icon-search" collapsible="true"
closable="false">
<table id="searchTable"> <table id="searchTable">
<tr> <tr>
<td>单据编号:</td> <td>单据编号:</td>
@@ -43,11 +44,13 @@
</td> </td>
<td>单据日期:</td> <td>单据日期:</td>
<td> <td>
<input type="text" name="searchBeginTime" id="searchBeginTime" onClick="WdatePicker({dateFmt:'yyyy-MM-dd'})" class="txt Wdate" style="width:100px;"/> <input type="text" name="searchBeginTime" id="searchBeginTime"
onClick="WdatePicker({dateFmt:'yyyy-MM-dd'})" class="txt Wdate" style="width:100px;"/>
</td> </td>
<td>-</td> <td>-</td>
<td> <td>
<input type="text" name="searchEndTime" id="searchEndTime" onClick="WdatePicker({dateFmt:'yyyy-MM-dd'})" class="txt Wdate" style="width:100px;"/> <input type="text" name="searchEndTime" id="searchEndTime" onClick="WdatePicker({dateFmt:'yyyy-MM-dd'})"
class="txt Wdate" style="width:100px;"/>
</td> </td>
<td>&nbsp;</td> <td>&nbsp;</td>
<td> <td>
@@ -56,14 +59,15 @@
</td> </td>
</tr> </tr>
</table> </table>
</div> </div>
<!-- 数据显示table --> <!-- 数据显示table -->
<div id="tablePanel" class="easyui-panel" style="padding:1px; top:300px;" title="其它入库列表" iconCls="icon-list" collapsible="true" closable="false"> <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> <table id="tableData" style="top:300px;border-bottom-color:#FFFFFF"></table>
</div> </div>
<div id="depotHeadDlg" class="easyui-dialog" style="width:1200px;padding:10px 20px;top:60px" <div id="depotHeadDlg" class="easyui-dialog" style="width:1200px;padding:10px 20px;top:60px"
closed="true" buttons="#dlg-buttons" modal="true" cache="false" collapsible="false" closable="true"> closed="true" buttons="#dlg-buttons" modal="true" cache="false" collapsible="false" closable="true">
<form id="depotHeadFM" method="post" novalidate> <form id="depotHeadFM" method="post" novalidate>
<table> <table>
@@ -71,19 +75,23 @@
<td style="width:60px;">供应商:</td> <td style="width:60px;">供应商:</td>
<td style="padding:5px;width:170px;"> <td style="padding:5px;width:170px;">
<div class="org-list"> <div class="org-list">
<input id="OrganId" name="OrganId" style="width:130px;" /> <input id="OrganId" name="OrganId" style="width:130px;"/>
</div> </div>
<div class="add-org-btn"> <div class="add-org-btn">
<img id="addOrgan" src="<%=path %>/js/easyui-1.3.5/themes/icons/edit_add.png" style="cursor: pointer;" alt="增加供应商" title="增加供应商" /> <img id="addOrgan" src="<%=path %>/js/easyui-1.3.5/themes/icons/edit_add.png"
style="cursor: pointer;" alt="增加供应商" title="增加供应商"/>
</div> </div>
</td> </td>
<td style="width:70px;">单据日期:</td> <td style="width:70px;">单据日期:</td>
<td style="padding:5px"> <td style="padding:5px">
<input type="text" name="OperTime" id="OperTime" onClick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'})" class="txt Wdate" style="width:140px;"/> <input type="text" name="OperTime" id="OperTime"
onClick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'})" class="txt Wdate"
style="width:140px;"/>
</td> </td>
<td style="width:80px;">单据编号:</td> <td style="width:80px;">单据编号:</td>
<td style="padding:5px"> <td style="padding:5px">
<input name="Number" id="Number" class="easyui-validatebox" data-options="required:true,validType:'length[2,30]'" style="width: 140px;"/> <input name="Number" id="Number" class="easyui-validatebox"
data-options="required:true,validType:'length[2,30]'" style="width: 140px;"/>
</td> </td>
<td style="width:70px;"></td> <td style="width:70px;"></td>
<td style="padding:5px"> <td style="padding:5px">
@@ -98,18 +106,20 @@
</tr> </tr>
<tr> <tr>
<td colspan="9"> <td colspan="9">
<textarea name="Remark" id="Remark" rows="2" cols="2" placeholder="暂无备注信息" style="width: 1130px; height:35px;"></textarea> <textarea name="Remark" id="Remark" rows="2" cols="2" placeholder="暂无备注信息"
style="width: 1130px; height:35px;"></textarea>
</td> </td>
</tr> </tr>
</table> </table>
<input type="hidden" name="clientIp" id="clientIp" value="<%=clientIp %>"/> <input type="hidden" name="clientIp" id="clientIp" value="<%=clientIp %>"/>
</form> </form>
</div> </div>
<div id="dlg-buttons"> <div id="dlg-buttons">
<a href="javascript:void(0)" id="saveDepotHead" class="easyui-linkbutton" iconCls="icon-ok">保存</a> <a href="javascript:void(0)" id="saveDepotHead" class="easyui-linkbutton" iconCls="icon-ok">保存</a>
<a href="javascript:void(0)" id="cancelDepotHead" class="easyui-linkbutton" iconCls="icon-cancel" onclick="javascript:$('#depotHeadDlg').dialog('close')">取消</a> <a href="javascript:void(0)" id="cancelDepotHead" class="easyui-linkbutton" iconCls="icon-cancel"
</div> onclick="javascript:$('#depotHeadDlg').dialog('close')">取消</a>
<div id="depotHeadDlgShow" class="easyui-dialog" style="width:1200px;padding:10px 20px;top:70px" </div>
<div id="depotHeadDlgShow" class="easyui-dialog" style="width:1200px;padding:10px 20px;top:70px"
closed="true" modal="true" cache="false" collapsible="false" closable="true"> closed="true" modal="true" cache="false" collapsible="false" closable="true">
<table> <table>
<tr> <tr>
@@ -142,6 +152,6 @@
</td> </td>
</tr> </tr>
</table> </table>
</div> </div>
</body> </body>
</html> </html>

View File

@@ -1,21 +1,21 @@
<%@page import="com.jsh.util.Tools"%> <%@page import="com.jsh.util.Tools" %>
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%> <%@ page language="java" pageEncoding="utf-8" %>
<% <%
String path = request.getContextPath(); String path = request.getContextPath();
String clientIp = Tools.getLocalIp(request); String clientIp = Tools.getLocalIp(request);
%> %>
<!DOCTYPE html> <!DOCTYPE html>
<html> <html>
<head> <head>
<title>其它出库</title> <title>其它出库</title>
<meta charset="utf-8"> <meta charset="utf-8">
<!-- 指定以IE8的方式来渲染 --> <!-- 指定以IE8的方式来渲染 -->
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE8"/> <meta http-equiv="X-UA-Compatible" content="IE=EmulateIE8"/>
<link rel="shortcut icon" href="<%=path%>/images/favicon.ico" type="image/x-icon" /> <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/default/easyui.css"/>
<link rel="stylesheet" type="text/css" href="<%=path %>/js/easyui-1.3.5/themes/icon.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" /> <link type="text/css" rel="stylesheet" href="<%=path %>/css/common.css"/>
<link type="text/css" rel="stylesheet" href="<%=path %>/css/in_out.css" /> <link type="text/css" rel="stylesheet" href="<%=path %>/css/in_out.css"/>
<script src="<%=path %>/js/jquery-1.8.0.min.js"></script> <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/jquery.easyui.min.js"></script>
<script src="<%=path %>/js/easyui-1.3.5/locale/easyui-lang-zh_CN.js"></script> <script src="<%=path %>/js/easyui-1.3.5/locale/easyui-lang-zh_CN.js"></script>
@@ -27,10 +27,11 @@
var path = "<%=path%>"; var path = "<%=path%>";
var clientIp = "<%=clientIp%>"; var clientIp = "<%=clientIp%>";
</script> </script>
</head> </head>
<body> <body>
<!-- 查询 --> <!-- 查询 -->
<div id = "searchPanel" class="easyui-panel" style="padding:3px;" title="查询窗口" iconCls="icon-search" collapsible="true" closable="false"> <div id="searchPanel" class="easyui-panel" style="padding:3px;" title="查询窗口" iconCls="icon-search" collapsible="true"
closable="false">
<table id="searchTable"> <table id="searchTable">
<tr> <tr>
<td>单据编号:</td> <td>单据编号:</td>
@@ -43,11 +44,13 @@
</td> </td>
<td>单据日期:</td> <td>单据日期:</td>
<td> <td>
<input type="text" name="searchBeginTime" id="searchBeginTime" onClick="WdatePicker({dateFmt:'yyyy-MM-dd'})" class="txt Wdate" style="width:100px;"/> <input type="text" name="searchBeginTime" id="searchBeginTime"
onClick="WdatePicker({dateFmt:'yyyy-MM-dd'})" class="txt Wdate" style="width:100px;"/>
</td> </td>
<td>-</td> <td>-</td>
<td> <td>
<input type="text" name="searchEndTime" id="searchEndTime" onClick="WdatePicker({dateFmt:'yyyy-MM-dd'})" class="txt Wdate" style="width:100px;"/> <input type="text" name="searchEndTime" id="searchEndTime" onClick="WdatePicker({dateFmt:'yyyy-MM-dd'})"
class="txt Wdate" style="width:100px;"/>
</td> </td>
<td>&nbsp;</td> <td>&nbsp;</td>
<td> <td>
@@ -56,29 +59,33 @@
</td> </td>
</tr> </tr>
</table> </table>
</div> </div>
<!-- 数据显示table --> <!-- 数据显示table -->
<div id="tablePanel" class="easyui-panel" style="padding:1px; top:300px;" title="其它出库列表" iconCls="icon-list" collapsible="true" closable="false"> <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> <table id="tableData" style="top:300px;border-bottom-color:#FFFFFF"></table>
</div> </div>
<div id="depotHeadDlg" class="easyui-dialog" style="width:1200px;padding:10px 20px;top:60px" <div id="depotHeadDlg" class="easyui-dialog" style="width:1200px;padding:10px 20px;top:60px"
closed="true" buttons="#dlg-buttons" modal="true" cache="false" collapsible="false" closable="true"> closed="true" buttons="#dlg-buttons" modal="true" cache="false" collapsible="false" closable="true">
<form id="depotHeadFM" method="post" novalidate> <form id="depotHeadFM" method="post" novalidate>
<table> <table>
<tr> <tr>
<td style="width:60px;">客户:</td> <td style="width:60px;">客户:</td>
<td style="padding:5px;width:170px;"> <td style="padding:5px;width:170px;">
<input id="OrganId" name="OrganId" style="width:130px;" /> <input id="OrganId" name="OrganId" style="width:130px;"/>
</td> </td>
<td style="width:70px;">单据日期:</td> <td style="width:70px;">单据日期:</td>
<td style="padding:5px"> <td style="padding:5px">
<input type="text" name="OperTime" id="OperTime" onClick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'})" class="txt Wdate" style="width:140px;"/> <input type="text" name="OperTime" id="OperTime"
onClick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'})" class="txt Wdate"
style="width:140px;"/>
</td> </td>
<td style="width:80px;">单据编号:</td> <td style="width:80px;">单据编号:</td>
<td style="padding:5px"> <td style="padding:5px">
<input name="Number" id="Number" class="easyui-validatebox" data-options="required:true,validType:'length[2,30]'" style="width: 140px;"/> <input name="Number" id="Number" class="easyui-validatebox"
data-options="required:true,validType:'length[2,30]'" style="width: 140px;"/>
</td> </td>
<td style="width:70px;"></td> <td style="width:70px;"></td>
<td style="padding:5px"> <td style="padding:5px">
@@ -93,18 +100,20 @@
</tr> </tr>
<tr> <tr>
<td colspan="9"> <td colspan="9">
<textarea name="Remark" id="Remark" rows="2" cols="2" placeholder="暂无备注信息" style="width: 1130px; height:35px;"></textarea> <textarea name="Remark" id="Remark" rows="2" cols="2" placeholder="暂无备注信息"
style="width: 1130px; height:35px;"></textarea>
</td> </td>
</tr> </tr>
</table> </table>
<input type="hidden" name="clientIp" id="clientIp" value="<%=clientIp %>"/> <input type="hidden" name="clientIp" id="clientIp" value="<%=clientIp %>"/>
</form> </form>
</div> </div>
<div id="dlg-buttons"> <div id="dlg-buttons">
<a href="javascript:void(0)" id="saveDepotHead" class="easyui-linkbutton" iconCls="icon-ok">保存</a> <a href="javascript:void(0)" id="saveDepotHead" class="easyui-linkbutton" iconCls="icon-ok">保存</a>
<a href="javascript:void(0)" id="cancelDepotHead" class="easyui-linkbutton" iconCls="icon-cancel" onclick="javascript:$('#depotHeadDlg').dialog('close')">取消</a> <a href="javascript:void(0)" id="cancelDepotHead" class="easyui-linkbutton" iconCls="icon-cancel"
</div> onclick="javascript:$('#depotHeadDlg').dialog('close')">取消</a>
<div id="depotHeadDlgShow" class="easyui-dialog" style="width:1200px;padding:10px 20px;top:70px" </div>
<div id="depotHeadDlgShow" class="easyui-dialog" style="width:1200px;padding:10px 20px;top:70px"
closed="true" modal="true" cache="false" collapsible="false" closable="true"> closed="true" modal="true" cache="false" collapsible="false" closable="true">
<table> <table>
<tr> <tr>
@@ -137,6 +146,6 @@
</td> </td>
</tr> </tr>
</table> </table>
</div> </div>
</body> </body>
</html> </html>

View File

@@ -1,29 +1,30 @@
<%@page import="com.jsh.util.Tools"%> <%@page import="com.jsh.util.Tools" %>
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%> <%@ page language="java" pageEncoding="utf-8" %>
<% <%
String path = request.getContextPath(); String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/"; String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + path + "/";
String clientIp = Tools.getLocalIp(request); String clientIp = Tools.getLocalIp(request);
%> %>
<!DOCTYPE html> <!DOCTYPE html>
<html> <html>
<head> <head>
<title>经手人管理</title> <title>经手人管理</title>
<meta charset="utf-8"> <meta charset="utf-8">
<!-- 指定以IE8的方式来渲染 --> <!-- 指定以IE8的方式来渲染 -->
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE8"/> <meta http-equiv="X-UA-Compatible" content="IE=EmulateIE8"/>
<link rel="shortcut icon" href="<%=path%>/images/favicon.ico" type="image/x-icon" /> <link rel="shortcut icon" href="<%=path%>/images/favicon.ico" type="image/x-icon"/>
<script type="text/javascript" src="<%=path %>/js/jquery-1.8.0.min.js"></script> <script type="text/javascript" src="<%=path %>/js/jquery-1.8.0.min.js"></script>
<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/default/easyui.css"/>
<link rel="stylesheet" type="text/css" href="<%=path %>/js/easyui-1.3.5/themes/icon.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" /> <link type="text/css" rel="stylesheet" href="<%=path %>/css/common.css"/>
<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/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/locale/easyui-lang-zh_CN.js"></script>
<script type="text/javascript" src="<%=path %>/js/common/common.js"></script> <script type="text/javascript" src="<%=path %>/js/common/common.js"></script>
</head> </head>
<body> <body>
<!-- 查询 --> <!-- 查询 -->
<div id = "searchPanel" class="easyui-panel" style="padding:10px;" title="查询窗口" iconCls="icon-search" collapsible="true" closable="false"> <div id="searchPanel" class="easyui-panel" style="padding:10px;" title="查询窗口" iconCls="icon-search" collapsible="true"
closable="false">
<table id="searchTable"> <table id="searchTable">
<tr> <tr>
<td>姓名:</td> <td>姓名:</td>
@@ -48,14 +49,15 @@
</td> </td>
</tr> </tr>
</table> </table>
</div> </div>
<!-- 数据显示table --> <!-- 数据显示table -->
<div id = "tablePanel" class="easyui-panel" style="padding:1px;top:300px;" title="经手人列表" iconCls="icon-list" collapsible="true" closable="false"> <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> <table id="tableData" style="top:300px;border-bottom-color:#FFFFFF"></table>
</div> </div>
<div id="personDlg" class="easyui-dialog" style="width:380px;padding:10px 20px" <div id="personDlg" class="easyui-dialog" style="width:380px;padding:10px 20px"
closed="true" buttons="#dlg-buttons" modal="true" cache="false" collapsible="false" closable="true"> closed="true" buttons="#dlg-buttons" modal="true" cache="false" collapsible="false" closable="true">
<form id="personFM" method="post" novalidate> <form id="personFM" method="post" novalidate>
<table> <table>
@@ -73,24 +75,25 @@
<tr> <tr>
<td>姓名</td> <td>姓名</td>
<td style="padding:5px"> <td style="padding:5px">
<input name="Name" id="Name" class="easyui-validatebox" data-options="required:true,validType:'length[2,30]'" style="width: 230px;height: 20px"/> <input name="Name" id="Name" class="easyui-validatebox"
data-options="required:true,validType:'length[2,30]'" style="width: 230px;height: 20px"/>
</td> </td>
</tr> </tr>
</table> </table>
<input type="hidden" name="clientIp" id="clientIp" value="<%=clientIp %>"/> <input type="hidden" name="clientIp" id="clientIp" value="<%=clientIp %>"/>
</form> </form>
</div> </div>
<div id="dlg-buttons"> <div id="dlg-buttons">
<a href="javascript:void(0)" id="savePerson" class="easyui-linkbutton" iconCls="icon-ok">保存</a> <a href="javascript:void(0)" id="savePerson" class="easyui-linkbutton" iconCls="icon-ok">保存</a>
<a href="javascript:void(0)" id="cancelPerson" class="easyui-linkbutton" iconCls="icon-cancel" onclick="javascript:$('#personDlg').dialog('close')">取消</a> <a href="javascript:void(0)" id="cancelPerson" class="easyui-linkbutton" iconCls="icon-cancel"
</div> onclick="javascript:$('#personDlg').dialog('close')">取消</a>
</div>
<script type="text/javascript"> <script type="text/javascript">
var depotList = null; var depotList = null;
var depotID = null; var depotID = null;
//初始化界面 //初始化界面
$(function() $(function () {
{
//初始化系统基础信息 //初始化系统基础信息
initSystemData(); initSystemData();
initSelectInfo(); initSelectInfo();
@@ -100,39 +103,33 @@
}); });
//初始化系统基础信息 //初始化系统基础信息
function initSystemData() function initSystemData() {
{
$.ajax({ $.ajax({
type:"post", type: "post",
url: "<%=path%>/depot/getBasicData.action", url: "<%=path%>/depot/getBasicData.action",
//设置为同步 //设置为同步
async:false, async: false,
dataType: "json", dataType: "json",
success: function (systemInfo) success: function (systemInfo) {
{
depotList = systemInfo.showModel.map.depotList; depotList = systemInfo.showModel.map.depotList;
var msgTip = systemInfo.showModel.msgTip; var msgTip = systemInfo.showModel.msgTip;
if(msgTip == "exceptoin") if (msgTip == "exceptoin") {
{ $.messager.alert('提示', '查找系统基础信息异常,请与管理员联系!', 'error');
$.messager.alert('提示','查找系统基础信息异常,请与管理员联系!','error');
return; return;
} }
} }
}); });
} }
//初始化页面选项卡 //初始化页面选项卡
function initSelectInfo() function initSelectInfo() {
{
var options = ""; var options = "";
if(depotList !=null) if (depotList != null) {
{
options = ""; options = "";
for(var i = 0 ;i < depotList.length;i ++) for (var i = 0; i < depotList.length; i++) {
{
var depot = depotList[i]; var depot = depotList[i];
if(0 == i) if (0 == i) {
{
depotID = depot.id; depotID = depot.id;
} }
options += '<option value="' + depot.id + '">' + depot.name + '</option>'; options += '<option value="' + depot.id + '">' + depot.name + '</option>';
@@ -143,162 +140,144 @@
} }
//防止表单提交重复 //防止表单提交重复
function initForm() function initForm() {
{
$('#personFM').form({ $('#personFM').form({
onSubmit: function(){ onSubmit: function () {
return false; return false;
} }
}); });
} }
//初始化表格数据 //初始化表格数据
function initTableData() function initTableData() {
{
$('#tableData').datagrid({ $('#tableData').datagrid({
//title:'经手人列表', //title:'经手人列表',
//iconCls:'icon-save', //iconCls:'icon-save',
//width:700, //width:700,
height:heightInfo, height: heightInfo,
nowrap: false, nowrap: false,
rownumbers: false, rownumbers: false,
//动画效果 //动画效果
animate:false, animate: false,
//选中单行 //选中单行
singleSelect : true, singleSelect: true,
collapsible:false, collapsible: false,
selectOnCheck:false, selectOnCheck: false,
//fitColumns:true, //fitColumns:true,
//单击行是否选中 //单击行是否选中
//checkOnSelect : false, //checkOnSelect : false,
url:'<%=path %>/person/findBy.action?pageSize=' + initPageSize, url: '<%=path %>/person/findBy.action?pageSize=' + initPageSize,
pagination: true, pagination: true,
//交替出现背景 //交替出现背景
striped : true, striped: true,
//loadFilter: pagerFilter, //loadFilter: pagerFilter,
pageSize: initPageSize, pageSize: initPageSize,
pageList: initPageNum, pageList: initPageNum,
columns:[[ columns: [[
{ field: 'Id',width:35,align:"center",checkbox:true}, {field: 'Id', width: 35, align: "center", checkbox: true},
{ title: '姓名',field: 'Name',width:180}, {title: '姓名', field: 'Name', width: 180},
{ title: '类型',field: 'Type',width:180}, {title: '类型', field: 'Type', width: 180},
{ title: '操作',field: 'op',align:"center",width:130,formatter:function(value,rec)
{ {
title: '操作', field: 'op', align: "center", width: 130, formatter: function (value, rec) {
var str = ''; var str = '';
var rowInfo = rec.Id + 'AaBb' + rec.Type+ 'AaBb' + rec.Name; var rowInfo = rec.Id + 'AaBb' + rec.Type + 'AaBb' + rec.Name;
if(1 == value) if (1 == value) {
{
str += '<img src="<%=path%>/js/easyui-1.3.5/themes/icons/pencil.png" style="cursor: pointer;" onclick="editPerson(\'' + rowInfo + '\');"/>&nbsp;<a onclick="editPerson(\'' + 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/pencil.png" style="cursor: pointer;" onclick="editPerson(\'' + rowInfo + '\');"/>&nbsp;<a onclick="editPerson(\'' + 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="deletePerson('+ rec.Id +');"/>&nbsp;<a onclick="deletePerson('+ rec.Id +');" 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="deletePerson(' + rec.Id + ');"/>&nbsp;<a onclick="deletePerson(' + rec.Id + ');" style="text-decoration:none;color:black;" href="javascript:void(0)">删除</a>&nbsp;&nbsp;';
} }
return str; return str;
} }
} }
]], ]],
toolbar:[ toolbar: [
{
id:'addPerson',
text:'增加',
iconCls:'icon-add',
handler:function()
{ {
id: 'addPerson',
text: '增加',
iconCls: 'icon-add',
handler: function () {
addPerson(); addPerson();
} }
}, },
{ {
id:'deletePerson', id: 'deletePerson',
text:'删除', text: '删除',
iconCls:'icon-remove', iconCls: 'icon-remove',
handler:function() handler: function () {
{
batDeletePerson(); batDeletePerson();
} }
} }
], ],
onLoadError:function() onLoadError: function () {
{ $.messager.alert('页面加载提示', '页面加载异常,请稍后再试!', 'error');
$.messager.alert('页面加载提示','页面加载异常,请稍后再试!','error');
return; return;
} }
}); });
} }
//初始化键盘enter事件 //初始化键盘enter事件
$(document).keydown(function(event) $(document).keydown(function (event) {
{
//兼容 IE和firefox 事件 //兼容 IE和firefox 事件
var e = window.event || event; var e = window.event || event;
var k = e.keyCode||e.which||e.charCode; var k = e.keyCode || e.which || e.charCode;
//兼容 IE,firefox 兼容 //兼容 IE,firefox 兼容
var obj = e.srcElement ? e.srcElement : e.target; var obj = e.srcElement ? e.srcElement : e.target;
//绑定键盘事件为 id是指定的输入框才可以触发键盘事件 13键盘事件 ---遗留问题 enter键效验 对话框会关闭问题 //绑定键盘事件为 id是指定的输入框才可以触发键盘事件 13键盘事件 ---遗留问题 enter键效验 对话框会关闭问题
if(k == "13"&&(obj.id=="Type"||obj.id=="Name")) if (k == "13" && (obj.id == "Type" || obj.id == "Name")) {
{
$("#savePerson").click(); $("#savePerson").click();
} }
//搜索按钮添加快捷键 //搜索按钮添加快捷键
if(k == "13"&&(obj.id=="searchType")) if (k == "13" && (obj.id == "searchType")) {
{
$("#searchBtn").click(); $("#searchBtn").click();
} }
}); });
//分页信息处理 //分页信息处理
function ininPager() function ininPager() {
{ try {
try
{
var opts = $("#tableData").datagrid('options'); var opts = $("#tableData").datagrid('options');
var pager = $("#tableData").datagrid('getPager'); var pager = $("#tableData").datagrid('getPager');
pager.pagination({ pager.pagination({
onSelectPage:function(pageNum, pageSize) onSelectPage: function (pageNum, pageSize) {
{
opts.pageNumber = pageNum; opts.pageNumber = pageNum;
opts.pageSize = pageSize; opts.pageSize = pageSize;
pager.pagination('refresh', pager.pagination('refresh',
{ {
pageNumber:pageNum, pageNumber: pageNum,
pageSize:pageSize pageSize: pageSize
}); });
showPersonDetails(pageNum,pageSize); showPersonDetails(pageNum, pageSize);
} }
}); });
} }
catch (e) catch (e) {
{ $.messager.alert('异常处理提示', "分页信息异常 : " + e.name + ": " + e.message, 'error');
$.messager.alert('异常处理提示',"分页信息异常 : " + e.name + ": " + e.message,'error');
} }
} }
//删除经手人信息 //删除经手人信息
function deletePerson(personID) function deletePerson(personID) {
{ $.messager.confirm('删除确认', '确定要删除此经手人信息吗?', function (r) {
$.messager.confirm('删除确认','确定要删除此经手人信息吗?',function(r) if (r) {
{
if (r)
{
$.ajax({ $.ajax({
type:"post", type: "post",
url: "<%=path %>/person/delete.action", url: "<%=path %>/person/delete.action",
dataType: "json", dataType: "json",
data: ({ data: ({
personID : personID, personID: personID,
clientIp:'<%=clientIp %>' clientIp: '<%=clientIp %>'
}), }),
success: function (tipInfo) success: function (tipInfo) {
{
var msg = tipInfo.showModel.msgTip; var msg = tipInfo.showModel.msgTip;
if(msg == '成功') if (msg == '成功') {
{
//加载完以后重新初始化 //加载完以后重新初始化
$("#searchBtn").click(); $("#searchBtn").click();
} }
else else
$.messager.alert('删除提示','删除经手人信息失败,请稍后再试!','error'); $.messager.alert('删除提示', '删除经手人信息失败,请稍后再试!', 'error');
}, },
//此处添加错误处理 //此处添加错误处理
error:function() error: function () {
{ $.messager.alert('删除提示', '删除经手人信息异常,请稍后再试!', 'error');
$.messager.alert('删除提示','删除经手人信息异常,请稍后再试!','error');
return; return;
} }
}); });
@@ -307,25 +286,18 @@
} }
//批量删除经手人 //批量删除经手人
function batDeletePerson() function batDeletePerson() {
{
var row = $('#tableData').datagrid('getChecked'); var row = $('#tableData').datagrid('getChecked');
if(row.length == 0) if (row.length == 0) {
{ $.messager.alert('删除提示', '没有记录被选中!', 'info');
$.messager.alert('删除提示','没有记录被选中!','info');
return; return;
} }
if(row.length > 0) if (row.length > 0) {
{ $.messager.confirm('删除确认', '确定要删除选中的' + row.length + '条经手人信息吗?', function (r) {
$.messager.confirm('删除确认','确定要删除选中的' + row.length + '条经手人信息吗?',function(r) if (r) {
{
if (r)
{
var ids = ""; var ids = "";
for(var i = 0;i < row.length; i ++) for (var i = 0; i < row.length; i++) {
{ if (i == row.length - 1) {
if(i == row.length-1)
{
ids += row[i].Id; ids += row[i].Id;
break; break;
} }
@@ -333,30 +305,27 @@
ids += row[i].Id + ","; ids += row[i].Id + ",";
} }
$.ajax({ $.ajax({
type:"post", type: "post",
url: "<%=path %>/person/batchDelete.action", url: "<%=path %>/person/batchDelete.action",
dataType: "json", dataType: "json",
async : false, async: false,
data: ({ data: ({
personIDs : ids, personIDs: ids,
clientIp:'<%=clientIp %>' clientIp: '<%=clientIp %>'
}), }),
success: function (tipInfo) success: function (tipInfo) {
{
var msg = tipInfo.showModel.msgTip; var msg = tipInfo.showModel.msgTip;
if(msg == '成功') if (msg == '成功') {
{
//加载完以后重新初始化 //加载完以后重新初始化
$("#searchBtn").click(); $("#searchBtn").click();
$(":checkbox").attr("checked",false); $(":checkbox").attr("checked", false);
} }
else else
$.messager.alert('删除提示','删除经手人信息失败,请稍后再试!','error'); $.messager.alert('删除提示', '删除经手人信息失败,请稍后再试!', 'error');
}, },
//此处添加错误处理 //此处添加错误处理
error:function() error: function () {
{ $.messager.alert('删除提示', '删除经手人信息异常,请稍后再试!', 'error');
$.messager.alert('删除提示','删除经手人信息异常,请稍后再试!','error');
return; return;
} }
}); });
@@ -371,12 +340,11 @@
//保存编辑前的名称 //保存编辑前的名称
var orgPerson = ""; var orgPerson = "";
function addPerson() function addPerson() {
{
$("#clientIp").val('<%=clientIp %>'); $("#clientIp").val('<%=clientIp %>');
$('#personFM').form('clear'); $('#personFM').form('clear');
$('#personDlg').dialog('open').dialog('setTitle','<img src="<%=path%>/js/easyui-1.3.5/themes/icons/edit_add.png"/>&nbsp;增加经手人信息'); $('#personDlg').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}); $(".window-mask").css({width: webW, height: webH});
$("#name").val("").focus(); $("#name").val("").focus();
orgPerson = ""; orgPerson = "";
@@ -386,37 +354,32 @@
//保存信息 //保存信息
$("#savePerson").unbind().bind({ $("#savePerson").unbind().bind({
click:function() click: function () {
{ if (!$('#personFM').form('validate'))
if(!$('#personFM').form('validate'))
return; return;
else else {
{ if (!$("#Type").val()) {
if(!$("#Type").val()){ $.messager.alert('提示', '请选择类型!', 'warning');
$.messager.alert('提示','请选择类型!','warning');
return; return;
} }
$.ajax({ $.ajax({
type:"post", type: "post",
url: url, url: url,
dataType: "json", dataType: "json",
async : false, async: false,
data: ({ data: ({
Type : $.trim($("#Type").val()), Type: $.trim($("#Type").val()),
Name : $.trim($("#Name").val()), Name: $.trim($("#Name").val()),
clientIp:'<%=clientIp %>' clientIp: '<%=clientIp %>'
}), }),
success: function (tipInfo) success: function (tipInfo) {
{ if (tipInfo) {
if(tipInfo)
{
$('#personDlg').dialog('close'); $('#personDlg').dialog('close');
var opts = $("#tableData").datagrid('options'); var opts = $("#tableData").datagrid('options');
showPersonDetails(opts.pageNumber,opts.pageSize); showPersonDetails(opts.pageNumber, opts.pageSize);
} }
else else {
{
$.messager.show({ $.messager.show({
title: '错误提示', title: '错误提示',
msg: '保存经手人信息失败,请稍后重试!' msg: '保存经手人信息失败,请稍后重试!'
@@ -424,9 +387,8 @@
} }
}, },
//此处添加错误处理 //此处添加错误处理
error:function() error: function () {
{ $.messager.alert('提示', '保存经手人信息异常,请稍后再试!', 'error');
$.messager.alert('提示','保存经手人信息异常,请稍后再试!','error');
return; return;
} }
}); });
@@ -435,8 +397,7 @@
}); });
//编辑信息 //编辑信息
function editPerson(personTotalInfo) function editPerson(personTotalInfo) {
{
var personInfo = personTotalInfo.split("AaBb"); var personInfo = personTotalInfo.split("AaBb");
$("#clientIp").val('<%=clientIp %>'); $("#clientIp").val('<%=clientIp %>');
@@ -444,8 +405,8 @@
$("#Name").val(personInfo[2]); $("#Name").val(personInfo[2]);
//orgPerson = personInfo[1]; //orgPerson = personInfo[1];
$('#personDlg').dialog('open').dialog('setTitle','<img src="<%=path%>/js/easyui-1.3.5/themes/icons/pencil.png"/>&nbsp;编辑经手人信息'); $('#personDlg').dialog('open').dialog('setTitle', '<img src="<%=path%>/js/easyui-1.3.5/themes/icons/pencil.png"/>&nbsp;编辑经手人信息');
$(".window-mask").css({ width: webW ,height: webH}); $(".window-mask").css({width: webW, height: webH});
personID = personInfo[0]; personID = personInfo[0];
//焦点在名称输入框==定焦在输入文字后面 //焦点在名称输入框==定焦在输入文字后面
$("#Name").val("").focus().val(personInfo[2]); $("#Name").val("").focus().val(personInfo[2]);
@@ -454,41 +415,37 @@
//搜索处理 //搜索处理
$("#searchBtn").unbind().bind({ $("#searchBtn").unbind().bind({
click:function() click: function () {
{ showPersonDetails(1, initPageSize);
showPersonDetails(1,initPageSize);
var opts = $("#tableData").datagrid('options'); var opts = $("#tableData").datagrid('options');
var pager = $("#tableData").datagrid('getPager'); var pager = $("#tableData").datagrid('getPager');
opts.pageNumber = 1; opts.pageNumber = 1;
opts.pageSize = initPageSize; opts.pageSize = initPageSize;
pager.pagination('refresh', pager.pagination('refresh',
{ {
pageNumber:1, pageNumber: 1,
pageSize:initPageSize pageSize: initPageSize
}); });
} }
}); });
function showPersonDetails(pageNo,pageSize) function showPersonDetails(pageNo, pageSize) {
{
$.ajax({ $.ajax({
type:"post", type: "post",
url: "<%=path %>/person/findBy.action", url: "<%=path %>/person/findBy.action",
dataType: "json", dataType: "json",
data: ({ data: ({
Name:$.trim($("#searchName").val()), Name: $.trim($("#searchName").val()),
Type:$.trim($("#searchType").val()), Type: $.trim($("#searchType").val()),
pageNo:pageNo, pageNo: pageNo,
pageSize:pageSize pageSize: pageSize
}), }),
success: function (data) success: function (data) {
{ $("#tableData").datagrid('loadData', data);
$("#tableData").datagrid('loadData',data);
}, },
//此处添加错误处理 //此处添加错误处理
error:function() error: function () {
{ $.messager.alert('查询提示', '查询数据后台异常,请稍后再试!', 'error');
$.messager.alert('查询提示','查询数据后台异常,请稍后再试!','error');
return; return;
} }
}); });
@@ -496,7 +453,7 @@
//重置按钮 //重置按钮
$("#searchResetBtn").unbind().bind({ $("#searchResetBtn").unbind().bind({
click:function(){ click: function () {
$("#searchProjectId").val(""); $("#searchProjectId").val("");
$("#searchType").val(""); $("#searchType").val("");
@@ -505,6 +462,6 @@
} }
}); });
</script> </script>
</body> </body>
</html> </html>

View File

@@ -1,21 +1,21 @@
<%@page import="com.jsh.util.Tools"%> <%@page import="com.jsh.util.Tools" %>
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%> <%@ page language="java" pageEncoding="utf-8" %>
<% <%
String path = request.getContextPath(); String path = request.getContextPath();
String clientIp = Tools.getLocalIp(request); String clientIp = Tools.getLocalIp(request);
%> %>
<!DOCTYPE html> <!DOCTYPE html>
<html> <html>
<head> <head>
<title>采购退货</title> <title>采购退货</title>
<meta charset="utf-8"> <meta charset="utf-8">
<!-- 指定以IE8的方式来渲染 --> <!-- 指定以IE8的方式来渲染 -->
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE8"/> <meta http-equiv="X-UA-Compatible" content="IE=EmulateIE8"/>
<link rel="shortcut icon" href="<%=path%>/images/favicon.ico" type="image/x-icon" /> <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/default/easyui.css"/>
<link rel="stylesheet" type="text/css" href="<%=path %>/js/easyui-1.3.5/themes/icon.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" /> <link type="text/css" rel="stylesheet" href="<%=path %>/css/common.css"/>
<link type="text/css" rel="stylesheet" href="<%=path %>/css/in_out.css" /> <link type="text/css" rel="stylesheet" href="<%=path %>/css/in_out.css"/>
<script src="<%=path %>/js/jquery-1.8.0.min.js"></script> <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/jquery.easyui.min.js"></script>
<script src="<%=path %>/js/easyui-1.3.5/locale/easyui-lang-zh_CN.js"></script> <script src="<%=path %>/js/easyui-1.3.5/locale/easyui-lang-zh_CN.js"></script>
@@ -27,10 +27,11 @@
var path = "<%=path%>"; var path = "<%=path%>";
var clientIp = "<%=clientIp%>"; var clientIp = "<%=clientIp%>";
</script> </script>
</head> </head>
<body> <body>
<!-- 查询 --> <!-- 查询 -->
<div id = "searchPanel" class="easyui-panel" style="padding:3px;" title="查询窗口" iconCls="icon-search" collapsible="true" closable="false"> <div id="searchPanel" class="easyui-panel" style="padding:3px;" title="查询窗口" iconCls="icon-search" collapsible="true"
closable="false">
<table id="searchTable"> <table id="searchTable">
<tr> <tr>
<td>单据编号:</td> <td>单据编号:</td>
@@ -43,11 +44,13 @@
</td> </td>
<td>单据日期:</td> <td>单据日期:</td>
<td> <td>
<input type="text" name="searchBeginTime" id="searchBeginTime" onClick="WdatePicker({dateFmt:'yyyy-MM-dd'})" class="txt Wdate" style="width:100px;"/> <input type="text" name="searchBeginTime" id="searchBeginTime"
onClick="WdatePicker({dateFmt:'yyyy-MM-dd'})" class="txt Wdate" style="width:100px;"/>
</td> </td>
<td>-</td> <td>-</td>
<td> <td>
<input type="text" name="searchEndTime" id="searchEndTime" onClick="WdatePicker({dateFmt:'yyyy-MM-dd'})" class="txt Wdate" style="width:100px;"/> <input type="text" name="searchEndTime" id="searchEndTime" onClick="WdatePicker({dateFmt:'yyyy-MM-dd'})"
class="txt Wdate" style="width:100px;"/>
</td> </td>
<td>&nbsp;</td> <td>&nbsp;</td>
<td> <td>
@@ -56,14 +59,15 @@
</td> </td>
</tr> </tr>
</table> </table>
</div> </div>
<!-- 数据显示table --> <!-- 数据显示table -->
<div id="tablePanel" class="easyui-panel" style="padding:1px; top:300px;" title="采购退货列表" iconCls="icon-list" collapsible="true" closable="false"> <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> <table id="tableData" style="top:300px;border-bottom-color:#FFFFFF"></table>
</div> </div>
<div id="depotHeadDlg" class="easyui-dialog" style="width:1200px;padding:10px 20px;top:20px" <div id="depotHeadDlg" class="easyui-dialog" style="width:1200px;padding:10px 20px;top:20px"
closed="true" buttons="#dlg-buttons" modal="true" cache="false" collapsible="false" closable="true"> closed="true" buttons="#dlg-buttons" modal="true" cache="false" collapsible="false" closable="true">
<form id="depotHeadFM" method="post" novalidate> <form id="depotHeadFM" method="post" novalidate>
<table> <table>
@@ -71,19 +75,23 @@
<td style="width:60px;">供应商:</td> <td style="width:60px;">供应商:</td>
<td style="padding:5px;width:170px;"> <td style="padding:5px;width:170px;">
<div class="org-list"> <div class="org-list">
<input id="OrganId" name="OrganId" style="width:130px;" /> <input id="OrganId" name="OrganId" style="width:130px;"/>
</div> </div>
<div class="add-org-btn"> <div class="add-org-btn">
<img id="addOrgan" src="<%=path %>/js/easyui-1.3.5/themes/icons/edit_add.png" style="cursor: pointer;" alt="增加供应商" title="增加供应商" /> <img id="addOrgan" src="<%=path %>/js/easyui-1.3.5/themes/icons/edit_add.png"
style="cursor: pointer;" alt="增加供应商" title="增加供应商"/>
</div> </div>
</td> </td>
<td style="width:70px;">单据日期:</td> <td style="width:70px;">单据日期:</td>
<td style="padding:5px"> <td style="padding:5px">
<input type="text" name="OperTime" id="OperTime" onClick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'})" class="txt Wdate" style="width:140px;"/> <input type="text" name="OperTime" id="OperTime"
onClick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'})" class="txt Wdate"
style="width:140px;"/>
</td> </td>
<td style="width:80px;">单据编号:</td> <td style="width:80px;">单据编号:</td>
<td style="padding:5px"> <td style="padding:5px">
<input name="Number" id="Number" class="easyui-validatebox" data-options="required:true,validType:'length[2,30]'" style="width: 140px;"/> <input name="Number" id="Number" class="easyui-validatebox"
data-options="required:true,validType:'length[2,30]'" style="width: 140px;"/>
</td> </td>
<td style="width:70px;"></td> <td style="width:70px;"></td>
<td style="padding:5px"> <td style="padding:5px">
@@ -98,26 +106,27 @@
</tr> </tr>
<tr> <tr>
<td colspan="9"> <td colspan="9">
<textarea name="Remark" id="Remark" rows="2" cols="2" placeholder="暂无备注信息" style="width: 1130px; height:35px;"></textarea> <textarea name="Remark" id="Remark" rows="2" cols="2" placeholder="暂无备注信息"
style="width: 1130px; height:35px;"></textarea>
</td> </td>
</tr> </tr>
<tr> <tr>
<td>优惠率:</td> <td>优惠率:</td>
<td style="padding:5px"> <td style="padding:5px">
<input id="Discount" name="Discount" style="width:110px;" /> <input id="Discount" name="Discount" style="width:110px;"/>
% %
</td> </td>
<td>退款优惠:</td> <td>退款优惠:</td>
<td style="padding:5px"> <td style="padding:5px">
<input id="DiscountMoney" name="DiscountMoney" style="width:120px;" /> <input id="DiscountMoney" name="DiscountMoney" style="width:120px;"/>
</td> </td>
<td>优惠后金额:</td> <td>优惠后金额:</td>
<td style="padding:5px"> <td style="padding:5px">
<input id="DiscountLastMoney" name="DiscountLastMoney" readonly="readonly" style="width:120px;" /> <input id="DiscountLastMoney" name="DiscountLastMoney" readonly="readonly" style="width:120px;"/>
</td> </td>
<td>本次退款:</td> <td>本次退款:</td>
<td style="padding:5px"> <td style="padding:5px">
<input id="ChangeAmount" name="ChangeAmount" data-changeamount="0" style="width:120px;" /> <input id="ChangeAmount" name="ChangeAmount" data-changeamount="0" style="width:120px;"/>
</td> </td>
<td style="width:100px;"></td> <td style="width:100px;"></td>
</tr> </tr>
@@ -125,16 +134,17 @@
<td>结算账户:</td> <td>结算账户:</td>
<td style="padding:5px"> <td style="padding:5px">
<select name="AccountId" id="AccountId" style="width:110px;"></select> <select name="AccountId" id="AccountId" style="width:110px;"></select>
<img class="many-account-ico" src="<%=path%>/js/easyui-1.3.5/themes/icons/filelist.jpg" style="display: none;"/> <img class="many-account-ico" src="<%=path%>/js/easyui-1.3.5/themes/icons/filelist.jpg"
style="display: none;"/>
</td> </td>
<td>本次欠款:</td> <td>本次欠款:</td>
<td style="padding:5px"> <td style="padding:5px">
<input id="Debt" name="Debt" readonly="readonly" style="width:120px;" /> <input id="Debt" name="Debt" readonly="readonly" style="width:120px;"/>
</td> </td>
<td>采购费用:</td> <td>采购费用:</td>
<td style="padding:5px"> <td style="padding:5px">
<input id="OtherMoney" name="OtherMoney" style="width:120px;" readonly="readonly" /> <input id="OtherMoney" name="OtherMoney" style="width:120px;" readonly="readonly"/>
<img class="other-money-ico" src="<%=path%>/js/easyui-1.3.5/themes/icons/filelist.jpg" /> <img class="other-money-ico" src="<%=path%>/js/easyui-1.3.5/themes/icons/filelist.jpg"/>
</td> </td>
<td></td> <td></td>
<td style="padding:5px"> <td style="padding:5px">
@@ -144,12 +154,13 @@
</table> </table>
<input type="hidden" name="clientIp" id="clientIp" value="<%=clientIp %>"/> <input type="hidden" name="clientIp" id="clientIp" value="<%=clientIp %>"/>
</form> </form>
</div> </div>
<div id="dlg-buttons"> <div id="dlg-buttons">
<a href="javascript:void(0)" id="saveDepotHead" class="easyui-linkbutton" iconCls="icon-ok">保存</a> <a href="javascript:void(0)" id="saveDepotHead" class="easyui-linkbutton" iconCls="icon-ok">保存</a>
<a href="javascript:void(0)" id="cancelDepotHead" class="easyui-linkbutton" iconCls="icon-cancel" onclick="javascript:$('#depotHeadDlg').dialog('close')">取消</a> <a href="javascript:void(0)" id="cancelDepotHead" class="easyui-linkbutton" iconCls="icon-cancel"
</div> onclick="javascript:$('#depotHeadDlg').dialog('close')">取消</a>
<div id="depotHeadDlgShow" class="easyui-dialog" style="width:1200px;padding:10px 20px;top:20px" </div>
<div id="depotHeadDlgShow" class="easyui-dialog" style="width:1200px;padding:10px 20px;top:20px"
closed="true" modal="true" cache="false" collapsible="false" closable="true"> closed="true" modal="true" cache="false" collapsible="false" closable="true">
<table> <table>
<tr> <tr>
@@ -220,8 +231,8 @@
<td style="width:100px;"></td> <td style="width:100px;"></td>
</tr> </tr>
</table> </table>
</div> </div>
<div id="depotHeadAccountDlg" class="easyui-dialog" style="width:380px;padding:10px 20px;top:80px" <div id="depotHeadAccountDlg" class="easyui-dialog" style="width:380px;padding:10px 20px;top:80px"
closed="true" modal="true" buttons="#accountDlgButtons" cache="false" collapsible="false" closable="true"> closed="true" modal="true" buttons="#accountDlgButtons" cache="false" collapsible="false" closable="true">
<table class="account-dlg"> <table class="account-dlg">
<tr class="account-head-tmp"> <tr class="account-head-tmp">
@@ -239,15 +250,15 @@
<tr class="account-content-tmp"> <tr class="account-content-tmp">
<td style="width:30px;"></td> <td style="width:30px;"></td>
<td style="width:140px; padding:3px;"><select class="account-id-dlg" style="width:140px;"></select></td> <td style="width:140px; padding:3px;"><select class="account-id-dlg" style="width:140px;"></select></td>
<td style="width:100px; padding:3px;"><input class="account-money-dlg" style="width:100px;" /></td> <td style="width:100px; padding:3px;"><input class="account-money-dlg" style="width:100px;"/></td>
</tr> </tr>
</table> </table>
</div> </div>
<div id="accountDlgButtons"> <div id="accountDlgButtons">
<a href="javascript:void(0)" id="saveDepotHeadAccountDlg" class="easyui-linkbutton" iconCls="icon-ok">保存</a> <a href="javascript:void(0)" id="saveDepotHeadAccountDlg" class="easyui-linkbutton" iconCls="icon-ok">保存</a>
<a href="javascript:void(0)" id="cancelDepotHeadAccountDlg" class="easyui-linkbutton" iconCls="icon-cancel">取消</a> <a href="javascript:void(0)" id="cancelDepotHeadAccountDlg" class="easyui-linkbutton" iconCls="icon-cancel">取消</a>
</div> </div>
<div id="otherMoneyDlg" class="easyui-dialog" style="width:380px;padding:10px 20px;top:80px" <div id="otherMoneyDlg" class="easyui-dialog" style="width:380px;padding:10px 20px;top:80px"
closed="true" modal="true" buttons="#otherMoneyDlgBtn" cache="false" collapsible="false" closable="true"> closed="true" modal="true" buttons="#otherMoneyDlgBtn" cache="false" collapsible="false" closable="true">
<table class="money-dlg"> <table class="money-dlg">
<tr class="money-head-tmp"> <tr class="money-head-tmp">
@@ -265,22 +276,23 @@
<tr class="money-content-tmp"> <tr class="money-content-tmp">
<td style="width:30px;"></td> <td style="width:30px;"></td>
<td style="width:140px; padding:3px;"><select class="money-id-dlg" style="width:140px;"></select></td> <td style="width:140px; padding:3px;"><select class="money-id-dlg" style="width:140px;"></select></td>
<td style="width:100px; padding:3px;"><input class="other-money-dlg" style="width:100px;" /></td> <td style="width:100px; padding:3px;"><input class="other-money-dlg" style="width:100px;"/></td>
</tr> </tr>
</table> </table>
</div> </div>
<div id="otherMoneyDlgBtn"> <div id="otherMoneyDlgBtn">
<a href="javascript:void(0)" id="saveOtherMoneyDlg" class="easyui-linkbutton" iconCls="icon-ok">保存</a> <a href="javascript:void(0)" id="saveOtherMoneyDlg" class="easyui-linkbutton" iconCls="icon-ok">保存</a>
<a href="javascript:void(0)" id="cancelOtherMoneyDlg" class="easyui-linkbutton" iconCls="icon-cancel">取消</a> <a href="javascript:void(0)" id="cancelOtherMoneyDlg" class="easyui-linkbutton" iconCls="icon-cancel">取消</a>
</div> </div>
<div id="supplierDlg" class="easyui-dialog" style="width:580px;padding:10px 20px" <div id="supplierDlg" class="easyui-dialog" style="width:580px;padding:10px 20px"
closed="true" buttons="#supplierDlgBtn" modal="true" collapsible="false" closable="true"> closed="true" buttons="#supplierDlgBtn" modal="true" collapsible="false" closable="true">
<form id="supplierFM"> <form id="supplierFM">
<table> <table>
<tr> <tr>
<td style="width: 80px;height: 20px">名称</td> <td style="width: 80px;height: 20px">名称</td>
<td style="width: 180px;padding:1px"> <td style="width: 180px;padding:1px">
<input name="supplier" id="supplier" class="easyui-validatebox" data-options="required:true,validType:'length[2,30]'" style="width: 160px;height: 20px"/> <input name="supplier" id="supplier" class="easyui-validatebox"
data-options="required:true,validType:'length[2,30]'" style="width: 160px;height: 20px"/>
</td> </td>
<td style="width: 60px;height: 20px">联系人</td> <td style="width: 60px;height: 20px">联系人</td>
<td style="width:180px;padding:1px;"> <td style="width:180px;padding:1px;">
@@ -294,13 +306,15 @@
</td> </td>
<td>手机</td> <td>手机</td>
<td style="padding:1px;"> <td style="padding:1px;">
<input name="telephone" id="telephone" class="easyui-validatebox" style="width: 160px;height: 20px"/> <input name="telephone" id="telephone" class="easyui-validatebox"
style="width: 160px;height: 20px"/>
</td> </td>
</tr> </tr>
<tr> <tr>
<td>电子邮箱</td> <td>电子邮箱</td>
<td style="padding:1px"> <td style="padding:1px">
<input name="email" id="email" class="easyui-validatebox" validType="email" style="width: 160px;height: 20px"/> <input name="email" id="email" class="easyui-validatebox" validType="email"
style="width: 160px;height: 20px"/>
</td> </td>
<td>传真</td> <td>传真</td>
<td style="padding:1px"> <td style="padding:1px">
@@ -310,21 +324,25 @@
<tr> <tr>
<td>期初应收</td> <td>期初应收</td>
<td style="padding:1px"> <td style="padding:1px">
<input name="BeginNeedGet" id="BeginNeedGet" type="text" class="easyui-numberbox" data-options="min:0,precision:2" style="width: 160px;height: 20px"></input> <input name="BeginNeedGet" id="BeginNeedGet" type="text" class="easyui-numberbox"
data-options="min:0,precision:2" style="width: 160px;height: 20px"></input>
</td> </td>
<td>期初应付</td> <td>期初应付</td>
<td style="padding:1px"> <td style="padding:1px">
<input name="BeginNeedPay" id="BeginNeedPay" type="text" class="easyui-numberbox" data-options="min:0,precision:2" style="width: 160px;height: 20px"></input> <input name="BeginNeedPay" id="BeginNeedPay" type="text" class="easyui-numberbox"
data-options="min:0,precision:2" style="width: 160px;height: 20px"></input>
</td> </td>
</tr> </tr>
<tr> <tr>
<td>累计应收</td> <td>累计应收</td>
<td style="padding:1px"> <td style="padding:1px">
<input name="AllNeedGet" id="AllNeedGet" type="text" class="easyui-numberbox" data-options="min:0,precision:2" style="width: 160px;height: 20px" disabled="true"></input> <input name="AllNeedGet" id="AllNeedGet" type="text" class="easyui-numberbox"
data-options="min:0,precision:2" style="width: 160px;height: 20px" disabled="true"></input>
</td> </td>
<td>累计应付</td> <td>累计应付</td>
<td style="padding:1px"> <td style="padding:1px">
<input name="AllNeedPay" id="AllNeedPay" type="text" class="easyui-numberbox" data-options="min:0,precision:2" style="width: 160px;height: 20px" disabled="true"></input> <input name="AllNeedPay" id="AllNeedPay" type="text" class="easyui-numberbox"
data-options="min:0,precision:2" style="width: 160px;height: 20px" disabled="true"></input>
</td> </td>
</tr> </tr>
<tr> <tr>
@@ -344,7 +362,8 @@
</td> </td>
<td>账号</td> <td>账号</td>
<td style="padding:1px"> <td style="padding:1px">
<input name="accountNumber" id="accountNumber" class="easyui-validatebox" style="width: 160px;height: 20px"/> <input name="accountNumber" id="accountNumber" class="easyui-validatebox"
style="width: 160px;height: 20px"/>
</td> </td>
</tr> </tr>
<tr> <tr>
@@ -361,10 +380,11 @@
</tr> </tr>
</table> </table>
</form> </form>
</div> </div>
<div id="supplierDlgBtn"> <div id="supplierDlgBtn">
<a href="javascript:void(0)" id="saveSupplier" class="easyui-linkbutton" iconCls="icon-ok">保存</a> <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> <a href="javascript:void(0)" id="cancelSupplier" class="easyui-linkbutton" iconCls="icon-cancel"
</div> onclick="javascript:$('#supplierDlg').dialog('close')">取消</a>
</body> </div>
</body>
</html> </html>

View File

@@ -1,21 +1,21 @@
<%@page import="com.jsh.util.Tools"%> <%@page import="com.jsh.util.Tools" %>
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%> <%@ page language="java" pageEncoding="utf-8" %>
<% <%
String path = request.getContextPath(); String path = request.getContextPath();
String clientIp = Tools.getLocalIp(request); String clientIp = Tools.getLocalIp(request);
%> %>
<!DOCTYPE html> <!DOCTYPE html>
<html> <html>
<head> <head>
<title>采购入库</title> <title>采购入库</title>
<meta charset="utf-8"> <meta charset="utf-8">
<!-- 指定以IE8的方式来渲染 --> <!-- 指定以IE8的方式来渲染 -->
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE8"/> <meta http-equiv="X-UA-Compatible" content="IE=EmulateIE8"/>
<link rel="shortcut icon" href="<%=path%>/images/favicon.ico" type="image/x-icon" /> <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/default/easyui.css"/>
<link rel="stylesheet" type="text/css" href="<%=path %>/js/easyui-1.3.5/themes/icon.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" /> <link type="text/css" rel="stylesheet" href="<%=path %>/css/common.css"/>
<link type="text/css" rel="stylesheet" href="<%=path %>/css/in_out.css" /> <link type="text/css" rel="stylesheet" href="<%=path %>/css/in_out.css"/>
<script src="<%=path %>/js/jquery-1.8.0.min.js"></script> <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/jquery.easyui.min.js"></script>
<script src="<%=path %>/js/easyui-1.3.5/locale/easyui-lang-zh_CN.js"></script> <script src="<%=path %>/js/easyui-1.3.5/locale/easyui-lang-zh_CN.js"></script>
@@ -27,10 +27,11 @@
var path = "<%=path%>"; var path = "<%=path%>";
var clientIp = "<%=clientIp%>"; var clientIp = "<%=clientIp%>";
</script> </script>
</head> </head>
<body> <body>
<!-- 查询 --> <!-- 查询 -->
<div id = "searchPanel" class="easyui-panel" style="padding:3px;" title="查询窗口" iconCls="icon-search" collapsible="true" closable="false"> <div id="searchPanel" class="easyui-panel" style="padding:3px;" title="查询窗口" iconCls="icon-search" collapsible="true"
closable="false">
<table id="searchTable"> <table id="searchTable">
<tr> <tr>
<td>单据编号:</td> <td>单据编号:</td>
@@ -43,11 +44,13 @@
</td> </td>
<td>单据日期:</td> <td>单据日期:</td>
<td> <td>
<input type="text" name="searchBeginTime" id="searchBeginTime" onClick="WdatePicker({dateFmt:'yyyy-MM-dd'})" class="txt Wdate" style="width:100px;"/> <input type="text" name="searchBeginTime" id="searchBeginTime"
onClick="WdatePicker({dateFmt:'yyyy-MM-dd'})" class="txt Wdate" style="width:100px;"/>
</td> </td>
<td>-</td> <td>-</td>
<td> <td>
<input type="text" name="searchEndTime" id="searchEndTime" onClick="WdatePicker({dateFmt:'yyyy-MM-dd'})" class="txt Wdate" style="width:100px;"/> <input type="text" name="searchEndTime" id="searchEndTime" onClick="WdatePicker({dateFmt:'yyyy-MM-dd'})"
class="txt Wdate" style="width:100px;"/>
</td> </td>
<td>&nbsp;</td> <td>&nbsp;</td>
<td> <td>
@@ -56,14 +59,15 @@
</td> </td>
</tr> </tr>
</table> </table>
</div> </div>
<!-- 数据显示table --> <!-- 数据显示table -->
<div id="tablePanel" class="easyui-panel" style="padding:1px; top:300px;" title="采购入库列表" iconCls="icon-list" collapsible="true" closable="false"> <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> <table id="tableData" style="top:300px;border-bottom-color:#FFFFFF"></table>
</div> </div>
<div id="depotHeadDlg" class="easyui-dialog" style="width:1200px;padding:10px 20px;top:20px" <div id="depotHeadDlg" class="easyui-dialog" style="width:1200px;padding:10px 20px;top:20px"
closed="true" buttons="#dlg-buttons" modal="true" cache="false" collapsible="false" closable="true"> closed="true" buttons="#dlg-buttons" modal="true" cache="false" collapsible="false" closable="true">
<form id="depotHeadFM" method="post" novalidate> <form id="depotHeadFM" method="post" novalidate>
<table> <table>
@@ -71,19 +75,23 @@
<td style="width:60px;">供应商:</td> <td style="width:60px;">供应商:</td>
<td style="padding:5px;width:170px;"> <td style="padding:5px;width:170px;">
<div class="org-list"> <div class="org-list">
<input id="OrganId" name="OrganId" style="width:130px;" /> <input id="OrganId" name="OrganId" style="width:130px;"/>
</div> </div>
<div class="add-org-btn"> <div class="add-org-btn">
<img id="addOrgan" src="<%=path %>/js/easyui-1.3.5/themes/icons/edit_add.png" style="cursor: pointer;" alt="增加供应商" title="增加供应商" /> <img id="addOrgan" src="<%=path %>/js/easyui-1.3.5/themes/icons/edit_add.png"
style="cursor: pointer;" alt="增加供应商" title="增加供应商"/>
</div> </div>
</td> </td>
<td style="width:70px;">单据日期:</td> <td style="width:70px;">单据日期:</td>
<td style="padding:5px"> <td style="padding:5px">
<input type="text" name="OperTime" id="OperTime" onClick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'})" class="txt Wdate" style="width:140px;"/> <input type="text" name="OperTime" id="OperTime"
onClick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'})" class="txt Wdate"
style="width:140px;"/>
</td> </td>
<td style="width:80px;">单据编号:</td> <td style="width:80px;">单据编号:</td>
<td style="padding:5px"> <td style="padding:5px">
<input name="Number" id="Number" class="easyui-validatebox" data-options="required:true,validType:'length[2,30]'" style="width: 140px;"/> <input name="Number" id="Number" class="easyui-validatebox"
data-options="required:true,validType:'length[2,30]'" style="width: 140px;"/>
</td> </td>
<td style="width:70px;"></td> <td style="width:70px;"></td>
<td style="padding:5px"> <td style="padding:5px">
@@ -98,26 +106,27 @@
</tr> </tr>
<tr> <tr>
<td colspan="9"> <td colspan="9">
<textarea name="Remark" id="Remark" rows="2" cols="2" placeholder="暂无备注信息" style="width: 1130px; height:35px;"></textarea> <textarea name="Remark" id="Remark" rows="2" cols="2" placeholder="暂无备注信息"
style="width: 1130px; height:35px;"></textarea>
</td> </td>
</tr> </tr>
<tr> <tr>
<td>优惠率:</td> <td>优惠率:</td>
<td style="padding:5px"> <td style="padding:5px">
<input id="Discount" name="Discount" style="width:110px;" /> <input id="Discount" name="Discount" style="width:110px;"/>
% %
</td> </td>
<td>付款优惠:</td> <td>付款优惠:</td>
<td style="padding:5px"> <td style="padding:5px">
<input id="DiscountMoney" name="DiscountMoney" style="width:120px;" /> <input id="DiscountMoney" name="DiscountMoney" style="width:120px;"/>
</td> </td>
<td>优惠后金额:</td> <td>优惠后金额:</td>
<td style="padding:5px"> <td style="padding:5px">
<input id="DiscountLastMoney" name="DiscountLastMoney" readonly="readonly" style="width:120px;" /> <input id="DiscountLastMoney" name="DiscountLastMoney" readonly="readonly" style="width:120px;"/>
</td> </td>
<td>本次付款:</td> <td>本次付款:</td>
<td style="padding:5px"> <td style="padding:5px">
<input id="ChangeAmount" name="ChangeAmount" data-changeamount="0" style="width:120px;" /> <input id="ChangeAmount" name="ChangeAmount" data-changeamount="0" style="width:120px;"/>
</td> </td>
<td style="width:100px;"></td> <td style="width:100px;"></td>
</tr> </tr>
@@ -125,32 +134,35 @@
<td>结算账户:</td> <td>结算账户:</td>
<td style="padding:5px"> <td style="padding:5px">
<select name="AccountId" id="AccountId" style="width:110px;"></select> <select name="AccountId" id="AccountId" style="width:110px;"></select>
<img class="many-account-ico" src="<%=path%>/js/easyui-1.3.5/themes/icons/filelist.jpg" style="display: none;"/> <img class="many-account-ico" src="<%=path%>/js/easyui-1.3.5/themes/icons/filelist.jpg"
style="display: none;"/>
</td> </td>
<td>本次欠款:</td> <td>本次欠款:</td>
<td style="padding:5px"> <td style="padding:5px">
<input id="Debt" name="Debt" readonly="readonly" style="width:120px;" /> <input id="Debt" name="Debt" readonly="readonly" style="width:120px;"/>
</td> </td>
<td>采购费用:</td> <td>采购费用:</td>
<td style="padding:5px"> <td style="padding:5px">
<input id="OtherMoney" name="OtherMoney" style="width:120px;" readonly="readonly" /> <input id="OtherMoney" name="OtherMoney" style="width:120px;" readonly="readonly"/>
<img class="other-money-ico" src="<%=path%>/js/easyui-1.3.5/themes/icons/filelist.jpg" /> <img class="other-money-ico" src="<%=path%>/js/easyui-1.3.5/themes/icons/filelist.jpg"/>
</td> </td>
<td>结算天数:</td> <td>结算天数:</td>
<td style="padding:5px"> <td style="padding:5px">
<input id="AccountDay" name="AccountDay" class="easyui-validatebox" data-options="validType:'length[1,3]'" style="width:120px;" /> <input id="AccountDay" name="AccountDay" class="easyui-validatebox"
data-options="validType:'length[1,3]'" style="width:120px;"/>
</td> </td>
<td style="width:100px;"></td> <td style="width:100px;"></td>
</tr> </tr>
</table> </table>
<input type="hidden" name="clientIp" id="clientIp" value="<%=clientIp %>"/> <input type="hidden" name="clientIp" id="clientIp" value="<%=clientIp %>"/>
</form> </form>
</div> </div>
<div id="dlg-buttons"> <div id="dlg-buttons">
<a href="javascript:void(0)" id="saveDepotHead" class="easyui-linkbutton" iconCls="icon-ok">保存</a> <a href="javascript:void(0)" id="saveDepotHead" class="easyui-linkbutton" iconCls="icon-ok">保存</a>
<a href="javascript:void(0)" id="cancelDepotHead" class="easyui-linkbutton" iconCls="icon-cancel" onclick="javascript:$('#depotHeadDlg').dialog('close')">取消</a> <a href="javascript:void(0)" id="cancelDepotHead" class="easyui-linkbutton" iconCls="icon-cancel"
</div> onclick="javascript:$('#depotHeadDlg').dialog('close')">取消</a>
<div id="depotHeadDlgShow" class="easyui-dialog" style="width:1200px;padding:10px 20px;top:20px" </div>
<div id="depotHeadDlgShow" class="easyui-dialog" style="width:1200px;padding:10px 20px;top:20px"
closed="true" modal="true" cache="false" collapsible="false" closable="true"> closed="true" modal="true" cache="false" collapsible="false" closable="true">
<table> <table>
<tr> <tr>
@@ -222,8 +234,8 @@
<td style="width:100px;"></td> <td style="width:100px;"></td>
</tr> </tr>
</table> </table>
</div> </div>
<div id="depotHeadAccountDlg" class="easyui-dialog" style="width:380px;padding:10px 20px;top:80px" <div id="depotHeadAccountDlg" class="easyui-dialog" style="width:380px;padding:10px 20px;top:80px"
closed="true" modal="true" buttons="#accountDlgButtons" cache="false" collapsible="false" closable="true"> closed="true" modal="true" buttons="#accountDlgButtons" cache="false" collapsible="false" closable="true">
<table class="account-dlg"> <table class="account-dlg">
<tr class="account-head-tmp"> <tr class="account-head-tmp">
@@ -241,15 +253,15 @@
<tr class="account-content-tmp"> <tr class="account-content-tmp">
<td style="width:30px;"></td> <td style="width:30px;"></td>
<td style="width:140px; padding:3px;"><select class="account-id-dlg" style="width:140px;"></select></td> <td style="width:140px; padding:3px;"><select class="account-id-dlg" style="width:140px;"></select></td>
<td style="width:100px; padding:3px;"><input class="account-money-dlg" style="width:100px;" /></td> <td style="width:100px; padding:3px;"><input class="account-money-dlg" style="width:100px;"/></td>
</tr> </tr>
</table> </table>
</div> </div>
<div id="accountDlgButtons"> <div id="accountDlgButtons">
<a href="javascript:void(0)" id="saveDepotHeadAccountDlg" class="easyui-linkbutton" iconCls="icon-ok">保存</a> <a href="javascript:void(0)" id="saveDepotHeadAccountDlg" class="easyui-linkbutton" iconCls="icon-ok">保存</a>
<a href="javascript:void(0)" id="cancelDepotHeadAccountDlg" class="easyui-linkbutton" iconCls="icon-cancel">取消</a> <a href="javascript:void(0)" id="cancelDepotHeadAccountDlg" class="easyui-linkbutton" iconCls="icon-cancel">取消</a>
</div> </div>
<div id="otherMoneyDlg" class="easyui-dialog" style="width:380px;padding:10px 20px;top:80px" <div id="otherMoneyDlg" class="easyui-dialog" style="width:380px;padding:10px 20px;top:80px"
closed="true" modal="true" buttons="#otherMoneyDlgBtn" cache="false" collapsible="false" closable="true"> closed="true" modal="true" buttons="#otherMoneyDlgBtn" cache="false" collapsible="false" closable="true">
<table class="money-dlg"> <table class="money-dlg">
<tr class="money-head-tmp"> <tr class="money-head-tmp">
@@ -267,22 +279,23 @@
<tr class="money-content-tmp"> <tr class="money-content-tmp">
<td style="width:30px;"></td> <td style="width:30px;"></td>
<td style="width:140px; padding:3px;"><select class="money-id-dlg" style="width:140px;"></select></td> <td style="width:140px; padding:3px;"><select class="money-id-dlg" style="width:140px;"></select></td>
<td style="width:100px; padding:3px;"><input class="other-money-dlg" style="width:100px;" /></td> <td style="width:100px; padding:3px;"><input class="other-money-dlg" style="width:100px;"/></td>
</tr> </tr>
</table> </table>
</div> </div>
<div id="otherMoneyDlgBtn"> <div id="otherMoneyDlgBtn">
<a href="javascript:void(0)" id="saveOtherMoneyDlg" class="easyui-linkbutton" iconCls="icon-ok">保存</a> <a href="javascript:void(0)" id="saveOtherMoneyDlg" class="easyui-linkbutton" iconCls="icon-ok">保存</a>
<a href="javascript:void(0)" id="cancelOtherMoneyDlg" class="easyui-linkbutton" iconCls="icon-cancel">取消</a> <a href="javascript:void(0)" id="cancelOtherMoneyDlg" class="easyui-linkbutton" iconCls="icon-cancel">取消</a>
</div> </div>
<div id="supplierDlg" class="easyui-dialog" style="width:580px;padding:10px 20px" <div id="supplierDlg" class="easyui-dialog" style="width:580px;padding:10px 20px"
closed="true" buttons="#supplierDlgBtn" modal="true" collapsible="false" closable="true"> closed="true" buttons="#supplierDlgBtn" modal="true" collapsible="false" closable="true">
<form id="supplierFM"> <form id="supplierFM">
<table> <table>
<tr> <tr>
<td style="width: 80px;height: 20px">名称</td> <td style="width: 80px;height: 20px">名称</td>
<td style="width: 180px;padding:1px"> <td style="width: 180px;padding:1px">
<input name="supplier" id="supplier" class="easyui-validatebox" data-options="required:true,validType:'length[2,30]'" style="width: 160px;height: 20px"/> <input name="supplier" id="supplier" class="easyui-validatebox"
data-options="required:true,validType:'length[2,30]'" style="width: 160px;height: 20px"/>
</td> </td>
<td style="width: 60px;height: 20px">联系人</td> <td style="width: 60px;height: 20px">联系人</td>
<td style="width:180px;padding:1px;"> <td style="width:180px;padding:1px;">
@@ -296,13 +309,15 @@
</td> </td>
<td>手机</td> <td>手机</td>
<td style="padding:1px;"> <td style="padding:1px;">
<input name="telephone" id="telephone" class="easyui-validatebox" style="width: 160px;height: 20px"/> <input name="telephone" id="telephone" class="easyui-validatebox"
style="width: 160px;height: 20px"/>
</td> </td>
</tr> </tr>
<tr> <tr>
<td>电子邮箱</td> <td>电子邮箱</td>
<td style="padding:1px"> <td style="padding:1px">
<input name="email" id="email" class="easyui-validatebox" validType="email" style="width: 160px;height: 20px"/> <input name="email" id="email" class="easyui-validatebox" validType="email"
style="width: 160px;height: 20px"/>
</td> </td>
<td>传真</td> <td>传真</td>
<td style="padding:1px"> <td style="padding:1px">
@@ -312,21 +327,25 @@
<tr> <tr>
<td>期初应收</td> <td>期初应收</td>
<td style="padding:1px"> <td style="padding:1px">
<input name="BeginNeedGet" id="BeginNeedGet" type="text" class="easyui-numberbox" data-options="min:0,precision:2" style="width: 160px;height: 20px"></input> <input name="BeginNeedGet" id="BeginNeedGet" type="text" class="easyui-numberbox"
data-options="min:0,precision:2" style="width: 160px;height: 20px"></input>
</td> </td>
<td>期初应付</td> <td>期初应付</td>
<td style="padding:1px"> <td style="padding:1px">
<input name="BeginNeedPay" id="BeginNeedPay" type="text" class="easyui-numberbox" data-options="min:0,precision:2" style="width: 160px;height: 20px"></input> <input name="BeginNeedPay" id="BeginNeedPay" type="text" class="easyui-numberbox"
data-options="min:0,precision:2" style="width: 160px;height: 20px"></input>
</td> </td>
</tr> </tr>
<tr> <tr>
<td>累计应收</td> <td>累计应收</td>
<td style="padding:1px"> <td style="padding:1px">
<input name="AllNeedGet" id="AllNeedGet" type="text" class="easyui-numberbox" data-options="min:0,precision:2" style="width: 160px;height: 20px" disabled="true"></input> <input name="AllNeedGet" id="AllNeedGet" type="text" class="easyui-numberbox"
data-options="min:0,precision:2" style="width: 160px;height: 20px" disabled="true"></input>
</td> </td>
<td>累计应付</td> <td>累计应付</td>
<td style="padding:1px"> <td style="padding:1px">
<input name="AllNeedPay" id="AllNeedPay" type="text" class="easyui-numberbox" data-options="min:0,precision:2" style="width: 160px;height: 20px" disabled="true"></input> <input name="AllNeedPay" id="AllNeedPay" type="text" class="easyui-numberbox"
data-options="min:0,precision:2" style="width: 160px;height: 20px" disabled="true"></input>
</td> </td>
</tr> </tr>
<tr> <tr>
@@ -346,7 +365,8 @@
</td> </td>
<td>账号</td> <td>账号</td>
<td style="padding:1px"> <td style="padding:1px">
<input name="accountNumber" id="accountNumber" class="easyui-validatebox" style="width: 160px;height: 20px"/> <input name="accountNumber" id="accountNumber" class="easyui-validatebox"
style="width: 160px;height: 20px"/>
</td> </td>
</tr> </tr>
<tr> <tr>
@@ -363,10 +383,11 @@
</tr> </tr>
</table> </table>
</form> </form>
</div> </div>
<div id="supplierDlgBtn"> <div id="supplierDlgBtn">
<a href="javascript:void(0)" id="saveSupplier" class="easyui-linkbutton" iconCls="icon-ok">保存</a> <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> <a href="javascript:void(0)" id="cancelSupplier" class="easyui-linkbutton" iconCls="icon-cancel"
</div> onclick="javascript:$('#supplierDlg').dialog('close')">取消</a>
</body> </div>
</body>
</html> </html>

View File

@@ -1,5 +1,5 @@
<%@page import="com.jsh.util.Tools"%> <%@page import="com.jsh.util.Tools" %>
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%> <%@ page language="java" pageEncoding="utf-8" %>
<% <%
String path = request.getContextPath(); String path = request.getContextPath();
String clientIp = Tools.getLocalIp(request); String clientIp = Tools.getLocalIp(request);
@@ -11,11 +11,11 @@
<meta charset="utf-8"> <meta charset="utf-8">
<!-- 指定以IE8的方式来渲染 --> <!-- 指定以IE8的方式来渲染 -->
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE8"/> <meta http-equiv="X-UA-Compatible" content="IE=EmulateIE8"/>
<link rel="shortcut icon" href="<%=path%>/images/favicon.ico" type="image/x-icon" /> <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/default/easyui.css"/>
<link rel="stylesheet" type="text/css" href="<%=path %>/js/easyui-1.3.5/themes/icon.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" /> <link type="text/css" rel="stylesheet" href="<%=path %>/css/common.css"/>
<link type="text/css" rel="stylesheet" href="<%=path %>/css/in_out.css" /> <link type="text/css" rel="stylesheet" href="<%=path %>/css/in_out.css"/>
<script src="<%=path %>/js/jquery-1.8.0.min.js"></script> <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/jquery.easyui.min.js"></script>
<script src="<%=path %>/js/easyui-1.3.5/locale/easyui-lang-zh_CN.js"></script> <script src="<%=path %>/js/easyui-1.3.5/locale/easyui-lang-zh_CN.js"></script>
@@ -29,8 +29,9 @@
</script> </script>
</head> </head>
<body> <body>
<!-- 查询 --> <!-- 查询 -->
<div id = "searchPanel" class="easyui-panel" style="padding:3px;" title="查询窗口" iconCls="icon-search" collapsible="true" closable="false"> <div id="searchPanel" class="easyui-panel" style="padding:3px;" title="查询窗口" iconCls="icon-search" collapsible="true"
closable="false">
<table id="searchTable"> <table id="searchTable">
<tr> <tr>
<td>单据编号:</td> <td>单据编号:</td>
@@ -43,11 +44,13 @@
</td> </td>
<td>单据日期:</td> <td>单据日期:</td>
<td> <td>
<input type="text" name="searchBeginTime" id="searchBeginTime" onClick="WdatePicker({dateFmt:'yyyy-MM-dd'})" class="txt Wdate" style="width:100px;"/> <input type="text" name="searchBeginTime" id="searchBeginTime"
onClick="WdatePicker({dateFmt:'yyyy-MM-dd'})" class="txt Wdate" style="width:100px;"/>
</td> </td>
<td>-</td> <td>-</td>
<td> <td>
<input type="text" name="searchEndTime" id="searchEndTime" onClick="WdatePicker({dateFmt:'yyyy-MM-dd'})" class="txt Wdate" style="width:100px;"/> <input type="text" name="searchEndTime" id="searchEndTime" onClick="WdatePicker({dateFmt:'yyyy-MM-dd'})"
class="txt Wdate" style="width:100px;"/>
</td> </td>
<td>&nbsp;</td> <td>&nbsp;</td>
<td> <td>
@@ -56,29 +59,33 @@
</td> </td>
</tr> </tr>
</table> </table>
</div> </div>
<!-- 数据显示table --> <!-- 数据显示table -->
<div id="tablePanel" class="easyui-panel" style="padding:1px; top:300px;" title="零售退货列表" iconCls="icon-list" collapsible="true" closable="false"> <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> <table id="tableData" style="top:300px;border-bottom-color:#FFFFFF"></table>
</div> </div>
<div id="depotHeadDlg" class="easyui-dialog" style="width:1200px;padding:10px 20px;top:40px" <div id="depotHeadDlg" class="easyui-dialog" style="width:1200px;padding:10px 20px;top:40px"
closed="true" buttons="#dlg-buttons" modal="true" cache="false" collapsible="false" closable="true"> closed="true" buttons="#dlg-buttons" modal="true" cache="false" collapsible="false" closable="true">
<form id="depotHeadFM" method="post" novalidate> <form id="depotHeadFM" method="post" novalidate>
<table> <table>
<tr> <tr>
<td style="width:60px;height:50px;">会员卡号:</td> <td style="width:60px;height:50px;">会员卡号:</td>
<td style="padding:5px;width:200px;"> <td style="padding:5px;width:200px;">
<input id="OrganId" name="OrganId" style="width:130px;" /> <input id="OrganId" name="OrganId" style="width:130px;"/>
</td> </td>
<td style="width:70px;">单据日期:</td> <td style="width:70px;">单据日期:</td>
<td style="padding:5px"> <td style="padding:5px">
<input type="text" name="OperTime" id="OperTime" onClick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'})" class="txt Wdate" style="width: 140px;"/> <input type="text" name="OperTime" id="OperTime"
onClick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'})" class="txt Wdate"
style="width: 140px;"/>
</td> </td>
<td style="width:80px;">单据编号:</td> <td style="width:80px;">单据编号:</td>
<td style="padding:5px"> <td style="padding:5px">
<input name="Number" id="Number" class="easyui-validatebox" data-options="required:true,validType:'length[2,30]'" style="width: 140px;"/> <input name="Number" id="Number" class="easyui-validatebox"
data-options="required:true,validType:'length[2,30]'" style="width: 140px;"/>
</td> </td>
<td style="width:70px;"></td> <td style="width:70px;"></td>
<td style="padding:5px;width:150px;"></td> <td style="padding:5px;width:150px;"></td>
@@ -95,7 +102,8 @@
</tr> </tr>
<tr> <tr>
<td colspan="2"> <td colspan="2">
<input id="ChangeAmount" name="ChangeAmount" class="change-amount" readonly="readonly" data-changeamount="0" /> <input id="ChangeAmount" name="ChangeAmount" class="change-amount" readonly="readonly"
data-changeamount="0"/>
</td> </td>
</tr> </tr>
<tr> <tr>
@@ -103,7 +111,9 @@
</tr> </tr>
<tr> <tr>
<td colspan="2"> <td colspan="2">
<input id="getAmount" name="getAmount" onKeypress="return (/[\d.]/.test(String.fromCharCode(event.keyCode)))" class="get-amount" data-changeamount="0" /> <input id="getAmount" name="getAmount"
onKeypress="return (/[\d.]/.test(String.fromCharCode(event.keyCode)))"
class="get-amount" data-changeamount="0"/>
</td> </td>
</tr> </tr>
<tr> <tr>
@@ -111,14 +121,16 @@
</tr> </tr>
<tr> <tr>
<td colspan="2"> <td colspan="2">
<input id="backAmount" name="backAmount" class="back-amount" readonly="readonly" data-changeamount="0" /> <input id="backAmount" name="backAmount" class="back-amount" readonly="readonly"
data-changeamount="0"/>
</td> </td>
</tr> </tr>
<tr> <tr>
<td>付款账户:</td> <td>付款账户:</td>
<td> <td>
<select name="AccountId" id="AccountId" style="width:110px;"></select> <select name="AccountId" id="AccountId" style="width:110px;"></select>
<img class="many-account-ico" src="<%=path%>/js/easyui-1.3.5/themes/icons/filelist.jpg" style="display: none;"/> <img class="many-account-ico" src="<%=path%>/js/easyui-1.3.5/themes/icons/filelist.jpg"
style="display: none;"/>
</td> </td>
</tr> </tr>
</table> </table>
@@ -126,18 +138,20 @@
</tr> </tr>
<tr> <tr>
<td colspan="8"> <td colspan="8">
<textarea name="Remark" id="Remark" rows="2" cols="2" placeholder="暂无备注信息" style="width: 1130px; height:35px;"></textarea> <textarea name="Remark" id="Remark" rows="2" cols="2" placeholder="暂无备注信息"
style="width: 1130px; height:35px;"></textarea>
</td> </td>
</tr> </tr>
</table> </table>
<input type="hidden" name="clientIp" id="clientIp" value="<%=clientIp %>"/> <input type="hidden" name="clientIp" id="clientIp" value="<%=clientIp %>"/>
</form> </form>
</div> </div>
<div id="dlg-buttons"> <div id="dlg-buttons">
<a href="javascript:void(0)" id="saveDepotHead" class="easyui-linkbutton" iconCls="icon-ok">保存</a> <a href="javascript:void(0)" id="saveDepotHead" class="easyui-linkbutton" iconCls="icon-ok">保存</a>
<a href="javascript:void(0)" id="cancelDepotHead" class="easyui-linkbutton" iconCls="icon-cancel" onclick="javascript:$('#depotHeadDlg').dialog('close')">取消</a> <a href="javascript:void(0)" id="cancelDepotHead" class="easyui-linkbutton" iconCls="icon-cancel"
</div> onclick="javascript:$('#depotHeadDlg').dialog('close')">取消</a>
<div id="depotHeadDlgShow" class="easyui-dialog" style="width:1200px;padding:10px 20px;top:50px" </div>
<div id="depotHeadDlgShow" class="easyui-dialog" style="width:1200px;padding:10px 20px;top:50px"
closed="true" modal="true" cache="false" collapsible="false" closable="true"> closed="true" modal="true" cache="false" collapsible="false" closable="true">
<table> <table>
<tr> <tr>
@@ -203,6 +217,6 @@
</td> </td>
</tr> </tr>
</table> </table>
</div> </div>
</body> </body>
</html> </html>

View File

@@ -1,21 +1,21 @@
<%@page import="com.jsh.util.Tools"%> <%@page import="com.jsh.util.Tools" %>
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%> <%@ page language="java" pageEncoding="utf-8" %>
<% <%
String path = request.getContextPath(); String path = request.getContextPath();
String clientIp = Tools.getLocalIp(request); String clientIp = Tools.getLocalIp(request);
%> %>
<!DOCTYPE html> <!DOCTYPE html>
<html> <html>
<head> <head>
<title>零售出库</title> <title>零售出库</title>
<meta charset="utf-8"> <meta charset="utf-8">
<!-- 指定以IE8的方式来渲染 --> <!-- 指定以IE8的方式来渲染 -->
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE8"/> <meta http-equiv="X-UA-Compatible" content="IE=EmulateIE8"/>
<link rel="shortcut icon" href="<%=path%>/images/favicon.ico" type="image/x-icon" /> <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/default/easyui.css"/>
<link rel="stylesheet" type="text/css" href="<%=path %>/js/easyui-1.3.5/themes/icon.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" /> <link type="text/css" rel="stylesheet" href="<%=path %>/css/common.css"/>
<link type="text/css" rel="stylesheet" href="<%=path %>/css/in_out.css" /> <link type="text/css" rel="stylesheet" href="<%=path %>/css/in_out.css"/>
<script src="<%=path %>/js/jquery-1.8.0.min.js"></script> <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/jquery.easyui.min.js"></script>
<script src="<%=path %>/js/easyui-1.3.5/locale/easyui-lang-zh_CN.js"></script> <script src="<%=path %>/js/easyui-1.3.5/locale/easyui-lang-zh_CN.js"></script>
@@ -27,10 +27,11 @@
var path = "<%=path%>"; var path = "<%=path%>";
var clientIp = "<%=clientIp%>"; var clientIp = "<%=clientIp%>";
</script> </script>
</head> </head>
<body> <body>
<!-- 查询 --> <!-- 查询 -->
<div id = "searchPanel" class="easyui-panel" style="padding:3px;" title="查询窗口" iconCls="icon-search" collapsible="true" closable="false"> <div id="searchPanel" class="easyui-panel" style="padding:3px;" title="查询窗口" iconCls="icon-search" collapsible="true"
closable="false">
<table id="searchTable"> <table id="searchTable">
<tr> <tr>
<td>单据编号:</td> <td>单据编号:</td>
@@ -43,11 +44,13 @@
</td> </td>
<td>单据日期:</td> <td>单据日期:</td>
<td> <td>
<input type="text" name="searchBeginTime" id="searchBeginTime" onClick="WdatePicker({dateFmt:'yyyy-MM-dd'})" class="txt Wdate" style="width:100px;"/> <input type="text" name="searchBeginTime" id="searchBeginTime"
onClick="WdatePicker({dateFmt:'yyyy-MM-dd'})" class="txt Wdate" style="width:100px;"/>
</td> </td>
<td>-</td> <td>-</td>
<td> <td>
<input type="text" name="searchEndTime" id="searchEndTime" onClick="WdatePicker({dateFmt:'yyyy-MM-dd'})" class="txt Wdate" style="width:100px;"/> <input type="text" name="searchEndTime" id="searchEndTime" onClick="WdatePicker({dateFmt:'yyyy-MM-dd'})"
class="txt Wdate" style="width:100px;"/>
</td> </td>
<td>&nbsp;</td> <td>&nbsp;</td>
<td> <td>
@@ -56,29 +59,33 @@
</td> </td>
</tr> </tr>
</table> </table>
</div> </div>
<!-- 数据显示table --> <!-- 数据显示table -->
<div id="tablePanel" class="easyui-panel" style="padding:1px; top:300px;" title="零售出库列表" iconCls="icon-list" collapsible="true" closable="false"> <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> <table id="tableData" style="top:300px;border-bottom-color:#FFFFFF"></table>
</div> </div>
<div id="depotHeadDlg" class="easyui-dialog" style="width:1200px;padding:10px 20px;top:40px" <div id="depotHeadDlg" class="easyui-dialog" style="width:1200px;padding:10px 20px;top:40px"
closed="true" buttons="#dlg-buttons" modal="true" cache="false" collapsible="false" closable="true"> closed="true" buttons="#dlg-buttons" modal="true" cache="false" collapsible="false" closable="true">
<form id="depotHeadFM" method="post" novalidate> <form id="depotHeadFM" method="post" novalidate>
<table> <table>
<tr> <tr>
<td style="width:60px;height:50px;">会员卡号:</td> <td style="width:60px;height:50px;">会员卡号:</td>
<td style="padding:5px;width:200px;"> <td style="padding:5px;width:200px;">
<input id="OrganId" name="OrganId" style="width:130px;" /> <input id="OrganId" name="OrganId" style="width:130px;"/>
</td> </td>
<td style="width:70px;">单据日期:</td> <td style="width:70px;">单据日期:</td>
<td style="padding:5px"> <td style="padding:5px">
<input type="text" name="OperTime" id="OperTime" onClick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'})" class="txt Wdate" style="width: 140px;"/> <input type="text" name="OperTime" id="OperTime"
onClick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'})" class="txt Wdate"
style="width: 140px;"/>
</td> </td>
<td style="width:80px;">单据编号:</td> <td style="width:80px;">单据编号:</td>
<td style="padding:5px"> <td style="padding:5px">
<input name="Number" id="Number" class="easyui-validatebox" data-options="required:true,validType:'length[2,30]'" style="width: 140px;"/> <input name="Number" id="Number" class="easyui-validatebox"
data-options="required:true,validType:'length[2,30]'" style="width: 140px;"/>
</td> </td>
<td style="width:70px;">付款类型:</td> <td style="width:70px;">付款类型:</td>
<td style="padding:5px;width:150px;"> <td style="padding:5px;width:150px;">
@@ -99,7 +106,8 @@
</tr> </tr>
<tr> <tr>
<td colspan="2"> <td colspan="2">
<input id="ChangeAmount" name="ChangeAmount" class="change-amount" readonly="readonly" data-changeamount="0" /> <input id="ChangeAmount" name="ChangeAmount" class="change-amount" readonly="readonly"
data-changeamount="0"/>
</td> </td>
</tr> </tr>
<tr> <tr>
@@ -107,7 +115,9 @@
</tr> </tr>
<tr> <tr>
<td colspan="2"> <td colspan="2">
<input id="getAmount" name="getAmount" onKeypress="return (/[\d.]/.test(String.fromCharCode(event.keyCode)))" class="get-amount" data-changeamount="0" /> <input id="getAmount" name="getAmount"
onKeypress="return (/[\d.]/.test(String.fromCharCode(event.keyCode)))"
class="get-amount" data-changeamount="0"/>
</td> </td>
</tr> </tr>
<tr> <tr>
@@ -115,14 +125,16 @@
</tr> </tr>
<tr> <tr>
<td colspan="2"> <td colspan="2">
<input id="backAmount" name="backAmount" class="back-amount" readonly="readonly" data-changeamount="0" /> <input id="backAmount" name="backAmount" class="back-amount" readonly="readonly"
data-changeamount="0"/>
</td> </td>
</tr> </tr>
<tr> <tr>
<td>收款账户:</td> <td>收款账户:</td>
<td> <td>
<select name="AccountId" id="AccountId" style="width:110px;"></select> <select name="AccountId" id="AccountId" style="width:110px;"></select>
<img class="many-account-ico" src="<%=path%>/js/easyui-1.3.5/themes/icons/filelist.jpg" style="display: none;"/> <img class="many-account-ico" src="<%=path%>/js/easyui-1.3.5/themes/icons/filelist.jpg"
style="display: none;"/>
</td> </td>
</tr> </tr>
</table> </table>
@@ -130,18 +142,20 @@
</tr> </tr>
<tr> <tr>
<td colspan="8"> <td colspan="8">
<textarea name="Remark" id="Remark" rows="2" cols="2" placeholder="暂无备注信息" style="width: 1130px; height:35px;"></textarea> <textarea name="Remark" id="Remark" rows="2" cols="2" placeholder="暂无备注信息"
style="width: 1130px; height:35px;"></textarea>
</td> </td>
</tr> </tr>
</table> </table>
<input type="hidden" name="clientIp" id="clientIp" value="<%=clientIp %>"/> <input type="hidden" name="clientIp" id="clientIp" value="<%=clientIp %>"/>
</form> </form>
</div> </div>
<div id="dlg-buttons"> <div id="dlg-buttons">
<a href="javascript:void(0)" id="saveDepotHead" class="easyui-linkbutton" iconCls="icon-ok">保存</a> <a href="javascript:void(0)" id="saveDepotHead" class="easyui-linkbutton" iconCls="icon-ok">保存</a>
<a href="javascript:void(0)" id="cancelDepotHead" class="easyui-linkbutton" iconCls="icon-cancel" onclick="javascript:$('#depotHeadDlg').dialog('close')">取消</a> <a href="javascript:void(0)" id="cancelDepotHead" class="easyui-linkbutton" iconCls="icon-cancel"
</div> onclick="javascript:$('#depotHeadDlg').dialog('close')">取消</a>
<div id="depotHeadDlgShow" class="easyui-dialog" style="width:1200px;padding:10px 20px;top:50px" </div>
<div id="depotHeadDlgShow" class="easyui-dialog" style="width:1200px;padding:10px 20px;top:50px"
closed="true" modal="true" cache="false" collapsible="false" closable="true"> closed="true" modal="true" cache="false" collapsible="false" closable="true">
<table> <table>
<tr> <tr>
@@ -208,8 +222,8 @@
</td> </td>
</tr> </tr>
</table> </table>
</div> </div>
<div id="depotHeadAccountDlg" class="easyui-dialog" style="width:380px;padding:10px 20px;top:80px" <div id="depotHeadAccountDlg" class="easyui-dialog" style="width:380px;padding:10px 20px;top:80px"
closed="true" modal="true" buttons="#accountDlgButtons" cache="false" collapsible="false" closable="true"> closed="true" modal="true" buttons="#accountDlgButtons" cache="false" collapsible="false" closable="true">
<table class="account-dlg"> <table class="account-dlg">
<tr class="account-head-tmp"> <tr class="account-head-tmp">
@@ -227,13 +241,13 @@
<tr class="account-content-tmp"> <tr class="account-content-tmp">
<td style="width:30px;"></td> <td style="width:30px;"></td>
<td style="width:140px; padding:3px;"><select class="account-id-dlg" style="width:140px;"></select></td> <td style="width:140px; padding:3px;"><select class="account-id-dlg" style="width:140px;"></select></td>
<td style="width:100px; padding:3px;"><input class="account-money-dlg" style="width:100px;" /></td> <td style="width:100px; padding:3px;"><input class="account-money-dlg" style="width:100px;"/></td>
</tr> </tr>
</table> </table>
</div> </div>
<div id="accountDlgButtons"> <div id="accountDlgButtons">
<a href="javascript:void(0)" id="saveDepotHeadAccountDlg" class="easyui-linkbutton" iconCls="icon-ok">保存</a> <a href="javascript:void(0)" id="saveDepotHeadAccountDlg" class="easyui-linkbutton" iconCls="icon-ok">保存</a>
<a href="javascript:void(0)" id="cancelDepotHeadAccountDlg" class="easyui-linkbutton" iconCls="icon-cancel">取消</a> <a href="javascript:void(0)" id="cancelDepotHeadAccountDlg" class="easyui-linkbutton" iconCls="icon-cancel">取消</a>
</div> </div>
</body> </body>
</html> </html>

View File

@@ -1,21 +1,21 @@
<%@page import="com.jsh.util.Tools"%> <%@page import="com.jsh.util.Tools" %>
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%> <%@ page language="java" pageEncoding="utf-8" %>
<% <%
String path = request.getContextPath(); String path = request.getContextPath();
String clientIp = Tools.getLocalIp(request); String clientIp = Tools.getLocalIp(request);
%> %>
<!DOCTYPE html> <!DOCTYPE html>
<html> <html>
<head> <head>
<title>销售退货</title> <title>销售退货</title>
<meta charset="utf-8"> <meta charset="utf-8">
<!-- 指定以IE8的方式来渲染 --> <!-- 指定以IE8的方式来渲染 -->
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE8"/> <meta http-equiv="X-UA-Compatible" content="IE=EmulateIE8"/>
<link rel="shortcut icon" href="<%=path%>/images/favicon.ico" type="image/x-icon" /> <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/default/easyui.css"/>
<link rel="stylesheet" type="text/css" href="<%=path %>/js/easyui-1.3.5/themes/icon.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" /> <link type="text/css" rel="stylesheet" href="<%=path %>/css/common.css"/>
<link type="text/css" rel="stylesheet" href="<%=path %>/css/in_out.css" /> <link type="text/css" rel="stylesheet" href="<%=path %>/css/in_out.css"/>
<script src="<%=path %>/js/jquery-1.8.0.min.js"></script> <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/jquery.easyui.min.js"></script>
<script src="<%=path %>/js/easyui-1.3.5/locale/easyui-lang-zh_CN.js"></script> <script src="<%=path %>/js/easyui-1.3.5/locale/easyui-lang-zh_CN.js"></script>
@@ -27,10 +27,11 @@
var path = "<%=path%>"; var path = "<%=path%>";
var clientIp = "<%=clientIp%>"; var clientIp = "<%=clientIp%>";
</script> </script>
</head> </head>
<body> <body>
<!-- 查询 --> <!-- 查询 -->
<div id = "searchPanel" class="easyui-panel" style="padding:3px;" title="查询窗口" iconCls="icon-search" collapsible="true" closable="false"> <div id="searchPanel" class="easyui-panel" style="padding:3px;" title="查询窗口" iconCls="icon-search" collapsible="true"
closable="false">
<table id="searchTable"> <table id="searchTable">
<tr> <tr>
<td>单据编号:</td> <td>单据编号:</td>
@@ -43,11 +44,13 @@
</td> </td>
<td>单据日期:</td> <td>单据日期:</td>
<td> <td>
<input type="text" name="searchBeginTime" id="searchBeginTime" onClick="WdatePicker({dateFmt:'yyyy-MM-dd'})" class="txt Wdate" style="width:100px;"/> <input type="text" name="searchBeginTime" id="searchBeginTime"
onClick="WdatePicker({dateFmt:'yyyy-MM-dd'})" class="txt Wdate" style="width:100px;"/>
</td> </td>
<td>-</td> <td>-</td>
<td> <td>
<input type="text" name="searchEndTime" id="searchEndTime" onClick="WdatePicker({dateFmt:'yyyy-MM-dd'})" class="txt Wdate" style="width:100px;"/> <input type="text" name="searchEndTime" id="searchEndTime" onClick="WdatePicker({dateFmt:'yyyy-MM-dd'})"
class="txt Wdate" style="width:100px;"/>
</td> </td>
<td>&nbsp;</td> <td>&nbsp;</td>
<td> <td>
@@ -56,33 +59,37 @@
</td> </td>
</tr> </tr>
</table> </table>
</div> </div>
<!-- 数据显示table --> <!-- 数据显示table -->
<div id="tablePanel" class="easyui-panel" style="padding:1px; top:300px;" title="销售退货列表" iconCls="icon-list" collapsible="true" closable="false"> <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> <table id="tableData" style="top:300px;border-bottom-color:#FFFFFF"></table>
</div> </div>
<div id="depotHeadDlg" class="easyui-dialog" style="width:1200px;padding:10px 20px;top:20px" <div id="depotHeadDlg" class="easyui-dialog" style="width:1200px;padding:10px 20px;top:20px"
closed="true" buttons="#dlg-buttons" modal="true" cache="false" collapsible="false" closable="true"> closed="true" buttons="#dlg-buttons" modal="true" cache="false" collapsible="false" closable="true">
<form id="depotHeadFM" method="post" novalidate> <form id="depotHeadFM" method="post" novalidate>
<table> <table>
<tr> <tr>
<td>客户:</td> <td>客户:</td>
<td style="padding:5px"> <td style="padding:5px">
<input id="OrganId" name="OrganId" style="width:110px;" /> <input id="OrganId" name="OrganId" style="width:110px;"/>
</td> </td>
<td style="width:70px;">销售人员:</td> <td style="width:70px;">销售人员:</td>
<td style="padding:5px"> <td style="padding:5px">
<input id="Salesman" name="Salesman" style="width:130px;" /> <input id="Salesman" name="Salesman" style="width:130px;"/>
</td> </td>
<td>单据日期:</td> <td>单据日期:</td>
<td style="padding:5px"> <td style="padding:5px">
<input type="text" name="OperTime" id="OperTime" onClick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'})" class="txt Wdate" style="width:140px;"/> <input type="text" name="OperTime" id="OperTime"
onClick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'})" class="txt Wdate"
style="width:140px;"/>
</td> </td>
<td>单据编号:</td> <td>单据编号:</td>
<td style="padding:5px"> <td style="padding:5px">
<input name="Number" id="Number" class="easyui-validatebox" data-options="required:true,validType:'length[2,30]'" style="width: 140px;"/> <input name="Number" id="Number" class="easyui-validatebox"
data-options="required:true,validType:'length[2,30]'" style="width: 140px;"/>
</td> </td>
<td style="width:100px;"></td> <td style="width:100px;"></td>
</tr> </tr>
@@ -94,26 +101,27 @@
</tr> </tr>
<tr> <tr>
<td colspan="9"> <td colspan="9">
<textarea name="Remark" id="Remark" rows="2" cols="2" placeholder="暂无备注信息" style="width: 1130px; height:35px;"></textarea> <textarea name="Remark" id="Remark" rows="2" cols="2" placeholder="暂无备注信息"
style="width: 1130px; height:35px;"></textarea>
</td> </td>
</tr> </tr>
<tr> <tr>
<td>优惠率:</td> <td>优惠率:</td>
<td style="padding:5px"> <td style="padding:5px">
<input id="Discount" name="Discount" style="width:110px;" /> <input id="Discount" name="Discount" style="width:110px;"/>
% %
</td> </td>
<td>退款优惠:</td> <td>退款优惠:</td>
<td style="padding:5px"> <td style="padding:5px">
<input id="DiscountMoney" name="DiscountMoney" style="width:120px;" /> <input id="DiscountMoney" name="DiscountMoney" style="width:120px;"/>
</td> </td>
<td>优惠后金额:</td> <td>优惠后金额:</td>
<td style="padding:5px"> <td style="padding:5px">
<input id="DiscountLastMoney" name="DiscountLastMoney" readonly="readonly" style="width:120px;" /> <input id="DiscountLastMoney" name="DiscountLastMoney" readonly="readonly" style="width:120px;"/>
</td> </td>
<td>本次退款:</td> <td>本次退款:</td>
<td style="padding:5px"> <td style="padding:5px">
<input id="ChangeAmount" name="ChangeAmount" data-changeamount="0" style="width:120px;" /> <input id="ChangeAmount" name="ChangeAmount" data-changeamount="0" style="width:120px;"/>
</td> </td>
<td style="width:100px;"></td> <td style="width:100px;"></td>
</tr> </tr>
@@ -121,16 +129,17 @@
<td>结算账户:</td> <td>结算账户:</td>
<td style="padding:5px"> <td style="padding:5px">
<select name="AccountId" id="AccountId" style="width:120px;"></select> <select name="AccountId" id="AccountId" style="width:120px;"></select>
<img class="many-account-ico" src="<%=path%>/js/easyui-1.3.5/themes/icons/filelist.jpg" style="display: none;"/> <img class="many-account-ico" src="<%=path%>/js/easyui-1.3.5/themes/icons/filelist.jpg"
style="display: none;"/>
</td> </td>
<td>本次欠款:</td> <td>本次欠款:</td>
<td style="padding:5px"> <td style="padding:5px">
<input id="Debt" name="Debt" readonly="readonly" style="width:120px;" /> <input id="Debt" name="Debt" readonly="readonly" style="width:120px;"/>
</td> </td>
<td>销售费用:</td> <td>销售费用:</td>
<td style="padding:5px"> <td style="padding:5px">
<input id="OtherMoney" name="OtherMoney" style="width:120px;" readonly="readonly" /> <input id="OtherMoney" name="OtherMoney" style="width:120px;" readonly="readonly"/>
<img class="other-money-ico" src="<%=path%>/js/easyui-1.3.5/themes/icons/filelist.jpg" /> <img class="other-money-ico" src="<%=path%>/js/easyui-1.3.5/themes/icons/filelist.jpg"/>
</td> </td>
<td></td> <td></td>
<td style="padding:5px"> <td style="padding:5px">
@@ -140,12 +149,13 @@
</table> </table>
<input type="hidden" name="clientIp" id="clientIp" value="<%=clientIp %>"/> <input type="hidden" name="clientIp" id="clientIp" value="<%=clientIp %>"/>
</form> </form>
</div> </div>
<div id="dlg-buttons"> <div id="dlg-buttons">
<a href="javascript:void(0)" id="saveDepotHead" class="easyui-linkbutton" iconCls="icon-ok">保存</a> <a href="javascript:void(0)" id="saveDepotHead" class="easyui-linkbutton" iconCls="icon-ok">保存</a>
<a href="javascript:void(0)" id="cancelDepotHead" class="easyui-linkbutton" iconCls="icon-cancel" onclick="javascript:$('#depotHeadDlg').dialog('close')">取消</a> <a href="javascript:void(0)" id="cancelDepotHead" class="easyui-linkbutton" iconCls="icon-cancel"
</div> onclick="javascript:$('#depotHeadDlg').dialog('close')">取消</a>
<div id="depotHeadDlgShow" class="easyui-dialog" style="width:1200px;padding:10px 20px;top:20px" </div>
<div id="depotHeadDlgShow" class="easyui-dialog" style="width:1200px;padding:10px 20px;top:20px"
closed="true" modal="true" cache="false" collapsible="false" closable="true"> closed="true" modal="true" cache="false" collapsible="false" closable="true">
<table> <table>
<tr> <tr>
@@ -218,8 +228,8 @@
<td style="width:100px;"></td> <td style="width:100px;"></td>
</tr> </tr>
</table> </table>
</div> </div>
<div id="depotHeadAccountDlg" class="easyui-dialog" style="width:380px;padding:10px 20px;top:80px" <div id="depotHeadAccountDlg" class="easyui-dialog" style="width:380px;padding:10px 20px;top:80px"
closed="true" modal="true" buttons="#accountDlgButtons" cache="false" collapsible="false" closable="true"> closed="true" modal="true" buttons="#accountDlgButtons" cache="false" collapsible="false" closable="true">
<table class="account-dlg"> <table class="account-dlg">
<tr class="account-head-tmp"> <tr class="account-head-tmp">
@@ -237,15 +247,15 @@
<tr class="account-content-tmp"> <tr class="account-content-tmp">
<td style="width:30px;"></td> <td style="width:30px;"></td>
<td style="width:140px; padding:3px;"><select class="account-id-dlg" style="width:140px;"></select></td> <td style="width:140px; padding:3px;"><select class="account-id-dlg" style="width:140px;"></select></td>
<td style="width:100px; padding:3px;"><input class="account-money-dlg" style="width:100px;" /></td> <td style="width:100px; padding:3px;"><input class="account-money-dlg" style="width:100px;"/></td>
</tr> </tr>
</table> </table>
</div> </div>
<div id="accountDlgButtons"> <div id="accountDlgButtons">
<a href="javascript:void(0)" id="saveDepotHeadAccountDlg" class="easyui-linkbutton" iconCls="icon-ok">保存</a> <a href="javascript:void(0)" id="saveDepotHeadAccountDlg" class="easyui-linkbutton" iconCls="icon-ok">保存</a>
<a href="javascript:void(0)" id="cancelDepotHeadAccountDlg" class="easyui-linkbutton" iconCls="icon-cancel">取消</a> <a href="javascript:void(0)" id="cancelDepotHeadAccountDlg" class="easyui-linkbutton" iconCls="icon-cancel">取消</a>
</div> </div>
<div id="otherMoneyDlg" class="easyui-dialog" style="width:380px;padding:10px 20px;top:80px" <div id="otherMoneyDlg" class="easyui-dialog" style="width:380px;padding:10px 20px;top:80px"
closed="true" modal="true" buttons="#otherMoneyDlgBtn" cache="false" collapsible="false" closable="true"> closed="true" modal="true" buttons="#otherMoneyDlgBtn" cache="false" collapsible="false" closable="true">
<table class="money-dlg"> <table class="money-dlg">
<tr class="money-head-tmp"> <tr class="money-head-tmp">
@@ -263,13 +273,13 @@
<tr class="money-content-tmp"> <tr class="money-content-tmp">
<td style="width:30px;"></td> <td style="width:30px;"></td>
<td style="width:140px; padding:3px;"><select class="money-id-dlg" style="width:140px;"></select></td> <td style="width:140px; padding:3px;"><select class="money-id-dlg" style="width:140px;"></select></td>
<td style="width:100px; padding:3px;"><input class="other-money-dlg" style="width:100px;" /></td> <td style="width:100px; padding:3px;"><input class="other-money-dlg" style="width:100px;"/></td>
</tr> </tr>
</table> </table>
</div> </div>
<div id="otherMoneyDlgBtn"> <div id="otherMoneyDlgBtn">
<a href="javascript:void(0)" id="saveOtherMoneyDlg" class="easyui-linkbutton" iconCls="icon-ok">保存</a> <a href="javascript:void(0)" id="saveOtherMoneyDlg" class="easyui-linkbutton" iconCls="icon-ok">保存</a>
<a href="javascript:void(0)" id="cancelOtherMoneyDlg" class="easyui-linkbutton" iconCls="icon-cancel">取消</a> <a href="javascript:void(0)" id="cancelOtherMoneyDlg" class="easyui-linkbutton" iconCls="icon-cancel">取消</a>
</div> </div>
</body> </body>
</html> </html>

View File

@@ -1,21 +1,21 @@
<%@page import="com.jsh.util.Tools"%> <%@page import="com.jsh.util.Tools" %>
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%> <%@ page language="java" pageEncoding="utf-8" %>
<% <%
String path = request.getContextPath(); String path = request.getContextPath();
String clientIp = Tools.getLocalIp(request); String clientIp = Tools.getLocalIp(request);
%> %>
<!DOCTYPE html> <!DOCTYPE html>
<html> <html>
<head> <head>
<title>销售出库</title> <title>销售出库</title>
<meta charset="utf-8"> <meta charset="utf-8">
<!-- 指定以IE8的方式来渲染 --> <!-- 指定以IE8的方式来渲染 -->
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE8"/> <meta http-equiv="X-UA-Compatible" content="IE=EmulateIE8"/>
<link rel="shortcut icon" href="<%=path%>/images/favicon.ico" type="image/x-icon" /> <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/default/easyui.css"/>
<link rel="stylesheet" type="text/css" href="<%=path %>/js/easyui-1.3.5/themes/icon.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" /> <link type="text/css" rel="stylesheet" href="<%=path %>/css/common.css"/>
<link type="text/css" rel="stylesheet" href="<%=path %>/css/in_out.css" /> <link type="text/css" rel="stylesheet" href="<%=path %>/css/in_out.css"/>
<script src="<%=path %>/js/jquery-1.8.0.min.js"></script> <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/jquery.easyui.min.js"></script>
<script src="<%=path %>/js/easyui-1.3.5/locale/easyui-lang-zh_CN.js"></script> <script src="<%=path %>/js/easyui-1.3.5/locale/easyui-lang-zh_CN.js"></script>
@@ -27,10 +27,11 @@
var path = "<%=path%>"; var path = "<%=path%>";
var clientIp = "<%=clientIp%>"; var clientIp = "<%=clientIp%>";
</script> </script>
</head> </head>
<body> <body>
<!-- 查询 --> <!-- 查询 -->
<div id = "searchPanel" class="easyui-panel" style="padding:3px;" title="查询窗口" iconCls="icon-search" collapsible="true" closable="false"> <div id="searchPanel" class="easyui-panel" style="padding:3px;" title="查询窗口" iconCls="icon-search" collapsible="true"
closable="false">
<table id="searchTable"> <table id="searchTable">
<tr> <tr>
<td>单据编号:</td> <td>单据编号:</td>
@@ -43,11 +44,13 @@
</td> </td>
<td>单据日期:</td> <td>单据日期:</td>
<td> <td>
<input type="text" name="searchBeginTime" id="searchBeginTime" onClick="WdatePicker({dateFmt:'yyyy-MM-dd'})" class="txt Wdate" style="width:100px;"/> <input type="text" name="searchBeginTime" id="searchBeginTime"
onClick="WdatePicker({dateFmt:'yyyy-MM-dd'})" class="txt Wdate" style="width:100px;"/>
</td> </td>
<td>-</td> <td>-</td>
<td> <td>
<input type="text" name="searchEndTime" id="searchEndTime" onClick="WdatePicker({dateFmt:'yyyy-MM-dd'})" class="txt Wdate" style="width:100px;"/> <input type="text" name="searchEndTime" id="searchEndTime" onClick="WdatePicker({dateFmt:'yyyy-MM-dd'})"
class="txt Wdate" style="width:100px;"/>
</td> </td>
<td>&nbsp;</td> <td>&nbsp;</td>
<td> <td>
@@ -56,33 +59,37 @@
</td> </td>
</tr> </tr>
</table> </table>
</div> </div>
<!-- 数据显示table --> <!-- 数据显示table -->
<div id="tablePanel" class="easyui-panel" style="padding:1px; top:300px;" title="销售出库列表" iconCls="icon-list" collapsible="true" closable="false"> <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> <table id="tableData" style="top:300px;border-bottom-color:#FFFFFF"></table>
</div> </div>
<div id="depotHeadDlg" class="easyui-dialog" style="width:1200px;padding:10px 20px;top:20px" <div id="depotHeadDlg" class="easyui-dialog" style="width:1200px;padding:10px 20px;top:20px"
closed="true" buttons="#dlg-buttons" modal="true" cache="false" collapsible="false" closable="true"> closed="true" buttons="#dlg-buttons" modal="true" cache="false" collapsible="false" closable="true">
<form id="depotHeadFM" method="post" novalidate> <form id="depotHeadFM" method="post" novalidate>
<table> <table>
<tr> <tr>
<td style="width:60px;">客户:</td> <td style="width:60px;">客户:</td>
<td style="padding:5px"> <td style="padding:5px">
<input id="OrganId" name="OrganId" style="width:130px;" /> <input id="OrganId" name="OrganId" style="width:130px;"/>
</td> </td>
<td style="width:70px;">销售人员:</td> <td style="width:70px;">销售人员:</td>
<td style="padding:5px"> <td style="padding:5px">
<input id="Salesman" name="Salesman" style="width:130px;" /> <input id="Salesman" name="Salesman" style="width:130px;"/>
</td> </td>
<td style="width:80px;">单据日期:</td> <td style="width:80px;">单据日期:</td>
<td style="padding:5px"> <td style="padding:5px">
<input type="text" name="OperTime" id="OperTime" onClick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'})" class="txt Wdate" style="width:140px;"/> <input type="text" name="OperTime" id="OperTime"
onClick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'})" class="txt Wdate"
style="width:140px;"/>
</td> </td>
<td style="width:70px;">单据编号:</td> <td style="width:70px;">单据编号:</td>
<td style="padding:5px"> <td style="padding:5px">
<input name="Number" id="Number" class="easyui-validatebox" data-options="required:true,validType:'length[2,30]'" style="width: 140px;"/> <input name="Number" id="Number" class="easyui-validatebox"
data-options="required:true,validType:'length[2,30]'" style="width: 140px;"/>
</td> </td>
<td style="width:100px;"></td> <td style="width:100px;"></td>
</tr> </tr>
@@ -94,26 +101,27 @@
</tr> </tr>
<tr> <tr>
<td colspan="9"> <td colspan="9">
<textarea name="Remark" id="Remark" rows="2" cols="2" placeholder="暂无备注信息" style="width: 1130px; height:35px;"></textarea> <textarea name="Remark" id="Remark" rows="2" cols="2" placeholder="暂无备注信息"
style="width: 1130px; height:35px;"></textarea>
</td> </td>
</tr> </tr>
<tr> <tr>
<td>优惠率:</td> <td>优惠率:</td>
<td style="padding:5px"> <td style="padding:5px">
<input id="Discount" name="Discount" style="width:110px;" /> <input id="Discount" name="Discount" style="width:110px;"/>
% %
</td> </td>
<td>收款优惠:</td> <td>收款优惠:</td>
<td style="padding:5px"> <td style="padding:5px">
<input id="DiscountMoney" name="DiscountMoney" style="width:120px;" /> <input id="DiscountMoney" name="DiscountMoney" style="width:120px;"/>
</td> </td>
<td>优惠后金额:</td> <td>优惠后金额:</td>
<td style="padding:5px"> <td style="padding:5px">
<input id="DiscountLastMoney" name="DiscountLastMoney" readonly="readonly" style="width:120px;" /> <input id="DiscountLastMoney" name="DiscountLastMoney" readonly="readonly" style="width:120px;"/>
</td> </td>
<td>本次收款:</td> <td>本次收款:</td>
<td style="padding:5px"> <td style="padding:5px">
<input id="ChangeAmount" name="ChangeAmount" data-changeamount="0" style="width:120px;" /> <input id="ChangeAmount" name="ChangeAmount" data-changeamount="0" style="width:120px;"/>
</td> </td>
<td style="width:100px;"></td> <td style="width:100px;"></td>
</tr> </tr>
@@ -121,32 +129,35 @@
<td>结算账户:</td> <td>结算账户:</td>
<td style="padding:5px"> <td style="padding:5px">
<select name="AccountId" id="AccountId" style="width:120px;"></select> <select name="AccountId" id="AccountId" style="width:120px;"></select>
<img class="many-account-ico" src="<%=path%>/js/easyui-1.3.5/themes/icons/filelist.jpg" style="display: none;"/> <img class="many-account-ico" src="<%=path%>/js/easyui-1.3.5/themes/icons/filelist.jpg"
style="display: none;"/>
</td> </td>
<td>本次欠款:</td> <td>本次欠款:</td>
<td style="padding:5px"> <td style="padding:5px">
<input id="Debt" name="Debt" readonly="readonly" style="width:120px;" /> <input id="Debt" name="Debt" readonly="readonly" style="width:120px;"/>
</td> </td>
<td>销售费用:</td> <td>销售费用:</td>
<td style="padding:5px"> <td style="padding:5px">
<input id="OtherMoney" name="OtherMoney" style="width:120px;" readonly="readonly" /> <input id="OtherMoney" name="OtherMoney" style="width:120px;" readonly="readonly"/>
<img class="other-money-ico" src="<%=path%>/js/easyui-1.3.5/themes/icons/filelist.jpg" /> <img class="other-money-ico" src="<%=path%>/js/easyui-1.3.5/themes/icons/filelist.jpg"/>
</td> </td>
<td>结算天数:</td> <td>结算天数:</td>
<td style="padding:5px"> <td style="padding:5px">
<input id="AccountDay" name="AccountDay" class="easyui-numberbox" data-options="validType:'length[1,3]'" style="width:120px;" /> <input id="AccountDay" name="AccountDay" class="easyui-numberbox"
data-options="validType:'length[1,3]'" style="width:120px;"/>
</td> </td>
<td style="width:100px;"></td> <td style="width:100px;"></td>
</tr> </tr>
</table> </table>
<input type="hidden" name="clientIp" id="clientIp" value="<%=clientIp %>"/> <input type="hidden" name="clientIp" id="clientIp" value="<%=clientIp %>"/>
</form> </form>
</div> </div>
<div id="dlg-buttons"> <div id="dlg-buttons">
<a href="javascript:void(0)" id="saveDepotHead" class="easyui-linkbutton" iconCls="icon-ok">保存</a> <a href="javascript:void(0)" id="saveDepotHead" class="easyui-linkbutton" iconCls="icon-ok">保存</a>
<a href="javascript:void(0)" id="cancelDepotHead" class="easyui-linkbutton" iconCls="icon-cancel" onclick="javascript:$('#depotHeadDlg').dialog('close')">取消</a> <a href="javascript:void(0)" id="cancelDepotHead" class="easyui-linkbutton" iconCls="icon-cancel"
</div> onclick="javascript:$('#depotHeadDlg').dialog('close')">取消</a>
<div id="depotHeadDlgShow" class="easyui-dialog" style="width:1200px;padding:10px 20px;top:20px" </div>
<div id="depotHeadDlgShow" class="easyui-dialog" style="width:1200px;padding:10px 20px;top:20px"
closed="true" modal="true" cache="false" collapsible="false" closable="true"> closed="true" modal="true" cache="false" collapsible="false" closable="true">
<table> <table>
<tr> <tr>
@@ -220,8 +231,8 @@
<td style="width:100px;"></td> <td style="width:100px;"></td>
</tr> </tr>
</table> </table>
</div> </div>
<div id="depotHeadAccountDlg" class="easyui-dialog" style="width:380px;padding:10px 20px;top:80px" <div id="depotHeadAccountDlg" class="easyui-dialog" style="width:380px;padding:10px 20px;top:80px"
closed="true" modal="true" buttons="#accountDlgButtons" cache="false" collapsible="false" closable="true"> closed="true" modal="true" buttons="#accountDlgButtons" cache="false" collapsible="false" closable="true">
<table class="account-dlg"> <table class="account-dlg">
<tr class="account-head-tmp"> <tr class="account-head-tmp">
@@ -239,15 +250,15 @@
<tr class="account-content-tmp"> <tr class="account-content-tmp">
<td style="width:30px;"></td> <td style="width:30px;"></td>
<td style="width:140px; padding:3px;"><select class="account-id-dlg" style="width:140px;"></select></td> <td style="width:140px; padding:3px;"><select class="account-id-dlg" style="width:140px;"></select></td>
<td style="width:100px; padding:3px;"><input class="account-money-dlg" style="width:100px;" /></td> <td style="width:100px; padding:3px;"><input class="account-money-dlg" style="width:100px;"/></td>
</tr> </tr>
</table> </table>
</div> </div>
<div id="accountDlgButtons"> <div id="accountDlgButtons">
<a href="javascript:void(0)" id="saveDepotHeadAccountDlg" class="easyui-linkbutton" iconCls="icon-ok">保存</a> <a href="javascript:void(0)" id="saveDepotHeadAccountDlg" class="easyui-linkbutton" iconCls="icon-ok">保存</a>
<a href="javascript:void(0)" id="cancelDepotHeadAccountDlg" class="easyui-linkbutton" iconCls="icon-cancel">取消</a> <a href="javascript:void(0)" id="cancelDepotHeadAccountDlg" class="easyui-linkbutton" iconCls="icon-cancel">取消</a>
</div> </div>
<div id="otherMoneyDlg" class="easyui-dialog" style="width:380px;padding:10px 20px;top:80px" <div id="otherMoneyDlg" class="easyui-dialog" style="width:380px;padding:10px 20px;top:80px"
closed="true" modal="true" buttons="#otherMoneyDlgBtn" cache="false" collapsible="false" closable="true"> closed="true" modal="true" buttons="#otherMoneyDlgBtn" cache="false" collapsible="false" closable="true">
<table class="money-dlg"> <table class="money-dlg">
<tr class="money-head-tmp"> <tr class="money-head-tmp">
@@ -265,14 +276,14 @@
<tr class="money-content-tmp"> <tr class="money-content-tmp">
<td style="width:30px;"></td> <td style="width:30px;"></td>
<td style="width:140px; padding:3px;"><select class="money-id-dlg" style="width:140px;"></select></td> <td style="width:140px; padding:3px;"><select class="money-id-dlg" style="width:140px;"></select></td>
<td style="width:100px; padding:3px;"><input class="other-money-dlg" style="width:100px;" /></td> <td style="width:100px; padding:3px;"><input class="other-money-dlg" style="width:100px;"/></td>
</tr> </tr>
</table> </table>
</div> </div>
<div id="otherMoneyDlgBtn"> <div id="otherMoneyDlgBtn">
<a href="javascript:void(0)" id="saveOtherMoneyDlg" class="easyui-linkbutton" iconCls="icon-ok">保存</a> <a href="javascript:void(0)" id="saveOtherMoneyDlg" class="easyui-linkbutton" iconCls="icon-ok">保存</a>
<a href="javascript:void(0)" id="cancelOtherMoneyDlg" class="easyui-linkbutton" iconCls="icon-cancel">取消</a> <a href="javascript:void(0)" id="cancelOtherMoneyDlg" class="easyui-linkbutton" iconCls="icon-cancel">取消</a>
</div> </div>
</body> </body>
</html> </html>

View File

@@ -1,19 +1,19 @@
<%@page import="com.jsh.util.Tools"%> <%@page import="com.jsh.util.Tools" %>
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%> <%@ page language="java" pageEncoding="utf-8" %>
<% <%
String path = request.getContextPath(); String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/"; String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + path + "/";
String clientIp = Tools.getLocalIp(request); String clientIp = Tools.getLocalIp(request);
%> %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <!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"> <html xmlns="http://www.w3.org/1999/xhtml">
<head> <head>
<title>资产管理</title> <title>资产管理</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<!-- 指定以IE8的方式来渲染 --> <!-- 指定以IE8的方式来渲染 -->
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE8"/> <meta http-equiv="X-UA-Compatible" content="IE=EmulateIE8"/>
<link rel="shortcut icon" href="<%=path%>/images/favicon.ico" type="image/x-icon" /> <link rel="shortcut icon" href="<%=path%>/images/favicon.ico" type="image/x-icon"/>
<link rel="stylesheet" type="text/css" href="<%=path %>/js/jdigiclock/css/jquery.jdigiclock.css" /> <link rel="stylesheet" type="text/css" href="<%=path %>/js/jdigiclock/css/jquery.jdigiclock.css"/>
<script type="text/javascript" src="<%=path %>/js/jquery-1.8.0.min.js"></script> <script type="text/javascript" src="<%=path %>/js/jquery-1.8.0.min.js"></script>
<script type="text/javascript" src="<%=path %>/js/jdigiclock/lib/jquery.jdigiclock.js"></script> <script type="text/javascript" src="<%=path %>/js/jdigiclock/lib/jquery.jdigiclock.js"></script>
<!-- 图片上次预览js开始 --> <!-- 图片上次预览js开始 -->
@@ -23,12 +23,13 @@
<!-- 图片上次预览js结束 --> <!-- 图片上次预览js结束 -->
<style type="text/css"> <style type="text/css">
::-moz-focus-inner{ ::-moz-focus-inner {
padding: 0; padding: 0;
border: 0; border: 0;
} }
.ui_button,
.ui_fileup { .ui_button,
.ui_fileup {
vertical-align: middle; vertical-align: middle;
border: 1px solid #ccc; border: 1px solid #ccc;
display: inline-block; display: inline-block;
@@ -38,12 +39,14 @@
*overflow: visible; *overflow: visible;
*display: inline; *display: inline;
*zoom: 1; *zoom: 1;
} }
.ui_fileup {
.ui_fileup {
position: relative; position: relative;
overflow: hidden; overflow: hidden;
} }
.ui_fileup input {
.ui_fileup input {
filter: alpha(opacity=1); filter: alpha(opacity=1);
position: absolute; position: absolute;
background: #fff; background: #fff;
@@ -55,61 +58,65 @@
left: auto; left: auto;
right: 0; right: 0;
top: 0; top: 0;
} }
.avataria .cont { .avataria .cont {
text-align: center; text-align: center;
min-height: 1%; min-height: 1%;
margin: 25px; margin: 25px;
width: 302px; width: 302px;
_zoom: 1; _zoom: 1;
} }
.avataria form {
.avataria form {
text-align: left; text-align: left;
overflow: hidden; overflow: hidden;
} }
.avataria .cont:after {
.avataria .cont:after {
content: ""; content: "";
display: block; display: block;
overflow: hidden; overflow: hidden;
height: 0; height: 0;
clear: both; clear: both;
} }
.thumb {
.thumb {
float: right; float: right;
height: 120px; height: 120px;
width: 120px; width: 120px;
} }
.cropaera {
.cropaera {
clear: both; clear: both;
} }
.preview {
.preview {
height: 300px; height: 300px;
width: 300px; width: 300px;
} }
</style> </style>
</head> </head>
<body> <body>
<!-- <div class="avataria" title="头像上传前预览"> <!-- <div class="avataria" title="头像上传前预览">
<div class="cont"> <div class="cont">
<div class="thumb"></div> <div class="thumb"></div>
<form enctype="application/x-www-form-urlencoded"> <form enctype="application/x-www-form-urlencoded">
<div class="ui_fileup"><input type="file" id="file" accept="image/*" onerror="alert('请选择一个图片')">浏览</div> <div class="ui_fileup"><input type="file" id="file" accept="image/*" onerror="alert('请选择一个图片')">浏览</div>
&nbsp; &nbsp;
<input type="submit" class="ui_button" value="保存"> <input type="submit" class="ui_button" value="保存">
<input name="crop" type="hidden"> <input name="crop" type="hidden">
</form> </form>
</div> </div>
<div class="cont"> <div class="cont">
<div id="preview" class="preview"></div> <div id="preview" class="preview"></div>
</div> </div>
</div> --> </div> -->
<div id="digiclock"></div> <div id="digiclock"></div>
<script type="text/javascript"> <script type="text/javascript">
//初始化界面 //初始化界面
$(function() $(function () {
{
initColck(); initColck();
//imagepreview(document.getElementById("file"), document.getElementById("preview"), function(info){ //imagepreview(document.getElementById("file"), document.getElementById("preview"), function(info){
@@ -125,14 +132,14 @@
//}, ".thumb"); //}, ".thumb");
//}); //});
}); });
//初始化钟 //初始化钟
function initColck() function initColck() {
{
$('#digiclock').jdigiclock({ $('#digiclock').jdigiclock({
clockImagesPath:"<%=path%>/js/jdigiclock/images/clock/", clockImagesPath: "<%=path%>/js/jdigiclock/images/clock/",
weatherImagesPath:"<%=path%>/js/jdigiclock/images/weather/" weatherImagesPath: "<%=path%>/js/jdigiclock/images/weather/"
}); });
} }
</script> </script>
</body> </body>
</html> </html>

View File

@@ -1,15 +1,15 @@
<%@page import="com.jsh.util.Tools"%> <%@page import="com.jsh.util.Tools" %>
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%> <%@ page language="java" pageEncoding="utf-8" %>
<% <%
String path = request.getContextPath(); String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/"; String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + path + "/";
String clientIp = Tools.getLocalIp(request); String clientIp = Tools.getLocalIp(request);
%> %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <!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"> <html xmlns="http://www.w3.org/1999/xhtml">
<head> <head>
<title>Simple Map</title> <title>Simple Map</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<meta name="viewport" content="initial-scale=1.0, user-scalable=no"> <meta name="viewport" content="initial-scale=1.0, user-scalable=no">
<meta charset="utf-8"> <meta charset="utf-8">
<style> <style>
@@ -21,21 +21,22 @@
</style> </style>
<script src="https://maps.googleapis.com/maps/api/js?v=3.exp&sensor=false"></script> <script src="https://maps.googleapis.com/maps/api/js?v=3.exp&sensor=false"></script>
<script> <script>
var map; var map;
function initialize() {
function initialize() {
var mapOptions = { var mapOptions = {
zoom: 8, zoom: 8,
center: new google.maps.LatLng(-34.397, 150.644) center: new google.maps.LatLng(-34.397, 150.644)
}; };
map = new google.maps.Map(document.getElementById('map-canvas'), map = new google.maps.Map(document.getElementById('map-canvas'),
mapOptions); mapOptions);
} }
google.maps.event.addDomListener(window, 'load', initialize); google.maps.event.addDomListener(window, 'load', initialize);
</script> </script>
</head> </head>
<body> <body>
<div id="map-canvas"></div> <div id="map-canvas"></div>
</body> </body>
</html> </html>

View File

@@ -1,31 +1,32 @@
<%@page import="com.jsh.util.Tools"%> <%@page import="com.jsh.util.Tools" %>
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%> <%@ page language="java" pageEncoding="utf-8" %>
<% <%
String path = request.getContextPath(); String path = request.getContextPath();
String clientIp = Tools.getLocalIp(request); String clientIp = Tools.getLocalIp(request);
%> %>
<!DOCTYPE html> <!DOCTYPE html>
<html> <html>
<head> <head>
<title>结算账户查询</title> <title>结算账户查询</title>
<meta charset="utf-8"> <meta charset="utf-8">
<!-- 指定以IE8的方式来渲染 --> <!-- 指定以IE8的方式来渲染 -->
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE8"/> <meta http-equiv="X-UA-Compatible" content="IE=EmulateIE8"/>
<link rel="shortcut icon" href="<%=path%>/images/favicon.ico" type="image/x-icon" /> <link rel="shortcut icon" href="<%=path%>/images/favicon.ico" type="image/x-icon"/>
<script type="text/javascript" src="<%=path %>/js/jquery-1.8.0.min.js"></script> <script type="text/javascript" src="<%=path %>/js/jquery-1.8.0.min.js"></script>
<script type="text/javascript" src="<%=path %>/js/print/print.js"></script> <script type="text/javascript" src="<%=path %>/js/print/print.js"></script>
<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/default/easyui.css"/>
<link rel="stylesheet" type="text/css" href="<%=path %>/js/easyui-1.3.5/themes/icon.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" /> <link type="text/css" rel="stylesheet" href="<%=path %>/css/common.css"/>
<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/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/locale/easyui-lang-zh_CN.js"></script>
<script type="text/javascript" src="<%=path %>/js/common/outlook_in.js"></script> <script type="text/javascript" src="<%=path %>/js/common/outlook_in.js"></script>
<script type="text/javascript" src="<%=path %>/js/My97DatePicker/WdatePicker.js"></script> <script type="text/javascript" src="<%=path %>/js/My97DatePicker/WdatePicker.js"></script>
<script type="text/javascript" src="<%=path %>/js/common/common.js"></script> <script type="text/javascript" src="<%=path %>/js/common/common.js"></script>
</head> </head>
<body> <body>
<!-- 查询 --> <!-- 查询 -->
<div id = "searchPanel" class="easyui-panel" style="padding:10px;" title="查询窗口" iconCls="icon-search" collapsible="true" closable="false"> <div id="searchPanel" class="easyui-panel" style="padding:10px;" title="查询窗口" iconCls="icon-search" collapsible="true"
closable="false">
<table id="searchTable"> <table id="searchTable">
<tr> <tr>
<td>名称:</td> <td>名称:</td>
@@ -46,204 +47,199 @@
</td> </td>
</tr> </tr>
</table> </table>
</div> </div>
<!-- 数据显示table --> <!-- 数据显示table -->
<div id = "tablePanel" class="easyui-panel" style="padding:1px;top:300px;" title="结算账户列表" iconCls="icon-list" collapsible="true" closable="false"> <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> <table id="tableData" style="top:300px;border-bottom-color:#FFFFFF"></table>
</div> </div>
<div id="accountDetailListDlg" class="easyui-dialog" style="width:900px;height:500px;padding:10px 20px" closed="true" modal="true" collapsible="false" closable="true"> <div id="accountDetailListDlg" class="easyui-dialog" style="width:900px;height:500px;padding:10px 20px" closed="true"
modal="true" collapsible="false" closable="true">
<table id="accountTableData" style="top:50px;border-bottom-color:#FFFFFF"></table> <table id="accountTableData" style="top:50px;border-bottom-color:#FFFFFF"></table>
</div> </div>
<script type="text/javascript"> <script type="text/javascript">
//初始化界面 //初始化界面
$(function() $(function () {
{
initTableData(); initTableData();
ininPager(); ininPager();
print(); print();
}); });
//初始化表格数据 //初始化表格数据
function initTableData(){ function initTableData() {
$('#tableData').datagrid({ $('#tableData').datagrid({
//iconCls:'icon-save', //iconCls:'icon-save',
//width:700, //width:700,
height:heightInfo, height: heightInfo,
nowrap: false, nowrap: false,
rownumbers: true, rownumbers: true,
//动画效果 //动画效果
animate:false, animate: false,
//选中单行 //选中单行
singleSelect : true, singleSelect: true,
collapsible:false, collapsible: false,
selectOnCheck:false, selectOnCheck: false,
//fitColumns:true, //fitColumns:true,
//单击行是否选中 //单击行是否选中
checkOnSelect : false, checkOnSelect: false,
//交替出现背景 //交替出现背景
striped : true, striped: true,
url:'<%=path %>/account/findBy.action?pageSize=' + initPageSize, url: '<%=path %>/account/findBy.action?pageSize=' + initPageSize,
pagination: true, pagination: true,
//自动截取数据 //自动截取数据
//nowrap : true, //nowrap : true,
//loadFilter: pagerFilter, //loadFilter: pagerFilter,
pageSize: initPageSize, pageSize: initPageSize,
pageList: initPageNum, pageList: initPageNum,
columns:[[ columns: [[
{ title: '名称',field: 'name',width:100}, {title: '名称', field: 'name', width: 100},
{ title: '编号', field: 'serialNo',width:150,align:"center"}, {title: '编号', field: 'serialNo', width: 150, align: "center"},
{ title: '期初金额', field: 'initialAmount',width:100,align:"center"}, {title: '期初金额', field: 'initialAmount', width: 100, align: "center"},
{ title: '本月发生额', field: 'thisMonthAmount',width:100,align:"center"}, {title: '本月发生额', field: 'thisMonthAmount', width: 100, align: "center"},
{ title: '当前余额', field: 'currentAmount',width:100,align:"center"}, {title: '当前余额', field: 'currentAmount', width: 100, align: "center"},
{ title: '操作', field: 'op',width:100,align:"center",formatter:function(value,rec) { {
title: '操作', field: 'op', width: 100, align: "center", formatter: function (value, rec) {
var str = ''; var str = '';
var rowInfo = rec.id + 'AaBb' + rec.name +'AaBb' + rec.serialNo +'AaBb' + rec.initialAmount +'AaBb' + rec.currentAmount; var rowInfo = rec.id + 'AaBb' + rec.name + 'AaBb' + rec.serialNo + 'AaBb' + rec.initialAmount + 'AaBb' + rec.currentAmount;
str += '<img src="<%=path%>/js/easyui-1.3.5/themes/icons/list.png" style="cursor: pointer;" onclick="showAccountInOutList(\'' + rowInfo + '\');"/>&nbsp;<a onclick="showAccountInOutList(\'' + 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/list.png" style="cursor: pointer;" onclick="showAccountInOutList(\'' + rowInfo + '\');"/>&nbsp;<a onclick="showAccountInOutList(\'' + rowInfo + '\');" style="text-decoration:none;color:black;" href="javascript:void(0)">流水</a>&nbsp;&nbsp;';
return str; return str;
} }
} }
]], ]],
onLoadError:function() onLoadError: function () {
{ $.messager.alert('页面加载提示', '页面加载异常,请稍后再试!', 'error');
$.messager.alert('页面加载提示','页面加载异常,请稍后再试!','error');
return; return;
} }
}); });
} }
//初始化键盘enter事件 //初始化键盘enter事件
$(document).keydown(function(event) $(document).keydown(function (event) {
{
//兼容 IE和firefox 事件 //兼容 IE和firefox 事件
var e = window.event || event; var e = window.event || event;
var k = e.keyCode||e.which||e.charCode; var k = e.keyCode || e.which || e.charCode;
//兼容 IE,firefox 兼容 //兼容 IE,firefox 兼容
var obj = e.srcElement ? e.srcElement : e.target; var obj = e.srcElement ? e.srcElement : e.target;
//绑定键盘事件为 id是指定的输入框才可以触发键盘事件 13键盘事件 ---遗留问题 enter键效验 对话框会关闭问题 //绑定键盘事件为 id是指定的输入框才可以触发键盘事件 13键盘事件 ---遗留问题 enter键效验 对话框会关闭问题
//搜索按钮添加快捷键 //搜索按钮添加快捷键
if(k == "13"&&(obj.id=="searchName"||obj.id=="searchSerialNo")) if (k == "13" && (obj.id == "searchName" || obj.id == "searchSerialNo")) {
{
$("#searchBtn").click(); $("#searchBtn").click();
} }
}); });
//分页信息处理 //分页信息处理
function ininPager() function ininPager() {
{ try {
try
{
var opts = $("#tableData").datagrid('options'); var opts = $("#tableData").datagrid('options');
var pager = $("#tableData").datagrid('getPager'); var pager = $("#tableData").datagrid('getPager');
pager.pagination({ pager.pagination({
onSelectPage:function(pageNum, pageSize) onSelectPage: function (pageNum, pageSize) {
{
opts.pageNumber = pageNum; opts.pageNumber = pageNum;
opts.pageSize = pageSize; opts.pageSize = pageSize;
pager.pagination('refresh', pager.pagination('refresh',
{ {
pageNumber:pageNum, pageNumber: pageNum,
pageSize:pageSize pageSize: pageSize
}); });
showAccountDetails(pageNum,pageSize); showAccountDetails(pageNum, pageSize);
} }
}); });
} }
catch (e) catch (e) {
{ $.messager.alert('异常处理提示', "分页信息异常 : " + e.name + ": " + e.message, 'error');
$.messager.alert('异常处理提示',"分页信息异常 : " + e.name + ": " + e.message,'error');
} }
} }
//搜索处理 //搜索处理
$("#searchBtn").unbind().bind({ $("#searchBtn").unbind().bind({
click:function() click: function () {
{ showAccountDetails(1, initPageSize);
showAccountDetails(1,initPageSize);
var opts = $("#tableData").datagrid('options'); var opts = $("#tableData").datagrid('options');
var pager = $("#tableData").datagrid('getPager'); var pager = $("#tableData").datagrid('getPager');
opts.pageNumber = 1; opts.pageNumber = 1;
opts.pageSize = initPageSize; opts.pageSize = initPageSize;
pager.pagination('refresh', pager.pagination('refresh',
{ {
pageNumber:1, pageNumber: 1,
pageSize:initPageSize pageSize: initPageSize
}); });
} }
}); });
function showAccountDetails(pageNo,pageSize) function showAccountDetails(pageNo, pageSize) {
{
$.ajax({ $.ajax({
type:"post", type: "post",
url: "<%=path %>/account/findBy.action", url: "<%=path %>/account/findBy.action",
dataType: "json", dataType: "json",
data: ({ data: ({
name:$.trim($("#searchName").val()), name: $.trim($("#searchName").val()),
serialNo:$.trim($("#searchSerialNo").val()), serialNo: $.trim($("#searchSerialNo").val()),
pageNo:pageNo, pageNo: pageNo,
pageSize:pageSize pageSize: pageSize
}), }),
success: function (data) success: function (data) {
{ $("#tableData").datagrid('loadData', data);
$("#tableData").datagrid('loadData',data);
}, },
//此处添加错误处理 //此处添加错误处理
error:function() error: function () {
{ $.messager.alert('查询提示', '查询数据后台异常,请稍后再试!', 'error');
$.messager.alert('查询提示','查询数据后台异常,请稍后再试!','error');
return; return;
} }
}); });
} }
function showAccountInOutList(accountInfo){ function showAccountInOutList(accountInfo) {
var info = accountInfo.split("AaBb"); var info = accountInfo.split("AaBb");
var accountId = info[0]; var accountId = info[0];
var initialAmount = info[3]; var initialAmount = info[3];
$('#accountDetailListDlg').dialog('open').dialog('setTitle','<img src="<%=path%>/js/easyui-1.3.5/themes/icons/pencil.png"/>&nbsp;查看账户流水'); $('#accountDetailListDlg').dialog('open').dialog('setTitle', '<img src="<%=path%>/js/easyui-1.3.5/themes/icons/pencil.png"/>&nbsp;查看账户流水');
$(".window-mask").css({ width: webW ,height: webH}); $(".window-mask").css({width: webW, height: webH});
initAccountDetailData(accountId); initAccountDetailData(accountId);
getAccountInOutList(accountId,initialAmount,1,initPageSize); getAccountInOutList(accountId, initialAmount, 1, initPageSize);
ininAccountDetailPager(accountId,initialAmount); ininAccountDetailPager(accountId, initialAmount);
} }
//初始化表格数据 //初始化表格数据
function initAccountDetailData(accountId){ function initAccountDetailData(accountId) {
$('#accountTableData').datagrid({ $('#accountTableData').datagrid({
height:heightInfo, height: heightInfo,
nowrap: false, nowrap: false,
rownumbers: false, rownumbers: false,
//动画效果 //动画效果
animate:false, animate: false,
//选中单行 //选中单行
singleSelect : true, singleSelect: true,
collapsible:false, collapsible: false,
selectOnCheck:false, selectOnCheck: false,
//单击行是否选中 //单击行是否选中
checkOnSelect : false, checkOnSelect: false,
//交替出现背景 //交替出现背景
striped : true, striped: true,
pagination: true, pagination: true,
pageSize: initPageSize, pageSize: initPageSize,
pageList: initPageNum, pageList: initPageNum,
columns:[[ columns: [[
{ title: '单据编号',field: 'number',width:150, {
title: '单据编号', field: 'number', width: 150,
formatter: function (value, row) { formatter: function (value, row) {
return "<a class='n-link' onclick=\"newTab('" + row.number + "','../materials/bill_detail.jsp?n=" + row.number + "&type=" + row.type + "','')\">" return "<a class='n-link' onclick=\"newTab('" + row.number + "','../materials/bill_detail.jsp?n=" + row.number + "&type=" + row.type + "','')\">"
+ row.number + "</a>"; + row.number + "</a>";
} }
}, },
{ title: '类型', field: 'type',width:100}, {title: '类型', field: 'type', width: 100},
{ title: '单位信息', field: 'supplierName',width:150}, {title: '单位信息', field: 'supplierName', width: 150},
{ title: '金额', field: 'changeAmount',width:80, {
title: '金额', field: 'changeAmount', width: 80,
formatter: function (value, row) { formatter: function (value, row) {
if(row.aList && row.amList) { if (row.aList && row.amList) {
var aListArr = row.aList.toString().split(","); var aListArr = row.aList.toString().split(",");
var amListArr = row.amList.toString().split(","); var amListArr = row.amList.toString().split(",");
var res = ""; var res = "";
for(var i=0; i<aListArr.length; i++) { for (var i = 0; i < aListArr.length; i++) {
if(aListArr[i] == accountId) { if (aListArr[i] == accountId) {
res = amListArr[i]; res = amListArr[i];
} }
} }
@@ -254,55 +250,55 @@
} }
} }
}, },
{ title: '余额', field: 'balance',width:80}, {title: '余额', field: 'balance', width: 80},
{ title: '入库出库日期',field: 'operTime',width:180} {title: '入库出库日期', field: 'operTime', width: 180}
]], ]],
onLoadError:function() { onLoadError: function () {
$.messager.alert('页面加载提示','页面加载异常,请稍后再试!','error'); $.messager.alert('页面加载提示', '页面加载异常,请稍后再试!', 'error');
return; return;
} }
}); });
} }
//分页信息处理 //分页信息处理
function ininAccountDetailPager(accountId,initialAmount){ function ininAccountDetailPager(accountId, initialAmount) {
try { try {
var opts = $("#accountTableData").datagrid('options'); var opts = $("#accountTableData").datagrid('options');
var pager = $("#accountTableData").datagrid('getPager'); var pager = $("#accountTableData").datagrid('getPager');
pager.pagination({ pager.pagination({
onSelectPage:function(pageNum, pageSize) { onSelectPage: function (pageNum, pageSize) {
opts.pageNumber = pageNum; opts.pageNumber = pageNum;
opts.pageSize = pageSize; opts.pageSize = pageSize;
pager.pagination('refresh', { pager.pagination('refresh', {
pageNumber:pageNum, pageNumber: pageNum,
pageSize:pageSize pageSize: pageSize
}); });
getAccountInOutList(accountId,initialAmount,pageNum,pageSize); getAccountInOutList(accountId, initialAmount, pageNum, pageSize);
} }
}); });
} }
catch (e) { catch (e) {
$.messager.alert('异常处理提示',"分页信息异常 : " + e.name + ": " + e.message,'error'); $.messager.alert('异常处理提示', "分页信息异常 : " + e.name + ": " + e.message, 'error');
} }
} }
function getAccountInOutList(accountId,initialAmount,pageNo,pageSize){ function getAccountInOutList(accountId, initialAmount, pageNo, pageSize) {
$.ajax({ $.ajax({
type:"get", type: "get",
url: "<%=path %>/account/findAccountInOutList.action", url: "<%=path %>/account/findAccountInOutList.action",
dataType: "json", dataType: "json",
data: ({ data: ({
accountID: accountId, accountID: accountId,
initialAmount: initialAmount, initialAmount: initialAmount,
pageNo:pageNo, pageNo: pageNo,
pageSize:pageSize pageSize: pageSize
}), }),
success: function (res) { success: function (res) {
$("#accountTableData").datagrid('loadData',res); $("#accountTableData").datagrid('loadData', res);
}, },
//此处添加错误处理 //此处添加错误处理
error:function() { error: function () {
$.messager.alert('查询提示','查询数据后台异常,请稍后再试!','error'); $.messager.alert('查询提示', '查询数据后台异常,请稍后再试!', 'error');
return; return;
} }
}); });
@@ -310,11 +306,11 @@
//报表打印 //报表打印
function print() { function print() {
$("#printBtn").off("click").on("click",function(){ $("#printBtn").off("click").on("click", function () {
var path = "<%=path %>"; var path = "<%=path %>";
CreateFormPage('打印报表', $('#tableData'), path); CreateFormPage('打印报表', $('#tableData'), path);
}); });
} }
</script> </script>
</body> </body>
</html> </html>

View File

@@ -1,35 +1,37 @@
<%@page import="com.jsh.util.Tools"%> <%@page import="com.jsh.util.Tools" %>
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%> <%@ page language="java" pageEncoding="utf-8" %>
<% <%
String path = request.getContextPath(); String path = request.getContextPath();
String clientIp = Tools.getLocalIp(request); String clientIp = Tools.getLocalIp(request);
%> %>
<!DOCTYPE html> <!DOCTYPE html>
<html> <html>
<head> <head>
<title>进货统计</title> <title>进货统计</title>
<meta charset="utf-8"> <meta charset="utf-8">
<!-- 指定以IE8的方式来渲染 --> <!-- 指定以IE8的方式来渲染 -->
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE8"/> <meta http-equiv="X-UA-Compatible" content="IE=EmulateIE8"/>
<link rel="shortcut icon" href="<%=path%>/images/favicon.ico" type="image/x-icon" /> <link rel="shortcut icon" href="<%=path%>/images/favicon.ico" type="image/x-icon"/>
<script type="text/javascript" src="<%=path %>/js/jquery-1.8.0.min.js"></script> <script type="text/javascript" src="<%=path %>/js/jquery-1.8.0.min.js"></script>
<script type="text/javascript" src="<%=path %>/js/print/print.js"></script> <script type="text/javascript" src="<%=path %>/js/print/print.js"></script>
<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/default/easyui.css"/>
<link rel="stylesheet" type="text/css" href="<%=path %>/js/easyui-1.3.5/themes/icon.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" /> <link type="text/css" rel="stylesheet" href="<%=path %>/css/common.css"/>
<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/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/locale/easyui-lang-zh_CN.js"></script>
<script type="text/javascript" src="<%=path %>/js/My97DatePicker/WdatePicker.js"></script> <script type="text/javascript" src="<%=path %>/js/My97DatePicker/WdatePicker.js"></script>
<script type="text/javascript" src="<%=path %>/js/common/common.js"></script> <script type="text/javascript" src="<%=path %>/js/common/common.js"></script>
</head> </head>
<body> <body>
<!-- 查询 --> <!-- 查询 -->
<div id = "searchPanel" class="easyui-panel" style="padding:10px;" title="查询窗口" iconCls="icon-search" collapsible="true" closable="false"> <div id="searchPanel" class="easyui-panel" style="padding:10px;" title="查询窗口" iconCls="icon-search" collapsible="true"
closable="false">
<table id="searchTable"> <table id="searchTable">
<tr> <tr>
<td>月份:</td> <td>月份:</td>
<td> <td>
<input type="text" name="searchMonth" id="searchMonth" onClick="WdatePicker({dateFmt:'yyyy-MM'})" class="txt Wdate" style="width:180px;"/> <input type="text" name="searchMonth" id="searchMonth" onClick="WdatePicker({dateFmt:'yyyy-MM'})"
class="txt Wdate" style="width:180px;"/>
</td> </td>
<td>&nbsp;</td> <td>&nbsp;</td>
<td>&nbsp;</td> <td>&nbsp;</td>
@@ -40,18 +42,18 @@
</td> </td>
</tr> </tr>
</table> </table>
</div> </div>
<!-- 数据显示table --> <!-- 数据显示table -->
<div id = "tablePanel" class="easyui-panel" style="padding:1px;top:300px;" title="进货统计列表" iconCls="icon-list" collapsible="true" closable="false"> <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> <table id="tableData" style="top:300px;border-bottom-color:#FFFFFF"></table>
</div> </div>
<script type="text/javascript"> <script type="text/javascript">
var mPropertyList = ""; //商品属性列表 var mPropertyList = ""; //商品属性列表
//初始化界面 //初始化界面
$(function() $(function () {
{
var thisDate = getNowFormatMonth(); //当前月份 var thisDate = getNowFormatMonth(); //当前月份
$("#searchMonth").val(thisDate); $("#searchMonth").val(thisDate);
initMProperty(); //初始化商品属性 initMProperty(); //初始化商品属性
@@ -62,7 +64,7 @@
}); });
//初始化商品属性 //初始化商品属性
function initMProperty(){ function initMProperty() {
$.ajax({ $.ajax({
type: "post", type: "post",
url: "<%=path %>/materialProperty/findBy.action", url: "<%=path %>/materialProperty/findBy.action",
@@ -70,197 +72,185 @@
success: function (res) { success: function (res) {
if (res && res.rows) { if (res && res.rows) {
var thisRows = res.rows; var thisRows = res.rows;
for(var i=0; i < thisRows.length; i++) { for (var i = 0; i < thisRows.length; i++) {
if(thisRows[i].enabled){ if (thisRows[i].enabled) {
mPropertyList += thisRows[i].nativeName +","; mPropertyList += thisRows[i].nativeName + ",";
} }
} }
if(mPropertyList){ if (mPropertyList) {
mPropertyList = mPropertyList.substring(0,mPropertyList.length-1); mPropertyList = mPropertyList.substring(0, mPropertyList.length - 1);
} }
} }
}, },
//此处添加错误处理 //此处添加错误处理
error:function() { error: function () {
$.messager.alert('查询提示','查询信息异常,请稍后再试!','error'); $.messager.alert('查询提示', '查询信息异常,请稍后再试!', 'error');
return; return;
} }
}); });
} }
//初始化表格数据 //初始化表格数据
function initTableData() function initTableData() {
{
$('#tableData').datagrid({ $('#tableData').datagrid({
height:heightInfo, height: heightInfo,
nowrap: false, nowrap: false,
rownumbers: true, rownumbers: true,
//动画效果 //动画效果
animate:false, animate: false,
//选中单行 //选中单行
singleSelect : true, singleSelect: true,
pagination: true, pagination: true,
//交替出现背景 //交替出现背景
striped : true, striped: true,
//loadFilter: pagerFilter, //loadFilter: pagerFilter,
pageSize: 10, pageSize: 10,
pageList: [10,50,100], pageList: [10, 50, 100],
columns:[[ columns: [[
{ title: '名称',field: 'MaterialName',width:60}, {title: '名称', field: 'MaterialName', width: 60},
{ title: '型号',field: 'MaterialModel',width:80}, {title: '型号', field: 'MaterialModel', width: 80},
{ title: '扩展信息',field: 'MaterialOther',width:150}, {title: '扩展信息', field: 'MaterialOther', width: 150},
{ title: '单位',field: 'MaterialUnit',width:80}, {title: '单位', field: 'MaterialUnit', width: 80},
{ title: '进货数量',field: 'InSum',width:60}, {title: '进货数量', field: 'InSum', width: 60},
{ title: '进货金额',field: 'InSumPrice',width:60}, {title: '进货金额', field: 'InSumPrice', width: 60},
{ title: '退货数量',field: 'OutSum',width:60}, {title: '退货数量', field: 'OutSum', width: 60},
{ title: '退货金额',field: 'OutSumPrice',width:60} {title: '退货金额', field: 'OutSumPrice', width: 60}
]], ]],
onLoadError:function() onLoadError: function () {
{ $.messager.alert('页面加载提示', '页面加载异常,请稍后再试!', 'error');
$.messager.alert('页面加载提示','页面加载异常,请稍后再试!','error');
return; return;
} }
}); });
} }
//初始化键盘enter事件 //初始化键盘enter事件
$(document).keydown(function(event) $(document).keydown(function (event) {
{
//兼容 IE和firefox 事件 //兼容 IE和firefox 事件
var e = window.event || event; var e = window.event || event;
var k = e.keyCode||e.which||e.charCode; var k = e.keyCode || e.which || e.charCode;
//兼容 IE,firefox 兼容 //兼容 IE,firefox 兼容
var obj = e.srcElement ? e.srcElement : e.target; var obj = e.srcElement ? e.srcElement : e.target;
//绑定键盘事件为 id是指定的输入框才可以触发键盘事件 13键盘事件 ---遗留问题 enter键效验 对话框会关闭问题 //绑定键盘事件为 id是指定的输入框才可以触发键盘事件 13键盘事件 ---遗留问题 enter键效验 对话框会关闭问题
//搜索按钮添加快捷键 //搜索按钮添加快捷键
if(k == "13"&&(obj.id=="searchMonth")) if (k == "13" && (obj.id == "searchMonth")) {
{
$("#searchBtn").click(); $("#searchBtn").click();
} }
}); });
//分页信息处理 //分页信息处理
function ininPager() function ininPager() {
{ try {
try
{
var opts = $("#tableData").datagrid('options'); var opts = $("#tableData").datagrid('options');
var pager = $("#tableData").datagrid('getPager'); var pager = $("#tableData").datagrid('getPager');
pager.pagination({ pager.pagination({
onSelectPage:function(pageNum, pageSize) onSelectPage: function (pageNum, pageSize) {
{
opts.pageNumber = pageNum; opts.pageNumber = pageNum;
opts.pageSize = pageSize; opts.pageSize = pageSize;
pager.pagination('refresh', pager.pagination('refresh',
{ {
pageNumber:pageNum, pageNumber: pageNum,
pageSize:pageSize pageSize: pageSize
}); });
showDetails(pageNum,pageSize); showDetails(pageNum, pageSize);
} }
}); });
} }
catch (e) catch (e) {
{ $.messager.alert('异常处理提示', "分页信息异常 : " + e.name + ": " + e.message, 'error');
$.messager.alert('异常处理提示',"分页信息异常 : " + e.name + ": " + e.message,'error');
} }
} }
function search() { function search() {
showDetails(1,initPageSize); showDetails(1, initPageSize);
var opts = $("#tableData").datagrid('options'); var opts = $("#tableData").datagrid('options');
var pager = $("#tableData").datagrid('getPager'); var pager = $("#tableData").datagrid('getPager');
opts.pageNumber = 1; opts.pageNumber = 1;
opts.pageSize = initPageSize; opts.pageSize = initPageSize;
pager.pagination('refresh', { pager.pagination('refresh', {
pageNumber:1, pageNumber: 1,
pageSize:initPageSize pageSize: initPageSize
}); });
} }
//搜索处理 //搜索处理
$("#searchBtn").unbind().bind({ $("#searchBtn").unbind().bind({
click:function() click: function () {
{
search(); search();
} }
}); });
function showDetails(pageNo,pageSize) { function showDetails(pageNo, pageSize) {
$.ajax({ $.ajax({
type:"post", type: "post",
url: "<%=path %>/depotHead/findByMonth.action", url: "<%=path %>/depotHead/findByMonth.action",
dataType: "json", dataType: "json",
data: ({ data: ({
MonthTime:$("#searchMonth").val() MonthTime: $("#searchMonth").val()
}), }),
success: function (res) success: function (res) {
{
var HeadIds = res.HeadIds; var HeadIds = res.HeadIds;
if(HeadIds) { if (HeadIds) {
//获取排序后的产品ID //获取排序后的产品ID
$.ajax({ $.ajax({
type:"post", type: "post",
url: "<%=path %>/material/findByOrder.action", url: "<%=path %>/material/findByOrder.action",
dataType: "json", dataType: "json",
success: function (resNew) success: function (resNew) {
{
var MIds = resNew.mIds; var MIds = resNew.mIds;
if(MIds) { if (MIds) {
$.ajax({ $.ajax({
type:"post", type: "post",
url: "<%=path %>/depotItem/buyIn.action", url: "<%=path %>/depotItem/buyIn.action",
dataType: "json", dataType: "json",
data: ({ data: ({
pageNo:pageNo, pageNo: pageNo,
pageSize:pageSize, pageSize: pageSize,
MonthTime:$("#searchMonth").val(), MonthTime: $("#searchMonth").val(),
HeadIds:HeadIds, HeadIds: HeadIds,
MaterialIds:MIds, MaterialIds: MIds,
mpList: mPropertyList mpList: mPropertyList
}), }),
success: function (data) success: function (data) {
{ $("#tableData").datagrid('loadData', data);
$("#tableData").datagrid('loadData',data);
}, },
//此处添加错误处理 //此处添加错误处理
error:function() error: function () {
{ $.messager.alert('查询提示', '查询数据后台异常,请稍后再试!', 'error');
$.messager.alert('查询提示','查询数据后台异常,请稍后再试!','error');
return; return;
} }
}); });
} }
else { else {
$.messager.alert('查询提示','本月无数据!','error'); $.messager.alert('查询提示', '本月无数据!', 'error');
} }
}, },
//此处添加错误处理 //此处添加错误处理
error:function() error: function () {
{ $.messager.alert('查询提示', '查询数据后台异常,请稍后再试!', 'error');
$.messager.alert('查询提示','查询数据后台异常,请稍后再试!','error');
return; return;
} }
}); });
} }
else { else {
$.messager.alert('查询提示','本月无数据!','error'); $.messager.alert('查询提示', '本月无数据!', 'error');
} }
}, },
//此处添加错误处理 //此处添加错误处理
error:function() error: function () {
{ $.messager.alert('查询提示', '查询数据后台异常,请稍后再试!', 'error');
$.messager.alert('查询提示','查询数据后台异常,请稍后再试!','error');
return; return;
} }
}); });
} }
//报表打印 //报表打印
function print() { function print() {
$("#printBtn").off("click").on("click",function(){ $("#printBtn").off("click").on("click", function () {
var path = "<%=path %>"; var path = "<%=path %>";
CreateFormPage('打印报表', $('#tableData'), path); CreateFormPage('打印报表', $('#tableData'), path);
}); });
} }
</script> </script>
</body> </body>
</html> </html>

View File

@@ -1,22 +1,22 @@
<%@page import="com.jsh.util.Tools"%> <%@page import="com.jsh.util.Tools" %>
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%> <%@ page language="java" pageEncoding="utf-8" %>
<% <%
String path = request.getContextPath(); String path = request.getContextPath();
String clientIp = Tools.getLocalIp(request); String clientIp = Tools.getLocalIp(request);
%> %>
<!DOCTYPE html> <!DOCTYPE html>
<html> <html>
<head> <head>
<title>客户对账</title> <title>客户对账</title>
<meta charset="utf-8"> <meta charset="utf-8">
<!-- 指定以IE8的方式来渲染 --> <!-- 指定以IE8的方式来渲染 -->
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE8"/> <meta http-equiv="X-UA-Compatible" content="IE=EmulateIE8"/>
<link rel="shortcut icon" href="<%=path%>/images/favicon.ico" type="image/x-icon" /> <link rel="shortcut icon" href="<%=path%>/images/favicon.ico" type="image/x-icon"/>
<script type="text/javascript" src="<%=path %>/js/jquery-1.8.0.min.js"></script> <script type="text/javascript" src="<%=path %>/js/jquery-1.8.0.min.js"></script>
<script type="text/javascript" src="<%=path %>/js/print/print.js"></script> <script type="text/javascript" src="<%=path %>/js/print/print.js"></script>
<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/default/easyui.css"/>
<link rel="stylesheet" type="text/css" href="<%=path %>/js/easyui-1.3.5/themes/icon.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" /> <link type="text/css" rel="stylesheet" href="<%=path %>/css/common.css"/>
<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/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/locale/easyui-lang-zh_CN.js"></script>
<script type="text/javascript" src="<%=path %>/js/common/outlook_in.js"></script> <script type="text/javascript" src="<%=path %>/js/common/outlook_in.js"></script>
@@ -25,24 +25,27 @@
<script> <script>
var uid = ${sessionScope.user.id}; var uid = ${sessionScope.user.id};
</script> </script>
</head> </head>
<body> <body>
<!-- 查询 --> <!-- 查询 -->
<div id = "searchPanel" class="easyui-panel" style="padding:10px;" title="查询窗口" iconCls="icon-search" collapsible="true" closable="false"> <div id="searchPanel" class="easyui-panel" style="padding:10px;" title="查询窗口" iconCls="icon-search" collapsible="true"
closable="false">
<table id="searchTable"> <table id="searchTable">
<tr> <tr>
<td>客户:</td> <td>客户:</td>
<td> <td>
<input id="OrganId" name="OrganId" style="width:120px;" /> <input id="OrganId" name="OrganId" style="width:120px;"/>
</td> </td>
<td>&nbsp;</td> <td>&nbsp;</td>
<td>单据日期:</td> <td>单据日期:</td>
<td> <td>
<input type="text" name="searchBeginTime" id="searchBeginTime" onClick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'})" class="txt Wdate" style="width:140px;"/> <input type="text" name="searchBeginTime" id="searchBeginTime"
onClick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'})" class="txt Wdate" style="width:140px;"/>
</td> </td>
<td>-</td> <td>-</td>
<td> <td>
<input type="text" name="searchEndTime" id="searchEndTime" onClick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'})" class="txt Wdate" style="width:140px;"/> <input type="text" name="searchEndTime" id="searchEndTime"
onClick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'})" class="txt Wdate" style="width:140px;"/>
</td> </td>
<td>&nbsp;</td> <td>&nbsp;</td>
<td> <td>
@@ -57,19 +60,19 @@
</td> </td>
</tr> </tr>
</table> </table>
</div> </div>
<!-- 数据显示table --> <!-- 数据显示table -->
<div id = "tablePanel" class="easyui-panel" style="padding:1px;top:300px;" title="客户对账列表" iconCls="icon-list" collapsible="true" closable="false"> <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> <table id="tableData" style="top:300px;border-bottom-color:#FFFFFF"></table>
</div> </div>
<script type="text/javascript"> <script type="text/javascript">
var path = "<%=path %>"; var path = "<%=path %>";
var cusUrl = path + "/supplier/findBySelect_cus.action?UBType=UserCustomer&UBKeyId=" + uid; //客户接口 var cusUrl = path + "/supplier/findBySelect_cus.action?UBType=UserCustomer&UBKeyId=" + uid; //客户接口
//初始化界面 //初始化界面
$(function() $(function () {
{
var thisDate = getNowFormatMonth(); //当前月份 var thisDate = getNowFormatMonth(); //当前月份
var thisDateTime = getNowFormatDateTime(); //当前时间 var thisDateTime = getNowFormatDateTime(); //当前时间
$("#searchBeginTime").val(thisDate + "-01 00:00:00"); $("#searchBeginTime").val(thisDate + "-01 00:00:00");
@@ -83,99 +86,92 @@
//初始化客户 //初始化客户
function initSupplier(){ function initSupplier() {
$('#OrganId').combobox({ $('#OrganId').combobox({
url: cusUrl, url: cusUrl,
valueField:'id', valueField: 'id',
textField:'supplier', textField: 'supplier',
filter: function(q, row){ filter: function (q, row) {
var opts = $(this).combobox('options'); var opts = $(this).combobox('options');
return row[opts.textField].indexOf(q) >-1; return row[opts.textField].indexOf(q) > -1;
} }
}); });
} }
//初始化表格数据 //初始化表格数据
function initTableData() function initTableData() {
{
$('#tableData').datagrid({ $('#tableData').datagrid({
height:heightInfo, height: heightInfo,
nowrap: false, nowrap: false,
rownumbers: true, rownumbers: true,
//动画效果 //动画效果
animate:false, animate: false,
//选中单行 //选中单行
singleSelect : true, singleSelect: true,
pagination: true, pagination: true,
//交替出现背景 //交替出现背景
striped : true, striped: true,
pageSize: 10, pageSize: 10,
pageList: [10,50,100], pageList: [10, 50, 100],
columns:[[ columns: [[
{ title: '单据编号',field: 'number',width:140, {
title: '单据编号', field: 'number', width: 140,
formatter: function (value, row) { formatter: function (value, row) {
return "<a class='n-link' onclick=\"newTab('" + row.number + "','../materials/bill_detail.jsp?n=" + row.number + "&type=" + row.type + "','')\">" return "<a class='n-link' onclick=\"newTab('" + row.number + "','../materials/bill_detail.jsp?n=" + row.number + "&type=" + row.type + "','')\">"
+ row.number + "</a>"; + row.number + "</a>";
} }
}, },
{ title: '类型',field: 'type',width:100}, {title: '类型', field: 'type', width: 100},
{ title: '单位名称',field: 'supplierName',width:200}, {title: '单位名称', field: 'supplierName', width: 200},
{ title: '单据金额',field: 'discountLastMoney',width:80}, {title: '单据金额', field: 'discountLastMoney', width: 80},
{ title: '实际支付',field: 'changeAmount',width:80}, {title: '实际支付', field: 'changeAmount', width: 80},
{ title: '本期变化',field: 'allPrice',width:80}, {title: '本期变化', field: 'allPrice', width: 80},
{ title: '单据日期',field: 'operTime',width:140} {title: '单据日期', field: 'operTime', width: 140}
]], ]],
onLoadError:function() onLoadError: function () {
{ $.messager.alert('页面加载提示', '页面加载异常,请稍后再试!', 'error');
$.messager.alert('页面加载提示','页面加载异常,请稍后再试!','error');
return; return;
} }
}); });
} }
//初始化键盘enter事件 //初始化键盘enter事件
$(document).keydown(function(event) $(document).keydown(function (event) {
{
//兼容 IE和firefox 事件 //兼容 IE和firefox 事件
var e = window.event || event; var e = window.event || event;
var k = e.keyCode||e.which||e.charCode; var k = e.keyCode || e.which || e.charCode;
//兼容 IE,firefox 兼容 //兼容 IE,firefox 兼容
var obj = e.srcElement ? e.srcElement : e.target; var obj = e.srcElement ? e.srcElement : e.target;
//绑定键盘事件为 id是指定的输入框才可以触发键盘事件 13键盘事件 ---遗留问题 enter键效验 对话框会关闭问题 //绑定键盘事件为 id是指定的输入框才可以触发键盘事件 13键盘事件 ---遗留问题 enter键效验 对话框会关闭问题
if(k == "13"&&(obj.id=="Type"||obj.id=="Name")) if (k == "13" && (obj.id == "Type" || obj.id == "Name")) {
{
$("#savePerson").click(); $("#savePerson").click();
} }
//搜索按钮添加快捷键 //搜索按钮添加快捷键
if(k == "13"&&(obj.id=="searchType")) if (k == "13" && (obj.id == "searchType")) {
{
$("#searchBtn").click(); $("#searchBtn").click();
} }
}); });
//分页信息处理 //分页信息处理
function ininPager() function ininPager() {
{ try {
try
{
var opts = $("#tableData").datagrid('options'); var opts = $("#tableData").datagrid('options');
var pager = $("#tableData").datagrid('getPager'); var pager = $("#tableData").datagrid('getPager');
pager.pagination({ pager.pagination({
onSelectPage:function(pageNum, pageSize) onSelectPage: function (pageNum, pageSize) {
{
opts.pageNumber = pageNum; opts.pageNumber = pageNum;
opts.pageSize = pageSize; opts.pageSize = pageSize;
pager.pagination('refresh', pager.pagination('refresh',
{ {
pageNumber:pageNum, pageNumber: pageNum,
pageSize:pageSize pageSize: pageSize
}); });
showDetails(pageNum,pageSize); showDetails(pageNum, pageSize);
} }
}); });
} }
catch (e) catch (e) {
{ $.messager.alert('异常处理提示', "分页信息异常 : " + e.name + ": " + e.message, 'error');
$.messager.alert('异常处理提示',"分页信息异常 : " + e.name + ": " + e.message,'error');
} }
} }
@@ -187,107 +183,106 @@
//搜索处理 //搜索处理
function search() { function search() {
showDetails(1,initPageSize); showDetails(1, initPageSize);
var opts = $("#tableData").datagrid('options'); var opts = $("#tableData").datagrid('options');
var pager = $("#tableData").datagrid('getPager'); var pager = $("#tableData").datagrid('getPager');
opts.pageNumber = 1; opts.pageNumber = 1;
opts.pageSize = initPageSize; opts.pageSize = initPageSize;
pager.pagination('refresh', pager.pagination('refresh',
{ {
pageNumber:1, pageNumber: 1,
pageSize:initPageSize pageSize: initPageSize
}); });
} }
$("#searchBtn").unbind().bind({ $("#searchBtn").unbind().bind({
click:function() click: function () {
{
search(); search();
} }
}); });
function showDetails(pageNo,pageSize) function showDetails(pageNo, pageSize) {
{
$.ajax({ $.ajax({
type: "post", type: "post",
url: "<%=path %>/depotHead/findStatementAccount.action", url: "<%=path %>/depotHead/findStatementAccount.action",
dataType: "json", dataType: "json",
data: ({ data: ({
pageNo:pageNo, pageNo: pageNo,
pageSize:pageSize, pageSize: pageSize,
BeginTime: $("#searchBeginTime").val(), BeginTime: $("#searchBeginTime").val(),
EndTime: $("#searchEndTime").val(), EndTime: $("#searchEndTime").val(),
OrganId: $('#OrganId').combobox('getValue'), OrganId: $('#OrganId').combobox('getValue'),
supType: "客户" supType: "客户"
}), }),
success: function (res) { success: function (res) {
if(res){ if (res) {
$("#tableData").datagrid('loadData',res); $("#tableData").datagrid('loadData', res);
//如果选择了单位信息,就进行计算期初和期末 //如果选择了单位信息,就进行计算期初和期末
var supplierId = $('#OrganId').combobox('getValue'); var supplierId = $('#OrganId').combobox('getValue');
if(supplierId) { if (supplierId) {
//先查找期初信息 //先查找期初信息
var beginNeedGet = 0; var beginNeedGet = 0;
var beginNeedPay = 0; var beginNeedPay = 0;
$.ajax({ $.ajax({
type:"post", type: "post",
url: "<%=path %>/supplier/findById.action", url: "<%=path %>/supplier/findById.action",
dataType: "json", dataType: "json",
async: false, async: false,
data: ({ data: ({
supplierID: supplierId supplierID: supplierId
}), }),
success: function(res){ success: function (res) {
if(res && res.rows && res.rows[0]) { if (res && res.rows && res.rows[0]) {
if(res.rows[0].BeginNeedGet) { if (res.rows[0].BeginNeedGet) {
beginNeedGet = res.rows[0].BeginNeedGet; beginNeedGet = res.rows[0].BeginNeedGet;
} }
if(res.rows[0].BeginNeedPay) { if (res.rows[0].BeginNeedPay) {
beginNeedPay = res.rows[0].BeginNeedPay; beginNeedPay = res.rows[0].BeginNeedPay;
} }
//显示期初结存 //显示期初结存
var searchBeginTime = $("#searchBeginTime").val(); //开始时间 var searchBeginTime = $("#searchBeginTime").val(); //开始时间
$.ajax({ $.ajax({
type:"post", type: "post",
url: "<%=path %>/depotHead/findTotalPay.action", url: "<%=path %>/depotHead/findTotalPay.action",
dataType: "json", dataType: "json",
async: false, async: false,
data: ({ data: ({
supplierId: supplierId, supplierId: supplierId,
EndTime:searchBeginTime, EndTime: searchBeginTime,
supType: "customer" supType: "customer"
}), }),
success: function(res){ success: function (res) {
if(res) { if (res) {
var moneyA = res.getAllMoney.toFixed(2)-0; var moneyA = res.getAllMoney.toFixed(2) - 0;
$.ajax({ $.ajax({
type:"post", type: "post",
url: "<%=path %>/accountHead/findTotalPay.action", url: "<%=path %>/accountHead/findTotalPay.action",
dataType: "json", dataType: "json",
async: false, async: false,
data: ({ data: ({
supplierId: supplierId, supplierId: supplierId,
EndTime:searchBeginTime, EndTime: searchBeginTime,
supType: "customer" supType: "customer"
}), }),
success: function(res){ success: function (res) {
if(res) { if (res) {
var moneyB = res.getAllMoney.toFixed(2)-0; var moneyB = res.getAllMoney.toFixed(2) - 0;
var money = moneyA+moneyB; var money = moneyA + moneyB;
var moneyBeginNeedGet = beginNeedGet-0; //期初应收 var moneyBeginNeedGet = beginNeedGet - 0; //期初应收
var moneyBeginNeedPay = beginNeedPay-0; //期初应付 var moneyBeginNeedPay = beginNeedPay - 0; //期初应付
money = (money + moneyBeginNeedGet - moneyBeginNeedPay).toFixed(2); money = (money + moneyBeginNeedGet - moneyBeginNeedPay).toFixed(2);
$(".first-total").text(money); //期初结存 $(".first-total").text(money); //期初结存
} }
}, },
error: function(){ error: function () {
$.messager.alert('提示','网络异常请稍后再试!','error'); $.messager.alert('提示', '网络异常请稍后再试!', 'error');
return; return;
} }
}); });
} }
}, },
error: function(){ error: function () {
$.messager.alert('提示','网络异常请稍后再试!','error'); $.messager.alert('提示', '网络异常请稍后再试!', 'error');
return; return;
} }
}) })
@@ -295,54 +290,54 @@
//显示期末合计 //显示期末合计
var searchEndTime = $("#searchEndTime").val(); //结束时间 var searchEndTime = $("#searchEndTime").val(); //结束时间
$.ajax({ $.ajax({
type:"post", type: "post",
url: "<%=path %>/depotHead/findTotalPay.action", url: "<%=path %>/depotHead/findTotalPay.action",
dataType: "json", dataType: "json",
async: false, async: false,
data: ({ data: ({
supplierId: supplierId, supplierId: supplierId,
EndTime:searchEndTime, EndTime: searchEndTime,
supType: "customer" supType: "customer"
}), }),
success: function(res){ success: function (res) {
if(res) { if (res) {
var moneyA = res.getAllMoney.toFixed(2)-0; var moneyA = res.getAllMoney.toFixed(2) - 0;
$.ajax({ $.ajax({
type:"post", type: "post",
url: "<%=path %>/accountHead/findTotalPay.action", url: "<%=path %>/accountHead/findTotalPay.action",
dataType: "json", dataType: "json",
async: false, async: false,
data: ({ data: ({
supplierId: supplierId, supplierId: supplierId,
EndTime:searchEndTime, EndTime: searchEndTime,
supType: "customer" supType: "customer"
}), }),
success: function(res){ success: function (res) {
if(res) { if (res) {
var moneyB = res.getAllMoney.toFixed(2)-0; var moneyB = res.getAllMoney.toFixed(2) - 0;
var money = moneyA+moneyB; var money = moneyA + moneyB;
var moneyBeginNeedGet = beginNeedGet-0; //期初应收 var moneyBeginNeedGet = beginNeedGet - 0; //期初应收
var moneyBeginNeedPay = beginNeedPay-0; //期初应付 var moneyBeginNeedPay = beginNeedPay - 0; //期初应付
money = (money + moneyBeginNeedGet - moneyBeginNeedPay).toFixed(2); money = (money + moneyBeginNeedGet - moneyBeginNeedPay).toFixed(2);
$(".last-total").text(money); //期末合计 $(".last-total").text(money); //期末合计
} }
}, },
error: function(){ error: function () {
$.messager.alert('提示','网络异常请稍后再试!','error'); $.messager.alert('提示', '网络异常请稍后再试!', 'error');
return; return;
} }
}); });
} }
}, },
error: function(){ error: function () {
$.messager.alert('提示','网络异常请稍后再试!','error'); $.messager.alert('提示', '网络异常请稍后再试!', 'error');
return; return;
} }
}) })
} }
}, },
error: function(){ error: function () {
$.messager.alert('提示','网络异常请稍后再试!','error'); $.messager.alert('提示', '网络异常请稍后再试!', 'error');
return; return;
} }
}); });
@@ -350,19 +345,20 @@
} }
}, },
//此处添加错误处理 //此处添加错误处理
error:function() { error: function () {
$.messager.alert('查询提示','查询数据后台异常,请稍后再试!','error'); $.messager.alert('查询提示', '查询数据后台异常,请稍后再试!', 'error');
return; return;
} }
}); });
} }
//报表打印 //报表打印
function print() { function print() {
$("#printBtn").off("click").on("click",function(){ $("#printBtn").off("click").on("click", function () {
var path = "<%=path %>"; var path = "<%=path %>";
CreateFormPage('打印报表', $('#tableData'), path); CreateFormPage('打印报表', $('#tableData'), path);
}); });
} }
</script> </script>
</body> </body>
</html> </html>

View File

@@ -1,34 +1,35 @@
<%@page import="com.jsh.util.Tools"%> <%@page import="com.jsh.util.Tools" %>
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%> <%@ page language="java" pageEncoding="utf-8" %>
<% <%
String path = request.getContextPath(); String path = request.getContextPath();
String clientIp = Tools.getLocalIp(request); String clientIp = Tools.getLocalIp(request);
%> %>
<!DOCTYPE html> <!DOCTYPE html>
<html> <html>
<head> <head>
<title>礼品卡统计</title> <title>礼品卡统计</title>
<meta charset="utf-8"> <meta charset="utf-8">
<!-- 指定以IE8的方式来渲染 --> <!-- 指定以IE8的方式来渲染 -->
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE8"/> <meta http-equiv="X-UA-Compatible" content="IE=EmulateIE8"/>
<link rel="shortcut icon" href="<%=path%>/images/favicon.ico" type="image/x-icon" /> <link rel="shortcut icon" href="<%=path%>/images/favicon.ico" type="image/x-icon"/>
<script type="text/javascript" src="<%=path %>/js/jquery-1.8.0.min.js"></script> <script type="text/javascript" src="<%=path %>/js/jquery-1.8.0.min.js"></script>
<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/default/easyui.css"/>
<link rel="stylesheet" type="text/css" href="<%=path %>/js/easyui-1.3.5/themes/icon.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" /> <link type="text/css" rel="stylesheet" href="<%=path %>/css/common.css"/>
<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/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/locale/easyui-lang-zh_CN.js"></script>
<script type="text/javascript" src="<%=path %>/js/My97DatePicker/WdatePicker.js"></script> <script type="text/javascript" src="<%=path %>/js/My97DatePicker/WdatePicker.js"></script>
<script type="text/javascript" src="<%=path %>/js/common/common.js"></script> <script type="text/javascript" src="<%=path %>/js/common/common.js"></script>
</head> </head>
<body> <body>
<!-- 查询 --> <!-- 查询 -->
<div id = "searchPanel" class="easyui-panel" style="padding:10px;" title="查询窗口" iconCls="icon-search" collapsible="true" closable="false"> <div id="searchPanel" class="easyui-panel" style="padding:10px;" title="查询窗口" iconCls="icon-search" collapsible="true"
closable="false">
<table id="searchTable"> <table id="searchTable">
<tr> <tr>
<td>礼品卡:</td> <td>礼品卡:</td>
<td> <td>
<input id="searchGiftId" name="searchGiftId" style="width:110px;" /> <input id="searchGiftId" name="searchGiftId" style="width:110px;"/>
</td> </td>
<td>&nbsp;</td> <td>&nbsp;</td>
<td> <td>
@@ -36,19 +37,20 @@
</td> </td>
</tr> </tr>
</table> </table>
</div> </div>
<!-- 数据显示table --> <!-- 数据显示table -->
<div id = "tablePanel" class="easyui-panel" style="padding:1px;top:300px;" title="礼品卡统计列表" iconCls="icon-list" collapsible="true" closable="false"> <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> <table id="tableData" style="top:300px;border-bottom-color:#FFFFFF"></table>
</div> </div>
<script type="text/javascript"> <script type="text/javascript">
var mPropertyList = ""; //商品属性列表 var mPropertyList = ""; //商品属性列表
//初始化界面 //初始化界面
$(function(){ $(function () {
var userBusinessList=null; var userBusinessList = null;
var userdepot=null; var userdepot = null;
initGift(); initGift();
initMProperty(); //初始化商品属性 initMProperty(); //初始化商品属性
initTableData(); initTableData();
@@ -56,27 +58,27 @@
}); });
//初始化-礼品卡 //初始化-礼品卡
function initGift(){ function initGift() {
$('#searchGiftId').combobox({ $('#searchGiftId').combobox({
url: "<%=path %>/depot/findGiftByType.action?type=1", url: "<%=path %>/depot/findGiftByType.action?type=1",
valueField:'id', valueField: 'id',
textField:'name' textField: 'name'
}); });
//当会员卡号长度超过10位后自动点击下拉框用于兼容刷卡器 //当会员卡号长度超过10位后自动点击下拉框用于兼容刷卡器
$("#searchGiftId").next().find("input").off("keyup").on("keyup",function(){ $("#searchGiftId").next().find("input").off("keyup").on("keyup", function () {
var self = this; var self = this;
if($(this).val().length === 10){ if ($(this).val().length === 10) {
setTimeout(function(){ setTimeout(function () {
$(".combo-panel .combobox-item-selected").click(); $(".combo-panel .combobox-item-selected").click();
search(); search();
},500); }, 500);
} }
}); });
} }
//初始化商品属性 //初始化商品属性
function initMProperty(){ function initMProperty() {
$.ajax({ $.ajax({
type: "post", type: "post",
url: "<%=path %>/materialProperty/findBy.action", url: "<%=path %>/materialProperty/findBy.action",
@@ -84,179 +86,179 @@
success: function (res) { success: function (res) {
if (res && res.rows) { if (res && res.rows) {
var thisRows = res.rows; var thisRows = res.rows;
for(var i=0; i < thisRows.length; i++) { for (var i = 0; i < thisRows.length; i++) {
if(thisRows[i].enabled){ if (thisRows[i].enabled) {
mPropertyList += thisRows[i].nativeName +","; mPropertyList += thisRows[i].nativeName + ",";
} }
} }
if(mPropertyList){ if (mPropertyList) {
mPropertyList = mPropertyList.substring(0,mPropertyList.length-1); mPropertyList = mPropertyList.substring(0, mPropertyList.length - 1);
} }
} }
}, },
//此处添加错误处理 //此处添加错误处理
error:function() { error: function () {
$.messager.alert('查询提示','查询信息异常,请稍后再试!','error'); $.messager.alert('查询提示', '查询信息异常,请稍后再试!', 'error');
return; return;
} }
}); });
} }
//初始化表格数据 //初始化表格数据
function initTableData(){ function initTableData() {
$('#tableData').datagrid({ $('#tableData').datagrid({
height:heightInfo, height: heightInfo,
nowrap: false, nowrap: false,
rownumbers: true, rownumbers: true,
//动画效果 //动画效果
animate:false, animate: false,
//选中单行 //选中单行
singleSelect : true, singleSelect: true,
pagination: true, pagination: true,
//交替出现背景 //交替出现背景
striped : true, striped: true,
pageSize: 10, pageSize: 10,
pageList: [10,50,100], pageList: [10, 50, 100],
columns:[[ columns: [[
{ title: '名称',field: 'MaterialName',width:60}, {title: '名称', field: 'MaterialName', width: 60},
{ title: '型号',field: 'MaterialModel',width:80}, {title: '型号', field: 'MaterialModel', width: 80},
{ title: '扩展信息',field: 'MaterialOther',width:150}, {title: '扩展信息', field: 'MaterialOther', width: 150},
{ title: '单位',field: 'MaterialUnit',width:80}, {title: '单位', field: 'MaterialUnit', width: 80},
{ title: '结存数量',field: 'thisSum',width:80} {title: '结存数量', field: 'thisSum', width: 80}
]], ]],
onLoadError:function() { onLoadError: function () {
$.messager.alert('页面加载提示','页面加载异常,请稍后再试!','error'); $.messager.alert('页面加载提示', '页面加载异常,请稍后再试!', 'error');
return; return;
} }
}); });
} }
//初始化键盘enter事件 //初始化键盘enter事件
$(document).keydown(function(event) { $(document).keydown(function (event) {
//兼容 IE和firefox 事件 //兼容 IE和firefox 事件
var e = window.event || event; var e = window.event || event;
var k = e.keyCode||e.which||e.charCode; var k = e.keyCode || e.which || e.charCode;
//兼容 IE,firefox 兼容 //兼容 IE,firefox 兼容
var obj = e.srcElement ? e.srcElement : e.target; var obj = e.srcElement ? e.srcElement : e.target;
//绑定键盘事件为 id是指定的输入框才可以触发键盘事件 13键盘事件 ---遗留问题 enter键效验 对话框会关闭问题 //绑定键盘事件为 id是指定的输入框才可以触发键盘事件 13键盘事件 ---遗留问题 enter键效验 对话框会关闭问题
if(k == "13"&&(obj.id=="Type"||obj.id=="Name")) { if (k == "13" && (obj.id == "Type" || obj.id == "Name")) {
$("#savePerson").click(); $("#savePerson").click();
} }
//搜索按钮添加快捷键 //搜索按钮添加快捷键
if(k == "13"&&(obj.id=="searchType")) { if (k == "13" && (obj.id == "searchType")) {
$("#searchBtn").click(); $("#searchBtn").click();
} }
}); });
//分页信息处理 //分页信息处理
function ininPager() { function ininPager() {
try { try {
var opts = $("#tableData").datagrid('options'); var opts = $("#tableData").datagrid('options');
var pager = $("#tableData").datagrid('getPager'); var pager = $("#tableData").datagrid('getPager');
pager.pagination({ pager.pagination({
onSelectPage:function(pageNum, pageSize) onSelectPage: function (pageNum, pageSize) {
{
opts.pageNumber = pageNum; opts.pageNumber = pageNum;
opts.pageSize = pageSize; opts.pageSize = pageSize;
pager.pagination('refresh', pager.pagination('refresh',
{ {
pageNumber:pageNum, pageNumber: pageNum,
pageSize:pageSize pageSize: pageSize
}); });
showPersonDetails(pageNum,pageSize); showPersonDetails(pageNum, pageSize);
} }
}); });
} }
catch (e) catch (e) {
{ $.messager.alert('异常处理提示', "分页信息异常 : " + e.name + ": " + e.message, 'error');
$.messager.alert('异常处理提示',"分页信息异常 : " + e.name + ": " + e.message,'error');
} }
} }
//搜索处理 //搜索处理
function search() { function search() {
showPersonDetails(1,initPageSize); showPersonDetails(1, initPageSize);
var opts = $("#tableData").datagrid('options'); var opts = $("#tableData").datagrid('options');
var pager = $("#tableData").datagrid('getPager'); var pager = $("#tableData").datagrid('getPager');
opts.pageNumber = 1; opts.pageNumber = 1;
opts.pageSize = initPageSize; opts.pageSize = initPageSize;
pager.pagination('refresh', { pager.pagination('refresh', {
pageNumber:1, pageNumber: 1,
pageSize:initPageSize pageSize: initPageSize
}); });
} }
$("#searchBtn").unbind().bind({ $("#searchBtn").unbind().bind({
click:function() { click: function () {
var giftId = $('#searchGiftId').combobox('getValue'); //礼品卡Id var giftId = $('#searchGiftId').combobox('getValue'); //礼品卡Id
if(giftId) { if (giftId) {
search(); search();
} }
else { else {
$.messager.alert('查询提示','请选择一张礼品卡!','warning'); $.messager.alert('查询提示', '请选择一张礼品卡!', 'warning');
} }
} }
}); });
function showPersonDetails(pageNo,pageSize) { function showPersonDetails(pageNo, pageSize) {
var searchGiftId = $("#searchGiftId").combobox("getValue"); var searchGiftId = $("#searchGiftId").combobox("getValue");
$.ajax({ $.ajax({
type:"post", type: "post",
url: "<%=path %>/depotHead/findGiftReport.action", url: "<%=path %>/depotHead/findGiftReport.action",
dataType: "json", dataType: "json",
success: function (res) { success: function (res) {
var HeadIds = res.HeadIds; var HeadIds = res.HeadIds;
if(HeadIds) { if (HeadIds) {
//获取排序后的产品ID //获取排序后的产品ID
$.ajax({ $.ajax({
type:"post", type: "post",
url: "<%=path %>/material/findByOrder.action", url: "<%=path %>/material/findByOrder.action",
dataType: "json", dataType: "json",
success: function (resNew) { success: function (resNew) {
var MIds = resNew.mIds; var MIds = resNew.mIds;
if(MIds) { if (MIds) {
$.ajax({ $.ajax({
type:"post", type: "post",
url: "<%=path %>/depotItem/findGiftByAll.action", url: "<%=path %>/depotItem/findGiftByAll.action",
dataType: "json", dataType: "json",
data: ({ data: ({
pageNo:pageNo, pageNo: pageNo,
pageSize:pageSize, pageSize: pageSize,
ProjectId: searchGiftId, ProjectId: searchGiftId,
HeadIds: HeadIds, HeadIds: HeadIds,
MaterialIds: MIds, MaterialIds: MIds,
mpList: mPropertyList mpList: mPropertyList
}), }),
success: function (data) { success: function (data) {
$("#tableData").datagrid('loadData',data); $("#tableData").datagrid('loadData', data);
}, },
//此处添加错误处理 //此处添加错误处理
error:function() { error: function () {
$.messager.alert('查询提示','查询数据后台异常,请稍后再试!','error'); $.messager.alert('查询提示', '查询数据后台异常,请稍后再试!', 'error');
return; return;
} }
}); });
} }
else { else {
$.messager.alert('查询提示','查询数据后台异常,请稍后再试!','error'); $.messager.alert('查询提示', '查询数据后台异常,请稍后再试!', 'error');
} }
}, },
//此处添加错误处理 //此处添加错误处理
error:function() { error: function () {
$.messager.alert('查询提示','查询数据后台异常,请稍后再试!','error'); $.messager.alert('查询提示', '查询数据后台异常,请稍后再试!', 'error');
return; return;
} }
}); });
} }
else { else {
$.messager.alert('查询提示','该礼品卡无数据!','warning'); $.messager.alert('查询提示', '该礼品卡无数据!', 'warning');
} }
}, },
//此处添加错误处理 //此处添加错误处理
error:function() { error: function () {
$.messager.alert('查询提示','查询数据后台异常,请稍后再试!','error'); $.messager.alert('查询提示', '查询数据后台异常,请稍后再试!', 'error');
return; return;
} }
}); });
} }
</script> </script>
</body> </body>
</html> </html>

View File

@@ -1,22 +1,22 @@
<%@page import="com.jsh.util.Tools"%> <%@page import="com.jsh.util.Tools" %>
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%> <%@ page language="java" pageEncoding="utf-8" %>
<% <%
String path = request.getContextPath(); String path = request.getContextPath();
String clientIp = Tools.getLocalIp(request); String clientIp = Tools.getLocalIp(request);
%> %>
<!DOCTYPE html> <!DOCTYPE html>
<html> <html>
<head> <head>
<title>入库明细</title> <title>入库明细</title>
<meta charset="utf-8"> <meta charset="utf-8">
<!-- 指定以IE8的方式来渲染 --> <!-- 指定以IE8的方式来渲染 -->
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE8"/> <meta http-equiv="X-UA-Compatible" content="IE=EmulateIE8"/>
<link rel="shortcut icon" href="<%=path%>/images/favicon.ico" type="image/x-icon" /> <link rel="shortcut icon" href="<%=path%>/images/favicon.ico" type="image/x-icon"/>
<script type="text/javascript" src="<%=path %>/js/jquery-1.8.0.min.js"></script> <script type="text/javascript" src="<%=path %>/js/jquery-1.8.0.min.js"></script>
<script type="text/javascript" src="<%=path %>/js/print/print.js"></script> <script type="text/javascript" src="<%=path %>/js/print/print.js"></script>
<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/default/easyui.css"/>
<link rel="stylesheet" type="text/css" href="<%=path %>/js/easyui-1.3.5/themes/icon.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" /> <link type="text/css" rel="stylesheet" href="<%=path %>/css/common.css"/>
<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/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/locale/easyui-lang-zh_CN.js"></script>
<script type="text/javascript" src="<%=path %>/js/common/outlook_in.js"></script> <script type="text/javascript" src="<%=path %>/js/common/outlook_in.js"></script>
@@ -25,15 +25,16 @@
<script> <script>
var uid = ${sessionScope.user.id}; var uid = ${sessionScope.user.id};
</script> </script>
</head> </head>
<body> <body>
<!-- 查询 --> <!-- 查询 -->
<div id = "searchPanel" class="easyui-panel" style="padding:10px;" title="查询窗口" iconCls="icon-search" collapsible="true" closable="false"> <div id="searchPanel" class="easyui-panel" style="padding:10px;" title="查询窗口" iconCls="icon-search" collapsible="true"
closable="false">
<table id="searchTable"> <table id="searchTable">
<tr> <tr>
<td>供应商:</td> <td>供应商:</td>
<td> <td>
<input id="OrganId" name="OrganId" style="width:120px;" /> <input id="OrganId" name="OrganId" style="width:120px;"/>
</td> </td>
<td>&nbsp;</td> <td>&nbsp;</td>
<td>仓库:</td> <td>仓库:</td>
@@ -43,11 +44,13 @@
<td>&nbsp;</td> <td>&nbsp;</td>
<td>单据日期:</td> <td>单据日期:</td>
<td> <td>
<input type="text" name="searchBeginTime" id="searchBeginTime" onClick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'})" class="txt Wdate" style="width:140px;"/> <input type="text" name="searchBeginTime" id="searchBeginTime"
onClick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'})" class="txt Wdate" style="width:140px;"/>
</td> </td>
<td>-</td> <td>-</td>
<td> <td>
<input type="text" name="searchEndTime" id="searchEndTime" onClick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'})" class="txt Wdate" style="width:140px;"/> <input type="text" name="searchEndTime" id="searchEndTime"
onClick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'})" class="txt Wdate" style="width:140px;"/>
</td> </td>
<td>&nbsp;</td> <td>&nbsp;</td>
<td> <td>
@@ -57,28 +60,28 @@
</td> </td>
</tr> </tr>
</table> </table>
</div> </div>
<!-- 数据显示table --> <!-- 数据显示table -->
<div id = "tablePanel" class="easyui-panel" style="padding:1px;top:300px;" title="入库明细列表" iconCls="icon-list" collapsible="true" closable="false"> <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> <table id="tableData" style="top:300px;border-bottom-color:#FFFFFF"></table>
</div> </div>
<script type="text/javascript"> <script type="text/javascript">
var depotList = null; var depotList = null;
var depotID = null; var depotID = null;
var depotString = ""; //仓库列表 var depotString = ""; //仓库列表
var path = "<%=path %>"; var path = "<%=path %>";
var supUrl = path + "/supplier/findBySelect_sup.action"; //供应商接口 var supUrl = path + "/supplier/findBySelect_sup.action"; //供应商接口
//初始化界面 //初始化界面
$(function() $(function () {
{
var thisDate = getNowFormatMonth(); //当前月份 var thisDate = getNowFormatMonth(); //当前月份
var thisDateTime = getNowFormatDateTime(); //当前时间 var thisDateTime = getNowFormatDateTime(); //当前时间
$("#searchBeginTime").val(thisDate + "-01 00:00:00"); $("#searchBeginTime").val(thisDate + "-01 00:00:00");
$("#searchEndTime").val(thisDateTime); $("#searchEndTime").val(thisDateTime);
var userBusinessList=null; var userBusinessList = null;
var userdepot=null; var userdepot = null;
initSupplier(); //初始化供应商信息 initSupplier(); //初始化供应商信息
initSystemData_UB(); initSystemData_UB();
initSelectInfo_UB(); initSelectInfo_UB();
@@ -91,192 +94,175 @@
}); });
//初始化供应商 //初始化供应商
function initSupplier(){ function initSupplier() {
$('#OrganId').combobox({ $('#OrganId').combobox({
url: supUrl, url: supUrl,
valueField:'id', valueField: 'id',
textField:'supplier', textField: 'supplier',
filter: function(q, row){ filter: function (q, row) {
var opts = $(this).combobox('options'); var opts = $(this).combobox('options');
return row[opts.textField].indexOf(q) >-1; return row[opts.textField].indexOf(q) > -1;
} }
}); });
} }
//初始化系统基础信息 //初始化系统基础信息
function initSystemData_UB(){ function initSystemData_UB() {
$.ajax({ $.ajax({
type:"post", type: "post",
url: "<%=path %>/userBusiness/getBasicData.action", url: "<%=path %>/userBusiness/getBasicData.action",
data: ({ data: ({
KeyId: uid, KeyId: uid,
Type:"UserDepot" Type: "UserDepot"
}), }),
//设置为同步 //设置为同步
async:false, async: false,
dataType: "json", dataType: "json",
success: function (systemInfo) success: function (systemInfo) {
{ if (systemInfo) {
if(systemInfo)
{
userBusinessList = systemInfo.showModel.map.userBusinessList; userBusinessList = systemInfo.showModel.map.userBusinessList;
var msgTip = systemInfo.showModel.msgTip; var msgTip = systemInfo.showModel.msgTip;
if(msgTip == "exceptoin") if (msgTip == "exceptoin") {
{ $.messager.alert('提示', '查找UserBusiness异常,请与管理员联系!', 'error');
$.messager.alert('提示','查找UserBusiness异常,请与管理员联系!','error');
return; return;
} }
} }
else else {
{ userBusinessList = null;
userBusinessList=null;
} }
} }
}); });
} }
//初始化页面选项卡
function initSelectInfo_UB(){
if(userBusinessList !=null) //初始化页面选项卡
{ function initSelectInfo_UB() {
if(userBusinessList.length>0)
{ if (userBusinessList != null) {
if (userBusinessList.length > 0) {
//用户对应的仓库列表 [1][2][3]... //用户对应的仓库列表 [1][2][3]...
userdepot =userBusinessList[0].value; userdepot = userBusinessList[0].value;
} }
} }
} }
//初始化系统基础信息 //初始化系统基础信息
function initSystemData_depot(){ function initSystemData_depot() {
$.ajax({ $.ajax({
type:"post", type: "post",
url: "<%=path %>/depot/getBasicData.action", url: "<%=path %>/depot/getBasicData.action",
//设置为同步 //设置为同步
async:false, async: false,
dataType: "json", dataType: "json",
success: function (systemInfo) success: function (systemInfo) {
{
depotList = systemInfo.showModel.map.depotList; depotList = systemInfo.showModel.map.depotList;
var msgTip = systemInfo.showModel.msgTip; var msgTip = systemInfo.showModel.msgTip;
if(msgTip == "exceptoin") if (msgTip == "exceptoin") {
{ $.messager.alert('提示', '查找系统基础信息异常,请与管理员联系!', 'error');
$.messager.alert('提示','查找系统基础信息异常,请与管理员联系!','error');
return; return;
} }
} }
}); });
} }
//初始化页面选项卡 //初始化页面选项卡
function initSelectInfo_depot(){ function initSelectInfo_depot() {
var options = ""; var options = "";
if(depotList !=null) if (depotList != null) {
{
options = ""; options = "";
for(var i = 0 ;i < depotList.length;i++) for (var i = 0; i < depotList.length; i++) {
{
var depot = depotList[i]; var depot = depotList[i];
if(userdepot!=null) if (userdepot != null) {
{ if (userdepot.indexOf("[" + depot.id + "]") != -1) {
if(userdepot.indexOf("["+depot.id+"]")!=-1)
{
options += '<option value="' + depot.id + '">' + depot.name + '</option>'; options += '<option value="' + depot.id + '">' + depot.name + '</option>';
depotString = depotString + depot.id + ","; depotString = depotString + depot.id + ",";
} }
} }
} }
depotString = depotString.substring(0, depotString.length-1); depotString = depotString.substring(0, depotString.length - 1);
$("#searchProjectId").empty().append('<option value="">全部</option>').append(options); $("#searchProjectId").empty().append('<option value="">全部</option>').append(options);
} }
} }
//初始化表格数据 //初始化表格数据
function initTableData() function initTableData() {
{
$('#tableData').datagrid({ $('#tableData').datagrid({
height:heightInfo, height: heightInfo,
nowrap: false, nowrap: false,
rownumbers: true, rownumbers: true,
//动画效果 //动画效果
animate:false, animate: false,
//选中单行 //选中单行
singleSelect : true, singleSelect: true,
pagination: true, pagination: true,
//交替出现背景 //交替出现背景
striped : true, striped: true,
pageSize: 10, pageSize: 10,
pageList: [10,50,100], pageList: [10, 50, 100],
columns:[[ columns: [[
{ title: '单据编号',field: 'number',width:140, {
title: '单据编号', field: 'number', width: 140,
formatter: function (value, row) { formatter: function (value, row) {
return "<a class='n-link' onclick=\"newTab('" + row.number + "','../materials/bill_detail.jsp?n=" + row.number + "&type=" + row.type + "','')\">" return "<a class='n-link' onclick=\"newTab('" + row.number + "','../materials/bill_detail.jsp?n=" + row.number + "&type=" + row.type + "','')\">"
+ row.number + "</a>"; + row.number + "</a>";
} }
}, },
{ title: '商品名称',field: 'materialName',width:120}, {title: '商品名称', field: 'materialName', width: 120},
{ title: '商品型号',field: 'materialModel',width:100}, {title: '商品型号', field: 'materialModel', width: 100},
{ title: '单价',field: 'unitPrice',width:60}, {title: '单价', field: 'unitPrice', width: 60},
{ title: '入库数量',field: 'operNumber',width:60}, {title: '入库数量', field: 'operNumber', width: 60},
{ title: '金额',field: 'allPrice',width:60}, {title: '金额', field: 'allPrice', width: 60},
{ title: '供应商',field: 'supplierName',width:200}, {title: '供应商', field: 'supplierName', width: 200},
{ title: '仓库',field: 'depotName',width:120}, {title: '仓库', field: 'depotName', width: 120},
{ title: '入库日期',field: 'operTime',width:80}, {title: '入库日期', field: 'operTime', width: 80},
]], ]],
onLoadError:function() onLoadError: function () {
{ $.messager.alert('页面加载提示', '页面加载异常,请稍后再试!', 'error');
$.messager.alert('页面加载提示','页面加载异常,请稍后再试!','error');
return; return;
} }
}); });
} }
//初始化键盘enter事件 //初始化键盘enter事件
$(document).keydown(function(event) $(document).keydown(function (event) {
{
//兼容 IE和firefox 事件 //兼容 IE和firefox 事件
var e = window.event || event; var e = window.event || event;
var k = e.keyCode||e.which||e.charCode; var k = e.keyCode || e.which || e.charCode;
//兼容 IE,firefox 兼容 //兼容 IE,firefox 兼容
var obj = e.srcElement ? e.srcElement : e.target; var obj = e.srcElement ? e.srcElement : e.target;
//绑定键盘事件为 id是指定的输入框才可以触发键盘事件 13键盘事件 ---遗留问题 enter键效验 对话框会关闭问题 //绑定键盘事件为 id是指定的输入框才可以触发键盘事件 13键盘事件 ---遗留问题 enter键效验 对话框会关闭问题
if(k == "13"&&(obj.id=="Type"||obj.id=="Name")) if (k == "13" && (obj.id == "Type" || obj.id == "Name")) {
{
$("#savePerson").click(); $("#savePerson").click();
} }
//搜索按钮添加快捷键 //搜索按钮添加快捷键
if(k == "13"&&(obj.id=="searchType")) if (k == "13" && (obj.id == "searchType")) {
{
$("#searchBtn").click(); $("#searchBtn").click();
} }
}); });
//分页信息处理 //分页信息处理
function ininPager() function ininPager() {
{ try {
try
{
var opts = $("#tableData").datagrid('options'); var opts = $("#tableData").datagrid('options');
var pager = $("#tableData").datagrid('getPager'); var pager = $("#tableData").datagrid('getPager');
pager.pagination({ pager.pagination({
onSelectPage:function(pageNum, pageSize) onSelectPage: function (pageNum, pageSize) {
{
opts.pageNumber = pageNum; opts.pageNumber = pageNum;
opts.pageSize = pageSize; opts.pageSize = pageSize;
pager.pagination('refresh', pager.pagination('refresh',
{ {
pageNumber:pageNum, pageNumber: pageNum,
pageSize:pageSize pageSize: pageSize
}); });
showDetails(pageNum,pageSize); showDetails(pageNum, pageSize);
} }
}); });
} }
catch (e) catch (e) {
{ $.messager.alert('异常处理提示', "分页信息异常 : " + e.name + ": " + e.message, 'error');
$.messager.alert('异常处理提示',"分页信息异常 : " + e.name + ": " + e.message,'error');
} }
} }
@@ -288,33 +274,32 @@
//搜索处理 //搜索处理
function search() { function search() {
showDetails(1,initPageSize); showDetails(1, initPageSize);
var opts = $("#tableData").datagrid('options'); var opts = $("#tableData").datagrid('options');
var pager = $("#tableData").datagrid('getPager'); var pager = $("#tableData").datagrid('getPager');
opts.pageNumber = 1; opts.pageNumber = 1;
opts.pageSize = initPageSize; opts.pageSize = initPageSize;
pager.pagination('refresh', pager.pagination('refresh',
{ {
pageNumber:1, pageNumber: 1,
pageSize:initPageSize pageSize: initPageSize
}); });
} }
$("#searchBtn").unbind().bind({ $("#searchBtn").unbind().bind({
click:function() click: function () {
{
search(); search();
} }
}); });
function showDetails(pageNo,pageSize) function showDetails(pageNo, pageSize) {
{
$.ajax({ $.ajax({
type: "post", type: "post",
url: "<%=path %>/depotHead/findInDetail.action", url: "<%=path %>/depotHead/findInDetail.action",
dataType: "json", dataType: "json",
data: ({ data: ({
pageNo:pageNo, pageNo: pageNo,
pageSize:pageSize, pageSize: pageSize,
OrganId: $('#OrganId').combobox('getValue'), OrganId: $('#OrganId').combobox('getValue'),
ProjectId: $.trim($("#searchProjectId").val()), ProjectId: $.trim($("#searchProjectId").val()),
DepotIds: depotString, DepotIds: depotString,
@@ -323,24 +308,25 @@
Type: "入库" Type: "入库"
}), }),
success: function (res) { success: function (res) {
if(res){ if (res) {
$("#tableData").datagrid('loadData',res); $("#tableData").datagrid('loadData', res);
} }
}, },
//此处添加错误处理 //此处添加错误处理
error:function() { error: function () {
$.messager.alert('查询提示','查询数据后台异常,请稍后再试!','error'); $.messager.alert('查询提示', '查询数据后台异常,请稍后再试!', 'error');
return; return;
} }
}); });
} }
//报表打印 //报表打印
function print() { function print() {
$("#printBtn").off("click").on("click",function(){ $("#printBtn").off("click").on("click", function () {
var path = "<%=path %>"; var path = "<%=path %>";
CreateFormPage('打印报表', $('#tableData'), path); CreateFormPage('打印报表', $('#tableData'), path);
}); });
} }
</script> </script>
</body> </body>
</html> </html>

View File

@@ -1,22 +1,22 @@
<%@page import="com.jsh.util.Tools"%> <%@page import="com.jsh.util.Tools" %>
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%> <%@ page language="java" pageEncoding="utf-8" %>
<% <%
String path = request.getContextPath(); String path = request.getContextPath();
String clientIp = Tools.getLocalIp(request); String clientIp = Tools.getLocalIp(request);
%> %>
<!DOCTYPE html> <!DOCTYPE html>
<html> <html>
<head> <head>
<title>入库汇总</title> <title>入库汇总</title>
<meta charset="utf-8"> <meta charset="utf-8">
<!-- 指定以IE8的方式来渲染 --> <!-- 指定以IE8的方式来渲染 -->
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE8"/> <meta http-equiv="X-UA-Compatible" content="IE=EmulateIE8"/>
<link rel="shortcut icon" href="<%=path%>/images/favicon.ico" type="image/x-icon" /> <link rel="shortcut icon" href="<%=path%>/images/favicon.ico" type="image/x-icon"/>
<script type="text/javascript" src="<%=path %>/js/jquery-1.8.0.min.js"></script> <script type="text/javascript" src="<%=path %>/js/jquery-1.8.0.min.js"></script>
<script type="text/javascript" src="<%=path %>/js/print/print.js"></script> <script type="text/javascript" src="<%=path %>/js/print/print.js"></script>
<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/default/easyui.css"/>
<link rel="stylesheet" type="text/css" href="<%=path %>/js/easyui-1.3.5/themes/icon.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" /> <link type="text/css" rel="stylesheet" href="<%=path %>/css/common.css"/>
<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/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/locale/easyui-lang-zh_CN.js"></script>
<script type="text/javascript" src="<%=path %>/js/My97DatePicker/WdatePicker.js"></script> <script type="text/javascript" src="<%=path %>/js/My97DatePicker/WdatePicker.js"></script>
@@ -24,15 +24,16 @@
<script> <script>
var kid = ${sessionScope.user.id}; var kid = ${sessionScope.user.id};
</script> </script>
</head> </head>
<body> <body>
<!-- 查询 --> <!-- 查询 -->
<div id = "searchPanel" class="easyui-panel" style="padding:10px;" title="查询窗口" iconCls="icon-search" collapsible="true" closable="false"> <div id="searchPanel" class="easyui-panel" style="padding:10px;" title="查询窗口" iconCls="icon-search" collapsible="true"
closable="false">
<table id="searchTable"> <table id="searchTable">
<tr> <tr>
<td>供应商:</td> <td>供应商:</td>
<td> <td>
<input id="OrganId" name="OrganId" style="width:120px;" /> <input id="OrganId" name="OrganId" style="width:120px;"/>
</td> </td>
<td>&nbsp;</td> <td>&nbsp;</td>
<td>仓库:</td> <td>仓库:</td>
@@ -42,11 +43,13 @@
<td>&nbsp;</td> <td>&nbsp;</td>
<td>单据日期:</td> <td>单据日期:</td>
<td> <td>
<input type="text" name="searchBeginTime" id="searchBeginTime" onClick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'})" class="txt Wdate" style="width:140px;"/> <input type="text" name="searchBeginTime" id="searchBeginTime"
onClick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'})" class="txt Wdate" style="width:140px;"/>
</td> </td>
<td>-</td> <td>-</td>
<td> <td>
<input type="text" name="searchEndTime" id="searchEndTime" onClick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'})" class="txt Wdate" style="width:140px;"/> <input type="text" name="searchEndTime" id="searchEndTime"
onClick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'})" class="txt Wdate" style="width:140px;"/>
</td> </td>
<td>&nbsp;</td> <td>&nbsp;</td>
<td> <td>
@@ -56,28 +59,28 @@
</td> </td>
</tr> </tr>
</table> </table>
</div> </div>
<!-- 数据显示table --> <!-- 数据显示table -->
<div id = "tablePanel" class="easyui-panel" style="padding:1px;top:300px;" title="入库汇总列表" iconCls="icon-list" collapsible="true" closable="false"> <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> <table id="tableData" style="top:300px;border-bottom-color:#FFFFFF"></table>
</div> </div>
<script type="text/javascript"> <script type="text/javascript">
var depotList = null; var depotList = null;
var depotID = null; var depotID = null;
var depotString = ""; //仓库列表 var depotString = ""; //仓库列表
var path = "<%=path %>"; var path = "<%=path %>";
var supUrl = path + "/supplier/findBySelect_sup.action"; //供应商接口 var supUrl = path + "/supplier/findBySelect_sup.action"; //供应商接口
//初始化界面 //初始化界面
$(function() $(function () {
{
var thisDate = getNowFormatMonth(); //当前月份 var thisDate = getNowFormatMonth(); //当前月份
var thisDateTime = getNowFormatDateTime(); //当前时间 var thisDateTime = getNowFormatDateTime(); //当前时间
$("#searchBeginTime").val(thisDate + "-01 00:00:00"); $("#searchBeginTime").val(thisDate + "-01 00:00:00");
$("#searchEndTime").val(thisDateTime); $("#searchEndTime").val(thisDateTime);
var userBusinessList=null; var userBusinessList = null;
var userdepot=null; var userdepot = null;
initSupplier(); //初始化供应商信息 initSupplier(); //初始化供应商信息
initSystemData_UB(); initSystemData_UB();
initSelectInfo_UB(); initSelectInfo_UB();
@@ -90,183 +93,165 @@
}); });
//初始化供应商 //初始化供应商
function initSupplier(){ function initSupplier() {
$('#OrganId').combobox({ $('#OrganId').combobox({
url: supUrl, url: supUrl,
valueField:'id', valueField: 'id',
textField:'supplier', textField: 'supplier',
filter: function(q, row){ filter: function (q, row) {
var opts = $(this).combobox('options'); var opts = $(this).combobox('options');
return row[opts.textField].indexOf(q) >-1; return row[opts.textField].indexOf(q) > -1;
} }
}); });
} }
//初始化系统基础信息 //初始化系统基础信息
function initSystemData_UB(){ function initSystemData_UB() {
$.ajax({ $.ajax({
type:"post", type: "post",
url: "<%=path %>/userBusiness/getBasicData.action", url: "<%=path %>/userBusiness/getBasicData.action",
data: ({ data: ({
KeyId:kid, KeyId: kid,
Type:"UserDepot" Type: "UserDepot"
}), }),
//设置为同步 //设置为同步
async:false, async: false,
dataType: "json", dataType: "json",
success: function (systemInfo) success: function (systemInfo) {
{ if (systemInfo) {
if(systemInfo)
{
userBusinessList = systemInfo.showModel.map.userBusinessList; userBusinessList = systemInfo.showModel.map.userBusinessList;
var msgTip = systemInfo.showModel.msgTip; var msgTip = systemInfo.showModel.msgTip;
if(msgTip == "exceptoin") if (msgTip == "exceptoin") {
{ $.messager.alert('提示', '查找UserBusiness异常,请与管理员联系!', 'error');
$.messager.alert('提示','查找UserBusiness异常,请与管理员联系!','error');
return; return;
} }
} }
else else {
{ userBusinessList = null;
userBusinessList=null;
} }
} }
}); });
} }
//初始化页面选项卡
function initSelectInfo_UB(){
if(userBusinessList !=null) //初始化页面选项卡
{ function initSelectInfo_UB() {
if(userBusinessList.length>0)
{ if (userBusinessList != null) {
if (userBusinessList.length > 0) {
//用户对应的仓库列表 [1][2][3]... //用户对应的仓库列表 [1][2][3]...
userdepot =userBusinessList[0].value; userdepot = userBusinessList[0].value;
} }
} }
} }
//初始化系统基础信息 //初始化系统基础信息
function initSystemData_depot(){ function initSystemData_depot() {
$.ajax({ $.ajax({
type:"post", type: "post",
url: "<%=path %>/depot/getBasicData.action", url: "<%=path %>/depot/getBasicData.action",
//设置为同步 //设置为同步
async:false, async: false,
dataType: "json", dataType: "json",
success: function (systemInfo) success: function (systemInfo) {
{
depotList = systemInfo.showModel.map.depotList; depotList = systemInfo.showModel.map.depotList;
var msgTip = systemInfo.showModel.msgTip; var msgTip = systemInfo.showModel.msgTip;
if(msgTip == "exceptoin") if (msgTip == "exceptoin") {
{ $.messager.alert('提示', '查找系统基础信息异常,请与管理员联系!', 'error');
$.messager.alert('提示','查找系统基础信息异常,请与管理员联系!','error');
return; return;
} }
} }
}); });
} }
//初始化页面选项卡 //初始化页面选项卡
function initSelectInfo_depot(){ function initSelectInfo_depot() {
var options = ""; var options = "";
if(depotList !=null) if (depotList != null) {
{
options = ""; options = "";
for(var i = 0 ;i < depotList.length;i++) for (var i = 0; i < depotList.length; i++) {
{
var depot = depotList[i]; var depot = depotList[i];
if(userdepot!=null) if (userdepot != null) {
{ if (userdepot.indexOf("[" + depot.id + "]") != -1) {
if(userdepot.indexOf("["+depot.id+"]")!=-1)
{
options += '<option value="' + depot.id + '">' + depot.name + '</option>'; options += '<option value="' + depot.id + '">' + depot.name + '</option>';
depotString = depotString + depot.id + ","; depotString = depotString + depot.id + ",";
} }
} }
} }
depotString = depotString.substring(0, depotString.length-1); depotString = depotString.substring(0, depotString.length - 1);
$("#searchProjectId").empty().append('<option value="">全部</option>').append(options); $("#searchProjectId").empty().append('<option value="">全部</option>').append(options);
} }
} }
//初始化表格数据 //初始化表格数据
function initTableData() function initTableData() {
{
$('#tableData').datagrid({ $('#tableData').datagrid({
height:heightInfo, height: heightInfo,
nowrap: false, nowrap: false,
rownumbers: true, rownumbers: true,
//动画效果 //动画效果
animate:false, animate: false,
//选中单行 //选中单行
singleSelect : true, singleSelect: true,
pagination: true, pagination: true,
//交替出现背景 //交替出现背景
striped : true, striped: true,
pageSize: 10, pageSize: 10,
pageList: [10,50,100], pageList: [10, 50, 100],
columns:[[ columns: [[
{ title: '商品名称',field: 'mName',width:150}, {title: '商品名称', field: 'mName', width: 150},
{ title: '商品型号',field: 'Model',width:150}, {title: '商品型号', field: 'Model', width: 150},
{ title: '商品类型',field: 'categoryName',width:120}, {title: '商品类型', field: 'categoryName', width: 120},
{ title: '入库数量',field: 'numSum',width:120}, {title: '入库数量', field: 'numSum', width: 120},
{ title: '入库金额',field: 'priceSum',width:120} {title: '入库金额', field: 'priceSum', width: 120}
]], ]],
onLoadError:function() onLoadError: function () {
{ $.messager.alert('页面加载提示', '页面加载异常,请稍后再试!', 'error');
$.messager.alert('页面加载提示','页面加载异常,请稍后再试!','error');
return; return;
} }
}); });
} }
//初始化键盘enter事件 //初始化键盘enter事件
$(document).keydown(function(event) $(document).keydown(function (event) {
{
//兼容 IE和firefox 事件 //兼容 IE和firefox 事件
var e = window.event || event; var e = window.event || event;
var k = e.keyCode||e.which||e.charCode; var k = e.keyCode || e.which || e.charCode;
//兼容 IE,firefox 兼容 //兼容 IE,firefox 兼容
var obj = e.srcElement ? e.srcElement : e.target; var obj = e.srcElement ? e.srcElement : e.target;
//绑定键盘事件为 id是指定的输入框才可以触发键盘事件 13键盘事件 ---遗留问题 enter键效验 对话框会关闭问题 //绑定键盘事件为 id是指定的输入框才可以触发键盘事件 13键盘事件 ---遗留问题 enter键效验 对话框会关闭问题
if(k == "13"&&(obj.id=="Type"||obj.id=="Name")) if (k == "13" && (obj.id == "Type" || obj.id == "Name")) {
{
$("#savePerson").click(); $("#savePerson").click();
} }
//搜索按钮添加快捷键 //搜索按钮添加快捷键
if(k == "13"&&(obj.id=="searchType")) if (k == "13" && (obj.id == "searchType")) {
{
$("#searchBtn").click(); $("#searchBtn").click();
} }
}); });
//分页信息处理 //分页信息处理
function ininPager() function ininPager() {
{ try {
try
{
var opts = $("#tableData").datagrid('options'); var opts = $("#tableData").datagrid('options');
var pager = $("#tableData").datagrid('getPager'); var pager = $("#tableData").datagrid('getPager');
pager.pagination({ pager.pagination({
onSelectPage:function(pageNum, pageSize) onSelectPage: function (pageNum, pageSize) {
{
opts.pageNumber = pageNum; opts.pageNumber = pageNum;
opts.pageSize = pageSize; opts.pageSize = pageSize;
pager.pagination('refresh', pager.pagination('refresh',
{ {
pageNumber:pageNum, pageNumber: pageNum,
pageSize:pageSize pageSize: pageSize
}); });
showDetails(pageNum,pageSize); showDetails(pageNum, pageSize);
} }
}); });
} }
catch (e) catch (e) {
{ $.messager.alert('异常处理提示', "分页信息异常 : " + e.name + ": " + e.message, 'error');
$.messager.alert('异常处理提示',"分页信息异常 : " + e.name + ": " + e.message,'error');
} }
} }
@@ -278,33 +263,32 @@
//搜索处理 //搜索处理
function search() { function search() {
showDetails(1,initPageSize); showDetails(1, initPageSize);
var opts = $("#tableData").datagrid('options'); var opts = $("#tableData").datagrid('options');
var pager = $("#tableData").datagrid('getPager'); var pager = $("#tableData").datagrid('getPager');
opts.pageNumber = 1; opts.pageNumber = 1;
opts.pageSize = initPageSize; opts.pageSize = initPageSize;
pager.pagination('refresh', pager.pagination('refresh',
{ {
pageNumber:1, pageNumber: 1,
pageSize:initPageSize pageSize: initPageSize
}); });
} }
$("#searchBtn").unbind().bind({ $("#searchBtn").unbind().bind({
click:function() click: function () {
{
search(); search();
} }
}); });
function showDetails(pageNo,pageSize) function showDetails(pageNo, pageSize) {
{
$.ajax({ $.ajax({
type: "post", type: "post",
url: "<%=path %>/depotHead/findInOutMaterialCount.action", url: "<%=path %>/depotHead/findInOutMaterialCount.action",
dataType: "json", dataType: "json",
data: ({ data: ({
pageNo:pageNo, pageNo: pageNo,
pageSize:pageSize, pageSize: pageSize,
OrganId: $('#OrganId').combobox('getValue'), OrganId: $('#OrganId').combobox('getValue'),
ProjectId: $.trim($("#searchProjectId").val()), ProjectId: $.trim($("#searchProjectId").val()),
DepotIds: depotString, DepotIds: depotString,
@@ -313,24 +297,25 @@
Type: "入库" Type: "入库"
}), }),
success: function (res) { success: function (res) {
if(res){ if (res) {
$("#tableData").datagrid('loadData',res); $("#tableData").datagrid('loadData', res);
} }
}, },
//此处添加错误处理 //此处添加错误处理
error:function() { error: function () {
$.messager.alert('查询提示','查询数据后台异常,请稍后再试!','error'); $.messager.alert('查询提示', '查询数据后台异常,请稍后再试!', 'error');
return; return;
} }
}); });
} }
//报表打印 //报表打印
function print() { function print() {
$("#printBtn").off("click").on("click",function(){ $("#printBtn").off("click").on("click", function () {
var path = "<%=path %>"; var path = "<%=path %>";
CreateFormPage('打印报表', $('#tableData'), path); CreateFormPage('打印报表', $('#tableData'), path);
}); });
} }
</script> </script>
</body> </body>
</html> </html>

View File

@@ -1,22 +1,22 @@
<%@page import="com.jsh.util.Tools"%> <%@page import="com.jsh.util.Tools" %>
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%> <%@ page language="java" pageEncoding="utf-8" %>
<% <%
String path = request.getContextPath(); String path = request.getContextPath();
String clientIp = Tools.getLocalIp(request); String clientIp = Tools.getLocalIp(request);
%> %>
<!DOCTYPE html> <!DOCTYPE html>
<html> <html>
<head> <head>
<title>库存状况</title> <title>库存状况</title>
<meta charset="utf-8"> <meta charset="utf-8">
<!-- 指定以IE8的方式来渲染 --> <!-- 指定以IE8的方式来渲染 -->
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE8"/> <meta http-equiv="X-UA-Compatible" content="IE=EmulateIE8"/>
<link rel="shortcut icon" href="<%=path%>/images/favicon.ico" type="image/x-icon" /> <link rel="shortcut icon" href="<%=path%>/images/favicon.ico" type="image/x-icon"/>
<script type="text/javascript" src="<%=path %>/js/jquery-1.8.0.min.js"></script> <script type="text/javascript" src="<%=path %>/js/jquery-1.8.0.min.js"></script>
<script type="text/javascript" src="<%=path %>/js/print/print.js"></script> <script type="text/javascript" src="<%=path %>/js/print/print.js"></script>
<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/default/easyui.css"/>
<link rel="stylesheet" type="text/css" href="<%=path %>/js/easyui-1.3.5/themes/icon.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" /> <link type="text/css" rel="stylesheet" href="<%=path %>/css/common.css"/>
<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/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/locale/easyui-lang-zh_CN.js"></script>
<script type="text/javascript" src="<%=path %>/js/My97DatePicker/WdatePicker.js"></script> <script type="text/javascript" src="<%=path %>/js/My97DatePicker/WdatePicker.js"></script>
@@ -24,10 +24,11 @@
<script> <script>
var kid = ${sessionScope.user.id}; var kid = ${sessionScope.user.id};
</script> </script>
</head> </head>
<body> <body>
<!-- 查询 --> <!-- 查询 -->
<div id = "searchPanel" class="easyui-panel" style="padding:10px;" title="查询窗口" iconCls="icon-search" collapsible="true" closable="false"> <div id="searchPanel" class="easyui-panel" style="padding:10px;" title="查询窗口" iconCls="icon-search" collapsible="true"
closable="false">
<table id="searchTable"> <table id="searchTable">
<tr> <tr>
<td>仓库:</td> <td>仓库:</td>
@@ -37,7 +38,8 @@
<td>&nbsp;</td> <td>&nbsp;</td>
<td>月份:</td> <td>月份:</td>
<td> <td>
<input type="text" name="searchMonth" id="searchMonth" onClick="WdatePicker({dateFmt:'yyyy-MM'})" class="txt Wdate" style="width:180px;"/> <input type="text" name="searchMonth" id="searchMonth" onClick="WdatePicker({dateFmt:'yyyy-MM'})"
class="txt Wdate" style="width:180px;"/>
</td> </td>
<td>&nbsp;</td> <td>&nbsp;</td>
<td> <td>
@@ -50,24 +52,24 @@
</td> </td>
</tr> </tr>
</table> </table>
</div> </div>
<!-- 数据显示table --> <!-- 数据显示table -->
<div id = "tablePanel" class="easyui-panel" style="padding:1px;top:300px;" title="库存状况列表" iconCls="icon-list" collapsible="true" closable="false"> <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> <table id="tableData" style="top:300px;border-bottom-color:#FFFFFF"></table>
</div> </div>
<script type="text/javascript"> <script type="text/javascript">
var depotList = null; var depotList = null;
var depotID = null; var depotID = null;
var mPropertyList = ""; //商品属性列表 var mPropertyList = ""; //商品属性列表
//初始化界面 //初始化界面
$(function() $(function () {
{
var thisDate = getNowFormatMonth(); //当前月份 var thisDate = getNowFormatMonth(); //当前月份
$("#searchMonth").val(thisDate); $("#searchMonth").val(thisDate);
var userBusinessList=null; var userBusinessList = null;
var userdepot=null; var userdepot = null;
initSystemData_UB(); initSystemData_UB();
initSelectInfo_UB(); initSelectInfo_UB();
initSystemData_depot(); initSystemData_depot();
@@ -82,12 +84,12 @@
//导出EXCEL //导出EXCEL
function exportExcel() { function exportExcel() {
$("#exprotBtn").off("click").on("click",function(){ $("#exprotBtn").off("click").on("click", function () {
if(!$("#searchPanel .total-count").text()) { if (!$("#searchPanel .total-count").text()) {
$.messager.alert('导出提示','请先选择月份再进行查询!','error'); $.messager.alert('导出提示', '请先选择月份再进行查询!', 'error');
} }
else { else {
showEachDetails(1,3000); showEachDetails(1, 3000);
//此处直接去做get请求用下面的查询每月统计的方法去获取list参数长度虽长但还是可以用get //此处直接去做get请求用下面的查询每月统计的方法去获取list参数长度虽长但还是可以用get
//window.location.href = "<%=path%>/depotItem/exportExcel.action?browserType=" + getOs(); //window.location.href = "<%=path%>/depotItem/exportExcel.action?browserType=" + getOs();
} }
@@ -95,86 +97,76 @@
} }
//初始化系统基础信息 //初始化系统基础信息
function initSystemData_UB(){ function initSystemData_UB() {
$.ajax({ $.ajax({
type:"post", type: "post",
url: "<%=path %>/userBusiness/getBasicData.action", url: "<%=path %>/userBusiness/getBasicData.action",
data: ({ data: ({
KeyId:kid, KeyId: kid,
Type:"UserDepot" Type: "UserDepot"
}), }),
//设置为同步 //设置为同步
async:false, async: false,
dataType: "json", dataType: "json",
success: function (systemInfo) success: function (systemInfo) {
{ if (systemInfo) {
if(systemInfo)
{
userBusinessList = systemInfo.showModel.map.userBusinessList; userBusinessList = systemInfo.showModel.map.userBusinessList;
var msgTip = systemInfo.showModel.msgTip; var msgTip = systemInfo.showModel.msgTip;
if(msgTip == "exceptoin") if (msgTip == "exceptoin") {
{ $.messager.alert('提示', '查找UserBusiness异常,请与管理员联系!', 'error');
$.messager.alert('提示','查找UserBusiness异常,请与管理员联系!','error');
return; return;
} }
} }
else else {
{ userBusinessList = null;
userBusinessList=null;
} }
} }
}); });
} }
//初始化页面选项卡
function initSelectInfo_UB(){
if(userBusinessList !=null) //初始化页面选项卡
{ function initSelectInfo_UB() {
if(userBusinessList.length>0)
{ if (userBusinessList != null) {
if (userBusinessList.length > 0) {
//用户对应的仓库列表 [1][2][3]... //用户对应的仓库列表 [1][2][3]...
userdepot =userBusinessList[0].value; userdepot = userBusinessList[0].value;
} }
} }
} }
//初始化系统基础信息 //初始化系统基础信息
function initSystemData_depot(){ function initSystemData_depot() {
$.ajax({ $.ajax({
type:"post", type: "post",
url: "<%=path %>/depot/getBasicData.action", url: "<%=path %>/depot/getBasicData.action",
//设置为同步 //设置为同步
async:false, async: false,
dataType: "json", dataType: "json",
success: function (systemInfo) success: function (systemInfo) {
{
depotList = systemInfo.showModel.map.depotList; depotList = systemInfo.showModel.map.depotList;
var msgTip = systemInfo.showModel.msgTip; var msgTip = systemInfo.showModel.msgTip;
if(msgTip == "exceptoin") if (msgTip == "exceptoin") {
{ $.messager.alert('提示', '查找系统基础信息异常,请与管理员联系!', 'error');
$.messager.alert('提示','查找系统基础信息异常,请与管理员联系!','error');
return; return;
} }
} }
}); });
} }
//初始化页面选项卡 //初始化页面选项卡
function initSelectInfo_depot(){ function initSelectInfo_depot() {
var options = ""; var options = "";
if(depotList !=null) if (depotList != null) {
{
options = ""; options = "";
for(var i = 0 ;i < depotList.length;i++) for (var i = 0; i < depotList.length; i++) {
{
var depot = depotList[i]; var depot = depotList[i];
if(userdepot!=null) if (userdepot != null) {
{ if (userdepot.indexOf("[" + depot.id + "]") != -1) {
if(userdepot.indexOf("["+depot.id+"]")!=-1)
{
options += '<option value="' + depot.id + '">' + depot.name + '</option>'; options += '<option value="' + depot.id + '">' + depot.name + '</option>';
} }
} }
@@ -184,7 +176,7 @@
} }
//初始化商品属性 //初始化商品属性
function initMProperty(){ function initMProperty() {
$.ajax({ $.ajax({
type: "post", type: "post",
url: "<%=path %>/materialProperty/findBy.action", url: "<%=path %>/materialProperty/findBy.action",
@@ -192,111 +184,105 @@
success: function (res) { success: function (res) {
if (res && res.rows) { if (res && res.rows) {
var thisRows = res.rows; var thisRows = res.rows;
for(var i=0; i < thisRows.length; i++) { for (var i = 0; i < thisRows.length; i++) {
if(thisRows[i].enabled){ if (thisRows[i].enabled) {
mPropertyList += thisRows[i].nativeName +","; mPropertyList += thisRows[i].nativeName + ",";
} }
} }
if(mPropertyList){ if (mPropertyList) {
mPropertyList = mPropertyList.substring(0,mPropertyList.length-1); mPropertyList = mPropertyList.substring(0, mPropertyList.length - 1);
} }
} }
}, },
//此处添加错误处理 //此处添加错误处理
error:function() { error: function () {
$.messager.alert('查询提示','查询信息异常,请稍后再试!','error'); $.messager.alert('查询提示', '查询信息异常,请稍后再试!', 'error');
return; return;
} }
}); });
} }
//初始化表格数据 //初始化表格数据
function initTableData() function initTableData() {
{
$('#tableData').datagrid({ $('#tableData').datagrid({
height:heightInfo, height: heightInfo,
nowrap: false, nowrap: false,
rownumbers: true, rownumbers: true,
//动画效果 //动画效果
animate:false, animate: false,
//选中单行 //选中单行
singleSelect : true, singleSelect: true,
pagination: true, pagination: true,
//交替出现背景 //交替出现背景
striped : true, striped: true,
//loadFilter: pagerFilter, //loadFilter: pagerFilter,
pageSize: 10, pageSize: 10,
pageList: [10,50,100], pageList: [10, 50, 100],
columns:[[ columns: [[
{ title: '名称',field: 'MaterialName',width:60}, {title: '名称', field: 'MaterialName', width: 60},
{ title: '型号',field: 'MaterialModel',width:80}, {title: '型号', field: 'MaterialModel', width: 80},
{ title: '扩展信息',field: 'MaterialOther',width:150}, {title: '扩展信息', field: 'MaterialOther', width: 150},
{ title: '单位',field: 'MaterialUnit',width:80}, {title: '单位', field: 'MaterialUnit', width: 80},
{ title: '单价',field: 'UnitPrice',width:60,formatter: function(value,row,index){ {
title: '单价', field: 'UnitPrice', width: 60, formatter: function (value, row, index) {
return value.toFixed(2); return value.toFixed(2);
} }
}, },
{ title: '上月结存数量',field: 'prevSum',width:80}, {title: '上月结存数量', field: 'prevSum', width: 80},
{ title: '入库数量',field: 'InSum',width:60}, {title: '入库数量', field: 'InSum', width: 60},
{ title: '出库数量',field: 'OutSum',width:60}, {title: '出库数量', field: 'OutSum', width: 60},
{ title: '本月结存数量',field: 'thisSum',width:80}, {title: '本月结存数量', field: 'thisSum', width: 80},
{ title: '结存金额',field: 'thisAllPrice',width:60, {
formatter: function(value,row,index){ title: '结存金额', field: 'thisAllPrice', width: 60,
formatter: function (value, row, index) {
return value.toFixed(2); return value.toFixed(2);
} }
} }
]], ]],
onLoadError:function() onLoadError: function () {
{ $.messager.alert('页面加载提示', '页面加载异常,请稍后再试!', 'error');
$.messager.alert('页面加载提示','页面加载异常,请稍后再试!','error');
return; return;
} }
}); });
} }
//初始化键盘enter事件 //初始化键盘enter事件
$(document).keydown(function(event) $(document).keydown(function (event) {
{
//兼容 IE和firefox 事件 //兼容 IE和firefox 事件
var e = window.event || event; var e = window.event || event;
var k = e.keyCode||e.which||e.charCode; var k = e.keyCode || e.which || e.charCode;
//兼容 IE,firefox 兼容 //兼容 IE,firefox 兼容
var obj = e.srcElement ? e.srcElement : e.target; var obj = e.srcElement ? e.srcElement : e.target;
//绑定键盘事件为 id是指定的输入框才可以触发键盘事件 13键盘事件 ---遗留问题 enter键效验 对话框会关闭问题 //绑定键盘事件为 id是指定的输入框才可以触发键盘事件 13键盘事件 ---遗留问题 enter键效验 对话框会关闭问题
if(k == "13"&&(obj.id=="Type"||obj.id=="Name")) if (k == "13" && (obj.id == "Type" || obj.id == "Name")) {
{
$("#savePerson").click(); $("#savePerson").click();
} }
//搜索按钮添加快捷键 //搜索按钮添加快捷键
if(k == "13"&&(obj.id=="searchType")) if (k == "13" && (obj.id == "searchType")) {
{
$("#searchBtn").click(); $("#searchBtn").click();
} }
}); });
//分页信息处理 //分页信息处理
function ininPager() function ininPager() {
{ try {
try
{
var opts = $("#tableData").datagrid('options'); var opts = $("#tableData").datagrid('options');
var pager = $("#tableData").datagrid('getPager'); var pager = $("#tableData").datagrid('getPager');
pager.pagination({ pager.pagination({
onSelectPage:function(pageNum, pageSize) onSelectPage: function (pageNum, pageSize) {
{
opts.pageNumber = pageNum; opts.pageNumber = pageNum;
opts.pageSize = pageSize; opts.pageSize = pageSize;
pager.pagination('refresh', pager.pagination('refresh',
{ {
pageNumber:pageNum, pageNumber: pageNum,
pageSize:pageSize pageSize: pageSize
}); });
showEachDetails(pageNum,pageSize); showEachDetails(pageNum, pageSize);
} }
}); });
} }
catch (e) catch (e) {
{ $.messager.alert('异常处理提示', "分页信息异常 : " + e.name + ": " + e.message, 'error');
$.messager.alert('异常处理提示',"分页信息异常 : " + e.name + ": " + e.message,'error');
} }
} }
@@ -308,137 +294,129 @@
//搜索处理 //搜索处理
function search() { function search() {
showEachDetails(1,initPageSize); showEachDetails(1, initPageSize);
var opts = $("#tableData").datagrid('options'); var opts = $("#tableData").datagrid('options');
var pager = $("#tableData").datagrid('getPager'); var pager = $("#tableData").datagrid('getPager');
opts.pageNumber = 1; opts.pageNumber = 1;
opts.pageSize = initPageSize; opts.pageSize = initPageSize;
pager.pagination('refresh', pager.pagination('refresh',
{ {
pageNumber:1, pageNumber: 1,
pageSize:initPageSize pageSize: initPageSize
}); });
} }
$("#searchBtn").unbind().bind({ $("#searchBtn").unbind().bind({
click:function() click: function () {
{
search(); search();
} }
}); });
function showEachDetails(pageNo,pageSize) function showEachDetails(pageNo, pageSize) {
{
$.ajax({ $.ajax({
type:"post", type: "post",
url: "<%=path %>/depotHead/findByMonth.action", url: "<%=path %>/depotHead/findByMonth.action",
dataType: "json", dataType: "json",
data: ({ data: ({
MonthTime:$("#searchMonth").val() MonthTime: $("#searchMonth").val()
}), }),
success: function (res) success: function (res) {
{
var HeadIds = res.HeadIds; var HeadIds = res.HeadIds;
if(HeadIds) { if (HeadIds) {
//获取排序后的产品ID //获取排序后的产品ID
$.ajax({ $.ajax({
type:"post", type: "post",
url: "<%=path %>/material/findByOrder.action", url: "<%=path %>/material/findByOrder.action",
dataType: "json", dataType: "json",
success: function (resNew) success: function (resNew) {
{
var MIds = resNew.mIds; var MIds = resNew.mIds;
if(MIds) { if (MIds) {
if(pageSize === 3000) { if (pageSize === 3000) {
window.location.href = "<%=path%>/depotItem/exportExcel.action?browserType=" + getOs() + "&pageNo=" + pageNo + "&pageSize=" + pageSize + "&ProjectId="+ $.trim($("#searchProjectId").val()) +"&MonthTime=" + $("#searchMonth").val() + "&HeadIds=" + HeadIds + "&MaterialIds=" + MIds; window.location.href = "<%=path%>/depotItem/exportExcel.action?browserType=" + getOs() + "&pageNo=" + pageNo + "&pageSize=" + pageSize + "&ProjectId=" + $.trim($("#searchProjectId").val()) + "&MonthTime=" + $("#searchMonth").val() + "&HeadIds=" + HeadIds + "&MaterialIds=" + MIds;
} }
else { else {
$.ajax({ $.ajax({
type:"post", type: "post",
url: "<%=path %>/depotItem/findByAll.action", url: "<%=path %>/depotItem/findByAll.action",
dataType: "json", dataType: "json",
data: ({ data: ({
pageNo:pageNo, pageNo: pageNo,
pageSize:pageSize, pageSize: pageSize,
ProjectId: $.trim($("#searchProjectId").val()), ProjectId: $.trim($("#searchProjectId").val()),
MonthTime:$("#searchMonth").val(), MonthTime: $("#searchMonth").val(),
HeadIds:HeadIds, HeadIds: HeadIds,
MaterialIds:MIds, MaterialIds: MIds,
mpList: mPropertyList mpList: mPropertyList
}), }),
success: function (data) success: function (data) {
{ $("#tableData").datagrid('loadData', data);
$("#tableData").datagrid('loadData',data);
}, },
//此处添加错误处理 //此处添加错误处理
error:function() error: function () {
{ $.messager.alert('查询提示', '查询数据后台异常,请稍后再试!', 'error');
$.messager.alert('查询提示','查询数据后台异常,请稍后再试!','error');
return; return;
} }
}); });
//总金额 //总金额
$.ajax({ $.ajax({
type:"post", type: "post",
url: "<%=path %>/depotItem/totalCountMoney.action", url: "<%=path %>/depotItem/totalCountMoney.action",
dataType: "json", dataType: "json",
data: ({ data: ({
ProjectId: $.trim($("#searchProjectId").val()), ProjectId: $.trim($("#searchProjectId").val()),
MonthTime:$("#searchMonth").val(), MonthTime: $("#searchMonth").val(),
HeadIds:HeadIds, HeadIds: HeadIds,
MaterialIds:MIds MaterialIds: MIds
}), }),
success: function (data) success: function (data) {
{ if (data && data.totalCount) {
if(data && data.totalCount) {
var count = data.totalCount.toString(); var count = data.totalCount.toString();
if(count.lastIndexOf('.')>-1){ if (count.lastIndexOf('.') > -1) {
count = count.substring(0,count.lastIndexOf('.')+3); count = count.substring(0, count.lastIndexOf('.') + 3);
} }
$("#searchPanel .total-count").text("本月合计金额:" + count + "元");//本月合计金额 $("#searchPanel .total-count").text("本月合计金额:" + count + "元");//本月合计金额
} }
}, },
//此处添加错误处理 //此处添加错误处理
error:function() error: function () {
{ $.messager.alert('查询提示', '查询数据后台异常,请稍后再试!', 'error');
$.messager.alert('查询提示','查询数据后台异常,请稍后再试!','error');
return; return;
} }
}); });
} }
} }
else { else {
$.messager.alert('查询提示','本月无数据!','error'); $.messager.alert('查询提示', '本月无数据!', 'error');
} }
}, },
//此处添加错误处理 //此处添加错误处理
error:function() error: function () {
{ $.messager.alert('查询提示', '查询数据后台异常,请稍后再试!', 'error');
$.messager.alert('查询提示','查询数据后台异常,请稍后再试!','error');
return; return;
} }
}); });
} }
else { else {
$.messager.alert('查询提示','本月无数据!','error'); $.messager.alert('查询提示', '本月无数据!', 'error');
} }
}, },
//此处添加错误处理 //此处添加错误处理
error:function() error: function () {
{ $.messager.alert('查询提示', '查询数据后台异常,请稍后再试!', 'error');
$.messager.alert('查询提示','查询数据后台异常,请稍后再试!','error');
return; return;
} }
}); });
} }
//报表打印 //报表打印
function print() { function print() {
$("#printBtn").off("click").on("click",function(){ $("#printBtn").off("click").on("click", function () {
var path = "<%=path %>"; var path = "<%=path %>";
CreateFormPage('打印报表', $('#tableData'), path); CreateFormPage('打印报表', $('#tableData'), path);
}); });
} }
</script> </script>
</body> </body>
</html> </html>

View File

@@ -1,22 +1,22 @@
<%@page import="com.jsh.util.Tools"%> <%@page import="com.jsh.util.Tools" %>
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%> <%@ page language="java" pageEncoding="utf-8" %>
<% <%
String path = request.getContextPath(); String path = request.getContextPath();
String clientIp = Tools.getLocalIp(request); String clientIp = Tools.getLocalIp(request);
%> %>
<!DOCTYPE html> <!DOCTYPE html>
<html> <html>
<head> <head>
<title>出库明细</title> <title>出库明细</title>
<meta charset="utf-8"> <meta charset="utf-8">
<!-- 指定以IE8的方式来渲染 --> <!-- 指定以IE8的方式来渲染 -->
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE8"/> <meta http-equiv="X-UA-Compatible" content="IE=EmulateIE8"/>
<link rel="shortcut icon" href="<%=path%>/images/favicon.ico" type="image/x-icon" /> <link rel="shortcut icon" href="<%=path%>/images/favicon.ico" type="image/x-icon"/>
<script type="text/javascript" src="<%=path %>/js/jquery-1.8.0.min.js"></script> <script type="text/javascript" src="<%=path %>/js/jquery-1.8.0.min.js"></script>
<script type="text/javascript" src="<%=path %>/js/print/print.js"></script> <script type="text/javascript" src="<%=path %>/js/print/print.js"></script>
<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/default/easyui.css"/>
<link rel="stylesheet" type="text/css" href="<%=path %>/js/easyui-1.3.5/themes/icon.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" /> <link type="text/css" rel="stylesheet" href="<%=path %>/css/common.css"/>
<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/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/locale/easyui-lang-zh_CN.js"></script>
<script type="text/javascript" src="<%=path %>/js/common/outlook_in.js"></script> <script type="text/javascript" src="<%=path %>/js/common/outlook_in.js"></script>
@@ -25,15 +25,16 @@
<script> <script>
var uid = ${sessionScope.user.id}; var uid = ${sessionScope.user.id};
</script> </script>
</head> </head>
<body> <body>
<!-- 查询 --> <!-- 查询 -->
<div id = "searchPanel" class="easyui-panel" style="padding:10px;" title="查询窗口" iconCls="icon-search" collapsible="true" closable="false"> <div id="searchPanel" class="easyui-panel" style="padding:10px;" title="查询窗口" iconCls="icon-search" collapsible="true"
closable="false">
<table id="searchTable"> <table id="searchTable">
<tr> <tr>
<td>客户:</td> <td>客户:</td>
<td> <td>
<input id="OrganId" name="OrganId" style="width:120px;" /> <input id="OrganId" name="OrganId" style="width:120px;"/>
</td> </td>
<td>&nbsp;</td> <td>&nbsp;</td>
<td>仓库:</td> <td>仓库:</td>
@@ -43,11 +44,13 @@
<td>&nbsp;</td> <td>&nbsp;</td>
<td>单据日期:</td> <td>单据日期:</td>
<td> <td>
<input type="text" name="searchBeginTime" id="searchBeginTime" onClick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'})" class="txt Wdate" style="width:140px;"/> <input type="text" name="searchBeginTime" id="searchBeginTime"
onClick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'})" class="txt Wdate" style="width:140px;"/>
</td> </td>
<td>-</td> <td>-</td>
<td> <td>
<input type="text" name="searchEndTime" id="searchEndTime" onClick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'})" class="txt Wdate" style="width:140px;"/> <input type="text" name="searchEndTime" id="searchEndTime"
onClick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'})" class="txt Wdate" style="width:140px;"/>
</td> </td>
<td>&nbsp;</td> <td>&nbsp;</td>
<td> <td>
@@ -57,28 +60,28 @@
</td> </td>
</tr> </tr>
</table> </table>
</div> </div>
<!-- 数据显示table --> <!-- 数据显示table -->
<div id = "tablePanel" class="easyui-panel" style="padding:1px;top:300px;" title="出库明细列表" iconCls="icon-list" collapsible="true" closable="false"> <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> <table id="tableData" style="top:300px;border-bottom-color:#FFFFFF"></table>
</div> </div>
<script type="text/javascript"> <script type="text/javascript">
var depotList = null; var depotList = null;
var depotID = null; var depotID = null;
var depotString = ""; //仓库列表 var depotString = ""; //仓库列表
var path = "<%=path %>"; var path = "<%=path %>";
var cusUrl = path + "/supplier/findBySelect_cus.action?UBType=UserCustomer&UBKeyId=" + uid; //客户接口 var cusUrl = path + "/supplier/findBySelect_cus.action?UBType=UserCustomer&UBKeyId=" + uid; //客户接口
//初始化界面 //初始化界面
$(function() $(function () {
{
var thisDate = getNowFormatMonth(); //当前月份 var thisDate = getNowFormatMonth(); //当前月份
var thisDateTime = getNowFormatDateTime(); //当前时间 var thisDateTime = getNowFormatDateTime(); //当前时间
$("#searchBeginTime").val(thisDate + "-01 00:00:00"); $("#searchBeginTime").val(thisDate + "-01 00:00:00");
$("#searchEndTime").val(thisDateTime); $("#searchEndTime").val(thisDateTime);
var userBusinessList=null; var userBusinessList = null;
var userdepot=null; var userdepot = null;
initSupplier(); //初始化客户信息 initSupplier(); //初始化客户信息
initSystemData_UB(); initSystemData_UB();
initSelectInfo_UB(); initSelectInfo_UB();
@@ -91,192 +94,175 @@
}); });
//初始化客户 //初始化客户
function initSupplier(){ function initSupplier() {
$('#OrganId').combobox({ $('#OrganId').combobox({
url: cusUrl, url: cusUrl,
valueField:'id', valueField: 'id',
textField:'supplier', textField: 'supplier',
filter: function(q, row){ filter: function (q, row) {
var opts = $(this).combobox('options'); var opts = $(this).combobox('options');
return row[opts.textField].indexOf(q) >-1; return row[opts.textField].indexOf(q) > -1;
} }
}); });
} }
//初始化系统基础信息 //初始化系统基础信息
function initSystemData_UB(){ function initSystemData_UB() {
$.ajax({ $.ajax({
type:"post", type: "post",
url: "<%=path %>/userBusiness/getBasicData.action", url: "<%=path %>/userBusiness/getBasicData.action",
data: ({ data: ({
KeyId: uid, KeyId: uid,
Type:"UserDepot" Type: "UserDepot"
}), }),
//设置为同步 //设置为同步
async:false, async: false,
dataType: "json", dataType: "json",
success: function (systemInfo) success: function (systemInfo) {
{ if (systemInfo) {
if(systemInfo)
{
userBusinessList = systemInfo.showModel.map.userBusinessList; userBusinessList = systemInfo.showModel.map.userBusinessList;
var msgTip = systemInfo.showModel.msgTip; var msgTip = systemInfo.showModel.msgTip;
if(msgTip == "exceptoin") if (msgTip == "exceptoin") {
{ $.messager.alert('提示', '查找UserBusiness异常,请与管理员联系!', 'error');
$.messager.alert('提示','查找UserBusiness异常,请与管理员联系!','error');
return; return;
} }
} }
else else {
{ userBusinessList = null;
userBusinessList=null;
} }
} }
}); });
} }
//初始化页面选项卡
function initSelectInfo_UB(){
if(userBusinessList !=null) //初始化页面选项卡
{ function initSelectInfo_UB() {
if(userBusinessList.length>0)
{ if (userBusinessList != null) {
if (userBusinessList.length > 0) {
//用户对应的仓库列表 [1][2][3]... //用户对应的仓库列表 [1][2][3]...
userdepot =userBusinessList[0].value; userdepot = userBusinessList[0].value;
} }
} }
} }
//初始化系统基础信息 //初始化系统基础信息
function initSystemData_depot(){ function initSystemData_depot() {
$.ajax({ $.ajax({
type:"post", type: "post",
url: "<%=path %>/depot/getBasicData.action", url: "<%=path %>/depot/getBasicData.action",
//设置为同步 //设置为同步
async:false, async: false,
dataType: "json", dataType: "json",
success: function (systemInfo) success: function (systemInfo) {
{
depotList = systemInfo.showModel.map.depotList; depotList = systemInfo.showModel.map.depotList;
var msgTip = systemInfo.showModel.msgTip; var msgTip = systemInfo.showModel.msgTip;
if(msgTip == "exceptoin") if (msgTip == "exceptoin") {
{ $.messager.alert('提示', '查找系统基础信息异常,请与管理员联系!', 'error');
$.messager.alert('提示','查找系统基础信息异常,请与管理员联系!','error');
return; return;
} }
} }
}); });
} }
//初始化页面选项卡 //初始化页面选项卡
function initSelectInfo_depot(){ function initSelectInfo_depot() {
var options = ""; var options = "";
if(depotList !=null) if (depotList != null) {
{
options = ""; options = "";
for(var i = 0 ;i < depotList.length;i++) for (var i = 0; i < depotList.length; i++) {
{
var depot = depotList[i]; var depot = depotList[i];
if(userdepot!=null) if (userdepot != null) {
{ if (userdepot.indexOf("[" + depot.id + "]") != -1) {
if(userdepot.indexOf("["+depot.id+"]")!=-1)
{
options += '<option value="' + depot.id + '">' + depot.name + '</option>'; options += '<option value="' + depot.id + '">' + depot.name + '</option>';
depotString = depotString + depot.id + ","; depotString = depotString + depot.id + ",";
} }
} }
} }
depotString = depotString.substring(0, depotString.length-1); depotString = depotString.substring(0, depotString.length - 1);
$("#searchProjectId").empty().append('<option value="">全部</option>').append(options); $("#searchProjectId").empty().append('<option value="">全部</option>').append(options);
} }
} }
//初始化表格数据 //初始化表格数据
function initTableData() function initTableData() {
{
$('#tableData').datagrid({ $('#tableData').datagrid({
height:heightInfo, height: heightInfo,
nowrap: false, nowrap: false,
rownumbers: true, rownumbers: true,
//动画效果 //动画效果
animate:false, animate: false,
//选中单行 //选中单行
singleSelect : true, singleSelect: true,
pagination: true, pagination: true,
//交替出现背景 //交替出现背景
striped : true, striped: true,
pageSize: 10, pageSize: 10,
pageList: [10,50,100], pageList: [10, 50, 100],
columns:[[ columns: [[
{ title: '单据编号',field: 'number',width:140, {
title: '单据编号', field: 'number', width: 140,
formatter: function (value, row) { formatter: function (value, row) {
return "<a class='n-link' onclick=\"newTab('" + row.number + "','../materials/bill_detail.jsp?n=" + row.number + "&type=" + row.type + "','')\">" return "<a class='n-link' onclick=\"newTab('" + row.number + "','../materials/bill_detail.jsp?n=" + row.number + "&type=" + row.type + "','')\">"
+ row.number + "</a>"; + row.number + "</a>";
} }
}, },
{ title: '商品名称',field: 'materialName',width:120}, {title: '商品名称', field: 'materialName', width: 120},
{ title: '商品型号',field: 'materialModel',width:100}, {title: '商品型号', field: 'materialModel', width: 100},
{ title: '单价',field: 'unitPrice',width:60}, {title: '单价', field: 'unitPrice', width: 60},
{ title: '出库数量',field: 'operNumber',width:60}, {title: '出库数量', field: 'operNumber', width: 60},
{ title: '金额',field: 'allPrice',width:60}, {title: '金额', field: 'allPrice', width: 60},
{ title: '客户',field: 'supplierName',width:200}, {title: '客户', field: 'supplierName', width: 200},
{ title: '仓库',field: 'depotName',width:120}, {title: '仓库', field: 'depotName', width: 120},
{ title: '出库日期',field: 'operTime',width:80}, {title: '出库日期', field: 'operTime', width: 80},
]], ]],
onLoadError:function() onLoadError: function () {
{ $.messager.alert('页面加载提示', '页面加载异常,请稍后再试!', 'error');
$.messager.alert('页面加载提示','页面加载异常,请稍后再试!','error');
return; return;
} }
}); });
} }
//初始化键盘enter事件 //初始化键盘enter事件
$(document).keydown(function(event) $(document).keydown(function (event) {
{
//兼容 IE和firefox 事件 //兼容 IE和firefox 事件
var e = window.event || event; var e = window.event || event;
var k = e.keyCode||e.which||e.charCode; var k = e.keyCode || e.which || e.charCode;
//兼容 IE,firefox 兼容 //兼容 IE,firefox 兼容
var obj = e.srcElement ? e.srcElement : e.target; var obj = e.srcElement ? e.srcElement : e.target;
//绑定键盘事件为 id是指定的输入框才可以触发键盘事件 13键盘事件 ---遗留问题 enter键效验 对话框会关闭问题 //绑定键盘事件为 id是指定的输入框才可以触发键盘事件 13键盘事件 ---遗留问题 enter键效验 对话框会关闭问题
if(k == "13"&&(obj.id=="Type"||obj.id=="Name")) if (k == "13" && (obj.id == "Type" || obj.id == "Name")) {
{
$("#savePerson").click(); $("#savePerson").click();
} }
//搜索按钮添加快捷键 //搜索按钮添加快捷键
if(k == "13"&&(obj.id=="searchType")) if (k == "13" && (obj.id == "searchType")) {
{
$("#searchBtn").click(); $("#searchBtn").click();
} }
}); });
//分页信息处理 //分页信息处理
function ininPager() function ininPager() {
{ try {
try
{
var opts = $("#tableData").datagrid('options'); var opts = $("#tableData").datagrid('options');
var pager = $("#tableData").datagrid('getPager'); var pager = $("#tableData").datagrid('getPager');
pager.pagination({ pager.pagination({
onSelectPage:function(pageNum, pageSize) onSelectPage: function (pageNum, pageSize) {
{
opts.pageNumber = pageNum; opts.pageNumber = pageNum;
opts.pageSize = pageSize; opts.pageSize = pageSize;
pager.pagination('refresh', pager.pagination('refresh',
{ {
pageNumber:pageNum, pageNumber: pageNum,
pageSize:pageSize pageSize: pageSize
}); });
showDetails(pageNum,pageSize); showDetails(pageNum, pageSize);
} }
}); });
} }
catch (e) catch (e) {
{ $.messager.alert('异常处理提示', "分页信息异常 : " + e.name + ": " + e.message, 'error');
$.messager.alert('异常处理提示',"分页信息异常 : " + e.name + ": " + e.message,'error');
} }
} }
@@ -288,33 +274,32 @@
//搜索处理 //搜索处理
function search() { function search() {
showDetails(1,initPageSize); showDetails(1, initPageSize);
var opts = $("#tableData").datagrid('options'); var opts = $("#tableData").datagrid('options');
var pager = $("#tableData").datagrid('getPager'); var pager = $("#tableData").datagrid('getPager');
opts.pageNumber = 1; opts.pageNumber = 1;
opts.pageSize = initPageSize; opts.pageSize = initPageSize;
pager.pagination('refresh', pager.pagination('refresh',
{ {
pageNumber:1, pageNumber: 1,
pageSize:initPageSize pageSize: initPageSize
}); });
} }
$("#searchBtn").unbind().bind({ $("#searchBtn").unbind().bind({
click:function() click: function () {
{
search(); search();
} }
}); });
function showDetails(pageNo,pageSize) function showDetails(pageNo, pageSize) {
{
$.ajax({ $.ajax({
type: "post", type: "post",
url: "<%=path %>/depotHead/findInDetail.action", url: "<%=path %>/depotHead/findInDetail.action",
dataType: "json", dataType: "json",
data: ({ data: ({
pageNo:pageNo, pageNo: pageNo,
pageSize:pageSize, pageSize: pageSize,
OrganId: $('#OrganId').combobox('getValue'), OrganId: $('#OrganId').combobox('getValue'),
ProjectId: $.trim($("#searchProjectId").val()), ProjectId: $.trim($("#searchProjectId").val()),
DepotIds: depotString, DepotIds: depotString,
@@ -323,24 +308,25 @@
Type: "出库" Type: "出库"
}), }),
success: function (res) { success: function (res) {
if(res){ if (res) {
$("#tableData").datagrid('loadData',res); $("#tableData").datagrid('loadData', res);
} }
}, },
//此处添加错误处理 //此处添加错误处理
error:function() { error: function () {
$.messager.alert('查询提示','查询数据后台异常,请稍后再试!','error'); $.messager.alert('查询提示', '查询数据后台异常,请稍后再试!', 'error');
return; return;
} }
}); });
} }
//报表打印 //报表打印
function print() { function print() {
$("#printBtn").off("click").on("click",function(){ $("#printBtn").off("click").on("click", function () {
var path = "<%=path %>"; var path = "<%=path %>";
CreateFormPage('打印报表', $('#tableData'), path); CreateFormPage('打印报表', $('#tableData'), path);
}); });
} }
</script> </script>
</body> </body>
</html> </html>

View File

@@ -1,22 +1,22 @@
<%@page import="com.jsh.util.Tools"%> <%@page import="com.jsh.util.Tools" %>
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%> <%@ page language="java" pageEncoding="utf-8" %>
<% <%
String path = request.getContextPath(); String path = request.getContextPath();
String clientIp = Tools.getLocalIp(request); String clientIp = Tools.getLocalIp(request);
%> %>
<!DOCTYPE html> <!DOCTYPE html>
<html> <html>
<head> <head>
<title>出库汇总</title> <title>出库汇总</title>
<meta charset="utf-8"> <meta charset="utf-8">
<!-- 指定以IE8的方式来渲染 --> <!-- 指定以IE8的方式来渲染 -->
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE8"/> <meta http-equiv="X-UA-Compatible" content="IE=EmulateIE8"/>
<link rel="shortcut icon" href="<%=path%>/images/favicon.ico" type="image/x-icon" /> <link rel="shortcut icon" href="<%=path%>/images/favicon.ico" type="image/x-icon"/>
<script type="text/javascript" src="<%=path %>/js/jquery-1.8.0.min.js"></script> <script type="text/javascript" src="<%=path %>/js/jquery-1.8.0.min.js"></script>
<script type="text/javascript" src="<%=path %>/js/print/print.js"></script> <script type="text/javascript" src="<%=path %>/js/print/print.js"></script>
<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/default/easyui.css"/>
<link rel="stylesheet" type="text/css" href="<%=path %>/js/easyui-1.3.5/themes/icon.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" /> <link type="text/css" rel="stylesheet" href="<%=path %>/css/common.css"/>
<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/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/locale/easyui-lang-zh_CN.js"></script>
<script type="text/javascript" src="<%=path %>/js/My97DatePicker/WdatePicker.js"></script> <script type="text/javascript" src="<%=path %>/js/My97DatePicker/WdatePicker.js"></script>
@@ -24,15 +24,16 @@
<script> <script>
var uid = ${sessionScope.user.id}; var uid = ${sessionScope.user.id};
</script> </script>
</head> </head>
<body> <body>
<!-- 查询 --> <!-- 查询 -->
<div id = "searchPanel" class="easyui-panel" style="padding:10px;" title="查询窗口" iconCls="icon-search" collapsible="true" closable="false"> <div id="searchPanel" class="easyui-panel" style="padding:10px;" title="查询窗口" iconCls="icon-search" collapsible="true"
closable="false">
<table id="searchTable"> <table id="searchTable">
<tr> <tr>
<td>客户:</td> <td>客户:</td>
<td> <td>
<input id="OrganId" name="OrganId" style="width:120px;" /> <input id="OrganId" name="OrganId" style="width:120px;"/>
</td> </td>
<td>&nbsp;</td> <td>&nbsp;</td>
<td>仓库:</td> <td>仓库:</td>
@@ -42,11 +43,13 @@
<td>&nbsp;</td> <td>&nbsp;</td>
<td>单据日期:</td> <td>单据日期:</td>
<td> <td>
<input type="text" name="searchBeginTime" id="searchBeginTime" onClick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'})" class="txt Wdate" style="width:140px;"/> <input type="text" name="searchBeginTime" id="searchBeginTime"
onClick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'})" class="txt Wdate" style="width:140px;"/>
</td> </td>
<td>-</td> <td>-</td>
<td> <td>
<input type="text" name="searchEndTime" id="searchEndTime" onClick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'})" class="txt Wdate" style="width:140px;"/> <input type="text" name="searchEndTime" id="searchEndTime"
onClick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'})" class="txt Wdate" style="width:140px;"/>
</td> </td>
<td>&nbsp;</td> <td>&nbsp;</td>
<td> <td>
@@ -56,28 +59,28 @@
</td> </td>
</tr> </tr>
</table> </table>
</div> </div>
<!-- 数据显示table --> <!-- 数据显示table -->
<div id = "tablePanel" class="easyui-panel" style="padding:1px;top:300px;" title="出库汇总列表" iconCls="icon-list" collapsible="true" closable="false"> <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> <table id="tableData" style="top:300px;border-bottom-color:#FFFFFF"></table>
</div> </div>
<script type="text/javascript"> <script type="text/javascript">
var depotList = null; var depotList = null;
var depotID = null; var depotID = null;
var depotString = ""; //仓库列表 var depotString = ""; //仓库列表
var path = "<%=path %>"; var path = "<%=path %>";
var cusUrl = path + "/supplier/findBySelect_cus.action?UBType=UserCustomer&UBKeyId=" + uid; //客户接口 var cusUrl = path + "/supplier/findBySelect_cus.action?UBType=UserCustomer&UBKeyId=" + uid; //客户接口
//初始化界面 //初始化界面
$(function() $(function () {
{
var thisDate = getNowFormatMonth(); //当前月份 var thisDate = getNowFormatMonth(); //当前月份
var thisDateTime = getNowFormatDateTime(); //当前时间 var thisDateTime = getNowFormatDateTime(); //当前时间
$("#searchBeginTime").val(thisDate + "-01 00:00:00"); $("#searchBeginTime").val(thisDate + "-01 00:00:00");
$("#searchEndTime").val(thisDateTime); $("#searchEndTime").val(thisDateTime);
var userBusinessList=null; var userBusinessList = null;
var userdepot=null; var userdepot = null;
initSupplier(); //初始化客户信息 initSupplier(); //初始化客户信息
initSystemData_UB(); initSystemData_UB();
initSelectInfo_UB(); initSelectInfo_UB();
@@ -90,183 +93,165 @@
}); });
//初始化客户 //初始化客户
function initSupplier(){ function initSupplier() {
$('#OrganId').combobox({ $('#OrganId').combobox({
url: cusUrl, url: cusUrl,
valueField:'id', valueField: 'id',
textField:'supplier', textField: 'supplier',
filter: function(q, row){ filter: function (q, row) {
var opts = $(this).combobox('options'); var opts = $(this).combobox('options');
return row[opts.textField].indexOf(q) >-1; return row[opts.textField].indexOf(q) > -1;
} }
}); });
} }
//初始化系统基础信息 //初始化系统基础信息
function initSystemData_UB(){ function initSystemData_UB() {
$.ajax({ $.ajax({
type:"post", type: "post",
url: "<%=path %>/userBusiness/getBasicData.action", url: "<%=path %>/userBusiness/getBasicData.action",
data: ({ data: ({
KeyId:uid, KeyId: uid,
Type:"UserDepot" Type: "UserDepot"
}), }),
//设置为同步 //设置为同步
async:false, async: false,
dataType: "json", dataType: "json",
success: function (systemInfo) success: function (systemInfo) {
{ if (systemInfo) {
if(systemInfo)
{
userBusinessList = systemInfo.showModel.map.userBusinessList; userBusinessList = systemInfo.showModel.map.userBusinessList;
var msgTip = systemInfo.showModel.msgTip; var msgTip = systemInfo.showModel.msgTip;
if(msgTip == "exceptoin") if (msgTip == "exceptoin") {
{ $.messager.alert('提示', '查找UserBusiness异常,请与管理员联系!', 'error');
$.messager.alert('提示','查找UserBusiness异常,请与管理员联系!','error');
return; return;
} }
} }
else else {
{ userBusinessList = null;
userBusinessList=null;
} }
} }
}); });
} }
//初始化页面选项卡
function initSelectInfo_UB(){
if(userBusinessList !=null) //初始化页面选项卡
{ function initSelectInfo_UB() {
if(userBusinessList.length>0)
{ if (userBusinessList != null) {
if (userBusinessList.length > 0) {
//用户对应的仓库列表 [1][2][3]... //用户对应的仓库列表 [1][2][3]...
userdepot =userBusinessList[0].value; userdepot = userBusinessList[0].value;
} }
} }
} }
//初始化系统基础信息 //初始化系统基础信息
function initSystemData_depot(){ function initSystemData_depot() {
$.ajax({ $.ajax({
type:"post", type: "post",
url: "<%=path %>/depot/getBasicData.action", url: "<%=path %>/depot/getBasicData.action",
//设置为同步 //设置为同步
async:false, async: false,
dataType: "json", dataType: "json",
success: function (systemInfo) success: function (systemInfo) {
{
depotList = systemInfo.showModel.map.depotList; depotList = systemInfo.showModel.map.depotList;
var msgTip = systemInfo.showModel.msgTip; var msgTip = systemInfo.showModel.msgTip;
if(msgTip == "exceptoin") if (msgTip == "exceptoin") {
{ $.messager.alert('提示', '查找系统基础信息异常,请与管理员联系!', 'error');
$.messager.alert('提示','查找系统基础信息异常,请与管理员联系!','error');
return; return;
} }
} }
}); });
} }
//初始化页面选项卡 //初始化页面选项卡
function initSelectInfo_depot(){ function initSelectInfo_depot() {
var options = ""; var options = "";
if(depotList !=null) if (depotList != null) {
{
options = ""; options = "";
for(var i = 0 ;i < depotList.length;i++) for (var i = 0; i < depotList.length; i++) {
{
var depot = depotList[i]; var depot = depotList[i];
if(userdepot!=null) if (userdepot != null) {
{ if (userdepot.indexOf("[" + depot.id + "]") != -1) {
if(userdepot.indexOf("["+depot.id+"]")!=-1)
{
options += '<option value="' + depot.id + '">' + depot.name + '</option>'; options += '<option value="' + depot.id + '">' + depot.name + '</option>';
depotString = depotString + depot.id + ","; depotString = depotString + depot.id + ",";
} }
} }
} }
depotString = depotString.substring(0, depotString.length-1); depotString = depotString.substring(0, depotString.length - 1);
$("#searchProjectId").empty().append('<option value="">全部</option>').append(options); $("#searchProjectId").empty().append('<option value="">全部</option>').append(options);
} }
} }
//初始化表格数据 //初始化表格数据
function initTableData() function initTableData() {
{
$('#tableData').datagrid({ $('#tableData').datagrid({
height:heightInfo, height: heightInfo,
nowrap: false, nowrap: false,
rownumbers: true, rownumbers: true,
//动画效果 //动画效果
animate:false, animate: false,
//选中单行 //选中单行
singleSelect : true, singleSelect: true,
pagination: true, pagination: true,
//交替出现背景 //交替出现背景
striped : true, striped: true,
pageSize: 10, pageSize: 10,
pageList: [10,50,100], pageList: [10, 50, 100],
columns:[[ columns: [[
{ title: '商品名称',field: 'mName',width:150}, {title: '商品名称', field: 'mName', width: 150},
{ title: '商品型号',field: 'Model',width:150}, {title: '商品型号', field: 'Model', width: 150},
{ title: '商品类型',field: 'categoryName',width:120}, {title: '商品类型', field: 'categoryName', width: 120},
{ title: '出库数量',field: 'numSum',width:120}, {title: '出库数量', field: 'numSum', width: 120},
{ title: '出库金额',field: 'priceSum',width:120} {title: '出库金额', field: 'priceSum', width: 120}
]], ]],
onLoadError:function() onLoadError: function () {
{ $.messager.alert('页面加载提示', '页面加载异常,请稍后再试!', 'error');
$.messager.alert('页面加载提示','页面加载异常,请稍后再试!','error');
return; return;
} }
}); });
} }
//初始化键盘enter事件 //初始化键盘enter事件
$(document).keydown(function(event) $(document).keydown(function (event) {
{
//兼容 IE和firefox 事件 //兼容 IE和firefox 事件
var e = window.event || event; var e = window.event || event;
var k = e.keyCode||e.which||e.charCode; var k = e.keyCode || e.which || e.charCode;
//兼容 IE,firefox 兼容 //兼容 IE,firefox 兼容
var obj = e.srcElement ? e.srcElement : e.target; var obj = e.srcElement ? e.srcElement : e.target;
//绑定键盘事件为 id是指定的输入框才可以触发键盘事件 13键盘事件 ---遗留问题 enter键效验 对话框会关闭问题 //绑定键盘事件为 id是指定的输入框才可以触发键盘事件 13键盘事件 ---遗留问题 enter键效验 对话框会关闭问题
if(k == "13"&&(obj.id=="Type"||obj.id=="Name")) if (k == "13" && (obj.id == "Type" || obj.id == "Name")) {
{
$("#savePerson").click(); $("#savePerson").click();
} }
//搜索按钮添加快捷键 //搜索按钮添加快捷键
if(k == "13"&&(obj.id=="searchType")) if (k == "13" && (obj.id == "searchType")) {
{
$("#searchBtn").click(); $("#searchBtn").click();
} }
}); });
//分页信息处理 //分页信息处理
function ininPager() function ininPager() {
{ try {
try
{
var opts = $("#tableData").datagrid('options'); var opts = $("#tableData").datagrid('options');
var pager = $("#tableData").datagrid('getPager'); var pager = $("#tableData").datagrid('getPager');
pager.pagination({ pager.pagination({
onSelectPage:function(pageNum, pageSize) onSelectPage: function (pageNum, pageSize) {
{
opts.pageNumber = pageNum; opts.pageNumber = pageNum;
opts.pageSize = pageSize; opts.pageSize = pageSize;
pager.pagination('refresh', pager.pagination('refresh',
{ {
pageNumber:pageNum, pageNumber: pageNum,
pageSize:pageSize pageSize: pageSize
}); });
showDetails(pageNum,pageSize); showDetails(pageNum, pageSize);
} }
}); });
} }
catch (e) catch (e) {
{ $.messager.alert('异常处理提示', "分页信息异常 : " + e.name + ": " + e.message, 'error');
$.messager.alert('异常处理提示',"分页信息异常 : " + e.name + ": " + e.message,'error');
} }
} }
@@ -278,33 +263,32 @@
//搜索处理 //搜索处理
function search() { function search() {
showDetails(1,initPageSize); showDetails(1, initPageSize);
var opts = $("#tableData").datagrid('options'); var opts = $("#tableData").datagrid('options');
var pager = $("#tableData").datagrid('getPager'); var pager = $("#tableData").datagrid('getPager');
opts.pageNumber = 1; opts.pageNumber = 1;
opts.pageSize = initPageSize; opts.pageSize = initPageSize;
pager.pagination('refresh', pager.pagination('refresh',
{ {
pageNumber:1, pageNumber: 1,
pageSize:initPageSize pageSize: initPageSize
}); });
} }
$("#searchBtn").unbind().bind({ $("#searchBtn").unbind().bind({
click:function() click: function () {
{
search(); search();
} }
}); });
function showDetails(pageNo,pageSize) function showDetails(pageNo, pageSize) {
{
$.ajax({ $.ajax({
type: "post", type: "post",
url: "<%=path %>/depotHead/findInOutMaterialCount.action", url: "<%=path %>/depotHead/findInOutMaterialCount.action",
dataType: "json", dataType: "json",
data: ({ data: ({
pageNo:pageNo, pageNo: pageNo,
pageSize:pageSize, pageSize: pageSize,
OrganId: $('#OrganId').combobox('getValue'), OrganId: $('#OrganId').combobox('getValue'),
ProjectId: $.trim($("#searchProjectId").val()), ProjectId: $.trim($("#searchProjectId").val()),
DepotIds: depotString, DepotIds: depotString,
@@ -313,24 +297,25 @@
Type: "出库" Type: "出库"
}), }),
success: function (res) { success: function (res) {
if(res){ if (res) {
$("#tableData").datagrid('loadData',res); $("#tableData").datagrid('loadData', res);
} }
}, },
//此处添加错误处理 //此处添加错误处理
error:function() { error: function () {
$.messager.alert('查询提示','查询数据后台异常,请稍后再试!','error'); $.messager.alert('查询提示', '查询数据后台异常,请稍后再试!', 'error');
return; return;
} }
}); });
} }
//报表打印 //报表打印
function print() { function print() {
$("#printBtn").off("click").on("click",function(){ $("#printBtn").off("click").on("click", function () {
var path = "<%=path %>"; var path = "<%=path %>";
CreateFormPage('打印报表', $('#tableData'), path); CreateFormPage('打印报表', $('#tableData'), path);
}); });
} }
</script> </script>
</body> </body>
</html> </html>

View File

@@ -1,35 +1,37 @@
<%@page import="com.jsh.util.Tools"%> <%@page import="com.jsh.util.Tools" %>
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%> <%@ page language="java" pageEncoding="utf-8" %>
<% <%
String path = request.getContextPath(); String path = request.getContextPath();
String clientIp = Tools.getLocalIp(request); String clientIp = Tools.getLocalIp(request);
%> %>
<!DOCTYPE html> <!DOCTYPE html>
<html> <html>
<head> <head>
<title>销售统计</title> <title>销售统计</title>
<meta charset="utf-8"> <meta charset="utf-8">
<!-- 指定以IE8的方式来渲染 --> <!-- 指定以IE8的方式来渲染 -->
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE8"/> <meta http-equiv="X-UA-Compatible" content="IE=EmulateIE8"/>
<link rel="shortcut icon" href="<%=path%>/images/favicon.ico" type="image/x-icon" /> <link rel="shortcut icon" href="<%=path%>/images/favicon.ico" type="image/x-icon"/>
<script type="text/javascript" src="<%=path %>/js/jquery-1.8.0.min.js"></script> <script type="text/javascript" src="<%=path %>/js/jquery-1.8.0.min.js"></script>
<script type="text/javascript" src="<%=path %>/js/print/print.js"></script> <script type="text/javascript" src="<%=path %>/js/print/print.js"></script>
<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/default/easyui.css"/>
<link rel="stylesheet" type="text/css" href="<%=path %>/js/easyui-1.3.5/themes/icon.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" /> <link type="text/css" rel="stylesheet" href="<%=path %>/css/common.css"/>
<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/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/locale/easyui-lang-zh_CN.js"></script>
<script type="text/javascript" src="<%=path %>/js/My97DatePicker/WdatePicker.js"></script> <script type="text/javascript" src="<%=path %>/js/My97DatePicker/WdatePicker.js"></script>
<script type="text/javascript" src="<%=path %>/js/common/common.js"></script> <script type="text/javascript" src="<%=path %>/js/common/common.js"></script>
</head> </head>
<body> <body>
<!-- 查询 --> <!-- 查询 -->
<div id = "searchPanel" class="easyui-panel" style="padding:10px;" title="查询窗口" iconCls="icon-search" collapsible="true" closable="false"> <div id="searchPanel" class="easyui-panel" style="padding:10px;" title="查询窗口" iconCls="icon-search" collapsible="true"
closable="false">
<table id="searchTable"> <table id="searchTable">
<tr> <tr>
<td>月份:</td> <td>月份:</td>
<td> <td>
<input type="text" name="searchMonth" id="searchMonth" onClick="WdatePicker({dateFmt:'yyyy-MM'})" class="txt Wdate" style="width:180px;"/> <input type="text" name="searchMonth" id="searchMonth" onClick="WdatePicker({dateFmt:'yyyy-MM'})"
class="txt Wdate" style="width:180px;"/>
</td> </td>
<td>&nbsp;</td> <td>&nbsp;</td>
<td>&nbsp;</td> <td>&nbsp;</td>
@@ -41,19 +43,19 @@
<td><span class="tip">注:此处包含零售+批发销售</span></td> <td><span class="tip">注:此处包含零售+批发销售</span></td>
</tr> </tr>
</table> </table>
</div> </div>
<!-- 数据显示table --> <!-- 数据显示table -->
<div id = "tablePanel" class="easyui-panel" style="padding:1px;top:300px;" title="销售统计列表" iconCls="icon-list" collapsible="true" closable="false"> <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> <table id="tableData" style="top:300px;border-bottom-color:#FFFFFF"></table>
</div> </div>
<script type="text/javascript"> <script type="text/javascript">
var mPropertyList = ""; //商品属性列表 var mPropertyList = ""; //商品属性列表
//初始化界面 //初始化界面
$(function() $(function () {
{ $("#searchTable .tip").css("padding-left", "15px").css("color", "red");
$("#searchTable .tip").css("padding-left","15px").css("color","red");
var thisDate = getNowFormatMonth(); //当前月份 var thisDate = getNowFormatMonth(); //当前月份
$("#searchMonth").val(thisDate); $("#searchMonth").val(thisDate);
initMProperty(); //初始化商品属性 initMProperty(); //初始化商品属性
@@ -64,7 +66,7 @@
}); });
//初始化商品属性 //初始化商品属性
function initMProperty(){ function initMProperty() {
$.ajax({ $.ajax({
type: "post", type: "post",
url: "<%=path %>/materialProperty/findBy.action", url: "<%=path %>/materialProperty/findBy.action",
@@ -72,198 +74,186 @@
success: function (res) { success: function (res) {
if (res && res.rows) { if (res && res.rows) {
var thisRows = res.rows; var thisRows = res.rows;
for(var i=0; i < thisRows.length; i++) { for (var i = 0; i < thisRows.length; i++) {
if(thisRows[i].enabled){ if (thisRows[i].enabled) {
mPropertyList += thisRows[i].nativeName +","; mPropertyList += thisRows[i].nativeName + ",";
} }
} }
if(mPropertyList){ if (mPropertyList) {
mPropertyList = mPropertyList.substring(0,mPropertyList.length-1); mPropertyList = mPropertyList.substring(0, mPropertyList.length - 1);
} }
} }
}, },
//此处添加错误处理 //此处添加错误处理
error:function() { error: function () {
$.messager.alert('查询提示','查询信息异常,请稍后再试!','error'); $.messager.alert('查询提示', '查询信息异常,请稍后再试!', 'error');
return; return;
} }
}); });
} }
//初始化表格数据 //初始化表格数据
function initTableData() function initTableData() {
{
$('#tableData').datagrid({ $('#tableData').datagrid({
height:heightInfo, height: heightInfo,
nowrap: false, nowrap: false,
rownumbers: true, rownumbers: true,
//动画效果 //动画效果
animate:false, animate: false,
//选中单行 //选中单行
singleSelect : true, singleSelect: true,
pagination: true, pagination: true,
//交替出现背景 //交替出现背景
striped : true, striped: true,
//loadFilter: pagerFilter, //loadFilter: pagerFilter,
pageSize: 10, pageSize: 10,
pageList: [10,50,100], pageList: [10, 50, 100],
columns:[[ columns: [[
{ title: '名称',field: 'MaterialName',width:60}, {title: '名称', field: 'MaterialName', width: 60},
{ title: '型号',field: 'MaterialModel',width:80}, {title: '型号', field: 'MaterialModel', width: 80},
{ title: '扩展信息',field: 'MaterialOther',width:150}, {title: '扩展信息', field: 'MaterialOther', width: 150},
{ title: '单位',field: 'MaterialUnit',width:80}, {title: '单位', field: 'MaterialUnit', width: 80},
{ title: '销售数量',field: 'OutSum',width:60}, {title: '销售数量', field: 'OutSum', width: 60},
{ title: '销售金额',field: 'OutSumPrice',width:60}, {title: '销售金额', field: 'OutSumPrice', width: 60},
{ title: '退货数量',field: 'InSum',width:60}, {title: '退货数量', field: 'InSum', width: 60},
{ title: '退货金额',field: 'InSumPrice',width:60} {title: '退货金额', field: 'InSumPrice', width: 60}
]], ]],
onLoadError:function() onLoadError: function () {
{ $.messager.alert('页面加载提示', '页面加载异常,请稍后再试!', 'error');
$.messager.alert('页面加载提示','页面加载异常,请稍后再试!','error');
return; return;
} }
}); });
} }
//初始化键盘enter事件 //初始化键盘enter事件
$(document).keydown(function(event) $(document).keydown(function (event) {
{
//兼容 IE和firefox 事件 //兼容 IE和firefox 事件
var e = window.event || event; var e = window.event || event;
var k = e.keyCode||e.which||e.charCode; var k = e.keyCode || e.which || e.charCode;
//兼容 IE,firefox 兼容 //兼容 IE,firefox 兼容
var obj = e.srcElement ? e.srcElement : e.target; var obj = e.srcElement ? e.srcElement : e.target;
//绑定键盘事件为 id是指定的输入框才可以触发键盘事件 13键盘事件 ---遗留问题 enter键效验 对话框会关闭问题 //绑定键盘事件为 id是指定的输入框才可以触发键盘事件 13键盘事件 ---遗留问题 enter键效验 对话框会关闭问题
//搜索按钮添加快捷键 //搜索按钮添加快捷键
if(k == "13"&&(obj.id=="searchMonth")) if (k == "13" && (obj.id == "searchMonth")) {
{
$("#searchBtn").click(); $("#searchBtn").click();
} }
}); });
//分页信息处理 //分页信息处理
function ininPager() function ininPager() {
{ try {
try
{
var opts = $("#tableData").datagrid('options'); var opts = $("#tableData").datagrid('options');
var pager = $("#tableData").datagrid('getPager'); var pager = $("#tableData").datagrid('getPager');
pager.pagination({ pager.pagination({
onSelectPage:function(pageNum, pageSize) onSelectPage: function (pageNum, pageSize) {
{
opts.pageNumber = pageNum; opts.pageNumber = pageNum;
opts.pageSize = pageSize; opts.pageSize = pageSize;
pager.pagination('refresh', pager.pagination('refresh',
{ {
pageNumber:pageNum, pageNumber: pageNum,
pageSize:pageSize pageSize: pageSize
}); });
showDetails(pageNum,pageSize); showDetails(pageNum, pageSize);
} }
}); });
} }
catch (e) catch (e) {
{ $.messager.alert('异常处理提示', "分页信息异常 : " + e.name + ": " + e.message, 'error');
$.messager.alert('异常处理提示',"分页信息异常 : " + e.name + ": " + e.message,'error');
} }
} }
//搜索处理 //搜索处理
function search() { function search() {
showDetails(1,initPageSize); showDetails(1, initPageSize);
var opts = $("#tableData").datagrid('options'); var opts = $("#tableData").datagrid('options');
var pager = $("#tableData").datagrid('getPager'); var pager = $("#tableData").datagrid('getPager');
opts.pageNumber = 1; opts.pageNumber = 1;
opts.pageSize = initPageSize; opts.pageSize = initPageSize;
pager.pagination('refresh', pager.pagination('refresh',
{ {
pageNumber:1, pageNumber: 1,
pageSize:initPageSize pageSize: initPageSize
}); });
} }
$("#searchBtn").unbind().bind({ $("#searchBtn").unbind().bind({
click:function() { click: function () {
search(); search();
} }
}); });
function showDetails(pageNo,pageSize) function showDetails(pageNo, pageSize) {
{
$.ajax({ $.ajax({
type:"post", type: "post",
url: "<%=path %>/depotHead/findByMonth.action", url: "<%=path %>/depotHead/findByMonth.action",
dataType: "json", dataType: "json",
data: ({ data: ({
MonthTime:$("#searchMonth").val() MonthTime: $("#searchMonth").val()
}), }),
success: function (res) success: function (res) {
{
var HeadIds = res.HeadIds; var HeadIds = res.HeadIds;
if(HeadIds) { if (HeadIds) {
//获取排序后的产品ID //获取排序后的产品ID
$.ajax({ $.ajax({
type:"post", type: "post",
url: "<%=path %>/material/findByOrder.action", url: "<%=path %>/material/findByOrder.action",
dataType: "json", dataType: "json",
success: function (resNew) success: function (resNew) {
{
var MIds = resNew.mIds; var MIds = resNew.mIds;
if(MIds) { if (MIds) {
$.ajax({ $.ajax({
type:"post", type: "post",
url: "<%=path %>/depotItem/saleOut.action", url: "<%=path %>/depotItem/saleOut.action",
dataType: "json", dataType: "json",
data: ({ data: ({
pageNo:pageNo, pageNo: pageNo,
pageSize:pageSize, pageSize: pageSize,
MonthTime:$("#searchMonth").val(), MonthTime: $("#searchMonth").val(),
HeadIds:HeadIds, HeadIds: HeadIds,
MaterialIds:MIds, MaterialIds: MIds,
mpList: mPropertyList mpList: mPropertyList
}), }),
success: function (data) success: function (data) {
{ $("#tableData").datagrid('loadData', data);
$("#tableData").datagrid('loadData',data);
}, },
//此处添加错误处理 //此处添加错误处理
error:function() error: function () {
{ $.messager.alert('查询提示', '查询数据后台异常,请稍后再试!', 'error');
$.messager.alert('查询提示','查询数据后台异常,请稍后再试!','error');
return; return;
} }
}); });
} }
else { else {
$.messager.alert('查询提示','本月无数据!','error'); $.messager.alert('查询提示', '本月无数据!', 'error');
} }
}, },
//此处添加错误处理 //此处添加错误处理
error:function() error: function () {
{ $.messager.alert('查询提示', '查询数据后台异常,请稍后再试!', 'error');
$.messager.alert('查询提示','查询数据后台异常,请稍后再试!','error');
return; return;
} }
}); });
} }
else { else {
$.messager.alert('查询提示','本月无数据!','error'); $.messager.alert('查询提示', '本月无数据!', 'error');
} }
}, },
//此处添加错误处理 //此处添加错误处理
error:function() error: function () {
{ $.messager.alert('查询提示', '查询数据后台异常,请稍后再试!', 'error');
$.messager.alert('查询提示','查询数据后台异常,请稍后再试!','error');
return; return;
} }
}); });
} }
//报表打印 //报表打印
function print() { function print() {
$("#printBtn").off("click").on("click",function(){ $("#printBtn").off("click").on("click", function () {
var path = "<%=path %>"; var path = "<%=path %>";
CreateFormPage('打印报表', $('#tableData'), path); CreateFormPage('打印报表', $('#tableData'), path);
}); });
} }
</script> </script>
</body> </body>
</html> </html>

View File

@@ -1,22 +1,22 @@
<%@page import="com.jsh.util.Tools"%> <%@page import="com.jsh.util.Tools" %>
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%> <%@ page language="java" pageEncoding="utf-8" %>
<% <%
String path = request.getContextPath(); String path = request.getContextPath();
String clientIp = Tools.getLocalIp(request); String clientIp = Tools.getLocalIp(request);
%> %>
<!DOCTYPE html> <!DOCTYPE html>
<html> <html>
<head> <head>
<title>供应商对账</title> <title>供应商对账</title>
<meta charset="utf-8"> <meta charset="utf-8">
<!-- 指定以IE8的方式来渲染 --> <!-- 指定以IE8的方式来渲染 -->
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE8"/> <meta http-equiv="X-UA-Compatible" content="IE=EmulateIE8"/>
<link rel="shortcut icon" href="<%=path%>/images/favicon.ico" type="image/x-icon" /> <link rel="shortcut icon" href="<%=path%>/images/favicon.ico" type="image/x-icon"/>
<script type="text/javascript" src="<%=path %>/js/jquery-1.8.0.min.js"></script> <script type="text/javascript" src="<%=path %>/js/jquery-1.8.0.min.js"></script>
<script type="text/javascript" src="<%=path %>/js/print/print.js"></script> <script type="text/javascript" src="<%=path %>/js/print/print.js"></script>
<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/default/easyui.css"/>
<link rel="stylesheet" type="text/css" href="<%=path %>/js/easyui-1.3.5/themes/icon.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" /> <link type="text/css" rel="stylesheet" href="<%=path %>/css/common.css"/>
<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/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/locale/easyui-lang-zh_CN.js"></script>
<script type="text/javascript" src="<%=path %>/js/common/outlook_in.js"></script> <script type="text/javascript" src="<%=path %>/js/common/outlook_in.js"></script>
@@ -25,24 +25,27 @@
<script> <script>
var uid = ${sessionScope.user.id}; var uid = ${sessionScope.user.id};
</script> </script>
</head> </head>
<body> <body>
<!-- 查询 --> <!-- 查询 -->
<div id = "searchPanel" class="easyui-panel" style="padding:10px;" title="查询窗口" iconCls="icon-search" collapsible="true" closable="false"> <div id="searchPanel" class="easyui-panel" style="padding:10px;" title="查询窗口" iconCls="icon-search" collapsible="true"
closable="false">
<table id="searchTable"> <table id="searchTable">
<tr> <tr>
<td>供应商:</td> <td>供应商:</td>
<td> <td>
<input id="OrganId" name="OrganId" style="width:120px;" /> <input id="OrganId" name="OrganId" style="width:120px;"/>
</td> </td>
<td>&nbsp;</td> <td>&nbsp;</td>
<td>单据日期:</td> <td>单据日期:</td>
<td> <td>
<input type="text" name="searchBeginTime" id="searchBeginTime" onClick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'})" class="txt Wdate" style="width:140px;"/> <input type="text" name="searchBeginTime" id="searchBeginTime"
onClick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'})" class="txt Wdate" style="width:140px;"/>
</td> </td>
<td>-</td> <td>-</td>
<td> <td>
<input type="text" name="searchEndTime" id="searchEndTime" onClick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'})" class="txt Wdate" style="width:140px;"/> <input type="text" name="searchEndTime" id="searchEndTime"
onClick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'})" class="txt Wdate" style="width:140px;"/>
</td> </td>
<td>&nbsp;</td> <td>&nbsp;</td>
<td> <td>
@@ -57,19 +60,19 @@
</td> </td>
</tr> </tr>
</table> </table>
</div> </div>
<!-- 数据显示table --> <!-- 数据显示table -->
<div id = "tablePanel" class="easyui-panel" style="padding:1px;top:300px;" title="供应商对账列表" iconCls="icon-list" collapsible="true" closable="false"> <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> <table id="tableData" style="top:300px;border-bottom-color:#FFFFFF"></table>
</div> </div>
<script type="text/javascript"> <script type="text/javascript">
var path = "<%=path %>"; var path = "<%=path %>";
var supUrl = path + "/supplier/findBySelect_sup.action"; //供应商接口 var supUrl = path + "/supplier/findBySelect_sup.action"; //供应商接口
//初始化界面 //初始化界面
$(function() $(function () {
{
var thisDate = getNowFormatMonth(); //当前月份 var thisDate = getNowFormatMonth(); //当前月份
var thisDateTime = getNowFormatDateTime(); //当前时间 var thisDateTime = getNowFormatDateTime(); //当前时间
$("#searchBeginTime").val(thisDate + "-01 00:00:00"); $("#searchBeginTime").val(thisDate + "-01 00:00:00");
@@ -83,99 +86,92 @@
//初始化供应商 //初始化供应商
function initSupplier(){ function initSupplier() {
$('#OrganId').combobox({ $('#OrganId').combobox({
url: supUrl, url: supUrl,
valueField:'id', valueField: 'id',
textField:'supplier', textField: 'supplier',
filter: function(q, row){ filter: function (q, row) {
var opts = $(this).combobox('options'); var opts = $(this).combobox('options');
return row[opts.textField].indexOf(q) >-1; return row[opts.textField].indexOf(q) > -1;
} }
}); });
} }
//初始化表格数据 //初始化表格数据
function initTableData() function initTableData() {
{
$('#tableData').datagrid({ $('#tableData').datagrid({
height:heightInfo, height: heightInfo,
nowrap: false, nowrap: false,
rownumbers: true, rownumbers: true,
//动画效果 //动画效果
animate:false, animate: false,
//选中单行 //选中单行
singleSelect : true, singleSelect: true,
pagination: true, pagination: true,
//交替出现背景 //交替出现背景
striped : true, striped: true,
pageSize: 10, pageSize: 10,
pageList: [10,50,100], pageList: [10, 50, 100],
columns:[[ columns: [[
{ title: '单据编号',field: 'number',width:140, {
title: '单据编号', field: 'number', width: 140,
formatter: function (value, row) { formatter: function (value, row) {
return "<a class='n-link' onclick=\"newTab('" + row.number + "','../materials/bill_detail.jsp?n=" + row.number + "&type=" + row.type + "','')\">" return "<a class='n-link' onclick=\"newTab('" + row.number + "','../materials/bill_detail.jsp?n=" + row.number + "&type=" + row.type + "','')\">"
+ row.number + "</a>"; + row.number + "</a>";
} }
}, },
{ title: '类型',field: 'type',width:100}, {title: '类型', field: 'type', width: 100},
{ title: '单位名称',field: 'supplierName',width:200}, {title: '单位名称', field: 'supplierName', width: 200},
{ title: '单据金额',field: 'discountLastMoney',width:80}, {title: '单据金额', field: 'discountLastMoney', width: 80},
{ title: '实际支付',field: 'changeAmount',width:80}, {title: '实际支付', field: 'changeAmount', width: 80},
{ title: '本期变化',field: 'allPrice',width:80}, {title: '本期变化', field: 'allPrice', width: 80},
{ title: '单据日期',field: 'operTime',width:140} {title: '单据日期', field: 'operTime', width: 140}
]], ]],
onLoadError:function() onLoadError: function () {
{ $.messager.alert('页面加载提示', '页面加载异常,请稍后再试!', 'error');
$.messager.alert('页面加载提示','页面加载异常,请稍后再试!','error');
return; return;
} }
}); });
} }
//初始化键盘enter事件 //初始化键盘enter事件
$(document).keydown(function(event) $(document).keydown(function (event) {
{
//兼容 IE和firefox 事件 //兼容 IE和firefox 事件
var e = window.event || event; var e = window.event || event;
var k = e.keyCode||e.which||e.charCode; var k = e.keyCode || e.which || e.charCode;
//兼容 IE,firefox 兼容 //兼容 IE,firefox 兼容
var obj = e.srcElement ? e.srcElement : e.target; var obj = e.srcElement ? e.srcElement : e.target;
//绑定键盘事件为 id是指定的输入框才可以触发键盘事件 13键盘事件 ---遗留问题 enter键效验 对话框会关闭问题 //绑定键盘事件为 id是指定的输入框才可以触发键盘事件 13键盘事件 ---遗留问题 enter键效验 对话框会关闭问题
if(k == "13"&&(obj.id=="Type"||obj.id=="Name")) if (k == "13" && (obj.id == "Type" || obj.id == "Name")) {
{
$("#savePerson").click(); $("#savePerson").click();
} }
//搜索按钮添加快捷键 //搜索按钮添加快捷键
if(k == "13"&&(obj.id=="searchType")) if (k == "13" && (obj.id == "searchType")) {
{
$("#searchBtn").click(); $("#searchBtn").click();
} }
}); });
//分页信息处理 //分页信息处理
function ininPager() function ininPager() {
{ try {
try
{
var opts = $("#tableData").datagrid('options'); var opts = $("#tableData").datagrid('options');
var pager = $("#tableData").datagrid('getPager'); var pager = $("#tableData").datagrid('getPager');
pager.pagination({ pager.pagination({
onSelectPage:function(pageNum, pageSize) onSelectPage: function (pageNum, pageSize) {
{
opts.pageNumber = pageNum; opts.pageNumber = pageNum;
opts.pageSize = pageSize; opts.pageSize = pageSize;
pager.pagination('refresh', pager.pagination('refresh',
{ {
pageNumber:pageNum, pageNumber: pageNum,
pageSize:pageSize pageSize: pageSize
}); });
showDetails(pageNum,pageSize); showDetails(pageNum, pageSize);
} }
}); });
} }
catch (e) catch (e) {
{ $.messager.alert('异常处理提示', "分页信息异常 : " + e.name + ": " + e.message, 'error');
$.messager.alert('异常处理提示',"分页信息异常 : " + e.name + ": " + e.message,'error');
} }
} }
@@ -187,107 +183,106 @@
//搜索处理 //搜索处理
function search() { function search() {
showDetails(1,initPageSize); showDetails(1, initPageSize);
var opts = $("#tableData").datagrid('options'); var opts = $("#tableData").datagrid('options');
var pager = $("#tableData").datagrid('getPager'); var pager = $("#tableData").datagrid('getPager');
opts.pageNumber = 1; opts.pageNumber = 1;
opts.pageSize = initPageSize; opts.pageSize = initPageSize;
pager.pagination('refresh', pager.pagination('refresh',
{ {
pageNumber:1, pageNumber: 1,
pageSize:initPageSize pageSize: initPageSize
}); });
} }
$("#searchBtn").unbind().bind({ $("#searchBtn").unbind().bind({
click:function() click: function () {
{
search(); search();
} }
}); });
function showDetails(pageNo,pageSize) function showDetails(pageNo, pageSize) {
{
$.ajax({ $.ajax({
type: "post", type: "post",
url: "<%=path %>/depotHead/findStatementAccount.action", url: "<%=path %>/depotHead/findStatementAccount.action",
dataType: "json", dataType: "json",
data: ({ data: ({
pageNo:pageNo, pageNo: pageNo,
pageSize:pageSize, pageSize: pageSize,
BeginTime: $("#searchBeginTime").val(), BeginTime: $("#searchBeginTime").val(),
EndTime: $("#searchEndTime").val(), EndTime: $("#searchEndTime").val(),
OrganId: $('#OrganId').combobox('getValue'), OrganId: $('#OrganId').combobox('getValue'),
supType: "供应商" supType: "供应商"
}), }),
success: function (res) { success: function (res) {
if(res){ if (res) {
$("#tableData").datagrid('loadData',res); $("#tableData").datagrid('loadData', res);
//如果选择了单位信息,就进行计算期初和期末 //如果选择了单位信息,就进行计算期初和期末
var supplierId = $('#OrganId').combobox('getValue'); var supplierId = $('#OrganId').combobox('getValue');
if(supplierId) { if (supplierId) {
//先查找期初信息 //先查找期初信息
var beginNeedGet = 0; var beginNeedGet = 0;
var beginNeedPay = 0; var beginNeedPay = 0;
$.ajax({ $.ajax({
type:"post", type: "post",
url: "<%=path %>/supplier/findById.action", url: "<%=path %>/supplier/findById.action",
dataType: "json", dataType: "json",
async: false, async: false,
data: ({ data: ({
supplierID: supplierId supplierID: supplierId
}), }),
success: function(res){ success: function (res) {
if(res && res.rows && res.rows[0]) { if (res && res.rows && res.rows[0]) {
if(res.rows[0].BeginNeedGet) { if (res.rows[0].BeginNeedGet) {
beginNeedGet = res.rows[0].BeginNeedGet; beginNeedGet = res.rows[0].BeginNeedGet;
} }
if(res.rows[0].BeginNeedPay) { if (res.rows[0].BeginNeedPay) {
beginNeedPay = res.rows[0].BeginNeedPay; beginNeedPay = res.rows[0].BeginNeedPay;
} }
//显示期初结存 //显示期初结存
var searchBeginTime = $("#searchBeginTime").val(); //开始时间 var searchBeginTime = $("#searchBeginTime").val(); //开始时间
$.ajax({ $.ajax({
type:"post", type: "post",
url: "<%=path %>/depotHead/findTotalPay.action", url: "<%=path %>/depotHead/findTotalPay.action",
dataType: "json", dataType: "json",
async: false, async: false,
data: ({ data: ({
supplierId: supplierId, supplierId: supplierId,
EndTime:searchBeginTime, EndTime: searchBeginTime,
supType: "vendor" supType: "vendor"
}), }),
success: function(res){ success: function (res) {
if(res) { if (res) {
var moneyA = res.getAllMoney.toFixed(2)-0; var moneyA = res.getAllMoney.toFixed(2) - 0;
$.ajax({ $.ajax({
type:"post", type: "post",
url: "<%=path %>/accountHead/findTotalPay.action", url: "<%=path %>/accountHead/findTotalPay.action",
dataType: "json", dataType: "json",
async: false, async: false,
data: ({ data: ({
supplierId: supplierId, supplierId: supplierId,
EndTime:searchBeginTime, EndTime: searchBeginTime,
supType: "vendor" supType: "vendor"
}), }),
success: function(res){ success: function (res) {
if(res) { if (res) {
var moneyB = res.getAllMoney.toFixed(2)-0; var moneyB = res.getAllMoney.toFixed(2) - 0;
var money = moneyA+moneyB; var money = moneyA + moneyB;
var moneyBeginNeedGet = beginNeedGet-0; //期初应收 var moneyBeginNeedGet = beginNeedGet - 0; //期初应收
var moneyBeginNeedPay = beginNeedPay-0; //期初应付 var moneyBeginNeedPay = beginNeedPay - 0; //期初应付
money = (money + moneyBeginNeedPay - moneyBeginNeedGet).toFixed(2); money = (money + moneyBeginNeedPay - moneyBeginNeedGet).toFixed(2);
$(".first-total").text(money); //期初结存 $(".first-total").text(money); //期初结存
} }
}, },
error: function(){ error: function () {
$.messager.alert('提示','网络异常请稍后再试!','error'); $.messager.alert('提示', '网络异常请稍后再试!', 'error');
return; return;
} }
}); });
} }
}, },
error: function(){ error: function () {
$.messager.alert('提示','网络异常请稍后再试!','error'); $.messager.alert('提示', '网络异常请稍后再试!', 'error');
return; return;
} }
}) })
@@ -295,54 +290,54 @@
//显示期末合计 //显示期末合计
var searchEndTime = $("#searchEndTime").val(); //结束时间 var searchEndTime = $("#searchEndTime").val(); //结束时间
$.ajax({ $.ajax({
type:"post", type: "post",
url: "<%=path %>/depotHead/findTotalPay.action", url: "<%=path %>/depotHead/findTotalPay.action",
dataType: "json", dataType: "json",
async: false, async: false,
data: ({ data: ({
supplierId: supplierId, supplierId: supplierId,
EndTime:searchEndTime, EndTime: searchEndTime,
supType: "vendor" supType: "vendor"
}), }),
success: function(res){ success: function (res) {
if(res) { if (res) {
var moneyA = res.getAllMoney.toFixed(2)-0; var moneyA = res.getAllMoney.toFixed(2) - 0;
$.ajax({ $.ajax({
type:"post", type: "post",
url: "<%=path %>/accountHead/findTotalPay.action", url: "<%=path %>/accountHead/findTotalPay.action",
dataType: "json", dataType: "json",
async: false, async: false,
data: ({ data: ({
supplierId: supplierId, supplierId: supplierId,
EndTime:searchEndTime, EndTime: searchEndTime,
supType: "vendor" supType: "vendor"
}), }),
success: function(res){ success: function (res) {
if(res) { if (res) {
var moneyB = res.getAllMoney.toFixed(2)-0; var moneyB = res.getAllMoney.toFixed(2) - 0;
var money = moneyA+moneyB; var money = moneyA + moneyB;
var moneyBeginNeedGet = beginNeedGet-0; //期初应收 var moneyBeginNeedGet = beginNeedGet - 0; //期初应收
var moneyBeginNeedPay = beginNeedPay-0; //期初应付 var moneyBeginNeedPay = beginNeedPay - 0; //期初应付
money = (money + moneyBeginNeedPay - moneyBeginNeedGet).toFixed(2); money = (money + moneyBeginNeedPay - moneyBeginNeedGet).toFixed(2);
$(".last-total").text(money); //期末合计 $(".last-total").text(money); //期末合计
} }
}, },
error: function(){ error: function () {
$.messager.alert('提示','网络异常请稍后再试!','error'); $.messager.alert('提示', '网络异常请稍后再试!', 'error');
return; return;
} }
}); });
} }
}, },
error: function(){ error: function () {
$.messager.alert('提示','网络异常请稍后再试!','error'); $.messager.alert('提示', '网络异常请稍后再试!', 'error');
return; return;
} }
}) })
} }
}, },
error: function(){ error: function () {
$.messager.alert('提示','网络异常请稍后再试!','error'); $.messager.alert('提示', '网络异常请稍后再试!', 'error');
return; return;
} }
}); });
@@ -350,19 +345,20 @@
} }
}, },
//此处添加错误处理 //此处添加错误处理
error:function() { error: function () {
$.messager.alert('查询提示','查询数据后台异常,请稍后再试!','error'); $.messager.alert('查询提示', '查询数据后台异常,请稍后再试!', 'error');
return; return;
} }
}); });
} }
//报表打印 //报表打印
function print() { function print() {
$("#printBtn").off("click").on("click",function(){ $("#printBtn").off("click").on("click", function () {
var path = "<%=path %>"; var path = "<%=path %>";
CreateFormPage('打印报表', $('#tableData'), path); CreateFormPage('打印报表', $('#tableData'), path);
}); });
} }
</script> </script>
</body> </body>
</html> </html>

View File

@@ -1,42 +1,48 @@
<%@page import="com.jsh.util.Tools"%> <%@page import="com.jsh.util.Tools" %>
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%> <%@ page language="java" pageEncoding="utf-8" %>
<% <%
String path = request.getContextPath(); String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/"; String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + path + "/";
String clientIp = Tools.getLocalIp(request); String clientIp = Tools.getLocalIp(request);
%> %>
<!DOCTYPE html> <!DOCTYPE html>
<html> <html>
<head> <head>
<title>个人资料</title> <title>个人资料</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<!-- 指定以IE8的方式来渲染 --> <!-- 指定以IE8的方式来渲染 -->
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE8"/> <meta http-equiv="X-UA-Compatible" content="IE=EmulateIE8"/>
<link rel="shortcut icon" href="<%=path%>/images/favicon.ico" type="image/x-icon" /> <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/default/easyui.css"/>
<link rel="stylesheet" type="text/css" href="<%=path %>/js/easyui-1.3.5/themes/icon.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/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/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/locale/easyui-lang-zh_CN.js"></script>
<script type="text/javascript" src="<%=path %>/js/common/common.js"></script> <script type="text/javascript" src="<%=path %>/js/common/common.js"></script>
</head> </head>
<body> <body>
<div id="userDlg" class="easyui-panel" title="修改密码" style="height:370px;background-color:#EAF2FD; " <div id="userDlg" class="easyui-panel" title="修改密码" style="height:370px;background-color:#EAF2FD; "
iconCls="icon-unlock" collapsible="true" closable="false"> iconCls="icon-unlock" collapsible="true" closable="false">
<form id="passwordFM" method="post" novalidate> <form id="passwordFM" method="post" novalidate>
<div class="fitem" style="padding:10px"> <div class="fitem" style="padding:10px">
<label id="passwordLabel">原始密码&nbsp;&nbsp;</label> <label id="passwordLabel">原始密码&nbsp;&nbsp;</label>
<input type="password" name="orgpassword" id="orgpassword" class="easyui-validatebox" data-options="required:true,validType:'length[5,20]'" style="width: 230px;height: 20px" missingMessage="请输入原始密码"/> <input type="password" name="orgpassword" id="orgpassword" class="easyui-validatebox"
data-options="required:true,validType:'length[5,20]'" style="width: 230px;height: 20px"
missingMessage="请输入原始密码"/>
<span id="orgTipMsg"></span> <span id="orgTipMsg"></span>
</div> </div>
<div class="fitem" style="padding:10px"> <div class="fitem" style="padding:10px">
<label id="newPassword">重设密码&nbsp;&nbsp;</label> <label id="newPassword">重设密码&nbsp;&nbsp;</label>
<input type="password" name="password" id="password" class="easyui-validatebox" data-options="required:true,validType:'length[5,20]'" style="width: 230px;height: 20px" missingMessage="请填写新密码"/> <input type="password" name="password" id="password" class="easyui-validatebox"
data-options="required:true,validType:'length[5,20]'" style="width: 230px;height: 20px"
missingMessage="请填写新密码"/>
<span id="orgTipMsg"></span> <span id="orgTipMsg"></span>
</div> </div>
<div class="fitem" style="padding:10px"> <div class="fitem" style="padding:10px">
<label id="repasswordLabel">再输一遍&nbsp;&nbsp;</label> <label id="repasswordLabel">再输一遍&nbsp;&nbsp;</label>
<input type="password" name="repassword" id="repassword" class="easyui-validatebox" style="width: 230px;height: 20px" required="true" class="easyui-validatebox" validType="equals['#password']" missingMessage="请再次填写新密码" invalidMessage="两次密码输入不一致"/> <input type="password" name="repassword" id="repassword" class="easyui-validatebox"
style="width: 230px;height: 20px" required="true" class="easyui-validatebox"
validType="equals['#password']" missingMessage="请再次填写新密码" invalidMessage="两次密码输入不一致"/>
<span id="tipMsg"></span> <span id="tipMsg"></span>
</div> </div>
<input type="hidden" name="clientIp" id="clientIp" value="<%=clientIp %>"/> <input type="hidden" name="clientIp" id="clientIp" value="<%=clientIp %>"/>
@@ -46,75 +52,68 @@
<a href="javascript:void(0)" id="savepassword" class="easyui-linkbutton" iconCls="icon-save">保存</a> <a href="javascript:void(0)" id="savepassword" class="easyui-linkbutton" iconCls="icon-save">保存</a>
<a href="javascript:void(0)" id="cancelpassword" class="easyui-linkbutton" iconCls="icon-redo">重置</a> <a href="javascript:void(0)" id="cancelpassword" class="easyui-linkbutton" iconCls="icon-redo">重置</a>
</div> </div>
</div> </div>
<script type="text/javascript"> <script type="text/javascript">
//初始化界面 //初始化界面
$(function() $(function () {
{
$("#orgpassword").focus(); $("#orgpassword").focus();
$('#passwordFM').form({ $('#passwordFM').form({
onSubmit: function(){ onSubmit: function () {
return false; return false;
} }
}); });
$("#userDlg").panel({height:webH-3, width:webW+15}); $("#userDlg").panel({height: webH - 3, width: webW + 15});
$("#dlg-buttons").css("padding-left","65px"); $("#dlg-buttons").css("padding-left", "65px");
}); });
//重置 //重置
$("#cancelpassword").off("click").on("click",function(){ $("#cancelpassword").off("click").on("click", function () {
$("#orgpassword").val(""); $("#orgpassword").val("");
$("#password").val(""); $("#password").val("");
$("#repassword").val(""); $("#repassword").val("");
}); });
//初始化键盘enter事件 //初始化键盘enter事件
$(document).keydown(function(event) $(document).keydown(function (event) {
{
//兼容 IE和firefox 事件 //兼容 IE和firefox 事件
var e = window.event || event; var e = window.event || event;
var k = e.keyCode||e.which||e.charCode; var k = e.keyCode || e.which || e.charCode;
//兼容 IE,firefox 兼容 //兼容 IE,firefox 兼容
var obj = e.srcElement ? e.srcElement : e.target; var obj = e.srcElement ? e.srcElement : e.target;
//绑定键盘事件为 id是指定的输入框才可以触发键盘事件 13键盘事件 //绑定键盘事件为 id是指定的输入框才可以触发键盘事件 13键盘事件
if(k == "13"&&(obj.id=="orgpassword" || obj.id=="password"|| obj.id=="repassword")) if (k == "13" && (obj.id == "orgpassword" || obj.id == "password" || obj.id == "repassword"))
$("#savepassword").click(); $("#savepassword").click();
}); });
$("#savepassword").unbind().bind({ $("#savepassword").unbind().bind({
click:function() click: function () {
{ if (!$('#passwordFM').form('validate'))
if(!$('#passwordFM').form('validate'))
return; return;
$.ajax({ $.ajax({
type:"post", type: "post",
url: "<%=path %>/user/updatePwd.action", url: "<%=path %>/user/updatePwd.action",
dataType: "json", dataType: "json",
async : false, async: false,
data: ({ data: ({
userID : '${sessionScope.user.id}', userID: '${sessionScope.user.id}',
password : $.trim($("#password").val()), password: $.trim($("#password").val()),
orgpwd : $.trim($("#orgpassword").val()) orgpwd: $.trim($("#orgpassword").val())
}), }),
success: function (tipInfo) success: function (tipInfo) {
{ if (1 == tipInfo)
if(1 == tipInfo)
//回退到上次访问页面 //回退到上次访问页面
history.go(-1); history.go(-1);
else if(2 == tipInfo) else if (2 == tipInfo) {
{
$("#orgTipMsg").empty().append("<font color='red'>原始密码输入错误</font>"); $("#orgTipMsg").empty().append("<font color='red'>原始密码输入错误</font>");
return; return;
} }
else else {
{ $.messager.alert('提示', '更新密码异常,请稍后再试!', 'error');
$.messager.alert('提示','更新密码异常,请稍后再试!','error');
return; return;
} }
}, },
//此处添加错误处理 //此处添加错误处理
error:function() error: function () {
{ $.messager.alert('提示', '更新密码异常,请稍后再试!', 'error');
$.messager.alert('提示','更新密码异常,请稍后再试!','error');
return; return;
} }
}); });
@@ -123,16 +122,14 @@
//处理tip提示 //处理tip提示
$("#orgpassword").unbind().bind({ $("#orgpassword").unbind().bind({
'click keyup':function() 'click keyup': function () {
{
$("#orgTipMsg").empty(); $("#orgTipMsg").empty();
}, },
'blur':function() 'blur': function () {
{
$("#orgTipMsg").empty(); $("#orgTipMsg").empty();
} }
}); });
</script> </script>
</body> </body>
</html> </html>

View File

@@ -1,37 +1,37 @@
<%@page import="com.jsh.util.Tools"%> <%@page import="com.jsh.util.Tools" %>
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%> <%@ page language="java" pageEncoding="utf-8" %>
<% <%
String path = request.getContextPath(); String path = request.getContextPath();
String clientIp = Tools.getLocalIp(request); String clientIp = Tools.getLocalIp(request);
%> %>
<!DOCTYPE html> <!DOCTYPE html>
<html> <html>
<head> <head>
<title>用户对应客户</title> <title>用户对应客户</title>
<meta charset="utf-8"> <meta charset="utf-8">
<!-- 指定以IE8的方式来渲染 --> <!-- 指定以IE8的方式来渲染 -->
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE8" /> <meta http-equiv="X-UA-Compatible" content="IE=EmulateIE8"/>
<link rel="shortcut icon" href="<%=path%>/images/favicon.ico" type="image/x-icon" /> <link rel="shortcut icon" href="<%=path%>/images/favicon.ico" type="image/x-icon"/>
<script type="text/javascript" src="<%=path%>/js/jquery-1.8.0.min.js"></script> <script type="text/javascript" src="<%=path%>/js/jquery-1.8.0.min.js"></script>
<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/default/easyui.css"/>
<link rel="stylesheet" type="text/css" href="<%=path%>/js/easyui-1.3.5/themes/icon.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" /> <link type="text/css" rel="stylesheet" href="<%=path%>/css/common.css"/>
<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/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/locale/easyui-lang-zh_CN.js"></script>
<script type="text/javascript" src="<%=path%>/js/common/common.js"></script> <script type="text/javascript" src="<%=path%>/js/common/common.js"></script>
</head> </head>
<body> <body>
<!-- 数据显示table --> <!-- 数据显示table -->
<div style="padding-bottom: 10px;"> <div style="padding-bottom: 10px;">
<a id="btnOK" class="easyui-linkbutton" iconCls="icon-ok">保存</a> <a id="btnOK" class="easyui-linkbutton" iconCls="icon-ok">保存</a>
</div> </div>
<div> <div>
<ul id="tt"></ul> <ul id="tt"></ul>
</div> </div>
<script type="text/javascript"> <script type="text/javascript">
var url_id = getUrlParam('id'); //获取传值id用户id var url_id = getUrlParam('id'); //获取传值id用户id
var type="UserCustomer"; var type = "UserCustomer";
var url;//定义链接地址 var url;//定义链接地址
function GetNode(ctype) { function GetNode(ctype) {
var node = $('#tt').tree('getChecked'); var node = $('#tt').tree('getChecked');
@@ -55,27 +55,30 @@
//cnodes = cnodes.substring(0, cnodes.length - 1); //cnodes = cnodes.substring(0, cnodes.length - 1);
pnodes = pnodes.substring(0, pnodes.length - 1); pnodes = pnodes.substring(0, pnodes.length - 1);
if (ctype == 'child') { return cnodes; } if (ctype == 'child') {
else { return pnodes }; return cnodes;
}
else {
return pnodes
}
;
}; };
$(function () { $(function () {
$('#tt').tree({ $('#tt').tree({
url:'<%=path%>/supplier/findUserCustomer.action?UBType='+type+'&UBKeyId='+url_id, url: '<%=path%>/supplier/findUserCustomer.action?UBType=' + type + '&UBKeyId=' + url_id,
animate:true, animate: true,
checkbox:true checkbox: true
}); });
$("#btnOK").click( $("#btnOK").click(
function() { function () {
if(!checkUserDepot()) if (!checkUserDepot()) {
{
url = '<%=path%>/userBusiness/create.action'; url = '<%=path%>/userBusiness/create.action';
} }
else else {
{
url = '<%=path%>/userBusiness/update.action'; url = '<%=path%>/userBusiness/update.action';
} }
@@ -83,11 +86,12 @@
$.ajax({ $.ajax({
type: "post", type: "post",
url:url, url: url,
data: { Type: type, KeyId: url_id, Value: GetNode('child'),clientIp:'<%=clientIp %>' data: {
Type: type, KeyId: url_id, Value: GetNode('child'), clientIp: '<%=clientIp %>'
}, },
dataType: "json", dataType: "json",
async : false, async: false,
success: function (tipInfo) { success: function (tipInfo) {
if (tipInfo) { if (tipInfo) {
self.parent.$.colorbox.close(); self.parent.$.colorbox.close();
@@ -104,33 +108,30 @@
}); });
//检查记录是否存在 //检查记录是否存在
function checkUserDepot() function checkUserDepot() {
{
//表示是否存在 true == 存在 false = 不存在 //表示是否存在 true == 存在 false = 不存在
var flag = false; var flag = false;
//开始ajax名称检验是否存在 //开始ajax名称检验是否存在
$.ajax({ $.ajax({
type:"post", type: "post",
url: "<%=path %>/userBusiness/checkIsValueExist.action", url: "<%=path %>/userBusiness/checkIsValueExist.action",
dataType: "json", dataType: "json",
async : false, async: false,
data: ({ data: ({
Type : type, Type: type,
KeyId : url_id KeyId: url_id
}), }),
success: function (tipInfo) success: function (tipInfo) {
{
flag = tipInfo; flag = tipInfo;
}, },
//此处添加错误处理 //此处添加错误处理
error:function() error: function () {
{ $.messager.alert('提示', '检查用户对应功能是否存在异常,请稍后再试!', 'error');
$.messager.alert('提示','检查用户对应功能是否存在异常,请稍后再试!','error');
return; return;
} }
}); });
return flag; return flag;
} }
</script> </script>
</body> </body>
</html> </html>

View File

@@ -1,38 +1,38 @@
<%@page import="com.jsh.util.Tools"%> <%@page import="com.jsh.util.Tools" %>
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%> <%@ page language="java" pageEncoding="utf-8" %>
<% <%
String path = request.getContextPath(); String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/"; String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + path + "/";
String clientIp = Tools.getLocalIp(request); String clientIp = Tools.getLocalIp(request);
%> %>
<!DOCTYPE html> <!DOCTYPE html>
<html> <html>
<head> <head>
<title>用户对应部门</title> <title>用户对应部门</title>
<meta charset="utf-8"> <meta charset="utf-8">
<!-- 指定以IE8的方式来渲染 --> <!-- 指定以IE8的方式来渲染 -->
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE8" /> <meta http-equiv="X-UA-Compatible" content="IE=EmulateIE8"/>
<link rel="shortcut icon" href="<%=path%>/images/favicon.ico" type="image/x-icon" /> <link rel="shortcut icon" href="<%=path%>/images/favicon.ico" type="image/x-icon"/>
<script type="text/javascript" src="<%=path%>/js/jquery-1.8.0.min.js"></script> <script type="text/javascript" src="<%=path%>/js/jquery-1.8.0.min.js"></script>
<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/default/easyui.css"/>
<link rel="stylesheet" type="text/css" href="<%=path%>/js/easyui-1.3.5/themes/icon.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" /> <link type="text/css" rel="stylesheet" href="<%=path%>/css/common.css"/>
<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/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/locale/easyui-lang-zh_CN.js"></script>
<script type="text/javascript" src="<%=path%>/js/common/common.js"></script> <script type="text/javascript" src="<%=path%>/js/common/common.js"></script>
</head> </head>
<body> <body>
<!-- 数据显示table --> <!-- 数据显示table -->
<div style="padding-bottom: 10px;"> <div style="padding-bottom: 10px;">
<a id="btnOK" class="easyui-linkbutton" iconCls="icon-ok">保存</a> <a id="btnOK" class="easyui-linkbutton" iconCls="icon-ok">保存</a>
</div> </div>
<div> <div>
<ul id="tt"></ul> <ul id="tt"></ul>
</div> </div>
<script type="text/javascript"> <script type="text/javascript">
var url_id = getUrlParam('id'); //获取传值id用户id var url_id = getUrlParam('id'); //获取传值id用户id
var type="UserDepot"; var type = "UserDepot";
var url;//定义链接地址 var url;//定义链接地址
function GetNode(ctype) { function GetNode(ctype) {
var node = $('#tt').tree('getChecked'); var node = $('#tt').tree('getChecked');
@@ -56,27 +56,30 @@
//cnodes = cnodes.substring(0, cnodes.length - 1); //cnodes = cnodes.substring(0, cnodes.length - 1);
pnodes = pnodes.substring(0, pnodes.length - 1); pnodes = pnodes.substring(0, pnodes.length - 1);
if (ctype == 'child') { return cnodes; } if (ctype == 'child') {
else { return pnodes }; return cnodes;
}
else {
return pnodes
}
;
}; };
$(function () { $(function () {
$('#tt').tree({ $('#tt').tree({
url:'<%=path%>/depot/findUserDepot.action?UBType='+type+'&UBKeyId='+url_id, url: '<%=path%>/depot/findUserDepot.action?UBType=' + type + '&UBKeyId=' + url_id,
animate:true, animate: true,
checkbox:true checkbox: true
}); });
$("#btnOK").click( $("#btnOK").click(
function() { function () {
if(!checkUserDepot()) if (!checkUserDepot()) {
{
url = '<%=path%>/userBusiness/create.action'; url = '<%=path%>/userBusiness/create.action';
} }
else else {
{
url = '<%=path%>/userBusiness/update.action'; url = '<%=path%>/userBusiness/update.action';
} }
@@ -84,11 +87,12 @@
$.ajax({ $.ajax({
type: "post", type: "post",
url:url, url: url,
data: { Type: type, KeyId: url_id, Value: GetNode('child'),clientIp:'<%=clientIp %>' data: {
Type: type, KeyId: url_id, Value: GetNode('child'), clientIp: '<%=clientIp %>'
}, },
dataType: "json", dataType: "json",
async : false, async: false,
success: function (tipInfo) { success: function (tipInfo) {
if (tipInfo) { if (tipInfo) {
self.parent.$.colorbox.close(); self.parent.$.colorbox.close();
@@ -105,33 +109,30 @@
}); });
//检查记录是否存在 //检查记录是否存在
function checkUserDepot() function checkUserDepot() {
{
//表示是否存在 true == 存在 false = 不存在 //表示是否存在 true == 存在 false = 不存在
var flag = false; var flag = false;
//开始ajax名称检验是否存在 //开始ajax名称检验是否存在
$.ajax({ $.ajax({
type:"post", type: "post",
url: "<%=path %>/userBusiness/checkIsValueExist.action", url: "<%=path %>/userBusiness/checkIsValueExist.action",
dataType: "json", dataType: "json",
async : false, async: false,
data: ({ data: ({
Type : type, Type: type,
KeyId : url_id KeyId: url_id
}), }),
success: function (tipInfo) success: function (tipInfo) {
{
flag = tipInfo; flag = tipInfo;
}, },
//此处添加错误处理 //此处添加错误处理
error:function() error: function () {
{ $.messager.alert('提示', '检查用户对应功能是否存在异常,请稍后再试!', 'error');
$.messager.alert('提示','检查用户对应功能是否存在异常,请稍后再试!','error');
return; return;
} }
}); });
return flag; return flag;
} }
</script> </script>
</body> </body>
</html> </html>

View File

@@ -1,38 +1,38 @@
<%@page import="com.jsh.util.Tools"%> <%@page import="com.jsh.util.Tools" %>
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%> <%@ page language="java" pageEncoding="utf-8" %>
<% <%
String path = request.getContextPath(); String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/"; String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + path + "/";
String clientIp = Tools.getLocalIp(request); String clientIp = Tools.getLocalIp(request);
%> %>
<!DOCTYPE html> <!DOCTYPE html>
<html> <html>
<head> <head>
<title>用户对应角色</title> <title>用户对应角色</title>
<meta charset="utf-8"> <meta charset="utf-8">
<!-- 指定以IE8的方式来渲染 --> <!-- 指定以IE8的方式来渲染 -->
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE8" /> <meta http-equiv="X-UA-Compatible" content="IE=EmulateIE8"/>
<link rel="shortcut icon" href="<%=path%>/images/favicon.ico" type="image/x-icon" /> <link rel="shortcut icon" href="<%=path%>/images/favicon.ico" type="image/x-icon"/>
<script type="text/javascript" src="<%=path%>/js/jquery-1.8.0.min.js"></script> <script type="text/javascript" src="<%=path%>/js/jquery-1.8.0.min.js"></script>
<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/default/easyui.css"/>
<link rel="stylesheet" type="text/css" href="<%=path%>/js/easyui-1.3.5/themes/icon.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" /> <link type="text/css" rel="stylesheet" href="<%=path%>/css/common.css"/>
<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/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/locale/easyui-lang-zh_CN.js"></script>
<script type="text/javascript" src="<%=path%>/js/common/common.js"></script> <script type="text/javascript" src="<%=path%>/js/common/common.js"></script>
</head> </head>
<body> <body>
<!-- 数据显示table --> <!-- 数据显示table -->
<div style="padding-bottom: 10px;"> <div style="padding-bottom: 10px;">
<a id="btnOK" class="easyui-linkbutton" iconCls="icon-ok">保存</a> <a id="btnOK" class="easyui-linkbutton" iconCls="icon-ok">保存</a>
</div> </div>
<div> <div>
<ul id="tt"></ul> <ul id="tt"></ul>
</div> </div>
<script type="text/javascript"> <script type="text/javascript">
var url_id = getUrlParam('id'); //获取传值id用户id var url_id = getUrlParam('id'); //获取传值id用户id
var type="UserRole"; var type = "UserRole";
var url;//定义链接地址 var url;//定义链接地址
function GetNode(ctype) { function GetNode(ctype) {
var node = $('#tt').tree('getChecked'); var node = $('#tt').tree('getChecked');
@@ -56,27 +56,30 @@
//cnodes = cnodes.substring(0, cnodes.length - 1); //cnodes = cnodes.substring(0, cnodes.length - 1);
pnodes = pnodes.substring(0, pnodes.length - 1); pnodes = pnodes.substring(0, pnodes.length - 1);
if (ctype == 'child') { return cnodes; } if (ctype == 'child') {
else { return pnodes }; return cnodes;
}
else {
return pnodes
}
;
}; };
$(function () { $(function () {
$('#tt').tree({ $('#tt').tree({
url:'<%=path%>/role/findUserRole.action?UBType='+type+'&UBKeyId='+url_id, url: '<%=path%>/role/findUserRole.action?UBType=' + type + '&UBKeyId=' + url_id,
animate:true, animate: true,
checkbox:true checkbox: true
}); });
$("#btnOK").click( $("#btnOK").click(
function() { function () {
if(!checkUserRole()) if (!checkUserRole()) {
{
url = '<%=path%>/userBusiness/create.action'; url = '<%=path%>/userBusiness/create.action';
} }
else else {
{
url = '<%=path%>/userBusiness/update.action'; url = '<%=path%>/userBusiness/update.action';
} }
@@ -84,11 +87,12 @@
$.ajax({ $.ajax({
type: "post", type: "post",
url:url, url: url,
data: { Type: type, KeyId: url_id, Value: GetNode('child'),clientIp:'<%=clientIp %>' data: {
Type: type, KeyId: url_id, Value: GetNode('child'), clientIp: '<%=clientIp %>'
}, },
dataType: "json", dataType: "json",
async : false, async: false,
success: function (tipInfo) { success: function (tipInfo) {
if (tipInfo) { if (tipInfo) {
self.parent.$.colorbox.close(); self.parent.$.colorbox.close();
@@ -105,33 +109,30 @@
}); });
//检查记录是否存在 //检查记录是否存在
function checkUserRole() function checkUserRole() {
{
//表示是否存在 true == 存在 false = 不存在 //表示是否存在 true == 存在 false = 不存在
var flag = false; var flag = false;
//开始ajax名称检验是否存在 //开始ajax名称检验是否存在
$.ajax({ $.ajax({
type:"post", type: "post",
url: "<%=path %>/userBusiness/checkIsValueExist.action", url: "<%=path %>/userBusiness/checkIsValueExist.action",
dataType: "json", dataType: "json",
async : false, async: false,
data: ({ data: ({
Type : type, Type: type,
KeyId : url_id KeyId: url_id
}), }),
success: function (tipInfo) success: function (tipInfo) {
{
flag = tipInfo; flag = tipInfo;
}, },
//此处添加错误处理 //此处添加错误处理
error:function() error: function () {
{ $.messager.alert('提示', '检查用户对应功能是否存在异常,请稍后再试!', 'error');
$.messager.alert('提示','检查用户对应功能是否存在异常,请稍后再试!','error');
return; return;
} }
}); });
return flag; return flag;
} }
</script> </script>
</body> </body>
</html> </html>

View File

@@ -1,54 +1,61 @@
<%@page import="com.jsh.util.Tools"%> <%@page import="com.jsh.util.Tools" %>
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%> <%@ page language="java" pageEncoding="utf-8" %>
<% <%
String path = request.getContextPath(); String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/"; String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + path + "/";
String clientIp = Tools.getLocalIp(request); String clientIp = Tools.getLocalIp(request);
%> %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <!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"> <html xmlns="http://www.w3.org/1999/xhtml">
<head> <head>
<title>个人资料</title> <title>个人资料</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<!-- 指定以IE8的方式来渲染 --> <!-- 指定以IE8的方式来渲染 -->
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE8"/> <meta http-equiv="X-UA-Compatible" content="IE=EmulateIE8"/>
<link rel="shortcut icon" href="<%=path%>/images/favicon.ico" type="image/x-icon" /> <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/default/easyui.css"/>
<link rel="stylesheet" type="text/css" href="<%=path %>/js/easyui-1.3.5/themes/icon.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/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/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/locale/easyui-lang-zh_CN.js"></script>
<script type="text/javascript" src="<%=path %>/js/common/common.js"></script> <script type="text/javascript" src="<%=path %>/js/common/common.js"></script>
</head> </head>
<body> <body>
<div id="position" class="easyui-panel" title="当前位置:系统管理 &gt; 个人资料" collapsible="false" closable="false"/> <div id="position" class="easyui-panel" title="当前位置:系统管理 &gt; 个人资料" collapsible="false" closable="false"/>
<div id="userDlg" class="easyui-panel" title="个人资料" style="height:400px;padding:10px 20px;background-color:#EAF2FD " <div id="userDlg" class="easyui-panel" title="个人资料" style="height:400px;padding:10px 20px;background-color:#EAF2FD "
buttons="#dlg-buttons" iconCls="icon-comment" collapsible="true" closable="false"> buttons="#dlg-buttons" iconCls="icon-comment" collapsible="true" closable="false">
<form id="usernameFM" method="post" novalidate action="<%=path %>/user/update.action"> <form id="usernameFM" method="post" novalidate action="<%=path %>/user/update.action">
<div class="fitem" style="padding:5px"> <div class="fitem" style="padding:5px">
<label id="usernameLabel">用户名称&nbsp;&nbsp;</label> <label id="usernameLabel">用户名称&nbsp;&nbsp;</label>
<input name="username" id="username" class="easyui-validatebox" data-options="required:true,validType:'length[2,30]'" value="${sessionScope.user.username}" style="width: 230px;height: 20px"/> <input name="username" id="username" class="easyui-validatebox"
data-options="required:true,validType:'length[2,30]'" value="${sessionScope.user.username}"
style="width: 230px;height: 20px"/>
</div> </div>
<div class="fitem" style="padding:5px"> <div class="fitem" style="padding:5px">
<label id="departmentLabel">部&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;门&nbsp;&nbsp;</label> <label id="departmentLabel">部&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;门&nbsp;&nbsp;</label>
<input name="department" id="department" style="width: 230px;height: 20px" value="${sessionScope.user.department}"/> <input name="department" id="department" style="width: 230px;height: 20px"
value="${sessionScope.user.department}"/>
</div> </div>
<div class="fitem" style="padding:5px"> <div class="fitem" style="padding:5px">
<label id="positionLabel">职&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;位&nbsp;&nbsp;</label> <label id="positionLabel">职&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;位&nbsp;&nbsp;</label>
<input name="position" id="position" style="width: 230px;height: 20px" value="${sessionScope.user.position}"/> <input name="position" id="position" style="width: 230px;height: 20px"
value="${sessionScope.user.position}"/>
</div> </div>
<div class="fitem" style="padding:5px"> <div class="fitem" style="padding:5px">
<label id="phonenumLabel">联系电话&nbsp;&nbsp;</label> <label id="phonenumLabel">联系电话&nbsp;&nbsp;</label>
<input name="phonenum" id="phonenum" class="easyui-numberbox" style="width: 230px;height: 20px" value="${sessionScope.user.phonenum}"/> <input name="phonenum" id="phonenum" class="easyui-numberbox" style="width: 230px;height: 20px"
value="${sessionScope.user.phonenum}"/>
</div> </div>
<div class="fitem" style="padding:5px"> <div class="fitem" style="padding:5px">
<label id="emailLabel">电子邮箱&nbsp;&nbsp;</label> <label id="emailLabel">电子邮箱&nbsp;&nbsp;</label>
<input name="email" id="email" class="easyui-validatebox" validType="email" style="width: 230px;height: 20px" value="${sessionScope.user.email}"/> <input name="email" id="email" class="easyui-validatebox" validType="email"
style="width: 230px;height: 20px" value="${sessionScope.user.email}"/>
</div> </div>
<div class="fitem" style="padding:5px"> <div class="fitem" style="padding:5px">
<label id="descriptionLabel">描&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;述&nbsp;&nbsp;</label> <label id="descriptionLabel">描&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;述&nbsp;&nbsp;</label>
<textarea name="description" id="description" rows="3" cols="3" style="width: 230px;font-size: 12px;">${sessionScope.user.description}</textarea> <textarea name="description" id="description" rows="3" cols="3"
style="width: 230px;font-size: 12px;">${sessionScope.user.description}</textarea>
</div> </div>
<input type="hidden" name="clientIp" id="clientIp" value="<%=clientIp %>"/> <input type="hidden" name="clientIp" id="clientIp" value="<%=clientIp %>"/>
<input type="hidden" name="userID" id="userID" value="${sessionScope.user.id}"/> <input type="hidden" name="userID" id="userID" value="${sessionScope.user.id}"/>
@@ -58,22 +65,19 @@
<a href="javascript:void(0)" id="saveusername" class="easyui-linkbutton" iconCls="icon-save">修改</a> <a href="javascript:void(0)" id="saveusername" class="easyui-linkbutton" iconCls="icon-save">修改</a>
<a href="javascript:void(0)" id="cancelusername" class="easyui-linkbutton" iconCls="icon-cancel">取消</a> <a href="javascript:void(0)" id="cancelusername" class="easyui-linkbutton" iconCls="icon-cancel">取消</a>
</div> </div>
</div> </div>
</div> </div>
<script type="text/javascript"> <script type="text/javascript">
//初始化界面 //初始化界面
$(function() $(function () {
{
browserFit(); browserFit();
$("#userDlg").panel({height:webH-35}); $("#userDlg").panel({height: webH - 35});
}); });
//浏览器适配 //浏览器适配
function browserFit() function browserFit() {
{ if (getOs() == 'MSIE') {
if(getOs()=='MSIE')
{
$("#usernameLabel").empty().append("用户名称&nbsp;&nbsp;"); $("#usernameLabel").empty().append("用户名称&nbsp;&nbsp;");
$("#departmentLabel").empty().append("部&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;门&nbsp;&nbsp;"); $("#departmentLabel").empty().append("部&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;门&nbsp;&nbsp;");
$("#positionLabel").empty().append("职&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;位&nbsp;&nbsp;"); $("#positionLabel").empty().append("职&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;位&nbsp;&nbsp;");
@@ -81,8 +85,7 @@
$("#emailLabel").empty().append("电子邮箱&nbsp;&nbsp;"); $("#emailLabel").empty().append("电子邮箱&nbsp;&nbsp;");
$("#descriptionLabel").empty().append("描&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;述&nbsp;&nbsp;"); $("#descriptionLabel").empty().append("描&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;述&nbsp;&nbsp;");
} }
else else {
{
$("#usernameLabel").empty().append("用户名称&nbsp;"); $("#usernameLabel").empty().append("用户名称&nbsp;");
$("#departmentLabel").empty().append("部&nbsp;&nbsp;&nbsp;&nbsp;门&nbsp;"); $("#departmentLabel").empty().append("部&nbsp;&nbsp;&nbsp;&nbsp;门&nbsp;");
$("#positionLabel").empty().append("职&nbsp;&nbsp;&nbsp;&nbsp;位&nbsp;"); $("#positionLabel").empty().append("职&nbsp;&nbsp;&nbsp;&nbsp;位&nbsp;");
@@ -93,106 +96,93 @@
} }
$("#cancelusername").unbind().bind({ $("#cancelusername").unbind().bind({
click:function() click: function () {
{
history.go(-1); history.go(-1);
} }
}); });
//初始化键盘enter事件 //初始化键盘enter事件
$(document).keydown(function(event) $(document).keydown(function (event) {
{
//兼容 IE和firefox 事件 //兼容 IE和firefox 事件
var e = window.event || event; var e = window.event || event;
var k = e.keyCode||e.which||e.charCode; var k = e.keyCode || e.which || e.charCode;
//兼容 IE,firefox 兼容 //兼容 IE,firefox 兼容
var obj = e.srcElement ? e.srcElement : e.target; var obj = e.srcElement ? e.srcElement : e.target;
//绑定键盘事件为 id是指定的输入框才可以触发键盘事件 13键盘事件 //绑定键盘事件为 id是指定的输入框才可以触发键盘事件 13键盘事件
if(k == "13"&&(obj.id=="username" || obj.id=="department"|| obj.id=="phonenum" if (k == "13" && (obj.id == "username" || obj.id == "department" || obj.id == "phonenum"
|| obj.id=="email" || obj.id=="description" || obj.id=="position")) || obj.id == "email" || obj.id == "description" || obj.id == "position")) {
{
$("#saveusername").click(); $("#saveusername").click();
} }
}); });
//保存用户信息 //保存用户信息
$("#saveusername").unbind().bind({ $("#saveusername").unbind().bind({
click:function() click: function () {
{ if (checkusernameName())
if(checkusernameName())
return; return;
var reg = /^([0-9])+$/; var reg = /^([0-9])+$/;
var phonenum = $.trim($("#phonenum").val()); var phonenum = $.trim($("#phonenum").val());
if(phonenum.length>0 && !reg.test(phonenum)) if (phonenum.length > 0 && !reg.test(phonenum)) {
{ $.messager.alert('提示', '电话号码只能是数字', 'info');
$.messager.alert('提示','电话号码只能是数字','info');
$("#phonenum").val("").focus(); $("#phonenum").val("").focus();
return; return;
} }
$('#usernameFM').form('submit',{ $('#usernameFM').form('submit', {
onSubmit: function() onSubmit: function () {
{
return $(this).form('validate'); return $(this).form('validate');
}, },
success: function(result) success: function (result) {
{ var result = eval('(' + result + ')');
var result = eval('('+result+')'); if (!result) {
if (!result)
{
$.messager.show({ $.messager.show({
title: '错误提示', title: '错误提示',
msg: '保存用户信息失败,请稍后重试!' msg: '保存用户信息失败,请稍后重试!'
}); });
} }
else else {
{ $.messager.alert('提示', '修改个人资料成功!', 'info');
$.messager.alert('提示','修改个人资料成功!','info');
} }
} }
}); });
} }
}); });
//检查用户 名称是否存在 ++ 重名无法提示问题需要跟进 //检查用户 名称是否存在 ++ 重名无法提示问题需要跟进
function checkusernameName() function checkusernameName() {
{
var username = $.trim($("#username").val()); var username = $.trim($("#username").val());
//表示是否存在 true == 存在 false = 不存在 //表示是否存在 true == 存在 false = 不存在
var flag = false; var flag = false;
//开始ajax名称检验不能重名 //开始ajax名称检验不能重名
if(username.length > 0 && username != '${sessionScope.user.username}') if (username.length > 0 && username != '${sessionScope.user.username}') {
{
$.ajax({ $.ajax({
type:"post", type: "post",
url: "<%=path %>/user/checkIsNameExist.action", url: "<%=path %>/user/checkIsNameExist.action",
dataType: "json", dataType: "json",
async : false, async: false,
data: ({ data: ({
userID : '${sessionScope.user.id}', userID: '${sessionScope.user.id}',
username : username username: username
}), }),
success: function (tipInfo) success: function (tipInfo) {
{
flag = tipInfo; flag = tipInfo;
if(tipInfo) if (tipInfo) {
{ $.messager.alert('提示', '用户名称已经存在', 'info');
$.messager.alert('提示','用户名称已经存在','info');
//alert("用户名称已经存在"); //alert("用户名称已经存在");
//$("#username").val(""); //$("#username").val("");
return; return;
} }
}, },
//此处添加错误处理 //此处添加错误处理
error:function() error: function () {
{ $.messager.alert('提示', '检查用户名称是否存在异常,请稍后再试!', 'error');
$.messager.alert('提示','检查用户名称是否存在异常,请稍后再试!','error');
return; return;
} }
}); });
} }
return flag; return flag;
} }
</script> </script>
</body> </body>
</html> </html>