shouwen.vue 8.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310
  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;" lower-threshold="10" :refresher-enabled="xlList1[0]" :refresher-triggered="xlList2[0]" @scrolltolower="lower(0)" @refresherrefresh="refresherrefresh(0)" @refresherrestore="refresherrestore(0)">
  8. <view style="padding: 20rpx;background-color: #fff;">
  9. <u-search v-model="db.title" placeholder="请输入标题" :showAction="true" actionText="搜索"
  10. :animation="true" @custom="dbsearch" @clear="dbsearch">
  11. </u-search>
  12. </view>
  13. <view v-for="(item,index) in dbList" :key="index" style="padding: 20rpx 40rpx;border-bottom: 1px solid #eaeaea;background-color: #fff;" @click="getinfo(item)">
  14. <view >
  15. <u--text :lines="1" size="32rpx" :text="item.Title"></u--text>
  16. </view>
  17. <view style="display: flex;justify-content: space-between;margin-top: 20rpx;color:#909399;font-size: 28rpx;">
  18. <view style="display: flex;align-items: center;">
  19. {{item.NodeName}}
  20. <view v-if="item.WFState == 5">
  21. (退回)
  22. </view>
  23. <view v-if="item.WFState == 6">
  24. (移交)
  25. </view>
  26. </view>
  27. <view>{{showtime(item.ADT)}}</view>
  28. </view>
  29. </view>
  30. <div style="padding: 10rpx 0;" v-if="dbList.length > 0">
  31. <u-loadmore :status="statusList[0]" />
  32. </div>
  33. <div v-if="dbList.length == 0">
  34. <u-empty mode="list" icon="/static/list.png" text="暂无内容" textSize="30rpx"></u-empty>
  35. </div>
  36. </scroll-view>
  37. </swiper-item>
  38. <swiper-item >
  39. <scroll-view scroll-y style="width: 100%;height: 100%;overflow: auto;box-sizing: border-box;" lower-threshold="10" :refresher-enabled="xlList1[1]" :refresher-triggered="xlList2[1]" @scrolltolower="lower(1)" @refresherrefresh="refresherrefresh(1)" @refresherrestore="refresherrestore(1)">
  40. <view style="padding: 20rpx;background-color: #fff;">
  41. <u-search v-model="yb.title" placeholder="请输入标题" :showAction="true" actionText="搜索"
  42. :animation="true" @custom="ybsearch" @clear="ybsearch">
  43. </u-search>
  44. </view>
  45. <view v-for="(item,index) in ybList" :key="index" style="padding: 20rpx 40rpx;border-bottom: 1px solid #eaeaea;background-color: #fff;" @click="getinfo(item)">
  46. <view >
  47. <u--text :lines="1" size="32rpx" :text="item.Title"></u--text>
  48. </view>
  49. <view style="display: flex;justify-content: space-between;margin-top: 20rpx;color:#909399;font-size: 28rpx;">
  50. <view >
  51. {{item.NodeName}}
  52. </view>
  53. <view>{{showtime(item.RDT)}}</view>
  54. </view>
  55. </view>
  56. <div style="padding: 10rpx 0;" v-if="ybList.length >0">
  57. <u-loadmore :status="statusList[1]" />
  58. </div>
  59. <div v-if="ybList.length == 0">
  60. <u-empty mode="list" icon="/static/list.png" text="暂无内容" textSize="30rpx"></u-empty>
  61. </div>
  62. </scroll-view>
  63. </swiper-item>
  64. </swiper>
  65. </view>
  66. <view style="height: 100rpx;border-top: 2px solid #dadbde;box-sizing: border-box;background-color: #fff;">
  67. <u-grid :border="true" col="2">
  68. <u-grid-item @click="click(0)">
  69. <text class="grid-text" :class="current==0?'choose':''">待办</text>
  70. </u-grid-item>
  71. <u-grid-item @click="click(1)">
  72. <text class="grid-text" :class="current==1?'choose':''">已办</text>
  73. </u-grid-item>
  74. </u-grid>
  75. </view>
  76. </view>
  77. </template>
  78. <script>
  79. import {showtime} from "@/utils/wjw.js"
  80. export default {
  81. data() {
  82. return {
  83. //当前待办还是已办
  84. current:0,
  85. //待办相关
  86. db:{
  87. pageNum:1,
  88. pageSize:20,
  89. fkFlow:null,
  90. title:null,
  91. token:uni.getStorageSync('jtoken')
  92. },
  93. dbList:[],
  94. dbSearch:null,
  95. dbTotal:0,
  96. //已办相关
  97. yb:{
  98. pageNum:1,
  99. pageSize:20,
  100. fkFlow:null,
  101. title:null,
  102. token:uni.getStorageSync('jtoken')
  103. },
  104. ybList:[],
  105. ybSearch:null,
  106. ybTotal:0,
  107. //下拉刷新相关
  108. xlList1:[true,false],
  109. xlList2:[true,true],
  110. statusList:['loadmore','loadmore'],
  111. //查看事件
  112. showtime:showtime,
  113. //收发文状态
  114. type:null,
  115. }
  116. },
  117. onLoad(options){
  118. this.db.fkFlow = options.fkFlow
  119. this.yb.fkFlow = options.fkFlow
  120. this.type = options.type
  121. uni.setNavigationBarTitle({
  122. title:options.title
  123. })
  124. this.getDbList()
  125. },
  126. onShow(){
  127. getApp().globalData.peoIdList = []
  128. getApp().globalData.peoList = []
  129. getApp().globalData.peoDeptList = []
  130. getApp().globalData.adjustUserId=''
  131. getApp().globalData.user=''
  132. uni.$off()
  133. uni.$on('query', (query) => {
  134. if(query.a== 'back'){
  135. // uni.showLoading({
  136. // title:'加载中...',
  137. // mask:true
  138. // })
  139. setTimeout(()=>{
  140. this.db.pageNum = 1
  141. this.dbList = []
  142. this.getDbList()
  143. this.yb.pageNum = 1
  144. this.ybList = []
  145. this.getYbList()
  146. },2000)
  147. }
  148. })
  149. },
  150. methods: {
  151. //点击已办待办
  152. click(i){
  153. this.current = i
  154. if(i==0){
  155. this.xlList1[0] = true
  156. this.xlList1[1] = false
  157. if(this.dbList.length == 0){
  158. this.getDbList()
  159. }
  160. }else{
  161. this.xlList1[0] = false
  162. this.xlList1[1] = true
  163. if(this.ybList.length == 0){
  164. this.getYbList()
  165. }
  166. }
  167. },
  168. //swiper切换
  169. animationfinish(e){
  170. this.current = e.detail.current;
  171. },
  172. //查询待办列表
  173. getDbList(){
  174. uni.$u.http.get('/jflow/restful/DB_Todolist_FlowNo',{params:this.db}).then(res=>{
  175. // console.log(res)
  176. uni.hideLoading()
  177. this.dbList = [...this.dbList,...res.list]
  178. if(res.total<=this.db.pageSize){
  179. this.statusList[0] = "nomore"
  180. }else{
  181. this.statusList[0] = "loadmore"
  182. }
  183. this.dbTotal = Math.ceil(res.total / this.db.pageSize)
  184. this.$forceUpdate()
  185. })
  186. },
  187. //查询已办列表
  188. getYbList(){
  189. uni.$u.http.get('/jflow/restful/MyJoinOneFlows',{params:this.yb}).then(res=>{
  190. console.log(res)
  191. uni.hideLoading()
  192. this.ybList = [...this.ybList,...res.list]
  193. if(res.total<=this.yb.pageSize){
  194. this.statusList[1] = "nomore"
  195. }else{
  196. this.statusList[1] = "loadmore"
  197. }
  198. this.ybTotal = Math.ceil(res.total / this.yb.pageSize)
  199. this.$forceUpdate()
  200. })
  201. },
  202. //触底加载
  203. lower(e){
  204. if(e==0){
  205. if(this.db.pageNum != this.dbTotal){
  206. uni.showLoading({
  207. title:"加载中..."
  208. })
  209. this.db.pageNum++
  210. this.getDbList()
  211. }else{
  212. uni.hideLoading()
  213. this.statusList[e] = "nomore"
  214. this.$forceUpdate()
  215. }
  216. }else{
  217. if(this.yb.pageNum != this.ybTotal){
  218. uni.showLoading({
  219. title:"加载中..."
  220. })
  221. this.yb.pageNum++
  222. this.getYbList()
  223. }else{
  224. uni.hideLoading()
  225. this.statusList[e] = "nomore"
  226. this.$forceUpdate()
  227. }
  228. }
  229. },
  230. //下拉刷新
  231. refresherrefresh(e){
  232. if(e==0){
  233. this.xlList2[e] = true
  234. this.db.pageNum = 1
  235. this.dbList = []
  236. this.getDbList()
  237. setTimeout(()=>{
  238. this.xlList2[e] = false
  239. this.$forceUpdate()
  240. },2000)
  241. }else{
  242. this.xlList2[e] = true
  243. this.yb.pageNum = 1
  244. this.ybList = []
  245. this.getYbList()
  246. setTimeout(()=>{
  247. this.xlList2[e] = false
  248. this.$forceUpdate()
  249. },2000)
  250. }
  251. },
  252. refresherrestore(e){
  253. },
  254. //待办搜索
  255. dbsearch(){
  256. this.db.pageNum = 1
  257. this.dbList = []
  258. this.getDbList()
  259. },
  260. //已办搜索
  261. ybsearch(){
  262. this.yb.pageNum = 1
  263. this.ybList = []
  264. this.getYbList()
  265. },
  266. //查看收文发文详情
  267. getinfo(item){
  268. if(this.type == 1){
  269. uni.navigateTo({
  270. url:"/pages/swMessage/swMessage?workid="+item.WorkID+'&type='+this.current+'&flowNo='+this.db.fkFlow+"&title="+item.Title+"&nodeName="+item.NodeName+"&nodeId="+item.FK_Node
  271. })
  272. }else if(this.type == 2){
  273. uni.navigateTo({
  274. url:"/pages/fwMessage/fwMessage?workid="+item.WorkID+'&type='+this.current+'&flowNo='+this.db.fkFlow+"&title="+item.Title+"&nodeName="+item.NodeName+"&nodeId="+item.FK_Node
  275. })
  276. }else{
  277. uni.navigateTo({
  278. url:"/pages/inforeview/inforeview?workid="+item.WorkID+'&type='+this.current+'&flowNo='+this.db.fkFlow+"&title="+item.Title+"&nodeName="+item.NodeName+"&nodeId="+item.FK_Node
  279. })
  280. }
  281. }
  282. }
  283. }
  284. </script>
  285. <style lang="scss" scoped>
  286. .grid-text {
  287. height: 100rpx;
  288. line-height: 100rpx;
  289. font-size: 36rpx;
  290. color: #606266;
  291. /* #ifndef APP-PLUS */
  292. box-sizing: border-box;
  293. /* #endif */
  294. }
  295. .choose{
  296. color:#409EFF
  297. }
  298. </style>