合并Master

This commit is contained in:
lemon橪
2021-07-22 18:03:04 +08:00
10 changed files with 78 additions and 29 deletions

View File

@@ -27,8 +27,9 @@
</Row>
<Table class="mt_10" :loading="loading" border :columns="columns" :data="data" ref="table" @on-selection-change="changeSelect">
<template slot-scope="{ row }" slot="action">
<Button v-if="row.promotionStatus === 'NEW' || row.promotionStatus === 'CLOSE'" type="info" size="small" style="margin-right: 5px" @click="edit(row)">编辑</Button>
<Button v-if="row.promotionStatus === 'NEW' || row.promotionStatus === 'CLOSE'" type="info" size="small" :style="{'marginRight': row.promotionStatus !== 'CLOSE'?'5px':'0'}" @click="edit(row)">编辑</Button>
<Button v-if="row.promotionStatus !== 'CLOSE'" type="error" size="small" @click="remove(row)">下架</Button>
<!-- <Button v-if="row.promotionStatus === 'CLOSE' || row.promotionStatus === 'NEW'" type="success" size="small" @click="open(row)">上架</Button> -->
</template>
</Table>
<Row type="flex" justify="end" class="page">
@@ -257,6 +258,29 @@ export default {
edit(v) {
this.$router.push({ name: "add-coupon", query: { id: v.id } });
},
// 开启优惠券
open(v) {
this.$Modal.confirm({
title: "确认",
content: "确认要上架此优惠券么?",
loading: true,
onOk: () => {
this.loading = false;
let params = {
couponIds: v.id,
promotionStatus: "START",
};
updateCouponStatus(params).then((res) => {
this.$Modal.remove();
if (res.success) {
this.$Message.success("上架成功");
this.clearSelectAll();
this.getDataList();
}
});
},
});
},
// 下架优惠券
remove(v) {
this.$Modal.confirm({
@@ -280,6 +304,7 @@ export default {
},
});
},
// 批量下架
delAll() {
if (this.selectCount <= 0) {

View File

@@ -12,7 +12,7 @@
:disabled="form.promotionStatus != 'NEW'"
placeholder="活动名称"
clearable
style="width: 260px"
style="width: 280px"
/>
</FormItem>
<FormItem label="活动时间" prop="rangeTime">
@@ -23,7 +23,7 @@
format="yyyy-MM-dd HH:mm:ss"
placeholder="请选择"
:options="options"
style="width: 320px"
style="width: 280px"
>
</DatePicker>
</FormItem>
@@ -34,7 +34,7 @@
type="textarea"
:rows="4"
clearable
style="width: 260px"
style="width: 280px"
/>
</FormItem>
</div>
@@ -48,7 +48,7 @@
:disabled="form.promotionStatus != 'NEW'"
placeholder="优惠门槛"
clearable
style="width: 260px"
style="width: 280px"
/>
<span class="describe">消费达到当前金额可以参与优惠</span>
</FormItem>
@@ -77,7 +77,7 @@
v-model="form.fullMinus"
placeholder="优惠金额"
clearable
style="width: 260px"
style="width: 280px"
/>
</FormItem>
<FormItem
@@ -91,7 +91,7 @@
v-model="form.fullRate"
placeholder="优惠折扣"
clearable
style="width: 260px"
style="width: 280px"
/>
<span class="describe">优惠折扣为0-10之间数字可有一位小数</span>
</FormItem>
@@ -127,7 +127,7 @@
:remote-method="getCouponList"
placeholder="输入优惠券名称搜索"
:loading="couponLoading"
style="width: 260px"
style="width: 280px"
>
<Option
v-for="item in couponList"
@@ -145,7 +145,7 @@
:remote-method="getGiftList"
placeholder="输入赠品名称搜索"
:loading="giftLoading"
style="width: 260px"
style="width: 280px"
>
<Option
v-for="item in giftList"
@@ -161,7 +161,7 @@
v-model="form.point"
type="number"
:min="0"
style="width: 260px"
style="width: 280px"
/>
</FormItem>
<FormItem label="使用范围" prop="scopeType">