From d3bbf2da62ad06feb4aecda2f6b2f1d18d3a3fde Mon Sep 17 00:00:00 2001 From: chenhao Date: Tue, 23 Dec 2025 19:52:57 +0800 Subject: [PATCH] =?UTF-8?q?feat(finance):=20=E6=9B=B4=E6=96=B0=E5=BC=80?= =?UTF-8?q?=E7=A5=A8=E5=8D=95=E8=AF=A6=E6=83=85=E5=92=8C=E6=93=8D=E4=BD=9C?= =?UTF-8?q?=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 修改详情抽屉中的字段显示,将创建时间改为预计开票时间 - 添加开票状态、审批节点、审批状态和审批通过时间显示 - 更新销售-应收单表格的数据源和字段映射 - 扩展操作列宽度以适应更多按钮 - 添加发票按钮的显示条件控制 - 添加申请开票按钮的显示条件控制 - 添加申请红冲按钮的显示条件控制 - 实现撤销功能按钮和相关逻辑 - 添加撤销发票API接口 - 优化票据类型选择的交互逻辑 - 添加发票金额验证和自动计算功能 - 实现附件上传的权限控制 - 完善发票撤销的业务逻辑处理 --- oms_web/oms_vue/src/api/finance/invoice.js | 8 ++ .../invoice/components/DetailDrawer.vue | 67 +++++----- .../invoice/components/InvoiceDialog.vue | 115 +++++++++++++----- .../src/views/finance/invoice/index.vue | 24 +++- .../controller/OmsInvoiceBillController.java | 23 +++- .../com/ruoyi/sip/domain/OmsInvoiceBill.java | 4 + .../sip/mapper/OmsInvoiceBillMapper.java | 3 + .../OmsReceivableInvoiceDetailMapper.java | 6 + .../sip/service/IOmsFinAttachmentService.java | 6 +- .../sip/service/IOmsInvoiceBillService.java | 3 + .../IOmsReceivableInvoiceDetailService.java | 5 + .../impl/OmsFinAttachmentServiceImpl.java | 3 +- .../impl/OmsInvoiceBillServiceImpl.java | 93 +++++++++++--- ...OmsReceivableInvoiceDetailServiceImpl.java | 40 ++++++ .../mapper/sip/OmsInvoiceBillMapper.xml | 28 ++++- .../sip/OmsReceivableInvoiceDetailMapper.xml | 30 +++++ .../sip/OmsReceivableReceiptDetailMapper.xml | 2 +- 17 files changed, 364 insertions(+), 96 deletions(-) diff --git a/oms_web/oms_vue/src/api/finance/invoice.js b/oms_web/oms_vue/src/api/finance/invoice.js index 9fb039df..f619ffba 100644 --- a/oms_web/oms_vue/src/api/finance/invoice.js +++ b/oms_web/oms_vue/src/api/finance/invoice.js @@ -82,3 +82,11 @@ export function applyInvoice(data) { data: data }) } + +// 撤销销售收票单 +export function revokeInvoice(id) { + return request({ + url: '/finance/invoice/revoke/' + id, + method: 'delete' + }) +} diff --git a/oms_web/oms_vue/src/views/finance/invoice/components/DetailDrawer.vue b/oms_web/oms_vue/src/views/finance/invoice/components/DetailDrawer.vue index cfbcd1da..b90bb89d 100644 --- a/oms_web/oms_vue/src/views/finance/invoice/components/DetailDrawer.vue +++ b/oms_web/oms_vue/src/views/finance/invoice/components/DetailDrawer.vue @@ -15,7 +15,7 @@
销售-开票单编号: {{ detail.invoiceBillCode }}
-
销售-生成时间: {{ detail.createTime }}
+
预计开票时间: {{ detail.createTime }}
进货商名称: {{ detail.partnerName }}
@@ -45,14 +45,28 @@
- -
票据类型: - + +
开票状态: +
- -
发票/红冲: - {{detail.totalPriceWithTax<0?'红冲票据':'正常票据'}} + +
审批节点: {{ detail.approveNode }}
+
+ +
审批状态: +
+
+ + + + +
审批通过时间 :{{detail.approveTime}} +
+
+ +
票据类型: +
@@ -92,45 +106,20 @@ - - -
备注: {{ detail.remark }}
-
- -
上传人姓名: {{ detail.createByName }}
-
- -
开票状态: - -
-
-
- - -
审批节点: {{ detail.approveNode }}
-
- -
审批状态: -
-
- -
审批通过时间 :{{detail.approveTime}} -
-
-
+
销售-应收单 - + - + - - - - + + + +
diff --git a/oms_web/oms_vue/src/views/finance/invoice/components/InvoiceDialog.vue b/oms_web/oms_vue/src/views/finance/invoice/components/InvoiceDialog.vue index a7c2c6a0..e78264e3 100644 --- a/oms_web/oms_vue/src/views/finance/invoice/components/InvoiceDialog.vue +++ b/oms_web/oms_vue/src/views/finance/invoice/components/InvoiceDialog.vue @@ -5,7 +5,7 @@
- 上传{{ titleText }} + 上传{{ titleText }}
@@ -20,7 +20,7 @@
票据类型 - +
{{ titleText }} @@ -113,8 +113,8 @@ - - + + - +
- {{ invoiceData.invoicePriceWithTax }} + {{ invoiceData.totalPriceWithTax }} - - + + - {{ invoiceData.invoicePriceWithoutTax }} + {{ invoiceData.totalPriceWithoutTax }} - - + + {{ invoiceData.taxAmount }} - - + + { const data = response.data || []; data.sort((a, b) => new Date(b.createTime) - new Date(a.createTime)); @@ -339,10 +339,10 @@ export default { // New Upload Dialog Methods openUploadDialog() { this.uploadForm = { - ticketPriceWithTax: '', - ticketPriceWithoutTax: '', - ticketAmount: '', - ticketType: '', + invoicePriceWithTax: '', + invoicePriceWithoutTax: '', + invoiceAmount: '', + invoiceType: '', remark: '', file: null }; @@ -358,6 +358,26 @@ export default { this.uploadForm.file = null; this.previewUrl = ''; }, + handleTypeChange(val) { + if (val === '2') { + this.uploadForm.invoiceAmount = '0'; + this.handleAmountChange('0'); + } + }, + handleWithoutTaxChange(val) { + const total = parseFloat(this.uploadForm.invoicePriceWithTax); + const withoutTax = parseFloat(val); + if (!isNaN(total) && !isNaN(withoutTax)) { + this.uploadForm.invoiceAmount = (total - withoutTax).toFixed(2); + } + }, + handleAmountChange(val) { + const total = parseFloat(this.uploadForm.invoicePriceWithTax); + const tax = parseFloat(val); + if (!isNaN(total) && !isNaN(tax)) { + this.uploadForm.invoicePriceWithoutTax = (total - tax).toFixed(2); + } + }, handleFileChange(file) { const isLt2M = file.size / 1024 / 1024 < 2; const isAcceptedType = ['image/jpeg', 'image/png', 'application/pdf'].includes(file.raw.type); @@ -388,15 +408,50 @@ export default { return; } + const limitTotal = parseFloat(this.invoiceData.totalPriceWithTax); + const inputTotal = parseFloat(this.uploadForm.invoicePriceWithTax); + const inputWithoutTax = parseFloat(this.uploadForm.invoicePriceWithoutTax); + const inputTax = parseFloat(this.uploadForm.invoiceAmount); + + if (!isNaN(limitTotal)) { + if (limitTotal >= 0) { + if (!isNaN(inputTotal) && inputTotal > limitTotal) { + this.$message.warning("发票含税总价不能超过开票单含税总价"); + return; + } + if (!isNaN(inputWithoutTax) && inputWithoutTax < 0) { + this.$message.warning("发票未税总价不能为负数"); + return; + } + if (!isNaN(inputTax) && inputTax < 0) { + this.$message.warning("发票税额不能为负数"); + return; + } + } else { + if (!isNaN(inputTotal) && inputTotal < limitTotal) { + this.$message.warning("发票含税总价不能小于开票单含税总价"); + return; + } + if (!isNaN(inputWithoutTax) && inputWithoutTax > 0) { + this.$message.warning("发票未税总价不能为正数"); + return; + } + if (!isNaN(inputTax) && inputTax > 0) { + this.$message.warning("发票税额不能为正数"); + return; + } + } + } + const formData = new FormData(); formData.append("file", this.uploadForm.file); formData.append("id", this.invoiceData.id); formData.append("remark", this.uploadForm.remark); - formData.append("ticketPriceWithTax", this.uploadForm.ticketPriceWithTax); - formData.append("ticketPriceWithoutTax", this.uploadForm.ticketPriceWithoutTax); - formData.append("ticketAmount", this.uploadForm.ticketAmount); - formData.append("ticketType", this.uploadForm.ticketType); - + formData.append("invoicePriceWithTax", this.uploadForm.invoicePriceWithTax); + formData.append("invoicePriceWithoutTax", this.uploadForm.invoicePriceWithoutTax); + formData.append("invoiceAmount", this.uploadForm.invoiceAmount); + formData.append("invoiceType", this.uploadForm.invoiceType); + this.invoiceData.invoiceType=this.uploadForm.invoiceType uploadInvoiceAttachment(formData) .then(response => { this.$message.success("上传成功"); diff --git a/oms_web/oms_vue/src/views/finance/invoice/index.vue b/oms_web/oms_vue/src/views/finance/invoice/index.vue index 7ba34260..377a15bd 100644 --- a/oms_web/oms_vue/src/views/finance/invoice/index.vue +++ b/oms_web/oms_vue/src/views/finance/invoice/index.vue @@ -158,7 +158,7 @@ - + @@ -217,7 +226,7 @@