isOfficer
This commit is contained in:
parent
6da1827526
commit
e043a3c9cc
4 changed files with 74 additions and 37 deletions
|
|
@ -32,6 +32,9 @@ const {
|
|||
success,
|
||||
} = mixin;
|
||||
|
||||
const isOfficer = ref<boolean | null>(null);
|
||||
const isStaff = ref<boolean | null>(null);
|
||||
|
||||
const paramsId = route.params.id;
|
||||
const myForm = ref<QForm | null>(null);
|
||||
const roleAdmin = ref<boolean>(false);
|
||||
|
|
@ -140,11 +143,27 @@ const getClass = (val: boolean) => {
|
|||
};
|
||||
};
|
||||
|
||||
async function getWorkFlow() {
|
||||
showLoader();
|
||||
await http
|
||||
.get(config.API.workflowKeycloakSystem("ORG_COMMAND"))
|
||||
.then(async (res) => {
|
||||
const data = await res.data.result;
|
||||
isOfficer.value = data.isOfficer;
|
||||
isStaff.value = data.isStaff;
|
||||
roleAdmin.value = data.isOfficer;
|
||||
hideLoader();
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
hideLoader();
|
||||
})
|
||||
.finally(() => {});
|
||||
}
|
||||
|
||||
onMounted(async () => {
|
||||
const user = await tokenParsed();
|
||||
if (user) {
|
||||
roleAdmin.value = await user.role.includes("placement1");
|
||||
}
|
||||
getWorkFlow();
|
||||
|
||||
fetchData();
|
||||
});
|
||||
</script>
|
||||
|
|
|
|||
|
|
@ -83,9 +83,8 @@ onMounted(async () => {
|
|||
await fetchPlacementData();
|
||||
}
|
||||
|
||||
const user = await tokenParsed();
|
||||
if (user) {
|
||||
roleAdmin.value = await user.role.includes("placement1");
|
||||
if (DataStore.isOfficer) {
|
||||
roleAdmin.value = DataStore.isOfficer;
|
||||
}
|
||||
|
||||
await getStat();
|
||||
|
|
|
|||
|
|
@ -779,26 +779,41 @@ watch(containStatus, () => {
|
|||
}
|
||||
});
|
||||
|
||||
async function getWorkFlow() {
|
||||
showLoader();
|
||||
await http
|
||||
.get(config.API.workflowKeycloakSystem("ORG_COMMAND"))
|
||||
.then(async (res) => {
|
||||
const data = await res.data.result;
|
||||
DataStore.isOfficer = data.isOfficer;
|
||||
DataStore.isStaff = data.isStaff;
|
||||
roleAdmin.value = data.isOfficer;
|
||||
if (roleAdmin.value === false) {
|
||||
displayAdd.value = false;
|
||||
visibleColumns.value = [
|
||||
"position",
|
||||
"fullName",
|
||||
"examNumber",
|
||||
"idCard",
|
||||
"positionNumber",
|
||||
"organizationName",
|
||||
"reportingDate",
|
||||
"bmaOfficer",
|
||||
"statusName",
|
||||
"positionCandidate",
|
||||
];
|
||||
}
|
||||
hideLoader();
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
hideLoader();
|
||||
})
|
||||
.finally(() => {});
|
||||
}
|
||||
|
||||
onMounted(async () => {
|
||||
const user = await tokenParsed();
|
||||
if (user) {
|
||||
roleAdmin.value = await user.role.includes("placement1");
|
||||
if (roleAdmin.value === false) {
|
||||
displayAdd.value = false;
|
||||
visibleColumns.value = [
|
||||
"position",
|
||||
"fullName",
|
||||
"examNumber",
|
||||
"idCard",
|
||||
"positionNumber",
|
||||
"organizationName",
|
||||
"reportingDate",
|
||||
"bmaOfficer",
|
||||
"statusName",
|
||||
"positionCandidate",
|
||||
];
|
||||
}
|
||||
}
|
||||
await getWorkFlow();
|
||||
await getTable();
|
||||
});
|
||||
</script>
|
||||
|
|
|
|||
|
|
@ -89,6 +89,8 @@ export const useProfileDataStore = defineStore("profilePlacenent", () => {
|
|||
export const usePlacementDataStore = defineStore("placement", () => {
|
||||
const mixin = useCounterMixin(); //เรียกฟังก์ชันกลาง
|
||||
const tabsMain = ref<string>("probation");
|
||||
const isOfficer = ref<boolean|null>(null);
|
||||
const isStaff = ref<boolean|null>(null);
|
||||
const { hideLoader } = mixin;
|
||||
interface placement {
|
||||
mappingPosition: { columns: String[] };
|
||||
|
|
@ -209,7 +211,9 @@ export const usePlacementDataStore = defineStore("placement", () => {
|
|||
DataMain,
|
||||
DataUpdateMain,
|
||||
checkLoad,
|
||||
tabsMain
|
||||
tabsMain,
|
||||
isOfficer,
|
||||
isStaff,
|
||||
};
|
||||
});
|
||||
export const useOrderPlacementDataStore = defineStore("placementOrder", () => {
|
||||
|
|
@ -312,43 +316,43 @@ export const useOrderPlacementDataStore = defineStore("placementOrder", () => {
|
|||
export const useTransferDataStore = defineStore("transferDataStore", () => {
|
||||
const optionStatusProbation = ref<OpfillterTypeSt[]>([
|
||||
{
|
||||
id: '',
|
||||
id: "",
|
||||
value: "ทั้งหมด",
|
||||
},
|
||||
{
|
||||
id: '1',
|
||||
id: "1",
|
||||
value: "อยู่ระหว่างการทดลองปฏิบัติหน้าที่ราชการ",
|
||||
},
|
||||
{
|
||||
id: '2',
|
||||
id: "2",
|
||||
value: "พ้นการทดลองปฏิบัติหน้าที่ราชการ",
|
||||
},
|
||||
{
|
||||
id: '3',
|
||||
id: "3",
|
||||
value: "ไม่พ้นการทดลองปฏิบัติหน้าที่ราชการ",
|
||||
},
|
||||
{
|
||||
id: '4',
|
||||
id: "4",
|
||||
value: "ยุติการทดลองปฏิบัติหน้าที่ราชการเนื่องจากเปลี่ยนตำแหน่ง",
|
||||
},
|
||||
{
|
||||
id: '5',
|
||||
id: "5",
|
||||
value: "ยุติการทดลองปฏิบัติหน้าที่ราชการเนื่องจากลาออก",
|
||||
},
|
||||
{
|
||||
id: '6',
|
||||
id: "6",
|
||||
value: "ยุติการทดลองปฏิบัติหน้าที่ราชการเนื่องจากถึงแก่กรรม",
|
||||
},
|
||||
{
|
||||
id: '7',
|
||||
id: "7",
|
||||
value: "ขยายระยะเวลาทดลองปฏิบัติหน้าที่ราชการ",
|
||||
},
|
||||
{
|
||||
id: '8',
|
||||
id: "8",
|
||||
value: "ส่งรายชื่อไปออกคำสั่ง",
|
||||
},
|
||||
{
|
||||
id: '9',
|
||||
id: "9",
|
||||
value: "ออกคำสั่งเสร็จแล้ว",
|
||||
},
|
||||
]);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue