agentList.vue 7.3 KB

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