subsList.vue 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187
  1. <template>
  2. <cwg-page-wrapper class="create-page" :isHeaderFixed="true">
  3. <cwg-header :title="t('Ib.Custom.Manage2')" />
  4. <view class="account-content">
  5. <view class="search-content">
  6. <view class="search-bar">
  7. <uni-easyinput v-model="search.ibNo" :placeholder="t('Label.IbAccount')" />
  8. <uni-easyinput v-model="search.name" :placeholder="t('Ib.Custom.NameLabel')" />
  9. <uni-easyinput v-model="search.cId" placeholder="CID" />
  10. <uni-datetime-picker type="daterange" v-model="search.date"
  11. :placeholder="t('placeholder.Start') + ' - ' + t('placeholder.End')" @change="handleDateChange"/>
  12. </view>
  13. <view class="search-bar">
  14. <button type="primary" class="search-button" @click="addSub">
  15. <cwg-icon name="icon_add" :size="18" color="#fff"></cwg-icon>
  16. {{t('Ib.Report.Title5')}}
  17. </button>
  18. </view>
  19. </view>
  20. <cwg-tabel
  21. ref="tableRef"
  22. :columns="columns"
  23. :mobilePrimaryFields="mobilePrimaryFields"
  24. :queryParams="search"
  25. :api="listApi"
  26. :show-operation="true"
  27. :showPagination="true"
  28. >
  29. <template #action="{ row }">
  30. <cwg-dropdown :menu-list="menuList(row)" @menuClick="handleMenuClick">
  31. <view class="pc-header-btn">
  32. <cwg-icon name="crm-ellipsis" :size="24" />
  33. </view>
  34. </cwg-dropdown>
  35. </template>
  36. </cwg-tabel>
  37. </view>
  38. </cwg-page-wrapper>
  39. </template>
  40. <script setup lang="ts">
  41. // 代理管理
  42. import { ref, reactive, computed, onMounted, onUnmounted } from 'vue'
  43. import { onLoad } from '@dcloudio/uni-app'
  44. import { useI18n } from 'vue-i18n' // uni-app 中已集成,但需配置
  45. import { customApi } from '@/service/custom'
  46. import { financialApi } from '@/service/financial'
  47. import Config from '@/config/index'
  48. import { lang } from '@/composables/config'
  49. import { ibApi } from '@/service/ib'
  50. import { useFilters } from '@/composables/useFilters'
  51. const { numberFormat, numberDecimal } = useFilters()
  52. const search = ref({
  53. ibNo: '',
  54. name: '',
  55. date: '',
  56. cId: '',
  57. startDate: '',
  58. endDate: '',
  59. })
  60. const { t, locale } = useI18n()
  61. // 表格列配置
  62. const columns = ref([
  63. {
  64. prop: 'cId',
  65. label: t('Label.CidAccount'),
  66. align: 'center',
  67. },
  68. {
  69. prop: 'ibNo',
  70. label: t('Label.IbAccount'),
  71. align: 'center',
  72. },
  73. {
  74. prop: 'name',
  75. label: t('Ib.Custom.NameLabel'),
  76. align: 'center',
  77. },
  78. {
  79. prop: 'agentNum',
  80. label: t('Ib.Custom.AgentNum'),
  81. align: 'center',
  82. },
  83. {
  84. prop: 'customNum',
  85. label: t('Ib.Custom.CustomerNum'),
  86. align: 'center',
  87. },
  88. {
  89. prop: 'addTime',
  90. label: t('Label.ApplyTime'),
  91. align: 'center',
  92. },
  93. {
  94. prop: 'lastTime',
  95. label: t('Ib.Custom.LastActiveTime'),
  96. align: 'center',
  97. },
  98. {
  99. prop: 'action',
  100. label: t('Label.Action'),
  101. align: 'center',
  102. slot: 'action',
  103. },
  104. ])
  105. const mobilePrimaryFields = ref([
  106. {
  107. prop: 'cId',
  108. label: t('Label.CidAccount'),
  109. align: 'center',
  110. },
  111. {
  112. prop: 'ibNo',
  113. label: t('Label.IbAccount'),
  114. align: 'center',
  115. },
  116. {
  117. prop: 'name',
  118. label: t('Ib.Custom.NameLabel'),
  119. align: 'center',
  120. },
  121. {
  122. prop: 'more',
  123. type: 'more',
  124. width: 20,
  125. align: 'right',
  126. },
  127. ])
  128. const listApi = ref(ibApi.IbSubs)
  129. const handleDateChange = (val) => {
  130. search.value.startDate = val[0]
  131. search.value.endDate = val[1]
  132. }
  133. // 下拉菜单配置
  134. const menuList = (row) => {
  135. return [
  136. {
  137. label: t('Ib.Custom.Commit3'),
  138. type: 'vietnamDistribution',
  139. row,
  140. show: true,
  141. },
  142. {
  143. label: t('Ib.Custom.Commit5'),
  144. type: 'exclusiveCommission',
  145. row,
  146. show: row.exclusiveCommissionOptions?.length > 0,
  147. },
  148. ].filter((item) => item.show)
  149. }
  150. const handleMenuClick = (item) => {
  151. if (item.type == 'vietnamDistribution') {
  152. const { cId, id, permissionDisplay } = item.row
  153. formInfoRow.value = {
  154. cId, id, permissionDisplay,
  155. }
  156. docVisible.value = true
  157. } else if (item.type == 'exclusiveCommission') {
  158. const { cId, id, comPoint1, hide1 } = item.row
  159. pointForm.value = {
  160. cId, id, comPoint1, hide1,
  161. }
  162. pointVisible.value = true
  163. }
  164. }
  165. </script>
  166. <style lang="scss" scoped>
  167. @import "@/uni.scss";
  168. .search-content {
  169. display: flex;
  170. justify-content: space-between;
  171. }
  172. .search-button{
  173. display: flex;
  174. align-items: center;
  175. line-height: px2rpx(36);
  176. min-width: px2rpx(120);
  177. }
  178. </style>