|
|
@@ -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);
|