修改价格
This commit is contained in:
@@ -29,10 +29,10 @@
|
|||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
<el-form-item label="半年价格" prop="halfFee">
|
<el-form-item label="半年价格" prop="halfFee">
|
||||||
<el-input v-model="dataForm.halfFee" placeholder="半年价格"></el-input>
|
<el-input v-model="dataForm.halfFee" placeholder="半年价格" :disabled='this.dataForm.id'></el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="全年价格" prop="fee">
|
<el-form-item label="全年价格" prop="fee">
|
||||||
<el-input v-model="dataForm.fee" placeholder="全年价格"></el-input>
|
<el-input v-model="dataForm.fee" placeholder="全年价格" :disabled='this.dataForm.id'></el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
|
||||||
<el-form-item label="排序" prop="sort">
|
<el-form-item label="排序" prop="sort">
|
||||||
|
|||||||
399
src/views/modules/course/catalogue-price.vue
Normal file
399
src/views/modules/course/catalogue-price.vue
Normal file
@@ -0,0 +1,399 @@
|
|||||||
|
<template>
|
||||||
|
<el-dialog
|
||||||
|
:title="'修改关联商品价格'"
|
||||||
|
:close-on-click-modal="false"
|
||||||
|
:visible.sync="visible"
|
||||||
|
@close="handlereset"
|
||||||
|
>
|
||||||
|
<el-form
|
||||||
|
:model="dataForm"
|
||||||
|
:rules="dataRule"
|
||||||
|
ref="dataForm"
|
||||||
|
label-width="100px"
|
||||||
|
>
|
||||||
|
<el-form-item label="目录名称" prop="title">
|
||||||
|
{{ dataForm.title }}
|
||||||
|
<!-- <el-input
|
||||||
|
v-model=""
|
||||||
|
placeholder="目录名称"
|
||||||
|
disabled
|
||||||
|
></el-input> -->
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
|
<el-row>
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="类型" prop="type">
|
||||||
|
<div v-if="dataForm.type == 0">免费</div>
|
||||||
|
<div v-if="dataForm.type == 1">普通收费</div>
|
||||||
|
<div v-if="dataForm.type == 2">超v课程</div>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
<el-row>
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="目录价格" prop="type">
|
||||||
|
<span
|
||||||
|
>半年:
|
||||||
|
|
||||||
|
<span style="font-weight: bold;margin-right: 20px;">
|
||||||
|
¥{{ dataForm.halfFee }}</span
|
||||||
|
>
|
||||||
|
</span>
|
||||||
|
<span
|
||||||
|
>全年:
|
||||||
|
<span style="font-weight: bold;">
|
||||||
|
¥{{ dataForm.fee }}</span
|
||||||
|
></span
|
||||||
|
>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
<el-row>
|
||||||
|
<el-col :span="24">
|
||||||
|
<el-col :span="6">
|
||||||
|
<el-form-item label="商品原价" prop="halfFee">
|
||||||
|
<span style="color: rgb(255, 91, 54);font-weight: bold;">
|
||||||
|
¥
|
||||||
|
{{ dataForm.yearType == 0 ? dataForm.halfFee : dataForm.fee }}
|
||||||
|
</span>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="修改后价格" prop="halfFee">
|
||||||
|
<el-input
|
||||||
|
v-model="dataForm.currentFee"
|
||||||
|
placeholder="修改价格"
|
||||||
|
></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="4">
|
||||||
|
<div
|
||||||
|
style="height: 40px;display: flex;
|
||||||
|
align-items: center;justify-content: flex-end;"
|
||||||
|
>
|
||||||
|
<el-switch
|
||||||
|
v-model="dataForm.yearType"
|
||||||
|
active-color="#13ce66"
|
||||||
|
:active-value="1"
|
||||||
|
:inactive-value="0"
|
||||||
|
active-text="全年"
|
||||||
|
inactive-text="半年"
|
||||||
|
@change="handleChangeYearType"
|
||||||
|
>
|
||||||
|
</el-switch>
|
||||||
|
</div>
|
||||||
|
</el-col>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
<el-row>
|
||||||
|
<el-col :span="24">
|
||||||
|
<el-form-item label="关联商品" prop="splits">
|
||||||
|
<el-radio-group v-model="dataForm.productId">
|
||||||
|
<el-radio
|
||||||
|
:label="item.productId"
|
||||||
|
border
|
||||||
|
v-for="item in goodsList"
|
||||||
|
style="width: 100%;"
|
||||||
|
>{{ item.productName }}</el-radio
|
||||||
|
>
|
||||||
|
</el-radio-group>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
</el-form>
|
||||||
|
<span slot="footer" class="dialog-footer">
|
||||||
|
<el-button @click="handlereset">取消</el-button>
|
||||||
|
<el-button type="primary" @click="dataFormSubmit()">确定</el-button>
|
||||||
|
</span>
|
||||||
|
</el-dialog>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import global from "../../common/common.vue"; //引入共用组间
|
||||||
|
export default {
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
linkList: [{ label: "半年", value: 0 }, { label: "一年", value: 1 }],
|
||||||
|
baseUrl: global.baseUrl,
|
||||||
|
goodsList: [],
|
||||||
|
currentGoodsList: [],
|
||||||
|
visible: false,
|
||||||
|
typeList: [
|
||||||
|
{
|
||||||
|
//类型0免费1普通收费2超v课程
|
||||||
|
dictType: 0,
|
||||||
|
dictValue: "免费"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
dictType: 1,
|
||||||
|
dictValue: "普通收费"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
dictType: 2,
|
||||||
|
dictValue: "超v课程"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
needCreateList: [
|
||||||
|
{
|
||||||
|
////是否同步创建商品0否1是
|
||||||
|
dictType: 0,
|
||||||
|
dictValue: "否"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
dictType: 1,
|
||||||
|
dictValue: "是"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
medicaldesBookTypeList: [
|
||||||
|
{
|
||||||
|
dictType: 1,
|
||||||
|
dictValue: "中医基础"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
dictType: 2,
|
||||||
|
dictValue: "中医经典"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
dictType: 3,
|
||||||
|
dictValue: "各家学说"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
dictType: 4,
|
||||||
|
dictValue: "中医临床"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
dictType: 5,
|
||||||
|
dictValue: "文学"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
dictType: 6,
|
||||||
|
dictValue: "哲学"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
props: {
|
||||||
|
dictType: "",
|
||||||
|
dictValue: ""
|
||||||
|
},
|
||||||
|
gushuList: [],
|
||||||
|
authorList: [],
|
||||||
|
restaurants: [],
|
||||||
|
author: "",
|
||||||
|
publisherList: [],
|
||||||
|
fileList: [],
|
||||||
|
fileListNovel: [],
|
||||||
|
dialogImageUrl: "",
|
||||||
|
dialogVisible: false,
|
||||||
|
dataForm: {
|
||||||
|
oldFee: 0
|
||||||
|
},
|
||||||
|
splitsTypeList: [],
|
||||||
|
dataRule: {}
|
||||||
|
};
|
||||||
|
},
|
||||||
|
created() {
|
||||||
|
this.getBookList();
|
||||||
|
this.loadAll();
|
||||||
|
},
|
||||||
|
mounted() {
|
||||||
|
// this.restaurants = this.loadAll();
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
handleChangeYearType(e) {
|
||||||
|
this.$forceUpdate()
|
||||||
|
// this.productId = "";
|
||||||
|
console.log("e at line 235:", e);
|
||||||
|
if (e == 0) {
|
||||||
|
|
||||||
|
// this.dataForm.oldFee = this.dataForm.halfFee;
|
||||||
|
this.dataForm.currentFee = this.dataForm.halfFee;
|
||||||
|
} else if (e == 1) {
|
||||||
|
|
||||||
|
// this.dataForm.oldFee = this.dataForm.fee;
|
||||||
|
this.dataForm.currentFee = this.dataForm.fee;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
changeType(e) {
|
||||||
|
console.log("e at line 256:", e);
|
||||||
|
if (e == 0) {
|
||||||
|
this.dataForm.content = "";
|
||||||
|
} else {
|
||||||
|
this.dataForm.url = "";
|
||||||
|
}
|
||||||
|
},
|
||||||
|
init(row, courseid) {
|
||||||
|
console.log("row2", row);
|
||||||
|
this.dataForm = { ...row } || {};
|
||||||
|
this.dataForm.courseId = courseid || "";
|
||||||
|
this.visible = true;
|
||||||
|
this.dataForm.currentFee = this.dataForm.halfFee;
|
||||||
|
this.dataForm.old = this.dataForm.halfFee;
|
||||||
|
this.dataForm.yearType = 0;
|
||||||
|
this.$forceUpdate();
|
||||||
|
if (row.productList && row.productList.length > 0) {
|
||||||
|
this.goodsList = [...row.productList];
|
||||||
|
this.currentGoodsList = this.goodsList.filter(e =>
|
||||||
|
e.productName.includes("半年")
|
||||||
|
);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
// 表单提交
|
||||||
|
dataFormSubmit() {
|
||||||
|
console.log("11111", this.dataForm.medicaldesBookType);
|
||||||
|
// if (this.dataForm.medicaldesBookType.length == 0) {
|
||||||
|
// this.$message.error("请选择图书类型");
|
||||||
|
// return
|
||||||
|
// }
|
||||||
|
this.$refs["dataForm"].validate(valid => {
|
||||||
|
if (valid) {
|
||||||
|
if (!this.dataForm.currentFee) {
|
||||||
|
this.$message.error("请输入价格");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (!this.dataForm.productId) {
|
||||||
|
this.$message.error("请选择关联的商品");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
this.$http({
|
||||||
|
url: this.$http.adornUrl("/master/course/changeCatalogueFee"),
|
||||||
|
method: "post",
|
||||||
|
data: this.$http.adornData({
|
||||||
|
catalogueId: this.dataForm.id,
|
||||||
|
type: this.dataForm.yearType, //0半年1全年
|
||||||
|
fee: this.dataForm.currentFee,
|
||||||
|
productId: this.dataForm.productId
|
||||||
|
|
||||||
|
// courseId: this.dataForm.courseId || undefined,
|
||||||
|
// id: this.dataForm.id || undefined,
|
||||||
|
// title: this.dataForm.title,
|
||||||
|
// type: this.dataForm.type, //类型0免费1普通收费2超v课程
|
||||||
|
// halfFee: this.dataForm.halfFee, //半年价格
|
||||||
|
// fee: this.dataForm.fee, //全年价格
|
||||||
|
// sort: this.dataForm.sort,
|
||||||
|
// needCreate: this.dataForm.needCreate //是否同步创建商品0否1是
|
||||||
|
})
|
||||||
|
}).then(({ data }) => {
|
||||||
|
if (data && data.code === 0) {
|
||||||
|
this.$message({
|
||||||
|
message: "操作成功",
|
||||||
|
type: "success",
|
||||||
|
duration: 1500,
|
||||||
|
onClose: () => {
|
||||||
|
this.visible = false;
|
||||||
|
this.$emit("refreshDataList");
|
||||||
|
}
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
this.$message.error(data.msg);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
handlePicSuccess(res, file) {
|
||||||
|
if (res.msg == "success") {
|
||||||
|
this.dataForm.images = res.url;
|
||||||
|
this.$message.success("上传成功");
|
||||||
|
} else {
|
||||||
|
this.$message.error("上传失败");
|
||||||
|
}
|
||||||
|
},
|
||||||
|
//图书分类
|
||||||
|
getBookList() {
|
||||||
|
this.$http({
|
||||||
|
url: this.$http.adornUrl("/book/sysdictdata/selectByType/book_type"),
|
||||||
|
method: "get"
|
||||||
|
// params: this.$http.adornParams({
|
||||||
|
// 'type': 'book_type',
|
||||||
|
// })
|
||||||
|
}).then(({ data }) => {
|
||||||
|
console.log(data);
|
||||||
|
// this.bookList = data.dataList
|
||||||
|
});
|
||||||
|
|
||||||
|
// 获取图书拆分类型
|
||||||
|
this.$http({
|
||||||
|
url: this.$http.adornUrl("/book/sysdictdata/selectByType/splitsType"),
|
||||||
|
method: "get"
|
||||||
|
}).then(({ data }) => {
|
||||||
|
this.splitsTypeList = data.dataList;
|
||||||
|
});
|
||||||
|
|
||||||
|
// 获取古书
|
||||||
|
this.$http({
|
||||||
|
url: this.$http.adornUrl("/book/book/getAncientBooks"),
|
||||||
|
method: "post"
|
||||||
|
}).then(({ data }) => {
|
||||||
|
this.gushuList = data.books;
|
||||||
|
});
|
||||||
|
},
|
||||||
|
handleRemove(file) {
|
||||||
|
this.dataForm.images = "";
|
||||||
|
},
|
||||||
|
handlePictureCardPreview(file) {
|
||||||
|
this.dataForm.images = file.url;
|
||||||
|
this.dialogVisible = true;
|
||||||
|
},
|
||||||
|
handleDownload(file) {
|
||||||
|
console.log(file);
|
||||||
|
},
|
||||||
|
handlereset() {
|
||||||
|
(this.fileList = []), (this.fileListNovel = []), (this.visible = false);
|
||||||
|
},
|
||||||
|
handlePreview(file) {
|
||||||
|
console.log(file);
|
||||||
|
},
|
||||||
|
handleExceed(files, fileList) {
|
||||||
|
this.$message.warning(
|
||||||
|
`当前限制选择 3 个文件,本次选择了 ${
|
||||||
|
files.length
|
||||||
|
} 个文件,共选择了 ${files.length + fileList.length} 个文件`
|
||||||
|
);
|
||||||
|
},
|
||||||
|
beforeRemove(file, fileList) {
|
||||||
|
return this.$confirm(`确定移除 ${file.name}?`);
|
||||||
|
},
|
||||||
|
handleRemoveNovel(file) {
|
||||||
|
this.dataForm.novel = "";
|
||||||
|
},
|
||||||
|
handleNovelSuccess(file) {
|
||||||
|
this.dataForm.novel = file.url;
|
||||||
|
},
|
||||||
|
// querySearch(queryString, cb) {
|
||||||
|
// var restaurants = this.restaurants;
|
||||||
|
// var results = queryString ? restaurants.filter(this.createFilter(queryString)) : restaurants;
|
||||||
|
// // 调用 callback 返回建议列表的数据
|
||||||
|
// console.log(results)
|
||||||
|
// cb(results);
|
||||||
|
// },
|
||||||
|
// createFilter(queryString) {
|
||||||
|
// return (restaurant) => {
|
||||||
|
// return (restaurant.value.toLowerCase().indexOf(queryString.toLowerCase()) === 0);
|
||||||
|
// };
|
||||||
|
// },
|
||||||
|
loadAll() {
|
||||||
|
this.$http({
|
||||||
|
url: this.$http.adornUrl("/book/author/bookAuthorList"),
|
||||||
|
method: "get"
|
||||||
|
}).then(({ data }) => {
|
||||||
|
this.authorList = data.list;
|
||||||
|
});
|
||||||
|
this.$http({
|
||||||
|
url: this.$http.adornUrl("/book/publisher/publisherList"),
|
||||||
|
method: "get"
|
||||||
|
}).then(({ data }) => {
|
||||||
|
this.publisherList = data.list;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
// handleSelect(item) {
|
||||||
|
// this.dataForm.authorId = item.id
|
||||||
|
// console.log(item);
|
||||||
|
// }
|
||||||
|
}
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
<style lang="less" scoped>
|
||||||
|
/deep/.el-radio.is-bordered + .el-radio.is-bordered {
|
||||||
|
margin-left: 0 !important;
|
||||||
|
margin-top: 10px !important;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
@@ -1,32 +1,133 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="mod-config">
|
<div class="mod-config">
|
||||||
<el-form :inline="true" :model="dataForm" @keyup.enter.native="getDataList()">
|
<el-form
|
||||||
|
:inline="true"
|
||||||
|
:model="dataForm"
|
||||||
|
@keyup.enter.native="getDataList()"
|
||||||
|
>
|
||||||
<!-- <el-form-item label="课程目录名称">
|
<!-- <el-form-item label="课程目录名称">
|
||||||
<el-input v-model="query.keywords" placeholder="课程目录名称" clearable></el-input>
|
<el-input v-model="query.keywords" placeholder="课程目录名称" clearable></el-input>
|
||||||
</el-form-item> -->
|
</el-form-item> -->
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-button @click="pageIndex = 1;getDataList()">查询</el-button>
|
<el-button
|
||||||
|
@click="
|
||||||
|
pageIndex = 1;
|
||||||
|
getDataList();
|
||||||
|
"
|
||||||
|
>查询</el-button
|
||||||
|
>
|
||||||
<el-button type="primary" @click="addOrUpdateHandle()">新增</el-button>
|
<el-button type="primary" @click="addOrUpdateHandle()">新增</el-button>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
<el-table :data="dataList" border v-loading="dataListLoading"
|
<el-table
|
||||||
style="width: 100%;">
|
:data="dataList"
|
||||||
<el-table-column prop="title" header-align="center" align="center" label="目录名称">
|
border
|
||||||
|
v-loading="dataListLoading"
|
||||||
|
style="width: 100%;"
|
||||||
|
>
|
||||||
|
<el-table-column
|
||||||
|
prop="title"
|
||||||
|
header-align="center"
|
||||||
|
align="center"
|
||||||
|
label="目录名称"
|
||||||
|
>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
|
<el-table-column
|
||||||
<el-table-column prop="createTime" header-align="center" align="center" label="创建日期">
|
prop="sort"
|
||||||
</el-table-column>
|
header-align="center"
|
||||||
|
align="center"
|
||||||
<el-table-column fixed="right" header-align="center" align="center" width="250" label="操作">
|
label="收费类型"
|
||||||
|
width="100"
|
||||||
|
>
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
|
<div v-if="scope.row.type == 0">免费</div>
|
||||||
<div>
|
<div v-if="scope.row.type == 1">普通收费</div>
|
||||||
<router-link :to="{path: 'course-courseChapter' , query:{ id : scope.row.id ,courseid: courseid, pageIndex} }">
|
<div v-if="scope.row.type == 2">超v课程</div>
|
||||||
<el-button type="text" size="small">章节管理</el-button>
|
</template>
|
||||||
</router-link>
|
</el-table-column>
|
||||||
<el-button type="text" size="small" @click="addOrUpdateHandle(scope.row)">修改</el-button>
|
<el-table-column
|
||||||
<el-button type="text" size="small" @click="deleteHandle(scope.row.id)">删除</el-button>
|
prop="sort"
|
||||||
</div>
|
header-align="center"
|
||||||
|
align="center"
|
||||||
|
label="价格(半年/一年)"
|
||||||
|
width="160"
|
||||||
|
>
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<div>{{ scope.row.halfFee }} / {{ scope.row.fee }}</div>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column
|
||||||
|
prop="sort"
|
||||||
|
header-align="center"
|
||||||
|
align="center"
|
||||||
|
label="关联商品"
|
||||||
|
width="500"
|
||||||
|
>
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<div v-for="(item,i) in scope.row.productList">
|
||||||
|
{{ item.productName }}
|
||||||
|
<span style="color: #ff5b36;">¥{{ item.activePrice?item.activePrice:item.price }}</span>
|
||||||
|
<span style="color: #9c9a9b;text-decoration:line-through;" v-if="item.activePrice>0">¥{{item.price }}</span>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
|
||||||
|
|
||||||
|
<el-table-column
|
||||||
|
prop="sort"
|
||||||
|
header-align="center"
|
||||||
|
align="center"
|
||||||
|
label="排序"
|
||||||
|
width="80"
|
||||||
|
>
|
||||||
|
</el-table-column>
|
||||||
|
|
||||||
|
|
||||||
|
<!-- <el-table-column
|
||||||
|
prop="createTime"
|
||||||
|
header-align="center"
|
||||||
|
align="center"
|
||||||
|
label="创建日期"
|
||||||
|
width="160"
|
||||||
|
>
|
||||||
|
</el-table-column> -->
|
||||||
|
|
||||||
|
<el-table-column
|
||||||
|
fixed="right"
|
||||||
|
header-align="center"
|
||||||
|
align="center"
|
||||||
|
width="220"
|
||||||
|
label="操作"
|
||||||
|
>
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<div>
|
||||||
|
<router-link
|
||||||
|
:to="{
|
||||||
|
path: 'course-courseChapter',
|
||||||
|
query: { id: scope.row.id, courseid: courseid, pageIndex }
|
||||||
|
}"
|
||||||
|
>
|
||||||
|
<el-button type="text" size="small">章节管理</el-button>
|
||||||
|
</router-link>
|
||||||
|
<el-button
|
||||||
|
type="text"
|
||||||
|
size="small"
|
||||||
|
@click="addOrUpdateHandle(scope.row)"
|
||||||
|
>修改</el-button
|
||||||
|
>
|
||||||
|
<el-button
|
||||||
|
type="text"
|
||||||
|
size="small"
|
||||||
|
@click="priceHandle(scope.row)"
|
||||||
|
>修改价格</el-button
|
||||||
|
>
|
||||||
|
<el-button
|
||||||
|
type="text"
|
||||||
|
size="small"
|
||||||
|
@click="deleteHandle(scope.row.id)"
|
||||||
|
>删除</el-button
|
||||||
|
>
|
||||||
|
</div>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
@@ -35,23 +136,33 @@
|
|||||||
style="padding: 30px 0; text-align: center;" layout="total, sizes, prev, pager, next, jumper">
|
style="padding: 30px 0; text-align: center;" layout="total, sizes, prev, pager, next, jumper">
|
||||||
</el-pagination> -->
|
</el-pagination> -->
|
||||||
<!-- 弹窗, 新增 / 修改 -->
|
<!-- 弹窗, 新增 / 修改 -->
|
||||||
<add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList"></add-or-update>
|
<add-or-update
|
||||||
|
v-if="addOrUpdateVisible"
|
||||||
|
ref="addOrUpdate"
|
||||||
|
@refreshDataList="getDataList"
|
||||||
|
></add-or-update>
|
||||||
|
<price
|
||||||
|
v-if="priceVisible"
|
||||||
|
ref="priceUpdate"
|
||||||
|
@refreshDataList="getDataList"
|
||||||
|
></price>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import AddOrUpdate from './catalogue-add-or-update'
|
import AddOrUpdate from "./catalogue-add-or-update";
|
||||||
|
import price from "./catalogue-price";
|
||||||
export default {
|
export default {
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
dataForm: {
|
dataForm: {
|
||||||
key: ''
|
key: ""
|
||||||
},
|
},
|
||||||
query:{
|
query: {
|
||||||
type:'',
|
type: "",
|
||||||
categoryId:'',
|
categoryId: "",
|
||||||
sociologyId:'',
|
sociologyId: "",
|
||||||
keywords:''
|
keywords: ""
|
||||||
},
|
},
|
||||||
dataList: [],
|
dataList: [],
|
||||||
delFlag: false,
|
delFlag: false,
|
||||||
@@ -60,101 +171,113 @@ export default {
|
|||||||
totalPage: 0,
|
totalPage: 0,
|
||||||
dataListLoading: false,
|
dataListLoading: false,
|
||||||
dataListSelections: [],
|
dataListSelections: [],
|
||||||
addOrUpdateVisible: false
|
addOrUpdateVisible: false,
|
||||||
}
|
priceVisible: false
|
||||||
|
};
|
||||||
},
|
},
|
||||||
components: {
|
components: {
|
||||||
AddOrUpdate
|
AddOrUpdate,price
|
||||||
},
|
},
|
||||||
activated() {
|
activated() {
|
||||||
this.courseid = this.$route.query.id;
|
this.courseid = this.$route.query.id;
|
||||||
if(this.$route.query.upPageInde != null){
|
if (this.$route.query.upPageInde != null) {
|
||||||
this.pageIndex = this.$route.query.upPageIndex;
|
this.pageIndex = this.$route.query.upPageIndex;
|
||||||
console.log(this.pageIndex)
|
console.log(this.pageIndex);
|
||||||
}
|
}
|
||||||
this.getDataList()
|
this.getDataList();
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
// 获取数据列表
|
// 获取数据列表
|
||||||
getDataList() {
|
getDataList() {
|
||||||
this.dataListLoading = true
|
this.dataListLoading = true;
|
||||||
this.$http({
|
this.$http({
|
||||||
url: this.$http.adornUrl('/master/course/getCourseCatalogues'),
|
url: this.$http.adornUrl("/master/course/getCourseCatalogues"),
|
||||||
method: 'post',
|
method: "post",
|
||||||
data: this.$http.adornData({
|
data: this.$http.adornData({
|
||||||
'id': this.courseid,
|
id: this.courseid
|
||||||
// 'page': this.pageIndex,
|
// 'page': this.pageIndex,
|
||||||
// 'limit': this.pageSize,
|
// 'limit': this.pageSize,
|
||||||
// "type": this.query.type||0, //类型0全部,1:医学,2:国学
|
// "type": this.query.type||0, //类型0全部,1:医学,2:国学
|
||||||
// "categoryId": this.query.categoryId, //医学类型id,当type为1时为必填项;为0时代表全部
|
// "categoryId": this.query.categoryId, //医学类型id,当type为1时为必填项;为0时代表全部
|
||||||
// "sociologyId": this.query.sociologyId, //国学类型id,当type为2时为必填项;为0代表全部
|
// "sociologyId": this.query.sociologyId, //国学类型id,当type为2时为必填项;为0代表全部
|
||||||
// "keywords": this.query.keywords //关键字
|
// "keywords": this.query.keywords //关键字
|
||||||
})
|
})
|
||||||
}).then(({ data }) => {
|
}).then(({ data }) => {
|
||||||
if (data && data.code === 0) {
|
if (data && data.code === 0) {
|
||||||
this.dataList = data.catalogues
|
this.dataList = data.catalogues;
|
||||||
// this.totalPage = data.page.total
|
// this.totalPage = data.page.total
|
||||||
} else {
|
} else {
|
||||||
this.dataList = []
|
this.dataList = [];
|
||||||
// this.totalPage = 0
|
// this.totalPage = 0
|
||||||
}
|
}
|
||||||
this.dataListLoading = false
|
this.dataListLoading = false;
|
||||||
})
|
});
|
||||||
},
|
},
|
||||||
// 每页数
|
// 每页数
|
||||||
sizeChangeHandle(val) {
|
sizeChangeHandle(val) {
|
||||||
this.pageSize = val
|
this.pageSize = val;
|
||||||
this.pageIndex = 1
|
this.pageIndex = 1;
|
||||||
this.getDataList()
|
this.getDataList();
|
||||||
},
|
},
|
||||||
// 当前页
|
// 当前页
|
||||||
currentChangeHandle(val) {
|
currentChangeHandle(val) {
|
||||||
this.pageIndex = val
|
this.pageIndex = val;
|
||||||
this.getDataList()
|
this.getDataList();
|
||||||
},
|
},
|
||||||
// 多选
|
// 多选
|
||||||
selectionChangeHandle(val) {
|
selectionChangeHandle(val) {
|
||||||
this.dataListSelections = val
|
this.dataListSelections = val;
|
||||||
},
|
},
|
||||||
// 新增 / 修改
|
// 新增 / 修改
|
||||||
addOrUpdateHandle(row) {
|
addOrUpdateHandle(row) {
|
||||||
console.log('row1', row)
|
console.log("row1", row);
|
||||||
this.addOrUpdateVisible = true
|
this.addOrUpdateVisible = true;
|
||||||
this.$nextTick(() => {
|
this.$nextTick(() => {
|
||||||
this.$refs.addOrUpdate.init(row, this.courseid)
|
this.$refs.addOrUpdate.init(row, this.courseid);
|
||||||
})
|
});
|
||||||
|
},
|
||||||
|
priceHandle(row) {
|
||||||
|
console.log("row1", row);
|
||||||
|
this.priceVisible = true;
|
||||||
|
this.$nextTick(() => {
|
||||||
|
this.$refs.priceUpdate.init(row, this.courseid);
|
||||||
|
});
|
||||||
},
|
},
|
||||||
// 删除
|
// 删除
|
||||||
deleteHandle(id) {
|
deleteHandle(id) {
|
||||||
// var ids = id ? [id] : this.dataListSelections.map(item => {
|
// var ids = id ? [id] : this.dataListSelections.map(item => {
|
||||||
// return item.id
|
// return item.id
|
||||||
// })
|
// })
|
||||||
this.$confirm(`确定对[id=${id}]进行[${id ? '删除' : '批量删除'}]操作?`, '提示', {
|
this.$confirm(
|
||||||
confirmButtonText: '确定',
|
`确定对[id=${id}]进行[${id ? "删除" : "批量删除"}]操作?`,
|
||||||
cancelButtonText: '取消',
|
"提示",
|
||||||
type: 'warning'
|
{
|
||||||
}).then(() => {
|
confirmButtonText: "确定",
|
||||||
|
cancelButtonText: "取消",
|
||||||
|
type: "warning"
|
||||||
|
}
|
||||||
|
).then(() => {
|
||||||
this.$http({
|
this.$http({
|
||||||
url: this.$http.adornUrl('/master/course/delCourseCatalogue'),
|
url: this.$http.adornUrl("/master/course/delCourseCatalogue"),
|
||||||
method: 'post',
|
method: "post",
|
||||||
data: this.$http.adornData({
|
data: this.$http.adornData({
|
||||||
'id': id
|
id: id
|
||||||
})
|
})
|
||||||
}).then(({ data }) => {
|
}).then(({ data }) => {
|
||||||
if (data && data.code === 0) {
|
if (data && data.code === 0) {
|
||||||
this.$message({
|
this.$message({
|
||||||
message: '操作成功',
|
message: "操作成功",
|
||||||
type: 'success',
|
type: "success",
|
||||||
duration: 1500,
|
duration: 1500,
|
||||||
onClose: () => {
|
onClose: () => {
|
||||||
this.getDataList()
|
this.getDataList();
|
||||||
}
|
}
|
||||||
})
|
});
|
||||||
} else {
|
} else {
|
||||||
this.$message.error(data.msg)
|
this.$message.error(data.msg);
|
||||||
}
|
}
|
||||||
})
|
});
|
||||||
})
|
});
|
||||||
},
|
},
|
||||||
// 开关变化
|
// 开关变化
|
||||||
SwitchChange(event) {
|
SwitchChange(event) {
|
||||||
@@ -162,81 +285,83 @@ export default {
|
|||||||
var parms = {
|
var parms = {
|
||||||
delFlag: event.delFlag,
|
delFlag: event.delFlag,
|
||||||
id: event.id
|
id: event.id
|
||||||
}
|
};
|
||||||
this.$http({
|
this.$http({
|
||||||
url: this.$http.adornUrl('/book/book/update'),
|
url: this.$http.adornUrl("/book/book/update"),
|
||||||
method: 'post',
|
method: "post",
|
||||||
data: parms
|
data: parms
|
||||||
}).then(res => {
|
|
||||||
this.$message({
|
|
||||||
message: '成功',
|
|
||||||
type: 'success'
|
|
||||||
})
|
|
||||||
this.loading = false
|
|
||||||
this.getDataList()
|
|
||||||
}).catch(error => {
|
|
||||||
this.loading = false
|
|
||||||
console.log(error)
|
|
||||||
})
|
})
|
||||||
console.log(event)
|
.then(res => {
|
||||||
|
this.$message({
|
||||||
|
message: "成功",
|
||||||
|
type: "success"
|
||||||
|
});
|
||||||
|
this.loading = false;
|
||||||
|
this.getDataList();
|
||||||
|
})
|
||||||
|
.catch(error => {
|
||||||
|
this.loading = false;
|
||||||
|
console.log(error);
|
||||||
|
});
|
||||||
|
console.log(event);
|
||||||
},
|
},
|
||||||
chapterHandle(id, row) {
|
chapterHandle(id, row) {
|
||||||
if (row.novel == '') {
|
if (row.novel == "") {
|
||||||
this.$alert('请上传电子书文件后在进行此操作', '提示', {
|
this.$alert("请上传电子书文件后在进行此操作", "提示", {
|
||||||
confirmButtonText: '好的',
|
confirmButtonText: "好的"
|
||||||
});
|
});
|
||||||
return false
|
return false;
|
||||||
}
|
}
|
||||||
this.$http({
|
this.$http({
|
||||||
url: this.$http.adornUrl('/book/book/getChapter'),
|
url: this.$http.adornUrl("/book/book/getChapter"),
|
||||||
method: 'get',
|
method: "get",
|
||||||
params: this.$http.adornParams({
|
params: this.$http.adornParams({
|
||||||
'id':id
|
id: id
|
||||||
})
|
|
||||||
}).then(res => {
|
|
||||||
this.$message({
|
|
||||||
message: '成功',
|
|
||||||
type: 'success'
|
|
||||||
})
|
})
|
||||||
this.loading = false
|
}).then(res => {
|
||||||
this.getDataList()
|
this.$message({
|
||||||
})
|
message: "成功",
|
||||||
|
type: "success"
|
||||||
|
});
|
||||||
|
this.loading = false;
|
||||||
|
this.getDataList();
|
||||||
|
});
|
||||||
},
|
},
|
||||||
contentHandle(id){
|
contentHandle(id) {
|
||||||
this.$http({
|
this.$http({
|
||||||
url: this.$http.adornUrl('/book/bookchaptercontent/getBookVoices'),
|
url: this.$http.adornUrl("/book/bookchaptercontent/getBookVoices"),
|
||||||
method: 'get',
|
method: "get",
|
||||||
params: this.$http.adornParams({
|
params: this.$http.adornParams({
|
||||||
'id':id
|
id: id
|
||||||
})
|
|
||||||
}).then(res => {
|
|
||||||
this.$message({
|
|
||||||
message: '成功',
|
|
||||||
type: 'success'
|
|
||||||
})
|
})
|
||||||
this.loading = false
|
}).then(res => {
|
||||||
this.getDataList()
|
this.$message({
|
||||||
})
|
message: "成功",
|
||||||
|
type: "success"
|
||||||
|
});
|
||||||
|
this.loading = false;
|
||||||
|
this.getDataList();
|
||||||
|
});
|
||||||
},
|
},
|
||||||
voicesHandle(id){
|
voicesHandle(id) {
|
||||||
//allVoices
|
//allVoices
|
||||||
this.$http({
|
this.$http({
|
||||||
// url: this.$http.adornUrl('/book/bookchaptercontent/allVoices'),
|
// url: this.$http.adornUrl('/book/bookchaptercontent/allVoices'),
|
||||||
url: this.$http.adornUrl('/book/bookchaptercontent/AllVOices'),
|
url: this.$http.adornUrl("/book/bookchaptercontent/AllVOices"),
|
||||||
method: 'get',
|
method: "get",
|
||||||
params: this.$http.adornParams({
|
params: this.$http.adornParams({
|
||||||
'id':id
|
id: id
|
||||||
})
|
|
||||||
}).then(res => {
|
|
||||||
console.log('book/bookchaptercontent/AllVOices')
|
|
||||||
this.$message({
|
|
||||||
message: '成功',
|
|
||||||
type: 'success'
|
|
||||||
})
|
})
|
||||||
this.loading = false
|
}).then(res => {
|
||||||
this.getDataList()
|
console.log("book/bookchaptercontent/AllVOices");
|
||||||
})
|
this.$message({
|
||||||
|
message: "成功",
|
||||||
|
type: "success"
|
||||||
|
});
|
||||||
|
this.loading = false;
|
||||||
|
this.getDataList();
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -13,7 +13,8 @@
|
|||||||
></el-input>
|
></el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="平台分类">
|
<el-form-item label="平台分类">
|
||||||
<el-cascader clearable
|
<el-cascader
|
||||||
|
clearable
|
||||||
:props="{
|
:props="{
|
||||||
label: 'title',
|
label: 'title',
|
||||||
value: 'id',
|
value: 'id',
|
||||||
@@ -138,24 +139,80 @@
|
|||||||
label="层级">
|
label="层级">
|
||||||
</el-table-column> -->
|
</el-table-column> -->
|
||||||
|
|
||||||
<el-table-column label="课程图" header-align="center" align="center">
|
<el-table-column
|
||||||
|
label="课程图"
|
||||||
|
header-align="center"
|
||||||
|
align="center"
|
||||||
|
width="100"
|
||||||
|
>
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<div
|
<div
|
||||||
v-if="scope.row.image"
|
v-if="scope.row.image"
|
||||||
style="width:100%;display: flex;
|
style="width:100%;display: flex;
|
||||||
align-items: center;justify-content: center;"
|
align-items: center;justify-content: center;"
|
||||||
>
|
>
|
||||||
<img :src="scope.row.image" alt="" width="80px" height="80px" />
|
<img :src="scope.row.image" alt="" width="40px" height="40px" />
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column
|
<el-table-column
|
||||||
|
prop="sort"
|
||||||
|
header-align="center"
|
||||||
|
align="center"
|
||||||
|
label="关联商品"
|
||||||
|
width="600"
|
||||||
|
>
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<div v-for="(v, i) in scope.row.courseCatalogueEntityList" :style="`overflow: hidden;display: flex;
|
||||||
|
align-items: center;border-bottom: 3px solid #17B3A3;padding:10px 0;${i==scope.row.courseCatalogueEntityList.length-1?'border:none;':''}`">
|
||||||
|
<div
|
||||||
|
style="width: 90px;float: left;font-weight: 800;"
|
||||||
|
v-if="scope.row.courseCatalogueEntityList.length > 1"
|
||||||
|
>
|
||||||
|
{{ v.title }}
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div
|
||||||
|
class="right"
|
||||||
|
:style="
|
||||||
|
`width: calc(100% - ${
|
||||||
|
scope.row.courseCatalogueEntityList.length > 1 ? 100 : 0
|
||||||
|
}px);float: right;`
|
||||||
|
"
|
||||||
|
>
|
||||||
|
<div v-for="(item, i) in v.productList">
|
||||||
|
{{ item.productName }}
|
||||||
|
<span style="color: #ff5b36;"
|
||||||
|
>¥{{
|
||||||
|
item.activePrice ? item.activePrice : item.price
|
||||||
|
}}</span
|
||||||
|
>
|
||||||
|
<span
|
||||||
|
style="color: #9c9a9b;text-decoration:line-through;"
|
||||||
|
v-if="item.activePrice > 0"
|
||||||
|
>¥{{ item.price }}</span
|
||||||
|
>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column
|
||||||
|
prop="sort"
|
||||||
|
width="80"
|
||||||
|
header-align="center"
|
||||||
|
align="center"
|
||||||
|
label="排序"
|
||||||
|
>
|
||||||
|
</el-table-column>
|
||||||
|
<!-- <el-table-column
|
||||||
prop="createTime"
|
prop="createTime"
|
||||||
header-align="center"
|
header-align="center"
|
||||||
align="center"
|
align="center"
|
||||||
|
width="160"
|
||||||
label="创建日期"
|
label="创建日期"
|
||||||
>
|
>
|
||||||
</el-table-column>
|
</el-table-column> -->
|
||||||
<!-- <el-table-column prop="updateTime" header-align="center" align="center" label="更新日期">
|
<!-- <el-table-column prop="updateTime" header-align="center" align="center" label="更新日期">
|
||||||
</el-table-column> -->
|
</el-table-column> -->
|
||||||
<!-- <el-table-column
|
<!-- <el-table-column
|
||||||
@@ -174,7 +231,7 @@
|
|||||||
fixed="right"
|
fixed="right"
|
||||||
header-align="center"
|
header-align="center"
|
||||||
align="center"
|
align="center"
|
||||||
width="250"
|
width="160"
|
||||||
label="操作"
|
label="操作"
|
||||||
>
|
>
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
@@ -266,7 +323,7 @@ export default {
|
|||||||
selectType: [],
|
selectType: [],
|
||||||
options: [
|
options: [
|
||||||
{
|
{
|
||||||
id: 'all',
|
id: "all",
|
||||||
title: "全部",
|
title: "全部",
|
||||||
children: undefined
|
children: undefined
|
||||||
},
|
},
|
||||||
@@ -357,12 +414,10 @@ export default {
|
|||||||
data.medicalId = "";
|
data.medicalId = "";
|
||||||
data.sociologyId = "";
|
data.sociologyId = "";
|
||||||
} else if (this.selectType.length >= 1) {
|
} else if (this.selectType.length >= 1) {
|
||||||
data.type = this.selectType[0]=='all'?0:this.selectType[0];
|
data.type = this.selectType[0] == "all" ? 0 : this.selectType[0];
|
||||||
if (this.selectType.length == 1) {
|
if (this.selectType.length == 1) {
|
||||||
|
|
||||||
data.medicalId = "";
|
data.medicalId = "";
|
||||||
data.sociologyId = "";
|
data.sociologyId = "";
|
||||||
|
|
||||||
}
|
}
|
||||||
if (this.selectType.length > 1) {
|
if (this.selectType.length > 1) {
|
||||||
if (this.selectType[0] == 1) {
|
if (this.selectType[0] == 1) {
|
||||||
|
|||||||
@@ -8,8 +8,9 @@
|
|||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-button @click="pageIndex = 1;getDataList()">查询</el-button>
|
<el-button @click="pageIndex = 1;getDataList()">查询</el-button>
|
||||||
<el-button v-if="isAuth('book:user:save')" type="primary" @click="addOrUpdateHandle()">新增</el-button>
|
<el-button v-if="isAuth('book:user:save')" type="primary" @click="addOrUpdateHandle()">新增</el-button>
|
||||||
<el-button v-if="isAuth('book:user:delete')" type="danger" @click="deleteHandle()"
|
<el-button type="primary" @click="addOrUpdateHandle()">合并账号</el-button>
|
||||||
:disabled="dataListSelections.length <= 0">批量删除</el-button>
|
<!-- <el-button v-if="isAuth('book:user:delete')" type="danger" @click="deleteHandle()"
|
||||||
|
:disabled="dataListSelections.length <= 0">批量删除</el-button> -->
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
<el-table :data="dataList" border v-loading="dataListLoading" @selection-change="selectionChangeHandle"
|
<el-table :data="dataList" border v-loading="dataListLoading" @selection-change="selectionChangeHandle"
|
||||||
|
|||||||
Reference in New Issue
Block a user