equipmentDelivery.vue 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221
  1. <template>
  2. <view>
  3. <u-navbar title="设备出库" class="head">
  4. <view class="tabs" slot="bottom">
  5. <u-tabs bar-width="80" inactive-color="#777777" active-color="#101010" :list="list" :is-scroll="false"
  6. :current="current" @change="change"></u-tabs>
  7. </view>
  8. </u-navbar>
  9. <view class="list1" >
  10. <view class="item" v-for="(item,i) in list[current].list" @click="ckInfo(item.id)" :key="i" >
  11. <view class="title">
  12. {{item.projectName}}
  13. </view>
  14. <view class="group">
  15. <view class="name">
  16. 申请人:
  17. </view>
  18. <view class="value">
  19. {{item.createByName}}
  20. </view>
  21. </view>
  22. <view class="group">
  23. <view class="name">
  24. 申请时间:
  25. </view>
  26. <view class="value">
  27. {{item.createTime}}
  28. </view>
  29. </view>
  30. <view class="group">
  31. <view class="name">
  32. 审批时间:
  33. </view>
  34. <view class="value">
  35. {{item.approveTime}}
  36. </view>
  37. </view>
  38. </view>
  39. <u-divider v-if="list[current].recordsTotal==list[current].list.length"
  40. :isnone="list[current].recordsTotal==0" nonetext="没有找到相关内容"
  41. border-color="#CFD2D5">已经到底了</u-divider>
  42. </view>
  43. </view>
  44. </template>
  45. <script>
  46. import * as API from '@/apis/pagejs/storeManagement.js'
  47. export default {
  48. data() {
  49. return {
  50. list: [{
  51. name: '待出库',
  52. pageIndex: 1,
  53. pageSize: 20,
  54. recordsTotal: 1,
  55. status:"0",
  56. list:[]
  57. }, {
  58. name: '已出库',
  59. pageIndex: 1,
  60. pageSize: 20,
  61. recordsTotal: 1,
  62. status:"1",
  63. list:[]
  64. }],
  65. current: 0
  66. }
  67. },
  68. onReachBottom() {
  69. var obj=this.list[this.current]
  70. if (obj.list.length < obj.recordsTotal) {
  71. this.myLoadmore();
  72. }
  73. },
  74. onReady(){
  75. this.getList()
  76. },
  77. methods: {
  78. getList(){
  79. uni.showLoading({
  80. title: "加载中",
  81. mask: true,
  82. })
  83. var list=this.list[this.current].list
  84. var obj=this.list[this.current]
  85. var listForm={
  86. ...obj
  87. }
  88. delete listForm.list
  89. API.outWaitList(listForm).then((res) => {
  90. uni.hideLoading();
  91. if(listForm.pageIndex==1){
  92. list = res.data.data;
  93. }else{
  94. list = [
  95. ...list,
  96. ...res.data.data
  97. ];
  98. }
  99. if(this.current==0){
  100. this.carhelp.set("badgeList_outWaitList",res.data.recordsTotal)
  101. }
  102. this.list[this.current].list=list
  103. this.list[this.current].recordsTotal = res.data.recordsTotal;
  104. }).catch(error => {
  105. uni.showToast({
  106. title: error,
  107. icon: "none"
  108. })
  109. })
  110. },
  111. myLoadmore(){
  112. this.list[this.current].pageIndex += 1;
  113. this.getList();
  114. },
  115. init(){
  116. this.current=0
  117. this.list[0].pageIndex=1
  118. this.list[1].pageIndex=1
  119. this.getList()
  120. },
  121. ckInfo(id){
  122. var url="./deliveryDetails?id="+id;
  123. uni.navigateTo({
  124. url:url,
  125. events: {
  126. refreshData: () => {
  127. this.init()
  128. }
  129. }
  130. })
  131. },
  132. change(index) {
  133. this.current = index;
  134. var list = this.list[this.current].list
  135. if (list.length == 0) {
  136. this.getList();
  137. }
  138. }
  139. }
  140. }
  141. </script>
  142. <style lang="scss" scoped>
  143. page{
  144. padding-bottom: 100rpx;
  145. }
  146. .head {
  147. background: linear-gradient(180deg, rgba(190, 211, 240, 1) 0%, rgba(244, 244, 246, 1) 100%) !important;
  148. /deep/.u-navbar {
  149. //background: 0!important;
  150. background: linear-gradient(180deg, rgba(190, 211, 240, 1) 0%, rgba(244, 244, 246, 1) 100%) !important;
  151. height: 210rpx;
  152. //padding: 0 32rpx;
  153. }
  154. /deep/.u-border-bottom:after {
  155. height: 0;
  156. }
  157. .tabs {
  158. padding: 0 32rpx
  159. }
  160. }
  161. .tabs{
  162. display: flex;
  163. justify-content: space-between;
  164. align-items: center;
  165. /deep/.u-tabs{
  166. background: 0 !important;
  167. width: 250rpx;
  168. }
  169. /deep/.u-tab-bar{
  170. background-color: #2A8EFB !important;
  171. }
  172. }
  173. .list1,.list2{
  174. padding: 0 32rpx;
  175. margin-top: 60px;margin-bottom: 10px;
  176. .item{
  177. border-radius: 8px;
  178. background-color: rgba(255, 255, 255, 1);
  179. padding: 32rpx;
  180. margin-bottom: 24rpx;
  181. .title{
  182. color: rgba(51, 51, 51, 1);
  183. font-size: 36rpx;
  184. margin-bottom: 16rpx;
  185. }
  186. .group{
  187. display: flex;
  188. color: rgba(119, 119, 119, 1);
  189. margin-top: 16rpx;
  190. font-weight: bold;
  191. }
  192. }
  193. }
  194. </style>