满额活动指定商品功能

This commit is contained in:
Yer11214
2024-10-07 17:11:51 +08:00
parent 7cdb8d5456
commit 6e872f0287
3 changed files with 42 additions and 6 deletions

View File

@@ -158,7 +158,11 @@
style="width: 100%" style="width: 100%"
v-if="form.scopeType == 'PORTION_GOODS'" v-if="form.scopeType == 'PORTION_GOODS'"
> >
<Table border :columns="columns" :data="form.promotionGoodsList"> <div style="display: flex; margin-bottom: 10px" v-if="form.promotionStatus == 'NEW'">
<Button type="primary" @click="openSkuList">选择商品</Button>
<Button type="error" ghost style="margin-left: 10px" @click="delSelectGoods">批量删除</Button>
</div>
<Table border :columns="columns" @on-selection-change="changeSelect" :data="form.promotionGoodsList">
<template slot-scope="{ row }" slot="goodsName"> <template slot-scope="{ row }" slot="goodsName">
<div> <div>
<a class="mr_10" @click="linkTo(row.goodsId, row.skuId)">{{ <a class="mr_10" @click="linkTo(row.goodsId, row.skuId)">{{
@@ -204,6 +208,8 @@
</FormItem> </FormItem>
</Form> </Form>
</Card> </Card>
<sku-select ref="skuSelect" @selectedGoodsData="selectedGoodsData"></sku-select>
</div> </div>
</template> </template>
@@ -211,11 +217,16 @@
import { getPlatformCouponList, getFullDiscountById, newFullDiscount, editFullDiscount,} from "@/api/promotion"; import { getPlatformCouponList, getFullDiscountById, newFullDiscount, editFullDiscount,} from "@/api/promotion";
import { getGoodsSkuData } from "@/api/goods"; import { getGoodsSkuData } from "@/api/goods";
import { regular } from "@/utils"; import { regular } from "@/utils";
import skuSelect from "@/components/lili-dialog";
import vueQr from "vue-qr"; import vueQr from "vue-qr";
export default { export default {
name: "add-full-discount", name: "add-full-discount",
components: { components: {
"vue-qr": vueQr, "vue-qr": vueQr,
skuSelect,
}, },
data() { data() {
const checkPrice = (rule, value, callback) => { const checkPrice = (rule, value, callback) => {
@@ -322,6 +333,20 @@ export default {
this.getGiftList(); this.getGiftList();
}, },
methods: { methods: {
changeSelect (e) {
// 已选商品批量选择
this.selectedGoods = e;
},
openSkuList () {
// 显示商品选择器
this.$refs.skuSelect.open("goods");
let data = JSON.parse(JSON.stringify(this.form.promotionGoodsList));
data.forEach((e) => {
e.id = e.skuId;
});
this.$refs.skuSelect.goodsData = data;
},
getDetail() { getDetail() {
// 获取活动详情 // 获取活动详情
getFullDiscountById(this.id).then((res) => { getFullDiscountById(this.id).then((res) => {
@@ -447,6 +472,14 @@ export default {
} }
}); });
}, },
closeCurrentPage () {
this.$store.commit("removeTag", "full-cut-detail");
this.$store.commit("removeTag", "promotions/full-discount");
localStorage.storeOpenedList = JSON.stringify(
this.$store.state.app.storeOpenedList
);
this.$router.go(-1);
},
changeSelect (e) { changeSelect (e) {
// 已选商品批量选择 // 已选商品批量选择
this.selectedGoods = e; this.selectedGoods = e;

View File

@@ -136,11 +136,7 @@ export default {
key: "endTime", key: "endTime",
width: 170, width: 170,
}, },
{
title: "店铺名称",
key: "storeName",
minWidth: 60,
},
{ {
title: "活动类型", title: "活动类型",
slot: "promotionType", slot: "promotionType",

View File

@@ -56,6 +56,9 @@
<Button type="info" size="small" @click="view(row)" style="margin-right: 5px" <Button type="info" size="small" @click="view(row)" style="margin-right: 5px"
>查看</Button >查看</Button
> >
<Button type="default" v-if="row.promotionStatus === 'NEW'" size="small" @click="edit(row)" style="margin-right: 5px"
>编辑</Button
>
<Button <Button
type="error" type="error"
size="small" size="small"
@@ -147,6 +150,10 @@ export default {
}; };
}, },
methods: { methods: {
edit(v){
this.$router.push({ name: 'pintuan-create', query: {id:v.id}})
},
// 初始化数据 // 初始化数据
init() { init() {
this.getDataList(); this.getDataList();