Files
SIPAIIS_WMS_JSSW/WebRoot/jsp/safety/SafetyEducationBuilderBindList.jsp

166 lines
6.1 KiB
Plaintext
Raw Permalink Normal View History

2026-01-16 14:13:44 +08:00
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<%@ page language="java" pageEncoding="utf-8" %>
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %>
<style type="text/css">
.borde1 {
text-align: left;
position: relative;
z-index: 2;
border: 1px solid grey;
width: 700px;
}
.borde1 span {
display: inline-block;
background: white;
padding: 10px;
margin-left: -708px;
margin-top: -10px;
}
#table20{
border-left: 0px;
border-right: 0px;
}
#table20 th{
border-left: 0px;
border-right: 0px;
}
#table20 td{
border-left: 0px;
border-right: 0px;
}
.table-striped>tbody>tr:nth-of-type(odd){
background-color: white;
}
</style>
<script type="text/javascript">
// var tableGroupList = []
$(function () {
inittableFun(function (dom) {
let divHeight = dom.height()
$('.borde1').css({'height': Math.abs(divHeight) + 70 + 'px'})
});
});
var deleteFun = function (id) {
stopBubbleDefaultEvent();
swal({
text: "您确定要解除绑定?",
dangerMode: true,
buttons: {
cancel: {
text: "取消",
value: null,
visible: true,
className: "btn btn-default btn-sm",
closeModal: true,
},
confirm: {
text: "确定",
value: true,
visible: true,
className: "btn btn-danger btn-sm",
closeModal: true
}
}
})
.then(function (willDelete) {
if (willDelete) {
$.post(ext.contextPath + '/safety/SafetyEducationBuilder/unbindJob.do', {id: id}, function (data) {
if (data.code === 1) {
$("#table20").bootstrapTable('refresh');
} else {
showAlert('d', '删除失败',);
}
}, "json");
}
});
};
function inittableFun(callback) {
console.log("${bizId}")
$("#table20").bootstrapTable({ // 对应table标签的id
url: ext.contextPath + '/safety/SafetyEducationBuilder/getList.do?safetyJobId=${bizId}', // 获取表格数据的url
cache: false, // 设置为 false 禁用 AJAX 数据缓存, 默认为true
striped: true, //表格显示条纹默认为false
pagination: true, // 在表格底部显示分页组件默认false
pageList: [10, 20, 50], // 设置页面可以显示的数据条数
pageSize: 10, // 页面数据条数
pageNumber: 1, // 首页页码
sidePagination: 'server', // 设置为服务器端分页
queryParams: function (params) { // 请求服务器数据时发送的参数可以在这里添加额外的查询参数返回false则终止请求
return {
rows: params.limit, // 每页要显示的数据条数
page: params.offset / params.limit + 1, // 每页显示数据的开始页码
}
},
sortName: 'id', // 要排序的字段
sortOrder: 'desc', // 排序规则
//detailView: true,//父子表
columns: [
{
checkbox: false, // 显示一个勾选框
}, {
field: 'educationCode', // 返回json数据中的name
title: '培训记录编号', // 表格表头显示文字
align: 'center', // 左右居中
valign: 'middle' // 上下居中
}, {
field: 'educationDate', // 返回json数据中的name
title: '培训日期', // 表格表头显示文字
align: 'center', // 左右居中
valign: 'middle', // 上下居中
formatter: function (value, row, index) {
return value.substring(0, 10);
}
}, {
field: 'name', // 返回json数据中的name
title: '姓名', // 表格表头显示文字
align: 'center', // 左右居中
valign: 'middle' // 上下居中
}, {
title: "操作",
align: 'center',
valign: 'middle',
width: 160, // 定义列的宽度单位为像素px
formatter: function (value, row, index) {
var buts = '';
buts += '<button class="btn btn-default btn-sm" title="删除" onclick="deleteFun(\'' + row.id + '\')"><i class="fa fa fa-trash-o"></i><span class="hidden-md hidden-lg">删除</span></button>';
buts = '<div class="btn-group" >' + buts + '</div>';
return buts;
}
}
],
onLoadSuccess: function () { //加载成功时执行
adjustBootstrapTableView("table20");
},
onLoadError: function () { //加载失败时执行
console.info("加载数据失败");
}
});
var intervalKey = setInterval(function () {
if ($("#table20").height() > 0) {
if (callback) {
callback($("#table20"))
}
clearInterval(intervalKey)
}
}, 200)
}
</script>
<div >
<div class="borde1">
<span>安全培训</span>
<div class="col-sm-12 " style="margin-top: 30px;margin-left: 5px">
<table id="table20"></table>
</div>
</div>
<input type="hidden" name="bizId" value="${bizId}"/>
</div>