From a432c580320b47a695b6736b6a3e614535b591d8 Mon Sep 17 00:00:00 2001 From: tianyongbao Date: Thu, 12 Feb 2026 19:38:58 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E5=8A=9F=E8=83=BD=E4=BC=98=E5=8C=96?= =?UTF-8?q?=E5=AE=8C=E5=96=84=EF=BC=8C=E5=88=86=E6=9C=9F=E5=BE=85=E8=BF=98?= =?UTF-8?q?=E7=9B=B8=E5=85=B3=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../creditInstallmentAnalysis/index.vue | 28 +++- src/views/invest/onlineLendAnalysis/index.vue | 143 +++++++++++++++++- src/views/invest/onlineLendHistory/index.vue | 19 +++ 3 files changed, 179 insertions(+), 11 deletions(-) diff --git a/src/views/invest/creditInstallmentAnalysis/index.vue b/src/views/invest/creditInstallmentAnalysis/index.vue index 13f24fd..d164b73 100644 --- a/src/views/invest/creditInstallmentAnalysis/index.vue +++ b/src/views/invest/creditInstallmentAnalysis/index.vue @@ -148,17 +148,26 @@
- + - + - + @@ -293,7 +302,8 @@ const historyObj = ref({ dueDetail: '', repaidDetail: '', leftDetail: '', - historyDetailList: [] + historyDetailList: [], + tableHistoryDetailList: [] }) const chartData = ref({ @@ -301,6 +311,14 @@ const chartData = ref({ value1: [] }) +// 计算属性:倒序后的表格数据 +const reversedTableData = computed(() => { + if (historyObj.value.tableHistoryDetailList && historyObj.value.tableHistoryDetailList.length > 0) { + return [...historyObj.value.tableHistoryDetailList].reverse() + } + return [] +}) + function getList() { loading.value = true chartData.value = { name: [], value1: [] } diff --git a/src/views/invest/onlineLendAnalysis/index.vue b/src/views/invest/onlineLendAnalysis/index.vue index 07266ec..5059047 100644 --- a/src/views/invest/onlineLendAnalysis/index.vue +++ b/src/views/invest/onlineLendAnalysis/index.vue @@ -148,22 +148,86 @@
- + - + - +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -196,6 +260,7 @@ const dates = [ const loading = ref(true) const total = ref(0) const radioVal = ref('柱状图') +const repaymentOpen = ref(false) const creditCardList = ref([]) const dateValidate = (rules, value, callback) => { @@ -231,10 +296,26 @@ const data = reactive({ }, rules: { time: [{ validator: dateValidate, dateType: 'months', num: 35, dateRange: '月', message: '时间跨度不能大于36个月,默认选择开始日期的36个月' }] + }, + repaymentForm: { + id: null, + bankCardLendName: '', + repaymentDate: '', + principal: 0, + interest: 0, + currentAmount: 0, + postingState: '1', + remark: '' + }, + repaymentRules: { + repaymentDate: [{ required: true, message: '还款日期不能为空', trigger: 'blur' }], + principal: [{ required: true, message: '应还本金不能为空', trigger: 'blur' }], + interest: [{ required: true, message: '应还利息不能为空', trigger: 'blur' }], + postingState: [{ required: true, message: '还款状态不能为空', trigger: 'change' }] } }) -const { queryParams, queryCreditCardParams, rules } = toRefs(data) +const { queryParams, queryCreditCardParams, rules, repaymentForm, repaymentRules } = toRefs(data) const handleCreditChange = (id) => { queryParams.value.id = id getList() @@ -294,7 +375,8 @@ const historyObj = ref({ dueDetail: '', repaidDetail: '', leftDetail: '', - historyDetailList: [] + historyDetailList: [], + tableHistoryDetailList: [] }) const chartData = ref({ @@ -302,6 +384,14 @@ const chartData = ref({ value1: [] }) +// 计算属性:倒序后的表格数据 +const reversedTableData = computed(() => { + if (historyObj.value.tableHistoryDetailList && historyObj.value.tableHistoryDetailList.length > 0) { + return [...historyObj.value.tableHistoryDetailList].reverse() + } + return [] +}) + function getList() { loading.value = true chartData.value = { name: [], value1: [] } @@ -537,6 +627,47 @@ const handleRadioChange = (type) => { break } } + +/** 还款按钮操作 */ +function handleRepayment(item) { + repaymentForm.value = { + id: item.id, + bankCardLendName: item.bankCardLendName, + repaymentDate: dayjs(new Date().getTime()).format('YYYY-MM-DD'), + principal: item.principal, + interest: item.interest, + currentAmount: item.currentAmount, + postingState: '1', + remark: '' + } + repaymentOpen.value = true +} + +/** 计算合计金额 */ +function calculateTotalAmount() { + const principal = parseFloat(repaymentForm.value.principal) || 0 + const interest = parseFloat(repaymentForm.value.interest) || 0 + repaymentForm.value.currentAmount = (principal + interest).toFixed(2) +} + +/** 提交还款 */ +function submitRepayment() { + proxy.$refs.repaymentFormRef.validate((valid) => { + if (valid) { + proxy.$modal + .confirm('是否确认已还款?') + .then(function () { + // TODO: 这里需要调用后端接口更新还款状态 + // 示例: return updateInstallmentDetail(repaymentForm.value) + proxy.$modal.msgSuccess('还款成功') + repaymentOpen.value = false + getList() // 刷新列表 + }) + .catch(() => {}) + } + }) +} + getCreditCardList() getList() diff --git a/src/views/invest/onlineLendHistory/index.vue b/src/views/invest/onlineLendHistory/index.vue index 6d4f426..ce4c107 100644 --- a/src/views/invest/onlineLendHistory/index.vue +++ b/src/views/invest/onlineLendHistory/index.vue @@ -227,6 +227,9 @@