agentList.vue 7.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295
  1. <template>
  2. <cwg-page-wrapper class="create-page" :isHeaderFixed="true">
  3. <cwg-header :title="t('Documentary.console.item23')" />
  4. <view class="account-content">
  5. <view class="search-content">
  6. <view class="search-bar">
  7. <cwg-complex-search :fields="filterFields" v-model="searchParams" @search="handleSearch"
  8. @reset="handleReset" />
  9. </view>
  10. </view>
  11. <cwg-tabel class="table-container" ref="tableRef" :columns="columns" :mobilePrimaryFields="mobilePrimaryFields"
  12. :queryParams="search" :api="listApi" :show-operation="true" :showPagination="true">
  13. </cwg-tabel>
  14. </view>
  15. <!-- 专属手续费分配/展示设置确认弹窗 -->
  16. <cwg-popup :visible="dialogInfoTradingAddTc" :title="t('Ib.Custom.Btn')" :cancelText="t('Btn.Cancel')"
  17. :confirmText="t('Btn.Confirm')" @close="dialogInfoTradingAddCanle" @confirm="dialogInfoTradingAddOpen">
  18. <view class="dia-content custom-dialog-content">
  19. <view class="desc-text">
  20. <view class="desc-p">{{ t('news_add_field1.CustomerManagement.item1') }}</view>
  21. <view class="desc-p">{{ t('news_add_field1.CustomerManagement.item2') }}</view>
  22. </view>
  23. <view class="agree-box">
  24. <checkbox-group @change="onAgreeChange">
  25. <label class="agree-label">
  26. <checkbox :value="1" :checked="dialogInfoTradingAddTcAgree" color="#2b5aed"
  27. style="transform:scale(0.8)" />
  28. <view class="agree-des">
  29. <text>{{ t('news_add_field1.CustomerManagement.item3') }}</text>
  30. </view>
  31. </label>
  32. </checkbox-group>
  33. </view>
  34. </view>
  35. </cwg-popup>
  36. </cwg-page-wrapper>
  37. </template>
  38. <script setup lang="ts">
  39. // 信号源管理
  40. import { ref, reactive, computed, onMounted, onUnmounted, nextTick } from 'vue'
  41. import { onLoad } from '@dcloudio/uni-app'
  42. import { useI18n } from 'vue-i18n' // uni-app 中已集成,但需配置
  43. import Config from '@/config/index'
  44. import { lang } from '@/composables/config'
  45. import { ibApi } from '@/service/ib'
  46. import { useFilters } from '@/composables/useFilters'
  47. const { numberFormat, numberDecimal } = useFilters()
  48. const searchParams = ref({})
  49. const search = ref({
  50. name: ''
  51. })
  52. const filterFields = computed(() => [
  53. { key: 'name', type: 'input', label: t('Ib.Custom.NameLabel'), placeholder: t('Ib.Custom.NameLabel'), defaultValue: '' },
  54. ])
  55. const tableRef = ref<any>(null)
  56. const handleSearch = (params: any) => {
  57. search.value = { ...params }
  58. nextTick(() => {
  59. tableRef.value?.refreshTable?.()
  60. })
  61. }
  62. const handleReset = (params: any) => {
  63. search.value = {
  64. ...params,
  65. }
  66. nextTick(() => {
  67. tableRef.value?.refreshTable?.()
  68. })
  69. }
  70. const formInfo = ref({})
  71. const dialogInfoTradingAddTc = ref(false)
  72. const dialogInfoTradingAddTcAgree = ref(false)
  73. const dialogInfoTradingAdd = ref(false)
  74. const { t, locale } = useI18n()
  75. // 表格列配置
  76. const columns = ref([
  77. {
  78. prop: 'dealCId',
  79. label: t('Label.CidAccount'),
  80. align: 'center',
  81. },
  82. {
  83. prop: 'pIbNo',
  84. label: t('Label.AgentNumber'),
  85. align: 'center',
  86. },
  87. {
  88. prop: 'nickname',
  89. label: t('Documentary.console.item20'),
  90. align: 'center',
  91. },
  92. {
  93. prop: 'dealLogin',
  94. label: t('Documentary.tradingCenter.item18'),
  95. align: 'center',
  96. },
  97. {
  98. prop: 'dealPlatform',
  99. label: t('Label.Platform'),
  100. align: 'center',
  101. },
  102. {
  103. prop: 'dealLeverage',
  104. label: t('Label.Leverage'),
  105. align: 'center',
  106. },
  107. {
  108. prop: 'dealLoginType',
  109. type: 'tag',
  110. label: t('Label.AccountType'),
  111. align: 'center',
  112. tagMap: {
  113. 1: t('AccountType.ClassicAccount'),
  114. 2: t('AccountType.SeniorAccount'),
  115. 5: t('AccountType.SpeedAccount'),
  116. 6: t('AccountType.SpeedAccount'),
  117. 7: t('AccountType.StandardAccount'),
  118. 8: t('AccountType.CentAccount'),
  119. },
  120. },
  121. {
  122. prop: 'distributionType',
  123. label: t('Documentary.AgentBackground.item11'),
  124. align: 'center',
  125. formatter: ({ row }) => row.distributionType === 1 ? t('Documentary.TundManagement.item59') : '--',
  126. },
  127. {
  128. prop: 'distributionRatio',
  129. label: t('Documentary.Report.item5'),
  130. align: 'center',
  131. },
  132. {
  133. prop: 'settlementCycle',
  134. label: t('Documentary.AgentBackground.item13'),
  135. align: 'center',
  136. },
  137. {
  138. prop: 'approveTime',
  139. label: t('Label.ApplyTime'),
  140. align: 'center',
  141. },
  142. {
  143. prop: 'permissionDisplay',
  144. type: 'tag',
  145. label: t('Documentary.AgentBackground.item14'),
  146. align: 'center',
  147. tagMap: {
  148. 1: t('Documentary.AgentBackground.item16'),
  149. 2: t('Documentary.AgentBackground.item15'),
  150. },
  151. },
  152. {
  153. prop: 'action',
  154. label: t('Label.Action'),
  155. type: 'action',
  156. align: 'center',
  157. menuList: [
  158. {
  159. label: t('Ib.Custom.Btn'),
  160. type: 'DisplaySettings',
  161. btnClick: (row) => handleMenuClick({ type: 'DisplaySettings', row }),
  162. show: (row) => row.agentUpdatePurview == '1',
  163. },
  164. ]
  165. },
  166. ])
  167. const mobilePrimaryFields = ref([
  168. {
  169. prop: 'cId',
  170. label: t('Label.CidAccount'),
  171. align: 'center',
  172. },
  173. {
  174. prop: 'ibNo',
  175. label: t('Label.IbAccount'),
  176. align: 'center',
  177. },
  178. {
  179. prop: 'name',
  180. label: t('Ib.Custom.NameLabel'),
  181. align: 'center',
  182. },
  183. {
  184. prop: 'more',
  185. type: 'more',
  186. width: 20,
  187. align: 'right',
  188. },
  189. ])
  190. const listApi = ref(ibApi.followDealAgentSearchList)
  191. const handleDateChange = (val) => {
  192. search.value.startDate = val[0]
  193. search.value.endDate = val[1]
  194. }
  195. const handleMenuClick = (item) => {
  196. if (item.type == 'DisplaySettings') {
  197. const { dealLogin, id, permissionDisplay, pIbNo, agentDistributionRatio } = item.row
  198. formInfo.value = {
  199. dealLogin, id, permissionDisplay,
  200. ibNo: pIbNo,
  201. agentDistributionRatio: agentDistributionRatio == null ? '' : agentDistributionRatio.toString()
  202. }
  203. dialogInfoTradingAddTcAgree.value = false
  204. dialogInfoTradingAddTc.value = true
  205. }
  206. }
  207. const onAgreeChange = (e: any) => {
  208. dialogInfoTradingAddTcAgree.value = e.detail.value.length > 0
  209. }
  210. const dialogInfoTradingAddCanle = () => {
  211. dialogInfoTradingAddTc.value = false
  212. dialogInfoTradingAddTcAgree.value = false
  213. }
  214. const dialogInfoTradingAddOpen = () => {
  215. if (!dialogInfoTradingAddTcAgree.value) {
  216. uni.showToast({ title: t('Msg.Read'), icon: 'none' })
  217. return
  218. }
  219. dialogInfoTradingAddTc.value = false
  220. dialogInfoTradingAdd.value = true
  221. dialogInfoTradingAddTcAgree.value = false
  222. }
  223. onMounted(() => {
  224. // dialogInfoTradingAddTc.value = true
  225. })
  226. </script>
  227. <style lang="scss" scoped>
  228. @import "@/uni.scss";
  229. .search-content {
  230. display: flex;
  231. justify-content: space-between;
  232. }
  233. .search-button {
  234. display: flex;
  235. align-items: center;
  236. height: px2rpx(36);
  237. line-height: px2rpx(36);
  238. }
  239. .custom-dialog-content {
  240. padding: px2rpx(20);
  241. }
  242. .desc-text {
  243. text-align: initial;
  244. line-height: 1.5;
  245. margin-bottom: px2rpx(20);
  246. color: var(--bs-heading-color);
  247. font-size: px2rpx(14);
  248. .desc-p {
  249. margin-bottom: px2rpx(10);
  250. }
  251. }
  252. .agree-box {
  253. margin-top: px2rpx(15);
  254. .agree-label {
  255. display: flex;
  256. align-items: flex-start;
  257. cursor: pointer;
  258. }
  259. .agree-des {
  260. flex: 1;
  261. font-size: px2rpx(14);
  262. color: #606266;
  263. line-height: 1.5;
  264. margin-left: px2rpx(5);
  265. margin-top: px2rpx(3);
  266. }
  267. }
  268. </style>