fileTransmitList.vue 5.9 KB

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