综合办公系统
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

info.vue 11KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376
  1. <!--
  2. * @Author: ysh
  3. * @Date: 2024-03-22 14:50:46
  4. * @LastEditors: Please set LastEditors
  5. * @LastEditTime: 2025-02-27 11:40:45
  6. -->
  7. <template>
  8. <div class="bg" v-loading="loading">
  9. <div class="header">
  10. <div class="back">
  11. <el-button type="primary" plain @click="goBack">返回</el-button>
  12. </div>
  13. <div class="title">
  14. {{ '【' + this.form.nickName + '】' }}详细信息
  15. </div>
  16. </div>
  17. <el-row class="app-container">
  18. <el-col :span="8" class="userInfo">
  19. <div class="text-center">
  20. <div class="avatar">
  21. <img :src="avatar" class="user-avatar" />
  22. </div>
  23. <div class="user-name">{{ form.nickName }}</div>
  24. <div class="user-sex">
  25. <span class="mr10">{{ getAgeByIdCard(form.idCard) + '岁' }} {{ form.sex == '0' ? ' 男' : ' 女' }}</span>
  26. <el-tag type="success" v-if="form.status == '0'">在职</el-tag>
  27. <el-tag type="danger" v-if="form.status == '1'">离职</el-tag>
  28. <el-tag type="warning" v-if="form.status == '2'">退休</el-tag>
  29. <el-tag type="primary" v-if="form.status == '3'">试用</el-tag>
  30. <el-tag type="info" v-if="form.status == '4'">返聘</el-tag>
  31. </div>
  32. </div>
  33. <div class="info-item">
  34. <div class="item-label">
  35. <svg-icon icon-class="dept" class="info-icon"></svg-icon>
  36. <div class="item-label">部门:</div>
  37. </div>
  38. <div>{{ form.dept ? form.dept.deptName : '' }}</div>
  39. </div>
  40. <div class="info-item">
  41. <div class="item-label">
  42. <svg-icon icon-class="post" class="info-icon"></svg-icon>
  43. <div class="item-label">职务:</div>
  44. </div>
  45. <div>{{ postData }}</div>
  46. </div>
  47. <div class="info-item">
  48. <div class="item-label">
  49. <svg-icon icon-class="phone" class="info-icon"></svg-icon>
  50. <div class="item-label">联系电话:</div>
  51. </div>
  52. <div class="item-value">{{ form.phonenumber }}</div>
  53. </div>
  54. <div class="info-item">
  55. <div class="item-label">
  56. <svg-icon icon-class="postSalary" class="info-icon"></svg-icon>
  57. <div class="item-label">薪资岗级:</div>
  58. </div>
  59. <div>
  60. {{ selectDictLabel(dict.type.sys_user_postlevel, form.postLevel) +
  61. selectDictLabel(dict.type.sys_user_salarylevel, form.salaryLevel) }}
  62. </div>
  63. </div>
  64. <div class="info-item">
  65. <div class="item-label">
  66. <svg-icon icon-class="date" class="info-icon"></svg-icon>
  67. <div class="item-label">入职时间:</div>
  68. </div>
  69. <div>{{ parseTime(form.entryDate, '{y}-{m}') }}</div>
  70. </div>
  71. <div class="info-item" v-for="item in userInfo">
  72. <div class="item-label">
  73. <svg-icon :icon-class="item.icon" class="info-icon"></svg-icon>
  74. <div class="item-label">{{ item.label }}</div>
  75. </div>
  76. <div>{{ item.value }}</div>
  77. </div>
  78. <div class="info-item">
  79. <div class="item-label">
  80. <svg-icon icon-class="homePlace" class="info-icon"></svg-icon>
  81. <div class="item-label" style="min-width:70px;">家庭住址:</div>
  82. </div>
  83. <div>{{ form.homePlace }}</div>
  84. </div>
  85. </el-col>
  86. <el-col :span="15" class="stateInfo">
  87. <el-tabs v-model="activeName" @tab-click="handleClick">
  88. <el-tab-pane label="负责项目" name="0">
  89. <projectInfo></projectInfo>
  90. </el-tab-pane>
  91. <el-tab-pane label="参与项目" name="1">
  92. <participate></participate>
  93. </el-tab-pane>
  94. <el-tab-pane label="变更记录" name="2">
  95. <changeRecord></changeRecord>
  96. </el-tab-pane>
  97. </el-tabs>
  98. </el-col>
  99. </el-row>
  100. </div>
  101. </template>
  102. <script>
  103. import userAvatar from "@/views/system/user/profile/userAvatar.vue"
  104. import { getUser } from "@/api/system/user"
  105. import projectInfo from './projectInfo'
  106. import participate from './participate'
  107. import changeRecord from './changeRecord'
  108. export default {
  109. components: { userAvatar, projectInfo, participate, changeRecord },
  110. dicts: ['sys_normal_disable', 'sys_user_sex', 'sys_user_titles', 'sys_user_certificates', 'sys_user_pmlevel',
  111. 'sys_user_postlevel', 'sys_user_salarylevel', 'sys_user_political', 'sys_user_degree', 'sys_user_engineerlevel', 'sys_user_operatorlevel'],
  112. created() {
  113. if (this.$route.query)
  114. this.getUserInfo(this.$route.query.userId);
  115. },
  116. data() {
  117. return {
  118. loading: true,
  119. form: {
  120. userId: undefined,
  121. nickName: '',
  122. dept: {
  123. deptName: ''
  124. }
  125. },
  126. userInfo: [],
  127. postOptions: [],
  128. postData: '',
  129. activeName: '2',
  130. avatar: ''
  131. }
  132. },
  133. methods: {
  134. getUserInfo(id) {
  135. getUser(id).then(res => {
  136. this.postOptions = res.posts;
  137. if (res.data) {
  138. this.avatar = (res.data.avatar == "" || res.data.avatar == null) ? require("@/assets/images/user.png") : process.env.VUE_APP_BASE_API + res.data.avatar;
  139. this.form = res.data;
  140. this.formartForm(res);
  141. this.userInfo = [
  142. {
  143. label: '技术职称:',
  144. icon: 'titles',
  145. value: this.form.titles != null ? this.selectDictLabels(this.dict.type.sys_user_titles, this.form.titles, ',') : ''
  146. },
  147. {
  148. label: '职称专业:',
  149. icon: 'titles',
  150. value: this.form.titleProfession
  151. },
  152. {
  153. label: '职业资格:',
  154. icon: 'certificate',
  155. value: this.form.certificates != null ? this.selectDictLabels(this.dict.type.sys_user_certificates, this.form.certificates, ',') : ''
  156. },
  157. {
  158. label: '工程师岗级:',
  159. icon: 'engineer',
  160. value: this.selectDictLabel(this.dict.type.sys_user_engineerlevel, this.form.engineerLevel)
  161. },
  162. {
  163. label: '技工等级:',
  164. icon: 'operator',
  165. value: this.selectDictLabel(this.dict.type.sys_user_operatorlevel, this.form.operatorLevel)
  166. },
  167. {
  168. label: '项目经理级别:',
  169. icon: 'pmLevel',
  170. value: this.selectDictLabel(this.dict.type.sys_user_pmlevel, this.form.pmLevel)
  171. },
  172. {
  173. label: '身份证号码:',
  174. icon: 'idCard',
  175. value: this.form.idCard
  176. },
  177. {
  178. label: '籍贯:',
  179. icon: 'place',
  180. value: this.form.nativePlace
  181. },
  182. {
  183. label: '政治面貌:',
  184. icon: 'politicalAffiliation',
  185. value: this.selectDictLabels(this.dict.type.sys_user_political, this.form.politicalAffiliation, ',')
  186. },
  187. {
  188. label: '民族:',
  189. icon: 'flower',
  190. value: this.form.ethnic
  191. },
  192. {
  193. label: '最高学历毕业院校:',
  194. icon: 'school',
  195. value: this.form.graduateSchool
  196. },
  197. {
  198. label: '最高学历专业:',
  199. icon: 'major',
  200. value: this.form.major
  201. },
  202. {
  203. label: '最高学历:',
  204. icon: 'degree',
  205. value: this.selectDictLabel(this.dict.type.sys_user_degree, this.form.degree)
  206. },
  207. {
  208. label: '初始学历专业:',
  209. icon: 'major',
  210. value: this.form.initialMajor
  211. },
  212. {
  213. label: '初始学历:',
  214. icon: 'degree',
  215. value: this.selectDictLabel(this.dict.type.sys_user_degree, this.form.initialDegree)
  216. },
  217. {
  218. label: '合同签订:',
  219. icon: 'contractSign',
  220. value: this.parseTime(this.form.contractSign, '{y}-{m}-{d}')
  221. },
  222. {
  223. label: '合同期满:',
  224. icon: 'contractExpire',
  225. value: this.parseTime(this.form.contractExpire, '{y}-{m}-{d}')
  226. },
  227. ]
  228. this.loading =false;
  229. }
  230. })
  231. },
  232. formartForm(res) {
  233. if (this.$route.query) {
  234. this.form.userId = this.$route.query.userId
  235. this.form.nickName = this.$route.query.nickName
  236. }
  237. let postArr = [];
  238. for (let post of res.posts) {
  239. for (let postid of res.postIds) {
  240. if (postid == post.postId) {
  241. postArr.push(post.postName)
  242. }
  243. }
  244. }
  245. this.postData = postArr.join('/')
  246. },
  247. handleClick() {
  248. },
  249. goBack() {
  250. let obj = { path: "/staff/info" }
  251. this.$tab.closeOpenPage(obj);
  252. this.$router.push({ path: '/oa/staff/people' });
  253. },
  254. getAgeByIdCard(idCard) {
  255. const sexAndAge = {}
  256. //获取用户身份证号码
  257. const userCard = idCard
  258. //如果用户身份证号码为undefined则返回空
  259. if (!userCard) {
  260. return sexAndAge
  261. }
  262. // 获取出生日期
  263. const yearBirth = userCard.substring(6, 10)
  264. const monthBirth = userCard.substring(10, 12)
  265. const dayBirth = userCard.substring(12, 14)
  266. // 获取当前年月日并计算年龄
  267. const myDate = new Date()
  268. const monthNow = myDate.getMonth() + 1
  269. const dayNow = myDate.getDate()
  270. let age = myDate.getFullYear() - yearBirth
  271. if (monthNow < monthBirth || (monthNow == monthBirth && dayNow < dayBirth)) {
  272. age--
  273. }
  274. // 得到年龄
  275. sexAndAge.age = age
  276. return sexAndAge.age
  277. },
  278. }
  279. }
  280. </script>
  281. <style lang="scss" scoped>
  282. .bg {
  283. background-color: #F0F2F5;
  284. }
  285. .header {
  286. background-color: #fff;
  287. height: 110px;
  288. display: flex;
  289. align-items: center;
  290. .back {
  291. margin-left: 30px;
  292. flex: 1;
  293. }
  294. .title {
  295. text-align: center;
  296. flex: 24;
  297. font-size: 25px;
  298. padding-right: 100px;
  299. }
  300. }
  301. .userInfo {
  302. background-color: #fff;
  303. height: 900px;
  304. margin-right: 40px;
  305. padding: 5px;
  306. .avatar {
  307. text-align: center;
  308. // padding: 10px 0;
  309. .user-avatar {
  310. width: 130px;
  311. height: 130px;
  312. border-radius: 50%;
  313. }
  314. }
  315. .user-name {
  316. font-size: 18px;
  317. font-weight: bold;
  318. }
  319. .user-sex {
  320. line-height: 30px;
  321. font-size: 14px;
  322. color: #797979;
  323. }
  324. .info-item {
  325. line-height: 30px;
  326. color: #5A5A5A;
  327. font-size: 14px;
  328. padding-left: 30px;
  329. display: flex;
  330. align-items: flex-start;
  331. .info-icon {
  332. font-size: 20px;
  333. margin-right: 10px;
  334. vertical-align: middle;
  335. }
  336. .item-label {
  337. max-width: 156px;
  338. display: flex;
  339. align-items: center;
  340. font-family: '微软雅黑';
  341. font-weight: bold;
  342. // text-align: right;
  343. // display: inline-block;
  344. }
  345. .item-value {
  346. max-width: 260px;
  347. // display: inline-block;
  348. }
  349. }
  350. }
  351. .stateInfo {
  352. background-color: #fff;
  353. height: 900px;
  354. overflow-y: scroll;
  355. padding: 10px 30px 0;
  356. }
  357. </style>