角色配置、单位类型配置

master
LiuJiaNan 2026-08-05 14:23:12 +08:00
parent 494e8947ef
commit f58b6020b8
1 changed files with 6 additions and 2 deletions

View File

@ -155,6 +155,7 @@ function List(props) {
const AddModalComponent = (props) => {
const { parentId, id } = props;
const level = parentId === "0" ? 1 : 2;
const [tenantTypes, setTenantTypes] = useState([]);
const [fullServiceMenu, setFullServiceMenu] = useState([]);
@ -199,7 +200,7 @@ const AddModalComponent = (props) => {
const { success } = await props[id ? "editUnitTypeConfig" : "saveUnitTypeConfig"]({
...values,
id,
level: parentId === "0" ? 1 : 2,
level,
parentId,
menuIds: values.menuIds?.join(","),
});
@ -211,9 +212,10 @@ const AddModalComponent = (props) => {
};
const onSubmit = async (values) => {
if (parentId !== "0") {
if (parentId !== "0" && values.defaultType) {
const { data } = await props["verifyUnitTypeConfig"]({
defaultType: values.defaultType,
level,
id,
});
if (!data.available) {
@ -260,6 +262,7 @@ const AddModalComponent = (props) => {
if (value) {
const { data } = await props["verifyUnitTypeConfig"]({
tenantTypeId: value,
level,
id,
});
return data.available ? Promise.resolve() : Promise.reject(new Error(data.msg));
@ -294,6 +297,7 @@ const AddModalComponent = (props) => {
if (value) {
const { data } = await props["verifyUnitTypeConfig"]({
code: value,
level,
id,
});
return data.available ? Promise.resolve() : Promise.reject(new Error(data.msg));