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 } }) // 类型