|
|
@@ -235,12 +235,11 @@
|
|
|
<!-- <el-input v-model="prize.productId" placeholder="请输入商品ID" />-->
|
|
|
<el-select
|
|
|
v-model="prize.productId"
|
|
|
- filterable
|
|
|
+ :filterable="true"
|
|
|
clearable
|
|
|
remote
|
|
|
reserve-keyword
|
|
|
placeholder="请输入关键字搜索"
|
|
|
- :remote-method="fetchProducts"
|
|
|
:loading="loadingProducts"
|
|
|
size="small"
|
|
|
style="width: 180px"
|
|
|
@@ -468,6 +467,7 @@ export default {
|
|
|
this.canLiveId = true;
|
|
|
}
|
|
|
this.getList();
|
|
|
+ this.getProducts();
|
|
|
},
|
|
|
// 初始化时立即执行一次
|
|
|
immediate: true
|
|
|
@@ -481,19 +481,19 @@ export default {
|
|
|
this.getDicts("sys_live_lottery_status").then(response => {
|
|
|
this.lotteryStatusOptions = response.data;
|
|
|
});
|
|
|
- if (this.$route.params.liveId) {
|
|
|
- this.liveId = this.$route.params.liveId;
|
|
|
- }else {
|
|
|
- this.liveId = this.$route.query.liveId;
|
|
|
- }
|
|
|
- this.parentLiveId = this.liveId;
|
|
|
- this.queryParams.liveId = this.parentLiveId;
|
|
|
- if(this.queryParams.liveId){
|
|
|
- this.form.liveId = this.parentLiveId;
|
|
|
- //设置查询条件直播间ID不可修改
|
|
|
- this.canLiveId = true;
|
|
|
- }
|
|
|
- this.getList();
|
|
|
+ // if (this.$route.params.liveId) {
|
|
|
+ // this.liveId = this.$route.params.liveId;
|
|
|
+ // }else {
|
|
|
+ // this.liveId = this.$route.query.liveId;
|
|
|
+ // }
|
|
|
+ // this.parentLiveId = this.liveId;
|
|
|
+ // this.queryParams.liveId = this.parentLiveId;
|
|
|
+ // if(this.queryParams.liveId){
|
|
|
+ // this.form.liveId = this.parentLiveId;
|
|
|
+ // //设置查询条件直播间ID不可修改
|
|
|
+ // this.canLiveId = true;
|
|
|
+ // }
|
|
|
+ // this.getList();
|
|
|
},
|
|
|
mounted() {
|
|
|
this.$watch(
|
|
|
@@ -504,14 +504,9 @@ export default {
|
|
|
);
|
|
|
},
|
|
|
methods: {
|
|
|
- async fetchProducts(query) {
|
|
|
- if (!query) {
|
|
|
- this.productOptions = [];
|
|
|
- return;
|
|
|
- }
|
|
|
+ getProducts(){
|
|
|
const queryParam = {
|
|
|
- liveId : this.liveId,
|
|
|
- keywords: query
|
|
|
+ liveId : this.liveId
|
|
|
}
|
|
|
this.loadingProducts = true;
|
|
|
try {
|
|
|
@@ -525,6 +520,23 @@ export default {
|
|
|
this.loadingProducts = false;
|
|
|
}
|
|
|
},
|
|
|
+ // async fetchProducts(query) {
|
|
|
+ // const queryParam = {
|
|
|
+ // liveId : this.liveId,
|
|
|
+ // keywords: query
|
|
|
+ // }
|
|
|
+ // this.loadingProducts = true;
|
|
|
+ // try {
|
|
|
+ // listLiveGoods(queryParam).then(response => {
|
|
|
+ // this.productOptions = response.rows;
|
|
|
+ // })
|
|
|
+ // } catch (err) {
|
|
|
+ // console.error('查询商品失败:', err);
|
|
|
+ // this.productOptions = [];
|
|
|
+ // } finally {
|
|
|
+ // this.loadingProducts = false;
|
|
|
+ // }
|
|
|
+ // },
|
|
|
// 获取默认奖品配置
|
|
|
getDefaultPrize() {
|
|
|
return {
|