index.vue 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153
  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="invoice"
  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. <invoice-item
  34. v-for="item in listData"
  35. :key="item.invoiceId"
  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/invoice'
  56. import InvoiceItem from './components/invoiceItem'
  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: 'InvoiceIndex',
  62. components: {
  63. InvoiceItem,
  64. ListFilter
  65. },
  66. mixins: [tabbar, mainListMixins],
  67. data() {
  68. return {
  69. GetListFn: GetList, // 获取列表数据接口
  70. listType: 'crm_invoice',
  71. refreshPage: false // 刷新页面标志
  72. }
  73. },
  74. computed: {
  75. showAddBtn() {
  76. return this.$auth('crm.invoice.save')
  77. }
  78. },
  79. onShow() {
  80. if (this.refreshPage) {
  81. this.$nextTick(function() {
  82. this.refreshPage = false
  83. this.getList({}, true)
  84. })
  85. }
  86. },
  87. methods: {
  88. handleFilter(opt) {
  89. this.listParams = {
  90. page: 0,
  91. limit: 15
  92. }
  93. this.getList(opt, true)
  94. },
  95. handleAdd() {
  96. this.$Router.navigateTo({
  97. url: '/pages_crm/invoice/create',
  98. query: {
  99. type: 'invoice'
  100. }
  101. })
  102. },
  103. handleCrmSearch() {
  104. this.$Router.navigateTo({
  105. url: '/pages_crm/crmSearch',
  106. query: {
  107. type: 'invoice'
  108. }
  109. })
  110. }
  111. }
  112. }
  113. </script>
  114. <style scoped lang="scss">
  115. @import '../style/list.scss';
  116. .ft-statistics {
  117. font-size: 34rpx;
  118. }
  119. .main-container {
  120. .list-view {
  121. flex: 1;
  122. overflow-y: hidden;
  123. .list-wrapper {
  124. width: 100%;
  125. height: 100%;
  126. display: flex;
  127. flex-direction: column;
  128. overflow: hidden;
  129. .list-scroll {
  130. flex: 1;
  131. overflow: hidden;
  132. }
  133. }
  134. }
  135. }
  136. </style>