listPurchaseOrder.jsp 8.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249
  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}/main.css" rel="stylesheet" type="text/css" />
  8. <link href="${pageContext.request.contextPath }/liger/lib/ligerUI/skins/${sessionScope.css}/css/ligerui-all.css" rel="stylesheet" type="text/css" />
  9. <script src="${pageContext.request.contextPath }/liger/lib/jquery/jquery-1.3.2.min.js" type="text/javascript"></script>
  10. <script src="${pageContext.request.contextPath }/liger/lib/ligerUI/js/core/base.js" type="text/javascript"></script>
  11. <script src="${pageContext.request.contextPath }/liger/lib/ligerUI/js/plugins/ligerGrid.js" type="text/javascript"></script>
  12. <script type="text/javascript" src="/shares/js/constant.js"></script>
  13. <script type="text/javascript" src="/shares/js/common.js"></script>
  14. <script type="text/javascript" src="/shares/js/yw/erp/erpflow.js"></script>
  15. <script src="${pageContext.request.contextPath}/liger/lib/ligerUI/js/ligerui.all.js" type="text/javascript"></script>
  16. <script type="text/javascript">
  17. var grid = null;
  18. $(function() {
  19. initPurchaseGridList();
  20. });
  21. function initPurchaseGridList(params) {
  22. var checkbox = false;
  23. if ("${checkbox}" == 'false' || "${checkbox}" == '') {
  24. checkbox = false;
  25. } else {
  26. checkbox = true;
  27. }
  28. var columns = [
  29. {
  30. display : '采购单号',
  31. name : 'purchase_number',
  32. width : 120
  33. }, {
  34. display : '采购单主题',
  35. name : 'purchase_theme',
  36. width : 120
  37. }, {
  38. display : '供应商名称',
  39. name : 'purchase_suppliers_name',
  40. width : 80
  41. }, {
  42. display : '采购日期',
  43. name : 'purchase_date',
  44. width : 80
  45. }, {
  46. display : '采购类型',
  47. name : 'purchase_type_name',
  48. width : 80
  49. } , {
  50. display : '采购负责人',
  51. name : 'purchase_assigned_user_name',
  52. width : 80
  53. } ,{
  54. display : '实付金额',
  55. name : 'purchase_after_amount',
  56. width : 80
  57. },{
  58. display : '采购状态',
  59. name : 'purchase_status_name',
  60. width : 80
  61. },{
  62. display : '付款状态',
  63. name : 'purchase_payment_state_name',
  64. width : 80
  65. },{
  66. display : '审核状态',
  67. name : 'au_status',
  68. width : 120,
  69. render : function(row) {
  70. if(row.au_status=="4"){
  71. return "未审核";
  72. }else if(row.au_status=="1"){
  73. var html = '<a href=\"#\" onclick=\"viewflow('+ row.flow_ins_id + ')\"><font color=blue>审核中</font></a>&nbsp;';
  74. return html;
  75. }else if(row.au_status=="2"){
  76. var html = '<a href=\"#\" onclick=\"viewflow('+ row.flow_ins_id + ')\"><font color=blue>审核通过</font></a>&nbsp;';
  77. return html;
  78. }else if(row.au_status == "3"){
  79. var html = '<a href=\"#\" onclick=\"viewflow('+ row.flow_ins_id + ')\"><font color=blue>驳回</font></a>&nbsp;';
  80. return html;
  81. }
  82. }
  83. }];
  84. if ("${requestScope.lookup }" == "") {
  85. columns
  86. .push({
  87. display : '操作',
  88. width : 180,
  89. isAllowHide : false,
  90. render : function(row) {
  91. var html = '<a href=\"#\" onclick=\"addTab(\'viewpurchase\'+getCurrentTabId(), \'查看采购信息\', \'${pageContext.request.contextPath }/erpPurchaseOrderAction.do?task=view&purchase_id='
  92. + row.purchase_id + '\',true,true);\"><font color=blue>查看</font></a>&nbsp;';
  93. if('${loginId}'==row.purchaser_create_id){
  94. if(row.purchase_status==0){
  95. if(row.au_status==4 || row.au_status==3){
  96. html += '<a href=\"#\" onclick=\"deleteRow('+ row.purchase_id + ')\"><font color=blue>删除</font></a>&nbsp;';
  97. html += '<a href=\"#\" onclick=\"addTab(\'updatepurchase\'+getCurrentTabId(), \'修改采购信息\', \'${pageContext.request.contextPath }/erpPurchaseOrderAction.do?task=toEdit&purchase_id='
  98. + row.purchase_id
  99. + '&tabid='
  100. + getCurrentTabId() + '\',true,true);\"><font color=blue>编辑</font></a>&nbsp;';
  101. }
  102. if(row.au_status==1 || row.au_status==3){
  103. html += '<a href=\"#\" onclick=\"cancel_payflow('+ row.flow_ins_id + ')\"><font color=blue>撤消</font></a>&nbsp;';
  104. }
  105. //html += '<a href=\"#\" onclick=\"cancleRow('+ row.purchase_id + ')\">撤消</a>&nbsp;';
  106. }
  107. }
  108. html += '<a href=\"${pageContext.request.contextPath }/erpPurchaseOrderAction.do?task=print&purchase_id='
  109. + row.purchase_id + '\" target="_blank"><font color=blue>打印</font></a>&nbsp;';
  110. return html;
  111. }
  112. });
  113. }
  114. grid = $("#maingrid4")
  115. .ligerGrid(
  116. {
  117. columns : columns,
  118. pageSize : 20,
  119. url : 'erpPurchaseOrderAction.do?task=query&purchaseStatus=${purchaseStatus}&au_status=${au_status}&purchase_payment_state=${purchase_payment_state}&lookup=${lookup}&loginId=${loginId}&time='
  120. + new Date().getTime() + params,
  121. pageParmName : 'p', //页索引参数名,(提交给服务器)
  122. pagesizeParmName : 'pSize', //页记录数参数名,(提交给服务器)
  123. width : '99.9%',
  124. height : '98.5%',
  125. checkbox : checkbox,
  126. onCheckRow: function(checked, rowdata, rowindex) {
  127. for (var rowid in this.records){
  128. this.unselect(rowid);
  129. }
  130. if(checked){
  131. this.select(rowindex);
  132. }else{
  133. this.unselect(rowindex);
  134. }
  135. }
  136. });
  137. $("#pageloading").hide();
  138. $(".l-grid-hd-cell-btn-checkbox").css("display", "none"); //隱藏checkAll
  139. }
  140. // wzf start 2015-01-15
  141. /**
  142. * 撤销流程
  143. */
  144. function cancel_payflow(insId){
  145. if(!confirm("确定要撤消流程?")){
  146. return ;
  147. }
  148. $.ajax({
  149. type:"post",
  150. url:"workFlowAction.do?task=cancelflow&insId="+insId+"&time="+new Date().getTime(),
  151. dataType:"json",
  152. success:function(data){
  153. if(data.i>0){
  154. $.ligerDialog.success("操作成功");
  155. searchByKword();
  156. }else{
  157. $.ligerDialog.success("操作失败");
  158. }
  159. }
  160. });
  161. }
  162. //查询
  163. function searchByKword() {
  164. var purchase_number= $("#purchase_number").val();//采购单编号
  165. var s = "";
  166. if (purchase_number != "" && typeof (purchase_number) != "undefined") {
  167. s += "&purchase_number=" + encodeURI(encodeURI(purchase_number));
  168. }
  169. var purchase_theme= $("#purchase_theme").val();//采购单主题
  170. if (purchase_theme != "" && typeof (purchase_theme) != "undefined") {
  171. s += "&purchase_theme=" + encodeURI(encodeURI(purchase_theme));
  172. }
  173. grid.set("newPage","1");
  174. $(function() {
  175. initPurchaseGridList(s);
  176. });
  177. }
  178. function f_select() {
  179. var rows = grid.getCheckedRows();
  180. return rows;
  181. }
  182. function deleteRow(obj) {
  183. if (confirm("确定要删除")) {
  184. window.parent.f_addTab(new Date().getTime(), '删除采购信息',
  185. '${pageContext.request.contextPath }/erpPurchaseOrderAction.do?task=delete&purchase_id='
  186. + obj + '&tabid=' + getCurrentTabId());
  187. }
  188. }
  189. //撤消采购单
  190. function cancleRow(obj) {
  191. if (confirm("确定要删除")) {
  192. window.parent.f_addTab(new Date().getTime(), '撤消采购单',
  193. '${pageContext.request.contextPath }/erpPurchaseOrderAction.do?task=cancle&purchase_status=2&purchase_id='
  194. + obj + '&tabid=' + getCurrentTabId());
  195. }
  196. }
  197. /**
  198. * 查看流程
  199. */
  200. function viewflow(insId){
  201. var url="${pageContext.request.contextPath}/workFlowAction.do?task=viewflow&insId="+insId+"&tabid="+getCurrentTabId();
  202. openODialog(url,"查看流程信息");
  203. }
  204. </script>
  205. </head>
  206. <body>
  207. <%@ include file="/include/message.jsp"%>
  208. <div class="container">
  209. <%-- <c:if test="${!empty requestScope.loginId && requestScope.lookup == null or requestScope.looup == '' }">
  210. <div id="title" class="form-button">
  211. <input type="button" class="l-button" value="新增采购信息" onclick="addTab('addpurchase'+getCurrentTabId(), '新增采购订单', '${pageContext.request.contextPath }/erpPurchaseOrderAction.do?task=toAdd&tabid=' + getCurrentTabId(),true,true);" style="width: 90px"/>
  212. </div>
  213. <div class="default_search" style="margin: 0; height:30px;"></div>
  214. </c:if> --%>
  215. <div class="default_search" style="margin: 0;">
  216. <ul class="list_search">
  217. <li class="title">采购单号:</li>
  218. <li class="text"><input type="text" name="purchase_number" id="purchase_number">
  219. </li>
  220. </ul>
  221. <ul class="list_search">
  222. <li class="title">采购单主题:</li>
  223. <li class="text"><input type="text" name="purchase_theme" id="purchase_theme">
  224. </li>
  225. </ul>
  226. <ul>
  227. <li class="search-button"><input type="button" class='l-button'
  228. name="search" onclick="searchByKword()" value="查询" /></li>
  229. </ul>
  230. </div>
  231. <div style="clear:both;"></div>
  232. <div id="searchbar">
  233. <div style="overflow: hidden; clear: both;">
  234. <div id="maingrid4" style="margin: 0; padding: 0"></div>
  235. </div>
  236. </div>
  237. </div>
  238. </body>
  239. </html>