Merge branch 'develop' into devTee

This commit is contained in:
setthawutttty 2025-03-20 15:01:33 +07:00
commit 6c72cc5538
13 changed files with 880 additions and 426 deletions

View file

@ -248,7 +248,7 @@ async function onDownloadFile(id: string, profileId: string) {
.get(
config.API.subFileByFileName(
"ทะเบียนประวัติ",
"ประกาศเกียรติคุณ",
"เอกสารความสามารถพิเศษ",
profileId,
id,
"เอกสารหลักฐาน"
@ -328,6 +328,7 @@ onMounted(async () => {
<span class="text-weight-medium">{{ col.label }}</span>
</q-th>
<q-th auto-width />
<q-th auto-width />
</q-tr>
</template>
@ -344,7 +345,6 @@ onMounted(async () => {
{{ col.value ? col.value : "-" }}
</div>
</q-td>
<q-td auto-width>
<q-btn
v-if="props.row.isUpload == true"
@ -357,6 +357,9 @@ onMounted(async () => {
>
<q-tooltip>ดาวนโหลด</q-tooltip>
</q-btn>
</q-td>
<q-td auto-width>
<q-btn
color="info"
flat

View file

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

View file

@ -6,6 +6,7 @@ import { ref, onMounted } from "vue";
import http from "@/plugins/http";
import config from "@/app.config";
import { useDataStore } from "@/stores/data";
import { useRegistryDataStore } from "@/modules/10_registry/store/Main";
import type { DisciplineDetail } from "@/modules/10_registry/interface/index/Main";
@ -15,6 +16,7 @@ const link = ref<string>("");
const $q = useQuasar();
const mixin = useCounterMixin();
const dataStore = useDataStore();
const { getPathUploadFlie } = useRegistryDataStore();
const { showLoader, hideLoader, messageError, date2Thai, onSearchDataTable } =
mixin;
@ -26,6 +28,8 @@ const rowsHistory = ref<DisciplineDetail[]>([]);
const rowsHistoryData = ref<DisciplineDetail[]>([]);
const mode = ref<boolean>($q.screen.gt.xs);
const fileGroup = ref<string>("เอกสารวินัย");
const modalHistory = ref<boolean>(false);
/** ตัวแปรข้อมูล */
@ -179,6 +183,11 @@ function getHistory() {
});
}
async function onDownloadFile(id: string, profileId: string) {
const data = await getPathUploadFlie(fileGroup.value, profileId, id);
window.open(data.downloadUrl, "_blank");
}
function onSearch() {
rows.value = onSearchDataTable(
filter.value,
@ -247,6 +256,7 @@ onMounted(async () => {
<span class="text-weight-medium">{{ col.label }}</span>
</q-th>
<q-th auto-width />
<q-th auto-width />
</q-tr>
</template>
@ -263,6 +273,20 @@ onMounted(async () => {
{{ col.value ? col.value : "-" }}
</div>
</q-td>
<q-td auto-width>
<q-btn
v-if="props.row.isUpload"
color="green"
flat
dense
round
size="14px"
icon="mdi-file-document-outline"
@click="onDownloadFile(props.row.id, props.row.profileId)"
>
<q-tooltip>ดาวนโหลด</q-tooltip>
</q-btn>
</q-td>
<q-td auto-width>
<q-btn
color="info"
@ -282,18 +306,31 @@ onMounted(async () => {
<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>
<div class="row absolute_button">
<q-btn
v-if="props.row.isUpload"
color="green"
flat
dense
round
size="14px"
icon="mdi-file-document-outline"
@click="onDownloadFile(props.row.id, props.row.profileId)"
>
<q-tooltip>ดาวนโหลด</q-tooltip>
</q-btn>
<q-btn
icon="mdi-history"
color="info"
flat
dense
round
size="14px"
@click="onHistory(props.row.id)"
>
<q-tooltip>ประวแกไขว</q-tooltip>
</q-btn>
</div>
<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">{{
@ -331,5 +368,6 @@ onMounted(async () => {
.fix_top {
justify-content: start !important;
margin-top: 10px;
}
</style>

View file

@ -6,6 +6,7 @@ import { ref, reactive, onMounted } from "vue";
import http from "@/plugins/http";
import config from "@/app.config";
import { useDataStore } from "@/stores/data";
import { useRegistryDataStore } from "@/modules/10_registry/store/Main";
import type { DutyFormType } from "@/modules/10_registry/interface/index/Main";
//history dialog
@ -22,6 +23,7 @@ const rowsHistoryData = ref<DutyFormType[]>([]);
const $q = useQuasar();
const mode = ref<any>($q.screen.gt.xs);
const mixin = useCounterMixin();
const { getPathUploadFlie } = useRegistryDataStore();
const { showLoader, hideLoader, messageError, date2Thai, onSearchDataTable } =
mixin;
@ -241,6 +243,8 @@ const columnsHistory = ref<QTableProps["columns"]>([
},
]);
const fileGroup = ref<string>("เอกสารปฏิบัติราชการพิเศษ");
function onHistory(id: string) {
modalHistory.value = true;
idByRow.value = id;
@ -282,6 +286,11 @@ function getHistory() {
});
}
async function onDownloadFile(id: string, profileId: string) {
const data = await getPathUploadFlie(fileGroup.value, profileId, id);
window.open(data.downloadUrl, "_blank");
}
function onSearch() {
rows.value = onSearchDataTable(
filter.value,
@ -352,6 +361,7 @@ onMounted(async () => {
<span class="text-weight-medium">{{ col.label }}</span>
</q-th>
<q-th auto-width />
<q-th auto-width />
</q-tr>
</template>
@ -368,6 +378,21 @@ onMounted(async () => {
{{ col.value ? col.value : "-" }}
</div>
</q-td>
<q-td auto-width>
<q-btn
v-if="props.row.isUpload"
color="green"
flat
dense
round
size="14px"
icon="mdi-file-document-outline"
@click="onDownloadFile(props.row.id, props.row.profileId)"
>
<q-tooltip>ดาวนโหลด</q-tooltip>
</q-btn>
</q-td>
<q-td auto-width>
<q-btn
color="info"
@ -387,18 +412,31 @@ onMounted(async () => {
<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>
<div class="row absolute_button">
<q-btn
v-if="props.row.isUpload"
color="green"
flat
dense
round
size="14px"
icon="mdi-file-document-outline"
@click="onDownloadFile(props.row.id, props.row.profileId)"
>
<q-tooltip>ดาวนโหลด</q-tooltip>
</q-btn>
<q-btn
icon="mdi-history"
color="info"
flat
dense
round
size="14px"
@click="onHistory(props.row.id)"
>
<q-tooltip>ประวแกไขปฏราชการพเศษ</q-tooltip>
</q-btn>
</div>
<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">{{
@ -417,6 +455,7 @@ onMounted(async () => {
</template>
</d-table>
</div>
<DialogHistory
v-model:modal="modalHistory"
:title="'ประวัติแก้ไขปฏิบัติราชการพิเศษ'"
@ -436,5 +475,6 @@ onMounted(async () => {
.fix_top {
justify-content: start !important;
margin-top: 10px;
}
</style>

View file

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

View file

@ -73,10 +73,24 @@ const baseColumns = ref<QTableColumn[]>([
.toString()
.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
},
{
name: "commandDateSign",
align: "left",
label: "วันที่ลงนาม",
sortable: true,
field: "commandDateSign",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
format: (v) => date2Thai(v),
sort: (a: string, b: string) =>
a
.toString()
.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
},
{
name: "posNo",
align: "left",
label: "ตำแหน่งเลขที่",
label: link.value === "-employee" ? "ตำแหน่งเลขที่" : "เลขที่ตำแหน่ง",
sortable: true,
field: "posNo",
headerStyle: "font-size: 14px",
@ -109,7 +123,7 @@ const baseColumns = ref<QTableColumn[]>([
{
name: "positionType",
align: "left",
label: link.value === "-employee" ? "กลุ่มงาน" : "ประเภทตำแหน่ง",
label: link.value === "-employee" ? "กลุ่มงาน" : "ตำแหน่งประเภท",
sortable: true,
field: "positionType",
headerStyle: "font-size: 14px",
@ -150,28 +164,6 @@ const baseColumns = ref<QTableColumn[]>([
sort: (a: string, b: string) =>
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
},
{
name: "amount",
align: "left",
label: link.value === "-employee" ? "ค่าตอบแทนรายเดือน" : "เงินเดือน",
sortable: true,
field: "amount",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
format(v, row) {
return row.amount
? `${row.amount.toLocaleString()}${
row.amountSpecial !== 0 && row.amountSpecial
? ` (${row.amountSpecial.toLocaleString()})`
: ""
}`
: "-";
},
sort: (a: string, b: string) =>
a
.toString()
.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
},
{
name: "commandNo",
align: "left",
@ -180,7 +172,7 @@ const baseColumns = ref<QTableColumn[]>([
field: "commandNo",
format(val, row) {
return row.commandNo && row.commandYear
? `${row.commandNo}/${row.commandYear}`
? `${row.commandNo}/${Number(row.commandYear) + 543}`
: "";
},
headerStyle: "font-size: 14px",
@ -196,26 +188,9 @@ const baseColumns = ref<QTableColumn[]>([
field: "commandCode",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
format(val, row) {
return store.convertCommandCodeName(val);
},
sort: (a: string, b: string) =>
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
},
{
name: "commandDateSign",
align: "left",
label: "วันที่ลงนาม",
sortable: true,
field: "commandDateSign",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
format: (v) => date2Thai(v),
sort: (a: string, b: string) =>
a
.toString()
.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
},
{
name: "organization",
align: "left",
@ -236,6 +211,28 @@ const baseColumns = ref<QTableColumn[]>([
sort: (a: string, b: string) =>
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
},
{
name: "amount",
align: "left",
label: link.value === "-employee" ? "ค่าจ้าง" : "เงินเดือน",
sortable: true,
field: "amount",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
format(v, row) {
return row.amount
? `${row.amount.toLocaleString()}${
row.amountSpecial !== 0 && row.amountSpecial
? ` (${row.amountSpecial.toLocaleString()})`
: ""
}`
: "-";
},
sort: (a: string, b: string) =>
a
.toString()
.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
},
{
name: "remark",
align: "left",
@ -245,7 +242,9 @@ const baseColumns = ref<QTableColumn[]>([
headerStyle: "font-size: 14px",
style: "font-size: 14px",
sort: (a: string, b: string) =>
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
a
.toString()
.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
},
{
name: "lastUpdateFullName",
@ -292,18 +291,37 @@ const baseVisibleColumns = ref<string[]>([
"lastUpdatedAt",
]);
const columns = ref<QTableColumn[]>(
baseColumns.value.filter(
const columns = computed<QTableColumn[]>(() => {
if (!checkType.value) {
if (baseColumns.value) {
return baseColumns.value.filter(
(column) =>
column.name !== "positionExecutive" &&
column.name !== "lastUpdateFullName" &&
column.name !== "lastUpdatedAt"
);
}
}
return baseColumns.value.filter(
(e: QTableColumn) =>
e.name !== "lastUpdateFullName" && e.name !== "lastUpdatedAt"
)
);
);
});
const visibleColumns = ref<String[]>(
baseVisibleColumns.value.filter(
(e: string) => e !== "lastUpdateFullName" && e !== "lastUpdatedAt"
)
);
const columnsHistory = ref<QTableColumn[]>(baseColumns.value);
const columnsHistory = computed<QTableColumn[]>(() => {
if (!checkType.value) {
if (baseColumns.value) {
return baseColumns.value.filter(
(column) => column.name !== "positionExecutive"
);
}
}
return baseColumns.value;
});
const visibleColumnsHistory = ref<string[]>(baseVisibleColumns.value);
/** เปิด dialog ประวัติ*/
@ -523,6 +541,12 @@ onMounted(async () => {
<div v-else-if="col.name == 'status'">
{{ props.row.status ? props.row.status : "-" }}
</div>
<div
v-else-if="col.name == 'organization'"
class="table_ellipsis"
>
{{ col.value ? col.value : "-" }}
</div>
<div v-else>
{{ col.value ? col.value : "-" }}
</div>

View file

@ -1,5 +1,5 @@
<script setup lang="ts">
import { useQuasar, type QTableProps } from "quasar";
import { useQuasar, type QTableColumn } from "quasar";
import { ref, onMounted, computed } from "vue";
import http from "@/plugins/http";
@ -16,8 +16,14 @@ const link = ref<string>("");
const $q = useQuasar();
const dataPerson = useDataStore();
const mixin = useCounterMixin();
const { showLoader, hideLoader, messageError, date2Thai, onSearchDataTable } =
mixin;
const {
showLoader,
hideLoader,
messageError,
date2Thai,
onSearchDataTable,
findOrgName,
} = mixin;
const idByRow = ref<string>("");
const rows = ref<SalaryFormType[]>([]);
@ -32,24 +38,272 @@ const checkType = ref<boolean>(
const modalHistory = ref<boolean>(false);
/** ตัวแปรข้อมูล */
const baseColumns = ref<QTableColumn[]>([
{
name: "commandDateAffect",
align: "left",
label: "วันที่คำสั่งมีผล",
sortable: true,
field: "commandDateAffect",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
format: (v) => date2Thai(v),
sort: (a: string, b: string) =>
a
.toString()
.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
},
{
name: "commandDateSign",
align: "left",
label: "วันที่ลงนาม",
sortable: true,
field: "commandDateSign",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
format: (v) => date2Thai(v),
sort: (a: string, b: string) =>
a
.toString()
.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
},
{
name: "posNo",
align: "left",
label: link.value === "-employee" ? "ตำแหน่งเลขที่" : "เลขที่ตำแหน่ง",
sortable: true,
field: "posNo",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
format(val, row) {
return row.posNoAbb && row.posNo
? `${row.posNoAbb}${row.posNo}`
: row.posNo
? row.posNo
: "-";
},
sort: (a: string, b: string) =>
a
.toString()
.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
},
{
name: "positionName",
align: "left",
label: link.value === "-employee" ? "ตำแหน่ง" : "ตำแหน่งในสายงาน",
sortable: true,
field: "positionName",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
sort: (a: string, b: string) =>
a
.toString()
.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
},
{
name: "positionType",
align: "left",
label: link.value === "-employee" ? "กลุ่มงาน" : "ตำแหน่งประเภท",
sortable: true,
field: "positionType",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
sort: (a: string, b: string) =>
a
.toString()
.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
},
{
name: "positionLevel",
align: "left",
label: link.value === "-employee" ? "ระดับชั้นงาน" : "ระดับ",
sortable: true,
field: "positionLevel",
format(val, row) {
return `${
row.positionLevel
? row.positionLevel
: row.positionCee
? row.positionCee
: "-"
}`;
},
headerStyle: "font-size: 14px",
style: "font-size: 14px",
sort: (a: string, b: string) =>
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
},
{
name: "positionExecutive",
align: "left",
label: "ตำแหน่งทางการบริหาร",
sortable: true,
field: "positionExecutive",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
sort: (a: string, b: string) =>
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
},
{
name: "commandNo",
align: "left",
label: "เลขที่คำสั่ง",
sortable: true,
field: "commandNo",
format(val, row) {
return row.commandNo && row.commandYear
? `${row.commandNo}/${Number(row.commandYear) + 543}`
: "";
},
headerStyle: "font-size: 14px",
style: "font-size: 14px",
sort: (a: string, b: string) =>
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
},
{
name: "commandCode",
align: "left",
label: "ประเภทคำสั่ง",
sortable: true,
field: "commandCode",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
sort: (a: string, b: string) =>
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
},
{
name: "organization",
align: "left",
label: "สังกัด",
sortable: true,
field: "organization",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
format(val, row) {
return findOrgName({
root: row.orgRoot,
child1: row.orgChild1,
child2: row.orgChild2,
child3: row.orgChild3,
child4: row.orgChild4,
});
},
sort: (a: string, b: string) =>
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
},
{
name: "amount",
align: "left",
label: link.value === "-employee" ? "ค่าจ้าง" : "เงินเดือน",
sortable: true,
field: "amount",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
format(v, row) {
return row.amount
? `${row.amount.toLocaleString()}${
row.amountSpecial !== 0 && row.amountSpecial
? ` (${row.amountSpecial.toLocaleString()})`
: ""
}`
: "-";
},
sort: (a: string, b: string) =>
a
.toString()
.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
},
{
name: "mouthSalaryAmount",
align: "left",
label: "เงินค่าตอบแทนรายเดือน",
sortable: true,
field: "mouthSalaryAmount",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
format: (v) => Number(v).toLocaleString(),
sort: (a: string, b: string) =>
a
.toString()
.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
},
{
name: "positionSalaryAmount",
align: "left",
label: "เงินประจำตำแหน่ง",
sortable: true,
field: "positionSalaryAmount",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
format: (v) => Number(v).toLocaleString(),
sort: (a: string, b: string) =>
a
.toString()
.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
},
{
name: "remark",
align: "left",
label: "หมายเหตุ",
sortable: true,
field: "remark",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
sort: (a: string, b: string) =>
a
.toString()
.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
},
{
name: "lastUpdateFullName",
align: "left",
label: "ผู้ดำเนินการ",
sortable: true,
field: "lastUpdateFullName",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
sort: (a: string, b: string) =>
a
.toString()
.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
},
{
name: "lastUpdatedAt",
align: "left",
label: "วันที่แก้ไข",
sortable: true,
field: "lastUpdatedAt",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
format: (v) => date2Thai(v, false, true),
sort: (a: string, b: string) =>
a
.toString()
.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
},
]);
const visibleColumns = ref<string[]>([
"commandDateAffect",
"amount",
"positionSalaryAmount",
"mouthSalaryAmount",
"posNo",
"positionName",
"positionType",
"positionLevel",
"commandName",
"refCommandNo",
"positionExecutive",
"amount",
"positionSalaryAmount",
"mouthSalaryAmount",
"commandNo",
"commandCode",
"commandDateSign",
"organization",
"remark",
"lastUpdateFullName",
"lastUpdatedAt",
]);
const columns = computed(() => {
if (checkType.value == false) {
if (link.value === "-employee") {
if (baseColumns.value) {
return baseColumns.value.filter(
(column) =>
@ -61,51 +315,71 @@ const columns = computed(() => {
return baseColumns.value;
});
const baseColumns = ref<QTableProps["columns"]>([
const visibleColumnsHistory = ref<string[]>([
"commandDateAffect",
"posNo",
"positionName",
"positionType",
"positionLevel",
"positionExecutive",
"amount",
"positionSalaryAmount",
"mouthSalaryAmount",
"commandNo",
"commandCode",
"commandDateSign",
"organization",
"remark",
"lastUpdateFullName",
"lastUpdatedAt",
]);
const columnsHistory = computed(() => {
if (link.value === "-employee") {
if (baseColumnsHistory.value) {
return baseColumnsHistory.value.filter(
(column: QTableColumn) =>
column.name !== "positionSalaryAmount" &&
column.name !== "mouthSalaryAmount"
);
}
}
return baseColumns.value;
});
const baseColumnsHistory = ref<QTableColumn[]>([
{
name: "commandDateAffect",
align: "left",
label: "วัน เดือน ปี",
label: "วันที่คำสั่งมีผล",
sortable: true,
field: "commandDateAffect",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
format: (v) => date2Thai(v),
sort: (a: string, b: string) =>
a
.toString()
.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
},
{
name: "amount",
name: "commandDateSign",
align: "left",
label: checkType.value ? "เงินเดือน" : "ค่าตอบแทนรายเดือน",
label: "วันที่ลงนาม",
sortable: true,
field: "amount",
field: "commandDateSign",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
format: (v) => Number(v).toLocaleString(),
},
{
name: "positionSalaryAmount",
align: "left",
label: "เงินประจำตำแหน่ง",
sortable: true,
field: "positionSalaryAmount",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
format: (v) => Number(v).toLocaleString(),
},
{
name: "mouthSalaryAmount",
align: "left",
label: "เงินค่าตอบแทนรายเดือน",
sortable: true,
field: "mouthSalaryAmount",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
format: (v) => Number(v).toLocaleString(),
format: (v) => date2Thai(v),
sort: (a: string, b: string) =>
a
.toString()
.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
},
{
name: "posNo",
align: "left",
label: "ตำแหน่งเลขที่",
label: link.value === "-employee" ? "ตำแหน่งเลขที่" : "เลขที่ตำแหน่ง",
sortable: true,
field: "posNo",
headerStyle: "font-size: 14px",
@ -117,33 +391,43 @@ const baseColumns = ref<QTableProps["columns"]>([
? row.posNo
: "-";
},
sort: (a: string, b: string) =>
a
.toString()
.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
},
{
name: "positionName",
align: "left",
label: "ตำแหน่ง",
label: link.value === "-employee" ? "ตำแหน่ง" : "ตำแหน่งในสายงาน",
sortable: true,
field: "positionName",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
sort: (a: string, b: string) =>
a
.toString()
.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
},
{
name: "positionType",
align: "left",
label: "ประเภทตำแหน่ง",
label: link.value === "-employee" ? "กลุ่มงาน" : "ตำแหน่งประเภท",
sortable: true,
field: "positionType",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
sort: (a: string, b: string) =>
a
.toString()
.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
},
{
name: "positionLevel",
align: "left",
label: "ระดับ",
label: link.value === "-employee" ? "ระดับชั้นงาน" : "ระดับ",
sortable: true,
field: "positionLevel",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
format(val, row) {
return `${
row.positionLevel
@ -153,207 +437,10 @@ const baseColumns = ref<QTableProps["columns"]>([
: "-"
}`;
},
},
{
name: "commandName",
align: "left",
label: "เอกสารอ้างอิง",
sortable: true,
field: "commandName",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
},
{
name: "refCommandNo",
align: "left",
label: "เลขที่คำสั่ง",
sortable: true,
field: "refCommandNo",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
format(val, row) {
return row.commandNo && row.commandYear
? `${row.commandNo}/${row.commandYear}`
: "";
},
},
{
name: "remark",
align: "left",
label: "หมายเหตุ",
sortable: true,
field: "remark",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
},
{
name: "lastUpdateFullName",
align: "left",
label: "ผู้ดำเนินการ",
sortable: true,
field: "lastUpdateFullName",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
},
{
name: "lastUpdatedAt",
align: "left",
label: "วันที่แก้ไข",
sortable: true,
field: "lastUpdatedAt",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
format: (v) => date2Thai(v, false, true),
},
]);
const visibleColumnsHistory = ref<string[]>([
"commandDateAffect",
"amount",
"positionSalaryAmount",
"mouthSalaryAmount",
"oc",
"positionName",
"posNo",
"positionLine",
"positionPathSide",
"positionType",
"positionLevel",
"positionExecutive",
"positionExecutiveSide",
"salaryClass",
"commandName",
"refCommandNo",
"remark",
"lastUpdateFullName",
"lastUpdatedAt",
]);
const columnsHistory = computed(() => {
if (checkType.value == false) {
if (baseColumnsHistory.value) {
return baseColumnsHistory.value.filter(
(column) =>
column.name !== "positionSalaryAmount" &&
column.name !== "mouthSalaryAmount"
);
}
}
return baseColumns.value;
});
const baseColumnsHistory = ref<QTableProps["columns"]>([
{
name: "commandDateAffect",
align: "left",
label: "วัน เดือน ปี",
sortable: true,
field: "commandDateAffect",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
format: (v) => date2Thai(v),
},
{
name: "amount",
align: "left",
label: checkType.value ? "เงินเดือน" : "ค่าตอบแทนรายเดือน",
sortable: true,
field: "amount",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
format: (v) => Number(v).toLocaleString(),
},
{
name: "positionSalaryAmount",
align: "left",
label: "เงินประจำตำแหน่ง",
sortable: true,
field: "positionSalaryAmount",
headerStyle: "font-size: 14px",
format: (v) => Number(v).toLocaleString(),
style: "font-size: 14px",
},
{
name: "mouthSalaryAmount",
align: "left",
label: "เงินค่าตอบแทนรายเดือน",
sortable: true,
field: "mouthSalaryAmount",
headerStyle: "font-size: 14px",
format: (v) => Number(v).toLocaleString(),
style: "font-size: 14px",
},
{
name: "oc",
align: "left",
label: "สังกัด",
sortable: true,
field: "oc",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
},
{
name: "posNo",
align: "left",
label: "ตำแหน่งเลขที่",
sortable: true,
field: "posNo",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
format(val, row) {
return row.posNoAbb && row.posNo
? `${row.posNoAbb}${row.posNo}`
: row.posNo
? row.posNo
: "-";
},
},
{
name: "positionName",
align: "left",
label: "ตำแหน่ง",
sortable: true,
field: "positionName",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
},
{
name: "positionLine",
align: "left",
label: "สายงาน",
sortable: true,
field: "positionLine",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
},
{
name: "positionPathSide",
align: "left",
label: "ด้าน/สาขา",
sortable: true,
field: "positionPathSide",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
},
{
name: "positionType",
align: "left",
label: "ตำแหน่งประเภท",
sortable: true,
field: "positionType",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
},
{
name: "positionLevel",
align: "left",
label: "ระดับ",
sortable: true,
field: "positionLevel",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
sort: (a: string, b: string) =>
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
},
{
name: "positionExecutive",
@ -363,48 +450,107 @@ const baseColumnsHistory = ref<QTableProps["columns"]>([
field: "positionExecutive",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
sort: (a: string, b: string) =>
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
},
{
name: "positionExecutiveSide",
align: "left",
label: "ด้านทางการบริหาร",
sortable: true,
field: "positionExecutiveSide",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
},
{
name: "salaryClass",
align: "left",
label: "ตำแหน่ง (รายละเอียด)",
sortable: true,
field: "salaryClass",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
},
{
name: "commandName",
align: "left",
label: "เอกสารอ้างอิง",
sortable: true,
field: "commandName",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
},
{
name: "refCommandNo",
name: "commandNo",
align: "left",
label: "เลขที่คำสั่ง",
sortable: true,
field: "refCommandNo",
field: "commandNo",
format(val, row) {
return row.commandNo && row.commandYear
? `${row.commandNo}/${Number(row.commandYear) + 543}`
: "";
},
headerStyle: "font-size: 14px",
style: "font-size: 14px",
sort: (a: string, b: string) =>
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
},
{
name: "commandCode",
align: "left",
label: "ประเภทคำสั่ง",
sortable: true,
field: "commandCode",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
sort: (a: string, b: string) =>
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
},
{
name: "organization",
align: "left",
label: "สังกัด",
sortable: true,
field: "organization",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
format(val, row) {
return row.commandNo && row.commandYear
? `${row.commandNo}/${row.commandYear}`
: "";
return findOrgName({
root: row.orgRoot,
child1: row.orgChild1,
child2: row.orgChild2,
child3: row.orgChild3,
child4: row.orgChild4,
});
},
sort: (a: string, b: string) =>
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
},
{
name: "amount",
align: "left",
label: link.value === "-employee" ? "ค่าจ้าง" : "เงินเดือน",
sortable: true,
field: "amount",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
format(v, row) {
return row.amount
? `${row.amount.toLocaleString()}${
row.amountSpecial !== 0 && row.amountSpecial
? ` (${row.amountSpecial.toLocaleString()})`
: ""
}`
: "-";
},
sort: (a: string, b: string) =>
a
.toString()
.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
},
{
name: "mouthSalaryAmount",
align: "left",
label: "เงินค่าตอบแทนรายเดือน",
sortable: true,
field: "mouthSalaryAmount",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
format: (v) => Number(v).toLocaleString(),
sort: (a: string, b: string) =>
a
.toString()
.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
},
{
name: "positionSalaryAmount",
align: "left",
label: "เงินประจำตำแหน่ง",
sortable: true,
field: "positionSalaryAmount",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
format: (v) => Number(v).toLocaleString(),
sort: (a: string, b: string) =>
a
.toString()
.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
},
{
name: "remark",
align: "left",
@ -413,6 +559,10 @@ const baseColumnsHistory = ref<QTableProps["columns"]>([
field: "remark",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
sort: (a: string, b: string) =>
a
.toString()
.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
},
{
name: "lastUpdateFullName",
@ -422,6 +572,10 @@ const baseColumnsHistory = ref<QTableProps["columns"]>([
field: "lastUpdateFullName",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
sort: (a: string, b: string) =>
a
.toString()
.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
},
{
name: "lastUpdatedAt",
@ -432,6 +586,10 @@ const baseColumnsHistory = ref<QTableProps["columns"]>([
headerStyle: "font-size: 14px",
style: "font-size: 14px",
format: (v) => date2Thai(v, false, true),
sort: (a: string, b: string) =>
a
.toString()
.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
},
]);
@ -562,6 +720,9 @@ onMounted(async () => {
<div v-else-if="col.name == 'status'">
{{ props.row.status ? props.row.status : "-" }}
</div>
<div v-else-if="col.name == 'organization'" class="table_ellipsis">
{{ col.value ? col.value : "-" }}
</div>
<div v-else>
{{ col.value ? col.value : "-" }}
</div>

View file

@ -6,6 +6,7 @@ import { ref, onMounted } from "vue";
import http from "@/plugins/http";
import config from "@/app.config";
import { useDataStore } from "@/stores/data";
import { useRegistryDataStore } from "@/modules/10_registry/store/Main";
import type { NopaidFormType } from "@/modules/10_registry/interface/index/Main";
@ -24,6 +25,7 @@ const mode = ref<boolean>($q.screen.gt.xs);
const mixin = useCounterMixin();
const { showLoader, hideLoader, messageError, date2Thai, onSearchDataTable } =
mixin;
const { getPathUploadFlie } = useRegistryDataStore();
const modalHistory = ref<boolean>(false);
/** ตัวแปรข้อมูล */
@ -218,6 +220,8 @@ const columnsHistory = ref<QTableProps["columns"]>([
},
]);
const fileGroup = ref<string>("เอกสารบันทึกวันที่ไม่ได้รับเงินเดือน");
function onHistory(id: string) {
modalHistory.value = true;
idByRow.value = id;
@ -261,6 +265,11 @@ function getHistory() {
});
}
async function onDownloadFile(id: string, profileId: string) {
const data = await getPathUploadFlie(fileGroup.value, profileId, id);
window.open(data.downloadUrl, "_blank");
}
function onSearch() {
rows.value = onSearchDataTable(
filter.value,
@ -331,6 +340,7 @@ onMounted(async () => {
<span class="text-weight-medium">{{ col.label }}</span>
</q-th>
<q-th auto-width />
<q-th auto-width />
</q-tr>
</template>
@ -347,6 +357,20 @@ onMounted(async () => {
{{ col.value ? col.value : "-" }}
</div>
</q-td>
<q-td auto-width>
<q-btn
v-if="props.row.isUpload"
color="green"
flat
dense
round
size="14px"
icon="mdi-file-document-outline"
@click="onDownloadFile(props.row.id, props.row.profileId)"
>
<q-tooltip>ดาวนโหลด</q-tooltip>
</q-btn>
</q-td>
<q-td auto-width>
<q-btn
color="info"
@ -366,20 +390,33 @@ onMounted(async () => {
<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
<div class="row absolute_button">
<q-btn
v-if="props.row.isUpload"
color="green"
flat
dense
round
size="14px"
icon="mdi-file-document-outline"
@click="onDownloadFile(props.row.id, props.row.profileId)"
>
</q-btn>
<q-tooltip>ดาวนโหลด</q-tooltip>
</q-btn>
<q-btn
icon="mdi-history"
color="info"
flat
dense
round
size="14px"
@click="onHistory(props.row.id)"
>
<q-tooltip
>ประวแกไขบนทกวนทไมไดบเงนเดอนฯ</q-tooltip
>
</q-btn>
</div>
<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">{{
@ -398,6 +435,7 @@ onMounted(async () => {
</template>
</d-table>
</div>
<DialogHistory
v-model:modal="modalHistory"
:title="'ประวัติแก้ไขบันทึกวันที่ไม่ได้รับเงินเดือนฯ'"
@ -417,5 +455,6 @@ onMounted(async () => {
.fix_top {
justify-content: start !important;
margin-top: 10px;
}
</style>

View file

@ -6,6 +6,7 @@ import { ref, reactive, onMounted } from "vue";
import http from "@/plugins/http";
import config from "@/app.config";
import { useDataStore } from "@/stores/data";
import { useRegistryDataStore } from "@/modules/10_registry/store/Main";
import type { CertificateDetail } from "@/modules/10_registry/interface/index/Main";
@ -18,6 +19,7 @@ const dataPerson = useDataStore();
const mixin = useCounterMixin();
const { showLoader, hideLoader, messageError, date2Thai, onSearchDataTable } =
mixin;
const { getPathUploadFlie } = useRegistryDataStore();
const idByRow = ref<string>("");
const rows = ref<CertificateDetail[]>([]);
@ -216,6 +218,9 @@ const columnsHistory = ref<QTableProps["columns"]>([
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
},
]);
const fileGroup = ref<string>("เอกสารใบอนุญาตประกอบวิชาชีพ");
function onHistory(id: string) {
modalHistory.value = true;
idByRow.value = id;
@ -263,6 +268,11 @@ function getHistory() {
});
}
async function onDownloadFile(id: string, profileId: string) {
const data = await getPathUploadFlie(fileGroup.value, profileId, id);
window.open(data.downloadUrl, "_blank");
}
function onSearch() {
rows.value = onSearchDataTable(
filter.value,
@ -333,6 +343,7 @@ onMounted(async () => {
<span class="text-weight-medium">{{ col.label }}</span>
</q-th>
<q-th auto-width />
<q-th auto-width />
</q-tr>
</template>
@ -349,6 +360,20 @@ onMounted(async () => {
{{ col.value ? col.value : "-" }}
</div>
</q-td>
<q-td auto-width>
<q-btn
v-if="props.row.isUpload"
color="green"
flat
dense
round
size="14px"
icon="mdi-file-document-outline"
@click="onDownloadFile(props.row.id, props.row.profileId)"
>
<q-tooltip>ดาวนโหลด</q-tooltip>
</q-btn>
</q-td>
<q-td auto-width>
<q-btn
color="info"
@ -368,18 +393,31 @@ onMounted(async () => {
<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>
<div class="row absolute_button">
<q-btn
v-if="props.row.isUpload"
color="green"
flat
dense
round
size="14px"
icon="mdi-file-document-outline"
@click="onDownloadFile(props.row.id, props.row.profileId)"
>
<q-tooltip>ดาวนโหลด</q-tooltip>
</q-btn>
<q-btn
icon="mdi-history"
color="info"
flat
dense
round
size="14px"
@click="onHistory(props.row.id)"
>
<q-tooltip>ประวแกไขใบอนญาตประกอบวชาช</q-tooltip>
</q-btn>
</div>
<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">{{
@ -398,6 +436,7 @@ onMounted(async () => {
</template>
</d-table>
</div>
<DialogHistory
v-model:modal="modalHistory"
:title="'ประวัติแก้ไขใบอนุญาตประกอบวิชาชีพ'"
@ -417,5 +456,6 @@ onMounted(async () => {
.fix_top {
justify-content: start !important;
margin-top: 10px;
}
</style>

View file

@ -6,6 +6,7 @@ import http from "@/plugins/http";
import config from "@/app.config";
import { useCounterMixin } from "@/stores/mixin";
import { useDataStore } from "@/stores/data";
import { useRegistryDataStore } from "@/modules/10_registry/store/Main";
import type { InsigniaFormType } from "@/modules/10_registry/interface/index/Main";
@ -25,6 +26,7 @@ const mode = ref<boolean>($q.screen.gt.xs);
const mixin = useCounterMixin();
const { showLoader, hideLoader, messageError, date2Thai, onSearchDataTable } =
mixin;
const { getPathUploadFlie } = useRegistryDataStore();
const modalHistory = ref<boolean>(false);
/** ตัวแปรข้อมูล */
@ -432,6 +434,8 @@ const columnsHistory = ref<QTableProps["columns"]>([
},
]);
const fileGroup = ref<string>("เครื่องราชฯ");
function onHistory(id: string) {
modalHistory.value = true;
idByRow.value = id;
@ -479,6 +483,11 @@ function getHistory() {
});
}
async function onDownloadFile(id: string, profileId: string) {
const data = await getPathUploadFlie(fileGroup.value, profileId, id);
window.open(data.downloadUrl, "_blank");
}
function onSearch() {
rows.value = onSearchDataTable(
filter.value,
@ -549,6 +558,7 @@ onMounted(async () => {
<span class="text-weight-medium">{{ col.label }}</span>
</q-th>
<q-th auto-width />
<q-th auto-width />
</q-tr>
</template>
@ -567,6 +577,20 @@ onMounted(async () => {
{{ col.value ? col.value : "-" }}
</div>
</q-td>
<q-td auto-width>
<q-btn
v-if="props.row.isUpload"
color="green"
flat
dense
round
size="14px"
icon="mdi-file-document-outline"
@click="onDownloadFile(props.row.id, props.row.profileId)"
>
<q-tooltip>ดาวนโหลด</q-tooltip>
</q-btn>
</q-td>
<q-td auto-width>
<q-btn
color="info"
@ -586,18 +610,32 @@ onMounted(async () => {
<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>
<div class="row absolute_button">
<q-btn
v-if="props.row.isUpload"
color="green"
flat
dense
round
size="14px"
icon="mdi-file-document-outline"
@click="onDownloadFile(props.row.id, props.row.profileId)"
>
<q-tooltip>ดาวนโหลด</q-tooltip>
</q-btn>
<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>
</div>
<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">{{
@ -647,5 +685,6 @@ onMounted(async () => {
.fix_top {
justify-content: start !important;
margin-top: 10px;
}
</style>

View file

@ -7,6 +7,7 @@ import config from "@/app.config";
import { useCounterMixin } from "@/stores/mixin";
import { useDataStore } from "@/stores/data";
import { useRegistryInFormationStore } from "@/modules/10_registry/store/registry";
import { useRegistryDataStore } from "@/modules/10_registry/store/Main";
import type { HonorFormData } from "@/modules/10_registry/interface/index/Main";
@ -27,6 +28,7 @@ const mode = ref<boolean>($q.screen.gt.xs);
const mixin = useCounterMixin();
const { showLoader, hideLoader, messageError, date2Thai, onSearchDataTable } =
mixin;
const { getPathUploadFlie } = useRegistryDataStore();
const modalHistory = ref<boolean>(false);
/** ตัวแปรข้อมูล */
@ -218,6 +220,8 @@ const columnsHistory = ref<QTableProps["columns"]>([
},
]);
const fileGroup = ref<string>("ประกาศเกียรติคุณ");
function onHistory(id: string) {
modalHistory.value = true;
idByRow.value = id;
@ -263,6 +267,11 @@ function getHistory() {
});
}
async function onDownloadFile(id: string, profileId: string) {
const data = await getPathUploadFlie(fileGroup.value, profileId, id);
window.open(data.downloadUrl, "_blank");
}
function onSearch() {
rows.value = onSearchDataTable(
filter.value,
@ -333,6 +342,7 @@ onMounted(async () => {
<span class="text-weight-medium">{{ col.label }}</span>
</q-th>
<q-th auto-width />
<q-th auto-width />
</q-tr>
</template>
@ -349,6 +359,20 @@ onMounted(async () => {
{{ col.value ? col.value : "-" }}
</div>
</q-td>
<q-td auto-width>
<q-btn
v-if="props.row.isUpload"
color="green"
flat
dense
round
size="14px"
icon="mdi-file-document-outline"
@click="onDownloadFile(props.row.id, props.row.profileId)"
>
<q-tooltip>ดาวนโหลด</q-tooltip>
</q-btn>
</q-td>
<q-td auto-width>
<q-btn
color="info"
@ -368,18 +392,32 @@ onMounted(async () => {
<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>
<div class="row absolute_button">
<q-btn
v-if="props.row.isUpload"
color="green"
flat
dense
round
size="14px"
icon="mdi-file-document-outline"
@click="onDownloadFile(props.row.id, props.row.profileId)"
>
<q-tooltip>ดาวนโหลด</q-tooltip>
</q-btn>
<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>
</div>
<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">{{
@ -398,6 +436,7 @@ onMounted(async () => {
</template>
</d-table>
</div>
<DialogHistory
v-model:modal="modalHistory"
:title="'ประวัติแก้ไขประกาศเกียรติคุณ'"
@ -417,5 +456,6 @@ onMounted(async () => {
.fix_top {
justify-content: start !important;
margin-top: 10px;
}
</style>

View file

@ -0,0 +1,38 @@
import { defineStore } from "pinia";
import { useQuasar } from "quasar";
import http from "@/plugins/http";
import config from "@/app.config";
import { useCounterMixin } from "@/stores/mixin";
const $q = useQuasar();
const mixin = useCounterMixin();
const { messageError } = mixin;
export const useRegistryDataStore = defineStore("RegistryDataStoreMain", () => {
async function getPathUploadFlie(
group: string,
profileId: string,
id: string
) {
try {
const res = await http.get(
config.API.subFileByFileName(
"ทะเบียนประวัติ",
group,
profileId,
id,
"เอกสารหลักฐาน"
)
);
return res.data;
} catch (err) {
messageError($q, err);
}
}
return {
// Function
getPathUploadFlie,
};
});

View file

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