diff --git a/src/components/LoginLinkage.vue b/src/components/LoginLinkage.vue index baf5cc4cc..026d2b6e3 100644 --- a/src/components/LoginLinkage.vue +++ b/src/components/LoginLinkage.vue @@ -7,13 +7,7 @@ const modal = defineModel("modal", { required: true }); const step = ref(1); const devices = ref(""); -const devicesData = ref([ - "Generic", - "EMV", - "Smartcard", - "Reader", - "0", -]); +const devicesData = ref(["Generic EMV Smartcard Reader0"]); const devicesOp = ref([]); /** 1.เสียบบัตรประชาชนเข้ากับเครื่องอ่าน*/ diff --git a/src/modules/04_registryPerson/components/requestEdit/02_TabIDP.vue b/src/modules/04_registryPerson/components/requestEdit/02_TabIDP.vue index f34761819..4f20b06bc 100644 --- a/src/modules/04_registryPerson/components/requestEdit/02_TabIDP.vue +++ b/src/modules/04_registryPerson/components/requestEdit/02_TabIDP.vue @@ -47,6 +47,15 @@ const columns = ref([ headerStyle: "font-size: 14px", style: "font-size: 14px", }, + { + name: "createdFullName", + align: "left", + label: "ผู้ยื่นขอ", + sortable: true, + field: "createdFullName", + headerStyle: "font-size: 14px", + style: "font-size: 14px", + }, { name: "name", align: "left", @@ -124,6 +133,7 @@ const columns = ref([ ]); const visibleColumns = ref([ "createdAt", + "createdFullName", "name", "developmentProjects", "developmentTarget", diff --git a/src/modules/04_registryPerson/components/requestEdit/Dialog02_EditIDP.vue b/src/modules/04_registryPerson/components/requestEdit/Dialog02_EditIDP.vue index 2dae1f215..9ce760a0c 100644 --- a/src/modules/04_registryPerson/components/requestEdit/Dialog02_EditIDP.vue +++ b/src/modules/04_registryPerson/components/requestEdit/Dialog02_EditIDP.vue @@ -17,8 +17,14 @@ import DialogHeader from "@/components/DialogHeader.vue"; const $q = useQuasar(); const store = useRequestEditStore(); -const { dialogConfirm, showLoader, hideLoader, messageError, success } = - useCounterMixin(); +const { + dialogConfirm, + showLoader, + hideLoader, + messageError, + success, + date2Thai, +} = useCounterMixin(); const modal = defineModel("modal", { required: true }); //เปิด,ปิด popup แก้ไขสถานะคำร้อง const requestId = defineModel("requestId", { required: true }); // id ที่ต้องการแก้ไข @@ -40,6 +46,8 @@ const formData = reactive({ developmentReport: "", //รายงานผลการพัฒนา status: "", //สถานะ reason: "", //หมายเหตุ + createdFullName: "", //ผู้ขอแก้ไข + createdAt: null, //เวลาที่แก้ไข }); //70 การลงมือปฏิบัติ (โดยผู้บังคับบัญชามอบหมาย) @@ -151,6 +159,8 @@ function fetchDataByid(id: string) { formData.reasonDevelopment10 = data.reasonDevelopment10; formData.status = data.status; formData.reason = data.reason; + formData.createdFullName = data.createdFullName; + formData.createdAt = data.createdAt; }) .catch((err) => { messageError($q, err); @@ -213,6 +223,8 @@ function closeDialog() { formData.developmentReport = ""; formData.status = ""; formData.reason = ""; + formData.createdFullName = ""; + formData.createdAt = null; } /** @@ -241,16 +253,22 @@ watch(modal, (val) => { - + -
+
@@ -297,6 +315,8 @@ watch(modal, (val) => {
+ + บันทึก { const insignia = ref(""); - const insigniaOp = ref([{ name: "ทั้งหมด", id: "" }]); - const insigniaOp2 = ref([]); - const insigniaType = ref(); + const insigniaOp = ref([{ name: "ทั้งหมด", id: "" }]); + const insigniaOp2 = ref([]); + const insigniaType = ref([]); const invoiceType = ref("all"); const invoiceTypeop = ref([ { name: "ทั้งหมด", id: "all" }, @@ -26,20 +36,20 @@ export const useResultDataStore = defineStore("insigniaResult", () => { { name: "ข้าราชการ กทม.สามัญ", id: "officer" }, { name: "ลูกจ้างประจำ", id: "employee" }, ]); - const rows = ref([]); - const listInsignia = ref([]); - const type = ref([]); + const rows = ref([]); + const listInsignia = ref([]); + const type = ref([]); /** * function เรียกประเภทเครื่องราช * @param data ประเภทเครื่องราช */ - async function fetchDatainsignia(data: any) { + async function fetchDatainsignia(data: ResponseInsigniaType[]) { insignia.value = ""; invoiceType.value = "all"; insigniaOp.value = [{ name: "ทั้งหมด", id: "" }]; insigniaOp2.value = []; - data.forEach((e: any) => { + data.forEach((e: ResponseInsigniaType) => { insigniaOp.value.push({ name: `${e.name} (${e.shortName})`, id: e.id, @@ -47,10 +57,10 @@ export const useResultDataStore = defineStore("insigniaResult", () => { }); }); - data.forEach((e: any) => { + data.forEach((e: ResponseInsigniaType) => { insigniaOp2.value.push({ name: `${e.name} (${e.shortName})`, id: e.id }); }); - data.forEach((e: any) => { + data.forEach((e: ResponseInsigniaType) => { type.value.push({ name: e.name, shortName: e.shortName, @@ -62,23 +72,28 @@ export const useResultDataStore = defineStore("insigniaResult", () => { * function เรียกประเภทเครื่องราช * @param data ประเภทเครื่องราช */ - async function fetchDatainsigniaType(data: any) { - insigniaType.value = data.map((e: any) => ({ name: e.id, label: e.name })); + async function fetchDatainsigniaType(data: ResponseInsigniaType[]) { + insigniaType.value = data.map((e: ResponseInsigniaType) => ({ + name: e.id, + label: e.name, + })); } /** * function บันทึกผลการได้รับพระราชทานเครื่องราชอิสริยาภรณ์/การจ่ายใบกำกับ * @param data รายชื่อข้าราชการสามัญฯ */ - async function fetchlistinsignia(data: any) { + async function fetchlistinsignia(data: ResponseRecordLists[]) { + console.log(data); + rows.value = []; - let alllist = await data.map((e: any) => ({ + const alllist = await data.map((e: ResponseRecordLists) => ({ id: e.id, citizenId: e.citizenId, prefix: e.prefix, position: e.position, - status: status(e.status), - dateReceive: date2Thai(e.dateReceive), + status: status(e.status) ?? "", + dateReceive: e.dateReceive ?? date2Thai(e.dateReceive), name: e.fullName, type: `${e.requestInsignia} (${ type.value.find((item) => item.name === e.requestInsignia)?.shortName || @@ -88,13 +103,13 @@ export const useResultDataStore = defineStore("insigniaResult", () => { e.profileType === "" ? "officer" : e.profileType ), profileType: e.profileType === "" ? "officer" : e.profileType, - date: date2Thai(e.date), + date: e.date ?? date2Thai(e.date), volumeNo: e.volumeNo, section: e.section, page: e.page, number: e.no, vatnumber: e.number, - datepay: date2Thai(e.datePayment), + datepay: e.datePayment ?? date2Thai(e.datePayment), typepay: e.typePayment, address: e.address, dateReceiveInsignia: e.dateReceiveInsignia, @@ -104,6 +119,7 @@ export const useResultDataStore = defineStore("insigniaResult", () => { orgReceiveInsignia: e.orgReceiveInsignia, orgReturnInsignia: e.orgReturnInsignia, })); + rows.value = alllist; listInsignia.value = alllist; searchData(invoiceType.value, employeeClass.value); @@ -129,7 +145,7 @@ export const useResultDataStore = defineStore("insigniaResult", () => { rows.value = list; } else if (invoice === "all" && employeeClass !== "all") { let list = listInsignia.value.filter( - (e: any) => e.employeeType === profileType(employeeClass) + (e: DataRecord) => e.employeeType === profileType(employeeClass) ); rows.value = list; } else if (invoice === "all" && employeeClass == "all") { @@ -158,27 +174,29 @@ export const useResultDataStore = defineStore("insigniaResult", () => { * function convert สถานภาพ * @param val สถานภาพ */ - const profileType = (val: string) => { - switch (val) { + function profileType(val: string) { + const newVal = val.toLocaleLowerCase(); + switch (newVal) { case "officer": return "ข้าราชการ กทม.สามัญ"; case "employee": return "ลูกจ้างประจำ"; } - }; + } /** * function convert สถานะ การจ่าย * @param val สถานะ การจ่าย */ - const convertDatepay = (val: any) => { + function convertDatepay(val: string | null) { switch (val) { case null: return "noDate"; default: return "haveDate"; } - }; + } + return { rows, insignia, @@ -195,7 +213,5 @@ export const useResultDataStore = defineStore("insigniaResult", () => { profileType, fetchlistinsignia, searchData, - // selectInvoice, - // selectEmployeeClass, }; }); diff --git a/src/modules/07_insignia/views/03_ResultMain.vue b/src/modules/07_insignia/views/03_ResultMain.vue index cbcc9c81e..48d67a952 100644 --- a/src/modules/07_insignia/views/03_ResultMain.vue +++ b/src/modules/07_insignia/views/03_ResultMain.vue @@ -229,7 +229,7 @@ const visibleColumns = ref([ "dateReceive", "date", "employeeType", - "volumeNo", + " ", "section", "page", "number", diff --git a/src/modules/11_discipline/components/1_Complaint/EditPage.vue b/src/modules/11_discipline/components/1_Complaint/EditPage.vue index 868d78895..f0eb3f714 100644 --- a/src/modules/11_discipline/components/1_Complaint/EditPage.vue +++ b/src/modules/11_discipline/components/1_Complaint/EditPage.vue @@ -13,7 +13,7 @@ import type { FormData, ArrayPerson, ArrayFileList, -} from "@/modules/11_discipline/interface/request/Complaint"; +} from "@/modules/11_discipline/interface/request/complaint"; import Form from "@/modules/11_discipline/components/1_Complaint/Form.vue"; import PopupSendToNext from "@/modules/11_discipline/components/PopupSendToNext.vue"; @@ -163,16 +163,17 @@ const visibleColumns = ref([ "organization", ]); - - /** ดึงข้อมูล */ async function getData() { showLoader(); await http .get( - config.API.complaintbyGetId(id.value, mainStore.pathComplaints(route.name as string)) + config.API.complaintbyGetId( + id.value, + mainStore.pathComplaints(route.name as string) + ) ) - .then((res) => { + .then(async (res) => { const dataList = res.data.result; data.id = dataList.id; data.respondentType = dataList.respondentType; @@ -194,8 +195,7 @@ async function getData() { data.result = dataList.result; data.disciplineComplaintDocs = dataList.disciplineComplaintDocs; data.activeId = dataList.activeId; - - mainStore.fetchDataRowsSend(dataList.persons); + await mainStore.fetchDataRowsSend(dataList.persons); }) .catch((e) => { messageError($q, e); @@ -214,8 +214,8 @@ async function onSubmit(data: any) { http .put(config.API.complaintbyId(id.value), data) - .then((res) => { - getData(); + .then(async () => { + await getData(); success($q, "บันทึกข้อมูลสำเร็จ"); }) .catch((e) => { @@ -233,31 +233,28 @@ function sentInvestigate() { } else { dialogConfirm( $q, - () => sentConfirmNoPerson(), + () => { + showLoader(); + http + .put(config.API.complaintApprove(id.value), { + persons: [], + }) + .then(() => { + router.push(`/discipline/complaints`); + }) + .catch((e) => { + messageError($q, e); + }) + .finally(() => { + hideLoader(); + }); + }, "ยืนยันส่งไปสืบสวน", "ต้องการยืนยันยืนยันส่งไปสืบสวนใช่หรือไม่?" ); } } -/** ส่งไปสืบสวน */ -function sentConfirmNoPerson() { - showLoader(); - http - .put(config.API.complaintApprove(id.value), { - persons: [], - }) - .then((res) => { - router.push(`/discipline/complaints`); - }) - .catch((e) => { - messageError($q, e); - }) - .finally(() => { - hideLoader(); - }); -} - /** ปิด dialog */ function closePopup() { modalPopup.value = false; @@ -267,7 +264,21 @@ function closePopup() { function endInvestigate() { dialogConfirm( $q, - () => confirmEndInvestigate(), + () => { + showLoader(); + http + .get(config.API.complaintReject(id.value)) + .then(async () => { + await getData(); + success($q, "ยุติเรื่องสำเร็จ"); + }) + .catch((e) => { + messageError($q, e); + }) + .finally(async () => { + hideLoader(); + }); + }, "ยืนยันยุติเรื่อง", "ต้องการยืนยันยุติเรื่องใช่หรือไม่?" ); @@ -277,58 +288,38 @@ function endInvestigate() { function cancelInvestigate() { dialogConfirm( $q, - () => confirmCancelInvestigate(), + () => { + showLoader(); + http + .get(config.API.complaintResume(id.value)) + .then(async () => { + await getData(); + success($q, "ยกเลิกยุติเรื่องสำเร็จ"); + }) + .catch((e) => { + messageError($q, e); + }) + .finally(() => { + hideLoader(); + }); + }, "ยืนยันยกเลิกการยุติเรื่อง", "ต้องการยืนยันยกเลิกการยุติเรื่องใช่หรือไม่?" ); } -/** ฟังชั่น ยุติเรื่อง*/ -function confirmEndInvestigate() { - showLoader(); - http - .get(config.API.complaintReject(id.value)) - .then((res) => { - success($q, "ยุติเรื่องสำเร็จ"); - }) - .catch((e) => { - messageError($q, e); - }) - .finally(async () => { - await getData(); - }); -} - -/** ฟังชั่น ยกเลิกการยุติเรื่อง*/ -function confirmCancelInvestigate() { - showLoader(); - http - .get(config.API.complaintResume(id.value)) - .then((res) => { - getData(); - }) - .catch((e) => { - messageError($q, e); - }) - .finally(() => { - hideLoader(); - success($q, "ยกเลิกยุติเรื่องสำเร็จ"); - }); -} - /** * ดึงข้อมูล จาก component เเล้ว update * @param data person data */ function sendPersonToNext(data: ArrayPerson[]) { const dataMapId = data.map((item: ArrayPerson) => item.id); - showLoader(); http .put(config.API.complaintApprove(id.value), { persons: dataMapId, }) - .then((res) => { + .then(() => { router.push(`/discipline/complaints`); }) .catch((e) => { @@ -340,8 +331,8 @@ function sendPersonToNext(data: ArrayPerson[]) { } /** เรียกใช้งาน ฟังชั่น ตอนเริ่มโหลดหน้า */ -onMounted(() => { - getData(); +onMounted(async () => { + await getData(); }); diff --git a/src/modules/11_discipline/components/1_Complaint/Form.vue b/src/modules/11_discipline/components/1_Complaint/Form.vue index 5ff90b2e2..e52e7e92a 100644 --- a/src/modules/11_discipline/components/1_Complaint/Form.vue +++ b/src/modules/11_discipline/components/1_Complaint/Form.vue @@ -14,7 +14,7 @@ import type { DataOption } from "@/modules/11_discipline/interface/index/Main"; import type { FormData, ArrayFileList, -} from "@/modules/11_discipline/interface/request/Complaint"; +} from "@/modules/11_discipline/interface/request/complaint"; import PopupPersonal from "@/components/Dialogs/PopupPersonalNew.vue"; import DialogAddPersonal from "@/components/Dialogs/AddPersonal.vue"; @@ -133,8 +133,6 @@ function onSubmit() { if (mainStore.rowsAdd) { formData.persons = await mainStore.rowsAdd; } - console.log("formData===>", formData); - await props.onSubmit(formData); isSave.value = false; }); @@ -156,9 +154,9 @@ function confirmDelete(id: string) { showLoader(); http .delete(config.API.complaintFileDelete(formData.id, id)) - .then((res) => { + .then(async (res) => { + await props.getData(); success($q, `ลบไฟล์สำเร็จ`); - props.getData(); }) .catch((e) => { messageError($q, e); @@ -184,18 +182,19 @@ function upLoadFileDoc() { showLoader(); http .put(config.API.complaintFileUpload(formData.id), Data) - .then((res) => { + .then(async (res) => { + await props.getData(); countNum.value = 2; formData.documentFile = null; - hideLoader(); + success($q, "อัพโหลดไฟล์สำเร็จ"); - props.getData(); }) .catch((e) => { messageError($q, e); - hideLoader(); }) - .finally(async () => {}); + .finally(async () => { + hideLoader(); + }); } /** @@ -216,8 +215,8 @@ async function getActive() { .get(config.API.activeOrganization) .then(async (res) => { const data = await res.data.result; + await getOc(data.activeId); formData.activeId = data.activeId; - getOc(data.activeId); }) .catch((err) => { messageError($q, err); @@ -226,7 +225,7 @@ async function getActive() { hideLoader(); }); } else { - getOc(formData.activeId); + await getOc(formData.activeId); } } @@ -382,9 +381,9 @@ watch(props.data, async () => { /** โหลดข้อมูลเมื่อเข้าหน้านี้ */ onMounted(() => { mainStore.rowsAdd = []; - getListChannel(); getActive(); + getListChannel(); }); diff --git a/src/modules/11_discipline/components/2_InvestigateFacts/EditPage.vue b/src/modules/11_discipline/components/2_InvestigateFacts/EditPage.vue index b830c2497..6aa928593 100644 --- a/src/modules/11_discipline/components/2_InvestigateFacts/EditPage.vue +++ b/src/modules/11_discipline/components/2_InvestigateFacts/EditPage.vue @@ -153,9 +153,9 @@ async function getDataComplaint() { } /** ดึงข้อมูลรายละเอียด */ -function getData() { +async function getData() { showLoader(); - http + await http .get( config.API.investigateByGetId( id.value, @@ -206,14 +206,12 @@ function getData() { * @param id ระบุ บุคคล */ async function onSubmit(data: any) { - // put showLoader(); http .put(config.API.investigateById(id.value), data) - .then(async (res) => { + .then(async () => { await getData(); await success($q, "บันทึกข้อมูลสำเร็จ"); - // router.push(`/discipline/complaints`); }) .catch((e) => { messageError($q, e); @@ -245,7 +243,7 @@ function sentConfirmNoPerson() { .put(config.API.investigateApprove(id.value), { persons: [], }) - .then((res) => { + .then(() => { getData(); router.push(`/discipline/investigatefacts`); }) @@ -344,10 +342,11 @@ watch( ); /** โหลดข้อมูลเมื่อเข้าหน้านี้ */ -onMounted(() => { - getData(); +onMounted(async () => { if (store.tabMenu == "complaints") { - getDataComplaint(); + await Promise.all([getData(), getDataComplaint()]); + } else { + getData(); } }); @@ -424,18 +423,19 @@ onMounted(() => { - -
+ + +