107 lines
4.0 KiB
Vue
Raw Normal View History

2022-10-18 19:30:05 +08:00
<template>
<div>
<el-card class="box-card" :body-style="{ padding: '20px 20px 0 20px' }">
2022-10-19 21:06:09 +08:00
<el-form :inline="true" :model="formSearch" class="demo-form-inline">
2022-10-18 19:30:05 +08:00
<el-form-item label="店铺">
2022-10-19 21:06:09 +08:00
<el-select v-model="formSearch.store_id" placeholder="全部">
<el-option v-for="store in stores" :key="store.id" :label="store.name" :value="store.id">
</el-option>
2022-10-18 19:30:05 +08:00
</el-select>
</el-form-item>
<el-form-item label="团购状态">
2022-10-19 21:06:09 +08:00
<el-select v-model="formSearch.status" placeholder="团购状态">
2022-10-21 13:09:30 +08:00
<el-option label="未开始" value="-5"></el-option>
2022-10-18 19:30:05 +08:00
<el-option label="跟团中" value="1"></el-option>
2022-10-21 13:09:30 +08:00
<el-option label="预览中" value="-10"></el-option>
<el-option label="已结束" value="20"></el-option>
2022-10-18 19:30:05 +08:00
</el-select>
</el-form-item>
<el-form-item label="活动标题">
2022-10-19 21:06:09 +08:00
<el-input v-model="formSearch.title" placeholder="活动标题"></el-input>
2022-10-18 19:30:05 +08:00
</el-form-item>
<el-form-item>
2022-10-19 21:06:09 +08:00
<el-button type="primary" @click="getGroupList();">查询</el-button>
<el-button type="success" @click="groupAdd();">新增团购</el-button>
2022-10-18 19:30:05 +08:00
</el-form-item>
</el-form>
</el-card>
<el-card style="margin-top: 10px" class="box-card">
<el-table v-loading="loading" :data="tableData" border style="width: 100%">
<el-table-column prop="shop.name" label="店铺">
2022-10-18 19:30:05 +08:00
</el-table-column>
<el-table-column prop="title" label="活动标题">
</el-table-column>
<el-table-column prop="status" label="团购状态">
</el-table-column>
2022-10-19 21:06:09 +08:00
<el-table-column label="开团时间">
<template slot-scope="scope">
<div>{{scope.row.start_time}}</div>
<div></div>
<div>{{scope.row.end_time}}</div>
</template>
2022-10-18 19:30:05 +08:00
</el-table-column>
2022-10-19 21:06:09 +08:00
<el-table-column label="手机查看">
<template slot-scope="scope">
<el-image style="width: 100px; height: 100px" :src="scope.row.ercode"></el-image>
</template>
2022-10-18 19:30:05 +08:00
</el-table-column>
<el-table-column prop="options" label="操作">
<template slot-scope="scope">
<el-button @click="groupEdit(scope.row.id)" type="text" size="small">编辑</el-button>
2022-10-18 19:30:05 +08:00
</template>
</el-table-column>
</el-table>
</el-card>
</div>
</template>
<script>
2022-10-19 21:06:09 +08:00
import { storeList } from "../../api/shop";
import { groupList } from "../../api/group";
2022-10-18 19:30:05 +08:00
export default {
data() {
return {
2022-10-19 21:06:09 +08:00
formSearch: {
store_id: "",
status: "",
title: "",
2022-10-21 13:09:30 +08:00
page: 1,
per_page: 20
2022-10-18 19:30:05 +08:00
},
2022-10-19 21:06:09 +08:00
stores: [],
loading: false,
2022-10-21 13:09:30 +08:00
tableData: []
2022-10-18 19:30:05 +08:00
}
},
2022-10-19 21:06:09 +08:00
mounted() {
this.getStoreList();
this.getGroupList();
},
2022-10-18 19:30:05 +08:00
methods: {
2022-10-19 21:06:09 +08:00
getStoreList() {
2022-10-21 13:09:30 +08:00
let params = {
2022-10-19 21:06:09 +08:00
page: 0,
per_page: 999,
2022-10-21 13:09:30 +08:00
plat_id: 1
2022-10-19 21:06:09 +08:00
};
2022-10-21 13:09:30 +08:00
storeList(params).then((res) => {
2022-10-19 21:06:09 +08:00
this.stores = res.data.data;
});
},
getGroupList() {
2022-10-21 13:09:30 +08:00
groupList(this.formSearch).then((res) => {
this.tableData = res.data.data;
})
2022-10-19 21:06:09 +08:00
},
groupAdd() {
this.$router.push({ path: "GROUP_GOODS_ADD", query: { id: 0 } });
},
groupEdit(id) {
this.$router.push({ path: "GROUP_GOODS_EDIT", query: { id: id } });
},
2022-10-18 19:30:05 +08:00
}
}
</script>