แก้ bug ฟอร์มทดลองงาน

This commit is contained in:
Warunee Tamkoo 2023-10-04 17:36:53 +07:00
parent c0efcf59ce
commit d83530ec9c
5 changed files with 56 additions and 179 deletions

View file

@ -151,6 +151,8 @@ const fetchEvaluate = async () => {
self_learning.value = data.self_learning.toString();
training_seminar.value = data.training_seminar.toString();
other_training.value = data.other_training.toString();
dateAutherise.value = data.commander_dated
if (
data.achievement_other_desc !== "" &&
data.achievement_other_level !== null

View file

@ -46,6 +46,19 @@ const director_id3 = ref<any>(null);
const optionDirector = ref<any>([]);
const person = ref<any>([]);
const options = ref<any>([
{ value: 1, label: "พัฒนาครบ 3 ส่วน" },
{ value: 2, label: "พัฒนาไม่ครบ 3 ส่วน" },
]);
const optionsResult = ref<any>([
{ value: 1, label: "ไม่ต่ำกว่ามาตรฐานที่กำหนด เห็นควรให้รับราชการต่อ" },
{ value: 2, label: "ต่ำกว่ามาตรฐานที่กำหนด เห็นควรให้ออกจากราชการ" },
{
value: 3,
label: "เห็นควรให้ขยายระยะเวลาทดลองปฏิบัติหน้าที่ราชการต่อไปอีก",
},
]);
// const saveEdit = async (id: string) => {
// await myForm.value.validate().then((result: boolean) => {
// if (result) {
@ -73,6 +86,7 @@ const fecthAssign = async (id: string) => {
) {
develop.value = res.data.data.result.develop_complete;
result.value = res.data.data.result.evaluate_result;
changeReson52(Number(res.data.data.result.evaluate_result));
}
director_id.value = res.data.data.chairman.name;
@ -117,19 +131,6 @@ const fecthResult = async (id: string) => {
// part new
const options = [
{ value: 1, label: "พัฒนาครบ 3 ส่วน" },
{ value: 2, label: "พัฒนาไม่ครบ 3 ส่วน" },
];
const optionsResult = [
{ value: 1, label: "ไม่ต่ำกว่ามาตรฐานที่กำหนด เห็นควรให้รับราชการต่อ" },
{ value: 2, label: "ต่ำกว่ามาตรฐานที่กำหนด เห็นควรให้ออกจากราชการ" },
{
value: 3,
label: "เห็นควรให้ขยายระยะเวลาทดลองปฏิบัติหน้าที่ราชการต่อไปอีก",
},
];
const savaForm = async () => {
await myForm.value.validate().then((result: boolean) => {
if (result) {
@ -207,7 +208,7 @@ const postData = async (action: string) => {
});
}
};
const selectRuslt = () => {
const selectResult = () => {
if (result.value !== 3) {
expand_month.value = "";
}
@ -236,30 +237,6 @@ onMounted(() => {
fecthAssign(assignId.value);
fecthResult(assignId.value);
});
const optionsFn = ref<any>([]);
function filterFnOptions(val: string, update: any) {
if (val == "") {
update(() => {
optionsFn.value = options;
});
} else {
update(() => {
optionsFn.value = options.filter((e: any) => e.label.search(val) !== -1);
});
}
}
const optionsResultFn = ref<any>([])
function filterFnOptionsResult(val: string, update: any) {
if (val == "") {
update(() => {
optionsResultFn.value = optionsResult;
});
} else {
update(() => {
optionsResultFn.value = optionsResult.filter((e: any) => e.label.search(val) !== -1);
});
}
}
</script>
<template>
@ -428,7 +405,7 @@ function filterFnOptionsResult(val: string, update: any) {
'กรุณาเลือกการพัฒนาในระหว่างทดลองปฏิบัติหน้าที่ราชการ',
]"
hide-bottom-space
:options="optionsFn"
:options="options"
class="col-xs-12 col-sm-6"
dense
borderless
@ -440,7 +417,6 @@ function filterFnOptionsResult(val: string, update: any) {
outlined
v-model="develop"
label="การพัฒนาในระหว่างทดลองปฏิบัติหน้าที่ราชการ"
@filter="filterFnOptions"
use-input
><template v-slot:no-option>
<q-item>
@ -461,7 +437,7 @@ function filterFnOptionsResult(val: string, update: any) {
'กรุณาเลือกผลการประเมินการทดลองปฏิบัติหน้าที่ราชการ',
]"
hide-bottom-space
:options="optionsResultFn"
:options="optionsResult"
:disable="!status"
dense
borderless
@ -472,9 +448,8 @@ function filterFnOptionsResult(val: string, update: any) {
outlined
v-model="result"
label="ผลการประเมินการทดลองปฏิบัติหน้าที่ราชการ"
@update:model-value="selectRuslt"
@update:model-value="selectResult"
use-input
@filter="filterFnOptionsResult"
><template v-slot:no-option>
<q-item>
<q-item-section class="text-grey">

View file

@ -152,6 +152,7 @@ const fecthFormRound = async () => {
self_learning.value = data.self_learning.toString();
training_seminar.value = data.training_seminar.toString();
other_training.value = data.other_training.toString();
dateAutherise.value = data.assessor_dated
if (
data.achievement_other_desc !== "" &&
data.achievement_other_level !== null

View file

@ -161,6 +161,8 @@ const fecthFormRound = async () => {
self_learning.value = data.self_learning.toString();
training_seminar.value = data.training_seminar.toString();
other_training.value = data.other_training.toString();
dateAutherise.value = data.assessor_dated
if (
data.achievement_other_desc !== "" &&
data.achievement_other_level !== null