origanization.vue 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241
  1. <template>
  2. <view>
  3. <view class="search">
  4. <view class="box">
  5. <view class="icon">
  6. <uni-icons type="search" size="14" color="#BBBBBB"></uni-icons>
  7. </view>
  8. <view class="text">搜索</view>
  9. </view>
  10. </view>
  11. <view class="content">
  12. <view class="title">
  13. <view class="icon">
  14. <image src="./icon/title_icon.png" mode=""></image>
  15. </view>
  16. <view class="text">国家能源集团枣泉煤矿</view>
  17. </view>
  18. <view class="section" v-for="(item,index) in list" :key="index">
  19. <view class="box">
  20. <view class="item">
  21. <view class="left">
  22. <view class="icon" v-if="active == index" @click.stop="change_active(index,item.id)">
  23. <image src="./icon/close.png" mode=""></image>
  24. </view>
  25. <view class="icon" v-if="active != index" @click.stop="change_active(index,item.id)">
  26. <image src="./icon/open.png" mode=""></image>
  27. </view>
  28. <view class="text">{{item.title}} ({{item.user_num}})</view>
  29. </view>
  30. <view class="right">
  31. <uni-icons type="eye"></uni-icons>
  32. </view>
  33. </view>
  34. <view class="list" v-if="active == index">
  35. <view class="item" v-for="(item_2,index_2) in user_list" :key="index_2">
  36. <view class="icon">{{item_2.name.charAt(0)}}</view>
  37. <view class="text">{{item_2.name}} {{item_2.position_name}}</view>
  38. </view>
  39. </view>
  40. </view>
  41. </view>
  42. </view>
  43. </view>
  44. </template>
  45. <script>
  46. export default {
  47. data() {
  48. return {
  49. // 部门列表
  50. list: [
  51. ],
  52. // 当前展开部门
  53. active: 99999999,
  54. // 人员列表
  55. user_list:[]
  56. };
  57. },
  58. methods: {
  59. // 获取部门列表
  60. get_section_getGroupList() {
  61. uni.showLoading({
  62. mask:true
  63. })
  64. this.$api.section_getGroupList({
  65. }).then((res) => {
  66. uni.hideLoading()
  67. console.log(res)
  68. this.list = res.data.data.group.leader.data.concat(res.data.data.group.office.data.concat(res
  69. .data.data.group.basic.data.concat()))
  70. // console.log(this.list)
  71. })
  72. },
  73. change_active(index,id) {
  74. this.user_list = []
  75. if (this.active == index) {
  76. this.active = 99999999
  77. } else {
  78. this.active = index
  79. this.get_user_list(id)
  80. }
  81. },
  82. // 获取当前部门人员
  83. get_user_list(id){
  84. uni.showLoading({
  85. mask:true
  86. })
  87. this.$api.user_list({
  88. id:id
  89. }).then((res)=>{
  90. uni.hideLoading()
  91. console.log(res)
  92. this.user_list = res.data.data
  93. })
  94. }
  95. },
  96. onLoad() {
  97. this.get_section_getGroupList()
  98. }
  99. }
  100. </script>
  101. <style lang="scss">
  102. page {
  103. background-color: #F3F8F7;
  104. }
  105. .search {
  106. margin-bottom: 20rpx;
  107. background-color: #FFFFFF;
  108. box-sizing: border-box;
  109. padding: 25rpx 30rpx;
  110. .box {
  111. height: 60rpx;
  112. background-color: #F4F4F4;
  113. border-radius: 50rpx;
  114. display: flex;
  115. align-items: center;
  116. box-sizing: border-box;
  117. padding: 0 25rpx;
  118. .icon {
  119. margin-right: 10rpx;
  120. }
  121. .text {
  122. font-size: 24rpx;
  123. color: #BBBBBB;
  124. }
  125. }
  126. }
  127. .content {
  128. background-color: #FFFFFF;
  129. .title {
  130. height: 95rpx;
  131. display: flex;
  132. align-items: center;
  133. box-sizing: border-box;
  134. padding: 0 36rpx;
  135. border-bottom: 1rpx solid #F3F8F7;
  136. .icon {
  137. image {
  138. width: 48rpx;
  139. height: 36rpx;
  140. }
  141. }
  142. .text {
  143. margin-left: 20rpx;
  144. font-size: 36rpx;
  145. font-weight: 700;
  146. }
  147. }
  148. .section{
  149. box-sizing: border-box;
  150. padding: 0 20rpx;
  151. .box{
  152. .item{
  153. height: 95rpx;
  154. display: flex;
  155. align-items: center;
  156. justify-content: space-between;
  157. margin-left: 20rpx;
  158. border-bottom: 1rpx solid #F3F8F7;
  159. .left{
  160. display: flex;
  161. align-items: center;
  162. .icon{
  163. line-height: 95rpx;
  164. width: 90rpx;
  165. text-align: center;
  166. image{
  167. width: 24rpx;
  168. height: 24rpx;
  169. }
  170. }
  171. .text{
  172. font-size: 28rpx;
  173. }
  174. }
  175. .right{
  176. line-height: 95rpx;
  177. width: 90rpx;
  178. text-align: center;
  179. }
  180. }
  181. .list{
  182. .item{
  183. height: 95rpx;
  184. display: flex;
  185. justify-content: left;
  186. align-items: center;
  187. margin-left: 108rpx;
  188. border-bottom: 1rpx solid #F3F8F7;
  189. .icon{
  190. width: 35rpx;
  191. text-align: center;
  192. line-height: 35rpx;
  193. border-radius: 50%;
  194. border: 1rpx solid #00A1E9;
  195. font-size: 24rpx;
  196. color: #00A1E9;
  197. }
  198. .text{
  199. margin-left: 18rpx;
  200. font-size: 28rpx;
  201. }
  202. }
  203. }
  204. }
  205. }
  206. }
  207. </style>