|
@@ -4,7 +4,15 @@
|
|
<el-col :span="24" class="main animate__animated animate__backInRight">
|
|
<el-col :span="24" class="main animate__animated animate__backInRight">
|
|
<el-col :span="24" class="one"> <span>优惠券管理</span> </el-col>
|
|
<el-col :span="24" class="one"> <span>优惠券管理</span> </el-col>
|
|
<el-col :span="24" class="two">
|
|
<el-col :span="24" class="two">
|
|
- <search-1 :form="searchForm" :statusList="statusList" @onSubmit="search" @toReset="toClose"></search-1>
|
|
|
|
|
|
+ <search-1
|
|
|
|
+ :form="searchForm"
|
|
|
|
+ :statusList="statusList"
|
|
|
|
+ @onSubmit="search"
|
|
|
|
+ @toReset="toClose"
|
|
|
|
+ @querySearch="querySearch"
|
|
|
|
+ :shopList="shopList"
|
|
|
|
+ :discount_typeList="discount_typeList"
|
|
|
|
+ ></search-1>
|
|
</el-col>
|
|
</el-col>
|
|
<el-col :span="24" class="thr">
|
|
<el-col :span="24" class="thr">
|
|
<el-button type="primary" size="mini" @click="toAdd()">新增</el-button>
|
|
<el-button type="primary" size="mini" @click="toAdd()">新增</el-button>
|
|
@@ -34,6 +42,7 @@ const _ = require('lodash');
|
|
import { mapState, createNamespacedHelpers } from 'vuex';
|
|
import { mapState, createNamespacedHelpers } from 'vuex';
|
|
const { mapActions } = createNamespacedHelpers('coupon');
|
|
const { mapActions } = createNamespacedHelpers('coupon');
|
|
const { mapActions: dictData } = createNamespacedHelpers('dictData');
|
|
const { mapActions: dictData } = createNamespacedHelpers('dictData');
|
|
|
|
+const { mapActions: shop } = createNamespacedHelpers('shop');
|
|
|
|
|
|
export default {
|
|
export default {
|
|
name: 'card-1',
|
|
name: 'card-1',
|
|
@@ -62,6 +71,15 @@ export default {
|
|
{ label: '商铺', model: 'shop.name' },
|
|
{ label: '商铺', model: 'shop.name' },
|
|
{ label: '优惠券名称', model: 'name' },
|
|
{ label: '优惠券名称', model: 'name' },
|
|
{ label: '优惠券数量', model: 'num' },
|
|
{ label: '优惠券数量', model: 'num' },
|
|
|
|
+ {
|
|
|
|
+ label: '减免方式',
|
|
|
|
+ model: 'discount_type',
|
|
|
|
+ format: (i) => {
|
|
|
|
+ let data = that.discount_typeList.find((f) => f.value == i);
|
|
|
|
+ if (data) return data.label;
|
|
|
|
+ else return '暂无';
|
|
|
|
+ },
|
|
|
|
+ },
|
|
{
|
|
{
|
|
label: '是否使用',
|
|
label: '是否使用',
|
|
model: 'status',
|
|
model: 'status',
|
|
@@ -78,6 +96,11 @@ export default {
|
|
issueList: [],
|
|
issueList: [],
|
|
// 是否使用
|
|
// 是否使用
|
|
statusList: [],
|
|
statusList: [],
|
|
|
|
+ // 商铺
|
|
|
|
+ shopList: [],
|
|
|
|
+
|
|
|
|
+ // 减免方式
|
|
|
|
+ discount_typeList: [],
|
|
};
|
|
};
|
|
},
|
|
},
|
|
async created() {
|
|
async created() {
|
|
@@ -85,6 +108,8 @@ export default {
|
|
await this.searchOther();
|
|
await this.searchOther();
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
|
|
+ ...shop({ shopQuery: 'query' }),
|
|
|
|
+
|
|
...dictData({ dictQuery: 'query' }),
|
|
...dictData({ dictQuery: 'query' }),
|
|
...mapActions(['query', 'fetch', 'create', 'update', 'delete']),
|
|
...mapActions(['query', 'fetch', 'create', 'update', 'delete']),
|
|
// 查询
|
|
// 查询
|
|
@@ -132,6 +157,19 @@ export default {
|
|
if (this.$checkRes(res)) {
|
|
if (this.$checkRes(res)) {
|
|
this.$set(this, `statusList`, res.data);
|
|
this.$set(this, `statusList`, res.data);
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ // 减免方式
|
|
|
|
+ res = await this.dictQuery({ code: 'coupon_discount_type' });
|
|
|
|
+ if (this.$checkRes(res)) {
|
|
|
|
+ this.$set(this, `discount_typeList`, res.data);
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ // 店铺名称远程查询
|
|
|
|
+ async querySearch(value) {
|
|
|
|
+ let res = await this.shopQuery({ name: value });
|
|
|
|
+ if (this.$checkRes(res)) {
|
|
|
|
+ this.$set(this, 'shopList', res.data);
|
|
|
|
+ }
|
|
},
|
|
},
|
|
},
|
|
},
|
|
computed: {
|
|
computed: {
|