调整页面布局

master
Chopper 2021-05-17 08:58:35 +08:00
parent 3b37178cfe
commit cd86e1de22
4 changed files with 100 additions and 70 deletions

View File

@ -2,7 +2,7 @@
<div class="search"> <div class="search">
<Card> <Card>
<Row> <Row>
<Form ref="searchForm" :model="searchForm" inline :label-width="70" class="search-form" > <Form ref="searchForm" :model="searchForm" inline :label-width="70" class="search-form">
<Form-item label="活动名称" prop="couponName"> <Form-item label="活动名称" prop="couponName">
<Input <Input
type="text" type="text"
@ -39,7 +39,7 @@
</Row> </Row>
<Row class="operation padding-row"> <Row class="operation padding-row">
<Button @click="add" type="primary">添加</Button> <Button @click="add" type="primary">添加</Button>
<Button @click="delAll" >批量下</Button> <Button @click="delAll"></Button>
<!-- <Button @click="upAll" >批量上架</Button> --> <!-- <Button @click="upAll" >批量上架</Button> -->
</Row> </Row>
<Row> <Row>
@ -67,7 +67,8 @@
size="small" size="small"
style="margin-right: 10px" style="margin-right: 10px"
@click="edit(row)" @click="edit(row)"
>编辑</Button >编辑
</Button
> >
<Button <Button
v-if="row.promotionStatus === 'START' || row.promotionStatus === 'NEW'" v-if="row.promotionStatus === 'START' || row.promotionStatus === 'NEW'"
@ -75,7 +76,8 @@
size="small" size="small"
style="margin-right: 10px" style="margin-right: 10px"
@click="remove(row)" @click="remove(row)"
>下架</Button >下架
</Button
> >
</template> </template>
</Table> </Table>
@ -128,7 +130,7 @@ export default {
// //
formValidate: { formValidate: {
promotionName: [ promotionName: [
{ required: true, message: "不能为空", trigger: "blur" }, {required: true, message: "不能为空", trigger: "blur"},
], ],
}, },
submitLoading: false, // submitLoading: false, //
@ -153,9 +155,8 @@ export default {
key: "couponName", key: "couponName",
minWidth: 120, minWidth: 120,
tooltip: true tooltip: true
}, }, {
{ title: "面额/折扣",
title: "面额",
key: "price", key: "price",
width: 120, width: 120,
render: (h, params) => { render: (h, params) => {
@ -165,24 +166,19 @@ export default {
this.$options.filters.unitPrice(params.row.price, "¥") this.$options.filters.unitPrice(params.row.price, "¥")
); );
} else { } else {
return h("div"); return h("div", params.row.couponDiscount + "折");
} }
}, },
}, },
{ {
title: "折扣", title: "领取数量/总数量",
key: "couponDiscount",
minWidth: 60
},
{
title: "总数量",
key: "publishNum", key: "publishNum",
width: 100
},
{
title: "领取数量",
key: "receivedNum",
width: 100, width: 100,
render: (h, params) => {
return h(
"div", params.row.receivedNum + "/" + params.row.publishNum)
}
}, },
{ {
title: "优惠券类型", title: "优惠券类型",
@ -217,15 +213,19 @@ export default {
}, },
}, },
{ {
title: "开始时间", title: "活动时间",
key: "startTime",
minWidth: 120, minWidth: 120,
tooltip: true render: (h, params) => {
return h("div", {
domProps:
{innerHTML: params.row.startTime + "<br/>" + params.row.endTime}
});
},
}, },
{ {
title: "状态", title: "状态",
key: "promotionStatus", key: "promotionStatus",
minWidth: 90, minWidth: 100,
fixed: "right", fixed: "right",
render: (h, params) => { render: (h, params) => {
let text = "未知", let text = "未知",
@ -261,7 +261,7 @@ export default {
slot: "action", slot: "action",
align: "center", align: "center",
fixed: "right", fixed: "right",
minWidth: 130 width: 80
}, },
], ],
data: [], // data: [], //
@ -280,14 +280,14 @@ export default {
this.getDataList(); this.getDataList();
}, },
add() { add() {
this.$router.push({ name: "add-platform-coupon" }); this.$router.push({name: "add-platform-coupon"});
}, },
/** 跳转至领取详情页面 */ /** 跳转至领取详情页面 */
receiveInfo(v) { receiveInfo(v) {
this.$router.push({ name: "member-receive-coupon", query: { id: v.id } }); this.$router.push({name: "member-receive-coupon", query: {id: v.id}});
}, },
info(v) { info(v) {
this.$router.push({ name: "platform-coupon-info", query: { id: v.id } }); this.$router.push({name: "platform-coupon-info", query: {id: v.id}});
}, },
changePage(v) { changePage(v) {
this.searchForm.pageNumber = v - 1; this.searchForm.pageNumber = v - 1;
@ -372,7 +372,7 @@ export default {
}); });
}, },
edit(v) { edit(v) {
this.$router.push({ name: "edit-platform-coupon", query: { id: v.id } }); this.$router.push({name: "edit-platform-coupon", query: {id: v.id}});
}, },
remove(v) { remove(v) {
this.$Modal.confirm({ this.$Modal.confirm({
@ -382,7 +382,7 @@ export default {
loading: true, loading: true,
onOk: () => { onOk: () => {
// //
updatePlatformCouponStatus({ couponIds: v.id, promotionStatus: "CLOSE" }) updatePlatformCouponStatus({couponIds: v.id, promotionStatus: "CLOSE"})
.then((res) => { .then((res) => {
this.$Modal.remove(); this.$Modal.remove();
if (res.success) { if (res.success) {
@ -463,5 +463,5 @@ export default {
}; };
</script> </script>
<style lang="scss"> <style lang="scss">
@import "@/styles/table-common.scss"; @import "@/styles/table-common.scss";
</style> </style>

View File

@ -1,7 +1,7 @@
<template> <template>
<div> <div>
<Card> <Card>
<Form ref="form" :model="form" :label-width="120" :rules="formRule"> <Form ref="form" :model="form" :label-width="120">
<div class="base-info-item"> <div class="base-info-item">
<h4>基本信息</h4> <h4>基本信息</h4>
<div class="form-item-view"> <div class="form-item-view">
@ -216,14 +216,19 @@ export default {
}, },
}, },
{ {
title: "库存", title: "图片",
key: "quantity", key: "quantity",
minWidth: 40, minWidth: 40,
}, },
{ {
title: "商品二维码", title: "库存",
slot: "QRCode", key: "quantity",
minWidth: 40,
}, },
// {
// title: "",
// slot: "QRCode",
// },
], ],
options: { options: {
disabledDate(date) { disabledDate(date) {

View File

@ -141,48 +141,94 @@ export default {
type: "selection", type: "selection",
width: 60, width: 60,
align: "center", align: "center",
fixed: "left",
}, },
{ {
title: "活动名称", title: "活动名称",
key: "promotionName", key: "promotionName",
minWidth: 120, minWidth: 120,
fixed: "left",
}, },
{ {
title: "优惠券名称", title: "优惠券名称",
key: "couponName", key: "couponName",
minWidth: 120, minWidth: 120,
tooltip: true
}, {
title: "面额/折扣",
key: "price",
width: 120,
render: (h, params) => {
if (params.row.price) {
return h(
"div",
this.$options.filters.unitPrice(params.row.price, "¥")
);
} else {
return h("div", params.row.couponDiscount + "折");
}
},
},
{
title: "领取数量/总数量",
key: "publishNum",
width: 100,
render: (h, params) => {
return h(
"div", params.row.receivedNum + "/" + params.row.publishNum)
}
}, },
{ {
title: "优惠券类型", title: "优惠券类型",
key: "couponType", key: "couponType",
minWidth: 50, width: 120,
render: (h, params) => { render: (h, params) => {
let text = "未知"; let text = "未知";
if (params.row.couponType == "DISCOUNT") { if (params.row.couponType === "DISCOUNT") {
text = "打折"; text = "打折";
} else if (params.row.couponType == "PRICE") { } else if (params.row.couponType === "PRICE") {
text = "减免现金"; text = "减免现金";
} }
return h("div", [text]); return h("div", [text]);
}, },
}, },
{ {
title: "面额", title: "品类描述",
key: "price", key: "scopeType",
minWidth: 40, width: 100,
render: (h, params) => {
let text = "未知";
if (params.row.scopeType == "ALL") {
text = "全品类";
} else if (params.row.scopeType == "PORTION_GOODS_CATEGORY") {
text = "商品分类";
} else if (params.row.scopeType == "PORTION_SHOP_CATEGORY") {
text = "店铺分类";
} else if (params.row.scopeType == "PORTION_GOODS") {
text = "指定商品";
}
return h("div", [text]);
},
}, },
{ {
title: "折扣", title: "活动时间",
key: "couponDiscount", minWidth: 120,
minWidth: 40, render: (h, params) => {
return h("div", {
domProps:
{innerHTML: params.row.startTime + "<br/>" + params.row.endTime}
});
},
}, },
{ {
title: "状态", title: "状态",
key: "status", key: "promotionStatus",
minWidth: 30, minWidth: 100,
fixed: "right",
render: (h, params) => { render: (h, params) => {
let text = "未知", let text = "未知",
color = "default"; color = "";
if (params.row.promotionStatus == "NEW") { if (params.row.promotionStatus == "NEW") {
text = "未开始"; text = "未开始";
color = "default"; color = "default";
@ -209,29 +255,12 @@ export default {
]); ]);
}, },
}, },
{
title: "品类描述",
key: "scopeType",
minWidth: 120,
render: (h, params) => {
let text = "未知";
if (params.row.scopeType == "ALL") {
text = "全品类";
} else if (params.row.scopeType == "PORTION_GOODS_CATEGORY") {
text = "部分商品分类";
} else if (params.row.scopeType == "PORTION_GOODS") {
text = "指定商品";
} else if (params.row.scopeType == "PORTION_SHOP_CATEGORY") {
text = "部分店铺分类";
}
return h("div", [text]);
},
},
{ {
title: "操作", title: "操作",
slot: "action", slot: "action",
align: "center", align: "center",
width: 200, fixed: "right",
width: 80,
}, },
], ],
data: [], // data: [], //

View File

@ -347,10 +347,6 @@ export default {
key: "quantity", key: "quantity",
minWidth: 40, minWidth: 40,
}, },
{
title: "商品二维码",
slot: "QRCode",
},
{ {
title: "操作", title: "操作",
slot: "action", slot: "action",