Commit 2ab4a28c by 王志慧

commit

1 parent 8aaa0027
......@@ -27,7 +27,7 @@ function limitPrice(newValue, oldValue, intergerDigit, pointDigit, minValue, max
}
return newValue
} else {
return newValue ? oldValue : ''
return newValue ? oldValue : newValue
}
}
......
......@@ -51,8 +51,8 @@ const editCommodityObj = {
minSellPrice: [{ required: true, message: '请输入最低售价', trigger: 'change' }],
giftCost: [{ required: true, message: '请输入赠送成本', trigger: 'change' }],
productCost: [{ required: true, message: '请输入产品成本', trigger: 'change' }],
warningValue: [{ required: true, message: '请输入库存预警下限', trigger: 'change' }],
warningValueMax: [{ required: true, message: '请输入库存预警上限', trigger: 'change' }],
// warningValue: [{ required: true, message: '请输入库存预警下限', trigger: 'change' }],
// warningValueMax: [{ required: true, message: '请输入库存预警上限', trigger: 'change' }],
merchantList: [{ required: true, message: '请选择门店', trigger: 'change' }],
warrantyPeriod: [{ required: true, message: '请输入质保年限', trigger: 'change' }]
},
......@@ -127,7 +127,7 @@ const editCommodityObj = {
type: 'input'
},
{
label: '库存预警上限/件',
label: '库存上限预警/件',
name: 'warningValueMax',
type: 'input'
},
......
......@@ -117,7 +117,7 @@ export default {
},
// 赠送成本
'editForm.giftCost'(newValue, oldValue) {
this.editForm.giftCost = limitPrice(newValue, oldValue, 6, 2)
this.editForm.giftCost = limitPrice(newValue, oldValue, 6, 2)? limitPrice(newValue, oldValue, 6, 2):this.editForm.giftCost
},
// 产品成本
'editForm.productCost'(newValue, oldValue) {
......@@ -168,6 +168,7 @@ export default {
this.handleCheckChange(res.baseProductFlag, 'baseProductFlag')
this.handleCheckChange(res.upgradeProductFlag, 'upgradeProductFlag')
}
this.editForm = res
this.$nextTick(() => {
this.editStatus = false
......@@ -195,7 +196,6 @@ export default {
},
// 产品类型改变
handleCheckChange(val, attr) {
console.log(val, attr)
let baseAttrList = ['赠送成本/元',]
let upAttrList = ['售价/元', '最低售价/元', '产品成本/元']
switch (attr) {
......@@ -222,9 +222,7 @@ export default {
},
changeFormAttr(formName, attrName, labelList, attrValue) {
labelList.forEach(item => {
console.log(item)
let idx = this[formName]?.findIndex(k => {
console.log(k)
return k.label == item
})
this[formName][idx][attrName] = attrValue
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!