index.vue 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150
  1. <template>
  2. <view class="uni-app">
  3. <view class="status-bar" />
  4. <view class="main-container">
  5. <wk-nav-bar title="线索" :show-left="!showTabbar">
  6. <!-- #ifndef MP-WEIXIN -->
  7. <button class="button white-btn" @click="handleCrmSearch">
  8. <text class="wk wk-search" />
  9. </button>
  10. <!-- #endif -->
  11. </wk-nav-bar>
  12. <!-- #ifdef MP-WEIXIN -->
  13. <view class="search-box linear-gradient">
  14. <view class="box" @click="handleCrmSearch">
  15. <text class="wk wk-search" />
  16. <text class="wk-placeholder">
  17. 请输入线索名称/手机/电话
  18. </text>
  19. </view>
  20. </view>
  21. <!-- #endif -->
  22. <view class="list-view">
  23. <view class="list-wrapper">
  24. <list-filter
  25. crm-type="leads"
  26. @filter="handleFilter" />
  27. <wk-scroll-view
  28. v-if="!refreshPage"
  29. :status="listStatus"
  30. class="list-scroll"
  31. @refresh="getList({}, true)"
  32. @loadmore="getList()">
  33. <leads-item
  34. v-for="item in listData"
  35. :key="item.leadsId"
  36. :item-data="item" />
  37. </wk-scroll-view>
  38. </view>
  39. </view>
  40. </view>
  41. <wk-drag-button
  42. v-if="showAddBtn"
  43. @click="handleAdd">
  44. <view class="wk-drag-btn">
  45. <text class="wk wk-plus icon" />
  46. </view>
  47. </wk-drag-button>
  48. <wk-tabbar
  49. v-if="showTabbar"
  50. v-model="footerIndex"
  51. :list="mixinFooterNav" />
  52. </view>
  53. </template>
  54. <script>
  55. import { GetList } from 'API/crm/leads'
  56. import LeadsItem from './components/leadsItem.vue'
  57. import ListFilter from '../components/listFilter/index.vue'
  58. import tabbar from '@/mixins/tabbar.js'
  59. import mainListMixins from '@/mixins/mainList.js'
  60. export default {
  61. name: 'LeadsIndex',
  62. components: {
  63. LeadsItem,
  64. ListFilter
  65. },
  66. mixins: [tabbar, mainListMixins],
  67. data() {
  68. return {
  69. navIndex: 0,
  70. navList: [
  71. {label: '线索', com: 'CustomerList', action: 'crm.leads.read'}
  72. ],
  73. GetListFn: GetList, // 获取列表数据接口
  74. listType: 'crm_leads',
  75. refreshPage: false // 刷新页面标志
  76. }
  77. },
  78. computed: {
  79. showAddBtn() {
  80. return this.$auth('crm.leads.save')
  81. }
  82. },
  83. onShow() {
  84. if (this.refreshPage) {
  85. this.$nextTick(function() {
  86. this.refreshPage = false
  87. this.getList({}, true)
  88. })
  89. }
  90. },
  91. methods: {
  92. handleFilter(opt) {
  93. this.listParams = {
  94. page: 0,
  95. limit: 15
  96. }
  97. this.getList(opt, true)
  98. },
  99. handleAdd() {
  100. this.$Router.navigateTo({
  101. url: '/pages_crm/leads/create'
  102. })
  103. },
  104. handleCrmSearch() {
  105. this.$Router.navigateTo({
  106. url: '/pages_crm/crmSearch',
  107. query: {
  108. type: 'leads'
  109. }
  110. })
  111. }
  112. }
  113. }
  114. </script>
  115. <style scoped lang="scss">
  116. @import '../style/list.scss';
  117. .main-container {
  118. .list-view {
  119. flex: 1;
  120. overflow-y: hidden;
  121. .list-wrapper {
  122. width: 100%;
  123. height: 100%;
  124. display: flex;
  125. flex-direction: column;
  126. overflow: hidden;
  127. .list-scroll {
  128. flex: 1;
  129. overflow: hidden;
  130. }
  131. }
  132. }
  133. }
  134. </style>