From 1bfcdae54bbaeffcd18b81bdae42a8960a1d28c9 Mon Sep 17 00:00:00 2001 From: "DESKTOP-1R2VSQH\\Lenovo ThinkPad E490" Date: Thu, 3 Apr 2025 18:00:14 +0700 Subject: [PATCH] =?UTF-8?q?[Edit=20SIT]=20=E0=B9=81=E0=B8=81=E0=B9=89?= =?UTF-8?q?=E0=B9=84=E0=B8=82=E0=B8=8A=E0=B9=88=E0=B8=A7=E0=B8=A2=E0=B8=A3?= =?UTF-8?q?=E0=B8=B2=E0=B8=8A=E0=B8=81=E0=B8=B2=E0=B8=A3=20=E0=B9=81?= =?UTF-8?q?=E0=B8=A5=E0=B8=B0=E0=B8=AA=E0=B9=88=E0=B8=87=E0=B8=95=E0=B8=B1?= =?UTF-8?q?=E0=B8=A7=E0=B8=81=E0=B8=A5=E0=B8=B1=E0=B8=9A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/registry/api.registry.ts | 1 + .../06_HelpGovernment.vue | 122 +++++++++++++++++- .../GovernmentInformation/07_Position.vue | 5 +- .../detail/Salary/01_PositionSalary.vue | 5 +- .../interface/request/Government.ts | 1 + .../interface/response/Government.ts | 1 + .../04_registryPerson/views/detailView.vue | 10 +- 7 files changed, 136 insertions(+), 9 deletions(-) diff --git a/src/api/registry/api.registry.ts b/src/api/registry/api.registry.ts index 9ae19d24b..556e10c67 100644 --- a/src/api/registry/api.registry.ts +++ b/src/api/registry/api.registry.ts @@ -238,4 +238,5 @@ export default { `${registryNew}${type}/assistance/${id}`, profileAssistanceHistory: (id: string, type: string) => `${registryNew}${type}/assistance/history/${id}`, + profileAssistanceReturn: `${env.API_URI}/placement/repatriation`, }; diff --git a/src/modules/04_registryPerson/components/detail/GovernmentInformation/06_HelpGovernment.vue b/src/modules/04_registryPerson/components/detail/GovernmentInformation/06_HelpGovernment.vue index 080625fbd..9f867d1c6 100644 --- a/src/modules/04_registryPerson/components/detail/GovernmentInformation/06_HelpGovernment.vue +++ b/src/modules/04_registryPerson/components/detail/GovernmentInformation/06_HelpGovernment.vue @@ -3,13 +3,14 @@ import { ref, onMounted, reactive } from "vue"; import { useQuasar } from "quasar"; import axios from "axios"; -import { useRoute } from "vue-router"; +import { useRoute, useRouter } from "vue-router"; import { checkPermission } from "@/utils/permissions"; import { useCounterMixin } from "@/stores/mixin"; import http from "@/plugins/http"; import config from "@/app.config"; import type { QTableColumn } from "quasar"; +import type { DataOption } from "@/modules/04_registryPerson/interface/index/Main"; import type { DatAssistance } from "@/modules/04_registryPerson/interface/request/Government"; import type { ResAssistanceData, @@ -21,6 +22,7 @@ import DialogHistory from "@/modules/04_registryPerson/components/detail/DialogH import DialogPreviewCommand from "@/modules/18_command/components/DialogPreviewCommand.vue"; const route = useRoute(); +const router = useRouter(); const $q = useQuasar(); const mixin = useCounterMixin(); const { @@ -46,10 +48,22 @@ const isLeave = defineModel("isLeave", { }); const baseColumns = ref([ + { + name: "commandName", + align: "left", + label: "ประเภทคำสั่ง", + sortable: true, + field: "commandName", + headerStyle: "font-size: 14px", + style: "font-size: 14px", + sort: (a: string, b: string) => + a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }), + }, + { name: "agency", align: "left", - label: "หน่วยงานที่ให้ช่วยราชการ", + label: "หน่วยงานที่ให้ช่วยราชการ/ส่งตัวกลับ", sortable: true, field: "agency", headerStyle: "font-size: 14px", @@ -128,6 +142,7 @@ const baseColumns = ref([ }, ]); const baseVisibleColumns = ref([ + "commandName", "agency", "dateStart", "dateEnd", @@ -168,12 +183,24 @@ const modalCommand = ref(false); const command = ref(""); const commandId = ref(""); +const commandCodeOptions = ref([ + { + name: "ให้ช่วยราชการ", + id: "ให้ช่วยราชการ", + }, + { + name: "ให้ข้าราชการกลับไปปฏิบัติงานทางต้นสังกัดเดิม", + id: "ให้ข้าราชการกลับไปปฏิบัติงานทางต้นสังกัดเดิม", + }, +]); //รายการปรเภทคำสั่ง + const formData = reactive({ agency: "", dateStart: null, dateEnd: null, commandNo: "", document: "", + commandName: "", // isUpload: false, }); const fileUpload = ref(); @@ -353,6 +380,7 @@ function openEditDialog(data: ResAssistanceData) { formData.dateEnd = data.dateEnd; formData.commandNo = data.commandNo; formData.document = data.document; + formData.commandName = data.commandName; isUpload.value = data.isUpload; if (isUpload.value) { onDownloadFile(data.id, false); @@ -379,10 +407,34 @@ function closeDialogForm() { formData.dateEnd = null; formData.commandNo = ""; formData.document = ""; + formData.commandName = ""; isUpload.value = false; fileUpload.value = undefined; } +/** + * ฟังก์ชันส่งตัวกลับ + * @param refId ของช่วยราชการ + */ +async function onReturner(refId: string) { + showLoader(); + const formData = new FormData(); + formData.append("OfficerId", refId); + formData.append("Id", profileId.value); + + await http + .post(config.API.profileAssistanceReturn, formData) + .then(async () => { + router.push("/placement/repatriate"); + }) + .catch((err) => { + messageError($q, err); + }) + .finally(() => { + hideLoader(); + }); +} + onMounted(() => { fetchData(); }); @@ -510,6 +562,26 @@ onMounted(() => { > แก้ไขข้อมูล + + + ส่งตัวกลับ +
{ > แก้ไขข้อมูล + + ส่งตัวกลับ +
@@ -643,6 +731,36 @@ onMounted(() => {
+
+ + + + +
([ label: "ประเภทคำสั่ง", sortable: true, field: "commandCode", + format(val, row) { + return row.commandName; + }, headerStyle: "font-size: 14px", style: "font-size: 14px", sort: (a: string, b: string) => @@ -804,7 +807,7 @@ function onClikcHistory(id: string) { */ function onRefCommand(data: ResListSalary) { modalCommand.value = true; - command.value = data.refCommandNo; + command.value = `${data.commandNo}/${Number(data.commandYear) + 543}`; commandId.value = data.commandId; } diff --git a/src/modules/04_registryPerson/components/detail/Salary/01_PositionSalary.vue b/src/modules/04_registryPerson/components/detail/Salary/01_PositionSalary.vue index 9578a82fc..b2c3f3628 100644 --- a/src/modules/04_registryPerson/components/detail/Salary/01_PositionSalary.vue +++ b/src/modules/04_registryPerson/components/detail/Salary/01_PositionSalary.vue @@ -206,6 +206,9 @@ const baseColumns = ref([ label: "ประเภทคำสั่ง", sortable: true, field: "commandCode", + format(val, row) { + return row.commandName; + }, headerStyle: "font-size: 14px", style: "font-size: 14px", sort: (a: string, b: string) => @@ -794,7 +797,7 @@ const classInput = (val: boolean) => { function onRefCommand(data: ResListSalary) { modalCommand.value = true; - command.value = data.refCommandNo; + command.value = `${data.commandNo}/${Number(data.commandYear) + 543}`; commandId.value = data.commandId; } diff --git a/src/modules/04_registryPerson/interface/request/Government.ts b/src/modules/04_registryPerson/interface/request/Government.ts index 89faa2225..c821d1429 100644 --- a/src/modules/04_registryPerson/interface/request/Government.ts +++ b/src/modules/04_registryPerson/interface/request/Government.ts @@ -12,6 +12,7 @@ interface DatAssistance { agency: string; commandNo: string; document: string; + commandName: string; // isUpload: boolean; } diff --git a/src/modules/04_registryPerson/interface/response/Government.ts b/src/modules/04_registryPerson/interface/response/Government.ts index 959ed19fb..bcdf39e50 100644 --- a/src/modules/04_registryPerson/interface/response/Government.ts +++ b/src/modules/04_registryPerson/interface/response/Government.ts @@ -20,6 +20,7 @@ interface ResActingPosData { interface ResAssistanceData { agency: string; commandNo: string; + commandName: string; commandId: string; createdAt: Date | null; createdFullName: string; diff --git a/src/modules/04_registryPerson/views/detailView.vue b/src/modules/04_registryPerson/views/detailView.vue index fffea41c2..19013484e 100644 --- a/src/modules/04_registryPerson/views/detailView.vue +++ b/src/modules/04_registryPerson/views/detailView.vue @@ -80,11 +80,11 @@ const baseItemsMenu = ref([ name: "ช่วยราชการ", system: "SYS_TEMPDUTY", }, - { - id: "2", - name: "ส่งตัวกลับ", - system: "SYS_TEMPDUTY2", - }, + // { + // id: "2", + // name: "ส่งตัวกลับ", + // system: "SYS_TEMPDUTY2", + // }, { id: "3", name: "แต่งตั้ง-เลื่อน-ย้าย",