adminIndex.vue 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195
  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. key: 'assignStatus',
  50. value: [0]
  51. }],
  52. }, {
  53. name: '详情',
  54. apiName: '',
  55. btnType: 'primary',
  56. type: '1',
  57. pageUrl: '/pages/saleManage/contact/components/drawer'
  58. }, {
  59. name: '释放',
  60. apiName: 'setFree',
  61. btnType: 'warning ',
  62. type: '2',
  63. pageUrl: '',
  64. judge: [{
  65. key: 'assignStatus',
  66. value: [1]
  67. }],
  68. }, {
  69. name: '指派',
  70. apiName: 'assignModelShow',
  71. btnType: 'warning ',
  72. type: '2',
  73. pageUrl: '',
  74. judge: [{
  75. key: 'assignStatus',
  76. value: [0]
  77. }],
  78. }, {
  79. name: '删除',
  80. apiName: 'del',
  81. btnType: 'error',
  82. type: '2',
  83. pageUrl: '',
  84. judge: [{
  85. key: 'assignStatus',
  86. value: [0]
  87. }],
  88. }],
  89. searchVal: '',
  90. categoryLevelId: '',
  91. classificationList:[]
  92. }
  93. },
  94. async onLoad() {
  95. getTreeByPid(17).then(res => {
  96. this.classificationList = res.data
  97. });
  98. this.$nextTick(() => {
  99. this.$refs.contactListRef.getList({
  100. type: 1,
  101. })
  102. })
  103. },
  104. methods: {
  105. doSearch(){
  106. this.$nextTick(() => {
  107. this.$refs.contactListRef.doSearch({
  108. type: 1,
  109. name: this.searchVal,
  110. categoryId: this.categoryLevelId,
  111. })
  112. })
  113. },
  114. confirm([id]) {
  115. this.categoryLevelId = id
  116. this.doSearch()
  117. },
  118. add() {
  119. uni.navigateTo({
  120. url: '/pages/saleManage/contact/add'
  121. })
  122. },
  123. scrolltolower() {
  124. this.$refs.contactListRef.getList({
  125. type: 1,
  126. name: this.searchVal,
  127. categoryId: this.categoryLevelId,
  128. })
  129. },
  130. }
  131. }
  132. </script>
  133. <style lang="scss" scoped>
  134. .add {
  135. width: 96rpx;
  136. height: 96rpx;
  137. border-radius: 48rpx;
  138. background: #3c9cff;
  139. position: fixed;
  140. bottom: 100rpx;
  141. right: 24rpx;
  142. display: flex;
  143. align-items: center;
  144. justify-content: center;
  145. }
  146. .top-wrapper {
  147. background-color: #fff;
  148. display: flex;
  149. width: 750rpx;
  150. height: 88rpx;
  151. padding: 16rpx 32rpx;
  152. align-items: center;
  153. gap: 16rpx;
  154. /deep/.uni-section {
  155. margin-top: 0px;
  156. }
  157. /deep/.uni-section-header {
  158. padding: 0px;
  159. }
  160. .search_btn {
  161. width: 120rpx;
  162. height: 70rpx;
  163. line-height: 70rpx;
  164. padding: 0 24rpx;
  165. background: $theme-color;
  166. font-size: 32rpx;
  167. color: #fff;
  168. margin: 0;
  169. margin-left: 26rpx;
  170. }
  171. .menu_icon {
  172. width: 44rpx;
  173. height: 44rpx;
  174. margin-left: 14rpx;
  175. }
  176. }
  177. </style>