fileTransmitList.vue 6.7 KB

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