|
@@ -14,45 +14,14 @@
|
|
class="!w-full"
|
|
class="!w-full"
|
|
v-model="formData.date"
|
|
v-model="formData.date"
|
|
value-format="YYYY-MM-DD"
|
|
value-format="YYYY-MM-DD"
|
|
- type="date"
|
|
|
|
|
|
+ type="dates"
|
|
placeholder="选择日期"
|
|
placeholder="选择日期"
|
|
:disabled-date="disabledDate"
|
|
:disabled-date="disabledDate"
|
|
/>
|
|
/>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
</el-col>
|
|
</el-col>
|
|
- <!-- <el-col :span="12">
|
|
|
|
- <el-form-item label="姓名" prop="studentName">
|
|
|
|
- <el-input v-model="formData.studentName" placeholder="请输入姓名" />
|
|
|
|
- </el-form-item>
|
|
|
|
- </el-col> -->
|
|
|
|
- </el-row>
|
|
|
|
-
|
|
|
|
- <!-- <el-row>
|
|
|
|
- <el-col :span="12">
|
|
|
|
- <el-form-item label="学号" prop="userNumber">
|
|
|
|
- <el-input v-model="formData.userNumber" placeholder="请输入学号" />
|
|
|
|
- </el-form-item>
|
|
|
|
- </el-col>
|
|
|
|
- <el-col :span="12">
|
|
|
|
- <el-form-item label="导师名称" prop="supervisor">
|
|
|
|
- <el-input v-model="formData.supervisor" placeholder="请输入导师名称" />
|
|
|
|
- </el-form-item>
|
|
|
|
- </el-col>
|
|
|
|
</el-row>
|
|
</el-row>
|
|
|
|
|
|
- <el-row>
|
|
|
|
- <el-col :span="12">
|
|
|
|
- <el-form-item label="工作间名称" prop="deptName">
|
|
|
|
- <el-input v-model="formData.deptName" placeholder="请输入工作间名称" />
|
|
|
|
- </el-form-item>
|
|
|
|
- </el-col>
|
|
|
|
- <el-col :span="12">
|
|
|
|
- <el-form-item label="打卡类型" prop="clockInStatus">
|
|
|
|
- <el-input v-model="clockInStatuE" value="请假" disabled />
|
|
|
|
- </el-form-item>
|
|
|
|
- </el-col>
|
|
|
|
- </el-row> -->
|
|
|
|
-
|
|
|
|
<el-row>
|
|
<el-row>
|
|
<el-col :span="24">
|
|
<el-col :span="24">
|
|
<el-form-item label="备注原因" prop="remark">
|
|
<el-form-item label="备注原因" prop="remark">
|
|
@@ -61,40 +30,6 @@
|
|
</el-col>
|
|
</el-col>
|
|
</el-row>
|
|
</el-row>
|
|
|
|
|
|
- <!-- <el-form-item label="学生id" prop="studentId">
|
|
|
|
- <el-input v-model="formData.studentId" placeholder="请输入学生id" />
|
|
|
|
- </el-form-item> -->
|
|
|
|
- <!-- <el-form-item label="工作间id" prop="deptId">
|
|
|
|
- <el-input v-model="formData.deptId" placeholder="请输入工作间id" />
|
|
|
|
- </el-form-item> -->
|
|
|
|
- <!-- <el-form-item label="打卡时间" prop="clockInTime">
|
|
|
|
- <el-date-picker
|
|
|
|
- v-model="formData.clockInTime"
|
|
|
|
- type="datetime"
|
|
|
|
- value-format="x"
|
|
|
|
- placeholder="选择打卡时间"
|
|
|
|
- />
|
|
|
|
- </el-form-item> -->
|
|
|
|
- <!-- <el-form-item label="打卡状态 0正常,1迟到、2早退、3缺勤、4请假" prop="clockInStatus">
|
|
|
|
- <el-radio-group v-model="formData.clockInStatus">
|
|
|
|
- <el-radio label="1">请选择字典生成</el-radio>
|
|
|
|
- </el-radio-group>
|
|
|
|
- </el-form-item> -->
|
|
|
|
- <!-- <el-form-item label="打卡状态 " prop="clockInStatus">
|
|
|
|
- <el-select
|
|
|
|
- v-model="formData.clockInStatus"
|
|
|
|
- placeholder="请选择打卡状态 "
|
|
|
|
- clearable
|
|
|
|
- class="!w-240px"
|
|
|
|
- >
|
|
|
|
- <el-option
|
|
|
|
- v-for="option in clockInStatusOptions"
|
|
|
|
- :key="option.value"
|
|
|
|
- :label="option.label"
|
|
|
|
- :value="option.value"
|
|
|
|
- />
|
|
|
|
- </el-select>
|
|
|
|
- </el-form-item> -->
|
|
|
|
</el-form>
|
|
</el-form>
|
|
<template #footer>
|
|
<template #footer>
|
|
<el-button @click="submitForm" type="primary" :disabled="formLoading">确 定</el-button>
|
|
<el-button @click="submitForm" type="primary" :disabled="formLoading">确 定</el-button>
|
|
@@ -137,7 +72,7 @@ const formRules = reactive({
|
|
deptId: [{ required: true, message: '工作间id不能为空', trigger: 'blur' }],
|
|
deptId: [{ required: true, message: '工作间id不能为空', trigger: 'blur' }],
|
|
deptName: [{ required: true, message: '工作间名称不能为空', trigger: 'blur' }],
|
|
deptName: [{ required: true, message: '工作间名称不能为空', trigger: 'blur' }],
|
|
date: [{ required: true, message: '日期不能为空', trigger: 'blur' }],
|
|
date: [{ required: true, message: '日期不能为空', trigger: 'blur' }],
|
|
-
|
|
|
|
|
|
+ remark:[{ required: true, message: '备注原因不能为空', trigger: 'blur' }],
|
|
})
|
|
})
|
|
const formRef = ref() // 表单 Ref
|
|
const formRef = ref() // 表单 Ref
|
|
|
|
|
|
@@ -178,19 +113,24 @@ const submitForm = async () => {
|
|
// 提交请求
|
|
// 提交请求
|
|
formLoading.value = true
|
|
formLoading.value = true
|
|
try {
|
|
try {
|
|
- const data = formData.value as unknown as StudentAttendanceVO
|
|
|
|
- if (formType.value === 'create') {
|
|
|
|
- await StudentAttendanceApi.createStudentAttendance(data)
|
|
|
|
- message.success(t('common.createSuccess'))
|
|
|
|
- } else {
|
|
|
|
- await StudentAttendanceApi.updateStudentAttendance(data)
|
|
|
|
- message.success(t('common.updateSuccess'))
|
|
|
|
|
|
+ const data = formData.value as unknown as StudentAttendanceVO;
|
|
|
|
+ const dates = Array.isArray(formData.value.date) ? formData.value.date : [];
|
|
|
|
+ for (const date of dates) {
|
|
|
|
+ const submissionData = { ...data, date }; // 为每个日期创建新的提交数据
|
|
|
|
+ if (formType.value === 'create') {
|
|
|
|
+ await StudentAttendanceApi.createStudentAttendance(submissionData);
|
|
|
|
+ } else {
|
|
|
|
+ await StudentAttendanceApi.updateStudentAttendance(submissionData);
|
|
|
|
+ }
|
|
}
|
|
}
|
|
- dialogVisible.value = false
|
|
|
|
|
|
+
|
|
|
|
+ message.success(t('common.operationSuccess'));
|
|
|
|
+ dialogVisible.value = false;
|
|
|
|
+
|
|
// 发送操作成功的事件
|
|
// 发送操作成功的事件
|
|
- emit('success')
|
|
|
|
|
|
+ emit('success');
|
|
} finally {
|
|
} finally {
|
|
- formLoading.value = false
|
|
|
|
|
|
+ formLoading.value = false;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|