|
|
@@ -7,6 +7,7 @@
|
|
|
</template>
|
|
|
<Form ref="formRef" class="g-form__container" @submit="formSubmit">
|
|
|
<CellGroup inset>
|
|
|
+ <Field label="银行渠道" v-model="cusBankName" name="cusBankName" :rules="formRules.CusBankID" @click-input="showCusBank = true" is-link />
|
|
|
<Field name="OpenBankAccId" :label="$t('banksign.bankname')" v-model="formData.ExBankName" readonly
|
|
|
v-if="!isedit && userInfo.bankid" />
|
|
|
<Field name="OpenBankAccId" :label="$t('banksign.bankname')" v-model="formData.ExBankName"
|
|
|
@@ -57,6 +58,15 @@
|
|
|
:placeholder="$t('common.pleaseenter') + `${item.fieldname}`" />
|
|
|
</template>
|
|
|
</template>
|
|
|
+ <Popup v-model:show="showCusBank" position="bottom" teleport="body" round>
|
|
|
+ <Picker :columns="datalist" @cancel="showCusBank = false" @confirm="cusBankChange" :confirm-button-text="$t('operation.confirm')" :cancel-button-text="$t('operation.cancel')" >
|
|
|
+ <template #option="{ text, index }">
|
|
|
+ <slot name="option" :row="datalist[index]" :index="index">
|
|
|
+ <span>{{ text }}</span>
|
|
|
+ </slot>
|
|
|
+ </template>
|
|
|
+ </Picker>
|
|
|
+ </Popup>
|
|
|
</CellGroup>
|
|
|
</Form>
|
|
|
<template #footer>
|
|
|
@@ -73,7 +83,7 @@
|
|
|
|
|
|
<script lang="ts" setup>
|
|
|
import { shallowRef, ref, computed, defineAsyncComponent } from 'vue'
|
|
|
-import { CellGroup, Button, Field, Form, FormInstance, FieldRule, showFailToast } from 'vant'
|
|
|
+import { CellGroup, Button, Field, Form, FormInstance, FieldRule, showFailToast, Popup, Picker } from 'vant'
|
|
|
import { fullloading, dialog } from '@/utils/vant'
|
|
|
import { useDoBankSign, useDoCusBankExtendConfigs } from '@/business/bank'
|
|
|
import { validateRules } from '@/constants/regex'
|
|
|
@@ -93,18 +103,47 @@ const SelectBank = defineAsyncComponent(() => import('./select-bank/index.vue'))
|
|
|
// 搜索支行
|
|
|
const SearchBank = defineAsyncComponent(() => import('./search-bank/index.vue'))
|
|
|
|
|
|
-const { formData, onSubmit, banklist, bankInfo, extendInfo, system_1010, system_1013, smsVerificationCode } = useDoBankSign()
|
|
|
+const { formData, onSubmit, cusBanks, selectCusBank, swsFormData, bankInfo, extendInfo, system_1010, system_1013, smsVerificationCode } = useDoBankSign()
|
|
|
const showModal = shallowRef(true)
|
|
|
const refresh = shallowRef(false) // 是否刷新父组件数据
|
|
|
const formRef = shallowRef<FormInstance>()
|
|
|
const showSelect = shallowRef(false) // 弹出客户选择界面
|
|
|
const showSearch = shallowRef(false) // 弹出客户搜索界面
|
|
|
+const showCusBank = shallowRef(false) // 弹出银行渠道
|
|
|
const { configs } = useDoCusBankExtendConfigs(1)
|
|
|
const userStore = useUserStore()
|
|
|
const { userInfo } = userStore.$toRefs()
|
|
|
+const cusBankName = shallowRef('')
|
|
|
|
|
|
const { global: { t } } = i18n
|
|
|
|
|
|
+const datalist = computed(() => {
|
|
|
+ return cusBanks.value.map(e => {
|
|
|
+ return { text: e.cusbankname, value: e.cusbankid }
|
|
|
+ })
|
|
|
+})
|
|
|
+
|
|
|
+const cusBankChange = ({ selectedOptions }) => {
|
|
|
+ showCusBank.value = false
|
|
|
+
|
|
|
+ formData.CusBankID = selectedOptions[0].value
|
|
|
+ selectCusBank.value = cusBanks.value.find(e => e.cusbankid === formData.CusBankID)
|
|
|
+ const { tradedate, currency, cusbankid, cusbankname } = selectCusBank.value ?? {}
|
|
|
+ cusBankName.value = cusbankname ?? ''
|
|
|
+
|
|
|
+ formData.TradeDate = tradedate
|
|
|
+ formData.Currency = currency
|
|
|
+ formData.OpenBankAccId = undefined
|
|
|
+
|
|
|
+ swsFormData.CusBankID = cusbankid
|
|
|
+ swsFormData.TradeDate = tradedate
|
|
|
+}
|
|
|
+
|
|
|
+// 银行列表
|
|
|
+const banklist = computed(() => {
|
|
|
+ return cusBanks.value?.find(e => e.cusbankid === formData.CusBankID)?.Banklst.filter(e => e.status == 0 ) ?? []
|
|
|
+})
|
|
|
+
|
|
|
// 倒计时函数
|
|
|
const countdown = useCountDown({
|
|
|
time: +system_1013 * 1000,
|
|
|
@@ -169,6 +208,13 @@ const onSearchBankChange = (item: Model.BankBranChnumInfoRsp) => {
|
|
|
|
|
|
// 表单验证规则
|
|
|
const formRules: { [key in keyof Proto.t2bBankSignReq]?: FieldRule[] } = {
|
|
|
+ CusBankID: [{
|
|
|
+ message: "请选择银行渠道",
|
|
|
+ required: true,
|
|
|
+ validator: () => {
|
|
|
+ return !!formData.CusBankID
|
|
|
+ }
|
|
|
+ }],
|
|
|
OpenBankAccId: [{
|
|
|
message: t('banksign.tips11'),
|
|
|
validator: () => {
|