index.vue 3.6 KB

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