소스 검색

代码提交

Handy_Cao 3 년 전
부모
커밋
7bd45deffe

+ 11 - 11
src/business/bank/index.ts

@@ -260,27 +260,26 @@ export function doBankSign() {
         CertType: getUserInfo()?.cardtypeid.toString()
     })
 
-    const cusSignBank = shallowRef<Model.CusBankSignBankRsp[]>([])
+    /// 托管银行信息
+    const cusSignBank = shallowRef<Model.CusBankSignBankRsp>()
 
     /// 查询签约银行信息
     const request = queryCusBankSignBank({
         success: (res) => {
-            cusSignBank.value = res.data,
-            ({
-                accountName: formData.AccountName,
-                branchBankName: formData.OpenBankName,
-                bankNo: formData.BankAccountNo,
-                currency: formData.Currency,
-                tradedate: formData.TradeDate,
-                bankid: formData.OpenBankAccId,
-                cusbankid: formData.CusBankID
-            })
+            if(res.data.length) {
+                const data=res.data[0]
+                cusSignBank.value = data
+                formData.Currency=data.currency
+                formData.CusBankID=data.cusbankid
+                formData.TradeDate=data.tradedate
+            }
         }
     })
 
     const onSubmit = async () => {
         await request
         loading.value = true
+        console.log(cusSignBank)
         return t2bBankSign({
             data: {
                 ...formData
@@ -306,6 +305,7 @@ export function doCancelBankSign() {
     const loading = shallowRef(false)
     /// 获取当前是否已签约
     const bankAccountSign = shallowRef<Model.BankAccountSignRsp[]>([])
+    /// 表单信息
     const formData = reactive<Partial<Proto.t2bBankCancelSignReq>>({})
     
     /// 请求签约信息

+ 1 - 1
src/packages/mobile/components/base/select/index.vue

@@ -24,7 +24,7 @@ import { Field, FieldRule, Popup, Picker, PickerOption, FieldInstance } from 'va
 
 const props = defineProps({
     modelValue: {
-        type: [Number,String]
+        type: [Number, String]
     },
     options: {
         type: Array,

+ 12 - 16
src/packages/mobile/views/account/certification/index.vue

@@ -6,7 +6,7 @@
         <Form ref="formRef" class="g-form__container" @submit="onSubmit">
             <CellGroup inset>
                 <Field v-model="formData.username" name="username" label="姓名" placeholder="请输入用户姓名" :rules="formRules.username"/>
-                <Field v-model="formData.cardtype" name="cardtype" label="证件类型" placeholder="请选择证件类型" is-link readonly @click="showPicker = true"/>
+                <app-select v-model="formData.cardtype" name="cardtype" label="证件类型" placeholder="请选择证件类型" :rules="formRules.cardtype" :options="enums" />
                 <Field v-model="formData.cardnum" name="cardnum" label="证件号码" placeholder="请输入证件号码" :rules="formRules.cardnum"/>
                 <Field v-model="formData.cardbackphotourl" name="cardbackphotourl" label="证件正面照片" :rules="formRules.cardbackphotourl">
                     <template #input>
@@ -20,9 +20,6 @@
                 </Field>
             </CellGroup>
         </Form>
-        <Popup v-model:show="showPicker" round position="bottom">
-            <Picker  title="请选择证件类型" :columns="enums" @cancel="showPicker = false" @confirm="onConfirm" />
-        </Popup>
         <template #footer>
             <div class="g-form__footer">
                 <Button type="primary" @click="formRef?.submit" round block>提交实名认证</Button>
@@ -32,25 +29,24 @@
 </template>
 
 <script lang="ts" setup>
-import { reactive, shallowRef } from 'vue'
-import { CellGroup, Button, Field, Form, FormInstance, Uploader, Toast, FieldRule, Picker, Popup } from 'vant'
+import { shallowRef, computed } from 'vue'
+import { CellGroup, Button, Field, Form, FormInstance, Uploader, Toast, FieldRule } from 'vant'
 import { addAuthReq } from '@/business/user'
 import { Model } from 'echarts/core';
 import { fullloading, dialog } from '@/utils/vant';
 import { ref } from 'vue';
 import { getCertificateTypeList } from "@/constants/account";
+import AppSelect from '@mobile/components/base/select/index.vue'
 
 const formRef = shallowRef<FormInstance>()
 const { formData, formSubmit } = addAuthReq()
-const showPicker = ref(false);
-const result = ref('');
+
 /// 证件正面地址
 const backList = ref([]);
 /// 证件背面地址
 const frontList = ref([]);
-
 /// 获取对应的证件枚举类型
-const enums = getCertificateTypeList().map(obj=>{ return obj.label })
+const enums = computed(() => { return getCertificateTypeList().map(obj=>{ return {label: obj.label, value: obj.value} }) }) 
 
 const afterRead = (file: any) => {
     file.status = 'uploading';
@@ -68,6 +64,12 @@ const formRules: { [key in keyof Model.AddAuthReq]?: FieldRule[] } = {
         required: true,
         message: '请输入用户姓名',
     }],
+    cardtype: [{
+        message: '请选择证件类型',
+        validator: () => {
+            return !!formData.cardtype
+        }
+    }],
     cardnum: [{
         required: true,
         message: '请输入证件号码',
@@ -82,12 +84,6 @@ const formRules: { [key in keyof Model.AddAuthReq]?: FieldRule[] } = {
     }],
 }
 
-const onConfirm = (value: any) => {
-    result.value = value;
-    showPicker.value = false;
-    formData.cardtype = value
-}
-
 const onSubmit = () => {
     fullloading((hideLoading) => {
         formSubmit().then(() => {

+ 6 - 20
src/packages/mobile/views/bank/sign/components/edit/index.vue

@@ -5,22 +5,16 @@
         </template>
         <Form ref="formRef" class="g-form__container" @submit="formSubmit">
             <CellGroup inset>
-                <!-- <Field name="BankName" is-link label="开户银行" placeholder="请选择银行信息" @click="showPicker = true" /> -->
-                <app-select v-model="formData.OpenBankAccId" name="BankName" label="开户银行"
-                    :rules="formRules.OpenBankAccId" :options="banklist"
-                    />
+                <app-select v-model="formData.OpenBankAccId" name="BankName" label="开户银行" placeholder="请选择开户银行" :rules="formRules.OpenBankAccId" :options="banklist" />
                 <Field name="BankNo" label="银行卡号" v-model="formData.BankAccountNo" placeholder="请输入银行卡账号" :rules="formRules.BankAccountNo" />
                 <Field name="AccountName" label="姓名" v-model="formData.BankAccountName" placeholder="请输入银行卡账户名" :rules="formRules.BankAccountName" />
                 <Field name="BranchBankName" label="支行名称" v-model="formData.OpenBankName" placeholder="请输入银行卡支行名称" :rules="formRules.OpenBankName" />
-                <Field name="SignStatus" label="签约状态" readonly model-value="签约中" />
+                <Field v-if="false" name="SignStatus" label="签约状态" readonly model-value="签约中" />
             </CellGroup>
         </Form>
-        <Popup v-model:show="showPicker" round position="bottom">
-            <Picker  title="可签约银行" :columns="columns" @cancel="showPicker = false" @confirm="onConfirm" />
-        </Popup>
         <template #footer>
             <div class="g-form__footer">
-                <Button type="success" round block>解约</Button>
+                <!-- <Button type="success" round block>解约</Button> -->
                 <Button type="primary" round block @click="formRef?.submit()">提交</Button>
             </div>
         </template>
@@ -29,29 +23,21 @@
 
 <script lang="ts" setup>
 
-import { shallowRef,computed } from 'vue'
-import { CellGroup, Button, Field, Form, FormInstance, FieldRule, Toast, Picker, Popup } from 'vant'
+import { shallowRef, computed } from 'vue'
+import { CellGroup, Button, Field, Form, FormInstance, FieldRule, Toast } from 'vant'
 import { fullloading, dialog } from '@/utils/vant'
 import { doBankSign } from '@/business/bank'
-import { ref } from 'vue';
 import { useNavigation } from '@/hooks/navigation'
 import AppSelect from '@mobile/components/base/select/index.vue'
 
 const {router}=useNavigation()
 const { formData, onSubmit, cusSignBank } = doBankSign()
-const result = ref('');
-const showPicker = ref(false);
 const formRef = shallowRef<FormInstance>()
 
 const banklist=computed(()=> {
-    return (cusSignBank.value[0]?.Banklst ?? []).map((e)=>({label:e.bankname,value:e.bankid}))
+    return (cusSignBank.value?.Banklst ?? []).map((e)=>({label:e.bankname,value:e.bankid}))
 })
 
-const onConfirm = (value: any) => {
-    result.value = value;
-    showPicker.value = false;
-}
-
 // 表单验证规则
 const formRules: { [key in keyof Proto.t2bBankSignReq]?: FieldRule[] } = {
     OpenBankAccId: [{