แก้ลูกจ้าง

This commit is contained in:
setthawutttty 2024-11-07 14:51:21 +07:00
parent aa65b8165d
commit 7d75535d15
25 changed files with 942 additions and 892 deletions

View file

@ -7,13 +7,13 @@ import config from "@/app.config";
import { useCounterMixin } from "@/stores/mixin";
import { useDataStore } from "@/stores/data";
import type { InsigniaFormType } from "@/modules/10_registry/interface/index/Main";
//history dialog
import DialogHistory from "@/modules/10_registry/Dialog/DialogHistory.vue";
const dataPerson = useDataStore()
const link = ref<string>("");
const dataPerson = useDataStore();
const idByRow = ref<string>("");
const rows = ref<InsigniaFormType[]>([]);
const filter = ref<string>("");
@ -400,7 +400,7 @@ function onHistory(id: string) {
function getData() {
showLoader();
http
.get(config.API.dataUserCertificateByType(dataPerson.officerLink,"insignia"))
.get(config.API.dataUserCertificateByType(link.value, "insignia"))
.then((res) => {
const data = res.data.result;
rows.value = data;
@ -417,7 +417,13 @@ function getData() {
function getHistory() {
showLoader();
http
.get(config.API.dataUserCertificateHistoryByType(dataPerson.officerLink,"insignia", idByRow.value))
.get(
config.API.dataUserCertificateHistoryByType(
link.value,
"insignia",
idByRow.value
)
)
.then((res) => {
const data = res.data.result;
rowsHistory.value = data;
@ -431,7 +437,8 @@ function getHistory() {
}
onMounted(async () => {
await getData();
link.value = await dataPerson.getProFileType();
getData();
});
</script>
<template>
@ -474,7 +481,6 @@ onMounted(async () => {
outlined
emit-value
map-options
options-dense
option-value="name"
style="min-width: 140px"
@ -483,104 +489,102 @@ onMounted(async () => {
:display-value="$q.lang.table.columns"
/>
</q-toolbar>
<d-table
flat
dense
bordered
virtual-scroll
:rows="rows.length !== 0 ? rows:[]"
:columns="columns"
:grid="!mode"
:filter="filter"
:rows-per-page-options="[10, 25, 50, 100]"
:visible-columns="visibleColumns"
:virtual-scroll-sticky-size-start="48"
>
<template v-slot:header="props">
<q-tr :props="props">
<q-th v-for="col in props.cols" :key="col.name" :props="props">
<span class="text-weight-medium">{{ col.label }}</span>
</q-th>
<q-th auto-width />
</q-tr>
</template>
<d-table
flat
dense
bordered
virtual-scroll
:rows="rows.length !== 0 ? rows : []"
:columns="columns"
:grid="!mode"
:filter="filter"
:rows-per-page-options="[10, 25, 50, 100]"
:visible-columns="visibleColumns"
:virtual-scroll-sticky-size-start="48"
>
<template v-slot:header="props">
<q-tr :props="props">
<q-th v-for="col in props.cols" :key="col.name" :props="props">
<span class="text-weight-medium">{{ col.label }}</span>
</q-th>
<q-th auto-width />
</q-tr>
</template>
<template v-if="mode" v-slot:body="props">
<q-tr :props="props" class="cursor-pointer">
<q-td v-for="(col, index) in props.cols" :key="col.name">
<div v-if="col.name == 'insignia'">
{{ props.row.insignia ? `${props.row.insignia.name} ` : "-"
}}{{
props.row.insignia.shortName
? `(${props.row.insignia.shortName})`
: ""
}}
</div>
<div v-else>
{{ col.value ? col.value : "-" }}
</div>
</q-td>
<q-td auto-width>
<template v-if="mode" v-slot:body="props">
<q-tr :props="props" class="cursor-pointer">
<q-td v-for="(col, index) in props.cols" :key="col.name">
<div v-if="col.name == 'insignia'">
{{ props.row.insignia ? `${props.row.insignia.name} ` : "-"
}}{{
props.row.insignia.shortName
? `(${props.row.insignia.shortName})`
: ""
}}
</div>
<div v-else>
{{ col.value ? col.value : "-" }}
</div>
</q-td>
<q-td auto-width>
<q-btn
color="info"
flat
dense
round
size="14px"
icon="mdi-history"
@click="onHistory(props.row.id)"
>
<q-tooltip>ประวแกไขเครองราชอสรยาภรณ</q-tooltip>
</q-btn>
</q-td>
</q-tr>
</template>
<template v-else v-slot:item="props">
<div class="q-mb-xs col-xs-12 col-sm-6 col-md-4 col-lg-3">
<q-card bordered flat>
<q-list dense class="q-mt-lg relative-position">
<q-btn
icon="mdi-history"
color="info"
flat
dense
round
size="14px"
icon="mdi-history"
class="absolute_button"
@click="onHistory(props.row.id)"
>
<q-tooltip>ประวแกไขเครองราชอสรยาภรณ</q-tooltip>
</q-btn>
</q-td>
</q-tr>
</template>
<template v-else v-slot:item="props">
<div class="q-mb-xs col-xs-12 col-sm-6 col-md-4 col-lg-3">
<q-card bordered flat>
<q-list dense class="q-mt-lg relative-position">
<q-btn
icon="mdi-history"
color="info"
flat
dense
round
size="14px"
class="absolute_button"
@click="onHistory(props.row.id)"
>
<q-tooltip>ประวแกไขเครองราชอสรยาภรณ</q-tooltip>
</q-btn>
<q-item v-for="col in props.cols" :key="col.name">
<q-item-section class="fix_top">
<q-item-label class="text-grey-6 text-weight-medium">{{
col.label
}}</q-item-label>
</q-item-section>
<q-item-section v-if="col.name == 'insignia'" class="fix_top">
<q-item-label class="text-dark text-weight-medium"
>{{
props.row.insignia
? `${props.row.insignia.name} `
: "-"
}}{{
props.row.insignia.shortName
? `(${props.row.insignia.shortName})`
: ""
}}</q-item-label
>
</q-item-section>
<q-item-section v-else class="fix_top">
<q-item-label class="text-dark text-weight-medium">{{
col.value ? col.value : "-"
}}</q-item-label>
</q-item-section>
</q-item>
</q-list>
</q-card>
</div>
</template>
</d-table>
<q-item v-for="col in props.cols" :key="col.name">
<q-item-section class="fix_top">
<q-item-label class="text-grey-6 text-weight-medium">{{
col.label
}}</q-item-label>
</q-item-section>
<q-item-section v-if="col.name == 'insignia'" class="fix_top">
<q-item-label class="text-dark text-weight-medium"
>{{
props.row.insignia ? `${props.row.insignia.name} ` : "-"
}}{{
props.row.insignia.shortName
? `(${props.row.insignia.shortName})`
: ""
}}</q-item-label
>
</q-item-section>
<q-item-section v-else class="fix_top">
<q-item-label class="text-dark text-weight-medium">{{
col.value ? col.value : "-"
}}</q-item-label>
</q-item-section>
</q-item>
</q-list>
</q-card>
</div>
</template>
</d-table>
</div>
<DialogHistory
v-model:modal="modalHistory"