Commit 8e80e9f4dfa77a975cf5bbb16045ec1cbf2d6f4d
1 parent
f37bc86c
账户补打开发完成
Showing
11 changed files
with
704 additions
and
42 deletions
src/api/account/printAccountReceiptApi.js
0 → 100644
| 1 | +import request from '@/utils/request' | ||
| 2 | + | ||
| 3 | +/** | ||
| 4 | + * 获取账户收据列表 | ||
| 5 | + * @param {Object} params 查询参数 | ||
| 6 | + * @returns {Promise} | ||
| 7 | + */ | ||
| 8 | +export function listAccountReceipt(params) { | ||
| 9 | + return new Promise((resolve, reject) => { | ||
| 10 | + request({ | ||
| 11 | + url: '/receipt.listAccountReceipt', | ||
| 12 | + method: 'get', | ||
| 13 | + params | ||
| 14 | + }).then(response => { | ||
| 15 | + const res = response.data | ||
| 16 | + resolve(res) | ||
| 17 | + }).catch(error => { | ||
| 18 | + reject(error) | ||
| 19 | + }) | ||
| 20 | + }) | ||
| 21 | +} | ||
| 22 | + | ||
| 23 | +/** | ||
| 24 | + * 查询打印规格 | ||
| 25 | + * @param {Object} params 查询参数 | ||
| 26 | + * @returns {Promise} | ||
| 27 | + */ | ||
| 28 | +export function queryFeePrintSpec(params) { | ||
| 29 | + return new Promise((resolve, reject) => { | ||
| 30 | + request({ | ||
| 31 | + url: '/feePrintSpec/queryFeePrintSpec', | ||
| 32 | + method: 'get', | ||
| 33 | + params | ||
| 34 | + }).then(response => { | ||
| 35 | + const res = response.data | ||
| 36 | + resolve(res) | ||
| 37 | + }).catch(error => { | ||
| 38 | + reject(error) | ||
| 39 | + }) | ||
| 40 | + }) | ||
| 41 | +} | ||
| 0 | \ No newline at end of file | 42 | \ No newline at end of file |
src/api/account/printSmallAccountReceiptApi.js
0 → 100644
| 1 | +import request from '@/utils/request' | ||
| 2 | + | ||
| 3 | +// 获取账户收据列表 | ||
| 4 | +export function listAccountReceipt(params) { | ||
| 5 | + return new Promise((resolve, reject) => { | ||
| 6 | + request({ | ||
| 7 | + url: '/receipt.listAccountReceipt', | ||
| 8 | + method: 'get', | ||
| 9 | + params | ||
| 10 | + }).then(response => { | ||
| 11 | + const res = response.data | ||
| 12 | + resolve(res) | ||
| 13 | + }).catch(error => { | ||
| 14 | + reject(error) | ||
| 15 | + }) | ||
| 16 | + }) | ||
| 17 | +} | ||
| 18 | + | ||
| 19 | +// 查询费用打印规格 | ||
| 20 | +export function queryFeePrintSpec(params) { | ||
| 21 | + return new Promise((resolve, reject) => { | ||
| 22 | + request({ | ||
| 23 | + url: '/feePrintSpec/queryFeePrintSpec', | ||
| 24 | + method: 'get', | ||
| 25 | + params | ||
| 26 | + }).then(response => { | ||
| 27 | + const res = response.data | ||
| 28 | + resolve(res) | ||
| 29 | + }).catch(error => { | ||
| 30 | + reject(error) | ||
| 31 | + }) | ||
| 32 | + }) | ||
| 33 | +} | ||
| 34 | + | ||
| 35 | +// 获取打印机列表 | ||
| 36 | +export function listMachinePrinter(params) { | ||
| 37 | + return new Promise((resolve, reject) => { | ||
| 38 | + request({ | ||
| 39 | + url: '/printer.listMachinePrinter', | ||
| 40 | + method: 'get', | ||
| 41 | + params | ||
| 42 | + }).then(response => { | ||
| 43 | + const res = response.data | ||
| 44 | + resolve(res) | ||
| 45 | + }).catch(error => { | ||
| 46 | + reject(error) | ||
| 47 | + }) | ||
| 48 | + }) | ||
| 49 | +} | ||
| 50 | + | ||
| 51 | +// 打印账户收据 | ||
| 52 | +export function printAccountReceipt(data) { | ||
| 53 | + return new Promise((resolve, reject) => { | ||
| 54 | + request({ | ||
| 55 | + url: '/print.printAccountReceipt', | ||
| 56 | + method: 'post', | ||
| 57 | + data | ||
| 58 | + }).then(response => { | ||
| 59 | + const res = response.data | ||
| 60 | + resolve(res) | ||
| 61 | + }).catch(error => { | ||
| 62 | + reject(error) | ||
| 63 | + }) | ||
| 64 | + }) | ||
| 65 | +} | ||
| 0 | \ No newline at end of file | 66 | \ No newline at end of file |
src/components/owner/ownerDetailAccountReceipt.vue
| 1 | <template> | 1 | <template> |
| 2 | <div> | 2 | <div> |
| 3 | - <el-row class="margin-top-lg"> | ||
| 4 | - <el-col :span="12"></el-col> | ||
| 5 | - <el-col :span="12" class="text-right"> | 3 | + <div class="flex justify-between"> |
| 4 | + <div></div> | ||
| 5 | + <div > | ||
| 6 | <el-button type="primary" size="small" @click="_printFeeAccountReceipt" style="margin-left:10px"> | 6 | <el-button type="primary" size="small" @click="_printFeeAccountReceipt" style="margin-left:10px"> |
| 7 | - {{$t('ownerDetailAccountReceipt.print')}} | 7 | + {{ $t('ownerDetailAccountReceipt.print') }} |
| 8 | </el-button> | 8 | </el-button> |
| 9 | <el-button type="primary" size="small" @click="_printFeeSmallAccountReceipt" style="margin-left:10px"> | 9 | <el-button type="primary" size="small" @click="_printFeeSmallAccountReceipt" style="margin-left:10px"> |
| 10 | - {{$t('ownerDetailAccountReceipt.printSmall')}} | 10 | + {{ $t('ownerDetailAccountReceipt.printSmall') }} |
| 11 | </el-button> | 11 | </el-button> |
| 12 | - </el-col> | ||
| 13 | - </el-row> | 12 | + </div> |
| 13 | + </div> | ||
| 14 | <div class="margin-top"> | 14 | <div class="margin-top"> |
| 15 | - <el-table | ||
| 16 | - :data="ownerDetailAccountReceiptInfo.feeReceipts" | ||
| 17 | - style="width: 100%; margin-top: 10px" | ||
| 18 | - border | ||
| 19 | - stripe | ||
| 20 | - > | 15 | + <el-table :data="ownerDetailAccountReceiptInfo.feeReceipts" style="width: 100%; margin-top: 10px" border stripe> |
| 21 | <el-table-column width="50" align="center"> | 16 | <el-table-column width="50" align="center"> |
| 22 | <template slot-scope="scope"> | 17 | <template slot-scope="scope"> |
| 23 | - <el-checkbox | ||
| 24 | - v-model="scope.row.checked" | ||
| 25 | - @change="handleCheckChange(scope.row)" | ||
| 26 | - ></el-checkbox> | 18 | + <el-checkbox v-model="scope.row.checked" @change="handleCheckChange(scope.row)"></el-checkbox> |
| 27 | </template> | 19 | </template> |
| 28 | </el-table-column> | 20 | </el-table-column> |
| 29 | - <el-table-column prop="acctName" :label="$t('ownerDetailAccountReceipt.accountName')" align="center"></el-table-column> | ||
| 30 | - <el-table-column prop="acctTypeName" :label="$t('ownerDetailAccountReceipt.accountType')" align="center"></el-table-column> | ||
| 31 | - <el-table-column prop="ownerName" :label="$t('ownerDetailAccountReceipt.owner')" align="center"></el-table-column> | ||
| 32 | - <el-table-column prop="receivedAmount" :label="$t('ownerDetailAccountReceipt.prestoreAmount')" align="center"></el-table-column> | ||
| 33 | - <el-table-column prop="primeRateName" :label="$t('ownerDetailAccountReceipt.prestoreMethod')" align="center"></el-table-column> | ||
| 34 | - <el-table-column prop="amount" :label="$t('ownerDetailAccountReceipt.totalAmount')" align="center"></el-table-column> | ||
| 35 | - <el-table-column prop="createTime" :label="$t('ownerDetailAccountReceipt.prestoreTime')" align="center"></el-table-column> | ||
| 36 | - <el-table-column prop="arId" :label="$t('ownerDetailAccountReceipt.receiptId')" align="center"></el-table-column> | 21 | + <el-table-column prop="acctName" :label="$t('ownerDetailAccountReceipt.accountName')" |
| 22 | + align="center"></el-table-column> | ||
| 23 | + <el-table-column prop="acctTypeName" :label="$t('ownerDetailAccountReceipt.accountType')" | ||
| 24 | + align="center"></el-table-column> | ||
| 25 | + <el-table-column prop="ownerName" :label="$t('ownerDetailAccountReceipt.owner')" | ||
| 26 | + align="center"></el-table-column> | ||
| 27 | + <el-table-column prop="receivedAmount" :label="$t('ownerDetailAccountReceipt.prestoreAmount')" | ||
| 28 | + align="center"></el-table-column> | ||
| 29 | + <el-table-column prop="primeRateName" :label="$t('ownerDetailAccountReceipt.prestoreMethod')" | ||
| 30 | + align="center"></el-table-column> | ||
| 31 | + <el-table-column prop="amount" :label="$t('ownerDetailAccountReceipt.totalAmount')" | ||
| 32 | + align="center"></el-table-column> | ||
| 33 | + <el-table-column prop="createTime" :label="$t('ownerDetailAccountReceipt.prestoreTime')" | ||
| 34 | + align="center"></el-table-column> | ||
| 35 | + <el-table-column prop="arId" :label="$t('ownerDetailAccountReceipt.receiptId')" | ||
| 36 | + align="center"></el-table-column> | ||
| 37 | </el-table> | 37 | </el-table> |
| 38 | - <el-pagination | ||
| 39 | - @current-change="handleCurrentChange" | ||
| 40 | - :current-page="currentPage" | ||
| 41 | - :page-size="pageSize" | ||
| 42 | - layout="total, prev, pager, next, jumper" | ||
| 43 | - :total="total"> | 38 | + <el-pagination @current-change="handleCurrentChange" :current-page="currentPage" :page-size="pageSize" |
| 39 | + layout="total, prev, pager, next, jumper" :total="total"> | ||
| 44 | </el-pagination> | 40 | </el-pagination> |
| 45 | </div> | 41 | </div> |
| 46 | </div> | 42 | </div> |
src/i18n/feeI18n.js
| @@ -34,6 +34,8 @@ import { messages as owePayFeeOrderMessages } from '../views/fee/owePayFeeOrderL | @@ -34,6 +34,8 @@ import { messages as owePayFeeOrderMessages } from '../views/fee/owePayFeeOrderL | ||
| 34 | import { messages as printOweFeeMessages } from '../views/fee/printOweFeeLang' | 34 | import { messages as printOweFeeMessages } from '../views/fee/printOweFeeLang' |
| 35 | import { messages as feeDetailMessages } from '../views/fee/feeDetailLang' | 35 | import { messages as feeDetailMessages } from '../views/fee/feeDetailLang' |
| 36 | import { messages as roomCreatePayFeeMessages } from '../views/fee/roomCreatePayFeeLang' | 36 | import { messages as roomCreatePayFeeMessages } from '../views/fee/roomCreatePayFeeLang' |
| 37 | +import { messages as printAccountReceiptMessages } from '../views/account/printAccountReceiptLang' | ||
| 38 | +import { messages as printSmallAccountReceiptMessages } from '../views/account/printSmallAccountReceiptLang' | ||
| 37 | 39 | ||
| 38 | export const messages = { | 40 | export const messages = { |
| 39 | en: { | 41 | en: { |
| @@ -73,6 +75,8 @@ export const messages = { | @@ -73,6 +75,8 @@ export const messages = { | ||
| 73 | ...printOweFeeMessages.en, | 75 | ...printOweFeeMessages.en, |
| 74 | ...feeDetailMessages.en, | 76 | ...feeDetailMessages.en, |
| 75 | ...roomCreatePayFeeMessages.en, | 77 | ...roomCreatePayFeeMessages.en, |
| 78 | + ...printAccountReceiptMessages.en, | ||
| 79 | + ...printSmallAccountReceiptMessages.en, | ||
| 76 | }, | 80 | }, |
| 77 | zh: { | 81 | zh: { |
| 78 | ...contractCreateFeeMessages.zh, | 82 | ...contractCreateFeeMessages.zh, |
| @@ -111,5 +115,7 @@ export const messages = { | @@ -111,5 +115,7 @@ export const messages = { | ||
| 111 | ...printOweFeeMessages.zh, | 115 | ...printOweFeeMessages.zh, |
| 112 | ...feeDetailMessages.zh, | 116 | ...feeDetailMessages.zh, |
| 113 | ...roomCreatePayFeeMessages.zh, | 117 | ...roomCreatePayFeeMessages.zh, |
| 118 | + ...printAccountReceiptMessages.zh, | ||
| 119 | + ...printSmallAccountReceiptMessages.zh, | ||
| 114 | } | 120 | } |
| 115 | } | 121 | } |
| 116 | \ No newline at end of file | 122 | \ No newline at end of file |
src/router/feeRouter.js
| @@ -163,6 +163,7 @@ export default [ | @@ -163,6 +163,7 @@ export default [ | ||
| 163 | path: '/pages/fee/roomCreatePayFee', | 163 | path: '/pages/fee/roomCreatePayFee', |
| 164 | name: '/pages/fee/roomCreatePayFee', | 164 | name: '/pages/fee/roomCreatePayFee', |
| 165 | component: () => import('@/views/fee/roomCreatePayFeeList.vue') | 165 | component: () => import('@/views/fee/roomCreatePayFeeList.vue') |
| 166 | - } | 166 | + }, |
| 167 | + | ||
| 167 | 168 | ||
| 168 | ] | 169 | ] |
| 169 | \ No newline at end of file | 170 | \ No newline at end of file |
src/router/index.js
| @@ -690,9 +690,19 @@ const routes = [ | @@ -690,9 +690,19 @@ const routes = [ | ||
| 690 | component: () => import('@/views/fee/printPayFeeBangTaiList.vue') | 690 | component: () => import('@/views/fee/printPayFeeBangTaiList.vue') |
| 691 | }, | 691 | }, |
| 692 | { | 692 | { |
| 693 | - path:'/pages/property/printSmallPayFee', | ||
| 694 | - name:'/pages/property/printSmallPayFee', | 693 | + path: '/pages/property/printSmallPayFee', |
| 694 | + name: '/pages/property/printSmallPayFee', | ||
| 695 | component: () => import('@/views/fee/printSmallPayFeeList.vue') | 695 | component: () => import('@/views/fee/printSmallPayFeeList.vue') |
| 696 | + }, | ||
| 697 | + { | ||
| 698 | + path: '/pages/property/printAccountReceipt', | ||
| 699 | + name: '/pages/property/printAccountReceipt', | ||
| 700 | + component: () => import('@/views/account/printAccountReceiptList.vue') | ||
| 701 | + }, | ||
| 702 | + { | ||
| 703 | + path:'/pages/property/printSmallAccountReceipt', | ||
| 704 | + name:'/pages/property/printSmallAccountReceipt', | ||
| 705 | + component: () => import('@/views/account/printSmallAccountReceiptList.vue') | ||
| 696 | }, | 706 | }, |
| 697 | ] | 707 | ] |
| 698 | 708 | ||
| @@ -706,9 +716,9 @@ router.beforeEach((to, from, next) => { | @@ -706,9 +716,9 @@ router.beforeEach((to, from, next) => { | ||
| 706 | if (to.path.startsWith('/img/') || to.path.startsWith('/static/') || to.path.startsWith('/js/') || to.path.startsWith('/css/')) { | 716 | if (to.path.startsWith('/img/') || to.path.startsWith('/static/') || to.path.startsWith('/js/') || to.path.startsWith('/css/')) { |
| 707 | return next(); // 直接放行 | 717 | return next(); // 直接放行 |
| 708 | } | 718 | } |
| 709 | - if (to.path.startsWith('/formjs/') || to.path.startsWith('/bpmnjs/') | ||
| 710 | - || to.path.startsWith('/components/frame/') | ||
| 711 | - || to.path.startsWith('/bigScreen/')) { | 719 | + if (to.path.startsWith('/formjs/') || to.path.startsWith('/bpmnjs/') |
| 720 | + || to.path.startsWith('/components/frame/') | ||
| 721 | + || to.path.startsWith('/bigScreen/')) { | ||
| 712 | return next(); // 直接放行 | 722 | return next(); // 直接放行 |
| 713 | } | 723 | } |
| 714 | if (to.path.endsWith('.xlsx')) { | 724 | if (to.path.endsWith('.xlsx')) { |
src/views/account/printAccountReceiptLang.js
0 → 100644
| 1 | +export const messages = { | ||
| 2 | + en: { | ||
| 3 | + printAccountReceipt: { | ||
| 4 | + depositSlip: 'Deposit Slip', | ||
| 5 | + receiptNum: 'Receipt Number', | ||
| 6 | + depositTime: 'Deposit Time', | ||
| 7 | + number: 'No.', | ||
| 8 | + accountName: 'Account Name', | ||
| 9 | + accountType: 'Account Type', | ||
| 10 | + owner: 'Owner', | ||
| 11 | + depositAmount: 'Deposit Amount', | ||
| 12 | + depositMethod: 'Deposit Method', | ||
| 13 | + currentBalance: 'Current Balance', | ||
| 14 | + remark: 'Remark', | ||
| 15 | + chineseAmount: 'Chinese Amount', | ||
| 16 | + departmentHead: 'Department Head', | ||
| 17 | + operator: 'Operator', | ||
| 18 | + financialCollection: 'Financial Collection', | ||
| 19 | + customerConfirmation: 'Customer Confirmation', | ||
| 20 | + loadError: 'Failed to load receipt data', | ||
| 21 | + loadSpecError: 'Failed to load print specification' | ||
| 22 | + } | ||
| 23 | + }, | ||
| 24 | + zh: { | ||
| 25 | + printAccountReceipt: { | ||
| 26 | + depositSlip: '预存单', | ||
| 27 | + receiptNum: '单号', | ||
| 28 | + depositTime: '预存时间', | ||
| 29 | + number: '编号', | ||
| 30 | + accountName: '账户名称', | ||
| 31 | + accountType: '账户类型', | ||
| 32 | + owner: '业主', | ||
| 33 | + depositAmount: '预存金额', | ||
| 34 | + depositMethod: '预存方式', | ||
| 35 | + currentBalance: '当前余额', | ||
| 36 | + remark: '备注', | ||
| 37 | + chineseAmount: '大写人民币', | ||
| 38 | + departmentHead: '部门负责人', | ||
| 39 | + operator: '经办人', | ||
| 40 | + financialCollection: '财务收款', | ||
| 41 | + customerConfirmation: '客户确认', | ||
| 42 | + loadError: '加载收据数据失败', | ||
| 43 | + loadSpecError: '加载打印规格失败' | ||
| 44 | + } | ||
| 45 | + } | ||
| 46 | +} | ||
| 0 | \ No newline at end of file | 47 | \ No newline at end of file |
src/views/account/printAccountReceiptList.vue
0 → 100644
| 1 | +<template> | ||
| 2 | + <div class="print-account-receipt-container"> | ||
| 3 | + <div > | ||
| 4 | + <div class="print-content"> | ||
| 5 | + <div class="text-center"> | ||
| 6 | + <div style="color:#000;font-size:26px">{{ printAccountReceiptInfo.communityName }} {{ | ||
| 7 | + $t('printAccountReceipt.depositSlip') }}</div> | ||
| 8 | + </div> | ||
| 9 | + <div style="color:#000;font-size:14px;margin-left:20px"> | ||
| 10 | + <div class="float-left"> | ||
| 11 | + <span style="color:#000;font-size:14px"> | ||
| 12 | + {{ $t('printAccountReceipt.receiptNum') }}:{{ printAccountReceiptInfo.receiptNum }} | ||
| 13 | + </span> | ||
| 14 | + </div> | ||
| 15 | + <div class="float-right text-right"> | ||
| 16 | + <span>{{ $t('printAccountReceipt.depositTime') }}:{{ printAccountReceiptInfo.feeTime }}</span> | ||
| 17 | + </div> | ||
| 18 | + </div> | ||
| 19 | + | ||
| 20 | + <table class="table vc-table-border" style="width:100%;color:#000;font-size:14px;border-collapse:collapse;border:1px solid #000"> | ||
| 21 | + <thead> | ||
| 22 | + <tr> | ||
| 23 | + <th style="width:80px;text-align:center;padding:8px;border:1px solid #000">{{ $t('printAccountReceipt.number') }}</th> | ||
| 24 | + <th style="text-align:center;padding:8px;border:1px solid #000">{{ $t('printAccountReceipt.accountName') }}</th> | ||
| 25 | + <th style="text-align:center;padding:8px;border:1px solid #000">{{ $t('printAccountReceipt.accountType') }}</th> | ||
| 26 | + <th style="text-align:center;padding:8px;border:1px solid #000">{{ $t('printAccountReceipt.owner') }}</th> | ||
| 27 | + <th style="text-align:center;padding:8px;border:1px solid #000">{{ $t('printAccountReceipt.depositAmount') }}</th> | ||
| 28 | + <th style="text-align:center;padding:8px;border:1px solid #000">{{ $t('printAccountReceipt.depositMethod') }}</th> | ||
| 29 | + <th style="text-align:center;padding:8px;border:1px solid #000">{{ $t('printAccountReceipt.currentBalance') }}</th> | ||
| 30 | + <th style="width:200px;text-align:center;padding:8px;border:1px solid #000">{{ $t('printAccountReceipt.remark') }}</th> | ||
| 31 | + </tr> | ||
| 32 | + </thead> | ||
| 33 | + <tbody style="border:1px solid #000"> | ||
| 34 | + <tr v-for="(item, index) in printAccountReceiptInfo.feeReceipts" :key="index" style="border:1px solid #000"> | ||
| 35 | + <td style="text-align:center;padding:8px;border:1px solid #000">{{ index + 1 }}</td> | ||
| 36 | + <td style="text-align:center;padding:8px;border:1px solid #000">{{ item.acctName }}</td> | ||
| 37 | + <td style="text-align:center;padding:8px;border:1px solid #000">{{ item.acctTypeName }}</td> | ||
| 38 | + <td style="text-align:center;padding:8px;border:1px solid #000">{{ item.ownerName }}</td> | ||
| 39 | + <td style="text-align:center;padding:8px;border:1px solid #000">{{ item.receivedAmount }}</td> | ||
| 40 | + <td style="text-align:center;padding:8px;border:1px solid #000">{{ item.primeRateName }}</td> | ||
| 41 | + <td style="text-align:center;padding:8px;border:1px solid #000">{{ item.amount }}</td> | ||
| 42 | + <td style="text-align:center;padding:8px;border:1px solid #000">{{ item.remark }}</td> | ||
| 43 | + </tr> | ||
| 44 | + <tr style="border:1px solid #000"> | ||
| 45 | + <td colspan="3" style="text-align:center;padding:8px;border:1px solid #000"> | ||
| 46 | + {{ $t('printAccountReceipt.chineseAmount') }}(元) | ||
| 47 | + </td> | ||
| 48 | + <td colspan="4" style="text-align:center;padding:8px;border:1px solid #000"> | ||
| 49 | + {{ changeNumMoneyToChinese(printAccountReceiptInfo.amount) }} | ||
| 50 | + </td> | ||
| 51 | + <td colspan="1" style="text-align:center;padding:8px;border:1px solid #000"> | ||
| 52 | + {{ printAccountReceiptInfo.amount }} | ||
| 53 | + </td> | ||
| 54 | + </tr> | ||
| 55 | + <tr v-if="printAccountReceiptInfo.content || printAccountReceiptInfo.qrImg" style="border:1px solid #000"> | ||
| 56 | + <td colspan="4" style="padding:8px;border:1px solid #000"> | ||
| 57 | + <div style="max-width:600px" v-html="printAccountReceiptInfo.content"></div> | ||
| 58 | + </td> | ||
| 59 | + <td colspan="4" style="text-align:right;padding:8px;border:1px solid #000"> | ||
| 60 | + <img v-if="printAccountReceiptInfo.qrImg" :src="printAccountReceiptInfo.qrImg" width="100px" height="100px"> | ||
| 61 | + </td> | ||
| 62 | + </tr> | ||
| 63 | + </tbody> | ||
| 64 | + </table> | ||
| 65 | + | ||
| 66 | + <div style="color:#000;font-size:14px;margin:20px 0 0 10px;overflow:hidden"> | ||
| 67 | + <div style="float:left;width:25%"> | ||
| 68 | + {{ $t('printAccountReceipt.departmentHead') }}: | ||
| 69 | + </div> | ||
| 70 | + <div style="float:left;width:25%"> | ||
| 71 | + {{ $t('printAccountReceipt.operator') }}:{{ userInfo.name }} | ||
| 72 | + </div> | ||
| 73 | + <div style="float:left;width:25%"> | ||
| 74 | + {{ $t('printAccountReceipt.financialCollection') }}: | ||
| 75 | + </div> | ||
| 76 | + <div style="float:left;width:25%"> | ||
| 77 | + {{ $t('printAccountReceipt.customerConfirmation') }}: | ||
| 78 | + </div> | ||
| 79 | + </div> | ||
| 80 | + | ||
| 81 | + <div id="print-btn" style="margin-top:20px;text-align:right"> | ||
| 82 | + <button type="button" class="el-button el-button--warning" style="margin-right:20px" @click="handleCancel"> | ||
| 83 | + {{ $t('common.cancel') }} | ||
| 84 | + </button> | ||
| 85 | + <button type="button" class="el-button el-button--primary" @click="handlePrint"> | ||
| 86 | + <i class="el-icon-printer"></i> {{ $t('common.print') }} | ||
| 87 | + </button> | ||
| 88 | + </div> | ||
| 89 | + </div> | ||
| 90 | + </div> | ||
| 91 | + </div> | ||
| 92 | +</template> | ||
| 93 | + | ||
| 94 | +<script> | ||
| 95 | +import { listAccountReceipt, queryFeePrintSpec } from '@/api/account/printAccountReceiptApi' | ||
| 96 | +import { getUserId, getUserName } from '@/api/user/userApi' | ||
| 97 | +import { getCommunityId, getCommunityName } from '@/api/community/communityApi' | ||
| 98 | +import { changeNumMoneyToChinese } from '@/utils/moneyUtil' | ||
| 99 | + | ||
| 100 | +export default { | ||
| 101 | + name: 'PrintAccountReceiptList', | ||
| 102 | + data() { | ||
| 103 | + return { | ||
| 104 | + printAccountReceiptInfo: { | ||
| 105 | + communityName: '', | ||
| 106 | + arIds: '', | ||
| 107 | + amount: 0.00, | ||
| 108 | + feeReceipts: [], | ||
| 109 | + content: '', | ||
| 110 | + qrImg: '', | ||
| 111 | + receiptNum: '', | ||
| 112 | + feeTime: '' | ||
| 113 | + }, | ||
| 114 | + printFlag: '0', | ||
| 115 | + userInfo: {} | ||
| 116 | + } | ||
| 117 | + }, | ||
| 118 | + created() { | ||
| 119 | + this.printAccountReceiptInfo.arIds = this.$route.query.arIds | ||
| 120 | + this.printAccountReceiptInfo.communityName = getCommunityName() | ||
| 121 | + this.loadReceipt() | ||
| 122 | + this.loadPrintSpec() | ||
| 123 | + this.userInfo = { | ||
| 124 | + id: getUserId(), | ||
| 125 | + name: getUserName() | ||
| 126 | + } | ||
| 127 | + }, | ||
| 128 | + methods: { | ||
| 129 | + async loadReceipt() { | ||
| 130 | + try { | ||
| 131 | + const params = { | ||
| 132 | + page: 1, | ||
| 133 | + row: 30, | ||
| 134 | + arIds: this.printAccountReceiptInfo.arIds, | ||
| 135 | + communityId: getCommunityId() | ||
| 136 | + } | ||
| 137 | + | ||
| 138 | + const { data } = await listAccountReceipt(params) | ||
| 139 | + let amount = 0 | ||
| 140 | + data.forEach(item => { | ||
| 141 | + amount += parseFloat(item.receivedAmount) | ||
| 142 | + }) | ||
| 143 | + this.printAccountReceiptInfo.amount = amount.toFixed(2) | ||
| 144 | + this.printAccountReceiptInfo.feeReceipts = data | ||
| 145 | + if (data && data.length > 0) { | ||
| 146 | + this.printAccountReceiptInfo.receiptNum = data[0].arId | ||
| 147 | + this.printAccountReceiptInfo.feeTime = data[0].createTime | ||
| 148 | + } | ||
| 149 | + } catch (error) { | ||
| 150 | + this.$message.error(this.$t('printAccountReceipt.loadError')) | ||
| 151 | + } | ||
| 152 | + }, | ||
| 153 | + async loadPrintSpec() { | ||
| 154 | + try { | ||
| 155 | + const params = { | ||
| 156 | + page: 1, | ||
| 157 | + row: 1, | ||
| 158 | + specCd: 2020, | ||
| 159 | + communityId: getCommunityId() | ||
| 160 | + } | ||
| 161 | + | ||
| 162 | + const { data } = await queryFeePrintSpec(params) | ||
| 163 | + if (data.length > 0) { | ||
| 164 | + this.printAccountReceiptInfo.content = data[0].content | ||
| 165 | + this.printAccountReceiptInfo.qrImg = data[0].qrImg | ||
| 166 | + if (data[0].printName) { | ||
| 167 | + this.printAccountReceiptInfo.communityName = data[0].printName | ||
| 168 | + } | ||
| 169 | + } | ||
| 170 | + } catch (error) { | ||
| 171 | + this.$message.error(this.$t('printAccountReceipt.loadSpecError')) | ||
| 172 | + } | ||
| 173 | + }, | ||
| 174 | + changeNumMoneyToChinese, | ||
| 175 | + handlePrint() { | ||
| 176 | + this.printFlag = '1' | ||
| 177 | + document.getElementById("print-btn").style.display = "none" | ||
| 178 | + window.print() | ||
| 179 | + window.opener = null | ||
| 180 | + window.close() | ||
| 181 | + }, | ||
| 182 | + handleCancel() { | ||
| 183 | + window.opener = null | ||
| 184 | + window.close() | ||
| 185 | + } | ||
| 186 | + } | ||
| 187 | +} | ||
| 188 | +</script> | ||
| 189 | + | ||
| 190 | +<style scoped> | ||
| 191 | +.print-account-receipt-container { | ||
| 192 | + padding: 20px; | ||
| 193 | +} | ||
| 194 | + | ||
| 195 | +.print-content { | ||
| 196 | + padding: 20px; | ||
| 197 | +} | ||
| 198 | + | ||
| 199 | +.float-left { | ||
| 200 | + float: left; | ||
| 201 | +} | ||
| 202 | + | ||
| 203 | +.float-right { | ||
| 204 | + float: right; | ||
| 205 | +} | ||
| 206 | + | ||
| 207 | +.text-center { | ||
| 208 | + text-align: center; | ||
| 209 | +} | ||
| 210 | + | ||
| 211 | +.text-right { | ||
| 212 | + text-align: right; | ||
| 213 | +} | ||
| 214 | +</style> | ||
| 0 | \ No newline at end of file | 215 | \ No newline at end of file |
src/views/account/printSmallAccountReceiptLang.js
0 → 100644
| 1 | +export const messages = { | ||
| 2 | + en: { | ||
| 3 | + printSmallAccountReceipt: { | ||
| 4 | + title: 'Prepaid Receipt', | ||
| 5 | + receiptNum: 'Receipt No.', | ||
| 6 | + feeTime: 'Time', | ||
| 7 | + acctName: 'Account Name:', | ||
| 8 | + acctTypeName: 'Account Type:', | ||
| 9 | + ownerName: 'Owner:', | ||
| 10 | + receivedAmount: 'Prepaid Amount:', | ||
| 11 | + primeRateName: 'Prepaid Method:', | ||
| 12 | + amount: 'Current Balance:', | ||
| 13 | + remark: 'Remark:', | ||
| 14 | + totalAmount: 'Total', | ||
| 15 | + issuer: 'Issuer', | ||
| 16 | + print: 'Print', | ||
| 17 | + cloudPrint: 'Cloud Print', | ||
| 18 | + cancel: 'Cancel', | ||
| 19 | + printer: 'Printer', | ||
| 20 | + quantity: 'Quantity', | ||
| 21 | + printSuccess: 'Print submitted successfully', | ||
| 22 | + requiredPrinter: 'Required, please select a printer', | ||
| 23 | + requiredQuantity: 'Required, please enter quantity' | ||
| 24 | + } | ||
| 25 | + }, | ||
| 26 | + zh: { | ||
| 27 | + printSmallAccountReceipt: { | ||
| 28 | + title: '预存收据单', | ||
| 29 | + receiptNum: '单号', | ||
| 30 | + feeTime: '时间', | ||
| 31 | + acctName: '账户名称:', | ||
| 32 | + acctTypeName: '账户类型:', | ||
| 33 | + ownerName: '业主:', | ||
| 34 | + receivedAmount: '预存金额:', | ||
| 35 | + primeRateName: '预存方式:', | ||
| 36 | + amount: '当前余额:', | ||
| 37 | + remark: '备注:', | ||
| 38 | + totalAmount: '总计', | ||
| 39 | + issuer: '开票人', | ||
| 40 | + print: '打印', | ||
| 41 | + cloudPrint: '云打印', | ||
| 42 | + cancel: '取消', | ||
| 43 | + printer: '打印机', | ||
| 44 | + quantity: '数量', | ||
| 45 | + printSuccess: '打印提交成功', | ||
| 46 | + requiredPrinter: '必填,请选择打印机', | ||
| 47 | + requiredQuantity: '必填,请填写数量' | ||
| 48 | + } | ||
| 49 | + } | ||
| 50 | +} | ||
| 0 | \ No newline at end of file | 51 | \ No newline at end of file |
src/views/account/printSmallAccountReceiptList.vue
0 → 100644
| 1 | +<template> | ||
| 2 | + <div class="printSmallAccountReceipt-container"> | ||
| 3 | + <div class="print_container"> | ||
| 4 | + <div style="color:#000;font-size:32px" class="text-center"> | ||
| 5 | + <span>{{ $t('printSmallAccountReceipt.title') }}</span> | ||
| 6 | + </div> | ||
| 7 | + <span>**************************</span> | ||
| 8 | + <div class="section2" style="font-size: 12px; margin-left: 5px;"> | ||
| 9 | + <div> | ||
| 10 | + <span>{{ $t('printSmallAccountReceipt.receiptNum') }}</span>:{{ printSmallAccountReceiptInfo.receiptNum }} | ||
| 11 | + </div> | ||
| 12 | + <div> | ||
| 13 | + <span>{{ $t('printSmallAccountReceipt.feeTime') }}</span>:{{ printSmallAccountReceiptInfo.feeTime }} | ||
| 14 | + </div> | ||
| 15 | + </div> | ||
| 16 | + <span>**************************</span> | ||
| 17 | + <div class="section2" style="font-size: 12px; margin-left: 5px;" | ||
| 18 | + v-for="(item, index) in printSmallAccountReceiptInfo.feeReceipts" :key="index"> | ||
| 19 | + <div> | ||
| 20 | + <span>{{ $t('printSmallAccountReceipt.acctName') }}</span>{{ item.acctName }} | ||
| 21 | + </div> | ||
| 22 | + <div> | ||
| 23 | + <span>{{ $t('printSmallAccountReceipt.acctTypeName') }}</span>{{ item.acctTypeName }} | ||
| 24 | + </div> | ||
| 25 | + <div> | ||
| 26 | + <span>{{ $t('printSmallAccountReceipt.ownerName') }}</span>{{ item.ownerName }} | ||
| 27 | + </div> | ||
| 28 | + <div> | ||
| 29 | + <span>{{ $t('printSmallAccountReceipt.receivedAmount') }}</span>{{ item.receivedAmount }} | ||
| 30 | + </div> | ||
| 31 | + <div> | ||
| 32 | + <span>{{ $t('printSmallAccountReceipt.primeRateName') }}</span>{{ item.primeRateName }} | ||
| 33 | + </div> | ||
| 34 | + <div> | ||
| 35 | + <span>{{ $t('printSmallAccountReceipt.amount') }}</span> | ||
| 36 | + {{ item.amount }} | ||
| 37 | + </div> | ||
| 38 | + <div> | ||
| 39 | + <span>{{ $t('printSmallAccountReceipt.remark') }}</span>{{ item.remark }} | ||
| 40 | + </div> | ||
| 41 | + <span>**************************</span> | ||
| 42 | + </div> | ||
| 43 | + <div class="section5" style="font-size: 12px; margin-left: 5px;"> | ||
| 44 | + <div> | ||
| 45 | + <span>{{ $t('printSmallAccountReceipt.totalAmount') }}</span>:{{ printSmallAccountReceiptInfo.amount }} | ||
| 46 | + </div> | ||
| 47 | + <div> | ||
| 48 | + <span>{{ $t('printSmallAccountReceipt.issuer') }}</span>:{{ userInfo.name }} | ||
| 49 | + </div> | ||
| 50 | + <div v-html="printSmallAccountReceiptInfo.content"></div> | ||
| 51 | + <div><img :src="printSmallAccountReceiptInfo.qrImg" width="100px" height="100px"></div> | ||
| 52 | + </div> | ||
| 53 | + <span>**************************</span> | ||
| 54 | + </div> | ||
| 55 | + | ||
| 56 | + <div id="print-btn"> | ||
| 57 | + <el-button type="primary" class="float-right" @click="_printPurchaseApplyDiv()"> | ||
| 58 | + <i class="el-icon-printer"></i> {{ $t('printSmallAccountReceipt.print') }} | ||
| 59 | + </el-button> | ||
| 60 | + <el-button class="float-right margin-right" @click="_openCloudPrint()"> | ||
| 61 | + <i class="el-icon-cloudy"></i> {{ $t('printSmallAccountReceipt.cloudPrint') }} | ||
| 62 | + </el-button> | ||
| 63 | + <el-button type="default" class="float-right margin-right" @click="_closePage()"> | ||
| 64 | + {{ $t('printSmallAccountReceipt.cancel') }} | ||
| 65 | + </el-button> | ||
| 66 | + </div> | ||
| 67 | + | ||
| 68 | + | ||
| 69 | + </div> | ||
| 70 | +</template> | ||
| 71 | + | ||
| 72 | +<script> | ||
| 73 | +import { getCommunityId, getCommunityName } from '@/api/community/communityApi' | ||
| 74 | +import { getUserId, getUserName } from '@/api/user/userApi' | ||
| 75 | +import { listAccountReceipt, queryFeePrintSpec, listMachinePrinter, printAccountReceipt } from '@/api/account/printSmallAccountReceiptApi' | ||
| 76 | + | ||
| 77 | +export default { | ||
| 78 | + name: 'PrintSmallAccountReceiptList', | ||
| 79 | + components: { | ||
| 80 | + | ||
| 81 | + }, | ||
| 82 | + data() { | ||
| 83 | + return { | ||
| 84 | + printSmallAccountReceiptInfo: { | ||
| 85 | + communityName: '', | ||
| 86 | + arIds: '', | ||
| 87 | + amount: 0.00, | ||
| 88 | + feeReceipts: [], | ||
| 89 | + content: '', | ||
| 90 | + qrImg: '', | ||
| 91 | + apply: 'N', | ||
| 92 | + receiptNum: '', | ||
| 93 | + feeTime: '', | ||
| 94 | + machineId: '', | ||
| 95 | + quantity: '1', | ||
| 96 | + machines: [] | ||
| 97 | + }, | ||
| 98 | + userInfo: {}, | ||
| 99 | + communityId: '' | ||
| 100 | + } | ||
| 101 | + }, | ||
| 102 | + created() { | ||
| 103 | + this.communityId = getCommunityId() | ||
| 104 | + this.printSmallAccountReceiptInfo.arIds = this.$route.query.arIds | ||
| 105 | + this.printSmallAccountReceiptInfo.communityName = getCommunityName() | ||
| 106 | + this.userInfo = { | ||
| 107 | + id: getUserId(), | ||
| 108 | + name: getUserName() | ||
| 109 | + } | ||
| 110 | + this._loadReceipt() | ||
| 111 | + this._loadPrintSpec() | ||
| 112 | + }, | ||
| 113 | + methods: { | ||
| 114 | + async _loadReceipt() { | ||
| 115 | + try { | ||
| 116 | + const param = { | ||
| 117 | + page: 1, | ||
| 118 | + row: 30, | ||
| 119 | + arIds: this.printSmallAccountReceiptInfo.arIds, | ||
| 120 | + communityId: this.communityId | ||
| 121 | + } | ||
| 122 | + | ||
| 123 | + const { data } = await listAccountReceipt(param) | ||
| 124 | + let _amount = 0 | ||
| 125 | + data.forEach(item => { | ||
| 126 | + _amount += parseFloat(item.receivedAmount) | ||
| 127 | + }) | ||
| 128 | + this.printSmallAccountReceiptInfo.amount = _amount.toFixed(2) | ||
| 129 | + this.printSmallAccountReceiptInfo.feeReceipts = data | ||
| 130 | + if (data && data.length > 0) { | ||
| 131 | + this.printSmallAccountReceiptInfo.receiptNum = data[0].arId | ||
| 132 | + this.printSmallAccountReceiptInfo.feeTime = data[0].createTime | ||
| 133 | + } | ||
| 134 | + } catch (error) { | ||
| 135 | + console.error('加载收据失败:', error) | ||
| 136 | + } | ||
| 137 | + }, | ||
| 138 | + async _loadPrintSpec() { | ||
| 139 | + try { | ||
| 140 | + const param = { | ||
| 141 | + page: 1, | ||
| 142 | + row: 1, | ||
| 143 | + specCd: 2020, | ||
| 144 | + communityId: this.communityId | ||
| 145 | + } | ||
| 146 | + | ||
| 147 | + const { data } = await queryFeePrintSpec(param) | ||
| 148 | + if (data.length > 0) { | ||
| 149 | + this.printSmallAccountReceiptInfo.content = data[0].content | ||
| 150 | + this.printSmallAccountReceiptInfo.qrImg = data[0].qrImg | ||
| 151 | + } | ||
| 152 | + } catch (error) { | ||
| 153 | + console.error('加载打印规格失败:', error) | ||
| 154 | + } | ||
| 155 | + }, | ||
| 156 | + _printPurchaseApplyDiv() { | ||
| 157 | + let bdhtml = window.document.body.innerHTML | ||
| 158 | + let sprnstr = "<startprint></startprint>" | ||
| 159 | + let eprnstr = "<endprint></endprint>" | ||
| 160 | + let prnhtml = bdhtml.substr(bdhtml.indexOf(sprnstr) + sprnstr.length) | ||
| 161 | + prnhtml = prnhtml.substring(0, prnhtml.indexOf(eprnstr)) | ||
| 162 | + window.document.body.innerHTML = prnhtml | ||
| 163 | + console.log(window.document.body.innerHTML) | ||
| 164 | + window.print() | ||
| 165 | + window.opener = null | ||
| 166 | + window.close() | ||
| 167 | + }, | ||
| 168 | + _closePage() { | ||
| 169 | + window.opener = null | ||
| 170 | + window.close() | ||
| 171 | + }, | ||
| 172 | + async _openCloudPrint() { | ||
| 173 | + let _arIds = []; | ||
| 174 | + this.printSmallAccountReceiptInfo.feeReceipts.forEach(_data => { | ||
| 175 | + _arIds.push(_data.arId); | ||
| 176 | + }) | ||
| 177 | + if (_arIds.length < 1) { | ||
| 178 | + this.$message.error(this.$t('printSmallAccountReceipt.noFee')) | ||
| 179 | + return; | ||
| 180 | + } | ||
| 181 | + let _data = { | ||
| 182 | + communityId: getCommunityId(), | ||
| 183 | + machineId: this.printSmallAccountReceiptInfo.machineId, | ||
| 184 | + quantity: this.printSmallAccountReceiptInfo.quantity, | ||
| 185 | + arIds: _arIds.join(',') | ||
| 186 | + } | ||
| 187 | + await printAccountReceipt(_data) | ||
| 188 | + | ||
| 189 | + }, | ||
| 190 | + async _listMachinePrinter() { | ||
| 191 | + try { | ||
| 192 | + const param = { | ||
| 193 | + page: 1, | ||
| 194 | + row: 100, | ||
| 195 | + communityId: this.communityId | ||
| 196 | + } | ||
| 197 | + | ||
| 198 | + const { data } = await listMachinePrinter(param) | ||
| 199 | + this.printSmallAccountReceiptInfo.machines = data | ||
| 200 | + | ||
| 201 | + if (this.printSmallAccountReceiptInfo.machines && this.printSmallAccountReceiptInfo.machines.length > 0) { | ||
| 202 | + this.printSmallAccountReceiptInfo.machineId = this.printSmallAccountReceiptInfo.machines[0].machineId | ||
| 203 | + } | ||
| 204 | + } catch (error) { | ||
| 205 | + console.error('加载打印机失败:', error) | ||
| 206 | + } | ||
| 207 | + }, | ||
| 208 | + handleCloudPrintSuccess() { | ||
| 209 | + this.$message.success(this.$t('printSmallAccountReceipt.printSuccess')) | ||
| 210 | + } | ||
| 211 | + } | ||
| 212 | +} | ||
| 213 | +</script> | ||
| 214 | + | ||
| 215 | +<style lang="scss" scoped> | ||
| 216 | +.printSmallAccountReceipt-container { | ||
| 217 | + padding: 20px; | ||
| 218 | + | ||
| 219 | + .print_container { | ||
| 220 | + margin-bottom: 20px; | ||
| 221 | + } | ||
| 222 | + | ||
| 223 | + #print-btn { | ||
| 224 | + margin-top: 20px; | ||
| 225 | + text-align: right; | ||
| 226 | + | ||
| 227 | + .float-right { | ||
| 228 | + float: right; | ||
| 229 | + } | ||
| 230 | + | ||
| 231 | + .margin-right { | ||
| 232 | + margin-right: 10px; | ||
| 233 | + } | ||
| 234 | + } | ||
| 235 | +} | ||
| 236 | +</style> | ||
| 0 | \ No newline at end of file | 237 | \ No newline at end of file |
src/views/fee/printPayFeeList.vue
| @@ -107,6 +107,7 @@ import { getCommunityId, getCommunityName } from '@/api/community/communityApi' | @@ -107,6 +107,7 @@ import { getCommunityId, getCommunityName } from '@/api/community/communityApi' | ||
| 107 | import { queryFeeReceipt, queryFeeReceiptDetail, queryFeePrintSpec } from '@/api/fee/printPayFeeApi' | 107 | import { queryFeeReceipt, queryFeeReceiptDetail, queryFeePrintSpec } from '@/api/fee/printPayFeeApi' |
| 108 | import { getUserId, getUserName } from '@/api/user/userApi' | 108 | import { getUserId, getUserName } from '@/api/user/userApi' |
| 109 | import { dateFormat } from '@/utils/dateUtil' | 109 | import { dateFormat } from '@/utils/dateUtil' |
| 110 | +import { changeNumMoneyToChinese } from '@/utils/moneyUtil' | ||
| 110 | 111 | ||
| 111 | export default { | 112 | export default { |
| 112 | name: 'PrintPayFeeList', | 113 | name: 'PrintPayFeeList', |
| @@ -238,11 +239,7 @@ export default { | @@ -238,11 +239,7 @@ export default { | ||
| 238 | if (!date) return '' | 239 | if (!date) return '' |
| 239 | return dateFormat(date) | 240 | return dateFormat(date) |
| 240 | }, | 241 | }, |
| 241 | - changeNumMoneyToChinese(num) { | ||
| 242 | - // 这里实现数字转中文大写金额的逻辑 | ||
| 243 | - // 原vc.changeNumMoneyToChinese的实现 | ||
| 244 | - return num // 实际应该返回转换后的中文大写金额 | ||
| 245 | - }, | 242 | + changeNumMoneyToChinese, |
| 246 | handlePrint() { | 243 | handlePrint() { |
| 247 | this.printFlag = '1' | 244 | this.printFlag = '1' |
| 248 | document.getElementById("print-btn").style.display = "none" | 245 | document.getElementById("print-btn").style.display = "none" |