Commit 0483acf2 authored by youjie's avatar youjie
parents 80e86df8 56108ccb
......@@ -59,16 +59,7 @@ export function SetAdminScrollAppointment(data) {
data
})
}
/**
* 后台取消预约
*/
export function CancelAppointment(data) {
return request({
url: '/Scroll/CancelAppointment',
method: 'post',
data
})
}
/**
* 后台确认约课
*/
......@@ -174,6 +165,7 @@ export function setAdminScrollMakeUp(data) {
data
})
}
/**
* 取消已确认的约课
*/
......@@ -184,6 +176,18 @@ export function cancelSureAppointment(data) {
data
})
}
/**
* 后台取消预约
*/
export function CancelAppointment(data) {
return request({
url: '/Scroll/CancelAppointment',
method: 'post',
data
})
}
/**
* 调整上课教室
*/
......
......@@ -86,7 +86,6 @@
getTeacherList() {
getTeacherDropDownList({
LeaveStatus: 1,
IsShow: 1
}).then(res => {
this.TeacherList = res.Data;
});
......
......@@ -8,16 +8,21 @@
<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">
<q-field filled label="学员列表" stack-label>
<template v-slot:control>
<div class="row">
<q-checkbox v-model="selectStu" v-for="(x, y) in saveObj.GuestList" :key="y" :val="x.AppointmentId">
{{ x.GuestName }}
</q-checkbox>
</div>
</template>
</q-field>
<div class="EmpLine_title">
<div class="Emp_Line"></div>
<div>请选择要取消的学员和课时状态</div>
</div>
<div class="row wrap" style="margin-top:8px;" v-for="(gItem,gIndex) in saveObj.GuestList" :key="gIndex">
<div class="col-3">
<q-checkbox v-model="gItem.IsChecked" :key="gIndex" :val="gItem.AppointmentId">
{{ gItem.GuestName }}
</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-separator />
<q-card-actions align="right" class="bg-white">
......@@ -30,8 +35,8 @@
</template>
<script>
import {
cancelSureAppointment
} from "../../../api/studyabroad/subscribe.js";
cancelStuAppointment
} from "../../../api/scheduling/schedu.js";
export default {
model: {
prop: "show",
......@@ -59,7 +64,16 @@
StuIds: 0,
ShiftSort: "",
},
selectStu: []
selectStu: [],
optionList: [{
Id: 1,
Name: "扣除学员课时按缺勤处理"
},
{
Id: 0,
Name: "无损取消"
}
]
};
},
methods: {
......@@ -68,7 +82,20 @@
this.$emit("changeshow", val);
},
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({
message: "请选择学生",
position: "top"
......@@ -79,26 +106,17 @@
Date: this.date,
TeacherId: this.saveObj.Tid,
ShiftSort: this.saveObj.ShiftSort,
AppointIds: this.selectStu.toString(),
AppointIds: selectStu.toString(),
AccountId: this.saveObj.AccountId, //新取消接口参数
ChooseStuList: [], //新取消接口参数
ChooseStuList: tempChoose, //新取消接口参数
};
if (this.selectStu && this.selectStu.length > 0) {
this.selectStu.forEach(item => {
msg.ChooseStuList.push({
AppointId: item,
IsCalcStuCheck: 0
});
})
}
cancelSureAppointment(msg).then(res => {
cancelStuAppointment(msg).then(res => {
if (res.Code == 1) {
this.$q.notify({
message: "操作成功",
position: "top"
});
this.$emit("success", this.selectStu);
this.selectStu = []
this.$emit("success", selectStu);
this.changeDig(false)
}
});
......
......@@ -72,8 +72,9 @@
saveObj.AppointState == 1 &&
isShowTag(saveObj.GuestList, saveObj.ScrollMinNum)
" />
<!--CancelAdminAppointment(saveObj)-->
<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>
</q-field>
<q-field filled label="最小成班人数:" stack-label class="col-6" v-if="saveObj.ClassType == 3">
......@@ -85,13 +86,6 @@
<q-field filled label="已约学员:" stack-label class="col-12" v-if="saveObj.ClassType == 3">
<template v-slot:control>
<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">
<q-checkbox v-model="checkStuType2" v-for="(x, y) in saveObj.GuestList" :key="y" :val="x.AppointmentId">
{{ x.GuestName }}
......@@ -103,12 +97,17 @@
<div class="row col-12 relative-position" v-else>
<div class="absolute" style="top:-20px;right:0" v-if="auth.IsEdit">
<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>
<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 == 3">(重)</span>
</span>
......@@ -119,7 +118,7 @@
<template v-slot:control>
<div>
<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 == 3">(重)</span>
</span>
......@@ -138,9 +137,7 @@
</template>
<script>
import {
CancelAppointment,
SetSureAppointment,
cancelSureAppointment
} from "../../../api/studyabroad/subscribe.js";
import ChangeCourse from "./changeCourse";
import MakeUp from "./makeUp.vue"
......@@ -198,45 +195,7 @@
modifyTeacher() {
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() {
if (this.saveObj.EnrollNum < this.saveObj.ScrollMinNum) {
......@@ -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() {
this.CourseObj = {
......
......@@ -87,6 +87,7 @@
" @click.stop="
showDetail(__item, item.ClassDate, _item.TeacherId)
">
<el-popover placement="top-start" width="200" trigger="hover">
<div slot="reference" style="height:80vh;position:relative">
<q-badge rounded color="red" label="未成班" style="position:absolute;top:0;right:0" v-if="
......@@ -498,7 +499,7 @@
getTeacherList() {
getTeacherDropDownList({
LeaveStatus: 1,
IsShow: 1
}).then(res => {
if (res.Code == 1) {
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