| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335 |
- <template>
- <cwg-page-wrapper class="create-page" :isHeaderFixed="true">
- <cwg-header :title="t('Home.page_ib.item2')" />
- <view class="info-card">
- <view class="search-content">
- <view class="search-bar">
- <uni-easyinput v-model="search.cId" placeholder="CID" />
- <uni-easyinput v-model="search.name" :placeholder="t('Ib.Custom.NameLabel')" />
- <uni-easyinput v-model="search.email" :placeholder="t('Label.Email')" />
- </view>
- <view class="search-tabs">
- <view class="crm-cursor tab-item" :class="{ active: search.belongsType == 1 }" @click="chooseBelongsType(1)"
- >
- {{ t('Ib.Custom.Unverified') }}
- <view
- v-if="statistics.unverifiedNum !== undefined"
- class="count-badge"
- >({{ statistics.unverifiedNum }})
- </view>
- </view>
- <view
- class="crm-cursor tab-item"
- :class="{ active: search.belongsType == 2 }"
- @click="chooseBelongsType(2)"
- >
- {{ t('Ib.Custom.UnDeposit') }}
- <view
- v-if="statistics.unDepositNum !== undefined"
- class="count-badge"
- >({{ statistics.unDepositNum }})
- </view
- >
- </view>
- <view
- class="crm-cursor tab-item"
- :class="{ active: search.belongsType == 3 }"
- @click="chooseBelongsType(3)"
- >
- {{ t('Ib.Custom.Deposited') }}
- <view
- v-if="statistics.depositNum !== undefined"
- class="count-badge"
- >({{ statistics.depositNum }})
- </view
- >
- </view>
- </view>
- </view>
- <cwg-tabel
- ref="tableRef"
- :columns="columns"
- :mobilePrimaryFields="mobilePrimaryFields"
- :queryParams="search"
- :api="listApi"
- :show-operation="true"
- :showPagination="true"
- >
- <template #action="{ row }">
- <cwg-dropdown :menu-list="menuList(row)" @menuClick="handleMenuClick">
- <view class="pc-header-btn">
- <cwg-icon name="crm-ellipsis" :size="24" />
- </view>
- </cwg-dropdown>
- </template>
- </cwg-tabel>
- <!-- 跟单全局设置 -->
- <DocumentaryDialog :visible="docVisible" :detail="formInfoRow" @close="closeDoc" @confirm="confirmDoc" />
- <!-- 开户调整 -->
- <PointDialog :visible="pointVisible" :detail="pointForm" @close="closePoint" @confirm="confirmPoint" />
- <ApplyIbDialog :visible="applyVisible" :tableData="pointForm" @close="closePoint" @confirm="confirmPoint" />
- </view>
- </cwg-page-wrapper>
- </template>
- <script setup lang="ts">
- import { computed, ref, onMounted } from 'vue'
- import { useI18n } from 'vue-i18n'
- import Config from '@/config/index'
- const { t, locale } = useI18n()
- import { customApi } from '@/service/custom'
- import { lang } from '@/composables/config'
- import { ibApi } from '@/service/ib'
- import DocumentaryDialog from '@/pages/ib/components/documentaryDialog.vue'
- import PointDialog from '@/pages/ib/components/pointDialog.vue'
- import ApplyIbDialog from '@/pages/ib/components/applyIbDialog.vue'
- const { Code } = Config
- const statistics = ref({
- unverifiedNum: 0,
- unDepositNum: 0,
- depositNum: 0,
- })
- const search = ref({
- 'name': '',
- 'email': '',
- 'cId': '',
- // 1:未实名 2:未入金 3:已入金
- belongsType: null,
- })
- const formInfoRow = ref({})
- const pointForm = ref({})
- const applyTable = ref([])
- const docVisible = ref(false)
- const pointVisible = ref(false)
- const applyVisible = ref(false)
- const tableRef = ref(null)
- // 表格列配置
- const columns = ref([
- {
- prop: 'cId',
- label: t('Label.CidAccount'),
- align: 'center',
- },
- {
- prop: 'name',
- label: t('Ib.Custom.NameLabel'),
- align: 'center',
- },
- {
- prop: 'email',
- label: t('Label.Email'),
- align: 'center',
- },
- {
- prop: 'countryEnName',
- label: t('Label.Nationality'),
- align: 'center',
- width: lang ? 110 : 0,
- },
- {
- prop: 'addTime',
- label: t('Label.RegistrationTime'),
- align: 'center',
- width: lang ? 110 : 0,
- },
- {
- prop: 'belongsType',
- label: t('Ib.Custom.CustomerStatus'),
- align: 'center',
- formatter: ({ row }) => row.belongsType == 1 ? t('Ib.Custom.Unverified') :
- row.belongsType == 2 ? t('Ib.Custom.UnDeposit') :
- row.belongsType == 3 ? t('Ib.Custom.Deposited') : '--',
- },
- {
- prop: 'ibStatus',
- label: t('Ib.Custom.ApplyAgent'),
- align: 'center',
- formatter: ({ row }) => row.ibStatus == 2 ? t('Ib.Custom.Yes') : t('Ib.Custom.No'),
- },
- {
- prop: 'action',
- label: t('Label.Action'),
- align: 'center',
- slot: 'action',
- },
- ])
- const mobilePrimaryFields = ref([
- {
- prop: 'cId',
- label: t('Label.CidAccount'),
- align: 'center',
- },
- {
- prop: 'name',
- label: t('Ib.Custom.NameLabel'),
- align: 'center',
- },
- {
- prop: 'email',
- label: t('Label.Email'),
- align: 'center',
- },
- {
- prop: 'more',
- type: 'more',
- width: 20,
- align: 'right',
- },
- ])
- const listApi = ref(null)
- listApi.value = ibApi.customerSubs
- //选择belongsType(点击已选中的 tab 可反选取消)
- const chooseBelongsType = (belongsType) => {
- if (search.value.belongsType == belongsType) {
- search.value.belongsType = null // 反选:取消选中
- } else {
- search.value.belongsType = belongsType
- }
- }
- // 下拉菜单配置
- const menuList = (row) => {
- return [
- {
- label: t('Documentary.AgentBackground.item1'),
- type: 'documentary',
- row,
- show: true,
- },
- {
- label: t('Home.msg.ibTitle'),
- type: 'applyIb',
- row,
- show: row.ibStatus == 1 && row.belongsType != 1,
- },
- {
- label: t('Ib.Custom.AccountAdjust'),
- type: 'Point',
- row,
- show: row.belongsType != 1,
- },
- ].filter((item) => item.show)
- }
- const handleMenuClick = (item) => {
- if (item.type == 'documentary') {
- const { cId, id, permissionDisplay } = item.row
- formInfoRow.value = {
- cId, id, permissionDisplay,
- }
- docVisible.value = true
- } else if (item.type == 'applyIb') {
- applyVisible.value = true
- } else if (item.type == 'Point') {
- const { cId, id, comPoint1, hide1 } = item.row
- pointForm.value = {
- cId, id, comPoint1, hide1,
- }
- pointVisible.value = true
- }
- }
- //获取统计数
- const getStatistics = async () => {
- try {
- let res = await ibApi.customerSubsStatistics({})
- if (res.code == Code.StatusOK && res.data) {
- statistics.value = {
- unverifiedNum: res.data.unverifiedNum || 0,
- unDepositNum: res.data.unDepositNum || 0,
- depositNum: res.data.depositNum || 0,
- }
- }
- } catch (error) {
- }
- }
- onMounted(() => {
- getStatistics()
- // docVisible.value =true
- // pointVisible.value =true
- })
- const closeDoc = () => {
- docVisible.value = false
- }
- const closeApply = () => {
- applyVisible.value = false
- }
- const closePoint = () => {
- pointVisible.value = false
- }
- const confirmDoc = () => {
- docVisible.value = false
- tableRef.value.refreshTable()
- }
- const confirmPoint = () => {
- pointVisible.value = false
- tableRef.value.refreshTable()
- }
- const confirmApply = () => {
- applyVisible.value = false
- tableRef.value.refreshTable()
- }
- </script>
- <style scoped lang="scss">
- @import "@/uni.scss";
- .search-content {
- display: flex;
- justify-content: space-between;
- }
- .search-bar {
- display: flex;
- align-items: center;
- justify-content: flex-start;
- flex-wrap: wrap;
- gap: px2rpx(10);
- margin: px2rpx(16) 0;
- .cwg-combox,
- .uni-easyinput,
- .uni-date {
- width: px2rpx(180) !important;
- flex: none;
- }
- }
- .search-tabs {
- display: flex;
- align-items: center;
- flex-wrap: wrap;
- gap: px2rpx(10);
- margin: px2rpx(16) 0;
- .tab-item {
- display: flex;
- min-width: px2rpx(100);
- border: 1px solid #F0F0F0;
- border-radius: px2rpx(4);
- margin-left: px2rpx(5);
- height: px2rpx(33);
- line-height: px2rpx(33);
- justify-content: center;
- &.active {
- color: var(--color-white);
- background-color: var(--color-error);
- border-color: var(--color-error);
- }
- }
- }
- </style>
|