fixing ระบบวินัย
This commit is contained in:
parent
e9ee7e7f40
commit
ba728ea000
16 changed files with 391 additions and 442 deletions
|
|
@ -118,7 +118,7 @@ const dataInvestigatefacts = reactive<FormInvestigateFact>({
|
|||
persons: [],
|
||||
investigationExtendHistory: [],
|
||||
isDisciplinary: false,
|
||||
isAncestorDNA:false
|
||||
isAncestorDNA: false,
|
||||
});
|
||||
|
||||
/** function fetchData สอบสวนความผิดทางวินัย*/
|
||||
|
|
@ -223,47 +223,7 @@ async function fetchDetailComplaints() {
|
|||
async function onSubmitDisciplinary(data: any) {
|
||||
showLoader();
|
||||
await http
|
||||
.put(config.API.disciplineDisciplinaryById(id.value), {
|
||||
respondentType:data.respondentType ,
|
||||
organizationId:data.organizationId ,
|
||||
disciplinaryDateAllegation:data.disciplinaryDateAllegation ,
|
||||
disciplinaryDateEvident:data.disciplinaryDateEvident ,
|
||||
disciplinaryCaseFault:data.disciplinaryCaseFault ,
|
||||
disciplinaryInvestigateAt:data.disciplinaryInvestigateAt ,
|
||||
disciplinaryFaultLevel:data.disciplinaryFaultLevel ,
|
||||
disciplinaryRefLaw:data.disciplinaryRefLaw ,
|
||||
disciplinarySummaryEvidence:data.disciplinarySummaryEvidence ,
|
||||
disciplinaryRecordAccuser:data.disciplinaryRecordAccuser ,
|
||||
disciplinaryWitnesses:data.disciplinaryWitnesses ,
|
||||
result:data.result ,
|
||||
directors: data.directors,
|
||||
persons: data.persons.map((item: any) => (
|
||||
{
|
||||
id:item.id ,
|
||||
idcard:item.idcard ,
|
||||
name:item.name ,
|
||||
prefix:item.prefix ,
|
||||
firstName:item.firstName ,
|
||||
lastName:item.lastName ,
|
||||
position:item.position === "-" ? null:item.position,
|
||||
positionLevel:item.positionLevel === "-" ? null:item.positionLevel,
|
||||
salary:item.salary === "-" ? null:item.salary,
|
||||
personId:item.personId ,
|
||||
posNo:item.posNo === "-" ? null:item.posNo,
|
||||
organization:item.organization ,
|
||||
})),
|
||||
extendStatus:data.extendStatus ,
|
||||
disciplinaryDateStart:data.disciplinaryDateStart ,
|
||||
disciplinaryDateEnd:data.disciplinaryDateEnd ,
|
||||
daysExtend:data.daysExtend ,
|
||||
disciplinaryDateInvestigation:data.disciplinaryDateInvestigation ,
|
||||
disciplinaryDateResult:data.disciplinaryDateResult ,
|
||||
disciplinaryStatusResult:data.disciplinaryStatusResult ,
|
||||
disciplinaryCauseText:data.disciplinaryCauseText ,
|
||||
disciplinaryResult:data.disciplinaryResult ,
|
||||
disciplinaryExtendHistory:data.disciplinaryExtendHistory ,
|
||||
disciplinaryFaultLevelOther:data.disciplinaryFaultLevelOther ,
|
||||
})
|
||||
.put(config.API.disciplineDisciplinaryById(id.value), data)
|
||||
.then(async () => {
|
||||
await fetchDetailDisciplinary();
|
||||
success($q, "บันทึกข้อมูลสำเร็จ");
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue