updated structure organization fact

This commit is contained in:
Warunee Tamkoo 2024-09-13 14:18:05 +07:00
parent 760d467d0d
commit 41359b8c81
4 changed files with 35 additions and 5 deletions

View file

@ -80,6 +80,7 @@ const formData = reactive<FormDataAgency>({
orgLevel: "", orgLevel: "",
orgLevelSub: "", orgLevelSub: "",
responsibility: "", responsibility: "",
isOfficer: false,
}); });
/** /**
@ -90,7 +91,7 @@ const formData = reactive<FormDataAgency>({
function onSubmit() { function onSubmit() {
dialogConfirm($q, async () => { dialogConfirm($q, async () => {
showLoader(); showLoader();
const type = store.checkLevel(level.value); const type = await store.checkLevel(level.value);
const nameId = const nameId =
level.value === 0 level.value === 0
? "orgRevisionId" ? "orgRevisionId"
@ -121,6 +122,7 @@ function onSubmit() {
[nameId]: rootId, [nameId]: rootId,
responsibility: responsibility:
formData.responsibility != null ? formData.responsibility : "", formData.responsibility != null ? formData.responsibility : "",
isOfficer: formData.isOfficer,
}; };
// //
@ -187,6 +189,7 @@ function closeClear() {
formData.orgFax = ""; formData.orgFax = "";
formData.orgLevel = ""; formData.orgLevel = "";
formData.responsibility = ""; formData.responsibility = "";
formData.isOfficer = false;
props.close?.(); props.close?.();
} }
@ -304,6 +307,7 @@ watch(
formData.orgLevel = props.dataNode.orgTreeRank; formData.orgLevel = props.dataNode.orgTreeRank;
formData.orgLevelSub = props.dataNode.orgTreeRankSub; formData.orgLevelSub = props.dataNode.orgTreeRankSub;
formData.responsibility = props.dataNode.responsibility; formData.responsibility = props.dataNode.responsibility;
formData.isOfficer = props.dataNode.isOfficer ?? false;
orgLevelOption.value = orgLevelOption.value =
props.dataNode.orgTreeRank === "DEPARTMENT" props.dataNode.orgTreeRank === "DEPARTMENT"
? orgLevelOptionMain.value ? orgLevelOptionMain.value
@ -485,6 +489,22 @@ watch(
rows="4" rows="4"
/> />
</div> </div>
<div
v-if="
(actionType === 'ADD' && props.dataNode?.orgLevel === 0) ||
(actionType === 'EDIT' && props.dataNode?.orgLevel === 1)
"
class="col-12"
>
<q-checkbox
keep-color
color="primary"
dense
v-model="formData.isOfficer"
label="สกจ."
class="q-ml-sm"
/>
</div>
</div> </div>
</q-card-section> </q-card-section>
<q-separator /> <q-separator />

View file

@ -377,6 +377,7 @@ 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'"
dense dense
flat flat
round round
@ -389,7 +390,12 @@ watch(
</div> </div>
<div <div
:class="store.typeOrganizational === 'draft' ? 'col-10' : 'col-12'" :class="
store.typeOrganizational === 'draft' &&
checkPermission($route)?.attrOwnership == 'OWNER'
? 'col-10'
: 'col-12'
"
> >
<q-input dense outlined v-model="filter" label="ค้นหา"> <q-input dense outlined v-model="filter" label="ค้นหา">
<template v-slot:append> <template v-slot:append>

View file

@ -29,6 +29,7 @@ interface FormDataAgency {
orgLevel: string; orgLevel: string;
orgLevelSub: string; orgLevelSub: string;
responsibility: string; responsibility: string;
isOfficer?: boolean;
} }
interface FormDataPosition { interface FormDataPosition {

View file

@ -175,7 +175,7 @@ onMounted(async () => {
<strong>{{ date2Thai(store.orgPublishDate) }}</strong> <strong>{{ date2Thai(store.orgPublishDate) }}</strong>
</div> </div>
<q-btn <q-btn
v-if="checkPermission($route)?.attrIsUpdate" v-if="checkPermission($route)?.attrOwnership == 'OWNER'"
dense dense
class="q-px-md" class="q-px-md"
color="indigo-9" color="indigo-9"
@ -257,7 +257,10 @@ onMounted(async () => {
" "
/> />
<q-btn-dropdown <q-btn-dropdown
v-if="itemHistory.length !== 0" v-if="
checkPermission($route)?.attrOwnership == 'OWNER' &&
itemHistory.length > 0
"
dense dense
class="q-px-md" class="q-px-md"
color="blue" color="blue"
@ -283,7 +286,7 @@ onMounted(async () => {
</q-btn-group> </q-btn-group>
<q-btn-dropdown <q-btn-dropdown
v-if="checkPermission($route)?.attrIsCreate" v-if="checkPermission($route)?.attrOwnership == 'OWNER'"
dense dense
unelevated unelevated
class="q-px-md" class="q-px-md"