Commit 8baf9fc1 authored by zhengke's avatar zhengke

修改

parent 7275a305
......@@ -97,8 +97,9 @@
emit-value map-options />
</div>
<div class="col-6">
<q-input filled stack-label maxlength="3" :dense="false" v-model="objOption.ClassPersion"
ref="ClassPersion" class="col-6 q-pr-lg q-pb-lg" label="招生人数" @keyup.native="checkInteger(objOption,'ClassPersion')" :rules="[val => !!val || '请填写招生人数']" />
<q-input filled stack-label maxlength="3" :dense="false" v-model="objOption.ClassPersion" ref="ClassPersion"
class="col-6 q-pr-lg q-pb-lg" label="招生人数" @keyup.native="checkInteger(objOption,'ClassPersion')"
:rules="[val => !!val || '请填写招生人数']" />
</div>
</div>
<div class="row wrap">
......@@ -128,11 +129,13 @@
<div class="row wrap">
<div class="col-6">
<q-input filled stack-label maxlength="8" :dense="false" v-model="objOption.OriginalPrice"
ref="OriginalPrice" class="col-6 q-pr-lg q-pb-lg" label="原价" @keyup.native="checkPrice(objOption,'OriginalPrice')" :rules="[val => !!val || '请填写原价']" />
ref="OriginalPrice" class="col-6 q-pr-lg q-pb-lg" label="原价"
@keyup.native="checkPrice(objOption,'OriginalPrice')" :rules="[val => !!val || '请填写原价']" />
</div>
<div class="col-6">
<q-input filled stack-label maxlength="8" :dense="false" v-model="objOption.SellPrice" ref="SellPrice"
class="col-6 q-pr-lg q-pb-lg" label="卖价" @keyup.native="checkPrice(objOption,'SellPrice')" :rules="[val => !!val || '请填写卖价']" />
class="col-6 q-pr-lg q-pb-lg" label="卖价" @keyup.native="checkPrice(objOption,'SellPrice')"
:rules="[val => !!val || '请填写卖价']" />
</div>
</div>
<div class="row wrap">
......@@ -159,12 +162,14 @@
<template v-if="objOption.IsStepPrice==1">
<div class="row wrap" v-for="(item,index) in ladderPriceList" :key="index">
<div class="col-6">
<q-input filled stack-label maxlength="3" v-model="item.PersionNum" @keyup.native="checkInteger(item,'PersionNum')" :dense="false"
class="col-6 q-pr-lg q-pb-lg" label="人" />
<q-input filled stack-label maxlength="3" v-model="item.PersionNum"
@keyup.native="checkInteger(item,'PersionNum')" :dense="false" class="col-6 q-pr-lg q-pb-lg"
label="人" />
</div>
<div class="col-6" style="position:relative;">
<q-input filled stack-label maxlength="8" v-model="item.PersionPrice" @keyup.native="checkPrice(item,'PersionPrice')" :dense="false"
class="col-6 q-pr-lg q-pb-lg" label="价格" />
<q-input filled stack-label maxlength="8" v-model="item.PersionPrice"
@keyup.native="checkPrice(item,'PersionPrice')" :dense="false" class="col-6 q-pr-lg q-pb-lg"
label="价格" />
<q-btn style="position:absolute;right:-5px;top:20px;" size="6px" @click="delStepPrice(index)" round
color="red" icon="iconfont icon-guanbi1" />
</div>
......@@ -185,7 +190,8 @@
<div class="col-12">
<q-field filled class="col-6 q-pr-lg q-pb-lg">
 <template v-slot:control>
<el-input placeholder="数值" maxlength="8" v-model="objOption.CommissionValue" @keyup.native="checkPrice(objOption,'CommissionValue')">
<el-input placeholder="数值" maxlength="8" ref="CommissionValue" v-model="objOption.CommissionValue"
@keyup.native="checkPrice(objOption,'CommissionValue')" :rules="[val => !!val || '请填写数值']">
<template slot="append">
<span v-if="objOption.CommissionType==1"></span>
<span v-if="objOption.CommissionType==2">%</span>
......@@ -501,76 +507,43 @@
},
//保存班级
saveCourse() {
this.objOption.ClassStepPriceList = this.ladderPriceList;
if (this.objOption.ClassName == '') {
this.$q.notify({
type: 'negative',
position: "top",
message: `请填写班级名称`
})
return;
}
if (this.objOption.ClassPersion == '') {
this.$q.notify({
type: 'negative',
position: "top",
message: `请填写招生人数`
})
return;
}
if (this.objOption.OriginalPrice == '') {
this.$q.notify({
type: 'negative',
position: "top",
message: `请填写原价`
})
return;
}
if (this.objOption.SellPrice == '') {
this.$q.notify({
type: 'negative',
position: "top",
message: `请填写卖价`
})
return;
}
if (this.objOption.IsOpenCommission == 1) {
if (this.objOption.CommissionValue == '') {
this.$refs.ClassName.validate();
this.$refs.ClassPersion.validate();
this.$refs.OriginalPrice.validate();
this.$refs.SellPrice.validate();
if (!this.$refs.ClassName.hasError && !this.$refs.ClassPersion.hasError && !this.$refs.OriginalPrice.hasError &&
!this.$refs.SellPrice.hasError) {
if (this.objOption.IsOpenCommission == 1) {
if (this.objOption.CommissionValue == '') {
this.$q.notify({
type: 'negative',
position: "top",
message: `请填写数值`
})
return;
}
}
this.objOption.ClassStepPriceList = this.ladderPriceList;
//选中的日期或星期
this.objOption.WeekDayList = this.checkedDays;
//默认上课时间
this.objOption.DefaultPlanTimeList = this.DefaultPlanTimeList;
this.saveCourseLoading = true;
saveClass(this.objOption).then(res => {
this.saveCourseLoading = false
this.$q.notify({
type: 'negative',
position: "top",
message: `请填写数值`
icon: 'iconfont icon-chenggong',
color: 'accent',
timeout: 2000,
message: '数据保存成功!',
position: 'top'
})
return;
}
}
if (this.objOption.ClassHours == '') {
this.$q.notify({
type: 'negative',
position: "top",
message: `请填写学习课时`
this.$emit("success")
this.closeSaveForm()
}).catch(() => {
this.saveCourseLoading = false
})
return;
}
//选中的日期或星期
this.objOption.WeekDayList = this.checkedDays;
//默认上课时间
this.objOption.DefaultPlanTimeList = this.DefaultPlanTimeList;
this.saveCourseLoading = true;
saveClass(this.objOption).then(res => {
this.saveCourseLoading = false
this.$q.notify({
icon: 'iconfont icon-chenggong',
color: 'accent',
timeout: 2000,
message: '数据保存成功!',
position: 'top'
})
this.$emit("success")
this.closeSaveForm()
}).catch(() => {
this.saveCourseLoading = false
})
},
//获取课程
getCourseList() {
......
......@@ -143,7 +143,7 @@
<div style="padding: 15px" class="class-popover">
<div style="font-size: 18px;font-weight: bold;color:#2D2D2D;font-family: 'perfectFont'">新增课时奖励</div>
<q-select class="col-12 q-pb-lg q-pr-lg" multiple clearable filled stack-label use-input use-chips
option-value="TId" option-label="TeacherName" v-model="tempManager" ref="ManagerId" :options="TeacherList"
option-value="TId" option-label="TeacherName" v-model="tempManager" ref="ManagerId" :rules="[val => !!val || '请选择课时奖励']" :options="TeacherList"
label="选择老师" :dense="false" emit-value map-options @filter="filterFn">
<template v-slot:no-option>
<q-item>
......@@ -382,7 +382,7 @@
type: 'negative',
position: 'top',
timeout: 1500,
message: `请选择教师`
message: `请选择教师`
})
return
}
......
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