origanization.vue 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184
  1. <template>
  2. <view>
  3. <view class="search">
  4. <view class="box" @click="go_search()">
  5. <view class="icon">
  6. <uni-icons type="search" size="16" 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" v-if="mine_code == 'zaoquan'">国家能源集团枣泉煤矿</view>
  17. <view class="text" v-if="mine_code == 'ningmeijituan'">国家能源集团宁夏煤业公司</view>
  18. <view class="text" v-if="mine_code == 'ningdongyunying'">国家能源集团宁东运营部</view>
  19. <view class="text" v-if="mine_code == 'qingshuiying'">国家能源集团清水营煤矿</view>
  20. <view class="text" v-if="mine_code == 'wuyegongsi'">物业公司</view>
  21. <view class="text" v-if="mine_code == 'jinjiaqu' || mine_code == 'jinjiaqu_neiwang'">国家能源集团金家渠煤矿</view>
  22. <view class="text" v-if="mine_code == 'yangchangwan'">国家能源集团羊场湾煤矿</view>
  23. <view class="text" v-if="mine_code == 'shicaocun'">国家能源集团石槽村煤矿</view>
  24. <view class="text" v-if="mine_code == 'jinfeng' || mine_code == 'jinfeng_neiwang'">国家能源集团金凤煤矿</view>
  25. </view>
  26. <origanizationSection :data="list" :mine_code="mine_code"></origanizationSection>
  27. </view>
  28. </view>
  29. </template>
  30. <script>
  31. import data from "./data.json"
  32. export default {
  33. data() {
  34. return {
  35. // 当前煤矿编码
  36. mine_code: "",
  37. // 部门列表
  38. list: [
  39. ],
  40. // 当前展开部门
  41. active: 99999999,
  42. // 人员列表
  43. user_list: []
  44. };
  45. },
  46. onLoad() {
  47. // 初始化当前煤矿编码
  48. this.mine_code = uni.getStorageSync('mine_code')
  49. this.get_section_getGroupList()
  50. },
  51. methods: {
  52. // 搜索
  53. go_search() {
  54. uni.navigateTo({
  55. url: "./search/search",
  56. animationType: "fade-in",
  57. animationDuration: 200
  58. })
  59. },
  60. // 获取部门列表
  61. get_section_getGroupList() {
  62. uni.showLoading({
  63. mask: true
  64. })
  65. this.$api.section_get_org_structure({
  66. }).then((res) => {
  67. uni.hideLoading()
  68. console.log(res.data.content.data[0].children)
  69. if(this.mine_code == 'ningmeijituan'){
  70. this.list = res.data.content.data[0].children
  71. }else{
  72. this.list = res.data.content.data
  73. }
  74. })
  75. },
  76. change_active(index, id) {
  77. this.user_list = []
  78. if (this.active == index) {
  79. this.active = 99999999
  80. } else {
  81. this.active = index
  82. // this.get_user_list(id)
  83. console.log(id)
  84. }
  85. },
  86. go_record(page_id) {
  87. console.log(page_id)
  88. if (page_id == null) {
  89. uni.showToast({
  90. icon: "none",
  91. title: "该部门还未关联二维码"
  92. })
  93. } else {
  94. console.log(page_id)
  95. uni.navigateTo({
  96. url: "../../../index/record/record?pageId=" + page_id + "&mine_code=" + uni.getStorageSync(
  97. 'mine_code'),
  98. })
  99. }
  100. },
  101. }
  102. }
  103. </script>
  104. <style lang="scss">
  105. page {
  106. background-color: #F3F8F7;
  107. }
  108. .search {
  109. margin-bottom: 20rpx;
  110. background-color: #FFFFFF;
  111. box-sizing: border-box;
  112. padding: 25rpx 30rpx;
  113. .box {
  114. height: 80rpx;
  115. background-color: #F4F4F4;
  116. border-radius: 50rpx;
  117. display: flex;
  118. align-items: center;
  119. box-sizing: border-box;
  120. padding: 0 25rpx;
  121. .icon {
  122. margin-right: 10rpx;
  123. }
  124. .text {
  125. font-size: 30rpx;
  126. color: #BBBBBB;
  127. }
  128. }
  129. }
  130. .content {
  131. background-color: #FFFFFF;
  132. .title {
  133. height: 110rpx;
  134. display: flex;
  135. align-items: center;
  136. box-sizing: border-box;
  137. padding: 0 36rpx;
  138. border-bottom: 1rpx solid #F3F8F7;
  139. .icon {
  140. image {
  141. width: 48rpx;
  142. height: 36rpx;
  143. }
  144. }
  145. .text {
  146. margin-left: 20rpx;
  147. font-size: 36rpx;
  148. font-weight: 700;
  149. }
  150. }
  151. }
  152. </style>