dailyWork.vue 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407
  1. <template>
  2. <view style="width: 100vw;height:100vh;">
  3. <view style="height: calc(100% - 104rpx);">
  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 in dbList" :key="item.WorkID" style="padding: 20rpx 40rpx;border-bottom: 1px solid #dadada;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="0" :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="sq.title" placeholder="请输入标题" :showAction="true" actionText="搜索"
  34. :animation="true" @custom="sqsearch" @clear="sqsearch">
  35. </u-search>
  36. </view>
  37. <view v-for="item in sqList" :key="item.WorkID" style="padding: 20rpx 40rpx;border-bottom: 1px solid #ceccca;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="sqList.length > 0">
  47. <u-loadmore :status="statusList[1]" />
  48. </div>
  49. <div v-if="sqList.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-item >
  55. <scroll-view scroll-y style="width: 100%;height: 100%;overflow: auto;box-sizing: border-box;" lower-threshold="0" :refresher-enabled="xlList1[2]" :refresher-triggered="xlList2[2]" @scrolltolower="lower(2)" @refresherrefresh="refresherrefresh(2)" @refresherrestore="refresherrestore(2)">
  56. <view style="padding: 20rpx;background-color: #fff;">
  57. <u-search v-model="yb.title" placeholder="请输入标题" :showAction="true" actionText="搜索"
  58. :animation="true" @custom="ybsearch" @clear="ybsearch">
  59. </u-search>
  60. </view>
  61. <view v-for="item in ybList" :key="item.WorkID" style="padding: 20rpx 40rpx;border-bottom: 1px solid #ceccca;background-color: #fff;" @click="getinfo(item)">
  62. <view >
  63. <u--text :lines="1" size="32rpx" :text="item.Title"></u--text>
  64. </view>
  65. <view style="display: flex;justify-content: space-between;margin-top: 20rpx;color:#909399;font-size: 28rpx;">
  66. <view>{{item.NodeName}}</view>
  67. <view>{{showtime(item.RDT)}}</view>
  68. </view>
  69. </view>
  70. <div style="padding: 10rpx 0;" v-if="ybList.length > 0">
  71. <u-loadmore :status="statusList[2]" />
  72. </div>
  73. <div v-if="ybList.length == 0">
  74. <u-empty mode="list" icon="/static/list.png" text="暂无内容" textSize="30rpx"></u-empty>
  75. </div>
  76. </scroll-view>
  77. </swiper-item>
  78. </swiper>
  79. </view>
  80. <view style="height: 100rpx;border-top: 2px solid #dadbde;box-sizing: border-box;">
  81. <u-grid :border="true" col="3">
  82. <u-grid-item @click="click(0)">
  83. <text class="grid-text" :class="current==0?'choose':''">待办</text>
  84. </u-grid-item>
  85. <u-grid-item @click="click(1)">
  86. <text class="grid-text" :class="current==1?'choose':''">我申请的</text>
  87. </u-grid-item>
  88. <u-grid-item @click="click(2)">
  89. <text class="grid-text" :class="current==2?'choose':''">已办</text>
  90. </u-grid-item>
  91. </u-grid>
  92. </view>
  93. <u-action-sheet :actions="morelist" :closeOnClickOverlay="true" :closeOnClickAction="true" cancelText="取消" title="申请" :show="show" @select="selectClick" @close="show = false"></u-action-sheet>
  94. </view>
  95. </template>
  96. <script>
  97. import {showtime} from "@/utils/wjw.js"
  98. export default {
  99. data() {
  100. return {
  101. //当前待办还是已办
  102. current:0,
  103. //待办相关
  104. db:{
  105. pageNum:1,
  106. pageSize:20,
  107. fkFlow:null,
  108. title:null,
  109. token:uni.getStorageSync('jtoken')
  110. },
  111. dbList:[],
  112. dbSearch:null,
  113. dbTotal:0,
  114. //已办相关
  115. yb:{
  116. pageNum:1,
  117. pageSize:20,
  118. fkFlow:null,
  119. title:null,
  120. token:uni.getStorageSync('jtoken')
  121. },
  122. ybList:[],
  123. ybSearch:null,
  124. ybTotal:0,
  125. //下拉刷新相关
  126. xlList1:[true,false,false],
  127. xlList2:[true,true,true],
  128. statusList:['loadmore','loadmore','loadmore'],
  129. //查看事件
  130. showtime:showtime,
  131. //收发文状态
  132. type:null,
  133. //我申请的相关
  134. sq:{
  135. pageNum:1,
  136. pageSize:20,
  137. fkFlow:null,
  138. title:null,
  139. token:uni.getStorageSync('jtoken')
  140. },
  141. sqList:[],
  142. sqSearch:null,
  143. sqTotal:0,
  144. //更多展示
  145. show:false,
  146. morelist:[
  147. ],
  148. }
  149. },
  150. onLoad(options){
  151. this.db.fkFlow = options.fkFlow
  152. this.yb.fkFlow = options.fkFlow
  153. this.sq.fkFlow = options.fkFlow
  154. this.type = options.type
  155. uni.setNavigationBarTitle({
  156. title:options.title
  157. })
  158. this.getDbList()
  159. if(options.fkFlow == '006'){
  160. this.morelist.push({name:'中层出差申请'})
  161. }else if(options.fkFlow == '007'){
  162. this.morelist.push({name:'外出授课申请'})
  163. }else if(options.fkFlow == '009'){
  164. this.morelist.push({name:'请(休)假申请'})
  165. }else if(options.fkFlow == '015'){
  166. this.morelist.push({name:'用车申请'})
  167. }
  168. },
  169. onNavigationBarButtonTap(e) {
  170. this.show = true
  171. },
  172. onShow(){
  173. getApp().globalData.peoIdList = []
  174. getApp().globalData.peoList = []
  175. getApp().globalData.peoDeptList = []
  176. uni.$off()
  177. uni.$on('query', (query) => {
  178. if(query.a=='back'){
  179. setTimeout(()=>{
  180. this.db.pageNum = 1
  181. this.dbList = []
  182. this.getDbList()
  183. this.xlList2[this.current] = true
  184. this.yb.pageNum = 1
  185. this.ybList = []
  186. this.getYbList()
  187. },2000)
  188. }
  189. })
  190. },
  191. methods: {
  192. //点击已办待办
  193. click(i){
  194. if(i==0){
  195. this.xlList1[i] = true
  196. this.xlList1[this.current] = false
  197. this.current = i
  198. if(this.dbList.length == 0){
  199. this.getDbList()
  200. }
  201. }else if(i==1){
  202. this.xlList1[i] = true
  203. this.xlList1[this.current] = false
  204. this.current = i
  205. if(this.sqList.length == 0){
  206. this.getSqList()
  207. }
  208. }else if(i==2){
  209. this.xlList1[i] = true
  210. this.xlList1[this.current] = false
  211. this.current = i
  212. if(this.ybList.length == 0){
  213. this.getYbList()
  214. }
  215. }
  216. },
  217. //swiper切换
  218. animationfinish(e){
  219. this.current = e.detail.current;
  220. },
  221. //查询待办列表
  222. getDbList(){
  223. uni.$u.http.get('/jflow/restful/DB_Todolist_FlowNo',{params:this.db}).then(res=>{
  224. uni.hideLoading()
  225. this.dbList = [...this.dbList,...res.list]
  226. if(res.total<=this.db.pageSize){
  227. this.statusList[0] = "nomore"
  228. }else{
  229. this.statusList[0] = "loadmore"
  230. }
  231. this.$forceUpdate()
  232. this.dbTotal = Math.ceil(res.total / this.db.pageSize)
  233. })
  234. },
  235. //查询已办列表
  236. getYbList(){
  237. uni.$u.http.get('/jflow/restful/MyJoinOneFlows',{params:this.yb}).then(res=>{
  238. uni.hideLoading()
  239. this.ybList = [...this.ybList,...res.list]
  240. if(res.total<=this.yb.pageSize){
  241. this.statusList[2] = "nomore"
  242. }else{
  243. this.statusList[2] = "loadmore"
  244. }
  245. this.$forceUpdate()
  246. this.ybTotal = Math.ceil(res.total / this.yb.pageSize)
  247. })
  248. },
  249. //查询我申请的列表
  250. getSqList(){
  251. uni.$u.http.get('/jflow/restful/DB_MyStartFlowInstanceByFlow',{
  252. params:{...this.sq},
  253. header: {
  254. 'content-Type': 'application/x-www-form-urlencoded'
  255. },
  256. }).then(res=>{
  257. // console.log(res)
  258. uni.hideLoading()
  259. this.sqList = [...this.sqList,...res.list]
  260. if(res.total<=this.sq.pageSize){
  261. this.statusList[1] = "nomore"
  262. }else{
  263. this.statusList[1] = "loadmore"
  264. }
  265. this.$forceUpdate()
  266. this.sqTotal = Math.ceil(res.total / this.sq.pageSize)
  267. })
  268. },
  269. //触底加载
  270. lower(e){
  271. uni.showLoading({
  272. title:"加载中..."
  273. })
  274. if(e==0){
  275. if(this.db.pageNum != this.dbTotal){
  276. this.db.pageNum++
  277. this.getDbList()
  278. }else{
  279. uni.hideLoading()
  280. this.statusList[e] = "nomore"
  281. this.$forceUpdate()
  282. }
  283. }else if(e==1){
  284. if(this.sq.pageNum != this.sqTotal){
  285. this.sq.pageNum++
  286. this.getSqList()
  287. }else{
  288. uni.hideLoading()
  289. this.statusList[e] = "nomore"
  290. this.$forceUpdate()
  291. }
  292. }else if(e==2){
  293. if(this.yb.pageNum != this.ybTotal){
  294. this.yb.pageNum++
  295. this.getYbList()
  296. }else{
  297. uni.hideLoading()
  298. this.statusList[e] = "nomore"
  299. this.$forceUpdate()
  300. }
  301. }
  302. },
  303. //下拉刷新
  304. refresherrefresh(e){
  305. if(e==0){
  306. this.xlList2[e] = true
  307. this.db.pageNum = 1
  308. this.dbList = []
  309. this.getDbList()
  310. setTimeout(()=>{
  311. this.xlList2[e] = false
  312. this.$forceUpdate()
  313. },2000)
  314. }else if(e==1){
  315. this.xlList2[e] = true
  316. this.sq.pageNum = 1
  317. this.sqList = []
  318. this.getSqList()
  319. setTimeout(()=>{
  320. this.xlList2[e] = false
  321. this.$forceUpdate()
  322. },2000)
  323. }else if(e==2){
  324. this.xlList2[e] = true
  325. this.yb.pageNum = 1
  326. this.ybList = []
  327. this.getYbList()
  328. setTimeout(()=>{
  329. this.xlList2[e] = false
  330. this.$forceUpdate()
  331. },2000)
  332. }
  333. },
  334. refresherrestore(e){
  335. },
  336. //待办搜索
  337. dbsearch(){
  338. this.db.pageNum = 1
  339. this.dbList = []
  340. this.getDbList()
  341. },
  342. //已办搜索
  343. ybsearch(){
  344. this.yb.pageNum = 1
  345. this.ybList = []
  346. this.getYbList()
  347. },
  348. //申请搜索
  349. sqsearch(){
  350. this.sq.pageNum = 1
  351. this.sqList = []
  352. this.getSqList()
  353. },
  354. //查看收文发文详情
  355. getinfo(item){
  356. uni.navigateTo({
  357. url:"/pages/workInfo/workInfo?workid="+item.WorkID+'&type='+this.current+'&flowNo='+this.db.fkFlow+"&title="+item.Title+"&nodeName="+item.NodeName+"&nodeId="+item.FK_Node+"&fkFlow="+this.db.fkFlow
  358. })
  359. },
  360. //点击申请
  361. selectClick(){
  362. if(this.db.fkFlow == '006'){
  363. uni.navigateTo({
  364. url:"/pages/shenqing/shenqing?title=中层出差申请&fkFlow="+this.db.fkFlow
  365. })
  366. }else if(this.db.fkFlow == '007'){
  367. uni.navigateTo({
  368. url:"/pages/shenqing/shenqing?title=外出授课申请&fkFlow="+this.db.fkFlow
  369. })
  370. }else if(this.db.fkFlow == '009'){
  371. uni.navigateTo({
  372. url:"/pages/shenqing/shenqing?title=请(休)假申请&fkFlow="+this.db.fkFlow
  373. })
  374. }else if(this.db.fkFlow == '015'){
  375. uni.navigateTo({
  376. url:"/pages/shenqing/shenqing?title=用车申请&fkFlow="+this.db.fkFlow
  377. })
  378. }
  379. }
  380. }
  381. }
  382. </script>
  383. <style lang="scss" scoped>
  384. .grid-text {
  385. height: 100rpx;
  386. line-height: 100rpx;
  387. font-size: 36rpx;
  388. color: #606266;
  389. /* #ifndef APP-PLUS */
  390. box-sizing: border-box;
  391. /* #endif */
  392. }
  393. .choose{
  394. color:#409EFF
  395. }
  396. </style>