综合办公系统
選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。

info.vue 11KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371
  1. <!--
  2. * @Author: ysh
  3. * @Date: 2024-03-22 14:50:46
  4. * @LastEditors: Please set LastEditors
  5. * @LastEditTime: 2025-02-26 17:09:25
  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: 'certificate',
  150. value: this.form.certificates != null ? this.selectDictLabels(this.dict.type.sys_user_certificates, this.form.certificates, ',') : ''
  151. },
  152. {
  153. label: '工程师岗级:',
  154. icon: 'engineer',
  155. value: this.selectDictLabel(this.dict.type.sys_user_engineerlevel, this.form.engineerLevel)
  156. },
  157. {
  158. label: '技工等级:',
  159. icon: 'operator',
  160. value: this.selectDictLabel(this.dict.type.sys_user_operatorlevel, this.form.operatorLevel)
  161. },
  162. {
  163. label: '项目经理级别:',
  164. icon: 'pmLevel',
  165. value: this.selectDictLabel(this.dict.type.sys_user_pmlevel, this.form.pmLevel)
  166. },
  167. {
  168. label: '身份证号码:',
  169. icon: 'idCard',
  170. value: this.form.idCard
  171. },
  172. {
  173. label: '籍贯:',
  174. icon: 'place',
  175. value: this.form.nativePlace
  176. },
  177. {
  178. label: '政治面貌:',
  179. icon: 'politicalAffiliation',
  180. value: this.selectDictLabels(this.dict.type.sys_user_political, this.form.politicalAffiliation, ',')
  181. },
  182. {
  183. label: '民族:',
  184. icon: 'flower',
  185. value: this.form.ethnic
  186. },
  187. {
  188. label: '毕业院校:',
  189. icon: 'school',
  190. value: this.form.graduateSchool
  191. },
  192. {
  193. label: '专业:',
  194. icon: 'major',
  195. value: this.form.major
  196. },
  197. {
  198. label: '最高学历:',
  199. icon: 'degree',
  200. value: this.selectDictLabel(this.dict.type.sys_user_degree, this.form.degree)
  201. },
  202. {
  203. label: '初始专业:',
  204. icon: 'major',
  205. value: this.form.initialMajor
  206. },
  207. {
  208. label: '初始学历:',
  209. icon: 'degree',
  210. value: this.selectDictLabel(this.dict.type.sys_user_degree, this.form.initialDegree)
  211. },
  212. {
  213. label: '合同签订:',
  214. icon: 'contractSign',
  215. value: this.parseTime(this.form.contractSign, '{y}-{m}-{d}')
  216. },
  217. {
  218. label: '合同期满:',
  219. icon: 'contractExpire',
  220. value: this.parseTime(this.form.contractExpire, '{y}-{m}-{d}')
  221. },
  222. ]
  223. this.loading =false;
  224. }
  225. })
  226. },
  227. formartForm(res) {
  228. if (this.$route.query) {
  229. this.form.userId = this.$route.query.userId
  230. this.form.nickName = this.$route.query.nickName
  231. }
  232. let postArr = [];
  233. for (let post of res.posts) {
  234. for (let postid of res.postIds) {
  235. if (postid == post.postId) {
  236. postArr.push(post.postName)
  237. }
  238. }
  239. }
  240. this.postData = postArr.join('/')
  241. },
  242. handleClick() {
  243. },
  244. goBack() {
  245. let obj = { path: "/staff/info" }
  246. this.$tab.closeOpenPage(obj);
  247. this.$router.push({ path: '/oa/staff/people' });
  248. },
  249. getAgeByIdCard(idCard) {
  250. const sexAndAge = {}
  251. //获取用户身份证号码
  252. const userCard = idCard
  253. //如果用户身份证号码为undefined则返回空
  254. if (!userCard) {
  255. return sexAndAge
  256. }
  257. // 获取出生日期
  258. const yearBirth = userCard.substring(6, 10)
  259. const monthBirth = userCard.substring(10, 12)
  260. const dayBirth = userCard.substring(12, 14)
  261. // 获取当前年月日并计算年龄
  262. const myDate = new Date()
  263. const monthNow = myDate.getMonth() + 1
  264. const dayNow = myDate.getDate()
  265. let age = myDate.getFullYear() - yearBirth
  266. if (monthNow < monthBirth || (monthNow == monthBirth && dayNow < dayBirth)) {
  267. age--
  268. }
  269. // 得到年龄
  270. sexAndAge.age = age
  271. return sexAndAge.age
  272. },
  273. }
  274. }
  275. </script>
  276. <style lang="scss" scoped>
  277. .bg {
  278. background-color: #F0F2F5;
  279. }
  280. .header {
  281. background-color: #fff;
  282. height: 110px;
  283. display: flex;
  284. align-items: center;
  285. .back {
  286. margin-left: 30px;
  287. flex: 1;
  288. }
  289. .title {
  290. text-align: center;
  291. flex: 24;
  292. font-size: 25px;
  293. padding-right: 100px;
  294. }
  295. }
  296. .userInfo {
  297. background-color: #fff;
  298. height: 900px;
  299. margin-right: 40px;
  300. padding: 5px;
  301. .avatar {
  302. text-align: center;
  303. // padding: 10px 0;
  304. .user-avatar {
  305. width: 130px;
  306. height: 130px;
  307. border-radius: 50%;
  308. }
  309. }
  310. .user-name {
  311. font-size: 18px;
  312. font-weight: bold;
  313. }
  314. .user-sex {
  315. line-height: 30px;
  316. font-size: 14px;
  317. color: #797979;
  318. }
  319. .info-item {
  320. line-height: 30px;
  321. color: #5A5A5A;
  322. font-size: 14px;
  323. padding-left: 30px;
  324. display: flex;
  325. align-items: flex-start;
  326. .info-icon {
  327. font-size: 20px;
  328. margin-right: 10px;
  329. vertical-align: middle;
  330. }
  331. .item-label {
  332. max-width: 150px;
  333. display: flex;
  334. align-items: center;
  335. font-family: '微软雅黑';
  336. font-weight: bold;
  337. // text-align: right;
  338. // display: inline-block;
  339. }
  340. .item-value {
  341. max-width: 260px;
  342. // display: inline-block;
  343. }
  344. }
  345. }
  346. .stateInfo {
  347. background-color: #fff;
  348. height: 900px;
  349. overflow-y: scroll;
  350. padding: 10px 30px 0;
  351. }
  352. </style>