123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670 |
- <template>
- <view>
- <view class="top">
- <view class="avatar" @click="change_avatar(info.avatar)">
- <image v-if="info.avatar" :src="info.avatar" mode="aspectFill"></image>
- <view class="avatar" v-if="!info.avatar && !info" :style="{backgroundColor:bgColor[1]}">
- {{info.name.split('').pop()}}
- </view>
- </view>
- <view class="info">
- <view class="name">{{info.name}}</view>
- <view class="box">
- <view class="item">
- <view class="label">部门</view>
- <view class="text">{{info.section_fullname}}</view>
- </view>
- <view class="item">
- <view class="label">职务</view>
- <view class="text">{{info.duty_num}}</view>
- </view>
- <view class="item">
- <view class="label">员工编号</view>
- <view class="text">{{info.staff_num}}</view>
- </view>
- </view>
- </view>
- </view>
- <view class="content">
- <view class="box">
- <view class="item" @click="change_active(1)">
- <view class="text" :style="{color:active == 1?'#333':'#8e8e8e'}">个人信息</view>
- <view class="line" v-if="active == 1"></view>
- </view>
- <view class="item" @click="change_active(2)">
- <view class="text" :style="{color:active == 2?'#333':'#8e8e8e'}">工作经历</view>
- <view class="line" v-if="active == 2"></view>
- </view>
- <view class="item" @click="change_active(3)">
- <view class="text" :style="{color:active == 3?'#333':'#8e8e8e'}">荣誉及证书</view>
- <view class="line" v-if="active == 3"></view>
- </view>
- </view>
- <!-- 个人信息 -->
- <view class="list_1" v-if="active == 1">
- <view class="item" @click="binding_phone()">
- <view class="label">手机号</view>
- <view class="text">{{info.mobile}}</view>
- <view class="right">
- <uni-icons type="arrowright"></uni-icons>
- </view>
- </view>
- <view class="item" @click="go_qianming()">
- <view class="label">手写签名</view>
- <view class="text">
- <image :src="info.base_img" style="width: 300rpx;height: 120rpx;" mode="aspectFill"></image>
- </view>
- <view class="right">
- <uni-icons type="arrowright"></uni-icons>
- </view>
- </view>
- <view class="item">
- <view class="label">岗位分类</view>
- <view class="text">{{info.job_classify}}</view>
- <view class="right"></view>
- </view>
- <view class="item">
- <view class="label">岗位</view>
- <view class="text">{{info.job}}</view>
- <view class="right"></view>
- </view>
- <view class="item">
- <view class="label">职级(职务码)</view>
- <view class="text">{{info.duty_num}}</view>
- <view class="right"></view>
- </view>
- <view class="item">
- <view class="label">性别</view>
- <view class="text" v-if="info.sex == 1">男</view>
- <view class="text" v-if="info.sex == 0">女</view>
- <view class="right"></view>
- </view>
- <view class="item">
- <view class="label">初始学历</view>
- <view class="text">{{info.start_education}}</view>
- <view class="right"></view>
- </view>
- <view class="item">
- <view class="label">最高学历</view>
- <view class="text">{{info.best_education}}</view>
- <view class="right"></view>
- </view>
- <view class="item">
- <view class="label">员工组</view>
- <view class="text">{{info.group}}</view>
- <view class="right"></view>
- </view>
- <view class="item">
- <view class="label">员工子组</view>
- <view class="text">{{info.group_sub}}</view>
- <view class="right"></view>
- </view>
- <view class="item">
- <view class="label">籍贯</view>
- <view class="text">{{info.native}}</view>
- <view class="right"></view>
- </view>
- <view class="item">
- <view class="label">宗教信仰</view>
- <view class="text">{{info.faith}}</view>
- <view class="right"></view>
- </view>
- <view class="item">
- <view class="label">户口性质</view>
- <view class="text">{{info.registered}}</view>
- <view class="right"></view>
- </view>
- <view class="item">
- <view class="label">民族</view>
- <view class="text">{{info.nation}}</view>
- <view class="right"></view>
- </view>
- <view class="item">
- <view class="label">出生日期</view>
- <view class="text">{{info.birthday}}</view>
- <view class="right"></view>
- </view>
- <view class="item">
- <view class="label">身份证号</view>
- <view class="text">{{info.identity_card}}</view>
- <view class="right"></view>
- </view>
- <view class="item">
- <view class="label">参加工作时间</view>
- <view class="text">{{info.working_date}}</view>
- <view class="right"></view>
- </view>
- <view class="item">
- <view class="label">进入神华系统时间</view>
- <view class="text">{{info.system_date}}</view>
- <view class="right"></view>
- </view>
- <view class="item">
- <view class="label">进入子分公司时间</view>
- <view class="text">{{info.system_sub_date}}</view>
- <view class="right"></view>
- </view>
- <view class="item">
- <view class="label">进入本单位时间</view>
- <view class="text">{{info.section_date}}</view>
- <view class="right"></view>
- </view>
- <view class="item">
- <view class="label">政治面貌</view>
- <view class="text">{{info.politics}}</view>
- <view class="right"></view>
- </view>
- <view class="item">
- <view class="label">参加党派时间</view>
- <view class="text">{{info.politics_date}}</view>
- <view class="right"></view>
- </view>
- </view>
- <!-- 工作经历 -->
- <view class="list_2" v-if="active == 2">
- <view class="item">
- <view class="text_1">任职时间</view>
- <view class="text_2">工作单位</view>
- <view class="text_3">职务</view>
- </view>
- <view class="item" v-for="(item,index) in info.work_experience" :key="index" @click="del_job(index)">
- <view class="text_1">{{item.range_text}}</view>
- <view class="text_2">{{item.job_unit}}</view>
- <view class="text_3">{{item.job_post}}</view>
- </view>
- <view class="item" @click="add_text()">
- <view style="margin: 0 auto;">
- <uni-icons type="compose" size="24"></uni-icons>
- </view>
- </view>
- </view>
- <!-- 荣誉及证书 -->
- <view class="list_3" v-if="active == 3">
- <view class="item" v-for="(item,index) in info.honor" :key="index"
- @click="click_image(index,item.path)">
- <view class="img">
- <image :src="item.path" mode="aspectFill"></image>
- </view>
- <view class="text">{{item.imageName}}</view>
- </view>
- <view class="item">
- <view class="img">
- <view class="add" @click="add_image()">+</view>
- </view>
- <view class="text"></view>
- </view>
- </view>
- </view>
- </view>
- </template>
- <script>
- import {set_base_url} from '@/common/set_base_url.js'
-
- export default {
- data() {
- return {
- mine_code:"",
- base_url: "",
- active: 1,
- info: {},
- // 头像随机色
- bgColor: [],
- };
- },
- onLoad() {
- // 初始化当前煤矿编码
- this.mine_code = uni.getStorageSync('mine_code')
- // 根据矿编码切换首页接口不同的请求基础路径
- this.base_url = set_base_url(this.mine_code)
-
- // 设置头像
- for (let i = 0; i < 2; i++) {
- // 获取随机色
- let r = parseInt(Math.random() * 256)
- let g = parseInt(Math.random() * 256)
- let b = parseInt(Math.random() * 256)
- // ES6 字符串拼接
- // this.bgColor = `rgba(${r},${g},${b},0.3)`
- let color = "rgba(" + r + "," + g + "," + b + "," + 0.3 + ")"
- // console.log(color)
- this.bgColor.push(color)
- }
- },
- onShow() {
- this.get_info()
- },
- methods: {
- change_active(index) {
- this.active = index
- },
- // 获取个人信息
- get_info() {
- this.$api.user_getUinfo({
- staff_num: uni.getStorageSync('user').staff_num
- }).then((res) => {
- // console.log(res.data.data)
- this.info = res.data.data
- this.info.work_experience = JSON.parse(res.data.data.work_experience)
- this.info.honor = JSON.parse(res.data.data.honor)
- })
- },
- // 新增工作经历
- add_text() {
- const data = {
- work_experience: this.info.work_experience
- }
- uni.navigateTo({
- url: "./job_record/job_record",
- success: (res) => {
- // 通过eventChannel向被打开页面传送数据
- res.eventChannel.emit('acceptDataFromOpenerPage', {
- data: data
- })
- }
- })
- },
- del_job(index) {
- uni.showActionSheet({
- itemList: ['删除'],
- success: (res) => {
- this.info.work_experience.splice(index, 1)
- this.$api.user_updateUserMessage({
- work_experience: JSON.stringify(this.info.work_experience)
- }).then((res) => {
- console.log(res)
- uni.showToast({
- icon: "none",
- title: "删除成功"
- })
- })
- },
- fail: (res) => {
- console.log(res.errMsg);
- }
- });
- },
- // 新增荣誉
- add_image() {
- const data = {
- base_url: this.base_url,
-
- honor_list: this.info.honor
- }
- uni.navigateTo({
- url: "./honor/honor",
- success: (res) => {
- // 通过eventChannel向被打开页面传送数据
- res.eventChannel.emit('acceptDataFromOpenerPage', {
- data: data
- })
- }
- })
- },
- click_image(index, path) {
- console.log(index, path)
- uni.showActionSheet({
- itemList: ['查看', '删除'],
- success: (res) => {
- if (res.tapIndex == 0) {
- console.log('选中了第' + (res.tapIndex + 1) + '个按钮');
- uni.previewImage({
- urls: path.split(','),
- });
- } else if (res.tapIndex == 1) {
- console.log('选中了第' + (res.tapIndex + 1) + '个按钮');
- console.log(index)
- this.info.honor.splice(index, 1)
- console.log(this.info.honor)
- this.$api.user_updateUserMessage({
- honor: JSON.stringify(this.info.honor)
- }).then((res) => {
- console.log(res)
- uni.showToast({
- icon: "none",
- title: "删除成功"
- })
- })
- }
- },
- fail: (res) => {
- console.log(res.errMsg);
- }
- })
- },
- // 更换头像
- change_avatar() {
- uni.showActionSheet({
- itemList: ['更换头像'],
- success: (res) => {
- uni.chooseImage({
- count: 1,
- success: (chooseImageRes) => {
- const tempFilePaths = chooseImageRes.tempFilePaths;
- console.log(chooseImageRes.tempFiles[0]);
- uni.showLoading({
- mask: true,
- title: "上传中..."
- })
-
- uni.uploadFile({
- url: this.base_url + "/worksheet/design/up_images",
- header: {
- 'Authorization': uni.getStorageSync('token_type') +' '+uni.getStorageSync('Authorization')
- },
- filePath: tempFilePaths[0],
- name: 'file',
- // formData只有H5存在
- formData: {
- image: chooseImageRes.tempFiles[0]
- },
- success: (uploadFileRes) => {
-
- console.log(JSON.parse(uploadFileRes.data));
- const data = JSON.parse(uploadFileRes.data).data
- if (!this.info.avatar) {
- this.info.avatar = data.path
- } else {
- this.info.avatar = data.path
- }
- console.log(this.info.avatar)
- this.$api.user_updateUserMessage({
- avatar: this.info.avatar
- }).then((res) => {
- console.log(res)
-
- uni.hideLoading()
-
- uni.showToast({
- icon: "none",
- title: "更换成功"
- })
- })
-
-
- }
- })
- }
- })
- },
- fail: (res) => {
- console.log(res.errMsg);
- }
- })
- },
-
-
- // 绑定手机
- binding_phone(){
- uni.navigateTo({
- url:"../setPhone/setPhone"
- })
- },
- go_qianming(){
- uni.navigateTo({
- url:"../signature/signature"
- })
- }
- }
- }
- </script>
- <style lang="scss">
- page {
- background-color: #F5F8F8;
- }
- .top {
- position: relative;
- background-color: #FFFFFF;
- width: 750rpx;
- height: 490rpx;
- background-image: url(./icon/top.png);
- background-size: 100% 100%;
- background-position: 0 -110rpx;
- background-repeat: no-repeat;
- .avatar {
- padding-top: 70rpx;
- text-align: center;
- image {
- width: 200rpx;
- height: 200rpx;
- border-radius: 50%;
- }
- }
- .info {
- margin-top: 20rpx;
- .name {
- text-align: center;
- font-size: 40rpx;
- font-weight: 700;
- }
- .box {
- margin-top: 30rpx;
- display: flex;
- justify-content: space-around;
- .item {
- width: 250rpx;
- text-align: center;
- .label {
- font-size: 30rpx;
- color: #009FE8;
- margin-bottom: 10rpx;
- }
- .text {
- font-size: 32rpx;
- }
- }
- }
- }
- .redo {
- width: 100rpx;
- height: 100rpx;
- line-height: 100rpx;
- text-align: center;
- position: absolute;
- top: 0;
- right: 0;
- }
- margin-bottom: 20rpx;
- }
- .content {
- background-color: #FFFFFF;
- .box {
- display: flex;
- justify-content: space-around;
- align-items: center;
- border-bottom: 2rpx solid #F5F8F8;
- .item {
- height: 95rpx;
- width: 230rpx;
- text-align: center;
- position: relative;
- .text {
- font-size: 34rpx;
- line-height: 95rpx;
- }
- .line {
- margin: -6rpx auto 0;
- width: 80rpx;
- height: 6rpx;
- background-color: #009FE8;
- }
- }
- }
- .list_1 {
- box-sizing: border-box;
- padding: 0 50rpx;
- .item {
- border-bottom: 2rpx solid #F5F8F8;
- // height: 95rpx;
- box-sizing: border-box;
- padding: 30rpx 0;
- display: flex;
- // justify-content: space-between;
- justify-content: space-between;
- align-items: center;
- font-size: 32rpx;
- .label {
- width: 300rpx;
- text-align: left;
- }
- .text {
- width: 300rpx;
- text-align: left;
- color: #8e8e8e;
- }
- .right {
- // width: 100rpx;
- text-align: right;
- }
- }
- }
- .list_2 {
- box-sizing: border-box;
- padding: 0 50rpx;
- .item {
- border-bottom: 2rpx solid #F5F8F8;
- // height: 95rpx;
- box-sizing: border-box;
- padding: 20rpx 0;
- display: flex;
- justify-content: space-between;
- align-items: center;
- font-size: 28rpx;
- text-align: center;
- color: #8e8e8e;
- .text_1 {
- width: 190rpx;
- }
- .text_2 {
- width: 240rpx;
- }
- .text_3 {
- width: 160rpx;
- }
- }
- .item:first-child {
- font-size: 32rpx;
- color: #333;
- }
- }
- .list_3 {
- box-sizing: border-box;
- padding: 50rpx;
- overflow: hidden;
- .item {
- float: left;
- margin-right: 50rpx;
- margin-bottom: 30rpx;
- width: 300rpx;
- text-align: center;
- .img {
- margin-bottom: 10rpx;
- image {
- width: 300rpx;
- height: 180rpx;
- }
- .add {
- font-size: 140rpx;
- color: #DCDCDC;
- text-align: center;
- height: 180rpx;
- line-height: 160rpx;
- background-color: #EEEEEE;
- }
- }
- .text {
- width: 260rpx;
- font-size: 30rpx;
- color: #8e8e8e;
- overflow: hidden;
- white-space: nowrap;
- text-overflow: ellipsis;
- }
- }
- .item:nth-child(2n) {
- margin-right: 0;
- }
- }
- }
- </style>
|