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