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 @@