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

3 days ago
  1. <#import "../master.ftl" as master>
  2. <@master.layout>
  3. <style>
  4. #fm label {
  5. width: 150px;
  6. }
  7. </style>
  8. <div class="page-header">
  9. <h3>Query serial number</h3>
  10. </div>
  11. <div id="tb" style="padding:10px 5px;">
  12. <div>
  13. Serial No: <input class="easyui-textbox" id="serialNo" style="width:260px">
  14. <input type="hidden" id="serialNoSearch" value="">
  15. <a id="queryLink" class="easyui-linkbutton" iconCls="icon-search">Search</a>
  16. &nbsp;&nbsp;&nbsp;
  17. <a href="javascript:void(0)" id="downExcel" class="easyui-linkbutton" iconCls="icon-add" onclick="downExcel()">Export to Excel</a>
  18. </div>
  19. </div>
  20. <table id="dg" class="easyui-datagrid" style="width:100%;height:460px;"
  21. data-options="singleSelect:true,collapsible:false,toolbar:'#tb'">
  22. <thead>
  23. <tr>
  24. <th data-options="field:'serialsNo',width:260,editor:'textbox'">Serials Number</th>
  25. <th data-options="field:'item',width:160,editor:'textbox'">Item</th>
  26. <th data-options="field:'itemValue',width:648,editor:'textbox'">值</th>
  27. </tr>
  28. </thead>
  29. </table>
  30. <script>
  31. //设置宽度
  32. $(window).resize(function () {
  33. $("#dg").datagrid({"height": $(window).height() - $(".datagrid").offset().top - 20});
  34. });
  35. $(function () {
  36. $(window).resize();
  37. });
  38. $("#queryLink").click(function(){
  39. var dg = $('#dg').datagrid({
  40. url: '/prepress/serialInfo',
  41. queryParams: {serialNo: $("#serialNo").val()},
  42. pagination: false
  43. });
  44. $('dg').datagrid('load');
  45. $("#serialNoSearch").val($("#serialNo").val());
  46. });
  47. //导出
  48. function downExcel(){
  49. var serialNoSearch = $("#serialNoSearch").val();
  50. console.log(serilaNo);
  51. if(serilaNo!=null && serilaNo!=""){
  52. //拼接url
  53. var url = "/prepress/downSerialInfo?serilaNo="+encodeURIComponent(serialNoSearch);
  54. //设置href
  55. $("#downExcel").attr("href", url);
  56. } else {
  57. $.messager.alert('Error','No query results yet!', 'error');
  58. }
  59. }
  60. </script>
  61. </@master.layout>