pull/174/MERGE v2026.03
YunaiV 2026-04-18 13:38:46 +08:00
commit 0d0017eac7
1 changed files with 12 additions and 3 deletions

View File

@ -115,7 +115,7 @@
> >
<uni-easyinput <uni-easyinput
:inputBorder="false" :inputBorder="false"
:value="state.accountInfo.bankName" :value="bankNameLabel"
placeholder="请选择银行" placeholder="请选择银行"
suffixIcon="right" suffixIcon="right"
disabled disabled
@ -164,7 +164,7 @@
</template> </template>
<script setup> <script setup>
import { onBeforeMount, reactive } from 'vue'; import { onBeforeMount, reactive, computed } from 'vue';
import sheep from '@/sheep'; import sheep from '@/sheep';
import accountTypeSelect from './components/account-type-select.vue'; import accountTypeSelect from './components/account-type-select.vue';
import { fen2yuan } from '@/sheep/hooks/useGoods'; import { fen2yuan } from '@/sheep/hooks/useGoods';
@ -199,6 +199,14 @@
bankListSelectedIndex: '', // bankList index bankListSelectedIndex: '', // bankList index
}); });
const bankNameLabel = computed(() => {
if (!state.accountInfo.bankName || !state.bankList || state.bankList.length === 0) {
return '';
}
const item = state.bankList.find((it) => it.value === state.accountInfo.bankName);
return item ? item.label : '';
});
// //
const onAccountSelect = (e) => { const onAccountSelect = (e) => {
state.accountSelect = e; state.accountSelect = e;
@ -300,7 +308,8 @@
function bankChange(e) { function bankChange(e) {
const value = e.detail.value; const value = e.detail.value;
state.bankListSelectedIndex = value; state.bankListSelectedIndex = value;
state.accountInfo.bankName = state.bankList[value].label; const item = state.bankList[value];
state.accountInfo.bankName = item ? item.value : undefined;
} }
onBeforeMount(() => { onBeforeMount(() => {