|
@@ -2,36 +2,39 @@
|
|
|
<div id="card-1">
|
|
|
<el-row>
|
|
|
<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="two">
|
|
|
- <search-1
|
|
|
- :form="searchForm"
|
|
|
- :statusList="statusList"
|
|
|
- @onSubmit="search"
|
|
|
- @toReset="toClose"
|
|
|
- @querySearch="querySearch"
|
|
|
- :shopList="shopList"
|
|
|
- :discount_typeList="discount_typeList"
|
|
|
- ></search-1>
|
|
|
- </el-col>
|
|
|
- <el-col :span="24" class="thr">
|
|
|
- <el-button type="primary" size="mini" @click="toAdd()">新增</el-button>
|
|
|
- </el-col>
|
|
|
- <el-col :span="24" class="four">
|
|
|
- <data-table
|
|
|
- :select="true"
|
|
|
- :selected="selected"
|
|
|
- @handleSelect="handleSelect"
|
|
|
- :fields="fields"
|
|
|
- :opera="opera"
|
|
|
- @query="search"
|
|
|
- :data="list"
|
|
|
- :total="total"
|
|
|
- @edit="toEdit"
|
|
|
- @del="toDel"
|
|
|
- >
|
|
|
- </data-table>
|
|
|
- </el-col>
|
|
|
+ <span v-show="view === 'list'">
|
|
|
+ <el-col :span="24" class="one"> <span>优惠券管理</span> </el-col>
|
|
|
+ <el-col :span="24" class="two">
|
|
|
+ <search-1
|
|
|
+ :form="searchForm"
|
|
|
+ :statusList="statusList"
|
|
|
+ @onSubmit="search"
|
|
|
+ @toReset="toClose"
|
|
|
+ @querySearch="querySearch"
|
|
|
+ :shopList="shopList"
|
|
|
+ :discount_typeList="discount_typeList"
|
|
|
+ ></search-1>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="24" class="thr">
|
|
|
+ <el-button type="primary" size="mini" @click="toAdd()">新增</el-button>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="24" class="four">
|
|
|
+ <data-table
|
|
|
+ :select="true"
|
|
|
+ :selected="selected"
|
|
|
+ @handleSelect="handleSelect"
|
|
|
+ :fields="fields"
|
|
|
+ :opera="opera"
|
|
|
+ @query="search"
|
|
|
+ :data="list"
|
|
|
+ :total="total"
|
|
|
+ @edit="toEdit"
|
|
|
+ @del="toDel"
|
|
|
+ >
|
|
|
+ </data-table>
|
|
|
+ </el-col>
|
|
|
+ </span>
|
|
|
+ <detail v-if="view === 'info'" :id="id" @toBack="toBack"></detail>
|
|
|
</el-col>
|
|
|
</el-row>
|
|
|
</div>
|
|
@@ -47,10 +50,11 @@ const { mapActions: shop } = createNamespacedHelpers('shop');
|
|
|
export default {
|
|
|
name: 'card-1',
|
|
|
props: {},
|
|
|
- components: { search1: () => import('./parts/search-1.vue') },
|
|
|
+ components: { search1: () => import('./parts/search-1.vue'), detail: () => import('./detail.vue') },
|
|
|
data: function () {
|
|
|
const that = this;
|
|
|
return {
|
|
|
+ view: 'list',
|
|
|
// 查询
|
|
|
searchForm: {},
|
|
|
list: [],
|
|
@@ -101,6 +105,7 @@ export default {
|
|
|
shopList: [],
|
|
|
// 减免方式
|
|
|
discount_typeList: [],
|
|
|
+ id: '',
|
|
|
};
|
|
|
},
|
|
|
async created() {
|
|
@@ -122,11 +127,15 @@ export default {
|
|
|
},
|
|
|
// 新增
|
|
|
toAdd() {
|
|
|
- this.$router.push({ path: '/platActivi/coupon/detail' });
|
|
|
+ this.$set(this, `view`, 'info');
|
|
|
+ },
|
|
|
+ toBack() {
|
|
|
+ this.view = 'list';
|
|
|
},
|
|
|
// 修改
|
|
|
async toEdit({ data }) {
|
|
|
- this.$router.push({ path: '/platActivi/coupon/detail', query: { id: data.id } });
|
|
|
+ this.$set(this, `id`, data.id);
|
|
|
+ this.$set(this, `view`, 'info');
|
|
|
},
|
|
|
// 删除
|
|
|
async toDel({ data }) {
|