From 9d8cfa4127ba943fce08fd8ed27618a728fd5746 Mon Sep 17 00:00:00 2001 From: tianyongbao Date: Wed, 4 Mar 2026 13:40:02 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E6=8A=95=E8=B5=84=E8=AE=B0=E8=B4=A6?= =?UTF-8?q?=E5=92=8C=E8=AE=B0=E5=BD=95=EF=BC=8C=E6=96=B0=E5=A2=9E=E9=BB=98?= =?UTF-8?q?=E8=AE=A4=E9=80=89=E4=B8=AD=E7=AC=AC=E4=B8=80=E6=9D=A1=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../accounts/investAccountDeal/addEdit.vue | 21 +++++++++++++++++++ .../accounts/investTransferRecord/addEdit.vue | 5 +++++ 2 files changed, 26 insertions(+) diff --git a/src/pages/work/accounts/investAccountDeal/addEdit.vue b/src/pages/work/accounts/investAccountDeal/addEdit.vue index 15660e1..3740f4e 100644 --- a/src/pages/work/accounts/investAccountDeal/addEdit.vue +++ b/src/pages/work/accounts/investAccountDeal/addEdit.vue @@ -169,6 +169,27 @@ onLoad((option) => { } }) } + } else if (!form.value.id && response.rows.length > 0) { + // 新增时,默认选中第一条数据 + const firstAccount = response.rows[0] + form.value.accountName = firstAccount.nameCodeAvailableLimit + form.value.accountId = firstAccount.id + // 触发账户选择逻辑 + getFutureStocks(firstAccount.id).then((accountRes) => { + const account = accountRes.data + accountType.value = account.type + if (account.type == '1') { + futuresShow.value = true + form.value.amount = 0 + form.value.closedPosition = null + form.value.commission = null + } else { + futuresShow.value = false + form.value.amount = null + form.value.closedPosition = 0 + form.value.commission = 0 + } + }) } }) if(form.value.id!=null){ diff --git a/src/pages/work/accounts/investTransferRecord/addEdit.vue b/src/pages/work/accounts/investTransferRecord/addEdit.vue index 1585dbf..cf3bcf1 100644 --- a/src/pages/work/accounts/investTransferRecord/addEdit.vue +++ b/src/pages/work/accounts/investTransferRecord/addEdit.vue @@ -145,6 +145,11 @@ onLoad((option) => { if (selectedAccount) { form.value.inAccountName = selectedAccount.nameDebitNameCode } + } else if (!form.value.id && response.rows.length > 0) { + // 新增时,默认选中第一条投资账户 + const firstAccount = response.rows[0] + form.value.inAccountName = firstAccount.nameDebitNameCode + form.value.inAccountId = firstAccount.id } }) // 类型