From 8bd4fa8cfbb7f5b83b9d35f4607ba70d745b3577 Mon Sep 17 00:00:00 2001 From: tianqian <277562116@qq.com> Date: Sat, 6 May 2023 19:37:36 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8D=95=E5=85=83=E9=95=BF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/modules/housemaster/cpts/edit.vue | 50 ++++++++++++--------- 1 file changed, 29 insertions(+), 21 deletions(-) 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') {