warehousing.vue 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209
  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="code">
  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" @click="toDetail(item)">
  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.purveyName || ''}}</text>
  39. </p>
  40. <p class="info-line">
  41. <text class="label">采购员:</text>
  42. <text class="info">{{item.buyerName || ''}}</text>
  43. </p>
  44. <p class="info-line">
  45. <text class="label">送货单号:</text>
  46. <text class="info">{{item.delivery || ''}}</text>
  47. </p>
  48. <p class="info-line">
  49. <text class="label">退货状态:</text>
  50. <text class="info" v-if="item.returnFlag == '0'">未退货</text>
  51. <text class="info" v-if="item.returnFlag == '1'">部分退货</text>
  52. <text class="info" v-if="item.returnFlag == '2'">全部退货</text>
  53. </p>
  54. <p class="info-line">
  55. <text class="label">用途:</text>
  56. <text class="info">{{item.purpose || ''}}</text>
  57. </p>
  58. <p class="info-line">
  59. <text class="label">创建人:</text>
  60. <text class="info">{{item.createUser || ''}}</text>
  61. </p>
  62. <p class="info-line">
  63. <text class="label">创建时间:</text>
  64. <text class="info">{{item.createDate || ''}}</text>
  65. </p>
  66. </view>
  67. <!-- <view>
  68. <view class="card-oper">
  69. <view class="btn">
  70. <u-button type='primary' color='#4680F9' size="small" @click="toDetail(item)">登记明细</u-button>
  71. </view>
  72. </view>
  73. </view> -->
  74. </view>
  75. </u-list-item>
  76. </u-list>
  77. </template>
  78. <template v-else>
  79. <u-empty mode="list" icon="https://cdn.uviewui.com/uview/empty/list.png">
  80. </u-empty>
  81. </template>
  82. </view>
  83. <u-loading-page
  84. color="#666"
  85. loading-mode="semicircle"
  86. :loading="loading">
  87. </u-loading-page>
  88. </view>
  89. </template>
  90. <script>
  91. import dayjs from 'dayjs'
  92. import {fetchList} from '../../api/warehousing'
  93. export default {
  94. components:{
  95. },
  96. data() {
  97. return {
  98. tableData:[],
  99. loading:false,
  100. code:'',
  101. hasMore:false,
  102. page: {
  103. pages: 1,
  104. size: 10,
  105. },
  106. total:0,
  107. };
  108. },
  109. // onLoad(options) {
  110. // this.getList()
  111. // },
  112. onShow() {
  113. this.getList()
  114. },
  115. methods: {
  116. //去新增入库单
  117. onClickRight(){
  118. uni.navigateTo({ url: `/subpages/spare/add-edit?type=add&work=in`})
  119. },
  120. //查看明细
  121. toDetail(item){
  122. uni.navigateTo({ url: `/subpages/spare/add-edit?id=${item.id}&type=view&work=in`})
  123. },
  124. //搜索列表
  125. searchList(){
  126. this.page.pages = 1
  127. this.hasMore = false
  128. this.getList()
  129. },
  130. //获取订单列表
  131. getList() {
  132. this.loading = true
  133. let data = {
  134. current: this.page.pages,
  135. size: this.page.size,
  136. code:this.code || '' ,
  137. kind:'11'
  138. };
  139. fetchList(data).then((res) => {
  140. if (res.data.code == 0) {
  141. if (this.hasMore) {
  142. this.tableData = [
  143. ...this.tableData,
  144. ...res.data.data.records,
  145. ];
  146. } else {
  147. this.tableData = res.data.data.records;
  148. }
  149. console.log(this.tableData);
  150. this.total = res.data.data.total;
  151. if (this.tableData.length >= this.total) {
  152. this.hasMore = false;
  153. } else {
  154. this.hasMore = true;
  155. }
  156. this.loading = false
  157. }
  158. });
  159. },
  160. //加载更多
  161. scrolltolower() {
  162. if (this.hasMore) {
  163. this.page.pages += 1;
  164. this.getList();
  165. }
  166. },
  167. },
  168. };
  169. </script>
  170. <style>
  171. /* #ifndef APP-NVUE */
  172. view {
  173. /* display: flex; */
  174. box-sizing: border-box;
  175. /* flex-direction: column; */
  176. }
  177. page {
  178. box-sizing: border-box;
  179. /* padding: 40rpx 40rpx 80rpx; */
  180. height: 100%;
  181. }
  182. /* #endif*/
  183. </style>
  184. <style lang="scss" scoped>
  185. @import '../../common/css/public.scss';
  186. .order-list {
  187. // height: calc(100vh - var(--window-top)) ;
  188. // overflow: hidden;
  189. background-color: #f8f8f8;
  190. .qrcode-wrap{
  191. padding: 24rpx;
  192. text-align: center;
  193. .info-line{
  194. text-align: center;
  195. font-size: 32rpx;
  196. margin-top: 24rpx;
  197. }
  198. }
  199. }
  200. .popupShow {
  201. overflow: hidden;
  202. position: fixed;
  203. }
  204. </style>