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' }) } }