index.vue 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178
  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"></uni-nav-bar>
  5. <view class="top-wrapper">
  6. <uni-section>
  7. <uni-easyinput prefixIcon="search" style="width: 480rpx" v-model="searchFrom.keyWord" placeholder="请输入">
  8. </uni-easyinput>
  9. </uni-section>
  10. <button class="search_btn" @click="doSearch">搜索</button>
  11. <image class="menu_icon" src="~@/static/pda/menu.svg"></image>
  12. </view>
  13. <view class="list_box">
  14. <u-list @scrolltolower="scrolltolower" key="list" :preLoadScreen="page * 10">
  15. <u-list-item v-for="(item, index) in dataList" :key="index">
  16. <workCard :item="item" @handleDetail="handleDetail"></workCard>
  17. </u-list-item>
  18. <u-list-item v-if="dataList.length === 0">
  19. <view class="nodata"> 暂无数据 </view>
  20. </u-list-item>
  21. </u-list>
  22. </view>
  23. </view>
  24. </template>
  25. <script>
  26. import workCard from '../../components/workCard.vue'
  27. import { getTaskInstanceList } from '@/api/pda/workOrder.js'
  28. import {
  29. workorderPage
  30. } from '@/api/pda/workOrder.js'
  31. let [isEnd] = [false]
  32. export default {
  33. components: {
  34. workCard
  35. },
  36. data() {
  37. return {
  38. page: 1,
  39. size: 5,
  40. dataList: [],
  41. searchFrom: {
  42. keyWord: null
  43. },
  44. }
  45. },
  46. onShow() {
  47. this.getList()
  48. },
  49. methods: {
  50. async getList() {
  51. let params = {
  52. pageNum: this.page,
  53. size: this.size,
  54. status: [4, 5, 6, 7],
  55. ...this.searchFrom
  56. }
  57. isEnd = false
  58. const res = await workorderPage(params)
  59. console.log(res)
  60. if (params.page === 1) {
  61. this.dataList = []
  62. }
  63. this.dataList.push(...res.list)
  64. isEnd = this.dataList.length >= res.count
  65. },
  66. doSearch() {},
  67. scrolltolower() {
  68. if (isEnd) return
  69. this.page++
  70. this.getList()
  71. },
  72. handleDetail(item) {
  73. let url = '/pages/pda/workOrder/extrusionMolding/index'
  74. url += `?id=${item.id}&title=${item.produceTaskInstanceName}`
  75. console.log(url)
  76. uni.navigateTo({
  77. url
  78. })
  79. console.log(item)
  80. },
  81. }
  82. }
  83. </script>
  84. <style lang="scss" scoped>
  85. .content-box {
  86. height: 100vh;
  87. overflow: hidden;
  88. display: flex;
  89. flex-direction: column;
  90. background-color: $page-bg;
  91. }
  92. .top-wrapper {
  93. background-color: #fff;
  94. display: flex;
  95. width: 750rpx;
  96. height: 88rpx;
  97. padding: 16rpx 32rpx;
  98. align-items: center;
  99. gap: 16rpx;
  100. /deep/.uni-section {
  101. margin-top: 0px;
  102. }
  103. /deep/.uni-section-header {
  104. padding: 0px;
  105. }
  106. .search_btn {
  107. width: 120rpx;
  108. height: 70rpx;
  109. line-height: 70rpx;
  110. padding: 0 24rpx;
  111. background: $theme-color;
  112. font-size: 32rpx;
  113. color: #fff;
  114. margin: 0;
  115. }
  116. .menu_icon {
  117. width: 44rpx;
  118. height: 44rpx;
  119. }
  120. }
  121. .list_box {
  122. flex: 1;
  123. overflow: hidden;
  124. padding: 16rpx 0;
  125. .u-list {
  126. height: 100% !important;
  127. }
  128. }
  129. .nodata {
  130. font-size: 40rpx;
  131. text-align: center;
  132. padding-top: 30rpx;
  133. }
  134. </style>