Merge branch 'develop' into devTee
This commit is contained in:
commit
ed227359d1
22 changed files with 813 additions and 444 deletions
|
|
@ -14,7 +14,7 @@ export default {
|
|||
) => `${url}/sub-file/${name}/${group}/${id}/${subId}/${fileName}`,
|
||||
|
||||
file: (name: string, group: string, id: string) =>
|
||||
`${url}/sub/${name}/${group}/${id}`,
|
||||
`${url}/file/${name}/${group}/${id}`,
|
||||
fileByFile: (name: string, group: string, id: string, fileName: string) =>
|
||||
`${url}/sub/${name}/${group}/${id}/${fileName}`,
|
||||
`${url}/file/${name}/${group}/${id}/${fileName}`,
|
||||
};
|
||||
|
|
|
|||
|
|
@ -4,6 +4,8 @@ const registryNew = `${env.API_URI}/org/profile/`;
|
|||
|
||||
export default {
|
||||
registryNew,
|
||||
registryNewByProfileId: (profileId : string) => `${registryNew}${profileId}`,
|
||||
|
||||
// เครื่องราชฯ
|
||||
profileNewInsign: `${registryNew}insignia`,
|
||||
profileNewInsignByProfileId: (profileId: string) =>
|
||||
|
|
@ -48,8 +50,34 @@ profileNewEducationHisByEducationId: (educationsId: string) =>
|
|||
profileNewAbility: `${registryNew}ability`,
|
||||
profileNewAbilityByProfileId: (profileId: string) =>
|
||||
`${registryNew}ability/${profileId}`,
|
||||
profileNewAbilityByAbilityId: (educationId: string) =>
|
||||
`${registryNew}ability/${educationId}`,
|
||||
profileNewAbilityByAbilityId: (abilityId: string) =>
|
||||
`${registryNew}ability/${abilityId}`,
|
||||
profileNewAbilityHisByAbilityId: (abilityId: string) =>
|
||||
`${registryNew}ability/history/${abilityId}`,
|
||||
};
|
||||
|
||||
// ใบอนุญาตประกอบวิชาชีพ
|
||||
profileNewCertificate: `${registryNew}certificate`,
|
||||
profileNewCertificateByProfileId: (profileId: string) =>
|
||||
`${registryNew}certificate/${profileId}`,
|
||||
profileNewCertificateByCertificateId: (certificateId: string) =>
|
||||
`${registryNew}certificate/${certificateId}`,
|
||||
profileNewCertificateHisByCertificateId: (certificateId: string) =>
|
||||
`${registryNew}certificate/history/${certificateId}`,
|
||||
|
||||
// ข้อมูลอื่นๆ
|
||||
profileNewOther: `${registryNew}other`,
|
||||
profileNewOtherByProfileId: (profileId: string) =>
|
||||
`${registryNew}other/${profileId}`,
|
||||
profileNewOtherById: (dataId: string) => `${registryNew}other/${dataId}`,
|
||||
profileNewOtherHisById: (dataId: string) =>
|
||||
`${registryNew}other/history/${dataId}`,
|
||||
|
||||
// ข้อมูลครอบครัว
|
||||
profileNewFamily: `${registryNew}family`,
|
||||
profileNewFamilyByProfileId: (profileId: string) =>
|
||||
`${registryNew}family/${profileId}`,
|
||||
profileNewFamilyByFamilyId: (familyId: string) =>
|
||||
`${registryNew}family/${familyId}`,
|
||||
profileNewFamilyeHisByFamilyId: (familyId: string) =>
|
||||
`${registryNew}family/history/${familyId}`,
|
||||
};
|
||||
|
|
|
|||
|
|
@ -228,7 +228,12 @@ function validateForm() {
|
|||
}
|
||||
|
||||
async function onSubmit() {
|
||||
if (posLevelName.value.length > 0) {
|
||||
if (
|
||||
posLevelName.value.length > 0 &&
|
||||
posLevelAuthority.value.length > 0 &&
|
||||
posLevelRank.value !== undefined &&
|
||||
posLevelRank.value > 0
|
||||
) {
|
||||
dialogConfirm(
|
||||
$q,
|
||||
async () => {
|
||||
|
|
@ -310,9 +315,12 @@ onMounted(async () => {
|
|||
<template v-slot:body="props">
|
||||
<q-tr :props="props" class="cursor-pointer">
|
||||
<q-td v-for="(col, index) in props.cols" :key="col.id">
|
||||
<div v-if="col.name == 'no'">
|
||||
<div v-if="col.name === 'no'">
|
||||
{{ props.rowIndex + 1 }}
|
||||
</div>
|
||||
<div v-if="col.name === 'posTypeName'">
|
||||
{{ posName }}
|
||||
</div>
|
||||
<div v-else>
|
||||
{{ col.value }}
|
||||
</div>
|
||||
|
|
@ -405,7 +413,7 @@ onMounted(async () => {
|
|||
borderless
|
||||
min="1"
|
||||
bg-color="white"
|
||||
:rules="[(val) => val != null || 'กรุณากรอกระดับ']"
|
||||
:rules="[(val) => val > 0 || 'กรุณากรอกระดับ']"
|
||||
hide-bottom-space
|
||||
mask="############"
|
||||
/>
|
||||
|
|
|
|||
|
|
@ -1,18 +1,34 @@
|
|||
<script setup lang="ts">
|
||||
import { ref, reactive, watch } from "vue";
|
||||
import moment from "moment";
|
||||
import { ref, reactive, watch, onMounted } from "vue";
|
||||
import dialogHeader from "@/components/DialogHeader.vue";
|
||||
import type { QTableProps } from "quasar";
|
||||
import { useCounterMixin } from "@/stores/mixin";
|
||||
import { QForm, useQuasar } from "quasar";
|
||||
import type { ProfesLicenseObject } from "@/modules/04_registryNew/interface/index/profesLicense";
|
||||
import { useRoute } from "vue-router";
|
||||
import type { RequestItemsObject } from "@/modules/04_registryNew/interface/request/ProfesLicense";
|
||||
import type { ResponseObject } from "@/modules/04_registryNew/interface/response/ProfesLicense";
|
||||
import http from "@/plugins/http";
|
||||
import config from "@/app.config";
|
||||
const mixin = useCounterMixin();
|
||||
const $q = useQuasar();
|
||||
const { dialogConfirm, date2Thai } = mixin;
|
||||
const {
|
||||
dialogRemove,
|
||||
dialogConfirm,
|
||||
showLoader,
|
||||
hideLoader,
|
||||
messageError,
|
||||
success,
|
||||
date2Thai,
|
||||
} = mixin;
|
||||
|
||||
const historyDialog = ref<boolean>(false);
|
||||
const addDataDialog = ref<boolean>(false);
|
||||
const mode = ref<string>("table");
|
||||
const dialog = ref<boolean>(false);
|
||||
const route = useRoute();
|
||||
const id = ref<string>(route.params.id.toString());
|
||||
const dialogStatus = ref<string>("create");
|
||||
const editId = ref<string>("");
|
||||
|
||||
const columns = ref<QTableProps["columns"]>([
|
||||
{
|
||||
name: "certificateType",
|
||||
|
|
@ -53,6 +69,7 @@ const columns = ref<QTableProps["columns"]>([
|
|||
label: "วันที่ออกใบอนุญาต",
|
||||
sortable: true,
|
||||
field: "issueDate",
|
||||
format: (v) => date2Thai(v),
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
sort: (a: string, b: string) =>
|
||||
|
|
@ -63,6 +80,7 @@ const columns = ref<QTableProps["columns"]>([
|
|||
align: "left",
|
||||
label: "วันที่หมดอายุ",
|
||||
sortable: true,
|
||||
format: (v) => date2Thai(v),
|
||||
field: "expireDate",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
|
|
@ -71,7 +89,7 @@ const columns = ref<QTableProps["columns"]>([
|
|||
},
|
||||
]);
|
||||
|
||||
const profesLicenseData = reactive<ProfesLicenseObject>({
|
||||
const profesLicenseData = reactive<RequestItemsObject>({
|
||||
certificateType: "",
|
||||
issuer: "",
|
||||
certificateNo: "",
|
||||
|
|
@ -79,47 +97,30 @@ const profesLicenseData = reactive<ProfesLicenseObject>({
|
|||
expireDate: new Date(),
|
||||
});
|
||||
|
||||
const rows = ref<ResponseObject[]>([]);
|
||||
const historyRows = ref<ResponseObject[]>([]);
|
||||
|
||||
const formFilter = reactive({
|
||||
page: 1,
|
||||
pageSize: 10,
|
||||
keyword: "",
|
||||
});
|
||||
|
||||
const historyFormFilter = reactive({
|
||||
page: 1,
|
||||
pageSize: 10,
|
||||
keyword: "",
|
||||
});
|
||||
|
||||
const pagination = ref({
|
||||
page: formFilter.page,
|
||||
rowsPerPage: formFilter.pageSize,
|
||||
});
|
||||
|
||||
const row = [
|
||||
{
|
||||
certificateType: "ใบอนุญาต",
|
||||
issuer: "หน่วยงานเชียงใหม่",
|
||||
certificateNo: "12",
|
||||
issueDate: new Date(),
|
||||
expireDate: new Date(),
|
||||
},
|
||||
{
|
||||
certificateType: "ใบอนุญาต",
|
||||
issuer: "หน่วยงานพะเยา",
|
||||
certificateNo: "136",
|
||||
issueDate: new Date(),
|
||||
expireDate: new Date(),
|
||||
},
|
||||
{
|
||||
certificateType: "ใบอนุญาต",
|
||||
issuer: "หน่วยงานโคราช",
|
||||
certificateNo: "12",
|
||||
issueDate: new Date(),
|
||||
expireDate: new Date(),
|
||||
},
|
||||
{
|
||||
certificateType: "ใบอนุญาต",
|
||||
issuer: "หน่วยงานกทม",
|
||||
certificateNo: "11",
|
||||
issueDate: new Date(),
|
||||
expireDate: new Date(),
|
||||
},
|
||||
];
|
||||
const historyPagination = ref({
|
||||
page: historyFormFilter.page,
|
||||
rowsPerPage: historyFormFilter.pageSize,
|
||||
});
|
||||
|
||||
const visibleColumns = ref<string[]>([
|
||||
"certificateType",
|
||||
|
|
@ -129,6 +130,14 @@ const visibleColumns = ref<string[]>([
|
|||
"expireDate",
|
||||
]);
|
||||
|
||||
const historyVisibleColumns = ref<string[]>([
|
||||
"certificateType",
|
||||
"issuer",
|
||||
"certificateNo",
|
||||
"issueDate",
|
||||
"expireDate",
|
||||
]);
|
||||
|
||||
function validateForm() {
|
||||
onSubmit();
|
||||
}
|
||||
|
|
@ -137,6 +146,7 @@ async function onSubmit() {
|
|||
dialogConfirm(
|
||||
$q,
|
||||
async () => {
|
||||
dialogStatus.value === "create" ? addData() : editData(editId.value);
|
||||
closeDialog();
|
||||
},
|
||||
"ยืนยันการบันทึกข้อมูล",
|
||||
|
|
@ -145,11 +155,123 @@ async function onSubmit() {
|
|||
}
|
||||
|
||||
function closeDialog() {
|
||||
addDataDialog.value = false;
|
||||
dialog.value = false;
|
||||
}
|
||||
function closeHistoryDialog() {
|
||||
historyDialog.value = false;
|
||||
}
|
||||
|
||||
async function fetchData(id: string) {
|
||||
showLoader();
|
||||
await http
|
||||
.get(config.API.profileNewCertificateByProfileId(id))
|
||||
.then(async (res) => {
|
||||
rows.value = res.data.result;
|
||||
})
|
||||
.catch((err) => {
|
||||
messageError($q, err);
|
||||
})
|
||||
.finally(() => {
|
||||
hideLoader();
|
||||
});
|
||||
}
|
||||
|
||||
function clearForm() {
|
||||
profesLicenseData.expireDate = new Date();
|
||||
profesLicenseData.issueDate = new Date();
|
||||
profesLicenseData.certificateNo = "";
|
||||
profesLicenseData.certificateType = "";
|
||||
profesLicenseData.issuer = "";
|
||||
}
|
||||
|
||||
function editForm(row: any) {
|
||||
dialogStatus.value = "edit";
|
||||
editId.value = row.id;
|
||||
profesLicenseData.certificateType = row.certificateType;
|
||||
profesLicenseData.certificateNo = row.certificateNo;
|
||||
profesLicenseData.issuer = row.issuer;
|
||||
profesLicenseData.issueDate = row.issueDate;
|
||||
profesLicenseData.expireDate = row.expireDate;
|
||||
dialog.value = true;
|
||||
}
|
||||
|
||||
async function addData() {
|
||||
await http
|
||||
.post(config.API.profileNewCertificate, {
|
||||
profileId: id.value,
|
||||
expireDate: profesLicenseData.expireDate,
|
||||
issueDate: profesLicenseData.issueDate,
|
||||
certificateNo: profesLicenseData.certificateNo,
|
||||
certificateType: profesLicenseData.certificateType,
|
||||
issuer: profesLicenseData.issuer,
|
||||
isActive: true,
|
||||
})
|
||||
.then(() => {
|
||||
fetchData(id.value);
|
||||
success($q, "บันทึกข้อมูลสำเร็จ");
|
||||
})
|
||||
.catch((err) => {
|
||||
messageError($q, err);
|
||||
})
|
||||
.finally(() => {
|
||||
hideLoader();
|
||||
});
|
||||
}
|
||||
|
||||
async function editData(idData: string) {
|
||||
await http
|
||||
.patch(config.API.profileNewCertificateByCertificateId(idData), {
|
||||
expireDate: profesLicenseData.expireDate,
|
||||
issueDate: profesLicenseData.issueDate,
|
||||
certificateNo: profesLicenseData.certificateNo,
|
||||
certificateType: profesLicenseData.certificateType,
|
||||
issuer: profesLicenseData.issuer,
|
||||
isActive: true,
|
||||
})
|
||||
.then(() => {
|
||||
fetchData(id.value);
|
||||
success($q, "บันทึกข้อมูลสำเร็จ");
|
||||
})
|
||||
.catch((err) => {
|
||||
messageError($q, err);
|
||||
})
|
||||
.finally(() => {
|
||||
hideLoader();
|
||||
});
|
||||
}
|
||||
|
||||
async function deleteData(idData: string) {
|
||||
await http
|
||||
.delete(config.API.profileNewCertificateByCertificateId(idData))
|
||||
.then(() => {
|
||||
fetchData(id.value);
|
||||
})
|
||||
.catch((err) => {
|
||||
messageError($q, err);
|
||||
})
|
||||
.finally(() => {
|
||||
hideLoader();
|
||||
});
|
||||
}
|
||||
|
||||
async function fetchHistoryData(id: string) {
|
||||
showLoader();
|
||||
await http
|
||||
.get(config.API.profileNewCertificateHisByCertificateId(id))
|
||||
.then(async (res) => {
|
||||
historyRows.value = res.data.result;
|
||||
})
|
||||
.catch((err) => {
|
||||
messageError($q, err);
|
||||
})
|
||||
.finally(() => {
|
||||
hideLoader();
|
||||
});
|
||||
}
|
||||
|
||||
onMounted(async () => {
|
||||
await fetchData(id.value);
|
||||
});
|
||||
</script>
|
||||
|
||||
<template>
|
||||
|
|
@ -161,12 +283,27 @@ function closeHistoryDialog() {
|
|||
color="primary"
|
||||
icon="add"
|
||||
size="16px"
|
||||
@click="addDataDialog = true"
|
||||
@click="
|
||||
dialogStatus = 'create';
|
||||
clearForm();
|
||||
dialog = true;
|
||||
"
|
||||
>
|
||||
<q-tooltip>เพิ่มข้อมูล</q-tooltip></q-btn
|
||||
>
|
||||
|
||||
<q-space />
|
||||
<q-input
|
||||
dense
|
||||
outlined
|
||||
v-model="formFilter.keyword"
|
||||
label="ค้นหา"
|
||||
class="q-mr-sm"
|
||||
>
|
||||
<template v-slot:append>
|
||||
<q-icon name="search" />
|
||||
</template>
|
||||
</q-input>
|
||||
<q-select
|
||||
v-if="mode === 'table'"
|
||||
v-model="visibleColumns"
|
||||
|
|
@ -219,12 +356,13 @@ function closeHistoryDialog() {
|
|||
:grid="mode === 'card'"
|
||||
ref="table"
|
||||
:columns="columns"
|
||||
:rows="row"
|
||||
:rows="rows"
|
||||
row-key="name"
|
||||
flat
|
||||
bordered
|
||||
:paging="true"
|
||||
dense
|
||||
:filter="formFilter.keyword"
|
||||
v-model:pagination="pagination"
|
||||
:rows-per-page-options="[20, 50, 100]"
|
||||
class="custom-header-table"
|
||||
|
|
@ -240,19 +378,29 @@ function closeHistoryDialog() {
|
|||
</template>
|
||||
<template v-slot:body="props" v-if="mode === 'table'">
|
||||
<q-tr :props="props" class="cursor-pointer">
|
||||
<q-td
|
||||
v-for="col in props.cols"
|
||||
:key="col.id"
|
||||
@click="addDataDialog = true"
|
||||
>
|
||||
<div v-if="col.name === 'issueDate' || col.name === 'expireDate'">
|
||||
{{ col.value ? date2Thai(col.value) : "-" }}
|
||||
</div>
|
||||
<div v-else>
|
||||
<q-td v-for="col in props.cols" :key="col.id">
|
||||
<div>
|
||||
{{ col.value }}
|
||||
</div>
|
||||
</q-td>
|
||||
<q-td auto-width>
|
||||
<q-btn
|
||||
color="primary"
|
||||
flat
|
||||
dense
|
||||
round
|
||||
class="q-mr-xs"
|
||||
size="14px"
|
||||
icon="mdi-pencil-outline"
|
||||
clickable
|
||||
@click="
|
||||
() => {
|
||||
editForm(props.row);
|
||||
}
|
||||
"
|
||||
>
|
||||
<q-tooltip>แก้ไขข้อมูล</q-tooltip>
|
||||
</q-btn>
|
||||
<q-btn
|
||||
color="info"
|
||||
flat
|
||||
|
|
@ -260,9 +408,26 @@ function closeHistoryDialog() {
|
|||
round
|
||||
size="14px"
|
||||
icon="mdi-history"
|
||||
@click="() => (historyDialog = true)"
|
||||
@click="
|
||||
() => (fetchHistoryData(props.row.id), (historyDialog = true))
|
||||
"
|
||||
>
|
||||
<q-tooltip>ประวัติแก้ไขประวัติการศึกษา</q-tooltip>
|
||||
<q-tooltip>ประวัติแก้ไขใบอนุญาตประกอบวิชาชีพ</q-tooltip>
|
||||
</q-btn>
|
||||
<q-btn
|
||||
color="red"
|
||||
flat
|
||||
dense
|
||||
round
|
||||
size="14px"
|
||||
icon="mdi-delete"
|
||||
clickable
|
||||
@click.stop="
|
||||
dialogRemove($q, async () => await deleteData(props.row.id))
|
||||
"
|
||||
v-close-popup
|
||||
>
|
||||
<q-tooltip>ลบข้อมูล</q-tooltip>
|
||||
</q-btn>
|
||||
</q-td>
|
||||
</q-tr>
|
||||
|
|
@ -278,18 +443,21 @@ function closeHistoryDialog() {
|
|||
round
|
||||
color="primary"
|
||||
icon="edit"
|
||||
@click="addDataDialog = true"
|
||||
@click="editForm(props.row)"
|
||||
>
|
||||
<q-tooltip>แก้ไขข้อมูล</q-tooltip>
|
||||
</q-btn>
|
||||
<q-btn
|
||||
flat
|
||||
round
|
||||
color="blue"
|
||||
icon="history"
|
||||
@click="historyDialog = true"
|
||||
color="info"
|
||||
icon="mdi-history"
|
||||
size="14px"
|
||||
@click="
|
||||
() => (fetchHistoryData(props.row.id), (historyDialog = true))
|
||||
"
|
||||
>
|
||||
<q-tooltip>ประวัติแก้ไขประวัติการศึกษา</q-tooltip>
|
||||
<q-tooltip>ประวัติแก้ไขใบอนุญาตประกอบวิชาชีพ</q-tooltip>
|
||||
</q-btn>
|
||||
</q-card-actions>
|
||||
<q-separator />
|
||||
|
|
@ -305,13 +473,7 @@ function closeHistoryDialog() {
|
|||
<div>{{ col.label }}</div>
|
||||
</div>
|
||||
<div class="col">
|
||||
<div
|
||||
v-if="col.name === 'issueDate' || col.name === 'expireDate'"
|
||||
>
|
||||
{{ col.value ? date2Thai(col.value) : "-" }}
|
||||
</div>
|
||||
|
||||
<div v-else>{{ col.value }}</div>
|
||||
<div>{{ col.value }}</div>
|
||||
</div>
|
||||
</div>
|
||||
</q-list>
|
||||
|
|
@ -320,12 +482,12 @@ function closeHistoryDialog() {
|
|||
</template>
|
||||
</d-table>
|
||||
|
||||
<q-dialog v-model="addDataDialog" class="dialog" persistent>
|
||||
<q-dialog v-model="dialog" class="dialog" persistent>
|
||||
<q-card style="min-width: 40%" class="bg-white">
|
||||
<q-form @submit.prevent greedy @validation-success="validateForm">
|
||||
<q-card-section class="flex justify-between" style="padding: 0">
|
||||
<dialog-header
|
||||
tittle="เพิ่มใบอนุญาตประกอบวิชาชีพ"
|
||||
:tittle="dialogStatus == 'edit' ? 'แก้ไขข้อมูล' : 'เพิ่มข้อมูล'"
|
||||
:close="closeDialog"
|
||||
/>
|
||||
</q-card-section>
|
||||
|
|
@ -345,7 +507,7 @@ function closeHistoryDialog() {
|
|||
<div class="col">
|
||||
<q-input
|
||||
outlined
|
||||
v-model="profesLicenseData.certificateType"
|
||||
v-model="profesLicenseData.issuer"
|
||||
label="หน่วยงานผู้ออกใบอนุญาต"
|
||||
bg-color="white"
|
||||
dense
|
||||
|
|
@ -360,7 +522,7 @@ function closeHistoryDialog() {
|
|||
<div class="col">
|
||||
<q-input
|
||||
outlined
|
||||
v-model="profesLicenseData.certificateType"
|
||||
v-model="profesLicenseData.certificateNo"
|
||||
label="เลขที่ใบอนุญาต"
|
||||
bg-color="white"
|
||||
dense
|
||||
|
|
@ -475,7 +637,7 @@ function closeHistoryDialog() {
|
|||
<q-form @submit.prevent greedy @validation-success="validateForm">
|
||||
<q-card-section class="flex justify-between" style="padding: 0">
|
||||
<dialog-header
|
||||
tittle="ประวัติแก้ไขประวัติการศึกษา"
|
||||
tittle="ประวัติแก้ไขใบอนุญาตประกอบวิชาชีพ"
|
||||
:close="closeHistoryDialog"
|
||||
/>
|
||||
</q-card-section>
|
||||
|
|
@ -487,7 +649,7 @@ function closeHistoryDialog() {
|
|||
dense
|
||||
outlined
|
||||
bg-color="white"
|
||||
v-model="formFilter.keyword"
|
||||
v-model="historyFormFilter.keyword"
|
||||
label="ค้นหา"
|
||||
class="q-mr-sm"
|
||||
>
|
||||
|
|
@ -497,7 +659,7 @@ function closeHistoryDialog() {
|
|||
</q-input>
|
||||
|
||||
<q-select
|
||||
v-model="visibleColumns"
|
||||
v-model="historyVisibleColumns"
|
||||
multiple
|
||||
outlined
|
||||
dense
|
||||
|
|
@ -515,15 +677,17 @@ function closeHistoryDialog() {
|
|||
<d-table
|
||||
ref="table"
|
||||
:columns="columns"
|
||||
:rows="row"
|
||||
:rows="historyRows"
|
||||
row-key="name"
|
||||
flat
|
||||
:filter="historyFormFilter.keyword"
|
||||
v-model:pagination="historyPagination"
|
||||
bordered
|
||||
:paging="true"
|
||||
dense
|
||||
:rows-per-page-options="[20, 50, 100]"
|
||||
class="custom-header-table"
|
||||
:visible-columns="visibleColumns"
|
||||
:visible-columns="historyVisibleColumns"
|
||||
>
|
||||
<template v-slot:header="props">
|
||||
<q-tr :props="props">
|
||||
|
|
@ -536,13 +700,8 @@ function closeHistoryDialog() {
|
|||
<template v-slot:body="props">
|
||||
<q-tr :props="props" class="cursor-pointer">
|
||||
<q-td v-for="col in props.cols" :key="col.id">
|
||||
<div
|
||||
v-if="col.name === 'issueDate' || col.name === 'expireDate'"
|
||||
>
|
||||
{{ col.value ? date2Thai(col.value) : "-" }}
|
||||
</div>
|
||||
<div v-else>
|
||||
{{ col.value }}
|
||||
<div>
|
||||
{{ col.value ? col.value : "-" }}
|
||||
</div>
|
||||
</q-td>
|
||||
</q-tr>
|
||||
|
|
|
|||
|
|
@ -174,6 +174,7 @@ const pagination = ref({
|
|||
page: formFilter.page,
|
||||
rowsPerPage: formFilter.pageSize,
|
||||
});
|
||||
|
||||
const historyFormFilter = reactive({
|
||||
page: 1,
|
||||
pageSize: 10,
|
||||
|
|
@ -244,6 +245,25 @@ function clearForm() {
|
|||
trainData.endDate = new Date();
|
||||
}
|
||||
|
||||
function editForm(row: any) {
|
||||
dialogStatus.value = "edit";
|
||||
editId.value = row.id;
|
||||
isDate.value = row.isDate ? "true" : "false";
|
||||
trainData.name = row.name;
|
||||
trainData.topic = row.topic;
|
||||
trainData.yearly = row.yearly;
|
||||
trainData.place = row.place;
|
||||
trainData.duration = row.duration;
|
||||
trainData.department = row.department;
|
||||
trainData.numberOrder = row.numberOrder;
|
||||
trainData.dateOrder = row.dateOrder;
|
||||
trainData.startDate = row.startDate;
|
||||
trainData.endDate = row.endDate;
|
||||
trainData.startYear = +row.startDate.slice(0, 4);
|
||||
trainData.finishYear = +row.endDate.slice(0, 4);
|
||||
dialog.value = true;
|
||||
}
|
||||
|
||||
async function addData() {
|
||||
await http
|
||||
.post(config.API.profileNewTraining, {
|
||||
|
|
@ -276,7 +296,6 @@ async function addData() {
|
|||
async function editData(idData: string) {
|
||||
await http
|
||||
.patch(config.API.profileNewTrainingByTrainingId(idData), {
|
||||
profileId: id.value,
|
||||
name: trainData.name,
|
||||
topic: trainData.topic ? trainData.topic : "",
|
||||
yearly: trainData.yearly,
|
||||
|
|
@ -315,6 +334,7 @@ async function deleteData(idData: string) {
|
|||
hideLoader();
|
||||
});
|
||||
}
|
||||
|
||||
function closeDialog() {
|
||||
clearForm();
|
||||
dialog.value = false;
|
||||
|
|
@ -532,22 +552,7 @@ onMounted(async () => {
|
|||
clickable
|
||||
@click="
|
||||
() => {
|
||||
dialogStatus = 'edit';
|
||||
editId = props.row.id;
|
||||
isDate = props.row.isDate ? 'true' : 'false';
|
||||
trainData.name = props.row.name;
|
||||
trainData.topic = props.row.topic;
|
||||
trainData.yearly = props.row.yearly;
|
||||
trainData.place = props.row.place;
|
||||
trainData.duration = props.row.duration;
|
||||
trainData.department = props.row.department;
|
||||
trainData.numberOrder = props.row.numberOrder;
|
||||
trainData.dateOrder = props.row.dateOrder;
|
||||
trainData.startDate = props.row.startDate;
|
||||
trainData.endDate = props.row.endDate;
|
||||
trainData.startYear = +props.row.startDate.slice(0, 4);
|
||||
trainData.finishYear = +props.row.endDate.slice(0, 4);
|
||||
dialog = true;
|
||||
editForm(props.row);
|
||||
}
|
||||
"
|
||||
>
|
||||
|
|
@ -564,7 +569,7 @@ onMounted(async () => {
|
|||
() => (fetchHistoryData(props.row.id), (historyDialog = true))
|
||||
"
|
||||
>
|
||||
<q-tooltip>ประวัติแก้ไขประวัติการศึกษา</q-tooltip>
|
||||
<q-tooltip>ประวัติแก้ไขการฝึกอบรม/ดูงาน</q-tooltip>
|
||||
</q-btn>
|
||||
<q-btn
|
||||
color="red"
|
||||
|
|
@ -596,24 +601,7 @@ onMounted(async () => {
|
|||
size="14px"
|
||||
color="primary"
|
||||
icon="mdi-pencil-outline"
|
||||
@click="
|
||||
dialogStatus = 'edit';
|
||||
editId = props.row.id;
|
||||
isDate = props.row.isDate ? 'true' : 'false';
|
||||
trainData.name = props.row.name;
|
||||
trainData.topic = props.row.topic;
|
||||
trainData.yearly = props.row.yearly;
|
||||
trainData.place = props.row.place;
|
||||
trainData.duration = props.row.duration;
|
||||
trainData.department = props.row.department;
|
||||
trainData.numberOrder = props.row.numberOrder;
|
||||
trainData.dateOrder = props.row.dateOrder;
|
||||
trainData.startDate = props.row.startDate;
|
||||
trainData.endDate = props.row.endDate;
|
||||
trainData.startYear = +props.row.startDate.slice(0, 4);
|
||||
trainData.finishYear = +props.row.endDate.slice(0, 4);
|
||||
dialog = true;
|
||||
"
|
||||
@click="editForm(props.row)"
|
||||
>
|
||||
<q-tooltip>แก้ไขข้อมูล</q-tooltip>
|
||||
</q-btn>
|
||||
|
|
@ -623,9 +611,11 @@ onMounted(async () => {
|
|||
size="14px"
|
||||
color="info"
|
||||
icon="history"
|
||||
@click="historyDialog = true"
|
||||
@click="
|
||||
() => (fetchHistoryData(props.row.id), (historyDialog = true))
|
||||
"
|
||||
>
|
||||
<q-tooltip>ประวัติแก้ไขประวัติการศึกษา</q-tooltip>
|
||||
<q-tooltip>ประวัติแก้ไขการฝึกอบรม/ดูงาน</q-tooltip>
|
||||
</q-btn>
|
||||
</q-card-actions>
|
||||
<q-separator />
|
||||
|
|
@ -1008,7 +998,7 @@ onMounted(async () => {
|
|||
<q-form @submit.prevent greedy @validation-success="validateForm">
|
||||
<q-card-section class="flex justify-between" style="padding: 0">
|
||||
<dialog-header
|
||||
tittle="ประวัติแก้ไขประวัติการศึกษา"
|
||||
tittle="ประวัติแก้ไขการฝึกอบรม/ดูงาน"
|
||||
:close="closeHistoryDialog"
|
||||
/>
|
||||
</q-card-section>
|
||||
|
|
|
|||
|
|
@ -489,7 +489,7 @@ async function addEditData(editStatus: boolean = false) {
|
|||
: config.API.profileNewInsign;
|
||||
const method = editStatus ? "patch" : "post";
|
||||
const reqBody: RequestItemsObject = {
|
||||
profileId: profileId.value,
|
||||
profileId: editStatus ? undefined : profileId.value,
|
||||
isActive: insigniaData.isActive,
|
||||
year: insigniaData.year,
|
||||
no: insigniaData.no,
|
||||
|
|
|
|||
|
|
@ -238,12 +238,13 @@ async function addEditData(editStatus: boolean = false) {
|
|||
: config.API.profileNewHonor;
|
||||
const method = editStatus ? "patch" : "post";
|
||||
const reqBody: RequestItemsObject = {
|
||||
profileId: profileId.value,
|
||||
profileId: editStatus ? undefined : profileId.value,
|
||||
isActive: declHonorData.isActive,
|
||||
detail: declHonorData.detail,
|
||||
issueDate: declHonorData.isDate
|
||||
? declHonorData.issueDate
|
||||
: new Date(`${declHonorData.issueDateYear}-1-1`),
|
||||
issueDate:
|
||||
declHonorData.isDate === "true"
|
||||
? declHonorData.issueDate
|
||||
: new Date(`${declHonorData.issueDateYear}-01-01`),
|
||||
issuer: declHonorData.issuer,
|
||||
refCommandDate: declHonorData.refCommandDate,
|
||||
refCommandNo: declHonorData.refCommandNo,
|
||||
|
|
|
|||
|
|
@ -295,7 +295,7 @@ async function addEditData(editStatus: boolean = false) {
|
|||
: config.API.profileNewAssessments;
|
||||
const method = editStatus ? "patch" : "post";
|
||||
const reqBody: RequestItemsObject = {
|
||||
profileId: profileId.value,
|
||||
profileId: editStatus ? undefined : profileId.value,
|
||||
isActive: resPerformData.isActive,
|
||||
name: resPerformData.name,
|
||||
date: resPerformData.date,
|
||||
|
|
@ -337,7 +337,6 @@ function onClickOpenDialog(editStatus: boolean = false, row?: ResponseObject) {
|
|||
isEdit.value = editStatus;
|
||||
|
||||
if (editStatus && row) {
|
||||
console.log(row.id);
|
||||
Object.assign(resPerformData, row);
|
||||
} else {
|
||||
(resPerformData.id = ""),
|
||||
|
|
@ -375,7 +374,9 @@ async function clickHistory(row: ResponseObject) {
|
|||
|
||||
showLoader();
|
||||
try {
|
||||
const res = await http.get(config.API.profileAssessmentHisId(row.id));
|
||||
const res = await http.get(config.API.profileNewAssessmentsHisById(row.id));
|
||||
console.log(res.data);
|
||||
|
||||
rowsHistory.value = res.data.result;
|
||||
} catch (e) {
|
||||
messageError($q, e);
|
||||
|
|
|
|||
|
|
@ -7,6 +7,8 @@ import type {
|
|||
MyObjectRef,
|
||||
} from "@/modules/04_registryNew/interface/index/other";
|
||||
|
||||
import http from "@/plugins/http";
|
||||
import config from "@/app.config";
|
||||
import { useCounterMixin } from "@/stores/mixin";
|
||||
import DialogHeader from "@/components/DialogHeader.vue";
|
||||
import { useRoute } from "vue-router";
|
||||
|
|
@ -14,7 +16,15 @@ import DialogHistory from "@/modules/04_registryNew/components/detail/Other/01_O
|
|||
const route = useRoute();
|
||||
const $q = useQuasar();
|
||||
const mixin = useCounterMixin();
|
||||
const { date2Thai, showLoader, hideLoader, success, messageError } = mixin;
|
||||
const {
|
||||
date2Thai,
|
||||
showLoader,
|
||||
hideLoader,
|
||||
success,
|
||||
messageError,
|
||||
dialogRemove,
|
||||
dialogConfirm,
|
||||
} = mixin;
|
||||
|
||||
const id = ref<string>("");
|
||||
|
||||
|
|
@ -45,6 +55,7 @@ const modal = ref<boolean>(false);
|
|||
const edit = ref<boolean>(false);
|
||||
const modalHistory = ref<boolean>(false);
|
||||
|
||||
const isActive = ref<boolean>(true);
|
||||
const date = ref<Date | null>(null);
|
||||
const detail = ref<string>();
|
||||
|
||||
|
|
@ -65,6 +76,7 @@ const columns = ref<QTableProps["columns"]>([
|
|||
field: "date",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px; width: 50px;",
|
||||
format: (v) => date2Thai(v),
|
||||
},
|
||||
{
|
||||
name: "detail",
|
||||
|
|
@ -91,6 +103,7 @@ function openDialogEdit(props: RowList) {
|
|||
modal.value = true;
|
||||
edit.value = true;
|
||||
|
||||
id.value = props.id;
|
||||
date.value = props.date;
|
||||
detail.value = props.detail;
|
||||
}
|
||||
|
|
@ -112,107 +125,118 @@ function closeDialog() {
|
|||
|
||||
/** validate check*/
|
||||
function validateForm() {
|
||||
const hasError = [];
|
||||
for (const key in objectRef) {
|
||||
if (Object.prototype.hasOwnProperty.call(objectRef, key)) {
|
||||
const property = objectRef[key];
|
||||
if (property.value && typeof property.value.validate === "function") {
|
||||
const isValid = property.value.validate();
|
||||
hasError.push(isValid);
|
||||
dialogConfirm(
|
||||
$q,
|
||||
async () => {
|
||||
const hasError = [];
|
||||
for (const key in objectRef) {
|
||||
if (Object.prototype.hasOwnProperty.call(objectRef, key)) {
|
||||
const property = objectRef[key];
|
||||
if (property.value && typeof property.value.validate === "function") {
|
||||
const isValid = property.value.validate();
|
||||
hasError.push(isValid);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (hasError.every((result) => result === true)) {
|
||||
if ((edit.value = false)) {
|
||||
saveData();
|
||||
} else {
|
||||
editData();
|
||||
}
|
||||
}
|
||||
if (hasError.every((result) => result === true)) {
|
||||
if (edit.value) {
|
||||
editData();
|
||||
} else {
|
||||
saveData();
|
||||
}
|
||||
}
|
||||
},
|
||||
"ยืนยันการบันทึกข้อมูล",
|
||||
"ต้องการยืนยันการบันทึกข้อมูลนี้หรือไม่ ?"
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* บันทึกเพิ่มข้อมูล
|
||||
*/
|
||||
function saveData() {
|
||||
// showLoader();
|
||||
// await http
|
||||
// .post(config.API.profileOtherId(profileId.value), {
|
||||
// id: id.value,
|
||||
// date: date.value,
|
||||
// detail: detail.value,
|
||||
// })
|
||||
// .then((res) => {
|
||||
// success($q, "บันทึกข้อมูลสำเร็จ");
|
||||
// modal.value = false;
|
||||
// })
|
||||
// .catch((e) => {
|
||||
// messageError($q, e);
|
||||
// })
|
||||
// .finally(async () => {
|
||||
// await fetchData();
|
||||
// });
|
||||
closeDialog();
|
||||
async function saveData() {
|
||||
showLoader();
|
||||
await http
|
||||
.post(config.API.profileNewOther, {
|
||||
profileId: profileId.value,
|
||||
isActive: isActive.value,
|
||||
date: date.value,
|
||||
detail: detail.value,
|
||||
})
|
||||
.then((res) => {
|
||||
success($q, "บันทึกข้อมูลสำเร็จ");
|
||||
getData();
|
||||
closeDialog();
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(() => {
|
||||
hideLoader();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* บันทึกแก้ไขข้อมูล
|
||||
*/
|
||||
const editData = async () => {
|
||||
// showLoader();
|
||||
// await http
|
||||
// .put(config.API.profileOtherId(id.value), {
|
||||
// id: id.value,
|
||||
// date: date.value,
|
||||
// detail: detail.value,
|
||||
// })
|
||||
// .then((res) => {
|
||||
// success($q, "บันทึกข้อมูลสำเร็จ");
|
||||
// modal.value = false;
|
||||
// })
|
||||
// .catch((e) => {
|
||||
// messageError($q, e);
|
||||
// })
|
||||
// .finally(async () => {
|
||||
// await fetchData();
|
||||
// });
|
||||
closeDialog();
|
||||
};
|
||||
async function editData() {
|
||||
showLoader();
|
||||
await http
|
||||
.patch(config.API.profileNewOtherById(id.value), {
|
||||
isActive: isActive.value,
|
||||
date: date.value,
|
||||
detail: detail.value,
|
||||
})
|
||||
.then((res) => {
|
||||
success($q, "บันทึกข้อมูลสำเร็จ");
|
||||
getData();
|
||||
closeDialog();
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(() => {
|
||||
hideLoader();
|
||||
});
|
||||
}
|
||||
|
||||
function getData() {
|
||||
const data: RowList[] = [
|
||||
{
|
||||
id: "08dc3c0e-b6ef-4e6c-8c84-787447416450",
|
||||
date: null,
|
||||
detail: "ทดสอบ 1",
|
||||
createdFullName: "สาวิตรี ศรีสมัย",
|
||||
createdAt: new Date("2024-03-04T05:48:27.615Z"),
|
||||
},
|
||||
{
|
||||
id: "08dc3c0e-bd30-48e8-8d14-31bcaf92b3a2",
|
||||
date: null,
|
||||
detail: "ทดสอบ 2",
|
||||
createdFullName: "สาวิตรี ศรีสมัย",
|
||||
createdAt: new Date("2024-03-04T05:48:38.105Z"),
|
||||
},
|
||||
{
|
||||
id: "08dc3c0e-c874-41fe-8b55-7c992ebf99b2",
|
||||
date: new Date("2024-03-03T17:00:00.000Z"),
|
||||
detail: "ข้อมูลอื่นๆ",
|
||||
createdFullName: "สาวิตรี ศรีสมัย",
|
||||
createdAt: new Date("2024-03-04T05:48:57.002Z"),
|
||||
},
|
||||
];
|
||||
async function getData() {
|
||||
showLoader();
|
||||
await http
|
||||
.get(config.API.profileNewOtherByProfileId(profileId.value))
|
||||
.then((res) => {
|
||||
rows.value = res.data.result;
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(() => {
|
||||
hideLoader();
|
||||
});
|
||||
}
|
||||
|
||||
rows.value = data;
|
||||
async function deleteData(id: string) {
|
||||
showLoader();
|
||||
await http
|
||||
.delete(config.API.profileNewOtherById(id))
|
||||
.then((res) => {
|
||||
success($q, "ลบข้อมูลสำเร็จ");
|
||||
getData();
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(() => {
|
||||
hideLoader();
|
||||
});
|
||||
}
|
||||
|
||||
const infoRows = [
|
||||
{ title: 'รายละเอียด', value: '' },
|
||||
{ title: 'ล้างมลทิน', value: '' },
|
||||
{ title: 'เลขที่คำสั่ง', value: '' },
|
||||
{ title: 'เอกสารอ้างอิง (ลงวันที่)', value: '' }
|
||||
]
|
||||
{ title: "รายละเอียด", value: "" },
|
||||
{ title: "ล้างมลทิน", value: "" },
|
||||
{ title: "เลขที่คำสั่ง", value: "" },
|
||||
{ title: "เอกสารอ้างอิง (ลงวันที่)", value: "" },
|
||||
];
|
||||
onMounted(() => {
|
||||
getData();
|
||||
});
|
||||
|
|
@ -318,24 +342,24 @@ onMounted(() => {
|
|||
</template>
|
||||
<template v-slot:body="props" v-if="mode === 'table'">
|
||||
<q-tr :props="props" class="cursor-pointer">
|
||||
<q-td
|
||||
v-for="col in props.cols"
|
||||
:key="col.id"
|
||||
@click="openDialogEdit(props.row)"
|
||||
>
|
||||
<div v-if="col.name === 'no'">
|
||||
{{
|
||||
(formFilter.page - 1) * formFilter.pageSize + props.rowIndex + 1
|
||||
}}
|
||||
</div>
|
||||
<div v-else-if="col.name == 'date'" class="table_ellipsis">
|
||||
{{ col.value ? date2Thai(col.value) : "-" }}
|
||||
</div>
|
||||
<div v-else>
|
||||
<q-td v-for="col in props.cols" :key="col.id">
|
||||
<div>
|
||||
{{ col.value ? col.value : "-" }}
|
||||
</div>
|
||||
</q-td>
|
||||
<q-td auto-width>
|
||||
<q-btn
|
||||
flat
|
||||
dense
|
||||
round
|
||||
class="q-mr-xs"
|
||||
size="14px"
|
||||
color="primary"
|
||||
icon="mdi-pencil-outline"
|
||||
@click="openDialogEdit(props.row)"
|
||||
>
|
||||
<q-tooltip>แก้ไขข้อมูล</q-tooltip>
|
||||
</q-btn>
|
||||
<q-btn
|
||||
color="info"
|
||||
flat
|
||||
|
|
@ -347,6 +371,19 @@ onMounted(() => {
|
|||
>
|
||||
<q-tooltip>ประวัติแก้ไขอื่นๆ</q-tooltip>
|
||||
</q-btn>
|
||||
<!-- <q-btn
|
||||
flat
|
||||
dense
|
||||
round
|
||||
size="14px"
|
||||
color="red"
|
||||
icon="mdi-delete"
|
||||
@click="
|
||||
dialogRemove($q, async () => await deleteData(props.row.id))
|
||||
"
|
||||
>
|
||||
<q-tooltip>ลบข้อมูล</q-tooltip>
|
||||
</q-btn> -->
|
||||
</q-td>
|
||||
</q-tr>
|
||||
</template>
|
||||
|
|
@ -376,36 +413,23 @@ onMounted(() => {
|
|||
</div>
|
||||
<q-separator />
|
||||
<q-card-section class="q-pa-none">
|
||||
<div class="row q-pa-sm">
|
||||
<div class="col text-grey-6 text-weight-medium">รายละเอียด</div>
|
||||
<div class="col">
|
||||
{{ props.row.detail !== "" ? props.row.detail : "-" }}
|
||||
</div>
|
||||
<div class="col text-grey-6 text-weight-medium">ล้างมลทิน</div>
|
||||
<div class="col">
|
||||
{{ props.row.unStigma ? props.row.unStigma : "-" }}
|
||||
</div>
|
||||
</div>
|
||||
<q-separator />
|
||||
<div class="row bg-grey-2 q-pa-sm">
|
||||
<div class="col text-grey-6 text-weight-medium">เลขที่คำสั่ง</div>
|
||||
<div class="col">
|
||||
{{
|
||||
props.row.refCommandNo ? props.row.refCommandNo : "-"
|
||||
}}
|
||||
</div>
|
||||
<div class="col text-grey-6 text-weight-medium">
|
||||
เอกสารอ้างอิง (ลงวันที่)
|
||||
</div>
|
||||
<div class="col">
|
||||
{{
|
||||
props.row.refCommandDate
|
||||
? date2Thai(props.row.refCommandDate)
|
||||
: "-"
|
||||
}}
|
||||
</div>
|
||||
</div>
|
||||
<q-item
|
||||
v-for="(col, index) in props.cols.filter(
|
||||
(col) => col.name !== 'desc'
|
||||
)"
|
||||
:key="col.name"
|
||||
:class="index % 2 !== 0 ? 'bg-grey-1' : ''"
|
||||
>
|
||||
<q-item-section class="text-grey-6">
|
||||
<q-item-label>{{ col.label }}</q-item-label>
|
||||
</q-item-section>
|
||||
|
||||
<q-item-section class="text-dark">
|
||||
<q-item-label>
|
||||
{{ col.value ? col.value : "-" }}
|
||||
</q-item-label>
|
||||
</q-item-section>
|
||||
</q-item>
|
||||
</q-card-section>
|
||||
</q-card>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -91,8 +91,7 @@ const columns = ref<QTableProps["columns"]>([
|
|||
]);
|
||||
function getHistory() {
|
||||
showLoader();
|
||||
http
|
||||
.get(config.API.profileOtherHisId(id.value))
|
||||
http.get(config.API.profileNewOtherHisById(id.value))
|
||||
.then((res) => {
|
||||
let data = res.data.result;
|
||||
rows.value = [];
|
||||
|
|
|
|||
|
|
@ -1,91 +1,174 @@
|
|||
<script setup lang="ts">
|
||||
import { ref, onMounted } from "vue";
|
||||
import { useRoute } from "vue-router";
|
||||
import http from "@/plugins/http";
|
||||
import config from "@/app.config";
|
||||
import axios from "axios";
|
||||
import { useCounterMixin } from "@/stores/mixin";
|
||||
import { useQuasar } from "quasar";
|
||||
import type { ArrayFileList } from "@/modules/04_registryNew/interface/index/document";
|
||||
const $q = useQuasar;
|
||||
const $q = useQuasar();
|
||||
const route = useRoute();
|
||||
const mixin = useCounterMixin();
|
||||
const {
|
||||
dialogConfirm,
|
||||
showLoader,
|
||||
hideLoader,
|
||||
success,
|
||||
messageError,
|
||||
showLoader,
|
||||
hideLoader,
|
||||
dialogConfirm,
|
||||
dialogRemove,
|
||||
} = mixin;
|
||||
|
||||
const id = ref<string>("");
|
||||
const documentFile = ref<any>(null);
|
||||
const fileDocDataUpload = ref<File[]>([]);
|
||||
const fileList = ref<ArrayFileList[]>([]);
|
||||
/**
|
||||
* ฟังชั่นอัปโหลดไฟล์
|
||||
* @param documentFile ไฟล์ที่รับมา
|
||||
*/
|
||||
function fileUploadDoc(documentFile: any) {
|
||||
documentFile.forEach((file: any) => {
|
||||
fileDocDataUpload.value.push(file);
|
||||
});
|
||||
const profileId = ref<string>(
|
||||
route.params.id ? route.params.id.toString() : ""
|
||||
);
|
||||
|
||||
async function getData() {
|
||||
showLoader()
|
||||
await http
|
||||
.get(
|
||||
config.API.file("ระบบทะเบียนประวัติ", "เอกสารหลักฐาน", profileId.value)
|
||||
)
|
||||
.then((res) => {
|
||||
fileList.value = res.data;
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(() => {
|
||||
hideLoader()
|
||||
});
|
||||
}
|
||||
|
||||
function getData() {}
|
||||
/**
|
||||
* ฟังก์ชั่นสำหรับอัพโหลดไฟล์เอกสารหลักฐาน
|
||||
*/
|
||||
function upLoadFileDoc() {
|
||||
async function uploadFileDoc(uploadUrl: string, file: any) {
|
||||
const Data = new FormData();
|
||||
Data.append("file", documentFile.value);
|
||||
showLoader();
|
||||
http
|
||||
.put(config.API.complaintFileUpload(id.value), Data)
|
||||
await axios
|
||||
.put(uploadUrl, file, {
|
||||
headers: {
|
||||
"Content-Type": file.type,
|
||||
},
|
||||
})
|
||||
.then((res) => {
|
||||
success($q, "อัพโหลดไฟล์สำเร็จ");
|
||||
success($q, "อัปโหลดไฟล์สำเร็จ");
|
||||
getData();
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(() => {
|
||||
hideLoader();
|
||||
documentFile.value = null;
|
||||
});
|
||||
}
|
||||
|
||||
async function clickUpload(file: any) {
|
||||
const fileName = { fileName: file.name };
|
||||
|
||||
dialogConfirm(
|
||||
$q,
|
||||
async () => {
|
||||
const selectedFile = file;
|
||||
const formdata = new FormData();
|
||||
formdata.append("file", selectedFile);
|
||||
await http
|
||||
.post(
|
||||
config.API.file(
|
||||
"ระบบทะเบียนประวัติ",
|
||||
"เอกสารหลักฐาน",
|
||||
profileId.value
|
||||
),
|
||||
{
|
||||
replace: false,
|
||||
fileList: fileName,
|
||||
}
|
||||
)
|
||||
.then(async (res) => {
|
||||
const foundKey: string | undefined = Object.keys(res.data).find(
|
||||
(key) =>
|
||||
res.data[key]?.fileName !== undefined &&
|
||||
res.data[key]?.fileName !== ""
|
||||
);
|
||||
foundKey &&
|
||||
uploadFileDoc(res.data[foundKey]?.uploadUrl, documentFile.value);
|
||||
})
|
||||
.catch((err) => {
|
||||
messageError($q, err);
|
||||
});
|
||||
},
|
||||
"ยืนยันการอัปโหลดไฟล์",
|
||||
"ต้องการยืนยันการอัปโหลดไฟล์นี้หรือไม่ ?"
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* ดาวน์โหลดลิงค์ไฟล์
|
||||
* @param fileName file name
|
||||
*/
|
||||
function downloadFile(fileName: string) {
|
||||
showLoader();
|
||||
http
|
||||
.get(
|
||||
config.API.fileByFile(
|
||||
"ระบบทะเบียนประวัติ",
|
||||
"เอกสารหลักฐาน",
|
||||
profileId.value,
|
||||
fileName
|
||||
)
|
||||
)
|
||||
.then((res) => {
|
||||
const data = res.data.downloadUrl;
|
||||
window.open(data, "_blank");
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(async () => {
|
||||
hideLoader();
|
||||
documentFile.value = null;
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* เปิดลิงค์ไฟล์
|
||||
* @param link รับมาเป็น https ลิงค์
|
||||
*/
|
||||
function downloadFile(link: string) {
|
||||
window.open(link, "_blank");
|
||||
}
|
||||
|
||||
/**
|
||||
* ลบไฟล์
|
||||
* @param id id file
|
||||
* @param fileName file name
|
||||
*/
|
||||
function deleteFile(id: string) {
|
||||
dialogRemove($q, () => confirmDelete(id));
|
||||
function deleteFile(fileName: string) {
|
||||
dialogRemove($q, async () => {
|
||||
showLoader();
|
||||
http
|
||||
.delete(
|
||||
config.API.fileByFile(
|
||||
"ระบบทะเบียนประวัติ",
|
||||
"เอกสารหลักฐาน",
|
||||
profileId.value,
|
||||
fileName
|
||||
)
|
||||
)
|
||||
.then((res) => {
|
||||
success($q, `ลบไฟล์สำเร็จ`);
|
||||
setTimeout(() => {
|
||||
getData();
|
||||
hideLoader();
|
||||
}, 1000);
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(() => {
|
||||
hideLoader();
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* ยืนยัน ลบ ไฟล์
|
||||
* @param id id file
|
||||
*/
|
||||
function confirmDelete(idOrder: string) {
|
||||
showLoader();
|
||||
http
|
||||
.delete(config.API.complaintFileDelete(id.value, idOrder))
|
||||
.then((res) => {
|
||||
success($q, `ลบไฟล์สำเร็จ`);
|
||||
getData();
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(() => {});
|
||||
}
|
||||
onMounted(() => {
|
||||
getData();
|
||||
});
|
||||
</script>
|
||||
<template>
|
||||
<div class="col-sm-12 col-md-3">
|
||||
|
|
@ -105,7 +188,6 @@ function confirmDelete(idOrder: string) {
|
|||
outlined
|
||||
dense
|
||||
v-model="documentFile"
|
||||
@added="fileUploadDoc"
|
||||
label="ไฟล์เอกสารหลักฐาน"
|
||||
hide-bottom-space
|
||||
accept=".pdf,.xlsx,.docx,.png,.jpg"
|
||||
|
|
@ -123,7 +205,7 @@ function confirmDelete(idOrder: string) {
|
|||
dense
|
||||
color="add"
|
||||
icon="mdi-upload"
|
||||
@click="upLoadFileDoc()"
|
||||
@click="clickUpload(documentFile)"
|
||||
><q-tooltip>อัปโหลดไฟล์</q-tooltip></q-btn
|
||||
>
|
||||
</template>
|
||||
|
|
@ -151,7 +233,7 @@ function confirmDelete(idOrder: string) {
|
|||
dense
|
||||
color="blue"
|
||||
icon="mdi-download"
|
||||
@click="downloadFile(data.pathName)"
|
||||
@click="downloadFile(data.fileName)"
|
||||
><q-tooltip>ดาวน์โหลดไฟล์</q-tooltip></q-btn
|
||||
>
|
||||
<q-btn
|
||||
|
|
@ -162,7 +244,7 @@ function confirmDelete(idOrder: string) {
|
|||
color="red"
|
||||
class="q-ml-sm"
|
||||
icon="mdi-delete-outline"
|
||||
@click="deleteFile(data.id)"
|
||||
@click="deleteFile(data.fileName)"
|
||||
><q-tooltip>ลบไฟล์</q-tooltip></q-btn
|
||||
>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -326,6 +326,30 @@ function clearForm() {
|
|||
educationData.note = "";
|
||||
}
|
||||
|
||||
function editForm(row: any) {
|
||||
dialogStatus.value = "edit";
|
||||
editId.value = row.id;
|
||||
isDate.value = row.isDate ? "true" : "false";
|
||||
educationData.educationLevel = row.educationLevel;
|
||||
educationData.institute = row.institute;
|
||||
educationData.finishDate = row.finishDate;
|
||||
educationData.startDate = row.startDate;
|
||||
educationData.endDate = row.endDate;
|
||||
educationData.isEducation = row.isEducation;
|
||||
educationData.degree = row.degree;
|
||||
educationData.field = row.field;
|
||||
educationData.fundName = row.fundName;
|
||||
educationData.gpa = row.gpa;
|
||||
educationData.country = row.country;
|
||||
educationData.other = row.other;
|
||||
educationData.duration = row.duration;
|
||||
educationData.durationYear = row.durationYear;
|
||||
educationData.note = row.note;
|
||||
educationData.startYear = +row.startDate.slice(0, 4);
|
||||
educationData.endYear = +row.endDate.slice(0, 4);
|
||||
dialog.value = true;
|
||||
}
|
||||
|
||||
function closeDialog() {
|
||||
clearForm();
|
||||
dialog.value = false;
|
||||
|
|
@ -403,7 +427,6 @@ async function addData() {
|
|||
async function editData(idData: string) {
|
||||
await http
|
||||
.patch(config.API.profileNewEducationByEducationId(idData), {
|
||||
profileId: id.value,
|
||||
isActive: true,
|
||||
country: educationData.country,
|
||||
degree: educationData.degree,
|
||||
|
|
@ -519,7 +542,7 @@ onMounted(async () => {
|
|||
@click="
|
||||
() => {
|
||||
dialogStatus = 'create';
|
||||
clearForm;
|
||||
clearForm();
|
||||
dialog = true;
|
||||
}
|
||||
"
|
||||
|
|
@ -631,27 +654,7 @@ onMounted(async () => {
|
|||
clickable
|
||||
@click="
|
||||
() => {
|
||||
dialogStatus = 'edit';
|
||||
editId = props.row.id;
|
||||
isDate = props.row.isDate ? 'true' : 'false';
|
||||
educationData.educationLevel = props.row.educationLevel;
|
||||
educationData.institute = props.row.institute;
|
||||
educationData.finishDate = props.row.finishDate;
|
||||
educationData.startDate = props.row.startDate;
|
||||
educationData.endDate = props.row.endDate;
|
||||
educationData.isEducation = props.row.isEducation;
|
||||
educationData.degree = props.row.degree;
|
||||
educationData.field = props.row.field;
|
||||
educationData.fundName = props.row.fundName;
|
||||
educationData.gpa = props.row.gpa;
|
||||
educationData.country = props.row.country;
|
||||
educationData.other = props.row.other;
|
||||
educationData.duration = props.row.duration;
|
||||
educationData.durationYear = props.row.durationYear;
|
||||
educationData.note = props.row.note;
|
||||
educationData.startYear = +props.row.startDate.slice(0, 4);
|
||||
educationData.endYear = +props.row.endDate.slice(0, 4);
|
||||
dialog = true;
|
||||
editForm(props.row);
|
||||
}
|
||||
"
|
||||
>
|
||||
|
|
@ -700,29 +703,7 @@ onMounted(async () => {
|
|||
color="primary"
|
||||
size="14px"
|
||||
icon="mdi-pencil-outline"
|
||||
@click="
|
||||
dialogStatus = 'edit';
|
||||
editId = props.row.id;
|
||||
isDate = props.row.isDate ? 'true' : 'false';
|
||||
educationData.educationLevel = props.row.educationLevel;
|
||||
educationData.institute = props.row.institute;
|
||||
educationData.finishDate = props.row.finishDate;
|
||||
educationData.startDate = props.row.startDate;
|
||||
educationData.endDate = props.row.endDate;
|
||||
educationData.isEducation = props.row.isEducation;
|
||||
educationData.degree = props.row.degree;
|
||||
educationData.field = props.row.field;
|
||||
educationData.fundName = props.row.fundName;
|
||||
educationData.gpa = props.row.gpa;
|
||||
educationData.country = props.row.country;
|
||||
educationData.other = props.row.other;
|
||||
educationData.duration = props.row.duration;
|
||||
educationData.durationYear = props.row.durationYear;
|
||||
educationData.note = props.row.note;
|
||||
educationData.startYear = +props.row.startDate.slice(0, 4);
|
||||
educationData.endYear = +props.row.endDate.slice(0, 4);
|
||||
dialog = true;
|
||||
"
|
||||
@click="editForm(props.row)"
|
||||
>
|
||||
<q-tooltip>แก้ไขข้อมูล</q-tooltip>
|
||||
</q-btn>
|
||||
|
|
|
|||
|
|
@ -150,6 +150,16 @@ function clearForm() {
|
|||
specialSkill.remark = "";
|
||||
}
|
||||
|
||||
function editForm(row: any) {
|
||||
dialogStatus.value = "edit";
|
||||
editId.value = row.id;
|
||||
specialSkill.detail = row.detail;
|
||||
specialSkill.field = row.field;
|
||||
specialSkill.reference = row.reference;
|
||||
specialSkill.remark = row.remark;
|
||||
dialog.value = true;
|
||||
}
|
||||
|
||||
async function fetchData(id: string) {
|
||||
showLoader();
|
||||
await http
|
||||
|
|
@ -208,7 +218,6 @@ async function addData() {
|
|||
async function editData(idData: string) {
|
||||
await http
|
||||
.patch(config.API.profileNewAbilityByAbilityId(idData), {
|
||||
profileId: id.value,
|
||||
isActive: true,
|
||||
remark: specialSkill.remark,
|
||||
field: specialSkill.field,
|
||||
|
|
@ -359,13 +368,7 @@ onMounted(async () => {
|
|||
clickable
|
||||
@click="
|
||||
() => {
|
||||
dialogStatus = 'edit';
|
||||
editId = props.row.id;
|
||||
specialSkill.detail = props.row.detail;
|
||||
specialSkill.field = props.row.field;
|
||||
specialSkill.reference = props.row.reference;
|
||||
specialSkill.remark = props.row.remark;
|
||||
dialog = true;
|
||||
editForm(props.row);
|
||||
}
|
||||
"
|
||||
>
|
||||
|
|
@ -417,13 +420,7 @@ onMounted(async () => {
|
|||
size="14px"
|
||||
@click="
|
||||
() => {
|
||||
dialogStatus = 'edit';
|
||||
editId = props.row.id;
|
||||
specialSkill.detail = props.row.detail;
|
||||
specialSkill.field = props.row.field;
|
||||
specialSkill.reference = props.row.reference;
|
||||
specialSkill.remark = props.row.remark;
|
||||
dialog = true;
|
||||
editForm(props.row);
|
||||
}
|
||||
"
|
||||
>
|
||||
|
|
@ -533,7 +530,7 @@ onMounted(async () => {
|
|||
<q-form @submit.prevent greedy @validation-success="validateForm">
|
||||
<q-card-section class="flex justify-between" style="padding: 0">
|
||||
<dialog-header
|
||||
tittle="ประวัติแก้ไขประวัติการศึกษา"
|
||||
tittle="ประวัติแก้ไขความสามารถพิเศษ"
|
||||
:close="closeHistoryDialog"
|
||||
/>
|
||||
</q-card-section>
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
interface RequestItemsObject {
|
||||
profileId: string;
|
||||
profileId?: string;
|
||||
isActive: boolean;
|
||||
detail: string;
|
||||
issueDate: Date | null;
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
interface RequestItemsObject {
|
||||
profileId: string;
|
||||
profileId?: string;
|
||||
isActive: boolean;
|
||||
year: number;
|
||||
no: string;
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
interface ProfesLicenseObject {
|
||||
interface RequestItemsObject {
|
||||
certificateType: string;
|
||||
issuer: string;
|
||||
certificateNo: string;
|
||||
|
|
@ -6,4 +6,4 @@ interface ProfesLicenseObject {
|
|||
expireDate: Date;
|
||||
}
|
||||
|
||||
export type { ProfesLicenseObject };
|
||||
export type { RequestItemsObject };
|
||||
|
|
@ -1,5 +1,5 @@
|
|||
interface RequestItemsObject {
|
||||
profileId: string;
|
||||
profileId?: string;
|
||||
isActive: boolean;
|
||||
name: string;
|
||||
date: Date | null;
|
||||
|
|
|
|||
|
|
@ -0,0 +1,12 @@
|
|||
//ข้อมูล
|
||||
interface ResponseObject {
|
||||
issuer: string,
|
||||
certificateType: string,
|
||||
certificateNo: string,
|
||||
issueDate: Date | null,
|
||||
isActive: boolean,
|
||||
expireDate: Date | null
|
||||
}
|
||||
|
||||
export type { ResponseObject };
|
||||
|
||||
|
|
@ -1,18 +1,32 @@
|
|||
<script setup lang="ts">
|
||||
import { ref, onMounted } from "vue";
|
||||
import { ref, onMounted, reactive } from "vue";
|
||||
import axios from "axios";
|
||||
import { useRoute, useRouter } from "vue-router";
|
||||
import { useCounterMixin } from "@/stores/mixin";
|
||||
import http from "@/plugins/http";
|
||||
import config from "@/app.config";
|
||||
|
||||
import { useQuasar } from "quasar";
|
||||
import type { DataOption } from "@/modules/04_registryNew/interface/index/Main";
|
||||
import type { DataPerson } from "@/modules/04_registryNew/interface/response/Main";
|
||||
|
||||
import avatar from "@/assets/avatar_user.jpg";
|
||||
import TabMain from "@/modules/04_registryNew/components/detail/TabMain.vue";
|
||||
import UploadFile from "@/modules/11_discipline/components/UploadFile.vue";
|
||||
const mixin = useCounterMixin();
|
||||
const $q = useQuasar();
|
||||
const router = useRouter();
|
||||
const route = useRoute();
|
||||
const {
|
||||
dialogRemove,
|
||||
dialogConfirm,
|
||||
showLoader,
|
||||
hideLoader,
|
||||
messageError,
|
||||
success,
|
||||
date2Thai,
|
||||
} = mixin;
|
||||
|
||||
const profileId = ref<string>(route.params.id.toString());
|
||||
const formDetail = ref<DataPerson>();
|
||||
const formDetail = ref<any>();
|
||||
const itemsMenu = ref<DataOption[]>([
|
||||
{
|
||||
id: "1",
|
||||
|
|
@ -39,27 +53,94 @@ const itemsMenu = ref<DataOption[]>([
|
|||
name: "อื่นๆ",
|
||||
},
|
||||
]);
|
||||
|
||||
const uploadUrl = ref<string>("");
|
||||
const fileName = ref<string>("");
|
||||
const profilePicture = ref<string>("");
|
||||
const profileFile = ref();
|
||||
const input = document.createElement("input");
|
||||
input.type = "file";
|
||||
input.accept = ".jpg,.png,.tif,.pic";
|
||||
|
||||
input.addEventListener("change", (e) => {
|
||||
profileFile.value = (e.currentTarget as HTMLInputElement).files?.[0];
|
||||
uploadProfile();
|
||||
});
|
||||
|
||||
function selectFile() {
|
||||
input.click();
|
||||
}
|
||||
|
||||
function fetchDataPersonal() {
|
||||
const data = {
|
||||
id: "1526d9d3-d8b1-43ab-81b5-a84dfbe99201",
|
||||
prefix: "นาย",
|
||||
firstName: "ณัฐพงศ์",
|
||||
lastName: "ดิษยบุตร",
|
||||
citizenId: "0000000000001",
|
||||
position: "นักบริหาร",
|
||||
posLevelId: "1526d9d3-d8b1-43ab-81b5-a84dfbe09362",
|
||||
posTypeId: "1526d9d3-d8b1-43ab-81b5-a84dfbe08091",
|
||||
};
|
||||
async function uploadProfile() {
|
||||
await http
|
||||
.post(config.API.file("ทะเบียนประวัติ", "โปรไฟล์", profileId.value), {
|
||||
replace: true,
|
||||
fileList: [
|
||||
{
|
||||
fileName: fileName.value,
|
||||
},
|
||||
],
|
||||
})
|
||||
.then(async (res) => {
|
||||
uploadUrl.value = res.data[fileName.value].uploadUrl;
|
||||
uploadFileURL(uploadUrl.value, profileFile.value);
|
||||
})
|
||||
.catch((err) => {
|
||||
messageError($q, err);
|
||||
})
|
||||
.finally(() => {
|
||||
hideLoader();
|
||||
});
|
||||
}
|
||||
|
||||
formDetail.value = data;
|
||||
async function uploadFileURL(uploadUrl: string, file: any) {
|
||||
showLoader();
|
||||
await axios
|
||||
.put(uploadUrl, file, {
|
||||
headers: {
|
||||
"Content-Type": file.type,
|
||||
},
|
||||
})
|
||||
.then(() => {
|
||||
fetchProfile(profileId.value);
|
||||
success($q, "อัปโหลดไฟล์สำเร็จ");
|
||||
})
|
||||
.catch((err) => {
|
||||
messageError($q, err);
|
||||
})
|
||||
.finally(() => {
|
||||
hideLoader();
|
||||
});
|
||||
}
|
||||
|
||||
async function fetchProfile(id: string) {
|
||||
showLoader();
|
||||
await http
|
||||
.get(config.API.fileByFile("ทะเบียนประวัติ", "โปรไฟล์", id, fileName.value))
|
||||
.then(async (res) => {
|
||||
profilePicture.value = res.data.downloadUrl;
|
||||
})
|
||||
.catch(() => {
|
||||
profilePicture.value = avatar;
|
||||
})
|
||||
.finally(() => {
|
||||
hideLoader();
|
||||
});
|
||||
}
|
||||
|
||||
async function fetchDataPersonal() {
|
||||
showLoader();
|
||||
await http
|
||||
.get(config.API.registryNewByProfileId(profileId.value))
|
||||
.then((res) => {
|
||||
formDetail.value = res.data.result;
|
||||
})
|
||||
.catch((err) => {
|
||||
messageError($q, err);
|
||||
})
|
||||
.finally(() => {
|
||||
hideLoader();
|
||||
});
|
||||
}
|
||||
|
||||
function onClickDownloadKp7(type: string) {
|
||||
|
|
@ -69,7 +150,9 @@ function onClickDownloadKp7(type: string) {
|
|||
window.open(config.API.profileKp7ShortId(profileId.value));
|
||||
}
|
||||
}
|
||||
onMounted(() => {
|
||||
onMounted(async () => {
|
||||
fileName.value = `profile-${profileId.value}`;
|
||||
fetchProfile(profileId.value);
|
||||
fetchDataPersonal();
|
||||
});
|
||||
</script>
|
||||
|
|
@ -147,7 +230,7 @@ onMounted(() => {
|
|||
|
||||
<div class="absolute-center-left q-ml-lg">
|
||||
<q-avatar size="130px">
|
||||
<img src="@/assets/avatar_user.jpg" />
|
||||
<img :src="profilePicture" />
|
||||
</q-avatar>
|
||||
<q-btn
|
||||
round
|
||||
|
|
@ -166,19 +249,19 @@ onMounted(() => {
|
|||
<div class="col-2">
|
||||
<div class="col-sm-3 col-md-3">
|
||||
<div class="col text-grey-6">ตำแหน่งในสายงาน</div>
|
||||
<div class="col">หัวหน้าสำนักงาน</div>
|
||||
<div class="col">{{ formDetail?.position }}</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-2">
|
||||
<div class="col-sm-3 col-md-3">
|
||||
<div class="col text-grey-6">ประเภทตำแหน่ง</div>
|
||||
<div class="col">บริหาร</div>
|
||||
<div class="col">{{ formDetail?.posType.posTypeName }}</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-2">
|
||||
<div class="col-sm-3 col-md-3">
|
||||
<div class="col text-grey-6">ระดับตำแหน่งง</div>
|
||||
<div class="col">ชำนาญการพิเศษ</div>
|
||||
<div class="col text-grey-6">ระดับตำแหน่ง</div>
|
||||
<div class="col">{{ formDetail?.posLevel.posLevelName }}</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -309,15 +309,15 @@ function fetchDataPeriodNew() {
|
|||
}
|
||||
|
||||
function onClickDownload(data: DataOption) {
|
||||
if (data.id === "gov1-06" || data.id === "gov2-06") {
|
||||
if (data.id === "gov-06") {
|
||||
const formData = {
|
||||
type: "HAFT",
|
||||
startDate:
|
||||
data.id === "gov1-06"
|
||||
data.id === "gov-06"
|
||||
? `${props?.roundFilter?.year - 1}-10-01`
|
||||
: `${props?.roundFilter?.year}-04-01`,
|
||||
endDate:
|
||||
data.id === "gov1-06"
|
||||
data.id === "gov-06"
|
||||
? `${props?.roundFilter?.year}-03-31`
|
||||
: `${props?.roundFilter?.year}-09-30`,
|
||||
};
|
||||
|
|
@ -336,6 +336,10 @@ function onClickDownload(data: DataOption) {
|
|||
} else {
|
||||
if (props.rootId && props.periodId) {
|
||||
showLoader();
|
||||
console.log("id==>", data.id);
|
||||
console.log("rootId==>", props.rootId);
|
||||
console.log("periodId==>", props.periodId);
|
||||
|
||||
http
|
||||
.get(
|
||||
config.API.salaryReportListsByid(
|
||||
|
|
|
|||
|
|
@ -64,35 +64,35 @@ export const useSalaryEmployeeListSDataStore = defineStore(
|
|||
/** List Download รายงานของรอบเมษายน*/
|
||||
const itemDownloadApr = ref<DataOption[]>([
|
||||
{
|
||||
id: "gov1-01",
|
||||
id: "gov-01",
|
||||
name: "รายชื่อข้าราชการผู้ที่ครองตำแหน่ง ณ วันที่ 1 มีนาคม",
|
||||
},
|
||||
{
|
||||
id: "gov1-02",
|
||||
id: "gov-02",
|
||||
name: "บัญชีการคำนวณโควตาเลื่อนเงินเดือน รอบเมษายน",
|
||||
},
|
||||
{
|
||||
id: "gov1-03",
|
||||
id: "gov-03",
|
||||
name: "รายชื่อข้าราชการที่ได้รับการเสนอขอเลื่อนหนึ่งขั้น",
|
||||
},
|
||||
{
|
||||
id: "gov1-04",
|
||||
id: "gov-04",
|
||||
name: "แบบ 1 กท รอบเมษายน",
|
||||
},
|
||||
{
|
||||
id: "gov1-05",
|
||||
id: "gov-05",
|
||||
name: "แบบ 2 กท รอบเมษายน",
|
||||
},
|
||||
{
|
||||
id: "gov1-06",
|
||||
id: "gov-06",
|
||||
name: "แบบ 3 กท บัญชีแสดงวันลาครึ่งปี ขรก.",
|
||||
},
|
||||
{
|
||||
id: "gov1-07",
|
||||
id: "gov-07",
|
||||
name: "คำสั่งเลื่อนเงินเดือน รอบเมษายน",
|
||||
},
|
||||
{
|
||||
id: "gov1-08",
|
||||
id: "gov-08",
|
||||
name: "คำสั่งค่าตอบแทนพิเศษ และผู้ไม่ได้เลื่อน รอบเมษายน",
|
||||
},
|
||||
]);
|
||||
|
|
@ -100,39 +100,39 @@ export const useSalaryEmployeeListSDataStore = defineStore(
|
|||
/** List Download รายงานของรอบตุลาคม*/
|
||||
const itemDownloadOct = ref<DataOption[]>([
|
||||
{
|
||||
id: "gov2-01",
|
||||
id: "gov-01",
|
||||
name: "รายชื่อข้าราชการผู้ที่ครองตำแหน่ง ณ วันที่ 1 กันยายน",
|
||||
},
|
||||
{
|
||||
id: "gov2-02",
|
||||
id: "gov-02",
|
||||
name: "บัญชีการคำนวณวงเงินเลื่อนเงินเดือน รอบตุลาคม",
|
||||
},
|
||||
{
|
||||
id: "gov2-03",
|
||||
id: "gov-03",
|
||||
name: "รายชื่อข้าราชการผู้ที่ได้รับการเสนอขอเลื่อนเงินเดือนทั้งปีสองขั้น",
|
||||
},
|
||||
{
|
||||
id: "gov2-04",
|
||||
id: "gov-04",
|
||||
name: "แบบ 1 กท รอบตุลาคม",
|
||||
},
|
||||
{
|
||||
id: "gov2-05",
|
||||
id: "gov-05",
|
||||
name: "แบบ 2 กท รอบตุลาคม",
|
||||
},
|
||||
{
|
||||
id: "gov2-06",
|
||||
id: "gov-06",
|
||||
name: "แบบ 3 กท บัญชีแสดงวันลาครึ่งปี ขรก. ",
|
||||
},
|
||||
{
|
||||
id: "gov2-07",
|
||||
id: "gov-07",
|
||||
name: "คำสั่งเลื่อนเงินเดือนข้าราชการเกษียณ",
|
||||
},
|
||||
{
|
||||
id: "gov2-08",
|
||||
id: "gov-08",
|
||||
name: "คำสั่งเลื่อนเงินเดือน รอบตุลาคม",
|
||||
},
|
||||
{
|
||||
id: "gov2-09",
|
||||
id: "gov-09",
|
||||
name: "คำสั่งค่าตอบแทนพิเศษ และผู้ไม่ได้เลื่อนเงินเดือน รอบตุลาคม",
|
||||
},
|
||||
]);
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@ export const useSalaryListSDataStore = defineStore("salaryListStore", () => {
|
|||
|
||||
const remaining = ref<number>(0);
|
||||
|
||||
const statusQuota = ref<string>('')
|
||||
const statusQuota = ref<string>("");
|
||||
const groupId = ref<string>("");
|
||||
const rootId = ref<string>("");
|
||||
const roundMainCode = ref<string>("");
|
||||
|
|
@ -62,35 +62,35 @@ export const useSalaryListSDataStore = defineStore("salaryListStore", () => {
|
|||
/** List Download รายงานของรอบเมษายน*/
|
||||
const itemDownloadApr = ref<DataOption[]>([
|
||||
{
|
||||
id: "gov1-01",
|
||||
id: "gov-01",
|
||||
name: "รายชื่อข้าราชการผู้ที่ครองตำแหน่ง ณ วันที่ 1 มีนาคม",
|
||||
},
|
||||
{
|
||||
id: "gov1-02",
|
||||
id: "gov-02",
|
||||
name: "บัญชีการคำนวณโควตาเลื่อนเงินเดือน รอบเมษายน",
|
||||
},
|
||||
{
|
||||
id: "gov1-03",
|
||||
id: "gov-03",
|
||||
name: "รายชื่อข้าราชการที่ได้รับการเสนอขอเลื่อนหนึ่งขั้น",
|
||||
},
|
||||
{
|
||||
id: "gov1-04",
|
||||
id: "gov-04",
|
||||
name: "แบบ 1 กท รอบเมษายน",
|
||||
},
|
||||
{
|
||||
id: "gov1-05",
|
||||
id: "gov-05",
|
||||
name: "แบบ 2 กท รอบเมษายน",
|
||||
},
|
||||
{
|
||||
id: "gov1-06",
|
||||
id: "gov-06",
|
||||
name: "แบบ 3 กท บัญชีแสดงวันลาครึ่งปี ขรก.",
|
||||
},
|
||||
{
|
||||
id: "gov1-07",
|
||||
id: "gov-07",
|
||||
name: "คำสั่งเลื่อนเงินเดือน รอบเมษายน",
|
||||
},
|
||||
{
|
||||
id: "gov1-08",
|
||||
id: "gov-08",
|
||||
name: "คำสั่งค่าตอบแทนพิเศษ และผู้ไม่ได้เลื่อน รอบเมษายน",
|
||||
},
|
||||
]);
|
||||
|
|
@ -98,39 +98,39 @@ export const useSalaryListSDataStore = defineStore("salaryListStore", () => {
|
|||
/** List Download รายงานของรอบตุลาคม*/
|
||||
const itemDownloadOct = ref<DataOption[]>([
|
||||
{
|
||||
id: "gov2-01",
|
||||
id: "gov-01",
|
||||
name: "รายชื่อข้าราชการผู้ที่ครองตำแหน่ง ณ วันที่ 1 กันยายน",
|
||||
},
|
||||
{
|
||||
id: "gov2-02",
|
||||
id: "gov-02",
|
||||
name: "บัญชีการคำนวณวงเงินเลื่อนเงินเดือน รอบตุลาคม",
|
||||
},
|
||||
{
|
||||
id: "gov2-03",
|
||||
id: "gov-03",
|
||||
name: "รายชื่อข้าราชการผู้ที่ได้รับการเสนอขอเลื่อนเงินเดือนทั้งปีสองขั้น",
|
||||
},
|
||||
{
|
||||
id: "gov2-04",
|
||||
id: "gov-04",
|
||||
name: "แบบ 1 กท รอบตุลาคม",
|
||||
},
|
||||
{
|
||||
id: "gov2-05",
|
||||
id: "gov-05",
|
||||
name: "แบบ 2 กท รอบตุลาคม",
|
||||
},
|
||||
{
|
||||
id: "gov2-06",
|
||||
id: "gov-06",
|
||||
name: "แบบ 3 กท บัญชีแสดงวันลาครึ่งปี ขรก. ",
|
||||
},
|
||||
{
|
||||
id: "gov2-07",
|
||||
id: "gov-07",
|
||||
name: "คำสั่งเลื่อนเงินเดือนข้าราชการเกษียณ",
|
||||
},
|
||||
{
|
||||
id: "gov2-08",
|
||||
id: "gov-08",
|
||||
name: "คำสั่งเลื่อนเงินเดือน รอบตุลาคม",
|
||||
},
|
||||
{
|
||||
id: "gov2-09",
|
||||
id: "gov-09",
|
||||
name: "คำสั่งค่าตอบแทนพิเศษ และผู้ไม่ได้เลื่อนเงินเดือน รอบตุลาคม",
|
||||
},
|
||||
]);
|
||||
|
|
@ -156,6 +156,6 @@ export const useSalaryListSDataStore = defineStore("salaryListStore", () => {
|
|||
remaining,
|
||||
isClosedRound,
|
||||
roundYear,
|
||||
statusQuota
|
||||
statusQuota,
|
||||
};
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue