personal_information_peixun.vue 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675
  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">
  10. <view class="label">年龄</view>
  11. <view class="box">{{user_info.age}}岁</view>
  12. </view>
  13. <view class="item">
  14. <view class="label">性别</view>
  15. <view class="box">{{user_info.sex}}</view>
  16. </view>
  17. </view>
  18. </view>
  19. <view class="right">
  20. <view class="img">
  21. <image :src="user_info.photo_pic" mode="aspectFill"></image>
  22. </view>
  23. </view>
  24. </view>
  25. <view class="inner">
  26. <view class="line">
  27. <view class="item">
  28. <view class="label">学历</view>
  29. <view class="box">{{user_info.edu_as}}</view>
  30. </view>
  31. <view class="item">
  32. <view class="label">职务/岗位</view>
  33. <view class="box">{{user_info.job_as}}</view>
  34. </view>
  35. <!-- <view class="item">
  36. <view class="label">职称</view>
  37. <view class="box">无</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 6" :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. this.$api.oauth_sso({
  212. url: window.location.href
  213. }).then((res) => {
  214. uni.setStorageSync('Authorization', res.data.data.accessToken)
  215. uni.setStorageSync('token_type', res.data.data.token_type)
  216. // 存储用户基本信息
  217. uni.setStorageSync('user', res.data.data.user);
  218. uni.setStorageSync('people_code', res.data.data.user.people_code);
  219. // 存储电话号码
  220. uni.setStorageSync('mobile', res.data.data.user.mobile);
  221. // 初始化当前煤矿编码
  222. this.mine_code = uni.getStorageSync('mine_code')
  223. // 根据矿编码切换首页接口不同的请求基础路径
  224. this.base_url = set_base_url(this.mine_code)
  225. this.staff_num = uni.getStorageSync('user').staff_num
  226. this.get_examination_get_detail()
  227. })
  228. }else{
  229. // 初始化当前煤矿编码
  230. this.mine_code = uni.getStorageSync('mine_code')
  231. // 根据矿编码切换首页接口不同的请求基础路径
  232. this.base_url = set_base_url(this.mine_code)
  233. this.staff_num = uni.getStorageSync('user').staff_num
  234. this.get_examination_get_detail()
  235. }
  236. // #endif
  237. // #ifdef APP-PLUS
  238. // 初始化当前煤矿编码
  239. this.mine_code = uni.getStorageSync('mine_code')
  240. // 根据矿编码切换首页接口不同的请求基础路径
  241. this.base_url = set_base_url(this.mine_code)
  242. this.staff_num = uni.getStorageSync('user').staff_num
  243. this.get_examination_get_detail()
  244. // #endif
  245. },
  246. methods: {
  247. tab(index) {
  248. console.log(index + 1)
  249. this.list = []
  250. this.active = index
  251. this.$api.examination_get_detail({
  252. staff_num: this.staff_num,
  253. type: index + 1
  254. }).then((res) => {
  255. console.log(res.data.content.data)
  256. this.list = res.data.content.data.list
  257. if (index == 5) {
  258. this.honor = JSON.parse(res.data.content.data.list.honor)
  259. }
  260. })
  261. },
  262. get_examination_get_detail() {
  263. this.$api.examination_get_detail({
  264. staff_num: this.staff_num,
  265. type: 1
  266. }).then((res) => {
  267. console.log(res.data.content.data)
  268. this.user_info = res.data.content.data.user_info
  269. this.list = res.data.content.data.list
  270. })
  271. },
  272. // 新增荣誉
  273. add_image() {
  274. const data = {
  275. base_url: this.base_url,
  276. honor_list: this.honor
  277. }
  278. uni.navigateTo({
  279. url: "./honor/honor",
  280. success: (res) => {
  281. // 通过eventChannel向被打开页面传送数据
  282. res.eventChannel.emit('acceptDataFromOpenerPage', {
  283. data: data
  284. })
  285. }
  286. })
  287. },
  288. click_image(index, path) {
  289. console.log(index, path)
  290. uni.showActionSheet({
  291. itemList: ['查看', '删除'],
  292. success: (res) => {
  293. if (res.tapIndex == 0) {
  294. console.log('选中了第' + (res.tapIndex + 1) + '个按钮');
  295. uni.previewImage({
  296. urls: path.split(','),
  297. });
  298. } else if (res.tapIndex == 1) {
  299. console.log('选中了第' + (res.tapIndex + 1) + '个按钮');
  300. console.log(index)
  301. this.honor.splice(index, 1)
  302. console.log(this.honor)
  303. this.$api.user_updateUserMessage({
  304. honor: JSON.stringify(this.honor)
  305. }).then((res) => {
  306. console.log(res)
  307. uni.showToast({
  308. icon: "none",
  309. title: "删除成功"
  310. })
  311. })
  312. }
  313. },
  314. fail: (res) => {
  315. console.log(res.errMsg);
  316. }
  317. })
  318. },
  319. }
  320. }
  321. </script>
  322. <style lang="scss">
  323. .content {
  324. background-color: #009fe8;
  325. box-sizing: border-box;
  326. padding: 25rpx;
  327. .line {
  328. color: #FFFFFF;
  329. border-bottom: 2rpx dashed #C4EDFF;
  330. overflow: hidden;
  331. box-sizing: border-box;
  332. padding: 20rpx 0;
  333. .item {
  334. float: left;
  335. margin-right: 5rpx;
  336. width: 230rpx;
  337. .label {
  338. font-size: 28rpx;
  339. opacity: 0.9;
  340. margin-bottom: 8rpx;
  341. }
  342. .box {
  343. font-size: 30rpx;
  344. font-weight: 700;
  345. white-space: nowrap;
  346. // overflow: hidden;
  347. // text-overflow: ellipsis;
  348. }
  349. }
  350. .item:last-child {
  351. margin-right: 0;
  352. }
  353. }
  354. .user {
  355. display: flex;
  356. justify-content: space-between;
  357. .left {
  358. width: 470rpx;
  359. .name {
  360. font-size: 60rpx;
  361. font-weight: 700;
  362. }
  363. }
  364. .right {
  365. width: 200rpx;
  366. .img {
  367. image {
  368. width: 200rpx;
  369. height: 250rpx;
  370. }
  371. }
  372. }
  373. }
  374. }
  375. .tab_content {
  376. padding-top: 20rpx;
  377. background-color: #009fe8;
  378. .tab {
  379. margin: 0 auto;
  380. width: 700rpx;
  381. display: flex;
  382. justify-content: space-around;
  383. // .item{
  384. // width: 90rpx;
  385. // height: 82rpx;
  386. // background-color: #FFFFFF;
  387. // text-align: center;
  388. // border-radius: 0 20rpx 0 0;
  389. // image{
  390. // margin-top: 20rpx;
  391. // width: 44rpx;
  392. // height: 44rpx;
  393. // }
  394. // }
  395. .item {
  396. width: 116rpx;
  397. background-color: #FFFFFF;
  398. text-align: center;
  399. border-radius: 0 20rpx 0 0;
  400. .img {
  401. -webkit-filter: grayscale(100%);
  402. /* Chrome, Safari, Opera */
  403. filter: grayscale(100%);
  404. image {
  405. margin-top: 20rpx;
  406. width: 44rpx;
  407. height: 44rpx;
  408. }
  409. }
  410. .text {
  411. font-size: 24rpx;
  412. color: #848484;
  413. }
  414. }
  415. .active {
  416. .img {
  417. -webkit-filter: none;
  418. /* Chrome, Safari, Opera */
  419. filter: none;
  420. image {
  421. margin-top: 10rpx;
  422. width: 54rpx;
  423. height: 54rpx;
  424. }
  425. }
  426. .text {
  427. color: #009fe8;
  428. font-size: 26rpx;
  429. font-weight: 700;
  430. }
  431. }
  432. }
  433. .content {
  434. padding: 0;
  435. background-color: #FFFFFF;
  436. border-radius: 16rpx 16rpx 0 0;
  437. padding-top: 20rpx;
  438. .list {
  439. .item {
  440. display: flex;
  441. justify-content: space-around;
  442. align-items: center;
  443. text-align: center;
  444. padding: 20rpx 0;
  445. line-height: 36rpx;
  446. font-size: 26rpx;
  447. border-bottom: 2rpx dashed #DCDCDC;
  448. .text_1 {
  449. width: 130rpx;
  450. }
  451. .text_2 {
  452. width: 190rpx;
  453. }
  454. .text_3 {
  455. width: 130rpx;
  456. }
  457. .text_4 {
  458. width: 130rpx;
  459. }
  460. }
  461. .label_box {
  462. background-color: #DCDCDC;
  463. display: flex;
  464. justify-content: space-around;
  465. align-items: center;
  466. height: 60rpx;
  467. .label {
  468. color: #999999;
  469. font-size: 26rpx;
  470. font-weight: 700;
  471. }
  472. }
  473. }
  474. .list_2 {
  475. .item {
  476. .text_1 {
  477. width: 130rpx;
  478. }
  479. .text_2 {
  480. width: 180rpx;
  481. }
  482. .text_3 {
  483. width: 100rpx;
  484. }
  485. .text_4 {
  486. width: 100rpx;
  487. }
  488. .text_5 {
  489. width: 140rpx;
  490. }
  491. }
  492. .label_box {
  493. .label {
  494. font-size: 24rpx;
  495. }
  496. }
  497. }
  498. .list_3 {
  499. .item {
  500. .text_1 {
  501. width: 160rpx;
  502. }
  503. .text_2 {
  504. width: 180rpx;
  505. }
  506. .text_3 {
  507. width: 130rpx;
  508. }
  509. .text_4 {
  510. width: 130rpx;
  511. }
  512. }
  513. }
  514. .list_4 {
  515. .item {
  516. .text_1 {
  517. width: 180rpx;
  518. }
  519. .text_2 {
  520. width: 130rpx;
  521. }
  522. .text_3 {
  523. width: 100rpx;
  524. }
  525. .text_4 {
  526. width: 100rpx;
  527. }
  528. .text_5 {
  529. width: 100rpx;
  530. }
  531. }
  532. .label_box {
  533. .label {
  534. font-size: 24rpx;
  535. }
  536. }
  537. }
  538. .list_5 {
  539. .item {
  540. .text_1 {
  541. width: 700rpx;
  542. font-size: 28rpx;
  543. }
  544. }
  545. }
  546. .honor {
  547. box-sizing: border-box;
  548. padding: 50rpx;
  549. overflow: hidden;
  550. .item {
  551. float: left;
  552. margin-right: 50rpx;
  553. margin-bottom: 30rpx;
  554. width: 300rpx;
  555. text-align: center;
  556. .img {
  557. margin-bottom: 10rpx;
  558. image {
  559. width: 300rpx;
  560. height: 180rpx;
  561. }
  562. .add {
  563. font-size: 140rpx;
  564. color: #DCDCDC;
  565. text-align: center;
  566. height: 180rpx;
  567. line-height: 160rpx;
  568. background-color: #EEEEEE;
  569. }
  570. }
  571. .text {
  572. width: 260rpx;
  573. font-size: 30rpx;
  574. color: #8e8e8e;
  575. overflow: hidden;
  576. white-space: nowrap;
  577. text-overflow: ellipsis;
  578. }
  579. }
  580. .item:nth-child(2n) {
  581. margin-right: 0;
  582. }
  583. }
  584. }
  585. }
  586. </style>