This commit is contained in:
DESKTOP-1R2VSQH\Lenovo ThinkPad E490 2025-04-08 17:21:01 +07:00
parent e27c26ba0a
commit 0821095838
6 changed files with 244 additions and 114 deletions

View file

@ -250,18 +250,53 @@ function checkSelectForm() {
/** function บันทักตรวจสอบคุณสมบัติ*/
async function saveStep1() {
showLoader();
const salaries = formDetail.value.salaries.map((e: any) => ({
amount: e.amount,
date: e.date,
mouthSalaryAmount: e.mouthSalaryAmount ? e.mouthSalaryAmount : 0,
// amount: e.amount,
// date: e.date,
// mouthSalaryAmount: e.mouthSalaryAmount ? e.mouthSalaryAmount : 0,
// posNo: e.posNo,
// position: e.position,
// positionSalaryAmount: e.positionSalaryAmount ? e.positionSalaryAmount : 0,
// refCommandDate: e.refCommandDate,
// refCommandNo: e.refCommandNo ? e.refCommandNo : "",
// salaryClass: e.salaryClass ? e.salaryClass : "",
// salaryRef: e.salaryRef ? e.salaryRef : "",
// salaryStatus: e.salaryStatus ? e.salariesStatus : "",
profileId: e.profileId,
commandCode: e.commandCode,
commandNo: e.commandNo,
commandYear: e.commandYear ? Number(e.commandYear) : 0,
commandDateAffect: e.commandDateAffect,
commandDateSign: e.commandDateSign,
posNoAbb: e.posNoAbb,
posNo: e.posNo,
position: e.position,
positionSalaryAmount: e.positionSalaryAmount ? e.positionSalaryAmount : 0,
refCommandDate: e.refCommandDate,
refCommandNo: e.refCommandNo ? e.refCommandNo : "",
salaryClass: e.salaryClass ? e.salaryClass : "",
salaryRef: e.salaryRef ? e.salaryRef : "",
salaryStatus: e.salaryStatus ? e.salariesStatus : "",
positionName: e.positionName,
positionType: e.positionType,
positionLevel: e.positionLevel,
positionLine: e.positionLine,
positionPathSide: e.positionPathSide,
positionExecutive: e.positionExecutive,
amount: e.amount ? e.amount.toString() : "0",
amountSpecial: e.amountSpecial ? e.amountSpecial.toString() : "0",
positionSalaryAmount: e.positionSalaryAmount
? e.positionSalaryAmount.toString()
: "0",
mouthSalaryAmount: e.mouthSalaryAmount
? e.mouthSalaryAmount.toString()
: "0",
orgRoot: e.orgRoot,
orgChild1: e.orgChild1,
orgChild2: e.orgChild2,
orgChild3: e.orgChild3,
orgChild4: e.orgChild4,
remark: e.remark,
commandId: e.commandId,
isGovernment: e.isGovernment,
positionCee: e.positionCee,
commandName: e.commandName,
posNumCodeSit: e.posNumCodeSit,
posNumCodeSitAbb: e.posNumCodeSitAbb,
}));
const educations = formDetail.value.educations.map((e: any) => ({

View file

@ -283,9 +283,15 @@ async function onClickDowloadFile(
? { salary: dataPerson.formData.salary ? dataPerson.formData.salary : "" }
: null,
tp === "EV1_006" ? { lastTwoYear: (currentYear - 2).toString() } : null,
tp === "EV1_006" ? { lastOneYear: (currentYear - 1).toString() } : null,
tp === "EV1_006" ? { currentYear: currentYear.toString() } : null,
tp === "EV1_006"
? {
years: {
lastTwoYear: toThaiNumber(currentYear - 2 + 543),
lastOneYear: toThaiNumber(currentYear - 1 + 543),
currentYear: toThaiNumber(currentYear + 543),
},
}
: null,
tp === "EV1_006" ? { commanderFullname: formData.commanderFullname } : null,
tp === "EV1_006" ? { commanderPosition: formData.commanderPosition } : null,
tp === "EV1_006" ? { commanderOrg: "" } : null,
@ -307,6 +313,7 @@ async function onClickDowloadFile(
tp === "EV1_010" ? { subject: formData.subject } : null
);
const body = {
template: tp,
reportName: templateName,
@ -315,6 +322,10 @@ async function onClickDowloadFile(
await genReport(body, fileName); //
}
function toThaiNumber(input: number | string) {
return input.toString().replace(/\d/g, (d) => "๐๑๒๓๔๕๖๗๘๙"[parseInt(d)]);
}
/**
* function fetch งกปโหลดไฟล
* @param volume เล

View file

@ -0,0 +1,120 @@
<script setup lang="ts">
import { useQuasar } from "quasar";
import { ref, watch } from "vue";
import http from "@/plugins/http";
import config from "@/app.config";
import { useCounterMixin } from "@/stores/mixin";
import type { CardDataPos } from "@/modules/10_registry/interface/index/Main";
import DialogHeader from "@/components/DialogHeader.vue";
const $q = useQuasar();
const { showLoader, hideLoader, messageError, formatDatePosition } =
useCounterMixin();
const modal = defineModel<boolean>("modal", { required: true });
const cardData = ref<CardDataPos[]>([
{
label: "ระยะเวลาดำรงตำแหน่งในสายงาน",
data: [],
},
{
label: "ระยะเวลาดำรงตำแหน่งตามระดับ",
data: [],
},
{
label: "ระยะเวลาดำรงตำแหน่งทางการบริหาร",
data: [],
},
]);
function onClosePopup() {
modal.value = false;
}
async function fetchDataPosition() {
showLoader();
await http
.get(config.API.salaryTenurePosition(""))
.then((res) => {
const data = res.data.result;
if (data) {
// map
const formatData = (list: any) =>
list.map((e: any) => ({
name: e.name ?? "",
time: formatDatePosition(e.year, e.month, e.day),
}));
// data
const position = data.position ? formatData(data.position) : []; //
const posLevel = data.posLevel ? formatData(data.posLevel) : []; //
const posExecutive = data.posExecutive
? formatData(data.posExecutive)
: []; //
// cardData
if (cardData.value[0]) {
cardData.value[0].data = position;
}
if (cardData.value[1]) {
cardData.value[1].data = posLevel;
}
if (cardData.value[2]) {
cardData.value[2].data = posExecutive;
}
// cardData
if (posExecutive.length === 0 && cardData.value.length > 2) {
cardData.value.splice(2, 1);
}
}
})
.catch((err) => {
messageError($q, err);
})
.finally(() => {
hideLoader();
});
}
watch(modal, (v) => {
if (v) {
fetchDataPosition();
} else {
cardData.value.forEach((item) => {
item.data = [];
});
}
});
</script>
<template>
<q-dialog v-model="modal" persistent>
<q-card style="min-width: 40%">
<DialogHeader :tittle="`ตำแหน่ง`" :close="onClosePopup" />
<q-separator />
<q-card-section>
<div class="row q-col-gutter-sm q-pb-sm">
<div class="col" v-for="(item, index) in cardData" :key="index">
<q-card bordered class="col-12" style="border: 1px solid #d6dee1">
<div class="col-12 text-weight-medium bg-grey-1 q-py-xs q-px-md">
{{ item.label }}
</div>
<div class="col-12"><q-separator /></div>
<q-card-section class="q-pt-none" style="min-height: 200px">
<li v-for="data in item.data">
{{ data.name }} {{ data.time }}
</li>
</q-card-section>
</q-card>
</div>
</div>
</q-card-section>
</q-card>
</q-dialog>
</template>
<style scoped></style>

View file

@ -9,6 +9,7 @@ import type {
} from "@/modules/06_evaluate/interface/evalute";
import PopupCheckFeatures from "@/modules/06_evaluate/components/PopupCheckFeatures.vue";
import PopupPosition from "@/modules/06_evaluate/components/PopupPosition.vue";
/** use*/
const store = useEvaluateStore();
@ -24,6 +25,7 @@ const education = ref<any>();
const emit = defineEmits(["update:spec"]);
const modal = ref<boolean>(false);
const modalPosition = ref<boolean>(false);
const show = ref<boolean>(false);
const formData = reactive<FormSpec>({
@ -69,6 +71,10 @@ function closeModal() {
modal.value = false;
}
function onViewDataPosition() {
modalPosition.value = true;
}
/**hook lifecycle*/
onMounted(() => {
props.data && fetchCheckSpec(props.data);
@ -120,7 +126,19 @@ onMounted(() => {
/>
</q-item-section>
<q-item-section>
<q-item-label>ประวการรบราชการ </q-item-label>
<q-item-label
>ประวการรบราชการ
<q-btn
flat
round
dense
color="info"
icon="info"
@click="onViewDataPosition()"
>
<q-tooltip>อมลประวการรบราชการ</q-tooltip>
</q-btn>
</q-item-label>
</q-item-section>
</q-item>
<q-item v-ripple class="listItem">
@ -223,6 +241,8 @@ onMounted(() => {
:close-modal="closeModal"
:educations="educations"
/>
<PopupPosition v-model:modal="modalPosition" />
</template>
<style>

View file

@ -86,7 +86,7 @@ async function fetchDetail() {
formDetail.positionLevel = data.posLevelName;
formDetail.posNo = data.posNo ?? "";
formDetail.birthDate = data.birthDate;
formDetail.govAge = data.govAge; //
// formDetail.govAge = data.govAge; //
formDetail.salary = data.salary;
http.get(config.API.dataUserEducations).then((res) => {
@ -107,11 +107,6 @@ async function fetchDetail() {
http.get(config.API.dataUserSalary).then((res) => {
formDetail.salaries = res.data.result;
// formDetail.salary = formDetail.salaries
// ? formattedNumber(
// formDetail.salaries[formDetail.salaries.length - 1].amount
// )
// : "";
});
http.get(config.API.dataUserCertificate("training")).then((res) => {
@ -130,16 +125,9 @@ async function fetchDetail() {
});
http.get(config.API.dataUserAssessments).then((res) => {
// formDetail.honor = res.data.result
// res.data.result.map((e: any) => ({
// receivedDate: e.createdAt,
// authority: e.issuer,
// detail: e.detail,
// orderNumber: e.refCommandNo,
// doce: e.refCommandDate,
formDetail.assessments = res.data.result;
});
// }));
emit("update:formDeital", formDetail);
})
.catch((err) => {
@ -176,26 +164,27 @@ async function fetchCheckSpec(data: any) {
issueDate: date2Thai(e.issueDate),
issuer: e.issuer,
}));
formDetail.salaries = data.salaries.map((e: any) => ({
amount: e.amount,
date: e.date,
mouthSalaryAmount: e.mouthSalaryAmount ? e.mouthSalaryAmount : 0,
posNo: e.posNo,
position: e.position,
positionSalaryAmount: e.positionSalaryAmount ? e.positionSalaryAmount : 0,
refCommandDate: e.refCommandDate ? e.refCommandDate : "",
salaryClass: e.salaryClass ? e.salaryClass : "",
salaryRef: e.salaryRef ? e.salaryRef : "",
salaryStatus: e.salaryStatus ? e.salariesStatus : "",
//
oc: "-",
lineWork: "-",
side: "-",
positionType: "-",
level: "-",
positionsAdministrative: "-",
aspectAdministrative: "-",
}));
formDetail.salaries = data.salaries
// .map((e: any) => ({
// amount: e.amount,
// date: e.date,
// mouthSalaryAmount: e.mouthSalaryAmount ? e.mouthSalaryAmount : 0,
// posNo: e.posNo,
// position: e.position,
// positionSalaryAmount: e.positionSalaryAmount ? e.positionSalaryAmount : 0,
// refCommandDate: e.refCommandDate ? e.refCommandDate : "",
// salaryClass: e.salaryClass ? e.salaryClass : "",
// salaryRef: e.salaryRef ? e.salaryRef : "",
// salaryStatus: e.salaryStatus ? e.salariesStatus : "",
// //
// oc: "-",
// lineWork: "-",
// side: "-",
// positionType: "-",
// level: "-",
// positionsAdministrative: "-",
// aspectAdministrative: "-",
// }));
formDetail.trainings = data.trainings.map((e: any) => ({
dateOrder: date2Thai(e.dateOrder),
department: e.department,
@ -228,11 +217,11 @@ function getData() {
showLoader();
http
.get(config.API.dataUserGovernment)
.then((res) => {
const data = res.data.result;
.then(async (res) => {
const data = await res.data.result;
formDetail.org = data.org;
formDetail.govAge = data.govAge
? `${data.govAge.year} วัน ${data.govAge.month} เดือน ${data.govAge.year} ปี`
? `${data.govAge.year} ปี ${data.govAge.month} เดือน ${data.govAge.day} วัน`
: "";
})
.catch((e) => {
@ -596,12 +585,13 @@ onMounted(async () => {
<span class="q-ml-lg q-my-sm">ผลงานทเคยเสนอขอประเม (าม)</span>
</div>
<div class="col-12"><q-separator /></div>
<div class="col-10">
<div class="col-12 q-pa-sm">-</div>
<!-- <div class="col-10">
<TableData
:columns="columnAssessments"
:row="formDetail.assessments"
/>
</div>
</div> -->
</q-card>
</div>
</q-card>

View file

@ -7,7 +7,7 @@ import { useCounterMixin } from "@/stores/mixin";
export const useEvaluateDetailStore = defineStore("evaluateDetailStore", () => {
/** columns TableViewStep1*/
const mixin = useCounterMixin();
const { date2Thai, findOrgNameHtml } = mixin;
const { date2Thai, findOrgNameHtml, findOrgName } = mixin;
const columnsCertificates = ref<QTableProps["columns"]>([
{
@ -67,10 +67,6 @@ export const useEvaluateDetailStore = defineStore("evaluateDetailStore", () => {
headerStyle: "font-size: 14px",
style: "font-size: 14px",
format: (v) => date2Thai(v),
sort: (a: string, b: string) =>
a
.toString()
.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
},
{
name: "commandDateSign",
@ -81,10 +77,6 @@ export const useEvaluateDetailStore = defineStore("evaluateDetailStore", () => {
headerStyle: "font-size: 14px",
style: "font-size: 14px",
format: (v) => date2Thai(v),
sort: (a: string, b: string) =>
a
.toString()
.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
},
{
name: "posNumCodeSit",
@ -112,7 +104,7 @@ export const useEvaluateDetailStore = defineStore("evaluateDetailStore", () => {
style: "font-size: 14px",
format(val, row) {
return row.posNoAbb && row.posNo
? `${row.posNoAbb}${row.posNo}`
? `${row.posNoAbb} ${row.posNo}`
: row.posNo
? row.posNo
: "-";
@ -143,10 +135,6 @@ export const useEvaluateDetailStore = defineStore("evaluateDetailStore", () => {
field: "positionType",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
sort: (a: string, b: string) =>
a
.toString()
.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
},
{
name: "positionLevel",
@ -165,8 +153,6 @@ export const useEvaluateDetailStore = defineStore("evaluateDetailStore", () => {
},
headerStyle: "font-size: 14px",
style: "font-size: 14px",
sort: (a: string, b: string) =>
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
},
{
name: "positionExecutive",
@ -176,8 +162,6 @@ export const useEvaluateDetailStore = defineStore("evaluateDetailStore", () => {
field: "positionExecutive",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
sort: (a: string, b: string) =>
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
},
{
name: "commandNo",
@ -192,8 +176,6 @@ export const useEvaluateDetailStore = defineStore("evaluateDetailStore", () => {
},
headerStyle: "font-size: 14px",
style: "font-size: 14px",
sort: (a: string, b: string) =>
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
},
{
name: "commandCode",
@ -201,10 +183,11 @@ export const useEvaluateDetailStore = defineStore("evaluateDetailStore", () => {
label: "ประเภทคำสั่ง",
sortable: true,
field: "commandCode",
format(val, row) {
return row.commandName;
},
headerStyle: "font-size: 14px",
style: "font-size: 14px",
sort: (a: string, b: string) =>
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
},
{
name: "organization",
@ -214,8 +197,16 @@ export const useEvaluateDetailStore = defineStore("evaluateDetailStore", () => {
field: "organization",
headerStyle: "font-size: 14px;min-width:280px",
style: "font-size: 14px",
sort: (a: string, b: string) =>
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
format(val, row) {
return findOrgName({
root: row.orgRoot,
child1: row.orgChild1,
child2: row.orgChild2,
child3: row.orgChild3,
child4: row.orgChild4,
});
},
},
{
name: "amount",
@ -234,40 +225,7 @@ export const useEvaluateDetailStore = defineStore("evaluateDetailStore", () => {
}`
: "-";
},
sort: (a: string, b: string) =>
a
.toString()
.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
},
{
name: "mouthSalaryAmount",
align: "left",
label: "เงินค่าตอบแทนรายเดือน",
sortable: true,
field: "mouthSalaryAmount",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
format: (v) => Number(v).toLocaleString(),
sort: (a: string, b: string) =>
a
.toString()
.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
},
{
name: "positionSalaryAmount",
align: "left",
label: "เงินประจำตำแหน่ง",
sortable: true,
field: "positionSalaryAmount",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
format: (v) => Number(v).toLocaleString(),
sort: (a: string, b: string) =>
a
.toString()
.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
},
{
name: "remark",
align: "left",
@ -276,10 +234,6 @@ export const useEvaluateDetailStore = defineStore("evaluateDetailStore", () => {
field: "remark",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
sort: (a: string, b: string) =>
a
.toString()
.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
},
]);