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,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 basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + path + "/"; String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + path + "/";
@@ -34,21 +34,21 @@
<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
@@ -56,8 +56,7 @@
} }
//初始化键盘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;
@@ -74,12 +73,10 @@
}); });
//检测用户输入数据 //检测用户输入数据
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,8 +85,7 @@
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;
@@ -97,8 +93,7 @@
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();
@@ -114,36 +109,31 @@
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,17 +144,14 @@
//定义变量控制密码提示显示 //定义变量控制密码提示显示
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 兼容
@@ -172,23 +159,20 @@
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();
} }

File diff suppressed because it is too large Load Diff

View File

@@ -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,22 +38,29 @@ 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>

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 basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + path + "/"; String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + path + "/";
@@ -23,13 +23,30 @@
<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%
}
/*兼容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; background-color: #EAF2FD;
} }
</style> </style>
@@ -37,7 +54,8 @@
<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>
@@ -110,18 +128,23 @@
<%-- <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;"
data-options="iconCls:'icon-chart-statistics'">
<div id="culumnContainer">柱状图</div> <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>
@@ -150,8 +173,7 @@
//报表显示个数 //报表显示个数
var showNum = 10; var showNum = 10;
//初始化界面 //初始化界面
$(function() $(function () {
{
//progress(); //progress();
//页面自定义高度 //页面自定义高度
heightInfo = heightInfo - 50; heightInfo = heightInfo - 50;
@@ -181,15 +203,12 @@
}); });
//浏览器适配 //浏览器适配
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;商:");
} }
@@ -198,8 +217,8 @@
$("#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,8 +227,7 @@
} }
//是否限制条件 //是否限制条件
function initShowDataNum() function initShowDataNum() {
{
var type = $("#searchTopten").val(); var type = $("#searchTopten").val();
if (0 == type) if (0 == type)
showNum = 10; showNum = 10;
@@ -219,8 +237,7 @@
} }
//加载进度条 //加载进度条
function progress() function progress() {
{
$.messager.progress({ $.messager.progress({
title: '请稍候', title: '请稍候',
msg: '数据加载ing...' msg: '数据加载ing...'
@@ -229,9 +246,9 @@
$.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",
@@ -246,12 +263,10 @@
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,8 +275,7 @@
} }
//初始化表格数据 //初始化表格数据
function initTableData() function initTableData() {
{
$('#tableData').datagrid({ $('#tableData').datagrid({
//title:'资产列表', //title:'资产列表',
//iconCls:'icon-save', //iconCls:'icon-save',
@@ -294,8 +308,7 @@
{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;
} }
@@ -304,8 +317,7 @@
} }
//初始化键盘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;
@@ -314,31 +326,27 @@
//搜索按钮添加快捷键 //搜索按钮添加快捷键
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();
//系统基础数据 //系统基础数据
@@ -461,8 +455,7 @@
//饼状图 //饼状图
function showPieChart() function showPieChart() {
{
//解决初始化范围变小问题 //解决初始化范围变小问题
$("#pieContainer").empty(); $("#pieContainer").empty();
var getReportTypeInfo = getReportType(); var getReportTypeInfo = getReportType();
@@ -475,13 +468,11 @@
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])
@@ -537,8 +528,7 @@
} }
//综合图 //综合图
function showComboChart() function showComboChart() {
{
//解决初始化范围变小问题 //解决初始化范围变小问题
$("#zongheContainer").empty(); $("#zongheContainer").empty();
var getReportTypeInfo = getReportType(); var getReportTypeInfo = getReportType();
@@ -555,13 +545,11 @@
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)
@@ -709,8 +697,7 @@
} }
//折线图 //折线图
function showSpline() function showSpline() {
{
//解决初始化范围变小问题 //解决初始化范围变小问题
$("#zxianContainer").empty(); $("#zxianContainer").empty();
var getReportTypeInfo = getReportType(); var getReportTypeInfo = getReportType();
@@ -724,12 +711,10 @@
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])
@@ -745,8 +730,7 @@
marker: { marker: {
symbol: 'square', symbol: 'square',
labels: { labels: {
formatter: function() formatter: function () {
{
return this.value + '个'; return this.value + '个';
} }
} }
@@ -818,8 +802,7 @@
} }
//柱状图 //柱状图
function showHistogram() function showHistogram() {
{
//解决初始化范围变小问题 //解决初始化范围变小问题
$("#culumnContainer").empty(); $("#culumnContainer").empty();
var getReportTypeInfo = getReportType(); var getReportTypeInfo = getReportType();
@@ -833,12 +816,10 @@
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])
@@ -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;
@@ -929,12 +909,10 @@
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])
@@ -961,28 +939,23 @@
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 '按所属用户统计';
} }
} }

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 basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + path + "/"; String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + path + "/";

View File

@@ -1,4 +1,4 @@
<%@ 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 + "/";

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 basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + path + "/"; String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + path + "/";
@@ -22,15 +22,24 @@
<!-- <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>
--> -->
@@ -41,9 +50,9 @@
</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')
@@ -52,15 +61,13 @@
$("#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);
@@ -76,37 +83,32 @@
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)
@@ -119,45 +121,37 @@
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%>";
} }
} }

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 basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + path + "/"; String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + path + "/";
@@ -25,15 +25,41 @@
<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 }
{
/*兼容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; background-color: #EAF2FD;
} }
</style> </style>
@@ -41,31 +67,37 @@
<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>
@@ -73,8 +105,7 @@
//控制图表显示个数 //控制图表显示个数
var showNum = 10; var showNum = 10;
//初始化界面 //初始化界面
$(function() $(function () {
{
//progress(); //progress();
$.messager.progress({ $.messager.progress({
title: '请稍候', title: '请稍候',
@@ -94,8 +125,7 @@
}); });
//加载进度条 //加载进度条
function progress() function progress() {
{
var win = $.messager.progress({ var win = $.messager.progress({
title: '请稍候', title: '请稍候',
msg: '数据加载ing...' msg: '数据加载ing...'
@@ -106,8 +136,7 @@
} }
//初始化表格数据 //初始化表格数据
function initTableData() function initTableData() {
{
$('#tableData').datagrid({ $('#tableData').datagrid({
//title:'资产列表', //title:'资产列表',
//iconCls:'icon-save', //iconCls:'icon-save',
@@ -150,8 +179,7 @@
{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;
} }
@@ -159,15 +187,12 @@
} }
//分页信息处理 //分页信息处理
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',
@@ -179,14 +204,12 @@
} }
}); });
} }
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",
@@ -200,14 +223,12 @@
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;
} }
@@ -227,8 +248,7 @@
//饼状图 //饼状图
function showPieChart() function showPieChart() {
{
var pageData = null; var pageData = null;
$.ajax({ $.ajax({
type: "post", type: "post",
@@ -239,12 +259,10 @@
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]
@@ -307,8 +324,7 @@
} }
//综合图 //综合图
function showComboChart() function showComboChart() {
{
var pageData = null; var pageData = null;
$.ajax({ $.ajax({
type: "post", type: "post",
@@ -319,12 +335,10 @@
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;
} }
@@ -345,8 +359,7 @@
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];
@@ -474,8 +487,7 @@
} }
//折线图 //折线图
function showSpline() function showSpline() {
{
var pageData = null; var pageData = null;
$.ajax({ $.ajax({
type: "post", type: "post",
@@ -486,12 +498,10 @@
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;
} }
@@ -510,8 +520,7 @@
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]);
@@ -521,8 +530,7 @@
marker: { marker: {
symbol: 'square', symbol: 'square',
labels: { labels: {
formatter: function() formatter: function () {
{
return this.value + '个'; return this.value + '个';
} }
} }
@@ -593,8 +601,7 @@
} }
//柱状图 //柱状图
function showHistogram() function showHistogram() {
{
var pageData = null; var pageData = null;
$.ajax({ $.ajax({
type: "post", type: "post",
@@ -605,12 +612,10 @@
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;
} }
@@ -628,8 +633,7 @@
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]);
@@ -698,27 +702,21 @@
} }
//返回统计类型字符串 //返回统计类型字符串
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 '按所属用户统计';
} }
} }

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 basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + path + "/"; String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + path + "/";
@@ -21,20 +21,27 @@
<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="desktop">
<div id="zoom-tip"><div><i></i><span></span></div><a href="javascript:;" class="close" onclick="HROS.zoom.close();">×</a></div> <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">
@@ -88,7 +95,9 @@
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,6 +114,7 @@
//加载桌面 //加载桌面
HROS.base.init(); HROS.base.init();
} }
//判断是否存在session如果不存在就跳到登录界面 //判断是否存在session如果不存在就跳到登录界面
function UserOut() { function UserOut() {
var kid = ${sessionScope.user.id}; var kid = ${sessionScope.user.id};
@@ -112,6 +122,7 @@
top.location.href = '../../'; top.location.href = '../../';
} }
} }
setInterval(UserOut, 5000); //每5秒检测一次 setInterval(UserOut, 5000); //每5秒检测一次
}); });

View File

@@ -1,4 +1,4 @@
<%@ 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 + "/";
@@ -43,8 +43,7 @@ var functions="";
var btnStrList = []; //按钮权限列表 var btnStrList = []; //按钮权限列表
//初始化界面 //初始化界面
$(function() $(function () {
{
//初始化系统基础信息 //初始化系统基础信息
initSystemData(id, 'UserRole'); initSystemData(id, 'UserRole');
initSelectInfo(0); initSelectInfo(0);
@@ -55,8 +54,7 @@ $(function()
}); });
//初始化系统基础信息 //初始化系统基础信息
function initSystemData(kid,type) function initSystemData(kid, type) {
{
$.ajax({ $.ajax({
type: "post", type: "post",
url: "<%=path%>/userBusiness/getBasicData.action", url: "<%=path%>/userBusiness/getBasicData.action",
@@ -67,26 +65,23 @@ function initSystemData(kid,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) { function initSelectInfo(lei) {
if (userBusinessList != null) { if (userBusinessList != null) {
@@ -118,8 +113,7 @@ function initSelectInfo(lei) {
} }
//初始化页面 //初始化页面
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
@@ -129,27 +123,23 @@ function initSelect()
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);
} }
@@ -159,8 +149,7 @@ function initSelect()
} }
//测试自定义hql //测试自定义hql
function ceshi() function ceshi() {
{
$.ajax({ $.ajax({
type: "post", type: "post",
url: "<%=path%>/userBusiness/getceshi.action", url: "<%=path%>/userBusiness/getceshi.action",
@@ -170,29 +159,23 @@ function ceshi()
//设置为同步 //设置为同步
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]);
} }

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 basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + path + "/"; String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + path + "/";
@@ -20,13 +20,11 @@
<script type="text/javascript"> <script type="text/javascript">
//初始化界面 //初始化界面
$(function() $(function () {
{
init(); init();
}); });
function init() function init() {
{
} }
</script> </script>

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);
@@ -29,7 +29,8 @@
</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>
@@ -54,7 +57,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>
@@ -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,13 +96,15 @@
</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>
@@ -104,7 +113,8 @@
</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"
onclick="javascript:$('#accountHeadDlg').dialog('close')">取消</a>
</div> </div>
<div id="accountHeadDlgShow" class="easyui-dialog" style="width:1200px;padding:10px 20px;top:20px" <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">

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);
@@ -29,7 +29,8 @@
</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>
@@ -54,7 +57,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>
@@ -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,7 +106,8 @@
</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>
@@ -107,7 +116,8 @@
</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"
onclick="javascript:$('#accountHeadDlg').dialog('close')">取消</a>
</div> </div>
<div id="accountHeadDlgShow" class="easyui-dialog" style="width:1200px;padding:10px 20px;top:20px" <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">

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);
@@ -29,7 +29,8 @@
</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>
@@ -54,7 +57,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>
@@ -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,7 +107,8 @@
</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>
@@ -108,7 +117,8 @@
</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"
onclick="javascript:$('#accountHeadDlg').dialog('close')">取消</a>
</div> </div>
<div id="accountHeadDlgShow" class="easyui-dialog" style="width:1200px;padding:10px 20px;top:20px" <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">

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);
@@ -29,7 +29,8 @@
</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>
@@ -54,7 +57,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>
@@ -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,7 +106,8 @@
</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>
@@ -107,7 +116,8 @@
</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"
onclick="javascript:$('#accountHeadDlg').dialog('close')">取消</a>
</div> </div>
<div id="accountHeadDlgShow" class="easyui-dialog" style="width:1200px;padding:10px 20px;top:20px" <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">

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);
@@ -29,7 +29,8 @@
</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>
@@ -54,7 +57,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>
@@ -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,13 +96,15 @@
</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>
@@ -104,7 +113,8 @@
</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"
onclick="javascript:$('#accountHeadDlg').dialog('close')">取消</a>
</div> </div>
<div id="accountHeadDlgShow" class="easyui-dialog" style="width:1200px;padding:10px 20px;top:20px" <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">

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);
@@ -29,7 +29,8 @@
</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>
@@ -54,7 +57,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>
@@ -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,13 +95,15 @@
</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>
@@ -104,7 +112,8 @@
</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"
onclick="javascript:$('#accountHeadDlg').dialog('close')">取消</a>
</div> </div>
<div id="accountHeadDlgShow" class="easyui-dialog" style="width:1200px;padding:10px 20px;top:20px" <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">

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);
@@ -23,7 +23,8 @@
</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>
@@ -54,7 +55,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>
<div id="accountDlg" class="easyui-dialog" style="width:380px;padding:10px 20px" <div id="accountDlg" class="easyui-dialog" style="width:380px;padding:10px 20px"
@@ -62,19 +64,23 @@
<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>
@@ -85,9 +91,11 @@
</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"
onclick="javascript:$('#accountDlg').dialog('close')">取消</a>
</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>
@@ -121,7 +129,8 @@
{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", {
title: '是否默认', field: 'isDefault', width: 100, align: "center",
formatter: function (value, rec) { formatter: function (value, rec) {
if (rec.isDefault) { if (rec.isDefault) {
return "<b style='color:green'>是</b>"; return "<b style='color:green'>是</b>";
@@ -132,12 +141,11 @@
} }
}, },
{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;';
@@ -151,8 +159,7 @@
id: 'addAccount', id: 'addAccount',
text: '增加', text: '增加',
iconCls: 'icon-add', iconCls: 'icon-add',
handler:function() handler: function () {
{
addAccount(); addAccount();
} }
}, },
@@ -160,8 +167,7 @@
id: 'deleteAccount', id: 'deleteAccount',
text: '删除', text: '删除',
iconCls: 'icon-remove', iconCls: 'icon-remove',
handler:function() handler: function () {
{
batDeleteAccount(); batDeleteAccount();
} }
}, },
@@ -169,14 +175,12 @@
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;
} }
@@ -191,26 +195,23 @@
//兼容 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',
@@ -222,18 +223,15 @@
} }
}); });
} }
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",
@@ -244,8 +242,7 @@
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 == '成功')
//加载完以后重新初始化 //加载完以后重新初始化
@@ -254,8 +251,7 @@
$.messager.alert('删除提示', '删除结算账户失败,请稍后再试!', 'error'); $.messager.alert('删除提示', '删除结算账户失败,请稍后再试!', 'error');
}, },
//此处添加错误处理 //此处添加错误处理
error:function() error: function () {
{
$.messager.alert('删除提示', '删除结算账户异常,请稍后再试!', 'error'); $.messager.alert('删除提示', '删除结算账户异常,请稍后再试!', 'error');
return; return;
} }
@@ -267,22 +263,16 @@
//批量删除结算账户 //批量删除结算账户
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;
} }
@@ -297,11 +287,9 @@
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);
@@ -310,8 +298,7 @@
$.messager.alert('删除提示', '删除结算账户失败,请稍后再试!', 'error'); $.messager.alert('删除提示', '删除结算账户失败,请稍后再试!', 'error');
}, },
//此处添加错误处理 //此处添加错误处理
error:function() error: function () {
{
$.messager.alert('删除提示', '删除结算账户异常,请稍后再试!', 'error'); $.messager.alert('删除提示', '删除结算账户异常,请稍后再试!', 'error');
return; return;
} }
@@ -347,13 +334,11 @@
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",
@@ -374,13 +359,13 @@
} }
}, },
//此处添加错误处理 //此处添加错误处理
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++) {
@@ -399,29 +384,24 @@
//保存结算账户 //保存结算账户
$("#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');
//加载完以后重新初始化 //加载完以后重新初始化
@@ -461,8 +441,7 @@
//表示是否存在 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",
@@ -472,18 +451,15 @@
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,8 +470,7 @@
//搜索处理 //搜索处理
$("#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');
@@ -521,13 +496,11 @@
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,7 +538,8 @@
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>";
@@ -573,7 +547,8 @@
}, },
{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(",");

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 basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + path + "/"; String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + path + "/";
@@ -26,7 +26,8 @@
</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,7 +52,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>
@@ -61,43 +63,59 @@
<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 %>"/>
@@ -105,13 +123,13 @@
</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"
onclick="javascript:$('#appDlg').dialog('close')">取消</a>
</div> </div>
<script type="text/javascript"> <script type="text/javascript">
//初始化界面 //初始化界面
$(function() $(function () {
{
initTableData(); initTableData();
ininPager(); ininPager();
initForm(); initForm();
@@ -119,8 +137,7 @@
//防止表单提交重复 //防止表单提交重复
function initForm() function initForm() {
{
$('#appFM').form({ $('#appFM').form({
onSubmit: function () { onSubmit: function () {
return false; return false;
@@ -129,8 +146,7 @@
} }
//初始化表格数据 //初始化表格数据
function initTableData() function initTableData() {
{
$('#tableData').datagrid({ $('#tableData').datagrid({
//title:'应用列表', //title:'应用列表',
//iconCls:'icon-save', //iconCls:'icon-save',
@@ -159,10 +175,9 @@
{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 + "\" />";
} }
} }
@@ -170,29 +185,36 @@
{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){ {
title: '拉伸', field: 'ReSize', width: 50, formatter: function (value) {
return value ? "开" : "关"; return value ? "开" : "关";
}}, }
{ title: '最大化',field: 'OpenMax',width:50,formatter:function(value){ },
{
title: '最大化', field: 'OpenMax', width: 50, formatter: function (value) {
return value ? "开" : "关"; return value ? "开" : "关";
}}, }
{ title: 'Flash',field: 'Flash',width:50,formatter:function(value){ },
{
title: 'Flash', field: 'Flash', width: 50, formatter: function (value) {
return value ? "开" : "关"; return value ? "开" : "关";
}}, }
},
{title: '种类', field: 'ZL', width: 50}, {title: '种类', field: 'ZL', width: 50},
{title: '排序号', field: 'Sort', width: 50}, {title: '排序号', field: 'Sort', width: 50},
{title: '备注', field: 'Remark', 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: '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;';
} }
@@ -205,8 +227,7 @@
id: 'addApp', id: 'addApp',
text: '增加', text: '增加',
iconCls: 'icon-add', iconCls: 'icon-add',
handler:function() handler: function () {
{
addApp(); addApp();
} }
}, },
@@ -214,14 +235,12 @@
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;
} }
@@ -229,8 +248,7 @@
} }
//初始化键盘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;
@@ -238,27 +256,22 @@
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',
@@ -270,19 +283,15 @@
} }
}); });
} }
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",
@@ -291,11 +300,9 @@
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();
} }
@@ -303,8 +310,7 @@
$.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;
} }
@@ -348,11 +347,9 @@
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);
@@ -361,8 +358,7 @@
$.messager.alert('删除提示', '删除应用信息失败,请稍后再试!', 'error'); $.messager.alert('删除提示', '删除应用信息失败,请稍后再试!', 'error');
}, },
//此处添加错误处理 //此处添加错误处理
error:function() error: function () {
{
$.messager.alert('删除提示', '删除应用信息异常,请稍后再试!', 'error'); $.messager.alert('删除提示', '删除应用信息异常,请稍后再试!', 'error');
return; return;
} }
@@ -378,8 +374,7 @@
//保存编辑前的名称 //保存编辑前的名称
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;增加应用信息');
@@ -406,14 +401,12 @@
//保存信息 //保存信息
$("#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,
@@ -437,17 +430,14 @@
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,8 +445,7 @@
} }
}, },
//此处添加错误处理 //此处添加错误处理
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]);
@@ -495,14 +483,12 @@
} }
//检查名称是否存在 ++ 重名无法提示问题需要跟进 //检查名称是否存在 ++ 重名无法提示问题需要跟进
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",
@@ -512,11 +498,9 @@
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("");
@@ -524,8 +508,7 @@
} }
}, },
//此处添加错误处理 //此处添加错误处理
error:function() error: function () {
{
$.messager.alert('提示', '检查应用名称是否存在异常,请稍后再试!', 'error'); $.messager.alert('提示', '检查应用名称是否存在异常,请稍后再试!', 'error');
return; return;
} }
@@ -536,8 +519,7 @@
//搜索处理 //搜索处理
$("#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');
@@ -551,8 +533,7 @@
} }
}); });
function showAppDetails(pageNo,pageSize) function showAppDetails(pageNo, pageSize) {
{
$.ajax({ $.ajax({
type: "post", type: "post",
url: "<%=path %>/app/findBy.action", url: "<%=path %>/app/findBy.action",
@@ -563,13 +544,11 @@
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;
} }

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 basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + path + "/"; String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + path + "/";
@@ -24,7 +24,8 @@
<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>
@@ -69,21 +70,25 @@
</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>
@@ -101,14 +106,17 @@
</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"
onclick="javascript:$('#assetnameDlg').dialog('close')">取消</a>
</div> </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>
@@ -119,14 +127,14 @@
</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"
onclick="javascript:$('#categoryDlg').dialog('close')">取消</a>
</div> </div>
<script type="text/javascript"> <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,9 +205,9 @@
$("#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;
@@ -223,8 +222,7 @@
} }
//初始化表格数据 //初始化表格数据
function initTableData() function initTableData() {
{
$('#tableData').datagrid({ $('#tableData').datagrid({
//title:'资产名称列表', //title:'资产名称列表',
//iconCls:'icon-save', //iconCls:'icon-save',
@@ -254,12 +252,11 @@
{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;';
} }
@@ -272,8 +269,7 @@
id: 'addAssetName', id: 'addAssetName',
text: '增加', text: '增加',
iconCls: 'icon-add', iconCls: 'icon-add',
handler:function() handler: function () {
{
addAssetName(); addAssetName();
} }
}, },
@@ -281,14 +277,12 @@
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;
} }
@@ -296,35 +290,30 @@
} }
//初始化键盘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("");
@@ -335,14 +324,12 @@
//保存信息 //保存信息
$("#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',
@@ -353,17 +340,14 @@
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,8 +355,7 @@
} }
}, },
//此处添加错误处理 //此处添加错误处理
error:function() error: function () {
{
$.messager.alert('提示', '保存资产类型信息异常,请稍后再试!', 'error'); $.messager.alert('提示', '保存资产类型信息异常,请稍后再试!', 'error');
return; return;
} }
@@ -382,14 +365,12 @@
}); });
//检查名称是否存在 ++ 重名无法提示问题需要跟进 //检查名称是否存在 ++ 重名无法提示问题需要跟进
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",
@@ -399,11 +380,9 @@
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("");
@@ -411,8 +390,7 @@
} }
}, },
//此处添加错误处理 //此处添加错误处理
error:function() error: function () {
{
$.messager.alert('提示', '检查资产类型名称是否存在异常,请稍后再试!', 'error'); $.messager.alert('提示', '检查资产类型名称是否存在异常,请稍后再试!', 'error');
return; return;
} }
@@ -422,15 +400,12 @@
} }
//分页信息处理 //分页信息处理
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',
@@ -442,19 +417,15 @@
} }
}); });
} }
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",
@@ -463,11 +434,9 @@
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();
} }
@@ -475,8 +444,7 @@
$.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;
} }
@@ -520,11 +481,9 @@
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);
@@ -533,8 +492,7 @@
$.messager.alert('删除提示', '删除资产名称信息失败,请稍后再试!', 'error'); $.messager.alert('删除提示', '删除资产名称信息失败,请稍后再试!', 'error');
}, },
//此处添加错误处理 //此处添加错误处理
error:function() error: function () {
{
$.messager.alert('删除提示', '删除资产名称信息异常,请稍后再试!', 'error'); $.messager.alert('删除提示', '删除资产名称信息异常,请稍后再试!', 'error');
return; return;
} }
@@ -550,8 +508,7 @@
//保存编辑前的名称 //保存编辑前的名称
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});
@@ -570,14 +527,12 @@
//保存信息 //保存信息
$("#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,
@@ -590,17 +545,14 @@
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,8 +560,7 @@
} }
}, },
//此处添加错误处理 //此处添加错误处理
error:function() error: function () {
{
$.messager.alert('提示', '保存资产名称信息异常,请稍后再试!', 'error'); $.messager.alert('提示', '保存资产名称信息异常,请稍后再试!', 'error');
return; return;
} }
@@ -619,8 +570,7 @@
}); });
//编辑信息 //编辑信息
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],
@@ -643,14 +593,12 @@
} }
//检查名称是否存在 ++ 重名无法提示问题需要跟进 //检查名称是否存在 ++ 重名无法提示问题需要跟进
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",
@@ -660,18 +608,15 @@
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,8 +627,7 @@
//搜索处理 //搜索处理
$("#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');
@@ -697,8 +641,7 @@
} }
}); });
function showAssetNameDetails(pageNo,pageSize) function showAssetNameDetails(pageNo, pageSize) {
{
$.ajax({ $.ajax({
type: "post", type: "post",
url: "<%=path %>/assetname/findBy.action", url: "<%=path %>/assetname/findBy.action",
@@ -711,13 +654,11 @@
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;
} }

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 basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + path + "/"; String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + path + "/";
@@ -24,7 +24,8 @@
<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>
@@ -49,7 +50,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>
@@ -58,7 +60,8 @@
<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>
@@ -69,13 +72,13 @@
</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"
onclick="javascript:$('#categoryDlg').dialog('close')">取消</a>
</div> </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,8 +100,7 @@
} }
//防止表单提交重复 //防止表单提交重复
function initForm() function initForm() {
{
$('#categoryFM').form({ $('#categoryFM').form({
onSubmit: function () { onSubmit: function () {
return false; return false;
@@ -110,8 +109,7 @@
} }
//初始化表格数据 //初始化表格数据
function initTableData() function initTableData() {
{
$('#tableData').datagrid({ $('#tableData').datagrid({
//title:'供应商列表', //title:'供应商列表',
//iconCls:'icon-save', //iconCls:'icon-save',
@@ -139,12 +137,11 @@
{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;';
} }
@@ -157,8 +154,7 @@
id: 'addSupplier', id: 'addSupplier',
text: '增加', text: '增加',
iconCls: 'icon-add', iconCls: 'icon-add',
handler:function() handler: function () {
{
addCategory(); addCategory();
} }
}, },
@@ -166,14 +162,12 @@
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;
} }
@@ -181,34 +175,29 @@
} }
//初始化键盘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',
@@ -220,19 +209,15 @@
} }
}); });
} }
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",
@@ -241,11 +226,9 @@
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();
} }
@@ -253,8 +236,7 @@
$.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;
} }
@@ -298,11 +273,9 @@
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);
@@ -311,8 +284,7 @@
$.messager.alert('删除提示', '删除资产类别信息失败,请稍后再试!', 'error'); $.messager.alert('删除提示', '删除资产类别信息失败,请稍后再试!', 'error');
}, },
//此处添加错误处理 //此处添加错误处理
error:function() error: function () {
{
$.messager.alert('删除提示', '删除资产类别信息异常,请稍后再试!', 'error'); $.messager.alert('删除提示', '删除资产类别信息异常,请稍后再试!', 'error');
return; return;
} }
@@ -328,8 +300,7 @@
//保存编辑前的名称 //保存编辑前的名称
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;增加资产类型信息');
@@ -344,14 +315,12 @@
//保存信息 //保存信息
$("#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,
@@ -362,17 +331,14 @@
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,8 +346,7 @@
} }
}, },
//此处添加错误处理 //此处添加错误处理
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 %>');
@@ -409,14 +373,12 @@
} }
//检查名称是否存在 ++ 重名无法提示问题需要跟进 //检查名称是否存在 ++ 重名无法提示问题需要跟进
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",
@@ -426,11 +388,9 @@
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("");
@@ -438,8 +398,7 @@
} }
}, },
//此处添加错误处理 //此处添加错误处理
error:function() error: function () {
{
$.messager.alert('提示', '检查资产类型名称是否存在异常,请稍后再试!', 'error'); $.messager.alert('提示', '检查资产类型名称是否存在异常,请稍后再试!', 'error');
return; return;
} }
@@ -450,8 +409,7 @@
//搜索处理 //搜索处理
$("#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');
@@ -465,8 +423,7 @@
} }
}); });
function showCategoryDetails(pageNo,pageSize) function showCategoryDetails(pageNo, pageSize) {
{
$.ajax({ $.ajax({
type: "post", type: "post",
url: "<%=path %>/category/findBy.action", url: "<%=path %>/category/findBy.action",
@@ -477,13 +434,11 @@
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;
} }

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);
@@ -28,7 +28,8 @@
</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>
@@ -60,7 +61,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>
<div id="supplierDlg" class="easyui-dialog" style="width:580px;padding:10px 20px" <div id="supplierDlg" class="easyui-dialog" style="width:580px;padding:10px 20px"
@@ -70,7 +72,8 @@
<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>
@@ -154,12 +164,14 @@
</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"
onclick="javascript:$('#supplierDlg').dialog('close')">取消</a>
</div> </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"/>
@@ -177,7 +189,8 @@
<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>

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);
@@ -22,7 +22,8 @@
</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,7 +45,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>
@@ -55,25 +57,29 @@
<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>
@@ -94,7 +100,8 @@
</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"
onclick="javascript:$('#depotDlg').dialog('close')">取消</a>
</div> </div>
<script type="text/javascript"> <script type="text/javascript">
@@ -141,13 +148,13 @@
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, {
title: '操作', field: 'op', align: "center", width: 60,
formatter: function (value, rec) { 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 + ');"/>';
} }
@@ -202,6 +209,7 @@
$("#searchBtn").click(); $("#searchBtn").click();
} }
}); });
//分页信息处理 //分页信息处理
function ininPager() { function ininPager() {
try { try {
@@ -238,8 +246,7 @@
}), }),
success: function (tipInfo) { success: function (tipInfo) {
var msg = tipInfo.showModel.msgTip; var msg = tipInfo.showModel.msgTip;
if(msg == '成功') if (msg == '成功') {
{
//加载完以后重新初始化 //加载完以后重新初始化
$("#searchBtn").click(); $("#searchBtn").click();
} }
@@ -265,13 +272,10 @@
} }
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;
} }
@@ -287,11 +291,9 @@
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);
@@ -300,8 +302,7 @@
$.messager.alert('删除提示', '删除仓库信息失败,请稍后再试!', 'error'); $.messager.alert('删除提示', '删除仓库信息失败,请稍后再试!', 'error');
}, },
//此处添加错误处理 //此处添加错误处理
error:function() error: function () {
{
$.messager.alert('删除提示', '删除仓库信息异常,请稍后再试!', 'error'); $.messager.alert('删除提示', '删除仓库信息异常,请稍后再试!', 'error');
return; return;
} }
@@ -317,8 +318,7 @@
//保存编辑前的名称 //保存编辑前的名称
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});
@@ -336,8 +336,7 @@
return; return;
else if (checkDepotName()) else if (checkDepotName())
return; return;
else else {
{
$.ajax({ $.ajax({
type: "post", type: "post",
url: url, url: url,
@@ -353,17 +352,14 @@
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,8 +367,7 @@
} }
}, },
//此处添加错误处理 //此处添加错误处理
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 %>');
@@ -403,14 +397,12 @@
} }
//检查名称是否存在 ++ 重名无法提示问题需要跟进 //检查名称是否存在 ++ 重名无法提示问题需要跟进
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",
@@ -420,11 +412,9 @@
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("");
@@ -432,8 +422,7 @@
} }
}, },
//此处添加错误处理 //此处添加错误处理
error:function() error: function () {
{
$.messager.alert('提示', '检查仓库名称是否存在异常,请稍后再试!', 'error'); $.messager.alert('提示', '检查仓库名称是否存在异常,请稍后再试!', 'error');
return; return;
} }
@@ -444,8 +433,7 @@
//搜索处理 //搜索处理
$("#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');
@@ -459,8 +447,7 @@
} }
}); });
function showDepotDetails(pageNo,pageSize) function showDepotDetails(pageNo, pageSize) {
{
$.ajax({ $.ajax({
type: "post", type: "post",
url: "<%=path %>/depot/findBy.action", url: "<%=path %>/depot/findBy.action",
@@ -472,13 +459,11 @@
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;
} }

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 basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + path + "/"; String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + path + "/";
@@ -23,7 +23,8 @@
</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,7 +49,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>
@@ -58,15 +60,19 @@
<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 %>"/>
@@ -74,13 +80,13 @@
</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"
onclick="javascript:$('#depotDlg').dialog('close')">取消</a>
</div> </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,8 +110,7 @@
} }
//防止表单提交重复 //防止表单提交重复
function initForm() function initForm() {
{
$('#depotFM').form({ $('#depotFM').form({
onSubmit: function () { onSubmit: function () {
return false; return false;
@@ -117,8 +119,7 @@
} }
//初始化表格数据 //初始化表格数据
function initTableData() function initTableData() {
{
$('#tableData').datagrid({ $('#tableData').datagrid({
//title:'仓库列表', //title:'仓库列表',
//iconCls:'icon-save', //iconCls:'icon-save',
@@ -147,12 +148,11 @@
{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;';
} }
@@ -165,8 +165,7 @@
id: 'addDepot', id: 'addDepot',
text: '增加', text: '增加',
iconCls: 'icon-add', iconCls: 'icon-add',
handler:function() handler: function () {
{
addDepot(); addDepot();
} }
}, },
@@ -174,14 +173,12 @@
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;
} }
@@ -189,34 +186,29 @@
} }
//初始化键盘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',
@@ -228,19 +220,15 @@
} }
}); });
} }
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",
@@ -249,11 +237,9 @@
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();
} }
@@ -261,8 +247,7 @@
$.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;
} }
@@ -306,11 +284,9 @@
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);
@@ -319,8 +295,7 @@
$.messager.alert('删除提示', '删除仓库信息失败,请稍后再试!', 'error'); $.messager.alert('删除提示', '删除仓库信息失败,请稍后再试!', 'error');
}, },
//此处添加错误处理 //此处添加错误处理
error:function() error: function () {
{
$.messager.alert('删除提示', '删除仓库信息异常,请稍后再试!', 'error'); $.messager.alert('删除提示', '删除仓库信息异常,请稍后再试!', 'error');
return; return;
} }
@@ -336,8 +311,7 @@
//保存编辑前的名称 //保存编辑前的名称
var orgDepot = ""; var orgDepot = "";
function addDepot() function addDepot() {
{
$("#clientIp").val('<%=clientIp %>'); $("#clientIp").val('<%=clientIp %>');
$("#sort").val(""); $("#sort").val("");
$("#remark").val(""); $("#remark").val("");
@@ -353,14 +327,12 @@
//保存信息 //保存信息
$("#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,
@@ -373,17 +345,14 @@
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,8 +360,7 @@
} }
}, },
//此处添加错误处理 //此处添加错误处理
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 %>');
@@ -421,14 +388,12 @@
} }
//检查名称是否存在 ++ 重名无法提示问题需要跟进 //检查名称是否存在 ++ 重名无法提示问题需要跟进
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",
@@ -438,11 +403,9 @@
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("");
@@ -450,8 +413,7 @@
} }
}, },
//此处添加错误处理 //此处添加错误处理
error:function() error: function () {
{
$.messager.alert('提示', '检查仓库名称是否存在异常,请稍后再试!', 'error'); $.messager.alert('提示', '检查仓库名称是否存在异常,请稍后再试!', 'error');
return; return;
} }
@@ -462,8 +424,7 @@
//搜索处理 //搜索处理
$("#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');
@@ -477,8 +438,7 @@
} }
}); });
function showDepotDetails(pageNo,pageSize) function showDepotDetails(pageNo, pageSize) {
{
$.ajax({ $.ajax({
type: "post", type: "post",
url: "<%=path %>/depot/findBy.action", url: "<%=path %>/depot/findBy.action",
@@ -490,13 +450,11 @@
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;
} }

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 basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + path + "/"; String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + path + "/";
@@ -23,7 +23,8 @@
</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>
@@ -52,7 +53,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>
@@ -62,23 +64,29 @@
<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>
@@ -88,17 +96,20 @@
</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>
@@ -107,13 +118,13 @@
</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"
onclick="javascript:$('#functionsDlg').dialog('close')">取消</a>
</div> </div>
<script type="text/javascript"> <script type="text/javascript">
//初始化界面 //初始化界面
$(function() $(function () {
{
initTableData(); initTableData();
ininPager(); ininPager();
initForm(); initForm();
@@ -121,8 +132,7 @@
}); });
//防止表单提交重复 //防止表单提交重复
function initForm() function initForm() {
{
$('#functionsFM').form({ $('#functionsFM').form({
onSubmit: function () { onSubmit: function () {
return false; return false;
@@ -131,8 +141,7 @@
} }
//初始化表格数据 //初始化表格数据
function initTableData() function initTableData() {
{
$('#tableData').datagrid({ $('#tableData').datagrid({
//title:'功能列表', //title:'功能列表',
//iconCls:'icon-save', //iconCls:'icon-save',
@@ -162,20 +171,23 @@
{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;';
} }
@@ -188,8 +200,7 @@
id: 'addFunctions', id: 'addFunctions',
text: '增加', text: '增加',
iconCls: 'icon-add', iconCls: 'icon-add',
handler:function() handler: function () {
{
addFunctions(); addFunctions();
} }
}, },
@@ -197,14 +208,12 @@
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;
} }
@@ -212,34 +221,29 @@
} }
//初始化键盘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',
@@ -251,8 +255,7 @@
} }
}); });
} }
catch (e) catch (e) {
{
$.messager.alert('异常处理提示', "分页信息异常 : " + e.name + ": " + e.message, 'error'); $.messager.alert('异常处理提示', "分页信息异常 : " + e.name + ": " + e.message, 'error');
} }
} }
@@ -269,12 +272,9 @@
} }
//删除供应商信息 //删除供应商信息
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",
@@ -283,11 +283,9 @@
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();
} }
@@ -295,8 +293,7 @@
$.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;
} }
@@ -340,11 +330,9 @@
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);
@@ -353,8 +341,7 @@
$.messager.alert('删除提示', '删除功能信息失败,请稍后再试!', 'error'); $.messager.alert('删除提示', '删除功能信息失败,请稍后再试!', 'error');
}, },
//此处添加错误处理 //此处添加错误处理
error:function() error: function () {
{
$.messager.alert('删除提示', '删除功能信息异常,请稍后再试!', 'error'); $.messager.alert('删除提示', '删除功能信息异常,请稍后再试!', 'error');
return; return;
} }
@@ -370,8 +357,7 @@
//保存编辑前的名称 //保存编辑前的名称
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});
@@ -385,14 +371,12 @@
//保存信息 //保存信息
$("#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;
@@ -414,17 +398,14 @@
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,8 +413,7 @@
} }
}, },
//此处添加错误处理 //此处添加错误处理
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 %>');
@@ -482,14 +461,12 @@
} }
//检查名称是否存在 ++ 重名无法提示问题需要跟进 //检查名称是否存在 ++ 重名无法提示问题需要跟进
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",
@@ -499,11 +476,9 @@
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("");
@@ -511,8 +486,7 @@
} }
}, },
//此处添加错误处理 //此处添加错误处理
error:function() error: function () {
{
$.messager.alert('提示', '检查功能名称是否存在异常,请稍后再试!', 'error'); $.messager.alert('提示', '检查功能名称是否存在异常,请稍后再试!', 'error');
return; return;
} }
@@ -523,8 +497,7 @@
//搜索处理 //搜索处理
$("#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');
@@ -538,8 +511,7 @@
} }
}); });
function showFunctionsDetails(pageNo,pageSize) function showFunctionsDetails(pageNo, pageSize) {
{
$.ajax({ $.ajax({
type: "post", type: "post",
url: "<%=path %>/functions/findBy.action", url: "<%=path %>/functions/findBy.action",
@@ -550,13 +522,11 @@
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;
} }

View File

@@ -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,22 +38,29 @@ 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>

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 basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + path + "/"; String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + path + "/";
@@ -24,7 +24,8 @@
</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>
@@ -59,7 +60,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>
<div id="inOutItemDlg" class="easyui-dialog" style="width:380px;padding:10px 20px" <div id="inOutItemDlg" class="easyui-dialog" style="width:380px;padding:10px 20px"
@@ -67,7 +69,8 @@
<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>
@@ -85,31 +88,28 @@
</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"
onclick="javascript:$('#inOutItemDlg').dialog('close')">取消</a>
</div> </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,8 +119,7 @@
} }
//初始化表格数据 //初始化表格数据
function initTableData() function initTableData() {
{
$('#tableData').datagrid({ $('#tableData').datagrid({
//title:'收支项目', //title:'收支项目',
//iconCls:'icon-save', //iconCls:'icon-save',
@@ -151,12 +150,11 @@
{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;';
} }
@@ -169,8 +167,7 @@
id: 'addInOutItem', id: 'addInOutItem',
text: '增加', text: '增加',
iconCls: 'icon-add', iconCls: 'icon-add',
handler:function() handler: function () {
{
addInOutItem(); addInOutItem();
} }
}, },
@@ -178,14 +175,12 @@
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;
} }
@@ -193,35 +188,30 @@
} }
//初始化键盘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',
@@ -233,19 +223,15 @@
} }
}); });
} }
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",
@@ -256,8 +242,7 @@
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 == '成功')
//加载完以后重新初始化 //加载完以后重新初始化
@@ -266,8 +251,7 @@
$.messager.alert('删除提示', '删除收支项目失败,请稍后再试!', 'error'); $.messager.alert('删除提示', '删除收支项目失败,请稍后再试!', 'error');
}, },
//此处添加错误处理 //此处添加错误处理
error:function() error: function () {
{
$.messager.alert('删除提示', '删除收支项目异常,请稍后再试!', 'error'); $.messager.alert('删除提示', '删除收支项目异常,请稍后再试!', 'error');
return; return;
} }
@@ -277,25 +261,18 @@
} }
//批量删除收支项目 //批量删除收支项目
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;
} }
@@ -310,11 +287,9 @@
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);
@@ -323,8 +298,7 @@
$.messager.alert('删除提示', '删除收支项目失败,请稍后再试!', 'error'); $.messager.alert('删除提示', '删除收支项目失败,请稍后再试!', 'error');
}, },
//此处添加错误处理 //此处添加错误处理
error:function() error: function () {
{
$.messager.alert('删除提示', '删除收支项目异常,请稍后再试!', 'error'); $.messager.alert('删除提示', '删除收支项目异常,请稍后再试!', 'error');
return; return;
} }
@@ -340,8 +314,7 @@
//保存编辑前的名称 //保存编辑前的名称
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');
@@ -359,8 +332,7 @@
//保存收支项目 //保存收支项目
$("#saveInOutItem").unbind().bind({ $("#saveInOutItem").unbind().bind({
click:function() click: function () {
{
if (checkInOutItemName()) if (checkInOutItemName())
return; return;
if (!$("#type").val()) { if (!$("#type").val()) {
@@ -369,22 +341,18 @@
} }
$('#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');
//加载完以后重新初始化 //加载完以后重新初始化
@@ -398,8 +366,7 @@
}); });
//编辑收支项目 //编辑收支项目
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],
@@ -418,14 +385,12 @@
} }
//检查收支项目 名称是否存在 ++ 重名无法提示问题需要跟进 //检查收支项目 名称是否存在 ++ 重名无法提示问题需要跟进
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",
@@ -435,18 +400,15 @@
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,8 +419,7 @@
//搜索处理 //搜索处理
$("#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');
@@ -472,8 +433,7 @@
} }
}); });
function showInOutItemDetails(pageNo,pageSize) function showInOutItemDetails(pageNo, pageSize) {
{
$.ajax({ $.ajax({
type: "post", type: "post",
url: "<%=path %>/inOutItem/findBy.action", url: "<%=path %>/inOutItem/findBy.action",
@@ -485,13 +445,11 @@
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;
} }

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 basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + path + "/"; String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + path + "/";
@@ -23,7 +23,8 @@
</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>
@@ -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>
@@ -81,14 +83,14 @@
</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,8 +100,7 @@
}); });
//初始化表格数据 //初始化表格数据
function initTableData() function initTableData() {
{
$('#tableData').datagrid({ $('#tableData').datagrid({
//title:'供应商列表', //title:'供应商列表',
//iconCls:'icon-save', //iconCls:'icon-save',
@@ -132,8 +133,7 @@
{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;
} }
@@ -141,8 +141,7 @@
} }
//初始化键盘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;
@@ -152,21 +151,18 @@
//搜索按钮添加快捷键 //搜索按钮添加快捷键
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',
@@ -178,29 +174,25 @@
} }
}); });
} }
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,8 +219,7 @@
//搜索处理 //搜索处理
$("#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');
@@ -246,8 +233,7 @@
} }
}); });
function showLogDetails(pageNo,pageSize) function showLogDetails(pageNo, pageSize) {
{
$.ajax({ $.ajax({
type: "post", type: "post",
url: "<%=path %>/log/findBy.action", url: "<%=path %>/log/findBy.action",
@@ -263,14 +249,12 @@
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("");

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);
@@ -28,7 +28,8 @@
</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>
@@ -60,7 +61,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>
<div id="supplierDlg" class="easyui-dialog" style="width:600px;padding:10px 20px" <div id="supplierDlg" class="easyui-dialog" style="width:600px;padding:10px 20px"
@@ -70,7 +72,8 @@
<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>
@@ -154,12 +164,14 @@
</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"
onclick="javascript:$('#supplierDlg').dialog('close')">取消</a>
</div> </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"/>
@@ -177,7 +189,8 @@
<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>

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 basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + path + "/"; String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + path + "/";
@@ -26,7 +26,8 @@
</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,7 +49,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>
@@ -58,7 +60,9 @@
<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 %>"/>
@@ -66,13 +70,13 @@
</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"
onclick="javascript:$('#roleDlg').dialog('close')">取消</a>
</div> </div>
<script type="text/javascript"> <script type="text/javascript">
//初始化界面 //初始化界面
$(function() $(function () {
{
initTableData(); initTableData();
ininPager(); ininPager();
initForm(); initForm();
@@ -80,23 +84,19 @@
}); });
//浏览器适配 //浏览器适配
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;
@@ -105,8 +105,7 @@
} }
//初始化表格数据 //初始化表格数据
function initTableData() function initTableData() {
{
$('#tableData').datagrid({ $('#tableData').datagrid({
//title:'角色列表', //title:'角色列表',
//iconCls:'icon-save', //iconCls:'icon-save',
@@ -133,12 +132,11 @@
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;';
} }
@@ -151,8 +149,7 @@
id: 'addRole', id: 'addRole',
text: '增加', text: '增加',
iconCls: 'icon-add', iconCls: 'icon-add',
handler:function() handler: function () {
{
addRole(); addRole();
} }
}, },
@@ -160,14 +157,12 @@
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;
} }
@@ -175,34 +170,29 @@
} }
//初始化键盘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',
@@ -214,19 +204,15 @@
} }
}); });
} }
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",
@@ -235,11 +221,9 @@
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();
} }
@@ -247,8 +231,7 @@
$.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;
} }
@@ -292,11 +268,9 @@
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);
@@ -305,8 +279,7 @@
$.messager.alert('删除提示', '删除角色信息失败,请稍后再试!', 'error'); $.messager.alert('删除提示', '删除角色信息失败,请稍后再试!', 'error');
}, },
//此处添加错误处理 //此处添加错误处理
error:function() error: function () {
{
$.messager.alert('删除提示', '删除角色信息异常,请稍后再试!', 'error'); $.messager.alert('删除提示', '删除角色信息异常,请稍后再试!', 'error');
return; return;
} }
@@ -322,8 +295,7 @@
//保存编辑前的名称 //保存编辑前的名称
var orgRole = ""; var orgRole = "";
function addRole() function addRole() {
{
$("#clientIp").val('<%=clientIp %>'); $("#clientIp").val('<%=clientIp %>');
$("#sort").val(""); $("#sort").val("");
$("#remark").val(""); $("#remark").val("");
@@ -339,14 +311,12 @@
//保存信息 //保存信息
$("#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,
@@ -356,17 +326,14 @@
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,8 +341,7 @@
} }
}, },
//此处添加错误处理 //此处添加错误处理
error:function() error: function () {
{
$.messager.alert('提示', '保存角色信息异常,请稍后再试!', 'error'); $.messager.alert('提示', '保存角色信息异常,请稍后再试!', 'error');
return; return;
} }
@@ -385,8 +351,7 @@
}); });
//编辑信息 //编辑信息
function editRole(roleTotalInfo) function editRole(roleTotalInfo) {
{
var roleInfo = roleTotalInfo.split("AaBb"); var roleInfo = roleTotalInfo.split("AaBb");
$("#clientIp").val('<%=clientIp %>'); $("#clientIp").val('<%=clientIp %>');
@@ -402,14 +367,12 @@
} }
//检查名称是否存在 ++ 重名无法提示问题需要跟进 //检查名称是否存在 ++ 重名无法提示问题需要跟进
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",
@@ -419,11 +382,9 @@
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("");
@@ -431,8 +392,7 @@
} }
}, },
//此处添加错误处理 //此处添加错误处理
error:function() error: function () {
{
$.messager.alert('提示', '检查角色名称是否存在异常,请稍后再试!', 'error'); $.messager.alert('提示', '检查角色名称是否存在异常,请稍后再试!', 'error');
return; return;
} }
@@ -443,8 +403,7 @@
//搜索处理 //搜索处理
$("#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');
@@ -458,8 +417,7 @@
} }
}); });
function showRoleDetails(pageNo,pageSize) function showRoleDetails(pageNo, pageSize) {
{
$.ajax({ $.ajax({
type: "post", type: "post",
url: "<%=path %>/role/findBy.action", url: "<%=path %>/role/findBy.action",
@@ -469,13 +427,11 @@
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;
} }

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 basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + path + "/"; String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + path + "/";
@@ -57,8 +57,13 @@
//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 () {
@@ -72,12 +77,10 @@
$("#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';
} }
@@ -86,7 +89,8 @@
$.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,
@@ -106,8 +110,7 @@
}); });
//检查记录是否存在 //检查记录是否存在
function checkRoleAPP() function checkRoleAPP() {
{
//表示是否存在 true == 存在 false = 不存在 //表示是否存在 true == 存在 false = 不存在
var flag = false; var flag = false;
//开始ajax名称检验是否存在 //开始ajax名称检验是否存在
@@ -120,13 +123,11 @@
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;
} }

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 basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + path + "/"; String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + path + "/";
@@ -57,8 +57,13 @@
//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 () {
@@ -71,12 +76,10 @@
$("#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';
} }
@@ -85,7 +88,8 @@
$.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,
@@ -105,8 +109,7 @@
}); });
//检查记录是否存在 //检查记录是否存在
function checkRoleFunctions() function checkRoleFunctions() {
{
//表示是否存在 true == 存在 false = 不存在 //表示是否存在 true == 存在 false = 不存在
var flag = false; var flag = false;
//开始ajax名称检验是否存在 //开始ajax名称检验是否存在
@@ -119,13 +122,11 @@
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;
} }

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);
@@ -27,7 +27,8 @@
</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>
@@ -45,6 +46,7 @@
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';
@@ -62,6 +64,7 @@
} }
}); });
} }
//初始化表格数据 //初始化表格数据
function initTableData() { function initTableData() {
$('#tableData').datagrid({ $('#tableData').datagrid({
@@ -74,7 +77,8 @@
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(",");
@@ -97,8 +101,7 @@
} }
} }
]], ]],
onLoadError:function() onLoadError: function () {
{
$.messager.alert('页面加载提示', '页面加载异常,请稍后再试!', 'error'); $.messager.alert('页面加载提示', '页面加载异常,请稍后再试!', 'error');
return; return;
} }
@@ -107,13 +110,11 @@
//分页信息处理 //分页信息处理
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',
@@ -125,8 +126,7 @@
} }
}); });
} }
catch (e) catch (e) {
{
$.messager.alert('异常处理提示', "分页信息异常 : " + e.name + ": " + e.message, 'error'); $.messager.alert('异常处理提示', "分页信息异常 : " + e.name + ": " + e.message, 'error');
} }
} }
@@ -171,6 +171,7 @@
} }
}); });
} }
function bindEvent() { function bindEvent() {
setTimeout(function () { setTimeout(function () {
var bindBody = $("#pushList .datagrid-view2 .datagrid-body"); var bindBody = $("#pushList .datagrid-view2 .datagrid-body");

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);
@@ -96,7 +96,8 @@
<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>

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);
@@ -22,7 +22,8 @@
</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,16 +52,19 @@
<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>
@@ -69,21 +74,20 @@
</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"
onclick="javascript:$('#unitDlg').dialog('close')">取消</a>
</div> </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;
@@ -118,12 +122,12 @@
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, {
title: '操作', field: 'op', align: "center", width: 60,
formatter: function (value, rec) { 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 + ');"/>';
} }
@@ -173,6 +177,7 @@
$("#searchBtn").click(); $("#searchBtn").click();
} }
}); });
//分页信息处理 //分页信息处理
function ininPager() { function ininPager() {
try { try {
@@ -209,8 +214,7 @@
}), }),
success: function (tipInfo) { success: function (tipInfo) {
var msg = tipInfo.showModel.msgTip; var msg = tipInfo.showModel.msgTip;
if(msg == '成功') if (msg == '成功') {
{
//加载完以后重新初始化 //加载完以后重新初始化
$("#searchBtn").click(); $("#searchBtn").click();
} }
@@ -236,13 +240,10 @@
} }
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;
} }
@@ -299,14 +300,12 @@
//保存信息 //保存信息
$("#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());
@@ -320,17 +319,14 @@
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,8 +334,7 @@
} }
}, },
//此处添加错误处理 //此处添加错误处理
error:function() error: function () {
{
$.messager.alert('提示', '保存计量单位异常,请稍后再试!', 'error'); $.messager.alert('提示', '保存计量单位异常,请稍后再试!', 'error');
return; return;
} }
@@ -373,14 +368,12 @@
} }
//检查名称是否存在 ++ 重名无法提示问题需要跟进 //检查名称是否存在 ++ 重名无法提示问题需要跟进
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",
@@ -392,15 +385,13 @@
}), }),
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,8 +402,7 @@
//搜索处理 //搜索处理
$("#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');
@@ -426,8 +416,7 @@
} }
}); });
function showUnitDetails(pageNo,pageSize) function showUnitDetails(pageNo, pageSize) {
{
$.ajax({ $.ajax({
type: "post", type: "post",
url: "<%=path %>/unit/findBy.action", url: "<%=path %>/unit/findBy.action",
@@ -437,13 +426,11 @@
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;
} }

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 basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + path + "/"; String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + path + "/";
@@ -26,7 +26,8 @@
</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>
@@ -54,7 +55,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>
@@ -63,11 +65,13 @@
<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>
@@ -96,22 +101,20 @@
<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"
onclick="javascript:$('#userDlg').dialog('close')">取消</a>
</div> </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')
{
$("#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,8 +141,7 @@
} }
//初始化表格数据 //初始化表格数据
function initTableData() function initTableData() {
{
$('#tableData').datagrid({ $('#tableData').datagrid({
height: heightInfo, height: heightInfo,
nowrap: false, nowrap: false,
@@ -166,14 +167,13 @@
{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;';
@@ -191,8 +191,7 @@
id: 'addUser', id: 'addUser',
text: '增加', text: '增加',
iconCls: 'icon-add', iconCls: 'icon-add',
handler:function() handler: function () {
{
addUser(); addUser();
} }
}, },
@@ -200,14 +199,12 @@
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;
} }
@@ -215,8 +212,7 @@
} }
//初始化键盘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;
@@ -224,28 +220,24 @@
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',
@@ -257,19 +249,15 @@
} }
}); });
} }
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",
@@ -278,11 +266,9 @@
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();
@@ -293,8 +279,7 @@
$.messager.alert('删除提示', '删除用户信息失败,请稍后再试!', 'error'); $.messager.alert('删除提示', '删除用户信息失败,请稍后再试!', 'error');
}, },
//此处添加错误处理 //此处添加错误处理
error:function() error: function () {
{
$.messager.alert('删除提示', '删除用户信息异常,请稍后再试!', 'error'); $.messager.alert('删除提示', '删除用户信息异常,请稍后再试!', 'error');
return; return;
} }
@@ -304,25 +289,18 @@
} }
//批量删除用户 //批量删除用户
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;
} }
@@ -337,11 +315,9 @@
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();
@@ -351,8 +327,7 @@
$.messager.alert('删除提示', '删除用户信息失败,请稍后再试!', 'error'); $.messager.alert('删除提示', '删除用户信息失败,请稍后再试!', 'error');
}, },
//此处添加错误处理 //此处添加错误处理
error:function() error: function () {
{
$.messager.alert('删除提示', '删除用户信息异常,请稍后再试!', 'error'); $.messager.alert('删除提示', '删除用户信息异常,请稍后再试!', 'error');
return; return;
} }
@@ -368,8 +343,7 @@
//保存编辑前的名称 //保存编辑前的名称
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');
@@ -414,15 +388,13 @@
//保存用户信息 //保存用户信息
$("#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;
@@ -430,22 +402,18 @@
$('#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');
//加载完以后重新初始化 //加载完以后重新初始化
@@ -459,8 +427,7 @@
}); });
//编辑用户信息 //编辑用户信息
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],
@@ -487,14 +454,12 @@
//}); //});
//检查用户 名称是否存在 ++ 重名无法提示问题需要跟进 //检查用户 名称是否存在 ++ 重名无法提示问题需要跟进
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",
@@ -504,11 +469,9 @@
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("");
@@ -516,8 +479,7 @@
} }
}, },
//此处添加错误处理 //此处添加错误处理
error:function() error: function () {
{
$.messager.alert('提示', '检查用户名称是否存在异常,请稍后再试!', 'error'); $.messager.alert('提示', '检查用户名称是否存在异常,请稍后再试!', 'error');
return; return;
} }
@@ -528,8 +490,7 @@
//搜索处理 //搜索处理
$("#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');
@@ -543,8 +504,7 @@
} }
}); });
function showUserDetails(pageNo,pageSize) function showUserDetails(pageNo, pageSize) {
{
$.ajax({ $.ajax({
type: "post", type: "post",
url: "<%=path %>/user/findBy.action", url: "<%=path %>/user/findBy.action",
@@ -555,14 +515,12 @@
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;
} }

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);
@@ -28,7 +28,8 @@
</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>
@@ -60,7 +61,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>
<div id="supplierDlg" class="easyui-dialog" style="width:580px;padding:10px 20px" <div id="supplierDlg" class="easyui-dialog" style="width:580px;padding:10px 20px"
@@ -70,7 +72,8 @@
<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>
@@ -154,12 +164,14 @@
</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"
onclick="javascript:$('#supplierDlg').dialog('close')">取消</a>
</div> </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"/>
@@ -177,7 +189,8 @@
<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>

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);
@@ -30,7 +30,8 @@
</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>
@@ -59,7 +62,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>
@@ -70,11 +74,14 @@
<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,7 +97,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>
</table> </table>
@@ -99,7 +107,8 @@
</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"
onclick="javascript:$('#depotHeadDlg').dialog('close')">取消</a>
</div> </div>
<div id="depotHeadDlgShow" class="easyui-dialog" style="width:1200px;padding:10px 20px;top:70px" <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">

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);
@@ -30,7 +30,8 @@
</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>
@@ -59,7 +62,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>
@@ -70,11 +74,14 @@
<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,7 +97,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>
</table> </table>
@@ -99,7 +107,8 @@
</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"
onclick="javascript:$('#depotHeadDlg').dialog('close')">取消</a>
</div> </div>
<div id="depotHeadDlgShow" class="easyui-dialog" style="width:1200px;padding:10px 20px;top:70px" <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">

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);
@@ -28,7 +28,8 @@
</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,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);
@@ -30,7 +30,8 @@
</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>
@@ -59,7 +62,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>
@@ -70,11 +74,14 @@
<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,7 +97,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>
</table> </table>
@@ -99,7 +107,8 @@
</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"
onclick="javascript:$('#depotHeadDlg').dialog('close')">取消</a>
</div> </div>
<div id="depotHeadDlgShow" class="easyui-dialog" style="width:1200px;padding:10px 20px;top:70px" <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">

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);
@@ -30,7 +30,8 @@
</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>
@@ -59,7 +62,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>
@@ -70,11 +74,14 @@
<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,7 +97,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>
</table> </table>
@@ -99,7 +107,8 @@
</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"
onclick="javascript:$('#depotHeadDlg').dialog('close')">取消</a>
</div> </div>
<div id="depotHeadDlgShow" class="easyui-dialog" style="width:1200px;padding:10px 20px;top:60px" <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">

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);
@@ -30,7 +30,8 @@
</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>
@@ -59,7 +62,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>
@@ -70,11 +74,14 @@
<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,7 +97,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>
</table> </table>
@@ -99,7 +107,8 @@
</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"
onclick="javascript:$('#depotHeadDlg').dialog('close')">取消</a>
</div> </div>
<div id="depotHeadDlgShow" class="easyui-dialog" style="width:1200px;padding:10px 20px;top:60px" <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">

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);
@@ -24,7 +24,8 @@
</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>
@@ -53,11 +54,13 @@
</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="materialDetailListDlg" class="easyui-dialog" style="width:900px;height:500px;padding:10px 20px" closed="true" modal="true" collapsible="false" closable="true"> <div id="materialDetailListDlg" class="easyui-dialog" style="width:900px;height:500px;padding:10px 20px" closed="true"
modal="true" collapsible="false" closable="true">
<table id="materialTableData" style="top:50px;border-bottom-color:#FFFFFF"></table> <table id="materialTableData" style="top:50px;border-bottom-color:#FFFFFF"></table>
</div> </div>
@@ -70,11 +73,15 @@
<tr> <tr>
<td style="width:60px; height:30px;">品名</td> <td style="width:60px; height:30px;">品名</td>
<td style="padding:5px;width:180px;"> <td style="padding:5px;width:180px;">
<input name="Name" id="Name" class="easyui-validatebox" data-options="required:true,validType:'length[2,30]'" style="width: 180px;height: 20px"/> <input name="Name" id="Name" class="easyui-validatebox"
data-options="required:true,validType:'length[2,30]'"
style="width: 180px;height: 20px"/>
</td> </td>
<td style="width:80px;">型号</td> <td style="width:80px;">型号</td>
<td style="padding:5px;width:180px;"> <td style="padding:5px;width:180px;">
<input name="Model" id="Model" class="easyui-validatebox" data-options="required:true,validType:'length[1,30]'" style="width: 180px;height: 20px"/> <input name="Model" id="Model" class="easyui-validatebox"
data-options="required:true,validType:'length[1,30]'"
style="width: 180px;height: 20px"/>
</td> </td>
<td style="width:200px;"></td> <td style="width:200px;"></td>
</tr> </tr>
@@ -92,7 +99,8 @@
<tr> <tr>
<td style="height:30px;">备注</td> <td style="height:30px;">备注</td>
<td style="padding:5px" colspan="3"> <td style="padding:5px" colspan="3">
<textarea name="Remark" id="Remark" rows="2" cols="2" placeholder="暂无备注信息" style="width: 468px; height:40px;"></textarea> <textarea name="Remark" id="Remark" rows="2" cols="2" placeholder="暂无备注信息"
style="width: 468px; height:40px;"></textarea>
</td> </td>
<td></td> <td></td>
</tr> </tr>
@@ -103,12 +111,15 @@
<tr> <tr>
<td style="height:30px;">安全存量</td> <td style="height:30px;">安全存量</td>
<td style="padding:5px"> <td style="padding:5px">
<input name="SafetyStock" id="SafetyStock" class="easyui-validatebox" data-options="validType:'length[1,30]'" style="width: 180px;height: 20px"/> <input name="SafetyStock" id="SafetyStock" class="easyui-validatebox"
data-options="validType:'length[1,30]'" style="width: 180px;height: 20px"/>
</td> </td>
<td>单位</td> <td>单位</td>
<td style="padding:5px"> <td style="padding:5px">
<input name="Unit" id="Unit" class="easyui-validatebox" data-options="validType:'length[1,30]'" style="width: 180px;height: 20px; "/> <input name="Unit" id="Unit" class="easyui-validatebox"
<select name="manyUnit" id="manyUnit" style="width:180px;height: 20px;display: none"></select> data-options="validType:'length[1,30]'" style="width: 180px;height: 20px; "/>
<select name="manyUnit" id="manyUnit"
style="width:180px;height: 20px;display: none"></select>
</td> </td>
<td> <td>
<input id="manyUnitCheck" type="checkbox"/>多单位 <input id="manyUnitCheck" type="checkbox"/>多单位
@@ -157,16 +168,26 @@
</tr> </tr>
<tr class="price-one"> <tr class="price-one">
<td style="height:30px;">零售价</td> <td style="height:30px;">零售价</td>
<td style="padding:5px"><input name="RetailPrice" id="RetailPrice" class="easyui-validatebox" data-options="validType:'length[1,30]'" style="width: 180px;height: 20px"/></td> <td style="padding:5px"><input name="RetailPrice" id="RetailPrice" class="easyui-validatebox"
data-options="validType:'length[1,30]'"
style="width: 180px;height: 20px"/></td>
<td>最低售价</td> <td>最低售价</td>
<td style="padding:5px"><input name="LowPrice" id="LowPrice" class="easyui-validatebox" data-options="validType:'length[1,30]'" style="width: 180px;height: 20px"/></td> <td style="padding:5px"><input name="LowPrice" id="LowPrice" class="easyui-validatebox"
data-options="validType:'length[1,30]'"
style="width: 180px;height: 20px"/></td>
<td></td> <td></td>
</tr> </tr>
<tr class="price-two"> <tr class="price-two">
<td style="height:30px;">预计采购价</td> <td style="height:30px;">预计采购价</td>
<td style="padding:5px"><input name="PresetPriceOne" id="PresetPriceOne" class="easyui-validatebox" data-options="validType:'length[1,30]'" style="width: 180px;height: 20px"/></td> <td style="padding:5px"><input name="PresetPriceOne" id="PresetPriceOne"
class="easyui-validatebox"
data-options="validType:'length[1,30]'"
style="width: 180px;height: 20px"/></td>
<td>批发价</td> <td>批发价</td>
<td style="padding:5px"><input name="PresetPriceTwo" id="PresetPriceTwo" class="easyui-validatebox" data-options="validType:'length[1,30]'" style="width: 180px;height: 20px"/></td> <td style="padding:5px"><input name="PresetPriceTwo" id="PresetPriceTwo"
class="easyui-validatebox"
data-options="validType:'length[1,30]'"
style="width: 180px;height: 20px"/></td>
<td></td> <td></td>
</tr> </tr>
</table> </table>
@@ -176,37 +197,43 @@
<tr class="tr-color"> <tr class="tr-color">
<td style="width:60px; height:30px;">颜色</td> <td style="width:60px; height:30px;">颜色</td>
<td style="padding:5px"> <td style="padding:5px">
<input name="Color" id="Color" class="easyui-validatebox" data-options="validType:'length[1,30]'" style="width: 250px;height: 20px"/> <input name="Color" id="Color" class="easyui-validatebox"
data-options="validType:'length[1,30]'" style="width: 250px;height: 20px"/>
</td> </td>
</tr> </tr>
<tr class="tr-standard"> <tr class="tr-standard">
<td>规格</td> <td>规格</td>
<td style="padding:5px"> <td style="padding:5px">
<input name="Standard" id="Standard" class="easyui-validatebox" data-options="validType:'length[1,30]'" style="width: 250px;height: 20px"/> <input name="Standard" id="Standard" class="easyui-validatebox"
data-options="validType:'length[1,30]'" style="width: 250px;height: 20px"/>
</td> </td>
</tr> </tr>
<tr class="tr-mfrs"> <tr class="tr-mfrs">
<td>制造商</td> <td>制造商</td>
<td style="padding:5px"> <td style="padding:5px">
<input name="Mfrs" id="Mfrs" class="easyui-validatebox" data-options="validType:'length[1,30]'" style="width: 250px;height: 20px"/> <input name="Mfrs" id="Mfrs" class="easyui-validatebox"
data-options="validType:'length[1,30]'" style="width: 250px;height: 20px"/>
</td> </td>
</tr> </tr>
<tr class="tr-otherField1"> <tr class="tr-otherField1">
<td>自定义1</td> <td>自定义1</td>
<td style="padding:5px"> <td style="padding:5px">
<input name="OtherField1" id="OtherField1" class="easyui-validatebox" data-options="validType:'length[1,30]'" style="width: 250px;height: 20px"/> <input name="OtherField1" id="OtherField1" class="easyui-validatebox"
data-options="validType:'length[1,30]'" style="width: 250px;height: 20px"/>
</td> </td>
</tr> </tr>
<tr class="tr-otherField2"> <tr class="tr-otherField2">
<td>自定义2</td> <td>自定义2</td>
<td style="padding:5px"> <td style="padding:5px">
<input name="OtherField2" id="OtherField2" class="easyui-validatebox" data-options="validType:'length[1,30]'" style="width: 250px;height: 20px"/> <input name="OtherField2" id="OtherField2" class="easyui-validatebox"
data-options="validType:'length[1,30]'" style="width: 250px;height: 20px"/>
</td> </td>
</tr> </tr>
<tr class="tr-otherField3"> <tr class="tr-otherField3">
<td>自定义3</td> <td>自定义3</td>
<td style="padding:5px"> <td style="padding:5px">
<input name="OtherField3" id="OtherField3" class="easyui-validatebox" data-options="validType:'length[1,30]'" style="width: 250px;height: 20px"/> <input name="OtherField3" id="OtherField3" class="easyui-validatebox"
data-options="validType:'length[1,30]'" style="width: 250px;height: 20px"/>
</td> </td>
</tr> </tr>
</table> </table>
@@ -217,7 +244,8 @@
</div> </div>
<div id="dlg-buttons"> <div id="dlg-buttons">
<a href="javascript:void(0)" id="saveMaterial" class="easyui-linkbutton" iconCls="icon-ok">保存</a> <a href="javascript:void(0)" id="saveMaterial" class="easyui-linkbutton" iconCls="icon-ok">保存</a>
<a href="javascript:void(0)" id="cancelMaterial" class="easyui-linkbutton" iconCls="icon-cancel" onclick="javascript:$('#materialDlg').dialog('close')">取消</a> <a href="javascript:void(0)" id="cancelMaterial" class="easyui-linkbutton" iconCls="icon-cancel"
onclick="javascript:$('#materialDlg').dialog('close')">取消</a>
</div> </div>
<!-- 导入excel表格 --> <!-- 导入excel表格 -->
@@ -241,7 +269,8 @@
<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>
@@ -257,8 +286,7 @@
var mPropertyList = null; //商品属性列表 var mPropertyList = null; //商品属性列表
var mPropertyListShort = ""; //商品属性列表-传值 var mPropertyListShort = ""; //商品属性列表-传值
//初始化界面 //初始化界面
$(function() $(function () {
{
//初始化系统基础信息 //初始化系统基础信息
initMProperty(); initMProperty();
initSystemData(1); initSystemData(1);
@@ -291,6 +319,7 @@
} }
}); });
} }
function initSystemData(parentid_search) { function initSystemData(parentid_search) {
$.ajax({ $.ajax({
type: "post", type: "post",
@@ -301,60 +330,49 @@
//设置为同步 //设置为同步
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) {
{
materialID = materialCategory.id; materialID = materialCategory.id;
} }
options += '<option value="' + materialCategory.id + '">' + materialCategory.name + '</option>'; options += '<option value="' + materialCategory.id + '">' + materialCategory.name + '</option>';
if(lei=="search_second"||lei=="type_second"||lei=="search_three") if (lei == "search_second" || lei == "type_second" || lei == "search_three") {
{
types += materialCategory.id + ','; types += materialCategory.id + ',';
} }
} }
if(lei=="search_first") if (lei == "search_first") {
{
$("#searchCategoryId_f").empty().append('<option value="">全部</option>').append(options); $("#searchCategoryId_f").empty().append('<option value="">全部</option>').append(options);
} }
else if(lei=="search_second") else if (lei == "search_second") {
{
$("#searchCategoryId_s").empty().append('<option value="">全部</option>').append(options); $("#searchCategoryId_s").empty().append('<option value="">全部</option>').append(options);
} }
else if(lei=="search_three") else if (lei == "search_three") {
{
$("#searchCategoryId_t").empty().append('<option value="">全部</option>').append(options); $("#searchCategoryId_t").empty().append('<option value="">全部</option>').append(options);
} }
else if(lei=="edit_first") else if (lei == "edit_first") {
{
$("#CategoryId_f").empty().append('<option value="">全部</option>').append(options); $("#CategoryId_f").empty().append('<option value="">全部</option>').append(options);
} }
else if(lei=="edit_second") else if (lei == "edit_second") {
{
$("#CategoryId_s").empty().append('<option value="">全部</option>').append(options); $("#CategoryId_s").empty().append('<option value="">全部</option>').append(options);
} }
else if(lei=="edit_three") else if (lei == "edit_three") {
{
$("#CategoryId_t").empty().append('<option value="">全部</option>').append(options); $("#CategoryId_t").empty().append('<option value="">全部</option>').append(options);
} }
} }
@@ -363,17 +381,14 @@
//一级目录-查询方法 //一级目录-查询方法
var searchFirst = function () { var searchFirst = function () {
var parentid_search = $("#searchCategoryId_f").val(); var parentid_search = $("#searchCategoryId_f").val();
if(parentid_search!='') if (parentid_search != '') {
{
types += parentid_search + ','; types += parentid_search + ',';
initSystemData(parentid_search); initSystemData(parentid_search);
initSelectInfo("search_second"); initSelectInfo("search_second");
var arr = types.split(','); var arr = types.split(',');
for(var i=0;i<arr.length;i++) for (var i = 0; i < arr.length; i++) {
{ if (arr[i] != '' && arr[i] != parentid_search) {
if(arr[i]!='' && arr[i]!=parentid_search)
{
initSystemData(arr[i]); initSystemData(arr[i]);
initSelectInfo("type_second"); initSelectInfo("type_second");
} }
@@ -397,8 +412,7 @@
//二级目录-查询方法 //二级目录-查询方法
var searchSecond = function () { var searchSecond = function () {
var parentid_search = $("#searchCategoryId_s").val(); var parentid_search = $("#searchCategoryId_s").val();
if(parentid_search!='') if (parentid_search != '') {
{
initSystemData(parentid_search); initSystemData(parentid_search);
initSelectInfo("search_three"); initSelectInfo("search_three");
types = types.substring(0, types.length - 1); types = types.substring(0, types.length - 1);
@@ -420,8 +434,7 @@
$("#searchCategoryId_t").change( $("#searchCategoryId_t").change(
function () { function () {
var parentid_search = $("#searchCategoryId_t").val(); var parentid_search = $("#searchCategoryId_t").val();
if(parentid_search!='') if (parentid_search != '') {
{
types = parentid_search; types = parentid_search;
setCategoryId = types; setCategoryId = types;
types = ""; types = "";
@@ -435,8 +448,7 @@
$("#CategoryId_f").change( $("#CategoryId_f").change(
function () { function () {
var CategoryId_f = $("#CategoryId_f").val(); var CategoryId_f = $("#CategoryId_f").val();
if(CategoryId_f!='') if (CategoryId_f != '') {
{
initSystemData(CategoryId_f); initSystemData(CategoryId_f);
initSelectInfo("edit_second"); initSelectInfo("edit_second");
} }
@@ -446,8 +458,7 @@
$("#CategoryId_s").change( $("#CategoryId_s").change(
function () { function () {
var CategoryId_s = $("#CategoryId_s").val(); var CategoryId_s = $("#CategoryId_s").val();
if(CategoryId_s!='') if (CategoryId_s != '') {
{
initSystemData(CategoryId_s); initSystemData(CategoryId_s);
initSelectInfo("edit_three"); initSelectInfo("edit_three");
} }
@@ -455,8 +466,7 @@
); );
//防止表单提交重复 //防止表单提交重复
function initForm() function initForm() {
{
$('#materialFM').form({ $('#materialFM').form({
onSubmit: function () { onSubmit: function () {
return false; return false;
@@ -590,15 +600,15 @@
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.Model + 'AaBb' + rec.Color + 'AaBb' + rec.Unit + 'AaBb' + rec.RetailPrice var rowInfo = rec.Id + 'AaBb' + rec.Name + 'AaBb' + rec.Model + 'AaBb' + rec.Color + 'AaBb' + rec.Unit + 'AaBb' + rec.RetailPrice
+ 'AaBb' + rec.LowPrice + 'AaBb' + rec.PresetPriceOne + 'AaBb' + rec.PresetPriceTwo + 'AaBb' + rec.Remark + 'AaBb' + rec.Standard + 'AaBb' + rec.LowPrice + 'AaBb' + rec.PresetPriceOne + 'AaBb' + rec.PresetPriceTwo + 'AaBb' + rec.Remark + 'AaBb' + rec.Standard
+ 'AaBb' + rec.Color + 'AaBb' + rec.Packing + 'AaBb' + rec.SafetyStock + 'AaBb' + rec.CategoryId + 'AaBb' + rec.CategoryName + 'AaBb' + rec.Color + 'AaBb' + rec.Packing + 'AaBb' + rec.SafetyStock + 'AaBb' + rec.CategoryId + 'AaBb' + rec.CategoryName
+ 'AaBb' + rec.UnitId + 'AaBb' + rec.UnitName + 'AaBb' + rec.FirstOutUnit + 'AaBb' + rec.FirstInUnit + 'AaBb' + rec.UnitId + 'AaBb' + rec.UnitName + 'AaBb' + rec.FirstOutUnit + 'AaBb' + rec.FirstInUnit
+ 'AaBb' + rec.Mfrs + 'AaBb' + rec.OtherField1 + 'AaBb' + rec.OtherField2 + 'AaBb' + rec.OtherField3; + 'AaBb' + rec.Mfrs + 'AaBb' + rec.OtherField1 + 'AaBb' + rec.OtherField2 + 'AaBb' + rec.OtherField3;
if(1 == value) if (1 == value) {
{
str += '<img title="编辑" src="<%=path%>/js/easyui-1.3.5/themes/icons/pencil.png" style="cursor: pointer;" onclick="editMaterial(\'' + rowInfo + '\');"/>&nbsp;&nbsp;&nbsp;'; str += '<img title="编辑" src="<%=path%>/js/easyui-1.3.5/themes/icons/pencil.png" style="cursor: pointer;" onclick="editMaterial(\'' + rowInfo + '\');"/>&nbsp;&nbsp;&nbsp;';
str += '<img title="删除" src="<%=path%>/js/easyui-1.3.5/themes/icons/edit_remove.png" style="cursor: pointer;" onclick="deleteMaterial(' + rec.Id + ');"/>'; str += '<img title="删除" src="<%=path%>/js/easyui-1.3.5/themes/icons/edit_remove.png" style="cursor: pointer;" onclick="deleteMaterial(' + rec.Id + ');"/>';
} }
@@ -610,7 +620,8 @@
{title: '扩展信息', field: 'MaterialOther', width: 150}, {title: '扩展信息', field: 'MaterialOther', width: 150},
{title: '单位', field: 'Unit', width: 60}, {title: '单位', field: 'Unit', width: 60},
{title: '安全存量', field: 'SafetyStock', width: 70}, {title: '安全存量', field: 'SafetyStock', width: 70},
{ title: '库存',field: 'abc',width:70, formatter:function(value,rec){ {
title: '库存', field: 'abc', width: 70, formatter: function (value, rec) {
var monthTime = getNowFormatMonth(); var monthTime = getNowFormatMonth();
var mId = rec.Id; //商品id var mId = rec.Id; //商品id
var thisStock = 0; var thisStock = 0;
@@ -644,22 +655,24 @@
} }
}); });
return "<span class='class-" + rec.Id + "'>" + thisStock + "</span>"; return "<span class='class-" + rec.Id + "'>" + thisStock + "</span>";
}}, }
},
{title: '零售价', field: 'RetailPrice', width: 60}, {title: '零售价', field: 'RetailPrice', width: 60},
{title: '最低售价', field: 'LowPrice', width: 70}, {title: '最低售价', field: 'LowPrice', width: 70},
{title: '预计采购价', field: 'PresetPriceOne', width: 70}, {title: '预计采购价', field: 'PresetPriceOne', width: 70},
{title: '批发价', field: 'PresetPriceTwo', width: 70}, {title: '批发价', field: 'PresetPriceTwo', width: 70},
{ title: '状态',field: 'Enabled',width:50,align:"center",formatter:function(value){ {
title: '状态', field: 'Enabled', width: 50, align: "center", formatter: function (value) {
return value ? "启用" : "禁用"; return value ? "启用" : "禁用";
}} }
}
]], ]],
toolbar: [ toolbar: [
{ {
id: 'addMaterial', id: 'addMaterial',
text: '增加', text: '增加',
iconCls: 'icon-add', iconCls: 'icon-add',
handler:function() handler: function () {
{
addMaterial(); addMaterial();
} }
}, },
@@ -668,8 +681,7 @@
id: 'deleteMaterial', id: 'deleteMaterial',
text: '删除', text: '删除',
iconCls: 'icon-remove', iconCls: 'icon-remove',
handler:function() handler: function () {
{
batDeleteMaterial(); batDeleteMaterial();
} }
}, },
@@ -710,8 +722,7 @@
} }
} }
], ],
onLoadError:function() onLoadError: function () {
{
$.messager.alert('页面加载提示', '页面加载异常,请稍后再试!', 'error'); $.messager.alert('页面加载提示', '页面加载异常,请稍后再试!', 'error');
return; return;
} }
@@ -739,7 +750,8 @@
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>";
@@ -800,34 +812,29 @@
} }
//初始化键盘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")) {
{
$("#saveMaterial").click(); $("#saveMaterial").click();
} }
//搜索按钮添加快捷键 //搜索按钮添加快捷键
if(k == "13"&&(obj.id=="searchCategoryId"||(obj.id=="searchName"))) if (k == "13" && (obj.id == "searchCategoryId" || (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',
@@ -839,19 +846,15 @@
} }
}); });
} }
catch (e) catch (e) {
{
$.messager.alert('异常处理提示', "分页信息异常 : " + e.name + ": " + e.message, 'error'); $.messager.alert('异常处理提示', "分页信息异常 : " + e.name + ": " + e.message, 'error');
} }
} }
//删除商品信息 //删除商品信息
function deleteMaterial(materialID) function deleteMaterial(materialID) {
{ $.messager.confirm('删除确认', '确定要删除此商品信息吗?', function (r) {
$.messager.confirm('删除确认','确定要删除此商品信息吗?',function(r) if (r) {
{
if (r)
{
$.ajax({ $.ajax({
type: "post", type: "post",
url: "<%=path %>/material/delete.action", url: "<%=path %>/material/delete.action",
@@ -860,11 +863,9 @@
materialID: materialID, materialID: materialID,
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();
} }
@@ -872,8 +873,7 @@
$.messager.alert('删除提示', '删除商品信息失败,请稍后再试!', 'error'); $.messager.alert('删除提示', '删除商品信息失败,请稍后再试!', 'error');
}, },
//此处添加错误处理 //此处添加错误处理
error:function() error: function () {
{
$.messager.alert('删除提示', '删除商品信息异常,请稍后再试!', 'error'); $.messager.alert('删除提示', '删除商品信息异常,请稍后再试!', 'error');
return; return;
} }
@@ -883,25 +883,18 @@
} }
//批量删除商品 //批量删除商品
function batDeleteMaterial() function batDeleteMaterial() {
{
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;
} }
@@ -917,11 +910,9 @@
materialIDs: ids, materialIDs: 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);
@@ -930,8 +921,7 @@
$.messager.alert('删除提示', '删除商品信息失败,请稍后再试!', 'error'); $.messager.alert('删除提示', '删除商品信息失败,请稍后再试!', 'error');
}, },
//此处添加错误处理 //此处添加错误处理
error:function() error: function () {
{
$.messager.alert('删除提示', '删除商品信息异常,请稍后再试!', 'error'); $.messager.alert('删除提示', '删除商品信息异常,请稍后再试!', 'error');
return; return;
} }
@@ -944,22 +934,16 @@
//批量启用 //批量启用
function setEnableFun() { function setEnableFun() {
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;
} }
@@ -975,11 +959,9 @@
materialIDs: ids, materialIDs: 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);
@@ -988,8 +970,7 @@
$.messager.alert('启用提示', '启用信息失败,请稍后再试!', 'error'); $.messager.alert('启用提示', '启用信息失败,请稍后再试!', 'error');
}, },
//此处添加错误处理 //此处添加错误处理
error:function() error: function () {
{
$.messager.alert('启用提示', '启用信息异常,请稍后再试!', 'error'); $.messager.alert('启用提示', '启用信息异常,请稍后再试!', 'error');
return; return;
} }
@@ -1002,22 +983,16 @@
//批量禁用 //批量禁用
function setDisEnableFun() { function setDisEnableFun() {
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;
} }
@@ -1033,11 +1008,9 @@
materialIDs: ids, materialIDs: 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);
@@ -1046,8 +1019,7 @@
$.messager.alert('禁用提示', '禁用信息失败,请稍后再试!', 'error'); $.messager.alert('禁用提示', '禁用信息失败,请稍后再试!', 'error');
}, },
//此处添加错误处理 //此处添加错误处理
error:function() error: function () {
{
$.messager.alert('禁用提示', '禁用信息异常,请稍后再试!', 'error'); $.messager.alert('禁用提示', '禁用信息异常,请稍后再试!', 'error');
return; return;
} }
@@ -1175,10 +1147,13 @@
$('#materialDlg').dialog('open').dialog('setTitle', '<img src="<%=path%>/js/easyui-1.3.5/themes/icons/edit_add.png"/>&nbsp;增加商品信息'); $('#materialDlg').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();
$("#CategoryId_f").show(); $("#CategoryId_s").show(); $("#CategoryId_t").show(); //全部显示 $("#CategoryId_f").show();
$("#CategoryId_s").show();
$("#CategoryId_t").show(); //全部显示
$("#mTypeName").hide(); $("#mTypeName").hide();
$("#mTypeChange").hide(); //按钮隐藏 $("#mTypeChange").hide(); //按钮隐藏
$("#CategoryId_s").empty(); $("#CategoryId_t").empty(); //清空类型下拉 $("#CategoryId_s").empty();
$("#CategoryId_t").empty(); //清空类型下拉
$("#manyUnitCheck").prop("checked", false); $("#manyUnitCheck").prop("checked", false);
//当前为不选中状态 //当前为不选中状态
@@ -1272,16 +1247,13 @@
return; return;
} }
var parent = 1; var parent = 1;
if($("#CategoryId_f").val()!=""&&$("#CategoryId_f").val()!=null) if ($("#CategoryId_f").val() != "" && $("#CategoryId_f").val() != null) {
{
parent = $("#CategoryId_f").val(); parent = $("#CategoryId_f").val();
} }
if($("#CategoryId_s").val()!=""&&$("#CategoryId_s").val()!=null) if ($("#CategoryId_s").val() != "" && $("#CategoryId_s").val() != null) {
{
parent = $("#CategoryId_s").val(); parent = $("#CategoryId_s").val();
} }
if($("#CategoryId_t").val()!=""&&$("#CategoryId_t").val()!=null) if ($("#CategoryId_t").val() != "" && $("#CategoryId_t").val() != null) {
{
parent = $("#CategoryId_t").val(); parent = $("#CategoryId_t").val();
} }
//构造价格列表json //构造价格列表json
@@ -1334,17 +1306,14 @@
Remark: $.trim($("#Remark").val()), Remark: $.trim($("#Remark").val()),
clientIp: '<%=clientIp %>' clientIp: '<%=clientIp %>'
}), }),
success: function (tipInfo) success: function (tipInfo) {
{ if (tipInfo) {
if(tipInfo)
{
$('#materialDlg').dialog('close'); $('#materialDlg').dialog('close');
var opts = $("#tableData").datagrid('options'); var opts = $("#tableData").datagrid('options');
showMaterialDetails(opts.pageNumber, opts.pageSize); showMaterialDetails(opts.pageNumber, opts.pageSize);
} }
else else {
{
$.messager.show({ $.messager.show({
title: '错误提示', title: '错误提示',
msg: '保存商品信息失败,请稍后重试!' msg: '保存商品信息失败,请稍后重试!'
@@ -1352,8 +1321,7 @@
} }
}, },
//此处添加错误处理 //此处添加错误处理
error:function() error: function () {
{
$.messager.alert('提示', '保存商品信息异常,请稍后再试!', 'error'); $.messager.alert('提示', '保存商品信息异常,请稍后再试!', 'error');
return; return;
} }
@@ -1361,6 +1329,7 @@
}); });
var mId = 0, mName = ""; var mId = 0, mName = "";
//根据id查询类型信息 //根据id查询类型信息
function findByTypeId(Id) { function findByTypeId(Id) {
$.ajax({ $.ajax({
@@ -1372,8 +1341,7 @@
//设置为同步 //设置为同步
async: false, async: false,
dataType: "json", dataType: "json",
success: function (res) success: function (res) {
{
if (res) { if (res) {
mId = res.parentId; mId = res.parentId;
mName = res.name; mName = res.name;
@@ -1383,8 +1351,7 @@
} }
//编辑信息 //编辑信息
function editMaterial(materialTotalInfo) function editMaterial(materialTotalInfo) {
{
var materialInfo = materialTotalInfo.split("AaBb"); var materialInfo = materialTotalInfo.split("AaBb");
$("#clientIp").val('<%=clientIp %>'); $("#clientIp").val('<%=clientIp %>');
@@ -1425,8 +1392,11 @@
else { else {
categoryName = mName + categoryName; categoryName = mName + categoryName;
} }
$("#CategoryId_s").empty(); $("#CategoryId_t").empty(); //清空类型下拉 $("#CategoryId_s").empty();
$("#CategoryId_f").hide(); $("#CategoryId_s").hide(); $("#CategoryId_t").hide(); //全部隐藏 $("#CategoryId_t").empty(); //清空类型下拉
$("#CategoryId_f").hide();
$("#CategoryId_s").hide();
$("#CategoryId_t").hide(); //全部隐藏
$("#mTypeName").text(categoryName).show(); //类型显示 $("#mTypeName").text(categoryName).show(); //类型显示
$("#mTypeChange").show(); //按钮显示 $("#mTypeChange").show(); //按钮显示
$("#Packing").focus().val(materialInfo[12]); $("#Packing").focus().val(materialInfo[12]);
@@ -1533,13 +1503,14 @@
$("#mTypeChange").off("click").on("click", function () { $("#mTypeChange").off("click").on("click", function () {
$(this).hide(); $(this).hide();
$("#mTypeName").hide(); $("#mTypeName").hide();
$("#CategoryId_f").show(); $("#CategoryId_s").show(); $("#CategoryId_t").show(); //全部显示 $("#CategoryId_f").show();
$("#CategoryId_s").show();
$("#CategoryId_t").show(); //全部显示
}); });
//搜索处理 //搜索处理
$("#searchBtn").unbind().bind({ $("#searchBtn").unbind().bind({
click:function() click: function () {
{
showMaterialDetails(1, initPageSize); showMaterialDetails(1, initPageSize);
var opts = $("#tableData").datagrid('options'); var opts = $("#tableData").datagrid('options');
var pager = $("#tableData").datagrid('getPager'); var pager = $("#tableData").datagrid('getPager');
@@ -1574,13 +1545,11 @@
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;
} }
@@ -1594,7 +1563,8 @@
$("#searchCategoryId_f").val(""); $("#searchCategoryId_f").val("");
$("#searchCategoryId_s").val(""); $("#searchCategoryId_s").val("");
$("#searchCategoryId_t").val(""); $("#searchCategoryId_t").val("");
$("#searchCategoryId_s").empty(); $("#searchCategoryId_t").empty(); //清空类型下拉 $("#searchCategoryId_s").empty();
$("#searchCategoryId_t").empty(); //清空类型下拉
setCategoryId = "1"; setCategoryId = "1";
//加载完以后重新初始化 //加载完以后重新初始化
$("#searchBtn").click(); $("#searchBtn").click();

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);
@@ -22,7 +22,8 @@
</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>
@@ -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,7 +81,8 @@
</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">
@@ -120,18 +125,20 @@
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){ {
title: '是否启用', field: 'enabled', width: 100, formatter: function (value, rec) {
if (rec.enabled) { if (rec.enabled) {
return "启用"; return "启用";
} }
else { else {
return "禁用"; return "禁用";
} }
}}, }
},
{title: '排序', field: 'sort', width: 100}, {title: '排序', field: 'sort', width: 100},
{title: '别名', field: 'anotherName', width: 100}, {title: '别名', field: 'anotherName', width: 100},
{ title: '操作',field: 'op',align:"center",width:80,formatter:function(value,rec)
{ {
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,8 +146,7 @@
} }
} }
]], ]],
onLoadError:function() onLoadError: function () {
{
$.messager.alert('页面加载提示', '页面加载异常,请稍后再试!', 'error'); $.messager.alert('页面加载提示', '页面加载异常,请稍后再试!', 'error');
return; return;
} }
@@ -163,10 +169,10 @@
$("#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({
@@ -181,8 +187,7 @@
} }
}); });
} }
catch (e) catch (e) {
{
$.messager.alert('异常处理提示', "分页信息异常 : " + e.name + ": " + e.message, 'error'); $.messager.alert('异常处理提示', "分页信息异常 : " + e.name + ": " + e.message, 'error');
} }
} }
@@ -250,8 +255,7 @@
//搜索处理 //搜索处理
$("#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');
@@ -278,8 +282,7 @@
$("#tableData").datagrid('loadData', data); $("#tableData").datagrid('loadData', data);
}, },
//此处添加错误处理 //此处添加错误处理
error:function() error: function () {
{
$.messager.alert('查询提示', '查询数据后台异常,请稍后再试!', 'error'); $.messager.alert('查询提示', '查询数据后台异常,请稍后再试!', 'error');
return; return;
} }

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 basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + path + "/"; String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + path + "/";
@@ -23,7 +23,8 @@
</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>
@@ -47,7 +48,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>
@@ -57,7 +59,9 @@
<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>
@@ -82,7 +86,8 @@
</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"
onclick="javascript:$('#materialCategoryDlg').dialog('close')">取消</a>
</div> </div>
<script type="text/javascript"> <script type="text/javascript">
@@ -91,8 +96,7 @@
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,8 +106,7 @@
}); });
//初始化系统基础信息 //初始化系统基础信息
function initSystemData(parentid_search) function initSystemData(parentid_search) {
{
$.ajax({ $.ajax({
type: "post", type: "post",
url: "<%=path%>/materialCategory/getBasicData.action", url: "<%=path%>/materialCategory/getBasicData.action",
@@ -113,54 +116,44 @@
//设置为同步 //设置为同步
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);
} }
} }
@@ -169,8 +162,7 @@
$("#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);
} }
@@ -180,8 +172,7 @@
$("#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);
} }
@@ -191,19 +182,16 @@
$("#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);
} }
@@ -219,8 +207,7 @@
); );
//防止表单提交重复 //防止表单提交重复
function initForm() function initForm() {
{
$('#materialCategoryFM').form({ $('#materialCategoryFM').form({
onSubmit: function () { onSubmit: function () {
return false; return false;
@@ -229,8 +216,7 @@
} }
//初始化表格数据 //初始化表格数据
function initTableData() function initTableData() {
{
$('#tableData').datagrid({ $('#tableData').datagrid({
//title:'商品类别列表', //title:'商品类别列表',
//iconCls:'icon-save', //iconCls:'icon-save',
@@ -257,12 +243,11 @@
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;';
} }
@@ -275,8 +260,7 @@
id: 'addMaterialCategory', id: 'addMaterialCategory',
text: '增加', text: '增加',
iconCls: 'icon-add', iconCls: 'icon-add',
handler:function() handler: function () {
{
addMaterialCategory(); addMaterialCategory();
} }
}, },
@@ -285,14 +269,12 @@
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;
} }
@@ -300,34 +282,29 @@
} }
//初始化键盘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',
@@ -339,19 +316,15 @@
} }
}); });
} }
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",
@@ -360,11 +333,9 @@
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();
} }
@@ -372,8 +343,7 @@
$.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;
} }
@@ -417,11 +380,9 @@
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);
@@ -430,8 +391,7 @@
$.messager.alert('删除提示', '删除商品类别信息失败,请稍后再试!', 'error'); $.messager.alert('删除提示', '删除商品类别信息失败,请稍后再试!', 'error');
}, },
//此处添加错误处理 //此处添加错误处理
error:function() error: function () {
{
$.messager.alert('删除提示', '删除商品类别信息异常,请稍后再试!', 'error'); $.messager.alert('删除提示', '删除商品类别信息异常,请稍后再试!', 'error');
return; return;
} }
@@ -447,8 +407,7 @@
//保存编辑前的名称 //保存编辑前的名称
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;增加商品类别信息');
@@ -462,19 +421,15 @@
//保存信息 //保存信息
$("#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({
@@ -488,17 +443,14 @@
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,8 +458,7 @@
} }
}, },
//此处添加错误处理 //此处添加错误处理
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 %>');
@@ -537,8 +487,7 @@
//搜索处理 //搜索处理
$("#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');
@@ -553,19 +502,15 @@
}); });
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();
} }
@@ -579,13 +524,11 @@
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;
} }

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);
@@ -30,7 +30,8 @@
</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>
@@ -59,7 +62,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>
@@ -74,16 +78,20 @@
<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,7 +106,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>
</table> </table>
@@ -107,7 +116,8 @@
</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"
onclick="javascript:$('#depotHeadDlg').dialog('close')">取消</a>
</div> </div>
<div id="depotHeadDlgShow" class="easyui-dialog" style="width:1200px;padding:10px 20px;top:70px" <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">

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);
@@ -30,7 +30,8 @@
</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>
@@ -59,7 +62,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>
@@ -74,11 +78,14 @@
</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,7 +100,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>
</table> </table>
@@ -102,7 +110,8 @@
</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"
onclick="javascript:$('#depotHeadDlg').dialog('close')">取消</a>
</div> </div>
<div id="depotHeadDlgShow" class="easyui-dialog" style="width:1200px;padding:10px 20px;top:70px" <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">

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 basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + path + "/"; String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + path + "/";
@@ -23,7 +23,8 @@
</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,7 +52,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>
@@ -73,7 +75,8 @@
<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>
@@ -82,15 +85,15 @@
</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"
onclick="javascript:$('#personDlg').dialog('close')">取消</a>
</div> </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,8 +140,7 @@
} }
//防止表单提交重复 //防止表单提交重复
function initForm() function initForm() {
{
$('#personFM').form({ $('#personFM').form({
onSubmit: function () { onSubmit: function () {
return false; return false;
@@ -153,8 +149,7 @@
} }
//初始化表格数据 //初始化表格数据
function initTableData() function initTableData() {
{
$('#tableData').datagrid({ $('#tableData').datagrid({
//title:'经手人列表', //title:'经手人列表',
//iconCls:'icon-save', //iconCls:'icon-save',
@@ -182,12 +177,11 @@
{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;';
} }
@@ -200,8 +194,7 @@
id: 'addPerson', id: 'addPerson',
text: '增加', text: '增加',
iconCls: 'icon-add', iconCls: 'icon-add',
handler:function() handler: function () {
{
addPerson(); addPerson();
} }
}, },
@@ -209,14 +202,12 @@
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;
} }
@@ -224,34 +215,29 @@
} }
//初始化键盘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',
@@ -263,19 +249,15 @@
} }
}); });
} }
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",
@@ -284,11 +266,9 @@
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();
} }
@@ -296,8 +276,7 @@
$.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;
} }
@@ -341,11 +313,9 @@
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);
@@ -354,8 +324,7 @@
$.messager.alert('删除提示', '删除经手人信息失败,请稍后再试!', 'error'); $.messager.alert('删除提示', '删除经手人信息失败,请稍后再试!', 'error');
}, },
//此处添加错误处理 //此处添加错误处理
error:function() error: function () {
{
$.messager.alert('删除提示', '删除经手人信息异常,请稍后再试!', 'error'); $.messager.alert('删除提示', '删除经手人信息异常,请稍后再试!', 'error');
return; return;
} }
@@ -371,8 +340,7 @@
//保存编辑前的名称 //保存编辑前的名称
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;增加经手人信息');
@@ -386,12 +354,10 @@
//保存信息 //保存信息
$("#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;
@@ -406,17 +372,14 @@
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,8 +387,7 @@
} }
}, },
//此处添加错误处理 //此处添加错误处理
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 %>');
@@ -454,8 +415,7 @@
//搜索处理 //搜索处理
$("#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');
@@ -469,8 +429,7 @@
} }
}); });
function showPersonDetails(pageNo,pageSize) function showPersonDetails(pageNo, pageSize) {
{
$.ajax({ $.ajax({
type: "post", type: "post",
url: "<%=path %>/person/findBy.action", url: "<%=path %>/person/findBy.action",
@@ -481,13 +440,11 @@
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;
} }

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);
@@ -30,7 +30,8 @@
</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>
@@ -59,7 +62,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>
@@ -74,16 +78,20 @@
<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,7 +106,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>
@@ -125,7 +134,8 @@
<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">
@@ -147,7 +157,8 @@
</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"
onclick="javascript:$('#depotHeadDlg').dialog('close')">取消</a>
</div> </div>
<div id="depotHeadDlgShow" class="easyui-dialog" style="width:1200px;padding:10px 20px;top:20px" <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">
@@ -280,7 +291,8 @@
<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>
@@ -364,7 +383,8 @@
</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"
onclick="javascript:$('#supplierDlg').dialog('close')">取消</a>
</div> </div>
</body> </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);
@@ -30,7 +30,8 @@
</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>
@@ -59,7 +62,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>
@@ -74,16 +78,20 @@
<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,7 +106,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>
@@ -125,7 +134,8 @@
<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">
@@ -138,7 +148,8 @@
</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>
@@ -148,7 +159,8 @@
</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"
onclick="javascript:$('#depotHeadDlg').dialog('close')">取消</a>
</div> </div>
<div id="depotHeadDlgShow" class="easyui-dialog" style="width:1200px;padding:10px 20px;top:20px" <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">
@@ -282,7 +294,8 @@
<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>
@@ -366,7 +386,8 @@
</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"
onclick="javascript:$('#supplierDlg').dialog('close')">取消</a>
</div> </div>
</body> </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);
@@ -30,7 +30,8 @@
</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>
@@ -59,7 +62,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>
@@ -74,11 +78,14 @@
</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,7 +138,8 @@
</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>
@@ -135,7 +148,8 @@
</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"
onclick="javascript:$('#depotHeadDlg').dialog('close')">取消</a>
</div> </div>
<div id="depotHeadDlgShow" class="easyui-dialog" style="width:1200px;padding:10px 20px;top:50px" <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">

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);
@@ -30,7 +30,8 @@
</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>
@@ -59,7 +62,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>
@@ -74,11 +78,14 @@
</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,7 +142,8 @@
</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>
@@ -139,7 +152,8 @@
</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"
onclick="javascript:$('#depotHeadDlg').dialog('close')">取消</a>
</div> </div>
<div id="depotHeadDlgShow" class="easyui-dialog" style="width:1200px;padding:10px 20px;top:50px" <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">

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);
@@ -30,7 +30,8 @@
</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>
@@ -59,7 +62,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>
@@ -78,11 +82,14 @@
</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,7 +101,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>
@@ -121,7 +129,8 @@
<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">
@@ -143,7 +152,8 @@
</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"
onclick="javascript:$('#depotHeadDlg').dialog('close')">取消</a>
</div> </div>
<div id="depotHeadDlgShow" class="easyui-dialog" style="width:1200px;padding:10px 20px;top:20px" <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">

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);
@@ -30,7 +30,8 @@
</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>
@@ -59,7 +62,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>
@@ -78,11 +82,14 @@
</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,7 +101,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>
@@ -121,7 +129,8 @@
<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">
@@ -134,7 +143,8 @@
</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>
@@ -144,7 +154,8 @@
</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"
onclick="javascript:$('#depotHeadDlg').dialog('close')">取消</a>
</div> </div>
<div id="depotHeadDlgShow" class="easyui-dialog" style="width:1200px;padding:10px 20px;top:20px" <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">

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 basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + path + "/"; String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + path + "/";
@@ -27,6 +27,7 @@
padding: 0; padding: 0;
border: 0; border: 0;
} }
.ui_button, .ui_button,
.ui_fileup { .ui_fileup {
vertical-align: middle; vertical-align: middle;
@@ -39,10 +40,12 @@
*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;
@@ -64,10 +67,12 @@
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;
@@ -75,14 +80,17 @@
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;
@@ -108,8 +116,7 @@
<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,9 +132,9 @@
//}, ".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/"

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 basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + path + "/"; String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + path + "/";
@@ -22,6 +22,7 @@
<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,

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);
@@ -25,7 +25,8 @@
</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>
@@ -49,18 +50,19 @@
</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();
@@ -98,7 +100,8 @@
{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;';
@@ -106,8 +109,7 @@
} }
} }
]], ]],
onLoadError:function() onLoadError: function () {
{
$.messager.alert('页面加载提示', '页面加载异常,请稍后再试!', 'error'); $.messager.alert('页面加载提示', '页面加载异常,请稍后再试!', 'error');
return; return;
} }
@@ -115,8 +117,7 @@
} }
//初始化键盘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;
@@ -124,21 +125,18 @@
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',
@@ -150,15 +148,14 @@
} }
}); });
} }
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');
@@ -172,8 +169,7 @@
} }
}); });
function showAccountDetails(pageNo,pageSize) function showAccountDetails(pageNo, pageSize) {
{
$.ajax({ $.ajax({
type: "post", type: "post",
url: "<%=path %>/account/findBy.action", url: "<%=path %>/account/findBy.action",
@@ -184,13 +180,11 @@
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;
} }
@@ -228,7 +222,8 @@
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>";
@@ -236,7 +231,8 @@
}, },
{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(",");

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);
@@ -24,12 +24,14 @@
</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>
@@ -43,15 +45,15 @@
</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(); //初始化商品属性
@@ -89,8 +91,7 @@
} }
//初始化表格数据 //初始化表格数据
function initTableData() function initTableData() {
{
$('#tableData').datagrid({ $('#tableData').datagrid({
height: heightInfo, height: heightInfo,
nowrap: false, nowrap: false,
@@ -115,8 +116,7 @@
{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;
} }
@@ -124,8 +124,7 @@
} }
//初始化键盘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;
@@ -133,21 +132,18 @@
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',
@@ -159,8 +155,7 @@
} }
}); });
} }
catch (e) catch (e) {
{
$.messager.alert('异常处理提示', "分页信息异常 : " + e.name + ": " + e.message, 'error'); $.messager.alert('异常处理提示', "分页信息异常 : " + e.name + ": " + e.message, 'error');
} }
} }
@@ -176,10 +171,10 @@
pageSize: initPageSize pageSize: initPageSize
}); });
} }
//搜索处理 //搜索处理
$("#searchBtn").unbind().bind({ $("#searchBtn").unbind().bind({
click:function() click: function () {
{
search(); search();
} }
}); });
@@ -192,8 +187,7 @@
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
@@ -201,8 +195,7 @@
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({
@@ -217,14 +210,12 @@
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;
} }
@@ -235,8 +226,7 @@
} }
}, },
//此处添加错误处理 //此处添加错误处理
error:function() error: function () {
{
$.messager.alert('查询提示', '查询数据后台异常,请稍后再试!', 'error'); $.messager.alert('查询提示', '查询数据后台异常,请稍后再试!', 'error');
return; return;
} }
@@ -247,13 +237,13 @@
} }
}, },
//此处添加错误处理 //此处添加错误处理
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 () {

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);
@@ -28,7 +28,8 @@
</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>
@@ -38,11 +39,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>
@@ -60,7 +63,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>
@@ -68,8 +72,7 @@
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");
@@ -96,8 +99,7 @@
} }
//初始化表格数据 //初始化表格数据
function initTableData() function initTableData() {
{
$('#tableData').datagrid({ $('#tableData').datagrid({
height: heightInfo, height: heightInfo,
nowrap: false, nowrap: false,
@@ -112,7 +114,8 @@
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>";
@@ -125,8 +128,7 @@
{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;
} }
@@ -134,34 +136,29 @@
} }
//初始化键盘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',
@@ -173,8 +170,7 @@
} }
}); });
} }
catch (e) catch (e) {
{
$.messager.alert('异常处理提示', "分页信息异常 : " + e.name + ": " + e.message, 'error'); $.messager.alert('异常处理提示', "分页信息异常 : " + e.name + ": " + e.message, 'error');
} }
} }
@@ -198,15 +194,14 @@
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",
@@ -356,6 +351,7 @@
} }
}); });
} }
//报表打印 //报表打印
function print() { function print() {
$("#printBtn").off("click").on("click", function () { $("#printBtn").off("click").on("click", function () {

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);
@@ -23,7 +23,8 @@
</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>
@@ -147,14 +149,14 @@
$("#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',
@@ -166,8 +168,7 @@
} }
}); });
} }
catch (e) catch (e) {
{
$.messager.alert('异常处理提示', "分页信息异常 : " + e.name + ": " + e.message, 'error'); $.messager.alert('异常处理提示', "分页信息异常 : " + e.name + ": " + e.message, 'error');
} }
} }
@@ -184,6 +185,7 @@
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

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);
@@ -28,7 +28,8 @@
</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>
@@ -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>
@@ -60,7 +63,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>
@@ -71,8 +75,7 @@
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");
@@ -115,33 +118,28 @@
//设置为同步 //设置为同步
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() { function initSelectInfo_UB() {
if(userBusinessList !=null) if (userBusinessList != null) {
{ if (userBusinessList.length > 0) {
if(userBusinessList.length>0)
{
//用户对应的仓库列表 [1][2][3]... //用户对应的仓库列表 [1][2][3]...
userdepot = userBusinessList[0].value; userdepot = userBusinessList[0].value;
} }
@@ -157,33 +155,28 @@
//设置为同步 //设置为同步
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 + ",";
} }
@@ -195,8 +188,7 @@
} }
//初始化表格数据 //初始化表格数据
function initTableData() function initTableData() {
{
$('#tableData').datagrid({ $('#tableData').datagrid({
height: heightInfo, height: heightInfo,
nowrap: false, nowrap: false,
@@ -211,7 +203,8 @@
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>";
@@ -226,8 +219,7 @@
{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;
} }
@@ -235,34 +227,29 @@
} }
//初始化键盘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',
@@ -274,8 +261,7 @@
} }
}); });
} }
catch (e) catch (e) {
{
$.messager.alert('异常处理提示', "分页信息异常 : " + e.name + ": " + e.message, 'error'); $.messager.alert('异常处理提示', "分页信息异常 : " + e.name + ": " + e.message, 'error');
} }
} }
@@ -299,15 +285,14 @@
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",
@@ -334,6 +319,7 @@
} }
}); });
} }
//报表打印 //报表打印
function print() { function print() {
$("#printBtn").off("click").on("click", function () { $("#printBtn").off("click").on("click", function () {

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);
@@ -27,7 +27,8 @@
</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>
@@ -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>
@@ -59,7 +62,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>
@@ -70,8 +74,7 @@
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");
@@ -114,33 +117,28 @@
//设置为同步 //设置为同步
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() { function initSelectInfo_UB() {
if(userBusinessList !=null) if (userBusinessList != null) {
{ if (userBusinessList.length > 0) {
if(userBusinessList.length>0)
{
//用户对应的仓库列表 [1][2][3]... //用户对应的仓库列表 [1][2][3]...
userdepot = userBusinessList[0].value; userdepot = userBusinessList[0].value;
} }
@@ -156,33 +154,28 @@
//设置为同步 //设置为同步
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 + ",";
} }
@@ -194,8 +187,7 @@
} }
//初始化表格数据 //初始化表格数据
function initTableData() function initTableData() {
{
$('#tableData').datagrid({ $('#tableData').datagrid({
height: heightInfo, height: heightInfo,
nowrap: false, nowrap: false,
@@ -216,8 +208,7 @@
{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;
} }
@@ -225,34 +216,29 @@
} }
//初始化键盘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',
@@ -264,8 +250,7 @@
} }
}); });
} }
catch (e) catch (e) {
{
$.messager.alert('异常处理提示', "分页信息异常 : " + e.name + ": " + e.message, 'error'); $.messager.alert('异常处理提示', "分页信息异常 : " + e.name + ": " + e.message, 'error');
} }
} }
@@ -289,15 +274,14 @@
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",
@@ -324,6 +308,7 @@
} }
}); });
} }
//报表打印 //报表打印
function print() { function print() {
$("#printBtn").off("click").on("click", function () { $("#printBtn").off("click").on("click", function () {

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);
@@ -27,7 +27,8 @@
</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>
@@ -53,7 +55,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>
@@ -62,8 +65,7 @@
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;
@@ -106,33 +108,28 @@
//设置为同步 //设置为同步
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() { function initSelectInfo_UB() {
if(userBusinessList !=null) if (userBusinessList != null) {
{ if (userBusinessList.length > 0) {
if(userBusinessList.length>0)
{
//用户对应的仓库列表 [1][2][3]... //用户对应的仓库列表 [1][2][3]...
userdepot = userBusinessList[0].value; userdepot = userBusinessList[0].value;
} }
@@ -148,33 +145,28 @@
//设置为同步 //设置为同步
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>';
} }
} }
@@ -211,8 +203,7 @@
} }
//初始化表格数据 //初始化表格数据
function initTableData() function initTableData() {
{
$('#tableData').datagrid({ $('#tableData').datagrid({
height: heightInfo, height: heightInfo,
nowrap: false, nowrap: false,
@@ -232,7 +223,8 @@
{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);
} }
}, },
@@ -240,14 +232,14 @@
{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, {
title: '结存金额', field: 'thisAllPrice', width: 60,
formatter: function (value, row, index) { 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;
} }
@@ -255,34 +247,29 @@
} }
//初始化键盘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',
@@ -294,8 +281,7 @@
} }
}); });
} }
catch (e) catch (e) {
{
$.messager.alert('异常处理提示', "分页信息异常 : " + e.name + ": " + e.message, 'error'); $.messager.alert('异常处理提示', "分页信息异常 : " + e.name + ": " + e.message, 'error');
} }
} }
@@ -319,15 +305,14 @@
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",
@@ -335,8 +320,7 @@
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
@@ -344,8 +328,7 @@
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) {
@@ -365,14 +348,12 @@
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;
} }
@@ -389,8 +370,7 @@
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) {
@@ -400,8 +380,7 @@
} }
}, },
//此处添加错误处理 //此处添加错误处理
error:function() error: function () {
{
$.messager.alert('查询提示', '查询数据后台异常,请稍后再试!', 'error'); $.messager.alert('查询提示', '查询数据后台异常,请稍后再试!', 'error');
return; return;
} }
@@ -413,8 +392,7 @@
} }
}, },
//此处添加错误处理 //此处添加错误处理
error:function() error: function () {
{
$.messager.alert('查询提示', '查询数据后台异常,请稍后再试!', 'error'); $.messager.alert('查询提示', '查询数据后台异常,请稍后再试!', 'error');
return; return;
} }
@@ -425,13 +403,13 @@
} }
}, },
//此处添加错误处理 //此处添加错误处理
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 () {

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);
@@ -28,7 +28,8 @@
</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>
@@ -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>
@@ -60,7 +63,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>
@@ -71,8 +75,7 @@
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");
@@ -115,33 +118,28 @@
//设置为同步 //设置为同步
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() { function initSelectInfo_UB() {
if(userBusinessList !=null) if (userBusinessList != null) {
{ if (userBusinessList.length > 0) {
if(userBusinessList.length>0)
{
//用户对应的仓库列表 [1][2][3]... //用户对应的仓库列表 [1][2][3]...
userdepot = userBusinessList[0].value; userdepot = userBusinessList[0].value;
} }
@@ -157,33 +155,28 @@
//设置为同步 //设置为同步
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 + ",";
} }
@@ -195,8 +188,7 @@
} }
//初始化表格数据 //初始化表格数据
function initTableData() function initTableData() {
{
$('#tableData').datagrid({ $('#tableData').datagrid({
height: heightInfo, height: heightInfo,
nowrap: false, nowrap: false,
@@ -211,7 +203,8 @@
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>";
@@ -226,8 +219,7 @@
{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;
} }
@@ -235,34 +227,29 @@
} }
//初始化键盘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',
@@ -274,8 +261,7 @@
} }
}); });
} }
catch (e) catch (e) {
{
$.messager.alert('异常处理提示', "分页信息异常 : " + e.name + ": " + e.message, 'error'); $.messager.alert('异常处理提示', "分页信息异常 : " + e.name + ": " + e.message, 'error');
} }
} }
@@ -299,15 +285,14 @@
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",
@@ -334,6 +319,7 @@
} }
}); });
} }
//报表打印 //报表打印
function print() { function print() {
$("#printBtn").off("click").on("click", function () { $("#printBtn").off("click").on("click", function () {

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);
@@ -27,7 +27,8 @@
</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>
@@ -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>
@@ -59,7 +62,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>
@@ -70,8 +74,7 @@
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");
@@ -114,33 +117,28 @@
//设置为同步 //设置为同步
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() { function initSelectInfo_UB() {
if(userBusinessList !=null) if (userBusinessList != null) {
{ if (userBusinessList.length > 0) {
if(userBusinessList.length>0)
{
//用户对应的仓库列表 [1][2][3]... //用户对应的仓库列表 [1][2][3]...
userdepot = userBusinessList[0].value; userdepot = userBusinessList[0].value;
} }
@@ -156,33 +154,28 @@
//设置为同步 //设置为同步
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 + ",";
} }
@@ -194,8 +187,7 @@
} }
//初始化表格数据 //初始化表格数据
function initTableData() function initTableData() {
{
$('#tableData').datagrid({ $('#tableData').datagrid({
height: heightInfo, height: heightInfo,
nowrap: false, nowrap: false,
@@ -216,8 +208,7 @@
{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;
} }
@@ -225,34 +216,29 @@
} }
//初始化键盘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',
@@ -264,8 +250,7 @@
} }
}); });
} }
catch (e) catch (e) {
{
$.messager.alert('异常处理提示', "分页信息异常 : " + e.name + ": " + e.message, 'error'); $.messager.alert('异常处理提示', "分页信息异常 : " + e.name + ": " + e.message, 'error');
} }
} }
@@ -289,15 +274,14 @@
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",
@@ -324,6 +308,7 @@
} }
}); });
} }
//报表打印 //报表打印
function print() { function print() {
$("#printBtn").off("click").on("click", function () { $("#printBtn").off("click").on("click", function () {

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);
@@ -24,12 +24,14 @@
</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>
@@ -44,15 +46,15 @@
</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);
@@ -91,8 +93,7 @@
} }
//初始化表格数据 //初始化表格数据
function initTableData() function initTableData() {
{
$('#tableData').datagrid({ $('#tableData').datagrid({
height: heightInfo, height: heightInfo,
nowrap: false, nowrap: false,
@@ -117,8 +118,7 @@
{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;
} }
@@ -126,8 +126,7 @@
} }
//初始化键盘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;
@@ -135,21 +134,18 @@
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',
@@ -161,8 +157,7 @@
} }
}); });
} }
catch (e) catch (e) {
{
$.messager.alert('异常处理提示', "分页信息异常 : " + e.name + ": " + e.message, 'error'); $.messager.alert('异常处理提示', "分页信息异常 : " + e.name + ": " + e.message, 'error');
} }
} }
@@ -180,14 +175,14 @@
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",
@@ -195,8 +190,7 @@
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
@@ -204,8 +198,7 @@
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({
@@ -220,14 +213,12 @@
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;
} }
@@ -238,8 +229,7 @@
} }
}, },
//此处添加错误处理 //此处添加错误处理
error:function() error: function () {
{
$.messager.alert('查询提示', '查询数据后台异常,请稍后再试!', 'error'); $.messager.alert('查询提示', '查询数据后台异常,请稍后再试!', 'error');
return; return;
} }
@@ -250,13 +240,13 @@
} }
}, },
//此处添加错误处理 //此处添加错误处理
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 () {

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);
@@ -28,7 +28,8 @@
</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>
@@ -38,11 +39,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>
@@ -60,7 +63,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>
@@ -68,8 +72,7 @@
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");
@@ -96,8 +99,7 @@
} }
//初始化表格数据 //初始化表格数据
function initTableData() function initTableData() {
{
$('#tableData').datagrid({ $('#tableData').datagrid({
height: heightInfo, height: heightInfo,
nowrap: false, nowrap: false,
@@ -112,7 +114,8 @@
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>";
@@ -125,8 +128,7 @@
{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;
} }
@@ -134,34 +136,29 @@
} }
//初始化键盘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',
@@ -173,8 +170,7 @@
} }
}); });
} }
catch (e) catch (e) {
{
$.messager.alert('异常处理提示', "分页信息异常 : " + e.name + ": " + e.message, 'error'); $.messager.alert('异常处理提示', "分页信息异常 : " + e.name + ": " + e.message, 'error');
} }
} }
@@ -198,15 +194,14 @@
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",
@@ -356,6 +351,7 @@
} }
}); });
} }
//报表打印 //报表打印
function print() { function print() {
$("#printBtn").off("click").on("click", function () { $("#printBtn").off("click").on("click", function () {

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 basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + path + "/"; String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + path + "/";
@@ -26,17 +26,23 @@
<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 %>"/>
@@ -50,8 +56,7 @@
<script type="text/javascript"> <script type="text/javascript">
//初始化界面 //初始化界面
$(function() $(function () {
{
$("#orgpassword").focus(); $("#orgpassword").focus();
$('#passwordFM').form({ $('#passwordFM').form({
onSubmit: function () { onSubmit: function () {
@@ -68,8 +73,7 @@
$("#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;
@@ -81,8 +85,7 @@
}); });
$("#savepassword").unbind().bind({ $("#savepassword").unbind().bind({
click:function() click: function () {
{
if (!$('#passwordFM').form('validate')) if (!$('#passwordFM').form('validate'))
return; return;
$.ajax({ $.ajax({
@@ -95,25 +98,21 @@
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,12 +122,10 @@
//处理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();
} }
}); });

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);
@@ -55,8 +55,13 @@
//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 () {
@@ -70,12 +75,10 @@
$("#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,7 +87,8 @@
$.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,
@@ -104,8 +108,7 @@
}); });
//检查记录是否存在 //检查记录是否存在
function checkUserDepot() function checkUserDepot() {
{
//表示是否存在 true == 存在 false = 不存在 //表示是否存在 true == 存在 false = 不存在
var flag = false; var flag = false;
//开始ajax名称检验是否存在 //开始ajax名称检验是否存在
@@ -118,13 +121,11 @@
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;
} }

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 basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + path + "/"; String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + path + "/";
@@ -56,8 +56,13 @@
//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 () {
@@ -71,12 +76,10 @@
$("#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';
} }
@@ -85,7 +88,8 @@
$.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,
@@ -105,8 +109,7 @@
}); });
//检查记录是否存在 //检查记录是否存在
function checkUserDepot() function checkUserDepot() {
{
//表示是否存在 true == 存在 false = 不存在 //表示是否存在 true == 存在 false = 不存在
var flag = false; var flag = false;
//开始ajax名称检验是否存在 //开始ajax名称检验是否存在
@@ -119,13 +122,11 @@
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;
} }

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 basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + path + "/"; String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + path + "/";
@@ -56,8 +56,13 @@
//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 () {
@@ -71,12 +76,10 @@
$("#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';
} }
@@ -85,7 +88,8 @@
$.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,
@@ -105,8 +109,7 @@
}); });
//检查记录是否存在 //检查记录是否存在
function checkUserRole() function checkUserRole() {
{
//表示是否存在 true == 存在 false = 不存在 //表示是否存在 true == 存在 false = 不存在
var flag = false; var flag = false;
//开始ajax名称检验是否存在 //开始ajax名称检验是否存在
@@ -119,13 +122,11 @@
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;
} }

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 basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + path + "/"; String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + path + "/";
@@ -27,28 +27,35 @@
<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}"/>
@@ -63,17 +70,14 @@
<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,15 +96,13 @@
} }
$("#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;
@@ -109,60 +110,52 @@
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",
@@ -172,11 +165,9 @@
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("");
@@ -184,8 +175,7 @@
} }
}, },
//此处添加错误处理 //此处添加错误处理
error:function() error: function () {
{
$.messager.alert('提示', '检查用户名称是否存在异常,请稍后再试!', 'error'); $.messager.alert('提示', '检查用户名称是否存在异常,请稍后再试!', 'error');
return; return;
} }