diff --git a/src/modules/02_organization/components/DialogFormDateTime.vue b/src/modules/02_organization/components/DialogFormDateTime.vue index 5f1df9098..5b585227c 100644 --- a/src/modules/02_organization/components/DialogFormDateTime.vue +++ b/src/modules/02_organization/components/DialogFormDateTime.vue @@ -18,6 +18,7 @@ const { hideLoader, messageError, success, + convertDateToAPI, } = useCounterMixin(); /** @@ -52,7 +53,7 @@ function onSubmit() { showLoader(); http .put(config.API.orgSetDateTime(store.draftId as string), { - orgPublishDate: dateTime.value, + orgPublishDate: convertDateToAPI(dateTime.value), }) .then(async () => { await props.fetchActive(); diff --git a/src/modules/02_organization/components/DialogStructureDetail.vue b/src/modules/02_organization/components/DialogStructureDetail.vue index ddb743660..1746f28e2 100644 --- a/src/modules/02_organization/components/DialogStructureDetail.vue +++ b/src/modules/02_organization/components/DialogStructureDetail.vue @@ -18,7 +18,7 @@ const modal = defineModel("structureDetail", { required: true }); const treeId = defineModel("treeId", { required: true }); const orgLevel = defineModel("orgLevel", { required: true }); -const formData = reactive({ +const formData = reactive({ orgName: "", agencyName: "", //*ส่วนราชการ orgType: "", //*ประเภท @@ -27,7 +27,15 @@ const formData = reactive({ orgPhoneEx: "", //หมายเลขโทรศัพท์ที่ติดต่อจากภายนอก orgPhoneIn: "", //หมายเลขโทรศัพท์ที่ติดต่อจากภายใน orgFax: "", //หมายเลขโทรสาร - orgShortName: "", + orgShortName: "", //อักษรย่อ + misId: "", //MsiId + departMentCode: "", //DEPARTMENT CODE + divisionCode: "", //DIVISION CODE + sectionCode: "", //SECTION CODE + jobCode: "", //JOB CODE + responsibility: "", //หน้าที่ความรับผิดชอบ + isCommission: "", //สำนักปลัด + isDeputy: "", //สำนักงาน กก. }); /** @@ -54,8 +62,20 @@ async function fetchDetailTree(id: string, type: string) { : "ยุบเลิก"; formData.orgPhoneEx = data[`org${type}PhoneEx`]; formData.orgPhoneIn = data[`org${type}PhoneIn`]; - formData.orgFax = data[`org${type}Fax`]; - formData.orgShortName = data[`org${type}ShortName`]; + formData.orgFax = data[`org${type}Fax`] ? data[`org${type}Fax`] : "-"; + formData.orgShortName = data[`org${type}ShortName`] + ? data[`org${type}ShortName`] + : "-"; + formData.misId = data.misId ? data.misId : "-"; + formData.departMentCode = data.DEPARTMENT_CODE + ? data.DEPARTMENT_CODE + : "-"; + formData.divisionCode = data.DIVISION_CODE ? data.DIVISION_CODE : "-"; + formData.sectionCode = data.SECTION_CODE ? data.SECTION_CODE : "-"; + formData.jobCode = data.JOB_CODE ? data.JOB_CODE : "-"; + formData.responsibility = data.responsibility ? data.responsibility : "-"; + formData.isDeputy = data.isDeputy ? "ใช่" : "-"; + formData.isCommission = data.isCommission ? "ใช่" : "-"; }) .catch((err) => { messageError($q, err); @@ -108,6 +128,12 @@ watch(

{{ formData.agencyName }}

+
+
อักษรย่อ
+
+

{{ formData.orgShortName }}

+
+
ประเภท
@@ -149,8 +175,63 @@ watch(
Fax
-

{{ formData.orgFax }}

-

-

+

{{ formData.orgFax }}

+
+
+ +
+
MsiId
+
+

{{ formData.misId }}

+
+
+ +
+
DEPARTMENT CODE
+
+

{{ formData.departMentCode }}

+
+
+ +
+
DIVISION CODE
+
+

{{ formData.divisionCode }}

+
+
+ +
+
SECTION CODE
+
+

{{ formData.sectionCode }}

+
+
+ +
+
JOB CODE
+
+

{{ formData.jobCode }}

+
+
+ +
+
หน้าที่ความรับผิดชอบ
+
+

{{ formData.responsibility }}

+
+
+ +
+
สำนักปลัด
+
+

{{ formData.isDeputy }}

+
+
+ +
+
สำนักงาน กก.
+
+

{{ formData.isCommission }}

diff --git a/src/modules/02_organization/store/organizational.ts b/src/modules/02_organization/store/organizational.ts index 120bbcc53..4e44e352c 100644 --- a/src/modules/02_organization/store/organizational.ts +++ b/src/modules/02_organization/store/organizational.ts @@ -148,6 +148,24 @@ export const useOrganizational = defineStore("organizationalStore", () => { } } + /** + * ฟังก์ชันแปลงค่าสถานะรายละเอียดโครงสร้าง + * @param type สถานะ + * @returns ชือสถานะ + */ + function convertStatus(type: string) { + switch (type) { + case "current": + return "ปกติ"; + case "draft": + return "แบบร่าง"; + case "old": + return "ยุบเลิก"; + default: + return "-"; + } + } + return { typeOrganizational, statusView, @@ -171,5 +189,6 @@ export const useOrganizational = defineStore("organizationalStore", () => { rootId, isLosck, remark, + convertStatus, }; }); diff --git a/src/modules/04_registryPerson/components/DialogHistory.vue b/src/modules/04_registryPerson/components/DialogHistory.vue index a7d3f4d95..15d41a880 100644 --- a/src/modules/04_registryPerson/components/DialogHistory.vue +++ b/src/modules/04_registryPerson/components/DialogHistory.vue @@ -33,10 +33,7 @@ const employeeClass = ref( const typeKeyword = ref(""); const Keyword = ref(""); const positionKeyword = ref(""); -const employeeClassOps = ref([ - { id: "officer", name: "ข้าราชการ กทม.สามัญ" }, - { id: "perm", name: "ลูกจ้างประจำ" }, -]); + //ตัวเลือกประเภทการค้นหา const typeKeywordOps = ref([ { id: "no", name: "ตำแหน่งเลขที่" }, @@ -97,14 +94,6 @@ const columns = ref([ ]); const rows = ref([]); -/** function เปลี่ยนประเภท*/ -function changeEmployeeClass() { - typeKeyword.value = ""; - Keyword.value = ""; - positionKeyword.value = ""; - rows.value = []; -} - /** * function ค้นหาประวัติถือครองตำแหน่ง * @param type ประเภทข่าราชการ @@ -186,27 +175,6 @@ function closeDialog() {
- -
(route.params.id.toString()); @@ -44,98 +46,7 @@ const dialogStatus = ref("create"); //สถานะการแก้ const editId = ref(""); //id ที่ต้องการแก้ไข //Table Main -const rows = ref([]); //รายการใบอนุญาตประกอบวิชาชีพ -const rowsMain = ref([]); //รายการใบอนุญาตประกอบวิชาชีพ -const keyword = ref(""); //คำค้นหา -const columns = ref([ - { - name: "certificateType", - align: "left", - label: "ชื่อใบอนุญาต", - sortable: true, - field: "certificateType", - headerStyle: "font-size: 14px", - style: "font-size: 14px", - sort: (a: string, b: string) => - a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }), - }, - { - name: "issuer", - align: "left", - label: "หน่วยงานผู้ออกใบอนุญาต", - sortable: true, - field: "issuer", - headerStyle: "font-size: 14px", - style: "font-size: 14px", - sort: (a: string, b: string) => - a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }), - }, - { - name: "certificateNo", - align: "left", - label: "เลขที่ใบอนุญาต", - sortable: true, - field: "certificateNo", - headerStyle: "font-size: 14px", - style: "font-size: 14px", - sort: (a: string, b: string) => - a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }), - }, - { - name: "issueDate", - align: "left", - label: "วันที่ออกใบอนุญาต", - sortable: true, - field: "issueDate", - format: (v) => date2Thai(v), - headerStyle: "font-size: 14px", - style: "font-size: 14px", - sort: (a: string, b: string) => - a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }), - }, - { - name: "expireDate", - align: "left", - label: "วันที่หมดอายุ", - sortable: true, - format: (v) => date2Thai(v), - field: "expireDate", - headerStyle: "font-size: 14px", - style: "font-size: 14px", - sort: (a: string, b: string) => - a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }), - }, - { - name: "lastUpdatedAt", - align: "left", - label: "วันที่แก้ไข", - sortable: true, - field: "lastUpdatedAt", - format: (v) => date2Thai(v, false, true), - headerStyle: "font-size: 14px", - style: "font-size: 14px", - sort: (a: string, b: string) => - a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }), - }, -]); -const visibleColumns = ref([ - "certificateType", - "issuer", - "certificateNo", - "issueDate", - "expireDate", - "lastUpdatedAt", -]); -const pagination = ref({ - sortBy: "lastUpdatedAt", -}); - -//Table ประวัติแก้ไขใบอนุญาตประกอบวิชาชีพ -const historyRows = ref([]); //รายการประวัติแก้ไขใบอนุญาตประกอบวิชาชีพ -const historyRowsMain = ref([]); //รายการประวัติแก้ไขใบอนุญาตประกอบวิชาชีพ - -const historyKeyword = ref(""); //คำค้นหาประวัติแก้ไข -const historyColumns = ref([ +const baseColumns = ref([ { name: "certificateType", align: "left", @@ -217,7 +128,7 @@ const historyColumns = ref([ a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }), }, ]); -const historyVisibleColumns = ref([ +const baseVisibleColumns = ref([ "certificateType", "issuer", "certificateNo", @@ -226,15 +137,30 @@ const historyVisibleColumns = ref([ "lastUpdateFullName", "lastUpdatedAt", ]); -const historyPagination = ref({ + +const rows = ref([]); //รายการใบอนุญาตประกอบวิชาชีพ +const rowsMain = ref([]); //รายการใบอนุญาตประกอบวิชาชีพ +const keyword = ref(""); //คำค้นหา +const columns = ref( + baseColumns.value.filter((e: QTableColumn) => e.name !== "lastUpdateFullName") +); +const visibleColumns = ref( + baseVisibleColumns.value.filter((e: string) => e !== "lastUpdateFullName") +); +const pagination = ref({ sortBy: "lastUpdatedAt", }); +//Table ประวัติแก้ไขใบอนุญาตประกอบวิชาชีพ +const historyId = ref(""); +const columnsHistory = ref(baseColumns.value); +const visibleColumnsHistory = ref(baseVisibleColumns.value); + const profesLicenseData = reactive({ certificateType: "", //ชื่อใบอนุญาต issuer: "", //หน่วยงานผู้ออกใบอนุญาต certificateNo: "", //เลขที่ใบอนุญาต - issueDate: new Date(), //วันที่ออกใบอนุญาต + issueDate: null, //วันที่ออกใบอนุญาต expireDate: null, //วันที่หมดอายุ profileId: id.value, }); @@ -243,26 +169,49 @@ const profesLicenseData = reactive({ function onSubmit() { dialogConfirm( $q, - () => { - dialogStatus.value === "create" ? addData() : editData(editId.value); + async () => { + showLoader(); + const isEdit = dialogStatus.value === "create" ? false : true; + const url = isEdit + ? config.API.profileNewCertificateByCertificateId( + editId.value, + empType.value + ) + : config.API.profileNewCertificate(empType.value); + + const method = isEdit ? http.patch : http.post; + await method(url, { + ...profesLicenseData, + issueDate: convertDateToAPI(profesLicenseData.issueDate), + expireDate: convertDateToAPI(profesLicenseData.expireDate), + profileId: isEdit + ? undefined + : empType.value === "" + ? id.value + : undefined, + profileEmployeeId: isEdit + ? undefined + : empType.value !== "" + ? id.value + : undefined, + }) + .then(async () => { + await fetchData(id.value); + success($q, "บันทึกข้อมูลสำเร็จ"); + closeDialog(); + }) + .catch((err) => { + messageError($q, err); + }) + .finally(() => { + hideLoader(); + }); }, "ยืนยันการบันทึกข้อมูล", "ต้องการยืนยันการบันทึกข้อมูลนี้หรือไม่ ?" ); } -/** ปิด form ข้อมูลใบอนุญาตประกอบวิชาชีพ*/ -function closeDialog() { - dialog.value = false; -} - -/** ปิด popup ประวัติการแก้ไขข้อมูลใบอนุญาตประกอบวิชาชีพ*/ -function closeHistoryDialog() { - historyDialog.value = false; - historyRows.value = []; - historyKeyword.value = ""; -} - /** fetch ข้อมูลรายการใบอนุญาตประกอบวิชาชีพ*/ async function fetchData(id: string) { showLoader(); @@ -280,10 +229,15 @@ async function fetchData(id: string) { }); } +/** ปิด form ข้อมูลใบอนุญาตประกอบวิชาชีพ*/ +function closeDialog() { + dialog.value = false; +} + /** เคลียร์ form ข้อมูลใบอนุญาตประกอบวิชาชีพ*/ function clearForm() { profesLicenseData.expireDate = null; - profesLicenseData.issueDate = new Date(); + profesLicenseData.issueDate = null; profesLicenseData.certificateNo = ""; profesLicenseData.certificateType = ""; profesLicenseData.issuer = ""; @@ -293,7 +247,7 @@ function clearForm() { * เปิด form แก้ไขข้อมูลใบอนุญาตประกอบวิชาชีพ * @param row ข้อมูลใบอนุญาตประกอบวิชาชีพ */ -function editForm(row: any) { +function editForm(row: ResponseObject) { dialogStatus.value = "edit"; editId.value = row.id; profesLicenseData.certificateType = row.certificateType; @@ -304,72 +258,27 @@ function editForm(row: any) { dialog.value = true; } -/** - * เพิ่มรายการข้อมูลใบอนุญาตประกอบวิชาชีพ - */ -function addData() { - showLoader(); - http - .post(config.API.profileNewCertificate(empType.value), { - ...profesLicenseData, - profileId: empType.value === "" ? id.value : undefined, - profileEmployeeId: empType.value !== "" ? id.value : undefined, - }) - .then(async () => { - await fetchData(id.value); - await success($q, "บันทึกข้อมูลสำเร็จ"); - closeDialog(); - }) - .catch((err) => { - messageError($q, err); - }) - .finally(() => { - hideLoader(); - }); -} - -/** - * แก้ไขข้อมูลใบอนุญาตประกอบวิชาชีพ - * @param idData รายการข้อมูลใบอนุญาตประกอบวิชาชีพ - */ -function editData(idData: string) { - showLoader(); - http - .patch( - config.API.profileNewCertificateByCertificateId(idData, empType.value), - { - ...profesLicenseData, - profileId: undefined, - } - ) - .then(async () => { - await fetchData(id.value); - await success($q, "บันทึกข้อมูลสำเร็จ"); - closeDialog(); - }) - .catch((err) => { - messageError($q, err); - }) - .finally(() => { - hideLoader(); - }); +function onViewHistory(id: string) { + historyId.value = id; + historyDialog.value = true; } /** fetch ข้อมูลประวัติการแก้ไขข้อมูลใบอนุญาตประกอบวิชาชีพ*/ -function fetchHistoryData(id: string) { +async function fetchDataHistory() { showLoader(); - http - .get(config.API.profileNewCertificateHisByCertificateId(id, empType.value)) - .then(async (res) => { - historyRows.value = res.data.result; - historyRowsMain.value = res.data.result; - }) - .catch((err) => { - messageError($q, err); - }) - .finally(() => { - hideLoader(); - }); + try { + const res = await http.get( + config.API.profileNewCertificateHisByCertificateId( + historyId.value, + empType.value + ) + ); + return res.data.result; + } catch (err) { + messageError($q, err); + } finally { + hideLoader(); + } } function serchDataTable() { @@ -380,14 +289,6 @@ function serchDataTable() { ); } -function serchDataTableHistory() { - historyRows.value = onSearchDataTable( - historyKeyword.value, - historyRowsMain.value, - historyColumns.value ? historyColumns.value : [] - ); -} - /** * ทำงานเมื่อ Components ถูกเรียกใช้งาน */ @@ -503,9 +404,7 @@ onMounted(() => { round color="deep-purple" icon="mdi-history" - @click=" - () => (fetchHistoryData(props.row.id), (historyDialog = true)) - " + @click="() => onViewHistory(props.row.id)" > ประวัติแก้ไขใบอนุญาตประกอบวิชาชีพ @@ -544,9 +443,7 @@ onMounted(() => { round color="deep-purple" icon="mdi-history" - @click=" - () => (fetchHistoryData(props.row.id), (historyDialog = true)) - " + @click="() => onViewHistory(props.row.id)" > ประวัติแก้ไขใบอนุญาตประกอบวิชาชีพ @@ -737,79 +634,13 @@ onMounted(() => { - - - - - - -
- - - - - - -
- - - - -
-
-
+ diff --git a/src/modules/04_registryPerson/components/detail/Achievement/04_DeclarationHonor.vue b/src/modules/04_registryPerson/components/detail/Achievement/04_DeclarationHonor.vue index e64fa3808..58150d506 100644 --- a/src/modules/04_registryPerson/components/detail/Achievement/04_DeclarationHonor.vue +++ b/src/modules/04_registryPerson/components/detail/Achievement/04_DeclarationHonor.vue @@ -9,7 +9,7 @@ import { useCounterMixin } from "@/stores/mixin"; import http from "@/plugins/http"; import config from "@/app.config"; -import type { QTableProps } from "quasar"; +import type { QTableColumn } from "quasar"; import type { RequestItemsObject } from "@/modules/04_registryPerson/interface/request/DeclarationHonor"; import type { DataOption, @@ -18,6 +18,7 @@ import type { import type { ResponseObject } from "@/modules/04_registryPerson/interface/response/DeclarationHonor"; import DialogHeader from "@/components/DialogHeader.vue"; +import DialogHistory from "@/modules/04_registryPerson/components/detail/DialogHistory.vue"; const $q = useQuasar(); const route = useRoute(); @@ -31,6 +32,7 @@ const { dialogConfirm, pathRegistryEmp, onSearchDataTable, + convertDateToAPI, } = mixin; const profileId = ref( @@ -76,10 +78,7 @@ const modeView = ref("table"); //การแสดงผล Table,Card const modalHistory = ref(false); //แสดง popup ประวัติแก้ไข //Table Main -const rows = ref([]); -const rowsMain = ref([]); -const filterSearch = ref(""); -const columns = ref([ +const baseColumns = ref([ { name: "issueDate", align: "left", @@ -88,101 +87,8 @@ const columns = ref([ field: "issueDate", format(val, row) { return row.isDate - ? date2Thai(row.issueDate) - : new Date(row.issueDate).getFullYear() + 543; - }, - headerStyle: "font-size: 14px", - style: "font-size: 14px", - sort: (a: string, b: string) => - a - .toString() - .localeCompare(b, undefined, { numeric: true, sensitivity: "base" }), - }, - { - name: "issuer", - align: "left", - label: "ผู้มีอำนาจลงนาม", - sortable: true, - field: "issuer", - headerStyle: "font-size: 14px", - style: "font-size: 14px", - sort: (a: string, b: string) => - a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }), - }, - { - name: "detail", - align: "left", - label: "รายละเอียด", - sortable: true, - field: "detail", - headerStyle: "font-size: 14px", - style: "font-size: 14px", - sort: (a: string, b: string) => - a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }), - }, - { - name: "refCommandNo", - align: "left", - label: "เลขที่คำสั่ง", - sortable: true, - field: "refCommandNo", - headerStyle: "font-size: 14px", - style: "font-size: 14px", - sort: (a: string, b: string) => - a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }), - }, - { - name: "refCommandDate", - align: "left", - label: "เอกสารอ้างอิง (ลงวันที่)", - sortable: true, - field: "refCommandDate", - headerStyle: "font-size: 14px", - style: "font-size: 14px", - format: (v) => date2Thai(v), - sort: (a: string, b: string) => - a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }), - }, - { - name: "lastUpdatedAt", - align: "left", - label: "วันที่แก้ไข", - sortable: true, - field: "lastUpdatedAt", - format: (v) => date2Thai(v, false, true), - headerStyle: "font-size: 14px", - style: "font-size: 14px", - sort: (a: string, b: string) => - a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }), - }, -]); -const visibleColumns = ref([ - "issuer", - "detail", - "issueDate", - "refCommandNo", - "refCommandDate", - "lastUpdatedAt", -]); -const pagination = ref({ - sortBy: "lastUpdatedAt", -}); - -//Table ประวัติแก้ไข -const rowsHistory = ref([]); -const rowsHistoryMain = ref([]); -const filterHistory = ref(""); -const columnsHistory = ref([ - { - name: "issueDate", - align: "left", - label: "วันที่ได้รับ", - sortable: true, - field: "issueDate", - format(val, row) { - return row.isDate - ? date2Thai(row.issueDate) - : new Date(row.issueDate).getFullYear() + 543; + ? date2Thai(row.issueDate).toString() + : (new Date(row.issueDate).getFullYear() + 543).toString(); }, headerStyle: "font-size: 14px", style: "font-size: 14px", @@ -260,7 +166,7 @@ const columnsHistory = ref([ a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }), }, ]); -const visibleColumnsHistory = ref([ +const baseVisibleColumns = ref([ "issuer", "detail", "issueDate", @@ -269,6 +175,27 @@ const visibleColumnsHistory = ref([ "lastUpdateFullName", "lastUpdatedAt", ]); + +const rows = ref([]); +const rowsMain = ref([]); +const filterSearch = ref(""); +const columns = ref( + baseColumns.value.filter((e: QTableColumn) => e.name !== "lastUpdateFullName") +); +const visibleColumns = ref( + baseVisibleColumns.value.filter((e: string) => e !== "lastUpdateFullName") +); +const pagination = ref({ + sortBy: "lastUpdatedAt", +}); + +//Table ประวัติแก้ไข +const rowsHistory = ref([]); +const rowsHistoryMain = ref([]); +const filterHistory = ref(""); +const historyId = ref(""); +const columnsHistory = ref(baseColumns.value); +const visibleColumnsHistory = ref(baseVisibleColumns.value); const historyPagination = ref({ sortBy: "lastUpdatedAt", }); @@ -303,7 +230,7 @@ async function addEditData(editStatus: boolean = false) { ? config.API.profileNewHonorById(id.value, empType.value) : config.API.profileNewHonor(empType.value); const method = editStatus ? "patch" : "post"; - const reqBody: RequestItemsObject = { + const reqBody = { ...declHonorForm, isUpload: !isEdit.value ? undefined : isUpload.value, profileEmployeeId: @@ -313,10 +240,10 @@ async function addEditData(editStatus: boolean = false) { isDate: declHonorForm.isDate === "true" ? true : false, issueDate: declHonorForm.isDate === "true" - ? declHonorForm.issueDate - : new Date(`${issueDateYear.value}-01-01`), + ? convertDateToAPI(declHonorForm.issueDate) + : convertDateToAPI(new Date(`${issueDateYear.value}-01-01`)), + refCommandDate: convertDateToAPI(declHonorForm.refCommandDate), }; - try { await http[method](url, reqBody).then(async (res) => { if ((fileUpload.value && id.value) || res.data.result) { @@ -324,7 +251,7 @@ async function addEditData(editStatus: boolean = false) { } }); await fetchData(); - await success($q, "บันทึกข้อมูลสำเร็จ"); + success($q, "บันทึกข้อมูลสำเร็จ"); modal.value = false; } catch (e) { messageError($q, e); @@ -469,15 +396,17 @@ async function clickClose() { /** fetch ช้อมูลประวัติการแก้ไขรายการข้อมูลประกาศเกียรติคุณ*/ async function clickHistory(row: ResponseObject) { + historyId.value = row.id; modalHistory.value = true; - filterSearch.value = ""; +} + +async function fetchDataHistory() { showLoader(); try { const res = await http.get( - config.API.profileNewHonorHisById(row.id, empType.value) + config.API.profileNewHonorHisById(historyId.value, empType.value) ); - rowsHistory.value = res.data.result; - rowsHistoryMain.value = res.data.result; + return res.data.result; } catch (e) { messageError($q, e); } finally { @@ -522,19 +451,12 @@ function serchDataTable() { ); } -function serchDataTableHistory() { - rowsHistory.value = onSearchDataTable( - filterHistory.value, - rowsHistoryMain.value, - columnsHistory.value ? columnsHistory.value : [] - ); -} - /** ทำงานเมื่อ Components ถูกเรียกใช้งาน*/ onMounted(() => { fetchData(); }); + diff --git a/src/modules/04_registryPerson/components/detail/Achievement/05_ResultsPerformance.vue b/src/modules/04_registryPerson/components/detail/Achievement/05_ResultsPerformance.vue index 5d4fb6d09..7fb80f998 100644 --- a/src/modules/04_registryPerson/components/detail/Achievement/05_ResultsPerformance.vue +++ b/src/modules/04_registryPerson/components/detail/Achievement/05_ResultsPerformance.vue @@ -9,7 +9,7 @@ import { useResultsPerformDataStore } from "@/modules/04_registryPerson/stores/R import http from "@/plugins/http"; import config from "@/app.config"; -import type { QTableProps } from "quasar"; +import type { QTableColumn } from "quasar"; import type { RequestItemsObject, DataOptions, @@ -18,6 +18,7 @@ import type { ResponseObject } from "@/modules/04_registryPerson/interface/respo import DialogHeader from "@/components/DialogHeader.vue"; import DialogDevelop from "@/modules/04_registryPerson/components/detail/Achievement/DialogDevelopmance.vue"; +import DialogHistory from "@/modules/04_registryPerson/components/detail/DialogHistory.vue"; const $q = useQuasar(); const route = useRoute(); @@ -33,6 +34,7 @@ const { dialogConfirm, pathRegistryEmp, onSearchDataTable, + convertDateToAPI, } = mixin; const profileId = ref( @@ -80,266 +82,7 @@ const resPerformForm = reactive({ }); //Table ผลการประเมินการปฏิบัติราชการ -const rows = ref([]); -const rowsMain = ref([]); -const filterSearch = ref(""); -const columns = ref([ - { - name: "date", - align: "left", - label: "วันที่ได้รับ", - sortable: true, - field: "date", - 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: "year", - align: "left", - label: "ปีงบประมาณ", - sortable: true, - field: "year", - headerStyle: "font-size: 14px", - style: "font-size: 14px", - format: (v) => { - return `${v ? Number(v) + 543 : "-"}`; - }, - sort: (a: string, b: string) => - a - .toString() - .localeCompare(b, undefined, { numeric: true, sensitivity: "base" }), - }, - { - name: "period", - align: "left", - label: "รอบการประเมิน", - sortable: true, - field: "period", - headerStyle: "font-size: 14px", - style: "font-size: 14px", - format: (v) => { - return ( - periodOp.value.find((item: DataOptions) => item.id === v)?.name || "-" - ); - }, - sort: (a: string, b: string) => - a - .toString() - .localeCompare(b, undefined, { numeric: true, sensitivity: "base" }), - }, - { - name: "point1Total", - align: "left", - label: "ส่วนที่ 1 (น้ำหนัก)", - sortable: true, - field: "point1Total", - headerStyle: "font-size: 14px", - style: "font-size: 14px", - sort: (a: string, b: string) => - a - .toString() - .localeCompare(b, undefined, { numeric: true, sensitivity: "base" }), - }, - { - name: "point1", - align: "left", - label: "ผลประเมินส่วนที่ 1 (คะแนน)", - sortable: true, - field: "point1", - headerStyle: "font-size: 14px", - style: "font-size: 14px", - sort: (a: string, b: string) => - a - .toString() - .localeCompare(b, undefined, { numeric: true, sensitivity: "base" }), - }, - { - name: "point2Total", - align: "left", - label: "ส่วนที่ 2 (น้ำหนัก)", - sortable: true, - field: "point2Total", - headerStyle: "font-size: 14px", - style: "font-size: 14px", - sort: (a: string, b: string) => - a - .toString() - .localeCompare(b, undefined, { numeric: true, sensitivity: "base" }), - }, - { - name: "point2", - align: "left", - label: "ผลประเมินส่วนที่ 2 (คะแนน)", - sortable: true, - field: "point2", - headerStyle: "font-size: 14px", - style: "font-size: 14px", - sort: (a: string, b: string) => - a - .toString() - .localeCompare(b, undefined, { numeric: true, sensitivity: "base" }), - }, - { - name: "pointSumTotal", - align: "left", - label: "ผลรวม (น้ำหนัก)", - sortable: true, - field: "pointSumTotal", - headerStyle: "font-size: 14px", - style: "font-size: 14px", - sort: (a: string, b: string) => - a - .toString() - .localeCompare(b, undefined, { numeric: true, sensitivity: "base" }), - }, - { - name: "pointSum", - align: "left", - label: "ผลประเมินรวม (คะแนน)", - sortable: true, - field: "pointSum", - headerStyle: "font-size: 14px", - style: "font-size: 14px", - sort: (a: string, b: string) => - a - .toString() - .localeCompare(b, undefined, { numeric: true, sensitivity: "base" }), - }, - { - name: "name", - align: "left", - label: "ผลประเมิน", - sortable: true, - field: "name", - format(val, row) { - return `${textPoint(row.pointSum)} ${textRangePoint(row.pointSum)}`; - }, - headerStyle: "font-size: 14px", - style: "font-size: 14px", - sort: (a: string, b: string) => - a - .toString() - .localeCompare(b, undefined, { numeric: true, sensitivity: "base" }), - }, - { - name: "lastUpdatedAt", - align: "left", - label: "วันที่แก้ไข", - sortable: true, - field: "lastUpdatedAt", - format: (v) => date2Thai(v, false, true), - headerStyle: "font-size: 14px", - style: "font-size: 14px", - sort: (a: string, b: string) => - a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }), - }, -]); -const visibleColumns = ref([ - "point1Total", - "year", - "period", - "point1", - "point2Total", - "point2", - "pointSumTotal", - "pointSum", - "name", - "date", - "lastUpdatedAt", -]); -const pagination = ref({ - sortBy: "lastUpdatedAt", -}); - -//Table การพัฒนารายบุคคล (Individual Development Plan) -const rowsPlan = ref([]); -const filterSearchPlan = ref(""); -const columnsPlan = ref([ - { - name: "no", - align: "left", - label: "ลำดับ", - sortable: false, - field: "no", - headerStyle: "font-size: 14px", - style: "font-size: 14px", - format: (v) => date2Thai(v), - }, - { - name: "name", - align: "left", - label: "ความรู้/ทักษะ/สมรรถนะที่ต้องได้รับการพัฒนา", - sortable: false, - field: "name", - headerStyle: "font-size: 14px", - style: "font-size: 14px", - sort: (a: string, b: string) => - a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }), - }, - { - name: "developmentProjects", - align: "left", - label: "วิธีการพัฒนา", - sortable: false, - field: "developmentProjects", - headerStyle: "font-size: 14px", - style: "font-size: 14px", - sort: (a: string, b: string) => - a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }), - }, - { - name: "developmentTarget", - align: "left", - label: "เป้าหมายการพัฒนา", - sortable: false, - field: "developmentTarget", - headerStyle: "font-size: 14px", - style: "font-size: 14px", - sort: (a: string, b: string) => - a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }), - }, - { - name: "developmentResults", - align: "left", - label: "วิธีการวัดผลการพัฒนา", - sortable: false, - field: "developmentResults", - headerStyle: "font-size: 14px", - style: "font-size: 14px", - sort: (a: string, b: string) => - a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }), - }, - { - name: "developmentReport", - align: "left", - label: "รายงานผลการพัฒนา", - sortable: false, - field: "developmentReport", - headerStyle: "font-size: 14px", - style: "font-size: 14px", - sort: (a: string, b: string) => - a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }), - }, -]); -const visibleColumnsPlan = ref([ - "no", - "name", - "developmentProjects", - "developmentTarget", - "developmentResults", - "developmentReport", -]); - -//Table ประวัติแก้ไข -const rowsHistory = ref([]); -const rowsHistoryMain = ref([]); -const filterHistory = ref(""); -const columnsHistory = ref([ +const baseColumns = ref([ { name: "date", align: "left", @@ -506,7 +249,7 @@ const columnsHistory = ref([ a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }), }, ]); -const visibleColumnsHistory = ref([ +const baseVisibleColumns = ref([ "point1Total", "year", "period", @@ -520,10 +263,106 @@ const visibleColumnsHistory = ref([ "lastUpdateFullName", "lastUpdatedAt", ]); -const historyPagination = ref({ + +const rows = ref([]); +const rowsMain = ref([]); +const filterSearch = ref(""); +const columns = ref( + baseColumns.value.filter((e: QTableColumn) => e.name !== "lastUpdateFullName") +); +const visibleColumns = ref( + baseVisibleColumns.value.filter((e: string) => e !== "lastUpdateFullName") +); +const pagination = ref({ sortBy: "lastUpdatedAt", }); +//Table การพัฒนารายบุคคล (Individual Development Plan) +const rowsPlan = ref([]); +const filterSearchPlan = ref(""); +const columnsPlan = ref([ + { + name: "no", + align: "left", + label: "ลำดับ", + sortable: false, + field: "no", + headerStyle: "font-size: 14px", + style: "font-size: 14px", + format: (v) => date2Thai(v), + }, + { + name: "name", + align: "left", + label: "ความรู้/ทักษะ/สมรรถนะที่ต้องได้รับการพัฒนา", + sortable: false, + field: "name", + headerStyle: "font-size: 14px", + style: "font-size: 14px", + sort: (a: string, b: string) => + a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }), + }, + { + name: "developmentProjects", + align: "left", + label: "วิธีการพัฒนา", + sortable: false, + field: "developmentProjects", + headerStyle: "font-size: 14px", + style: "font-size: 14px", + sort: (a: string, b: string) => + a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }), + }, + { + name: "developmentTarget", + align: "left", + label: "เป้าหมายการพัฒนา", + sortable: false, + field: "developmentTarget", + headerStyle: "font-size: 14px", + style: "font-size: 14px", + sort: (a: string, b: string) => + a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }), + }, + { + name: "developmentResults", + align: "left", + label: "วิธีการวัดผลการพัฒนา", + sortable: false, + field: "developmentResults", + headerStyle: "font-size: 14px", + style: "font-size: 14px", + sort: (a: string, b: string) => + a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }), + }, + { + name: "developmentReport", + align: "left", + label: "รายงานผลการพัฒนา", + sortable: false, + field: "developmentReport", + headerStyle: "font-size: 14px", + style: "font-size: 14px", + sort: (a: string, b: string) => + a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }), + }, +]); +const visibleColumnsPlan = ref([ + "no", + "name", + "developmentProjects", + "developmentTarget", + "developmentResults", + "developmentReport", +]); + +//Table ประวัติแก้ไข +const rowsHistory = ref([]); +const rowsHistoryMain = ref([]); +const historyId = ref(""); +const columnsHistory = ref(baseColumns.value); +const visibleColumnsHistory = ref(baseVisibleColumns.value); + /** fetch รายการข้อมูลผลการประเมินการปฏิบัติราชการ*/ async function fetchData() { if (!profileId.value) return; @@ -585,8 +424,9 @@ async function addEditData(editStatus: boolean = false) { ? config.API.profileNewAssessmentsById(id.value, empType.value) : config.API.profileNewAssessments(empType.value); const method = editStatus ? "patch" : "post"; - const reqBody: RequestItemsObject = { + const reqBody = { ...resPerformForm, + date: convertDateToAPI(resPerformForm.date), period: period.value, year: year.value, profileEmployeeId: @@ -636,16 +476,18 @@ async function clickClose() { /** fetch ช้อมูลประวัติการแก้ไขรายการข้อมูลผลการประเมินการปฏิบัติราชการ*/ async function clickHistory(row: ResponseObject) { + historyId.value = row.id; modalHistory.value = true; - filterSearch.value = ""; +} + +async function fetchDataHistory() { showLoader(); try { const res = await http.get( - config.API.profileNewAssessmentsHisById(row.id, empType.value) + config.API.profileNewAssessmentsHisById(historyId.value, empType.value) ); - rowsHistory.value = res.data.result; - rowsHistoryMain.value = res.data.result; + return res.data.result; } catch (e) { messageError($q, e); } finally { @@ -702,14 +544,6 @@ function serchDataTable() { ); } -function serchDataTableHistory() { - rowsHistory.value = onSearchDataTable( - filterHistory.value, - rowsHistoryMain.value, - columnsHistory.value ? columnsHistory.value : [] - ); -} - watch( () => paginationIdp.value.rowsPerPage, async () => { @@ -1391,78 +1225,13 @@ onMounted(async () => { - - - - - -
- - - - - -
- - > - - - -
-
-
+ +import { ref, watch } from "vue"; +import { useCounterMixin } from "@/stores/mixin"; + +import type { QTableColumn } from "quasar"; +import type { DataHistory } from "@/modules/04_registryPerson/interface/index/Main"; + +import DialogHeader from "@/components/DialogHeader.vue"; + +const { onSearchDataTable } = useCounterMixin(); + +const modal = defineModel("modal", { required: true }); +const title = defineModel("title", { required: true }); +const columns = defineModel("columns", { + required: true, +}); +const visibleColumnsMain = defineModel("visibleColumns", { + required: true, +}); + +const props = defineProps({ + fetchData: { type: Function, required: true }, +}); + +const filter = ref(""); +const rows = ref([]); +const dataMain = ref([]); +const visibleColumns = ref([]); +const pagination = ref({ + sortBy: "lastUpdatedAt", +}); + +async function fetchDataTable() { + visibleColumns.value = visibleColumnsMain.value; + const data = await props?.fetchData?.(); + dataMain.value = data; + rows.value = data; +} + +/** ฟังก์ค้นหาข้อมูลรายการประวัติแก้ไขข้อมูลส่วนตัว */ +function serchDataTable() { + rows.value = onSearchDataTable(filter.value, dataMain.value, columns.value); +} + +watch( + () => modal.value, + () => { + if (modal.value) { + fetchDataTable(); + } else { + filter.value = ""; + dataMain.value = []; + rows.value = []; + pagination.value.sortBy = "lastUpdatedAt"; + } + } +); + + + + + diff --git a/src/modules/04_registryPerson/components/detail/Employee/01_DataEmployee.vue b/src/modules/04_registryPerson/components/detail/Employee/01_DataEmployee.vue index 7ae0444c1..8c637bd94 100644 --- a/src/modules/04_registryPerson/components/detail/Employee/01_DataEmployee.vue +++ b/src/modules/04_registryPerson/components/detail/Employee/01_DataEmployee.vue @@ -1,11 +1,12 @@ + diff --git a/src/modules/04_registryPerson/components/detail/GovernmentInformation/02_DisciplineHistory.vue b/src/modules/04_registryPerson/components/detail/GovernmentInformation/02_DisciplineHistory.vue deleted file mode 100644 index 17641c029..000000000 --- a/src/modules/04_registryPerson/components/detail/GovernmentInformation/02_DisciplineHistory.vue +++ /dev/null @@ -1,271 +0,0 @@ - - - diff --git a/src/modules/04_registryPerson/components/detail/GovernmentInformation/03_Leave.vue b/src/modules/04_registryPerson/components/detail/GovernmentInformation/03_Leave.vue index e98d8e134..8a3a31d27 100644 --- a/src/modules/04_registryPerson/components/detail/GovernmentInformation/03_Leave.vue +++ b/src/modules/04_registryPerson/components/detail/GovernmentInformation/03_Leave.vue @@ -1,6 +1,6 @@ + diff --git a/src/modules/04_registryPerson/components/detail/GovernmentInformation/03_LeaveHistory.vue b/src/modules/04_registryPerson/components/detail/GovernmentInformation/03_LeaveHistory.vue deleted file mode 100644 index 0682c4a7f..000000000 --- a/src/modules/04_registryPerson/components/detail/GovernmentInformation/03_LeaveHistory.vue +++ /dev/null @@ -1,334 +0,0 @@ - - - diff --git a/src/modules/04_registryPerson/components/detail/GovernmentInformation/04_PerformSpecialWork.vue b/src/modules/04_registryPerson/components/detail/GovernmentInformation/04_PerformSpecialWork.vue index 74cae954c..2f8f17a77 100644 --- a/src/modules/04_registryPerson/components/detail/GovernmentInformation/04_PerformSpecialWork.vue +++ b/src/modules/04_registryPerson/components/detail/GovernmentInformation/04_PerformSpecialWork.vue @@ -1,6 +1,6 @@ - - diff --git a/src/modules/04_registryPerson/components/detail/GovernmentInformation/05_ActingPos.vue b/src/modules/04_registryPerson/components/detail/GovernmentInformation/05_ActingPos.vue index b7ed1e294..cb189c9e0 100644 --- a/src/modules/04_registryPerson/components/detail/GovernmentInformation/05_ActingPos.vue +++ b/src/modules/04_registryPerson/components/detail/GovernmentInformation/05_ActingPos.vue @@ -8,12 +8,12 @@ import { useCounterMixin } from "@/stores/mixin"; import http from "@/plugins/http"; import config from "@/app.config"; -import type { QTableProps } from "quasar"; +import type { QTableColumn } from "quasar"; import type { DataActing } from "@/modules/04_registryPerson/interface/request/Government"; import type { ResActingPosData } from "@/modules/04_registryPerson/interface/response/Government"; import DialogHeader from "@/components/DialogHeader.vue"; -import DialogHistory from "@/modules/04_registryPerson/components/detail/GovernmentInformation/05_ActingPosHistory.vue"; +import DialogHistory from "@/modules/04_registryPerson/components/detail/DialogHistory.vue"; import DialogPreviewCommand from "@/modules/18_command/components/DialogPreviewCommand.vue"; const route = useRoute(); @@ -28,6 +28,7 @@ const { success, pathRegistryEmp, onSearchDataTable, + convertDateToAPI, } = mixin; const profileId = ref( @@ -40,12 +41,7 @@ const isLeave = defineModel("isLeave", { required: true, }); -/** Table*/ -const rows = ref([]); //รายการวินัย -const rowsMain = ref([]); //รายการวินัย -const mode = ref("table"); //การแสดงผล Table card -const filterKeyword = ref(""); //คำค้นหา -const columns = ref([ +const baseColumns = ref([ { name: "dateStart", align: "left", @@ -119,7 +115,17 @@ const columns = ref([ .toString() .localeCompare(b, undefined, { numeric: true, sensitivity: "base" }), }, - + { + name: "lastUpdateFullName", + align: "left", + label: "ผู้ดำเนินการ", + sortable: true, + field: "lastUpdateFullName", + headerStyle: "font-size: 14px", + style: "font-size: 14px", + sort: (a: string, b: string) => + a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }), + }, { name: "lastUpdatedAt", align: "left", @@ -133,19 +139,35 @@ const columns = ref([ a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }), }, ]); -const visibleColumns = ref([ +const baseVisibleColumns = ref([ "dateStart", "dateEnd", "posNo", "position", "refCommandNo", "status", + "lastUpdateFullName", "lastUpdatedAt", ]); + +/** Table*/ +const rows = ref([]); //รายการวินัย +const rowsMain = ref([]); //รายการวินัย +const mode = ref("table"); //การแสดงผล Table card +const filterKeyword = ref(""); //คำค้นหา +const columns = ref( + baseColumns.value.filter((e: QTableColumn) => e.name !== "lastUpdateFullName") +); +const visibleColumns = ref( + baseVisibleColumns.value.filter((e: string) => e !== "lastUpdateFullName") +); const pagination = ref({ sortBy: "lastUpdatedAt", }); +const columnsHistory = ref(baseColumns.value); +const visibleColumnsHistory = ref(baseVisibleColumns.value); + /** Dialog*/ const isStatusEdit = ref(false); const modal = ref(false); @@ -164,15 +186,6 @@ const formData = reactive({ status: false, }); -/** ฟังก์ค้นหาข้อมูลรายการ */ -function serchDataTable() { - rows.value = onSearchDataTable( - filterKeyword.value, - rowsMain.value, - columns.value ? columns.value : [] - ); -} - async function fetchData() { showLoader(); await http @@ -190,11 +203,28 @@ async function fetchData() { }); } +/** function fetch ข้อมูลประวติการแก้ไขข้อมูล*/ +async function fetchDataHistory() { + showLoader(); + try { + const res = await http.get( + config.API.profileActpositionHistory(rowId.value, empType.value) + ); + return res.data.result; + } catch (err) { + messageError($q, err); + } finally { + hideLoader(); + } +} + function onSubmit() { dialogConfirm($q, async () => { showLoader(); const body = { ...formData, + dateStart: convertDateToAPI(formData.dateStart), + dateEnd: convertDateToAPI(formData.dateEnd), profileId: isStatusEdit.value ? undefined : profileId.value, }; const method = isStatusEdit.value ? "patch" : "post"; @@ -252,6 +282,15 @@ function closeDialogForm() { formData.status = false; } +/** ฟังก์ค้นหาข้อมูลรายการ */ +function serchDataTable() { + rows.value = onSearchDataTable( + filterKeyword.value, + rowsMain.value, + columns.value ? columns.value : [] + ); +} + onMounted(() => { fetchData(); }); @@ -618,7 +657,14 @@ onMounted(() => { - + + -import { ref, watch } from "vue"; -import DialogHeader from "@/components/DialogHeader.vue"; -import { useCounterMixin } from "@/stores/mixin"; -import { useQuasar, type QTableProps } from "quasar"; - -import http from "@/plugins/http"; -import config from "@/app.config"; - -import type { ResponseObject } from "@/modules/04_registryPerson/interface/index/performSpecialWork"; -import { useRoute } from "vue-router"; - -const modal = defineModel("modal", { required: true }); -const id = defineModel("id", { required: true }); - -const route = useRoute(); -const $q = useQuasar(); -const mixin = useCounterMixin(); -const { - showLoader, - hideLoader, - messageError, - date2Thai, - pathRegistryEmp, - onSearchDataTable, -} = mixin; - -const empType = ref(pathRegistryEmp(route.name?.toString() ?? "")); - -const filterKeyword = ref(""); //คำค้นหา -const rows = ref([]); //data history -const rowsMain = ref([]); //data history -const columns = ref([ - { - name: "dateStart", - align: "left", - label: "วันที่เริ่มต้น", - sortable: true, - field: "dateStart", - format: (v) => date2Thai(v), - headerStyle: "font-size: 14px", - style: "font-size: 14px", - sort: (a: string, b: string) => - a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }), - }, - { - name: "dateEnd", - align: "left", - label: "วันที่สิ้นสุด", - sortable: true, - field: "dateEnd", - format: (v) => date2Thai(v), - headerStyle: "font-size: 14px", - style: "font-size: 14px", - sort: (a: string, b: string) => - a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }), - }, - { - name: "posNo", - align: "left", - label: "ตำแหน่งเลขที่", - sortable: true, - field: "posNo", - headerStyle: "font-size: 14px", - style: "font-size: 14px", - sort: (a: string, b: string) => - a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }), - }, - { - name: "position", - align: "left", - label: "ตำแหน่ง", - sortable: true, - field: "position", - headerStyle: "font-size: 14px", - style: "font-size: 14px", - sort: (a: string, b: string) => - a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }), - }, - { - name: "status", - align: "left", - label: "สถานะ", - sortable: true, - field: "status", - format(val, row) { - return row.status ? "ใช้งาน" : "-"; - }, - headerStyle: "font-size: 14px", - style: "font-size: 14px", - sort: (a: string, b: string) => - a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }), - }, - { - name: "lastUpdateFullName", - align: "left", - label: "ผู้ดำเนินการ", - sortable: true, - field: "lastUpdateFullName", - headerStyle: "font-size: 14px", - style: "font-size: 14px", - sort: (a: string, b: string) => - a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }), - }, - { - name: "lastUpdatedAt", - align: "left", - label: "วันที่แก้ไข", - sortable: true, - field: "lastUpdatedAt", - headerStyle: "font-size: 14px", - style: "font-size: 14px", - format: (v) => date2Thai(v, false, true), - sort: (a: string, b: string) => - a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }), - }, -]); -const visibleColumns = ref([ - "dateStart", - "dateEnd", - "posNo", - "position", - "status", - "lastUpdateFullName", - "lastUpdatedAt", -]); -const historyPagination = ref({ - sortBy: "lastUpdatedAt", -}); - -/** function fetch ข้อมูลประวติการแก้ไขข้อมูล*/ -function fetchDataHistory() { - showLoader(); - http - .get(config.API.profileActpositionHistory(id.value, empType.value)) - .then((res) => { - let data = res.data.result; - rows.value = data; - rowsMain.value = data; - }) - .catch((e) => { - messageError($q, e); - }) - .finally(() => { - hideLoader(); - }); -} - -function serchDataTable() { - rows.value = onSearchDataTable( - filterKeyword.value, - rowsMain.value, - columns.value ? columns.value : [] - ); -} - -/** - * ดูการเปลี่ยนแปลงของ modal - * ถ้า modal เป็น true เรียก fetchDataHistory เพิ่อดึงข้อมูลประวัติการแก้ไข - */ -watch(modal, (status) => { - if (status == true) { - fetchDataHistory(); - filterKeyword.value = ""; - } else { - filterKeyword.value = ""; - rows.value = []; - rowsMain.value = []; - } -}); - - - 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 b28eedd98..080625fbd 100644 --- a/src/modules/04_registryPerson/components/detail/GovernmentInformation/06_HelpGovernment.vue +++ b/src/modules/04_registryPerson/components/detail/GovernmentInformation/06_HelpGovernment.vue @@ -9,7 +9,7 @@ import { useCounterMixin } from "@/stores/mixin"; import http from "@/plugins/http"; import config from "@/app.config"; -import type { QTableProps } from "quasar"; +import type { QTableColumn } from "quasar"; import type { DatAssistance } from "@/modules/04_registryPerson/interface/request/Government"; import type { ResAssistanceData, @@ -17,7 +17,7 @@ import type { } from "@/modules/04_registryPerson/interface/response/Government"; import DialogHeader from "@/components/DialogHeader.vue"; -import DialogHistory from "@/modules/04_registryPerson/components/detail/GovernmentInformation/06_HelpGovernmentHistory.vue"; +import DialogHistory from "@/modules/04_registryPerson/components/detail/DialogHistory.vue"; import DialogPreviewCommand from "@/modules/18_command/components/DialogPreviewCommand.vue"; const route = useRoute(); @@ -32,6 +32,7 @@ const { success, pathRegistryEmp, onSearchDataTable, + convertDateToAPI, } = mixin; const profileId = ref( @@ -44,12 +45,7 @@ const isLeave = defineModel("isLeave", { required: true, }); -/** Table*/ -const rows = ref([]); //รายการวินัย -const rowsMain = ref([]); //รายการวินัย -const mode = ref("table"); //การแสดงผล Table card -const filterKeyword = ref(""); //คำค้นหา -const columns = ref([ +const baseColumns = ref([ { name: "agency", align: "left", @@ -107,6 +103,17 @@ const columns = ref([ sort: (a: string, b: string) => a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }), }, + { + name: "lastUpdateFullName", + align: "left", + label: "ผู้ดำเนินการ", + sortable: true, + field: "lastUpdateFullName", + headerStyle: "font-size: 14px", + style: "font-size: 14px", + sort: (a: string, b: string) => + a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }), + }, { name: "lastUpdatedAt", align: "left", @@ -120,15 +127,31 @@ const columns = ref([ a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }), }, ]); -const visibleColumns = ref([ +const baseVisibleColumns = ref([ "agency", "dateStart", "dateEnd", "commandNo", "document", + "lastUpdateFullName", "lastUpdatedAt", ]); +const columnsHistory = ref(baseColumns.value); +const visibleColumnsHistory = ref(baseVisibleColumns.value); + +/** Table*/ +const rows = ref([]); //รายการวินัย +const rowsMain = ref([]); //รายการวินัย +const mode = ref("table"); //การแสดงผล Table card +const filterKeyword = ref(""); //คำค้นหา + +const columns = ref( + baseColumns.value.filter((e: QTableColumn) => e.name !== "lastUpdateFullName") +); +const visibleColumns = ref( + baseVisibleColumns.value.filter((e: string) => e !== "lastUpdateFullName") +); const pagination = ref({ sortBy: "lastUpdatedAt", }); @@ -182,11 +205,28 @@ async function fetchData() { }); } +/** function fetch ข้อมูลประวติการแก้ไขข้อมูล*/ +async function fetchDataHistory() { + showLoader(); + try { + const res = await http.get( + config.API.profileAssistanceHistory(rowId.value, empType.value) + ); + return res.data.result; + } catch (err) { + messageError($q, err); + } finally { + hideLoader(); + } +} + function onSubmit() { dialogConfirm($q, async () => { showLoader(); const body = { ...formData, + dateStart: convertDateToAPI(formData.dateStart), + dateEnd: convertDateToAPI(formData.dateEnd), profileId: isStatusEdit.value ? undefined : profileId.value, isUpload: !isStatusEdit.value ? undefined : isUpload.value, }; @@ -825,7 +865,13 @@ onMounted(() => { - + -import { ref, watch } from "vue"; -import DialogHeader from "@/components/DialogHeader.vue"; -import { useCounterMixin } from "@/stores/mixin"; -import { useQuasar, type QTableProps } from "quasar"; - -import http from "@/plugins/http"; -import config from "@/app.config"; - -import type { ResponseObject } from "@/modules/04_registryPerson/interface/index/performSpecialWork"; -import { useRoute } from "vue-router"; - -const modal = defineModel("modal", { required: true }); -const id = defineModel("id", { required: true }); - -const route = useRoute(); -const $q = useQuasar(); -const mixin = useCounterMixin(); -const { - showLoader, - hideLoader, - messageError, - date2Thai, - pathRegistryEmp, - onSearchDataTable, -} = mixin; - -const empType = ref(pathRegistryEmp(route.name?.toString() ?? "")); - -const filterKeyword = ref(""); //คำค้นหา -const rows = ref([]); //data history -const rowsMain = ref([]); //data history -const columns = ref([ - { - name: "agency", - align: "left", - label: "หน่วยงานที่ให้ช่วยราชการ", - sortable: true, - field: "agency", - headerStyle: "font-size: 14px", - style: "font-size: 14px", - sort: (a: string, b: string) => - a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }), - }, - { - name: "dateStart", - align: "left", - label: "วันเริ่มช่วยราชการ", - sortable: true, - field: "dateStart", - format: (v) => date2Thai(v), - headerStyle: "font-size: 14px", - style: "font-size: 14px", - sort: (a: string, b: string) => - a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }), - }, - { - name: "dateEnd", - align: "left", - label: "วันสิ้นสุดการช่วยราชการ", - sortable: true, - field: "dateEnd", - format: (v) => date2Thai(v), - headerStyle: "font-size: 14px", - style: "font-size: 14px", - sort: (a: string, b: string) => - a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }), - }, - { - name: "commandNo", - align: "left", - label: "เลขที่คำสั่ง", - sortable: true, - field: "commandNo", - headerStyle: "font-size: 14px", - style: "font-size: 14px", - sort: (a: string, b: string) => - a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }), - }, - { - name: "document", - align: "left", - label: "เอกสารอ้างอิง", - sortable: true, - field: "document", - headerStyle: "font-size: 14px", - style: "font-size: 14px", - sort: (a: string, b: string) => - a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }), - }, - { - name: "lastUpdateFullName", - align: "left", - label: "ผู้ดำเนินการ", - sortable: true, - field: "lastUpdateFullName", - headerStyle: "font-size: 14px", - style: "font-size: 14px", - sort: (a: string, b: string) => - a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }), - }, - { - name: "lastUpdatedAt", - align: "left", - label: "วันที่แก้ไข", - sortable: true, - field: "lastUpdatedAt", - headerStyle: "font-size: 14px", - style: "font-size: 14px", - format: (v) => date2Thai(v, false, true), - sort: (a: string, b: string) => - a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }), - }, -]); -const visibleColumns = ref([ - "agency", - "dateStart", - "dateEnd", - "commandNo", - "document", - "lastUpdateFullName", - "lastUpdatedAt", -]); -const historyPagination = ref({ - sortBy: "lastUpdatedAt", -}); - -/** function fetch ข้อมูลประวติการแก้ไขข้อมูล*/ -function fetchDataHistory() { - showLoader(); - http - .get(config.API.profileAssistanceHistory(id.value, empType.value)) - .then((res) => { - let data = res.data.result; - rows.value = data; - rowsMain.value = rows.value; - }) - .catch((e) => { - messageError($q, e); - }) - .finally(() => { - hideLoader(); - }); -} - -function serchDataTable() { - rows.value = onSearchDataTable( - filterKeyword.value, - rowsMain.value, - columns.value ? columns.value : [] - ); -} - -/** - * ดูการเปลี่ยนแปลงของ modal - * ถ้า modal เป็น true เรียก fetchDataHistory เพิ่อดึงข้อมูลประวัติการแก้ไข - */ -watch(modal, (status) => { - if (status == true) { - fetchDataHistory(); - filterKeyword.value = ""; - } else { - filterKeyword.value = ""; - } -}); - - - diff --git a/src/modules/04_registryPerson/components/detail/GovernmentInformation/07_Position.vue b/src/modules/04_registryPerson/components/detail/GovernmentInformation/07_Position.vue index 6187ac38a..2a96b3d98 100644 --- a/src/modules/04_registryPerson/components/detail/GovernmentInformation/07_Position.vue +++ b/src/modules/04_registryPerson/components/detail/GovernmentInformation/07_Position.vue @@ -9,7 +9,7 @@ import { useGovernmentPosDataStore } from "@/modules/04_registryPerson/stores/Po import http from "@/plugins/http"; import config from "@/app.config"; -import type { QTableProps } from "quasar"; +import type { QTableColumn } from "quasar"; import type { DataOption } from "@/modules/04_registryPerson/interface/index/Main"; import type { FormPostition } from "@/modules/04_registryPerson/interface/index/government"; import type { @@ -25,7 +25,7 @@ import type { ResListSalary } from "@/modules/04_registryPerson/interface/respon import type { DataCardPos } from "@/modules/04_registryPerson/interface/index/government"; import DialogHeader from "@/components/DialogHeader.vue"; -import DialogHistory from "@/modules/04_registryPerson/components/detail/GovernmentInformation/07_PositionHistory.vue"; +import DialogHistory from "@/modules/04_registryPerson/components/detail/DialogHistory.vue"; import DialogPreviewCommand from "@/modules/18_command/components/DialogPreviewCommand.vue"; const $q = useQuasar(); @@ -51,19 +51,12 @@ const { onSearchDataTable, formatDatePosition, findOrgName, - convertDateToAPI + convertDateToAPI, } = useCounterMixin(); const empType = ref(pathRegistryEmp(route.name?.toString() ?? "")); -//Table -const rows = ref([]); //รายการตำแหน่งเงินเดือน -const rowsMain = ref([]); //รายการตำแหน่งเงินเดือน -const keyword = ref(""); //คำค้นหา -const modalCommand = ref(false); -const command = ref(""); -const commandId = ref(""); -const baseColumns = ref([ +const baseColumns = ref([ { name: "commandDateAffect", align: "left", @@ -88,7 +81,7 @@ const baseColumns = ref([ style: "font-size: 14px", format(val, row) { return row.posNoAbb && row.posNo - ? `${row.posNoAbb}.${row.posNo}` + ? `${row.posNoAbb}${row.posNo}` : row.posNo ? row.posNo : "-"; @@ -252,20 +245,35 @@ const baseColumns = ref([ sort: (a: string, b: string) => a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }), }, + { + name: "lastUpdateFullName", + align: "left", + label: "ผู้ดำเนินการ", + sortable: true, + field: "lastUpdateFullName", + headerStyle: "font-size: 14px", + style: "font-size: 14px", + sort: (a: string, b: string) => + a + .toString() + .localeCompare(b, undefined, { numeric: true, sensitivity: "base" }), + }, + { + name: "lastUpdatedAt", + align: "left", + label: "วันที่แก้ไข", + sortable: true, + field: "lastUpdatedAt", + headerStyle: "font-size: 14px", + style: "font-size: 14px", + format: (v) => date2Thai(v, false, true), + sort: (a: string, b: string) => + a + .toString() + .localeCompare(b, undefined, { numeric: true, sensitivity: "base" }), + }, ]); -const columns = computed(() => { - if (empType.value === "-employee") { - if (baseColumns.value) { - return baseColumns.value.filter( - (column) => - column.name !== "positionSalaryAmount" && - column.name !== "mouthSalaryAmount" - ); - } - } - return baseColumns.value; -}); -const visibleColumns = ref([ +const baseVisibleColumns = ref([ "commandDateAffect", "posNo", "positionName", @@ -278,7 +286,29 @@ const visibleColumns = ref([ "commandDateSign", "organization", "remark", + "lastUpdateFullName", + "lastUpdatedAt", ]); + +//Table +const rows = ref([]); //รายการตำแหน่งเงินเดือน +const rowsMain = ref([]); //รายการตำแหน่งเงินเดือน +const keyword = ref(""); //คำค้นหา +const modalCommand = ref(false); +const command = ref(""); +const commandId = ref(""); + +const columns = ref( + baseColumns.value.filter( + (e: QTableColumn) => + e.name !== "lastUpdateFullName" && e.name !== "lastUpdatedAt" + ) +); +const visibleColumns = ref( + baseVisibleColumns.value.filter( + (e: string) => e !== "lastUpdateFullName" && e !== "lastUpdatedAt" + ) +); const pagination = ref({ sortBy: "", }); @@ -296,6 +326,7 @@ const formData = reactive({ positionType: "", //ประเภทตำแหน่ง | กลุ่มงาน positionLevel: "", //ระดับตำแหน่ง | ระดับชั้นงาน positionLine: "", // สายงาน + positionCee: "", //ระดับซี positionPathSide: "", //ด้าน/สาขา positionExecutive: "", //ตำแหน่งทางการบริหาร amount: null, //เงินเดือน @@ -308,6 +339,9 @@ const formData = reactive({ remark: "", //หมายเหตุ }); +const columnsHistory = ref(baseColumns.value); +const visibleColumnsHistory = ref(baseVisibleColumns.value); + const modalDialogSalary = ref(false); //แสดง popup ตำแหน่งเงินเดือน const isStatusEdit = ref(false); //สถานะแก้ไขข้อมูลตำแหน่งเงินเดือน const salaryId = ref(""); //id ที่ต้องการแก้ไข @@ -504,7 +538,7 @@ async function fetchDataTenure() { // นำข้อมูลไปใส่ใน cardData cardData.value[0].data = position; cardData.value[1].data = posLevel; - if (empType.value !== "-employee") { + if (empType.value !== "-employee" && cardData.value.length > 2) { cardData.value[2].data = posExecutive; } @@ -529,9 +563,9 @@ async function fetchDataTenure() { * @param status แก่ไข , เพิ่ม */ async function updateSelectType(val: string, status: boolean = false) { - const listLevel = dataLevel.value.find( - (e: DataPosType) => e.posTypeName === val - ); + const listLevel = val + ? dataLevel.value.find((e: DataPosType) => e.posTypeName === val) + : null; if (listLevel) { store.posLevelData = listLevel.posLevels.map((e: DataPosLevel) => ({ @@ -543,6 +577,9 @@ async function updateSelectType(val: string, status: boolean = false) { })); formData.positionLevel = !status ? "" : formData.positionLevel; + } else { + store.posLevelData = []; + formData.positionLevel = ""; } } @@ -588,6 +625,7 @@ async function onClickOpenDialog( formData.positionName = statusEdit ? data.positionName : ""; formData.positionType = statusEdit ? data.positionType : ""; formData.positionLevel = statusEdit ? data.positionLevel : ""; + formData.positionCee = statusEdit ? data.positionCee : ""; formData.positionLine = statusEdit ? data.positionLine : ""; formData.positionPathSide = statusEdit ? data.positionPathSide : ""; formData.positionExecutive = statusEdit ? data.positionExecutive : ""; @@ -736,6 +774,22 @@ function serchDataTable() { ); } +/** function fetch ข้อมูลประวัติการแก้ไข*/ +async function fetchDataHistory() { + showLoader(); + try { + const res = await http.get( + config.API.profileListSalaryHistoryNew(salaryId.value, empType.value) + ); + + return res.data.result; + } catch (err) { + messageError($q, err); + } finally { + hideLoader(); + } +} + function classInput(val: boolean) { return { "full-width inputgreen cursor-pointer": val, @@ -913,7 +967,8 @@ onMounted(async () => {
-
+
+ { fill-input input-debounce="0" @update:model-value="updateSelectType" - :rules="[(val: string) => !!val || 'กรุณาเลือกประเภทคำสั่ง']" @filter="(inputValue: string, doneFn: Function) => filterSelector(inputValue, doneFn, 'commandCode' )" @@ -948,7 +1002,43 @@ onMounted(async () => {
-
+
+ + + + + + +
+ +
{ :label="`${'เลขที่คำสั่ง'}`" />
- +
+ { : formData.commandYear + 543 " :label="`${'พ.ศ.'}`" - :rules="[(val:string) => !!val || `${'กรุณากรอก พ.ศ.'}`]" > diff --git a/src/modules/04_registryPerson/components/detail/PersonalInformation/04_FamilyNew.vue b/src/modules/04_registryPerson/components/detail/PersonalInformation/04_FamilyNew.vue index efed70aa5..6305f3d9c 100644 --- a/src/modules/04_registryPerson/components/detail/PersonalInformation/04_FamilyNew.vue +++ b/src/modules/04_registryPerson/components/detail/PersonalInformation/04_FamilyNew.vue @@ -9,7 +9,7 @@ import { useCounterMixin } from "@/stores/mixin"; import http from "@/plugins/http"; import config from "@/app.config"; -import type { QTableProps } from "quasar"; +import type { QTableColumn } from "quasar"; import type { DataOption } from "@/modules/04_registryPerson/interface/index/Main"; import type { FormPerson, @@ -17,6 +17,7 @@ import type { } from "@/modules/04_registryPerson/interface/index/family"; import DialogHeader from "@/components/DialogHeader.vue"; +import DialogHistory from "@/modules/04_registryPerson/components/detail/DialogHistory.vue"; const $q = useQuasar(); const route = useRoute(); @@ -30,7 +31,6 @@ const { messageError, success, pathRegistryEmp, - onSearchDataTable, } = useCounterMixin(); /** props*/ @@ -43,9 +43,7 @@ const profileId = ref( const empType = ref(pathRegistryEmp(route.name?.toString() ?? "")); /** TableHisoty*/ -const rows = ref([]); -const rowsMain = ref([]); -const visibleColumns = ref([ +const visibleColumns = ref([ "statusMarital", "citizenId", "prefix", @@ -57,7 +55,7 @@ const visibleColumns = ref([ "lastUpdateFullName", "lastUpdatedAt", ]); -const columns = ref([ +const columns = ref([ { name: "statusMarital", align: "left", @@ -151,9 +149,6 @@ const columns = ref([ format: (val) => date2Thai(val, false, true), }, ]); -const pagination = ref({ - sortBy: "lastUpdatedAt", -}); /** ข้อมูล*/ const fatherData = reactive({ @@ -190,6 +185,7 @@ const modalHistory = ref(false); const filterHistory = ref(""); const titleForm = ref(""); const typeForm = ref(""); +const historyId = ref(""); const isEdit = ref(false); const childernId = ref(""); @@ -353,7 +349,6 @@ function closeDialog() { fromData.job = ""; fromData.lastNameOld = ""; fromData.statusMarital = ""; - rows.value = []; filterHistory.value = ""; } @@ -418,10 +413,9 @@ function onOpenDialogForm( * @param id */ async function onOpenDialogHistory(type: string, id: string = "") { - modalHistory.value = true; typeForm.value = type; - const historyId = type === "children" ? id : profileId.value; - await fetchHistory(historyId, type); + historyId.value = type === "children" ? id : profileId.value; + modalHistory.value = true; } /** function fetch ข้อมูลความสัมพันธ์ */ @@ -453,59 +447,41 @@ function filterSelectorRelation(val: string, update: Function) { }); } -/** - * function fetch ข้อมูลประวัติการแก้ไขข้อมูล - * @param id - * @param type - */ -async function fetchHistory(id: string, type: string) { +async function fetchDataHistory() { showLoader(); - await http - .get(config.API.profileFamilyHistory(id, empType.value, type)) - .then(async (res) => { - const data = await res.data.result; - rows.value = await data.map((e: any) => ({ - citizenId: e[`${type}CitizenId`], - prefix: e[`${type}Prefix`], - firstName: e[`${type}FirstName`], - lastName: e[`${type}LastName`], - job: e[`${type}Career`], - isLive: e[`${type}Live`], - lastNameOld: - type === "couple" - ? e.coupleLastNameOld - : type === "mother" - ? e.motherLastNameOld - : undefined, - lastUpdateFullName: e.lastUpdateFullName, - lastUpdatedAt: e.lastUpdatedAt, - statusMarital: type === "couple" ? e.relationship : undefined, - })); - rowsMain.value = rows.value; - }) - .catch((err) => { - messageError($q, err); - }) - .finally(() => { - hideLoader(); - }); -} + try { + const res = await http.get( + config.API.profileFamilyHistory( + historyId.value, + empType.value, + typeForm.value + ) + ); -/** ฟังก์ค้นหาข้อมูลรายการประวัติแก้ไขข้อมูล */ -function serchDataTable() { - const baseColumns = - typeForm.value === "couple" - ? columns.value - : typeForm.value === "mother" - ? columns.value?.filter((e) => e.name !== "statusMarital") - : columns.value?.filter( - (e) => e.name !== "lastNameOld" && e.name !== "statusMarital" - ); - rows.value = onSearchDataTable( - filterHistory.value, - rowsMain.value, - baseColumns ? baseColumns : [] - ); + const data = await res.data.result.map((e: any) => ({ + citizenId: e[`${typeForm.value}CitizenId`], + prefix: e[`${typeForm.value}Prefix`], + firstName: e[`${typeForm.value}FirstName`], + lastName: e[`${typeForm.value}LastName`], + job: e[`${typeForm.value}Career`], + isLive: e[`${typeForm.value}Live`], + lastNameOld: + typeForm.value === "couple" + ? e.coupleLastNameOld + : typeForm.value === "mother" + ? e.motherLastNameOld + : undefined, + lastUpdateFullName: e.lastUpdateFullName, + lastUpdatedAt: e.lastUpdatedAt, + statusMarital: typeForm.value === "couple" ? e.relationship : undefined, + })); + + return data; + } catch (err) { + messageError($q, err); + } finally { + hideLoader(); + } } /** ทำงานเมื่อ Components ถูกเรียกใช้งาน*/ @@ -1073,100 +1049,29 @@ onMounted(async () => { - - - - - - -
- - - - - -
- - - > - - - -
-
-
+ diff --git a/src/modules/04_registryPerson/components/detail/PersonalInformation/05_Education.vue b/src/modules/04_registryPerson/components/detail/PersonalInformation/05_Education.vue index 0dc06d5c4..222fa2033 100644 --- a/src/modules/04_registryPerson/components/detail/PersonalInformation/05_Education.vue +++ b/src/modules/04_registryPerson/components/detail/PersonalInformation/05_Education.vue @@ -1,4 +1,3 @@ -div + diff --git a/src/modules/04_registryPerson/components/requestEdit/02_TabIDP.vue b/src/modules/04_registryPerson/components/requestEdit/02_TabIDP.vue index 716ebd786..b9e87fb87 100644 --- a/src/modules/04_registryPerson/components/requestEdit/02_TabIDP.vue +++ b/src/modules/04_registryPerson/components/requestEdit/02_TabIDP.vue @@ -192,7 +192,6 @@ function clearStatus() { */ function filterOption(val: string, update: Function) { update(() => { - status.value = val ? "" : status.value; statusOption.value = store.optionStatusIDP.filter( (v: DataOption) => v.name.indexOf(val) > -1 ); @@ -284,6 +283,7 @@ watch( } ); +/** HooK lifecycle ทำงานเมื่อมีการเรียกใช้งาน Componenets */ onMounted(() => { props.isIdp && fetchData(); }); diff --git a/src/modules/04_registryPerson/components/requestEdit/Page02_DetailIDP.vue b/src/modules/04_registryPerson/components/requestEdit/Page02_DetailIDP.vue index 056d116ac..89bc1289b 100644 --- a/src/modules/04_registryPerson/components/requestEdit/Page02_DetailIDP.vue +++ b/src/modules/04_registryPerson/components/requestEdit/Page02_DetailIDP.vue @@ -203,7 +203,6 @@ onMounted(() => {
- ( ); onBeforeMount(async () => { - isIDP.value = await (route.name?.toString() == "registryNewRequestEditEMP" - ? false - : true); + isIDP.value = + route.name?.toString() == "registryNewRequestEditEMP" ? false : true; }); onMounted(() => { diff --git a/src/modules/05_placement/components/AppointMent/AppointMentDetail.vue b/src/modules/05_placement/components/AppointMent/AppointMentDetail.vue index 31c93a36d..f89bcba65 100644 --- a/src/modules/05_placement/components/AppointMent/AppointMentDetail.vue +++ b/src/modules/05_placement/components/AppointMent/AppointMentDetail.vue @@ -25,6 +25,7 @@ const { hideLoader, success, dialogConfirm, + convertDateToAPI } = useCounterMixin(); const paramsId = route.params.id; //id รายการที่เลือก @@ -90,7 +91,7 @@ function putAppointment() { positionNumberOld: posNo.value, amountOld: salary.value.toString().replace(/,/g, ""), reason: reason.value, - positionDate: date.value, + positionDate: convertDateToAPI(date.value), }; showLoader(); await http diff --git a/src/modules/05_placement/components/Help-Government/HelpGovernmentDetail.vue b/src/modules/05_placement/components/Help-Government/HelpGovernmentDetail.vue index 5ccf51fd4..a3b5a16c4 100644 --- a/src/modules/05_placement/components/Help-Government/HelpGovernmentDetail.vue +++ b/src/modules/05_placement/components/Help-Government/HelpGovernmentDetail.vue @@ -29,6 +29,7 @@ const { hideLoader, success, findOrgName, + convertDateToAPI } = mixin; const dataId = route.params.id as string; @@ -83,8 +84,8 @@ function onSubmit() { const body = { organizationPositionOld: organizationPositionOld.value, organization: organization.value, - dateStart: dateStart.value, - dateEnd: dateEnd.value, + dateStart: convertDateToAPI(dateStart.value), + dateEnd: convertDateToAPI(dateEnd.value), reason: reason.value, }; await http diff --git a/src/modules/05_placement/components/Other/OtherDetail.vue b/src/modules/05_placement/components/Other/OtherDetail.vue index 7abc5c3a5..f89603145 100644 --- a/src/modules/05_placement/components/Other/OtherDetail.vue +++ b/src/modules/05_placement/components/Other/OtherDetail.vue @@ -29,6 +29,7 @@ const { dialogConfirm, findOrgName, success, + convertDateToAPI, } = mixin; const paramsId = route.params.id; @@ -98,8 +99,8 @@ function onSubmit() { positionLevelOld: positionLevelOld.value, positionNumberOld: posNo.value, amountOld: salary.value.toString().replace(/,/g, ""), - positionDate: date.value, - militaryDate: militaryDate.value, + positionDate: convertDateToAPI(date.value), + militaryDate: convertDateToAPI(militaryDate.value), reason: reason.value, }; await http diff --git a/src/modules/05_placement/components/PersonalDetail/DialogCheckInformation.vue b/src/modules/05_placement/components/PersonalDetail/DialogCheckInformation.vue index d0ff69c33..461dfcbe3 100644 --- a/src/modules/05_placement/components/PersonalDetail/DialogCheckInformation.vue +++ b/src/modules/05_placement/components/PersonalDetail/DialogCheckInformation.vue @@ -1,7 +1,7 @@