From 8a7dff55bf367a2017048815c7d714528268ea1b Mon Sep 17 00:00:00 2001 From: tianyongbao Date: Thu, 13 Feb 2025 17:44:01 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E6=99=BA=E8=81=AA=E8=AE=B0=E8=B4=A6?= =?UTF-8?q?=E7=AE=A1=E7=90=86=EF=BC=8C=E6=8A=95=E8=B5=84=E4=BA=A4=E6=98=93?= =?UTF-8?q?=E8=AE=B0=E5=BD=95=EF=BC=8C=E5=8A=9F=E8=83=BD=E4=BC=98=E5=8C=96?= =?UTF-8?q?=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/invest/investAccountDeal/index.vue | 13 +++++++++++-- src/views/invest/lendTransferRecord/index.vue | 4 ++-- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/src/views/invest/investAccountDeal/index.vue b/src/views/invest/investAccountDeal/index.vue index 36ec528..4213cb3 100644 --- a/src/views/invest/investAccountDeal/index.vue +++ b/src/views/invest/investAccountDeal/index.vue @@ -64,11 +64,12 @@ + @@ -234,7 +235,7 @@ function reset() { type: '5', accountId: null, amount: null, - dealType: null, + dealType: '1', createBy: null, createTime: null, updateBy: null, @@ -307,6 +308,14 @@ function submitForm() { form.value.remark = '平仓盈亏' + form.value.closedPosition + ',手续费' + form.value.commission form.value.amount = form.value.closedPosition - form.value.commission } + //如果是亏损,金额乘以-1 + if (form.value.amount >= 0) { + form.value.dealType = '1' + alert(form.value.dealType) + } else { + form.value.dealType = '2' + form.value.amount = form.value.amount * -1 + } if (form.value.id != null) { updateAccountDealRecord(form.value).then((response) => { proxy.$modal.msgSuccess('修改成功') diff --git a/src/views/invest/lendTransferRecord/index.vue b/src/views/invest/lendTransferRecord/index.vue index 8167157..0970cbe 100644 --- a/src/views/invest/lendTransferRecord/index.vue +++ b/src/views/invest/lendTransferRecord/index.vue @@ -77,7 +77,7 @@ - + @@ -193,7 +193,7 @@ const handleOperate = (operate, row) => { const { queryParams, queryLendParams, queryDebitParams, form, rules } = toRefs(data) -const handleDealTypehange = (type) => { +const handleDealTypeChange = (type) => { //1表示借款,2表示还款 if (type === '1') { commissionShow.value = false