contactsList.vue 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. <template>
  2. <view class="list-wrapper">
  3. <list-filter
  4. crm-type="contacts"
  5. @filter="handleFilter" />
  6. <wk-scroll-view
  7. :status="listStatus"
  8. class="list-scroll"
  9. @refresh="getList({}, true)"
  10. @loadmore="getList()">
  11. <contacts-item
  12. v-for="(item, index) in listData"
  13. :key="item.contactsId"
  14. :index="index"
  15. :item-data="item" />
  16. </wk-scroll-view>
  17. <wk-drag-button
  18. v-if="showAddBtn"
  19. @click="handleAdd">
  20. <view class="wk-drag-btn">
  21. <text class="wk wk-plus icon" />
  22. </view>
  23. </wk-drag-button>
  24. </view>
  25. </template>
  26. <script>
  27. import { GetList } from 'API/crm/concat'
  28. import ContactsItem from '../contacts/components/contactsItem'
  29. import ListFilter from '../components/listFilter/index.vue'
  30. import mainListMixins from '../../mixins/mainList.js'
  31. export default {
  32. name: 'ContactsList',
  33. components: {
  34. ContactsItem,
  35. ListFilter
  36. },
  37. mixins: [mainListMixins],
  38. data() {
  39. return {
  40. GetListFn: GetList, // 获取列表数据接口
  41. listType: 'crm_contacts'
  42. }
  43. },
  44. computed: {
  45. showAddBtn() {
  46. return this.$auth('crm.contacts.save')
  47. }
  48. },
  49. methods: {
  50. handleFilter(opt) {
  51. this.listParams = {
  52. page: 0,
  53. limit: 15
  54. }
  55. this.getList(opt, true)
  56. },
  57. getParams() {
  58. return {search: ''}
  59. },
  60. handleAdd() {
  61. this.$Router.navigateTo({
  62. url: '/pages_crm/contacts/create'
  63. })
  64. }
  65. }
  66. }
  67. </script>
  68. <style scoped lang="scss">
  69. .list-wrapper {
  70. width: 100%;
  71. height: 100%;
  72. display: flex;
  73. flex-direction: column;
  74. overflow: hidden;
  75. .list-scroll {
  76. flex: 1;
  77. overflow: hidden;
  78. }
  79. }
  80. </style>