กำหนดสิทธิ์ => บทบาทที่เลือกไปแล้วไม่แสดง

This commit is contained in:
DESKTOP-1R2VSQH\Lenovo ThinkPad E490 2024-07-24 16:58:07 +07:00
parent 3628fe11f4
commit c97bbc7a78
2 changed files with 17 additions and 6 deletions

View file

@ -79,6 +79,12 @@ function fetchListRoles() {
.then((res) => {
const data = res.data.result;
rows.value = data;
const findRole = data.find(
(e: Roles) => e.id === props.dataPosMaster.authRoleId
);
if (findRole) {
selected.value.push(findRole);
}
})
.catch((err) => {
messageError($q, err);
@ -100,13 +106,14 @@ function onSubmit() {
authRoleId: arrayId[0],
posMasterId: props.dataPosMaster.id,
})
.then(() => {
closeDialog();
props.fetchDataTable(
.then(async () => {
await props.fetchDataTable(
reqMaster.value.id,
reqMaster.value.revisionId,
reqMaster.value.type
);
await success($q, "บันทึกข้อมูลสำเร็จ");
await closeDialog();
})
.catch((err) => {
messageError($q, err);

View file

@ -321,9 +321,13 @@ function onDeleteRole(id: string) {
authRoleId: "",
posMasterId: id,
})
.then(() => {
fetchDataTable(reqMaster.id, reqMaster.revisionId, reqMaster.type);
success($q, "ลบข้อมูลสำเร็จ");
.then(async () => {
await fetchDataTable(
reqMaster.id,
reqMaster.revisionId,
reqMaster.type
);
await success($q, "ลบข้อมูลสำเร็จ");
})
.catch((err) => {
messageError($q, err);