จัดโค้ด

This commit is contained in:
setthawutttty 2023-11-17 18:00:02 +07:00
parent 50298e9976
commit 1e16bd7b2d
7 changed files with 174 additions and 86 deletions

View file

@ -373,7 +373,9 @@ onMounted(async () => {
การทดลองปฏหนาทราชการของ {{ person.name }} การทดลองปฏหนาทราชการของ {{ person.name }}
</div> </div>
</q-toolbar> </q-toolbar>
<q-separator /> <q-separator />
<q-card-section> <q-card-section>
<div class="row col-12 no-margin q-px-md q-pt-md"> <div class="row col-12 no-margin q-px-md q-pt-md">
<div class="row col-12 q-gutter-lg"> <div class="row col-12 q-gutter-lg">
@ -384,7 +386,6 @@ onMounted(async () => {
</div> </div>
<div class="col-12 q-pl-md q-pb-md"> <div class="col-12 q-pl-md q-pb-md">
<!-- <div class="col-12"><span class="text-top0 q-pl-sm">ตำแหน</span> {{ person.Position }}</div> -->
<div class="col-12"> <div class="col-12">
<span class="text-top0 q-pl-sm">ตำแหนงในสายงาน</span> <span class="text-top0 q-pl-sm">ตำแหนงในสายงาน</span>
{{ person.PositionLineName }} {{ person.PositionLineName }}
@ -412,12 +413,14 @@ onMounted(async () => {
date2Thai(assign.date_finish) date2Thai(assign.date_finish)
}}</span> }}</span>
</div> </div>
<div class="col-12 text-top0 row items-center"> <div class="col-12 text-top0 row items-center">
<q-icon name="mdi-label" color="grey-4" class="q-pr-sm" /> <q-icon name="mdi-label" color="grey-4" class="q-pr-sm" />
นทกผล<span class="text-primary q-pr-sm">{{ นทกผล<span class="text-primary q-pr-sm">{{
"ครั้งที่ " + round "ครั้งที่ " + round
}}</span> }}</span>
</div> </div>
<div class="col-12 text-top0 row items-center"> <div class="col-12 text-top0 row items-center">
<div class="col-6 q-px-sm"> <div class="col-6 q-px-sm">
<datepicker <datepicker
@ -458,6 +461,7 @@ onMounted(async () => {
</template> </template>
</datepicker> </datepicker>
</div> </div>
<div class="col-6 q-px-sm"> <div class="col-6 q-px-sm">
<datepicker <datepicker
menu-class-name="modalfix" menu-class-name="modalfix"
@ -498,6 +502,7 @@ onMounted(async () => {
</datepicker> </datepicker>
</div> </div>
</div> </div>
<div class="col-12 q-pt-md"> <div class="col-12 q-pt-md">
<q-separator size="3px" color="grey-2" /> <q-separator size="3px" color="grey-2" />
</div> </div>
@ -1346,6 +1351,7 @@ onMounted(async () => {
<q-item-section> <q-item-section>
<q-item-label>2. การเรยนรวยตนเอง</q-item-label> <q-item-label>2. การเรยนรวยตนเอง</q-item-label>
</q-item-section> </q-item-section>
<q-item-section side> <q-item-section side>
<div class="row"> <div class="row">
<q-radio <q-radio
@ -1364,10 +1370,10 @@ onMounted(async () => {
/> />
</div> </div>
</q-item-section> </q-item-section>
</q-item> </q-item>
<q-separator class="q-my-xs" /> <q-separator class="q-my-xs" />
<q-item <q-item
dense dense
tag="label" tag="label"
@ -1407,6 +1413,7 @@ onMounted(async () => {
> >
</q-item-section> </q-item-section>
<q-item-section side> <q-item-section side>
<div class="row"> <div class="row">
<q-radio <q-radio
checked-icon="task_alt" checked-icon="task_alt"
@ -1423,6 +1430,7 @@ onMounted(async () => {
label=" ยังไม่ได้ดำเนินการ" label=" ยังไม่ได้ดำเนินการ"
/> />
</div> </div>
</q-item-section> </q-item-section>
</q-item> </q-item>
</q-list> </q-list>
@ -1430,8 +1438,6 @@ onMounted(async () => {
</div> </div>
</div> </div>
<!-- Footer -->
<!-- <Footer /> -->
<div class="row col-12 q-gutter-lg no-margin justify-center"> <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 class="col-12 text-top2 row items-center">
@ -1492,6 +1498,7 @@ onMounted(async () => {
</div> </div>
</div> </div>
</div> </div>
<div class="col-12"> <div class="col-12">
<q-separator size="3px" color="grey-2" /> <q-separator size="3px" color="grey-2" />
</div> </div>

View file

@ -24,6 +24,7 @@ const {
dialogConfirm, dialogConfirm,
dialogMessageNotify, dialogMessageNotify,
} = mixin; } = mixin;
const { ratingColors } = probationStore; const { ratingColors } = probationStore;
const assignId = ref<string>(route.params.form.toString()); const assignId = ref<string>(route.params.form.toString());
const personalId = ref<string>(route.params.id.toString()); const personalId = ref<string>(route.params.id.toString());
@ -81,6 +82,7 @@ const other_training = ref<any>(null);
const Autherise = ref<any>(null); const Autherise = ref<any>(null);
const dateAutherise = ref<any>(new Date()); const dateAutherise = ref<any>(new Date());
const checkArray = ref<number>(0); const checkArray = ref<number>(0);
const alerts = Array(20) const alerts = Array(20)
.fill(null) .fill(null)
.map(() => ref<boolean>(false)); .map(() => ref<boolean>(false));
@ -133,7 +135,9 @@ const variablesToWatch = [
success_level, success_level,
]; ];
const ArrayCountbotton = [orientation, self_learning, training_seminar]; const ArrayCountbotton = [orientation, self_learning, training_seminar];
const savaForm = () => {
/** เช็คข้อมูลก่อน save */
function savaForm(){
achievement_strengthRef.value.validate(); achievement_strengthRef.value.validate();
behavio_strengthRef.value.validate(); behavio_strengthRef.value.validate();
@ -207,11 +211,11 @@ const savaForm = () => {
} }
}; };
/** /**
* get data เกฐในตวแปร * get data เกฐในตวแปร
* @param id person id * @param id person id
*/ */
async function fecthFormdata(id: string){ async function fecthFormdata(id: string) {
await http await http
.get(config.API.formevaluateRecordCommander(id)) .get(config.API.formevaluateRecordCommander(id))
.then((res: any) => { .then((res: any) => {
@ -244,10 +248,10 @@ const savaForm = () => {
checkArray.value = list1_1.value.length; checkArray.value = list1_1.value.length;
}) })
.catch((e: any) => {}); .catch((e: any) => {});
}; }
/** ยืนยัน save ข้อมูล */ /** ยืนยัน save ข้อมูล */
function putformData(){ function putformData() {
const data = { const data = {
evaluate_no: evaluate_no.value, evaluate_no: evaluate_no.value,
start_date: start_date.value, start_date: start_date.value,
@ -285,12 +289,12 @@ function putformData(){
assessor_dated: dateToISO(dateAutherise.value), assessor_dated: dateToISO(dateAutherise.value),
}; };
dialogConfirm($q, async () => await saveformdata(data)); dialogConfirm($q, async () => await saveformdata(data));
}; }
/** save /** save
* @param data อมลท save * @param data อมลท save
*/ */
async function saveformdata(data: any){ async function saveformdata(data: any) {
await http await http
.post(config.API.formevaluateCommander(assignId.value), data) .post(config.API.formevaluateCommander(assignId.value), data)
.then(() => { .then(() => {
@ -300,7 +304,7 @@ async function saveformdata(data: any){
.catch((e: any) => { .catch((e: any) => {
messageError($q, e); messageError($q, e);
}); });
}; }
variablesToWatch.forEach((variable, index) => { variablesToWatch.forEach((variable, index) => {
watch(variable, (item: any) => { watch(variable, (item: any) => {
@ -352,11 +356,11 @@ watch(lengthdiscipline_level, (newLength) => {
* งช class * งช class
* @param i true/false * @param i true/false
*/ */
function getBordered(i: boolean){ function getBordered(i: boolean) {
return { return {
border_custom: i, border_custom: i,
}; };
}; }
onMounted(async () => { onMounted(async () => {
await fecthFormdata(assignId.value); await fecthFormdata(assignId.value);

View file

@ -84,14 +84,33 @@ const achievement_inproveRef = ref<any>(null);
const behavio_strengthRef = ref<any>(null); const behavio_strengthRef = ref<any>(null);
const behavio_inproveRef = ref<any>(null); const behavio_inproveRef = ref<any>(null);
const edit = () => { const list1_2 = [
status.value = true; { id: "", label: "" },
}; { id: "", label: "" },
{ id: "", label: "" },
{ id: "", label: "" },
{ id: "", label: "" },
{ id: "", label: "" },
{ id: "", label: "" },
{ id: "", label: "" },
{ id: "", label: "" },
{ id: "", label: "" },
];
const cancel = () => { const list2_1 = probationStore.behavior_no1;
status.value = false; const list2_2 = probationStore.behavior_no2;
props.fecthAssign?.(assignId.value); const list2_3 = probationStore.behavior_no3;
};
const achievement_strengthRules = [
(val: any) => (val && val.length > 0) || "กรุณากรอกข้อมูลจุดเด่น",
];
const behavio_strengthRules = [
(val: any) => (val && val.length > 0) || "กรุณากรอกข้อมูลจุดเด่น",
];
/** รับค่า props มาจากหน้าหลัก */
const props = defineProps({ const props = defineProps({
tab: String, tab: String,
data: Object, data: Object,
@ -99,7 +118,21 @@ const props = defineProps({
fecthAssign: Function, fecthAssign: Function,
}); });
const fecthFormdata = async () => { /** ให้ status true */
function edit(){
status.value = true;
};
/** status false
* เรยกใช งช จากหนาหล
*/
function cancel(){
status.value = false;
props.fecthAssign?.(assignId.value);
};
/** get data */
async function fecthFormdata(){
await http await http
.get(config.API.formevaluateRecordCommander(assignId.value)) .get(config.API.formevaluateRecordCommander(assignId.value))
.then(async (res: any) => { .then(async (res: any) => {
@ -113,7 +146,9 @@ const fecthFormdata = async () => {
} }
}); });
}; };
const fectFormfull = async () => {
/** get data */
async function fectFormfull(){
Autherise.value = Autherise.value =
probationStore.director.name + probationStore.director.name +
` (${probationStore.director.PositionLineName}, ${probationStore.director.PositionLevelName}, ${probationStore.director.Oc})`; ` (${probationStore.director.PositionLineName}, ${probationStore.director.PositionLevelName}, ${probationStore.director.Oc})`;
@ -130,7 +165,9 @@ const fectFormfull = async () => {
checkArray.value = list1_1.value.length; checkArray.value = list1_1.value.length;
fecthFormRound(); fecthFormRound();
}; };
const fecthFormRound = async () => {
/** get data */
async function fecthFormRound(){
try { try {
let data = await dataArr.value; let data = await dataArr.value;
evaluate_id.value = data.id; evaluate_id.value = data.id;
@ -190,32 +227,8 @@ const fecthFormRound = async () => {
} }
}; };
const list1_2 = [ /** เช็คก่อน save */
{ id: "", label: "" }, function savaForm(){
{ id: "", label: "" },
{ id: "", label: "" },
{ id: "", label: "" },
{ id: "", label: "" },
{ id: "", label: "" },
{ id: "", label: "" },
{ id: "", label: "" },
{ id: "", label: "" },
{ id: "", label: "" },
];
const list2_1 = probationStore.behavior_no1;
const list2_2 = probationStore.behavior_no2;
const list2_3 = probationStore.behavior_no3;
const achievement_strengthRules = [
(val: any) => (val && val.length > 0) || "กรุณากรอกข้อมูลจุดเด่น",
];
const behavio_strengthRules = [
(val: any) => (val && val.length > 0) || "กรุณากรอกข้อมูลจุดเด่น",
];
const savaForm = () => {
achievement_strengthRef.value.validate(); achievement_strengthRef.value.validate();
achievement_inproveRef.value.validate(); achievement_inproveRef.value.validate();
behavio_strengthRef.value.validate(); behavio_strengthRef.value.validate();
@ -258,7 +271,8 @@ const savaForm = () => {
} }
}; };
const putformData = () => { /** ยืนยัน save data */
function putformData(){
const data = { const data = {
evaluate_no: evaluate_no.value, evaluate_no: evaluate_no.value,
start_date: start_date.value, start_date: start_date.value,
@ -300,7 +314,8 @@ const putformData = () => {
); );
}; };
const saveformdata = async (data: any) => { /** save data */
async function saveformdata(data: any){
await http await http
.post(config.API.formevaluateCommander(assignId.value), data) .post(config.API.formevaluateCommander(assignId.value), data)
.then((res: any) => { .then((res: any) => {
@ -312,7 +327,8 @@ const saveformdata = async (data: any) => {
}); });
}; };
const editData = async (data: any) => { /** update data */
async function editData(data: any){
await http await http
.put( .put(
config.API.editEvaluateCommander(assignId.value, evaluate_id.value), config.API.editEvaluateCommander(assignId.value, evaluate_id.value),
@ -334,6 +350,7 @@ watch(props, async () => {
fectFormfull(); fectFormfull();
} }
}); });
onMounted(async () => { onMounted(async () => {
if (props.tab && props.action == "edit") { if (props.tab && props.action == "edit") {
evaluate_no.value = Number(props.tab.charAt(4)); evaluate_no.value = Number(props.tab.charAt(4));
@ -376,6 +393,7 @@ onMounted(async () => {
</q-btn> </q-btn>
</div> </div>
</div> </div>
<div class="col-12 row q-gutter-lg"> <div class="col-12 row q-gutter-lg">
<div class="col-12 row"> <div class="col-12 row">
<div class="col-12 row text-top0"> <div class="col-12 row text-top0">
@ -487,6 +505,7 @@ onMounted(async () => {
</q-list> </q-list>
</q-card> </q-card>
</div> </div>
<div class="col-12 row"> <div class="col-12 row">
<div class="col-xs-12 col-sm-11 col-md-10 offset-md-1 text-top2"> <div class="col-xs-12 col-sm-11 col-md-10 offset-md-1 text-top2">
ผลผลตของงานทเกดขนจร ผลผลตของงานทเกดขนจร
@ -745,6 +764,7 @@ onMounted(async () => {
</q-item> </q-item>
</q-list> </q-list>
</q-card> </q-card>
<q-card class="text-top0 col-xs-12 col-sm-11 q-pa-xs q-pl-sm"> <q-card class="text-top0 col-xs-12 col-sm-11 q-pa-xs q-pl-sm">
<q-list dense> <q-list dense>
<q-item dense tag="label" v-ripple> <q-item dense tag="label" v-ripple>
@ -920,6 +940,7 @@ onMounted(async () => {
</q-list> </q-list>
</q-card> </q-card>
</div> </div>
<div class="col-12 row"> <div class="col-12 row">
<div class="col-12 text-top0 row items-center q-pl-lg"> <div class="col-12 text-top0 row items-center q-pl-lg">
<q-icon name="mdi-label" color="grey-4" class="q-pr-sm" /> <q-icon name="mdi-label" color="grey-4" class="q-pr-sm" />
@ -968,6 +989,7 @@ onMounted(async () => {
</q-list> </q-list>
</q-card> </q-card>
</div> </div>
<div class="col-12 row"> <div class="col-12 row">
<div class="col-12 text-top0 row items-center q-pl-lg"> <div class="col-12 text-top0 row items-center q-pl-lg">
<q-icon name="mdi-label" color="grey-4" class="q-pr-sm" /> <q-icon name="mdi-label" color="grey-4" class="q-pr-sm" />
@ -1016,6 +1038,7 @@ onMounted(async () => {
</q-list> </q-list>
</q-card> </q-card>
</div> </div>
<div class="col-12 row"> <div class="col-12 row">
<div class="col-12 text-top0 row items-center q-pl-lg"> <div class="col-12 text-top0 row items-center q-pl-lg">
<q-icon name="mdi-label" color="grey-4" class="q-pr-sm" /> <q-icon name="mdi-label" color="grey-4" class="q-pr-sm" />
@ -1085,6 +1108,7 @@ onMounted(async () => {
</q-list> </q-list>
</q-card> </q-card>
</div> </div>
<!-- <FormComment /> --> <!-- <FormComment /> -->
<div class="row col-12 q-gutter-lg no-margin"> <div class="row col-12 q-gutter-lg no-margin">
<div class="col-12 row"> <div class="col-12 row">
@ -1168,6 +1192,7 @@ onMounted(async () => {
</div> </div>
</q-item-section> </q-item-section>
</q-item> </q-item>
<q-separator class="q-my-xs" /> <q-separator class="q-my-xs" />
<q-item dense tag="label" v-ripple> <q-item dense tag="label" v-ripple>
<q-item-section> <q-item-section>
@ -1194,6 +1219,7 @@ onMounted(async () => {
</div> </div>
</q-item-section> </q-item-section>
</q-item> </q-item>
<q-separator class="q-my-xs" /> <q-separator class="q-my-xs" />
<q-item dense tag="label" v-ripple> <q-item dense tag="label" v-ripple>
<q-item-section> <q-item-section>
@ -1220,6 +1246,7 @@ onMounted(async () => {
</div> </div>
</q-item-section> </q-item-section>
</q-item> </q-item>
<q-separator class="q-my-xs" /> <q-separator class="q-my-xs" />
<q-item dense tag="label" v-ripple> <q-item dense tag="label" v-ripple>
<q-item-section> <q-item-section>
@ -1315,6 +1342,7 @@ onMounted(async () => {
</div> </div>
</div> </div>
</div> </div>
<q-toolbar <q-toolbar
class="text-primary" class="text-primary"
v-if="routeName == 'probationFormAddresult'" v-if="routeName == 'probationFormAddresult'"

View file

@ -2,6 +2,8 @@
import { ref, watch } from "vue"; import { ref, watch } from "vue";
const tabHead = ref<string>("save1"); const tabHead = ref<string>("save1");
/** รับค่ามาจากหน้าหลัก */
const props = defineProps({ const props = defineProps({
FileDownload: { FileDownload: {
type: Function, type: Function,
@ -25,7 +27,9 @@ const props = defineProps({
}, },
}, },
}); });
const downloadFile = (type: string) => {
/** เรียกใช้ฟังชั่นจากหน้าหลัก */
function downloadFile(type: string){
props.FileDownload(type); props.FileDownload(type);
}; };
@ -33,7 +37,8 @@ watch(tabHead, () => {
props.changeTab(tabHead.value); props.changeTab(tabHead.value);
}); });
const nextPage = () => { /** ไปยัง step ต่อไป */
function nextPage(){
if (props.loop !== undefined) { if (props.loop !== undefined) {
if (props.loop < 3) { if (props.loop < 3) {
props.addData(); props.addData();

View file

@ -33,10 +33,11 @@ const fullname = ref<string>("");
const tab = ref<string>("save1"); const tab = ref<string>("save1");
const dataArrayNumber = ref<number>(); const dataArrayNumber = ref<number>();
const dataRole = ref<string>("mentor"); const dataRole = ref<string>("mentor");
onMounted(async () => {
await fecthAssign(assignId.value); /** get
}); * @param id person id
const fecthAssign = async (id: string) => { */
async function fecthAssign(id: string){
showLoader(); showLoader();
await http await http
.get(config.API.formevaluate(id)) .get(config.API.formevaluate(id))
@ -52,11 +53,18 @@ const fecthAssign = async (id: string) => {
hideLoader(); hideLoader();
}); });
}; };
const changeTab = (tabVal: string) => {
/**
* เปลยน tab
* @param tabVal type
*/
function changeTab(tabVal: string){
tab.value = tabVal; tab.value = tabVal;
dataArrayNumber.value = Number(tabVal.charAt(4)); dataArrayNumber.value = Number(tabVal.charAt(4));
}; };
const downloadFile = (response: any, filename: string) => {
/** convert file */
function downloadFile(response: any, filename: string){
const link = document.createElement("a"); const link = document.createElement("a");
var fileName = filename; var fileName = filename;
link.href = window.URL.createObjectURL(new Blob([response.data])); link.href = window.URL.createObjectURL(new Blob([response.data]));
@ -65,7 +73,9 @@ const downloadFile = (response: any, filename: string) => {
link.click(); link.click();
document.body.removeChild(link); document.body.removeChild(link);
}; };
const FileDownload = async (type: string) => {
/** download file */
async function FileDownload(type: string){
let numTab = probationStore.evaluate.find( let numTab = probationStore.evaluate.find(
(e: any) => e.no === dataArrayNumber.value (e: any) => e.no === dataArrayNumber.value
); );
@ -109,11 +119,17 @@ const FileDownload = async (type: string) => {
}); });
} }
}; };
const addData = () => {
/** ไปหน้า page add */
function addData(){
router.push( router.push(
`/probation/detail/addresult/${personalId.value}/${assignId.value}` `/probation/detail/addresult/${personalId.value}/${assignId.value}`
); );
}; };
onMounted(async () => {
await fecthAssign(assignId.value);
});
</script> </script>
<template> <template>
@ -146,14 +162,6 @@ const addData = () => {
action="edit" action="edit"
/> />
</q-tab-panel> </q-tab-panel>
<!-- <q-page-container>
<FormSaveResult
:tab="tab"
:data="probationStore.evaluate.find((x: any) => x.no === dataArrayNumber)"
action="edit"
/>
</q-page-container> -->
</q-tab-panels> </q-tab-panels>
<div class="q-gutter-md" v-else-if="probationStore.tabs.length == 0"> <div class="q-gutter-md" v-else-if="probationStore.tabs.length == 0">

View file

@ -33,10 +33,16 @@ const fullname = ref<string>("");
const tab = ref<string>("save1"); const tab = ref<string>("save1");
const dataArrayNumber = ref<number>(); const dataArrayNumber = ref<number>();
const dataRole = ref<string>("mentor"); const dataRole = ref<string>("mentor");
onMounted(async () => { onMounted(async () => {
await fecthAssign(assignId.value); await fecthAssign(assignId.value);
}); });
const fecthAssign = async (id: string) => {
/**
* get data
* @param id person id
*/
async function fecthAssign(id: string){
showLoader(); showLoader();
await http await http
.get(config.API.formevaluateCommander(id)) .get(config.API.formevaluateCommander(id))
@ -54,11 +60,18 @@ const fecthAssign = async (id: string) => {
hideLoader(); hideLoader();
}); });
}; };
const changeTab = (tabVal: string) => {
/**
* เปลยน tab
* @param tabVal type
*/
function changeTab(tabVal: string){
tab.value = tabVal; tab.value = tabVal;
dataArrayNumber.value = Number(tabVal.charAt(4)); dataArrayNumber.value = Number(tabVal.charAt(4));
}; };
const downloadFile = (response: any, filename: string) => {
/** เปลี่ยน type file */
function downloadFile(response: any, filename: string){
const link = document.createElement("a"); const link = document.createElement("a");
var fileName = filename; var fileName = filename;
link.href = window.URL.createObjectURL(new Blob([response.data])); link.href = window.URL.createObjectURL(new Blob([response.data]));
@ -67,7 +80,12 @@ const downloadFile = (response: any, filename: string) => {
link.click(); link.click();
document.body.removeChild(link); document.body.removeChild(link);
}; };
const FileDownload = async (type: string) => {
/**
* download file
* @param type type
*/
async function FileDownload(type: string){
let numTab = probationStore.evaluate.find( let numTab = probationStore.evaluate.find(
(e: any) => e.no === dataArrayNumber.value (e: any) => e.no === dataArrayNumber.value
); );
@ -111,7 +129,9 @@ const FileDownload = async (type: string) => {
}); });
} }
}; };
const addData = () => {
/** เปลี่ยนหน้า เพิ่ม */
function addData(){
router.push( router.push(
`/probation/detail/addevaluacommander/${personalId.value}/${assignId.value}` `/probation/detail/addevaluacommander/${personalId.value}/${assignId.value}`
); );

View file

@ -35,7 +35,11 @@ const tabs = ref<any>([]);
const dataArrayNumber = ref<number>(1); const dataArrayNumber = ref<number>(1);
const evaluate = ref<any>([]); const evaluate = ref<any>([]);
const changeTab = (tabVal: string) => { /**
* เปลยน tab
* @param tabVal type
*/
function changeTab(tabVal: string){
tab.value = tabVal; tab.value = tabVal;
dataArrayNumber.value = Number(tabVal.charAt(4)); dataArrayNumber.value = Number(tabVal.charAt(4));
}; };
@ -44,7 +48,11 @@ onMounted(() => {
fecthAssign(assignId.value); fecthAssign(assignId.value);
}); });
const fecthAssign = async (id: string) => { /**
* get data
* @param id person id
*/
async function fecthAssign(id: string){
showLoader(); showLoader();
await http await http
.get(config.API.createformCommader(id)) .get(config.API.createformCommader(id))
@ -62,7 +70,9 @@ const fecthAssign = async (id: string) => {
hideLoader(); hideLoader();
}); });
}; };
const downloadFile = (response: any, filename: string) => {
/** เปลี่ยน type file */
function downloadFile(response: any, filename: string){
const link = document.createElement("a"); const link = document.createElement("a");
var fileName = filename; var fileName = filename;
link.href = window.URL.createObjectURL(new Blob([response.data])); link.href = window.URL.createObjectURL(new Blob([response.data]));
@ -72,7 +82,11 @@ const downloadFile = (response: any, filename: string) => {
document.body.removeChild(link); document.body.removeChild(link);
}; };
const FileDownload = async (type: string) => { /**
* download file
* @param type type
*/
async function FileDownload(type: string){
let numTab = evaluate.value.find((e: any) => e.no === dataArrayNumber.value); let numTab = evaluate.value.find((e: any) => e.no === dataArrayNumber.value);
showLoader(); showLoader();
await http await http
@ -92,7 +106,9 @@ const FileDownload = async (type: string) => {
hideLoader(); hideLoader();
}); });
}; };
const addData = () => {
/** เปลี่ยนหน้า เพิ่ม */
function addData(){
router.push( router.push(
`/probation/detail/addevalua/${personalId.value}/${assignId.value}` `/probation/detail/addevalua/${personalId.value}/${assignId.value}`
); );