| | |
| | | |
| | | const { proxy } = getCurrentInstance() |
| | | import { getUserProfile } from '@/api/system/user.js' |
| | | import {staffJoinUpdate, staffJoinListPage} from "@/api/personnelManagement/onboarding.js"; |
| | | import { fa, id } from 'element-plus/es/locales.mjs' |
| | | import {staffOnJobListPage, updateStaffOnJob} from "@/api/personnelManagement/staffOnJob.js"; |
| | | |
| | | const tableLoading = ref(false) |
| | | // 分页参数 |
| | |
| | | currentUser.value = res.data |
| | | // console.log("----",currentUser.value) |
| | | //得到人员列表 |
| | | staffJoinListPage({staffState: 1}).then(res => { |
| | | staffOnJobListPage({staffState: 1}).then(res => { |
| | | //筛选出和currentUser同名的人员 |
| | | // let tableData = res.data.records |
| | | user.value = res.data.records.find(item => item.staffName === currentUser.value.userName) |
| | |
| | | const userRes = await getUserProfile(); |
| | | if (userRes.code === 200) { |
| | | currentUser.value = userRes.data; |
| | | const staffListRes = await staffJoinListPage({ staffState: 1 }); |
| | | const staffListRes = await staffOnJobListPage({ staffState: 1 }); |
| | | user.value = staffListRes.data.records.find(item => item.staffName === currentUser.value.userName); |
| | | // console.log("++++", user.value); |
| | | |
| | | Object.assign(joinForm, user.value); |
| | | joinForm.staffName = profileForm.name; |
| | | joinForm.phone = profileForm.phone; |
| | | joinForm.email = profileForm.email; |
| | | joinForm.adress = profileForm.adress; |
| | | console.log(joinForm) |
| | | // 调用更新个人信息的接口 |
| | | staffJoinUpdate(joinForm).then(res => { |
| | | updateStaffOnJob(user.value.id, joinForm).then(res => { |
| | | if (res.code === 200) { |
| | | ElMessage.success('个人信息保存成功'); |
| | | getProfile(); |