✨ feat: 人事流程
This commit is contained in:
@@ -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() {
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user