fileTransmitList.vue 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242
  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. data() {
  74. return {
  75. status: 'loadmore',
  76. type: "",
  77. time: "",
  78. value: "",
  79. range: [],
  80. dataList: [],
  81. searchForm: {
  82. yearNum: '',
  83. cardNum: '',
  84. sendingAgency: '',
  85. docFontSize: '',
  86. fileSource: '',
  87. writtenTime: '',
  88. receivingTime: '',
  89. contentSummary: '',
  90. state: '',
  91. createTime: ""
  92. },
  93. tablePage: {
  94. pages: 0,
  95. currentPage: 0,
  96. pageSize: 10,
  97. orders: [{
  98. column: "a.create_time",
  99. asc: false
  100. }],
  101. },
  102. loading: false,
  103. }
  104. },
  105. methods: {
  106. // 查看详情
  107. toInfo(item) {
  108. console.log("item ===",this.type);
  109. if (this.type == 3 || this.type == 5 || this.type == 4) {
  110. uni.navigateTo({
  111. url: '/pages/fileTransmit/fileInfo?id=' + item.id
  112. })
  113. } else {
  114. uni.navigateTo({
  115. url: '/pages/fileTransmit/examineFile?id=' + item.id
  116. })
  117. // let user = $auth.getUserInfo()
  118. // let role = $auth.getUserInfo().roleNames
  119. // if (role == '办公室主任') {
  120. // uni.navigateTo({
  121. // url: '/pages/fileTransmit/examineFile?id=' + item.id
  122. // })
  123. // } else {
  124. // gwFlowService.queryByGwId(item.id).then(data => {
  125. // let gw = data.filter(item => {
  126. // return item.nextUser == user.id && item.state == 1
  127. // })
  128. // if (gw.length > 0) {
  129. // uni.navigateTo({
  130. // url: '/pages/fileTransmit/examineFile?id=' + item.id
  131. // })
  132. // } else {
  133. // }
  134. // })
  135. // }
  136. }
  137. },
  138. // 搜索
  139. doSearch() {
  140. console.log("search=============", this.searchForm);
  141. this.dataList = [];
  142. this.tablePage.currentPage = 0;
  143. this.tablePage.pageSize = 10;
  144. this.tablePage.pages = 0;
  145. this.loadmore()
  146. },
  147. onReachBottom() {
  148. this.loadmore()
  149. },
  150. loadmore() {
  151. if (this.tablePage.currentPage !== 0 && this.tablePage.pages <= this.tablePage.currentPage) {
  152. this.status = 'nomore';
  153. return;
  154. }
  155. this.tablePage.currentPage = ++this.tablePage.currentPage;
  156. //联网加载数据
  157. this.status = 'loading';
  158. let {
  159. createTime,
  160. ...newForm
  161. } = this.searchForm
  162. gwCirculationCard2Service.list({
  163. current: this.tablePage.currentPage,
  164. size: this.tablePage.pageSize,
  165. orders: this.tablePage.orders,
  166. beginCreateDate: this.searchForm.createTime ? this.searchForm.createTime[0] : '',
  167. endCreateDate: this.searchForm.createTime ? this.searchForm.createTime[1] : '',
  168. ...newForm
  169. }).then((data) => {
  170. //追加新数据
  171. this.dataList = this.dataList.concat(data.records);
  172. let places = []
  173. this.dataList.forEach(item => {
  174. places.push({
  175. text: item.sendingAgency,
  176. value: item.sendingAgency
  177. })
  178. });
  179. this.range = places.filter((item) => !places.includes(item.value) && places.push(item.value))
  180. this.tablePage.pages = data.pages;
  181. if (this.tablePage.pages <= this.tablePage.currentPage) {
  182. this.status = 'nomore'
  183. } else {
  184. this.status = 'loadmore'
  185. }
  186. })
  187. }
  188. }
  189. }
  190. </script>
  191. <style>
  192. .card_banner {
  193. width: 100%;
  194. height: 60px;
  195. background-color: #36a7f3;
  196. }
  197. .ellipsis-description {
  198. font-size: 20px;
  199. }
  200. .u-transition {
  201. align-items: flex-end;
  202. }
  203. .list_search_icon {
  204. line-height: 60px;
  205. }
  206. .list_search_select {
  207. width: 200px;
  208. background-color: #fff;
  209. height: 30px;
  210. border-radius: 10px;
  211. margin: 15px 5px 0;
  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>