修复配置查询问题

This commit is contained in:
Dragon
2024-03-21 18:57:57 +08:00
parent 1f39e1f291
commit af112d5278

View File

@@ -16,7 +16,7 @@
</div> </div>
<div class="inquire" style="display: inline-block; margin-right: 20px"> <div class="inquire" style="display: inline-block; margin-right: 20px">
<span class="demonstration">选择礼物个数区间</span> <span class="demonstration">选择礼物个数区间</span>
<el-select v-model="inquire.value2" placeholder="请选择"> <el-select @change="selectGift2" v-model="inquire.value2" placeholder="请选择">
<el-option <el-option
v-for="(item, i) in inquire.giftsNum" v-for="(item, i) in inquire.giftsNum"
:key="i" :key="i"
@@ -275,39 +275,56 @@ export default {
getFun() { getFun() {
getAll({ giftType: 16 }).then((res) => { getAll({ giftType: 16 }).then((res) => {
this.inquire.gifts = res.data; this.inquire.gifts = res.data;
this.inquire.value1 = res.data[0].giftId; this.inquire.value1 = "";
luckyGiftRangeConfigList({ giftId: this.inquire.value1 }).then((res) => { this.inquire.value2 = "";
this.inquire.giftsNum = res.data; // this.inquire.value1 = res.data[0].giftId;
this.inquire.value2 = res.data[0].id; // luckyGiftRangeConfigList({ giftId: this.inquire.value1 }).then((res) => {
this.loading = true; // this.inquire.giftsNum = res.data;
luckyGiftRewardList({ // this.inquire.value2 = res.data[0].id;
giftId: this.inquire.value1, // this.loading = true;
rangeId: this.inquire.value2, // luckyGiftRewardList({
}).then((res) => { // giftId: this.inquire.value1,
this.inquire.diamond = res.data.giftPrice; // rangeId: this.inquire.value2,
this.inquire.giftExpectation = res.data.expectValue; // }).then((res) => {
this.tableData = res.data.list; // this.inquire.diamond = res.data.giftPrice;
this.loading = false; // this.inquire.giftExpectation = res.data.expectValue;
}); // this.tableData = res.data.list;
}); // this.loading = false;
// });
// });
}); });
}, },
// 外部监听 // 外部监听
selectGift(e) { selectGift(e) {
console.log(e); console.log(e);
luckyGiftRangeConfigList({ giftId: e }).then((res) => { this.inquire.value1 = e;
luckyGiftRangeConfigList({ giftId: this.inquire.value1 }).then((res) => {
this.inquire.giftsNum = res.data; this.inquire.giftsNum = res.data;
this.inquire.value2 = res.data[0].id; // this.inquire.value2 = res.data[0].id;
this.loading = true; // this.loading = true;
luckyGiftRewardList({ // luckyGiftRewardList({
giftId: e, // giftId: e,
rangeId: this.inquire.value2, // rangeId: this.inquire.value2,
}).then((res) => { // }).then((res) => {
this.inquire.diamond = res.data.giftPrice; // this.inquire.diamond = res.data.giftPrice;
this.inquire.giftExpectation = res.data.expectValue; // this.inquire.giftExpectation = res.data.expectValue;
this.tableData = res.data.list; // this.tableData = res.data.list;
this.loading = false; // this.loading = false;
}); // });
});
},
// 外部监听2
selectGift2(e) {
this.inquire.value2 = e;
this.loading = true;
luckyGiftRewardList({
giftId: this.inquire.value1,
rangeId: this.inquire.value2,
}).then((res) => {
this.inquire.diamond = res.data.giftPrice;
this.inquire.giftExpectation = res.data.expectValue;
this.tableData = res.data.list;
this.loading = false;
}); });
}, },
// 监听弹窗数值变化1 // 监听弹窗数值变化1
@@ -467,7 +484,15 @@ export default {
} }
this.detailsDialog = false; this.detailsDialog = false;
}); });
this.getFun(); luckyGiftRewardList({
giftId: this.inquire.value1,
rangeId: this.inquire.value2,
}).then((res) => {
this.inquire.diamond = res.data.giftPrice;
this.inquire.giftExpectation = res.data.expectValue;
this.tableData = res.data.list;
this.loading = false;
});
}, },
//删除 //删除
del(val) { del(val) {
@@ -478,7 +503,15 @@ export default {
}) })
.then(() => { .then(() => {
luckyGiftRewardDelete({ id: val.id }).then((res) => { luckyGiftRewardDelete({ id: val.id }).then((res) => {
this.getFun(); luckyGiftRewardList({
giftId: this.inquire.value1,
rangeId: this.inquire.value2,
}).then((res) => {
this.inquire.diamond = res.data.giftPrice;
this.inquire.giftExpectation = res.data.expectValue;
this.tableData = res.data.list;
this.loading = false;
});
}); });
}) })
.catch(() => {}); .catch(() => {});