综合办公系统
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

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