index.vue 3.2 KB

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