fileTransmitList.vue 6.6 KB

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