|
|
@@ -0,0 +1,123 @@
|
|
|
+<!-- 会员机构管理-机构管理-机构资料管理-资金账户 -->
|
|
|
+<template>
|
|
|
+ <teleport to="#appPageTeleport">
|
|
|
+ <app-view>
|
|
|
+ <template #header>
|
|
|
+ <app-filter :option="filterOption" />
|
|
|
+ </template>
|
|
|
+ <app-table :data="dataList" :columns="tableColumns" :loading="loading">
|
|
|
+ <template #headerLeft>
|
|
|
+ <span>[{{ record.accountname }}]的资金账户</span>
|
|
|
+ </template>
|
|
|
+ <template #headerRight>
|
|
|
+ <div>
|
|
|
+ <el-button type="primary" @click="showComponent('Edit')">{{ t('operation.add') }}</el-button>
|
|
|
+ <el-button @click="emit('closed')">{{ t('operation.close') }}</el-button>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ <!-- 操作 -->
|
|
|
+ <template #operate="{ row }">
|
|
|
+ <el-button size="small" icon="Search" @click="showComponent('Details', row)" circle plain />
|
|
|
+ <el-button size="small" icon="Document" @click="showComponent('SignStatement', row)" circle plain />
|
|
|
+ <el-button size="small" icon="Edit" @click="showComponent('Edit', row)" circle plain />
|
|
|
+ <el-button size="small" icon="Key" @click="showComponent('Password', row)" circle plain />
|
|
|
+ </template>
|
|
|
+ <template #footer>
|
|
|
+ <app-pagination :total="total" v-model:page-size="pageSize" v-model:page-index="pageIndex"
|
|
|
+ @change="onSearch" />
|
|
|
+ </template>
|
|
|
+ </app-table>
|
|
|
+ <component ref="componentRef" :is="componentMap.get(componentId)" v-bind="{ record: selectedItem }"
|
|
|
+ @closed="closeComponent" v-if="componentId" />
|
|
|
+ </app-view>
|
|
|
+ </teleport>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script lang="ts" setup>
|
|
|
+import { shallowRef, PropType, defineAsyncComponent } from 'vue'
|
|
|
+import { ElMessage } from 'element-plus'
|
|
|
+import { useEnum } from '@/hooks/enum'
|
|
|
+import { useRequest } from '@/hooks/request'
|
|
|
+import { useDataFilter } from '@/hooks/datatable-v2'
|
|
|
+import { useComponent } from '@/hooks/component'
|
|
|
+import { organTaaccount } from '@/services/api/member'
|
|
|
+import AppTable from '@pc/components/base/table/index.vue'
|
|
|
+import AppPagination from '@pc/components/base/pagination/index.vue'
|
|
|
+import AppFilter from '@pc/components/base/table-filter-v2/index.vue'
|
|
|
+import { i18n } from '@/stores'
|
|
|
+
|
|
|
+const props = defineProps({
|
|
|
+ record: {
|
|
|
+ type: Object as PropType<Model.OrganDetailListRsp>,
|
|
|
+ required: true
|
|
|
+ }
|
|
|
+})
|
|
|
+
|
|
|
+const componentMap = new Map<string, unknown>([
|
|
|
+ ['Details', defineAsyncComponent(() => import('@pc/views/account/fundacct/components/details/index.vue'))], // 详情
|
|
|
+ ['SignStatement', defineAsyncComponent(() => import('./signstatement/index.vue'))], // 签解约流水
|
|
|
+ ['Edit', defineAsyncComponent(() => import('./edit/index.vue'))], // 修改
|
|
|
+ ['Password', defineAsyncComponent(() => import('./password/index.vue'))], // 重置密码
|
|
|
+])
|
|
|
+
|
|
|
+const emit = defineEmits(['closed'])
|
|
|
+
|
|
|
+// 账户类型
|
|
|
+const mainaccounttypeEnum = useEnum('mainaccounttype')
|
|
|
+// 内/外部
|
|
|
+const accounttypeEnum = useEnum('accounttype')
|
|
|
+// 交易状态
|
|
|
+const traderstatusEnum = useEnum('traderstatus')
|
|
|
+
|
|
|
+const selectedItem = shallowRef<Model.OrganTaaccountRsp>()
|
|
|
+
|
|
|
+const { global: { t } } = i18n
|
|
|
+
|
|
|
+const { componentRef, componentId, openComponent, closeComponent } = useComponent(() => run())
|
|
|
+
|
|
|
+const { dataList, total, pageSize, pageIndex, loading, run } = useRequest(organTaaccount, {
|
|
|
+ params: {
|
|
|
+ pageNum: 1,
|
|
|
+ pageSize: 20,
|
|
|
+ userId: props.record.userid
|
|
|
+ },
|
|
|
+ onError: (err) => {
|
|
|
+ ElMessage.error(err)
|
|
|
+ }
|
|
|
+})
|
|
|
+
|
|
|
+const tableColumns = shallowRef<Model.TableColumn[]>([
|
|
|
+ { field: 'accountId', label: '资金账户' },
|
|
|
+ { field: 'isMain', label: '账户类型', formatValue: (val) => mainaccounttypeEnum.getEnumTypeName(val) },
|
|
|
+ { field: 'taAccountType', label: '内/外部', formatValue: (val) => accounttypeEnum.getEnumTypeName(val) },
|
|
|
+ { field: 'relatedName', label: '关联账户' },
|
|
|
+ { field: 'parentAccountId', label: '所属母账户' },
|
|
|
+ { field: 'tradeStatus', label: '交易状态', formatValue: (val) => traderstatusEnum.getEnumTypeName(val) },
|
|
|
+ { field: 'currency', label: '币种' },
|
|
|
+ { field: 'curRiskRate', label: '风险率(%)' },
|
|
|
+ { field: 'operate', label: 'common.operate', width: 180, fixed: 'right' }
|
|
|
+])
|
|
|
+
|
|
|
+const { filterOption, getQueryParams, resetFilters } = useDataFilter<Model.OrganTaaccountReq>({
|
|
|
+ filters: [
|
|
|
+ {
|
|
|
+ field: 'accountId',
|
|
|
+ label: '资金账户'
|
|
|
+ },
|
|
|
+ ],
|
|
|
+ buttons: [
|
|
|
+ { label: t('operation.search'), className: 'el-button--primary', onClick: () => onSearch() },
|
|
|
+ { label: t('operation.reset'), className: 'el-button--primary', validateEvent: false, onClick: () => resetFilters() }
|
|
|
+ ]
|
|
|
+})
|
|
|
+
|
|
|
+const showComponent = (code: string, row?: Model.OrganTaaccountRsp) => {
|
|
|
+ selectedItem.value = row
|
|
|
+ openComponent(code)
|
|
|
+}
|
|
|
+
|
|
|
+const onSearch = (clear = false) => {
|
|
|
+ const qs = getQueryParams(clear)
|
|
|
+ run(qs)
|
|
|
+}
|
|
|
+</script>
|