Commit 48fc693d authored by zhengke's avatar zhengke

修改

parent fd8405a0
......@@ -612,4 +612,14 @@ export function GetRepeatClassPlan(data) {
});
}
/**
* 保存单个上课计划冲突修改
*/
export function UpdateClassPlanSingle(data) {
return request({
url: '/Class/UpdateClassPlanSingle',
method: 'post',
data
});
}
......@@ -18,6 +18,25 @@
color: red;
}
.classConDialog {
width: 400px;
height: auto;
}
.delBtnStyle {
position: absolute;
right: 6px;
top: -9px;
width: 20px;
height: 20px;
border: 1px solid red;
background-color: red;
color: #fff;
line-height: 18px;
text-align: center;
border-radius: 50%;
}
</style>
<template>
<div class="page-body">
......@@ -76,7 +95,80 @@
</q-banner>
</q-popup-proxy>
</span>
<q-btn flat size="xs" icon="edit" color="accent" style="font-weight:400" label="编辑" />
<q-btn flat size="xs" icon="edit" color="accent" style="font-weight:400;" label="编辑"
@click="getInfo(props.row)">
<q-popup-proxy>
<q-banner v-if="isShowEdit">
<div class="classConDialog">
<div style="margin:10px 0 15px 0;">{{props.row.ClassDate}}课程安排</div>
<q-select filled stack-label option-value="TId" option-label="TeacherName"
v-model="addMsg.TeacherId" ref="Teacher_Id" :options="TeacherList" label="关联教师" :dense="false"
class="col-6 q-pb-lg" emit-value map-options />
<q-input filled v-model="addMsg.ClassDate" class="col-6 q-pb-lg" mask="date" label="上课时间">
<template v-slot:append>
<q-icon name="event" class="cursor-pointer">
<q-popup-proxy ref="qDateProxy3" transition-show="scale" transition-hide="scale">
<q-date v-model="addMsg.ClassDate" @input=' () => $refs.qDateProxy3[0].hide()' />
</q-popup-proxy>
</q-icon>
</template>
</q-input>
<q-select filled stack-label option-value="RoomId" option-label="RoomName"
v-model="addMsg.ClassRoomId" ref="ClassRoomId" :options="ClassRoomList" label="关联教室"
:dense="false" class="col-6 q-pb-lg" emit-value map-options />
<div style="display:flex;justify-content:flex-end;margin-bottom:20px;">
<q-btn @click="addStep()" size="10px" round color="primary" icon="iconfont icon-img_haha" />
</div>
<div class="row wrap" style="position:relative;" v-for="(subItem,subIndex) in addMsg.PlanTimeList"
:key="subIndex">
<div class="col-4">
<q-input filled v-model="subItem.StartTime" class="col-6 q-pr-lg q-pb-lg" mask="time">
<template v-slot:append>
<q-icon name="access_time" class="cursor-pointer">
<q-popup-proxy transition-show="scale" transition-hide="scale">
<q-time v-model="subItem.StartTime">
<div class="row items-center justify-end">
<q-btn v-close-popup label="确定" color="primary" flat />
</div>
</q-time>
</q-popup-proxy>
</q-icon>
</template>
</q-input>
</div>
<div class="col-4">
<q-input filled v-model="subItem.EndTime" class="col-6 q-pr-lg q-pb-lg" mask="time">
<template v-slot:append>
<q-icon name="access_time" class="cursor-pointer">
<q-popup-proxy transition-show="scale" transition-hide="scale">
<q-time v-model="subItem.EndTime">
<div class="row items-center justify-end">
<q-btn v-close-popup label="确定" color="primary" flat />
</div>
</q-time>
</q-popup-proxy>
</q-icon>
</template>
</q-input>
</div>
<div class="col-4">
<q-input filled stack-label maxlength="10" :dense="false" v-model="subItem.TimeHour"
ref="TimeHour" class="col-4 q-pr-lg q-pb-lg" label="消耗课时" :rules="[val => !!val || '请填写消耗课时']"
@keyup.native="checkPrice(subItem,'TimeHour')" />
</div>
<div class="delBtnStyle">
<i @click="delStep(subIndex)" class="iconfont icon-guanbi"></i>
</div>
</div>
<q-card-actions align="right" class="bg-white">
<q-btn label="取消" flat color="grey-10" @click="isShowEdit=false"
style="font-weight:400 !important" />
<q-btn label="确认" color="accent q-px-md" style="font-weight:400 !important" :loading="saveLoading" @click="saveSteps" />
</q-card-actions>
</div>
</q-banner>
</q-popup-proxy>
</q-btn>
</q-td>
</template>
</q-table>
......@@ -85,15 +177,18 @@
</template>
<script>
import {
GetRepeatClassPlan
GetRepeatClassPlan,
getTeacherDropDownList,
queryClassRoomList,
UpdateClassPlanSingle
} from "../../api/school/index";
export default {
meta: {
title: "上课计划冲突调整"
},
data() {
return {
currentUrl: "",
columns: [{
name: "ClassDate",
label: "日期",
......@@ -133,6 +228,29 @@
msg: {
ClassId: 53
},
isShowEdit: false,
//单行修改参数
addMsg: {
ClassPlanId: 0,
ClassId: 0,
ClassDate: "",
ClassDateStr: "",
ClassRoomId: 0,
RoomName: "",
TeacherId: 0,
TeacherName: "",
UserIcon: "",
PlanTimeList: [{
ClassTimeId: 0,
StartTime: "",
EndTime: "",
TimeHour: 0,
}]
},
TeacherList: [], //老师下拉数据
ClassRoomList: [], //教室下拉数据
saveLoading: false,
//提交参数
postMsg: {
ClassId: 0, //班级编号
......@@ -150,19 +268,11 @@
};
},
mounted() {
this.GetTeacherList();
this.getClassRoomList();
this.getList();
},
methods: {
//重新查询
resetSearch() {
this.msg.pageIndex = 1;
this.getcourselist();
},
//翻页
changePage(val) {
this.msg.pageIndex = val;
this.getcourselist();
},
getList() {
this.loading = true;
this.dataList = [];
......@@ -170,8 +280,87 @@
this.loading = false;
if (res.Code == 1) {
this.dataList = res.Data;
this.postMsg.PlanList=res.Data;
this.postMsg.PlanList = res.Data;
}
})
},
//编辑修改
getInfo(item) {
this.isShowEdit = true;
var Obj = JSON.parse(JSON.stringify(item));
this.addMsg.ClassPlanId = Obj.ClassPlanId;
this.addMsg.ClassId = Obj.ClassId;
this.addMsg.ClassDate = Obj.ClassDate;
this.addMsg.ClassRoomId = Obj.ClassRoomId;
this.addMsg.TeacherId = Obj.TeacherId;
this.addMsg.PlanTimeList = Obj.PlanTimeList;
},
//获取教师下拉
GetTeacherList() {
getTeacherDropDownList({}).then(res => {
if (res.Code == 1) {
this.TeacherList = res.Data;
}
})
},
//获取教室下拉
getClassRoomList() {
queryClassRoomList({}).then(res => {
if (res.Code == 1) {
this.ClassRoomList = res.Data;
}
})
},
//点击新增
addStep() {
var obj = {
ClassTimeId: 0,
StartTime: '',
EndTime: '',
TimeHour: 0
}
this.addMsg.PlanTimeList.push(obj);
},
//删除
delStep(index) {
this.addMsg.PlanTimeList.splice(index, 1);
},
//保存
saveSteps() {
for (let i = 0; i < this.addMsg.PlanTimeList.length; i++) {
if (this.addMsg.PlanTimeList[i].StartTime == '') {
this.$q.notify({
type: 'negative',
position: "top",
message: `请选择第${i+1}节课开始时间`
})
return
}
if (this.addMsg.PlanTimeList[i].EndTime == '') {
this.$q.notify({
type: 'negative',
position: "top",
message: `请选择第${i+1}节课结束时间`
})
return
}
}
this.saveLoading = true
UpdateClassPlanSingle(this.addMsg).then(res => {
this.saveLoading = false
if (res.Code == 1) {
this.isShowEdit = false;
this.getList();
if (res.Data) {
this.$q.notify({
type: 'negative',
position: "top",
message: `还存在冲突数据请继续修改!`
})
}
}
}).catch(() => {
this.saveLoading = false
})
}
}
......
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