123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184 |
- <template>
- <div class="page_staffManagement">
- <van-sticky>
- <div class="staffManagementTitle">
- <i class="iconfont icon-zuojiantou jiantou" @click="$router.go(-1)"></i>
- <span class="titleName">员工管理</span>
- </div>
- </van-sticky>
- <div class="staffBox">
- <div
- class="staffOne"
- v-for="(item, index) in admin_user"
- :key="index"
- v-if="admin_user.length > 0"
- @click="goEditStaff(item.user_id,item.is_sub_admin)"
-
- >
- <img v-if="item.avatar.length > 0" :src="item.avatar" alt />
- <img
- v-if="item.avatar.length == 0"
- src="../../../../../assets/images/default_avatar.jpg"
- alt
- />
- <p >
- <span>{{ item.user_name }}</span>
- <i
- v-if="org_creator != item.user_id"
- class="iconfont icon-bianji bianji"
- ></i>
- </p>
- </div>
- </div>
-
- <van-overlay :show="loading" type="spinner" size="30px">
- <div class="wrapper">
- <van-loading size="24px" vertical>正在加载中...</van-loading>
- </div>
- </van-overlay>
- </div>
- </template>
- <script>
- // import "../libs/rem.js";
- import { setRem } from "@/libs/functionRem";
- import { GetAllStaff } from "@/api/admin_user";
-
- export default {
- data() {
- return {
- loading:false,
- active: 0,
- admin_user: [],
- org_creator:0,
- };
- },
- methods: {
- GetAllStaff: function() {
- this.loading = true
- GetAllStaff().then(response => {
- if (response.data.state === 1) {
- this.admin_user = response.data.data.admins;
- for (let i = 0; i < this.admin_user.length; i++) {
- if (this.admin_user[i].role_ids.length > 0) {
- let isExist = -1;
- let ids = this.admin_user[i].role_ids.split(",");
- isExist = ids.indexOf(this.$route.query.id.toString());
- if (isExist < 0) {
- this.admin_user.splice(i, 1);
- i = i - 1;
- }
- }
- }
- this.loading = false
-
- } else {
- this.loading = false
-
- this.$toast({
- message: response.data.msg
- });
- }
- });
- },
- goEditStaff: function(id,is_sub_admin) {
- if (this.org_creator != id){
- this.$router.push({ path: "/staff/editstaff?id=" + id });
- }
- },
- goAddStaff: function() {
- this.$router.push({ path: "/staff/addstaff" });
- }
- },
- created() {
- setRem();
- //获取没被禁用的用户
-
- this.org_creator = this.$store.getters.user.org.creator
-
- this.GetAllStaff();
- }
- };
- </script>
-
- <style lang="scss" scoped>
- .page_staffManagement {
- height: 100%;
- overflow-y: auto;
- background: #fafafa;
-
- .staffManagementTitle {
- background: #fff;
- padding: 0 1.125rem;
- height: 3.125rem;
- display: flex;
- align-items: center;
- }
-
- .jiantou {
- font-size: 1.5rem;
- font-weight: 600;
- margin-right: 7rem;
- }
-
- .titleName {
- font-size: 1.125rem;
- font-weight: 600;
- }
-
- .iconOne {
- font-size: 1.5rem;
- }
-
- .staffBox {
- padding-left: 0.875rem;
- background: #fff;
-
- .staffOne {
- display: flex;
- align-items: center;
- height: 3.75rem;
-
- img {
- width: 2.5rem;
- height: 2.5rem;
- margin-right: 0.875rem;
- }
-
- p {
- display: flex;
- align-items: center;
- justify-content: space-between;
- padding-right: 0.875rem;
- flex: 1;
- height: 100%;
- // box-shadow: 0px 1px 0px 0px rgba(0, 0, 0, 0.1);
- border-bottom: 1px solid #e5e5e5;
- font-size: 1rem;
- }
-
- .bianji {
- font-size: 1.25rem;
- color: #cccccc;
- }
- }
- }
- }
- ::-webkit-scrollbar {
- width: 0;
- }
- </style>
-
- <style lang="scss">
- .page_staffManagement {
- .van-tabs__line {
- background: #5b98ff;
- }
- }
- .wrapper {
- position: fixed;
- left: 50%;
- top: 50%;
- transform: translate(-50%, -50%);
- }
- </style>
|