培训班
This commit is contained in:
@@ -23,7 +23,7 @@ module.exports = {
|
||||
},
|
||||
|
||||
// Various Dev Server settings
|
||||
host: '192.168.110.157', // can be overwritten by process.env.HOST
|
||||
host: '192.168.110.160', // can be overwritten by process.env.HOST
|
||||
port: 8001, // can be overwritten by process.env.PORT, if port is in use, a free one will be determined
|
||||
autoOpenBrowser: true,
|
||||
errorOverlay: true,
|
||||
|
||||
@@ -19,25 +19,7 @@
|
||||
<template v-if="pageType == 'label'">
|
||||
<el-form-item label="手机号/邮箱:" prop="userKey" class="form_item">
|
||||
<div style="display: flex;align-items: center;">
|
||||
<el-autocomplete
|
||||
v-if="!isEdit"
|
||||
style="width: 400px;"
|
||||
v-model="addCertificateForm.userKey"
|
||||
:fetch-suggestions="loadAll"
|
||||
placeholder="请输入手机号/邮箱"
|
||||
@select="handleSelect"
|
||||
>
|
||||
<template #default="{ item }">
|
||||
<div class="custom-item">
|
||||
<span>{{ item.tel ? item.tel : item.email }}</span>
|
||||
<span
|
||||
style="color: gray; margin-left: 10px;"
|
||||
v-if="item.name"
|
||||
>({{ item.name }})</span
|
||||
>
|
||||
</div>
|
||||
</template>
|
||||
</el-autocomplete>
|
||||
|
||||
<span v-if="isEdit">{{ addCertificateForm.userKey }}</span>
|
||||
</div>
|
||||
</el-form-item>
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
>
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="年份">
|
||||
<el-form-item label="培训年份">
|
||||
<el-input
|
||||
v-model="dataForm.year"
|
||||
placeholder="请输入年份(YYYY)"
|
||||
@@ -47,33 +47,62 @@
|
||||
border
|
||||
v-loading="dataListLoading"
|
||||
style="width: 100%"
|
||||
@sort-change="handleSortChange"
|
||||
>
|
||||
<el-table-column label="标题" align="center">
|
||||
<el-table-column
|
||||
label="序号"
|
||||
type="index"
|
||||
align="center"
|
||||
width="60">
|
||||
</el-table-column>
|
||||
<el-table-column label="培训日期" width="110" align="center" sortable="custom" :sort-orders="['ascending', 'descending']">
|
||||
<template slot-scope="scope">
|
||||
<span v-if="scope.row.trainingDate">
|
||||
{{ scope.row.trainingDate.substring(0, 10) }}
|
||||
</span>
|
||||
<span v-else>-</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="创建时间" width="110" align="center" sortable="custom" :sort-orders="['ascending', 'descending']">
|
||||
<template slot-scope="scope">
|
||||
<span v-if="scope.row.createTime">
|
||||
{{ scope.row.createTime.substring(0, 10) }}
|
||||
</span>
|
||||
<span v-else>-</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="标题" align="center" width="160">
|
||||
<template slot-scope="scope">{{ scope.row.title }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="年份" align="center">
|
||||
<template slot-scope="scope">{{ scope.row.year }}</template>
|
||||
<el-table-column label="海报" align="center" width="90">
|
||||
<template slot-scope="scope">
|
||||
<img width="50px" :src="scope.row.icon" v-if="scope.row.icon" alt="" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="原价" align="center">
|
||||
<el-table-column label="年份" align="center" prop="year" width="90"></el-table-column>
|
||||
<el-table-column label="原价" align="center" width="80">
|
||||
<template slot-scope="scope">{{ scope.row.fee }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="vip价格" align="center">
|
||||
<el-table-column label="vip价格" align="center" width="80">
|
||||
<template slot-scope="scope">{{ scope.row.vipFee }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="svip价格" align="center">
|
||||
<el-table-column label="svip价格" align="center" width="80">
|
||||
<template slot-scope="scope">{{ scope.row.svipFee }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="湖粉价格" align="center">
|
||||
<template slot-scope="scope">{{ scope.row.huFee }}</template>
|
||||
<el-table-column label="湖粉价格" align="center" width="130">
|
||||
<template slot-scope="scope">
|
||||
三星湖粉 {{ scope.row.threeHuFee }}<br/>
|
||||
五星湖粉 {{ scope.row.fiveHuFee }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="活动类型" align="center" prop="type">
|
||||
<el-table-column label="活动类型" align="center" prop="type" width="90">
|
||||
<template slot-scope="scope">
|
||||
<span v-if="scope.row.type==1">线上</span>
|
||||
<span v-else-if="scope.row.type==2">线下</span>
|
||||
<span v-else>--</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="报名状态" align="center" width="220">
|
||||
<el-table-column label="报名状态" align="center" width="200">
|
||||
<template slot-scope="scope">
|
||||
<el-switch
|
||||
@change="changeSingupFlag(scope.row)"
|
||||
@@ -87,13 +116,13 @@
|
||||
</el-switch>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="创建时间" align="center" prop="createTime">
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column label="排序" align="center" prop="sort" width="90"></el-table-column>
|
||||
|
||||
<el-table-column
|
||||
fixed="right"
|
||||
header-align="center"
|
||||
align="center"
|
||||
width="120"
|
||||
label="操作"
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
@@ -107,7 +136,6 @@
|
||||
<el-button
|
||||
type="text"
|
||||
size="small"
|
||||
@click="userHandle(scope.row)"
|
||||
>用户列表</el-button
|
||||
>
|
||||
</router-link>
|
||||
@@ -141,21 +169,47 @@
|
||||
<el-form-item label="标题" prop="title">
|
||||
<el-input v-model="addForm.title" placeholder="请输入标题"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="年份" prop="year">
|
||||
<el-input v-model="addForm.year" placeholder="请输入年份(YYYY)"></el-input>
|
||||
<el-form-item label="培训日期" prop="trainingDate">
|
||||
<el-date-picker
|
||||
v-model="addForm.trainingDate"
|
||||
type="date"
|
||||
value-format="yyyy-MM-dd"
|
||||
placeholder="请选择日期">
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
<el-form-item label="原价" prop="fee">
|
||||
<el-input v-model="addForm.fee" placeholder="请输入原价"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="排序" prop="sort">
|
||||
<el-input v-model="addForm.sort" placeholder="请输入排序"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="vip类型">
|
||||
<el-checkbox-group v-model="vipType" @change="handleCheckedVip" class="checkbox-group">
|
||||
<el-checkbox v-for="item in vipList" :label="item.type" :key="item.type">{{item.title}}</el-checkbox>
|
||||
</el-checkbox-group>
|
||||
</el-form-item>
|
||||
<el-form-item label="vip价格" prop="vipFee">
|
||||
<el-input v-model="addForm.vipFee" placeholder="请输入vip价格"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="svip类型">
|
||||
<el-checkbox-group v-model="svipType" @change="handleCheckedSvip" class="checkbox-group">
|
||||
<el-checkbox v-for="item in svipList" :label="item.type" :key="item.type">{{item.title}}</el-checkbox>
|
||||
</el-checkbox-group>
|
||||
</el-form-item>
|
||||
<el-form-item label="svip价格" prop="svipFee">
|
||||
<el-input v-model="addForm.svipFee" placeholder="请输入svip价格"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="湖粉价格" prop="huFee">
|
||||
<el-input v-model="addForm.huFee" placeholder="请输入湖粉价格"></el-input>
|
||||
<el-form-item label="湖粉价格">
|
||||
<div class="hufen_block">
|
||||
<span>三星湖粉</span>
|
||||
<el-input v-model="addForm.threeHuFee" placeholder="请输入湖粉价格(90湖分以上)"></el-input>
|
||||
</div>
|
||||
<div class="hufen_block">
|
||||
<span>五星湖粉</span>
|
||||
<el-input v-model="addForm.fiveHuFee" placeholder="请输入湖粉价格(150湖分以上)"></el-input>
|
||||
</div>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="活动类型" prop="type">
|
||||
<el-radio-group v-model="addForm.type">
|
||||
<el-radio :label="1">线上</el-radio>
|
||||
@@ -174,6 +228,25 @@
|
||||
>
|
||||
</el-switch>
|
||||
</el-form-item>
|
||||
<el-form-item label="上传海报" prop="icon">
|
||||
<el-upload
|
||||
:limit="1"
|
||||
class="el-uploadfeng"
|
||||
:action="baseUrl + '/oss/fileoss'"
|
||||
list-type="picture-card"
|
||||
:on-preview="handlePreview"
|
||||
:file-list="fileList"
|
||||
:on-success="handleSuccess"
|
||||
accept=".jpeg,.jpg,.gif,.png"
|
||||
:on-remove="handleRemove"
|
||||
>
|
||||
<i class="el-icon-plus"></i>
|
||||
</el-upload>
|
||||
<span>支持图片类型:.jpeg,.jpg,.gif,.png</span>
|
||||
<el-dialog :visible.sync="dialogVisible" :append-to-body="true">
|
||||
<img width="100%" :src="addForm.icon" alt="" />
|
||||
</el-dialog>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button @click="cancleClose">取 消</el-button>
|
||||
@@ -183,12 +256,13 @@
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import global from "../../common/common.vue"; //引入共用组间
|
||||
export default {
|
||||
data() {
|
||||
// 通用校验规则:正数且大于 0
|
||||
const validatePositiveNumber = (rule, value, callback) => {
|
||||
if (!value) {
|
||||
return callback(new Error('不能为空'));
|
||||
return callback(new Error('原价不能为空'));
|
||||
}
|
||||
if (!/^\d+(\.\d+)?$/.test(value)) {
|
||||
return callback(new Error('必须是正数或小数'));
|
||||
@@ -199,10 +273,12 @@ export default {
|
||||
callback();
|
||||
};
|
||||
return {
|
||||
baseUrl: global.baseUrl,
|
||||
dataForm: {
|
||||
title: '',
|
||||
type: '', //1线上 2线下
|
||||
year: '',
|
||||
year: '', //日期
|
||||
trainingDate: '',
|
||||
singupFlag: '', //1可报名 0不可报名
|
||||
},
|
||||
addForm: {
|
||||
@@ -211,12 +287,16 @@ export default {
|
||||
type: 1, //1线上 2线下
|
||||
icon: '',
|
||||
year: '',
|
||||
trainingDate: '',
|
||||
fee: '',
|
||||
vipType: '',
|
||||
vipFee: '',
|
||||
svipType: '',
|
||||
svipFee: '',
|
||||
huFee: '',
|
||||
threeHuFee: '',
|
||||
fiveHuFee: '',
|
||||
singupFlag: 1, //1可报名 0不可报名
|
||||
sort: 0
|
||||
sort: ''
|
||||
},
|
||||
editId: "",
|
||||
addFormRule: {
|
||||
@@ -226,10 +306,11 @@ export default {
|
||||
message: "请输入标题",
|
||||
},
|
||||
],
|
||||
year: [
|
||||
trainingDate: [
|
||||
{
|
||||
required: true,
|
||||
message: "请输入年份",
|
||||
message: "请选择日期",
|
||||
trigger: 'change'
|
||||
},
|
||||
],
|
||||
fee: [
|
||||
@@ -247,12 +328,44 @@ export default {
|
||||
addOrUpdateVisible: false,
|
||||
titlesub: '新增',
|
||||
statusType: 0, //区分新增还是修改
|
||||
value: '', //选择日期
|
||||
fileList: [], //图片数组
|
||||
dialogVisible: false,
|
||||
//保存数据
|
||||
vipList: [],
|
||||
svipList: [],
|
||||
//勾选值
|
||||
vipType: [],
|
||||
svipType: [],
|
||||
//日期排序
|
||||
sortParams: {
|
||||
date1: '',
|
||||
date2: ''
|
||||
}
|
||||
};
|
||||
},
|
||||
created() {
|
||||
activated(){
|
||||
this.getDataList();
|
||||
this.getVipData();
|
||||
},
|
||||
methods: {
|
||||
//排序变化事件
|
||||
handleSortChange({ column, prop, order }) {
|
||||
// 更新当前列的排序状态
|
||||
var name = column.label;
|
||||
if(name=='培训日期'){
|
||||
this.sortParams.date1 = order
|
||||
? (order === 'ascending' ? '2' : '1')
|
||||
: null;
|
||||
}else{
|
||||
this.sortParams.date2 = order
|
||||
? (order === 'ascending' ? '2' : '1')
|
||||
: null;
|
||||
}
|
||||
this.getDataList();
|
||||
},
|
||||
|
||||
|
||||
// 获取数据列表
|
||||
getDataList() {
|
||||
this.dataListLoading = true;
|
||||
@@ -262,6 +375,8 @@ export default {
|
||||
data: this.$http.adornData({
|
||||
current: this.pageIndex,
|
||||
limit: this.pageSize,
|
||||
trainingDateSort: this.sortParams.date1,
|
||||
createTimeSort: this.sortParams.date2,
|
||||
title: this.dataForm.title,
|
||||
type: this.dataForm.type,
|
||||
year: this.dataForm.year,
|
||||
@@ -291,35 +406,41 @@ export default {
|
||||
type: 1, //1线上 2线下
|
||||
icon: '',
|
||||
year: '',
|
||||
trainingDate: '',
|
||||
fee: '',
|
||||
vipType: '',
|
||||
vipFee: '',
|
||||
svipType: '',
|
||||
svipFee: '',
|
||||
huFee: '',
|
||||
threeHuFee: '',
|
||||
fiveHuFee: '',
|
||||
singupFlag: 1, //1可报名 0不可报名
|
||||
sort: 0
|
||||
sort: ''
|
||||
}
|
||||
this.fileList = [];
|
||||
this.vipType = [];
|
||||
this.svipType = [];
|
||||
},
|
||||
//关闭
|
||||
cancleClose(){
|
||||
this.addOrUpdateVisible = false;
|
||||
},
|
||||
//点击确定
|
||||
addOrEditCate(){
|
||||
//如果是新增
|
||||
if(this.statusType==0){
|
||||
if(this.statusType==0){ //如果是新增
|
||||
this.addCate();
|
||||
}else if(this.statusType==1){ //如果是修改
|
||||
this.editCate(this.addForm);
|
||||
}
|
||||
},
|
||||
|
||||
//取消
|
||||
cancleClose(){
|
||||
this.addOrUpdateVisible = false;
|
||||
},
|
||||
//确定
|
||||
//修改
|
||||
editCate(data){
|
||||
this.$refs["addFormRef"].validate(valid => {
|
||||
if (valid) {
|
||||
var icon = '';
|
||||
if(this.fileList&&this.fileList.length>0){
|
||||
icon = this.fileList[0].url
|
||||
}
|
||||
this.$http({
|
||||
url: this.$http.adornUrl("/master/trainingClass/editTrainingClass"),
|
||||
method: "post",
|
||||
@@ -328,12 +449,16 @@ export default {
|
||||
title: data.title,
|
||||
type: data.type,
|
||||
year: data.year,
|
||||
trainingDate: data.trainingDate,
|
||||
singupFlag: data.singupFlag,
|
||||
icon: data.icon,
|
||||
icon: icon,
|
||||
fee: data.fee,
|
||||
vipType: String(this.vipType),
|
||||
vipFee: data.vipFee,
|
||||
svipType: String(this.svipType),
|
||||
svipFee: data.svipFee,
|
||||
huFee: data.huFee,
|
||||
threeHuFee: data.threeHuFee,
|
||||
fiveHuFee: data.fiveHuFee,
|
||||
sort: data.sort
|
||||
}),
|
||||
}).then(({ data }) => {
|
||||
@@ -365,6 +490,10 @@ export default {
|
||||
addCate(){
|
||||
this.$refs["addFormRef"].validate(valid => {
|
||||
if (valid) {
|
||||
var icon = '';
|
||||
if(this.fileList&&this.fileList.length>0){
|
||||
icon = this.fileList[0].url
|
||||
}
|
||||
this.$http({
|
||||
url: this.$http.adornUrl("/master/trainingClass/addTrainingClass"),
|
||||
method: "post",
|
||||
@@ -372,13 +501,16 @@ export default {
|
||||
id: this.addForm.id,
|
||||
title: this.addForm.title,
|
||||
type: String(this.addForm.type),
|
||||
year: this.addForm.year,
|
||||
trainingDate: this.addForm.trainingDate,
|
||||
singupFlag: String(this.addForm.singupFlag),
|
||||
icon: this.addForm.icon,
|
||||
icon: icon,
|
||||
fee: this.addForm.fee,
|
||||
vipType: String(this.vipType),
|
||||
vipFee: this.addForm.vipFee,
|
||||
svipType: String(this.svipType),
|
||||
svipFee: this.addForm.svipFee,
|
||||
huFee: this.addForm.huFee,
|
||||
threeHuFee: this.addForm.threeHuFee,
|
||||
fiveHuFee: this.addForm.fiveHuFee,
|
||||
sort: this.addForm.sort
|
||||
}),
|
||||
}).then(({ data }) => {
|
||||
@@ -399,6 +531,7 @@ export default {
|
||||
//操作
|
||||
//点击修改
|
||||
editHandle(data){
|
||||
this.fileList = [];
|
||||
this.addOrUpdateVisible = true;
|
||||
this.titlesub = '修改';
|
||||
this.statusType = 1; //修改
|
||||
@@ -407,17 +540,69 @@ export default {
|
||||
this.addForm.title = data.title;
|
||||
this.addForm.type = Number(data.type);
|
||||
this.addForm.year = data.year;
|
||||
this.addForm.trainingDate = data.trainingDate;
|
||||
this.addForm.singupFlag = Number(data.singupFlag);
|
||||
this.addForm.icon = data.icon;
|
||||
//图片赋值
|
||||
if(data.icon){
|
||||
this.fileList.push({
|
||||
url: data.icon
|
||||
});
|
||||
}
|
||||
this.addForm.fee = data.fee;
|
||||
this.vipType = data.vipType.split(',').map(item => parseInt(item, 10));
|
||||
this.addForm.vipFee = data.vipFee;
|
||||
this.svipType = data.svipType.split(',').map(item => parseInt(item, 10));
|
||||
this.addForm.svipFee = data.svipFee;
|
||||
this.addForm.huFee = data.huFee;
|
||||
this.addForm.threeHuFee = data.threeHuFee;
|
||||
this.addForm.fiveHuFee = data.fiveHuFee;
|
||||
this.addForm.sort = data.sort;
|
||||
},
|
||||
//点击用户列表
|
||||
userHandle(data){
|
||||
console.log('用户列表')
|
||||
//上传图片
|
||||
handlePreview(file) {
|
||||
this.fileList = [];
|
||||
this.addForm.icon = file.url;
|
||||
this.fileList.push({
|
||||
url: file.url
|
||||
});
|
||||
this.dialogVisible = true;
|
||||
},
|
||||
//图片上传成功
|
||||
handleSuccess(res, file) {
|
||||
if (res.msg == "success") {
|
||||
this.fileList.push({
|
||||
url: res.url
|
||||
});
|
||||
this.$message.success("图片上传成功");
|
||||
} else {
|
||||
this.$message.error("图片上传失败");
|
||||
}
|
||||
},
|
||||
//图片删除操作
|
||||
handleRemove(file, fileList) {
|
||||
this.fileList = [];
|
||||
},
|
||||
|
||||
//获取vip数据
|
||||
getVipData(){
|
||||
this.$http({
|
||||
url: this.$http.adornUrl("/master/trainingClass/getVipBuyConfigList"),
|
||||
method: "post",
|
||||
data: this.$http.adornData({}),
|
||||
}).then(({ data }) => {
|
||||
if (data && data.code === 0) {
|
||||
this.vipList = data.vipBuyConfigList.filter(item => item.type >= 4 && item.type <= 9);
|
||||
this.svipList = data.vipBuyConfigList.filter(item => item.type === 1 || item.type === 2);
|
||||
}
|
||||
});
|
||||
},
|
||||
//勾选vip
|
||||
handleCheckedVip(value){
|
||||
console.log('vip的值', value)
|
||||
},
|
||||
//勾选svip
|
||||
handleCheckedSvip(value){
|
||||
console.log('svip的值', value)
|
||||
},
|
||||
},
|
||||
};
|
||||
@@ -440,7 +625,7 @@ export default {
|
||||
|
||||
.dialog_box {
|
||||
.el-form-item__content {
|
||||
width: calc(100% - 90px) !important;
|
||||
width: calc(100% - 120px) !important;
|
||||
}
|
||||
.form_item {
|
||||
width: 100%;
|
||||
@@ -452,4 +637,35 @@ export default {
|
||||
}
|
||||
}
|
||||
}
|
||||
.checkbox-group .el-checkbox{
|
||||
margin-left: 0;
|
||||
margin-right: 20px;
|
||||
|
||||
.el-checkbox__label{
|
||||
padding-left: 6px;
|
||||
font-size: 13px;
|
||||
}
|
||||
}
|
||||
.hufen_block{
|
||||
display: flex;
|
||||
align-items: center;
|
||||
|
||||
span{
|
||||
width: 70px;
|
||||
display: inline-block;
|
||||
}
|
||||
.el-input{
|
||||
width: 90%;
|
||||
line-height: 34px;
|
||||
}
|
||||
.el-input__inner{
|
||||
width: 220px;
|
||||
height: 30px;
|
||||
line-height: 34px;
|
||||
padding: 0 8px;
|
||||
}
|
||||
.el-input__inner::placeholder {
|
||||
font-size: 12px;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -5,17 +5,9 @@
|
||||
:model="dataForm"
|
||||
@keyup.enter.native="getDataList()"
|
||||
>
|
||||
<el-form-item label="名称">
|
||||
<el-input
|
||||
v-model="dataForm.title"
|
||||
placeholder="请输入名称"
|
||||
clearable
|
||||
>
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="手机号">
|
||||
<el-input
|
||||
v-model="dataForm.title"
|
||||
v-model="dataForm.tel"
|
||||
placeholder="请输入手机号"
|
||||
clearable
|
||||
>
|
||||
@@ -31,8 +23,8 @@
|
||||
>
|
||||
<el-button
|
||||
type="primary"
|
||||
@click="addOrUpdateHandle()"
|
||||
>新增</el-button
|
||||
@click="addHandle()"
|
||||
>报名</el-button
|
||||
>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
@@ -41,32 +33,36 @@
|
||||
border
|
||||
v-loading="dataListLoading"
|
||||
style="width: 100%"
|
||||
@sort-change="handleSortChange"
|
||||
>
|
||||
<el-table-column label="用户ID" align="center" prop="id"></el-table-column>
|
||||
<el-table-column label="姓名" align="center" prop="nickname">
|
||||
<el-table-column
|
||||
label="序号"
|
||||
type="index"
|
||||
align="center"
|
||||
width="60">
|
||||
</el-table-column>
|
||||
<el-table-column label="报名时间" align="center" prop="createTime" width="170" sortable="custom" :sort-orders="['ascending', 'descending']">
|
||||
</el-table-column>
|
||||
<el-table-column label="订单编号" align="center" prop="orderSn"></el-table-column>
|
||||
<el-table-column label="名称" align="center">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ scope.row.nickname ? scope.row.nickname : "暂无用户名" }}</span>
|
||||
<span>{{ scope.row.user.name ? scope.row.user.nickname : "暂无用户名" }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="头像" align="center" prop="avatar">
|
||||
<el-table-column label="联系方式" align="center">
|
||||
<template slot-scope="scope">{{ scope.row.user.tel||'-' }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="用户身份" align="center">
|
||||
<template slot-scope="scope">
|
||||
<img
|
||||
v-if="scope.row.avatar && scope.row.avatar != ''"
|
||||
:src="scope.row.avatar"
|
||||
width="50"
|
||||
height="50"
|
||||
/>
|
||||
<img
|
||||
v-else
|
||||
src="../../../../static/img/morenAvavter.png"
|
||||
width="50"
|
||||
height="50"
|
||||
/>
|
||||
{{ scope.row.identity }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="电话" align="center" prop="tel"></el-table-column>
|
||||
<el-table-column label="邮箱" align="center" prop="email"></el-table-column>
|
||||
<el-table-column label="创建时间" align="center" prop="createTime">
|
||||
|
||||
<el-table-column label="支付方式" align="center">
|
||||
<template slot-scope="scope">{{ scope.row.payMethod }}:{{ scope.row.realMoney }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="抵扣方式" align="center">
|
||||
<template slot-scope="scope">积分:{{ scope.row.jfDeduction }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
fixed="right"
|
||||
@@ -78,7 +74,9 @@
|
||||
<el-button
|
||||
type="text"
|
||||
size="small"
|
||||
>修改</el-button>
|
||||
@click="deleteHandle(scope.row)"
|
||||
>删除</el-button
|
||||
>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
@@ -95,24 +93,34 @@
|
||||
|
||||
<!-- 弹窗, 新增 / 修改 -->
|
||||
<el-dialog
|
||||
:visible.sync="addOrUpdateVisible"
|
||||
:title="titlesub"
|
||||
:visible.sync="addVisible"
|
||||
title="添加用户"
|
||||
class="dialog_box"
|
||||
@close="cancleClose"
|
||||
width="600px"
|
||||
>
|
||||
<el-form
|
||||
:model="addForm"
|
||||
ref="addFormRef"
|
||||
:rules="addFormRule"
|
||||
label-width="90px"
|
||||
label-width="100px"
|
||||
>
|
||||
<el-form-item label="姓名" prop="nickname">
|
||||
<el-input v-model="addForm.nickname" placeholder="请输入姓名"></el-input>
|
||||
<el-form-item label="手机号/邮箱" prop="userKey" style="width: 530px;">
|
||||
<el-input v-model="addForm.userKey" placeholder="请输入手机号/邮箱" clearable @input="handleSearch"></el-input>
|
||||
<div class="data-list" v-if="showSearch" v-loading="searchListLoading">
|
||||
<span v-for="(v,i) in searchList" :key="i" @click="checkTitle(v)">{{ v.tel }}</span>
|
||||
</div>
|
||||
</el-form-item>
|
||||
<el-form-item label="用户身份" v-if="infoStatus">
|
||||
{{ info.identity }}
|
||||
</el-form-item>
|
||||
<el-form-item label="最终价格" v-if="infoStatus">
|
||||
{{ info.fee }}
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button @click="cancleClose">取 消</el-button>
|
||||
<el-button type="primary" @click="addOrEditCate">确 定</el-button>
|
||||
<el-button type="primary" @click="addCate">确 定</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
</div>
|
||||
@@ -123,26 +131,18 @@ export default {
|
||||
return {
|
||||
trainingId: null,
|
||||
dataForm: {
|
||||
title: '',
|
||||
|
||||
|
||||
|
||||
|
||||
tel: ''
|
||||
},
|
||||
addForm: {
|
||||
id: "", //新增不传
|
||||
title: "", //标题
|
||||
|
||||
|
||||
|
||||
|
||||
userId: '',
|
||||
userKey: ''
|
||||
},
|
||||
editId: "",
|
||||
addFormRule: {
|
||||
title: [
|
||||
userKey: [
|
||||
{
|
||||
required: true,
|
||||
message: "请输入标题",
|
||||
message: "请输入手机号/邮箱",
|
||||
},
|
||||
]
|
||||
},
|
||||
@@ -151,16 +151,36 @@ export default {
|
||||
pageSize: 10,
|
||||
totalPage: 0,
|
||||
dataListLoading: false,
|
||||
addOrUpdateVisible: false,
|
||||
titlesub: '新增',
|
||||
statusType: 0, //区分新增还是修改
|
||||
searchListLoading: false,
|
||||
addVisible: false,
|
||||
//新增-模糊查询
|
||||
showSearch: false,
|
||||
searchList: [],
|
||||
sortParams: { // 排序参数
|
||||
field: 'date', // 默认排序字段
|
||||
order: 'desc' // 默认降序
|
||||
},
|
||||
//获取身份和价格
|
||||
infoStatus: false,
|
||||
info: {},
|
||||
//日期排序
|
||||
sortParams: {
|
||||
date: ''
|
||||
}
|
||||
};
|
||||
},
|
||||
created() {
|
||||
this.trainingId=this.$route.query.id;
|
||||
activated(){
|
||||
this.trainingId = this.$route.query.id;
|
||||
this.getDataList();
|
||||
},
|
||||
methods: {
|
||||
//排序变化事件
|
||||
handleSortChange({ column, prop, order }) {
|
||||
this.sortParams.date = order
|
||||
? (order === 'ascending' ? '2' : '1')
|
||||
: null;
|
||||
this.getDataList();
|
||||
},
|
||||
// 获取数据列表
|
||||
getDataList() {
|
||||
this.dataListLoading = true;
|
||||
@@ -170,7 +190,9 @@ export default {
|
||||
data: this.$http.adornData({
|
||||
current: this.pageIndex,
|
||||
limit: this.pageSize,
|
||||
trainingId: this.trainingId
|
||||
trainingId: this.trainingId,
|
||||
tel: this.dataForm.tel,
|
||||
createTimeSort: this.sortParams.date
|
||||
}),
|
||||
}).then(({ data }) => {
|
||||
if (data && data.code === 0) {
|
||||
@@ -180,27 +202,20 @@ export default {
|
||||
this.dataListLoading = false;
|
||||
});
|
||||
},
|
||||
//新增
|
||||
addOrUpdateHandle(){
|
||||
this.addOrUpdateVisible = true;
|
||||
this.statusType = 0; //新增
|
||||
this.titlesub = '新增';
|
||||
//添加用户
|
||||
addHandle(){
|
||||
this.addVisible = true;
|
||||
this.$refs["addFormRef"].resetFields();
|
||||
this.addForm = {
|
||||
title: "", //标题
|
||||
userId:'',
|
||||
userKey: ''
|
||||
}
|
||||
this.infoStatus = false;
|
||||
this.info = {};
|
||||
},
|
||||
//关闭
|
||||
cancleClose(){
|
||||
this.addOrUpdateVisible = false;
|
||||
},
|
||||
addOrEditCate(){
|
||||
this.addCate();
|
||||
},
|
||||
|
||||
//取消
|
||||
cancleClose(){
|
||||
this.addOrUpdateVisible = false;
|
||||
this.addVisible = false;
|
||||
},
|
||||
// 每页数
|
||||
sizeChangeHandle(val) {
|
||||
@@ -213,40 +228,121 @@ export default {
|
||||
this.pageIndex = val;
|
||||
this.getDataList();
|
||||
},
|
||||
//新增
|
||||
//模糊查询
|
||||
handleSearch(val){
|
||||
if(val){
|
||||
this.showSearch = true;
|
||||
this.searchListLoading = true;
|
||||
this.infoStatus = false;
|
||||
this.info = {}
|
||||
this.$http({
|
||||
url: this.$http.adornUrl("/book/user/getUserList"),
|
||||
method: "post",
|
||||
data: this.$http.adornData({
|
||||
page: 1,
|
||||
limit: 9999,
|
||||
key: val
|
||||
})
|
||||
}).then(({ data }) => {
|
||||
if (data && data.code === 0) {
|
||||
if(data.user.records&&data.user.records.length>0){
|
||||
this.searchList = data.user.records;
|
||||
}else{
|
||||
this.searchList = [];
|
||||
}
|
||||
this.searchListLoading = false;
|
||||
}
|
||||
});
|
||||
}else{
|
||||
console.log('输入框已被清空');
|
||||
this.infoStatus = false;
|
||||
this.info = {}
|
||||
}
|
||||
},
|
||||
//选中模糊值
|
||||
checkTitle(v){
|
||||
this.addForm.userId = v.id;
|
||||
this.addForm.userKey = v.tel;
|
||||
this.showSearch = false;
|
||||
this.getFinalPriceByUser();
|
||||
},
|
||||
//获取角色和价格
|
||||
getFinalPriceByUser(){
|
||||
this.$http({
|
||||
url: this.$http.adornUrl("/common/trainingClass/getFinalPriceByUser"),
|
||||
method: "post",
|
||||
data: this.$http.adornData({
|
||||
userId: this.addForm.userId,
|
||||
classId: Number(this.trainingId)
|
||||
}),
|
||||
}).then(({ data }) => {
|
||||
if (data && data.code === 0) {
|
||||
if(data.info){
|
||||
this.infoStatus = true;
|
||||
this.info = data.info;
|
||||
}else{
|
||||
this.infoStatus = false;
|
||||
}
|
||||
}else{
|
||||
this.$message.error(data.msg);
|
||||
}
|
||||
});
|
||||
},
|
||||
//添加用户
|
||||
addCate(){
|
||||
this.$refs["addFormRef"].validate(valid => {
|
||||
if (valid) {
|
||||
this.$http({
|
||||
url: this.$http.adornUrl("/master/trainingClass/addTrainingClass"),
|
||||
url: this.$http.adornUrl("/master/trainingClass/addUserToTrainingClass"),
|
||||
method: "post",
|
||||
data: this.$http.adornData({
|
||||
id: this.addForm.id,
|
||||
title: this.addForm.title,
|
||||
type: String(this.addForm.type),
|
||||
year: this.addForm.year,
|
||||
singupFlag: String(this.addForm.singupFlag),
|
||||
icon: this.addForm.icon,
|
||||
fee: this.addForm.fee,
|
||||
vipFee: this.addForm.vipFee,
|
||||
svipFee: this.addForm.svipFee,
|
||||
huFee: this.addForm.huFee,
|
||||
sort: this.addForm.sort
|
||||
userId: this.addForm.userId,
|
||||
trainingId: this.trainingId,
|
||||
identity: this.info.identity+':'+this.info.fee
|
||||
}),
|
||||
}).then(({ data }) => {
|
||||
if (data && data.code === 0) {
|
||||
this.$message({
|
||||
message: "操作成功",
|
||||
message: "添加成功",
|
||||
type: "success"
|
||||
});
|
||||
this.addOrUpdateVisible = false;
|
||||
this.addVisible = false;
|
||||
|
||||
this.getDataList();
|
||||
}else{
|
||||
this.$message.error(data.msg);
|
||||
}
|
||||
});
|
||||
}
|
||||
})
|
||||
}
|
||||
},
|
||||
//删除
|
||||
deleteHandle(row){
|
||||
this.$confirm("确定要删除该用户?", "提示", {
|
||||
confirmButtonText: "确定",
|
||||
cancelButtonText: "取消",
|
||||
type: "warning"
|
||||
})
|
||||
.then(() => {
|
||||
this.$http({
|
||||
url: this.$http.adornUrl("/master/trainingClass/delUserToTrainingClass"),
|
||||
method: "post",
|
||||
data: this.$http.adornData({
|
||||
id: row.id
|
||||
}),
|
||||
}).then(({ data }) => {
|
||||
if (data && data.code === 0) {
|
||||
this.$message({
|
||||
message: "操作成功",
|
||||
type: "success"
|
||||
});
|
||||
|
||||
this.getDataList();
|
||||
}
|
||||
});
|
||||
})
|
||||
.catch(() => {});
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
@@ -280,4 +376,26 @@ export default {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.data-list{
|
||||
min-height: 200px;
|
||||
width: 100%;
|
||||
border-radius: 4px;
|
||||
background: #fff;
|
||||
position: absolute;
|
||||
z-index: 99;
|
||||
top: 40px;
|
||||
left: 0;
|
||||
padding: 10px 20px;
|
||||
cursor: pointer;
|
||||
max-height: 280px;
|
||||
overflow-y: scroll;
|
||||
|
||||
span{
|
||||
color: #606266;
|
||||
line-height: 36px;
|
||||
font-size: 14px;
|
||||
display: block;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -5,9 +5,9 @@
|
||||
window.SITE_CONFIG = {};
|
||||
|
||||
// api接口请求地址
|
||||
window.SITE_CONFIG['baseUrl'] = 'https://api.nuttyreading.com'; // 线上正式环境
|
||||
// window.SITE_CONFIG['baseUrl'] = 'http://192.168.110.100:9200/pb'; //川
|
||||
// window.SITE_CONFIG['baseUrl'] = 'http://192.168.110.110:9200/pb'; //本地
|
||||
//window.SITE_CONFIG['baseUrl'] = 'https://api.nuttyreading.com'; // 线上正式环境
|
||||
window.SITE_CONFIG['baseUrl'] = 'http://192.168.110.100:9200/pb'; //川
|
||||
//window.SITE_CONFIG['baseUrl'] = 'http://192.168.110.110:9200/pb'; //本地
|
||||
|
||||
// cdn地址 = 域名 + 版本号
|
||||
window.SITE_CONFIG['domain'] = './'; // 域名
|
||||
|
||||
Reference in New Issue
Block a user