shouwen.vue 8.2 KB

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