Ver código fonte

修复平台表单设备国标编号校验提示错误

648540858 1 ano atrás
pai
commit
c2760c0067
1 arquivos alterados com 13 adições e 1 exclusões
  1. 13 1
      web_src/src/components/PlatformEdit.vue

+ 13 - 1
web_src/src/components/PlatformEdit.vue

@@ -168,7 +168,7 @@ export default {
       } else {
         var exit = await this.deviceGBIdExit(value);
         if (exit) {
-          callback(new Error("设备国标编号已存在"));
+          callback(new Error("设备国标编号格式错误或已存在"));
         } else {
           callback();
         }
@@ -287,6 +287,18 @@ export default {
         });
       }
     },
+    deviceGBIdExit: async function (deviceGbId) {
+      let result = false;
+      await this.$axios({
+        method:"get",
+        url:`/api/platform/exit/${deviceGbId}`
+      }).then((res)=> {
+        result = res.data;
+      }).catch((error)=> {
+        console.log(error);
+      });
+      return result;
+    },
     close: function () {
       this.closeEdit()
     },