shouwen.vue 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475
  1. <template>
  2. <view style="width: 100vw;height:100vh;">
  3. <view style="height: calc(100% - 102rpx);">
  4. <swiper style="height: 100%;background-color:#F3F4F6 ;" :current="current" disable-touch
  5. @animationfinish="animationfinish">
  6. <swiper-item>
  7. <scroll-view scroll-y style="width: 100%;height: 100%;overflow: auto;box-sizing: border-box;"
  8. lower-threshold="10" :refresher-enabled="xlList1[0]" :refresher-triggered="xlList2[0]"
  9. @scrolltolower="lower(0)" @refresherrefresh="refresherrefresh(0)"
  10. @refresherrestore="refresherrestore(0)">
  11. <view style="padding: 20rpx;background-color: #fff;">
  12. <u-search v-model="db.title" placeholder="请输入标题" :showAction="true" actionText="搜索"
  13. :animation="true" @custom="dbsearch" @clear="dbsearch">
  14. </u-search>
  15. </view>
  16. <view v-for="(item,index) in dbList" :key="index"
  17. style="padding: 20rpx 40rpx;border-bottom: 1px solid #eaeaea;background-color: #fff;"
  18. @click="getinfo(item)">
  19. <view style="display: flex;">
  20. <span v-if="item.FlowName == '收文-急件'">
  21. <image mode="widthFix" style="width: 18px; vertical-align: middle"
  22. src="/static/ji.png" alt="">
  23. </image>
  24. </span>
  25. <span v-if="item.isZhuBan == 'Y'">
  26. <image mode="widthFix" style="width: 18px; vertical-align: middle"
  27. src="/static/zhu.png" alt="">
  28. </image>
  29. </span>
  30. <u--text style="display: inline-block;" :lines="1" size="32rpx"
  31. :text="item.Title"></u--text>
  32. </view>
  33. <view
  34. style="display: flex;justify-content: space-between;margin-top: 20rpx;color:#909399;font-size: 28rpx;">
  35. <view style="display: flex;align-items: center;">
  36. {{item.FlowName}} <span style="margin-left: 20px;">{{item.NodeName}}</span>
  37. <view v-if="item.WFState == 5">
  38. (退回)
  39. </view>
  40. <view v-if="item.WFState == 6">
  41. (移交)
  42. </view>
  43. </view>
  44. <view>{{showtime(item.ADT)}}</view>
  45. </view>
  46. </view>
  47. <div style="padding: 10rpx 0;" v-if="dbList.length > 0">
  48. <u-loadmore :status="statusList[0]" />
  49. </div>
  50. <div v-if="dbList.length == 0">
  51. <u-empty mode="list" icon="/static/list.png" text="暂无内容" textSize="30rpx"></u-empty>
  52. </div>
  53. </scroll-view>
  54. </swiper-item>
  55. <swiper-item>
  56. <scroll-view scroll-y style="width: 100%;height: 100%;overflow: auto;box-sizing: border-box;"
  57. lower-threshold="10" :refresher-enabled="xlList1[2]" :refresher-triggered="xlList2[2]"
  58. @scrolltolower="lower(2)" @refresherrefresh="refresherrefresh(2)"
  59. @refresherrestore="refresherrestore(2)">
  60. <view style="padding: 20rpx;background-color: #fff;">
  61. <u-search v-model="me.title" placeholder="请输入标题" :showAction="true" actionText="搜索"
  62. :animation="true" @custom="mesearch" @clear="mesearch">
  63. </u-search>
  64. </view>
  65. <view v-for="(item,index) in meList" :key="index"
  66. style="padding: 20rpx 40rpx;border-bottom: 1px solid #eaeaea;background-color: #fff;"
  67. @click="getinfo(item)">
  68. <view style="display: flex;">
  69. <span v-if="item.FlowName == '收文-急件'">
  70. <image mode="widthFix" style="width: 18px; vertical-align: middle"
  71. src="/static/ji.png" alt="">
  72. </image>
  73. </span>
  74. <span v-if="item.isZhuBan == 'Y'">
  75. <image mode="widthFix" style="width: 18px; vertical-align: middle"
  76. src="/static/zhu.png" alt="">
  77. </image>
  78. </span>
  79. <u--text style="display: inline-block;" :lines="1" size="32rpx"
  80. :text="item.Title"></u--text>
  81. </view>
  82. <view
  83. style="display: flex;justify-content: space-between;margin-top: 20rpx;color:#909399;font-size: 28rpx;">
  84. <view style="display: flex;align-items: center;">
  85. {{item.FlowName}} <span style="margin-left: 20px;">{{item.NodeName}}</span>
  86. <view v-if="item.WFState == 5">
  87. (退回)
  88. </view>
  89. <view v-if="item.WFState == 6">
  90. (移交)
  91. </view>
  92. </view>
  93. <view>{{showtime(item.RDT)}}</view>
  94. </view>
  95. </view>
  96. <div style="padding: 10rpx 0;" v-if="meList.length > 0">
  97. <u-loadmore :status="statusList[2]" />
  98. </div>
  99. <div v-if="meList.length == 0">
  100. <u-empty mode="list" icon="/static/list.png" text="暂无内容" textSize="30rpx"></u-empty>
  101. </div>
  102. </scroll-view>
  103. </swiper-item>
  104. <swiper-item>
  105. <scroll-view scroll-y style="width: 100%;height: 100%;overflow: auto;box-sizing: border-box;"
  106. lower-threshold="10" :refresher-enabled="xlList1[1]" :refresher-triggered="xlList2[1]"
  107. @scrolltolower="lower(1)" @refresherrefresh="refresherrefresh(1)"
  108. @refresherrestore="refresherrestore(1)">
  109. <view style="padding: 20rpx;background-color: #fff;">
  110. <u-search v-model="yb.title" placeholder="请输入标题" :showAction="true" actionText="搜索"
  111. :animation="true" @custom="ybsearch" @clear="ybsearch">
  112. </u-search>
  113. </view>
  114. <view v-for="(item,index) in ybList" :key="index"
  115. style="padding: 20rpx 40rpx;border-bottom: 1px solid #eaeaea;background-color: #fff;"
  116. @click="getinfo(item)">
  117. <view style="display: flex;">
  118. <span v-if="item.FlowName == '收文-急件'">
  119. <image mode="widthFix" style="width: 18px; vertical-align: middle"
  120. src="/static/ji.png" alt="">
  121. </image>
  122. </span>
  123. <span v-if="item.isZhuBan == 'Y'">
  124. <image mode="widthFix" style="width: 18px; vertical-align: middle"
  125. src="/static/zhu.png" alt="">
  126. </image>
  127. </span>
  128. <u--text :lines="1" size="32rpx" :text="item.Title"></u--text>
  129. </view>
  130. <view
  131. style="display: flex;justify-content: space-between;margin-top: 20rpx;color:#909399;font-size: 28rpx;">
  132. <view>
  133. {{item.FlowName}} <span style="margin-left: 20px;">{{item.NodeName}}</span>
  134. </view>
  135. <view>{{showtime(item.RDT)}}</view>
  136. </view>
  137. </view>
  138. <div style="padding: 10rpx 0;" v-if="ybList.length >0">
  139. <u-loadmore :status="statusList[1]" />
  140. </div>
  141. <div v-if="ybList.length == 0">
  142. <u-empty mode="list" icon="/static/list.png" text="暂无内容" textSize="30rpx"></u-empty>
  143. </div>
  144. </scroll-view>
  145. </swiper-item>
  146. </swiper>
  147. </view>
  148. <view style="height: 100rpx;border-top: 2px solid #dadbde;box-sizing: border-box;background-color: #fff;">
  149. <u-grid :border="true" col="3">
  150. <u-grid-item @click="click(0)">
  151. <text class="grid-text" :class="current==0?'choose':''">待办</text>
  152. </u-grid-item>
  153. <u-grid-item @click="click(1)">
  154. <text class="grid-text" :class="current==1?'choose':''">我的提交</text>
  155. </u-grid-item>
  156. <u-grid-item @click="click(2)">
  157. <text class="grid-text" :class="current==2?'choose':''">已办</text>
  158. </u-grid-item>
  159. </u-grid>
  160. </view>
  161. </view>
  162. </template>
  163. <script>
  164. import {
  165. showtime
  166. } from "@/utils/wjw.js"
  167. import jiPng from '@/static/ji.png'
  168. export default {
  169. data() {
  170. return {
  171. jiPng,
  172. //当前待办还是已办
  173. current: 0,
  174. //待办相关
  175. db: {
  176. pageNum: 1,
  177. pageSize: 10,
  178. fkFlow: null,
  179. title: null,
  180. token: uni.getStorageSync('jtoken')
  181. },
  182. dbList: [],
  183. dbSearch: null,
  184. dbTotal: 0,
  185. //已办相关
  186. yb: {
  187. pageNum: 1,
  188. pageSize: 10,
  189. fkFlow: null,
  190. title: null,
  191. token: uni.getStorageSync('jtoken')
  192. },
  193. ybList: [],
  194. ybSearch: null,
  195. ybTotal: 0,
  196. //下拉刷新相关
  197. xlList1: [true, false, false],
  198. xlList2: [true, true, true],
  199. statusList: ['loadmore', 'loadmore', 'loadmore'],
  200. //查看事件
  201. showtime: showtime,
  202. //收发文状态
  203. type: null,
  204. meTotal: 0,
  205. meList: [],
  206. meSearch: null,
  207. me: {
  208. pageNum: 1,
  209. pageSize: 10,
  210. fkFlow: null,
  211. title: null,
  212. token: uni.getStorageSync('jtoken')
  213. },
  214. shouwenNum: null,
  215. numList: {},
  216. num: 0,
  217. }
  218. },
  219. onLoad(options) {
  220. this.db.fkFlow = options.fkFlow
  221. this.yb.fkFlow = options.fkFlow
  222. this.me.fkFlow = options.fkFlow
  223. this.type = options.type
  224. uni.setNavigationBarTitle({
  225. title: options.title
  226. })
  227. this.getDbList()
  228. },
  229. onShow() {
  230. getApp().globalData.peoIdList = []
  231. getApp().globalData.peoList = []
  232. getApp().globalData.peoDeptList = []
  233. getApp().globalData.adjustUserId = ''
  234. getApp().globalData.user = ''
  235. uni.$off()
  236. uni.$on('query', (query) => {
  237. if (query.a == 'back') {
  238. // uni.showLoading({
  239. // title:'加载中...',
  240. // mask:true
  241. // })
  242. setTimeout(() => {
  243. this.db.pageNum = 1
  244. this.dbList = []
  245. this.getDbList()
  246. this.yb.pageNum = 1
  247. this.ybList = []
  248. this.getYbList()
  249. this.me.pageNum = 1
  250. this.meList = []
  251. this.getMeList()
  252. uni.$emit('query', {
  253. a: 'stag'
  254. })
  255. }, 2000)
  256. }
  257. })
  258. },
  259. methods: {
  260. //点击已办待办
  261. click(i) {
  262. this.current = i
  263. if (i == 0) {
  264. this.xlList1[0] = true
  265. this.xlList1[1] = false
  266. this.xlList1[2] = false
  267. if (this.dbList.length == 0) {
  268. this.getDbList()
  269. }
  270. } else if (i == 2) {
  271. this.xlList1[0] = false
  272. this.xlList1[2] = false
  273. this.xlList1[1] = true
  274. if (this.ybList.length == 0) {
  275. this.getYbList()
  276. }
  277. } else {
  278. this.xlList1[0] = false
  279. this.xlList1[2] = false
  280. this.xlList1[1] = true
  281. if (this.meList.length == 0) {
  282. this.getMeList()
  283. }
  284. }
  285. },
  286. //swiper切换
  287. animationfinish(e) {
  288. this.current = e.detail.current;
  289. },
  290. //查询待办列表
  291. getDbList() {
  292. uni.$u.http.get('/offcial/receive/todolist', {
  293. params: this.db
  294. }).then(res => {
  295. uni.hideLoading()
  296. this.dbList = [...this.dbList, ...res.list]
  297. if (res.total <= this.db.pageSize) {
  298. this.statusList[0] = "nomore"
  299. } else {
  300. this.statusList[0] = "loadmore"
  301. }
  302. this.dbTotal = Math.ceil(res.total / this.db.pageSize)
  303. this.$forceUpdate()
  304. })
  305. },
  306. //查询已办列表
  307. getYbList() {
  308. uni.$u.http.get('/jflow/restful/MyJoinOneFlows', {
  309. params: this.yb
  310. }).then(res => {
  311. uni.hideLoading()
  312. this.ybList = [...this.ybList, ...res.list]
  313. if (res.total <= this.yb.pageSize) {
  314. this.statusList[1] = "nomore"
  315. } else {
  316. this.statusList[1] = "loadmore"
  317. }
  318. this.ybTotal = Math.ceil(res.total / this.yb.pageSize)
  319. this.$forceUpdate()
  320. })
  321. },
  322. //查询我的提交列表
  323. getMeList() {
  324. uni.$u.http.get('/jflow/restful/DB_MyStartFlowInstance', {
  325. params: this.me
  326. }).then(res => {
  327. uni.hideLoading()
  328. this.meList = [...this.meList, ...res.list]
  329. if (res.total <= this.me.pageSize) {
  330. this.statusList[2] = "nomore"
  331. } else {
  332. this.statusList[2] = "loadmore"
  333. }
  334. this.meTotal = Math.ceil(res.total / this.me.pageSize)
  335. this.$forceUpdate()
  336. })
  337. },
  338. //触底加载
  339. lower(e) {
  340. if (e == 0) {
  341. if (this.db.pageNum != this.dbTotal) {
  342. uni.showLoading({
  343. title: "加载中..."
  344. })
  345. this.db.pageNum++
  346. this.getDbList()
  347. } else {
  348. uni.hideLoading()
  349. this.statusList[e] = "nomore"
  350. this.$forceUpdate()
  351. }
  352. } else if (e == 1) {
  353. if (this.yb.pageNum != this.ybTotal) {
  354. uni.showLoading({
  355. title: "加载中..."
  356. })
  357. this.yb.pageNum++
  358. this.getYbList()
  359. } else {
  360. uni.hideLoading()
  361. this.statusList[e] = "nomore"
  362. this.$forceUpdate()
  363. }
  364. } else {
  365. if (this.me.pageNum != this.meTotal) {
  366. uni.showLoading({
  367. title: "加载中..."
  368. })
  369. this.me.pageNum++
  370. this.getMeList()
  371. } else {
  372. uni.hideLoading()
  373. this.statusList[e] = "nomore"
  374. this.$forceUpdate()
  375. }
  376. }
  377. },
  378. //下拉刷新
  379. refresherrefresh(e) {
  380. if (e == 0) {
  381. this.xlList2[e] = true
  382. this.db.pageNum = 1
  383. this.dbList = []
  384. this.getDbList()
  385. setTimeout(() => {
  386. this.xlList2[e] = false
  387. this.$forceUpdate()
  388. }, 2000)
  389. } else if (e == 1) {
  390. this.xlList2[e] = true
  391. this.yb.pageNum = 1
  392. this.ybList = []
  393. this.getYbList()
  394. setTimeout(() => {
  395. this.xlList2[e] = false
  396. this.$forceUpdate()
  397. }, 2000)
  398. } else {
  399. this.xlList2[e] = true
  400. this.me.pageNum = 1
  401. this.meList = []
  402. this.getMeList()
  403. setTimeout(() => {
  404. this.xlList2[e] = false
  405. this.$forceUpdate()
  406. }, 2000)
  407. }
  408. },
  409. refresherrestore(e) {
  410. },
  411. //待办搜索
  412. dbsearch() {
  413. this.db.pageNum = 1
  414. this.dbList = []
  415. this.getDbList()
  416. },
  417. //已办搜索
  418. ybsearch() {
  419. this.yb.pageNum = 1
  420. this.ybList = []
  421. this.getYbList()
  422. },
  423. //已办搜索
  424. mesearch() {
  425. this.me.pageNum = 1
  426. this.meList = []
  427. this.getMeList()
  428. },
  429. //查看收文发文详情
  430. getinfo(item) {
  431. if (this.type == 1) {
  432. uni.navigateTo({
  433. url: "/pages/swMessage/swMessage?workid=" + item.WorkID + '&type=' + this.current +
  434. '&flowNo=' + item.FK_Flow + "&title=" + item.Title + "&nodeName=" + item.NodeName +
  435. "&nodeId=" + item.FK_Node + '&current=' + this.current
  436. })
  437. } else if (this.type == 2) {
  438. uni.navigateTo({
  439. url: "/pages/fwMessage/fwMessage?workid=" + item.WorkID + '&type=' + this.current +
  440. '&flowNo=' + this.db.fkFlow + "&title=" + item.Title + "&nodeName=" + item.NodeName +
  441. "&nodeId=" + item.FK_Node
  442. })
  443. } else {
  444. uni.navigateTo({
  445. url: "/pages/inforeview/inforeview?workid=" + item.WorkID + '&type=' + this.current +
  446. '&flowNo=' + this.db.fkFlow + "&title=" + item.Title + "&nodeName=" + item.NodeName +
  447. "&nodeId=" + item.FK_Node
  448. })
  449. }
  450. }
  451. }
  452. }
  453. </script>
  454. <style lang="scss" scoped>
  455. .grid-text {
  456. height: 100rpx;
  457. line-height: 100rpx;
  458. font-size: 36rpx;
  459. color: #606266;
  460. /* #ifndef APP-PLUS */
  461. box-sizing: border-box;
  462. /* #endif */
  463. }
  464. .choose {
  465. color: #409EFF
  466. }
  467. </style>