面授课bug

This commit is contained in:
zhangyc
2022-12-02 17:04:43 +08:00
parent 1078eaac89
commit c246418ef4
2 changed files with 99 additions and 21 deletions

View File

@@ -666,7 +666,7 @@ export default {
state.paperName = "";
};
const queryTest = () => {
// state.addLoading = true;
state.addLoading = true;
queryExaminationDetailById({ examinationId: props.EditTestId })
.then((res) => {
formState.examinationName = res.data.data.examinationName;

View File

@@ -690,7 +690,9 @@
<div class="btnText" @click="ft_exit">取消</div>
</div>
<div class="btn btn6">
<div class="btnText" @click="handlePush">确定</div>
<div v-if="(isEdit==0)" class="btnText" @click="handlePush">确定</div>
<div v-if="isEdit==1" class="btnText">已保存</div>
</div>
<div class="btn btn6">
<div class="btnText" @click="reviewClick">提交审核</div>
@@ -1989,7 +1991,10 @@
<div class="btnText" @click="handleCancelStu">取消</div>
</div>
<div class="cstm_btn btn6">
<div class="btnText" @click="handleSureStu">确定</div>
<div v-if="addLoading" class="btnText" >保存中</div>
<div v-else class="btnText" @click="handleSureStu">确定</div>
</div>
</div>
</div>
@@ -2483,6 +2488,7 @@
<div class="btnText" @click="agreereject_exit">取消</div>
</div>
<div class="qrm_btn btn2">
<div class="btnText" @click="handleAgreeTrue">确定</div>
</div>
</div>
@@ -2540,7 +2546,10 @@
<div class="btnText" @click="delete_exit1">取消</div>
</div>
<div class="del_btn btn2">
<div class="btnText" @click="handleDeleteExit">确定</div>
<div v-if="addLoading" class="btnText" >保存中...</div>
<div v-else class="btnText" @click="handleDeleteExit">确定</div>
</div>
</div>
</div>
@@ -2599,6 +2608,11 @@
classify="course"
/>
</div>
<div class="aeLoading" :style="{display: addLoading ? 'flex' : 'none'}" >
<a-spin :spinning="addLoading" tip="保存中..." />
</div>
</template>
<script>
import {
@@ -3123,9 +3137,12 @@ export default defineComponent({
},
setup() {
const state = reactive({
addLoading:false,
currentPlanItem: {},
teacherId:null,
teacher:null,
selectedRowKeys7: [],
isEdit:0,
//列表表格
tableData1: [
@@ -3366,7 +3383,7 @@ export default defineComponent({
addStudentList: null, //选中列表
newCourseName: null, //新建开课名称
addLoading:false,
});
const showStuAdd = () => {
@@ -3717,10 +3734,13 @@ export default defineComponent({
const rest = () => {
options4CurName.value = "";
options4CurId.value = "";
state.teacher =null;
state.teacherId =null;
};
const handleChangeTea1 = (val) => {
console.log(787877);
console.log(val);
rest();
getTea();
};
@@ -4018,6 +4038,7 @@ export default defineComponent({
for (const keyName of checkList) {
if (!keyName) {
count++;
}
}
return count ? false : true;
@@ -4041,8 +4062,11 @@ export default defineComponent({
valueHtml.value = "";
state.fileList =[];
};
//保存面授课
const handlePush = (param) => {
state.addLoading = true;
//state.isEdit = 1;
console.log("========",state.addLoading);
console.log("state.imgList");
console.log(state.imgList);
let files = "";
@@ -4053,6 +4077,8 @@ export default defineComponent({
}
files = files.slice(0, files.length - 1);
console.log(files);
let tid = (state.teacherId==null)?(state.qdms_inputV5 ? state.qdms_inputV5 : null):state.teacherId;
console.log("state.teacherId==null",state.teacherId==null,"state.qdms_inputV5",state.qdms_inputV5,"state.teacherId",state.teacherId,"tid",tid);
const postData = {
offcourseId: state.offcourseId, //不传代表新增
name: state.qdms_inputV1,
@@ -4062,23 +4088,29 @@ export default defineComponent({
categoryId: state.fen_lei,
sceneId: state.chang_jin,
tips: state.tags_val ? state.tags_val.join(",") : null,
teacherId: state.qdms_inputV5 ? state.qdms_inputV5 : null, //?
teacherId:tid, //?
intro: state.qdms_inputV6,
attach: files,
outline: valueHtml.value,
//teacherId:state.teacherId ,
};
console.log("===",state.teacherId,"hha",state.qdms_inputV5);
console.log("postData");
console.log(postData);
const checkList = [
postData.name,
postData.picUrl,
postData.targetUser,
postData.categoryId,
postData.teacherId,
];
if (!checkVal(checkList)) {
return false;
message.destroy();
return message.error("请输入必填项");
}else{
state.addLoading = true;
}
edit(postData).then((res) => {
if (res.data.code === 200) {
getTableDate();
@@ -4108,7 +4140,7 @@ export default defineComponent({
};
const createkk = () => {
getTea();
state.offcoursePlanId =null;
state.cstm_hs = true;
};
const handleCancelStu = () => {
@@ -4124,8 +4156,9 @@ export default defineComponent({
state.checked1 = false;
state.checked4 = false;
};
//保存开课
const handleSureStu = () => {
state.addLoading = false;
let startTime,
endTime = 0;
if (state.xjkkinputV3) {
@@ -4149,7 +4182,8 @@ export default defineComponent({
name: state.xjkkinputV1,
signFlag: state.xjkkradioV1 === 0 ? 1 : 0, //是否允许未报名的签到:1是0否
// signWordFlag: state.xjkkradioV1 === 1 ? 1 : 0, //签到是否需要口令:1是0否
teacherId: state.xjkkinputV4 ? state.xjkkinputV4 : 1,
teacherId: state.xjkkinputV4 ? state.xjkkinputV4 : "",
teacher:options4CurName.value,
};
console.log(postData);
const checkList = [
@@ -4160,19 +4194,24 @@ export default defineComponent({
postData.teacherId,
];
if (!checkVal(checkList)) {
return false;
message.destroy();
return message.error("请输入必填项");
}else{
state.addLoading = true;
console.log("state.addLoading ",state.addLoading );
}
editPlan(postData).then((res) => {
state.addLoading = false;
if (res.data.code === 200) {
getTableDate3();
handleCancelStu();
rest();
rest();
}
});
state.addLoading = false;
};
//编辑开课
const handelEditStu = async (itm) => {
console.log(itm);
state.offcourseId = itm.offcourseId;
state.offcoursePlanId = itm.offcoursePlanId;
@@ -4271,17 +4310,21 @@ export default defineComponent({
state.ftQR_hs = false;
state.ftsQR_hs = false;
state.vipftQR_hs = false;
state.addLoading =false;
};
const rg_exit = () => {
state.rg_hs = false;
state.addLoading =false;
};
const graduate_exit = () => {
state.graduate_hs = false;
state.addLoading =false;
};
const agreereject_exit = () => {
state.agreereject_hs = false;
state.agreestudy_hs = false;
state.rejectstudy_hs = false;
state.addLoading =false;
};
const delete_exit1 = () => {
state.delete_hs = false;
@@ -4290,6 +4333,7 @@ export default defineComponent({
state.nouse_hs = false;
state.rg_hs = false;
state.graduate_hs = false;
state.addLoading =false;
};
const handleRejectExit = (itm, type) => {
if (type === "1") {
@@ -4342,7 +4386,9 @@ export default defineComponent({
delete_exit1();
}
};
//确认复制
const handleAgreeTrue = async () => {
if (state.agreestudy_hs) {
handleStudent({
offcoursePlanId: state.offcoursePlanId,
@@ -4352,6 +4398,7 @@ export default defineComponent({
});
getTableDate2();
delete_exit1();
state.addLoading =false;
}
if (state.rejectstudy_hs) {
handleStudent({
@@ -4362,9 +4409,13 @@ export default defineComponent({
});
getTableDate2();
delete_exit1();
}
};
//确认复制课程
const handleDeleteExit = async () => {
state.addLoading =true;
if (state.del_hs) {
console.log(11111111);
if (state.offcourseId && state.offcoursePlanId && state.studentId) {
@@ -4388,7 +4439,7 @@ export default defineComponent({
console.log(3333333);
handle({
offcourseId: state.offcourseId,
type: 1,
type: -1,
}).then((res) => {
if (res.data.code === 200) {
getTableDate();
@@ -4396,6 +4447,7 @@ export default defineComponent({
}
});
}
}
if (state.copy_hs) {
console.log(2222222);
@@ -4422,6 +4474,7 @@ export default defineComponent({
signFlag: item.signFlag, //是否允许未报名的签到:1是0否
//signWordFlag: item.signWordFlag, //签到是否需要口令:1是0否
teacherId: item.teacherId,
teacher:item.teacher,
};
console.log(obj);
editPlan(obj).then((res) => {
@@ -4452,12 +4505,14 @@ export default defineComponent({
intro: item.intro,
attach: item.attach,
outline: item.outline,
teacher:item.teacher,
};
edit(postData).then((res) => {
if (res.data.code === 200) {
getTableDate();
delete_exit1();
rest();
}
});
}
@@ -4477,6 +4532,7 @@ export default defineComponent({
});
}
}
};
const handleDeleteKaike = (value) => {
state.offcoursePlanId = value.offcoursePlanId;
@@ -4518,8 +4574,12 @@ export default defineComponent({
}
});
};
//获取教师
const getTea = async () => {
console.log("获取授课教师信息");
options4CurName.value =state.teacher;
options4CurId.value =state.teacherId;
const item1 = await getMemberInfoApi({
pageNo: state.currentPageTea1,
pageSize: state.pageSizeTea1,
@@ -4542,9 +4602,14 @@ export default defineComponent({
if (state.offcoursePlanId && state.offcourseId) {
options4CurName.value = item.realName;
state.xjkkinputV4 = item.realName;
state.teacherId = item.id;
} else if (state.offcourseId) {
options4CurName.value = item.realName;
state.qdms_inputV5 = item.realName;
state.teacher = item.realName;
state.teacherId =item.id;
console.log("那个老师",item);
}
}
newArr.push({
@@ -4556,7 +4621,10 @@ export default defineComponent({
console.log("options4.value");
console.log(options4.value);
};
//编辑面授课
const handleEdit = async (itm, type) => {
state.isEdit = 0;
console.log(45555);
console.log(itm);
if (type === "1") {
@@ -4581,9 +4649,9 @@ export default defineComponent({
state.fen_lei = String(item.categoryId);
state.chang_jin = String(item.sceneId);
state.tags_val = item.tips ? item.tips.split(",") : [];
// state.qdms_inputV5 = item.teacherId;
options4CurId.value = item.teacherId;
state.qdms_inputV5 = null;
//state.qdms_inputV5 = item.teacherId;
state.teacher = item.teacher;
state.teacherId = item.teacherId;
state.qdms_inputV6 = item.intro;
if(item.attach==""){
state.imgList =[];
@@ -4806,6 +4874,11 @@ export default defineComponent({
}
};
const submitReview = (id) => {
state.addLoading =true;
if(id==""){
return message.error("请先完成保存");
}
let obj = {
offcourseId: id ? id : state.offcourseId,
type: 1,
@@ -4817,6 +4890,8 @@ export default defineComponent({
ft_exit();
rest();
getTableDate();
state.addLoading =false;
}
});
};
@@ -5023,6 +5098,9 @@ export default defineComponent({
});
</script>
<style lang="scss">
.aeLoading{
z-index: 10000;
}
.courseManage {
width: 100%;
height: 100%;