Browse Source

商家端新增优惠商品选择添加商品搜索业务功能

master
dy-hu 1 year ago
parent
commit
566eb111b4
  1. 27
      src/views/marketing/coupon/add.vue

27
src/views/marketing/coupon/add.vue

@ -134,6 +134,10 @@
:modal="false"
>
<!-- 表格 -->
<div style="margin-bottom: 15px">
<el-input v-model="prodSearch" :placeholder="$t('product.productname_hint')" style="width: 360px"/>
<el-button type="primary" style="margin-left: 8px" @click="searchProd">{{$t('common.query')}}</el-button>
</div>
<div class="tableBox">
<el-table
ref="multipleTable"
@ -158,10 +162,10 @@
</template>
</el-table-column>
<el-table-column prop="productName" label="产品名称" width="220" />
<el-table-column prop="productId" label="产品id" show-overflow-tooltip />
<!-- <el-table-column prop="discountPrice" label="售价(元)" show-overflow-tooltip />-->
<el-table-column prop="originalPrice" label="原价(元)" show-overflow-tooltip />
<el-table-column prop="stockNumber" label="库存(件)" show-overflow-tooltip />
<el-table-column prop="shopName" label="所属店铺" show-overflow-tooltip />
<!-- <el-table-column prop="volume" label="销量" show-overflow-tooltip />-->
</el-table>
<div class="fenye">
@ -326,6 +330,7 @@ export default {
pageSize: 10
},
shopMultipleSelection: [],
prodSearch: undefined
}
},
watch: {
@ -345,7 +350,6 @@ export default {
}
},
mounted() {
console.log('mounted-------')
this.shopCouponId = this.couponId
if (this.shopCouponId) {
this.getCouponInfo()
@ -421,6 +425,15 @@ export default {
return false
}
}
if (this.addForm.applyType === 4) {
if (!this.addForm.ids || !this.addForm.ids.length || this.addForm.ids.length === 0) {
this.$message({
message: '请选择指定店铺',
type: 'warning'
})
return false
}
}
this.addForm.effectiveStart = this.dateInfo[0]
this.addForm.effectiveEnd = this.dateInfo[1]
if (this.shopCouponId) {
@ -567,6 +580,8 @@ export default {
//
closeSelect() {
this.isVisible = false
this.prodSearch = undefined
this.proOption.searchContent = undefined
},
// ID
@ -624,7 +639,6 @@ export default {
})
} else if (this.addForm.applyType === 4) {
this.idList = res.data.ids
console.log('idList-->', this.idList)
/*this.addForm.products.forEach(item => {
this.idList.push(item.productId)
})*/
@ -638,6 +652,13 @@ export default {
this.addForm.threshold = 0
}
},
searchProd() {
this.proOption.page = 1
this.proOption.pageSize = 10
this.proOption.searchContent = this.prodSearch
this.getProList()
}
}
}
</script>

Loading…
Cancel
Save