Merge branch 'develop' into dev-tee

This commit is contained in:
setthawutttty 2023-08-30 17:13:08 +07:00
commit 04e58b1b8b
8 changed files with 632 additions and 485 deletions

View file

@ -2,6 +2,7 @@
import { ref, onMounted, watch } from "vue";
import { useQuasar } from "quasar";
import { useProbationDataStore } from "@/modules/05_placement/store";
import { useAssignDataStore } from "@/modules/05_placement/storeAssign";
import { useCounterMixin } from "@/stores/mixin";
import { useRouter, useRoute } from "vue-router";
import http from "@/plugins/http";
@ -26,12 +27,10 @@ const {
} = mixin;
const route = useRoute();
const assignId = ref<string>(route.params.form.toString());
const assignStore = useAssignDataStore();
const { assign } = assignStore;
const personalId = ref<string>(route.params.personalId.toString());
const saveEdit = (id: string) => {
dialogConfirm($q, () => console.log("save"));
};
const edit = () => {
status.value = true;
};
@ -41,7 +40,6 @@ const cancel = () => {
};
const person = ref<any>([]);
const assign = ref<any>([]);
const evaluate_no = ref<number>();
const evaluate_id = ref<string>("");
const start_date = ref<Date>(new Date());
@ -106,7 +104,8 @@ onMounted(async () => {
if (props.tab && props.action == "edit") {
evaluate_no.value = Number(props.tab.charAt(4));
dataArr.value = await props.data;
fecthAssign();
// fecthAssign();
fetchEvaluate();
}
});
@ -114,80 +113,90 @@ watch(props, async () => {
if (props.tab && props.action == "edit") {
evaluate_no.value = Number(props.tab.charAt(4));
dataArr.value = await props.data;
fecthAssign();
// fecthAssign();
fetchEvaluate();
}
});
const fecthAssign = async () => {
showLoader();
await http
.get(config.API.evaluateCreate(assignId.value))
.then(async (res: any) => {
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);
// const fecthAssign = async () => {
// showLoader();
// await http
// .get(config.API.evaluateCreate(assignId.value))
// .then(async (res: any) => {
// console.log(res);
Autherise.value = commander.value.name;
evaluate_no.value = res.data.data.evaluate_no;
start_date.value = res.data.data.start_date;
date_finish.value = res.data.data.end_date;
}
})
.catch((e) => {
messageError($q, e);
})
.finally(() => {
if (props.action == "edit") {
fetchEvaluate();
}
hideLoader();
});
};
// 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;
// evaluate_no.value = res.data.data.evaluate_no;
// start_date.value = res.data.data.start_date;
// date_finish.value = res.data.data.end_date;
// }
// })
// .catch((e) => {
// messageError($q, e);
// })
// .finally(() => {
// if (props.action == "edit") {
// fetchEvaluate();
// }
// hideLoader();
// });
// };
const fetchEvaluate = async () => {
let data = await dataArr.value;
evaluate_id.value = data.id;
start_date.value = data.date_start;
date_finish.value = data.date_finish;
knowledge_level.value = data.knowledge_level;
skill_level.value = data.skill_level;
competency_level.value = data.competency_level;
learn_level.value = data.learn_level;
apply_level.value = data.apply_level;
success_level.value = data.success_level;
achievement_other.value.text = data.achievement_other_desc;
achievement_other.value.level = data.achievement_other_level;
conduct_level.value[0] = data.conduct1_level;
conduct_level.value[1] = data.conduct2_level;
conduct_level.value[2] = data.conduct3_level;
conduct_level.value[3] = data.conduct4_level;
moral_level.value[0] = data.moral1_level;
moral_level.value[1] = data.moral2_level;
moral_level.value[2] = data.moral3_level;
discipline_level.value[0] = data.discipline1_level;
discipline_level.value[1] = data.discipline2_level;
discipline_level.value[2] = data.discipline3_level;
discipline_level.value[3] = data.discipline4_level;
discipline_level.value[4] = data.discipline5_level;
behavio_orther.value.text = data.behavior_other_desc;
behavio_orther.value.level = data.behavior_other_level;
behavio_strength_desc.value = data.behavior_strength_desc;
behavior_improve_desc.value = data.behavior_improve_desc;
orientation.value = data.orientation.toString();
self_learning.value = data.self_learning.toString();
training_seminar.value = data.training_seminar.toString();
other_training.value = data.other_training.toString();
if (
data.achievement_other_desc !== "" &&
data.achievement_other_level !== null
) {
etc.value = true;
} else etc.value = false;
if (data.behavior_other_desc !== "" && data.behavior_other_level !== null) {
etc2.value = true;
} else etc2.value = false;
status.value = false;
// showLoader();
try {
let data = await dataArr.value;
evaluate_id.value = data.id;
start_date.value = data.date_start;
date_finish.value = data.date_finish;
knowledge_level.value = data.knowledge_level;
skill_level.value = data.skill_level;
competency_level.value = data.competency_level;
learn_level.value = data.learn_level;
apply_level.value = data.apply_level;
success_level.value = data.success_level;
achievement_other.value.text = data.achievement_other_desc;
achievement_other.value.level = data.achievement_other_level;
conduct_level.value[0] = data.conduct1_level;
conduct_level.value[1] = data.conduct2_level;
conduct_level.value[2] = data.conduct3_level;
conduct_level.value[3] = data.conduct4_level;
moral_level.value[0] = data.moral1_level;
moral_level.value[1] = data.moral2_level;
moral_level.value[2] = data.moral3_level;
discipline_level.value[0] = data.discipline1_level;
discipline_level.value[1] = data.discipline2_level;
discipline_level.value[2] = data.discipline3_level;
discipline_level.value[3] = data.discipline4_level;
discipline_level.value[4] = data.discipline5_level;
behavio_orther.value.text = data.behavior_other_desc;
behavio_orther.value.level = data.behavior_other_level;
behavio_strength_desc.value = data.behavior_strength_desc;
behavior_improve_desc.value = data.behavior_improve_desc;
orientation.value = data.orientation.toString();
self_learning.value = data.self_learning.toString();
training_seminar.value = data.training_seminar.toString();
other_training.value = data.other_training.toString();
if (
data.achievement_other_desc !== "" &&
data.achievement_other_level !== null
) {
etc.value = true;
} else etc.value = false;
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();
}
};
const Autherise = ref<any>(null);
@ -366,7 +375,9 @@ const save = () => {
</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>
งวนท
@ -549,7 +560,8 @@ const save = () => {
<q-item-section>
<q-item-label>
<q-icon name="mdi-label" color="grey-4" class="q-pr-sm" />
1.5. ความสามารถในการปรบใชความรบงานในหนาท</q-item-label
1.5.
ความสามารถในการปรบใชความรบงานในหนาท</q-item-label
>
</q-item-section>
<q-item-section side>
@ -636,7 +648,8 @@ const save = () => {
dense
v-model="etc"
@click="
(achievement_other.text = ''), (achievement_other.level = 0)
(achievement_other.text = ''),
(achievement_other.level = 0)
"
/></q-item-label>
</q-item-section>
@ -644,7 +657,10 @@ const save = () => {
</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">
@ -1146,12 +1162,7 @@ const save = () => {
<!-- <Footer /> -->
<q-toolbar class="text-primary" v-if="routeName == 'FormEvaluateAdd'">
<q-space />
<q-btn
label="บันทึก"
color="secondary"
@click="savaForm"
/>
<q-btn label="บันทึก" color="secondary" @click="savaForm" />
</q-toolbar>
</div>
</div>

View file

@ -2,6 +2,7 @@
import { ref, watch, computed, onMounted } from "vue";
import { useQuasar } from "quasar";
import { useProbationDataStore } from "@/modules/05_placement/store";
import { useAssignDataStore } from "@/modules/05_placement/storeAssign";
import { useCounterMixin } from "@/stores/mixin";
import { useRouter, useRoute } from "vue-router";
import http from "@/plugins/http";
@ -12,6 +13,8 @@ const routeName = router.currentRoute.value.name;
const $q = useQuasar();
const probationStore = useProbationDataStore();
const { ratingColors } = probationStore;
const assignStore = useAssignDataStore();
const { assign } = assignStore;
const mixin = useCounterMixin();
const {
date2Thai,
@ -35,8 +38,6 @@ const edit = () => {
const cancel = () => {
status.value = false;
};
// const person = ref<any>([]);
const assign = ref<any>([]);
const evaluate_no = ref<number>();
const evaluate_id = ref<string>("");
const start_date = ref<Date>(new Date());
@ -46,9 +47,6 @@ const chairman = ref<any>([]);
const commander = ref<any>([]);
const mentors = ref<any>([{ name: "" }, { name: "" }]);
const dataArr = ref<any>();
const round = ref<any>();
const props = defineProps({
tab: String,
data: Object,
@ -59,7 +57,7 @@ onMounted(async () => {
if (props.tab && props.action == "edit") {
evaluate_no.value = Number(props.tab.charAt(4));
dataArr.value = await props.data;
fecthAssign();
await fetchEvaluate();
}
});
@ -67,95 +65,90 @@ watch(props, async () => {
if (props.tab && props.action == "edit") {
evaluate_no.value = Number(props.tab.charAt(4));
dataArr.value = await props.data;
fecthAssign();
await fetchEvaluate();
}
});
const fecthAssign = async () => {
showLoader();
await http
.get(config.API.evaluateChairman(assignId.value))
.then(async (res: any) => {
if (props.action == "add") {
assign.value = res.data.data.assign;
evaluate_no.value = res.data.data.evaluate_no;
start_date.value = res.data.data.start_date;
date_finish.value = res.data.data.end_date;
chairman.value = res.data.data.chairman;
commander.value = res.data.data.commander;
mentors.value = res.data.data.mentors;
}
})
.catch((e) => {
messageError($q, e);
})
.finally(() => {
if (props.action == "edit") {
fetchEvaluate();
}
hideLoader();
});
};
// const fecthAssign = async () => {
// showLoader();
// await http
// .get(config.API.evaluateChairman(assignId.value))
// .then(async (res: any) => {
// if (props.action == "add") {
// assign.value = res.data.data.assign;
// evaluate_no.value = res.data.data.evaluate_no;
// start_date.value = res.data.data.start_date;
// date_finish.value = res.data.data.end_date;
// chairman.value = res.data.data.chairman;
// commander.value = res.data.data.commander;
// mentors.value = res.data.data.mentors;
// }
// })
// .catch((e) => {
// messageError($q, e);
// })
// .finally(() => {
// if (props.action == "edit") {
// fetchEvaluate();
// }
// hideLoader();
// });
// };
const fetchEvaluate = async () => {
showLoader();
let data = await dataArr.value;
evaluate_id.value = data.id;
// showLoader();
try {
let data = await dataArr.value;
evaluate_id.value = data.id;
start_date.value = data.date_start;
date_finish.value = data.date_finish;
learn_level.value = data.knowledge_level;
apply_level.value = data.apply_level;
success_level.value = data.success_level;
achievement_other.value.text = data.achievement_other_desc;
achievement_other.value.level = data.achievement_other_level;
conduct_level.value[0] = data.conduct1_level;
conduct_level.value[1] = data.conduct2_level;
conduct_level.value[2] = data.conduct3_level;
conduct_level.value[3] = data.conduct4_level;
moral_level.value[0] = data.moral1_level;
moral_level.value[1] = data.moral2_level;
moral_level.value[2] = data.moral3_level;
discipline_level.value[0] = data.discipline1_level;
discipline_level.value[1] = data.discipline2_level;
discipline_level.value[2] = data.discipline3_level;
discipline_level.value[3] = data.discipline4_level;
discipline_level.value[4] = data.discipline5_level;
behavio_orther.value.text = data.behavior_other_desc;
behavio_orther.value.level = data.behavior_other_level;
orientation.value = data.develop_orientation_score;
self_learning.value = data.develop_self_learning_score;
training_seminar.value = data.develop_training_seminar_score;
other_training.value = data.develop_other_training_score;
orientation_percent.value = data.develop_orientation_percent;
self_learning_percent.value = data.develop_self_learning_percent;
training_seminar_percent.value = data.develop_training_seminar_percent;
other_training_percent.value = data.develop_other_training_percent;
develop_result.value = data.develop_result;
evaluate_result.value = data.evaluate_result;
start_date.value = data.date_start;
date_finish.value = data.date_finish;
learn_level.value = data.knowledge_level;
apply_level.value = data.apply_level;
success_level.value = data.success_level;
achievement_other.value.text = data.achievement_other_desc;
achievement_other.value.level = data.achievement_other_level;
conduct_level.value[0] = data.conduct1_level;
conduct_level.value[1] = data.conduct2_level;
conduct_level.value[2] = data.conduct3_level;
conduct_level.value[3] = data.conduct4_level;
moral_level.value[0] = data.moral1_level;
moral_level.value[1] = data.moral2_level;
moral_level.value[2] = data.moral3_level;
discipline_level.value[0] = data.discipline1_level;
discipline_level.value[1] = data.discipline2_level;
discipline_level.value[2] = data.discipline3_level;
discipline_level.value[3] = data.discipline4_level;
discipline_level.value[4] = data.discipline5_level;
behavio_orther.value.text = data.behavior_other_desc;
behavio_orther.value.level = data.behavior_other_level;
orientation.value = data.develop_orientation_score;
self_learning.value = data.develop_self_learning_score;
training_seminar.value = data.develop_training_seminar_score;
other_training.value = data.develop_other_training_score;
orientation_percent.value = data.develop_orientation_percent;
self_learning_percent.value = data.develop_self_learning_percent;
training_seminar_percent.value = data.develop_training_seminar_percent;
other_training_percent.value = data.develop_other_training_percent;
develop_result.value = data.develop_result;
evaluate_result.value = data.evaluate_result;
if (
data.achievement_other_desc !== "" &&
data.achievement_other_level !== null
) {
etc.value = true;
} else etc.value = false;
if (data.behavior_other_desc !== "" && data.behavior_other_level !== null) {
etc2.value = true;
} else etc2.value = false;
if (
data.achievement_other_desc !== "" &&
data.achievement_other_level !== null
) {
etc.value = true;
} else etc.value = false;
if (data.behavior_other_desc !== "" && data.behavior_other_level !== null) {
etc2.value = true;
} else etc2.value = false;
status.value = false;
// })
// .catch((e) => {
// if (e.data.message !== "Data not found!") {
// messageError($q, e);
// }
// })
// .finally(() => {
// hideLoader();
// });
status.value = false;
// setTimeout(() => {
// hideLoader();
// }, 1000);
} catch (error) {
// hideLoader();
}
};
const list2_1 = [
@ -238,7 +231,6 @@ const develop_result_option = ref<any>([
{ name: "ไม่ผ่าน (ต่ำกว่าร้อยละ 60)", value: 0 },
]);
// footer
const Autherise = ref<any>(null);
const dateAutherise = ref<any>(new Date());
// const option = ref<any>([]);
@ -495,7 +487,9 @@ const putformData = () => {
</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>
งวนท
@ -559,7 +553,8 @@ const putformData = () => {
<q-item-section>
<q-item-label>
<q-icon name="mdi-label" color="grey-4" class="q-pr-sm" />
1.2. ความสามารถในการปรบใชความรบงานในหนาท</q-item-label
1.2.
ความสามารถในการปรบใชความรบงานในหนาท</q-item-label
>
</q-item-section>
<q-item-section side>
@ -646,7 +641,8 @@ const putformData = () => {
:disable="!status"
v-model="etc"
@click="
(achievement_other.text = ''), (achievement_other.level = 0)
(achievement_other.text = ''),
(achievement_other.level = 0)
"
/></q-item-label>
</q-item-section>
@ -654,7 +650,10 @@ const putformData = () => {
</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">
@ -707,7 +706,7 @@ const putformData = () => {
</q-card>
<div class="text-top0 col-xs-12 col-sm-11 q-px-lg">
<div class="row col-12 justify-between q-pa-sm ">
<div class="row col-12 justify-between q-pa-sm">
<div class="text-black">คะแนนรวมผลสมฤทธของการทดลองฯ</div>
<div class="text-weight-bold text-black">{{ score1 }}</div>
</div>
@ -932,10 +931,9 @@ const putformData = () => {
</q-item>
</q-list>
</q-card>
</div>
<div class="text-top0 col-xs-12 col-sm-11 q-pt-sm q-px-md q-my-none">
<div class="row col-12 justify-between q-py-sm ">
<div class="row col-12 justify-between q-py-sm">
<div class="text-black">คะแนนรวมพฤตกรรมการปฎราชการ</div>
<div class="text-weight-bold text-black">{{ score2 }}</div>
</div>
@ -958,7 +956,8 @@ const putformData = () => {
<q-item-section>
<q-item-label>
<q-icon name="mdi-label" color="grey-4" class="q-pr-sm" />
3.1. ผลสมฤทธของการทดลองปฏหนาทราชการ</q-item-label
3.1.
ผลสมฤทธของการทดลองปฏหนาทราชการ</q-item-label
>
</q-item-section>
<q-item-section>
@ -1061,7 +1060,7 @@ const putformData = () => {
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>
@ -1105,7 +1104,7 @@ const putformData = () => {
</div>
<div class="col">
<q-input
outlined
outlined
dense
type="number"
:disable="!status"
@ -1162,7 +1161,9 @@ const putformData = () => {
<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">
<div class="col-8 text-weight-medium"><q-item-label> ผลคะแนนรวม</q-item-label></div>
<div class="col-8 text-weight-medium">
<q-item-label> ผลคะแนนรวม</q-item-label>
</div>
<div class="col q-pl-md">{{ score4 }}</div>
<div class="col q-pl-md">{{ score5 }}</div>
</div>
@ -1271,7 +1272,7 @@ const putformData = () => {
</div>
<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-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> -->
สรปผลการพฒนา
@ -1321,167 +1322,169 @@ const putformData = () => {
<!-- Footer -->
<!-- <Footer /> -->
<div class="row col-12 q-gutter-lg no-margin justify-center">
<div class="col-xs-12 col-sm-11 ">
<div class="col-12 text-top2 row items-center">งคบบญชาผมอบหมายงาน</div>
<div class="col-xs-12 col-sm-11">
<div class="col-12 text-top2 row items-center">
งคบบญชาผมอบหมายงาน
</div>
<div class="col-12 row q-col-gutter-md">
<q-select
class="col-xs-12 col-sm-8"
dense
v-model="commander.name"
outlined
label="ผู้บังคับบัญชา"
disable
/>
<div class="col-xs-12 col-sm-4">
<datepicker
menu-class-name="modalfix"
v-model="dateAutherise"
:locale="'th'"
autoApply
borderless
:readonly="!status"
:enableTimePicker="false"
week-start="0"
>
<template #year="{ year }">
{{ year + 543 }}
</template>
<template #year-overlay-value="{ value }">
{{ parseInt(value + 543) }}
</template>
<template #trigger>
<q-input
outlined
dense
:disable="!status"
hide-bottom-space
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>
</template>
</q-input>
</template>
</datepicker>
</div>
<q-select
class="col-xs-12 col-sm-8"
dense
v-model="mentors[0].name"
outlined
label="ผู้บังคับบัญชา"
disable
/>
<div class="col-xs-12 col-sm-4">
<datepicker
menu-class-name="modalfix"
v-model="dateAutherise"
:locale="'th'"
autoApply
borderless
:readonly="!status"
:enableTimePicker="false"
week-start="0"
>
<template #year="{ year }">
{{ year + 543 }}
</template>
<template #year-overlay-value="{ value }">
{{ parseInt(value + 543) }}
</template>
<template #trigger>
<q-input
outlined
:disable="!status"
dense
class="full-width datepicker col-3"
hide-bottom-space
: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>
</template>
</q-input>
</template>
</datepicker>
</div>
<q-select
class="col-xs-12 col-sm-8"
dense
v-model="mentors[1].name"
outlined
label="ผู้บังคับบัญชา"
disable
/>
<div class="col-xs-12 col-sm-4">
<datepicker
menu-class-name="modalfix"
v-model="dateAutherise"
:locale="'th'"
autoApply
borderless
:readonly="!status"
:enableTimePicker="false"
week-start="0"
>
<template #year="{ year }">
{{ year + 543 }}
</template>
<template #year-overlay-value="{ value }">
{{ parseInt(value + 543) }}
</template>
<template #trigger>
<q-input
outlined
dense
:disable="!status"
class="full-width datepicker col-3"
hide-bottom-space
: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>
</template>
</q-input>
</template>
</datepicker>
<q-select
class="col-xs-12 col-sm-8"
dense
v-model="commander.name"
outlined
label="ผู้บังคับบัญชา"
disable
/>
<div class="col-xs-12 col-sm-4">
<datepicker
menu-class-name="modalfix"
v-model="dateAutherise"
:locale="'th'"
autoApply
borderless
:readonly="!status"
:enableTimePicker="false"
week-start="0"
>
<template #year="{ year }">
{{ year + 543 }}
</template>
<template #year-overlay-value="{ value }">
{{ parseInt(value + 543) }}
</template>
<template #trigger>
<q-input
outlined
dense
:disable="!status"
hide-bottom-space
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>
</template>
</q-input>
</template>
</datepicker>
</div>
<q-select
class="col-xs-12 col-sm-8"
dense
v-model="mentors[0].name"
outlined
label="ผู้บังคับบัญชา"
disable
/>
<div class="col-xs-12 col-sm-4">
<datepicker
menu-class-name="modalfix"
v-model="dateAutherise"
:locale="'th'"
autoApply
borderless
:readonly="!status"
:enableTimePicker="false"
week-start="0"
>
<template #year="{ year }">
{{ year + 543 }}
</template>
<template #year-overlay-value="{ value }">
{{ parseInt(value + 543) }}
</template>
<template #trigger>
<q-input
outlined
:disable="!status"
dense
class="full-width datepicker col-3"
hide-bottom-space
: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>
</template>
</q-input>
</template>
</datepicker>
</div>
<q-select
class="col-xs-12 col-sm-8"
dense
v-model="mentors[1].name"
outlined
label="ผู้บังคับบัญชา"
disable
/>
<div class="col-xs-12 col-sm-4">
<datepicker
menu-class-name="modalfix"
v-model="dateAutherise"
:locale="'th'"
autoApply
borderless
:readonly="!status"
:enableTimePicker="false"
week-start="0"
>
<template #year="{ year }">
{{ year + 543 }}
</template>
<template #year-overlay-value="{ value }">
{{ parseInt(value + 543) }}
</template>
<template #trigger>
<q-input
outlined
dense
:disable="!status"
class="full-width datepicker col-3"
hide-bottom-space
: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>
</template>
</q-input>
</template>
</datepicker>
</div>
</div>
</div>
</div>
<div class="row col-12 q-gutter-lg no-margin justify-center">
<div class="col-xs-12 col-sm-11">
<div class="col-xs-12 col-sm-11">
<div class="col-12 text-top2 row items-center">คณะกรรมการ</div>
<div class="col-12 row q-col-gutter-md">
<q-select
@ -1537,14 +1540,12 @@ 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-btn label="บันทึก" color="secondary" @click="savaForm" />
</q-toolbar>
</div>
</div>

View file

@ -2,9 +2,9 @@
import { ref, onMounted, watch } from "vue";
import { useQuasar } from "quasar";
import { useProbationDataStore } from "@/modules/05_placement/store";
import { useCounterMixin } from "@/stores/mixin";
import { useAssignDataStore } from "@/modules/05_placement/storeAssign";
// import { formatDate } from "@fullcalendar/core";
import { useCounterMixin } from "@/stores/mixin";
import { useRouter, useRoute } from "vue-router";
import http from "@/plugins/http";
@ -14,6 +14,9 @@ const routeName = router.currentRoute.value.name;
const $q = useQuasar();
const route = useRoute();
const probationStore = useProbationDataStore();
const assignStore = useAssignDataStore();
const { fecthAssignoutput, assign } = assignStore;
const mixin = useCounterMixin();
const {
date2Thai,
@ -29,8 +32,6 @@ const { ratingColors } = probationStore;
const assignId = ref<string>(route.params.form.toString());
const personalId = ref<string>(route.params.personalId.toString());
const person = ref<any>([]);
const assign = ref<any>([]);
const start_date = ref<Date>(new Date());
const date_finish = ref<Date>(new Date());
const status = ref<boolean>(false);
@ -54,13 +55,9 @@ const props = defineProps({
});
onMounted(async () => {
// if (props.action == 'add') {
// fecthFormdata();
// }
if (props.tab && props.action == "edit") {
evaluate_no.value = Number(props.tab.charAt(4));
dataArr.value = await props.data;
fecthFormdata();
}
});
@ -69,7 +66,7 @@ watch(props, async () => {
if (props.tab && props.action == "edit") {
evaluate_no.value = Number(props.tab.charAt(4));
dataArr.value = await props.data;
fecthFormdata();
fectFormfull();
}
});
@ -77,46 +74,55 @@ const fecthFormdata = async () => {
await http
.get(config.API.formevaluateRecord(assignId.value))
.then(async (res: any) => {
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;
// if (res.data.data.evaluate_no > round.value) {
// await fecthFormRound(assignId.value, round.value);
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) => {
})
.catch((e: any) => {})
.finally(() => {
if (props.action == "edit") {
fecthFormRound();
}
});
};
const fectFormfull = async () => {
Autherise.value = assignStore.director.name;
list1_1.value = assignStore.assignOutput;
evaluate_expenct_level.value = await assignStore.assignOutput.map(
(e: any) => ({
id: e.id,
labal: e.output_desc,
})
);
evaluate_ouptut.value = await assignStore.assignOutput.map((e: any) => ({
id: e.id,
}));
checkArray.value = list1_1.value.length;
fecthFormRound();
};
const fecthFormRound = async () => {
showLoader();
// showLoader();
try {
let data = await dataArr.value;
evaluate_id.value = data.id;
@ -160,7 +166,6 @@ const fecthFormRound = async () => {
if (data.behavior_other_desc !== "" && data.behavior_other_level !== null) {
etc2.value = true;
} else etc2.value = false;
if (data.achievements) {
await data.achievements.map((e: any, index: number) => {
evaluate_expenct_level.value[index].level = e.evaluate_expect_level;
@ -170,21 +175,15 @@ const fecthFormRound = async () => {
}
status.value = false;
setTimeout(() => {
hideLoader();
}, 1000);
// setTimeout(() => {
// hideLoader();
// }, 1000);
} catch (error) {
hideLoader();
}
};
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: "" },
{ id: "", label: "" },
@ -244,10 +243,6 @@ const list2_3 = [
];
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>([
{ id: "1", label: "ผลผลิตของงานที่คาดหวัง 1", level: 0 },
@ -268,11 +263,8 @@ 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
@ -281,8 +273,6 @@ 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
@ -303,17 +293,11 @@ 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) || "",
// ];
const savaForm = () => {
achievement_strengthRef.value.validate();
@ -322,16 +306,7 @@ const savaForm = () => {
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 ||
knowledge_level.value === 0 ||
skill_level.value === 0 ||
competency_level.value === 0 ||
@ -492,7 +467,9 @@ const editData = async (data: any) => {
</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>
งวนท
@ -785,7 +762,8 @@ const editData = async (data: any) => {
<q-item-section>
<q-item-label>
<q-icon name="mdi-label" color="grey-4" class="q-pr-sm" />
1.6. ความสามารถในการปรบใชความรบงานในหนาท</q-item-label
1.6.
ความสามารถในการปรบใชความรบงานในหนาท</q-item-label
>
</q-item-section>
<q-item-section side>
@ -870,7 +848,8 @@ const editData = async (data: any) => {
dense
v-model="etc"
@click="
(achievement_other.text = ''), (achievement_other.level = 0)
(achievement_other.text = ''),
(achievement_other.level = 0)
"
:disable="!status"
/></q-item-label>
@ -879,7 +858,10 @@ const editData = async (data: any) => {
</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">
@ -1424,13 +1406,12 @@ const editData = async (data: any) => {
</div>
</div>
</div>
<q-toolbar class="text-primary" v-if="routeName == 'probationFormAddresult'">
<q-toolbar
class="text-primary"
v-if="routeName == 'probationFormAddresult'"
>
<q-space />
<q-btn
label="บันทึก"
color="secondary"
@click="savaForm"
/>
<q-btn label="บันทึก" color="secondary" @click="savaForm" />
</q-toolbar>
</div>
</div>

View file

@ -1,13 +1,10 @@
<script setup lang="ts">
import { ref, watch, onMounted } from "vue";
import { useRoute, useRouter } from "vue-router";
const route = useRoute();
import { ref, watch } from "vue";
const tabHead = ref<string>("save1");
const props = defineProps({
FileDownload:{
type:Function,
FileDownload: {
type: Function,
default() {
return "Default function";
},
@ -28,23 +25,26 @@ const props = defineProps({
},
},
});
const downloadFile = (type:string) =>{
props.FileDownload(type)
}
const downloadFile = (type: string) => {
props.FileDownload(type);
};
watch(tabHead, () => {
props.changeTab(tabHead.value);
});
const nextPage = () => {
props.addData();
if (props.loop !== undefined) {
if (props.loop < 3) {
props.addData();
}
}
};
</script>
<template>
<q-header class="bg-grey-1">
<div class="bg-grey-1">
<!-- |{{ tabHead }}| -->
<div class="col-12 row q-gutter-x-md items-center">
<q-tabs
dense
@ -53,9 +53,9 @@ const nextPage = () => {
indicator-color="grey-1"
class="text-grey-7"
>
<q-tab v-for="(i,j) in loop" :name="`save${i}`" :key="j" >
<q-tab v-for="(i, j) in loop" :name="`save${i}`" :key="j">
<div class="row col-12 items-center">
<div class="q-mr-sm">ครงท{{i}}</div>
<div class="q-mr-sm">ครงท{{ i }}</div>
<q-btn
size="12px"
flat
@ -67,13 +67,21 @@ const nextPage = () => {
<q-tooltip>ดาวนโหลด</q-tooltip>
<q-menu>
<q-list style="min-width: 150px">
<q-item clickable v-close-popup @click="downloadFile('pdf')">
<q-item
clickable
v-close-popup
@click="downloadFile('pdf')"
>
<q-item-section avatar
><q-icon color="red" name="mdi-file-pdf"
/></q-item-section>
<q-item-section>ไฟล .PDF</q-item-section>
</q-item>
<q-item clickable v-close-popup @click="downloadFile('docx')">
<q-item
clickable
v-close-popup
@click="downloadFile('docx')"
>
<q-item-section avatar
><q-icon color="blue" name="mdi-file-word"
/></q-item-section>

View file

@ -3,6 +3,7 @@ import { ref, defineAsyncComponent, watch, onMounted, onUpdated } from "vue";
import { useCounterMixin } from "@/stores/mixin";
import { useQuasar } from "quasar";
import { useRoute, useRouter } from "vue-router";
import { useAssignDataStore } from "@/modules/05_placement/storeAssign";
const Header = defineAsyncComponent(
() =>
import(
@ -18,31 +19,28 @@ const FormSaveResult = defineAsyncComponent(
import http from "@/plugins/http";
import config from "@/app.config";
const router = useRouter();
const route = useRoute();
const $q = useQuasar();
const assignStore = useAssignDataStore();
const { fecthdataAssign } = assignStore;
const mixin = useCounterMixin();
const { showLoader, hideLoader, messageError, success } = mixin;
const { showLoader, hideLoader, messageError } = mixin;
const assignId = ref<string>(route.params.form.toString());
const personalId = ref<string>(route.params.personalId.toString());
const fullname = ref<string>("");
const evaluate = ref<any>([]);
const tabs = ref<any>([]);
const tab = ref<string>("save1");
const dataArrayNumber = ref<number>();
const dataRole = ref<string>("mentor");
onMounted(async () => {
await fecthAssign(assignId.value);
});
const fecthAssign = async (id: string) => {
showLoader();
await http
.get(config.API.formevaluate(id))
.then(async (res: any) => {
evaluate.value = res.data.data.evaluate;
tabs.value = evaluate.value;
await fecthdataAssign(res.data.data);
fullname.value = res.data.data.person.name;
dataArrayNumber.value = 1;
})
@ -53,7 +51,6 @@ const fecthAssign = async (id: string) => {
hideLoader();
});
};
const changeTab = (tabVal: string) => {
tab.value = tabVal;
dataArrayNumber.value = Number(tabVal.charAt(4));
@ -67,9 +64,10 @@ const downloadFile = (response: any, filename: string) => {
link.click();
document.body.removeChild(link);
};
const FileDownload = async (type: string) => {
let numTab = evaluate.value.find((e: any) => e.no === dataArrayNumber.value);
let numTab = assignStore.evaluate.find(
(e: any) => e.no === dataArrayNumber.value
);
//
if (dataRole.value == "mentor") {
showLoader();
@ -119,20 +117,44 @@ const addData = () => {
<template>
<Header
v-if="tabs.length > 0"
v-if="assignStore.tabs.length > 0"
:change-tab="changeTab"
:add-data="addData"
:loop="tabs.length"
:loop="assignStore.tabs.length"
:FileDownload="FileDownload"
/>
<q-page-container v-if="tabs.length > 0">
<FormSaveResult
:tab="tab"
:data="evaluate.find((x: any) => x.no === dataArrayNumber)"
action="edit"
/>
</q-page-container>
<div class="q-gutter-md" v-else-if="tabs.length == 0">
<q-tab-panels
v-model="tab"
animated
swipeable
vertical
transition-prev="jump-up"
transition-next="jump-up"
v-if="assignStore.tabs.length > 0"
class="mt"
>
<q-tab-panel
v-for="item in assignStore.evaluate"
:name="`save${item.no}`"
:key="item.no"
>
<FormSaveResult
:tab="tab"
:data="assignStore.evaluate.find((x: any) => x.no === dataArrayNumber)"
action="edit"
/>
</q-tab-panel>
<!-- <q-page-container>
<FormSaveResult
:tab="tab"
:data="assignStore.evaluate.find((x: any) => x.no === dataArrayNumber)"
action="edit"
/>
</q-page-container> -->
</q-tab-panels>
<div class="q-gutter-md" v-else-if="assignStore.tabs.length == 0">
<div class="flex justify-center items-center q-my-md q-gutter-md">
<q-btn
outline
@ -140,7 +162,11 @@ const addData = () => {
label="สร้างแบบบันทึกผล"
@click="addData"
/>
</div>
</div>
</template>
<style lang="scss" scoped>
.mt {
margin-top: 25px;
}
</style>

View file

@ -5,6 +5,7 @@ import config from "@/app.config";
import { useQuasar } from "quasar";
import { useRoute, useRouter } from "vue-router";
import { useCounterMixin } from "@/stores/mixin";
import { useAssignDataStore } from "@/modules/05_placement/storeAssign";
const Header = defineAsyncComponent(
() =>
@ -23,10 +24,12 @@ const router = useRouter();
const route = useRoute();
const mixin = useCounterMixin();
const $q = useQuasar();
const { showLoader, hideLoader, messageError, success } = mixin;
const { showLoader, hideLoader, messageError } = mixin;
const assignStore = useAssignDataStore();
const { fecthdataAssign } = assignStore;
const assignId = ref<string>(route.params.form.toString());
const personalId = ref<string>(route.params.personalId.toString());
const fullname = ref<string>("")
const fullname = ref<string>("");
const tab = ref<string>("save1");
const tabs = ref<any>([]);
const dataArrayNumber = ref<number>(1);
@ -45,10 +48,11 @@ const fecthAssign = async (id: string) => {
showLoader();
await http
.get(config.API.createformCommader(id))
.then((res: any) => {
evaluate.value = res.data.data.evaluate;
fullname.value = res.data.data.person.name;
.then(async (res: any) => {
await fecthdataAssign(res.data.data);
evaluate.value = assignStore.evaluate;
tabs.value = evaluate.value;
fullname.value = res.data.data.person.name;
dataArrayNumber.value = 1;
})
.catch((e: any) => {
@ -76,7 +80,10 @@ const FileDownload = async (type: string) => {
responseType: "blob",
})
.then(async (res) => {
downloadFile(res, `แบบประเมินผล(ผู้บังคับบัญชา)_${fullname.value}_ครั้งที่${numTab.no}.${type}`);
downloadFile(
res,
`แบบประเมินผล(ผู้บังคับบัญชา)_${fullname.value}_ครั้งที่${numTab.no}.${type}`
);
})
.catch((e) => {
messageError($q, e);
@ -101,13 +108,35 @@ const addData = () => {
:FileDownload="FileDownload"
/>
<q-page-container v-if="tabs.length > 0">
<q-tab-panels
v-model="tab"
animated
swipeable
vertical
transition-prev="jump-up"
transition-next="jump-up"
v-if="tabs.length > 0"
class="mt"
>
<q-tab-panel
v-for="item in assignStore.evaluate"
:name="`save${item.no}`"
:key="item.no"
>
<FormEvaluate
:tab="tab"
:data="assignStore.evaluate.find((x: any) => x.no === dataArrayNumber)"
action="edit"
/>
</q-tab-panel>
</q-tab-panels>
<!-- <q-page-container v-if="tabs.length > 0">
<FormEvaluate
:tab="tab"
:data="evaluate.find((x: any) => x.no === dataArrayNumber)"
action="edit"
/>
</q-page-container>
</q-page-container> -->
<div v-else class="q-gutter-md">
<div class="flex justify-center items-center q-my-md q-gutter-md">
@ -115,3 +144,8 @@ const addData = () => {
</div>
</div>
</template>
<style lang="scss" scoped>
.mt {
margin-top: 25px;
}
</style>

View file

@ -5,9 +5,22 @@ import config from "@/app.config";
import { useQuasar } from "quasar";
import { useRoute, useRouter } from "vue-router";
import { useCounterMixin } from "@/stores/mixin";
import { useAssignDataStore } from "@/modules/05_placement/storeAssign";
const assignStore = useAssignDataStore();
const { fecthdataAssign } = assignStore;
const Header = defineAsyncComponent(() => import("@/modules/05_placement/components/probation/FormEvaluation/Header.vue"));
const FormEvaluateScore = defineAsyncComponent(() => import("@/modules/05_placement/components/probation/FormEvaluation/FormEvaluateScore.vue"));
const Header = defineAsyncComponent(
() =>
import(
"@/modules/05_placement/components/probation/FormEvaluation/Header.vue"
)
);
const FormEvaluateScore = defineAsyncComponent(
() =>
import(
"@/modules/05_placement/components/probation/FormEvaluation/FormEvaluateScore.vue"
)
);
const router = useRouter();
const route = useRoute();
@ -17,7 +30,7 @@ const { showLoader, hideLoader, messageError, success } = mixin;
const assignId = ref<string>(route.params.form.toString());
const personalId = ref<string>(route.params.personalId.toString());
const fullname = ref<string>("")
const fullname = ref<string>("");
const tab = ref<string>("save1");
const tabs = ref<any>([]);
const dataArrayNumber = ref<number>(1);
@ -31,8 +44,9 @@ const fecthAssign = async (id: string) => {
showLoader();
await http
.get(config.API.createformChairman(id))
.then((res: any) => {
evaluate.value = res.data.data.evaluate;
.then(async (res: any) => {
await fecthdataAssign(res.data.data);
evaluate.value = assignStore.evaluate;
fullname.value = res.data.data.person.name;
tabs.value = evaluate.value;
dataArrayNumber.value = 1;
@ -62,7 +76,10 @@ const FileDownload = async (type: string) => {
responseType: "blob",
})
.then(async (res) => {
downloadFile(res, `แบบประเมินผล(คณะกรรมการ)_${fullname.value}_ครั้งที่${numTab.no}.${type}`);
downloadFile(
res,
`แบบประเมินผล(คณะกรรมการ)_${fullname.value}_ครั้งที่${numTab.no}.${type}`
);
})
.catch((e) => {
messageError($q, e);
@ -84,11 +101,42 @@ const changeTab = (tabVal: string) => {
</script>
<template>
<Header v-if="tabs.length > 0" :change-tab="changeTab" :loop="tabs.length" :add-data="addData" :FileDownload="FileDownload"/>
<Header
v-if="tabs.length > 0"
:change-tab="changeTab"
:loop="tabs.length"
:add-data="addData"
:FileDownload="FileDownload"
/>
<q-page-container v-if="tabs.length > 0">
<FormEvaluateScore :tab="tab" :data="evaluate.find((x: any) => x.no === dataArrayNumber)" action="edit" />
</q-page-container>
<q-tab-panels
v-model="tab"
animated
swipeable
vertical
transition-prev="jump-up"
transition-next="jump-up"
v-if="tabs.length > 0"
class="mt"
><q-tab-panel
v-for="item in assignStore.evaluate"
:name="`save${item.no}`"
:key="item.no"
>
<FormEvaluateScore
:tab="tab"
:data="evaluate.find((x: any) => x.no === dataArrayNumber)"
action="edit"
/>
</q-tab-panel>
</q-tab-panels>
<!-- <q-page-container v-if="tabs.length > 0">
<FormEvaluateScore
:tab="tab"
:data="evaluate.find((x: any) => x.no === dataArrayNumber)"
action="edit"
/>
</q-page-container> -->
<div class="q-gutter-md" v-if="tabs.length === 0">
<div class="flex justify-center items-center q-my-md q-gutter-md">
@ -96,3 +144,9 @@ const changeTab = (tabVal: string) => {
</div>
</div>
</template>
<style lang="scss" scoped>
.mt {
margin-top: 25px;
}
</style>

View file

@ -0,0 +1,32 @@
import { defineStore } from "pinia";
import { ref } from "vue";
export const useAssignDataStore = defineStore("assign", () => {
const assign = ref<any>([])
const evaluate = ref<any>([])
const tabs = ref<any>([]);
const assignOutput = ref<any>([])
const director = ref<any>([])
const fecthdataAssign = async (data: any) => {
assign.value = await data.assign
evaluate.value = await data.evaluate
tabs.value = await data.evaluate
}
const fecthAssignoutput = (data: any) => {
assignOutput.value = data.assign_output
director.value = data.director
}
return {
fecthdataAssign,
fecthAssignoutput,
assign,
evaluate,
tabs,
assignOutput,
director,
};
});