课程价格

This commit is contained in:
2024-05-31 13:51:17 +08:00
parent 35aa7e3666
commit edfd9f6edf
2 changed files with 69 additions and 22 deletions

View File

@@ -92,7 +92,8 @@
<el-radio <el-radio
:label="item.productId" :label="item.productId"
border border
v-for="item in goodsList" v-for="(item,i) in goodsList"
:key="i"
style="width: 100%;" style="width: 100%;"
>{{ item.productName }}</el-radio >{{ item.productName }}</el-radio
> >
@@ -205,11 +206,11 @@ export default {
if (e == 0) { if (e == 0) {
// this.dataForm.oldFee = this.dataForm.halfFee; // this.dataForm.oldFee = this.dataForm.halfFee;
this.dataForm.currentFee = this.dataForm.halfFee; // this.dataForm.currentFee = JSON.parse(JSON.stringify(this.dataForm.halfFee));
} else if (e == 1) { } else if (e == 1) {
// this.dataForm.oldFee = this.dataForm.fee; // this.dataForm.oldFee = this.dataForm.fee;
this.dataForm.currentFee = this.dataForm.fee; // this.dataForm.currentFee = JSON.parse(JSON.stringify(this.dataForm.fee));
} }
}, },
changeType(e) { changeType(e) {
@@ -225,15 +226,15 @@ export default {
this.dataForm = { ...row } || {}; this.dataForm = { ...row } || {};
this.dataForm.courseId = courseid || ""; this.dataForm.courseId = courseid || "";
this.visible = true; this.visible = true;
this.dataForm.currentFee = this.dataForm.halfFee; // this.dataForm.currentFee = this.dataForm.halfFee;
this.dataForm.old = this.dataForm.halfFee; // this.dataForm.old = this.dataForm.halfFee;
this.dataForm.yearType = 0; this.dataForm.yearType = 0;
this.$forceUpdate(); this.$forceUpdate();
if (row.productList && row.productList.length > 0) { if (row.productList && row.productList.length > 0) {
this.goodsList = [...row.productList]; this.goodsList = [...row.productList];
this.currentGoodsList = this.goodsList.filter(e => // this.currentGoodsList = this.goodsList.filter(e =>
e.productName.includes("半年") // e.productName.includes("半年")
); // );
} }
}, },
// 表单提交 // 表单提交

View File

@@ -64,15 +64,20 @@
width="500" width="500"
> >
<template slot-scope="scope"> <template slot-scope="scope">
<div v-for="(item,i) in scope.row.productList"> <div v-for="(item, i) in scope.row.productList">
{{ item.productName }} {{ item.productName }}
<span style="color: #ff5b36;">{{ item.activePrice?item.activePrice:item.price }}</span> <span style="color: #ff5b36;"
<span style="color: #9c9a9b;text-decoration:line-through;" v-if="item.activePrice>0">{{item.price }}</span> >{{ 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>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column <el-table-column
prop="sort" prop="sort"
header-align="center" header-align="center"
@@ -82,7 +87,6 @@
> >
</el-table-column> </el-table-column>
<!-- <el-table-column <!-- <el-table-column
prop="createTime" prop="createTime"
header-align="center" header-align="center"
@@ -115,18 +119,31 @@
@click="addOrUpdateHandle(scope.row)" @click="addOrUpdateHandle(scope.row)"
>修改</el-button >修改</el-button
> >
<el-button <el-button
type="text" style="color:red"
size="small"
@click="priceHandle(scope.row)"
>修改价格</el-button
>
<el-button
type="text" type="text"
size="small" size="small"
@click="deleteHandle(scope.row.id)" @click="deleteHandle(scope.row.id)"
>删除</el-button >删除</el-button
> >
<el-dropdown>
<el-button type="text" size="small"
>更多操作<i class="el-icon-arrow-down el-icon--right"></i
></el-button>
<!-- <span type="primary" size="mini" class="el-dropdown-link">
更多操作<i class="el-icon-arrow-down el-icon--right"></i>
</span> -->
<el-dropdown-menu slot="dropdown">
<el-dropdown-item @click.native="priceHandle(scope.row)"
>修改价格</el-dropdown-item
>
<el-dropdown-item
@click.native="handleCreateProduct(scope.row.id)"
>创建商品</el-dropdown-item
>
</el-dropdown-menu>
</el-dropdown>
</div> </div>
</template> </template>
</el-table-column> </el-table-column>
@@ -172,11 +189,15 @@ export default {
dataListLoading: false, dataListLoading: false,
dataListSelections: [], dataListSelections: [],
addOrUpdateVisible: false, addOrUpdateVisible: false,
priceVisible: false priceVisible: false,
urlList: {
createProduct: "/master/course/createProductForCatalogue"
}
}; };
}, },
components: { components: {
AddOrUpdate,price AddOrUpdate,
price
}, },
activated() { activated() {
this.courseid = this.$route.query.id; this.courseid = this.$route.query.id;
@@ -236,6 +257,31 @@ export default {
this.$refs.addOrUpdate.init(row, this.courseid); this.$refs.addOrUpdate.init(row, this.courseid);
}); });
}, },
handleCreateProduct(id) {
console.log('id at line 260:', id)
this.$http
.request({
url: this.$http.adornUrl(`${this.urlList.createProduct}`),
method: "POST",
data: {
id: id
},
header: {
//默认 无 说明:请求头
"Content-Type": "application/json"
}
})
.then(res => {
console.log("result at line 452:", res);
if (res && res.data.code === 0) {
this.$message.success(res.data.msg);
this.getDataList();
} else {
this.$message.error(res.data.msg);
}
});
},
priceHandle(row) { priceHandle(row) {
console.log("row1", row); console.log("row1", row);
this.priceVisible = true; this.priceVisible = true;