fileTransmitList.vue 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204
  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. <u-loadmore :status="status" />
  33. </view>
  34. </template>
  35. <script>
  36. import gwCirculationCard2Service from '@/api/circulation/gwCirculationCard2.js'
  37. import gwFlowService from '@/api/circulation/gwFlowService.js'
  38. import * as $auth from "@/common/auth.js"
  39. export default {
  40. onLoad(option) {
  41. if (option) {
  42. this.type = option.type
  43. this.searchForm.state = option.type
  44. this.loadmore()
  45. }
  46. },
  47. data() {
  48. return {
  49. status: 'loadmore',
  50. type: "",
  51. time: "",
  52. value: "",
  53. range: [],
  54. dataList: [],
  55. searchForm: {
  56. yearNum: '',
  57. cardNum: '',
  58. sendingAgency: '',
  59. docFontSize: '',
  60. fileSource: '',
  61. writtenTime: '',
  62. receivingTime: '',
  63. contentSummary: '',
  64. state: '',
  65. createTime: ""
  66. },
  67. tablePage: {
  68. pages: 0,
  69. currentPage: 0,
  70. pageSize: 10,
  71. orders: [{
  72. column: "a.create_time",
  73. asc: false
  74. }],
  75. },
  76. loading: false,
  77. }
  78. },
  79. methods: {
  80. // 查看详情
  81. toInfo(item) {
  82. if (this.type == 3) {
  83. uni.navigateTo({
  84. url: '/pages/fileTransmit/fileInfo?id=' + item.id
  85. })
  86. } else {
  87. let user = $auth.getUserInfo()
  88. let role = $auth.getUserInfo().roleNames
  89. if (role == '办公室主任') {
  90. uni.navigateTo({
  91. url: '/pages/fileTransmit/examineFile?id=' + item.id
  92. })
  93. } else {
  94. gwFlowService.queryByGwId(item.id).then(data => {
  95. let gw = data.filter(item => {
  96. return item.nextUser == user.id && item.state == 1
  97. })
  98. if (gw.length > 0) {
  99. uni.navigateTo({
  100. url: '/pages/fileTransmit/examineFile?id=' + item.id
  101. })
  102. } else {
  103. uni.navigateTo({
  104. url: '/pages/fileTransmit/fileInfo?id=' + item.id
  105. })
  106. }
  107. })
  108. }
  109. }
  110. },
  111. // 搜索
  112. doSearch() {
  113. console.log("search=============", this.searchForm);
  114. this.dataList = [];
  115. this.tablePage.currentPage = 0;
  116. this.tablePage.pageSize = 10;
  117. this.tablePage.pages = 0;
  118. this.loadmore()
  119. },
  120. onReachBottom() {
  121. this.loadmore()
  122. },
  123. loadmore() {
  124. if (this.tablePage.currentPage !== 0 && this.tablePage.pages <= this.tablePage.currentPage) {
  125. this.status = 'nomore';
  126. return;
  127. }
  128. this.tablePage.currentPage = ++this.tablePage.currentPage;
  129. //联网加载数据
  130. this.status = 'loading';
  131. let {createTime,...newForm} = this.searchForm
  132. gwCirculationCard2Service.list({
  133. current: this.tablePage.currentPage,
  134. size: this.tablePage.pageSize,
  135. orders: this.tablePage.orders,
  136. beginCreateDate: this.searchForm.createTime ? this.searchForm.createTime[0] : '',
  137. endCreateDate: this.searchForm.createTime ? this.searchForm.createTime[1] : '',
  138. ...newForm
  139. }).then((data) => {
  140. //追加新数据
  141. this.dataList = this.dataList.concat(data.records);
  142. let places = []
  143. this.dataList.forEach(item => {
  144. places.push({
  145. text: item.sendingAgency,
  146. value: item.sendingAgency
  147. })
  148. });
  149. this.range = places.filter((item) => !places.includes(item.value) && places.push(item.value))
  150. this.tablePage.pages = data.pages;
  151. if (this.tablePage.pages <= this.tablePage.currentPage) {
  152. this.status = 'nomore'
  153. } else {
  154. this.status = 'loadmore'
  155. }
  156. })
  157. }
  158. }
  159. }
  160. </script>
  161. <style>
  162. .card_banner {
  163. width: 100%;
  164. height: 60px;
  165. background-color: #36a7f3;
  166. }
  167. .list_search_icon {
  168. line-height: 60px;
  169. }
  170. .list_search_select {
  171. width: 200px;
  172. background-color: #fff;
  173. height: 30px;
  174. border-radius: 10px;
  175. margin: 15px 5px 0;
  176. }
  177. .list_search_date {
  178. margin: 8px 5px 0;
  179. }
  180. .t-c {
  181. height: 34px;
  182. line-height: 34px;
  183. }
  184. .list_content {
  185. background-color: #fff;
  186. }
  187. .list_label {
  188. margin-top: 33px;
  189. }
  190. </style>