ปรับโค้ดวินัย

This commit is contained in:
setthawutttty 2024-01-12 15:05:45 +07:00
parent 1483bbcac7
commit c81b5db558
17 changed files with 93 additions and 196 deletions

View file

@ -21,7 +21,6 @@ import type {
MyObjectInvestigateRef,
} from "@/modules/11_discipline/interface/request/investigateFact";
import type { ArrayPersonAdd } from "@/modules/11_discipline/interface/response/investigate";
import config from "@/app.config";
import http from "@/plugins/http";
@ -137,23 +136,6 @@ const formData = reactive<FormData>({
isDisciplinary: false,
});
/** maping ref เข้าตัวแปรเพื่อเตรียมตรวจสอบ */
const objectInvestigate: MyObjectInvestigateRef = {
// complaint: complaintRef,
// complaintdetail: complaintdetailRef,
// investigationDescription: investigationDescriptionRef,
// fault: faultRef,
// investigationDetailOther: investigationDetailOtherRef,
// fileComplaint: fileComplaintRef,
// date: dateRef,
// dateEnd: dateEndRef,
// investigationDetail: investigationDetailRef,
// daysExtend: daysExtendRef,
// investigationStatusResult: investigationStatusResultRef,
// investigationCauseText: investigationCauseTextRef,
// result: resultRef,
};
const rows = ref([]);
const rowsChack = ref([]);
const statusStep = computed(() => {
@ -181,23 +163,8 @@ const calendarModalclose = () => (calendarModal.value = !calendarModal.value);
/*** ฟังก์ชั่นสำหรับ validate ฟอร์ม */
function validateForm() {
const hasError = [];
for (const key in objectInvestigate) {
if (Object.prototype.hasOwnProperty.call(objectInvestigate, key)) {
const property = objectInvestigate[key];
if (property.value && typeof property.value.validate === "function") {
const isValid = property.value.validate();
hasError.push(isValid);
}
}
}
if (hasError.every((result) => result === true)) {
countNum.value = 1
onSubmit();
} else {
console.log("ไม่ผ่าน ");
}
}
/**
@ -581,14 +548,13 @@ function emitPerson(data: FormData[]) {
Id: dataMapId,
})
.then((res) => {
// router.push(`/discipline/investigatefacts`);
getOc();
})
.catch((e) => {
messageError($q, e);
})
.finally(() => {
hideLoader();
getOc();
});
}