outboundDelivery.vue 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243
  1. <template>
  2. <!-- 出库 -->
  3. <view class="main-wrap">
  4. <uni-search-bar class="uni-search-bar" @confirm="search" v-model="searchValue" @input="inputChange" cancelButton="none" placeholder="搜索关键字"></uni-search-bar>
  5. <view class="scroll_box">
  6. <scroll-view scroll-y="true" class="scroll-Y" @scrolltolower="lower">
  7. <view v-if="listData.length > 0" class="order-list">
  8. <view class="item" v-for="(item, index) in listData" :key="index">
  9. <view class="title">
  10. <view class="s1">出库单号 {{ item.bizNo }}</view>
  11. <view class="s2">
  12. {{ dict.bizScene[item.bizScene] }}
  13. </view>
  14. </view>
  15. <view class="main">
  16. <view class="row">
  17. <view class="row-item">
  18. <text class="t1">出库数量</text>
  19. <text class="t2">{{ item.measureQuantity }}{{ item.measureUnit }}</text>
  20. </view>
  21. <view class="row-item">
  22. <text class="t1">包装数量</text>
  23. <text class="t2">{{ item.packingQuantity }}{{ item.packingUnit }}</text>
  24. </view>
  25. <view class="row-item">
  26. <text class="t1">操作人</text>
  27. <text class="t2"></text>
  28. </view>
  29. <view class="row-item">
  30. <text class="t1">审核人</text>
  31. <text class="t2">{{ item.verifyName }}</text>
  32. </view>
  33. </view>
  34. <view class="row">
  35. <view class="row-item w100">
  36. <text class="t1">出库时间</text>
  37. <text class="t2">{{ item.createTime }}</text>
  38. </view>
  39. </view>
  40. <!-- <view class="ckmx" @click="goDetails(item)">查看明细</view> -->
  41. </view>
  42. </view>
  43. </view>
  44. <view v-else class="no_data">暂无数据</view>
  45. <!-- <u-loadmore fontSize="32" iconSize="36" :status="status" style="margin: 20rpx 0" /> -->
  46. </scroll-view>
  47. </view>
  48. </view>
  49. </template>
  50. <script>
  51. import { outInRecordsPage } from '@/api/warehouseManagement'
  52. export default {
  53. props: ['categoryId'],
  54. data() {
  55. return {
  56. page: 1,
  57. size: 20,
  58. isEnd: true,
  59. listData: [],
  60. status: 'loading',
  61. searchValue: '',
  62. dict: {
  63. bizScene: {
  64. 1: '退供出库',
  65. 2: '调拨出库',
  66. 3: '销售出库',
  67. 4: '领用出库',
  68. 5: '报废出库',
  69. 6: '外协出库',
  70. 7: '委外出库',
  71. 8: '受托退货出库',
  72. 9: '仓库委外出库',
  73. 10: '采购退货出库',
  74. 11: '自选领用出库',
  75. 12: '配料出库'
  76. }
  77. }
  78. }
  79. },
  80. created() {
  81. this.getData()
  82. },
  83. methods: {
  84. // 触底
  85. lower() {
  86. console.log('触底')
  87. if (this.isEnd) {
  88. return
  89. }
  90. this.getMoreLists()
  91. },
  92. inputChange() {
  93. // 清除timer对应的延时器
  94. clearTimeout(this.timerId)
  95. // 重新启动一个延时器,并把timerId赋值给this.timer
  96. this.timerId = setTimeout(() => {
  97. // 如果500毫秒内,没有触发新的输入事件,则为搜索关键词赋值
  98. this.search()
  99. }, 500)
  100. },
  101. getData() {
  102. let par = {
  103. pageNum: this.page,
  104. size: this.size,
  105. type: 2,
  106. categoryId: this.categoryId
  107. }
  108. if (this.searchValue !== '') {
  109. par.keyWord = this.searchValue
  110. }
  111. uni.showLoading({
  112. title: '加载中'
  113. })
  114. // par = this.URLSearchParams(par)
  115. outInRecordsPage(par)
  116. .then(res => {
  117. console.log('res----', res)
  118. this.listData = [...this.listData, ...res.list]
  119. let pages = res.count
  120. if (this.listData.length < pages) {
  121. this.isEnd = false
  122. this.status = 'loading'
  123. } else {
  124. this.isEnd = true
  125. this.status = 'nomore'
  126. }
  127. })
  128. .finally(err => {
  129. uni.hideLoading()
  130. })
  131. },
  132. getMoreLists() {
  133. this.page++
  134. this.getData()
  135. },
  136. search() {
  137. this.page = 1
  138. this.listData = []
  139. this.status = 'loading'
  140. this.getData()
  141. },
  142. goDetails(item) {
  143. let par = {
  144. bizNo: item.id,
  145. type: '出库'
  146. }
  147. par = this.URLSearchParams(par)
  148. uni.navigateTo({
  149. url: '/pages/warehouse/inventory/order/outInStorageDetail?' + par
  150. })
  151. }
  152. }
  153. }
  154. </script>
  155. <style lang="scss" scoped>
  156. .main-wrap {
  157. height: 100%;
  158. display: flex;
  159. flex-direction: column;
  160. overflow: hidden;
  161. }
  162. .scroll_box {
  163. flex: 1;
  164. overflow: hidden;
  165. }
  166. .scroll-Y {
  167. height: 100%;
  168. background-color: #fafafa;
  169. }
  170. .no_data {
  171. height: 100%;
  172. display: flex;
  173. justify-content: center;
  174. align-items: center;
  175. }
  176. .order-list {
  177. .item {
  178. background-color: #fff;
  179. margin-bottom: 30rpx;
  180. margin-bottom: 30rpx;
  181. .title {
  182. display: flex;
  183. padding: 20rpx;
  184. justify-content: space-between;
  185. align-items: center;
  186. border-bottom: 1px solid #dedede;
  187. .s1 {
  188. color: #333333;
  189. font-size: 28rpx;
  190. font-weight: bold;
  191. }
  192. .s2 {
  193. font-size: 28rpx;
  194. font-weight: bold;
  195. color: #333333;
  196. }
  197. }
  198. .main {
  199. padding: 0 30rpx;
  200. .row {
  201. display: flex;
  202. align-items: center;
  203. justify-content: space-between;
  204. flex-wrap: wrap;
  205. .row-item {
  206. padding: 20rpx 0;
  207. width: 50%;
  208. border-bottom: 1px dashed #dedede;
  209. .t1 {
  210. font-weight: bold;
  211. font-size: 28rpx;
  212. color: #333333;
  213. margin-right: 20rpx;
  214. }
  215. .t2 {
  216. font-size: 28rpx;
  217. color: #333333;
  218. }
  219. }
  220. }
  221. .ckmx {
  222. color: #70b603;
  223. font-size: 28rpx;
  224. font-weight: bold;
  225. padding: 20rpx;
  226. display: flex;
  227. justify-content: flex-end;
  228. }
  229. }
  230. }
  231. }
  232. </style>