You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

65 lines
2.0 KiB

<#import "../master.ftl" as master>
<@master.layout>
<style>
#fm label {
width: 150px;
}
</style>
<div class="page-header">
<h3>Query serial number</h3>
</div>
<div id="tb" style="padding:10px 5px;">
<div>
Serial No: <input class="easyui-textbox" id="serialNo" style="width:260px">
<input type="hidden" id="serialNoSearch" value="">
<a id="queryLink" class="easyui-linkbutton" iconCls="icon-search">Search</a>
&nbsp;&nbsp;&nbsp;
<a href="javascript:void(0)" id="downExcel" class="easyui-linkbutton" iconCls="icon-add" onclick="downExcel()">Export to Excel</a>
</div>
</div>
<table id="dg" class="easyui-datagrid" style="width:100%;height:460px;"
data-options="singleSelect:true,collapsible:false,toolbar:'#tb'">
<thead>
<tr>
<th data-options="field:'serialsNo',width:260,editor:'textbox'">Serials Number</th>
<th data-options="field:'item',width:160,editor:'textbox'">Item</th>
<th data-options="field:'itemValue',width:648,editor:'textbox'">值</th>
</tr>
</thead>
</table>
<script>
//设置宽度
$(window).resize(function () {
$("#dg").datagrid({"height": $(window).height() - $(".datagrid").offset().top - 20});
});
$(function () {
$(window).resize();
});
$("#queryLink").click(function(){
var dg = $('#dg').datagrid({
url: '/prepress/serialInfo',
queryParams: {serialNo: $("#serialNo").val()},
pagination: false
});
$('dg').datagrid('load');
$("#serialNoSearch").val($("#serialNo").val());
});
//导出
function downExcel(){
var serialNoSearch = $("#serialNoSearch").val();
console.log(serilaNo);
if(serilaNo!=null && serilaNo!=""){
//拼接url
var url = "/prepress/downSerialInfo?serilaNo="+encodeURIComponent(serialNoSearch);
//设置href
$("#downExcel").attr("href", url);
} else {
$.messager.alert('Error','No query results yet!', 'error');
}
}
</script>
</@master.layout>