Files
SIPAIIS_WMS_JSSW/WebRoot/jsp/sparepart/goodsForOneGoodsSelect.jsp
2026-01-16 14:13:44 +08:00

140 lines
5.8 KiB
Plaintext
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<script type="text/javascript">
var doSearchSelectGoods = function() {
$("#table_selectGoods").bootstrapTable('refresh');
};
function doSelect() {
var checkItems = $("#table_selectGoods").bootstrapTable('getAllSelections');
var ids="";
var names="";
if(checkItems!=null&&checkItems.length>0){
for(var i=0;i<checkItems.length;i++){
ids+=checkItems[i].id+",";
names+=checkItems[i].name+",";
}
}
$('#${param.formId} #${param.hiddenId}').val(ids);
$('#${param.formId} #${param.textId}').val(names);
closeModal("goods4SelectModal");
};
// function doSelect(row) {
// $('#${param.formId} #${param.hiddenId}' ).val(row.id);
// $('#${param.formId} #${param.textId}').val(row.name);
// closeModal("goods4SelectModal");
// };
function queryParams(params) {
var temp={
rows: params.limit, // 每页要显示的数据条数
page: params.offset/params.limit+1, // 每页显示数据的开始页码
sort: params.sort, // 要排序的字段
order: params.order,
search_name: $('#search_name_goods').val()
};
return temp;
}
$(function() {
$("#search_name_goods").keyup(function () {
if (event.keyCode == 13) {
event.preventDefault();
//回车执行查询
doSearchSelectGoods();
event.stopPropagation();
}
});
$("#table_selectGoods").bootstrapTable({ // 对应table标签的id
url: ext.contextPath + '/sparepart/goods/getList.do', // 获取表格数据的url
//cache: false, // 设置为 false 禁用 AJAX 数据缓存, 默认为true
// clickToSelect:true,
striped: true, //表格显示条纹默认为false
pagination: true, // 在表格底部显示分页组件默认false
pageList: [10, 20], // 设置页面可以显示的数据条数
pageSize: 20, // 页面数据条数
pageNumber: 1, // 首页页码
sidePagination: 'server', // 设置为服务器端分页
queryParams: queryParams,
queryParamsType: "limit",
sortName: 'id', // 要排序的字段
sortOrder: 'desc', // 排序规则
/* showColumns: true,
showRefresh: true, */
columns: [
{
checkbox:true,//单选框
},{
field: 'name', // 返回json数据中的name
title: '物品名称', // 表格表头显示文字
align: 'center', // 左右居中
valign: 'middle' // 上下居中
},{
field: 'brand', // 返回json数据中的name
title: '物品品牌', // 表格表头显示文字
align: 'center', // 左右居中
valign: 'middle' // 上下居中
},{
field: 'model', // 返回json数据中的name
title: '规格型号', // 表格表头显示文字
align: 'center', // 左右居中
valign: 'middle' // 上下居中
},{
field: 'goodsClass.name', // 返回json数据中的name
title: '物品类别', // 表格表头显示文字
align: 'center', // 左右居中
valign: 'middle', // 上下居中
},{
field: 'unit', // 返回json数据中的name
title: '物品单位', // 表格表头显示文字
align: 'center', // 左右居中
valign: 'middle' // 上下居中
}
],
onLoadSuccess: function(){ //加载成功时执行
adjustBootstrapTableView("table_selectGoods");
},
onLoadError: function(){ //加载失败时执行
console.info("加载数据失败");
}
})
});
</script>
<div class="modal fade" id="goods4SelectModal">
<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">&times;</span></button>
<h4 class="modal-title">选择备件</h4>
</div>
<div class="modal-body " style="width:100%">
<div id="alertDiv"></div>
<div class="form-group form-inline" >
<div class="form-group form-inline pull-right" style="padding-bottom: 5px;">
<div class="input-group input-group-sm" style="width: 250px;">
<input type="text" id="search_name_goods" name="search_name_goods" class="form-control pull-right" placeholder="备件名称">
<div class="input-group-btn">
<button class="btn btn-default" onclick="doSearchSelectGoods();"><i class="fa fa-search"></i></button>
</div>
</div>
</div>
</div>
<div>
<div id="table_selectGoods" style="height:330px;overflow:auto;width:100%"></div>
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
<button type="button" class="btn btn-primary" onclick="doSelect()">确认</button>
</div>
</div>
<!-- /.modal-content -->
</div>
<!-- /.modal-dialog -->
</div>