diff --git a/src/modules/11_discipline/components/1_Complaint/Form.vue b/src/modules/11_discipline/components/1_Complaint/Form.vue index 39546a242..48805fa17 100644 --- a/src/modules/11_discipline/components/1_Complaint/Form.vue +++ b/src/modules/11_discipline/components/1_Complaint/Form.vue @@ -152,6 +152,7 @@ function validateForm() { if (property.value && typeof property.value.validate === "function") { const isValid = property.value.validate(); hasError.push(isValid); + } } } @@ -160,6 +161,7 @@ function validateForm() { onSubmit(); } else { console.log("ไม่ผ่าน "); + console.log(formData) } } @@ -346,7 +348,7 @@ function onclickViewinfo(id: string) { /** * ปิด modal - * @param modal false + * @param modal false */ function updatemodalPersonal(modal: boolean) { modalPersonal.value = modal; @@ -598,7 +600,7 @@ onMounted(() => { :readonly="isReadonly" hide-bottom-space v-model="formData.title" - :rules="[(val) => !!val || 'กรุณาการข้อมูล']" + :rules="[(val) => !!val || 'กรุณากรอกเรื่องร้องเรียน']" lazy-rules label="เรื่องร้องเรียน" type="textarea" @@ -689,6 +691,7 @@ onMounted(() => { option-value="id" option-label="name" emit-value + clearable hide-bottom-space map-options @update:model-value=" @@ -740,6 +743,13 @@ onMounted(() => { > + @@ -761,6 +771,7 @@ onMounted(() => { emit-value hide-bottom-space map-options + clearable @update:model-value="changeFormData()" /> @@ -807,6 +818,14 @@ onMounted(() => { > + + @@ -827,6 +846,7 @@ onMounted(() => { option-label="name" hide-bottom-space emit-value + clearable map-options @update:model-value="changeFormData()" /> diff --git a/src/modules/11_discipline/components/2_InvestigateFacts/Form.vue b/src/modules/11_discipline/components/2_InvestigateFacts/Form.vue index cbbedd52e..3fb46ad6d 100644 --- a/src/modules/11_discipline/components/2_InvestigateFacts/Form.vue +++ b/src/modules/11_discipline/components/2_InvestigateFacts/Form.vue @@ -163,8 +163,8 @@ const calendarModalclose = () => (calendarModal.value = !calendarModal.value); /*** ฟังก์ชั่นสำหรับ validate ฟอร์ม */ function validateForm() { - countNum.value = 1 - onSubmit(); + countNum.value = 1; + onSubmit(); } /** @@ -173,6 +173,7 @@ function validateForm() { * หากยกเลิกจะกลับไปหน้าฟอร์ม */ function onSubmit() { + console.log(formData); dialogConfirm( $q, async () => { @@ -212,7 +213,7 @@ async function calEndDate(val: string) { changeFormData(); const date = await new Date(props.data.investigationDateEnd); formData.investigationDateEnd = await new Date( - date.setDate(date.getDate() + (Number(val))) + date.setDate(date.getDate() + Number(val)) ); } @@ -293,7 +294,6 @@ watch(props.data, async () => { } else if (countNum.value === 2) { formData.disciplineInvestigateRelevantDocs = props.data.disciplineInvestigateRelevantDocs; - } else if (countNum.value === 3) { formData.disciplineInvestigateDocs = props.data.disciplineInvestigateDocs; } @@ -330,7 +330,7 @@ function uploadFile() { .put(config.API.investigateUploadFile(formData.id), Data) .then((res) => { success($q, "อัปโหลดไฟล์สำเร็จ"); - countNum.value = 3 + countNum.value = 3; props.getData(); // router.push(`/discipline/complaints`); }) @@ -382,9 +382,7 @@ function confirmDeleteRelevant(id: string) { .catch((e) => { messageError($q, e); }) - .finally(() => { - - }); + .finally(() => {}); } /** @@ -410,9 +408,7 @@ function confirmDelete(id: string) { .catch((e) => { messageError($q, e); }) - .finally(() => { - - }); + .finally(() => {}); } async function addPerson(data: any) { await mainStore.fetchData(data); @@ -585,7 +581,6 @@ async function saveDuty(id: string, duty: string, resolution: string) { messageError($q, e); }) .finally(async () => { - hideLoader(); }); } @@ -599,6 +594,38 @@ function updatemodalPersonal(modal: boolean) { modalPersonal.value = modal; } +watch( + () => formData.investigationDetail, + (newValue, oldValue) => { + if (newValue !== "OTHER") { + formData.investigationDetailOther = ""; + } + } +); + +watch( + () => formData.respondentType, + () => { + if (formData.respondentType !== "ORGANIZATION") { + formData.organizationId = ""; + } + } +); +watch( + () => formData.investigationStatusResult, + () => { + if (formData.investigationStatusResult !== "HAVE_CAUSE") { + formData.investigationCauseText = ""; + } + } +); + +function calculateMinDate() { + const startDate = new Date(formData.investigationDateStart as Date); + startDate.setDate(startDate.getDate() + 1); + return startDate; + } + onMounted(async () => { mainStore.rowsAdd = []; getOc(); @@ -676,6 +703,7 @@ onMounted(async () => { v-model="formData.organizationId" :options="investigateFactStore.organizationIdOp" label="เลือกสำนักงาน" + clearable @update:model-value="changeFormData()" /> @@ -754,15 +782,15 @@ onMounted(async () => { - ดูข้อมูลในทะเบียนประวัติ - + dense + flat + round + color="info" + icon="info" + @click="onclickViewinfo(props.row.personId)" + > + ดูข้อมูลในทะเบียนประวัติ + { label="ลักษณะการสืบสวน" emit-value map-options + clearable option-label="name" option-value="id" use-input @@ -990,6 +1019,20 @@ onMounted(async () => { > + @@ -1012,6 +1055,7 @@ onMounted(async () => { :enableTimePicker="false" week-start="0" @update:model-value="changeFormData()" + :min-date="calculateMinDate()" > + @@ -1221,6 +1277,7 @@ onMounted(async () => { :options="mainStore.statusResultOptions" label="ผลการสืบสวน" emit-value + map-options option-label="name" option-value="id" @@ -1248,6 +1305,7 @@ onMounted(async () => { :readonly="isReadonly" for="#fault" outlined + clearable dense ref="investigationCauseTextRef" v-model="formData.investigationCauseText" @@ -1553,7 +1611,6 @@ onMounted(async () => { :id="personId" @update:modal="updatemodalPersonal" /> -