ปรับวินัย

This commit is contained in:
setthawutttty 2024-01-17 17:30:51 +07:00
parent f67c32209e
commit cd307bc0a8
5 changed files with 272 additions and 59 deletions

View file

@ -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()"
/>
</div>
@ -754,15 +782,15 @@ onMounted(async () => {
<q-tr :props="props" class="cursor-pointer">
<td>
<q-btn
dense
flat
round
color="info"
icon="info"
@click="onclickViewinfo(props.row.personId)"
>
<q-tooltip>อมลในทะเบยนประว</q-tooltip>
</q-btn>
dense
flat
round
color="info"
icon="info"
@click="onclickViewinfo(props.row.personId)"
>
<q-tooltip>อมลในทะเบยนประว</q-tooltip>
</q-btn>
</td>
<q-td
v-for="col in props.cols"
@ -820,6 +848,7 @@ onMounted(async () => {
label="ลักษณะการสืบสวน"
emit-value
map-options
clearable
option-label="name"
option-value="id"
use-input
@ -990,6 +1019,20 @@ onMounted(async () => {
>
</q-icon>
</template>
<template
v-if="formData.investigationDateStart && isReadonly === false && formData.investigationExtendHistory.length === 0"
v-slot:append
>
<q-icon
name="cancel"
@click.stop.prevent="
(formData.investigationDateStart =
null),
(formData.investigationDateEnd = null)
"
class="cursor-pointer"
/>
</template>
</q-input>
</template>
</datepicker>
@ -1012,6 +1055,7 @@ onMounted(async () => {
:enableTimePicker="false"
week-start="0"
@update:model-value="changeFormData()"
:min-date="calculateMinDate()"
>
<template #year="{ year }">{{
year + 543
@ -1048,6 +1092,18 @@ onMounted(async () => {
>
</q-icon>
</template>
<template
v-if="formData.investigationDateEnd && isReadonly === false && formData.investigationExtendHistory.length === 0"
v-slot:append
>
<q-icon
name="cancel"
@click.stop.prevent="
formData.investigationDateEnd = null
"
class="cursor-pointer"
/>
</template>
</q-input>
</template>
</datepicker>
@ -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"
/>
</template>
<style scope>