diff --git a/web_src/src/components/dialog/catalogEdit.vue b/web_src/src/components/dialog/catalogEdit.vue
index e2fe59bc..9a5e3a36 100644
--- a/web_src/src/components/dialog/catalogEdit.vue
+++ b/web_src/src/components/dialog/catalogEdit.vue
@@ -12,15 +12,6 @@
>
-
-
-
-
-
-
-
-
-
@@ -63,7 +54,11 @@ export default {
return callback(new Error('行政区划编号必须为2/4/6/8位'));
}
if (this.form.parentId !== this.platformDeviceId && this.form.parentId.length >= value.trim().length) {
- return callback(new Error('行政区划编号长度应该每次两位递增'));
+ if (this.form.parentId.length === 20) {
+ return callback(new Error('业务分组/虚拟组织下不可创建行政区划'));
+ }else {
+ return callback(new Error('行政区划编号长度应该每次两位递增'));
+ }
}
}else {
if (value.trim().length !== 20) {
@@ -122,27 +117,31 @@ export default {
this.level = level;
},
onSubmit: function () {
- console.log("onSubmit");
- console.log(this.form);
- this.$axios({
- method:"post",
- url:`/api/platform/catalog/${!this.isEdit? "add":"edit"}`,
- data: this.form
- }).then((res)=> {
- if (res.data.code === 0) {
- if (this.submitCallback)this.submitCallback(this.form)
- }else {
- this.$message({
- showClose: true,
- message: res.data.msg,
- type: "error",
+ this.$refs["form"].validate((valid) => {
+ if (valid) {
+ this.$axios({
+ method:"post",
+ url:`/api/platform/catalog/${!this.isEdit? "add":"edit"}`,
+ data: this.form
+ }).then((res)=> {
+ if (res.data.code === 0) {
+ if (this.submitCallback)this.submitCallback(this.form)
+ }else {
+ this.$message({
+ showClose: true,
+ message: res.data.msg,
+ type: "error",
+ });
+ }
+ this.close();
+ })
+ .catch((error)=> {
+ console.log(error);
});
- }
- this.close();
- })
- .catch((error)=> {
- console.log(error);
- });
+ } else {
+ return false;
+ }
+ });
},
close: function () {
this.isEdit = false;