shouwen.vue 8.5 KB

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