bug
This commit is contained in:
parent
e175eeda8a
commit
09fd7d1e04
@ -217,7 +217,7 @@
|
|||||||
<div class="box-bt"> <div >赠送卡券</div> <el-button type="primary" icon="el-icon-plus" @click="getlistFavorable()" >新增</el-button> </div>
|
<div class="box-bt"> <div >赠送卡券</div> <el-button type="primary" icon="el-icon-plus" @click="getlistFavorable()" >新增</el-button> </div>
|
||||||
<div style="margin: 10px 0px">
|
<div style="margin: 10px 0px">
|
||||||
<el-table
|
<el-table
|
||||||
:data="form.tableDatas"
|
:data="tableData1"
|
||||||
border
|
border
|
||||||
style="width: 100%">
|
style="width: 100%">
|
||||||
<el-table-column
|
<el-table-column
|
||||||
@ -660,6 +660,7 @@ export default {
|
|||||||
tableDatadh:[],//兑换券
|
tableDatadh:[],//兑换券
|
||||||
tableDatasw:[],//实物
|
tableDatasw:[],//实物
|
||||||
tableDatas:[],//公共选择区域
|
tableDatas:[],//公共选择区域
|
||||||
|
tableData1:[],//公共选择区域
|
||||||
//请求优惠券列表时的参数
|
//请求优惠券列表时的参数
|
||||||
youhuiquan:{
|
youhuiquan:{
|
||||||
name:'',
|
name:'',
|
||||||
@ -979,7 +980,8 @@ export default {
|
|||||||
giftCardTotal: 1//券数量
|
giftCardTotal: 1//券数量
|
||||||
}
|
}
|
||||||
|
|
||||||
this.form.tableDatas.push(data)
|
// this.form.tableDatas.push(data)
|
||||||
|
this.tableData1.push(data)
|
||||||
|
|
||||||
this.$message.success("新增成功")
|
this.$message.success("新增成功")
|
||||||
|
|
||||||
@ -1110,16 +1112,17 @@ export default {
|
|||||||
/** 修改按钮操作 */
|
/** 修改按钮操作 */
|
||||||
handleUpdate(row) {
|
handleUpdate(row) {
|
||||||
this.reset();
|
this.reset();
|
||||||
|
this.tableData1 = []
|
||||||
const id = row.id || this.ids
|
const id = row.id || this.ids
|
||||||
getActiveConsumption(id).then(response => {
|
getActiveConsumption(id).then(response => {
|
||||||
this.form = response.data;
|
this.form = response.data;
|
||||||
if(response.data.activeConsumptionChildList&&response.data.activeConsumptionChildList.length >1){
|
if(response.data.activeConsumptionChildList&&response.data.activeConsumptionChildList.length >1){
|
||||||
this.form.tableDatas = response.data.activeConsumptionChildList.filter(item => item.activeGift == '1')
|
this.form.tableDatas = response.data.activeConsumptionChildList.filter(item => item.activeGift == '1')
|
||||||
|
this.tableData1 = response.data.activeConsumptionChildList.filter(item => item.activeGift == '1')
|
||||||
this.tableDatas = response.data.activeConsumptionChildList.filter(item => item.activeGift == '2')
|
this.tableDatas = response.data.activeConsumptionChildList.filter(item => item.activeGift == '2')
|
||||||
this.form.shiwudata = response.data.activeConsumptionChildList.filter(item => item.activeGift == '4')
|
this.form.shiwudata = response.data.activeConsumptionChildList.filter(item => item.activeGift == '4')
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
this.open = true;
|
this.open = true;
|
||||||
this.title = "修改消费有礼活动";
|
this.title = "修改消费有礼活动";
|
||||||
});
|
});
|
||||||
@ -1173,10 +1176,14 @@ export default {
|
|||||||
},
|
},
|
||||||
/** 提交按钮 */
|
/** 提交按钮 */
|
||||||
submitForm() {
|
submitForm() {
|
||||||
if (!this.form.tableDatas || this.form.tableDatas.length==0){
|
// if (!this.form.tableDatas || this.form.tableDatas.length==0){
|
||||||
this.form.tableDatas = []
|
// this.form.tableDatas = []
|
||||||
}
|
// }
|
||||||
this.form.activeConsumptionChildList = this.form.tableDatas.concat(this.tableDatas, this.form.shiwudata);
|
// if (this.tableDatas && this.tableDatas.length>0 || this.form.shiwudata && this.form.shiwudata.length>0 )
|
||||||
|
// this.form.activeConsumptionChildList = this.form.tableDatas.concat(this.tableDatas, this.form.shiwudata);
|
||||||
|
|
||||||
|
// if (this.tableDatas && this.tableDatas.length>0 || this.form.shiwudata && this.form.shiwudata.length>0 )
|
||||||
|
this.form.activeConsumptionChildList = this.tableData1.concat(this.tableDatas);
|
||||||
console.log(this.form.activeConsumptionChildList)
|
console.log(this.form.activeConsumptionChildList)
|
||||||
|
|
||||||
this.$refs["form"].validate(valid => {
|
this.$refs["form"].validate(valid => {
|
||||||
|
@ -125,6 +125,7 @@ public class ActiveConsumptionServiceImpl extends ServiceImpl<ActiveConsumptionM
|
|||||||
activeConsumption.setGasolineUserLevel(arrayToString(activeConsumptionDTO.getGasolineUserLevel()));
|
activeConsumption.setGasolineUserLevel(arrayToString(activeConsumptionDTO.getGasolineUserLevel()));
|
||||||
//天然气会员等级
|
//天然气会员等级
|
||||||
activeConsumption.setNaturalUserLevel(arrayToString(activeConsumptionDTO.getNaturalUserLevel()));
|
activeConsumption.setNaturalUserLevel(arrayToString(activeConsumptionDTO.getNaturalUserLevel()));
|
||||||
|
activeConsumption.setMoneyType(activeConsumptionDTO.getMoneyType());
|
||||||
save = save(activeConsumption);
|
save = save(activeConsumption);
|
||||||
}
|
}
|
||||||
//新增兑换物品
|
//新增兑换物品
|
||||||
@ -313,6 +314,7 @@ public class ActiveConsumptionServiceImpl extends ServiceImpl<ActiveConsumptionM
|
|||||||
String participationConditionMoney = activeConsumptionDTO.getParticipationConditionMoney();
|
String participationConditionMoney = activeConsumptionDTO.getParticipationConditionMoney();
|
||||||
double participationConditionMoneys = Double.parseDouble(participationConditionMoney);
|
double participationConditionMoneys = Double.parseDouble(participationConditionMoney);
|
||||||
BeanUtils.copyProperties(activeConsumptionDTO,activeConsumption);
|
BeanUtils.copyProperties(activeConsumptionDTO,activeConsumption);
|
||||||
|
activeConsumption.setMoneyType(activeConsumptionDTO.getMoneyType());
|
||||||
activeConsumption.setParticipationConditionMoney(participationConditionMoneys);
|
activeConsumption.setParticipationConditionMoney(participationConditionMoneys);
|
||||||
activeConsumption.setAdaptOil(arrayToString(activeConsumptionDTO.getAdaptOil()));
|
activeConsumption.setAdaptOil(arrayToString(activeConsumptionDTO.getAdaptOil()));
|
||||||
activeConsumption.setActiveGift(arrayToString(activeConsumptionDTO.getActiveGift()));
|
activeConsumption.setActiveGift(arrayToString(activeConsumptionDTO.getActiveGift()));
|
||||||
@ -335,10 +337,11 @@ public class ActiveConsumptionServiceImpl extends ServiceImpl<ActiveConsumptionM
|
|||||||
List<ActiveConsumptionChild> activeConsumptionChildList1 = activeConsumptionDTO.getActiveConsumptionChildList();
|
List<ActiveConsumptionChild> activeConsumptionChildList1 = activeConsumptionDTO.getActiveConsumptionChildList();
|
||||||
if (CollectionUtils.isNotEmpty(activeConsumptionChildList1)){
|
if (CollectionUtils.isNotEmpty(activeConsumptionChildList1)){
|
||||||
activeConsumptionChildList1.stream().map(s ->{
|
activeConsumptionChildList1.stream().map(s ->{
|
||||||
s.setActiveConsumptionId(activeConsumption.getId());
|
if (ObjectUtil.isNotEmpty(s)) s.setActiveConsumptionId(activeConsumption.getId());
|
||||||
return s;
|
return s;
|
||||||
}).collect(Collectors.toList());
|
}).collect(Collectors.toList());
|
||||||
update = activeConsumptionChildService.saveBatch(activeConsumptionChildList1);
|
if (ObjectUtil.isNotEmpty(activeConsumptionChildList1))
|
||||||
|
update = activeConsumptionChildService.saveBatch(activeConsumptionChildList1);
|
||||||
}
|
}
|
||||||
return update;
|
return update;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user