修复配置查询问题

This commit is contained in:
Dragon
2024-03-21 18:57:57 +08:00
parent 08288a617c
commit b2a9c4e376

View File

@@ -16,7 +16,7 @@
</div>
<div class="inquire" style="display: inline-block; margin-right: 20px">
<span class="demonstration">选择礼物个数区间</span>
<el-select v-model="inquire.value2" placeholder="请选择">
<el-select @change="selectGift2" v-model="inquire.value2" placeholder="请选择">
<el-option
v-for="(item, i) in inquire.giftsNum"
:key="i"
@@ -275,39 +275,56 @@ export default {
getFun() {
getAll({ giftType: 16 }).then((res) => {
this.inquire.gifts = res.data;
this.inquire.value1 = res.data[0].giftId;
luckyGiftRangeConfigList({ giftId: this.inquire.value1 }).then((res) => {
this.inquire.giftsNum = res.data;
this.inquire.value2 = res.data[0].id;
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;
});
});
this.inquire.value1 = "";
this.inquire.value2 = "";
// this.inquire.value1 = res.data[0].giftId;
// luckyGiftRangeConfigList({ giftId: this.inquire.value1 }).then((res) => {
// this.inquire.giftsNum = res.data;
// this.inquire.value2 = res.data[0].id;
// 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;
// });
// });
});
},
// 外部监听
selectGift(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.value2 = res.data[0].id;
this.loading = true;
luckyGiftRewardList({
giftId: e,
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;
});
// this.inquire.value2 = res.data[0].id;
// this.loading = true;
// luckyGiftRewardList({
// giftId: e,
// 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;
// });
});
},
// 外部监听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
@@ -467,7 +484,15 @@ export default {
}
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) {
@@ -478,7 +503,15 @@ export default {
})
.then(() => {
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(() => {});