risk.vue 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225
  1. <template>
  2. <view class="page-index">
  3. <view class="status_bar"></view>
  4. <div class="title">
  5. <text class="tab" :class="type==='user'?'active':''" @click="changeTab('user')">我的</text>
  6. <text class="tab" :class="type==='group'?'active':''" @click="changeTab('group')">部门</text>
  7. </div>
  8. <div class="statistics">
  9. <div class="head">任务统计</div>
  10. <div class="container">
  11. <div class="item">
  12. <image class="icon" src="/static/index/wait.png" alt=""></image>
  13. <text>待评审{{statistics.review}}个</text>
  14. </div>
  15. <div class="item">
  16. <image class="icon" src="/static/index/expire.png" alt=""></image>
  17. <text>待整改{{statistics.rectify}}个</text>
  18. </div>
  19. <div class="item">
  20. <image class="icon" src="/static/index/complete.png" alt=""></image>
  21. <text>待验收{{statistics.accept}}个</text>
  22. </div>
  23. <div class="item">
  24. <image class="icon" src="/static/index/complete.png" alt=""></image>
  25. <text>已完成{{statistics.complete}}个</text>
  26. </div>
  27. <div class="item">
  28. <image class="icon" src="/static/index/revocation.png" alt=""></image>
  29. <text>已撤销{{statistics.revocation}}个</text>
  30. </div>
  31. </div>
  32. </div>
  33. <div class="task-list">
  34. <div class="head">待办风险</div>
  35. <div class="item" v-for="(item,index) in items" :key="index" @click="linkTo(item)">
  36. <div class="task-title">{{item.hdangerTitle}}</div>
  37. <view class="footer">
  38. <view class="lf">
  39. <div class="time">{{item.dangerDeadline}}</div>
  40. <div class="user">{{item.curAccountName}}</div>
  41. </view>
  42. <div class="status" v-if="item.status===4">完成</div>
  43. <div class="status" v-else>{{item.curActivityTitle}}</div>
  44. </view>
  45. </div>
  46. </div>
  47. </view>
  48. </template>
  49. <script>
  50. import { getDangerByList, getDangerByPage } from '@/api/dangerApi'
  51. export default {
  52. data() {
  53. return {
  54. statusBarHeight:0,
  55. type:"user",
  56. statistics: {
  57. review:10,
  58. rectify:2,
  59. complete:10,
  60. accept:88,
  61. revocation:2
  62. },
  63. items:[]
  64. }
  65. },
  66. onShow(){
  67. this.init()
  68. },
  69. methods: {
  70. init(){
  71. getDangerByList().then((res)=>{
  72. this.items=res.data
  73. this.statistics.review=res.data.filter(item=>item.status==1).length
  74. this.statistics.rectify=res.data.filter(item=>item.status==2).length
  75. this.statistics.accept=res.data.filter(item=>item.status==3).length
  76. this.statistics.complete=res.data.filter(item=>item.status==4).length
  77. this.statistics.revocation=res.data.filter(item=>item.status==-1).length
  78. })
  79. },
  80. changeTab(type){
  81. this.type=type
  82. if(type==='group'){
  83. }else{
  84. }
  85. },
  86. linkTo(item){
  87. let url="";
  88. switch(item.curActivityCode){
  89. case "review" ://评审
  90. url='/pages/risk/review/review'
  91. break;
  92. case "submit" ://提交
  93. url='/pages/risk/repeal/repeal'
  94. break;
  95. case "accept" ://验收
  96. url='/pages/risk/check/check'
  97. break;
  98. case "rectify" ://整改
  99. url='/pages/risk/rectify/rectify'
  100. break;
  101. }
  102. uni.setStorageSync('danger-info',item)
  103. uni.navigateTo({
  104. url
  105. })
  106. }
  107. }
  108. }
  109. </script>
  110. <style lang="scss" scoped>
  111. .page-index{
  112. background: linear-gradient(180deg, #4D73FF 0%, rgba(77, 115, 255, 0) 100%);
  113. padding: 0 30upx;
  114. .title{
  115. .tab{
  116. font-size: 34upx;
  117. line-height: 50upx;
  118. margin-right: 32upx;
  119. color: rgba(255, 255, 255, 0.6);
  120. &.active{
  121. color: #fff;
  122. }
  123. }
  124. }
  125. .statistics{
  126. &{
  127. border-radius: 24upx;
  128. background-color: #fff;
  129. padding:36upx 0 0 24upx;
  130. margin-top: 48upx;
  131. }
  132. .head{
  133. font-weight: 900;
  134. font-size: 34upx;
  135. line-height: 50upx;
  136. color: #151515;
  137. }
  138. .container{
  139. display: flex;
  140. align-items: center;
  141. flex-wrap: wrap;
  142. .item{
  143. width: 33.33%;
  144. display: flex;
  145. justify-content: center;
  146. align-items: center;
  147. flex-direction: column;
  148. margin-bottom: 40upx;
  149. .icon{
  150. display: block;
  151. width:88upx;
  152. height: 88upx;
  153. }
  154. text{
  155. font-size: 28upx;
  156. line-height: 42upx;
  157. color: #151515;
  158. padding-top: 18upx;
  159. }
  160. }
  161. }
  162. }
  163. .task-list{
  164. border-radius: 24upx;
  165. background-color: #fff;
  166. margin-top: 24upx;
  167. padding: 36upx 24upx;
  168. .head{
  169. font-weight: 900;
  170. font-size: 34upx;
  171. line-height: 50upx;
  172. color: #151515;
  173. }
  174. .item{
  175. padding: 30upx 40upx 38upx 40upx;
  176. margin-top: 20rpx;
  177. border: 1px solid #F8F9FD;
  178. .task-title{
  179. color: #212121;
  180. font-size: 32upx;
  181. padding-bottom: 24upx;
  182. }
  183. .footer{
  184. display: flex;
  185. justify-content: space-between;
  186. align-items: center;
  187. .lf{
  188. display: flex;
  189. .time{
  190. background-image: url(/static/index/time.png);
  191. background-repeat: no-repeat;
  192. background-position: left center;
  193. background-size: 24upx 24upx;
  194. padding-left: 36upx;
  195. color: #999;
  196. font-size: 24upx;
  197. }
  198. .user{
  199. background-image: url(/static/index/user.png);
  200. background-repeat: no-repeat;
  201. background-position: left center;
  202. background-size: 24upx 24upx;
  203. padding-left: 36upx;
  204. color: #999;
  205. font-size: 24upx;
  206. margin-left: 10rpx;
  207. }
  208. }
  209. .status{
  210. color: #4D73FF;
  211. }
  212. }
  213. }
  214. }
  215. }
  216. .container {
  217. padding: 20px;
  218. font-size: 14px;
  219. line-height: 24px;
  220. }
  221. </style>