From 689604a29bed4bb67c35b82b2a43f0aae9dc2847 Mon Sep 17 00:00:00 2001 From: x_z Date: Sat, 9 Jul 2022 15:12:56 +0800 Subject: [PATCH] =?UTF-8?q?1.=E4=BF=AE=E5=A4=8D=E7=A6=85=E9=81=93bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/utils/strUtil.js | 5 ++--- src/views/basic/invWarehouse.vue | 10 ++++++++-- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/src/utils/strUtil.js b/src/utils/strUtil.js index c5a88ce..0389b58 100644 --- a/src/utils/strUtil.js +++ b/src/utils/strUtil.js @@ -1,11 +1,10 @@ //封装字符串相关的方法 export function isBlank(value) { - if (value === "" || value === null) { + if (value === "" || value === null || value === undefined) { return true; } - value = value.trim(); - if (value === "string" || value === "undefined") { + if ("" === value || value === "string" || value === "undefined") { return true; } } diff --git a/src/views/basic/invWarehouse.vue b/src/views/basic/invWarehouse.vue index bbc6f59..6e0f36c 100644 --- a/src/views/basic/invWarehouse.vue +++ b/src/views/basic/invWarehouse.vue @@ -719,7 +719,7 @@ export default { configParms: {}, subData: {}, subFromName: "add", - + currentCode: null }; }, methods: { @@ -763,6 +763,7 @@ export default { // 更改值 this.formVisible = false; this.subFormVisible = false; + this.loadSubData(this.currentCode); return true; }, // 显示表单 @@ -828,10 +829,14 @@ export default { this.$refs["dataForm"].validate((valid) => { if (valid) { - if (this.formData.pcode == null && this.formData.level != 1) { + if (isBlank(this.formData.pcode) && this.formData.level != 1) { this.$message.warning("上级仓库不能为空"); return; } + if (isBlank(this.formData.name)) { + this.$message.warning("仓库名称不能为空"); + return; + } this.formLoading = true; let data = Object.assign({}, this.formData); saveWarehouse(data, this.formName) @@ -1061,6 +1066,7 @@ export default { this.subList = []; this.userList = null; this.bussinessTypeList = null; + this.currentCode = row.code; this.loadSubData(row.code); },