|
@@ -0,0 +1,84 @@
|
|
|
|
+<template>
|
|
|
|
+ <div class="m-container">
|
|
|
|
+ <div class="infoWrap">
|
|
|
|
+ <el-form :model="accompanyForm" :inline="true">
|
|
|
|
+ <el-form-item label="每周可预约课次">
|
|
|
|
+ <el-input type="number" v-model.trim="accompanyForm.count"></el-input>
|
|
|
|
+ </el-form-item>
|
|
|
|
+ <el-form-item label="每周休息的周次">
|
|
|
|
+ <el-select v-model="accompanyForm.week">
|
|
|
|
+ <el-option label="星期一" value="1" />
|
|
|
|
+ <el-option label="星期二" value="2" />
|
|
|
|
+ <el-option label="星期三" value="3" />
|
|
|
|
+ <el-option label="星期四" value="4" />
|
|
|
|
+ <el-option label="星期五" value="5" />
|
|
|
|
+ <el-option label="星期六" value="6" />
|
|
|
|
+ <el-option label="星期日" value="7" />
|
|
|
|
+ </el-select>
|
|
|
|
+ </el-form-item>
|
|
|
|
+ <el-form-item>
|
|
|
|
+ <el-button type="primary" @click="submitOk">确定</el-button>
|
|
|
|
+ </el-form-item>
|
|
|
|
+ </el-form>
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
+</template>
|
|
|
|
+<script>
|
|
|
|
+import { teacherFreeTime,resetTeacherFreeTime } from '@/api/teacherManager'
|
|
|
|
+export default {
|
|
|
|
+ props: ['teacherId'],
|
|
|
|
+ data() {
|
|
|
|
+ return {
|
|
|
|
+ accompanyForm: {
|
|
|
|
+ count: "80",
|
|
|
|
+ week: ""
|
|
|
|
+ },
|
|
|
|
+ accompanyId:null
|
|
|
|
+ };
|
|
|
|
+ },
|
|
|
|
+ created(){
|
|
|
|
+ this.init()
|
|
|
|
+ },
|
|
|
|
+ activated(){
|
|
|
|
+ this.init()
|
|
|
|
+ },
|
|
|
|
+ methods:{
|
|
|
|
+ init(){
|
|
|
|
+ // this.teacherId = this.$route.query.teacherId ;
|
|
|
|
+ if (this.$route.query.search) {
|
|
|
|
+ this.Fsearch = this.$route.query.search;
|
|
|
|
+ }
|
|
|
|
+ if (this.$route.query.rules) {
|
|
|
|
+ this.Frules = this.$route.query.rules
|
|
|
|
+ }
|
|
|
|
+ if( this.teacherId){
|
|
|
|
+ teacherFreeTime({id:this.teacherId}).then(res=>{
|
|
|
|
+ if(res.code == 200&&res.data){
|
|
|
|
+ this.accompanyId = res.data.id;
|
|
|
|
+ this.accompanyForm.count = res.data.totalTimes;
|
|
|
|
+ this.accompanyForm.week = res.data.holiday.toString();
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ submitOk(){
|
|
|
|
+ this.$confirm('确认保存设置?', '提示', {
|
|
|
|
+ confirmButtonText: '确定',
|
|
|
|
+ cancelButtonText: '取消',
|
|
|
|
+ type: 'warning'
|
|
|
|
+ }).then(() => {
|
|
|
|
+ resetTeacherFreeTime({holiday:this.accompanyForm.week,userId:this.teacherId,id:this.accompanyId,totalTimes:this.accompanyForm.count}).then(res=>{
|
|
|
|
+ if(res.code == 200){
|
|
|
|
+ this.$message.success('保存成功')
|
|
|
|
+ this.$router.push({ path: '/business/teacherList', query: { rules: this.Frules, search: this.Fsearch } })
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ })
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+};
|
|
|
|
+</script>
|
|
|
|
+<style lang="sass">
|
|
|
|
+
|
|
|
|
+</style>
|