|
- /* * 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架(http://www.learun.cn)
- * Copyright (c) 2013-2020 力软信息技术(苏州)有限公司
- * 创建人:超级管理员
- * 日 期:2021-05-28 14:18
- * 描 述:支出预算管理
- */
- var acceptClick;
- var keyValue = request('keyValue');
- var processId = request('processId');
- // 设置权限
- var setAuthorize;
- // 设置表单数据
- var setFormData;
- // 验证数据是否填写完整
- var validForm;
- // 保存数据
- var save;
- var tableData;
- var processInfo;
- var html = '';
- var processhtml = '';
- var bootstrap = function ($, learun) {
- "use strict";
- var page = {
- init: function () {
- $('.lr-form-wrap').lrscroll();
- page.bind();
- page.initData();
-
- },
- bind: function () {
-
- // 打印
- $('#lr_print').on('click', function () {
- $('#content').jqprint();
-
- });
-
- },
- initData: function () {
- $('#t1').html('');
- page.getTableData(keyValue, function (data) {
- if (data && data.FD_PayManage) {
- tableData = data.FD_PayManage;
- //部门
- var deptName = '';
- learun.clientdata.getAsync('custmerData', {
- url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'classdata',
- key: tableData.PDept,
- keyId: 'id',
- callback: function (_data) {
- deptName = _data['name'];
- }
- });
- //付款方式
- var PPayType = '';
- learun.clientdata.getAsync('dataItem',
- {
- key: tableData.PPayType,
- code: 'fdPayType',
- callback: function (_data) {
- PPayType = _data.text;
- }
- });
-
- //资金支出来源
- var topSource = '';
- learun.clientdata.getAsync('dataItem',
- {
- key: tableData.PTopSource,
- code: 'fdPaySource',
- callback: function (_data) {
- topSource = _data.text;
- }
- });
- //财政专项名称
- var pIncome = '';
- learun.clientdata.getAsync('custmerData', {
- url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'incomeList',
- key: tableData.PIncomeId,
- keyId: 'iid',
- callback: function (_data) {
- pIncome = _data['iname'];
- }
- });
-
- html += '<tr align="center">';
- html += '<td>报销部门</td>';
- html += '<td colspan=4 style="width: 35%;">' + deptName + '</td>';
- html += '<td style="width: 300px;">报销日期</td>';
- html += '<td colspan=2 >' + tableData.PTime + '</td >';
- html += '</tr >';
- html += '<tr align="center">';
- html += '<td>付款方式</td>';
- html += '<td colspan=6>' + PPayType + '</td>';
- html += '</tr>';
- html += '<tr align="center"><td>汇款信息</td><td colspan=3>汇 入 收 款 单 位</td>';
- html += '<td>汇款信息</td><td colspan=2>汇 入 个 人 账 户</td>';
- html += '</tr>';
- html += '<tr align="center">';
- html += '<td>单位名称</td><td colspan=3>' + tableData.PPayee + '</td>';
- html += '<td>收 款 人</td><td colspan=2>' + tableData.PCollectionUser + '</td>';
- html += '</tr>';
- html += '<tr align="center">';
- html += '<td>开户银行</td><td colspan=3>' + tableData.PPayeeBank + '</td>';
- html += '<td>开卡银行</td>';
- html += '<td style="width: 300px;">' + tableData.PCollectionBank1 + '</td><td style="width: 450px;padding:0;margin: 0;">' + tableData.PCollectionBank2 + '</td>';
- html += '</tr>';
- html += '<tr align="center">';
- html += '<td>账 号</td><td colspan=3>' + tableData.PPayeeBankAccount + '</td>';
- html += '<td>卡 号</td><td>' + tableData.PCollectionBankAccount1 + '</td><td>' + tableData.PCollectionBankAccount2 + '</td>';
- html += '</tr>';
-
- html += '<tr>';
- html += '<td align="center" style="width: 250px;">资金支出用途</td><td colspan=6 class="textEm">' + tableData.PPurpose + '</td>';
- html += '</tr>';
- html += '<tr>';
- html += '<td align="center">报销金额</td>';
- html += '<td colspan=4 class="textEm">大写:' + smalltoBIG(tableData.PAmount) + '</td>';
- html += '<td colspan=2 class="textEm">小写¥:' + tableData.PAmount + '</td>';
- html += '</tr>';
- html += '<tr>';
- html += '<td align="center" rowspan="3">报销审批</td>';
- if (tableData.PRemarks == null || tableData.PRemarks == 'null') {
- tableData.PRemarks = '';
- }
- html += '<td colspan=4 class="textEm">补充说明:' + tableData.PRemarks + '</td>';
- html += '<td colspan=2 class="textEm">经 办 人:' + tableData.PUserName + '</td>';
- html += '</tr>';
-
- $('#t1').append(html);
- }
- if (data && data.TaskLogList) {
- processInfo = data.TaskLogList;
- //部门领导
- var bmld = '';
- var bmldyj = '';
- var cwcz = '';
- var cwczyj = '';
- processInfo.forEach((item, index) => {
- if (item && item.F_NodeId) {
- //部门领导
- if (item.F_NodeId == '14c32eaf-9394-4d78-370f-e82e4fc9c73b') {
- bmld = item.F_TaskUserName;
- if (item.F_Des) {
- bmldyj = item.F_Des;
- } else {
- bmldyj = item.F_OperationName;
- }
- }
- //财务处长审核
- if (item.F_NodeId == '0edd8daa-59ce-60f7-9a99-2f9ed7e62db3') {
- cwcz = item.F_TaskUserName;
- if (item.F_Des) {
- cwczyj = item.F_Des;
- } else {
- cwczyj = item.F_OperationName;
- }
- }
- }
- });
-
-
- processhtml += '<tr>';
- processhtml += '<td colspan=4 class="textEm">审核意见:' + bmldyj + '</td>';
- processhtml += '<td colspan=2 class="textEm">部门领导:' + bmld + '</td>';
- processhtml += '</tr>';
-
- processhtml += '<tr>';
- processhtml += '<td colspan=4 class="textEm">支付意见:' + cwczyj + '</td>';
- processhtml += '<td colspan=2 class="textEm">财务处长:' + cwcz + '</td>';
- processhtml += '</tr>';
-
- processhtml += '<tr>';
- processhtml += '<td rowspan="2" align="center">所附单据:</td>';
- processhtml += '<td colspan=6 class="list"><span>1.申请 份</span><span>2.发票 张</span><span>3.真伪查验 张</span><span>4.入库单 张</span><span>5.资产验收单 张</span>';
- processhtml += '</td></tr>';
-
- processhtml += '<tr>';
- processhtml += '<td colspan=6 class="list" class="textEm">';
- processhtml += '<span>6.差旅费保修单 张</span><span>7.其他 张</span>';
- processhtml += '</td></tr>';
- processhtml += '<tr>';
- processhtml += '<td align="center">资金支付</td>';
- processhtml += '<td colspan=4 style="border-right:0;width: 30%;" class="textEm"><span>出纳:</span></td>';
- processhtml += '<td colspan=2 style="border-left:0 ;"><span>复核:</span></td>';
- processhtml += '</tr>';
-
- $('#t1').append(processhtml);
- }
- });
-
- },
- getTableData: function (keyValue, callback) {
- learun.httpAsync('GET', top.$.rootUrl + '/ReceiveSendFeeManagement/FD_PayManage/GetPrintData', { keyValue: keyValue, processId: processId }, function (data) {
- callback && callback(data);
- });
- }
- };
- // 设置表单数据
- setFormData = function (processId, param, callback) {
-
- callback && callback();
- }
- // 验证数据是否填写完整
- validForm = function () {
- if (!$('body').lrValidform()) {
- return false;
- }
- return true;
- };
- // 保存数据
- save = function (processId, callBack, i) {
-
- };
-
- page.init();
- function smalltoBIG(n) {
- var fraction = ['角', '分'];
- var digit = ['零', '壹', '贰', '叁', '肆', '伍', '陆', '柒', '捌', '玖'];
- var unit = [
- ['元', '万', '亿'],
- ['', '拾', '佰', '仟']
- ];
- var head = n < 0 ? '欠' : '';
- n = Math.abs(n);
-
- var s = '';
-
- for (var i = 0; i < fraction.length; i++) {
- s += (digit[Math.floor(n * 10 * Math.pow(10, i)) % 10] + fraction[i]).replace(/零./, '');
- }
- s = s || '整';
- n = Math.floor(n);
-
- for (var i = 0; i < unit[0].length && n > 0; i++) {
- var p = '';
- for (var j = 0; j < unit[1].length && n > 0; j++) {
- p = digit[n % 10] + unit[1][j] + p;
- n = Math.floor(n / 10);
- }
- s = p.replace(/(零.)*零$/, '').replace(/^$/, '零') + unit[0][i] + s;
- }
- return head + s.replace(/(零.)*零元/, '元').replace(/(零.)+/g, '零').replace(/^整$/, '零元整');
- }
- }
|