ApplyReceipt.vue 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196
  1. <template>
  2. <view>
  3. <view class="tabs-view">
  4. <view class="keyword-view clearfix">
  5. <u-search :clearabled="true" @custom="searchData" @search="searchData" @clear="searchData" placeholder="客户名称" v-model="keyword"></u-search>
  6. </view>
  7. <u-tabs-swiper ref="tabs" font-size="28" :current="tabs_current" :list="status_list" @change="statusChange" :is-scroll="false"></u-tabs-swiper>
  8. </view>
  9. <view class="list-ul">
  10. <view
  11. class="list-li"
  12. v-for="(item, index) in receipt_list"
  13. :key="index"
  14. @click="goPage('/pagesT/Finance/ApplyReceiptDetail?id=' + item.id + '&time=' + item.createTime)"
  15. >
  16. <view class="title clearfix">
  17. <view class="float_left">{{ item.customerName }}</view>
  18. <view class="float_right">
  19. <text class="success-status" v-if="item.auditStatus === 2">已审核</text>
  20. <text class="warning-status" v-else>待审核</text>
  21. <text class="custom-icon custom-icon-jinru"></text>
  22. </view>
  23. </view>
  24. <view class="list-cont">
  25. <view class="list-cont-li" @click.stop="copy(item.no)">
  26. <text style="margin-right: 20rpx;">{{ item.no }}</text>
  27. <u-icon name="copy" custom-prefix="custom-icon" size="22"></u-icon>
  28. </view>
  29. <view class="list-cont-li clearfix">
  30. <view class="float_left">{{ $u.timeFormat(item.createTime, 'yyyy-mm-dd') }}</view>
  31. <view class="float_right price">{{ $utils.formattedNumber(item.totalActualAmount) }}</view>
  32. </view>
  33. </view>
  34. </view>
  35. <view v-if="!receipt_list.length" class="empty-view"><u-empty text="暂无数据" mode="list"></u-empty></view>
  36. <u-loadmore v-if="receipt_list.length" :status="load_status" />
  37. </view>
  38. <addBtn v-if="$accessCheck($Access.addApplyReceipt)" url="/pagesT/Finance/AddApplyReceipt"></addBtn>
  39. </view>
  40. </template>
  41. <script>
  42. export default {
  43. data() {
  44. return {
  45. receipt_list: [],
  46. load_status: 'nomore',
  47. page: 1,
  48. pageSize: 10,
  49. total: 0,
  50. tabs_current: 0,
  51. keyword: '',
  52. search_show: false,
  53. status_list: [
  54. {
  55. value: '',
  56. name: '全部'
  57. },
  58. {
  59. value: 1,
  60. name: '待审核'
  61. },
  62. {
  63. value: 2,
  64. name: '已审核'
  65. }
  66. ],
  67. billStatus: '',
  68. customerName: '',
  69. customerId: '',
  70. customerData: ''
  71. };
  72. },
  73. onShow() {
  74. this.page = 1;
  75. this.getAllReceiptRequisition();
  76. },
  77. onReachBottom() {
  78. if (this.tab_current === 0) {
  79. if (this.total / this.pageSize > this.page) {
  80. this.page += 1;
  81. this.getAllReceiptRequisition();
  82. }
  83. }
  84. },
  85. onPullDownRefresh() {
  86. this.getAllReceiptRequisition();
  87. },
  88. methods: {
  89. getAllReceiptRequisition() {
  90. this.load_status = 'loading';
  91. this.$u.api
  92. .getAllReceiptRequisition({
  93. page: this.page,
  94. pageSize: this.pageSize,
  95. operatorName: '',
  96. custormerName: this.keyword,
  97. auditStatus: this.billStatus
  98. })
  99. .then(res => {
  100. uni.stopPullDownRefresh();
  101. if (this.page === 1) {
  102. this.receipt_list = res.data;
  103. } else {
  104. this.receipt_list = this.receipt_list.concat(res.data);
  105. }
  106. this.total = res.pageTotal;
  107. this.load_status = this.$utils.loadStatus(this.page, this.pageSize, this.total);
  108. })
  109. .catch(err => {
  110. uni.stopPullDownRefresh();
  111. });
  112. },
  113. statusChange(index) {
  114. this.tabs_current = index;
  115. this.billStatus = this.status_list[index].value;
  116. this.searchData();
  117. },
  118. searchData() {
  119. this.page = 1;
  120. this.getAllReceiptRequisition();
  121. }
  122. }
  123. };
  124. </script>
  125. <style lang="scss" scoped>
  126. .tabs-view {
  127. position: fixed;
  128. top: 0;
  129. left: 0;
  130. width: 100%;
  131. background-color: #ffffff;
  132. z-index: 99;
  133. .keyword-view {
  134. padding: 20rpx 24rpx 0;
  135. .float_left {
  136. width: 640rpx;
  137. }
  138. .float_right {
  139. line-height: 64rpx;
  140. width: 50rpx;
  141. text-align: center;
  142. color: #666666;
  143. }
  144. }
  145. }
  146. .list-ul {
  147. padding-top: 160rpx;
  148. .list-li {
  149. width: 710rpx;
  150. border-radius: 20rpx;
  151. margin: 20rpx auto;
  152. padding: 10rpx 24rpx 30rpx;
  153. margin-top: 20rpx;
  154. background-color: #ffffff;
  155. .title {
  156. line-height: 80rpx;
  157. border-bottom: 1px solid #eeeeee;
  158. .float_left {
  159. font-weight: bold;
  160. }
  161. .float_rigth {
  162. .custom-icon-jinru {
  163. margin-left: 10rpx;
  164. font-size: 28rpx;
  165. }
  166. }
  167. }
  168. .list-cont {
  169. margin-top: 10rpx;
  170. .list-cont-li {
  171. color: #6c6c6c;
  172. line-height: 40rpx;
  173. font-size: 24rpx;
  174. .price {
  175. font-weight: bold;
  176. font-size: 26rpx;
  177. color: $uni-color-error;
  178. }
  179. }
  180. }
  181. }
  182. }
  183. </style>