แก้ไข Form ทดลองงาน
This commit is contained in:
parent
7b6c390193
commit
df7364f7b8
10 changed files with 2810 additions and 78 deletions
|
|
@ -82,11 +82,11 @@ const list2_3 = [
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
onMounted(async () => {
|
onMounted(async () => {
|
||||||
fecthAssign(assignId.value);
|
|
||||||
if (props.tab !== undefined) {
|
if (props.tab !== undefined) {
|
||||||
round.value = props.tab.charAt(4);
|
round.value = props.tab.charAt(4);
|
||||||
fetchEvaluate(assignId.value, round.value);
|
// fetchEvaluate(assignId.value, round.value);
|
||||||
}
|
}
|
||||||
|
fecthAssign(assignId.value);
|
||||||
// console.log(round.value);
|
// console.log(round.value);
|
||||||
// console.log(assignId.value);
|
// console.log(assignId.value);
|
||||||
});
|
});
|
||||||
|
|
@ -94,8 +94,7 @@ const fecthAssign = async (id: string) => {
|
||||||
showLoader();
|
showLoader();
|
||||||
await http
|
await http
|
||||||
.get(config.API.evaluateCreate(id))
|
.get(config.API.evaluateCreate(id))
|
||||||
.then((res: any) => {
|
.then(async (res: any) => {
|
||||||
// console.log(res);
|
|
||||||
person.value = res.data.data.person;
|
person.value = res.data.data.person;
|
||||||
assign.value = res.data.data.assign;
|
assign.value = res.data.data.assign;
|
||||||
commander.value = res.data.data.commander;
|
commander.value = res.data.data.commander;
|
||||||
|
|
@ -104,6 +103,11 @@ const fecthAssign = async (id: string) => {
|
||||||
evaluate_no.value = res.data.data.evaluate_no;
|
evaluate_no.value = res.data.data.evaluate_no;
|
||||||
start_date.value = res.data.data.start_date;
|
start_date.value = res.data.data.start_date;
|
||||||
date_finish.value = res.data.data.end_date;
|
date_finish.value = res.data.data.end_date;
|
||||||
|
console.log(props.tab, res.data.data.evaluate_no);
|
||||||
|
|
||||||
|
if (res.data.data.evaluate_no > round.value) {
|
||||||
|
await fetchEvaluate(assignId.value, round.value);
|
||||||
|
}
|
||||||
})
|
})
|
||||||
.catch((e) => {
|
.catch((e) => {
|
||||||
messageError($q, e);
|
messageError($q, e);
|
||||||
|
|
@ -113,11 +117,11 @@ const fecthAssign = async (id: string) => {
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
const fetchEvaluate = async (id: string, round: string) => {
|
const fetchEvaluate = async (id: string, round: string) => {
|
||||||
// showLoader();
|
showLoader();
|
||||||
await http
|
await http
|
||||||
.get(config.API.evaluatecommader(id, round))
|
.get(config.API.evaluatecommader(id, round))
|
||||||
.then((res: any) => {
|
.then((res: any) => {
|
||||||
// console.log(res);
|
console.log(res);
|
||||||
let data = res.data.data.evaluate;
|
let data = res.data.data.evaluate;
|
||||||
console.log(data);
|
console.log(data);
|
||||||
start_date.value = data.date_start;
|
start_date.value = data.date_start;
|
||||||
|
|
@ -165,11 +169,14 @@ const fetchEvaluate = async (id: string, round: string) => {
|
||||||
status.value = false;
|
status.value = false;
|
||||||
})
|
})
|
||||||
.catch((e) => {
|
.catch((e) => {
|
||||||
messageError($q, e);
|
|
||||||
console.log(e);
|
console.log(e);
|
||||||
|
|
||||||
|
if (e.data.message !== "Data not found!") {
|
||||||
|
messageError($q, e);
|
||||||
|
}
|
||||||
})
|
})
|
||||||
.finally(() => {
|
.finally(() => {
|
||||||
// hideLoader();
|
hideLoader();
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
File diff suppressed because it is too large
Load diff
|
|
@ -39,20 +39,18 @@ const props = defineProps({
|
||||||
tab: String,
|
tab: String,
|
||||||
});
|
});
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
console.log(props);
|
|
||||||
console.log(assignId.value);
|
|
||||||
fecthAssign(assignId.value);
|
|
||||||
if (props.tab !== undefined) {
|
if (props.tab !== undefined) {
|
||||||
round.value = props.tab.charAt(4);
|
round.value = props.tab.charAt(4);
|
||||||
fetchEvaluate(assignId.value, round.value);
|
// fetchEvaluate(assignId.value, round.value);
|
||||||
}
|
}
|
||||||
|
fecthAssign(assignId.value);
|
||||||
});
|
});
|
||||||
const fecthAssign = async (id: string) => {
|
const fecthAssign = async (id: string) => {
|
||||||
showLoader();
|
showLoader();
|
||||||
await http
|
await http
|
||||||
.get(config.API.evaluateChairman(id))
|
.get(config.API.evaluateChairman(id))
|
||||||
.then((res: any) => {
|
.then(async (res: any) => {
|
||||||
console.log(res);
|
// console.log(res);
|
||||||
assign.value = res.data.data.assign;
|
assign.value = res.data.data.assign;
|
||||||
evaluate_no.value = res.data.data.evaluate_no;
|
evaluate_no.value = res.data.data.evaluate_no;
|
||||||
start_date.value = res.data.data.start_date;
|
start_date.value = res.data.data.start_date;
|
||||||
|
|
@ -60,7 +58,10 @@ const fecthAssign = async (id: string) => {
|
||||||
chairman.value = res.data.data.chairman;
|
chairman.value = res.data.data.chairman;
|
||||||
commander.value = res.data.data.commander;
|
commander.value = res.data.data.commander;
|
||||||
mentors.value = res.data.data.mentors;
|
mentors.value = res.data.data.mentors;
|
||||||
console.log(mentors.value[0].name);
|
|
||||||
|
if (res.data.data.evaluate_no > round.value) {
|
||||||
|
await fetchEvaluate(assignId.value, round.value);
|
||||||
|
}
|
||||||
})
|
})
|
||||||
.catch((e) => {
|
.catch((e) => {
|
||||||
messageError($q, e);
|
messageError($q, e);
|
||||||
|
|
@ -122,7 +123,9 @@ const fetchEvaluate = async (id: string, round: string) => {
|
||||||
status.value = false;
|
status.value = false;
|
||||||
})
|
})
|
||||||
.catch((e) => {
|
.catch((e) => {
|
||||||
console.log(e);
|
if (e.data.message !== "Data not found!") {
|
||||||
|
messageError($q, e);
|
||||||
|
}
|
||||||
})
|
})
|
||||||
.finally(() => {
|
.finally(() => {
|
||||||
hideLoader();
|
hideLoader();
|
||||||
|
|
|
||||||
File diff suppressed because it is too large
Load diff
|
|
@ -40,18 +40,19 @@ const props = defineProps({
|
||||||
});
|
});
|
||||||
|
|
||||||
onMounted(async () => {
|
onMounted(async () => {
|
||||||
console.log("tab===>",props.tab)
|
console.log("tab===>", props.tab);
|
||||||
|
|
||||||
await fecthFormdata(assignId.value);
|
|
||||||
if (props.tab !== undefined) {
|
if (props.tab !== undefined) {
|
||||||
round.value = props.tab.charAt(4);
|
round.value = props.tab.charAt(4);
|
||||||
await fecthFormRound(assignId.value, round.value);
|
|
||||||
|
// await fecthFormRound(assignId.value, round.value);
|
||||||
}
|
}
|
||||||
|
await fecthFormdata(assignId.value);
|
||||||
});
|
});
|
||||||
const fecthFormdata = async (id: string) => {
|
const fecthFormdata = async (id: string) => {
|
||||||
await http
|
await http
|
||||||
.get(config.API.formevaluateRecord(id))
|
.get(config.API.formevaluateRecord(id))
|
||||||
.then((res: any) => {
|
.then(async (res: any) => {
|
||||||
console.log(res);
|
console.log(res);
|
||||||
evaluate_no.value = res.data.data.evaluate_no;
|
evaluate_no.value = res.data.data.evaluate_no;
|
||||||
start_date.value = res.data.data.start_date;
|
start_date.value = res.data.data.start_date;
|
||||||
|
|
@ -70,6 +71,12 @@ const fecthFormdata = async (id: string) => {
|
||||||
id: e.id,
|
id: e.id,
|
||||||
}));
|
}));
|
||||||
checkArray.value = list1_1.value.length;
|
checkArray.value = list1_1.value.length;
|
||||||
|
|
||||||
|
console.log(res.data.data.evaluate_no, round.value);
|
||||||
|
|
||||||
|
if (res.data.data.evaluate_no > round.value) {
|
||||||
|
await fecthFormRound(assignId.value, round.value);
|
||||||
|
}
|
||||||
})
|
})
|
||||||
.catch((e: any) => {
|
.catch((e: any) => {
|
||||||
console.log(e);
|
console.log(e);
|
||||||
|
|
@ -1321,8 +1328,7 @@ const saveformdata = async (data: any) => {
|
||||||
</div>
|
</div>
|
||||||
<q-toolbar class="text-primary">
|
<q-toolbar class="text-primary">
|
||||||
<q-space />
|
<q-space />
|
||||||
<q-btn label="บันทึก" color="secondary" @click="savaForm" />
|
<q-btn v-if="status" label="บันทึก" color="secondary" @click="savaForm" />
|
||||||
<!-- v-if="status" -->
|
|
||||||
</q-toolbar>
|
</q-toolbar>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
|
||||||
|
|
@ -25,6 +25,8 @@ const start_date = ref<Date>(new Date());
|
||||||
const date_finish = ref<Date>(new Date());
|
const date_finish = ref<Date>(new Date());
|
||||||
const round = ref<number>();
|
const round = ref<number>();
|
||||||
|
|
||||||
|
const checkArray = ref<number>(0);
|
||||||
|
|
||||||
onMounted(async () => {
|
onMounted(async () => {
|
||||||
await fecthFormdata(assignId.value);
|
await fecthFormdata(assignId.value);
|
||||||
});
|
});
|
||||||
|
|
@ -42,19 +44,30 @@ const fecthFormdata = async (id: string) => {
|
||||||
assign.value = res.data.data.assign;
|
assign.value = res.data.data.assign;
|
||||||
option.value.push(res.data.data.director);
|
option.value.push(res.data.data.director);
|
||||||
Autherise.value = res.data.data.director.name;
|
Autherise.value = res.data.data.director.name;
|
||||||
|
|
||||||
|
list1_1.value = res.data.data.assign_output;
|
||||||
|
evaluate_expenct_level.value = res.data.data.assign_output.map((e) => ({
|
||||||
|
id: e.id,
|
||||||
|
labal: e.output_desc,
|
||||||
|
}));
|
||||||
|
evaluate_ouptut.value = res.data.data.assign_output.map((e) => ({
|
||||||
|
id: e.id,
|
||||||
|
text: "",
|
||||||
|
}));
|
||||||
|
checkArray.value = list1_1.value.length;
|
||||||
})
|
})
|
||||||
.catch((e: any) => {
|
.catch((e: any) => {
|
||||||
console.log(e);
|
console.log(e);
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
const list1_1 = [
|
const list1_1 = ref<any>([
|
||||||
{ id: "1", label: "ผลผลิตของงานที่คาดหวัง 1" },
|
// { id: "1", label: "ผลผลิตของงานที่คาดหวัง 1" },
|
||||||
{ id: "2", label: "ผลผลิตของงานที่คาดหวัง 2" },
|
// { id: "2", label: "ผลผลิตของงานที่คาดหวัง 2" },
|
||||||
{ id: "3", label: "ผลผลิตของงานที่คาดหวัง 3" },
|
// { id: "3", label: "ผลผลิตของงานที่คาดหวัง 3" },
|
||||||
{ id: "4", label: "ผลผลิตของงานที่คาดหวัง 4" },
|
// { id: "4", label: "ผลผลิตของงานที่คาดหวัง 4" },
|
||||||
{ id: "5", label: "ผลผลิตของงานที่คาดหวัง 5" },
|
// { id: "5", label: "ผลผลิตของงานที่คาดหวัง 5" },
|
||||||
];
|
]);
|
||||||
const list1_2 = [
|
const list1_2 = [
|
||||||
{ id: "1", label: "ผลผลิตของงานที่เกิดขึ้น 1" },
|
{ id: "1", label: "ผลผลิตของงานที่เกิดขึ้น 1" },
|
||||||
{ id: "2", label: "ผลผลิตของงานที่เกิดขึ้น 2" },
|
{ id: "2", label: "ผลผลิตของงานที่เกิดขึ้น 2" },
|
||||||
|
|
@ -115,18 +128,18 @@ const period = ref<number>(1);
|
||||||
|
|
||||||
// part 1
|
// part 1
|
||||||
const evaluate_expenct_level = ref<any>([
|
const evaluate_expenct_level = ref<any>([
|
||||||
{ id: "1", label: "ผลผลิตของงานที่คาดหวัง 1", level: 0 },
|
// { id: "1", label: "ผลผลิตของงานที่คาดหวัง 1", level: 0 },
|
||||||
{ id: "2", label: "ผลผลิตของงานที่คาดหวัง 2", level: 0 },
|
// { id: "2", label: "ผลผลิตของงานที่คาดหวัง 2", level: 0 },
|
||||||
{ id: "3", label: "ผลผลิตของงานที่คาดหวัง 3", level: 0 },
|
// { id: "3", label: "ผลผลิตของงานที่คาดหวัง 3", level: 0 },
|
||||||
{ id: "4", label: "ผลผลิตของงานที่คาดหวัง 4", level: 0 },
|
// { id: "4", label: "ผลผลิตของงานที่คาดหวัง 4", level: 0 },
|
||||||
{ id: "5", label: "ผลผลิตของงานที่คาดหวัง 5", level: 0 },
|
// { id: "5", label: "ผลผลิตของงานที่คาดหวัง 5", level: 0 },
|
||||||
]);
|
]);
|
||||||
const evaluate_ouptut = ref<any>([
|
const evaluate_ouptut = ref<any>([
|
||||||
{ level: 0, text: "" },
|
// { level: 0, text: "" },
|
||||||
{ level: 0, text: "" },
|
// { level: 0, text: "" },
|
||||||
{ level: 0, text: "" },
|
// { level: 0, text: "" },
|
||||||
{ level: 0, text: "" },
|
// { level: 0, text: "" },
|
||||||
{ level: 0, text: "" },
|
// { level: 0, text: "" },
|
||||||
]);
|
]);
|
||||||
const knowledge_level = ref<number>(0);
|
const knowledge_level = ref<number>(0);
|
||||||
const skill_level = ref<number>(0);
|
const skill_level = ref<number>(0);
|
||||||
|
|
@ -187,16 +200,16 @@ const savaForm = () => {
|
||||||
behavio_inproveRef.value.validate();
|
behavio_inproveRef.value.validate();
|
||||||
|
|
||||||
let hasError = false;
|
let hasError = false;
|
||||||
const filterlevel1_1 = evaluate_expenct_level.value.filter(
|
// const filterlevel1_1 = evaluate_expenct_level.value.filter(
|
||||||
(e: any) => e.level == 0
|
// (e: any) => e.level == 0
|
||||||
);
|
// );
|
||||||
const filter_ouptut1_2 = evaluate_ouptut.value.filter(
|
// const filter_ouptut1_2 = evaluate_ouptut.value.filter(
|
||||||
(e: any) => e.level == 0 || e.text == ""
|
// (e: any) => e.level == 0 || e.text == ""
|
||||||
);
|
// );
|
||||||
|
|
||||||
if (
|
if (
|
||||||
filterlevel1_1.length != 0 ||
|
// filterlevel1_1.length != 0 ||
|
||||||
filter_ouptut1_2.length != 0 ||
|
// filter_ouptut1_2.length != 0 ||
|
||||||
knowledge_level.value === 0 ||
|
knowledge_level.value === 0 ||
|
||||||
skill_level.value === 0 ||
|
skill_level.value === 0 ||
|
||||||
competency_level.value === 0 ||
|
competency_level.value === 0 ||
|
||||||
|
|
@ -350,9 +363,7 @@ const saveformdata = async (data: any) => {
|
||||||
</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-black q-px-sm">{{
|
<span class="text-black q-px-sm">{{ "ครั้งที่" + round }}</span>
|
||||||
"ครั้งที่" + round
|
|
||||||
}}</span>
|
|
||||||
ระหว่างวันที่
|
ระหว่างวันที่
|
||||||
<span class="text-black q-px-sm">{{
|
<span class="text-black q-px-sm">{{
|
||||||
date2Thai(start_date)
|
date2Thai(start_date)
|
||||||
|
|
@ -387,7 +398,7 @@ const saveformdata = async (data: any) => {
|
||||||
<q-list dense v-for="(list, i) in list1_1" :key="i">
|
<q-list dense v-for="(list, i) in list1_1" :key="i">
|
||||||
<q-item dense tag="label" v-ripple>
|
<q-item dense tag="label" v-ripple>
|
||||||
<q-item-section>
|
<q-item-section>
|
||||||
<q-item-label>{{ list.label }}</q-item-label>
|
<q-item-label>{{ list.output_desc }}</q-item-label>
|
||||||
</q-item-section>
|
</q-item-section>
|
||||||
<q-item-section side>
|
<q-item-section side>
|
||||||
<q-rating
|
<q-rating
|
||||||
|
|
@ -435,7 +446,7 @@ const saveformdata = async (data: any) => {
|
||||||
class="col-xs-12 col-sm-11 col-md-10 offset-md-1 q-pa-sm bg-grey-1"
|
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 list1_2" :key="i">
|
<q-list dense v-for="(list, i) in list1_2" :key="i">
|
||||||
<q-item dense tag="label" v-ripple>
|
<q-item dense tag="label" v-ripple v-if="i < checkArray">
|
||||||
<q-item-section>
|
<q-item-section>
|
||||||
<!-- <q-item-label>{{ list.label }}</q-item-label> -->
|
<!-- <q-item-label>{{ list.label }}</q-item-label> -->
|
||||||
<q-input
|
<q-input
|
||||||
|
|
|
||||||
|
|
@ -56,7 +56,7 @@ const changeTab = (tabVal: string) => {
|
||||||
};
|
};
|
||||||
const addData = () => {
|
const addData = () => {
|
||||||
router.push(
|
router.push(
|
||||||
`/probation/detail/add/${personalId.value}/${assignId.value}`
|
`/probation/detail/addresult/${personalId.value}/${assignId.value}`
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
|
||||||
|
|
@ -1,21 +1,74 @@
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { ref, defineAsyncComponent } from "vue";
|
import { ref, defineAsyncComponent, onMounted } from "vue";
|
||||||
const tab = ref<string>("save1");
|
import http from "@/plugins/http";
|
||||||
const changeTab = (tabVal: string) => {
|
import config from "@/app.config";
|
||||||
tab.value = tabVal
|
import { useQuasar } from "quasar";
|
||||||
}
|
import { useRoute, useRouter } from "vue-router";
|
||||||
|
import { useCounterMixin } from "@/stores/mixin";
|
||||||
const Header = defineAsyncComponent(
|
const Header = defineAsyncComponent(
|
||||||
() => import("@/modules/05_placement/components/probation/FormEvaluation/Header.vue")
|
() =>
|
||||||
|
import(
|
||||||
|
"@/modules/05_placement/components/probation/FormEvaluation/Header.vue"
|
||||||
|
)
|
||||||
);
|
);
|
||||||
const FormEvaluate = defineAsyncComponent(
|
const FormEvaluate = defineAsyncComponent(
|
||||||
() => import("@/modules/05_placement/components/probation/FormEvaluation/FormEvaluate.vue")
|
() =>
|
||||||
)
|
import(
|
||||||
|
"@/modules/05_placement/components/probation/FormEvaluation/FormEvaluate.vue"
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
|
const router = useRouter();
|
||||||
|
const route = useRoute();
|
||||||
|
const mixin = useCounterMixin();
|
||||||
|
const $q = useQuasar();
|
||||||
|
const { showLoader, hideLoader, messageError, success } = mixin;
|
||||||
|
const assignId = ref<string>(route.params.form.toString());
|
||||||
|
const personalId = ref<string>(route.params.personalId.toString());
|
||||||
|
|
||||||
|
const tab = ref<string>("save1");
|
||||||
|
const tabs = ref<any>([]);
|
||||||
|
const activeTab = ref<string>("tab2");
|
||||||
|
|
||||||
|
const changeTab = (tabVal: string) => {
|
||||||
|
tab.value = tabVal;
|
||||||
|
};
|
||||||
|
|
||||||
|
onMounted(() => {
|
||||||
|
fecthAssign(assignId.value);
|
||||||
|
});
|
||||||
|
|
||||||
|
const fecthAssign = async (id: string) => {
|
||||||
|
showLoader();
|
||||||
|
await http
|
||||||
|
.get(config.API.evaluateCreate(id))
|
||||||
|
.then((res: any) => {
|
||||||
|
if (res.data.data.evaluate_no > 2) {
|
||||||
|
tabs.value = res.data.data.evaluate;
|
||||||
|
} else tabs.value.push({ no: 1 }, { no: 2 });
|
||||||
|
})
|
||||||
|
.catch((e: any) => {
|
||||||
|
console.log(e);
|
||||||
|
messageError($q, e);
|
||||||
|
})
|
||||||
|
.finally(() => {
|
||||||
|
hideLoader();
|
||||||
|
});
|
||||||
|
};
|
||||||
|
const addData = () => {
|
||||||
|
router.push(`/probation/detail/addevalua/${personalId.value}/${assignId.value}`);
|
||||||
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<Header :change-tab="changeTab" />
|
<Header
|
||||||
|
:change-tab="changeTab"
|
||||||
|
:activeTab="activeTab"
|
||||||
|
:loop="tabs.length"
|
||||||
|
:add-data="addData"
|
||||||
|
/>
|
||||||
|
|
||||||
<q-page-container>
|
<!-- <q-page-container>
|
||||||
<q-tab-panels v-model="tab" animated>
|
<q-tab-panels v-model="tab" animated>
|
||||||
<q-tab-panel name="save1">
|
<q-tab-panel name="save1">
|
||||||
<FormEvaluate :tab="tab" />
|
<FormEvaluate :tab="tab" />
|
||||||
|
|
@ -25,5 +78,16 @@ const FormEvaluate = defineAsyncComponent(
|
||||||
<FormEvaluate :tab="tab"/>
|
<FormEvaluate :tab="tab"/>
|
||||||
</q-tab-panel>
|
</q-tab-panel>
|
||||||
</q-tab-panels>
|
</q-tab-panels>
|
||||||
|
</q-page-container> -->
|
||||||
|
<q-page-container>
|
||||||
|
<q-tab-panels v-model="tab" animated>
|
||||||
|
<q-tab-panel
|
||||||
|
v-for="tabName in tabs"
|
||||||
|
:key="tabName"
|
||||||
|
:name="'save' + tabName.no"
|
||||||
|
>
|
||||||
|
<FormEvaluate :tab="tab" />
|
||||||
|
</q-tab-panel>
|
||||||
|
</q-tab-panels>
|
||||||
</q-page-container>
|
</q-page-container>
|
||||||
</template>
|
</template>
|
||||||
|
|
@ -1,9 +1,10 @@
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { ref, defineAsyncComponent } from "vue";
|
import { ref, defineAsyncComponent, onMounted } from "vue";
|
||||||
const tab = ref<string>("save1");
|
import http from "@/plugins/http";
|
||||||
const changeTab = (tabVal: string) => {
|
import config from "@/app.config";
|
||||||
tab.value = tabVal;
|
import { useQuasar } from "quasar";
|
||||||
};
|
import { useRoute, useRouter } from "vue-router";
|
||||||
|
import { useCounterMixin } from "@/stores/mixin";
|
||||||
const Header = defineAsyncComponent(
|
const Header = defineAsyncComponent(
|
||||||
() =>
|
() =>
|
||||||
import(
|
import(
|
||||||
|
|
@ -16,12 +17,56 @@ const FormEvaluateScore = defineAsyncComponent(
|
||||||
"@/modules/05_placement/components/probation/FormEvaluation/FormEvaluateScore.vue"
|
"@/modules/05_placement/components/probation/FormEvaluation/FormEvaluateScore.vue"
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
const router = useRouter();
|
||||||
|
const route = useRoute();
|
||||||
|
const mixin = useCounterMixin();
|
||||||
|
const $q = useQuasar();
|
||||||
|
const { showLoader, hideLoader, messageError, success } = mixin;
|
||||||
|
const assignId = ref<string>(route.params.form.toString());
|
||||||
|
const personalId = ref<string>(route.params.personalId.toString());
|
||||||
|
|
||||||
|
const tab = ref<string>("save1");
|
||||||
|
const tabs = ref<any>([]);
|
||||||
|
const activeTab = ref<string>("tab2");
|
||||||
|
|
||||||
|
onMounted(() => {
|
||||||
|
fecthAssign(assignId.value);
|
||||||
|
});
|
||||||
|
|
||||||
|
const fecthAssign = async (id: string) => {
|
||||||
|
showLoader();
|
||||||
|
await http
|
||||||
|
.get(config.API.evaluateChairman(id))
|
||||||
|
.then((res: any) => {
|
||||||
|
if (res.data.data.evaluate_no > 2) {
|
||||||
|
tabs.value = res.data.data.evaluate;
|
||||||
|
} else tabs.value.push({ no: 1 }, { no: 2 });
|
||||||
|
})
|
||||||
|
.catch((e) => {
|
||||||
|
messageError($q, e);
|
||||||
|
})
|
||||||
|
.finally(() => {
|
||||||
|
hideLoader();
|
||||||
|
});
|
||||||
|
};
|
||||||
|
const addData = () => {
|
||||||
|
router.push(`/probation/detail/addevaluascore/${personalId.value}/${assignId.value}`);
|
||||||
|
};
|
||||||
|
const changeTab = (tabVal: string) => {
|
||||||
|
tab.value = tabVal;
|
||||||
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<Header :change-tab="changeTab" />
|
<Header
|
||||||
|
:change-tab="changeTab"
|
||||||
|
:activeTab="activeTab"
|
||||||
|
:loop="tabs.length"
|
||||||
|
:add-data="addData"
|
||||||
|
/>
|
||||||
|
|
||||||
<q-page-container>
|
<!-- <q-page-container>
|
||||||
<q-tab-panels v-model="tab" animated>
|
<q-tab-panels v-model="tab" animated>
|
||||||
<q-tab-panel name="save1">
|
<q-tab-panel name="save1">
|
||||||
<FormEvaluateScore :tab="tab" />
|
<FormEvaluateScore :tab="tab" />
|
||||||
|
|
@ -31,5 +76,16 @@ const FormEvaluateScore = defineAsyncComponent(
|
||||||
<FormEvaluateScore :tab="tab" />
|
<FormEvaluateScore :tab="tab" />
|
||||||
</q-tab-panel>
|
</q-tab-panel>
|
||||||
</q-tab-panels>
|
</q-tab-panels>
|
||||||
|
</q-page-container> -->
|
||||||
|
<q-page-container>
|
||||||
|
<q-tab-panels v-model="tab" animated>
|
||||||
|
<q-tab-panel
|
||||||
|
v-for="tabName in tabs"
|
||||||
|
:key="tabName"
|
||||||
|
:name="'save' + tabName.no"
|
||||||
|
>
|
||||||
|
<FormEvaluateScore :tab="tab" />
|
||||||
|
</q-tab-panel>
|
||||||
|
</q-tab-panels>
|
||||||
</q-page-container>
|
</q-page-container>
|
||||||
</template>
|
</template>
|
||||||
|
|
|
||||||
|
|
@ -27,6 +27,18 @@ const transfer = () =>
|
||||||
import("@/modules/05_placement/components/Transfer/transferMain.vue");
|
import("@/modules/05_placement/components/Transfer/transferMain.vue");
|
||||||
const transferbyId = () =>
|
const transferbyId = () =>
|
||||||
import("@/modules/05_placement/components/Transfer/transferRegistry.vue");
|
import("@/modules/05_placement/components/Transfer/transferRegistry.vue");
|
||||||
|
const FormSaveResultAdd = () =>
|
||||||
|
import(
|
||||||
|
"@/modules/05_placement/components/probation/FormEvaluation/FormSaveResultAdd.vue"
|
||||||
|
);
|
||||||
|
const FormEvaluateAdd = () =>
|
||||||
|
import(
|
||||||
|
"@/modules/05_placement/components/probation/FormEvaluation/FormEvaluateAdd.vue"
|
||||||
|
);
|
||||||
|
const FormEvaluateScoreAdd = () =>
|
||||||
|
import(
|
||||||
|
"@/modules/05_placement/components/probation/FormEvaluation/FormEvaluateScoreAdd.vue"
|
||||||
|
);
|
||||||
|
|
||||||
// คำสั่งช่วยราชการ/ส่งตัวกลับ
|
// คำสั่งช่วยราชการ/ส่งตัวกลับ
|
||||||
const RepatriationOrder = () =>
|
const RepatriationOrder = () =>
|
||||||
|
|
@ -49,10 +61,7 @@ const receiveDetail2 = () =>
|
||||||
import("@/modules/05_placement/components/Receive/receiveDetail2.vue");
|
import("@/modules/05_placement/components/Receive/receiveDetail2.vue");
|
||||||
const ReceiveAdd = () =>
|
const ReceiveAdd = () =>
|
||||||
import("@/modules/05_placement/components/Receive/FormAdd.vue");
|
import("@/modules/05_placement/components/Receive/FormAdd.vue");
|
||||||
const FormSaveResultAdd = () =>
|
|
||||||
import(
|
|
||||||
"@/modules/05_placement/components/probation/FormEvaluation/FormSaveResultAdd.vue"
|
|
||||||
);
|
|
||||||
//แต่งตั้ง-เลื่อน
|
//แต่งตั้ง-เลื่อน
|
||||||
const AppointmentMain = () => import("@/modules/05_placement/components/AppointMent/Main.vue");
|
const AppointmentMain = () => import("@/modules/05_placement/components/AppointMent/Main.vue");
|
||||||
const AppointmentDetail = () => import("@/modules/05_placement/components/AppointMent/Detail.vue");
|
const AppointmentDetail = () => import("@/modules/05_placement/components/AppointMent/Detail.vue");
|
||||||
|
|
@ -122,8 +131,8 @@ export default [
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: "/probation/detail/add/:id/:form",
|
path: "/probation/detail/addresult/:id/:form",
|
||||||
name: "probationFormAdd",
|
name: "probationFormAddresult",
|
||||||
component: FormSaveResultAdd,
|
component: FormSaveResultAdd,
|
||||||
meta: {
|
meta: {
|
||||||
Auth: true,
|
Auth: true,
|
||||||
|
|
@ -131,6 +140,26 @@ export default [
|
||||||
Role: "placement",
|
Role: "placement",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
path: "/probation/detail/addevalua/:id/:form",
|
||||||
|
name: "probationFormAddevalua",
|
||||||
|
component: FormEvaluateAdd,
|
||||||
|
meta: {
|
||||||
|
Auth: true,
|
||||||
|
Key: [6.3],
|
||||||
|
Role: "placement",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
path: "/probation/detail/addevaluascore/:id/:form",
|
||||||
|
name: "probationFormAddevaluascore",
|
||||||
|
component: FormEvaluateScoreAdd,
|
||||||
|
meta: {
|
||||||
|
Auth: true,
|
||||||
|
Key: [6.3],
|
||||||
|
Role: "placement",
|
||||||
|
},
|
||||||
|
},
|
||||||
{
|
{
|
||||||
path: "/probation/work/add",
|
path: "/probation/work/add",
|
||||||
name: "probationWorkAdd",
|
name: "probationWorkAdd",
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue