From feef4c6defa64afee0a2aec64a5a3283878b679a Mon Sep 17 00:00:00 2001 From: yunuo970428 <405378304@qq.com> Date: Mon, 27 May 2024 10:51:42 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=8C=E5=96=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../basicinformation/profession/profession.vue | 17 ++++++++++++----- .../basicinformation/subjects/subjects.vue | 17 ++++++++++++----- .../src/views/basicinformation/team/team.vue | 17 ++++++++++++----- 3 files changed, 36 insertions(+), 15 deletions(-) diff --git a/yxt-as-ui/src/views/basicinformation/profession/profession.vue b/yxt-as-ui/src/views/basicinformation/profession/profession.vue index 4cd39267f5..8509c26f3a 100644 --- a/yxt-as-ui/src/views/basicinformation/profession/profession.vue +++ b/yxt-as-ui/src/views/basicinformation/profession/profession.vue @@ -251,6 +251,9 @@ export default { }, toAdd() { this.dialogVisible = true + this.$nextTick(() => { + this.$refs['form_obj'].clearValidate() + }) }, getNumber(val, limit) { val = val.replace(/[^0-9.]/g, '') // 保留数字 @@ -285,11 +288,15 @@ export default { handleConfirm() { this.formobj.createBySid = window.sessionStorage.getItem('userSid') this.formobj.orgPath = window.sessionStorage.getItem('defaultOrgPath') - req.saveOrUpdate(this.formobj).then((resp) => { - if (resp.success) { - this.$message({ showClose: true, type: 'success', message: '保存成功' }) - this.getList() - this.handleClose() + this.$refs['form_obj'].validate((valid) => { + if (valid) { + req.saveOrUpdate(this.formobj).then((resp) => { + if (resp.success) { + this.$message({ showClose: true, type: 'success', message: '保存成功' }) + this.getList() + this.handleClose() + } + }) } }) }, diff --git a/yxt-as-ui/src/views/basicinformation/subjects/subjects.vue b/yxt-as-ui/src/views/basicinformation/subjects/subjects.vue index 00f7a8f8c1..02e07afd90 100644 --- a/yxt-as-ui/src/views/basicinformation/subjects/subjects.vue +++ b/yxt-as-ui/src/views/basicinformation/subjects/subjects.vue @@ -245,6 +245,9 @@ export default { }, toAdd() { this.dialogVisible = true + this.$nextTick(() => { + this.$refs['form_obj'].clearValidate() + }) }, getNumber(val, limit) { val = val.replace(/[^0-9.]/g, '') // 保留数字 @@ -279,11 +282,15 @@ export default { handleConfirm() { this.formobj.createBySid = window.sessionStorage.getItem('userSid') this.formobj.orgPath = window.sessionStorage.getItem('defaultOrgPath') - req.saveOrUpdate(this.formobj).then((resp) => { - if (resp.success) { - this.$message({ showClose: true, type: 'success', message: '保存成功' }) - this.getList() - this.handleClose() + this.$refs['form_obj'].validate((valid) => { + if (valid) { + req.saveOrUpdate(this.formobj).then((resp) => { + if (resp.success) { + this.$message({ showClose: true, type: 'success', message: '保存成功' }) + this.getList() + this.handleClose() + } + }) } }) }, diff --git a/yxt-as-ui/src/views/basicinformation/team/team.vue b/yxt-as-ui/src/views/basicinformation/team/team.vue index 54265e55eb..65effc4574 100644 --- a/yxt-as-ui/src/views/basicinformation/team/team.vue +++ b/yxt-as-ui/src/views/basicinformation/team/team.vue @@ -230,6 +230,9 @@ export default { }, toAdd() { this.dialogVisible = true + this.$nextTick(() => { + this.$refs['form_obj'].clearValidate() + }) }, getNumber(val, limit) { val = val.replace(/[^0-9.]/g, '') // 保留数字 @@ -264,11 +267,15 @@ export default { handleConfirm() { this.formobj.createBySid = window.sessionStorage.getItem('userSid') this.formobj.orgPath = window.sessionStorage.getItem('defaultOrgPath') - req.saveOrUpdate(this.formobj).then((resp) => { - if (resp.success) { - this.$message({ showClose: true, type: 'success', message: '保存成功' }) - this.getList() - this.handleClose() + this.$refs['form_obj'].validate((valid) => { + if (valid) { + req.saveOrUpdate(this.formobj).then((resp) => { + if (resp.success) { + this.$message({ showClose: true, type: 'success', message: '保存成功' }) + this.getList() + this.handleClose() + } + }) } }) },