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