|
@@ -28,7 +28,7 @@
|
|
|
</template>
|
|
</template>
|
|
|
|
|
|
|
|
<script lang="ts" setup>
|
|
<script lang="ts" setup>
|
|
|
-import { shallowRef, defineAsyncComponent } from 'vue'
|
|
|
|
|
|
|
+import { shallowRef, defineAsyncComponent, onActivated } from 'vue'
|
|
|
import { useComponent } from '@/hooks/component'
|
|
import { useComponent } from '@/hooks/component'
|
|
|
import { useComposeTable } from '@pc/components/base/table'
|
|
import { useComposeTable } from '@pc/components/base/table'
|
|
|
import { useRequest } from '@/hooks/request'
|
|
import { useRequest } from '@/hooks/request'
|
|
@@ -36,17 +36,21 @@ import { useDataFilter } from '@/hooks/datatable'
|
|
|
import { queryBankAccountSign } from '@/services/api/bank'
|
|
import { queryBankAccountSign } from '@/services/api/bank'
|
|
|
import { getSignStatusName, SignStatus } from '@/constants/bank'
|
|
import { getSignStatusName, SignStatus } from '@/constants/bank'
|
|
|
import { getCertificateTypeCodeName } from '@/constants/account'
|
|
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 AppTable from '@pc/components/base/table/index.vue'
|
|
|
import AppFilter from '@pc/components/base/table-filter/index.vue'
|
|
import AppFilter from '@pc/components/base/table-filter/index.vue'
|
|
|
|
|
|
|
|
const componentMap = new Map<string, unknown>([
|
|
const componentMap = new Map<string, unknown>([
|
|
|
['cancel', defineAsyncComponent(() => import('./components/cancel/index.vue'))],
|
|
['cancel', defineAsyncComponent(() => import('./components/cancel/index.vue'))],
|
|
|
['sign', defineAsyncComponent(() => import('./components/sign/index.vue'))],
|
|
['sign', defineAsyncComponent(() => import('./components/sign/index.vue'))],
|
|
|
|
|
+ ['certification', defineAsyncComponent(() => import('./components/certification/index.vue'))], // 实名认证
|
|
|
])
|
|
])
|
|
|
|
|
|
|
|
const { rowKey, expandKeys, rowClick, selectedRow } = useComposeTable<Model.BankAccountSignRsp>({ rowKey: 'applyexchticket' })
|
|
const { rowKey, expandKeys, rowClick, selectedRow } = useComposeTable<Model.BankAccountSignRsp>({ rowKey: 'applyexchticket' })
|
|
|
const { filterOptons } = useDataFilter<Model.BankAccountSignReq>()
|
|
const { filterOptons } = useDataFilter<Model.BankAccountSignReq>()
|
|
|
const { loading, dataList, run } = useRequest(queryBankAccountSign, {})
|
|
const { loading, dataList, run } = useRequest(queryBankAccountSign, {})
|
|
|
|
|
+const authStatus = shallowRef(AuthStatus.Uncertified) // 实名认证状态
|
|
|
|
|
|
|
|
const { componentRef, componentId, openComponent, closeComponent } = useComponent(() => {
|
|
const { componentRef, componentId, openComponent, closeComponent } = useComponent(() => {
|
|
|
run()
|
|
run()
|
|
@@ -64,7 +68,18 @@ const tableColumns = shallowRef<Model.TableColumn[]>([
|
|
|
{ prop: 'signstatus', label: '状态' },
|
|
{ prop: 'signstatus', label: '状态' },
|
|
|
])
|
|
])
|
|
|
|
|
|
|
|
-filterOptons.buttonList = [
|
|
|
|
|
|
|
+filterOptons.buttonList = authStatus.value === AuthStatus.Certified ? [
|
|
|
{ lable: '添加签约账户', className: 'el-button--primary', onClick: () => openComponent('sign') },
|
|
{ lable: '添加签约账户', className: 'el-button--primary', onClick: () => openComponent('sign') },
|
|
|
|
|
+] : [
|
|
|
|
|
+ { lable: '实名认证', className: 'el-button--warning', onClick: () => openComponent('certification') },
|
|
|
]
|
|
]
|
|
|
|
|
+
|
|
|
|
|
+onActivated(() => {
|
|
|
|
|
+ if (authStatus.value !== AuthStatus.Certified) {
|
|
|
|
|
+ // 获取用户账号信息
|
|
|
|
|
+ queryUserAccount().then((res) => {
|
|
|
|
|
+ authStatus.value = res.data.hasauth
|
|
|
|
|
+ })
|
|
|
|
|
+ }
|
|
|
|
|
+})
|
|
|
</script>
|
|
</script>
|