no commit message
This commit is contained in:
@@ -2,13 +2,12 @@
|
||||
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
|
||||
<%
|
||||
String path = request.getContextPath();
|
||||
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
|
||||
String clientIp = Tools.getCurrentUserIP();
|
||||
%>
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>部门管理</title>
|
||||
<title>仓库管理</title>
|
||||
<meta charset="utf-8">
|
||||
<!-- 指定以IE8的方式来渲染 -->
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE8"/>
|
||||
@@ -28,17 +27,14 @@
|
||||
<tr>
|
||||
<td>仓库名称:</td>
|
||||
<td>
|
||||
<input type="text" name="searchName" id="searchName" style="width:150px;"/>
|
||||
<input type="text" name="searchName" id="searchName" style="width:100px;"/>
|
||||
</td>
|
||||
<td> </td>
|
||||
<td> </td>
|
||||
<td id="searchRemarkLabel">描 述:</td>
|
||||
<td id="searchRemarkLabel">描述:</td>
|
||||
<td>
|
||||
<input type="text" name="searchRemark" id="searchRemark" style="width:150px;"/>
|
||||
<input type="text" name="searchRemark" id="searchRemark" 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>
|
||||
@@ -57,16 +53,40 @@
|
||||
<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>
|
||||
<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><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>
|
||||
<td>描述</td>
|
||||
<td style="padding:5px">
|
||||
<textarea name="remark" id="remark" rows="2" cols="2" style="width: 230px;"></textarea>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<input type="hidden" name="clientIp" id="clientIp" value="<%=clientIp %>"/>
|
||||
@@ -84,27 +104,7 @@
|
||||
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()
|
||||
@@ -117,8 +117,7 @@
|
||||
}
|
||||
|
||||
//初始化表格数据
|
||||
function initTableData()
|
||||
{
|
||||
function initTableData() {
|
||||
$('#tableData').datagrid({
|
||||
//title:'仓库列表',
|
||||
//iconCls:'icon-save',
|
||||
@@ -143,45 +142,46 @@
|
||||
pageSize: initPageSize,
|
||||
pageList: initPageNum,
|
||||
columns:[[
|
||||
{ field: 'id',width:35,align:"center",checkbox:true},
|
||||
{ title: '仓库名称',field: 'name',width:200},
|
||||
{ title: '排序',field: 'sort',width:200},
|
||||
{ title: '描述',field: 'remark',width:200},
|
||||
{ title: '操作',field: 'op',align:"center",width:130,formatter:function(value,rec)
|
||||
{
|
||||
var str = '';
|
||||
var rowInfo = rec.id + 'AaBb' + rec.name + 'AaBb' + rec.sort + 'AaBb' + rec.remark;
|
||||
if(1 == value)
|
||||
{
|
||||
str += '<img src="<%=path%>/js/easyui-1.3.5/themes/icons/pencil.png" style="cursor: pointer;" onclick="editDepot(\'' + rowInfo + '\');"/> <a onclick="editDepot(\'' + rowInfo + '\');" style="text-decoration:none;color:black;" href="javascript:void(0)">编辑</a> ';
|
||||
str += '<img src="<%=path%>/js/easyui-1.3.5/themes/icons/edit_remove.png" style="cursor: pointer;" onclick="deleteDepot('+ rec.id +');"/> <a onclick="deleteDepot('+ rec.id +');" style="text-decoration:none;color:black;" href="javascript:void(0)">删除</a> ';
|
||||
}
|
||||
return str;
|
||||
}
|
||||
}
|
||||
{ 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;
|
||||
if(1 == value)
|
||||
{
|
||||
str += '<img title="编辑" src="<%=path%>/js/easyui-1.3.5/themes/icons/pencil.png" style="cursor: pointer;" onclick="editDepot(\'' + rowInfo + '\');"/> ';
|
||||
str += '<img title="删除" src="<%=path%>/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()
|
||||
{
|
||||
handler:function() {
|
||||
addDepot();
|
||||
}
|
||||
},
|
||||
},'-',
|
||||
{
|
||||
id:'deleteDepot',
|
||||
text:'删除',
|
||||
iconCls:'icon-remove',
|
||||
handler:function()
|
||||
{
|
||||
handler:function() {
|
||||
batDeleteDepot();
|
||||
}
|
||||
}
|
||||
],
|
||||
onLoadError:function()
|
||||
{
|
||||
onLoadError:function() {
|
||||
$.messager.alert('页面加载提示','页面加载异常,请稍后再试!','error');
|
||||
return;
|
||||
}
|
||||
@@ -189,38 +189,31 @@
|
||||
}
|
||||
|
||||
//初始化键盘enter事件
|
||||
$(document).keydown(function(event)
|
||||
{
|
||||
$(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" ))
|
||||
{
|
||||
if(k == "13"&&(obj.id=="name"||obj.id=="sort"|| obj.id=="remark" )) {
|
||||
$("#saveDepot").click();
|
||||
}
|
||||
//搜索按钮添加快捷键
|
||||
if(k == "13"&&(obj.id=="searchName" || obj.id=="searchRemark" ))
|
||||
{
|
||||
if(k == "13"&&(obj.id=="searchName" || obj.id=="searchRemark" )) {
|
||||
$("#searchBtn").click();
|
||||
}
|
||||
});
|
||||
//分页信息处理
|
||||
function ininPager()
|
||||
{
|
||||
try
|
||||
{
|
||||
function ininPager() {
|
||||
try {
|
||||
var opts = $("#tableData").datagrid('options');
|
||||
var pager = $("#tableData").datagrid('getPager');
|
||||
pager.pagination({
|
||||
onSelectPage:function(pageNum, pageSize)
|
||||
{
|
||||
onSelectPage:function(pageNum, pageSize) {
|
||||
opts.pageNumber = pageNum;
|
||||
opts.pageSize = pageSize;
|
||||
pager.pagination('refresh',
|
||||
{
|
||||
pager.pagination('refresh', {
|
||||
pageNumber:pageNum,
|
||||
pageSize:pageSize
|
||||
});
|
||||
@@ -228,19 +221,15 @@
|
||||
}
|
||||
});
|
||||
}
|
||||
catch (e)
|
||||
{
|
||||
catch (e) {
|
||||
$.messager.alert('异常处理提示',"分页信息异常 : " + e.name + ": " + e.message,'error');
|
||||
}
|
||||
}
|
||||
|
||||
//删除供应商信息
|
||||
function deleteDepot(depotID)
|
||||
{
|
||||
$.messager.confirm('删除确认','确定要删除此仓库信息吗?',function(r)
|
||||
{
|
||||
if (r)
|
||||
{
|
||||
function deleteDepot(depotID) {
|
||||
$.messager.confirm('删除确认','确定要删除此仓库信息吗?',function(r) {
|
||||
if (r) {
|
||||
$.ajax({
|
||||
type:"post",
|
||||
url: "<%=path %>/depot/delete.action",
|
||||
@@ -249,8 +238,7 @@
|
||||
depotID : depotID,
|
||||
clientIp:'<%=clientIp %>'
|
||||
}),
|
||||
success: function (tipInfo)
|
||||
{
|
||||
success: function (tipInfo) {
|
||||
var msg = tipInfo.showModel.msgTip;
|
||||
if(msg == '成功')
|
||||
{
|
||||
@@ -261,8 +249,7 @@
|
||||
$.messager.alert('删除提示','删除仓库信息失败,请稍后再试!','error');
|
||||
},
|
||||
//此处添加错误处理
|
||||
error:function()
|
||||
{
|
||||
error:function() {
|
||||
$.messager.alert('删除提示','删除仓库信息异常,请稍后再试!','error');
|
||||
return;
|
||||
}
|
||||
@@ -272,18 +259,14 @@
|
||||
}
|
||||
|
||||
//批量删除供应商
|
||||
function batDeleteDepot()
|
||||
{
|
||||
function batDeleteDepot() {
|
||||
var row = $('#tableData').datagrid('getChecked');
|
||||
if(row.length == 0)
|
||||
{
|
||||
if(row.length == 0) {
|
||||
$.messager.alert('删除提示','没有记录被选中!','info');
|
||||
return;
|
||||
}
|
||||
if(row.length > 0)
|
||||
{
|
||||
$.messager.confirm('删除确认','确定要删除选中的' + row.length + '条仓库信息吗?',function(r)
|
||||
{
|
||||
if(row.length > 0) {
|
||||
$.messager.confirm('删除确认','确定要删除选中的' + row.length + '条仓库信息吗?',function(r) {
|
||||
if (r)
|
||||
{
|
||||
var ids = "";
|
||||
@@ -339,12 +322,10 @@
|
||||
function addDepot()
|
||||
{
|
||||
$("#clientIp").val('<%=clientIp %>');
|
||||
$("#sort").val("");
|
||||
$("#remark").val("");
|
||||
$('#depotDlg').dialog('open').dialog('setTitle','<img src="<%=path%>/js/easyui-1.3.5/themes/icons/edit_add.png"/> 增加仓库信息');
|
||||
$(".window-mask").css({ width: webW ,height: webH});
|
||||
$("#name").val("").focus();
|
||||
//$('#depotFM').form('clear');
|
||||
$('#depotFM').form('clear');
|
||||
$("#name").focus();
|
||||
|
||||
orgDepot = "";
|
||||
depotID = 0;
|
||||
@@ -352,52 +333,52 @@
|
||||
}
|
||||
|
||||
//保存信息
|
||||
$("#saveDepot").unbind().bind({
|
||||
click:function()
|
||||
$("#saveDepot").off("click").on("click",function() {
|
||||
if(!$('#depotFM').form('validate'))
|
||||
return;
|
||||
else if(checkDepotName())
|
||||
return;
|
||||
else
|
||||
{
|
||||
if(!$('#depotFM').form('validate'))
|
||||
return;
|
||||
else if(checkDepotName())
|
||||
return;
|
||||
else
|
||||
{
|
||||
$.ajax({
|
||||
type:"post",
|
||||
url: url,
|
||||
dataType: "json",
|
||||
async : false,
|
||||
data: ({
|
||||
name : $.trim($("#name").val()),
|
||||
type : 0,
|
||||
sort : $.trim($("#sort").val()),
|
||||
remark : $.trim($("#remark").val()),
|
||||
clientIp:'<%=clientIp %>'
|
||||
}),
|
||||
success: function (tipInfo)
|
||||
$.ajax({
|
||||
type:"post",
|
||||
url: url,
|
||||
dataType: "json",
|
||||
async : false,
|
||||
data: ({
|
||||
name : $.trim($("#name").val()),
|
||||
address: $.trim($("#address").val()),
|
||||
warehousing: $.trim($("#warehousing").val()),
|
||||
truckage: $.trim($("#truckage").val()),
|
||||
type : 0,
|
||||
sort : $.trim($("#sort").val()),
|
||||
remark : $.trim($("#remark").val()),
|
||||
clientIp:'<%=clientIp %>'
|
||||
}),
|
||||
success: function (tipInfo)
|
||||
{
|
||||
if(tipInfo)
|
||||
{
|
||||
if(tipInfo)
|
||||
{
|
||||
$('#depotDlg').dialog('close');
|
||||
|
||||
var opts = $("#tableData").datagrid('options');
|
||||
showDepotDetails(opts.pageNumber,opts.pageSize);
|
||||
}
|
||||
else
|
||||
{
|
||||
$.messager.show({
|
||||
title: '错误提示',
|
||||
msg: '保存仓库信息失败,请稍后重试!'
|
||||
});
|
||||
}
|
||||
},
|
||||
//此处添加错误处理
|
||||
error:function()
|
||||
{
|
||||
$.messager.alert('提示','保存仓库信息异常,请稍后再试!','error');
|
||||
return;
|
||||
$('#depotDlg').dialog('close');
|
||||
|
||||
var opts = $("#tableData").datagrid('options');
|
||||
showDepotDetails(opts.pageNumber,opts.pageSize);
|
||||
}
|
||||
});
|
||||
}
|
||||
else
|
||||
{
|
||||
$.messager.show({
|
||||
title: '错误提示',
|
||||
msg: '保存仓库信息失败,请稍后重试!'
|
||||
});
|
||||
}
|
||||
},
|
||||
//此处添加错误处理
|
||||
error:function()
|
||||
{
|
||||
$.messager.alert('提示','保存仓库信息异常,请稍后再试!','error');
|
||||
return;
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
@@ -410,6 +391,9 @@
|
||||
$("#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]);
|
||||
|
||||
orgDepot = depotInfo[1];
|
||||
$('#depotDlg').dialog('open').dialog('setTitle','<img src="<%=path%>/js/easyui-1.3.5/themes/icons/pencil.png"/> 编辑仓库信息');
|
||||
|
||||
Reference in New Issue
Block a user