From 16849e724a55d5992419383794049604079cdbd8 Mon Sep 17 00:00:00 2001 From: java110 <928255095@qq.com> Date: Sat, 13 Mar 2021 18:12:52 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8A=A0=E5=85=A5=E5=B0=8F=E7=A5=A8=E6=89=93?= =?UTF-8?q?=E5=8D=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../simplifyFeeReceipt.html | 4 + .../simplifyFeeReceipt/simplifyFeeReceipt.js | 15 ++ .../printSmallPayFee/printSmallPayFee.html | 37 +++++ .../printSmallPayFee/printSmallPayFee.js | 149 ++++++++++++++++++ public/smallPrint.html | 18 +++ 5 files changed, 223 insertions(+) create mode 100644 public/pages/property/printSmallPayFee/printSmallPayFee.html create mode 100644 public/pages/property/printSmallPayFee/printSmallPayFee.js create mode 100644 public/smallPrint.html diff --git a/public/components/property/simplifyFeeReceipt/simplifyFeeReceipt.html b/public/components/property/simplifyFeeReceipt/simplifyFeeReceipt.html index fb52d13df..ebdefa07f 100644 --- a/public/components/property/simplifyFeeReceipt/simplifyFeeReceipt.html +++ b/public/components/property/simplifyFeeReceipt/simplifyFeeReceipt.html @@ -21,6 +21,10 @@ v-on:click="_printFeeReceipt()"> 打印 +
diff --git a/public/components/property/simplifyFeeReceipt/simplifyFeeReceipt.js b/public/components/property/simplifyFeeReceipt/simplifyFeeReceipt.js index 496d5568b..b9b9e53db 100644 --- a/public/components/property/simplifyFeeReceipt/simplifyFeeReceipt.js +++ b/public/components/property/simplifyFeeReceipt/simplifyFeeReceipt.js @@ -108,6 +108,21 @@ } window.open("/print.html#/pages/property/printPayFee?receiptIds=" + receiptids); }, + + _printFeeSmallReceipt:function(){ + if ($that.simplifyFeeReceiptInfo.selectReceipts.length < 1) { + vc.toast('请选择打印收据'); + return; + } + let receiptids = ''; + $that.simplifyFeeReceiptInfo.selectReceipts.forEach(item => { + receiptids += (item + ','); + }) + if (receiptids.endsWith(',')) { + receiptids = receiptids.substring(0, receiptids.length - 1); + } + window.open("/smallPrint.html#/pages/property/printSmallPayFee?receiptIds=" + receiptids); + }, clearSimplifyFeeReceiptInfo: function () { $that.simplifyFeeReceiptInfo = { feeReceipts: [], diff --git a/public/pages/property/printSmallPayFee/printSmallPayFee.html b/public/pages/property/printSmallPayFee/printSmallPayFee.html new file mode 100644 index 000000000..3e4dcb74e --- /dev/null +++ b/public/pages/property/printSmallPayFee/printSmallPayFee.html @@ -0,0 +1,37 @@ + +
+ + + + +
\ No newline at end of file diff --git a/public/pages/property/printSmallPayFee/printSmallPayFee.js b/public/pages/property/printSmallPayFee/printSmallPayFee.js new file mode 100644 index 000000000..72b966efd --- /dev/null +++ b/public/pages/property/printSmallPayFee/printSmallPayFee.js @@ -0,0 +1,149 @@ +(function (vc) { + + vc.extends({ + data: { + printSmallPayFeeInfo: { + communityName: '', + receiptId: '', + receiptIds: '', + roomName: '', + amount: 0.00, + fees: [], + feeTime: '', + wechatName: '', + content: '', + qrImg: '' + }, + printFlag: '0' + }, + _initMethod: function () { + //vc.component._initPrintPurchaseApplyDateInfo(); + + $that.printSmallPayFeeInfo.receiptId = vc.getParam('receiptId'); + $that.printSmallPayFeeInfo.receiptIds = vc.getParam('receiptIds'); + //$that.printSmallPayFeeInfo.feeTime = vc.dateTimeFormat(new Date()); + + $that.printSmallPayFeeInfo.communityName = vc.getCurrentCommunity().name; + + $that._loadReceipt(); + + $that._loadPrintSpec(); + }, + _initEvent: function () { + + + }, + methods: { + _initPayFee: function () { + + }, + _loadReceipt: function () { + + var param = { + params: { + page: 1, + row: 30, + receiptId: $that.printSmallPayFeeInfo.receiptId, + receiptIds: $that.printSmallPayFeeInfo.receiptIds, + communityId: vc.getCurrentCommunity().communityId + } + }; + + //发送get请求 + vc.http.apiGet('/feeReceipt/queryFeeReceipt', + param, + function (json, res) { + var _feeReceiptManageInfo = JSON.parse(json); + let _feeReceipt = _feeReceiptManageInfo.data; + let _amount = 0; + _feeReceipt.forEach(item => { + _amount += parseFloat(item.amount) + }); + + $that.printSmallPayFeeInfo.amount = _amount; + $that.printSmallPayFeeInfo.roomName = _feeReceipt[0].objName; + $that.printSmallPayFeeInfo.feeTime = _feeReceipt[0].createTime; + $that.printSmallPayFeeInfo.receiptNum = _feeReceipt[0].receiptId; + + $that._loadReceiptDetail(); + + }, function (errInfo, error) { + console.log('请求失败处理'); + } + ); + }, + _loadReceiptDetail: function () { + + var param = { + params: { + page: 1, + row: 100, + receiptId: $that.printSmallPayFeeInfo.receiptId, + receiptIds: $that.printSmallPayFeeInfo.receiptIds, + communityId: vc.getCurrentCommunity().communityId + } + }; + + //发送get请求 + vc.http.apiGet('/feeReceipt/queryFeeReceiptDetail', + param, + function (json, res) { + var _feeReceiptManageInfo = JSON.parse(json); + let _feeReceiptDetails = _feeReceiptManageInfo.data; + $that.printSmallPayFeeInfo.fees = _feeReceiptDetails; + }, function (errInfo, error) { + console.log('请求失败处理'); + } + ); + }, + _loadPrintSpec: function () { + var param = { + params: { + page: 1, + row: 1, + specCd: 2020, + communityId: vc.getCurrentCommunity().communityId + } + }; + + //发送get请求 + vc.http.apiGet('/feePrintSpec/queryFeePrintSpec', + param, + function (json, res) { + var _json = JSON.parse(json); + var _data = _json.data; + if (_data.length > 0) { + $that.printSmallPayFeeInfo.content = _data[0].content; + $that.printSmallPayFeeInfo.qrImg = _data[0].qrImg; + } + }, function (errInfo, error) { + console.log('请求失败处理'); + } + ); + + }, + + _printPurchaseApplyDiv: function () { + + + let bdhtml=window.document.body.innerHTML; + let sprnstr=""; + let eprnstr=""; + let prnhtml=bdhtml.substr(bdhtml.indexOf(sprnstr)+sprnstr.length); + prnhtml=prnhtml.substring(0,prnhtml.indexOf(eprnstr)); + window.document.body.innerHTML=prnhtml; + console.log(window.document.body.innerHTML) + window.print(); + // window.print(); + // //$that.printFlag = false; + window.opener = null; + window.close(); + }, + _closePage: function () { + window.opener = null; + window.close(); + } + } + }); + +})(window.vc); diff --git a/public/smallPrint.html b/public/smallPrint.html new file mode 100644 index 000000000..371352443 --- /dev/null +++ b/public/smallPrint.html @@ -0,0 +1,18 @@ + + + + + 收据单 + + + +
+
+ + + + + + + + \ No newline at end of file