From 2db7276a87853a241ea7d528453420e7ce45a443 Mon Sep 17 00:00:00 2001 From: fengachen <373943794@qq.com> Date: Tue, 8 Nov 2022 18:02:21 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90=E4=BF=AE=E6=94=B9=E3=80=91=E5=88=B0?= =?UTF-8?q?=E8=B4=A6=E5=BC=80=E7=A5=A8=20=E6=9D=A5=E6=AC=BE=20=E5=BC=80?= =?UTF-8?q?=E7=A5=A8=20=E7=A1=AE=E8=AE=A4=E6=94=B6=E5=85=A5=E5=A2=9E?= =?UTF-8?q?=E5=8A=A0=E7=A8=8E=E7=8E=87=E9=80=89=E6=8B=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../modules/ArriveModule.vue | 29 ++++++++++++++++--- .../modules/ConfirmModule.vue | 24 ++++++++++++++- .../modules/InvoicingModule.vue | 27 +++++++++++++++-- 3 files changed, 73 insertions(+), 7 deletions(-) diff --git a/src/views/financialManagement/arriveAndInvoicing/modules/ArriveModule.vue b/src/views/financialManagement/arriveAndInvoicing/modules/ArriveModule.vue index 9838300..c10f66e 100644 --- a/src/views/financialManagement/arriveAndInvoicing/modules/ArriveModule.vue +++ b/src/views/financialManagement/arriveAndInvoicing/modules/ArriveModule.vue @@ -18,18 +18,22 @@ @blur="addZeroAmount" @change="e => e.target.value = (e.target.value.replace(/[^0-9-.]/g, '')).trim()"> + + + @@ -58,10 +62,11 @@ import JDate from '../../../../components/tools/JDate' import { addPaymentPhase, editAmountPhase } from '../../../../api/incomePaymentsApi' import { addZero } from '../../../../utils/util' import { TaxOperateMixin } from './TaxOperateMixin' +import JDictSelectTag from '@comp/dict/JDictSelectTag' export default { name: 'ArriveModule', - components: { JDate }, + components: { JDate,JDictSelectTag }, mixins: [TaxOperateMixin], props: { // 项目id @@ -110,6 +115,10 @@ export default { rules: [{ required: true, validator: this.checkMoney }], validateTrigger: 'blur' }, + taxRate: { + rules: [{ required: true,message: '请选择税率' }], + validateTrigger: 'change',initialValue:'0.06' + }, noTaxAmount: { rules: [{required: true, validator: this.checkNoTaxMoney}], validateTrigger: 'blur' @@ -130,12 +139,24 @@ export default { add() { this.edit({}) }, + /** + * 改变税率计算 到账金额 与税额 + * */ + changeRate(val){ + this.taxRate = val + let amount = this.form.getFieldValue('amountReceived') + if(!amount) return + let obj = this.calcOtherNumber(amount) + this.$nextTick(() => { + this.form.setFieldsValue( {tax:obj.noTaxAmount,noTaxAmount: obj.tax}) + }) + }, edit(record) { this.form.resetFields() this.model = Object.assign({}, record) this.visible = true this.$nextTick(() => { - this.form.setFieldsValue(pick(this.model, 'amountReceived', 'tax', 'noTaxAmount', 'paymentDate', 'remark')) + this.form.setFieldsValue(pick(this.model, 'amountReceived', 'tax', 'taxRate','noTaxAmount', 'paymentDate', 'remark')) }) }, handleOk() { diff --git a/src/views/financialManagement/arriveAndInvoicing/modules/ConfirmModule.vue b/src/views/financialManagement/arriveAndInvoicing/modules/ConfirmModule.vue index 9c23e27..abe43c7 100644 --- a/src/views/financialManagement/arriveAndInvoicing/modules/ConfirmModule.vue +++ b/src/views/financialManagement/arriveAndInvoicing/modules/ConfirmModule.vue @@ -19,10 +19,15 @@ @blur="addZeroAmount" @change="e => e.target.value = (e.target.value.replace(/[^0-9-.]/g, '')).trim()"> + + + @@ -30,6 +35,7 @@ @@ -101,6 +107,10 @@ export default { rules: [{required: true, validator: this.checkMoney}], validateTrigger: 'blur' }, + taxRate: { + rules: [{ required: true,message: '请选择税率' }], + validateTrigger: 'change',initialValue:'0.06' + }, noTaxAmount: { rules: [{required: true, validator: this.checkNoTaxMoney}], validateTrigger: 'blur' @@ -118,6 +128,18 @@ export default { }, methods: { addZero, + /** + * 改变税率计算 到账金额 与税额 + * */ + changeRate(val){ + this.taxRate = val + let amount = this.form.getFieldValue('amountReceived') + if(!amount) return + let obj = this.calcOtherNumber(amount) + this.$nextTick(() => { + this.form.setFieldsValue( {tax:obj.noTaxAmount,noTaxAmount: obj.tax}) + }) + }, add(projectInfo, isFirst) { let currentDate = new Date() @@ -156,7 +178,7 @@ export default { this.taxRate = this.projectInfo.needInvoice ? 0.06 : 0 this.visible = true this.$nextTick(() => { - this.form.setFieldsValue(pick(this.model, 'amountReceived', 'tax', 'noTaxAmount','paymentDate', 'remark')) + this.form.setFieldsValue(pick(this.model, 'amountReceived', 'tax','taxRate', 'noTaxAmount','paymentDate', 'remark')) }) }, getInfoById(id) { diff --git a/src/views/financialManagement/arriveAndInvoicing/modules/InvoicingModule.vue b/src/views/financialManagement/arriveAndInvoicing/modules/InvoicingModule.vue index 5e0c41e..7e68da8 100644 --- a/src/views/financialManagement/arriveAndInvoicing/modules/InvoicingModule.vue +++ b/src/views/financialManagement/arriveAndInvoicing/modules/InvoicingModule.vue @@ -18,10 +18,15 @@ @blur="addZeroAmount" @change="e => e.target.value = (e.target.value.replace(/[^0-9.-]/g, '')).trim()"> + + + @@ -29,6 +34,7 @@ @@ -65,10 +71,11 @@ import { addPayBill, editPayBill } from '../../../../api/incomePaymentsApi' import { addZero } from '../../../../utils/util' import { getContactsById } from '../../../../api/api' import {TaxOperateMixin} from './TaxOperateMixin' +import JDictSelectTag from '@comp/dict/JDictSelectTag' export default { name: 'InvoicingModule', - components: { JDate }, + components: { JDate,JDictSelectTag }, mixins: [TaxOperateMixin], props: { // 项目id @@ -123,6 +130,10 @@ export default { rules: [{ required: true, validator: this.checkMoney }], validateTrigger: 'blur' }, + taxRate: { + rules: [{ required: true,message: '请选择税率' }], + validateTrigger: 'change',initialValue:'0.06' + }, noTaxAmount: { rules: [{required: true, validator: this.checkNoTaxMoney}], validateTrigger: 'blur' @@ -146,6 +157,18 @@ export default { }, methods: { addZero, + /** + * 改变税率计算 到账金额 与税额 + * */ + changeRate(val){ + this.taxRate = val + let amount = this.form.getFieldValue('invoiceAmount') + if(!amount) return + let obj = this.calcOtherNumber(amount) + this.$nextTick(() => { + this.form.setFieldsValue( {tax:obj.noTaxAmount,noTaxAmount: obj.tax}) + }) + }, add() { this.edit({}) }, @@ -155,7 +178,7 @@ export default { this.getMailContactPostalCode() this.visible = true this.$nextTick(() => { - this.form.setFieldsValue(pick(this.model, 'invoiceAmount', 'tax', 'noTaxAmount', 'billNo', 'billDate', 'remark')) + this.form.setFieldsValue(pick(this.model, 'invoiceAmount', 'tax','taxRate', 'noTaxAmount', 'billNo', 'billDate', 'remark')) }) }, getMailContactPostalCode() {