前后端代码解构

This commit is contained in:
2025-03-13 11:15:27 +08:00
parent 6623a6c03d
commit 222ebb07dc
579 changed files with 0 additions and 72316 deletions

View File

@@ -1,162 +0,0 @@
<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>
</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="请选择" :disabled="!canChangeUser">
<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'
import { getUserProfile } from "@/api/system/user";
export default {
name: "Offboarding",
dicts: [],
data() {
return {
form: {},
userList: [],
user: {},
fileList: [] // 存储选中的文件
}
},
created() {
this.getUserList();
this.getUserInfo();
},
methods: {
// 获取用户列表
getUserList() {
listUser().then(res => {
this.userList = res.rows;
})
},
canChangeUser() {
const dir = this.user.roles.map(item => {
return item.roleKey
})
return dir.includes("admin")
},
// 获取用户信息
getUserInfo() {
getUserProfile().then(res => {
this.user = res.data.user;
this.form.userId = this.user.userId;
console.log(this.user);
})
},
// 文件状态改变时的处理
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);
// 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>

View File

@@ -1,352 +0,0 @@
<template>
<div class="app-container">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
<el-form-item label="离职日期" prop="resignationDate">
<el-date-picker clearable
v-model="queryParams.resignationDate"
type="date"
value-format="yyyy-MM-dd"
placeholder="请选择离职日期">
</el-date-picker>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
</el-form-item>
</el-form>
<el-row :gutter="10" class="mb8">
<!-- <el-col :span="1.5">
<el-button
type="primary"
plain
icon="el-icon-plus"
size="mini"
@click="handleAdd"
v-hasPermi="['system:offboarding:add']"
>新增
</el-button>
</el-col> -->
<el-col :span="1.5">
<el-button
type="success"
plain
icon="el-icon-edit"
size="mini"
:disabled="single"
@click="handleUpdate"
v-hasPermi="['system:offboarding:edit']"
>修改
</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="danger"
plain
icon="el-icon-delete"
size="mini"
:disabled="multiple"
@click="handleDelete"
v-hasPermi="['system:offboarding:remove']"
>删除
</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="warning"
plain
icon="el-icon-download"
size="mini"
@click="handleExport"
v-hasPermi="['system:offboarding:export']"
>导出
</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<el-table v-loading="loading" :data="offboardingList" @selection-change="handleSelectionChange">
<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="resignationDate" width="180">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.resignationDate, '{y}-{m}-{d}') }}</span>
</template>
</el-table-column>
<el-table-column label="离职面谈" align="center" prop="exitInterview">
<template slot-scope="scope">
<el-tag :type="scope.row.exitInterview===1?'success':'warning'">
{{ scope.row.exitInterview === 1 ? '完成' : '未完成' }}
</el-tag>
</template>
</el-table-column>
<el-table-column label="工作交接" align="center" prop="handoverCompleted">
<template slot-scope="scope">
<el-tag :type="scope.row.handoverCompleted===1?'success':'warning'">
{{ scope.row.handoverCompleted === 1 ? '完成' : '未完成' }}
</el-tag>
</template>
</el-table-column>
<el-table-column label="离职原因" align="center" prop="exitReason"/>
<el-table-column label="最终工资" align="center" prop="finalSalary"/>
<el-table-column label="离职申请书" align="center" prop="resignationApplicationSubmitted">
<template slot-scope="scope">
<el-tag :type="scope.row.resignationApplicationSubmitted===1?'success':'warning'">
{{ scope.row.resignationApplicationSubmitted === 1 ? '已提交' : '未提交' }}
</el-tag>
</template>
</el-table-column>
<el-table-column label="离职证明" align="center" prop="exitCertificateIssued">
<template slot-scope="scope">
<el-tag :type="scope.row.exitCertificateIssued===1?'success':'warning'">
{{ scope.row.exitCertificateIssued === 1 ? '已开据' : '未开据' }}
</el-tag>
</template>
</el-table-column>
<el-table-column label="离职状态" align="center" prop="offboardingConfirmed">
<template slot-scope="scope">
<el-tag :type="scope.row.exitCertificateIssued===1?'success':'warning'">
{{ scope.row.exitCertificateIssued === 1 ? '已离职' : '手续未完善' }}
</el-tag>
</template>
</el-table-column>
<el-table-column label="备注" align="center" prop="remark"/>
<el-table-column label="操作" align="center" class-name="small-padding fixed-width" fixed="right">
<template slot-scope="scope">
<el-button
size="mini"
type="text"
icon="el-icon-edit"
v-if="scope.row.dataBackupCompleted!==1"
@click="handleUpdate(scope.row)"
v-hasPermi="['system:offboarding:edit']"
>离职跟进
</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-delete"
@click="handleDelete(scope.row)"
v-hasPermi="['system:offboarding:remove']"
>删除
</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-close"
v-if="scope.row.offboardingConfirmed===1&&scope.row.dataBackupCompleted!==1"
@click="handleClose(scope.row)"
v-hasPermi="['system:offboarding:remove']"
>离职完成
</el-button>
</template>
</el-table-column>
</el-table>
<pagination
v-show="total>0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
</div>
</template>
<script>
import {listOffboarding, getOffboarding, delOffboarding, addOffboarding, updateOffboarding} from "@/api/oa/offboarding";
import {delUser} from "@/api/system/user";
export default {
name: "Offboarding",
data() {
return {
// 按钮loading
buttonLoading: false,
// 遮罩层
loading: true,
// 选中数组
ids: [],
// 非单个禁用
single: true,
// 非多个禁用
multiple: true,
// 显示搜索条件
showSearch: true,
// 总条数
total: 0,
// 离职管理表格数据
offboardingList: [],
// 弹出层标题
title: "",
// 是否显示弹出层
open: false,
// 查询参数
queryParams: {
pageNum: 1,
pageSize: 10,
userId: undefined,
resignationDate: undefined,
exitInterview: undefined,
handoverCompleted: undefined,
exitReason: undefined,
finalSalary: undefined,
resignationApplicationSubmitted: undefined,
dataBackupCompleted: undefined,
handoverArranged: undefined,
salarySettled: undefined,
benefitsSettled: undefined,
exitCertificateIssued: undefined,
offboardingConfirmed: undefined,
},
// 表单参数
form: {},
// 表单校验
rules: {}
};
},
created() {
this.getList();
},
methods: {
// 操作离职删除oa账号
handleClose(row) {
this.$confirm('此操作将永久删除该办公系统账号, 是否继续?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
delUser(row.userId).then(response => {
row.dataBackupCompleted = 1;
updateOffboarding(row).then(res => {
this.$message({
type: 'success',
message: '删除成功!'
});
this.getList();
})
})
}).catch(() => {
this.$message({
type: 'info',
message: '已取消删除'
});
});
},
/** 查询离职管理列表 */
getList() {
this.loading = true;
listOffboarding(this.queryParams).then(response => {
this.offboardingList = response.rows;
this.total = response.total;
this.loading = false;
});
},
// 取消按钮
cancel() {
this.open = false;
this.reset();
},
// 表单重置
reset() {
this.form = {
offboardingId: undefined,
userId: undefined,
resignationDate: undefined,
exitInterview: undefined,
handoverCompleted: undefined,
exitReason: undefined,
finalSalary: undefined,
resignationApplicationSubmitted: undefined,
dataBackupCompleted: undefined,
handoverArranged: undefined,
salarySettled: undefined,
benefitsSettled: undefined,
exitCertificateIssued: undefined,
offboardingConfirmed: undefined,
createBy: undefined,
createTime: undefined,
updateBy: undefined,
updateTime: undefined,
remark: undefined,
delFlag: undefined
};
this.resetForm("form");
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm");
this.handleQuery();
},
// 多选框选中数据
handleSelectionChange(selection) {
this.ids = selection.map(item => item.offboardingId)
this.single = selection.length !== 1
this.multiple = !selection.length
},
/** 新增按钮操作 */
handleAdd() {
this.$router.push('/people/addOffboarding')
},
/** 修改按钮操作 */
handleUpdate(row) {
this.$router.push('/people/updateOffboarding/' + row.offboardingId);
},
/** 提交按钮 */
submitForm() {
this.$refs["form"].validate(valid => {
if (valid) {
this.buttonLoading = true;
if (this.form.offboardingId != null) {
updateOffboarding(this.form).then(response => {
this.$modal.msgSuccess("修改成功");
this.open = false;
this.getList();
}).finally(() => {
this.buttonLoading = false;
});
} else {
addOffboarding(this.form).then(response => {
this.$modal.msgSuccess("新增成功");
this.open = false;
this.getList();
}).finally(() => {
this.buttonLoading = false;
});
}
}
});
},
/** 删除按钮操作 */
handleDelete(row) {
const offboardingIds = row.offboardingId || this.ids;
this.$modal.confirm('是否确认删除离职管理编号为"' + offboardingIds + '"的数据项?').then(() => {
this.loading = true;
return delOffboarding(offboardingIds);
}).then(() => {
this.loading = false;
this.getList();
this.$modal.msgSuccess("删除成功");
}).catch(() => {
}).finally(() => {
this.loading = false;
});
},
/** 导出按钮操作 */
handleExport() {
this.download('system/offboarding/export', {
...this.queryParams
}, `offboarding_${new Date().getTime()}.xlsx`)
}
}
};
</script>

View File

@@ -1,177 +0,0 @@
<template>
<div class="main">
<el-tabs v-model="activeName" @tab-click="handleClick">
<el-tab-pane label="基本信息" name="first">
<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: 10px;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>
<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>
</el-tab-pane>
<el-tab-pane label="流程跟进" name="second">
<div style="background-color: #fff;border-radius: 10px;margin-top: 10px;flex-direction: column;padding: 20px">
<el-form ref="form" :model="form" label-width="150px">
<el-form-item label="是否面谈">
<el-radio-group v-model="form.exitInterview">
<el-radio :label="0">未完成</el-radio>
<el-radio :label="1">已完成</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item label="离职交接">
<el-radio-group v-model="form.handoverCompleted">
<el-radio :label="0">未完成</el-radio>
<el-radio :label="1">已完成</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item label="最终工资结算(¥)">
<el-input v-model="form.finalSalary"></el-input>
</el-form-item>
<el-form-item label="离职申请书提交">
<el-radio-group v-model="form.resignationApplicationSubmitted">
<el-radio :label="0">未完成</el-radio>
<el-radio :label="1">已完成</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item label="离职证明">
<el-radio-group v-model="form.exitCertificateIssued">
<el-radio :label="0">未开据</el-radio>
<el-radio :label="1">已开据</el-radio>
</el-radio-group>
</el-form-item>
</el-form>
<div>
<el-button type="primary" @click="saveFormToOffboarding">
保存信息
</el-button>
<el-button type="warning"
v-if="form.exitInterview===1&&
form.handoverCompleted===1&&
form.resignationApplicationSubmitted===1"
@click="completeOffboarding"
>确认离职</el-button>
</div>
</div>
</el-tab-pane>
</el-tabs>
</div>
</template>
<script>
import {addOffboarding, getOffboarding, updateOffboarding} from "@/api/oa/offboarding";
import {listUser} from "@/api/system/user";
export default {
name: "Offboarding",
dicts: [],
data() {
return{
activeName:"first",
form:{},
userList:[],
user:{}
}
},
created() {
this.getForm(this.$route.params.offboardingId);
this.getUserList();
},
methods: {
getForm(offboardingId) {
getOffboarding(offboardingId).then(res => {
this.form = res.data;
})
},
//获取用户列表
getUserList() {
listUser().then(res => {
this.userList = res.rows;
console.log(res.rows)
})
},
//保存离职信息
saveFormToOffboarding(){
updateOffboarding(this.form).then(res=>{
this.$modal.msgSuccess("跟进成功");
this.loading = false;
this.goBack()
})
},
/** 返回页面 */
goBack() {
// 关闭当前标签页并返回上个页面
this.$tab.closePage(this.$route)
this.$router.back()
},
completeOffboarding() {
// 代表完成离职
this.form.offboardingConfirmed = 1;
this.saveFormToOffboarding();
}
},
}
</script>
<style scoped >
.main{
padding: 20px;
background: #f6f6f6;
}
</style>