index.vue 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180
  1. <template>
  2. <view class="page-container">
  3. <!-- 头部筛选 -->
  4. <view class="page-head">
  5. <u-tabs :list="list"
  6. :itemStyle="{
  7. width: '330rpx',
  8. height: '80rpx'
  9. }"
  10. :activeStyle="{
  11. color:'#4573FC'
  12. }"
  13. lineWidth="40"
  14. lineColor="#4573FC"
  15. @click="({index}) => {
  16. current = index
  17. handleQuery()
  18. }"
  19. >
  20. </u-tabs>
  21. <u-row>
  22. <u-col :span="12" style="padding: 16rpx 24rpx;">
  23. <view>
  24. <view class="input-wapper">
  25. <u--input
  26. v-model="params.queryName"
  27. :disabled="false"
  28. :clearable="true"
  29. placeholder="请输入物品名称或者申领单号"
  30. prefixIcon="search"
  31. shape="circle"
  32. prefixIconStyle="font-size: 22px;color: #909399"
  33. inputAlign="center"
  34. fontSize="28rpx"
  35. disabledColor="#F2F2F2"
  36. border="none"
  37. :customStyle="{
  38. height: '62rpx',
  39. padding: '4rpx 28rpx',
  40. background: '#F2F2F2'
  41. }"
  42. @confirm="handleQuery"
  43. >
  44. </u--input>
  45. </view>
  46. </view>
  47. </u-col>
  48. </u-row>
  49. </view>
  50. <!-- 内容 -->
  51. <view class="page-body">
  52. <scroll-view scroll-y style="height: 100%" enable-back-to-top refresher-enabled
  53. refresher-background="#F6F6F6" :refresher-triggered="refresher" @refresherrefresh="handleRefresher"
  54. @scrolltolower="handleScrollLower">
  55. <template v-for="(e,index) in tableList">
  56. <item :item="e" @getList="handleQuery"
  57. :key="index"
  58. >
  59. </item>
  60. </template>
  61. <view class="nodata-warp" v-if="!tableList.length">
  62. <image :src="$getImages('/assetsMobile/images/no-data.png')" class="nodata-image"></image>
  63. </view>
  64. <u-loadmore :status="loadStatus" height="30"/>
  65. <!-- <u-empty mode="data" v-if="tableList.length === 0" marginTop="200"></u-empty> -->
  66. </scroll-view>
  67. </view>
  68. </view>
  69. </template>
  70. <script>
  71. import {materialApplyRec} from '@/api/system/material.js'
  72. import listMixin from '@/utils/mixins/list.js'
  73. import item from './module/item'
  74. export default {
  75. mixins: [listMixin],
  76. components: {
  77. item,
  78. },
  79. data() {
  80. return {
  81. params: {
  82. queryName: '',
  83. },
  84. list: [
  85. { name: '领用记录'},
  86. { name: '借用记录'},
  87. ],
  88. current: 0,
  89. }
  90. },
  91. onLoad() {
  92. this.handleQuery()
  93. },
  94. onShow() {
  95. },
  96. methods: {
  97. async handleTableList() {
  98. this.loadStatus = 'loading'
  99. let ajaxData = {
  100. ...this.params,
  101. outflowType: this.current==0?2:1,
  102. page: this.page,
  103. size: this.pageSize
  104. }
  105. let {code,data} = await materialApplyRec(ajaxData)
  106. if (code == "0" ) {
  107. data.list.map((e) => {
  108. this.tableList.push({
  109. ...e,
  110. });
  111. })
  112. this.loadStatus = 'loadmore'
  113. this.total = data.total;
  114. if (this.page * this.pageSize >= this.total) {
  115. this.loadStatus = 'nomore'
  116. }
  117. this.refresher = false;
  118. }
  119. },
  120. }
  121. }
  122. </script>
  123. <style lang="scss" scoped>
  124. .disflex {
  125. display: flex;
  126. justify-content: center;
  127. align-items: center;
  128. }
  129. .page-container {
  130. font-size: 28rpx;
  131. min-height: 100%;
  132. height: 100%;
  133. position: relative;
  134. overflow: hidden;
  135. .page-head {
  136. background: #fff;
  137. }
  138. .page-body {
  139. width: 100%;
  140. height: calc(100% - 146rpx - 20rpx);
  141. overflow: hidden;
  142. }
  143. }
  144. .nodata-warp{
  145. display: flex;
  146. justify-content: center;
  147. align-items: center;
  148. padding: 100rpx 0;
  149. .nodata-image{
  150. width: 218rpx;
  151. height: 150rpx;
  152. }
  153. }
  154. ::v-deep {
  155. }
  156. </style>