diff --git a/src/components/repayment/components/pro.vue b/src/components/repayment/components/pro.vue index dd1a583..fae1a18 100644 --- a/src/components/repayment/components/pro.vue +++ b/src/components/repayment/components/pro.vue @@ -84,7 +84,7 @@ export default { }, confirm() { this.dialogVisible = false; - this.form.proList = { ...this.list }; + this.form.proList = [...this.list]; this.$emit("proData", this.form); }, getSummaries(param) { diff --git a/src/components/repayment/components/rec.vue b/src/components/repayment/components/rec.vue index ad4276f..cfbde7a 100644 --- a/src/components/repayment/components/rec.vue +++ b/src/components/repayment/components/rec.vue @@ -48,6 +48,7 @@ export default { row.payMoney = 0; } let form = { ...row }; + form.cardOver = (form.cardRestMoney - form.payMoney).toFixed(2) * 1; this.recIndex = -1; this.list.splice(index, 1, form); this.sumPay(); @@ -81,7 +82,7 @@ export default { }, confirm() { this.dialogVisible = false; - this.form.recList = { ...this.list }; + this.form.recList = [...this.list]; this.$emit("recData", this.form); }, getSummaries(param) { diff --git a/src/components/repayment/index.vue b/src/components/repayment/index.vue index a8cad52..82ec5f6 100644 --- a/src/components/repayment/index.vue +++ b/src/components/repayment/index.vue @@ -110,10 +110,10 @@ @@ -247,21 +247,28 @@ export default { this.$refs.pro.show(row); }, proData(v) { - console.log(v); - // if (v.payNumber > 0) { - // var number = 0; - // this.list.forEach((item, index) => { - // item.proList.forEach((items) => { - // if (index == v.index) { - // number = items.payNumber; - // } else { - // if (items.payNumber == 0) { - // items.courseRestCount = items.courseRestCount - items.payNumber; - // } - // } - // }); - // }); - // } + if (v.courseMoney > 0) { + var list = []; + v.proList.forEach((item) => { + item.courseConsumeCount = item.courseConsumeCount - item.payNumber; + item.courseRestCount = item.courseRestCount - item.payNumber; + list.push(item); + }); + this.list.forEach((item) => { + let proList = []; + if (item.index != v.index) { + item.proList.forEach((items, indexs) => { + if (items.payNumber == 0) { + list[indexs].payNumber = 0; + list[indexs].payMoney = 0; + items = list[indexs]; + } + proList.push(items); + }); + } + item.proList = proList; + }); + } this.list.splice(v.index, 1, v); this.sumList(); }, @@ -269,10 +276,31 @@ export default { this.$refs.rec.show(row); }, recData(v) { + if (v.recMoney > 0) { + var list = []; + v.recList.forEach((item) => { + item.cardRestMoney = item.cardRestMoney - item.payMoney; + item.cardConsumeMoney = item.cardConsumeMoney - item.payMoney; + list.push(item); + }); + this.list.forEach((item) => { + let recList = []; + if (item.index != v.index) { + item.recList.forEach((items, indexs) => { + if (items.payMoney == 0) { + list[indexs].payMoney = 0; + items = list[indexs]; + } + recList.push(items); + console.log(recList); + }); + } + item.recList = recList; + }); + } this.list.splice(v.index, 1, v); this.sumList(); }, - //关闭弹窗前的回调方法 handleClose() { this.form = Object.assign({});