counterList.jsp 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177
  1. <%@ page contentType="text/html;charset=GBK"%>
  2. <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
  3. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  4. <HEAD>
  5. <TITLE>合作公司信息</TITLE>
  6. <link href="${pageContext.request.contextPath }/liger/lib/ligerUI/skins/${sessionScope.css}/css/ligerui-all.css" rel="stylesheet" type="text/css" />
  7. <script src="${pageContext.request.contextPath }/liger/lib/jquery/jquery-1.3.2.min.js" type="text/javascript"></script>
  8. <script src="${pageContext.request.contextPath }/liger/lib/ligerUI/js/core/base.js" type="text/javascript"></script>
  9. <script src="${pageContext.request.contextPath }/liger/lib/ligerUI/js/plugins/ligerGrid.js" type="text/javascript"></script>
  10. <link href="${pageContext.request.contextPath}/main.css" rel="stylesheet" type="text/css" />
  11. <script src="${pageContext.request.contextPath}/liger/lib/ligerUI/js/ligerui.all.js"
  12. type="text/javascript"></script>
  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 i = 0;
  18. var checkValue = new Array(); //定义一个数组
  19. $(document).ready(function(){
  20. if('${checkValue}' != "" && typeof ('${checkValue}') != "undefined"){
  21. checkValue = '${checkValue}'.split(",");
  22. }
  23. searchByKword();
  24. });
  25. function loadCounterList(params) {
  26. var checkbox = false;
  27. if ("${checkbox}" == 'false' || "${checkbox}" == '') {
  28. checkbox = false;
  29. } else {
  30. checkbox = true;
  31. }
  32. var columns = [
  33. {
  34. display : '点包机编号',
  35. name : 'counter_no',
  36. width : 150
  37. },
  38. {
  39. display : '点包机名称',
  40. name : 'counter_name',
  41. width : 320
  42. },
  43. {
  44. display : '发料仓库',
  45. name : 'sdepot_name',
  46. width : 320
  47. }];
  48. if ("${requestScope.lookup }" == "") {
  49. columns.push({
  50. display : '操作',
  51. isAllowHide : false,
  52. width : 200,
  53. render : function(row) {
  54. var html = '<a href=\"#\" onclick=\"viewCounterEntry('
  55. + row.universalid
  56. + ')\">查看</a>&nbsp;';
  57. html += '<a href=\"#\" onclick=\"editCounterEntry('
  58. + row.universalid
  59. + ')\">编辑</a>&nbsp;';
  60. html += '<a href=\"#\" onclick=\"delCounterEntry('
  61. + row.universalid
  62. + ')\">删除</a>&nbsp;';
  63. return html;
  64. }
  65. });
  66. }
  67. grid = $("#counterGrid")
  68. .ligerGrid(
  69. {
  70. columns : columns,
  71. pageSize : 20,
  72. url : 'erpEndProdCounterAction.do?task=counterList&lookup=${lookup}'+params
  73. + '&time='
  74. + new Date().getTime(),
  75. pageParmName : 'p', //页索引参数名,(提交给服务器)
  76. pagesizeParmName : 'pSize', //页记录数参数名,(提交给服务器)
  77. width : '99.9%',
  78. height : '99%',
  79. isChecked: f_isChecked,
  80. checkbox : checkbox,
  81. onCheckRow : function(checked, rowdata, rowindex) {
  82. for ( var rowid in this.records)
  83. this.unselect(rowid);
  84. this.select(rowindex);
  85. }
  86. });
  87. $("#pageloading").hide();
  88. if(checkbox){
  89. $(".l-grid-hd-cell-btn-checkbox").css("display", "none"); //隱藏checkAll
  90. }
  91. }
  92. function viewCounterEntry(id){
  93. window.parent.f_addTab(new Date().getTime(), '查看点包机信息', '${pageContext.request.contextPath }/erpEndProdCounterAction.do?task=viewCounterEntry&id='+id+'&tabid=' + getCurrentTabId());
  94. }
  95. function editCounterEntry(id){
  96. window.parent.f_addTab(new Date().getTime(), '编辑点包机信息', '${pageContext.request.contextPath }/erpEndProdCounterAction.do?task=toEditCounterEntry&id='+id+'&tabid=' + getCurrentTabId());
  97. }
  98. function delCounterEntry(id){
  99. if (window.confirm("确定要删除吗?")){
  100. var param={'id':id};
  101. sendAjaxParam(param,"erpEndProdCounterAction.do?task=delCounterEntry",'json',delProcess);
  102. }
  103. }
  104. function delProcess(data){
  105. if(data.error!=null){
  106. $.ligerDialog.error(data.error);
  107. }
  108. if(data.success!=null){
  109. $.ligerDialog.success(data.success);
  110. }
  111. searchByKword();
  112. }
  113. function searchByKword(){
  114. if(grid!=null){
  115. grid.set("newPage","1");
  116. }
  117. var params="";
  118. var counter_search_num=$("#counter_search_num").val();
  119. params=params+"&counter_search_num="+encodeURI(encodeURI(counter_search_num));
  120. var counter_search_name=$("#counter_search_name").val();
  121. params=params+"&counter_search_name="+encodeURI(encodeURI(counter_search_name));
  122. loadCounterList(params);
  123. }
  124. function f_select() {
  125. var rows = grid.getCheckedRows();
  126. return rows;
  127. }
  128. //默认选中
  129. function f_isChecked(rowdata){
  130. if(checkValue != "" && typeof (checkValue) != "undefined"){
  131. if(checkValue[i]==rowdata.universalid){
  132. i++;
  133. return true;
  134. }
  135. return false;
  136. }
  137. }
  138. </script>
  139. </HEAD>
  140. <BODY>
  141. <%@ include file="/include/button.jsp"%>
  142. <%@ include file="/include/message.jsp"%>
  143. <div class="container">
  144. <c:if test="${requestScope.lookup == null or requestScope.looup == '' }">
  145. <div id="title" class="form-button">
  146. <input style="width:80px;" type="button" class="l-button" value="添加点包机" onclick="window.parent.f_addTab(new Date().getTime(), '添加点包机', '${pageContext.request.contextPath }/erpEndProdCounterAction.do?task=toCreate&tabid=' + getCurrentTabId());"/>
  147. </div>
  148. <div class="default_search" style="margin: 0; height:30px;"></div>
  149. </c:if>
  150. <div class="default_search" style="margin: 0;">
  151. <ul class="list_search" style="width:300px;">
  152. <li class="title" style="width:100px;">点包机编号:</li>
  153. <li class="text" >
  154. <input type="text" name="counter_search_num" id="counter_search_num" value=""/>
  155. </li>
  156. </ul>
  157. <ul class="list_search" style="float:left;width:300px">
  158. <li class="title" style="width:100px;">点包机名称:</li>
  159. <li class="text" style="width:150px;">
  160. <input type="text" name="counter_search_name" id="counter_search_name" value=""/>
  161. </li>
  162. </ul>
  163. <ul>
  164. <li class="search-button"><input type="button" class='l-button'
  165. name="search" onclick="searchByKword()" value="查询" /></li>
  166. </ul>
  167. </div>
  168. <div style="overflow: hidden; clear: both;">
  169. <div id="counterGrid" style="margin: 0; padding: 0"></div>
  170. </div>
  171. </div>
  172. </BODY>
  173. </HTML>