outdepot.vue 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190
  1. <template>
  2. <view class="order-list content">
  3. <u-sticky bgColor="#fff">
  4. <view class="search-wrap">
  5. <view class="input-wrap">
  6. <u-search
  7. bgColor='#fff'
  8. :showAction='false'
  9. placeholder="搜索出库单号"
  10. @search="searchList"
  11. @clear='searchList'
  12. v-model="keyword">
  13. </u-search>
  14. <view class="search-btn" @click="searchList">{{$t("customer_meter.search")}}</view>
  15. </view>
  16. <uni-icons type="plus" size='32' @click="onClickRight"></uni-icons>
  17. </view>
  18. </u-sticky>
  19. <view class="swiper-box">
  20. <template v-if="tableData.length">
  21. <u-list @scrolltolower="scrolltolower" :preLoadScreen="1.5">
  22. <u-list-item v-for="(item, index) in tableData" :key="index">
  23. <view class="order-card">
  24. <view class="order-card-title">
  25. 出库单号:{{item.code}}
  26. </view>
  27. <view class="order-info">
  28. <p class="info-line">
  29. <text class="label">登记日期:</text>
  30. <text class="info">{{item.setDate || ''}}</text>
  31. </p>
  32. <p class="info-line">
  33. <text class="label">仓库:</text>
  34. <text class="info">{{item.storeName || ''}}</text>
  35. </p>
  36. <p class="info-line">
  37. <text class="label">领料人:</text>
  38. <text class="info" >{{item.requesterName || ''}}</text>
  39. </p>
  40. <p class="info-line">
  41. <text class="label">部门:</text>
  42. <text class="info">{{item.deptName || ''}}</text>
  43. </p>
  44. <p class="info-line">
  45. <text class="label">退货状态:</text>
  46. <text class="info" v-if="item.returnFlag == '0'">未退货</text>
  47. <text class="info" v-if="item.returnFlag == '1'">部分退货</text>
  48. <text class="info" v-if="item.returnFlag == '2'">全部退货</text>
  49. </p>
  50. <p class="info-line">
  51. <text class="label">创建人:</text>
  52. <text class="info">{{item.createUser || ''}}</text>
  53. </p>
  54. <p class="info-line">
  55. <text class="label">创建时间:</text>
  56. <text class="info">{{item.createDate || ''}}</text>
  57. </p>
  58. </view>
  59. </view>
  60. </u-list-item>
  61. </u-list>
  62. </template>
  63. <template v-else>
  64. <u-empty mode="list" icon="https://cdn.uviewui.com/uview/empty/list.png">
  65. </u-empty>
  66. </template>
  67. </view>
  68. <u-loading-page
  69. color="#666"
  70. loading-mode="semicircle"
  71. :loading="loading">
  72. </u-loading-page>
  73. </view>
  74. </template>
  75. <script>
  76. import dayjs from 'dayjs'
  77. import {fetchList} from '../../api/warehousing'
  78. export default {
  79. components:{
  80. },
  81. data() {
  82. return {
  83. tableData:[],
  84. loading:false,
  85. hasMore:false,
  86. keyword:'',
  87. page: {
  88. pages: 1,
  89. size: 10,
  90. },
  91. total:0,
  92. };
  93. },
  94. // onLoad(options) {
  95. // this.getList()
  96. // },
  97. onShow() {
  98. this.getList()
  99. },
  100. methods: {
  101. //去新增入库单
  102. onClickRight(){
  103. uni.navigateTo({ url: `/subpages/spare/add-edit?type=add&work=out`})
  104. },
  105. //搜索列表
  106. searchList(){
  107. this.page.pages = 1
  108. this.hasMore = false
  109. this.getList()
  110. },
  111. //获取订单列表
  112. getList() {
  113. this.loading = true
  114. let data = {
  115. current: this.page.pages,
  116. size: this.page.size,
  117. keywords:this.keyword || '' ,
  118. kind:'14'
  119. };
  120. fetchList(data).then((res) => {
  121. if (res.data.code == 0) {
  122. if (this.hasMore) {
  123. this.tableData = [
  124. ...this.tableData,
  125. ...res.data.data.records,
  126. ];
  127. } else {
  128. this.tableData = res.data.data.records;
  129. }
  130. console.log(this.tableData);
  131. this.total = res.data.data.total;
  132. if (this.tableData.length >= this.total) {
  133. this.hasMore = false;
  134. } else {
  135. this.hasMore = true;
  136. }
  137. this.loading = false
  138. }
  139. });
  140. },
  141. //加载更多
  142. scrolltolower() {
  143. if (this.hasMore) {
  144. this.page.pages += 1;
  145. this.getList();
  146. }
  147. },
  148. },
  149. };
  150. </script>
  151. <style>
  152. /* #ifndef APP-NVUE */
  153. view {
  154. /* display: flex; */
  155. box-sizing: border-box;
  156. /* flex-direction: column; */
  157. }
  158. page {
  159. box-sizing: border-box;
  160. /* padding: 40rpx 40rpx 80rpx; */
  161. height: 100%;
  162. }
  163. /* #endif*/
  164. </style>
  165. <style lang="scss" scoped>
  166. @import '../../common/css/public.scss';
  167. .order-list {
  168. // height: calc(100vh - var(--window-top)) ;
  169. // overflow: hidden;
  170. background-color: #f8f8f8;
  171. .qrcode-wrap{
  172. padding: 24rpx;
  173. text-align: center;
  174. .info-line{
  175. text-align: center;
  176. font-size: 32rpx;
  177. margin-top: 24rpx;
  178. }
  179. }
  180. }
  181. .popupShow {
  182. overflow: hidden;
  183. position: fixed;
  184. }
  185. </style>