From 642dab6f332eadefd06f1dad9e214a781ff525d4 Mon Sep 17 00:00:00 2001 From: wanglei Date: Tue, 11 Nov 2025 08:23:01 +0800 Subject: [PATCH] =?UTF-8?q?=E8=80=83=E6=A0=B8=E6=A8=A1=E6=9D=BF=20?= =?UTF-8?q?=E8=80=83=E6=A0=B8=E9=A1=B9=E9=9D=9E=E7=A9=BA=E6=A0=A1=E9=AA=8C?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ruoyi-ui/src/views/kaohe/template/index.vue | 28 +++++++++++++-------- 1 file changed, 17 insertions(+), 11 deletions(-) diff --git a/ruoyi-ui/src/views/kaohe/template/index.vue b/ruoyi-ui/src/views/kaohe/template/index.vue index c171f01..a11eda6 100644 --- a/ruoyi-ui/src/views/kaohe/template/index.vue +++ b/ruoyi-ui/src/views/kaohe/template/index.vue @@ -302,17 +302,23 @@ export default { submitForm() { this.$refs["form"].validate(valid => { if (valid) { - if (this.form.id != null) { - updateTemplate(this.form).then(response => { - this.$modal.msgSuccess("修改成功") - this.open = false - this.getList() - }) - } else { - addTemplate(this.form).then(response => { - this.$modal.msgSuccess("新增成功") - this.open = false - this.getList() + if(this.form.items.length>0){ + if (this.form.id != null) { + updateTemplate(this.form).then(response => { + this.$modal.msgSuccess("修改成功") + this.open = false + this.getList() + }) + } else { + addTemplate(this.form).then(response => { + this.$modal.msgSuccess("新增成功") + this.open = false + this.getList() + }) + } + }else { + this.$alert(`考核项不能为空,请选择考核项!`, `提示`, { + type: 'warning' }) } }