|
|
|
@ -41,14 +41,28 @@ export default { |
|
|
|
|
controlWindows: Object, |
|
|
|
|
}, |
|
|
|
|
data() { |
|
|
|
|
let validatorFloorPrice = (rule, value, callback) => { |
|
|
|
|
if (!value || !+value) return callback("成本价价不能为0或空"); |
|
|
|
|
callback(); |
|
|
|
|
}; |
|
|
|
|
let validatorSalePrice2company = (rule, value, callback) => { |
|
|
|
|
if (!value || !+value) return callback("企业销售价不能为0或空"); |
|
|
|
|
if (value < this.form.floorPrice) |
|
|
|
|
return callback("企业销售价不能低于成本价"); |
|
|
|
|
callback(); |
|
|
|
|
}; |
|
|
|
|
return { |
|
|
|
|
form: {}, |
|
|
|
|
rules: { |
|
|
|
|
floorPrice: [ |
|
|
|
|
{ required: true, message: "请输入成本价", trigger: "blur" }, |
|
|
|
|
{ required: true, validator: validatorFloorPrice, trigger: "change" }, |
|
|
|
|
], |
|
|
|
|
salePrice2company: [ |
|
|
|
|
{ required: true, message: "请输入企业销售价", trigger: "blur" }, |
|
|
|
|
{ |
|
|
|
|
required: true, |
|
|
|
|
validator: validatorSalePrice2company, |
|
|
|
|
trigger: "change", |
|
|
|
|
}, |
|
|
|
|
], |
|
|
|
|
}, |
|
|
|
|
}; |
|
|
|
|