fileTransmitList.vue 5.6 KB

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