shouwen.vue 8.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308
  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. uni.$off()
  131. uni.$on('query', (query) => {
  132. if(query.a== 'back'){
  133. // uni.showLoading({
  134. // title:'加载中...',
  135. // mask:true
  136. // })
  137. setTimeout(()=>{
  138. this.db.pageNum = 1
  139. this.dbList = []
  140. this.getDbList()
  141. this.yb.pageNum = 1
  142. this.ybList = []
  143. this.getYbList()
  144. },2000)
  145. }
  146. })
  147. },
  148. methods: {
  149. //点击已办待办
  150. click(i){
  151. this.current = i
  152. if(i==0){
  153. this.xlList1[0] = true
  154. this.xlList1[1] = false
  155. if(this.dbList.length == 0){
  156. this.getDbList()
  157. }
  158. }else{
  159. this.xlList1[0] = false
  160. this.xlList1[1] = true
  161. if(this.ybList.length == 0){
  162. this.getYbList()
  163. }
  164. }
  165. },
  166. //swiper切换
  167. animationfinish(e){
  168. this.current = e.detail.current;
  169. },
  170. //查询待办列表
  171. getDbList(){
  172. uni.$u.http.get('/jflow/restful/DB_Todolist_FlowNo',{params:this.db}).then(res=>{
  173. // console.log(res)
  174. uni.hideLoading()
  175. this.dbList = [...this.dbList,...res.list]
  176. if(res.total<=this.db.pageSize){
  177. this.statusList[0] = "nomore"
  178. }else{
  179. this.statusList[0] = "loadmore"
  180. }
  181. this.dbTotal = Math.ceil(res.total / this.db.pageSize)
  182. this.$forceUpdate()
  183. })
  184. },
  185. //查询已办列表
  186. getYbList(){
  187. uni.$u.http.get('/jflow/restful/MyJoinOneFlows',{params:this.yb}).then(res=>{
  188. console.log(res)
  189. uni.hideLoading()
  190. this.ybList = [...this.ybList,...res.list]
  191. if(res.total<=this.yb.pageSize){
  192. this.statusList[1] = "nomore"
  193. }else{
  194. this.statusList[1] = "loadmore"
  195. }
  196. this.ybTotal = Math.ceil(res.total / this.yb.pageSize)
  197. this.$forceUpdate()
  198. })
  199. },
  200. //触底加载
  201. lower(e){
  202. if(e==0){
  203. if(this.db.pageNum != this.dbTotal){
  204. uni.showLoading({
  205. title:"加载中..."
  206. })
  207. this.db.pageNum++
  208. this.getDbList()
  209. }else{
  210. uni.hideLoading()
  211. this.statusList[e] = "nomore"
  212. this.$forceUpdate()
  213. }
  214. }else{
  215. if(this.yb.pageNum != this.ybTotal){
  216. uni.showLoading({
  217. title:"加载中..."
  218. })
  219. this.yb.pageNum++
  220. this.getYbList()
  221. }else{
  222. uni.hideLoading()
  223. this.statusList[e] = "nomore"
  224. this.$forceUpdate()
  225. }
  226. }
  227. },
  228. //下拉刷新
  229. refresherrefresh(e){
  230. if(e==0){
  231. this.xlList2[e] = true
  232. this.db.pageNum = 1
  233. this.dbList = []
  234. this.getDbList()
  235. setTimeout(()=>{
  236. this.xlList2[e] = false
  237. this.$forceUpdate()
  238. },2000)
  239. }else{
  240. this.xlList2[e] = true
  241. this.yb.pageNum = 1
  242. this.ybList = []
  243. this.getYbList()
  244. setTimeout(()=>{
  245. this.xlList2[e] = false
  246. this.$forceUpdate()
  247. },2000)
  248. }
  249. },
  250. refresherrestore(e){
  251. },
  252. //待办搜索
  253. dbsearch(){
  254. this.db.pageNum = 1
  255. this.dbList = []
  256. this.getDbList()
  257. },
  258. //已办搜索
  259. ybsearch(){
  260. this.yb.pageNum = 1
  261. this.ybList = []
  262. this.getYbList()
  263. },
  264. //查看收文发文详情
  265. getinfo(item){
  266. if(this.type == 1){
  267. uni.navigateTo({
  268. url:"/pages/swMessage/swMessage?workid="+item.WorkID+'&type='+this.current+'&flowNo='+this.db.fkFlow+"&title="+item.Title+"&nodeName="+item.NodeName+"&nodeId="+item.FK_Node
  269. })
  270. }else if(this.type == 2){
  271. uni.navigateTo({
  272. url:"/pages/fwMessage/fwMessage?workid="+item.WorkID+'&type='+this.current+'&flowNo='+this.db.fkFlow+"&title="+item.Title+"&nodeName="+item.NodeName+"&nodeId="+item.FK_Node
  273. })
  274. }else{
  275. uni.navigateTo({
  276. url:"/pages/inforeview/inforeview?workid="+item.WorkID+'&type='+this.current+'&flowNo='+this.db.fkFlow+"&title="+item.Title+"&nodeName="+item.NodeName+"&nodeId="+item.FK_Node
  277. })
  278. }
  279. }
  280. }
  281. }
  282. </script>
  283. <style lang="scss" scoped>
  284. .grid-text {
  285. height: 100rpx;
  286. line-height: 100rpx;
  287. font-size: 36rpx;
  288. color: #606266;
  289. /* #ifndef APP-PLUS */
  290. box-sizing: border-box;
  291. /* #endif */
  292. }
  293. .choose{
  294. color:#409EFF
  295. }
  296. </style>