|
|
@@ -2,29 +2,32 @@
|
|
|
<app-modal direction="right-top" height="100%" width="100%" v-model:show="showModal" :refresh="refresh">
|
|
|
<app-view class="g-form">
|
|
|
<template #header>
|
|
|
- <app-navbar :title="isedit ? $t('banksign.modifybanksign') : $t('banksign.addbanksign')" @back="closed" />
|
|
|
+ <app-navbar :title="isedit ? $t('banksign.modifybanksign') : $t('banksign.addbanksign')"
|
|
|
+ @back="closed" />
|
|
|
</template>
|
|
|
<Form ref="formRef" class="g-form__container" @submit="formSubmit">
|
|
|
<CellGroup inset>
|
|
|
- <Field name="OpenBankAccId" :label="$t('banksign.bankname')" :rules="formRules.OpenBankAccId" is-link>
|
|
|
- <template #input>
|
|
|
- <app-select :readonly="bankaccount != ''" v-model="formData.OpenBankAccId" :placeholder="$t('banksign.Pleaseselectyourbank')" :options="banklist"
|
|
|
- :optionProps="{ label: 'bankname', value: 'bankid' }" />
|
|
|
- </template>
|
|
|
- </Field>
|
|
|
- <Field type="number" name="BankNo" :label="$t('banksign.bankaccountno')" :readonly="bankaccount != ''" maxlength="30" v-model.trim="formData.BankAccountNo"
|
|
|
- :placeholder="$t('banksign.Pleaseenterbankaccountno')" :rules="formRules.BankAccountNo" />
|
|
|
- <Field name="AccountName" :label="$t('banksign.bankaccountname')" readonly v-model="formData.AccountName" :placeholder="$t('banksign.Pleaseenterbankaccountname')"
|
|
|
+ <Field name="OpenBankAccId" :label="$t('banksign.bankname')" v-model="selectedBankName"
|
|
|
+ :placeholder="$t('banksign.Pleaseselectyourbank')" :rules="formRules.OpenBankAccId"
|
|
|
+ @click-input="showSelect = true" readonly is-link />
|
|
|
+ <Field type="number" name="BankNo" :label="$t('banksign.bankaccountno')"
|
|
|
+ :readonly="bankaccount != ''" maxlength="30" v-model.trim="formData.BankAccountNo"
|
|
|
+ :placeholder="$t('banksign.Pleaseenterbankaccountno')" :rules="formRules.BankAccountNo" />
|
|
|
+ <Field name="AccountName" :label="$t('banksign.bankaccountname')" readonly
|
|
|
+ v-model="formData.AccountName" :placeholder="$t('banksign.Pleaseenterbankaccountname')"
|
|
|
:rules="formRules.AccountName" />
|
|
|
- <Field name="MobilePhone" :label="$t('banksign.mobilephone')" :readonly="mobile2 != ''" maxlength="50"
|
|
|
- v-model="formData.MobilePhone" :placeholder="$t('banksign.Pleaseenteryourmobilephonenumber')" :rules="formRules.MobilePhone" />
|
|
|
+ <Field name="MobilePhone" :label="$t('banksign.mobilephone')" :readonly="mobile2 != ''"
|
|
|
+ maxlength="50" v-model="formData.MobilePhone"
|
|
|
+ :placeholder="$t('banksign.Pleaseenteryourmobilephonenumber')" :rules="formRules.MobilePhone" />
|
|
|
<template v-for="(item, index) in configs" :key="index">
|
|
|
<template v-if="(item.fieldcode === 'verify_code')">
|
|
|
- <Field v-if="(bankInfo === undefined) && showExtendInfo(item)" v-model="item.value" type="digit"
|
|
|
- name="vcode" :label="item.fieldname" :placeholder="$t('common.required')" autocomplete="off">
|
|
|
+ <Field v-if="(bankInfo === undefined) && showExtendInfo(item)" v-model="item.value"
|
|
|
+ type="digit" name="vcode" :label="item.fieldname" :placeholder="$t('common.required')"
|
|
|
+ autocomplete="off">
|
|
|
<template #button>
|
|
|
<Button size="small" type="danger" :disabled="isCountdown" @click="sendVerifyCode">
|
|
|
- <span v-if="isCountdown">{{ $t('banksign.sendagain') }}({{ currentTime.seconds }})</span>
|
|
|
+ <span v-if="isCountdown">{{ $t('banksign.sendagain') }}({{ currentTime.seconds
|
|
|
+ }})</span>
|
|
|
<span v-else>{{ $t('banksign.verificationcode') }}</span>
|
|
|
</Button>
|
|
|
</template>
|
|
|
@@ -33,28 +36,32 @@
|
|
|
<template v-else-if="(item.fieldcode === 'bank_branch_name')">
|
|
|
<Field v-if="showExtendInfo(item)" name="OpenBankName" :label="item.fieldname"
|
|
|
v-model="item.value" maxlength="100" right-icon="search"
|
|
|
- :placeholder="$t('common.pleaseenter')+`${item.fieldname}`" :rules="formRules.OpenBankName"
|
|
|
- @click-right-icon="showSearch = true" />
|
|
|
+ :placeholder="$t('common.pleaseenter') + `${item.fieldname}`"
|
|
|
+ :rules="formRules.OpenBankName" @click-right-icon="showSearch = true" />
|
|
|
</template>
|
|
|
<template v-else-if="(item.fieldcode === '100')">
|
|
|
<Field v-if="showExtendInfo(item)" type="number" name="OpenBankNo" :label="item.fieldname"
|
|
|
- v-model="item.value" maxlength="50" :placeholder="$t('common.pleaseenter')+`${item.fieldname}`"
|
|
|
+ v-model="item.value" maxlength="50"
|
|
|
+ :placeholder="$t('common.pleaseenter') + `${item.fieldname}`"
|
|
|
:rules="formRules.OpenBankNo" />
|
|
|
</template>
|
|
|
<template v-else>
|
|
|
<Field v-if="showExtendInfo(item)" :name="item.fieldcode" :label="item.fieldname"
|
|
|
:readonly="item.fieldcode === 'legal_name' && legalpersonname != ''"
|
|
|
- v-model="item.value" maxlength="50" :placeholder="$t('common.pleaseenter')+`${item.fieldname}`" />
|
|
|
+ v-model="item.value" maxlength="50"
|
|
|
+ :placeholder="$t('common.pleaseenter') + `${item.fieldname}`" />
|
|
|
</template>
|
|
|
</template>
|
|
|
</CellGroup>
|
|
|
</Form>
|
|
|
<template #footer>
|
|
|
<div class="g-form__footer inset">
|
|
|
- <Button type="danger" round block @click="formRef?.submit()">{{ bankInfo ? $t('operation.modify') : $t('operation.submit') }}</Button>
|
|
|
+ <Button type="danger" round block @click="formRef?.submit()">{{ bankInfo ? $t('operation.modify') :
|
|
|
+ $t('operation.submit') }}</Button>
|
|
|
</div>
|
|
|
</template>
|
|
|
- <Search v-model:show="showSearch" @change="onBankChange" />
|
|
|
+ <SelectBank v-model:show="showSelect" :data-list="banklist" @change="onSelectBankChange" />
|
|
|
+ <SearchBank v-model:show="showSearch" @change="onSearchBankChange" />
|
|
|
</app-view>
|
|
|
</app-modal>
|
|
|
</template>
|
|
|
@@ -64,24 +71,26 @@
|
|
|
import { shallowRef, ref, computed, defineAsyncComponent } from 'vue'
|
|
|
import { CellGroup, Button, Field, Form, FormInstance, FieldRule, showFailToast } from 'vant'
|
|
|
import { fullloading, dialog } from '@/utils/vant'
|
|
|
-import { useDoBankSign, useDoCusBankExtendConfigs, useT2bSMSVerificationCode } from '@/business/bank'
|
|
|
+import { useDoBankSign, useDoCusBankExtendConfigs } from '@/business/bank'
|
|
|
import { validateRules } from '@/constants/regex'
|
|
|
import { useCountDown } from '@vant/use'
|
|
|
import { useUserStore, i18n } from '@/stores'
|
|
|
import AppModal from '@/components/base/modal/index.vue'
|
|
|
-import AppSelect from '@mobile/components/base/select/index.vue'
|
|
|
|
|
|
+// 选择银行
|
|
|
+const SelectBank = defineAsyncComponent(() => import('./select-bank/index.vue'))
|
|
|
// 搜索支行
|
|
|
-const Search = defineAsyncComponent(() => import('./search/index.vue'))
|
|
|
+const SearchBank = defineAsyncComponent(() => import('./search-bank/index.vue'))
|
|
|
|
|
|
-const { formData, onSubmit, banklist, bankInfo, system_1010 } = useDoBankSign()
|
|
|
+const { formData, onSubmit, banklist, bankInfo, system_1010, smsVerificationCode } = useDoBankSign()
|
|
|
const showModal = shallowRef(true)
|
|
|
-const showSearch = shallowRef(false) // 弹出客户搜索界面
|
|
|
const refresh = shallowRef(false) // 是否刷新父组件数据
|
|
|
const formRef = shallowRef<FormInstance>()
|
|
|
+const showSelect = shallowRef(false) // 弹出客户选择界面
|
|
|
+const showSearch = shallowRef(false) // 弹出客户搜索界面
|
|
|
+const selectedBankName = shallowRef('') // 选中的银行名称
|
|
|
const { configs } = useDoCusBankExtendConfigs(1)
|
|
|
const userStore = useUserStore()
|
|
|
-const { smsVerificationCode } = useT2bSMSVerificationCode()
|
|
|
const { legalpersonname, mobile2, bankaccount, userinfotype } = userStore.userInfo
|
|
|
|
|
|
const { global: { t } } = i18n
|
|
|
@@ -128,7 +137,12 @@ const sendVerifyCode = () => {
|
|
|
})
|
|
|
}
|
|
|
|
|
|
-const onBankChange = (item: Model.BankBranChnumInfoRsp) => {
|
|
|
+const onSelectBankChange = (item: Model.BankInfoRsp) => {
|
|
|
+ selectedBankName.value = item.bankname
|
|
|
+ formData.OpenBankAccId = item.bankid
|
|
|
+}
|
|
|
+
|
|
|
+const onSearchBankChange = (item: Model.BankBranChnumInfoRsp) => {
|
|
|
configs.value.forEach((e) => {
|
|
|
switch (e.fieldcode) {
|
|
|
case 'bank_branch_name':
|
|
|
@@ -232,8 +246,9 @@ const formSubmit = () => {
|
|
|
// 关闭弹窗
|
|
|
const closed = (isRefresh = false) => {
|
|
|
refresh.value = isRefresh
|
|
|
- if (showSearch.value) {
|
|
|
+ if (showSearch.value || showSelect.value) {
|
|
|
showSearch.value = false
|
|
|
+ showSelect.value = false
|
|
|
} else {
|
|
|
showModal.value = false
|
|
|
}
|