invoice.vue 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174
  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: 460rpx" v-model="searchFrom.docNo" 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. <invoiceCard :item="{...item,index:index+1}" @handleDetail="handleDetail"></invoiceCard>
  17. </u-list-item>
  18. <u-list-item v-if="dataList.length === 0">
  19. <view style='margin-top: 20vh;'>
  20. <u-empty iconSize='150' textSize='32' text='暂无'>
  21. </u-empty>
  22. </view>
  23. </u-list-item>
  24. </u-list>
  25. </view>
  26. </view>
  27. </template>
  28. <script>
  29. import invoiceCard from './invoiceCard.vue'
  30. import {
  31. saleordersendrecord
  32. } from '@/api/saleManage/saleorder/index.js'
  33. let [isEnd] = [false]
  34. export default {
  35. components: {
  36. invoiceCard
  37. },
  38. data() {
  39. return {
  40. page: 1,
  41. size: 10,
  42. dataList: [],
  43. searchFrom: {
  44. docNo: null
  45. },
  46. }
  47. },
  48. onShow() {
  49. this.getList()
  50. },
  51. methods: {
  52. async getList() {
  53. let params = {
  54. pageNum: this.page,
  55. reviewStatus:2,
  56. size: this.size,
  57. ...this.searchFrom
  58. }
  59. isEnd = false
  60. const res = await saleordersendrecord(params)
  61. if (params.pageNum === 1) {
  62. this.dataList = []
  63. }
  64. this.dataList.push(...res.list)
  65. isEnd = this.dataList.length >= res.count
  66. },
  67. doSearch() {
  68. this.page = 1
  69. this.getList()
  70. },
  71. scrolltolower() {
  72. if (isEnd) return
  73. this.page++
  74. this.getList()
  75. },
  76. handleDetail(item) {
  77. let url = '/pages/invoiceConfirm/index'
  78. url += `?id=${item.id}&docNo=${item.docNo}`
  79. uni.navigateTo({
  80. url
  81. })
  82. },
  83. }
  84. }
  85. </script>
  86. <style lang="scss" scoped>
  87. .content-box {
  88. height: 100vh;
  89. overflow: hidden;
  90. display: flex;
  91. flex-direction: column;
  92. background-color: $page-bg;
  93. }
  94. .top-wrapper {
  95. background-color: #fff;
  96. display: flex;
  97. width: 750rpx;
  98. height: 88rpx;
  99. padding: 16rpx 32rpx;
  100. align-items: center;
  101. gap: 16rpx;
  102. /deep/.uni-section {
  103. margin-top: 0px;
  104. }
  105. /deep/.uni-section-header {
  106. padding: 0px;
  107. }
  108. .search_btn {
  109. width: 120rpx;
  110. height: 70rpx;
  111. line-height: 70rpx;
  112. padding: 0 24rpx;
  113. background: $theme-color;
  114. font-size: 32rpx;
  115. color: #fff;
  116. margin: 0;
  117. margin-left: 26rpx;
  118. }
  119. .menu_icon {
  120. width: 44rpx;
  121. height: 44rpx;
  122. margin-left: 14rpx;
  123. }
  124. }
  125. .list_box {
  126. flex: 1;
  127. overflow: hidden;
  128. padding: 16rpx 0;
  129. .u-list {
  130. height: 100% !important;
  131. }
  132. }
  133. </style>