|
@@ -6,7 +6,7 @@
|
|
<div class="base-info-form">
|
|
<div class="base-info-form">
|
|
<el-form :model="form" :rules="rules" ref="form" label-width="100px">
|
|
<el-form :model="form" :rules="rules" ref="form" label-width="100px">
|
|
<el-form-item label="盲票类型" prop="type">
|
|
<el-form-item label="盲票类型" prop="type">
|
|
- <el-radio-group v-model="form.type" size="small" :disabled="form.disabled">
|
|
|
|
|
|
+ <el-radio-group v-model="form.type" size="small" :disabled="form.disabled" @change="$refs['form'].clearValidate()">
|
|
<el-radio label="online">线上盲票</el-radio>
|
|
<el-radio label="online">线上盲票</el-radio>
|
|
<el-radio label="offline">线下盲票</el-radio>
|
|
<el-radio label="offline">线下盲票</el-radio>
|
|
</el-radio-group>
|
|
</el-radio-group>
|
|
@@ -24,6 +24,7 @@
|
|
v-model="ticketPicUrl"
|
|
v-model="ticketPicUrl"
|
|
:limit="1"
|
|
:limit="1"
|
|
:file-size="0.2"
|
|
:file-size="0.2"
|
|
|
|
+ @change="$refs.form.validateField(['picUrl'])"
|
|
/>
|
|
/>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
<div class="tip">
|
|
<div class="tip">
|
|
@@ -96,6 +97,34 @@
|
|
<div class="tip">
|
|
<div class="tip">
|
|
例如:一张盲票用户支付10元,盲票佣金系数90%,经销商佣金比例20%,那么经销商佣金为10元*90%*20%=1.8元
|
|
例如:一张盲票用户支付10元,盲票佣金系数90%,经销商佣金比例20%,那么经销商佣金为10元*90%*20%=1.8元
|
|
</div>
|
|
</div>
|
|
|
|
+ <el-form-item label="销售范围" prop="saleChannelType" v-if="form.type == 'offline'">
|
|
|
|
+ <el-radio-group v-model="form.saleChannelType" size="small" @change="$refs['form'].clearValidate()">
|
|
|
|
+ <el-radio :label="1">所有渠道</el-radio>
|
|
|
|
+ <el-radio :label="2">指定渠道</el-radio>
|
|
|
|
+ </el-radio-group>
|
|
|
|
+ </el-form-item>
|
|
|
|
+ <el-form-item label="渠道" prop="channelIdList" v-if="form.saleChannelType == 2">
|
|
|
|
+ <el-select
|
|
|
|
+ v-model="form.channelIdList"
|
|
|
|
+ placeholder="请选择渠道"
|
|
|
|
+ style="width: 240px;"
|
|
|
|
+ filterable
|
|
|
|
+ clearable
|
|
|
|
+ multiple
|
|
|
|
+ >
|
|
|
|
+ <el-option
|
|
|
|
+ v-for="(item, index) in channelList"
|
|
|
|
+ :key="index"
|
|
|
|
+ :label="item.name"
|
|
|
|
+ :value="item.channelId">
|
|
|
|
+ <div>
|
|
|
|
+ <span style="float: left;">{{item.name}} </span>
|
|
|
|
+ <span style="float: right;">{{item.mobile}}</span>
|
|
|
|
+ </div>
|
|
|
|
+ </el-option>
|
|
|
|
+ </el-select>
|
|
|
|
+ </el-form-item>
|
|
|
|
+ <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" >奖级设置</div>
|
|
@@ -117,6 +146,8 @@
|
|
<goods-add :dialog-visible="goodsTableVisible" @close="close" @confirmGoods="confirmGoods" v-if="goodsTableVisible" />
|
|
<goods-add :dialog-visible="goodsTableVisible" @close="close" @confirmGoods="confirmGoods" v-if="goodsTableVisible" />
|
|
<!-- 添加券 -->
|
|
<!-- 添加券 -->
|
|
<coupon-add :dialog-visible="couponTableVisible" @close="close" @confirmCoupon="confirmCoupon" v-if="couponTableVisible" />
|
|
<coupon-add :dialog-visible="couponTableVisible" @close="close" @confirmCoupon="confirmCoupon" v-if="couponTableVisible" />
|
|
|
|
+ <!-- 添加券包 -->
|
|
|
|
+ <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" />
|
|
</div>
|
|
</div>
|
|
@@ -125,10 +156,12 @@
|
|
import { publicFileGetUrl } from "@/api/common";
|
|
import { publicFileGetUrl } from "@/api/common";
|
|
import CustomFieldsMixin from "@/mixins/CustomFields";
|
|
import CustomFieldsMixin from "@/mixins/CustomFields";
|
|
import { ticketBoxCreate, setListDetail, ticketBoxDetail} from "@/api/business/ticket";
|
|
import { ticketBoxCreate, setListDetail, ticketBoxDetail} from "@/api/business/ticket";
|
|
|
|
+import { listAllChannel} from "@/api/admin/channel";
|
|
import { accMul, accDiv } from "@/utils/util";
|
|
import { accMul, accDiv } from "@/utils/util";
|
|
import AwardsList from "./components/AwardsList"
|
|
import AwardsList from "./components/AwardsList"
|
|
import GoodsAdd from "./components/GoodsAdd"
|
|
import GoodsAdd from "./components/GoodsAdd"
|
|
import CouponAdd from "./components/CouponAdd"
|
|
import CouponAdd from "./components/CouponAdd"
|
|
|
|
+import CouponPkgAdd from "./components/CouponPkgAdd"
|
|
import CoinAdd from "./components/CoinAdd"
|
|
import CoinAdd from "./components/CoinAdd"
|
|
export default {
|
|
export default {
|
|
name: "TicketCreate",
|
|
name: "TicketCreate",
|
|
@@ -137,6 +170,7 @@ export default {
|
|
AwardsList,
|
|
AwardsList,
|
|
GoodsAdd,
|
|
GoodsAdd,
|
|
CouponAdd,
|
|
CouponAdd,
|
|
|
|
+ CouponPkgAdd,
|
|
CoinAdd,
|
|
CoinAdd,
|
|
},
|
|
},
|
|
data() {
|
|
data() {
|
|
@@ -153,8 +187,11 @@ export default {
|
|
pkgUnit: 200, // 张数
|
|
pkgUnit: 200, // 张数
|
|
pkgSalePrice: 0, // 单价
|
|
pkgSalePrice: 0, // 单价
|
|
saleCommRate: "", // 基数
|
|
saleCommRate: "", // 基数
|
|
- disabled:false,
|
|
|
|
|
|
+ disabled: false,
|
|
|
|
+ saleChannelType: 1
|
|
},
|
|
},
|
|
|
|
+ // 上级渠道列表
|
|
|
|
+ channelList:[],
|
|
rules: {
|
|
rules: {
|
|
type: [
|
|
type: [
|
|
{ required: true, message: "请选择盲票类型", trigger: "change" },
|
|
{ required: true, message: "请选择盲票类型", trigger: "change" },
|
|
@@ -166,7 +203,7 @@ export default {
|
|
{
|
|
{
|
|
required: true,
|
|
required: true,
|
|
message: "请上传盲票图片",
|
|
message: "请上传盲票图片",
|
|
- trigger: "change",
|
|
|
|
|
|
+ trigger: ["blur", "change"],
|
|
},
|
|
},
|
|
],
|
|
],
|
|
facePrice: [
|
|
facePrice: [
|
|
@@ -221,6 +258,12 @@ export default {
|
|
trigger: ["blur", "change"],
|
|
trigger: ["blur", "change"],
|
|
},
|
|
},
|
|
],
|
|
],
|
|
|
|
+ saleChannelType: [
|
|
|
|
+ { required: true, message: "请选择销售范围", trigger: "change" },
|
|
|
|
+ ],
|
|
|
|
+ channelIdList: [
|
|
|
|
+ { required: true, message: "请选择渠道", trigger: "change" },
|
|
|
|
+ ],
|
|
},
|
|
},
|
|
|
|
|
|
// 奖级列表
|
|
// 奖级列表
|
|
@@ -228,6 +271,7 @@ export default {
|
|
goodsTableVisible: false, // 添加商品弹框
|
|
goodsTableVisible: false, // 添加商品弹框
|
|
couponTitle: "", // 券名称
|
|
couponTitle: "", // 券名称
|
|
couponTableVisible: false, // 添加卡券弹框
|
|
couponTableVisible: false, // 添加卡券弹框
|
|
|
|
+ couponPkgTableVisible: false, // 添加券包弹框
|
|
coinTableVisible: false, // 添加盲豆弹框
|
|
coinTableVisible: false, // 添加盲豆弹框
|
|
pageParams: {
|
|
pageParams: {
|
|
pageNum: 1,
|
|
pageNum: 1,
|
|
@@ -250,14 +294,22 @@ export default {
|
|
}
|
|
}
|
|
},
|
|
},
|
|
created() {
|
|
created() {
|
|
|
|
+ this.getChannelList()
|
|
if (this.id) {
|
|
if (this.id) {
|
|
let data = {
|
|
let data = {
|
|
boxId: this.id
|
|
boxId: this.id
|
|
}
|
|
}
|
|
ticketBoxDetail(data).then(res => {
|
|
ticketBoxDetail(data).then(res => {
|
|
- const { awardsList, type, title, picUrl,facePrice, salePrice, quantity, pkgUnit, pkgSalePrice, saleCommRate } = res.data
|
|
|
|
- this.form = { type: JSON.parse(type).value, disabled:true,
|
|
|
|
- title, picUrl, facePrice:accDiv(facePrice, 100), salePrice:accDiv(salePrice, 100), quantity, pkgUnit, pkgSalePrice:accDiv(pkgSalePrice, 100), saleCommRate }
|
|
|
|
|
|
+ const { awardsList, type, title, picUrl, facePrice, salePrice, quantity, pkgUnit, pkgSalePrice, saleCommRate, saleChannelType, channelList } = res.data
|
|
|
|
+ this.form = {
|
|
|
|
+ disabled:true,
|
|
|
|
+ title, picUrl, quantity, pkgUnit, saleCommRate, saleChannelType,
|
|
|
|
+ channelIdList: channelList.map(item => item.channelId),
|
|
|
|
+ type: JSON.parse(type).value,
|
|
|
|
+ facePrice:accDiv(facePrice, 100),
|
|
|
|
+ salePrice:accDiv(salePrice, 100),
|
|
|
|
+ pkgSalePrice:accDiv(pkgSalePrice, 100)
|
|
|
|
+ }
|
|
if(awardsList){
|
|
if(awardsList){
|
|
awardsList.forEach((item) => {
|
|
awardsList.forEach((item) => {
|
|
item.isEdit = true,
|
|
item.isEdit = true,
|
|
@@ -275,6 +327,12 @@ export default {
|
|
}
|
|
}
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
|
|
+ // 获取上级渠道下拉列表
|
|
|
|
+ getChannelList(){
|
|
|
|
+ listAllChannel().then(response => {
|
|
|
|
+ this.channelList = response.data || [];
|
|
|
|
+ });
|
|
|
|
+ },
|
|
|
|
|
|
// 保存
|
|
// 保存
|
|
submitForm() {
|
|
submitForm() {
|
|
@@ -291,6 +349,10 @@ export default {
|
|
// );
|
|
// );
|
|
// return;
|
|
// return;
|
|
// }
|
|
// }
|
|
|
|
+ if (this.form.quantity > 100000) {
|
|
|
|
+ this.$message.error("盲票数量超出限制,请重新填写!");
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
|
|
let prizeIndex = this.awardsList.findIndex((item) => {
|
|
let prizeIndex = this.awardsList.findIndex((item) => {
|
|
return !item.prizeList.length && item.quantity > 0;
|
|
return !item.prizeList.length && item.quantity > 0;
|
|
@@ -327,7 +389,7 @@ export default {
|
|
item.prizeList = item.prizeList.map((ele) => {
|
|
item.prizeList = item.prizeList.map((ele) => {
|
|
return {
|
|
return {
|
|
...ele,
|
|
...ele,
|
|
- refId: ele.goodsId || ele.couponId,
|
|
|
|
|
|
+ refId: ele.goodsId || ele.couponId || ele.id,
|
|
prizeType: ele.prizeType,
|
|
prizeType: ele.prizeType,
|
|
quantity: ele.quantity,
|
|
quantity: ele.quantity,
|
|
value: Number(ele.coinValue),
|
|
value: Number(ele.coinValue),
|
|
@@ -364,7 +426,6 @@ export default {
|
|
background: "rgba(0, 0, 0, 0.4)",
|
|
background: "rgba(0, 0, 0, 0.4)",
|
|
});
|
|
});
|
|
|
|
|
|
-
|
|
|
|
request(data)
|
|
request(data)
|
|
.then((res) => {
|
|
.then((res) => {
|
|
loading.close();
|
|
loading.close();
|
|
@@ -388,6 +449,7 @@ export default {
|
|
close() {
|
|
close() {
|
|
this.goodsTableVisible = false;
|
|
this.goodsTableVisible = false;
|
|
this.couponTableVisible = false;
|
|
this.couponTableVisible = false;
|
|
|
|
+ this.couponPkgTableVisible = false;
|
|
this.coinTableVisible = false;
|
|
this.coinTableVisible = false;
|
|
},
|
|
},
|
|
|
|
|
|
@@ -397,6 +459,8 @@ export default {
|
|
this.goodsTableVisible = true;
|
|
this.goodsTableVisible = true;
|
|
} else if (e == "coupon") {
|
|
} else if (e == "coupon") {
|
|
this.couponTableVisible = true;
|
|
this.couponTableVisible = true;
|
|
|
|
+ } else if (e == "coupon_pkg") {
|
|
|
|
+ this.couponPkgTableVisible = true;
|
|
} else if (e == "coin") {
|
|
} else if (e == "coin") {
|
|
this.coinTableVisible = true;
|
|
this.coinTableVisible = true;
|
|
}
|
|
}
|
|
@@ -412,6 +476,11 @@ export default {
|
|
this.$refs.awards.add(1, arr)
|
|
this.$refs.awards.add(1, arr)
|
|
},
|
|
},
|
|
|
|
|
|
|
|
+ // 确认选中券包
|
|
|
|
+ confirmCouponPkg(arr) {;
|
|
|
|
+ this.$refs.awards.add(1, arr)
|
|
|
|
+ },
|
|
|
|
+
|
|
// 确认输入盲豆
|
|
// 确认输入盲豆
|
|
confirmCoin(obj) {
|
|
confirmCoin(obj) {
|
|
this.$refs.awards.add(2, obj)
|
|
this.$refs.awards.add(2, obj)
|