diff --git a/src/modules/04_registryPerson/components/Dialog/04_Father.vue b/src/modules/04_registryPerson/components/Dialog/04_Father.vue index 8b9d6c3ae..72f0cc181 100644 --- a/src/modules/04_registryPerson/components/Dialog/04_Father.vue +++ b/src/modules/04_registryPerson/components/Dialog/04_Father.vue @@ -1,5 +1,5 @@ @@ -117,6 +127,7 @@ async function upDateStatus() { -import { reactive } from "vue"; +import { reactive, watch } from "vue"; import { useQuasar } from "quasar"; import http from "@/plugins/http"; @@ -32,6 +32,7 @@ const props = defineProps({ const modal = defineModel("modal", { required: true }); // ตัวแปร popup const profileId = defineModel("profileId", { required: true }); //id บุคคล +const idCard = defineModel("idCard", { required: true }); //เลขบัตร ปชช const motherData = reactive({ isLive: 1, @@ -100,6 +101,15 @@ async function upDateStatus() { hideLoader(); }); } +watch( + () => modal.value, + () => { + if (modal.value) { + storeLinkCenter.fetchPerson(); + motherData.citizenId = idCard.value; + } + } +); @@ -118,6 +128,7 @@ async function upDateStatus() { hide-bottom-space bg-color="white" dense + readonly v-model="motherData.citizenId" :label="`${'เลขประจำตัวประชาชน'}`" maxlength="13" diff --git a/src/modules/04_registryPerson/components/Dialog/06_Couple.vue b/src/modules/04_registryPerson/components/Dialog/06_Couple.vue index 8204a14fe..0b1995a2b 100644 --- a/src/modules/04_registryPerson/components/Dialog/06_Couple.vue +++ b/src/modules/04_registryPerson/components/Dialog/06_Couple.vue @@ -1,5 +1,5 @@ @@ -160,6 +171,7 @@ function filterSelectorRelation(val: any, update: Function) { outlined bg-color="white" dense + readonly v-model="coupleData.citizenId" :label="`${'เลขประจำตัวประชาชน'}`" maxlength="13" diff --git a/src/modules/04_registryPerson/components/Dialog/07_Child.vue b/src/modules/04_registryPerson/components/Dialog/07_Child.vue deleted file mode 100644 index 0a63dbcb6..000000000 --- a/src/modules/04_registryPerson/components/Dialog/07_Child.vue +++ /dev/null @@ -1,276 +0,0 @@ - - - - - - - - - - - - • บุตร - เพิ่ม - - - บุตรคนที่:{{ index + 1 }} - - - - - storeProfile.filterSelector(inputValue, doneFn,'prefixOps' - ) " - /> - - - - - - - - - - - - - ลบ - - - - - สถานภาพการมีชีวิต - - - - - - - - - - - - - - ยกเลิก - - - - - diff --git a/src/modules/04_registryPerson/components/Dialog/DialogUpdate.vue b/src/modules/04_registryPerson/components/Dialog/DialogUpdate.vue index 3996253b2..88c96fbb1 100644 --- a/src/modules/04_registryPerson/components/Dialog/DialogUpdate.vue +++ b/src/modules/04_registryPerson/components/Dialog/DialogUpdate.vue @@ -201,27 +201,6 @@ async function amiRequest() { formDataAddress.currentDistrictId = data.value.currentDistrictId; formDataAddress.currentSubDistrictId = data.value.currentSubDistrictId; formDataAddress.currentZipCode = data.value.currentZipCode; - - // formFamily.fatherFirstName = data.value.fatherName; - // formFamily.motherFirstName = data.value.motherName; -} - -/** - * function fetch ข้อมูลความสัมพันธ์ - */ -async function fetchDataRelationship() { - await http - .get(config.API.orgRelationship) - .then(async (res) => { - const list = await res.data.result.map((e: any) => ({ - id: e.id, - name: e.name, - })); - storeLinkCenter.optionRelationshipMain = list; - }) - .catch((err) => { - messageError($q, err); - }); } watch( @@ -230,7 +209,6 @@ watch( if (modal.value) { showLoader(); count.value = 0; - await fetchDataRelationship(); await storeLinkCenter.fetchPerson(); await amiRequest(); presentAddress.value = formDataAddress.registrationZipCode ? "0" : "1"; diff --git a/src/modules/04_registryPerson/components/requestEdit/Page01_Detail.vue b/src/modules/04_registryPerson/components/requestEdit/Page01_Detail.vue index affc306bd..1945f21e8 100644 --- a/src/modules/04_registryPerson/components/requestEdit/Page01_Detail.vue +++ b/src/modules/04_registryPerson/components/requestEdit/Page01_Detail.vue @@ -13,6 +13,9 @@ import type { DataRequest } from "@/modules/04_registryPerson/interface/response import Workflow from "@/components/Workflow/Main.vue"; import DialogUpdate from "@/modules/04_registryPerson/components/Dialog/DialogUpdate.vue"; +import DialogUpdateFather from "@/modules/04_registryPerson/components/Dialog/04_Father.vue"; +import DialogUpdateMother from "@/modules/04_registryPerson/components/Dialog/05_Mother.vue"; +import DialogUpdateCouple from "@/modules/04_registryPerson/components/Dialog/06_Couple.vue"; const $q = useQuasar(); const router = useRouter(); @@ -29,14 +32,21 @@ const { const urlImg = ref(""); const modalUpdate = ref(false); +const modalFather = ref(false); +const modalMother = ref(false); +const modalCouple = ref(false); + const profileId = ref(""); -const idCard = ref(""); +const citizenId = ref(""); const requestId = ref(route.params.id.toString()); -const dataRequest = ref({ +const dataRequest = ref({ + id: "", fullname: "", - createdAt: null, + createdAt: "", topic: "", detail: "", + status: "", + citizenId: "", }); //ฟอร์มสถานะคำร้อง @@ -66,12 +76,7 @@ async function fetchDataRequest() { .get(config.API.requestEdit + `${requestId.value}`) .then((res) => { const data = res.data.result; - dataRequest.value = { - fullname: data.fullname, - createdAt: data.createdAt, - topic: data.topic, - detail: data.detail, - }; + dataRequest.value = data; formData.status = data.status; formData.remark = data.remark; @@ -195,8 +200,32 @@ async function downloadUrl(id: string, fileName: string) { }); } -function onUpdate() { - modalUpdate.value = true; +function onUpdate(data: DataRequest) { + citizenId.value = data.citizenId as string; + if (data.topic == "ขอปรับปรุงข้อมูลจากกรมการปกครอง") { + modalUpdate.value = true; + } else if (data.topic == "ขอแก้ไขข้อมูล บิดา") { + modalFather.value = true; + } else if (data.topic == "ขอแก้ไขข้อมูล มารดา") { + modalMother.value = true; + } else if (data.topic == "ขอแก้ไขข้อมูล คู่สมรส") { + modalCouple.value = true; + } +} + +function topicConvert(type: string) { + switch (type) { + case "ขอแก้ไขข้อมูล บิดา": + return "แก้ไขข้อมูล บิดา"; + case "ขอแก้ไขข้อมูล มารดา": + return "แก้ไขข้อมูล มารดา"; + case "ขอแก้ไขข้อมูล คู่สมรส": + return "แก้ไขข้อมูล คู่สมรส"; + case "ขอปรับปรุงข้อมูลจากกรมการปกครอง": + return "ปรับปรุงข้อมูลจากกรมการปกครอง"; + default: + return ""; + } } onMounted(async () => { @@ -223,10 +252,10 @@ onMounted(async () => { - ปรับปรุงข้อมูลจากกรมการปกครอง + {{ topicConvert(dataRequest.topic) }} @@ -270,7 +299,7 @@ onMounted(async () => { class="full-width" :model-value=" dataRequest.createdAt != null - ? date2Thai(dataRequest.createdAt) + ? date2Thai(dataRequest.createdAt as Date) : null " :label="`${'วันที่ยื่นขอ'}`" @@ -465,7 +494,31 @@ onMounted(async () => { + + + + + + { break; } } + + /** + * function fetch ข้อมูลความสัมพันธ์ + */ +function fetchDataRelationship() { + http + .get(config.API.orgRelationship) + .then((res) => { + const list = res.data.result.map((e: any) => ({ + id: e.id, + name: e.name, + })); + optionRelationshipMain.value = list; + }) + .catch((err) => { + messageError($q, err); + }); +} return { fetchPerson, OpsPersonFilter, @@ -348,5 +366,6 @@ export const useDataLinkCenter = defineStore("DataLinkCenter", () => { fetchSubDistrict, optionRelationshipMain, optionRelationship, + fetchDataRelationship }; }); diff --git a/src/modules/04_registryPerson/stores/profile.ts b/src/modules/04_registryPerson/stores/profile.ts index e5d8578b8..f9ab3f897 100644 --- a/src/modules/04_registryPerson/stores/profile.ts +++ b/src/modules/04_registryPerson/stores/profile.ts @@ -34,7 +34,6 @@ export const useProfileDataStore = defineStore("profile", () => { nationality: null, ethnicity: null, birthDate: null, - phone: null, lastName: "", firstName: "", prefix: "",