Merge branch 'develop' into devTee
This commit is contained in:
commit
ee22aa6f6f
19 changed files with 757 additions and 318 deletions
|
|
@ -4,11 +4,27 @@ const registryNew = `${env.API_URI}/org/profile/`;
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
registryNew,
|
registryNew,
|
||||||
|
// เครื่องราชฯ
|
||||||
profileNewInsign: `${registryNew}insignia`,
|
profileNewInsign: `${registryNew}insignia`,
|
||||||
profileNewInsignByProfileId: (profileId: string) =>
|
profileNewInsignByProfileId: (profileId: string) =>
|
||||||
`${registryNew}insignia/${profileId}`,
|
`${registryNew}insignia/${profileId}`,
|
||||||
profileNewInsignByInsignId: (insignId: string) =>
|
profileNewInsignById: (dataId: string) => `${registryNew}insignia/${dataId}`,
|
||||||
`${registryNew}insignia/${insignId}`,
|
profileNewInsignHisById: (dataId: string) =>
|
||||||
profileNewInsignHisByInsignId: (insignId: string) =>
|
`${registryNew}insignia/history/${dataId}`,
|
||||||
`${registryNew}insignia/history/${insignId}`,
|
|
||||||
|
// ประกาศเกียรติคุณ
|
||||||
|
profileNewHonor: `${registryNew}honor`,
|
||||||
|
profileNewHonorByProfileId: (profileId: string) =>
|
||||||
|
`${registryNew}honor/${profileId}`,
|
||||||
|
profileNewHonorById: (dataId: string) => `${registryNew}honor/${dataId}`,
|
||||||
|
profileNewHonorHisById: (dataId: string) => `${registryNew}honor/${dataId}`,
|
||||||
|
|
||||||
|
// การฝึกอบรม
|
||||||
|
profileNewTraining: `${registryNew}training`,
|
||||||
|
profileNewTrainingByProfileId: (profileId: string) =>
|
||||||
|
`${registryNew}training/${profileId}`,
|
||||||
|
profileNewTrainingByTrainingId: (trainingId: string) =>
|
||||||
|
`${registryNew}training/${trainingId}`,
|
||||||
|
profileNewTrainingHisByTrainingId: (trainingId: string) =>
|
||||||
|
`${registryNew}training/history/${trainingId}`,
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -251,6 +251,7 @@ async function deleteData(idData: string) {
|
||||||
.delete(config.API.insigniaNewIdOrg(idData))
|
.delete(config.API.insigniaNewIdOrg(idData))
|
||||||
.then(() => {
|
.then(() => {
|
||||||
fetchData(id.value);
|
fetchData(id.value);
|
||||||
|
success($q, "ลบข้อมูลสำเร็จ");
|
||||||
})
|
})
|
||||||
.catch((err) => {
|
.catch((err) => {
|
||||||
messageError($q, err);
|
messageError($q, err);
|
||||||
|
|
|
||||||
|
|
@ -163,6 +163,7 @@ async function deleteData(id: string) {
|
||||||
.delete(config.API.insigniaTypeNewIdOrg(id))
|
.delete(config.API.insigniaTypeNewIdOrg(id))
|
||||||
.then(() => {
|
.then(() => {
|
||||||
fetchData();
|
fetchData();
|
||||||
|
success($q, "ลบข้อมูลสำเร็จ");
|
||||||
})
|
})
|
||||||
.catch((err) => {
|
.catch((err) => {
|
||||||
messageError($q, err);
|
messageError($q, err);
|
||||||
|
|
|
||||||
|
|
@ -126,6 +126,7 @@ async function deleteData(id: string) {
|
||||||
.delete(config.API.orgPrefixId(id))
|
.delete(config.API.orgPrefixId(id))
|
||||||
.then(() => {
|
.then(() => {
|
||||||
fetchData();
|
fetchData();
|
||||||
|
success($q, "ลบข้อมูลสำเร็จ");
|
||||||
})
|
})
|
||||||
.catch((err) => {
|
.catch((err) => {
|
||||||
messageError($q, err);
|
messageError($q, err);
|
||||||
|
|
|
||||||
|
|
@ -130,6 +130,7 @@ async function deleteData(id: string) {
|
||||||
.delete(config.API.orgRankId(id))
|
.delete(config.API.orgRankId(id))
|
||||||
.then(() => {
|
.then(() => {
|
||||||
fetchData();
|
fetchData();
|
||||||
|
success($q, "ลบข้อมูลสำเร็จ");
|
||||||
})
|
})
|
||||||
.catch((err) => {
|
.catch((err) => {
|
||||||
messageError($q, err);
|
messageError($q, err);
|
||||||
|
|
|
||||||
|
|
@ -130,6 +130,7 @@ async function deleteData(id: string) {
|
||||||
.delete(config.API.orgBloodGroupId(id))
|
.delete(config.API.orgBloodGroupId(id))
|
||||||
.then(() => {
|
.then(() => {
|
||||||
fetchData();
|
fetchData();
|
||||||
|
success($q, "ลบข้อมูลสำเร็จ");
|
||||||
})
|
})
|
||||||
.catch((err) => {
|
.catch((err) => {
|
||||||
messageError($q, err);
|
messageError($q, err);
|
||||||
|
|
|
||||||
|
|
@ -130,6 +130,7 @@ async function deleteData(id: string) {
|
||||||
.delete(config.API.orgGenderId(id))
|
.delete(config.API.orgGenderId(id))
|
||||||
.then(() => {
|
.then(() => {
|
||||||
fetchData();
|
fetchData();
|
||||||
|
success($q, "ลบข้อมูลสำเร็จ");
|
||||||
})
|
})
|
||||||
.catch((err) => {
|
.catch((err) => {
|
||||||
messageError($q, err);
|
messageError($q, err);
|
||||||
|
|
|
||||||
|
|
@ -130,6 +130,7 @@ async function deleteData(id: string) {
|
||||||
.delete(config.API.orgReligionId(id))
|
.delete(config.API.orgReligionId(id))
|
||||||
.then(() => {
|
.then(() => {
|
||||||
fetchData();
|
fetchData();
|
||||||
|
success($q, "ลบข้อมูลสำเร็จ");
|
||||||
})
|
})
|
||||||
.catch((err) => {
|
.catch((err) => {
|
||||||
messageError($q, err);
|
messageError($q, err);
|
||||||
|
|
|
||||||
|
|
@ -158,6 +158,7 @@ async function deleteData(id: string) {
|
||||||
.delete(config.API.orgRelationshipId(id))
|
.delete(config.API.orgRelationshipId(id))
|
||||||
.then(() => {
|
.then(() => {
|
||||||
fetchData();
|
fetchData();
|
||||||
|
success($q, "ลบข้อมูลสำเร็จ");
|
||||||
})
|
})
|
||||||
.catch((err) => {
|
.catch((err) => {
|
||||||
messageError($q, err);
|
messageError($q, err);
|
||||||
|
|
|
||||||
|
|
@ -142,6 +142,7 @@ async function deleteData(id: string) {
|
||||||
.delete(config.API.orgEducationLevelId(id))
|
.delete(config.API.orgEducationLevelId(id))
|
||||||
.then(() => {
|
.then(() => {
|
||||||
fetchData();
|
fetchData();
|
||||||
|
success($q, "ลบข้อมูลสำเร็จ");
|
||||||
})
|
})
|
||||||
.catch((err) => {
|
.catch((err) => {
|
||||||
messageError($q, err);
|
messageError($q, err);
|
||||||
|
|
|
||||||
|
|
@ -146,6 +146,7 @@ async function deleteData(id: string) {
|
||||||
.delete(config.API.orgPosTypeId(id))
|
.delete(config.API.orgPosTypeId(id))
|
||||||
.then(() => {
|
.then(() => {
|
||||||
fetchData();
|
fetchData();
|
||||||
|
success($q, "ลบข้อมูลสำเร็จ");
|
||||||
})
|
})
|
||||||
.catch((err) => {
|
.catch((err) => {
|
||||||
messageError($q, err);
|
messageError($q, err);
|
||||||
|
|
|
||||||
|
|
@ -203,6 +203,7 @@ async function deleteData(id: string) {
|
||||||
.delete(config.API.orgPosLevelId(id))
|
.delete(config.API.orgPosLevelId(id))
|
||||||
.then(() => {
|
.then(() => {
|
||||||
fetchData();
|
fetchData();
|
||||||
|
success($q, "ลบข้อมูลสำเร็จ");
|
||||||
})
|
})
|
||||||
.catch((err) => {
|
.catch((err) => {
|
||||||
messageError($q, err);
|
messageError($q, err);
|
||||||
|
|
|
||||||
|
|
@ -225,6 +225,7 @@ function closeHistoryDialog() {
|
||||||
bordered
|
bordered
|
||||||
:paging="true"
|
:paging="true"
|
||||||
dense
|
dense
|
||||||
|
v-model:pagination="pagination"
|
||||||
:rows-per-page-options="[20, 50, 100]"
|
:rows-per-page-options="[20, 50, 100]"
|
||||||
class="custom-header-table"
|
class="custom-header-table"
|
||||||
:visible-columns="visibleColumns"
|
:visible-columns="visibleColumns"
|
||||||
|
|
|
||||||
|
|
@ -1,16 +1,29 @@
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { ref, reactive, watch } from "vue";
|
import { ref, reactive, watch, onMounted } from "vue";
|
||||||
import moment from "moment";
|
import moment from "moment";
|
||||||
import dialogHeader from "@/components/DialogHeader.vue";
|
import dialogHeader from "@/components/DialogHeader.vue";
|
||||||
import type { QTableProps } from "quasar";
|
import type { QTableProps } from "quasar";
|
||||||
import { useCounterMixin } from "@/stores/mixin";
|
import { useCounterMixin } from "@/stores/mixin";
|
||||||
|
import { useRoute } from "vue-router";
|
||||||
import { QForm, useQuasar } from "quasar";
|
import { QForm, useQuasar } from "quasar";
|
||||||
|
import http from "@/plugins/http";
|
||||||
|
import config from "@/app.config";
|
||||||
|
|
||||||
const mixin = useCounterMixin();
|
const mixin = useCounterMixin();
|
||||||
const $q = useQuasar();
|
const $q = useQuasar();
|
||||||
const { dialogConfirm, date2Thai } = mixin;
|
const {
|
||||||
|
dialogRemove,
|
||||||
|
dialogConfirm,
|
||||||
|
showLoader,
|
||||||
|
hideLoader,
|
||||||
|
messageError,
|
||||||
|
success,
|
||||||
|
date2Thai,
|
||||||
|
} = mixin;
|
||||||
|
|
||||||
const addDataDialog = ref<boolean>(false);
|
const route = useRoute();
|
||||||
|
const id = ref<string>(route.params.id.toString());
|
||||||
|
const dialog = ref<boolean>(false);
|
||||||
const mode = ref<string>("table");
|
const mode = ref<string>("table");
|
||||||
const columns = ref<QTableProps["columns"]>([
|
const columns = ref<QTableProps["columns"]>([
|
||||||
{
|
{
|
||||||
|
|
@ -125,27 +138,10 @@ const columns = ref<QTableProps["columns"]>([
|
||||||
},
|
},
|
||||||
]);
|
]);
|
||||||
const isDate = ref<string>("false");
|
const isDate = ref<string>("false");
|
||||||
const educationOption = ["ใช่", "ไม่ใช่"];
|
const dialogStatus = ref<string>("create");
|
||||||
const historyDialog = ref<boolean>(false);
|
const historyDialog = ref<boolean>(false);
|
||||||
const educationData = reactive({
|
const editId = ref<string>("");
|
||||||
level: "",
|
|
||||||
institute: "",
|
|
||||||
startYear: new Date().getFullYear(),
|
|
||||||
finishYear: new Date().getFullYear(),
|
|
||||||
graduateDate: new Date(),
|
|
||||||
startDate: new Date(),
|
|
||||||
endDate: new Date(),
|
|
||||||
isEducation: "",
|
|
||||||
degree: "",
|
|
||||||
field: "",
|
|
||||||
fundName: "",
|
|
||||||
gpa: null,
|
|
||||||
country: "",
|
|
||||||
other: "",
|
|
||||||
duration: "",
|
|
||||||
durationYear: "",
|
|
||||||
note: "",
|
|
||||||
});
|
|
||||||
const trainData = reactive({
|
const trainData = reactive({
|
||||||
name: "",
|
name: "",
|
||||||
topic: "",
|
topic: "",
|
||||||
|
|
@ -178,7 +174,7 @@ const row = [
|
||||||
topic: "ชื่อหัวข้อ",
|
topic: "ชื่อหัวข้อ",
|
||||||
yearly: "2567",
|
yearly: "2567",
|
||||||
place: "สถานที่",
|
place: "สถานที่",
|
||||||
duration: "2567",
|
duration: "3 ปี",
|
||||||
department: "แผนกสาขา",
|
department: "แผนกสาขา",
|
||||||
numberOrder: "1244",
|
numberOrder: "1244",
|
||||||
dateOrder: new Date(),
|
dateOrder: new Date(),
|
||||||
|
|
@ -247,17 +243,19 @@ const row = [
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
|
const rows = ref<any>([]);
|
||||||
|
|
||||||
const visibleColumns = ref<string[]>([
|
const visibleColumns = ref<string[]>([
|
||||||
"name",
|
"name", // ชื่อโครงงาน
|
||||||
"topic",
|
"topic", // หัวข้อ
|
||||||
"yearly",
|
"yearly", // ปีที่อบรม
|
||||||
"place",
|
"place", // สถานที่
|
||||||
"duration",
|
"duration", // รวมระยะวเลา
|
||||||
"department",
|
"department", // หน่วยงานที่รับผิดชอบ
|
||||||
"numberOrder",
|
"numberOrder", // เลขที่คำสั่ง
|
||||||
"dateOrder",
|
"dateOrder", // คำสั่งลงวันที่
|
||||||
"startDate",
|
"startDate", // วันเริ่มต้น
|
||||||
"endDate",
|
"endDate", // วันสิ้นสุด
|
||||||
]);
|
]);
|
||||||
|
|
||||||
function validateForm() {
|
function validateForm() {
|
||||||
|
|
@ -268,6 +266,7 @@ async function onSubmit() {
|
||||||
dialogConfirm(
|
dialogConfirm(
|
||||||
$q,
|
$q,
|
||||||
async () => {
|
async () => {
|
||||||
|
dialogStatus.value === "create" ? addData() : editData(editId.value);
|
||||||
closeDialog();
|
closeDialog();
|
||||||
},
|
},
|
||||||
"ยืนยันการบันทึกข้อมูล",
|
"ยืนยันการบันทึกข้อมูล",
|
||||||
|
|
@ -275,8 +274,94 @@ async function onSubmit() {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function clearForm() {
|
||||||
|
isDate.value = "false";
|
||||||
|
trainData.name = "";
|
||||||
|
trainData.topic = "";
|
||||||
|
trainData.yearly = new Date().getFullYear();
|
||||||
|
trainData.place = "";
|
||||||
|
trainData.duration = "";
|
||||||
|
trainData.department = "";
|
||||||
|
trainData.numberOrder = "";
|
||||||
|
trainData.dateOrder = new Date();
|
||||||
|
trainData.startDate = new Date();
|
||||||
|
trainData.endDate = new Date();
|
||||||
|
}
|
||||||
|
|
||||||
|
async function addData() {
|
||||||
|
await http
|
||||||
|
.post(config.API.profileNewTraining, {
|
||||||
|
profileId: id.value,
|
||||||
|
name: trainData.name,
|
||||||
|
topic: trainData.topic ? trainData.topic : "",
|
||||||
|
yearly: trainData.yearly,
|
||||||
|
place: trainData.place ? trainData.place : "",
|
||||||
|
duration: trainData.duration ? trainData.duration : "",
|
||||||
|
department: trainData.department ? trainData.department : "",
|
||||||
|
numberOrder: trainData.numberOrder ? trainData.numberOrder : "",
|
||||||
|
dateOrder: trainData.dateOrder,
|
||||||
|
startDate: trainData.startDate,
|
||||||
|
endDate: trainData.endDate,
|
||||||
|
isDate: isDate.value === "true" ? true : false,
|
||||||
|
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.profileNewTrainingByTrainingId(idData), {
|
||||||
|
profileId: id.value,
|
||||||
|
name: trainData.name,
|
||||||
|
topic: trainData.topic ? trainData.topic : "",
|
||||||
|
yearly: trainData.yearly,
|
||||||
|
place: trainData.place ? trainData.place : "",
|
||||||
|
duration: trainData.duration ? trainData.duration : "",
|
||||||
|
department: trainData.department ? trainData.department : "",
|
||||||
|
numberOrder: trainData.numberOrder ? trainData.numberOrder : "",
|
||||||
|
dateOrder: trainData.dateOrder,
|
||||||
|
startDate: trainData.startDate,
|
||||||
|
endDate: trainData.endDate,
|
||||||
|
isDate: isDate.value === "true" ? true : false,
|
||||||
|
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.profileNewTrainingByTrainingId(idData))
|
||||||
|
.then(() => {
|
||||||
|
fetchData(id.value);
|
||||||
|
})
|
||||||
|
.catch((err) => {
|
||||||
|
messageError($q, err);
|
||||||
|
})
|
||||||
|
.finally(() => {
|
||||||
|
hideLoader();
|
||||||
|
});
|
||||||
|
}
|
||||||
function closeDialog() {
|
function closeDialog() {
|
||||||
addDataDialog.value = false;
|
clearForm();
|
||||||
|
dialog.value = false;
|
||||||
}
|
}
|
||||||
function closeHistoryDialog() {
|
function closeHistoryDialog() {
|
||||||
historyDialog.value = false;
|
historyDialog.value = false;
|
||||||
|
|
@ -285,17 +370,83 @@ function closeHistoryDialog() {
|
||||||
watch(
|
watch(
|
||||||
() => isDate.value,
|
() => isDate.value,
|
||||||
() => {
|
() => {
|
||||||
if (isDate.value === "true") {
|
if (isDate.value === "false") {
|
||||||
trainData.startDate = new Date(`${trainData.startYear}`);
|
console.log(trainData.startDate);
|
||||||
trainData.endDate = new Date(`${trainData.finishYear}`);
|
trainData.startYear = +trainData.startDate.toString().slice(11, 15);
|
||||||
|
trainData.finishYear = +trainData.endDate.toString().slice(11, 15);
|
||||||
|
trainData.startDate = new Date(trainData.startYear + "-01-01");
|
||||||
|
trainData.endDate = new Date(trainData.finishYear + "-01-01");
|
||||||
} else {
|
} else {
|
||||||
trainData.startYear = parseInt(
|
trainData.startDate = new Date(trainData.startYear + "-01-01");
|
||||||
moment(trainData.startDate).format("YYYY")
|
trainData.endDate = new Date(trainData.finishYear + "-01-01");
|
||||||
);
|
|
||||||
trainData.finishYear = parseInt(moment(trainData.endDate).format("YYYY"));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
|
watch(
|
||||||
|
() => trainData.startYear,
|
||||||
|
() => {
|
||||||
|
if (isDate.value === "false") {
|
||||||
|
trainData.startDate = new Date(trainData.startYear + "-01-01");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
);
|
||||||
|
watch(
|
||||||
|
() => trainData.finishYear,
|
||||||
|
() => {
|
||||||
|
if (isDate.value === "false") {
|
||||||
|
trainData.endDate = new Date(trainData.finishYear + "-01-01");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
|
watch(
|
||||||
|
() => trainData.startDate,
|
||||||
|
() => {
|
||||||
|
if (isDate.value === "true") {
|
||||||
|
trainData.startYear = +trainData.startDate.toString().slice(11, 15);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
);
|
||||||
|
watch(
|
||||||
|
() => trainData.endDate,
|
||||||
|
() => {
|
||||||
|
if (isDate.value === "true") {
|
||||||
|
trainData.finishYear = +trainData.endDate.toString().slice(11, 15);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
);
|
||||||
|
// async function isDateCheck() {
|
||||||
|
// if (isDate.value === "false") {
|
||||||
|
// trainData.startYear = +trainData.startDate.toString().slice(11, 15);
|
||||||
|
// trainData.finishYear = +trainData.endDate.toString().slice(11, 15);
|
||||||
|
// trainData.startDate = new Date(trainData.startYear + "-01-01");
|
||||||
|
// trainData.endDate = new Date(trainData.finishYear + "-01-01");
|
||||||
|
// } else {
|
||||||
|
// trainData.startDate = new Date(trainData.startYear + "-01-01");
|
||||||
|
// trainData.endDate = new Date(trainData.finishYear + "-01-01");
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
|
||||||
|
async function fetchData(id: string) {
|
||||||
|
showLoader();
|
||||||
|
await http
|
||||||
|
.get(config.API.profileNewTrainingByProfileId(id))
|
||||||
|
.then(async (res) => {
|
||||||
|
rows.value = res.data.result;
|
||||||
|
console.log(rows.value);
|
||||||
|
})
|
||||||
|
.catch((err) => {
|
||||||
|
messageError($q, err);
|
||||||
|
})
|
||||||
|
.finally(() => {
|
||||||
|
hideLoader();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
onMounted(async () => {
|
||||||
|
await fetchData(id.value);
|
||||||
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
|
|
@ -306,7 +457,13 @@ watch(
|
||||||
color="primary"
|
color="primary"
|
||||||
icon="add"
|
icon="add"
|
||||||
size="16px"
|
size="16px"
|
||||||
@click="addDataDialog = true"
|
@click="
|
||||||
|
() => {
|
||||||
|
dialogStatus = 'create';
|
||||||
|
clearForm;
|
||||||
|
dialog = true;
|
||||||
|
}
|
||||||
|
"
|
||||||
>
|
>
|
||||||
<q-tooltip>เพิ่มข้อมูล</q-tooltip></q-btn
|
<q-tooltip>เพิ่มข้อมูล</q-tooltip></q-btn
|
||||||
>
|
>
|
||||||
|
|
@ -376,13 +533,14 @@ watch(
|
||||||
:grid="mode === 'card'"
|
:grid="mode === 'card'"
|
||||||
ref="table"
|
ref="table"
|
||||||
:columns="columns"
|
:columns="columns"
|
||||||
:rows="row"
|
:rows="rows"
|
||||||
row-key="name"
|
row-key="name"
|
||||||
flat
|
flat
|
||||||
bordered
|
bordered
|
||||||
:paging="true"
|
:paging="true"
|
||||||
dense
|
dense
|
||||||
:rows-per-page-options="[20, 50, 100]"
|
:rows-per-page-options="[20, 50, 100]"
|
||||||
|
v-model:pagination="pagination"
|
||||||
class="custom-header-table"
|
class="custom-header-table"
|
||||||
:visible-columns="visibleColumns"
|
:visible-columns="visibleColumns"
|
||||||
>
|
>
|
||||||
|
|
@ -399,19 +557,39 @@ watch(
|
||||||
<q-td
|
<q-td
|
||||||
v-for="col in props.cols"
|
v-for="col in props.cols"
|
||||||
:key="col.id"
|
:key="col.id"
|
||||||
@click="addDataDialog = true"
|
@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;
|
||||||
|
}
|
||||||
|
"
|
||||||
>
|
>
|
||||||
<div
|
<div v-if="col.name === 'startDate' || col.name === 'endDate'">
|
||||||
v-if="
|
<div v-if="props.row.isDate">{{ date2Thai(col.value) }}</div>
|
||||||
col.name === 'startDate' ||
|
<div v-else>
|
||||||
col.name === 'endDate' ||
|
{{ +col.value.slice(0, 4) + 543 }}
|
||||||
col.name === 'dateOrder'
|
</div>
|
||||||
"
|
|
||||||
>
|
|
||||||
{{ col.value ? date2Thai(col.value) : "-" }}
|
|
||||||
</div>
|
</div>
|
||||||
|
<div v-else-if="col.name === 'dateOrder'">
|
||||||
|
{{ date2Thai(col.value) }}
|
||||||
|
</div>
|
||||||
|
<div v-else-if="col.name === 'yearly'">{{ col.value + 543 }}</div>
|
||||||
<div v-else>
|
<div v-else>
|
||||||
{{ col.value }}
|
{{ col.value ? col.value : "-" }}
|
||||||
</div>
|
</div>
|
||||||
</q-td>
|
</q-td>
|
||||||
<q-td auto-width>
|
<q-td auto-width>
|
||||||
|
|
@ -426,6 +604,21 @@ watch(
|
||||||
>
|
>
|
||||||
<q-tooltip>ประวัติแก้ไขประวัติการศึกษา</q-tooltip>
|
<q-tooltip>ประวัติแก้ไขประวัติการศึกษา</q-tooltip>
|
||||||
</q-btn>
|
</q-btn>
|
||||||
|
<q-btn
|
||||||
|
color="red"
|
||||||
|
flat
|
||||||
|
dense
|
||||||
|
round
|
||||||
|
size="12px"
|
||||||
|
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-td>
|
||||||
</q-tr>
|
</q-tr>
|
||||||
</template>
|
</template>
|
||||||
|
|
@ -440,7 +633,7 @@ watch(
|
||||||
round
|
round
|
||||||
color="primary"
|
color="primary"
|
||||||
icon="edit"
|
icon="edit"
|
||||||
@click="addDataDialog = true"
|
@click="dialog = true"
|
||||||
>
|
>
|
||||||
<q-tooltip>แก้ไขข้อมูล</q-tooltip>
|
<q-tooltip>แก้ไขข้อมูล</q-tooltip>
|
||||||
</q-btn>
|
</q-btn>
|
||||||
|
|
@ -466,16 +659,7 @@ watch(
|
||||||
<div>{{ col.label }}</div>
|
<div>{{ col.label }}</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="col">
|
<div class="col">
|
||||||
<div
|
<div>{{ col.value }}</div>
|
||||||
v-if="
|
|
||||||
col.name === 'startDate' ||
|
|
||||||
col.name === 'endDate' ||
|
|
||||||
col.name === 'dateOrder'
|
|
||||||
"
|
|
||||||
>
|
|
||||||
{{ col.value ? date2Thai(col.value) : "-" }}
|
|
||||||
</div>
|
|
||||||
<div v-else>{{ col.value }}</div>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -485,11 +669,14 @@ watch(
|
||||||
</template>
|
</template>
|
||||||
</d-table>
|
</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-card style="min-width: 40%" class="bg-white">
|
||||||
<q-form @submit.prevent greedy @validation-success="validateForm">
|
<q-form @submit.prevent greedy @validation-success="validateForm">
|
||||||
<q-card-section class="flex justify-between" style="padding: 0">
|
<q-card-section class="flex justify-between" style="padding: 0">
|
||||||
<dialog-header tittle="เพิ่มประวัติการศึกษา" :close="closeDialog" />
|
<dialog-header
|
||||||
|
:tittle="dialogStatus == 'edit' ? 'แก้ไขข้อมูล' : 'เพิ่มข้อมูล'"
|
||||||
|
:close="closeDialog"
|
||||||
|
/>
|
||||||
</q-card-section>
|
</q-card-section>
|
||||||
<q-separator color="grey-4" />
|
<q-separator color="grey-4" />
|
||||||
<div class="col">
|
<div class="col">
|
||||||
|
|
@ -568,7 +755,7 @@ watch(
|
||||||
!!val ||
|
!!val ||
|
||||||
`${'กรุณาเลือกปีที่เริ่มต้นการฝึกอบรม/ดูงาน'}`,
|
`${'กรุณาเลือกปีที่เริ่มต้นการฝึกอบรม/ดูงาน'}`,
|
||||||
]"
|
]"
|
||||||
:label="`${'ปี ที่เริ่มต้นการฝึกอบรม/ดูงาน'}`"
|
:label="`${'ปีที่เริ่มต้นการฝึกอบรม/ดูงาน'}`"
|
||||||
>
|
>
|
||||||
<template v-slot:prepend>
|
<template v-slot:prepend>
|
||||||
<q-icon
|
<q-icon
|
||||||
|
|
@ -607,7 +794,7 @@ watch(
|
||||||
(val) =>
|
(val) =>
|
||||||
!!val || `${'กรุณาเลือกปีที่จบการฝึกอบรม/ดูงาน'}`,
|
!!val || `${'กรุณาเลือกปีที่จบการฝึกอบรม/ดูงาน'}`,
|
||||||
]"
|
]"
|
||||||
:label="`${'ปี ที่จบการฝึกอบรม/ดูงาน'}`"
|
:label="`${'ปีที่จบการฝึกอบรม/ดูงาน'}`"
|
||||||
>
|
>
|
||||||
<template v-slot:prepend>
|
<template v-slot:prepend>
|
||||||
<q-icon
|
<q-icon
|
||||||
|
|
@ -769,7 +956,6 @@ watch(
|
||||||
label="หน่วยงานที่รับผิดชอบจัดการฝึกอบรม/ดูงาน"
|
label="หน่วยงานที่รับผิดชอบจัดการฝึกอบรม/ดูงาน"
|
||||||
bg-color="white"
|
bg-color="white"
|
||||||
dense
|
dense
|
||||||
mask="#.##"
|
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</q-card-section>
|
</q-card-section>
|
||||||
|
|
@ -902,16 +1088,7 @@ watch(
|
||||||
<template v-slot:body="props">
|
<template v-slot:body="props">
|
||||||
<q-tr :props="props" class="cursor-pointer">
|
<q-tr :props="props" class="cursor-pointer">
|
||||||
<q-td v-for="col in props.cols" :key="col.id">
|
<q-td v-for="col in props.cols" :key="col.id">
|
||||||
<div
|
<div>
|
||||||
v-if="
|
|
||||||
col.name === 'startDate' ||
|
|
||||||
col.name === 'endDate' ||
|
|
||||||
col.name === 'dateOrder'
|
|
||||||
"
|
|
||||||
>
|
|
||||||
{{ col.value ? date2Thai(col.value) : "-" }}
|
|
||||||
</div>
|
|
||||||
<div v-else>
|
|
||||||
{{ col.value }}
|
{{ col.value }}
|
||||||
</div>
|
</div>
|
||||||
</q-td>
|
</q-td>
|
||||||
|
|
|
||||||
|
|
@ -1,28 +1,28 @@
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { onMounted, ref, watch, useAttrs } from "vue";
|
import { onMounted, ref, watch, reactive } from "vue";
|
||||||
|
import { useRoute } from "vue-router";
|
||||||
import { useQuasar } from "quasar";
|
import { useQuasar } from "quasar";
|
||||||
import type { QTableProps } from "quasar";
|
|
||||||
import http from "@/plugins/http";
|
import http from "@/plugins/http";
|
||||||
import config from "@/app.config";
|
import config from "@/app.config";
|
||||||
|
import type { QTableProps } from "quasar";
|
||||||
|
|
||||||
import { useCounterMixin } from "@/stores/mixin";
|
import { useCounterMixin } from "@/stores/mixin";
|
||||||
import HistoryTable from "@/components/TableHistory.vue";
|
import HistoryTable from "@/components/TableHistory.vue";
|
||||||
import DialogHeader from "@/components/DialogHeader.vue";
|
import DialogHeader from "@/components/DialogHeader.vue";
|
||||||
import type {
|
|
||||||
RequestItemsObject,
|
|
||||||
Columns,
|
|
||||||
DataProps,
|
|
||||||
} from "@/modules/04_registryNew/interface/request/Insignia";
|
|
||||||
|
|
||||||
import type {
|
import type {
|
||||||
DataOption,
|
DataOption,
|
||||||
DataOptionInsignia,
|
DataOptionInsignia,
|
||||||
InsigniaOps,
|
InsigniaOps,
|
||||||
Pagination,
|
Pagination,
|
||||||
} from "@/modules/04_registryNew/interface/index/Main";
|
} from "@/modules/04_registryNew/interface/index/Main";
|
||||||
|
import type {
|
||||||
|
RequestItemsObject,
|
||||||
|
Columns,
|
||||||
|
DataProps,
|
||||||
|
} from "@/modules/04_registryNew/interface/request/Insignia";
|
||||||
|
|
||||||
const $q = useQuasar();
|
const $q = useQuasar();
|
||||||
const attrs = ref<any>(useAttrs());
|
const route = useRoute();
|
||||||
const mixin = useCounterMixin();
|
const mixin = useCounterMixin();
|
||||||
const {
|
const {
|
||||||
date2Thai,
|
date2Thai,
|
||||||
|
|
@ -34,27 +34,51 @@ const {
|
||||||
showLoader,
|
showLoader,
|
||||||
hideLoader,
|
hideLoader,
|
||||||
} = mixin;
|
} = mixin;
|
||||||
|
const profileId = ref<string>(
|
||||||
|
route.params.id ? route.params.id.toString() : ""
|
||||||
|
);
|
||||||
|
|
||||||
const year = ref<number | null>(0);
|
const insigniaData = reactive<{
|
||||||
const receiveDate = ref<Date | string | null>();
|
id: string;
|
||||||
const insigniaId = ref<string>("");
|
isActive: boolean;
|
||||||
const insigniaType = ref<string>();
|
year: number | null;
|
||||||
const no = ref<string>();
|
receiveDate: Date | string | null;
|
||||||
const issue = ref<string>();
|
insigniaId: string;
|
||||||
const volumeNo = ref<string>();
|
insigniaType: string;
|
||||||
const volume = ref<string>();
|
no: string;
|
||||||
const section = ref<string>();
|
issue: string;
|
||||||
const page = ref<string>();
|
volumeNo: string;
|
||||||
const dateAnnounce = ref<Date | null | string>(null);
|
volume: string;
|
||||||
const refCommandNo = ref<string>();
|
section: string;
|
||||||
const refCommandDate = ref<Date | null | string>();
|
page: string;
|
||||||
const note = ref<string>();
|
dateAnnounce: Date | null | string;
|
||||||
|
refCommandNo: string;
|
||||||
|
refCommandDate: Date | null | string;
|
||||||
|
note: string;
|
||||||
|
}>({
|
||||||
|
id: "",
|
||||||
|
isActive: true,
|
||||||
|
year: 0,
|
||||||
|
receiveDate: null,
|
||||||
|
insigniaId: "",
|
||||||
|
insigniaType: "",
|
||||||
|
no: "",
|
||||||
|
issue: "",
|
||||||
|
volumeNo: "",
|
||||||
|
volume: "",
|
||||||
|
section: "",
|
||||||
|
page: "",
|
||||||
|
dateAnnounce: null,
|
||||||
|
refCommandNo: "",
|
||||||
|
refCommandDate: null,
|
||||||
|
note: "",
|
||||||
|
});
|
||||||
|
|
||||||
const editRow = ref<boolean>(false);
|
const editRow = ref<boolean>(false);
|
||||||
const myForm = ref<any>();
|
const myForm = ref<any>();
|
||||||
const edit = ref<boolean>(false);
|
const isEdit = ref<boolean>(false);
|
||||||
const modal = ref<boolean>(false);
|
const modal = ref<boolean>(false);
|
||||||
const modelView = ref<string>("table");
|
const modeView = ref<string>("table");
|
||||||
const filterSearch = ref("");
|
const filterSearch = ref("");
|
||||||
const filterHistory = ref<string>("");
|
const filterHistory = ref<string>("");
|
||||||
const modalHistory = ref<boolean>(false);
|
const modalHistory = ref<boolean>(false);
|
||||||
|
|
@ -68,90 +92,7 @@ const OpsFilter = ref<InsigniaOps>({
|
||||||
insigniaOptions: [],
|
insigniaOptions: [],
|
||||||
});
|
});
|
||||||
|
|
||||||
// mock data
|
const rows = ref<any>([]);
|
||||||
const rows = ref<any>([
|
|
||||||
{
|
|
||||||
id: "08dbc95b-7d2d-4a33-8c2c-426845b1d14e",
|
|
||||||
insignia: "จัตุรถาภรณ์ช้างเผือก",
|
|
||||||
insigniaId: "08db721b-c7f9-40c5-85f7-7c2c6d0eceb9",
|
|
||||||
insigniaType: "ชั้นต่ำกว่าสายสะพาย",
|
|
||||||
year: 2025,
|
|
||||||
no: "1",
|
|
||||||
issue: "1",
|
|
||||||
volumeNo: "1",
|
|
||||||
volume: null,
|
|
||||||
section: "1",
|
|
||||||
page: "1",
|
|
||||||
receiveDate: new Date("2023-10-10T00:00:00"),
|
|
||||||
dateAnnounce: new Date("2023-10-10T00:00:00"),
|
|
||||||
refCommandNo: "1",
|
|
||||||
refCommandDate: null,
|
|
||||||
createdFullName: "System Administrator",
|
|
||||||
createdAt: new Date("2023-10-10T13:38:18.177967"),
|
|
||||||
note: "1234dd",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
id: "08dbc95b-7d2d-4a33-8c2c-426845b1d14e",
|
|
||||||
insignia: "จัตุรถาภรณ์ช้างเผือก",
|
|
||||||
insigniaId: "91a7322d-29f7-4d14-8aab-d98db9251ddc",
|
|
||||||
insigniaType: "ชั้นต่ำกว่าสายสะพาย",
|
|
||||||
year: 2024,
|
|
||||||
no: "",
|
|
||||||
issue: "",
|
|
||||||
volumeNo: "",
|
|
||||||
volume: "",
|
|
||||||
section: "",
|
|
||||||
page: "",
|
|
||||||
receiveDate: new Date("2024-02-07T00:00:00"),
|
|
||||||
dateAnnounce: null,
|
|
||||||
refCommandNo: null,
|
|
||||||
refCommandDate: null,
|
|
||||||
createdFullName: "User Key1",
|
|
||||||
createdAt: new Date("2024-02-07T18:14:50.918701"),
|
|
||||||
note: null,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
id: "08dbc95b-7d2d-4a33-8c2c-426845b1d14e",
|
|
||||||
insignia: "จัตุรถาภรณ์มงกุฎไทย",
|
|
||||||
insigniaId: "91a7322d-29f7-4d14-8aab-d98db9251ddc",
|
|
||||||
insigniaType: "ชั้นต่ำกว่าสายสะพาย",
|
|
||||||
year: 2016,
|
|
||||||
no: "",
|
|
||||||
issue: "",
|
|
||||||
volumeNo: "",
|
|
||||||
volume: "",
|
|
||||||
section: "",
|
|
||||||
page: "",
|
|
||||||
receiveDate: new Date("2016-05-02T00:00:00"),
|
|
||||||
dateAnnounce: null,
|
|
||||||
refCommandNo: null,
|
|
||||||
refCommandDate: null,
|
|
||||||
createdFullName: "สาวิตรี ศรีสมัย",
|
|
||||||
createdAt: new Date("2024-02-13T18:06:44.941056"),
|
|
||||||
note: null,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
id: "08dbc95b-7d2d-4a33-8c2c-426845b1d14e",
|
|
||||||
insignia: "ตริตาภรณ์ช้างเผือก",
|
|
||||||
insigniaId: "08db721b-c7fd-4ec7-886a-f883ae333a8d",
|
|
||||||
insigniaType: "ชั้นต่ำกว่าสายสะพาย",
|
|
||||||
year: 2018,
|
|
||||||
no: "",
|
|
||||||
issue: "",
|
|
||||||
volumeNo: "",
|
|
||||||
volume: "",
|
|
||||||
section: "",
|
|
||||||
page: "",
|
|
||||||
receiveDate: new Date("2024-02-13T00:00:00"),
|
|
||||||
dateAnnounce: null,
|
|
||||||
refCommandNo: "",
|
|
||||||
refCommandDate: null,
|
|
||||||
createdFullName: "สาวิตรี ศรีสมัย",
|
|
||||||
createdAt: new Date("2024-02-13T18:08:49.301201"),
|
|
||||||
note: "a",
|
|
||||||
},
|
|
||||||
]);
|
|
||||||
|
|
||||||
const columns = ref<QTableProps["columns"]>([
|
const columns = ref<QTableProps["columns"]>([
|
||||||
{
|
{
|
||||||
name: "year",
|
name: "year",
|
||||||
|
|
@ -161,8 +102,6 @@ const columns = ref<QTableProps["columns"]>([
|
||||||
field: "year",
|
field: "year",
|
||||||
headerStyle: "font-size: 14px",
|
headerStyle: "font-size: 14px",
|
||||||
style: "font-size: 14px",
|
style: "font-size: 14px",
|
||||||
sort: (a: string, b: string) =>
|
|
||||||
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "receiveDate",
|
name: "receiveDate",
|
||||||
|
|
@ -180,7 +119,7 @@ const columns = ref<QTableProps["columns"]>([
|
||||||
align: "left",
|
align: "left",
|
||||||
label: "ชื่อเครื่องราชฯ",
|
label: "ชื่อเครื่องราชฯ",
|
||||||
sortable: true,
|
sortable: true,
|
||||||
field: "insignia",
|
field: "insigniaId",
|
||||||
headerStyle: "font-size: 14px",
|
headerStyle: "font-size: 14px",
|
||||||
style: "font-size: 14px",
|
style: "font-size: 14px",
|
||||||
sort: (a: string, b: string) =>
|
sort: (a: string, b: string) =>
|
||||||
|
|
@ -308,7 +247,6 @@ const columns = ref<QTableProps["columns"]>([
|
||||||
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
|
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
|
||||||
},
|
},
|
||||||
]);
|
]);
|
||||||
|
|
||||||
const columnsHistory = ref<QTableProps["columns"]>([
|
const columnsHistory = ref<QTableProps["columns"]>([
|
||||||
{
|
{
|
||||||
name: "year",
|
name: "year",
|
||||||
|
|
@ -476,7 +414,6 @@ const columnsHistory = ref<QTableProps["columns"]>([
|
||||||
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
|
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
|
||||||
},
|
},
|
||||||
]);
|
]);
|
||||||
|
|
||||||
const visibleColumns = ref<String[]>([
|
const visibleColumns = ref<String[]>([
|
||||||
"insignia",
|
"insignia",
|
||||||
"insigniaType",
|
"insigniaType",
|
||||||
|
|
@ -494,7 +431,6 @@ const visibleColumns = ref<String[]>([
|
||||||
"note",
|
"note",
|
||||||
"createdAt",
|
"createdAt",
|
||||||
]);
|
]);
|
||||||
|
|
||||||
const visibleColumnsHistory = ref<String[]>([
|
const visibleColumnsHistory = ref<String[]>([
|
||||||
"insignia",
|
"insignia",
|
||||||
"insigniaType",
|
"insigniaType",
|
||||||
|
|
@ -513,19 +449,236 @@ const visibleColumnsHistory = ref<String[]>([
|
||||||
"createdAt",
|
"createdAt",
|
||||||
]);
|
]);
|
||||||
|
|
||||||
const initialPagination = ref<Pagination>({
|
const formFilter = reactive({
|
||||||
rowsPerPage: 0,
|
page: 1,
|
||||||
|
pageSize: 10,
|
||||||
|
keyword: "",
|
||||||
});
|
});
|
||||||
|
|
||||||
const paginationLabel = (start: string, end: string, total: string) => {
|
const pagination = ref({
|
||||||
return start + "-" + end + " ใน " + total;
|
page: formFilter.page,
|
||||||
};
|
rowsPerPage: formFilter.pageSize,
|
||||||
|
});
|
||||||
|
|
||||||
function onClickOpenDialog(StatusEdit: boolean = false, data: any = []) {
|
async function fetchData() {
|
||||||
modal.value = true;
|
if (profileId.value) {
|
||||||
|
showLoader();
|
||||||
|
await http
|
||||||
|
.get(config.API.profileNewInsignByProfileId(profileId.value))
|
||||||
|
.then((res) => {
|
||||||
|
let data = res.data.result;
|
||||||
|
rows.value = [];
|
||||||
|
data.map((e: any) => {
|
||||||
|
rows.value.push({
|
||||||
|
id: e.id,
|
||||||
|
insigniaId: e.insigniaId,
|
||||||
|
insigniaType: e.insigniaType,
|
||||||
|
year: e.year,
|
||||||
|
no: e.no,
|
||||||
|
issue: e.issue,
|
||||||
|
volumeNo: e.volumeNo,
|
||||||
|
volume: e.volume,
|
||||||
|
section: e.section,
|
||||||
|
page: e.page,
|
||||||
|
receiveDate: e.receiveDate,
|
||||||
|
dateAnnounce: e.dateAnnounce,
|
||||||
|
refCommandNo: e.refCommandNo,
|
||||||
|
refCommandDate: e.refCommandDate,
|
||||||
|
createdFullName: e.createdFullName,
|
||||||
|
createdAt: e.createdAt,
|
||||||
|
note: e.note,
|
||||||
|
});
|
||||||
|
});
|
||||||
|
})
|
||||||
|
.catch((e) => {
|
||||||
|
messageError($q, e);
|
||||||
|
})
|
||||||
|
.finally(() => {
|
||||||
|
hideLoader();
|
||||||
|
// store.isLoad++;
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const clickClose = async () => {
|
async function fetchInsignia() {
|
||||||
|
showLoader();
|
||||||
|
await http
|
||||||
|
.get(config.API.insignia)
|
||||||
|
.then((res) => {
|
||||||
|
const data = res.data.result;
|
||||||
|
let option: DataOptionInsignia[] = [];
|
||||||
|
data.map((r: any) => {
|
||||||
|
option.push({
|
||||||
|
id: r.id.toString(),
|
||||||
|
name: r.name.toString() + ` (${r.shortName})`,
|
||||||
|
typeName:
|
||||||
|
r.insigniaType == null ? null : r.insigniaType.name.toString(),
|
||||||
|
});
|
||||||
|
});
|
||||||
|
Ops.value.insigniaOptions = option;
|
||||||
|
OpsFilter.value.insigniaOptions = option;
|
||||||
|
})
|
||||||
|
.catch((e) => {
|
||||||
|
messageError($q, e);
|
||||||
|
})
|
||||||
|
.finally(() => {
|
||||||
|
hideLoader();
|
||||||
|
// store.isLoad++;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
async function saveData() {
|
||||||
|
if (profileId.value) {
|
||||||
|
showLoader();
|
||||||
|
await http
|
||||||
|
.post(config.API.profileNewInsign, {
|
||||||
|
profileId: profileId.value,
|
||||||
|
isActive: insigniaData.isActive,
|
||||||
|
year: insigniaData.year,
|
||||||
|
no: insigniaData.no,
|
||||||
|
volume: insigniaData.volume,
|
||||||
|
section: insigniaData.section,
|
||||||
|
page: insigniaData.page,
|
||||||
|
receiveDate: dateToISO(insigniaData.receiveDate as Date),
|
||||||
|
insigniaId: insigniaData.insigniaId,
|
||||||
|
insigniaType: insigniaData.insigniaType,
|
||||||
|
dateAnnounce: insigniaData.dateAnnounce
|
||||||
|
? dateToISO(insigniaData.dateAnnounce as Date)
|
||||||
|
: null,
|
||||||
|
issue: insigniaData.issue,
|
||||||
|
volumeNo: insigniaData.volumeNo,
|
||||||
|
refCommandDate:
|
||||||
|
insigniaData.refCommandDate == null
|
||||||
|
? null
|
||||||
|
: dateToISO(insigniaData.refCommandDate as Date),
|
||||||
|
refCommandNo: insigniaData.refCommandNo,
|
||||||
|
// note: note.value,
|
||||||
|
})
|
||||||
|
.then((res) => {
|
||||||
|
success($q, "บันทึกข้อมูลสำเร็จ");
|
||||||
|
modal.value = false;
|
||||||
|
})
|
||||||
|
.catch((e) => {
|
||||||
|
messageError($q, e);
|
||||||
|
})
|
||||||
|
.finally(async () => {
|
||||||
|
await fetchData();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
async function editData() {
|
||||||
|
showLoader();
|
||||||
|
await http
|
||||||
|
.patch(config.API.profileNewInsignById(insigniaData.id), {
|
||||||
|
profileId: profileId.value,
|
||||||
|
isActive: insigniaData.isActive,
|
||||||
|
year: insigniaData.year,
|
||||||
|
no: insigniaData.no,
|
||||||
|
volume: insigniaData.volume,
|
||||||
|
section: insigniaData.section,
|
||||||
|
page: insigniaData.page,
|
||||||
|
receiveDate: dateToISO(insigniaData.receiveDate as Date),
|
||||||
|
insigniaId: insigniaData.insigniaId,
|
||||||
|
insigniaType: insigniaData.insigniaType,
|
||||||
|
dateAnnounce: insigniaData.dateAnnounce
|
||||||
|
? dateToISO(insigniaData.dateAnnounce as Date)
|
||||||
|
: null,
|
||||||
|
issue: insigniaData.issue,
|
||||||
|
volumeNo: insigniaData.volumeNo,
|
||||||
|
refCommandDate:
|
||||||
|
insigniaData.refCommandDate == null
|
||||||
|
? null
|
||||||
|
: dateToISO(insigniaData.refCommandDate as Date),
|
||||||
|
refCommandNo: insigniaData.refCommandNo,
|
||||||
|
// note: note.value,
|
||||||
|
})
|
||||||
|
.then((res) => {
|
||||||
|
success($q, "บันทึกข้อมูลสำเร็จ");
|
||||||
|
modal.value = false;
|
||||||
|
})
|
||||||
|
.catch((e) => {
|
||||||
|
messageError($q, e);
|
||||||
|
})
|
||||||
|
.finally(async () => {
|
||||||
|
await fetchData();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
async function clickDelete(dataId: string) {
|
||||||
|
$q.dialog({
|
||||||
|
title: `ลบข้อมูล`,
|
||||||
|
message: `ต้องการทำการลบข้อมูลนี้ใช่หรือไม่?`,
|
||||||
|
cancel: "ยกเลิก",
|
||||||
|
ok: "ยืนยัน",
|
||||||
|
persistent: true,
|
||||||
|
})
|
||||||
|
.onOk(async () => {
|
||||||
|
showLoader();
|
||||||
|
await http
|
||||||
|
.delete(config.API.profileNewInsignById(dataId))
|
||||||
|
.then((res) => {
|
||||||
|
success($q, "ลบข้อมูลสำเร็จ");
|
||||||
|
modal.value = false;
|
||||||
|
})
|
||||||
|
.catch((e) => {
|
||||||
|
messageError($q, e);
|
||||||
|
})
|
||||||
|
.finally(async () => {
|
||||||
|
await fetchData();
|
||||||
|
});
|
||||||
|
})
|
||||||
|
.onCancel(async () => {
|
||||||
|
await fetchData();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
function onClickOpenDialog(editStatus: boolean = false, props?: any) {
|
||||||
|
modal.value = true;
|
||||||
|
editRow.value = false;
|
||||||
|
|
||||||
|
if (editStatus && props) {
|
||||||
|
isEdit.value = editStatus;
|
||||||
|
|
||||||
|
insigniaData.id = props.row.id;
|
||||||
|
insigniaData.year = props.row.year == 0 ? 0 : props.row.year;
|
||||||
|
insigniaData.receiveDate = props.row.receiveDate;
|
||||||
|
insigniaData.insigniaId = props.row.insigniaId;
|
||||||
|
insigniaData.insigniaType = props.row.insigniaType;
|
||||||
|
insigniaData.no = props.row.no;
|
||||||
|
insigniaData.issue = props.row.issue;
|
||||||
|
insigniaData.volumeNo = props.row.volumeNo;
|
||||||
|
insigniaData.volume = props.row.volume;
|
||||||
|
insigniaData.section = props.row.section;
|
||||||
|
insigniaData.page = props.row.page;
|
||||||
|
insigniaData.dateAnnounce =
|
||||||
|
props.row.dateAnnounce == "-" ? "" : props.row.dateAnnounce;
|
||||||
|
insigniaData.refCommandNo = props.row.refCommandNo;
|
||||||
|
insigniaData.refCommandDate =
|
||||||
|
props.row.refCommandDate == "-" ? null : props.row.refCommandDate;
|
||||||
|
insigniaData.note = props.note;
|
||||||
|
} else {
|
||||||
|
isEdit.value = editStatus;
|
||||||
|
|
||||||
|
insigniaData.id = "";
|
||||||
|
insigniaData.year = 0;
|
||||||
|
insigniaData.receiveDate = "";
|
||||||
|
insigniaData.insigniaId = "";
|
||||||
|
insigniaData.insigniaType = "";
|
||||||
|
insigniaData.no = "";
|
||||||
|
insigniaData.issue = "";
|
||||||
|
insigniaData.volumeNo = "";
|
||||||
|
insigniaData.volume = "";
|
||||||
|
insigniaData.section = "";
|
||||||
|
insigniaData.page = "";
|
||||||
|
insigniaData.dateAnnounce = null;
|
||||||
|
insigniaData.refCommandNo = "";
|
||||||
|
insigniaData.refCommandDate = null;
|
||||||
|
insigniaData.note = "";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
async function clickClose() {
|
||||||
if (editRow.value == true) {
|
if (editRow.value == true) {
|
||||||
$q.dialog({
|
$q.dialog({
|
||||||
title: `ข้อมูลมีการแก้ไข`,
|
title: `ข้อมูลมีการแก้ไข`,
|
||||||
|
|
@ -535,6 +688,7 @@ const clickClose = async () => {
|
||||||
persistent: true,
|
persistent: true,
|
||||||
}).onOk(async () => {
|
}).onOk(async () => {
|
||||||
modal.value = false;
|
modal.value = false;
|
||||||
|
editRow.value = false;
|
||||||
// next.value = false;
|
// next.value = false;
|
||||||
// previous.value = false;
|
// previous.value = false;
|
||||||
});
|
});
|
||||||
|
|
@ -543,33 +697,6 @@ const clickClose = async () => {
|
||||||
// next.value = false;
|
// next.value = false;
|
||||||
// previous.value = false;
|
// previous.value = false;
|
||||||
}
|
}
|
||||||
};
|
|
||||||
|
|
||||||
function onSubmit() {
|
|
||||||
myForm.value.validate().then(async (result: boolean) => {
|
|
||||||
if (result) {
|
|
||||||
// await saveData();
|
|
||||||
modal.value = false;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
function selectData(props: any) {
|
|
||||||
modal.value = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
function filterSelector(val: any, update: Function, refData: string) {
|
|
||||||
switch (refData) {
|
|
||||||
case "insigniaOptions":
|
|
||||||
update(() => {
|
|
||||||
Ops.value.insigniaOptions = OpsFilter.value.insigniaOptions.filter(
|
|
||||||
(v: DataOption) => v.name.indexOf(val) > -1
|
|
||||||
);
|
|
||||||
});
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
async function clickHistory(row: RequestItemsObject) {
|
async function clickHistory(row: RequestItemsObject) {
|
||||||
|
|
@ -611,45 +738,44 @@ async function clickHistory(row: RequestItemsObject) {
|
||||||
// });
|
// });
|
||||||
}
|
}
|
||||||
|
|
||||||
async function fetchInsignia() {
|
function onSubmit() {
|
||||||
showLoader();
|
myForm.value.validate().then(async (result: boolean) => {
|
||||||
await http
|
if (result) {
|
||||||
.get(config.API.insignia)
|
isEdit.value ? await editData() : await saveData();
|
||||||
.then((res) => {
|
modal.value = false;
|
||||||
const data = res.data.result;
|
}
|
||||||
let option: DataOptionInsignia[] = [];
|
});
|
||||||
data.map((r: any) => {
|
|
||||||
option.push({
|
|
||||||
id: r.id.toString(),
|
|
||||||
name: r.name.toString() + ` (${r.shortName})`,
|
|
||||||
typeName:
|
|
||||||
r.insigniaType == null ? null : r.insigniaType.name.toString(),
|
|
||||||
});
|
|
||||||
});
|
|
||||||
Ops.value.insigniaOptions = option;
|
|
||||||
OpsFilter.value.insigniaOptions = option;
|
|
||||||
})
|
|
||||||
.catch((e) => {
|
|
||||||
messageError($q, e);
|
|
||||||
})
|
|
||||||
.finally(() => {
|
|
||||||
hideLoader();
|
|
||||||
// store.isLoad++;
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
watch(insigniaId, (count: string, prevCount: string) => {
|
function filterSelector(val: any, update: Function, refData: string) {
|
||||||
const insigniaTypeFilter = Ops.value.insigniaOptions.filter(
|
switch (refData) {
|
||||||
(r: DataOptionInsignia) => r.id == insigniaId.value
|
case "insigniaOptions":
|
||||||
);
|
update(() => {
|
||||||
if (insigniaTypeFilter[0] != null) {
|
Ops.value.insigniaOptions = OpsFilter.value.insigniaOptions.filter(
|
||||||
insigniaType.value = insigniaTypeFilter[0].typeName;
|
(v: DataOption) => v.name.indexOf(val) > -1
|
||||||
|
);
|
||||||
|
});
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
});
|
}
|
||||||
|
|
||||||
|
watch(
|
||||||
|
() => insigniaData.insigniaId,
|
||||||
|
(count: string, prevCount: string) => {
|
||||||
|
const insigniaTypeFilter = Ops.value.insigniaOptions.filter(
|
||||||
|
(r: DataOptionInsignia) => r.id === insigniaData.insigniaId
|
||||||
|
);
|
||||||
|
if (insigniaTypeFilter.length > 0) {
|
||||||
|
insigniaData.insigniaType = insigniaTypeFilter[0].typeName;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
onMounted(async () => {
|
onMounted(async () => {
|
||||||
await fetchInsignia();
|
await fetchInsignia();
|
||||||
// await fetchData();
|
await fetchData();
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
@ -672,7 +798,7 @@ onMounted(async () => {
|
||||||
</q-input>
|
</q-input>
|
||||||
|
|
||||||
<q-select
|
<q-select
|
||||||
v-if="modelView === 'table'"
|
v-if="modeView === 'table'"
|
||||||
dense
|
dense
|
||||||
multiple
|
multiple
|
||||||
outlined
|
outlined
|
||||||
|
|
@ -690,7 +816,7 @@ onMounted(async () => {
|
||||||
|
|
||||||
<q-btn-toggle
|
<q-btn-toggle
|
||||||
dense
|
dense
|
||||||
v-model="modelView"
|
v-model="modeView"
|
||||||
toggle-color="grey-4"
|
toggle-color="grey-4"
|
||||||
class="no-shadow toggle-borderd"
|
class="no-shadow toggle-borderd"
|
||||||
:options="[
|
:options="[
|
||||||
|
|
@ -703,7 +829,7 @@ onMounted(async () => {
|
||||||
name="format_list_bulleted"
|
name="format_list_bulleted"
|
||||||
size="24px"
|
size="24px"
|
||||||
:style="{
|
:style="{
|
||||||
color: modelView === 'table' ? '#787B7C' : '#C9D3DB',
|
color: modeView === 'table' ? '#787B7C' : '#C9D3DB',
|
||||||
}"
|
}"
|
||||||
/>
|
/>
|
||||||
</template>
|
</template>
|
||||||
|
|
@ -712,7 +838,7 @@ onMounted(async () => {
|
||||||
name="mdi-view-grid-outline"
|
name="mdi-view-grid-outline"
|
||||||
size="24px"
|
size="24px"
|
||||||
:style="{
|
:style="{
|
||||||
color: modelView === 'card' ? '#787B7C' : '#C9D3DB',
|
color: modeView === 'card' ? '#787B7C' : '#C9D3DB',
|
||||||
}"
|
}"
|
||||||
/>
|
/>
|
||||||
</template>
|
</template>
|
||||||
|
|
@ -723,16 +849,14 @@ onMounted(async () => {
|
||||||
flat
|
flat
|
||||||
dense
|
dense
|
||||||
bordered
|
bordered
|
||||||
virtual-scroll
|
|
||||||
ref="table"
|
ref="table"
|
||||||
v-bind="attrs"
|
class="custom-header-table"
|
||||||
:rows="rows"
|
:rows="rows"
|
||||||
|
:paging="true"
|
||||||
:columns="columns"
|
:columns="columns"
|
||||||
:filter="filterSearch"
|
:filter="filterSearch"
|
||||||
:grid="modelView === 'card'"
|
:grid="modeView === 'card'"
|
||||||
:pagination="initialPagination"
|
|
||||||
:visible-columns="visibleColumns"
|
:visible-columns="visibleColumns"
|
||||||
:pagination-label="paginationLabel"
|
|
||||||
:rows-per-page-options="[20, 50, 100]"
|
:rows-per-page-options="[20, 50, 100]"
|
||||||
>
|
>
|
||||||
<template v-slot:header="props">
|
<template v-slot:header="props">
|
||||||
|
|
@ -744,14 +868,14 @@ onMounted(async () => {
|
||||||
</q-tr>
|
</q-tr>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<template v-slot:body="props" v-if="modelView === 'table'">
|
<template v-slot:body="props" v-if="modeView === 'table'">
|
||||||
<q-tr :props="props" class="cursor-pointer">
|
<q-tr :props="props" class="cursor-pointer">
|
||||||
<q-td
|
<q-td
|
||||||
v-for="col in props.cols"
|
v-for="col in props.cols"
|
||||||
class="cursor-pointer"
|
class="cursor-pointer"
|
||||||
:key="col.name"
|
:key="col.name"
|
||||||
:props="props"
|
:props="props"
|
||||||
@click="selectData(props)"
|
@click="onClickOpenDialog(true, props)"
|
||||||
>
|
>
|
||||||
<div
|
<div
|
||||||
v-if="
|
v-if="
|
||||||
|
|
@ -766,6 +890,14 @@ onMounted(async () => {
|
||||||
<div v-else-if="col.name == 'year'" class="table_ellipsis">
|
<div v-else-if="col.name == 'year'" class="table_ellipsis">
|
||||||
{{ col.value + 543 }}
|
{{ col.value + 543 }}
|
||||||
</div>
|
</div>
|
||||||
|
<div v-else-if="col.name == 'insignia'" class="table_ellipsis">
|
||||||
|
{{
|
||||||
|
col.value
|
||||||
|
? (Ops.insigniaOptions.find((r) => r.id === col.value) || {})
|
||||||
|
.name
|
||||||
|
: "-"
|
||||||
|
}}
|
||||||
|
</div>
|
||||||
<div v-else class="table_ellipsis">
|
<div v-else class="table_ellipsis">
|
||||||
{{ col.value ? col.value : "-" }}
|
{{ col.value ? col.value : "-" }}
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -782,6 +914,17 @@ onMounted(async () => {
|
||||||
>
|
>
|
||||||
<q-tooltip>ประวัติแก้ไขเครื่องราชอิสริยาภรณ์</q-tooltip>
|
<q-tooltip>ประวัติแก้ไขเครื่องราชอิสริยาภรณ์</q-tooltip>
|
||||||
</q-btn>
|
</q-btn>
|
||||||
|
<q-btn
|
||||||
|
flat
|
||||||
|
dense
|
||||||
|
round
|
||||||
|
size="14px"
|
||||||
|
color="red"
|
||||||
|
icon="mdi-delete"
|
||||||
|
@click="clickDelete(props.row.id)"
|
||||||
|
>
|
||||||
|
<q-tooltip>ลบข้อมูล</q-tooltip>
|
||||||
|
</q-btn>
|
||||||
</q-td>
|
</q-td>
|
||||||
</q-tr>
|
</q-tr>
|
||||||
</template>
|
</template>
|
||||||
|
|
@ -797,7 +940,7 @@ onMounted(async () => {
|
||||||
round
|
round
|
||||||
color="primary"
|
color="primary"
|
||||||
icon="mdi-pencil-outline"
|
icon="mdi-pencil-outline"
|
||||||
@click.stop.prevent="onClickOpenDialog()"
|
@click="onClickOpenDialog(true, props)"
|
||||||
>
|
>
|
||||||
<q-tooltip>แก่ไขข้อมุล</q-tooltip>
|
<q-tooltip>แก่ไขข้อมุล</q-tooltip>
|
||||||
</q-btn>
|
</q-btn>
|
||||||
|
|
@ -806,7 +949,7 @@ onMounted(async () => {
|
||||||
round
|
round
|
||||||
color="info"
|
color="info"
|
||||||
icon="mdi-history"
|
icon="mdi-history"
|
||||||
@click.stop.prevent="clickHistory(props.row)"
|
@click="clickHistory(props.row)"
|
||||||
>
|
>
|
||||||
<q-tooltip>ประวัติแก้ไขเครื่องราชอิสริยาภรณ์</q-tooltip>
|
<q-tooltip>ประวัติแก้ไขเครื่องราชอิสริยาภรณ์</q-tooltip>
|
||||||
</q-btn>
|
</q-btn>
|
||||||
|
|
@ -837,6 +980,19 @@ onMounted(async () => {
|
||||||
<q-item-label v-else-if="col.name == 'year'">
|
<q-item-label v-else-if="col.name == 'year'">
|
||||||
{{ col.value + 543 }}
|
{{ col.value + 543 }}
|
||||||
</q-item-label>
|
</q-item-label>
|
||||||
|
<q-item-label
|
||||||
|
v-else-if="col.name == 'insignia'"
|
||||||
|
class="table_ellipsis"
|
||||||
|
>
|
||||||
|
{{
|
||||||
|
col.value
|
||||||
|
? (
|
||||||
|
Ops.insigniaOptions.find((r) => r.id === col.value) ||
|
||||||
|
{}
|
||||||
|
).name
|
||||||
|
: "-"
|
||||||
|
}}
|
||||||
|
</q-item-label>
|
||||||
<q-item-label v-else>
|
<q-item-label v-else>
|
||||||
{{ col.value ? col.value : "-" }}
|
{{ col.value ? col.value : "-" }}
|
||||||
</q-item-label>
|
</q-item-label>
|
||||||
|
|
@ -859,7 +1015,7 @@ onMounted(async () => {
|
||||||
<datepicker
|
<datepicker
|
||||||
autoApply
|
autoApply
|
||||||
year-picker
|
year-picker
|
||||||
v-model="year"
|
v-model="insigniaData.year"
|
||||||
week-start="0"
|
week-start="0"
|
||||||
menu-class-name="modalfix"
|
menu-class-name="modalfix"
|
||||||
:locale="'th'"
|
:locale="'th'"
|
||||||
|
|
@ -875,7 +1031,8 @@ onMounted(async () => {
|
||||||
outlined
|
outlined
|
||||||
lazy-rules
|
lazy-rules
|
||||||
hide-bottom-space
|
hide-bottom-space
|
||||||
:model-value="year !== 0 ? (year as number) + 543:null"
|
class="inputgreen"
|
||||||
|
:model-value="insigniaData.year !== 0 ? (insigniaData.year as number) + 543 : null"
|
||||||
:rules="[
|
:rules="[
|
||||||
(val:string) =>
|
(val:string) =>
|
||||||
!!val ||
|
!!val ||
|
||||||
|
|
@ -901,7 +1058,7 @@ onMounted(async () => {
|
||||||
borderless
|
borderless
|
||||||
week-start="0"
|
week-start="0"
|
||||||
menu-class-name="modalfix"
|
menu-class-name="modalfix"
|
||||||
v-model="receiveDate"
|
v-model="insigniaData.receiveDate"
|
||||||
:locale="'th'"
|
:locale="'th'"
|
||||||
:enableTimePicker="false"
|
:enableTimePicker="false"
|
||||||
>
|
>
|
||||||
|
|
@ -915,18 +1072,17 @@ onMounted(async () => {
|
||||||
<q-input
|
<q-input
|
||||||
dense
|
dense
|
||||||
outlined
|
outlined
|
||||||
|
hide-bottom-space
|
||||||
|
class="inputgreen"
|
||||||
for="inputDatereceive"
|
for="inputDatereceive"
|
||||||
ref="dateReceivedRef"
|
ref="dateReceivedRef"
|
||||||
hide-bottom-space
|
|
||||||
:model-value="
|
:model-value="
|
||||||
receiveDate != null
|
insigniaData.receiveDate != null
|
||||||
? date2Thai(receiveDate as Date)
|
? date2Thai(insigniaData.receiveDate as Date)
|
||||||
: null
|
: null
|
||||||
"
|
"
|
||||||
:label="`${'วันที่ได้รับ'}`"
|
:label="`${'วันที่ได้รับ'}`"
|
||||||
:rules="[
|
:rules="[(val) => !!val || `${'กรุณาเลือกวันที่ได้รับ'}`]"
|
||||||
(val) => !!val || `${'กรุณาเลือกวันที่ได้รับ'}`,
|
|
||||||
]"
|
|
||||||
@update:modelValue="() => (editRow = true)"
|
@update:modelValue="() => (editRow = true)"
|
||||||
>
|
>
|
||||||
<template v-slot:prepend>
|
<template v-slot:prepend>
|
||||||
|
|
@ -952,7 +1108,8 @@ onMounted(async () => {
|
||||||
option-value="id"
|
option-value="id"
|
||||||
input-debounce="0"
|
input-debounce="0"
|
||||||
option-label="name"
|
option-label="name"
|
||||||
v-model="insigniaId"
|
v-model="insigniaData.insigniaId"
|
||||||
|
class="inputgreen"
|
||||||
:label="`${'ชื่อเครื่องราชฯ'}`"
|
:label="`${'ชื่อเครื่องราชฯ'}`"
|
||||||
:options="Ops.insigniaOptions"
|
:options="Ops.insigniaOptions"
|
||||||
:rules="[(val:string) => !!val || `${'กรุณาเลือกชื่อเครื่องราชฯ'}`]"
|
:rules="[(val:string) => !!val || `${'กรุณาเลือกชื่อเครื่องราชฯ'}`]"
|
||||||
|
|
@ -969,7 +1126,7 @@ onMounted(async () => {
|
||||||
outlined
|
outlined
|
||||||
lazy-rules
|
lazy-rules
|
||||||
hide-bottom-space
|
hide-bottom-space
|
||||||
v-model="insigniaType"
|
v-model="insigniaData.insigniaType"
|
||||||
:label="`${'ลำดับชั้น'}`"
|
:label="`${'ลำดับชั้น'}`"
|
||||||
@update:modelValue="() => (editRow = true)"
|
@update:modelValue="() => (editRow = true)"
|
||||||
/>
|
/>
|
||||||
|
|
@ -980,7 +1137,8 @@ onMounted(async () => {
|
||||||
outlined
|
outlined
|
||||||
lazy-rules
|
lazy-rules
|
||||||
hide-bottom-space
|
hide-bottom-space
|
||||||
v-model="no"
|
v-model="insigniaData.no"
|
||||||
|
class="inputgreen"
|
||||||
:label="`${'ลำดับที่'}`"
|
:label="`${'ลำดับที่'}`"
|
||||||
:rules="[(val:string) => !!val || `${'กรุณากรอกลำดับที่'}`]"
|
:rules="[(val:string) => !!val || `${'กรุณากรอกลำดับที่'}`]"
|
||||||
@update:modelValue="() => (editRow = true)"
|
@update:modelValue="() => (editRow = true)"
|
||||||
|
|
@ -992,7 +1150,8 @@ onMounted(async () => {
|
||||||
outlined
|
outlined
|
||||||
lazy-rules
|
lazy-rules
|
||||||
hide-bottom-space
|
hide-bottom-space
|
||||||
v-model="issue"
|
v-model="insigniaData.issue"
|
||||||
|
class="inputgreen"
|
||||||
:label="`${'ราชกิจจาฯ ฉบับที่'}`"
|
:label="`${'ราชกิจจาฯ ฉบับที่'}`"
|
||||||
:rules="[(val:string) => !!val || `${'กรุณากรอกราชกิจจาฯ ฉบับที่'}`]"
|
:rules="[(val:string) => !!val || `${'กรุณากรอกราชกิจจาฯ ฉบับที่'}`]"
|
||||||
@update:modelValue="() => (editRow = true)"
|
@update:modelValue="() => (editRow = true)"
|
||||||
|
|
@ -1004,7 +1163,8 @@ onMounted(async () => {
|
||||||
outlined
|
outlined
|
||||||
lazy-rules
|
lazy-rules
|
||||||
hide-bottom-space
|
hide-bottom-space
|
||||||
v-model="volumeNo"
|
v-model="insigniaData.volumeNo"
|
||||||
|
class="inputgreen"
|
||||||
:label="`${'เล่มที่'}`"
|
:label="`${'เล่มที่'}`"
|
||||||
:rules="[(val:string) => !!val || `${'กรุณากรอกเล่มที่'}`]"
|
:rules="[(val:string) => !!val || `${'กรุณากรอกเล่มที่'}`]"
|
||||||
@update:modelValue="() => (editRow = true)"
|
@update:modelValue="() => (editRow = true)"
|
||||||
|
|
@ -1016,7 +1176,8 @@ onMounted(async () => {
|
||||||
outlined
|
outlined
|
||||||
lazy-rules
|
lazy-rules
|
||||||
hide-bottom-space
|
hide-bottom-space
|
||||||
v-model="volume"
|
v-model="insigniaData.volume"
|
||||||
|
class="inputgreen"
|
||||||
:label="`${'เล่ม'}`"
|
:label="`${'เล่ม'}`"
|
||||||
:rules="[(val:string) => !!val || `${'กรุณากรอกเล่ม'}`]"
|
:rules="[(val:string) => !!val || `${'กรุณากรอกเล่ม'}`]"
|
||||||
@update:modelValue="() => (editRow = true)"
|
@update:modelValue="() => (editRow = true)"
|
||||||
|
|
@ -1027,8 +1188,9 @@ onMounted(async () => {
|
||||||
dense
|
dense
|
||||||
outlined
|
outlined
|
||||||
lazy-rules
|
lazy-rules
|
||||||
v-model="section"
|
|
||||||
hide-bottom-space
|
hide-bottom-space
|
||||||
|
v-model="insigniaData.section"
|
||||||
|
class="inputgreen"
|
||||||
:label="`${'ตอน'}`"
|
:label="`${'ตอน'}`"
|
||||||
:rules="[(val:string) => !!val || `${'กรุณากรอกตอน'}`]"
|
:rules="[(val:string) => !!val || `${'กรุณากรอกตอน'}`]"
|
||||||
@update:modelValue="() => (editRow = true)"
|
@update:modelValue="() => (editRow = true)"
|
||||||
|
|
@ -1039,8 +1201,9 @@ onMounted(async () => {
|
||||||
dense
|
dense
|
||||||
lazy-rules
|
lazy-rules
|
||||||
outlined
|
outlined
|
||||||
v-model="page"
|
|
||||||
hide-bottom-space
|
hide-bottom-space
|
||||||
|
v-model="insigniaData.page"
|
||||||
|
class="inputgreen"
|
||||||
:label="`${'หน้า'}`"
|
:label="`${'หน้า'}`"
|
||||||
:rules="[(val:string) => !!val || `${'กรุณากรอกหน้า'}`]"
|
:rules="[(val:string) => !!val || `${'กรุณากรอกหน้า'}`]"
|
||||||
@update:modelValue="() => (editRow = true)"
|
@update:modelValue="() => (editRow = true)"
|
||||||
|
|
@ -1050,7 +1213,7 @@ onMounted(async () => {
|
||||||
<datepicker
|
<datepicker
|
||||||
autoApply
|
autoApply
|
||||||
week-start="0"
|
week-start="0"
|
||||||
v-model="dateAnnounce"
|
v-model="insigniaData.dateAnnounce"
|
||||||
menu-class-name="modalfix"
|
menu-class-name="modalfix"
|
||||||
:locale="'th'"
|
:locale="'th'"
|
||||||
:enableTimePicker="false"
|
:enableTimePicker="false"
|
||||||
|
|
@ -1065,7 +1228,8 @@ onMounted(async () => {
|
||||||
outlined
|
outlined
|
||||||
lazy-rules
|
lazy-rules
|
||||||
hide-bottom-space
|
hide-bottom-space
|
||||||
:model-value="date2Thai(dateAnnounce as Date)"
|
class="inputgreen"
|
||||||
|
:model-value="date2Thai(insigniaData.dateAnnounce as Date)"
|
||||||
:label="`${'วันที่ประกาศในราชกิจจาฯ'}`"
|
:label="`${'วันที่ประกาศในราชกิจจาฯ'}`"
|
||||||
:rules="[
|
:rules="[
|
||||||
(val:string) =>
|
(val:string) =>
|
||||||
|
|
@ -1080,13 +1244,6 @@ onMounted(async () => {
|
||||||
color="primary"
|
color="primary"
|
||||||
/>
|
/>
|
||||||
</template>
|
</template>
|
||||||
<template v-if="dateAnnounce && edit" v-slot:append>
|
|
||||||
<q-icon
|
|
||||||
name="cancel"
|
|
||||||
@click.stop.prevent="dateAnnounce = null"
|
|
||||||
class="cursor-pointer"
|
|
||||||
/>
|
|
||||||
</template>
|
|
||||||
</q-input>
|
</q-input>
|
||||||
</template>
|
</template>
|
||||||
</datepicker>
|
</datepicker>
|
||||||
|
|
@ -1097,7 +1254,8 @@ onMounted(async () => {
|
||||||
outlined
|
outlined
|
||||||
lazy-rules
|
lazy-rules
|
||||||
hide-bottom-space
|
hide-bottom-space
|
||||||
v-model="refCommandNo"
|
v-model="insigniaData.refCommandNo"
|
||||||
|
class="inputgreen"
|
||||||
:label="`${'เลขที่คำสั่ง'}`"
|
:label="`${'เลขที่คำสั่ง'}`"
|
||||||
@update:modelValue="() => (editRow = true)"
|
@update:modelValue="() => (editRow = true)"
|
||||||
>
|
>
|
||||||
|
|
@ -1110,7 +1268,7 @@ onMounted(async () => {
|
||||||
<datepicker
|
<datepicker
|
||||||
autoApply
|
autoApply
|
||||||
week-start="0"
|
week-start="0"
|
||||||
v-model="refCommandDate"
|
v-model="insigniaData.refCommandDate"
|
||||||
menu-class-name="modalfix"
|
menu-class-name="modalfix"
|
||||||
:locale="'th'"
|
:locale="'th'"
|
||||||
:enableTimePicker="false"
|
:enableTimePicker="false"
|
||||||
|
|
@ -1126,12 +1284,12 @@ onMounted(async () => {
|
||||||
clearable
|
clearable
|
||||||
lazy-rules
|
lazy-rules
|
||||||
hide-bottom-space
|
hide-bottom-space
|
||||||
:borderless="!edit"
|
class="inputgreen"
|
||||||
:label="`${'เอกสารอ้างอิง (ลง วัน/เดือน/ปี)'}`"
|
:label="`${'เอกสารอ้างอิง (ลง วัน/เดือน/ปี)'}`"
|
||||||
:model-value="
|
:model-value="
|
||||||
date2Thai(refCommandDate as Date)
|
date2Thai(insigniaData.refCommandDate as Date)
|
||||||
"
|
"
|
||||||
@clear="refCommandDate = ''"
|
@clear="insigniaData.refCommandDate = ''"
|
||||||
@update:modelValue="() => (editRow = true)"
|
@update:modelValue="() => (editRow = true)"
|
||||||
>
|
>
|
||||||
<template v-slot:prepend>
|
<template v-slot:prepend>
|
||||||
|
|
@ -1150,7 +1308,8 @@ onMounted(async () => {
|
||||||
dense
|
dense
|
||||||
outlined
|
outlined
|
||||||
hide-bottom-space
|
hide-bottom-space
|
||||||
v-model="note"
|
v-model="insigniaData.note"
|
||||||
|
class="inputgreen"
|
||||||
label="หมายเหตุ"
|
label="หมายเหตุ"
|
||||||
@update:modelValue="() => (editRow = true)"
|
@update:modelValue="() => (editRow = true)"
|
||||||
/>
|
/>
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,6 @@ import config from "@/app.config";
|
||||||
import genReportXLSX from "@/plugins/genreportxlsx";
|
import genReportXLSX from "@/plugins/genreportxlsx";
|
||||||
import DialogInfoCriteria from "@/modules/13_salary/components/SalaryLists/DialogInfoCriteria.vue";
|
import DialogInfoCriteria from "@/modules/13_salary/components/SalaryLists/DialogInfoCriteria.vue";
|
||||||
|
|
||||||
|
|
||||||
/** importType*/
|
/** importType*/
|
||||||
import type { DataOption } from "@/modules/13_salary/interface/index/Main";
|
import type { DataOption } from "@/modules/13_salary/interface/index/Main";
|
||||||
import type { DataFilter } from "@/modules/13_salary/interface/index/SalaryList";
|
import type { DataFilter } from "@/modules/13_salary/interface/index/SalaryList";
|
||||||
|
|
@ -209,7 +208,7 @@ function fetchDataQuota(id: string) {
|
||||||
itemsCard.value[0].total = data.total;
|
itemsCard.value[0].total = data.total;
|
||||||
itemsCard.value[1].total = data.fifteenPercent;
|
itemsCard.value[1].total = data.fifteenPercent;
|
||||||
itemsCard.value[2].total = data.chosen;
|
itemsCard.value[2].total = data.chosen;
|
||||||
itemsCard.value[3].total = data.remaining;
|
itemsCard.value[3].total = data.remaining;
|
||||||
itemsCard.value[4].total = data.totalBackup;
|
itemsCard.value[4].total = data.totalBackup;
|
||||||
|
|
||||||
itemsCard.value[5].total = data.currentAmount;
|
itemsCard.value[5].total = data.currentAmount;
|
||||||
|
|
@ -218,7 +217,7 @@ function fetchDataQuota(id: string) {
|
||||||
itemsCard.value[8].total = data.sixPercentSpentAmount;
|
itemsCard.value[8].total = data.sixPercentSpentAmount;
|
||||||
itemsCard.value[9].total = data.useAmount;
|
itemsCard.value[9].total = data.useAmount;
|
||||||
itemsCard.value[10].total = data.remainingAmount;
|
itemsCard.value[10].total = data.remainingAmount;
|
||||||
|
|
||||||
itemsCard.value[11].total = data.totalBackup;
|
itemsCard.value[11].total = data.totalBackup;
|
||||||
})
|
})
|
||||||
.catch((err) => {
|
.catch((err) => {
|
||||||
|
|
@ -323,7 +322,72 @@ onMounted(async () => {
|
||||||
:key="index"
|
:key="index"
|
||||||
@click="changeTabGroup"
|
@click="changeTabGroup"
|
||||||
>
|
>
|
||||||
<q-tab :name="item.name" :label="item.lable" />
|
<q-tab :name="item.name" :label="item.lable">
|
||||||
|
<q-tooltip>
|
||||||
|
<q-list dense v-if="item.name === 'group1'">
|
||||||
|
<q-item>
|
||||||
|
<q-item-section>
|
||||||
|
<q-item-label lines="1">
|
||||||
|
<span class="text-bold">ทั่วไป: </span>
|
||||||
|
<span> ปฏิบัติงาน,ชำนาญงาน,อาวุโส</span></q-item-label
|
||||||
|
>
|
||||||
|
</q-item-section>
|
||||||
|
</q-item>
|
||||||
|
<q-item>
|
||||||
|
<q-item-section>
|
||||||
|
<q-item-label lines="1">
|
||||||
|
<span class="text-bold">วิชาการ: </span>
|
||||||
|
<span> ปฏิบัติการ,ชำนาญการ,ชำนาญการพิเศษ</span></q-item-label
|
||||||
|
>
|
||||||
|
</q-item-section>
|
||||||
|
</q-item>
|
||||||
|
|
||||||
|
<q-item>
|
||||||
|
<q-item-section>
|
||||||
|
<q-item-label lines="1">
|
||||||
|
<span class="text-bold">อำนวยการ: </span>
|
||||||
|
<span> ต้น</span></q-item-label
|
||||||
|
>
|
||||||
|
</q-item-section>
|
||||||
|
</q-item>
|
||||||
|
</q-list>
|
||||||
|
<q-list dense v-if="item.name === 'group2'">
|
||||||
|
<q-item>
|
||||||
|
<q-item-section>
|
||||||
|
<q-item-label lines="1">
|
||||||
|
<span class="text-bold">ทั่วไป: </span>
|
||||||
|
<span> ทักษะพิเศษ</span></q-item-label
|
||||||
|
>
|
||||||
|
</q-item-section>
|
||||||
|
</q-item>
|
||||||
|
<q-item>
|
||||||
|
<q-item-section>
|
||||||
|
<q-item-label lines="1">
|
||||||
|
<span class="text-bold">วิชาการ: </span>
|
||||||
|
<span> เชี่ยวชาญ,ทรงคุณวุฒิ</span></q-item-label
|
||||||
|
>
|
||||||
|
</q-item-section>
|
||||||
|
</q-item>
|
||||||
|
|
||||||
|
<q-item>
|
||||||
|
<q-item-section>
|
||||||
|
<q-item-label lines="1">
|
||||||
|
<span class="text-bold">อำนวยการ: </span>
|
||||||
|
<span> สูง</span></q-item-label
|
||||||
|
>
|
||||||
|
</q-item-section>
|
||||||
|
</q-item>
|
||||||
|
<q-item>
|
||||||
|
<q-item-section>
|
||||||
|
<q-item-label lines="1">
|
||||||
|
<span class="text-bold">บริหาร: </span>
|
||||||
|
<span> ต้น,สูง</span></q-item-label
|
||||||
|
>
|
||||||
|
</q-item-section>
|
||||||
|
</q-item>
|
||||||
|
</q-list>
|
||||||
|
</q-tooltip>
|
||||||
|
</q-tab>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<q-space />
|
<q-space />
|
||||||
|
|
@ -346,7 +410,11 @@ onMounted(async () => {
|
||||||
>
|
>
|
||||||
<!-- Card โควต้า -->
|
<!-- Card โควต้า -->
|
||||||
<div class="row col-12 q-pa-md">
|
<div class="row col-12 q-pa-md">
|
||||||
<div :class="`row col-12 ${store.roundMainCode === 'APR' ? `q-col-gutter-md`:`q-gutter-md`} items-start`">
|
<div
|
||||||
|
:class="`row col-12 ${
|
||||||
|
store.roundMainCode === 'APR' ? `q-col-gutter-md` : `q-gutter-md`
|
||||||
|
} items-start`"
|
||||||
|
>
|
||||||
<div
|
<div
|
||||||
v-for="(item, index) in store.roundMainCode === 'APR'
|
v-for="(item, index) in store.roundMainCode === 'APR'
|
||||||
? itemsCard.slice(0, 5)
|
? itemsCard.slice(0, 5)
|
||||||
|
|
@ -354,7 +422,11 @@ onMounted(async () => {
|
||||||
? itemsCard.slice(5, 12)
|
? itemsCard.slice(5, 12)
|
||||||
: itemsCard"
|
: itemsCard"
|
||||||
:key="index"
|
:key="index"
|
||||||
:class="store.roundMainCode === 'APR' ? 'col-6 col-sm-4 col-md-3 col-lg-2' : 'col-3'"
|
:class="
|
||||||
|
store.roundMainCode === 'APR'
|
||||||
|
? 'col-6 col-sm-4 col-md-3 col-lg-2'
|
||||||
|
: 'col-3'
|
||||||
|
"
|
||||||
>
|
>
|
||||||
<q-card>
|
<q-card>
|
||||||
<q-card-section>
|
<q-card-section>
|
||||||
|
|
|
||||||
|
|
@ -211,6 +211,7 @@ watch(
|
||||||
active-color="primary"
|
active-color="primary"
|
||||||
color="dark"
|
color="dark"
|
||||||
:max="totalPage"
|
:max="totalPage"
|
||||||
|
:max-pages="5"
|
||||||
size="sm"
|
size="sm"
|
||||||
boundary-links
|
boundary-links
|
||||||
direction-links
|
direction-links
|
||||||
|
|
|
||||||
|
|
@ -653,6 +653,7 @@ watch([() => page.value, () => pageSize.value], () => {
|
||||||
active-color="primary"
|
active-color="primary"
|
||||||
color="dark"
|
color="dark"
|
||||||
:max="totalPage"
|
:max="totalPage"
|
||||||
|
:max-pages="5"
|
||||||
size="sm"
|
size="sm"
|
||||||
boundary-links
|
boundary-links
|
||||||
direction-links
|
direction-links
|
||||||
|
|
|
||||||
|
|
@ -594,6 +594,7 @@ async function onClickDownloadReport(val: string, name: string) {
|
||||||
active-color="primary"
|
active-color="primary"
|
||||||
color="dark"
|
color="dark"
|
||||||
:max="totalPage"
|
:max="totalPage"
|
||||||
|
:max-pages="5"
|
||||||
size="sm"
|
size="sm"
|
||||||
boundary-links
|
boundary-links
|
||||||
direction-links
|
direction-links
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue