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