index.vue 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174
  1. <template>
  2. <view class="uni-app">
  3. <view class="status-bar" />
  4. <view class="main-container">
  5. <wk-nav-bar title="审批" />
  6. <view class="container">
  7. <view class="top">
  8. <view class="box" @click="handleTo('my')">
  9. <image :src="$static('images/examine/owner_sponsor.png')" class="box-pic" />
  10. <text class="text">
  11. 我发起的
  12. </text>
  13. </view>
  14. <view class="line" />
  15. <view class="box" @click="handleTo('examine')">
  16. <image :src="$static('images/examine/owner_examine.png')" class="box-pic" />
  17. <text class="text">
  18. 我审批的
  19. </text>
  20. </view>
  21. </view>
  22. <view class="section-title">
  23. 新建审批
  24. </view>
  25. <view class="container-body">
  26. <view
  27. v-for="(item, index) in categoryList"
  28. :key="index"
  29. class="box body-box"
  30. @click="createExamine(item)">
  31. <view :style="{backgroundColor: item.examineIcon ? item.examineIcon.split(',')[1] : '#9376ff'}" class="icon">
  32. <text :class="item.examineIcon ? item.examineIcon.split(',')[0] : 'wk wk-approve'" />
  33. </view>
  34. <text class="text">
  35. {{ item.examineName }}
  36. </text>
  37. </view>
  38. </view>
  39. </view>
  40. </view>
  41. </view>
  42. </template>
  43. <script>
  44. import { QueryPartList } from 'API/examine'
  45. export default {
  46. name: 'OaExamineIndex',
  47. data() {
  48. return {
  49. categoryList: []
  50. }
  51. },
  52. mounted() {
  53. this.getCategoryList()
  54. },
  55. methods: {
  56. getCategoryList() {
  57. QueryPartList({
  58. label: 0
  59. }).then(res => {
  60. this.categoryList = res.list
  61. }).catch(() => {})
  62. },
  63. handleTo(type) {
  64. this.$Router.navigateTo({
  65. url: '/pages_examine/list',
  66. query: {
  67. by: type
  68. }
  69. })
  70. },
  71. // categoryId: item.examineId
  72. createExamine(item) {
  73. this.$Router.navigateTo({
  74. url: '/pages_examine/add',
  75. query: {
  76. examineId: item.examineId,
  77. title: item.examineName
  78. }
  79. })
  80. }
  81. }
  82. }
  83. </script>
  84. <style scoped lang="scss">
  85. .box {
  86. width: 23%;
  87. flex-direction: column;
  88. margin: 24rpx 1%;
  89. @include center;
  90. .box-pic, .icon {
  91. width: 80rpx;
  92. height: 80rpx;
  93. color: white;
  94. margin-bottom: 15rpx;
  95. @include center;
  96. .wk {
  97. font-size: 42rpx;
  98. }
  99. }
  100. .text {
  101. width: 100%;
  102. font-size: 26rpx;
  103. color: $gray;
  104. text-align: center;
  105. @include ellipsis;
  106. }
  107. }
  108. .main-container {
  109. background-color: #F5F5F5;
  110. display: flex;
  111. flex-direction: column;
  112. overflow: hidden;
  113. .container {
  114. flex: 1;
  115. overflow-y: scroll;
  116. .section-title {
  117. font-weight: bold;
  118. font-size: $wk-font-medium;
  119. background-color: white;
  120. padding: 26rpx 20rpx 10rpx 20rpx;
  121. &.border {
  122. border-bottom: 1rpx solid $border-color;
  123. }
  124. }
  125. .top {
  126. background-color: white;
  127. margin-bottom: 20rpx;
  128. padding: 15rpx 0;
  129. @include center;
  130. .box {
  131. margin: 24rpx 11.5%;
  132. .box-pic {
  133. width: 66rpx;
  134. height: 66rpx;
  135. }
  136. }
  137. .line {
  138. width: 1rpx;
  139. height: 100rpx;
  140. background-color: $border-color;
  141. }
  142. }
  143. .container-body {
  144. background-color: #fff;
  145. display: flex;
  146. flex-wrap: wrap;
  147. color: $dark;
  148. padding-bottom: 15rpx;
  149. .body-box {
  150. .icon {
  151. border-radius: 50%;
  152. }
  153. }
  154. }
  155. }
  156. }
  157. </style>