no message
This commit is contained in:
parent
6b80d6804f
commit
9ce455e100
5 changed files with 752 additions and 200 deletions
|
|
@ -1,6 +1,6 @@
|
|||
<script setup lang="ts">
|
||||
import { useQuasar, QForm } from "quasar";
|
||||
import { onMounted, reactive, ref } from "vue";
|
||||
import { onMounted, reactive, ref, watch } from "vue";
|
||||
import DialogHeader from "@/modules/05_placement/components/PersonalList/DialogHeader.vue";
|
||||
import DialogFooter from "@/modules/05_placement/components/PersonalList/DialogFooter.vue";
|
||||
import { useCounterMixin } from "@/stores/mixin";
|
||||
|
|
@ -18,6 +18,7 @@ const checkValidate = ref<boolean>(false);
|
|||
const myFormPosition = ref<any>();
|
||||
const selected = ref<string>("");
|
||||
const selectedFile = ref<string>("");
|
||||
const dataRespone = ref<any>();
|
||||
|
||||
// Set form field
|
||||
let dataForm = reactive({
|
||||
|
|
@ -29,9 +30,9 @@ let dataForm = reactive({
|
|||
positionLineId: "",
|
||||
positionPathSideId: "",
|
||||
positionTypeId: "",
|
||||
salaryAmount: null,
|
||||
mouthSalaryAmount: null,
|
||||
positionSalaryAmount: null,
|
||||
// salaryAmount: null,
|
||||
// mouthSalaryAmount: null,
|
||||
// positionSalaryAmount: null,
|
||||
});
|
||||
|
||||
onMounted(async () => {
|
||||
|
|
@ -61,6 +62,7 @@ const loadTreeData = async () => {
|
|||
.get(`${config.s3ClusterUrl}${selectedFile.value}`)
|
||||
.then((res: any) => {
|
||||
treeData.value = res.data;
|
||||
dataRespone.value = res.data;
|
||||
|
||||
// Filter objects with "name" null
|
||||
const filteredData = res.data.filter(filterByPersonIdNull);
|
||||
|
|
@ -75,6 +77,7 @@ const loadTreeData = async () => {
|
|||
};
|
||||
|
||||
function filterByPersonIdNull(obj: any) {
|
||||
// console.log(obj);
|
||||
if (obj.name === null && obj.isCondition != true) {
|
||||
return true;
|
||||
}
|
||||
|
|
@ -113,6 +116,7 @@ const props = defineProps({
|
|||
type: Function,
|
||||
default: () => console.log("close modal"),
|
||||
},
|
||||
personal: Object,
|
||||
});
|
||||
|
||||
const myFilterMethod = (node: any, filter: string) => {
|
||||
|
|
@ -160,9 +164,9 @@ const saveAppoint = async () => {
|
|||
positionLineId: dataForm.positionLineId,
|
||||
positionPathSideId: dataForm.positionPathSideId,
|
||||
positionTypeId: dataForm.positionTypeId,
|
||||
salaryAmount: dataForm.salaryAmount,
|
||||
mouthSalaryAmount: dataForm.mouthSalaryAmount,
|
||||
positionSalaryAmount: dataForm.positionSalaryAmount,
|
||||
// salaryAmount: dataForm.salaryAmount,
|
||||
// mouthSalaryAmount: dataForm.mouthSalaryAmount,
|
||||
// positionSalaryAmount: dataForm.positionSalaryAmount,
|
||||
};
|
||||
// console.log("save appoint===>", dataAppoint);
|
||||
|
||||
|
|
@ -219,9 +223,9 @@ const closeAndClear = async () => {
|
|||
dataForm.positionLineId = "";
|
||||
dataForm.positionPathSideId = "";
|
||||
dataForm.positionTypeId = "";
|
||||
dataForm.salaryAmount = null;
|
||||
dataForm.mouthSalaryAmount = null;
|
||||
dataForm.positionSalaryAmount = null;
|
||||
// dataForm.salaryAmount = null;
|
||||
// dataForm.mouthSalaryAmount = null;
|
||||
// dataForm.positionSalaryAmount = null;
|
||||
};
|
||||
// ตำแหน่งเลขที่
|
||||
const posNoOptions = ref<Object[]>([
|
||||
|
|
@ -354,11 +358,42 @@ const checkPosition = (val: string) => {
|
|||
const num = placementPosition.value.findIndex((e: string) => e === val);
|
||||
return num;
|
||||
};
|
||||
const personal = ref<any>();
|
||||
|
||||
watch(props, () => {
|
||||
const dataPersonal = props.personal;
|
||||
if (dataPersonal) {
|
||||
dataPersonal.map((data: any) => {
|
||||
personal.value = data;
|
||||
});
|
||||
console.log("personal", personal.value);
|
||||
}
|
||||
if (personal.value.draft === false) {
|
||||
const findData = dataRespone.value.find(findByPerson);
|
||||
console.log(findData);
|
||||
loadTreeData();
|
||||
selectedPosition(findData.children.children.children)
|
||||
}
|
||||
});
|
||||
const findByPerson = (obj: any) => {
|
||||
if (
|
||||
obj.positionLineId === personal.value.positionLineId &&
|
||||
obj.positionTypeId === personal.value.positionTypeId &&
|
||||
obj.positionNumId === personal.value.posNoId
|
||||
) {
|
||||
return true;
|
||||
}
|
||||
if (obj.children && obj.children.length > 0) {
|
||||
obj.children = obj.children.find(findByPerson);
|
||||
return obj.children;
|
||||
}
|
||||
return false;
|
||||
};
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<q-dialog v-model="props.modal" persistent full-width>
|
||||
<q-card>
|
||||
<q-dialog v-model="props.modal" persistent>
|
||||
<q-card style="width: 700px; max-width: 80vw">
|
||||
<q-form ref="myFormPosition">
|
||||
<DialogHeader title="เลือกหน่วยงานที่รับบรรจุ" :close="closeModal" />
|
||||
<q-separator />
|
||||
|
|
@ -510,7 +545,7 @@ const checkPosition = (val: string) => {
|
|||
<q-scroll-area visible style="height: 70vh">
|
||||
<div class="row col-12 q-col-gutter-xs">
|
||||
<div class="col-xs-12 col-sm-12 col-md-12"></div>
|
||||
<div class="col-xs-6 col-sm-6 col-md-6">
|
||||
<div class="col-xs-12 col-sm-12 col-md-12">
|
||||
<datepicker
|
||||
menu-class-name="modalfix"
|
||||
v-model="dataForm.containDate"
|
||||
|
|
@ -532,10 +567,7 @@ const checkPosition = (val: string) => {
|
|||
:model-value="
|
||||
date2Thai(new Date(dataForm.containDate))
|
||||
"
|
||||
:rules="[
|
||||
(val: string) =>
|
||||
!!val ||
|
||||
`${'วันที่รายงานตัว'}`,
|
||||
:rules="[ (val: string) =>!!val ||`${'วันที่รายงานตัว'}`,
|
||||
]"
|
||||
:label="`${'วันที่รายงานตัว'}`"
|
||||
hide-bottom-space
|
||||
|
|
@ -553,7 +585,7 @@ const checkPosition = (val: string) => {
|
|||
</datepicker>
|
||||
</div>
|
||||
<q-space />
|
||||
<div class="col-xs-6 col-sm-6 col-md-6">
|
||||
<div class="col-xs-12 col-sm-12 col-md-12">
|
||||
<q-select
|
||||
class="full-width inputgreen cursor-pointer custom-input"
|
||||
outlined
|
||||
|
|
@ -567,7 +599,7 @@ const checkPosition = (val: string) => {
|
|||
map-options
|
||||
/>
|
||||
</div>
|
||||
<div class="col-xs-6 col-sm-6 col-md-6">
|
||||
<div class="col-xs-12 col-sm-12 col-md-12">
|
||||
<q-select
|
||||
outlined
|
||||
class="full-width inputgreen cursor-pointer custom-input"
|
||||
|
|
@ -581,7 +613,7 @@ const checkPosition = (val: string) => {
|
|||
map-options
|
||||
/>
|
||||
</div>
|
||||
<div class="col-xs-6 col-sm-6 col-md-6">
|
||||
<div class="col-xs-12 col-sm-12 col-md-12">
|
||||
<q-select
|
||||
outlined
|
||||
class="full-width inputgreen cursor-pointer custom-input"
|
||||
|
|
@ -596,7 +628,7 @@ const checkPosition = (val: string) => {
|
|||
/>
|
||||
</div>
|
||||
|
||||
<div class="col-xs-6 col-sm-6 col-md-6">
|
||||
<div class="col-xs-12 col-sm-12 col-md-12">
|
||||
<q-select
|
||||
outlined
|
||||
class="full-width inputgreen cursor-pointer custom-input"
|
||||
|
|
@ -610,7 +642,7 @@ const checkPosition = (val: string) => {
|
|||
map-options
|
||||
/>
|
||||
</div>
|
||||
<div class="col-xs-6 col-sm-6 col-md-6">
|
||||
<div class="col-xs-12 col-sm-12 col-md-12">
|
||||
<q-select
|
||||
outlined
|
||||
class="full-width inputgreen cursor-pointer custom-input"
|
||||
|
|
@ -624,7 +656,7 @@ const checkPosition = (val: string) => {
|
|||
map-options
|
||||
/>
|
||||
</div>
|
||||
<div class="col-xs-6 col-sm-6 col-md-6">
|
||||
<div class="col-xs-12 col-sm-12 col-md-12">
|
||||
<q-select
|
||||
outlined
|
||||
class="full-width inputgreen cursor-pointer custom-input"
|
||||
|
|
@ -640,10 +672,10 @@ const checkPosition = (val: string) => {
|
|||
map-options
|
||||
/>
|
||||
</div>
|
||||
<div class="col-sx-12 col-sm-12 col-md-12">
|
||||
<!-- <div class="col-sx-12 col-sm-12 col-md-12">
|
||||
<q-separator inset size="2px" class="q-my-md" />
|
||||
</div>
|
||||
<div class="col-xs-6 col-sm-6 col-md-6">
|
||||
</div> -->
|
||||
<!-- <div class="col-xs-6 col-sm-6 col-md-6">
|
||||
<q-input
|
||||
outlined
|
||||
dense
|
||||
|
|
@ -655,9 +687,9 @@ const checkPosition = (val: string) => {
|
|||
type="number"
|
||||
hide-bottom-space
|
||||
/>
|
||||
</div>
|
||||
</div> -->
|
||||
|
||||
<div class="col-xs-6 col-sm-6 col-md-6">
|
||||
<!-- <div class="col-xs-6 col-sm-6 col-md-6">
|
||||
<q-input
|
||||
outlined
|
||||
dense
|
||||
|
|
@ -671,9 +703,9 @@ const checkPosition = (val: string) => {
|
|||
type="number"
|
||||
hide-bottom-space
|
||||
/>
|
||||
</div>
|
||||
</div> -->
|
||||
|
||||
<div class="col-xs-6 col-sm-6 col-md-6">
|
||||
<!-- <div class="col-xs-6 col-sm-6 col-md-6">
|
||||
<q-input
|
||||
outlined
|
||||
dense
|
||||
|
|
@ -688,7 +720,7 @@ const checkPosition = (val: string) => {
|
|||
type="number"
|
||||
hide-bottom-space
|
||||
/>
|
||||
</div>
|
||||
</div> -->
|
||||
</div>
|
||||
</q-scroll-area>
|
||||
</q-card>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue