listProject.jsp 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146
  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 : 'subtotal',
  38. width : 100
  39. }, {
  40. display : '备用金',
  41. name : 'petty_cash',
  42. width : 100
  43. }, {
  44. display : '创建时间',
  45. name : 'create_date',
  46. width : 100
  47. } ];
  48. grid = $("#maingrid4").ligerGrid(
  49. {
  50. columns : columns,
  51. pageSize : 20,
  52. url : 'fmChooseProjectAction.do?method=getProjectData&time='
  53. + new Date().getTime() + params,
  54. pageParmName : 'p', //页索引参数名,(提交给服务器)
  55. pagesizeParmName : 'pSize', //页记录数参数名,(提交给服务器)
  56. width : '99.9%',
  57. height : '99%',
  58. checkbox : checkbox,
  59. isChecked: f_isChecked,
  60. onCheckRow: function(checked, rowdata, rowindex) {
  61. for (var rowid in this.records){
  62. this.unselect(rowid);
  63. }
  64. if(checked){
  65. this.select(rowindex);
  66. }else{
  67. this.unselect(rowindex);
  68. }
  69. }
  70. });
  71. $("#pageloading").hide();
  72. $(".l-grid-hd-cell-btn-checkbox").css("display", "none"); //隱藏checkAll
  73. }
  74. //默认选中
  75. function f_isChecked(rowdata){
  76. if(checkValue != "" && typeof (checkValue) != "undefined"){
  77. if(checkValue[i]==rowdata.sid){
  78. i++;
  79. return true;
  80. }
  81. return false;
  82. }
  83. }
  84. $(function() {
  85. if('${checkValue}' != "" && typeof ('${checkValue}') != "undefined"){
  86. checkValue = '${checkValue}'.split(",");
  87. }
  88. initSupplierGridList();
  89. });
  90. function searchByKword() {
  91. var s = "";
  92. var sno = $("#sno").val();
  93. if (sno != "" && typeof (sno) != "undefined") {
  94. s += "&sno=" + encodeURI(encodeURI(sno));
  95. }
  96. var sname = $("#sname").val();
  97. if (sname != "" && typeof (sname) != "undefined") {
  98. s += "&sname=" + encodeURI(encodeURI(sname));
  99. }
  100. grid.set("newPage","1");
  101. $(function() {
  102. initSupplierGridList(s);
  103. });
  104. }
  105. function f_select() {
  106. var rows = grid.getCheckedRows();
  107. return rows;
  108. }
  109. </script>
  110. </head>
  111. <body>
  112. <%@ include file="/include/message.jsp"%>
  113. <div class="container">
  114. <div class="default_search" style="margin: 0;">
  115. <ul class="list_search">
  116. <li class="title">项目编号:</li>
  117. <li class="text"><input type="text" name="sno" id="sno"></li>
  118. </ul>
  119. <ul class="list_search">
  120. <li class="title">项目全称:</li>
  121. <li class="text"><input type="text" name="sname" id="sname"></li>
  122. </ul>
  123. <ul>
  124. <li class="search-button">
  125. <input type="button" class='l-button' name="search" onclick="searchByKword()" value="查询" />
  126. </li>
  127. </ul>
  128. </div>
  129. <div style="clear:both;"></div>
  130. <div id="searchbar">
  131. <div style="overflow: hidden;clear: both;">
  132. <div id="maingrid4" style="margin: 0; padding: 0"></div>
  133. </div>
  134. </div>
  135. </div>
  136. </body>
  137. </html>