Refactor Code การทดลองปฏิบัติหน้าที่ราชการ

This commit is contained in:
setthawutttty 2023-09-21 16:08:12 +07:00
parent 01f23e51f8
commit a8f24024bf
14 changed files with 898 additions and 1269 deletions

View file

@ -6,7 +6,7 @@ import { useCounterMixin } from "@/stores/mixin";
import { useRouter, useRoute } from "vue-router";
import http from "@/plugins/http";
import config from "@/app.config";
import criterion from "@/modules/05_placement/components/Other/Criterion.vue"
import criterion from "@/modules/05_placement/components/Other/Criterion.vue";
const router = useRouter();
const routeName = router.currentRoute.value.name;
@ -29,15 +29,34 @@ const route = useRoute();
const assignId = ref<string>(route.params.form.toString());
const { assign } = probationStore;
const personalId = ref<string>(route.params.personalId.toString());
const Autherise = ref<any>(null);
const dateAutherise = ref<any>(new Date());
const option = ref<any>([]);
const edit = () => {
status.value = true;
};
const cancel = () => {
status.value = false;
};
// part 1
const knowledge_level = ref<number>(0);
const skill_level = ref<number>(0);
const competency_level = ref<number>(0);
const learn_level = ref<number>(0);
const apply_level = ref<number>(0);
const success_level = ref<number>(0);
const etc = ref<any>(false);
const achievement_other = ref<any>({ text: "", level: 0 });
// part 2
const conduct_level = ref<any>([]);
const moral_level = ref<any>([]);
const discipline_level = ref<any>([]);
const etc2 = ref<any>(false); // checkBox 2.4
const behavio_orther = ref<any>({ text: "", level: 0 });
const behavio_strength_desc = ref<string>("");
const behavior_improve_desc = ref<string>("");
// part 3
const orientation = ref<any>(null);
const self_learning = ref<any>(null);
const training_seminar = ref<any>(null);
const other_training = ref<any>(null);
//rules
const behavio_strengthRef = ref<any>(null);
const person = ref<any>([]);
const evaluate_no = ref<number>();
const evaluate_id = ref<string>("");
@ -47,6 +66,18 @@ const commander = ref<any>([]);
const status = ref<boolean>(true);
const dataArr = ref<any>();
const behavio_strengthRules = [
(val: any) => (val && val.length > 0) || "กรุณากรอกข้อมูลจุดเด่น",
];
const behavio_inproveRef = ref<any>(null);
const edit = () => {
status.value = true;
};
const cancel = () => {
status.value = false;
};
const props = defineProps({
tab: String,
data: Object,
@ -57,23 +88,7 @@ const list2_1 = probationStore.behavior_no1;
const list2_2 = probationStore.behavior_no2;
const list2_3 = probationStore.behavior_no3;
onMounted(async () => {
if (props.tab && props.action == "edit") {
evaluate_no.value = Number(props.tab.charAt(4));
dataArr.value = await props.data;
fecthAssign();
fetchEvaluate();
}
});
watch(props, async () => {
if (props.tab && props.action == "edit") {
evaluate_no.value = Number(props.tab.charAt(4));
dataArr.value = await props.data;
fecthAssign();
fetchEvaluate();
}
});
const fecthAssign = async () => {
showLoader();
@ -83,7 +98,6 @@ const fecthAssign = async () => {
console.log(res);
if (props.action == "add") {
person.value = res.data.data.person;
// assign.value = res.data.data.assign;
commander.value = res.data.data.commander;
option.value.push(commander.value);
Autherise.value = commander.value.name;
@ -104,7 +118,6 @@ const fecthAssign = async () => {
});
};
const fetchEvaluate = async () => {
// showLoader();
try {
let data = await dataArr.value;
evaluate_id.value = data.id;
@ -148,54 +161,14 @@ const fetchEvaluate = async () => {
etc2.value = true;
} else etc2.value = false;
status.value = false;
// setTimeout(() => {
// hideLoader();
// }, 1000);
} catch (error) {
hideLoader();
}
};
const Autherise = ref<any>(null);
const dateAutherise = ref<any>(new Date());
const option = ref<any>([]);
// part 1
const knowledge_level = ref<number>(0);
const skill_level = ref<number>(0);
const competency_level = ref<number>(0);
const learn_level = ref<number>(0);
const apply_level = ref<number>(0);
const success_level = ref<number>(0);
const etc = ref<any>(false);
const achievement_other = ref<any>({ text: "", level: 0 });
// part 2
const conduct_level = ref<any>([]);
const moral_level = ref<any>([]);
const discipline_level = ref<any>([]);
const etc2 = ref<any>(false); // checkBox 2.4
const behavio_orther = ref<any>({ text: "", level: 0 });
const behavio_strength_desc = ref<string>("");
const behavior_improve_desc = ref<string>("");
// part 3
const orientation = ref<any>(null);
const self_learning = ref<any>(null);
const training_seminar = ref<any>(null);
const other_training = ref<any>(null);
//rules
const behavio_strengthRef = ref<any>(null);
const behavio_strengthRules = [
(val: any) => (val && val.length > 0) || "กรุณากรอกข้อมูลจุดเด่น",
];
const behavio_inproveRef = ref<any>(null);
// const behavio_inproveRules = [
// (val: any) => (val && val.length > 0) || "",
// ];
const savaForm = () => {
let hasError = false;
behavio_strengthRef.value.validate();
// behavio_inproveRef.value.validate();
if (
knowledge_level.value === 0 ||
skill_level.value === 0 ||
@ -207,7 +180,6 @@ const savaForm = () => {
moral_level.value.length < 3 ||
discipline_level.value.length < 5 ||
behavio_strength_desc.value === "" ||
// behavior_improve_desc.value === "" ||
orientation.value === null ||
self_learning.value === null ||
training_seminar.value === null
@ -281,13 +253,30 @@ const save = () => {
});
});
};
watch(props, async () => {
if (props.tab && props.action == "edit") {
evaluate_no.value = Number(props.tab.charAt(4));
dataArr.value = await props.data;
fecthAssign();
fetchEvaluate();
}
});
onMounted(async () => {
if (props.tab && props.action == "edit") {
evaluate_no.value = Number(props.tab.charAt(4));
dataArr.value = await props.data;
fecthAssign();
fetchEvaluate();
}
});
</script>
<template>
<div class="row col-12 no-margin q-pa-sm">
<div class="toptitle text-dark col-12 row items-center q-gutter-md">
<div>แบบประเมนผล (งคบบญชา)</div>
<!-- <q-space /> -->
<div v-if="status == false">
<q-btn
dense

View file

@ -6,7 +6,7 @@ import { useCounterMixin } from "@/stores/mixin";
import { useRoute, useRouter } from "vue-router";
import http from "@/plugins/http";
import config from "@/app.config";
import criterion from "@/modules/05_placement/components/Other/Criterion.vue"
import criterion from "@/modules/05_placement/components/Other/Criterion.vue";
const $q = useQuasar();
const probationStore = useProbationDataStore();
@ -36,7 +36,32 @@ const date_finish = ref<Date>(new Date());
const commander = ref<any>([]);
const round = ref<any>();
const status = ref<boolean>(true);
const Autherise = ref<any>(null);
const dateAutherise = ref<any>(new Date());
const option = ref<any>([]);
// part 1
const skill_level = ref<number>(0);
const competency_level = ref<number>(0);
const learn_level = ref<number>(0);
const apply_level = ref<number>(0);
const success_level = ref<number>(0);
const etc = ref<any>(false);
const achievement_other = ref<any>({ text: "", level: 0 });
// part 2
const conduct_level = ref<any>([]);
const moral_level = ref<any>([]);
const discipline_level = ref<any>([]);
const etc2 = ref<any>(false); // checkBox 2.4
const behavio_orther = ref<any>({ text: "", level: 0 });
const behavio_strength_desc = ref<string>("");
const behavior_improve_desc = ref<string>("");
const orientation = ref<any>(null);
const self_learning = ref<any>(null);
const training_seminar = ref<any>(null);
const other_training = ref<any>(null);
const behavio_strengthRef = ref<any>(null);
const props = defineProps({
tab: String,
});
@ -45,9 +70,6 @@ const list2_1 = probationStore.behavior_no1;
const list2_2 = probationStore.behavior_no2;
const list2_3 = probationStore.behavior_no3;
onMounted(async () => {
fecthAssign(assignId.value);
});
const fecthAssign = async (id: string) => {
showLoader();
await http
@ -70,27 +92,7 @@ const fecthAssign = async (id: string) => {
hideLoader();
});
};
const Autherise = ref<any>(null);
const dateAutherise = ref<any>(new Date());
const option = ref<any>([]);
// part 1
const skill_level = ref<number>(0);
const competency_level = ref<number>(0);
const learn_level = ref<number>(0);
const apply_level = ref<number>(0);
const success_level = ref<number>(0);
const etc = ref<any>(false);
const achievement_other = ref<any>({ text: "", level: 0 });
// part 2
const conduct_level = ref<any>([]);
const moral_level = ref<any>([]);
const discipline_level = ref<any>([]);
const etc2 = ref<any>(false); // checkBox 2.4
const behavio_orther = ref<any>({ text: "", level: 0 });
const behavio_strength_desc = ref<string>("");
const behavior_improve_desc = ref<string>("");
// part 3
const alerts = Array(20)
.fill(null)
@ -105,12 +107,9 @@ const lengthmoral_level = computed(() => {
const lengthdiscipline_level = computed(() => {
return discipline_level.value.filter((item: number) => item !== 0).length;
});
const orientation = ref<any>(null);
const self_learning = ref<any>(null);
const training_seminar = ref<any>(null);
const other_training = ref<any>(null);
//rules
const behavio_strengthRef = ref<any>(null);
const behavio_strengthRules = [
(val: any) => (val && val.length > 0) || "กรุณากรอกข้อมูลจุดเด่น",
];
@ -134,7 +133,6 @@ const variablesToWatch = [
const savaForm = () => {
let hasError = false;
behavio_strengthRef.value.validate();
// behavio_inproveRef.value.validate();
if (
knowledge_level.value === 0 ||
skill_level.value === 0 ||
@ -236,6 +234,11 @@ const putformData = () => {
});
};
const getBordered = (i: boolean) => {
return {
border_custom: i,
};
};
variablesToWatch.forEach((variable, index) => {
watch(variable, (item: any) => {
if (item !== 0) {
@ -266,11 +269,9 @@ watch(lengthdiscipline_level, (newLength) => {
alerts[8].value = false;
}
});
const getBordered = (i: boolean) => {
return {
border_custom: i,
};
};
onMounted(async () => {
fecthAssign(assignId.value);
});
</script>
<template>

View file

@ -6,7 +6,7 @@ import { useCounterMixin } from "@/stores/mixin";
import { useRouter, useRoute } from "vue-router";
import http from "@/plugins/http";
import config from "@/app.config";
import criterion from "@/modules/05_placement/components/Other/Criterion.vue"
import criterion from "@/modules/05_placement/components/Other/Criterion.vue";
const router = useRouter();
const routeName = router.currentRoute.value.name;
@ -57,24 +57,41 @@ const director_id2 = ref<any>(null);
const director_id3 = ref<any>(null);
const director1_dated = ref<any>("");
const director2_dated = ref<any>("");
// part 1
const learn_level = ref<number>(0);
const apply_level = ref<number>(0);
const success_level = ref<number>(0);
const etc = ref<any>(false);
const achievement_other = ref<any>({ text: "", level: 0 });
// part 2
const conduct_level = ref<any>([]);
const moral_level = ref<any>([]);
const discipline_level = ref<any>([]);
const etc2 = ref<any>(false); // checkBox 2.4
const behavio_orther = ref<any>({ text: "", level: 0 });
onMounted(async () => {
if (props.tab && props.action == "edit") {
evaluate_no.value = Number(props.tab.charAt(4));
dataArr.value = await props.data;
await fetchEvaluate();
await fecthAssign();
}
});
// part 3
const orientation = ref<number>(0);
const self_learning = ref<number>(0);
const training_seminar = ref<number>(0);
const other_training = ref<number>(0);
const orientation_percent = ref<number>(0);
const self_learning_percent = ref<number>(0);
const training_seminar_percent = ref<number>(0);
const other_training_percent = ref<number>(0);
const develop_result = ref<any>();
const evaluate_result = ref<any>();
const evaluate_result_option = ref<any>([
{ name: "ผ่าน (สูงกว่าร้อยละ 60)", value: 1 },
{ name: "ไม่ผ่าน (ต่ำกว่าร้อยละ 60)", value: 0 },
]);
watch(props, async () => {
if (props.tab && props.action == "edit") {
evaluate_no.value = Number(props.tab.charAt(4));
dataArr.value = await props.data;
await fetchEvaluate();
await fecthAssign();
}
});
const develop_result_option = ref<any>([
{ name: "ผ่าน (สูงกว่าร้อยละ 60)", value: 1 },
{ name: "ไม่ผ่าน (ต่ำกว่าร้อยละ 60)", value: 0 },
]);
// footer
const dateAutherise = ref<any>();
const fecthAssign = async () => {
showLoader();
@ -96,9 +113,9 @@ const fecthAssign = async () => {
director_id3.value = res.data.data.mentors[0].name;
}
dateAutherise.value = res.data.data.chairman_dated
director1_dated.value = res.data.data.director1_dated
director2_dated.value = res.data.data.director2_dated
dateAutherise.value = res.data.data.chairman_dated;
director1_dated.value = res.data.data.director1_dated;
director2_dated.value = res.data.data.director2_dated;
})
.catch((e) => {
messageError($q, e);
@ -157,57 +174,14 @@ const fetchEvaluate = async () => {
if (data.behavior_other_desc !== "" && data.behavior_other_level !== null) {
etc2.value = true;
} else etc2.value = false;
status.value = false;
// setTimeout(() => {
// hideLoader();
// }, 1000);
} catch (error) {
// hideLoader();
}
} catch (error) {}
};
const list2_1 = probationStore.behavior_no1;
const list2_2 = probationStore.behavior_no2;
const list2_3 = probationStore.behavior_no3;
// part 1
const learn_level = ref<number>(0);
const apply_level = ref<number>(0);
const success_level = ref<number>(0);
const etc = ref<any>(false);
const achievement_other = ref<any>({ text: "", level: 0 });
// part 2
const conduct_level = ref<any>([]);
const moral_level = ref<any>([]);
const discipline_level = ref<any>([]);
const etc2 = ref<any>(false); // checkBox 2.4
const behavio_orther = ref<any>({ text: "", level: 0 });
// part 3
const orientation = ref<number>(0);
const self_learning = ref<number>(0);
const training_seminar = ref<number>(0);
const other_training = ref<number>(0);
const orientation_percent = ref<number>(0);
const self_learning_percent = ref<number>(0);
const training_seminar_percent = ref<number>(0);
const other_training_percent = ref<number>(0);
const develop_result = ref<any>();
const evaluate_result = ref<any>();
const evaluate_result_option = ref<any>([
{ name: "ผ่าน (สูงกว่าร้อยละ 60)", value: 1 },
{ name: "ไม่ผ่าน (ต่ำกว่าร้อยละ 60)", value: 0 },
]);
const develop_result_option = ref<any>([
{ name: "ผ่าน (สูงกว่าร้อยละ 60)", value: 1 },
{ name: "ไม่ผ่าน (ต่ำกว่าร้อยละ 60)", value: 0 },
]);
// footer
const dateAutherise = ref<any>();
// const option = ref<any>([]);
// score
const score1 = computed(() => {
if (
@ -412,6 +386,22 @@ const putformData = () => {
});
});
};
watch(props, async () => {
if (props.tab && props.action == "edit") {
evaluate_no.value = Number(props.tab.charAt(4));
dataArr.value = await props.data;
await fetchEvaluate();
await fecthAssign();
}
});
onMounted(async () => {
if (props.tab && props.action == "edit") {
evaluate_no.value = Number(props.tab.charAt(4));
dataArr.value = await props.data;
await fetchEvaluate();
await fecthAssign();
}
});
</script>
<template>
@ -419,9 +409,15 @@ const putformData = () => {
<div class="row col-12 no-margin q-pa-sm">
<div class="toptitle text-dark col-12 row items-center q-gutter-md">
<div>แบบประเมนผล (คณะกรรมการ)</div>
<!-- <q-space /> -->
<div v-if="status == false">
<q-btn dense flat round color="primary" @click="edit()" icon="mdi-pencil-outline">
<q-btn
dense
flat
round
color="primary"
@click="edit()"
icon="mdi-pencil-outline"
>
<q-tooltip>แกไขขอม</q-tooltip>
</q-btn>
</div>
@ -429,7 +425,15 @@ const putformData = () => {
<q-btn dense flat round color="red" @click="cancel()" icon="mdi-undo">
<q-tooltip>ยกเล</q-tooltip>
</q-btn>
<q-btn dense class="q-ml-sm" flat round color="public" @click="savaForm()" icon="mdi-content-save-outline">
<q-btn
dense
class="q-ml-sm"
flat
round
color="public"
@click="savaForm()"
icon="mdi-content-save-outline"
>
<q-tooltip>นทกขอม</q-tooltip>
</q-btn>
</div>
@ -479,11 +483,19 @@ const putformData = () => {
<q-item-section>
<q-item-label>
<q-icon name="mdi-label" color="grey-4" class="q-pr-sm" />
1.1. ความสามารถในการเรยนรงาน</q-item-label>
1.1. ความสามารถในการเรยนรงาน</q-item-label
>
</q-item-section>
<q-item-section side>
<q-rating v-model="learn_level" max="5" size="sm" :disable="!status" color="grey"
:color-selected="ratingColors" label="ระดับการประเมินพฤติกรรม">
<q-rating
v-model="learn_level"
max="5"
size="sm"
:disable="!status"
color="grey"
:color-selected="ratingColors"
label="ระดับการประเมินพฤติกรรม"
>
<template v-slot:tip-1>
<q-tooltip>ำกวาความคาดหวงมาก (1)</q-tooltip>
</template>
@ -512,11 +524,19 @@ const putformData = () => {
<q-item-label>
<q-icon name="mdi-label" color="grey-4" class="q-pr-sm" />
1.2.
ความสามารถในการปรบใชความรบงานในหนาท</q-item-label>
ความสามารถในการปรบใชความรบงานในหนาท</q-item-label
>
</q-item-section>
<q-item-section side>
<q-rating v-model="apply_level" max="5" size="sm" color="grey" :disable="!status"
:color-selected="ratingColors" label="ระดับการประเมินพฤติกรรม">
<q-rating
v-model="apply_level"
max="5"
size="sm"
color="grey"
:disable="!status"
:color-selected="ratingColors"
label="ระดับการประเมินพฤติกรรม"
>
<template v-slot:tip-1>
<q-tooltip>ำกวาความคาดหวงมาก (1)</q-tooltip>
</template>
@ -544,11 +564,19 @@ const putformData = () => {
<q-item-section>
<q-item-label>
<q-icon name="mdi-label" color="grey-4" class="q-pr-sm" />
1.3. ความสำเรจของงานทไดบมอบหมาย</q-item-label>
1.3. ความสำเรจของงานทไดบมอบหมาย</q-item-label
>
</q-item-section>
<q-item-section side>
<q-rating v-model="success_level" max="5" :disable="!status" size="sm" color="grey"
:color-selected="ratingColors" label="ระดับการประเมินพฤติกรรม">
<q-rating
v-model="success_level"
max="5"
:disable="!status"
size="sm"
color="grey"
:color-selected="ratingColors"
label="ระดับการประเมินพฤติกรรม"
>
<template v-slot:tip-1>
<q-tooltip>ำกวาความคาดหวงมาก (1)</q-tooltip>
</template>
@ -577,29 +605,55 @@ const putformData = () => {
<q-item-label>
<q-icon name="mdi-label" color="grey-4" class="q-pr-sm" />
1.4 นๆ
<q-checkbox class="q-ml-sm" dense :disable="!status" v-model="etc" @click="
(achievement_other.text = ''),
(achievement_other.level = 0)
" /></q-item-label>
<q-checkbox
class="q-ml-sm"
dense
:disable="!status"
v-model="etc"
@click="
(achievement_other.text = ''),
(achievement_other.level = 0)
"
/></q-item-label>
</q-item-section>
</q-item>
</q-list>
</q-card>
<q-card v-if="etc" class="text-top0 col-xs-12 col-sm-11 q-pa-xs q-pl-lg">
<q-card
v-if="etc"
class="text-top0 col-xs-12 col-sm-11 q-pa-xs q-pl-lg"
>
<q-list dense>
<q-item dense tag="label" v-ripple>
<q-item-section class="q-ml-md">
<q-item-label>
<q-input v-model="achievement_other.text" label="กรอกอื่นๆ" dense lazy-rules autogrow
:disable="!status" hide-bottom-space outlined class="bg-white" :rules="[
<q-input
v-model="achievement_other.text"
label="กรอกอื่นๆ"
dense
lazy-rules
autogrow
:disable="!status"
hide-bottom-space
outlined
class="bg-white"
:rules="[
(val) => (val && val.length > 0) || 'กรุณากรอกข้อความ',
]" />
]"
/>
</q-item-label>
</q-item-section>
<q-item-section side>
<q-rating v-model="achievement_other.level" max="5" size="sm" color="grey" :disable="!status"
:color-selected="ratingColors" label="ระดับการประเมินพฤติกรรม">
<q-rating
v-model="achievement_other.level"
max="5"
size="sm"
color="grey"
:disable="!status"
:color-selected="ratingColors"
label="ระดับการประเมินพฤติกรรม"
>
<template v-slot:tip-1>
<q-tooltip>ำกวาความคาดหวงมาก (1)</q-tooltip>
</template>
@ -640,15 +694,27 @@ const putformData = () => {
<q-icon name="mdi-label" color="grey-4" class="q-pr-sm" />
2.1 ความประพฤต
</div>
<q-card flat bordered class="col-xs-12 col-sm-11 col-md-10 offset-md-1 q-pa-sm bg-grey-1">
<q-card
flat
bordered
class="col-xs-12 col-sm-11 col-md-10 offset-md-1 q-pa-sm bg-grey-1"
>
<q-list dense v-for="(list, i) in list2_1" :key="i">
<q-item dense tag="label" v-ripple>
<q-item-section>
<q-item-label>{{ list.label }}</q-item-label>
</q-item-section>
<q-item-section side>
<q-rating v-model="conduct_level[i]" :val="list.id" max="5" size="sm" :disable="!status" color="grey"
:color-selected="ratingColors" label="ระดับการประเมินพฤติกรรม">
<q-rating
v-model="conduct_level[i]"
:val="list.id"
max="5"
size="sm"
:disable="!status"
color="grey"
:color-selected="ratingColors"
label="ระดับการประเมินพฤติกรรม"
>
<template v-slot:tip-1>
<q-tooltip>ำกวาความคาดหวงมาก (1)</q-tooltip>
</template>
@ -676,15 +742,27 @@ const putformData = () => {
<q-icon name="mdi-label" color="grey-4" class="q-pr-sm" />
2.2 ความมณธรรมจรยธรรม
</div>
<q-card flat bordered class="col-xs-12 col-sm-11 col-md-10 offset-md-1 q-pa-sm bg-grey-1">
<q-card
flat
bordered
class="col-xs-12 col-sm-11 col-md-10 offset-md-1 q-pa-sm bg-grey-1"
>
<q-list dense v-for="(list, i) in list2_2" :key="i">
<q-item dense tag="label" v-ripple>
<q-item-section>
<q-item-label>{{ list.label }}</q-item-label>
</q-item-section>
<q-item-section side>
<q-rating v-model="moral_level[i]" :val="list.id" :disable="!status" max="5" size="sm" color="grey"
:color-selected="ratingColors" label="ระดับการประเมินพฤติกรรม">
<q-rating
v-model="moral_level[i]"
:val="list.id"
:disable="!status"
max="5"
size="sm"
color="grey"
:color-selected="ratingColors"
label="ระดับการประเมินพฤติกรรม"
>
<template v-slot:tip-1>
<q-tooltip>ำกวาความคาดหวงมาก (1)</q-tooltip>
</template>
@ -712,15 +790,27 @@ const putformData = () => {
<q-icon name="mdi-label" color="grey-4" class="q-pr-sm" />
2.3 การรกษาว
</div>
<q-card flat bordered class="col-xs-12 col-sm-11 col-md-10 offset-md-1 q-pa-sm bg-grey-1">
<q-card
flat
bordered
class="col-xs-12 col-sm-11 col-md-10 offset-md-1 q-pa-sm bg-grey-1"
>
<q-list dense v-for="(list, i) in list2_3" :key="i">
<q-item dense tag="label" v-ripple>
<q-item-section>
<q-item-label>{{ list.label }}</q-item-label>
</q-item-section>
<q-item-section side>
<q-rating v-model="discipline_level[i]" :val="list.id" :disable="!status" max="5" size="sm"
color="grey" :color-selected="ratingColors" label="ระดับการประเมินพฤติกรรม">
<q-rating
v-model="discipline_level[i]"
:val="list.id"
:disable="!status"
max="5"
size="sm"
color="grey"
:color-selected="ratingColors"
label="ระดับการประเมินพฤติกรรม"
>
<template v-slot:tip-1>
<q-tooltip>ำกวาความคาดหวงมาก (1)</q-tooltip>
</template>
@ -747,23 +837,51 @@ const putformData = () => {
<div class="col-12 text-top0 row items-center q-pl-md">
<q-icon name="mdi-label" color="grey-4" class="q-pr-sm" />
2.4 นๆ
<q-checkbox class="q-ml-sm" dense v-model="etc2" :disable="!status"
@click="(behavio_orther.text = ''), (behavio_orther.level = 0)" />
<q-checkbox
class="q-ml-sm"
dense
v-model="etc2"
:disable="!status"
@click="(behavio_orther.text = ''), (behavio_orther.level = 0)"
/>
</div>
<q-card v-if="etc2" flat bordered class="col-xs-12 col-sm-11 col-md-10 offset-md-1 q-pa-sm bg-grey-1">
<q-card
v-if="etc2"
flat
bordered
class="col-xs-12 col-sm-11 col-md-10 offset-md-1 q-pa-sm bg-grey-1"
>
<q-list dense>
<q-item dense tag="label" v-ripple>
<q-item-section>
<q-item-label>
<q-input v-model="behavio_orther.text" label="กรอกอื่นๆ" dense lazy-rules :disable="!status"
autogrow hide-bottom-space outlined class="bg-white" :rules="[
(val) => (val && val.length > 0) || 'กรุณากรอกข้อความ',
]" />
<q-input
v-model="behavio_orther.text"
label="กรอกอื่นๆ"
dense
lazy-rules
:disable="!status"
autogrow
hide-bottom-space
outlined
class="bg-white"
:rules="[
(val) =>
(val && val.length > 0) || 'กรุณากรอกข้อความ',
]"
/>
</q-item-label>
</q-item-section>
<q-item-section side>
<q-rating v-model="behavio_orther.level" max="5" size="sm" :disable="!status" color="grey"
:color-selected="ratingColors" label="ระดับการประเมินพฤติกรรม">
<q-rating
v-model="behavio_orther.level"
max="5"
size="sm"
:disable="!status"
color="grey"
:color-selected="ratingColors"
label="ระดับการประเมินพฤติกรรม"
>
<template v-slot:tip-1>
<q-tooltip>ำกวาความคาดหวงมาก (1)</q-tooltip>
</template>
@ -810,7 +928,8 @@ const putformData = () => {
<q-item-label>
<q-icon name="mdi-label" color="grey-4" class="q-pr-sm" />
3.1.
ผลสมฤทธของการทดลองปฏหนาทราชการ</q-item-label>
ผลสมฤทธของการทดลองปฏหนาทราชการ</q-item-label
>
</q-item-section>
<q-item-section>
<q-item-label style="color: gray">
@ -842,7 +961,9 @@ const putformData = () => {
<q-item-section>
<q-item-label>
<q-icon name="mdi-label" color="grey-4" class="q-pr-sm" />
3.2. พฤตกรรมของผทดลองปฏหนาทราชการ</q-item-label>
3.2.
พฤตกรรมของผทดลองปฏหนาทราชการ</q-item-label
>
</q-item-section>
<q-item-section>
<q-item-label style="color: gray">
@ -907,7 +1028,11 @@ const putformData = () => {
<q-avatar class="bg-grey-2 q-mr-sm" size="28px">4</q-avatar>
การพฒนาผทดลองปฏหนาทราชการ
</div>
<q-card flat bordered class="col-xs-12 col-sm-11 col-md-11 q-pa-sm bg-grey-1">
<q-card
flat
bordered
class="col-xs-12 col-sm-11 col-md-11 q-pa-sm bg-grey-1"
>
<div class="col-xs-12 col-sm-11 col-md-11 q-my-sm">
<div class="row q-gutter-md q-pl-md">
<div class="col-8 text-weight-medium">วข</div>
@ -919,30 +1044,66 @@ const putformData = () => {
<div class="row q-gutter-md align-center q-pl-md">
<div class="col-8">1. การปฐมนเทศ</div>
<div class="col">
<q-input outlined dense type="number" :disable="!status" v-model="orientation" />
<q-input
outlined
dense
type="number"
:disable="!status"
v-model="orientation"
/>
</div>
<div class="col">
<q-input outlined dense type="number" :disable="!status" v-model="orientation_percent" />
<q-input
outlined
dense
type="number"
:disable="!status"
v-model="orientation_percent"
/>
</div>
</div>
<q-separator class="q-my-xs" />
<div class="row q-gutter-md align-center q-pl-md">
<div class="col-8">2. การเรยนรวยตนเอง</div>
<div class="col">
<q-input dense outlined type="number" :disable="!status" v-model="self_learning" />
<q-input
dense
outlined
type="number"
:disable="!status"
v-model="self_learning"
/>
</div>
<div class="col">
<q-input outlined dense type="number" :disable="!status" v-model="self_learning_percent" />
<q-input
outlined
dense
type="number"
:disable="!status"
v-model="self_learning_percent"
/>
</div>
</div>
<q-separator class="q-my-xs" />
<div class="row q-gutter-md align-center q-pl-md">
<div class="col-8">3. การอบรมสมนารวมก</div>
<div class="col">
<q-input outlined dense type="number" :disable="!status" v-model="training_seminar" />
<q-input
outlined
dense
type="number"
:disable="!status"
v-model="training_seminar"
/>
</div>
<div class="col">
<q-input outlined dense type="number" :disable="!status" v-model="training_seminar_percent" />
<q-input
outlined
dense
type="number"
:disable="!status"
v-model="training_seminar_percent"
/>
</div>
</div>
<q-separator class="q-my-xs" />
@ -951,10 +1112,22 @@ const putformData = () => {
4. การอบรมอ ตามทหนวยงานกำหนด (าม)
</div>
<div class="col">
<q-input outlined dense type="number" :disable="!status" v-model="other_training" />
<q-input
outlined
dense
type="number"
:disable="!status"
v-model="other_training"
/>
</div>
<div class="col">
<q-input outlined dense type="number" :disable="!status" v-model="other_training_percent" />
<q-input
outlined
dense
type="number"
:disable="!status"
v-model="other_training_percent"
/>
</div>
</div>
<q-separator class="q-my-xs" />
@ -967,105 +1140,6 @@ const putformData = () => {
<div class="col q-pl-md">{{ score5 }}</div>
</div>
</div>
<!-- <q-list dense>
<q-item dense tag="label" v-ripple>
<q-item-section>
<q-item-label>1. การปฐมนเทศ</q-item-label>
</q-item-section>
<q-item-section side>
<div class="row">
<q-radio
checked-icon="task_alt"
unchecked-icon="panorama_fish_eye"
v-model="orientation"
val="1"
label="ดำเนินการเเล้ว"
/>
<q-radio
checked-icon="task_alt"
unchecked-icon="panorama_fish_eye"
v-model="orientation"
val="0"
label=" ยังไม่ได้ดำเนินการ"
/>
</div>
</q-item-section>
</q-item>
<q-separator class="q-my-xs" />
<q-item dense tag="label" v-ripple>
<q-item-section>
<q-item-label>2. การเรยนรวยตนเอง</q-item-label>
</q-item-section>
<q-item-section side>
<div class="row">
<q-radio
checked-icon="task_alt"
unchecked-icon="panorama_fish_eye"
v-model="self_learning"
val="1"
label="ดำเนินการเเล้ว"
/>
<q-radio
checked-icon="task_alt"
unchecked-icon="panorama_fish_eye"
v-model="self_learning"
val="0"
label=" ยังไม่ได้ดำเนินการ"
/>
</div>
</q-item-section>
</q-item>
<q-separator class="q-my-xs" />
<q-item dense tag="label" v-ripple>
<q-item-section>
<q-item-label>3. การอบรมสมนารวมก</q-item-label>
</q-item-section>
<q-item-section side>
<div class="row">
<q-radio
checked-icon="task_alt"
unchecked-icon="panorama_fish_eye"
v-model="training_seminar"
val="1"
label="ดำเนินการเเล้ว"
/>
<q-radio
checked-icon="task_alt"
unchecked-icon="panorama_fish_eye"
v-model="training_seminar"
val="0"
label=" ยังไม่ได้ดำเนินการ"
/>
</div>
</q-item-section>
</q-item>
<q-separator class="q-my-xs" />
<q-item dense tag="label" v-ripple>
<q-item-section>
<q-item-label
>4. การอบรมอ ตามทหนวยงานกำหนด (าม)</q-item-label
>
</q-item-section>
<q-item-section side>
<div class="row">
<q-radio
checked-icon="task_alt"
unchecked-icon="panorama_fish_eye"
v-model="other_training"
val="1"
label="ดำเนินการเเล้ว"
/>
<q-radio
checked-icon="task_alt"
unchecked-icon="panorama_fish_eye"
v-model="other_training"
val="0"
label=" ยังไม่ได้ดำเนินการ"
/>
</div>
</q-item-section>
</q-item>
</q-list> -->
</q-card>
</div>
</div>
@ -1073,13 +1147,22 @@ const putformData = () => {
<div class="row col-12 q-gutter-lg no-margin justify-center">
<div class="col-xs-12 col-sm-11 row justify-center">
<div class="col-12 text-top0 items-center">
<!-- <q-avatar class="bg-grey-2 q-mr-sm" size="28px">5</q-avatar> -->
สรปผลการพฒนา
</div>
<div class="col-12">
<q-select :disable="!status" class="col-xs-12" dense v-model="develop_result" outlined
:options="develop_result_option" option-label="name" option-value="value" label="เลือกสรุปผลการพัฒนา"
map-options emit-value />
<q-select
:disable="!status"
class="col-xs-12"
dense
v-model="develop_result"
outlined
:options="develop_result_option"
option-label="name"
option-value="value"
label="เลือกสรุปผลการพัฒนา"
map-options
emit-value
/>
</div>
</div>
</div>
@ -1087,13 +1170,22 @@ const putformData = () => {
<div class="row col-12 q-gutter-lg no-margin justify-center">
<div class="col-xs-12 col-sm-11 row justify-center">
<div class="col-12 text-top0 items-center">
<!-- <q-avatar class="bg-grey-2 q-mr-sm" size="28px">5</q-avatar> -->
สรปผล การประเมนผลทดลองปฏหนาทราชการ
</div>
<div class="col-12">
<q-select :disable="!status" class="col-xs-12" dense v-model="evaluate_result" outlined
:options="evaluate_result_option" option-label="name" option-value="value"
label="เลือกสรุปผล การประเมินผลทดลองปฏิบัติหน้าที่ราชการ" map-options emit-value />
<q-select
:disable="!status"
class="col-xs-12"
dense
v-model="evaluate_result"
outlined
:options="evaluate_result_option"
option-label="name"
option-value="value"
label="เลือกสรุปผล การประเมินผลทดลองปฏิบัติหน้าที่ราชการ"
map-options
emit-value
/>
</div>
</div>
</div>
@ -1110,11 +1202,26 @@ const putformData = () => {
ประธานคณะกรรมการประเมนผลการปฏหนาทราชการ
</div>
<div class="col-12 row q-col-gutter-md">
<q-select class="col-xs-12 col-sm-8" dense v-model="director_id" outlined label="ชื่อ-นามสกุล"
option-label="name" disable />
<q-select
class="col-xs-12 col-sm-8"
dense
v-model="director_id"
outlined
label="ชื่อ-นามสกุล"
option-label="name"
disable
/>
<div class="col-xs-12 col-sm-4">
<datepicker menu-class-name="modalfix" v-model="dateAutherise" :locale="'th'" :readonly="!status"
autoApply borderless :enableTimePicker="false" week-start="0">
<datepicker
menu-class-name="modalfix"
v-model="dateAutherise"
:locale="'th'"
:readonly="!status"
autoApply
borderless
:enableTimePicker="false"
week-start="0"
>
<template #year="{ year }">
{{ year + 543 }}
</template>
@ -1122,10 +1229,23 @@ const putformData = () => {
{{ parseInt(value + 543) }}
</template>
<template #trigger>
<q-input outlined dense :disable="!status" class="full-width datepicker col-3" :model-value="dateAutherise != null ? date2Thai(dateAutherise) : null
" :label="`${'ลงวันที่'}`" :rules="[(val) => !!val || `${'กรุณาเลือกลงวันที่'}`]">
<q-input
outlined
dense
:disable="!status"
class="full-width datepicker col-3"
:model-value="
dateAutherise != null ? date2Thai(dateAutherise) : null
"
:label="`${'ลงวันที่'}`"
:rules="[(val) => !!val || `${'กรุณาเลือกลงวันที่'}`]"
>
<template v-slot:prepend>
<q-icon name="event" class="cursor-pointer" style="color: var(--q-primary)">
<q-icon
name="event"
class="cursor-pointer"
style="color: var(--q-primary)"
>
</q-icon>
</template>
</q-input>
@ -1141,11 +1261,26 @@ const putformData = () => {
<!-- ความเหนของผอำนาจสงบรรจตามมาตรา 52 -->
</div>
<div class="col-12 row q-col-gutter-md">
<q-select class="col-xs-12 col-sm-8" dense v-model="director_id2" outlined label="ชื่อ-นามสกุล" disable
option-label="name" />
<q-select
class="col-xs-12 col-sm-8"
dense
v-model="director_id2"
outlined
label="ชื่อ-นามสกุล"
disable
option-label="name"
/>
<div class="col-xs-12 col-sm-4">
<datepicker menu-class-name="modalfix" v-model="director1_dated" :locale="'th'" autoApply borderless
:readonly="!status" :enableTimePicker="false" week-start="0">
<datepicker
menu-class-name="modalfix"
v-model="director1_dated"
:locale="'th'"
autoApply
borderless
:readonly="!status"
:enableTimePicker="false"
week-start="0"
>
<template #year="{ year }">
{{ year + 543 }}
</template>
@ -1153,12 +1288,25 @@ const putformData = () => {
{{ parseInt(value + 543) }}
</template>
<template #trigger>
<q-input outlined dense :disable="!status" class="full-width datepicker col-3" :model-value="director1_dated != null
? date2Thai(director1_dated)
: null
" :label="`${'ลงวันที่'}`" :rules="[(val) => !!val || `${'กรุณาเลือกลงวันที่'}`]">
<q-input
outlined
dense
:disable="!status"
class="full-width datepicker col-3"
:model-value="
director1_dated != null
? date2Thai(director1_dated)
: null
"
:label="`${'ลงวันที่'}`"
:rules="[(val) => !!val || `${'กรุณาเลือกลงวันที่'}`]"
>
<template v-slot:prepend>
<q-icon name="event" class="cursor-pointer" style="color: var(--q-primary)">
<q-icon
name="event"
class="cursor-pointer"
style="color: var(--q-primary)"
>
</q-icon>
</template>
</q-input>
@ -1174,11 +1322,26 @@ const putformData = () => {
<!-- อำนาจสงบรรจตามมาตรา 52 -->
</div>
<div class="col-12 row q-col-gutter-md">
<q-select class="col-xs-12 col-sm-8" dense v-model="director_id3" outlined label="ชื่อ-นามสกุล" disable
option-label="name" />
<q-select
class="col-xs-12 col-sm-8"
dense
v-model="director_id3"
outlined
label="ชื่อ-นามสกุล"
disable
option-label="name"
/>
<div class="col-xs-12 col-sm-4">
<datepicker menu-class-name="modalfix" v-model="director2_dated" :locale="'th'" autoApply
:readonly="!status" borderless :enableTimePicker="false" week-start="0">
<datepicker
menu-class-name="modalfix"
v-model="director2_dated"
:locale="'th'"
autoApply
:readonly="!status"
borderless
:enableTimePicker="false"
week-start="0"
>
<template #year="{ year }">
{{ year + 543 }}
</template>
@ -1186,12 +1349,25 @@ const putformData = () => {
{{ parseInt(value + 543) }}
</template>
<template #trigger>
<q-input outlined dense :disable="!status" class="full-width datepicker col-3" :model-value="director2_dated != null
? date2Thai(director2_dated)
: null
" :label="`${'ลงวันที่'}`" :rules="[(val) => !!val || `${'กรุณาเลือกลงวันที่'}`]">
<q-input
outlined
dense
:disable="!status"
class="full-width datepicker col-3"
:model-value="
director2_dated != null
? date2Thai(director2_dated)
: null
"
:label="`${'ลงวันที่'}`"
:rules="[(val) => !!val || `${'กรุณาเลือกลงวันที่'}`]"
>
<template v-slot:prepend>
<q-icon name="event" class="cursor-pointer" style="color: var(--q-primary)">
<q-icon
name="event"
class="cursor-pointer"
style="color: var(--q-primary)"
>
</q-icon>
</template>
</q-input>
@ -1202,7 +1378,10 @@ const putformData = () => {
</div>
</div>
<q-toolbar class="text-primary" v-if="routeName == 'probationFormAddevaluascore'">
<q-toolbar
class="text-primary"
v-if="routeName == 'probationFormAddevaluascore'"
>
<q-space />
<q-btn label="บันทึก" color="secondary" @click="savaForm" />
</q-toolbar>

View file

@ -42,40 +42,6 @@ const director_id2 = ref<any>(null);
const director_id3 = ref<any>(null);
const myForm = ref<any>(null);
onMounted(() => {
fecthAssign(assignId.value);
});
const fecthAssign = async (id: string) => {
showLoader();
await http
.get(config.API.evaluateChairman(id))
.then(async (res: any) => {
person.value = await res.data.data.person;
assign.value = await res.data.data.assign;
evaluate_no.value = await res.data.data.evaluate_no;
start_date.value = await res.data.data.start_date;
date_finish.value = await res.data.data.end_date;
director_id.value = res.data.data.chairman.name;
director_id2.value = res.data.data.commander.name;
if (res.data.data.mentors.length != 0) {
director_id3.value = res.data.data.mentors[0].name;
}
})
.catch((e) => {
messageError($q, e);
})
.finally(() => {
hideLoader();
});
};
const list2_1 = probationStore.behavior_no1;
const list2_2 = probationStore.behavior_no2;
const list2_3 = probationStore.behavior_no3;
const director1_dated = ref<any>("");
const director2_dated = ref<any>("");
@ -114,6 +80,40 @@ const develop_result_option = ref<any>([
]);
// footer
const dateAutherise = ref<any>(null);
onMounted(() => {
fecthAssign(assignId.value);
});
const fecthAssign = async (id: string) => {
showLoader();
await http
.get(config.API.evaluateChairman(id))
.then(async (res: any) => {
person.value = await res.data.data.person;
assign.value = await res.data.data.assign;
evaluate_no.value = await res.data.data.evaluate_no;
start_date.value = await res.data.data.start_date;
date_finish.value = await res.data.data.end_date;
director_id.value = res.data.data.chairman.name;
director_id2.value = res.data.data.commander.name;
if (res.data.data.mentors.length != 0) {
director_id3.value = res.data.data.mentors[0].name;
}
})
.catch((e) => {
messageError($q, e);
})
.finally(() => {
hideLoader();
});
};
const list2_1 = probationStore.behavior_no1;
const list2_2 = probationStore.behavior_no2;
const list2_3 = probationStore.behavior_no3;
// score
const score1 = computed(() => {
@ -238,8 +238,6 @@ const variablesToWatch = [learn_level, apply_level, success_level];
const savaForm = async () => {
let hasError = false;
// await selectResult1.value.validate();
// await selectResult2.value.validate();
if (
learn_level.value === 0 ||
apply_level.value === 0 ||
@ -942,105 +940,6 @@ watch(lengthdiscipline_level, (newLength) => {
<q-input outlined dense type="number" v-model="other_training_percent" />
</div>
</div>
<!-- <q-list dense>
<q-item dense tag="label" v-ripple>
<q-item-section>
<q-item-label>1. การปฐมนเทศ</q-item-label>
</q-item-section>
<q-item-section side>
<div class="row">
<q-radio
checked-icon="task_alt"
unchecked-icon="panorama_fish_eye"
v-model="orientation"
val="1"
label="ดำเนินการเเล้ว"
/>
<q-radio
checked-icon="task_alt"
unchecked-icon="panorama_fish_eye"
v-model="orientation"
val="0"
label=" ยังไม่ได้ดำเนินการ"
/>
</div>
</q-item-section>
</q-item>
<q-separator class="q-my-xs" />
<q-item dense tag="label" v-ripple>
<q-item-section>
<q-item-label>2. การเรยนรวยตนเอง</q-item-label>
</q-item-section>
<q-item-section side>
<div class="row">
<q-radio
checked-icon="task_alt"
unchecked-icon="panorama_fish_eye"
v-model="self_learning"
val="1"
label="ดำเนินการเเล้ว"
/>
<q-radio
checked-icon="task_alt"
unchecked-icon="panorama_fish_eye"
v-model="self_learning"
val="0"
label=" ยังไม่ได้ดำเนินการ"
/>
</div>
</q-item-section>
</q-item>
<q-separator class="q-my-xs" />
<q-item dense tag="label" v-ripple>
<q-item-section>
<q-item-label>3. การอบรมสมนารวมก</q-item-label>
</q-item-section>
<q-item-section side>
<div class="row">
<q-radio
checked-icon="task_alt"
unchecked-icon="panorama_fish_eye"
v-model="training_seminar"
val="1"
label="ดำเนินการเเล้ว"
/>
<q-radio
checked-icon="task_alt"
unchecked-icon="panorama_fish_eye"
v-model="training_seminar"
val="0"
label=" ยังไม่ได้ดำเนินการ"
/>
</div>
</q-item-section>
</q-item>
<q-separator class="q-my-xs" />
<q-item dense tag="label" v-ripple>
<q-item-section>
<q-item-label
>4. การอบรมอ ตามทหนวยงานกำหนด (าม)</q-item-label
>
</q-item-section>
<q-item-section side>
<div class="row">
<q-radio
checked-icon="task_alt"
unchecked-icon="panorama_fish_eye"
v-model="other_training"
val="1"
label="ดำเนินการเเล้ว"
/>
<q-radio
checked-icon="task_alt"
unchecked-icon="panorama_fish_eye"
v-model="other_training"
val="0"
label=" ยังไม่ได้ดำเนินการ"
/>
</div>
</q-item-section>
</q-item>
</q-list> -->
<q-separator class="q-my-xs" />
<div class="col-xs-12 col-sm-11 col-md-11 q-my-sm">
<div class="row q-gutter-md q-pl-sm">
@ -1076,7 +975,6 @@ watch(lengthdiscipline_level, (newLength) => {
<div class="row col-12 q-gutter-lg no-margin justify-center">
<div class="col-xs-12 col-sm-11 row justify-center">
<div class="col-12 text-top0 items-center">
<!-- <q-avatar class="bg-grey-2 q-mr-sm" size="28px">5</q-avatar> -->
สรปผล การประเมนผลทดลองปฎหนาทราชการ
</div>
<div class="col-12">
@ -1200,7 +1098,6 @@ watch(lengthdiscipline_level, (newLength) => {
<div class="col-12">
<q-separator size="3px" color="grey-2" />
</div>
<!-- <Footer /> -->
<div class="row col-12">
<q-space />
<q-btn label="บันทึก" color="secondary" @click="savaForm" v-if="status" />

View file

@ -28,26 +28,6 @@ const assign = ref<any>([]);
const mentors = ref<any>([]);
const commander = ref<any>([]);
const status = ref<boolean>(true);
const saveEdit = async (id: string) => {
await myForm.value.validate().then((result: boolean) => {
if (result) {
dialogConfirm($q, async () => await postData("put"));
}else {
dialogMessageNotify($q, "กรุณากรอกข้อมูลให้ครบ");
}
});
};
// const edit = () => {
// status.value = true;
// };
// const cancel = () => {
// status.value = false;
// };
onMounted(() => {
fecthAssign(assignId.value);
fecthResult(assignId.value);
});
const ID = ref<string>('')
const date_start = ref<Date>(new Date());
const date_finish = ref<Date>();
@ -59,13 +39,25 @@ const chairman_dated = ref<Date>();
const director1_dated = ref<any>("");
const director2_dated = ref<any>("");
const fullname = ref<string>("");
const director_id = ref<any>(null);
const director_id2 = ref<any>(null);
const director_id3 = ref<any>(null);
const optionDirector = ref<any>([]);
const saveEdit = async (id: string) => {
await myForm.value.validate().then((result: boolean) => {
if (result) {
dialogConfirm($q, async () => await postData("put"));
}else {
dialogMessageNotify($q, "กรุณากรอกข้อมูลให้ครบ");
}
});
};
const fecthAssign = async (id: string) => {
showLoader();
await http
.get(config.API.evaluateReportcreate(id))
.then((res) => {
// assign.value = res.data.data.assign;
mentors.value = res.data.data.mentors;
date_start.value = res.data.data.assign.date_start;
date_finish.value = res.data.data.assign.date_finish;
@ -96,7 +88,6 @@ const fecthResult = async (id: string) => {
if (res.data.data != null) {
const data = await res.data.data.evaluate;
ID.value = data.id
// fullname.value = res.data.data.profile.name;
date_start.value = data.date_start;
date_finish.value = data.date_finish;
develop.value = await Number(data.develop_complete);
@ -128,11 +119,7 @@ const optionsResult = [
},
];
const director_id = ref<any>(null);
const director_id2 = ref<any>(null);
const director_id3 = ref<any>(null);
const optionDirector = ref<any>([]);
const savaForm = async () => {
await myForm.value.validate().then((result: boolean) => {
@ -203,7 +190,6 @@ const postData = async (action: string) => {
})
.finally(() => {
status.value = false;
// fecthAssign(assignId.value);
fecthResult(assignId.value);
});
}
@ -213,13 +199,17 @@ const selectRuslt = () => {
expand_month.value = "";
}
};
onMounted(() => {
fecthAssign(assignId.value);
fecthResult(assignId.value);
});
</script>
<template>
<div class="row col-12">
<div class="toptitle text-dark col-12 row items-center q-gutter-md">
<div>แบบรายงานการประเมนฯ</div>
<!-- <q-space /> -->
<q-btn
v-if="!status"
size="12px"
@ -246,37 +236,6 @@ const selectRuslt = () => {
</q-list>
</q-menu>
</q-btn>
<!-- <div v-if="action == 'edit'">
<div v-if="status == false">
<q-btn
dense
flat
round
color="primary"
@click="edit()"
icon="mdi-pencil-outline"
>
<q-tooltip>แกไขขอม</q-tooltip>
</q-btn>
</div>
<div v-else>
<q-btn dense flat round color="red" @click="cancel()" icon="mdi-undo">
<q-tooltip>ยกเล</q-tooltip>
</q-btn>
<q-btn
dense
flat
round
class="q-ml-sm"
color="public"
@click="saveEdit(assignId)"
icon="mdi-content-save-outline"
>
<q-tooltip>นทกขอม</q-tooltip>
</q-btn>
</div>
</div> -->
</div>
<q-form ref="myForm">
<div class="row col-12">

View file

@ -2,10 +2,9 @@
import { ref, onMounted, watch } from "vue";
import { useQuasar } from "quasar";
import { useProbationDataStore } from "@/modules/05_placement/storeProbation";
import { useCounterMixin } from "@/stores/mixin";
import { useRouter, useRoute } from "vue-router";
import http from "@/plugins/http";
import config from "@/app.config";
@ -25,7 +24,6 @@ const {
notifyError,
dateToISO,
messageError,
showLoader,
hideLoader,
dialogConfirm,
} = mixin;
@ -41,6 +39,36 @@ const evaluate_no = ref<number>(1);
const dataArr = ref<any>();
const checkArray = ref<number>(0);
const list1_1 = ref<any>([]);
const option = ref<any>([]);
const evaluate_expenct_level = ref<any>([{ id: "1", label: "ผลผลิตของงานที่คาดหวัง 1", level: 0 }]);
const evaluate_ouptut = ref<any>([{ level: 0, text: "" }]);
const knowledge_level = ref<number>(0);
const skill_level = ref<number>(0);
const competency_level = ref<number>(0);
const learn_level = ref<number>(0);
const apply_level = ref<number>(0);
const etc = ref<any>(false); // checkBox 1.8
const achievement_other = ref<any>({ text: "", level: 0 });
const achievement_strength_desc = ref<string>("");
const achievement_improve_desc = ref<string>("");
const conduct_level = ref<any>([]);
const moral_level = ref<any>([]);
const discipline_level = ref<any>([]);
const etc2 = ref<any>(false); // checkBox 2.4
const behavio_orther = ref<any>({ text: "", level: 0 });
const behavior_strength_desc = ref<string>("");
const behavior_improve_desc = ref<string>("");
const orientation = ref<any>(null);
const self_learning = ref<any>(null);
const training_seminar = ref<any>(null);
const other_training = ref<any>(null);
const Autherise = ref<any>(null);
const dateAutherise = ref<any>(new Date());
const achievement_strengthRef = ref<any>(null);
const achievement_inproveRef = ref<any>(null);
const behavio_strengthRef = ref<any>(null);
const behavio_inproveRef = ref<any>(null);
const edit = () => {
status.value = true;
@ -55,50 +83,12 @@ const props = defineProps({
action: String,
});
onMounted(async () => {
if (props.tab && props.action == "edit") {
evaluate_no.value = Number(props.tab.charAt(4));
dataArr.value = await props.data;
fecthFormdata();
}
});
watch(props, async () => {
if (props.tab && props.action == "edit") {
evaluate_no.value = Number(props.tab.charAt(4));
dataArr.value = await props.data;
fectFormfull();
}
});
const fecthFormdata = async () => {
await http
.get(config.API.formevaluateRecord(assignId.value))
.then(async (res: any) => {
await fecthAssignoutput(res.data.data);
await fectFormfull();
// if (props.action == "add") {
// evaluate_no.value = res.data.data.evaluate_no;
// start_date.value = res.data.data.start_date;
// date_finish.value = res.data.data.end_date;
// person.value = res.data.data.person;
// option.value.push(res.data.data.director);
// }
// Autherise.value = res.data.data.director.name;
// list1_1.value = res.data.data.assign_output;
// evaluate_expenct_level.value = await res.data.data.assign_output.map(
// (e: any) => ({
// id: e.id,
// labal: e.output_desc,
// })
// );
// evaluate_ouptut.value = await res.data.data.assign_output.map(
// (e: any) => ({
// id: e.id,
// })
// );
// checkArray.value = list1_1.value.length;
})
.catch((e: any) => {})
.finally(() => {
@ -123,7 +113,6 @@ const fectFormfull = async () => {
fecthFormRound();
};
const fecthFormRound = async () => {
// showLoader();
try {
let data = await dataArr.value;
evaluate_id.value = data.id;
@ -176,15 +165,12 @@ const fecthFormRound = async () => {
}
status.value = false;
// setTimeout(() => {
// hideLoader();
// }, 1000);
} catch (error) {
hideLoader();
}
};
const list1_1 = ref<any>([]);
const list1_2 = [
{ id: "", label: "" },
{ id: "", label: "" },
@ -202,63 +188,18 @@ const list2_1 = probationStore.behavior_no1;
const list2_2 = probationStore.behavior_no2;
const list2_3 = probationStore.behavior_no3;
const option = ref<any>([]);
// part 1
const evaluate_expenct_level = ref<any>([
{ id: "1", label: "ผลผลิตของงานที่คาดหวัง 1", level: 0 },
// { id: "2", label: " 2", level: 0 },
// { id: "3", label: " 3", level: 0 },
// { id: "4", label: " 4", level: 0 },
// { id: "5", label: " 5", level: 0 },
]);
const evaluate_ouptut = ref<any>([
{ level: 0, text: "" },
// { level: 0, text: "" },
// { level: 0, text: "" },
// { level: 0, text: "" },
// { level: 0, text: "" },
]);
const knowledge_level = ref<number>(0);
const skill_level = ref<number>(0);
const competency_level = ref<number>(0);
const learn_level = ref<number>(0);
const apply_level = ref<number>(0);
const etc = ref<any>(false); // checkBox 1.8
const achievement_other = ref<any>({ text: "", level: 0 });
const achievement_strength_desc = ref<string>("");
const achievement_improve_desc = ref<string>("");
// part 2
const conduct_level = ref<any>([]);
const moral_level = ref<any>([]);
const discipline_level = ref<any>([]);
const etc2 = ref<any>(false); // checkBox 2.4
const behavio_orther = ref<any>({ text: "", level: 0 });
const behavior_strength_desc = ref<string>("");
const behavior_improve_desc = ref<string>("");
// part 3
const orientation = ref<any>(null);
const self_learning = ref<any>(null);
const training_seminar = ref<any>(null);
const other_training = ref<any>(null);
// footer
const Autherise = ref<any>(null);
const dateAutherise = ref<any>(new Date());
//rules
const evaluate_ouptutRules = [
(val: any) => (val && val.length > 0) || "กรุณากรอกเหตุผลที่เกิดขึ้น",
];
const achievement_strengthRef = ref<any>(null);
const achievement_strengthRules = [
(val: any) => (val && val.length > 0) || "กรุณากรอกข้อมูลจุดเด่น",
];
const achievement_inproveRef = ref<any>(null);
const behavio_strengthRef = ref<any>(null);
const behavio_strengthRules = [
(val: any) => (val && val.length > 0) || "กรุณากรอกข้อมูลจุดเด่น",
];
const behavio_inproveRef = ref<any>(null);
const savaForm = () => {
achievement_strengthRef.value.validate();
@ -273,14 +214,11 @@ const savaForm = () => {
competency_level.value === 0 ||
learn_level.value === 0 ||
apply_level.value === 0 ||
// success_level.value === 0 ||
achievement_strength_desc.value === "" ||
// achievement_improve_desc.value === "" ||
conduct_level.value.length < 4 ||
moral_level.value.length < 3 ||
discipline_level.value.length < 5 ||
behavior_strength_desc.value === "" ||
// behavior_improve_desc.value === "" ||
orientation.value === null ||
self_learning.value === null ||
training_seminar.value === null
@ -318,10 +256,7 @@ const putformData = () => {
competency_level: competency_level.value,
learn_level: learn_level.value,
apply_level: apply_level.value,
// success_level: success_level.value,
achievement_other: achievement_other.value,
// achievement_other_desc: etc_text.value,
// achievement_other_level: ext_value.value,
achievement_strength_desc: achievement_strength_desc.value,
achievement_improve_desc: achievement_improve_desc.value,
conduct1_level: conduct_level.value[0],
@ -336,8 +271,6 @@ const putformData = () => {
discipline3_level: discipline_level.value[2],
discipline4_level: discipline_level.value[3],
discipline5_level: discipline_level.value[4],
// behavio_orther_desc: etc_text2.value,
// behavio_orther_level: ext_value2.value,
behavio_orther: behavio_orther.value,
behavior_strength_desc: behavior_strength_desc.value,
behavior_improve_desc: behavior_improve_desc.value,
@ -346,7 +279,6 @@ const putformData = () => {
training_seminar: Number(training_seminar.value),
other_training: Number(other_training.value),
assessor_dated: dateToISO(dateAutherise.value),
// commander_dated: dateAutherise.value,
};
dialogConfirm($q, () =>
@ -377,13 +309,28 @@ const editData = async (data: any) => {
messageError($q, e);
});
};
watch(props, async () => {
if (props.tab && props.action == "edit") {
evaluate_no.value = Number(props.tab.charAt(4));
dataArr.value = await props.data;
fectFormfull();
}
});
onMounted(async () => {
if (props.tab && props.action == "edit") {
evaluate_no.value = Number(props.tab.charAt(4));
dataArr.value = await props.data;
fecthFormdata();
}
});
</script>
<template>
<div class="row col-12 no-margin q-pa-sm">
<div class="toptitle text-dark col-12 row items-center q-gutter-md">
<div>แบบบนทกผล (เเล)</div>
<!-- <q-space /> -->
<div v-if="status == false">
<q-btn
dense
@ -418,23 +365,27 @@ const editData = async (data: any) => {
<div class="col-12 text-top0 row items-center">
<q-icon name="mdi-label" color="grey-4" class="q-pr-sm" />
นเรมทดลองปฏหนาทราชการ งแตนท
<span class="text-black q-px-sm">{{
date2Thai(assign.date_start)
}}</span>
<span class="text-black q-px-sm">
{{ date2Thai(assign.date_start) }}
</span>
งวนท
<span class="text-black q-px-sm">{{
date2Thai(assign.date_finish)
}}</span>
<span class="text-black q-px-sm">
{{ date2Thai(assign.date_finish) }}
</span>
</div>
<div class="col-12 text-top0 row items-center">
<q-icon name="mdi-label" color="grey-4" class="q-pr-sm" />
<span class="text-primary q-pr-sm">{{
"ครั้งที่ " + evaluate_no
}}</span>
<span class="text-primary q-pr-sm">
{{ "ครั้งที่ " + evaluate_no }}
</span>
ระหวางวนท
<span class="text-black q-px-sm">{{ date2Thai(start_date) }}</span>
<span class="text-black q-px-sm">
{{ date2Thai(start_date) }}
</span>
งวนท
<span class="text-black q-px-sm">{{ date2Thai(date_finish) }}</span>
<span class="text-black q-px-sm">
{{ date2Thai(date_finish) }}
</span>
</div>
<div class="col-12 q-pt-md">
<q-separator size="3px" color="grey-2" />
@ -512,7 +463,6 @@ const editData = async (data: any) => {
<q-list dense v-for="(list, i) in list1_2" :key="i">
<q-item dense tag="label" v-ripple v-if="i < checkArray">
<q-item-section>
<!-- <q-item-label>{{ list.label }}</q-item-label> -->
<q-input
outlined
dense
@ -554,7 +504,6 @@ const editData = async (data: any) => {
</q-rating>
</q-item-section>
</q-item>
<!-- <q-separator class="q-my-xs" v-if="i + 1 < list1_2.length" /> -->
</q-list>
</q-card>
</div>
@ -760,46 +709,6 @@ const editData = async (data: any) => {
</q-item>
</q-list>
</q-card>
<!-- <q-card class="text-top0 col-12 q-pa-sm q-pl-lg">
<q-list dense>
<q-item dense tag="label" v-ripple>
<q-item-section>
<q-item-label>
<q-icon name="mdi-label" color="grey-4" class="q-pr-sm" />
1.7. ความสำเรจของงานทไดบมอบหมาย</q-item-label
>
</q-item-section>
<q-item-section side>
<q-rating
v-model="success_level"
max="5"
size="sm"
color="grey"
:color-selected="ratingColors"
label="ระดับการประเมินพฤติกรรม"
>
<template v-slot:tip-1>
<q-tooltip>ำกวาความคาดหวงมาก</q-tooltip>
</template>
<template v-slot:tip-2>
<q-tooltip>ำกวาความคาดหวงคอนขางมาก</q-tooltip>
</template>
<template v-slot:tip-3>
<q-tooltip>เปนไปตามความคาดหว</q-tooltip>
</template>
<template v-slot:tip-4>
<q-tooltip>งวาความคาดหวงคอนขางมาก</q-tooltip>
</template>
<template v-slot:tip-5>
<q-tooltip>งกวาความคาดหวงมาก</q-tooltip>
</template>
</q-rating>
</q-item-section>
</q-item>
</q-list>
</q-card> -->
<q-card class="text-top0 col-xs-12 col-sm-11 q-pa-xs q-pl-sm">
<q-list dense>
<q-item dense tag="label" v-ripple>
@ -919,9 +828,6 @@ const editData = async (data: any) => {
/>
</div>
</div>
<!-- Part 2 -->
<!-- <Part2 /> -->
<div class="row col-12 q-gutter-lg no-margin">
<div class="col-12 row">
<div class="col-12 text-top0 items-center">
@ -1140,7 +1046,6 @@ const editData = async (data: any) => {
</q-list>
</q-card>
</div>
<!-- <FormComment /> -->
<div class="row col-12 q-gutter-lg no-margin">
<div class="col-12 row">
<div class="col-12 text-top0 row items-center q-pl-lg">
@ -1183,9 +1088,6 @@ const editData = async (data: any) => {
</div>
</div>
</div>
<!-- Part 3 -->
<!-- <Part3 /> -->
<div class="row col-12 q-gutter-lg no-margin">
<div class="col-12 row justify-center">
<div class="col-12 text-top0 items-center">
@ -1307,9 +1209,6 @@ const editData = async (data: any) => {
</q-card>
</div>
</div>
<!-- Footer -->
<!-- <Footer /> -->
<div class="row col-12 q-gutter-lg no-margin justify-center">
<div class="col-xs-12 col-sm-11 row">
<div class="col-12 text-top2 row items-center">

View file

@ -3,13 +3,12 @@ import { ref, onMounted, watch, computed } from "vue";
import { useQuasar } from "quasar";
import { useProbationDataStore } from "@/modules/05_placement/storeProbation";
import { useCounterMixin } from "@/stores/mixin";
// import { formatDate } from "@fullcalendar/core";
import { useRoute, useRouter } from "vue-router";
import http from "@/plugins/http";
import config from "@/app.config";
import criterion from "@/modules/05_placement/components/Other/Criterion.vue"
import criterion from "@/modules/05_placement/components/Other/Criterion.vue";
const $q = useQuasar();
const route = useRoute();
@ -35,14 +34,57 @@ const evaluate_no = ref<string>("");
const start_date = ref<Date>(new Date());
const date_finish = ref<Date>(new Date());
const round = ref<number>();
const list1_1 = ref<any>([]);
const list1_2 = [{ id: "", label: "" }];
const list2_1 = probationStore.behavior_no1;
const list2_2 = probationStore.behavior_no2;
const list2_3 = probationStore.behavior_no3;
const option = ref<any>([]);
const achievement_strengthRef = ref<any>(null);
const achievement_inproveRef = ref<any>(null);
const behavio_strengthRef = ref<any>(null);
const behavio_inproveRef = ref<any>(null);
const dateToday = ref<Date>(new Date("10-10-2023"));
const dateEnd = ref<Date>(new Date("12-10-2023"));
const period = ref<number>(1);
// part 1
const evaluate_expenct_level = ref<any>([]);
const evaluate_ouptut = ref<any>([]);
const knowledge_level = ref<number>(0);
const skill_level = ref<number>(0);
const competency_level = ref<number>(0);
const learn_level = ref<number>(0);
const apply_level = ref<number>(0);
const success_level = ref<number>(0);
const etc = ref<any>(false); // checkBox 1.8
const achievement_other = ref<any>({ text: "", level: 0 });
const achievement_strength_desc = ref<string>("");
const achievement_improve_desc = ref<string>("");
// part 2
const conduct_level = ref<any>([]);
const moral_level = ref<any>([]);
const discipline_level = ref<any>([]);
const etc2 = ref<any>(false); // checkBox 2.4
const behavio_orther = ref<any>({ text: "", level: 0 });
const behavior_strength_desc = ref<string>("");
const behavior_improve_desc = ref<string>("");
// part 3
const orientation = ref<any>(null);
const self_learning = ref<any>(null);
const training_seminar = ref<any>(null);
const other_training = ref<any>(null);
// footer
const Autherise = ref<any>(null);
const dateAutherise = ref<any>(new Date());
const checkArray = ref<number>(0);
const alerts = Array(20)
.fill(null)
.map(() => ref<boolean>(false));
onMounted(async () => {
await fecthFormdata(assignId.value);
});
const fecthFormdata = async (id: string) => {
await http
.get(config.API.formevaluateRecordCommander(id))
@ -76,83 +118,23 @@ const fecthFormdata = async (id: string) => {
.catch((e: any) => {});
};
const list1_1 = ref<any>([
// { id: "1", label: " 1" },
// { id: "2", label: " 2" },
// { id: "3", label: " 3" },
// { id: "4", label: " 4" },
// { id: "5", label: " 5" },
]);
const list1_2 = [{ id: "", label: "" }];
const list2_1 = probationStore.behavior_no1;
const list2_2 = probationStore.behavior_no2;
const list2_3 = probationStore.behavior_no3;
const option = ref<any>([]);
const dateToday = ref<Date>(new Date("10-10-2023"));
const dateEnd = ref<Date>(new Date("12-10-2023"));
const period = ref<number>(1);
// part 1
const evaluate_expenct_level = ref<any>([]);
const evaluate_ouptut = ref<any>([
// { level: 0, text: "" },
// { level: 0, text: "" },
// { level: 0, text: "" },
// { level: 0, text: "" },
// { level: 0, text: "" },
]);
const knowledge_level = ref<number>(0);
const skill_level = ref<number>(0);
const competency_level = ref<number>(0);
const learn_level = ref<number>(0);
const apply_level = ref<number>(0);
const success_level = ref<number>(0);
const etc = ref<any>(false); // checkBox 1.8
const achievement_other = ref<any>({ text: "", level: 0 });
// const etc_text = ref<string>("");
// const ext_value = ref<number>(0);
const achievement_strength_desc = ref<string>("");
const achievement_improve_desc = ref<string>("");
// part 2
const conduct_level = ref<any>([]);
const moral_level = ref<any>([]);
const discipline_level = ref<any>([]);
const etc2 = ref<any>(false); // checkBox 2.4
const behavio_orther = ref<any>({ text: "", level: 0 });
// const etc_text2 = ref<string>("");
// const ext_value2 = ref<number>(0);
const behavior_strength_desc = ref<string>("");
const behavior_improve_desc = ref<string>("");
// part 3
const orientation = ref<any>(null);
const self_learning = ref<any>(null);
const training_seminar = ref<any>(null);
const other_training = ref<any>(null);
// footer
const Autherise = ref<any>(null);
const dateAutherise = ref<any>(new Date());
//rules
const evaluate_ouptutRules = [
(val: any) => (val && val.length > 0) || "กรุณากรอกเหตุผลที่เกิดขึ้น",
];
const achievement_strengthRef = ref<any>(null);
const achievement_strengthRules = [
(val: any) => (val && val.length > 0) || "กรุณากรอกข้อมูลจุดเด่น",
];
const achievement_inproveRef = ref<any>(null);
const achievement_inproveRules = [
(val: any) => (val && val.length > 0) || "กรุณากรอกข้อมูลสิ่งที่ควรปรับปรุง",
];
const behavio_strengthRef = ref<any>(null);
const behavio_strengthRules = [
(val: any) => (val && val.length > 0) || "กรุณากรอกข้อมูลจุดเด่น",
];
const behavio_inproveRef = ref<any>(null);
const behavio_inproveRules = [
(val: any) => (val && val.length > 0) || "กรุณากรอกข้อมูลสิ่งที่ควรปรับปรุง",
];
@ -186,21 +168,11 @@ const variablesToWatch = [
const ArrayCountbotton = [orientation, self_learning, training_seminar];
const savaForm = () => {
achievement_strengthRef.value.validate();
// achievement_inproveRef.value.validate();
behavio_strengthRef.value.validate();
// behavio_inproveRef.value.validate();
let hasError = false;
// const filterlevel1_1 = evaluate_expenct_level.value.filter(
// (e: any) => e.level == 0
// );
// const filter_ouptut1_2 = evaluate_ouptut.value.filter(
// (e: any) => e.level == 0 || e.text == ""
// );
if (
// filterlevel1_1.length != 0 ||
// filter_ouptut1_2.length != 0 ||
lengthevaluate_expenct_level.value !==
evaluate_expenct_level.value.length ||
lengthevaluate_ouptut.value !== evaluate_ouptut.value.length ||
@ -211,12 +183,10 @@ const savaForm = () => {
apply_level.value === 0 ||
success_level.value === 0 ||
achievement_strength_desc.value === "" ||
// achievement_improve_desc.value === "" ||
lengthconduct.value !== 4 ||
lengthmoral_level.value !== 3 ||
lengthdiscipline_level.value !== 5 ||
behavior_strength_desc.value === "" ||
// behavior_improve_desc.value === "" ||
orientation.value === null ||
self_learning.value === null ||
training_seminar.value === null
@ -287,8 +257,6 @@ const putformData = () => {
apply_level: apply_level.value,
success_level: success_level.value,
achievement_other: achievement_other.value,
// achievement_other_desc: etc_text.value,
// achievement_other_level: ext_value.value,
achievement_strength_desc: achievement_strength_desc.value,
achievement_improve_desc: achievement_improve_desc.value,
conduct1_level: conduct_level.value[0],
@ -303,8 +271,6 @@ const putformData = () => {
discipline3_level: discipline_level.value[2],
discipline4_level: discipline_level.value[3],
discipline5_level: discipline_level.value[4],
// behavio_orther_desc: etc_text2.value,
// behavio_orther_level: ext_value2.value,
behavio_orther: behavio_orther.value,
behavior_strength_desc: behavior_strength_desc.value,
behavior_improve_desc: behavior_improve_desc.value,
@ -313,7 +279,6 @@ const putformData = () => {
training_seminar: Number(training_seminar.value),
other_training: Number(other_training.value),
assessor_dated: dateToISO(dateAutherise.value),
// commander_dated: dateAutherise.value,
};
dialogConfirm($q, async () => await saveformdata(data));
};
@ -376,6 +341,9 @@ const getBordered = (i: boolean) => {
border_custom: i,
};
};
onMounted(async () => {
await fecthFormdata(assignId.value);
});
</script>
<template>
@ -508,7 +476,6 @@ const getBordered = (i: boolean) => {
<q-list dense v-for="(list, i) in list1_2" :key="i">
<q-item dense tag="label" v-ripple v-if="i < checkArray">
<q-item-section>
<!-- <q-item-label>{{ list.label }}</q-item-label> -->
<q-input
outlined
dense
@ -549,7 +516,6 @@ const getBordered = (i: boolean) => {
</q-rating>
</q-item-section>
</q-item>
<!-- <q-separator class="q-my-xs" v-if="i + 1 < list1_2.length" /> -->
</q-list>
</q-card>
</div>

View file

@ -41,6 +41,46 @@ const evaluate_no = ref<number>(1);
const dataArr = ref<any>();
const checkArray = ref<number>(0);
const list1_1 = ref<any>([]);
const option = ref<any>([]);
// part 1
const evaluate_expenct_level = ref<any>([ { id: "1", label: "ผลผลิตของงานที่คาดหวัง 1", level: 0 } ]);
const evaluate_ouptut = ref<any>([ { level: 0, text: "" } ]);
const knowledge_level = ref<number>(0);
const skill_level = ref<number>(0);
const competency_level = ref<number>(0);
const learn_level = ref<number>(0);
const apply_level = ref<number>(0);
const etc = ref<any>(false); // checkBox 1.8
const achievement_other = ref<any>({ text: "", level: 0 });
const achievement_strength_desc = ref<string>("");
const achievement_improve_desc = ref<string>("");
// part 2
const conduct_level = ref<any>([]);
const moral_level = ref<any>([]);
const discipline_level = ref<any>([]);
const etc2 = ref<any>(false); // checkBox 2.4
const behavio_orther = ref<any>({ text: "", level: 0 });
const behavior_strength_desc = ref<string>("");
const behavior_improve_desc = ref<string>("");
// part 3
const orientation = ref<any>(null);
const self_learning = ref<any>(null);
const training_seminar = ref<any>(null);
const other_training = ref<any>(null);
// footer
const Autherise = ref<any>(null);
const dateAutherise = ref<any>(new Date());
//rules
const evaluate_ouptutRules = [
(val: any) => (val && val.length > 0) || "กรุณากรอกเหตุผลที่เกิดขึ้น",
];
const achievement_strengthRef = ref<any>(null);
const achievement_inproveRef = ref<any>(null);
const behavio_strengthRef = ref<any>(null);
const behavio_inproveRef = ref<any>(null);
const edit = () => {
status.value = true;
@ -55,50 +95,12 @@ const props = defineProps({
action: String,
});
onMounted(async () => {
if (props.tab && props.action == "edit") {
evaluate_no.value = Number(props.tab.charAt(4));
dataArr.value = await props.data;
fecthFormdata();
}
});
watch(props, async () => {
if (props.tab && props.action == "edit") {
evaluate_no.value = Number(props.tab.charAt(4));
dataArr.value = await props.data;
fectFormfull();
}
});
const fecthFormdata = async () => {
await http
.get(config.API.formevaluateRecordCommander(assignId.value))
.then(async (res: any) => {
await fecthAssignoutput(res.data.data);
await fectFormfull();
// if (props.action == "add") {
// evaluate_no.value = res.data.data.evaluate_no;
// start_date.value = res.data.data.start_date;
// date_finish.value = res.data.data.end_date;
// person.value = res.data.data.person;
// option.value.push(res.data.data.director);
// }
// Autherise.value = res.data.data.director.name;
// list1_1.value = res.data.data.assign_output;
// evaluate_expenct_level.value = await res.data.data.assign_output.map(
// (e: any) => ({
// id: e.id,
// labal: e.output_desc,
// })
// );
// evaluate_ouptut.value = await res.data.data.assign_output.map(
// (e: any) => ({
// id: e.id,
// })
// );
// checkArray.value = list1_1.value.length;
})
.catch((e: any) => {})
.finally(() => {
@ -123,7 +125,6 @@ const fectFormfull = async () => {
fecthFormRound();
};
const fecthFormRound = async () => {
// showLoader();
try {
let data = await dataArr.value;
evaluate_id.value = data.id;
@ -176,15 +177,11 @@ const fecthFormRound = async () => {
}
status.value = false;
// setTimeout(() => {
// hideLoader();
// }, 1000);
} catch (error) {
hideLoader();
}
};
const list1_1 = ref<any>([]);
const list1_2 = [
{ id: "", label: "" },
{ id: "", label: "" },
@ -202,63 +199,13 @@ const list2_1 = probationStore.behavior_no1;
const list2_2 = probationStore.behavior_no2;
const list2_3 = probationStore.behavior_no3;
const option = ref<any>([]);
// part 1
const evaluate_expenct_level = ref<any>([
{ id: "1", label: "ผลผลิตของงานที่คาดหวัง 1", level: 0 },
// { id: "2", label: " 2", level: 0 },
// { id: "3", label: " 3", level: 0 },
// { id: "4", label: " 4", level: 0 },
// { id: "5", label: " 5", level: 0 },
]);
const evaluate_ouptut = ref<any>([
{ level: 0, text: "" },
// { level: 0, text: "" },
// { level: 0, text: "" },
// { level: 0, text: "" },
// { level: 0, text: "" },
]);
const knowledge_level = ref<number>(0);
const skill_level = ref<number>(0);
const competency_level = ref<number>(0);
const learn_level = ref<number>(0);
const apply_level = ref<number>(0);
const etc = ref<any>(false); // checkBox 1.8
const achievement_other = ref<any>({ text: "", level: 0 });
const achievement_strength_desc = ref<string>("");
const achievement_improve_desc = ref<string>("");
// part 2
const conduct_level = ref<any>([]);
const moral_level = ref<any>([]);
const discipline_level = ref<any>([]);
const etc2 = ref<any>(false); // checkBox 2.4
const behavio_orther = ref<any>({ text: "", level: 0 });
const behavior_strength_desc = ref<string>("");
const behavior_improve_desc = ref<string>("");
// part 3
const orientation = ref<any>(null);
const self_learning = ref<any>(null);
const training_seminar = ref<any>(null);
const other_training = ref<any>(null);
// footer
const Autherise = ref<any>(null);
const dateAutherise = ref<any>(new Date());
//rules
const evaluate_ouptutRules = [
(val: any) => (val && val.length > 0) || "กรุณากรอกเหตุผลที่เกิดขึ้น",
];
const achievement_strengthRef = ref<any>(null);
const achievement_strengthRules = [
(val: any) => (val && val.length > 0) || "กรุณากรอกข้อมูลจุดเด่น",
];
const achievement_inproveRef = ref<any>(null);
const behavio_strengthRef = ref<any>(null);
const behavio_strengthRules = [
(val: any) => (val && val.length > 0) || "กรุณากรอกข้อมูลจุดเด่น",
];
const behavio_inproveRef = ref<any>(null);
const savaForm = () => {
achievement_strengthRef.value.validate();
@ -273,14 +220,11 @@ const savaForm = () => {
competency_level.value === 0 ||
learn_level.value === 0 ||
apply_level.value === 0 ||
// success_level.value === 0 ||
achievement_strength_desc.value === "" ||
// achievement_improve_desc.value === "" ||
conduct_level.value.length < 4 ||
moral_level.value.length < 3 ||
discipline_level.value.length < 5 ||
behavior_strength_desc.value === "" ||
// behavior_improve_desc.value === "" ||
orientation.value === null ||
self_learning.value === null ||
training_seminar.value === null
@ -318,10 +262,7 @@ const putformData = () => {
competency_level: competency_level.value,
learn_level: learn_level.value,
apply_level: apply_level.value,
// success_level: success_level.value,
achievement_other: achievement_other.value,
// achievement_other_desc: etc_text.value,
// achievement_other_level: ext_value.value,
achievement_strength_desc: achievement_strength_desc.value,
achievement_improve_desc: achievement_improve_desc.value,
conduct1_level: conduct_level.value[0],
@ -336,8 +277,6 @@ const putformData = () => {
discipline3_level: discipline_level.value[2],
discipline4_level: discipline_level.value[3],
discipline5_level: discipline_level.value[4],
// behavio_orther_desc: etc_text2.value,
// behavio_orther_level: ext_value2.value,
behavio_orther: behavio_orther.value,
behavior_strength_desc: behavior_strength_desc.value,
behavior_improve_desc: behavior_improve_desc.value,
@ -346,7 +285,6 @@ const putformData = () => {
training_seminar: Number(training_seminar.value),
other_training: Number(other_training.value),
assessor_dated: dateToISO(dateAutherise.value),
// commander_dated: dateAutherise.value,
};
dialogConfirm($q, () =>
@ -380,13 +318,28 @@ const editData = async (data: any) => {
messageError($q, e);
});
};
watch(props, async () => {
if (props.tab && props.action == "edit") {
evaluate_no.value = Number(props.tab.charAt(4));
dataArr.value = await props.data;
fectFormfull();
}
});
onMounted(async () => {
if (props.tab && props.action == "edit") {
evaluate_no.value = Number(props.tab.charAt(4));
dataArr.value = await props.data;
fecthFormdata();
}
});
</script>
<template>
<div class="row col-12 no-margin q-pa-sm">
<div class="toptitle text-dark col-12 row items-center q-gutter-md">
<div>แบบบนทกผล (เเล)</div>
<!-- <q-space /> -->
<div>แบบบนทกผล (งคบบญชา)</div>
<div v-if="status == false">
<q-btn
dense
@ -515,7 +468,6 @@ const editData = async (data: any) => {
<q-list dense v-for="(list, i) in list1_2" :key="i">
<q-item dense tag="label" v-ripple v-if="i < checkArray">
<q-item-section>
<!-- <q-item-label>{{ list.label }}</q-item-label> -->
<q-input
outlined
dense
@ -557,7 +509,6 @@ const editData = async (data: any) => {
</q-rating>
</q-item-section>
</q-item>
<!-- <q-separator class="q-my-xs" v-if="i + 1 < list1_2.length" /> -->
</q-list>
</q-card>
</div>
@ -763,46 +714,6 @@ const editData = async (data: any) => {
</q-item>
</q-list>
</q-card>
<!-- <q-card class="text-top0 col-12 q-pa-sm q-pl-lg">
<q-list dense>
<q-item dense tag="label" v-ripple>
<q-item-section>
<q-item-label>
<q-icon name="mdi-label" color="grey-4" class="q-pr-sm" />
1.7. ความสำเรจของงานทไดบมอบหมาย</q-item-label
>
</q-item-section>
<q-item-section side>
<q-rating
v-model="success_level"
max="5"
size="sm"
color="grey"
:color-selected="ratingColors"
label="ระดับการประเมินพฤติกรรม"
>
<template v-slot:tip-1>
<q-tooltip>ำกวาความคาดหวงมาก</q-tooltip>
</template>
<template v-slot:tip-2>
<q-tooltip>ำกวาความคาดหวงคอนขางมาก</q-tooltip>
</template>
<template v-slot:tip-3>
<q-tooltip>เปนไปตามความคาดหว</q-tooltip>
</template>
<template v-slot:tip-4>
<q-tooltip>งวาความคาดหวงคอนขางมาก</q-tooltip>
</template>
<template v-slot:tip-5>
<q-tooltip>งกวาความคาดหวงมาก</q-tooltip>
</template>
</q-rating>
</q-item-section>
</q-item>
</q-list>
</q-card> -->
<q-card class="text-top0 col-xs-12 col-sm-11 q-pa-xs q-pl-sm">
<q-list dense>
<q-item dense tag="label" v-ripple>

View file

@ -41,7 +41,6 @@ const fecthAssign = async (id: string) => {
await http
.get(config.API.formevaluateCommander(id))
.then(async (res: any) => {
console.log(res);
await fecthdataAssign(res.data.data);
fullname.value = res.data.data.experimentee
? res.data.data.experimentee.name