origanization.vue 6.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328
  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 == 'ningdongyunying'">国家能源集团宁东运营部</view>
  18. <view class="text" v-if="mine_code == 'qingshuiying'">国家能源集团清水营煤矿</view>
  19. <view class="text" v-if="mine_code == 'wuyegongsi'">物业公司</view>
  20. <view class="text" v-if="mine_code == 'jinjiaqu'">国家能源集团金家渠煤矿</view>
  21. <view class="text" v-if="mine_code == 'yangchangwan'">国家能源集团羊场湾煤矿</view>
  22. </view>
  23. <view class="section" v-for="(item,index) in list" :key="index">
  24. <view class="box">
  25. <view class="item">
  26. <view class="left">
  27. <view class="icon" v-if="active == index" @click.stop="change_active(index,item.id)">
  28. <image src="./icon/close.png" mode=""></image>
  29. </view>
  30. <view class="icon" v-if="active != index" @click.stop="change_active(index,item.id)">
  31. <image src="./icon/open.png" mode=""></image>
  32. </view>
  33. <view class="text">{{item.title}} ({{item.user_num}})</view>
  34. </view>
  35. <view class="right" @click="go_record(item.page_id)">
  36. <uni-icons type="eye"></uni-icons>
  37. </view>
  38. </view>
  39. <view class="list" v-if="active == index">
  40. <view class="item" v-for="(item_2,index_2) in user_list" :key="index_2" @click="go_user_info(item_2.staff_num)">
  41. <view class="left">
  42. <view class="icon">{{item_2.name.charAt(0)}}</view>
  43. <view class="text">{{item_2.name}} {{item_2.position_name}} {{item_2.mobile}}</view>
  44. </view>
  45. <view class="right" @click.stop="phone(item_2.mobile)">
  46. <uni-icons type="phone"></uni-icons>
  47. </view>
  48. </view>
  49. </view>
  50. </view>
  51. </view>
  52. </view>
  53. </view>
  54. </template>
  55. <script>
  56. export default {
  57. data() {
  58. return {
  59. // 当前煤矿编码
  60. mine_code: "",
  61. // 部门列表
  62. list: [
  63. ],
  64. // 当前展开部门
  65. active: 99999999,
  66. // 人员列表
  67. user_list: []
  68. };
  69. },
  70. onLoad() {
  71. // 初始化当前煤矿编码
  72. this.mine_code = uni.getStorageSync('mine_code')
  73. this.get_section_getGroupList()
  74. },
  75. methods: {
  76. // 搜索
  77. go_search() {
  78. uni.navigateTo({
  79. url: "./search/search",
  80. animationType: "fade-in",
  81. animationDuration: 200
  82. })
  83. },
  84. // 获取部门列表
  85. get_section_getGroupList() {
  86. uni.showLoading({
  87. mask: true
  88. })
  89. this.$api.section_getGroupList({
  90. }).then((res) => {
  91. uni.hideLoading()
  92. console.log(res)
  93. console.log(this.mine_code)
  94. // if(this.mine_code == 'zaoquan'){
  95. // this.list = res.data.data.group.leader.data.concat(res.data.data.group.office.data.concat(res
  96. // .data.data.group.basic.data.concat()))
  97. // }
  98. if(this.mine_code == 'ningdongyunying'){
  99. this.list = res.data.data.group.basic.data.concat(res.data.data.group.office.data.concat(res
  100. .data.data.group.zongbu.data.concat(res.data.data.group.weiwaidanwei.data.concat())))
  101. }else{
  102. this.list = res.data.data.group.leader.data.concat(res.data.data.group.office.data.concat(res
  103. .data.data.group.basic.data.concat()))
  104. }
  105. // console.log(this.list)
  106. })
  107. },
  108. change_active(index, id) {
  109. this.user_list = []
  110. if (this.active == index) {
  111. this.active = 99999999
  112. } else {
  113. this.active = index
  114. this.get_user_list(id)
  115. }
  116. },
  117. // 获取当前部门人员
  118. get_user_list(id) {
  119. uni.showLoading({
  120. mask: true
  121. })
  122. this.$api.user_list({
  123. id: id
  124. }).then((res) => {
  125. uni.hideLoading()
  126. console.log(res)
  127. this.user_list = res.data.data
  128. })
  129. },
  130. go_record(page_id) {
  131. console.log(page_id)
  132. if (page_id == null) {
  133. uni.showToast({
  134. icon: "none",
  135. title: "该部门还未关联二维码"
  136. })
  137. } else {
  138. uni.navigateTo({
  139. url: "../../index/record/record?pageId=" + page_id + "&mine_code=" + uni.getStorageSync(
  140. 'mine_code'),
  141. })
  142. }
  143. },
  144. phone(mobile){
  145. if(mobile != null){
  146. uni.makePhoneCall({
  147. phoneNumber: mobile
  148. });
  149. }
  150. },
  151. go_user_info(staff_num){
  152. uni.navigateTo({
  153. url:"./personal_information/personal_information?staff_num=" + staff_num
  154. })
  155. }
  156. }
  157. }
  158. </script>
  159. <style lang="scss">
  160. page {
  161. background-color: #F3F8F7;
  162. }
  163. .search {
  164. margin-bottom: 20rpx;
  165. background-color: #FFFFFF;
  166. box-sizing: border-box;
  167. padding: 25rpx 30rpx;
  168. .box {
  169. height: 80rpx;
  170. background-color: #F4F4F4;
  171. border-radius: 50rpx;
  172. display: flex;
  173. align-items: center;
  174. box-sizing: border-box;
  175. padding: 0 25rpx;
  176. .icon {
  177. margin-right: 10rpx;
  178. }
  179. .text {
  180. font-size: 30rpx;
  181. color: #BBBBBB;
  182. }
  183. }
  184. }
  185. .content {
  186. background-color: #FFFFFF;
  187. .title {
  188. height: 110rpx;
  189. display: flex;
  190. align-items: center;
  191. box-sizing: border-box;
  192. padding: 0 36rpx;
  193. border-bottom: 1rpx solid #F3F8F7;
  194. .icon {
  195. image {
  196. width: 48rpx;
  197. height: 36rpx;
  198. }
  199. }
  200. .text {
  201. margin-left: 20rpx;
  202. font-size: 36rpx;
  203. font-weight: 700;
  204. }
  205. }
  206. .section {
  207. box-sizing: border-box;
  208. padding: 0 20rpx;
  209. .box {
  210. .item {
  211. height: 110rpx;
  212. display: flex;
  213. align-items: center;
  214. justify-content: space-between;
  215. margin-left: 20rpx;
  216. border-bottom: 1rpx solid #F3F8F7;
  217. .left {
  218. display: flex;
  219. align-items: center;
  220. .icon {
  221. line-height: 110rpx;
  222. width: 90rpx;
  223. text-align: center;
  224. image {
  225. width: 24rpx;
  226. height: 24rpx;
  227. }
  228. }
  229. .text {
  230. font-size: 32rpx;
  231. }
  232. }
  233. .right {
  234. line-height: 110rpx;
  235. width: 90rpx;
  236. text-align: center;
  237. }
  238. }
  239. .list {
  240. .item {
  241. height: 110rpx;
  242. display: flex;
  243. justify-content: space-between;
  244. align-items: center;
  245. margin-left: 108rpx;
  246. border-bottom: 1rpx solid #F3F8F7;
  247. .left{
  248. width: 500rpx;
  249. .icon {
  250. width: 35rpx;
  251. text-align: center;
  252. line-height: 35rpx;
  253. border-radius: 50%;
  254. border: 1rpx solid #00A1E9;
  255. font-size: 24rpx;
  256. color: #00A1E9;
  257. }
  258. .text {
  259. width: 450rpx;
  260. margin-left: 18rpx;
  261. font-size: 30rpx;
  262. }
  263. }
  264. .right{
  265. line-height: 110rpx;
  266. width: 90rpx;
  267. text-align: center;
  268. }
  269. }
  270. }
  271. }
  272. }
  273. }
  274. </style>