|
|
@@ -1,7 +1,7 @@
|
|
1
|
1
|
<template>
|
|
2
|
2
|
<div class="app-container">
|
|
3
|
3
|
<el-row :gutter="20">
|
|
4
|
|
- <el-col :span="6" :xs="24">
|
|
|
4
|
+ <el-col :span="8" :xs="24" class="userInfo">
|
|
5
|
5
|
<el-card class="box-card">
|
|
6
|
6
|
<div slot="header" class="clearfix">
|
|
7
|
7
|
<span>个人信息</span>
|
|
|
@@ -9,37 +9,28 @@
|
|
9
|
9
|
<div>
|
|
10
|
10
|
<div class="text-center">
|
|
11
|
11
|
<userAvatar />
|
|
|
12
|
+ <div class="user-name">{{ user.nickName }}</div>
|
|
|
13
|
+ <div class="user-sex">
|
|
|
14
|
+ <span class="mr10">{{ getAgeByIdCard(user.idCard) + '岁' }} {{ user.sex == '0' ? ' 男' : ' 女' }}</span>
|
|
|
15
|
+ <el-tag type="success" v-if="user.status == '0'">在职</el-tag>
|
|
|
16
|
+ <el-tag type="danger" v-if="user.status == '1'">离职</el-tag>
|
|
|
17
|
+ <el-tag type="warning" v-if="user.status == '2'">退休</el-tag>
|
|
|
18
|
+ <el-tag type="primary" v-if="user.status == '3'">试用</el-tag>
|
|
|
19
|
+ <el-tag type="info" v-if="user.status == '4'">返聘</el-tag>
|
|
|
20
|
+ </div>
|
|
|
21
|
+
|
|
|
22
|
+ <div class="info-item" v-for="item in userInfo">
|
|
|
23
|
+ <div class="item-label" v-if="item.value != '' && item.value != undefined">
|
|
|
24
|
+ <svg-icon :icon-class="item.icon" class="info-icon"></svg-icon>
|
|
|
25
|
+ <div class="item-label">{{ item.label }}</div>
|
|
|
26
|
+ </div>
|
|
|
27
|
+ <div>{{ item.value }}</div>
|
|
|
28
|
+ </div>
|
|
12
|
29
|
</div>
|
|
13
|
|
- <ul class="list-group list-group-striped">
|
|
14
|
|
- <li class="list-group-item">
|
|
15
|
|
- <svg-icon icon-class="user" />用户名称
|
|
16
|
|
- <div class="pull-right">{{ user.userName }}</div>
|
|
17
|
|
- </li>
|
|
18
|
|
- <li class="list-group-item">
|
|
19
|
|
- <svg-icon icon-class="phone" />手机号码
|
|
20
|
|
- <div class="pull-right">{{ user.phonenumber }}</div>
|
|
21
|
|
- </li>
|
|
22
|
|
- <li class="list-group-item">
|
|
23
|
|
- <svg-icon icon-class="email" />用户邮箱
|
|
24
|
|
- <div class="pull-right">{{ user.email }}</div>
|
|
25
|
|
- </li>
|
|
26
|
|
- <li class="list-group-item">
|
|
27
|
|
- <svg-icon icon-class="tree" />所属部门
|
|
28
|
|
- <div class="pull-right" v-if="user.dept">{{ user.dept.deptName }} / {{ postGroup }}</div>
|
|
29
|
|
- </li>
|
|
30
|
|
- <li class="list-group-item">
|
|
31
|
|
- <svg-icon icon-class="peoples" />所属角色
|
|
32
|
|
- <div class="pull-right">{{ roleGroup }}</div>
|
|
33
|
|
- </li>
|
|
34
|
|
- <li class="list-group-item">
|
|
35
|
|
- <svg-icon icon-class="date" />创建日期
|
|
36
|
|
- <div class="pull-right">{{ user.createTime }}</div>
|
|
37
|
|
- </li>
|
|
38
|
|
- </ul>
|
|
39
|
30
|
</div>
|
|
40
|
31
|
</el-card>
|
|
41
|
32
|
</el-col>
|
|
42
|
|
- <el-col :span="18" :xs="24">
|
|
|
33
|
+ <el-col :span="16" :xs="24" class="stateInfo">
|
|
43
|
34
|
<el-card>
|
|
44
|
35
|
<div slot="header" class="clearfix">
|
|
45
|
36
|
<span>基本资料</span>
|
|
|
@@ -51,6 +42,15 @@
|
|
51
|
42
|
<el-tab-pane label="修改密码" name="resetPwd">
|
|
52
|
43
|
<resetPwd />
|
|
53
|
44
|
</el-tab-pane>
|
|
|
45
|
+ <el-tab-pane label="负责项目" name="0">
|
|
|
46
|
+ <projectInfo :userId="userId"></projectInfo>
|
|
|
47
|
+ </el-tab-pane>
|
|
|
48
|
+ <el-tab-pane label="参与项目" name="1">
|
|
|
49
|
+ <participate :userId="userId"></participate>
|
|
|
50
|
+ </el-tab-pane>
|
|
|
51
|
+ <el-tab-pane label="变更记录" name="2">
|
|
|
52
|
+ <changeRecord :userId="userId"></changeRecord>
|
|
|
53
|
+ </el-tab-pane>
|
|
54
|
54
|
</el-tabs>
|
|
55
|
55
|
</el-card>
|
|
56
|
56
|
</el-col>
|
|
|
@@ -63,15 +63,22 @@ import userAvatar from "./userAvatar";
|
|
63
|
63
|
import userInfo from "./userInfo";
|
|
64
|
64
|
import resetPwd from "./resetPwd";
|
|
65
|
65
|
import { getUserProfile } from "@/api/system/user";
|
|
|
66
|
+import projectInfo from '@/views/oa/staff/projectInfo'
|
|
|
67
|
+import participate from '@/views/oa/staff/participate'
|
|
|
68
|
+import changeRecord from '@/views/oa/staff/changeRecord'
|
|
66
|
69
|
|
|
67
|
70
|
export default {
|
|
68
|
71
|
name: "Profile",
|
|
69
|
|
- components: { userAvatar, userInfo, resetPwd },
|
|
|
72
|
+ components: { userAvatar, userInfo, resetPwd, projectInfo, participate, changeRecord },
|
|
|
73
|
+ dicts: ['sys_normal_disable', 'sys_user_sex', 'sys_user_titles', 'sys_user_certificates', 'sys_user_pmlevel',
|
|
|
74
|
+ 'sys_user_postlevel', 'sys_user_salarylevel', 'sys_user_political', 'sys_user_degree', 'sys_user_engineerlevel', 'sys_user_operatorlevel'],
|
|
70
|
75
|
data() {
|
|
71
|
76
|
return {
|
|
72
|
77
|
user: {},
|
|
|
78
|
+ userId: this.$store.getters.userId,
|
|
73
|
79
|
roleGroup: {},
|
|
74
|
80
|
postGroup: {},
|
|
|
81
|
+ userInfo: [],
|
|
75
|
82
|
activeTab: "userinfo"
|
|
76
|
83
|
};
|
|
77
|
84
|
},
|
|
|
@@ -84,8 +91,213 @@ export default {
|
|
84
|
91
|
this.user = response.data;
|
|
85
|
92
|
this.roleGroup = response.roleGroup;
|
|
86
|
93
|
this.postGroup = response.postGroup;
|
|
|
94
|
+ this.userInfo = [
|
|
|
95
|
+ {
|
|
|
96
|
+ label: '部门:',
|
|
|
97
|
+ icon: 'dept',
|
|
|
98
|
+ value: this.user.dept ? this.user.dept.deptName : ''
|
|
|
99
|
+ },
|
|
|
100
|
+ {
|
|
|
101
|
+ label: '职务:',
|
|
|
102
|
+ icon: 'dept',
|
|
|
103
|
+ value: this.postGroup
|
|
|
104
|
+ },
|
|
|
105
|
+ {
|
|
|
106
|
+ label: '联系电话:',
|
|
|
107
|
+ icon: 'phone',
|
|
|
108
|
+ value: this.user.phonenumber
|
|
|
109
|
+ },
|
|
|
110
|
+ {
|
|
|
111
|
+ label: '薪资岗级:',
|
|
|
112
|
+ icon: 'postSalary',
|
|
|
113
|
+ value: this.selectDictLabel(this.dict.type.sys_user_postlevel, this.user.postLevel) + this.selectDictLabel(this.dict.type.sys_user_salarylevel, this.user.salaryLevel)
|
|
|
114
|
+ },
|
|
|
115
|
+ {
|
|
|
116
|
+ label: '入职时间:',
|
|
|
117
|
+ icon: 'date',
|
|
|
118
|
+ value: this.parseTime(this.user.entryDate, '{y}-{m}')
|
|
|
119
|
+ },
|
|
|
120
|
+ {
|
|
|
121
|
+ label: '技术职称:',
|
|
|
122
|
+ icon: 'titles',
|
|
|
123
|
+ value: this.user.titles != null ? this.selectDictLabels(this.dict.type.sys_user_titles, this.user.titles, ',') : ''
|
|
|
124
|
+ },
|
|
|
125
|
+ {
|
|
|
126
|
+ label: '职称专业:',
|
|
|
127
|
+ icon: 'titles',
|
|
|
128
|
+ value: this.user.titleProfession
|
|
|
129
|
+ },
|
|
|
130
|
+ {
|
|
|
131
|
+ label: '职业资格:',
|
|
|
132
|
+ icon: 'certificate',
|
|
|
133
|
+ value: this.user.certificates != null ? this.selectDictLabels(this.dict.type.sys_user_certificates, this.user.certificates, ',') : ''
|
|
|
134
|
+ },
|
|
|
135
|
+ {
|
|
|
136
|
+ label: '工程师岗级:',
|
|
|
137
|
+ icon: 'engineer',
|
|
|
138
|
+ value: this.selectDictLabel(this.dict.type.sys_user_engineerlevel, this.user.engineerLevel)
|
|
|
139
|
+ },
|
|
|
140
|
+ {
|
|
|
141
|
+ label: '技工等级:',
|
|
|
142
|
+ icon: 'operator',
|
|
|
143
|
+ value: this.selectDictLabel(this.dict.type.sys_user_operatorlevel, this.user.operatorLevel)
|
|
|
144
|
+ },
|
|
|
145
|
+ {
|
|
|
146
|
+ label: '项目经理级别:',
|
|
|
147
|
+ icon: 'pmLevel',
|
|
|
148
|
+ value: this.selectDictLabel(this.dict.type.sys_user_pmlevel, this.user.pmLevel)
|
|
|
149
|
+ },
|
|
|
150
|
+ {
|
|
|
151
|
+ label: '身份证号码:',
|
|
|
152
|
+ icon: 'idCard',
|
|
|
153
|
+ value: this.user.idCard
|
|
|
154
|
+ },
|
|
|
155
|
+ {
|
|
|
156
|
+ label: '籍贯:',
|
|
|
157
|
+ icon: 'place',
|
|
|
158
|
+ value: this.user.nativePlace
|
|
|
159
|
+ },
|
|
|
160
|
+ {
|
|
|
161
|
+ label: '政治面貌:',
|
|
|
162
|
+ icon: 'politicalAffiliation',
|
|
|
163
|
+ value: this.selectDictLabels(this.dict.type.sys_user_political, this.user.politicalAffiliation, ',')
|
|
|
164
|
+ },
|
|
|
165
|
+ {
|
|
|
166
|
+ label: '民族:',
|
|
|
167
|
+ icon: 'flower',
|
|
|
168
|
+ value: this.user.ethnic
|
|
|
169
|
+ },
|
|
|
170
|
+ {
|
|
|
171
|
+ label: '最高学历毕业院校:',
|
|
|
172
|
+ icon: 'school',
|
|
|
173
|
+ value: this.user.graduateSchool
|
|
|
174
|
+ },
|
|
|
175
|
+ {
|
|
|
176
|
+ label: '最高学历专业:',
|
|
|
177
|
+ icon: 'major',
|
|
|
178
|
+ value: this.user.major
|
|
|
179
|
+ },
|
|
|
180
|
+ {
|
|
|
181
|
+ label: '最高学历:',
|
|
|
182
|
+ icon: 'degree',
|
|
|
183
|
+ value: this.selectDictLabel(this.dict.type.sys_user_degree, this.user.degree)
|
|
|
184
|
+ },
|
|
|
185
|
+ {
|
|
|
186
|
+ label: '初始学历毕业院校:',
|
|
|
187
|
+ icon: 'school',
|
|
|
188
|
+ value: this.user.initialSchool
|
|
|
189
|
+ },
|
|
|
190
|
+ {
|
|
|
191
|
+ label: '初始学历专业:',
|
|
|
192
|
+ icon: 'major',
|
|
|
193
|
+ value: this.user.initialMajor
|
|
|
194
|
+ },
|
|
|
195
|
+ {
|
|
|
196
|
+ label: '初始学历:',
|
|
|
197
|
+ icon: 'degree',
|
|
|
198
|
+ value: this.selectDictLabel(this.dict.type.sys_user_degree, this.user.initialDegree)
|
|
|
199
|
+ },
|
|
|
200
|
+ {
|
|
|
201
|
+ label: '合同签订:',
|
|
|
202
|
+ icon: 'contractSign',
|
|
|
203
|
+ value: this.parseTime(this.user.contractSign, '{y}-{m}-{d}')
|
|
|
204
|
+ },
|
|
|
205
|
+ {
|
|
|
206
|
+ label: '合同期满:',
|
|
|
207
|
+ icon: 'contractExpire',
|
|
|
208
|
+ value: this.parseTime(this.user.contractExpire, '{y}-{m}-{d}')
|
|
|
209
|
+ },
|
|
|
210
|
+ {
|
|
|
211
|
+ label: '家庭住址:',
|
|
|
212
|
+ icon: 'homePlace',
|
|
|
213
|
+ value: this.user.homePlace
|
|
|
214
|
+ },
|
|
|
215
|
+ {
|
|
|
216
|
+ label: '紧急联系方式:',
|
|
|
217
|
+ icon: 'user',
|
|
|
218
|
+ value: this.user.contact ? this.user.contact : '' + this.user.telephone ? this.user.telephone : ''
|
|
|
219
|
+ },
|
|
|
220
|
+ {
|
|
|
221
|
+ label: '备注:',
|
|
|
222
|
+ icon: 'log',
|
|
|
223
|
+ value: this.user.remark
|
|
|
224
|
+ },
|
|
|
225
|
+ ]
|
|
87
|
226
|
});
|
|
88
|
|
- }
|
|
|
227
|
+ },
|
|
|
228
|
+ getAgeByIdCard(idCard) {
|
|
|
229
|
+ //获取用户身份证号码
|
|
|
230
|
+ const userCard = idCard
|
|
|
231
|
+ //如果用户身份证号码为undefined则返回空
|
|
|
232
|
+ if (!userCard) {
|
|
|
233
|
+ return 0
|
|
|
234
|
+ }
|
|
|
235
|
+ // 获取出生日期
|
|
|
236
|
+ const yearBirth = userCard.substring(6, 10)
|
|
|
237
|
+ const monthBirth = userCard.substring(10, 12)
|
|
|
238
|
+ const dayBirth = userCard.substring(12, 14)
|
|
|
239
|
+ // 获取当前年月日并计算年龄
|
|
|
240
|
+ const myDate = new Date()
|
|
|
241
|
+ const monthNow = myDate.getMonth() + 1
|
|
|
242
|
+ const dayNow = myDate.getDate()
|
|
|
243
|
+ let age = myDate.getFullYear() - yearBirth
|
|
|
244
|
+
|
|
|
245
|
+ if (monthNow < monthBirth || (monthNow == monthBirth && dayNow < dayBirth)) {
|
|
|
246
|
+ age--
|
|
|
247
|
+ }
|
|
|
248
|
+ return age
|
|
|
249
|
+ },
|
|
89
|
250
|
}
|
|
90
|
251
|
};
|
|
91
|
252
|
</script>
|
|
|
253
|
+
|
|
|
254
|
+<style lang="scss" scoped>
|
|
|
255
|
+.userInfo {
|
|
|
256
|
+ background-color: #fff;
|
|
|
257
|
+ height: 1000px;
|
|
|
258
|
+ padding: 5px;
|
|
|
259
|
+
|
|
|
260
|
+ .user-name {
|
|
|
261
|
+ font-size: 18px;
|
|
|
262
|
+ font-weight: bold;
|
|
|
263
|
+ }
|
|
|
264
|
+
|
|
|
265
|
+ .user-sex {
|
|
|
266
|
+ line-height: 30px;
|
|
|
267
|
+ font-size: 14px;
|
|
|
268
|
+ color: #797979;
|
|
|
269
|
+ }
|
|
|
270
|
+
|
|
|
271
|
+ .info-item {
|
|
|
272
|
+ line-height: 30px;
|
|
|
273
|
+ color: #5A5A5A;
|
|
|
274
|
+ font-size: 14px;
|
|
|
275
|
+ padding-left: 30px;
|
|
|
276
|
+ display: flex;
|
|
|
277
|
+ align-items: flex-start;
|
|
|
278
|
+
|
|
|
279
|
+ .info-icon {
|
|
|
280
|
+ font-size: 20px;
|
|
|
281
|
+ margin-right: 10px;
|
|
|
282
|
+ vertical-align: middle;
|
|
|
283
|
+ }
|
|
|
284
|
+
|
|
|
285
|
+ .item-label {
|
|
|
286
|
+ max-width: 156px;
|
|
|
287
|
+ display: flex;
|
|
|
288
|
+ align-items: center;
|
|
|
289
|
+ font-family: '微软雅黑';
|
|
|
290
|
+ font-weight: bold;
|
|
|
291
|
+ // text-align: right;
|
|
|
292
|
+ // display: inline-block;
|
|
|
293
|
+ }
|
|
|
294
|
+ }
|
|
|
295
|
+}
|
|
|
296
|
+
|
|
|
297
|
+.stateInfo {
|
|
|
298
|
+ background-color: #fff;
|
|
|
299
|
+ height: 1000px;
|
|
|
300
|
+ overflow-y: scroll;
|
|
|
301
|
+ padding: 10px 30px 0;
|
|
|
302
|
+}
|
|
|
303
|
+</style>
|