-
+
isShowOtherByCheckboxTree(label))
const isHasOtherInfo = otherOptions.every(item => otherValues[item]);
- console.log(otherOptions,allCheckedOptions,isHasOtherInfo,"otherOptions")
- console.log(o,checkedValues,otherValues,options,isChecked,"checkboxTreeValue")
if (!isChecked || !isHasOtherInfo) {
errors.push({
field: key,
@@ -388,15 +386,36 @@ export default {
this.$set(this.errors, key, true);
}
continue
+ }else if(o.type === "radioAndOther"&&o.fillType === this.templateFillType){
+ const radioValue = formFields[key] || {};
+ const {otherCode} = o;
+ const otherValue = formFields[otherCode] || "";
+ const isShow = this.isShowOtherByRadioAndOther(radioValue,o)
+ console.log(o,radioValue,isShow,otherValue,"radioValue")
+ if(isShow&&!otherValue){
+ errors.push({
+ field: key,
+ label: o.label,
+ error: "请输入信息"
+ });
+ this.$set(this.errors, key, true);
+ }
+ // if (!radioValue) {
+ // errors.push({
+ // field: key,
+ // label: o.label,
+ // error: "请选择方法学验证"
+ // });
+ // this.$set(this.errors, key, true);
+ // }
+ continue
}
if (isValueEmpty(formFields[key])) {
// 其他字段需要判断是否显示再校验
- if (o.label === "template.common.other" && !this.isShowOther(formFields[o.parentKey]) && o.parentType !== "radioAndOther") {
- continue
- }
- if (o.type === "radioAndOther" && o.label === "template.common.other" && !this.isShowOtherByRadioAndOther(formFields[o.parentKey])) {
+ if (o.label === "template.common.other" && !this.isShowOther(formFields[o.parentKey])) {
continue
}
+
//span的字段不校验
if (o.type === "span" || o.type === "text" || o.type === "button") {
continue
@@ -460,7 +479,9 @@ export default {
onBlur(key, val) {
// compareTo 功能:当fillType==="actFill"时,判断当前值是否与compareTo字段的值一样,如果不一样则将当前input框的背景色标记成橙色
this.onValueChangeCompareTo(key, val);
-
+ if (this.errors[key]) {
+ this.$set(this.errors, key, false);
+ }
this.$emit("blur", { key, value: val, ...this.formFields });
},
onValueChangeCompareTo(key, val, compKey) {