321 lines
9.6 KiB
Vue
321 lines
9.6 KiB
Vue
<template>
|
||
<view class="app">
|
||
<view class="Commodity" @tap="uploadImag">
|
||
<image class="picture" :src="myimg" mode="" v-if="myimg"></image>
|
||
<image class="picture" :src="baseurl + appPersonallist.avatar" mode="" v-else></image>
|
||
<view class="">
|
||
点击编辑头像
|
||
</view>
|
||
</view>
|
||
<view class="centercontent" v-if="appPersonallist">
|
||
<view class="content">
|
||
<view class="name">
|
||
<span>姓名:</span>
|
||
<input type="text" maxlength="10" placeholder="请输入" v-model="appPersonallist.nickName" disabled />
|
||
</view>
|
||
<view class="name">
|
||
<span>性别:</span>
|
||
<text v-if='appPersonallist.sex'> {{appPersonallist.sex}}
|
||
</text>
|
||
</view>
|
||
<view class="name">
|
||
<span>年龄:</span>
|
||
<input type="text" maxlength="4" placeholder=" " v-model="appPersonallist.age" disabled />
|
||
</view>
|
||
<!-- <view class="name">
|
||
<span class="">
|
||
账号:
|
||
</span>
|
||
</view> -->
|
||
<view class="name">
|
||
<span>手机号:</span>
|
||
<input disabled type="text" maxlength="11" placeholder="请输入" v-model="appPersonallist.phonenumber"
|
||
disabled />
|
||
</view>
|
||
<view class="nursetype" style="">
|
||
<span>家庭住址:</span>
|
||
<text v-if="appPersonallist.address"> {{appPersonallist.address}}
|
||
</text>
|
||
</view>
|
||
<view class="nursetype " style="">
|
||
护理站:
|
||
<text v-for='(uitem,uindex) in appPersonallist.nurseStationSysUserVOList' :key="uindex">
|
||
{{uitem.nurseStationName}}
|
||
<text v-if="uindex!=appPersonallist.nurseStationSysUserVOList.length-1">,</text>
|
||
</text>
|
||
<!-- {{getNurseStationName(appPersonallist)}} -->
|
||
</view>
|
||
<view class="nursetype" @tap='positionalTitleLevelshow=true'>
|
||
<span>职称级别:</span>
|
||
<text v-if="appPersonallist.positionalTitleLevelvalue">
|
||
{{appPersonallist.positionalTitleLevelvalue}}
|
||
</text>
|
||
</view>
|
||
<view class="name" style="">
|
||
擅长项目:
|
||
<input type="text" placeholder=" " v-model="appPersonallist.geniusItem" />
|
||
<!-- <input type="text" v-model="appPersonallist.geniusItem" /> -->
|
||
<!-- <text v-if="appPersonallist.geniusItem"> {{}}
|
||
</text> -->
|
||
</view>
|
||
<view class="nursetype " style="border: none;">
|
||
证书上传:
|
||
<view class="upload" @tap='uploadcertificate' v-if="certificateimg.length==0">
|
||
<view class="">
|
||
<u-icon name="plus" color='#E6E6E6' label='拍摄上传' label-color='#E6E6E6'></u-icon>
|
||
</view>
|
||
</view>
|
||
<view class="rate" v-else>
|
||
<view class="itemimgs" v-for="(item,index) in certificateimg" :key="index">
|
||
<image class="delimg" src="../../static/gb2.png" mode="" @tap='delimg(item)'>
|
||
</image>
|
||
<image class="itemimg" :src="item" mode=""></image>
|
||
</view>
|
||
<view class="item" @tap='uploadcertificate'>
|
||
<image src="../../static/paishe.png" mode=""></image>
|
||
<view class="title">
|
||
拍摄上传
|
||
</view>
|
||
</view>
|
||
</view>
|
||
</view>
|
||
</view>
|
||
</view>
|
||
<view class="finish" @tap="uploadcertificateimgs">保存</view>
|
||
<!-- <u-select v-model="sexshow" :list="sexlist" mode="single-column" @confirm="sexconfirm"></u-select> -->
|
||
<u-select v-model="positionalTitleLevelshow" :list="positionalTitleLevellist" mode="single-column"
|
||
@confirm="positionalTitleLevelconfirm"></u-select>
|
||
<u-toast ref="uToast" />
|
||
</view>
|
||
</template>
|
||
<script>
|
||
import {
|
||
updateNursePersonCheck,
|
||
personNurseStationLists
|
||
} from '@/api/Modifyinformation/Modifyinformation.js';
|
||
import {
|
||
nurseAppletPersonCenter,
|
||
} from '@/api/personnal/personal.js';
|
||
import baseurl from '@/api/baseurl.js'
|
||
export default {
|
||
data() {
|
||
return {
|
||
baseurl: '', //url
|
||
timer: null, //timer
|
||
nursePersonId: null, //护理员id
|
||
// sexshow: false, //性别选择
|
||
// sexlist: [{
|
||
// value: 'MALE',
|
||
// label: '男'
|
||
// },
|
||
// {
|
||
// value: 'FEMALE',
|
||
// label: '女'
|
||
// }
|
||
// ],
|
||
positionalTitleLevelshow: false,
|
||
positionalTitleLevellist: [{
|
||
label: "初级",
|
||
value: "PRIMARY_LEVEL",
|
||
}, {
|
||
label: "中级",
|
||
value: "MIDDLE_LEVEL",
|
||
}, {
|
||
label: "高级",
|
||
value: "HIGH_LEVEL",
|
||
}],
|
||
appPersonallist: {
|
||
nurseStationPersonCheckList: []
|
||
}, //用户信息
|
||
image: false, //判断是否上传头像
|
||
certificateimg: [], //证书img
|
||
myimg: null, //头像img
|
||
uploadcertificateimg: [], //上传的证书img
|
||
}
|
||
},
|
||
computed: {
|
||
// getNurseStationName() {
|
||
// return data => data?.nurseStationSysUserVOList?. [0]?.nurseStationName || ''
|
||
// },
|
||
},
|
||
onShow() {},
|
||
onLoad(options) {
|
||
this.image = false
|
||
this.baseurl = baseurl;
|
||
let that = this
|
||
const value = uni.getStorageSync('nursePersonId');
|
||
if (value) {
|
||
that.nursePersonId = value
|
||
that.myInfo()
|
||
} else {}
|
||
},
|
||
methods: {
|
||
//删除证书图片
|
||
delimg(item) {
|
||
this.certificateimg = this.certificateimg.filter(e => e != item)
|
||
this.uploadcertificateimg = this.uploadcertificateimg.filter(e => e != item)
|
||
this.appPersonallist.nurseStationPersonCertificateList = this.appPersonallist
|
||
.nurseStationPersonCertificateList
|
||
.filter(e => (this.baseurl + e.certificateUrl) != item)
|
||
},
|
||
//上传证书
|
||
uploadcertificate() {
|
||
var that = this;
|
||
uni.chooseImage({
|
||
count: 9,
|
||
success(res) {
|
||
res.tempFilePaths.forEach(e => {
|
||
that.uploadcertificateimg.push(e)
|
||
that.certificateimg.push(e)
|
||
})
|
||
}
|
||
})
|
||
},
|
||
//上传头像
|
||
uploadImag() {
|
||
var that = this;
|
||
uni.chooseImage({
|
||
count: 1,
|
||
success(res) {
|
||
that.image = true
|
||
that.myimg = res.tempFilePaths[0]
|
||
that.appPersonallist.avatar = res.tempFilePaths[0]
|
||
}
|
||
})
|
||
},
|
||
//个人信息
|
||
myInfo() {
|
||
nurseAppletPersonCenter(this.nursePersonId).then(res => {
|
||
res.data.sex == 'MALE' ? res.data.sex = '男' : ''
|
||
res.data.sex == 'FEMALE' ? res.data.sex = '女' : ''
|
||
res.data.positionalTitleLevel == 'PRIMARY_LEVEL' ? res.data.positionalTitleLevelvalue = '初级' :
|
||
''
|
||
res.data.positionalTitleLevel == 'MIDDLE_LEVEL' ? res.data.positionalTitleLevelvalue = '中级' :
|
||
''
|
||
res.data.positionalTitleLevel == 'HIGH_LEVEL' ? res.data.positionalTitleLevelvalue = '高级' : ''
|
||
res.data.id = this.nursePersonId
|
||
res.data.nurseStationPersonCertificateList.forEach(e => {
|
||
if (e.certificateUrl) {
|
||
this.certificateimg.push(baseurl + e.certificateUrl)
|
||
}
|
||
})
|
||
res.data.nurseStationPersonCheckList = []
|
||
this.appPersonallist = res.data
|
||
})
|
||
},
|
||
//上传证书
|
||
uploadcertificateimgs() {
|
||
let that = this
|
||
if (this.uploadcertificateimg && this.uploadcertificateimg.length > 0) {
|
||
this.uploadcertificateimg.forEach(e => {
|
||
uni.uploadFile({
|
||
url: baseurl +
|
||
'/nurseApplet/personCenter/uploadNurseStationPersonCertificateUrl',
|
||
filePath: e, //file: 二进制(filePath)
|
||
name: 'file',
|
||
formData: { //多余值
|
||
'nursePersonId': that.nursePersonId,
|
||
},
|
||
timeout: 10000,
|
||
success(res) {
|
||
var img = {
|
||
certificateUrl: JSON.parse(res.data).imgUrl
|
||
}
|
||
that.appPersonallist.nurseStationPersonCheckList.push(img)
|
||
if (that.appPersonallist.nurseStationPersonCheckList.length == that
|
||
.uploadcertificateimg.length) {
|
||
that.gofinish();
|
||
that.appPersonallist.nurseStationPersonCheckList = []
|
||
that.uploadcertificateimg = []
|
||
}
|
||
}
|
||
})
|
||
})
|
||
} else {
|
||
that.gofinish();
|
||
}
|
||
},
|
||
//修改
|
||
gofinish() {
|
||
var that = this
|
||
if (this.image) {
|
||
uni.uploadFile({
|
||
url: baseurl + '/nurseApp/personLogin/updateHeadAvatarHead',
|
||
filePath: that.appPersonallist.avatar, //file: 二进制(filePath)
|
||
name: 'file',
|
||
formData: { //多余值
|
||
'userId': that.appPersonallist.userId,
|
||
},
|
||
timeout: 10000,
|
||
success(res) {
|
||
that.appPersonallist.avatar = JSON.parse(res.data).imgUrl
|
||
that.updateNursePerson();
|
||
}
|
||
})
|
||
} else {
|
||
that.updateNursePerson();
|
||
}
|
||
},
|
||
updateNursePerson() {
|
||
this.appPersonallist.nurseStationPersonCertificateList.forEach(e => {
|
||
var img = {
|
||
certificateUrl: e.certificateUrl
|
||
}
|
||
this.appPersonallist.nurseStationPersonCheckList.push(img)
|
||
})
|
||
var that = this
|
||
var obj = {
|
||
avatar: that.appPersonallist.avatar,
|
||
userId: that.appPersonallist.userId,
|
||
id: that.nursePersonId,
|
||
positionalTitleLevelCheck: that.appPersonallist.positionalTitleLevel,
|
||
geniusItemCheck: that.appPersonallist.geniusItem,
|
||
nurseStationPersonCheckList: that.appPersonallist.nurseStationPersonCheckList
|
||
}
|
||
updateNursePersonCheck(obj).then(res => {
|
||
if (res.code == 200) {
|
||
that.$refs.uToast.show({
|
||
title: '修改成功',
|
||
type: 'success',
|
||
duration: '1500',
|
||
})
|
||
if (that.timer) {
|
||
clearTimeout(that.timer)
|
||
}
|
||
that.timer = setTimeout(e => {
|
||
uni.navigateBack({
|
||
delta: 1
|
||
})
|
||
}, 1500)
|
||
} else {
|
||
that.$refs.uToast.show({
|
||
title: res.msg,
|
||
type: 'error'
|
||
})
|
||
}
|
||
})
|
||
},
|
||
confirm(e) {
|
||
this.appPersonallist.nurseStationSysUserVOList[0].nurseStationId = e[0].value
|
||
this.appPersonallist.nurseStationSysUserVOList[0].nurseStationName = e[0]['label']
|
||
},
|
||
//开启选择性别
|
||
sexshowtrue() {
|
||
this.sexshow = true
|
||
},
|
||
//职称级别
|
||
positionalTitleLevelconfirm(e) {
|
||
this.appPersonallist.positionalTitleLevelvalue = e[0].label
|
||
this.appPersonallist.positionalTitleLevel = e[0].value
|
||
},
|
||
//选择性别
|
||
sexconfirm(e) {
|
||
this.appPersonallist.sex = e[0].label
|
||
},
|
||
},
|
||
}
|
||
</script>
|
||
<style lang="scss">
|
||
@import './Modifyinformation.scss';
|
||
</style>
|