mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/vue/fe-manage.git
synced 2025-12-10 19:36:46 +08:00
教师回退,防止报错
This commit is contained in:
@@ -125,7 +125,7 @@
|
||||
<span style="margin-right: 3px">面授时间</span>
|
||||
</div>
|
||||
<div class="select fitems">
|
||||
<!-- <a-range-picker
|
||||
<a-range-picker
|
||||
style="width: 88%; height: 40px; border-radius: 8px"
|
||||
:show-time="{ format: 'HH:mm' }"
|
||||
format="YYYY-MM-DD HH:mm"
|
||||
@@ -135,28 +135,6 @@
|
||||
separator="至"
|
||||
:placeholder="[' 开始时间', ' 结束时间']"
|
||||
:disabled="editBeginClass"
|
||||
/> -->
|
||||
<a-date-picker
|
||||
style="width: 41%; height: 40px; border-radius: 8px"
|
||||
:show-time="{ format: 'HH:mm' }"
|
||||
format="YYYY-MM-DD HH:mm"
|
||||
valueFormat="YYYY-MM-DD HH:mm"
|
||||
v-model:value="dateTime[0]"
|
||||
@change="timeChange"
|
||||
:placeholder="' 开始时间'"
|
||||
:disabled="editBeginClass"
|
||||
/>
|
||||
<span style="margin: 0 10px;">至</span>
|
||||
<!-- 第二个日期选择器,用于结束时间 -->
|
||||
<a-date-picker
|
||||
style="width: 41%; height: 40px; border-radius: 8px"
|
||||
:show-time="{ format: 'HH:mm' }"
|
||||
format="YYYY-MM-DD HH:mm"
|
||||
valueFormat="YYYY-MM-DD HH:mm"
|
||||
v-model:value="dateTime[1]"
|
||||
@change="timeChangeEnd"
|
||||
:placeholder="' 结束时间'"
|
||||
:disabled="editBeginClass"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
@@ -552,13 +530,12 @@ const formDataRule = {
|
||||
const { validate } = Form.useForm(formData, formDataRule);
|
||||
const durationText = computed(() => dateTime.value?.length?dayjs(dateTime.value[1]).diff(dayjs(dateTime.value[0]),'minute'):'请输入持续时间');
|
||||
function timeChange(time, timeStr) {
|
||||
formData.value.beginTime = timeStr;
|
||||
formData.value.beginTime = timeStr[0];
|
||||
formData.value.endTime = timeStr[1];
|
||||
// formData.value.duration = durationText.value
|
||||
// formData.value.duration || (formData.value.duration = dayjs(timeStr[1]).diff(dayjs(timeStr[0]),'minute'))
|
||||
}
|
||||
function timeChangeEnd(time,timeStr){
|
||||
formData.value.endTime = timeStr;
|
||||
}
|
||||
|
||||
function search() {
|
||||
tableRef.value.fetch();
|
||||
}
|
||||
@@ -592,7 +569,6 @@ const createNewCourse = () => {
|
||||
type: props.type,
|
||||
offcourseId: params.value.offcourseId,
|
||||
draftTaskId: params.value.draftTaskId,
|
||||
name:courseName.value
|
||||
});
|
||||
dateTime.value = [];
|
||||
validated.value = 0;
|
||||
@@ -626,10 +602,6 @@ async function coursePlanConfirm() {
|
||||
message.info('讲师费已进入审批阶段,无法编辑')
|
||||
return
|
||||
}
|
||||
if(dateTime.value.length<2){
|
||||
message.info('请选择开始时间和结束时间')
|
||||
return
|
||||
}
|
||||
await validate().catch(({ errorFields }) => {
|
||||
message.warning(errorFields[0].errors.join());
|
||||
throw Error("数据校验不通过");
|
||||
|
||||
Reference in New Issue
Block a user