【修改】支出合 金额联动
This commit is contained in:
@@ -38,6 +38,7 @@
|
|||||||
:maxLength='50'
|
:maxLength='50'
|
||||||
v-bind="$attrs"
|
v-bind="$attrs"
|
||||||
@blur="addZero"
|
@blur="addZero"
|
||||||
|
@input="changePaidAmount"
|
||||||
@change="(e) => {e.target.value = (e.target.value.replace(/[^0-9.]/g,'')).trim()}"></a-input>
|
@change="(e) => {e.target.value = (e.target.value.replace(/[^0-9.]/g,'')).trim()}"></a-input>
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
</a-col>
|
</a-col>
|
||||||
@@ -118,6 +119,17 @@ export default {
|
|||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
addZero,
|
addZero,
|
||||||
|
// 修改
|
||||||
|
changePaidAmount(){
|
||||||
|
// 计算分阶段应收 款总和
|
||||||
|
let money = this.form.getFieldsValue().installmentList.reduce((total,current) => {
|
||||||
|
return total + Number(current.paidAmount)
|
||||||
|
},0)
|
||||||
|
|
||||||
|
this.$emit('editPaidAmount',money)
|
||||||
|
|
||||||
|
// console.log(this.form.getFieldsValue().installmentList,'this.form.getFieldValue()this.form.getFieldValue()')
|
||||||
|
},
|
||||||
/**
|
/**
|
||||||
* 初始化分期信息列表
|
* 初始化分期信息列表
|
||||||
* @param record
|
* @param record
|
||||||
|
|||||||
+2
-1
@@ -619,7 +619,7 @@ export function addZero(e) {
|
|||||||
// (e) => {e.target.value = e.target.value.replace(/[^0-9.]/g,'')}
|
// (e) => {e.target.value = e.target.value.replace(/[^0-9.]/g,'')}
|
||||||
// console.log(e.target.value)
|
// console.log(e.target.value)
|
||||||
// 判断是否包含 .
|
// 判断是否包含 .
|
||||||
let value = e.target.value
|
let value = e.target.value.toString()
|
||||||
// 判断是否有数据
|
// 判断是否有数据
|
||||||
if (value && value !== '') {
|
if (value && value !== '') {
|
||||||
// 判断是否包含小数点
|
// 判断是否包含小数点
|
||||||
@@ -642,6 +642,7 @@ export function addZero(e) {
|
|||||||
} else {
|
} else {
|
||||||
// 不包括小数点
|
// 不包括小数点
|
||||||
e.target.value = e.target.value + '.00'
|
e.target.value = e.target.value + '.00'
|
||||||
|
return e.target.value
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+13
-1
@@ -278,7 +278,7 @@
|
|||||||
<div class="part-title">
|
<div class="part-title">
|
||||||
<div class="part-title-text">分期信息</div>
|
<div class="part-title-text">分期信息</div>
|
||||||
</div>
|
</div>
|
||||||
<installment-form ref="installmentForm" @ok="installmentFormOk" label="付"></installment-form>
|
<installment-form ref="installmentForm" @ok="installmentFormOk" @editPaidAmount="editPaidAmount" label="付"></installment-form>
|
||||||
</div>
|
</div>
|
||||||
<!-- /分期信息-->
|
<!-- /分期信息-->
|
||||||
<a-form-item class="table-operator">
|
<a-form-item class="table-operator">
|
||||||
@@ -438,6 +438,17 @@ export default {
|
|||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
addZero,
|
addZero,
|
||||||
|
/**
|
||||||
|
* 修改分期应收款触发的方法
|
||||||
|
* @param {Number} money 分期实付总数
|
||||||
|
* */
|
||||||
|
editPaidAmount(money){
|
||||||
|
let num = this.addZero({target:{value:money+''}})
|
||||||
|
this.form.setFieldsValue({'amountReceived':num})
|
||||||
|
this.amountReceivedNum = money
|
||||||
|
this.accountsReceivableNum = this.form.getFieldValue('accountsReceivableAmount')
|
||||||
|
this.calculateOutstandingAmount()
|
||||||
|
},
|
||||||
add() {
|
add() {
|
||||||
this.title = '新建支出合同'
|
this.title = '新建支出合同'
|
||||||
this.$refs.installmentForm.initInstallmentList([])
|
this.$refs.installmentForm.initInstallmentList([])
|
||||||
@@ -729,6 +740,7 @@ export default {
|
|||||||
* @param value
|
* @param value
|
||||||
*/
|
*/
|
||||||
amountReceivedChange(e) {
|
amountReceivedChange(e) {
|
||||||
|
console.log('amountReceivedChange')
|
||||||
e.target.value = (e.target.value.replace(/[^0-9.]/g, '')).trim()
|
e.target.value = (e.target.value.replace(/[^0-9.]/g, '')).trim()
|
||||||
this.amountReceivedNum = e.target.value
|
this.amountReceivedNum = e.target.value
|
||||||
this.calculateOutstandingAmount()
|
this.calculateOutstandingAmount()
|
||||||
|
|||||||
Reference in New Issue
Block a user