|
@@ -156,9 +156,13 @@
|
|
<div class="tip" v-if="form.type == 'offline'">注:盲票只对所选渠道下的门店可见</div>
|
|
<div class="tip" v-if="form.type == 'offline'">注:盲票只对所选渠道下的门店可见</div>
|
|
</el-form>
|
|
</el-form>
|
|
</div>
|
|
</div>
|
|
- <div class="base-info-title" >奖级设置</div>
|
|
|
|
- <!-- 奖级设置 -->
|
|
|
|
|
|
+ <!-- 关联商品设置 -->
|
|
|
|
+ <div class="base-info-title" v-if="form.type != 'offline'">商品设置(购买即可提货)</div>
|
|
|
|
|
|
|
|
+ <award-form ref="awardFrom" @close="close" v-model="goodsList" :id="ids" @goodsCommand="goodsCommand" v-if="form.type != 'offline'"></award-form>
|
|
|
|
+
|
|
|
|
+ <!-- 奖级设置 -->
|
|
|
|
+ <div class="base-info-title" >奖级设置</div>
|
|
<!-- 奖级列表 -->
|
|
<!-- 奖级列表 -->
|
|
<awards-list ref="awards" :id="ids" v-model="awardsList" @handleCommand="handleCommand" @close="close" />
|
|
<awards-list ref="awards" :id="ids" v-model="awardsList" @handleCommand="handleCommand" @close="close" />
|
|
<!-- 保存 -->
|
|
<!-- 保存 -->
|
|
@@ -179,6 +183,8 @@
|
|
<coupon-pkg-add :dialog-visible="couponPkgTableVisible" @close="close" @confirmCouponPkg="confirmCouponPkg" v-if="couponPkgTableVisible" />
|
|
<coupon-pkg-add :dialog-visible="couponPkgTableVisible" @close="close" @confirmCouponPkg="confirmCouponPkg" v-if="couponPkgTableVisible" />
|
|
<!-- 添加盲豆 -->
|
|
<!-- 添加盲豆 -->
|
|
<coin-add :dialog-visible="coinTableVisible" @close="close" @confirmCoin="confirmCoin" v-if="coinTableVisible" />
|
|
<coin-add :dialog-visible="coinTableVisible" @close="close" @confirmCoin="confirmCoin" v-if="coinTableVisible" />
|
|
|
|
+ <!-- 添加商品 -->
|
|
|
|
+ <goods-add-form :dialog-visible="goodsVisibleForm" @close="close" @confirmGoodsForm="confirmGoodsForm" v-if="goodsVisibleForm" ></goods-add-form>
|
|
</div>
|
|
</div>
|
|
</template>
|
|
</template>
|
|
<script>
|
|
<script>
|
|
@@ -193,6 +199,8 @@ import GoodsAdd from "./components/GoodsAdd"
|
|
import CouponAdd from "./components/CouponAdd"
|
|
import CouponAdd from "./components/CouponAdd"
|
|
import CouponPkgAdd from "./components/CouponPkgAdd"
|
|
import CouponPkgAdd from "./components/CouponPkgAdd"
|
|
import CoinAdd from "./components/CoinAdd"
|
|
import CoinAdd from "./components/CoinAdd"
|
|
|
|
+import AwardForm from "./components/AwardForm"
|
|
|
|
+import GoodsAddForm from "./components/GoodsAddForm"
|
|
export default {
|
|
export default {
|
|
name: "TicketCreate",
|
|
name: "TicketCreate",
|
|
mixins: [CustomFieldsMixin],
|
|
mixins: [CustomFieldsMixin],
|
|
@@ -202,7 +210,9 @@ export default {
|
|
CouponAdd,
|
|
CouponAdd,
|
|
CouponPkgAdd,
|
|
CouponPkgAdd,
|
|
CoinAdd,
|
|
CoinAdd,
|
|
- Upload
|
|
|
|
|
|
+ Upload,
|
|
|
|
+ AwardForm,
|
|
|
|
+ GoodsAddForm
|
|
},
|
|
},
|
|
data() {
|
|
data() {
|
|
return {
|
|
return {
|
|
@@ -317,6 +327,8 @@ export default {
|
|
|
|
|
|
// 奖级列表
|
|
// 奖级列表
|
|
awardsList: [],
|
|
awardsList: [],
|
|
|
|
+ //关联商品列表
|
|
|
|
+ goodsList: [],
|
|
goodsTableVisible: false, // 添加商品弹框
|
|
goodsTableVisible: false, // 添加商品弹框
|
|
couponTitle: "", // 券名称
|
|
couponTitle: "", // 券名称
|
|
couponTableVisible: false, // 添加卡券弹框
|
|
couponTableVisible: false, // 添加卡券弹框
|
|
@@ -326,6 +338,7 @@ export default {
|
|
pageNum: 1,
|
|
pageNum: 1,
|
|
pageSize: 10,
|
|
pageSize: 10,
|
|
},
|
|
},
|
|
|
|
+ goodsVisibleForm: false, //添加关联商品弹框
|
|
};
|
|
};
|
|
},
|
|
},
|
|
computed: {
|
|
computed: {
|
|
@@ -349,7 +362,7 @@ export default {
|
|
boxId: this.id
|
|
boxId: this.id
|
|
}
|
|
}
|
|
ticketBoxDetail(data).then(res => {
|
|
ticketBoxDetail(data).then(res => {
|
|
- const { awardsList, type, title, picUrl, facePrice, salePrice, prePrice, quantity, originPrice, pkgUnit, pkgSalePrice, saleCommRate, saleChannelType, channelList } = res.data
|
|
|
|
|
|
+ const { awardsList, goodsList, type, title, picUrl, facePrice, salePrice, prePrice, quantity, originPrice, pkgUnit, pkgSalePrice, saleCommRate, saleChannelType, channelList } = res.data
|
|
this.form = {
|
|
this.form = {
|
|
disabled:true,
|
|
disabled:true,
|
|
title, picUrl, quantity, pkgUnit, saleCommRate, saleChannelType,
|
|
title, picUrl, quantity, pkgUnit, saleCommRate, saleChannelType,
|
|
@@ -375,6 +388,17 @@ export default {
|
|
})
|
|
})
|
|
this.awardsList = awardsList
|
|
this.awardsList = awardsList
|
|
}
|
|
}
|
|
|
|
+ if(goodsList){
|
|
|
|
+ goodsList.forEach((item) => {
|
|
|
|
+ (item.picUrl = publicFileGetUrl + item.picUrl.split(',')[0]),
|
|
|
|
+ // (item.prizeType = JSON.parse(item.prizeType).value);
|
|
|
|
+ (item.prizeType = 'goods');
|
|
|
|
+ });
|
|
|
|
+ this.$nextTick(() => {
|
|
|
|
+ this.$refs.awardFrom.add(goodsList)
|
|
|
|
+ })
|
|
|
|
+ // this.goodsList = goodsList
|
|
|
|
+ }
|
|
})
|
|
})
|
|
}
|
|
}
|
|
},
|
|
},
|
|
@@ -472,6 +496,11 @@ export default {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ if (this.form.type != "offline" && this.goodsList.length < 1) {
|
|
|
|
+ this.$message.error("关联商品不能为空");
|
|
|
|
+ return
|
|
|
|
+ }
|
|
|
|
+
|
|
let data = {
|
|
let data = {
|
|
...this.form,
|
|
...this.form,
|
|
facePrice: accMul(this.form.facePrice, 100),
|
|
facePrice: accMul(this.form.facePrice, 100),
|
|
@@ -480,6 +509,7 @@ export default {
|
|
pkgSalePrice: accMul(this.form.pkgSalePrice, 100),
|
|
pkgSalePrice: accMul(this.form.pkgSalePrice, 100),
|
|
originPrice: accMul(this.form.originPrice, 100),
|
|
originPrice: accMul(this.form.originPrice, 100),
|
|
awardsList: filterArr2,
|
|
awardsList: filterArr2,
|
|
|
|
+ goodsList: this.goodsList
|
|
};
|
|
};
|
|
|
|
|
|
if (this.id){
|
|
if (this.id){
|
|
@@ -520,6 +550,7 @@ export default {
|
|
this.couponTableVisible = false;
|
|
this.couponTableVisible = false;
|
|
this.couponPkgTableVisible = false;
|
|
this.couponPkgTableVisible = false;
|
|
this.coinTableVisible = false;
|
|
this.coinTableVisible = false;
|
|
|
|
+ this.goodsVisibleForm = false;
|
|
},
|
|
},
|
|
|
|
|
|
changeType(e) {
|
|
changeType(e) {
|
|
@@ -538,7 +569,9 @@ export default {
|
|
this.coinTableVisible = true;
|
|
this.coinTableVisible = true;
|
|
}
|
|
}
|
|
},
|
|
},
|
|
-
|
|
|
|
|
|
+ goodsCommand() {
|
|
|
|
+ this.goodsVisibleForm = true;
|
|
|
|
+ },
|
|
// 确认选中商品
|
|
// 确认选中商品
|
|
confirmGoods(arr) {
|
|
confirmGoods(arr) {
|
|
this.$refs.awards.add(1, arr)
|
|
this.$refs.awards.add(1, arr)
|
|
@@ -559,6 +592,11 @@ export default {
|
|
this.$refs.awards.add(2, obj)
|
|
this.$refs.awards.add(2, obj)
|
|
},
|
|
},
|
|
|
|
|
|
|
|
+ //选中的关联商品
|
|
|
|
+ confirmGoodsForm(arr) {
|
|
|
|
+ this.$refs.awardFrom.add(arr)
|
|
|
|
+ },
|
|
|
|
+
|
|
// 取消
|
|
// 取消
|
|
back() {
|
|
back() {
|
|
this.$store.dispatch("tagsView/delView", this.$route);
|
|
this.$store.dispatch("tagsView/delView", this.$route);
|