调整页面布局

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

@ -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>
@ -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: [], //

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",