Files
SIPAIIS_WMS_JSSW/WebRoot/jsp/equipment/equipmentCardTreeViewWeb2.jsp

226 lines
11 KiB
Plaintext
Raw Permalink Normal View History

2026-01-16 14:13:44 +08:00
<%@ 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" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>
<%@ page import="com.sipai.entity.base.ServerObject" %>
<%@ taglib uri="http://www.springsecurity.org/jsp" prefix="security" %>
<!DOCTYPE html>
<head>
<title><%= ServerObject.atttable.get("TOPTITLE")%>
</title>
<!-- 引用页头及CSS页-->
<jsp:include page="/jsp/inc.jsp"></jsp:include>
<script type="text/javascript">
// var dosearch = function () {
// initFun();
// };
// var refreshTable = function () {
// $("#table").bootstrapTable('refresh');
// };
//表格查询参数
function queryParamsFun(params) { // 请求服务器数据时发送的参数可以在这里添加额外的查询参数返回false则终止请求
return {
rows: params.limit, // 每页要显示的数据条数
page: params.offset / params.limit + 1, // 每页显示数据的开始页码
sort: params.sort, // 要排序的字段
order: params.order,
unitId: '${unitId}',
processSectionId: $('#processSection').val(),
equipmentClassId: $('#equipmentClass').val(),
search_name: $('#search_name').val()
}
};
var initFun = function () {
//销毁表格
$("#table").bootstrapTable('destroy');
$("#table").bootstrapTable({ // 对应table标签的id
url: ext.contextPath + '/equipment/getList4EquipmentCard.do', // 获取表格数据的url
cache: false, // 设置为 false 禁用 AJAX 数据缓存, 默认为true
striped: false, //表格显示条纹默认为false
pagination: true, // 在表格底部显示分页组件默认false
// showToggle: true,
cardView:false,
// strictSearch:true,
pageList: [10, 20, 200], // 设置页面可以显示的数据条数
pageSize: 20, // 页面数据条数
pageNumber: 1, // 首页页码
sidePagination: 'server', // 设置为服务器端分页
queryParams: queryParamsFun,
sortName: 'equipmentcardid', // 要排序的字段
sortOrder: 'asc', // 排序规则
onClickRow: function (row) {//单击行事件,执行查看功能
//viewFun(row.id);
},
columns: [
{
field: 'equipmentcardid', // 返回json数据中的name
title: '设备编号', // 表格表头显示文字
align: 'center', // 左右居中
valign: 'middle',
width: '25%',
// formatter: function (value, row, index) {
// if (value != null && value != '') {
// return "<span style='display: block;overflow: hidden;text-overflow: ellipsis;white-space: nowrap;' title='" + value + "'>" + value + "</span>";
// }
// }
}, {
field: 'equipmentname', // 返回json数据中的name
title: '设备名称', // 表格表头显示文字
align: 'center', // 左右居中
valign: 'middle',
width: '25%',
// formatter: function (value, row, index) {
// if (value != null && value != '') {
// return "<span style='display: block;overflow: hidden;text-overflow: ellipsis;white-space: nowrap;' title='" + value + "'>" + value + "</span>";
// }
// }
}, {
field: 'equipmentClass.name', // 返回json数据中的name
title: '设备类型', // 表格表头显示文字
align: 'center', // 左右居中
valign: 'middle',
width: '25%',
// formatter: function (value, row, index) {
// if (value != null && value != '') {
// return "<span style='display: block;overflow: hidden;text-overflow: ellipsis;white-space: nowrap;' title='" + value + "'>" + value + "</span>";
// }
// }
}, {
field: 'equipmentmodelname', // 返回json数据中的name
title: '设备型号', // 表格表头显示文字
align: 'center', // 左右居中
valign: 'middle',
width: '25%',
// formatter: function (value, row, index) {
// if (value != null && value != '') {
// return "<span style='display: block;overflow: hidden;text-overflow: ellipsis;white-space: nowrap;' title='" + value + "'>" + value + "</span>";
// }
// }
}
],
onLoadSuccess: function () { //加载成功时执行
adjustBootstrapTableView("table");
},
onLoadError: function () { //加载失败时执行
console.info("加载数据失败");
}
});
/**
* 工艺段
*/
$.post(ext.contextPath + "/user/processSection/getProcessSection4Select.do", {companyId: '${unitId}'}, function (data) {
$("#processSection").empty();
var selelct_ = $("#processSection").select2({
data: data,
cache: false,
placeholder: '请选择',//默认文字提示
allowClear: true,//允许清空
escapeMarkup: function (markup) {
return markup;
}, // 自定义格式化防止xss注入
language: "zh-CN",
minimumInputLength: 0,
minimumResultsForSearch: 5,//数据超过十个启用搜索框
formatResult: function formatRepo(repo) {
return repo.text;
}, // 函数用来渲染结果
formatSelection: function formatRepoSelection(repo) {
return repo.text;
} // 函数用于呈现当前的选择
});
$(".select2-selection--single").css({'height': '30px', 'paddingTop': '4px'})
selelct_.val('').trigger("change");
selelct_.on("change", function (e) {
$("#table").bootstrapTable('refresh');
});
}, 'json');
/**
* 设备类型
*/
$.post(ext.contextPath + "/equipment/equipmentClass/getEquipmentClassJson4Root.do", {}, function (data) {
$("#equipmentClass").empty();
var selelct_ = $("#equipmentClass").select2({
data: data,
cache: false,
placeholder: '请选择',//默认文字提示
allowClear: true,//允许清空
escapeMarkup: function (markup) {
return markup;
}, // 自定义格式化防止xss注入
language: "zh-CN",
minimumInputLength: 0,
minimumResultsForSearch: 5,//数据超过十个启用搜索框
formatResult: function formatRepo(repo) {
return repo.text;
}, // 函数用来渲染结果
formatSelection: function formatRepoSelection(repo) {
return repo.text;
} // 函数用于呈现当前的选择
});
$(".select2-selection--single").css({'height': '30px', 'paddingTop': '4px'})
selelct_.val('').trigger("change");
selelct_.on("change", function (e) {
$("#table").bootstrapTable('refresh');
});
}, 'json');
};
$(function () {
initFun();
});
</script>
</head>
<body style="opacity:0.8;background: transparent;">
<div class="wrapper">
<div class="content-wrapper" style="background-color: #15305F;color: #FFFFFF;">
<section class="content container-fluid">
<div id="mainAlertdiv"></div>
<div id="subDiv"></div>
<div id="subDiv_Configure"></div>
<div id="subDiv_PatroPoint"></div>
<div id="subDiv_Equipment"></div>
<form id="searchForm">
<div>
<div class="btn-group" style="width: 100%;">
<div class="form-group pull-right form-inline">
<label class="form-label">工艺段</label>
<select class="form-control select2 " id="processSection" name="processSection"
style="width: 180px;">
</select>
<label class="form-label ">设备类型</label>
<select class="form-control select2 " id="equipmentClass" name="equipmentClass"
style="width: 180px;">
</select>
<label class="form-label">设备名称</label>
<div class="input-group input-group-sm" style="width: 200px;">
<input type="text" id="search_name" autocomplete="off" name="search_name"
class="form-control pull-right" style="height:34px" placeholder="请输入">
<div class="input-group-btn">
<button class="btn btn-default" onclick="dosearchTab();" style="height:34px"><i
class="fa fa-search"></i></button>
</div>
</div>
</div>
</div>
</div>
</form>
<%-- <table id="table" style="table-layout:fixed;"></table>--%>
<table id="table"></table>
</section>
<!-- /.content -->
</div>
</div>
</body>
</html>