Files
SIPAIIS_WMS_JSSW/WebRoot/jsp/center.jsp
2026-01-16 14:13:44 +08:00

154 lines
5.7 KiB
Plaintext
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<!-- Content Wrapper. Contains page content -->
<script type="text/javascript">
var addFun = function() {
var dialog = parent.ext.modalDialog({
iframeId:'iframeadd',
title : '添加班组',
url : ext.contextPath + '/work/group/add.do?iframeId=iframeadd',
buttons : [ {
text : '保存',
handler : function() {
dialog.find('iframe').get(0).contentWindow.dosave(dialog, grid);
}
} ]
});
};
var editFun = function(id) {
var dialog = parent.ext.modalDialog({
iframeId:'iframeedit',
title : '编辑班组',
url : ext.contextPath + '/work/group/edit.do?iframeId=iframeedit&id=' + id,
buttons : [ {
text : '保存',
handler : function() {
dialog.find('iframe').get(0).contentWindow.dosave(dialog, grid);
}
} ]
});
};
var viewFun = function(id) {
var dialog = parent.ext.modalDialog({
title : '查看用户信息',
url : ext.contextPath + '/work/group/view.do?id=' + id
});
};
var deleteFun = function(id) {
parent.$.messager.confirm('提示', '您确定要删除此记录?', function(r) {
if (r) {
$.post(ext.contextPath + '/work/group/delete.do', {id : id}, function(data) {
if(data==1){
parent.$.messager.alert('提示','删除成功','info',function(){
grid.datagrid('reload');
});
}else{
parent.$.messager.alert('提示','删除失败','info');
}
});
}
});
};
var deletesFun = function() {
var checkedItems = $('#grid').datagrid('getChecked');
var datas="";
$.each(checkedItems, function(index, item){
datas+=item.id+",";
});
//alert(datas);
if(datas==""){
top.$.messager.alert('提示', '请先选择要删除的记录','info');
}else{
parent.$.messager.confirm('提示', '您确定要删除此记录?', function(r) {
if (r) {
$.post(ext.contextPath + '/work/group/deletes.do', {ids:datas} , function(data) {
if(data>0){
parent.$.messager.alert('提示','成功删除'+data+'条记录','info',function(){
grid.datagrid('reload');
grid.datagrid('clearChecked');
});
}else{
parent.$.messager.alert('提示','删除失败','info');
}
});
}
});
}
};
$(function() {
$("#table").bootstrapTable({ // 对应table标签的id
url: ext.contextPath + '/work/group/getlist.do', // 获取表格数据的url
cache: false, // 设置为 false 禁用 AJAX 数据缓存, 默认为true
striped: true, //表格显示条纹默认为false
pagination: true, // 在表格底部显示分页组件默认false
pageList: [10, 20,50], // 设置页面可以显示的数据条数
pageSize: 50, // 页面数据条数
pageNumber: 1, // 首页页码
sidePagination: 'server', // 设置为服务器端分页
queryParams: function (params) { // 请求服务器数据时发送的参数可以在这里添加额外的查询参数返回false则终止请求
return {
rows: params.limit, // 每页要显示的数据条数
page: params.offset/params.limit+1, // 每页显示数据的开始页码
sort: params.sort, // 要排序的字段
order: params.order // 排序规则
}
},
sortName: 'id', // 要排序的字段
sortOrder: 'desc', // 排序规则
columns: [
{
checkbox: true, // 显示一个勾选框
align: 'center' // 居中显示
}, {
field: 'name', // 返回json数据中的name
title: '编号', // 表格表头显示文字
align: 'center', // 左右居中
valign: 'middle' // 上下居中
},{
title: "操作",
align: 'center',
valign: 'middle',
width: 160, // 定义列的宽度单位为像素px
formatter: function (value, row, index) {
return '<button class="btn btn-primary btn-sm" onclick="del(\'' + row.stdId + '\')">删除</button>';
}
}
],
onLoadSuccess: function(){ //加载成功时执行
console.info("加载成功");
},
onLoadError: function(){ //加载失败时执行
console.info("加载数据失败");
}
})
});
</script>
<div class="content-wrapper">
<!-- Content Header (Page header) -->
<section class="content-header">
<h1 id ="head_title"></h1>
<ol class="breadcrumb">
<li><a id ='head_firstlevel' href="#"><i class="fa fa-dashboard"></i> </a></li>
<!-- <li class="active">Here</li> -->
</ol>
</section>
<!-- Main content -->
<section class="content container-fluid">
<table >
<tr>
<td>
<button type="button" class="btn btn-block btn-primary" data-toggle="modal" data-target="#addModal">新增</button>
</td>
</tr>
</table>
<br>
<table id="table"></table>
</section>
<!-- 新增页面-->
<jsp:include page="/jsp/work/demoAdd.jsp"></jsp:include>
<!-- /.content -->
</div>