Commit c229a0fe authored by 吴春's avatar 吴春

1

parent 9763c0ec
......@@ -7,7 +7,7 @@
<q-dialog v-model="persistent" content-class="bg-grey-1" persistent transition-show="scale" transition-hide="scale">
<q-card style="width: 800px;max-width:900px;">
<q-card-section>
<div class="text-h6">{{objOption.ReserveClassId==0?'新增试听课程':'修改试听课程'}}</div>
<div class="text-h6">{{objOption.Id==0?'新增试听课程':'修改试听课程'}}</div>
</q-card-section>
<q-card-section class="q-pt-none scroll" style="max-height: 70vh">
<div class="row wrap">
......@@ -79,7 +79,9 @@
} from "../../api/school/index";
import {
GetReserveClass,
SetReserveClass
SetReserveClass,
GetVisitorReserveById,
SetVisitorReserveClass
} from '../../api/scheduling/schedu'
export default {
props: {
......@@ -99,7 +101,9 @@
EndTime: "",
ClassRoomId: "",
ClassContent: '',
TrialLessonId: ''
TrialLessonId: '',
Visitor_Id:0,
Id:0,
},
saveLoading: false,
TeacherList: [],
......@@ -153,20 +157,26 @@
//初始化表单
initObj() {
this.objOption.ClassDate = this.saveObj.ReservationDate
if (this.saveObj && this.saveObj.ReserveClassId > 0) {
GetReserveClass({
ReserveClassId: this.saveObj.ReserveClassId
if (this.saveObj && this.saveObj.Id > 0) {
GetVisitorReserveById({
Id: this.saveObj.Id
}).then(res => {
if (res.Code == 1) {
this.objOption.ReserveClassId = res.Data.ReserveClassId;
this.objOption.TeacherId = res.Data.TeacherId;
this.objOption.ClassDate = res.Data.ClassDateStr;
this.objOption.ClassTime = res.Data.ClassTime;
this.objOption.EndTime = res.Data.EndTime;
this.objOption.ClassRoomId = res.Data.ClassRoomId;
this.objOption.TrialLessonId = res.Data.TrialLessonId;
this.objOption.ClassContent = res.Data.ClassContent;
if(res.Data&&res.Data.length>0){
this.objOption.ReserveClassId = res.Data[0].ReserveClassId;
this.objOption.TeacherId = res.Data[0].TeacherId;
this.objOption.ClassDate = res.Data[0].ClassDateStr;
this.objOption.ClassTime = res.Data[0].ClassTime;
this.objOption.EndTime = res.Data[0].EndTime;
this.objOption.ClassRoomId = res.Data[0].ClassRoomId;
this.objOption.TrialLessonId = res.Data[0].TrialLessonId;
this.objOption.Visitor_Id = res.Data[0].Visitor_Id;
if(this.objOption.TrialLessonId==0){
this.objOption.ClassDate = this.timeFormatSeconds(res.Data[0].ReservationDate);
}
this.objOption.ClassContent = res.Data[0].ClassContent;
this.objOption.Id = res.Data[0].Id;
}
} else {
let nowDay = new Date();
var year = nowDay.getFullYear(); //年
......@@ -183,6 +193,32 @@
})
}
},
//获得年月日时分秒
//传入日期//例:2020-10-27T14:36:23
timeFormatSeconds(time,type) {
let timeStr="";
if(time==='0001-01-01T00:00:00'){
return timeStr;
}
var d = time ? new Date(time) : new Date();
var year = d.getFullYear();
var month = d.getMonth() + 1;
var day = d.getDate();
if (month < 10) month = '0' + month;
if (day < 10) day = '0' + day;
if(type==2){
var hours = d.getHours();
var min = d.getMinutes();
var seconds = d.getSeconds();
if (hours < 0) hours = '0' + hours;
if (min < 10) min = '0' + min;
if (seconds < 10) seconds = '0' + seconds;
timeStr+= ' ' + hours + ':' + min + ':' + seconds;
}
timeStr=year + '-' + month + '-' + day +timeStr;
return timeStr;
},
//关闭弹窗
closeSaveForm() {
this.$emit('close')
......@@ -239,7 +275,7 @@
return
}
this.saveLoading = true;
SetReserveClass(this.objOption).then(res => {
SetVisitorReserveClass(this.objOption).then(res => {
this.saveLoading = false
this.$q.notify({
icon: 'iconfont icon-chenggong',
......
......@@ -17,6 +17,13 @@
</template>
</q-td>
</template>
<template v-slot:body-cell-Demand="props">
<q-td>
<template>
<div v-html="props.row.Demand"></div>
</template>
</q-td>
</template>
<template v-slot:body-cell-ClassDateStr="props">
<q-td :props="props">
<div style="min-width: 150px;word-break: break-word;white-space: normal;">
......@@ -80,7 +87,8 @@
<script>
import {
RemoveReserveClass
RemoveReserveClass,
RemoveVisitorReserve
} from '../../api/scheduling/schedu'
import reserveForm from '../schedul/reserve-form'
export default {
......@@ -208,6 +216,7 @@ return timeStr;
},
//编辑试听
editVisitor(obj) {
console.log("reserveObj",obj);
this.reserveObj = obj
this.isShowReserve = true;
},
......
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