满额活动指定商品功能

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%"
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">
<div>
<a class="mr_10" @click="linkTo(row.goodsId, row.skuId)">{{
@@ -204,6 +208,8 @@
</FormItem>
</Form>
</Card>
<sku-select ref="skuSelect" @selectedGoodsData="selectedGoodsData"></sku-select>
</div>
</template>
@@ -211,11 +217,16 @@
import { getPlatformCouponList, getFullDiscountById, newFullDiscount, editFullDiscount,} from "@/api/promotion";
import { getGoodsSkuData } from "@/api/goods";
import { regular } from "@/utils";
import skuSelect from "@/components/lili-dialog";
import vueQr from "vue-qr";
export default {
name: "add-full-discount",
components: {
"vue-qr": vueQr,
skuSelect,
},
data() {
const checkPrice = (rule, value, callback) => {
@@ -322,6 +333,20 @@ export default {
this.getGiftList();
},
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() {
// 获取活动详情
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) {
// 已选商品批量选择
this.selectedGoods = e;

View File

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

View File

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