123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328 |
- <template>
- <view>
- <view class="search">
- <view class="box" @click="go_search()">
- <view class="icon">
- <uni-icons type="search" size="16" color="#BBBBBB"></uni-icons>
- </view>
- <view class="text">搜索</view>
- </view>
- </view>
- <view class="content">
- <view class="title">
- <view class="icon">
- <image src="./icon/title_icon.png" mode=""></image>
- </view>
-
- <view class="text" v-if="mine_code == 'zaoquan'">国家能源集团枣泉煤矿</view>
- <view class="text" v-if="mine_code == 'ningdongyunying'">国家能源集团宁东运营部</view>
- <view class="text" v-if="mine_code == 'qingshuiying'">国家能源集团清水营煤矿</view>
- <view class="text" v-if="mine_code == 'wuyegongsi'">物业公司</view>
- <view class="text" v-if="mine_code == 'jinjiaqu'">国家能源集团金家渠煤矿</view>
- <view class="text" v-if="mine_code == 'yangchangwan'">国家能源集团羊场湾煤矿</view>
- </view>
- <view class="section" v-for="(item,index) in list" :key="index">
- <view class="box">
- <view class="item">
- <view class="left">
- <view class="icon" v-if="active == index" @click.stop="change_active(index,item.id)">
- <image src="./icon/close.png" mode=""></image>
- </view>
- <view class="icon" v-if="active != index" @click.stop="change_active(index,item.id)">
- <image src="./icon/open.png" mode=""></image>
- </view>
- <view class="text">{{item.title}} ({{item.user_num}})</view>
- </view>
- <view class="right" @click="go_record(item.page_id)">
- <uni-icons type="eye"></uni-icons>
- </view>
- </view>
- <view class="list" v-if="active == index">
- <view class="item" v-for="(item_2,index_2) in user_list" :key="index_2" @click="go_user_info(item_2.staff_num)">
- <view class="left">
- <view class="icon">{{item_2.name.charAt(0)}}</view>
- <view class="text">{{item_2.name}} {{item_2.position_name}} {{item_2.mobile}}</view>
- </view>
- <view class="right" @click.stop="phone(item_2.mobile)">
- <uni-icons type="phone"></uni-icons>
- </view>
- </view>
- </view>
- </view>
- </view>
- </view>
- </view>
- </template>
- <script>
- export default {
- data() {
- return {
- // 当前煤矿编码
- mine_code: "",
- // 部门列表
- list: [
- ],
- // 当前展开部门
- active: 99999999,
- // 人员列表
- user_list: []
- };
- },
- onLoad() {
- // 初始化当前煤矿编码
- this.mine_code = uni.getStorageSync('mine_code')
-
- this.get_section_getGroupList()
- },
- methods: {
- // 搜索
- go_search() {
- uni.navigateTo({
- url: "./search/search",
- animationType: "fade-in",
- animationDuration: 200
- })
- },
- // 获取部门列表
- get_section_getGroupList() {
- uni.showLoading({
- mask: true
- })
- this.$api.section_getGroupList({
- }).then((res) => {
- uni.hideLoading()
- console.log(res)
- console.log(this.mine_code)
-
-
- // if(this.mine_code == 'zaoquan'){
- // this.list = res.data.data.group.leader.data.concat(res.data.data.group.office.data.concat(res
- // .data.data.group.basic.data.concat()))
- // }
-
- if(this.mine_code == 'ningdongyunying'){
- this.list = res.data.data.group.basic.data.concat(res.data.data.group.office.data.concat(res
- .data.data.group.zongbu.data.concat(res.data.data.group.weiwaidanwei.data.concat())))
- }else{
- this.list = res.data.data.group.leader.data.concat(res.data.data.group.office.data.concat(res
- .data.data.group.basic.data.concat()))
- }
-
- // console.log(this.list)
- })
- },
- change_active(index, id) {
- this.user_list = []
- if (this.active == index) {
- this.active = 99999999
- } else {
- this.active = index
- this.get_user_list(id)
- }
- },
- // 获取当前部门人员
- get_user_list(id) {
- uni.showLoading({
- mask: true
- })
- this.$api.user_list({
- id: id
- }).then((res) => {
- uni.hideLoading()
- console.log(res)
- this.user_list = res.data.data
- })
- },
- go_record(page_id) {
- console.log(page_id)
- if (page_id == null) {
- uni.showToast({
- icon: "none",
- title: "该部门还未关联二维码"
- })
- } else {
- uni.navigateTo({
- url: "../../index/record/record?pageId=" + page_id + "&mine_code=" + uni.getStorageSync(
- 'mine_code'),
- })
- }
- },
-
- phone(mobile){
- if(mobile != null){
- uni.makePhoneCall({
- phoneNumber: mobile
- });
- }
- },
-
- go_user_info(staff_num){
- uni.navigateTo({
- url:"./personal_information/personal_information?staff_num=" + staff_num
- })
- }
- }
- }
- </script>
- <style lang="scss">
- page {
- background-color: #F3F8F7;
- }
- .search {
- margin-bottom: 20rpx;
- background-color: #FFFFFF;
- box-sizing: border-box;
- padding: 25rpx 30rpx;
- .box {
- height: 80rpx;
- background-color: #F4F4F4;
- border-radius: 50rpx;
- display: flex;
- align-items: center;
- box-sizing: border-box;
- padding: 0 25rpx;
- .icon {
- margin-right: 10rpx;
- }
- .text {
- font-size: 30rpx;
- color: #BBBBBB;
- }
- }
- }
- .content {
- background-color: #FFFFFF;
- .title {
- height: 110rpx;
- display: flex;
- align-items: center;
- box-sizing: border-box;
- padding: 0 36rpx;
- border-bottom: 1rpx solid #F3F8F7;
- .icon {
- image {
- width: 48rpx;
- height: 36rpx;
- }
- }
- .text {
- margin-left: 20rpx;
- font-size: 36rpx;
- font-weight: 700;
- }
- }
- .section {
- box-sizing: border-box;
- padding: 0 20rpx;
- .box {
- .item {
- height: 110rpx;
- display: flex;
- align-items: center;
- justify-content: space-between;
- margin-left: 20rpx;
- border-bottom: 1rpx solid #F3F8F7;
- .left {
- display: flex;
- align-items: center;
- .icon {
- line-height: 110rpx;
- width: 90rpx;
- text-align: center;
- image {
- width: 24rpx;
- height: 24rpx;
- }
- }
- .text {
- font-size: 32rpx;
- }
- }
- .right {
- line-height: 110rpx;
- width: 90rpx;
- text-align: center;
- }
- }
- .list {
- .item {
- height: 110rpx;
- display: flex;
- justify-content: space-between;
- align-items: center;
- margin-left: 108rpx;
- border-bottom: 1rpx solid #F3F8F7;
-
- .left{
- width: 500rpx;
- .icon {
- width: 35rpx;
- text-align: center;
- line-height: 35rpx;
- border-radius: 50%;
- border: 1rpx solid #00A1E9;
-
- font-size: 24rpx;
- color: #00A1E9;
- }
-
- .text {
- width: 450rpx;
- margin-left: 18rpx;
- font-size: 30rpx;
-
- }
- }
- .right{
- line-height: 110rpx;
- width: 90rpx;
- text-align: center;
- }
-
- }
- }
- }
- }
- }
- </style>
|