课程价格
This commit is contained in:
@@ -92,7 +92,8 @@
|
||||
<el-radio
|
||||
:label="item.productId"
|
||||
border
|
||||
v-for="item in goodsList"
|
||||
v-for="(item,i) in goodsList"
|
||||
:key="i"
|
||||
style="width: 100%;"
|
||||
>{{ item.productName }}</el-radio
|
||||
>
|
||||
@@ -205,11 +206,11 @@ export default {
|
||||
if (e == 0) {
|
||||
|
||||
// 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) {
|
||||
|
||||
// this.dataForm.oldFee = this.dataForm.fee;
|
||||
this.dataForm.currentFee = this.dataForm.fee;
|
||||
// this.dataForm.currentFee = JSON.parse(JSON.stringify(this.dataForm.fee));
|
||||
}
|
||||
},
|
||||
changeType(e) {
|
||||
@@ -225,15 +226,15 @@ export default {
|
||||
this.dataForm = { ...row } || {};
|
||||
this.dataForm.courseId = courseid || "";
|
||||
this.visible = true;
|
||||
this.dataForm.currentFee = this.dataForm.halfFee;
|
||||
this.dataForm.old = this.dataForm.halfFee;
|
||||
// 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("半年")
|
||||
);
|
||||
// this.currentGoodsList = this.goodsList.filter(e =>
|
||||
// e.productName.includes("半年")
|
||||
// );
|
||||
}
|
||||
},
|
||||
// 表单提交
|
||||
|
||||
@@ -64,15 +64,20 @@
|
||||
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 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"
|
||||
@@ -82,7 +87,6 @@
|
||||
>
|
||||
</el-table-column>
|
||||
|
||||
|
||||
<!-- <el-table-column
|
||||
prop="createTime"
|
||||
header-align="center"
|
||||
@@ -115,18 +119,31 @@
|
||||
@click="addOrUpdateHandle(scope.row)"
|
||||
>修改</el-button
|
||||
>
|
||||
|
||||
<el-button
|
||||
type="text"
|
||||
size="small"
|
||||
@click="priceHandle(scope.row)"
|
||||
>修改价格</el-button
|
||||
>
|
||||
<el-button
|
||||
style="color:red"
|
||||
type="text"
|
||||
size="small"
|
||||
@click="deleteHandle(scope.row.id)"
|
||||
>删除</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>
|
||||
</template>
|
||||
</el-table-column>
|
||||
@@ -172,11 +189,15 @@ export default {
|
||||
dataListLoading: false,
|
||||
dataListSelections: [],
|
||||
addOrUpdateVisible: false,
|
||||
priceVisible: false
|
||||
priceVisible: false,
|
||||
urlList: {
|
||||
createProduct: "/master/course/createProductForCatalogue"
|
||||
}
|
||||
};
|
||||
},
|
||||
components: {
|
||||
AddOrUpdate,price
|
||||
AddOrUpdate,
|
||||
price
|
||||
},
|
||||
activated() {
|
||||
this.courseid = this.$route.query.id;
|
||||
@@ -236,6 +257,31 @@ export default {
|
||||
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) {
|
||||
console.log("row1", row);
|
||||
this.priceVisible = true;
|
||||
|
||||
Reference in New Issue
Block a user