+
{
const typeOrganizational = ref("current"); // ประเภทโครงสร้าง
const statusView = ref("list"); // การแสดงผล รายการ,map
- const rootId = ref('')
- const isOfficer = ref(null);
- const isStaff = ref(null);
+ const rootId = ref("");
+ const isOfficer = ref(null);
+ const isStaff = ref(null);
const dataActive = ref(); //ข้อมูลโครงสร้าง
const activeId = ref(); // id โครงสร้างปัจจุบัน
@@ -24,6 +24,7 @@ export const useOrganizational = defineStore("organizationalStore", () => {
const treeId = ref(); // id โหนด
const level = ref(); // ระดับโหนด
const orgPublishDate = ref(null); // วันเผยแพร่
+ const isLosck = ref(false);
const sumPosition = reactive({
total: 0,
use: 0,
@@ -166,6 +167,7 @@ export const useOrganizational = defineStore("organizationalStore", () => {
getSumPosition,
isOfficer,
isStaff,
- rootId
+ rootId,
+ isLosck,
};
});
diff --git a/src/modules/02_organization/views/main.vue b/src/modules/02_organization/views/main.vue
index 632fb0805..c786c035b 100644
--- a/src/modules/02_organization/views/main.vue
+++ b/src/modules/02_organization/views/main.vue
@@ -56,6 +56,7 @@ async function fetchOrganizationActive() {
const data = await res.data.result;
if (data) {
await store.fetchDataActive(data);
+ await fetchCheckIslock(data.draftId);
if (data.activeName === null && data.draftName === null) {
isStatusData.value = false;
} else {
@@ -146,6 +147,18 @@ async function workflowSystem() {
.finally(() => {});
}
+async function fetchCheckIslock(id: string) {
+ http
+ .get(config.API.orgIsLock + `/${id}`)
+ .then((res) => {
+ const data = res.data.result;
+ store.isLosck = data;
+ })
+ .catch((e) => {
+ messageError($q, e);
+ });
+}
+
watch(
() => store.typeOrganizational,
() => {
@@ -305,7 +318,10 @@ onMounted(async () => {