reportInfo.vue 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194
  1. <template>
  2. <cwg-page-wrapper class="create-page" :isHeaderFixed="true">
  3. <cwg-header :title="t('vu.IbReport.title1')" />
  4. <view class="account-content">
  5. <cwg-tabel ref="tableRef" :columns="columns" :mobilePrimaryFields="mobilePrimaryFields" :queryParams="search"
  6. :api="listApi" :show-operation="false" :showPagination="true" :immediate="false"
  7. >
  8. </cwg-tabel>
  9. </view>
  10. </cwg-page-wrapper>
  11. </template>
  12. <script setup lang="ts">
  13. // 报告
  14. import { ref, computed, onMounted, watch, nextTick, reactive } from 'vue'
  15. import { useI18n } from 'vue-i18n'
  16. import { onLoad } from '@dcloudio/uni-app'
  17. import Config from '@/config/index'
  18. import { ibApi } from '@/service/ib'
  19. import { useReportConst } from '@/pages/ib/const/report'
  20. import { useFilters } from '@/composables/useFilters'
  21. import { isAfterJuly28 } from '@/utils/dateUtils'
  22. import useUserStore from '@/stores/use-user-store'
  23. import dayjs from 'dayjs'
  24. const { numberFormat } = useFilters()
  25. const { t } = useI18n()
  26. const { groupCurrency1 } = useReportConst()
  27. const tableRef = ref(null)
  28. const search = reactive({
  29. login: '',
  30. })
  31. // 表格列配置 根据types 切换
  32. const columns = computed(() => {
  33. return [
  34. { prop: 'ibNo', label: t('Label.AttributionNumber') },
  35. { prop: 'login', label: t('Label.TradingAccount') },
  36. {
  37. prop: 'groupType', label: t('Label.Type'),
  38. type: 'tag',
  39. tagMap: {
  40. 1: t('AccountType.ClassicAccount'),
  41. 2: t('AccountType.SeniorAccount'),
  42. 3: !isAfterJuly28() ? t('AccountType.AgencyAccount') : '',
  43. 4: t('AccountType.ProfessionalAccount'),
  44. 5: t('AccountType.SpeedAccount'),
  45. 6: t('AccountType.SpeedAccount'),
  46. 7: t('AccountType.StandardAccount'),
  47. 8: t('AccountType.CentAccount'),
  48. },
  49. },
  50. { prop: 'symbol', label: t('Label.Varieties') },
  51. {
  52. prop: 'volume', label: t('Label.Volume'),
  53. formatter: ({ row }) => {
  54. return `${numberFormat(row.volume ?? '0')}/${t('Label.Lot')}`
  55. },
  56. },
  57. {
  58. prop: 'rebateAmount', label: t('Label.rebateAmount'),
  59. formatter: ({ row }) => {
  60. return `${groupCurrency1(row.currency)}${numberFormat(row.rebateAmount ?? '0')}`
  61. },
  62. },
  63. {
  64. prop: 'rebatePoint', label: t('Label.rebatePoint'),
  65. formatter: ({ row }) => {
  66. return `${groupCurrency1(row.currency)}${numberFormat(row.rebatePoint ?? '0')}/${t('Label.Lot')}`
  67. },
  68. },
  69. {
  70. prop: 'commissionAmount', label: t('Label.commissionAmount'),
  71. formatter: ({ row }) => {
  72. return `${groupCurrency1(row.currency)}${numberFormat(row.commissionAmount ?? '0')}`
  73. },
  74. },
  75. {
  76. prop: 'commissionPoint', label: t('Label.commissionPoint'),
  77. formatter: ({ row }) => {
  78. return `${groupCurrency1(row.currency)}${numberFormat(row.commissionPoint ?? '0')}/${t('Label.Lot')}`
  79. },
  80. },
  81. { prop: 'openTime', label: t('Label.OpenTime') },
  82. { prop: 'closeTime', label: t('Label.CloseTime') },
  83. ]
  84. })
  85. const mobilePrimaryFields = computed(() => {
  86. return [
  87. { prop: 'ibNo', label: t('Label.AttributionNumber') },
  88. { prop: 'login', label: t('Label.TradingAccount') },
  89. {
  90. prop: 'groupType', label: t('Label.Type'),
  91. type: 'tag',
  92. tagMap: {
  93. 1: t('AccountType.ClassicAccount'),
  94. 2: t('AccountType.SeniorAccount'),
  95. 3: !isAfterJuly28() ? t('AccountType.AgencyAccount') : '',
  96. 4: t('AccountType.ProfessionalAccount'),
  97. 5: t('AccountType.SpeedAccount'),
  98. 6: t('AccountType.SpeedAccount'),
  99. 7: t('AccountType.StandardAccount'),
  100. 8: t('AccountType.CentAccount'),
  101. },
  102. },
  103. {
  104. prop: 'more',
  105. type: 'more',
  106. width: 20,
  107. align: 'center',
  108. },
  109. ]
  110. })
  111. const listApi = ibApi.tradeAgentCommission
  112. onLoad((options) => {
  113. console.log(options)
  114. search.login = options.login
  115. search.date = [
  116. options.closeTime,
  117. options.closeTime,
  118. ]
  119. nextTick(() => {
  120. tableRef.value?.loadData()
  121. })
  122. })
  123. </script>
  124. <style lang="scss" scoped>
  125. @import "@/uni.scss";
  126. .search-content {
  127. display: flex;
  128. justify-content: space-between;
  129. }
  130. .report-platform {
  131. display: flex;
  132. align-items: center;
  133. .checklist-box {
  134. cursor: pointer;
  135. box-sizing: border-box;
  136. padding: 0 px2rpx(20);
  137. border: 1px solid #DCDFE6;
  138. background-color: #f5f5f5;
  139. height: px2rpx(35);
  140. line-height: px2rpx(35);
  141. border-radius: px2rpx(4) 0 0 px2rpx(4);
  142. &:last-child {
  143. border-radius: 0 px2rpx(4) px2rpx(4) 0;
  144. }
  145. &.active {
  146. color: var(--color-white);
  147. background-color: var(--color-error);
  148. border-color: var(--color-error);
  149. }
  150. }
  151. }
  152. .search-input-box {
  153. .uni-input {
  154. height: px2rpx(35);
  155. border: 1px solid #DCDFE6;
  156. padding: 0 px2rpx(20);
  157. border-radius: px2rpx(4);
  158. background-color: rgba(var(--bs-body-bg-rgb), var(--bs-bg-opacity)) !important;
  159. }
  160. }
  161. .agent-select {
  162. width: px2rpx(240);
  163. }
  164. .search-btn {
  165. height: px2rpx(36);
  166. line-height: px2rpx(36);
  167. margin: 0;
  168. }
  169. .btn {
  170. font-size: px2rpx(10);
  171. padding: px2rpx(4) px2rpx(8);
  172. }
  173. </style>