fileTransmitList.vue 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166
  1. <template>
  2. <view class="file_list_page">
  3. <view class="list_search card_banner flex">
  4. <uni-data-select class="list_search_select" v-model="searchForm.sendingAgency" :localdata="range"
  5. placeholder="发文部门"></uni-data-select>
  6. <uni-datetime-picker class="list_search_date" v-model="searchForm.createTime" type="daterange" />
  7. <u-icon class="list_search_icon" name="search" color="#fff" size="28" @click="doSearch"></u-icon>
  8. </view>
  9. <view class="list_content">
  10. <u-cell-group>
  11. <u-cell v-for="item in dataList">
  12. <view slot="title">
  13. <view class="text-bold text-black">
  14. <view class="ellipsis-description">
  15. {{item.contentSummary}}
  16. </view>
  17. </view>
  18. </view>
  19. <view slot="value">
  20. <view class="text-grey text-sm list_label margin-top">
  21. {{item.createTime}}
  22. </view>
  23. </view>
  24. <view slot="label">
  25. <view class="text-grey text-sm margin-top">
  26. {{item.sendingAgency}}
  27. </view>
  28. </view>
  29. </u-cell>
  30. </u-cell-group>
  31. </view>
  32. </view>
  33. </template>
  34. <script>
  35. import gwCirculationCard2Service from '@/api/circulation/gwCirculationCard2.js'
  36. export default {
  37. onLoad(option) {
  38. if (option) {
  39. this.type = option.type
  40. this.searchForm.state = option.type
  41. this.loadmore()
  42. }
  43. },
  44. data() {
  45. return {
  46. status: 'loadmore',
  47. type: "",
  48. time: "",
  49. value: "",
  50. range: [],
  51. dataList: [],
  52. searchForm: {
  53. yearNum: '',
  54. cardNum: '',
  55. sendingAgency: '',
  56. docFontSize: '',
  57. fileSource: '',
  58. writtenTime: '',
  59. receivingTime: '',
  60. contentSummary: '',
  61. state: '',
  62. createTime: ""
  63. },
  64. tablePage: {
  65. pages: 0,
  66. currentPage: 0,
  67. pageSize: 10,
  68. orders: [{
  69. column: "a.create_time",
  70. asc: false
  71. }],
  72. },
  73. loading: false,
  74. }
  75. },
  76. methods: {
  77. // 搜索
  78. doSearch() {
  79. console.log("search=============", this.searchForm);
  80. this.dataList = [];
  81. this.tablePage.currentPage = 0;
  82. this.tablePage.pageSize = 10;
  83. this.tablePage.pages = 0;
  84. this.loadmore()
  85. },
  86. onReachBottom() {
  87. this.loadmore()
  88. },
  89. loadmore() {
  90. if (this.tablePage.currentPage !== 0 && this.tablePage.pages <= this.tablePage.currentPage) {
  91. this.status = 'nomore';
  92. return;
  93. }
  94. this.tablePage.currentPage = ++this.tablePage.currentPage;
  95. //联网加载数据
  96. this.status = 'loading';
  97. gwCirculationCard2Service.list({
  98. current: this.tablePage.currentPage,
  99. size: this.tablePage.pageSize,
  100. orders: this.tablePage.orders,
  101. // beginCreateDate: this.searchForm.createDate ? this.searchForm.createDate[0] : '',
  102. // endCreateDate: this.searchForm.createDate ? this.searchForm.createDate[1] : '',
  103. ...this.searchForm
  104. }).then((data) => {
  105. //追加新数据
  106. this.dataList = this.dataList.concat(data.records);
  107. let places = []
  108. this.dataList.forEach(item => {
  109. places.push({
  110. text: item.sendingAgency,
  111. value: item.sendingAgency
  112. })
  113. });
  114. this.range = places.filter((item) => !places.includes(item.value) && places.push(item.value))
  115. this.tablePage.pages = data.pages;
  116. if (this.tablePage.pages <= this.tablePage.currentPage) {
  117. this.status = 'nomore'
  118. } else {
  119. this.status = 'loadmore'
  120. }
  121. })
  122. }
  123. }
  124. }
  125. </script>
  126. <style>
  127. .card_banner {
  128. width: 100%;
  129. height: 60px;
  130. background-color: #36a7f3;
  131. }
  132. .list_search_icon {
  133. line-height: 60px;
  134. }
  135. .list_search_select {
  136. width: 200px;
  137. background-color: #fff;
  138. height: 30px;
  139. border-radius: 10px;
  140. margin: 15px 5px 0;
  141. }
  142. .list_search_date {
  143. margin: 8px 5px 0;
  144. }
  145. .t-c {
  146. height: 34px;
  147. line-height: 34px;
  148. }
  149. .list_content {
  150. background-color: #fff;
  151. }
  152. .list_label {
  153. margin-top: 33px;
  154. }
  155. </style>