Commit 6cf8b5c5 authored by zhengke's avatar zhengke

修改

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