fileTransmitList.vue 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243
  1. <template>
  2. <view>
  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 class="value_tag">
  24. <u-tag v-if="type==5" :text="item.state==1?'待办':item.state == 3?'归档':'已办'" plain
  25. :type="item.state==1?'warning':item.state == 3?'primary':'success'">
  26. </u-tag>
  27. </view>
  28. </view>
  29. <view slot="label">
  30. <view class="text-grey margin-top">
  31. {{item.sendingAgency}}
  32. </view>
  33. </view>
  34. </u-cell>
  35. </u-cell-group>
  36. </view>
  37. <u-loadmore :status="status" />
  38. </view>
  39. </template>
  40. <script>
  41. import gwCirculationCard2Service from '@/api/circulation/gwCirculationCard2.js'
  42. import gwFlowService from '@/api/circulation/gwFlowService.js'
  43. import * as $auth from "@/common/auth.js"
  44. export default {
  45. onShow() {
  46. // 先获取页面栈
  47. let pages = getCurrentPages();
  48. // 当前页面的前一个页面
  49. let prevPage = pages[pages.length - 1];
  50. if (prevPage.options.type) {
  51. this.dataList = []
  52. this.type = prevPage.options.type
  53. switch (prevPage.options.type) {
  54. case "1":
  55. uni.setNavigationBarTitle({
  56. title: '待办列表' // 设置为你想要显示的标题文本
  57. });
  58. break;
  59. case "3":
  60. uni.setNavigationBarTitle({
  61. title: '归档列表' // 设置为你想要显示的标题文本
  62. });
  63. break;
  64. case "4":
  65. uni.setNavigationBarTitle({
  66. title: '已办列表' // 设置为你想要显示的标题文本
  67. });
  68. break;
  69. case "5":
  70. uni.setNavigationBarTitle({
  71. title: '公文列表' // 设置为你想要显示的标题文本
  72. });
  73. break;
  74. }
  75. this.searchForm.state = prevPage.options.type
  76. this.tablePage.currentPage = 0
  77. this.status = 'loading';
  78. this.loadmore()
  79. }
  80. },
  81. data() {
  82. return {
  83. status: 'loadmore',
  84. type: "",
  85. time: "",
  86. value: "",
  87. range: [],
  88. dataList: [],
  89. searchForm: {
  90. yearNum: '',
  91. cardNum: '',
  92. sendingAgency: '',
  93. docFontSize: '',
  94. fileSource: '',
  95. writtenTime: '',
  96. receivingTime: '',
  97. contentSummary: '',
  98. state: '',
  99. createTime: ""
  100. },
  101. tablePage: {
  102. pages: 0,
  103. currentPage: 0,
  104. pageSize: 10,
  105. orders: [{
  106. column: "a.create_time",
  107. asc: false
  108. }],
  109. },
  110. loading: false,
  111. }
  112. },
  113. methods: {
  114. // 查看详情
  115. toInfo(item) {
  116. if (this.type == 3 || this.type == 5 || this.type == 4) {
  117. uni.navigateTo({
  118. url: '/pages/fileTransmit/fileInfo?id=' + item.id
  119. })
  120. } else {
  121. uni.navigateTo({
  122. url: '/pages/fileTransmit/examineFile?id=' + item.id
  123. })
  124. }
  125. },
  126. // 搜索
  127. doSearch() {
  128. this.dataList = [];
  129. this.tablePage.currentPage = 0;
  130. this.tablePage.pageSize = 10;
  131. this.tablePage.pages = 0;
  132. this.loadmore()
  133. },
  134. onReachBottom() {
  135. this.loadmore()
  136. },
  137. loadmore() {
  138. if (this.tablePage.currentPage !== 0 && this.tablePage.pages <= this.tablePage.currentPage) {
  139. this.status = 'nomore';
  140. return;
  141. }
  142. this.tablePage.currentPage = ++this.tablePage.currentPage;
  143. //联网加载数据
  144. this.status = 'loading';
  145. let {
  146. createTime,
  147. ...newForm
  148. } = this.searchForm
  149. gwCirculationCard2Service.list({
  150. current: this.tablePage.currentPage,
  151. size: this.tablePage.pageSize,
  152. orders: this.tablePage.orders,
  153. beginCreateDate: this.searchForm.createTime ? this.searchForm.createTime[0] : '',
  154. endCreateDate: this.searchForm.createTime ? this.searchForm.createTime[1] : '',
  155. ...newForm
  156. }).then((data) => {
  157. //追加新数据
  158. this.dataList = this.dataList.concat(data.records);
  159. let places = []
  160. this.dataList.forEach(item => {
  161. places.push({
  162. text: item.sendingAgency,
  163. value: item.sendingAgency
  164. })
  165. });
  166. this.range = places.filter((item) => !places.includes(item.value) && places.push(item.value))
  167. this.tablePage.pages = data.pages;
  168. if (this.tablePage.pages <= this.tablePage.currentPage) {
  169. this.status = 'nomore'
  170. } else {
  171. this.status = 'loadmore'
  172. }
  173. })
  174. }
  175. }
  176. }
  177. </script>
  178. <style>
  179. .card_banner {
  180. width: 100%;
  181. height: 60px;
  182. background-color: #36a7f3;
  183. }
  184. .ellipsis-description {
  185. font-size: 18px;
  186. }
  187. .u-transition {
  188. align-items: flex-end;
  189. }
  190. .list_search_icon {
  191. line-height: 60px;
  192. }
  193. .list_search_select {
  194. /* */
  195. /* #ifdef H5 */
  196. width: 300px !important;
  197. /* #endif */
  198. background-color: #fff;
  199. height: 30px;
  200. border-radius: 10px;
  201. margin: 15px 5px 0;
  202. }
  203. .value_tag {
  204. width: 50%;
  205. position: relative;
  206. /* #ifdef H5 */
  207. right: -60px;
  208. /* #endif */
  209. /* #ifdef APP-PLUS */
  210. right: -50px;
  211. /* #endif */
  212. }
  213. .list_search_date {
  214. margin: 8px 5px 0;
  215. }
  216. .t-c {
  217. height: 34px;
  218. line-height: 34px;
  219. }
  220. .list_content {
  221. background-color: #fff;
  222. }
  223. .list_label {
  224. margin-top: 33px;
  225. }
  226. </style>