stockcheck.vue 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217
  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">
  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.name || ''}}</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.totalNum }}</text>
  39. </p>
  40. </view>
  41. <view>
  42. <view class="card-oper">
  43. <view class="btn">
  44. <u-button type='primary' color='#4680F9' size="small" @click="toDetail(item)">库存盘点</u-button>
  45. </view>
  46. </view>
  47. </view>
  48. </view>
  49. </u-list-item>
  50. </u-list>
  51. </template>
  52. <template v-else>
  53. <u-empty mode="list" icon="https://cdn.uviewui.com/uview/empty/list.png">
  54. </u-empty>
  55. </template>
  56. </view>
  57. <u-loading-page
  58. color="#666"
  59. loading-mode="semicircle"
  60. :loading="loading">
  61. </u-loading-page>
  62. </view>
  63. </template>
  64. <script>
  65. import {materialLiveList} from '../../api/stock'
  66. export default {
  67. components:{
  68. },
  69. data() {
  70. return {
  71. tableData:[],
  72. loading:false,
  73. code:'',
  74. hasMore:false,
  75. page: {
  76. pages: 1,
  77. size: 10,
  78. },
  79. unitList:[],
  80. currentRow:{},
  81. total:0,
  82. };
  83. },
  84. onShow() {
  85. this.getList()
  86. },
  87. methods: {
  88. //查看明细
  89. toDetail(item){
  90. uni.navigateTo({ url: `/subpages/spare/inventory?content=${JSON.stringify(item)}`})
  91. },
  92. //搜索列表
  93. searchList(){
  94. this.page.pages = 1
  95. this.hasMore = false
  96. this.getList()
  97. },
  98. //获取订单列表
  99. getList() {
  100. this.loading = true
  101. let data = {
  102. current: this.page.pages,
  103. size: this.page.size,
  104. code:this.code || '' ,
  105. kind:'11'
  106. };
  107. materialLiveList(data).then((res) => {
  108. if (res.data.code == 0) {
  109. if (this.hasMore) {
  110. this.tableData = [
  111. ...this.tableData,
  112. ...res.data.data.records,
  113. ];
  114. } else {
  115. this.tableData = res.data.data.records;
  116. }
  117. console.log(this.tableData);
  118. this.total = res.data.data.total;
  119. if (this.tableData.length >= this.total) {
  120. this.hasMore = false;
  121. } else {
  122. this.hasMore = true;
  123. }
  124. this.loading = false
  125. }
  126. });
  127. },
  128. //加载更多
  129. scrolltolower() {
  130. if (this.hasMore) {
  131. this.page.pages += 1;
  132. this.getList();
  133. }
  134. },
  135. },
  136. };
  137. </script>
  138. <style>
  139. /* #ifndef APP-NVUE */
  140. view {
  141. /* display: flex; */
  142. box-sizing: border-box;
  143. /* flex-direction: column; */
  144. }
  145. page {
  146. box-sizing: border-box;
  147. /* padding: 40rpx 40rpx 80rpx; */
  148. height: 100%;
  149. }
  150. /* #endif*/
  151. </style>
  152. <style lang="scss" scoped>
  153. @import '../../common/css/public.scss';
  154. .order-list {
  155. // height: calc(100vh - var(--window-top)) ;
  156. // overflow: hidden;
  157. background-color: #f8f8f8;
  158. .qrcode-wrap{
  159. padding: 24rpx;
  160. text-align: center;
  161. .info-line{
  162. text-align: center;
  163. font-size: 32rpx;
  164. margin-top: 24rpx;
  165. }
  166. }
  167. }
  168. .popupShow {
  169. overflow: hidden;
  170. position: fixed;
  171. }
  172. .picker-card{
  173. padding: 32rpx 32rpx 144rpx;
  174. position: relative;
  175. height: 100%;
  176. overflow-y: scroll;
  177. display: block;
  178. .card-oper{
  179. position: absolute;
  180. width: 100%;
  181. bottom: 0;
  182. left:0;
  183. display: flex;
  184. flex-direction: row;
  185. justify-content: space-between;
  186. padding: 24rpx;
  187. .btn{
  188. width: 100%;
  189. }
  190. }
  191. }
  192. /deep/ .u-popup__content{
  193. height: 70%;
  194. overflow-y: scroll;
  195. border-radius: 6px;
  196. width: 90%;
  197. }
  198. .shelf-card{
  199. margin: 0 0 24rpx;
  200. display: block;
  201. .order-info{
  202. display: flex;
  203. flex-direction: row;
  204. flex-wrap: wrap;
  205. .info-line{
  206. width: 50%;
  207. .label{
  208. width: 120rpx;
  209. }
  210. }
  211. }
  212. }
  213. </style>