Commit fc8667d7 authored by huanghaoting's avatar huanghaoting

请假列表、请假详情、加班申请、加班列表

parent c0c44f0b
import request from '@/utils/request'
// 查询请假申请列表
export function listApplication(query) {
return request({
url: '/application/application/list',
method: 'get',
params: query
})
}
// 查询请假申请详细
export function getApplication(id) {
return request({
url: '/application/application/' + id,
method: 'get'
})
}
// 新增请假申请
export function addApplication(data) {
return request({
url: '/application/application',
method: 'post',
data: data
})
}
// 修改请假申请
export function updateApplication(data) {
return request({
url: '/application/application',
method: 'put',
data: data
})
}
// 删除请假申请
export function delApplication(id) {
return request({
url: '/application/application/' + id,
method: 'delete'
})
}
import request from '@/utils/request'
// 查询加班申请列表
export function listOvertimeApplication(query) {
return request({
url: '/application/overtimeApplication/list',
method: 'get',
params: query
})
}
// 查询加班申请表单
export function findOvertimeApplication(query) {
return request({
url: '/application/overtimeApplication/find',
method: 'get',
params: query
})
}
// 查询加班申请详细
export function getOvertimeApplication(id) {
return request({
url: '/application/overtimeApplication/' + id,
method: 'get'
})
}
// 新增加班申请
export function addOvertimeApplication(data) {
return request({
url: '/application/overtimeApplication',
method: 'post',
data: data
})
}
// 修改加班申请
export function updateOvertimeApplication(data) {
return request({
url: '/application/overtimeApplication',
method: 'put',
data: data
})
}
// 删除加班申请
export function delOvertimeApplication(id) {
return request({
url: '/application/overtimeApplication/' + id,
method: 'delete'
})
}
// src/utils/psa/holidays_2025.js
const holidaysData = {
code: 200,
data: [
{
name: "元旦",
holiday: ["2025-01-01"]
},
{
name: "春节",
holiday: [
"2025-01-28",
"2025-01-29",
"2025-01-30",
"2025-01-31",
"2025-02-01",
"2025-02-02",
"2025-02-03",
"2025-02-04"
]
},
{
name: "清明节",
holiday: ["2025-04-04", "2025-04-05", "2025-04-06"]
},
{
name: "劳动节",
holiday: ["2025-05-01", "2025-05-02", "2025-05-03", "2025-05-04", "2025-05-05"]
},
{
name: "端午节",
holiday: ["2025-05-31", "2025-06-01", "2025-06-02"]
},
{
name: "中秋节",
holiday: ["2025-09-15", "2025-09-16", "2025-09-17"]
},
{
name: "国庆节",
holiday: [
"2025-10-01",
"2025-10-02",
"2025-10-03",
"2025-10-04",
"2025-10-05",
"2025-10-06",
"2025-10-07",
"2025-10-08"
]
}
],
message: ""
};
export default holidaysData;
This diff is collapsed.
<template>
<div class="container">
<div class="div1"></div>
<span class="leave-application-title">请假详情</span>
<div class="leave-application-line"></div>
<div class="div2"></div>
<el-row type="flex" align="middle" justify="center" class="row-style0">
<el-col :span="2">
<label class="label">姓名:</label>
</el-col>
<el-col :span="22">
<span class="span-style">{{ form.uname }}</span>
</el-col>
</el-row>
<el-row type="flex" align="middle" class="row-style">
<el-col :span="2">
<label class="label">申请日期:</label>
</el-col>
<el-col :span="22">
<span class="span-style">{{ form.requestDate }}</span>
</el-col>
</el-row>
<el-row type="flex" align="middle" class="row-style">
<el-col :span="2">
<label class="label">请假类型:</label>
</el-col>
<el-col :span="22">
<span class="span-style">{{ leaveTypeName }}</span>
</el-col>
</el-row>
<el-row type="flex" align="middle" class="row-style">
<el-col :span="2">
<label class="label">请假开始时间:</label>
</el-col>
<el-col :span="22">
<span class="span-style">{{ form.startTime }}</span>
</el-col>
</el-row>
<el-row type="flex" align="middle" class="row-style">
<el-col :span="2">
<label class="label">请假结束时间:</label>
</el-col>
<el-col :span="22">
<span class="span-style">{{ form.endTime }}</span>
</el-col>
</el-row>
<el-row type="flex" align="middle" class="row-style">
<el-col :span="2">
<label class="label">请假时长:</label>
</el-col>
<el-col :span="22">
<span class="span-style">{{ form.leavetimeHours }}</span>
</el-col>
</el-row>
<el-row type="flex" align="middle" class="row-style">
<el-col :span="2">
<label class="label">请假天数:</label>
</el-col>
<el-col :span="22">
<span class="span-style">{{ form.leaveDaysSubtotal }}</span>
</el-col>
</el-row>
<el-row type="flex" align="middle" class="row-style">
<el-col :span="2">
<label class="label">查看附件:</label>
</el-col>
<el-col :span="22">
<span class="span-style">{{ form.proof }}</span>
</el-col>
</el-row>
<el-row type="flex" align="middle" class="row-style">
<el-col :span="2">
<label class="label">请假事由说明:</label>
</el-col>
<el-col :span="22">
<span class="span-style">{{ form.reason }}</span>
</el-col>
</el-row>
<el-row type="flex" align="middle" class="row-style">
<el-col :span="2">
<label class="label">一级审批人:</label>
</el-col>
<el-col :span="22">
<span class="span-style">{{ form.firstApprover }}</span>
</el-col>
</el-row>
<el-row type="flex" align="middle" class="row-style">
<el-col :span="2">
<label class="label">二级审批人:</label>
</el-col>
<el-col :span="22">
<span class="span-style">{{ form.secondApprover }}</span>
</el-col>
</el-row>
<el-button class="button-style" @click="handleCancel">返回</el-button>
</div>
</template>
<script setup>
import {ElMessage} from 'element-plus';
import {getApplication} from "../../../api/application/application.js";
import {useRouter, useRoute} from 'vue-router';
const router = useRouter(); // 创建路由器实例
const route = useRoute();
const form = reactive({
uname: '',
requestDate: '',
leaveType: '',
startTime: '',
endTime: '',
leavetimeHours: '',
leaveDaysSubtotal: '',
reason: '',
proof: '',
firstApprover: '',
secondApprover: ''
});
// 定义请假类型映射
const leaveTypeMap = {
'0': '病假',
'1': '产假',
'2': '倒休',
'3': '婚假',
'4': '年假',
'5': '陪产假',
'6': '丧假',
'7': '事假',
'8': '孕检假',
'9': '流产假'
};
// 计算属性,获取中文请假类型
const leaveTypeName = computed(() => leaveTypeMap[form.leaveType] || '未知类型');
onMounted(() => {
const id = route.query.id; // 获取路由参数中的 id
if (id) {
getApplication(id).then(response => {
console.log("获取到的数据:" + JSON.stringify(response.data));
Object.assign(form, response.data); // 将获取到的数据赋值给 form
}).catch(error => {
ElMessage.error('获取数据失败');
console.error(error);
});
}
});
/** 返回按钮操作 **/
const handleCancel = () => {
router.push({ path: '/attendance/leave' });
};
</script>
<style scoped>
.container {
width: 1920px;
height: 1080px;
background: #FAFAFB;
margin: 16px 28px 29px 20px;
}
.div1 {
height: 30px;
}
.leave-application-title {
width: 72px;
height: 15px;
font-family: "PingFangSC-Medium", sans-serif;
font-weight: 500;
font-size: 18px;
color: #0D162A;
letter-spacing: 0;
line-height: 15px;
margin: 0 0 0 32px;
}
.leave-application-line {
width: 72px;
height: 4px;
background: #0062FF;
margin-top: 8px;
margin-left: 32px;
}
.div2 {
height: 0;
}
/*第一行的样式 */
.row-style0 {
margin-top: 45px;
}
/* 标签样式*/
.label {
font-family: "PingFangSC-Regular", sans-serif;
font-weight: 400;
font-size: 16px;
color: #666666;
letter-spacing: 0;
text-align: right;
line-height: 13px;
display: inline-block; /* 确保宽度生效 */
margin: 0 30px 0 28px;
}
.row-style {
margin-top: 24px;
}
.span-style {
width: 64px;
height: 13px;
font-family: "PingFangSC-Regular", sans-serif;
font-weight: 400;
font-size: 16px;
color: #4A4E54;
letter-spacing: 0;
line-height: 13px;
}
/* 返回按钮 */
.button-style {
width: 116px;
height: 40px;
background: #0147EB;
font-family: "PingFangSC-Regular", sans-serif;
font-weight: 400;
font-size: 16px;
color: #FFFFFF;
letter-spacing: 0;
text-align: center;
line-height: 13px;
margin: 250px 0 0 1454px;
}
</style>
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment