fixing ระบบวินัย

This commit is contained in:
Warunee Tamkoo 2024-05-28 15:41:15 +07:00
parent e9ee7e7f40
commit ba728ea000
16 changed files with 391 additions and 442 deletions

View file

@ -121,42 +121,6 @@ const disciplineDisciplinary_DocRecordAccusers = ref<FileLists[]>([]);
const disciplineDisciplinary_DocWitnessess = ref<FileLists[]>([]);
const disciplineDisciplinary_DocOthers = ref<FileLists[]>([]);
/** ตัวแปร ref สำหรับแสดง validate */
const respondentTypeRef = ref<Object | null>(null);
const organizationIdRef = ref<Object | null>(null);
const consideredAgencyRef = ref<Object | null>(null);
const disciplinaryDateAllegationRef = ref<Object | null>(null);
const disciplinaryDateEvidentRef = ref<Object | null>(null);
const disciplinaryCaseFaultRef = ref<Object | null>(null);
const disciplinaryInvestigateAtRef = ref<Object | null>(null);
const disciplinaryFaultLevelRef = ref<Object | null>(null);
const disciplinaryRefLawRef = ref<Object | null>(null);
const disciplinarySummaryEvidenceRef = ref<Object | null>(null);
const disciplinaryRecordAccuserRef = ref<Object | null>(null);
const disciplinaryWitnessesRef = ref<Object | null>(null);
const resultRef = ref<Object | null>(null);
const dateRef = ref<Object | null>(null);
const dateEndRef = ref<Object | null>(null);
const daysExtendRef = ref<Object | null>(null);
const disciplinaryDateResultRef = ref<Object | null>(null);
const disciplinaryStatusResultRef = ref<Object | null>(null);
const disciplinaryCauseTextRef = ref<Object | null>(null);
const disciplinaryResultRef = ref<Object | null>(null);
/** maping ref เข้าตัวแปรเพื่อเตรียมตรวจสอบ */
const objectdisciplinary: DisciplinaryRef = {
// respondentType: respondentTypeRef,
// organizationId: organizationIdRef,
// consideredAgency: consideredAgencyRef,
// disciplinaryFaultLevel: disciplinaryFaultLevelRef,
// date: dateRef,
// dateEnd: dateEndRef,
// daysExtend: daysExtendRef,
// disciplinaryDateResult: disciplinaryDateResultRef,
// disciplinaryStatusResult: disciplinaryStatusResultRef,
// disciplinaryResult: disciplinaryResultRef,
};
const initialPagination = ref<any>({
rowsPerPage: 0,
});
@ -206,24 +170,6 @@ function toggleModal() {
modalPerson.value = !modalPerson.value;
}
/** ฟังชั่นตรวจสอบความถูกต้องก่อน บันทึก */
function validateForm() {
const hasError = [];
for (const key in objectdisciplinary) {
if (Object.prototype.hasOwnProperty.call(objectdisciplinary, key)) {
const property = objectdisciplinary[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();
}
}
/**
* งชนคำนวณเวลาวนทนสดจาก นทนสดการสอบสวน
* @param val จำนวนวนทองการขยาย
@ -338,6 +284,26 @@ async function fetchDatadetail() {
isSuspend: person.isSuspend,
status: person.status,
statusDiscard: person.statusDiscard,
root: person.root,
rootId: person.rootId,
rootShortName: person.rootShortName,
child1: person.child1,
child1Id: person.child1Id,
child1ShortName: person.child1ShortName,
child2: person.child2,
child2Id: person.child2Id,
child2ShortName: person.child2ShortName,
child3: person.child3,
child3Id: person.child3Id,
child3ShortName: person.child3ShortName,
child4: person.child4,
child4Id: person.child4Id,
child4ShortName: person.child4ShortName,
posMasterNo: person.posMasterNo,
posTypeId: person.posTypeId,
posTypeName: person.posTypeName,
posLevelId: person.posLevelId,
posLevelName: person.posLevelName,
}));
formData.disciplinaryStatusResult = props.data.disciplinaryStatusResult
@ -357,7 +323,7 @@ async function fetchDatadetail() {
position: person.position === null ? "-" : person.position,
positionLevel:
person.positionLevel === null ? "-" : person.positionLevel,
salary: person.salary === null ? "-" : person.salary,
salary: person.salary === null ? "" : person.salary,
personId: person.personId,
posNo: person.posNo === null ? "-" : person.posNo,
organization: person.organization,
@ -691,7 +657,12 @@ onMounted(async () => {
</q-banner>
</div>
<form @submit.prevent="validateForm" class="col-12 row">
<q-form
greedy
@submit.prevent
@validation-success="onSubmit"
class="col-12 row"
>
<div class="row col-12">
<div class="col-xs-12 col-sm-12 col-md-9 row no-wrap">
<div class="col-12 row q-pl-md q-py-md">
@ -1822,7 +1793,7 @@ onMounted(async () => {
><q-tooltip>บทกขอม</q-tooltip></q-btn
>
</div>
</form>
</q-form>
</div>
<DialogDuty