listSupplier.jsp 8.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283
  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 : 'sno',
  30. width : 120
  31. }, {
  32. display : '供应商全称',
  33. name : 'sname',
  34. width : 300
  35. }, {
  36. display : '联系人',
  37. name : 'slinkman',
  38. width : 100
  39. }, {
  40. display : '创建时间',
  41. name : 'createdate',
  42. width : 180
  43. } ];
  44. if ("${requestScope.lookup }" == "") {
  45. columns.push({
  46. display : '操作',
  47. isAllowHide : false,
  48. width : 200,
  49. render : function(row) {
  50. var html = '<a href=\"#\" onclick=\"addSuppilerProduct('
  51. + row.sid +');\">供货产品</a>&nbsp;';
  52. //html += '<a href=\"#\" onclick=\"viewSuppilerProduct('
  53. //+ row.sid + ');\">供货明细</a>&nbsp;';
  54. html += '<a href=\"#\" onclick=\"viewSuppiler('
  55. + row.sid + ');\">查看</a>&nbsp;';
  56. html += '<a href=\"#\" onclick=\"editSuppiler('
  57. + row.sid+');\">编辑</a>&nbsp;';
  58. html += '<a href=\"#\" onclick=\"deleteRow('
  59. + row.sid + ');\">删除</a>&nbsp;';
  60. return html;
  61. }
  62. });
  63. }
  64. grid = $("#maingrid4").ligerGrid(
  65. {
  66. columns : columns,
  67. pageSize : 20,
  68. url : 'SupplierAction.do?task=list&lookup=${lookup}&time='
  69. + new Date().getTime() + params,
  70. pageParmName : 'p', //页索引参数名,(提交给服务器)
  71. pagesizeParmName : 'pSize', //页记录数参数名,(提交给服务器)
  72. width : '99.9%',
  73. height : '99.3%',
  74. checkbox : checkbox,
  75. isChecked: f_isChecked,
  76. onCheckRow: function(checked, rowdata, rowindex) {
  77. for (var rowid in this.records){
  78. this.unselect(rowid);
  79. }
  80. if(checked){
  81. this.select(rowindex);
  82. }else{
  83. this.unselect(rowindex);
  84. }
  85. }
  86. });
  87. $("#pageloading").hide();
  88. $(".l-grid-hd-cell-btn-checkbox").css("display", "none"); //隱藏checkAll
  89. }
  90. //默认选中
  91. function f_isChecked(rowdata){
  92. if(checkValue != "" && typeof (checkValue) != "undefined"){
  93. if(checkValue[i]==rowdata.sid){
  94. i++;
  95. return true;
  96. }
  97. return false;
  98. }
  99. }
  100. $(function() {
  101. if('${checkValue}' != "" && typeof ('${checkValue}') != "undefined"){
  102. checkValue = '${checkValue}'.split(",");
  103. }
  104. initSupplierGridList();
  105. });
  106. function searchByKword() {
  107. var s = "";
  108. var sno = $("#sno").val();
  109. if (sno != "" && typeof (sno) != "undefined") {
  110. s += "&sno=" + encodeURI(encodeURI(sno));
  111. }
  112. var sname = $("#sname").val();
  113. if (sname != "" && typeof (sname) != "undefined") {
  114. s += "&sname=" + encodeURI(encodeURI(sname));
  115. }
  116. var stype = $("#stype").val();
  117. if (stype != "" && typeof (stype) != "undefined") {
  118. s += "&stype=" + encodeURI(encodeURI(stype));
  119. }
  120. var bill_type = $("#bill_type").val();
  121. if (bill_type != "" && typeof (bill_type) != "undefined") {
  122. s += "&bill_type=" + encodeURI(encodeURI(bill_type));
  123. }
  124. grid.set("newPage","1");
  125. $(function() {
  126. initSupplierGridList(s);
  127. });
  128. }
  129. // wzf start 2015-1-23
  130. function autoSearch(par1,par2){
  131. var s = "";
  132. var sno ="";
  133. if (par1!= "" && typeof ( par1) != "undefined"){
  134. sno = par1;
  135. }else{
  136. sno = $("#sno").val();
  137. }
  138. if (sno != "" && typeof (sno) != "undefined") {
  139. s += "&sno=" + encodeURI(encodeURI(sno));
  140. }
  141. var sname = "";
  142. if (par2!= "" && typeof (par2) != "undefined"){
  143. sname = par2;
  144. }else{
  145. sname = $("#sname").val();
  146. }
  147. if (sname != "" && typeof (sname) != "undefined") {
  148. s += "&sname=" + encodeURI(encodeURI(sname));
  149. }
  150. grid.set("newPage","1");
  151. $(function() {
  152. initSupplierGridList(s);
  153. });
  154. }
  155. // wzf start 2015-1-23
  156. function f_select() {
  157. var rows = grid.getCheckedRows();
  158. return rows;
  159. }
  160. // 导入
  161. var importDlg;
  162. function importExcel(){
  163. var type="supplier";
  164. importDlg = $.ligerDialog.open({
  165. height: 120,
  166. width:440,
  167. url: 'initStockAction.do?task=toImport&type='+type,
  168. allowClose:false,
  169. title:'导入供应商',
  170. buttons : [ {
  171. text : '导入',
  172. onclick : function(item,dialog){
  173. dialog.frame.importExcel(window);
  174. }
  175. },{
  176. text : '关闭',
  177. onclick : function(item,dialog){
  178. importDlg.close();
  179. grid.loadData();
  180. }
  181. }]
  182. });
  183. }
  184. //新增供应货物
  185. function addSuppilerProduct(universalid){
  186. addTab('addSuppilerProduct' + getCurrentTabId(), '新增供应货物', '${pageContext.request.contextPath }/SupplierAction.do?task=toAddSupplyProduct&sid='
  187. + universalid + '&tabid=' + getCurrentTabId(),true,true);
  188. }
  189. function viewSuppilerProduct(universalid){
  190. addTab('viewSuppilerProduct' + getCurrentTabId(), '供货明细', '${pageContext.request.contextPath }/SupplierAction.do?task=infoSupplyProduct&sid='
  191. + universalid + '&tabid=' + getCurrentTabId(),true,true);
  192. }
  193. //查看供应商
  194. function viewSuppiler(universalid){
  195. addTab('viewSuppiler' + getCurrentTabId(), '查看供应商', '${pageContext.request.contextPath }/SupplierAction.do?task=info&sid='
  196. + universalid + '&tabid=' + getCurrentTabId(),true,true);
  197. }
  198. //编辑供应商
  199. function editSuppiler(universalid){
  200. addTab('editSuppiler' + getCurrentTabId(), '编辑供应商', '${pageContext.request.contextPath }/SupplierAction.do?task=toEdit&sid='
  201. + universalid + '&tabid=' + getCurrentTabId(),true,true);
  202. }
  203. //删除供应商
  204. function deleteRow(universalid){
  205. if (window.confirm("确定要删除吗?")){
  206. addTab('delSuppiler' + getCurrentTabId(), '删除供应商', '${pageContext.request.contextPath }/SupplierAction.do?task=del&sid='
  207. + universalid + '&tabid=' + getCurrentTabId(),true,true);
  208. }
  209. }
  210. </script>
  211. </head>
  212. <body>
  213. <%@ include file="/include/message.jsp"%>
  214. <div class="container">
  215. <c:if test="${requestScope.lookup == null or requestScope.looup == '' }">
  216. <div id="title" class="form-button">
  217. <input type="button" class="l-button" value="新增供应商" onclick="addTab('addSupplier'+getCurrentTabId(), '新增供应商', '${pageContext.request.contextPath }/SupplierAction.do?task=toCreate&tabid=' + getCurrentTabId(),true,true);"/>
  218. <input type="button" class="l-button" value="导入供应商" onclick="importExcel()" />
  219. </div>
  220. <div class="default_search" style="margin: 0; height:30px;"></div>
  221. </c:if>
  222. <div class="default_search" style="margin: 0;">
  223. <ul class="list_search">
  224. <li class="title">供应商编号:</li>
  225. <li class="text"><input type="text" name="sno" id="sno" onkeyup="autoSearch(this.value,'')" onchange="autoSearch('','')"></li>
  226. </ul>
  227. <ul class="list_search">
  228. <li class="title">供应商全称:</li>
  229. <li class="text"><input type="text" name="sname" id="sname" onkeyup="autoSearch('',this.value)" onchange="autoSearch('','')"></li>
  230. </ul>
  231. <ul class="list_search" >
  232. <li class="title">供应商类别:</li>
  233. <li class="text">
  234. <select id="stype" name="stype" class="short-text">
  235. <option value="" selected="selected">--请选择--</option>
  236. <c:forEach items="${requestScope.stype}" var="stype">
  237. <option value="${stype.dvalue }">${stype.dname }</option>
  238. </c:forEach>
  239. </select>
  240. </li>
  241. </ul>
  242. <ul class="list_search">
  243. <li class="title">发票类型:</li>
  244. <li class="text">
  245. <select id="bill_type" name="bill_type" class="short-text">
  246. <option value="" selected="selected">--请选择--</option>
  247. <c:forEach items="${requestScope.bill_type}" var="bill_type">
  248. <option value="${bill_type.dvalue }">${bill_type.dname }</option>
  249. </c:forEach>
  250. </select>
  251. </li>
  252. </ul>
  253. <ul>
  254. <li class="search-button">
  255. <input type="button" class='l-button' name="search" onclick="searchByKword()" value="查询" />
  256. </li>
  257. </ul>
  258. </div>
  259. <div style="clear:both;"></div>
  260. <div id="searchbar">
  261. <div style="overflow: hidden;clear: both;">
  262. <div id="maingrid4" style="margin: 0; padding: 0"></div>
  263. </div>
  264. </div>
  265. </div>
  266. </body>
  267. </html>