|
@@ -6,7 +6,7 @@
|
|
|
<div class="base-info-form">
|
|
|
<el-form :model="form" :rules="rules" ref="form" label-width="100px">
|
|
|
<el-form-item label="盲票类型" prop="type">
|
|
|
- <el-radio-group v-model="form.type" size="small" :disabled="form.disabled" @change="$refs['form'].clearValidate()">
|
|
|
+ <el-radio-group v-model="form.type" size="small" :disabled="form.disabled" @change="$refs['form'].clearValidate();changeType($event)">
|
|
|
<el-radio label="online">线上盲票</el-radio>
|
|
|
<el-radio label="offline">线下盲票</el-radio>
|
|
|
</el-radio-group>
|
|
@@ -45,6 +45,20 @@
|
|
|
<template slot="append">元</template>
|
|
|
</el-input>
|
|
|
</el-form-item>
|
|
|
+ <el-form-item
|
|
|
+ label="划线价"
|
|
|
+ prop="originPrice"
|
|
|
+ v-if="form.type != 'offline'"
|
|
|
+ >
|
|
|
+ <el-input
|
|
|
+ v-model="form.originPrice"
|
|
|
+ style="width: 240px"
|
|
|
+ size="small"
|
|
|
+ placeholder="请输入划线价"
|
|
|
+ >
|
|
|
+ <template slot="append">元</template>
|
|
|
+ </el-input>
|
|
|
+ </el-form-item>
|
|
|
<el-form-item label="盲票总数" prop="quantity">
|
|
|
<el-input
|
|
|
v-model="form.quantity"
|
|
@@ -184,6 +198,7 @@ export default {
|
|
|
pkgUnit: 200, // 张数
|
|
|
pkgSalePrice: 0, // 单价
|
|
|
saleCommRate: "", // 基数
|
|
|
+ originPrice: 0, //划线价
|
|
|
disabled: false,
|
|
|
saleChannelType: 1
|
|
|
},
|
|
@@ -229,6 +244,11 @@ export default {
|
|
|
trigger: ["blur", "change"],
|
|
|
},
|
|
|
],
|
|
|
+ originPrice: [{
|
|
|
+ pattern: /^([0-9]\d*)$/,
|
|
|
+ message: "请输入合法的数字",
|
|
|
+ trigger: ["blur", "change"],
|
|
|
+ },],
|
|
|
pkgUnit: [
|
|
|
{ required: true, message: "请输入每包张数", trigger: "blur" },
|
|
|
{
|
|
@@ -297,7 +317,7 @@ export default {
|
|
|
boxId: this.id
|
|
|
}
|
|
|
ticketBoxDetail(data).then(res => {
|
|
|
- const { awardsList, type, title, picUrl, facePrice, salePrice, quantity, pkgUnit, pkgSalePrice, saleCommRate, saleChannelType, channelList } = res.data
|
|
|
+ const { awardsList, type, title, picUrl, facePrice, salePrice, quantity, originPrice, pkgUnit, pkgSalePrice, saleCommRate, saleChannelType, channelList } = res.data
|
|
|
this.form = {
|
|
|
disabled:true,
|
|
|
title, picUrl, quantity, pkgUnit, saleCommRate, saleChannelType,
|
|
@@ -305,7 +325,8 @@ export default {
|
|
|
type: JSON.parse(type).value,
|
|
|
facePrice:accDiv(facePrice, 100),
|
|
|
salePrice:accDiv(salePrice, 100),
|
|
|
- pkgSalePrice:accDiv(pkgSalePrice, 100)
|
|
|
+ pkgSalePrice:accDiv(pkgSalePrice, 100),
|
|
|
+ originPrice:accDiv(originPrice, 100)
|
|
|
}
|
|
|
if(awardsList){
|
|
|
awardsList.forEach((item) => {
|
|
@@ -317,6 +338,7 @@ export default {
|
|
|
});
|
|
|
this.$nextTick(() => {
|
|
|
this.$refs.awards.add(3, awardsList)
|
|
|
+ this.$refs.awards.changetype(JSON.parse(type).value)
|
|
|
})
|
|
|
this.awardsList = awardsList
|
|
|
}
|
|
@@ -402,11 +424,27 @@ export default {
|
|
|
return item.quantity != 0;
|
|
|
});
|
|
|
|
|
|
+ for (let i = 0; i < filterArr2.length; i++) {
|
|
|
+ if(filterArr2[i].awardsLabel == "" || filterArr2[i].awardsLabel == undefined){
|
|
|
+ this.$message.error("关联奖级不能为空");
|
|
|
+ return
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (this.form.type == "offline") {
|
|
|
+ this.form.originPrice = null
|
|
|
+ for (let i = 0; i < filterArr2.length; i++) {
|
|
|
+ for (let j = 0; j < filterArr2[i].prizeList; j++) {
|
|
|
+ filterArr2[i].prizeList[j].quantity = null
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
let data = {
|
|
|
...this.form,
|
|
|
facePrice: accMul(this.form.facePrice, 100),
|
|
|
salePrice: accMul(this.form.salePrice, 100),
|
|
|
pkgSalePrice: accMul(this.form.pkgSalePrice, 100),
|
|
|
+ originPrice: accMul(this.form.originPrice, 100),
|
|
|
awardsList: filterArr2,
|
|
|
};
|
|
|
|
|
@@ -450,6 +488,10 @@ export default {
|
|
|
this.coinTableVisible = false;
|
|
|
},
|
|
|
|
|
|
+ changeType(e) {
|
|
|
+ this.$refs.awards.changetype(e)
|
|
|
+ },
|
|
|
+
|
|
|
// 添加奖品种类
|
|
|
handleCommand(e) {
|
|
|
if (e == "goods") {
|