|
@@ -27,11 +27,11 @@
|
|
<el-table-column label="课程" prop="courseName" align="center" />
|
|
<el-table-column label="课程" prop="courseName" align="center" />
|
|
<el-table-column label="小节" prop="videoName" align="center" />
|
|
<el-table-column label="小节" prop="videoName" align="center" />
|
|
<el-table-column label="营期日期" prop="dayDate" align="center"/>
|
|
<el-table-column label="营期日期" prop="dayDate" align="center"/>
|
|
- <el-table-column label="红包金额(0.1-0.3元)" width="200px" align="center">
|
|
|
|
|
|
+ <el-table-column label="红包金额(0.0-0.3元)" width="200px" align="center">
|
|
<template slot-scope="scope">
|
|
<template slot-scope="scope">
|
|
<el-input-number
|
|
<el-input-number
|
|
v-model="scope.row.amount"
|
|
v-model="scope.row.amount"
|
|
- :min="0.1"
|
|
|
|
|
|
+ :min="0.0"
|
|
:max="0.3"
|
|
:max="0.3"
|
|
:precision="2"
|
|
:precision="2"
|
|
:step="0.01"
|
|
:step="0.01"
|
|
@@ -129,25 +129,27 @@ export default {
|
|
periodId: this.periodId,
|
|
periodId: this.periodId,
|
|
companyId: this.currentCompany.companyId
|
|
companyId: this.currentCompany.companyId
|
|
}).then(response => {
|
|
}).then(response => {
|
|
|
|
+ console.log("-----------",JSON.stringify(response.data))
|
|
this.redPacketList = (response.data || []).map(item => ({
|
|
this.redPacketList = (response.data || []).map(item => ({
|
|
...item,
|
|
...item,
|
|
- amount: item.amount || 0.1
|
|
|
|
|
|
+ // amount: item.amount || 0.1
|
|
|
|
+ amount:item.amount ?? 0.1
|
|
}));
|
|
}));
|
|
});
|
|
});
|
|
},
|
|
},
|
|
// 保存红包金额
|
|
// 保存红包金额
|
|
handleSave() {
|
|
handleSave() {
|
|
// 筛选出有金额的项目
|
|
// 筛选出有金额的项目
|
|
- const validAmountItems = this.redPacketList.filter(item => item.amount > 0);
|
|
|
|
|
|
+ const validAmountItems = this.redPacketList.filter(item => item.amount >= 0);
|
|
if (validAmountItems.length === 0) {
|
|
if (validAmountItems.length === 0) {
|
|
this.$message.warning('请至少设置一个红包金额');
|
|
this.$message.warning('请至少设置一个红包金额');
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
|
|
|
|
// 验证金额范围
|
|
// 验证金额范围
|
|
- const invalidItems = validAmountItems.filter(item => item.amount < 0.1 || item.amount > 0.3);
|
|
|
|
|
|
+ const invalidItems = validAmountItems.filter(item => item.amount < 0.0 || item.amount > 0.3);
|
|
if (invalidItems.length > 0) {
|
|
if (invalidItems.length > 0) {
|
|
- this.$message.error('红包金额需要在0.1元至0.3元之间');
|
|
|
|
|
|
+ this.$message.error('红包金额需要在0.0元至0.3元之间');
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
|
|
|