recording.vue 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194
  1. <template>
  2. <cwg-page-wrapper class="create-page" :isHeaderFixed="true">
  3. <cwg-header :title="t('Home.page_ib.item7')" />
  4. <view class="account-content">
  5. <view class="search-content">
  6. <view class="search-bar">
  7. <cwg-combox v-model:value="search.types" :options="typeList"
  8. :placeholder="t('placeholder.choose')" :clearable="false"/>
  9. <uni-datetime-picker type="daterange" v-model="search.date"
  10. :placeholder="t('placeholder.Start') + ' - ' + t('placeholder.End')"
  11. @change="handleDateChange" />
  12. </view>
  13. <view />
  14. </view>
  15. <cwg-tabel
  16. ref="tableRef"
  17. :columns="columns"
  18. :mobilePrimaryFields="mobilePrimaryFields"
  19. :queryParams="search"
  20. :api="listApi"
  21. :show-operation="true"
  22. :showPagination="true"
  23. >
  24. <template #approveDesc="{row}">
  25. <text v-if="reasons[row.approveDesc]">
  26. {{
  27. isZh ? reasons[row.approveDesc].content : reasons[row.approveDesc].enContent
  28. }}
  29. </text>
  30. <text v-else>{{ row.approveDesc }}</text>
  31. </template>
  32. <template #remitChannelName="{row}">
  33. <text>
  34. {{
  35. isZh ? row.remitChannelName || '--' : row.remitChannelEnName || '--'
  36. }}
  37. </text>
  38. </template>
  39. <template #status="{row}">
  40. <text v-if="row.status == 1">
  41. {{ t('State.ToBeProcessed') }}
  42. </text>
  43. <text v-if="row.status == 2&&row.submitStatus == 2">
  44. {{ t('State.Completed') }}
  45. </text>
  46. <text v-if="row.status == 2&&row.submitStatus != 2">
  47. {{ t('State.InTheProcessing') }}
  48. </text>
  49. <text v-if="row.status == 3 || row.callbackStatus == 2">
  50. {{ t('State.Refused') }}
  51. </text>
  52. <text v-if="row.status == 5">
  53. {{ t('State.Cancelled') }}
  54. </text>
  55. <button v-if="row.status == 1" @click.stop="cancel(row.id)">
  56. {{ t('Btn.Cancel') }}
  57. </button>
  58. </template>
  59. <template #action="{ row }">
  60. <cwg-dropdown :menu-list="menuList(row)" @menuClick="handleMenuClick">
  61. <view class="pc-header-btn">
  62. <cwg-icon name="crm-ellipsis" :size="24" />
  63. </view>
  64. </cwg-dropdown>
  65. </template>
  66. </cwg-tabel>
  67. </view>
  68. </cwg-page-wrapper>
  69. </template>
  70. <script setup lang="ts">
  71. // 申请历史
  72. import { ref, reactive, computed, onMounted, onUnmounted } from 'vue'
  73. import { onLoad } from '@dcloudio/uni-app'
  74. import { useI18n } from 'vue-i18n' // uni-app 中已集成,但需配置
  75. import { customApi } from '@/service/custom'
  76. import { financialApi } from '@/service/financial'
  77. import Config from '@/config/index'
  78. import { ibApi } from '@/service/ib'
  79. import { apiList, columnList, mobileList } from '@/pages/ib/const/recording'
  80. import { useFilters } from '@/composables/useFilters'
  81. import { useConfirm } from '@/hooks/useConfirm'
  82. const confirm = useConfirm()
  83. const { numberFormat, numberDecimal } = useFilters()
  84. const { t, locale } = useI18n()
  85. const lang = locale.value
  86. const reasons = ref({})
  87. let { Code } = Config
  88. const typeList = ref([
  89. { text: t('Ib.Recording.NewAccount'), value: 1 },
  90. { text: t('Ib.Recording.LeverageApply'), value: 2 },
  91. { text: t('Ib.Recording.InternalTransfer'), value: 3 },
  92. { text: t('Ib.Recording.ActivitiesApply'), value: 4 },
  93. { text: t('Ib.Recording.MaidAdjust'), value: 5 },
  94. { text: t('Ib.Recording.BelongingAdjust'), value: 6 },
  95. { text: t('Ib.Recording.CommissionAllocation'), value: 7 },
  96. { text: t('Custom.Withdraw.Title'), value: 8 },
  97. { text: t('Ib.Recording.MamHangUndo'), value: 9 },
  98. { text: t('Home.page_ib.item9'), value: 10 },
  99. { text: t('Ib.PammManager.title2'), value: 11 },
  100. { text: t('Ib.PammManager.title3'), value: 12 },
  101. { text: t('Ib.Transfer.IbAccountTransfer'), value: 13 },
  102. ])
  103. const search = ref({
  104. types: 1,
  105. date: '',
  106. startDate: '',
  107. endDate: '',
  108. })
  109. const isZh = computed(() => {
  110. ['cn', 'zhHant'].indexOf(lang) != -1
  111. })
  112. // 表格列配置 根据types 切换
  113. const columns = computed(() => {
  114. return columnList[search.value.types]
  115. })
  116. const mobilePrimaryFields = computed(() => {
  117. return [
  118. ...mobileList[search.value.types],
  119. {
  120. prop: 'more',
  121. type: 'more',
  122. width: 20,
  123. align: 'right',
  124. }
  125. ]
  126. })
  127. // 接口 根据types 切换
  128. const listApi = computed(() => {
  129. return ibApi[apiList[search.value.types]]
  130. })
  131. //获取原因列表
  132. const searchReasons = async () => {
  133. let res = await customApi.reasonsRefusalList({ type: nviewl })
  134. if (res.code == Code.StatusOK) {
  135. if (res.data == nviewl) {
  136. reasons.value = {}
  137. } else {
  138. reasons.value = res.data
  139. }
  140. } else {
  141. uni.showToast({
  142. title: res.msg,
  143. icon: 'none',
  144. })
  145. }
  146. }
  147. const handleDateChange = (val) => {
  148. search.value.startDate = val[0]
  149. search.value.endDate = val[1]
  150. }
  151. const cancel = async (id) => {
  152. try {
  153. await confirm({
  154. title: t('Msg.SystemPrompt'),
  155. content: t('Msg.Cancle'),
  156. confirmText: t('Btn.item6'),
  157. cancelText: t('Btn.item7'),
  158. })
  159. let res = await ibApi.withdrawCancel({ id })
  160. if (res.code == Code.StatusOK) {
  161. uni.showToast({
  162. title: t('Msg.Success'),
  163. icon: 'success',
  164. })
  165. } else {
  166. uni.showToast({
  167. title: res.msg,
  168. icon: 'none',
  169. })
  170. }
  171. } catch (err) {
  172. }
  173. }
  174. onMounted(() => {
  175. searchReasons()
  176. })
  177. </script>
  178. <style lang="scss" scoped>
  179. @import "@/uni.scss";
  180. .search-content {
  181. display: flex;
  182. justify-content: space-between;
  183. }
  184. </style>