|
@@ -149,9 +149,14 @@
|
|
|
<el-input-number v-model="newspaperForm.with_addon_price_org" :min="0" size="small" :precision="2" class="personal-ceil"></el-input-number>
|
|
|
<span class="prepend">¥</span>
|
|
|
<span class="append">元</span>
|
|
|
- <p class="tips">  </p>
|
|
|
</el-form-item>
|
|
|
- <el-form-item label="优惠价格" prop="with_addon_price_sell" class="price-box" :key="'with_addon_price_1'">
|
|
|
+ <el-form-item label="优惠价格" prop="has_discount_addon">
|
|
|
+ <el-radio-group v-model="newspaperForm.has_discount_addon">
|
|
|
+ <el-radio :label="0">没有</el-radio>
|
|
|
+ <el-radio :label="1">有</el-radio>
|
|
|
+ </el-radio-group>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="优惠价格" prop="with_addon_price_sell" class="price-box" v-if="newspaperForm.has_discount_addon===1">
|
|
|
<el-input-number v-model="newspaperForm.with_addon_price_sell" :min="0" size="small" :precision="2" class="personal-ceil"></el-input-number>
|
|
|
<span class="prepend">¥</span>
|
|
|
<span class="append">元</span>
|
|
@@ -165,9 +170,14 @@
|
|
|
<el-input-number v-model="newspaperForm.iss_price_org" :min="0" size="small" :precision="2" class="personal-ceil"></el-input-number>
|
|
|
<span class="prepend">¥</span>
|
|
|
<span class="append">元</span>
|
|
|
- <p class="tips">  </p>
|
|
|
</el-form-item>
|
|
|
- <el-form-item label="优惠价格" prop="iss_price_sell" class="price-box" :key="'iss_price_1'">
|
|
|
+ <el-form-item label="优惠价格" prop="has_discount">
|
|
|
+ <el-radio-group v-model="newspaperForm.has_discount">
|
|
|
+ <el-radio :label="0">没有</el-radio>
|
|
|
+ <el-radio :label="1">有</el-radio>
|
|
|
+ </el-radio-group>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="优惠价格" prop="iss_price_sell" class="price-box" v-if="newspaperForm.has_discount===1">
|
|
|
<el-input-number v-model="newspaperForm.iss_price_sell" :min="0" size="small" :precision="2" class="personal-ceil"></el-input-number>
|
|
|
<span class="prepend">¥</span>
|
|
|
<span class="append">元</span>
|
|
@@ -234,7 +244,7 @@ export default {
|
|
|
if (price!==undefined&¤tPrice!==undefined) {
|
|
|
if(price===0&&rule.fullField==='price'){
|
|
|
callback(new Error('原价需大于0'));
|
|
|
- }else if(currentPrice>=price){
|
|
|
+ }else if(currentPrice>=price&&this.newspaperForm.has_discount){
|
|
|
callback(new Error('优惠价格必须低于原价'));
|
|
|
}else{
|
|
|
callback();
|
|
@@ -254,7 +264,7 @@ export default {
|
|
|
if (price!==undefined&¤tPrice!==undefined) {
|
|
|
if(price===0&&rule.fullField==='price'){
|
|
|
callback(new Error('原价需大于0'));
|
|
|
- }else if(currentPrice>=price){
|
|
|
+ }else if(currentPrice>=price&&this.newspaperForm.has_discount_addon){
|
|
|
callback(new Error('优惠价格必须低于原价'));
|
|
|
}else{
|
|
|
callback();
|
|
@@ -309,7 +319,9 @@ export default {
|
|
|
iss_price_org: null,
|
|
|
iss_price_sell: null,
|
|
|
with_addon_price_org: null,
|
|
|
- with_addon_price_sell: null
|
|
|
+ with_addon_price_sell: null,
|
|
|
+ has_discount: 1,
|
|
|
+ has_discount_addon: 1
|
|
|
},
|
|
|
rulesNewspaper:{
|
|
|
iss_name:[
|
|
@@ -498,9 +510,9 @@ export default {
|
|
|
study_phase: form.study_phase,
|
|
|
vl_id: form.vl_id,
|
|
|
iss_price_org: form.iss_price_org,
|
|
|
- iss_price_sell: form.iss_price_sell,
|
|
|
+ iss_price_sell: this.newspaperForm.has_discount===1?form.iss_price_sell:form.iss_price_org,
|
|
|
with_addon_price_org: form.with_addon_price_org,
|
|
|
- with_addon_price_sell: form.with_addon_price_sell,
|
|
|
+ with_addon_price_sell: this.newspaperForm.has_discount_addon===1?form.with_addon_price_sell:form.with_addon_price_org,
|
|
|
iss_note: form.iss_note,
|
|
|
info_tag_data: form.info_tag_data,
|
|
|
chn_data: JSON.parse(form.chn_data),
|
|
@@ -547,6 +559,16 @@ export default {
|
|
|
this.newspaperForm.cover_image_list.push[{
|
|
|
id: res.data.iss_cover_id
|
|
|
}]
|
|
|
+ if(res.data.iss_price_org===res.data.iss_price_sell){
|
|
|
+ this.$set(this.newspaperForm,'has_discount',0)
|
|
|
+ }else{
|
|
|
+ this.$set(this.newspaperForm,'has_discount',1)
|
|
|
+ }
|
|
|
+ if(res.data.with_addon_price_org===res.data.with_addon_price_sell){
|
|
|
+ this.$set(this.newspaperForm,'has_discount_addon',0)
|
|
|
+ }else{
|
|
|
+ this.$set(this.newspaperForm,'has_discount_addon',1)
|
|
|
+ }
|
|
|
}
|
|
|
})
|
|
|
.catch(() => {
|