Merge branch 'probation-dev-local' into warunee-dev
This commit is contained in:
commit
0ee99d21e1
6 changed files with 716 additions and 734 deletions
|
|
@ -1,6 +1,8 @@
|
|||
import env from "../index";
|
||||
const dataOptions = `${env.API_PROBATION_URI}/data-options`;
|
||||
const personal = `${env.API_PROBATION_URI}/personal`;
|
||||
const calculate = `${env.API_PROBATION_URI}/calculate`;
|
||||
const finish = `${env.API_PROBATION_URI}/assign`;
|
||||
|
||||
export default {
|
||||
competencyOptions: () => `${dataOptions}/competency`,
|
||||
|
|
@ -8,7 +10,11 @@ export default {
|
|||
knowledgeOptions: () => `${dataOptions}/knowledge`,
|
||||
skillOptions: () => `${dataOptions}/skill`,
|
||||
lawOptions: () => `${dataOptions}/law`,
|
||||
|
||||
personalList: () => `${personal}/list`,
|
||||
personal: (personalId:string) => `${personal}?personal_id=${personalId}`,
|
||||
newAssign: (personalId:string) => `${dataOptions}/new-assign?personal_id=${personalId}`,
|
||||
calculateDate: () => `${calculate}/assign-finish`,
|
||||
saveFinish: (personalId:string) => `${finish}/probation-assign?personal_id=${personalId}`,
|
||||
personalAdd: () => `${personal}/add`,
|
||||
// clearPosition: (personalId:string) => `${placement}/position/clear/${personalId}`
|
||||
};
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load diff
|
|
@ -84,7 +84,7 @@
|
|||
<q-tr
|
||||
:props="props"
|
||||
class="cursor-pointer"
|
||||
@click="router.push(`/probation/detail/${props.rowIndex + 1}`)"
|
||||
@click="router.push(`/probation/detail/${props.row.personal_id}`)"
|
||||
>
|
||||
<q-td v-for="col in props.cols" :key="col.name" :props="props">
|
||||
<div v-if="col.name == 'no'">
|
||||
|
|
@ -257,12 +257,12 @@ const pagination = ref({
|
|||
const visibleColumns = ref<string[]>([
|
||||
"no",
|
||||
"name",
|
||||
"position",
|
||||
"level",
|
||||
"institution",
|
||||
"time",
|
||||
"status",
|
||||
"orderNum",
|
||||
"position_line",
|
||||
"position_level",
|
||||
"organization",
|
||||
"probation_no",
|
||||
"order_number",
|
||||
"probation_status",
|
||||
]); //ค้นหา คอลัมน์ คอลัมน์ที่แสดง
|
||||
|
||||
// หัวตาราง
|
||||
|
|
@ -286,114 +286,63 @@ const columns = ref<QTableProps["columns"]>([
|
|||
style: "font-size: 14px",
|
||||
},
|
||||
{
|
||||
name: "position",
|
||||
name: "position_line",
|
||||
align: "left",
|
||||
label: "ตำแหน่งในสายงาน",
|
||||
sortable: true,
|
||||
field: "position",
|
||||
field: "position_line",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
},
|
||||
{
|
||||
name: "level",
|
||||
name: "position_level",
|
||||
align: "left",
|
||||
label: "ระดับ",
|
||||
sortable: true,
|
||||
field: "level",
|
||||
field: "position_level",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
},
|
||||
{
|
||||
name: "institution",
|
||||
name: "organization",
|
||||
align: "left",
|
||||
label: "สังกัด",
|
||||
sortable: true,
|
||||
field: "institution",
|
||||
field: "organization",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
},
|
||||
{
|
||||
name: "time",
|
||||
name: "probation_no",
|
||||
align: "center",
|
||||
label: "ครั้งที่ทดลองงาน",
|
||||
sortable: true,
|
||||
field: "time",
|
||||
field: "probation_no",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
},
|
||||
{
|
||||
name: "orderNum",
|
||||
name: "order_number",
|
||||
align: "center",
|
||||
label: "เลขที่คําสั่งบรรจุแต่งตั้ง",
|
||||
sortable: true,
|
||||
field: "orderNum",
|
||||
field: "order_number",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
},
|
||||
{
|
||||
name: "status",
|
||||
name: "probation_status",
|
||||
align: "left",
|
||||
label: "สถานะทดลองงาน",
|
||||
sortable: true,
|
||||
field: "status",
|
||||
field: "probation_status",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
},
|
||||
]);
|
||||
|
||||
// ข้อมูลตาราง (จำลอง)
|
||||
const rows = ref<FormMainProbation[]>([
|
||||
{
|
||||
no: "1",
|
||||
name: "นายสมคิด ยอดใจ ",
|
||||
position: "นักวิชาการพัสดุ",
|
||||
level: "ปฏิบัติการ",
|
||||
institution: "กลุ่มงานโครงสร้างและอัตรากำลัง ๒",
|
||||
time: "1",
|
||||
status: "อยู่ระหว่างการทดลองงาน",
|
||||
orderNum: "11/2566",
|
||||
},
|
||||
{
|
||||
no: "2",
|
||||
name: "นายเกียรติศักดิ์ บัณฑิต",
|
||||
position: "นักวิชาการพัสดุ",
|
||||
level: "ปฏิบัติการ",
|
||||
institution: "กลุ่มงานโครงสร้างและอัตรากำลัง ๒",
|
||||
time: "1",
|
||||
status: "อยู่ระหว่างการทดลองงาน",
|
||||
orderNum: "11/2566",
|
||||
},
|
||||
{
|
||||
no: "3",
|
||||
name: "นางสาวกัณฐิมา กาฬสินธุ์",
|
||||
position: "นักจัดการงานทั่วไป",
|
||||
level: "ปฏิบัติการ",
|
||||
institution: "กลุ่มงานช่วยนักบริหาร",
|
||||
time: "1",
|
||||
status: "อยู่ระหว่างการทดลองงาน",
|
||||
orderNum: "11/2566",
|
||||
},
|
||||
{
|
||||
no: "4",
|
||||
name: "นางสาวเมขลา กระจ่างมนตรี",
|
||||
position: "นักจัดการงานทั่วไป",
|
||||
level: "ปฏิบัติการ",
|
||||
institution: "กลุ่มงานช่วยนักบริหาร",
|
||||
time: "1",
|
||||
status: "ไม่ผ่านการทดลอง",
|
||||
orderNum: "11/2566",
|
||||
},
|
||||
{
|
||||
no: "5",
|
||||
name: "นางสาวฐิติรัตน์ พงษ์ศิริ",
|
||||
position: "นักจัดการงานทั่วไป",
|
||||
level: "ปฏิบัติการ",
|
||||
institution: "กลุ่มงานช่วยนักบริหาร",
|
||||
time: "1",
|
||||
status: "ผ่านการทดลองงาน",
|
||||
orderNum: "11/2566",
|
||||
},
|
||||
]);
|
||||
const rows = ref<FormMainProbation[]>([]);
|
||||
|
||||
// หัวตาราง2
|
||||
const columns2 = ref<QTableProps["columns"]>([
|
||||
|
|
@ -483,28 +432,37 @@ const rows2 = ref<FormMainProbation2[]>([
|
|||
// },
|
||||
]);
|
||||
|
||||
onMounted(async () => {});
|
||||
|
||||
watch(modal, () => {
|
||||
if (modal.value === true) {
|
||||
fecthOrganiz();
|
||||
}
|
||||
onMounted(async () => {
|
||||
getpersonalList();
|
||||
});
|
||||
|
||||
const fecthOrganiz = async () => {
|
||||
// watch(modal, () => {
|
||||
// if (modal.value === true) {
|
||||
// getpersonalList();
|
||||
// }
|
||||
// });
|
||||
|
||||
const getpersonalList = async () => {
|
||||
showLoader();
|
||||
await http
|
||||
.get(config.API.profileOrganizRoot)
|
||||
.get(config.API.personalList())
|
||||
.then((res) => {
|
||||
console.log(res);
|
||||
let id = res.data.result[0].id;
|
||||
if (id !== "") {
|
||||
findlist(id);
|
||||
}
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
const data = res.data.data;
|
||||
rows.value = data.map((item: FormMainProbation) => ({
|
||||
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(() => {})
|
||||
.finally(() => {
|
||||
hideLoader();
|
||||
});
|
||||
|
|
@ -559,15 +517,11 @@ const clickAdd = (id: string) => {
|
|||
.onOk(async () => {
|
||||
const postData = {
|
||||
personal_id: id,
|
||||
}
|
||||
};
|
||||
console.log("postData:", postData);
|
||||
await http
|
||||
.post(config.API.personalAdd(), postData)
|
||||
.then((res) => {
|
||||
console.log("res:", res);
|
||||
|
||||
});
|
||||
|
||||
await http.post(config.API.personalAdd(), postData).then((res) => {
|
||||
console.log("res:", res);
|
||||
});
|
||||
})
|
||||
.onCancel(() => {})
|
||||
.onDismiss(() => {});
|
||||
|
|
|
|||
|
|
@ -34,19 +34,19 @@
|
|||
<div class="col-xs-6 col-sm-3 row items-center">
|
||||
<div class="col-12 q-pl-md">
|
||||
<div class="col-12 text-top">ตำแหน่งในสายงาน</div>
|
||||
<div class="col-12 text-detail">{{ position }}</div>
|
||||
<div class="col-12 text-detail">{{ position_line }}</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-xs-6 col-sm-2 row items-center">
|
||||
<div class="col-12">
|
||||
<div class="col-12 text-top">ระดับ</div>
|
||||
<div class="col-12 text-detail">{{ level }}</div>
|
||||
<div class="col-12 text-detail">{{ position_level }}</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-xs-6 col-sm-3 row items-center">
|
||||
<div class="col-12">
|
||||
<div class="col-12 text-top">สังกัด</div>
|
||||
<div class="col-12 text-detail">{{ institution }}</div>
|
||||
<div class="col-12 text-detail">{{ organization }}</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-xs-6 col-sm-3 row items-center">
|
||||
|
|
@ -55,18 +55,18 @@
|
|||
<div class="col-12 text-detail">
|
||||
<q-icon
|
||||
size="20px"
|
||||
v-if="status == 'อยู่ระหว่างการทดลองงาน'"
|
||||
v-if="probation_status == 'PENDING'"
|
||||
name="mdi-timer-sand"
|
||||
color="deep-orange"
|
||||
/>
|
||||
<q-icon
|
||||
size="20px"
|
||||
v-else-if="status == 'ไม่ผ่านการทดลอง'"
|
||||
v-else-if="probation_status == 'ไม่ผ่านการทดลอง'"
|
||||
name="mdi-close"
|
||||
color="red"
|
||||
/>
|
||||
<q-icon size="20px" v-else name="mdi-check" color="teal" />
|
||||
{{ status }}
|
||||
{{ probation_status == 'PENDING' ? 'อยู่ในระหว่างการทดลองงาน' : '' }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -78,7 +78,7 @@
|
|||
<div class="row col-12 q-col-gutter-sm">
|
||||
<div>
|
||||
<q-btn
|
||||
@click="router.push(`/probation/add`)"
|
||||
@click="router.push(`/probation/add/${personalId}`)"
|
||||
size="12px"
|
||||
flat
|
||||
round
|
||||
|
|
@ -191,17 +191,26 @@
|
|||
</template>
|
||||
<script setup lang="ts">
|
||||
import { useRouter, useRoute } from "vue-router";
|
||||
import { ref, useAttrs } 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 http from "@/plugins/http";
|
||||
import config from "@/app.config";
|
||||
|
||||
const $q = useQuasar(); //ใช้ noti quasar
|
||||
const mixin = useCounterMixin();
|
||||
const { messageError, success, showLoader, hideLoader } = mixin;
|
||||
const router = useRouter();
|
||||
const route = useRoute();
|
||||
|
||||
const name = ref<string>("นายสมคิด ยอดใจ");
|
||||
const position = ref<string>("นักจัดการงานทั่วไป");
|
||||
const level = ref<string>("ชำนาญการพิเศษ");
|
||||
const institution = ref<string>("ฝ่ายบริหารงานทั่วไป");
|
||||
const status = ref<string>("อยู่ระหว่างการทดลองงาน");
|
||||
const personalId = ref<string>(route.params.id as string);
|
||||
const name = ref<string>("");
|
||||
const position_line = ref<string>("");
|
||||
const position_level = ref<string>("");
|
||||
const organization = ref<string>("");
|
||||
const probation_status = ref<string>("");
|
||||
|
||||
const pagination = ref({
|
||||
sortBy: "desc",
|
||||
|
|
@ -314,6 +323,42 @@ const paginationLabel = (start: string, end: string, total: string) => {
|
|||
if (paging.value == true) return " " + start + "-" + end + " ใน " + total;
|
||||
else return start + "-" + end + " ใน " + total;
|
||||
};
|
||||
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
|
||||
|
||||
// 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(() => {})
|
||||
.finally(() => {
|
||||
hideLoader();
|
||||
});
|
||||
};
|
||||
|
||||
onMounted(async () => {
|
||||
await getpersonalList()
|
||||
console.log()
|
||||
})
|
||||
</script>
|
||||
<style lang="scss" scope>
|
||||
.q-img {
|
||||
|
|
|
|||
|
|
@ -24,14 +24,17 @@ interface FormOrderPlacementMainData {
|
|||
}
|
||||
|
||||
interface FormMainProbation {
|
||||
no: string;
|
||||
name: string;
|
||||
position: string;
|
||||
level: string;
|
||||
institution: string;
|
||||
time: string;
|
||||
status: string;
|
||||
orderNum: string;
|
||||
personal_id: number,
|
||||
ordering: number,
|
||||
name: string,
|
||||
position_line: string,
|
||||
position_line_id: string,
|
||||
position_level: string,
|
||||
position_level_id: string,
|
||||
organization: string,
|
||||
probation_no: number,
|
||||
order_number: string,
|
||||
probation_status: string
|
||||
}
|
||||
interface FormMainProbation2 {
|
||||
no: string;
|
||||
|
|
@ -47,8 +50,21 @@ interface FormProbationDetail {
|
|||
intendant: string;
|
||||
commander: string;
|
||||
}
|
||||
interface FormProbationPersonal {
|
||||
personal_id: string,
|
||||
name: string,
|
||||
position_line: string,
|
||||
position_line_id: string,
|
||||
position_level: string,
|
||||
position_level_id: string,
|
||||
organization: string,
|
||||
probation_no: number,
|
||||
order_number: string,
|
||||
probation_status: string
|
||||
}
|
||||
export type { FormPlacementMainData };
|
||||
export type { FormOrderPlacementMainData };
|
||||
export type { FormMainProbation };
|
||||
export type { FormMainProbation2 };
|
||||
export type { FormProbationDetail };
|
||||
export type { FormProbationPersonal };
|
||||
|
|
|
|||
|
|
@ -177,7 +177,7 @@ export default [
|
|||
},
|
||||
},
|
||||
{
|
||||
path: "/probation/add",
|
||||
path: "/probation/add/:personalId",
|
||||
name: "probationWorkAdd",
|
||||
component: probationFormAssign,
|
||||
meta: {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue