| | |
| | | handleRowClick(currentRow ,oldCurrentRow){ |
| | | this.prizeFrom.couponId = currentRow.id; |
| | | this.showCoupon = currentRow.couponName; |
| | | console.log(this.prizeFrom.couponId) |
| | | }, |
| | | getCouponDataList() { |
| | | // 获取数据 |
| | |
| | | getPlatformCouponList(this.couponSearchForm).then((res) => { |
| | | this.couponLoading = false; |
| | | if (res.success) { |
| | | console.log(res); |
| | | this.couponData = res.result.records; |
| | | this.couponTotal = res.result.total; |
| | | } |
| | |
| | | this.modelShow = false |
| | | this.submitLoading = false |
| | | this.showCoupon = ''; |
| | | this.$refs.form.resetFields() |
| | | |
| | | }, |
| | | getPage(){ |
| | | this.loading = true; |
| | |
| | | this.infoModalShow = false; |
| | | }, |
| | | openEdit(row){ |
| | | this.$refs.form.resetFields(); |
| | | //重置id |
| | | //需要判断是否可以编辑 |
| | | canUpDatePrizeDraw(row.id).then(res =>{ |
| | | if (res.code === 200){ |
| | | if (res.state){ |
| | | console.log(res.data) |
| | | this.modelShow = true; |
| | | this.modelTitle = "编辑奖品"; |
| | | this.prizeFrom ={ |
| | |
| | | }, |
| | | openAdd(){ |
| | | this.$refs.form.resetFields() |
| | | //重置id |
| | | this.prizeFrom.id = null; |
| | | |
| | | this.modelShow = true; |
| | | this.modelTitle = "新增奖品"; |
| | | //清除表单状态. |
| | |
| | | this.imgTempUrl = null; |
| | | this.showCoupon = null; |
| | | }, |
| | | delById(row){ |
| | | del(row.id).then(res=>{ |
| | | if (res.code === 200){ |
| | | this.$Message.success(res.msg) |
| | | }else { |
| | | this.$Message.error(res.msg) |
| | | async delById(row){ |
| | | let status = false |
| | | await canUpDatePrizeDraw(row.id).then(res => { |
| | | |
| | | if (res.code === 200) { |
| | | status = res.state; |
| | | |
| | | } |
| | | this.getPage() |
| | | }) |
| | | }); |
| | | if (status){ |
| | | await del(row.id).then(res=>{ |
| | | if (res.code === 200){ |
| | | this.$Message.success(res.msg) |
| | | }else { |
| | | this.$Message.error(res.msg) |
| | | } |
| | | this.getPage() |
| | | }) |
| | | }else { |
| | | this.$Message.error("该奖品在抽奖活动中无法删除!") |
| | | } |
| | | |
| | | }, |
| | | // 获取富文本编辑器的内容 |
| | | // 初始化数据 |