This commit is contained in:
xiaozhiyong
2023-03-01 16:42:36 +08:00
parent 0b9076df67
commit 56cf799cfb
7 changed files with 37 additions and 11 deletions

View File

@@ -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",
},
],
},
};