Merge remote-tracking branch 'origin/develop' into develop

This commit is contained in:
yuping
2023-03-21 15:35:05 +08:00

View File

@@ -106,6 +106,7 @@
v-model:validated="validated" v-model:validated="validated"
:id="formData.id" :id="formData.id"
show-count show-count
:onceName="onceName"
:type="5" :type="5"
style="width: 440px; height: 40px; border-radius: 8px" style="width: 440px; height: 40px; border-radius: 8px"
placeholder="请输入开课名称" placeholder="请输入开课名称"
@@ -214,7 +215,7 @@
</div> </div>
</div> </div>
</div> </div>
<div class="cstm_items"> <!-- <div class="cstm_items">
<div class="signbox"> <div class="signbox">
<span style="margin-right: 3px">报名设置</span> <span style="margin-right: 3px">报名设置</span>
</div> </div>
@@ -225,7 +226,7 @@
<span style="color: #6d7584">是否允许公开报名</span> <span style="color: #6d7584">是否允许公开报名</span>
</CheckBox> </CheckBox>
</div> </div>
</div> </div> -->
<div class="cstm_items" style="align-items: flex-start;"> <div class="cstm_items" style="align-items: flex-start;">
<div class="signbox"> <div class="signbox">
@@ -357,6 +358,7 @@ import BaseTable from "@/components/common/BaseTable";
import {request} from "@/api/request"; import {request} from "@/api/request";
import dialog from "@/utils/dialog"; import dialog from "@/utils/dialog";
import {useResetRef} from "@/utils/useCommon"; import {useResetRef} from "@/utils/useCommon";
import { validateName } from "@/api/index1";
const props = defineProps({ const props = defineProps({
type: Number, type: Number,
@@ -435,7 +437,7 @@ const params = ref({
const validated = ref(0); const validated = ref(0);
const dateTime = ref([]); const dateTime = ref([]);
const courseName = ref(); const courseName = ref();
const onceName = ref("");
const formData = useResetRef({ const formData = useResetRef({
name: "", name: "",
address: "", address: "",
@@ -529,6 +531,7 @@ const createNewCourse = () => {
offcourseId: params.value.offcourseId, offcourseId: params.value.offcourseId,
draftTaskId: params.value.draftTaskId, draftTaskId: params.value.draftTaskId,
}); });
onceName.value = "";
dateTime.value = []; dateTime.value = [];
validated.value = 0; validated.value = 0;
offCourseNewVisiable.value = true; offCourseNewVisiable.value = true;
@@ -552,6 +555,19 @@ async function coursePlanConfirm() {
message.warning(errorFields[0].errors.join()); message.warning(errorFields[0].errors.join());
throw Error("数据校验不通过"); throw Error("数据校验不通过");
}); });
const offName = await validateName({
name: formData.value.name,
type: 5,
id: formData.value.id,
}).then((res) => {
console.log(res, res.data.data);
return res.data.data === 1;
});
if (offName) {
message.destroy();
message.warning("开课名称重复,请重新填写");
return;
}
offCourseNewVisiable.value = false; offCourseNewVisiable.value = false;
tableRef.value.toLoading(); tableRef.value.toLoading();
await request(COURSE_PLAN_EDIT, { ...formData.value }); await request(COURSE_PLAN_EDIT, { ...formData.value });
@@ -574,6 +590,7 @@ function openDrawer(row) {
params.value.draftTaskId = row.id; params.value.draftTaskId = row.id;
formData.value.offcourseId = row.courseId; formData.value.offcourseId = row.courseId;
formData.value.draftTaskId = row.id; formData.value.draftTaskId = row.id;
onceName.value = row.name;
courseName.value = row.name; courseName.value = row.name;
nextTick(tableRef.value.fetch); nextTick(tableRef.value.fetch);
} }