purchaseAccountPayList.jsp 6.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232
  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 src="${pageContext.request.contextPath}/liger/lib/ligerUI/js/plugins/ligerDialog.js" 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" src="/shares/datePicker/WdatePicker.js"></script>
  16. <script src="${pageContext.request.contextPath}/liger/lib/ligerUI/js/ligerui.all.js" type="text/javascript"></script>
  17. <script type="text/javascript">
  18. var grid = null;
  19. $(function() {
  20. initTargetGrid();
  21. });
  22. function initTargetGrid(params) {
  23. var columns = [
  24. {
  25. display : '供应商名称',
  26. name : 'sname',
  27. width : 300,
  28. totalSummary:
  29. {
  30. type: 'sum',
  31. render: function (e) {
  32. return "<div>" + ' 合计' + "</div>";
  33. }
  34. }
  35. }, {
  36. display : '应付款',
  37. name : 'total_amount',
  38. width : 120,
  39. totalSummary:
  40. {
  41. type: 'sum',
  42. render: function (e) {
  43. var sum = parseFloat(e.sum);
  44. return "<div>" + formatnumber(sum,2) + "</div>";
  45. }
  46. }
  47. }, {
  48. display : '已付款',
  49. name : 'payment_amount',
  50. width : 120,
  51. totalSummary:
  52. {
  53. type: 'sum',
  54. render: function (e) {
  55. var sum = parseFloat(e.sum);
  56. return "<div>" + formatnumber(sum,2) + "</div>";
  57. }
  58. }
  59. },{
  60. display : '未付款',
  61. name : 'unpaid_amount',
  62. width : 120,
  63. totalSummary:
  64. {
  65. type: 'sum',
  66. render: function (e) {
  67. var sum = parseFloat(e.sum);
  68. return "<div>" + formatnumber(sum,2) + "</div>";
  69. }
  70. }
  71. }
  72. ];
  73. columns
  74. .push({
  75. display : '操作',
  76. width : 130,
  77. isAllowHide : false,
  78. render : function(row) {
  79. var html = '<a href=\"#\" onclick=\"paymentRequest('+ row.supplier_id + ')\"><font color=blue>付款申请</font></a>&nbsp;';
  80. return html;
  81. }
  82. });
  83. grid = $("#maingrid4")
  84. .ligerGrid(
  85. {
  86. columns : columns,
  87. pageSize : 20,
  88. url : 'erpPurchaseAccountPayAction.do?task=purchaseAccountPayList&viewListType=allList&time=' + new Date().getTime() + params,
  89. pageParmName : 'p', //页索引参数名,(提交给服务器)
  90. pagesizeParmName : 'pSize', //页记录数参数名,(提交给服务器)
  91. width : '99.9%',
  92. height : '99%'
  93. });
  94. $("#pageloading").hide();
  95. $(".l-grid-hd-cell-btn-checkbox").css("display", "none"); //隱藏checkAll
  96. }
  97. //查询
  98. function searchByKword() {
  99. var s = "";
  100. var sname = $("#sname").val();//供应商名称
  101. if (sname != "" && typeof (sname) != "undefined") {
  102. s += "&sname=" + encodeURI(encodeURI(sname)) ;
  103. }
  104. grid.set("newPage","1");
  105. initTargetGrid(s);
  106. }
  107. function f_select() {
  108. var rows = grid.getCheckedRows();
  109. return rows;
  110. }
  111. /**
  112. * 付款申请
  113. */
  114. function paymentRequest(supplier_id){
  115. addTab('paymentRequest' + getCurrentTabId(), '付款申请', '${pageContext.request.contextPath }/erpPurchaseAccountPayAction.do?task=toPaymentRequest&supplier_id='
  116. + supplier_id + '&tabid=' + getCurrentTabId(),true,true);
  117. }
  118. //清除查询条件
  119. function clearAll(){
  120. $("#receive_date_start").val("");
  121. $("#receive_date_end").val("");
  122. $("#income_sta_number").val("");
  123. $("#operator").val("");
  124. $("#pay_unit").val("");
  125. $("#contract_number").val("");
  126. grid.set("newPage","1");
  127. initTargetGrid();
  128. }
  129. /**
  130. * 撤销流程
  131. */
  132. function cancel_payflow(insId){
  133. if(!confirm("确定要撤消流程?")){
  134. return ;
  135. }
  136. $.ajax({
  137. type:"post",
  138. url:"workFlowAction.do.do?task=cancelflow&insId="+insId+"&time="+new Date().getTime(),
  139. dataType:"json",
  140. success:function(data){
  141. if(data.i>0){
  142. $.ligerDialog.success("操作成功");
  143. searchByKword();
  144. }else{
  145. $.ligerDialog.success("操作失败");
  146. }
  147. }
  148. });
  149. }
  150. /**
  151. * 查看流程
  152. */
  153. function viewflow(insId){
  154. var url="${pageContext.request.contextPath}/workFlowAction.do?task=viewflow&insId="+insId+"&tabid="+getCurrentTabId();
  155. openODialog(url,"查看流程信息");
  156. }
  157. function openODialog(owurl, name) {
  158. oDialog = openTopDialog({
  159. height : $("body", window.top.document).height() - 50,
  160. width : $("body", window.top.document).width() - 50,
  161. url : owurl,
  162. showMax : false,
  163. showToggle : false,
  164. showMin : false,
  165. isResize : false,
  166. modal : false,
  167. title : name,
  168. allowClose : true
  169. });
  170. }
  171. function closeODialog() {
  172. oDialog.close();
  173. }
  174. /**
  175. * 格式化小数点
  176. */
  177. function formatnumber(value, num) {
  178. var a, b, c, i;
  179. a = value.toString();
  180. b = a.indexOf(".");
  181. c = a.length;
  182. if (num == 0) {
  183. if (b != -1) {
  184. a = a.substring(0, b);
  185. }
  186. } else {// 如果没有小数点
  187. if (b == -1) {
  188. a = a + ".";
  189. for (i = 1; i <= num; i++) {
  190. a = a + "0";
  191. }
  192. } else {// 有小数点,超出位数自动截取,否则补0
  193. a = a.substring(0, b + num + 1);
  194. for (i = c; i <= b + num; i++) {
  195. a = a + "0";
  196. }
  197. }
  198. }
  199. return a;
  200. }
  201. </script>
  202. </head>
  203. <body>
  204. <%@ include file="/include/message.jsp"%>
  205. <div class="container">
  206. <div class="default_search" style="margin: 0;">
  207. <ul>
  208. <li class="title"> 供应商名称:</li>
  209. <li class="text">
  210. <input type="text" id="sname" name="sname" value="" />
  211. </li>
  212. </ul>
  213. <ul>
  214. <li class="search-button">
  215. <input type="button" class='l-button'
  216. name="search" onclick="searchByKword()" value="查询"/></li>
  217. </ul>
  218. </div>
  219. <div style="clear:both;"></div>
  220. <div id="searchbar">
  221. <div style="overflow: hidden; clear: both;">
  222. <div id="maingrid4" style="margin: 0; padding: 0"></div>
  223. </div>
  224. </div>
  225. </div>
  226. </body>
  227. </html>