升级代码结构,采用Maven来管理jar包(14)
This commit is contained in:
1556
src/main/webapp/pages/asset/asset.jsp
Normal file
1556
src/main/webapp/pages/asset/asset.jsp
Normal file
File diff suppressed because it is too large
Load Diff
76
src/main/webapp/pages/asset/home.jsp
Normal file
76
src/main/webapp/pages/asset/home.jsp
Normal file
@@ -0,0 +1,76 @@
|
||||
<%@page language="java" contentType="text/html; charset=utf-8" pageEncoding="utf-8"%>
|
||||
<%
|
||||
String path = request.getContextPath();
|
||||
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
|
||||
%>
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv=Content-Type content="text/html; charset=utf-8">
|
||||
<!-- 指定以IE8的方式来渲染 -->
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE8"/>
|
||||
<link rel="shortcut icon" href="<%=path%>/images/favicon.ico" type="image/x-icon" />
|
||||
<link href="css/admin.css" type="text/css" rel="stylesheet">
|
||||
<title>首页说明</title>
|
||||
<style type="text/css">
|
||||
<!--
|
||||
body {
|
||||
margin-left: 0px;
|
||||
margin-top: 0px;
|
||||
margin-right: 0px;
|
||||
margin-bottom: 0px;
|
||||
background-color: #EAF2FD;
|
||||
}
|
||||
.STYLE1 {font-size: 12px}
|
||||
.STYLE4 {
|
||||
font-size: 12px;
|
||||
color: #1F4A65;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
a:link {
|
||||
font-size: 12px;
|
||||
color: #06482a;
|
||||
text-decoration: none;
|
||||
|
||||
}
|
||||
a:visited {
|
||||
font-size: 12px;
|
||||
color: #06482a;
|
||||
text-decoration: none;
|
||||
}
|
||||
a:hover {
|
||||
font-size: 12px;
|
||||
color: #FF0000;
|
||||
text-decoration: underline;
|
||||
}
|
||||
a:active {
|
||||
font-size: 12px;
|
||||
color: #FF0000;
|
||||
text-decoration: none;
|
||||
}
|
||||
.STYLE7 {font-size: 12}
|
||||
-->
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<table cellSpacing=0 cellPadding=0 width="100%" align=center border=0>
|
||||
<tr height=28>
|
||||
<td width="1101" class="STYLE4">
|
||||
<img src="<%=path%>/images/computer.png" width="16" height="16" />
|
||||
<span >资产管理</span>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td bgColor=#b1ceef height=1></td>
|
||||
</tr>
|
||||
<tr height="5px">
|
||||
<td background=images/shadow_bg.jpg></td>
|
||||
</tr>
|
||||
</table>
|
||||
<p style="font-size: 12px;color: #1F4A65;padding: 10px">
|
||||
|
||||
资产管理是记录资产明细,包括资产名称、资产类型、供应商、使用用户等信息,通过资产管理,可以记录平时资产明细,管理资产信息。资产管理包括增加,修改,删除、搜索消费信息等功能点。报表图表最多显示十条报表记录。
|
||||
</p>
|
||||
</body>
|
||||
</html>
|
||||
991
src/main/webapp/pages/asset/report.jsp
Normal file
991
src/main/webapp/pages/asset/report.jsp
Normal file
@@ -0,0 +1,991 @@
|
||||
<%@page import="com.jsh.util.Tools"%>
|
||||
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
|
||||
<%
|
||||
String path = request.getContextPath();
|
||||
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
|
||||
String clientIp = Tools.getCurrentUserIP();
|
||||
%>
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head>
|
||||
<title>资产管理</title>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
<!-- 指定以IE8的方式来渲染 -->
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE8"/>
|
||||
<link rel="shortcut icon" href="<%=path%>/images/favicon.ico" type="image/x-icon" />
|
||||
<link rel="stylesheet" type="text/css" href="<%=path %>/js/easyui-1.3.5/themes/default/easyui.css"/>
|
||||
<link rel="stylesheet" type="text/css" href="<%=path %>/js/easyui-1.3.5/themes/icon.css"/>
|
||||
<script type="text/javascript" src="<%=path %>/js/jquery-1.8.0.min.js"></script>
|
||||
<script type="text/javascript" src="<%=path %>/js/easyui-1.3.5/jquery.easyui.min.js"></script>
|
||||
<script type="text/javascript" src="<%=path %>/js/easyui-1.3.5/locale/easyui-lang-zh_CN.js"></script>
|
||||
<script type="text/javascript" src="<%=path%>/js/highcharts/highcharts.js"></script>
|
||||
<script type="text/javascript" src="<%=path%>/js/highcharts/exporting.js"></script>
|
||||
<script type="text/javascript" src="<%=path%>/js/StringBuffer.js"></script>
|
||||
<script type="text/javascript" src="<%=path %>/js/common/common.js"></script>
|
||||
<style>
|
||||
body{ margin:0; height:100%}
|
||||
html{ height:100%} /*兼容firefox的div高度100%*/
|
||||
#left{ width:150px; height:100%; float:left; _margin-right:-3px;}
|
||||
#right{ height:100%;}
|
||||
<!--页面展示特殊要求-->
|
||||
.datagrid-body,.datagrid-footer,.datagrid-pager ,.datagrid-view
|
||||
{
|
||||
background-color:#EAF2FD;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div id="position" class="easyui-panel" title="当前位置:资产管理 > 资产报表" collapsible="false" closable="false"/>
|
||||
<!-- 查询 -->
|
||||
<div id = "searchPanel" class="easyui-panel" style="padding:10px;" title="查询窗口" iconCls="icon-search" collapsible="true" closable="false">
|
||||
<table id="searchTable">
|
||||
<tr>
|
||||
<td>资产名称:</td>
|
||||
<td>
|
||||
<select name="searchAssetNameID" id="searchAssetNameID" style="width:200px;"></select>
|
||||
</td>
|
||||
<td> </td>
|
||||
<td> </td>
|
||||
<td>资产类型:</td>
|
||||
<td>
|
||||
<select name="searchCategoryID" id="searchCategoryID" style="width:200px;"></select>
|
||||
</td>
|
||||
<td> </td>
|
||||
<td> </td>
|
||||
<td>用户姓名:</td>
|
||||
<td>
|
||||
<select name="searchUsernameID" id="searchUsernameID" style="width:200px;"></select>
|
||||
</td>
|
||||
<td> </td>
|
||||
<td> </td>
|
||||
<td id="searchStatusLabel">状 态:</td>
|
||||
<td>
|
||||
<select name="searchStatus" id="searchStatus" style="width:200px;">
|
||||
<option value="">请选择</option>
|
||||
<option value="0">在库</option>
|
||||
<option value="1">在用</option>
|
||||
<option value="2">消费</option>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td id="searchSupplierIDLabel">供 应 商:</td>
|
||||
<td>
|
||||
<select name="searchSupplierID" id="searchSupplierID" style="width:200px;"></select>
|
||||
</td>
|
||||
<td> </td>
|
||||
<td> </td>
|
||||
<td>统计类型:</td>
|
||||
<td>
|
||||
<select name="searchReportType" id="searchReportType" style="width:200px;">
|
||||
<option value="0">资产状态</option>
|
||||
<option value="1">资产类型</option>
|
||||
<option value="2">供应商</option>
|
||||
<option value="3">资产名称</option>
|
||||
<option value="4">所属用户</option>
|
||||
</select>
|
||||
</td>
|
||||
<td> </td>
|
||||
<td> </td>
|
||||
<td>是否前十:</td>
|
||||
<td>
|
||||
<select name="searchTopten" id="searchTopten" style="width:200px;">
|
||||
<option value="0">是</option>
|
||||
<option value="1">否</option>
|
||||
</select>
|
||||
</td>
|
||||
<td> </td>
|
||||
<td> </td>
|
||||
<td> </td>
|
||||
<td>
|
||||
<a href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-search" id="searchBtn">查询</a>
|
||||
<a href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-redo" id="searchResetBtn">重置</a>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<!-- 数据显示table -->
|
||||
<%-- <div id = "tablePanel" class="easyui-panel" style="padding:1px;top:300px;" title="资产列表" iconCls="icon-chart-column" collapsible="true" closable="false">--%>
|
||||
<%-- <table id="tableData" style="height:360px;top:300px;border-bottom-color:#FFFFFF"></table>--%>
|
||||
<%-- </div>--%>
|
||||
|
||||
<div id = "tablePanel" class="easyui-panel" style="padding:1px;top:300px;" title="资产报表" iconCls="icon-chart-column" collapsible="true" maximizable="false" closable="false">
|
||||
<div id="left" class="easyui-tabs" style="padding:1px;">
|
||||
<div title="综合图" style="padding:10px;background-color: #EAF2FD;height:340px;top:300px;" data-options="iconCls:'icon-chart-zonghe'">
|
||||
<div id="zongheContainer">综合图</div>
|
||||
</div>
|
||||
<div title="柱状图" style="padding:10px;background-color: #EAF2FD;height:340px;top:300px;" data-options="iconCls:'icon-chart-statistics'">
|
||||
<div id="culumnContainer" >柱状图</div>
|
||||
</div>
|
||||
<div title="饼状图" data-options="iconCls:'icon-chart-pie'" style="padding:10px;background-color: #EAF2FD;height:340px;top:300px;">
|
||||
<div id="pieContainer">饼状图</div>
|
||||
</div>
|
||||
<div title="折线图" data-options="iconCls:'icon-chart-polygram'" style="padding:10px;background-color: #EAF2FD;height:340px;top:300px;">
|
||||
<div id="zxianContainer">折现图</div>
|
||||
</div>
|
||||
</div>
|
||||
<div id="right" class="easyui-tabs" style="padding:1px;">
|
||||
<div title="表格" data-options="iconCls:'icon-list'" style="padding:10px;background-color: #EAF2FD;top:300px;">
|
||||
<table id="tableData" style="top:300px;border-bottom-color:#FFFFFF;background-color: #EAF2FD;"></table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script type="text/javascript">
|
||||
|
||||
var userList = null;
|
||||
var categoryList = null;
|
||||
var supplierList = null;
|
||||
var nameList = null;
|
||||
//界面selet选显卡有问题解决方案
|
||||
var nameID = null;
|
||||
var userID = null;
|
||||
var categoryID = null;
|
||||
var supplierID = null;
|
||||
|
||||
//报表数据
|
||||
var pageData = null;
|
||||
|
||||
//报表显示个数
|
||||
var showNum = 10;
|
||||
//初始化界面
|
||||
$(function()
|
||||
{
|
||||
//progress();
|
||||
//页面自定义高度
|
||||
heightInfo = heightInfo - 50;
|
||||
//是否限制条件 默认限制
|
||||
initShowDataNum();
|
||||
//initTableData();
|
||||
//ininPager();
|
||||
//初始化系统基础信息
|
||||
initSystemData();
|
||||
//初始化页面系统基础信息选项卡
|
||||
initSelectInfo();
|
||||
//获取报表数据
|
||||
getDataInfo();
|
||||
//初始化报表高度
|
||||
initChartsHight();
|
||||
//初始化表格数据
|
||||
initTableData();
|
||||
//综合图
|
||||
showComboChart();
|
||||
//饼状图
|
||||
showPieChart();
|
||||
//折线图
|
||||
showSpline();
|
||||
//显示柱状图
|
||||
showHistogram();
|
||||
browserFit();
|
||||
});
|
||||
|
||||
//浏览器适配
|
||||
function browserFit()
|
||||
{
|
||||
if(getOs()=='MSIE')
|
||||
{
|
||||
$("#searchStatusLabel").empty().append("状 态:");
|
||||
$("#searchSupplierIDLabel").empty().append("供 应 商:");
|
||||
}
|
||||
else
|
||||
{
|
||||
$("#searchStatusLabel").empty().append("状 态:");
|
||||
$("#searchSupplierIDLabel").empty().append("供 应 商:");
|
||||
}
|
||||
}
|
||||
|
||||
$("#left").tabs({width:630});
|
||||
|
||||
var chartHight;
|
||||
function initChartsHight()
|
||||
{
|
||||
|
||||
$("#zxianContainer").add("#pieContainer").add("#culumnContainer")
|
||||
.add("#zongheContainer").css({height: heightInfo});
|
||||
|
||||
chartHight = $("#zxianContainer").outerHeight();
|
||||
}
|
||||
|
||||
//是否限制条件
|
||||
function initShowDataNum()
|
||||
{
|
||||
var type = $("#searchTopten").val();
|
||||
if(0 == type)
|
||||
showNum = 10;
|
||||
else
|
||||
//表示不限制
|
||||
showNum = 10000000000;
|
||||
}
|
||||
|
||||
//加载进度条
|
||||
function progress()
|
||||
{
|
||||
$.messager.progress({
|
||||
title:'请稍候',
|
||||
msg:'数据加载ing...'
|
||||
});
|
||||
setTimeout(function(){
|
||||
$.messager.progress('close');
|
||||
},3300)
|
||||
}
|
||||
//获取查询数据
|
||||
function getDataInfo()
|
||||
{
|
||||
$.ajax({
|
||||
type:"post",
|
||||
url: "<%=path%>/report/find.action",
|
||||
dataType: "json",
|
||||
//取消异步机制,保证页面数据返回再进行处理
|
||||
async: false,
|
||||
data: ({
|
||||
assetNameID:$.trim($("#searchAssetNameID").val()),
|
||||
assetCategoryID:$.trim($("#searchCategoryID").val()),
|
||||
usernameID:$.trim($("#searchUsernameID").val()),
|
||||
status:$.trim($("#searchStatus").val()),
|
||||
supplierID:$.trim($("#searchSupplierID").val()),
|
||||
reportType : $.trim($("#searchReportType").val()),
|
||||
}),
|
||||
success: function (reportInfo)
|
||||
{
|
||||
pageData = reportInfo.showModel.reportData;
|
||||
var msgTip = reportInfo.showModel.msgTip;
|
||||
if(msgTip == "get report data exception")
|
||||
{
|
||||
alert("查找报表信息异常,请与管理员联系!");
|
||||
return;
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
//初始化表格数据
|
||||
function initTableData()
|
||||
{
|
||||
$('#tableData').datagrid({
|
||||
//title:'资产列表',
|
||||
//iconCls:'icon-save',
|
||||
//width:700,
|
||||
height : chartHight,
|
||||
nowrap: false,
|
||||
rownumbers: false,
|
||||
//动画效果
|
||||
animate:false,
|
||||
//选中单行
|
||||
singleSelect : true,
|
||||
collapsible:false,
|
||||
selectOnCheck:false,
|
||||
//列宽自适应
|
||||
//fitColumns:true,
|
||||
//单击行是否选中
|
||||
checkOnSelect : false,
|
||||
url: null,
|
||||
//pagination: true,
|
||||
//loadFilter: pagerFilter,
|
||||
//交替出现背景
|
||||
striped : true,
|
||||
//pageSize: 10,
|
||||
//pageList: [10,20,30,50],
|
||||
rowStyler:function(index,row){
|
||||
return 'background-color:#EAF2FD;';
|
||||
},
|
||||
showFooter: true,
|
||||
columns:[[
|
||||
{ title: getReportType() + '类型',id:"dataTypeColumn",width:300,field: 'name',align:"center"},
|
||||
{ title: '总数',field: 'sum',width:130,align:"center"}
|
||||
]],
|
||||
onLoadError:function()
|
||||
{
|
||||
$.messager.alert('页面加载提示','页面加载异常,请稍后再试!','error');
|
||||
return;
|
||||
}
|
||||
});
|
||||
$('#tableData').datagrid('loadData',initTableDetails());
|
||||
}
|
||||
|
||||
//初始化键盘enter事件
|
||||
$(document).keydown(function(event)
|
||||
{
|
||||
//兼容 IE和firefox 事件
|
||||
var e = window.event || event;
|
||||
var k = e.keyCode||e.which||e.charCode;
|
||||
//兼容 IE,firefox 兼容
|
||||
var obj = e.srcElement ? e.srcElement : e.target;
|
||||
|
||||
//搜索按钮添加快捷键
|
||||
if(k == "13"&&(obj.id=="searchSupplier" || obj.id=="searchCategoryID"|| obj.id=="searchUsernameID"
|
||||
|| obj.id=="searchStatus" || obj.id=="searchSupplierID" ))
|
||||
{
|
||||
$("#searchBtn").click();
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
//初始化系统基础信息
|
||||
function initSystemData()
|
||||
{
|
||||
$.ajax({
|
||||
type:"post",
|
||||
url: "<%=path%>/asset/getBasicData.action",
|
||||
//设置为同步
|
||||
async:false,
|
||||
dataType: "json",
|
||||
success: function (systemInfo)
|
||||
{
|
||||
userList = systemInfo.showModel.map.userList;
|
||||
categoryList = systemInfo.showModel.map.categoryList;
|
||||
supplierList = systemInfo.showModel.map.supplierList;
|
||||
nameList = systemInfo.showModel.map.assetnameList;
|
||||
var msgTip = systemInfo.showModel.msgTip;
|
||||
if(msgTip == "exceptoin")
|
||||
{
|
||||
$.messager.alert('提示','查找系统基础信息异常,请与管理员联系!','error');
|
||||
return;
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
//初始化页面选项卡
|
||||
function initSelectInfo()
|
||||
{
|
||||
var options = "";
|
||||
if(nameList !=null)
|
||||
{
|
||||
for(var i = 0 ;i < nameList.length;i ++)
|
||||
{
|
||||
var nameInfo = nameList[i];
|
||||
if(0== i)
|
||||
{
|
||||
nameID = nameInfo.id;
|
||||
}
|
||||
options += '<option value="' + nameInfo.id + '">' + nameInfo.assetname + '</option>';
|
||||
}
|
||||
$("#searchAssetNameID").empty().append('<option value="">请选择</option>').append(options);
|
||||
}
|
||||
|
||||
if(userList !=null)
|
||||
{
|
||||
options = "";
|
||||
for(var i = 0 ;i < userList.length;i ++)
|
||||
{
|
||||
var user = userList[i];
|
||||
if(0 == i)
|
||||
{
|
||||
userID = user.id
|
||||
}
|
||||
options += '<option value="' + user.id + '">' + user.username + '</option>';
|
||||
}
|
||||
$("#searchUsernameID").empty().append('<option value="">请选择</option>').append(options);
|
||||
|
||||
}
|
||||
|
||||
if(categoryList !=null)
|
||||
{
|
||||
options = "";
|
||||
for(var i = 0 ;i < categoryList.length;i ++)
|
||||
{
|
||||
var category = categoryList[i];
|
||||
if(0 == i)
|
||||
{
|
||||
categoryID = category.id;
|
||||
}
|
||||
options += '<option value="' + category.id + '">' + category.assetname + '</option>';
|
||||
}
|
||||
$("#searchCategoryID").empty().append('<option value="">请选择</option>').append(options);
|
||||
}
|
||||
|
||||
if(supplierList !=null)
|
||||
{
|
||||
options = "";
|
||||
for(var i = 0 ;i < supplierList.length;i ++)
|
||||
{
|
||||
var supplier = supplierList[i];
|
||||
if(0 == i)
|
||||
{
|
||||
supplierID = supplier.id;
|
||||
}
|
||||
options += '<option value="' + supplier.id + '">' + supplier.supplier + '</option>';
|
||||
}
|
||||
$("#searchSupplierID").empty().append('<option value="">请选择</option>').append(options);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//搜索处理
|
||||
$("#searchBtn").unbind().bind({
|
||||
click:function()
|
||||
{
|
||||
//是否限制条件 默认限制
|
||||
initShowDataNum();
|
||||
//系统基础数据
|
||||
getDataInfo();
|
||||
//综合图
|
||||
showComboChart();
|
||||
//饼状图
|
||||
showPieChart();
|
||||
//折线图
|
||||
showSpline();
|
||||
//显示柱状图
|
||||
showHistogram();
|
||||
//表格数据
|
||||
initTableData();
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
//重置按钮
|
||||
$("#searchResetBtn").unbind().bind({
|
||||
click:function(){
|
||||
$("#searchAssetNameID").val("");
|
||||
$("#searchCategoryID").val("");
|
||||
$("#searchUsernameID").val("");
|
||||
$("#searchStatus").val("");
|
||||
$("#searchSupplierID").val("");
|
||||
|
||||
//加载完以后重新初始化
|
||||
$("#searchBtn").click();
|
||||
}
|
||||
});
|
||||
|
||||
//设置饼状图为渐变色
|
||||
Highcharts.getOptions().colors = $.map(Highcharts.getOptions().colors, function(color) {
|
||||
return {
|
||||
radialGradient: { cx: 0.5, cy: 0.3, r: 0.7 },
|
||||
stops: [
|
||||
[0, color],
|
||||
[1, Highcharts.Color(color).brighten(-0.3).get('rgb')] // darken
|
||||
]
|
||||
};
|
||||
});
|
||||
|
||||
|
||||
//饼状图
|
||||
function showPieChart()
|
||||
{
|
||||
//解决初始化范围变小问题
|
||||
$("#pieContainer").empty();
|
||||
var getReportTypeInfo = getReportType();
|
||||
var reportType = $("#searchReportType").val();
|
||||
//封装数据到数组中
|
||||
var allDataInfo = new Array();
|
||||
|
||||
var showNumInfo = 0;
|
||||
if(pageData.length >= showNum)
|
||||
showNumInfo = 10;
|
||||
else
|
||||
showNumInfo = pageData.length;
|
||||
for(var i = 0;i < showNumInfo; i++)
|
||||
{
|
||||
var dataInfo = new Array();
|
||||
var totalInfo = pageData[i]
|
||||
|
||||
if(reportType == 0)
|
||||
{
|
||||
if(0 == totalInfo[1])
|
||||
dataInfo.push("在库");
|
||||
else if(1 == totalInfo[1])
|
||||
dataInfo.push("在用");
|
||||
else if(2 == totalInfo[1])
|
||||
dataInfo.push("消费");
|
||||
}
|
||||
else
|
||||
dataInfo.push(totalInfo[1]);
|
||||
|
||||
dataInfo.push(totalInfo[0]);
|
||||
allDataInfo.push(dataInfo);
|
||||
}
|
||||
|
||||
new Highcharts.Chart({
|
||||
chart: {
|
||||
renderTo: 'pieContainer',
|
||||
plotBackgroundColor: null,
|
||||
plotBorderWidth: null,
|
||||
backgroundColor:'#EAF2FD',
|
||||
plotShadow: false
|
||||
},
|
||||
title: {
|
||||
text: getReportTypeInfo + "饼状图"
|
||||
},
|
||||
tooltip: {
|
||||
formatter: function() {
|
||||
return this.point.name +':'+ this.y + "个";
|
||||
}
|
||||
},
|
||||
plotOptions: {
|
||||
pie: {
|
||||
allowPointSelect: true,
|
||||
cursor: 'pointer',
|
||||
dataLabels: {
|
||||
enabled: true,
|
||||
color: '#000000',
|
||||
connectorColor: '#000000',
|
||||
formatter: function() {
|
||||
if(this.point.name.length >10)
|
||||
return '<b>' + this.point.name.substr(0,10) + "</b>...:"+ this.y + "个";
|
||||
return '<b>' + this.point.name +'</b>:'+ this.y + "个";
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
series: [{
|
||||
type: 'pie',
|
||||
name: '',
|
||||
data: allDataInfo
|
||||
}]
|
||||
});
|
||||
}
|
||||
|
||||
//综合图
|
||||
function showComboChart()
|
||||
{
|
||||
//解决初始化范围变小问题
|
||||
$("#zongheContainer").empty();
|
||||
var getReportTypeInfo = getReportType();
|
||||
var reportType = $("#searchReportType").val();
|
||||
//按照统计数据封装显示数据
|
||||
var xName = new Array();
|
||||
var columnData = new Array();
|
||||
var columnDataForm = null;
|
||||
var averageDataForm = null;
|
||||
var allDataSum = 0;
|
||||
|
||||
var showNumInfo = 0;
|
||||
if(pageData.length >= showNum)
|
||||
showNumInfo = 10;
|
||||
else
|
||||
showNumInfo = pageData.length;
|
||||
for(var i = 0 ;i < showNumInfo;i ++)
|
||||
{
|
||||
var eachData = pageData[i];
|
||||
var sum = eachData[0];
|
||||
var totalInfo = eachData[1];
|
||||
if(reportType == 0)
|
||||
{
|
||||
if(0 == totalInfo)
|
||||
xName.push("在库");
|
||||
else if(1 == totalInfo)
|
||||
xName.push("在用");
|
||||
else if(2 == totalInfo)
|
||||
xName.push("消费");
|
||||
}
|
||||
else
|
||||
xName.push(totalInfo);
|
||||
columnData.push(sum);
|
||||
allDataSum += sum;
|
||||
}
|
||||
columnDataForm =
|
||||
{
|
||||
type: 'column',
|
||||
name: "资产总数",
|
||||
data: columnData
|
||||
};
|
||||
|
||||
averageDataForm = {
|
||||
type: 'spline',
|
||||
name: getReportTypeInfo + '资产概况曲线',
|
||||
data: columnData,
|
||||
marker: {
|
||||
lineWidth: 2,
|
||||
lineColor: Highcharts.getOptions().colors[3],
|
||||
fillColor: 'white'
|
||||
}
|
||||
};
|
||||
sumDataForm =
|
||||
{
|
||||
type: 'pie',
|
||||
name: '总数',
|
||||
data: [{
|
||||
name: '资产总数',
|
||||
y: allDataSum
|
||||
}],
|
||||
center: [450, 1],
|
||||
size: 80,
|
||||
showInLegend: false,
|
||||
dataLabels: {
|
||||
enabled: true,
|
||||
align:'center'
|
||||
}
|
||||
}
|
||||
new Highcharts.Chart({
|
||||
chart: {
|
||||
renderTo: 'zongheContainer',
|
||||
backgroundColor:'#EAF2FD'
|
||||
},
|
||||
title: {
|
||||
text: getReportTypeInfo + "综合图"
|
||||
},
|
||||
xAxis: {
|
||||
categories: xName,
|
||||
labels: {
|
||||
rotation: -45, //逆时针旋转45°,标签名称太长。
|
||||
align: 'right', //设置右对齐
|
||||
formatter: function() {
|
||||
if(this.value.length >10)
|
||||
return this.value.substr(0,10) + "...";
|
||||
return this.value ;
|
||||
}
|
||||
}
|
||||
},
|
||||
yAxis: {
|
||||
title: {
|
||||
text: ''
|
||||
},
|
||||
labels: {
|
||||
formatter: function() {
|
||||
return this.value;
|
||||
}
|
||||
}
|
||||
},
|
||||
plotOptions: {
|
||||
column: {
|
||||
cursor: 'pointer',
|
||||
dataLabels: {
|
||||
enabled: true,
|
||||
style: {
|
||||
fontWeight: 'bold'
|
||||
},
|
||||
formatter: function() {
|
||||
return this.y;
|
||||
}
|
||||
},
|
||||
//设置是否显示最下面选项
|
||||
showInLegend: false
|
||||
},
|
||||
spline: {
|
||||
marker: {
|
||||
radius: 4,
|
||||
lineColor: '#666666',
|
||||
lineWidth: 1
|
||||
},
|
||||
showInLegend: false
|
||||
},
|
||||
line: {
|
||||
dataLabels: {
|
||||
enabled: false
|
||||
},
|
||||
enableMouseTracking: true,
|
||||
showInLegend: false
|
||||
},
|
||||
pie: {
|
||||
allowPointSelect: true,
|
||||
cursor: 'pointer',
|
||||
dataLabels: {
|
||||
color: '#000000',
|
||||
connectorColor: '#000000',
|
||||
formatter: function() {
|
||||
return '资产总数: '+ this.y;
|
||||
}
|
||||
},
|
||||
showInLegend: false
|
||||
}
|
||||
},
|
||||
tooltip: {
|
||||
formatter: function() {
|
||||
var s;
|
||||
if(this.x == 0)
|
||||
s = '在库:'+ this.y +' 个';
|
||||
else if(this.x ==1)
|
||||
s = '在用:'+ this.y +' 个';
|
||||
else if(this.x ==2)
|
||||
s = '消费:'+ this.y +' 个';
|
||||
else
|
||||
s = this.x +':'+ this.y +' 个';
|
||||
return s;
|
||||
}
|
||||
},
|
||||
labels: {
|
||||
items: [{
|
||||
html: '',
|
||||
style: {
|
||||
left: '40px',
|
||||
top: '8px',
|
||||
color: 'black'
|
||||
}
|
||||
}]
|
||||
},
|
||||
series: [columnDataForm,averageDataForm,sumDataForm]
|
||||
});
|
||||
}
|
||||
|
||||
//折线图
|
||||
function showSpline()
|
||||
{
|
||||
//解决初始化范围变小问题
|
||||
$("#zxianContainer").empty();
|
||||
var getReportTypeInfo = getReportType();
|
||||
var reportType = $("#searchReportType").val();
|
||||
var dataInfo = new Array();
|
||||
var nameData = new Array();
|
||||
var consumeSumInfo= null;
|
||||
|
||||
var showNumInfo = 0;
|
||||
if(pageData.length >= showNum)
|
||||
showNumInfo = 10;
|
||||
else
|
||||
showNumInfo = pageData.length;
|
||||
for(var i = 0 ;i < showNumInfo;i ++)
|
||||
{
|
||||
var totalInfo = pageData[i]
|
||||
dataInfo.push(totalInfo[0]);
|
||||
if(reportType == 0)
|
||||
{
|
||||
if(0 == totalInfo[1])
|
||||
nameData.push("在库");
|
||||
else if(1 == totalInfo[1])
|
||||
nameData.push("在用");
|
||||
else if(2 == totalInfo[1])
|
||||
nameData.push("消费");
|
||||
}
|
||||
else
|
||||
nameData.push(totalInfo[1]);
|
||||
}
|
||||
consumeSumInfo= {
|
||||
name: getReportTypeInfo + '总额',
|
||||
marker: {
|
||||
symbol: 'square',
|
||||
labels: {
|
||||
formatter: function()
|
||||
{
|
||||
return this.value +'个';
|
||||
}
|
||||
}
|
||||
},
|
||||
data: dataInfo
|
||||
};
|
||||
|
||||
new Highcharts.Chart({
|
||||
chart: {
|
||||
renderTo: 'zxianContainer',
|
||||
type: 'line',
|
||||
backgroundColor:'#EAF2FD'
|
||||
},
|
||||
title: {
|
||||
text: getReportTypeInfo + "曲线图"
|
||||
},
|
||||
subtitle: {
|
||||
text: ''
|
||||
},
|
||||
xAxis: {
|
||||
categories: nameData,
|
||||
allowDecimals:false,
|
||||
labels: {
|
||||
rotation: -45, //逆时针旋转45°,标签名称太长。
|
||||
align: 'right', //设置右对齐
|
||||
formatter: function() {
|
||||
if(this.value.length >10)
|
||||
return this.value.substr(0,10) + "...";
|
||||
return this.value ;
|
||||
}
|
||||
}
|
||||
},
|
||||
yAxis: {
|
||||
title: {
|
||||
text: ''
|
||||
},
|
||||
labels: {
|
||||
formatter: function() {
|
||||
return this.value;
|
||||
}
|
||||
}
|
||||
},
|
||||
tooltip: {
|
||||
crosshairs: false,
|
||||
shared: true,
|
||||
formatter: function() { //格式化提示框的内容样式
|
||||
return this.x +': '+ this.y +'个';
|
||||
}
|
||||
},
|
||||
plotOptions: {
|
||||
spline: {
|
||||
marker: {
|
||||
radius: 4,
|
||||
lineColor: '#666666',
|
||||
lineWidth: 1
|
||||
},
|
||||
showInLegend: false
|
||||
},
|
||||
line: {
|
||||
dataLabels: {
|
||||
enabled: true
|
||||
},
|
||||
enableMouseTracking: true,
|
||||
showInLegend: false
|
||||
}
|
||||
},
|
||||
series: [consumeSumInfo]
|
||||
});
|
||||
}
|
||||
|
||||
//柱状图
|
||||
function showHistogram()
|
||||
{
|
||||
//解决初始化范围变小问题
|
||||
$("#culumnContainer").empty();
|
||||
var getReportTypeInfo = getReportType();
|
||||
var reportType = $("#searchReportType").val();
|
||||
var dataInfo = new Array();
|
||||
var nameData = new Array();
|
||||
var consumeSumInfo= null;
|
||||
|
||||
var showNumInfo = 0;
|
||||
if(pageData.length >= showNum)
|
||||
showNumInfo = 10;
|
||||
else
|
||||
showNumInfo = pageData.length;
|
||||
for(var i = 0 ;i < showNumInfo;i ++)
|
||||
{
|
||||
var totalInfo = pageData[i]
|
||||
dataInfo.push(totalInfo[0]);
|
||||
if(reportType == 0)
|
||||
{
|
||||
if(0 == totalInfo[1])
|
||||
nameData.push("在库");
|
||||
else if(1 == totalInfo[1])
|
||||
nameData.push("在用");
|
||||
else if(2 == totalInfo[1])
|
||||
nameData.push("消费");
|
||||
}
|
||||
else
|
||||
nameData.push(totalInfo[1]);
|
||||
|
||||
}
|
||||
consumeSumInfo= {
|
||||
name: getReportTypeInfo + "柱状图",
|
||||
data: dataInfo
|
||||
}
|
||||
|
||||
new Highcharts.Chart({
|
||||
chart: {
|
||||
renderTo: 'culumnContainer',
|
||||
type: 'column',
|
||||
backgroundColor:'#EAF2FD'
|
||||
},
|
||||
title: {
|
||||
text: getReportTypeInfo + "柱状图"
|
||||
},
|
||||
xAxis: {
|
||||
categories: nameData,
|
||||
labels: {
|
||||
rotation: -45, //逆时针旋转45°,标签名称太长。
|
||||
align: 'right', //设置右对齐
|
||||
formatter: function() {
|
||||
if(this.value.length >10)
|
||||
return this.value.substr(0,10) + "...";
|
||||
return this.value ;
|
||||
}
|
||||
}
|
||||
},
|
||||
yAxis: {
|
||||
title: {
|
||||
text: ''
|
||||
},
|
||||
labels: {
|
||||
formatter: function() {
|
||||
return this.value;
|
||||
}
|
||||
}
|
||||
},
|
||||
plotOptions: {
|
||||
column: {
|
||||
cursor: 'pointer',
|
||||
dataLabels: {
|
||||
enabled: true,
|
||||
style: {
|
||||
fontWeight: 'bold'
|
||||
},
|
||||
formatter: function() {
|
||||
return this.y;
|
||||
}
|
||||
},
|
||||
showInLegend: false
|
||||
}
|
||||
},
|
||||
tooltip: {
|
||||
formatter: function() {
|
||||
return this.x +':'+ this.y +'个';
|
||||
}
|
||||
},
|
||||
credits: {
|
||||
enabled: false
|
||||
},
|
||||
series: [consumeSumInfo]
|
||||
});
|
||||
}
|
||||
|
||||
//填充表格数据
|
||||
function initTableDetails()
|
||||
{
|
||||
var reportType = $("#searchReportType").val();
|
||||
var dataJson = {};
|
||||
dataJson.total = pageData.length;
|
||||
var dataArray = [];
|
||||
var totalSum = 0;
|
||||
var typeSum = 0;
|
||||
var footerArray = [];
|
||||
|
||||
var showNumInfo = 0;
|
||||
if(pageData.length >= showNum)
|
||||
showNumInfo = 10;
|
||||
else
|
||||
showNumInfo = pageData.length;
|
||||
for(var i = 0 ;i < showNumInfo;i ++)
|
||||
{
|
||||
var totalInfo = pageData[i];
|
||||
var name = "";
|
||||
if(reportType == 0)
|
||||
{
|
||||
if(0 == totalInfo[1])
|
||||
name = "在库";
|
||||
else if(1 == totalInfo[1])
|
||||
name = "在用";
|
||||
else if(2 == totalInfo[1])
|
||||
name = "消费";
|
||||
}
|
||||
else
|
||||
name = totalInfo[1];
|
||||
var dataInfo = {};
|
||||
dataInfo.name = name;
|
||||
dataInfo.sum = totalInfo[0];
|
||||
totalSum += totalInfo[0];
|
||||
dataArray.push(dataInfo);
|
||||
typeSum ++;
|
||||
}
|
||||
|
||||
var footerInfo = {
|
||||
sum : totalSum,
|
||||
name:getReportType()+ ' ' + typeSum + ' 种类型总数'
|
||||
};
|
||||
footerArray.push(footerInfo);
|
||||
dataJson.rows = dataArray;
|
||||
dataJson.footer = footerArray;
|
||||
return dataJson;
|
||||
}
|
||||
//返回统计类型字符串
|
||||
function getReportType()
|
||||
{
|
||||
var reportType = $("#searchReportType").val();
|
||||
if(reportType==0)
|
||||
{
|
||||
return '按资产状态统计';
|
||||
}
|
||||
else if(reportType==1)
|
||||
{
|
||||
return '按资产类型统计';
|
||||
}
|
||||
else if(reportType==2)
|
||||
{
|
||||
return '按供应商统计';
|
||||
}
|
||||
else if(reportType==3)
|
||||
{
|
||||
return '按资产名称统计';
|
||||
}
|
||||
else if(reportType==4)
|
||||
{
|
||||
return '按所属用户统计';
|
||||
}
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
24
src/main/webapp/pages/common/admin.jsp
Normal file
24
src/main/webapp/pages/common/admin.jsp
Normal file
@@ -0,0 +1,24 @@
|
||||
<%@page import="com.jsh.util.Tools"%>
|
||||
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
|
||||
<%
|
||||
String path = request.getContextPath();
|
||||
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
|
||||
String clientIp = Tools.getCurrentUserIP();
|
||||
%>
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head>
|
||||
<title>ERP系统</title>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
<!-- 指定以IE8的方式来渲染 -->
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE8"/>
|
||||
<link rel="shortcut icon" href="<%=path%>/images/favicon.ico" type="image/x-icon" />
|
||||
<link type="text/css" rel="stylesheet" href="<%=path %>/css/css.css" />
|
||||
</head>
|
||||
<frameset frameborder="no" border="0" framespacing="0" id="framesetList">
|
||||
<frame src="<%=path %>/pages/common/main.jsp" name="mainFrame" id="mainFrame" title="mainFrame" />
|
||||
</frameset>
|
||||
<body>
|
||||
</body>
|
||||
</noframes>
|
||||
</html>
|
||||
19
src/main/webapp/pages/common/foot.jsp
Normal file
19
src/main/webapp/pages/common/foot.jsp
Normal file
@@ -0,0 +1,19 @@
|
||||
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
|
||||
<%
|
||||
String path = request.getContextPath();
|
||||
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
|
||||
%>
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head>
|
||||
<title>资产管理</title>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
<!-- 指定以IE8的方式来渲染 -->
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE8"/>
|
||||
<link rel="shortcut icon" href="<%=path%>/images/favicon.ico" type="image/x-icon" />
|
||||
<link type="text/css" rel="stylesheet" href="<%=path %>/css/css.css" />
|
||||
</head>
|
||||
<body>
|
||||
<div id="foot">Copyright © 2015 季圣华 版权所有 版本号 V1.0</div>
|
||||
</body>
|
||||
</html>
|
||||
167
src/main/webapp/pages/common/head.jsp
Normal file
167
src/main/webapp/pages/common/head.jsp
Normal file
@@ -0,0 +1,167 @@
|
||||
<%@page import="com.jsh.util.Tools"%>
|
||||
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
|
||||
<%
|
||||
String path = request.getContextPath();
|
||||
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
|
||||
String clientIp = Tools.getCurrentUserIP();
|
||||
%>
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head>
|
||||
<title>资产管理</title>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
<!-- 指定以IE8的方式来渲染 -->
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE8"/>
|
||||
<link rel="shortcut icon" href="<%=path%>/images/favicon.ico" type="image/x-icon" />
|
||||
<link type="text/css" rel="stylesheet" href="<%=path %>/css/css.css" />
|
||||
<script type="text/javascript" src="<%=path %>/js/jquery-1.8.0.min.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<div id="header">
|
||||
<div id="logo"><img src="<%=path%>/images/windvane.png" height="50" alt="资产管理" title="资产管理"/></div>
|
||||
<!-- <div id="logo"><img src="<%=path%>/images/suma_logo.png" height="45" alt="资产管理系统" title="资产管理系统"/></div> -->
|
||||
<div id="nav_top">
|
||||
<ul>
|
||||
<li><a href="<%=path%>/pages/other/clock.jsp" style="background:url(<%=path %>/images/clock.png) 0 1px no-repeat;color:#333;text-decoration:none;" target="mainFrame"><span id="showNowTime"></span></a></li>
|
||||
<li>|</li>
|
||||
<li><a href="javascript:void(0)" style="background:url(<%=path %>/images/user_business_boss.png) 0 1px no-repeat;color:#333;text-decoration:none;">用户名:${sessionScope.user.loginame}</a></li>
|
||||
<li>|</li>
|
||||
<li id="1"><a href="<%=path %>/pages/common/home.jsp" id="navtop_home" target="mainFrame" style="color:#333;text-decoration:none;">首页</a></li>
|
||||
<li id="2">|</li>
|
||||
<li id="3"><a href="<%=path %>/pages/user/userinfo.jsp" id="person_file" target="mainFrame" style="background:url(<%=path %>/images/comment.png) 0 1px no-repeat;color:#333;text-decoration:none;">个人资料</a></li>
|
||||
<li id="4">|</li>
|
||||
<li id="5"><a href="<%=path %>/pages/user/password.jsp" target="mainFrame" id="navtop_editpwd" style="background:url(<%=path %>/images/lock_unlock.png) 0 1px no-repeat;color:#333;text-decoration:none;">修改密码</a></li>
|
||||
<!--<li>|</li>
|
||||
<li><a href="javascript:void(0)" id="navtop_help">帮助</a></li>
|
||||
-->
|
||||
<li id="6">|</li>
|
||||
<li><a href="javascript:void(0)" id="navtop_logout">注销</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<script type="text/javascript">
|
||||
$(init);
|
||||
//页面初始化
|
||||
function init()
|
||||
{
|
||||
//初始化时间
|
||||
showTime();
|
||||
if('${sessionScope.user.loginame}'!= 'guest')
|
||||
$("#1").add("#2").add("#3").add("#4").add("#5").add("#6").show();
|
||||
else
|
||||
$("#1").add("#2").add("#3").add("#4").add("#5").add("#6").hide();
|
||||
}
|
||||
|
||||
function showDate()
|
||||
{
|
||||
var calendar = new Date();
|
||||
var day = calendar.getDay();
|
||||
var month = calendar.getMonth();
|
||||
var date = calendar.getDate();
|
||||
var year = calendar.getYear();
|
||||
if (year< 1900)
|
||||
{
|
||||
year = 1900 + year;
|
||||
}
|
||||
var cent = parseInt(year/100);
|
||||
var g = year % 19;
|
||||
var k = parseInt((cent - 17)/25);
|
||||
var i = (cent - parseInt(cent/4) - parseInt((cent - k)/3) + 19*g + 15) % 30;
|
||||
i = i - parseInt(i/28)*(1 - parseInt(i/28)*parseInt(29/(i+1))*parseInt((21-g)/11));
|
||||
var j = (year + parseInt(year/4) + i + 2 - cent + parseInt(cent/4)) % 7;
|
||||
var l = i - j;
|
||||
var emonth = 3 + parseInt((l + 40)/44);
|
||||
var edate = l + 28 - 31*parseInt((emonth/4));
|
||||
emonth--;
|
||||
var dayname = new Array ("星期日", "星期一", "星期二", "星期三", "星期四", "星期五", "星期六");
|
||||
var monthname =new Array ("1月","2月","3月","4月","5月","6月","7月","8月","9月","10月","11月","12月" );
|
||||
var message = "";
|
||||
if(getOs().indexOf("MSIE")!= -1)
|
||||
{
|
||||
//控制时间和图片之间的距离
|
||||
$("#blankSpace").empty().append(" ");
|
||||
message = year + "年" + monthname[month]+ date + "日 " + dayname[day]+" ";
|
||||
|
||||
}
|
||||
else if(getOs().indexOf("Firefox") != -1)
|
||||
{
|
||||
$("#blankSpace").empty().append(" ");
|
||||
message = year + "年 " + monthname[month]+ date + "日 " + dayname[day]+" ";
|
||||
}
|
||||
else
|
||||
{
|
||||
$("#blankSpace").empty().append(" ");
|
||||
message = year + "年 " + monthname[month]+ date + "日 " + dayname[day] + " ";
|
||||
}
|
||||
return message;
|
||||
}
|
||||
function showTime()
|
||||
{
|
||||
var Digital=new Date();
|
||||
var hours=Digital.getHours();
|
||||
var minutes=Digital.getMinutes();
|
||||
var seconds=Digital.getSeconds();
|
||||
if(hours==0)
|
||||
{
|
||||
hours="00";
|
||||
}
|
||||
if(hours <= 9 && hours > 0)
|
||||
{
|
||||
hours="0"+hours;
|
||||
}
|
||||
if(minutes<=9)
|
||||
minutes="0"+minutes;
|
||||
if(seconds<=9)
|
||||
seconds="0"+seconds;
|
||||
var myclock=hours+":"+minutes+":"+seconds;
|
||||
//定时器
|
||||
setTimeout("showTime()",1000);
|
||||
var message = showDate()+" "+myclock;
|
||||
$("#showNowTime").empty().append(message);
|
||||
}
|
||||
//判断浏览器的类型
|
||||
function getOs()
|
||||
{
|
||||
var OsObject = "";
|
||||
if(navigator.userAgent.indexOf("MSIE")>0)
|
||||
{
|
||||
return "MSIE";
|
||||
}
|
||||
else if(navigator.userAgent.indexOf("Firefox")>0)
|
||||
{
|
||||
return "Firefox";
|
||||
}
|
||||
else if(navigator.userAgent.indexOf("Safari")>0)
|
||||
{
|
||||
return "Safari";
|
||||
}
|
||||
else if(navigator.userAgent.indexOf("Camino")>0)
|
||||
{
|
||||
return "Camino";
|
||||
}
|
||||
else if(navigator.userAgent.indexOf("Gecko/")>0)
|
||||
{
|
||||
return "Gecko";
|
||||
}
|
||||
else if(navigator.userAgent.indexOf("Opera/")>0)
|
||||
{
|
||||
return "Opera";
|
||||
}
|
||||
else
|
||||
{
|
||||
return "unknown";
|
||||
}
|
||||
}
|
||||
//退出系统
|
||||
$("#navtop_logout").bind({
|
||||
click:function()
|
||||
{
|
||||
if(confirm("确认要退出系统吗?"))
|
||||
{
|
||||
window.location.href ="<%=path%>/user/logout.action?clientIp=<%=clientIp%>" ;
|
||||
}
|
||||
}
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
727
src/main/webapp/pages/common/home.jsp
Normal file
727
src/main/webapp/pages/common/home.jsp
Normal file
@@ -0,0 +1,727 @@
|
||||
<%@page import="com.jsh.util.Tools"%>
|
||||
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
|
||||
<%
|
||||
String path = request.getContextPath();
|
||||
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
|
||||
String clientIp = Tools.getCurrentUserIP();
|
||||
String type = request.getParameter("type");
|
||||
String location = "首页";
|
||||
if(null != type)
|
||||
location = "资产管理 >资产概况";
|
||||
%>
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head>
|
||||
<title>erp</title>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
<!-- 指定以IE8的方式来渲染 -->
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE8"/>
|
||||
<link rel="shortcut icon" href="<%=path%>/images/favicon.ico" type="image/x-icon" />
|
||||
<link rel="stylesheet" type="text/css" href="<%=path %>/js/easyui-1.3.5/themes/default/easyui.css"/>
|
||||
<link rel="stylesheet" type="text/css" href="<%=path %>/js/easyui-1.3.5/themes/icon.css"/>
|
||||
<script type="text/javascript" src="<%=path %>/js/jquery-1.8.0.min.js"></script>
|
||||
<script type="text/javascript" src="<%=path %>/js/easyui-1.3.5/jquery.easyui.min.js"></script>
|
||||
<script type="text/javascript" src="<%=path %>/js/easyui-1.3.5/locale/easyui-lang-zh_CN.js"></script>
|
||||
<script type="text/javascript" src="<%=path%>/js/highcharts/highcharts.js"></script>
|
||||
<script type="text/javascript" src="<%=path%>/js/highcharts/exporting.js"></script>
|
||||
<style>
|
||||
body{ margin:0; height:100%}
|
||||
html{ height:100%} /*兼容firefox的div高度100%*/
|
||||
#left{ width:150px; height:100%; float:left; _margin-right:-3px;}
|
||||
#right{ height:100%;}
|
||||
#leftdown{ width:150px; height:100%; float:left; _margin-right:-3px;}
|
||||
#rightdown{ height:100%;}
|
||||
<!--页面展示特殊要求-->
|
||||
.datagrid-body,.datagrid-footer,.datagrid-pager ,.datagrid-view
|
||||
{
|
||||
background-color:#EAF2FD;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div id="position" class="easyui-panel" title="当前位置: <%=location %>" collapsible="false" closable="false"/>
|
||||
<!--按月统计资产柱状图 -->
|
||||
<div id = "tablePanel0" class="easyui-panel" style="padding:1px;top:300px;" title="资产报表" iconCls="icon-chart-column" collapsible="true" maximizable="false" closable="false">
|
||||
<div id="left" class="easyui-tabs" style="width:630px;height:auto;padding:1px;">
|
||||
<div title="综合图" style="padding:10px;background-color: #EAF2FD;height:340px;top:300px;" data-options="iconCls:'icon-chart-zonghe'">
|
||||
<div id="zongheContainer" style="height: 340px;">综合图</div>
|
||||
</div>
|
||||
</div>
|
||||
<div id="right" class="easyui-tabs" style="height:auto;padding:1px;">
|
||||
<div title="柱状图" style="padding:10px;background-color: #EAF2FD;height:340px;top:300px;" data-options="iconCls:'icon-chart-statistics'">
|
||||
<div id="culumnContainer" style="height: 340px;">柱状图</div>
|
||||
</div>
|
||||
</div>
|
||||
<div id="leftdown" class="easyui-tabs" style="width:630px;height:auto;padding:1px;">
|
||||
<div title="折线图" data-options="iconCls:'icon-chart-polygram'" style="padding:10px;background-color: #EAF2FD;height:340px;top:300px;">
|
||||
<div id="zxianContainer" style="height: 340px;">折现图</div>
|
||||
</div>
|
||||
</div>
|
||||
<div id="rightdown" class="easyui-tabs" style="height:auto;padding:1px;">
|
||||
<div title="饼状图" data-options="iconCls:'icon-chart-pie'" style="padding:10px;background-color: #EAF2FD;height:340px;top:300px;">
|
||||
<div id="pieContainer" style="height: 340px;">饼状图</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 数据显示table -->
|
||||
<div id = "tablePanel" class="easyui-panel" style="padding:1px;top:300px;" title="资产列表" iconCls="icon-list" collapsible="true" closable="false">
|
||||
<table id="tableData" style="height:360px;top:300px;border-bottom-color:#FFFFFF"></table>
|
||||
</div>
|
||||
|
||||
<script type="text/javascript">
|
||||
//控制图表显示个数
|
||||
var showNum = 10;
|
||||
//初始化界面
|
||||
$(function()
|
||||
{
|
||||
//progress();
|
||||
$.messager.progress({
|
||||
title:'请稍候',
|
||||
msg:'数据加载ing...'
|
||||
});
|
||||
//综合图
|
||||
showComboChart();
|
||||
//显示柱状图
|
||||
showHistogram();
|
||||
//折线图
|
||||
showSpline();
|
||||
//饼状图
|
||||
showPieChart();
|
||||
initTableData();
|
||||
ininPager();
|
||||
$.messager.progress('close');
|
||||
});
|
||||
|
||||
//加载进度条
|
||||
function progress()
|
||||
{
|
||||
var win = $.messager.progress({
|
||||
title:'请稍候',
|
||||
msg:'数据加载ing...'
|
||||
});
|
||||
setTimeout(function(){
|
||||
$.messager.progress('close');
|
||||
},3300);
|
||||
}
|
||||
|
||||
//初始化表格数据
|
||||
function initTableData()
|
||||
{
|
||||
$('#tableData').datagrid({
|
||||
//title:'资产列表',
|
||||
//iconCls:'icon-save',
|
||||
//width:700,
|
||||
//height:480,
|
||||
nowrap: false,
|
||||
rownumbers: false,
|
||||
//动画效果
|
||||
animate:false,
|
||||
//选中单行
|
||||
singleSelect : true,
|
||||
collapsible:false,
|
||||
selectOnCheck:false,
|
||||
//fitColumns:true,
|
||||
//单击行是否选中
|
||||
checkOnSelect : false,
|
||||
//交替出现背景
|
||||
striped : true,
|
||||
url:'<%=path %>/asset/findBy.action',
|
||||
pagination: true,
|
||||
//loadFilter: pagerFilter,
|
||||
pageSize: 10,
|
||||
pageList: [10,20,30,50],
|
||||
frozenColumns:[[
|
||||
{ field: 'id',width:35,align:"center",checkbox:true},
|
||||
{ title: '资产名称',field: 'assetname',width:100},
|
||||
{ title: '单价', field: 'price',width:70,align:"center"},
|
||||
{ title: '资产类型', field: 'category',width:115,align:"center"},
|
||||
{ title: '用户',field: 'username',width:100,align:"center"},
|
||||
{ title: '购买日期',field: 'purchasedate',width:90,align:"center"},
|
||||
{ title: '状态',field: 'status',width:50,align:"center"},
|
||||
{ title: '位置',field: 'location',width:100,align:"center"},
|
||||
{ title: '资产编号',field: 'assetnum',width:120,align:"center"},
|
||||
{ title: '序列号',field: 'serialnum',width:120,align:"center"}
|
||||
]],
|
||||
columns:[[
|
||||
{ title: '有效日期',field: 'periodofvalidity',width:90,align:"center"},
|
||||
{ title: '保修日期',field: 'warrantydate',width:90,align:"center"},
|
||||
{ title: '供应商',field: 'supplier',width:100,align:"center"},
|
||||
{ title: '标签',field: 'labels',width:180,align:"center"},
|
||||
{ title: '描述',field: 'description',width:300}
|
||||
]],
|
||||
onLoadError:function()
|
||||
{
|
||||
$.messager.alert('页面加载提示','页面加载异常,请稍后再试!','error');
|
||||
return;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
//分页信息处理
|
||||
function ininPager()
|
||||
{
|
||||
try
|
||||
{
|
||||
var opts = $("#tableData").datagrid('options');
|
||||
var pager = $("#tableData").datagrid('getPager');
|
||||
pager.pagination({
|
||||
onSelectPage:function(pageNum, pageSize)
|
||||
{
|
||||
opts.pageNumber = pageNum;
|
||||
opts.pageSize = pageSize;
|
||||
pager.pagination('refresh',
|
||||
{
|
||||
pageNumber:pageNum,
|
||||
pageSize:pageSize
|
||||
});
|
||||
showAssetDetails(pageNum,pageSize);
|
||||
}
|
||||
});
|
||||
}
|
||||
catch (e)
|
||||
{
|
||||
$.messager.alert('异常处理提示',"分页信息异常 : " + e.name + ": " + e.message,'error');
|
||||
}
|
||||
}
|
||||
|
||||
function showAssetDetails(pageNo,pageSize)
|
||||
{
|
||||
$.ajax({
|
||||
type:"post",
|
||||
url: "<%=path %>/asset/findBy.action",
|
||||
dataType: "json",
|
||||
data: ({
|
||||
assetNameID:$.trim($("#searchAssetNameID").val()),
|
||||
assetCategoryID:$.trim($("#searchCategoryID").val()),
|
||||
usernameID:$.trim($("#searchUsernameID").val()),
|
||||
status:$.trim($("#searchStatus").val()),
|
||||
supplierID:$.trim($("#searchSupplierID").val()),
|
||||
pageNo:pageNo,
|
||||
pageSize:pageSize
|
||||
}),
|
||||
success: function (data)
|
||||
{
|
||||
$("#tableData").datagrid('loadData',data);
|
||||
//$('#tableData').datagrid('reload');
|
||||
},
|
||||
//此处添加错误处理
|
||||
error:function()
|
||||
{
|
||||
$.messager.alert('查询提示','查询数据后台异常,请稍后再试!','error');
|
||||
return;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
//设置饼状图为渐变色
|
||||
Highcharts.getOptions().colors = $.map(Highcharts.getOptions().colors, function(color) {
|
||||
return {
|
||||
radialGradient: { cx: 0.5, cy: 0.3, r: 0.7 },
|
||||
stops: [
|
||||
[0, color],
|
||||
[1, Highcharts.Color(color).brighten(-0.3).get('rgb')] // darken
|
||||
]
|
||||
};
|
||||
});
|
||||
|
||||
|
||||
//饼状图
|
||||
function showPieChart()
|
||||
{
|
||||
var pageData = null;
|
||||
$.ajax({
|
||||
type:"post",
|
||||
url: "<%=path%>/report/find.action",
|
||||
dataType: "json",
|
||||
//取消异步机制,保证页面数据返回再进行处理
|
||||
async: false,
|
||||
data: ({
|
||||
reportType : 2,
|
||||
}),
|
||||
success: function (reportInfo)
|
||||
{
|
||||
pageData = reportInfo.showModel.reportData;
|
||||
var msgTip = reportInfo.showModel.msgTip;
|
||||
if(msgTip == "get report data exception")
|
||||
{
|
||||
alert("查找报表信息异常,请与管理员联系!");
|
||||
return;
|
||||
}
|
||||
}
|
||||
});
|
||||
//解决初始化范围变小问题
|
||||
$("#pieContainer").empty();
|
||||
var getReportTypeInfo = "按供应商统计";
|
||||
//封装数据到数组中
|
||||
var allDataInfo = new Array();
|
||||
for(var i = 0;i < pageData.length; i++)
|
||||
{
|
||||
var dataInfo = new Array();
|
||||
var totalInfo = pageData[i]
|
||||
|
||||
dataInfo.push(totalInfo[1]);
|
||||
|
||||
dataInfo.push(totalInfo[0]);
|
||||
allDataInfo.push(dataInfo);
|
||||
}
|
||||
|
||||
new Highcharts.Chart({
|
||||
chart: {
|
||||
renderTo: 'pieContainer',
|
||||
plotBackgroundColor: null,
|
||||
plotBorderWidth: null,
|
||||
backgroundColor:'#EAF2FD',
|
||||
plotShadow: false
|
||||
},
|
||||
title: {
|
||||
text: getReportTypeInfo + "饼状图"
|
||||
},
|
||||
tooltip: {
|
||||
formatter: function() {
|
||||
return this.point.name +':'+ this.y + "个";
|
||||
}
|
||||
},
|
||||
plotOptions: {
|
||||
pie: {
|
||||
allowPointSelect: true,
|
||||
cursor: 'pointer',
|
||||
dataLabels: {
|
||||
enabled: true,
|
||||
color: '#000000',
|
||||
connectorColor: '#000000',
|
||||
formatter: function() {
|
||||
if(this.point.name.length >10)
|
||||
return '<b>' + this.point.name.substr(0,10) + "</b>...:"+ this.y + "个";
|
||||
return '<b>' + this.point.name +'</b>:'+ this.y + "个";
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
series: [{
|
||||
type: 'pie',
|
||||
name: '',
|
||||
data: allDataInfo
|
||||
}]
|
||||
});
|
||||
}
|
||||
|
||||
//综合图
|
||||
function showComboChart()
|
||||
{
|
||||
var pageData = null;
|
||||
$.ajax({
|
||||
type:"post",
|
||||
url: "<%=path%>/report/find.action",
|
||||
dataType: "json",
|
||||
//取消异步机制,保证页面数据返回再进行处理
|
||||
async: false,
|
||||
data: ({
|
||||
reportType : 0
|
||||
}),
|
||||
success: function (reportInfo)
|
||||
{
|
||||
pageData = reportInfo.showModel.reportData;
|
||||
var msgTip = reportInfo.showModel.msgTip;
|
||||
if(msgTip == "get report data exception")
|
||||
{
|
||||
alert("查找报表信息异常,请与管理员联系!");
|
||||
return;
|
||||
}
|
||||
}
|
||||
});
|
||||
//解决初始化范围变小问题
|
||||
$("#zongheContainer").empty();
|
||||
var getReportTypeInfo = "按资产状态统计";
|
||||
//按照统计数据封装显示数据
|
||||
var xName = new Array();
|
||||
var columnData = new Array();
|
||||
var columnDataForm = null;
|
||||
var averageDataForm = null;
|
||||
var allDataSum = 0;
|
||||
|
||||
var showNumInfo = 0;
|
||||
if(pageData.length >= showNum)
|
||||
showNumInfo = 10;
|
||||
else
|
||||
showNumInfo = pageData.length;
|
||||
for(var i = 0 ;i < showNumInfo;i ++)
|
||||
{
|
||||
var eachData = pageData[i];
|
||||
var sum = eachData[0];
|
||||
var totalInfo = eachData[1];
|
||||
if(0 == totalInfo)
|
||||
xName.push("在库");
|
||||
else if(1 == totalInfo)
|
||||
xName.push("在用");
|
||||
else if(2 == totalInfo)
|
||||
xName.push("消费");
|
||||
columnData.push(sum);
|
||||
allDataSum += sum;
|
||||
}
|
||||
columnDataForm =
|
||||
{
|
||||
type: 'column',
|
||||
name: "资产总数",
|
||||
data: columnData
|
||||
};
|
||||
|
||||
averageDataForm = {
|
||||
type: 'spline',
|
||||
name: getReportTypeInfo + '资产概况曲线',
|
||||
data: columnData,
|
||||
marker: {
|
||||
lineWidth: 2,
|
||||
lineColor: Highcharts.getOptions().colors[3],
|
||||
fillColor: 'white'
|
||||
}
|
||||
};
|
||||
sumDataForm =
|
||||
{
|
||||
type: 'pie',
|
||||
name: '总数',
|
||||
data: [{
|
||||
name: '资产总数',
|
||||
y: allDataSum
|
||||
}],
|
||||
center: [450, 1],
|
||||
size: 80,
|
||||
showInLegend: false,
|
||||
dataLabels: {
|
||||
enabled: true,
|
||||
align:'center'
|
||||
}
|
||||
}
|
||||
new Highcharts.Chart({
|
||||
chart: {
|
||||
renderTo: 'zongheContainer',
|
||||
backgroundColor:'#EAF2FD'
|
||||
},
|
||||
title: {
|
||||
text: getReportTypeInfo + "综合图"
|
||||
},
|
||||
xAxis: {
|
||||
categories: xName
|
||||
},
|
||||
yAxis: {
|
||||
title: {
|
||||
text: ''
|
||||
},
|
||||
labels: {
|
||||
formatter: function() {
|
||||
return this.value;
|
||||
}
|
||||
}
|
||||
},
|
||||
plotOptions: {
|
||||
column: {
|
||||
cursor: 'pointer',
|
||||
dataLabels: {
|
||||
enabled: true,
|
||||
style: {
|
||||
fontWeight: 'bold'
|
||||
},
|
||||
formatter: function() {
|
||||
return this.y;
|
||||
}
|
||||
},
|
||||
//设置是否显示最下面选项
|
||||
showInLegend: false
|
||||
},
|
||||
spline: {
|
||||
marker: {
|
||||
radius: 4,
|
||||
lineColor: '#666666',
|
||||
lineWidth: 1
|
||||
},
|
||||
showInLegend: false
|
||||
},
|
||||
line: {
|
||||
dataLabels: {
|
||||
enabled: false
|
||||
},
|
||||
enableMouseTracking: true,
|
||||
showInLegend: false
|
||||
},
|
||||
pie: {
|
||||
allowPointSelect: false,
|
||||
dataLabels: {
|
||||
color: '#000000',
|
||||
connectorColor: '#000000',
|
||||
formatter: function() {
|
||||
return '资产总数: '+ this.y;
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
tooltip: {
|
||||
formatter: function() {
|
||||
return this.key +':'+ this.y +' 个';
|
||||
}
|
||||
},
|
||||
labels: {
|
||||
items: [{
|
||||
html: '',
|
||||
style: {
|
||||
left: '40px',
|
||||
top: '8px',
|
||||
color: 'black'
|
||||
}
|
||||
}]
|
||||
},
|
||||
series: [columnDataForm,averageDataForm,sumDataForm]
|
||||
});
|
||||
}
|
||||
|
||||
//折线图
|
||||
function showSpline()
|
||||
{
|
||||
var pageData = null;
|
||||
$.ajax({
|
||||
type:"post",
|
||||
url: "<%=path%>/report/find.action",
|
||||
dataType: "json",
|
||||
//取消异步机制,保证页面数据返回再进行处理
|
||||
async: false,
|
||||
data: ({
|
||||
reportType : 1
|
||||
}),
|
||||
success: function (reportInfo)
|
||||
{
|
||||
pageData = reportInfo.showModel.reportData;
|
||||
var msgTip = reportInfo.showModel.msgTip;
|
||||
if(msgTip == "get report data exception")
|
||||
{
|
||||
alert("查找报表信息异常,请与管理员联系!");
|
||||
return;
|
||||
}
|
||||
}
|
||||
});
|
||||
//解决初始化范围变小问题
|
||||
$("#zxianContainer").empty();
|
||||
var getReportTypeInfo = "按资产类型统计";
|
||||
var dataInfo = new Array();
|
||||
var nameData = new Array();
|
||||
var consumeSumInfo= null;
|
||||
|
||||
|
||||
var showNumInfo = 0;
|
||||
if(pageData.length >= showNum)
|
||||
showNumInfo = 10;
|
||||
else
|
||||
showNumInfo = pageData.length;
|
||||
for(var i = 0 ;i < showNumInfo;i ++)
|
||||
{
|
||||
var totalInfo = pageData[i]
|
||||
dataInfo.push(totalInfo[0]);
|
||||
nameData.push(totalInfo[1]);
|
||||
}
|
||||
consumeSumInfo= {
|
||||
name: getReportTypeInfo + '总共',
|
||||
marker: {
|
||||
symbol: 'square',
|
||||
labels: {
|
||||
formatter: function()
|
||||
{
|
||||
return this.value +'个';
|
||||
}
|
||||
}
|
||||
},
|
||||
data: dataInfo
|
||||
};
|
||||
|
||||
new Highcharts.Chart({
|
||||
chart: {
|
||||
renderTo: 'zxianContainer',
|
||||
type: 'line',
|
||||
backgroundColor:'#EAF2FD'
|
||||
},
|
||||
title: {
|
||||
text: getReportTypeInfo + "曲线图"
|
||||
},
|
||||
subtitle: {
|
||||
text: ''
|
||||
},
|
||||
xAxis: {
|
||||
categories: nameData,
|
||||
labels: {
|
||||
rotation: -45, //逆时针旋转45°,标签名称太长。
|
||||
align: 'right', //设置右对齐
|
||||
formatter: function() {
|
||||
if(this.value.length >10)
|
||||
return this.value.substr(0,10) + "...";
|
||||
return this.value ;
|
||||
}
|
||||
}
|
||||
},
|
||||
yAxis: {
|
||||
title: {
|
||||
text: ''
|
||||
},
|
||||
labels: {
|
||||
formatter: function() {
|
||||
return this.value ;
|
||||
}
|
||||
}
|
||||
},
|
||||
tooltip: {
|
||||
crosshairs: false,
|
||||
shared: true,
|
||||
formatter: function() {
|
||||
return this.x + ":" +this.y +'个';
|
||||
}
|
||||
},
|
||||
plotOptions: {
|
||||
spline: {
|
||||
marker: {
|
||||
radius: 4,
|
||||
lineColor: '#666666',
|
||||
lineWidth: 1
|
||||
},
|
||||
showInLegend: false
|
||||
},
|
||||
line: {
|
||||
dataLabels: {
|
||||
enabled: true
|
||||
},
|
||||
enableMouseTracking: true,
|
||||
showInLegend: false
|
||||
}
|
||||
},
|
||||
series: [consumeSumInfo]
|
||||
});
|
||||
}
|
||||
|
||||
//柱状图
|
||||
function showHistogram()
|
||||
{
|
||||
var pageData = null;
|
||||
$.ajax({
|
||||
type:"post",
|
||||
url: "<%=path%>/report/find.action",
|
||||
dataType: "json",
|
||||
//取消异步机制,保证页面数据返回再进行处理
|
||||
async: false,
|
||||
data: ({
|
||||
reportType : 3,
|
||||
}),
|
||||
success: function (reportInfo)
|
||||
{
|
||||
pageData = reportInfo.showModel.reportData;
|
||||
var msgTip = reportInfo.showModel.msgTip;
|
||||
if(msgTip == "get report data exception")
|
||||
{
|
||||
alert("查找报表信息异常,请与管理员联系!");
|
||||
return;
|
||||
}
|
||||
}
|
||||
});
|
||||
//解决初始化范围变小问题
|
||||
$("#culumnContainer").empty();
|
||||
var getReportTypeInfo = "按资产名称统计";
|
||||
var dataInfo = new Array();
|
||||
var nameData = new Array();
|
||||
var consumeSumInfo= null;
|
||||
|
||||
var showNumInfo = 0;
|
||||
if(pageData.length >= showNum)
|
||||
showNumInfo = 10;
|
||||
else
|
||||
showNumInfo = pageData.length;
|
||||
for(var i = 0 ;i < showNumInfo;i ++)
|
||||
{
|
||||
var totalInfo = pageData[i];
|
||||
dataInfo.push(totalInfo[0]);
|
||||
nameData.push(totalInfo[1]);
|
||||
}
|
||||
consumeSumInfo= {
|
||||
name: getReportTypeInfo + "柱状图",
|
||||
data: dataInfo
|
||||
}
|
||||
|
||||
new Highcharts.Chart({
|
||||
chart: {
|
||||
renderTo: 'culumnContainer',
|
||||
type: 'column',
|
||||
backgroundColor:'#EAF2FD'
|
||||
},
|
||||
title: {
|
||||
text: getReportTypeInfo + "柱状图"
|
||||
},
|
||||
xAxis: {
|
||||
categories: nameData,
|
||||
labels: {
|
||||
rotation: -45, //逆时针旋转45°,标签名称太长。
|
||||
align: 'right', //设置右对齐
|
||||
formatter: function() {
|
||||
if(this.value.length >10)
|
||||
return this.value.substr(0,10) + "...";
|
||||
return this.value ;
|
||||
}
|
||||
}
|
||||
},
|
||||
yAxis: {
|
||||
title: {
|
||||
text: ''
|
||||
},
|
||||
labels: {
|
||||
formatter: function() {
|
||||
return this.value;
|
||||
}
|
||||
}
|
||||
},
|
||||
plotOptions: {
|
||||
column: {
|
||||
cursor: 'pointer',
|
||||
dataLabels: {
|
||||
enabled: true,
|
||||
style: {
|
||||
fontWeight: 'bold'
|
||||
},
|
||||
formatter: function() {
|
||||
return this.y;
|
||||
}
|
||||
},
|
||||
showInLegend: false
|
||||
}
|
||||
},
|
||||
tooltip: {
|
||||
formatter: function() {
|
||||
return this.x + ":" +this.y +'个';
|
||||
}
|
||||
},
|
||||
credits: {
|
||||
enabled: false
|
||||
},
|
||||
series: [consumeSumInfo]
|
||||
});
|
||||
}
|
||||
|
||||
//返回统计类型字符串
|
||||
function getReportType()
|
||||
{
|
||||
var reportType = $("#searchReportType").val();
|
||||
if(reportType==0)
|
||||
{
|
||||
return '按资产状态统计';
|
||||
}
|
||||
else if(reportType==1)
|
||||
{
|
||||
return '按资产类型统计';
|
||||
}
|
||||
else if(reportType==2)
|
||||
{
|
||||
return '按供应商统计';
|
||||
}
|
||||
else if(reportType==3)
|
||||
{
|
||||
return '按资产名称统计';
|
||||
}
|
||||
else if(reportType==4)
|
||||
{
|
||||
return '按所属用户统计';
|
||||
}
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
120
src/main/webapp/pages/common/main.jsp
Normal file
120
src/main/webapp/pages/common/main.jsp
Normal file
@@ -0,0 +1,120 @@
|
||||
<%@page import="com.jsh.util.Tools"%>
|
||||
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
|
||||
<%
|
||||
String path = request.getContextPath();
|
||||
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
|
||||
String clientIp = Tools.getCurrentUserIP();
|
||||
%>
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>ERP系统</title>
|
||||
<link href="<%=path%>/js/HoorayOS_mini/js/HoorayLibs/hooraylibs.css" rel="stylesheet" />
|
||||
<link href="<%=path%>/js/HoorayOS_mini/img/ui/index.css" rel="stylesheet" />
|
||||
</head>
|
||||
<body>
|
||||
<div class="loading"></div>
|
||||
<!-- 浏览器升级提示 -->
|
||||
<div class="update_browser_box">
|
||||
<div class="update_browser">
|
||||
<div class="subtitle">您正在使用的IE浏览器版本过低,<br>我们建议您升级或者更换浏览器,以便体验顺畅、兼容、安全的互联网。</div>
|
||||
<div class="title">选择一款<span>新</span>浏览器吧</div>
|
||||
<div class="browser">
|
||||
<a href="http://windows.microsoft.com/zh-CN/internet-explorer/downloads/ie" class="ie" target="_blank" title="ie浏览器">ie浏览器</a>
|
||||
<a href="http://www.google.cn/chrome/" class="chrome" target="_blank" title="谷歌浏览器">谷歌浏览器</a>
|
||||
<a href="http://www.firefox.com.cn" class="firefox" target="_blank" title="火狐浏览器">火狐浏览器</a>
|
||||
<a href="http://www.opera.com" class="opera" target="_blank" title="opera浏览器">opera浏览器</a>
|
||||
<a href="http://www.apple.com.cn/safari" class="safari" target="_blank" title="safari浏览器">safari浏览器</a>
|
||||
</div>
|
||||
<div class="bottomtitle">[ <a href="http://www.baidu.com/search/theie6countdown.html" target="_blank">对IE6说再见</a> ]</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- 桌面 -->
|
||||
<div id="desktop">
|
||||
<div id="zoom-tip"><div><i></i><span></span></div><a href="javascript:;" class="close" onclick="HROS.zoom.close();">×</a></div>
|
||||
<div id="desk">
|
||||
<div id="desk-1" class="desktop-container"><div class="scrollbar scrollbar-x"></div><div class="scrollbar scrollbar-y"></div></div>
|
||||
<div id="dock-bar">
|
||||
<div id="dock-container">
|
||||
<div class="dock-middle">
|
||||
<div class="dock-applist"></div>
|
||||
<div class="dock-toollist">
|
||||
<a id="loginOut" href="#">
|
||||
<img src="<%=path%>/js/HoorayOS_mini/img/exit.png" style="height:50px;width:50px;">
|
||||
</a>
|
||||
<span style="text-align:center;color:white; position:absolute;top:435px; left:15px;">
|
||||
${sessionScope.user.username}
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div id="task-bar-bg1"></div>
|
||||
<div id="task-bar-bg2"></div>
|
||||
<div id="task-bar">
|
||||
<div id="task-next"><a href="javascript:;" id="task-next-btn" hidefocus="true"></a></div>
|
||||
<div id="task-content">
|
||||
<div id="task-content-inner"></div>
|
||||
</div>
|
||||
<div id="task-pre"><a href="javascript:;" id="task-pre-btn" hidefocus="true"></a></div>
|
||||
</div>
|
||||
</div>
|
||||
<script src="<%=path%>/js/HoorayOS_mini/js/jquery-1.8.3.min.js"></script>
|
||||
<script src="<%=path%>/js/HoorayOS_mini/js/HoorayLibs/hooraylibs.js"></script>
|
||||
<script src="<%=path%>/js/HoorayOS_mini/js/templates.js"></script>
|
||||
<script src="<%=path%>/js/HoorayOS_mini/js/core.js"></script>
|
||||
<script src="<%=path%>/js/HoorayOS_mini/js/hros.app.js"></script>
|
||||
<script src="<%=path%>/js/HoorayOS_mini/js/hros.base.js"></script>
|
||||
<script src="<%=path%>/js/HoorayOS_mini/js/hros.desktop.js"></script>
|
||||
<script src="<%=path%>/js/HoorayOS_mini/js/hros.dock.js"></script>
|
||||
<script src="<%=path%>/js/HoorayOS_mini/js/hros.grid.js"></script>
|
||||
<script src="<%=path%>/js/HoorayOS_mini/js/hros.maskBox.js"></script>
|
||||
<script src="<%=path%>/js/HoorayOS_mini/js/hros.taskbar.js"></script>
|
||||
<script src="<%=path%>/js/HoorayOS_mini/js/hros.popupMenu.js"></script>
|
||||
<script src="<%=path%>/js/HoorayOS_mini/js/hros.wallpaper.js"></script>
|
||||
<script src="<%=path%>/js/HoorayOS_mini/js/hros.widget.js"></script>
|
||||
<script src="<%=path%>/js/HoorayOS_mini/js/hros.window.js"></script>
|
||||
<script src="<%=path%>/js/HoorayOS_mini/js/hros.zoom.js"></script>
|
||||
|
||||
<script type="text/javascript" src="<%=path%>/js/easyui-1.3.5/jquery.easyui.min.js"></script>
|
||||
<link href="<%=path%>/js/easyui-1.3.5/themes/default/easyui.css" rel="stylesheet" type="text/css" />
|
||||
|
||||
<script>
|
||||
$(function () {
|
||||
$('#loginOut').click(function () {
|
||||
if (confirm("确认要退出系统吗?"))
|
||||
location.href = '<%=path%>/user/logout.action?clientIp=<%=clientIp%>';
|
||||
})
|
||||
//IE下禁止选中
|
||||
document.body.onselectstart = document.body.ondrag = function () { return false; }
|
||||
//隐藏加载遮罩层
|
||||
$('.loading').hide();
|
||||
//IE6升级提示
|
||||
if ($.browser.msie && $.browser.version < 7) {
|
||||
if ($.browser.version < 7) {
|
||||
//虽然不支持IE6,但还是得修复PNG图片透明的问题
|
||||
DD_belatedPNG.fix('.update_browser .browser');
|
||||
}
|
||||
$('.update_browser_box').show();
|
||||
} else {
|
||||
$('#desktop').show();
|
||||
//初始化一些桌面信息
|
||||
HROS.CONFIG.wallpaper = '<%=path%>/js/HoorayOS_mini/img/wallpaper/wallpaper.jpg';
|
||||
//加载桌面
|
||||
HROS.base.init();
|
||||
}
|
||||
//判断是否存在session,如果不存在就跳到登录界面
|
||||
function UserOut() {
|
||||
var kid = ${sessionScope.user.id};
|
||||
if (!kid){
|
||||
top.location.href = '../../';
|
||||
}
|
||||
}
|
||||
setInterval(UserOut, 5000); //每5秒检测一次
|
||||
});
|
||||
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
246
src/main/webapp/pages/common/menu.jsp
Normal file
246
src/main/webapp/pages/common/menu.jsp
Normal file
@@ -0,0 +1,246 @@
|
||||
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
|
||||
<%
|
||||
String path = request.getContextPath();
|
||||
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
|
||||
%>
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title></title>
|
||||
<meta charset="utf-8">
|
||||
<!-- 指定以IE8的方式来渲染 -->
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE8"/>
|
||||
<link rel="shortcut icon" href="<%=path%>/images/favicon.ico" type="image/x-icon" />
|
||||
<link rel="stylesheet" type="text/css" href="<%=path %>/js/easyui-1.3.5/themes/default/easyui.css"/>
|
||||
<link rel="stylesheet" type="text/css" href="<%=path %>/js/easyui-1.3.5/themes/icon.css"/>
|
||||
<link type="text/css" rel="stylesheet" href="<%=path %>/css/common.css" />
|
||||
<script type="text/javascript" src="<%=path %>/js/jquery-1.8.0.min.js"></script>
|
||||
<script type="text/javascript" src="<%=path %>/js/easyui-1.3.5/jquery.easyui.min.js"></script>
|
||||
<script type="text/javascript" src="<%=path %>/js/easyui-1.3.5/locale/easyui-lang-zh_CN.js"></script>
|
||||
<script type="text/javascript" src="<%=path %>/js/easyui-1.3.5/outlook.js"></script>
|
||||
<script type="text/javascript" src="<%=path %>/js/common/common.js"></script>
|
||||
<script type="text/javascript">
|
||||
function NewTab(name, url) {
|
||||
addTab(name, url, '');
|
||||
}
|
||||
</script>
|
||||
</head>
|
||||
<body class="easyui-layout" style="overflow-y: hidden" scroll="no">
|
||||
<script>
|
||||
var pageid = getUrlParam('id'); //获取传值id
|
||||
var id=${sessionScope.user.id};
|
||||
//alert(pageid);
|
||||
|
||||
var userBusinessList = null;
|
||||
var userBusinessID = null;
|
||||
var type=null;
|
||||
var options = "";
|
||||
var kid=null;
|
||||
var lei=null;
|
||||
var last="";
|
||||
var functions="";
|
||||
|
||||
//初始化界面
|
||||
$(function()
|
||||
{
|
||||
//初始化系统基础信息
|
||||
initSystemData(id,'UserRole');
|
||||
initSelectInfo(0);
|
||||
|
||||
initSelect();
|
||||
|
||||
//ceshi();
|
||||
});
|
||||
|
||||
//初始化系统基础信息
|
||||
function initSystemData(kid,type)
|
||||
{
|
||||
$.ajax({
|
||||
type:"post",
|
||||
url: "<%=path%>/userBusiness/getBasicData.action",
|
||||
data: ({
|
||||
KeyId:kid,
|
||||
Type:type
|
||||
}),
|
||||
//设置为同步
|
||||
async:false,
|
||||
dataType: "json",
|
||||
success: function (systemInfo)
|
||||
{
|
||||
if(systemInfo)
|
||||
{
|
||||
userBusinessList = systemInfo.showModel.map.userBusinessList;
|
||||
var msgTip = systemInfo.showModel.msgTip;
|
||||
if(msgTip == "exceptoin")
|
||||
{
|
||||
$.messager.alert('提示','查找UserBusiness异常,请与管理员联系!','error');
|
||||
return;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
userBusinessList=null;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
//初始化页面选项卡
|
||||
function initSelectInfo(lei)
|
||||
{
|
||||
|
||||
if(userBusinessList !=null)
|
||||
{
|
||||
if(userBusinessList.length>0)
|
||||
{
|
||||
options =userBusinessList[0].value;
|
||||
if(options!="")
|
||||
{
|
||||
options=options.substring(1,options.length-1);
|
||||
}
|
||||
if(lei==1)
|
||||
{
|
||||
last+=options+'][';
|
||||
}
|
||||
else if(lei==2)
|
||||
{
|
||||
functions+=options+'][';
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//初始化页面
|
||||
function initSelect()
|
||||
{
|
||||
var arr = options.split('][');
|
||||
for(var i in arr){
|
||||
|
||||
initSystemData(arr[i],'RoleAPP'); //根据角色找app
|
||||
initSelectInfo(1);
|
||||
|
||||
initSystemData(arr[i],'RoleFunctions'); //根据角色找functions
|
||||
initSelectInfo(2);
|
||||
}
|
||||
if(last!="")
|
||||
{
|
||||
last="["+last.substring(0,last.length-1);
|
||||
//alert(last);
|
||||
|
||||
if(last.indexOf("["+pageid+"]")!=-1)
|
||||
{
|
||||
//alert("存在");
|
||||
$("#west").show();
|
||||
$("#mainPanle").show();
|
||||
$("#mm").show();
|
||||
}
|
||||
else
|
||||
{
|
||||
//alert("不存在");
|
||||
$("div").remove();
|
||||
$("<div style='width:100%;text-align:center;padding-top:20px'><b>抱歉,您没有该权限!</b></div>").appendTo("body");
|
||||
}
|
||||
|
||||
}
|
||||
if(functions!="")
|
||||
{
|
||||
functions="["+functions.substring(0,functions.length-1);
|
||||
//alert(functions);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
//测试自定义hql
|
||||
function ceshi()
|
||||
{
|
||||
$.ajax({
|
||||
type:"post",
|
||||
url: "<%=path%>/userBusiness/getceshi.action",
|
||||
data: ({
|
||||
Type:"UserRole"
|
||||
}),
|
||||
//设置为同步
|
||||
async:false,
|
||||
dataType: "json",
|
||||
success: function (systemInfo)
|
||||
{
|
||||
if(systemInfo)
|
||||
{
|
||||
userBusinessList = systemInfo.showModel.map.userBusinessList;
|
||||
var msgTip = systemInfo.showModel.msgTip;
|
||||
if(msgTip == "exceptoin")
|
||||
{
|
||||
$.messager.alert('提示','查找UserBusiness异常,请与管理员联系!','error');
|
||||
return;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
userBusinessList=null;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
if(userBusinessList !=null)
|
||||
{
|
||||
if(userBusinessList.length>0)
|
||||
{
|
||||
alert(userBusinessList[0][0]);
|
||||
alert(userBusinessList[0][1]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
<div region="west" hide="true" split="true" title="导航菜单" style="width:155px;" id="west">
|
||||
<div id="nav" fit="true" border="false">
|
||||
<!-- 导航内容 -->
|
||||
<div>
|
||||
<ul id="tt"></ul>
|
||||
<script type="text/javascript">
|
||||
var PNumber = getUrlParam('appID'); //获取传值appid
|
||||
$(function () {
|
||||
$('#tt').tree({
|
||||
url:'<%=path%>/functions/findMenu.action?PNumber='+PNumber+'&hasFunctions='+functions,
|
||||
animate:true,
|
||||
});
|
||||
});
|
||||
</script>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div id="mainPanle" region="center" style="background: #eee; overflow-y: hidden">
|
||||
<div id="tabs" class="easyui-tabs" fit="true" border="false"></div>
|
||||
</div>
|
||||
<div id="mm" class="easyui-menu" style="width: 150px;">
|
||||
<div id="mm-tabupdate">
|
||||
刷新
|
||||
</div>
|
||||
<div class="menu-sep">
|
||||
</div>
|
||||
<div id="mm-tabclose">
|
||||
关闭
|
||||
</div>
|
||||
<div id="mm-tabcloseall">
|
||||
全部关闭
|
||||
</div>
|
||||
<div id="mm-tabcloseother">
|
||||
除此之外全部关闭
|
||||
</div>
|
||||
<div class="menu-sep">
|
||||
</div>
|
||||
<div id="mm-tabcloseright">
|
||||
当前页右侧全部关闭
|
||||
</div>
|
||||
<div id="mm-tabcloseleft">
|
||||
当前页左侧全部关闭
|
||||
</div>
|
||||
<div class="menu-sep">
|
||||
</div>
|
||||
<div id="mm-exit">
|
||||
退出
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
34
src/main/webapp/pages/common/templateforjsp.jsp
Normal file
34
src/main/webapp/pages/common/templateforjsp.jsp
Normal file
@@ -0,0 +1,34 @@
|
||||
<%@page import="com.jsh.util.Tools"%>
|
||||
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
|
||||
<%
|
||||
String path = request.getContextPath();
|
||||
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
|
||||
String clientIp = Tools.getCurrentUserIP();
|
||||
%>
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head>
|
||||
<title>资产管理</title>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
<!-- 指定以IE8的方式来渲染 -->
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE8"/>
|
||||
<link rel="shortcut icon" href="<%=path%>/images/favicon.ico" type="image/x-icon" />
|
||||
<link type="text/css" rel="stylesheet" href="<%=path %>/css/css.css" />
|
||||
<script type="text/javascript" src="<%=path %>/js/jquery-1.8.0.min.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<script type="text/javascript">
|
||||
//初始化界面
|
||||
$(function()
|
||||
{
|
||||
init();
|
||||
});
|
||||
|
||||
function init()
|
||||
{
|
||||
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
157
src/main/webapp/pages/financial/giro.jsp
Normal file
157
src/main/webapp/pages/financial/giro.jsp
Normal file
@@ -0,0 +1,157 @@
|
||||
<%@page import="com.jsh.util.Tools"%>
|
||||
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
|
||||
<%
|
||||
String path = request.getContextPath();
|
||||
String clientIp = Tools.getCurrentUserIP();
|
||||
%>
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>转账单</title>
|
||||
<meta charset="utf-8">
|
||||
<!-- 指定以IE8的方式来渲染 -->
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE8"/>
|
||||
<link rel="shortcut icon" href="<%=path%>/images/favicon.ico" type="image/x-icon" />
|
||||
<link rel="stylesheet" type="text/css" href="<%=path %>/js/easyui-1.3.5/themes/default/easyui.css"/>
|
||||
<link rel="stylesheet" type="text/css" href="<%=path %>/js/easyui-1.3.5/themes/icon.css"/>
|
||||
<link type="text/css" rel="stylesheet" href="<%=path %>/css/common.css" />
|
||||
<script src="<%=path %>/js/jquery-1.8.0.min.js"></script>
|
||||
<script src="<%=path %>/js/easyui-1.3.5/jquery.easyui.min.js"></script>
|
||||
<script src="<%=path %>/js/easyui-1.3.5/locale/easyui-lang-zh_CN.js"></script>
|
||||
<script src="<%=path %>/js/My97DatePicker/WdatePicker.js"></script>
|
||||
<script src="<%=path %>/js/common/common.js"></script>
|
||||
<script src="<%=path %>/js/pages/financial/financial_base.js"></script>
|
||||
<script>
|
||||
var kid = ${sessionScope.user.id};
|
||||
var path = "<%=path%>";
|
||||
var clientIp = "<%=clientIp%>";
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<!-- 查询 -->
|
||||
<div id = "searchPanel" class="easyui-panel" style="padding:3px;" title="查询窗口" iconCls="icon-search" collapsible="true" closable="false">
|
||||
<table id="searchTable">
|
||||
<tr>
|
||||
<td>单据编号:</td>
|
||||
<td>
|
||||
<input type="text" name="searchBillNo" id="searchBillNo" style="width:60px;"/>
|
||||
</td>
|
||||
<td>单据日期:</td>
|
||||
<td>
|
||||
<input type="text" name="searchBeginTime" id="searchBeginTime" onClick="WdatePicker({dateFmt:'yyyy-MM-dd'})" class="txt Wdate" style="width:80px;"/>
|
||||
</td>
|
||||
<td>-</td>
|
||||
<td>
|
||||
<input type="text" name="searchEndTime" id="searchEndTime" onClick="WdatePicker({dateFmt:'yyyy-MM-dd'})" class="txt Wdate" style="width:80px;"/>
|
||||
</td>
|
||||
<td> </td>
|
||||
<td>
|
||||
<a href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-search" id="searchBtn">查询</a>
|
||||
<a href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-redo" id="searchResetBtn">重置</a>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<!-- 数据显示table -->
|
||||
<div id = "tablePanel" class="easyui-panel" style="padding:1px;top:300px;" title="转账单列表" iconCls="icon-list" collapsible="true" closable="false">
|
||||
<table id="tableData" style="top:300px;border-bottom-color:#FFFFFF"></table>
|
||||
</div>
|
||||
|
||||
<div id="accountHeadDlg" class="easyui-dialog" style="width:850px;padding:10px 20px;top:20px"
|
||||
closed="true" buttons="#dlg-buttons" modal="true" cache="false" collapsible="false" closable="true">
|
||||
<form id="accountHeadFM" method="post" novalidate>
|
||||
<table>
|
||||
<tr>
|
||||
<td>单据编号:</td>
|
||||
<td style="padding:5px">
|
||||
<input name="BillNo" id="BillNo" class="easyui-validatebox" data-options="required:true,validType:'length[2,30]'" style="width: 110px;"/>
|
||||
</td>
|
||||
<td>单据日期:</td>
|
||||
<td style="padding:5px">
|
||||
<input type="text" name="BillTime" id="BillTime" onClick="WdatePicker({dateFmt:'yyyy-MM-dd'})" class="txt Wdate" style="width:110px;"/>
|
||||
</td>
|
||||
<td>经手人:</td>
|
||||
<td style="padding:5px">
|
||||
<select name="HandsPersonId" id="HandsPersonId" style="width:110px;"></select>
|
||||
</td>
|
||||
<td style="width:50px;"></td>
|
||||
<td style="padding:5px;width:110px;"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>付款账户:</td>
|
||||
<td style="padding:5px">
|
||||
<select id="AccountId" name="AccountId" style="width:110px;"></select>
|
||||
</td>
|
||||
<td>实付金额:</td>
|
||||
<td style="padding:5px">
|
||||
<input type="text" name="ChangeAmount" id="ChangeAmount" class="easyui-numberbox" data-options="min:0,precision:2" style="width: 110px;"></input>
|
||||
</td>
|
||||
<td>单据备注:</td>
|
||||
<td style="padding:5px">
|
||||
<input name="Remark" id="Remark" class="easyui-validatebox" style="width: 110px;"/>
|
||||
</td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>单据明细:</td>
|
||||
<td colspan="7">
|
||||
<!-- 单据列表table -->
|
||||
<table id="accountData" style="top:100px;border-bottom-color:#FFFFFF"></table>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<input type="hidden" name="clientIp" id="clientIp" value="<%=clientIp %>"/>
|
||||
</form>
|
||||
</div>
|
||||
<div id="dlg-buttons">
|
||||
<a href="javascript:void(0)" id="saveAccountHead" class="easyui-linkbutton" iconCls="icon-ok">保存</a>
|
||||
<a href="javascript:void(0)" id="cancelAccountHead" class="easyui-linkbutton" iconCls="icon-cancel" onclick="javascript:$('#accountHeadDlg').dialog('close')">取消</a>
|
||||
</div>
|
||||
<div id="accountHeadDlgShow" class="easyui-dialog" style="width:850px;padding:10px 20px;top:20px"
|
||||
closed="true" modal="true" cache="false" collapsible="false" closable="true">
|
||||
<table>
|
||||
<tr>
|
||||
<td>单据编号:</td>
|
||||
<td style="padding:5px;width:110px;">
|
||||
<span id="BillNoShow"></span>
|
||||
</td>
|
||||
<td>单据日期:</td>
|
||||
<td style="padding:5px;width:110px;">
|
||||
<span id="BillTimeShow"></span>
|
||||
</td>
|
||||
<td>经手人:</td>
|
||||
<td style="padding:5px;width:110px;">
|
||||
<span id="HandsPersonIdShow"></span>
|
||||
</td>
|
||||
<td style="width:50px;"></td>
|
||||
<td style="padding:5px;width:110px;">
|
||||
</tr>
|
||||
<tr>
|
||||
<td>付款账户:</td>
|
||||
<td style="padding:5px">
|
||||
<span id="AccountIdShow"></span>
|
||||
</td>
|
||||
<td>实付金额:</td>
|
||||
<td style="padding:5px">
|
||||
<span id="ChangeAmountShow"></span>
|
||||
</td>
|
||||
<td>单据备注:</td>
|
||||
<td style="padding:5px">
|
||||
<span id="RemarkShow"></span>
|
||||
</td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>单据明细:</td>
|
||||
<td colspan="7">
|
||||
<!-- 单据列表table -->
|
||||
<table id="accountDataShow" style="top:100px;border-bottom-color:#FFFFFF"></table>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
161
src/main/webapp/pages/financial/item_in.jsp
Normal file
161
src/main/webapp/pages/financial/item_in.jsp
Normal file
@@ -0,0 +1,161 @@
|
||||
<%@page import="com.jsh.util.Tools"%>
|
||||
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
|
||||
<%
|
||||
String path = request.getContextPath();
|
||||
String clientIp = Tools.getCurrentUserIP();
|
||||
%>
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>收入单</title>
|
||||
<meta charset="utf-8">
|
||||
<!-- 指定以IE8的方式来渲染 -->
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE8"/>
|
||||
<link rel="shortcut icon" href="<%=path%>/images/favicon.ico" type="image/x-icon" />
|
||||
<link rel="stylesheet" type="text/css" href="<%=path %>/js/easyui-1.3.5/themes/default/easyui.css"/>
|
||||
<link rel="stylesheet" type="text/css" href="<%=path %>/js/easyui-1.3.5/themes/icon.css"/>
|
||||
<link type="text/css" rel="stylesheet" href="<%=path %>/css/common.css" />
|
||||
<script src="<%=path %>/js/jquery-1.8.0.min.js"></script>
|
||||
<script src="<%=path %>/js/easyui-1.3.5/jquery.easyui.min.js"></script>
|
||||
<script src="<%=path %>/js/easyui-1.3.5/locale/easyui-lang-zh_CN.js"></script>
|
||||
<script src="<%=path %>/js/My97DatePicker/WdatePicker.js"></script>
|
||||
<script src="<%=path %>/js/common/common.js"></script>
|
||||
<script src="<%=path %>/js/pages/financial/financial_base.js"></script>
|
||||
<script>
|
||||
var kid = ${sessionScope.user.id};
|
||||
var path = "<%=path%>";
|
||||
var clientIp = "<%=clientIp%>";
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<!-- 查询 -->
|
||||
<div id = "searchPanel" class="easyui-panel" style="padding:3px;" title="查询窗口" iconCls="icon-search" collapsible="true" closable="false">
|
||||
<table id="searchTable">
|
||||
<tr>
|
||||
<td>单据编号:</td>
|
||||
<td>
|
||||
<input type="text" name="searchBillNo" id="searchBillNo" style="width:60px;"/>
|
||||
</td>
|
||||
<td>单据日期:</td>
|
||||
<td>
|
||||
<input type="text" name="searchBeginTime" id="searchBeginTime" onClick="WdatePicker({dateFmt:'yyyy-MM-dd'})" class="txt Wdate" style="width:80px;"/>
|
||||
</td>
|
||||
<td>-</td>
|
||||
<td>
|
||||
<input type="text" name="searchEndTime" id="searchEndTime" onClick="WdatePicker({dateFmt:'yyyy-MM-dd'})" class="txt Wdate" style="width:80px;"/>
|
||||
</td>
|
||||
<td> </td>
|
||||
<td>
|
||||
<a href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-search" id="searchBtn">查询</a>
|
||||
<a href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-redo" id="searchResetBtn">重置</a>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<!-- 数据显示table -->
|
||||
<div id = "tablePanel" class="easyui-panel" style="padding:1px;top:300px;" title="收入单列表" iconCls="icon-list" collapsible="true" closable="false">
|
||||
<table id="tableData" style="top:300px;border-bottom-color:#FFFFFF"></table>
|
||||
</div>
|
||||
|
||||
<div id="accountHeadDlg" class="easyui-dialog" style="width:850px;padding:10px 20px;top:20px"
|
||||
closed="true" buttons="#dlg-buttons" modal="true" cache="false" collapsible="false" closable="true">
|
||||
<form id="accountHeadFM" method="post" novalidate>
|
||||
<table>
|
||||
<tr>
|
||||
<td>单据编号:</td>
|
||||
<td style="padding:5px">
|
||||
<input name="BillNo" id="BillNo" class="easyui-validatebox" data-options="required:true,validType:'length[2,30]'" style="width: 110px;"/>
|
||||
</td>
|
||||
<td>单据日期:</td>
|
||||
<td style="padding:5px">
|
||||
<input type="text" name="BillTime" id="BillTime" onClick="WdatePicker({dateFmt:'yyyy-MM-dd'})" class="txt Wdate" style="width:110px;"/>
|
||||
</td>
|
||||
<td>收款账户:</td>
|
||||
<td style="padding:5px">
|
||||
<select id="AccountId" name="AccountId" style="width:110px;"></select>
|
||||
</td>
|
||||
<td>收款金额:</td>
|
||||
<td>
|
||||
<input type="text" name="ChangeAmount" id="ChangeAmount" class="easyui-numberbox" data-options="min:0,precision:2" style="width: 60px;"></input>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>往来单位:</td>
|
||||
<td style="padding:5px">
|
||||
<select name="OrganId" id="OrganId" style="width:110px;"></select>
|
||||
</td>
|
||||
<td>经手人:</td>
|
||||
<td style="padding:5px">
|
||||
<select name="HandsPersonId" id="HandsPersonId" style="width:110px;"></select>
|
||||
</td>
|
||||
<td>单据备注:</td>
|
||||
<td style="padding:5px">
|
||||
<input name="Remark" id="Remark" class="easyui-validatebox" style="width: 110px;"/>
|
||||
</td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>单据明细:</td>
|
||||
<td colspan="7">
|
||||
<!-- 单据列表table -->
|
||||
<table id="accountData" style="top:100px;border-bottom-color:#FFFFFF"></table>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<input type="hidden" name="clientIp" id="clientIp" value="<%=clientIp %>"/>
|
||||
</form>
|
||||
</div>
|
||||
<div id="dlg-buttons">
|
||||
<a href="javascript:void(0)" id="saveAccountHead" class="easyui-linkbutton" iconCls="icon-ok">保存</a>
|
||||
<a href="javascript:void(0)" id="cancelAccountHead" class="easyui-linkbutton" iconCls="icon-cancel" onclick="javascript:$('#accountHeadDlg').dialog('close')">取消</a>
|
||||
</div>
|
||||
<div id="accountHeadDlgShow" class="easyui-dialog" style="width:850px;padding:10px 20px;top:20px"
|
||||
closed="true" modal="true" cache="false" collapsible="false" closable="true">
|
||||
<table>
|
||||
<tr>
|
||||
<td>单据编号:</td>
|
||||
<td style="padding:5px;width:110px;">
|
||||
<span id="BillNoShow"></span>
|
||||
</td>
|
||||
<td>单据日期:</td>
|
||||
<td style="padding:5px;width:110px;">
|
||||
<span id="BillTimeShow"></span>
|
||||
</td>
|
||||
<td>收款账户:</td>
|
||||
<td style="padding:5px;width:110px;">
|
||||
<span id="AccountIdShow"></span>
|
||||
</td>
|
||||
<td>收款金额:</td>
|
||||
<td style="padding:5px;width:110px;">
|
||||
<span id="ChangeAmountShow"></span>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>往来单位:</td>
|
||||
<td style="padding:5px">
|
||||
<span id="OrganIdShow"></span>
|
||||
</td>
|
||||
<td>经手人:</td>
|
||||
<td style="padding:5px">
|
||||
<span id="HandsPersonIdShow"></span>
|
||||
</td>
|
||||
<td>单据备注:</td>
|
||||
<td style="padding:5px">
|
||||
<span id="RemarkShow"></span>
|
||||
</td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>单据明细:</td>
|
||||
<td colspan="7">
|
||||
<!-- 单据列表table -->
|
||||
<table id="accountDataShow" style="top:100px;border-bottom-color:#FFFFFF"></table>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
161
src/main/webapp/pages/financial/item_out.jsp
Normal file
161
src/main/webapp/pages/financial/item_out.jsp
Normal file
@@ -0,0 +1,161 @@
|
||||
<%@page import="com.jsh.util.Tools"%>
|
||||
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
|
||||
<%
|
||||
String path = request.getContextPath();
|
||||
String clientIp = Tools.getCurrentUserIP();
|
||||
%>
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>支出单</title>
|
||||
<meta charset="utf-8">
|
||||
<!-- 指定以IE8的方式来渲染 -->
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE8"/>
|
||||
<link rel="shortcut icon" href="<%=path%>/images/favicon.ico" type="image/x-icon" />
|
||||
<link rel="stylesheet" type="text/css" href="<%=path %>/js/easyui-1.3.5/themes/default/easyui.css"/>
|
||||
<link rel="stylesheet" type="text/css" href="<%=path %>/js/easyui-1.3.5/themes/icon.css"/>
|
||||
<link type="text/css" rel="stylesheet" href="<%=path %>/css/common.css" />
|
||||
<script src="<%=path %>/js/jquery-1.8.0.min.js"></script>
|
||||
<script src="<%=path %>/js/easyui-1.3.5/jquery.easyui.min.js"></script>
|
||||
<script src="<%=path %>/js/easyui-1.3.5/locale/easyui-lang-zh_CN.js"></script>
|
||||
<script src="<%=path %>/js/My97DatePicker/WdatePicker.js"></script>
|
||||
<script src="<%=path %>/js/common/common.js"></script>
|
||||
<script src="<%=path %>/js/pages/financial/financial_base.js"></script>
|
||||
<script>
|
||||
var kid = ${sessionScope.user.id};
|
||||
var path = "<%=path%>";
|
||||
var clientIp = "<%=clientIp%>";
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<!-- 查询 -->
|
||||
<div id = "searchPanel" class="easyui-panel" style="padding:3px;" title="查询窗口" iconCls="icon-search" collapsible="true" closable="false">
|
||||
<table id="searchTable">
|
||||
<tr>
|
||||
<td>单据编号:</td>
|
||||
<td>
|
||||
<input type="text" name="searchBillNo" id="searchBillNo" style="width:60px;"/>
|
||||
</td>
|
||||
<td>单据日期:</td>
|
||||
<td>
|
||||
<input type="text" name="searchBeginTime" id="searchBeginTime" onClick="WdatePicker({dateFmt:'yyyy-MM-dd'})" class="txt Wdate" style="width:80px;"/>
|
||||
</td>
|
||||
<td>-</td>
|
||||
<td>
|
||||
<input type="text" name="searchEndTime" id="searchEndTime" onClick="WdatePicker({dateFmt:'yyyy-MM-dd'})" class="txt Wdate" style="width:80px;"/>
|
||||
</td>
|
||||
<td> </td>
|
||||
<td>
|
||||
<a href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-search" id="searchBtn">查询</a>
|
||||
<a href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-redo" id="searchResetBtn">重置</a>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<!-- 数据显示table -->
|
||||
<div id = "tablePanel" class="easyui-panel" style="padding:1px;top:300px;" title="支出单列表" iconCls="icon-list" collapsible="true" closable="false">
|
||||
<table id="tableData" style="top:300px;border-bottom-color:#FFFFFF"></table>
|
||||
</div>
|
||||
|
||||
<div id="accountHeadDlg" class="easyui-dialog" style="width:850px;padding:10px 20px;top:20px"
|
||||
closed="true" buttons="#dlg-buttons" modal="true" cache="false" collapsible="false" closable="true">
|
||||
<form id="accountHeadFM" method="post" novalidate>
|
||||
<table>
|
||||
<tr>
|
||||
<td>单据编号:</td>
|
||||
<td style="padding:5px">
|
||||
<input name="BillNo" id="BillNo" class="easyui-validatebox" data-options="required:true,validType:'length[2,30]'" style="width: 110px;"/>
|
||||
</td>
|
||||
<td>单据日期:</td>
|
||||
<td style="padding:5px">
|
||||
<input type="text" name="BillTime" id="BillTime" onClick="WdatePicker({dateFmt:'yyyy-MM-dd'})" class="txt Wdate" style="width:110px;"/>
|
||||
</td>
|
||||
<td>付款账户:</td>
|
||||
<td style="padding:5px">
|
||||
<select id="AccountId" name="AccountId" style="width:110px;"></select>
|
||||
</td>
|
||||
<td>付款金额:</td>
|
||||
<td>
|
||||
<input type="text" name="ChangeAmount" id="ChangeAmount" class="easyui-numberbox" data-options="min:0,precision:2" style="width: 60px;"></input>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>往来单位:</td>
|
||||
<td style="padding:5px">
|
||||
<select name="OrganId" id="OrganId" style="width:110px;"></select>
|
||||
</td>
|
||||
<td>经手人:</td>
|
||||
<td style="padding:5px">
|
||||
<select name="HandsPersonId" id="HandsPersonId" style="width:110px;"></select>
|
||||
</td>
|
||||
<td>单据备注:</td>
|
||||
<td style="padding:5px">
|
||||
<input name="Remark" id="Remark" class="easyui-validatebox" style="width: 110px;"/>
|
||||
</td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>单据明细:</td>
|
||||
<td colspan="7">
|
||||
<!-- 单据列表table -->
|
||||
<table id="accountData" style="top:100px;border-bottom-color:#FFFFFF"></table>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<input type="hidden" name="clientIp" id="clientIp" value="<%=clientIp %>"/>
|
||||
</form>
|
||||
</div>
|
||||
<div id="dlg-buttons">
|
||||
<a href="javascript:void(0)" id="saveAccountHead" class="easyui-linkbutton" iconCls="icon-ok">保存</a>
|
||||
<a href="javascript:void(0)" id="cancelAccountHead" class="easyui-linkbutton" iconCls="icon-cancel" onclick="javascript:$('#accountHeadDlg').dialog('close')">取消</a>
|
||||
</div>
|
||||
<div id="accountHeadDlgShow" class="easyui-dialog" style="width:850px;padding:10px 20px;top:20px"
|
||||
closed="true" modal="true" cache="false" collapsible="false" closable="true">
|
||||
<table>
|
||||
<tr>
|
||||
<td>单据编号:</td>
|
||||
<td style="padding:5px;width:110px;">
|
||||
<span id="BillNoShow"></span>
|
||||
</td>
|
||||
<td>单据日期:</td>
|
||||
<td style="padding:5px;width:110px;">
|
||||
<span id="BillTimeShow"></span>
|
||||
</td>
|
||||
<td>付款账户:</td>
|
||||
<td style="padding:5px;width:110px;">
|
||||
<span id="AccountIdShow"></span>
|
||||
</td>
|
||||
<td>付款金额:</td>
|
||||
<td style="padding:5px;width:110px;">
|
||||
<span id="ChangeAmountShow"></span>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>往来单位:</td>
|
||||
<td style="padding:5px">
|
||||
<span id="OrganIdShow"></span>
|
||||
</td>
|
||||
<td>经手人:</td>
|
||||
<td style="padding:5px">
|
||||
<span id="HandsPersonIdShow"></span>
|
||||
</td>
|
||||
<td>单据备注:</td>
|
||||
<td style="padding:5px">
|
||||
<span id="RemarkShow"></span>
|
||||
</td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>单据明细:</td>
|
||||
<td colspan="7">
|
||||
<!-- 单据列表table -->
|
||||
<table id="accountDataShow" style="top:100px;border-bottom-color:#FFFFFF"></table>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
157
src/main/webapp/pages/financial/money_in.jsp
Normal file
157
src/main/webapp/pages/financial/money_in.jsp
Normal file
@@ -0,0 +1,157 @@
|
||||
<%@page import="com.jsh.util.Tools"%>
|
||||
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
|
||||
<%
|
||||
String path = request.getContextPath();
|
||||
String clientIp = Tools.getCurrentUserIP();
|
||||
%>
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>收款单</title>
|
||||
<meta charset="utf-8">
|
||||
<!-- 指定以IE8的方式来渲染 -->
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE8"/>
|
||||
<link rel="shortcut icon" href="<%=path%>/images/favicon.ico" type="image/x-icon" />
|
||||
<link rel="stylesheet" type="text/css" href="<%=path %>/js/easyui-1.3.5/themes/default/easyui.css"/>
|
||||
<link rel="stylesheet" type="text/css" href="<%=path %>/js/easyui-1.3.5/themes/icon.css"/>
|
||||
<link type="text/css" rel="stylesheet" href="<%=path %>/css/common.css" />
|
||||
<script src="<%=path %>/js/jquery-1.8.0.min.js"></script>
|
||||
<script src="<%=path %>/js/easyui-1.3.5/jquery.easyui.min.js"></script>
|
||||
<script src="<%=path %>/js/easyui-1.3.5/locale/easyui-lang-zh_CN.js"></script>
|
||||
<script src="<%=path %>/js/My97DatePicker/WdatePicker.js"></script>
|
||||
<script src="<%=path %>/js/common/common.js"></script>
|
||||
<script src="<%=path %>/js/pages/financial/financial_base.js"></script>
|
||||
<script>
|
||||
var kid = ${sessionScope.user.id};
|
||||
var path = "<%=path%>";
|
||||
var clientIp = "<%=clientIp%>";
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<!-- 查询 -->
|
||||
<div id = "searchPanel" class="easyui-panel" style="padding:3px;" title="查询窗口" iconCls="icon-search" collapsible="true" closable="false">
|
||||
<table id="searchTable">
|
||||
<tr>
|
||||
<td>单据编号:</td>
|
||||
<td>
|
||||
<input type="text" name="searchBillNo" id="searchBillNo" style="width:60px;"/>
|
||||
</td>
|
||||
<td>单据日期:</td>
|
||||
<td>
|
||||
<input type="text" name="searchBeginTime" id="searchBeginTime" onClick="WdatePicker({dateFmt:'yyyy-MM-dd'})" class="txt Wdate" style="width:80px;"/>
|
||||
</td>
|
||||
<td>-</td>
|
||||
<td>
|
||||
<input type="text" name="searchEndTime" id="searchEndTime" onClick="WdatePicker({dateFmt:'yyyy-MM-dd'})" class="txt Wdate" style="width:80px;"/>
|
||||
</td>
|
||||
<td> </td>
|
||||
<td>
|
||||
<a href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-search" id="searchBtn">查询</a>
|
||||
<a href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-redo" id="searchResetBtn">重置</a>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<!-- 数据显示table -->
|
||||
<div id = "tablePanel" class="easyui-panel" style="padding:1px;top:300px;" title="收款单列表" iconCls="icon-list" collapsible="true" closable="false">
|
||||
<table id="tableData" style="top:300px;border-bottom-color:#FFFFFF"></table>
|
||||
</div>
|
||||
|
||||
<div id="accountHeadDlg" class="easyui-dialog" style="width:850px;padding:10px 20px;top:20px"
|
||||
closed="true" buttons="#dlg-buttons" modal="true" cache="false" collapsible="false" closable="true">
|
||||
<form id="accountHeadFM" method="post" novalidate>
|
||||
<table>
|
||||
<tr>
|
||||
<td>单据编号:</td>
|
||||
<td style="padding:5px">
|
||||
<input name="BillNo" id="BillNo" class="easyui-validatebox" data-options="required:true,validType:'length[2,30]'" style="width: 110px;"/>
|
||||
</td>
|
||||
<td>单据日期:</td>
|
||||
<td style="padding:5px">
|
||||
<input type="text" name="BillTime" id="BillTime" onClick="WdatePicker({dateFmt:'yyyy-MM-dd'})" class="txt Wdate" style="width:110px;"/>
|
||||
</td>
|
||||
<td>优惠金额:</td>
|
||||
<td style="padding:5px">
|
||||
<input type="text" name="ChangeAmount" id="ChangeAmount" class="easyui-numberbox" data-options="min:0,precision:2" style="width: 110px;"></input>
|
||||
</td>
|
||||
<td style="width:50px;"></td>
|
||||
<td style="padding:5px;width:110px;"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>付款单位:</td>
|
||||
<td style="padding:5px">
|
||||
<select name="OrganId" id="OrganId" style="width:110px;"></select>
|
||||
</td>
|
||||
<td>经手人:</td>
|
||||
<td style="padding:5px">
|
||||
<select name="HandsPersonId" id="HandsPersonId" style="width:110px;"></select>
|
||||
</td>
|
||||
<td>单据备注:</td>
|
||||
<td style="padding:5px">
|
||||
<input name="Remark" id="Remark" class="easyui-validatebox" style="width: 110px;"/>
|
||||
</td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>单据明细:</td>
|
||||
<td colspan="7">
|
||||
<!-- 单据列表table -->
|
||||
<table id="accountData" style="top:100px;border-bottom-color:#FFFFFF"></table>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<input type="hidden" name="clientIp" id="clientIp" value="<%=clientIp %>"/>
|
||||
</form>
|
||||
</div>
|
||||
<div id="dlg-buttons">
|
||||
<a href="javascript:void(0)" id="saveAccountHead" class="easyui-linkbutton" iconCls="icon-ok">保存</a>
|
||||
<a href="javascript:void(0)" id="cancelAccountHead" class="easyui-linkbutton" iconCls="icon-cancel" onclick="javascript:$('#accountHeadDlg').dialog('close')">取消</a>
|
||||
</div>
|
||||
<div id="accountHeadDlgShow" class="easyui-dialog" style="width:850px;padding:10px 20px;top:20px"
|
||||
closed="true" modal="true" cache="false" collapsible="false" closable="true">
|
||||
<table>
|
||||
<tr>
|
||||
<td>单据编号:</td>
|
||||
<td style="padding:5px;width:120px;">
|
||||
<span id="BillNoShow"></span>
|
||||
</td>
|
||||
<td>单据日期:</td>
|
||||
<td style="padding:5px;width:120px;">
|
||||
<span id="BillTimeShow"></span>
|
||||
</td>
|
||||
<td>优惠金额:</td>
|
||||
<td style="padding:5px;width:120px;">
|
||||
<span id="ChangeAmountShow"></span>
|
||||
</td>
|
||||
<td style="width:50px;"></td>
|
||||
<td style="padding:5px;width:120px;">
|
||||
</tr>
|
||||
<tr>
|
||||
<td>付款单位:</td>
|
||||
<td style="padding:5px">
|
||||
<span id="OrganIdShow"></span>
|
||||
</td>
|
||||
<td>经手人:</td>
|
||||
<td style="padding:5px">
|
||||
<span id="HandsPersonIdShow"></span>
|
||||
</td>
|
||||
<td>单据备注:</td>
|
||||
<td style="padding:5px">
|
||||
<span id="RemarkShow"></span>
|
||||
</td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>单据明细:</td>
|
||||
<td colspan="7">
|
||||
<!-- 单据列表table -->
|
||||
<table id="accountDataShow" style="top:100px;border-bottom-color:#FFFFFF"></table>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
157
src/main/webapp/pages/financial/money_out.jsp
Normal file
157
src/main/webapp/pages/financial/money_out.jsp
Normal file
@@ -0,0 +1,157 @@
|
||||
<%@page import="com.jsh.util.Tools"%>
|
||||
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
|
||||
<%
|
||||
String path = request.getContextPath();
|
||||
String clientIp = Tools.getCurrentUserIP();
|
||||
%>
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>付款单</title>
|
||||
<meta charset="utf-8">
|
||||
<!-- 指定以IE8的方式来渲染 -->
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE8"/>
|
||||
<link rel="shortcut icon" href="<%=path%>/images/favicon.ico" type="image/x-icon" />
|
||||
<link rel="stylesheet" type="text/css" href="<%=path %>/js/easyui-1.3.5/themes/default/easyui.css"/>
|
||||
<link rel="stylesheet" type="text/css" href="<%=path %>/js/easyui-1.3.5/themes/icon.css"/>
|
||||
<link type="text/css" rel="stylesheet" href="<%=path %>/css/common.css" />
|
||||
<script src="<%=path %>/js/jquery-1.8.0.min.js"></script>
|
||||
<script src="<%=path %>/js/easyui-1.3.5/jquery.easyui.min.js"></script>
|
||||
<script src="<%=path %>/js/easyui-1.3.5/locale/easyui-lang-zh_CN.js"></script>
|
||||
<script src="<%=path %>/js/My97DatePicker/WdatePicker.js"></script>
|
||||
<script src="<%=path %>/js/common/common.js"></script>
|
||||
<script src="<%=path %>/js/pages/financial/financial_base.js"></script>
|
||||
<script>
|
||||
var kid = ${sessionScope.user.id};
|
||||
var path = "<%=path%>";
|
||||
var clientIp = "<%=clientIp%>";
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<!-- 查询 -->
|
||||
<div id = "searchPanel" class="easyui-panel" style="padding:3px;" title="查询窗口" iconCls="icon-search" collapsible="true" closable="false">
|
||||
<table id="searchTable">
|
||||
<tr>
|
||||
<td>单据编号:</td>
|
||||
<td>
|
||||
<input type="text" name="searchBillNo" id="searchBillNo" style="width:60px;"/>
|
||||
</td>
|
||||
<td>单据日期:</td>
|
||||
<td>
|
||||
<input type="text" name="searchBeginTime" id="searchBeginTime" onClick="WdatePicker({dateFmt:'yyyy-MM-dd'})" class="txt Wdate" style="width:80px;"/>
|
||||
</td>
|
||||
<td>-</td>
|
||||
<td>
|
||||
<input type="text" name="searchEndTime" id="searchEndTime" onClick="WdatePicker({dateFmt:'yyyy-MM-dd'})" class="txt Wdate" style="width:80px;"/>
|
||||
</td>
|
||||
<td> </td>
|
||||
<td>
|
||||
<a href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-search" id="searchBtn">查询</a>
|
||||
<a href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-redo" id="searchResetBtn">重置</a>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<!-- 数据显示table -->
|
||||
<div id = "tablePanel" class="easyui-panel" style="padding:1px;top:300px;" title="付款单列表" iconCls="icon-list" collapsible="true" closable="false">
|
||||
<table id="tableData" style="top:300px;border-bottom-color:#FFFFFF"></table>
|
||||
</div>
|
||||
|
||||
<div id="accountHeadDlg" class="easyui-dialog" style="width:850px;padding:10px 20px;top:20px"
|
||||
closed="true" buttons="#dlg-buttons" modal="true" cache="false" collapsible="false" closable="true">
|
||||
<form id="accountHeadFM" method="post" novalidate>
|
||||
<table>
|
||||
<tr>
|
||||
<td>单据编号:</td>
|
||||
<td style="padding:5px">
|
||||
<input name="BillNo" id="BillNo" class="easyui-validatebox" data-options="required:true,validType:'length[2,30]'" style="width: 110px;"/>
|
||||
</td>
|
||||
<td>单据日期:</td>
|
||||
<td style="padding:5px">
|
||||
<input type="text" name="BillTime" id="BillTime" onClick="WdatePicker({dateFmt:'yyyy-MM-dd'})" class="txt Wdate" style="width:110px;"/>
|
||||
</td>
|
||||
<td>优惠金额:</td>
|
||||
<td style="padding:5px">
|
||||
<input type="text" name="ChangeAmount" id="ChangeAmount" class="easyui-numberbox" data-options="min:0,precision:2" style="width: 110px;"></input>
|
||||
</td>
|
||||
<td style="width:50px;"></td>
|
||||
<td style="padding:5px;width:110px;"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>收款单位:</td>
|
||||
<td style="padding:5px">
|
||||
<select name="OrganId" id="OrganId" style="width:110px;"></select>
|
||||
</td>
|
||||
<td>经手人:</td>
|
||||
<td style="padding:5px">
|
||||
<select name="HandsPersonId" id="HandsPersonId" style="width:110px;"></select>
|
||||
</td>
|
||||
<td>单据备注:</td>
|
||||
<td style="padding:5px">
|
||||
<input name="Remark" id="Remark" class="easyui-validatebox" style="width: 110px;"/>
|
||||
</td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>单据明细:</td>
|
||||
<td colspan="7">
|
||||
<!-- 单据列表table -->
|
||||
<table id="accountData" style="top:100px;border-bottom-color:#FFFFFF"></table>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<input type="hidden" name="clientIp" id="clientIp" value="<%=clientIp %>"/>
|
||||
</form>
|
||||
</div>
|
||||
<div id="dlg-buttons">
|
||||
<a href="javascript:void(0)" id="saveAccountHead" class="easyui-linkbutton" iconCls="icon-ok">保存</a>
|
||||
<a href="javascript:void(0)" id="cancelAccountHead" class="easyui-linkbutton" iconCls="icon-cancel" onclick="javascript:$('#accountHeadDlg').dialog('close')">取消</a>
|
||||
</div>
|
||||
<div id="accountHeadDlgShow" class="easyui-dialog" style="width:850px;padding:10px 20px;top:20px"
|
||||
closed="true" modal="true" cache="false" collapsible="false" closable="true">
|
||||
<table>
|
||||
<tr>
|
||||
<td>单据编号:</td>
|
||||
<td style="padding:5px;width:110px;">
|
||||
<span id="BillNoShow"></span>
|
||||
</td>
|
||||
<td>单据日期:</td>
|
||||
<td style="padding:5px;width:110px;">
|
||||
<span id="BillTimeShow"></span>
|
||||
</td>
|
||||
<td>优惠金额:</td>
|
||||
<td style="padding:5px;width:110px;">
|
||||
<span id="ChangeAmountShow"></span>
|
||||
</td>
|
||||
<td style="width:50px;"></td>
|
||||
<td style="padding:5px;width:110px;">
|
||||
</tr>
|
||||
<tr>
|
||||
<td>收款单位:</td>
|
||||
<td style="padding:5px">
|
||||
<span id="OrganIdShow"></span>
|
||||
</td>
|
||||
<td>经手人:</td>
|
||||
<td style="padding:5px">
|
||||
<span id="HandsPersonIdShow"></span>
|
||||
</td>
|
||||
<td>单据备注:</td>
|
||||
<td style="padding:5px">
|
||||
<span id="RemarkShow"></span>
|
||||
</td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>单据明细:</td>
|
||||
<td colspan="7">
|
||||
<!-- 单据列表table -->
|
||||
<table id="accountDataShow" style="top:100px;border-bottom-color:#FFFFFF"></table>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
518
src/main/webapp/pages/manage/account.jsp
Normal file
518
src/main/webapp/pages/manage/account.jsp
Normal file
@@ -0,0 +1,518 @@
|
||||
<%@page import="com.jsh.util.Tools"%>
|
||||
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
|
||||
<%
|
||||
String path = request.getContextPath();
|
||||
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
|
||||
String clientIp = Tools.getCurrentUserIP();
|
||||
%>
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>结算账户</title>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
<!-- 指定以IE8的方式来渲染 -->
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE8"/>
|
||||
<link rel="shortcut icon" href="<%=path%>/images/favicon.ico" type="image/x-icon" />
|
||||
<link rel="stylesheet" type="text/css" href="<%=path %>/js/easyui-1.3.5/themes/default/easyui.css"/>
|
||||
<link rel="stylesheet" type="text/css" href="<%=path %>/js/easyui-1.3.5/themes/icon.css"/>
|
||||
<link type="text/css" rel="stylesheet" href="<%=path %>/css/common.css" />
|
||||
<script type="text/javascript" src="<%=path %>/js/jquery-1.8.0.min.js"></script>
|
||||
<script type="text/javascript" src="<%=path %>/js/easyui-1.3.5/jquery.easyui.min.js"></script>
|
||||
<script type="text/javascript" src="<%=path %>/js/easyui-1.3.5/locale/easyui-lang-zh_CN.js"></script>
|
||||
<script type="text/javascript" src="<%=path %>/js/common/common.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<!-- 查询 -->
|
||||
<div id = "searchPanel" class="easyui-panel" style="padding:10px;" title="查询窗口" iconCls="icon-search" collapsible="true" closable="false">
|
||||
<table id="searchTable">
|
||||
<tr>
|
||||
<td>名 称:</td>
|
||||
<td>
|
||||
<input type="text" name="searchName" id="searchName" style="width:70px;"/>
|
||||
</td>
|
||||
|
||||
<td> </td>
|
||||
<td> </td>
|
||||
<td id="searchSerialNoLabel">编 号:</td>
|
||||
<td>
|
||||
<input type="text" name="searchSerialNo" id="searchSerialNo" style="width:70px;"/>
|
||||
</td>
|
||||
<td> </td>
|
||||
<td> </td>
|
||||
<td id="searchRemarkLabel">备 注:</td>
|
||||
<td>
|
||||
<input type="text" name="searchRemark" id="searchRemark" style="width:70px;"/>
|
||||
</td>
|
||||
<td> </td>
|
||||
<td> </td>
|
||||
<td>
|
||||
<a href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-search" id="searchBtn">查询</a>
|
||||
<a href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-redo" id="searchResetBtn">重置</a>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<!-- 数据显示table -->
|
||||
<div id = "tablePanel" class="easyui-panel" style="padding:1px;top:300px;" title="结算账户" iconCls="icon-list" collapsible="true" closable="false">
|
||||
<table id="tableData" style="top:300px;border-bottom-color:#FFFFFF"></table>
|
||||
</div>
|
||||
<div id="accountDlg" class="easyui-dialog" style="width:380px;padding:10px 20px"
|
||||
closed="true" buttons="#dlg-buttons" modal="true" collapsible="false" closable="true">
|
||||
<form id="accountFM" method="post" novalidate>
|
||||
<div class="fitem" style="padding:5px">
|
||||
<label id="nameLabel">名 称</label>
|
||||
<input name="name" id="name" class="easyui-validatebox" data-options="required:true,validType:'length[2,30]'" style="width: 230px;height: 20px"/>
|
||||
</div>
|
||||
<div class="fitem" style="padding:5px">
|
||||
<label id="serialNoLabel">编 号</label>
|
||||
<input name="serialNo" id="serialNo" class="easyui-validatebox" data-options="required:true,validType:'length[2,30]'" style="width: 230px;height: 20px"/>
|
||||
</div>
|
||||
<div class="fitem" style="padding:5px">
|
||||
<label id="initialAmountLabel">期初金额</label>
|
||||
<input name="initialAmount" id="initialAmount" type="text" class="easyui-numberbox" data-options="min:0,precision:2" style="width: 230px;height: 20px"></input>
|
||||
</div>
|
||||
<div class="fitem" style="padding:5px">
|
||||
<label id="currentAmountLabel">当前余额</label>
|
||||
<input name="currentAmount" id="currentAmount" type="text" disabled="disabled" class="easyui-numberbox" data-options="min:0,precision:2" style="width: 230px;height: 20px"></input>
|
||||
</div>
|
||||
<div class="fitem" style="padding:5px">
|
||||
<label id="remarkLabel">备 注</label>
|
||||
<textarea name="remark" id="remark" rows="2" cols="2" style="width: 230px;"></textarea>
|
||||
</div>
|
||||
<input type="hidden" name="clientIp" id="clientIp" value="<%=clientIp %>"/>
|
||||
</form>
|
||||
</div>
|
||||
<div id="dlg-buttons">
|
||||
<a href="javascript:void(0)" id="saveAccount" class="easyui-linkbutton" iconCls="icon-ok">保存</a>
|
||||
<a href="javascript:void(0)" id="cancelAccount" class="easyui-linkbutton" iconCls="icon-cancel" onclick="javascript:$('#accountDlg').dialog('close')">取消</a>
|
||||
</div>
|
||||
|
||||
<script type="text/javascript">
|
||||
//初始化界面
|
||||
$(function()
|
||||
{
|
||||
initTableData();
|
||||
ininPager();
|
||||
browserFit();
|
||||
});
|
||||
|
||||
//浏览器适配
|
||||
function browserFit()
|
||||
{
|
||||
if(getOs()=='MSIE')
|
||||
{
|
||||
$("#searchSerialNoLabel").empty().append("编 号:");
|
||||
$("#searchRemarkLabel").empty().append("备 注:");
|
||||
$("#nameLabel").empty().append("名 称");
|
||||
$("#serialNoLabel").empty().append("编 号");
|
||||
$("#initialAmountLabel").empty().append("期初金额");
|
||||
$("#currentAmountLabel").empty().append("当前余额");
|
||||
$("#remarkLabel").empty().append("备 注");
|
||||
}
|
||||
else
|
||||
{
|
||||
$("#searchSerialNoLabel").empty().append("编 号:");
|
||||
$("#searchRemarkLabel").empty().append("备 注:");
|
||||
$("#nameLabel").empty().append("名 称");
|
||||
$("#serialNoLabel").empty().append("编 号");
|
||||
$("#initialAmountLabel").empty().append("期初金额");
|
||||
$("#currentAmountLabel").empty().append("当前余额");
|
||||
$("#remarkLabel").empty().append("备 注");
|
||||
}
|
||||
}
|
||||
|
||||
//初始化表格数据
|
||||
function initTableData()
|
||||
{
|
||||
$('#tableData').datagrid({
|
||||
//title:'结算账户',
|
||||
//iconCls:'icon-save',
|
||||
//width:700,
|
||||
height:heightInfo,
|
||||
nowrap: false,
|
||||
rownumbers: false,
|
||||
//动画效果
|
||||
animate:false,
|
||||
//选中单行
|
||||
singleSelect : true,
|
||||
collapsible:false,
|
||||
selectOnCheck:false,
|
||||
//fitColumns:true,
|
||||
//单击行是否选中
|
||||
checkOnSelect : false,
|
||||
//交替出现背景
|
||||
striped : true,
|
||||
url:'<%=path %>/account/findBy.action?pageSize=' + initPageSize,
|
||||
pagination: true,
|
||||
//自动截取数据
|
||||
//nowrap : true,
|
||||
//loadFilter: pagerFilter,
|
||||
pageSize: initPageSize,
|
||||
pageList: initPageNum,
|
||||
columns:[[
|
||||
{ field: 'id',width:35,align:"center",checkbox:true},
|
||||
{ title: '名称',field: 'name',width:100},
|
||||
{ title: '编号', field: 'serialNo',width:100,align:"center"},
|
||||
{ title: '期初金额', field: 'initialAmount',width:100,align:"center"},
|
||||
{ title: '当前余额', field: 'currentAmount',width:100,align:"center"},
|
||||
{ title: '备注',field: 'remark',width:100},
|
||||
{ title: '操作',field: 'op',align:"center",width:130,formatter:function(value,rec)
|
||||
{
|
||||
var str = '';
|
||||
var rowInfo = rec.id + 'AaBb' + rec.name +'AaBb' + rec.serialNo +'AaBb' + rec.initialAmount +'AaBb' + rec.currentAmount + 'AaBb'+ rec.remark;
|
||||
if(1 == value)
|
||||
{
|
||||
str += '<img src="<%=path%>/js/easyui-1.3.5/themes/icons/pencil.png" style="cursor: pointer;" onclick="editAccount(\'' + rowInfo + '\');"/> <a onclick="editAccount(\'' + rowInfo + '\');" style="text-decoration:none;color:black;" href="javascript:void(0)">编辑</a> ';
|
||||
str += '<img src="<%=path%>/js/easyui-1.3.5/themes/icons/edit_remove.png" style="cursor: pointer;" onclick="deleteAccount(\'' + rowInfo + '\');"/> <a onclick="deleteAccount(\'' + rowInfo + '\');" style="text-decoration:none;color:black;" href="javascript:void(0)">删除</a> ';
|
||||
}
|
||||
return str;
|
||||
}
|
||||
}
|
||||
]],
|
||||
toolbar:[
|
||||
{
|
||||
id:'addAccount',
|
||||
text:'增加',
|
||||
iconCls:'icon-add',
|
||||
handler:function()
|
||||
{
|
||||
addAccount();
|
||||
}
|
||||
},
|
||||
{
|
||||
id:'deleteAccount',
|
||||
text:'删除',
|
||||
iconCls:'icon-remove',
|
||||
handler:function()
|
||||
{
|
||||
batDeleteAccount();
|
||||
}
|
||||
}
|
||||
],
|
||||
onLoadError:function()
|
||||
{
|
||||
$.messager.alert('页面加载提示','页面加载异常,请稍后再试!','error');
|
||||
return;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
//初始化键盘enter事件
|
||||
$(document).keydown(function(event)
|
||||
{
|
||||
//兼容 IE和firefox 事件
|
||||
var e = window.event || event;
|
||||
var k = e.keyCode||e.which||e.charCode;
|
||||
//兼容 IE,firefox 兼容
|
||||
var obj = e.srcElement ? e.srcElement : e.target;
|
||||
//绑定键盘事件为 id是指定的输入框才可以触发键盘事件 13键盘事件
|
||||
if(k == "13"&&(obj.id=="name" || obj.id=="serialNo" || obj.id=="initialAmount" || obj.id=="currentAmount" || obj.id=="remark"))
|
||||
{
|
||||
$("#saveAccount").click();
|
||||
}
|
||||
|
||||
//搜索按钮添加快捷键
|
||||
if(k == "13"&&(obj.id=="searchName" || obj.id=="searchSerialNo" || obj.id=="searchRemark"))
|
||||
{
|
||||
$("#searchBtn").click();
|
||||
}
|
||||
});
|
||||
//分页信息处理
|
||||
function ininPager()
|
||||
{
|
||||
try
|
||||
{
|
||||
var opts = $("#tableData").datagrid('options');
|
||||
var pager = $("#tableData").datagrid('getPager');
|
||||
pager.pagination({
|
||||
onSelectPage:function(pageNum, pageSize)
|
||||
{
|
||||
opts.pageNumber = pageNum;
|
||||
opts.pageSize = pageSize;
|
||||
pager.pagination('refresh',
|
||||
{
|
||||
pageNumber:pageNum,
|
||||
pageSize:pageSize
|
||||
});
|
||||
showAccountDetails(pageNum,pageSize);
|
||||
}
|
||||
});
|
||||
}
|
||||
catch (e)
|
||||
{
|
||||
$.messager.alert('异常处理提示',"分页信息异常 : " + e.name + ": " + e.message,'error');
|
||||
}
|
||||
}
|
||||
|
||||
//删除结算账户
|
||||
function deleteAccount(accountInfo)
|
||||
{
|
||||
$.messager.confirm('删除确认','确定要删除此结算账户吗?',function(r)
|
||||
{
|
||||
if (r)
|
||||
{
|
||||
var accountTotalInfo = accountInfo.split("AaBb");
|
||||
$.ajax({
|
||||
type:"post",
|
||||
url: "<%=path %>/account/delete.action",
|
||||
dataType: "json",
|
||||
data: ({
|
||||
accountID : accountTotalInfo[0],
|
||||
name:accountTotalInfo[1],
|
||||
clientIp:'<%=clientIp %>'
|
||||
}),
|
||||
success: function (tipInfo)
|
||||
{
|
||||
var msg = tipInfo.showModel.msgTip;
|
||||
if(msg == '成功')
|
||||
//加载完以后重新初始化
|
||||
$("#searchBtn").click();
|
||||
else
|
||||
$.messager.alert('删除提示','删除结算账户失败,请稍后再试!','error');
|
||||
},
|
||||
//此处添加错误处理
|
||||
error:function()
|
||||
{
|
||||
$.messager.alert('删除提示','删除结算账户异常,请稍后再试!','error');
|
||||
return;
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
//批量删除结算账户
|
||||
function batDeleteAccount()
|
||||
{
|
||||
var row = $('#tableData').datagrid('getChecked');
|
||||
if(row.length == 0)
|
||||
{
|
||||
$.messager.alert('删除提示','没有记录被选中!','info');
|
||||
return;
|
||||
}
|
||||
if(row.length > 0)
|
||||
{
|
||||
$.messager.confirm('删除确认','确定要删除选中的' + row.length + '条结算账户吗?',function(r)
|
||||
{
|
||||
if (r)
|
||||
{
|
||||
var ids = "";
|
||||
for(var i = 0;i < row.length; i ++)
|
||||
{
|
||||
if(i == row.length-1)
|
||||
{
|
||||
ids += row[i].id;
|
||||
break;
|
||||
}
|
||||
ids += row[i].id + ",";
|
||||
}
|
||||
$.ajax({
|
||||
type:"post",
|
||||
url: "<%=path %>/account/batchDelete.action",
|
||||
dataType: "json",
|
||||
async : false,
|
||||
data: ({
|
||||
accountIDs : ids,
|
||||
clientIp:'<%=clientIp %>'
|
||||
}),
|
||||
success: function (tipInfo)
|
||||
{
|
||||
var msg = tipInfo.showModel.msgTip;
|
||||
if(msg == '成功')
|
||||
{
|
||||
//加载完以后重新初始化
|
||||
$("#searchBtn").click();
|
||||
$(":checkbox").attr("checked",false);
|
||||
}
|
||||
else
|
||||
$.messager.alert('删除提示','删除结算账户失败,请稍后再试!','error');
|
||||
},
|
||||
//此处添加错误处理
|
||||
error:function()
|
||||
{
|
||||
$.messager.alert('删除提示','删除结算账户异常,请稍后再试!','error');
|
||||
return;
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
//增加结算账户
|
||||
var url;
|
||||
var accountID = 0;
|
||||
//保存编辑前的名称
|
||||
var orgaccount = "";
|
||||
|
||||
function addAccount()
|
||||
{
|
||||
$('#accountDlg').dialog('open').dialog('setTitle','<img src="<%=path%>/js/easyui-1.3.5/themes/icons/edit_add.png"/> 增加结算账户');
|
||||
$(".window-mask").css({ width: webW ,height: webH});
|
||||
$('#accountFM').form('clear');
|
||||
|
||||
var row = {
|
||||
clientIp:'<%=clientIp %>'
|
||||
};
|
||||
$('#accountFM').form('load',row);
|
||||
|
||||
$("#account").focus();
|
||||
orgAccount = "";
|
||||
accountID = 0;
|
||||
url = '<%=path %>/account/create.action';
|
||||
}
|
||||
|
||||
//保存结算账户
|
||||
$("#saveAccount").unbind().bind({
|
||||
click:function()
|
||||
{
|
||||
if(checkAccountName())
|
||||
return;
|
||||
|
||||
$('#accountFM').form('submit',{
|
||||
url: url,
|
||||
onSubmit: function()
|
||||
{
|
||||
return $(this).form('validate');
|
||||
},
|
||||
success: function(result)
|
||||
{
|
||||
var result = eval('('+result+')');
|
||||
if (!result)
|
||||
{
|
||||
$.messager.show({
|
||||
title: '错误提示',
|
||||
msg: '保存结算账户失败,请稍后重试!'
|
||||
});
|
||||
}
|
||||
else
|
||||
{
|
||||
$('#accountDlg').dialog('close');
|
||||
//$('#tableData').datagrid('reload');
|
||||
//加载完以后重新初始化
|
||||
//$("#searchBtn").click();
|
||||
var opts = $("#tableData").datagrid('options');
|
||||
showAccountDetails(opts.pageNumber,opts.pageSize);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
//编辑结算账户
|
||||
function editAccount(accountTotalInfo)
|
||||
{
|
||||
var accountInfo = accountTotalInfo.split("AaBb");
|
||||
var row = {
|
||||
name : accountInfo[1],
|
||||
serialNo : accountInfo[2],
|
||||
initialAmount : accountInfo[3],
|
||||
currentAmount : accountInfo[4],
|
||||
remark : accountInfo[5],
|
||||
clientIp:'<%=clientIp %>'
|
||||
};
|
||||
orgAccount = accountInfo[1];
|
||||
$('#accountDlg').dialog('open').dialog('setTitle','<img src="<%=path%>/js/easyui-1.3.5/themes/icons/pencil.png"/> 编辑结算账户');
|
||||
$(".window-mask").css({ width: webW ,height: webH});
|
||||
$('#accountFM').form('load',row);
|
||||
accountID = accountInfo[0];
|
||||
//焦点在名称输入框==定焦在输入文字后面
|
||||
$("#account").val("").focus().val(accountInfo[1]);
|
||||
url = '<%=path %>/account/update.action?accountID=' + accountInfo[0];
|
||||
}
|
||||
|
||||
//检查结算账户 名称是否存在 ++ 重名无法提示问题需要跟进
|
||||
function checkAccountName()
|
||||
{
|
||||
var accountName = $.trim($("#name").val());
|
||||
//表示是否存在 true == 存在 false = 不存在
|
||||
var flag = false;
|
||||
//开始ajax名称检验,不能重名
|
||||
if(accountName.length > 0 &&( orgAccount.length ==0 || accountName != orgAccount))
|
||||
{
|
||||
$.ajax({
|
||||
type:"post",
|
||||
url: "<%=path %>/account/checkIsNameExist.action",
|
||||
dataType: "json",
|
||||
async : false,
|
||||
data: ({
|
||||
accountID : accountID,
|
||||
name : accountName
|
||||
}),
|
||||
success: function (tipInfo)
|
||||
{
|
||||
flag = tipInfo;
|
||||
if(tipInfo)
|
||||
{
|
||||
$.messager.alert('提示','结算账户名称已经存在','info');
|
||||
return;
|
||||
}
|
||||
},
|
||||
//此处添加错误处理
|
||||
error:function()
|
||||
{
|
||||
$.messager.alert('提示','检查结算账户名称是否存在异常,请稍后再试!','error');
|
||||
return;
|
||||
}
|
||||
});
|
||||
}
|
||||
return flag;
|
||||
}
|
||||
|
||||
//搜索处理
|
||||
$("#searchBtn").unbind().bind({
|
||||
click:function()
|
||||
{
|
||||
showAccountDetails(1,initPageSize);
|
||||
var opts = $("#tableData").datagrid('options');
|
||||
var pager = $("#tableData").datagrid('getPager');
|
||||
opts.pageNumber = 1;
|
||||
opts.pageSize = initPageSize;
|
||||
pager.pagination('refresh',
|
||||
{
|
||||
pageNumber:1,
|
||||
pageSize:initPageSize
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
function showAccountDetails(pageNo,pageSize)
|
||||
{
|
||||
$.ajax({
|
||||
type:"post",
|
||||
url: "<%=path %>/account/findBy.action",
|
||||
dataType: "json",
|
||||
data: ({
|
||||
name:$.trim($("#searchName").val()),
|
||||
serialNo:$.trim($("#searchSerialNo").val()),
|
||||
remark:$.trim($("#searchRemark").val()),
|
||||
pageNo:pageNo,
|
||||
pageSize:pageSize
|
||||
}),
|
||||
success: function (data)
|
||||
{
|
||||
$("#tableData").datagrid('loadData',data);
|
||||
},
|
||||
//此处添加错误处理
|
||||
error:function()
|
||||
{
|
||||
$.messager.alert('查询提示','查询数据后台异常,请稍后再试!','error');
|
||||
return;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
//重置按钮
|
||||
$("#searchResetBtn").unbind().bind({
|
||||
click:function(){
|
||||
$("#searchName").val("");
|
||||
$("#searchSerialNo").val("");
|
||||
$("#searchRemark").val("");
|
||||
//加载完以后重新初始化
|
||||
$("#searchBtn").click();
|
||||
}
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
584
src/main/webapp/pages/manage/app.jsp
Normal file
584
src/main/webapp/pages/manage/app.jsp
Normal file
@@ -0,0 +1,584 @@
|
||||
<%@page import="com.jsh.util.Tools"%>
|
||||
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
|
||||
<%
|
||||
String path = request.getContextPath();
|
||||
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
|
||||
String clientIp = Tools.getCurrentUserIP();
|
||||
%>
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>应用管理</title>
|
||||
<meta charset="utf-8">
|
||||
<!-- 指定以IE8的方式来渲染 -->
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE8"/>
|
||||
<link rel="shortcut icon" href="<%=path%>/images/favicon.ico" type="image/x-icon" />
|
||||
<link rel="stylesheet" type="text/css" href="<%=path %>/js/easyui-1.3.5/themes/default/easyui.css"/>
|
||||
<link rel="stylesheet" type="text/css" href="<%=path %>/js/easyui-1.3.5/themes/icon.css"/>
|
||||
<link type="text/css" rel="stylesheet" href="<%=path %>/css/common.css" />
|
||||
<script type="text/javascript" src="<%=path %>/js/jquery-1.8.0.min.js"></script>
|
||||
<script type="text/javascript" src="<%=path %>/js/easyui-1.3.5/jquery.easyui.min.js"></script>
|
||||
<script type="text/javascript" src="<%=path %>/js/easyui-1.3.5/locale/easyui-lang-zh_CN.js"></script>
|
||||
<script type="text/javascript" src="<%=path %>/js/common/common.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<!-- 查询 -->
|
||||
<div id = "searchPanel" class="easyui-panel" style="padding:10px;" title="查询窗口" iconCls="icon-search" collapsible="true" closable="false">
|
||||
<table id="searchTable">
|
||||
<tr>
|
||||
<td>名称:</td>
|
||||
<td>
|
||||
<input type="text" name="searchName" id="searchName" style="width:100px;"/>
|
||||
</td>
|
||||
<td> </td>
|
||||
<td> </td>
|
||||
<td>种类:</td>
|
||||
<td>
|
||||
<input type="text" name="searchType" id="searchType" style="width:100px;"/>
|
||||
</td>
|
||||
<td> </td>
|
||||
<td> </td>
|
||||
<td> </td>
|
||||
<td>
|
||||
<a href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-search" id="searchBtn">查询</a>
|
||||
<a href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-redo" id="searchResetBtn">重置</a>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<!-- 数据显示table -->
|
||||
<div id = "tablePanel" class="easyui-panel" style="padding:1px;top:300px;" title="应用列表" iconCls="icon-list" collapsible="true" closable="false">
|
||||
<table id="tableData" style="top:300px;border-bottom-color:#FFFFFF"></table>
|
||||
</div>
|
||||
|
||||
<div id="appDlg" class="easyui-dialog" style="width:380px;padding:10px 20px"
|
||||
closed="true" buttons="#dlg-buttons" modal="true" cache="false" collapsible="false" closable="true">
|
||||
<form id="appFM" method="post" enctype="multipart/form-data">
|
||||
<table>
|
||||
<tr>
|
||||
<td>代号</td>
|
||||
<td style="padding:1px"><input name="Number" id="Number" class="easyui-textbox" style="width: 230px;height: 20px"/></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>名称</td>
|
||||
<td style="padding:1px"><input name="Name" id="Name" class="easyui-validatebox" data-options="required:true,validType:'length[2,30]'" style="width: 230px;height: 20px"/></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>类型</td>
|
||||
<td style="padding:1px"><input name="Type" id="Type" class="easyui-textbox" style="width: 230px;height: 20px"/></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>图标</td>
|
||||
<td style="padding:1px"><input name="Icon" id="Icon" type="file" class="easyui-textbox" style="width: 230px;height: 20px"/></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>链接</td>
|
||||
<td style="padding:1px"><input name="URL" id="URL" class="easyui-textbox" style="width: 230px;height: 20px"/></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>宽度</td>
|
||||
<td style="padding:1px"><input name="Width" id="Width" class="easyui-textbox" style="width: 230px;height: 20px"/></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>高度</td>
|
||||
<td style="padding:1px"><input name="Height" id="Height" class="easyui-textbox" style="width: 230px;height: 20px"/></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>拉伸</td>
|
||||
<td style="padding:1px"><input name="ReSize" id="ReSize" type="checkbox" style="width: 230px;height: 20px"/></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>最大化</td>
|
||||
<td style="padding:1px"><input name="OpenMax" id="OpenMax" type="checkbox" style="width: 230px;height: 20px"/></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Flash</td>
|
||||
<td style="padding:1px"><input name="Flash" id="Flash" type="checkbox" style="width: 230px;height: 20px"/></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>种类</td>
|
||||
<td style="padding:1px"><input name="ZL" id="ZL" class="easyui-textbox" style="width: 230px;height: 20px"/></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>排序号</td>
|
||||
<td style="padding:1px"><input name="Sort" id="Sort" class="easyui-textbox" style="width: 230px;height: 20px"/></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>备注</td>
|
||||
<td style="padding:1px"><input name="Remark" id="Remark" class="easyui-textbox" style="width: 230px;height: 20px"/></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>启用</td>
|
||||
<td style="padding:1px"><input name="Enabled" id="Enabled" type="checkbox" style="width: 230px;height: 20px"/></td>
|
||||
</tr>
|
||||
</table>
|
||||
<input type="hidden" name="clientIp" id="clientIp" value="<%=clientIp %>"/>
|
||||
</form>
|
||||
</div>
|
||||
<div id="dlg-buttons">
|
||||
<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>
|
||||
</div>
|
||||
|
||||
<script type="text/javascript">
|
||||
//初始化界面
|
||||
$(function()
|
||||
{
|
||||
initTableData();
|
||||
ininPager();
|
||||
initForm();
|
||||
});
|
||||
|
||||
|
||||
//防止表单提交重复
|
||||
function initForm()
|
||||
{
|
||||
$('#appFM').form({
|
||||
onSubmit: function(){
|
||||
return false;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
//初始化表格数据
|
||||
function initTableData()
|
||||
{
|
||||
$('#tableData').datagrid({
|
||||
//title:'应用列表',
|
||||
//iconCls:'icon-save',
|
||||
//width:700,
|
||||
height:heightInfo,
|
||||
nowrap: false,
|
||||
rownumbers: false,
|
||||
//动画效果
|
||||
animate:false,
|
||||
//选中单行
|
||||
singleSelect : true,
|
||||
collapsible:false,
|
||||
selectOnCheck:false,
|
||||
//fitColumns:true,
|
||||
//单击行是否选中
|
||||
checkOnSelect : false,
|
||||
url:'<%=path %>/app/findBy.action?pageSize=' + initPageSize,
|
||||
pagination: true,
|
||||
//交替出现背景
|
||||
striped : true,
|
||||
//loadFilter: pagerFilter,
|
||||
pageSize: initPageSize,
|
||||
pageList: initPageNum,
|
||||
columns:[[
|
||||
{ field: 'Id',width:35,align:"center",checkbox:true},
|
||||
{ title: '代号',field: 'Number',width:50},
|
||||
{ title: '应用名称',field: 'Name',width:100},
|
||||
{ title: '类型',field: 'Type',width:50},
|
||||
{ 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+"\" />";
|
||||
}
|
||||
}
|
||||
},
|
||||
{ title: '链接',field: 'URL',width:100},
|
||||
{ title: '宽度',field: 'Width',width:50},
|
||||
{ title: '高度',field: 'Height',width:50},
|
||||
{ title: '拉伸',field: 'ReSize',width:50},
|
||||
{ title: '最大化',field: 'OpenMax',width:50},
|
||||
{ title: 'Flash',field: 'Flash',width:50},
|
||||
{ title: '种类',field: 'ZL',width:50},
|
||||
{ title: '排序号',field: 'Sort',width:50},
|
||||
{ title: '备注',field: 'Remark',width:50},
|
||||
{ title: '启用',field: 'Enabled',width:50},
|
||||
|
||||
{ title: '操作',field: 'op',align:"center",width:130,formatter:function(value,rec)
|
||||
{
|
||||
var str = '';
|
||||
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.Flash + 'AaBb' + rec.ZL + 'AaBb' + rec.Sort + 'AaBb' + rec.Remark + 'AaBb' + rec.Enabled;
|
||||
if(1 == value)
|
||||
{
|
||||
str += '<img src="<%=path%>/js/easyui-1.3.5/themes/icons/pencil.png" style="cursor: pointer;" onclick="editApp(\'' + rowInfo + '\');"/> <a onclick="editApp(\'' + rowInfo + '\');" style="text-decoration:none;color:black;" href="javascript:void(0)">编辑</a> ';
|
||||
str += '<img src="<%=path%>/js/easyui-1.3.5/themes/icons/edit_remove.png" style="cursor: pointer;" onclick="deleteApp('+ rec.Id +');"/> <a onclick="deleteApp('+ rec.Id +');" style="text-decoration:none;color:black;" href="javascript:void(0)">删除</a> ';
|
||||
}
|
||||
return str;
|
||||
}
|
||||
}
|
||||
]],
|
||||
toolbar:[
|
||||
{
|
||||
id:'addApp',
|
||||
text:'增加',
|
||||
iconCls:'icon-add',
|
||||
handler:function()
|
||||
{
|
||||
addApp();
|
||||
}
|
||||
},
|
||||
{
|
||||
id:'deleteApp',
|
||||
text:'删除',
|
||||
iconCls:'icon-remove',
|
||||
handler:function()
|
||||
{
|
||||
batDeleteApp();
|
||||
}
|
||||
}
|
||||
],
|
||||
onLoadError:function()
|
||||
{
|
||||
$.messager.alert('页面加载提示','页面加载异常,请稍后再试!','error');
|
||||
return;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
//初始化键盘enter事件
|
||||
$(document).keydown(function(event)
|
||||
{
|
||||
//兼容 IE和firefox 事件
|
||||
var e = window.event || event;
|
||||
var k = e.keyCode||e.which||e.charCode;
|
||||
//兼容 IE,firefox 兼容
|
||||
var obj = e.srcElement ? e.srcElement : e.target;
|
||||
//绑定键盘事件为 id是指定的输入框才可以触发键盘事件 13键盘事件 ---遗留问题 enter键效验 对话框会关闭问题
|
||||
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"))
|
||||
{
|
||||
$("#saveApp").click();
|
||||
}
|
||||
//搜索按钮添加快捷键
|
||||
if(k == "13"&&(obj.id=="searchName" || obj.id=="searchType" ))
|
||||
{
|
||||
$("#searchBtn").click();
|
||||
}
|
||||
});
|
||||
|
||||
//分页信息处理
|
||||
function ininPager()
|
||||
{
|
||||
try
|
||||
{
|
||||
var opts = $("#tableData").datagrid('options');
|
||||
var pager = $("#tableData").datagrid('getPager');
|
||||
pager.pagination({
|
||||
onSelectPage:function(pageNum, pageSize)
|
||||
{
|
||||
opts.pageNumber = pageNum;
|
||||
opts.pageSize = pageSize;
|
||||
pager.pagination('refresh',
|
||||
{
|
||||
pageNumber:pageNum,
|
||||
pageSize:pageSize
|
||||
});
|
||||
showAppDetails(pageNum,pageSize);
|
||||
}
|
||||
});
|
||||
}
|
||||
catch (e)
|
||||
{
|
||||
$.messager.alert('异常处理提示',"分页信息异常 : " + e.name + ": " + e.message,'error');
|
||||
}
|
||||
}
|
||||
|
||||
//删除应用信息
|
||||
function deleteApp(appID)
|
||||
{
|
||||
$.messager.confirm('删除确认','确定要删除此应用信息吗?',function(r)
|
||||
{
|
||||
if (r)
|
||||
{
|
||||
$.ajax({
|
||||
type:"post",
|
||||
url: "<%=path %>/app/delete.action",
|
||||
dataType: "json",
|
||||
data: ({
|
||||
appID : appID,
|
||||
clientIp:'<%=clientIp %>'
|
||||
}),
|
||||
success: function (tipInfo)
|
||||
{
|
||||
var msg = tipInfo.showModel.msgTip;
|
||||
if(msg == '成功')
|
||||
{
|
||||
//加载完以后重新初始化
|
||||
$("#searchBtn").click();
|
||||
}
|
||||
else
|
||||
$.messager.alert('删除提示','删除应用信息失败,请稍后再试!','error');
|
||||
},
|
||||
//此处添加错误处理
|
||||
error:function()
|
||||
{
|
||||
$.messager.alert('删除提示','删除应用信息异常,请稍后再试!','error');
|
||||
return;
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
//批量删除
|
||||
function batDeleteApp()
|
||||
{
|
||||
var row = $('#tableData').datagrid('getChecked');
|
||||
if(row.length == 0)
|
||||
{
|
||||
$.messager.alert('删除提示','没有记录被选中!','info');
|
||||
return;
|
||||
}
|
||||
if(row.length > 0)
|
||||
{
|
||||
$.messager.confirm('删除确认','确定要删除选中的' + row.length + '条应用信息吗?',function(r)
|
||||
{
|
||||
if (r)
|
||||
{
|
||||
var ids = "";
|
||||
for(var i = 0;i < row.length; i ++)
|
||||
{
|
||||
if(i == row.length-1)
|
||||
{
|
||||
ids += row[i].Id;
|
||||
break;
|
||||
}
|
||||
//alert(row[i].id);
|
||||
ids += row[i].Id + ",";
|
||||
}
|
||||
$.ajax({
|
||||
type:"post",
|
||||
url: "<%=path %>/app/batchDelete.action",
|
||||
dataType: "json",
|
||||
async : false,
|
||||
data: ({
|
||||
appIDs : ids,
|
||||
clientIp:'<%=clientIp %>'
|
||||
}),
|
||||
success: function (tipInfo)
|
||||
{
|
||||
var msg = tipInfo.showModel.msgTip;
|
||||
if(msg == '成功')
|
||||
{
|
||||
//加载完以后重新初始化
|
||||
$("#searchBtn").click();
|
||||
$(":checkbox").attr("checked",false);
|
||||
}
|
||||
else
|
||||
$.messager.alert('删除提示','删除应用信息失败,请稍后再试!','error');
|
||||
},
|
||||
//此处添加错误处理
|
||||
error:function()
|
||||
{
|
||||
$.messager.alert('删除提示','删除应用信息异常,请稍后再试!','error');
|
||||
return;
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
//增加
|
||||
var url;
|
||||
var appID = 0;
|
||||
//保存编辑前的名称
|
||||
var orgApp = "";
|
||||
|
||||
function addApp()
|
||||
{
|
||||
$("#clientIp").val('<%=clientIp %>');
|
||||
$('#appFM').form('clear');
|
||||
$('#appDlg').dialog('open').dialog('setTitle','<img src="<%=path%>/js/easyui-1.3.5/themes/icons/edit_add.png"/> 增加应用信息');
|
||||
$(".window-mask").css({ width: webW ,height: webH});
|
||||
$("#name").val("").focus();
|
||||
|
||||
orgApp = "";
|
||||
appID = 0;
|
||||
url = '<%=path %>/app/create.action';
|
||||
}
|
||||
|
||||
//保存信息
|
||||
$("#saveApp").unbind().bind({
|
||||
click:function()
|
||||
{
|
||||
if(!$('#appFM').form('validate'))
|
||||
return;
|
||||
else if(checkAppName())
|
||||
return;
|
||||
else
|
||||
{
|
||||
$.ajax({
|
||||
type:"post",
|
||||
url: url,
|
||||
dataType: "json",
|
||||
async : false,
|
||||
fileElementId:'Icon',
|
||||
data: ({
|
||||
Number : $.trim($("#Number").val()),
|
||||
Name : $.trim($("#Name").val()),
|
||||
Type : $.trim($("#Type").val()),
|
||||
Icon : $("#Icon").val(),
|
||||
URL : $.trim($("#URL").val()),
|
||||
Width : $.trim($("#Width").val()),
|
||||
Height : $.trim($("#Height").val()),
|
||||
ReSize : $("#ReSize").is(':checked'),
|
||||
OpenMax : $("#OpenMax").is(':checked'),
|
||||
Flash : $("#Flash").is(':checked'),
|
||||
ZL : $.trim($("#ZL").val()),
|
||||
Sort : $.trim($("#Sort").val()),
|
||||
Remark : $.trim($("#Remark").val()),
|
||||
Enabled : $("#Enabled").is(':checked'),
|
||||
clientIp:'<%=clientIp %>'
|
||||
}),
|
||||
success: function (tipInfo)
|
||||
{
|
||||
if(tipInfo)
|
||||
{
|
||||
$('#appDlg').dialog('close');
|
||||
|
||||
var opts = $("#tableData").datagrid('options');
|
||||
showAppDetails(opts.pageNumber,opts.pageSize);
|
||||
}
|
||||
else
|
||||
{
|
||||
$.messager.show({
|
||||
title: '错误提示',
|
||||
msg: '保存应用信息失败,请稍后重试!'
|
||||
});
|
||||
}
|
||||
},
|
||||
//此处添加错误处理
|
||||
error:function()
|
||||
{
|
||||
$.messager.alert('提示','保存应用信息异常,请稍后再试!','error');
|
||||
return;
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
//编辑信息
|
||||
function editApp(appTotalInfo)
|
||||
{
|
||||
var appInfo = appTotalInfo.split("AaBb");
|
||||
$("#clientIp").val('<%=clientIp %>');
|
||||
$("#Number").focus().val(appInfo[1]);
|
||||
$("#Name").val(appInfo[2]);
|
||||
$("#Type").val(appInfo[3]);
|
||||
//$("#Icon").val(appInfo[4]);
|
||||
$("#URL").val(appInfo[5]);
|
||||
$("#Width").val(appInfo[6]);
|
||||
$("#Height").val(appInfo[7]);
|
||||
$("#ReSize").attr("checked",appInfo[8]=='true'?true:false);
|
||||
$("#OpenMax").attr("checked",appInfo[9]=='true'?true:false);
|
||||
$("#Flash").attr("checked",appInfo[10]=='true'?true:false);
|
||||
$("#ZL").val(appInfo[11]);
|
||||
$("#Sort").val(appInfo[12]);
|
||||
$("#Remark").val(appInfo[13]);
|
||||
$("#Enabled").attr("checked",appInfo[14]=='true'?true:false);
|
||||
|
||||
orgApp = appInfo[2];
|
||||
$('#appDlg').dialog('open').dialog('setTitle','<img src="<%=path%>/js/easyui-1.3.5/themes/icons/pencil.png"/> 编辑应用信息');
|
||||
$(".window-mask").css({ width: webW ,height: webH});
|
||||
appID = appInfo[0];
|
||||
//焦点在名称输入框==定焦在输入文字后面
|
||||
$("#name").val("").focus().val(appInfo[1]);
|
||||
url = '<%=path %>/app/update.action?appID=' + appInfo[0];
|
||||
}
|
||||
|
||||
//检查名称是否存在 ++ 重名无法提示问题需要跟进
|
||||
function checkAppName()
|
||||
{
|
||||
var name = $.trim($("#Name").val());
|
||||
//表示是否存在 true == 存在 false = 不存在
|
||||
var flag = false;
|
||||
//开始ajax名称检验,不能重名
|
||||
if(name.length > 0 &&( orgApp.length ==0 || name != orgApp))
|
||||
{
|
||||
$.ajax({
|
||||
type:"post",
|
||||
url: "<%=path %>/app/checkIsNameExist.action",
|
||||
dataType: "json",
|
||||
async : false,
|
||||
data: ({
|
||||
appID : appID,
|
||||
name : name
|
||||
}),
|
||||
success: function (tipInfo)
|
||||
{
|
||||
flag = tipInfo;
|
||||
if(tipInfo)
|
||||
{
|
||||
$.messager.alert('提示','应用名称已经存在','info');
|
||||
//alert("应用名称已经存在");
|
||||
//$("#name").val("");
|
||||
return;
|
||||
}
|
||||
},
|
||||
//此处添加错误处理
|
||||
error:function()
|
||||
{
|
||||
$.messager.alert('提示','检查应用名称是否存在异常,请稍后再试!','error');
|
||||
return;
|
||||
}
|
||||
});
|
||||
}
|
||||
return flag;
|
||||
}
|
||||
|
||||
//搜索处理
|
||||
$("#searchBtn").unbind().bind({
|
||||
click:function()
|
||||
{
|
||||
showAppDetails(1,initPageSize);
|
||||
var opts = $("#tableData").datagrid('options');
|
||||
var pager = $("#tableData").datagrid('getPager');
|
||||
opts.pageNumber = 1;
|
||||
opts.pageSize = initPageSize;
|
||||
pager.pagination('refresh',
|
||||
{
|
||||
pageNumber:1,
|
||||
pageSize:initPageSize
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
function showAppDetails(pageNo,pageSize)
|
||||
{
|
||||
$.ajax({
|
||||
type:"post",
|
||||
url: "<%=path %>/app/findBy.action",
|
||||
dataType: "json",
|
||||
data: ({
|
||||
Name:$.trim($("#searchName").val()),
|
||||
Type:$.trim($("#searchType").val()),
|
||||
pageNo:pageNo,
|
||||
pageSize:pageSize
|
||||
}),
|
||||
success: function (data)
|
||||
{
|
||||
$("#tableData").datagrid('loadData',data);
|
||||
},
|
||||
//此处添加错误处理
|
||||
error:function()
|
||||
{
|
||||
$.messager.alert('查询提示','查询数据后台异常,请稍后再试!','error');
|
||||
return;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
//重置按钮
|
||||
$("#searchResetBtn").unbind().bind({
|
||||
click:function(){
|
||||
$("#searchName").val("");
|
||||
$("#searchType").val("");
|
||||
|
||||
//加载完以后重新初始化
|
||||
$("#searchBtn").click();
|
||||
}
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
741
src/main/webapp/pages/manage/assetname.jsp
Normal file
741
src/main/webapp/pages/manage/assetname.jsp
Normal file
@@ -0,0 +1,741 @@
|
||||
<%@page import="com.jsh.util.Tools"%>
|
||||
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
|
||||
<%
|
||||
String path = request.getContextPath();
|
||||
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
|
||||
String clientIp = Tools.getCurrentUserIP();
|
||||
%>
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head>
|
||||
<title>资产管理</title>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
<!-- 指定以IE8的方式来渲染 -->
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE8"/>
|
||||
<link rel="shortcut icon" href="<%=path%>/images/favicon.ico" type="image/x-icon" />
|
||||
<link rel="stylesheet" type="text/css" href="<%=path %>/js/easyui-1.3.5/themes/default/easyui.css"/>
|
||||
<link rel="stylesheet" type="text/css" href="<%=path %>/js/easyui-1.3.5/themes/icon.css"/>
|
||||
<link type="text/css" rel="stylesheet" href="<%=path %>/css/common.css" />
|
||||
<script type="text/javascript" src="<%=path %>/js/jquery-1.8.0.min.js"></script>
|
||||
<script type="text/javascript" src="<%=path %>/js/easyui-1.3.5/jquery.easyui.min.js"></script>
|
||||
<script type="text/javascript" src="<%=path %>/js/easyui-1.3.5/locale/easyui-lang-zh_CN.js"></script>
|
||||
<script type="text/javascript" src="<%=path %>/js/common/common.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<div id="position" class="easyui-panel" title="当前位置:系统管理 > 资产名称" collapsible="false" closable="false"/>
|
||||
<!-- 查询 -->
|
||||
<div id = "searchPanel" class="easyui-panel" style="padding:10px;" title="查询窗口" iconCls="icon-search" collapsible="true" closable="false">
|
||||
<table id="searchTable">
|
||||
<tr>
|
||||
<td>类型名称:</td>
|
||||
<td>
|
||||
<input type="text" name="searchAssetName" id="searchAssetName" style="width:230px;"/>
|
||||
</td>
|
||||
<td> </td>
|
||||
<td> </td>
|
||||
<td>资产类型:</td>
|
||||
<td>
|
||||
<select name="searchCategory" id="searchCategory" style="width:230px;"/>
|
||||
</td>
|
||||
<td> </td>
|
||||
<td> </td>
|
||||
<td>是否耗材:</td>
|
||||
<td>
|
||||
<select name="searchConsume" id="searchConsume" style="width:230px;">
|
||||
<option value="">请选择</option>
|
||||
<option value="0">是</option>
|
||||
<option value="1">否</option>
|
||||
</select>
|
||||
</td>
|
||||
<td> </td>
|
||||
<td> </td>
|
||||
<td> </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td id="searchDescLabel">描 述:</td>
|
||||
<td>
|
||||
<input type="text" name="searchDesc" id="searchDesc" style="width:230px;"/>
|
||||
</td>
|
||||
<td> </td>
|
||||
<td> </td>
|
||||
<td> </td>
|
||||
<td>
|
||||
<a href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-search" id="searchBtn">查询</a>
|
||||
<a href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-redo" id="searchResetBtn">重置</a>
|
||||
</td>
|
||||
<td colspan="7"> </td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<!-- 数据显示table -->
|
||||
<div id = "tablePanel" class="easyui-panel" style="padding:1px;top:300px;" title="资产名称列表" iconCls="icon-list" collapsible="true" closable="false">
|
||||
<table id="tableData" style="top:300px;border-bottom-color:#FFFFFF"></table>
|
||||
</div>
|
||||
|
||||
<div id="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>
|
||||
<div class="fitem" style="padding:5px">
|
||||
<label id="assetNameLabel">资产名称 </label>
|
||||
<input name="assetName" id="assetName" class="easyui-validatebox" data-options="required:true,validType:'length[2,30]'" style="width: 230px;height: 20px"/>
|
||||
</div>
|
||||
<div class="fitem" style="padding:5px">
|
||||
<label id="categoryLabel">资产类型 </label>
|
||||
<select name="category" id="category" style="width:230px;height: 20px">
|
||||
</select>
|
||||
<img id="addCategory" src="<%=path %>/js/easyui-1.3.5/themes/icons/edit_add.png" style="cursor: pointer;" alt="增加资产类型" title="增加资产类型" />
|
||||
</div>
|
||||
<div class="fitem" style="padding:5px">
|
||||
<label id="consumableLabel">是否耗材 </label>
|
||||
<select name="consumable" id="consumable" style="width: 230px;height: 20px">
|
||||
<option value="0">是</option>
|
||||
<option value="1">否</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="fitem" style="padding:5px;">
|
||||
<label id="descriptionLabel">描 述 </label>
|
||||
<textarea name="description" id="description" rows="2" cols="2" style="width: 230px;"></textarea>
|
||||
</div>
|
||||
<input type="hidden" name="clientIp" id="clientIp" value="<%=clientIp %>"/>
|
||||
</form>
|
||||
</div>
|
||||
<div id="dlg-buttons">
|
||||
<a href="javascript:void(0)" id="saveAssetName" class="easyui-linkbutton" iconCls="icon-ok">保存</a>
|
||||
<a href="javascript:void(0)" id="cancelAssetName" class="easyui-linkbutton" iconCls="icon-cancel" onclick="javascript:$('#assetnameDlg').dialog('close')">取消</a>
|
||||
</div>
|
||||
<!--增加类型信息 -->
|
||||
<div id="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>
|
||||
<div class="fitem" style="padding:5px">
|
||||
<label id="categoryNameLabel">类型名称 </label>
|
||||
<input name="categoryName" id="categoryName" class="easyui-validatebox" data-options="required:true,validType:'length[2,30]'" style="width: 230px;height: 20px"/>
|
||||
</div>
|
||||
<div class="fitem" style="padding:5px;">
|
||||
<label id="catedescriptionLabel">描 述 </label>
|
||||
<textarea name="descriptioncate" id="descriptioncate" rows="2" cols="2" style="width: 230px;"></textarea>
|
||||
</div>
|
||||
<input type="hidden" name="clientIp" id="clientIp" value="<%=clientIp %>"/>
|
||||
</form>
|
||||
</div>
|
||||
<div id="dlg-buttons1">
|
||||
<a href="javascript:void(0)" id="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>
|
||||
</div>
|
||||
<script type="text/javascript">
|
||||
var categoryList = null;
|
||||
var categoryID = null;
|
||||
//初始化界面
|
||||
$(function()
|
||||
{
|
||||
//初始化系统基础信息
|
||||
initSystemData();
|
||||
initSelectInfo();
|
||||
initTableData();
|
||||
ininPager();
|
||||
initForm();
|
||||
browserFit();
|
||||
});
|
||||
|
||||
//浏览器适配
|
||||
function browserFit()
|
||||
{
|
||||
if(getOs()=='MSIE')
|
||||
{
|
||||
$("#searchDescLabel").empty().append("描 述:");
|
||||
$("#descriptionLabel").empty().append("描 述 ");
|
||||
$("#assetNameLabel").empty().append("资产名称 ");
|
||||
$("#categoryLabel").empty().append("资产类型 ");
|
||||
$("#consumableLabel").empty().append("是否耗材 ");
|
||||
|
||||
$("#categoryNameLabel").empty().append("类型名称 ");
|
||||
$("#catedescriptionLabel").empty().append("描 述 ");
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
$("#searchDescLabel").empty().append("描 述:");
|
||||
$("#descriptionLabel").empty().append("描 述 ");
|
||||
$("#assetNameLabel").empty().append("资产名称 ");
|
||||
$("#categoryLabel").empty().append("资产类型 ");
|
||||
$("#consumableLabel").empty().append("是否耗材 ");
|
||||
|
||||
$("#categoryNameLabel").empty().append("类型名称 ");
|
||||
$("#catedescriptionLabel").empty().append("描 述 ");
|
||||
}
|
||||
}
|
||||
|
||||
//初始化系统基础信息
|
||||
function initSystemData()
|
||||
{
|
||||
$.ajax({
|
||||
type:"post",
|
||||
url: "<%=path%>/asset/getBasicData.action",
|
||||
//设置为同步
|
||||
async:false,
|
||||
dataType: "json",
|
||||
success: function (systemInfo)
|
||||
{
|
||||
categoryList = systemInfo.showModel.map.categoryList;
|
||||
var msgTip = systemInfo.showModel.msgTip;
|
||||
if(msgTip == "exceptoin")
|
||||
{
|
||||
$.messager.alert('提示','查找系统基础信息异常,请与管理员联系!','error');
|
||||
return;
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
//初始化页面选项卡
|
||||
function initSelectInfo()
|
||||
{
|
||||
var options = "";
|
||||
|
||||
if(categoryList !=null)
|
||||
{
|
||||
options = "";
|
||||
for(var i = 0 ;i < categoryList.length;i ++)
|
||||
{
|
||||
var category = categoryList[i];
|
||||
if(0 == i)
|
||||
{
|
||||
categoryID = category.id;
|
||||
}
|
||||
options += '<option value="' + category.id + '">' + category.assetname + '</option>';
|
||||
}
|
||||
$("#category").empty().append(options);
|
||||
$("#searchCategory").empty().append('<option value="">请选择</option>').append(options);
|
||||
}
|
||||
}
|
||||
//防止表单提交重复
|
||||
function initForm()
|
||||
{
|
||||
$('#assetnameFM').form({
|
||||
onSubmit: function(){
|
||||
return false;
|
||||
}
|
||||
});
|
||||
|
||||
$('#categoryFM').form({
|
||||
onSubmit: function(){
|
||||
return false;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
//初始化表格数据
|
||||
function initTableData()
|
||||
{
|
||||
$('#tableData').datagrid({
|
||||
//title:'资产名称列表',
|
||||
//iconCls:'icon-save',
|
||||
//width:700,
|
||||
height:heightInfo,
|
||||
nowrap: false,
|
||||
rownumbers: false,
|
||||
//动画效果
|
||||
animate:false,
|
||||
//选中单行
|
||||
singleSelect : true,
|
||||
collapsible:false,
|
||||
selectOnCheck:false,
|
||||
//fitColumns:true,
|
||||
//单击行是否选中
|
||||
checkOnSelect : false,
|
||||
//交替出现背景
|
||||
striped : true,
|
||||
url:'<%=path %>/assetname/findBy.action?pageSize=' + initPageSize,
|
||||
pagination: true,
|
||||
//loadFilter: pagerFilter,
|
||||
pageSize: initPageSize,
|
||||
pageList: initPageNum,
|
||||
columns:[[
|
||||
{ field: 'id',width:35,align:"center",checkbox:true},
|
||||
{ title: '资产名称',field: 'assetname',width:200},
|
||||
{ title: '资产类型',field: 'category',width:200},
|
||||
{ title: '是否耗材',field: 'consumable',width:100,align:"center"},
|
||||
{ title: '描述',field: 'description',width:400},
|
||||
{ title: '操作',field: 'op',align:"center",width:130,formatter:function(value,rec)
|
||||
{
|
||||
var str = '';
|
||||
var rowInfo = rec.id + 'AaBb' + rec.assetname + 'AaBb' + rec.consumableStatus + 'AaBb' + rec.isystem + 'AaBb' + rec.description + 'AaBb' + rec.categoryID;
|
||||
if(1 == value)
|
||||
{
|
||||
str += '<img src="<%=path%>/js/easyui-1.3.5/themes/icons/pencil.png" style="cursor: pointer;" onclick="editAssetName(\'' + rowInfo + '\');"/> <a onclick="editAssetName(\'' + rowInfo + '\');" style="text-decoration:none;color:black;" href="javascript:void(0)">编辑</a> ';
|
||||
str += '<img src="<%=path%>/js/easyui-1.3.5/themes/icons/edit_remove.png" style="cursor: pointer;" onclick="deleteAssetName('+ rec.id +');"/> <a onclick="deleteAssetName('+ rec.id +');" style="text-decoration:none;color:black;" href="javascript:void(0)">删除</a> ';
|
||||
}
|
||||
return str;
|
||||
}
|
||||
}
|
||||
]],
|
||||
toolbar:[
|
||||
{
|
||||
id:'addAssetName',
|
||||
text:'增加',
|
||||
iconCls:'icon-add',
|
||||
handler:function()
|
||||
{
|
||||
addAssetName();
|
||||
}
|
||||
},
|
||||
{
|
||||
id:'deleteAssetName',
|
||||
text:'删除',
|
||||
iconCls:'icon-remove',
|
||||
handler:function()
|
||||
{
|
||||
batDeleteAssetName();
|
||||
}
|
||||
}
|
||||
],
|
||||
onLoadError:function()
|
||||
{
|
||||
$.messager.alert('页面加载提示','页面加载异常,请稍后再试!','error');
|
||||
return;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
//初始化键盘enter事件
|
||||
$(document).keydown(function(event)
|
||||
{
|
||||
//兼容 IE和firefox 事件
|
||||
var e = window.event || event;
|
||||
var k = e.keyCode||e.which||e.charCode;
|
||||
//兼容 IE,firefox 兼容
|
||||
var obj = e.srcElement ? e.srcElement : e.target;
|
||||
//绑定键盘事件为 id是指定的输入框才可以触发键盘事件 13键盘事件 ---遗留问题 enter键效验 对话框会关闭问题
|
||||
if(k == "13"&&(obj.id=="assetName"|| obj.id=="description"|| obj.id=="consumable" || obj.id=="category" ))
|
||||
{
|
||||
$("#saveAssetName").click();
|
||||
}
|
||||
|
||||
//绑定键盘事件为 id是指定的输入框才可以触发键盘事件 13键盘事件 ---遗留问题 enter键效验 对话框会关闭问题
|
||||
if(k == "13"&&(obj.id=="categoryName"|| obj.id=="description" ))
|
||||
{
|
||||
$("#saveCategory").click();
|
||||
}
|
||||
|
||||
//搜索按钮添加快捷键
|
||||
if(k == "13"&&(obj.id=="searchAssetName" || obj.id=="searchDesc" || obj.id=="searchCategory" ))
|
||||
{
|
||||
$("#searchBtn").click();
|
||||
}
|
||||
});
|
||||
|
||||
$("#addCategory").unbind().bind({
|
||||
click:function()
|
||||
{
|
||||
$("#clientIp").val('<%=clientIp %>');
|
||||
$("#categoryName").val("").focus();
|
||||
$("#descriptioncate").val("");
|
||||
$('#categoryDlg').dialog({width : 390}).dialog('open').dialog('setTitle','<img src="<%=path%>/js/easyui-1.3.5/themes/icons/edit_add.png"/> 增加资产类型信息');
|
||||
$("#categoryName").focus();
|
||||
}
|
||||
});
|
||||
|
||||
//保存信息
|
||||
$("#saveCategory").unbind().bind({
|
||||
click:function()
|
||||
{
|
||||
if(!$('#categoryFM').form('validate'))
|
||||
return;
|
||||
else if(checkCategoryName())
|
||||
return;
|
||||
else
|
||||
{
|
||||
$.ajax({
|
||||
type:"post",
|
||||
url: '<%=path %>/category/create.action',
|
||||
dataType: "json",
|
||||
async : false,
|
||||
data: ({
|
||||
categoryName : $.trim($("#categoryName").val()),
|
||||
description : $.trim($("#descriptioncate").val()),
|
||||
clientIp:'<%=clientIp %>'
|
||||
}),
|
||||
success: function (tipInfo)
|
||||
{
|
||||
if(tipInfo)
|
||||
{
|
||||
$('#categoryDlg').dialog('close');
|
||||
//初始化系统基础信息
|
||||
initSystemData();
|
||||
initSelectInfo();
|
||||
}
|
||||
else
|
||||
{
|
||||
$.messager.show({
|
||||
title: '错误提示',
|
||||
msg: '保存资产类别信息失败,请稍后重试!'
|
||||
});
|
||||
}
|
||||
},
|
||||
//此处添加错误处理
|
||||
error:function()
|
||||
{
|
||||
$.messager.alert('提示','保存资产类型信息异常,请稍后再试!','error');
|
||||
return;
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
//检查名称是否存在 ++ 重名无法提示问题需要跟进
|
||||
function checkCategoryName()
|
||||
{
|
||||
var categoryName = $.trim($("#categoryName").val());
|
||||
//表示是否存在 true == 存在 false = 不存在
|
||||
var flag = false;
|
||||
//开始ajax名称检验,不能重名
|
||||
if(categoryName.length > 0)
|
||||
{
|
||||
$.ajax({
|
||||
type:"post",
|
||||
url: "<%=path %>/category/checkIsNameExist.action",
|
||||
dataType: "json",
|
||||
async : false,
|
||||
data: ({
|
||||
categoryID : 0,
|
||||
categoryName : categoryName
|
||||
}),
|
||||
success: function (tipInfo)
|
||||
{
|
||||
flag = tipInfo;
|
||||
if(tipInfo)
|
||||
{
|
||||
$.messager.alert('提示','资产类型名称已经存在','info');
|
||||
//alert("资产名称名称已经存在");
|
||||
//$("#supplier").val("");
|
||||
return;
|
||||
}
|
||||
},
|
||||
//此处添加错误处理
|
||||
error:function()
|
||||
{
|
||||
$.messager.alert('提示','检查资产类型名称是否存在异常,请稍后再试!','error');
|
||||
return;
|
||||
}
|
||||
});
|
||||
}
|
||||
return flag;
|
||||
}
|
||||
|
||||
//分页信息处理
|
||||
function ininPager()
|
||||
{
|
||||
try
|
||||
{
|
||||
var opts = $("#tableData").datagrid('options');
|
||||
var pager = $("#tableData").datagrid('getPager');
|
||||
pager.pagination({
|
||||
onSelectPage:function(pageNum, pageSize)
|
||||
{
|
||||
opts.pageNumber = pageNum;
|
||||
opts.pageSize = pageSize;
|
||||
pager.pagination('refresh',
|
||||
{
|
||||
pageNumber:pageNum,
|
||||
pageSize:pageSize
|
||||
});
|
||||
showAssetNameDetails(pageNum,pageSize);
|
||||
}
|
||||
});
|
||||
}
|
||||
catch (e)
|
||||
{
|
||||
$.messager.alert('异常处理提示',"分页信息异常 : " + e.name + ": " + e.message,'error');
|
||||
}
|
||||
}
|
||||
|
||||
//删除资产名称信息
|
||||
function deleteAssetName(assetNameID)
|
||||
{
|
||||
$.messager.confirm('删除确认','确定要删除此资产名称信息吗?',function(r)
|
||||
{
|
||||
if (r)
|
||||
{
|
||||
$.ajax({
|
||||
type:"post",
|
||||
url: "<%=path %>/assetname/delete.action",
|
||||
dataType: "json",
|
||||
data: ({
|
||||
assetNameID : assetNameID,
|
||||
clientIp:'<%=clientIp %>'
|
||||
}),
|
||||
success: function (tipInfo)
|
||||
{
|
||||
var msg = tipInfo.showModel.msgTip;
|
||||
if(msg == '成功')
|
||||
{
|
||||
//加载完以后重新初始化
|
||||
$("#searchBtn").click();
|
||||
}
|
||||
else
|
||||
$.messager.alert('删除提示','删除资产名称信息失败,请稍后再试!','error');
|
||||
},
|
||||
//此处添加错误处理
|
||||
error:function()
|
||||
{
|
||||
$.messager.alert('删除提示','删除资产名称信息异常,请稍后再试!','error');
|
||||
return;
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
//批量删除资产名称
|
||||
function batDeleteAssetName()
|
||||
{
|
||||
var row = $('#tableData').datagrid('getChecked');
|
||||
if(row.length == 0)
|
||||
{
|
||||
$.messager.alert('删除提示','没有记录被选中!','info');
|
||||
return;
|
||||
}
|
||||
if(row.length > 0)
|
||||
{
|
||||
$.messager.confirm('删除确认','确定要删除选中的' + row.length + '条资产名称信息吗?',function(r)
|
||||
{
|
||||
if (r)
|
||||
{
|
||||
var ids = "";
|
||||
for(var i = 0;i < row.length; i ++)
|
||||
{
|
||||
if(i == row.length-1)
|
||||
{
|
||||
ids += row[i].id;
|
||||
break;
|
||||
}
|
||||
//alert(row[i].id);
|
||||
ids += row[i].id + ",";
|
||||
}
|
||||
$.ajax({
|
||||
type:"post",
|
||||
url: "<%=path %>/assetname/batchDelete.action",
|
||||
dataType: "json",
|
||||
async : false,
|
||||
data: ({
|
||||
assetNameIDs : ids,
|
||||
clientIp:'<%=clientIp %>'
|
||||
}),
|
||||
success: function (tipInfo)
|
||||
{
|
||||
var msg = tipInfo.showModel.msgTip;
|
||||
if(msg == '成功')
|
||||
{
|
||||
//加载完以后重新初始化
|
||||
$("#searchBtn").click();
|
||||
$(":checkbox").attr("checked",false);
|
||||
}
|
||||
else
|
||||
$.messager.alert('删除提示','删除资产名称信息失败,请稍后再试!','error');
|
||||
},
|
||||
//此处添加错误处理
|
||||
error:function()
|
||||
{
|
||||
$.messager.alert('删除提示','删除资产名称信息异常,请稍后再试!','error');
|
||||
return;
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
//增加
|
||||
var url;
|
||||
var assetNameID = 0;
|
||||
//保存编辑前的名称
|
||||
var orgAssetName = "";
|
||||
|
||||
function addAssetName()
|
||||
{
|
||||
$('#assetnameDlg').dialog({width : 390}).dialog('open')
|
||||
.dialog('setTitle','<img src="<%=path%>/js/easyui-1.3.5/themes/icons/edit_add.png"/> 增加资产名称信息');
|
||||
$(".window-mask").css({ width: webW ,height: webH});
|
||||
$('#assetnameFM').form('clear');
|
||||
var row = {
|
||||
consumable:0,
|
||||
clientIp:'<%=clientIp %>',
|
||||
category:categoryID
|
||||
};
|
||||
$('#assetnameFM').form('load',row);
|
||||
$("#assetName").focus();
|
||||
orgAssetName = "";
|
||||
assetNameID = 0;
|
||||
url = '<%=path %>/assetname/create.action';
|
||||
}
|
||||
|
||||
//保存信息
|
||||
$("#saveAssetName").unbind().bind({
|
||||
click:function()
|
||||
{
|
||||
if(!$('#assetnameFM').form('validate'))
|
||||
return;
|
||||
else if(checkAssetName())
|
||||
return;
|
||||
else
|
||||
{
|
||||
$.ajax({
|
||||
type:"post",
|
||||
url: url,
|
||||
dataType: "json",
|
||||
async : false,
|
||||
data: ({
|
||||
assetName : $.trim($("#assetName").val()),
|
||||
consumable : $("#consumable").val(),
|
||||
description : $.trim($("#description").val()),
|
||||
clientIp:'<%=clientIp %>',
|
||||
categoryID: $.trim($("#category").val()),
|
||||
}),
|
||||
success: function (tipInfo)
|
||||
{
|
||||
if(tipInfo)
|
||||
{
|
||||
$('#assetnameDlg').dialog('close');
|
||||
|
||||
var opts = $("#tableData").datagrid('options');
|
||||
showAssetNameDetails(opts.pageNumber,opts.pageSize);
|
||||
}
|
||||
else
|
||||
{
|
||||
$.messager.show({
|
||||
title: '错误提示',
|
||||
msg: '保存资产名称信息失败,请稍后重试!'
|
||||
});
|
||||
}
|
||||
},
|
||||
//此处添加错误处理
|
||||
error:function()
|
||||
{
|
||||
$.messager.alert('提示','保存资产名称信息异常,请稍后再试!','error');
|
||||
return;
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
//编辑信息
|
||||
function editAssetName(assetNameTotalInfo)
|
||||
{
|
||||
var assetnameInfo = assetNameTotalInfo.split("AaBb");
|
||||
var row = {
|
||||
assetName : assetnameInfo[1],
|
||||
consumable : assetnameInfo[2],
|
||||
description : assetnameInfo[4],
|
||||
clientIp:'<%=clientIp %>',
|
||||
category:assetnameInfo[5]
|
||||
};
|
||||
|
||||
orgAssetName = assetnameInfo[1];
|
||||
|
||||
$('#assetnameDlg').dialog({width : 390}).dialog('open')
|
||||
.dialog('setTitle','<img src="<%=path%>/js/easyui-1.3.5/themes/icons/pencil.png"/> 编辑资产名称信息');
|
||||
$(".window-mask").css({ width: webW ,height: webH});
|
||||
$('#assetnameFM').form('load',row);
|
||||
assetNameID = assetnameInfo[0];
|
||||
//焦点在名称输入框==定焦在输入文字后面
|
||||
$("#assetName").val("").focus().val(assetnameInfo[1]);
|
||||
url = '<%=path %>/assetname/update.action?assetNameID=' + assetnameInfo[0];
|
||||
}
|
||||
|
||||
//检查名称是否存在 ++ 重名无法提示问题需要跟进
|
||||
function checkAssetName()
|
||||
{
|
||||
var assetName = $.trim($("#assetName").val());
|
||||
//表示是否存在 true == 存在 false = 不存在
|
||||
var flag = false;
|
||||
//开始ajax名称检验,不能重名
|
||||
if(assetName.length > 0 &&( orgAssetName.length ==0 || assetName != orgAssetName))
|
||||
{
|
||||
$.ajax({
|
||||
type:"post",
|
||||
url: "<%=path %>/assetname/checkIsNameExist.action",
|
||||
dataType: "json",
|
||||
async : false,
|
||||
data: ({
|
||||
assetNameID : assetNameID,
|
||||
assetName : assetName
|
||||
}),
|
||||
success: function (tipInfo)
|
||||
{
|
||||
flag = tipInfo;
|
||||
if(tipInfo)
|
||||
{
|
||||
$.messager.alert('提示','资产名称已经存在','info');
|
||||
return;
|
||||
}
|
||||
},
|
||||
//此处添加错误处理
|
||||
error:function()
|
||||
{
|
||||
$.messager.alert('提示','检查资产名称是否存在异常,请稍后再试!','error');
|
||||
return;
|
||||
}
|
||||
});
|
||||
}
|
||||
return flag;
|
||||
}
|
||||
|
||||
//搜索处理
|
||||
$("#searchBtn").unbind().bind({
|
||||
click:function()
|
||||
{
|
||||
showAssetNameDetails(1,initPageSize);
|
||||
var opts = $("#tableData").datagrid('options');
|
||||
var pager = $("#tableData").datagrid('getPager');
|
||||
opts.pageNumber = 1;
|
||||
opts.pageSize = initPageSize;
|
||||
pager.pagination('refresh',
|
||||
{
|
||||
pageNumber:1,
|
||||
pageSize:initPageSize
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
function showAssetNameDetails(pageNo,pageSize)
|
||||
{
|
||||
$.ajax({
|
||||
type:"post",
|
||||
url: "<%=path %>/assetname/findBy.action",
|
||||
dataType: "json",
|
||||
data: ({
|
||||
assetName:$.trim($("#searchAssetName").val()),
|
||||
description:$.trim($("#searchDesc").val()),
|
||||
categoryID : $("#searchCategory").val(),
|
||||
consumable : $("#searchConsume").val(),
|
||||
pageNo:pageNo,
|
||||
pageSize:pageSize
|
||||
}),
|
||||
success: function (data)
|
||||
{
|
||||
$("#tableData").datagrid('loadData',data);
|
||||
},
|
||||
//此处添加错误处理
|
||||
error:function()
|
||||
{
|
||||
$.messager.alert('查询提示','查询数据后台异常,请稍后再试!','error');
|
||||
return;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
//重置按钮
|
||||
$("#searchResetBtn").unbind().bind({
|
||||
click:function(){
|
||||
$("#searchAssetName").val("");
|
||||
$("#searchDesc").val("");
|
||||
$("#searchCategory").val("");
|
||||
$("#searchConsume").val("");
|
||||
|
||||
//加载完以后重新初始化
|
||||
$("#searchBtn").click();
|
||||
}
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
505
src/main/webapp/pages/manage/category.jsp
Normal file
505
src/main/webapp/pages/manage/category.jsp
Normal file
@@ -0,0 +1,505 @@
|
||||
<%@page import="com.jsh.util.Tools"%>
|
||||
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
|
||||
<%
|
||||
String path = request.getContextPath();
|
||||
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
|
||||
String clientIp = Tools.getCurrentUserIP();
|
||||
%>
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>资产管理</title>
|
||||
<meta charset="utf-8" />
|
||||
<!-- 指定以IE8的方式来渲染 -->
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE8"/>
|
||||
<link rel="shortcut icon" href="<%=path%>/images/favicon.ico" type="image/x-icon" />
|
||||
<link rel="stylesheet" type="text/css" href="<%=path %>/js/easyui-1.3.5/themes/default/easyui.css"/>
|
||||
<link rel="stylesheet" type="text/css" href="<%=path %>/js/easyui-1.3.5/themes/icon.css"/>
|
||||
<link type="text/css" rel="stylesheet" href="<%=path %>/css/common.css" />
|
||||
<script type="text/javascript" src="<%=path %>/js/jquery-1.8.0.min.js"></script>
|
||||
<script type="text/javascript" src="<%=path %>/js/easyui-1.3.5/jquery.easyui.min.js"></script>
|
||||
<script type="text/javascript" src="<%=path %>/js/easyui-1.3.5/locale/easyui-lang-zh_CN.js"></script>
|
||||
<script type="text/javascript" src="<%=path %>/js/common/common.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<div id="position" class="easyui-panel" title="当前位置:系统管理 > 资产类型" collapsible="false" closable="false"/>
|
||||
<!-- 查询 -->
|
||||
<div id = "searchPanel" class="easyui-panel" style="padding:10px;" title="查询窗口" iconCls="icon-search" collapsible="true" closable="false">
|
||||
<table id="searchTable">
|
||||
<tr>
|
||||
<td>类型名称:</td>
|
||||
<td>
|
||||
<input type="text" name="searchCategory" id="searchCategory" style="width:230px;"/>
|
||||
</td>
|
||||
<td> </td>
|
||||
<td> </td>
|
||||
<td id="searchDescLabel">描 述:</td>
|
||||
<td>
|
||||
<input type="text" name="searchDesc" id="searchDesc" style="width:230px;"/>
|
||||
</td>
|
||||
<td> </td>
|
||||
<td> </td>
|
||||
<td> </td>
|
||||
<td>
|
||||
<a href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-search" id="searchBtn">查询</a>
|
||||
<a href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-redo" id="searchResetBtn">重置</a>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<!-- 数据显示table -->
|
||||
<div id = "tablePanel" class="easyui-panel" style="padding:1px;top:300px;" title="类型列表" iconCls="icon-list" collapsible="true" closable="false">
|
||||
<table id="tableData" style="top:300px;border-bottom-color:#FFFFFF"></table>
|
||||
</div>
|
||||
|
||||
<div id="categoryDlg" class="easyui-dialog" style="width:380px;padding:10px 20px"
|
||||
closed="true" buttons="#dlg-buttons" modal="true" cache="false" collapsible="false" closable="true">
|
||||
<form id="categoryFM" method="post" novalidate>
|
||||
<div class="fitem" style="padding:5px">
|
||||
<label id="categoryNameLabel">类型名称 </label>
|
||||
<input name="categoryName" id="categoryName" class="easyui-validatebox" data-options="required:true,validType:'length[2,30]'" style="width: 230px;height: 20px"/>
|
||||
</div>
|
||||
<div class="fitem" style="padding:5px;">
|
||||
<label id="descriptionLabel">描 述 </label>
|
||||
<textarea name="description" id="description" rows="2" cols="2" style="width: 230px;"></textarea>
|
||||
</div>
|
||||
<input type="hidden" name="clientIp" id="clientIp" value="<%=clientIp %>"/>
|
||||
</form>
|
||||
</div>
|
||||
<div id="dlg-buttons">
|
||||
<a href="javascript:void(0)" id="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>
|
||||
</div>
|
||||
|
||||
<script type="text/javascript">
|
||||
//初始化界面
|
||||
$(function()
|
||||
{
|
||||
initTableData();
|
||||
ininPager();
|
||||
initForm();
|
||||
browserFit();
|
||||
});
|
||||
|
||||
//浏览器适配
|
||||
function browserFit()
|
||||
{
|
||||
if(getOs()=='MSIE')
|
||||
{
|
||||
$("#searchDescLabel").empty().append("描 述:");
|
||||
$("#categoryNameLabel").empty().append("类型名称 ");
|
||||
$("#descriptionLabel").empty().append("描 述 ");
|
||||
}
|
||||
else
|
||||
{
|
||||
$("#searchDescLabel").empty().append("描 述:");
|
||||
$("#categoryNameLabel").empty().append("类型名称 ");
|
||||
$("#descriptionLabel").empty().append("描 述 ");
|
||||
}
|
||||
}
|
||||
|
||||
//防止表单提交重复
|
||||
function initForm()
|
||||
{
|
||||
$('#categoryFM').form({
|
||||
onSubmit: function(){
|
||||
return false;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
//初始化表格数据
|
||||
function initTableData()
|
||||
{
|
||||
$('#tableData').datagrid({
|
||||
//title:'供应商列表',
|
||||
//iconCls:'icon-save',
|
||||
//width:700,
|
||||
height:heightInfo,
|
||||
nowrap: false,
|
||||
rownumbers: false,
|
||||
//动画效果
|
||||
animate:false,
|
||||
//选中单行
|
||||
singleSelect : true,
|
||||
collapsible:false,
|
||||
selectOnCheck:false,
|
||||
//fitColumns:true,
|
||||
//单击行是否选中
|
||||
checkOnSelect : false,
|
||||
url:'<%=path %>/category/findBy.action?pageSize=' + initPageSize,
|
||||
pagination: true,
|
||||
//交替出现背景
|
||||
striped : true,
|
||||
//loadFilter: pagerFilter,
|
||||
pageSize: initPageSize,
|
||||
pageList: initPageNum,
|
||||
columns:[[
|
||||
{ field: 'id',width:35,align:"center",checkbox:true},
|
||||
{ title: '资产类型',field: 'categoryname',width:200},
|
||||
{ title: '描述',field: 'description',width:400},
|
||||
{ title: '操作',field: 'op',align:"center",width:130,formatter:function(value,rec)
|
||||
{
|
||||
var str = '';
|
||||
var rowInfo = rec.id + 'AaBb' + rec.categoryname + 'AaBb' + rec.isystem + 'AaBb' + rec.description;
|
||||
if(1 == value)
|
||||
{
|
||||
str += '<img src="<%=path%>/js/easyui-1.3.5/themes/icons/pencil.png" style="cursor: pointer;" onclick="editCategory(\'' + rowInfo + '\');"/> <a onclick="editCategory(\'' + rowInfo + '\');" style="text-decoration:none;color:black;" href="javascript:void(0)">编辑</a> ';
|
||||
str += '<img src="<%=path%>/js/easyui-1.3.5/themes/icons/edit_remove.png" style="cursor: pointer;" onclick="deleteCategory('+ rec.id +');"/> <a onclick="deleteCategory('+ rec.id +');" style="text-decoration:none;color:black;" href="javascript:void(0)">删除</a> ';
|
||||
}
|
||||
return str;
|
||||
}
|
||||
}
|
||||
]],
|
||||
toolbar:[
|
||||
{
|
||||
id:'addSupplier',
|
||||
text:'增加',
|
||||
iconCls:'icon-add',
|
||||
handler:function()
|
||||
{
|
||||
addCategory();
|
||||
}
|
||||
},
|
||||
{
|
||||
id:'deleteSupplier',
|
||||
text:'删除',
|
||||
iconCls:'icon-remove',
|
||||
handler:function()
|
||||
{
|
||||
batDeleteCategory();
|
||||
}
|
||||
}
|
||||
],
|
||||
onLoadError:function()
|
||||
{
|
||||
$.messager.alert('页面加载提示','页面加载异常,请稍后再试!','error');
|
||||
return;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
//初始化键盘enter事件
|
||||
$(document).keydown(function(event)
|
||||
{
|
||||
//兼容 IE和firefox 事件
|
||||
var e = window.event || event;
|
||||
var k = e.keyCode||e.which||e.charCode;
|
||||
//兼容 IE,firefox 兼容
|
||||
var obj = e.srcElement ? e.srcElement : e.target;
|
||||
//绑定键盘事件为 id是指定的输入框才可以触发键盘事件 13键盘事件 ---遗留问题 enter键效验 对话框会关闭问题
|
||||
if(k == "13"&&(obj.id=="categoryName"|| obj.id=="description" ))
|
||||
{
|
||||
$("#saveCategory").click();
|
||||
}
|
||||
//搜索按钮添加快捷键
|
||||
if(k == "13"&&(obj.id=="searchCategory" || obj.id=="searchDesc" ))
|
||||
{
|
||||
$("#searchBtn").click();
|
||||
}
|
||||
});
|
||||
//分页信息处理
|
||||
function ininPager()
|
||||
{
|
||||
try
|
||||
{
|
||||
var opts = $("#tableData").datagrid('options');
|
||||
var pager = $("#tableData").datagrid('getPager');
|
||||
pager.pagination({
|
||||
onSelectPage:function(pageNum, pageSize)
|
||||
{
|
||||
opts.pageNumber = pageNum;
|
||||
opts.pageSize = pageSize;
|
||||
pager.pagination('refresh',
|
||||
{
|
||||
pageNumber:pageNum,
|
||||
pageSize:pageSize
|
||||
});
|
||||
showCategoryDetails(pageNum,pageSize);
|
||||
}
|
||||
});
|
||||
}
|
||||
catch (e)
|
||||
{
|
||||
$.messager.alert('异常处理提示',"分页信息异常 : " + e.name + ": " + e.message,'error');
|
||||
}
|
||||
}
|
||||
|
||||
//删除供应商信息
|
||||
function deleteCategory(categoryID)
|
||||
{
|
||||
$.messager.confirm('删除确认','确定要删除此资产类型信息吗?',function(r)
|
||||
{
|
||||
if (r)
|
||||
{
|
||||
$.ajax({
|
||||
type:"post",
|
||||
url: "<%=path %>/category/delete.action",
|
||||
dataType: "json",
|
||||
data: ({
|
||||
categoryID : categoryID,
|
||||
clientIp:'<%=clientIp %>'
|
||||
}),
|
||||
success: function (tipInfo)
|
||||
{
|
||||
var msg = tipInfo.showModel.msgTip;
|
||||
if(msg == '成功')
|
||||
{
|
||||
//加载完以后重新初始化
|
||||
$("#searchBtn").click();
|
||||
}
|
||||
else
|
||||
$.messager.alert('删除提示','删除资产类别信息失败,请稍后再试!','error');
|
||||
},
|
||||
//此处添加错误处理
|
||||
error:function()
|
||||
{
|
||||
$.messager.alert('删除提示','删除资产类别信息异常,请稍后再试!','error');
|
||||
return;
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
//批量删除供应商
|
||||
function batDeleteCategory()
|
||||
{
|
||||
var row = $('#tableData').datagrid('getChecked');
|
||||
if(row.length == 0)
|
||||
{
|
||||
$.messager.alert('删除提示','没有记录被选中!','info');
|
||||
return;
|
||||
}
|
||||
if(row.length > 0)
|
||||
{
|
||||
$.messager.confirm('删除确认','确定要删除选中的' + row.length + '条资产类别信息吗?',function(r)
|
||||
{
|
||||
if (r)
|
||||
{
|
||||
var ids = "";
|
||||
for(var i = 0;i < row.length; i ++)
|
||||
{
|
||||
if(i == row.length-1)
|
||||
{
|
||||
ids += row[i].id;
|
||||
break;
|
||||
}
|
||||
//alert(row[i].id);
|
||||
ids += row[i].id + ",";
|
||||
}
|
||||
$.ajax({
|
||||
type:"post",
|
||||
url: "<%=path %>/category/batchDelete.action",
|
||||
dataType: "json",
|
||||
async : false,
|
||||
data: ({
|
||||
categoryIDs : ids,
|
||||
clientIp:'<%=clientIp %>'
|
||||
}),
|
||||
success: function (tipInfo)
|
||||
{
|
||||
var msg = tipInfo.showModel.msgTip;
|
||||
if(msg == '成功')
|
||||
{
|
||||
//加载完以后重新初始化
|
||||
$("#searchBtn").click();
|
||||
$(":checkbox").attr("checked",false);
|
||||
}
|
||||
else
|
||||
$.messager.alert('删除提示','删除资产类别信息失败,请稍后再试!','error');
|
||||
},
|
||||
//此处添加错误处理
|
||||
error:function()
|
||||
{
|
||||
$.messager.alert('删除提示','删除资产类别信息异常,请稍后再试!','error');
|
||||
return;
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
//增加
|
||||
var url;
|
||||
var categoryID = 0;
|
||||
//保存编辑前的名称
|
||||
var orgCategory = "";
|
||||
|
||||
function addCategory()
|
||||
{
|
||||
$("#clientIp").val('<%=clientIp %>');
|
||||
$("#description").val("");
|
||||
$('#categoryDlg').dialog('open').dialog('setTitle','<img src="<%=path%>/js/easyui-1.3.5/themes/icons/edit_add.png"/> 增加资产类型信息');
|
||||
$(".window-mask").css({ width: webW ,height: webH});
|
||||
$("#categoryName").val("").focus();
|
||||
//$('#categoryFM').form('clear');
|
||||
|
||||
orgCategory = "";
|
||||
categoryID = 0;
|
||||
url = '<%=path %>/category/create.action';
|
||||
}
|
||||
|
||||
//保存信息
|
||||
$("#saveCategory").unbind().bind({
|
||||
click:function()
|
||||
{
|
||||
if(!$('#categoryFM').form('validate'))
|
||||
return;
|
||||
else if(checkCategoryName())
|
||||
return;
|
||||
else
|
||||
{
|
||||
$.ajax({
|
||||
type:"post",
|
||||
url: url,
|
||||
dataType: "json",
|
||||
async : false,
|
||||
data: ({
|
||||
categoryName : $.trim($("#categoryName").val()),
|
||||
description : $.trim($("#description").val()),
|
||||
clientIp:'<%=clientIp %>'
|
||||
}),
|
||||
success: function (tipInfo)
|
||||
{
|
||||
if(tipInfo)
|
||||
{
|
||||
$('#categoryDlg').dialog('close');
|
||||
|
||||
var opts = $("#tableData").datagrid('options');
|
||||
showCategoryDetails(opts.pageNumber,opts.pageSize);
|
||||
}
|
||||
else
|
||||
{
|
||||
$.messager.show({
|
||||
title: '错误提示',
|
||||
msg: '保存资产类别信息失败,请稍后重试!'
|
||||
});
|
||||
}
|
||||
},
|
||||
//此处添加错误处理
|
||||
error:function()
|
||||
{
|
||||
$.messager.alert('提示','保存资产类型信息异常,请稍后再试!','error');
|
||||
return;
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
//编辑信息
|
||||
function editCategory(categoryTotalInfo)
|
||||
{
|
||||
var categoryInfo = categoryTotalInfo.split("AaBb");
|
||||
|
||||
$("#clientIp").val('<%=clientIp %>');
|
||||
$("#categoryName").focus().val(categoryInfo[1]);
|
||||
$("#description").val(categoryInfo[3]);
|
||||
|
||||
orgCategory = categoryInfo[1];
|
||||
$('#categoryDlg').dialog('open').dialog('setTitle','<img src="<%=path%>/js/easyui-1.3.5/themes/icons/pencil.png"/> 编辑资产类型信息');
|
||||
$(".window-mask").css({ width: webW ,height: webH});
|
||||
categoryID = categoryInfo[0];
|
||||
//焦点在名称输入框==定焦在输入文字后面
|
||||
$("#categoryName").val("").focus().val(categoryInfo[1]);
|
||||
url = '<%=path %>/category/update.action?categoryID=' + categoryInfo[0];
|
||||
}
|
||||
|
||||
//检查名称是否存在 ++ 重名无法提示问题需要跟进
|
||||
function checkCategoryName()
|
||||
{
|
||||
var categoryName = $.trim($("#categoryName").val());
|
||||
//表示是否存在 true == 存在 false = 不存在
|
||||
var flag = false;
|
||||
//开始ajax名称检验,不能重名
|
||||
if(categoryName.length > 0 &&( orgCategory.length ==0 || categoryName != orgCategory))
|
||||
{
|
||||
$.ajax({
|
||||
type:"post",
|
||||
url: "<%=path %>/category/checkIsNameExist.action",
|
||||
dataType: "json",
|
||||
async : false,
|
||||
data: ({
|
||||
categoryID : categoryID,
|
||||
categoryName : categoryName
|
||||
}),
|
||||
success: function (tipInfo)
|
||||
{
|
||||
flag = tipInfo;
|
||||
if(tipInfo)
|
||||
{
|
||||
$.messager.alert('提示','资产类型名称已经存在','info');
|
||||
//alert("供应商名称已经存在");
|
||||
//$("#supplier").val("");
|
||||
return;
|
||||
}
|
||||
},
|
||||
//此处添加错误处理
|
||||
error:function()
|
||||
{
|
||||
$.messager.alert('提示','检查资产类型名称是否存在异常,请稍后再试!','error');
|
||||
return;
|
||||
}
|
||||
});
|
||||
}
|
||||
return flag;
|
||||
}
|
||||
|
||||
//搜索处理
|
||||
$("#searchBtn").unbind().bind({
|
||||
click:function()
|
||||
{
|
||||
showCategoryDetails(1,initPageSize);
|
||||
var opts = $("#tableData").datagrid('options');
|
||||
var pager = $("#tableData").datagrid('getPager');
|
||||
opts.pageNumber = 1;
|
||||
opts.pageSize = initPageSize;
|
||||
pager.pagination('refresh',
|
||||
{
|
||||
pageNumber:1,
|
||||
pageSize:initPageSize
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
function showCategoryDetails(pageNo,pageSize)
|
||||
{
|
||||
$.ajax({
|
||||
type:"post",
|
||||
url: "<%=path %>/category/findBy.action",
|
||||
dataType: "json",
|
||||
data: ({
|
||||
categoryName:$.trim($("#searchCategory").val()),
|
||||
description:$.trim($("#searchDesc").val()),
|
||||
pageNo:pageNo,
|
||||
pageSize:pageSize
|
||||
}),
|
||||
success: function (data)
|
||||
{
|
||||
$("#tableData").datagrid('loadData',data);
|
||||
},
|
||||
//此处添加错误处理
|
||||
error:function()
|
||||
{
|
||||
$.messager.alert('查询提示','查询数据后台异常,请稍后再试!','error');
|
||||
return;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
//重置按钮
|
||||
$("#searchResetBtn").unbind().bind({
|
||||
click:function(){
|
||||
$("#searchCategory").val("");
|
||||
$("#searchDesc").val("");
|
||||
|
||||
//加载完以后重新初始化
|
||||
$("#searchBtn").click();
|
||||
}
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
528
src/main/webapp/pages/manage/depot.jsp
Normal file
528
src/main/webapp/pages/manage/depot.jsp
Normal file
@@ -0,0 +1,528 @@
|
||||
<%@page import="com.jsh.util.Tools"%>
|
||||
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
|
||||
<%
|
||||
String path = request.getContextPath();
|
||||
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
|
||||
String clientIp = Tools.getCurrentUserIP();
|
||||
%>
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>部门管理</title>
|
||||
<meta charset="utf-8">
|
||||
<!-- 指定以IE8的方式来渲染 -->
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE8"/>
|
||||
<link rel="shortcut icon" href="<%=path%>/images/favicon.ico" type="image/x-icon" />
|
||||
<link rel="stylesheet" type="text/css" href="<%=path %>/js/easyui-1.3.5/themes/default/easyui.css"/>
|
||||
<link rel="stylesheet" type="text/css" href="<%=path %>/js/easyui-1.3.5/themes/icon.css"/>
|
||||
<link type="text/css" rel="stylesheet" href="<%=path %>/css/common.css" />
|
||||
<script type="text/javascript" src="<%=path %>/js/jquery-1.8.0.min.js"></script>
|
||||
<script type="text/javascript" src="<%=path %>/js/easyui-1.3.5/jquery.easyui.min.js"></script>
|
||||
<script type="text/javascript" src="<%=path %>/js/easyui-1.3.5/locale/easyui-lang-zh_CN.js"></script>
|
||||
<script type="text/javascript" src="<%=path %>/js/common/common.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<!-- 查询 -->
|
||||
<div id = "searchPanel" class="easyui-panel" style="padding:10px;" title="查询窗口" iconCls="icon-search" collapsible="true" closable="false">
|
||||
<table id="searchTable">
|
||||
<tr>
|
||||
<td>仓库名称:</td>
|
||||
<td>
|
||||
<input type="text" name="searchName" id="searchName" style="width:150px;"/>
|
||||
</td>
|
||||
<td> </td>
|
||||
<td> </td>
|
||||
<td id="searchRemarkLabel">描 述:</td>
|
||||
<td>
|
||||
<input type="text" name="searchRemark" id="searchRemark" style="width:150px;"/>
|
||||
</td>
|
||||
<td> </td>
|
||||
<td> </td>
|
||||
<td> </td>
|
||||
<td>
|
||||
<a href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-search" id="searchBtn">查询</a>
|
||||
<a href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-redo" id="searchResetBtn">重置</a>
|
||||
<a href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-redo" id="setBuilding">查看单元</a>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<!-- 数据显示table -->
|
||||
<div id = "tablePanel" class="easyui-panel" style="padding:1px;top:300px;" title="仓库列表" iconCls="icon-list" collapsible="true" closable="false">
|
||||
<table id="tableData" style="top:300px;border-bottom-color:#FFFFFF"></table>
|
||||
</div>
|
||||
|
||||
<div id="depotDlg" class="easyui-dialog" style="width:380px;padding:10px 20px"
|
||||
closed="true" buttons="#dlg-buttons" modal="true" cache="false" collapsible="false" closable="true">
|
||||
<form id="depotFM" method="post" novalidate>
|
||||
<table>
|
||||
<tr>
|
||||
<td><label id="nameLabel">仓库名称 </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>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><label id="sortLabel">排 序 </label></td>
|
||||
<td style="padding:5px"><input name="sort" id="sort" class="easyui-textbox" style="width: 230px;height: 20px"/></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><label id="remarkLabel">描 述 </label></td>
|
||||
<td style="padding:5px"><textarea name="remark" id="remark" rows="2" cols="2" style="width: 230px;"></textarea></td>
|
||||
</tr>
|
||||
</table>
|
||||
<input type="hidden" name="clientIp" id="clientIp" value="<%=clientIp %>"/>
|
||||
</form>
|
||||
</div>
|
||||
<div id="dlg-buttons">
|
||||
<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>
|
||||
</div>
|
||||
|
||||
<script type="text/javascript">
|
||||
//初始化界面
|
||||
$(function()
|
||||
{
|
||||
initTableData();
|
||||
ininPager();
|
||||
initForm();
|
||||
browserFit();
|
||||
});
|
||||
|
||||
//浏览器适配
|
||||
function browserFit()
|
||||
{
|
||||
if(getOs()=='MSIE')
|
||||
{
|
||||
$("#searchRemarkLabel").empty().append("描 述:");
|
||||
$("#nameLabel").empty().append("仓库名称 ");
|
||||
$("#sortLabel").empty().append("排 序 ");
|
||||
$("#remarkLabel").empty().append("描 述 ");
|
||||
}
|
||||
else
|
||||
{
|
||||
$("#searchRemarkLabel").empty().append("描 述:");
|
||||
$("#nameLabel").empty().append("仓库名称 ");
|
||||
$("#sortLabel").empty().append("排 序 ");
|
||||
$("#remarkLabel").empty().append("描 述 ");
|
||||
}
|
||||
}
|
||||
|
||||
//防止表单提交重复
|
||||
function initForm()
|
||||
{
|
||||
$('#depotFM').form({
|
||||
onSubmit: function(){
|
||||
return false;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
//初始化表格数据
|
||||
function initTableData()
|
||||
{
|
||||
$('#tableData').datagrid({
|
||||
//title:'仓库列表',
|
||||
//iconCls:'icon-save',
|
||||
//width:700,
|
||||
height:heightInfo,
|
||||
nowrap: false,
|
||||
rownumbers: false,
|
||||
//动画效果
|
||||
animate:false,
|
||||
//选中单行
|
||||
singleSelect : true,
|
||||
collapsible:false,
|
||||
selectOnCheck:false,
|
||||
//fitColumns:true,
|
||||
//单击行是否选中
|
||||
checkOnSelect : false,
|
||||
url:'<%=path %>/depot/findBy.action?pageSize=' + initPageSize,
|
||||
pagination: true,
|
||||
//交替出现背景
|
||||
striped : true,
|
||||
//loadFilter: pagerFilter,
|
||||
pageSize: initPageSize,
|
||||
pageList: initPageNum,
|
||||
columns:[[
|
||||
{ field: 'id',width:35,align:"center",checkbox:true},
|
||||
{ title: '仓库名称',field: 'name',width:200},
|
||||
{ title: '排序',field: 'sort',width:200},
|
||||
{ title: '描述',field: 'remark',width:200},
|
||||
{ title: '操作',field: 'op',align:"center",width:130,formatter:function(value,rec)
|
||||
{
|
||||
var str = '';
|
||||
var rowInfo = rec.id + 'AaBb' + rec.name + 'AaBb' + rec.sort + 'AaBb' + rec.remark;
|
||||
if(1 == value)
|
||||
{
|
||||
str += '<img src="<%=path%>/js/easyui-1.3.5/themes/icons/pencil.png" style="cursor: pointer;" onclick="editDepot(\'' + rowInfo + '\');"/> <a onclick="editDepot(\'' + rowInfo + '\');" style="text-decoration:none;color:black;" href="javascript:void(0)">编辑</a> ';
|
||||
str += '<img src="<%=path%>/js/easyui-1.3.5/themes/icons/edit_remove.png" style="cursor: pointer;" onclick="deleteDepot('+ rec.id +');"/> <a onclick="deleteDepot('+ rec.id +');" style="text-decoration:none;color:black;" href="javascript:void(0)">删除</a> ';
|
||||
}
|
||||
return str;
|
||||
}
|
||||
}
|
||||
]],
|
||||
toolbar:[
|
||||
{
|
||||
id:'addDepot',
|
||||
text:'增加',
|
||||
iconCls:'icon-add',
|
||||
handler:function()
|
||||
{
|
||||
addDepot();
|
||||
}
|
||||
},
|
||||
{
|
||||
id:'deleteDepot',
|
||||
text:'删除',
|
||||
iconCls:'icon-remove',
|
||||
handler:function()
|
||||
{
|
||||
batDeleteDepot();
|
||||
}
|
||||
}
|
||||
],
|
||||
onLoadError:function()
|
||||
{
|
||||
$.messager.alert('页面加载提示','页面加载异常,请稍后再试!','error');
|
||||
return;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
//初始化键盘enter事件
|
||||
$(document).keydown(function(event)
|
||||
{
|
||||
//兼容 IE和firefox 事件
|
||||
var e = window.event || event;
|
||||
var k = e.keyCode||e.which||e.charCode;
|
||||
//兼容 IE,firefox 兼容
|
||||
var obj = e.srcElement ? e.srcElement : e.target;
|
||||
//绑定键盘事件为 id是指定的输入框才可以触发键盘事件 13键盘事件 ---遗留问题 enter键效验 对话框会关闭问题
|
||||
if(k == "13"&&(obj.id=="name"||obj.id=="sort"|| obj.id=="remark" ))
|
||||
{
|
||||
$("#saveDepot").click();
|
||||
}
|
||||
//搜索按钮添加快捷键
|
||||
if(k == "13"&&(obj.id=="searchName" || obj.id=="searchRemark" ))
|
||||
{
|
||||
$("#searchBtn").click();
|
||||
}
|
||||
});
|
||||
//分页信息处理
|
||||
function ininPager()
|
||||
{
|
||||
try
|
||||
{
|
||||
var opts = $("#tableData").datagrid('options');
|
||||
var pager = $("#tableData").datagrid('getPager');
|
||||
pager.pagination({
|
||||
onSelectPage:function(pageNum, pageSize)
|
||||
{
|
||||
opts.pageNumber = pageNum;
|
||||
opts.pageSize = pageSize;
|
||||
pager.pagination('refresh',
|
||||
{
|
||||
pageNumber:pageNum,
|
||||
pageSize:pageSize
|
||||
});
|
||||
showDepotDetails(pageNum,pageSize);
|
||||
}
|
||||
});
|
||||
}
|
||||
catch (e)
|
||||
{
|
||||
$.messager.alert('异常处理提示',"分页信息异常 : " + e.name + ": " + e.message,'error');
|
||||
}
|
||||
}
|
||||
|
||||
//删除供应商信息
|
||||
function deleteDepot(depotID)
|
||||
{
|
||||
$.messager.confirm('删除确认','确定要删除此仓库信息吗?',function(r)
|
||||
{
|
||||
if (r)
|
||||
{
|
||||
$.ajax({
|
||||
type:"post",
|
||||
url: "<%=path %>/depot/delete.action",
|
||||
dataType: "json",
|
||||
data: ({
|
||||
depotID : depotID,
|
||||
clientIp:'<%=clientIp %>'
|
||||
}),
|
||||
success: function (tipInfo)
|
||||
{
|
||||
var msg = tipInfo.showModel.msgTip;
|
||||
if(msg == '成功')
|
||||
{
|
||||
//加载完以后重新初始化
|
||||
$("#searchBtn").click();
|
||||
}
|
||||
else
|
||||
$.messager.alert('删除提示','删除仓库信息失败,请稍后再试!','error');
|
||||
},
|
||||
//此处添加错误处理
|
||||
error:function()
|
||||
{
|
||||
$.messager.alert('删除提示','删除仓库信息异常,请稍后再试!','error');
|
||||
return;
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
//批量删除供应商
|
||||
function batDeleteDepot()
|
||||
{
|
||||
var row = $('#tableData').datagrid('getChecked');
|
||||
if(row.length == 0)
|
||||
{
|
||||
$.messager.alert('删除提示','没有记录被选中!','info');
|
||||
return;
|
||||
}
|
||||
if(row.length > 0)
|
||||
{
|
||||
$.messager.confirm('删除确认','确定要删除选中的' + row.length + '条仓库信息吗?',function(r)
|
||||
{
|
||||
if (r)
|
||||
{
|
||||
var ids = "";
|
||||
for(var i = 0;i < row.length; i ++)
|
||||
{
|
||||
if(i == row.length-1)
|
||||
{
|
||||
ids += row[i].id;
|
||||
break;
|
||||
}
|
||||
//alert(row[i].id);
|
||||
ids += row[i].id + ",";
|
||||
}
|
||||
$.ajax({
|
||||
type:"post",
|
||||
url: "<%=path %>/depot/batchDelete.action",
|
||||
dataType: "json",
|
||||
async : false,
|
||||
data: ({
|
||||
depotIDs : ids,
|
||||
clientIp:'<%=clientIp %>'
|
||||
}),
|
||||
success: function (tipInfo)
|
||||
{
|
||||
var msg = tipInfo.showModel.msgTip;
|
||||
if(msg == '成功')
|
||||
{
|
||||
//加载完以后重新初始化
|
||||
$("#searchBtn").click();
|
||||
$(":checkbox").attr("checked",false);
|
||||
}
|
||||
else
|
||||
$.messager.alert('删除提示','删除仓库信息失败,请稍后再试!','error');
|
||||
},
|
||||
//此处添加错误处理
|
||||
error:function()
|
||||
{
|
||||
$.messager.alert('删除提示','删除仓库信息异常,请稍后再试!','error');
|
||||
return;
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
//增加
|
||||
var url;
|
||||
var depotID = 0;
|
||||
//保存编辑前的名称
|
||||
var orgDepot = "";
|
||||
|
||||
function addDepot()
|
||||
{
|
||||
$("#clientIp").val('<%=clientIp %>');
|
||||
$("#sort").val("");
|
||||
$("#remark").val("");
|
||||
$('#depotDlg').dialog('open').dialog('setTitle','<img src="<%=path%>/js/easyui-1.3.5/themes/icons/edit_add.png"/> 增加仓库信息');
|
||||
$(".window-mask").css({ width: webW ,height: webH});
|
||||
$("#name").val("").focus();
|
||||
//$('#depotFM').form('clear');
|
||||
|
||||
orgDepot = "";
|
||||
depotID = 0;
|
||||
url = '<%=path %>/depot/create.action';
|
||||
}
|
||||
|
||||
//保存信息
|
||||
$("#saveDepot").unbind().bind({
|
||||
click:function()
|
||||
{
|
||||
if(!$('#depotFM').form('validate'))
|
||||
return;
|
||||
else if(checkDepotName())
|
||||
return;
|
||||
else
|
||||
{
|
||||
$.ajax({
|
||||
type:"post",
|
||||
url: url,
|
||||
dataType: "json",
|
||||
async : false,
|
||||
data: ({
|
||||
name : $.trim($("#name").val()),
|
||||
sort : $.trim($("#sort").val()),
|
||||
remark : $.trim($("#remark").val()),
|
||||
clientIp:'<%=clientIp %>'
|
||||
}),
|
||||
success: function (tipInfo)
|
||||
{
|
||||
if(tipInfo)
|
||||
{
|
||||
$('#depotDlg').dialog('close');
|
||||
|
||||
var opts = $("#tableData").datagrid('options');
|
||||
showDepotDetails(opts.pageNumber,opts.pageSize);
|
||||
}
|
||||
else
|
||||
{
|
||||
$.messager.show({
|
||||
title: '错误提示',
|
||||
msg: '保存仓库信息失败,请稍后重试!'
|
||||
});
|
||||
}
|
||||
},
|
||||
//此处添加错误处理
|
||||
error:function()
|
||||
{
|
||||
$.messager.alert('提示','保存仓库信息异常,请稍后再试!','error');
|
||||
return;
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
//编辑信息
|
||||
function editDepot(depotTotalInfo)
|
||||
{
|
||||
var depotInfo = depotTotalInfo.split("AaBb");
|
||||
|
||||
$("#clientIp").val('<%=clientIp %>');
|
||||
$("#name").focus().val(depotInfo[1]);
|
||||
$("#sort").val(depotInfo[2]);
|
||||
$("#remark").val(depotInfo[3]);
|
||||
|
||||
orgDepot = depotInfo[1];
|
||||
$('#depotDlg').dialog('open').dialog('setTitle','<img src="<%=path%>/js/easyui-1.3.5/themes/icons/pencil.png"/> 编辑仓库信息');
|
||||
$(".window-mask").css({ width: webW ,height: webH});
|
||||
depotID = depotInfo[0];
|
||||
//焦点在名称输入框==定焦在输入文字后面
|
||||
$("#name").val("").focus().val(depotInfo[1]);
|
||||
url = '<%=path %>/depot/update.action?depotID=' + depotInfo[0];
|
||||
}
|
||||
|
||||
//检查名称是否存在 ++ 重名无法提示问题需要跟进
|
||||
function checkDepotName()
|
||||
{
|
||||
var name = $.trim($("#name").val());
|
||||
//表示是否存在 true == 存在 false = 不存在
|
||||
var flag = false;
|
||||
//开始ajax名称检验,不能重名
|
||||
if(name.length > 0 &&( orgDepot.length ==0 || name != orgDepot))
|
||||
{
|
||||
$.ajax({
|
||||
type:"post",
|
||||
url: "<%=path %>/depot/checkIsNameExist.action",
|
||||
dataType: "json",
|
||||
async : false,
|
||||
data: ({
|
||||
depotID : depotID,
|
||||
name : name
|
||||
}),
|
||||
success: function (tipInfo)
|
||||
{
|
||||
flag = tipInfo;
|
||||
if(tipInfo)
|
||||
{
|
||||
$.messager.alert('提示','仓库名称已经存在','info');
|
||||
//alert("仓库名称已经存在");
|
||||
//$("#name").val("");
|
||||
return;
|
||||
}
|
||||
},
|
||||
//此处添加错误处理
|
||||
error:function()
|
||||
{
|
||||
$.messager.alert('提示','检查仓库名称是否存在异常,请稍后再试!','error');
|
||||
return;
|
||||
}
|
||||
});
|
||||
}
|
||||
return flag;
|
||||
}
|
||||
|
||||
//搜索处理
|
||||
$("#searchBtn").unbind().bind({
|
||||
click:function()
|
||||
{
|
||||
showDepotDetails(1,initPageSize);
|
||||
var opts = $("#tableData").datagrid('options');
|
||||
var pager = $("#tableData").datagrid('getPager');
|
||||
opts.pageNumber = 1;
|
||||
opts.pageSize = initPageSize;
|
||||
pager.pagination('refresh',
|
||||
{
|
||||
pageNumber:1,
|
||||
pageSize:initPageSize
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
function showDepotDetails(pageNo,pageSize)
|
||||
{
|
||||
$.ajax({
|
||||
type:"post",
|
||||
url: "<%=path %>/depot/findBy.action",
|
||||
dataType: "json",
|
||||
data: ({
|
||||
name:$.trim($("#searchName").val()),
|
||||
remark:$.trim($("#searchRemark").val()),
|
||||
pageNo:pageNo,
|
||||
pageSize:pageSize
|
||||
}),
|
||||
success: function (data)
|
||||
{
|
||||
$("#tableData").datagrid('loadData',data);
|
||||
},
|
||||
//此处添加错误处理
|
||||
error:function()
|
||||
{
|
||||
$.messager.alert('查询提示','查询数据后台异常,请稍后再试!','error');
|
||||
return;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
//重置按钮
|
||||
$("#searchResetBtn").unbind().bind({
|
||||
click:function(){
|
||||
$("#searchName").val("");
|
||||
$("#searchRemark").val("");
|
||||
|
||||
//加载完以后重新初始化
|
||||
$("#searchBtn").click();
|
||||
}
|
||||
});
|
||||
|
||||
//查看单元(设置)
|
||||
$('#setBuilding').click(function () {
|
||||
var currentRow = $("#tableData").datagrid("getChecked");
|
||||
if (currentRow.length == 0) {
|
||||
alert("请选择一条数据再操作!");
|
||||
return false;
|
||||
}
|
||||
parent.addTab(currentRow[0].id + "单元", "<%=path %>/pages/materials/building.jsp?ProjectId=" + currentRow[0].id, "");
|
||||
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
535
src/main/webapp/pages/manage/functions.jsp
Normal file
535
src/main/webapp/pages/manage/functions.jsp
Normal file
@@ -0,0 +1,535 @@
|
||||
<%@page import="com.jsh.util.Tools"%>
|
||||
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
|
||||
<%
|
||||
String path = request.getContextPath();
|
||||
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
|
||||
String clientIp = Tools.getCurrentUserIP();
|
||||
%>
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>功能管理</title>
|
||||
<meta charset="utf-8">
|
||||
<!-- 指定以IE8的方式来渲染 -->
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE8"/>
|
||||
<link rel="shortcut icon" href="<%=path%>/images/favicon.ico" type="image/x-icon" />
|
||||
<link rel="stylesheet" type="text/css" href="<%=path %>/js/easyui-1.3.5/themes/default/easyui.css"/>
|
||||
<link rel="stylesheet" type="text/css" href="<%=path %>/js/easyui-1.3.5/themes/icon.css"/>
|
||||
<link type="text/css" rel="stylesheet" href="<%=path %>/css/common.css" />
|
||||
<script type="text/javascript" src="<%=path %>/js/jquery-1.8.0.min.js"></script>
|
||||
<script type="text/javascript" src="<%=path %>/js/easyui-1.3.5/jquery.easyui.min.js"></script>
|
||||
<script type="text/javascript" src="<%=path %>/js/easyui-1.3.5/locale/easyui-lang-zh_CN.js"></script>
|
||||
<script type="text/javascript" src="<%=path %>/js/common/common.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<!-- 查询 -->
|
||||
<div id = "searchPanel" class="easyui-panel" style="padding:10px;" title="查询窗口" iconCls="icon-search" collapsible="true" closable="false">
|
||||
<table id="searchTable">
|
||||
<tr>
|
||||
<td>名称:</td>
|
||||
<td>
|
||||
<input type="text" name="searchName" id="searchName" style="width:100px;"/>
|
||||
</td>
|
||||
<td> </td>
|
||||
<td> </td>
|
||||
<td>类型: </td>
|
||||
<td> </td>
|
||||
<td>
|
||||
<select name="searchType" id="searchType" style="width:100px; height:20px">
|
||||
<option value="">全部</option>
|
||||
<option value="电脑版">电脑版</option>
|
||||
<option value="手机版">手机版</option>
|
||||
</select>
|
||||
</td>
|
||||
<td> </td>
|
||||
<td> </td>
|
||||
<td>
|
||||
<a href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-search" id="searchBtn">查询</a>
|
||||
<a href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-redo" id="searchResetBtn">重置</a>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<!-- 数据显示table -->
|
||||
<div id = "tablePanel" class="easyui-panel" style="padding:1px;top:300px;" title="功能列表" iconCls="icon-list" collapsible="true" closable="false">
|
||||
<table id="tableData" style="top:300px;border-bottom-color:#FFFFFF"></table>
|
||||
</div>
|
||||
|
||||
<div id="functionsDlg" class="easyui-dialog" style="width:380px;padding:10px 20px"
|
||||
closed="true" buttons="#dlg-buttons" modal="true" cache="false" collapsible="false" closable="true">
|
||||
<form id="functionsFM" method="post" novalidate>
|
||||
<table>
|
||||
<tr>
|
||||
<td>编号</td>
|
||||
<td style="padding:1px"><input name="Number" id="Number" class="easyui-textbox" style="width: 230px;height: 20px"/></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>名称</td>
|
||||
<td style="padding:1px"><input name="Name" id="Name" class="easyui-validatebox" data-options="required:true,validType:'length[2,20]'" style="width: 230px;height: 20px"/></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>上级编号</td>
|
||||
<td style="padding:1px"><input name="PNumber" id="PNumber" class="easyui-textbox" style="width: 230px;height: 20px"/></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>链接</td>
|
||||
<td style="padding:1px"><input name="URL" id="URL" class="easyui-textbox" style="width: 230px;height: 20px"/></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>收缩</td>
|
||||
<td style="padding:1px"><input name="State" id="State" type="checkbox" style="width: 230px;height: 20px"/></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>排序</td>
|
||||
<td style="padding:1px"><input name="Sort" id="Sort" class="easyui-textbox" style="width: 230px;height: 20px"/></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>启用</td>
|
||||
<td style="padding:1px"><input name="Enabled" id="Enabled" type="checkbox" style="width: 230px;height: 20px"/></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>类型</td>
|
||||
<td style="padding:1px"><select name="Type" id="Type" style="width: 230px;height: 20px">
|
||||
<option value="电脑版">电脑版</option>
|
||||
<option value="手机版">手机版</option></select>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<input type="hidden" name="clientIp" id="clientIp" value="<%=clientIp %>"/>
|
||||
</form>
|
||||
</div>
|
||||
<div id="dlg-buttons">
|
||||
<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>
|
||||
</div>
|
||||
|
||||
<script type="text/javascript">
|
||||
//初始化界面
|
||||
$(function()
|
||||
{
|
||||
initTableData();
|
||||
ininPager();
|
||||
initForm();
|
||||
});
|
||||
|
||||
//防止表单提交重复
|
||||
function initForm()
|
||||
{
|
||||
$('#functionsFM').form({
|
||||
onSubmit: function(){
|
||||
return false;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
//初始化表格数据
|
||||
function initTableData()
|
||||
{
|
||||
$('#tableData').datagrid({
|
||||
//title:'功能列表',
|
||||
//iconCls:'icon-save',
|
||||
//width:700,
|
||||
height:heightInfo,
|
||||
rownumbers: false,
|
||||
//动画效果
|
||||
animate:false,
|
||||
//选中单行
|
||||
singleSelect : true,
|
||||
collapsible:false,
|
||||
selectOnCheck:false,
|
||||
//fitColumns:true,
|
||||
//单击行是否选中
|
||||
checkOnSelect : false,
|
||||
url:'<%=path %>/functions/findBy.action?pageSize=' + initPageSize,
|
||||
pagination: true,
|
||||
//交替出现背景
|
||||
striped : true,
|
||||
//loadFilter: pagerFilter,
|
||||
pageSize: initPageSize,
|
||||
pageList: initPageNum,
|
||||
columns:[[
|
||||
{ field: 'Id',width:35,align:"center",checkbox:true},
|
||||
{ title: '编号 ',field: 'Number',width:60},
|
||||
{ title: '名称',field: 'Name',width:80},
|
||||
{ title: '上级编号',field: 'PNumber',width:60},
|
||||
{ title: '链接',field: 'URL',width:120},
|
||||
{ title: '排序',field: 'Sort',width:50},
|
||||
{ title: '收缩',field: 'State',width:50},
|
||||
{ title: '启用',field: 'Enabled',width:50},
|
||||
{ title: '类型',field: 'Type',width:50},
|
||||
{ title: '操作',field: 'op',align:"center",width:130,formatter:function(value,rec)
|
||||
{
|
||||
var str = '';
|
||||
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;
|
||||
if(1 == value)
|
||||
{
|
||||
str += '<img src="<%=path%>/js/easyui-1.3.5/themes/icons/pencil.png" style="cursor: pointer;" onclick="editFunctions(\'' + rowInfo + '\');"/> <a onclick="editFunctions(\'' + rowInfo + '\');" style="text-decoration:none;color:black;" href="javascript:void(0)">编辑</a> ';
|
||||
str += '<img src="<%=path%>/js/easyui-1.3.5/themes/icons/edit_remove.png" style="cursor: pointer;" onclick="deleteFunctions('+ rec.Id +');"/> <a onclick="deleteFunctions('+ rec.Id +');" style="text-decoration:none;color:black;" href="javascript:void(0)">删除</a> ';
|
||||
}
|
||||
return str;
|
||||
}
|
||||
}
|
||||
]],
|
||||
toolbar:[
|
||||
{
|
||||
id:'addFunctions',
|
||||
text:'增加',
|
||||
iconCls:'icon-add',
|
||||
handler:function()
|
||||
{
|
||||
addFunctions();
|
||||
}
|
||||
},
|
||||
{
|
||||
id:'deleteFunctions',
|
||||
text:'删除',
|
||||
iconCls:'icon-remove',
|
||||
handler:function()
|
||||
{
|
||||
batDeleteFunctions();
|
||||
}
|
||||
}
|
||||
],
|
||||
onLoadError:function()
|
||||
{
|
||||
$.messager.alert('页面加载提示','页面加载异常,请稍后再试!','error');
|
||||
return;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
//初始化键盘enter事件
|
||||
$(document).keydown(function(event)
|
||||
{
|
||||
//兼容 IE和firefox 事件
|
||||
var e = window.event || event;
|
||||
var k = e.keyCode||e.which||e.charCode;
|
||||
//兼容 IE,firefox 兼容
|
||||
var obj = e.srcElement ? e.srcElement : e.target;
|
||||
//绑定键盘事件为 id是指定的输入框才可以触发键盘事件 13键盘事件 ---遗留问题 enter键效验 对话框会关闭问题
|
||||
if(k == "13"&&(obj.id=="Name"||obj.id=="PNumber"|| obj.id=="URL" ))
|
||||
{
|
||||
$("#saveFunctions").click();
|
||||
}
|
||||
//搜索按钮添加快捷键
|
||||
if(k == "13"&&(obj.id=="searchName" || obj.id=="searchType" ))
|
||||
{
|
||||
$("#searchBtn").click();
|
||||
}
|
||||
});
|
||||
//分页信息处理
|
||||
function ininPager()
|
||||
{
|
||||
try
|
||||
{
|
||||
var opts = $("#tableData").datagrid('options');
|
||||
var pager = $("#tableData").datagrid('getPager');
|
||||
pager.pagination({
|
||||
onSelectPage:function(pageNum, pageSize)
|
||||
{
|
||||
opts.pageNumber = pageNum;
|
||||
opts.pageSize = pageSize;
|
||||
pager.pagination('refresh',
|
||||
{
|
||||
pageNumber:pageNum,
|
||||
pageSize:pageSize
|
||||
});
|
||||
showFunctionsDetails(pageNum,pageSize);
|
||||
}
|
||||
});
|
||||
}
|
||||
catch (e)
|
||||
{
|
||||
$.messager.alert('异常处理提示',"分页信息异常 : " + e.name + ": " + e.message,'error');
|
||||
}
|
||||
}
|
||||
|
||||
//删除供应商信息
|
||||
function deleteFunctions(functionsID)
|
||||
{
|
||||
$.messager.confirm('删除确认','确定要删除此功能信息吗?',function(r)
|
||||
{
|
||||
if (r)
|
||||
{
|
||||
$.ajax({
|
||||
type:"post",
|
||||
url: "<%=path %>/functions/delete.action",
|
||||
dataType: "json",
|
||||
data: ({
|
||||
functionsID : functionsID,
|
||||
clientIp:'<%=clientIp %>'
|
||||
}),
|
||||
success: function (tipInfo)
|
||||
{
|
||||
var msg = tipInfo.showModel.msgTip;
|
||||
if(msg == '成功')
|
||||
{
|
||||
//加载完以后重新初始化
|
||||
$("#searchBtn").click();
|
||||
}
|
||||
else
|
||||
$.messager.alert('删除提示','删除功能信息失败,请稍后再试!','error');
|
||||
},
|
||||
//此处添加错误处理
|
||||
error:function()
|
||||
{
|
||||
$.messager.alert('删除提示','删除功能信息异常,请稍后再试!','error');
|
||||
return;
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
//批量删除
|
||||
function batDeleteFunctions()
|
||||
{
|
||||
var row = $('#tableData').datagrid('getChecked');
|
||||
if(row.length == 0)
|
||||
{
|
||||
$.messager.alert('删除提示','没有记录被选中!','info');
|
||||
return;
|
||||
}
|
||||
if(row.length > 0)
|
||||
{
|
||||
$.messager.confirm('删除确认','确定要删除选中的' + row.length + '条功能信息吗?',function(r)
|
||||
{
|
||||
if (r)
|
||||
{
|
||||
var ids = "";
|
||||
for(var i = 0;i < row.length; i ++)
|
||||
{
|
||||
if(i == row.length-1)
|
||||
{
|
||||
ids += row[i].Id;
|
||||
break;
|
||||
}
|
||||
//alert(row[i].id);
|
||||
ids += row[i].Id + ",";
|
||||
}
|
||||
$.ajax({
|
||||
type:"post",
|
||||
url: "<%=path %>/functions/batchDelete.action",
|
||||
dataType: "json",
|
||||
async : false,
|
||||
data: ({
|
||||
functionsIDs : ids,
|
||||
clientIp:'<%=clientIp %>'
|
||||
}),
|
||||
success: function (tipInfo)
|
||||
{
|
||||
var msg = tipInfo.showModel.msgTip;
|
||||
if(msg == '成功')
|
||||
{
|
||||
//加载完以后重新初始化
|
||||
$("#searchBtn").click();
|
||||
$(":checkbox").attr("checked",false);
|
||||
}
|
||||
else
|
||||
$.messager.alert('删除提示','删除功能信息失败,请稍后再试!','error');
|
||||
},
|
||||
//此处添加错误处理
|
||||
error:function()
|
||||
{
|
||||
$.messager.alert('删除提示','删除功能信息异常,请稍后再试!','error');
|
||||
return;
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
//增加
|
||||
var url;
|
||||
var functionsID = 0;
|
||||
//保存编辑前的名称
|
||||
var orgFunctions = "";
|
||||
|
||||
function addFunctions()
|
||||
{
|
||||
$("#clientIp").val('<%=clientIp %>');
|
||||
$('#functionsDlg').dialog('open').dialog('setTitle','<img src="<%=path%>/js/easyui-1.3.5/themes/icons/edit_add.png"/> 增加功能信息');
|
||||
$(".window-mask").css({ width: webW ,height: webH});
|
||||
$("#Name").val("").focus();
|
||||
$('#functionsFM').form('clear');
|
||||
|
||||
orgFunctions = "";
|
||||
functionsID = 0;
|
||||
url = '<%=path %>/functions/create.action';
|
||||
}
|
||||
|
||||
//保存信息
|
||||
$("#saveFunctions").unbind().bind({
|
||||
click:function()
|
||||
{
|
||||
if(!$('#functionsFM').form('validate'))
|
||||
return;
|
||||
else if(checkFunctionsName())
|
||||
return;
|
||||
else
|
||||
{
|
||||
$.ajax({
|
||||
type:"post",
|
||||
url: url,
|
||||
dataType: "json",
|
||||
async : false,
|
||||
data: ({
|
||||
Number : $.trim($("#Number").val()),
|
||||
Name : $.trim($("#Name").val()),
|
||||
PNumber : $.trim($("#PNumber").val()),
|
||||
URL : $.trim($("#URL").val()),
|
||||
State : $("#State").is(':checked'),
|
||||
Sort : $.trim($("#Sort").val()),
|
||||
Enabled : $("#Enabled").is(':checked'),
|
||||
Type : $.trim($("#Type").val()),
|
||||
clientIp:'<%=clientIp %>'
|
||||
}),
|
||||
success: function (tipInfo)
|
||||
{
|
||||
if(tipInfo)
|
||||
{
|
||||
$('#functionsDlg').dialog('close');
|
||||
|
||||
var opts = $("#tableData").datagrid('options');
|
||||
showFunctionsDetails(opts.pageNumber,opts.pageSize);
|
||||
}
|
||||
else
|
||||
{
|
||||
$.messager.show({
|
||||
title: '错误提示',
|
||||
msg: '保存功能信息失败,请稍后重试!'
|
||||
});
|
||||
}
|
||||
},
|
||||
//此处添加错误处理
|
||||
error:function()
|
||||
{
|
||||
$.messager.alert('提示','保存功能信息异常,请稍后再试!','error');
|
||||
return;
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
//编辑信息
|
||||
function editFunctions(functionsTotalInfo)
|
||||
{
|
||||
var functionsInfo = functionsTotalInfo.split("AaBb");
|
||||
|
||||
$("#clientIp").val('<%=clientIp %>');
|
||||
$("#Number").focus().val(functionsInfo[1]);
|
||||
$("#Name").focus().val(functionsInfo[2]);
|
||||
$("#PNumber").focus().val(functionsInfo[3]);
|
||||
$("#URL").focus().val(functionsInfo[4]);
|
||||
$("#State").attr("checked",functionsInfo[5]=='true'?true:false);
|
||||
$("#Sort").focus().val(functionsInfo[6]);
|
||||
$("#Enabled").attr("checked",functionsInfo[7]=='true'?true:false);
|
||||
$("#Type").focus().val(functionsInfo[8]);
|
||||
|
||||
orgFunctions = functionsInfo[2];
|
||||
$('#functionsDlg').dialog('open').dialog('setTitle','<img src="<%=path%>/js/easyui-1.3.5/themes/icons/pencil.png"/> 编辑功能信息');
|
||||
$(".window-mask").css({ width: webW ,height: webH});
|
||||
functionsID = functionsInfo[0];
|
||||
//焦点在名称输入框==定焦在输入文字后面
|
||||
$("#Name").val("").focus().val(functionsInfo[2]);
|
||||
url = '<%=path %>/functions/update.action?functionsID=' + functionsInfo[0];
|
||||
}
|
||||
|
||||
//检查名称是否存在 ++ 重名无法提示问题需要跟进
|
||||
function checkFunctionsName()
|
||||
{
|
||||
var Name = $.trim($("#Name").val());
|
||||
//表示是否存在 true == 存在 false = 不存在
|
||||
var flag = false;
|
||||
//开始ajax名称检验,不能重名
|
||||
if(name.length > 0 &&( orgFunctions.length ==0 || name != orgFunctions))
|
||||
{
|
||||
$.ajax({
|
||||
type:"post",
|
||||
url: "<%=path %>/functions/checkIsNameExist.action",
|
||||
dataType: "json",
|
||||
async : false,
|
||||
data: ({
|
||||
functionsID : functionsID,
|
||||
Name : Name
|
||||
}),
|
||||
success: function (tipInfo)
|
||||
{
|
||||
flag = tipInfo;
|
||||
if(tipInfo)
|
||||
{
|
||||
$.messager.alert('提示','功能名称已经存在','info');
|
||||
//alert("功能名称已经存在");
|
||||
//$("#name").val("");
|
||||
return;
|
||||
}
|
||||
},
|
||||
//此处添加错误处理
|
||||
error:function()
|
||||
{
|
||||
$.messager.alert('提示','检查功能名称是否存在异常,请稍后再试!','error');
|
||||
return;
|
||||
}
|
||||
});
|
||||
}
|
||||
return flag;
|
||||
}
|
||||
|
||||
//搜索处理
|
||||
$("#searchBtn").unbind().bind({
|
||||
click:function()
|
||||
{
|
||||
showFunctionsDetails(1,initPageSize);
|
||||
var opts = $("#tableData").datagrid('options');
|
||||
var pager = $("#tableData").datagrid('getPager');
|
||||
opts.pageNumber = 1;
|
||||
opts.pageSize = initPageSize;
|
||||
pager.pagination('refresh',
|
||||
{
|
||||
pageNumber:1,
|
||||
pageSize:initPageSize
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
function showFunctionsDetails(pageNo,pageSize)
|
||||
{
|
||||
$.ajax({
|
||||
type:"post",
|
||||
url: "<%=path %>/functions/findBy.action",
|
||||
dataType: "json",
|
||||
data: ({
|
||||
Name:$.trim($("#searchName").val()),
|
||||
Type:$.trim($("#searchType").val()),
|
||||
pageNo:pageNo,
|
||||
pageSize:pageSize
|
||||
}),
|
||||
success: function (data)
|
||||
{
|
||||
$("#tableData").datagrid('loadData',data);
|
||||
},
|
||||
//此处添加错误处理
|
||||
error:function()
|
||||
{
|
||||
$.messager.alert('查询提示','查询数据后台异常,请稍后再试!','error');
|
||||
return;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
//重置按钮
|
||||
$("#searchResetBtn").unbind().bind({
|
||||
click:function(){
|
||||
$("#searchName").val("");
|
||||
|
||||
//加载完以后重新初始化
|
||||
$("#searchBtn").click();
|
||||
}
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
76
src/main/webapp/pages/manage/home.jsp
Normal file
76
src/main/webapp/pages/manage/home.jsp
Normal file
@@ -0,0 +1,76 @@
|
||||
<%@page language="java" contentType="text/html; charset=utf-8" pageEncoding="utf-8"%>
|
||||
<%
|
||||
String path = request.getContextPath();
|
||||
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
|
||||
%>
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv=Content-Type content="text/html; charset=utf-8">
|
||||
<!-- 指定以IE8的方式来渲染 -->
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE8"/>
|
||||
<link rel="shortcut icon" href="<%=path%>/images/favicon.ico" type="image/x-icon" />
|
||||
<link href="css/admin.css" type="text/css" rel="stylesheet">
|
||||
<title>首页说明</title>
|
||||
<style type="text/css">
|
||||
<!--
|
||||
body {
|
||||
margin-left: 0px;
|
||||
margin-top: 0px;
|
||||
margin-right: 0px;
|
||||
margin-bottom: 0px;
|
||||
background-color: #EAF2FD;
|
||||
}
|
||||
.STYLE1 {font-size: 12px}
|
||||
.STYLE4 {
|
||||
font-size: 12px;
|
||||
color: #1F4A65;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
a:link {
|
||||
font-size: 12px;
|
||||
color: #06482a;
|
||||
text-decoration: none;
|
||||
|
||||
}
|
||||
a:visited {
|
||||
font-size: 12px;
|
||||
color: #06482a;
|
||||
text-decoration: none;
|
||||
}
|
||||
a:hover {
|
||||
font-size: 12px;
|
||||
color: #FF0000;
|
||||
text-decoration: underline;
|
||||
}
|
||||
a:active {
|
||||
font-size: 12px;
|
||||
color: #FF0000;
|
||||
text-decoration: none;
|
||||
}
|
||||
.STYLE7 {font-size: 12}
|
||||
-->
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<table cellSpacing=0 cellPadding=0 width="100%" align=center border=0>
|
||||
<tr height=28>
|
||||
<td width="1101" class="STYLE4">
|
||||
<img src="<%=path%>/images/preferences1.png" width="16" height="16" />
|
||||
<span >系统管理</span>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td bgColor=#b1ceef height=1></td>
|
||||
</tr>
|
||||
<tr height="5px">
|
||||
<td background=images/shadow_bg.jpg></td>
|
||||
</tr>
|
||||
</table>
|
||||
<p style="font-size: 12px;color: #1F4A65;padding: 10px">
|
||||
|
||||
系统管理是管理系统中的基础数据设置信息,包括供应商、资产类型、资产名称、用户管理等,通过系统管理,可以为系统提供基础数据支持。日志管理主要包括供应商、资产类型、资产名称、用户管理等的增删改查等功能点。
|
||||
</p>
|
||||
</body>
|
||||
</html>
|
||||
510
src/main/webapp/pages/manage/inOutItem.jsp
Normal file
510
src/main/webapp/pages/manage/inOutItem.jsp
Normal file
@@ -0,0 +1,510 @@
|
||||
<%@page import="com.jsh.util.Tools"%>
|
||||
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
|
||||
<%
|
||||
String path = request.getContextPath();
|
||||
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
|
||||
String clientIp = Tools.getCurrentUserIP();
|
||||
%>
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>收支项目</title>
|
||||
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
<!-- 指定以IE8的方式来渲染 -->
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE8"/>
|
||||
<link rel="shortcut icon" href="<%=path%>/images/favicon.ico" type="image/x-icon" />
|
||||
<link rel="stylesheet" type="text/css" href="<%=path %>/js/easyui-1.3.5/themes/default/easyui.css"/>
|
||||
<link rel="stylesheet" type="text/css" href="<%=path %>/js/easyui-1.3.5/themes/icon.css"/>
|
||||
<link type="text/css" rel="stylesheet" href="<%=path %>/css/common.css" />
|
||||
<script type="text/javascript" src="<%=path %>/js/jquery-1.8.0.min.js"></script>
|
||||
<script type="text/javascript" src="<%=path %>/js/easyui-1.3.5/jquery.easyui.min.js"></script>
|
||||
<script type="text/javascript" src="<%=path %>/js/easyui-1.3.5/locale/easyui-lang-zh_CN.js"></script>
|
||||
<script type="text/javascript" src="<%=path %>/js/common/common.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<!-- 查询 -->
|
||||
<div id = "searchPanel" class="easyui-panel" style="padding:10px;" title="查询窗口" iconCls="icon-search" collapsible="true" closable="false">
|
||||
<table id="searchTable">
|
||||
<tr>
|
||||
<td>名 称:</td>
|
||||
<td>
|
||||
<input type="text" name="searchName" id="searchName" style="width:70px;"/>
|
||||
</td>
|
||||
|
||||
<td> </td>
|
||||
<td> </td>
|
||||
<td id="searchTypeLabel">类 型:</td>
|
||||
<td>
|
||||
<select name="searchType" id="searchType" style="width:70px;">
|
||||
<option value="">全部</option>
|
||||
<option value="收入">收入</option>
|
||||
<option value="支出">支出</option>
|
||||
</select>
|
||||
</td>
|
||||
<td> </td>
|
||||
<td> </td>
|
||||
<td id="searchRemarkLabel">备 注:</td>
|
||||
<td>
|
||||
<input type="text" name="searchRemark" id="searchRemark" style="width:70px;"/>
|
||||
</td>
|
||||
<td> </td>
|
||||
<td> </td>
|
||||
<td>
|
||||
<a href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-search" id="searchBtn">查询</a>
|
||||
<a href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-redo" id="searchResetBtn">重置</a>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<!-- 数据显示table -->
|
||||
<div id = "tablePanel" class="easyui-panel" style="padding:1px;top:300px;" title="收支项目" iconCls="icon-list" collapsible="true" closable="false">
|
||||
<table id="tableData" style="top:300px;border-bottom-color:#FFFFFF"></table>
|
||||
</div>
|
||||
<div id="inOutItemDlg" class="easyui-dialog" style="width:380px;padding:10px 20px"
|
||||
closed="true" buttons="#dlg-buttons" modal="true" collapsible="false" closable="true">
|
||||
<form id="inOutItemFM" method="post" novalidate>
|
||||
<div class="fitem" style="padding:5px">
|
||||
<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"/>
|
||||
</div>
|
||||
<div class="fitem" style="padding:5px">
|
||||
<label id="typeLabel">类 型</label>
|
||||
<select name="type" id="type" style="width:230px;">
|
||||
<option value="收入">收入</option>
|
||||
<option value="支出">支出</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="fitem" style="padding:5px">
|
||||
<label id="remarkLabel">备 注</label>
|
||||
<textarea name="remark" id="remark" rows="2" cols="2" style="width: 230px;"></textarea>
|
||||
</div>
|
||||
<input type="hidden" name="clientIp" id="clientIp" value="<%=clientIp %>"/>
|
||||
</form>
|
||||
</div>
|
||||
<div id="dlg-buttons">
|
||||
<a href="javascript:void(0)" id="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>
|
||||
</div>
|
||||
|
||||
<script type="text/javascript">
|
||||
//初始化界面
|
||||
$(function()
|
||||
{
|
||||
initTableData();
|
||||
ininPager();
|
||||
browserFit();
|
||||
});
|
||||
|
||||
//浏览器适配
|
||||
function browserFit()
|
||||
{
|
||||
if(getOs()=='MSIE')
|
||||
{
|
||||
$("#searchTypeLabel").empty().append("类 型:");
|
||||
$("#searchRemarkLabel").empty().append("备 注:");
|
||||
$("#nameLabel").empty().append("名 称");
|
||||
$("#typeLabel").empty().append("类 型");
|
||||
$("#remarkLabel").empty().append("备 注");
|
||||
}
|
||||
else
|
||||
{
|
||||
$("#searchTypeLabel").empty().append("类 型:");
|
||||
$("#searchRemarkLabel").empty().append("备 注:");
|
||||
$("#nameLabel").empty().append("名 称");
|
||||
$("#typeLabel").empty().append("类 型");
|
||||
$("#remarkLabel").empty().append("备 注");
|
||||
}
|
||||
}
|
||||
|
||||
//初始化表格数据
|
||||
function initTableData()
|
||||
{
|
||||
$('#tableData').datagrid({
|
||||
//title:'收支项目',
|
||||
//iconCls:'icon-save',
|
||||
//width:700,
|
||||
height:heightInfo,
|
||||
nowrap: false,
|
||||
rownumbers: false,
|
||||
//动画效果
|
||||
animate:false,
|
||||
//选中单行
|
||||
singleSelect : true,
|
||||
collapsible:false,
|
||||
selectOnCheck:false,
|
||||
//fitColumns:true,
|
||||
//单击行是否选中
|
||||
checkOnSelect : false,
|
||||
//交替出现背景
|
||||
striped : true,
|
||||
url:'<%=path %>/inOutItem/findBy.action?pageSize=' + initPageSize,
|
||||
pagination: true,
|
||||
//自动截取数据
|
||||
//nowrap : true,
|
||||
//loadFilter: pagerFilter,
|
||||
pageSize: initPageSize,
|
||||
pageList: initPageNum,
|
||||
columns:[[
|
||||
{ field: 'id',width:35,align:"center",checkbox:true},
|
||||
{ title: '名称',field: 'name',width:200},
|
||||
{ title: '类型', field: 'type',width:100,align:"center"},
|
||||
{ title: '描述',field: 'remark',width:200},
|
||||
{ title: '操作',field: 'op',align:"center",width:130,formatter:function(value,rec)
|
||||
{
|
||||
var str = '';
|
||||
var rowInfo = rec.id + 'AaBb' + rec.name +'AaBb' + rec.type + 'AaBb'+ rec.remark;
|
||||
if(1 == value)
|
||||
{
|
||||
str += '<img src="<%=path%>/js/easyui-1.3.5/themes/icons/pencil.png" style="cursor: pointer;" onclick="editInOutItem(\'' + rowInfo + '\');"/> <a onclick="editInOutItem(\'' + rowInfo + '\');" style="text-decoration:none;color:black;" href="javascript:void(0)">编辑</a> ';
|
||||
str += '<img src="<%=path%>/js/easyui-1.3.5/themes/icons/edit_remove.png" style="cursor: pointer;" onclick="deleteInOutItem(\'' + rowInfo + '\');"/> <a onclick="deleteInOutItem(\'' + rowInfo + '\');" style="text-decoration:none;color:black;" href="javascript:void(0)">删除</a> ';
|
||||
}
|
||||
return str;
|
||||
}
|
||||
}
|
||||
]],
|
||||
toolbar:[
|
||||
{
|
||||
id:'addInOutItem',
|
||||
text:'增加',
|
||||
iconCls:'icon-add',
|
||||
handler:function()
|
||||
{
|
||||
addInOutItem();
|
||||
}
|
||||
},
|
||||
{
|
||||
id:'deleteInOutItem',
|
||||
text:'删除',
|
||||
iconCls:'icon-remove',
|
||||
handler:function()
|
||||
{
|
||||
batDeleteInOutItem();
|
||||
}
|
||||
}
|
||||
],
|
||||
onLoadError:function()
|
||||
{
|
||||
$.messager.alert('页面加载提示','页面加载异常,请稍后再试!','error');
|
||||
return;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
//初始化键盘enter事件
|
||||
$(document).keydown(function(event)
|
||||
{
|
||||
//兼容 IE和firefox 事件
|
||||
var e = window.event || event;
|
||||
var k = e.keyCode||e.which||e.charCode;
|
||||
//兼容 IE,firefox 兼容
|
||||
var obj = e.srcElement ? e.srcElement : e.target;
|
||||
//绑定键盘事件为 id是指定的输入框才可以触发键盘事件 13键盘事件
|
||||
if(k == "13"&&(obj.id=="name" || obj.id=="remark"))
|
||||
{
|
||||
$("#saveInOutItem").click();
|
||||
}
|
||||
|
||||
//搜索按钮添加快捷键
|
||||
if(k == "13"&&(obj.id=="searchName" || obj.id=="searchRemark"))
|
||||
{
|
||||
$("#searchBtn").click();
|
||||
}
|
||||
});
|
||||
//分页信息处理
|
||||
function ininPager()
|
||||
{
|
||||
try
|
||||
{
|
||||
var opts = $("#tableData").datagrid('options');
|
||||
var pager = $("#tableData").datagrid('getPager');
|
||||
pager.pagination({
|
||||
onSelectPage:function(pageNum, pageSize)
|
||||
{
|
||||
opts.pageNumber = pageNum;
|
||||
opts.pageSize = pageSize;
|
||||
pager.pagination('refresh',
|
||||
{
|
||||
pageNumber:pageNum,
|
||||
pageSize:pageSize
|
||||
});
|
||||
showInOutItemDetails(pageNum,pageSize);
|
||||
}
|
||||
});
|
||||
}
|
||||
catch (e)
|
||||
{
|
||||
$.messager.alert('异常处理提示',"分页信息异常 : " + e.name + ": " + e.message,'error');
|
||||
}
|
||||
}
|
||||
|
||||
//删除收支项目
|
||||
function deleteInOutItem(inOutItemInfo)
|
||||
{
|
||||
$.messager.confirm('删除确认','确定要删除此收支项目吗?',function(r)
|
||||
{
|
||||
if (r)
|
||||
{
|
||||
var inOutItemTotalInfo = inOutItemInfo.split("AaBb");
|
||||
$.ajax({
|
||||
type:"post",
|
||||
url: "<%=path %>/inOutItem/delete.action",
|
||||
dataType: "json",
|
||||
data: ({
|
||||
inOutItemID : inOutItemTotalInfo[0],
|
||||
name:inOutItemTotalInfo[1],
|
||||
clientIp:'<%=clientIp %>'
|
||||
}),
|
||||
success: function (tipInfo)
|
||||
{
|
||||
var msg = tipInfo.showModel.msgTip;
|
||||
if(msg == '成功')
|
||||
//加载完以后重新初始化
|
||||
$("#searchBtn").click();
|
||||
else
|
||||
$.messager.alert('删除提示','删除收支项目失败,请稍后再试!','error');
|
||||
},
|
||||
//此处添加错误处理
|
||||
error:function()
|
||||
{
|
||||
$.messager.alert('删除提示','删除收支项目异常,请稍后再试!','error');
|
||||
return;
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
//批量删除收支项目
|
||||
function batDeleteInOutItem()
|
||||
{
|
||||
var row = $('#tableData').datagrid('getChecked');
|
||||
if(row.length == 0)
|
||||
{
|
||||
$.messager.alert('删除提示','没有记录被选中!','info');
|
||||
return;
|
||||
}
|
||||
if(row.length > 0)
|
||||
{
|
||||
$.messager.confirm('删除确认','确定要删除选中的' + row.length + '条收支项目吗?',function(r)
|
||||
{
|
||||
if (r)
|
||||
{
|
||||
var ids = "";
|
||||
for(var i = 0;i < row.length; i ++)
|
||||
{
|
||||
if(i == row.length-1)
|
||||
{
|
||||
ids += row[i].id;
|
||||
break;
|
||||
}
|
||||
ids += row[i].id + ",";
|
||||
}
|
||||
$.ajax({
|
||||
type:"post",
|
||||
url: "<%=path %>/inOutItem/batchDelete.action",
|
||||
dataType: "json",
|
||||
async : false,
|
||||
data: ({
|
||||
inOutItemIDs : ids,
|
||||
clientIp:'<%=clientIp %>'
|
||||
}),
|
||||
success: function (tipInfo)
|
||||
{
|
||||
var msg = tipInfo.showModel.msgTip;
|
||||
if(msg == '成功')
|
||||
{
|
||||
//加载完以后重新初始化
|
||||
$("#searchBtn").click();
|
||||
$(":checkbox").attr("checked",false);
|
||||
}
|
||||
else
|
||||
$.messager.alert('删除提示','删除收支项目失败,请稍后再试!','error');
|
||||
},
|
||||
//此处添加错误处理
|
||||
error:function()
|
||||
{
|
||||
$.messager.alert('删除提示','删除收支项目异常,请稍后再试!','error');
|
||||
return;
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
//增加收支项目
|
||||
var url;
|
||||
var inOutItemID = 0;
|
||||
//保存编辑前的名称
|
||||
var orgInOutItem = "";
|
||||
|
||||
function addInOutItem()
|
||||
{
|
||||
$('#inOutItemDlg').dialog('open').dialog('setTitle','<img src="<%=path%>/js/easyui-1.3.5/themes/icons/edit_add.png"/> 增加收支项目');
|
||||
$(".window-mask").css({ width: webW ,height: webH});
|
||||
$('#inOutItemFM').form('clear');
|
||||
|
||||
var row = {
|
||||
clientIp:'<%=clientIp %>'
|
||||
};
|
||||
$('#inOutItemFM').form('load',row);
|
||||
|
||||
$("#inOutItem").focus();
|
||||
orgInOutItem = "";
|
||||
inOutItemID = 0;
|
||||
url = '<%=path %>/inOutItem/create.action';
|
||||
}
|
||||
|
||||
//保存收支项目
|
||||
$("#saveInOutItem").unbind().bind({
|
||||
click:function()
|
||||
{
|
||||
if(checkInOutItemName())
|
||||
return;
|
||||
|
||||
$('#inOutItemFM').form('submit',{
|
||||
url: url,
|
||||
onSubmit: function()
|
||||
{
|
||||
return $(this).form('validate');
|
||||
},
|
||||
success: function(result)
|
||||
{
|
||||
var result = eval('('+result+')');
|
||||
if (!result)
|
||||
{
|
||||
$.messager.show({
|
||||
title: '错误提示',
|
||||
msg: '保存收支项目失败,请稍后重试!'
|
||||
});
|
||||
}
|
||||
else
|
||||
{
|
||||
$('#inOutItemDlg').dialog('close');
|
||||
//$('#tableData').datagrid('reload');
|
||||
//加载完以后重新初始化
|
||||
//$("#searchBtn").click();
|
||||
var opts = $("#tableData").datagrid('options');
|
||||
showInOutItemDetails(opts.pageNumber,opts.pageSize);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
//编辑收支项目
|
||||
function editInOutItem(inOutItemTotalInfo)
|
||||
{
|
||||
var inOutItemInfo = inOutItemTotalInfo.split("AaBb");
|
||||
var row = {
|
||||
name : inOutItemInfo[1],
|
||||
type : inOutItemInfo[2],
|
||||
remark : inOutItemInfo[3],
|
||||
clientIp:'<%=clientIp %>'
|
||||
};
|
||||
orgInOutItem = inOutItemInfo[1];
|
||||
$('#inOutItemDlg').dialog('open').dialog('setTitle','<img src="<%=path%>/js/easyui-1.3.5/themes/icons/pencil.png"/> 编辑收支项目');
|
||||
$(".window-mask").css({ width: webW ,height: webH});
|
||||
$('#inOutItemFM').form('load',row);
|
||||
inOutItemID = inOutItemInfo[0];
|
||||
//焦点在名称输入框==定焦在输入文字后面
|
||||
$("#inOutItem").val("").focus().val(inOutItemInfo[1]);
|
||||
url = '<%=path %>/inOutItem/update.action?inOutItemID=' + inOutItemInfo[0];
|
||||
}
|
||||
|
||||
//检查收支项目 名称是否存在 ++ 重名无法提示问题需要跟进
|
||||
function checkInOutItemName()
|
||||
{
|
||||
var inOutItemName = $.trim($("#name").val());
|
||||
//表示是否存在 true == 存在 false = 不存在
|
||||
var flag = false;
|
||||
//开始ajax名称检验,不能重名
|
||||
if(inOutItemName.length > 0 &&( orgInOutItem.length ==0 || inOutItemName != orgInOutItem))
|
||||
{
|
||||
$.ajax({
|
||||
type:"post",
|
||||
url: "<%=path %>/inOutItem/checkIsNameExist.action",
|
||||
dataType: "json",
|
||||
async : false,
|
||||
data: ({
|
||||
inOutItemID : inOutItemID,
|
||||
name : inOutItemName
|
||||
}),
|
||||
success: function (tipInfo)
|
||||
{
|
||||
flag = tipInfo;
|
||||
if(tipInfo)
|
||||
{
|
||||
$.messager.alert('提示','收支项目名称已经存在','info');
|
||||
return;
|
||||
}
|
||||
},
|
||||
//此处添加错误处理
|
||||
error:function()
|
||||
{
|
||||
$.messager.alert('提示','检查收支项目名称是否存在异常,请稍后再试!','error');
|
||||
return;
|
||||
}
|
||||
});
|
||||
}
|
||||
return flag;
|
||||
}
|
||||
|
||||
//搜索处理
|
||||
$("#searchBtn").unbind().bind({
|
||||
click:function()
|
||||
{
|
||||
showInOutItemDetails(1,initPageSize);
|
||||
var opts = $("#tableData").datagrid('options');
|
||||
var pager = $("#tableData").datagrid('getPager');
|
||||
opts.pageNumber = 1;
|
||||
opts.pageSize = initPageSize;
|
||||
pager.pagination('refresh',
|
||||
{
|
||||
pageNumber:1,
|
||||
pageSize:initPageSize
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
function showInOutItemDetails(pageNo,pageSize)
|
||||
{
|
||||
$.ajax({
|
||||
type:"post",
|
||||
url: "<%=path %>/inOutItem/findBy.action",
|
||||
dataType: "json",
|
||||
data: ({
|
||||
name:$.trim($("#searchName").val()),
|
||||
type:$.trim($("#searchType").val()),
|
||||
remark:$.trim($("#searchRemark").val()),
|
||||
pageNo:pageNo,
|
||||
pageSize:pageSize
|
||||
}),
|
||||
success: function (data)
|
||||
{
|
||||
$("#tableData").datagrid('loadData',data);
|
||||
},
|
||||
//此处添加错误处理
|
||||
error:function()
|
||||
{
|
||||
$.messager.alert('查询提示','查询数据后台异常,请稍后再试!','error');
|
||||
return;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
//重置按钮
|
||||
$("#searchResetBtn").unbind().bind({
|
||||
click:function(){
|
||||
$("#searchName").val("");
|
||||
$("#searchType").val("");
|
||||
$("#searchRemark").val("");
|
||||
//加载完以后重新初始化
|
||||
$("#searchBtn").click();
|
||||
}
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
298
src/main/webapp/pages/manage/log.jsp
Normal file
298
src/main/webapp/pages/manage/log.jsp
Normal file
@@ -0,0 +1,298 @@
|
||||
<%@page import="com.jsh.util.Tools"%>
|
||||
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
|
||||
<%
|
||||
String path = request.getContextPath();
|
||||
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
|
||||
String clientIp = Tools.getCurrentUserIP();
|
||||
%>
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>资产管理</title>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
<!-- 指定以IE8的方式来渲染 -->
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE8"/>
|
||||
<link rel="shortcut icon" href="<%=path%>/images/favicon.ico" type="image/x-icon" />
|
||||
<link rel="stylesheet" type="text/css" href="<%=path %>/js/easyui-1.3.5/themes/default/easyui.css"/>
|
||||
<link rel="stylesheet" type="text/css" href="<%=path %>/js/easyui-1.3.5/themes/icon.css"/>
|
||||
<link type="text/css" rel="stylesheet" href="<%=path %>/css/common.css" />
|
||||
<script type="text/javascript" src="<%=path %>/js/jquery-1.8.0.min.js"></script>
|
||||
<script type="text/javascript" src="<%=path %>/js/easyui-1.3.5/jquery.easyui.min.js"></script>
|
||||
<script type="text/javascript" src="<%=path %>/js/easyui-1.3.5/locale/easyui-lang-zh_CN.js"></script>
|
||||
<script type="text/javascript" src="<%=path %>/js/common/common.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<!-- 查询 -->
|
||||
<div id = "searchPanel" class="easyui-panel" style="padding:10px;position: center;" title="查询窗口" iconCls="icon-search" collapsible="true" closable="false">
|
||||
<table id="searchTable">
|
||||
<tr>
|
||||
<td>操作模块:</td>
|
||||
<td>
|
||||
<input type="text" name="searchOperation" id="searchOperation" style="width:90px;"/>
|
||||
</td>
|
||||
|
||||
<td> </td>
|
||||
<td> </td>
|
||||
<td>操作人员:</td>
|
||||
<td>
|
||||
<select name="searchUsernameID" id="searchUsernameID" style="width:90px;" />
|
||||
</td>
|
||||
<td> </td>
|
||||
<td> </td>
|
||||
<td>操作IP:</td>
|
||||
<td>
|
||||
<input type="text" name="searchIP" id="searchIP" style="width:90px;"/>
|
||||
</td>
|
||||
<td> </td>
|
||||
<td> </td>
|
||||
<td>操作状态:</td>
|
||||
<td>
|
||||
<select name="searchStatus" id="searchStatus" style="width:90px;">
|
||||
<option value="">请选择</option>
|
||||
<option value="0">成功</option>
|
||||
<option value="1">失败</option>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>开始时间:</td>
|
||||
<td>
|
||||
<input type="text" name="searchBeginTime" id="searchBeginTime" class="easyui-datebox" style="width:90px;"/>
|
||||
</td>
|
||||
<td> </td>
|
||||
<td> </td>
|
||||
<td>结束时间:</td>
|
||||
<td>
|
||||
<input type="text" name="searchEndTime" id="searchEndTime" class="easyui-datebox" style="width:90px;"/>
|
||||
</td>
|
||||
<td> </td>
|
||||
<td> </td>
|
||||
<td>操作详情:</td>
|
||||
<td>
|
||||
<input type="text" name="searchDesc" id="searchDesc" style="width:90px;"/>
|
||||
</td>
|
||||
<td> </td>
|
||||
<td colspan="3">
|
||||
<a href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-search" id="searchBtn">查询</a>
|
||||
<a href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-redo" id="searchResetBtn">重置</a>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<!-- 数据显示table -->
|
||||
<div id = "tablePanel" class="easyui-panel" style="padding:1px;top:300px;" title="操作日志列表" iconCls="icon-list" collapsible="true" closable="false">
|
||||
<table id="tableData" style="height:340px;top:300px;border-bottom-color:#FFFFFF"></table>
|
||||
</div>
|
||||
<script type="text/javascript">
|
||||
var userList = null;
|
||||
//初始化界面
|
||||
$(function()
|
||||
{
|
||||
initTableData();
|
||||
ininPager();
|
||||
//初始化系统基础信息
|
||||
initSystemData();
|
||||
//初始化页面系统基础信息选项卡
|
||||
initSelectInfo();
|
||||
});
|
||||
|
||||
//初始化表格数据
|
||||
function initTableData()
|
||||
{
|
||||
$('#tableData').datagrid({
|
||||
//title:'供应商列表',
|
||||
//iconCls:'icon-save',
|
||||
//width:700,
|
||||
height:heightInfo,
|
||||
nowrap: false,
|
||||
rownumbers: true,
|
||||
//动画效果
|
||||
animate:false,
|
||||
//选中单行
|
||||
singleSelect : true,
|
||||
collapsible:false,
|
||||
selectOnCheck:false,
|
||||
//fitColumns:true,
|
||||
//单击行是否选中
|
||||
checkOnSelect : false,
|
||||
//交替出现背景
|
||||
striped : true,
|
||||
url:'<%=path %>/log/findBy.action?pageSize=' + initPageSize,
|
||||
pagination: true,
|
||||
//loadFilter: pagerFilter,
|
||||
pageSize: initPageSize,
|
||||
pageList: initPageNum,
|
||||
columns:[[
|
||||
{ title: '操作模块',field: 'operation',width:120},
|
||||
{ title: '操作人员', field: 'username',width:100,align:"center"},
|
||||
{ title: '操作IP', field: 'clientIP',width:90,align:"center"},
|
||||
{ title: '操作时间',field: 'createTime',width:150,align:"center"},
|
||||
{ title: '操作详情',field: 'details',width:380},
|
||||
{ title: '操作状态',field: 'status',width:70},
|
||||
{ title: '备注',field: 'remark',width:180}
|
||||
]],
|
||||
onLoadError:function()
|
||||
{
|
||||
$.messager.alert('页面加载提示','页面加载异常,请稍后再试!','error');
|
||||
return;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
//初始化键盘enter事件
|
||||
$(document).keydown(function(event)
|
||||
{
|
||||
//兼容 IE和firefox 事件
|
||||
var e = window.event || event;
|
||||
var k = e.keyCode||e.which||e.charCode;
|
||||
//兼容 IE,firefox 兼容
|
||||
var obj = e.srcElement ? e.srcElement : e.target;
|
||||
//绑定键盘事件为 id是指定的输入框才可以触发键盘事件 13键盘事件
|
||||
//搜索按钮添加快捷键
|
||||
if(k == "13"&&(obj.id=="searchOperation" || obj.id=="searchUsernameID"|| obj.id=="searchIP"
|
||||
|| obj.id=="searchStatus" || obj.id=="searchBeginTime" || obj.id=="searchEndTime"
|
||||
|| obj.id=="searchDesc"))
|
||||
{
|
||||
$("#searchBtn").click();
|
||||
}
|
||||
});
|
||||
//分页信息处理
|
||||
function ininPager()
|
||||
{
|
||||
try
|
||||
{
|
||||
var opts = $("#tableData").datagrid('options');
|
||||
var pager = $("#tableData").datagrid('getPager');
|
||||
pager.pagination({
|
||||
onSelectPage:function(pageNum, pageSize)
|
||||
{
|
||||
opts.pageNumber = pageNum;
|
||||
opts.pageSize = pageSize;
|
||||
pager.pagination('refresh',
|
||||
{
|
||||
pageNumber:pageNum,
|
||||
pageSize:pageSize
|
||||
});
|
||||
showLogDetails(pageNum,pageSize);
|
||||
}
|
||||
});
|
||||
}
|
||||
catch (e)
|
||||
{
|
||||
$.messager.alert('异常处理提示',"分页信息异常 : " + e.name + ": " + e.message,'error');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//初始化系统基础信息
|
||||
function initSystemData()
|
||||
{
|
||||
$.ajax({
|
||||
type:"post",
|
||||
url: "<%=path%>/log/getBasicData.action",
|
||||
//设置为同步
|
||||
async:false,
|
||||
dataType: "json",
|
||||
success: function (systemInfo)
|
||||
{
|
||||
//成功关闭loading
|
||||
userList = systemInfo.showModel.map.userList;
|
||||
var msgTip = systemInfo.showModel.msgTip;
|
||||
if(msgTip == "exceptoin")
|
||||
{
|
||||
$.messager.alert('提示','查找系统基础信息异常,请与管理员联系!','error');
|
||||
return;
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
//初始化页面选项卡
|
||||
function initSelectInfo()
|
||||
{
|
||||
var options = "";
|
||||
|
||||
if(userList !=null)
|
||||
{
|
||||
options = "";
|
||||
for(var i = 0 ;i < userList.length;i ++)
|
||||
{
|
||||
var user = userList[i];
|
||||
if(0 == i)
|
||||
{
|
||||
userID = user.id
|
||||
}
|
||||
options += '<option value="' + user.id + '">' + user.username + '</option>';
|
||||
}
|
||||
$("#searchUsernameID").empty().append('<option value="">请选择</option>').append(options);
|
||||
}
|
||||
}
|
||||
|
||||
//搜索处理
|
||||
$("#searchBtn").unbind().bind({
|
||||
click:function()
|
||||
{
|
||||
showLogDetails(1,initPageSize);
|
||||
var opts = $("#tableData").datagrid('options');
|
||||
var pager = $("#tableData").datagrid('getPager');
|
||||
opts.pageNumber = 1;
|
||||
opts.pageSize = initPageSize;
|
||||
pager.pagination('refresh',
|
||||
{
|
||||
pageNumber:1,
|
||||
pageSize:initPageSize
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
function showLogDetails(pageNo,pageSize)
|
||||
{
|
||||
$.ajax({
|
||||
type:"post",
|
||||
url: "<%=path %>/log/findBy.action",
|
||||
dataType: "json",
|
||||
data: ({
|
||||
operation:$.trim($("#searchOperation").val()),
|
||||
usernameID:$.trim($("#searchUsernameID").val()),
|
||||
clientIp:$.trim($("#searchIP").val()),
|
||||
status:$.trim($("#searchStatus").val()),
|
||||
beginTime:$.trim($("#searchBeginTime").datebox("getValue")),
|
||||
endTime:$.trim($("#searchEndTime").datebox("getValue")),
|
||||
contentdetails:$.trim($("#searchDesc").val()),
|
||||
pageNo:pageNo,
|
||||
pageSize:pageSize
|
||||
}),
|
||||
success: function (data)
|
||||
{
|
||||
$("#tableData").datagrid('loadData',data);
|
||||
//$('#tableData').datagrid('reload');
|
||||
},
|
||||
//此处添加错误处理
|
||||
error:function()
|
||||
{
|
||||
$.messager.alert('查询提示','查询数据后台异常,请稍后再试!','error');
|
||||
return;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
//重置按钮
|
||||
$("#searchResetBtn").unbind().bind({
|
||||
click:function()
|
||||
{
|
||||
$("#searchOperation").val("");
|
||||
$("#searchUsernameID").val("");
|
||||
$("#searchIP").val("");
|
||||
$("#searchStatus").val("");
|
||||
$("#searchBeginTime").datebox("clear");
|
||||
$("#searchEndTime").datebox("clear");
|
||||
$("#searchDesc").val("");
|
||||
|
||||
//加载完以后重新初始化
|
||||
$("#searchBtn").click();
|
||||
}
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
515
src/main/webapp/pages/manage/role.jsp
Normal file
515
src/main/webapp/pages/manage/role.jsp
Normal file
@@ -0,0 +1,515 @@
|
||||
<%@page import="com.jsh.util.Tools"%>
|
||||
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
|
||||
<%
|
||||
String path = request.getContextPath();
|
||||
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
|
||||
String clientIp = Tools.getCurrentUserIP();
|
||||
%>
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>角色管理</title>
|
||||
<meta charset="utf-8">
|
||||
<!-- 指定以IE8的方式来渲染 -->
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE8"/>
|
||||
<link rel="shortcut icon" href="<%=path%>/images/favicon.ico" type="image/x-icon" />
|
||||
<script type="text/javascript" src="<%=path %>/js/jquery-1.8.0.min.js"></script>
|
||||
<script type="text/javascript" src="<%=path %>/js/colorbox/jquery.colorbox-min.js"></script>
|
||||
<script type="text/javascript" src="<%=path %>/js/colorbox/colorboxSet.js"></script>
|
||||
<link href="<%=path %>/js/colorbox/colorbox.css" rel="stylesheet" type="text/css" />
|
||||
<link rel="stylesheet" type="text/css" href="<%=path %>/js/easyui-1.3.5/themes/default/easyui.css"/>
|
||||
<link rel="stylesheet" type="text/css" href="<%=path %>/js/easyui-1.3.5/themes/icon.css"/>
|
||||
<link type="text/css" rel="stylesheet" href="<%=path %>/css/common.css" />
|
||||
<script type="text/javascript" src="<%=path %>/js/easyui-1.3.5/jquery.easyui.min.js"></script>
|
||||
<script type="text/javascript" src="<%=path %>/js/easyui-1.3.5/locale/easyui-lang-zh_CN.js"></script>
|
||||
<script type="text/javascript" src="<%=path %>/js/common/common.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<!-- 查询 -->
|
||||
<div id = "searchPanel" class="easyui-panel" style="padding:10px;" title="查询窗口" iconCls="icon-search" collapsible="true" closable="false">
|
||||
<table id="searchTable">
|
||||
<tr>
|
||||
<td>角色名称:</td>
|
||||
<td>
|
||||
<input type="text" name="searchName" id="searchName" style="width:230px;"/>
|
||||
</td>
|
||||
<td> </td>
|
||||
<td> </td>
|
||||
<td> </td>
|
||||
<td>
|
||||
<a href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-search" id="searchBtn">查询</a>
|
||||
<a href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-redo" id="searchResetBtn">重置</a>
|
||||
<a id="btnSetApp" class='easyui-linkbutton iframe iframe_LargeForm' href='#' title='分配应用'>分配应用</a>
|
||||
<a id="btnSetFunctions" class='easyui-linkbutton iframe iframe_LargeForm' href='#' title='分配功能'>分配功能</a>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<!-- 数据显示table -->
|
||||
<div id = "tablePanel" class="easyui-panel" style="padding:1px;top:300px;" title="角色列表" iconCls="icon-list" collapsible="true" closable="false">
|
||||
<table id="tableData" style="top:300px;border-bottom-color:#FFFFFF"></table>
|
||||
</div>
|
||||
|
||||
<div id="roleDlg" class="easyui-dialog" style="width:380px;padding:10px 20px"
|
||||
closed="true" buttons="#dlg-buttons" modal="true" cache="false" collapsible="false" closable="true">
|
||||
<form id="roleFM" method="post" novalidate>
|
||||
<table>
|
||||
<tr>
|
||||
<td><label id="nameLabel">角色名称 </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>
|
||||
</tr>
|
||||
</table>
|
||||
<input type="hidden" name="clientIp" id="clientIp" value="<%=clientIp %>"/>
|
||||
</form>
|
||||
</div>
|
||||
<div id="dlg-buttons">
|
||||
<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>
|
||||
</div>
|
||||
|
||||
<script type="text/javascript">
|
||||
//初始化界面
|
||||
$(function()
|
||||
{
|
||||
initTableData();
|
||||
ininPager();
|
||||
initForm();
|
||||
browserFit();
|
||||
});
|
||||
|
||||
//浏览器适配
|
||||
function browserFit()
|
||||
{
|
||||
if(getOs()=='MSIE')
|
||||
{
|
||||
$("#searchRemarkLabel").empty().append("描 述:");
|
||||
$("#nameLabel").empty().append("角色名称 ");
|
||||
}
|
||||
else
|
||||
{
|
||||
$("#searchRemarkLabel").empty().append("描 述:");
|
||||
$("#nameLabel").empty().append("角色名称 ");
|
||||
}
|
||||
}
|
||||
|
||||
//防止表单提交重复
|
||||
function initForm()
|
||||
{
|
||||
$('#roleFM').form({
|
||||
onSubmit: function(){
|
||||
return false;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
//初始化表格数据
|
||||
function initTableData()
|
||||
{
|
||||
$('#tableData').datagrid({
|
||||
//title:'角色列表',
|
||||
//iconCls:'icon-save',
|
||||
//width:700,
|
||||
height:heightInfo,
|
||||
nowrap: false,
|
||||
rownumbers: false,
|
||||
//动画效果
|
||||
animate:false,
|
||||
//选中单行
|
||||
singleSelect : true,
|
||||
collapsible:false,
|
||||
//selectOnCheck:false,
|
||||
//fitColumns:true,
|
||||
//单击行是否选中
|
||||
//checkOnSelect : false,
|
||||
url:'<%=path %>/role/findBy.action?pageSize=' + initPageSize,
|
||||
pagination: true,
|
||||
//交替出现背景
|
||||
striped : true,
|
||||
//loadFilter: pagerFilter,
|
||||
pageSize: initPageSize,
|
||||
pageList: initPageNum,
|
||||
columns:[[
|
||||
{ field: 'Id',width:35,align:"center",checkbox:true},
|
||||
{ title: '角色名称',field: 'Name',width:200},
|
||||
{ title: '操作',field: 'op',align:"center",width:130,formatter:function(value,rec)
|
||||
{
|
||||
var str = '';
|
||||
var rowInfo = rec.Id + 'AaBb' + rec.Name;
|
||||
if(1 == value)
|
||||
{
|
||||
str += '<img src="<%=path%>/js/easyui-1.3.5/themes/icons/pencil.png" style="cursor: pointer;" onclick="editRole(\'' + rowInfo + '\');"/> <a onclick="editRole(\'' + rowInfo + '\');" style="text-decoration:none;color:black;" href="javascript:void(0)">编辑</a> ';
|
||||
str += '<img src="<%=path%>/js/easyui-1.3.5/themes/icons/edit_remove.png" style="cursor: pointer;" onclick="deleteRole('+ rec.Id +');"/> <a onclick="deleteRole('+ rec.Id +');" style="text-decoration:none;color:black;" href="javascript:void(0)">删除</a> ';
|
||||
}
|
||||
return str;
|
||||
}
|
||||
}
|
||||
]],
|
||||
toolbar:[
|
||||
{
|
||||
id:'addRole',
|
||||
text:'增加',
|
||||
iconCls:'icon-add',
|
||||
handler:function()
|
||||
{
|
||||
addRole();
|
||||
}
|
||||
},
|
||||
{
|
||||
id:'deleteRole',
|
||||
text:'删除',
|
||||
iconCls:'icon-remove',
|
||||
handler:function()
|
||||
{
|
||||
batDeleteRole();
|
||||
}
|
||||
}
|
||||
],
|
||||
onLoadError:function()
|
||||
{
|
||||
$.messager.alert('页面加载提示','页面加载异常,请稍后再试!','error');
|
||||
return;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
//初始化键盘enter事件
|
||||
$(document).keydown(function(event)
|
||||
{
|
||||
//兼容 IE和firefox 事件
|
||||
var e = window.event || event;
|
||||
var k = e.keyCode||e.which||e.charCode;
|
||||
//兼容 IE,firefox 兼容
|
||||
var obj = e.srcElement ? e.srcElement : e.target;
|
||||
//绑定键盘事件为 id是指定的输入框才可以触发键盘事件 13键盘事件 ---遗留问题 enter键效验 对话框会关闭问题
|
||||
if(k == "13"&&(obj.id=="name"||obj.id=="sort"|| obj.id=="remark" ))
|
||||
{
|
||||
$("#saveRole").click();
|
||||
}
|
||||
//搜索按钮添加快捷键
|
||||
if(k == "13"&&(obj.id=="searchName" || obj.id=="searchRemark" ))
|
||||
{
|
||||
$("#searchBtn").click();
|
||||
}
|
||||
});
|
||||
//分页信息处理
|
||||
function ininPager()
|
||||
{
|
||||
try
|
||||
{
|
||||
var opts = $("#tableData").datagrid('options');
|
||||
var pager = $("#tableData").datagrid('getPager');
|
||||
pager.pagination({
|
||||
onSelectPage:function(pageNum, pageSize)
|
||||
{
|
||||
opts.pageNumber = pageNum;
|
||||
opts.pageSize = pageSize;
|
||||
pager.pagination('refresh',
|
||||
{
|
||||
pageNumber:pageNum,
|
||||
pageSize:pageSize
|
||||
});
|
||||
showRoleDetails(pageNum,pageSize);
|
||||
}
|
||||
});
|
||||
}
|
||||
catch (e)
|
||||
{
|
||||
$.messager.alert('异常处理提示',"分页信息异常 : " + e.name + ": " + e.message,'error');
|
||||
}
|
||||
}
|
||||
|
||||
//删除供应商信息
|
||||
function deleteRole(roleID)
|
||||
{
|
||||
$.messager.confirm('删除确认','确定要删除此角色信息吗?',function(r)
|
||||
{
|
||||
if (r)
|
||||
{
|
||||
$.ajax({
|
||||
type:"post",
|
||||
url: "<%=path %>/role/delete.action",
|
||||
dataType: "json",
|
||||
data: ({
|
||||
roleID : roleID,
|
||||
clientIp:'<%=clientIp %>'
|
||||
}),
|
||||
success: function (tipInfo)
|
||||
{
|
||||
var msg = tipInfo.showModel.msgTip;
|
||||
if(msg == '成功')
|
||||
{
|
||||
//加载完以后重新初始化
|
||||
$("#searchBtn").click();
|
||||
}
|
||||
else
|
||||
$.messager.alert('删除提示','删除角色信息失败,请稍后再试!','error');
|
||||
},
|
||||
//此处添加错误处理
|
||||
error:function()
|
||||
{
|
||||
$.messager.alert('删除提示','删除角色信息异常,请稍后再试!','error');
|
||||
return;
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
//批量删除供应商
|
||||
function batDeleteRole()
|
||||
{
|
||||
var row = $('#tableData').datagrid('getChecked');
|
||||
if(row.length == 0)
|
||||
{
|
||||
$.messager.alert('删除提示','没有记录被选中!','info');
|
||||
return;
|
||||
}
|
||||
if(row.length > 0)
|
||||
{
|
||||
$.messager.confirm('删除确认','确定要删除选中的' + row.length + '条角色信息吗?',function(r)
|
||||
{
|
||||
if (r)
|
||||
{
|
||||
var ids = "";
|
||||
for(var i = 0;i < row.length; i ++)
|
||||
{
|
||||
if(i == row.length-1)
|
||||
{
|
||||
ids += row[i].Id;
|
||||
break;
|
||||
}
|
||||
//alert(row[i].id);
|
||||
ids += row[i].Id + ",";
|
||||
}
|
||||
$.ajax({
|
||||
type:"post",
|
||||
url: "<%=path %>/role/batchDelete.action",
|
||||
dataType: "json",
|
||||
async : false,
|
||||
data: ({
|
||||
roleIDs : ids,
|
||||
clientIp:'<%=clientIp %>'
|
||||
}),
|
||||
success: function (tipInfo)
|
||||
{
|
||||
var msg = tipInfo.showModel.msgTip;
|
||||
if(msg == '成功')
|
||||
{
|
||||
//加载完以后重新初始化
|
||||
$("#searchBtn").click();
|
||||
$(":checkbox").attr("checked",false);
|
||||
}
|
||||
else
|
||||
$.messager.alert('删除提示','删除角色信息失败,请稍后再试!','error');
|
||||
},
|
||||
//此处添加错误处理
|
||||
error:function()
|
||||
{
|
||||
$.messager.alert('删除提示','删除角色信息异常,请稍后再试!','error');
|
||||
return;
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
//增加
|
||||
var url;
|
||||
var roleID = 0;
|
||||
//保存编辑前的名称
|
||||
var orgRole = "";
|
||||
|
||||
function addRole()
|
||||
{
|
||||
$("#clientIp").val('<%=clientIp %>');
|
||||
$("#sort").val("");
|
||||
$("#remark").val("");
|
||||
$('#roleDlg').dialog('open').dialog('setTitle','<img src="<%=path%>/js/easyui-1.3.5/themes/icons/edit_add.png"/> 增加角色信息');
|
||||
$(".window-mask").css({ width: webW ,height: webH});
|
||||
$("#name").val("").focus();
|
||||
//$('#roleFM').form('clear');
|
||||
|
||||
orgRole = "";
|
||||
roleID = 0;
|
||||
url = '<%=path %>/role/create.action';
|
||||
}
|
||||
|
||||
//保存信息
|
||||
$("#saveRole").unbind().bind({
|
||||
click:function()
|
||||
{
|
||||
if(!$('#roleFM').form('validate'))
|
||||
return;
|
||||
else if(checkRoleName())
|
||||
return;
|
||||
else
|
||||
{
|
||||
$.ajax({
|
||||
type:"post",
|
||||
url: url,
|
||||
dataType: "json",
|
||||
async : false,
|
||||
data: ({
|
||||
name : $.trim($("#name").val()),
|
||||
clientIp:'<%=clientIp %>'
|
||||
}),
|
||||
success: function (tipInfo)
|
||||
{
|
||||
if(tipInfo)
|
||||
{
|
||||
$('#roleDlg').dialog('close');
|
||||
|
||||
var opts = $("#tableData").datagrid('options');
|
||||
showRoleDetails(opts.pageNumber,opts.pageSize);
|
||||
}
|
||||
else
|
||||
{
|
||||
$.messager.show({
|
||||
title: '错误提示',
|
||||
msg: '保存角色信息失败,请稍后重试!'
|
||||
});
|
||||
}
|
||||
},
|
||||
//此处添加错误处理
|
||||
error:function()
|
||||
{
|
||||
$.messager.alert('提示','保存角色信息异常,请稍后再试!','error');
|
||||
return;
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
//编辑信息
|
||||
function editRole(roleTotalInfo)
|
||||
{
|
||||
var roleInfo = roleTotalInfo.split("AaBb");
|
||||
|
||||
$("#clientIp").val('<%=clientIp %>');
|
||||
$("#name").focus().val(roleInfo[1]);
|
||||
|
||||
orgRole = roleInfo[1];
|
||||
$('#roleDlg').dialog('open').dialog('setTitle','<img src="<%=path%>/js/easyui-1.3.5/themes/icons/pencil.png"/> 编辑角色信息');
|
||||
$(".window-mask").css({ width: webW ,height: webH});
|
||||
roleID = roleInfo[0];
|
||||
//焦点在名称输入框==定焦在输入文字后面
|
||||
$("#name").val("").focus().val(roleInfo[1]);
|
||||
url = '<%=path %>/role/update.action?roleID=' + roleInfo[0];
|
||||
}
|
||||
|
||||
//检查名称是否存在 ++ 重名无法提示问题需要跟进
|
||||
function checkRoleName()
|
||||
{
|
||||
var name = $.trim($("#name").val());
|
||||
//表示是否存在 true == 存在 false = 不存在
|
||||
var flag = false;
|
||||
//开始ajax名称检验,不能重名
|
||||
if(name.length > 0 &&( orgRole.length ==0 || name != orgRole))
|
||||
{
|
||||
$.ajax({
|
||||
type:"post",
|
||||
url: "<%=path %>/role/checkIsNameExist.action",
|
||||
dataType: "json",
|
||||
async : false,
|
||||
data: ({
|
||||
roleID : roleID,
|
||||
name : name
|
||||
}),
|
||||
success: function (tipInfo)
|
||||
{
|
||||
flag = tipInfo;
|
||||
if(tipInfo)
|
||||
{
|
||||
$.messager.alert('提示','角色名称已经存在','info');
|
||||
//alert("角色名称已经存在");
|
||||
//$("#name").val("");
|
||||
return;
|
||||
}
|
||||
},
|
||||
//此处添加错误处理
|
||||
error:function()
|
||||
{
|
||||
$.messager.alert('提示','检查角色名称是否存在异常,请稍后再试!','error');
|
||||
return;
|
||||
}
|
||||
});
|
||||
}
|
||||
return flag;
|
||||
}
|
||||
|
||||
//搜索处理
|
||||
$("#searchBtn").unbind().bind({
|
||||
click:function()
|
||||
{
|
||||
showRoleDetails(1,initPageSize);
|
||||
var opts = $("#tableData").datagrid('options');
|
||||
var pager = $("#tableData").datagrid('getPager');
|
||||
opts.pageNumber = 1;
|
||||
opts.pageSize = initPageSize;
|
||||
pager.pagination('refresh',
|
||||
{
|
||||
pageNumber:1,
|
||||
pageSize:initPageSize
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
function showRoleDetails(pageNo,pageSize)
|
||||
{
|
||||
$.ajax({
|
||||
type:"post",
|
||||
url: "<%=path %>/role/findBy.action",
|
||||
dataType: "json",
|
||||
data: ({
|
||||
name:$.trim($("#searchName").val()),
|
||||
pageNo:pageNo,
|
||||
pageSize:pageSize
|
||||
}),
|
||||
success: function (data)
|
||||
{
|
||||
$("#tableData").datagrid('loadData',data);
|
||||
},
|
||||
//此处添加错误处理
|
||||
error:function()
|
||||
{
|
||||
$.messager.alert('查询提示','查询数据后台异常,请稍后再试!','error');
|
||||
return;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
//重置按钮
|
||||
$("#searchResetBtn").unbind().bind({
|
||||
click:function(){
|
||||
$("#searchName").val("");
|
||||
|
||||
//加载完以后重新初始化
|
||||
$("#searchBtn").click();
|
||||
}
|
||||
});
|
||||
|
||||
//分配应用
|
||||
$('#btnSetApp').click(function () {
|
||||
var currentRow = $("#tableData").datagrid("getSelected");
|
||||
if (currentRow == null) {
|
||||
alert("请选择一条数据再操作!");
|
||||
return false;
|
||||
}
|
||||
this.href = "<%=path %>/pages/manage/roleApp.jsp?id=" + currentRow.Id;
|
||||
});
|
||||
|
||||
//分配功能
|
||||
$('#btnSetFunctions').click(function () {
|
||||
var currentRow = $("#tableData").datagrid("getSelected");
|
||||
if (currentRow == null) {
|
||||
alert("请选择一条数据再操作!");
|
||||
return false;
|
||||
}
|
||||
this.href = "<%=path %>/pages/manage/roleFunctions.jsp?id=" + currentRow.Id;
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
138
src/main/webapp/pages/manage/roleApp.jsp
Normal file
138
src/main/webapp/pages/manage/roleApp.jsp
Normal file
@@ -0,0 +1,138 @@
|
||||
<%@page import="com.jsh.util.Tools"%>
|
||||
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
|
||||
<%
|
||||
String path = request.getContextPath();
|
||||
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
|
||||
String clientIp = Tools.getCurrentUserIP();
|
||||
%>
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>角色对应应用</title>
|
||||
<meta charset="utf-8">
|
||||
<!-- 指定以IE8的方式来渲染 -->
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE8" />
|
||||
<link rel="shortcut icon" href="<%=path%>/images/favicon.ico" type="image/x-icon" />
|
||||
<script type="text/javascript" src="<%=path%>/js/jquery-1.8.0.min.js"></script>
|
||||
<link rel="stylesheet" type="text/css" href="<%=path%>/js/easyui-1.3.5/themes/default/easyui.css" />
|
||||
<link rel="stylesheet" type="text/css" href="<%=path%>/js/easyui-1.3.5/themes/icon.css" />
|
||||
<link type="text/css" rel="stylesheet" href="<%=path%>/css/common.css" />
|
||||
<script type="text/javascript" src="<%=path%>/js/easyui-1.3.5/jquery.easyui.min.js"></script>
|
||||
<script type="text/javascript" src="<%=path%>/js/easyui-1.3.5/locale/easyui-lang-zh_CN.js"></script>
|
||||
<script type="text/javascript" src="<%=path%>/js/common/common.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<!-- 数据显示table -->
|
||||
<div>
|
||||
<a id="btnOK" class="easyui-linkbutton">保存</a>
|
||||
</div>
|
||||
<div>
|
||||
<ul id="tt"></ul>
|
||||
</div>
|
||||
|
||||
<script type="text/javascript">
|
||||
var url_id = getUrlParam('id'); //获取传值id(角色id)
|
||||
var type="RoleAPP";
|
||||
var url;//定义链接地址
|
||||
|
||||
function GetNode(ctype) {
|
||||
var node = $('#tt').tree('getChecked');
|
||||
var cnodes = '';
|
||||
var pnodes = '';
|
||||
|
||||
var prevNode = ''; //保存上一步所选父节点
|
||||
for (var i = 0; i < node.length; i++) {
|
||||
|
||||
if ($('#tt').tree('isLeaf', node[i].target)) {
|
||||
cnodes += '[' + node[i].id + ']';
|
||||
|
||||
var pnode = $('#tt').tree('getParent', node[i].target); //获取当前节点的父节点
|
||||
if (prevNode != pnode.id) //保证当前父节点与上一次父节点不同
|
||||
{
|
||||
pnodes += '[' + pnode.id + ']';
|
||||
prevNode = pnode.id; //保存当前节点
|
||||
}
|
||||
}
|
||||
}
|
||||
//cnodes = cnodes.substring(0, cnodes.length - 1);
|
||||
pnodes = pnodes.substring(0, pnodes.length - 1);
|
||||
|
||||
if (ctype == 'child') { return cnodes; }
|
||||
else { return pnodes };
|
||||
};
|
||||
|
||||
$(function () {
|
||||
|
||||
$('#tt').tree({
|
||||
url:'<%=path%>/app/findRoleAPP.action?UBType='+type+'&UBKeyId='+url_id,
|
||||
animate:true,
|
||||
checkbox:true
|
||||
});
|
||||
|
||||
|
||||
$("#btnOK").click(
|
||||
function() {
|
||||
if(!checkRoleAPP())
|
||||
{
|
||||
url = '<%=path%>/userBusiness/create.action';
|
||||
}
|
||||
else
|
||||
{
|
||||
url = '<%=path%>/userBusiness/update.action';
|
||||
}
|
||||
|
||||
if (confirm("您确定要保存吗?")) {
|
||||
|
||||
$.ajax({
|
||||
type: "post",
|
||||
url:url,
|
||||
data: { Type: type, KeyId: url_id, Value: GetNode('child'),clientIp:'<%=clientIp %>'
|
||||
},
|
||||
dataType: "json",
|
||||
async : false,
|
||||
success: function (tipInfo) {
|
||||
if (tipInfo) {
|
||||
self.parent.$.colorbox.close();
|
||||
alert("操作成功!");
|
||||
}
|
||||
else
|
||||
alert(tipInfo);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
});
|
||||
|
||||
//检查记录是否存在
|
||||
function checkRoleAPP()
|
||||
{
|
||||
//表示是否存在 true == 存在 false = 不存在
|
||||
var flag = false;
|
||||
//开始ajax名称检验,是否存在
|
||||
$.ajax({
|
||||
type:"post",
|
||||
url: "<%=path %>/userBusiness/checkIsValueExist.action",
|
||||
dataType: "json",
|
||||
async : false,
|
||||
data: ({
|
||||
Type : type,
|
||||
KeyId : url_id
|
||||
}),
|
||||
success: function (tipInfo)
|
||||
{
|
||||
flag = tipInfo;
|
||||
},
|
||||
//此处添加错误处理
|
||||
error:function()
|
||||
{
|
||||
$.messager.alert('提示','检查角色对应应用是否存在异常,请稍后再试!','error');
|
||||
return;
|
||||
}
|
||||
});
|
||||
return flag;
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
138
src/main/webapp/pages/manage/roleFunctions.jsp
Normal file
138
src/main/webapp/pages/manage/roleFunctions.jsp
Normal file
@@ -0,0 +1,138 @@
|
||||
<%@page import="com.jsh.util.Tools"%>
|
||||
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
|
||||
<%
|
||||
String path = request.getContextPath();
|
||||
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
|
||||
String clientIp = Tools.getCurrentUserIP();
|
||||
%>
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>角色对应应用</title>
|
||||
<meta charset="utf-8">
|
||||
<!-- 指定以IE8的方式来渲染 -->
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE8" />
|
||||
<link rel="shortcut icon" href="<%=path%>/images/favicon.ico" type="image/x-icon" />
|
||||
<script type="text/javascript" src="<%=path%>/js/jquery-1.8.0.min.js"></script>
|
||||
<link rel="stylesheet" type="text/css" href="<%=path%>/js/easyui-1.3.5/themes/default/easyui.css" />
|
||||
<link rel="stylesheet" type="text/css" href="<%=path%>/js/easyui-1.3.5/themes/icon.css" />
|
||||
<link type="text/css" rel="stylesheet" href="<%=path%>/css/common.css" />
|
||||
<script type="text/javascript" src="<%=path%>/js/easyui-1.3.5/jquery.easyui.min.js"></script>
|
||||
<script type="text/javascript" src="<%=path%>/js/easyui-1.3.5/locale/easyui-lang-zh_CN.js"></script>
|
||||
<script type="text/javascript" src="<%=path%>/js/common/common.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<!-- 数据显示table -->
|
||||
<div>
|
||||
<a id="btnOK" class="easyui-linkbutton">保存</a>
|
||||
</div>
|
||||
<div>
|
||||
<ul id="tt"></ul>
|
||||
</div>
|
||||
|
||||
<script type="text/javascript">
|
||||
var url_id = getUrlParam('id'); //获取传值id(角色id)
|
||||
var type="RoleFunctions";
|
||||
var url;//定义链接地址
|
||||
|
||||
function GetNode(ctype) {
|
||||
var node = $('#tt').tree('getChecked');
|
||||
var cnodes = '';
|
||||
var pnodes = '';
|
||||
|
||||
var prevNode = ''; //保存上一步所选父节点
|
||||
for (var i = 0; i < node.length; i++) {
|
||||
|
||||
if ($('#tt').tree('isLeaf', node[i].target)) {
|
||||
cnodes += '[' + node[i].id + ']';
|
||||
|
||||
var pnode = $('#tt').tree('getParent', node[i].target); //获取当前节点的父节点
|
||||
if (prevNode != pnode.id) //保证当前父节点与上一次父节点不同
|
||||
{
|
||||
pnodes += '[' + pnode.id + ']';
|
||||
prevNode = pnode.id; //保存当前节点
|
||||
}
|
||||
}
|
||||
}
|
||||
//cnodes = cnodes.substring(0, cnodes.length - 1);
|
||||
pnodes = pnodes.substring(0, pnodes.length - 1);
|
||||
|
||||
if (ctype == 'child') { return cnodes; }
|
||||
else { return pnodes };
|
||||
};
|
||||
|
||||
$(function () {
|
||||
|
||||
$('#tt').tree({
|
||||
url:'<%=path%>/functions/findRoleFunctions.action?UBType='+type+'&UBKeyId='+url_id,
|
||||
animate:true,
|
||||
checkbox:true
|
||||
});
|
||||
|
||||
|
||||
$("#btnOK").click(
|
||||
function() {
|
||||
if(!checkRoleFunctions())
|
||||
{
|
||||
url = '<%=path%>/userBusiness/create.action';
|
||||
}
|
||||
else
|
||||
{
|
||||
url = '<%=path%>/userBusiness/update.action';
|
||||
}
|
||||
|
||||
if (confirm("您确定要保存吗?")) {
|
||||
|
||||
$.ajax({
|
||||
type: "post",
|
||||
url:url,
|
||||
data: { Type: type, KeyId: url_id, Value: GetNode('child'),clientIp:'<%=clientIp %>'
|
||||
},
|
||||
dataType: "json",
|
||||
async : false,
|
||||
success: function (tipInfo) {
|
||||
if (tipInfo) {
|
||||
self.parent.$.colorbox.close();
|
||||
alert("操作成功!");
|
||||
}
|
||||
else
|
||||
alert(tipInfo);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
});
|
||||
|
||||
//检查记录是否存在
|
||||
function checkRoleFunctions()
|
||||
{
|
||||
//表示是否存在 true == 存在 false = 不存在
|
||||
var flag = false;
|
||||
//开始ajax名称检验,是否存在
|
||||
$.ajax({
|
||||
type:"post",
|
||||
url: "<%=path %>/userBusiness/checkIsValueExist.action",
|
||||
dataType: "json",
|
||||
async : false,
|
||||
data: ({
|
||||
Type : type,
|
||||
KeyId : url_id
|
||||
}),
|
||||
success: function (tipInfo)
|
||||
{
|
||||
flag = tipInfo;
|
||||
},
|
||||
//此处添加错误处理
|
||||
error:function()
|
||||
{
|
||||
$.messager.alert('提示','检查角色对应功能是否存在异常,请稍后再试!','error');
|
||||
return;
|
||||
}
|
||||
});
|
||||
return flag;
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
608
src/main/webapp/pages/manage/user.jsp
Normal file
608
src/main/webapp/pages/manage/user.jsp
Normal file
@@ -0,0 +1,608 @@
|
||||
<%@page import="com.jsh.util.Tools"%>
|
||||
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
|
||||
<%
|
||||
String path = request.getContextPath();
|
||||
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
|
||||
String clientIp = Tools.getCurrentUserIP();
|
||||
%>
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>用户管理</title>
|
||||
<meta charset="utf-8">
|
||||
<!-- 指定以IE8的方式来渲染 -->
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE8"/>
|
||||
<link rel="shortcut icon" href="<%=path%>/images/favicon.ico" type="image/x-icon" />
|
||||
<script type="text/javascript" src="<%=path %>/js/jquery-1.8.0.min.js"></script>
|
||||
<script type="text/javascript" src="<%=path %>/js/colorbox/jquery.colorbox-min.js"></script>
|
||||
<script type="text/javascript" src="<%=path %>/js/colorbox/colorboxSet.js"></script>
|
||||
<link href="<%=path %>/js/colorbox/colorbox.css" rel="stylesheet" type="text/css" />
|
||||
<link rel="stylesheet" type="text/css" href="<%=path %>/js/easyui-1.3.5/themes/default/easyui.css"/>
|
||||
<link rel="stylesheet" type="text/css" href="<%=path %>/js/easyui-1.3.5/themes/icon.css"/>
|
||||
<link type="text/css" rel="stylesheet" href="<%=path %>/css/common.css" />
|
||||
<script type="text/javascript" src="<%=path %>/js/easyui-1.3.5/jquery.easyui.min.js"></script>
|
||||
<script type="text/javascript" src="<%=path %>/js/easyui-1.3.5/locale/easyui-lang-zh_CN.js"></script>
|
||||
<script type="text/javascript" src="<%=path %>/js/common/common.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<!-- 查询 -->
|
||||
<div id = "searchPanel" class="easyui-panel" style="padding:10px;" title="查询窗口" iconCls="icon-search" collapsible="true" closable="false">
|
||||
<table id="searchTable">
|
||||
<tr>
|
||||
<td>用户名称:</td>
|
||||
<td>
|
||||
<input type="text" name="searchUsername" id="searchUsername" style="width:100px;"/>
|
||||
</td>
|
||||
<td> </td>
|
||||
<td> </td>
|
||||
<td>登录名称:</td>
|
||||
<td>
|
||||
<input type="text" name="searchLoginame" id="searchLoginame" style="width:100px;"/>
|
||||
</td>
|
||||
<td> </td>
|
||||
<td> </td>
|
||||
<td> </td>
|
||||
<td>
|
||||
<a href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-search" id="searchBtn">查询</a>
|
||||
<a href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-redo" id="searchResetBtn">重置</a>
|
||||
<a id="btnSetRole" class='easyui-linkbutton iframe iframe_LargeForm' href='#' title='分配角色'>分配角色</a>
|
||||
<a id="btnSetDepart" class='easyui-linkbutton iframe iframe_LargeForm' href='#' title='分配仓库'>分配仓库</a>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<!-- 数据显示table -->
|
||||
<div id = "tablePanel" class="easyui-panel" style="padding:1px;top:300px;" title="用户列表" iconCls="icon-list" collapsible="true" closable="false">
|
||||
<table id="tableData" style="top:300px;border-bottom-color:#FFFFFF"></table>
|
||||
</div>
|
||||
|
||||
<div id="userDlg" class="easyui-dialog" style="width:380px;padding:10px 20px"
|
||||
closed="true" buttons="#dlg-buttons" modal="true" collapsible="false" closable="true">
|
||||
<form id="usernameFM" method="post" novalidate>
|
||||
<div class="fitem" style="padding:5px">
|
||||
<label id="usernameLabel">用户名称 </label>
|
||||
<input name="username" id="username" class="easyui-validatebox" data-options="required:true,validType:'length[2,30]'" style="width: 230px;height: 20px"/>
|
||||
</div>
|
||||
<div class="fitem" style="padding:5px">
|
||||
<label id="loginameLabel">登录名称 </label>
|
||||
<input name="loginame" id="loginame" style="width: 230px;height: 20px"/>
|
||||
</div>
|
||||
<div class="fitem" style="padding:5px">
|
||||
<label id="departmentLabel">部 门 </label>
|
||||
<input name="department" id="department" style="width: 230px;height: 20px"/>
|
||||
</div>
|
||||
<div class="fitem" style="padding:5px">
|
||||
<label id="positionLabel">职 位 </label>
|
||||
<input name="position" id="position" style="width: 230px;height: 20px"/>
|
||||
</div>
|
||||
<div class="fitem" style="padding:5px">
|
||||
<label id="phonenumLabel">联系电话 </label>
|
||||
<input name="phonenum" id="phonenum" class="easyui-numberbox" style="width: 230px;height: 20px"/>
|
||||
</div>
|
||||
<div class="fitem" style="padding:5px">
|
||||
<label id="emailLabel">电子邮箱 </label>
|
||||
<input name="email" id="email" class="easyui-validatebox" validType="email" style="width: 230px;height: 20px"/>
|
||||
</div>
|
||||
<div class="fitem" style="padding:5px">
|
||||
<label id="descriptionLabel">描 述 </label>
|
||||
<textarea name="description" id="description" rows="2" cols="2" style="width: 230px;"></textarea>
|
||||
</div>
|
||||
<input type="hidden" name="clientIp" id="clientIp" value="<%=clientIp %>"/>
|
||||
</form>
|
||||
</div>
|
||||
<!--
|
||||
<div id="userLoginDlg" class="easyui-dialog" style="width:400px;height:280px;padding:10px 20px"
|
||||
closed="true" buttons="#logindlg-buttons" modal="true" iconCls="icon-save" collapsible="false" closable="true">
|
||||
<div class="fitem" style="padding:5px">
|
||||
<label>登录名称 </label>
|
||||
<input name="loginname" id="loginname" rows="3" cols="3" style="width: 230px;height: 20px"/>
|
||||
</div>
|
||||
<div class="fitem" style="padding:5px">
|
||||
<label>登录密码 </label>
|
||||
<input name="loginpwd" id="loginpwd" rows="3" cols="3" style="width: 230px;height: 20px"/>
|
||||
</div>
|
||||
<div class="fitem" style="padding:5px">
|
||||
<label>确定密码 </label>
|
||||
<input name="confirmloginpwd" id="confirmloginpwd" rows="3" cols="3" style="width: 230px;height: 20px"/>
|
||||
</div>
|
||||
</div>
|
||||
<div id="logindlg-buttons">
|
||||
<a href="javascript:void(0)" id="saveloginame" class="easyui-linkbutton" iconCls="icon-ok">保存</a>
|
||||
<a href="javascript:void(0)" id="canceloginame" class="easyui-linkbutton" iconCls="icon-cancel" onclick="javascript:$('#userLoginDlg').dialog('close')">取消</a>
|
||||
</div>
|
||||
-->
|
||||
<div id="dlg-buttons">
|
||||
<a href="javascript:void(0)" id="saveusername" class="easyui-linkbutton" iconCls="icon-ok">保存</a>
|
||||
<a href="javascript:void(0)" id="cancelusername" class="easyui-linkbutton" iconCls="icon-cancel" onclick="javascript:$('#userDlg').dialog('close')">取消</a>
|
||||
</div>
|
||||
|
||||
<script type="text/javascript">
|
||||
//初始化界面
|
||||
$(function()
|
||||
{
|
||||
initTableData();
|
||||
ininPager();
|
||||
browserFit();
|
||||
});
|
||||
|
||||
//浏览器适配
|
||||
function browserFit()
|
||||
{
|
||||
if(getOs()=='MSIE')
|
||||
{
|
||||
$("#usernameLabel").empty().append("用户名称 ");
|
||||
$("#loginameLabel").empty().append("登录名称 ");
|
||||
$("#departmentLabel").empty().append("部 门 ");
|
||||
$("#positionLabel").empty().append("职 位 ");
|
||||
$("#phonenumLabel").empty().append("联系电话 ");
|
||||
$("#emailLabel").empty().append("电子邮箱 ");
|
||||
$("#descriptionLabel").empty().append("描 述 ");
|
||||
$("#searchPositionLabel").empty().append("职 位:");
|
||||
$("#searchDeptLabel").empty().append("部 门:");
|
||||
$("#searchDescLabel").empty().append("描 述:");
|
||||
}
|
||||
else
|
||||
{
|
||||
$("#usernameLabel").empty().append("用户名称 ");
|
||||
$("#loginameLabel").empty().append("登录名称 ");
|
||||
$("#departmentLabel").empty().append("部 门 ");
|
||||
$("#positionLabel").empty().append("职 位 ");
|
||||
$("#phonenumLabel").empty().append("联系电话 ");
|
||||
$("#emailLabel").empty().append("电子邮箱 ");
|
||||
$("#descriptionLabel").empty().append("描 述 ");
|
||||
$("#searchPositionLabel").empty().append("职 位:");
|
||||
$("#searchDeptLabel").empty().append("部 门:");
|
||||
$("#searchDescLabel").empty().append("描 述:");
|
||||
}
|
||||
}
|
||||
|
||||
//初始化表格数据
|
||||
function initTableData()
|
||||
{
|
||||
$('#tableData').datagrid({
|
||||
//title:'用户列表',
|
||||
//iconCls:'icon-save',
|
||||
//width:widthInfo,
|
||||
height:heightInfo,
|
||||
nowrap: false,
|
||||
rownumbers: false,
|
||||
//动画效果
|
||||
animate:false,
|
||||
//选中单行
|
||||
singleSelect : true,
|
||||
collapsible:false,
|
||||
//selectOnCheck:false,
|
||||
//fitColumns:true,
|
||||
//单击行是否选中
|
||||
//checkOnSelect : false,
|
||||
url:'<%=path %>/user/findBy.action?pageSize=' + initPageSize,
|
||||
pagination: true,
|
||||
//交替出现背景
|
||||
striped : true,
|
||||
//loadFilter: pagerFilter,
|
||||
pageSize: initPageSize,
|
||||
pageList: initPageNum,
|
||||
columns:[[
|
||||
{ field: 'id',width:35,align:"center",checkbox:true},
|
||||
{ title: '用户名称',field: 'username',width:80},
|
||||
{ title: '登录名称', field: 'loginame',width:80,align:"center"},
|
||||
{ title: '职位', field: 'position',width:115,align:"center"},
|
||||
{ title: '部门',field: 'department',width:115,align:"center"},
|
||||
|
||||
{ title: '电子邮箱',field: 'email',width:150,align:"center"},
|
||||
{ title: '电话号码',field: 'phonenum',width:150,align:"center"},
|
||||
{ title: '描述',field: 'description',width:150},
|
||||
{ title: '操作',field: 'op',width:160,formatter:function(value,rec)
|
||||
{
|
||||
var str = '';
|
||||
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.isystem + 'AaBb' + rec.description;
|
||||
if(1 == value)
|
||||
{
|
||||
str += '<img src="<%=path%>/js/easyui-1.3.5/themes/icons/pencil.png" style="cursor: pointer;" onclick="editUser(\'' + rowInfo + '\');"/> <a onclick="editUser(\'' + rowInfo + '\');" style="text-decoration:none;color:black;" href="javascript:void(0)">编辑</a> ';
|
||||
str += '<img src="<%=path%>/js/easyui-1.3.5/themes/icons/edit_remove.png" style="cursor: pointer;" onclick="deleteUser('+ rec.id +');"/> <a onclick="deleteUser('+ rec.id +');" style="text-decoration:none;color:black;" href="javascript:void(0)">删除</a> ';
|
||||
//str += '<img src="<%=path%>/images/user.png" style="cursor: pointer;width: 16px;height: 16px" onclick="editUser(\'' + rowInfo + '\');"/> <a onclick="editUser(\'' + rowInfo + '\');" style="text-decoration:none;color:black;" href="javascript:void(0)">用户</a> ';
|
||||
}
|
||||
//else
|
||||
//{
|
||||
//str += '<img src="<%=path%>/images/admin.png" style="cursor: pointer;width: 16px;height: 16px" onclick="editUser(\'' + rowInfo + '\');"/> <a onclick="editUser(\'' + rowInfo + '\');" style="text-decoration:none;color:black;" href="javascript:void(0)">管理</a> ';
|
||||
//}
|
||||
return str;
|
||||
}
|
||||
}
|
||||
]],
|
||||
toolbar:[
|
||||
{
|
||||
id:'addUser',
|
||||
text:'增加',
|
||||
iconCls:'icon-add',
|
||||
handler:function()
|
||||
{
|
||||
addUser();
|
||||
}
|
||||
},
|
||||
{
|
||||
id:'deleteUser',
|
||||
text:'删除',
|
||||
iconCls:'icon-remove',
|
||||
handler:function()
|
||||
{
|
||||
batDeleteUser();
|
||||
}
|
||||
}
|
||||
],
|
||||
onLoadError:function()
|
||||
{
|
||||
$.messager.alert('页面加载提示','页面加载异常,请稍后再试!','error');
|
||||
return;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
//初始化键盘enter事件
|
||||
$(document).keydown(function(event)
|
||||
{
|
||||
//兼容 IE和firefox 事件
|
||||
var e = window.event || event;
|
||||
var k = e.keyCode||e.which||e.charCode;
|
||||
//兼容 IE,firefox 兼容
|
||||
var obj = e.srcElement ? e.srcElement : e.target;
|
||||
//绑定键盘事件为 id是指定的输入框才可以触发键盘事件 13键盘事件
|
||||
if(k == "13"&&(obj.id=="username" || obj.id=="department"|| obj.id=="phonenum"
|
||||
|| obj.id=="email" || obj.id=="description" || obj.id=="position"))
|
||||
{
|
||||
$("#saveusername").click();
|
||||
}
|
||||
|
||||
//搜索按钮添加快捷键
|
||||
if(k == "13"&&(obj.id=="searchUsername" || obj.id=="searchLoginame"|| obj.id=="searchPhonenum"
|
||||
|| obj.id=="searchPosition"|| obj.id=="searchEmail" || obj.id=="searchDesc" || obj.id=="searchDept" ))
|
||||
{
|
||||
$("#searchBtn").click();
|
||||
}
|
||||
});
|
||||
//分页信息处理
|
||||
function ininPager()
|
||||
{
|
||||
try
|
||||
{
|
||||
var opts = $("#tableData").datagrid('options');
|
||||
var pager = $("#tableData").datagrid('getPager');
|
||||
pager.pagination({
|
||||
onSelectPage:function(pageNum, pageSize)
|
||||
{
|
||||
opts.pageNumber = pageNum;
|
||||
opts.pageSize = pageSize;
|
||||
pager.pagination('refresh',
|
||||
{
|
||||
pageNumber:pageNum,
|
||||
pageSize:pageSize
|
||||
});
|
||||
showUserDetails(pageNum,pageSize);
|
||||
}
|
||||
});
|
||||
}
|
||||
catch (e)
|
||||
{
|
||||
$.messager.alert('异常处理提示',"分页信息异常 : " + e.name + ": " + e.message,'error');
|
||||
}
|
||||
}
|
||||
|
||||
//删除用户信息
|
||||
function deleteUser(userID)
|
||||
{
|
||||
$.messager.confirm('删除确认','确定要删除此用户信息吗?',function(r)
|
||||
{
|
||||
if (r)
|
||||
{
|
||||
$.ajax({
|
||||
type:"post",
|
||||
url: "<%=path %>/user/delete.action",
|
||||
dataType: "json",
|
||||
data: ({
|
||||
userID : userID,
|
||||
clientIp:'<%=clientIp %>'
|
||||
}),
|
||||
success: function (tipInfo)
|
||||
{
|
||||
var msg = tipInfo.showModel.msgTip;
|
||||
if(msg == '成功')
|
||||
{
|
||||
//$('#tableData').datagrid('reload');
|
||||
//加载完以后重新初始化
|
||||
$("#searchBtn").click();
|
||||
//var opts = $("#tableData").datagrid('options');
|
||||
//showUserDetails(opts.pageNumber,opts.pageSize);
|
||||
}
|
||||
else
|
||||
$.messager.alert('删除提示','删除用户信息失败,请稍后再试!','error');
|
||||
},
|
||||
//此处添加错误处理
|
||||
error:function()
|
||||
{
|
||||
$.messager.alert('删除提示','删除用户信息异常,请稍后再试!','error');
|
||||
return;
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
//批量删除用户
|
||||
function batDeleteUser()
|
||||
{
|
||||
var row = $('#tableData').datagrid('getChecked');
|
||||
if(row.length == 0)
|
||||
{
|
||||
$.messager.alert('删除提示','没有记录被选中!','info');
|
||||
return;
|
||||
}
|
||||
if(row.length > 0)
|
||||
{
|
||||
$.messager.confirm('删除确认','确定要删除选中的' + row.length + '条用户信息吗?',function(r)
|
||||
{
|
||||
if (r)
|
||||
{
|
||||
var ids = "";
|
||||
for(var i = 0;i < row.length; i ++)
|
||||
{
|
||||
if(i == row.length-1)
|
||||
{
|
||||
ids += row[i].id;
|
||||
break;
|
||||
}
|
||||
ids += row[i].id + ",";
|
||||
}
|
||||
$.ajax({
|
||||
type:"post",
|
||||
url: "<%=path %>/user/batchDelete.action",
|
||||
dataType: "json",
|
||||
async : false,
|
||||
data: ({
|
||||
userIDs : ids,
|
||||
clientIp:'<%=clientIp %>'
|
||||
}),
|
||||
success: function (tipInfo)
|
||||
{
|
||||
var msg = tipInfo.showModel.msgTip;
|
||||
if(msg == '成功')
|
||||
{
|
||||
//$('#tableData').datagrid('reload');
|
||||
//加载完以后重新初始化
|
||||
$("#searchBtn").click();
|
||||
$(":checkbox").attr("checked",false);
|
||||
}
|
||||
else
|
||||
$.messager.alert('删除提示','删除用户信息失败,请稍后再试!','error');
|
||||
},
|
||||
//此处添加错误处理
|
||||
error:function()
|
||||
{
|
||||
$.messager.alert('删除提示','删除用户信息异常,请稍后再试!','error');
|
||||
return;
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
//增加用户
|
||||
var url;
|
||||
var userID = 0;
|
||||
//保存编辑前的名称
|
||||
var orgusername = "";
|
||||
|
||||
function addUser()
|
||||
{
|
||||
$('#userDlg').dialog('open').dialog('setTitle','<img src="<%=path%>/js/easyui-1.3.5/themes/icons/edit_add.png"/> 增加用户');
|
||||
$(".window-mask").css({ width: webW ,height: webH});
|
||||
$('#usernameFM').form('clear');
|
||||
var row = {
|
||||
clientIp:'<%=clientIp %>'
|
||||
};
|
||||
$('#usernameFM').form('load',row);
|
||||
$("#username").focus();
|
||||
orgusername = "";
|
||||
userID = 0;
|
||||
url = '<%=path %>/user/create.action';
|
||||
}
|
||||
|
||||
//保存用户信息
|
||||
$("#saveusername").unbind().bind({
|
||||
click:function()
|
||||
{
|
||||
if(checkusernameName())
|
||||
return;
|
||||
|
||||
var reg = /^([0-9])+$/;
|
||||
var phonenum = $.trim($("#phonenum").val());
|
||||
if(phonenum.length>0 && !reg.test(phonenum))
|
||||
{
|
||||
$.messager.alert('提示','电话号码只能是数字','info');
|
||||
$("#phonenum").val("").focus();
|
||||
return;
|
||||
}
|
||||
|
||||
$('#usernameFM').form('submit',{
|
||||
url: url,
|
||||
onSubmit: function()
|
||||
{
|
||||
return $(this).form('validate');
|
||||
},
|
||||
success: function(result)
|
||||
{
|
||||
var result = eval('('+result+')');
|
||||
if (!result)
|
||||
{
|
||||
$.messager.show({
|
||||
title: '错误提示',
|
||||
msg: '保存用户信息失败,请稍后重试!'
|
||||
});
|
||||
}
|
||||
else
|
||||
{
|
||||
$('#userDlg').dialog('close');
|
||||
//$('#tableData').datagrid('reload');
|
||||
//加载完以后重新初始化
|
||||
//$("#searchBtn").click();
|
||||
var opts = $("#tableData").datagrid('options');
|
||||
showUserDetails(opts.pageNumber,opts.pageSize);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
//编辑用户信息
|
||||
function editUser(usernameTotalInfo)
|
||||
{
|
||||
var usernameInfo = usernameTotalInfo.split("AaBb");
|
||||
var row = {
|
||||
username : usernameInfo[1],
|
||||
loginame : usernameInfo[2],
|
||||
position : usernameInfo[3],
|
||||
department : usernameInfo[4],
|
||||
email : usernameInfo[5],
|
||||
phonenum : usernameInfo[6],
|
||||
description : usernameInfo[9],
|
||||
clientIp:'<%=clientIp %>'
|
||||
};
|
||||
orgusername = usernameInfo[1];
|
||||
$('#userDlg').dialog('open').dialog('setTitle','<img src="<%=path%>/js/easyui-1.3.5/themes/icons/pencil.png"/> 编辑用户信息');
|
||||
$(".window-mask").css({ width: webW ,height: webH});
|
||||
$('#usernameFM').form('load',row);
|
||||
userID = usernameInfo[0];
|
||||
//焦点在名称输入框==定焦在输入文字后面
|
||||
$("#username").val("").focus().val(usernameInfo[1]);
|
||||
url = '<%=path %>/user/update.action?userID=' + usernameInfo[0];
|
||||
}
|
||||
|
||||
//$("#username").unbind().bind({
|
||||
//blur:checkusernameName
|
||||
//});
|
||||
|
||||
//检查用户 名称是否存在 ++ 重名无法提示问题需要跟进
|
||||
function checkusernameName()
|
||||
{
|
||||
var usernameName = $.trim($("#username").val());
|
||||
//表示是否存在 true == 存在 false = 不存在
|
||||
var flag = false;
|
||||
//开始ajax名称检验,不能重名
|
||||
if(usernameName.length > 0 &&( orgusername.length ==0 || usernameName != orgusername))
|
||||
{
|
||||
$.ajax({
|
||||
type:"post",
|
||||
url: "<%=path %>/user/checkIsNameExist.action",
|
||||
dataType: "json",
|
||||
async : false,
|
||||
data: ({
|
||||
userID : userID,
|
||||
username : usernameName
|
||||
}),
|
||||
success: function (tipInfo)
|
||||
{
|
||||
flag = tipInfo;
|
||||
if(tipInfo)
|
||||
{
|
||||
$.messager.alert('提示','用户名称已经存在','info');
|
||||
//alert("用户名称已经存在");
|
||||
//$("#username").val("");
|
||||
return;
|
||||
}
|
||||
},
|
||||
//此处添加错误处理
|
||||
error:function()
|
||||
{
|
||||
$.messager.alert('提示','检查用户名称是否存在异常,请稍后再试!','error');
|
||||
return;
|
||||
}
|
||||
});
|
||||
}
|
||||
return flag;
|
||||
}
|
||||
|
||||
//搜索处理
|
||||
$("#searchBtn").unbind().bind({
|
||||
click:function()
|
||||
{
|
||||
showUserDetails(1,initPageSize);
|
||||
var opts = $("#tableData").datagrid('options');
|
||||
var pager = $("#tableData").datagrid('getPager');
|
||||
opts.pageNumber = 1;
|
||||
opts.pageSize = initPageSize;
|
||||
pager.pagination('refresh',
|
||||
{
|
||||
pageNumber:1,
|
||||
pageSize:initPageSize
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
function showUserDetails(pageNo,pageSize)
|
||||
{
|
||||
$.ajax({
|
||||
type:"post",
|
||||
url: "<%=path %>/user/findBy.action",
|
||||
dataType: "json",
|
||||
data: ({
|
||||
username:$.trim($("#searchUsername").val()),
|
||||
loginame:$.trim($("#searchLoginame").val()),
|
||||
pageNo:pageNo,
|
||||
pageSize:pageSize
|
||||
}),
|
||||
success: function (data)
|
||||
{
|
||||
$("#tableData").datagrid('loadData',data);
|
||||
//$('#tableData').datagrid('reload');
|
||||
},
|
||||
//此处添加错误处理
|
||||
error:function()
|
||||
{
|
||||
$.messager.alert('查询提示','查询数据后台异常,请稍后再试!','error');
|
||||
return;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
//重置按钮
|
||||
$("#searchResetBtn").unbind().bind({
|
||||
click:function(){
|
||||
$("#searchUsername").val("");
|
||||
$("#searchLoginame").val("");
|
||||
$("#searchPhonenum").val("");
|
||||
$("#searchPosition").val("");
|
||||
$("#searchDept").val("");
|
||||
$("#searchEmail").val("");
|
||||
$("#searchDesc").val("");
|
||||
|
||||
|
||||
//加载完以后重新初始化
|
||||
$("#searchBtn").click();
|
||||
}
|
||||
});
|
||||
|
||||
//分配角色
|
||||
$('#btnSetRole').click(function () {
|
||||
var currentRow = $("#tableData").datagrid("getSelected");
|
||||
if (currentRow == null) {
|
||||
alert("请选择一条数据再操作!");
|
||||
return false;
|
||||
}
|
||||
this.href = "<%=path %>/pages/user/userRole.jsp?id=" + currentRow.id;
|
||||
});
|
||||
|
||||
//分配部门
|
||||
$('#btnSetDepart').click(function () {
|
||||
var currentRow = $("#tableData").datagrid("getSelected");
|
||||
if (currentRow == null) {
|
||||
alert("请选择一条数据再操作!");
|
||||
return false;
|
||||
}
|
||||
this.href = "<%=path %>/pages/user/userDepot.jsp?id=" + currentRow.id;
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
587
src/main/webapp/pages/manage/vendor.jsp
Normal file
587
src/main/webapp/pages/manage/vendor.jsp
Normal file
@@ -0,0 +1,587 @@
|
||||
<%@page import="com.jsh.util.Tools"%>
|
||||
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
|
||||
<%
|
||||
String path = request.getContextPath();
|
||||
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
|
||||
String clientIp = Tools.getCurrentUserIP();
|
||||
%>
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head>
|
||||
<title>单位信息</title>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
<!-- 指定以IE8的方式来渲染 -->
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE8"/>
|
||||
<link rel="shortcut icon" href="<%=path%>/images/favicon.ico" type="image/x-icon" />
|
||||
<link rel="stylesheet" type="text/css" href="<%=path %>/js/easyui-1.3.5/themes/default/easyui.css"/>
|
||||
<link rel="stylesheet" type="text/css" href="<%=path %>/js/easyui-1.3.5/themes/icon.css"/>
|
||||
<link type="text/css" rel="stylesheet" href="<%=path %>/css/common.css" />
|
||||
<script type="text/javascript" src="<%=path %>/js/jquery-1.8.0.min.js"></script>
|
||||
<script type="text/javascript" src="<%=path %>/js/easyui-1.3.5/jquery.easyui.min.js"></script>
|
||||
<script type="text/javascript" src="<%=path %>/js/easyui-1.3.5/locale/easyui-lang-zh_CN.js"></script>
|
||||
<script type="text/javascript" src="<%=path %>/js/common/common.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<!-- 查询 -->
|
||||
<div id = "searchPanel" class="easyui-panel" style="padding:10px;" title="查询窗口" iconCls="icon-search" collapsible="true" closable="false">
|
||||
<table id="searchTable">
|
||||
<tr>
|
||||
<td>名 称:</td>
|
||||
<td>
|
||||
<input type="text" name="searchSupplier" id="searchSupplier" style="width:150px;"/>
|
||||
</td>
|
||||
|
||||
<td> </td>
|
||||
<td> </td>
|
||||
<td id="searchTypeLabel">类 型:</td>
|
||||
<td>
|
||||
<select name="searchType" id="searchType" style="width:150px;">
|
||||
<option value="">全部</option>
|
||||
<option value="供应商">供应商</option>
|
||||
<option value="客户">客户</option>
|
||||
</select>
|
||||
</td>
|
||||
<td> </td>
|
||||
<td> </td>
|
||||
<td>联系电话:</td>
|
||||
<td>
|
||||
<input type="text" name="searchPhonenum" id="searchPhonenum" style="width:150px;"/>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>电子邮箱:</td>
|
||||
<td>
|
||||
<input type="text" name="searchEmail" id="searchEmail" style="width:150px;"/>
|
||||
</td>
|
||||
<td> </td>
|
||||
<td> </td>
|
||||
<td id="searchDescLabel">描 述:</td>
|
||||
<td>
|
||||
<input type="text" name="searchDesc" id="searchDesc" style="width:150px;"/>
|
||||
</td>
|
||||
<td> </td>
|
||||
<td> </td>
|
||||
<td> </td>
|
||||
<td>
|
||||
<a href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-search" id="searchBtn">查询</a>
|
||||
<a href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-redo" id="searchResetBtn">重置</a>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<!-- 数据显示table -->
|
||||
<div id = "tablePanel" class="easyui-panel" style="padding:1px;top:300px;" title="单位列表" iconCls="icon-list" collapsible="true" closable="false">
|
||||
<table id="tableData" style="top:300px;border-bottom-color:#FFFFFF"></table>
|
||||
</div>
|
||||
<div id="supplierDlg" class="easyui-dialog" style="width:380px;padding:10px 20px"
|
||||
closed="true" buttons="#dlg-buttons" modal="true" collapsible="false" closable="true">
|
||||
<form id="supplierFM" method="post" novalidate>
|
||||
<div class="fitem" style="padding:5px">
|
||||
<label id="supplierLabel">名 称</label>
|
||||
<input name="supplier" id="supplier" class="easyui-validatebox" data-options="required:true,validType:'length[2,30]'" style="width: 230px;height: 20px"/>
|
||||
</div>
|
||||
<div class="fitem" style="padding:5px">
|
||||
<label id="typeLabel">类 型</label>
|
||||
<select name="type" id="type" style="width:230px;">
|
||||
<option value="供应商">供应商</option>
|
||||
<option value="客户">客户</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="fitem" style="padding:5px">
|
||||
<label id="contactsLabel">联 系 人 </label>
|
||||
<input name="contacts" id="contacts" class="easyui-validatebox" style="width: 230px;height: 20px"/>
|
||||
</div>
|
||||
<div class="fitem" style="padding:5px">
|
||||
<label id="phonenumLabel">联系电话 </label>
|
||||
<input name="phonenum" id="phonenum" class="easyui-numberbox" style="width: 230px;height: 20px"/>
|
||||
</div>
|
||||
<div class="fitem" style="padding:5px">
|
||||
<label id="emailLabel">电子邮箱 </label>
|
||||
<input name="email" id="email" class="easyui-validatebox" validType="email" style="width: 230px;height: 20px"/>
|
||||
</div>
|
||||
|
||||
<div class="fitem" style="padding:5px">
|
||||
<label id="BeginNeedGetLabel">期初应收</label>
|
||||
<input name="BeginNeedGet" id="BeginNeedGet" type="text" class="easyui-numberbox" data-options="min:0,precision:2" style="width: 230px;height: 20px"></input>
|
||||
</div>
|
||||
<div class="fitem" style="padding:5px">
|
||||
<label id="BeginNeedPayLabel">期初应付</label>
|
||||
<input name="BeginNeedPay" id="BeginNeedPay" type="text" class="easyui-numberbox" data-options="min:0,precision:2" style="width: 230px;height: 20px"></input>
|
||||
</div>
|
||||
<div class="fitem" style="padding:5px">
|
||||
<label id="AllNeedGetLabel">累计应收</label>
|
||||
<input name="AllNeedGet" id="AllNeedGet" type="text" class="easyui-numberbox" data-options="min:0,precision:2" style="width: 230px;height: 20px" disabled="true"></input>
|
||||
</div>
|
||||
<div class="fitem" style="padding:5px">
|
||||
<label id="AllNeedPayLabel">累计应付</label>
|
||||
<input name="AllNeedPay" id="AllNeedPay" type="text" class="easyui-numberbox" data-options="min:0,precision:2" style="width: 230px;height: 20px" disabled="true"></input>
|
||||
</div>
|
||||
<div class="fitem" style="padding:5px">
|
||||
<label id="descriptionLabel">描 述 </label>
|
||||
<textarea name="description" id="description" rows="2" cols="2" style="width: 230px;"></textarea>
|
||||
</div>
|
||||
<div class="fitem" style="padding:5px">
|
||||
<label id="enabledLabel">启 动 </label>
|
||||
<input name="enabled" id="enabled" type="checkbox" style="width: 230px;height: 20px"/>
|
||||
</div>
|
||||
<input type="hidden" name="clientIp" id="clientIp" value="<%=clientIp %>"/>
|
||||
</form>
|
||||
</div>
|
||||
<div id="dlg-buttons">
|
||||
<a href="javascript:void(0)" id="saveSupplier" class="easyui-linkbutton" iconCls="icon-ok">保存</a>
|
||||
<a href="javascript:void(0)" id="cancelSupplier" class="easyui-linkbutton" iconCls="icon-cancel" onclick="javascript:$('#supplierDlg').dialog('close')">取消</a>
|
||||
</div>
|
||||
|
||||
<script type="text/javascript">
|
||||
//初始化界面
|
||||
$(function()
|
||||
{
|
||||
initTableData();
|
||||
ininPager();
|
||||
browserFit();
|
||||
});
|
||||
|
||||
//浏览器适配
|
||||
function browserFit()
|
||||
{
|
||||
if(getOs()=='MSIE')
|
||||
{
|
||||
$("#searchContactsLabel").empty().append("联 系 人:");
|
||||
$("#searchDescLabel").empty().append("描 述:");
|
||||
$("#supplierLabel").empty().append("名 称");
|
||||
$("#contactsLabel").empty().append("联 系 人 ");
|
||||
$("#phonenumLabel").empty().append("联系电话 ");
|
||||
$("#emailLabel").empty().append("电子邮箱 ");
|
||||
$("#descriptionLabel").empty().append("描 述 ");
|
||||
}
|
||||
else
|
||||
{
|
||||
$("#searchContactsLabel").empty().append("联 系 人:");
|
||||
$("#searchDescLabel").empty().append("描 述:");
|
||||
$("#supplierLabel").empty().append("名 称");
|
||||
$("#contactsLabel").empty().append("联 系 人");
|
||||
$("#phonenumLabel").empty().append("联系电话");
|
||||
$("#emailLabel").empty().append("电子邮箱");
|
||||
$("#descriptionLabel").empty().append("描 述");
|
||||
}
|
||||
}
|
||||
|
||||
//初始化表格数据
|
||||
function initTableData()
|
||||
{
|
||||
$('#tableData').datagrid({
|
||||
//title:'单位列表',
|
||||
//iconCls:'icon-save',
|
||||
//width:700,
|
||||
height:heightInfo,
|
||||
nowrap: false,
|
||||
rownumbers: false,
|
||||
//动画效果
|
||||
animate:false,
|
||||
//选中单行
|
||||
singleSelect : true,
|
||||
collapsible:false,
|
||||
selectOnCheck:false,
|
||||
//fitColumns:true,
|
||||
//单击行是否选中
|
||||
checkOnSelect : false,
|
||||
//交替出现背景
|
||||
striped : true,
|
||||
url:'<%=path %>/supplier/findBy.action?pageSize=' + initPageSize,
|
||||
pagination: true,
|
||||
//自动截取数据
|
||||
//nowrap : true,
|
||||
//loadFilter: pagerFilter,
|
||||
pageSize: initPageSize,
|
||||
pageList: initPageNum,
|
||||
columns:[[
|
||||
{ field: 'id',width:35,align:"center",checkbox:true},
|
||||
{ title: '名称',field: 'supplier',width:120},
|
||||
{ title: '联系人', field: 'contacts',width:50,align:"center"},
|
||||
{ title: '联系电话', field: 'phonenum',width:60,align:"center"},
|
||||
{ title: '电子邮箱',field: 'email',width:80,align:"center"},
|
||||
{ title: '累计应收',field: 'AllNeedGet',width:70,align:"center"},
|
||||
{ title: '累计应付',field: 'AllNeedPay',width:70,align:"center"},
|
||||
{ title: '类型',field: 'type',width:50},
|
||||
{ title: '启动',field: 'enabled',width:40},
|
||||
{ title: '操作',field: 'op',align:"center",width:130,formatter:function(value,rec)
|
||||
{
|
||||
var str = '';
|
||||
var rowInfo = rec.id + 'AaBb' + rec.supplier +'AaBb' + rec.contacts + 'AaBb'+ rec.phonenum + 'AaBb'+ rec.email + 'AaBb'+ rec.BeginNeedGet + 'AaBb'+ rec.BeginNeedPay + 'AaBb'+ rec.AllNeedGet + 'AaBb'+ rec.AllNeedPay + 'AaBb' + rec.isystem + 'AaBb' + rec.description+ 'AaBb' + rec.type+ 'AaBb' + rec.enabled;
|
||||
if(1 == value)
|
||||
{
|
||||
str += '<img src="<%=path%>/js/easyui-1.3.5/themes/icons/pencil.png" style="cursor: pointer;" onclick="editSupplier(\'' + rowInfo + '\');"/> <a onclick="editSupplier(\'' + rowInfo + '\');" style="text-decoration:none;color:black;" href="javascript:void(0)">编辑</a> ';
|
||||
str += '<img src="<%=path%>/js/easyui-1.3.5/themes/icons/edit_remove.png" style="cursor: pointer;" onclick="deleteSupplier(\'' + rowInfo + '\');"/> <a onclick="deleteSupplier(\'' + rowInfo + '\');" style="text-decoration:none;color:black;" href="javascript:void(0)">删除</a> ';
|
||||
}
|
||||
return str;
|
||||
}
|
||||
}
|
||||
]],
|
||||
toolbar:[
|
||||
{
|
||||
id:'addSupplier',
|
||||
text:'增加',
|
||||
iconCls:'icon-add',
|
||||
handler:function()
|
||||
{
|
||||
addSuppler();
|
||||
}
|
||||
},
|
||||
{
|
||||
id:'deleteSupplier',
|
||||
text:'删除',
|
||||
iconCls:'icon-remove',
|
||||
handler:function()
|
||||
{
|
||||
batDeleteSupplier();
|
||||
}
|
||||
}
|
||||
],
|
||||
onLoadError:function()
|
||||
{
|
||||
$.messager.alert('页面加载提示','页面加载异常,请稍后再试!','error');
|
||||
return;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
//初始化键盘enter事件
|
||||
$(document).keydown(function(event)
|
||||
{
|
||||
//兼容 IE和firefox 事件
|
||||
var e = window.event || event;
|
||||
var k = e.keyCode||e.which||e.charCode;
|
||||
//兼容 IE,firefox 兼容
|
||||
var obj = e.srcElement ? e.srcElement : e.target;
|
||||
//绑定键盘事件为 id是指定的输入框才可以触发键盘事件 13键盘事件
|
||||
if(k == "13"&&(obj.id=="supplier" || obj.id=="contacts"|| obj.id=="phonenum"
|
||||
|| obj.id=="email" || obj.id=="description" ))
|
||||
{
|
||||
$("#saveSupplier").click();
|
||||
}
|
||||
|
||||
//搜索按钮添加快捷键
|
||||
if(k == "13"&&(obj.id=="searchSupplier" || obj.id=="searchContacts"|| obj.id=="searchPhonenum"
|
||||
|| obj.id=="searchEmail" || obj.id=="searchDesc" ))
|
||||
{
|
||||
$("#searchBtn").click();
|
||||
}
|
||||
});
|
||||
//分页信息处理
|
||||
function ininPager()
|
||||
{
|
||||
try
|
||||
{
|
||||
var opts = $("#tableData").datagrid('options');
|
||||
var pager = $("#tableData").datagrid('getPager');
|
||||
pager.pagination({
|
||||
onSelectPage:function(pageNum, pageSize)
|
||||
{
|
||||
opts.pageNumber = pageNum;
|
||||
opts.pageSize = pageSize;
|
||||
pager.pagination('refresh',
|
||||
{
|
||||
pageNumber:pageNum,
|
||||
pageSize:pageSize
|
||||
});
|
||||
showSupplierDetails(pageNum,pageSize);
|
||||
}
|
||||
});
|
||||
}
|
||||
catch (e)
|
||||
{
|
||||
$.messager.alert('异常处理提示',"分页信息异常 : " + e.name + ": " + e.message,'error');
|
||||
}
|
||||
}
|
||||
|
||||
//删除单位信息
|
||||
function deleteSupplier(supplierInfo)
|
||||
{
|
||||
$.messager.confirm('删除确认','确定要删除此单位信息吗?',function(r)
|
||||
{
|
||||
if (r)
|
||||
{
|
||||
var supplierTotalInfo = supplierInfo.split("AaBb");
|
||||
$.ajax({
|
||||
type:"post",
|
||||
url: "<%=path %>/supplier/delete.action",
|
||||
dataType: "json",
|
||||
data: ({
|
||||
supplierID : supplierTotalInfo[0],
|
||||
supplier:supplierTotalInfo[1],
|
||||
clientIp:'<%=clientIp %>'
|
||||
}),
|
||||
success: function (tipInfo)
|
||||
{
|
||||
var msg = tipInfo.showModel.msgTip;
|
||||
if(msg == '成功')
|
||||
//加载完以后重新初始化
|
||||
$("#searchBtn").click();
|
||||
else
|
||||
$.messager.alert('删除提示','删除单位信息失败,请稍后再试!','error');
|
||||
},
|
||||
//此处添加错误处理
|
||||
error:function()
|
||||
{
|
||||
$.messager.alert('删除提示','删除单位信息异常,请稍后再试!','error');
|
||||
return;
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
//批量删除单位
|
||||
function batDeleteSupplier()
|
||||
{
|
||||
var row = $('#tableData').datagrid('getChecked');
|
||||
if(row.length == 0)
|
||||
{
|
||||
$.messager.alert('删除提示','没有记录被选中!','info');
|
||||
return;
|
||||
}
|
||||
if(row.length > 0)
|
||||
{
|
||||
$.messager.confirm('删除确认','确定要删除选中的' + row.length + '条单位信息吗?',function(r)
|
||||
{
|
||||
if (r)
|
||||
{
|
||||
var ids = "";
|
||||
for(var i = 0;i < row.length; i ++)
|
||||
{
|
||||
if(i == row.length-1)
|
||||
{
|
||||
ids += row[i].id;
|
||||
break;
|
||||
}
|
||||
ids += row[i].id + ",";
|
||||
}
|
||||
$.ajax({
|
||||
type:"post",
|
||||
url: "<%=path %>/supplier/batchDelete.action",
|
||||
dataType: "json",
|
||||
async : false,
|
||||
data: ({
|
||||
supplierIDs : ids,
|
||||
clientIp:'<%=clientIp %>'
|
||||
}),
|
||||
success: function (tipInfo)
|
||||
{
|
||||
var msg = tipInfo.showModel.msgTip;
|
||||
if(msg == '成功')
|
||||
{
|
||||
//加载完以后重新初始化
|
||||
$("#searchBtn").click();
|
||||
$(":checkbox").attr("checked",false);
|
||||
}
|
||||
else
|
||||
$.messager.alert('删除提示','删除单位信息失败,请稍后再试!','error');
|
||||
},
|
||||
//此处添加错误处理
|
||||
error:function()
|
||||
{
|
||||
$.messager.alert('删除提示','删除单位信息异常,请稍后再试!','error');
|
||||
return;
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
//增加单位
|
||||
var url;
|
||||
var supplierID = 0;
|
||||
//保存编辑前的名称
|
||||
var orgSupplier = "";
|
||||
|
||||
function addSuppler()
|
||||
{
|
||||
$('#supplierDlg').dialog('open').dialog('setTitle','<img src="<%=path%>/js/easyui-1.3.5/themes/icons/edit_add.png"/> 增加单位信息');
|
||||
$(".window-mask").css({ width: webW ,height: webH});
|
||||
$('#supplierFM').form('clear');
|
||||
|
||||
var row = {
|
||||
clientIp:'<%=clientIp %>'
|
||||
};
|
||||
$('#supplierFM').form('load',row);
|
||||
|
||||
$("#supplier").focus();
|
||||
orgSupplier = "";
|
||||
supplierID = 0;
|
||||
url = '<%=path %>/supplier/create.action';
|
||||
}
|
||||
|
||||
//保存单位信息
|
||||
$("#saveSupplier").unbind().bind({
|
||||
click:function()
|
||||
{
|
||||
if(checkSupplierName())
|
||||
return;
|
||||
|
||||
var reg = /^([0-9])+$/;
|
||||
var phonenum = $.trim($("#phonenum").val());
|
||||
if(phonenum.length>0 && !reg.test(phonenum))
|
||||
{
|
||||
$.messager.alert('提示','电话号码只能是数字','info');
|
||||
$("#phonenum").val("").focus();
|
||||
return;
|
||||
}
|
||||
|
||||
$('#supplierFM').form('submit',{
|
||||
url: url,
|
||||
onSubmit: function()
|
||||
{
|
||||
return $(this).form('validate');
|
||||
},
|
||||
success: function(result)
|
||||
{
|
||||
var result = eval('('+result+')');
|
||||
if (!result)
|
||||
{
|
||||
$.messager.show({
|
||||
title: '错误提示',
|
||||
msg: '保存单位信息失败,请稍后重试!'
|
||||
});
|
||||
}
|
||||
else
|
||||
{
|
||||
$('#supplierDlg').dialog('close');
|
||||
var opts = $("#tableData").datagrid('options');
|
||||
showSupplierDetails(opts.pageNumber,opts.pageSize);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
//编辑单位信息
|
||||
function editSupplier(supplierTotalInfo)
|
||||
{
|
||||
var supplierInfo = supplierTotalInfo.split("AaBb");
|
||||
var row = {
|
||||
supplier : supplierInfo[1],
|
||||
contacts : supplierInfo[2],
|
||||
phonenum : supplierInfo[3],
|
||||
email : supplierInfo[4],
|
||||
BeginNeedGet : supplierInfo[5],
|
||||
BeginNeedPay : supplierInfo[6],
|
||||
AllNeedGet : supplierInfo[7],
|
||||
AllNeedPay : supplierInfo[8],
|
||||
description : supplierInfo[10],
|
||||
type : supplierInfo[11],
|
||||
enabled : supplierInfo[12],
|
||||
clientIp:'<%=clientIp %>'
|
||||
};
|
||||
orgSupplier = supplierInfo[1];
|
||||
$('#supplierDlg').dialog('open').dialog('setTitle','<img src="<%=path%>/js/easyui-1.3.5/themes/icons/pencil.png"/> 编辑单位信息');
|
||||
$(".window-mask").css({ width: webW ,height: webH});
|
||||
$('#supplierFM').form('load',row);
|
||||
supplierID = supplierInfo[0];
|
||||
//焦点在名称输入框==定焦在输入文字后面
|
||||
$("#supplier").val("").focus().val(supplierInfo[1]);
|
||||
url = '<%=path %>/supplier/update.action?supplierID=' + supplierInfo[0];
|
||||
}
|
||||
|
||||
|
||||
//检查单位名称是否存在 ++ 重名无法提示问题需要跟进
|
||||
function checkSupplierName()
|
||||
{
|
||||
var supplierName = $.trim($("#supplier").val());
|
||||
//表示是否存在 true == 存在 false = 不存在
|
||||
var flag = false;
|
||||
//开始ajax名称检验,不能重名
|
||||
if(supplierName.length > 0 &&( orgSupplier.length ==0 || supplierName != orgSupplier))
|
||||
{
|
||||
$.ajax({
|
||||
type:"post",
|
||||
url: "<%=path %>/supplier/checkIsNameExist.action",
|
||||
dataType: "json",
|
||||
async : false,
|
||||
data: ({
|
||||
supplierID : supplierID,
|
||||
supplier : supplierName
|
||||
}),
|
||||
success: function (tipInfo)
|
||||
{
|
||||
flag = tipInfo;
|
||||
if(tipInfo)
|
||||
{
|
||||
$.messager.alert('提示','单位名称已经存在','info');
|
||||
return;
|
||||
}
|
||||
},
|
||||
//此处添加错误处理
|
||||
error:function()
|
||||
{
|
||||
$.messager.alert('提示','检查单位名称是否存在异常,请稍后再试!','error');
|
||||
return;
|
||||
}
|
||||
});
|
||||
}
|
||||
return flag;
|
||||
}
|
||||
|
||||
//搜索处理
|
||||
$("#searchBtn").unbind().bind({
|
||||
click:function()
|
||||
{
|
||||
showSupplierDetails(1,initPageSize);
|
||||
var opts = $("#tableData").datagrid('options');
|
||||
var pager = $("#tableData").datagrid('getPager');
|
||||
opts.pageNumber = 1;
|
||||
opts.pageSize = initPageSize;
|
||||
pager.pagination('refresh',
|
||||
{
|
||||
pageNumber:1,
|
||||
pageSize:initPageSize
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
function showSupplierDetails(pageNo,pageSize)
|
||||
{
|
||||
$.ajax({
|
||||
type:"post",
|
||||
url: "<%=path %>/supplier/findBy.action",
|
||||
dataType: "json",
|
||||
data: ({
|
||||
supplier:$.trim($("#searchSupplier").val()),
|
||||
type:$.trim($("#searchType").val()),
|
||||
phonenum:$.trim($("#searchPhonenum").val()),
|
||||
email:$.trim($("#searchEmail").val()),
|
||||
description:$.trim($("#searchDesc").val()),
|
||||
pageNo:pageNo,
|
||||
pageSize:pageSize
|
||||
}),
|
||||
success: function (data)
|
||||
{
|
||||
$("#tableData").datagrid('loadData',data);
|
||||
//$('#tableData').datagrid('reload');
|
||||
},
|
||||
//此处添加错误处理
|
||||
error:function()
|
||||
{
|
||||
$.messager.alert('查询提示','查询数据后台异常,请稍后再试!','error');
|
||||
return;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
//重置按钮
|
||||
$("#searchResetBtn").unbind().bind({
|
||||
click:function(){
|
||||
$("#searchSupplier").val("");
|
||||
$("#searchType").val("");
|
||||
$("#searchPhonenum").val("");
|
||||
$("#searchEmail").val("");
|
||||
$("#searchDesc").val("");
|
||||
|
||||
//加载完以后重新初始化
|
||||
$("#searchBtn").click();
|
||||
}
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
161
src/main/webapp/pages/materials/allocation_out_list.jsp
Normal file
161
src/main/webapp/pages/materials/allocation_out_list.jsp
Normal file
@@ -0,0 +1,161 @@
|
||||
<%@page import="com.jsh.util.Tools"%>
|
||||
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
|
||||
<%
|
||||
String path = request.getContextPath();
|
||||
String clientIp = Tools.getCurrentUserIP();
|
||||
%>
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>调拨出库</title>
|
||||
<meta charset="utf-8">
|
||||
<!-- 指定以IE8的方式来渲染 -->
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE8"/>
|
||||
<link rel="shortcut icon" href="<%=path%>/images/favicon.ico" type="image/x-icon" />
|
||||
<link rel="stylesheet" type="text/css" href="<%=path %>/js/easyui-1.3.5/themes/default/easyui.css"/>
|
||||
<link rel="stylesheet" type="text/css" href="<%=path %>/js/easyui-1.3.5/themes/icon.css"/>
|
||||
<link type="text/css" rel="stylesheet" href="<%=path %>/css/common.css" />
|
||||
<script src="<%=path %>/js/jquery-1.8.0.min.js"></script>
|
||||
<script src="<%=path %>/js/easyui-1.3.5/jquery.easyui.min.js"></script>
|
||||
<script src="<%=path %>/js/easyui-1.3.5/locale/easyui-lang-zh_CN.js"></script>
|
||||
<script src="<%=path %>/js/My97DatePicker/WdatePicker.js"></script>
|
||||
<script src="<%=path %>/js/common/common.js"></script>
|
||||
<script src="<%=path %>/js/pages/materials/in_out.js"></script>
|
||||
<script>
|
||||
var kid = ${sessionScope.user.id};
|
||||
var path = "<%=path%>";
|
||||
var clientIp = "<%=clientIp%>";
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<!-- 查询 -->
|
||||
<div id = "searchPanel" class="easyui-panel" style="padding:3px;" title="查询窗口" iconCls="icon-search" collapsible="true" closable="false">
|
||||
<table id="searchTable">
|
||||
<tr>
|
||||
<td>发货仓库:</td>
|
||||
<td>
|
||||
<select name="searchProjectId" id="searchProjectId" style="width:80px;"></select>
|
||||
</td>
|
||||
<td>单据编号:</td>
|
||||
<td>
|
||||
<input type="text" name="searchNumber" id="searchNumber" style="width:60px;"/>
|
||||
</td>
|
||||
<td>单据日期:</td>
|
||||
<td>
|
||||
<input type="text" name="searchBeginTime" id="searchBeginTime" onClick="WdatePicker({dateFmt:'yyyy-MM-dd'})" class="txt Wdate" style="width:80px;"/>
|
||||
</td>
|
||||
<td>-</td>
|
||||
<td>
|
||||
<input type="text" name="searchEndTime" id="searchEndTime" onClick="WdatePicker({dateFmt:'yyyy-MM-dd'})" class="txt Wdate" style="width:80px;"/>
|
||||
</td>
|
||||
<td> </td>
|
||||
<td>
|
||||
<a href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-search" id="searchBtn">查询</a>
|
||||
<a href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-redo" id="searchResetBtn">重置</a>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<!-- 数据显示table -->
|
||||
<div id = "tablePanel" class="easyui-panel" style="padding:1px;top:300px;" title="调拨出库列表" iconCls="icon-list" collapsible="true" closable="false">
|
||||
<table id="tableData" style="top:300px;border-bottom-color:#FFFFFF"></table>
|
||||
</div>
|
||||
|
||||
<div id="depotHeadDlg" class="easyui-dialog" style="width:850px;padding:10px 20px;top:20px"
|
||||
closed="true" buttons="#dlg-buttons" modal="true" cache="false" collapsible="false" closable="true">
|
||||
<form id="depotHeadFM" method="post" novalidate>
|
||||
<table>
|
||||
<tr>
|
||||
<td>发货仓库:</td>
|
||||
<td style="padding:5px">
|
||||
<select name="ProjectId" id="ProjectId" style="width:120px;"></select>
|
||||
</td>
|
||||
<td>单据日期:</td>
|
||||
<td style="padding:5px">
|
||||
<input type="text" name="OperTime" id="OperTime" onClick="WdatePicker({dateFmt:'yyyy-MM-dd'})" class="txt Wdate" style="width:120px;"/>
|
||||
</td>
|
||||
<td>经手人:</td>
|
||||
<td style="padding:5px">
|
||||
<select name="HandsPersonId" id="HandsPersonId" style="width:120px;"></select>
|
||||
</td>
|
||||
<td style="width:50px;"></td>
|
||||
<td style="padding:5px;width:120px;"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>收货仓库:</td>
|
||||
<td style="padding:5px">
|
||||
<select name="AllocationProjectId" id="AllocationProjectId" style="width:120px;"></select>
|
||||
</td>
|
||||
<td>单据编号:</td>
|
||||
<td style="padding:5px"><input name="Number" id="Number" class="easyui-validatebox" data-options="required:true,validType:'length[2,30]'" style="width: 120px;"/>
|
||||
</td>
|
||||
<td>单据备注:</td>
|
||||
<td style="padding:5px">
|
||||
<input name="Remark" id="Remark" class="easyui-validatebox" style="width: 120px;"/>
|
||||
</td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>商品列表:</td>
|
||||
<td colspan="7">
|
||||
<!-- 商品列表table -->
|
||||
<table id="materialData" style="top:100px;border-bottom-color:#FFFFFF"></table>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<input type="hidden" name="clientIp" id="clientIp" value="<%=clientIp %>"/>
|
||||
</form>
|
||||
</div>
|
||||
<div id="dlg-buttons">
|
||||
<a href="javascript:void(0)" id="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>
|
||||
</div>
|
||||
<div id="depotHeadDlgShow" class="easyui-dialog" style="width:850px;padding:10px 20px;top:20px"
|
||||
closed="true" modal="true" cache="false" collapsible="false" closable="true">
|
||||
<table>
|
||||
<tr>
|
||||
<td>发货仓库:</td>
|
||||
<td style="padding:5px;width:120px;">
|
||||
<span id="ProjectIdShow"></span>
|
||||
</td>
|
||||
<td>单据日期:</td>
|
||||
<td style="padding:5px;width:120px;">
|
||||
<span id="OperTimeShow"></span>
|
||||
</td>
|
||||
<td>经手人:</td>
|
||||
<td style="padding:5px">
|
||||
<span id="HandsPersonIdShow"></span>
|
||||
</td>
|
||||
<td style="width:50px;"></td>
|
||||
<td style="padding:5px;width:120px;">
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>收货仓库:</td>
|
||||
<td style="padding:5px;width:120px;">
|
||||
<span id="AllocationProjectIdShow"></span>
|
||||
</td>
|
||||
<td>单据编号:</td>
|
||||
<td style="padding:5px">
|
||||
<span id="NumberShow"></span>
|
||||
</td>
|
||||
<td>单据备注:</td>
|
||||
<td style="padding:5px">
|
||||
<span id="RemarkShow"></span>
|
||||
</td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>商品列表:</td>
|
||||
<td colspan="7">
|
||||
<!-- 商品列表table -->
|
||||
<table id="materialDataShow" style="top:100px;border-bottom-color:#FFFFFF"></table>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
679
src/main/webapp/pages/materials/material.jsp
Normal file
679
src/main/webapp/pages/materials/material.jsp
Normal file
@@ -0,0 +1,679 @@
|
||||
<%@page import="com.jsh.util.Tools"%>
|
||||
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
|
||||
<%
|
||||
String path = request.getContextPath();
|
||||
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
|
||||
String clientIp = Tools.getCurrentUserIP();
|
||||
%>
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>商品信息</title>
|
||||
<meta charset="utf-8">
|
||||
<!-- 指定以IE8的方式来渲染 -->
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE8"/>
|
||||
<link rel="shortcut icon" href="<%=path%>/images/favicon.ico" type="image/x-icon" />
|
||||
<script type="text/javascript" src="<%=path %>/js/jquery-1.8.0.min.js"></script>
|
||||
<link rel="stylesheet" type="text/css" href="<%=path %>/js/easyui-1.3.5/themes/default/easyui.css"/>
|
||||
<link rel="stylesheet" type="text/css" href="<%=path %>/js/easyui-1.3.5/themes/icon.css"/>
|
||||
<link type="text/css" rel="stylesheet" href="<%=path %>/css/common.css" />
|
||||
<script type="text/javascript" src="<%=path %>/js/easyui-1.3.5/jquery.easyui.min.js"></script>
|
||||
<script type="text/javascript" src="<%=path %>/js/easyui-1.3.5/locale/easyui-lang-zh_CN.js"></script>
|
||||
<script type="text/javascript" src="<%=path %>/js/common/common.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<!-- 查询 -->
|
||||
<div id = "searchPanel" class="easyui-panel" style="padding:10px;" title="查询窗口" iconCls="icon-search" collapsible="true" closable="false">
|
||||
<table id="searchTable">
|
||||
<tr>
|
||||
<td>类别:</td>
|
||||
<td>
|
||||
<select name="searchCategoryId_f" id="searchCategoryId_f" style="width:100px;"></select>
|
||||
<select name="searchCategoryId_s" id="searchCategoryId_s" style="width:100px;"></select>
|
||||
<select name="searchCategoryId_t" id="searchCategoryId_t" style="width:100px;"></select>
|
||||
</td>
|
||||
<td> </td>
|
||||
<td> </td>
|
||||
<td> </td>
|
||||
<td>
|
||||
<a href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-search" id="searchBtn">查询</a>
|
||||
<a href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-redo" id="searchResetBtn">重置</a>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<!-- 数据显示table -->
|
||||
<div id = "tablePanel" class="easyui-panel" style="padding:1px;top:300px;" title="商品列表" iconCls="icon-list" collapsible="true" closable="false">
|
||||
<table id="tableData" style="top:300px;border-bottom-color:#FFFFFF"></table>
|
||||
</div>
|
||||
|
||||
<div id="materialDlg" class="easyui-dialog" style="width:380px;padding:10px 20px"
|
||||
closed="true" buttons="#dlg-buttons" modal="true" cache="false" collapsible="false" closable="true">
|
||||
<form id="materialFM" method="post" novalidate>
|
||||
<table>
|
||||
<tr>
|
||||
<td>名称</td>
|
||||
<td style="padding:5px"><input name="Name" id="Name" class="easyui-validatebox" data-options="required:true,validType:'length[2,30]'" style="width: 180px;height: 20px"/></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>类别</td>
|
||||
<td style="padding:5px">
|
||||
<select name="CategoryId_f" id="CategoryId_f" style="width:180px;height: 20px"></select><br/>
|
||||
<select name="CategoryId_s" id="CategoryId_s" style="width:180px;height: 20px"></select><br/>
|
||||
<select name="CategoryId_t" id="CategoryId_t" style="width:180px;height: 20px"></select>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>款号</td>
|
||||
<td style="padding:5px"><input name="Model" id="Model" class="easyui-validatebox" data-options="required:true,validType:'length[2,30]'" style="width: 180px;height: 20px"/></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>颜色</td>
|
||||
<td style="padding:5px"><input name="Color" id="Color" class="easyui-validatebox" data-options="required:true,validType:'length[1,30]'" style="width: 180px;height: 20px"/></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>单位</td>
|
||||
<td style="padding:5px"><input name="Unit" id="Unit" class="easyui-validatebox" data-options="required:true,validType:'length[1,30]'" style="width: 180px;height: 20px"/></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>零售价</td>
|
||||
<td style="padding:5px"><input name="RetailPrice" id="RetailPrice" class="easyui-validatebox" data-options="required:true,validType:'length[1,30]'" style="width: 180px;height: 20px"/></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>最低售价</td>
|
||||
<td style="padding:5px"><input name="LowPrice" id="LowPrice" class="easyui-validatebox" data-options="required:true,validType:'length[1,30]'" style="width: 180px;height: 20px"/></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>预设售价一</td>
|
||||
<td style="padding:5px"><input name="PresetPriceOne" id="PresetPriceOne" class="easyui-validatebox" data-options="required:true,validType:'length[1,30]'" style="width: 180px;height: 20px"/></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>预设售价二</td>
|
||||
<td style="padding:5px"><input name="PresetPriceTwo" id="PresetPriceTwo" class="easyui-validatebox" data-options="required:true,validType:'length[1,30]'" style="width: 180px;height: 20px"/></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>备注</td>
|
||||
<td style="padding:5px"><input name="Remark" id="Remark" style="width: 180px;height: 20px"/></td>
|
||||
</tr>
|
||||
</table>
|
||||
<input type="hidden" name="clientIp" id="clientIp" value="<%=clientIp %>"/>
|
||||
</form>
|
||||
</div>
|
||||
<div id="dlg-buttons">
|
||||
<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>
|
||||
</div>
|
||||
|
||||
<script type="text/javascript">
|
||||
var materialCategoryList = null;
|
||||
var materialID = null;
|
||||
var parentid_search=null;
|
||||
var lei=null;
|
||||
var types="";
|
||||
var setCategoryId="1";
|
||||
var cid=1;
|
||||
//初始化界面
|
||||
$(function()
|
||||
{
|
||||
//初始化系统基础信息
|
||||
initSystemData(1);
|
||||
initSelectInfo(1);
|
||||
initSelectInfo(11);
|
||||
initTableData();
|
||||
ininPager();
|
||||
initForm();
|
||||
});
|
||||
|
||||
//初始化系统基础信息
|
||||
function initSystemData(parentid_search)
|
||||
{
|
||||
$.ajax({
|
||||
type:"post",
|
||||
url: "<%=path%>/materialCategory/getBasicData.action",
|
||||
data: ({
|
||||
ParentId:parentid_search
|
||||
}),
|
||||
//设置为同步
|
||||
async:false,
|
||||
dataType: "json",
|
||||
success: function (systemInfo)
|
||||
{
|
||||
materialCategoryList = systemInfo.showModel.map.materialCategoryList;
|
||||
var msgTip = systemInfo.showModel.msgTip;
|
||||
if(msgTip == "exceptoin")
|
||||
{
|
||||
$.messager.alert('提示','查找商品异常,请与管理员联系!','error');
|
||||
return;
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
//初始化页面选项卡
|
||||
function initSelectInfo(lei)
|
||||
{
|
||||
var options = "";
|
||||
|
||||
if(materialCategoryList !=null)
|
||||
{
|
||||
options = "";
|
||||
for(var i = 0 ;i < materialCategoryList.length;i ++)
|
||||
{
|
||||
var materialCategory = materialCategoryList[i];
|
||||
if(0 == i)
|
||||
{
|
||||
materialID = materialCategory.id;
|
||||
}
|
||||
options += '<option value="' + materialCategory.id + '">' + materialCategory.name + '</option>';
|
||||
if(lei==2||lei==222||lei==3)
|
||||
{
|
||||
types+=materialCategory.id+',';
|
||||
}
|
||||
}
|
||||
//$("#CategoryId").empty().append(options);
|
||||
if(lei==1)
|
||||
{
|
||||
$("#searchCategoryId_f").empty().append('<option value="">全部</option>').append(options);
|
||||
}
|
||||
else if(lei==2)
|
||||
{
|
||||
$("#searchCategoryId_s").empty().append('<option value="">全部</option>').append(options);
|
||||
}
|
||||
else if(lei==3)
|
||||
{
|
||||
$("#searchCategoryId_t").empty().append('<option value="">全部</option>').append(options);
|
||||
}
|
||||
else if(lei==11)
|
||||
{
|
||||
$("#CategoryId_f").empty().append('<option value="">全部</option>').append(options);
|
||||
}
|
||||
else if(lei==12)
|
||||
{
|
||||
$("#CategoryId_s").empty().append('<option value="">全部</option>').append(options);
|
||||
}
|
||||
else if(lei==13)
|
||||
{
|
||||
$("#CategoryId_t").empty().append('<option value="">全部</option>').append(options);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$("#searchCategoryId_f").change(
|
||||
function(){
|
||||
var parentid_search=$("#searchCategoryId_f").val();
|
||||
if(parentid_search!='')
|
||||
{
|
||||
initSystemData(parentid_search);
|
||||
initSelectInfo(2);
|
||||
|
||||
var arr=new Array();
|
||||
arr=types.split(',');
|
||||
types="";
|
||||
for(var i=0;i<arr.length;i++)
|
||||
{
|
||||
if(arr[i]!='')
|
||||
{
|
||||
initSystemData(arr[i]);
|
||||
initSelectInfo(222);
|
||||
}
|
||||
}
|
||||
types=types.substring(0,types.length-1);
|
||||
//alert(types);
|
||||
setCategoryId=types;
|
||||
types="";
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
$("#searchCategoryId_s").change(
|
||||
function(){
|
||||
var parentid_search=$("#searchCategoryId_s").val();
|
||||
if(parentid_search!='')
|
||||
{
|
||||
initSystemData(parentid_search);
|
||||
initSelectInfo(3);
|
||||
|
||||
types=types.substring(0,types.length-1);
|
||||
//alert(types);
|
||||
setCategoryId=types;
|
||||
types="";
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
$("#searchCategoryId_t").change(
|
||||
function(){
|
||||
var parentid_search=$("#searchCategoryId_t").val();
|
||||
if(parentid_search!='')
|
||||
{
|
||||
types=parentid_search;
|
||||
|
||||
//alert(types);
|
||||
setCategoryId=types;
|
||||
types="";
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
$("#CategoryId_f").change(
|
||||
function(){
|
||||
var CategoryId_f=$("#CategoryId_f").val();
|
||||
if(CategoryId_f!='')
|
||||
{
|
||||
initSystemData(CategoryId_f);
|
||||
initSelectInfo(12);
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
$("#CategoryId_s").change(
|
||||
function(){
|
||||
var CategoryId_s=$("#CategoryId_s").val();
|
||||
if(CategoryId_s!='')
|
||||
{
|
||||
initSystemData(CategoryId_s);
|
||||
initSelectInfo(13);
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
//防止表单提交重复
|
||||
function initForm()
|
||||
{
|
||||
$('#materialFM').form({
|
||||
onSubmit: function(){
|
||||
return false;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
//初始化表格数据
|
||||
function initTableData()
|
||||
{
|
||||
$('#tableData').datagrid({
|
||||
//title:'商品列表',
|
||||
//iconCls:'icon-save',
|
||||
//width:700,
|
||||
height:heightInfo,
|
||||
nowrap: false,
|
||||
rownumbers: false,
|
||||
//动画效果
|
||||
animate:false,
|
||||
//选中单行
|
||||
singleSelect : true,
|
||||
collapsible:false,
|
||||
selectOnCheck:false,
|
||||
//fitColumns:true,
|
||||
//单击行是否选中
|
||||
//checkOnSelect : false,
|
||||
url:'<%=path %>/material/findBy.action?pageSize=' + initPageSize+'&CategoryIds='+setCategoryId+'&CategoryId='+cid,
|
||||
pagination: true,
|
||||
//交替出现背景
|
||||
striped : true,
|
||||
//loadFilter: pagerFilter,
|
||||
pageSize: initPageSize,
|
||||
pageList: initPageNum,
|
||||
columns:[[
|
||||
{ field: 'Id',width:35,align:"center",checkbox:true},
|
||||
{ title: '名称',field: 'Name',width:80},
|
||||
{ title: '款号',field: 'Model',width:80},
|
||||
{ title: '颜色',field: 'Color',width:40},
|
||||
{ title: '单位',field: 'Unit',width:50},
|
||||
{ title: '零售价',field: 'RetailPrice',width:50},
|
||||
{ title: '最低售价',field: 'LowPrice',width:70},
|
||||
{ title: '预设售价一',field: 'PresetPriceOne',width:70},
|
||||
{ title: '预设售价二',field: 'PresetPriceTwo',width:70},
|
||||
{ title: '备注',field: 'Remark',width:90},
|
||||
{ title: '操作',field: 'op',align:"center",width:150,formatter:function(value,rec)
|
||||
{
|
||||
var str = '';
|
||||
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;
|
||||
if(1 == value)
|
||||
{
|
||||
str += '<img src="<%=path%>/js/easyui-1.3.5/themes/icons/pencil.png" style="cursor: pointer;" onclick="editMaterial(\'' + rowInfo + '\');"/> <a onclick="editMaterial(\'' + rowInfo + '\');" style="text-decoration:none;color:black;" href="javascript:void(0)">编辑</a> ';
|
||||
str += '<img src="<%=path%>/js/easyui-1.3.5/themes/icons/edit_remove.png" style="cursor: pointer;" onclick="deleteMaterial('+ rec.Id +');"/> <a onclick="deleteMaterial('+ rec.Id +');" style="text-decoration:none;color:black;" href="javascript:void(0)">删除</a> ';
|
||||
}
|
||||
return str;
|
||||
}
|
||||
}
|
||||
]],
|
||||
toolbar:[
|
||||
{
|
||||
id:'addMaterial',
|
||||
text:'增加',
|
||||
iconCls:'icon-add',
|
||||
handler:function()
|
||||
{
|
||||
addMaterial();
|
||||
}
|
||||
},
|
||||
{
|
||||
id:'deleteMaterial',
|
||||
text:'删除',
|
||||
iconCls:'icon-remove',
|
||||
handler:function()
|
||||
{
|
||||
batDeleteMaterial();
|
||||
}
|
||||
}
|
||||
],
|
||||
onLoadError:function()
|
||||
{
|
||||
$.messager.alert('页面加载提示','页面加载异常,请稍后再试!','error');
|
||||
return;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
//初始化键盘enter事件
|
||||
$(document).keydown(function(event)
|
||||
{
|
||||
//兼容 IE和firefox 事件
|
||||
var e = window.event || event;
|
||||
var k = e.keyCode||e.which||e.charCode;
|
||||
//兼容 IE,firefox 兼容
|
||||
var obj = e.srcElement ? e.srcElement : e.target;
|
||||
//绑定键盘事件为 id是指定的输入框才可以触发键盘事件 13键盘事件 ---遗留问题 enter键效验 对话框会关闭问题
|
||||
if(k == "13"&&(obj.id=="CategoryLevel"||obj.id=="Name"))
|
||||
{
|
||||
$("#saveMaterial").click();
|
||||
}
|
||||
//搜索按钮添加快捷键
|
||||
if(k == "13"&&(obj.id=="searchCategoryId"))
|
||||
{
|
||||
$("#searchBtn").click();
|
||||
}
|
||||
});
|
||||
//分页信息处理
|
||||
function ininPager()
|
||||
{
|
||||
try
|
||||
{
|
||||
var opts = $("#tableData").datagrid('options');
|
||||
var pager = $("#tableData").datagrid('getPager');
|
||||
pager.pagination({
|
||||
onSelectPage:function(pageNum, pageSize)
|
||||
{
|
||||
opts.pageNumber = pageNum;
|
||||
opts.pageSize = pageSize;
|
||||
pager.pagination('refresh',
|
||||
{
|
||||
pageNumber:pageNum,
|
||||
pageSize:pageSize
|
||||
});
|
||||
showMaterialDetails(pageNum,pageSize);
|
||||
}
|
||||
});
|
||||
}
|
||||
catch (e)
|
||||
{
|
||||
$.messager.alert('异常处理提示',"分页信息异常 : " + e.name + ": " + e.message,'error');
|
||||
}
|
||||
}
|
||||
|
||||
//删除商品信息
|
||||
function deleteMaterial(materialID)
|
||||
{
|
||||
$.messager.confirm('删除确认','确定要删除此商品信息吗?',function(r)
|
||||
{
|
||||
if (r)
|
||||
{
|
||||
$.ajax({
|
||||
type:"post",
|
||||
url: "<%=path %>/material/delete.action",
|
||||
dataType: "json",
|
||||
data: ({
|
||||
materialID : materialID,
|
||||
clientIp:'<%=clientIp %>'
|
||||
}),
|
||||
success: function (tipInfo)
|
||||
{
|
||||
var msg = tipInfo.showModel.msgTip;
|
||||
if(msg == '成功')
|
||||
{
|
||||
//加载完以后重新初始化
|
||||
$("#searchBtn").click();
|
||||
}
|
||||
else
|
||||
$.messager.alert('删除提示','删除商品信息失败,请稍后再试!','error');
|
||||
},
|
||||
//此处添加错误处理
|
||||
error:function()
|
||||
{
|
||||
$.messager.alert('删除提示','删除商品信息异常,请稍后再试!','error');
|
||||
return;
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
//批量删除商品
|
||||
function batDeleteMaterial()
|
||||
{
|
||||
var row = $('#tableData').datagrid('getChecked');
|
||||
if(row.length == 0)
|
||||
{
|
||||
$.messager.alert('删除提示','没有记录被选中!','info');
|
||||
return;
|
||||
}
|
||||
if(row.length > 0)
|
||||
{
|
||||
$.messager.confirm('删除确认','确定要删除选中的' + row.length + '条商品信息吗?',function(r)
|
||||
{
|
||||
if (r)
|
||||
{
|
||||
var ids = "";
|
||||
for(var i = 0;i < row.length; i ++)
|
||||
{
|
||||
if(i == row.length-1)
|
||||
{
|
||||
ids += row[i].Id;
|
||||
break;
|
||||
}
|
||||
//alert(row[i].id);
|
||||
ids += row[i].Id + ",";
|
||||
}
|
||||
$.ajax({
|
||||
type:"post",
|
||||
url: "<%=path %>/material/batchDelete.action",
|
||||
dataType: "json",
|
||||
async : false,
|
||||
data: ({
|
||||
materialIDs : ids,
|
||||
clientIp:'<%=clientIp %>'
|
||||
}),
|
||||
success: function (tipInfo)
|
||||
{
|
||||
var msg = tipInfo.showModel.msgTip;
|
||||
if(msg == '成功')
|
||||
{
|
||||
//加载完以后重新初始化
|
||||
$("#searchBtn").click();
|
||||
$(":checkbox").attr("checked",false);
|
||||
}
|
||||
else
|
||||
$.messager.alert('删除提示','删除商品信息失败,请稍后再试!','error');
|
||||
},
|
||||
//此处添加错误处理
|
||||
error:function()
|
||||
{
|
||||
$.messager.alert('删除提示','删除商品信息异常,请稍后再试!','error');
|
||||
return;
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
//增加
|
||||
var url;
|
||||
var materialID = 0;
|
||||
//保存编辑前的名称
|
||||
var orgMaterial = "";
|
||||
|
||||
function addMaterial()
|
||||
{
|
||||
$("#clientIp").val('<%=clientIp %>');
|
||||
$('#materialFM').form('clear');
|
||||
$('#materialDlg').dialog('open').dialog('setTitle','<img src="<%=path%>/js/easyui-1.3.5/themes/icons/edit_add.png"/> 增加商品信息');
|
||||
$(".window-mask").css({ width: webW ,height: webH});
|
||||
$("#Name").val("").focus();
|
||||
|
||||
orgMaterial = "";
|
||||
materialID = 0;
|
||||
url = '<%=path %>/material/create.action';
|
||||
}
|
||||
|
||||
//保存信息
|
||||
$("#saveMaterial").unbind().bind({
|
||||
click:function()
|
||||
{
|
||||
if(!$('#materialFM').form('validate'))
|
||||
return;
|
||||
else
|
||||
{
|
||||
var parent=1;
|
||||
if($("#CategoryId_f").val()!=""&&$("#CategoryId_f").val()!=null)
|
||||
{
|
||||
parent=$("#CategoryId_f").val();
|
||||
}
|
||||
if($("#CategoryId_s").val()!=""&&$("#CategoryId_s").val()!=null)
|
||||
{
|
||||
parent=$("#CatetgoryId_s").val();
|
||||
}
|
||||
if($("#CategoryId_t").val()!=""&&$("#CategoryId_t").val()!=null)
|
||||
{
|
||||
parent=$("#CategoryId_t").val();
|
||||
}
|
||||
$.ajax({
|
||||
type:"post",
|
||||
url: url,
|
||||
dataType: "json",
|
||||
async : false,
|
||||
data: ({
|
||||
CategoryId : parent,
|
||||
Name : $.trim($("#Name").val()),
|
||||
Model : $.trim($("#Model").val()),
|
||||
Color : $.trim($("#Color").val()),
|
||||
Unit : $.trim($("#Unit").val()),
|
||||
RetailPrice : $.trim($("#RetailPrice").val()),
|
||||
LowPrice : $.trim($("#LowPrice").val()),
|
||||
PresetPriceOne : $.trim($("#PresetPriceOne").val()),
|
||||
PresetPriceTwo : $.trim($("#PresetPriceTwo").val()),
|
||||
Remark : $.trim($("#Remark").val()),
|
||||
clientIp:'<%=clientIp %>'
|
||||
}),
|
||||
success: function (tipInfo)
|
||||
{
|
||||
if(tipInfo)
|
||||
{
|
||||
$('#materialDlg').dialog('close');
|
||||
|
||||
var opts = $("#tableData").datagrid('options');
|
||||
showMaterialDetails(opts.pageNumber,opts.pageSize);
|
||||
}
|
||||
else
|
||||
{
|
||||
$.messager.show({
|
||||
title: '错误提示',
|
||||
msg: '保存商品信息失败,请稍后重试!'
|
||||
});
|
||||
}
|
||||
},
|
||||
//此处添加错误处理
|
||||
error:function()
|
||||
{
|
||||
$.messager.alert('提示','保存商品信息异常,请稍后再试!','error');
|
||||
return;
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
//编辑信息
|
||||
function editMaterial(materialTotalInfo)
|
||||
{
|
||||
var materialInfo = materialTotalInfo.split("AaBb");
|
||||
|
||||
$("#clientIp").val('<%=clientIp %>');
|
||||
$("#Name").focus().val(materialInfo[1]);
|
||||
$("#Model").val(materialInfo[2]);
|
||||
$("#Color").val(materialInfo[3]);
|
||||
$("#Unit").val(materialInfo[4]);
|
||||
$("#RetailPrice").val(materialInfo[5]);
|
||||
$("#LowPrice").val(materialInfo[6]);
|
||||
$("#PresetPriceOne").val(materialInfo[7]);
|
||||
$("#PresetPriceTwo").val(materialInfo[8]);
|
||||
$("#Remark").val(materialInfo[9]);
|
||||
|
||||
//orgMaterial = materialInfo[1];
|
||||
$('#materialDlg').dialog('open').dialog('setTitle','<img src="<%=path%>/js/easyui-1.3.5/themes/icons/pencil.png"/> 编辑商品信息');
|
||||
$(".window-mask").css({ width: webW ,height: webH});
|
||||
materialID = materialInfo[0];
|
||||
//焦点在名称输入框==定焦在输入文字后面
|
||||
$("#Name").val("").focus().val(materialInfo[1]);
|
||||
url = '<%=path %>/material/update.action?materialID=' + materialInfo[0];
|
||||
}
|
||||
|
||||
//搜索处理
|
||||
$("#searchBtn").unbind().bind({
|
||||
click:function()
|
||||
{
|
||||
showMaterialDetails(1,initPageSize);
|
||||
var opts = $("#tableData").datagrid('options');
|
||||
var pager = $("#tableData").datagrid('getPager');
|
||||
opts.pageNumber = 1;
|
||||
opts.pageSize = initPageSize;
|
||||
pager.pagination('refresh',
|
||||
{
|
||||
pageNumber:1,
|
||||
pageSize:initPageSize
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
function showMaterialDetails(pageNo,pageSize)
|
||||
{
|
||||
if(setCategoryId!="1")
|
||||
{cid=2;}
|
||||
$.ajax({
|
||||
type:"post",
|
||||
url: "<%=path %>/material/findBy.action",
|
||||
dataType: "json",
|
||||
data: ({
|
||||
CategoryId:cid,
|
||||
CategoryIds:setCategoryId,
|
||||
pageNo:pageNo,
|
||||
pageSize:pageSize
|
||||
}),
|
||||
success: function (data)
|
||||
{
|
||||
$("#tableData").datagrid('loadData',data);
|
||||
},
|
||||
//此处添加错误处理
|
||||
error:function()
|
||||
{
|
||||
$.messager.alert('查询提示','查询数据后台异常,请稍后再试!','error');
|
||||
return;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
//重置按钮
|
||||
$("#searchResetBtn").unbind().bind({
|
||||
click:function(){
|
||||
$("#searchCategoryId_f").val("");
|
||||
$("#searchCategoryId_s").val("");
|
||||
$("#searchCategoryId_t").val("");
|
||||
//加载完以后重新初始化
|
||||
$("#searchBtn").click();
|
||||
}
|
||||
});
|
||||
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
603
src/main/webapp/pages/materials/materialcategory.jsp
Normal file
603
src/main/webapp/pages/materials/materialcategory.jsp
Normal file
@@ -0,0 +1,603 @@
|
||||
<%@page import="com.jsh.util.Tools"%>
|
||||
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
|
||||
<%
|
||||
String path = request.getContextPath();
|
||||
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
|
||||
String clientIp = Tools.getCurrentUserIP();
|
||||
%>
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>商品类别管理</title>
|
||||
<meta charset="utf-8">
|
||||
<!-- 指定以IE8的方式来渲染 -->
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE8"/>
|
||||
<link rel="shortcut icon" href="<%=path%>/images/favicon.ico" type="image/x-icon" />
|
||||
<script type="text/javascript" src="<%=path %>/js/jquery-1.8.0.min.js"></script>
|
||||
<link rel="stylesheet" type="text/css" href="<%=path %>/js/easyui-1.3.5/themes/default/easyui.css"/>
|
||||
<link rel="stylesheet" type="text/css" href="<%=path %>/js/easyui-1.3.5/themes/icon.css"/>
|
||||
<link type="text/css" rel="stylesheet" href="<%=path %>/css/common.css" />
|
||||
<script type="text/javascript" src="<%=path %>/js/easyui-1.3.5/jquery.easyui.min.js"></script>
|
||||
<script type="text/javascript" src="<%=path %>/js/easyui-1.3.5/locale/easyui-lang-zh_CN.js"></script>
|
||||
<script type="text/javascript" src="<%=path %>/js/common/common.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<!-- 查询 -->
|
||||
<div id = "searchPanel" class="easyui-panel" style="padding:10px;" title="查询窗口" iconCls="icon-search" collapsible="true" closable="false">
|
||||
<table id="searchTable">
|
||||
<tr>
|
||||
<td>类别:</td>
|
||||
<td>
|
||||
<select name="searchParentId_f" id="searchParentId_f" style="width:100px;"></select>
|
||||
<select name="searchParentId_s" id="searchParentId_s" style="width:100px;"></select>
|
||||
<select name="searchParentId_t" id="searchParentId_t" style="width:100px;"></select>
|
||||
</td>
|
||||
<td> </td>
|
||||
<td> </td>
|
||||
<td> </td>
|
||||
<td>
|
||||
<a href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-search" id="searchBtn">查询</a>
|
||||
<a href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-redo" id="searchResetBtn">重置</a>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<!-- 数据显示table -->
|
||||
<div id = "tablePanel" class="easyui-panel" style="padding:1px;top:300px;" title="商品类别列表" iconCls="icon-list" collapsible="true" closable="false">
|
||||
<table id="tableData" style="top:300px;border-bottom-color:#FFFFFF"></table>
|
||||
</div>
|
||||
|
||||
<div id="materialCategoryDlg" class="easyui-dialog" style="width:380px;padding:10px 20px"
|
||||
closed="true" buttons="#dlg-buttons" modal="true" cache="false" collapsible="false" closable="true">
|
||||
<form id="materialCategoryFM" method="post" novalidate>
|
||||
<table>
|
||||
<tr>
|
||||
<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>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>层次</td>
|
||||
<td style="padding:5px">
|
||||
<select name="CategoryLevel" id="CategoryLevel" style="width:100px;">
|
||||
<option value="1">一级分类</option>
|
||||
<option value="2">二级分类</option>
|
||||
<option value="3">三级分类</option>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>上级</td>
|
||||
<td style="padding:5px">
|
||||
<select name="ParentId_f" id="ParentId_f" style="width:100px;height: 20px"></select>
|
||||
<select name="ParentId_s" id="ParentId_s" style="width:100px;height: 20px"></select>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<input type="hidden" name="clientIp" id="clientIp" value="<%=clientIp %>"/>
|
||||
</form>
|
||||
</div>
|
||||
<div id="dlg-buttons">
|
||||
<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>
|
||||
</div>
|
||||
|
||||
<script type="text/javascript">
|
||||
var materialCategoryList = null;
|
||||
var materialCategoryID = null;
|
||||
var parentid_search=null;
|
||||
var lei=null;
|
||||
//初始化界面
|
||||
$(function()
|
||||
{
|
||||
//初始化系统基础信息
|
||||
initSystemData(1);
|
||||
initSelectInfo(1);
|
||||
initTableData();
|
||||
ininPager();
|
||||
initForm();
|
||||
});
|
||||
|
||||
//初始化系统基础信息
|
||||
function initSystemData(parentid_search)
|
||||
{
|
||||
$.ajax({
|
||||
type:"post",
|
||||
url: "<%=path%>/materialCategory/getBasicData.action",
|
||||
data: ({
|
||||
ParentId:parentid_search
|
||||
}),
|
||||
//设置为同步
|
||||
async:false,
|
||||
dataType: "json",
|
||||
success: function (systemInfo)
|
||||
{
|
||||
materialCategoryList = systemInfo.showModel.map.materialCategoryList;
|
||||
var msgTip = systemInfo.showModel.msgTip;
|
||||
if(msgTip == "exceptoin")
|
||||
{
|
||||
$.messager.alert('提示','查找商品类别异常,请与管理员联系!','error');
|
||||
return;
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
//初始化页面选项卡
|
||||
function initSelectInfo(lei)
|
||||
{
|
||||
var options = "";
|
||||
|
||||
if(materialCategoryList !=null)
|
||||
{
|
||||
options = "";
|
||||
for(var i = 0 ;i < materialCategoryList.length;i ++)
|
||||
{
|
||||
var materialCategory = materialCategoryList[i];
|
||||
if(0 == i)
|
||||
{
|
||||
materialCategoryID = materialCategory.id;
|
||||
}
|
||||
options += '<option value="' + materialCategory.id + '">' + materialCategory.name + '</option>';
|
||||
}
|
||||
//$("#ParentId").empty().append(options);
|
||||
if(lei==1)
|
||||
{
|
||||
$("#searchParentId_f").empty().append('<option value="">全部</option>').append(options);
|
||||
}
|
||||
else if(lei==2)
|
||||
{
|
||||
$("#searchParentId_s").empty().append('<option value="">全部</option>').append(options);
|
||||
}
|
||||
else if(lei==3)
|
||||
{
|
||||
$("#searchParentId_t").empty().append('<option value="">全部</option>').append(options);
|
||||
}
|
||||
else if(lei==11)
|
||||
{
|
||||
$("#ParentId_f").empty().append('<option value="">全部</option>').append(options);
|
||||
}
|
||||
else if(lei==12)
|
||||
{
|
||||
$("#ParentId_s").empty().append('<option value="">全部</option>').append(options);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$("#searchParentId_f").change(
|
||||
function(){
|
||||
var parentid_search=$("#searchParentId_f").val();
|
||||
if(parentid_search!='')
|
||||
{
|
||||
initSystemData(parentid_search);
|
||||
initSelectInfo(2);
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
$("#searchParentId_s").change(
|
||||
function(){
|
||||
var parentid_search=$("#searchParentId_s").val();
|
||||
if(parentid_search!='')
|
||||
{
|
||||
initSystemData(parentid_search);
|
||||
initSelectInfo(3);
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
$("#CategoryLevel").change(
|
||||
function(){
|
||||
var CategoryLevel=$("#CategoryLevel").val();
|
||||
if(CategoryLevel==1)
|
||||
{
|
||||
$("#ParentId_f").empty();
|
||||
$("#ParentId_s").empty();
|
||||
}
|
||||
else if(CategoryLevel==2)
|
||||
{
|
||||
initSystemData(1);
|
||||
initSelectInfo(11);
|
||||
$("#ParentId_s").enabled=false;
|
||||
}
|
||||
else if(CategoryLevel==3)
|
||||
{
|
||||
initSystemData(1);
|
||||
initSelectInfo(11);
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
$("#ParentId_f").change(
|
||||
function(){
|
||||
var ParentId_f=$("#ParentId_f").val();
|
||||
initSystemData(ParentId_f);
|
||||
initSelectInfo(12);
|
||||
}
|
||||
);
|
||||
|
||||
//防止表单提交重复
|
||||
function initForm()
|
||||
{
|
||||
$('#materialCategoryFM').form({
|
||||
onSubmit: function(){
|
||||
return false;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
//初始化表格数据
|
||||
function initTableData()
|
||||
{
|
||||
$('#tableData').datagrid({
|
||||
//title:'商品类别列表',
|
||||
//iconCls:'icon-save',
|
||||
//width:700,
|
||||
height:heightInfo,
|
||||
nowrap: false,
|
||||
rownumbers: false,
|
||||
//动画效果
|
||||
animate:false,
|
||||
//选中单行
|
||||
singleSelect : true,
|
||||
collapsible:false,
|
||||
selectOnCheck:false,
|
||||
//fitColumns:true,
|
||||
//单击行是否选中
|
||||
//checkOnSelect : false,
|
||||
url:'<%=path %>/materialCategory/findBy.action?pageSize=' + initPageSize+'&ParentId=1',
|
||||
pagination: true,
|
||||
//交替出现背景
|
||||
striped : true,
|
||||
//loadFilter: pagerFilter,
|
||||
pageSize: initPageSize,
|
||||
pageList: initPageNum,
|
||||
columns:[[
|
||||
{ field: 'Id',width:35,align:"center",checkbox:true},
|
||||
{ title: '名称',field: 'Name',width:250},
|
||||
{ title: '操作',field: 'op',align:"center",width:130,formatter:function(value,rec)
|
||||
{
|
||||
var str = '';
|
||||
var rowInfo = rec.Id + 'AaBb' + rec.ParentId+ 'AaBb' + rec.CategoryLevel+ 'AaBb' + rec.Name;
|
||||
if(1 == value)
|
||||
{
|
||||
str += '<img src="<%=path%>/js/easyui-1.3.5/themes/icons/pencil.png" style="cursor: pointer;" onclick="editMaterialCategory(\'' + rowInfo + '\');"/> <a onclick="editMaterialCategory(\'' + rowInfo + '\');" style="text-decoration:none;color:black;" href="javascript:void(0)">编辑</a> ';
|
||||
str += '<img src="<%=path%>/js/easyui-1.3.5/themes/icons/edit_remove.png" style="cursor: pointer;" onclick="deleteMaterialCategory('+ rec.Id +');"/> <a onclick="deleteMaterialCategory('+ rec.Id +');" style="text-decoration:none;color:black;" href="javascript:void(0)">删除</a> ';
|
||||
}
|
||||
return str;
|
||||
}
|
||||
}
|
||||
]],
|
||||
toolbar:[
|
||||
{
|
||||
id:'addMaterialCategory',
|
||||
text:'增加',
|
||||
iconCls:'icon-add',
|
||||
handler:function()
|
||||
{
|
||||
addMaterialCategory();
|
||||
}
|
||||
},
|
||||
{
|
||||
id:'deleteMaterialCategory',
|
||||
text:'删除',
|
||||
iconCls:'icon-remove',
|
||||
handler:function()
|
||||
{
|
||||
batDeleteMaterialCategory();
|
||||
}
|
||||
}
|
||||
],
|
||||
onLoadError:function()
|
||||
{
|
||||
$.messager.alert('页面加载提示','页面加载异常,请稍后再试!','error');
|
||||
return;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
//初始化键盘enter事件
|
||||
$(document).keydown(function(event)
|
||||
{
|
||||
//兼容 IE和firefox 事件
|
||||
var e = window.event || event;
|
||||
var k = e.keyCode||e.which||e.charCode;
|
||||
//兼容 IE,firefox 兼容
|
||||
var obj = e.srcElement ? e.srcElement : e.target;
|
||||
//绑定键盘事件为 id是指定的输入框才可以触发键盘事件 13键盘事件 ---遗留问题 enter键效验 对话框会关闭问题
|
||||
if(k == "13"&&(obj.id=="CategoryLevel"||obj.id=="Name"))
|
||||
{
|
||||
$("#saveMaterialCategory").click();
|
||||
}
|
||||
//搜索按钮添加快捷键
|
||||
if(k == "13"&&(obj.id=="searchParentId"))
|
||||
{
|
||||
$("#searchBtn").click();
|
||||
}
|
||||
});
|
||||
//分页信息处理
|
||||
function ininPager()
|
||||
{
|
||||
try
|
||||
{
|
||||
var opts = $("#tableData").datagrid('options');
|
||||
var pager = $("#tableData").datagrid('getPager');
|
||||
pager.pagination({
|
||||
onSelectPage:function(pageNum, pageSize)
|
||||
{
|
||||
opts.pageNumber = pageNum;
|
||||
opts.pageSize = pageSize;
|
||||
pager.pagination('refresh',
|
||||
{
|
||||
pageNumber:pageNum,
|
||||
pageSize:pageSize
|
||||
});
|
||||
showMaterialCategoryDetails(pageNum,pageSize);
|
||||
}
|
||||
});
|
||||
}
|
||||
catch (e)
|
||||
{
|
||||
$.messager.alert('异常处理提示',"分页信息异常 : " + e.name + ": " + e.message,'error');
|
||||
}
|
||||
}
|
||||
|
||||
//删除商品类别信息
|
||||
function deleteMaterialCategory(materialCategoryID)
|
||||
{
|
||||
$.messager.confirm('删除确认','确定要删除此商品类别信息吗?',function(r)
|
||||
{
|
||||
if (r)
|
||||
{
|
||||
$.ajax({
|
||||
type:"post",
|
||||
url: "<%=path %>/materialCategory/delete.action",
|
||||
dataType: "json",
|
||||
data: ({
|
||||
materialCategoryID : materialCategoryID,
|
||||
clientIp:'<%=clientIp %>'
|
||||
}),
|
||||
success: function (tipInfo)
|
||||
{
|
||||
var msg = tipInfo.showModel.msgTip;
|
||||
if(msg == '成功')
|
||||
{
|
||||
//加载完以后重新初始化
|
||||
$("#searchBtn").click();
|
||||
}
|
||||
else
|
||||
$.messager.alert('删除提示','删除商品类别信息失败,请稍后再试!','error');
|
||||
},
|
||||
//此处添加错误处理
|
||||
error:function()
|
||||
{
|
||||
$.messager.alert('删除提示','删除商品类别信息异常,请稍后再试!','error');
|
||||
return;
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
//批量删除商品类别
|
||||
function batDeleteMaterialCategory()
|
||||
{
|
||||
var row = $('#tableData').datagrid('getChecked');
|
||||
if(row.length == 0)
|
||||
{
|
||||
$.messager.alert('删除提示','没有记录被选中!','info');
|
||||
return;
|
||||
}
|
||||
if(row.length > 0)
|
||||
{
|
||||
$.messager.confirm('删除确认','确定要删除选中的' + row.length + '条商品类别信息吗?',function(r)
|
||||
{
|
||||
if (r)
|
||||
{
|
||||
var ids = "";
|
||||
for(var i = 0;i < row.length; i ++)
|
||||
{
|
||||
if(i == row.length-1)
|
||||
{
|
||||
ids += row[i].Id;
|
||||
break;
|
||||
}
|
||||
//alert(row[i].id);
|
||||
ids += row[i].Id + ",";
|
||||
}
|
||||
$.ajax({
|
||||
type:"post",
|
||||
url: "<%=path %>/materialCategory/batchDelete.action",
|
||||
dataType: "json",
|
||||
async : false,
|
||||
data: ({
|
||||
materialCategoryIDs : ids,
|
||||
clientIp:'<%=clientIp %>'
|
||||
}),
|
||||
success: function (tipInfo)
|
||||
{
|
||||
var msg = tipInfo.showModel.msgTip;
|
||||
if(msg == '成功')
|
||||
{
|
||||
//加载完以后重新初始化
|
||||
$("#searchBtn").click();
|
||||
$(":checkbox").attr("checked",false);
|
||||
}
|
||||
else
|
||||
$.messager.alert('删除提示','删除商品类别信息失败,请稍后再试!','error');
|
||||
},
|
||||
//此处添加错误处理
|
||||
error:function()
|
||||
{
|
||||
$.messager.alert('删除提示','删除商品类别信息异常,请稍后再试!','error');
|
||||
return;
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
//增加
|
||||
var url;
|
||||
var materialCategoryID = 0;
|
||||
//保存编辑前的名称
|
||||
var orgMaterialCategory = "";
|
||||
|
||||
function addMaterialCategory()
|
||||
{
|
||||
$("#clientIp").val('<%=clientIp %>');
|
||||
$('#materialCategoryFM').form('clear');
|
||||
$('#materialCategoryDlg').dialog('open').dialog('setTitle','<img src="<%=path%>/js/easyui-1.3.5/themes/icons/edit_add.png"/> 增加商品类别信息');
|
||||
$(".window-mask").css({ width: webW ,height: webH});
|
||||
$("#Name").val("").focus();
|
||||
|
||||
orgMaterialCategory = "";
|
||||
materialCategoryID = 0;
|
||||
url = '<%=path %>/materialCategory/create.action';
|
||||
}
|
||||
|
||||
//保存信息
|
||||
$("#saveMaterialCategory").unbind().bind({
|
||||
click:function()
|
||||
{
|
||||
if(!$('#materialCategoryFM').form('validate'))
|
||||
return;
|
||||
else
|
||||
{
|
||||
var parent=1;
|
||||
if($("#ParentId_f").val()!=""&&$("#ParentId_f").val()!=null)
|
||||
{
|
||||
parent=$("#ParentId_f").val();
|
||||
}
|
||||
if($("#ParentId_s").val()!=""&&$("#ParentId_s").val()!=null)
|
||||
{
|
||||
parent=$("#ParentId_s").val();
|
||||
}
|
||||
$.ajax({
|
||||
type:"post",
|
||||
url: url,
|
||||
dataType: "json",
|
||||
async : false,
|
||||
data: ({
|
||||
ParentId : parent,
|
||||
CategoryLevel : $("#CategoryLevel").val(),
|
||||
Name : $.trim($("#Name").val()),
|
||||
clientIp:'<%=clientIp %>'
|
||||
}),
|
||||
success: function (tipInfo)
|
||||
{
|
||||
if(tipInfo)
|
||||
{
|
||||
$('#materialCategoryDlg').dialog('close');
|
||||
|
||||
var opts = $("#tableData").datagrid('options');
|
||||
showMaterialCategoryDetails(opts.pageNumber,opts.pageSize);
|
||||
}
|
||||
else
|
||||
{
|
||||
$.messager.show({
|
||||
title: '错误提示',
|
||||
msg: '保存商品类别信息失败,请稍后重试!'
|
||||
});
|
||||
}
|
||||
},
|
||||
//此处添加错误处理
|
||||
error:function()
|
||||
{
|
||||
$.messager.alert('提示','保存商品类别信息异常,请稍后再试!','error');
|
||||
return;
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
//编辑信息
|
||||
function editMaterialCategory(materialCategoryTotalInfo)
|
||||
{
|
||||
var materialCategoryInfo = materialCategoryTotalInfo.split("AaBb");
|
||||
|
||||
$("#clientIp").val('<%=clientIp %>');
|
||||
$("#ParentId").focus().val(materialCategoryInfo[1]);
|
||||
$("#CategoryLevel").val(materialCategoryInfo[2]);
|
||||
$("#Name").val(materialCategoryInfo[3]);
|
||||
|
||||
//orgMaterialCategory = materialCategoryInfo[1];
|
||||
$('#materialCategoryDlg').dialog('open').dialog('setTitle','<img src="<%=path%>/js/easyui-1.3.5/themes/icons/pencil.png"/> 编辑商品类别信息');
|
||||
$(".window-mask").css({ width: webW ,height: webH});
|
||||
materialCategoryID = materialCategoryInfo[0];
|
||||
//焦点在名称输入框==定焦在输入文字后面
|
||||
$("#Name").val("").focus().val(materialCategoryInfo[3]);
|
||||
url = '<%=path %>/materialCategory/update.action?materialCategoryID=' + materialCategoryInfo[0];
|
||||
}
|
||||
|
||||
//搜索处理
|
||||
$("#searchBtn").unbind().bind({
|
||||
click:function()
|
||||
{
|
||||
showMaterialCategoryDetails(1,initPageSize);
|
||||
var opts = $("#tableData").datagrid('options');
|
||||
var pager = $("#tableData").datagrid('getPager');
|
||||
opts.pageNumber = 1;
|
||||
opts.pageSize = initPageSize;
|
||||
pager.pagination('refresh',
|
||||
{
|
||||
pageNumber:1,
|
||||
pageSize:initPageSize
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
function showMaterialCategoryDetails(pageNo,pageSize)
|
||||
{
|
||||
var parent=1;
|
||||
if($("#searchParentId_f").val()!=""&&$("#searchParentId_f").val()!=null)
|
||||
{
|
||||
parent=$("#searchParentId_f").val();
|
||||
}
|
||||
if($("#searchParentId_s").val()!=""&&$("#searchParentId_s").val()!=null)
|
||||
{
|
||||
parent=$("#searchParentId_s").val();
|
||||
}
|
||||
if($("#searchParentId_t").val()!=""&&$("#searchParentId_t").val()!=null)
|
||||
{
|
||||
parent=$("#searchParentId_t").val();
|
||||
|
||||
}
|
||||
$.ajax({
|
||||
type:"post",
|
||||
url: "<%=path %>/materialCategory/findBy.action",
|
||||
dataType: "json",
|
||||
data: ({
|
||||
ParentId:parent,
|
||||
pageNo:pageNo,
|
||||
pageSize:pageSize
|
||||
}),
|
||||
success: function (data)
|
||||
{
|
||||
$("#tableData").datagrid('loadData',data);
|
||||
},
|
||||
//此处添加错误处理
|
||||
error:function()
|
||||
{
|
||||
$.messager.alert('查询提示','查询数据后台异常,请稍后再试!','error');
|
||||
return;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
//重置按钮
|
||||
$("#searchResetBtn").unbind().bind({
|
||||
click:function(){
|
||||
$("#searchParentId_f").val("");
|
||||
$("#searchParentId_s").val("");
|
||||
$("#searchParentId_t").val("");
|
||||
//加载完以后重新初始化
|
||||
$("#searchBtn").click();
|
||||
}
|
||||
});
|
||||
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
161
src/main/webapp/pages/materials/other_in_list.jsp
Normal file
161
src/main/webapp/pages/materials/other_in_list.jsp
Normal file
@@ -0,0 +1,161 @@
|
||||
<%@page import="com.jsh.util.Tools"%>
|
||||
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
|
||||
<%
|
||||
String path = request.getContextPath();
|
||||
String clientIp = Tools.getCurrentUserIP();
|
||||
%>
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>其它入库</title>
|
||||
<meta charset="utf-8">
|
||||
<!-- 指定以IE8的方式来渲染 -->
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE8"/>
|
||||
<link rel="shortcut icon" href="<%=path%>/images/favicon.ico" type="image/x-icon" />
|
||||
<link rel="stylesheet" type="text/css" href="<%=path %>/js/easyui-1.3.5/themes/default/easyui.css"/>
|
||||
<link rel="stylesheet" type="text/css" href="<%=path %>/js/easyui-1.3.5/themes/icon.css"/>
|
||||
<link type="text/css" rel="stylesheet" href="<%=path %>/css/common.css" />
|
||||
<script src="<%=path %>/js/jquery-1.8.0.min.js"></script>
|
||||
<script src="<%=path %>/js/easyui-1.3.5/jquery.easyui.min.js"></script>
|
||||
<script src="<%=path %>/js/easyui-1.3.5/locale/easyui-lang-zh_CN.js"></script>
|
||||
<script src="<%=path %>/js/My97DatePicker/WdatePicker.js"></script>
|
||||
<script src="<%=path %>/js/common/common.js"></script>
|
||||
<script src="<%=path %>/js/pages/materials/in_out.js"></script>
|
||||
<script>
|
||||
var kid = ${sessionScope.user.id};
|
||||
var path = "<%=path%>";
|
||||
var clientIp = "<%=clientIp%>";
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<!-- 查询 -->
|
||||
<div id = "searchPanel" class="easyui-panel" style="padding:3px;" title="查询窗口" iconCls="icon-search" collapsible="true" closable="false">
|
||||
<table id="searchTable">
|
||||
<tr>
|
||||
<td>收货仓库:</td>
|
||||
<td>
|
||||
<select name="searchProjectId" id="searchProjectId" style="width:80px;"></select>
|
||||
</td>
|
||||
<td>单据编号:</td>
|
||||
<td>
|
||||
<input type="text" name="searchNumber" id="searchNumber" style="width:60px;"/>
|
||||
</td>
|
||||
<td>单据日期:</td>
|
||||
<td>
|
||||
<input type="text" name="searchBeginTime" id="searchBeginTime" onClick="WdatePicker({dateFmt:'yyyy-MM-dd'})" class="txt Wdate" style="width:80px;"/>
|
||||
</td>
|
||||
<td>-</td>
|
||||
<td>
|
||||
<input type="text" name="searchEndTime" id="searchEndTime" onClick="WdatePicker({dateFmt:'yyyy-MM-dd'})" class="txt Wdate" style="width:80px;"/>
|
||||
</td>
|
||||
<td> </td>
|
||||
<td>
|
||||
<a href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-search" id="searchBtn">查询</a>
|
||||
<a href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-redo" id="searchResetBtn">重置</a>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<!-- 数据显示table -->
|
||||
<div id="tablePanel" class="easyui-panel" style="padding:1px; top:300px;" title="其它入库列表" iconCls="icon-list" collapsible="true" closable="false">
|
||||
<table id="tableData" style="top:300px;border-bottom-color:#FFFFFF"></table>
|
||||
</div>
|
||||
|
||||
<div id="depotHeadDlg" class="easyui-dialog" style="width:850px;padding:10px 20px;top:20px"
|
||||
closed="true" buttons="#dlg-buttons" modal="true" cache="false" collapsible="false" closable="true">
|
||||
<form id="depotHeadFM" method="post" novalidate>
|
||||
<table>
|
||||
<tr>
|
||||
<td>收货仓库:</td>
|
||||
<td style="padding:5px">
|
||||
<select name="ProjectId" id="ProjectId" style="width:120px;"></select>
|
||||
</td>
|
||||
<td>单据日期:</td>
|
||||
<td style="padding:5px">
|
||||
<input type="text" name="OperTime" id="OperTime" onClick="WdatePicker({dateFmt:'yyyy-MM-dd'})" class="txt Wdate" style="width:120px;"/>
|
||||
</td>
|
||||
<td>往来单位:</td>
|
||||
<td style="padding:5px">
|
||||
<input id="OrganId" name="OrganId" style="width:120px;" />
|
||||
</td>
|
||||
<td style="width:50px;"></td>
|
||||
<td style="padding:5px;width:120px;"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>经手人:</td>
|
||||
<td style="padding:5px">
|
||||
<select name="HandsPersonId" id="HandsPersonId" style="width:120px;"></select>
|
||||
</td>
|
||||
<td>单据编号:</td>
|
||||
<td style="padding:5px">
|
||||
<input name="Number" id="Number" class="easyui-validatebox" data-options="required:true,validType:'length[2,30]'" style="width: 120px;"/>
|
||||
</td>
|
||||
<td>单据备注:</td>
|
||||
<td style="padding:5px">
|
||||
<input name="Remark" id="Remark" class="easyui-validatebox" style="width: 120px;"/>
|
||||
</td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>商品列表:</td>
|
||||
<td colspan="7">
|
||||
<!-- 商品列表table -->
|
||||
<table id="materialData" style="top:100px;border-bottom-color:#FFFFFF"></table>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<input type="hidden" name="clientIp" id="clientIp" value="<%=clientIp %>"/>
|
||||
</form>
|
||||
</div>
|
||||
<div id="dlg-buttons">
|
||||
<a href="javascript:void(0)" id="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>
|
||||
</div>
|
||||
<div id="depotHeadDlgShow" class="easyui-dialog" style="width:850px;padding:10px 20px;top:20px"
|
||||
closed="true" modal="true" cache="false" collapsible="false" closable="true">
|
||||
<table>
|
||||
<tr>
|
||||
<td>收货仓库:</td>
|
||||
<td style="padding:5px;width:120px;">
|
||||
<span id="ProjectIdShow"></span>
|
||||
</td>
|
||||
<td>单据日期:</td>
|
||||
<td style="padding:5px;width:120px;">
|
||||
<span id="OperTimeShow"></span>
|
||||
</td>
|
||||
<td>往来单位:</td>
|
||||
<td style="padding:5px;width:120px;">
|
||||
<span id="OrganIdShow"></span>
|
||||
</td>
|
||||
<td style="width:50px;"></td>
|
||||
<td style="padding:5px;width:120px;"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>经手人:</td>
|
||||
<td style="padding:5px">
|
||||
<span id="HandsPersonIdShow"></span>
|
||||
</td>
|
||||
<td>单据编号:</td>
|
||||
<td style="padding:5px">
|
||||
<span id="NumberShow"></span>
|
||||
</td>
|
||||
<td>单据备注:</td>
|
||||
<td style="padding:5px">
|
||||
<span id="RemarkShow"></span>
|
||||
</td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>商品列表:</td>
|
||||
<td colspan="7">
|
||||
<!-- 商品列表table -->
|
||||
<table id="materialDataShow" style="top:100px;border-bottom-color:#FFFFFF"></table>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
161
src/main/webapp/pages/materials/other_out_list.jsp
Normal file
161
src/main/webapp/pages/materials/other_out_list.jsp
Normal file
@@ -0,0 +1,161 @@
|
||||
<%@page import="com.jsh.util.Tools"%>
|
||||
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
|
||||
<%
|
||||
String path = request.getContextPath();
|
||||
String clientIp = Tools.getCurrentUserIP();
|
||||
%>
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>其它出库</title>
|
||||
<meta charset="utf-8">
|
||||
<!-- 指定以IE8的方式来渲染 -->
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE8"/>
|
||||
<link rel="shortcut icon" href="<%=path%>/images/favicon.ico" type="image/x-icon" />
|
||||
<link rel="stylesheet" type="text/css" href="<%=path %>/js/easyui-1.3.5/themes/default/easyui.css"/>
|
||||
<link rel="stylesheet" type="text/css" href="<%=path %>/js/easyui-1.3.5/themes/icon.css"/>
|
||||
<link type="text/css" rel="stylesheet" href="<%=path %>/css/common.css" />
|
||||
<script src="<%=path %>/js/jquery-1.8.0.min.js"></script>
|
||||
<script src="<%=path %>/js/easyui-1.3.5/jquery.easyui.min.js"></script>
|
||||
<script src="<%=path %>/js/easyui-1.3.5/locale/easyui-lang-zh_CN.js"></script>
|
||||
<script src="<%=path %>/js/My97DatePicker/WdatePicker.js"></script>
|
||||
<script src="<%=path %>/js/common/common.js"></script>
|
||||
<script src="<%=path %>/js/pages/materials/in_out.js"></script>
|
||||
<script>
|
||||
var kid = ${sessionScope.user.id};
|
||||
var path = "<%=path%>";
|
||||
var clientIp = "<%=clientIp%>";
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<!-- 查询 -->
|
||||
<div id = "searchPanel" class="easyui-panel" style="padding:3px;" title="查询窗口" iconCls="icon-search" collapsible="true" closable="false">
|
||||
<table id="searchTable">
|
||||
<tr>
|
||||
<td>发货仓库:</td>
|
||||
<td>
|
||||
<select name="searchProjectId" id="searchProjectId" style="width:80px;"></select>
|
||||
</td>
|
||||
<td>单据编号:</td>
|
||||
<td>
|
||||
<input type="text" name="searchNumber" id="searchNumber" style="width:60px;"/>
|
||||
</td>
|
||||
<td>单据日期:</td>
|
||||
<td>
|
||||
<input type="text" name="searchBeginTime" id="searchBeginTime" onClick="WdatePicker({dateFmt:'yyyy-MM-dd'})" class="txt Wdate" style="width:80px;"/>
|
||||
</td>
|
||||
<td>-</td>
|
||||
<td>
|
||||
<input type="text" name="searchEndTime" id="searchEndTime" onClick="WdatePicker({dateFmt:'yyyy-MM-dd'})" class="txt Wdate" style="width:80px;"/>
|
||||
</td>
|
||||
<td> </td>
|
||||
<td>
|
||||
<a href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-search" id="searchBtn">查询</a>
|
||||
<a href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-redo" id="searchResetBtn">重置</a>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<!-- 数据显示table -->
|
||||
<div id="tablePanel" class="easyui-panel" style="padding:1px; top:300px;" title="其它出库列表" iconCls="icon-list" collapsible="true" closable="false">
|
||||
<table id="tableData" style="top:300px;border-bottom-color:#FFFFFF"></table>
|
||||
</div>
|
||||
|
||||
<div id="depotHeadDlg" class="easyui-dialog" style="width:850px;padding:10px 20px;top:20px"
|
||||
closed="true" buttons="#dlg-buttons" modal="true" cache="false" collapsible="false" closable="true">
|
||||
<form id="depotHeadFM" method="post" novalidate>
|
||||
<table>
|
||||
<tr>
|
||||
<td>发货仓库:</td>
|
||||
<td style="padding:5px">
|
||||
<select name="ProjectId" id="ProjectId" style="width:120px;"></select>
|
||||
</td>
|
||||
<td>单据日期:</td>
|
||||
<td style="padding:5px">
|
||||
<input type="text" name="OperTime" id="OperTime" onClick="WdatePicker({dateFmt:'yyyy-MM-dd'})" class="txt Wdate" style="width:120px;"/>
|
||||
</td>
|
||||
<td>往来单位:</td>
|
||||
<td style="padding:5px">
|
||||
<input id="OrganId" name="OrganId" style="width:120px;" />
|
||||
</td>
|
||||
<td style="width:50px;"></td>
|
||||
<td style="padding:5px;width:120px;"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>经手人:</td>
|
||||
<td style="padding:5px">
|
||||
<select name="HandsPersonId" id="HandsPersonId" style="width:120px;"></select>
|
||||
</td>
|
||||
<td>单据编号:</td>
|
||||
<td style="padding:5px"><input name="Number" id="Number" class="easyui-validatebox" data-options="required:true,validType:'length[2,30]'" style="width: 120px;"/>
|
||||
</td>
|
||||
<td>单据备注:</td>
|
||||
<td style="padding:5px">
|
||||
<input name="Remark" id="Remark" class="easyui-validatebox" style="width: 120px;"/>
|
||||
</td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>商品列表:</td>
|
||||
<td colspan="7">
|
||||
<!-- 商品列表table -->
|
||||
<table id="materialData" style="top:100px;border-bottom-color:#FFFFFF"></table>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<input type="hidden" name="clientIp" id="clientIp" value="<%=clientIp %>"/>
|
||||
</form>
|
||||
</div>
|
||||
<div id="dlg-buttons">
|
||||
<a href="javascript:void(0)" id="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>
|
||||
</div>
|
||||
<div id="depotHeadDlgShow" class="easyui-dialog" style="width:850px;padding:10px 20px;top:20px"
|
||||
closed="true" modal="true" cache="false" collapsible="false" closable="true">
|
||||
<table>
|
||||
<tr>
|
||||
<td>发货仓库:</td>
|
||||
<td style="padding:5px;width:120px;">
|
||||
<span id="ProjectIdShow"></span>
|
||||
</td>
|
||||
<td>单据日期:</td>
|
||||
<td style="padding:5px;width:120px;">
|
||||
<span id="OperTimeShow"></span>
|
||||
</td>
|
||||
<td>往来单位:</td>
|
||||
<td style="padding:5px;width:120px;">
|
||||
<span id="OrganIdShow"></span>
|
||||
</td>
|
||||
<td style="width:50px;"></td>
|
||||
<td style="padding:5px;width:120px;">
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>经手人:</td>
|
||||
<td style="padding:5px">
|
||||
<span id="HandsPersonIdShow"></span>
|
||||
</td>
|
||||
<td>单据编号:</td>
|
||||
<td style="padding:5px">
|
||||
<span id="NumberShow"></span>
|
||||
</td>
|
||||
<td>单据备注:</td>
|
||||
<td style="padding:5px">
|
||||
<span id="RemarkShow"></span>
|
||||
</td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>商品列表:</td>
|
||||
<td colspan="7">
|
||||
<!-- 商品列表table -->
|
||||
<table id="materialDataShow" style="top:100px;border-bottom-color:#FFFFFF"></table>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
504
src/main/webapp/pages/materials/person.jsp
Normal file
504
src/main/webapp/pages/materials/person.jsp
Normal file
@@ -0,0 +1,504 @@
|
||||
<%@page import="com.jsh.util.Tools"%>
|
||||
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
|
||||
<%
|
||||
String path = request.getContextPath();
|
||||
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
|
||||
String clientIp = Tools.getCurrentUserIP();
|
||||
%>
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>经手人管理</title>
|
||||
<meta charset="utf-8">
|
||||
<!-- 指定以IE8的方式来渲染 -->
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE8"/>
|
||||
<link rel="shortcut icon" href="<%=path%>/images/favicon.ico" type="image/x-icon" />
|
||||
<script type="text/javascript" src="<%=path %>/js/jquery-1.8.0.min.js"></script>
|
||||
<link rel="stylesheet" type="text/css" href="<%=path %>/js/easyui-1.3.5/themes/default/easyui.css"/>
|
||||
<link rel="stylesheet" type="text/css" href="<%=path %>/js/easyui-1.3.5/themes/icon.css"/>
|
||||
<link type="text/css" rel="stylesheet" href="<%=path %>/css/common.css" />
|
||||
<script type="text/javascript" src="<%=path %>/js/easyui-1.3.5/jquery.easyui.min.js"></script>
|
||||
<script type="text/javascript" src="<%=path %>/js/easyui-1.3.5/locale/easyui-lang-zh_CN.js"></script>
|
||||
<script type="text/javascript" src="<%=path %>/js/common/common.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<!-- 查询 -->
|
||||
<div id = "searchPanel" class="easyui-panel" style="padding:10px;" title="查询窗口" iconCls="icon-search" collapsible="true" closable="false">
|
||||
<table id="searchTable">
|
||||
<tr>
|
||||
<td>姓名:</td>
|
||||
<td>
|
||||
<input name="searchName" id="searchName" style="width:230px;"/>
|
||||
</td>
|
||||
<td>类型:</td>
|
||||
<td>
|
||||
<select name="searchType" id="searchType" style="width:230px;">
|
||||
<option value="">全部</option>
|
||||
<option value="仓管员">仓管员</option>
|
||||
<option value="财务员">财务员</option>
|
||||
</select>
|
||||
</td>
|
||||
<td> </td>
|
||||
<td> </td>
|
||||
<td> </td>
|
||||
<td>
|
||||
<a href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-search" id="searchBtn">查询</a>
|
||||
<a href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-redo" id="searchResetBtn">重置</a>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<!-- 数据显示table -->
|
||||
<div id = "tablePanel" class="easyui-panel" style="padding:1px;top:300px;" title="经手人列表" iconCls="icon-list" collapsible="true" closable="false">
|
||||
<table id="tableData" style="top:300px;border-bottom-color:#FFFFFF"></table>
|
||||
</div>
|
||||
|
||||
<div id="personDlg" class="easyui-dialog" style="width:380px;padding:10px 20px"
|
||||
closed="true" buttons="#dlg-buttons" modal="true" cache="false" collapsible="false" closable="true">
|
||||
<form id="personFM" method="post" novalidate>
|
||||
<table>
|
||||
<tr>
|
||||
<td>类型</td>
|
||||
<td style="padding:5px">
|
||||
<select name="Type" id="Type" style="width:230px;">
|
||||
<option value="">请选择</option>
|
||||
<option value="仓管员">仓管员</option>
|
||||
<option value="财务员">财务员</option>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>姓名</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>
|
||||
</table>
|
||||
<input type="hidden" name="clientIp" id="clientIp" value="<%=clientIp %>"/>
|
||||
</form>
|
||||
</div>
|
||||
<div id="dlg-buttons">
|
||||
<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>
|
||||
</div>
|
||||
|
||||
<script type="text/javascript">
|
||||
var depotList = null;
|
||||
var depotID = null;
|
||||
//初始化界面
|
||||
$(function()
|
||||
{
|
||||
//初始化系统基础信息
|
||||
initSystemData();
|
||||
initSelectInfo();
|
||||
initTableData();
|
||||
ininPager();
|
||||
initForm();
|
||||
});
|
||||
|
||||
//初始化系统基础信息
|
||||
function initSystemData()
|
||||
{
|
||||
$.ajax({
|
||||
type:"post",
|
||||
url: "<%=path%>/depot/getBasicData.action",
|
||||
//设置为同步
|
||||
async:false,
|
||||
dataType: "json",
|
||||
success: function (systemInfo)
|
||||
{
|
||||
depotList = systemInfo.showModel.map.depotList;
|
||||
var msgTip = systemInfo.showModel.msgTip;
|
||||
if(msgTip == "exceptoin")
|
||||
{
|
||||
$.messager.alert('提示','查找系统基础信息异常,请与管理员联系!','error');
|
||||
return;
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
//初始化页面选项卡
|
||||
function initSelectInfo()
|
||||
{
|
||||
var options = "";
|
||||
|
||||
if(depotList !=null)
|
||||
{
|
||||
options = "";
|
||||
for(var i = 0 ;i < depotList.length;i ++)
|
||||
{
|
||||
var depot = depotList[i];
|
||||
if(0 == i)
|
||||
{
|
||||
depotID = depot.id;
|
||||
}
|
||||
options += '<option value="' + depot.id + '">' + depot.name + '</option>';
|
||||
}
|
||||
$("#ProjectId").empty().append(options);
|
||||
$("#searchProjectId").empty().append('<option value="">全部</option>').append(options);
|
||||
}
|
||||
}
|
||||
|
||||
//防止表单提交重复
|
||||
function initForm()
|
||||
{
|
||||
$('#personFM').form({
|
||||
onSubmit: function(){
|
||||
return false;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
//初始化表格数据
|
||||
function initTableData()
|
||||
{
|
||||
$('#tableData').datagrid({
|
||||
//title:'经手人列表',
|
||||
//iconCls:'icon-save',
|
||||
//width:700,
|
||||
height:heightInfo,
|
||||
nowrap: false,
|
||||
rownumbers: false,
|
||||
//动画效果
|
||||
animate:false,
|
||||
//选中单行
|
||||
singleSelect : true,
|
||||
collapsible:false,
|
||||
selectOnCheck:false,
|
||||
//fitColumns:true,
|
||||
//单击行是否选中
|
||||
//checkOnSelect : false,
|
||||
url:'<%=path %>/person/findBy.action?pageSize=' + initPageSize,
|
||||
pagination: true,
|
||||
//交替出现背景
|
||||
striped : true,
|
||||
//loadFilter: pagerFilter,
|
||||
pageSize: initPageSize,
|
||||
pageList: initPageNum,
|
||||
columns:[[
|
||||
{ field: 'Id',width:35,align:"center",checkbox:true},
|
||||
{ title: '姓名',field: 'Name',width:180},
|
||||
{ title: '类型',field: 'Type',width:180},
|
||||
{ title: '操作',field: 'op',align:"center",width:130,formatter:function(value,rec)
|
||||
{
|
||||
var str = '';
|
||||
var rowInfo = rec.Id + 'AaBb' + rec.Type+ 'AaBb' + rec.Name;
|
||||
if(1 == value)
|
||||
{
|
||||
str += '<img src="<%=path%>/js/easyui-1.3.5/themes/icons/pencil.png" style="cursor: pointer;" onclick="editPerson(\'' + rowInfo + '\');"/> <a onclick="editPerson(\'' + rowInfo + '\');" style="text-decoration:none;color:black;" href="javascript:void(0)">编辑</a> ';
|
||||
str += '<img src="<%=path%>/js/easyui-1.3.5/themes/icons/edit_remove.png" style="cursor: pointer;" onclick="deletePerson('+ rec.Id +');"/> <a onclick="deletePerson('+ rec.Id +');" style="text-decoration:none;color:black;" href="javascript:void(0)">删除</a> ';
|
||||
}
|
||||
return str;
|
||||
}
|
||||
}
|
||||
]],
|
||||
toolbar:[
|
||||
{
|
||||
id:'addPerson',
|
||||
text:'增加',
|
||||
iconCls:'icon-add',
|
||||
handler:function()
|
||||
{
|
||||
addPerson();
|
||||
}
|
||||
},
|
||||
{
|
||||
id:'deletePerson',
|
||||
text:'删除',
|
||||
iconCls:'icon-remove',
|
||||
handler:function()
|
||||
{
|
||||
batDeletePerson();
|
||||
}
|
||||
}
|
||||
],
|
||||
onLoadError:function()
|
||||
{
|
||||
$.messager.alert('页面加载提示','页面加载异常,请稍后再试!','error');
|
||||
return;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
//初始化键盘enter事件
|
||||
$(document).keydown(function(event)
|
||||
{
|
||||
//兼容 IE和firefox 事件
|
||||
var e = window.event || event;
|
||||
var k = e.keyCode||e.which||e.charCode;
|
||||
//兼容 IE,firefox 兼容
|
||||
var obj = e.srcElement ? e.srcElement : e.target;
|
||||
//绑定键盘事件为 id是指定的输入框才可以触发键盘事件 13键盘事件 ---遗留问题 enter键效验 对话框会关闭问题
|
||||
if(k == "13"&&(obj.id=="Type"||obj.id=="Name"))
|
||||
{
|
||||
$("#savePerson").click();
|
||||
}
|
||||
//搜索按钮添加快捷键
|
||||
if(k == "13"&&(obj.id=="searchType"))
|
||||
{
|
||||
$("#searchBtn").click();
|
||||
}
|
||||
});
|
||||
//分页信息处理
|
||||
function ininPager()
|
||||
{
|
||||
try
|
||||
{
|
||||
var opts = $("#tableData").datagrid('options');
|
||||
var pager = $("#tableData").datagrid('getPager');
|
||||
pager.pagination({
|
||||
onSelectPage:function(pageNum, pageSize)
|
||||
{
|
||||
opts.pageNumber = pageNum;
|
||||
opts.pageSize = pageSize;
|
||||
pager.pagination('refresh',
|
||||
{
|
||||
pageNumber:pageNum,
|
||||
pageSize:pageSize
|
||||
});
|
||||
showPersonDetails(pageNum,pageSize);
|
||||
}
|
||||
});
|
||||
}
|
||||
catch (e)
|
||||
{
|
||||
$.messager.alert('异常处理提示',"分页信息异常 : " + e.name + ": " + e.message,'error');
|
||||
}
|
||||
}
|
||||
|
||||
//删除经手人信息
|
||||
function deletePerson(personID)
|
||||
{
|
||||
$.messager.confirm('删除确认','确定要删除此经手人信息吗?',function(r)
|
||||
{
|
||||
if (r)
|
||||
{
|
||||
$.ajax({
|
||||
type:"post",
|
||||
url: "<%=path %>/person/delete.action",
|
||||
dataType: "json",
|
||||
data: ({
|
||||
personID : personID,
|
||||
clientIp:'<%=clientIp %>'
|
||||
}),
|
||||
success: function (tipInfo)
|
||||
{
|
||||
var msg = tipInfo.showModel.msgTip;
|
||||
if(msg == '成功')
|
||||
{
|
||||
//加载完以后重新初始化
|
||||
$("#searchBtn").click();
|
||||
}
|
||||
else
|
||||
$.messager.alert('删除提示','删除经手人信息失败,请稍后再试!','error');
|
||||
},
|
||||
//此处添加错误处理
|
||||
error:function()
|
||||
{
|
||||
$.messager.alert('删除提示','删除经手人信息异常,请稍后再试!','error');
|
||||
return;
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
//批量删除经手人
|
||||
function batDeletePerson()
|
||||
{
|
||||
var row = $('#tableData').datagrid('getChecked');
|
||||
if(row.length == 0)
|
||||
{
|
||||
$.messager.alert('删除提示','没有记录被选中!','info');
|
||||
return;
|
||||
}
|
||||
if(row.length > 0)
|
||||
{
|
||||
$.messager.confirm('删除确认','确定要删除选中的' + row.length + '条经手人信息吗?',function(r)
|
||||
{
|
||||
if (r)
|
||||
{
|
||||
var ids = "";
|
||||
for(var i = 0;i < row.length; i ++)
|
||||
{
|
||||
if(i == row.length-1)
|
||||
{
|
||||
ids += row[i].Id;
|
||||
break;
|
||||
}
|
||||
//alert(row[i].id);
|
||||
ids += row[i].Id + ",";
|
||||
}
|
||||
$.ajax({
|
||||
type:"post",
|
||||
url: "<%=path %>/person/batchDelete.action",
|
||||
dataType: "json",
|
||||
async : false,
|
||||
data: ({
|
||||
personIDs : ids,
|
||||
clientIp:'<%=clientIp %>'
|
||||
}),
|
||||
success: function (tipInfo)
|
||||
{
|
||||
var msg = tipInfo.showModel.msgTip;
|
||||
if(msg == '成功')
|
||||
{
|
||||
//加载完以后重新初始化
|
||||
$("#searchBtn").click();
|
||||
$(":checkbox").attr("checked",false);
|
||||
}
|
||||
else
|
||||
$.messager.alert('删除提示','删除经手人信息失败,请稍后再试!','error');
|
||||
},
|
||||
//此处添加错误处理
|
||||
error:function()
|
||||
{
|
||||
$.messager.alert('删除提示','删除经手人信息异常,请稍后再试!','error');
|
||||
return;
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
//增加
|
||||
var url;
|
||||
var personID = 0;
|
||||
//保存编辑前的名称
|
||||
var orgPerson = "";
|
||||
|
||||
function addPerson()
|
||||
{
|
||||
$("#clientIp").val('<%=clientIp %>');
|
||||
$('#personFM').form('clear');
|
||||
$('#personDlg').dialog('open').dialog('setTitle','<img src="<%=path%>/js/easyui-1.3.5/themes/icons/edit_add.png"/> 增加经手人信息');
|
||||
$(".window-mask").css({ width: webW ,height: webH});
|
||||
$("#name").val("").focus();
|
||||
|
||||
orgPerson = "";
|
||||
personID = 0;
|
||||
url = '<%=path %>/person/create.action';
|
||||
}
|
||||
|
||||
//保存信息
|
||||
$("#savePerson").unbind().bind({
|
||||
click:function()
|
||||
{
|
||||
if(!$('#personFM').form('validate'))
|
||||
return;
|
||||
else
|
||||
{
|
||||
$.ajax({
|
||||
type:"post",
|
||||
url: url,
|
||||
dataType: "json",
|
||||
async : false,
|
||||
data: ({
|
||||
Type : $.trim($("#Type").val()),
|
||||
Name : $.trim($("#Name").val()),
|
||||
clientIp:'<%=clientIp %>'
|
||||
}),
|
||||
success: function (tipInfo)
|
||||
{
|
||||
if(tipInfo)
|
||||
{
|
||||
$('#personDlg').dialog('close');
|
||||
|
||||
var opts = $("#tableData").datagrid('options');
|
||||
showPersonDetails(opts.pageNumber,opts.pageSize);
|
||||
}
|
||||
else
|
||||
{
|
||||
$.messager.show({
|
||||
title: '错误提示',
|
||||
msg: '保存经手人信息失败,请稍后重试!'
|
||||
});
|
||||
}
|
||||
},
|
||||
//此处添加错误处理
|
||||
error:function()
|
||||
{
|
||||
$.messager.alert('提示','保存经手人信息异常,请稍后再试!','error');
|
||||
return;
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
//编辑信息
|
||||
function editPerson(personTotalInfo)
|
||||
{
|
||||
var personInfo = personTotalInfo.split("AaBb");
|
||||
|
||||
$("#clientIp").val('<%=clientIp %>');
|
||||
$("#Type").val(personInfo[1]);
|
||||
$("#Name").val(personInfo[2]);
|
||||
|
||||
//orgPerson = personInfo[1];
|
||||
$('#personDlg').dialog('open').dialog('setTitle','<img src="<%=path%>/js/easyui-1.3.5/themes/icons/pencil.png"/> 编辑经手人信息');
|
||||
$(".window-mask").css({ width: webW ,height: webH});
|
||||
personID = personInfo[0];
|
||||
//焦点在名称输入框==定焦在输入文字后面
|
||||
$("#Name").val("").focus().val(personInfo[2]);
|
||||
url = '<%=path %>/person/update.action?personID=' + personInfo[0];
|
||||
}
|
||||
|
||||
//搜索处理
|
||||
$("#searchBtn").unbind().bind({
|
||||
click:function()
|
||||
{
|
||||
showPersonDetails(1,initPageSize);
|
||||
var opts = $("#tableData").datagrid('options');
|
||||
var pager = $("#tableData").datagrid('getPager');
|
||||
opts.pageNumber = 1;
|
||||
opts.pageSize = initPageSize;
|
||||
pager.pagination('refresh',
|
||||
{
|
||||
pageNumber:1,
|
||||
pageSize:initPageSize
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
function showPersonDetails(pageNo,pageSize)
|
||||
{
|
||||
$.ajax({
|
||||
type:"post",
|
||||
url: "<%=path %>/person/findBy.action",
|
||||
dataType: "json",
|
||||
data: ({
|
||||
Name:$.trim($("#searchName").val()),
|
||||
Type:$.trim($("#searchType").val()),
|
||||
pageNo:pageNo,
|
||||
pageSize:pageSize
|
||||
}),
|
||||
success: function (data)
|
||||
{
|
||||
$("#tableData").datagrid('loadData',data);
|
||||
},
|
||||
//此处添加错误处理
|
||||
error:function()
|
||||
{
|
||||
$.messager.alert('查询提示','查询数据后台异常,请稍后再试!','error');
|
||||
return;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
//重置按钮
|
||||
$("#searchResetBtn").unbind().bind({
|
||||
click:function(){
|
||||
$("#searchProjectId").val("");
|
||||
$("#searchType").val("");
|
||||
|
||||
//加载完以后重新初始化
|
||||
$("#searchBtn").click();
|
||||
}
|
||||
});
|
||||
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
169
src/main/webapp/pages/materials/purchase_back_list.jsp
Normal file
169
src/main/webapp/pages/materials/purchase_back_list.jsp
Normal file
@@ -0,0 +1,169 @@
|
||||
<%@page import="com.jsh.util.Tools"%>
|
||||
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
|
||||
<%
|
||||
String path = request.getContextPath();
|
||||
String clientIp = Tools.getCurrentUserIP();
|
||||
%>
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>采购退货</title>
|
||||
<meta charset="utf-8">
|
||||
<!-- 指定以IE8的方式来渲染 -->
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE8"/>
|
||||
<link rel="shortcut icon" href="<%=path%>/images/favicon.ico" type="image/x-icon" />
|
||||
<link rel="stylesheet" type="text/css" href="<%=path %>/js/easyui-1.3.5/themes/default/easyui.css"/>
|
||||
<link rel="stylesheet" type="text/css" href="<%=path %>/js/easyui-1.3.5/themes/icon.css"/>
|
||||
<link type="text/css" rel="stylesheet" href="<%=path %>/css/common.css" />
|
||||
<script src="<%=path %>/js/jquery-1.8.0.min.js"></script>
|
||||
<script src="<%=path %>/js/easyui-1.3.5/jquery.easyui.min.js"></script>
|
||||
<script src="<%=path %>/js/easyui-1.3.5/locale/easyui-lang-zh_CN.js"></script>
|
||||
<script src="<%=path %>/js/My97DatePicker/WdatePicker.js"></script>
|
||||
<script src="<%=path %>/js/common/common.js"></script>
|
||||
<script src="<%=path %>/js/pages/materials/in_out.js"></script>
|
||||
<script>
|
||||
var kid = ${sessionScope.user.id};
|
||||
var path = "<%=path%>";
|
||||
var clientIp = "<%=clientIp%>";
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<!-- 查询 -->
|
||||
<div id = "searchPanel" class="easyui-panel" style="padding:3px;" title="查询窗口" iconCls="icon-search" collapsible="true" closable="false">
|
||||
<table id="searchTable">
|
||||
<tr>
|
||||
<td>发货仓库:</td>
|
||||
<td>
|
||||
<select name="searchProjectId" id="searchProjectId" style="width:80px;"></select>
|
||||
</td>
|
||||
<td>单据编号:</td>
|
||||
<td>
|
||||
<input type="text" name="searchNumber" id="searchNumber" style="width:60px;"/>
|
||||
</td>
|
||||
<td>单据日期:</td>
|
||||
<td>
|
||||
<input type="text" name="searchBeginTime" id="searchBeginTime" onClick="WdatePicker({dateFmt:'yyyy-MM-dd'})" class="txt Wdate" style="width:80px;"/>
|
||||
</td>
|
||||
<td>-</td>
|
||||
<td>
|
||||
<input type="text" name="searchEndTime" id="searchEndTime" onClick="WdatePicker({dateFmt:'yyyy-MM-dd'})" class="txt Wdate" style="width:80px;"/>
|
||||
</td>
|
||||
<td> </td>
|
||||
<td>
|
||||
<a href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-search" id="searchBtn">查询</a>
|
||||
<a href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-redo" id="searchResetBtn">重置</a>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<!-- 数据显示table -->
|
||||
<div id="tablePanel" class="easyui-panel" style="padding:1px; top:300px;" title="采购退货列表" iconCls="icon-list" collapsible="true" closable="false">
|
||||
<table id="tableData" style="top:300px;border-bottom-color:#FFFFFF"></table>
|
||||
</div>
|
||||
|
||||
<div id="depotHeadDlg" class="easyui-dialog" style="width:850px;padding:10px 20px;top:20px"
|
||||
closed="true" buttons="#dlg-buttons" modal="true" cache="false" collapsible="false" closable="true">
|
||||
<form id="depotHeadFM" method="post" novalidate>
|
||||
<table>
|
||||
<tr>
|
||||
<td>发货仓库:</td>
|
||||
<td style="padding:5px">
|
||||
<select name="ProjectId" id="ProjectId" style="width:110px;"></select>
|
||||
</td>
|
||||
<td>单据日期:</td>
|
||||
<td style="padding:5px">
|
||||
<input type="text" name="OperTime" id="OperTime" onClick="WdatePicker({dateFmt:'yyyy-MM-dd'})" class="txt Wdate" style="width:110px;"/>
|
||||
</td>
|
||||
<td>收货单位:</td>
|
||||
<td style="padding:5px">
|
||||
<input id="OrganId" name="OrganId" style="width:110px;" />
|
||||
</td>
|
||||
<td>经手人:</td>
|
||||
<td style="padding:5px">
|
||||
<select name="HandsPersonId" id="HandsPersonId" style="width:110px;"></select>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>收款账户:</td>
|
||||
<td style="padding:5px">
|
||||
<select name="AccountId" id="AccountId" style="width:110px;"></select>
|
||||
</td>
|
||||
<td>收款金额:</td>
|
||||
<td style="padding:5px">
|
||||
<input id="ChangeAmount" name="ChangeAmount" data-changeamount="0" style="width:110px;" />
|
||||
</td>
|
||||
<td>单据编号:</td>
|
||||
<td style="padding:5px">
|
||||
<input name="Number" id="Number" class="easyui-validatebox" data-options="required:true,validType:'length[2,30]'" style="width: 110px;"/>
|
||||
</td>
|
||||
<td>单据备注:</td>
|
||||
<td style="padding:5px">
|
||||
<input name="Remark" id="Remark" class="easyui-validatebox" style="width: 110px;"/>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>商品列表:</td>
|
||||
<td colspan="7">
|
||||
<!-- 商品列表table -->
|
||||
<table id="materialData" style="top:100px;border-bottom-color:#FFFFFF"></table>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<input type="hidden" name="clientIp" id="clientIp" value="<%=clientIp %>"/>
|
||||
</form>
|
||||
</div>
|
||||
<div id="dlg-buttons">
|
||||
<a href="javascript:void(0)" id="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>
|
||||
</div>
|
||||
<div id="depotHeadDlgShow" class="easyui-dialog" style="width:850px;padding:10px 20px;top:20px"
|
||||
closed="true" modal="true" cache="false" collapsible="false" closable="true">
|
||||
<table>
|
||||
<tr>
|
||||
<td>发货仓库:</td>
|
||||
<td style="padding:5px;width:110px;">
|
||||
<span id="ProjectIdShow"></span>
|
||||
</td>
|
||||
<td>单据日期:</td>
|
||||
<td style="padding:5px;width:110px;">
|
||||
<span id="OperTimeShow"></span>
|
||||
</td>
|
||||
<td>收货单位:</td>
|
||||
<td style="padding:5px;width:110px;">
|
||||
<span id="OrganIdShow"></span>
|
||||
</td>
|
||||
<td>经手人:</td>
|
||||
<td style="padding:5px;width:110px;">
|
||||
<span id="HandsPersonIdShow"></span>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>收款账户:</td>
|
||||
<td style="padding:5px">
|
||||
<span id="AccountIdShow"></span>
|
||||
</td>
|
||||
<td>收款金额:</td>
|
||||
<td style="padding:5px">
|
||||
<span id="ChangeAmountShow"></span>
|
||||
</td>
|
||||
<td>单据编号:</td>
|
||||
<td style="padding:5px">
|
||||
<span id="NumberShow"></span>
|
||||
</td>
|
||||
<td>单据备注:</td>
|
||||
<td style="padding:5px">
|
||||
<span id="RemarkShow"></span>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>商品列表:</td>
|
||||
<td colspan="7">
|
||||
<!-- 商品列表table -->
|
||||
<table id="materialDataShow" style="top:100px;border-bottom-color:#FFFFFF"></table>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
169
src/main/webapp/pages/materials/purchase_in_list.jsp
Normal file
169
src/main/webapp/pages/materials/purchase_in_list.jsp
Normal file
@@ -0,0 +1,169 @@
|
||||
<%@page import="com.jsh.util.Tools"%>
|
||||
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
|
||||
<%
|
||||
String path = request.getContextPath();
|
||||
String clientIp = Tools.getCurrentUserIP();
|
||||
%>
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>采购入库</title>
|
||||
<meta charset="utf-8">
|
||||
<!-- 指定以IE8的方式来渲染 -->
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE8"/>
|
||||
<link rel="shortcut icon" href="<%=path%>/images/favicon.ico" type="image/x-icon" />
|
||||
<link rel="stylesheet" type="text/css" href="<%=path %>/js/easyui-1.3.5/themes/default/easyui.css"/>
|
||||
<link rel="stylesheet" type="text/css" href="<%=path %>/js/easyui-1.3.5/themes/icon.css"/>
|
||||
<link type="text/css" rel="stylesheet" href="<%=path %>/css/common.css" />
|
||||
<script src="<%=path %>/js/jquery-1.8.0.min.js"></script>
|
||||
<script src="<%=path %>/js/easyui-1.3.5/jquery.easyui.min.js"></script>
|
||||
<script src="<%=path %>/js/easyui-1.3.5/locale/easyui-lang-zh_CN.js"></script>
|
||||
<script src="<%=path %>/js/My97DatePicker/WdatePicker.js"></script>
|
||||
<script src="<%=path %>/js/common/common.js"></script>
|
||||
<script src="<%=path %>/js/pages/materials/in_out.js"></script>
|
||||
<script>
|
||||
var kid = ${sessionScope.user.id};
|
||||
var path = "<%=path%>";
|
||||
var clientIp = "<%=clientIp%>";
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<!-- 查询 -->
|
||||
<div id = "searchPanel" class="easyui-panel" style="padding:3px;" title="查询窗口" iconCls="icon-search" collapsible="true" closable="false">
|
||||
<table id="searchTable">
|
||||
<tr>
|
||||
<td>收货仓库:</td>
|
||||
<td>
|
||||
<select name="searchProjectId" id="searchProjectId" style="width:80px;"></select>
|
||||
</td>
|
||||
<td>单据编号:</td>
|
||||
<td>
|
||||
<input type="text" name="searchNumber" id="searchNumber" style="width:60px;"/>
|
||||
</td>
|
||||
<td>单据日期:</td>
|
||||
<td>
|
||||
<input type="text" name="searchBeginTime" id="searchBeginTime" onClick="WdatePicker({dateFmt:'yyyy-MM-dd'})" class="txt Wdate" style="width:80px;"/>
|
||||
</td>
|
||||
<td>-</td>
|
||||
<td>
|
||||
<input type="text" name="searchEndTime" id="searchEndTime" onClick="WdatePicker({dateFmt:'yyyy-MM-dd'})" class="txt Wdate" style="width:80px;"/>
|
||||
</td>
|
||||
<td> </td>
|
||||
<td>
|
||||
<a href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-search" id="searchBtn">查询</a>
|
||||
<a href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-redo" id="searchResetBtn">重置</a>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<!-- 数据显示table -->
|
||||
<div id="tablePanel" class="easyui-panel" style="padding:1px; top:300px;" title="采购入库列表" iconCls="icon-list" collapsible="true" closable="false">
|
||||
<table id="tableData" style="top:300px;border-bottom-color:#FFFFFF"></table>
|
||||
</div>
|
||||
|
||||
<div id="depotHeadDlg" class="easyui-dialog" style="width:850px;padding:10px 20px;top:20px"
|
||||
closed="true" buttons="#dlg-buttons" modal="true" cache="false" collapsible="false" closable="true">
|
||||
<form id="depotHeadFM" method="post" novalidate>
|
||||
<table>
|
||||
<tr>
|
||||
<td>收货仓库:</td>
|
||||
<td style="padding:5px">
|
||||
<select name="ProjectId" id="ProjectId" style="width:110px;"></select>
|
||||
</td>
|
||||
<td>单据日期:</td>
|
||||
<td style="padding:5px">
|
||||
<input type="text" name="OperTime" id="OperTime" onClick="WdatePicker({dateFmt:'yyyy-MM-dd'})" class="txt Wdate" style="width:110px;"/>
|
||||
</td>
|
||||
<td>供货单位:</td>
|
||||
<td style="padding:5px">
|
||||
<input id="OrganId" name="OrganId" style="width:110px;" />
|
||||
</td>
|
||||
<td>经手人:</td>
|
||||
<td style="padding:5px">
|
||||
<select name="HandsPersonId" id="HandsPersonId" style="width:110px;"></select>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>付款账户:</td>
|
||||
<td style="padding:5px">
|
||||
<select name="AccountId" id="AccountId" style="width:110px;"></select>
|
||||
</td>
|
||||
<td>付款金额:</td>
|
||||
<td style="padding:5px">
|
||||
<input id="ChangeAmount" name="ChangeAmount" data-changeamount="0" style="width:110px;" />
|
||||
</td>
|
||||
<td>单据编号:</td>
|
||||
<td style="padding:5px">
|
||||
<input name="Number" id="Number" class="easyui-validatebox" data-options="required:true,validType:'length[2,30]'" style="width: 110px;"/>
|
||||
</td>
|
||||
<td>单据备注:</td>
|
||||
<td style="padding:5px">
|
||||
<input name="Remark" id="Remark" class="easyui-validatebox" style="width: 110px;"/>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>商品列表:</td>
|
||||
<td colspan="7">
|
||||
<!-- 商品列表table -->
|
||||
<table id="materialData" style="top:100px;border-bottom-color:#FFFFFF"></table>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<input type="hidden" name="clientIp" id="clientIp" value="<%=clientIp %>"/>
|
||||
</form>
|
||||
</div>
|
||||
<div id="dlg-buttons">
|
||||
<a href="javascript:void(0)" id="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>
|
||||
</div>
|
||||
<div id="depotHeadDlgShow" class="easyui-dialog" style="width:850px;padding:10px 20px;top:20px"
|
||||
closed="true" modal="true" cache="false" collapsible="false" closable="true">
|
||||
<table>
|
||||
<tr>
|
||||
<td>收货仓库:</td>
|
||||
<td style="padding:5px;width:110px;">
|
||||
<span id="ProjectIdShow"></span>
|
||||
</td>
|
||||
<td>单据日期:</td>
|
||||
<td style="padding:5px;width:110px;">
|
||||
<span id="OperTimeShow"></span>
|
||||
</td>
|
||||
<td>供货单位:</td>
|
||||
<td style="padding:5px;width:110px;">
|
||||
<span id="OrganIdShow"></span>
|
||||
</td>
|
||||
<td>经手人:</td>
|
||||
<td style="padding:5px;width:110px;">
|
||||
<span id="HandsPersonIdShow"></span>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>付款账户:</td>
|
||||
<td style="padding:5px">
|
||||
<span id="AccountIdShow"></span>
|
||||
</td>
|
||||
<td>付款金额:</td>
|
||||
<td style="padding:5px">
|
||||
<span id="ChangeAmountShow"></span>
|
||||
</td>
|
||||
<td>单据编号:</td>
|
||||
<td style="padding:5px">
|
||||
<span id="NumberShow"></span>
|
||||
</td>
|
||||
<td>单据备注:</td>
|
||||
<td style="padding:5px">
|
||||
<span id="RemarkShow"></span>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>商品列表:</td>
|
||||
<td colspan="7">
|
||||
<!-- 商品列表table -->
|
||||
<table id="materialDataShow" style="top:100px;border-bottom-color:#FFFFFF"></table>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
169
src/main/webapp/pages/materials/sale_back_list.jsp
Normal file
169
src/main/webapp/pages/materials/sale_back_list.jsp
Normal file
@@ -0,0 +1,169 @@
|
||||
<%@page import="com.jsh.util.Tools"%>
|
||||
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
|
||||
<%
|
||||
String path = request.getContextPath();
|
||||
String clientIp = Tools.getCurrentUserIP();
|
||||
%>
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>销售退货</title>
|
||||
<meta charset="utf-8">
|
||||
<!-- 指定以IE8的方式来渲染 -->
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE8"/>
|
||||
<link rel="shortcut icon" href="<%=path%>/images/favicon.ico" type="image/x-icon" />
|
||||
<link rel="stylesheet" type="text/css" href="<%=path %>/js/easyui-1.3.5/themes/default/easyui.css"/>
|
||||
<link rel="stylesheet" type="text/css" href="<%=path %>/js/easyui-1.3.5/themes/icon.css"/>
|
||||
<link type="text/css" rel="stylesheet" href="<%=path %>/css/common.css" />
|
||||
<script src="<%=path %>/js/jquery-1.8.0.min.js"></script>
|
||||
<script src="<%=path %>/js/easyui-1.3.5/jquery.easyui.min.js"></script>
|
||||
<script src="<%=path %>/js/easyui-1.3.5/locale/easyui-lang-zh_CN.js"></script>
|
||||
<script src="<%=path %>/js/My97DatePicker/WdatePicker.js"></script>
|
||||
<script src="<%=path %>/js/common/common.js"></script>
|
||||
<script src="<%=path %>/js/pages/materials/in_out.js"></script>
|
||||
<script>
|
||||
var kid = ${sessionScope.user.id};
|
||||
var path = "<%=path%>";
|
||||
var clientIp = "<%=clientIp%>";
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<!-- 查询 -->
|
||||
<div id = "searchPanel" class="easyui-panel" style="padding:3px;" title="查询窗口" iconCls="icon-search" collapsible="true" closable="false">
|
||||
<table id="searchTable">
|
||||
<tr>
|
||||
<td>收货仓库:</td>
|
||||
<td>
|
||||
<select name="searchProjectId" id="searchProjectId" style="width:80px;"></select>
|
||||
</td>
|
||||
<td>单据编号:</td>
|
||||
<td>
|
||||
<input type="text" name="searchNumber" id="searchNumber" style="width:60px;"/>
|
||||
</td>
|
||||
<td>单据日期:</td>
|
||||
<td>
|
||||
<input type="text" name="searchBeginTime" id="searchBeginTime" onClick="WdatePicker({dateFmt:'yyyy-MM-dd'})" class="txt Wdate" style="width:80px;"/>
|
||||
</td>
|
||||
<td>-</td>
|
||||
<td>
|
||||
<input type="text" name="searchEndTime" id="searchEndTime" onClick="WdatePicker({dateFmt:'yyyy-MM-dd'})" class="txt Wdate" style="width:80px;"/>
|
||||
</td>
|
||||
<td> </td>
|
||||
<td>
|
||||
<a href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-search" id="searchBtn">查询</a>
|
||||
<a href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-redo" id="searchResetBtn">重置</a>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<!-- 数据显示table -->
|
||||
<div id="tablePanel" class="easyui-panel" style="padding:1px; top:300px;" title="销售退货列表" iconCls="icon-list" collapsible="true" closable="false">
|
||||
<table id="tableData" style="top:300px;border-bottom-color:#FFFFFF"></table>
|
||||
</div>
|
||||
|
||||
<div id="depotHeadDlg" class="easyui-dialog" style="width:850px;padding:10px 20px;top:20px"
|
||||
closed="true" buttons="#dlg-buttons" modal="true" cache="false" collapsible="false" closable="true">
|
||||
<form id="depotHeadFM" method="post" novalidate>
|
||||
<table>
|
||||
<tr>
|
||||
<td>收货仓库:</td>
|
||||
<td style="padding:5px">
|
||||
<select name="ProjectId" id="ProjectId" style="width:110px;"></select>
|
||||
</td>
|
||||
<td>单据日期:</td>
|
||||
<td style="padding:5px">
|
||||
<input type="text" name="OperTime" id="OperTime" onClick="WdatePicker({dateFmt:'yyyy-MM-dd'})" class="txt Wdate" style="width:110px;"/>
|
||||
</td>
|
||||
<td>退货单位:</td>
|
||||
<td style="padding:5px">
|
||||
<input id="OrganId" name="OrganId" style="width:110px;" />
|
||||
</td>
|
||||
<td>经手人:</td>
|
||||
<td style="padding:5px">
|
||||
<select name="HandsPersonId" id="HandsPersonId" style="width:110px;"></select>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>付款账户:</td>
|
||||
<td style="padding:5px">
|
||||
<select name="AccountId" id="AccountId" style="width:110px;"></select>
|
||||
</td>
|
||||
<td>付款金额:</td>
|
||||
<td style="padding:5px">
|
||||
<input id="ChangeAmount" name="ChangeAmount" data-changeamount="0" style="width:110px;" />
|
||||
</td>
|
||||
<td>单据编号:</td>
|
||||
<td style="padding:5px">
|
||||
<input name="Number" id="Number" class="easyui-validatebox" data-options="required:true,validType:'length[2,30]'" style="width: 110px;"/>
|
||||
</td>
|
||||
<td>单据备注:</td>
|
||||
<td style="padding:5px">
|
||||
<input name="Remark" id="Remark" class="easyui-validatebox" style="width: 110px;"/>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>商品列表:</td>
|
||||
<td colspan="7">
|
||||
<!-- 商品列表table -->
|
||||
<table id="materialData" style="top:100px;border-bottom-color:#FFFFFF"></table>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<input type="hidden" name="clientIp" id="clientIp" value="<%=clientIp %>"/>
|
||||
</form>
|
||||
</div>
|
||||
<div id="dlg-buttons">
|
||||
<a href="javascript:void(0)" id="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>
|
||||
</div>
|
||||
<div id="depotHeadDlgShow" class="easyui-dialog" style="width:850px;padding:10px 20px;top:20px"
|
||||
closed="true" modal="true" cache="false" collapsible="false" closable="true">
|
||||
<table>
|
||||
<tr>
|
||||
<td>收货仓库:</td>
|
||||
<td style="padding:5px;width:110px;">
|
||||
<span id="ProjectIdShow"></span>
|
||||
</td>
|
||||
<td>单据日期:</td>
|
||||
<td style="padding:5px;width:110px;">
|
||||
<span id="OperTimeShow"></span>
|
||||
</td>
|
||||
<td>退货单位:</td>
|
||||
<td style="padding:5px;width:110px;">
|
||||
<span id="OrganIdShow"></span>
|
||||
</td>
|
||||
<td>经手人:</td>
|
||||
<td style="padding:5px;width:110px;">
|
||||
<span id="HandsPersonIdShow"></span>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>付款账户:</td>
|
||||
<td style="padding:5px;width:110px;">
|
||||
<span id="AccountIdShow"></span>
|
||||
</td>
|
||||
<td>付款金额:</td>
|
||||
<td style="padding:5px;width:110px;">
|
||||
<span id="ChangeAmountShow"></span>
|
||||
</td>
|
||||
<td>单据编号:</td>
|
||||
<td style="padding:5px;width:110px;">
|
||||
<span id="NumberShow"></span>
|
||||
</td>
|
||||
<td>单据备注:</td>
|
||||
<td style="padding:5px;width:110px;">
|
||||
<span id="RemarkShow"></span>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>商品列表:</td>
|
||||
<td colspan="7">
|
||||
<!-- 商品列表table -->
|
||||
<table id="materialDataShow" style="top:100px;border-bottom-color:#FFFFFF"></table>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
168
src/main/webapp/pages/materials/sale_out_list.jsp
Normal file
168
src/main/webapp/pages/materials/sale_out_list.jsp
Normal file
@@ -0,0 +1,168 @@
|
||||
<%@page import="com.jsh.util.Tools"%>
|
||||
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
|
||||
<%
|
||||
String path = request.getContextPath();
|
||||
String clientIp = Tools.getCurrentUserIP();
|
||||
%>
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>销售出库</title>
|
||||
<meta charset="utf-8">
|
||||
<!-- 指定以IE8的方式来渲染 -->
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE8"/>
|
||||
<link rel="shortcut icon" href="<%=path%>/images/favicon.ico" type="image/x-icon" />
|
||||
<link rel="stylesheet" type="text/css" href="<%=path %>/js/easyui-1.3.5/themes/default/easyui.css"/>
|
||||
<link rel="stylesheet" type="text/css" href="<%=path %>/js/easyui-1.3.5/themes/icon.css"/>
|
||||
<link type="text/css" rel="stylesheet" href="<%=path %>/css/common.css" />
|
||||
<script src="<%=path %>/js/jquery-1.8.0.min.js"></script>
|
||||
<script src="<%=path %>/js/easyui-1.3.5/jquery.easyui.min.js"></script>
|
||||
<script src="<%=path %>/js/easyui-1.3.5/locale/easyui-lang-zh_CN.js"></script>
|
||||
<script src="<%=path %>/js/My97DatePicker/WdatePicker.js"></script>
|
||||
<script src="<%=path %>/js/common/common.js"></script>
|
||||
<script src="<%=path %>/js/pages/materials/in_out.js"></script>
|
||||
<script>
|
||||
var kid = ${sessionScope.user.id};
|
||||
var path = "<%=path%>";
|
||||
var clientIp = "<%=clientIp%>";
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<!-- 查询 -->
|
||||
<div id = "searchPanel" class="easyui-panel" style="padding:3px;" title="查询窗口" iconCls="icon-search" collapsible="true" closable="false">
|
||||
<table id="searchTable">
|
||||
<tr>
|
||||
<td>发货仓库:</td>
|
||||
<td>
|
||||
<select name="searchProjectId" id="searchProjectId" style="width:80px;"></select>
|
||||
</td>
|
||||
<td>单据编号:</td>
|
||||
<td>
|
||||
<input type="text" name="searchNumber" id="searchNumber" style="width:60px;"/>
|
||||
</td>
|
||||
<td>单据日期:</td>
|
||||
<td>
|
||||
<input type="text" name="searchBeginTime" id="searchBeginTime" onClick="WdatePicker({dateFmt:'yyyy-MM-dd'})" class="txt Wdate" style="width:80px;"/>
|
||||
</td>
|
||||
<td>-</td>
|
||||
<td>
|
||||
<input type="text" name="searchEndTime" id="searchEndTime" onClick="WdatePicker({dateFmt:'yyyy-MM-dd'})" class="txt Wdate" style="width:80px;"/>
|
||||
</td>
|
||||
<td> </td>
|
||||
<td>
|
||||
<a href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-search" id="searchBtn">查询</a>
|
||||
<a href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-redo" id="searchResetBtn">重置</a>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<!-- 数据显示table -->
|
||||
<div id="tablePanel" class="easyui-panel" style="padding:1px; top:300px;" title="销售出库列表" iconCls="icon-list" collapsible="true" closable="false">
|
||||
<table id="tableData" style="top:300px;border-bottom-color:#FFFFFF"></table>
|
||||
</div>
|
||||
|
||||
<div id="depotHeadDlg" class="easyui-dialog" style="width:850px;padding:10px 20px;top:20px"
|
||||
closed="true" buttons="#dlg-buttons" modal="true" cache="false" collapsible="false" closable="true">
|
||||
<form id="depotHeadFM" method="post" novalidate>
|
||||
<table>
|
||||
<tr>
|
||||
<td>发货仓库:</td>
|
||||
<td style="padding:5px">
|
||||
<select name="ProjectId" id="ProjectId" style="width:110px;"></select>
|
||||
</td>
|
||||
<td>单据日期:</td>
|
||||
<td style="padding:5px">
|
||||
<input type="text" name="OperTime" id="OperTime" onClick="WdatePicker({dateFmt:'yyyy-MM-dd'})" class="txt Wdate" style="width:110px;"/>
|
||||
</td>
|
||||
<td>购买单位:</td>
|
||||
<td style="padding:5px">
|
||||
<input id="OrganId" name="OrganId" style="width:110px;" />
|
||||
</td>
|
||||
<td>经手人:</td>
|
||||
<td style="padding:5px">
|
||||
<select name="HandsPersonId" id="HandsPersonId" style="width:110px;"></select>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>收款账户:</td>
|
||||
<td style="padding:5px">
|
||||
<select name="AccountId" id="AccountId" style="width:110px;"></select>
|
||||
</td>
|
||||
<td>收款金额:</td>
|
||||
<td style="padding:5px">
|
||||
<input id="ChangeAmount" name="ChangeAmount" data-changeamount="0" style="width:110px;" />
|
||||
</td>
|
||||
<td>单据编号:</td>
|
||||
<td style="padding:5px"><input name="Number" id="Number" class="easyui-validatebox" data-options="required:true,validType:'length[2,30]'" style="width: 110px;"/>
|
||||
</td>
|
||||
<td>单据备注:</td>
|
||||
<td style="padding:5px">
|
||||
<input name="Remark" id="Remark" class="easyui-validatebox" style="width: 110px;"/>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>商品列表:</td>
|
||||
<td colspan="7">
|
||||
<!-- 商品列表table -->
|
||||
<table id="materialData" style="top:100px;border-bottom-color:#FFFFFF"></table>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<input type="hidden" name="clientIp" id="clientIp" value="<%=clientIp %>"/>
|
||||
</form>
|
||||
</div>
|
||||
<div id="dlg-buttons">
|
||||
<a href="javascript:void(0)" id="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>
|
||||
</div>
|
||||
<div id="depotHeadDlgShow" class="easyui-dialog" style="width:850px;padding:10px 20px;top:20px"
|
||||
closed="true" modal="true" cache="false" collapsible="false" closable="true">
|
||||
<table>
|
||||
<tr>
|
||||
<td>发货仓库:</td>
|
||||
<td style="padding:5px;width:110px;">
|
||||
<span id="ProjectIdShow"></span>
|
||||
</td>
|
||||
<td>单据日期:</td>
|
||||
<td style="padding:5px;width:110px;">
|
||||
<span id="OperTimeShow"></span>
|
||||
</td>
|
||||
<td>购买单位:</td>
|
||||
<td style="padding:5px;width:110px;">
|
||||
<span id="OrganIdShow"></span>
|
||||
</td>
|
||||
<td>经手人:</td>
|
||||
<td style="padding:5px;width:110px;">
|
||||
<span id="HandsPersonIdShow"></span>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>收款账户:</td>
|
||||
<td style="padding:5px">
|
||||
<span id="AccountIdShow"></span>
|
||||
</td>
|
||||
<td>收款金额:</td>
|
||||
<td style="padding:5px">
|
||||
<span id="ChangeAmountShow"></span>
|
||||
</td>
|
||||
<td>单据编号:</td>
|
||||
<td style="padding:5px">
|
||||
<span id="NumberShow"></span>
|
||||
</td>
|
||||
<td>单据备注:</td>
|
||||
<td style="padding:5px">
|
||||
<span id="RemarkShow"></span>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>商品列表:</td>
|
||||
<td colspan="7">
|
||||
<!-- 商品列表table -->
|
||||
<table id="materialDataShow" style="top:100px;border-bottom-color:#FFFFFF"></table>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
138
src/main/webapp/pages/other/clock.jsp
Normal file
138
src/main/webapp/pages/other/clock.jsp
Normal file
@@ -0,0 +1,138 @@
|
||||
<%@page import="com.jsh.util.Tools"%>
|
||||
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
|
||||
<%
|
||||
String path = request.getContextPath();
|
||||
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
|
||||
String clientIp = Tools.getCurrentUserIP();
|
||||
%>
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head>
|
||||
<title>资产管理</title>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
<!-- 指定以IE8的方式来渲染 -->
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE8"/>
|
||||
<link rel="shortcut icon" href="<%=path%>/images/favicon.ico" type="image/x-icon" />
|
||||
<link rel="stylesheet" type="text/css" href="<%=path %>/js/jdigiclock/css/jquery.jdigiclock.css" />
|
||||
<script type="text/javascript" src="<%=path %>/js/jquery-1.8.0.min.js"></script>
|
||||
<script type="text/javascript" src="<%=path %>/js/jdigiclock/lib/jquery.jdigiclock.js"></script>
|
||||
<!-- 图片上次预览js开始 -->
|
||||
<link rel="stylesheet" type="text/css" href="<%=path %>/js/imgpreview/imgup.css"/>
|
||||
<script type="text/javascript" src="<%=path %>/js/imgpreview/imagepreview.js"></script>
|
||||
<script type="text/javascript" src="<%=path %>/js/imgpreview/jquery.crop.js"></script>
|
||||
<!-- 图片上次预览js结束 -->
|
||||
|
||||
<style type="text/css">
|
||||
::-moz-focus-inner{
|
||||
padding: 0;
|
||||
border: 0;
|
||||
}
|
||||
.ui_button,
|
||||
.ui_fileup {
|
||||
vertical-align: middle;
|
||||
border: 1px solid #ccc;
|
||||
display: inline-block;
|
||||
padding: 5px 10px;
|
||||
background: #FFF;
|
||||
font-size: 12px;
|
||||
*overflow: visible;
|
||||
*display: inline;
|
||||
*zoom: 1;
|
||||
}
|
||||
.ui_fileup {
|
||||
position: relative;
|
||||
overflow: hidden;
|
||||
}
|
||||
.ui_fileup input {
|
||||
filter: alpha(opacity=1);
|
||||
position: absolute;
|
||||
background: #fff;
|
||||
font-size: 60px;
|
||||
cursor: default;
|
||||
width: auto;
|
||||
opacity: 0;
|
||||
z-index: 1;
|
||||
left: auto;
|
||||
right: 0;
|
||||
top: 0;
|
||||
}
|
||||
|
||||
.avataria .cont {
|
||||
text-align: center;
|
||||
min-height: 1%;
|
||||
margin: 25px;
|
||||
width: 302px;
|
||||
_zoom: 1;
|
||||
}
|
||||
.avataria form {
|
||||
text-align: left;
|
||||
overflow: hidden;
|
||||
}
|
||||
.avataria .cont:after {
|
||||
content: "";
|
||||
display: block;
|
||||
overflow: hidden;
|
||||
height: 0;
|
||||
clear: both;
|
||||
}
|
||||
.thumb {
|
||||
float: right;
|
||||
height: 120px;
|
||||
width: 120px;
|
||||
}
|
||||
.cropaera {
|
||||
clear: both;
|
||||
}
|
||||
.preview {
|
||||
height: 300px;
|
||||
width: 300px;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<!-- <div class="avataria" title="头像上传前预览">
|
||||
<div class="cont">
|
||||
<div class="thumb"></div>
|
||||
<form enctype="application/x-www-form-urlencoded">
|
||||
<div class="ui_fileup"><input type="file" id="file" accept="image/*" onerror="alert('请选择一个图片')">浏览</div>
|
||||
|
||||
<input type="submit" class="ui_button" value="保存">
|
||||
<input name="crop" type="hidden">
|
||||
</form>
|
||||
</div>
|
||||
<div class="cont">
|
||||
<div id="preview" class="preview"></div>
|
||||
</div>
|
||||
</div> -->
|
||||
<div id="digiclock"></div>
|
||||
<script type="text/javascript">
|
||||
//初始化界面
|
||||
$(function()
|
||||
{
|
||||
initColck();
|
||||
|
||||
//imagepreview(document.getElementById("file"), document.getElementById("preview"), function(info){
|
||||
//alert("文件名:" + info.name + "\r\n图片原始高度:" + info.height + "\r\n图片原始宽度:" + info.width);
|
||||
//这里若return false则不预览图片
|
||||
|
||||
//$("#preview").css({
|
||||
//background: "none"
|
||||
//});
|
||||
|
||||
//$("#preview").crop( function(e){
|
||||
//$("input[type='hidden']").val([e.top, e.left, e.height, e.width].toString());
|
||||
//}, ".thumb");
|
||||
//});
|
||||
});
|
||||
//初始化钟
|
||||
function initColck()
|
||||
{
|
||||
$('#digiclock').jdigiclock({
|
||||
clockImagesPath:"<%=path%>/js/jdigiclock/images/clock/",
|
||||
weatherImagesPath:"<%=path%>/js/jdigiclock/images/weather/"
|
||||
});
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
41
src/main/webapp/pages/other/preview.jsp
Normal file
41
src/main/webapp/pages/other/preview.jsp
Normal file
@@ -0,0 +1,41 @@
|
||||
<%@page import="com.jsh.util.Tools"%>
|
||||
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
|
||||
<%
|
||||
String path = request.getContextPath();
|
||||
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
|
||||
String clientIp = Tools.getCurrentUserIP();
|
||||
%>
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head>
|
||||
<title>Simple Map</title>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
<meta name="viewport" content="initial-scale=1.0, user-scalable=no">
|
||||
<meta charset="utf-8">
|
||||
<style>
|
||||
html, body, #map-canvas {
|
||||
height: 100%;
|
||||
margin: 0px;
|
||||
padding: 0px
|
||||
}
|
||||
</style>
|
||||
<script src="https://maps.googleapis.com/maps/api/js?v=3.exp&sensor=false"></script>
|
||||
<script>
|
||||
var map;
|
||||
function initialize() {
|
||||
var mapOptions = {
|
||||
zoom: 8,
|
||||
center: new google.maps.LatLng(-34.397, 150.644)
|
||||
};
|
||||
map = new google.maps.Map(document.getElementById('map-canvas'),
|
||||
mapOptions);
|
||||
}
|
||||
|
||||
google.maps.event.addDomListener(window, 'load', initialize);
|
||||
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<div id="map-canvas"></div>
|
||||
</body>
|
||||
</html>
|
||||
0
src/main/webapp/pages/readme.txt
Normal file
0
src/main/webapp/pages/readme.txt
Normal file
185
src/main/webapp/pages/reports/account_report.jsp
Normal file
185
src/main/webapp/pages/reports/account_report.jsp
Normal file
@@ -0,0 +1,185 @@
|
||||
<%@page import="com.jsh.util.Tools"%>
|
||||
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
|
||||
<%
|
||||
String path = request.getContextPath();
|
||||
String clientIp = Tools.getCurrentUserIP();
|
||||
%>
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>结算账户查询</title>
|
||||
<meta charset="utf-8">
|
||||
<!-- 指定以IE8的方式来渲染 -->
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE8"/>
|
||||
<link rel="shortcut icon" href="<%=path%>/images/favicon.ico" type="image/x-icon" />
|
||||
<script type="text/javascript" src="<%=path %>/js/jquery-1.8.0.min.js"></script>
|
||||
<link rel="stylesheet" type="text/css" href="<%=path %>/js/easyui-1.3.5/themes/default/easyui.css"/>
|
||||
<link rel="stylesheet" type="text/css" href="<%=path %>/js/easyui-1.3.5/themes/icon.css"/>
|
||||
<link type="text/css" rel="stylesheet" href="<%=path %>/css/common.css" />
|
||||
<script type="text/javascript" src="<%=path %>/js/easyui-1.3.5/jquery.easyui.min.js"></script>
|
||||
<script type="text/javascript" src="<%=path %>/js/easyui-1.3.5/locale/easyui-lang-zh_CN.js"></script>
|
||||
<script type="text/javascript" src="<%=path %>/js/My97DatePicker/WdatePicker.js"></script>
|
||||
<script type="text/javascript" src="<%=path %>/js/common/common.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<!-- 查询 -->
|
||||
<div id = "searchPanel" class="easyui-panel" style="padding:10px;" title="查询窗口" iconCls="icon-search" collapsible="true" closable="false">
|
||||
<table id="searchTable">
|
||||
<tr>
|
||||
<td>名称:</td>
|
||||
<td>
|
||||
<input type="text" name="searchName" id="searchName" style="width:70px;"/>
|
||||
</td>
|
||||
<td> </td>
|
||||
<td> </td>
|
||||
<td>编号:</td>
|
||||
<td>
|
||||
<input type="text" name="searchSerialNo" id="searchSerialNo" style="width:70px;"/>
|
||||
</td>
|
||||
<td> </td>
|
||||
<td>
|
||||
<a href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-search" id="searchBtn">查询</a>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<!-- 数据显示table -->
|
||||
<div id = "tablePanel" class="easyui-panel" style="padding:1px;top:300px;" title="结算账户查询" iconCls="icon-list" collapsible="true" closable="false">
|
||||
<table id="tableData" style="top:300px;border-bottom-color:#FFFFFF"></table>
|
||||
</div>
|
||||
|
||||
<script type="text/javascript">
|
||||
//初始化界面
|
||||
$(function()
|
||||
{
|
||||
initTableData();
|
||||
ininPager();
|
||||
});
|
||||
|
||||
//初始化表格数据
|
||||
function initTableData(){
|
||||
$('#tableData').datagrid({
|
||||
//iconCls:'icon-save',
|
||||
//width:700,
|
||||
height:heightInfo,
|
||||
nowrap: false,
|
||||
rownumbers: true,
|
||||
//动画效果
|
||||
animate:false,
|
||||
//选中单行
|
||||
singleSelect : true,
|
||||
collapsible:false,
|
||||
selectOnCheck:false,
|
||||
//fitColumns:true,
|
||||
//单击行是否选中
|
||||
checkOnSelect : false,
|
||||
//交替出现背景
|
||||
striped : true,
|
||||
url:'<%=path %>/account/findBy.action?pageSize=' + initPageSize,
|
||||
pagination: true,
|
||||
//自动截取数据
|
||||
//nowrap : true,
|
||||
//loadFilter: pagerFilter,
|
||||
pageSize: initPageSize,
|
||||
pageList: initPageNum,
|
||||
columns:[[
|
||||
{ title: '名称',field: 'name',width:100},
|
||||
{ title: '编号', field: 'serialNo',width:100,align:"center"},
|
||||
{ title: '期初金额', field: 'initialAmount',width:100,align:"center"},
|
||||
{ title: '本月发生额', field: 'thisMonthAmount',width:100,align:"center"},
|
||||
{ title: '当前余额', field: 'currentAmount',width:100,align:"center"}
|
||||
]],
|
||||
onLoadError:function()
|
||||
{
|
||||
$.messager.alert('页面加载提示','页面加载异常,请稍后再试!','error');
|
||||
return;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
//初始化键盘enter事件
|
||||
$(document).keydown(function(event)
|
||||
{
|
||||
//兼容 IE和firefox 事件
|
||||
var e = window.event || event;
|
||||
var k = e.keyCode||e.which||e.charCode;
|
||||
//兼容 IE,firefox 兼容
|
||||
var obj = e.srcElement ? e.srcElement : e.target;
|
||||
//绑定键盘事件为 id是指定的输入框才可以触发键盘事件 13键盘事件 ---遗留问题 enter键效验 对话框会关闭问题
|
||||
//搜索按钮添加快捷键
|
||||
if(k == "13"&&(obj.id=="searchName"||obj.id=="searchSerialNo"))
|
||||
{
|
||||
$("#searchBtn").click();
|
||||
}
|
||||
});
|
||||
//分页信息处理
|
||||
function ininPager()
|
||||
{
|
||||
try
|
||||
{
|
||||
var opts = $("#tableData").datagrid('options');
|
||||
var pager = $("#tableData").datagrid('getPager');
|
||||
pager.pagination({
|
||||
onSelectPage:function(pageNum, pageSize)
|
||||
{
|
||||
opts.pageNumber = pageNum;
|
||||
opts.pageSize = pageSize;
|
||||
pager.pagination('refresh',
|
||||
{
|
||||
pageNumber:pageNum,
|
||||
pageSize:pageSize
|
||||
});
|
||||
showAccountDetails(pageNum,pageSize);
|
||||
}
|
||||
});
|
||||
}
|
||||
catch (e)
|
||||
{
|
||||
$.messager.alert('异常处理提示',"分页信息异常 : " + e.name + ": " + e.message,'error');
|
||||
}
|
||||
}
|
||||
//搜索处理
|
||||
$("#searchBtn").unbind().bind({
|
||||
click:function()
|
||||
{
|
||||
showAccountDetails(1,initPageSize);
|
||||
var opts = $("#tableData").datagrid('options');
|
||||
var pager = $("#tableData").datagrid('getPager');
|
||||
opts.pageNumber = 1;
|
||||
opts.pageSize = initPageSize;
|
||||
pager.pagination('refresh',
|
||||
{
|
||||
pageNumber:1,
|
||||
pageSize:initPageSize
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
function showAccountDetails(pageNo,pageSize)
|
||||
{
|
||||
$.ajax({
|
||||
type:"post",
|
||||
url: "<%=path %>/account/findBy.action",
|
||||
dataType: "json",
|
||||
data: ({
|
||||
name:$.trim($("#searchName").val()),
|
||||
serialNo:$.trim($("#searchSerialNo").val()),
|
||||
pageNo:pageNo,
|
||||
pageSize:pageSize
|
||||
}),
|
||||
success: function (data)
|
||||
{
|
||||
$("#tableData").datagrid('loadData',data);
|
||||
},
|
||||
//此处添加错误处理
|
||||
error:function()
|
||||
{
|
||||
$.messager.alert('查询提示','查询数据后台异常,请稍后再试!','error');
|
||||
return;
|
||||
}
|
||||
});
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
224
src/main/webapp/pages/reports/buy_in_report.jsp
Normal file
224
src/main/webapp/pages/reports/buy_in_report.jsp
Normal file
@@ -0,0 +1,224 @@
|
||||
<%@page import="com.jsh.util.Tools"%>
|
||||
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
|
||||
<%
|
||||
String path = request.getContextPath();
|
||||
String clientIp = Tools.getCurrentUserIP();
|
||||
%>
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>进货统计</title>
|
||||
<meta charset="utf-8">
|
||||
<!-- 指定以IE8的方式来渲染 -->
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE8"/>
|
||||
<link rel="shortcut icon" href="<%=path%>/images/favicon.ico" type="image/x-icon" />
|
||||
<script type="text/javascript" src="<%=path %>/js/jquery-1.8.0.min.js"></script>
|
||||
<link rel="stylesheet" type="text/css" href="<%=path %>/js/easyui-1.3.5/themes/default/easyui.css"/>
|
||||
<link rel="stylesheet" type="text/css" href="<%=path %>/js/easyui-1.3.5/themes/icon.css"/>
|
||||
<link type="text/css" rel="stylesheet" href="<%=path %>/css/common.css" />
|
||||
<script type="text/javascript" src="<%=path %>/js/easyui-1.3.5/jquery.easyui.min.js"></script>
|
||||
<script type="text/javascript" src="<%=path %>/js/easyui-1.3.5/locale/easyui-lang-zh_CN.js"></script>
|
||||
<script type="text/javascript" src="<%=path %>/js/My97DatePicker/WdatePicker.js"></script>
|
||||
<script type="text/javascript" src="<%=path %>/js/common/common.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<!-- 查询 -->
|
||||
<div id = "searchPanel" class="easyui-panel" style="padding:10px;" title="查询窗口" iconCls="icon-search" collapsible="true" closable="false">
|
||||
<table id="searchTable">
|
||||
<tr>
|
||||
<td>月份:</td>
|
||||
<td>
|
||||
<input type="text" name="searchMonth" id="searchMonth" onClick="WdatePicker({dateFmt:'yyyy-MM'})" class="txt Wdate" style="width:180px;"/>
|
||||
</td>
|
||||
<td> </td>
|
||||
<td> </td>
|
||||
<td>
|
||||
<a href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-search" id="searchBtn">查询</a>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<!-- 数据显示table -->
|
||||
<div id = "tablePanel" class="easyui-panel" style="padding:1px;top:300px;" title="进货统计列表" iconCls="icon-list" collapsible="true" closable="false">
|
||||
<table id="tableData" style="top:300px;border-bottom-color:#FFFFFF"></table>
|
||||
</div>
|
||||
|
||||
<script type="text/javascript">
|
||||
//初始化界面
|
||||
$(function()
|
||||
{
|
||||
initTableData();
|
||||
ininPager();
|
||||
});
|
||||
|
||||
//初始化表格数据
|
||||
function initTableData()
|
||||
{
|
||||
$('#tableData').datagrid({
|
||||
//title:'列表',
|
||||
//iconCls:'icon-save',
|
||||
//width:700,
|
||||
height:heightInfo,
|
||||
nowrap: false,
|
||||
rownumbers: true,
|
||||
//动画效果
|
||||
animate:false,
|
||||
//选中单行
|
||||
singleSelect : true,
|
||||
//url:'<%=path %>/depotItem/buyIn.action?pageSize=' + initPageSize,
|
||||
pagination: true,
|
||||
//交替出现背景
|
||||
striped : true,
|
||||
//loadFilter: pagerFilter,
|
||||
pageSize: 10,
|
||||
pageList: [10,50,100],
|
||||
columns:[[
|
||||
{ title: '名称',field: 'MaterialName',width:60},
|
||||
{ title: '款号',field: 'MaterialModel',width:80},
|
||||
{ title: '颜色',field: 'MaterialColor',width:80},
|
||||
{ title: '进货数量',field: 'InSum',width:60},
|
||||
{ title: '进货金额',field: 'InSumPrice',width:60},
|
||||
{ title: '退货数量',field: 'OutSum',width:60},
|
||||
{ title: '退货金额',field: 'OutSumPrice',width:60}
|
||||
]],
|
||||
onLoadError:function()
|
||||
{
|
||||
$.messager.alert('页面加载提示','页面加载异常,请稍后再试!','error');
|
||||
return;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
//初始化键盘enter事件
|
||||
$(document).keydown(function(event)
|
||||
{
|
||||
//兼容 IE和firefox 事件
|
||||
var e = window.event || event;
|
||||
var k = e.keyCode||e.which||e.charCode;
|
||||
//兼容 IE,firefox 兼容
|
||||
var obj = e.srcElement ? e.srcElement : e.target;
|
||||
//绑定键盘事件为 id是指定的输入框才可以触发键盘事件 13键盘事件 ---遗留问题 enter键效验 对话框会关闭问题
|
||||
//搜索按钮添加快捷键
|
||||
if(k == "13"&&(obj.id=="searchMonth"))
|
||||
{
|
||||
$("#searchBtn").click();
|
||||
}
|
||||
});
|
||||
//分页信息处理
|
||||
function ininPager()
|
||||
{
|
||||
try
|
||||
{
|
||||
var opts = $("#tableData").datagrid('options');
|
||||
var pager = $("#tableData").datagrid('getPager');
|
||||
pager.pagination({
|
||||
onSelectPage:function(pageNum, pageSize)
|
||||
{
|
||||
opts.pageNumber = pageNum;
|
||||
opts.pageSize = pageSize;
|
||||
pager.pagination('refresh',
|
||||
{
|
||||
pageNumber:pageNum,
|
||||
pageSize:pageSize
|
||||
});
|
||||
showDetails(pageNum,pageSize);
|
||||
}
|
||||
});
|
||||
}
|
||||
catch (e)
|
||||
{
|
||||
$.messager.alert('异常处理提示',"分页信息异常 : " + e.name + ": " + e.message,'error');
|
||||
}
|
||||
}
|
||||
|
||||
//搜索处理
|
||||
$("#searchBtn").unbind().bind({
|
||||
click:function()
|
||||
{
|
||||
showDetails(1,initPageSize);
|
||||
var opts = $("#tableData").datagrid('options');
|
||||
var pager = $("#tableData").datagrid('getPager');
|
||||
opts.pageNumber = 1;
|
||||
opts.pageSize = initPageSize;
|
||||
pager.pagination('refresh',
|
||||
{
|
||||
pageNumber:1,
|
||||
pageSize:initPageSize
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
function showDetails(pageNo,pageSize)
|
||||
{
|
||||
$.ajax({
|
||||
type:"post",
|
||||
url: "<%=path %>/depotHead/findByMonth.action",
|
||||
dataType: "json",
|
||||
data: ({
|
||||
MonthTime:$("#searchMonth").val()
|
||||
}),
|
||||
success: function (res)
|
||||
{
|
||||
var HeadIds = res.HeadIds;
|
||||
if(HeadIds) {
|
||||
//获取排序后的产品ID
|
||||
$.ajax({
|
||||
type:"post",
|
||||
url: "<%=path %>/material/findByOrder.action",
|
||||
dataType: "json",
|
||||
success: function (resNew)
|
||||
{
|
||||
var MIds = resNew.mIds;
|
||||
if(MIds) {
|
||||
$.ajax({
|
||||
type:"get",
|
||||
url: "<%=path %>/depotItem/buyIn.action",
|
||||
dataType: "json",
|
||||
data: ({
|
||||
pageNo:pageNo,
|
||||
pageSize:pageSize,
|
||||
MonthTime:$("#searchMonth").val(),
|
||||
HeadIds:HeadIds,
|
||||
MaterialIds:MIds
|
||||
}),
|
||||
success: function (data)
|
||||
{
|
||||
$("#tableData").datagrid('loadData',data);
|
||||
|
||||
},
|
||||
//此处添加错误处理
|
||||
error:function()
|
||||
{
|
||||
$.messager.alert('查询提示','查询数据后台异常,请稍后再试!','error');
|
||||
return;
|
||||
}
|
||||
});
|
||||
}
|
||||
else {
|
||||
$.messager.alert('查询提示','本月无数据!','error');
|
||||
}
|
||||
},
|
||||
//此处添加错误处理
|
||||
error:function()
|
||||
{
|
||||
$.messager.alert('查询提示','查询数据后台异常,请稍后再试!','error');
|
||||
return;
|
||||
}
|
||||
});
|
||||
}
|
||||
else {
|
||||
$.messager.alert('查询提示','本月无数据!','error');
|
||||
}
|
||||
},
|
||||
//此处添加错误处理
|
||||
error:function()
|
||||
{
|
||||
$.messager.alert('查询提示','查询数据后台异常,请稍后再试!','error');
|
||||
return;
|
||||
}
|
||||
});
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
294
src/main/webapp/pages/reports/in_out_stock_report.jsp
Normal file
294
src/main/webapp/pages/reports/in_out_stock_report.jsp
Normal file
@@ -0,0 +1,294 @@
|
||||
<%@page import="com.jsh.util.Tools"%>
|
||||
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
|
||||
<%
|
||||
String path = request.getContextPath();
|
||||
String clientIp = Tools.getCurrentUserIP();
|
||||
%>
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>进销存管理</title>
|
||||
<meta charset="utf-8">
|
||||
<!-- 指定以IE8的方式来渲染 -->
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE8"/>
|
||||
<link rel="shortcut icon" href="<%=path%>/images/favicon.ico" type="image/x-icon" />
|
||||
<script type="text/javascript" src="<%=path %>/js/jquery-1.8.0.min.js"></script>
|
||||
<link rel="stylesheet" type="text/css" href="<%=path %>/js/easyui-1.3.5/themes/default/easyui.css"/>
|
||||
<link rel="stylesheet" type="text/css" href="<%=path %>/js/easyui-1.3.5/themes/icon.css"/>
|
||||
<link type="text/css" rel="stylesheet" href="<%=path %>/css/common.css" />
|
||||
<script type="text/javascript" src="<%=path %>/js/easyui-1.3.5/jquery.easyui.min.js"></script>
|
||||
<script type="text/javascript" src="<%=path %>/js/easyui-1.3.5/locale/easyui-lang-zh_CN.js"></script>
|
||||
<script type="text/javascript" src="<%=path %>/js/My97DatePicker/WdatePicker.js"></script>
|
||||
<script type="text/javascript" src="<%=path %>/js/common/common.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<!-- 查询 -->
|
||||
<div id = "searchPanel" class="easyui-panel" style="padding:10px;" title="查询窗口" iconCls="icon-search" collapsible="true" closable="false">
|
||||
<table id="searchTable">
|
||||
<tr>
|
||||
<td>月份:</td>
|
||||
<td>
|
||||
<input type="text" name="searchMonth" id="searchMonth" onClick="WdatePicker({dateFmt:'yyyy-MM'})" class="txt Wdate" style="width:180px;"/>
|
||||
</td>
|
||||
<td> </td>
|
||||
<td> </td>
|
||||
<td> </td>
|
||||
<td>
|
||||
<a href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-search" id="searchBtn">查询</a>
|
||||
<a href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-redo" id="exprotBtn">导出</a>
|
||||
<span class="total-count"></span>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<!-- 数据显示table -->
|
||||
<div id = "tablePanel" class="easyui-panel" style="padding:1px;top:300px;" title="库存状况列表" iconCls="icon-list" collapsible="true" closable="false">
|
||||
<table id="tableData" style="top:300px;border-bottom-color:#FFFFFF"></table>
|
||||
</div>
|
||||
|
||||
<script type="text/javascript">
|
||||
var depotList = null;
|
||||
var depotID = null;
|
||||
//初始化界面
|
||||
$(function()
|
||||
{
|
||||
initTableData();
|
||||
ininPager();
|
||||
exportExcel();
|
||||
});
|
||||
|
||||
//导出EXCEL
|
||||
function exportExcel() {
|
||||
$("#exprotBtn").off("click").on("click",function(){
|
||||
if(!$("#searchPanel .total-count").text()) {
|
||||
$.messager.alert('导出提示','请先选择月份再进行查询!','error');
|
||||
}
|
||||
else {
|
||||
showPersonDetails(1,3000);
|
||||
//此处直接去做get请求,用下面的查询每月统计的方法,去获取list,参数长度虽长,但还是可以用get
|
||||
//window.location.href = "<%=path%>/depotItem/exportExcel.action?browserType=" + getOs();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
//初始化表格数据
|
||||
function initTableData()
|
||||
{
|
||||
$('#tableData').datagrid({
|
||||
//title:'列表',
|
||||
//iconCls:'icon-save',
|
||||
//width:700,
|
||||
height:heightInfo,
|
||||
nowrap: false,
|
||||
rownumbers: true,
|
||||
//动画效果
|
||||
animate:false,
|
||||
//选中单行
|
||||
singleSelect : true,
|
||||
//url:'<%=path %>/depotItem/findByAll.action?pageSize=' + initPageSize,
|
||||
pagination: true,
|
||||
//交替出现背景
|
||||
striped : true,
|
||||
//loadFilter: pagerFilter,
|
||||
pageSize: 10,
|
||||
pageList: [10,50,100],
|
||||
columns:[[
|
||||
{ title: '名称',field: 'MaterialName',width:60},
|
||||
{ title: '款号',field: 'MaterialModel',width:80},
|
||||
{ title: '颜色',field: 'MaterialColor',width:80},
|
||||
{ title: '单价',field: 'UnitPrice',width:60,formatter: function(value,row,index){
|
||||
return value.toFixed(2);
|
||||
}
|
||||
},
|
||||
{ title: '上月结存数量',field: 'prevSum',width:80},
|
||||
{ title: '入库数量',field: 'InSum',width:60},
|
||||
{ title: '出库数量',field: 'OutSum',width:60},
|
||||
{ title: '本月结存数量',field: 'thisSum',width:80},
|
||||
{ title: '结存金额',field: 'thisAllPrice',width:60,
|
||||
formatter: function(value,row,index){
|
||||
return value.toFixed(2);
|
||||
}
|
||||
}
|
||||
]],
|
||||
onLoadError:function()
|
||||
{
|
||||
$.messager.alert('页面加载提示','页面加载异常,请稍后再试!','error');
|
||||
return;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
//初始化键盘enter事件
|
||||
$(document).keydown(function(event)
|
||||
{
|
||||
//兼容 IE和firefox 事件
|
||||
var e = window.event || event;
|
||||
var k = e.keyCode||e.which||e.charCode;
|
||||
//兼容 IE,firefox 兼容
|
||||
var obj = e.srcElement ? e.srcElement : e.target;
|
||||
//绑定键盘事件为 id是指定的输入框才可以触发键盘事件 13键盘事件 ---遗留问题 enter键效验 对话框会关闭问题
|
||||
if(k == "13"&&(obj.id=="Type"||obj.id=="Name"))
|
||||
{
|
||||
$("#savePerson").click();
|
||||
}
|
||||
//搜索按钮添加快捷键
|
||||
if(k == "13"&&(obj.id=="searchType"))
|
||||
{
|
||||
$("#searchBtn").click();
|
||||
}
|
||||
});
|
||||
//分页信息处理
|
||||
function ininPager()
|
||||
{
|
||||
try
|
||||
{
|
||||
var opts = $("#tableData").datagrid('options');
|
||||
var pager = $("#tableData").datagrid('getPager');
|
||||
pager.pagination({
|
||||
onSelectPage:function(pageNum, pageSize)
|
||||
{
|
||||
opts.pageNumber = pageNum;
|
||||
opts.pageSize = pageSize;
|
||||
pager.pagination('refresh',
|
||||
{
|
||||
pageNumber:pageNum,
|
||||
pageSize:pageSize
|
||||
});
|
||||
showPersonDetails(pageNum,pageSize);
|
||||
}
|
||||
});
|
||||
}
|
||||
catch (e)
|
||||
{
|
||||
$.messager.alert('异常处理提示',"分页信息异常 : " + e.name + ": " + e.message,'error');
|
||||
}
|
||||
}
|
||||
|
||||
//增加
|
||||
var url;
|
||||
var personID = 0;
|
||||
//保存编辑前的名称
|
||||
var orgPerson = "";
|
||||
|
||||
//搜索处理
|
||||
$("#searchBtn").unbind().bind({
|
||||
click:function()
|
||||
{
|
||||
showPersonDetails(1,initPageSize);
|
||||
var opts = $("#tableData").datagrid('options');
|
||||
var pager = $("#tableData").datagrid('getPager');
|
||||
opts.pageNumber = 1;
|
||||
opts.pageSize = initPageSize;
|
||||
pager.pagination('refresh',
|
||||
{
|
||||
pageNumber:1,
|
||||
pageSize:initPageSize
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
function showPersonDetails(pageNo,pageSize)
|
||||
{
|
||||
$.ajax({
|
||||
type:"post",
|
||||
url: "<%=path %>/depotHead/findByMonth.action",
|
||||
dataType: "json",
|
||||
data: ({
|
||||
MonthTime:$("#searchMonth").val()
|
||||
}),
|
||||
success: function (res)
|
||||
{
|
||||
var HeadIds = res.HeadIds;
|
||||
if(HeadIds) {
|
||||
//获取排序后的产品ID
|
||||
$.ajax({
|
||||
type:"post",
|
||||
url: "<%=path %>/material/findByOrder.action",
|
||||
dataType: "json",
|
||||
success: function (resNew)
|
||||
{
|
||||
var MIds = resNew.mIds;
|
||||
if(MIds) {
|
||||
if(pageSize === 3000) {
|
||||
window.location.href = "<%=path%>/depotItem/exportExcel.action?browserType=" + getOs() + "&pageNo=" + pageNo + "&pageSize=" + pageSize + "&MonthTime=" + $("#searchMonth").val() + "&HeadIds=" + HeadIds + "&MaterialIds=" + MIds;
|
||||
}
|
||||
else {
|
||||
$.ajax({
|
||||
type:"get",
|
||||
url: "<%=path %>/depotItem/findByAll.action",
|
||||
dataType: "json",
|
||||
data: ({
|
||||
pageNo:pageNo,
|
||||
pageSize:pageSize,
|
||||
MonthTime:$("#searchMonth").val(),
|
||||
HeadIds:HeadIds,
|
||||
MaterialIds:MIds
|
||||
}),
|
||||
success: function (data)
|
||||
{
|
||||
$("#tableData").datagrid('loadData',data);
|
||||
|
||||
},
|
||||
//此处添加错误处理
|
||||
error:function()
|
||||
{
|
||||
$.messager.alert('查询提示','查询数据后台异常,请稍后再试!','error');
|
||||
return;
|
||||
}
|
||||
});
|
||||
|
||||
//总金额
|
||||
$.ajax({
|
||||
type:"post",
|
||||
url: "<%=path %>/depotItem/totalCountMoney.action",
|
||||
dataType: "json",
|
||||
data: ({
|
||||
MonthTime:$("#searchMonth").val(),
|
||||
HeadIds:HeadIds,
|
||||
MaterialIds:MIds
|
||||
}),
|
||||
success: function (data)
|
||||
{
|
||||
if(data && data.totalCount) {
|
||||
var count = data.totalCount.toString();
|
||||
count = count.substring(0,count.lastIndexOf('.')+3);
|
||||
$("#searchPanel .total-count").text("本月合计金额:" + count + "元");//本月合计金额
|
||||
}
|
||||
},
|
||||
//此处添加错误处理
|
||||
error:function()
|
||||
{
|
||||
$.messager.alert('查询提示','查询数据后台异常,请稍后再试!','error');
|
||||
return;
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
else {
|
||||
$.messager.alert('查询提示','本月无数据!','error');
|
||||
}
|
||||
},
|
||||
//此处添加错误处理
|
||||
error:function()
|
||||
{
|
||||
$.messager.alert('查询提示','查询数据后台异常,请稍后再试!','error');
|
||||
return;
|
||||
}
|
||||
});
|
||||
}
|
||||
else {
|
||||
$.messager.alert('查询提示','本月无数据!','error');
|
||||
}
|
||||
},
|
||||
//此处添加错误处理
|
||||
error:function()
|
||||
{
|
||||
$.messager.alert('查询提示','查询数据后台异常,请稍后再试!','error');
|
||||
return;
|
||||
}
|
||||
});
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
224
src/main/webapp/pages/reports/sale_out_report.jsp
Normal file
224
src/main/webapp/pages/reports/sale_out_report.jsp
Normal file
@@ -0,0 +1,224 @@
|
||||
<%@page import="com.jsh.util.Tools"%>
|
||||
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
|
||||
<%
|
||||
String path = request.getContextPath();
|
||||
String clientIp = Tools.getCurrentUserIP();
|
||||
%>
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>销售统计</title>
|
||||
<meta charset="utf-8">
|
||||
<!-- 指定以IE8的方式来渲染 -->
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE8"/>
|
||||
<link rel="shortcut icon" href="<%=path%>/images/favicon.ico" type="image/x-icon" />
|
||||
<script type="text/javascript" src="<%=path %>/js/jquery-1.8.0.min.js"></script>
|
||||
<link rel="stylesheet" type="text/css" href="<%=path %>/js/easyui-1.3.5/themes/default/easyui.css"/>
|
||||
<link rel="stylesheet" type="text/css" href="<%=path %>/js/easyui-1.3.5/themes/icon.css"/>
|
||||
<link type="text/css" rel="stylesheet" href="<%=path %>/css/common.css" />
|
||||
<script type="text/javascript" src="<%=path %>/js/easyui-1.3.5/jquery.easyui.min.js"></script>
|
||||
<script type="text/javascript" src="<%=path %>/js/easyui-1.3.5/locale/easyui-lang-zh_CN.js"></script>
|
||||
<script type="text/javascript" src="<%=path %>/js/My97DatePicker/WdatePicker.js"></script>
|
||||
<script type="text/javascript" src="<%=path %>/js/common/common.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<!-- 查询 -->
|
||||
<div id = "searchPanel" class="easyui-panel" style="padding:10px;" title="查询窗口" iconCls="icon-search" collapsible="true" closable="false">
|
||||
<table id="searchTable">
|
||||
<tr>
|
||||
<td>月份:</td>
|
||||
<td>
|
||||
<input type="text" name="searchMonth" id="searchMonth" onClick="WdatePicker({dateFmt:'yyyy-MM'})" class="txt Wdate" style="width:180px;"/>
|
||||
</td>
|
||||
<td> </td>
|
||||
<td> </td>
|
||||
<td>
|
||||
<a href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-search" id="searchBtn">查询</a>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<!-- 数据显示table -->
|
||||
<div id = "tablePanel" class="easyui-panel" style="padding:1px;top:300px;" title="销售统计列表" iconCls="icon-list" collapsible="true" closable="false">
|
||||
<table id="tableData" style="top:300px;border-bottom-color:#FFFFFF"></table>
|
||||
</div>
|
||||
|
||||
<script type="text/javascript">
|
||||
//初始化界面
|
||||
$(function()
|
||||
{
|
||||
initTableData();
|
||||
ininPager();
|
||||
});
|
||||
|
||||
//初始化表格数据
|
||||
function initTableData()
|
||||
{
|
||||
$('#tableData').datagrid({
|
||||
//title:'列表',
|
||||
//iconCls:'icon-save',
|
||||
//width:700,
|
||||
height:heightInfo,
|
||||
nowrap: false,
|
||||
rownumbers: true,
|
||||
//动画效果
|
||||
animate:false,
|
||||
//选中单行
|
||||
singleSelect : true,
|
||||
//url:'<%=path %>/depotItem/saleOut.action?pageSize=' + initPageSize,
|
||||
pagination: true,
|
||||
//交替出现背景
|
||||
striped : true,
|
||||
//loadFilter: pagerFilter,
|
||||
pageSize: 10,
|
||||
pageList: [10,50,100],
|
||||
columns:[[
|
||||
{ title: '名称',field: 'MaterialName',width:60},
|
||||
{ title: '款号',field: 'MaterialModel',width:80},
|
||||
{ title: '颜色',field: 'MaterialColor',width:80},
|
||||
{ title: '销售数量',field: 'OutSum',width:60},
|
||||
{ title: '销售金额',field: 'OutSumPrice',width:60},
|
||||
{ title: '退货数量',field: 'InSum',width:60},
|
||||
{ title: '退货金额',field: 'InSumPrice',width:60}
|
||||
]],
|
||||
onLoadError:function()
|
||||
{
|
||||
$.messager.alert('页面加载提示','页面加载异常,请稍后再试!','error');
|
||||
return;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
//初始化键盘enter事件
|
||||
$(document).keydown(function(event)
|
||||
{
|
||||
//兼容 IE和firefox 事件
|
||||
var e = window.event || event;
|
||||
var k = e.keyCode||e.which||e.charCode;
|
||||
//兼容 IE,firefox 兼容
|
||||
var obj = e.srcElement ? e.srcElement : e.target;
|
||||
//绑定键盘事件为 id是指定的输入框才可以触发键盘事件 13键盘事件 ---遗留问题 enter键效验 对话框会关闭问题
|
||||
//搜索按钮添加快捷键
|
||||
if(k == "13"&&(obj.id=="searchMonth"))
|
||||
{
|
||||
$("#searchBtn").click();
|
||||
}
|
||||
});
|
||||
//分页信息处理
|
||||
function ininPager()
|
||||
{
|
||||
try
|
||||
{
|
||||
var opts = $("#tableData").datagrid('options');
|
||||
var pager = $("#tableData").datagrid('getPager');
|
||||
pager.pagination({
|
||||
onSelectPage:function(pageNum, pageSize)
|
||||
{
|
||||
opts.pageNumber = pageNum;
|
||||
opts.pageSize = pageSize;
|
||||
pager.pagination('refresh',
|
||||
{
|
||||
pageNumber:pageNum,
|
||||
pageSize:pageSize
|
||||
});
|
||||
showDetails(pageNum,pageSize);
|
||||
}
|
||||
});
|
||||
}
|
||||
catch (e)
|
||||
{
|
||||
$.messager.alert('异常处理提示',"分页信息异常 : " + e.name + ": " + e.message,'error');
|
||||
}
|
||||
}
|
||||
|
||||
//搜索处理
|
||||
$("#searchBtn").unbind().bind({
|
||||
click:function()
|
||||
{
|
||||
showDetails(1,initPageSize);
|
||||
var opts = $("#tableData").datagrid('options');
|
||||
var pager = $("#tableData").datagrid('getPager');
|
||||
opts.pageNumber = 1;
|
||||
opts.pageSize = initPageSize;
|
||||
pager.pagination('refresh',
|
||||
{
|
||||
pageNumber:1,
|
||||
pageSize:initPageSize
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
function showDetails(pageNo,pageSize)
|
||||
{
|
||||
$.ajax({
|
||||
type:"post",
|
||||
url: "<%=path %>/depotHead/findByMonth.action",
|
||||
dataType: "json",
|
||||
data: ({
|
||||
MonthTime:$("#searchMonth").val()
|
||||
}),
|
||||
success: function (res)
|
||||
{
|
||||
var HeadIds = res.HeadIds;
|
||||
if(HeadIds) {
|
||||
//获取排序后的产品ID
|
||||
$.ajax({
|
||||
type:"post",
|
||||
url: "<%=path %>/material/findByOrder.action",
|
||||
dataType: "json",
|
||||
success: function (resNew)
|
||||
{
|
||||
var MIds = resNew.mIds;
|
||||
if(MIds) {
|
||||
$.ajax({
|
||||
type:"get",
|
||||
url: "<%=path %>/depotItem/saleOut.action",
|
||||
dataType: "json",
|
||||
data: ({
|
||||
pageNo:pageNo,
|
||||
pageSize:pageSize,
|
||||
MonthTime:$("#searchMonth").val(),
|
||||
HeadIds:HeadIds,
|
||||
MaterialIds:MIds
|
||||
}),
|
||||
success: function (data)
|
||||
{
|
||||
$("#tableData").datagrid('loadData',data);
|
||||
|
||||
},
|
||||
//此处添加错误处理
|
||||
error:function()
|
||||
{
|
||||
$.messager.alert('查询提示','查询数据后台异常,请稍后再试!','error');
|
||||
return;
|
||||
}
|
||||
});
|
||||
}
|
||||
else {
|
||||
$.messager.alert('查询提示','本月无数据!','error');
|
||||
}
|
||||
},
|
||||
//此处添加错误处理
|
||||
error:function()
|
||||
{
|
||||
$.messager.alert('查询提示','查询数据后台异常,请稍后再试!','error');
|
||||
return;
|
||||
}
|
||||
});
|
||||
}
|
||||
else {
|
||||
$.messager.alert('查询提示','本月无数据!','error');
|
||||
}
|
||||
},
|
||||
//此处添加错误处理
|
||||
error:function()
|
||||
{
|
||||
$.messager.alert('查询提示','查询数据后台异常,请稍后再试!','error');
|
||||
return;
|
||||
}
|
||||
});
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
139
src/main/webapp/pages/user/password.jsp
Normal file
139
src/main/webapp/pages/user/password.jsp
Normal file
@@ -0,0 +1,139 @@
|
||||
<%@page import="com.jsh.util.Tools"%>
|
||||
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
|
||||
<%
|
||||
String path = request.getContextPath();
|
||||
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
|
||||
String clientIp = Tools.getCurrentUserIP();
|
||||
%>
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>个人资料</title>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
<!-- 指定以IE8的方式来渲染 -->
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE8"/>
|
||||
<link rel="shortcut icon" href="<%=path%>/images/favicon.ico" type="image/x-icon" />
|
||||
<link rel="stylesheet" type="text/css" href="<%=path %>/js/easyui-1.3.5/themes/default/easyui.css"/>
|
||||
<link rel="stylesheet" type="text/css" href="<%=path %>/js/easyui-1.3.5/themes/icon.css"/>
|
||||
<script type="text/javascript" src="<%=path %>/js/jquery-1.8.0.min.js"></script>
|
||||
<script type="text/javascript" src="<%=path %>/js/easyui-1.3.5/jquery.easyui.min.js"></script>
|
||||
<script type="text/javascript" src="<%=path %>/js/easyui-1.3.5/locale/easyui-lang-zh_CN.js"></script>
|
||||
<script type="text/javascript" src="<%=path %>/js/common/common.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<div id="userDlg" class="easyui-panel" title="修改密码" style="height:370px;padding:10px 20px;background-color:#EAF2FD; "
|
||||
buttons="#dlg-buttons" iconCls="icon-unlock" collapsible="true" closable="false">
|
||||
<form id="passwordFM" method="post" novalidate>
|
||||
<div class="fitem" style="padding:5px">
|
||||
<label id="passwordLabel">原始密码 </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="请输入原始密码"/>
|
||||
<span id="orgTipMsg"></span>
|
||||
</div>
|
||||
<div class="fitem" style="padding:5px">
|
||||
<label id="newPassword">重设密码 </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="请填写新密码"/>
|
||||
<span id="orgTipMsg"></span>
|
||||
</div>
|
||||
<div class="fitem" style="padding:5px">
|
||||
<label id="repasswordLabel">再输一遍 </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="两次密码输入不一致"/>
|
||||
<span id="tipMsg"></span>
|
||||
</div>
|
||||
<input type="hidden" name="clientIp" id="clientIp" value="<%=clientIp %>"/>
|
||||
</form>
|
||||
<div style="clear: both;"> </div>
|
||||
<div id="dlg-buttons">
|
||||
<a href="javascript:void(0)" id="savepassword" class="easyui-linkbutton" iconCls="icon-save">保存</a>
|
||||
<a href="javascript:void(0)" id="cancelpassword" class="easyui-linkbutton" iconCls="icon-cancel">取消</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script type="text/javascript">
|
||||
//初始化界面
|
||||
$(function()
|
||||
{
|
||||
$("#orgpassword").focus();
|
||||
$('#passwordFM').form({
|
||||
onSubmit: function(){
|
||||
return false;
|
||||
}
|
||||
});
|
||||
$("#userDlg").panel({height:webH-35});
|
||||
});
|
||||
|
||||
$("#cancelpassword").unbind().bind({
|
||||
click:function()
|
||||
{
|
||||
history.go(-1);
|
||||
}
|
||||
});
|
||||
|
||||
//初始化键盘enter事件
|
||||
$(document).keydown(function(event)
|
||||
{
|
||||
//兼容 IE和firefox 事件
|
||||
var e = window.event || event;
|
||||
var k = e.keyCode||e.which||e.charCode;
|
||||
//兼容 IE,firefox 兼容
|
||||
var obj = e.srcElement ? e.srcElement : e.target;
|
||||
//绑定键盘事件为 id是指定的输入框才可以触发键盘事件 13键盘事件
|
||||
if(k == "13"&&(obj.id=="orgpassword" || obj.id=="password"|| obj.id=="repassword"))
|
||||
$("#savepassword").click();
|
||||
});
|
||||
|
||||
$("#savepassword").unbind().bind({
|
||||
click:function()
|
||||
{
|
||||
if(!$('#passwordFM').form('validate'))
|
||||
return;
|
||||
$.ajax({
|
||||
type:"post",
|
||||
url: "<%=path %>/user/updatePwd.action",
|
||||
dataType: "json",
|
||||
async : false,
|
||||
data: ({
|
||||
userID : '${sessionScope.user.id}',
|
||||
password : $.trim($("#password").val()),
|
||||
orgpwd : $.trim($("#orgpassword").val())
|
||||
}),
|
||||
success: function (tipInfo)
|
||||
{
|
||||
if(1 == tipInfo)
|
||||
//回退到上次访问页面
|
||||
history.go(-1);
|
||||
else if(2 == tipInfo)
|
||||
{
|
||||
$("#orgTipMsg").empty().append("<font color='red'>原始密码输入错误</font>");
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
$.messager.alert('提示','更新密码异常,请稍后再试!','error');
|
||||
return;
|
||||
}
|
||||
},
|
||||
//此处添加错误处理
|
||||
error:function()
|
||||
{
|
||||
$.messager.alert('提示','更新密码异常,请稍后再试!','error');
|
||||
return;
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
//处理tip提示
|
||||
$("#orgpassword").unbind().bind({
|
||||
'click keyup':function()
|
||||
{
|
||||
$("#orgTipMsg").empty();
|
||||
},
|
||||
'blur':function()
|
||||
{
|
||||
$("#orgTipMsg").empty();
|
||||
}
|
||||
});
|
||||
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
137
src/main/webapp/pages/user/userDepot.jsp
Normal file
137
src/main/webapp/pages/user/userDepot.jsp
Normal file
@@ -0,0 +1,137 @@
|
||||
<%@page import="com.jsh.util.Tools"%>
|
||||
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
|
||||
<%
|
||||
String path = request.getContextPath();
|
||||
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
|
||||
String clientIp = Tools.getCurrentUserIP();
|
||||
%>
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>用户对应部门</title>
|
||||
<meta charset="utf-8">
|
||||
<!-- 指定以IE8的方式来渲染 -->
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE8" />
|
||||
<link rel="shortcut icon" href="<%=path%>/images/favicon.ico" type="image/x-icon" />
|
||||
<script type="text/javascript" src="<%=path%>/js/jquery-1.8.0.min.js"></script>
|
||||
<link rel="stylesheet" type="text/css" href="<%=path%>/js/easyui-1.3.5/themes/default/easyui.css" />
|
||||
<link rel="stylesheet" type="text/css" href="<%=path%>/js/easyui-1.3.5/themes/icon.css" />
|
||||
<link type="text/css" rel="stylesheet" href="<%=path%>/css/common.css" />
|
||||
<script type="text/javascript" src="<%=path%>/js/easyui-1.3.5/jquery.easyui.min.js"></script>
|
||||
<script type="text/javascript" src="<%=path%>/js/easyui-1.3.5/locale/easyui-lang-zh_CN.js"></script>
|
||||
<script type="text/javascript" src="<%=path%>/js/common/common.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<!-- 数据显示table -->
|
||||
<div>
|
||||
<a id="btnOK" class="easyui-linkbutton">保存</a>
|
||||
</div>
|
||||
<div>
|
||||
<ul id="tt"></ul>
|
||||
</div>
|
||||
|
||||
<script type="text/javascript">
|
||||
var url_id = getUrlParam('id'); //获取传值id(用户id)
|
||||
var type="UserDepot";
|
||||
var url;//定义链接地址
|
||||
function GetNode(ctype) {
|
||||
var node = $('#tt').tree('getChecked');
|
||||
var cnodes = '';
|
||||
var pnodes = '';
|
||||
|
||||
var prevNode = ''; //保存上一步所选父节点
|
||||
for (var i = 0; i < node.length; i++) {
|
||||
|
||||
if ($('#tt').tree('isLeaf', node[i].target)) {
|
||||
cnodes += '[' + node[i].id + ']';
|
||||
|
||||
var pnode = $('#tt').tree('getParent', node[i].target); //获取当前节点的父节点
|
||||
if (prevNode != pnode.id) //保证当前父节点与上一次父节点不同
|
||||
{
|
||||
pnodes += '[' + pnode.id + ']';
|
||||
prevNode = pnode.id; //保存当前节点
|
||||
}
|
||||
}
|
||||
}
|
||||
//cnodes = cnodes.substring(0, cnodes.length - 1);
|
||||
pnodes = pnodes.substring(0, pnodes.length - 1);
|
||||
|
||||
if (ctype == 'child') { return cnodes; }
|
||||
else { return pnodes };
|
||||
};
|
||||
|
||||
$(function () {
|
||||
|
||||
$('#tt').tree({
|
||||
url:'<%=path%>/depot/findUserDepot.action?UBType='+type+'&UBKeyId='+url_id,
|
||||
animate:true,
|
||||
checkbox:true
|
||||
});
|
||||
|
||||
|
||||
$("#btnOK").click(
|
||||
function() {
|
||||
if(!checkUserDepot())
|
||||
{
|
||||
url = '<%=path%>/userBusiness/create.action';
|
||||
}
|
||||
else
|
||||
{
|
||||
url = '<%=path%>/userBusiness/update.action';
|
||||
}
|
||||
|
||||
if (confirm("您确定要保存吗?")) {
|
||||
|
||||
$.ajax({
|
||||
type: "post",
|
||||
url:url,
|
||||
data: { Type: type, KeyId: url_id, Value: GetNode('child'),clientIp:'<%=clientIp %>'
|
||||
},
|
||||
dataType: "json",
|
||||
async : false,
|
||||
success: function (tipInfo) {
|
||||
if (tipInfo) {
|
||||
self.parent.$.colorbox.close();
|
||||
alert("操作成功!");
|
||||
}
|
||||
else
|
||||
alert(tipInfo);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
});
|
||||
|
||||
//检查记录是否存在
|
||||
function checkUserDepot()
|
||||
{
|
||||
//表示是否存在 true == 存在 false = 不存在
|
||||
var flag = false;
|
||||
//开始ajax名称检验,是否存在
|
||||
$.ajax({
|
||||
type:"post",
|
||||
url: "<%=path %>/userBusiness/checkIsValueExist.action",
|
||||
dataType: "json",
|
||||
async : false,
|
||||
data: ({
|
||||
Type : type,
|
||||
KeyId : url_id
|
||||
}),
|
||||
success: function (tipInfo)
|
||||
{
|
||||
flag = tipInfo;
|
||||
},
|
||||
//此处添加错误处理
|
||||
error:function()
|
||||
{
|
||||
$.messager.alert('提示','检查用户对应功能是否存在异常,请稍后再试!','error');
|
||||
return;
|
||||
}
|
||||
});
|
||||
return flag;
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
137
src/main/webapp/pages/user/userRole.jsp
Normal file
137
src/main/webapp/pages/user/userRole.jsp
Normal file
@@ -0,0 +1,137 @@
|
||||
<%@page import="com.jsh.util.Tools"%>
|
||||
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
|
||||
<%
|
||||
String path = request.getContextPath();
|
||||
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
|
||||
String clientIp = Tools.getCurrentUserIP();
|
||||
%>
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>用户对应角色</title>
|
||||
<meta charset="utf-8">
|
||||
<!-- 指定以IE8的方式来渲染 -->
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE8" />
|
||||
<link rel="shortcut icon" href="<%=path%>/images/favicon.ico" type="image/x-icon" />
|
||||
<script type="text/javascript" src="<%=path%>/js/jquery-1.8.0.min.js"></script>
|
||||
<link rel="stylesheet" type="text/css" href="<%=path%>/js/easyui-1.3.5/themes/default/easyui.css" />
|
||||
<link rel="stylesheet" type="text/css" href="<%=path%>/js/easyui-1.3.5/themes/icon.css" />
|
||||
<link type="text/css" rel="stylesheet" href="<%=path%>/css/common.css" />
|
||||
<script type="text/javascript" src="<%=path%>/js/easyui-1.3.5/jquery.easyui.min.js"></script>
|
||||
<script type="text/javascript" src="<%=path%>/js/easyui-1.3.5/locale/easyui-lang-zh_CN.js"></script>
|
||||
<script type="text/javascript" src="<%=path%>/js/common/common.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<!-- 数据显示table -->
|
||||
<div>
|
||||
<a id="btnOK" class="easyui-linkbutton">保存</a>
|
||||
</div>
|
||||
<div>
|
||||
<ul id="tt"></ul>
|
||||
</div>
|
||||
|
||||
<script type="text/javascript">
|
||||
var url_id = getUrlParam('id'); //获取传值id(用户id)
|
||||
var type="UserRole";
|
||||
var url;//定义链接地址
|
||||
function GetNode(ctype) {
|
||||
var node = $('#tt').tree('getChecked');
|
||||
var cnodes = '';
|
||||
var pnodes = '';
|
||||
|
||||
var prevNode = ''; //保存上一步所选父节点
|
||||
for (var i = 0; i < node.length; i++) {
|
||||
|
||||
if ($('#tt').tree('isLeaf', node[i].target)) {
|
||||
cnodes += '[' + node[i].id + ']';
|
||||
|
||||
var pnode = $('#tt').tree('getParent', node[i].target); //获取当前节点的父节点
|
||||
if (prevNode != pnode.id) //保证当前父节点与上一次父节点不同
|
||||
{
|
||||
pnodes += '[' + pnode.id + ']';
|
||||
prevNode = pnode.id; //保存当前节点
|
||||
}
|
||||
}
|
||||
}
|
||||
//cnodes = cnodes.substring(0, cnodes.length - 1);
|
||||
pnodes = pnodes.substring(0, pnodes.length - 1);
|
||||
|
||||
if (ctype == 'child') { return cnodes; }
|
||||
else { return pnodes };
|
||||
};
|
||||
|
||||
$(function () {
|
||||
|
||||
$('#tt').tree({
|
||||
url:'<%=path%>/role/findUserRole.action?UBType='+type+'&UBKeyId='+url_id,
|
||||
animate:true,
|
||||
checkbox:true
|
||||
});
|
||||
|
||||
|
||||
$("#btnOK").click(
|
||||
function() {
|
||||
if(!checkUserRole())
|
||||
{
|
||||
url = '<%=path%>/userBusiness/create.action';
|
||||
}
|
||||
else
|
||||
{
|
||||
url = '<%=path%>/userBusiness/update.action';
|
||||
}
|
||||
|
||||
if (confirm("您确定要保存吗?")) {
|
||||
|
||||
$.ajax({
|
||||
type: "post",
|
||||
url:url,
|
||||
data: { Type: type, KeyId: url_id, Value: GetNode('child'),clientIp:'<%=clientIp %>'
|
||||
},
|
||||
dataType: "json",
|
||||
async : false,
|
||||
success: function (tipInfo) {
|
||||
if (tipInfo) {
|
||||
self.parent.$.colorbox.close();
|
||||
alert("操作成功!");
|
||||
}
|
||||
else
|
||||
alert(tipInfo);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
});
|
||||
|
||||
//检查记录是否存在
|
||||
function checkUserRole()
|
||||
{
|
||||
//表示是否存在 true == 存在 false = 不存在
|
||||
var flag = false;
|
||||
//开始ajax名称检验,是否存在
|
||||
$.ajax({
|
||||
type:"post",
|
||||
url: "<%=path %>/userBusiness/checkIsValueExist.action",
|
||||
dataType: "json",
|
||||
async : false,
|
||||
data: ({
|
||||
Type : type,
|
||||
KeyId : url_id
|
||||
}),
|
||||
success: function (tipInfo)
|
||||
{
|
||||
flag = tipInfo;
|
||||
},
|
||||
//此处添加错误处理
|
||||
error:function()
|
||||
{
|
||||
$.messager.alert('提示','检查用户对应功能是否存在异常,请稍后再试!','error');
|
||||
return;
|
||||
}
|
||||
});
|
||||
return flag;
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
198
src/main/webapp/pages/user/userinfo.jsp
Normal file
198
src/main/webapp/pages/user/userinfo.jsp
Normal file
@@ -0,0 +1,198 @@
|
||||
<%@page import="com.jsh.util.Tools"%>
|
||||
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
|
||||
<%
|
||||
String path = request.getContextPath();
|
||||
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
|
||||
String clientIp = Tools.getCurrentUserIP();
|
||||
%>
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head>
|
||||
<title>个人资料</title>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
<!-- 指定以IE8的方式来渲染 -->
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE8"/>
|
||||
<link rel="shortcut icon" href="<%=path%>/images/favicon.ico" type="image/x-icon" />
|
||||
<link rel="stylesheet" type="text/css" href="<%=path %>/js/easyui-1.3.5/themes/default/easyui.css"/>
|
||||
<link rel="stylesheet" type="text/css" href="<%=path %>/js/easyui-1.3.5/themes/icon.css"/>
|
||||
<script type="text/javascript" src="<%=path %>/js/jquery-1.8.0.min.js"></script>
|
||||
<script type="text/javascript" src="<%=path %>/js/easyui-1.3.5/jquery.easyui.min.js"></script>
|
||||
<script type="text/javascript" src="<%=path %>/js/easyui-1.3.5/locale/easyui-lang-zh_CN.js"></script>
|
||||
<script type="text/javascript" src="<%=path %>/js/common/common.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<div id="position" class="easyui-panel" title="当前位置:系统管理 > 个人资料" collapsible="false" closable="false"/>
|
||||
<div id="userDlg" class="easyui-panel" title="个人资料" style="height:400px;padding:10px 20px;background-color:#EAF2FD "
|
||||
buttons="#dlg-buttons" iconCls="icon-comment" collapsible="true" closable="false">
|
||||
<form id="usernameFM" method="post" novalidate action="<%=path %>/user/update.action">
|
||||
<div class="fitem" style="padding:5px">
|
||||
<label id="usernameLabel">用户名称 </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"/>
|
||||
</div>
|
||||
|
||||
<div class="fitem" style="padding:5px">
|
||||
<label id="departmentLabel">部 门 </label>
|
||||
<input name="department" id="department" style="width: 230px;height: 20px" value="${sessionScope.user.department}"/>
|
||||
</div>
|
||||
<div class="fitem" style="padding:5px">
|
||||
<label id="positionLabel">职 位 </label>
|
||||
<input name="position" id="position" style="width: 230px;height: 20px" value="${sessionScope.user.position}"/>
|
||||
</div>
|
||||
<div class="fitem" style="padding:5px">
|
||||
<label id="phonenumLabel">联系电话 </label>
|
||||
<input name="phonenum" id="phonenum" class="easyui-numberbox" style="width: 230px;height: 20px" value="${sessionScope.user.phonenum}"/>
|
||||
</div>
|
||||
<div class="fitem" style="padding:5px">
|
||||
<label id="emailLabel">电子邮箱 </label>
|
||||
<input name="email" id="email" class="easyui-validatebox" validType="email" style="width: 230px;height: 20px" value="${sessionScope.user.email}"/>
|
||||
</div>
|
||||
<div class="fitem" style="padding:5px">
|
||||
<label id="descriptionLabel">描 述 </label>
|
||||
<textarea name="description" id="description" rows="3" cols="3" style="width: 230px;font-size: 12px;">${sessionScope.user.description}</textarea>
|
||||
</div>
|
||||
<input type="hidden" name="clientIp" id="clientIp" value="<%=clientIp %>"/>
|
||||
<input type="hidden" name="userID" id="userID" value="${sessionScope.user.id}"/>
|
||||
</form>
|
||||
<div style="clear: both;"> </div>
|
||||
<div id="dlg-buttons">
|
||||
<a href="javascript:void(0)" id="saveusername" class="easyui-linkbutton" iconCls="icon-save">修改</a>
|
||||
<a href="javascript:void(0)" id="cancelusername" class="easyui-linkbutton" iconCls="icon-cancel">取消</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script type="text/javascript">
|
||||
//初始化界面
|
||||
$(function()
|
||||
{
|
||||
browserFit();
|
||||
$("#userDlg").panel({height:webH-35});
|
||||
});
|
||||
|
||||
//浏览器适配
|
||||
function browserFit()
|
||||
{
|
||||
if(getOs()=='MSIE')
|
||||
{
|
||||
$("#usernameLabel").empty().append("用户名称 ");
|
||||
$("#departmentLabel").empty().append("部 门 ");
|
||||
$("#positionLabel").empty().append("职 位 ");
|
||||
$("#phonenumLabel").empty().append("联系电话 ");
|
||||
$("#emailLabel").empty().append("电子邮箱 ");
|
||||
$("#descriptionLabel").empty().append("描 述 ");
|
||||
}
|
||||
else
|
||||
{
|
||||
$("#usernameLabel").empty().append("用户名称 ");
|
||||
$("#departmentLabel").empty().append("部 门 ");
|
||||
$("#positionLabel").empty().append("职 位 ");
|
||||
$("#phonenumLabel").empty().append("联系电话 ");
|
||||
$("#emailLabel").empty().append("电子邮箱 ");
|
||||
$("#descriptionLabel").empty().append("描 述 ");
|
||||
}
|
||||
}
|
||||
|
||||
$("#cancelusername").unbind().bind({
|
||||
click:function()
|
||||
{
|
||||
history.go(-1);
|
||||
}
|
||||
});
|
||||
|
||||
//初始化键盘enter事件
|
||||
$(document).keydown(function(event)
|
||||
{
|
||||
//兼容 IE和firefox 事件
|
||||
var e = window.event || event;
|
||||
var k = e.keyCode||e.which||e.charCode;
|
||||
//兼容 IE,firefox 兼容
|
||||
var obj = e.srcElement ? e.srcElement : e.target;
|
||||
//绑定键盘事件为 id是指定的输入框才可以触发键盘事件 13键盘事件
|
||||
if(k == "13"&&(obj.id=="username" || obj.id=="department"|| obj.id=="phonenum"
|
||||
|| obj.id=="email" || obj.id=="description" || obj.id=="position"))
|
||||
{
|
||||
$("#saveusername").click();
|
||||
}
|
||||
});
|
||||
|
||||
//保存用户信息
|
||||
$("#saveusername").unbind().bind({
|
||||
click:function()
|
||||
{
|
||||
if(checkusernameName())
|
||||
return;
|
||||
|
||||
var reg = /^([0-9])+$/;
|
||||
var phonenum = $.trim($("#phonenum").val());
|
||||
if(phonenum.length>0 && !reg.test(phonenum))
|
||||
{
|
||||
$.messager.alert('提示','电话号码只能是数字','info');
|
||||
$("#phonenum").val("").focus();
|
||||
return;
|
||||
}
|
||||
|
||||
$('#usernameFM').form('submit',{
|
||||
onSubmit: function()
|
||||
{
|
||||
return $(this).form('validate');
|
||||
},
|
||||
success: function(result)
|
||||
{
|
||||
var result = eval('('+result+')');
|
||||
if (!result)
|
||||
{
|
||||
$.messager.show({
|
||||
title: '错误提示',
|
||||
msg: '保存用户信息失败,请稍后重试!'
|
||||
});
|
||||
}
|
||||
else
|
||||
{
|
||||
$.messager.alert('提示','修改个人资料成功!','info');
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
//检查用户 名称是否存在 ++ 重名无法提示问题需要跟进
|
||||
function checkusernameName()
|
||||
{
|
||||
var username = $.trim($("#username").val());
|
||||
//表示是否存在 true == 存在 false = 不存在
|
||||
var flag = false;
|
||||
//开始ajax名称检验,不能重名
|
||||
if(username.length > 0 && username != '${sessionScope.user.username}')
|
||||
{
|
||||
$.ajax({
|
||||
type:"post",
|
||||
url: "<%=path %>/user/checkIsNameExist.action",
|
||||
dataType: "json",
|
||||
async : false,
|
||||
data: ({
|
||||
userID : '${sessionScope.user.id}',
|
||||
username : username
|
||||
}),
|
||||
success: function (tipInfo)
|
||||
{
|
||||
flag = tipInfo;
|
||||
if(tipInfo)
|
||||
{
|
||||
$.messager.alert('提示','用户名称已经存在','info');
|
||||
//alert("用户名称已经存在");
|
||||
//$("#username").val("");
|
||||
return;
|
||||
}
|
||||
},
|
||||
//此处添加错误处理
|
||||
error:function()
|
||||
{
|
||||
$.messager.alert('提示','检查用户名称是否存在异常,请稍后再试!','error');
|
||||
return;
|
||||
}
|
||||
});
|
||||
}
|
||||
return flag;
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user