219 lines
7.8 KiB
Plaintext
219 lines
7.8 KiB
Plaintext
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
|
|
<!DOCTYPE html>
|
|
<script type="text/javascript">
|
|
var doSearchPatrolPoint = function() {
|
|
$("#table_warehouse").bootstrapTable('refresh');
|
|
};
|
|
|
|
function doSelect(dialog,grid) {
|
|
//var checkedItems = $("#table_user").bootstrapTable('getAllSelections');
|
|
var downPeopleId=$('#downPeopleId').val();
|
|
var datas="";
|
|
$.each(selectionIds, function(index, item){
|
|
if(datas!=""){
|
|
datas+=",";
|
|
}
|
|
datas+=item;
|
|
});
|
|
if (datas == "") {
|
|
showAlert('d', '请先选择记录', 'dowmAlertdiv');
|
|
}else if(downPeopleId == ""){
|
|
showAlert('d', '请选择下发人', 'dowmAlertdiv');
|
|
}else{
|
|
// console.log(datas);
|
|
$.post(ext.contextPath + '/process/libraryProcessManageWorkOrder/doIssued.do',{ids:datas,unitId:unitId,downPeopleId:downPeopleId},function(data) {
|
|
// console.log(data);
|
|
if (data.code == 1) {
|
|
$("#table").bootstrapTable('refresh');
|
|
closeModal("warehouseModal");
|
|
}else {
|
|
showAlert('d', data.msg);
|
|
}
|
|
},'json');
|
|
}
|
|
|
|
};
|
|
|
|
var $table;
|
|
var switchStatus=false;
|
|
var selectionIds = [];
|
|
|
|
function queryParams(params) {
|
|
var temp={
|
|
rows: params.limit,
|
|
page: params.offset/params.limit+1,
|
|
sort: params.sort,
|
|
order: params.order,
|
|
unitId: unitId
|
|
}
|
|
return temp;
|
|
}
|
|
|
|
$(function() {
|
|
$(".select2-selection--single").css({'height':'30px','paddingTop':'4px'});
|
|
|
|
// initialSelectionIds();
|
|
|
|
$table=$("#table_warehouse").bootstrapTable({
|
|
url: ext.contextPath + '/process/libraryProcessManage/getList.do',
|
|
clickToSelect:true,
|
|
striped: true,
|
|
pagination: true,
|
|
pageList: [10, 20],
|
|
pageSize: 20,
|
|
pageNumber: 1,
|
|
sidePagination: 'server',
|
|
clickToSelect:true,
|
|
responseHandler:responseHandler,
|
|
queryParams: queryParams,
|
|
queryParamsType: "limit",
|
|
sortName: 'code',
|
|
sortOrder: 'asc',
|
|
columns: [
|
|
{
|
|
checkbox: true,
|
|
formatter: function (i,row) {
|
|
if($.inArray(row.id,Array.from(selectionIds))!=-1){
|
|
return {
|
|
checked : true
|
|
}
|
|
}
|
|
}
|
|
},{
|
|
field: '', // 返回json数据中的name
|
|
title: '指标编号', // 表格表头显示文字
|
|
align: 'center', // 左右居中
|
|
valign: 'middle',
|
|
formatter: function (value, row, index) {
|
|
return row.code;
|
|
}
|
|
},
|
|
{
|
|
field: '', // 返回json数据中的name
|
|
title: '指标名称', // 表格表头显示文字
|
|
align: 'center', // 左右居中
|
|
valign: 'middle',
|
|
formatter: function (value, row, index) {
|
|
return row.name;
|
|
}
|
|
},
|
|
{
|
|
field: '', // 返回json数据中的name
|
|
title: '控制区', // 表格表头显示文字
|
|
align: 'center', // 左右居中
|
|
valign: 'middle',
|
|
formatter: function (value, row, index) {
|
|
return row.area;
|
|
}
|
|
},
|
|
{
|
|
field: '', // 返回json数据中的name
|
|
title: '单位', // 表格表头显示文字
|
|
align: 'center', // 左右居中
|
|
valign: 'middle',
|
|
formatter: function (value, row, index) {
|
|
return row.unit;
|
|
}
|
|
},
|
|
{
|
|
field: '', // 返回json数据中的name
|
|
title: '额定分值', // 表格表头显示文字
|
|
align: 'center', // 左右居中
|
|
valign: 'middle',
|
|
formatter: function (value, row, index) {
|
|
return row.baseHours;
|
|
}
|
|
},
|
|
],
|
|
onLoadSuccess: function(){
|
|
adjustBootstrapTableView("table_warehouse");
|
|
},
|
|
onLoadError: function(){
|
|
console.info("加载数据失败");
|
|
}
|
|
});
|
|
|
|
$table.on('check.bs.table check-all.bs.table uncheck.bs.table uncheck-all.bs.table', function (e,rows, obj) {
|
|
var ids = $.map(!$.isArray(rows) ? [rows] : rows, function (row) {
|
|
return row.id;
|
|
});
|
|
func = $.inArray(e.type, ['check', 'check-all']) > -1 ? 'union' : 'difference';
|
|
selectionIds = _[func](selectionIds, ids);
|
|
if('check'==e.type){
|
|
obj.parent().addClass("checked");
|
|
}else{
|
|
obj.parent().removeClass("checked");
|
|
}
|
|
});
|
|
});
|
|
//选中事件操作数组
|
|
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;
|
|
}
|
|
|
|
function selectPeople(){
|
|
$.post(ext.contextPath + '/user/userForOneSelect.do', {formId:"subDownForm",hiddenId:"downPeopleId",textId:"downPeopleName"} , function(data) {
|
|
$("#user4SelectDiv").html(data);
|
|
openModal("user4SelectModal");
|
|
});
|
|
}
|
|
</script>
|
|
|
|
<div class="modal fade" id="warehouseModal">
|
|
<div class="modal-dialog">
|
|
<div class="modal-content">
|
|
<div id="dowmAlertdiv"></div>
|
|
<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>
|
|
|
|
<form class="form-horizontal" id="subDownForm" autocomplete="off">
|
|
<div class="form-group pull-left form-inline" style="margin-left: 2px;">
|
|
<div class="input-group input-group-sm " style="width: 120px;">
|
|
<input type="hidden" name="downPeopleId" id="downPeopleId" />
|
|
<input type="text" id="downPeopleName" name="downPeopleName" class="form-control" placeholder="下发人员" onclick="selectPeople();" readonly>
|
|
</div>
|
|
</div>
|
|
</form>
|
|
|
|
<div class="table-scrollable">
|
|
<table class="table table-bordered table-striped" style="overflow:auto;width:100%" id="table_warehouse"></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> |