index.vue 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184
  1. <template>
  2. <view class="content-box">
  3. <uni-nav-bar fixed="true" statusBar="true" left-icon="back" title="领料" background-color="#157A2C" color="#fff"
  4. @clickLeft="back" right-icon="scan" @clickRight="HandlScanCode">
  5. </uni-nav-bar>
  6. <view class="top-wrapper">
  7. <view class="tab_box rx-sc">
  8. <view class="tab_item" :class="{active: tabType == 1}" @click="handTab(1)">生产工单列表</view>
  9. <view class="tab_item" :class="{active: tabType == 2}" @click="handTab(2)">领料工单列表</view>
  10. </view>
  11. <view class="nav_box rx-sc" v-if='tabType == 1'>
  12. <view class="nav_item " :class="{active: navType == 1}" @click="handNav(1)">未领料</view>
  13. <view class="nav_item" :class="{active: navType == 2}" @click="handNav(2)">已领料</view>
  14. </view>
  15. </view>
  16. <view class="list_box">
  17. <u-list @scrolltolower="scrolltolower" v-if="tabType == 1">
  18. <pickCard :List="dataList"> </pickCard>
  19. </u-list>
  20. </view>
  21. <view class="bottom-wrapper">
  22. 5555
  23. </view>
  24. </view>
  25. </template>
  26. <script>
  27. import pickCard from '../components/pickCard.vue'
  28. import {
  29. workorderPage
  30. } from '@/api/pda/workOrder.js'
  31. let [isEnd] = [false]
  32. export default {
  33. components: {
  34. pickCard
  35. },
  36. data() {
  37. return {
  38. tabType: 1,
  39. navType: 1,
  40. page: 1,
  41. size: 5,
  42. dataList: [],
  43. }
  44. },
  45. onShow() {
  46. this.getList()
  47. },
  48. methods: {
  49. async getList() {
  50. let params = {
  51. pageNum: this.page,
  52. size: this.size,
  53. status: [4, 5, 6, 7],
  54. }
  55. isEnd = false
  56. const res = await workorderPage(params)
  57. console.log(res)
  58. if (params.page === 1) {
  59. this.dataList = []
  60. }
  61. this.dataList.push(...res.list)
  62. isEnd = this.dataList.length >= res.count
  63. },
  64. handTab(type) {
  65. if (type != this.tabType) {
  66. this.tabType = type
  67. }
  68. },
  69. handNav(type) {
  70. if (type != this.navType) {
  71. this.navType = type
  72. }
  73. },
  74. scrolltolower() {
  75. if (isEnd) return
  76. this.page++
  77. this.getList()
  78. },
  79. // 相机扫码
  80. HandlScanCode() {
  81. let _this = this
  82. uni.scanCode({
  83. success: function(res) {
  84. console.log(res)
  85. }
  86. })
  87. //_this.Scancodedate('res')
  88. },
  89. }
  90. }
  91. </script>
  92. <style lang="scss" scoped>
  93. .content-box {
  94. height: 100vh;
  95. overflow: hidden;
  96. display: flex;
  97. flex-direction: column;
  98. background-color: $page-bg;
  99. }
  100. .tab_box {
  101. width: 100%;
  102. height: 68rpx;
  103. background: #fff;
  104. .tab_item {
  105. height: 68rpx;
  106. line-height: 68rpx;
  107. padding: 0 20rpx;
  108. font-size: 32rpx;
  109. color: #979C9E;
  110. }
  111. .active {
  112. box-sizing: border-box;
  113. border-bottom: 6rpx solid $theme-color;
  114. color: $theme-color;
  115. }
  116. }
  117. .nav_box{
  118. padding: 6rpx 32rpx;
  119. .nav_item{
  120. font-size: 28rpx;
  121. font-weight: 400;
  122. color: $theme-color;
  123. background: #F0F8F2;
  124. margin-right: 16rpx;
  125. padding: 4rpx 16rpx;
  126. border-radius: 8rpx;
  127. border: 2rpx solid #ACD4B5;
  128. }
  129. .active{
  130. background: $theme-color;;
  131. border: 2rpx solid $theme-color;;
  132. color: #FFF;
  133. }
  134. }
  135. .list_box {
  136. flex: 1;
  137. overflow: hidden;
  138. padding: 4rpx 0;
  139. .u-list {
  140. height: 100% !important;
  141. }
  142. }
  143. </style>