fileTransmitList.vue 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178
  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" @click="toInfo(item)">
  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. toInfo(item) {
  79. if(this.type==3 ){
  80. uni.navigateTo({
  81. url: '/pages/fileTransmit/fileInfo?id='+item.id
  82. })
  83. }else {
  84. uni.navigateTo({
  85. url: '/pages/fileTransmit/examineFile?id='+item.id
  86. })
  87. }
  88. },
  89. // 搜索
  90. doSearch() {
  91. console.log("search=============", this.searchForm);
  92. this.dataList = [];
  93. this.tablePage.currentPage = 0;
  94. this.tablePage.pageSize = 10;
  95. this.tablePage.pages = 0;
  96. this.loadmore()
  97. },
  98. onReachBottom() {
  99. this.loadmore()
  100. },
  101. loadmore() {
  102. if (this.tablePage.currentPage !== 0 && this.tablePage.pages <= this.tablePage.currentPage) {
  103. this.status = 'nomore';
  104. return;
  105. }
  106. this.tablePage.currentPage = ++this.tablePage.currentPage;
  107. //联网加载数据
  108. this.status = 'loading';
  109. gwCirculationCard2Service.list({
  110. current: this.tablePage.currentPage,
  111. size: this.tablePage.pageSize,
  112. orders: this.tablePage.orders,
  113. // beginCreateDate: this.searchForm.createDate ? this.searchForm.createDate[0] : '',
  114. // endCreateDate: this.searchForm.createDate ? this.searchForm.createDate[1] : '',
  115. ...this.searchForm
  116. }).then((data) => {
  117. //追加新数据
  118. this.dataList = this.dataList.concat(data.records);
  119. let places = []
  120. this.dataList.forEach(item => {
  121. places.push({
  122. text: item.sendingAgency,
  123. value: item.sendingAgency
  124. })
  125. });
  126. this.range = places.filter((item) => !places.includes(item.value) && places.push(item.value))
  127. this.tablePage.pages = data.pages;
  128. if (this.tablePage.pages <= this.tablePage.currentPage) {
  129. this.status = 'nomore'
  130. } else {
  131. this.status = 'loadmore'
  132. }
  133. })
  134. }
  135. }
  136. }
  137. </script>
  138. <style>
  139. .card_banner {
  140. width: 100%;
  141. height: 60px;
  142. background-color: #36a7f3;
  143. }
  144. .list_search_icon {
  145. line-height: 60px;
  146. }
  147. .list_search_select {
  148. width: 200px;
  149. background-color: #fff;
  150. height: 30px;
  151. border-radius: 10px;
  152. margin: 15px 5px 0;
  153. }
  154. .list_search_date {
  155. margin: 8px 5px 0;
  156. }
  157. .t-c {
  158. height: 34px;
  159. line-height: 34px;
  160. }
  161. .list_content {
  162. background-color: #fff;
  163. }
  164. .list_label {
  165. margin-top: 33px;
  166. }
  167. </style>