Commit 0ecd4aa1 by cwq0219

编辑商品-到店价<零售价格

1 parent 099e3ead
......@@ -157,7 +157,7 @@
</el-form>
</div>
<div class="relateProDialog flex">
<span style="width: 180px;">分配给导流方 (4S门店)</span>
<span class="sub-title">分配给导流方 (4S门店)</span>
<el-form
:model="proInfo"
:rules="rules"
......@@ -202,7 +202,7 @@
</el-form>
</div>
<div class="relateProDialog flex">
<span style="width: 180px;">分配给合伙人 (合作商)</span>
<span class="sub-title">分配给合伙人 (合作商)</span>
<el-form
:model="proInfo"
:rules="rules"
......@@ -282,15 +282,15 @@ export default {
},
rules: {
goodsCode: [{ required: true, message: '请选择关联升级商品', trigger: 'change' }],
upgradePrice: [{ required: true, message: '请输入建议升级价', trigger: 'blur' }],
shopPrice: [
{ required: true, message: '请输入到店价', trigger: 'blur' },
{ trigger: 'blur',
upgradePrice: [
{ required: true, message: '请输入建议升级价', trigger: 'blur' },
{ required: true,
trigger: 'change',
validator: (rule, value, callback) => {
(+value > +this.proInfo.upgradePrice) ? callback(new Error('到店价需小于建议升级价格')) : callback()
(+value < +this.proInfo.shopPrice) ? callback(new Error('建议升级价需要大于或等于到店价格')) : callback()
}
}
],
}],
shopPrice: [{ required: true, message: '请输入到店价', trigger: 'blur' }],
profitType: [{ required: true, message: '请输入分润规则', trigger: 'change' }],
profitValue: [{ required: true, message: '请输入分润比例', trigger: 'blur' }],
partnerProfitPer: [{ required: true, message: '请输入分润比例', trigger: 'blur' }]
......@@ -358,6 +358,8 @@ export default {
handleShopPrice(newVal) {
this.proInfo.shopPrice = limitPrice(newVal, this.oldVal.shopPrice, 6, 2)
this.oldVal.shopPrice = this.proInfo.shopPrice
var validateObj = (this.proInfo.shopPrice <= this.proInfo.upgradePrice) ? 'clearValidate' : 'validateField'
this.$refs.proRuleForm1[validateObj]('upgradePrice')
},
handleMaxUpgradeDiscount(newVal) {
this.proInfo.maxUpgradeDiscount = limitPrice(newVal, this.oldVal.maxUpgradeDiscount, 1, 1, 1)
......@@ -391,6 +393,11 @@ export default {
.relateProDialog.flex {
display: flex;
}
.relateProDialog .sub-title {
display: inline-block;
height: 52px;
line-height: 36px;
}
.relateProDialog .w-50 {
display: inline-block;
width: 50%;
......
......@@ -50,11 +50,13 @@ export default {
rules: {
yqMerchantId: [{ required: true, message: '请选择园区店', trigger: 'change' }],
goodsCode: [{ required: true, message: '请选择产品名称', trigger: 'change' }],
shopPrice: [
{ required: true, message: '请输入到店价', trigger: 'blur' },
{ trigger: 'blur',
shopPrice: [{ required: true, message: '请输入到店价', trigger: 'blur' }],
retailPrice: [
{ required: true, message: '请输入零售价格', trigger: 'blur' },
{ required: true,
trigger: 'change',
validator: (rule, value, callback) => {
(+value > +this.markOldVal.retailPrice) ? callback(new Error('到店价需小于建议升级价')) : callback()
(+value < +this.markOldVal.shopPrice) ? callback(new Error('配置零售价格需要大于或等于到店价格')) : callback()
}
}
],
......@@ -99,6 +101,8 @@ export default {
handleInput: (newVal) => {
this.$refs.d2Form.formData.shopPrice = limitPrice(newVal, this.markOldVal.shopPrice, 6, 2)
this.markOldVal.shopPrice = this.$refs.d2Form.formData.shopPrice
var validateObj = (this.markOldVal.shopPrice <= this.markOldVal.retailPrice) ? 'clearValidate' : 'validateField'
this.$refs.d2Form.$refs[this.comFormRef + 'd2FormRuleForm'][validateObj]('retailPrice')
}
}, {
name: 'retailPrice',
......@@ -164,6 +168,7 @@ export default {
}),
linkMerchantIds: res.merchantRefList ? res.merchantRefList.map(item => Object.assign(item, item.merchantInfo)) : []
}
this.markOldVal.shopPrice = res.shopPrice
this.markOldVal.retailPrice = res.retailPrice
this.$nextTick(() => {
this.show = true
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!