|
@@ -329,6 +329,7 @@ export default {
|
|
|
// 根据条件动态设置 dependentField 的验证规则
|
|
|
updateDependentFieldValidation() {
|
|
|
const conditionFieldValue = this.form.company;
|
|
|
+ console.log(conditionFieldValue,'conditionFieldValue');
|
|
|
// 清空 dependentField 的验证规则
|
|
|
this.rules.certificateNumber = [];
|
|
|
|
|
@@ -336,6 +337,8 @@ export default {
|
|
|
if (conditionFieldValue === 3) {
|
|
|
// 设置为必填项
|
|
|
this.rules.certificateNumber.push({ required: true, message: 'Dependent Field 是必填项', trigger: 'change' });
|
|
|
+ }else{
|
|
|
+ this.rules.certificateNumber = [];
|
|
|
}
|
|
|
},
|
|
|
//获取签字公司
|
|
@@ -628,7 +631,9 @@ export default {
|
|
|
if(val==1){
|
|
|
console.log(this.form.company,'公司');
|
|
|
this.form.company=2
|
|
|
+
|
|
|
this.$forceUpdate();//强制刷新视图
|
|
|
+ this.updateDependentFieldValidation()
|
|
|
|
|
|
}
|
|
|
},
|