Supplier.vue 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141
  1. <template>
  2. <view>
  3. <view class="tabs-view">
  4. <view class="keyword-view clearfix">
  5. <view class="float_left"><u-search :show-action="false" :clearabled="true" placeholder="供应商名称" v-model="keyword"></u-search></view>
  6. <view v-if="$accessCheck($Access.SupplierAddSupplier)" class="float_right" @click="goPage('/pagesT/Purchase/AddSupplier')"><u-icon name="plus" color="#333333" size="40"></u-icon></view>
  7. </view>
  8. </view>
  9. <view class="list-ul" v-if="$accessCheck($Access.SupplierGetAllSupplier)">
  10. <view class="list-li" v-for="(item, index) in supplier_list" :key="index" @click="goPage('/pagesT/Purchase/SupplierDetail?id=' + item.id)">
  11. <view class="title clearfix">
  12. <view class="float_left">{{ item.title }}</view>
  13. <view class="float_right">
  14. <text class="success-status" v-if="item.enableStatus === 5">启用</text>
  15. <text class="danger-status" v-else>禁用</text>
  16. <text class="custom-icon custom-icon-jinru"></text>
  17. </view>
  18. </view>
  19. <view class="list-cont">
  20. <view class="list-cont-li">编号:{{ item.code || '--' }}</view>
  21. <view class="list-cont-li clearfix">
  22. <view class="float_left">联系人:{{ item.realName || '--' }}</view>
  23. <view class="float_right mobile" @click.stop="callPhone(item.mobile)">
  24. {{ item.mobile }}
  25. <u-icon name="arrow-right" size="24"></u-icon>
  26. </view>
  27. </view>
  28. <view class="list-cont-li clearfix">地区:{{ item.area.provinceName }} {{ item.area.cityName }} {{ item.area.districtName }} {{ item.area.address }}</view>
  29. </view>
  30. </view>
  31. <view v-if="!supplier_list.length" class="empty-view"><u-empty text="暂无数据" mode="list"></u-empty></view>
  32. <u-loadmore v-if="supplier_list.length" :status="load_status" />
  33. </view>
  34. </view>
  35. </template>
  36. <script>
  37. export default {
  38. data() {
  39. return {
  40. supplier_list: [],
  41. load_status: 'nomore',
  42. page: 1,
  43. pageSize: 10,
  44. total: 0,
  45. tabs_current: 0,
  46. keyword: ''
  47. };
  48. },
  49. onShow() {
  50. this.getAllSupplier();
  51. },
  52. onReachBottom() {
  53. if (this.tab_current === 0) {
  54. if (this.total / this.pageSize > this.page) {
  55. this.page += 1;
  56. this.getAllSupplier();
  57. }
  58. }
  59. },
  60. onPullDownRefresh() {
  61. this.getAllSupplier();
  62. },
  63. methods: {
  64. getAllSupplier() {
  65. this.$u.api
  66. .getAllSupplier({
  67. page: this.page,
  68. pageSize: this.pageSize,
  69. keyword: this.keyword
  70. })
  71. .then(res => {
  72. uni.stopPullDownRefresh();
  73. if (this.page === 1) {
  74. this.supplier_list = res.data;
  75. } else {
  76. this.supplier_list = this.supplier_list.concat(res.data);
  77. }
  78. this.total = res.pageTotal;
  79. this.load_status = this.$utils.loadStatus(this.page,this.pageSize,this.total);
  80. })
  81. .catch(err => {
  82. uni.stopPullDownRefresh();
  83. });
  84. }
  85. }
  86. };
  87. </script>
  88. <style lang="scss" scoped>
  89. .tabs-view {
  90. position: fixed;
  91. top: 0;
  92. left: 0;
  93. width: 100%;
  94. background-color: #ffffff;
  95. .keyword-view {
  96. padding: 20rpx 24rpx;
  97. .float_left {
  98. width: 640rpx;
  99. }
  100. .float_right {
  101. line-height: 64rpx;
  102. width: 50rpx;
  103. text-align: center;
  104. color: #666666;
  105. }
  106. }
  107. }
  108. .list-ul {
  109. padding-top: 102rpx;
  110. .list-li {
  111. padding: 0 24rpx 20rpx;
  112. margin-top: 20rpx;
  113. background-color: #ffffff;
  114. .title {
  115. line-height: 80rpx;
  116. border-bottom: 1px solid #eeeeee;
  117. .float_left {
  118. font-weight: bold;
  119. }
  120. .float_rigth {
  121. .custom-icon-jinru {
  122. margin-left: 10rpx;
  123. font-size: 28rpx;
  124. }
  125. }
  126. }
  127. .list-cont {
  128. margin-top: 10rpx;
  129. .list-cont-li {
  130. line-height: 60rpx;
  131. .mobile {
  132. color: $uni-color-primary;
  133. }
  134. }
  135. }
  136. }
  137. }
  138. </style>