ปรับหน้าขอแก้ไขข้อมูลทะเบียนประวัติ
This commit is contained in:
parent
d44cc0d477
commit
c6acb3e2b8
9 changed files with 131 additions and 324 deletions
|
|
@ -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<string>("");
|
||||
const modalUpdate = ref<boolean>(false);
|
||||
const modalFather = ref<boolean>(false);
|
||||
const modalMother = ref<boolean>(false);
|
||||
const modalCouple = ref<boolean>(false);
|
||||
|
||||
const profileId = ref<string>("");
|
||||
const idCard = ref<string>("");
|
||||
const citizenId = ref<string>("");
|
||||
const requestId = ref<string>(route.params.id.toString());
|
||||
const dataRequest = ref<any>({
|
||||
const dataRequest = ref<DataRequest>({
|
||||
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 () => {
|
|||
<q-btn
|
||||
v-if="workflowRef?.permission.isUpdate"
|
||||
color="public"
|
||||
label="ปรับปรุงข้อมูลจากกรมการปกครอง"
|
||||
@click="onUpdate"
|
||||
:label="topicConvert(dataRequest.topic)"
|
||||
@click="onUpdate(dataRequest)"
|
||||
>
|
||||
<q-tooltip>ปรับปรุงข้อมูลจากกรมการปกครอง</q-tooltip>
|
||||
<q-tooltip>{{ topicConvert(dataRequest.topic) }}</q-tooltip>
|
||||
</q-btn>
|
||||
</div>
|
||||
<q-card>
|
||||
|
|
@ -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 () => {
|
|||
|
||||
<DialogUpdate
|
||||
v-model:modal="modalUpdate"
|
||||
v-model:id-card="idCard"
|
||||
v-model:id-card="dataRequest.citizenId"
|
||||
v-model:profile-id="profileId"
|
||||
:fetch-data="fetchDataRequest"
|
||||
:request-id="requestId"
|
||||
/>
|
||||
|
||||
<DialogUpdateFather
|
||||
v-model:modal="modalFather"
|
||||
v-model:id-card="dataRequest.citizenId"
|
||||
v-model:profile-id="profileId"
|
||||
:fetch-data="fetchDataRequest"
|
||||
:request-id="requestId"
|
||||
/>
|
||||
|
||||
<DialogUpdateMother
|
||||
v-model:modal="modalMother"
|
||||
v-model:id-card="dataRequest.citizenId"
|
||||
v-model:profile-id="profileId"
|
||||
:fetch-data="fetchDataRequest"
|
||||
:request-id="requestId"
|
||||
/>
|
||||
|
||||
<DialogUpdateCouple
|
||||
v-model:modal="modalCouple"
|
||||
v-model:id-card="dataRequest.citizenId"
|
||||
v-model:profile-id="profileId"
|
||||
:fetch-data="fetchDataRequest"
|
||||
:request-id="requestId"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue