mirror of
https://gitee.com/beijing_hongye_huicheng/lilishop-ui.git
synced 2025-12-23 03:15:54 +08:00
商品选择器回显
This commit is contained in:
@@ -223,7 +223,7 @@ export default {
|
||||
{
|
||||
title: "状态",
|
||||
key: "promotionStatus",
|
||||
minWidth: 100,
|
||||
width: 100,
|
||||
fixed: "right",
|
||||
render: (h, params) => {
|
||||
let text = "未知",
|
||||
@@ -250,9 +250,9 @@ export default {
|
||||
},
|
||||
},
|
||||
text
|
||||
),
|
||||
)
|
||||
]);
|
||||
},
|
||||
}
|
||||
},
|
||||
{
|
||||
title: "操作",
|
||||
|
||||
@@ -114,9 +114,8 @@
|
||||
v-if="form.scopeType == 'PORTION_GOODS'"
|
||||
>
|
||||
<div style="display: flex; margin-bottom: 10px">
|
||||
<Button type="primary" @click="$refs.skuSelect.open('goods')"
|
||||
>选择商品</Button
|
||||
>
|
||||
<Button type="primary" @click="openSkuList"
|
||||
>选择商品</Button>
|
||||
<Button
|
||||
type="error"
|
||||
ghost
|
||||
@@ -466,6 +465,14 @@ export default {
|
||||
name: "coupon",
|
||||
});
|
||||
},
|
||||
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;
|
||||
},
|
||||
changeSelect(e) {
|
||||
// 已选商品批量选择
|
||||
this.selectedGoods = e;
|
||||
@@ -497,15 +504,9 @@ export default {
|
||||
this.form.promotionGoodsList.splice(index, 1);
|
||||
},
|
||||
selectedGoodsData(item) {
|
||||
console.log(item);
|
||||
// 回显已选商品
|
||||
let ids = [];
|
||||
let list = [];
|
||||
this.form.promotionGoodsList.forEach((e) => {
|
||||
ids.push(e.skuId);
|
||||
});
|
||||
item.forEach((e) => {
|
||||
if (!ids.includes(e.id)) {
|
||||
list.push({
|
||||
goodsName: e.goodsName,
|
||||
price: e.price,
|
||||
@@ -515,9 +516,8 @@ export default {
|
||||
sellerName: e.sellerName,
|
||||
skuId: e.id,
|
||||
});
|
||||
}
|
||||
});
|
||||
this.form.promotionGoodsList.push(...list);
|
||||
this.form.promotionGoodsList = list;
|
||||
},
|
||||
getGoodsCategory(e) {
|
||||
// 获取级联选择器商品分类id
|
||||
|
||||
Reference in New Issue
Block a user