โครงสร้างอัตรากำลัง => เพิ่ม isLock
This commit is contained in:
parent
edbd250c54
commit
914072c8b6
5 changed files with 33 additions and 10 deletions
|
|
@ -26,6 +26,7 @@ export default {
|
|||
organizationHistoryNew: `${organization}/history`,
|
||||
organizationHistoryPostNew: `${organization}/history/publish`,
|
||||
orgChart: (id: string) => `${organization}/org-chart/${id}`,
|
||||
orgIsLock: `${organization}/lock`,
|
||||
|
||||
/** position*/
|
||||
orgPosPosition: `${orgPos}/position`,
|
||||
|
|
|
|||
|
|
@ -384,7 +384,10 @@ watch(
|
|||
<div class="row q-col-gutter-sm q-pl-sm">
|
||||
<div class="col-2" v-if="store.typeOrganizational === 'draft'">
|
||||
<q-btn
|
||||
v-if="checkPermission($route)?.attrOwnership == 'OWNER'"
|
||||
v-if="
|
||||
checkPermission($route)?.attrOwnership == 'OWNER' &&
|
||||
!store.isLosck
|
||||
"
|
||||
dense
|
||||
flat
|
||||
round
|
||||
|
|
@ -399,7 +402,8 @@ watch(
|
|||
<div
|
||||
:class="
|
||||
store.typeOrganizational === 'draft' &&
|
||||
checkPermission($route)?.attrOwnership == 'OWNER'
|
||||
checkPermission($route)?.attrOwnership == 'OWNER ' &&
|
||||
!store.isLosck
|
||||
? 'col-10'
|
||||
: 'col-12'
|
||||
"
|
||||
|
|
@ -468,7 +472,7 @@ watch(
|
|||
</div>
|
||||
|
||||
<q-btn
|
||||
v-if="store.typeOrganizational === 'draft'"
|
||||
v-if="store.typeOrganizational === 'draft' && !store.isLosck"
|
||||
@click.stop
|
||||
flat
|
||||
dense
|
||||
|
|
|
|||
|
|
@ -487,7 +487,7 @@ watch(
|
|||
<!-- TOOLBAR -->
|
||||
<div class="col-12">
|
||||
<q-toolbar style="padding: 0">
|
||||
<div v-if="store.typeOrganizational === 'draft'">
|
||||
<div v-if="store.typeOrganizational === 'draft'&& !store.isLosck">
|
||||
<q-btn
|
||||
flat
|
||||
round
|
||||
|
|
@ -602,7 +602,7 @@ watch(
|
|||
<q-tr :props="props">
|
||||
<q-td>
|
||||
<q-btn
|
||||
v-if="store.typeOrganizational === 'draft'"
|
||||
v-if="store.typeOrganizational === 'draft' && !store.isLosck"
|
||||
flat
|
||||
color="secondary"
|
||||
icon="mdi-dots-horizontal-circle-outline"
|
||||
|
|
|
|||
|
|
@ -12,9 +12,9 @@ export const useOrganizational = defineStore("organizationalStore", () => {
|
|||
const typeOrganizational = ref<string>("current"); // ประเภทโครงสร้าง
|
||||
const statusView = ref<string>("list"); // การแสดงผล รายการ,map
|
||||
|
||||
const rootId = ref<string>('')
|
||||
const isOfficer = ref<boolean|null>(null);
|
||||
const isStaff = ref<boolean|null>(null);
|
||||
const rootId = ref<string>("");
|
||||
const isOfficer = ref<boolean | null>(null);
|
||||
const isStaff = ref<boolean | null>(null);
|
||||
|
||||
const dataActive = ref<DataActive>(); //ข้อมูลโครงสร้าง
|
||||
const activeId = ref<string>(); // id โครงสร้างปัจจุบัน
|
||||
|
|
@ -24,6 +24,7 @@ export const useOrganizational = defineStore("organizationalStore", () => {
|
|||
const treeId = ref<string>(); // id โหนด
|
||||
const level = ref<number>(); // ระดับโหนด
|
||||
const orgPublishDate = ref<Date | null>(null); // วันเผยแพร่
|
||||
const isLosck = ref<boolean>(false);
|
||||
const sumPosition = reactive({
|
||||
total: 0,
|
||||
use: 0,
|
||||
|
|
@ -166,6 +167,7 @@ export const useOrganizational = defineStore("organizationalStore", () => {
|
|||
getSumPosition,
|
||||
isOfficer,
|
||||
isStaff,
|
||||
rootId
|
||||
rootId,
|
||||
isLosck,
|
||||
};
|
||||
});
|
||||
|
|
|
|||
|
|
@ -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 () => {
|
|||
</q-btn-group>
|
||||
|
||||
<q-btn
|
||||
v-if="checkPermission($route)?.attrOwnership == 'OWNER'"
|
||||
v-if="
|
||||
checkPermission($route)?.attrOwnership == 'OWNER' &&
|
||||
!store.isLosck
|
||||
"
|
||||
color="green-6"
|
||||
dense
|
||||
unelevated
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue