123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376 |
- <!--
- * @Author: ysh
- * @Date: 2024-03-22 14:50:46
- * @LastEditors: Please set LastEditors
- * @LastEditTime: 2025-02-27 11:40:45
- -->
- <template>
- <div class="bg" v-loading="loading">
- <div class="header">
- <div class="back">
- <el-button type="primary" plain @click="goBack">返回</el-button>
- </div>
- <div class="title">
- {{ '【' + this.form.nickName + '】' }}详细信息
- </div>
- </div>
- <el-row class="app-container">
- <el-col :span="8" class="userInfo">
- <div class="text-center">
- <div class="avatar">
- <img :src="avatar" class="user-avatar" />
- </div>
- <div class="user-name">{{ form.nickName }}</div>
- <div class="user-sex">
- <span class="mr10">{{ getAgeByIdCard(form.idCard) + '岁' }} {{ form.sex == '0' ? ' 男' : ' 女' }}</span>
- <el-tag type="success" v-if="form.status == '0'">在职</el-tag>
- <el-tag type="danger" v-if="form.status == '1'">离职</el-tag>
- <el-tag type="warning" v-if="form.status == '2'">退休</el-tag>
- <el-tag type="primary" v-if="form.status == '3'">试用</el-tag>
- <el-tag type="info" v-if="form.status == '4'">返聘</el-tag>
- </div>
- </div>
- <div class="info-item">
- <div class="item-label">
- <svg-icon icon-class="dept" class="info-icon"></svg-icon>
- <div class="item-label">部门:</div>
- </div>
- <div>{{ form.dept ? form.dept.deptName : '' }}</div>
- </div>
- <div class="info-item">
- <div class="item-label">
- <svg-icon icon-class="post" class="info-icon"></svg-icon>
- <div class="item-label">职务:</div>
- </div>
- <div>{{ postData }}</div>
- </div>
- <div class="info-item">
- <div class="item-label">
- <svg-icon icon-class="phone" class="info-icon"></svg-icon>
- <div class="item-label">联系电话:</div>
- </div>
- <div class="item-value">{{ form.phonenumber }}</div>
- </div>
- <div class="info-item">
- <div class="item-label">
- <svg-icon icon-class="postSalary" class="info-icon"></svg-icon>
- <div class="item-label">薪资岗级:</div>
- </div>
- <div>
- {{ selectDictLabel(dict.type.sys_user_postlevel, form.postLevel) +
- selectDictLabel(dict.type.sys_user_salarylevel, form.salaryLevel) }}
- </div>
- </div>
- <div class="info-item">
- <div class="item-label">
- <svg-icon icon-class="date" class="info-icon"></svg-icon>
- <div class="item-label">入职时间:</div>
- </div>
- <div>{{ parseTime(form.entryDate, '{y}-{m}') }}</div>
- </div>
- <div class="info-item" v-for="item in userInfo">
- <div class="item-label">
- <svg-icon :icon-class="item.icon" class="info-icon"></svg-icon>
- <div class="item-label">{{ item.label }}</div>
- </div>
- <div>{{ item.value }}</div>
- </div>
- <div class="info-item">
- <div class="item-label">
- <svg-icon icon-class="homePlace" class="info-icon"></svg-icon>
- <div class="item-label" style="min-width:70px;">家庭住址:</div>
- </div>
- <div>{{ form.homePlace }}</div>
- </div>
- </el-col>
- <el-col :span="15" class="stateInfo">
- <el-tabs v-model="activeName" @tab-click="handleClick">
- <el-tab-pane label="负责项目" name="0">
- <projectInfo></projectInfo>
- </el-tab-pane>
- <el-tab-pane label="参与项目" name="1">
- <participate></participate>
- </el-tab-pane>
- <el-tab-pane label="变更记录" name="2">
- <changeRecord></changeRecord>
- </el-tab-pane>
- </el-tabs>
- </el-col>
- </el-row>
- </div>
- </template>
-
- <script>
- import userAvatar from "@/views/system/user/profile/userAvatar.vue"
- import { getUser } from "@/api/system/user"
- import projectInfo from './projectInfo'
- import participate from './participate'
- import changeRecord from './changeRecord'
- export default {
- components: { userAvatar, projectInfo, participate, changeRecord },
- dicts: ['sys_normal_disable', 'sys_user_sex', 'sys_user_titles', 'sys_user_certificates', 'sys_user_pmlevel',
- 'sys_user_postlevel', 'sys_user_salarylevel', 'sys_user_political', 'sys_user_degree', 'sys_user_engineerlevel', 'sys_user_operatorlevel'],
- created() {
- if (this.$route.query)
- this.getUserInfo(this.$route.query.userId);
- },
- data() {
- return {
- loading: true,
- form: {
- userId: undefined,
- nickName: '',
- dept: {
- deptName: ''
- }
- },
- userInfo: [],
- postOptions: [],
- postData: '',
- activeName: '2',
- avatar: ''
- }
- },
- methods: {
- getUserInfo(id) {
- getUser(id).then(res => {
- this.postOptions = res.posts;
- if (res.data) {
- this.avatar = (res.data.avatar == "" || res.data.avatar == null) ? require("@/assets/images/user.png") : process.env.VUE_APP_BASE_API + res.data.avatar;
- this.form = res.data;
- this.formartForm(res);
- this.userInfo = [
- {
- label: '技术职称:',
- icon: 'titles',
- value: this.form.titles != null ? this.selectDictLabels(this.dict.type.sys_user_titles, this.form.titles, ',') : ''
- },
- {
- label: '职称专业:',
- icon: 'titles',
- value: this.form.titleProfession
- },
- {
- label: '职业资格:',
- icon: 'certificate',
- value: this.form.certificates != null ? this.selectDictLabels(this.dict.type.sys_user_certificates, this.form.certificates, ',') : ''
- },
- {
- label: '工程师岗级:',
- icon: 'engineer',
- value: this.selectDictLabel(this.dict.type.sys_user_engineerlevel, this.form.engineerLevel)
- },
- {
- label: '技工等级:',
- icon: 'operator',
- value: this.selectDictLabel(this.dict.type.sys_user_operatorlevel, this.form.operatorLevel)
- },
- {
- label: '项目经理级别:',
- icon: 'pmLevel',
- value: this.selectDictLabel(this.dict.type.sys_user_pmlevel, this.form.pmLevel)
- },
- {
- label: '身份证号码:',
- icon: 'idCard',
- value: this.form.idCard
- },
- {
- label: '籍贯:',
- icon: 'place',
- value: this.form.nativePlace
- },
- {
- label: '政治面貌:',
- icon: 'politicalAffiliation',
- value: this.selectDictLabels(this.dict.type.sys_user_political, this.form.politicalAffiliation, ',')
- },
- {
- label: '民族:',
- icon: 'flower',
- value: this.form.ethnic
- },
- {
- label: '最高学历毕业院校:',
- icon: 'school',
- value: this.form.graduateSchool
- },
- {
- label: '最高学历专业:',
- icon: 'major',
- value: this.form.major
- },
- {
- label: '最高学历:',
- icon: 'degree',
- value: this.selectDictLabel(this.dict.type.sys_user_degree, this.form.degree)
- },
- {
- label: '初始学历专业:',
- icon: 'major',
- value: this.form.initialMajor
- },
- {
- label: '初始学历:',
- icon: 'degree',
- value: this.selectDictLabel(this.dict.type.sys_user_degree, this.form.initialDegree)
- },
- {
- label: '合同签订:',
- icon: 'contractSign',
- value: this.parseTime(this.form.contractSign, '{y}-{m}-{d}')
- },
- {
- label: '合同期满:',
- icon: 'contractExpire',
- value: this.parseTime(this.form.contractExpire, '{y}-{m}-{d}')
- },
- ]
- this.loading =false;
- }
- })
- },
- formartForm(res) {
- if (this.$route.query) {
- this.form.userId = this.$route.query.userId
- this.form.nickName = this.$route.query.nickName
- }
- let postArr = [];
- for (let post of res.posts) {
- for (let postid of res.postIds) {
- if (postid == post.postId) {
- postArr.push(post.postName)
- }
- }
- }
- this.postData = postArr.join('/')
- },
- handleClick() {
-
- },
- goBack() {
- let obj = { path: "/staff/info" }
- this.$tab.closeOpenPage(obj);
- this.$router.push({ path: '/oa/staff/people' });
- },
- getAgeByIdCard(idCard) {
- const sexAndAge = {}
- //获取用户身份证号码
- const userCard = idCard
- //如果用户身份证号码为undefined则返回空
- if (!userCard) {
- return sexAndAge
- }
- // 获取出生日期
- const yearBirth = userCard.substring(6, 10)
- const monthBirth = userCard.substring(10, 12)
- const dayBirth = userCard.substring(12, 14)
- // 获取当前年月日并计算年龄
- const myDate = new Date()
- const monthNow = myDate.getMonth() + 1
- const dayNow = myDate.getDate()
- let age = myDate.getFullYear() - yearBirth
-
- if (monthNow < monthBirth || (monthNow == monthBirth && dayNow < dayBirth)) {
- age--
- }
- // 得到年龄
- sexAndAge.age = age
- return sexAndAge.age
- },
- }
- }
- </script>
-
- <style lang="scss" scoped>
- .bg {
- background-color: #F0F2F5;
- }
-
- .header {
- background-color: #fff;
- height: 110px;
- display: flex;
- align-items: center;
-
-
- .back {
- margin-left: 30px;
- flex: 1;
- }
-
- .title {
- text-align: center;
- flex: 24;
- font-size: 25px;
- padding-right: 100px;
- }
- }
-
- .userInfo {
- background-color: #fff;
- height: 900px;
- margin-right: 40px;
- padding: 5px;
-
- .avatar {
- text-align: center;
-
- // padding: 10px 0;
- .user-avatar {
- width: 130px;
- height: 130px;
- border-radius: 50%;
- }
-
- }
-
- .user-name {
- font-size: 18px;
- font-weight: bold;
- }
-
- .user-sex {
- line-height: 30px;
- font-size: 14px;
- color: #797979;
- }
-
- .info-item {
- line-height: 30px;
- color: #5A5A5A;
- font-size: 14px;
- padding-left: 30px;
- display: flex;
- align-items: flex-start;
-
- .info-icon {
- font-size: 20px;
- margin-right: 10px;
- vertical-align: middle;
- }
-
- .item-label {
- max-width: 156px;
- display: flex;
- align-items: center;
- font-family: '微软雅黑';
- font-weight: bold;
- // text-align: right;
- // display: inline-block;
- }
-
- .item-value {
- max-width: 260px;
- // display: inline-block;
- }
- }
- }
-
- .stateInfo {
- background-color: #fff;
- height: 900px;
- overflow-y: scroll;
- padding: 10px 30px 0;
- }
- </style>
|