selPurchase.vue 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153
  1. <template>
  2. <view>
  3. <view class="keyword-view clearfix">
  4. <u-search @clear="searchData()" @search="searchData()" :show-action="false" :clearabled="true" placeholder="采购单号" v-model="search_form.no"></u-search>
  5. </view>
  6. <view class="list-ul">
  7. <block v-for="(item, index) in purchase_list" :key="index">
  8. <view class="list-li" @click="selData(item)">
  9. <view class="top clearfix">
  10. <view class="ellipsis float_left">{{ item.supplierName }}</view>
  11. <view class="float_right">
  12. <text v-if="item.auditStatus === 2" class="success-status">已审核</text>
  13. <text v-else class="warning-status">待审核</text>
  14. <u-icon name="arrow-right" size="28" color="#999999"></u-icon>
  15. </view>
  16. </view>
  17. <view class="list-cont">
  18. <view class="total-money">{{ $utils.formattedNumber(item.purchaseAmount) }}</view>
  19. <view class="info-li" style="font-size: 28rpx; color: #111111;">{{ item.warehouseName }}</view>
  20. <view class="info-li" @click.stop="copy(item.no)">
  21. <text style="margin-right: 20rpx;">{{ item.no }}</text>
  22. <u-icon name="copy" custom-prefix="custom-icon" size="22"></u-icon>
  23. </view>
  24. <view class="info-li clearfix">
  25. <text class="float_left">{{ $u.timeFormat(item.createTime, 'yyyy-mm-dd hh:MM:ss') }}</text>
  26. <text class="float_right">采购员:{{ item.buyerName }}</text>
  27. </view>
  28. </view>
  29. </view>
  30. </block>
  31. </view>
  32. <u-loadmore v-if="purchase_list.length" :status="load_status" />
  33. <view v-else class="empty-view"><u-empty text="暂无数据" mode="list"></u-empty></view>
  34. </view>
  35. </template>
  36. <script>
  37. export default {
  38. data() {
  39. return {
  40. page: 1,
  41. pageSize: 10,
  42. total: 0,
  43. load_status: 'nomore',
  44. purchase_list: [],
  45. search_form: {
  46. no: '',
  47. }
  48. };
  49. },
  50. onShow() {
  51. this.searchData();
  52. },
  53. onReachBottom() {
  54. if (this.total / this.pageSize > this.page) {
  55. this.page += 1;
  56. this.getAllPurchase();
  57. }
  58. },
  59. onPullDownRefresh() {
  60. this.searchData();
  61. },
  62. methods: {
  63. selData(item) {
  64. // 选择返回上一页
  65. this._prePage().purchaseData = item;
  66. uni.navigateBack();
  67. },
  68. getAllPurchase() {
  69. this.load_status = 'loading';
  70. this.$u.api
  71. .getAllPurchase({
  72. returnStatus: '0,1',
  73. inStatus: '5,6',
  74. auditStatus: 2,
  75. deleteStatus: 5,
  76. no: this.search_form.no,
  77. page: this.page,
  78. pageSize: this.pageSize
  79. })
  80. .then(res => {
  81. if (this.page === 1) {
  82. this.purchase_list = res.data;
  83. } else {
  84. this.purchase_list = this.purchase_list.concat(res.data);
  85. }
  86. this.total = res.pageTotal;
  87. this.load_status = this.$utils.loadStatus(this.page, this.pageSize, this.total);
  88. });
  89. },
  90. searchData() {
  91. this.page = 1;
  92. this.getAllPurchase();
  93. }
  94. }
  95. };
  96. </script>
  97. <style lang="scss" scoped>
  98. .keyword-view {
  99. position: fixed;
  100. width: 100%;
  101. top: 0;
  102. left: 0;
  103. padding: 20rpx 24rpx;
  104. background-color: #ffffff;
  105. z-index: 9;
  106. .float_left {
  107. width: 640rpx;
  108. }
  109. .float_right {
  110. line-height: 64rpx;
  111. width: 50rpx;
  112. text-align: center;
  113. color: #666666;
  114. }
  115. }
  116. .list-ul {
  117. padding-top: 100rpx;
  118. .list-li {
  119. width: 710rpx;
  120. background-color: #ffffff;
  121. margin: 20rpx auto;
  122. border-radius: 20rpx;
  123. padding: 30rpx 24rpx;
  124. .top {
  125. padding-bottom: 20rpx;
  126. border-bottom: 1px solid #eeeeee;
  127. .float_left {
  128. width: 400rpx;
  129. font-weight: bold;
  130. }
  131. }
  132. .list-cont {
  133. padding-top: 20rpx;
  134. position: relative;
  135. .total-money {
  136. position: absolute;
  137. top: 45%;
  138. right: 0;
  139. transform: translateY(-50%);
  140. color: $uni-color-error;
  141. font-weight: bold;
  142. }
  143. .info-li {
  144. color: #6c6c6c;
  145. font-size: 24rpx;
  146. padding-bottom: 10rpx;
  147. }
  148. }
  149. }
  150. }
  151. </style>