优惠卷更改

This commit is contained in:
余同学 2024-11-26 18:03:52 +08:00
parent 99b9851d55
commit 6b95aed059
3 changed files with 85 additions and 29 deletions

View File

@ -9,4 +9,8 @@ export const coupon = {
params: data, params: data,
}); });
}, },
//添加优惠卷
addCoupon: (data) => {
return $http.post(`/merchant-api/coupon/save`, data);
},
}; };

View File

@ -147,13 +147,11 @@ export default {
}); });
}, },
addProduct(row) { addProduct(row) {
this.$refs.addOrUpdate this.$refs.addOrUpdate.toggle().add({
.toggle() ...row,
.add({ marketId: this.formInline.marketId,
...row, shopId: this.formInline.shopId,
marketId: this.formInline.marketId, });
shopId: this.formInline.shopId,
});
}, },
deleteProduct() { deleteProduct() {
console.log(this.selectList); console.log(this.selectList);
@ -202,35 +200,55 @@ export default {
return [ return [
{ type: "checkbox", width: "60px", fixed: "left" }, { type: "checkbox", width: "60px", fixed: "left" },
// { type: "seq", width: "60px", align: "center", title: "" }, // { type: "seq", width: "60px", align: "center", title: "" },
{
title: "店铺",
align: "center",
field: "cardName",
},
{ {
title: "优惠券名称", title: "优惠券名称",
align: "center", align: "center",
field: "cardNo", field: "name",
}, },
{ {
title: "发行方", title: "发行方",
align: "center", align: "center",
field: "telNo", field: "publisher",
type: "jsx",
render: ({ row }) => {
if (row.publisher === "MERCHANT") {
return <span>店铺</span>;
} else if (row.publisher == "PLATFORM") {
return <span>平台</span>;
}
},
}, },
{ {
title: "类别", title: "类别",
align: "center", align: "center",
field: "name", field: "category",
}, type: "jsx",
{ render: ({ row }) => {
title: "领取类型", if (row.category == "NO_THRESHOLD") {
align: "center", return <span>无门槛优惠券</span>;
field: "receiveType", } else if (row.category == "MAX_OUT") {
return <span>满减优惠券</span>;
} else if (row.category == "FIRST_ATTENTION") {
return <span>首次关注优惠券</span>;
} else if (row.category == "BIRTHDAY") {
return <span>生日券</span>;
} else if (row.category == "PLATFORM") {
return <span>平台优惠券</span>;
}
},
}, },
{ {
title: "优惠券类型", title: "优惠券类型",
align: "center", align: "center",
field: "name", field: "couponType",
type: "jsx",
render: ({ row }) => {
if (row.couponType == "MONEY") {
return <span>满减券</span>;
} else if (row.couponType == "DISCOUNT") {
return <span>折扣券</span>;
}
},
}, },
{ {
title: "优惠金额", title: "优惠金额",
@ -247,6 +265,21 @@ export default {
align: "center", align: "center",
field: "minPrice", field: "minPrice",
}, },
{
title: "限量",
align: "center",
field: "limitedNum",
},
{
title: "发放总数",
align: "center",
field: "total",
},
{
title: "剩余数量",
align: "center",
field: "lastTotal",
},
{ {
title: "状态", title: "状态",
align: "center", align: "center",
@ -255,7 +288,7 @@ export default {
render: ({ row }) => { render: ({ row }) => {
if (row.status == 0) { if (row.status == 0) {
return <span>关闭</span>; return <span>关闭</span>;
} else if (row.status == 2) { } else if (row.status == 1) {
return <span>开启</span>; return <span>开启</span>;
} }
}, },

View File

@ -29,7 +29,7 @@
> >
</el-date-picker> </el-date-picker>
</el-form-item> </el-form-item>
<el-form-item label-width="150px" label="开领取日期" prop="name"> <el-form-item label-width="150px" label="开领取日期" prop="name">
<el-date-picker <el-date-picker
@change="collectionDateChange" @change="collectionDateChange"
v-model="collectionDate" v-model="collectionDate"
@ -92,7 +92,7 @@
<el-option <el-option
v-for="item in [ v-for="item in [
{ {
label: '', label: '限',
value: 0, value: 0,
}, },
{ {
@ -134,6 +134,7 @@
import commodity from "./commodity.vue"; import commodity from "./commodity.vue";
import { debounce, cloneDeep } from "lodash"; import { debounce, cloneDeep } from "lodash";
import { Divider } from "element-ui"; import { Divider } from "element-ui";
import loginVue from "../../../common/login.vue";
export default { export default {
components: { commodity }, components: { commodity },
data() { data() {
@ -175,7 +176,20 @@ export default {
this.modalConfig.title = `添加${row.label}`; this.modalConfig.title = `添加${row.label}`;
this.$nextTick(() => { this.$nextTick(() => {
this.modalData = { this.modalData = {
category: "NO_THRESHOLD",
receiveType: "MANUAL",
couponType: "MONEY",
isTimeReceive: 1, //0-1-
name: "",
useStartTime: "",
useEndTime: "",
receiveStartTime: "",
receiveEndTime: "",
money: "",
total: 10000, total: 10000,
limitedNum: 0,
minPrice: 0,
usableRange: "PARTIAL_GOODS", //-PARTIAL_GOODS -ALL_GOODS -PARTIAL_SHOP
}; };
this.$refs.modal.resetFields(); this.$refs.modal.resetFields();
}); });
@ -231,11 +245,16 @@ export default {
type: "primary", type: "primary",
handle: () => { handle: () => {
console.log(this.modalData); console.log(this.modalData);
this.$api.mer_admin.bankCardAdd(this.modalData).then((res) => { let data = { ...this.modalData };
console.log(res); data.targetIds = [data.targetIds];
this.$emit("queryList"); console.log(this.modalData, data);
this.toggle(); this.$api.coupon
}); .addCoupon({ ...data, ...this.formInline })
.then((res) => {
console.log(res);
this.$emit("queryList");
this.toggle();
});
}, },
}, },
]; ];