1、调整请假

2、修复点名按钮的时间判断
This commit is contained in:
ywyonui 2025-08-30 09:10:44 +08:00
parent 833e0e9498
commit fc70ba71b1
4 changed files with 117 additions and 89 deletions

View File

@ -1,86 +1,69 @@
<template> <template>
<view class="qj-detail back-f8f8f8"> <view class="qj-detail back-f8f8f8">
<view class="pt-15"> <view class="pt-15">
<view class="dk-title pl-15 pr-15"> <BasicTabs
<BasicTitle line title="请假信息" :isBorder="false" /> class="detail-tabs"
</view> :list="tabList"
<!-- 请假信息卡片 --> bar-width="60px"
scroll-count="4"
:current="curTabIndex"
@change="switchTab"
/>
</view>
<!-- 请假信息 -->
<view v-show="curTabIndex === 0">
<view class="info-card"> <view class="info-card">
<view class="card-header"> <view class="card-header">
<text class="applicant-name" v-if="dbFlag">{{ qjData.xxzy }}</text> <text class="applicant-name" v-if="dbFlag">{{ qjData.xxzy }}</text>
<text class="applicant-name" v-else <text class="applicant-name" v-else>教师{{ qjData.jsName }}的请假申请</text>
>教师{{ qjData.jsName }}的请假申请</text
>
</view> </view>
<view class="divider"></view> <view class="divider"></view>
<view class="card-body"> <view class="card-body">
<view class="info-row"> <view class="info-row"><text class="label">请假类型:</text><text class="value">{{ qjData.qjlx }}</text></view>
<text class="label">请假类型:</text> <view class="info-row"><text class="label">开始时间:</text><text class="value">{{ qjData.qjkstime }}</text></view>
<text class="value">{{ qjData.qjlx }}</text> <view class="info-row"><text class="label">结束时间:</text><text class="value">{{ qjData.qjjstime }}</text></view>
</view> <view class="info-row"><text class="label">请假时长:</text><text class="value">{{ qjData.qjsc }}</text></view>
<view class="info-row"> <view class="info-column"><text class="label">请假事由:</text><text class="value">{{ qjData.qjsy }}</text></view>
<text class="label">开始时间:</text>
<text class="value">{{ qjData.qjkstime }}</text>
</view>
<view class="info-row">
<text class="label">结束时间:</text>
<text class="value">{{ qjData.qjjstime }}</text>
</view>
<view class="info-row">
<text class="label">请假时长:</text>
<text class="value">{{ qjData.qjsc }}</text>
</view>
<view class="info-column">
<text class="label">请假事由:</text>
<text class="value">{{ qjData.qjsy }}</text>
</view>
<view class="info-row" style="margin-bottom: 0; margin-top: 10px"> <view class="info-row" style="margin-bottom: 0; margin-top: 10px">
<text class="label">代课方式:</text> <text class="label">代课方式:</text>
<text class="value">{{ <text class="value">{{ dkfsText }}</text>
dkfsList[qjData.dkfs] ? dkfsList[qjData.dkfs].text : ""
}}</text>
</view> </view>
</view> </view>
</view> </view>
</view> </view>
<view class="" v-if="qjData.dkfs != 2 && dkList && dkList.length">
<view class="dk-title pl-15 pr-15">
<BasicTitle line title="代课明细" :isBorder="false" />
</view>
<view> <!-- 代课信息 -->
<view class="dk-card"> <view v-show="showDkTab && curTabIndex === 1">
<view class="card-body"> </view> <view v-if="qjData && qjData.dkfs == 2" class="p-15">
</view> 无需代课
</view> </view>
<!-- 请假信息卡片 --> <view v-else>
<view class="info-card" v-for="(item, index) in dkList" :key="index"> <view class="info-card" v-for="(item, index) in dkList" :key="index">
<view class="card-header"> <view class="card-header">
<text class="applicant-name" <text class="applicant-name">{{ item.dktime }}{{ item.xqLabel }}{{ item.jcmc }}</text>
>{{ item.dktime }}{{ item.xqLabel }}{{ item.jcmc }}</text
>
</view>
<view class="divider"></view>
<view class="card-body">
<view class="info-row">
<text class="label">排课名称:</text>
<text class="value">{{ item.pkName }}</text>
</view> </view>
<view class="info-row"> <view class="divider"></view>
<text class="label">上课时间:</text> <view class="card-body">
<text class="value">{{ item.startTime }}-{{ item.endTime }}</text> <view class="info-row">
</view> <text class="label">排课名称:</text>
<view class="info-row"> <text class="value">{{ item.pkMc }}</text>
<text class="label">代课老师:</text> </view>
<view class="value">{{ item.jsName }}</view> <view class="info-row">
<text class="label">上课时间:</text>
<text class="value">{{ item.startTime }}-{{ item.endTime }}</text>
</view>
<view class="info-row">
<text class="label">代课老师:</text>
<view class="value">{{ item.jsName }}</view>
</view>
</view> </view>
</view> </view>
</view> </view>
</view> </view>
<view class="">
<view class="dk-title pl-15 pr-15"> <!-- 审批流程 -->
<BasicTitle line title="请假流程" :isBorder="false" /> <view v-show="curTabIndex === 2">
</view>
<ProgressList :qjId="qjData.id" /> <ProgressList :qjId="qjData.id" />
</view> </view>
</view> </view>
@ -90,6 +73,7 @@
import { findDkPageApi, findQjById } from "@/api/base/jsQjApi"; import { findDkPageApi, findQjById } from "@/api/base/jsQjApi";
import { useDataStore } from "@/store/modules/data"; import { useDataStore } from "@/store/modules/data";
import ProgressList from "./progressList.vue"; import ProgressList from "./progressList.vue";
import { ref, computed, watch, onMounted } from "vue";
const { getXxts } = useDataStore(); const { getXxts } = useDataStore();
// //
@ -114,6 +98,12 @@ const notifyParentLoaded = () => {
}; };
const qjData = ref<any>({}); const qjData = ref<any>({});
const tabList = ref([{ name: "请假信息", id: "tab-qj" }, { name: "审批流程", id: "tab-sp" }]);
const showDkTab = ref(false);
const curTabIndex = ref(0);
const switchTab = (index: number) => {
curTabIndex.value = index;
};
const wdNameList = ref<string[]>([ const wdNameList = ref<string[]>([
"周一", "周一",
@ -139,6 +129,12 @@ const jsTypeMc: any = {
const dkList = ref<any>([]); const dkList = ref<any>([]);
const dkfsText = computed(() => {
if (!qjData.value) { return ''; }
let dkfs = typeof qjData.value.dkfs === "string" ? parseInt(qjData.value.dkfs) : qjData.value.dkfs || 0;
return dkfsList.value[dkfs].text;
});
watch( watch(
() => props.qjId, () => props.qjId,
(newVal, oldVal) => { (newVal, oldVal) => {
@ -153,10 +149,27 @@ watch(
const init = async () => { const init = async () => {
{ {
const res = await findQjById({ id: props.qjId }); const res = await findQjById({ id: props.qjId });
qjData.value = res.result; qjData.value = (res && res.result) ? res.result : {};
} }
// // Tab
if (qjData.value.dkfs == 2) { showDkTab.value = !!(qjData.value && qjData.value.dkfs != 2);
if (showDkTab.value) {
// Tab
const hasDk = tabList.value.findIndex((t:any) => t.id === 'tab-dk') > -1;
if (!hasDk) {
tabList.value = [{ name: "请假信息", id: "tab-qj" }, { name: "代课信息", id: "tab-dk" }, { name: "审批流程", id: "tab-sp" }];
}
} else {
// Tab
tabList.value = [{ name: "请假信息", id: "tab-qj" }, { name: "审批流程", id: "tab-sp" }];
}
//
if (!showDkTab.value) {
//
if (props.dbFlag) {
qjData.value.xxzy = getXxts.xxzy;
}
notifyParentLoaded();
return; return;
} }
{ {
@ -165,7 +178,9 @@ const init = async () => {
page: 1, page: 1,
rows: 1000, rows: 1000,
}); });
dkList.value = res.rows.map((item: any) => { console.log(res);
const rows = (res && (res.rows || res.result || res.data)) || [];
dkList.value = rows.map((item: any) => {
item.dktime = item.dktime.split(" ")[0]; item.dktime = item.dktime.split(" ")[0];
item.jcmc = jsTypeMc[item.jcType] + "第" + item.jc + "节"; item.jcmc = jsTypeMc[item.jcType] + "第" + item.jc + "节";
const xq: number = item.xq - 1; const xq: number = item.xq - 1;

View File

@ -7,8 +7,10 @@
</template> </template>
<template #spcs> <template #spcs>
<BasicSpCsMgr <BasicSpCsMgr
v-model:approvers="formData.sprList" ruleId="yfzc_js_qj"
v-model:ccPersons="formData.csrList" :qjId="formData.id"
:defaultValue="defSpCs"
@change="onSpCsChange"
/> />
</template> </template>
</BasicForm> </BasicForm>
@ -44,11 +46,11 @@ const props = withDefaults(defineProps<{
}>(), { }>(), {
data: () => ({ data: () => ({
id: "", id: "",
qjlx: "", qjlx: "事假",
qjkstime: "", qjkstime: "2025-08-28 12:00:00",
qjjstime: "", qjjstime: "2025-08-29 12:00:00",
qjsc: "", qjsc: "24小时",
qjsy: "", qjsy: "测试请假",
dkfs: 0, dkfs: 0,
sprList: [], sprList: [],
csrList: [], csrList: [],
@ -60,6 +62,14 @@ let formData = ref<any>({
jsId: getJs.id, jsId: getJs.id,
}); });
const defSpCs = computed(() => {
return {
sprList: formData.value.sprList,
csrList: formData.value.csrList,
}
})
const dkRef = ref<any>(null); const dkRef = ref<any>(null);
if (typeof props.data.dkfs === "string") { if (typeof props.data.dkfs === "string") {
@ -189,9 +199,11 @@ const validateTime = () => {
} }
const updateDk = () => { const updateDk = () => {
if (dkRef.value) { nextTick(() => {
dkRef.value.getPkkbList(); if (dkRef.value) {
} dkRef.value.getPkkbList();
}
});
}; };
// //
@ -240,6 +252,7 @@ const submit = async () => {
params.jsId = getJs.id; params.jsId = getJs.id;
params.jsName = getJs.jsxm; params.jsName = getJs.jsxm;
} }
console.log("请假参数:", params);
uni.showLoading({ title: "提交中..." }); uni.showLoading({ title: "提交中..." });
await submitApi(params).then(() => { await submitApi(params).then(() => {
showToast({ title: "提交成功", icon: "success" }); showToast({ title: "提交成功", icon: "success" });
@ -249,6 +262,14 @@ const submit = async () => {
}); });
uni.hideLoading(); uni.hideLoading();
}; };
// /
const onSpCsChange = (payload: any) => {
if (payload) {
formData.value.sprList = Array.isArray(payload.sprList) ? payload.sprList : [];
formData.value.csrList = Array.isArray(payload.csrList) ? payload.csrList : [];
}
};
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>

View File

@ -9,19 +9,12 @@
@loadDkList="handleDkListLoaded" @loadDkList="handleDkListLoaded"
/> />
<!-- 审批意见卡片 -->
<view class="info-card">
<view class="card-header">
<text class="applicant-name">审批意见</text>
</view>
<view class="divider"></view>
<view class="card-body">
<BasicForm @register="register" />
</view>
</view>
</view> </view>
<template #bottom> <template #bottom>
<view class="white-bg-color py-5"> <view class="white-bg-color py-5">
<view class="px-15">
<BasicForm @register="register" />
</view>
<view class="flex-row items-center pb-10 pt-5"> <view class="flex-row items-center pb-10 pt-5">
<u-button <u-button
text="取消" text="取消"
@ -94,8 +87,7 @@ const [register, { getValue }] = useForm({
], ],
}); });
//
const qjData = computed(() => getData || {});
const handleQjDataLoaded = (data: any) => { const handleQjDataLoaded = (data: any) => {
setData(data); setData(data);
@ -117,7 +109,7 @@ const submit = async () => {
} }
const params = { const params = {
qjId: qjData.value.id, qjId: qjId.value,
jsId: getJs.id, jsId: getJs.id,
spStatus: formData.spStatus, spStatus: formData.spStatus,
spYj: formData.spYj, spYj: formData.spYj,
@ -151,6 +143,7 @@ const submit = async () => {
onLoad(async (data?: any) => { onLoad(async (data?: any) => {
// //
console.log(data);
if (data && data.from && data.from == "db") { if (data && data.from && data.from == "db") {
dbFlag.value = true; dbFlag.value = true;

View File

@ -240,7 +240,6 @@ const goDm = (xkkc: any) => {
} else { } else {
msg = "上课时间未到,无法点名"; msg = "上课时间未到,无法点名";
} }
dmFlag = true;
if (dmFlag) { if (dmFlag) {
setData(xkkc); setData(xkkc);
uni.navigateTo({ uni.navigateTo({