agentList.vue 7.7 KB

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