export default { data(){ return{ rules:{ "bodgrp.rec.invref": [ {type: "string", required: true, message: "必输项"}, ], "bodgrp.rec.matdat": [ { validator: (rule, value, callback) => { if (this.model.bodgrp.rec.doctypcod !== 'P' && !this.model.bodgrp.rec.matdat && !this.model.swiadd.newmatdat) { callback(new Error('必输项')); } callback(); }, trigger: ['blur', 'change'] } ], } } } }