Commit adadaa91 authored by 罗超's avatar 罗超

2

parent 55bf28f5
...@@ -14,10 +14,14 @@ ...@@ -14,10 +14,14 @@
<q-space /> <q-space />
<q-btn icon="close" flat round dense v-close-popup /> <q-btn icon="close" flat round dense v-close-popup />
</q-card-section> </q-card-section>
<q-card-section class="q-pt-none scroll" > <q-card-section class="q-pt-none scroll">
<q-stepper v-model="step" ref="stepper" color="primary" animated flat> <q-stepper v-model="step" ref="stepper" color="primary" animated flat>
<q-step :name="1" title="选择课程" icon="settings" :done="step > 1"> <q-step :name="1" title="上课模式" icon="settings" :done="step > 1">
<div class="page-search row items-center" > <Mode v-model="mode"></Mode>
</q-step>
<q-step :name="2" title="选择课程" icon="settings" :done="step > 2">
<template v-if="mode == 1">
<div class="page-search row items-center">
<div class="col row wrap q-mr-lg q-col-gutter-md"> <div class="col row wrap q-mr-lg q-col-gutter-md">
<div class="col-3"> <div class="col-3">
<q-select <q-select
...@@ -114,7 +118,7 @@ ...@@ -114,7 +118,7 @@
</div> </div>
<Course <Course
:dataList="courseData" :dataList="courseData"
@select="selectCourse" @select="selectClass"
:select="defaultCourse" :select="defaultCourse"
></Course> ></Course>
<q-pagination <q-pagination
...@@ -125,15 +129,21 @@ ...@@ -125,15 +129,21 @@
:input="true" :input="true"
@input="changePage" @input="changePage"
/> />
</template>
<template v-if="mode == 2">
<yueke @select="selectCourse" :select="defaultCourse"></yueke>
</template>
</q-step> </q-step>
<q-step :name="2" title="确认" icon="settings" :done="step > 2"> <q-step :name="3" title="确认" icon="settings" :done="step > 3">
<orderForm <orderForm
ref="orderForm" ref="orderForm"
:mode="mode"
:schoolList="schoolList"
:save-obj="saveObj" :save-obj="saveObj"
:stuData="stuData" :stuData="stuData"
:modityOrderType="1" :modityOrderType="1"
@success="$emit('close')" @success="$emit('close')"
@cancelloading = 'cancelloading' @cancelloading="cancelloading"
></orderForm> ></orderForm>
</q-step> </q-step>
</q-stepper> </q-stepper>
...@@ -152,13 +162,13 @@ ...@@ -152,13 +162,13 @@
label="上一步" label="上一步"
v-if="step > 1" v-if="step > 1"
/> />
<q-btn @click="next" color="primary" label="下一步" v-if="step < 2" /> <q-btn @click="next" color="primary" label="下一步" v-if="step < 3" />
<q-btn <q-btn
label="保存" label="保存"
color="primary" color="primary"
:loading="loading1" :loading="loading1"
@click="saveOrderForm" @click="saveOrderForm"
v-if="step == 2" v-if="step == 3"
/> />
</q-card-actions> </q-card-actions>
</q-card> </q-card>
...@@ -180,8 +190,10 @@ import { ...@@ -180,8 +190,10 @@ import {
queryCourseDropdownList, queryCourseDropdownList,
getCourseSubject getCourseSubject
} from "../../../api/course/index"; } from "../../../api/course/index";
import Mode from "./transfer-order/tickMode";
import Course from "./transfer-order/courselist"; import Course from "./transfer-order/courselist";
import orderForm from "./transfer-order/order-form"; import orderForm from "./transfer-order/order-form";
import yueke from "./transfer-order/yueke";
export default { export default {
props: { props: {
select: { select: {
...@@ -191,7 +203,9 @@ export default { ...@@ -191,7 +203,9 @@ export default {
}, },
components: { components: {
Course, Course,
orderForm Mode,
orderForm,
yueke
}, },
data() { data() {
return { return {
...@@ -253,7 +267,8 @@ export default { ...@@ -253,7 +267,8 @@ export default {
ClassList: [], //关联课程下拉数据 ClassList: [], //关联课程下拉数据
myClassList: [], myClassList: [],
allClassList: [], allClassList: [],
loading1:false,//防止多次点击 loading1: false, //防止多次点击
mode: 1
}; };
}, },
mounted() { mounted() {
...@@ -271,7 +286,9 @@ export default { ...@@ -271,7 +286,9 @@ export default {
methods: { methods: {
getOrderGuestRenewState() { getOrderGuestRenewState() {
const ids = this.select.map(e => e.StuId).toString(); const ids = this.select.map(e => e.StuId).toString();
getOrderGuestRenewState({ StuIds: ids }).then(res => { getOrderGuestRenewState({
StuIds: ids
}).then(res => {
this.stuData = res.Data; this.stuData = res.Data;
}); });
}, },
...@@ -345,14 +362,45 @@ export default { ...@@ -345,14 +362,45 @@ export default {
this.courseMsg.pageIndex = val; this.courseMsg.pageIndex = val;
this.getCourseList(); this.getCourseList();
}, },
// 选择班级
selectClass(val) {
if (val.length > 0) {
this.saveObj = val[0];
this.saveObj.Unit_Price = this.saveObj.SellPrice;
this.defaultCourse = val;
}else{
this.saveObj = {};
this.saveObj.Unit_Price = 0;
this.defaultCourse = [];
}
},
// 选择课程 // 选择课程
selectCourse(val) { selectCourse(val) {
console.log("tag2", val);
if (val.length > 0) {
this.saveObj = val[0]; this.saveObj = val[0];
this.saveObj.Unit_Price = this.saveObj.SellPrice; this.saveObj.Unit_Price = this.saveObj.SellPrice;
this.defaultCourse = val; this.defaultCourse = val;
}else{
this.saveObj = {};
this.saveObj.Unit_Price = 0;
this.defaultCourse = [];
}
}, },
next() { next() {
if (!this.saveObj.ClassId || this.saveObj.ClassId == 0) { if (this.step == 1 && this.mode <= 0) {
this.$q.notify({
type: "negative",
position: "top",
message: `请选择上课模式`
});
return;
}
if (this.step == 2) {
if (
this.mode == 1 &&
(!this.saveObj.ClassId || this.saveObj.ClassId == 0)
) {
this.$q.notify({ this.$q.notify({
type: "negative", type: "negative",
position: "top", position: "top",
...@@ -360,6 +408,18 @@ export default { ...@@ -360,6 +408,18 @@ export default {
}); });
return; return;
} }
if (
this.mode == 2 &&
(!this.saveObj.ClassId || this.saveObj.ClassId == 0)
) {
this.$q.notify({
type: "negative",
position: "top",
message: `请选择课程`
});
return;
}
}
this.$refs.stepper.next(); this.$refs.stepper.next();
}, },
//获取校区列表 //获取校区列表
...@@ -402,12 +462,12 @@ export default { ...@@ -402,12 +462,12 @@ export default {
this.getCourseList(); this.getCourseList();
}, },
saveOrderForm() { saveOrderForm() {
this.loading1 = true this.loading1 = true;
this.$refs.orderForm.saveOrderInfo(); this.$refs.orderForm.saveOrderInfo();
}, },
cancelloading(){ cancelloading() {
this.loading1 = false this.loading1 = false;
}, }
} }
}; };
</script> </script>
...@@ -416,7 +476,8 @@ export default { ...@@ -416,7 +476,8 @@ export default {
background-color: transparent; background-color: transparent;
border: none; border: none;
} }
/deep/.q-stepper__step-inner{
padding:0 24px; /deep/.q-stepper__step-inner {
padding: 0 24px;
} }
</style> </style>
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