adminIndex.vue 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203
  1. <template>
  2. <view class="mainBox">
  3. <uni-nav-bar fixed="true" statusBar="true" left-icon="back" title="公海客户" @clickLeft="back">
  4. <!--右菜单-->
  5. <template slot="right">
  6. <u-button type="success" size="small" class="u-reset-button" @click="$refs.treePicker._show()"
  7. text="选择分类"></u-button>
  8. </template>
  9. </uni-nav-bar>
  10. <view class="top-wrapper">
  11. <uni-section>
  12. <uni-easyinput prefixIcon="search" style="width: 460rpx" v-model="searchVal" placeholder="名称">
  13. </uni-easyinput>
  14. </uni-section>
  15. <button class="search_btn" @click="doSearch">搜索</button>
  16. <image class="menu_icon" src="~@/static/pda/menu.svg"></image>
  17. </view>
  18. <u-list @scrolltolower="scrolltolower">
  19. <contactList :btnList="btnList" ref="contactListRef"></contactList>
  20. </u-list>
  21. <view class="add" @click="add">
  22. <u-icon name="plus" color="#fff"></u-icon>
  23. </view>
  24. <ba-tree-picker ref="treePicker" key="verify" :multiple="false" @select-change="confirm" title="选择分类"
  25. :localdata="classificationList" valueKey="id" textKey="name" />
  26. </view>
  27. </template>
  28. <script>
  29. import contactList from './contactList.vue'
  30. import baTreePicker from '@/components/ba-tree-picker/ba-tree-picker.vue'
  31. import {
  32. getTreeByPid,
  33. } from '@/api/classifyManage'
  34. export default {
  35. components: {
  36. contactList,
  37. baTreePicker
  38. },
  39. data() {
  40. return {
  41. treeList: [],
  42. btnList: [{
  43. name: '修改',
  44. apiName: '',
  45. btnType: 'primary',
  46. type: '1',
  47. pageUrl: '/pages/saleManage/contact/add',
  48. judge: [{
  49. authorities: 'eom:contact:update',
  50. },{
  51. key: 'assignStatus',
  52. value: [0]
  53. }],
  54. }, {
  55. name: '详情',
  56. apiName: '',
  57. btnType: 'primary',
  58. type: '1',
  59. pageUrl: '/pages/saleManage/contact/components/drawer'
  60. }, {
  61. name: '释放',
  62. apiName: 'setFree',
  63. btnType: 'warning ',
  64. type: '2',
  65. pageUrl: '',
  66. judge: [{
  67. // authorities: 'eom:contact:free',
  68. },{
  69. key: 'assignStatus',
  70. value: [1]
  71. }],
  72. }, {
  73. name: '指派',
  74. apiName: 'assignModelShow',
  75. btnType: 'warning ',
  76. type: '2',
  77. pageUrl: '',
  78. judge: [{
  79. // authorities: 'eom:contact:assign',
  80. },{
  81. key: 'assignStatus',
  82. value: [0]
  83. }],
  84. }, {
  85. name: '删除',
  86. apiName: 'del',
  87. btnType: 'error',
  88. type: '2',
  89. pageUrl: '',
  90. judge: [{
  91. // authorities: 'eom:contact:delete',
  92. },{
  93. key: 'assignStatus',
  94. value: [0]
  95. }],
  96. }],
  97. searchVal: '',
  98. categoryLevelId: '',
  99. classificationList:[]
  100. }
  101. },
  102. async onShow() {
  103. getTreeByPid(17).then(res => {
  104. this.classificationList = res.data
  105. });
  106. this.$nextTick(() => {
  107. this.$refs.contactListRef.doSearch({
  108. type: 1,
  109. })
  110. })
  111. },
  112. methods: {
  113. doSearch(){
  114. this.$nextTick(() => {
  115. this.$refs.contactListRef.doSearch({
  116. type: 1,
  117. name: this.searchVal,
  118. categoryId: this.categoryLevelId,
  119. })
  120. })
  121. },
  122. confirm([id]) {
  123. this.categoryLevelId = id
  124. this.doSearch()
  125. },
  126. add() {
  127. uni.navigateTo({
  128. url: '/pages/saleManage/contact/add'
  129. })
  130. },
  131. scrolltolower() {
  132. this.$refs.contactListRef.getList({
  133. type: 1,
  134. name: this.searchVal,
  135. categoryId: this.categoryLevelId,
  136. })
  137. },
  138. }
  139. }
  140. </script>
  141. <style lang="scss" scoped>
  142. .add {
  143. width: 96rpx;
  144. height: 96rpx;
  145. border-radius: 48rpx;
  146. background: #3c9cff;
  147. position: fixed;
  148. bottom: 100rpx;
  149. right: 24rpx;
  150. display: flex;
  151. align-items: center;
  152. justify-content: center;
  153. }
  154. .top-wrapper {
  155. background-color: #fff;
  156. display: flex;
  157. width: 750rpx;
  158. height: 88rpx;
  159. padding: 16rpx 32rpx;
  160. align-items: center;
  161. gap: 16rpx;
  162. /deep/.uni-section {
  163. margin-top: 0px;
  164. }
  165. /deep/.uni-section-header {
  166. padding: 0px;
  167. }
  168. .search_btn {
  169. width: 120rpx;
  170. height: 70rpx;
  171. line-height: 70rpx;
  172. padding: 0 24rpx;
  173. background: $theme-color;
  174. font-size: 32rpx;
  175. color: #fff;
  176. margin: 0;
  177. margin-left: 26rpx;
  178. }
  179. .menu_icon {
  180. width: 44rpx;
  181. height: 44rpx;
  182. margin-left: 14rpx;
  183. }
  184. }
  185. </style>