更新前端
This commit is contained in:
622
erp_web/pages/manage/account.html
Normal file
622
erp_web/pages/manage/account.html
Normal file
@@ -0,0 +1,622 @@
|
||||
<!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="/images/favicon.ico" type="image/x-icon"/>
|
||||
<link rel="stylesheet" type="text/css" href="/js/easyui-1.3.5/themes/default/easyui.css"/>
|
||||
<link rel="stylesheet" type="text/css" href="/js/easyui-1.3.5/themes/icon.css"/>
|
||||
<link type="text/css" rel="stylesheet" href="/css/common.css"/>
|
||||
<script type="text/javascript" src="/js/jquery-1.8.0.min.js"></script>
|
||||
<script type="text/javascript" src="/js/easyui-1.3.5/jquery.easyui.min.js"></script>
|
||||
<script type="text/javascript" src="/js/easyui-1.3.5/locale/easyui-lang-zh_CN.js"></script>
|
||||
<script type="text/javascript" src="/js/common/outlook_in.js"></script>
|
||||
<script type="text/javascript" src="/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>
|
||||
</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>
|
||||
<div id="accountDetailListDlg" class="easyui-dialog" style="width:900px;height:500px;padding:10px 20px" closed="true"
|
||||
modal="true" collapsible="false" closable="true">
|
||||
<table id="accountTableData" style="top:50px;border-bottom-color:#FFFFFF"></table>
|
||||
</div>
|
||||
|
||||
<script type="text/javascript">
|
||||
//初始化界面
|
||||
$(function () {
|
||||
initTableData();
|
||||
ininPager();
|
||||
});
|
||||
|
||||
//初始化表格数据
|
||||
function initTableData() {
|
||||
$('#tableData').datagrid({
|
||||
height: heightInfo,
|
||||
nowrap: false,
|
||||
rownumbers: false,
|
||||
//动画效果
|
||||
animate: false,
|
||||
//选中单行
|
||||
singleSelect: true,
|
||||
collapsible: false,
|
||||
//交替出现背景
|
||||
striped: true,
|
||||
pagination: true,
|
||||
pageSize: initPageSize,
|
||||
pageList: initPageNum,
|
||||
columns: [[
|
||||
{field: 'id', width: 35, align: "center", checkbox: true},
|
||||
{title: '名称', field: 'name', width: 100},
|
||||
{title: '编号', field: 'serialno', width: 150, align: "center"},
|
||||
{title: '期初金额', field: 'initialamount', width: 100, align: "center"},
|
||||
{title: '当前余额', field: 'currentamount', width: 100, align: "center"},
|
||||
{
|
||||
title: '是否默认', field: 'isdefault', width: 100, align: "center",
|
||||
formatter: function (value, rec) {
|
||||
if (rec.isdefault) {
|
||||
return "<b style='color:green'>是</b>";
|
||||
}
|
||||
else {
|
||||
return "否";
|
||||
}
|
||||
}
|
||||
},
|
||||
{title: '备注', field: 'remark', width: 100},
|
||||
{
|
||||
title: '操作', field: 'op', align: "center", width: 210, 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;
|
||||
str += '<img src="/js/easyui-1.3.5/themes/icons/list.png" style="cursor: pointer;" onclick="showAccountInOutList(\'' + rowInfo + '\');"/> <a onclick="showAccountInOutList(\'' + rowInfo + '\');" style="text-decoration:none;color:black;" href="javascript:void(0)">流水</a> ';
|
||||
str += '<img src="/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="/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();
|
||||
}
|
||||
},
|
||||
{
|
||||
id: 'setAccountIsDefault',
|
||||
text: '设为默认',
|
||||
iconCls: 'icon-ok',
|
||||
handler: function () {
|
||||
setAccountIsDefault();
|
||||
}
|
||||
}
|
||||
],
|
||||
onLoadError: function () {
|
||||
$.messager.alert('页面加载提示', '页面加载异常,请稍后再试!', 'error');
|
||||
return;
|
||||
}
|
||||
});
|
||||
showAccountDetails(1, initPageSize);
|
||||
}
|
||||
|
||||
//初始化键盘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: "/account/" + accountTotalInfo[0] + "/delete",
|
||||
dataType: "json",
|
||||
success: function (res) {
|
||||
if(res && res.code == 200) {
|
||||
$("#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: "/account/batchDelete",
|
||||
dataType: "json",
|
||||
async: false,
|
||||
data: ({
|
||||
ids: ids
|
||||
}),
|
||||
success: function (res) {
|
||||
if(res && res.code === 200) {
|
||||
$("#searchBtn").click();
|
||||
$(":checkbox").attr("checked", false);
|
||||
} else {
|
||||
$.messager.alert('删除提示', '删除结算账户失败,请稍后再试!', 'error');
|
||||
}
|
||||
},
|
||||
//此处添加错误处理
|
||||
error: function () {
|
||||
$.messager.alert('删除提示', '删除结算账户异常,请稍后再试!', 'error');
|
||||
return;
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
//增加结算账户
|
||||
var url;
|
||||
var accountID = 0;
|
||||
//保存编辑前的名称
|
||||
var oldAccount = "";
|
||||
|
||||
function addAccount() {
|
||||
$('#accountDlg').dialog('open').dialog('setTitle', '<img src="/js/easyui-1.3.5/themes/icons/edit_add.png"/> 增加结算账户');
|
||||
$(".window-mask").css({width: webW, height: webH});
|
||||
$('#accountFM').form('clear');
|
||||
|
||||
var row = {};
|
||||
$('#accountFM').form('load', row);
|
||||
|
||||
$("#account").focus();
|
||||
oldAccount = "";
|
||||
accountID = 0;
|
||||
url = '/account/add';
|
||||
}
|
||||
|
||||
//设为默认操作事件
|
||||
function setAccountIsDefault() {
|
||||
var allRow = $('#tableData').datagrid('getRows');
|
||||
var row = $('#tableData').datagrid('getChecked');
|
||||
if (row.length == 0) {
|
||||
$.messager.alert('设置提示', '没有记录被选中!', 'info');
|
||||
return;
|
||||
}
|
||||
if (row.length > 0) {
|
||||
function setDefault(accountID, isDefault) {
|
||||
$.ajax({
|
||||
type: "post",
|
||||
url: "/account/updateAmountIsDefault.action",
|
||||
dataType: "json",
|
||||
async: false,
|
||||
data: ({
|
||||
AccountID: accountID,
|
||||
IsDefault: isDefault
|
||||
}),
|
||||
success: function (res) {
|
||||
if (res == "true" && isDefault) {
|
||||
|
||||
}
|
||||
else {
|
||||
|
||||
}
|
||||
},
|
||||
//此处添加错误处理
|
||||
error: function () {
|
||||
$.messager.alert('删除提示', '删除结算账户异常,请稍后再试!', 'error');
|
||||
return;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
if (row.length == 1) {
|
||||
setDefault(row[0].id, true); //设置默认
|
||||
for (var i = 0; i < allRow.length; i++) {
|
||||
if (allRow[i].id != row[0].id) {
|
||||
setDefault(allRow[i].id, false);
|
||||
}
|
||||
}
|
||||
setTimeout(function () {
|
||||
$("#searchBtn").click();
|
||||
}, 1000);
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
//保存结算账户
|
||||
$("#saveAccount").off("click").on("click", function () {
|
||||
if (checkAccountName()) {
|
||||
return;
|
||||
}
|
||||
$.ajax({
|
||||
url: url,
|
||||
type: "post",
|
||||
dataType: "json",
|
||||
data: ({
|
||||
info: JSON.stringify($("#accountFM").serializeObject())
|
||||
}),
|
||||
success: function(res) {
|
||||
if(res && res.code === 200) {
|
||||
$('#accountDlg').dialog('close');
|
||||
//加载完以后重新初始化
|
||||
var opts = $("#tableData").datagrid('options');
|
||||
showAccountDetails(opts.pageNumber, opts.pageSize);
|
||||
}
|
||||
},
|
||||
//此处添加错误处理
|
||||
error: function () {
|
||||
$.messager.alert('提示', '保存结算账户异常,请稍后再试!', 'error');
|
||||
return;
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
//编辑结算账户
|
||||
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]
|
||||
};
|
||||
oldAccount = accountInfo[1];
|
||||
$('#accountDlg').dialog('open').dialog('setTitle', '<img src="/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 = '/account/update?id=' + accountInfo[0];
|
||||
}
|
||||
|
||||
//检查结算账户 名称是否存在 ++ 重名无法提示问题需要跟进
|
||||
function checkAccountName() {
|
||||
var accountName = $.trim($("#name").val());
|
||||
//表示是否存在 true == 存在 false = 不存在
|
||||
var flag = false;
|
||||
//开始ajax名称检验,不能重名
|
||||
if (accountName.length > 0 && (oldAccount.length == 0 || accountName != oldAccount)) {
|
||||
$.ajax({
|
||||
type: "get",
|
||||
url: "/account/checkIsNameExist",
|
||||
dataType: "json",
|
||||
async: false,
|
||||
data: ({
|
||||
id: accountID,
|
||||
name: accountName
|
||||
}),
|
||||
success: function (res) {
|
||||
if(res && res.code === 200) {
|
||||
if(res.data && res.data.status) {
|
||||
flag = res.data.status;
|
||||
if (flag) {
|
||||
$.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) {
|
||||
var name = $.trim($("#searchName").val());
|
||||
var serialNo = $.trim($("#searchSerialNo").val());
|
||||
var remark = $.trim($("#searchRemark").val());
|
||||
$.ajax({
|
||||
type: "get",
|
||||
url: "/account/list",
|
||||
dataType: "json",
|
||||
data: ({
|
||||
search: JSON.stringify({
|
||||
name: name,
|
||||
serialNo: serialNo,
|
||||
remark: remark
|
||||
}),
|
||||
currentPage: pageNo,
|
||||
pageSize: pageSize
|
||||
}),
|
||||
success: function (res) {
|
||||
if(res && res.code === 200){
|
||||
if(res.data && res.data.page) {
|
||||
$("#tableData").datagrid('loadData', res.data.page);
|
||||
}
|
||||
}
|
||||
},
|
||||
//此处添加错误处理
|
||||
error: function () {
|
||||
$.messager.alert('查询提示', '查询数据后台异常,请稍后再试!', 'error');
|
||||
return;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function showAccountInOutList(accountInfo) {
|
||||
var info = accountInfo.split("AaBb");
|
||||
var accountId = info[0];
|
||||
var initialAmount = info[3];
|
||||
$('#accountDetailListDlg').dialog('open').dialog('setTitle', '<img src="/js/easyui-1.3.5/themes/icons/pencil.png"/> 查看账户流水');
|
||||
$(".window-mask").css({width: webW, height: webH});
|
||||
initAccountDetailData(accountId);
|
||||
getAccountInOutList(accountId, initialAmount, 1, initPageSize);
|
||||
ininAccountDetailPager(accountId, initialAmount);
|
||||
}
|
||||
|
||||
//初始化表格数据
|
||||
function initAccountDetailData(accountId) {
|
||||
$('#accountTableData').datagrid({
|
||||
height: heightInfo,
|
||||
nowrap: false,
|
||||
rownumbers: false,
|
||||
//动画效果
|
||||
animate: false,
|
||||
//选中单行
|
||||
singleSelect: true,
|
||||
collapsible: false,
|
||||
selectOnCheck: false,
|
||||
//单击行是否选中
|
||||
checkOnSelect: false,
|
||||
//交替出现背景
|
||||
striped: true,
|
||||
pagination: true,
|
||||
pageSize: initPageSize,
|
||||
pageList: initPageNum,
|
||||
columns: [[
|
||||
{
|
||||
title: '单据编号', field: 'number', width: 150,
|
||||
formatter: function (value, row) {
|
||||
return "<a class='n-link' onclick=\"newTab('" + row.number + "','../materials/bill_detail.html?n=" + row.number + "&type=" + row.type + "','')\">"
|
||||
+ row.number + "</a>";
|
||||
}
|
||||
},
|
||||
{title: '类型', field: 'type', width: 100},
|
||||
{title: '单位信息', field: 'supplierName', width: 150},
|
||||
{
|
||||
title: '金额', field: 'changeAmount', width: 80,
|
||||
formatter: function (value, row) {
|
||||
if (row.aList && row.amList) {
|
||||
var aListArr = row.aList.toString().split(",");
|
||||
var amListArr = row.amList.toString().split(",");
|
||||
var res = "";
|
||||
for (var i = 0; i < aListArr.length; i++) {
|
||||
if (aListArr[i] == accountId) {
|
||||
res = amListArr[i];
|
||||
}
|
||||
}
|
||||
return res + "[多账户]";
|
||||
}
|
||||
else {
|
||||
return row.changeAmount;
|
||||
}
|
||||
}
|
||||
},
|
||||
{title: '余额', field: 'balance', width: 80},
|
||||
{title: '入库出库日期', field: 'operTime', width: 180}
|
||||
]],
|
||||
onLoadError: function () {
|
||||
$.messager.alert('页面加载提示', '页面加载异常,请稍后再试!', 'error');
|
||||
return;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
//分页信息处理
|
||||
function ininAccountDetailPager(accountId, initialAmount) {
|
||||
try {
|
||||
var opts = $("#accountTableData").datagrid('options');
|
||||
var pager = $("#accountTableData").datagrid('getPager');
|
||||
pager.pagination({
|
||||
onSelectPage: function (pageNum, pageSize) {
|
||||
opts.pageNumber = pageNum;
|
||||
opts.pageSize = pageSize;
|
||||
pager.pagination('refresh', {
|
||||
pageNumber: pageNum,
|
||||
pageSize: pageSize
|
||||
});
|
||||
getAccountInOutList(accountId, initialAmount, pageNum, pageSize);
|
||||
}
|
||||
});
|
||||
}
|
||||
catch (e) {
|
||||
$.messager.alert('异常处理提示', "分页信息异常 : " + e.name + ": " + e.message, 'error');
|
||||
}
|
||||
}
|
||||
|
||||
function getAccountInOutList(accountId, initialAmount, pageNo, pageSize) {
|
||||
$.ajax({
|
||||
type: "get",
|
||||
url: "/account/findAccountInOutList",
|
||||
dataType: "json",
|
||||
data: ({
|
||||
currentPage: pageNo,
|
||||
pageSize: pageSize,
|
||||
accountId: accountId,
|
||||
initialAmount: initialAmount
|
||||
}),
|
||||
success: function (res) {
|
||||
if(res && res.code === 200) {
|
||||
$("#accountTableData").datagrid('loadData', res.data);
|
||||
}
|
||||
},
|
||||
//此处添加错误处理
|
||||
error: function () {
|
||||
$.messager.alert('查询提示', '查询数据后台异常,请稍后再试!', 'error');
|
||||
return;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
//重置按钮
|
||||
$("#searchResetBtn").unbind().bind({
|
||||
click: function () {
|
||||
$("#searchName").val("");
|
||||
$("#searchSerialNo").val("");
|
||||
$("#searchRemark").val("");
|
||||
//加载完以后重新初始化
|
||||
$("#searchBtn").click();
|
||||
}
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
520
erp_web/pages/manage/app.html
Normal file
520
erp_web/pages/manage/app.html
Normal file
@@ -0,0 +1,520 @@
|
||||
<!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="/images/favicon.ico" type="image/x-icon"/>
|
||||
<link rel="stylesheet" type="text/css" href="/js/easyui-1.3.5/themes/default/easyui.css"/>
|
||||
<link rel="stylesheet" type="text/css" href="/js/easyui-1.3.5/themes/icon.css"/>
|
||||
<link type="text/css" rel="stylesheet" href="/css/common.css"/>
|
||||
<link href="/js/fileUploadQT/css/iconfont.css" rel="stylesheet" type="text/css"/>
|
||||
<link href="/js/fileUploadQT/css/fileUpload.css" rel="stylesheet" type="text/css"/>
|
||||
<script type="text/javascript" src="/js/jquery-1.8.0.min.js"></script>
|
||||
<script type="text/javascript" src="/js/easyui-1.3.5/jquery.easyui.min.js"></script>
|
||||
<script type="text/javascript" src="/js/easyui-1.3.5/locale/easyui-lang-zh_CN.js"></script>
|
||||
<script src="/js/fileUploadQT/js/fileUpload.js"></script>
|
||||
<script type="text/javascript" src="/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:600px;padding:10px 20px;top: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 style="width: 50px;height: 20px">代号</td>
|
||||
<td style="padding:1px"><input name="Number" id="Number" class="easyui-textbox" style="width: 150px;height: 20px"/></td>
|
||||
<td style="width: 50px;height: 20px">名称</td>
|
||||
<td style="padding:1px"><input name="Name" id="Name" class="easyui-validatebox"
|
||||
data-options="required:true,validType:'length[2,30]'" style="width: 150px;height: 20px"/></td>
|
||||
<td style="width: 50px;height: 20px">拉伸</td>
|
||||
<td style="padding:1px"><input name="ReSize" id="ReSize" type="checkbox" style="width: 50px;height: 20px"/></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>类型</td>
|
||||
<td style="padding:1px"><input name="Type" id="Type" class="easyui-textbox" style="width: 150px;height: 20px"/></td>
|
||||
<td>链接</td>
|
||||
<td style="padding:1px"><input name="URL" id="URL" class="easyui-textbox" style="width: 150px;height: 20px"/></td>
|
||||
<td>最大化</td>
|
||||
<td style="padding:1px"><input name="OpenMax" id="OpenMax" type="checkbox" style="width: 50px;height: 20px"/></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>宽度</td>
|
||||
<td style="padding:1px"><input name="Width" id="Width" class="easyui-textbox" style="width: 150px;height: 20px"/></td>
|
||||
<td>高度</td>
|
||||
<td style="padding:1px"><input name="Height" id="Height" class="easyui-textbox" style="width: 150px;height: 20px"/></td>
|
||||
<td>Flash</td>
|
||||
<td style="padding:1px"><input name="Flash" id="Flash" type="checkbox" style="width: 50px;height: 20px"/></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>排序号</td>
|
||||
<td style="padding:1px"><input name="Sort" id="Sort" class="easyui-textbox" style="width: 150px;height: 20px"/></td>
|
||||
<td>种类</td>
|
||||
<td style="padding:1px"><input name="ZL" id="ZL" class="easyui-textbox" style="width: 150px;height: 20px"/></td>
|
||||
<td>启用</td>
|
||||
<td style="padding:1px"><input name="Enabled" id="Enabled" type="checkbox" style="width: 50px;height: 20px"/></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>备注</td>
|
||||
<td style="padding:1px" colspan="5"><input name="Remark" id="Remark" class="easyui-textbox" style="width: 480px;height: 20px"/></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>图标</td>
|
||||
<td style="padding:1px" colspan="5">
|
||||
<div id="Icon" class="fileUploadContent"></div>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</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,
|
||||
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, formatter: function (value) {
|
||||
return value ? "开" : "关";
|
||||
}
|
||||
},
|
||||
{
|
||||
title: '最大化', field: 'openmax', width: 50, formatter: function (value) {
|
||||
return value ? "开" : "关";
|
||||
}
|
||||
},
|
||||
{
|
||||
title: 'Flash', field: 'flash', width: 50, formatter: function (value) {
|
||||
return value ? "开" : "关";
|
||||
}
|
||||
},
|
||||
{title: '种类', field: 'zl', width: 50},
|
||||
{title: '排序号', field: 'sort', width: 50},
|
||||
{title: '备注', field: 'remark', width: 50},
|
||||
{
|
||||
title: '启用', field: 'enabled', width: 50, formatter: function (value) {
|
||||
return value ? "开" : "关";
|
||||
}
|
||||
},
|
||||
{
|
||||
title: '操作', field: 'op', align: "center", width: 130, formatter: function (value, rec) {
|
||||
var str = '';
|
||||
var 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;
|
||||
str += '<img src="/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="/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;
|
||||
}
|
||||
});
|
||||
showAppDetails(1, initPageSize);
|
||||
}
|
||||
|
||||
//初始化键盘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: "/app/" + appID + "/delete",
|
||||
dataType: "json",
|
||||
success: function (res) {
|
||||
if(res && res.code == 200) {
|
||||
$("#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;
|
||||
}
|
||||
ids += row[i].id + ",";
|
||||
}
|
||||
$.ajax({
|
||||
type: "post",
|
||||
url: "/app/batchDelete",
|
||||
dataType: "json",
|
||||
async: false,
|
||||
data: ({
|
||||
ids: ids
|
||||
}),
|
||||
success: function (res) {
|
||||
if(res && res.code === 200) {
|
||||
$("#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() {
|
||||
$('#appFM').form('clear');
|
||||
$('#appDlg').dialog('open').dialog('setTitle', '<img src="/js/easyui-1.3.5/themes/icons/edit_add.png"/> 增加应用信息');
|
||||
$(".window-mask").css({width: webW, height: webH});
|
||||
$("#name").val("").focus();
|
||||
|
||||
orgApp = "";
|
||||
appID = 0;
|
||||
url = '/app/add';
|
||||
$("#Icon").empty();//清除上传控件数据
|
||||
$(".fileUploadContent").initUpload({
|
||||
"uploadUrl": "/app/uploadImg.action",//上传文件信息地址
|
||||
"progressUrl": "#",//获取进度信息地址,可选,注意需要返回的data格式如下({bytesRead: 102516060, contentLength: 102516060, items: 1, percent: 100, startTime: 1489223136317, useTime: 2767})
|
||||
//"showSummerProgress":false,//总进度条,默认限制
|
||||
//"size":350,//文件大小限制,单位kb,默认不限制
|
||||
"maxFileNumber": 1,//文件个数限制,为整数
|
||||
//"filelSavePath":"",//文件上传地址,后台设置的根目录
|
||||
//"beforeUpload":beforeUploadFun,//在上传前执行的函数
|
||||
//"onUpload":onUploadFun, //在上传后执行的函数
|
||||
autoCommit: true, //文件是否自动上传
|
||||
"fileType": ['png', 'jpg']//文件类型限制,默认不限制,注意写的是文件后缀
|
||||
});
|
||||
}
|
||||
|
||||
//保存信息
|
||||
$("#saveApp").off("click").on("click", function () {
|
||||
if (checkAppName()) {
|
||||
return;
|
||||
}
|
||||
$.ajax({
|
||||
url: url,
|
||||
type: "post",
|
||||
dataType: "json",
|
||||
fileElementId: 'Icon',
|
||||
data: ({
|
||||
info: JSON.stringify($("#appFM").serializeObject())
|
||||
}),
|
||||
success: function(res) {
|
||||
if(res && res.code === 200) {
|
||||
$('#appDlg').dialog('close');
|
||||
//加载完以后重新初始化
|
||||
var opts = $("#tableData").datagrid('options');
|
||||
showAppDetails(opts.pageNumber, opts.pageSize);
|
||||
} else {
|
||||
$.messager.alert('提示', '保存应用信息异常,请稍后再试!', 'error');
|
||||
return;
|
||||
}
|
||||
},
|
||||
//此处添加错误处理
|
||||
error: function () {
|
||||
$.messager.alert('提示', '保存应用信息异常,请稍后再试!', 'error');
|
||||
return;
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
//编辑信息
|
||||
function editApp(appTotalInfo) {
|
||||
var appInfo = appTotalInfo.split("AaBb");
|
||||
$("#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="/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 = '/depot/update?id=' + 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: "get",
|
||||
url: "/app/checkIsNameExist",
|
||||
dataType: "json",
|
||||
async: false,
|
||||
data: ({
|
||||
id: appID,
|
||||
name: name
|
||||
}),
|
||||
success: function (res) {
|
||||
if(res && res.code === 200) {
|
||||
if(res.data && res.data.status) {
|
||||
flag = res.data.status;
|
||||
if (flag) {
|
||||
$.messager.alert('提示', '应用名称已经存在', 'info');
|
||||
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) {
|
||||
var searchName = $.trim($("#searchName").val());
|
||||
var searchType = $.trim($("#searchType").val());
|
||||
$.ajax({
|
||||
type: "get",
|
||||
url: "/app/list",
|
||||
dataType: "json",
|
||||
data: ({
|
||||
search: JSON.stringify({
|
||||
name: searchName,
|
||||
type: searchType
|
||||
}),
|
||||
currentPage: pageNo,
|
||||
pageSize: pageSize
|
||||
}),
|
||||
success: function (res) {
|
||||
if(res && res.code === 200){
|
||||
if(res.data && res.data.page) {
|
||||
$("#tableData").datagrid('loadData', res.data.page);
|
||||
}
|
||||
}
|
||||
},
|
||||
//此处添加错误处理
|
||||
error: function () {
|
||||
$.messager.alert('查询提示', '查询数据后台异常,请稍后再试!', 'error');
|
||||
return;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
//重置按钮
|
||||
$("#searchResetBtn").unbind().bind({
|
||||
click: function () {
|
||||
$("#searchName").val("");
|
||||
$("#searchType").val("");
|
||||
|
||||
//加载完以后重新初始化
|
||||
$("#searchBtn").click();
|
||||
}
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
187
erp_web/pages/manage/customer.html
Normal file
187
erp_web/pages/manage/customer.html
Normal file
@@ -0,0 +1,187 @@
|
||||
<!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="/images/favicon.ico" type="image/x-icon"/>
|
||||
<link rel="stylesheet" type="text/css" href="/js/easyui-1.3.5/themes/default/easyui.css"/>
|
||||
<link rel="stylesheet" type="text/css" href="/js/easyui-1.3.5/themes/icon.css"/>
|
||||
<link type="text/css" rel="stylesheet" href="/css/common.css"/>
|
||||
<script type="text/javascript" src="/js/jquery-1.8.0.min.js"></script>
|
||||
<script type="text/javascript" src="/js/easyui-1.3.5/jquery.easyui.min.js"></script>
|
||||
<script type="text/javascript" src="/js/easyui-1.3.5/locale/easyui-lang-zh_CN.js"></script>
|
||||
<script type="text/javascript" src="/js/common/common.js"></script>
|
||||
<script src="/js/pages/manage/supplier.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:100px;"/>
|
||||
</td>
|
||||
<td> </td>
|
||||
<td>手机号码:</td>
|
||||
<td>
|
||||
<input type="text" name="searchTelephone" id="searchTelephone" style="width:100px;"/>
|
||||
</td>
|
||||
<td> </td>
|
||||
<td>联系电话:</td>
|
||||
<td>
|
||||
<input type="text" name="searchPhonenum" id="searchPhonenum" style="width:100px;"/>
|
||||
</td>
|
||||
<td> </td>
|
||||
<td id="searchDescLabel">备 注:</td>
|
||||
<td>
|
||||
<input type="text" name="searchDesc" id="searchDesc" style="width:100px;"/>
|
||||
</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:580px;padding:10px 20px"
|
||||
closed="true" buttons="#dlg-buttons" modal="true" collapsible="false" closable="true">
|
||||
<form id="supplierFM">
|
||||
<table>
|
||||
<tr>
|
||||
<td style="width: 80px;height: 20px">名称</td>
|
||||
<td style="width: 180px;padding:1px">
|
||||
<input name="supplier" id="supplier" class="easyui-validatebox"
|
||||
data-options="required:true,validType:'length[2,30]'" style="width: 160px;height: 20px"/>
|
||||
</td>
|
||||
<td style="width: 60px;height: 20px">联系人</td>
|
||||
<td style="width:180px;padding:1px;">
|
||||
<input name="contacts" id="contacts" class="easyui-validatebox" style="width: 160px;height: 20px"/>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>手机号码</td>
|
||||
<td style="padding:1px;">
|
||||
<input name="telephone" id="telephone" class="easyui-validatebox"
|
||||
style="width: 160px;height: 20px"/>
|
||||
</td>
|
||||
<td>电子邮箱</td>
|
||||
<td style="padding:1px">
|
||||
<input name="email" id="email" class="easyui-validatebox" validType="email"
|
||||
style="width: 160px;height: 20px"/>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>联系电话</td>
|
||||
<td style="padding:1px;">
|
||||
<input name="phonenum" id="phonenum" class="easyui-validatebox" style="width: 160px;height: 20px"/>
|
||||
</td>
|
||||
<td>传真</td>
|
||||
<td style="padding:1px">
|
||||
<input name="fax" id="fax" class="easyui-validatebox" style="width: 160px;height: 20px"/>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>期初应收</td>
|
||||
<td style="padding:1px">
|
||||
<input name="BeginNeedGet" id="BeginNeedGet" type="text" class="easyui-numberbox"
|
||||
data-options="min:0,precision:2" style="width: 160px;height: 20px"/>
|
||||
</td>
|
||||
<td>期初应付</td>
|
||||
<td style="padding:1px">
|
||||
<input name="BeginNeedPay" id="BeginNeedPay" type="text" class="easyui-numberbox"
|
||||
data-options="min:0,precision:2" style="width: 160px;height: 20px"/>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>累计应收</td>
|
||||
<td style="padding:1px">
|
||||
<input name="AllNeedGet" id="AllNeedGet" type="text" style="width: 160px;height: 20px"
|
||||
readonly="readonly"/>
|
||||
</td>
|
||||
<td>累计应付</td>
|
||||
<td style="padding:1px">
|
||||
<input name="AllNeedPay" id="AllNeedPay" type="text" style="width: 160px;height: 20px"
|
||||
readonly="readonly"/>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>纳税人识别号</td>
|
||||
<td style="padding:1px">
|
||||
<input name="taxNum" id="taxNum" class="easyui-validatebox" style="width: 160px;height: 20px"/>
|
||||
</td>
|
||||
<td>税率</td>
|
||||
<td style="padding:1px">
|
||||
<input name="taxRate" id="taxRate" class="easyui-validatebox" style="width: 160px;height: 20px"/>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>开户行</td>
|
||||
<td style="padding:1px">
|
||||
<input name="bankName" id="bankName" class="easyui-validatebox" style="width: 160px;height: 20px"/>
|
||||
</td>
|
||||
<td>账号</td>
|
||||
<td style="padding:1px">
|
||||
<input name="accountNumber" id="accountNumber" class="easyui-validatebox"
|
||||
style="width: 160px;height: 20px"/>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>地址</td>
|
||||
<td style="padding:1px" colspan="3">
|
||||
<input name="address" id="address" class="easyui-validatebox" style="width: 408px;height: 20px"/>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>备注</td>
|
||||
<td style="padding:1px" colspan="3">
|
||||
<textarea name="description" id="description" rows="2" cols="2" style="width: 408px;"></textarea>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</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>
|
||||
|
||||
<!-- 导入excel表格 -->
|
||||
<div id="importExcelDlg" style="padding:10px 20px">
|
||||
<form id="importExcelFM" method="post" enctype="multipart/form-data"
|
||||
action="/supplier/importExcelCustomer.action">
|
||||
<div class="fitem" style="padding:5px">
|
||||
<label>文件名称 </label>
|
||||
<input name="supplierFile" id="supplierFile" type="file" style="width: 230px;height: 20px"/>
|
||||
</div>
|
||||
<div class="fitem" style="padding:5px">
|
||||
<label><b>导入注意</b> </label><span>(预收款、期初应收、期初应付、税率均为数值且要大于0;另外期初应收、期初应付不能同时输入)</span>
|
||||
</div>
|
||||
<div class="fitem" style="padding:5px;display: none;">
|
||||
<label>是否审查 </label>
|
||||
<select id="isCheck" name="isCheck" style="width: 230px;height: 20px">
|
||||
<option value="0">是</option>
|
||||
<option value="1" selected="selected">否</option>
|
||||
</select>
|
||||
</div>
|
||||
<input type="hidden" name="clientIp" id="clientIp" value="<%=clientIp %>"/>
|
||||
<div id="dlg-buttons5">
|
||||
<a href="javascript:void(0)" id="saveimport" class="easyui-linkbutton" iconCls="icon-ok">导入</a>
|
||||
<a href="javascript:void(0)" id="cancelimport" class="easyui-linkbutton" iconCls="icon-cancel"
|
||||
onclick="javascript:$('#importExcelDlg').dialog('close')">取消</a>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
469
erp_web/pages/manage/depot.html
Normal file
469
erp_web/pages/manage/depot.html
Normal file
@@ -0,0 +1,469 @@
|
||||
<!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="/images/favicon.ico" type="image/x-icon"/>
|
||||
<link rel="stylesheet" type="text/css" href="/js/easyui-1.3.5/themes/default/easyui.css"/>
|
||||
<link rel="stylesheet" type="text/css" href="/js/easyui-1.3.5/themes/icon.css"/>
|
||||
<link type="text/css" rel="stylesheet" href="/css/common.css"/>
|
||||
<script type="text/javascript" src="/js/jquery-1.8.0.min.js"></script>
|
||||
<script type="text/javascript" src="/js/easyui-1.3.5/jquery.easyui.min.js"></script>
|
||||
<script type="text/javascript" src="/js/easyui-1.3.5/locale/easyui-lang-zh_CN.js"></script>
|
||||
<script type="text/javascript" src="/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 id="searchRemarkLabel">描述:</td>
|
||||
<td>
|
||||
<input type="text" name="searchRemark" id="searchRemark" style="width:100px;"/>
|
||||
</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="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>仓库名称</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>仓库地址</td>
|
||||
<td style="padding:5px">
|
||||
<input name="address" id="address" class="easyui-validatebox"
|
||||
data-options="validType:'length[2,30]'" style="width: 230px;height: 20px"/>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>仓储费</td>
|
||||
<td style="padding:5px">
|
||||
<input name="warehousing" id="warehousing" class="easyui-numberbox" data-options="min:0,precision:2"
|
||||
style="width: 175px;height: 20px"/> 元/天/KG
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>搬运费</td>
|
||||
<td style="padding:5px">
|
||||
<input name="truckage" id="truckage" class="easyui-numberbox" placeholder="如上下搬运20元,则填写10元"
|
||||
data-options="min:0,precision:2" style="width: 215px;height: 20px"/> 元
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>排序</td>
|
||||
<td style="padding:5px">
|
||||
<input name="sort" id="sort" class="easyui-textbox" style="width: 230px;height: 20px"/>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>描述</td>
|
||||
<td style="padding:5px">
|
||||
<textarea name="remark" id="remark" rows="2" cols="2" style="width: 230px;"></textarea>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</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();
|
||||
});
|
||||
|
||||
//防止表单提交重复
|
||||
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,
|
||||
pagination: true,
|
||||
//交替出现背景
|
||||
striped: true,
|
||||
//loadFilter: pagerFilter,
|
||||
pageSize: initPageSize,
|
||||
pageList: initPageNum,
|
||||
columns: [[
|
||||
{field: 'id', width: 35, align: "center", checkbox: true},
|
||||
{
|
||||
title: '操作', field: 'op', align: "center", width: 60,
|
||||
formatter: function (value, rec) {
|
||||
var str = '';
|
||||
var rowInfo = rec.id + 'AaBb' + rec.name + 'AaBb' + rec.sort + 'AaBb' + rec.remark + 'AaBb'
|
||||
+ rec.address + 'AaBb' + rec.warehousing + 'AaBb' + rec.truckage;
|
||||
str += '<img title="编辑" src="/js/easyui-1.3.5/themes/icons/pencil.png" style="cursor: pointer;" onclick="editDepot(\'' + rowInfo + '\');"/> ';
|
||||
str += '<img title="删除" src="/js/easyui-1.3.5/themes/icons/edit_remove.png" style="cursor: pointer;" onclick="deleteDepot(' + rec.id + ');"/>';
|
||||
return str;
|
||||
}
|
||||
},
|
||||
{title: '仓库名称', field: 'name', width: 200},
|
||||
{title: '仓库地址', field: 'address', width: 200},
|
||||
{title: '仓储费', field: 'warehousing', width: 60},
|
||||
{title: '搬运费', field: 'truckage', width: 60},
|
||||
{title: '排序', field: 'sort', width: 60},
|
||||
{title: '描述', field: 'remark', width: 120}
|
||||
]],
|
||||
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;
|
||||
}
|
||||
});
|
||||
showDepotDetails(1, initPageSize);
|
||||
}
|
||||
|
||||
//初始化键盘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: "/depot/" + depotID + "/delete",
|
||||
dataType: "json",
|
||||
success: function (res) {
|
||||
if(res && res.code == 200) {
|
||||
$("#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;
|
||||
}
|
||||
ids += row[i].id + ",";
|
||||
}
|
||||
$.ajax({
|
||||
type: "post",
|
||||
url: "/depot/batchDelete",
|
||||
dataType: "json",
|
||||
async: false,
|
||||
data: ({
|
||||
ids: ids
|
||||
}),
|
||||
success: function (res) {
|
||||
if(res && res.code === 200) {
|
||||
$("#searchBtn").click();
|
||||
$(":checkbox").attr("checked", false);
|
||||
} else {
|
||||
$.messager.alert('删除提示', '删除仓库信息失败,请稍后再试!', 'error');
|
||||
}
|
||||
},
|
||||
//此处添加错误处理
|
||||
error: function () {
|
||||
$.messager.alert('删除提示', '删除仓库信息异常,请稍后再试!', 'error');
|
||||
return;
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
//增加
|
||||
var url;
|
||||
var depotID = 0;
|
||||
//保存编辑前的名称
|
||||
var oldDepot = "";
|
||||
|
||||
function addDepot() {
|
||||
$('#depotDlg').dialog('open').dialog('setTitle', '<img src="/js/easyui-1.3.5/themes/icons/edit_add.png"/> 增加仓库信息');
|
||||
$(".window-mask").css({width: webW, height: webH});
|
||||
$('#depotFM').form('clear');
|
||||
$("#name").focus();
|
||||
|
||||
oldDepot = "";
|
||||
depotID = 0;
|
||||
url = '/depot/add';
|
||||
}
|
||||
|
||||
//保存信息
|
||||
$("#saveDepot").off("click").on("click", function () {
|
||||
if (checkDepotName()) {
|
||||
return;
|
||||
}
|
||||
$.ajax({
|
||||
url: url,
|
||||
type: "post",
|
||||
dataType: "json",
|
||||
data: ({
|
||||
info: JSON.stringify($("#depotFM").serializeObject())
|
||||
}),
|
||||
success: function(res) {
|
||||
if(res && res.code === 200) {
|
||||
$('#depotDlg').dialog('close');
|
||||
//加载完以后重新初始化
|
||||
var opts = $("#tableData").datagrid('options');
|
||||
showDepotDetails(opts.pageNumber, opts.pageSize);
|
||||
}
|
||||
},
|
||||
//此处添加错误处理
|
||||
error: function () {
|
||||
$.messager.alert('提示', '保存仓库信息异常,请稍后再试!', 'error');
|
||||
return;
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
//编辑信息
|
||||
function editDepot(depotTotalInfo) {
|
||||
var depotInfo = depotTotalInfo.split("AaBb");
|
||||
|
||||
$("#name").focus().val(depotInfo[1]);
|
||||
$("#sort").val(depotInfo[2]);
|
||||
$("#remark").val(depotInfo[3]);
|
||||
$("#address").val(depotInfo[4]);
|
||||
$("#warehousing").val(depotInfo[5]);
|
||||
$("#truckage").val(depotInfo[6]);
|
||||
|
||||
oldDepot = depotInfo[1];
|
||||
$('#depotDlg').dialog('open').dialog('setTitle', '<img src="/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 = '/depot/update?id=' + depotInfo[0];
|
||||
}
|
||||
|
||||
//检查名称是否存在 ++ 重名无法提示问题需要跟进
|
||||
function checkDepotName() {
|
||||
var name = $.trim($("#name").val());
|
||||
//表示是否存在 true == 存在 false = 不存在
|
||||
var flag = false;
|
||||
//开始ajax名称检验,不能重名
|
||||
if (name.length > 0 && (oldDepot.length == 0 || name != oldDepot)) {
|
||||
$.ajax({
|
||||
type: "get",
|
||||
url: "/depot/checkIsNameExist",
|
||||
dataType: "json",
|
||||
async: false,
|
||||
data: ({
|
||||
id: depotID,
|
||||
name: name
|
||||
}),
|
||||
success: function (res) {
|
||||
if(res && res.code === 200) {
|
||||
if(res.data && res.data.status) {
|
||||
flag = res.data.status;
|
||||
if (flag) {
|
||||
$.messager.alert('提示', '仓库名称已经存在', 'info');
|
||||
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) {
|
||||
var name = $.trim($("#searchName").val());
|
||||
var type = 0; //仓库
|
||||
var remark = $.trim($("#searchRemark").val());
|
||||
$.ajax({
|
||||
type: "get",
|
||||
url: "/depot/list",
|
||||
dataType: "json",
|
||||
data: ({
|
||||
search: JSON.stringify({
|
||||
name: name,
|
||||
type: type,
|
||||
remark: remark
|
||||
}),
|
||||
currentPage: pageNo,
|
||||
pageSize: pageSize
|
||||
}),
|
||||
success: function (res) {
|
||||
if(res && res.code === 200){
|
||||
if(res.data && res.data.page) {
|
||||
$("#tableData").datagrid('loadData', res.data.page);
|
||||
}
|
||||
}
|
||||
},
|
||||
//此处添加错误处理
|
||||
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 + "单元", "/pages/materials/building.jsp?ProjectId=" + currentRow[0].id, "");
|
||||
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
460
erp_web/pages/manage/depotGift.html
Normal file
460
erp_web/pages/manage/depotGift.html
Normal file
@@ -0,0 +1,460 @@
|
||||
<!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="/images/favicon.ico" type="image/x-icon"/>
|
||||
<link rel="stylesheet" type="text/css" href="/js/easyui-1.3.5/themes/default/easyui.css"/>
|
||||
<link rel="stylesheet" type="text/css" href="/js/easyui-1.3.5/themes/icon.css"/>
|
||||
<link type="text/css" rel="stylesheet" href="/css/common.css"/>
|
||||
<script type="text/javascript" src="/js/jquery-1.8.0.min.js"></script>
|
||||
<script type="text/javascript" src="/js/easyui-1.3.5/jquery.easyui.min.js"></script>
|
||||
<script type="text/javascript" src="/js/easyui-1.3.5/locale/easyui-lang-zh_CN.js"></script>
|
||||
<script type="text/javascript" src="/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>
|
||||
</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>
|
||||
</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,
|
||||
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;
|
||||
str += '<img src="/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="/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;
|
||||
}
|
||||
});
|
||||
showDepotDetails(1, initPageSize);
|
||||
}
|
||||
|
||||
//初始化键盘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: "/depot/" + depotID + "/delete",
|
||||
dataType: "json",
|
||||
success: function (res) {
|
||||
if(res && res.code == 200) {
|
||||
$("#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: "/depot/batchDelete",
|
||||
dataType: "json",
|
||||
async: false,
|
||||
data: ({
|
||||
ids: ids
|
||||
}),
|
||||
success: function (res) {
|
||||
if(res && res.code === 200) {
|
||||
$("#searchBtn").click();
|
||||
$(":checkbox").attr("checked", false);
|
||||
} else {
|
||||
$.messager.alert('删除提示', '删除礼品卡信息失败,请稍后再试!', 'error');
|
||||
}
|
||||
},
|
||||
//此处添加错误处理
|
||||
error: function () {
|
||||
$.messager.alert('删除提示', '删除礼品卡信息异常,请稍后再试!', 'error');
|
||||
return;
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
//增加
|
||||
var url;
|
||||
var depotID = 0;
|
||||
//保存编辑前的名称
|
||||
var oldDepot = "";
|
||||
|
||||
function addDepot() {
|
||||
$("#sort").val("");
|
||||
$("#remark").val("");
|
||||
$('#depotDlg').dialog('open').dialog('setTitle', '<img src="/js/easyui-1.3.5/themes/icons/edit_add.png"/> 增加仓库信息');
|
||||
$(".window-mask").css({width: webW, height: webH});
|
||||
$("#name").val("").focus();
|
||||
//$('#depotFM').form('clear');
|
||||
|
||||
oldDepot = "";
|
||||
depotID = 0;
|
||||
url = '/depot/add';
|
||||
}
|
||||
|
||||
//保存信息
|
||||
$("#saveDepot").off("click").on("click", function () {
|
||||
if (checkDepotName()) {
|
||||
return;
|
||||
}
|
||||
$.ajax({
|
||||
url: url,
|
||||
type: "post",
|
||||
dataType: "json",
|
||||
data: ({
|
||||
info: JSON.stringify($("#depotFM").serializeObject())
|
||||
}),
|
||||
success: function(res) {
|
||||
if(res && res.code === 200) {
|
||||
$('#depotDlg').dialog('close');
|
||||
//加载完以后重新初始化
|
||||
var opts = $("#tableData").datagrid('options');
|
||||
showDepotDetails(opts.pageNumber, opts.pageSize);
|
||||
}
|
||||
},
|
||||
//此处添加错误处理
|
||||
error: function () {
|
||||
$.messager.alert('提示', '保存仓库信息异常,请稍后再试!', 'error');
|
||||
return;
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
//编辑信息
|
||||
function editDepot(depotTotalInfo) {
|
||||
var depotInfo = depotTotalInfo.split("AaBb");
|
||||
|
||||
$("#name").focus().val(depotInfo[1]);
|
||||
$("#sort").val(depotInfo[2]);
|
||||
$("#remark").val(depotInfo[3]);
|
||||
|
||||
oldDepot = depotInfo[1];
|
||||
$('#depotDlg').dialog('open').dialog('setTitle', '<img src="/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 = '/depot/update?id=' + depotInfo[0];
|
||||
}
|
||||
|
||||
//检查名称是否存在 ++ 重名无法提示问题需要跟进
|
||||
function checkDepotName() {
|
||||
var name = $.trim($("#name").val());
|
||||
//表示是否存在 true == 存在 false = 不存在
|
||||
var flag = false;
|
||||
//开始ajax名称检验,不能重名
|
||||
if (name.length > 0 && (oldDepot.length == 0 || name != oldDepot)) {
|
||||
$.ajax({
|
||||
type: "get",
|
||||
url: "/depot/checkIsNameExist",
|
||||
dataType: "json",
|
||||
async: false,
|
||||
data: ({
|
||||
id: depotID,
|
||||
name: name
|
||||
}),
|
||||
success: function (res) {
|
||||
if(res && res.code === 200) {
|
||||
if(res.data && res.data.status) {
|
||||
flag = res.data.status;
|
||||
if (flag) {
|
||||
$.messager.alert('提示', '礼品卡名称已经存在', 'info');
|
||||
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) {
|
||||
var name = $.trim($("#searchName").val());
|
||||
var type = 1; // 礼品卡
|
||||
var remark = $.trim($("#searchRemark").val());
|
||||
$.ajax({
|
||||
type: "get",
|
||||
url: "/depot/list",
|
||||
dataType: "json",
|
||||
data: ({
|
||||
search: JSON.stringify({
|
||||
name: name,
|
||||
type: type,
|
||||
remark: remark
|
||||
}),
|
||||
currentPage: pageNo,
|
||||
pageSize: pageSize
|
||||
}),
|
||||
success: function (res) {
|
||||
if(res && res.code === 200){
|
||||
if(res.data && res.data.page) {
|
||||
$("#tableData").datagrid('loadData', res.data.page);
|
||||
}
|
||||
}
|
||||
},
|
||||
//此处添加错误处理
|
||||
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 + "单元", "/pages/materials/building.jsp?ProjectId=" + currentRow[0].id, "");
|
||||
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
509
erp_web/pages/manage/functions.html
Normal file
509
erp_web/pages/manage/functions.html
Normal file
@@ -0,0 +1,509 @@
|
||||
<!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="/images/favicon.ico" type="image/x-icon"/>
|
||||
<link rel="stylesheet" type="text/css" href="/js/easyui-1.3.5/themes/default/easyui.css"/>
|
||||
<link rel="stylesheet" type="text/css" href="/js/easyui-1.3.5/themes/icon.css"/>
|
||||
<link type="text/css" rel="stylesheet" href="/css/common.css"/>
|
||||
<script type="text/javascript" src="/js/jquery-1.8.0.min.js"></script>
|
||||
<script type="text/javascript" src="/js/easyui-1.3.5/jquery.easyui.min.js"></script>
|
||||
<script type="text/javascript" src="/js/easyui-1.3.5/locale/easyui-lang-zh_CN.js"></script>
|
||||
<script type="text/javascript" src="/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 style="width:65px;">编号</td>
|
||||
<td style="padding:5px">
|
||||
<input name="Number" id="Number" class="easyui-textbox" style="width: 230px;height: 20px"/>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>名称</td>
|
||||
<td style="padding:5px">
|
||||
<input name="Name" id="Name" class="easyui-validatebox"
|
||||
data-options="required:true,validType:'length[2,20]'" style="width: 230px;height: 20px"/>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>上级编号</td>
|
||||
<td style="padding:5px">
|
||||
<input name="PNumber" id="PNumber" class="easyui-textbox" style="width: 230px;height: 20px"/>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>链接</td>
|
||||
<td style="padding:5px"><input name="URL" id="URL" class="easyui-textbox" style="width: 230px;height: 20px"/></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>排序</td>
|
||||
<td style="padding:5px"><input name="Sort" id="Sort" class="easyui-textbox" style="width: 230px;height: 20px"/></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>功能按钮</td>
|
||||
<td style="padding:5px">
|
||||
<input id="PushBtn" name="PushBtn" style="width:230px;"/>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>收缩</td>
|
||||
<td style="padding:5px"><input name="State" id="State" type="checkbox" style="width: 230px;height: 20px"/></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>启用</td>
|
||||
<td style="padding:5px"><input name="Enabled" id="Enabled" type="checkbox" style="width: 230px;height: 20px"/></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>类型</td>
|
||||
<td style="padding:5px"><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();
|
||||
bindEvent();
|
||||
});
|
||||
|
||||
//防止表单提交重复
|
||||
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,
|
||||
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: 200},
|
||||
{title: '排序', field: 'sort', width: 50},
|
||||
{
|
||||
title: '收缩', field: 'state', width: 50, formatter: function (value) {
|
||||
return value ? "开" : "关";
|
||||
}
|
||||
},
|
||||
{
|
||||
title: '启用', field: 'enabled', width: 50, formatter: function (value) {
|
||||
return value ? "开" : "关";
|
||||
}
|
||||
},
|
||||
{title: '类型', field: 'type', width: 50},
|
||||
{
|
||||
title: '操作', field: 'op', align: "center", width: 130, formatter: function (value, rec) {
|
||||
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 + 'AaBb' + rec.pushbtn;
|
||||
str += '<img src="/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="/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;
|
||||
}
|
||||
});
|
||||
showFunctionsDetails(1, initPageSize);
|
||||
}
|
||||
|
||||
//初始化键盘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 bindEvent() {
|
||||
$('#PushBtn').combobox({
|
||||
url: '/js/pages/manage/pushBtn.json',
|
||||
valueField: 'id',
|
||||
textField: 'text',
|
||||
panelHeight: 120,
|
||||
multiple: true
|
||||
});
|
||||
}
|
||||
|
||||
//删除功能信息
|
||||
function deleteFunctions(functionsID) {
|
||||
$.messager.confirm('删除确认', '确定要删除此功能信息吗?', function (r) {
|
||||
if (r) {
|
||||
$.ajax({
|
||||
type: "post",
|
||||
url: "/functions/" + functionsID + "/delete",
|
||||
dataType: "json",
|
||||
success: function (res) {
|
||||
if(res && res.code == 200) {
|
||||
$("#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;
|
||||
}
|
||||
ids += row[i].id + ",";
|
||||
}
|
||||
$.ajax({
|
||||
type: "post",
|
||||
url: "/functions/batchDelete",
|
||||
dataType: "json",
|
||||
async: false,
|
||||
data: ({
|
||||
ids: ids
|
||||
}),
|
||||
success: function (res) {
|
||||
if(res && res.code === 200) {
|
||||
$("#searchBtn").click();
|
||||
$(":checkbox").attr("checked", false);
|
||||
} else {
|
||||
$.messager.alert('删除提示', '删除功能信息失败,请稍后再试!', 'error');
|
||||
}
|
||||
},
|
||||
//此处添加错误处理
|
||||
error: function () {
|
||||
$.messager.alert('删除提示', '删除功能信息异常,请稍后再试!', 'error');
|
||||
return;
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
//增加
|
||||
var url;
|
||||
var functionsID = 0;
|
||||
//保存编辑前的名称
|
||||
var oldFunctions = "";
|
||||
|
||||
function addFunctions() {
|
||||
$('#functionsDlg').dialog('open').dialog('setTitle', '<img src="/js/easyui-1.3.5/themes/icons/edit_add.png"/> 增加功能信息');
|
||||
$(".window-mask").css({width: webW, height: webH});
|
||||
$("#Name").val("").focus();
|
||||
$('#functionsFM').form('clear');
|
||||
|
||||
oldFunctions = "";
|
||||
functionsID = 0;
|
||||
url = '/functions/add';
|
||||
}
|
||||
|
||||
//保存信息
|
||||
$("#saveFunctions").off("click").on("click", function () {
|
||||
if (checkFunctionsName()) {
|
||||
return;
|
||||
}
|
||||
$.ajax({
|
||||
url: url,
|
||||
type: "post",
|
||||
dataType: "json",
|
||||
data: ({
|
||||
info: JSON.stringify($("#functionsFM").serializeObject())
|
||||
}),
|
||||
success: function(res) {
|
||||
if(res && res.code === 200) {
|
||||
$('#functionsDlg').dialog('close');
|
||||
//加载完以后重新初始化
|
||||
var opts = $("#tableData").datagrid('options');
|
||||
showFunctionsDetails(opts.pageNumber, opts.pageSize);
|
||||
}
|
||||
},
|
||||
//此处添加错误处理
|
||||
error: function () {
|
||||
$.messager.alert('提示', '保存功能信息异常,请稍后再试!', 'error');
|
||||
return;
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
//编辑信息
|
||||
function editFunctions(functionsTotalInfo) {
|
||||
var functionsInfo = functionsTotalInfo.split("AaBb");
|
||||
|
||||
$("#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]);
|
||||
if (functionsInfo[9] !== "undefined" && functionsInfo[9] !== "") {
|
||||
var arr = functionsInfo[9].split(",");
|
||||
var pushBtnArray = [];
|
||||
for (var i = 0; i < arr.length; i++) {
|
||||
if (arr[i]) {
|
||||
pushBtnArray.push(arr[i]);
|
||||
}
|
||||
}
|
||||
if (pushBtnArray.length) {
|
||||
$("#PushBtn").combobox('setValues', pushBtnArray);
|
||||
}
|
||||
}
|
||||
else {
|
||||
$("#PushBtn").combobox('setValues', '');
|
||||
}
|
||||
|
||||
oldFunctions = functionsInfo[2];
|
||||
$('#functionsDlg').dialog('open').dialog('setTitle', '<img src="/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 = '/functions/update?id=' + functionsInfo[0];
|
||||
}
|
||||
|
||||
//检查名称是否存在 ++ 重名无法提示问题需要跟进
|
||||
function checkFunctionsName() {
|
||||
var Name = $.trim($("#Name").val());
|
||||
//表示是否存在 true == 存在 false = 不存在
|
||||
var flag = false;
|
||||
//开始ajax名称检验,不能重名
|
||||
if (name.length > 0 && (oldFunctions.length == 0 || name != oldFunctions)) {
|
||||
$.ajax({
|
||||
type: "get",
|
||||
url: "/functions/checkIsNameExist",
|
||||
dataType: "json",
|
||||
async: false,
|
||||
data: ({
|
||||
id: functionsID,
|
||||
name: Name
|
||||
}),
|
||||
success: function (res) {
|
||||
if(res && res.code === 200) {
|
||||
if(res.data && res.data.status) {
|
||||
flag = res.data.status;
|
||||
if (flag) {
|
||||
$.messager.alert('提示', '功能名称已经存在', 'info');
|
||||
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) {
|
||||
var name = $.trim($("#searchName").val());
|
||||
var type = $.trim($("#searchType").val());
|
||||
$.ajax({
|
||||
type: "get",
|
||||
url: "/functions/list",
|
||||
dataType: "json",
|
||||
data: ({
|
||||
search: JSON.stringify({
|
||||
name: name,
|
||||
type: type
|
||||
}),
|
||||
currentPage: pageNo,
|
||||
pageSize: pageSize
|
||||
}),
|
||||
success: function (res) {
|
||||
if(res && res.code === 200){
|
||||
if(res.data && res.data.page) {
|
||||
$("#tableData").datagrid('loadData', res.data.page);
|
||||
}
|
||||
}
|
||||
},
|
||||
//此处添加错误处理
|
||||
error: function () {
|
||||
$.messager.alert('查询提示', '查询数据后台异常,请稍后再试!', 'error');
|
||||
return;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
//重置按钮
|
||||
$("#searchResetBtn").unbind().bind({
|
||||
click: function () {
|
||||
$("#searchName").val("");
|
||||
|
||||
//加载完以后重新初始化
|
||||
$("#searchBtn").click();
|
||||
}
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
459
erp_web/pages/manage/inOutItem.html
Normal file
459
erp_web/pages/manage/inOutItem.html
Normal file
@@ -0,0 +1,459 @@
|
||||
<!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="/images/favicon.ico" type="image/x-icon"/>
|
||||
<link rel="stylesheet" type="text/css" href="/js/easyui-1.3.5/themes/default/easyui.css"/>
|
||||
<link rel="stylesheet" type="text/css" href="/js/easyui-1.3.5/themes/icon.css"/>
|
||||
<link type="text/css" rel="stylesheet" href="/css/common.css"/>
|
||||
<script type="text/javascript" src="/js/jquery-1.8.0.min.js"></script>
|
||||
<script type="text/javascript" src="/js/easyui-1.3.5/jquery.easyui.min.js"></script>
|
||||
<script type="text/javascript" src="/js/easyui-1.3.5/locale/easyui-lang-zh_CN.js"></script>
|
||||
<script type="text/javascript" src="/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>
|
||||
</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,
|
||||
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;
|
||||
str += '<img src="/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="/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;
|
||||
}
|
||||
});
|
||||
showInOutItemDetails(1, initPageSize);
|
||||
}
|
||||
|
||||
//初始化键盘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: "/inOutItem/" + inOutItemTotalInfo[0] + "/delete",
|
||||
dataType: "json",
|
||||
success: function (res) {
|
||||
if(res && res.code == 200) {
|
||||
$("#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: "/inOutItem/batchDelete",
|
||||
dataType: "json",
|
||||
async: false,
|
||||
data: ({
|
||||
ids: ids
|
||||
}),
|
||||
success: function (res) {
|
||||
if(res && res.code === 200) {
|
||||
$("#searchBtn").click();
|
||||
$(":checkbox").attr("checked", false);
|
||||
} else {
|
||||
$.messager.alert('删除提示', '删除收支项目失败,请稍后再试!', 'error');
|
||||
}
|
||||
},
|
||||
//此处添加错误处理
|
||||
error: function () {
|
||||
$.messager.alert('删除提示', '删除收支项目异常,请稍后再试!', 'error');
|
||||
return;
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
//增加收支项目
|
||||
var url;
|
||||
var inOutItemID = 0;
|
||||
//保存编辑前的名称
|
||||
var oldInOutItem = "";
|
||||
|
||||
function addInOutItem() {
|
||||
$('#inOutItemDlg').dialog('open').dialog('setTitle', '<img src="/js/easyui-1.3.5/themes/icons/edit_add.png"/> 增加收支项目');
|
||||
$(".window-mask").css({width: webW, height: webH});
|
||||
$('#inOutItemFM').form('clear');
|
||||
|
||||
var row = {
|
||||
};
|
||||
$('#inOutItemFM').form('load', row);
|
||||
|
||||
$("#inOutItem").focus();
|
||||
oldInOutItem = "";
|
||||
inOutItemID = 0;
|
||||
url = '/inOutItem/add';
|
||||
}
|
||||
|
||||
//保存收支项目
|
||||
$("#saveInOutItem").off("click").on("click", function () {
|
||||
if (checkInOutItemName()) {
|
||||
return;
|
||||
}
|
||||
if (!$("#type").val()) {
|
||||
$.messager.alert('提示', '请选择类型!', 'warning');
|
||||
return;
|
||||
}
|
||||
$.ajax({
|
||||
url: url,
|
||||
type: "post",
|
||||
dataType: "json",
|
||||
data: ({
|
||||
info: JSON.stringify($("#inOutItemFM").serializeObject())
|
||||
}),
|
||||
success: function(res) {
|
||||
if(res && res.code === 200) {
|
||||
$('#inOutItemDlg').dialog('close');
|
||||
//加载完以后重新初始化
|
||||
var opts = $("#tableData").datagrid('options');
|
||||
showInOutItemDetails(opts.pageNumber, opts.pageSize);
|
||||
}
|
||||
},
|
||||
//此处添加错误处理
|
||||
error: function () {
|
||||
$.messager.alert('提示', '保存收支项目信息异常,请稍后再试!', 'error');
|
||||
return;
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
//编辑收支项目
|
||||
function editInOutItem(inOutItemTotalInfo) {
|
||||
var inOutItemInfo = inOutItemTotalInfo.split("AaBb");
|
||||
var row = {
|
||||
name: inOutItemInfo[1],
|
||||
type: inOutItemInfo[2],
|
||||
remark: inOutItemInfo[3]
|
||||
};
|
||||
oldInOutItem = inOutItemInfo[1];
|
||||
$('#inOutItemDlg').dialog('open').dialog('setTitle', '<img src="/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 = '/inOutItem/update?id=' + inOutItemInfo[0];
|
||||
}
|
||||
|
||||
//检查收支项目 名称是否存在 ++ 重名无法提示问题需要跟进
|
||||
function checkInOutItemName() {
|
||||
var inOutItemName = $.trim($("#name").val());
|
||||
//表示是否存在 true == 存在 false = 不存在
|
||||
var flag = false;
|
||||
//开始ajax名称检验,不能重名
|
||||
if (inOutItemName.length > 0 && (oldInOutItem.length == 0 || inOutItemName != oldInOutItem)) {
|
||||
$.ajax({
|
||||
type: "get",
|
||||
url: "/inOutItem/checkIsNameExist",
|
||||
dataType: "json",
|
||||
async: false,
|
||||
data: ({
|
||||
id: inOutItemID,
|
||||
name: inOutItemName
|
||||
}),
|
||||
success: function (res) {
|
||||
if(res && res.code === 200) {
|
||||
if(res.data && res.data.status) {
|
||||
flag = res.data.status;
|
||||
if (flag) {
|
||||
$.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) {
|
||||
var name = $.trim($("#searchName").val());
|
||||
var type = $.trim($("#searchType").val());
|
||||
var remark = $.trim($("#searchRemark").val());
|
||||
$.ajax({
|
||||
type: "get",
|
||||
url: "/inOutItem/list",
|
||||
dataType: "json",
|
||||
data: ({
|
||||
search: JSON.stringify({
|
||||
name: name,
|
||||
type: type,
|
||||
remark: remark
|
||||
}),
|
||||
currentPage: pageNo,
|
||||
pageSize: pageSize
|
||||
}),
|
||||
success: function (res) {
|
||||
if(res && res.code === 200){
|
||||
if(res.data && res.data.page) {
|
||||
$("#tableData").datagrid('loadData', res.data.page);
|
||||
}
|
||||
}
|
||||
},
|
||||
//此处添加错误处理
|
||||
error: function () {
|
||||
$.messager.alert('查询提示', '查询数据后台异常,请稍后再试!', 'error');
|
||||
return;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
//重置按钮
|
||||
$("#searchResetBtn").unbind().bind({
|
||||
click: function () {
|
||||
$("#searchName").val("");
|
||||
$("#searchType").val("");
|
||||
$("#searchRemark").val("");
|
||||
//加载完以后重新初始化
|
||||
$("#searchBtn").click();
|
||||
}
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
286
erp_web/pages/manage/log.html
Normal file
286
erp_web/pages/manage/log.html
Normal file
@@ -0,0 +1,286 @@
|
||||
<!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="/images/favicon.ico" type="image/x-icon"/>
|
||||
<link rel="stylesheet" type="text/css" href="/js/easyui-1.3.5/themes/default/easyui.css"/>
|
||||
<link rel="stylesheet" type="text/css" href="/js/easyui-1.3.5/themes/icon.css"/>
|
||||
<link type="text/css" rel="stylesheet" href="/css/common.css"/>
|
||||
<script type="text/javascript" src="/js/jquery-1.8.0.min.js"></script>
|
||||
<script type="text/javascript" src="/js/easyui-1.3.5/jquery.easyui.min.js"></script>
|
||||
<script type="text/javascript" src="/js/easyui-1.3.5/locale/easyui-lang-zh_CN.js"></script>
|
||||
<script type="text/javascript" src="/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,
|
||||
pagination: true,
|
||||
//loadFilter: pagerFilter,
|
||||
pageSize: initPageSize,
|
||||
pageList: initPageNum,
|
||||
columns: [[
|
||||
{title: '操作模块', field: 'operation', width: 120},
|
||||
{title: '操作人员', field: 'username', width: 80, align: "center"},
|
||||
{title: '操作IP', field: 'clientip', width: 90, align: "center"},
|
||||
{title: '操作时间', field: 'createtime', width: 130, align: "center"},
|
||||
{title: '操作详情', field: 'remark', width: 380},
|
||||
{title: '操作状态', field: 'status', width: 70},
|
||||
{title: '备注', field: 'remark', width: 180}
|
||||
]],
|
||||
onLoadError: function () {
|
||||
$.messager.alert('页面加载提示', '页面加载异常,请稍后再试!', 'error');
|
||||
return;
|
||||
}
|
||||
});
|
||||
showLogDetails(1, initPageSize);
|
||||
}
|
||||
|
||||
//初始化键盘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: "/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) {
|
||||
var operation = $.trim($("#searchOperation").val());
|
||||
var usernameID = $.trim($("#searchUsernameID").val());
|
||||
var clientIp = $.trim($("#searchIP").val());
|
||||
var status = $.trim($("#searchStatus").val());
|
||||
var beginTime = $.trim($("#searchBeginTime").datebox("getValue"));
|
||||
var endTime = $.trim($("#searchEndTime").datebox("getValue"));
|
||||
var contentdetails = $.trim($("#searchDesc").val());
|
||||
$.ajax({
|
||||
type: "get",
|
||||
url: "/log/list",
|
||||
dataType: "json",
|
||||
data: ({
|
||||
search: JSON.stringify({
|
||||
operation: operation,
|
||||
usernameID: usernameID,
|
||||
clientIp: clientIp,
|
||||
status: status,
|
||||
beginTime: beginTime,
|
||||
endTime: endTime,
|
||||
contentdetails: contentdetails
|
||||
}),
|
||||
currentPage: pageNo,
|
||||
pageSize: pageSize
|
||||
}),
|
||||
success: function (res) {
|
||||
if(res && res.code === 200){
|
||||
if(res.data && res.data.page) {
|
||||
$("#tableData").datagrid('loadData', res.data.page);
|
||||
}
|
||||
}
|
||||
},
|
||||
//此处添加错误处理
|
||||
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>
|
||||
187
erp_web/pages/manage/member.html
Normal file
187
erp_web/pages/manage/member.html
Normal file
@@ -0,0 +1,187 @@
|
||||
<!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="/images/favicon.ico" type="image/x-icon"/>
|
||||
<link rel="stylesheet" type="text/css" href="/js/easyui-1.3.5/themes/default/easyui.css"/>
|
||||
<link rel="stylesheet" type="text/css" href="/js/easyui-1.3.5/themes/icon.css"/>
|
||||
<link type="text/css" rel="stylesheet" href="/css/common.css"/>
|
||||
<script type="text/javascript" src="/js/jquery-1.8.0.min.js"></script>
|
||||
<script type="text/javascript" src="/js/easyui-1.3.5/jquery.easyui.min.js"></script>
|
||||
<script type="text/javascript" src="/js/easyui-1.3.5/locale/easyui-lang-zh_CN.js"></script>
|
||||
<script type="text/javascript" src="/js/common/common.js"></script>
|
||||
<script src="/js/pages/manage/supplier.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:100px;"/>
|
||||
</td>
|
||||
<td> </td>
|
||||
<td>手机号码:</td>
|
||||
<td>
|
||||
<input type="text" name="searchTelephone" id="searchTelephone" style="width:100px;"/>
|
||||
</td>
|
||||
<td> </td>
|
||||
<td>联系电话:</td>
|
||||
<td>
|
||||
<input type="text" name="searchPhonenum" id="searchPhonenum" style="width:100px;"/>
|
||||
</td>
|
||||
<td> </td>
|
||||
<td id="searchDescLabel">备 注:</td>
|
||||
<td>
|
||||
<input type="text" name="searchDesc" id="searchDesc" style="width:100px;"/>
|
||||
</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:600px;padding:10px 20px"
|
||||
closed="true" buttons="#dlg-buttons" modal="true" collapsible="false" closable="true">
|
||||
<form id="supplierFM">
|
||||
<table>
|
||||
<tr>
|
||||
<td style="width: 80px;height: 20px">名称</td>
|
||||
<td style="width: 180px;padding:1px">
|
||||
<input name="supplier" id="supplier" class="easyui-validatebox"
|
||||
data-options="required:true,validType:'length[2,30]'" style="width: 160px;height: 20px"/>
|
||||
</td>
|
||||
<td style="width: 60px;height: 20px">联系人</td>
|
||||
<td style="width:180px;padding:1px;">
|
||||
<input name="contacts" id="contacts" class="easyui-validatebox" style="width: 160px;height: 20px"/>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>手机号码</td>
|
||||
<td style="padding:1px;">
|
||||
<input name="telephone" id="telephone" class="easyui-validatebox"
|
||||
style="width: 160px;height: 20px"/>
|
||||
</td>
|
||||
<td>电子邮箱</td>
|
||||
<td style="padding:1px">
|
||||
<input name="email" id="email" class="easyui-validatebox" validType="email"
|
||||
style="width: 160px;height: 20px"/>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>联系电话</td>
|
||||
<td style="padding:1px;">
|
||||
<input name="phonenum" id="phonenum" class="easyui-validatebox" style="width: 160px;height: 20px"/>
|
||||
</td>
|
||||
<td>传真</td>
|
||||
<td style="padding:1px">
|
||||
<input name="fax" id="fax" class="easyui-validatebox" style="width: 160px;height: 20px"/>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>期初应收</td>
|
||||
<td style="padding:1px">
|
||||
<input name="BeginNeedGet" id="BeginNeedGet" type="text" class="easyui-numberbox"
|
||||
data-options="min:0,precision:2" style="width: 160px;height: 20px"/>
|
||||
</td>
|
||||
<td>期初应付</td>
|
||||
<td style="padding:1px">
|
||||
<input name="BeginNeedPay" id="BeginNeedPay" type="text" class="easyui-numberbox"
|
||||
data-options="min:0,precision:2" style="width: 160px;height: 20px"/>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>累计应收</td>
|
||||
<td style="padding:1px">
|
||||
<input name="AllNeedGet" id="AllNeedGet" type="text" style="width: 160px;height: 20px"
|
||||
readonly="readonly"/>
|
||||
</td>
|
||||
<td>累计应付</td>
|
||||
<td style="padding:1px">
|
||||
<input name="AllNeedPay" id="AllNeedPay" type="text" style="width: 160px;height: 20px"
|
||||
readonly="readonly"/>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>纳税人识别号</td>
|
||||
<td style="padding:1px">
|
||||
<input name="taxNum" id="taxNum" class="easyui-validatebox" style="width: 160px;height: 20px"/>
|
||||
</td>
|
||||
<td>税率</td>
|
||||
<td style="padding:1px">
|
||||
<input name="taxRate" id="taxRate" class="easyui-validatebox" style="width: 160px;height: 20px"/>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>开户行</td>
|
||||
<td style="padding:1px">
|
||||
<input name="bankName" id="bankName" class="easyui-validatebox" style="width: 160px;height: 20px"/>
|
||||
</td>
|
||||
<td>账号</td>
|
||||
<td style="padding:1px">
|
||||
<input name="accountNumber" id="accountNumber" class="easyui-validatebox"
|
||||
style="width: 160px;height: 20px"/>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>地址</td>
|
||||
<td style="padding:1px" colspan="3">
|
||||
<input name="address" id="address" class="easyui-validatebox" style="width: 408px;height: 20px"/>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>备注</td>
|
||||
<td style="padding:1px" colspan="3">
|
||||
<textarea name="description" id="description" rows="2" cols="2" style="width: 408px;"></textarea>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</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>
|
||||
|
||||
<!-- 导入excel表格 -->
|
||||
<div id="importExcelDlg" style="padding:10px 20px">
|
||||
<form id="importExcelFM" method="post" enctype="multipart/form-data"
|
||||
action="/supplier/importExcelMember.action">
|
||||
<div class="fitem" style="padding:5px">
|
||||
<label>文件名称 </label>
|
||||
<input name="supplierFile" id="supplierFile" type="file" style="width: 230px;height: 20px"/>
|
||||
</div>
|
||||
<div class="fitem" style="padding:5px">
|
||||
<label><b>导入注意</b> </label><span>(预收款、期初应收、期初应付、税率均为数值且要大于0;另外期初应收、期初应付不能同时输入)</span>
|
||||
</div>
|
||||
<div class="fitem" style="padding:5px;display: none;">
|
||||
<label>是否审查 </label>
|
||||
<select id="isCheck" name="isCheck" style="width: 230px;height: 20px">
|
||||
<option value="0">是</option>
|
||||
<option value="1" selected="selected">否</option>
|
||||
</select>
|
||||
</div>
|
||||
<input type="hidden" name="clientIp" id="clientIp" value="<%=clientIp %>"/>
|
||||
<div id="dlg-buttons5">
|
||||
<a href="javascript:void(0)" id="saveimport" class="easyui-linkbutton" iconCls="icon-ok">导入</a>
|
||||
<a href="javascript:void(0)" id="cancelimport" class="easyui-linkbutton" iconCls="icon-cancel"
|
||||
onclick="javascript:$('#importExcelDlg').dialog('close')">取消</a>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
454
erp_web/pages/manage/role.html
Normal file
454
erp_web/pages/manage/role.html
Normal file
@@ -0,0 +1,454 @@
|
||||
<!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="/images/favicon.ico" type="image/x-icon"/>
|
||||
<script type="text/javascript" src="/js/jquery-1.8.0.min.js"></script>
|
||||
<script type="text/javascript" src="/js/colorbox/jquery.colorbox-min.js"></script>
|
||||
<script type="text/javascript" src="/js/colorbox/colorboxSet.js"></script>
|
||||
<link href="/js/colorbox/colorbox.css" rel="stylesheet" type="text/css"/>
|
||||
<link rel="stylesheet" type="text/css" href="/js/easyui-1.3.5/themes/default/easyui.css"/>
|
||||
<link rel="stylesheet" type="text/css" href="/js/easyui-1.3.5/themes/icon.css"/>
|
||||
<link type="text/css" rel="stylesheet" href="/css/common.css"/>
|
||||
<script type="text/javascript" src="/js/easyui-1.3.5/jquery.easyui.min.js"></script>
|
||||
<script type="text/javascript" src="/js/easyui-1.3.5/locale/easyui-lang-zh_CN.js"></script>
|
||||
<script type="text/javascript" src="/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> </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>
|
||||
<a id="btnSetPushBtn" 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>
|
||||
</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,
|
||||
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;
|
||||
str += '<img src="/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="/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;
|
||||
}
|
||||
});
|
||||
showRoleDetails(1, initPageSize);
|
||||
}
|
||||
|
||||
//初始化键盘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: "/role/" + roleID + "/delete",
|
||||
dataType: "json",
|
||||
success: function (res) {
|
||||
if(res && res.code == 200) {
|
||||
$("#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;
|
||||
}
|
||||
ids += row[i].id + ",";
|
||||
}
|
||||
$.ajax({
|
||||
type: "post",
|
||||
url: "/role/batchDelete",
|
||||
dataType: "json",
|
||||
async: false,
|
||||
data: ({
|
||||
ids: ids,
|
||||
}),
|
||||
success: function (res) {
|
||||
if(res && res.code === 200) {
|
||||
$("#searchBtn").click();
|
||||
$(":checkbox").attr("checked", false);
|
||||
} else {
|
||||
$.messager.alert('删除提示', '删除角色信息失败,请稍后再试!', 'error');
|
||||
}
|
||||
},
|
||||
//此处添加错误处理
|
||||
error: function () {
|
||||
$.messager.alert('删除提示', '删除角色信息异常,请稍后再试!', 'error');
|
||||
return;
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
//增加
|
||||
var url;
|
||||
var roleID = 0;
|
||||
//保存编辑前的名称
|
||||
var oldName = "";
|
||||
|
||||
function addRole() {
|
||||
$("#sort").val("");
|
||||
$("#remark").val("");
|
||||
$('#roleDlg').dialog('open').dialog('setTitle', '<img src="/js/easyui-1.3.5/themes/icons/edit_add.png"/> 增加角色信息');
|
||||
$(".window-mask").css({width: webW, height: webH});
|
||||
$("#name").val("").focus();
|
||||
//$('#roleFM').form('clear');
|
||||
|
||||
oldName = "";
|
||||
roleID = 0;
|
||||
url = '/role/add';
|
||||
}
|
||||
|
||||
//保存信息
|
||||
$("#saveRole").off("click").on("click", function () {
|
||||
if (checkRoleName()) {
|
||||
return;
|
||||
}
|
||||
$.ajax({
|
||||
type: "post",
|
||||
url: url,
|
||||
dataType: "json",
|
||||
data: ({
|
||||
info: JSON.stringify($("#roleFM").serializeObject())
|
||||
}),
|
||||
success: function (res) {
|
||||
if(res && res.code === 200) {
|
||||
$('#roleDlg').dialog('close');
|
||||
//加载完以后重新初始化
|
||||
var opts = $("#tableData").datagrid('options');
|
||||
showRoleDetails(opts.pageNumber, opts.pageSize);
|
||||
}
|
||||
},
|
||||
//此处添加错误处理
|
||||
error: function () {
|
||||
$.messager.alert('提示', '保存角色信息异常,请稍后再试!', 'error');
|
||||
return;
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
//编辑信息
|
||||
function editRole(roleTotalInfo) {
|
||||
var roleInfo = roleTotalInfo.split("AaBb");
|
||||
|
||||
$("#name").focus().val(roleInfo[1]);
|
||||
|
||||
oldName = roleInfo[1];
|
||||
$('#roleDlg').dialog('open').dialog('setTitle', '<img src="/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 = '/role/update?id=' + roleInfo[0];
|
||||
}
|
||||
|
||||
//检查名称是否存在 ++ 重名无法提示问题需要跟进
|
||||
function checkRoleName() {
|
||||
var name = $.trim($("#name").val());
|
||||
//表示是否存在 true == 存在 false = 不存在
|
||||
var flag = false;
|
||||
//开始ajax名称检验,不能重名
|
||||
if (name.length > 0 && (oldName.length == 0 || name != oldName)) {
|
||||
$.ajax({
|
||||
type: "get",
|
||||
url: "/role/checkIsNameExist",
|
||||
dataType: "json",
|
||||
async: false,
|
||||
data: ({
|
||||
id: roleID,
|
||||
name: name
|
||||
}),
|
||||
success: function (res) {
|
||||
if(res && res.code === 200) {
|
||||
if(res.data && res.data.status) {
|
||||
flag = res.data.status;
|
||||
if (flag) {
|
||||
$.messager.alert('提示', '角色名称已经存在', 'info');
|
||||
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) {
|
||||
var searchName = $.trim($("#searchName").val());
|
||||
$.ajax({
|
||||
type: "get",
|
||||
url: "/role/list",
|
||||
dataType: "json",
|
||||
data: ({
|
||||
search: JSON.stringify({
|
||||
name: searchName
|
||||
}),
|
||||
currentPage: pageNo,
|
||||
pageSize: pageSize
|
||||
}),
|
||||
success: function (res) {
|
||||
if(res && res.code === 200){
|
||||
if(res.data && res.data.page) {
|
||||
$("#tableData").datagrid('loadData', res.data.page);
|
||||
}
|
||||
}
|
||||
},
|
||||
//此处添加错误处理
|
||||
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 = "/pages/manage/roleApp.html?id=" + currentRow.Id;
|
||||
});
|
||||
|
||||
//分配功能
|
||||
$('#btnSetFunctions').click(function () {
|
||||
var currentRow = $("#tableData").datagrid("getSelected");
|
||||
if (currentRow == null) {
|
||||
alert("请选择一条数据再操作!");
|
||||
return false;
|
||||
}
|
||||
this.href = "/pages/manage/roleFunctions.html?id=" + currentRow.Id;
|
||||
});
|
||||
|
||||
//分配按钮
|
||||
$('#btnSetPushBtn').click(function () {
|
||||
var currentRow = $("#tableData").datagrid("getSelected");
|
||||
if (currentRow == null) {
|
||||
alert("请选择一条数据再操作!");
|
||||
return false;
|
||||
}
|
||||
this.href = "/pages/manage/rolePushBtn.html?id=" + currentRow.Id;
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
140
erp_web/pages/manage/roleApp.html
Normal file
140
erp_web/pages/manage/roleApp.html
Normal file
@@ -0,0 +1,140 @@
|
||||
<!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="/images/favicon.ico" type="image/x-icon"/>
|
||||
<script type="text/javascript" src="/js/jquery-1.8.0.min.js"></script>
|
||||
<link rel="stylesheet" type="text/css" href="/js/easyui-1.3.5/themes/default/easyui.css"/>
|
||||
<link rel="stylesheet" type="text/css" href="/js/easyui-1.3.5/themes/icon.css"/>
|
||||
<link type="text/css" rel="stylesheet" href="/css/common.css"/>
|
||||
<script type="text/javascript" src="/js/easyui-1.3.5/jquery.easyui.min.js"></script>
|
||||
<script type="text/javascript" src="/js/easyui-1.3.5/locale/easyui-lang-zh_CN.js"></script>
|
||||
<script type="text/javascript" src="/js/common/common.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<!-- 数据显示table -->
|
||||
<div style="padding-bottom: 10px;">
|
||||
<a id="btnOK" class="easyui-linkbutton" iconCls="icon-ok">保存</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: '/app/findRoleAPP?UBType=' + type + '&UBKeyId=' + url_id,
|
||||
animate: true,
|
||||
checkbox: true
|
||||
});
|
||||
|
||||
|
||||
$("#btnOK").click(
|
||||
function () {
|
||||
var id = checkRoleAPP();
|
||||
if (!id) {
|
||||
url = '/userBusiness/add';
|
||||
}
|
||||
else {
|
||||
url = '/userBusiness/update?id=' + id;
|
||||
}
|
||||
|
||||
if (confirm("您确定要保存吗?")) {
|
||||
|
||||
$.ajax({
|
||||
url: url,
|
||||
type: "post",
|
||||
data: {
|
||||
info: JSON.stringify({
|
||||
type: type,
|
||||
keyid: url_id,
|
||||
value: GetNode('child')
|
||||
})
|
||||
},
|
||||
dataType: "json",
|
||||
async: false,
|
||||
success: function (res) {
|
||||
if(res && res.code === 200) {
|
||||
self.parent.$.colorbox.close();
|
||||
alert("操作成功!");
|
||||
}
|
||||
else {
|
||||
alert("操作失败!");
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
});
|
||||
|
||||
//检查记录是否存在
|
||||
function checkRoleAPP() {
|
||||
//表示是否存在 0 = 不存在,存在就返回id
|
||||
var flag = 0;
|
||||
//开始ajax名称检验,是否存在
|
||||
$.ajax({
|
||||
type: "get",
|
||||
url: "/userBusiness/checkIsValueExist",
|
||||
dataType: "json",
|
||||
async: false,
|
||||
data: ({
|
||||
type: type,
|
||||
keyId: url_id
|
||||
}),
|
||||
success: function (res) {
|
||||
if(res.data && res.data.id) {
|
||||
flag = res.data.id;
|
||||
}
|
||||
},
|
||||
//此处添加错误处理
|
||||
error: function () {
|
||||
$.messager.alert('提示', '检查角色对应应用是否存在异常,请稍后再试!', 'error');
|
||||
return;
|
||||
}
|
||||
});
|
||||
return flag;
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
139
erp_web/pages/manage/roleFunctions.html
Normal file
139
erp_web/pages/manage/roleFunctions.html
Normal file
@@ -0,0 +1,139 @@
|
||||
<!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="/images/favicon.ico" type="image/x-icon"/>
|
||||
<script type="text/javascript" src="/js/jquery-1.8.0.min.js"></script>
|
||||
<link rel="stylesheet" type="text/css" href="/js/easyui-1.3.5/themes/default/easyui.css"/>
|
||||
<link rel="stylesheet" type="text/css" href="/js/easyui-1.3.5/themes/icon.css"/>
|
||||
<link type="text/css" rel="stylesheet" href="/css/common.css"/>
|
||||
<script type="text/javascript" src="/js/easyui-1.3.5/jquery.easyui.min.js"></script>
|
||||
<script type="text/javascript" src="/js/easyui-1.3.5/locale/easyui-lang-zh_CN.js"></script>
|
||||
<script type="text/javascript" src="/js/common/common.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<!-- 数据显示table -->
|
||||
<div style="padding-bottom: 10px;">
|
||||
<a id="btnOK" class="easyui-linkbutton" iconCls="icon-ok">保存</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: '/functions/findRoleFunctions?UBType=' + type + '&UBKeyId=' + url_id,
|
||||
animate: true,
|
||||
checkbox: true
|
||||
});
|
||||
|
||||
$("#btnOK").click(
|
||||
function () {
|
||||
var id = checkRoleFunctions();
|
||||
if (!id) {
|
||||
url = '/userBusiness/add';
|
||||
}
|
||||
else {
|
||||
url = '/userBusiness/update?id=' + id;
|
||||
}
|
||||
|
||||
if (confirm("您确定要保存吗?")) {
|
||||
|
||||
$.ajax({
|
||||
url: url,
|
||||
type: "post",
|
||||
data: {
|
||||
info: JSON.stringify({
|
||||
type: type,
|
||||
keyid: url_id,
|
||||
value: GetNode('child')
|
||||
})
|
||||
},
|
||||
dataType: "json",
|
||||
async: false,
|
||||
success: function (res) {
|
||||
if(res && res.code === 200) {
|
||||
self.parent.$.colorbox.close();
|
||||
alert("操作成功!");
|
||||
}
|
||||
else {
|
||||
alert("操作失败!");
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
});
|
||||
|
||||
//检查记录是否存在
|
||||
function checkRoleFunctions() {
|
||||
//表示是否存在 0 = 不存在,存在就返回id
|
||||
var flag = 0;
|
||||
//开始ajax名称检验,是否存在
|
||||
$.ajax({
|
||||
type: "get",
|
||||
url: "/userBusiness/checkIsValueExist",
|
||||
dataType: "json",
|
||||
async: false,
|
||||
data: ({
|
||||
type: type,
|
||||
keyId: url_id
|
||||
}),
|
||||
success: function (res) {
|
||||
if(res.data && res.data.id) {
|
||||
flag = res.data.id;
|
||||
}
|
||||
},
|
||||
//此处添加错误处理
|
||||
error: function () {
|
||||
$.messager.alert('提示', '检查角色对应功能是否存在异常,请稍后再试!', 'error');
|
||||
return;
|
||||
}
|
||||
});
|
||||
return flag;
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
259
erp_web/pages/manage/rolePushBtn.html
Normal file
259
erp_web/pages/manage/rolePushBtn.html
Normal file
@@ -0,0 +1,259 @@
|
||||
<!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="/images/favicon.ico" type="image/x-icon"/>
|
||||
<script type="text/javascript" src="/js/jquery-1.8.0.min.js"></script>
|
||||
<link rel="stylesheet" type="text/css" href="/js/easyui-1.3.5/themes/default/easyui.css"/>
|
||||
<link rel="stylesheet" type="text/css" href="/js/easyui-1.3.5/themes/icon.css"/>
|
||||
<link type="text/css" rel="stylesheet" href="/css/common.css"/>
|
||||
<script type="text/javascript" src="/js/easyui-1.3.5/jquery.easyui.min.js"></script>
|
||||
<script type="text/javascript" src="/js/easyui-1.3.5/locale/easyui-lang-zh_CN.js"></script>
|
||||
<script type="text/javascript" src="/js/common/common.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<!-- 数据显示table -->
|
||||
<div style="padding-bottom: 10px;">
|
||||
<a id="btnOK" class="easyui-linkbutton" iconCls="icon-ok">保存</a>
|
||||
</div>
|
||||
<div id="pushList">
|
||||
<!-- 数据显示table -->
|
||||
<div id="tablePanel" class="easyui-panel" style="padding:1px; top:300px;" title="功能列表-选择按钮权限" iconCls="icon-list"
|
||||
closable="false">
|
||||
<table id="tableData" style="top:300px;border-bottom-color:#FFFFFF"></table>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script type="text/javascript">
|
||||
var keyId = getUrlParam('id'); //获取传值id(角色id)
|
||||
var pushBtnJSON;
|
||||
var userBusinessId = 0; //关系id
|
||||
var roleBtnStr = ""; //角色按钮权限
|
||||
//初始化界面
|
||||
$(function () {
|
||||
initJSON();
|
||||
initTableData();
|
||||
ininPager();
|
||||
showDetails(1, initPageSize);
|
||||
bindEvent();
|
||||
});
|
||||
|
||||
//初始化JSON
|
||||
function initJSON() {
|
||||
var url = '/js/pages/manage/pushBtn.json';
|
||||
$.ajax({
|
||||
url: url,
|
||||
type: "get",
|
||||
async: false,
|
||||
success: function (res) {
|
||||
if (res) {
|
||||
pushBtnJSON = res;
|
||||
}
|
||||
},
|
||||
error: function () {
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
//初始化表格数据
|
||||
function initTableData() {
|
||||
$('#tableData').datagrid({
|
||||
height: 360,
|
||||
rownumbers: true,
|
||||
//动画效果
|
||||
animate: false,
|
||||
//交替出现背景
|
||||
striped: true,
|
||||
columns: [[
|
||||
{field: 'Id', align: "center", hidden: true},
|
||||
{title: '名称', field: 'Name', width: 100},
|
||||
{
|
||||
title: '按钮列表', field: 'PushBtnList', width: 400, formatter: function (value, rec) {
|
||||
var btnStr = rec.PushBtn;
|
||||
if (btnStr != undefined) {
|
||||
var arr = btnStr.split(",");
|
||||
if (arr.length) {
|
||||
var str = "";
|
||||
for (var i = 0; i < arr.length; i++) {
|
||||
for (var j = 0; j < pushBtnJSON.length; j++) {
|
||||
if (pushBtnJSON[j].id === arr[i] - 0) {
|
||||
str += "<input type='checkbox' value='" + pushBtnJSON[j].id + "' />" + pushBtnJSON[j].text;
|
||||
}
|
||||
}
|
||||
}
|
||||
return str;
|
||||
|
||||
}
|
||||
}
|
||||
else {
|
||||
return "";
|
||||
}
|
||||
}
|
||||
}
|
||||
]],
|
||||
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
|
||||
});
|
||||
showDetails(pageNum, pageSize);
|
||||
}
|
||||
});
|
||||
}
|
||||
catch (e) {
|
||||
$.messager.alert('异常处理提示', "分页信息异常 : " + e.name + ": " + e.message, 'error');
|
||||
}
|
||||
}
|
||||
|
||||
function showDetails(pageNo, pageSize) {
|
||||
$.ajax({
|
||||
url: "/userBusiness/getBasicData.action",
|
||||
type: "get",
|
||||
data: {
|
||||
Type: 'RoleFunctions',
|
||||
KeyId: keyId
|
||||
},
|
||||
success: function (res) {
|
||||
if (res && res.showModel && res.showModel.map && res.showModel.map.userBusinessList && res.showModel.map.userBusinessList[0]) {
|
||||
userBusinessId = res.showModel.map.userBusinessList[0].id;
|
||||
roleBtnStr = res.showModel.map.userBusinessList[0].btnStr;
|
||||
var getValue = res.showModel.map.userBusinessList[0].value;
|
||||
getValue = getValue.substring(1, getValue.length - 1);
|
||||
if (getValue.indexOf("][")) {
|
||||
var arr = getValue.split("][");
|
||||
arr = arr.toString();
|
||||
$.ajax({
|
||||
url: "/functions/findByIds.action",
|
||||
type: "get",
|
||||
data: {
|
||||
FunctionsIDs: arr
|
||||
},
|
||||
success: function (rec) {
|
||||
$("#tableData").datagrid('loadData', JSON.parse(rec));
|
||||
},
|
||||
error: function () {
|
||||
$.messager.alert('提示', '查询数据异常,请稍后再试!', 'error');
|
||||
return;
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
},
|
||||
error: function () {
|
||||
$.messager.alert('提示', '查询数据异常,请稍后再试!', 'error');
|
||||
return;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function bindEvent() {
|
||||
setTimeout(function () {
|
||||
var bindBody = $("#pushList .datagrid-view2 .datagrid-body");
|
||||
|
||||
//加载按钮信息到缓存中
|
||||
if (roleBtnStr) {
|
||||
var roleBtnStrArr = JSON.parse(roleBtnStr);
|
||||
bindBody.find(".datagrid-row").each(function () {
|
||||
for (var i = 0; i < roleBtnStrArr.length; i++) {
|
||||
if (roleBtnStrArr[i] && roleBtnStrArr[i].funId) {
|
||||
var thisId = $(this).find("[field='Id']").text() - 0;
|
||||
if (roleBtnStrArr[i].funId == thisId) {
|
||||
$(this).find("[field='Id']").attr("data-btn", roleBtnStrArr[i].btnStr);
|
||||
//加载勾选状态
|
||||
$(this).find("[field='PushBtnList']").find("input").each(function () {
|
||||
var thisValue = $(this).val(); //勾选的值
|
||||
if (roleBtnStrArr[i].btnStr.indexOf(thisValue) > -1) {
|
||||
$(this).prop("checked", "checked");
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
//按钮勾选事件
|
||||
bindBody.find("[field='PushBtnList']").find("input").off("click").on("click", function () {
|
||||
var checkStr = "";
|
||||
$(this).closest(".datagrid-cell").find("input").each(function () {
|
||||
var thisValue = $(this).val(); //勾选的值
|
||||
var isChecked = $(this).prop("checked");
|
||||
if (isChecked) {
|
||||
checkStr = checkStr + thisValue + ",";
|
||||
}
|
||||
});
|
||||
if (checkStr) {
|
||||
checkStr = checkStr.substring(0, checkStr.length - 1);
|
||||
}
|
||||
$(this).closest(".datagrid-row").find("[field='Id']").attr("data-btn", checkStr);
|
||||
});
|
||||
}, 500);
|
||||
|
||||
$("#btnOK").off("click").on("click", function () {
|
||||
if (confirm("您确定要保存吗?")) {
|
||||
var bindList = $("#pushList .datagrid-view2 .datagrid-body .datagrid-row");
|
||||
var bindArr = [];
|
||||
var btnStr = "";
|
||||
bindList.each(function () {
|
||||
var funId = $(this).find("[field='Id']").text();
|
||||
var btnStr = $(this).find("[field='Id']").attr("data-btn");
|
||||
if (btnStr !== undefined && btnStr !== "") {
|
||||
var bindJSON = {};
|
||||
bindJSON.funId = funId;
|
||||
bindJSON.btnStr = btnStr;
|
||||
bindArr.push(bindJSON);
|
||||
}
|
||||
});
|
||||
if (bindArr.length) {
|
||||
btnStr = JSON.stringify(bindArr);
|
||||
}
|
||||
$.ajax({
|
||||
url: "/userBusiness/updateBtnStr.action",
|
||||
type: "get",
|
||||
data: {
|
||||
UserBusinessID: userBusinessId,
|
||||
BtnStr: btnStr
|
||||
},
|
||||
success: function (res) {
|
||||
if (res) {
|
||||
self.parent.$.colorbox.close();
|
||||
alert("操作成功!");
|
||||
}
|
||||
else {
|
||||
$.messager.show({
|
||||
title: '错误提示',
|
||||
msg: '保存按钮权限信息失败,请稍后重试!'
|
||||
});
|
||||
}
|
||||
},
|
||||
error: function () {
|
||||
$.messager.alert('提示', '保存数据异常,请稍后再试!', 'error');
|
||||
return;
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
143
erp_web/pages/manage/systemConfig.html
Normal file
143
erp_web/pages/manage/systemConfig.html
Normal file
@@ -0,0 +1,143 @@
|
||||
<!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="/images/favicon.ico" type="image/x-icon"/>
|
||||
<script type="text/javascript" src="/js/jquery-1.8.0.min.js"></script>
|
||||
<script type="text/javascript" src="/js/colorbox/jquery.colorbox-min.js"></script>
|
||||
<script type="text/javascript" src="/js/colorbox/colorboxSet.js"></script>
|
||||
<link href="/js/colorbox/colorbox.css" rel="stylesheet" type="text/css"/>
|
||||
<link rel="stylesheet" type="text/css" href="/js/easyui-1.3.5/themes/default/easyui.css"/>
|
||||
<link rel="stylesheet" type="text/css" href="/js/easyui-1.3.5/themes/icon.css"/>
|
||||
<link type="text/css" rel="stylesheet" href="/css/common.css"/>
|
||||
<script type="text/javascript" src="/js/easyui-1.3.5/jquery.easyui.min.js"></script>
|
||||
<script type="text/javascript" src="/js/easyui-1.3.5/locale/easyui-lang-zh_CN.js"></script>
|
||||
<script type="text/javascript" src="/js/common/common.js"></script>
|
||||
<script>
|
||||
$(function () {
|
||||
//加载信息
|
||||
function loadInfo() {
|
||||
$.ajax({
|
||||
type: "get",
|
||||
url: "/systemConfig/list",
|
||||
dataType: "json",
|
||||
data: ({
|
||||
currentPage: 1,
|
||||
pageSize: 100
|
||||
}),
|
||||
success: function (res) {
|
||||
if (res && res.code === 200) {
|
||||
if(res.data && res.data.page) {
|
||||
var array = res.data.page.rows;
|
||||
for (var i = 0; i < array.length; i++) {
|
||||
var name = array[i].name;
|
||||
$("." + name).val(array[i].value).attr("data-value", array[i].value).attr("data-id", array[i].id);
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
//此处添加错误处理
|
||||
error: function () {
|
||||
$.messager.alert('查询失败', '查询系统配置信息异常,请稍后再试!', 'error');
|
||||
return;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
loadInfo(); //加载信息
|
||||
|
||||
$("#saveSystemConfig").off("click").on("click", function () {
|
||||
var status = false;
|
||||
$("#searchTable input").each(function () {
|
||||
var thisId = $(this).attr("data-id");
|
||||
var thisValue = $(this).attr("data-value");
|
||||
if ($(this).val() != thisValue) {
|
||||
//更新修改过的单行信息
|
||||
$.ajax({
|
||||
type: "post",
|
||||
url: "/systemConfig/update?id=" + thisId,
|
||||
dataType: "json",
|
||||
data: {
|
||||
info: JSON.stringify({
|
||||
value: $(this).val()
|
||||
})
|
||||
},
|
||||
success: function (res) {
|
||||
if (res && res.code === 200) {
|
||||
status = true;
|
||||
}
|
||||
},
|
||||
//此处添加错误处理
|
||||
error: function () {
|
||||
$.messager.alert('保存失败', '保存系统配置信息失败,请稍后再试!', 'error');
|
||||
return;
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
setTimeout(function () {
|
||||
if (status) {
|
||||
$.messager.alert('保存成功', '保存系统配置信息成功!', 'info');
|
||||
loadInfo(); //加载信息
|
||||
}
|
||||
else {
|
||||
$.messager.alert('提示', '信息未修改,无需保存!', 'info');
|
||||
}
|
||||
}, 1000);
|
||||
});
|
||||
})
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<div class="system-config">
|
||||
<table id="searchTable">
|
||||
<tr>
|
||||
<td>公司名称:</td>
|
||||
<td>
|
||||
<input type="text" class="company_name easyui-validatebox"
|
||||
data-options="required:true,validType:'length[2,30]'" style="width:250px;"/>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>联系人:</td>
|
||||
<td>
|
||||
<input type="text" class="company_contacts" style="width:250px;"/>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>公司地址:</td>
|
||||
<td>
|
||||
<input type="text" class="company_address" style="width:250px;"/>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>公司电话:</td>
|
||||
<td>
|
||||
<input type="text" class="company_tel" style="width:250px;"/>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>公司传真:</td>
|
||||
<td>
|
||||
<input type="text" class="company_fax" style="width:250px;"/>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>公司邮编:</td>
|
||||
<td>
|
||||
<input type="text" class="company_post_code" style="width:250px;"/>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td>
|
||||
<a href="javascript:void(0)" id="saveSystemConfig" class="easyui-linkbutton" iconCls="icon-ok">保存信息</a>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
434
erp_web/pages/manage/unit.html
Normal file
434
erp_web/pages/manage/unit.html
Normal file
@@ -0,0 +1,434 @@
|
||||
<!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="/images/favicon.ico" type="image/x-icon"/>
|
||||
<link rel="stylesheet" type="text/css" href="/js/easyui-1.3.5/themes/default/easyui.css"/>
|
||||
<link rel="stylesheet" type="text/css" href="/js/easyui-1.3.5/themes/icon.css"/>
|
||||
<link type="text/css" rel="stylesheet" href="/css/common.css"/>
|
||||
<script type="text/javascript" src="/js/jquery-1.8.0.min.js"></script>
|
||||
<script type="text/javascript" src="/js/easyui-1.3.5/jquery.easyui.min.js"></script>
|
||||
<script type="text/javascript" src="/js/easyui-1.3.5/locale/easyui-lang-zh_CN.js"></script>
|
||||
<script type="text/javascript" src="/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>
|
||||
<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="unitDlg" class="easyui-dialog" style="width:380px;padding:10px 20px"
|
||||
closed="true" buttons="#dlg-buttons" modal="true" cache="false" collapsible="false" closable="true">
|
||||
<form id="unitFM" method="post" novalidate>
|
||||
<table>
|
||||
<tr>
|
||||
<td>基本单位</td>
|
||||
<td style="padding:5px">
|
||||
<input name="basicName" id="basicName" class="easyui-validatebox"
|
||||
data-options="required:true,validType:'length[1,10]'" style="width: 100px;height: 20px"/>
|
||||
基本单位应为最小度量单位
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>副单位</td>
|
||||
<td style="padding:5px">
|
||||
<input name="otherName" id="otherName" class="easyui-validatebox"
|
||||
data-options="required:true,validType:'length[1,5]'" style="width: 100px;height: 20px"/>
|
||||
=
|
||||
<input name="otherNum" id="otherNum" class="easyui-validatebox"
|
||||
data-options="required:true,validType:'length[1,5]'" style="width: 50px;height: 20px"/>
|
||||
<span id="unitName"></span>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
</div>
|
||||
<div id="dlg-buttons">
|
||||
<a href="javascript:void(0)" id="saveUnit" class="easyui-linkbutton" iconCls="icon-ok">保存</a>
|
||||
<a href="javascript:void(0)" id="cancelUnit" class="easyui-linkbutton" iconCls="icon-cancel"
|
||||
onclick="javascript:$('#unitDlg').dialog('close')">取消</a>
|
||||
</div>
|
||||
|
||||
<script type="text/javascript">
|
||||
//初始化界面
|
||||
$(function () {
|
||||
initTableData();
|
||||
ininPager();
|
||||
initForm();
|
||||
});
|
||||
|
||||
//防止表单提交重复
|
||||
function initForm() {
|
||||
$('#unitFM').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,
|
||||
pagination: true,
|
||||
//交替出现背景
|
||||
striped: true,
|
||||
//loadFilter: pagerFilter,
|
||||
pageSize: initPageSize,
|
||||
pageList: initPageNum,
|
||||
columns: [[
|
||||
{field: 'id', width: 35, align: "center", checkbox: true},
|
||||
{
|
||||
title: '操作', field: 'op', align: "center", width: 60,
|
||||
formatter: function (value, rec) {
|
||||
var str = '';
|
||||
var rowInfo = rec.id + 'AaBb' + rec.uname;
|
||||
str += '<img title="编辑" src="/js/easyui-1.3.5/themes/icons/pencil.png" style="cursor: pointer;" onclick="editUnit(\'' + rowInfo + '\');"/> ';
|
||||
str += '<img title="删除" src="/js/easyui-1.3.5/themes/icons/edit_remove.png" style="cursor: pointer;" onclick="deleteUnit(' + rec.id + ');"/>';
|
||||
return str;
|
||||
}
|
||||
},
|
||||
{title: '计量单位', field: 'uname', width: 200}
|
||||
]],
|
||||
toolbar: [
|
||||
{
|
||||
id: 'addUnit',
|
||||
text: '增加',
|
||||
iconCls: 'icon-add',
|
||||
handler: function () {
|
||||
addUnit();
|
||||
}
|
||||
}, '-',
|
||||
{
|
||||
id: 'deleteUnit',
|
||||
text: '删除',
|
||||
iconCls: 'icon-remove',
|
||||
handler: function () {
|
||||
batDeleteUnit();
|
||||
}
|
||||
}
|
||||
],
|
||||
onLoadError: function () {
|
||||
$.messager.alert('页面加载提示', '页面加载异常,请稍后再试!', 'error');
|
||||
return;
|
||||
}
|
||||
});
|
||||
showUnitDetails(1, initPageSize);
|
||||
}
|
||||
|
||||
//初始化键盘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")) {
|
||||
$("#saveUnit").click();
|
||||
}
|
||||
//搜索按钮添加快捷键
|
||||
if (k == "13" && (obj.id == "searchName")) {
|
||||
$("#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
|
||||
});
|
||||
showUnitDetails(pageNum, pageSize);
|
||||
}
|
||||
});
|
||||
}
|
||||
catch (e) {
|
||||
$.messager.alert('异常处理提示', "分页信息异常 : " + e.name + ": " + e.message, 'error');
|
||||
}
|
||||
}
|
||||
|
||||
//删除计量单位
|
||||
function deleteUnit(unitID) {
|
||||
$.messager.confirm('删除确认', '确定要删除此计量单位吗?', function (r) {
|
||||
if (r) {
|
||||
$.ajax({
|
||||
type: "post",
|
||||
url: "/unit/" + unitID + "/delete",
|
||||
dataType: "json",
|
||||
success: function (res) {
|
||||
if(res && res.code == 200) {
|
||||
$("#searchBtn").click();
|
||||
} else {
|
||||
$.messager.alert('删除提示', '删除计量单位失败,请稍后再试!', 'error');
|
||||
}
|
||||
},
|
||||
//此处添加错误处理
|
||||
error: function () {
|
||||
$.messager.alert('删除提示', '删除计量单位异常,请稍后再试!', 'error');
|
||||
return;
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
//批量删除计量单位
|
||||
function batDeleteUnit() {
|
||||
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: "/unit/batchDelete",
|
||||
dataType: "json",
|
||||
async: false,
|
||||
data: ({
|
||||
ids: ids
|
||||
}),
|
||||
success: function (res) {
|
||||
if(res && res.code === 200) {
|
||||
$("#searchBtn").click();
|
||||
$(":checkbox").attr("checked", false);
|
||||
} else {
|
||||
$.messager.alert('删除提示', '删除计量单位失败,请稍后再试!', 'error');
|
||||
}
|
||||
},
|
||||
//此处添加错误处理
|
||||
error: function () {
|
||||
$.messager.alert('删除提示', '删除计量单位异常,请稍后再试!', 'error');
|
||||
return;
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
//增加
|
||||
var url;
|
||||
var unitID = 0;
|
||||
//保存编辑前的名称
|
||||
var oldUnit = "";
|
||||
|
||||
function addUnit() {
|
||||
$('#unitDlg').dialog('open').dialog('setTitle', '<img src="/js/easyui-1.3.5/themes/icons/edit_add.png"/> 增加计量单位');
|
||||
$(".window-mask").css({width: webW, height: webH});
|
||||
$('#unitFM').form('clear');
|
||||
$("#name").focus();
|
||||
$("#unitName").text("");
|
||||
oldUnit = "";
|
||||
unitID = 0;
|
||||
url = '/unit/add';
|
||||
}
|
||||
|
||||
//保存信息
|
||||
$("#saveUnit").off("click").on("click", function () {
|
||||
if (checkUnitName()) {
|
||||
return;
|
||||
}
|
||||
var basicName = $.trim($("#basicName").val());
|
||||
var otherName = $.trim($("#otherName").val());
|
||||
var otherNum = $.trim($("#otherNum").val());
|
||||
var name = basicName + "," + otherName + "(1:" + otherNum + ")";
|
||||
|
||||
$.ajax({
|
||||
url: url,
|
||||
type: "post",
|
||||
dataType: "json",
|
||||
data: ({
|
||||
info: JSON.stringify({
|
||||
uname: name
|
||||
})
|
||||
}),
|
||||
success: function(res) {
|
||||
if(res && res.code === 200) {
|
||||
$('#unitDlg').dialog('close');
|
||||
//加载完以后重新初始化
|
||||
var opts = $("#tableData").datagrid('options');
|
||||
showUnitDetails(opts.pageNumber, opts.pageSize);
|
||||
}
|
||||
},
|
||||
//此处添加错误处理
|
||||
error: function () {
|
||||
$.messager.alert('提示', '保存计量单位异常,请稍后再试!', 'error');
|
||||
return;
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
//编辑信息
|
||||
function editUnit(unitTotalInfo) {
|
||||
var unitInfo = unitTotalInfo.split("AaBb");
|
||||
|
||||
oldUnit = unitInfo[1];
|
||||
$('#unitDlg').dialog('open').dialog('setTitle', '<img src="/js/easyui-1.3.5/themes/icons/pencil.png"/> 编辑计量单位');
|
||||
$(".window-mask").css({width: webW, height: webH});
|
||||
unitID = unitInfo[0];
|
||||
//焦点在名称输入框==定焦在输入文字后面
|
||||
var name = unitInfo[1];
|
||||
var basicName = name.substring(0, name.indexOf(",")); //基础单位
|
||||
$("#basicName").val(basicName);
|
||||
var otherItem = name.substring(name.indexOf(",") + 1);
|
||||
var otherName = otherItem.substring(0, otherItem.indexOf("("));
|
||||
$("#otherName").val(otherName);
|
||||
var lastNum = otherItem.substring(otherItem.indexOf(":") + 1);
|
||||
lastNum = lastNum.replace(")", "");
|
||||
$("#otherNum").val(lastNum);
|
||||
$("#unitName").text(basicName);
|
||||
url = '/unit/update?id=' + unitInfo[0];
|
||||
}
|
||||
|
||||
//检查名称是否存在 ++ 重名无法提示问题需要跟进
|
||||
function checkUnitName() {
|
||||
var name = $.trim($("#name").val());
|
||||
//表示是否存在 true == 存在 false = 不存在
|
||||
var flag = false;
|
||||
//开始ajax名称检验,不能重名
|
||||
if (name.length > 0 && (oldUnit.length == 0 || name != oldUnit)) {
|
||||
$.ajax({
|
||||
type: "get",
|
||||
url: "/unit/checkIsNameExist",
|
||||
dataType: "json",
|
||||
async: false,
|
||||
data: ({
|
||||
id: unitID,
|
||||
name: name
|
||||
}),
|
||||
success: function (res) {
|
||||
if(res && res.code === 200) {
|
||||
if(res.data && res.data.status) {
|
||||
flag = res.data.status;
|
||||
if (flag) {
|
||||
$.messager.alert('提示', '计量单位名称已经存在', 'info');
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
//此处添加错误处理
|
||||
error: function () {
|
||||
$.messager.alert('提示', '检查计量单位名称是否存在异常,请稍后再试!', 'error');
|
||||
return;
|
||||
}
|
||||
});
|
||||
}
|
||||
return flag;
|
||||
}
|
||||
|
||||
//搜索处理
|
||||
$("#searchBtn").unbind().bind({
|
||||
click: function () {
|
||||
showUnitDetails(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 showUnitDetails(pageNo, pageSize) {
|
||||
var uName = $.trim($("#searchName").val());
|
||||
$.ajax({
|
||||
type: "get",
|
||||
url: "/unit/list",
|
||||
dataType: "json",
|
||||
data: ({
|
||||
search: JSON.stringify({
|
||||
name: uName
|
||||
}),
|
||||
currentPage: pageNo,
|
||||
pageSize: pageSize
|
||||
}),
|
||||
success: function (res) {
|
||||
if(res && res.code === 200){
|
||||
if(res.data && res.data.page) {
|
||||
$("#tableData").datagrid('loadData', res.data.page);
|
||||
}
|
||||
}
|
||||
},
|
||||
//此处添加错误处理
|
||||
error: function () {
|
||||
$.messager.alert('查询提示', '查询数据后台异常,请稍后再试!', 'error');
|
||||
return;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
//重置按钮
|
||||
$("#searchResetBtn").unbind().bind({
|
||||
click: function () {
|
||||
$("#searchName").val("");
|
||||
//加载完以后重新初始化
|
||||
$("#searchBtn").click();
|
||||
}
|
||||
});
|
||||
|
||||
//单位名称事件
|
||||
$("#basicName").off("keyup").on("keyup", function () {
|
||||
$("#unitName").text($(this).val());
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
553
erp_web/pages/manage/user.html
Normal file
553
erp_web/pages/manage/user.html
Normal file
@@ -0,0 +1,553 @@
|
||||
<!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="/images/favicon.ico" type="image/x-icon"/>
|
||||
<script type="text/javascript" src="/js/jquery-1.8.0.min.js"></script>
|
||||
<script type="text/javascript" src="/js/colorbox/jquery.colorbox-min.js"></script>
|
||||
<script type="text/javascript" src="/js/colorbox/colorboxSet.js"></script>
|
||||
<link href="/js/colorbox/colorbox.css" rel="stylesheet" type="text/css"/>
|
||||
<link rel="stylesheet" type="text/css" href="/js/easyui-1.3.5/themes/default/easyui.css"/>
|
||||
<link rel="stylesheet" type="text/css" href="/js/easyui-1.3.5/themes/icon.css"/>
|
||||
<link type="text/css" rel="stylesheet" href="/css/common.css"/>
|
||||
<script type="text/javascript" src="/js/easyui-1.3.5/jquery.easyui.min.js"></script>
|
||||
<script type="text/javascript" src="/js/easyui-1.3.5/locale/easyui-lang-zh_CN.js"></script>
|
||||
<script type="text/javascript" src="/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="searchLoginame" id="searchLoginame" style="width:100px;"/>
|
||||
</td>
|
||||
<td> </td>
|
||||
<td> </td>
|
||||
<td>用户名称:</td>
|
||||
<td>
|
||||
<input type="text" name="searchUsername" id="searchUsername" 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>
|
||||
<a id="btnSetCustomer" 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="loginameLabel">登录名称 </label>
|
||||
<input name="loginame" id="loginame" class="easyui-validatebox"
|
||||
data-options="required:true,validType:'length[2,15]'" style="width: 120px;height: 20px"/>
|
||||
初始密码:123456
|
||||
</div>
|
||||
<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="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>
|
||||
</form>
|
||||
</div>
|
||||
<div id="dlg-buttons">
|
||||
<a href="javascript:void(0)" id="resetPwd" class="easyui-linkbutton" iconCls="icon-redo">重置密码</a>
|
||||
<a href="javascript:void(0)" id="saveusername" class="easyui-linkbutton" iconCls="icon-ok">保存</a>
|
||||
<a href="javascript:void(0)" id="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({
|
||||
height: heightInfo,
|
||||
nowrap: false,
|
||||
rownumbers: false,
|
||||
//动画效果
|
||||
animate: false,
|
||||
//选中单行
|
||||
singleSelect: true,
|
||||
collapsible: false,
|
||||
pagination: true,
|
||||
//交替出现背景
|
||||
striped: true,
|
||||
pageSize: initPageSize,
|
||||
pageList: initPageNum,
|
||||
columns: [[
|
||||
{field: 'id', width: 35, align: "center", checkbox:true},
|
||||
{title: '登录名称', field: 'loginame', width: 80},
|
||||
{title: '用户名称', field: 'username', 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: 'isystem', 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 (0 == value) {
|
||||
str += '<img src="/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="/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> ';
|
||||
}
|
||||
else {
|
||||
str += '';
|
||||
}
|
||||
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;
|
||||
}
|
||||
});
|
||||
showUserDetails(1, initPageSize);
|
||||
}
|
||||
|
||||
//初始化键盘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: "/user/" + userID + "/delete",
|
||||
dataType: "json",
|
||||
success: function (res) {
|
||||
if(res && res.code == 200) {
|
||||
$("#searchBtn").click();
|
||||
} 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 + ",";
|
||||
}
|
||||
if(row[i].loginame == "jsh"){
|
||||
$.messager.alert('提示', '管理员jsh不能删除!', 'warning');
|
||||
return;
|
||||
} else {
|
||||
$.ajax({
|
||||
type: "post",
|
||||
url: "/user/batchDelete",
|
||||
dataType: "json",
|
||||
async: false,
|
||||
data: ({
|
||||
ids: ids,
|
||||
}),
|
||||
success: function (res) {
|
||||
if(res && res.code === 200) {
|
||||
$("#searchBtn").click();
|
||||
$(":checkbox").attr("checked", false);
|
||||
} else {
|
||||
$.messager.alert('删除提示', '删除用户信息失败,请稍后再试!', 'error');
|
||||
}
|
||||
},
|
||||
//此处添加错误处理
|
||||
error: function () {
|
||||
$.messager.alert('删除提示', '删除用户信息异常,请稍后再试!', 'error');
|
||||
return;
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
//增加用户
|
||||
var url;
|
||||
var userID = 0;
|
||||
//保存编辑前的名称
|
||||
var oldLoginName = "";
|
||||
|
||||
function addUser() {
|
||||
$('#userDlg').dialog('open').dialog('setTitle', '<img src="/js/easyui-1.3.5/themes/icons/edit_add.png"/> 增加用户');
|
||||
$(".window-mask").css({width: webW, height: webH});
|
||||
$('#usernameFM').form('clear');
|
||||
var row = {};
|
||||
$('#usernameFM').form('load', row);
|
||||
$("#username").focus();
|
||||
oldLoginName = "";
|
||||
userID = 0;
|
||||
url = '/user/add';
|
||||
}
|
||||
|
||||
//重置用户密码
|
||||
$("#resetPwd").off("click").on("click", function () {
|
||||
$.messager.confirm('重置用户密码', '确定重置该用户的密码为123456吗?', function (r) {
|
||||
if (r) {
|
||||
$.ajax({
|
||||
type: "post",
|
||||
url: "/user/resetPwd",
|
||||
dataType: "json",
|
||||
data: ({
|
||||
id: userID
|
||||
}),
|
||||
success: function (res) {
|
||||
if (res && res.code === 200) {
|
||||
$.messager.alert('提示', '重置密码成功', 'info');
|
||||
}
|
||||
},
|
||||
//此处添加错误处理
|
||||
error: function () {
|
||||
$.messager.alert('提示', '重置密码失败,请稍后再试!', 'error');
|
||||
return;
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
//保存用户信息
|
||||
$("#saveusername").off("click").on("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;
|
||||
}
|
||||
$.ajax({
|
||||
url: url,
|
||||
type: "post",
|
||||
dataType: "json",
|
||||
data: {
|
||||
info: JSON.stringify($("#usernameFM").serializeObject())
|
||||
},
|
||||
success: function(res) {
|
||||
if(res && res.code === 200) {
|
||||
$('#userDlg').dialog('close');
|
||||
//加载完以后重新初始化
|
||||
var opts = $("#tableData").datagrid('options');
|
||||
showUserDetails(opts.pageNumber, opts.pageSize);
|
||||
}
|
||||
},
|
||||
//此处添加错误处理
|
||||
error: function () {
|
||||
$.messager.alert('提示', '网络异常,请稍后再试!', 'error');
|
||||
return;
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
//编辑用户信息
|
||||
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]
|
||||
};
|
||||
oldLoginName = usernameInfo[1];
|
||||
$('#userDlg').dialog('open').dialog('setTitle', '<img src="/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 = '/user/update?id=' + usernameInfo[0];
|
||||
}
|
||||
|
||||
//检查用户 名称是否存在 ++ 重名无法提示问题需要跟进
|
||||
function checkusernameName() {
|
||||
var loginName = $.trim($("#loginame").val());
|
||||
//表示是否存在 true == 存在 false = 不存在
|
||||
var flag = false;
|
||||
//开始ajax名称检验,不能重名
|
||||
if (loginName.length > 0 && (oldLoginName.length == 0 || loginName != oldLoginName)) {
|
||||
$.ajax({
|
||||
type: "get",
|
||||
url: "/user/checkIsNameExist",
|
||||
dataType: "json",
|
||||
async: false,
|
||||
data: ({
|
||||
id: userID,
|
||||
name: loginName
|
||||
}),
|
||||
success: function (res) {
|
||||
if(res && res.code === 200) {
|
||||
if(res.data && res.data.status) {
|
||||
flag = res.data.status;
|
||||
if (flag) {
|
||||
$.messager.alert('提示', '用户名称已经存在', 'info');
|
||||
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) {
|
||||
var userName = $.trim($("#searchUsername").val());
|
||||
var loginName = $.trim($("#searchLoginame").val());
|
||||
$.ajax({
|
||||
type: "get",
|
||||
url: "/user/list",
|
||||
dataType: "json",
|
||||
data: ({
|
||||
search: JSON.stringify({
|
||||
userName: userName,
|
||||
loginName: loginName
|
||||
}),
|
||||
currentPage: pageNo,
|
||||
pageSize: pageSize
|
||||
}),
|
||||
success: function (res) {
|
||||
if(res && res.code === 200){
|
||||
if(res.data && res.data.page) {
|
||||
$("#tableData").datagrid('loadData', res.data.page);
|
||||
}
|
||||
}
|
||||
},
|
||||
//此处添加错误处理
|
||||
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 = "/pages/user/userRole.html?id=" + currentRow.id;
|
||||
});
|
||||
|
||||
//分配部门
|
||||
$('#btnSetDepart').click(function () {
|
||||
var currentRow = $("#tableData").datagrid("getSelected");
|
||||
if (currentRow == null) {
|
||||
alert("请选择一条数据再操作!");
|
||||
return false;
|
||||
}
|
||||
this.href = "/pages/user/userDepot.html?id=" + currentRow.id;
|
||||
});
|
||||
|
||||
//分配客户
|
||||
$('#btnSetCustomer').click(function () {
|
||||
var currentRow = $("#tableData").datagrid("getSelected");
|
||||
if (currentRow == null) {
|
||||
alert("请选择一条数据再操作!");
|
||||
return false;
|
||||
}
|
||||
this.href = "/pages/user/userCustomer.html?id=" + currentRow.id;
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
188
erp_web/pages/manage/vendor.html
Normal file
188
erp_web/pages/manage/vendor.html
Normal file
@@ -0,0 +1,188 @@
|
||||
<!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="/images/favicon.ico" type="image/x-icon"/>
|
||||
<link rel="stylesheet" type="text/css" href="/js/easyui-1.3.5/themes/default/easyui.css"/>
|
||||
<link rel="stylesheet" type="text/css" href="/js/easyui-1.3.5/themes/icon.css"/>
|
||||
<link type="text/css" rel="stylesheet" href="/css/common.css"/>
|
||||
<script type="text/javascript" src="/js/jquery-1.8.0.min.js"></script>
|
||||
<script type="text/javascript" src="/js/easyui-1.3.5/jquery.easyui.min.js"></script>
|
||||
<script type="text/javascript" src="/js/easyui-1.3.5/locale/easyui-lang-zh_CN.js"></script>
|
||||
<script type="text/javascript" src="/js/common/common.js"></script>
|
||||
<script src="/js/pages/manage/supplier.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:100px;"/>
|
||||
</td>
|
||||
<td> </td>
|
||||
<td>手机号码:</td>
|
||||
<td>
|
||||
<input type="text" name="searchTelephone" id="searchTelephone" style="width:100px;"/>
|
||||
</td>
|
||||
<td> </td>
|
||||
<td>联系电话:</td>
|
||||
<td>
|
||||
<input type="text" name="searchPhonenum" id="searchPhonenum" style="width:100px;"/>
|
||||
</td>
|
||||
<td> </td>
|
||||
<td id="searchDescLabel">备 注:</td>
|
||||
<td>
|
||||
<input type="text" name="searchDesc" id="searchDesc" style="width:100px;"/>
|
||||
</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:580px;padding:10px 20px"
|
||||
closed="true" buttons="#dlg-buttons" modal="true" collapsible="false" closable="true">
|
||||
<form id="supplierFM">
|
||||
<table>
|
||||
<tr>
|
||||
<td style="width: 80px;height: 20px">名称</td>
|
||||
<td style="width: 180px;padding:1px">
|
||||
<input name="supplier" id="supplier" class="easyui-validatebox"
|
||||
data-options="required:true,validType:'length[2,30]'" style="width: 160px;height: 20px"/>
|
||||
</td>
|
||||
<td style="width: 60px;height: 20px">联系人</td>
|
||||
<td style="width:180px;padding:1px;">
|
||||
<input name="contacts" id="contacts" class="easyui-validatebox" style="width: 160px;height: 20px"/>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>手机号码</td>
|
||||
<td style="padding:1px;">
|
||||
<input name="telephone" id="telephone" class="easyui-validatebox"
|
||||
style="width: 160px;height: 20px"/>
|
||||
</td>
|
||||
<td>电子邮箱</td>
|
||||
<td style="padding:1px">
|
||||
<input name="email" id="email" class="easyui-validatebox" validType="email"
|
||||
style="width: 160px;height: 20px"/>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>联系电话</td>
|
||||
<td style="padding:1px;">
|
||||
<input name="phonenum" id="phonenum" class="easyui-validatebox" style="width: 160px;height: 20px"/>
|
||||
</td>
|
||||
<td>传真</td>
|
||||
<td style="padding:1px">
|
||||
<input name="fax" id="fax" class="easyui-validatebox" style="width: 160px;height: 20px"/>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>期初应收</td>
|
||||
<td style="padding:1px">
|
||||
<input name="BeginNeedGet" id="BeginNeedGet" type="text" class="easyui-numberbox"
|
||||
data-options="min:0,precision:2" style="width: 160px;height: 20px"/>
|
||||
</td>
|
||||
<td>期初应付</td>
|
||||
<td style="padding:1px">
|
||||
<input name="BeginNeedPay" id="BeginNeedPay" type="text" class="easyui-numberbox"
|
||||
data-options="min:0,precision:2" style="width: 160px;height: 20px"/>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>累计应收</td>
|
||||
<td style="padding:1px">
|
||||
<input name="AllNeedGet" id="AllNeedGet" type="text" style="width: 160px;height: 20px"
|
||||
readonly="readonly"/>
|
||||
</td>
|
||||
<td>累计应付</td>
|
||||
<td style="padding:1px">
|
||||
<input name="AllNeedPay" id="AllNeedPay" type="text" style="width: 160px;height: 20px"
|
||||
readonly="readonly"/>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>纳税人识别号</td>
|
||||
<td style="padding:1px">
|
||||
<input name="taxNum" id="taxNum" class="easyui-validatebox" style="width: 160px;height: 20px"/>
|
||||
</td>
|
||||
<td>税率</td>
|
||||
<td style="padding:1px">
|
||||
<input name="taxRate" id="taxRate" class="easyui-validatebox" style="width: 160px;height: 20px"/>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>开户行</td>
|
||||
<td style="padding:1px">
|
||||
<input name="bankName" id="bankName" class="easyui-validatebox" style="width: 160px;height: 20px"/>
|
||||
</td>
|
||||
<td>账号</td>
|
||||
<td style="padding:1px">
|
||||
<input name="accountNumber" id="accountNumber" class="easyui-validatebox"
|
||||
style="width: 160px;height: 20px"/>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>地址</td>
|
||||
<td style="padding:1px" colspan="3">
|
||||
<input name="address" id="address" class="easyui-validatebox" style="width: 408px;height: 20px"/>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>备注</td>
|
||||
<td style="padding:1px" colspan="3">
|
||||
<textarea name="description" id="description" rows="2" cols="2" style="width: 408px;"></textarea>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</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>
|
||||
|
||||
<!-- 导入excel表格 -->
|
||||
<div id="importExcelDlg" style="padding:10px 20px">
|
||||
<form id="importExcelFM" method="post" enctype="multipart/form-data"
|
||||
action="/supplier/importExcelVendor.action">
|
||||
<div class="fitem" style="padding:5px">
|
||||
<label>文件名称 </label>
|
||||
<input name="supplierFile" id="supplierFile" type="file" style="width: 230px;height: 20px"/>
|
||||
</div>
|
||||
<div class="fitem" style="padding:5px">
|
||||
<label><b>导入注意</b> </label><span>(预收款、期初应收、期初应付、税率均为数值且要大于0;另外期初应收、期初应付不能同时输入)</span>
|
||||
</div>
|
||||
<div class="fitem" style="padding:5px;display: none;">
|
||||
<label>是否审查 </label>
|
||||
<select id="isCheck" name="isCheck" style="width: 230px;height: 20px">
|
||||
<option value="0">是</option>
|
||||
<option value="1" selected="selected">否</option>
|
||||
</select>
|
||||
</div>
|
||||
<input type="hidden" name="clientIp" id="clientIp" value="<%=clientIp %>"/>
|
||||
<div id="dlg-buttons5">
|
||||
<a href="javascript:void(0)" id="saveimport" class="easyui-linkbutton" iconCls="icon-ok">导入</a>
|
||||
<a href="javascript:void(0)" id="cancelimport" class="easyui-linkbutton" iconCls="icon-cancel"
|
||||
onclick="javascript:$('#importExcelDlg').dialog('close')">取消</a>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user