You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

247 lines
11 KiB

  1. /* * 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架(http://www.learun.cn)
  2. * Copyright (c) 2013-2020 力软信息技术(苏州)有限公司
  3. * 创建人:超级管理员
  4. * 日 期:2021-05-28 14:18
  5. * 描 述:支出预算管理
  6. */
  7. var acceptClick;
  8. var keyValue = request('keyValue');
  9. var processId = request('processId');
  10. // 设置权限
  11. var setAuthorize;
  12. // 设置表单数据
  13. var setFormData;
  14. // 验证数据是否填写完整
  15. var validForm;
  16. // 保存数据
  17. var save;
  18. var tableData;
  19. var processInfo;
  20. var html = '';
  21. var processhtml = '';
  22. var bootstrap = function ($, learun) {
  23. "use strict";
  24. var page = {
  25. init: function () {
  26. $('.lr-form-wrap').lrscroll();
  27. page.bind();
  28. page.initData();
  29. },
  30. bind: function () {
  31. // 打印
  32. $('#lr_print').on('click', function () {
  33. $('#content').jqprint();
  34. });
  35. },
  36. initData: function () {
  37. $('#t1').html('');
  38. page.getTableData(keyValue, function (data) {
  39. if (data && data.FD_PayManage) {
  40. tableData = data.FD_PayManage;
  41. //部门
  42. var deptName = '';
  43. learun.clientdata.getAsync('custmerData', {
  44. url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'classdata',
  45. key: tableData.PDept,
  46. keyId: 'id',
  47. callback: function (_data) {
  48. deptName = _data['name'];
  49. }
  50. });
  51. //付款方式
  52. var PPayType = '';
  53. learun.clientdata.getAsync('dataItem',
  54. {
  55. key: tableData.PPayType,
  56. code: 'fdPayType',
  57. callback: function (_data) {
  58. PPayType = _data.text;
  59. }
  60. });
  61. //资金支出来源
  62. var topSource = '';
  63. learun.clientdata.getAsync('dataItem',
  64. {
  65. key: tableData.PTopSource,
  66. code: 'fdPaySource',
  67. callback: function (_data) {
  68. topSource = _data.text;
  69. }
  70. });
  71. //财政专项名称
  72. var pIncome = '';
  73. learun.clientdata.getAsync('custmerData', {
  74. url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'incomeList',
  75. key: tableData.PIncomeId,
  76. keyId: 'iid',
  77. callback: function (_data) {
  78. pIncome = _data['iname'];
  79. }
  80. });
  81. html += '<tr align="center">';
  82. html += '<td>报销部门</td>';
  83. html += '<td colspan=4 style="width: 35%;">' + deptName + '</td>';
  84. html += '<td style="width: 300px;">报销日期</td>';
  85. html += '<td colspan=2 >' + tableData.PTime + '</td >';
  86. html += '</tr >';
  87. html += '<tr align="center">';
  88. html += '<td>付款方式</td>';
  89. html += '<td colspan=6>' + PPayType + '</td>';
  90. html += '</tr>';
  91. html += '<tr align="center"><td>汇款信息</td><td colspan=3>汇 入 收 款 单 位</td>';
  92. html += '<td>汇款信息</td><td colspan=2>汇 入 个 人 账 户</td>';
  93. html += '</tr>';
  94. html += '<tr align="center">';
  95. html += '<td>单位名称</td><td colspan=3>' + tableData.PPayee + '</td>';
  96. html += '<td>收 款 人</td><td colspan=2>' + tableData.PCollectionUser + '</td>';
  97. html += '</tr>';
  98. html += '<tr align="center">';
  99. html += '<td>开户银行</td><td colspan=3>' + tableData.PPayeeBank + '</td>';
  100. html += '<td>开卡银行</td>';
  101. html += '<td style="width: 300px;">' + tableData.PCollectionBank1 + '</td><td style="width: 450px;padding:0;margin: 0;">' + tableData.PCollectionBank2 + '</td>';
  102. html += '</tr>';
  103. html += '<tr align="center">';
  104. html += '<td>账&nbsp;&nbsp;&nbsp;&nbsp;号</td><td colspan=3>' + tableData.PPayeeBankAccount + '</td>';
  105. html += '<td>卡&nbsp;&nbsp;&nbsp;&nbsp;号</td><td>' + tableData.PCollectionBankAccount1 + '</td><td>' + tableData.PCollectionBankAccount2 + '</td>';
  106. html += '</tr>';
  107. html += '<tr>';
  108. html += '<td align="center" style="width: 250px;">资金支出用途</td><td colspan=6 class="textEm">' + tableData.PPurpose + '</td>';
  109. html += '</tr>';
  110. html += '<tr>';
  111. html += '<td align="center">报销金额</td>';
  112. html += '<td colspan=4 class="textEm">大写:' + smalltoBIG(tableData.PAmount) + '</td>';
  113. html += '<td colspan=2 class="textEm">小写¥:' + tableData.PAmount + '</td>';
  114. html += '</tr>';
  115. html += '<tr>';
  116. html += '<td align="center" rowspan="3">报销审批</td>';
  117. if (tableData.PRemarks == null || tableData.PRemarks == 'null') {
  118. tableData.PRemarks = '';
  119. }
  120. html += '<td colspan=4 class="textEm">补充说明:' + tableData.PRemarks + '</td>';
  121. html += '<td colspan=2 class="textEm">经 办 人:' + tableData.PUserName + '</td>';
  122. html += '</tr>';
  123. $('#t1').append(html);
  124. }
  125. if (data && data.TaskLogList) {
  126. processInfo = data.TaskLogList;
  127. //部门领导
  128. var bmld = '';
  129. var bmldyj = '';
  130. var cwcz = '';
  131. var cwczyj = '';
  132. processInfo.forEach((item, index) => {
  133. if (item && item.F_NodeId) {
  134. //部门领导
  135. if (item.F_NodeId == '14c32eaf-9394-4d78-370f-e82e4fc9c73b') {
  136. bmld = item.F_TaskUserName;
  137. if (item.F_Des) {
  138. bmldyj = item.F_Des;
  139. } else {
  140. bmldyj = item.F_OperationName;
  141. }
  142. }
  143. //财务处长审核
  144. if (item.F_NodeId == '0edd8daa-59ce-60f7-9a99-2f9ed7e62db3') {
  145. cwcz = item.F_TaskUserName;
  146. if (item.F_Des) {
  147. cwczyj = item.F_Des;
  148. } else {
  149. cwczyj = item.F_OperationName;
  150. }
  151. }
  152. }
  153. });
  154. processhtml += '<tr>';
  155. processhtml += '<td colspan=4 class="textEm">审核意见:' + bmldyj + '</td>';
  156. processhtml += '<td colspan=2 class="textEm">部门领导:' + bmld + '</td>';
  157. processhtml += '</tr>';
  158. processhtml += '<tr>';
  159. processhtml += '<td colspan=4 class="textEm">支付意见:' + cwczyj + '</td>';
  160. processhtml += '<td colspan=2 class="textEm">财务处长:' + cwcz + '</td>';
  161. processhtml += '</tr>';
  162. processhtml += '<tr>';
  163. processhtml += '<td rowspan="2" align="center">所附单据:</td>';
  164. processhtml += '<td colspan=6 class="list"><span>1.申请 &nbsp;&nbsp;份</span><span>2.发票 &nbsp;&nbsp;张</span><span>3.真伪查验 &nbsp;&nbsp; 张</span><span>4.入库单 &nbsp;&nbsp;张</span><span>5.资产验收单&nbsp;&nbsp; 张</span>';
  165. processhtml += '</td></tr>';
  166. processhtml += '<tr>';
  167. processhtml += '<td colspan=6 class="list" class="textEm">';
  168. processhtml += '<span>6.差旅费保修单 &nbsp;&nbsp; 张</span><span>7.其他 &nbsp;&nbsp; 张</span>';
  169. processhtml += '</td></tr>';
  170. processhtml += '<tr>';
  171. processhtml += '<td align="center">资金支付</td>';
  172. processhtml += '<td colspan=4 style="border-right:0;width: 30%;" class="textEm"><span>出纳:</span></td>';
  173. processhtml += '<td colspan=2 style="border-left:0 ;"><span>复核:</span></td>';
  174. processhtml += '</tr>';
  175. $('#t1').append(processhtml);
  176. }
  177. });
  178. },
  179. getTableData: function (keyValue, callback) {
  180. learun.httpAsync('GET', top.$.rootUrl + '/ReceiveSendFeeManagement/FD_PayManage/GetPrintData', { keyValue: keyValue, processId: processId }, function (data) {
  181. callback && callback(data);
  182. });
  183. }
  184. };
  185. // 设置表单数据
  186. setFormData = function (processId, param, callback) {
  187. callback && callback();
  188. }
  189. // 验证数据是否填写完整
  190. validForm = function () {
  191. if (!$('body').lrValidform()) {
  192. return false;
  193. }
  194. return true;
  195. };
  196. // 保存数据
  197. save = function (processId, callBack, i) {
  198. };
  199. page.init();
  200. function smalltoBIG(n) {
  201. var fraction = ['角', '分'];
  202. var digit = ['零', '壹', '贰', '叁', '肆', '伍', '陆', '柒', '捌', '玖'];
  203. var unit = [
  204. ['元', '万', '亿'],
  205. ['', '拾', '佰', '仟']
  206. ];
  207. var head = n < 0 ? '欠' : '';
  208. n = Math.abs(n);
  209. var s = '';
  210. for (var i = 0; i < fraction.length; i++) {
  211. s += (digit[Math.floor(n * 10 * Math.pow(10, i)) % 10] + fraction[i]).replace(/零./, '');
  212. }
  213. s = s || '整';
  214. n = Math.floor(n);
  215. for (var i = 0; i < unit[0].length && n > 0; i++) {
  216. var p = '';
  217. for (var j = 0; j < unit[1].length && n > 0; j++) {
  218. p = digit[n % 10] + unit[1][j] + p;
  219. n = Math.floor(n / 10);
  220. }
  221. s = p.replace(/(零.)*零$/, '').replace(/^$/, '零') + unit[0][i] + s;
  222. }
  223. return head + s.replace(/(零.)*零元/, '元').replace(/(零.)+/g, '零').replace(/^整$/, '零元整');
  224. }
  225. }