pay_view.jsp 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508
  1. <%@ page language="java" contentType="text/html;charset=GBK" pageEncoding="GBK"%>
  2. <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
  3. <%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
  4. <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
  5. <html>
  6. <head>
  7. <meta http-equiv="Content-Type" content="text/html;charset=GBK">
  8. <title>新增付款申请</title>
  9. <link href="${pageContext.request.contextPath }/main.css" rel="stylesheet" type="text/css" />
  10. <link href="${pageContext.request.contextPath }/liger/lib/ligerUI/skins/${sessionScope.css}/css/ligerui-all.css" rel="stylesheet" type="text/css" />
  11. <script src="${pageContext.request.contextPath }/liger/lib/jquery/jquery-1.3.2.min.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/file.js"></script>
  15. <script src="${pageContext.request.contextPath }/liger/lib/ligerUI/js/core/base.js" type="text/javascript"></script>
  16. <script src="${pageContext.request.contextPath }/liger/lib/ligerUI/js/plugins/ligerDateEditor.js" type="text/javascript"></script>
  17. <script src="/shares/xheditor/xheditor-1.1.14/xheditor-1.1.14-zh-cn.min.js" type="text/javascript" ></script>
  18. <!-- 选择窗口需要加载的js文件 start-->
  19. <script src="${pageContext.request.contextPath}/liger/lib/json2.js" type="text/javascript"></script>
  20. <script src="${pageContext.request.contextPath}/liger/lib/ligerUI/js/plugins/ligerDialog.js" type="text/javascript"></script>
  21. <script src="${pageContext.request.contextPath}/liger/lib/ligerUI/js/plugins/ligerGrid.js" type="text/javascript"></script>
  22. <!-- -->
  23. <script src="${pageContext.request.contextPath}/liger/lib/ligerUI/js/plugins/ligerTextBox.js" type="text/javascript"></script>
  24. <script src="${pageContext.request.contextPath}/liger/lib/ligerUI/js/plugins/ligerCheckBox.js" type="text/javascript"></script>
  25. <script src="${pageContext.request.contextPath}/liger/lib/ligerUI/js/plugins/ligerComboBox.js" type="text/javascript"></script>
  26. <script src="${pageContext.request.contextPath}/liger/lib/ligerUI/js/plugins/ligerSpinner.js" type="text/javascript"></script>
  27. <script type="text/javascript" src="${pageContext.request.contextPath}/liger/lib/ligerUI/js/ligerui.all.js"></script>
  28. <script type="text/javascript">
  29. $(function(){
  30. f_initToGrid();
  31. f_initPurchaseGrid();
  32. var is_spare="${map.is_spare}";
  33. if(is_spare==1){
  34. $("#spare_money_tr").show();
  35. $("#spare_money_id_select").show();
  36. $("#spare_money_id_link").show();
  37. }
  38. var project_name="${map.project_name}";
  39. if(project_name !=null && project_name !=""){
  40. var project_id="${map.project_id}";
  41. if(project_id !=null && project_id !=""){
  42. $.ajax({
  43. url:"fmChooseProjectAction.do?method=getProjectMoney&project_id=${map.project_id}&time="+new Date().getTime(),
  44. type:"post",
  45. dataType:"json",
  46. success:function(data){
  47. var obj=data[0];
  48. call_project("${map.project_id}",obj.subtotal,obj.petty_cash);
  49. }
  50. });
  51. }
  52. }
  53. });
  54. var pay_grid=null;
  55. function f_initToGrid() {
  56. var columns=[
  57. { display: '摘要', name: 'digest', type: 'text',isSort: false,width:200,editor: { type: 'text' },
  58. totalSummary:
  59. {
  60. type: 'sum',
  61. render: function (e) {
  62. return "<div>" + ' 合计' + "</div>";
  63. }
  64. }},
  65. { display: '开支类别', name: 'subject_name', type: 'text',isSort: false,width:100,editor: { type: 'text' }},
  66. { display: '附单据(张)', name: 'invoice', type: 'int',isSort: false,width:200,editor:{type:"int"},
  67. totalSummary:
  68. {
  69. type: 'sum',
  70. render: function (e) {
  71. var sum = parseFloat(e.sum);
  72. return "<div>" + formatnumber(sum,2) + "</div>";
  73. }
  74. }
  75. },
  76. { display: '金额(¥)', name: 'item_money', type: 'float',isSort: false,width:200,editor: { type: 'float' },
  77. totalSummary:
  78. {
  79. type: 'sum',
  80. render: function (e) {
  81. var sum = parseFloat(e.sum);
  82. return "<div>" + formatnumber(sum,2) + "</div>";
  83. }
  84. }
  85. },
  86. { display: '备注', name: 'remark', type: 'text',isSort: false,width:200,editor: { type: 'text' }}
  87. ];
  88. if("${map.payment_type}"=="2"){
  89. columns.push({ display: '操作', width:150,render:function(item,rowindex){
  90. var h="";
  91. h += "<a href='javascript:open_pay()'>采购清单</a> ";
  92. return h;
  93. }});
  94. }
  95. pay_grid = $("#pay_grid").ligerGrid({
  96. columns:columns ,
  97. url:"expenditureStatementAction.do?task=pay_detail_page&expend_sta_id=${map.universalid}&time="+new Date().getTime(),
  98. usePager: false,
  99. enabledEdit: true,
  100. clickToEdit:false,
  101. rownumbers:true,
  102. rowDraggable:true,
  103. width :'99%',
  104. height : '300'
  105. });
  106. }
  107. var purchase_grid;
  108. function f_initPurchaseGrid() {
  109. purchase_grid = $("#pay_div").ligerGrid({
  110. columns:
  111. [
  112. { display: '应付账款ID', name: 'account_pay_id', type: 'text',isSort: false, hide: true,width:5},
  113. { display: '产品ID', name: 'product_id', type: 'text',isSort: false, hide: true,width:5},
  114. { display: '供应商ID', name: 'supplier_id', type: 'text',isSort: false, hide: true,width:5},
  115. { display: '请购明细ID', name: 'request_detail_id', type: 'text',isSort: false, hide: true,width:5},
  116. { display: '项目采购清单ID', name: 'project_buy_id', type: 'text',isSort: false, hide: true,width:5},
  117. { display: '采购单ID', name: 'purchase_id',type:'text',isSort:false, hide: true,width:5},
  118. { display: '采购单明细ID', name: 'purchase_detail_id', type: 'text',isSort: false, hide: true,width:5},
  119. { display: '采购单号', name: 'purchase_number',type:'text',isSort:false,hide: true,width:5},
  120. { display: '存货编码', name: 'product_num',type:'text',isSort:false,width:100},
  121. { display: '存货名称', name: 'product_name',type:'text',isSort:false,width:100},
  122. { display: '规格型号', name: 'product_model_standard',type:'text',isSort:false,width:150},
  123. { display: '单位', name: 'product_unit_name',type:'text',isSort:false,width:60},
  124. { display: '单价', name: 'purchase_product_sell_price',type:'float',isSort:false,width:100},
  125. { display: '本次付款数', name: 'pay_num',type:'text',isSort:false,width:100},
  126. { display: '本次付款金额', name: 'pay_amount',type:'text',isSort:false,width:100
  127. }
  128. ],
  129. url:"expenditureStatementAction.do?task=paySubDetail&sta_id=${map.universalid}&time="+new Date().getTime(),
  130. width :'99.8%',
  131. usePager: false,
  132. height : '95%'
  133. });
  134. }
  135. function openSpare(){
  136. var project_id=$("#project_id").val();
  137. if(project_id =="" || project_id==null){
  138. $.ligerDialog.warn("请先选择项目!");
  139. return ;
  140. }
  141. var url="${pageContext.request.contextPath}/expenditureStatementAction.do?task=toChooseStatement&expendType=3&project_id="+project_id+"&spare_where=alllist";
  142. openODialog(url,"查看备用金历史记录");
  143. }
  144. function openPay(){
  145. var project_id=$("#project_id").val();
  146. if(project_id =="" || project_id==null){
  147. $.ligerDialog.warn("请先选择项目!");
  148. return ;
  149. }
  150. var url="${pageContext.request.contextPath}/expenditureStatementAction.do?task=topayStatement&project_id="+project_id;
  151. oDialog = openTopDialog({
  152. height : $("body", window.top.document).height() - 150,
  153. width : $("body", window.top.document).width() - 650,
  154. url : url,
  155. showMax : false,
  156. showToggle : false,
  157. showMin : false,
  158. isResize : false,
  159. modal : false,
  160. title : "查看付款历史",
  161. allowClose : true
  162. });
  163. }
  164. function openODialog(owurl, name) {
  165. oDialog = openTopDialog({
  166. height : $("body", window.top.document).height() - 50,
  167. width : $("body", window.top.document).width() - 50,
  168. url : owurl,
  169. showMax : false,
  170. showToggle : false,
  171. showMin : false,
  172. isResize : false,
  173. modal : false,
  174. title : name,
  175. allowClose : true
  176. });
  177. }
  178. function closeODialog() {
  179. oDialog.close();
  180. }
  181. function call_project(project_id,subtotal,petty_cash){
  182. var total_money=0; //项目预算总金额或备用金总金额
  183. if("${expendType}"=="1"){//付款申请
  184. total_money=subtotal;
  185. }else if("${expendType}"=="3"){//备用金
  186. total_money=petty_cash;
  187. }
  188. $.ajax({
  189. type:"post",
  190. url:"expenditureStatementAction.do?task=query_project_money&expendType=${expendType}&project_id="+project_id+"&time="+new Date().getTime(),
  191. dataType:"json",
  192. success:function(data){
  193. $("tr[id='project_relation']").show();
  194. var alreay_expend_money=0; //已支出金额
  195. if(data[0].total_money ){
  196. alreay_expend_money=parseInt(data[0].total_money); //已支出金额
  197. }
  198. var expend_surplusr_money=total_money-alreay_expend_money; //未支出金额
  199. $("#project_amount_value").html(total_money);
  200. $("#alreay_expend_money_value").html(alreay_expend_money);
  201. $("#expend_surplusr_money_value").html(expend_surplusr_money);
  202. $("#alreay_expend_money").val(alreay_expend_money);
  203. $("#expend_surplusr_money").val(expend_surplusr_money);
  204. $("#spare_money_id").val("");
  205. $("#spare_money").val("");
  206. $("#spare_money_number").val("");
  207. },
  208. error:function(){
  209. $.ligerDialog.error("网络异常,请联系管理理员!");
  210. }
  211. });
  212. }
  213. //格式化小数点
  214. function formatnumber(value, num) {
  215. var a, b, c, i;
  216. a = value.toString();
  217. b = a.indexOf(".");
  218. c = a.length;
  219. if (num == 0) {
  220. if (b != -1) {
  221. a = a.substring(0, b);
  222. }
  223. } else {// 如果没有小数点
  224. if (b == -1) {
  225. a = a + ".";
  226. for (i = 1; i <= num; i++) {
  227. a = a + "0";
  228. }
  229. } else {// 有小数点,超出位数自动截取,否则补0
  230. a = a.substring(0, b + num + 1);
  231. for (i = c; i <= b + num; i++) {
  232. a = a + "0";
  233. }
  234. }
  235. }
  236. return a;
  237. }
  238. var pay_dialog;
  239. function open_pay(){
  240. pay_dialog=$.ligerDialog.open({height: 350,width:800, target: $("#pay_div"),title:"采购清单",
  241. buttons:[{
  242. text : '关闭',
  243. onclick : function(item, dialog) {
  244. dialog.hidden();
  245. }
  246. }]
  247. });
  248. }
  249. </script>
  250. </head>
  251. <body>
  252. <div class="forum-container" >
  253. <input type="hidden" name="project_id" id="project_id" value="${map.project_id }"/>
  254. <center>
  255. <table class="l-table-edit line">
  256. <c:choose>
  257. <c:when test="${expendType==1 }">
  258. <tr>
  259. <th colspan="4">付款申请单信息</th>
  260. </tr>
  261. <tr>
  262. <td class="l-table-edit-text" width="15%">项目名称:</td>
  263. <td class="l-table-edit-td" width="35%">
  264. ${map.project_name }
  265. </td>
  266. <td class="l-table-edit-text" width="15%">付款单号:</td>
  267. <td class="l-table-edit-td" width="35%">
  268. ${map.expend_sta_number}
  269. </td>
  270. </tr>
  271. <tr>
  272. <td class="l-table-edit-text" width="15%">付款类型:</td>
  273. <td class="l-table-edit-td" width="35%">
  274. <c:forEach items="${payment_type_list}" var="item">
  275. <c:if test="${map.payment_type==item.dvalue }">
  276. ${item.dname}
  277. </c:if>
  278. </c:forEach>
  279. </td>
  280. <td class="l-table-edit-text" width="15%">是否到票:</td>
  281. <td class="l-table-edit-td" width="35%">
  282. <c:forEach items="${isBillList}" var="item">
  283. <c:if test="${map.is_bill==item.dvalue }">
  284. ${item.dname}
  285. </c:if>
  286. </c:forEach>
  287. </td>
  288. </tr>
  289. </c:when>
  290. <c:when test="${expendType==2 }">
  291. <tr>
  292. <th colspan="4">费用报销信息</th>
  293. </tr>
  294. <tr>
  295. <td class="l-table-edit-text" width="15%">项目名称:</td>
  296. <td class="l-table-edit-td" width="35%">
  297. ${map.project_name }
  298. </td>
  299. <td class="l-table-edit-text" width="15%">费用报销单号:</td>
  300. <td class="l-table-edit-td" width="35%">
  301. ${map.expend_sta_number}
  302. </td>
  303. </tr>
  304. </c:when>
  305. <c:when test="${expendType==3 }">
  306. <tr>
  307. <th colspan="4">备用金信息</th>
  308. </tr>
  309. <tr>
  310. <td class="l-table-edit-text" width="15%">项目名称:</td>
  311. <td class="l-table-edit-td" width="35%">
  312. ${map.project_name }
  313. </td>
  314. <td class="l-table-edit-text" width="15%">备用金单号:</td>
  315. <td class="l-table-edit-td" width="35%">
  316. ${map.expend_sta_number}
  317. </td>
  318. </tr>
  319. </c:when>
  320. <c:when test="${expendType==4 }">
  321. <tr>
  322. <th colspan="4">其他往来付款信息</th>
  323. </tr>
  324. <tr>
  325. <td class="l-table-edit-text" width="15%">其它付款单号:</td>
  326. <td class="l-table-edit-td" width="90%" colspan="3">
  327. ${map.expend_sta_number}
  328. </td>
  329. </tr>
  330. </c:when>
  331. </c:choose>
  332. <tr>
  333. <td colspan="4" height="300">
  334. <!-- 明细 start -->
  335. <div class="l-clear"></div>
  336. <div id="pay_grid" style="margin: 0; padding: 0"></div><br />
  337. <div style="display:none;"></div>
  338. <!-- 明细 end -->
  339. </td>
  340. </tr>
  341. <c:if test="${(expendType==1 || expendType==2) && map.is_spare==1 }">
  342. <tr id="spare_money_tr" style="display:none">
  343. <td class="l-table-edit-text" colspan="4">
  344. <span style="display:none" id="spare_money_id_select" >冲账备用金单号:
  345. ${map.spare_money_number }
  346. </span>
  347. <span style="margin-left:80px;display:none" id="spare_money_id_link"><a href="#" onclick="openSpare()">查看备用金历史</a></span>
  348. </tr>
  349. </c:if>
  350. <c:if test="${expendType==1 }">
  351. <tr id="project_relation" style="display:none">
  352. <td class="l-table-edit-text" colspan="4">
  353. <span id="project_amount_span" >预算总金额:<font id="project_amount_value">0</font></span>
  354. <span id="alreay_expend_money_span" style="margin-left:80px;">已付款金额:<font id="alreay_expend_money_value">${map.alreay_expend_money }</font></span>
  355. <span id="expend_surplusr_money_span" style="margin-left:80px;">付款结余金额:<font id="expend_surplusr_money_value">${map.expend_surplusr_money }</font></span>
  356. <span id="pay_history" style="margin-left:80px;"><a href="#" onclick="openPay();">查看付款历史</a></span>
  357. </td>
  358. </tr>
  359. </c:if>
  360. <c:if test="${expendType==2 }">
  361. <tr id="project_relation" style="display:none">
  362. <td class="l-table-edit-text" colspan="4">
  363. <span id="project_amount_span" >预算可领用金额:<font id="project_amount_value"></font></span>
  364. <span id="alreay_expend_money_span" style="margin-left:80px;">已领用金额:<font id="alreay_expend_money_value">${map.alreay_expend_money }</font></span>
  365. <span id="expend_surplusr_money_span" style="margin-left:80px;">预算结余金额:<font id="expend_surplusr_money_value">${map.expend_surplusr_money }</font></span>
  366. <span id="pay_history" style="margin-left:80px;display:none"><a href="#" onclick="openPay();">查看付款历史</a></span>
  367. </td>
  368. </tr>
  369. </c:if>
  370. <c:if test="${expendType==3 }">
  371. <tr id="project_relation" style="display:none" >
  372. <td class="l-table-edit-text" width="15%">预算备用金总金额:</td>
  373. <td class="l-table-edit-td" width="35%">
  374. <span id="project_amount_value"></span>
  375. </td>
  376. <td class="l-table-edit-text" width="15%">备用金已领用金额:</td>
  377. <td class="l-table-edit-td" width="35%">
  378. <span id="alreay_expend_money_value">${map.alreay_expend_money}</span>
  379. </td>
  380. </tr>
  381. <tr id="project_relation1" style="display:none" >
  382. <td class="l-table-edit-text" width="15%">备用金结余金额:</td>
  383. <td class="l-table-edit-td" width="35%">
  384. <span id="expend_surplusr_money_value">${map.expend_surplusr_money }</span>
  385. </td>
  386. <td class="l-table-edit-text" width="15%">预计还款日期:</td>
  387. <td class="l-table-edit-td" width="35%">
  388. <fmt:formatDate value="${map.return_date }" pattern="yyyy-MM-dd"/>
  389. </td>
  390. </tr>
  391. </c:if>
  392. <c:if test="${expendType==1 || expendType==3 || expendType==4}">
  393. <tr>
  394. <td class="l-table-edit-text" width="15%">收款户名:</td>
  395. <td class="l-table-edit-td" width="35%">
  396. ${map.receipt_account }
  397. </td>
  398. <td class="l-table-edit-text" width="15%">开户银行:</td>
  399. <td class="l-table-edit-td" width="35%">
  400. ${map.receipt_bank }
  401. </td>
  402. </tr>
  403. <tr>
  404. <td class="l-table-edit-text" width="15%">银行帐号:</td>
  405. <td class="l-table-edit-td" width="90%" colspan="3">
  406. ${map.receipt_bank_account }
  407. </td>
  408. </tr>
  409. </c:if>
  410. <c:if test="${expendType==1 || expendType==4 }">
  411. <tr>
  412. <td class="l-table-edit-text" width="15%">附件:</td>
  413. <td class="l-table-edit-td" width="90%" colspan="3">
  414. <jsp:include page="/include/file.jsp">
  415. <jsp:param name="fieldName" value="files" />
  416. <jsp:param name="folder" value="fm/statement" />
  417. <jsp:param name="documentId" value="${map.doc_ids }" />
  418. <jsp:param name="size" value="${doc_ids_lenth }" />
  419. <jsp:param name="isView" value="1" />
  420. <jsp:param name="definedCss" value="file-style" />
  421. </jsp:include>
  422. </td>
  423. </tr>
  424. </c:if>
  425. <tr>
  426. <td class="l-table-edit-text" width="15%">申请人:</td>
  427. <td class="l-table-edit-td" width="35%">
  428. ${map.create_user_name }
  429. </td>
  430. <td class="l-table-edit-text" width="15%">申请日期:</td>
  431. <td class="l-table-edit-td" width="35%">
  432. <fmt:formatDate value="${map.create_date }" pattern="yyyy-MM-dd"/>
  433. </td>
  434. </tr>
  435. <tr>
  436. <td class="l-table-edit-text" width="20%">付款凭证:</td>
  437. <td class="l-table-edit-td" width="30%" >
  438. <jsp:include page="/include/file.jsp">
  439. <jsp:param name="fieldName" value="files" />
  440. <jsp:param name="folder" value="fm/statement" />
  441. <jsp:param name="documentId" value="${map.pay_proof }" />
  442. <jsp:param name="size" value="${pay_proof_lenth }" />
  443. <jsp:param name="isView" value="1" />
  444. <jsp:param name="definedCss" value="file-style" />
  445. </jsp:include>
  446. </td>
  447. <td class="l-table-edit-text" width="20%">银行流水单号:</td>
  448. <td class="l-table-edit-td" width="30%" >
  449. ${map.bank_number }
  450. </td>
  451. </tr>
  452. <tr>
  453. <td class="l-table-edit-text" width="15%">付款户名:</td>
  454. <td class="l-table-edit-td" width="35%" >
  455. ${map.pay_account_name }
  456. </td>
  457. <td class="l-table-edit-text" width="20%">付款开户银行:</td>
  458. <td class="l-table-edit-td" width="30%">
  459. ${map.pay_bank_name }
  460. </td>
  461. </tr>
  462. <tr>
  463. <td class="l-table-edit-text" width="20%">付款银行账号:</td>
  464. <td class="l-table-edit-td" width="80%" colspan="3">
  465. ${map.pay_bank_account_name }
  466. </td>
  467. </tr>
  468. <tr>
  469. <td class="l-table-edit-text" width="20%">付款人:</td>
  470. <td class="l-table-edit-td" width="30%">
  471. ${map.pay_people }
  472. </td>
  473. <td class="l-table-edit-text" width="15%">付款日期:</td>
  474. <td class="l-table-edit-td" width="35%">
  475. <fmt:formatDate value="${map.pay_date }" pattern="yyyy-MM-dd"/>
  476. </td>
  477. </tr>
  478. <tr>
  479. <td class="l-table-edit-text" width="20%"></td>
  480. <td class="l-table-edit-td" width="30%">
  481. </td>
  482. <td class="l-table-edit-text" width="20%"></td>
  483. <td class="l-table-edit-td" width="30%">
  484. </td>
  485. </tr>
  486. </table>
  487. </center>
  488. <div class="l-clear"></div>
  489. <div id="pay_div" style="margin-top:0px;display:none"></div><br />
  490. <div style="display:none;"></div>
  491. </div>
  492. <%@ include file="/include/message.jsp"%>
  493. </body>
  494. </html>