Commit 7a436d1c authored by 季圣华's avatar 季圣华
Browse files

!14 格式化代码,看着有点别扭

Merge pull request !14 from SmkfGao/master
parents 8f304964 6bc92ec9
<%@page import="com.jsh.util.Tools"%>
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@page import="com.jsh.util.Tools" %>
<%@ page language="java" pageEncoding="utf-8" %>
<%
String path = request.getContextPath();
String clientIp = Tools.getLocalIp(request);
%>
<!DOCTYPE html>
<html>
<head>
<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="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/print/print.js"></script>
<link rel="stylesheet" type="text/css" href="<%=path %>/js/easyui-1.3.5/themes/default/easyui.css"/>
<link rel="stylesheet" type="text/css" href="<%=path %>/js/easyui-1.3.5/themes/icon.css"/>
<link type="text/css" rel="stylesheet" href="<%=path %>/css/common.css" />
<link type="text/css" rel="stylesheet" href="<%=path %>/css/common.css"/>
<script type="text/javascript" src="<%=path %>/js/easyui-1.3.5/jquery.easyui.min.js"></script>
<script type="text/javascript" src="<%=path %>/js/easyui-1.3.5/locale/easyui-lang-zh_CN.js"></script>
<script type="text/javascript" src="<%=path %>/js/common/outlook_in.js"></script>
......@@ -25,24 +25,27 @@
<script>
var uid = ${sessionScope.user.id};
</script>
</head>
<body>
<!-- 查询 -->
<div id = "searchPanel" class="easyui-panel" style="padding:10px;" title="查询窗口" iconCls="icon-search" collapsible="true" closable="false">
</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 id="OrganId" name="OrganId" style="width:120px;" />
<input id="OrganId" name="OrganId" style="width:120px;"/>
</td>
<td>&nbsp;</td>
<td>单据日期:</td>
<td>
<input type="text" name="searchBeginTime" id="searchBeginTime" onClick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'})" class="txt Wdate" style="width:140px;"/>
<input type="text" name="searchBeginTime" id="searchBeginTime"
onClick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'})" class="txt Wdate" style="width:140px;"/>
</td>
<td>-</td>
<td>
<input type="text" name="searchEndTime" id="searchEndTime" onClick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'})" class="txt Wdate" style="width:140px;"/>
<input type="text" name="searchEndTime" id="searchEndTime"
onClick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'})" class="txt Wdate" style="width:140px;"/>
</td>
<td>&nbsp;</td>
<td>
......@@ -57,19 +60,19 @@
</td>
</tr>
</table>
</div>
</div>
<!-- 数据显示table -->
<div id = "tablePanel" class="easyui-panel" style="padding:1px;top:300px;" title="供应商对账列表" iconCls="icon-list" collapsible="true" closable="false">
<!-- 数据显示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>
<script type="text/javascript">
<script type="text/javascript">
var path = "<%=path %>";
var supUrl = path + "/supplier/findBySelect_sup.action"; //供应商接口
//初始化界面
$(function()
{
$(function () {
var thisDate = getNowFormatMonth(); //当前月份
var thisDateTime = getNowFormatDateTime(); //当前时间
$("#searchBeginTime").val(thisDate + "-01 00:00:00");
......@@ -83,99 +86,92 @@
//初始化供应商
function initSupplier(){
function initSupplier() {
$('#OrganId').combobox({
url: supUrl,
valueField:'id',
textField:'supplier',
filter: function(q, row){
valueField: 'id',
textField: 'supplier',
filter: function (q, row) {
var opts = $(this).combobox('options');
return row[opts.textField].indexOf(q) >-1;
return row[opts.textField].indexOf(q) > -1;
}
});
}
//初始化表格数据
function initTableData()
{
function initTableData() {
$('#tableData').datagrid({
height:heightInfo,
height: heightInfo,
nowrap: false,
rownumbers: true,
//动画效果
animate:false,
animate: false,
//选中单行
singleSelect : true,
singleSelect: true,
pagination: true,
//交替出现背景
striped : true,
striped: true,
pageSize: 10,
pageList: [10,50,100],
columns:[[
{ title: '单据编号',field: 'number',width:140,
pageList: [10, 50, 100],
columns: [[
{
title: '单据编号', field: 'number', width: 140,
formatter: function (value, row) {
return "<a class='n-link' onclick=\"newTab('" + row.number + "','../materials/bill_detail.jsp?n=" + row.number + "&type=" + row.type + "','')\">"
+ row.number + "</a>";
}
},
{ title: '类型',field: 'type',width:100},
{ title: '单位名称',field: 'supplierName',width:200},
{ title: '单据金额',field: 'discountLastMoney',width:80},
{ title: '实际支付',field: 'changeAmount',width:80},
{ title: '本期变化',field: 'allPrice',width:80},
{ title: '单据日期',field: 'operTime',width:140}
{title: '类型', field: 'type', width: 100},
{title: '单位名称', field: 'supplierName', width: 200},
{title: '单据金额', field: 'discountLastMoney', width: 80},
{title: '实际支付', field: 'changeAmount', width: 80},
{title: '本期变化', field: 'allPrice', width: 80},
{title: '单据日期', field: 'operTime', width: 140}
]],
onLoadError:function()
{
$.messager.alert('页面加载提示','页面加载异常,请稍后再试!','error');
onLoadError: function () {
$.messager.alert('页面加载提示', '页面加载异常,请稍后再试!', 'error');
return;
}
});
}
//初始化键盘enter事件
$(document).keydown(function(event)
{
$(document).keydown(function (event) {
//兼容 IE和firefox 事件
var e = window.event || event;
var k = e.keyCode||e.which||e.charCode;
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"))
{
if (k == "13" && (obj.id == "Type" || obj.id == "Name")) {
$("#savePerson").click();
}
//搜索按钮添加快捷键
if(k == "13"&&(obj.id=="searchType"))
{
if (k == "13" && (obj.id == "searchType")) {
$("#searchBtn").click();
}
});
//分页信息处理
function ininPager()
{
try
{
function ininPager() {
try {
var opts = $("#tableData").datagrid('options');
var pager = $("#tableData").datagrid('getPager');
pager.pagination({
onSelectPage:function(pageNum, pageSize)
{
onSelectPage: function (pageNum, pageSize) {
opts.pageNumber = pageNum;
opts.pageSize = pageSize;
pager.pagination('refresh',
{
pageNumber:pageNum,
pageSize:pageSize
pageNumber: pageNum,
pageSize: pageSize
});
showDetails(pageNum,pageSize);
showDetails(pageNum, pageSize);
}
});
}
catch (e)
{
$.messager.alert('异常处理提示',"分页信息异常 : " + e.name + ": " + e.message,'error');
catch (e) {
$.messager.alert('异常处理提示', "分页信息异常 : " + e.name + ": " + e.message, 'error');
}
}
......@@ -187,107 +183,106 @@
//搜索处理
function search() {
showDetails(1,initPageSize);
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
pageNumber: 1,
pageSize: initPageSize
});
}
$("#searchBtn").unbind().bind({
click:function()
{
click: function () {
search();
}
});
function showDetails(pageNo,pageSize)
{
function showDetails(pageNo, pageSize) {
$.ajax({
type: "post",
url: "<%=path %>/depotHead/findStatementAccount.action",
dataType: "json",
data: ({
pageNo:pageNo,
pageSize:pageSize,
pageNo: pageNo,
pageSize: pageSize,
BeginTime: $("#searchBeginTime").val(),
EndTime: $("#searchEndTime").val(),
OrganId: $('#OrganId').combobox('getValue'),
supType: "供应商"
}),
success: function (res) {
if(res){
$("#tableData").datagrid('loadData',res);
if (res) {
$("#tableData").datagrid('loadData', res);
//如果选择了单位信息,就进行计算期初和期末
var supplierId = $('#OrganId').combobox('getValue');
if(supplierId) {
if (supplierId) {
//先查找期初信息
var beginNeedGet = 0;
var beginNeedPay = 0;
$.ajax({
type:"post",
type: "post",
url: "<%=path %>/supplier/findById.action",
dataType: "json",
async: false,
data: ({
supplierID: supplierId
}),
success: function(res){
if(res && res.rows && res.rows[0]) {
if(res.rows[0].BeginNeedGet) {
success: function (res) {
if (res && res.rows && res.rows[0]) {
if (res.rows[0].BeginNeedGet) {
beginNeedGet = res.rows[0].BeginNeedGet;
}
if(res.rows[0].BeginNeedPay) {
if (res.rows[0].BeginNeedPay) {
beginNeedPay = res.rows[0].BeginNeedPay;
}
//显示期初结存
var searchBeginTime = $("#searchBeginTime").val(); //开始时间
$.ajax({
type:"post",
type: "post",
url: "<%=path %>/depotHead/findTotalPay.action",
dataType: "json",
async: false,
data: ({
supplierId: supplierId,
EndTime:searchBeginTime,
EndTime: searchBeginTime,
supType: "vendor"
}),
success: function(res){
if(res) {
var moneyA = res.getAllMoney.toFixed(2)-0;
success: function (res) {
if (res) {
var moneyA = res.getAllMoney.toFixed(2) - 0;
$.ajax({
type:"post",
type: "post",
url: "<%=path %>/accountHead/findTotalPay.action",
dataType: "json",
async: false,
data: ({
supplierId: supplierId,
EndTime:searchBeginTime,
EndTime: searchBeginTime,
supType: "vendor"
}),
success: function(res){
if(res) {
var moneyB = res.getAllMoney.toFixed(2)-0;
var money = moneyA+moneyB;
var moneyBeginNeedGet = beginNeedGet-0; //期初应收
var moneyBeginNeedPay = beginNeedPay-0; //期初应付
success: function (res) {
if (res) {
var moneyB = res.getAllMoney.toFixed(2) - 0;
var money = moneyA + moneyB;
var moneyBeginNeedGet = beginNeedGet - 0; //期初应收
var moneyBeginNeedPay = beginNeedPay - 0; //期初应付
money = (money + moneyBeginNeedPay - moneyBeginNeedGet).toFixed(2);
$(".first-total").text(money); //期初结存
}
},
error: function(){
$.messager.alert('提示','网络异常请稍后再试!','error');
error: function () {
$.messager.alert('提示', '网络异常请稍后再试!', 'error');
return;
}
});
}
},
error: function(){
$.messager.alert('提示','网络异常请稍后再试!','error');
error: function () {
$.messager.alert('提示', '网络异常请稍后再试!', 'error');
return;
}
})
......@@ -295,54 +290,54 @@
//显示期末合计
var searchEndTime = $("#searchEndTime").val(); //结束时间
$.ajax({
type:"post",
type: "post",
url: "<%=path %>/depotHead/findTotalPay.action",
dataType: "json",
async: false,
data: ({
supplierId: supplierId,
EndTime:searchEndTime,
EndTime: searchEndTime,
supType: "vendor"
}),
success: function(res){
if(res) {
var moneyA = res.getAllMoney.toFixed(2)-0;
success: function (res) {
if (res) {
var moneyA = res.getAllMoney.toFixed(2) - 0;
$.ajax({
type:"post",
type: "post",
url: "<%=path %>/accountHead/findTotalPay.action",
dataType: "json",
async: false,
data: ({
supplierId: supplierId,
EndTime:searchEndTime,
EndTime: searchEndTime,
supType: "vendor"
}),
success: function(res){
if(res) {
var moneyB = res.getAllMoney.toFixed(2)-0;
var money = moneyA+moneyB;
var moneyBeginNeedGet = beginNeedGet-0; //期初应收
var moneyBeginNeedPay = beginNeedPay-0; //期初应付
success: function (res) {
if (res) {
var moneyB = res.getAllMoney.toFixed(2) - 0;
var money = moneyA + moneyB;
var moneyBeginNeedGet = beginNeedGet - 0; //期初应收
var moneyBeginNeedPay = beginNeedPay - 0; //期初应付
money = (money + moneyBeginNeedPay - moneyBeginNeedGet).toFixed(2);
$(".last-total").text(money); //期末合计
}
},
error: function(){
$.messager.alert('提示','网络异常请稍后再试!','error');
error: function () {
$.messager.alert('提示', '网络异常请稍后再试!', 'error');
return;
}
});
}
},
error: function(){
$.messager.alert('提示','网络异常请稍后再试!','error');
error: function () {
$.messager.alert('提示', '网络异常请稍后再试!', 'error');
return;
}
})
}
},
error: function(){
$.messager.alert('提示','网络异常请稍后再试!','error');
error: function () {
$.messager.alert('提示', '网络异常请稍后再试!', 'error');
return;
}
});
......@@ -350,19 +345,20 @@
}
},
//此处添加错误处理
error:function() {
$.messager.alert('查询提示','查询数据后台异常,请稍后再试!','error');
error: function () {
$.messager.alert('查询提示', '查询数据后台异常,请稍后再试!', 'error');
return;
}
});
}
//报表打印
function print() {
$("#printBtn").off("click").on("click",function(){
$("#printBtn").off("click").on("click", function () {
var path = "<%=path %>";
CreateFormPage('打印报表', $('#tableData'), path);
});
}
</script>
</body>
</script>
</body>
</html>
\ No newline at end of file
<%@page import="com.jsh.util.Tools"%>
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@page import="com.jsh.util.Tools" %>
<%@ page language="java" pageEncoding="utf-8" %>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + path + "/";
String clientIp = Tools.getLocalIp(request);
%>
<!DOCTYPE html>
<html>
<head>
<head>
<title>个人资料</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<!-- 指定以IE8的方式来渲染 -->
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE8"/>
<link rel="shortcut icon" href="<%=path%>/images/favicon.ico" type="image/x-icon" />
<link rel="shortcut icon" href="<%=path%>/images/favicon.ico" type="image/x-icon"/>
<link rel="stylesheet" type="text/css" href="<%=path %>/js/easyui-1.3.5/themes/default/easyui.css"/>
<link rel="stylesheet" type="text/css" href="<%=path %>/js/easyui-1.3.5/themes/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;background-color:#EAF2FD; "
</head>
<body>
<div id="userDlg" class="easyui-panel" title="修改密码" style="height:370px;background-color:#EAF2FD; "
iconCls="icon-unlock" collapsible="true" closable="false">
<form id="passwordFM" method="post" novalidate>
<div class="fitem" style="padding:10px">
<label id="passwordLabel">原始密码&nbsp;&nbsp;</label>
<input type="password" name="orgpassword" id="orgpassword" class="easyui-validatebox" data-options="required:true,validType:'length[5,20]'" style="width: 230px;height: 20px" missingMessage="请输入原始密码"/>
<input type="password" name="orgpassword" id="orgpassword" class="easyui-validatebox"
data-options="required:true,validType:'length[5,20]'" style="width: 230px;height: 20px"
missingMessage="请输入原始密码"/>
<span id="orgTipMsg"></span>
</div>
<div class="fitem" style="padding:10px">
<label id="newPassword">重设密码&nbsp;&nbsp;</label>
<input type="password" name="password" id="password" class="easyui-validatebox" data-options="required:true,validType:'length[5,20]'" style="width: 230px;height: 20px" missingMessage="请填写新密码"/>
<input type="password" name="password" id="password" class="easyui-validatebox"
data-options="required:true,validType:'length[5,20]'" style="width: 230px;height: 20px"
missingMessage="请填写新密码"/>
<span id="orgTipMsg"></span>
</div>
<div class="fitem" style="padding:10px">
<label id="repasswordLabel">再输一遍&nbsp;&nbsp;</label>
<input type="password" name="repassword" id="repassword" class="easyui-validatebox" style="width: 230px;height: 20px" required="true" class="easyui-validatebox" validType="equals['#password']" missingMessage="请再次填写新密码" invalidMessage="两次密码输入不一致"/>
<input type="password" name="repassword" id="repassword" class="easyui-validatebox"
style="width: 230px;height: 20px" required="true" class="easyui-validatebox"
validType="equals['#password']" missingMessage="请再次填写新密码" invalidMessage="两次密码输入不一致"/>
<span id="tipMsg"></span>
</div>
<input type="hidden" name="clientIp" id="clientIp" value="<%=clientIp %>"/>
......@@ -46,75 +52,68 @@
<a href="javascript:void(0)" id="savepassword" class="easyui-linkbutton" iconCls="icon-save">保存</a>
<a href="javascript:void(0)" id="cancelpassword" class="easyui-linkbutton" iconCls="icon-redo">重置</a>
</div>
</div>
</div>
<script type="text/javascript">
<script type="text/javascript">
//初始化界面
$(function()
{
$(function () {
$("#orgpassword").focus();
$('#passwordFM').form({
onSubmit: function(){
onSubmit: function () {
return false;
}
});
$("#userDlg").panel({height:webH-3, width:webW+15});
$("#dlg-buttons").css("padding-left","65px");
$("#userDlg").panel({height: webH - 3, width: webW + 15});
$("#dlg-buttons").css("padding-left", "65px");
});
//重置
$("#cancelpassword").off("click").on("click",function(){
$("#cancelpassword").off("click").on("click", function () {
$("#orgpassword").val("");
$("#password").val("");
$("#repassword").val("");
});
//初始化键盘enter事件
$(document).keydown(function(event)
{
$(document).keydown(function (event) {
//兼容 IE和firefox 事件
var e = window.event || event;
var k = e.keyCode||e.which||e.charCode;
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"))
if (k == "13" && (obj.id == "orgpassword" || obj.id == "password" || obj.id == "repassword"))
$("#savepassword").click();
});
$("#savepassword").unbind().bind({
click:function()
{
if(!$('#passwordFM').form('validate'))
click: function () {
if (!$('#passwordFM').form('validate'))
return;
$.ajax({
type:"post",
type: "post",
url: "<%=path %>/user/updatePwd.action",
dataType: "json",
async : false,
async: false,
data: ({
userID : '${sessionScope.user.id}',
password : $.trim($("#password").val()),
orgpwd : $.trim($("#orgpassword").val())
userID: '${sessionScope.user.id}',
password: $.trim($("#password").val()),
orgpwd: $.trim($("#orgpassword").val())
}),
success: function (tipInfo)
{
if(1 == tipInfo)
success: function (tipInfo) {
if (1 == tipInfo)
//回退到上次访问页面
history.go(-1);
else if(2 == tipInfo)
{
else if (2 == tipInfo) {
$("#orgTipMsg").empty().append("<font color='red'>原始密码输入错误</font>");
return;
}
else
{
$.messager.alert('提示','更新密码异常,请稍后再试!','error');
else {
$.messager.alert('提示', '更新密码异常,请稍后再试!', 'error');
return;
}
},
//此处添加错误处理
error:function()
{
$.messager.alert('提示','更新密码异常,请稍后再试!','error');
error: function () {
$.messager.alert('提示', '更新密码异常,请稍后再试!', 'error');
return;
}
});
......@@ -123,16 +122,14 @@
//处理tip提示
$("#orgpassword").unbind().bind({
'click keyup':function()
{
'click keyup': function () {
$("#orgTipMsg").empty();
},
'blur':function()
{
'blur': function () {
$("#orgTipMsg").empty();
}
});
</script>
</body>
</script>
</body>
</html>
\ No newline at end of file
<%@page import="com.jsh.util.Tools"%>
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@page import="com.jsh.util.Tools" %>
<%@ page language="java" pageEncoding="utf-8" %>
<%
String path = request.getContextPath();
String clientIp = Tools.getLocalIp(request);
%>
<!DOCTYPE html>
<html>
<head>
<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" />
<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" />
<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 style="padding-bottom: 10px;">
</head>
<body>
<!-- 数据显示table -->
<div style="padding-bottom: 10px;">
<a id="btnOK" class="easyui-linkbutton" iconCls="icon-ok">保存</a>
</div>
<div>
</div>
<div>
<ul id="tt"></ul>
</div>
</div>
<script type="text/javascript">
<script type="text/javascript">
var url_id = getUrlParam('id'); //获取传值id(用户id)
var type="UserCustomer";
var type = "UserCustomer";
var url;//定义链接地址
function GetNode(ctype) {
var node = $('#tt').tree('getChecked');
......@@ -55,27 +55,30 @@
//cnodes = cnodes.substring(0, cnodes.length - 1);
pnodes = pnodes.substring(0, pnodes.length - 1);
if (ctype == 'child') { return cnodes; }
else { return pnodes };
if (ctype == 'child') {
return cnodes;
}
else {
return pnodes
}
;
};
$(function () {
$('#tt').tree({
url:'<%=path%>/supplier/findUserCustomer.action?UBType='+type+'&UBKeyId='+url_id,
animate:true,
checkbox:true
url: '<%=path%>/supplier/findUserCustomer.action?UBType=' + type + '&UBKeyId=' + url_id,
animate: true,
checkbox: true
});
$("#btnOK").click(
function() {
if(!checkUserDepot())
{
function () {
if (!checkUserDepot()) {
url = '<%=path%>/userBusiness/create.action';
}
else
{
else {
url = '<%=path%>/userBusiness/update.action';
}
......@@ -83,11 +86,12 @@
$.ajax({
type: "post",
url:url,
data: { Type: type, KeyId: url_id, Value: GetNode('child'),clientIp:'<%=clientIp %>'
url: url,
data: {
Type: type, KeyId: url_id, Value: GetNode('child'), clientIp: '<%=clientIp %>'
},
dataType: "json",
async : false,
async: false,
success: function (tipInfo) {
if (tipInfo) {
self.parent.$.colorbox.close();
......@@ -104,33 +108,30 @@
});
//检查记录是否存在
function checkUserDepot()
{
function checkUserDepot() {
//表示是否存在 true == 存在 false = 不存在
var flag = false;
//开始ajax名称检验,是否存在
$.ajax({
type:"post",
type: "post",
url: "<%=path %>/userBusiness/checkIsValueExist.action",
dataType: "json",
async : false,
async: false,
data: ({
Type : type,
KeyId : url_id
Type: type,
KeyId: url_id
}),
success: function (tipInfo)
{
success: function (tipInfo) {
flag = tipInfo;
},
//此处添加错误处理
error:function()
{
$.messager.alert('提示','检查用户对应功能是否存在异常,请稍后再试!','error');
error: function () {
$.messager.alert('提示', '检查用户对应功能是否存在异常,请稍后再试!', 'error');
return;
}
});
return flag;
}
</script>
</body>
</script>
</body>
</html>
\ No newline at end of file
<%@page import="com.jsh.util.Tools"%>
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@page import="com.jsh.util.Tools" %>
<%@ page language="java" pageEncoding="utf-8" %>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + path + "/";
String clientIp = Tools.getLocalIp(request);
%>
<!DOCTYPE html>
<html>
<head>
<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" />
<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" />
<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 style="padding-bottom: 10px;">
</head>
<body>
<!-- 数据显示table -->
<div style="padding-bottom: 10px;">
<a id="btnOK" class="easyui-linkbutton" iconCls="icon-ok">保存</a>
</div>
<div>
</div>
<div>
<ul id="tt"></ul>
</div>
</div>
<script type="text/javascript">
<script type="text/javascript">
var url_id = getUrlParam('id'); //获取传值id(用户id)
var type="UserDepot";
var type = "UserDepot";
var url;//定义链接地址
function GetNode(ctype) {
var node = $('#tt').tree('getChecked');
......@@ -56,27 +56,30 @@
//cnodes = cnodes.substring(0, cnodes.length - 1);
pnodes = pnodes.substring(0, pnodes.length - 1);
if (ctype == 'child') { return cnodes; }
else { return pnodes };
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
url: '<%=path%>/depot/findUserDepot.action?UBType=' + type + '&UBKeyId=' + url_id,
animate: true,
checkbox: true
});
$("#btnOK").click(
function() {
if(!checkUserDepot())
{
function () {
if (!checkUserDepot()) {
url = '<%=path%>/userBusiness/create.action';
}
else
{
else {
url = '<%=path%>/userBusiness/update.action';
}
......@@ -84,11 +87,12 @@
$.ajax({
type: "post",
url:url,
data: { Type: type, KeyId: url_id, Value: GetNode('child'),clientIp:'<%=clientIp %>'
url: url,
data: {
Type: type, KeyId: url_id, Value: GetNode('child'), clientIp: '<%=clientIp %>'
},
dataType: "json",
async : false,
async: false,
success: function (tipInfo) {
if (tipInfo) {
self.parent.$.colorbox.close();
......@@ -105,33 +109,30 @@
});
//检查记录是否存在
function checkUserDepot()
{
function checkUserDepot() {
//表示是否存在 true == 存在 false = 不存在
var flag = false;
//开始ajax名称检验,是否存在
$.ajax({
type:"post",
type: "post",
url: "<%=path %>/userBusiness/checkIsValueExist.action",
dataType: "json",
async : false,
async: false,
data: ({
Type : type,
KeyId : url_id
Type: type,
KeyId: url_id
}),
success: function (tipInfo)
{
success: function (tipInfo) {
flag = tipInfo;
},
//此处添加错误处理
error:function()
{
$.messager.alert('提示','检查用户对应功能是否存在异常,请稍后再试!','error');
error: function () {
$.messager.alert('提示', '检查用户对应功能是否存在异常,请稍后再试!', 'error');
return;
}
});
return flag;
}
</script>
</body>
</script>
</body>
</html>
\ No newline at end of file
<%@page import="com.jsh.util.Tools"%>
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@page import="com.jsh.util.Tools" %>
<%@ page language="java" pageEncoding="utf-8" %>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + path + "/";
String clientIp = Tools.getLocalIp(request);
%>
<!DOCTYPE html>
<html>
<head>
<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" />
<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" />
<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 style="padding-bottom: 10px;">
</head>
<body>
<!-- 数据显示table -->
<div style="padding-bottom: 10px;">
<a id="btnOK" class="easyui-linkbutton" iconCls="icon-ok">保存</a>
</div>
<div>
</div>
<div>
<ul id="tt"></ul>
</div>
</div>
<script type="text/javascript">
<script type="text/javascript">
var url_id = getUrlParam('id'); //获取传值id(用户id)
var type="UserRole";
var type = "UserRole";
var url;//定义链接地址
function GetNode(ctype) {
var node = $('#tt').tree('getChecked');
......@@ -56,27 +56,30 @@
//cnodes = cnodes.substring(0, cnodes.length - 1);
pnodes = pnodes.substring(0, pnodes.length - 1);
if (ctype == 'child') { return cnodes; }
else { return pnodes };
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
url: '<%=path%>/role/findUserRole.action?UBType=' + type + '&UBKeyId=' + url_id,
animate: true,
checkbox: true
});
$("#btnOK").click(
function() {
if(!checkUserRole())
{
function () {
if (!checkUserRole()) {
url = '<%=path%>/userBusiness/create.action';
}
else
{
else {
url = '<%=path%>/userBusiness/update.action';
}
......@@ -84,11 +87,12 @@
$.ajax({
type: "post",
url:url,
data: { Type: type, KeyId: url_id, Value: GetNode('child'),clientIp:'<%=clientIp %>'
url: url,
data: {
Type: type, KeyId: url_id, Value: GetNode('child'), clientIp: '<%=clientIp %>'
},
dataType: "json",
async : false,
async: false,
success: function (tipInfo) {
if (tipInfo) {
self.parent.$.colorbox.close();
......@@ -105,33 +109,30 @@
});
//检查记录是否存在
function checkUserRole()
{
function checkUserRole() {
//表示是否存在 true == 存在 false = 不存在
var flag = false;
//开始ajax名称检验,是否存在
$.ajax({
type:"post",
type: "post",
url: "<%=path %>/userBusiness/checkIsValueExist.action",
dataType: "json",
async : false,
async: false,
data: ({
Type : type,
KeyId : url_id
Type: type,
KeyId: url_id
}),
success: function (tipInfo)
{
success: function (tipInfo) {
flag = tipInfo;
},
//此处添加错误处理
error:function()
{
$.messager.alert('提示','检查用户对应功能是否存在异常,请稍后再试!','error');
error: function () {
$.messager.alert('提示', '检查用户对应功能是否存在异常,请稍后再试!', 'error');
return;
}
});
return flag;
}
</script>
</body>
</script>
</body>
</html>
\ No newline at end of file
<%@page import="com.jsh.util.Tools"%>
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@page import="com.jsh.util.Tools" %>
<%@ page language="java" pageEncoding="utf-8" %>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + path + "/";
String clientIp = Tools.getLocalIp(request);
%>
<!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>
<head>
<title>个人资料</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<!-- 指定以IE8的方式来渲染 -->
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE8"/>
<link rel="shortcut icon" href="<%=path%>/images/favicon.ico" type="image/x-icon" />
<link rel="shortcut icon" href="<%=path%>/images/favicon.ico" type="image/x-icon"/>
<link rel="stylesheet" type="text/css" href="<%=path %>/js/easyui-1.3.5/themes/default/easyui.css"/>
<link rel="stylesheet" type="text/css" href="<%=path %>/js/easyui-1.3.5/themes/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="当前位置:系统管理 &gt; 个人资料" collapsible="false" closable="false"/>
<div id="userDlg" class="easyui-panel" title="个人资料" style="height:400px;padding:10px 20px;background-color:#EAF2FD "
</head>
<body>
<div id="position" class="easyui-panel" title="当前位置:系统管理 &gt; 个人资料" collapsible="false" closable="false"/>
<div id="userDlg" class="easyui-panel" title="个人资料" style="height:400px;padding:10px 20px;background-color:#EAF2FD "
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">用户名称&nbsp;&nbsp;</label>
<input name="username" id="username" class="easyui-validatebox" data-options="required:true,validType:'length[2,30]'" value="${sessionScope.user.username}" style="width: 230px;height: 20px"/>
<input name="username" id="username" class="easyui-validatebox"
data-options="required:true,validType:'length[2,30]'" value="${sessionScope.user.username}"
style="width: 230px;height: 20px"/>
</div>
<div class="fitem" style="padding:5px">
<label id="departmentLabel">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</label>
<input name="department" id="department" style="width: 230px;height: 20px" value="${sessionScope.user.department}"/>
<input name="department" id="department" style="width: 230px;height: 20px"
value="${sessionScope.user.department}"/>
</div>
<div class="fitem" style="padding:5px">
<label id="positionLabel">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</label>
<input name="position" id="position" style="width: 230px;height: 20px" value="${sessionScope.user.position}"/>
<input name="position" id="position" style="width: 230px;height: 20px"
value="${sessionScope.user.position}"/>
</div>
<div class="fitem" style="padding:5px">
<label id="phonenumLabel">联系电话&nbsp;&nbsp;</label>
<input name="phonenum" id="phonenum" class="easyui-numberbox" style="width: 230px;height: 20px" value="${sessionScope.user.phonenum}"/>
<input name="phonenum" id="phonenum" class="easyui-numberbox" style="width: 230px;height: 20px"
value="${sessionScope.user.phonenum}"/>
</div>
<div class="fitem" style="padding:5px">
<label id="emailLabel">电子邮箱&nbsp;&nbsp;</label>
<input name="email" id="email" class="easyui-validatebox" validType="email" style="width: 230px;height: 20px" value="${sessionScope.user.email}"/>
<input name="email" id="email" class="easyui-validatebox" validType="email"
style="width: 230px;height: 20px" value="${sessionScope.user.email}"/>
</div>
<div class="fitem" style="padding:5px">
<label id="descriptionLabel">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</label>
<textarea name="description" id="description" rows="3" cols="3" style="width: 230px;font-size: 12px;">${sessionScope.user.description}</textarea>
<textarea name="description" id="description" rows="3" cols="3"
style="width: 230px;font-size: 12px;">${sessionScope.user.description}</textarea>
</div>
<input type="hidden" name="clientIp" id="clientIp" value="<%=clientIp %>"/>
<input type="hidden" name="userID" id="userID" value="${sessionScope.user.id}"/>
......@@ -58,22 +65,19 @@
<a href="javascript:void(0)" id="saveusername" class="easyui-linkbutton" iconCls="icon-save">修改</a>
<a href="javascript:void(0)" id="cancelusername" class="easyui-linkbutton" iconCls="icon-cancel">取消</a>
</div>
</div>
</div>
</div>
</div>
<script type="text/javascript">
<script type="text/javascript">
//初始化界面
$(function()
{
$(function () {
browserFit();
$("#userDlg").panel({height:webH-35});
$("#userDlg").panel({height: webH - 35});
});
//浏览器适配
function browserFit()
{
if(getOs()=='MSIE')
{
function browserFit() {
if (getOs() == 'MSIE') {
$("#usernameLabel").empty().append("用户名称&nbsp;&nbsp;");
$("#departmentLabel").empty().append("部&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;门&nbsp;&nbsp;");
$("#positionLabel").empty().append("职&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;位&nbsp;&nbsp;");
......@@ -81,8 +85,7 @@
$("#emailLabel").empty().append("电子邮箱&nbsp;&nbsp;");
$("#descriptionLabel").empty().append("描&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;述&nbsp;&nbsp;");
}
else
{
else {
$("#usernameLabel").empty().append("用户名称&nbsp;");
$("#departmentLabel").empty().append("部&nbsp;&nbsp;&nbsp;&nbsp;门&nbsp;");
$("#positionLabel").empty().append("职&nbsp;&nbsp;&nbsp;&nbsp;位&nbsp;");
......@@ -93,106 +96,93 @@
}
$("#cancelusername").unbind().bind({
click:function()
{
click: function () {
history.go(-1);
}
});
//初始化键盘enter事件
$(document).keydown(function(event)
{
$(document).keydown(function (event) {
//兼容 IE和firefox 事件
var e = window.event || event;
var k = e.keyCode||e.which||e.charCode;
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"))
{
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())
click: function () {
if (checkusernameName())
return;
var reg = /^([0-9])+$/;
var phonenum = $.trim($("#phonenum").val());
if(phonenum.length>0 && !reg.test(phonenum))
{
$.messager.alert('提示','电话号码只能是数字','info');
if (phonenum.length > 0 && !reg.test(phonenum)) {
$.messager.alert('提示', '电话号码只能是数字', 'info');
$("#phonenum").val("").focus();
return;
}
$('#usernameFM').form('submit',{
onSubmit: function()
{
$('#usernameFM').form('submit', {
onSubmit: function () {
return $(this).form('validate');
},
success: function(result)
{
var result = eval('('+result+')');
if (!result)
{
success: function (result) {
var result = eval('(' + result + ')');
if (!result) {
$.messager.show({
title: '错误提示',
msg: '保存用户信息失败,请稍后重试!'
});
}
else
{
$.messager.alert('提示','修改个人资料成功!','info');
else {
$.messager.alert('提示', '修改个人资料成功!', 'info');
}
}
});
}
});
//检查用户 名称是否存在 ++ 重名无法提示问题需要跟进
function checkusernameName()
{
function checkusernameName() {
var username = $.trim($("#username").val());
//表示是否存在 true == 存在 false = 不存在
var flag = false;
//开始ajax名称检验,不能重名
if(username.length > 0 && username != '${sessionScope.user.username}')
{
if (username.length > 0 && username != '${sessionScope.user.username}') {
$.ajax({
type:"post",
type: "post",
url: "<%=path %>/user/checkIsNameExist.action",
dataType: "json",
async : false,
async: false,
data: ({
userID : '${sessionScope.user.id}',
username : username
userID: '${sessionScope.user.id}',
username: username
}),
success: function (tipInfo)
{
success: function (tipInfo) {
flag = tipInfo;
if(tipInfo)
{
$.messager.alert('提示','用户名称已经存在','info');
if (tipInfo) {
$.messager.alert('提示', '用户名称已经存在', 'info');
//alert("用户名称已经存在");
//$("#username").val("");
return;
}
},
//此处添加错误处理
error:function()
{
$.messager.alert('提示','检查用户名称是否存在异常,请稍后再试!','error');
error: function () {
$.messager.alert('提示', '检查用户名称是否存在异常,请稍后再试!', 'error');
return;
}
});
}
return flag;
}
</script>
</body>
</script>
</body>
</html>
\ No newline at end of file
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment