Explorar el Código

Merge branch 'v20' of http://192.168.31.240:3000/MTP2.0_New/MTP20_WEB_GLOBAL into v20

li.shaoyi hace 9 meses
padre
commit
73c2735ded

+ 65 - 4
src/business/bank/index.ts

@@ -14,7 +14,9 @@ import {
     YJF_WithholdInApply,
     YJF_WithholdSignInSMS,
     YJF_WithholdSignOut,
-    queryMemberCusBankInfo
+    queryMemberCusBankInfo,
+    getHybridConfigs,
+    queryHybridReceiverOnboards
 } from '@/services/api/bank'
 import { SignStatus } from '@/constants/bank'
 import { decryptAES } from '@/services/websocket/package/crypto'
@@ -31,6 +33,10 @@ export function useDoWithdraw() {
     const loading = shallowRef(false)
     /// 获取当前是否已签约
     const bankAccountSign = shallowRef<Model.BankAccountSignRsp[]>([])
+    const hybrids = shallowRef<Model.PaymentCenterHybridConfigs[]>([])
+    const bank_code = shallowRef('')
+    const channel_code = shallowRef('')
+    const channel_banks = shallowRef<Model.HybridBank[]>([])
 
     const sign = computed<Partial<Model.BankAccountSignRsp>>(() => {
         if (bankAccountSign.value.length) {
@@ -60,8 +66,23 @@ export function useDoWithdraw() {
         }
     })
 
+    // 获取支付中心混合支付渠道配置信息列表 泰商所采用
+    getHybridConfigs().then((res) => {
+        if (res.data.length) {
+            hybrids.value = res.data.filter(e => e.can_amt_out === 1 && e.bank_infos.length != 0)
+            if (hybrids.value.length) {
+                channel_code.value = hybrids.value[0].channel_code ?? ''
+                // 默认选中第一个
+                channel_banks.value = hybrids.value.filter(e => e.channel_code === channel_code.value)[0].bank_infos.filter(e => e.out_in_flag === 0 && e.is_enabled === 1) ?? []
+                if (channel_banks.value.length != 0) {
+                    bank_code.value = channel_banks.value[0].bank_code ?? ''
+                }
+            }
+        }
+    }) 
+
     const onSubmit = async () => {
-        await request
+        await request,
         loading.value = true
 
         return t2bBankWithdraw({
@@ -78,7 +99,11 @@ export function useDoWithdraw() {
         loading,
         onSubmit,
         formData,
-        sign
+        sign,
+        hybrids,
+        bank_code,
+        channel_code,
+        channel_banks
     }
 }
 
@@ -87,6 +112,10 @@ export function useDoDeposit(userid?: number) {
     const loading = shallowRef(false)
     /// 获取当前是否已签约
     const bankAccountSign = shallowRef<Model.BankAccountSignRsp[]>([])
+    const hybrids = shallowRef<Model.PaymentCenterHybridConfigs[]>([])
+    const bank_code = shallowRef('')
+    const channel_code = shallowRef('')
+    const channel_banks = shallowRef<Model.HybridBank[]>([])
 
     const sign = computed<Partial<Model.BankAccountSignRsp>>(() => {
         if (bankAccountSign.value.length) {
@@ -114,6 +143,21 @@ export function useDoDeposit(userid?: number) {
         }
     })
 
+    // 获取支付中心混合支付渠道配置信息列表 泰商所采用
+    getHybridConfigs().then((res) => {
+        if (res.data.length) {
+            hybrids.value = res.data.filter(e => e.can_amt_in === 1 && e.bank_infos.length != 0)
+            if (hybrids.value.length) {
+                channel_code.value = hybrids.value[0].channel_code ?? ''
+                // 默认选中第一个
+                channel_banks.value = hybrids.value.filter(e => e.channel_code === channel_code.value)[0].bank_infos.filter(e => e.out_in_flag === 1 && e.is_enabled === 1) ?? []
+                if (channel_banks.value.length != 0) {
+                    bank_code.value = channel_banks.value[0].bank_code ?? ''
+                }
+            }
+        }
+    })    
+
     const onSubmit = async () => {
         await request
         loading.value = true
@@ -131,7 +175,11 @@ export function useDoDeposit(userid?: number) {
         loading,
         onSubmit,
         formData,
-        sign
+        sign,
+        hybrids,
+        bank_code,
+        channel_code,
+        channel_banks
     }
 }
 
@@ -433,6 +481,19 @@ export function useQueryCusBankSignBank() {
     return { cusBank, banklist, request }
 }
 
+/// 查询混合支付出金接收者信息
+export function useQueryHybridReceiverOnboards() {
+    /// 数据
+    const receivers = shallowRef<Partial<Model.HybridReceiverOnboard[]>>([])
+    /// 查询混合支付出金接收者信息
+    const request = queryHybridReceiverOnboards().then((res) => {
+        if (res.data.length) {
+            receivers.value = res.data
+        }
+    })
+    return { receivers, request }
+}
+
 /// 云缴费代扣解约请求
 export function useDoYJF_WithholdSignOut() {
     /// 获取UserId

+ 44 - 8
src/packages/tss/views/bank/wallet/components/deposit/Index.vue

@@ -1,3 +1,4 @@
+<!-- 充值-界面 -->
 <template>
     <app-view class="g-form bank-wallet-deposit">
         <Form ref="formRef" class="g-form__container" @submit="doDepositWarning">
@@ -28,9 +29,21 @@
                 <Cell :title="$t('mine.balance')" :value="currentAccount.currentbalance?.toFixed(2)" />
                 <Cell :title="$t('banksign.wallet.withdraw.bankaccountname')"
                     :value="handleNoneValue(sign.bankaccountname)" />
-                <Cell :title="$t('banksign.wallet.withdraw.bankname')" :value="handleNoneValue(sign.bankname)" />
-                <Cell :title="$t('banksign.wallet.withdraw.bankaccountno')"
+                <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" label="银行渠道" name="channel_code" is-link >
+                    <template #input>
+                        <app-select v-model="channel_code" :options="hybrids"
+                            :optionProps="{ label: 'channel_name', value: 'channel_code' }" @confirm="onHibirdChange"/>
+                    </template>
+                </Field>
+                <Field v-if="sign.ismix === 1 && bank_code != ''" label="银行名称" name="bank_code" is-link >
+                    <template #input>
+                        <app-select v-model="bank_code" :options="channel_banks"
+                            :optionProps="{ label: 'bank_name', value: 'bank_code' }" />
+                    </template>
+                </Field>
             </CellGroup>
             <CellGroup>
                 <Cell :title="$t('banksign.wallet.deposit.platformdepositbankname')" v-if="msg_320">
@@ -83,12 +96,13 @@ import { useDoDeposit, useDoCusBankExtendConfigs } from '@/business/bank'
 import { getServerTime } from '@/services/api/common'
 import { useUserStore, useAccountStore, i18n } from '@/stores'
 import { useComponent } from '@/hooks/component'
+import { handleNoneValue } from '@/filters'
 import Stepper from '@mobile/components/base/stepper/index.vue'
+import AppSelect from '@mobile/components/base/select/index.vue'
 import moment from 'moment'
-import { handleNoneValue } from '@/filters'
 
 const formRef = shallowRef<FormInstance>()
-const { formData, onSubmit, sign } = useDoDeposit()
+const { formData, onSubmit, sign, hybrids, channel_code, bank_code, channel_banks } = useDoDeposit()
 const { getSystemParamValue } = useUserStore()
 const { configs, cusBank, startTime, endTime } = useDoCusBankExtendConfigs(2)
 const certificate_photo_url = ref('')
@@ -97,6 +111,7 @@ const { global: { t } } = i18n
 
 const accountStore = useAccountStore()
 const { currentAccount } = accountStore.$toRefs()
+const { mobile2 } = userStore.userInfo
 
 const msg_320 = getSystemParamValue('320')
 const msg_321 = getSystemParamValue('321')
@@ -111,13 +126,20 @@ const { componentRef, componentId, openComponent, closeComponent } = useComponen
 
 // 数量步长列表
 const qtyStepList = [100, 500, 1000, 5000, 10000, 50000]
-// 数量步长
+// 数量步长 
 const qtyStep = shallowRef(qtyStepList[0])
 
 const onRadioChange = (value: number) => {
     formData.Amount = value
 }
 
+const onHibirdChange = (code: string) => {
+    // 银行信息
+    channel_banks.value = hybrids.value.find(e => e.channel_code === code)?.bank_infos.filter(e => e.out_in_flag === 1 && e.is_enabled === 1) ?? []
+    // 默认选中第一个
+    if(channel_banks.value.length) { bank_code.value = channel_banks.value[0].bank_code ?? '' }
+}
+
 // 表单验证规则
 const formRules: { [key: string]: FieldRule[] } = {
     Amount: [{
@@ -175,10 +197,23 @@ const formSubmit = () => {
                 obj[e.fieldcode] = e.value
             }
         })
+
+        if (channel_code.value != 'autobank') {
+            const hybrid: { [key: string]: unknown } = Object.create({})
+            // 拓展信息
+            hybrid['channel_code'] = channel_code.value
+            hybrid['bank_code'] = bank_code.value
+            if (channel_code.value === 'chillpay') {
+                const personinfo: { [key: string]: unknown } = Object.create({})
+                personinfo['phone_number'] = mobile2
+                hybrid['person_info'] = personinfo
+            }
+            obj['hybrid'] = hybrid
+        }
         obj['certificate_photo_url'] = certificate_photo_url.value
-        formData.extendInfo = JSON.stringify(obj)
 
-        let isComplete = false // 请求是否结束
+        // 请求是否结束
+        let isComplete = false 
         const complete = () => {
             isComplete = true
             dialog({
@@ -190,7 +225,8 @@ const formSubmit = () => {
 
         // 请求等待可能会超过30秒导致请求超时,所以2秒内没回应直接提示成功
         const t = setTimeout(() => complete(), 2000)
-
+        formData.extendInfo = JSON.stringify(obj)
+        
         onSubmit().then(() => {
             if (!isComplete) {
                 complete()

+ 88 - 10
src/packages/tss/views/bank/wallet/components/withdraw/Index.vue

@@ -1,3 +1,4 @@
+<!-- 提现-界面 -->
 <template>
     <app-view class="g-form bank-wallet-withdraw">
         <Form ref="formRef" class="g-form__container" @submit="doWithDrawWarning">
@@ -21,11 +22,26 @@
                 </template>
             </CellGroup>
             <CellGroup>
-                <Cell :title="$t('banksign.wallet.withdraw.bankaccountname')"
-                    :value="handleNoneValue(sign.bankaccountname)" />
-                <Cell :title="$t('banksign.wallet.withdraw.bankname')" :value="handleNoneValue(sign.bankname)" />
-                <Cell :title="$t('banksign.wallet.withdraw.bankaccountno')"
-                    :value="handleNoneValue(sign.bankaccountno)" />
+                <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" />
+                <Field v-if="sign.ismix === 1" label="银行渠道" name="channel_code" is-link >
+                    <template #input>
+                        <app-select v-model="channel_code" :options="hybrids" :optionProps="{ label: 'channel_name', value: 'channel_code' }" 
+                          @confirm="onHibirdChange"/>
+                    </template>
+                </Field>
+                <Field v-if="sign.ismix === 1 && channel_banks.length != 0" label="银行名称" name="bank_code" is-link >
+                    <template #input>
+                        <app-select v-model="bank_code" :options="channel_banks" :optionProps="{ label: 'bank_name', value: 'bank_code' }" />
+                    </template>
+                </Field>
+                <Field v-if="sign.ismix === 1" type="number" name="bank_account" label="银行卡号" maxlength="30" v-model.trim="onboard.bank_account" :placeholder="$t('banksign.Pleaseenterbankaccountno')"
+                        :rules="formRules.bank_account" />
             </CellGroup>
             <CellGroup v-if="msg_317">
                 <Cell :title="$t('common.tips')">
@@ -52,21 +68,24 @@
             </div>
         </template>
     </app-view>
+    <component :is="Reciver" v-model:show="showReciver" @change="onChange" />
 </template>
 
 <script lang="ts" setup>
-import { shallowRef } from 'vue'
+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 } from '@/business/bank'
 import { getServerTime } from '@/services/api/common'
 import { useNavigation } from '@mobile/router/navigation'
 import { useUserStore, i18n } from '@/stores'
-import moment from 'moment'
 import { handleNoneValue } from '@/filters'
+import moment from 'moment'
+import AppSelect from '@mobile/components/base/select/index.vue'
 
-const { formData, onSubmit, sign } = useDoWithdraw()
+const { formData, onSubmit, sign, hybrids, channel_code, bank_code, channel_banks } = useDoWithdraw()
 const { configs, cusBank, startTime, endTime } = useDoCusBankExtendConfigs(3)
+
 /// 资金账户信息
 const { fund } = useAccountFundInfo()
 const { router } = useNavigation()
@@ -74,9 +93,36 @@ const formRef = shallowRef<FormInstance>()
 const { getSystemParamValue } = useUserStore()
 const msg = getSystemParamValue('302')
 const msg_317 = getSystemParamValue('317')
-const userStore = useUserStore()
 const { global: { t } } = i18n
 
+const userStore = useUserStore() 
+const { userinfotype } = userStore.userInfo
+
+const showReciver = shallowRef(false)
+const Reciver = defineAsyncComponent(() => import('./reciver/Index.vue'))
+
+const onboard = reactive<Partial<Model.HybridReceiverOnboard>>({
+    receiver_type: userinfotype === 1 ? 'Individual' : 'Organization'
+})
+
+// 选择接收人信息
+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
+    // 切换银行
+    onHibirdChange(item.channel_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 && bank_code.value) {
+        bank_code.value = channel_banks.value[0].bank_code ?? ''
+    }
+}
+
 // 表单验证规则
 const formRules: { [key: string]: FieldRule[] } = {
     Amount: [{
@@ -91,6 +137,18 @@ const formRules: { [key: string]: FieldRule[] } = {
                 return t('banksign.wallet.withdraw.exceedingthepayableamount')
             }
         }
+    }],
+    cert_no: [{
+        required: true,
+        message: '请输入证件号码',
+    }],
+    phone_number: [{
+        required: true,
+        message: '请输入电话号码',
+    }],
+    bank_account: [{
+        required: true,
+        message: '请输入银行卡号',
     }]
 }
 
@@ -122,12 +180,30 @@ const doWithDrawWarning = () => {
 
 const formSubmit = () => {
     const obj: { [key: string]: unknown } = Object.create({})
+    // 拓展信息
     configs.value.forEach((e) => {
         if (e.value) {
             obj[e.fieldcode] = e.value
         }
     })
-    formData.extendInfo = JSON.stringify(obj)
+
+    if (channel_code.value != 'autobank') {
+        const hybrid: { [key: string]: unknown } = Object.create({})
+        // 拓展信息
+        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'] = onboard.phone_number
+        receiver['name'] = sign.value.bankaccountname
+        receiver['receiver_type'] = onboard.receiver_type
+        hybrid['receiver_onboard'] = receiver
+
+        obj['hybrid'] = hybrid
+    }
+
     fullloading((hideLoading) => {
         let isComplete = false // 请求是否结束
         const complete = () => {
@@ -139,6 +215,7 @@ const formSubmit = () => {
 
         // 请求等待可能会超过30秒导致请求超时,所以2秒内没回应直接提示成功
         const t = setTimeout(() => complete(), 2000)
+        formData.extendInfo = JSON.stringify(obj)
 
         onSubmit().then(() => {
             if (!isComplete) {
@@ -156,6 +233,7 @@ const formSubmit = () => {
         })
     })
 }
+
 </script>
 
 <style lang="less">

+ 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>

+ 20 - 0
src/services/api/bank/index.ts

@@ -259,4 +259,24 @@ export function queryMemberCusBankInfo(config: RequestConfig<Model.BankAccountSi
             ...config.data
         },
     })
+}
+
+/**
+ * 获取支付中心混合支付渠道配置信息列表
+ */
+export function getHybridConfigs(config: RequestConfig = {}) {
+    return http.commonRequest<Model.PaymentCenterHybridConfigs[]>({
+        url: '/Bank/GetHybridConfigs',
+        params: config.data,
+    })
+}
+
+/**
+ * 查询混合支付出金接收者信息
+ */
+export function queryHybridReceiverOnboards(config: RequestConfig = {}) {
+    return http.commonRequest<Model.HybridReceiverOnboard[]>({
+        url: '/Bank/QueryHybridReceiverOnboards',
+        params: config.data,
+    })
 }

+ 32 - 0
src/types/model/bank.d.ts

@@ -23,6 +23,7 @@ declare namespace Model {
         exchbankid: string; // 交易所开户银行ID
         exchpaybankaccname: string; // 交易所支出结算账户户名
         exchpaybankaccno: string; // 交易所支出结算账户
+        ismix: number; // 是否混合渠道 - 0:否 1:是
         isneedcheck: number; // 是否需要对账 - 0:需要 1:不需要 [不需要界面配置]
         isneedclear: number; // 是否需要清算 - 0:不需要 1:需要
         lastcheckstatus: number; // 最后对账状态 - 对账状态 - 1:未对账 2:对账成功 3:对账失败
@@ -84,6 +85,7 @@ declare namespace Model {
         direct: number;//方向(可以判断那方先发起的签约)
         exchticket: string;//最后一次签约成功的流水号
         extendinfo: string;//扩展信息(JSON字符串)
+        ismix: number; // 是否混合渠道 - 0:否 1:是
         mobilephone: string;//手机号
         mobilephone2: string;//手机号 - 密文
         netaddr: string;//调转网址
@@ -566,4 +568,34 @@ declare namespace Model {
         /// 用户ID
         userid: number
     }
+
+    interface PaymentCenterHybridConfigs {
+        bank_infos: HybridBank[]
+        can_amt_in: number   // 入金是否可用 0-不可用 1-可用
+        can_amt_out: number  // 出金是否可用 0-不可用 1-可用
+        channel_code: string // 渠道代码
+        channel_name: string // 渠道名称
+    }
+
+    interface HybridBank {
+        bank_code: string    // 银行代码
+        bank_name: string    // 银行名称
+        channel_code: string // 渠道代码
+        is_enabled: number  // 是否可用 0-未可用 1-可用
+        method_type: string // 方式类型
+        out_in_flag: number // 出入金标志 0-出金 1-入金
+        remark: string // 备注
+    }
+
+    interface HybridReceiverOnboard {
+        accountid: string    // 资金账户ID
+        bank_account: string    // 银行卡号
+        bank_code: string // 银行代码
+        bank_name: string  // 银行名称
+        cert_no: string // 证件号码
+        channel_code: string // 渠道代码
+        name: string // 名称 / 企业名称
+        phone_number?: string // 电话号码
+        receiver_type: string // 接收者类型 // 个人-Individual 企业-Organization
+    }
 }