| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194 |
- <template>
- <cwg-page-wrapper class="create-page" :isHeaderFixed="true">
- <cwg-header :title="t('Home.page_ib.item7')" />
- <view class="account-content">
- <view class="search-content">
- <view class="search-bar">
- <cwg-combox v-model:value="search.types" :options="typeList"
- :placeholder="t('placeholder.choose')" :clearable="false"/>
- <uni-datetime-picker type="daterange" v-model="search.date"
- :placeholder="t('placeholder.Start') + ' - ' + t('placeholder.End')"
- @change="handleDateChange" />
- </view>
- <view />
- </view>
- <cwg-tabel
- ref="tableRef"
- :columns="columns"
- :mobilePrimaryFields="mobilePrimaryFields"
- :queryParams="search"
- :api="listApi"
- :show-operation="true"
- :showPagination="true"
- >
- <template #approveDesc="{row}">
- <text v-if="reasons[row.approveDesc]">
- {{
- isZh ? reasons[row.approveDesc].content : reasons[row.approveDesc].enContent
- }}
- </text>
- <text v-else>{{ row.approveDesc }}</text>
- </template>
- <template #remitChannelName="{row}">
- <text>
- {{
- isZh ? row.remitChannelName || '--' : row.remitChannelEnName || '--'
- }}
- </text>
- </template>
- <template #status="{row}">
- <text v-if="row.status == 1">
- {{ t('State.ToBeProcessed') }}
- </text>
- <text v-if="row.status == 2&&row.submitStatus == 2">
- {{ t('State.Completed') }}
- </text>
- <text v-if="row.status == 2&&row.submitStatus != 2">
- {{ t('State.InTheProcessing') }}
- </text>
- <text v-if="row.status == 3 || row.callbackStatus == 2">
- {{ t('State.Refused') }}
- </text>
- <text v-if="row.status == 5">
- {{ t('State.Cancelled') }}
- </text>
- <button v-if="row.status == 1" @click.stop="cancel(row.id)">
- {{ t('Btn.Cancel') }}
- </button>
- </template>
- <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>
- </view>
- </cwg-page-wrapper>
- </template>
- <script setup lang="ts">
- // 申请历史
- import { ref, reactive, computed, onMounted, onUnmounted } from 'vue'
- import { onLoad } from '@dcloudio/uni-app'
- import { useI18n } from 'vue-i18n' // uni-app 中已集成,但需配置
- import { customApi } from '@/service/custom'
- import { financialApi } from '@/service/financial'
- import Config from '@/config/index'
- import { ibApi } from '@/service/ib'
- import { apiList, columnList, mobileList } from '@/pages/ib/const/recording'
- import { useFilters } from '@/composables/useFilters'
- import { useConfirm } from '@/hooks/useConfirm'
- const confirm = useConfirm()
- const { numberFormat, numberDecimal } = useFilters()
- const { t, locale } = useI18n()
- const lang = locale.value
- const reasons = ref({})
- let { Code } = Config
- const typeList = ref([
- { text: t('Ib.Recording.NewAccount'), value: 1 },
- { text: t('Ib.Recording.LeverageApply'), value: 2 },
- { text: t('Ib.Recording.InternalTransfer'), value: 3 },
- { text: t('Ib.Recording.ActivitiesApply'), value: 4 },
- { text: t('Ib.Recording.MaidAdjust'), value: 5 },
- { text: t('Ib.Recording.BelongingAdjust'), value: 6 },
- { text: t('Ib.Recording.CommissionAllocation'), value: 7 },
- { text: t('Custom.Withdraw.Title'), value: 8 },
- { text: t('Ib.Recording.MamHangUndo'), value: 9 },
- { text: t('Home.page_ib.item9'), value: 10 },
- { text: t('Ib.PammManager.title2'), value: 11 },
- { text: t('Ib.PammManager.title3'), value: 12 },
- { text: t('Ib.Transfer.IbAccountTransfer'), value: 13 },
- ])
- const search = ref({
- types: 1,
- date: '',
- startDate: '',
- endDate: '',
- })
- const isZh = computed(() => {
- ['cn', 'zhHant'].indexOf(lang) != -1
- })
- // 表格列配置 根据types 切换
- const columns = computed(() => {
- return columnList[search.value.types]
- })
- const mobilePrimaryFields = computed(() => {
- return [
- ...mobileList[search.value.types],
- {
- prop: 'more',
- type: 'more',
- width: 20,
- align: 'right',
- }
- ]
- })
- // 接口 根据types 切换
- const listApi = computed(() => {
- return ibApi[apiList[search.value.types]]
- })
- //获取原因列表
- const searchReasons = async () => {
- let res = await customApi.reasonsRefusalList({ type: nviewl })
- if (res.code == Code.StatusOK) {
- if (res.data == nviewl) {
- reasons.value = {}
- } else {
- reasons.value = res.data
- }
- } else {
- uni.showToast({
- title: res.msg,
- icon: 'none',
- })
- }
- }
- const handleDateChange = (val) => {
- search.value.startDate = val[0]
- search.value.endDate = val[1]
- }
- const cancel = async (id) => {
- try {
- await confirm({
- title: t('Msg.SystemPrompt'),
- content: t('Msg.Cancle'),
- confirmText: t('Btn.item6'),
- cancelText: t('Btn.item7'),
- })
- let res = await ibApi.withdrawCancel({ id })
- if (res.code == Code.StatusOK) {
- uni.showToast({
- title: t('Msg.Success'),
- icon: 'success',
- })
- } else {
- uni.showToast({
- title: res.msg,
- icon: 'none',
- })
- }
- } catch (err) {
- }
- }
- onMounted(() => {
- searchReasons()
- })
- </script>
- <style lang="scss" scoped>
- @import "@/uni.scss";
- .search-content {
- display: flex;
- justify-content: space-between;
- }
- </style>
|