Commit 99363e06 authored by 罗超's avatar 罗超

2

parent 7c2b3879
......@@ -128,4 +128,26 @@ export function setAppointmentMakeup(data) {
method: 'post',
data
})
}
////////////////////////新版////////////////////////
/**
* 获取可预约的学生列表(包含正常上课 重上课)
*/
export function getCanAppointmentStuList_V2(data) {
return request({
url: '/Scroll/GetCanAppointmentStuList_V2',
method: 'post',
data
})
}
/**
* 新增约课
*/
export function setAdminScrollAppointment_V2(data) {
return request({
url: '/Scroll/SetAdminScrollAppointment_V2',
method: 'post',
data
})
}
\ No newline at end of file
......@@ -90,8 +90,9 @@
class="q-mr-sm" />
<q-btn color="accent" size="xs" label="取消预约" @click="cancelSub()" :disable="checkStuType2.length == 0"
class="q-mr-sm" />
<q-btn color="accent" size="xs" label="补课" @click="showRelenishDig = true" style="margin-left:440px" />
<q-btn color="accent" size="xs" label="重学" @click="showReStudyDig = true" class="q-ml-sm" />
<q-btn color="accent" size="xs" label="补录" @click="showMakeUpDig = true" style="margin-left:440px" />
<!-- <q-btn color="accent" size="xs" label="补课" @click="showRelenishDig = true" style="margin-left:440px" />
<q-btn color="accent" size="xs" label="重学" @click="showReStudyDig = true" class="q-ml-sm" /> -->
</div>
<div class="row">
......@@ -126,6 +127,7 @@
<ChangeCourse v-model="showChangeDig" :saveObj="CourseObj" @success="ChangeCourseSuccessHandle" />
<ReStudy v-model="showReStudyDig" :saveObj="saveObj" :date="dateObj.date" @success="ReStudyHandle"></ReStudy>
<Relenish v-model="showRelenishDig" :saveObj="saveObj" :date="dateObj.date" @success="RelenishHandle"></Relenish>
<MakeUp v-model="showMakeUpDig" :saveObj="saveObj" :date="dateObj.date" @success="RelenishHandle"></MakeUp>
</div>
</template>
<script>
......@@ -136,11 +138,13 @@
import ChangeCourse from "./changeCourse";
import ReStudy from "./reStudy";
import Relenish from "./replenish.vue";
import MakeUp from "./makeUp.vue"
export default {
components: {
ChangeCourse,
ReStudy,
Relenish
Relenish,
MakeUp
},
props: {
dateObj: {
......@@ -166,6 +170,7 @@
showChangeDig: false,
showReStudyDig: false,
showRelenishDig: false,
showMakeUpDig: false,
CourseObj: {}
};
},
......
<template>
<div>
<q-dialog
v-model="show"
persistent
transition-show="scale"
transition-hide="scale"
@input="changeDig"
>
<q-card style="width: 600px;max-width:900px;">
<q-card-section class="row items-center q-pb-none">
<div class="text-h6">补录</div>
<q-space />
<q-btn icon="close" flat round dense @click="changeDig(false)" />
</q-card-section>
<q-card-section class="q-pt-none scroll" style="max-height: 70vh">
<div class="row col q-mr-lg q-col-gutter-md changeCourse">
<div class="row col-12">
<q-input
filled
stack-label
v-model="reStuMsg.StuName"
label="学员姓名"
class="col-10"
hint="提示:需输入学员姓名查询学员列表"
/>
<div class="col-2 q-pt-md">
<q-btn
size="sm"
color="accent"
label="查询"
@click="getStu"
class="q-ml-md"
/>
</div>
</div>
<div class="row col-12">
<q-select
filled
v-model="stuInfo"
stack-label
option-value="StuId"
option-label="StuName"
:options="stuOptions"
label="学员列表"
class="col-10"
>
<template v-slot:no-option>
<q-item>
<q-item-section class="text-grey">
未找到相关数据
</q-item-section>
</q-item>
</template>
</q-select>
<div class="col-2 q-pt-md">
<q-btn
size="sm"
color="accent"
label="添加"
@click="save"
class="q-ml-md"
/>
</div>
</div>
</div>
</q-card-section>
<q-separator />
<q-card-actions align="right" class="bg-white">
<q-btn label="取消" flat color="grey-10" @click="changeDig(false)" />
</q-card-actions>
</q-card>
</q-dialog>
</div>
</template>
<script>
import {
getCanAppointmentAgainList,
setAppointmentAgain
} from "../../../api/studyabroad/subscribe.js";
export default {
model: {
prop: "show",
event: "changeshow"
},
props: {
saveObj: {
type: Object,
default: null
},
date: {
type: String,
default: ""
},
show: {
type: Boolean,
default: false
}
},
watch: {
show(val) {
if (val) {
this.stuOptions = [];
}
}
},
data() {
return {
reStuMsg: {
StuName: "",
CourseGradeNo: 0,
CourseGradeId: 0
},
stuInfo: "",
stuOptions: []
};
},
methods: {
//开关弹窗
changeDig(val) {
this.$emit("changeshow", val);
},
getStu() {
if (!this.reStuMsg.StuName) {
this.$q.notify({
message: "请输入学生姓名",
position: "top"
});
return;
}
this.reStuMsg.CourseGradeNo=this.saveObj.Ranks,
this.reStuMsg.CourseGradeId = this.saveObj.CourseGradeId;
getCanAppointmentAgainList(this.reStuMsg).then(res => {
if (res.Code == 1) {
this.stuOptions = res.Data;
}
});
},
save() {
if (!this.stuInfo.StuId) {
this.$q.notify({
message: "请选择学生",
position: "top"
});
return;
}
const saveMsg = {
Date: this.date,
TeacherId: this.saveObj.Tid,
ShiftSort: this.saveObj.ShiftSort,
StuId: this.stuInfo.StuId,
GuestId: this.stuInfo.GuestId,
CourseId: this.saveObj.CourseId,
CourseGradeNo:this.saveObj.Ranks,
CourseGradeId: this.saveObj.CourseGradeId
};
setAppointmentAgain(saveMsg).then(res => {
if (res.Code == 1) {
this.$q.notify({
message: "操作成功",
position: "top"
});
this.$emit("success", {
GuestName: this.stuInfo.StuName,
AppointType: 3,
AppointmentId: res.Data
});
this.stuInfo = "";
this.stuOptions = [];
this.getStu();
}
});
}
}
};
</script>
......@@ -73,25 +73,45 @@
</template>
</q-field>
<div class="row col" v-show="
(editType == 1 ||
((editType == 1&&checkChapter.ChapterId>0) ||
(saveObj.ClassType == 3 && saveObj.AppointState == 1)) &&
auth.IsEdit&&showAddStu()
">
<div class="col-10">
<q-select filled stack-label use-input option-value="StuId" option-label="StuName" v-model="stuInfo"
ref="CourseId" :options="stuList" label="添加学员" :dense="false" class="col-6" @filter="filterStu">
<template v-slot:no-option>
<q-item>
<q-item-section class="text-grey">
未找到相关数据
</q-item-section>
</q-item>
</template>
</q-select>
<div class="row col-6">
<q-input filled stack-label v-model="stuMsg_v2.StuName" label="学员姓名" class="col-9"
hint="提示:需输入学员姓名查询学员列表" />
<div class="col-3 q-pt-md q-pl-md">
<q-btn size="sm" color="accent" label="查询" @click="getStu_V2" />
</div>
</div>
<div class="col-2 q-pt-md">
<q-btn size="sm" color="accent" label="添加" @click="subscribeCourse" :loading="addLoading"
class="q-ml-md" :disable="!stuInfo.StuId || stuInfo.StuId <= 0" />
<div class="row col-6">
<div class="col-9">
<q-select filled stack-label use-input option-value="StuId" option-label="StuName" v-model="stuInfo"
ref="CourseId" :options="stuList" label="学员列表" :dense="false" class="col-6" @filter="filterStu">
<template v-slot:no-option>
<q-item>
<q-item-section class="text-grey">
未找到相关数据
</q-item-section>
</q-item>
</template>
<template v-slot:option="scope">
<q-item v-bind="scope.itemProps" v-on="scope.itemEvents">
<q-item-section >
<div class="flex">
<span>{{ scope.opt.StuName }}</span>
<span v-if="scope.opt.State===3">(重)</span>
<span>-{{ scope.opt.CourseName }}</span>
</div>
</q-item-section>
</q-item>
</template>
</q-select>
</div>
<div class="col-3 q-pt-md q-pl-md">
<q-btn size="sm" color="accent" label="添加" @click="subscribeCourse" :loading="addLoading"
:disable="!stuInfo.StuId || stuInfo.StuId <= 0" />
</div>
</div>
</div>
<q-field filled label="已约学员" stack-label disable class="col-12" v-if="editType == 1&&addStuList.length>0">
......@@ -116,7 +136,9 @@
import {
GetCanTeacherClassTimeList,
GetCanAppointmentStuList,
SetAdminScrollAppointment
// SetAdminScrollAppointment,
getCanAppointmentStuList_V2,
setAdminScrollAppointment_V2
} from "../../../api/studyabroad/subscribe.js";
import {
queryCourseDropdownList,
......@@ -166,6 +188,7 @@
},
watch: {
show(val) {
console.log(243, this.saveObj)
this.addLoading = false;
this.addStuList = []
if (val) {
......@@ -177,9 +200,10 @@
this.courseCheckList = [];
this.stuList = [];
this.allStuList = [];
if (this.editType == 2&&this.saveObj.ClassType==3) {
this.getStu();
}
this.stuMsg_v2.StuName=""
// if (this.editType == 2 && this.saveObj.ClassType == 3) {
// this.getStu_V2();
// }
}
}
},
......@@ -199,6 +223,11 @@
CourseId: 0,
NextCourseGradeNo: 0
},
stuMsg_v2: {
StuName: "",
NextCourseGradeNo: 0,
CourseGradeId: 0,
},
detailObj: {},
detailMsg: {
StuId: 0,
......@@ -211,8 +240,9 @@
StuId: 0,
GuestId: 0,
CourseId: 0,
ChapterNo: 0,
CourseGradeId: 0
// ChapterNo: 0,
CourseGradeId: 0,
CourseGradeNo: 0
},
stuInfo: "",
checkStuList: [],
......@@ -225,6 +255,7 @@
};
},
mounted() {
this.getCourseList();
},
methods: {
......@@ -278,7 +309,7 @@
//获取老师的空闲上课时段
getCanTeacherTimeList() {
this.teaClassMsg.Date = this.dateObj.date;
this.courseCheckList=[]
this.courseCheckList = []
this.stuInfo = "";
if (this.teaClassMsg.TeacherId == 0) return;
GetCanTeacherClassTimeList(this.teaClassMsg).then(res => {
......@@ -287,6 +318,8 @@
},
//获取学生列表
getStu() {
console.log(this.checkChapter)
return
this.stuMsg.CourseId = this.teaClassMsg.CourseId || 0;
if (this.editType == 1) {
this.stuMsg.CourseGradeId = this.checkChapter.CourseRate || 0;
......@@ -314,6 +347,30 @@
}
});
},
//获取学生列表
getStu_V2() {
if (!this.stuMsg_v2.StuName) {
this.$q.notify({
position: 'top',
message: "请输入学生姓名",
timeout: 2500
})
return
}
if (this.editType == 1) {
this.stuMsg_v2.NextCourseGradeNo = this.checkChapter.ChapterGradeNo
this.stuMsg_v2.CourseGradeId = this.checkChapter.CourseRate
}
if (this.editType == 2) {
this.stuMsg_v2.NextCourseGradeNo = this.saveObj.Ranks
this.stuMsg_v2.CourseGradeId = this.saveObj.CourseGradeId
}
getCanAppointmentStuList_V2(this.stuMsg_v2).then(res => {
console.log(337, res)
this.stuList = JSON.parse(JSON.stringify(res.Data));
this.allStuList = JSON.parse(JSON.stringify(res.Data));
})
},
//获取章节
getChapterTree() {
if (this.teaClassMsg.CourseId == 0) return;
......@@ -347,7 +404,7 @@
}
});
if (this.checkChapter.CourseRate && this.checkChapter.ChapterNo) {
this.getStu();
// this.getStu();
}
this.teaClassMsg.TeacherId = 0;
this.teacherTimeList = [];
......@@ -421,7 +478,7 @@
this.saveMsg.GuestId = this.stuInfo.GuestId;
this.saveMsg.CourseId = this.teaClassMsg.CourseId;
this.saveMsg.TeacherId = this.teaClassMsg.TeacherId;
this.saveMsg.ChapterNo = this.checkChapter.ChapterNo;
this.saveMsg.CourseGradeNo = this.checkChapter.ChapterGradeNo;
this.saveMsg.CourseGradeId = this.checkChapter.CourseRate;
this.saveMsg.ShiftSort = newCourseCheckList.map(e => e.Sort).toString();
} else if (this.editType == 2) {
......@@ -431,12 +488,12 @@
this.saveMsg.GuestId = this.stuInfo.GuestId;
this.saveMsg.CourseId = 0;
this.saveMsg.TeacherId = this.saveObj.Tid;
this.saveMsg.ChapterNo = this.saveObj.Ranks;
this.saveMsg.CourseGradeNo = this.saveObj.Ranks;
this.saveMsg.CourseGradeId = this.saveObj.CourseGradeId;
this.saveMsg.ShiftSort = this.saveObj.ShiftSort;
}
this.addLoading = true;
SetAdminScrollAppointment(this.saveMsg)
setAdminScrollAppointment_V2(this.saveMsg)
.then(res => {
this.addLoading = false;
if (res.Code == 1) {
......@@ -454,7 +511,7 @@
});
}
this.stuInfo = "";
this.getStu();
this.getStu_V2();
this.$emit("success");
}
})
......@@ -463,7 +520,10 @@
});
},
detailSuccessHandle() {
this.getStu();
// this.getStu_V2();
this.stuMsg_v2.StuName=""
this.stuList=[]
this.allStuList=[]
this.$emit("success");
},
detailCloseHandle() {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment