Commit adadaa91 authored by 罗超's avatar 罗超

2

parent 55bf28f5
<template>
<div class="transfer-order">
<div class="transfer-order">
<q-dialog
v-model="persistent"
persistent
......@@ -14,126 +14,136 @@
<q-space />
<q-btn icon="close" flat round dense v-close-popup />
</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-step :name="1" title="选择课程" icon="settings" :done="step > 1">
<div class="page-search row items-center" >
<div class="col row wrap q-mr-lg q-col-gutter-md">
<div class="col-3">
<q-select
@input="resetSearch"
filled
option-value="SId"
option-label="SName"
v-model="courseMsg.School_Id"
:options="schoolList"
emit-value
map-options
label="关联校区"
clearable
/>
</div>
<div class="col-3">
<q-input
@change="resetSearch"
clearable
filled
v-model="courseMsg.ClassNo"
label="班号"
@clear="resetSearch"
maxlength="20"
/>
</div>
<div class="col-6">
<q-input
@change="resetSearch"
clearable
filled
v-model="courseMsg.ClassName"
label="班级名称"
@clear="resetSearch"
maxlength="20"
/>
</div>
<div class="col-6">
<q-select
@input="resetSearch"
@filter="filterCourseFn"
use-input
filled
option-value="CourseId"
option-label="CourseName"
v-model="courseMsg.CouseId"
:options="myClassList"
emit-value
map-options
label="学习课程"
clearable
>
<template v-slot:no-option>
<q-item>
<q-item-section class="text-grey">
未找到相关数据
</q-item-section>
</q-item>
</template>
</q-select>
</div>
<q-step :name="1" title="上课模式" icon="settings" :done="step > 1">
<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-3">
<q-select
@input="resetSearch"
filled
option-value="SId"
option-label="SName"
v-model="courseMsg.School_Id"
:options="schoolList"
emit-value
map-options
label="关联校区"
clearable
/>
</div>
<div class="col-6">
<div class="col-3 Sysuser_Date">
<q-field filled>
<template v-slot:control>
<el-date-picker
v-model="courseMsg.StartTime"
type="date"
placeholder="开学日期"
size="small"
style="width:47%;"
@change="resetSearch"
clear-icon="iconfont icon-guanbi"
>
</el-date-picker
>
<el-date-picker
v-model="courseMsg.EndTime"
type="date"
placeholder="结束日期"
size="small"
style="width:47%;"
@change="resetSearch"
clear-icon="iconfont icon-guanbi"
>
</el-date-picker>
<div class="col-3">
<q-input
@change="resetSearch"
clearable
filled
v-model="courseMsg.ClassNo"
label="班号"
@clear="resetSearch"
maxlength="20"
/>
</div>
<div class="col-6">
<q-input
@change="resetSearch"
clearable
filled
v-model="courseMsg.ClassName"
label="班级名称"
@clear="resetSearch"
maxlength="20"
/>
</div>
<div class="col-6">
<q-select
@input="resetSearch"
@filter="filterCourseFn"
use-input
filled
option-value="CourseId"
option-label="CourseName"
v-model="courseMsg.CouseId"
:options="myClassList"
emit-value
map-options
label="学习课程"
clearable
>
<template v-slot:no-option>
<q-item>
<q-item-section class="text-grey">
未找到相关数据
</q-item-section>
</q-item>
</template>
</q-field>
</q-select>
</div>
<div class="col-6">
<div class="col-3 Sysuser_Date">
<q-field filled>
<template v-slot:control>
<el-date-picker
v-model="courseMsg.StartTime"
type="date"
placeholder="开学日期"
size="small"
style="width:47%;"
@change="resetSearch"
clear-icon="iconfont icon-guanbi"
>
</el-date-picker
>
<el-date-picker
v-model="courseMsg.EndTime"
type="date"
placeholder="结束日期"
size="small"
style="width:47%;"
@change="resetSearch"
clear-icon="iconfont icon-guanbi"
>
</el-date-picker>
</template>
</q-field>
</div>
</div>
</div>
</div>
</div>
<Course
:dataList="courseData"
@select="selectCourse"
:select="defaultCourse"
></Course>
<q-pagination
class="full-width justify-end"
v-model="courseMsg.pageIndex"
color="primary"
:max="coursePageCount"
:input="true"
@input="changePage"
/>
<Course
:dataList="courseData"
@select="selectClass"
:select="defaultCourse"
></Course>
<q-pagination
class="full-width justify-end"
v-model="courseMsg.pageIndex"
color="primary"
:max="coursePageCount"
:input="true"
@input="changePage"
/>
</template>
<template v-if="mode == 2">
<yueke @select="selectCourse" :select="defaultCourse"></yueke>
</template>
</q-step>
<q-step :name="2" title="确认" icon="settings" :done="step > 2">
<q-step :name="3" title="确认" icon="settings" :done="step > 3">
<orderForm
ref="orderForm"
:mode="mode"
:schoolList="schoolList"
:save-obj="saveObj"
:stuData="stuData"
:modityOrderType="1"
@success="$emit('close')"
@cancelloading = 'cancelloading'
@cancelloading="cancelloading"
></orderForm>
</q-step>
</q-stepper>
......@@ -152,13 +162,13 @@
label="上一步"
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
label="保存"
color="primary"
:loading="loading1"
@click="saveOrderForm"
v-if="step == 2"
v-if="step == 3"
/>
</q-card-actions>
</q-card>
......@@ -180,8 +190,10 @@ import {
queryCourseDropdownList,
getCourseSubject
} from "../../../api/course/index";
import Mode from "./transfer-order/tickMode";
import Course from "./transfer-order/courselist";
import orderForm from "./transfer-order/order-form";
import yueke from "./transfer-order/yueke";
export default {
props: {
select: {
......@@ -191,7 +203,9 @@ export default {
},
components: {
Course,
orderForm
Mode,
orderForm,
yueke
},
data() {
return {
......@@ -253,7 +267,8 @@ export default {
ClassList: [], //关联课程下拉数据
myClassList: [],
allClassList: [],
loading1:false,//防止多次点击
loading1: false, //防止多次点击
mode: 1
};
},
mounted() {
......@@ -271,7 +286,9 @@ export default {
methods: {
getOrderGuestRenewState() {
const ids = this.select.map(e => e.StuId).toString();
getOrderGuestRenewState({ StuIds: ids }).then(res => {
getOrderGuestRenewState({
StuIds: ids
}).then(res => {
this.stuData = res.Data;
});
},
......@@ -345,21 +362,64 @@ export default {
this.courseMsg.pageIndex = val;
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) {
this.saveObj = val[0];
this.saveObj.Unit_Price = this.saveObj.SellPrice;
this.defaultCourse = val;
console.log("tag2", 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 = [];
}
},
next() {
if (!this.saveObj.ClassId || this.saveObj.ClassId == 0) {
if (this.step == 1 && this.mode <= 0) {
this.$q.notify({
type: "negative",
position: "top",
message: `请选择班级`
message: `请选择上课模式`
});
return;
}
if (this.step == 2) {
if (
this.mode == 1 &&
(!this.saveObj.ClassId || this.saveObj.ClassId == 0)
) {
this.$q.notify({
type: "negative",
position: "top",
message: `请选择班级`
});
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();
},
//获取校区列表
......@@ -402,12 +462,12 @@ export default {
this.getCourseList();
},
saveOrderForm() {
this.loading1 = true
this.loading1 = true;
this.$refs.orderForm.saveOrderInfo();
},
cancelloading(){
this.loading1 = false
},
cancelloading() {
this.loading1 = false;
}
}
};
</script>
......@@ -416,7 +476,8 @@ export default {
background-color: transparent;
border: none;
}
/deep/.q-stepper__step-inner{
padding:0 24px;
/deep/.q-stepper__step-inner {
padding: 0 24px;
}
</style>
\ No newline at end of file
</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