Handy_Cao 2 years ago
parent
commit
5fad127b8b

+ 1 - 0
src/packages/mobile/views/mine/Index.vue

@@ -188,6 +188,7 @@ const userLogout = () => {
 }
 
 onActivated(() => {
+    console.log(authStatus.value)
     if (authStatus.value !== AuthStatus.Certified) {
         // 获取用户账号信息
         queryUserAccount().then((res) => {

+ 2 - 1
src/packages/pc/views/account/sign/components/certification/index.vue

@@ -57,11 +57,12 @@ const formRules: FormRules = {
     username: [{
         required: true,
         message: '请输入用户姓名',
+        trigger: 'blur'
     }],
     cardnum: [{
         required: true,
         message: '请输入证件号码',
-
+        trigger: 'blur'
     }],
     cardbackphotourl: [{
         required: true,

+ 1 - 1
src/packages/pc/views/account/sign/components/sign/index.vue

@@ -2,7 +2,7 @@
 <template>
     <app-drawer :title="bankInfo ? '修改签约账户' : '添加签约账户'" :width="460" v-model:show="show" :loading="loading"
         :refresh="refresh">
-        <el-form ref="formRef" class="el-form--vertical" label-width="100px" :model="bankInfo" :rules="formRules">
+        <el-form ref="formRef" class="el-form--vertical" label-width="100px" :model="formData" :rules="formRules">
             <el-form-item label="开户银行" prop="OpenBankAccId">
                 <el-select v-model="formData.OpenBankAccId">
                     <el-option :label="item.bankname" :value="item.bankid" v-for="(item, index) in banklist"

+ 5 - 12
src/packages/pc/views/account/sign/index.vue

@@ -3,7 +3,8 @@
     <app-table :data="dataList" v-model:columns="tableColumns" :loading="loading" :row-key="rowKey"
         :expand-row-keys="expandKeys" @row-click="rowClick">
         <template #header>
-            <app-filter :options="filterOptons" />
+            <el-button type="primary" v-if="authStatus === AuthStatus.Certified" @click="openComponent('sign')">添加签约账户</el-button>
+            <el-button type="warning" v-else @click="openComponent('certification')" plain>实名认证</el-button>
         </template>
         <!-- 证件类型 -->
         <template #cardtype="{ value }">
@@ -28,18 +29,16 @@
 </template>
 
 <script lang="ts" setup>
-import { shallowRef, defineAsyncComponent, onActivated } from 'vue'
+import { shallowRef, defineAsyncComponent, onMounted } from 'vue'
 import { useComponent } from '@/hooks/component'
 import { useComposeTable } from '@pc/components/base/table'
 import { useRequest } from '@/hooks/request'
-import { useDataFilter } from '@/hooks/datatable'
 import { queryBankAccountSign } from '@/services/api/bank'
 import { getSignStatusName, SignStatus } from '@/constants/bank'
 import { getCertificateTypeCodeName } from '@/constants/account'
 import { queryUserAccount } from '@/services/api/account'
 import { AuthStatus } from '@/constants/account'
 import AppTable from '@pc/components/base/table/index.vue'
-import AppFilter from '@pc/components/base/table-filter/index.vue'
 
 const componentMap = new Map<string, unknown>([
     ['cancel', defineAsyncComponent(() => import('./components/cancel/index.vue'))],
@@ -48,7 +47,6 @@ const componentMap = new Map<string, unknown>([
 ])
 
 const { rowKey, expandKeys, rowClick, selectedRow } = useComposeTable<Model.BankAccountSignRsp>({ rowKey: 'applyexchticket' })
-const { filterOptons } = useDataFilter<Model.BankAccountSignReq>()
 const { loading, dataList, run } = useRequest(queryBankAccountSign, {})
 const authStatus = shallowRef(AuthStatus.Uncertified) // 实名认证状态
 
@@ -68,13 +66,7 @@ const tableColumns = shallowRef<Model.TableColumn[]>([
     { prop: 'signstatus', label: '状态' },
 ])
 
-filterOptons.buttonList = authStatus.value === AuthStatus.Certified ? [
-    { lable: '添加签约账户', className: 'el-button--primary', onClick: () => openComponent('sign') },
-] : [
-    { lable: '实名认证', className: 'el-button--warning', onClick: () => openComponent('certification') },
-]
-
-onActivated(() => {
+onMounted(() => {
     if (authStatus.value !== AuthStatus.Certified) {
         // 获取用户账号信息
         queryUserAccount().then((res) => {
@@ -82,4 +74,5 @@ onActivated(() => {
         })
     }
 })
+
 </script>

+ 7 - 4
src/packages/pc/views/footer/capital/summary/deposit/index.vue

@@ -4,10 +4,10 @@
         <el-form ref="formRef" class="el-form--vertical" label-width="100px" label-position="left" :model="formData"
             :rules="formRules">
             <el-form-item prop="Amount" label="充值金额">
-                <el-input-number placeholder="请输入" :max="9999999999" :precision="2" v-model="formData.Amount" />
+                <el-input-number placeholder="请输入" :max="9999999999" :precision="2" v-model="formData.Amount" :rules="formRules.Amount"/>
             </el-form-item>
-            <el-form-item label="凭证">
-                <app-upload :file-types="['image']" type-message="请选择正确的图片类型" @change="onUploadChange" />
+            <el-form-item label="凭证" prop="filePath">
+                <app-upload :file-types="['image']" type-message="请选择正确的图片类型" @change="onUploadChange" :rules="formRules.filePath"/>
             </el-form-item>
         </el-form>
         <template #footer>
@@ -23,6 +23,7 @@ import { ElMessage, FormInstance, FormRules } from 'element-plus'
 import { useDoDeposit } from '@/business/bank'
 import AppDrawer from '@pc/components/base/drawer/index.vue'
 import AppUpload from '@pc/components/base/upload/index.vue'
+import { shallowRef } from 'vue'
 
 const props = defineProps({
     selectedRow: {
@@ -35,13 +36,15 @@ const { formData, onSubmit, extendInfo, loading } = useDoDeposit(props.selectedR
 const show = ref(true)
 const refresh = ref(false)
 const formRef = ref<FormInstance>()
+const filePath = shallowRef('')
 
 const formRules: FormRules = {
     Amount: [{ required: true, message: '请输入充值金额' }],
+    filePath: [{ required: true, message: '请上传转账凭证' }],
 }
 
 const onUploadChange = (file: { filePath: string }) => {
-    console.log(file.filePath)
+    filePath.value = file.filePath
     extendInfo.certificate_photo_url = file.filePath
 }
 

+ 2 - 2
src/packages/pc/views/footer/capital/summary/index.vue

@@ -21,7 +21,7 @@
 </template>
 
 <script lang="ts" setup>
-import { shallowRef, defineAsyncComponent, onActivated } from 'vue'
+import { shallowRef, defineAsyncComponent, onMounted } from 'vue'
 import { useAccountStore } from '@/stores'
 import { useComponent } from '@/hooks/component'
 import { useComposeTable } from '@pc/components/base/table'
@@ -71,7 +71,7 @@ const doInOutMoney = (code: string) => {
     }
 }
 
-onActivated(() => {
+onMounted(() => {
     if (authStatus.value !== AuthStatus.Certified) {
         // 获取用户账号信息
         queryUserAccount().then((res) => {