assignList
This commit is contained in:
parent
f81ff646ac
commit
414eca616d
3 changed files with 57 additions and 62 deletions
|
|
@ -66,7 +66,9 @@
|
|||
color="red"
|
||||
/>
|
||||
<q-icon size="20px" v-else name="mdi-check" color="teal" />
|
||||
{{ probation_status == 'PENDING' ? 'อยู่ในระหว่างการทดลองงาน' : '' }}
|
||||
{{
|
||||
probation_status == "PENDING" ? "อยู่ในระหว่างการทดลองงาน" : ""
|
||||
}}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -155,7 +157,7 @@
|
|||
<q-tr
|
||||
:props="props"
|
||||
class="cursor-pointer"
|
||||
@click="clickSelect(props.row.no)"
|
||||
@click="clickSelect(props.row.id)"
|
||||
>
|
||||
<q-td v-for="col in props.cols" :key="col.name" :props="props">
|
||||
<div v-if="col.name == 'no'">
|
||||
|
|
@ -191,18 +193,18 @@
|
|||
</template>
|
||||
<script setup lang="ts">
|
||||
import { useRouter, useRoute } from "vue-router";
|
||||
import { ref, useAttrs,onMounted } from "vue";
|
||||
import { ref, useAttrs, onMounted } from "vue";
|
||||
import type { QTableProps } from "quasar";
|
||||
import type { FormProbationDetail } from "@/modules/05_placement/interface/request/Main";
|
||||
import type { FormProbationPersonal } from "@/modules/05_placement/interface/request/Main";
|
||||
import { useCounterMixin } from "@/stores/mixin";
|
||||
import { useQuasar } from "quasar";
|
||||
import { date, useQuasar } from "quasar";
|
||||
import http from "@/plugins/http";
|
||||
import config from "@/app.config";
|
||||
|
||||
const $q = useQuasar(); //ใช้ noti quasar
|
||||
const mixin = useCounterMixin();
|
||||
const { messageError, success, showLoader, hideLoader } = mixin;
|
||||
const { messageError, success, showLoader, hideLoader,date2Thai } = mixin;
|
||||
const router = useRouter();
|
||||
const route = useRoute();
|
||||
const personalId = ref<string>(route.params.id as string);
|
||||
|
|
@ -221,9 +223,9 @@ const pagination = ref({
|
|||
|
||||
const visibleColumns = ref<string[]>([
|
||||
"no",
|
||||
"startDate",
|
||||
"endDete",
|
||||
"intendant",
|
||||
"date_start",
|
||||
"date_finish",
|
||||
"mentors",
|
||||
"commander",
|
||||
]); //ค้นหา คอลัมน์ คอลัมน์ที่แสดง
|
||||
|
||||
|
|
@ -239,29 +241,29 @@ const columns = ref<QTableProps["columns"]>([
|
|||
style: "font-size: 14px",
|
||||
},
|
||||
{
|
||||
name: "startDate",
|
||||
name: "date_start",
|
||||
align: "left",
|
||||
label: "ตั้งแต่วันที่",
|
||||
sortable: true,
|
||||
field: "startDate",
|
||||
field: "date_start",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
},
|
||||
{
|
||||
name: "endDete",
|
||||
name: "date_finish",
|
||||
align: "left",
|
||||
label: "ถึงวันที่",
|
||||
sortable: true,
|
||||
field: "endDete",
|
||||
field: "date_finish",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
},
|
||||
{
|
||||
name: "intendant",
|
||||
name: "mentors",
|
||||
align: "left",
|
||||
label: "ผู้ดูแล",
|
||||
sortable: true,
|
||||
field: "intendant",
|
||||
field: "mentors",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
},
|
||||
|
|
@ -277,29 +279,7 @@ const columns = ref<QTableProps["columns"]>([
|
|||
]);
|
||||
|
||||
// ข้อมูลตาราง (จำลอง)
|
||||
const rows = ref<FormProbationDetail[]>([
|
||||
{
|
||||
no: "1",
|
||||
startDate: "09 ก.ย. 2566",
|
||||
endDete: "20 ต.ค. 2566",
|
||||
intendant: "นางสาวรัชภรณ์ ภักดี",
|
||||
commander: "นายนภัทร วันดี",
|
||||
},
|
||||
{
|
||||
no: "2",
|
||||
startDate: "25 ต.ค. 2566",
|
||||
endDete: "24 ม.ค. 2567",
|
||||
intendant: "นางสาวทวิดา กมลเวชชี",
|
||||
commander: "นางพิศ โพธิ์ดำ",
|
||||
},
|
||||
// {
|
||||
// no: "3",
|
||||
// startDate: "09 ก.ย. 2566",
|
||||
// endDete: "20 ต.ค. 2566",
|
||||
// intendant: "นางสาวทวิดา กมลเวชชี",
|
||||
// commander: "นายนภัทร วันดี"
|
||||
// },
|
||||
]);
|
||||
const rows = ref<FormProbationDetail[]>([]);
|
||||
|
||||
const clickAdd = () => {};
|
||||
|
||||
|
|
@ -323,30 +303,40 @@ const paginationLabel = (start: string, end: string, total: string) => {
|
|||
if (paging.value == true) return " " + start + "-" + end + " ใน " + total;
|
||||
else return start + "-" + end + " ใน " + total;
|
||||
};
|
||||
const getAssignList = async () => {
|
||||
showLoader();
|
||||
await http
|
||||
.get(config.API.probationGetAssignList(personalId.value))
|
||||
.then((res) => {
|
||||
console.log("LIST ===>", res.data.data);
|
||||
const data = res.data.data;
|
||||
rows.value = data.map((item: FormProbationDetail) => ({
|
||||
id:item.id,
|
||||
round_no: item.round_no,
|
||||
date_start: date2Thai(new Date(item.date_start)),
|
||||
date_finish: date2Thai(new Date(item.date_finish)),
|
||||
mentors: item.mentors,
|
||||
commander: item.commander,
|
||||
chairman: item.chairman,
|
||||
}));
|
||||
})
|
||||
.catch(() => {})
|
||||
.finally(() => {
|
||||
hideLoader();
|
||||
});
|
||||
};
|
||||
const getpersonalList = async () => {
|
||||
showLoader();
|
||||
await http
|
||||
.get(config.API.personal(personalId.value))
|
||||
.then((res) => {
|
||||
const data = res.data.data;
|
||||
name.value = data.name
|
||||
position_line.value = data.position_line
|
||||
position_level.value = data.position_level
|
||||
organization.value = data.organization
|
||||
probation_status.value = data.probation_status
|
||||
name.value = data.name;
|
||||
position_line.value = data.position_line;
|
||||
position_level.value = data.position_level;
|
||||
organization.value = data.organization;
|
||||
probation_status.value = data.probation_status;
|
||||
|
||||
// rows.value = data.map((item: FormProbationPersonal) => ({
|
||||
// personal_id: item.personal_id,
|
||||
// name: item.name,
|
||||
// position_line: item.position_line,
|
||||
// position_line_id: item.position_line_id,
|
||||
// position_level: item.position_level,
|
||||
// position_level_id: item.position_level_id,
|
||||
// organization: item.organization,
|
||||
// probation_no: item.probation_no,
|
||||
// order_number: item.order_number,
|
||||
// probation_status: item.probation_status,
|
||||
// }));
|
||||
console.log("(data)", data);
|
||||
})
|
||||
.catch(() => {})
|
||||
|
|
@ -356,9 +346,9 @@ const getpersonalList = async () => {
|
|||
};
|
||||
|
||||
onMounted(async () => {
|
||||
await getpersonalList()
|
||||
console.log()
|
||||
})
|
||||
await getpersonalList();
|
||||
await getAssignList();
|
||||
});
|
||||
</script>
|
||||
<style lang="scss" scope>
|
||||
.q-img {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue