Handy_Cao 9 mesiacov pred
rodič
commit
838eb3662e

+ 27 - 14
src/packages/tss/views/bank/wallet/components/withdraw/Index.vue

@@ -22,9 +22,10 @@
                 </template>
             </CellGroup>
             <CellGroup>
-                <Cell :title="$t('banksign.wallet.withdraw.bankaccountname')" :value="handleNoneValue(sign.bankaccountname)" />
+                <Cell v-if="sign.ismix === 0" :title="$t('banksign.wallet.withdraw.bankaccountname')" :value="handleNoneValue(sign.bankaccountname)" />
                 <Cell v-if="sign.ismix === 0" :title="$t('banksign.wallet.withdraw.bankname')" :value="handleNoneValue(sign.bankname)" />
                 <Cell v-if="sign.ismix === 0" :title="$t('banksign.wallet.withdraw.bankaccountno')" :value="handleNoneValue(sign.bankaccountno)" />
+                <Field v-if="sign.ismix === 1" name="bankaccountname" :label="$t('banksign.wallet.withdraw.bankaccountname')" v-model.trim="sign.bankaccountname" @click="showReciver = true" is-link readonly />
                 <Field v-if="sign.ismix === 1" type="number" name="phone_number" label="电话号码" maxlength="30" v-model.trim="onboard.phone_number" :placeholder="$t('banksign.Pleaseenterbankaccountno')"
                         :rules="formRules.phone_number" />
                 <Field v-if="sign.ismix === 1" type="number" name="cert_no" label="证件号码" maxlength="30" v-model.trim="onboard.cert_no" placeholder="请输入证件号码" :rules="formRules.cert_no" />
@@ -67,13 +68,14 @@
             </div>
         </template>
     </app-view>
+    <component :is="Reciver" v-model:show="showReciver" @change="onChange" />
 </template>
 
 <script lang="ts" setup>
-import { reactive, shallowRef } from 'vue'
-import { Form, Field, Cell, CellGroup, FormInstance, Button, FieldRule, RadioGroup, Radio } from 'vant'
+import { reactive, shallowRef, defineAsyncComponent } from 'vue'
+import { Form, Field, Cell, CellGroup, FormInstance, Button, FieldRule } from 'vant'
 import { fullloading, dialog, } from '@/utils/vant'
-import { useDoWithdraw, useAccountFundInfo, useDoCusBankExtendConfigs, useQueryHybridReceiverOnboards } from '@/business/bank'
+import { useDoWithdraw, useAccountFundInfo, useDoCusBankExtendConfigs } from '@/business/bank'
 import { getServerTime } from '@/services/api/common'
 import { useNavigation } from '@mobile/router/navigation'
 import { useUserStore, i18n } from '@/stores'
@@ -83,7 +85,6 @@ import AppSelect from '@mobile/components/base/select/index.vue'
 
 const { formData, onSubmit, sign, hybrids, channel_code, bank_code } = useDoWithdraw()
 const { configs, cusBank, startTime, endTime } = useDoCusBankExtendConfigs(3)
-const { receivers } = useQueryHybridReceiverOnboards()
 
 /// 资金账户信息
 const { fund } = useAccountFundInfo()
@@ -95,20 +96,32 @@ const msg_317 = getSystemParamValue('317')
 const { global: { t } } = i18n
 
 const userStore = useUserStore() 
-const { mobile2, cardnum, userinfotype } = userStore.userInfo
+const { userinfotype } = userStore.userInfo
+
+const showReciver = shallowRef(false)
+const Reciver = defineAsyncComponent(() => import('./reciver/Index.vue'))
 
 const onboard = reactive<Partial<Model.HybridReceiverOnboard>>({
-    phone_number: mobile2,
-    cert_no: cardnum,
     receiver_type: userinfotype === 1 ? 'Individual' : 'Organization'
 })
 
 const channel_banks = shallowRef<Model.HybridBank[]>([])
 
+// 选择接收人信息
+const onChange = (item: Model.HybridReceiverOnboard) => {
+    channel_code.value = item.channel_code
+    onboard.cert_no = item.cert_no
+    onboard.phone_number = item.phone_number
+    onboard.bank_account = item.bank_account
+    showReciver.value = false
+    // 切换银行
+    channel_banks.value = hybrids.value.find(e => e.channel_code === item.channel_code)?.bank_infos.filter(e => e.out_in_flag === 0 && e.is_enabled === 1) ?? []
+    bank_code.value = item.bank_code
+}
+
 const onHibirdChange = (code: string) => {
-    // 银行信息
     channel_banks.value = hybrids.value.find(e => e.channel_code === code)?.bank_infos.filter(e => e.out_in_flag === 0 && e.is_enabled === 1) ?? []
-    if(channel_banks.value.length) {
+    if(channel_banks.value.length && bank_code.value) {
         bank_code.value = channel_banks.value[0].bank_code ?? ''
     }
 }
@@ -182,18 +195,18 @@ const formSubmit = () => {
         // 拓展信息
         hybrid['channel_code'] = channel_code.value
         hybrid['bank_code'] = bank_code.value
+
         const receiver: { [key: string]: unknown } = Object.create({})
         receiver['bank_account'] = onboard.bank_account
         receiver['cert_no'] = onboard.cert_no
-        receiver['phone_number'] = mobile2
+        receiver['phone_number'] = onboard.phone_number
         receiver['name'] = sign.value.bankaccountname
-        receiver['receiver_type'] = 'Individual'
+        receiver['receiver_type'] = onboard.receiver_type
         hybrid['receiver_onboard'] = receiver
+
         obj['hybrid'] = hybrid
     }
 
-    console.log(obj)
-    
     fullloading((hideLoading) => {
         let isComplete = false // 请求是否结束
         const complete = () => {

+ 72 - 0
src/packages/tss/views/bank/wallet/components/withdraw/reciver/Index.vue

@@ -0,0 +1,72 @@
+<template>
+    <app-modal direction="right-top" height="100%" width="100%">
+        <app-view class="g-form">
+            <template #header>
+                <app-navbar title="选择接收人信息" @back="closed" />
+            </template>
+            <RadioGroup class="g-form__container" v-model="checkedRow" v-if="dataList.length">
+                <CellGroup v-for="(item, index) in dataList" :key="index" @click="onChange(item)" inset>
+                    <Cell>
+                        <template #title>
+                            <Radio :name="item" checked-color="#ee0a24">
+                                <ul style="margin-left: 10px;">
+                                    <li>
+                                        <span>接收人:</span>
+                                        <span>{{ item.name }}</span>
+                                    </li>
+                                    <li>
+                                        <span>电话号码:</span>
+                                        <span>{{ item.phone_number }}</span>
+                                    </li>
+                                    <li>
+                                        <span>证件号码:</span>
+                                        <span>{{ item.cert_no }}</span>
+                                    </li>
+                                    <li>
+                                        <span>接收银行:</span>
+                                        <span>{{ item.bank_name }}</span>
+                                    </li>
+                                    <li>
+                                        <span>银行卡号:</span>
+                                        <span>{{ item.bank_account }}</span>
+                                    </li>
+                                    <li>
+                                        <span>银行渠道:</span>
+                                        <span>{{ item.channel_code }}</span>
+                                    </li>
+                                </ul>
+                            </Radio>
+                        </template>
+                    </Cell>
+                </CellGroup>
+            </RadioGroup>
+            <Empty :description="t('common.nodatas')" v-else />
+        </app-view>
+    </app-modal>
+</template>
+
+<script lang="ts" setup>
+import { shallowRef } from 'vue'
+import { RadioGroup, Radio, Cell, CellGroup, Empty } from 'vant'
+import { useRequest } from '@/hooks/request'
+import { i18n } from "@/stores"
+import { queryHybridReceiverOnboards } from '@/services/api/bank'
+import AppModal from '@/components/base/modal/index.vue'
+
+const emit = defineEmits(['update:show', 'change'])
+const checkedRow = shallowRef<Model.HybridReceiverOnboard>()
+const { t } = i18n.global
+
+const { dataList } = useRequest(queryHybridReceiverOnboards, {})
+
+// 选择仓单
+const onChange = (item: Model.HybridReceiverOnboard) => {
+    checkedRow.value = item
+    emit('change', item)
+}
+
+// 关闭弹窗
+const closed = () => {
+    emit('update:show', false)
+}
+</script>

+ 2 - 2
src/types/model/bank.d.ts

@@ -591,9 +591,9 @@ declare namespace Model {
         accountid: string    // 资金账户ID
         bank_account: string    // 银行卡号
         bank_code: string // 银行代码
-        bank_name: number  // 银行名称
+        bank_name: string  // 银行名称
         cert_no: string // 证件号码
-        channel_code: number // 渠道代码
+        channel_code: string // 渠道代码
         name: string // 名称 / 企业名称
         phone_number?: string // 电话号码
         receiver_type: string // 接收者类型 // 个人-Individual 企业-Organization