Commit 6cf8b5c5 authored by zhengke's avatar zhengke

修改

parent 8452a17d
...@@ -5,6 +5,9 @@ ...@@ -5,6 +5,9 @@
</div> </div>
<div class="content"> <div class="content">
<el-form :model="addMsg" :rules="rules" ref="addMsg" label-width="150px" style="width:50%"> <el-form :model="addMsg" :rules="rules" ref="addMsg" label-width="150px" style="width:50%">
<el-form-item label="标题" prop="Title" class="is-required" size="small">
<el-input v-model="addMsg.Title" placeholder="请输入标题" class="w400" />
</el-form-item>
<el-form-item label="课程类型" prop="CourseClassType" class="is-required"> <el-form-item label="课程类型" prop="CourseClassType" class="is-required">
<el-select class="w400" style="margin-right: 10px;" v-model="addMsg.CourseClassType" size="small" <el-select class="w400" style="margin-right: 10px;" v-model="addMsg.CourseClassType" size="small"
placeholder="请选择" > placeholder="请选择" >
...@@ -19,9 +22,6 @@ ...@@ -19,9 +22,6 @@
</el-option> </el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="标题" prop="Title" class="is-required" size="small">
<el-input v-model="addMsg.Title" placeholder="请输入标题" class="w400" />
</el-form-item>
<el-form-item label="图片" prop="ClassPic" class="is-required"> <el-form-item label="图片" prop="ClassPic" class="is-required">
<el-button @click="openChangeDig(1)" size="small">选择文件</el-button> <el-button @click="openChangeDig(1)" size="small">选择文件</el-button>
<div class="app-gallery-item" style="position: relative;width: 100px;margin-top: 10px;border:none;"> <div class="app-gallery-item" style="position: relative;width: 100px;margin-top: 10px;border:none;">
...@@ -46,14 +46,11 @@ ...@@ -46,14 +46,11 @@
<el-input v-model="addMsg.PointNum" placeholder="请输入点数" class="w400" type="number" :min="0" :disabled="gkshow"/> <el-input v-model="addMsg.PointNum" placeholder="请输入点数" class="w400" type="number" :min="0" :disabled="gkshow"/>
</el-form-item> </el-form-item>
<el-form-item label="时长" prop="Duration" class="is-required" size="small"> <el-form-item label="时长" prop="Duration" class="is-required" size="small">
<el-input v-model="addMsg.Duration" placeholder="请输入时长" class="w400" type="number" :min="0"/> <el-input v-model="addMsg.Duration" placeholder="请输入时长" class="w400" type="number" :min="0">
</el-form-item> <template slot="append">
<el-form-item label="时长单位" prop="DurationUnit" class="is-required"> <el-radio v-model="addMsg.DurationUnit" v-for="(item,index) in DurationList" :label="item.Id" :key="index">{{item.Name}}</el-radio>
<el-select class="w400" style="margin-right: 10px;" v-model="addMsg.DurationUnit" size="small" </template>
placeholder="请选择" > </el-input>
<el-option v-for="item in DurationList" :key="item.Id" :label="item.Name" :value="item.Id">
</el-option>
</el-select>
</el-form-item> </el-form-item>
</el-form> </el-form>
</div> </div>
...@@ -77,6 +74,7 @@ ...@@ -77,6 +74,7 @@
}, },
data() { data() {
return { return {
radio:1,
addMsg: { addMsg: {
ID: 0, ID: 0,
CourseClassType:'',//课程类型(枚举) CourseClassType:'',//课程类型(枚举)
...@@ -85,7 +83,7 @@ ...@@ -85,7 +83,7 @@
IsFree:0, //是否免费0-否,1-是 IsFree:0, //是否免费0-否,1-是
PointNum:0,//点数 PointNum:0,//点数
Duration:0,//时长 Duration:0,//时长
DurationUnit:'',//时长单位(枚举) DurationUnit:1,//时长单位(枚举)
ClassPic:'', ClassPic:'',
Title:'', Title:'',
}, },
......
...@@ -16,8 +16,8 @@ ...@@ -16,8 +16,8 @@
<el-form-item label="点数" prop="PonitNum" class="is-required" size="small"> <el-form-item label="点数" prop="PonitNum" class="is-required" size="small">
<el-input v-model="addMsg.PonitNum" placeholder="请输入点数" class="w400" type="number" :min="0"/> <el-input v-model="addMsg.PonitNum" placeholder="请输入点数" class="w400" type="number" :min="0"/>
</el-form-item> </el-form-item>
<el-form-item label="赠送点数" prop="GivePonit" class="is-required" size="small"> <el-form-item label="赠送点数" prop="GivePoint" class="is-required" size="small">
<el-input v-model="addMsg.GivePonit" placeholder="请输入赠送点数" class="w400" type="number" :min="0"/> <el-input v-model="addMsg.GivePoint" placeholder="请输入赠送点数" class="w400" type="number" :min="0"/>
</el-form-item> </el-form-item>
</el-form> </el-form>
</div> </div>
...@@ -41,7 +41,7 @@ ...@@ -41,7 +41,7 @@
ID: 0, ID: 0,
GoodsName:'', GoodsName:'',
PonitNum:0, PonitNum:0,
GivePonit:0, GivePoint:0,
SellingPrice:0, SellingPrice:0,
}, },
rules: { rules: {
...@@ -60,7 +60,7 @@ ...@@ -60,7 +60,7 @@
message: '请输入售价', message: '请输入售价',
trigger: 'blur' trigger: 'blur'
}], }],
GivePonit: [{ GivePoint: [{
required: true, required: true,
message: '赠送点数不能为空', message: '赠送点数不能为空',
trigger: 'blur' trigger: 'blur'
...@@ -89,7 +89,6 @@ ...@@ -89,7 +89,6 @@
this.Error('点数大于0') this.Error('点数大于0')
return false return false
} }
this.addMsg.GivePonit = parseInt(this.addMsg.GivePonit);
this.apipost("/api/Point/SetPointGoods", this.addMsg, res => { this.apipost("/api/Point/SetPointGoods", this.addMsg, res => {
if (res.data.resultCode == 1) { if (res.data.resultCode == 1) {
this.CommonJump('pointList'); this.CommonJump('pointList');
...@@ -113,7 +112,7 @@ ...@@ -113,7 +112,7 @@
this.addMsg.ID = tempDate.ID; this.addMsg.ID = tempDate.ID;
this.addMsg.GoodsName = tempDate.GoodsName; this.addMsg.GoodsName = tempDate.GoodsName;
this.addMsg.PonitNum = tempDate.PonitNum; this.addMsg.PonitNum = tempDate.PonitNum;
this.addMsg.GivePonit = tempDate.GivePonit; this.addMsg.GivePoint = tempDate.GivePoint;
this.addMsg.SellingPrice = tempDate.SellingPrice; this.addMsg.SellingPrice = tempDate.SellingPrice;
}) })
}, },
......
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
<el-form-item label="课程分类" prop="CourseClassId" class="is-required"> <el-form-item label="课程分类" prop="CourseClassId" class="is-required">
<el-select class="w400" style="margin-right: 10px;" v-model="addMsg.CourseClassId" size="small" @change="getCoursedata(addMsg.CourseClassId)" <el-select class="w400" style="margin-right: 10px;" v-model="addMsg.CourseClassId" size="small" @change="getCoursedata(addMsg.CourseClassId)"
placeholder="请选择" > placeholder="请选择" >
<el-option v-for="item in CourseClassList" :key="item.ID" :label="item.ClassName" :value="item.ID" > <el-option v-for="item in CourseClassList" :key="item.ID" :label="item.ClassName+' '+'/'+' '+item.Title" :value="item.ID" >
</el-option> </el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
...@@ -71,14 +71,11 @@ ...@@ -71,14 +71,11 @@
<el-input v-model="addMsg.MinDuration" placeholder="请输入时长" class="w400" type="number" :min="0" :disabled="jiesushow"/> <el-input v-model="addMsg.MinDuration" placeholder="请输入时长" class="w400" type="number" :min="0" :disabled="jiesushow"/>
</el-form-item> </el-form-item>
<el-form-item label="每课时长" prop="StudyDuration" class="is-required" size="small" > <el-form-item label="每课时长" prop="StudyDuration" class="is-required" size="small" >
<el-input v-model="addMsg.StudyDuration" placeholder="请输入时长" class="w400" type="number" :min="0" @blur="getTime()"/> <el-input v-model="addMsg.StudyDuration" placeholder="请输入时长" class="w400" type="number" :min="0" @blur="getTime()">
</el-form-item> <template slot="append">
<el-form-item label="时长单位" prop="DurationUnit" class="is-required"> <el-radio v-model="addMsg.DurationUnit" v-for="(item,index) in DurationList" :label="item.Id" :key="index">{{item.Name}}</el-radio>
<el-select class="w400" style="margin-right: 10px;" v-model="addMsg.DurationUnit" size="small" @change="getTime()" </template>
placeholder="请选择" > </el-input>
<el-option v-for="item in DurationList" :key="item.Id" :label="item.Name" :value="item.Id">
</el-option>
</el-select>
</el-form-item> </el-form-item>
</el-form> </el-form>
</div> </div>
...@@ -109,7 +106,7 @@ ...@@ -109,7 +106,7 @@
CourseName:'', CourseName:'',
MinDuration:0, MinDuration:0,
StudyDuration:0, StudyDuration:0,
DurationUnit:'', DurationUnit:1,
IsPublic:0, IsPublic:0,
RoomId:'', RoomId:'',
}, },
...@@ -154,11 +151,6 @@ ...@@ -154,11 +151,6 @@
message: '时长不能为空', message: '时长不能为空',
trigger: 'blur' trigger: 'blur'
}], }],
DurationUnit: [{
required: true,
message: '请选择时长单位',
trigger: 'blur'
}],
StudyStartDate: [{ StudyStartDate: [{
required: true, required: true,
message: '请选择开始时间', message: '请选择开始时间',
...@@ -232,9 +224,8 @@ ...@@ -232,9 +224,8 @@
}, },
getCourseClassList(){ getCourseClassList(){
this.apipost("/api/Point/GetPointCourseClassList", {}, res => { this.apipost("/api/Point/GetPointCourseClassList", {}, res => {
if(res.data.resultCode==1){ if(res.data.resultCode==1){
this.CourseClassList = res.data.data this.CourseClassList = res.data.data;
}else { }else {
this.Info(res.data.message); this.Info(res.data.message);
} }
...@@ -244,7 +235,8 @@ ...@@ -244,7 +235,8 @@
getDurationList(){ getDurationList(){
this.apipost("/api/Point/GetDurationUnitEnumList", {}, res => { this.apipost("/api/Point/GetDurationUnitEnumList", {}, res => {
if(res.data.resultCode==1){ if(res.data.resultCode==1){
this.DurationList = res.data.data this.DurationList = res.data.data;
console.log(res,'小时');
}else { }else {
this.Info(res.data.message); this.Info(res.data.message);
} }
...@@ -299,11 +291,24 @@ ...@@ -299,11 +291,24 @@
ID: ID ID: ID
}, res => { }, res => {
this.loading = false; this.loading = false;
this.addMsg = res.data.data; if(res.data.resultCode==1){
let tempData = res.data.data;
this.addMsg.ID = tempData.ID;
this.addMsg.CourseClassId = tempData.CourseClassId;
this.addMsg.TeacherId = tempData.TeacherId;
this.addMsg.StudyDate = tempData.StudyDate;
this.addMsg.StudyStartDate = tempData.StudyStartDate;
this.addMsg.StudyEndDate = tempData.StudyEndDate;
this.addMsg.PointNum = tempData.PointNum;
this.addMsg.CourseName = tempData.CourseName;
this.addMsg.MinDuration = tempData.MinDuration;
this.addMsg.StudyDuration = tempData.StudyDuration;
this.addMsg.DurationUnit = tempData.DurationUnit;
this.addMsg.IsPublic = tempData.IsPublic;
this.addMsg.RoomId = tempData.RoomId;
}
}) })
}, }
}, },
mounted() { mounted() {
} }
......
...@@ -23,11 +23,13 @@ ...@@ -23,11 +23,13 @@
label="ID" label="ID"
width="100"> width="100">
</el-table-column> </el-table-column>
<el-table-column
prop="Title"
label="标题">
</el-table-column>
<el-table-column <el-table-column
prop="CourseClassName" prop="CourseClassName"
label="分类类型"> label="分类类型">
</el-table-column> </el-table-column>
<el-table-column <el-table-column
prop="Duration" prop="Duration"
...@@ -48,8 +50,8 @@ ...@@ -48,8 +50,8 @@
prop="IsGive" prop="IsGive"
label="是否免费"> label="是否免费">
<template slot-scope="scope"> <template slot-scope="scope">
<el-tag v-if="scope.row.IsFree==0" type="info">不免费</el-tag> <el-tag v-if="scope.row.IsFree==0" size="small" type="info">不免费</el-tag>
<el-tag v-if="scope.row.IsFree==1" type="success">免费</el-tag> <el-tag v-if="scope.row.IsFree==1" size="small" type="success">免费</el-tag>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column <el-table-column
......
...@@ -24,7 +24,7 @@ ...@@ -24,7 +24,7 @@
<el-table-column prop="IsGive" label="是否赠送点数"> <el-table-column prop="IsGive" label="是否赠送点数">
<template slot-scope="scope"> <template slot-scope="scope">
<el-tag v-if="scope.row.IsGive==0" type="info">不赠送</el-tag> <el-tag v-if="scope.row.IsGive==0" type="info">不赠送</el-tag>
<el-tag v-if="scope.row.IsGive>0" type="warning">赠送{{scope.row.GivePonit}}点数</el-tag> <el-tag v-if="scope.row.IsGive>0" type="warning">赠送{{scope.row.GivePoint}}点数</el-tag>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column fixed="right" label="操作" width="180"> <el-table-column fixed="right" label="操作" width="180">
......
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