fileTransmitList.vue 6.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281
  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>
  21. <u-tag v-if="$auth.getUserInfo().roleNames=='办公室管理员'&&(type==1 || type==4)" text="点击中止"
  22. type="warning" @click="suspend(item.id)">
  23. </u-tag>
  24. </view>
  25. <view class="text-grey text-sm list_label margin-top">
  26. {{item.createTime}}
  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. <u-toast ref="uToast"></u-toast>
  39. </view>
  40. </template>
  41. <script>
  42. import gwCirculationCard2Service from '@/api/circulation/gwCirculationCard2.js'
  43. import gwFlowService from '@/api/circulation/gwFlowService.js'
  44. import * as $auth from "@/common/auth.js"
  45. export default {
  46. onShow() {
  47. // 先获取页面栈
  48. let pages = getCurrentPages();
  49. // 当前页面的前一个页面
  50. let prevPage = pages[pages.length - 1];
  51. if (prevPage.options.type) {
  52. this.dataList = []
  53. this.type = prevPage.options.type
  54. switch (prevPage.options.type) {
  55. case "1":
  56. uni.setNavigationBarTitle({
  57. title: '待办列表' // 设置为你想要显示的标题文本
  58. });
  59. break;
  60. case "3":
  61. uni.setNavigationBarTitle({
  62. title: '归档列表' // 设置为你想要显示的标题文本
  63. });
  64. break;
  65. case "4":
  66. uni.setNavigationBarTitle({
  67. title: '已办列表' // 设置为你想要显示的标题文本
  68. });
  69. break;
  70. case "5":
  71. uni.setNavigationBarTitle({
  72. title: '公文列表' // 设置为你想要显示的标题文本
  73. });
  74. break;
  75. }
  76. this.searchForm.state = prevPage.options.type
  77. this.tablePage.currentPage = 0
  78. this.status = 'loading';
  79. this.loadmore()
  80. }
  81. },
  82. data() {
  83. return {
  84. status: 'loadmore',
  85. type: "",
  86. time: "",
  87. value: "",
  88. range: [],
  89. dataList: [],
  90. searchForm: {
  91. yearNum: '',
  92. cardNum: '',
  93. sendingAgency: '',
  94. docFontSize: '',
  95. fileSource: '',
  96. writtenTime: '',
  97. receivingTime: '',
  98. contentSummary: '',
  99. state: '',
  100. createTime: ""
  101. },
  102. tablePage: {
  103. pages: 0,
  104. currentPage: 0,
  105. pageSize: 10,
  106. orders: [{
  107. column: "a.create_time",
  108. asc: false
  109. }],
  110. },
  111. loading: false,
  112. }
  113. },
  114. methods: {
  115. showToast(params) {
  116. this.$refs.uToast.show({
  117. ...params,
  118. complete() {
  119. params.url && uni.redirectTo({
  120. url: params.url
  121. })
  122. }
  123. })
  124. },
  125. // 中止
  126. suspend(id) {
  127. uni.showModal({
  128. title: '中止原因',
  129. placeholderText: '输入中止原因',
  130. editable: true,
  131. success: function(res) {
  132. if (res.confirm) {
  133. gwCirculationCard2Service.abort(id, res.content).then((data) => {
  134. uni.showToast({
  135. title: "已中止",
  136. })
  137. that.status = 'loadmore'
  138. that.dataList = [];
  139. that.tablePage.currentPage = 0;
  140. that.tablePage.pageSize = 10;
  141. that.tablePage.pages = 0;
  142. that.loadmore()
  143. });
  144. } else if (res.cancel) {
  145. console.log('用户点击取消');
  146. }
  147. }
  148. });
  149. },
  150. // 查看详情
  151. toInfo(item) {
  152. if (this.type == 3 || this.type == 5 || this.type == 4) {
  153. uni.navigateTo({
  154. url: '/pages/fileTransmit/fileInfo?id=' + item.id
  155. })
  156. } else {
  157. uni.navigateTo({
  158. url: '/pages/fileTransmit/examineFile?id=' + item.id
  159. })
  160. }
  161. },
  162. // 搜索
  163. doSearch() {
  164. this.dataList = [];
  165. this.tablePage.currentPage = 0;
  166. this.tablePage.pageSize = 10;
  167. this.tablePage.pages = 0;
  168. this.loadmore()
  169. },
  170. onReachBottom() {
  171. this.loadmore()
  172. },
  173. loadmore() {
  174. if (this.tablePage.currentPage !== 0 && this.tablePage.pages <= this.tablePage.currentPage) {
  175. this.status = 'nomore';
  176. return;
  177. }
  178. this.tablePage.currentPage = ++this.tablePage.currentPage;
  179. //联网加载数据
  180. this.status = 'loading';
  181. let {
  182. createTime,
  183. ...newForm
  184. } = this.searchForm
  185. gwCirculationCard2Service.list({
  186. current: this.tablePage.currentPage,
  187. size: this.tablePage.pageSize,
  188. orders: this.tablePage.orders,
  189. beginCreateDate: this.searchForm.createTime ? this.searchForm.createTime[0] : '',
  190. endCreateDate: this.searchForm.createTime ? this.searchForm.createTime[1] : '',
  191. ...newForm
  192. }).then((data) => {
  193. //追加新数据
  194. this.dataList = this.dataList.concat(data.records);
  195. let places = []
  196. this.dataList.forEach(item => {
  197. places.push({
  198. text: item.sendingAgency,
  199. value: item.sendingAgency
  200. })
  201. });
  202. this.range = places.filter((item) => !places.includes(item.value) && places.push(item.value))
  203. this.tablePage.pages = data.pages;
  204. if (this.tablePage.pages <= this.tablePage.currentPage) {
  205. this.status = 'nomore'
  206. } else {
  207. this.status = 'loadmore'
  208. }
  209. })
  210. }
  211. }
  212. }
  213. </script>
  214. <style>
  215. .card_banner {
  216. width: 100%;
  217. height: 60px;
  218. background-color: #36a7f3;
  219. }
  220. .ellipsis-description {
  221. font-size: 18px;
  222. }
  223. .u-transition {
  224. align-items: flex-end;
  225. }
  226. .list_search_icon {
  227. line-height: 60px;
  228. }
  229. .list_search_select {
  230. /* */
  231. /* #ifdef H5 */
  232. width: 300px !important;
  233. /* #endif */
  234. background-color: #fff;
  235. height: 30px;
  236. border-radius: 10px;
  237. margin: 15px 5px 0;
  238. }
  239. .value_tag {
  240. width: 50%;
  241. position: relative;
  242. /* #ifdef H5 */
  243. right: -60px;
  244. /* #endif */
  245. /* #ifdef APP-PLUS */
  246. right: -50px;
  247. /* #endif */
  248. }
  249. .list_search_date {
  250. margin: 8px 5px 0;
  251. }
  252. .t-c {
  253. height: 34px;
  254. line-height: 34px;
  255. }
  256. .list_content {
  257. background-color: #fff;
  258. }
  259. .list_label {
  260. margin-top: 33px;
  261. }
  262. </style>