diff --git a/src/views/modules/housemaster/cpts/edit.vue b/src/views/modules/housemaster/cpts/edit.vue index 33646a16f..da8265a74 100644 --- a/src/views/modules/housemaster/cpts/edit.vue +++ b/src/views/modules/housemaster/cpts/edit.vue @@ -16,28 +16,29 @@ placeholder="请输入"> - + - + - - + - @@ -46,29 +47,29 @@ - + - + - + - + @@ -217,11 +218,7 @@ message: '楼栋不能为空', trigger: 'blur' }], - unitId: [{ - required: true, - message: '单元不能为空', - trigger: 'blur' - }], + unitId: [], } }; }, @@ -232,6 +229,17 @@ this.initForm(); }, methods: { + rule() { + if (this.fmData.type == "1") { + this.dataRule.unitId = [{ + required: true, + message: '单元不能为空', + trigger: 'blur' + }] + }else{ + this.dataRule.unitId = [] + } + }, async initForm() { this.getdistrictList(2); if (this.formType != 'add') {