first commit
This commit is contained in:
295
WebRoot/jsp/whp/baseinfo/WhpTestItemPop.jsp
Normal file
295
WebRoot/jsp/whp/baseinfo/WhpTestItemPop.jsp
Normal file
@ -0,0 +1,295 @@
|
||||
<!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">
|
||||
.select2-container .select2-selection--single {
|
||||
height: 34px;
|
||||
line-height: 34px;
|
||||
}
|
||||
|
||||
.select2-selection__arrow {
|
||||
margin-top: 3px;
|
||||
}
|
||||
|
||||
.foot {
|
||||
display: flex;
|
||||
padding-left: 50px;
|
||||
}
|
||||
|
||||
/*.layout{*/
|
||||
/* display: flex;*/
|
||||
/* padding-left: 15px;*/
|
||||
/*}*/
|
||||
.form-horizontal {
|
||||
padding-top: 20px;
|
||||
|
||||
}
|
||||
|
||||
.right {
|
||||
margin-left: 50px;
|
||||
}
|
||||
</style>
|
||||
<script type="text/javascript">
|
||||
$(function () {
|
||||
initTableLists();
|
||||
conditionDropDownStatus();
|
||||
conditionDropDownOrg();
|
||||
|
||||
|
||||
});
|
||||
var WhpTestItemPopdosearch = function () {
|
||||
$("#WhpTestItemPoptable").bootstrapTable('refresh');
|
||||
|
||||
};
|
||||
|
||||
function initTableLists() {
|
||||
|
||||
console.log($('#deptIdsCondition').val(),'$(\'#deptIdsCondition\').val()')
|
||||
$("#WhpTestItemPoptable").bootstrapTable({ // 对应table标签的id
|
||||
url: ext.contextPath + '/whp/baseinfo/WhpTestItem/getList.do', // 获取表格数据的url
|
||||
cache: false, // 设置为 false 禁用 AJAX 数据缓存, 默认为true
|
||||
striped: true, //表格显示条纹,默认为false
|
||||
singleSelect: true,
|
||||
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, // 每页显示数据的开始页码
|
||||
sort: params.sort, // 要排序的字段
|
||||
order: params.order, // 排序规则
|
||||
status: $('#statusCondition').val(),//状态
|
||||
deptIds: $('#deptIdsCondition').val() !=null?$('#deptIdsCondition').val().join(','):'', // 部门模糊查询
|
||||
likeString: $('#likeString').val() // 名称模糊查询
|
||||
}
|
||||
},
|
||||
sortName: 'id', // 要排序的字段
|
||||
sortOrder: 'desc', // 排序规则
|
||||
//detailView: true,//父子表
|
||||
columns: [
|
||||
{
|
||||
checkbox: true, // 显示一个勾选框
|
||||
|
||||
},
|
||||
{
|
||||
field: 'name', // 返回json数据中的name
|
||||
title: '检测项目名称', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle' // 上下居中
|
||||
}, {
|
||||
field: 'workingCurveStr', // 返回json数据中的name
|
||||
title: '工作曲线', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle' // 上下居中
|
||||
}, {
|
||||
field: 'equipmentName', // 返回json数据中的name
|
||||
title: '仪器设备', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle'
|
||||
}, {
|
||||
field: 'deptNames', // 返回json数据中的name
|
||||
title: '检测部门', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle'
|
||||
}, {
|
||||
field: 'confirmUserName', // 返回json数据中的name
|
||||
title: '检验复核人', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle'
|
||||
}, {
|
||||
field: 'testAddress', // 返回json数据中的name
|
||||
title: '测定地点', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle'
|
||||
}, {
|
||||
field: 'statusName', // 返回json数据中的name
|
||||
title: '状态', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle'
|
||||
}
|
||||
],
|
||||
onLoadSuccess: function () { //加载成功时执行
|
||||
adjustBootstrapTableView("WhpTestItemPoptable");
|
||||
|
||||
},
|
||||
onLoadError: function () { //加载失败时执行
|
||||
console.info("加载数据失败");
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function conditionDropDownStatus() {
|
||||
var select_Data = jQuery.parseJSON('${enableDropDown}');
|
||||
var select_3 = $("#statusCondition").select2({
|
||||
data: select_Data,
|
||||
cache: false,
|
||||
placeholder: '请选择',//默认文字提示educationTypeCondition
|
||||
allowClear: true,//允许清空
|
||||
escapeMarkup: function (markup) {
|
||||
return markup;
|
||||
}, // 自定义格式化防止xss注入
|
||||
language: "zh-CN",
|
||||
minimumInputLength: 0,
|
||||
minimumResultsForSearch: 10,//数据超过十个启用搜索框
|
||||
formatResult: function formatRepo(repo) {
|
||||
return repo.text;
|
||||
}, // 函数用来渲染结果
|
||||
formatSelection: function formatRepoSelection(repo) {
|
||||
return repo.text;
|
||||
} // 函数用于呈现当前的选择
|
||||
});
|
||||
$(".select2-selection--single").css({'height': '30px', 'paddingTop': '4px'});
|
||||
select_3.val('').trigger('change');
|
||||
}
|
||||
|
||||
function conditionDropDownOrg() {
|
||||
var select_Data = jQuery.parseJSON('${deptDropDown}');
|
||||
|
||||
var select_3 = $("#deptIdsCondition").select2({
|
||||
data: select_Data,
|
||||
cache: false,
|
||||
placeholder: '请选择',//默认文字提示educationTypeCondition
|
||||
allowClear: true,//允许清空
|
||||
escapeMarkup: function (markup) {
|
||||
return markup;
|
||||
}, // 自定义格式化防止xss注入
|
||||
language: "zh-CN",
|
||||
multiple: true,
|
||||
minimumInputLength: 0,
|
||||
minimumResultsForSearch: 10,//数据超过十个启用搜索框
|
||||
formatResult: function formatRepo(repo) {
|
||||
return repo.text;
|
||||
}, // 函数用来渲染结果
|
||||
formatSelection: function formatRepoSelection(repo) {
|
||||
return repo.text;
|
||||
} // 函数用于呈现当前的选择
|
||||
});
|
||||
$(".select2-selection--single").css({'height': '30px', 'paddingTop': '4px'});
|
||||
select_3.val('').trigger('change');
|
||||
}
|
||||
|
||||
//保存
|
||||
function WhpTestItemPopSaveFun() {
|
||||
var checkedItems = $("#WhpTestItemPoptable").bootstrapTable('getSelections');
|
||||
|
||||
var datas = "";
|
||||
$.each(checkedItems, function (index, item) {
|
||||
datas += item.id + ",";
|
||||
});
|
||||
if (datas == "") {
|
||||
showAlert('d', '请先选择记录', 'mainAlertdiv');
|
||||
} else {
|
||||
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) {
|
||||
console.log(checkedItems, 'checkedItems')
|
||||
var data = []
|
||||
checkedItems.map(item => {
|
||||
data.push({
|
||||
id: item.id,
|
||||
name: item.name
|
||||
})
|
||||
})
|
||||
console.log(data[0].id)
|
||||
console.log(data[0].name)
|
||||
$('#${param.formId} #${param.hiddenId}').val(data[0].id);
|
||||
$('#${param.formId} #${param.textId}').val(data[0].name);
|
||||
console.log(data)
|
||||
|
||||
closeModal('whpTestItemPops');
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
</script>
|
||||
<div class="modal fade" id="whpTestItemPops">
|
||||
<div class="modal-dialog modal-lg">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||
<span aria-hidden="true">×</span></button>
|
||||
<h4 class="modal-title">选择检测项目</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<div class="row">
|
||||
<div class="col-md-12 col-xs-13">
|
||||
<!-- 新增界面formid强制为addForm -->
|
||||
<form id="searchForm">
|
||||
<div>
|
||||
<div class="form-group" style="padding:0;">
|
||||
<div class="form-group pull-right form-inline">
|
||||
<div class="form-group">
|
||||
<label class="form-label">检测部门:</label>
|
||||
<select class="form-control select2" name="deptIdsCondition"
|
||||
id="deptIdsCondition"
|
||||
style="width:230px;height: 30px">
|
||||
</select>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="form-label">状态:</label>
|
||||
<select class="form-control select2" name="statusCondition"
|
||||
id="statusCondition"
|
||||
style="width:180px;height: 30px">
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="input-group input-group-sm" style="width: 250px;">
|
||||
<input type="text" id="likeString" name="likeString"
|
||||
class="form-control pull-right"
|
||||
placeholder="请输入检测项目名称">
|
||||
<div class="input-group-btn">
|
||||
<button type="button" class="btn btn-default"
|
||||
onclick="WhpTestItemPopdosearch();">
|
||||
<i class="fa fa-search"></i>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
<table id="WhpTestItemPoptable"></table>
|
||||
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default " data-dismiss="modal">关闭
|
||||
</button>
|
||||
<button type="button" class="btn btn-primary " style="margin-left: 10px"
|
||||
onclick="WhpTestItemPopSaveFun()">保存
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.modal-content -->
|
||||
</div>
|
||||
<!-- /.modal-dialog -->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
Reference in New Issue
Block a user