Commit 56108ccb authored by 黄奎's avatar 黄奎

学员取消

parent efe23b0f
...@@ -59,16 +59,7 @@ export function SetAdminScrollAppointment(data) { ...@@ -59,16 +59,7 @@ export function SetAdminScrollAppointment(data) {
data data
}) })
} }
/**
* 后台取消预约
*/
export function CancelAppointment(data) {
return request({
url: '/Scroll/CancelAppointment',
method: 'post',
data
})
}
/** /**
* 后台确认约课 * 后台确认约课
*/ */
...@@ -174,6 +165,7 @@ export function setAdminScrollMakeUp(data) { ...@@ -174,6 +165,7 @@ export function setAdminScrollMakeUp(data) {
data data
}) })
} }
/** /**
* 取消已确认的约课 * 取消已确认的约课
*/ */
...@@ -184,6 +176,18 @@ export function cancelSureAppointment(data) { ...@@ -184,6 +176,18 @@ export function cancelSureAppointment(data) {
data data
}) })
} }
/**
* 后台取消预约
*/
export function CancelAppointment(data) {
return request({
url: '/Scroll/CancelAppointment',
method: 'post',
data
})
}
/** /**
* 调整上课教室 * 调整上课教室
*/ */
......
...@@ -86,7 +86,6 @@ ...@@ -86,7 +86,6 @@
getTeacherList() { getTeacherList() {
getTeacherDropDownList({ getTeacherDropDownList({
LeaveStatus: 1, LeaveStatus: 1,
IsShow: 1
}).then(res => { }).then(res => {
this.TeacherList = res.Data; this.TeacherList = res.Data;
}); });
......
...@@ -8,16 +8,21 @@ ...@@ -8,16 +8,21 @@
<q-btn icon="close" flat round dense @click="changeDig(false)" /> <q-btn icon="close" flat round dense @click="changeDig(false)" />
</q-card-section> </q-card-section>
<q-card-section class="q-pt-none scroll" style="max-height: 70vh"> <q-card-section class="q-pt-none scroll" style="max-height: 70vh">
<q-field filled label="学员列表" stack-label> <div class="EmpLine_title">
<template v-slot:control> <div class="Emp_Line"></div>
<div class="row"> <div>请选择要取消的学员和课时状态</div>
<q-checkbox v-model="selectStu" v-for="(x, y) in saveObj.GuestList" :key="y" :val="x.AppointmentId"> </div>
{{ x.GuestName }} <div class="row wrap" style="margin-top:8px;" v-for="(gItem,gIndex) in saveObj.GuestList" :key="gIndex">
</q-checkbox> <div class="col-3">
</div> <q-checkbox v-model="gItem.IsChecked" :key="gIndex" :val="gItem.AppointmentId">
</template> {{ gItem.GuestName }}
</q-field> </q-checkbox>
</div>
<div class="col-6">
<q-select filled dense v-model="gItem.IsCalcStuCheck" option-value="Id" option-label="Name"
:options="optionList" emit-value map-options label="课时状态" />
</div>
</div>
</q-card-section> </q-card-section>
<q-separator /> <q-separator />
<q-card-actions align="right" class="bg-white"> <q-card-actions align="right" class="bg-white">
...@@ -30,8 +35,8 @@ ...@@ -30,8 +35,8 @@
</template> </template>
<script> <script>
import { import {
cancelSureAppointment cancelStuAppointment
} from "../../../api/studyabroad/subscribe.js"; } from "../../../api/scheduling/schedu.js";
export default { export default {
model: { model: {
prop: "show", prop: "show",
...@@ -59,7 +64,16 @@ ...@@ -59,7 +64,16 @@
StuIds: 0, StuIds: 0,
ShiftSort: "", ShiftSort: "",
}, },
selectStu: [] selectStu: [],
optionList: [{
Id: 1,
Name: "扣除学员课时按缺勤处理"
},
{
Id: 0,
Name: "无损取消"
}
]
}; };
}, },
methods: { methods: {
...@@ -68,7 +82,20 @@ ...@@ -68,7 +82,20 @@
this.$emit("changeshow", val); this.$emit("changeshow", val);
}, },
save() { save() {
if (this.selectStu.length == 0) { var tempChoose = [];
var selectStu = [];
if (this.saveObj.GuestList && this.saveObj.GuestList.length > 0) {
this.saveObj.GuestList.forEach(item => {
if (item.IsChecked) {
selectStu.push(item.AppointmentId);
tempChoose.push({
AppointId: item.AppointmentId,
IsCalcStuCheck: item.IsCalcStuCheck,
})
}
})
}
if (tempChoose.length == 0) {
this.$q.notify({ this.$q.notify({
message: "请选择学生", message: "请选择学生",
position: "top" position: "top"
...@@ -79,26 +106,17 @@ ...@@ -79,26 +106,17 @@
Date: this.date, Date: this.date,
TeacherId: this.saveObj.Tid, TeacherId: this.saveObj.Tid,
ShiftSort: this.saveObj.ShiftSort, ShiftSort: this.saveObj.ShiftSort,
AppointIds: this.selectStu.toString(), AppointIds: selectStu.toString(),
AccountId: this.saveObj.AccountId, //新取消接口参数 AccountId: this.saveObj.AccountId, //新取消接口参数
ChooseStuList: [], //新取消接口参数 ChooseStuList: tempChoose, //新取消接口参数
}; };
if (this.selectStu && this.selectStu.length > 0) { cancelStuAppointment(msg).then(res => {
this.selectStu.forEach(item => {
msg.ChooseStuList.push({
AppointId: item,
IsCalcStuCheck: 0
});
})
}
cancelSureAppointment(msg).then(res => {
if (res.Code == 1) { if (res.Code == 1) {
this.$q.notify({ this.$q.notify({
message: "操作成功", message: "操作成功",
position: "top" position: "top"
}); });
this.$emit("success", this.selectStu); this.$emit("success", selectStu);
this.selectStu = []
this.changeDig(false) this.changeDig(false)
} }
}); });
......
...@@ -72,8 +72,9 @@ ...@@ -72,8 +72,9 @@
saveObj.AppointState == 1 && saveObj.AppointState == 1 &&
isShowTag(saveObj.GuestList, saveObj.ScrollMinNum) isShowTag(saveObj.GuestList, saveObj.ScrollMinNum)
" /> " />
<!--CancelAdminAppointment(saveObj)-->
<q-btn color="accent" size="xs" label="取消" v-if="auth.IsEdit <q-btn color="accent" size="xs" label="取消" v-if="auth.IsEdit
" @click="CancelAdminAppointment(saveObj)" class="q-ml-md" :loading="saveLoading" /> " @click="showCancelDig = true" class="q-ml-md" :loading="saveLoading" />
</template> </template>
</q-field> </q-field>
<q-field filled label="最小成班人数:" stack-label class="col-6" v-if="saveObj.ClassType == 3"> <q-field filled label="最小成班人数:" stack-label class="col-6" v-if="saveObj.ClassType == 3">
...@@ -85,13 +86,6 @@ ...@@ -85,13 +86,6 @@
<q-field filled label="已约学员:" stack-label class="col-12" v-if="saveObj.ClassType == 3"> <q-field filled label="已约学员:" stack-label class="col-12" v-if="saveObj.ClassType == 3">
<template v-slot:control> <template v-slot:control>
<div v-if="saveObj.AppointState == 1 && auth.IsEdit"> <div v-if="saveObj.AppointState == 1 && auth.IsEdit">
<div class="q-mt-sm flex justify-start">
<q-btn color="accent" size="xs" label="调课" @click="showChangeCourse" :disable="checkStuType2.length == 0"
class="q-mr-sm" />
<q-btn color="accent" size="xs" label="取消预约" @click="cancelSub()" :disable="checkStuType2.length == 0"
class="q-mr-sm" />
</div>
<div class="row"> <div class="row">
<q-checkbox v-model="checkStuType2" v-for="(x, y) in saveObj.GuestList" :key="y" :val="x.AppointmentId"> <q-checkbox v-model="checkStuType2" v-for="(x, y) in saveObj.GuestList" :key="y" :val="x.AppointmentId">
{{ x.GuestName }} {{ x.GuestName }}
...@@ -103,12 +97,17 @@ ...@@ -103,12 +97,17 @@
<div class="row col-12 relative-position" v-else> <div class="row col-12 relative-position" v-else>
<div class="absolute" style="top:-20px;right:0" v-if="auth.IsEdit"> <div class="absolute" style="top:-20px;right:0" v-if="auth.IsEdit">
<q-btn color="accent" size="xs" label="取消" @click="showCancelDig = true" /> <q-btn color="accent" size="xs" label="取消" @click="showCancelDig = true" />
<q-btn style="display:none;" color="accent" size="xs" label="补录" @click="showMakeUpDig = true"
class="q-ml-sm" />
</div> </div>
<span v-for="(x, y) in saveObj.GuestList" :key="y"> <span v-for="(x, y) in saveObj.GuestList" :key="y">
{{ x.GuestName }} <font v-if="x.State==6" style="color:#cf6a87;">
<q-tooltip>
学员消课,不计算老师课时
</q-tooltip>
{{ x.GuestName }}
</font>
<font v-else>
{{ x.GuestName }}
</font>
<span v-if="x.AppointType == 2">(补)</span> <span v-if="x.AppointType == 2">(补)</span>
<span v-if="x.AppointType == 3">(重)</span> <span v-if="x.AppointType == 3">(重)</span>
</span> </span>
...@@ -119,7 +118,7 @@ ...@@ -119,7 +118,7 @@
<template v-slot:control> <template v-slot:control>
<div> <div>
<span v-for="(x, y) in saveObj.GuestList" :key="y"> <span v-for="(x, y) in saveObj.GuestList" :key="y">
{{ x.GuestName }} {{ x.GuestName }} HH
<span v-if="x.AppointType == 2">(补)</span> <span v-if="x.AppointType == 2">(补)</span>
<span v-if="x.AppointType == 3">(重)</span> <span v-if="x.AppointType == 3">(重)</span>
</span> </span>
...@@ -138,9 +137,7 @@ ...@@ -138,9 +137,7 @@
</template> </template>
<script> <script>
import { import {
CancelAppointment,
SetSureAppointment, SetSureAppointment,
cancelSureAppointment
} from "../../../api/studyabroad/subscribe.js"; } from "../../../api/studyabroad/subscribe.js";
import ChangeCourse from "./changeCourse"; import ChangeCourse from "./changeCourse";
import MakeUp from "./makeUp.vue" import MakeUp from "./makeUp.vue"
...@@ -198,45 +195,7 @@ ...@@ -198,45 +195,7 @@
modifyTeacher() { modifyTeacher() {
this.showTeacherDig = true; this.showTeacherDig = true;
}, },
//取消预约
cancelSub() {
let that = this;
console.log("that.saveObj",that.saveObj);
const msg = {
Date: that.dateObj.date,
TeacherId: that.saveObj.Tid,
AppointIds: that.checkStuType2.toString()
};
this.$q
.dialog({
title: "提示信息",
message: "是否要取消预约",
cancel: true,
ok: "是",
cancel: "否"
})
.onOk(() => {
// CancelAppointment(msg).then(res => {
// if (res.Code == 1) {
// that.$q.notify({
// message: "操作成功",
// position: "top"
// });
// that.checkStuType2.map(e => {
// that.saveObj.GuestList.map((_e, _i) => {
// if (e == _e.AppointmentId) {
// that.saveObj.GuestList.splice(_i, 1);
// }
// });
// });
// that.checkStuType2 = [];
// that.$emit("success");
// }
// });
})
.onCancel(() => {});
},
//确认约课 //确认约课
confirmSub() { confirmSub() {
if (this.saveObj.EnrollNum < this.saveObj.ScrollMinNum) { if (this.saveObj.EnrollNum < this.saveObj.ScrollMinNum) {
...@@ -265,51 +224,7 @@ ...@@ -265,51 +224,7 @@
} }
}); });
}, },
//取消预约
CancelAdminAppointment(item) {
let that = this;
var postMsg = {
AppointIds: "",
Date: this.dateObj.date,
ShiftSort: item.ShiftSort,
TeacherId: item.Tid,
AccountId: item.AccountId, //新接口取消约课参数
ChooseStuList: [], //新接口取消约课参数
};
var tempList = [];
if (item.GuestList && item.GuestList.length > 0) {
item.GuestList.forEach(subItem => {
tempList.push(subItem.AppointmentId);
postMsg.ChooseStuList.push({
AppointId: subItem.AppointmentId,
IsCalcStuCheck: 0
})
})
}
if (tempList && tempList.length > 0) {
postMsg.AppointIds = tempList.join(",");
}
this.$q
.dialog({
title: "提示信息",
message: "是否要取消本次预约",
cancel: true,
ok: "是",
cancel: "否"
})
.onOk(() => {
cancelSureAppointment(postMsg).then(res => {
if (res.Code == 1) {
that.$q.notify({
message: "操作成功",
position: "top"
});
that.$emit("close");
}
});
})
.onCancel(() => {});
},
//显示调课弹窗 //显示调课弹窗
showChangeCourse() { showChangeCourse() {
this.CourseObj = { this.CourseObj = {
......
...@@ -87,6 +87,7 @@ ...@@ -87,6 +87,7 @@
" @click.stop=" " @click.stop="
showDetail(__item, item.ClassDate, _item.TeacherId) showDetail(__item, item.ClassDate, _item.TeacherId)
"> ">
<el-popover placement="top-start" width="200" trigger="hover"> <el-popover placement="top-start" width="200" trigger="hover">
<div slot="reference" style="height:80vh;position:relative"> <div slot="reference" style="height:80vh;position:relative">
<q-badge rounded color="red" label="未成班" style="position:absolute;top:0;right:0" v-if=" <q-badge rounded color="red" label="未成班" style="position:absolute;top:0;right:0" v-if="
...@@ -498,7 +499,7 @@ ...@@ -498,7 +499,7 @@
getTeacherList() { getTeacherList() {
getTeacherDropDownList({ getTeacherDropDownList({
LeaveStatus: 1, LeaveStatus: 1,
IsShow: 1
}).then(res => { }).then(res => {
if (res.Code == 1) { if (res.Code == 1) {
this.TeacherList = JSON.parse(JSON.stringify(res.Data)); this.TeacherList = JSON.parse(JSON.stringify(res.Data));
......
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