Commit c229a0fe authored by 吴春's avatar 吴春

1

parent 9763c0ec
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
<q-dialog v-model="persistent" content-class="bg-grey-1" persistent transition-show="scale" transition-hide="scale"> <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 style="width: 800px;max-width:900px;">
<q-card-section> <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>
<q-card-section class="q-pt-none scroll" style="max-height: 70vh"> <q-card-section class="q-pt-none scroll" style="max-height: 70vh">
<div class="row wrap"> <div class="row wrap">
...@@ -79,7 +79,9 @@ ...@@ -79,7 +79,9 @@
} from "../../api/school/index"; } from "../../api/school/index";
import { import {
GetReserveClass, GetReserveClass,
SetReserveClass SetReserveClass,
GetVisitorReserveById,
SetVisitorReserveClass
} from '../../api/scheduling/schedu' } from '../../api/scheduling/schedu'
export default { export default {
props: { props: {
...@@ -99,7 +101,9 @@ ...@@ -99,7 +101,9 @@
EndTime: "", EndTime: "",
ClassRoomId: "", ClassRoomId: "",
ClassContent: '', ClassContent: '',
TrialLessonId: '' TrialLessonId: '',
Visitor_Id:0,
Id:0,
}, },
saveLoading: false, saveLoading: false,
TeacherList: [], TeacherList: [],
...@@ -153,20 +157,26 @@ ...@@ -153,20 +157,26 @@
//初始化表单 //初始化表单
initObj() { initObj() {
this.objOption.ClassDate = this.saveObj.ReservationDate this.objOption.ClassDate = this.saveObj.ReservationDate
if (this.saveObj && this.saveObj.ReserveClassId > 0) { if (this.saveObj && this.saveObj.Id > 0) {
GetReserveClass({ GetVisitorReserveById({
ReserveClassId: this.saveObj.ReserveClassId Id: this.saveObj.Id
}).then(res => { }).then(res => {
if (res.Code == 1) { if (res.Code == 1) {
if(res.Data&&res.Data.length>0){
this.objOption.ReserveClassId = res.Data.ReserveClassId; this.objOption.ReserveClassId = res.Data[0].ReserveClassId;
this.objOption.TeacherId = res.Data.TeacherId; this.objOption.TeacherId = res.Data[0].TeacherId;
this.objOption.ClassDate = res.Data.ClassDateStr; this.objOption.ClassDate = res.Data[0].ClassDateStr;
this.objOption.ClassTime = res.Data.ClassTime; this.objOption.ClassTime = res.Data[0].ClassTime;
this.objOption.EndTime = res.Data.EndTime; this.objOption.EndTime = res.Data[0].EndTime;
this.objOption.ClassRoomId = res.Data.ClassRoomId; this.objOption.ClassRoomId = res.Data[0].ClassRoomId;
this.objOption.TrialLessonId = res.Data.TrialLessonId; this.objOption.TrialLessonId = res.Data[0].TrialLessonId;
this.objOption.ClassContent = res.Data.ClassContent; 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 { } else {
let nowDay = new Date(); let nowDay = new Date();
var year = nowDay.getFullYear(); //年 var year = nowDay.getFullYear(); //年
...@@ -183,6 +193,32 @@ ...@@ -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() { closeSaveForm() {
this.$emit('close') this.$emit('close')
...@@ -239,7 +275,7 @@ ...@@ -239,7 +275,7 @@
return return
} }
this.saveLoading = true; this.saveLoading = true;
SetReserveClass(this.objOption).then(res => { SetVisitorReserveClass(this.objOption).then(res => {
this.saveLoading = false this.saveLoading = false
this.$q.notify({ this.$q.notify({
icon: 'iconfont icon-chenggong', icon: 'iconfont icon-chenggong',
......
...@@ -17,6 +17,13 @@ ...@@ -17,6 +17,13 @@
</template> </template>
</q-td> </q-td>
</template> </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"> <template v-slot:body-cell-ClassDateStr="props">
<q-td :props="props"> <q-td :props="props">
<div style="min-width: 150px;word-break: break-word;white-space: normal;"> <div style="min-width: 150px;word-break: break-word;white-space: normal;">
...@@ -80,7 +87,8 @@ ...@@ -80,7 +87,8 @@
<script> <script>
import { import {
RemoveReserveClass RemoveReserveClass,
RemoveVisitorReserve
} from '../../api/scheduling/schedu' } from '../../api/scheduling/schedu'
import reserveForm from '../schedul/reserve-form' import reserveForm from '../schedul/reserve-form'
export default { export default {
...@@ -208,6 +216,7 @@ return timeStr; ...@@ -208,6 +216,7 @@ return timeStr;
}, },
//编辑试听 //编辑试听
editVisitor(obj) { editVisitor(obj) {
console.log("reserveObj",obj);
this.reserveObj = obj this.reserveObj = obj
this.isShowReserve = true; 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