2025-07-23 00:01:09 +08:00
|
|
|
<template>
|
2025-07-27 23:37:02 +08:00
|
|
|
<BasicLayout>
|
2025-08-29 01:27:54 +08:00
|
|
|
<view class="p-15">
|
2025-07-27 23:37:02 +08:00
|
|
|
<!-- 请假信息卡片 -->
|
2025-08-29 01:27:54 +08:00
|
|
|
<view class="info-card">
|
2025-07-27 23:37:02 +08:00
|
|
|
<view class="card-header">
|
2025-08-29 01:27:54 +08:00
|
|
|
<text class="applicant-name">教师{{ qjData.jsName }}的请假申请</text>
|
2025-07-27 23:37:02 +08:00
|
|
|
</view>
|
2025-08-29 01:27:54 +08:00
|
|
|
<view class="card-content">
|
2025-07-27 23:37:02 +08:00
|
|
|
<view class="info-row">
|
2025-08-29 01:27:54 +08:00
|
|
|
<text class="label">请假老师:</text>
|
|
|
|
|
<text class="value">{{ qjData.jsName }}</text>
|
2025-07-27 23:37:02 +08:00
|
|
|
</view>
|
|
|
|
|
<view class="info-row">
|
2025-08-29 01:27:54 +08:00
|
|
|
<text class="label">请假类型:</text>
|
|
|
|
|
<text class="value">{{ qjData.qjlx }}</text>
|
2025-07-27 23:37:02 +08:00
|
|
|
</view>
|
|
|
|
|
<view class="info-row">
|
2025-08-29 01:27:54 +08:00
|
|
|
<text class="label">请假时间:</text>
|
|
|
|
|
<text class="value">{{ qjData.qjkstime }} 至 {{ qjData.qjjstime }}</text>
|
|
|
|
|
</view>
|
|
|
|
|
<view class="info-row">
|
|
|
|
|
<text class="label">请假时长:</text>
|
|
|
|
|
<text class="value">{{ qjData.qjsc }}</text>
|
|
|
|
|
</view>
|
|
|
|
|
<view class="info-row">
|
|
|
|
|
<text class="label">请假事由:</text>
|
|
|
|
|
<text class="value">{{ qjData.qjsy }}</text>
|
2025-07-27 23:37:02 +08:00
|
|
|
</view>
|
|
|
|
|
</view>
|
|
|
|
|
</view>
|
2025-08-29 01:27:54 +08:00
|
|
|
|
|
|
|
|
<!-- 代课信息 -->
|
|
|
|
|
<view class="dk-info-card">
|
|
|
|
|
<view class="card-header">
|
|
|
|
|
<text class="card-title">代课信息</text>
|
|
|
|
|
</view>
|
|
|
|
|
<view class="card-content">
|
|
|
|
|
<view class="info-row">
|
|
|
|
|
<text class="label">代课时间:</text>
|
|
|
|
|
<text class="value">{{ dkData.dktime }}</text>
|
|
|
|
|
</view>
|
|
|
|
|
<view class="info-row">
|
|
|
|
|
<text class="label">课程名称:</text>
|
|
|
|
|
<text class="value">{{ dkData.kcmc }}</text>
|
|
|
|
|
</view>
|
|
|
|
|
<view class="info-row">
|
|
|
|
|
<text class="label">班级:</text>
|
|
|
|
|
<text class="value">{{ dkData.bjmc }}</text>
|
|
|
|
|
</view>
|
2025-07-27 23:37:02 +08:00
|
|
|
</view>
|
|
|
|
|
</view>
|
2025-08-29 01:27:54 +08:00
|
|
|
|
|
|
|
|
<!-- 确认操作 -->
|
|
|
|
|
<view class="action-section">
|
|
|
|
|
<view class="action-title">确认代课</view>
|
|
|
|
|
<view class="action-buttons">
|
|
|
|
|
<u-button
|
|
|
|
|
text="拒绝代课"
|
|
|
|
|
type="error"
|
|
|
|
|
@click="handleReject"
|
|
|
|
|
class="action-btn"
|
2025-07-27 23:37:02 +08:00
|
|
|
/>
|
2025-08-29 01:27:54 +08:00
|
|
|
<u-button
|
|
|
|
|
text="确认代课"
|
|
|
|
|
type="primary"
|
|
|
|
|
@click="handleConfirm"
|
|
|
|
|
class="action-btn"
|
2025-07-27 23:37:02 +08:00
|
|
|
/>
|
|
|
|
|
</view>
|
|
|
|
|
</view>
|
2025-08-29 01:27:54 +08:00
|
|
|
</view>
|
2025-07-27 23:37:02 +08:00
|
|
|
</BasicLayout>
|
2025-07-23 00:01:09 +08:00
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<script setup lang="ts">
|
2025-07-27 23:37:02 +08:00
|
|
|
import { jsQjDkQrApi } from "@/api/base/jsQjApi";
|
2025-08-29 01:27:54 +08:00
|
|
|
import { findQjById, findDkByIdApi } from "@/api/base/jsQjApi";
|
2025-07-27 23:37:02 +08:00
|
|
|
import { useUserStore } from "@/store/modules/user";
|
|
|
|
|
import { navigateBack } from "@/utils/uniapp";
|
|
|
|
|
import { onLoad } from "@dcloudio/uni-app";
|
|
|
|
|
import { ref } from "vue";
|
2025-07-23 00:01:09 +08:00
|
|
|
|
2025-08-29 01:27:54 +08:00
|
|
|
const { getJs } = useUserStore();
|
2025-07-23 00:01:09 +08:00
|
|
|
|
2025-07-27 23:37:02 +08:00
|
|
|
const qjId = ref<string>();
|
|
|
|
|
const dkId = ref<string>();
|
2025-08-29 01:27:54 +08:00
|
|
|
const qjData = ref<any>({});
|
|
|
|
|
const dkData = ref<any>({});
|
2025-07-27 23:37:02 +08:00
|
|
|
|
2025-08-29 01:27:54 +08:00
|
|
|
// 加载请假信息
|
|
|
|
|
const loadQjData = async () => {
|
|
|
|
|
try {
|
|
|
|
|
const result = await findQjById({ id: qjId.value });
|
|
|
|
|
if (result.code === 1) {
|
|
|
|
|
qjData.value = result.data;
|
|
|
|
|
}
|
|
|
|
|
} catch (error) {
|
|
|
|
|
console.error('获取请假信息失败:', error);
|
|
|
|
|
}
|
2025-07-27 23:37:02 +08:00
|
|
|
};
|
|
|
|
|
|
2025-08-29 01:27:54 +08:00
|
|
|
// 加载代课信息
|
|
|
|
|
const loadDkData = async () => {
|
|
|
|
|
try {
|
|
|
|
|
const result = await findDkByIdApi({ id: dkId.value });
|
|
|
|
|
if (result.code === 1) {
|
|
|
|
|
dkData.value = result.data;
|
2025-07-27 23:37:02 +08:00
|
|
|
}
|
2025-08-29 01:27:54 +08:00
|
|
|
} catch (error) {
|
|
|
|
|
console.error('获取代课信息失败:', error);
|
|
|
|
|
}
|
2025-07-27 23:37:02 +08:00
|
|
|
};
|
|
|
|
|
|
2025-08-29 01:27:54 +08:00
|
|
|
// 确认代课
|
|
|
|
|
const handleConfirm = async () => {
|
2025-07-27 23:37:02 +08:00
|
|
|
const params = {
|
|
|
|
|
qjId: qjId.value,
|
|
|
|
|
jsId: getJs.id,
|
2025-08-29 01:27:54 +08:00
|
|
|
qrStatus: "1", // 1表示确认
|
|
|
|
|
remark: "确认代课"
|
2025-07-27 23:37:02 +08:00
|
|
|
};
|
2025-08-29 01:27:54 +08:00
|
|
|
|
|
|
|
|
uni.showLoading({ title: "确认中..." });
|
2025-07-27 23:37:02 +08:00
|
|
|
try {
|
|
|
|
|
await jsQjDkQrApi(params);
|
2025-08-29 01:27:54 +08:00
|
|
|
uni.showToast({ title: "确认成功", icon: "success" });
|
|
|
|
|
navigateBack();
|
|
|
|
|
} catch (error) {
|
|
|
|
|
uni.showToast({ title: "确认失败", icon: "error" });
|
2025-07-27 23:37:02 +08:00
|
|
|
}
|
2025-08-29 01:27:54 +08:00
|
|
|
uni.hideLoading();
|
2025-07-27 23:37:02 +08:00
|
|
|
};
|
|
|
|
|
|
2025-08-29 01:27:54 +08:00
|
|
|
// 拒绝代课
|
|
|
|
|
const handleReject = async () => {
|
|
|
|
|
uni.showModal({
|
|
|
|
|
title: "确认拒绝",
|
|
|
|
|
content: "确定要拒绝代课吗?",
|
|
|
|
|
success: async (res) => {
|
|
|
|
|
if (res.confirm) {
|
|
|
|
|
const params = {
|
|
|
|
|
qjId: qjId.value,
|
|
|
|
|
jsId: getJs.id,
|
|
|
|
|
qrStatus: "2", // 2表示拒绝
|
|
|
|
|
remark: "拒绝代课"
|
|
|
|
|
};
|
2025-08-01 20:11:36 +08:00
|
|
|
|
2025-08-29 01:27:54 +08:00
|
|
|
uni.showLoading({ title: "处理中..." });
|
|
|
|
|
try {
|
|
|
|
|
await jsQjDkQrApi(params);
|
|
|
|
|
uni.showToast({ title: "已拒绝", icon: "success" });
|
|
|
|
|
navigateBack();
|
|
|
|
|
} catch (error) {
|
|
|
|
|
uni.showToast({ title: "操作失败", icon: "error" });
|
2025-08-01 20:11:36 +08:00
|
|
|
}
|
2025-08-29 01:27:54 +08:00
|
|
|
uni.hideLoading();
|
2025-08-01 20:11:36 +08:00
|
|
|
}
|
2025-07-27 23:37:02 +08:00
|
|
|
}
|
2025-08-29 01:27:54 +08:00
|
|
|
});
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
onLoad((options) => {
|
|
|
|
|
if (options.qjId) {
|
|
|
|
|
qjId.value = options.qjId;
|
|
|
|
|
}
|
|
|
|
|
if (options.dkId) {
|
|
|
|
|
dkId.value = options.dkId;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 加载数据
|
|
|
|
|
if (qjId.value) {
|
|
|
|
|
loadQjData();
|
|
|
|
|
}
|
|
|
|
|
if (dkId.value) {
|
|
|
|
|
loadDkData();
|
2025-07-23 00:01:09 +08:00
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
</script>
|
|
|
|
|
|
2025-08-29 01:27:54 +08:00
|
|
|
<style lang="scss" scoped>
|
|
|
|
|
.info-card,
|
|
|
|
|
.dk-info-card {
|
|
|
|
|
background: white;
|
2025-07-27 23:37:02 +08:00
|
|
|
border-radius: 8px;
|
2025-08-29 01:27:54 +08:00
|
|
|
margin-bottom: 15px;
|
|
|
|
|
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
|
|
|
|
|
}
|
2025-07-27 23:37:02 +08:00
|
|
|
|
2025-08-29 01:27:54 +08:00
|
|
|
.card-header {
|
|
|
|
|
padding: 15px;
|
|
|
|
|
border-bottom: 1px solid #eee;
|
|
|
|
|
|
|
|
|
|
.applicant-name,
|
|
|
|
|
.card-title {
|
2025-07-27 23:37:02 +08:00
|
|
|
font-size: 16px;
|
|
|
|
|
font-weight: bold;
|
|
|
|
|
color: #333;
|
|
|
|
|
}
|
2025-08-29 01:27:54 +08:00
|
|
|
}
|
2025-07-27 23:37:02 +08:00
|
|
|
|
2025-08-29 01:27:54 +08:00
|
|
|
.card-content {
|
|
|
|
|
padding: 15px;
|
|
|
|
|
}
|
2025-07-27 23:37:02 +08:00
|
|
|
|
2025-08-29 01:27:54 +08:00
|
|
|
.info-row {
|
|
|
|
|
display: flex;
|
|
|
|
|
margin-bottom: 10px;
|
|
|
|
|
|
|
|
|
|
&:last-child {
|
|
|
|
|
margin-bottom: 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.label {
|
|
|
|
|
width: 80px;
|
|
|
|
|
font-size: 14px;
|
|
|
|
|
color: #666;
|
|
|
|
|
flex-shrink: 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.value {
|
|
|
|
|
flex: 1;
|
|
|
|
|
font-size: 14px;
|
|
|
|
|
color: #333;
|
|
|
|
|
}
|
|
|
|
|
}
|
2025-07-27 23:37:02 +08:00
|
|
|
|
2025-08-29 01:27:54 +08:00
|
|
|
.action-section {
|
|
|
|
|
background: white;
|
|
|
|
|
border-radius: 8px;
|
|
|
|
|
padding: 15px;
|
|
|
|
|
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
|
|
|
|
|
|
|
|
|
|
.action-title {
|
|
|
|
|
font-size: 16px;
|
|
|
|
|
font-weight: bold;
|
|
|
|
|
color: #333;
|
|
|
|
|
margin-bottom: 15px;
|
|
|
|
|
text-align: center;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.action-buttons {
|
|
|
|
|
display: flex;
|
|
|
|
|
gap: 15px;
|
|
|
|
|
|
|
|
|
|
.action-btn {
|
|
|
|
|
flex: 1;
|
2025-07-27 23:37:02 +08:00
|
|
|
}
|
|
|
|
|
}
|
2025-07-23 00:01:09 +08:00
|
|
|
}
|
2025-07-27 23:37:02 +08:00
|
|
|
</style>
|