ปรับทะเบียนประวัติ และ แก้ไขการเพิ่มตำแหน่ง
This commit is contained in:
parent
954f90a81a
commit
d2cf75cb3b
7 changed files with 279 additions and 182 deletions
|
|
@ -15,71 +15,74 @@
|
|||
{{ header }}
|
||||
</div>
|
||||
</div>
|
||||
<div class="q-gutter-sm q-mx-sm" v-if="addData == false">
|
||||
<q-btn
|
||||
size="12px"
|
||||
v-if="!edit"
|
||||
flat
|
||||
round
|
||||
:disabled="disable"
|
||||
:color="edit ? 'grey-7' : 'primary'"
|
||||
@click="ClickEdit"
|
||||
icon="mdi-pencil-outline"
|
||||
>
|
||||
<q-tooltip>แก้ไขข้อมูล</q-tooltip>
|
||||
</q-btn>
|
||||
<q-btn
|
||||
size="12px"
|
||||
flat
|
||||
round
|
||||
v-if="edit"
|
||||
:color="!edit ? 'grey-7' : 'public'"
|
||||
@click="save"
|
||||
icon="mdi-content-save-outline"
|
||||
>
|
||||
<q-tooltip>บันทึกข้อมูล</q-tooltip>
|
||||
</q-btn>
|
||||
<q-btn
|
||||
size="12px"
|
||||
flat
|
||||
round
|
||||
v-if="edit && !addEmployee"
|
||||
:color="!edit ? 'grey-7' : 'red'"
|
||||
@click="ClickCancel"
|
||||
icon="mdi-undo"
|
||||
>
|
||||
<q-tooltip>ยกเลิก</q-tooltip>
|
||||
</q-btn>
|
||||
</div>
|
||||
<div class="q-pl-sm" v-else-if="iconAdd != '' && iconAdd != null">
|
||||
<q-btn
|
||||
size="12px"
|
||||
flat
|
||||
round
|
||||
color="add"
|
||||
@click="addleave"
|
||||
icon="mdi-plus"
|
||||
>
|
||||
<q-tooltip>เพิ่มข้อมูล</q-tooltip>
|
||||
</q-btn>
|
||||
<!-- <q-btn size="12px" flat round color="add" @click="add" :icon="iconAdd">
|
||||
<div v-if="!profileStore.isVerified">
|
||||
<div class="q-gutter-sm q-mx-sm" v-if="addData == false">
|
||||
<q-btn
|
||||
size="12px"
|
||||
v-if="!edit"
|
||||
flat
|
||||
round
|
||||
:disabled="disable"
|
||||
:color="edit ? 'grey-7' : 'primary'"
|
||||
@click="ClickEdit"
|
||||
icon="mdi-pencil-outline"
|
||||
>
|
||||
<q-tooltip>แก้ไขข้อมูล</q-tooltip>
|
||||
</q-btn>
|
||||
<q-btn
|
||||
size="12px"
|
||||
flat
|
||||
round
|
||||
v-if="edit"
|
||||
:color="!edit ? 'grey-7' : 'public'"
|
||||
@click="save"
|
||||
icon="mdi-content-save-outline"
|
||||
>
|
||||
<q-tooltip>บันทึกข้อมูล</q-tooltip>
|
||||
</q-btn>
|
||||
<q-btn
|
||||
size="12px"
|
||||
flat
|
||||
round
|
||||
v-if="edit && !addEmployee"
|
||||
:color="!edit ? 'grey-7' : 'red'"
|
||||
@click="ClickCancel"
|
||||
icon="mdi-undo"
|
||||
>
|
||||
<q-tooltip>ยกเลิก</q-tooltip>
|
||||
</q-btn>
|
||||
</div>
|
||||
<div class="q-pl-sm" v-else-if="iconAdd != '' && iconAdd != null">
|
||||
<q-btn
|
||||
size="12px"
|
||||
flat
|
||||
round
|
||||
color="add"
|
||||
@click="addleave"
|
||||
icon="mdi-plus"
|
||||
>
|
||||
<q-tooltip>เพิ่มข้อมูล</q-tooltip>
|
||||
</q-btn>
|
||||
<!-- <q-btn size="12px" flat round color="add" @click="add" :icon="iconAdd">
|
||||
<q-tooltip>สรุปวันลา</q-tooltip>
|
||||
</q-btn> -->
|
||||
</div>
|
||||
|
||||
<div class="q-pl-sm" v-else>
|
||||
<q-btn
|
||||
size="12px"
|
||||
flat
|
||||
round
|
||||
:disabled="disable"
|
||||
color="add"
|
||||
@click="add"
|
||||
icon="mdi-plus"
|
||||
>
|
||||
<q-tooltip>เพิ่มข้อมูล</q-tooltip>
|
||||
</q-btn>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="q-pl-sm" v-else>
|
||||
<q-btn
|
||||
size="12px"
|
||||
flat
|
||||
round
|
||||
:disabled="disable"
|
||||
color="add"
|
||||
@click="add"
|
||||
icon="mdi-plus"
|
||||
>
|
||||
<q-tooltip>เพิ่มข้อมูล</q-tooltip>
|
||||
</q-btn>
|
||||
</div>
|
||||
<q-space />
|
||||
<q-btn
|
||||
color="info"
|
||||
|
|
@ -96,6 +99,9 @@
|
|||
</div>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import { useProfileDataStore } from "@/modules/04_registry/store";
|
||||
const profileStore = useProfileDataStore();
|
||||
|
||||
const props = defineProps({
|
||||
header: {
|
||||
type: String,
|
||||
|
|
|
|||
|
|
@ -153,81 +153,87 @@
|
|||
</div>
|
||||
</div>
|
||||
<q-space />
|
||||
|
||||
<q-btn
|
||||
v-if="
|
||||
profileType == 'officer' ||
|
||||
(profileType == 'employee' && employeeClass == 'perm')
|
||||
"
|
||||
round
|
||||
flat
|
||||
:color="reasonStatus ? 'primary' : 'pink-5'"
|
||||
:icon="
|
||||
reasonStatus ? 'mdi-home-import-outline' : 'mdi-home-export-outline'
|
||||
"
|
||||
<q-btn flat round color="green" icon="verified" @click="onClickVerified"
|
||||
><q-tooltip>ตรวจสอบข้อมูล</q-tooltip></q-btn
|
||||
>
|
||||
<q-menu transition-show="jump-down" transition-hide="jump-up">
|
||||
<q-list dense style="min-width: 160px">
|
||||
<q-item
|
||||
clickable
|
||||
v-close-popup
|
||||
@click="helpPost"
|
||||
v-if="profileType == 'officer'"
|
||||
>
|
||||
<q-item-section style="min-width: 0px" avatar class="q-py-sm">
|
||||
</q-item-section>
|
||||
<q-item-section>ช่วยราชการ</q-item-section>
|
||||
</q-item>
|
||||
<q-separator />
|
||||
<q-item
|
||||
clickable
|
||||
v-close-popup
|
||||
@click="repatriationPost"
|
||||
v-if="profileType == 'officer'"
|
||||
>
|
||||
<q-item-section style="min-width: 0px" avatar class="q-py-sm">
|
||||
</q-item-section>
|
||||
<q-item-section>ส่งตัวกลับ</q-item-section>
|
||||
</q-item>
|
||||
<q-separator />
|
||||
<q-item
|
||||
clickable
|
||||
v-close-popup
|
||||
@click="appointPost"
|
||||
v-if="profileType == 'officer'"
|
||||
>
|
||||
<q-item-section style="min-width: 0px" avatar class="q-py-sm">
|
||||
</q-item-section>
|
||||
<q-item-section>แต่งตั้ง-เลื่อน-ย้าย</q-item-section>
|
||||
</q-item>
|
||||
<q-item
|
||||
clickable
|
||||
v-close-popup
|
||||
@click="appointEmployeePost"
|
||||
v-if="profileType == 'employee'"
|
||||
>
|
||||
<q-item-section style="min-width: 0px" avatar class="q-py-sm">
|
||||
</q-item-section>
|
||||
<q-item-section>ปรับระดับชั้นงาน - ย้าย</q-item-section>
|
||||
</q-item>
|
||||
<q-separator />
|
||||
<q-item clickable v-close-popup @click="clickPassaway">
|
||||
<q-item-section style="min-width: 0px" avatar class="q-py-sm">
|
||||
</q-item-section>
|
||||
<q-item-section>ถึงแก่กรรม</q-item-section>
|
||||
</q-item>
|
||||
<q-separator />
|
||||
<q-item
|
||||
clickable
|
||||
v-close-popup
|
||||
@click="outPost"
|
||||
v-if="profileType == 'officer'"
|
||||
>
|
||||
<q-item-section style="min-width: 0px" avatar class="q-py-sm">
|
||||
</q-item-section>
|
||||
<q-item-section>ให้ออกจากราชการ</q-item-section>
|
||||
</q-item>
|
||||
<!-- <q-separator />
|
||||
|
||||
<div v-if="!roleKeyregistry && !roleRegistryverify">
|
||||
<q-btn
|
||||
v-if="
|
||||
profileType == 'officer' ||
|
||||
(profileType == 'employee' && employeeClass == 'perm')
|
||||
"
|
||||
round
|
||||
flat
|
||||
:color="reasonStatus ? 'primary' : 'pink-5'"
|
||||
:icon="
|
||||
reasonStatus
|
||||
? 'mdi-home-import-outline'
|
||||
: 'mdi-home-export-outline'
|
||||
"
|
||||
>
|
||||
<q-menu transition-show="jump-down" transition-hide="jump-up">
|
||||
<q-list dense style="min-width: 160px">
|
||||
<q-item
|
||||
clickable
|
||||
v-close-popup
|
||||
@click="helpPost"
|
||||
v-if="profileType == 'officer'"
|
||||
>
|
||||
<q-item-section style="min-width: 0px" avatar class="q-py-sm">
|
||||
</q-item-section>
|
||||
<q-item-section>ช่วยราชการ</q-item-section>
|
||||
</q-item>
|
||||
<q-separator />
|
||||
<q-item
|
||||
clickable
|
||||
v-close-popup
|
||||
@click="repatriationPost"
|
||||
v-if="profileType == 'officer'"
|
||||
>
|
||||
<q-item-section style="min-width: 0px" avatar class="q-py-sm">
|
||||
</q-item-section>
|
||||
<q-item-section>ส่งตัวกลับ</q-item-section>
|
||||
</q-item>
|
||||
<q-separator />
|
||||
<q-item
|
||||
clickable
|
||||
v-close-popup
|
||||
@click="appointPost"
|
||||
v-if="profileType == 'officer'"
|
||||
>
|
||||
<q-item-section style="min-width: 0px" avatar class="q-py-sm">
|
||||
</q-item-section>
|
||||
<q-item-section>แต่งตั้ง-เลื่อน-ย้าย</q-item-section>
|
||||
</q-item>
|
||||
<q-item
|
||||
clickable
|
||||
v-close-popup
|
||||
@click="appointEmployeePost"
|
||||
v-if="profileType == 'employee'"
|
||||
>
|
||||
<q-item-section style="min-width: 0px" avatar class="q-py-sm">
|
||||
</q-item-section>
|
||||
<q-item-section>ปรับระดับชั้นงาน - ย้าย</q-item-section>
|
||||
</q-item>
|
||||
<q-separator />
|
||||
<q-item clickable v-close-popup @click="clickPassaway">
|
||||
<q-item-section style="min-width: 0px" avatar class="q-py-sm">
|
||||
</q-item-section>
|
||||
<q-item-section>ถึงแก่กรรม</q-item-section>
|
||||
</q-item>
|
||||
<q-separator />
|
||||
<q-item
|
||||
clickable
|
||||
v-close-popup
|
||||
@click="outPost"
|
||||
v-if="profileType == 'officer'"
|
||||
>
|
||||
<q-item-section style="min-width: 0px" avatar class="q-py-sm">
|
||||
</q-item-section>
|
||||
<q-item-section>ให้ออกจากราชการ</q-item-section>
|
||||
</q-item>
|
||||
<!-- <q-separator />
|
||||
<q-item
|
||||
clickable
|
||||
v-close-popup
|
||||
|
|
@ -249,22 +255,23 @@
|
|||
</q-item-section>
|
||||
<q-item-section>ไล่ออกจากราชการ</q-item-section>
|
||||
</q-item> -->
|
||||
<q-separator />
|
||||
<q-item
|
||||
clickable
|
||||
v-close-popup
|
||||
@click="otherPost"
|
||||
v-if="profileType == 'officer'"
|
||||
>
|
||||
<q-item-section style="min-width: 0px" avatar class="q-py-sm">
|
||||
</q-item-section>
|
||||
<q-item-section>อื่นๆ</q-item-section>
|
||||
</q-item>
|
||||
<q-separator />
|
||||
</q-list>
|
||||
</q-menu>
|
||||
<!-- <q-tooltip>ส่งรายชื่อ</q-tooltip> -->
|
||||
</q-btn>
|
||||
<q-separator />
|
||||
<q-item
|
||||
clickable
|
||||
v-close-popup
|
||||
@click="otherPost"
|
||||
v-if="profileType == 'officer'"
|
||||
>
|
||||
<q-item-section style="min-width: 0px" avatar class="q-py-sm">
|
||||
</q-item-section>
|
||||
<q-item-section>อื่นๆ</q-item-section>
|
||||
</q-item>
|
||||
<q-separator />
|
||||
</q-list>
|
||||
</q-menu>
|
||||
<!-- <q-tooltip>ส่งรายชื่อ</q-tooltip> -->
|
||||
</q-btn>
|
||||
</div>
|
||||
|
||||
<!-- ปิดไปเพราะทำส่วนของพ้นราชการแล้ว -->
|
||||
<!-- <q-btn
|
||||
|
|
@ -781,6 +788,7 @@ import type { DataOption } from "@/modules/04_registry/interface/index/Main";
|
|||
import http from "@/plugins/http";
|
||||
import config from "@/app.config";
|
||||
import { useProfileDataStore } from "@/modules/04_registry/store";
|
||||
import keycloak from "@/plugins/keycloak";
|
||||
|
||||
const $q = useQuasar();
|
||||
const store = useDataStore();
|
||||
|
|
@ -871,10 +879,30 @@ const reasonOptions = ref<DataOption[]>([
|
|||
},
|
||||
]);
|
||||
|
||||
const roleKeyregistry = ref<boolean>(false);
|
||||
const roleRegistryverify = ref<boolean>(false);
|
||||
|
||||
function onClickVerified() {
|
||||
dialogConfirm(
|
||||
$q,
|
||||
async () => {},
|
||||
"ยืนยันการตรวจสอบข้อมูล",
|
||||
"ต้องการยืนยันการตรวจสอบข้อมูลนี้หรือไม่ ?"
|
||||
);
|
||||
}
|
||||
onMounted(async () => {
|
||||
// await checkProfileData();
|
||||
await fetchData();
|
||||
if (keycloak.tokenParsed != null) {
|
||||
roleKeyregistry.value = await keycloak.tokenParsed.role.includes(
|
||||
"keyregistry"
|
||||
);
|
||||
roleRegistryverify.value = await keycloak.tokenParsed.role.includes(
|
||||
"registryverify"
|
||||
);
|
||||
}
|
||||
console.log(roleKeyregistry.value, roleRegistryverify.value);
|
||||
await changeTab("information");
|
||||
await fetchData();
|
||||
await checIsVerified();
|
||||
});
|
||||
|
||||
const fetchData = async () => {
|
||||
|
|
@ -907,21 +935,29 @@ const fetchData = async () => {
|
|||
});
|
||||
};
|
||||
|
||||
const checkProfileData = async () => {
|
||||
showLoader();
|
||||
const isVerified = ref<boolean>(false);
|
||||
async function checIsVerified() {
|
||||
// showLoader();
|
||||
await http
|
||||
.get(config.API.profileCheckId(profileId.value))
|
||||
.get(config.API.profileInforId(profileId.value))
|
||||
.then((res) => {
|
||||
let data = res.data.result;
|
||||
if (data == false) router.push("/registry");
|
||||
const data = res.data.result;
|
||||
|
||||
profileStore.isVerified = data.isVerified
|
||||
? true
|
||||
: roleRegistryverify.value
|
||||
? true
|
||||
: roleKeyregistry.value
|
||||
? false
|
||||
: false;
|
||||
})
|
||||
.catch((e) => {
|
||||
router.push("/registry");
|
||||
.catch((err) => {
|
||||
messageError($q, err);
|
||||
})
|
||||
.finally(() => {
|
||||
hideLoader();
|
||||
// hideLoader();
|
||||
});
|
||||
};
|
||||
}
|
||||
|
||||
const fetchAvatarHistory = async () => {
|
||||
showLoader();
|
||||
|
|
@ -1502,7 +1538,12 @@ const clickSaveDeceased = async () => {
|
|||
watch(
|
||||
() => profileStore.isLoad,
|
||||
() => {
|
||||
const num = profileType.value === 'officer' ? 32:employeeClass.value === 'temp' ? 29:31
|
||||
const num =
|
||||
profileType.value === "officer"
|
||||
? 32
|
||||
: employeeClass.value === "temp"
|
||||
? 29
|
||||
: 31;
|
||||
profileStore.isLoad >= num && hideLoader();
|
||||
}
|
||||
);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue