personal_information_peixun.vue 14 KB

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