Merge remote-tracking branch 'origin/main'
This commit is contained in:
@@ -14,7 +14,6 @@ VUE_APP_CONTEXT_PATH = '/'
|
||||
# 监控地址
|
||||
VUE_APP_MONITRO_ADMIN = 'http://localhost:9090/admin/login'
|
||||
|
||||
|
||||
# websocket服务地址
|
||||
VUE_APP_SOCKET_SERVER = 'ws://localhost:8080/websocket/'
|
||||
|
||||
|
||||
33
ruoyi-ui/src/api/oa/hr.js
Normal file
33
ruoyi-ui/src/api/oa/hr.js
Normal file
@@ -0,0 +1,33 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
/**
|
||||
* 获取试用及转正页面信息
|
||||
*/
|
||||
export function getProbationList(params) {
|
||||
return request({
|
||||
url: '/system/onboarding/list',
|
||||
method: 'get',
|
||||
params
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新试用转正信息
|
||||
*/
|
||||
export function submitProbation(data) {
|
||||
return request({
|
||||
url: '/system/onboarding',
|
||||
method: 'put',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询当前用户详细信息
|
||||
*/
|
||||
export function getUserInfo(userId) {
|
||||
return request({
|
||||
url: `/system/onboarding/${userId}`,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
@@ -10,7 +10,7 @@ export function listOffboarding(query) {
|
||||
}
|
||||
|
||||
// 查询离职管理详细
|
||||
export function getOffboarding(offboardingId) {
|
||||
export function getOnboarding(offboardingId) {
|
||||
return request({
|
||||
url: '/system/offboarding/' + offboardingId,
|
||||
method: 'get'
|
||||
|
||||
@@ -29,12 +29,12 @@
|
||||
<el-table-column prop="uploadTime" label="上传时间" width="180">
|
||||
<template #default="{row}">{{ formatDate(row.uploadTime) }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" width="150" fixed="right" v-if="!readOnly">
|
||||
<!-- <el-table-column label="操作" width="150" fixed="right" >
|
||||
<template #default="{row}">
|
||||
<!-- <el-button size="mini" type="text" @click="handlePreview(row)">预览</el-button> -->
|
||||
<el-button size="mini" type="text" @click="handlePreview(row)">预览</el-button>
|
||||
<el-button size="mini" type="text" @click="handleDownload(row)">下载</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table-column> -->
|
||||
</el-table>
|
||||
|
||||
<!-- 添加文件对话框 -->
|
||||
@@ -137,7 +137,7 @@ export default {
|
||||
try {
|
||||
this.loading = true
|
||||
const res = await listDocument(this.userId)
|
||||
this.fileList = res.data.fileList
|
||||
this.fileList = res.data.fileList;
|
||||
console.log(this.fileList)
|
||||
const fileTypes = await getFileTypeList();
|
||||
this.fileTypes = fileTypes.rows;
|
||||
@@ -264,6 +264,14 @@ export default {
|
||||
handleSelectionChange(selection) {
|
||||
this.selectedFiles = selection
|
||||
},
|
||||
|
||||
handleDownload(row) {
|
||||
// const a = document.createElement('a')
|
||||
// a.href = row.fileUrl
|
||||
// a.download = row.fileName
|
||||
// a.click()
|
||||
window.open(row.filePath)
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@@ -1,123 +1,144 @@
|
||||
<template>
|
||||
<div class="main">
|
||||
|
||||
<el-header style="background-color: #fff;display: flex;justify-content:center;border-radius: 10px">
|
||||
<h1>员工离职申请表</h1>
|
||||
</el-header>
|
||||
<el-container style="background-color: #fff;border-radius: 10px;margin-top: 30px;flex-direction: column;padding: 20px">
|
||||
<div style="display: flex;justify-content: space-between;align-items: center;">
|
||||
|
||||
<div>基本信息</div>
|
||||
<div>
|
||||
<el-button type="primary" @click="saveFormToOffboarding">
|
||||
<i class="el-icon-check"></i>提交
|
||||
</el-button>
|
||||
<div class="main">
|
||||
<el-header style="background-color: #fff;display: flex;justify-content:center;border-radius: 10px">
|
||||
<h1>员工离职申请表</h1>
|
||||
</el-header>
|
||||
<el-container style="background-color: #fff;border-radius: 10px;margin-top: 30px;flex-direction: column;padding: 20px">
|
||||
<div style="display: flex;justify-content: space-between;align-items: center;">
|
||||
<div>基本信息</div>
|
||||
<div>
|
||||
<el-button type="primary" @click="saveFormToOffboarding">
|
||||
<i class="el-icon-check"></i>提交
|
||||
</el-button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<el-divider></el-divider>
|
||||
<div>
|
||||
<el-form ref="form" :model="form" label-width="80px">
|
||||
<el-row :gutter="18">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="离职人员" required>
|
||||
<el-select v-model="form.userId" filterable placeholder="请选择">
|
||||
<el-option
|
||||
v-for="item in userList"
|
||||
:key="item.userId"
|
||||
:label="item.nickName"
|
||||
:value="item.userId">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="离职时间" required>
|
||||
<el-date-picker
|
||||
v-model="form.resignationDate"
|
||||
type="date"
|
||||
value-format="yyyy-MM-dd"
|
||||
placeholder="选择日期">
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-form-item label="离职原因" required>
|
||||
<el-input type="textarea" v-model="form.exitReason" placeholder="请输入内容"></el-input>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</div>
|
||||
</el-container>
|
||||
</div>
|
||||
<el-divider></el-divider>
|
||||
<div>
|
||||
<el-form ref="form" :model="form" label-width="80px">
|
||||
<el-row :gutter="18">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="离职人员" required>
|
||||
<el-select v-model="form.userId" filterable placeholder="请选择">
|
||||
<el-option
|
||||
v-for="item in userList"
|
||||
:key="item.userId"
|
||||
:label="item.nickName"
|
||||
:value="item.userId">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="离职时间" required>
|
||||
<el-date-picker
|
||||
v-model="form.resignationDate"
|
||||
type="date"
|
||||
value-format="yyyy-MM-dd"
|
||||
placeholder="选择日期">
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-form-item label="离职原因" required>
|
||||
<el-input type="textarea" v-model="form.exitReason" placeholder="请输入内容"></el-input>
|
||||
</el-form-item>
|
||||
<!-- 新增文件上传组件 -->
|
||||
<el-form-item label="附件上传">
|
||||
<el-upload
|
||||
ref="upload"
|
||||
:auto-upload="false"
|
||||
:on-change="handleFileChange"
|
||||
:on-remove="handleFileRemove"
|
||||
multiple
|
||||
:file-list="fileList">
|
||||
<el-button size="small" type="primary">点击选择文件</el-button>
|
||||
<div slot="tip" class="el-upload__tip">请上传相关文件,支持多个文件</div>
|
||||
</el-upload>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</div>
|
||||
</el-container>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { addOffboarding } from "@/api/oa/offboarding";
|
||||
import { listUser } from "@/api/system/user";
|
||||
import { uploadFile, addFile } from '@/api/oa/document'
|
||||
|
||||
|
||||
</template>
|
||||
|
||||
<script>
|
||||
|
||||
import {addOffboarding} from "@/api/oa/offboarding";
|
||||
import {listUser} from "@/api/system/user";
|
||||
|
||||
export default {
|
||||
name: "Offboarding",
|
||||
dicts: [],
|
||||
data() {
|
||||
return{
|
||||
form:{},
|
||||
userList:[],
|
||||
user:{}
|
||||
}
|
||||
},
|
||||
created() {
|
||||
export default {
|
||||
name: "Offboarding",
|
||||
dicts: [],
|
||||
data() {
|
||||
return {
|
||||
form: {},
|
||||
userList: [],
|
||||
user: {},
|
||||
fileList: [] // 存储选中的文件
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.getUserList();
|
||||
},
|
||||
methods: {
|
||||
//获取用户列表
|
||||
getUserList() {
|
||||
listUser().then(res => {
|
||||
this.userList = res.rows;
|
||||
console.log(res.rows)
|
||||
})
|
||||
},
|
||||
//保存离职信息
|
||||
saveFormToOffboarding(){
|
||||
addOffboarding(this.form).then(res=>{
|
||||
this.$modal.msgSuccess("新增成功");
|
||||
this.loading = false;
|
||||
this.goBack()
|
||||
})
|
||||
},
|
||||
/** 返回页面 */
|
||||
goBack() {
|
||||
// 关闭当前标签页并返回上个页面
|
||||
this.$tab.closePage(this.$route)
|
||||
this.$router.back()
|
||||
},
|
||||
querySearchAsync(queryString, cb) {
|
||||
var userList = this.userList;
|
||||
var results = queryString ? userList.filter(this.createStateFilter(queryString)) : userList;
|
||||
methods: {
|
||||
// 获取用户列表
|
||||
getUserList() {
|
||||
listUser().then(res => {
|
||||
this.userList = res.rows;
|
||||
})
|
||||
},
|
||||
|
||||
// 文件状态改变时的处理
|
||||
handleFileChange(file, fileList) {
|
||||
this.fileList = fileList;
|
||||
},
|
||||
|
||||
// 文件移除处理
|
||||
handleFileRemove(file, fileList) {
|
||||
this.fileList = fileList;
|
||||
},
|
||||
|
||||
// 保存离职信息
|
||||
async saveFormToOffboarding() {
|
||||
try {
|
||||
// 1. 文件上传
|
||||
// 创建FormData对象
|
||||
const formData = new FormData();
|
||||
|
||||
// 添加表单数据
|
||||
formData.append('file', this.fileList[0].raw);
|
||||
console.log(this.fileList, formData);
|
||||
const data = uploadFile(formData);
|
||||
console.log(data, this.form);
|
||||
|
||||
clearTimeout(this.timeout);
|
||||
cb(results);
|
||||
},
|
||||
createStateFilter(queryString) {
|
||||
return (user) => {
|
||||
console.log(user);
|
||||
return (user.nickName.toLowerCase().indexOf(queryString.toLowerCase()) === 0);
|
||||
};
|
||||
},
|
||||
handleSelect(item) {
|
||||
this.form.userId = item.userId
|
||||
// 2. 文件绑定用户
|
||||
await addFile({
|
||||
userId: this.user.userId,
|
||||
fileList: [{
|
||||
fileName: data.newFileName,
|
||||
filePath: data.url,
|
||||
fileType: 1
|
||||
}]
|
||||
})
|
||||
// 3. 提交离职信息
|
||||
await addOffboarding(this.form);
|
||||
this.$modal.msgSuccess("提交成功");
|
||||
this.goBack();
|
||||
} catch (error) {
|
||||
this.$modal.msgError("提交失败");
|
||||
}
|
||||
},
|
||||
|
||||
/** 返回页面 */
|
||||
goBack() {
|
||||
this.$tab.closePage(this.$route);
|
||||
this.$router.back();
|
||||
}
|
||||
}
|
||||
|
||||
},
|
||||
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
|
||||
<style scoped >
|
||||
|
||||
.main{
|
||||
padding: 20px;
|
||||
background: #f6f6f6;
|
||||
}
|
||||
</style>
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.main {
|
||||
padding: 20px;
|
||||
background: #f6f6f6;
|
||||
}
|
||||
</style>
|
||||
128
ruoyi-ui/src/views/oa/peoples/apply/index.vue
Normal file
128
ruoyi-ui/src/views/oa/peoples/apply/index.vue
Normal file
@@ -0,0 +1,128 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-card class="box-card">
|
||||
<div slot="header" class="clearfix">
|
||||
<span>转正申请</span>
|
||||
<el-tag :type="statusType">{{ statusText }}</el-tag>
|
||||
</div>
|
||||
|
||||
<el-form ref="form" class="apply-form">
|
||||
<el-form-item label="申请材料" prop="file">
|
||||
<el-upload
|
||||
action=""
|
||||
:auto-upload="false"
|
||||
:on-change="handleFileChange"
|
||||
:file-list="fileList"
|
||||
>
|
||||
<el-button size="small" type="primary">选择文件</el-button>
|
||||
<div slot="tip" class="el-upload__tip">支持PDF/DOC格式,大小不超过50MB</div>
|
||||
</el-upload>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item>
|
||||
<el-button
|
||||
type="primary"
|
||||
:loading="loading"
|
||||
@click="handleSubmit"
|
||||
>提交申请</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-card>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { submitProbation } from '@/api/oa/hr'
|
||||
import { uploadFile, addFile } from '@/api/oa/document'
|
||||
import { getOnboarding } from "@/api/oa/onboarding"
|
||||
|
||||
|
||||
export default {
|
||||
name: 'ProbationApply',
|
||||
data() {
|
||||
return {
|
||||
loading: false,
|
||||
fileList: [],
|
||||
currentFile: null,
|
||||
statusMap: {
|
||||
pending: { label: '待审批', type: 'warning' },
|
||||
success: { label: '已提交', type: 'success' }
|
||||
},
|
||||
userInfo: null,
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
console.log(this.$store.state.user)
|
||||
// 获取用户入职信息
|
||||
// this.getUserInfo()
|
||||
},
|
||||
computed: {
|
||||
statusType() {
|
||||
return this.statusMap[this.fileList.length ? 'success' : 'pending'].type
|
||||
},
|
||||
statusText() {
|
||||
return this.statusMap[this.fileList.length ? 'success' : 'pending'].label
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
async getUserInfo() {
|
||||
const { data } = await getOnboarding(this.$store.state.user.id)
|
||||
this.userInfo = data
|
||||
},
|
||||
|
||||
handleFileChange(file) {
|
||||
this.currentFile = file.raw
|
||||
this.fileList = [file]
|
||||
},
|
||||
|
||||
async handleSubmit() {
|
||||
if (!this.currentFile) {
|
||||
return this.$message.warning('请先选择申请文件')
|
||||
}
|
||||
|
||||
try {
|
||||
this.loading = true
|
||||
|
||||
// 1. 上传文件
|
||||
const formData = new FormData()
|
||||
formData.append('file', this.currentFile)
|
||||
const data = await uploadFile(formData)
|
||||
// 2. 将文件关联用户
|
||||
await addFile({
|
||||
userId: this.$store.state.user.id,
|
||||
fileList: [{
|
||||
fileName: data.originalFilename,
|
||||
filePath: data.url,
|
||||
fileType: 0,
|
||||
}]
|
||||
})
|
||||
// 3. 提交申请
|
||||
await submitProbation({
|
||||
userId: this.$store.state.user.id,
|
||||
// onboardingId: this.userInfo.onboardingId,
|
||||
status: 1,
|
||||
})
|
||||
|
||||
this.$message.success('申请提交成功')
|
||||
this.fileList = []
|
||||
} catch (error) {
|
||||
this.$message.error('提交失败: ' + (error.message || error))
|
||||
} finally {
|
||||
this.loading = false
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.apply-form {
|
||||
max-width: 600px;
|
||||
margin: 20px auto;
|
||||
}
|
||||
.el-upload__tip {
|
||||
color: #999;
|
||||
font-size: 12px;
|
||||
margin-top: 5px;
|
||||
}
|
||||
</style>
|
||||
@@ -74,7 +74,7 @@
|
||||
size="800px"
|
||||
direction="rtl"
|
||||
append-to-body>
|
||||
<user-file-manager
|
||||
<UserFileManager
|
||||
:user-id="currentUser.userId"
|
||||
:read-only="!hasEditPermission"
|
||||
v-if="fileDrawerVisible" />
|
||||
@@ -87,7 +87,7 @@
|
||||
|
||||
<script>
|
||||
import { listUser } from "@/api/system/user";
|
||||
import UserFileManager from "./FileList";
|
||||
import UserFileManager from "@/components/FileList";
|
||||
// import UserDetailDialog from "@/components/UserDetailDialog";
|
||||
|
||||
export default {
|
||||
|
||||
@@ -30,7 +30,7 @@
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
|
||||
<el-button type="primary" icon="el-icon-search" size="mini" @click="getList">搜索</el-button>
|
||||
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
@@ -49,16 +49,11 @@
|
||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
|
||||
<el-table v-loading="loading" :data="probationList" @selection-change="handleSelectionChange">
|
||||
<el-table v-loading="loading" :data="probationList">
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column label="序号" align="center" type="index"/>
|
||||
<el-table-column label="姓名" align="center" prop="nickName"/>
|
||||
<el-table-column label="性别" align="center" prop="sex">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ scope.row.sex === '0' ? '男' : '女' }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="部门" align="center" prop="dept.deptName"/>
|
||||
<!-- <el-table-column label="部门" align="center" prop="dept.deptName"/> -->
|
||||
<el-table-column label="试用期限" align="center" width="200">
|
||||
<template slot-scope="scope">
|
||||
<div>{{ scope.row.probationStart }} ~ {{ scope.row.probationEnd }}</div>
|
||||
@@ -67,7 +62,7 @@
|
||||
</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="状态" align="center">
|
||||
<el-table-column label="状态" align="center" prop="status">
|
||||
<template slot-scope="scope">
|
||||
<el-tag :type="statusMap[scope.row.status].type">
|
||||
{{ statusMap[scope.row.status].label }}
|
||||
@@ -81,7 +76,7 @@
|
||||
type="text"
|
||||
icon="el-icon-edit"
|
||||
@click="handleRegular(scope.row)"
|
||||
v-if="scope.row.status === '0'"
|
||||
v-if="scope.row.status == 1"
|
||||
>转正</el-button>
|
||||
<el-button
|
||||
size="mini"
|
||||
@@ -126,14 +121,20 @@
|
||||
<el-button type="primary" @click="submitRegular">确认</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
|
||||
<el-dialog :title="转正详情" :visible.sync="detailVisible" width="500px">
|
||||
<FileList :userId="currentUserId" readonly="true" ></FileList>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
// import { getProbationList, batchRegular } from '@/api/hr/probation'
|
||||
import { listOnboarding, updateOnboarding } from '@/api/oa/onboarding'
|
||||
import FileList from '@/components/FileList'
|
||||
|
||||
export default {
|
||||
name: 'ProbationManage',
|
||||
components: { FileList },
|
||||
data() {
|
||||
return {
|
||||
queryParams: {
|
||||
@@ -146,8 +147,12 @@ export default {
|
||||
statusMap: {
|
||||
'0': { label: '试用中', type: 'warning' },
|
||||
'1': { label: '待审核', type: 'info' },
|
||||
'2': { label: '已转正', type: 'success' }
|
||||
'2': { label: '已转正', type: 'success' },
|
||||
// '0': { label: '未批准', type: 'danger' },
|
||||
// '1': { label: '已批准', type: 'success' }
|
||||
},
|
||||
showSearch: true,
|
||||
loading: false,
|
||||
probationList: [],
|
||||
deptOptions: [],
|
||||
multiple: true,
|
||||
@@ -157,24 +162,47 @@ export default {
|
||||
userIds: [],
|
||||
effectiveDate: '',
|
||||
remark: ''
|
||||
}
|
||||
},
|
||||
currentUserId: '',
|
||||
detailVisible: false,
|
||||
total: 0,
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.getList();
|
||||
console.log('挂在审核')
|
||||
},
|
||||
methods: {
|
||||
getList() {
|
||||
// getProbationList(this.queryParams).then(res => {
|
||||
// this.probationList = res.rows
|
||||
// this.total = res.total
|
||||
// })
|
||||
listOnboarding(this.queryParams).then(res => {
|
||||
this.probationList = res.rows
|
||||
this.total = res.total
|
||||
})
|
||||
},
|
||||
handleRegular(row) {
|
||||
this.form = {
|
||||
userIds: [row.userId],
|
||||
effectiveDate: '',
|
||||
remark: ''
|
||||
}
|
||||
this.dialogTitle = `转正操作 - ${row.nickName}`
|
||||
this.dialogVisible = true
|
||||
// this.form = {
|
||||
// userIds: [row.userId],
|
||||
// effectiveDate: '',
|
||||
// remark: ''
|
||||
// }
|
||||
// this.dialogTitle = `转正操作 - ${row.nickName}`
|
||||
// this.dialogVisible = true
|
||||
console.log('转正操作', row)
|
||||
const joiningDate = new Date()
|
||||
// 格式化为 YYYY-MM-DD
|
||||
const year = joiningDate.getFullYear()
|
||||
const month = String(joiningDate.getMonth() + 1).padStart(2, '0')
|
||||
const day = String(joiningDate.getDate()).padStart(2, '0')
|
||||
const formattedDate = `${year}-${month}-${day}`
|
||||
updateOnboarding({
|
||||
// onboardingId: row.onboardingId,
|
||||
userId: row.userId,
|
||||
status: 2,
|
||||
joiningDate: formattedDate
|
||||
}).then(res => {
|
||||
this.getList()
|
||||
this.$message.success('转正成功')
|
||||
})
|
||||
},
|
||||
handleBatchRegular() {
|
||||
this.form.userIds = this.selectedIds
|
||||
@@ -192,6 +220,13 @@ export default {
|
||||
if (days > 7) return 'success'
|
||||
if (days > 3) return 'warning'
|
||||
return 'danger'
|
||||
},
|
||||
handleDetail(row) {
|
||||
this.currentUserId = row.userId;
|
||||
this.detailVisible = true
|
||||
},
|
||||
resetQuery() {
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,14 +1,6 @@
|
||||
<template>
|
||||
<div class="container">
|
||||
<!-- 人事管理界面 -->
|
||||
<div v-if="userRole === 'HR'">
|
||||
<ProbationManage />
|
||||
</div>
|
||||
|
||||
<!-- 员工申请界面 -->
|
||||
<div v-else>
|
||||
<ProbationApply />
|
||||
</div>
|
||||
<ProbationManage />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -19,7 +11,7 @@ import ProbationManage from "./ProbationManage";
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
userRole: 'HR', // 实际应从登录信息获取
|
||||
userRole: 'DM', // 实际应从登录信息获取
|
||||
}
|
||||
},
|
||||
components: {
|
||||
|
||||
@@ -35,6 +35,28 @@
|
||||
<svg-icon icon-class="date" />创建日期
|
||||
<div class="pull-right">{{ user.createTime }}</div>
|
||||
</li>
|
||||
<li class="list-group-item" v-if="onBoardingInfo.status == '0'">
|
||||
转正申请
|
||||
<div class="pull-right">
|
||||
<el-button type="text" @click="toApplyProbation">申请转正</el-button>
|
||||
</div>
|
||||
</li>
|
||||
<li class="list-group-item" v-else>
|
||||
<svg-icon icon-class="date" />转正日期
|
||||
<div class="pull-right">{{ onBoardingInfo.joiningDate }}</div>
|
||||
</li>
|
||||
<li class="list-group-item">
|
||||
离职申请
|
||||
<div class="pull-right">
|
||||
<el-button type="danger" @click="toApplyQuit">申请离职</el-button>
|
||||
</div>
|
||||
</li>
|
||||
<li class="list-group-item">
|
||||
个人档案
|
||||
<div class="pull-right">
|
||||
<el-button type="text" @click="openFileDrawer">查看档案</el-button>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</el-card>
|
||||
@@ -55,6 +77,17 @@
|
||||
</el-card>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-drawer :title="`${user.nickName} - 文件管理`"
|
||||
:visible.sync="fileDrawerVisible"
|
||||
size="800px"
|
||||
direction="rtl"
|
||||
append-to-body>
|
||||
<user-file-manager
|
||||
:user-id="user.userId"
|
||||
:read-only="true"
|
||||
v-if="fileDrawerVisible" />
|
||||
</el-drawer>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -62,29 +95,55 @@
|
||||
import userAvatar from "./userAvatar";
|
||||
import userInfo from "./userInfo";
|
||||
import resetPwd from "./resetPwd";
|
||||
import UserFileManager from "@/components/FileList";
|
||||
import { getUserProfile } from "@/api/system/user";
|
||||
import { getOnboarding } from "@/api/oa/onboarding"
|
||||
|
||||
export default {
|
||||
name: "Profile",
|
||||
components: { userAvatar, userInfo, resetPwd },
|
||||
components: { userAvatar, userInfo, resetPwd, UserFileManager },
|
||||
data() {
|
||||
return {
|
||||
user: {},
|
||||
roleGroup: {},
|
||||
postGroup: {},
|
||||
activeTab: "userinfo"
|
||||
activeTab: "userinfo",
|
||||
fileDrawerVisible: false,
|
||||
onBoardingInfo: {}
|
||||
};
|
||||
},
|
||||
|
||||
created() {
|
||||
this.getUser();
|
||||
// 获取用户入职信息
|
||||
|
||||
},
|
||||
methods: {
|
||||
getUser() {
|
||||
getUserProfile().then(response => {
|
||||
this.user = response.data.user;
|
||||
console.log(this.user);
|
||||
this.roleGroup = response.data.roleGroup;
|
||||
this.postGroup = response.data.postGroup;
|
||||
this.getOnBoardInfo();
|
||||
});
|
||||
},
|
||||
async getOnBoardInfo() {
|
||||
const { data } = await getOnboarding(this.user.userId);
|
||||
this.onBoardingInfo = data;
|
||||
},
|
||||
openFileDrawer() {
|
||||
this.fileDrawerVisible = true;
|
||||
},
|
||||
// 跳转到申请转正页面
|
||||
toApplyProbation() {
|
||||
console.log("跳转到申请转正页面");
|
||||
this.$router.push('/people/apply');
|
||||
},
|
||||
// 跳转到离职页面
|
||||
toApplyQuit() {
|
||||
console.log("跳转到离职页面");
|
||||
this.$router.push('/people/addOffboarding');
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user