listProject.jsp 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138
  1. <%@ page language="java" contentType="text/html;charset=GBK" pageEncoding="GBK"%>
  2. <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
  3. <html>
  4. <head>
  5. <meta http-equiv="Content-Type" content="text/html;charset=GBK">
  6. <title>项目列表</title>
  7. <link href="${pageContext.request.contextPath }/liger/lib/ligerUI/skins/${sessionScope.css}/css/ligerui-all.css" rel="stylesheet" type="text/css" />
  8. <script src="${pageContext.request.contextPath }/liger/lib/jquery/jquery-1.3.2.min.js" type="text/javascript"></script>
  9. <script src="${pageContext.request.contextPath }/liger/lib/ligerUI/js/core/base.js" type="text/javascript"></script>
  10. <script src="${pageContext.request.contextPath }/liger/lib/ligerUI/js/plugins/ligerGrid.js" type="text/javascript"></script>
  11. <script src="${pageContext.request.contextPath }/liger/lib/ligerUI/js/plugins/ligerDialog.js" type="text/javascript"></script>
  12. <link href="${pageContext.request.contextPath}/main.css" rel="stylesheet" type="text/css" />
  13. <script type="text/javascript" src="/shares/js/constant.js"></script>
  14. <script type="text/javascript" src="/shares/js/common.js"></script>
  15. <script type="text/javascript">
  16. var grid = null;
  17. var checkValue = new Array(); //定义一个数组
  18. var i = 0;
  19. function initSupplierGridList(params) {
  20. var checkbox = false;
  21. if ("${checkbox}" == 'false' || "${checkbox}" == '') {
  22. checkbox = false;
  23. } else {
  24. checkbox = true;
  25. }
  26. var columns = [
  27. {
  28. display : '项目编号',
  29. name : 'project_code',
  30. width : 150
  31. }, {
  32. display : '项目名称',
  33. name : 'project_name',
  34. width : 300
  35. }, {
  36. display : '创建时间',
  37. name : 'create_date',
  38. width : 100
  39. } ];
  40. grid = $("#maingrid4").ligerGrid(
  41. {
  42. columns : columns,
  43. pageSize : 20,
  44. url : 'erpPurchaseRequestAction.do?task=getProjectData&time='
  45. + new Date().getTime() + params,
  46. pageParmName : 'p', //页索引参数名,(提交给服务器)
  47. pagesizeParmName : 'pSize', //页记录数参数名,(提交给服务器)
  48. width : '99.9%',
  49. height : '99%',
  50. checkbox : checkbox,
  51. isChecked: f_isChecked,
  52. onCheckRow: function(checked, rowdata, rowindex) {
  53. for (var rowid in this.records){
  54. this.unselect(rowid);
  55. }
  56. if(checked){
  57. this.select(rowindex);
  58. }else{
  59. this.unselect(rowindex);
  60. }
  61. }
  62. });
  63. $("#pageloading").hide();
  64. $(".l-grid-hd-cell-btn-checkbox").css("display", "none"); //隱藏checkAll
  65. }
  66. //默认选中
  67. function f_isChecked(rowdata){
  68. if(checkValue != "" && typeof (checkValue) != "undefined"){
  69. if(checkValue[i]==rowdata.sid){
  70. i++;
  71. return true;
  72. }
  73. return false;
  74. }
  75. }
  76. $(function() {
  77. if('${checkValue}' != "" && typeof ('${checkValue}') != "undefined"){
  78. checkValue = '${checkValue}'.split(",");
  79. }
  80. initSupplierGridList();
  81. });
  82. function searchByKword() {
  83. var s = "";
  84. var project_code = $("#project_code").val();
  85. if (project_code != "" && typeof (project_code) != "undefined") {
  86. s += "&project_code=" + encodeURI(encodeURI(project_code));
  87. }
  88. var project_name = $("#project_name").val();
  89. if (project_name != "" && typeof (project_name) != "undefined") {
  90. s += "&project_name=" + encodeURI(encodeURI(project_name));
  91. }
  92. grid.set("newPage","1");
  93. $(function() {
  94. initSupplierGridList(s);
  95. });
  96. }
  97. function f_select() {
  98. var rows = grid.getCheckedRows();
  99. return rows;
  100. }
  101. </script>
  102. </head>
  103. <body>
  104. <%@ include file="/include/message.jsp"%>
  105. <div class="container">
  106. <div class="default_search" style="margin: 0;">
  107. <ul class="list_search">
  108. <li class="title">项目编号:</li>
  109. <li class="text"><input type="text" name="project_code" id="project_code"></li>
  110. </ul>
  111. <ul class="list_search">
  112. <li class="title">项目名称:</li>
  113. <li class="text"><input type="text" name="project_name" id="project_name"></li>
  114. </ul>
  115. <ul>
  116. <li class="search-button">
  117. <input type="button" class='l-button' name="search" onclick="searchByKword()" value="查询" />
  118. </li>
  119. </ul>
  120. </div>
  121. <div style="clear:both;"></div>
  122. <div id="searchbar">
  123. <div style="overflow: hidden;clear: both;">
  124. <div id="maingrid4" style="margin: 0; padding: 0"></div>
  125. </div>
  126. </div>
  127. </div>
  128. </body>
  129. </html>