满额活动增加card样式
parent
8b0ca5ba7e
commit
87b3cbe344
|
@ -1,29 +1,12 @@
|
||||||
<template>
|
<template>
|
||||||
<div class="search">
|
<div class="search">
|
||||||
<Card>
|
<Card>
|
||||||
<Form
|
<Form ref="searchForm" :model="searchForm" inline :label-width="70" class="search-form">
|
||||||
ref="searchForm"
|
|
||||||
:model="searchForm"
|
|
||||||
inline
|
|
||||||
:label-width="70"
|
|
||||||
class="search-form"
|
|
||||||
>
|
|
||||||
<Form-item label="活动名称">
|
<Form-item label="活动名称">
|
||||||
<Input
|
<Input type="text" v-model="searchForm.promotionName" placeholder="请输入活动名称" clearable style="width: 200px" />
|
||||||
type="text"
|
|
||||||
v-model="searchForm.promotionName"
|
|
||||||
placeholder="请输入活动名称"
|
|
||||||
clearable
|
|
||||||
style="width: 200px"
|
|
||||||
/>
|
|
||||||
</Form-item>
|
</Form-item>
|
||||||
<Form-item label="活动状态" prop="promotionStatus">
|
<Form-item label="活动状态" prop="promotionStatus">
|
||||||
<Select
|
<Select v-model="searchForm.promotionStatus" placeholder="请选择" clearable style="width: 200px">
|
||||||
v-model="searchForm.promotionStatus"
|
|
||||||
placeholder="请选择"
|
|
||||||
clearable
|
|
||||||
style="width: 200px"
|
|
||||||
>
|
|
||||||
<Option value="NEW">未开始</Option>
|
<Option value="NEW">未开始</Option>
|
||||||
<Option value="START">已开始/上架</Option>
|
<Option value="START">已开始/上架</Option>
|
||||||
<Option value="END">已结束/下架</Option>
|
<Option value="END">已结束/下架</Option>
|
||||||
|
@ -31,13 +14,7 @@
|
||||||
</Select>
|
</Select>
|
||||||
</Form-item>
|
</Form-item>
|
||||||
<Form-item label="活动时间">
|
<Form-item label="活动时间">
|
||||||
<DatePicker
|
<DatePicker v-model="selectDate" type="daterange" clearable placeholder="选择起始时间" style="width: 200px">
|
||||||
v-model="selectDate"
|
|
||||||
type="daterange"
|
|
||||||
clearable
|
|
||||||
placeholder="选择起始时间"
|
|
||||||
style="width: 200px"
|
|
||||||
>
|
|
||||||
</DatePicker>
|
</DatePicker>
|
||||||
</Form-item>
|
</Form-item>
|
||||||
<Form-item>
|
<Form-item>
|
||||||
|
@ -60,54 +37,21 @@
|
||||||
</template>
|
</template>
|
||||||
<template slot-scope="{ row }" slot="action">
|
<template slot-scope="{ row }" slot="action">
|
||||||
<div>
|
<div>
|
||||||
<Button
|
<Button type="primary" v-if="row.promotionStatus == 'NEW'" size="small" @click="edit(row)">编辑</Button>
|
||||||
type="primary"
|
|
||||||
v-if="row.promotionStatus == 'NEW'"
|
|
||||||
size="small"
|
|
||||||
@click="edit(row)"
|
|
||||||
>编辑</Button
|
|
||||||
>
|
|
||||||
<Button type="info" v-else size="small" @click="edit(row)">查看</Button>
|
<Button type="info" v-else size="small" @click="edit(row)">查看</Button>
|
||||||
<Button
|
<Button type="success" v-if="row.promotionStatus === 'START'" style="margin-left: 5px" size="small"
|
||||||
type="success"
|
@click="openOrClose(row)">关闭</Button>
|
||||||
v-if="row.promotionStatus === 'START'"
|
<Button type="success" v-if="row.promotionStatus === 'CLOSE'" style="margin-left: 5px" size="small"
|
||||||
style="margin-left: 5px"
|
@click="openOrClose(row)">开启</Button>
|
||||||
size="small"
|
<Button type="error" :disabled="row.promotionStatus == 'START'" style="margin-left: 5px" size="small"
|
||||||
@click="openOrClose(row)"
|
@click="del(row)">删除</Button>
|
||||||
>关闭</Button
|
|
||||||
>
|
|
||||||
<Button
|
|
||||||
type="success"
|
|
||||||
v-if="row.promotionStatus === 'CLOSE'"
|
|
||||||
style="margin-left: 5px"
|
|
||||||
size="small"
|
|
||||||
@click="openOrClose(row)"
|
|
||||||
>开启</Button
|
|
||||||
>
|
|
||||||
<Button
|
|
||||||
type="error"
|
|
||||||
:disabled="row.promotionStatus == 'START'"
|
|
||||||
style="margin-left: 5px"
|
|
||||||
size="small"
|
|
||||||
@click="del(row)"
|
|
||||||
>删除</Button
|
|
||||||
>
|
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
</Table>
|
</Table>
|
||||||
<Row type="flex" justify="end" class="page operation">
|
<Row type="flex" justify="end" class="page operation">
|
||||||
<Page
|
<Page :current="searchForm.pageNumber" :total="total" :page-size="searchForm.pageSize" @on-change="changePage"
|
||||||
:current="searchForm.pageNumber"
|
@on-page-size-change="changePageSize" :page-size-opts="[10, 20, 50]" size="small" show-total show-elevator
|
||||||
:total="total"
|
show-sizer></Page>
|
||||||
:page-size="searchForm.pageSize"
|
|
||||||
@on-change="changePage"
|
|
||||||
@on-page-size-change="changePageSize"
|
|
||||||
:page-size-opts="[10, 20, 50]"
|
|
||||||
size="small"
|
|
||||||
show-total
|
|
||||||
show-elevator
|
|
||||||
show-sizer
|
|
||||||
></Page>
|
|
||||||
</Row>
|
</Row>
|
||||||
</Card>
|
</Card>
|
||||||
</div>
|
</div>
|
||||||
|
@ -120,7 +64,7 @@ import {
|
||||||
} from "@/api/promotion.js";
|
} from "@/api/promotion.js";
|
||||||
export default {
|
export default {
|
||||||
name: "full-cut",
|
name: "full-cut",
|
||||||
data() {
|
data () {
|
||||||
return {
|
return {
|
||||||
total: 0,
|
total: 0,
|
||||||
selectDate: [],
|
selectDate: [],
|
||||||
|
@ -198,31 +142,31 @@ export default {
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
// 改变页码
|
// 改变页码
|
||||||
newAct() {
|
newAct () {
|
||||||
this.$router.push({ name: "full-discount-detail" });
|
this.$router.push({ name: "full-discount-detail" });
|
||||||
},
|
},
|
||||||
// 初始化数据
|
// 初始化数据
|
||||||
init() {
|
init () {
|
||||||
this.getDataList();
|
this.getDataList();
|
||||||
},
|
},
|
||||||
// 改变页数
|
// 改变页数
|
||||||
changePage(v) {
|
changePage (v) {
|
||||||
this.searchForm.pageNumber = v;
|
this.searchForm.pageNumber = v;
|
||||||
this.getDataList();
|
this.getDataList();
|
||||||
},
|
},
|
||||||
// 改变页码
|
// 改变页码
|
||||||
changePageSize(v) {
|
changePageSize (v) {
|
||||||
this.searchForm.pageSize = v;
|
this.searchForm.pageSize = v;
|
||||||
this.getDataList();
|
this.getDataList();
|
||||||
},
|
},
|
||||||
// 搜索
|
// 搜索
|
||||||
handleSearch() {
|
handleSearch () {
|
||||||
this.searchForm.pageNumber = 1;
|
this.searchForm.pageNumber = 1;
|
||||||
this.searchForm.pageSize = 10;
|
this.searchForm.pageSize = 10;
|
||||||
this.getDataList();
|
this.getDataList();
|
||||||
},
|
},
|
||||||
// 重置
|
// 重置
|
||||||
handleReset() {
|
handleReset () {
|
||||||
this.selectDate = "";
|
this.selectDate = "";
|
||||||
this.searchForm = {};
|
this.searchForm = {};
|
||||||
this.searchForm.pageNumber = 1;
|
this.searchForm.pageNumber = 1;
|
||||||
|
@ -230,11 +174,11 @@ export default {
|
||||||
this.getDataList();
|
this.getDataList();
|
||||||
},
|
},
|
||||||
// 编辑
|
// 编辑
|
||||||
edit(row) {
|
edit (row) {
|
||||||
this.$router.push({ name: "full-discount-detail", query: { id: row.id } });
|
this.$router.push({ name: "full-discount-detail", query: { id: row.id } });
|
||||||
},
|
},
|
||||||
// 删除
|
// 删除
|
||||||
del(row) {
|
del (row) {
|
||||||
this.$Modal.confirm({
|
this.$Modal.confirm({
|
||||||
title: "提示",
|
title: "提示",
|
||||||
// 记得确认修改此处
|
// 记得确认修改此处
|
||||||
|
@ -253,7 +197,7 @@ export default {
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
// 开启或关闭活动
|
// 开启或关闭活动
|
||||||
openOrClose(row) {
|
openOrClose (row) {
|
||||||
let name = "开启";
|
let name = "开启";
|
||||||
let status = "START";
|
let status = "START";
|
||||||
if (row.promotionStatus === "START") {
|
if (row.promotionStatus === "START") {
|
||||||
|
@ -325,7 +269,7 @@ export default {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
// 获取列表数据
|
// 获取列表数据
|
||||||
getDataList() {
|
getDataList () {
|
||||||
this.loading = true;
|
this.loading = true;
|
||||||
if (this.selectDate && this.selectDate[0] && this.selectDate[1]) {
|
if (this.selectDate && this.selectDate[0] && this.selectDate[1]) {
|
||||||
this.searchForm.startTime = this.selectDate[0].getTime();
|
this.searchForm.startTime = this.selectDate[0].getTime();
|
||||||
|
@ -343,17 +287,19 @@ export default {
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted () {
|
||||||
this.init();
|
this.init();
|
||||||
},
|
},
|
||||||
// 页面缓存处理,从该页面离开时,修改KeepAlive为false,保证进入该页面是刷新
|
// 页面缓存处理,从该页面离开时,修改KeepAlive为false,保证进入该页面是刷新
|
||||||
beforeRouteLeave(to, from, next) {
|
beforeRouteLeave (to, from, next) {
|
||||||
from.meta.keepAlive = false;
|
from.meta.keepAlive = false;
|
||||||
next();
|
next();
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
|
@import "@/styles/table-common.scss";
|
||||||
|
|
||||||
.operation {
|
.operation {
|
||||||
margin: 10px 0;
|
margin: 10px 0;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue