first commit
This commit is contained in:
171
WebRoot/jsp/process/testTaskForSelectTestindexmanage.jsp
Normal file
171
WebRoot/jsp/process/testTaskForSelectTestindexmanage.jsp
Normal file
@ -0,0 +1,171 @@
|
||||
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
|
||||
<!DOCTYPE html>
|
||||
<script type="text/javascript">
|
||||
var doSearch = function() {
|
||||
$("#SelectTestindexmanage_table").bootstrapTable('refresh');
|
||||
};
|
||||
|
||||
function doSelect(dialog,grid) {
|
||||
// var checkedItems = $("#SelectTestindexmanage_table").bootstrapTable('getAllSelections');
|
||||
if(checkedItem!=''){
|
||||
$('#${param.formId} #${param.hiddenId}' ).val(checkedItem.id);
|
||||
$('#${param.formId} #${param.textId}').val(checkedItem.name);
|
||||
}
|
||||
closeModal('subTestindexmanageModal');
|
||||
};
|
||||
|
||||
// var selectionIds = [];
|
||||
|
||||
//显示已经勾选的数据
|
||||
function stateFormatter(value, row, index) {
|
||||
var flag=false;
|
||||
if(row.id=='${param.checkid}'){
|
||||
flag=true;
|
||||
checkedItem = "";
|
||||
}
|
||||
if (flag)
|
||||
return {
|
||||
checked : true//设置选中
|
||||
};
|
||||
return value;
|
||||
}
|
||||
|
||||
function queryParams(params) {
|
||||
var temp={
|
||||
rows: params.limit,
|
||||
page: params.offset/params.limit+1,
|
||||
sort: params.sort,
|
||||
order: params.order,
|
||||
unitId:unitId
|
||||
// search_name: $('#search_name').val()
|
||||
}
|
||||
return temp;
|
||||
}
|
||||
|
||||
$(function() {
|
||||
var $table;
|
||||
// $(".select2-selection--single").css({'height':'30px','paddingTop':'4px'});
|
||||
$table=$("#SelectTestindexmanage_table").bootstrapTable({
|
||||
url: ext.contextPath + '/process/testIndexManage/getListForSelect.do',
|
||||
striped: true,
|
||||
pagination: true,
|
||||
pageList: [10, 20],
|
||||
pageSize: 20,
|
||||
pageNumber: 1,
|
||||
sidePagination: 'server',
|
||||
clickToSelect:true,
|
||||
// responseHandler:responseHandler,
|
||||
queryParams: queryParams,
|
||||
queryParamsType: "limit",
|
||||
sortName: 'name',
|
||||
sortOrder: 'asc',
|
||||
columns: [
|
||||
{
|
||||
checkbox: true,
|
||||
formatter: stateFormatter
|
||||
},{
|
||||
field: 'name', // 返回json数据中的name
|
||||
title: '指标名称', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle'
|
||||
},{
|
||||
field: 'methodname', // 返回json数据中的name
|
||||
title: '检验方法', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle'
|
||||
},{
|
||||
field: 'matters', // 返回json数据中的name
|
||||
title: '注意事项', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle'
|
||||
}
|
||||
],
|
||||
onLoadSuccess: function(){
|
||||
adjustBootstrapTableView("SelectTestindexmanage_table");
|
||||
},
|
||||
onLoadError: function(){
|
||||
console.info("加载数据失败");
|
||||
}
|
||||
});
|
||||
|
||||
$table.on('check.bs.table check-all.bs.table uncheck.bs.table uncheck-all.bs.table', function (e,rows, obj) {
|
||||
if('check'==e.type){
|
||||
$('#SelectTestindexmanage_table .checked').removeClass("checked");
|
||||
obj.parent().addClass("checked");
|
||||
checkedItem = rows;
|
||||
}else{
|
||||
obj.parent().removeClass("checked");
|
||||
checkedItem = "";
|
||||
}
|
||||
});
|
||||
});
|
||||
// //选中事件操作数组
|
||||
// var union = function(array,ids){
|
||||
// $.each(ids, function (i, id) {
|
||||
// if($.inArray(id,array)==-1){
|
||||
// array[array.length] = id;
|
||||
// }
|
||||
// });
|
||||
// return array;
|
||||
// };
|
||||
// //取消选中事件操作数组
|
||||
// var difference = function(array,ids){
|
||||
// $.each(ids, function (i, id) {
|
||||
// var index = $.inArray(id,array);
|
||||
// if(index!=-1){
|
||||
// array.splice(index, 1);
|
||||
// }
|
||||
// });
|
||||
// return array;
|
||||
// };
|
||||
// var _ = {"union":union,"difference":difference};
|
||||
|
||||
// //表格分页之前处理多选框数据
|
||||
// function responseHandler(res) {
|
||||
// $.each(res.rows, function (i, row) {
|
||||
// row.checkStatus = $.inArray(row.id, selectionIds) != -1;
|
||||
// });
|
||||
// return res;
|
||||
// }
|
||||
</script>
|
||||
|
||||
<div class="modal fade" id="subTestindexmanageModal">
|
||||
<div class="modal-dialog">
|
||||
<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 " style="width:100%">
|
||||
<div id="alertDiv"></div>
|
||||
|
||||
<div class="form-group " style="margin-bottom:10px;">
|
||||
<input id="search_code" name="search_code" type="hidden" />
|
||||
<span id="company" style="height:31px;color:#000000;border-top-left-radius: 4px;border-bottom-left-radius: 4px;font-weight:bold"></span>
|
||||
</div>
|
||||
|
||||
<div class="form-group pull-right form-inline" >
|
||||
|
||||
<div class="form-group pull-left form-inline" style="float: left;width: 250px;margin-top: 5px;">
|
||||
<!-- <div class="input-group input-group-sm " style="width: 230px;">
|
||||
<input type="text" id="search_mpointcode" name="search_mpointcode" class="form-control pull-right" placeholder="点位查询">
|
||||
<div class="input-group-btn">
|
||||
<button class="btn btn-default" onclick="doSearch();"><i class="fa fa-search"></i></button>
|
||||
</div>
|
||||
</div> -->
|
||||
</div>
|
||||
</div>
|
||||
<div class="table-scrollable">
|
||||
<table class="table table-bordered table-striped" style="overflow:auto;width:100%" id="SelectTestindexmanage_table"></table>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default pull-left" data-dismiss="modal">关闭</button>
|
||||
<button type="button" class="btn btn-primary" onclick="doSelect()">确认</button>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.modal-content -->
|
||||
</div>
|
||||
<!-- /.modal-dialog -->
|
||||
</div>
|
||||
Reference in New Issue
Block a user