1.添加字符串处理工具

2.用户编辑页面提交方法添加参数校验
3.分库添加用户操作添加校验,不选择用户时无法关闭弹窗
fengcang
x_z 3 years ago
parent 56ff1562e8
commit ca6ad2d29b

@ -0,0 +1,7 @@
//封装字符串相关的方法
export function isBlank(value) {
value = value.trim();
if (value === "" || value === null || value === "string") {
return true;
}
}

@ -1155,24 +1155,26 @@ export default {
}) })
}, },
addUserData() { addUserData() {
this.userFormVisible = false;
let query = { let query = {
code: this.currentCode, code: this.currentCode,
userList: JSON.stringify(this.selectUserList) userList: JSON.stringify(this.selectUserList)
}; };
saveWarehouseUser(query).then((res) => { saveWarehouseUser(query).then((res) => {
this.$message.success("添加成功"); if (res.code === 20000) {
let loadParam = { this.userFormVisible = false;
code: this.currentCode this.$message.success("添加成功");
}; let loadParam = {
// code: this.currentCode
warehouseUserList(loadParam).then((res) => { };
this.userData = res.data; //
}).catch((error) => { warehouseUserList(loadParam).then((res) => {
console.log(error) this.userData = res.data;
}); }).catch((error) => {
});
} else {
this.$message.error(res.message);
}
}).catch((error) => { }).catch((error) => {
console.log(error);
this.$message.error("添加失败"); this.$message.error("添加失败");
}); });
}, },

@ -175,6 +175,8 @@ import {
authAdminDelete authAdminDelete
} from "../../../api/auth/authAdmin"; } from "../../../api/auth/authAdmin";
import {findConfig} from "@/api/thrsys/spsSyncStatus"; import {findConfig} from "@/api/thrsys/spsSyncStatus";
import {isBlank} from "@/utils/strUtil";
const formJson = { const formJson = {
id: "", id: "",
passWord: "", passWord: "",
@ -338,12 +340,20 @@ export default {
} }
}, },
formSubmit() { formSubmit() {
console.log( if (isBlank(this.formData.userName)) {
this.formData.userName + this.$message.error("用户账号不能为空");
"-----" + return;
this.formData.employeeName + } else if (isBlank(this.formData.passWord)) {
this.formData.userFlag this.$message.error("密码不能为空")
); return;
}else if (isBlank(this.formData.employeeName)) {
this.$message.error("用户名称不能为空");
return;
} else if (this.formData.roles.length === 0) {
this.$message.error("未指定角色!")
return;
}
this.$refs["dataForm"].validate(valid => { this.$refs["dataForm"].validate(valid => {
if (valid) { if (valid) {
this.formLoading = true; this.formLoading = true;

Loading…
Cancel
Save