提交
This commit is contained in:
1 parent
e39d98e655
commit
109577a578
10 files changed
+261
-43
No files matched your search
@@ -84,3 +84,25 @@ export const downloadImportTemplate = () => {
|
||||
responseType: 'blob'
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 根据学生ID获取班主任ID
|
||||
* @param studentId 学生ID
|
||||
*/
|
||||
export const getClassTeacherId = (studentId: string | number): AxiosPromise<{ data: number }> => {
|
||||
return request({
|
||||
url: `/studentMsg/studentMsg/getClassTeacherId/${studentId}`,
|
||||
method: 'get'
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 根据学生ID获取学院请假审批人列表
|
||||
* @param studentId 学生ID
|
||||
*/
|
||||
export const getCollegeLeaveApprovers = (studentId: string | number): AxiosPromise<{ data: number[] }> => {
|
||||
return request({
|
||||
url: `/studentMsg/studentMsg/getCollegeLeaveApprovers/${studentId}`,
|
||||
method: 'get'
|
||||
});
|
||||
};
|
||||
@@ -28,7 +28,7 @@
|
||||
</div>
|
||||
</el-tooltip>
|
||||
<!-- 消息 -->
|
||||
<el-tooltip :content="proxy.$t('navbar.message')" effect="dark" placement="bottom">
|
||||
<!-- <el-tooltip :content="proxy.$t('navbar.message')" effect="dark" placement="bottom">
|
||||
<div>
|
||||
<el-popover placement="bottom" trigger="click" transition="el-zoom-in-top" :width="300" :persistent="false">
|
||||
<template #reference>
|
||||
@@ -41,7 +41,7 @@
|
||||
</template>
|
||||
</el-popover>
|
||||
</div>
|
||||
</el-tooltip>
|
||||
</el-tooltip> -->
|
||||
<!-- <el-tooltip content="Github" effect="dark" placement="bottom">
|
||||
<ruo-yi-git id="ruoyi-git" class="right-menu-item hover-effect" />
|
||||
</el-tooltip> -->
|
||||
|
||||
@@ -243,7 +243,7 @@ import ApprovalButton from '@/components/Process/approvalButton.vue';
|
||||
import { AxiosResponse } from 'axios';
|
||||
import { StartProcessBo } from '@/api/workflow/workflowCommon/types';
|
||||
import { addStudentLeave, getStudentLeave, updateStudentLeave } from '@/api/workflow/studentLeave/studentLeave';
|
||||
import { getStudentMsg } from '@/api/xg/xsjcxx/studentMsg/studentMsg';
|
||||
import { getStudentMsg, getClassTeacherId, getCollegeLeaveApprovers } from '@/api/xg/xsjcxx/studentMsg/studentMsg';
|
||||
import { startWorkFlow } from '@/api/workflow/task';
|
||||
import { StudentLeaveForm, StudentLeaveVO } from '@/api/workflow/studentLeave/studentLeave/types';
|
||||
import { StudentMsgVO } from '@/api/xg/xsjcxx/studentMsg/studentMsg/types';
|
||||
@@ -686,8 +686,9 @@ const disabledEndDate = (time: Date) => {
|
||||
// 但需要确保结束时间不能早于开始时间
|
||||
if (form.startTime) {
|
||||
const startDate = new Date(form.startTime);
|
||||
if (time.getTime() <= startDate.getTime()) {
|
||||
return true; // 禁用早于或等于开始时间的日期
|
||||
// 修改逻辑:允许选择与开始时间同一天及之后的日期
|
||||
if (time.getTime() < startDate.getTime()) {
|
||||
return true; // 只禁用早于开始时间的日期,允许同一天
|
||||
}
|
||||
}
|
||||
|
||||
@@ -766,6 +767,42 @@ const submitFlow = async () => {
|
||||
// 启动工作流
|
||||
const handleStartWorkFlow = async (data: StudentLeaveForm) => {
|
||||
try {
|
||||
// 1. 调用接口获取班主任ID
|
||||
let classTeacherId: number | null = null;
|
||||
try {
|
||||
const classTeacherResponse = await getClassTeacherId(data.studentId);
|
||||
if (classTeacherResponse && classTeacherResponse.data) {
|
||||
classTeacherId = classTeacherResponse.data;
|
||||
console.log('获取到班主任ID:', classTeacherId);
|
||||
} else {
|
||||
console.warn('获取班主任ID失败');
|
||||
ElMessage.error('获取班主任信息失败,请稍后重试');
|
||||
return; // 停止后续操作
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('调用获取班主任ID接口失败:', error);
|
||||
ElMessage.error('获取班主任信息失败,请稍后重试');
|
||||
return; // 停止后续操作
|
||||
}
|
||||
|
||||
// 2. 调用接口获取学院请假审批人列表
|
||||
let collegeApprovers: number[] = [];
|
||||
try {
|
||||
const collegeApproversResponse = await getCollegeLeaveApprovers(data.studentId);
|
||||
if (collegeApproversResponse && collegeApproversResponse.data) {
|
||||
collegeApprovers = collegeApproversResponse.data;
|
||||
console.log('获取到学院请假审批人列表:', collegeApprovers);
|
||||
} else {
|
||||
console.warn('获取学院请假审批人列表失败');
|
||||
ElMessage.error('获取学院审批人信息失败,请稍后重试');
|
||||
return; // 停止后续操作
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('调用获取学院请假审批人接口失败:', error);
|
||||
ElMessage.error('获取学院审批人信息失败,请稍后重试');
|
||||
return; // 停止后续操作
|
||||
}
|
||||
|
||||
submitFormData.value.flowCode = flowCode.value;
|
||||
submitFormData.value.businessId = data.id;
|
||||
// 流程变量
|
||||
@@ -773,9 +810,12 @@ const handleStartWorkFlow = async (data: StudentLeaveForm) => {
|
||||
// hzdyjs-qj 使用的流程变量
|
||||
qjts: data.leaveDuration,
|
||||
// leave2/6 使用的流程变量
|
||||
leaveDays: data.leaveDuration,
|
||||
// leaveDays: data.leaveDuration,
|
||||
// leave4/5 使用的流程变量
|
||||
userList: ['1', '3', '4']
|
||||
// userList: ['1', '3', '4'],
|
||||
// 新增的流程变量
|
||||
bzrspr: classTeacherId,
|
||||
ejxyspr: collegeApprovers
|
||||
};
|
||||
submitFormData.value.variables = taskVariables.value;
|
||||
const resp = await startWorkFlow(submitFormData.value);
|
||||
|
||||
Reference in new issue
Block a user