Commit 92c91fb1 by cwq0219

商品编辑-零售价格+阳光激励费;到店价<升级价

1 parent 6747a13e
......@@ -138,6 +138,22 @@
</el-input>
</el-form-item>
</div>
<div class="w-50">
<el-form-item label="零售价格">
<el-input
v-model="proInfo.retailPrice"
placeholder="请输入零售价格"
clearable
class="dis-in-block"
@input="handleRetailPrice"
>
<i
slot="suffix"
class="input-suffix"
>元</i>
</el-input>
</el-form-item>
</div>
</el-form>
</div>
<div class="relateProDialog flex">
......@@ -195,6 +211,23 @@
style="width: calc(100% - 180px)"
>
<div class="w-50">
<el-form-item
label="阳光激励费"
title="每笔订单分配给合作商的金额结算比例。"
prop="incentiveCost"
>
<el-input
v-model="proInfo.incentiveCost"
@input="handleIncentiveCost"
placeholder="请输入阳光激励费"
class="dis-in-block"
>
<i
slot="suffix"
class="input-suffix"
>元</i>
</el-input>
</el-form-item>
</div>
<div class="w-50">
<el-form-item
......@@ -250,7 +283,14 @@ export default {
rules: {
goodsCode: [{ required: true, message: '请选择关联升级商品', trigger: 'change' }],
upgradePrice: [{ required: true, message: '请输入建议升级价', trigger: 'blur' }],
shopPrice: [{ required: true, message: '请输入到店价', trigger: 'blur' }],
shopPrice: [
{ required: true, message: '请输入到店价', trigger: 'blur' },
{ trigger: 'blur',
validator: (rule, value, callback) => {
(+value > +this.proInfo.upgradePrice) ? callback(new Error('到店价需小于建议升级价格')) : callback()
}
}
],
profitType: [{ required: true, message: '请输入分润规则', trigger: 'change' }],
profitValue: [{ required: true, message: '请输入分润比例', trigger: 'blur' }],
partnerProfitPer: [{ required: true, message: '请输入分润比例', trigger: 'blur' }]
......@@ -301,7 +341,6 @@ export default {
// console.log(value)
},
handleRelateProConfirm() {
console.log(this.proInfo)
this.$refs.proRuleForm1.validate(valid1 => {
this.$refs.proRuleForm2.validate(valid2 => {
this.$refs.proRuleForm3.validate(valid3 => {
......@@ -338,6 +377,14 @@ export default {
handleExtraCost(newVal) {
this.proInfo.extraCost = limitPrice(newVal, this.oldVal.extraCost, 8, 2)
this.oldVal.extraCost = this.proInfo.extraCost
},
handleRetailPrice(newVal) {
this.proInfo.retailPrice = limitPrice(newVal, this.oldVal.retailPrice, 6, 2)
this.oldVal.retailPrice = this.proInfo.retailPrice
},
handleIncentiveCost(newVal) {
this.proInfo.incentiveCost = limitPrice(newVal, this.oldVal.incentiveCost, 6, 2)
this.oldVal.incentiveCost = this.proInfo.incentiveCost
}
}
}
......
......@@ -50,137 +50,89 @@ export default {
rules: {
yqMerchantId: [{ required: true, message: '请选择园区店', trigger: 'change' }],
goodsCode: [{ required: true, message: '请选择产品名称', trigger: 'change' }],
shopPrice: [{ required: true, message: '请输入到店价', trigger: 'blur' }],
shopPrice: [
{ required: true, message: '请输入到店价', trigger: 'blur' },
{ trigger: 'blur',
validator: (rule, value, callback) => {
(+value > +this.markOldVal.retailPrice) ? callback(new Error('到店价需小于建议升级价')) : callback()
}
}
],
linkMerchantIds: [{ required: true, message: '请选择关联门店', trigger: 'change' }]
},
// headImg: {
// isHas: true,
// attr: 'thumbUrl'
// },
comFormRef: 'com',
editForm: [
// {
// title: '',
// formBlock: [{
// name: 'yqMerchantId',
// label: '园区店',
// isRequired: true,
// type: 'select',
// isHide: true,
// // tips: '选择基础商品',
// isClear: false,
// optionList: [],
// isDisabled: true,
// optionId: 'merchantId',
// optionLabel: 'merchantName'
// }]
// },
{
title: '基础商品信息',
width: '50%',
headImg: {
attr: 'thumbUrl'
},
formBlock: [{
name: 'goodsCode',
label: '产品名称',
isRequired: true,
type: 'select',
// tips: '选择基础商品',
isClear: false,
optionList: [],
isDisabled: true,
optionId: 'goodsCode',
optionLabel: 'goodsName'
}, {
name: 'goodsTypeName',
label: '分类',
type: 'input',
isDisabled: true
}, {
name: '',
label: '',
type: 'span'
}, {
name: 'sapCode',
label: '编号',
type: 'input',
isDisabled: true
}, {
name: 'shopPrice',
label: '到店价格',
type: 'input',
unit: '元',
// tips: '(商品最终交易价格)',
handleInput: (newVal) => {
this.$refs.d2Form.formData.shopPrice = limitPrice(newVal, this.markOldVal.shopPrice, 6, 2)
this.markOldVal.shopPrice = this.$refs.d2Form.formData.shopPrice
}
}, {
name: 'retailPrice',
label: '零售价格',
type: 'input',
unit: '元',
// tips: '(前端展示给车主)',
handleInput: (newVal) => {
this.$refs.d2Form.formData.retailPrice = limitPrice(newVal, this.markOldVal.retailPrice, 6, 2)
this.markOldVal.retailPrice = this.$refs.d2Form.formData.retailPrice
}
}]
editForm: [{
title: '基础商品信息',
width: '50%',
headImg: {
attr: 'thumbUrl'
},
// {
// title: '价格信息',
// formBlock: [{
// name: 'retailPrice',
// label: '商品零售价',
// type: 'input',
// unit: '元',
// tips: '(前端展示给车主)',
// handleInput: (newVal) => {
// this.$refs.d2Form.formData.retailPrice = limitPrice(newVal, this.markOldVal.retailPrice, 6, 2)
// this.markOldVal.retailPrice = this.$refs.d2Form.formData.retailPrice
// }
// }, {
// name: 'shopPrice',
// label: '到店价',
// type: 'input',
// unit: '元',
// tips: '(商品最终交易价格)',
// handleInput: (newVal) => {
// this.$refs.d2Form.formData.shopPrice = limitPrice(newVal, this.markOldVal.shopPrice, 6, 2)
// this.markOldVal.shopPrice = this.$refs.d2Form.formData.shopPrice
// }
// }, {
// name: 'maxRetailDiscount',
// label: '到店零售折扣',
// type: 'input',
// unit: '折',
// handleInput: (newVal) => {
// this.$refs.d2Form.formData.maxRetailDiscount = limitPrice(newVal, this.markOldVal.maxRetailDiscount, 1, 1, 1)
// this.markOldVal.maxRetailDiscount = this.$refs.d2Form.formData.maxRetailDiscount
// }
// }]
// },
{
title: '绑定升级商品',
formBlock: [{
name: 'upgradeGoods',
label: '',
type: 'relatePro',
optionValue: 'goodsCode',
relateAttr: 'goodsCode'
}]
formBlock: [{
name: 'goodsCode',
label: '产品名称',
isRequired: true,
type: 'select',
// tips: '选择基础商品',
isClear: false,
optionList: [],
isDisabled: true,
optionId: 'goodsCode',
optionLabel: 'goodsName'
}, {
name: 'goodsTypeName',
label: '分类',
type: 'input',
isDisabled: true
}, {
name: '',
label: '',
type: 'span'
}, {
title: '分配可见门店',
formBlock: [{
name: 'linkMerchantIds',
label: '',
btnTxt: '添加绑定',
type: 'button',
handleName: 'relateStore',
optionValue: 'merchantId'
}]
name: 'sapCode',
label: '编号',
type: 'input',
isDisabled: true
}, {
name: 'shopPrice',
label: '到店价格',
type: 'input',
unit: '元',
// tips: '(商品最终交易价格)',
handleInput: (newVal) => {
this.$refs.d2Form.formData.shopPrice = limitPrice(newVal, this.markOldVal.shopPrice, 6, 2)
this.markOldVal.shopPrice = this.$refs.d2Form.formData.shopPrice
}
}, {
name: 'retailPrice',
label: '零售价格',
type: 'input',
unit: '元',
// tips: '(前端展示给车主)',
handleInput: (newVal) => {
this.$refs.d2Form.formData.retailPrice = limitPrice(newVal, this.markOldVal.retailPrice, 6, 2)
this.markOldVal.retailPrice = this.$refs.d2Form.formData.retailPrice
}
}]
}, {
title: '绑定升级商品',
formBlock: [{
name: 'upgradeGoods',
label: '',
type: 'relatePro',
optionValue: 'goodsCode',
relateAttr: 'goodsCode'
}]
}, {
title: '分配可见门店',
formBlock: [{
name: 'linkMerchantIds',
label: '',
btnTxt: '添加绑定',
type: 'button',
handleName: 'relateStore',
optionValue: 'merchantId'
}]
}]
}
},
......@@ -192,7 +144,7 @@ export default {
this.addOrEdit = this.$route.params.addOrEdit
// !this.userInfo.beSuper && (this.editForm.splice(0, 1)) && this.getGoodsList(this.userInfo.detail.merchantId)
!this.userInfo.beSuper && this.getGoodsList(this.userInfo.detail.merchantId)
console.log(this.editForm)
// console.log(this.editForm)
if (this.addOrEdit === 'edit') {
getGoodsInfoById({ id: this.$route.params.row.id }).then(res => {
// console.log(res)
......@@ -220,7 +172,7 @@ export default {
}),
linkMerchantIds: res.merchantRefList ? res.merchantRefList.map(item => Object.assign(item, item.merchantInfo)) : []
}
console.log(this.editData)
// console.log(this.editData)
this.$nextTick(() => {
this.show = true
})
......@@ -251,7 +203,7 @@ export default {
},
handleAddConfirm(data) {
// console.log(data)
var upgradeGoodsAttr = ['goodsCode', 'shopPrice', 'maxUpgradeDiscount', 'upgradePrice', 'profitType', 'profitValue', 'extraCost', 'partnerProfitPer']
var upgradeGoodsAttr = ['goodsCode', 'shopPrice', 'maxUpgradeDiscount', 'retailPrice', 'upgradePrice', 'profitType', 'profitValue', 'extraCost', 'incentiveCost', 'partnerProfitPer']
var params = {
yqMerchantId: this.userInfo.beSuper ? data.yqMerchantId : this.userInfo.detail.merchantId,
goodsCode: data.goodsCode,
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!