diff --git a/src/views/system/dept/form.vue b/src/views/system/dept/form.vue index bc9b6f6..f7f57c1 100644 --- a/src/views/system/dept/form.vue +++ b/src/views/system/dept/form.vue @@ -51,6 +51,7 @@ defineExpose({ getRef }); emitPath: false, checkStrictly: true }" + :disabled="newFormInline.id ? true : false" clearable filterable placeholder="请选择上级部门" diff --git a/src/views/system/dept/utils/hook.tsx b/src/views/system/dept/utils/hook.tsx index 4526fdf..c69730d 100644 --- a/src/views/system/dept/utils/hook.tsx +++ b/src/views/system/dept/utils/hook.tsx @@ -189,6 +189,10 @@ export function useDept() { addDept(params).then(res => { if (res.success) { chores(); + } else { + message(`${res.msg}`, { + type: "warning" + }); } }); } else { diff --git a/src/views/system/user/utils/hook.tsx b/src/views/system/user/utils/hook.tsx index f4931da..c490b9f 100644 --- a/src/views/system/user/utils/hook.tsx +++ b/src/views/system/user/utils/hook.tsx @@ -148,25 +148,43 @@ export function useUser() { } ) .then(() => { - switchLoadMap.value[index] = Object.assign( - {}, - switchLoadMap.value[index], - { - loading: true + const params = { + department_id: row.department_id, + username: row.username, + phone_number: row.phone_number, + status: row.status, + gender: row.gender, + id: row.id + }; + updateUser(params).then(res => { + if (res.success) { + setTimeout(() => { + switchLoadMap.value[index] = Object.assign( + {}, + switchLoadMap.value[index], + { + loading: false + } + ); + message("已成功修改用户状态", { + type: "success" + }); + }, 300); + } else { + row.status === 0 ? (row.status = 1) : (row.status = 0); + message(`${res.msg}`, { + type: "warning" + }); } - ); - setTimeout(() => { - switchLoadMap.value[index] = Object.assign( - {}, - switchLoadMap.value[index], - { - loading: false - } - ); - message("已成功修改用户状态", { - type: "success" - }); - }, 300); + }); + // switchLoadMap.value[index] = Object.assign( + // {}, + // switchLoadMap.value[index], + // { + // loading: true + + // } + // ); }) .catch(() => { row.status === 0 ? (row.status = 1) : (row.status = 0);