fix ทะเบียนประวัติ

This commit is contained in:
DESKTOP-1R2VSQH\Lenovo ThinkPad E490 2025-03-19 09:45:12 +07:00
parent 7933047d04
commit 8ff3456a23
5 changed files with 29 additions and 37 deletions

View file

@ -19,8 +19,10 @@ import DialogHistory from "@/modules/10_registry/Dialog/DialogHistory.vue";
const link = ref<string>(""); const link = ref<string>("");
const $q = useQuasar(); const $q = useQuasar();
const mixin = useCounterMixin(); const mixin = useCounterMixin();
const dataPerson = useDataStore() const dataPerson = useDataStore();
const checkType = ref<boolean>(dataPerson.officerType == 'OFFICER' ? true:false) const checkType = ref<boolean>(
dataPerson.officerType == "OFFICER" ? true : false
);
const store = useRegistryInFormationStore(); const store = useRegistryInFormationStore();
const { showLoader, hideLoader, messageError, date2Thai, dateToISO } = mixin; const { showLoader, hideLoader, messageError, date2Thai, dateToISO } = mixin;
@ -383,7 +385,7 @@ function getData() {
/** get history */ /** get history */
function getHistory() { function getHistory() {
const url = const url =
dataPerson.officerType == 'OFFICER' dataPerson.officerType == "OFFICER"
? config.API.dataUserGovernmentHistory("") ? config.API.dataUserGovernmentHistory("")
: config.API.dataUserGovernmentHistory("-employee"); : config.API.dataUserGovernmentHistory("-employee");
showLoader(); showLoader();
@ -402,7 +404,7 @@ function getHistory() {
}); });
} }
onMounted(async() => { onMounted(async () => {
link.value = await dataPerson.getProFileType(); link.value = await dataPerson.getProFileType();
getData(); getData();
}); });
@ -433,31 +435,25 @@ onMounted(async() => {
{{ formData.org ? formData.org : "-" }} {{ formData.org ? formData.org : "-" }}
</div> </div>
<div class="col-5 text-grey-6 text-weight-medium"> <div class="col-5 text-grey-6 text-weight-medium">
{{ checkType ? 'ตำแหน่งในสายงาน':'ตำแหน่ง' }} {{ checkType ? "ตำแหน่งในสายงาน" : "ตำแหน่ง" }}
</div> </div>
<div class="col-7"> <div class="col-7">
{{ formData.position ? formData.position : "-" }} {{ formData.position ? formData.position : "-" }}
</div> </div>
<div class="col-5 text-grey-6 text-weight-medium"> <div class="col-5 text-grey-6 text-weight-medium">
ตำแหนงเลขท {{ checkType ? "เลขที่ตำแหน่ง" : "ตำแหน่งเลขที่" }}
</div> </div>
<div class="col-7"> <div class="col-7">
{{ formData.posMasterNo ? formData.posMasterNo : "-" }} {{ formData.posMasterNo ? formData.posMasterNo : "-" }}
</div> </div>
<div <div v-if="checkType" class="col-5 text-grey-6 text-weight-medium">
v-if="checkType"
class="col-5 text-grey-6 text-weight-medium"
>
ตำแหนงทางการบรหาร ตำแหนงทางการบรหาร
</div> </div>
<div v-if="checkType" class="col-7"> <div v-if="checkType" class="col-7">
{{ formData.posExecutive ? formData.posExecutive : "-" }} {{ formData.posExecutive ? formData.posExecutive : "-" }}
</div> </div>
<div <div v-if="checkType" class="col-5 text-grey-6 text-weight-medium">
v-if="checkType"
class="col-5 text-grey-6 text-weight-medium"
>
านทางการบรหาร านทางการบรหาร
</div> </div>
<div v-if="checkType" class="col-7"> <div v-if="checkType" class="col-7">
@ -472,19 +468,14 @@ onMounted(async() => {
<div class="col-12 col-sm-12 col-md-6"> <div class="col-12 col-sm-12 col-md-6">
<div class="row q-col-gutter-y-sm"> <div class="row q-col-gutter-y-sm">
<div <div v-if="checkType" class="col-5 text-grey-6 text-weight-medium">
v-if="checkType"
class="col-5 text-grey-6 text-weight-medium"
>
สายงาน สายงาน
</div> </div>
<div v-if="checkType" class="col-7"> <div v-if="checkType" class="col-7">
{{ formData.positionField ? formData.positionField : "-" }} {{ formData.positionField ? formData.positionField : "-" }}
</div> </div>
<div class="col-5 text-grey-6 text-weight-medium"> <div class="col-5 text-grey-6 text-weight-medium">
{{ {{ checkType ? "ตำแหน่งประเภท" : "กลุ่มงาน" }}
checkType ? "ตำแหน่งประเภท" : "กลุ่มงาน"
}}
</div> </div>
<div class="col-7"> <div class="col-7">
{{ formData.posType ? formData.posType : "-" }} {{ formData.posType ? formData.posType : "-" }}

View file

@ -26,6 +26,9 @@ const { showLoader, hideLoader, messageError, date2Thai, onSearchDataTable } =
mixin; mixin;
const modalHistory = ref<boolean>(false); const modalHistory = ref<boolean>(false);
const checkType = ref<boolean>(
dataStore.officerType == "OFFICER" ? true : false
);
/** ตัวแปรข้อมูล */ /** ตัวแปรข้อมูล */
const visibleColumns = ref<String[]>([ const visibleColumns = ref<String[]>([
@ -60,7 +63,7 @@ const columns = ref<QTableProps["columns"]>([
{ {
name: "posNo", name: "posNo",
align: "left", align: "left",
label: "ตำแหน่งเลขที่", label: checkType.value ? "เลขที่ตำแหน่ง" : "ตำแหน่งเลขที่",
sortable: true, sortable: true,
field: "posNo", field: "posNo",
headerStyle: "font-size: 14px", headerStyle: "font-size: 14px",
@ -138,7 +141,7 @@ const columnsHistory = ref<QTableProps["columns"]>([
{ {
name: "posNo", name: "posNo",
align: "left", align: "left",
label: "ตำแหน่งเลขที่", label: checkType.value ? "เลขที่ตำแหน่ง" : "ตำแหน่งเลขที่",
sortable: true, sortable: true,
field: "posNo", field: "posNo",
headerStyle: "font-size: 14px", headerStyle: "font-size: 14px",

View file

@ -76,7 +76,7 @@ const baseColumns = ref<QTableColumn[]>([
{ {
name: "posNo", name: "posNo",
align: "left", align: "left",
label: "ตำแหน่งเลขที่", label: checkType.value ? "เลขที่ตำแหน่ง" : "ตำแหน่งเลขที่",
sortable: true, sortable: true,
field: "posNo", field: "posNo",
headerStyle: "font-size: 14px", headerStyle: "font-size: 14px",
@ -153,7 +153,7 @@ const baseColumns = ref<QTableColumn[]>([
{ {
name: "amount", name: "amount",
align: "left", align: "left",
label: link.value === "-employee" ? "ค่าตอบแทนรายเดือน" : "เงินเดือน", label: link.value === "-employee" ? "ค่าจ้าง" : "เงินเดือน",
sortable: true, sortable: true,
field: "amount", field: "amount",
headerStyle: "font-size: 14px", headerStyle: "font-size: 14px",

View file

@ -75,7 +75,7 @@ const baseColumns = ref<QTableProps["columns"]>([
{ {
name: "amount", name: "amount",
align: "left", align: "left",
label: checkType.value ? "เงินเดือน" : "ค่าตอบแทนรายเดือน", label: checkType.value ? "เงินเดือน" : "ค่าจ้าง",
sortable: true, sortable: true,
field: "amount", field: "amount",
headerStyle: "font-size: 14px", headerStyle: "font-size: 14px",
@ -105,7 +105,7 @@ const baseColumns = ref<QTableProps["columns"]>([
{ {
name: "posNo", name: "posNo",
align: "left", align: "left",
label: "ตำแหน่งเลขที่", label: checkType.value ? "เลขที่ตำแหน่ง" : "ตำแหน่งเลขที่",
sortable: true, sortable: true,
field: "posNo", field: "posNo",
headerStyle: "font-size: 14px", headerStyle: "font-size: 14px",
@ -257,7 +257,7 @@ const baseColumnsHistory = ref<QTableProps["columns"]>([
{ {
name: "amount", name: "amount",
align: "left", align: "left",
label: checkType.value ? "เงินเดือน" : "ค่าตอบแทนรายเดือน", label: checkType.value ? "เงินเดือน" : "ค่าจ้าง",
sortable: true, sortable: true,
field: "amount", field: "amount",
headerStyle: "font-size: 14px", headerStyle: "font-size: 14px",
@ -297,7 +297,7 @@ const baseColumnsHistory = ref<QTableProps["columns"]>([
{ {
name: "posNo", name: "posNo",
align: "left", align: "left",
label: "ตำแหน่งเลขที่", label: checkType.value ? "เลขที่ตำแหน่ง" : "ตำแหน่งเลขที่",
sortable: true, sortable: true,
field: "posNo", field: "posNo",
headerStyle: "font-size: 14px", headerStyle: "font-size: 14px",

View file

@ -1,7 +1,5 @@
<script setup lang="ts"> <script setup lang="ts">
import avatar from "@/assets/avatar_user.jpg"; import { ref } from "vue";
import { ref, reactive, onMounted } from "vue";
import axios from "axios";
import { useCounterMixin } from "@/stores/mixin"; import { useCounterMixin } from "@/stores/mixin";
import { useDataStore } from "@/stores/data"; import { useDataStore } from "@/stores/data";
import { useRegistryInFormationStore } from "@/modules/10_registry/store/registry"; import { useRegistryInFormationStore } from "@/modules/10_registry/store/registry";
@ -24,7 +22,7 @@ const store = useRegistryInFormationStore();
const $q = useQuasar(); const $q = useQuasar();
const dataStore = useDataStore(); const dataStore = useDataStore();
const mixin = useCounterMixin(); const mixin = useCounterMixin();
const { messageError, dialogConfirm, showLoader, hideLoader } = mixin; const { messageError, showLoader, hideLoader } = mixin;
const router = useRouter(); const router = useRouter();
const tab = ref<string>("information"); const tab = ref<string>("information");
@ -56,13 +54,13 @@ async function onClickDownloadKp7(type: string) {
.then(async (res) => { .then(async (res) => {
const data = await res.data.result; const data = await res.data.result;
await genReport(data, fileName, "pdf"); await genReport(data, fileName, "pdf");
hideLoader();
}) })
.catch((err) => { .catch((err) => {
messageError($q, err); messageError($q, err);
hideLoader();
}) })
.finally(() => {}); .finally(() => {
hideLoader();
});
} }
/** /**