From b573cfdb7f960971de8b299b0711c97d193c4ae0 Mon Sep 17 00:00:00 2001 From: zengqiyang <492393100@qq.com> Date: Thu, 24 Apr 2025 18:29:19 +0800 Subject: [PATCH] =?UTF-8?q?=E5=85=A8=E9=83=A8=E8=B4=A6=E5=8D=95=E5=AF=B9?= =?UTF-8?q?=E6=8E=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 1 + pc/package.json | 5 +- pc/src/api/finance.js | 270 +++- pc/src/components/RegionSelector.vue | 136 ++ pc/src/router/modules/finance.js | 6 + .../finance/billList/components/AddBill.vue | 427 +++-- .../billList/components/BillDetail.vue | 1410 ++++++++++++++++- pc/src/views/finance/billList/index.vue | 74 +- .../components/TransactionDetail.vue | 520 ++++++ pc/src/views/finance/transaction/index.vue | 352 ++++ pc/src/views/project/index.vue | 16 +- pc/vue.config.js | 2 +- 12 files changed, 3036 insertions(+), 183 deletions(-) create mode 100644 pc/src/components/RegionSelector.vue create mode 100644 pc/src/views/finance/transaction/components/TransactionDetail.vue create mode 100644 pc/src/views/finance/transaction/index.vue diff --git a/package.json b/package.json index 621d8de..c496ed7 100644 --- a/package.json +++ b/package.json @@ -1,5 +1,6 @@ { "dependencies": { + "element-china-area-data": "^6.1.0", "html2canvas": "^1.4.1", "mammoth": "^1.9.0", "pdf-lib": "^1.17.1", diff --git a/pc/package.json b/pc/package.json index 491d5d5..a5c72a8 100644 --- a/pc/package.json +++ b/pc/package.json @@ -49,7 +49,10 @@ "vue-router": "3.4.9", "vuedraggable": "^2.24.3", "vuex": "3.6.0", - "xlsx": "^0.18.5" + "xlsx": "^0.18.5", + "element-china-area-data": "^6.1.0", + "mammoth": "^1.9.0", + "qrcode.vue": "^3.6.0" }, "devDependencies": { "@vue/cli-plugin-babel": "4.4.6", diff --git a/pc/src/api/finance.js b/pc/src/api/finance.js index 11a2f25..cd2ab71 100644 --- a/pc/src/api/finance.js +++ b/pc/src/api/finance.js @@ -416,7 +416,7 @@ export function uploadBillAttachment(billId, file) { formData.append('billId', billId) formData.append('file', file) return request({ - url: '/bill/attachment/upload', + url: '/bill/upload-attachment', method: 'post', data: formData, headers: { @@ -425,10 +425,11 @@ export function uploadBillAttachment(billId, file) { }) } +// 账单附件删除 export function deleteBillAttachment(attachmentId) { return request({ - url: `/bill/attachment/${attachmentId}`, - method: 'delete' + url: `/bill/attachment/delete/${attachmentId}`, + method: 'get' }) } @@ -446,4 +447,267 @@ export function exportBillList(data) { data, responseType: 'blob' }) +} + +// 收支流水相关接口 +export function getTransactionList(params) { + return request({ + url: '/finance/transaction/page', + method: 'get', + params + }) +} + +export function getTransactionDetail(id) { + return request({ + url: `/finance/transaction/${id}`, + method: 'get' + }) +} + +export function addTransaction(data) { + return request({ + url: '/finance/transaction', + method: 'post', + data + }) +} + +export function updateTransaction(data) { + return request({ + url: '/finance/transaction', + method: 'put', + data + }) +} + +export function exportTransactionList(params) { + return request({ + url: '/finance/transaction/export', + method: 'get', + params, + responseType: 'blob' + }) +} + +export function getTransactionAttachments(transactionId) { + return request({ + url: `/finance/transaction/${transactionId}`, + method: 'get' + }) +} + +export function uploadTransactionAttachment(transactionId, file) { + const formData = new FormData() + formData.append('transactionId', transactionId) + formData.append('userId', localStorage.getItem('userId') || '') + formData.append('userName', localStorage.getItem('userName') || '') + formData.append('file', file) + + return request({ + url: '/finance/transaction/attachment', + method: 'post', + data: formData, + headers: { + 'Content-Type': 'multipart/form-data' + } + }) +} + +export function deleteTransactionAttachment(attachmentId) { + return request({ + url: `/finance/transaction/attachment/file/${attachmentId}`, + method: 'delete' + }) +} + +export function previewAttachment(attachmentId) { + return request({ + url: `/finance/transaction/attachment/preview/file/${attachmentId}`, + method: 'get', + responseType: 'blob' + }) +} + +export function previewAttachmentByFileId(fileId) { + return request({ + url: `/finance/transaction/attachment/preview/file/${fileId}`, + method: 'get', + responseType: 'blob' + }) +} + +export function downloadAttachment(fileId, fileName) { + return request({ + url: `/finance/transaction/attachment/download/${fileId}`, + method: 'get', + params: { fileName }, + responseType: 'blob' + }) +} + +export function deleteAttachmentByFileId(fileId) { + return request({ + url: `/finance/transaction/attachment/file/${fileId}`, + method: 'delete', + params: { + userId: localStorage.getItem('userId') || '' + } + }) +} + +export function addTransactionOperation(data) { + return request({ + url: '/finance/transaction/operation', + method: 'post', + data + }) +} + +export function getTransactionOperationLogs(transactionId, query) { + return request({ + url: `/finance/transaction/${transactionId}`, + method: 'get' + }) +} + +// 获取所有收支账户 +export function getAllFinanceAccounts() { + return request({ + url: '/finance/account/list', + method: 'get' + }) +} + +// 账单调整相关接口 + +// 添加账单调整(按金额或按比例) +export function addBillAdjustment(data) { + return request({ + url: '/v1/bill-adjustments', + method: 'post', + data + }) +} + +// 作废账单调整 +export function voidBillAdjustment(data) { + return request({ + url: '/v1/bill-adjustments/void', + method: 'put', + data + }) +} + +// 分页查询账单调整记录 +export function getBillAdjustmentList(params) { + return request({ + url: '/v1/bill-adjustments', + method: 'get', + params + }) +} + +// 获取账单调整详情 +export function getBillAdjustmentDetail(id) { + return request({ + url: `/v1/bill-adjustments/${id}`, + method: 'get' + }) +} + +// 上传账单调整附件 +export function uploadBillAdjustmentAttachment(id, file) { + const formData = new FormData() + formData.append('file', file) + return request({ + url: `/v1/bill-adjustments/${id}/attachments`, + method: 'post', + data: formData, + headers: { + 'Content-Type': 'multipart/form-data' + } + }) +} + +// 删除账单调整附件 +export function deleteBillAdjustmentAttachment(attachmentId) { + return request({ + url: `/v1/bill-adjustments/attachments/${attachmentId}`, + method: 'delete' + }) +} + +// 获取账单明细 +export function getBillDetailById(detailId) { + return request({ + url: `/v1/bill-details/${detailId}`, + method: 'get' + }) +} + +// 获取账单调整附件列表 +export function getBillAdjustmentAttachmentList(adjustmentId) { + return request({ + url: `/v1/bill-adjustments/attachments/view/${adjustmentId}`, + method: 'get' + }) +} + +// 获取账单操作记录 +export function getBillOperationRecords(billId, params) { + return request({ + url: `/v1/operation-records/list/${billId}`, + method: 'get', + params + }) +} + +// 账单支付相关接口 +// 提交账单支付 +export function submitBillPayment(data) { + return request({ + url: '/v1/bill-payments', + method: 'post', + data + }) +} + +// 分页查询支付记录 +export function getBillPaymentRecords(params) { + return request({ + url: '/v1/bill-payments', + method: 'get', + params + }) +} + +// 获取支付详情 +export function getBillPaymentDetail(id) { + return request({ + url: `/v1/bill-payments/${id}`, + method: 'get' + }) +} + +// 上传支付附件 +export function uploadBillPaymentAttachment(id, file) { + const formData = new FormData() + formData.append('file', file) + return request({ + url: `/v1/bill-payments/${id}/attachments`, + method: 'post', + data: formData, + headers: { + 'Content-Type': 'multipart/form-data' + } + }) +} + +// 删除支付附件 +export function deleteBillPaymentAttachment(attachmentId) { + return request({ + url: `/v1/bill-payments/attachments/${attachmentId}`, + method: 'delete' + }) } \ No newline at end of file diff --git a/pc/src/components/RegionSelector.vue b/pc/src/components/RegionSelector.vue new file mode 100644 index 0000000..2713270 --- /dev/null +++ b/pc/src/components/RegionSelector.vue @@ -0,0 +1,136 @@ + + + + + + + \ No newline at end of file diff --git a/pc/src/router/modules/finance.js b/pc/src/router/modules/finance.js index c20f28b..af16121 100644 --- a/pc/src/router/modules/finance.js +++ b/pc/src/router/modules/finance.js @@ -30,6 +30,12 @@ export default { component: () => import('@/views/finance/billList/index.vue'), name: 'BillList', meta: { title: '所有账单', icon: 'el-icon-notebook-2' } + }, + { + path: 'transaction', + component: () => import('@/views/finance/transaction/index.vue'), + name: 'Transaction', + meta: { title: '收支流水', icon: 'el-icon-money' } } ] } \ No newline at end of file diff --git a/pc/src/views/finance/billList/components/AddBill.vue b/pc/src/views/finance/billList/components/AddBill.vue index 8371e23..6ed1402 100644 --- a/pc/src/views/finance/billList/components/AddBill.vue +++ b/pc/src/views/finance/billList/components/AddBill.vue @@ -5,8 +5,8 @@ - 含税 - 不含税 + 含税 + 不含税 @@ -14,18 +14,18 @@ - 正常 - 罚金 + 正常 + 罚金 - - + + - - + + - - + + @@ -64,8 +64,8 @@ - - + @@ -75,12 +75,12 @@ - - + + - + 预览 - 下载 删除 + + + + + + + + + + + + + 预览加载失败,请尝试下载后查看 + + 下载文件 + + + + + @@ -755,4 +933,45 @@ export default { color: #F56C6C; } } + +.preview-container { + min-height: 500px; + max-height: 700px; + overflow: auto; + + .preview-iframe { + width: 100%; + height: 500px; + border: none; + } + + .preview-image { + display: flex; + justify-content: center; + align-items: center; + min-height: 300px; + } + + .preview-error { + display: flex; + flex-direction: column; + align-items: center; + justify-content: center; + min-height: 300px; + color: #909399; + + i { + font-size: 48px; + margin-bottom: 20px; + } + + p { + font-size: 16px; + } + + .preview-actions { + margin-top: 20px; + } + } +} \ No newline at end of file diff --git a/pc/src/views/finance/billList/components/BillDetail.vue b/pc/src/views/finance/billList/components/BillDetail.vue index cc56d22..06b5ee4 100644 --- a/pc/src/views/finance/billList/components/BillDetail.vue +++ b/pc/src/views/finance/billList/components/BillDetail.vue @@ -2,22 +2,35 @@ + + + 账单信息 + + + + 账单支付 + + + - {{ billDetail.billNumber }} + {{ billDetail.totBillNo }} {{ getBillSourceName(billDetail.billSource) }} {{ billDetail.billStatus === '1' ? '开启' : '关闭' }} - {{ billDetail.payeeName }} + {{ billDetail.paysdName }} {{ billDetail.payeeContact }} {{ billDetail.contractNumber || '无' }} - {{ billDetail.feeTypeName }} + {{ billDetail.feTpName }} - {{ billDetail.billingStartDate }} 至 {{ billDetail.billingEndDate }} + {{ billDetail.chggBgnDt }} 至 {{ billDetail.chggEndDt }} - {{ billDetail.receivableDate }} + {{ billDetail.pybDt }} {{ getClearStatusName(billDetail.clearStatus) }} @@ -29,18 +42,18 @@ - - {{ getLateFeeStatusName(billDetail.lateFeeStatus) }} + + {{ getLateFeeStatusName(billDetail.ovdueStatus) }} - {{ formatAmount(billDetail.billAmount) }} - {{ formatAmount(billDetail.receivableAmount) }} - {{ formatAmount(billDetail.receivedAmount) }} + {{ formatAmount(billDetail.accblAmt) }} + {{ formatAmount(billDetail.accigRcvAmt) }} + {{ formatAmount(billDetail.atmRecvAmt) }} {{ formatAmount(billDetail.needAmount) }} - {{ formatAmount(billDetail.adjustAmount) }} - {{ formatAmount(billDetail.receivableLateFee) }} + {{ formatAmount(billDetail.adjAmt) }} + {{ formatAmount(billDetail.receivableOvdueAmt) }} {{ billDetail.taxRate }}% - {{ formatAmount(billDetail.taxAmount) }} + {{ formatAmount(billDetail.paybleTaxAmount) }} {{ billDetail.taxInclusiveRule }} {{ billDetail.specialBillType }} @@ -48,13 +61,121 @@ {{ billDetail.receiptStatus === '1' ? '已开据' : '未开据' }} - {{ billDetail.companyName }} + {{ billDetail.corNm }} {{ billDetail.rentArea }} ㎡ {{ billDetail.projectName }} {{ billDetail.billRemark || '无' }} + + + + + + {{ formatAmount(scope.row.receivableAmount) }} + + + + + {{ scope.row.taxRate }}% + + + + + {{ formatAmount(scope.row.taxAmount) }} + + + + + + + + + 调整 + + + + + + + + + + + + + + + + {{ scope.row.adjTpCd === '1' ? '调增' : '调减' }} + + + + + + {{ scope.row.adjMethod === '1' ? '按金额调整' : '按比例调整' }} + + + + + {{ formatAmount(scope.row.adjAmt) }} + + + + + {{ scope.row.adjRate ? scope.row.adjRate + '%' : '-' }} + + + + + + {{ scope.row.adjStatus === '1' ? '正常' : '作废' }} + + + + + + {{ scope.row.billDetailType === '1' ? '滞纳金' : '原账单' }} + + + + + {{ scope.row.adjSource === '1' ? '账单直接调整' : '合同调整' }} + + + + + + + 附件详情 + 作废 + + + + + + + + + + + + + + @@ -69,7 +190,19 @@ - + + + 添加附件 + 只能上传jpg/png/pdf文件,且不超过5MB + + + @@ -77,6 +210,7 @@ 预览 下载 + 删除 @@ -87,21 +221,289 @@ - - - - + + + + + + + + + + + + + + + + + + + + 预览加载失败,请尝试下载后查看 + + 下载文件 + + + + + + + + + + + + 调增 + 调减 + + + + + + + + + + + 按金额调整 + 按比例调整 + + + + + + + 调整后金额: {{ formatAmount(adjustedAmount) }} + + + + + + 调整后金额: {{ formatAmount(adjustedAmount) }} + + + + + + + + + + 添加附件 + 只能上传jpg/png/pdf文件,且不超过5MB + + + + + + + 预览 + 删除 + + + + + + + + + + + + + + + + + 预览 + 下载 + 删除 + + + + + + + + + + + + + + + 账单状态 + + + + {{ getClearStatusName(billDetail.clearStatus) }} + + + + + + + + 费用信息 + + {{ billDetail.feTpName }} + {{ formatAmount(billDetail.accigRcvAmt) }} + {{ formatAmount(billDetail.atmRecvAmt) }} + {{ formatAmount(billDetail.needAmount) }} + + + + + + + 收完 + + + + + {{ formatAmount(remainingAmount) }} + + + + + + + + + + + 支付方式 + + + + + + + + + + + + + + + + + + + + + + + + 附件信息 + + + 添加附件 + 只能上传jpg/png/pdf文件,且不超过5MB + + + + + + + + 预览 + 删除 + + + + + + + \ No newline at end of file diff --git a/pc/src/views/finance/billList/index.vue b/pc/src/views/finance/billList/index.vue index 4a9bbef..9eb4dba 100644 --- a/pc/src/views/finance/billList/index.vue +++ b/pc/src/views/finance/billList/index.vue @@ -2,17 +2,17 @@ - - + + - - + + - - + + @@ -20,7 +20,7 @@ - + - + - - + + @@ -89,25 +89,25 @@ - - + + - {{ scope.row.billAmount ? scope.row.billAmount.toFixed(2) : '0.00' }} + {{ scope.row.accblAmt ? scope.row.accblAmt.toFixed(2) : '0.00' }} - + - {{ scope.row.receivableAmount ? scope.row.receivableAmount.toFixed(2) : '0.00' }} + {{ scope.row.accigRcvAmt ? scope.row.accigRcvAmt.toFixed(2) : '0.00' }} - + - {{ scope.row.receivedAmount ? scope.row.receivedAmount.toFixed(2) : '0.00' }} + {{ scope.row.atmRecvAmt ? scope.row.atmRecvAmt.toFixed(2) : '0.00' }} - - - + + + 查看 @@ -171,10 +171,10 @@ export default { queryParams: { pageNum: 1, pageSize: 10, - contractNumber: '', + contractNo: '', roomNumber: '', - payeeName: '', - billNumber: '', + paysdName: '', + totBillNo: '', billStatus: [], receivableDateStart: '', receivableDateEnd: '', @@ -217,7 +217,7 @@ export default { } getBillList(queryParams).then(response => { - this.billList = response.data.data || [] + this.billList = response.data.list || [] this.total = response.data.total this.loading = false }).catch(() => { @@ -250,10 +250,10 @@ export default { children = category.financeFeeTypes.map(feeType => { return { id: feeType.id || Math.random().toString(36).substr(2, 9), - label: feeType.feeTypeName || '未命名费用', + label: feeType.feTpName || '未命名费用', categoryId: categoryId, // 存储原始数据以便后续使用 - feeTypeName: feeType.feeTypeName || '未命名费用', + feTpName: feeType.feTpName || '未命名费用', // 确保没有更多的子节点 children: null } @@ -353,12 +353,28 @@ export default { this.$refs.addBillForm.validateForm().then(valid => { if (valid) { const billData = this.$refs.addBillForm.getFormData() + billData.billType = 1 + billData.billSource = 3 + addBill(billData).then(response => { - this.$message.success('添加账单成功') - this.dialogVisible = false - this.getList() + if (response.code === '0000000000000000') { + this.$message.success('添加账单成功') + + // 如果有附件,上传附件 + const fileList = this.$refs.addBillForm.fileList + if (fileList && fileList.length > 0) { + this.$refs.addBillForm.uploadAttachments(response.data) + // 上传附件由组件内部处理后续流程,不需要在这里关闭弹窗 + } else { + this.dialogVisible = false + this.getList() + } + } else { + this.$message.error(response.message || '添加账单失败') + } }).catch(() => { // 错误处理 + this.$message.error('添加账单失败') }) } }) diff --git a/pc/src/views/finance/transaction/components/TransactionDetail.vue b/pc/src/views/finance/transaction/components/TransactionDetail.vue new file mode 100644 index 0000000..ac342a0 --- /dev/null +++ b/pc/src/views/finance/transaction/components/TransactionDetail.vue @@ -0,0 +1,520 @@ + + + + + + + + + 总体信息 + + + {{ detailData.totalInfo && detailData.totalInfo.unitName || '-' }} + + {{ formatAmount(detailData.totalInfo && detailData.totalInfo.totalAmount) }} + + + {{ formatAmount(detailData.totalInfo && detailData.totalInfo.matchedAmount) }} + + + {{ formatAmount(detailData.totalInfo && detailData.totalInfo.unmatchedAmount) }} + + + + + + + + + + 流水信息 + + + + + {{ (detailData.transaction && detailData.transaction.dcFlagCode === '0') ? '借(支出)' : '贷(收入)' }} + + + + {{ formatAmount(detailData.transaction && detailData.transaction.occuAmt) }} + + {{ detailData.transaction && detailData.transaction.inaccDate || '-' }} + {{ detailData.transaction && detailData.transaction.unitName || '-' }} + {{ getPaymentModeName(detailData.transaction && detailData.transaction.payModeName) }} + {{ detailData.transaction && detailData.transaction.opsAccname || '-' }} + {{ detailData.transaction && detailData.transaction.txVchrNo || '-' }} + {{ detailData.transaction && detailData.transaction.receiptNo || '-' }} + {{ detailData.transaction && detailData.transaction.conterName || '-' }} + {{ detailData.transaction && detailData.transaction.openaccBankName || '-' }} + {{ detailData.transaction && detailData.transaction.summ || '-' }} + {{ detailData.transaction && detailData.transaction.remark || '-' }} + + + + + + + + + 匹配账单 + + + + + + + {{ scope.row.billingStartDate || '-' }} 至 {{ scope.row.billingEndDate || '-' }} + + + + + {{ formatAmount(scope.row.receivableAmount) }} + + + + + 暂无匹配账单 + + + + + + + + + 附件信息 + + 添加附件 + + + + + + + + + 预览 + 下载 + 删除 + + + + + 暂无附件 + + + + + + + 点击上传 + 只能上传jpg/png/pdf文件,且不超过5MB + + + + + + + + + + 操作记录 + + + + + + + + 暂无操作记录 + + + + + + + + + + + + + + + + + + + 预览加载失败,请尝试下载后查看 + + 下载文件 + + + + + + + + + + + \ No newline at end of file diff --git a/pc/src/views/finance/transaction/index.vue b/pc/src/views/finance/transaction/index.vue new file mode 100644 index 0000000..7b19f8a --- /dev/null +++ b/pc/src/views/finance/transaction/index.vue @@ -0,0 +1,352 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + + + + 搜索 + 重置 + + 导出 + + + + + + + {{ scope.row.projectName }} - {{ scope.row.buildingName }} + + + + + + + + + + {{ scope.row.dcFlagCode === '0' ? '借(支出)' : '贷(收入)' }} + + + + + + {{ scope.row.occuAmt ? parseFloat(scope.row.occuAmt).toFixed(2) : '0.00' }} + + + + + {{ getCurrencyName(scope.row.currCode) }} + + + + + {{ getPaymentModeName(scope.row.payModeName) }} + + + + + + + {{ getStatusName(scope.row.transactionStatus) }} + + + + + + + 查看 + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/pc/src/views/project/index.vue b/pc/src/views/project/index.vue index e66e3bf..5cd2590 100644 --- a/pc/src/views/project/index.vue +++ b/pc/src/views/project/index.vue @@ -63,7 +63,7 @@ - + 搜索 @@ -133,7 +133,7 @@ - + @@ -223,9 +223,13 @@
预览加载失败,请尝试下载后查看