Browse Source

Merge branch 'master' of http://git.shengws.com/csx/Pad_New

csx 4 years ago
parent
commit
e6a080d38f

+ 8 - 0
src/api/temp.js View File

@@ -0,0 +1,8 @@
1
+import request from '@/utils/request'
2
+
3
+export function run(){
4
+  return request({
5
+    url:'/api/public/handledata',
6
+    method:'post',
7
+  })
8
+}

+ 160 - 120
src/pages/console/managementConsole/staff_role/employeeList/index.vue View File

@@ -20,7 +20,7 @@
20 20
         <div class="checkOne" v-for="(item, index) in admin_user" :key="index">
21 21
           <van-checkbox :name="item.id" @change="onChange"></van-checkbox>
22 22
           <div class="checkUserBox">
23
-            <img v-if="item.avatar.length > 0" :src="item.avatar" alt="" />
23
+            <img v-if="item.avatar.length > 0" :src="item.avatar" alt=""/>
24 24
             <img
25 25
               v-if="item.avatar.length == 0"
26 26
               src="../../../../../assets/images/default_avatar.jpg"
@@ -35,116 +35,147 @@
35 35
 </template>
36 36
 
37 37
 <script>
38
-import { setRem } from "@/libs/functionRem";
39
-import { GetAllStaff, AddUserRole } from "@/api/admin_user";
40
-export default {
41
-  data() {
42
-    return {
43
-      allChecked: false,
44
-      isSubSuperAdmin:false,
45
-      result: [],
46
-      admin_user: []
47
-    };
48
-  },
49
-  methods: {
50
-    save() {
51
-      if (this.result.length == 0) {
52
-        this.$toast({
53
-          message: "至少选择一个用户"
54
-        });
55
-        return;
56
-      }
38
+  import {setRem} from "@/libs/functionRem";
39
+  import {AddUserRole, GetAllStaff, GetRoleInfo} from "@/api/admin_user";
40
+
41
+  export default {
42
+    data() {
43
+      return {
44
+        allChecked: false,
45
+        isSubSuperAdmin: false,
46
+        result: [],
47
+        admin_user: [],
48
+        name: "",
49
+        is_system: "",
57 50
 
58
-      let params = {
59
-        id: this.$route.query.id,
60
-        ids: this.result.join(",")
61 51
       };
62
-      AddUserRole(params).then(response => {
63
-        if (response.data.state === 1) {
64
-          this.$router.go(-1);
65
-        } else {
52
+    },
53
+    methods: {
54
+      save() {
55
+        if (this.result.length == 0) {
66 56
           this.$toast({
67
-            message: response.data.msg
57
+            message: "至少选择一个用户"
68 58
           });
59
+          return;
69 60
         }
70
-      });
71
-    },
72
-    GetAllStaff: function() {
73
-      GetAllStaff().then(response => {
74
-        if (response.data.state === 1) {
75
-          this.admin_user = response.data.data.admins;
76
-          this.isSubSuperAdmin = response.data.data.isSubSuperAdmin;
77 61
 
78
-          console.log(this.admin_user);
79
-          for (let i = 0; i < this.admin_user.length; i++) {
80
-            if (this.admin_user[i].role_ids.length > 0) {
81
-              let isExist = -1;
82
-              let ids = this.admin_user[i].role_ids.split(",");
83
-              isExist = ids.indexOf(this.$route.query.id.toString());
84
-              if (isExist >= 0) {
85
-                this.admin_user.splice(i, 1);
86
-                i = i - 1;
87
-              }
88
-            }
62
+        let params = {
63
+          id: this.$route.query.id,
64
+          ids: this.result.join(",")
65
+        };
66
+        AddUserRole(params).then(response => {
67
+          if (response.data.state === 1) {
68
+            this.$router.go(-1);
69
+          } else {
70
+            this.$toast({
71
+              message: response.data.msg
72
+            });
89 73
           }
90
-          for (let i = 0; i < this.admin_user.length; i++) {
74
+        });
75
+      },
76
+      GetAllStaff: function () {
77
+        GetAllStaff().then(response => {
78
+          if (response.data.state === 1) {
79
+            this.admin_user = response.data.data.admins;
80
+            this.isSubSuperAdmin = response.data.data.isSubSuperAdmin;
91 81
 
92
-            if(this.isSubSuperAdmin){
93
-              if (this.admin_user[i].user_id == this.$store.getters.user.org.creator) {
94
-                this.admin_user.splice(i, 1);
95
-                i = i - 1;
96
-              }else{
97
-                if(this.admin_user[i].is_sub_admin && this.admin_user[i].user_id != this.$store.getters.user.admin.id){
82
+            console.log(this.admin_user);
83
+            for (let i = 0; i < this.admin_user.length; i++) {
84
+              if (this.admin_user[i].role_ids.length > 0) {
85
+                let isExist = -1;
86
+                let ids = this.admin_user[i].role_ids.split(",");
87
+                isExist = ids.indexOf(this.$route.query.id.toString());
88
+                if (isExist >= 0) {
98 89
                   this.admin_user.splice(i, 1);
99 90
                   i = i - 1;
100 91
                 }
101 92
               }
102
-            }else{
103
-
104
-
105 93
             }
94
+            for (let i = 0; i < this.admin_user.length; i++) {
95
+              if (this.isSubSuperAdmin) { //如果当前用户是子管理员,则将管理员剔除到待添加员工列表
96
+                if (this.admin_user[i].user_id == this.$store.getters.user.org.creator) {
97
+                  this.admin_user.splice(i, 1);
98
+                  i = i - 1;
99
+                } else {
100
+                  if (this.admin_user[i].is_sub_admin && this.admin_user[i].user_id != this.$store.getters.user.admin.id) {
101
+                    this.admin_user.splice(i, 1);
102
+                    i = i - 1;
103
+                  }
104
+                }
105
+              } else { //如果当前用户是超级管理员,而且当前编辑角色是子管理员的话,需要将超级管理员剔除到待添加员工列表
106
+                if (this.name == "子管理员" && this.is_system == 1) {
107
+                  if (this.admin_user[i].user_id == this.$store.getters.user.org.creator) {
108
+                    this.admin_user.splice(i, 1);
109
+                    i = i - 1;
110
+                  }
111
+                }
112
+              }
113
+            }
114
+          } else {
115
+            this.$toast({
116
+              message: response.data.msg
117
+            });
118
+          }
119
+        });
120
+      },
106 121
 
107
-
122
+      checkAll() {
123
+        if (this.allChecked == false) {
124
+          for (let i = 0; i < this.admin_user.length; i++) {
125
+            this.result.push(this.admin_user[i].id);
108 126
           }
127
+          this.allChecked = true;
109 128
         } else {
110
-          this.$toast({
111
-            message: response.data.msg
112
-          });
129
+          this.result = [];
113 130
         }
114
-      });
115
-    },
116
-
117
-    checkAll() {
118
-      if (this.allChecked == false) {
119
-        for (let i = 0; i < this.admin_user.length; i++) {
120
-          this.result.push(this.admin_user[i].id);
131
+      },
132
+      onChange() {
133
+        if (this.result.length == this.admin_user.length) {
134
+          this.allChecked = true;
135
+        } else {
136
+          this.allChecked = false;
137
+        }
138
+      }, GetRoleInfo(role_id) {
139
+        let params = {
140
+          id: role_id,
121 141
         }
122
-        this.allChecked = true;
123
-      } else {
124
-        this.result = [];
142
+        GetRoleInfo(params).then(response => {
143
+          if (response.data.state === 1) {
144
+
145
+            this.name = response.data.data.role.name
146
+            this.desc = response.data.data.role.intro
147
+            this.is_system = response.data.data.role.is_system
148
+            this.GetAllStaff();
149
+
150
+
151
+          } else {
152
+
153
+            this.$toast({
154
+              message: response.data.msg
155
+            });
156
+          }
157
+        }).catch(error => {
158
+          this.loading = false
159
+
160
+        });
161
+        ;
162
+
125 163
       }
126 164
     },
127
-    onChange() {
128
-      if (this.result.length == this.admin_user.length) {
129
-        this.allChecked = true;
130
-      } else {
131
-        this.allChecked = false;
132
-      }
165
+    created() {
166
+      //获取没被禁用的用户
167
+      this.GetRoleInfo(this.$route.query.id)
168
+      setRem();
133 169
     }
134
-  },
135
-  created() {
136
-    //获取没被禁用的用户
137
-    this.GetAllStaff();
138
-    setRem();
139
-  }
140
-};
170
+  };
141 171
 </script>
142 172
 
143 173
 <style lang="scss" scoped>
144
-.page_employeeList {
145
-  height: 100%;
146
-  overflow-y: auto;
147
-  background: #fafafa;
174
+  .page_employeeList {
175
+    height: 100%;
176
+    overflow-y: auto;
177
+    background: #fafafa;
178
+
148 179
   .editRoleTitle {
149 180
     background: #fff;
150 181
     padding: 0 1.125rem;
@@ -152,49 +183,58 @@ export default {
152 183
     display: flex;
153 184
     align-items: center;
154 185
     justify-content: space-between;
155
-    span {
156
-      font-size: 1rem;
157
-    }
186
+
187
+  span {
188
+    font-size: 1rem;
189
+  }
190
+
158 191
   }
159 192
   .jiantou {
160 193
     font-size: 1.5rem;
161 194
     font-weight: 600;
162 195
     margin-right: 1.5rem;
163 196
   }
197
+
164 198
   .titleName {
165 199
     font-size: 1.125rem !important;
166 200
     font-weight: 600;
167 201
   }
202
+
168 203
   .allCheckBox {
169
-    .allCheck {
170
-      height: 2.8125rem;
171
-      display: flex;
172
-      align-items: center;
173
-      background: #fff;
174
-      padding-left: 0.75rem;
175
-      margin: 1rem 0;
176
-      font-size: 1rem;
177
-    }
178
-    .checkOne {
179
-      background: #fff;
180
-      height: 3.75rem;
181
-      display: flex;
182
-      align-items: center;
183
-      padding-left: 0.75rem;
184
-    }
185
-    .checkUserBox {
186
-      display: flex;
187
-      align-items: center;
188
-      font-size: 1rem;
189
-      img {
190
-        width: 2.5rem;
191
-        height: 2.5rem;
192
-        margin: 0 0.75rem 0 1.25rem;
193
-      }
194
-    }
204
+
205
+  .allCheck {
206
+    height: 2.8125rem;
207
+    display: flex;
208
+    align-items: center;
209
+    background: #fff;
210
+    padding-left: 0.75rem;
211
+    margin: 1rem 0;
212
+    font-size: 1rem;
213
+  }
214
+
215
+  .checkOne {
216
+    background: #fff;
217
+    height: 3.75rem;
218
+    display: flex;
219
+    align-items: center;
220
+    padding-left: 0.75rem;
221
+  }
222
+
223
+  .checkUserBox {
224
+    display: flex;
225
+    align-items: center;
226
+    font-size: 1rem;
227
+
228
+  img {
229
+    width: 2.5rem;
230
+    height: 2.5rem;
231
+    margin: 0 0.75rem 0 1.25rem;
232
+  }
233
+
234
+  }
235
+  }
236
+  }
237
+  ::-webkit-scrollbar {
238
+    width: 0;
195 239
   }
196
-}
197
-::-webkit-scrollbar {
198
-  width: 0;
199
-}
200 240
 </style>

+ 4 - 2
src/pages/console/managementConsole/staff_role/staffManagement/index.vue View File

@@ -17,6 +17,7 @@
17 17
             v-for="(item,index) in admin_user"
18 18
             :key="index"
19 19
             v-if="admin_user.length > 0"
20
+            @click="goEditStaff(item.user_id)"
20 21
           >
21 22
             <img v-if="item.avatar.length > 0" :src="item.avatar" alt />
22 23
             <img
@@ -26,7 +27,7 @@
26 27
             />
27 28
             <p>
28 29
               <span>{{item.user_name}}</span>
29
-              <i @click="goEditStaff(item.user_id)" class="iconfont icon-bianji bianji"></i>
30
+              <i class="iconfont icon-bianji bianji"></i>
30 31
             </p>
31 32
           </div>
32 33
         </div>
@@ -42,6 +43,7 @@
42 43
             v-for="(item,index) in del_admin_user"
43 44
             :key="index"
44 45
             v-if="del_admin_user.length > 0"
46
+            @click="goEditStaff(item.user_id)"
45 47
           >
46 48
             <img v-if="item.avatar.length > 0" :src="item.avatar" alt />
47 49
             <img
@@ -51,7 +53,7 @@
51 53
             />
52 54
             <p>
53 55
               <span>{{item.user_name}}</span>
54
-              <i @click="goEditStaff(item.user_id)" class="iconfont icon-bianji bianji"></i>
56
+              <i  class="iconfont icon-bianji bianji"></i>
55 57
             </p>
56 58
           </div>
57 59
         </div>

+ 10 - 1
src/pages/homeIndex/index.vue View File

@@ -153,6 +153,8 @@
153 153
 import { Toast } from "vant";
154 154
 
155 155
 import { GetHomeData, ChangeOrg } from "@/api/home";
156
+import { run } from "@/api/temp";
157
+
156 158
 import "../../libs/rem.js";
157 159
 import "../../styles/newStyle.scss";
158 160
 import { setRem } from "@/libs/functionRem";
@@ -248,6 +250,13 @@ export default {
248 250
       });
249 251
     },
250 252
     jump(url) {
253
+      // run().then(response => {
254
+      //   if (response.data.state === 1) {
255
+      //
256
+      //   } else {
257
+      //
258
+      //   }
259
+      // });
251 260
       if (url.length != 0) {
252 261
         window.location.href = url;
253 262
       }
@@ -258,7 +267,7 @@ export default {
258 267
         return;
259 268
       }
260 269
       if (app.open_status == 0) {
261
-        Toast("敬请期待");
270
+        Toast("近期发布");
262 271
 
263 272
         return;
264 273
       }