storeDepotList.jsp 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172
  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 loadStoreDepotList(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 : 'sdepot_no',
  36. width : 220
  37. },
  38. {
  39. display : '发料仓库名称',
  40. name : 'sdepot_name',
  41. width : 320
  42. }];
  43. if ("${requestScope.lookup }" == "") {
  44. columns.push({
  45. display : '操作',
  46. isAllowHide : false,
  47. width : 200,
  48. render : function(row) {
  49. var html = '<a href=\"#\" onclick=\"viewStoreDepotEntry('
  50. + row.universalid
  51. + ')\">查看</a>&nbsp;';
  52. html += '<a href=\"#\" onclick=\"editStoreDepotEntry('
  53. + row.universalid
  54. + ')\">编辑</a>&nbsp;';
  55. html += '<a href=\"#\" onclick=\"delStoreDepotEntry('
  56. + row.universalid
  57. + ')\">删除</a>&nbsp;';
  58. return html;
  59. }
  60. });
  61. }
  62. grid = $("#storeDepotGrid")
  63. .ligerGrid(
  64. {
  65. columns : columns,
  66. pageSize : 20,
  67. url : 'erpEndProdStoreDepotAction.do?task=storeDepotList&lookup=${lookup}'+params
  68. + '&time='
  69. + new Date().getTime(),
  70. pageParmName : 'p', //页索引参数名,(提交给服务器)
  71. pagesizeParmName : 'pSize', //页记录数参数名,(提交给服务器)
  72. width : '99.9%',
  73. height : '99%',
  74. isChecked: f_isChecked,
  75. checkbox : checkbox,
  76. onCheckRow : function(checked, rowdata, rowindex) {
  77. for ( var rowid in this.records)
  78. this.unselect(rowid);
  79. this.select(rowindex);
  80. },
  81. });
  82. $("#pageloading").hide();
  83. if(checkbox){
  84. $(".l-grid-hd-cell-btn-checkbox").css("display", "none"); //隱藏checkAll
  85. }
  86. }
  87. function viewStoreDepotEntry(id){
  88. window.parent.f_addTab(new Date().getTime(), '查看发料仓库信息', '${pageContext.request.contextPath }/erpEndProdStoreDepotAction.do?task=viewStoreDepotEntry&id='+id+'&tabid=' + getCurrentTabId());
  89. }
  90. function editStoreDepotEntry(id){
  91. window.parent.f_addTab(new Date().getTime(), '编辑发料仓库信息', '${pageContext.request.contextPath }/erpEndProdStoreDepotAction.do?task=toEditStoreDepotEntry&id='+id+'&tabid=' + getCurrentTabId());
  92. }
  93. function delStoreDepotEntry(id){
  94. if (window.confirm("确定要删除吗?")){
  95. var param={'id':id};
  96. sendAjaxParam(param,"erpEndProdStoreDepotAction.do?task=delStoreDepotEntry",'json',delProcess);
  97. }
  98. }
  99. function delProcess(data){
  100. if(data.error!=null){
  101. $.ligerDialog.error(data.error);
  102. }
  103. if(data.success!=null){
  104. $.ligerDialog.success(data.success);
  105. }
  106. searchByKword();
  107. }
  108. function searchByKword(){
  109. if(grid!=null){
  110. grid.set("newPage","1");
  111. }
  112. var params="";
  113. var storeDepot_search_num=$("#storeDepot_search_num").val();
  114. params=params+"&storeDepot_search_num="+encodeURI(encodeURI(storeDepot_search_num));
  115. var storeDepot_search_name=$("#storeDepot_search_name").val();
  116. params=params+"&storeDepot_search_name="+encodeURI(encodeURI(storeDepot_search_name));
  117. loadStoreDepotList(params);
  118. }
  119. function f_select() {
  120. var rows = grid.getCheckedRows();
  121. return rows;
  122. }
  123. //默认选中
  124. function f_isChecked(rowdata){
  125. if(checkValue != "" && typeof (checkValue) != "undefined"){
  126. if(checkValue[i]==rowdata.universalid){
  127. i++;
  128. return true;
  129. }
  130. return false;
  131. }
  132. }
  133. </script>
  134. </HEAD>
  135. <BODY>
  136. <%@ include file="/include/button.jsp"%>
  137. <%@ include file="/include/message.jsp"%>
  138. <div class="container">
  139. <c:if test="${requestScope.lookup == null or requestScope.looup == '' }">
  140. <div id="title" class="form-button">
  141. <input style="width:100px;" type="button" class="l-button" value="添加发料仓库" onclick="window.parent.f_addTab(new Date().getTime(), '添加发料仓库', '${pageContext.request.contextPath }/erpEndProdStoreDepotAction.do?task=toCreate&tabid=' + getCurrentTabId());"/>
  142. </div>
  143. <div class="default_search" style="margin: 0; height:30px;"></div>
  144. </c:if>
  145. <div class="default_search" style="margin: 0;">
  146. <ul class="list_search" style="width:300px;">
  147. <li class="title" style="width:100px;">发料仓库编号:</li>
  148. <li class="text" >
  149. <input type="text" name="storeDepot_search_num" id="storeDepot_search_num" value=""/>
  150. </li>
  151. </ul>
  152. <ul class="list_search" style="float:left;width:300px">
  153. <li class="title" style="width:100px;">发料仓库名称:</li>
  154. <li class="text" style="width:150px;">
  155. <input type="text" name="storeDepot_search_name" id="storeDepot_search_name" value=""/>
  156. </li>
  157. </ul>
  158. <ul>
  159. <li class="search-button"><input type="button" class='l-button'
  160. name="search" onclick="searchByKword()" value="查询" /></li>
  161. </ul>
  162. </div>
  163. <div style="overflow: hidden; clear: both;">
  164. <div id="storeDepotGrid" style="margin: 0; padding: 0"></div>
  165. </div>
  166. </div>
  167. </BODY>
  168. </HTML>