personal_information_peixun.vue 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679
  1. <template>
  2. <view>
  3. <view class="content" v-if="user_info">
  4. <view class="user">
  5. <view class="left">
  6. <view class="line name">{{user_info.name}} <text
  7. style="font-size: 34rpx;margin-left: 100rpx;">{{staff_num}}</text> </view>
  8. <view class="line">
  9. <view class="item" style="width: 110rpx;">
  10. <view class="label">年龄</view>
  11. <view class="box">{{user_info.age}}岁</view>
  12. </view>
  13. <view class="item" style="width: 110rpx;">
  14. <view class="label">性别</view>
  15. <view class="box">{{user_info.sex}}</view>
  16. </view>
  17. <view class="item">
  18. <view class="label">出生年月</view>
  19. <view class="box">{{user_info.birthday}}</view>
  20. </view>
  21. </view>
  22. </view>
  23. <view class="right">
  24. <view class="img">
  25. <image :src="user_info.photo_pic" mode="aspectFill"></image>
  26. </view>
  27. </view>
  28. </view>
  29. <view class="inner">
  30. <view class="line">
  31. <view class="item">
  32. <view class="label">学历</view>
  33. <view class="box">{{user_info.edu_as}}</view>
  34. </view>
  35. <view class="item">
  36. <view class="label">职务/岗位</view>
  37. <view class="box">{{user_info.job_as}}</view>
  38. </view>
  39. </view>
  40. <view class="line">
  41. <view class="item">
  42. <view class="label">职称/技能等级</view>
  43. <view class="box">{{user_info.jnjdclass}}</view>
  44. </view>
  45. <view class="item">
  46. <view class="label">身体状况</view>
  47. <view class="box">{{user_info.daltonism}}</view>
  48. </view>
  49. <view class="item">
  50. <view class="label">参加工作时间</view>
  51. <view class="box">{{user_info.attend_work_time}}</view>
  52. </view>
  53. </view>
  54. <view class="line">
  55. <view class="item">
  56. <view class="label">进入本企业时间</view>
  57. <view class="box">{{user_info.access_sh_time}}</view>
  58. </view>
  59. <view class="item">
  60. <view class="label">所在部门/区队</view>
  61. <view class="box">{{user_info.org_name}}</view>
  62. </view>
  63. </view>
  64. </view>
  65. </view>
  66. <view class="tab_content" v-if="user_info">
  67. <view class="tab">
  68. <!-- <view class="item" v-for="(item,index) in 7" :key="index" @click="tab(index)">
  69. <image v-if="index == 0" src="./icon/icon_1.png" mode=""></image>
  70. <image v-if="index == 1" src="./icon/icon_2.png" mode=""></image>
  71. <image v-if="index == 2" src="./icon/icon_3.png" mode=""></image>
  72. <image v-if="index == 3" src="./icon/icon_4.png" mode=""></image>
  73. <image v-if="index == 4" src="./icon/icon_5.png" mode=""></image>
  74. <image v-if="index == 5" src="./icon/icon_6.png" mode=""></image>
  75. <image v-if="index == 6" src="./icon/icon_7.png" mode=""></image>
  76. </view> -->
  77. <view class="item" :class="active == index? 'active' : ''" v-for="(item,index) in 5" :key="index"
  78. @click="tab(index)">
  79. <view class="img">
  80. <image v-if="index == 0" src="./icon/icon_1.png" mode=""></image>
  81. <image v-if="index == 1" src="./icon/icon_2.png" mode=""></image>
  82. <image v-if="index == 2" src="./icon/icon_3.png" mode=""></image>
  83. <image v-if="index == 3" src="./icon/icon_4.png" mode=""></image>
  84. <image v-if="index == 4" src="./icon/icon_5.png" mode=""></image>
  85. <image v-if="index == 5" src="./icon/icon_6.png" mode=""></image>
  86. </view>
  87. <view class="text" v-if="index == 0">培训情况</view>
  88. <view class="text" v-if="index == 1">违章记录</view>
  89. <view class="text" v-if="index == 2">持证记录</view>
  90. <view class="text" v-if="index == 3">考试记录</view>
  91. <view class="text" v-if="index == 4">工作简历</view>
  92. <view class="text" v-if="index == 5">个人证件</view>
  93. </view>
  94. </view>
  95. <view class="content">
  96. <view class="list list_1" v-if="active == 0">
  97. <view class="item label_box">
  98. <view class="label text_1">培训时间</view>
  99. <view class="label text_2">培训项目</view>
  100. <view class="label text_3">培训地点</view>
  101. <view class="label text_4">考核情况</view>
  102. </view>
  103. <view class="item" v-for="(item,index) in list" :key="index">
  104. <view class="text_1">{{item.start_time}}</view>
  105. <view class="text_2">{{item.px_project_name}}</view>
  106. <view class="text_3">{{item.px_address}}</view>
  107. <view class="text_4">{{item.score}}</view>
  108. </view>
  109. </view>
  110. <view class="list list_2" v-if="active == 1">
  111. <view class="item label_box">
  112. <view class="label text_1">违章日期</view>
  113. <view class="label text_2">行为描述</view>
  114. <view class="label text_3">风险等级</view>
  115. <view class="label text_4">矫正措施</view>
  116. <view class="label text_5">负责人签字</view>
  117. </view>
  118. <view class="item" v-for="(item,index) in list" :key="index">
  119. <view class="text_1">{{item.unsafe_time}}</view>
  120. <view class="text_2">{{item.context}}</view>
  121. <view class="text_3">{{item.level_name}}</view>
  122. <view class="text_4">{{item.safe_method}}</view>
  123. <view class="text_5">{{item.resp_user}}</view>
  124. </view>
  125. </view>
  126. <view class="list list_3" v-if="active == 2">
  127. <view class="item label_box">
  128. <view class="label text_1">发证机关</view>
  129. <view class="label text_2">证件名称</view>
  130. <view class="label text_3">取证日期</view>
  131. <view class="label text_4">有效时间至</view>
  132. </view>
  133. <view class="item" v-for="(item,index) in list" :key="index">
  134. <view class="text_1">{{item.organzation}}</view>
  135. <view class="text_2">{{item.name}}</view>
  136. <view class="text_3">{{item.gain_time}}</view>
  137. <view class="text_4">{{item.end_time}}</view>
  138. </view>
  139. </view>
  140. <view class="list list_4" v-if="active == 3">
  141. <view class="item label_box">
  142. <view class="label text_1">考试名称</view>
  143. <view class="label text_2">考试时间</view>
  144. <view class="label text_3">考试限时</view>
  145. <view class="label text_4">考试总分</view>
  146. <view class="label text_5">考试成绩</view>
  147. </view>
  148. <view class="item" v-for="(item,index) in list" :key="index">
  149. <view class="text_1">{{item.name}}</view>
  150. <view class="text_2">{{item.exam_time}}</view>
  151. <view class="text_3">{{item.time}}</view>
  152. <view class="text_4">{{item.total_score}}分</view>
  153. <view class="text_5">{{item.score}}分</view>
  154. </view>
  155. </view>
  156. <view class="list list_5" v-if="active == 4">
  157. <view class="item label_box">
  158. <view class="label text_1">个人工作简历</view>
  159. </view>
  160. <view class="item" v-for="(item,index) in list" :key="index">
  161. <view class="text_1">{{item.begda}} 到 {{item.endda}} {{item.works}}</view>
  162. </view>
  163. </view>
  164. <!-- 荣誉及证书 -->
  165. <view class="honor" v-if="active == 5">
  166. <view class="item" v-for="(item,index) in honor" :key="index" @click="click_image(index,item.path)">
  167. <view class="img">
  168. <image :src="item.path" mode="aspectFill"></image>
  169. </view>
  170. <view class="text">{{item.imageName}}</view>
  171. </view>
  172. <view class="item">
  173. <view class="img">
  174. <view class="add" @click="add_image()">+</view>
  175. </view>
  176. <view class="text"></view>
  177. </view>
  178. </view>
  179. </view>
  180. </view>
  181. </view>
  182. </template>
  183. <script>
  184. import {
  185. set_base_url
  186. } from '@/common/set_base_url.js'
  187. export default {
  188. data() {
  189. return {
  190. mine_code: "",
  191. active: 0,
  192. staff_num: '',
  193. user_info: null,
  194. list: null,
  195. base_url: "",
  196. honor: []
  197. };
  198. },
  199. onLoad() {
  200. // #ifdef H5
  201. function GetQueryString(name) {
  202. var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)");
  203. var r = window.location.href.substr(1).match(reg);
  204. if (r != null) return unescape(r[2]);
  205. return null;
  206. }
  207. // 调用方法
  208. // alert(GetQueryString("参数名1"));
  209. // alert(GetQueryString("参数名2"));
  210. if(window.location.href.indexOf('oa=fanwei') != -1){
  211. if(uni.getStorageSync('Authorization')){
  212. // 初始化当前煤矿编码
  213. this.mine_code = uni.getStorageSync('mine_code')
  214. // 根据矿编码切换首页接口不同的请求基础路径
  215. this.base_url = set_base_url(this.mine_code)
  216. this.staff_num = uni.getStorageSync('user').staff_num
  217. this.get_examination_get_detail()
  218. }else{
  219. this.$api.oauth_sso({
  220. url: window.location.href
  221. }).then((res) => {
  222. uni.setStorageSync('Authorization', res.data.data.accessToken)
  223. uni.setStorageSync('token_type', res.data.data.token_type)
  224. // 存储用户基本信息
  225. uni.setStorageSync('user', res.data.data.user);
  226. uni.setStorageSync('people_code', res.data.data.user.people_code);
  227. // 存储电话号码
  228. uni.setStorageSync('mobile', res.data.data.user.mobile);
  229. window.location.reload()
  230. })
  231. }
  232. }else{
  233. // 初始化当前煤矿编码
  234. this.mine_code = uni.getStorageSync('mine_code')
  235. // 根据矿编码切换首页接口不同的请求基础路径
  236. this.base_url = set_base_url(this.mine_code)
  237. this.staff_num = uni.getStorageSync('user').staff_num
  238. this.get_examination_get_detail()
  239. }
  240. // #endif
  241. // #ifdef APP-PLUS
  242. // 初始化当前煤矿编码
  243. this.mine_code = uni.getStorageSync('mine_code')
  244. // 根据矿编码切换首页接口不同的请求基础路径
  245. this.base_url = set_base_url(this.mine_code)
  246. this.staff_num = uni.getStorageSync('user').staff_num
  247. this.get_examination_get_detail()
  248. // #endif
  249. },
  250. methods: {
  251. tab(index) {
  252. console.log(index + 1)
  253. this.list = []
  254. this.active = index
  255. this.$api.examination_get_detail({
  256. staff_num: this.staff_num,
  257. type: index + 1
  258. }).then((res) => {
  259. console.log(res.data.content.data)
  260. this.list = res.data.content.data.list
  261. if (index == 5) {
  262. this.honor = JSON.parse(res.data.content.data.list.honor)
  263. }
  264. })
  265. },
  266. get_examination_get_detail() {
  267. this.$api.examination_get_detail({
  268. staff_num: this.staff_num,
  269. type: 1
  270. }).then((res) => {
  271. console.log(res.data.content.data)
  272. this.user_info = res.data.content.data.user_info
  273. this.list = res.data.content.data.list
  274. })
  275. },
  276. // 新增荣誉
  277. add_image() {
  278. const data = {
  279. base_url: this.base_url,
  280. honor_list: this.honor
  281. }
  282. uni.navigateTo({
  283. url: "./honor/honor",
  284. success: (res) => {
  285. // 通过eventChannel向被打开页面传送数据
  286. res.eventChannel.emit('acceptDataFromOpenerPage', {
  287. data: data
  288. })
  289. }
  290. })
  291. },
  292. click_image(index, path) {
  293. console.log(index, path)
  294. uni.showActionSheet({
  295. itemList: ['查看', '删除'],
  296. success: (res) => {
  297. if (res.tapIndex == 0) {
  298. console.log('选中了第' + (res.tapIndex + 1) + '个按钮');
  299. uni.previewImage({
  300. urls: path.split(','),
  301. });
  302. } else if (res.tapIndex == 1) {
  303. console.log('选中了第' + (res.tapIndex + 1) + '个按钮');
  304. console.log(index)
  305. this.honor.splice(index, 1)
  306. console.log(this.honor)
  307. this.$api.user_updateUserMessage({
  308. honor: JSON.stringify(this.honor)
  309. }).then((res) => {
  310. console.log(res)
  311. uni.showToast({
  312. icon: "none",
  313. title: "删除成功"
  314. })
  315. })
  316. }
  317. },
  318. fail: (res) => {
  319. console.log(res.errMsg);
  320. }
  321. })
  322. },
  323. }
  324. }
  325. </script>
  326. <style lang="scss">
  327. .content {
  328. background-color: #009fe8;
  329. box-sizing: border-box;
  330. padding: 25rpx;
  331. .line {
  332. color: #FFFFFF;
  333. border-bottom: 2rpx dashed #C4EDFF;
  334. overflow: hidden;
  335. box-sizing: border-box;
  336. padding: 20rpx 0;
  337. .item {
  338. float: left;
  339. margin-right: 5rpx;
  340. width: 230rpx;
  341. .label {
  342. font-size: 28rpx;
  343. opacity: 0.9;
  344. margin-bottom: 8rpx;
  345. }
  346. .box {
  347. font-size: 30rpx;
  348. font-weight: 700;
  349. white-space: nowrap;
  350. // overflow: hidden;
  351. // text-overflow: ellipsis;
  352. }
  353. }
  354. .item:last-child {
  355. margin-right: 0;
  356. }
  357. }
  358. .user {
  359. display: flex;
  360. justify-content: space-between;
  361. .left {
  362. width: 470rpx;
  363. .name {
  364. font-size: 60rpx;
  365. font-weight: 700;
  366. }
  367. }
  368. .right {
  369. width: 200rpx;
  370. .img {
  371. image {
  372. width: 200rpx;
  373. height: 250rpx;
  374. }
  375. }
  376. }
  377. }
  378. }
  379. .tab_content {
  380. padding-top: 20rpx;
  381. background-color: #009fe8;
  382. .tab {
  383. margin: 0 auto;
  384. width: 590rpx;
  385. display: flex;
  386. justify-content: space-around;
  387. // .item{
  388. // width: 90rpx;
  389. // height: 82rpx;
  390. // background-color: #FFFFFF;
  391. // text-align: center;
  392. // border-radius: 0 20rpx 0 0;
  393. // image{
  394. // margin-top: 20rpx;
  395. // width: 44rpx;
  396. // height: 44rpx;
  397. // }
  398. // }
  399. .item {
  400. width: 116rpx;
  401. background-color: #FFFFFF;
  402. text-align: center;
  403. border-radius: 0 20rpx 0 0;
  404. .img {
  405. -webkit-filter: grayscale(100%);
  406. /* Chrome, Safari, Opera */
  407. filter: grayscale(100%);
  408. image {
  409. margin-top: 20rpx;
  410. width: 44rpx;
  411. height: 44rpx;
  412. }
  413. }
  414. .text {
  415. font-size: 24rpx;
  416. color: #848484;
  417. }
  418. }
  419. .active {
  420. .img {
  421. -webkit-filter: none;
  422. /* Chrome, Safari, Opera */
  423. filter: none;
  424. image {
  425. margin-top: 10rpx;
  426. width: 54rpx;
  427. height: 54rpx;
  428. }
  429. }
  430. .text {
  431. color: #009fe8;
  432. font-size: 26rpx;
  433. font-weight: 700;
  434. }
  435. }
  436. }
  437. .content {
  438. padding: 0;
  439. background-color: #FFFFFF;
  440. border-radius: 16rpx 16rpx 0 0;
  441. padding-top: 20rpx;
  442. .list {
  443. .item {
  444. display: flex;
  445. justify-content: space-around;
  446. align-items: center;
  447. text-align: center;
  448. padding: 20rpx 0;
  449. line-height: 36rpx;
  450. font-size: 26rpx;
  451. border-bottom: 2rpx dashed #DCDCDC;
  452. .text_1 {
  453. width: 130rpx;
  454. }
  455. .text_2 {
  456. width: 190rpx;
  457. }
  458. .text_3 {
  459. width: 130rpx;
  460. }
  461. .text_4 {
  462. width: 130rpx;
  463. }
  464. }
  465. .label_box {
  466. background-color: #DCDCDC;
  467. display: flex;
  468. justify-content: space-around;
  469. align-items: center;
  470. height: 60rpx;
  471. .label {
  472. color: #999999;
  473. font-size: 26rpx;
  474. font-weight: 700;
  475. }
  476. }
  477. }
  478. .list_2 {
  479. .item {
  480. .text_1 {
  481. width: 130rpx;
  482. }
  483. .text_2 {
  484. width: 180rpx;
  485. }
  486. .text_3 {
  487. width: 100rpx;
  488. }
  489. .text_4 {
  490. width: 100rpx;
  491. }
  492. .text_5 {
  493. width: 140rpx;
  494. }
  495. }
  496. .label_box {
  497. .label {
  498. font-size: 24rpx;
  499. }
  500. }
  501. }
  502. .list_3 {
  503. .item {
  504. .text_1 {
  505. width: 160rpx;
  506. }
  507. .text_2 {
  508. width: 180rpx;
  509. }
  510. .text_3 {
  511. width: 130rpx;
  512. }
  513. .text_4 {
  514. width: 130rpx;
  515. }
  516. }
  517. }
  518. .list_4 {
  519. .item {
  520. .text_1 {
  521. width: 180rpx;
  522. }
  523. .text_2 {
  524. width: 130rpx;
  525. }
  526. .text_3 {
  527. width: 100rpx;
  528. }
  529. .text_4 {
  530. width: 100rpx;
  531. }
  532. .text_5 {
  533. width: 100rpx;
  534. }
  535. }
  536. .label_box {
  537. .label {
  538. font-size: 24rpx;
  539. }
  540. }
  541. }
  542. .list_5 {
  543. .item {
  544. .text_1 {
  545. width: 700rpx;
  546. font-size: 28rpx;
  547. }
  548. }
  549. }
  550. .honor {
  551. box-sizing: border-box;
  552. padding: 50rpx;
  553. overflow: hidden;
  554. .item {
  555. float: left;
  556. margin-right: 50rpx;
  557. margin-bottom: 30rpx;
  558. width: 300rpx;
  559. text-align: center;
  560. .img {
  561. margin-bottom: 10rpx;
  562. image {
  563. width: 300rpx;
  564. height: 180rpx;
  565. }
  566. .add {
  567. font-size: 140rpx;
  568. color: #DCDCDC;
  569. text-align: center;
  570. height: 180rpx;
  571. line-height: 160rpx;
  572. background-color: #EEEEEE;
  573. }
  574. }
  575. .text {
  576. width: 260rpx;
  577. font-size: 30rpx;
  578. color: #8e8e8e;
  579. overflow: hidden;
  580. white-space: nowrap;
  581. text-overflow: ellipsis;
  582. }
  583. }
  584. .item:nth-child(2n) {
  585. margin-right: 0;
  586. }
  587. }
  588. }
  589. }
  590. </style>