ruku.vue 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182
  1. <template>
  2. <view class="RuKuContainer">
  3. <view class="all">
  4. <!-- :总共<text class="spec">{{ 0 }}</text>件 -->
  5. <view class="num">待入库</view>
  6. <view class="btn" @click="toUrlLink('stock/record?type=2')">入库记录</view>
  7. </view>
  8. <scroll-view class="orderList" scroll-y="true" @scrolltolower="getMore">
  9. <view
  10. v-for="item in list"
  11. :key="item.order_id"
  12. class="orderItem"
  13. >
  14. <view class="orderTop">
  15. <view class="orderNum">
  16. 单号:{{ item.order_num }}
  17. </view>
  18. <view class="allNum">
  19. 共{{ item.number }}箱
  20. </view>
  21. </view>
  22. <view class="orderBottom">
  23. <view class="time">
  24. {{ item.created_at | dateFormatter('yyyy/MM/dd') }}
  25. </view>
  26. <view class="infoBtn" @click.stop="toRuKu(item.order_id)">
  27. 货物详情
  28. </view>
  29. </view>
  30. </view>
  31. <view v-if="!isMore" class="noTip">没有更多了</view>
  32. </scroll-view>
  33. </view>
  34. </template>
  35. <script>
  36. import { allDaiRuKu } from "@/apis/stock.js"
  37. export default {
  38. data() {
  39. return {
  40. page_index: 1,
  41. list: [],
  42. isMore: true
  43. }
  44. },
  45. onLoad() {
  46. this.getAllDaiRuKu()
  47. },
  48. methods: {
  49. toRuKu(id) {
  50. uni.removeStorageSync('rukuOpenId')
  51. this.toUrlLink(`stock/dai_ruku?order_id=${id}`)
  52. },
  53. getMore() {
  54. if(!this.isMore) return false
  55. this.page_index += 1
  56. this.getAllDaiRuKu()
  57. },
  58. getAllDaiRuKu() {
  59. const _this = this
  60. uni.showLoading()
  61. allDaiRuKu({ page_index: _this.page_index }).then(res => {
  62. uni.hideLoading()
  63. if(res.code === 200) {
  64. this.list = [...this.list, ...res.data.list]
  65. if(res.data.list.length < 20) {
  66. this.isMore = false
  67. }
  68. } else {
  69. uni.showModal({
  70. content: res.message || '获取入库详情失败',
  71. showCancel: false
  72. })
  73. }
  74. }).catch(() => {
  75. uni.hideLoading()
  76. uni.showModal({
  77. content: '获取入库详情失败',
  78. showCancel: false
  79. })
  80. })
  81. },
  82. toUrlLink(url) {
  83. if(!url) return false
  84. uni.navigateTo({
  85. url: `../${url}`
  86. })
  87. }
  88. }
  89. }
  90. </script>
  91. <style lang="scss" scoped>
  92. page{
  93. width: 100%;
  94. height: 100%;
  95. }
  96. .RuKuContainer {
  97. width: 100%;
  98. height: 100%;
  99. background-color: #F9F9FB;
  100. display: flex;
  101. flex-direction: column;
  102. justify-content: space-between;
  103. .btn {
  104. width: 140rpx;
  105. height: 56rpx;
  106. border-radius: 8rpx;
  107. background-color: #EA4A41;
  108. color: #FFFFFF;
  109. font-size: 28rpx;
  110. line-height: 56rpx;
  111. text-align: center;
  112. text-align: center;
  113. }
  114. .all {
  115. width: 100%;
  116. height: 116rpx;
  117. padding: 0 30rpx;
  118. display: flex;
  119. align-items: center;
  120. justify-content: space-between;
  121. .num {
  122. color: #333333;
  123. font-size: 36rpx;
  124. line-height: 50rpx;
  125. font-weight: bold;
  126. .spec {
  127. color: #EA4A41 !important;
  128. }
  129. }
  130. }
  131. .orderList {
  132. width: 100%;
  133. flex: 1;
  134. overflow: hidden;
  135. .orderItem {
  136. width: calc(100% - 60rpx);
  137. margin: 0 auto 30rpx auto;
  138. background-color: #ffffff;
  139. padding: 30rpx;
  140. background-color: #ffffff;
  141. .orderTop, .orderBottom {
  142. width: 100%;
  143. display: flex;
  144. align-items: center;
  145. justify-content: space-between;
  146. }
  147. .orderTop {
  148. margin-bottom: 30rpx;
  149. .orderNum, .allNum {
  150. color: #333333;
  151. font-size: 32rpx;
  152. line-height: 44rpx;
  153. }
  154. }
  155. .orderBottom {
  156. .time {
  157. color: #999999;
  158. font-size: 28rpx;
  159. line-height: 40rpx;
  160. }
  161. .infoBtn{
  162. width: 176rpx;
  163. height: 68rpx;
  164. background: linear-gradient(to right, #F97C55 0%, #F44545 100%);
  165. color: #FFFFFF;
  166. font-size: 28rpx;
  167. line-height: 68rpx;
  168. text-align: center;
  169. border-radius: 68rpx;
  170. }
  171. }
  172. }
  173. }
  174. .noTip {
  175. text-align: center;
  176. padding: 20rpx 0;
  177. width: 100%;
  178. }
  179. }
  180. </style>