Merge branch 'develop' into anandadev
This commit is contained in:
commit
453726204c
19 changed files with 2045 additions and 956 deletions
|
|
@ -46,22 +46,61 @@ export default {
|
|||
|
||||
//education
|
||||
placementEducationId: (id: string) => `${placement}/education/${id}`,
|
||||
// position
|
||||
// position
|
||||
placementPosition: () => `${placement}/position/use`,
|
||||
// putPositiom
|
||||
putPosition: (id: any) => `${placement}/position/${id}`,
|
||||
// clear Position
|
||||
clearPosition: (personalId: string) => `${placement}/position/clear/${personalId}`,
|
||||
clearPosition: (personalId: string) =>
|
||||
`${placement}/position/clear/${personalId}`,
|
||||
|
||||
// order
|
||||
yearOptionsOrder: () => `${order}/order/fiscal-year`,
|
||||
createOrder: () => `${order}/order/detail`,
|
||||
listOrder: () => `${order}/order`,
|
||||
detailOrder:(orderId:string) => `${order}/order/detail/${orderId}`,
|
||||
deleteOrder:(orderId:string) => `${order}/order/${orderId}`,
|
||||
detailOrder: (orderId: string) => `${order}/order/detail/${orderId}`,
|
||||
deleteOrder: (orderId: string) => `${order}/order/${orderId}`,
|
||||
typeOrder: () => `${order}/order/order-type`,
|
||||
nextStep: (orderId: string) => `${order}/order/next/${orderId}`,
|
||||
prevStep: (orderId: string) => `${order}/order/prev/${orderId}`,
|
||||
|
||||
createOrder: () => `${order}/order/detail`,
|
||||
|
||||
examroundOrder: () => `${order}/order/detail/exam-round`,
|
||||
|
||||
//ข้อมูลเลือกรายชื่อออกคำสั่ง, ลบรายชื่อ
|
||||
personsOrder: (orderId: string) => `${order}/order/persons/${orderId}`,
|
||||
|
||||
//เปลี่ยน status ของคำสั่งไปขั้นตอนถัดไป
|
||||
nextOrder: (orderId: string) => `${order}/order/next/${orderId}`,
|
||||
//เปลี่ยน status ของคำสั่งไปขั้นตอนถัดไป
|
||||
preventOrder: (orderId: string) => `${order}/order/prev/${orderId}`,
|
||||
|
||||
//สลับลำดับข้อมูลในบัญชีแนบท้ายขึ้น
|
||||
swapUpOrder: (personalId: string) => `${order}/order/swap/up/${personalId}`,
|
||||
//สลับลำดับข้อมูลในบัญชีแนบท้ายลง
|
||||
swapDownOrder: (personalId: string) =>
|
||||
`${order}/order/swap/down/${personalId}`,
|
||||
|
||||
//บันทึกข้อมูลเงินเดือนสำหรับผู้บรรจุ
|
||||
salaryOrder: (id: string) => `${order}/order/salary/${id}`,
|
||||
|
||||
// popup แสดงรายชื่อตามหน่วยงานที่เลือก , popup เลือกรายชื่อส่งสำเนา
|
||||
copyOrderPersonsId: (id: string) => `${order}/order/copy-order/persons/${id}`,
|
||||
|
||||
copyOrder: `${order}/order/copy-order`,
|
||||
|
||||
copyOrderId: (id: string) => `${order}/order/copy-order/${id}`,
|
||||
|
||||
attachmentId: (id: string) => `${order}/order/attachment/${id}`,
|
||||
|
||||
attachmentOrderId: (orderId: string) =>
|
||||
`${order}/order/attachment/order-file/${orderId}`,
|
||||
attachmentFileId: (orderId: string) =>
|
||||
`${order}/order/attachment/file/${orderId}`,
|
||||
|
||||
orderReady: (id: string) => `${order}/order/ready/${id}`,
|
||||
attachmentOrder: (orderId: string) => `${order}/order/attachment/${orderId}`,
|
||||
|
||||
receiveData: () => `${receive}`,
|
||||
receiveDataId: (id: string) => `${receive}/${id}`,
|
||||
receivePosition: (id: string) => `${receive}/position/${id}`,
|
||||
|
|
|
|||
|
|
@ -6,7 +6,9 @@ export default {
|
|||
profile: (type: string, year: string) => `${retirement}/profile/${type}/${year}`,
|
||||
profileRetire: (retireProfileId: string) => `${retirement}/profile/${retireProfileId}`,
|
||||
listRetire: (retireId: string) => `${retirement}/${retireId}`,
|
||||
createnote: () => `${retirement}/reason`,
|
||||
reasonId: (retireId:string) => `${retirement}/reason/${retireId}`,
|
||||
retirement:(type:string,year:string) => `${retirement}/${type}/${year}`
|
||||
createnote: () => `${retirement}/edit`,
|
||||
removeProfile: () => `${retirement}/remove`,
|
||||
reasonId: (retireId: string) => `${retirement}/reason/${retireId}`,
|
||||
retirement: (type: string, year: string) => `${retirement}/${type}/${year}`,
|
||||
createProfile: () => `${retirement}/profile`,
|
||||
};
|
||||
|
|
|
|||
|
|
@ -48,6 +48,7 @@
|
|||
:name="4"
|
||||
title="รายละเอียดคำสั่งและแนบท้าย"
|
||||
prefix="4"
|
||||
:done="step > 4"
|
||||
:header-nav="step > 4"
|
||||
/>
|
||||
<template v-slot:message>
|
||||
|
|
@ -61,8 +62,17 @@
|
|||
</template>
|
||||
<script setup lang="ts">
|
||||
import { useRouter } from "vue-router";
|
||||
import { ref, defineAsyncComponent, onMounted } from "vue";
|
||||
import { ref, defineAsyncComponent, onMounted, onUnmounted } from "vue";
|
||||
import type { QStepper } from "quasar";
|
||||
import { useProbationDataStore } from "@/modules/05_placement/store";
|
||||
import { useRoute } from "vue-router";
|
||||
import http from "@/plugins/http";
|
||||
import config from "@/app.config";
|
||||
const route = useRoute();
|
||||
|
||||
const orderId_params = route.params.orderid;
|
||||
const probationData = useProbationDataStore();
|
||||
const { stepOrder, setStepOrder } = probationData;
|
||||
|
||||
const step01 = defineAsyncComponent(
|
||||
() =>
|
||||
|
|
@ -84,15 +94,38 @@ const step04 = defineAsyncComponent(
|
|||
const router = useRouter();
|
||||
const step = ref<number>(1);
|
||||
const stepper = ref<QStepper>();
|
||||
const orderId = ref<string>("");
|
||||
|
||||
const nextStep = () => {
|
||||
onUnmounted(() => {
|
||||
destroyLocalStorage();
|
||||
});
|
||||
const nextStep = async () => {
|
||||
stepper.value!.next();
|
||||
localStorage.setItem("currentStep", step.value.toString());
|
||||
if (orderId.value) {
|
||||
await http
|
||||
.put(config.API.nextStep(orderId.value))
|
||||
.then((res) => {
|
||||
console.log(res);
|
||||
})
|
||||
.catch((e) => {
|
||||
console.log(e);
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
const previousStep = () => {
|
||||
const previousStep = async () => {
|
||||
stepper.value!.previous();
|
||||
localStorage.setItem("currentStep", step.value.toString());
|
||||
if (orderId.value) {
|
||||
await http
|
||||
.put(config.API.prevStep(orderId.value))
|
||||
.then((res) => {
|
||||
console.log(res);
|
||||
})
|
||||
.catch((e) => {
|
||||
console.log(e);
|
||||
});
|
||||
}
|
||||
};
|
||||
const destroyLocalStorage = () => {
|
||||
localStorage.clear();
|
||||
|
|
@ -102,6 +135,10 @@ onMounted(() => {
|
|||
if (currentStep) {
|
||||
step.value = Number(currentStep);
|
||||
}
|
||||
if (orderId_params !== undefined) {
|
||||
orderId.value = orderId_params.toString();
|
||||
console.log(orderId.value);
|
||||
}
|
||||
});
|
||||
</script>
|
||||
<style>
|
||||
|
|
|
|||
|
|
@ -3,10 +3,24 @@
|
|||
<q-form ref="myForm" class="q-pa-md">
|
||||
<div class="row col-12 q-col-gutter-x-lg q-col-gutter-y-md">
|
||||
<div class="col-xs-12 col-md-6">
|
||||
<selector :class="getClass(true)" outlined dense lazy-rules v-model="typeOrder"
|
||||
:rules="[(val: string) => !!val || `${'กรุณาเลือกประเภทคำสั่ง'}`]" hide-bottom-space
|
||||
:label="`${'ประเภทคำสั่ง'}`" @update:modelValue="clickEditRow" emit-value map-options option-label="name"
|
||||
:options="typeOrderOption" option-value="id" use-input input-debounce="0" />
|
||||
<selector
|
||||
:class="getClass(true)"
|
||||
outlined
|
||||
dense
|
||||
lazy-rules
|
||||
v-model="typeOrder"
|
||||
:rules="[(val: string) => !!val || `${'กรุณาเลือกประเภทคำสั่ง'}`]"
|
||||
hide-bottom-space
|
||||
:label="`${'ประเภทคำสั่ง'}`"
|
||||
@update:modelValue="clickEditRow"
|
||||
emit-value
|
||||
map-options
|
||||
option-label="name"
|
||||
:options="typeOrderOption"
|
||||
option-value="id"
|
||||
use-input
|
||||
input-debounce="0"
|
||||
/>
|
||||
<!-- @filter="(inputValue:string,
|
||||
doneFn:Function) => filterSelector(inputValue, doneFn,'typeOrderOption'
|
||||
) " -->
|
||||
|
|
@ -15,36 +29,73 @@
|
|||
<div class="col-xs-12 col-md-6">
|
||||
<!-- :readonly="!edit"
|
||||
:borderless="!edit" -->
|
||||
<q-input :class="getClass(true)" outlined dense lazy-rules v-model="nameOrder"
|
||||
:rules="[(val) => !!val || `${'กรุณากรอกคำสั่งเรื่อง'}`]" :label="`${'คำสั่งเรื่อง'}`"
|
||||
@update:modelValue="clickEditRow" hide-bottom-space />
|
||||
<q-input
|
||||
:class="getClass(true)"
|
||||
outlined
|
||||
dense
|
||||
lazy-rules
|
||||
v-model="nameOrder"
|
||||
:rules="[(val) => !!val || `${'กรุณากรอกคำสั่งเรื่อง'}`]"
|
||||
:label="`${'คำสั่งเรื่อง'}`"
|
||||
@update:modelValue="clickEditRow"
|
||||
hide-bottom-space
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div class="row col-xs-7 col-md-3 q-col-gutter-x-xs">
|
||||
<div class="col-6">
|
||||
<q-input :class="getClass(true)" outlined dense lazy-rules v-model="command"
|
||||
:rules="[(val) => !!val || `${'กรุณากรอกคำสั่ง'}`]" :label="`${'คำสั่ง'}`" @update:modelValue="clickEditRow"
|
||||
hide-bottom-space type="number" />
|
||||
<q-input
|
||||
:class="getClass(true)"
|
||||
outlined
|
||||
dense
|
||||
lazy-rules
|
||||
v-model="command"
|
||||
:rules="[(val) => !!val || `${'กรุณากรอกคำสั่ง'}`]"
|
||||
:label="`${'คำสั่ง'}`"
|
||||
@update:modelValue="clickEditRow"
|
||||
hide-bottom-space
|
||||
type="number"
|
||||
/>
|
||||
</div>
|
||||
<label class="col-1 flex justify-center items-center text-bold">/</label>
|
||||
<label class="col-1 flex justify-center items-center text-bold"
|
||||
>/</label
|
||||
>
|
||||
<div class="col-5">
|
||||
<datepicker v-model="dateYear" :locale="'th'" autoApply year-picker :enableTimePicker="false"
|
||||
@update:modelValue="clickEditRow">
|
||||
<datepicker
|
||||
v-model="dateYear"
|
||||
:locale="'th'"
|
||||
autoApply
|
||||
year-picker
|
||||
:enableTimePicker="false"
|
||||
@update:modelValue="clickEditRow"
|
||||
>
|
||||
<template #year="{ year }">{{ year + 543 }}</template>
|
||||
<template #year-overlay-value="{ value }">{{
|
||||
parseInt(value + 543)
|
||||
}}</template>
|
||||
<template #trigger>
|
||||
<q-input :model-value="dateYear + 543" :rules="[(val) => !!val || `${'กรุณากรอก พ.ศ.'}`]"
|
||||
:label="`${'พ.ศ.'}`" dense outlined>
|
||||
<q-input
|
||||
:model-value="dateYear + 543"
|
||||
:rules="[(val) => !!val || `${'กรุณากรอก พ.ศ.'}`]"
|
||||
:label="`${'พ.ศ.'}`"
|
||||
dense
|
||||
outlined
|
||||
>
|
||||
</q-input>
|
||||
</template>
|
||||
</datepicker>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-xs-5 col-md-3">
|
||||
<datepicker menu-class-name="modalfix" v-model="dateCommand" :locale="'th'" autoApply borderless
|
||||
:enableTimePicker="false" week-start="0">
|
||||
<datepicker
|
||||
menu-class-name="modalfix"
|
||||
v-model="dateCommand"
|
||||
:locale="'th'"
|
||||
autoApply
|
||||
borderless
|
||||
:enableTimePicker="false"
|
||||
week-start="0"
|
||||
>
|
||||
<template #year="{ year }">
|
||||
{{ year + 543 }}
|
||||
</template>
|
||||
|
|
@ -52,12 +103,24 @@
|
|||
{{ parseInt(value + 543) }}
|
||||
</template>
|
||||
<template #trigger>
|
||||
<q-input outlined dense class="full-width datepicker" :model-value="dateCommand != null ? date2Thai(dateCommand) : null
|
||||
" :label="`${'วันที่มีผลออกคำสั่ง'}`" :rules="[
|
||||
(val) => !!val || `${'กรุณาเลือกวันที่มีผลออกคำสั่ง'}`,
|
||||
]">
|
||||
<q-input
|
||||
outlined
|
||||
dense
|
||||
class="full-width datepicker"
|
||||
:model-value="
|
||||
dateCommand != null ? date2Thai(dateCommand) : null
|
||||
"
|
||||
:label="`${'วันที่มีผลออกคำสั่ง'}`"
|
||||
:rules="[
|
||||
(val) => !!val || `${'กรุณาเลือกวันที่มีผลออกคำสั่ง'}`,
|
||||
]"
|
||||
>
|
||||
<template v-slot:prepend>
|
||||
<q-icon name="event" class="cursor-pointer" style="color: var(--q-primary)">
|
||||
<q-icon
|
||||
name="event"
|
||||
class="cursor-pointer"
|
||||
style="color: var(--q-primary)"
|
||||
>
|
||||
</q-icon>
|
||||
</template>
|
||||
</q-input>
|
||||
|
|
@ -66,10 +129,24 @@
|
|||
</div>
|
||||
|
||||
<div class="col-xs-12 col-md-6">
|
||||
<selector :class="getClass(true)" outlined dense lazy-rules v-model="byOrder"
|
||||
:rules="[(val: string) => !!val || `${'กรุณาเลือกคำสั่งโดย'}`]" hide-bottom-space :label="`${'คำสั่งโดย'}`"
|
||||
@update:modelValue="clickEditRow" emit-value map-options option-label="name" :options="byOrderOption"
|
||||
option-value="id" use-input input-debounce="0" />
|
||||
<selector
|
||||
:class="getClass(true)"
|
||||
outlined
|
||||
dense
|
||||
lazy-rules
|
||||
v-model="byOrder"
|
||||
:rules="[(val: string) => !!val || `${'กรุณาเลือกคำสั่งโดย'}`]"
|
||||
hide-bottom-space
|
||||
:label="`${'คำสั่งโดย'}`"
|
||||
@update:modelValue="clickEditRow"
|
||||
emit-value
|
||||
map-options
|
||||
option-label="name"
|
||||
:options="byOrderOption"
|
||||
option-value="id"
|
||||
use-input
|
||||
input-debounce="0"
|
||||
/>
|
||||
<!-- @filter="(inputValue:string,
|
||||
doneFn:Function) => filterSelector(inputValue, doneFn,'byOrderOption'
|
||||
) " -->
|
||||
|
|
@ -77,50 +154,101 @@
|
|||
<div class="col-xs-12 col-md-6">
|
||||
<!-- :readonly="!edit"
|
||||
:borderless="!edit" -->
|
||||
<q-input :class="getClass(true)" outlined dense lazy-rules v-model="nameCommand"
|
||||
:rules="[(val) => !!val || `${'กรุณากรอกผู้มีอำนาจลงนาม'}`]" :label="`${'ผู้มีอำนาจลงนาม'}`"
|
||||
@update:modelValue="clickEditRow" hide-bottom-space />
|
||||
<q-input
|
||||
:class="getClass(true)"
|
||||
outlined
|
||||
dense
|
||||
lazy-rules
|
||||
v-model="nameCommand"
|
||||
:rules="[(val) => !!val || `${'กรุณากรอกผู้มีอำนาจลงนาม'}`]"
|
||||
:label="`${'ผู้มีอำนาจลงนาม'}`"
|
||||
@update:modelValue="clickEditRow"
|
||||
hide-bottom-space
|
||||
/>
|
||||
</div>
|
||||
<div class="col-xs-12 col-md-6">
|
||||
<!-- :readonly="!edit"
|
||||
:borderless="!edit" -->
|
||||
<q-input :class="getClass(true)" outlined dense lazy-rules v-model="positionCommand"
|
||||
:rules="[(val) => !!val || `${'กรุณากรอกตำแหน่งผู้มีอำนาจลงนาม'}`]" :label="`${'ตำแหน่งผู้มีอำนาจลงนาม'}`"
|
||||
@update:modelValue="clickEditRow" hide-bottom-space />
|
||||
<q-input
|
||||
:class="getClass(true)"
|
||||
outlined
|
||||
dense
|
||||
lazy-rules
|
||||
v-model="positionCommand"
|
||||
:rules="[(val) => !!val || `${'กรุณากรอกตำแหน่งผู้มีอำนาจลงนาม'}`]"
|
||||
:label="`${'ตำแหน่งผู้มีอำนาจลงนาม'}`"
|
||||
@update:modelValue="clickEditRow"
|
||||
hide-bottom-space
|
||||
/>
|
||||
</div>
|
||||
<div class="col-12">
|
||||
<q-separator />
|
||||
</div>
|
||||
<div class="col-xs-12 col-md-6">
|
||||
<selector :class="getClass(true)" outlined dense lazy-rules v-model="examRound"
|
||||
:rules="[(val: string) => !!val || `${'กรุณาเลือกรอบการสอบ'}`]" hide-bottom-space :label="`${'รอบการสอบ'}`"
|
||||
@update:modelValue="clickEditRow" emit-value map-options option-label="examRoundName"
|
||||
:options="examRoundOption" option-value="examRoundValue" use-input input-debounce="0" />
|
||||
<selector
|
||||
:class="getClass(true)"
|
||||
outlined
|
||||
dense
|
||||
lazy-rules
|
||||
v-model="examRound"
|
||||
:rules="[(val: string) => !!val || `${'กรุณาเลือกรอบการสอบ'}`]"
|
||||
hide-bottom-space
|
||||
:label="`${'รอบการสอบ'}`"
|
||||
@update:modelValue="clickEditRow"
|
||||
emit-value
|
||||
map-options
|
||||
option-label="examRoundName"
|
||||
:options="examRoundOption"
|
||||
option-value="examRoundValue"
|
||||
use-input
|
||||
input-debounce="0"
|
||||
/>
|
||||
<!-- @filter="(inputValue:string,
|
||||
doneFn:Function) => filterSelector(inputValue, doneFn,'testOption'
|
||||
) " -->
|
||||
</div>
|
||||
<div class="col-xs-12 col-md-6">
|
||||
<selector :class="getClass(true)" outlined dense lazy-rules v-model="position"
|
||||
<!-- <selector :class="getClass(true)" outlined dense lazy-rules v-model="position"
|
||||
:rules="[(val: string) => !!val || `${'กรุณาเลือกตำแหน่งรับสมัคร'}`]" hide-bottom-space
|
||||
:label="`${'ตำแหน่งรับสมัคร'}`" @update:modelValue="clickEditRow" emit-value map-options option-label="name"
|
||||
:options="positionOption" option-value="id" use-input input-debounce="0" />
|
||||
:options="positionOption" option-value="id" use-input input-debounce="0" /> -->
|
||||
<!-- @filter="(inputValue:string, doneFn:Function) =>
|
||||
filterSelector(inputValue, doneFn,'positionOption' ) " -->
|
||||
</div>
|
||||
<div class="col-xs-12 col-md-6">
|
||||
<selector :class="getClass(true)" outlined dense lazy-rules v-model="register"
|
||||
:rules="[(val: string) => !!val || `${'กรุณาเลือกมติ กก. ครั้งที่ (เรื่อง รับสมัครสอบฯ)'}`]" hide-bottom-space
|
||||
:label="`${'มติ กก. ครั้งที่ (เรื่อง รับสมัครสอบฯ)'}`" @update:modelValue="clickEditRow" emit-value
|
||||
map-options option-label="name" :options="registerOption" option-value="id" use-input input-debounce="0" />
|
||||
<selector
|
||||
:class="getClass(true)"
|
||||
outlined
|
||||
dense
|
||||
lazy-rules
|
||||
v-model="register"
|
||||
:rules="[(val: string) => !!val || `${'กรุณาเลือกมติ กก. ครั้งที่ (เรื่อง รับสมัครสอบฯ)'}`]"
|
||||
hide-bottom-space
|
||||
:label="`${'มติ กก. ครั้งที่ (เรื่อง รับสมัครสอบฯ)'}`"
|
||||
@update:modelValue="clickEditRow"
|
||||
emit-value
|
||||
map-options
|
||||
option-label="name"
|
||||
:options="registerOption"
|
||||
option-value="id"
|
||||
use-input
|
||||
input-debounce="0"
|
||||
/>
|
||||
</div>
|
||||
<!-- @filter="(inputValue:string,
|
||||
doneFn:Function) => filterSelector(inputValue, doneFn,'registerOption'
|
||||
) " -->
|
||||
|
||||
<div class="col-xs-12 col-md-6">
|
||||
<datepicker menu-class-name="modalfix" v-model="dateRegister" :locale="'th'" autoApply borderless
|
||||
:enableTimePicker="false" week-start="0">
|
||||
<datepicker
|
||||
menu-class-name="modalfix"
|
||||
v-model="dateRegister"
|
||||
:locale="'th'"
|
||||
autoApply
|
||||
borderless
|
||||
:enableTimePicker="false"
|
||||
week-start="0"
|
||||
>
|
||||
<template #year="{ year }">
|
||||
{{ year + 543 }}
|
||||
</template>
|
||||
|
|
@ -128,13 +256,25 @@
|
|||
{{ parseInt(value + 543) }}
|
||||
</template>
|
||||
<template #trigger>
|
||||
<q-input outlined dense class="full-width datepicker" :model-value="dateRegister != null ? date2Thai(dateRegister) : null
|
||||
" :label="`${'ลงวันที่ (เรื่อง รับสมัครสอบฯ)'}`" :rules="[
|
||||
(val) =>
|
||||
!!val || `${'กรุณาเลือกลงวันที่ (เรื่อง รับสมัครสอบฯ)'}`,
|
||||
]">
|
||||
<q-input
|
||||
outlined
|
||||
dense
|
||||
class="full-width datepicker"
|
||||
:model-value="
|
||||
dateRegister != null ? date2Thai(dateRegister) : null
|
||||
"
|
||||
:label="`${'ลงวันที่ (เรื่อง รับสมัครสอบฯ)'}`"
|
||||
:rules="[
|
||||
(val) =>
|
||||
!!val || `${'กรุณาเลือกลงวันที่ (เรื่อง รับสมัครสอบฯ)'}`,
|
||||
]"
|
||||
>
|
||||
<template v-slot:prepend>
|
||||
<q-icon name="event" class="cursor-pointer" style="color: var(--q-primary)">
|
||||
<q-icon
|
||||
name="event"
|
||||
class="cursor-pointer"
|
||||
style="color: var(--q-primary)"
|
||||
>
|
||||
</q-icon>
|
||||
</template>
|
||||
</q-input>
|
||||
|
|
@ -142,18 +282,38 @@
|
|||
</datepicker>
|
||||
</div>
|
||||
<div class="col-xs-12 col-md-6">
|
||||
<selector :class="getClass(true)" outlined dense lazy-rules v-model="announce"
|
||||
<selector
|
||||
:class="getClass(true)"
|
||||
outlined
|
||||
dense
|
||||
lazy-rules
|
||||
v-model="announce"
|
||||
:rules="[(val: string) => !!val || `${'กรุณาเลือกมติ กก. ครั้งที่ (เรื่อง ผลการสอบแข่งขัน)'}`]"
|
||||
hide-bottom-space :label="`${'มติ กก. ครั้งที่ (เรื่อง ผลการสอบแข่งขัน)'}`" @update:modelValue="clickEditRow"
|
||||
emit-value map-options option-label="name" :options="announceOption" option-value="id" use-input
|
||||
input-debounce="0" />
|
||||
hide-bottom-space
|
||||
:label="`${'มติ กก. ครั้งที่ (เรื่อง ผลการสอบแข่งขัน)'}`"
|
||||
@update:modelValue="clickEditRow"
|
||||
emit-value
|
||||
map-options
|
||||
option-label="name"
|
||||
:options="announceOption"
|
||||
option-value="id"
|
||||
use-input
|
||||
input-debounce="0"
|
||||
/>
|
||||
<!-- @filter="(inputValue:string,
|
||||
doneFn:Function) => filterSelector(inputValue, doneFn,'announceOption'
|
||||
) " -->
|
||||
</div>
|
||||
<div class="col-xs-12 col-md-6">
|
||||
<datepicker menu-class-name="modalfix" v-model="dateAnnounce" :locale="'th'" autoApply borderless
|
||||
:enableTimePicker="false" week-start="0">
|
||||
<datepicker
|
||||
menu-class-name="modalfix"
|
||||
v-model="dateAnnounce"
|
||||
:locale="'th'"
|
||||
autoApply
|
||||
borderless
|
||||
:enableTimePicker="false"
|
||||
week-start="0"
|
||||
>
|
||||
<template #year="{ year }">
|
||||
{{ year + 543 }}
|
||||
</template>
|
||||
|
|
@ -161,13 +321,25 @@
|
|||
{{ parseInt(value + 543) }}
|
||||
</template>
|
||||
<template #trigger>
|
||||
<q-input outlined dense class="full-width datepicker" :model-value="dateAnnounce != null ? date2Thai(dateAnnounce) : null
|
||||
" :label="`${'ลงวันที่ (เรื่อง ผลการสอบแข่งขัน)'}`" :rules="[
|
||||
(val) =>
|
||||
!!val || `${'กรุณาเลือกลงวันที่ (เรื่อง ผลการสอบแข่งขัน)'}`,
|
||||
]">
|
||||
<q-input
|
||||
outlined
|
||||
dense
|
||||
class="full-width datepicker"
|
||||
:model-value="
|
||||
dateAnnounce != null ? date2Thai(dateAnnounce) : null
|
||||
"
|
||||
:label="`${'ลงวันที่ (เรื่อง ผลการสอบแข่งขัน)'}`"
|
||||
:rules="[
|
||||
(val) =>
|
||||
!!val || `${'กรุณาเลือกลงวันที่ (เรื่อง ผลการสอบแข่งขัน)'}`,
|
||||
]"
|
||||
>
|
||||
<template v-slot:prepend>
|
||||
<q-icon name="event" class="cursor-pointer" style="color: var(--q-primary)">
|
||||
<q-icon
|
||||
name="event"
|
||||
class="cursor-pointer"
|
||||
style="color: var(--q-primary)"
|
||||
>
|
||||
</q-icon>
|
||||
</template>
|
||||
</q-input>
|
||||
|
|
@ -198,13 +370,13 @@ import type {
|
|||
} from "@/modules/05_placement/interface/index/Main";
|
||||
import { useCounterMixin } from "@/stores/mixin";
|
||||
import type { QForm } from "quasar";
|
||||
import http from "@/plugins/http";
|
||||
import { useQuasar } from "quasar";
|
||||
import config from "@/app.config";
|
||||
import { useRoute } from "vue-router";
|
||||
import http from "@/plugins/http";
|
||||
import config from "@/app.config";
|
||||
|
||||
const mixin = useCounterMixin();
|
||||
const { date2Thai, messageError, showLoader, hideLoader } = mixin;
|
||||
const { date2Thai, messageError, showLoader, hideLoader, success } = mixin;
|
||||
const $q = useQuasar(); //ใช้ noti quasar
|
||||
const route = useRoute();
|
||||
|
||||
|
|
@ -366,7 +538,7 @@ const fetchdetailOrder = async () => {
|
|||
nameCommand.value = data.signatoryBy;
|
||||
positionCommand.value = data.signatoryPosition;
|
||||
examRound.value = data.examRound;
|
||||
position.value = data.registerPosition;
|
||||
// position.value = data.registerPosition;
|
||||
register.value = data.conclusionRegisterNo;
|
||||
dateRegister.value = data.conclusionRegisterDate;
|
||||
announce.value = data.conclusionResultNo;
|
||||
|
|
@ -398,7 +570,7 @@ const fecthExamRoundOption = async () => {
|
|||
examRoundOption.value = res.data.result;
|
||||
console.log(examRoundOption.value);
|
||||
})
|
||||
.catch((e) => { });
|
||||
.catch((e) => {});
|
||||
};
|
||||
const submit = async () => {
|
||||
const formdata = {
|
||||
|
|
@ -430,7 +602,7 @@ const submit = async () => {
|
|||
}).onOk(async () => {
|
||||
showLoader();
|
||||
if (!orderId) {
|
||||
createListOrder(formdata);
|
||||
createListOrder(formdata);
|
||||
} else {
|
||||
let orderIdString = orderId.toString();
|
||||
updateOrder(formdata, orderIdString);
|
||||
|
|
@ -444,11 +616,13 @@ const createListOrder = async (formData: Object) => {
|
|||
await http
|
||||
.post(config.API.createOrder(), formData)
|
||||
.then((res) => {
|
||||
console.log(res);
|
||||
const data = res.data.result;
|
||||
localStorage.setItem("orderId", data.id);
|
||||
next();
|
||||
success($q, "บันทึกข้อมูลสำเร็จ");
|
||||
})
|
||||
.catch((e) => {
|
||||
console.log(e);
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(() => {
|
||||
hideLoader();
|
||||
|
|
@ -462,9 +636,10 @@ const updateOrder = async (formData: Object, orderId: string) => {
|
|||
.then((res) => {
|
||||
console.log(res);
|
||||
next();
|
||||
success($q, "แก้ไขข้อมูลสำเร็จ");
|
||||
})
|
||||
.catch((e) => {
|
||||
console.log(e);
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(() => {
|
||||
hideLoader();
|
||||
|
|
|
|||
|
|
@ -1,9 +1,10 @@
|
|||
div
|
||||
<template>
|
||||
<div>
|
||||
<div class="q-py-md q-pl-md" style="height: 68vh; overflow-y: scroll">
|
||||
<div class="col-12 row q-pb-sm items-center">
|
||||
<q-btn flat round color="primary" @click="refresh" icon="mdi-refresh">
|
||||
<q-tooltip>อัปเดตข้อมูล</q-tooltip>
|
||||
<q-btn flat round color="primary" @click="refresh" icon="mdi-plus">
|
||||
<q-tooltip>เพิ่มข้อมูล</q-tooltip>
|
||||
</q-btn>
|
||||
<q-space />
|
||||
<div class="items-center" style="display: flex">
|
||||
|
|
@ -52,46 +53,20 @@
|
|||
:visible-columns="visibleColumns"
|
||||
:filter="filter"
|
||||
row-key="name"
|
||||
selection="multiple"
|
||||
v-model:selected="selected"
|
||||
>
|
||||
<!-- <template v-slot:header-selection="scope">
|
||||
<q-checkbox
|
||||
keep-color
|
||||
color="primary"
|
||||
dense
|
||||
v-model="scope.selected"
|
||||
/>
|
||||
</template> -->
|
||||
|
||||
<template v-slot:header="props">
|
||||
<q-tr :props="props">
|
||||
<q-th auto-width>
|
||||
<q-checkbox
|
||||
keep-color
|
||||
color="primary"
|
||||
dense
|
||||
v-model="props.selected"
|
||||
/>
|
||||
</q-th>
|
||||
<q-th v-for="col in props.cols" :key="col.name" :props="props">
|
||||
<span class="text-weight-medium">{{ col.label }}</span>
|
||||
</q-th>
|
||||
|
||||
<q-th auto-width />
|
||||
<q-th auto-width />
|
||||
<q-th auto-width />
|
||||
</q-tr>
|
||||
</template>
|
||||
<template v-slot:body="props">
|
||||
<q-tr :props="props" class="cursor-pointer">
|
||||
<q-td>
|
||||
<q-checkbox
|
||||
keep-color
|
||||
color="primary"
|
||||
dense
|
||||
v-model="props.selected"
|
||||
/>
|
||||
</q-td>
|
||||
<q-td
|
||||
v-for="col in props.cols"
|
||||
:key="col.name"
|
||||
|
|
@ -127,6 +102,19 @@
|
|||
<!-- <q-tooltip>เลื่อนลำดับลง</q-tooltip> -->
|
||||
</q-btn>
|
||||
</q-td>
|
||||
<q-td auto-width>
|
||||
<q-btn
|
||||
dense
|
||||
size="12px"
|
||||
flat
|
||||
round
|
||||
color="red"
|
||||
@click="dialogDeleteData(props.row.personId)"
|
||||
icon="mdi-delete"
|
||||
>
|
||||
<q-tooltip>ลบข้อมูล</q-tooltip>
|
||||
</q-btn>
|
||||
</q-td>
|
||||
</q-tr>
|
||||
</template>
|
||||
</d-table>
|
||||
|
|
@ -158,21 +146,15 @@
|
|||
</q-btn> -->
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!--********************************** เงินเดือน ********************************** -->
|
||||
<q-dialog v-model="modal" persistent>
|
||||
<q-card style="width: 70vw; max-width: 70vw">
|
||||
<q-card style="width: 50vw; max-width: 50vw">
|
||||
<q-form ref="myForm">
|
||||
<DialogHeader :tittle="titleName" :close="modalOpenClose" />
|
||||
<q-separator />
|
||||
<q-card-section class="q-pa-sm bg-grey-1">
|
||||
<div class="row col-12 q-col-gutter-sm">
|
||||
<div class="col-xs-12 col-sm-6 row">
|
||||
<q-card flat bordered class="fit q-pa-sm">
|
||||
<!-- style="height: 70vh" -->
|
||||
<q-scroll-area visible> </q-scroll-area>
|
||||
</q-card>
|
||||
</div>
|
||||
<div class="col-xs-12 col-sm-6">
|
||||
<div class="col-xs-12">
|
||||
<div class="col-12 row q-py-sm items-center q-col-gutter-sm">
|
||||
<div class="col-xs-6 col-sm-6 col-md-6">
|
||||
<q-input
|
||||
|
|
@ -236,14 +218,86 @@
|
|||
</q-form>
|
||||
</q-card>
|
||||
</q-dialog>
|
||||
<!--********************************** รายชื่อ ********************************** -->
|
||||
<q-dialog v-model="modalAdd" persistent>
|
||||
<q-card style="width: 50vw; max-width: 50vw">
|
||||
<q-form ref="myFormAdd">
|
||||
<DialogHeader tittle="รายชื่อในการออกคำสั่ง" :close="modalAddChange" />
|
||||
<q-separator />
|
||||
<q-card-section class="q-pa-sm bg-grey-1">
|
||||
<d-table
|
||||
:rows="rows"
|
||||
:columns="columns"
|
||||
:visible-columns="visibleColumns"
|
||||
:filter="filter"
|
||||
row-key="name"
|
||||
selection="multiple"
|
||||
v-model:selected="selected"
|
||||
>
|
||||
<template v-slot:header="props">
|
||||
<q-tr :props="props">
|
||||
<q-th auto-width>
|
||||
<q-checkbox
|
||||
keep-color
|
||||
color="primary"
|
||||
dense
|
||||
v-model="props.selected"
|
||||
/>
|
||||
</q-th>
|
||||
<q-th v-for="col in props.cols" :key="col.name" :props="props">
|
||||
<span class="text-weight-medium">{{ col.label }}</span>
|
||||
</q-th>
|
||||
</q-tr>
|
||||
</template>
|
||||
<template v-slot:body="props">
|
||||
<q-tr :props="props" class="cursor-pointer">
|
||||
<q-td>
|
||||
<q-checkbox
|
||||
keep-color
|
||||
color="primary"
|
||||
dense
|
||||
v-model="props.selected"
|
||||
/>
|
||||
</q-td>
|
||||
<q-td
|
||||
v-for="col in props.cols"
|
||||
:key="col.name"
|
||||
:props="props"
|
||||
>{{ col.name == "no" ? props.rowIndex + 1 : col.value }}</q-td
|
||||
>
|
||||
</q-tr>
|
||||
</template>
|
||||
</d-table>
|
||||
</q-card-section>
|
||||
<q-separator />
|
||||
<q-card-actions align="right">
|
||||
<q-btn
|
||||
dense
|
||||
unelevated
|
||||
label="บันทึก"
|
||||
color="public"
|
||||
@click="saveModalAdd"
|
||||
class="q-px-md"
|
||||
><!-- icon="mdi-content-save-outline"
|
||||
<q-tooltip>บันทึก</q-tooltip> -->
|
||||
</q-btn>
|
||||
</q-card-actions>
|
||||
</q-form>
|
||||
</q-card>
|
||||
</q-dialog>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import { ref } from "vue";
|
||||
import { ref, onMounted } from "vue";
|
||||
import { useQuasar } from "quasar";
|
||||
import type { QInput } from "quasar";
|
||||
import { useCounterMixin } from "@/stores/mixin";
|
||||
import type { QTableProps, QForm } from "quasar";
|
||||
import { useRoute } from "vue-router";
|
||||
import DialogHeader from "@/modules/04_registry/components/DialogHeader.vue";
|
||||
import type { ResponseData } from "@/modules/05_placement/interface/response/Order";
|
||||
|
||||
import http from "@/plugins/http";
|
||||
import config from "@/app.config";
|
||||
|
||||
const props = defineProps({
|
||||
next: {
|
||||
|
|
@ -259,8 +313,9 @@ const props = defineProps({
|
|||
const next = () => props.next();
|
||||
const previous = () => props.previous();
|
||||
const mixin = useCounterMixin(); //เรียกฟังก์ชันกลาง
|
||||
const { dialogMessage, messageError, showLoader, hideLoader } = mixin;
|
||||
const { dialogMessage, messageError, showLoader, hideLoader, success } = mixin;
|
||||
|
||||
const route = useRoute();
|
||||
const $q = useQuasar();
|
||||
|
||||
const modalData = ref<any>({
|
||||
|
|
@ -269,19 +324,31 @@ const modalData = ref<any>({
|
|||
mouthSalaryAmount: 0,
|
||||
});
|
||||
const myForm = ref<QForm | null>(null);
|
||||
const myFormAdd = ref<QForm | null>(null);
|
||||
const modal = ref<boolean>(false);
|
||||
const modalAdd = ref<boolean>(false);
|
||||
const titleName = ref<string>("");
|
||||
const filterRef = ref<QInput>();
|
||||
const filter = ref<string>("");
|
||||
const visibleColumns = ref<String[]>(["no", "idcard", "name", "educate"]);
|
||||
const visibleColumns = ref<String[]>(["no", "idCard", "name", "education"]);
|
||||
const columns = ref<QTableProps["columns"]>([
|
||||
{ name: "no", align: "left", label: "ลำดับ", field: "no", sortable: true },
|
||||
{
|
||||
name: "idcard",
|
||||
name: "no",
|
||||
align: "left",
|
||||
label: "ลำดับ",
|
||||
field: "no",
|
||||
sortable: true,
|
||||
sort: (a: string, b: string) =>
|
||||
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
|
||||
},
|
||||
{
|
||||
name: "idCard",
|
||||
align: "left",
|
||||
label: "เลขประจำตัวประชาชน",
|
||||
field: "idcard",
|
||||
field: "idCard",
|
||||
sortable: true,
|
||||
sort: (a: string, b: string) =>
|
||||
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
|
||||
},
|
||||
{
|
||||
name: "name",
|
||||
|
|
@ -289,94 +356,155 @@ const columns = ref<QTableProps["columns"]>([
|
|||
label: "ชื่อ-สกุล",
|
||||
field: "name",
|
||||
sortable: true,
|
||||
sort: (a: string, b: string) =>
|
||||
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
|
||||
},
|
||||
{
|
||||
name: "educate",
|
||||
name: "education",
|
||||
align: "left",
|
||||
label: "วุฒิการศึกษาในการออกคำสั่ง",
|
||||
field: "educate",
|
||||
field: "education",
|
||||
sortable: true,
|
||||
sort: (a: string, b: string) =>
|
||||
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
|
||||
},
|
||||
]);
|
||||
|
||||
const rows = ref<any>([
|
||||
{
|
||||
no: "0ac56905-1a74-4606-a120-233340adde95",
|
||||
name: "นางนัทธ์ เหล่าสกุล",
|
||||
idcard: "9158455632145",
|
||||
educate: "ปริญญาตรี",
|
||||
},
|
||||
{
|
||||
no: "0de607a0-b094-4a6d-9e30-979343ab5e53",
|
||||
name: "นางขรรค์ จันทรสมบัติ",
|
||||
idcard: "8558455632126",
|
||||
educate: "ปริญญาตรี",
|
||||
},
|
||||
{
|
||||
no: "93ca7366-2a35-4f94-a331-9c23c9ea78d3",
|
||||
name: "นางโอภาส จรัสวงศ์",
|
||||
idcard: "8158455635425",
|
||||
educate: "ปริญญาตรี",
|
||||
},
|
||||
{
|
||||
no: "d3777c19-2bd0-42df-90ce-c3eeeee55ac6",
|
||||
name: "นางธิญา หงษ์ทอง",
|
||||
idcard: "4558455632145",
|
||||
educate: "ปริญญาตรี",
|
||||
},
|
||||
{
|
||||
no: "1ccead6f-a851-4291-b3ab-a20757ecddbd",
|
||||
name: "นางธนวิทย์ พิกุลเทพ",
|
||||
idcard: "5542455632145",
|
||||
educate: "ปริญญาตรี",
|
||||
},
|
||||
{
|
||||
no: "1ccead6f-a851-4291-b3ab-a20757ecddbd",
|
||||
name: "นางหนึ่ง สตาภิรมย์",
|
||||
idcard: "7448455632145",
|
||||
educate: "ปริญญาตรี",
|
||||
},
|
||||
{
|
||||
no: "1ccead6f-a851-4291-b3ab-a20757ecddbd",
|
||||
name: "นางสัจพร คมคาย",
|
||||
idcard: "1236455632145",
|
||||
educate: "ปริญญาตรี",
|
||||
},
|
||||
{
|
||||
no: "1ccead6f-a851-4291-b3ab-a20757ecddbd",
|
||||
name: "นางตุลยากร ปรีดาศิริกุล",
|
||||
idcard: "1523455632145",
|
||||
educate: "ปริญญาตรี",
|
||||
},
|
||||
{
|
||||
no: "1ccead6f-a851-4291-b3ab-a20757ecddbd",
|
||||
name: "นางบัลลังค์ จิรวาณิชย์",
|
||||
idcard: "1258455632145",
|
||||
educate: "ปริญญาตรี",
|
||||
},
|
||||
{
|
||||
no: "1ccead6f-a851-4291-b3ab-a20757ecddbd",
|
||||
name: "นางคมคาย เรืองรังสรรค์",
|
||||
idcard: "8548455632145",
|
||||
educate: "ปริญญาตรี",
|
||||
},
|
||||
{
|
||||
no: "1ccead6f-a851-4291-b3ab-a20757ecddbd",
|
||||
name: "นางพรทิพา คมคาย",
|
||||
idcard: "6598455632145",
|
||||
educate: "ปริญญาตรี",
|
||||
},
|
||||
]);
|
||||
const rows = ref<ResponseData[]>([]);
|
||||
const selected = ref([]);
|
||||
|
||||
const upDown = (value: any, up: boolean = true) => {
|
||||
onMounted(async () => {
|
||||
await conditionData();
|
||||
});
|
||||
|
||||
const conditionData = async () => {
|
||||
const id = route.params.orderid
|
||||
? route.params.orderid.toString()
|
||||
: localStorage.getItem("orderId")
|
||||
? localStorage.getItem("orderId")
|
||||
: null;
|
||||
if (id !== null) {
|
||||
await getData(id);
|
||||
}
|
||||
};
|
||||
|
||||
const getData = async (id: string) => {
|
||||
showLoader();
|
||||
await http
|
||||
.get(config.API.personsOrder(id))
|
||||
.then((res) => {
|
||||
const data = res.data.result;
|
||||
// console.log(data);
|
||||
let list: ResponseData[] = [];
|
||||
data.map((r: ResponseData) => {
|
||||
list.push({
|
||||
education: r.education ?? "",
|
||||
idCard: r.idCard ?? "",
|
||||
name: r.name ?? "",
|
||||
personId: r.personId ?? "",
|
||||
selectStatus: r.selectStatus !== null ? r.selectStatus : false,
|
||||
sequence: r.sequence !== null ? r.sequence : 0,
|
||||
});
|
||||
});
|
||||
// console.log("list", list);
|
||||
rows.value = list;
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(() => {
|
||||
hideLoader();
|
||||
});
|
||||
};
|
||||
|
||||
const saveSalary = async (id: string) => {
|
||||
await http
|
||||
.put(config.API.salaryOrder(id))
|
||||
.then((res) => {
|
||||
// const data = res.data.result;
|
||||
// console.log(res);
|
||||
success($q, "บันทึกข้อมูลสำเร็จ");
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(() => {
|
||||
hideLoader();
|
||||
});
|
||||
};
|
||||
|
||||
const dialogDeleteData = async (id: string) => {
|
||||
dialogMessage(
|
||||
$q,
|
||||
"ยืนยันการลบข้อมูล",
|
||||
"ต้องการลบข้อมูลนี้ใช่หรือไม่?",
|
||||
"mdi-help-circle-outline",
|
||||
"ตกลง",
|
||||
"red",
|
||||
() => deleteData(id),
|
||||
undefined
|
||||
);
|
||||
};
|
||||
|
||||
const deleteData = async (id: string) => {
|
||||
await http
|
||||
.delete(config.API.personsOrder(id))
|
||||
.then((res) => {
|
||||
// const data = res.data.result;
|
||||
// console.log(res);
|
||||
success($q, "ลบข้อมูลสำเร็จ");
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(() => {
|
||||
hideLoader();
|
||||
});
|
||||
};
|
||||
|
||||
const swapUp = async (id: string) => {
|
||||
// id = personalId
|
||||
await http
|
||||
.put(config.API.swapUpOrder(id))
|
||||
.then((res) => {
|
||||
// const data = res.data.result;
|
||||
// console.log(res);
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(async () => {
|
||||
await conditionData();
|
||||
hideLoader();
|
||||
});
|
||||
};
|
||||
|
||||
const swapDown = async (id: string) => {
|
||||
// id = personalId
|
||||
await http
|
||||
.put(config.API.swapDownOrder(id))
|
||||
.then((res) => {
|
||||
// const data = res.data.result;
|
||||
// console.log(res);
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(async () => {
|
||||
await conditionData();
|
||||
hideLoader();
|
||||
});
|
||||
};
|
||||
|
||||
const upDown = async (value: any, up: boolean = true) => {
|
||||
const indexCurrent = value.rowIndex;
|
||||
if (up) {
|
||||
rows.value[indexCurrent] = rows.value[indexCurrent - 1];
|
||||
rows.value[indexCurrent - 1] = value.row;
|
||||
await swapUp(value.row.personId);
|
||||
// rows.value[indexCurrent] = rows.value[indexCurrent - 1];
|
||||
// rows.value[indexCurrent - 1] = value.row;
|
||||
} else {
|
||||
rows.value[indexCurrent] = rows.value[indexCurrent + 1];
|
||||
rows.value[indexCurrent + 1] = value.row;
|
||||
await swapDown(value.row.personId);
|
||||
// rows.value[indexCurrent] = rows.value[indexCurrent + 1];
|
||||
// rows.value[indexCurrent + 1] = value.row;
|
||||
}
|
||||
};
|
||||
|
||||
|
|
@ -407,32 +535,51 @@ const modalOpenClose = () => {
|
|||
}
|
||||
};
|
||||
|
||||
const modalAddChange = () => {
|
||||
modalAdd.value = !modalAdd.value;
|
||||
};
|
||||
|
||||
const saveModalAdd = () => {
|
||||
if (myFormAdd.value !== null) {
|
||||
myFormAdd.value.validate().then(async (result: boolean) => {
|
||||
if (result) {
|
||||
modalAddChange();
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
const click = (e: any) => {
|
||||
console.log(e);
|
||||
console.log(rows.value.length);
|
||||
};
|
||||
|
||||
const save = () => {
|
||||
if (selected.value.length > 0) {
|
||||
next();
|
||||
} else {
|
||||
dialogMessage(
|
||||
$q,
|
||||
"ข้อความแจ้งเตือน",
|
||||
"กรุณาเลือกรายชื่อ",
|
||||
"warning",
|
||||
undefined,
|
||||
"orange",
|
||||
undefined,
|
||||
undefined,
|
||||
true
|
||||
);
|
||||
}
|
||||
// if (selected.value.length > 0) {
|
||||
// next();
|
||||
// } else {
|
||||
// dialogMessage(
|
||||
// $q,
|
||||
// "ข้อความแจ้งเตือน",
|
||||
// "กรุณาเลือกรายชื่อ",
|
||||
// "warning",
|
||||
// undefined,
|
||||
// "orange",
|
||||
// undefined,
|
||||
// undefined,
|
||||
// true
|
||||
// );
|
||||
// }
|
||||
next();
|
||||
};
|
||||
|
||||
const selectData = (row: any) => {};
|
||||
|
||||
const refresh = () => {};
|
||||
const refresh = async () => {
|
||||
await conditionData();
|
||||
modalAddChange();
|
||||
selected.value = [];
|
||||
};
|
||||
|
||||
const resetFilter = () => {
|
||||
// reset ค่าที่ค้นหาเมื่อกดปุ่ม X ในกล่องค้นหา
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load diff
|
|
@ -286,14 +286,14 @@
|
|||
unelevated
|
||||
label="ออกคำสั่ง"
|
||||
:color="validateForm() ? 'public' : 'grey'"
|
||||
:disable="!validateForm()"
|
||||
:disable="statusOrder == 'N'"
|
||||
/>
|
||||
<q-btn
|
||||
class="text-dark"
|
||||
unelevated
|
||||
label="ส่งไปลงนาม"
|
||||
color="grey"
|
||||
disable
|
||||
:disable="statusOrder == 'N'"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -422,19 +422,42 @@ import { VuePDF, usePDF } from "@tato30/vue-pdf";
|
|||
import type { PDFDocumentLoadingTask } from "pdfjs-dist/types/src/display/api";
|
||||
import type { QForm } from "quasar";
|
||||
import { useCounterMixin } from "@/stores/mixin";
|
||||
import { useQuasar } from "quasar";
|
||||
import { useRoute } from "vue-router";
|
||||
import http from "@/plugins/http";
|
||||
import config from "@/app.config";
|
||||
|
||||
const mixin = useCounterMixin();
|
||||
const { date2Thai } = mixin;
|
||||
const { date2Thai, messageError, showLoader, hideLoader } = mixin;
|
||||
const route = useRoute();
|
||||
const $q = useQuasar();
|
||||
|
||||
const orderId_params = route.params.orderid;
|
||||
const dialog = ref<boolean>(false);
|
||||
const splitterModel = ref<number>(70);
|
||||
const tab = ref<string>("main");
|
||||
|
||||
const order = ref<string>("");
|
||||
const years = ref<number>(new Date().getDate());
|
||||
const date = ref<Date>(new Date());
|
||||
const fileOrder = ref<any>(null);
|
||||
const fileTailer = ref<any>(null);
|
||||
|
||||
const statusOrder = ref<string>();
|
||||
|
||||
// onUnmounted(() => {
|
||||
// window.removeEventListener("resize", (e: any) => {
|
||||
// myEventHandler(e);
|
||||
// });
|
||||
// });
|
||||
|
||||
const orderId = ref<string>("");
|
||||
onMounted(async () => {
|
||||
if (orderId_params !== undefined) {
|
||||
orderId.value = orderId_params.toString();
|
||||
fetchAttachment(orderId.value);
|
||||
fecthstatusOrder(orderId.value);
|
||||
}
|
||||
|
||||
// window.addEventListener("resize", (e: any) => {
|
||||
// myEventHandler(e);
|
||||
// });
|
||||
|
|
@ -447,6 +470,38 @@ onMounted(async () => {
|
|||
}, 1000);
|
||||
});
|
||||
|
||||
const fetchAttachment = async (orderId: string) => {
|
||||
showLoader();
|
||||
await http
|
||||
.get(config.API.attachmentOrder(orderId))
|
||||
.then((res) => {
|
||||
let response = res.data.result;
|
||||
console.log(response);
|
||||
order.value = response.orderNo;
|
||||
years.value = Number(response.orderYear);
|
||||
if (response.date !== undefined) {
|
||||
date.value = response.date;
|
||||
}
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(() => {
|
||||
hideLoader();
|
||||
});
|
||||
};
|
||||
const fecthstatusOrder = async (orderId: string) => {
|
||||
await http
|
||||
.get(config.API.orderReady(orderId))
|
||||
.then((res) => {
|
||||
let status = res.data.result;
|
||||
statusOrder.value = status.result;
|
||||
})
|
||||
.catch((e) => {
|
||||
console.log(e);
|
||||
});
|
||||
};
|
||||
|
||||
// const myEventHandler = (e: any) => {
|
||||
// console.log("e", e.target.innerWidth);
|
||||
// if (vuePDFRef !== null) {
|
||||
|
|
@ -475,15 +530,6 @@ const props = defineProps({
|
|||
const next = () => props.next();
|
||||
const previous = () => props.previous();
|
||||
|
||||
const splitterModel = ref<number>(70);
|
||||
const tab = ref<string>("main");
|
||||
const fileOrder = ref<any>(null);
|
||||
const fileTailer = ref<any>(null);
|
||||
|
||||
const order = ref<string>("");
|
||||
const years = ref<number>(new Date().getFullYear());
|
||||
const date = ref<Date>(new Date());
|
||||
|
||||
const onchangePage = (val: any) => {
|
||||
// console.log(val);
|
||||
if (vuePDFRef !== null) {
|
||||
|
|
@ -492,14 +538,57 @@ const onchangePage = (val: any) => {
|
|||
};
|
||||
|
||||
const save = () => {
|
||||
// putOrderData();
|
||||
if (myForm.value !== null) {
|
||||
myForm.value!.validate().then((success: Boolean) => {
|
||||
if (success) {
|
||||
// yay, models are correct
|
||||
$q.dialog({
|
||||
title: "ยืนยันการบันทึกข้อมูล",
|
||||
message: "ต้องการบันทึกข้อมูลนี้ใช่หรือไม่?",
|
||||
cancel: {
|
||||
flat: true,
|
||||
color: "negative",
|
||||
},
|
||||
persistent: true,
|
||||
})
|
||||
.onOk(async () => {
|
||||
await putOrderData();
|
||||
await postfileOrder();
|
||||
await postfileTailer();
|
||||
})
|
||||
.onCancel(() => {})
|
||||
.onDismiss(() => {});
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
const putOrderData = async () => {
|
||||
const orderData = {
|
||||
orderNo: order.value,
|
||||
orderYear: years.value.toString(),
|
||||
signDate: date.value,
|
||||
};
|
||||
await http
|
||||
.put(config.API.attachmentOrder(orderId.value), orderData)
|
||||
.then((res) => {
|
||||
console.log(res);
|
||||
})
|
||||
.catch((e) => {
|
||||
console.log(e);
|
||||
});
|
||||
};
|
||||
|
||||
const postfileOrder = async () => {
|
||||
const formData = new FormData();
|
||||
formData.append("File", fileOrder.value);
|
||||
await http.post(config.API.attachmentOrderId(orderId.value), formData);
|
||||
};
|
||||
const postfileTailer = async () => {
|
||||
const formData = new FormData();
|
||||
formData.append("File", fileTailer.value);
|
||||
await http.post(config.API.attachmentOrderId(orderId.value), formData);
|
||||
};
|
||||
|
||||
const validateForm = () => {
|
||||
return (
|
||||
|
|
@ -508,14 +597,12 @@ const validateForm = () => {
|
|||
order.value.trim() !== ""
|
||||
);
|
||||
};
|
||||
|
||||
const getClass = (val: boolean) => {
|
||||
return {
|
||||
"card-header-active q-px-lg q-py-md cursor-pointer": val,
|
||||
"card-header q-px-lg q-py-md cursor-pointer": !val,
|
||||
};
|
||||
};
|
||||
|
||||
const setTab = (val: string) => {
|
||||
tab.value = val;
|
||||
page.value = 1;
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
<script setup lang="ts">
|
||||
import { ref, computed } from "vue";
|
||||
import { ref, computed, onMounted } from "vue";
|
||||
import type { QTableProps } from "quasar";
|
||||
import { useQuasar } from "quasar";
|
||||
import { useRouter } from "vue-router";
|
||||
|
|
@ -7,16 +7,11 @@ import DialogFooter from "@/modules/05_placement/components/Receive/DialogFooter
|
|||
import DialogHeader from "@/modules/05_placement/components/Receive/DialogHeader.vue";
|
||||
import DialogOrgTree from "@/modules/05_placement/components/Receive/receiveModal.vue";
|
||||
import { useCounterMixin } from "@/stores/mixin";
|
||||
import { config } from "@fullcalendar/core/internal";
|
||||
import http from "@/plugins/http";
|
||||
import config from "@/app.config";
|
||||
const mixin = useCounterMixin(); //เรียกฟังก์ชันกลาง
|
||||
const {
|
||||
showLoader,
|
||||
hideLoader,
|
||||
dateText,
|
||||
success,
|
||||
messageError
|
||||
} = mixin;
|
||||
const { showLoader, hideLoader, dateText, success, messageError, date2Thai } =
|
||||
mixin;
|
||||
|
||||
const selected = ref([]);
|
||||
const checkSelected = computed(() => {
|
||||
|
|
@ -48,7 +43,7 @@ const visibleColumns = ref<string[]>([
|
|||
"citizenId",
|
||||
"fullname",
|
||||
"organizationName",
|
||||
"birthday"
|
||||
"birthday",
|
||||
]);
|
||||
|
||||
const visibleColumns2 = ref<string[]>([
|
||||
|
|
@ -56,7 +51,7 @@ const visibleColumns2 = ref<string[]>([
|
|||
"citizenId",
|
||||
"fullname",
|
||||
"organizationName",
|
||||
"birthday"
|
||||
"birthday",
|
||||
]); //ค้นหา คอลัมน์ คอลัมน์ที่แสดง
|
||||
const filterKeyword = ref<string>("");
|
||||
const filterKeyword2 = ref<string>("");
|
||||
|
|
@ -66,33 +61,63 @@ const resetFilter = () => {
|
|||
filterKeyword2.value = "";
|
||||
filterRef.value.focus();
|
||||
};
|
||||
onMounted(() => {
|
||||
fecthlistRecevice();
|
||||
});
|
||||
const listRecevice = ref<any>([]);
|
||||
const fecthlistRecevice = async () => {
|
||||
showLoader();
|
||||
await http
|
||||
.get(config.API.receiveData())
|
||||
.then((res) => {
|
||||
let response = res.data.result;
|
||||
listRecevice.value = response;
|
||||
// console.log(response);
|
||||
rows.value = response.map((e: any) => ({
|
||||
personalId: e.id,
|
||||
citizenId: e.citizenId,
|
||||
fullname: e.firstname + " " + e.lastname,
|
||||
organizationName:
|
||||
e.organizationName +
|
||||
" " +
|
||||
e.organizationShortName +
|
||||
" " +
|
||||
e.positionNumber +
|
||||
" " +
|
||||
e.positionPath,
|
||||
orgName: e.organizationName,
|
||||
organizationShortName: e.organizationShortName,
|
||||
positionNumber: e.positionNumber,
|
||||
positionPath: e.positionPath,
|
||||
birthday: date2Thai(e.dateOfBirth),
|
||||
}));
|
||||
// console.log(rows.value);
|
||||
rows2.value = rows.value.filter((e: any) => e.orgName !== null);
|
||||
})
|
||||
.catch((e) => {
|
||||
console.log(typeof e);
|
||||
})
|
||||
.finally(() => {
|
||||
hideLoader();
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
// const nextPage = (id:string) => {
|
||||
// router.push("/retirement/resign/"+id);
|
||||
// };
|
||||
const rows = ref<any>([
|
||||
{
|
||||
personalId: "08db721d-add6-47b0-8a13-5f45d106e8d1",
|
||||
citizenId: "1234444332222",
|
||||
fullname: "นางสาวอย พชช",
|
||||
organizationName: "นักจัดการงานทั่วไป",
|
||||
orgName: "กลุ่มงานช่วยนักบริหาร",
|
||||
organizationShortName: "สกจ.",
|
||||
positionNumber: "กก. 1",
|
||||
positionPath: "นักจัดการงานทั่วไป",
|
||||
birthday: dateText(new Date("1989-09-03"))
|
||||
},
|
||||
{
|
||||
personalId: "08db721d-adf2-4842-8056-1abb1539356e",
|
||||
citizenId: "0000222333333",
|
||||
fullname: "นางสาววญ สพ",
|
||||
organizationName: "นักจัดการงานทั่วไป",
|
||||
orgName: "กลุ่มงานช่วยนักบริหาร",
|
||||
organizationShortName: "สกจ.",
|
||||
positionNumber: "กก. 1",
|
||||
positionPath: "นักจัดการงานทั่วไป",
|
||||
birthday: dateText(new Date("1990-09-03")),
|
||||
},
|
||||
// {
|
||||
// personalId: "08db721d-add6-47b0-8a13-5f45d106e8d1",
|
||||
// citizenId: "1234444332222",
|
||||
// fullname: "นางสาวอย พชช",
|
||||
// organizationName: "นักจัดการงานทั่วไป",
|
||||
// orgName: "กลุ่มงานช่วยนักบริหาร",
|
||||
// organizationShortName: "สกจ.",
|
||||
// positionNumber: "กก. 1",
|
||||
// positionPath: "นักจัดการงานทั่วไป",
|
||||
// birthday: dateText(new Date("1989-09-03")),
|
||||
// },
|
||||
]);
|
||||
const rows2 = ref<any>([
|
||||
{
|
||||
|
|
@ -106,17 +131,6 @@ const rows2 = ref<any>([
|
|||
positionPath: "นักจัดการงานทั่วไป",
|
||||
birthday: dateText(new Date("1989-09-03")),
|
||||
},
|
||||
{
|
||||
personalId: "08db721d-adf2-4842-8056-1abb1539356e",
|
||||
citizenId: "0000222333333",
|
||||
fullname: "นางสาววญ สพ",
|
||||
organizationName: "นักจัดการงานทั่วไป",
|
||||
orgName: "กลุ่มงานช่วยนักบริหาร",
|
||||
organizationShortName: "สกจ.",
|
||||
positionNumber: "กก. 1",
|
||||
positionPath: "นักจัดการงานทั่วไป",
|
||||
birthday: dateText(new Date("1990-09-03")),
|
||||
},
|
||||
]);
|
||||
const columns = ref<QTableProps["columns"]>([
|
||||
{
|
||||
|
|
@ -219,11 +233,15 @@ const columns2 = ref<QTableProps["columns"]>([
|
|||
|
||||
const openModalTree = (id: string) => {
|
||||
personalId.value = id;
|
||||
personal.value = [];
|
||||
console.log(personalId.value);
|
||||
|
||||
personal.value = listRecevice.value.filter((e: any) => e.id === id);
|
||||
modalTree.value = true;
|
||||
};
|
||||
|
||||
const openDelete = (id: string) => {
|
||||
console.log(id);
|
||||
|
||||
$q.dialog({
|
||||
title: `ลบข้อมูล`,
|
||||
message: `ต้องการทำการลบข้อมูลนี้ใช่หรือไม่?`,
|
||||
|
|
@ -234,7 +252,7 @@ const openDelete = (id: string) => {
|
|||
.onOk(async () => {
|
||||
showLoader();
|
||||
await http
|
||||
.delete(config.API.receiveData(id))
|
||||
.delete(config.API.receiveDataId(id))
|
||||
.then((res) => {
|
||||
success($q, "ลบข้อมูลสำเร็จ");
|
||||
})
|
||||
|
|
@ -242,16 +260,15 @@ const openDelete = (id: string) => {
|
|||
messageError($q, e);
|
||||
})
|
||||
.finally(() => {
|
||||
fecthlistRecevice();
|
||||
hideLoader();
|
||||
});
|
||||
})
|
||||
.onCancel(() => {
|
||||
|
||||
});
|
||||
.onCancel(() => {});
|
||||
};
|
||||
|
||||
const closeModalTree = async () => {
|
||||
// await getTable();
|
||||
await fecthlistRecevice();
|
||||
modalTree.value = false;
|
||||
};
|
||||
|
||||
|
|
@ -272,27 +289,64 @@ const nextPage = (row: any) => {
|
|||
<q-tooltip>เพิ่มข้อมูล</q-tooltip>
|
||||
</q-btn>
|
||||
|
||||
<q-btn @click="popup()" size="14px" flat round color="add" icon="mdi-account-arrow-right">
|
||||
<q-btn
|
||||
@click="popup()"
|
||||
size="14px"
|
||||
flat
|
||||
round
|
||||
color="add"
|
||||
icon="mdi-account-arrow-right"
|
||||
>
|
||||
<q-tooltip>ส่งไปออกคำสั่งรับโอน</q-tooltip>
|
||||
</q-btn>
|
||||
|
||||
<q-space />
|
||||
<q-input class="col-xs-12 col-sm-3 col-md-2" standout dense v-model="filterKeyword" ref="filterRef" outlined
|
||||
debounce="300" placeholder="ค้นหา">
|
||||
<q-input
|
||||
class="col-xs-12 col-sm-3 col-md-2"
|
||||
standout
|
||||
dense
|
||||
v-model="filterKeyword"
|
||||
ref="filterRef"
|
||||
outlined
|
||||
debounce="300"
|
||||
placeholder="ค้นหา"
|
||||
>
|
||||
<template v-slot:append>
|
||||
<q-icon v-if="filterKeyword == ''" name="search" />
|
||||
<q-icon v-if="filterKeyword !== ''" name="clear" class="cursor-pointer" @click="resetFilter" />
|
||||
<q-icon
|
||||
v-if="filterKeyword !== ''"
|
||||
name="clear"
|
||||
class="cursor-pointer"
|
||||
@click="resetFilter"
|
||||
/>
|
||||
</template>
|
||||
</q-input>
|
||||
|
||||
<q-select v-model="visibleColumns" multiple outlined dense options-dense :display-value="$q.lang.table.columns"
|
||||
emit-value map-options :options="columns" option-value="name" options-cover style="min-width: 150px"
|
||||
class="col-xs-12 col-sm-3 col-md-2 q-ml-sm" />
|
||||
<q-select
|
||||
v-model="visibleColumns"
|
||||
multiple
|
||||
outlined
|
||||
dense
|
||||
options-dense
|
||||
:display-value="$q.lang.table.columns"
|
||||
emit-value
|
||||
map-options
|
||||
:options="columns"
|
||||
option-value="name"
|
||||
options-cover
|
||||
style="min-width: 150px"
|
||||
class="col-xs-12 col-sm-3 col-md-2 q-ml-sm"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div class="col-12 q-pt-sm">
|
||||
<d-table :columns="columns" :rows="rows" :filter="filterKeyword" row-key="fullname"
|
||||
:visible-columns="visibleColumns">
|
||||
<d-table
|
||||
:columns="columns"
|
||||
:rows="rows"
|
||||
:filter="filterKeyword"
|
||||
row-key="fullname"
|
||||
:visible-columns="visibleColumns"
|
||||
>
|
||||
<template v-slot:header="props">
|
||||
<q-tr :props="props">
|
||||
<q-th v-for="col in props.cols" :key="col.name" :props="props">
|
||||
|
|
@ -306,34 +360,52 @@ const nextPage = (row: any) => {
|
|||
<q-td key="no" :props="props" @click="nextPage(props.row)">
|
||||
{{ props.rowIndex + 1 }}
|
||||
</q-td>
|
||||
<q-td key="citizenId" :props="props" @click="nextPage(props.row)">
|
||||
<q-td
|
||||
key="citizenId"
|
||||
:props="props"
|
||||
@click="nextPage(props.row)"
|
||||
>
|
||||
{{ props.row.citizenId }}
|
||||
</q-td>
|
||||
<q-td key="fullname" :props="props" @click="nextPage(props.row)">
|
||||
<q-td
|
||||
key="fullname"
|
||||
:props="props"
|
||||
@click="nextPage(props.row)"
|
||||
>
|
||||
{{ props.row.fullname }}
|
||||
</q-td>
|
||||
<q-td key="organizationName" :props="props" @click="nextPage(props.row)">
|
||||
<div v-if="props.row.orgName !== null || props.row.positionPath !== null
|
||||
">
|
||||
<q-td
|
||||
key="organizationName"
|
||||
:props="props"
|
||||
@click="nextPage(props.row)"
|
||||
>
|
||||
<div
|
||||
v-if="
|
||||
props.row.orgName !== null ||
|
||||
props.row.positionPath !== null
|
||||
"
|
||||
>
|
||||
<div class="col-4">
|
||||
<div class="text-weight-medium">
|
||||
{{ props.row.orgName !== null ? props.row.orgName : "-" }}
|
||||
{{
|
||||
props.row.orgName !== null ? props.row.orgName : "-"
|
||||
}}
|
||||
{{
|
||||
props.row.organizationShortName !== null
|
||||
? `(${props.row.organizationShortName})`
|
||||
: ""
|
||||
? `(${props.row.organizationShortName})`
|
||||
: ""
|
||||
}}
|
||||
</div>
|
||||
<div class="text-weight-light">
|
||||
{{
|
||||
props.row.positionPath !== null
|
||||
? props.row.positionPath
|
||||
: "-"
|
||||
? props.row.positionPath
|
||||
: "-"
|
||||
}}
|
||||
{{
|
||||
props.row.positionNumber !== null
|
||||
? `(${props.row.positionNumber})`
|
||||
: ""
|
||||
? `(${props.row.positionNumber})`
|
||||
: ""
|
||||
}}
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -344,21 +416,57 @@ const nextPage = (row: any) => {
|
|||
</div>
|
||||
</div>
|
||||
</q-td>
|
||||
<q-td key="birthday" :props="props" @click="nextPage(props.row)">
|
||||
<q-td
|
||||
key="birthday"
|
||||
:props="props"
|
||||
@click="nextPage(props.row)"
|
||||
>
|
||||
{{ props.row.birthday }}
|
||||
</q-td>
|
||||
<q-td auto-width>
|
||||
<q-btn icon="mdi-dots-vertical" size="12px" color="grey-7" flat round dense>
|
||||
<q-menu transition-show="jump-down" transition-hide="jump-up">
|
||||
<q-btn
|
||||
icon="mdi-dots-vertical"
|
||||
size="12px"
|
||||
color="grey-7"
|
||||
flat
|
||||
round
|
||||
dense
|
||||
>
|
||||
<q-menu
|
||||
transition-show="jump-down"
|
||||
transition-hide="jump-up"
|
||||
>
|
||||
<q-list dense style="min-width: 100px">
|
||||
<q-item clickable v-close-popup @click="openModalTree(props.row.personalId)">
|
||||
<q-item-section style="min-width: 0px" avatar class="q-py-sm">
|
||||
<q-icon color="primary" size="xs" name="mdi-bookmark-outline" />
|
||||
<q-item
|
||||
clickable
|
||||
v-close-popup
|
||||
@click="openModalTree(props.row.personalId)"
|
||||
>
|
||||
<q-item-section
|
||||
style="min-width: 0px"
|
||||
avatar
|
||||
class="q-py-sm"
|
||||
>
|
||||
<q-icon
|
||||
color="primary"
|
||||
size="xs"
|
||||
name="mdi-bookmark-outline"
|
||||
/>
|
||||
</q-item-section>
|
||||
<q-item-section>เลือกหน่วยงานที่รับโอน</q-item-section>
|
||||
<q-item-section
|
||||
>เลือกหน่วยงานที่รับโอน</q-item-section
|
||||
>
|
||||
</q-item>
|
||||
<q-item clickable v-close-popup @click="openDelete(props.row.personalId)">
|
||||
<q-item-section style="min-width: 0px" avatar class="q-py-sm">
|
||||
<q-item
|
||||
clickable
|
||||
v-close-popup
|
||||
@click="openDelete(props.row.personalId)"
|
||||
>
|
||||
<q-item-section
|
||||
style="min-width: 0px"
|
||||
avatar
|
||||
class="q-py-sm"
|
||||
>
|
||||
<q-tooltip>ลบข้อมูล</q-tooltip>
|
||||
<q-icon color="red" size="xs" name="mdi-delete" />
|
||||
</q-item-section>
|
||||
|
|
@ -384,24 +492,61 @@ const nextPage = (row: any) => {
|
|||
<div class="row justify-end">
|
||||
<div class="col-5">
|
||||
<q-toolbar style="padding: 0">
|
||||
<q-input borderless outlined dense debounce="300" v-model="filterKeyword2" placeholder="ค้นหา"
|
||||
style="width: 850px; max-width: auto">
|
||||
<q-input
|
||||
borderless
|
||||
outlined
|
||||
dense
|
||||
debounce="300"
|
||||
v-model="filterKeyword2"
|
||||
placeholder="ค้นหา"
|
||||
style="width: 850px; max-width: auto"
|
||||
>
|
||||
<template v-slot:append>
|
||||
<q-icon v-if="filterKeyword2 == ''" name="search" />
|
||||
<q-icon v-if="filterKeyword2 !== ''" name="clear" class="cursor-pointer" @click="resetFilter" />
|
||||
<q-icon
|
||||
v-if="filterKeyword2 !== ''"
|
||||
name="clear"
|
||||
class="cursor-pointer"
|
||||
@click="resetFilter"
|
||||
/>
|
||||
</template>
|
||||
</q-input>
|
||||
<q-select v-model="visibleColumns2" multiple outlined dense options-dense
|
||||
:display-value="$q.lang.table.columns" emit-value map-options :options="columns2" option-value="name"
|
||||
options-cover style="min-width: 150px" class="gt-xs q-ml-sm" />
|
||||
<q-select
|
||||
v-model="visibleColumns2"
|
||||
multiple
|
||||
outlined
|
||||
dense
|
||||
options-dense
|
||||
:display-value="$q.lang.table.columns"
|
||||
emit-value
|
||||
map-options
|
||||
:options="columns2"
|
||||
option-value="name"
|
||||
options-cover
|
||||
style="min-width: 150px"
|
||||
class="gt-xs q-ml-sm"
|
||||
/>
|
||||
</q-toolbar>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<d-table :columns="columns2" :rows="rows2" :filter="filterKeyword2" row-key="personalId" flat
|
||||
:visible-columns="visibleColumns2" selection="multiple" v-model:selected="selected">
|
||||
<d-table
|
||||
:columns="columns2"
|
||||
:rows="rows2"
|
||||
:filter="filterKeyword2"
|
||||
row-key="personalId"
|
||||
flat
|
||||
:visible-columns="visibleColumns2"
|
||||
selection="multiple"
|
||||
v-model:selected="selected"
|
||||
>
|
||||
<template v-slot:header-selection="scope">
|
||||
<q-checkbox keep-color color="primary" dense v-model="scope.selected" />
|
||||
<q-checkbox
|
||||
keep-color
|
||||
color="primary"
|
||||
dense
|
||||
v-model="scope.selected"
|
||||
/>
|
||||
</template>
|
||||
<!-- <template v-slot:body-selection="scope">
|
||||
<q-checkbox
|
||||
|
|
@ -414,7 +559,12 @@ const nextPage = (row: any) => {
|
|||
<template v-slot:body="props">
|
||||
<q-tr :props="props" class="cursor-pointer">
|
||||
<q-td>
|
||||
<q-checkbox keep-color color="primary" dense v-model="props.selected" />
|
||||
<q-checkbox
|
||||
keep-color
|
||||
color="primary"
|
||||
dense
|
||||
v-model="props.selected"
|
||||
/>
|
||||
</q-td>
|
||||
<q-td key="no" :props="props">
|
||||
{{ props.rowIndex + 1 }}
|
||||
|
|
@ -425,28 +575,36 @@ const nextPage = (row: any) => {
|
|||
<q-td key="fullname" :props="props" @click="nextPage(props.row)">
|
||||
{{ props.row.fullname }}
|
||||
</q-td>
|
||||
<q-td key="organizationName" :props="props" @click="nextPage(props.row)">
|
||||
<div v-if="props.row.orgName !== null || props.row.positionPath !== null
|
||||
">
|
||||
<q-td
|
||||
key="organizationName"
|
||||
:props="props"
|
||||
@click="nextPage(props.row)"
|
||||
>
|
||||
<div
|
||||
v-if="
|
||||
props.row.orgName !== null ||
|
||||
props.row.positionPath !== null
|
||||
"
|
||||
>
|
||||
<div class="col-4">
|
||||
<div class="text-weight-medium">
|
||||
{{ props.row.orgName !== null ? props.row.orgName : "-" }}
|
||||
{{
|
||||
props.row.organizationShortName !== null
|
||||
? `(${props.row.organizationShortName})`
|
||||
: ""
|
||||
? `(${props.row.organizationShortName})`
|
||||
: ""
|
||||
}}
|
||||
</div>
|
||||
<div class="text-weight-light">
|
||||
{{
|
||||
props.row.positionPath !== null
|
||||
? props.row.positionPath
|
||||
: "-"
|
||||
? props.row.positionPath
|
||||
: "-"
|
||||
}}
|
||||
{{
|
||||
props.row.positionNumber !== null
|
||||
? `(${props.row.positionNumber})`
|
||||
: ""
|
||||
? `(${props.row.positionNumber})`
|
||||
: ""
|
||||
}}
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -466,11 +624,22 @@ const nextPage = (row: any) => {
|
|||
</q-card-section>
|
||||
|
||||
<q-card-actions align="right" class="bg-white text-teal">
|
||||
<q-btn label="บันทึก" @click="" :disable="checkSelected" color="public" />
|
||||
<q-btn
|
||||
label="บันทึก"
|
||||
@click=""
|
||||
:disable="checkSelected"
|
||||
color="public"
|
||||
/>
|
||||
</q-card-actions>
|
||||
</q-card>
|
||||
</q-dialog>
|
||||
|
||||
<DialogOrgTree v-model:modal="modalTree" :personalId="personalId" :close="closeModalTree" :personal="personal" />
|
||||
<DialogOrgTree
|
||||
v-model:modal="modalTree"
|
||||
:close="closeModalTree"
|
||||
:personal="personal"
|
||||
:personalId="personalId"
|
||||
/>
|
||||
<!-- :personalId="personalId" -->
|
||||
</template>
|
||||
<style scoped lang="scss"></style>
|
||||
|
|
|
|||
|
|
@ -153,15 +153,18 @@ const validateData = async () => {
|
|||
}
|
||||
});
|
||||
};
|
||||
|
||||
const id = ref<string>("");
|
||||
const saveAppoint = async () => {
|
||||
console.log("save", dataForm);
|
||||
|
||||
myFormPosition.value.validate().then(async (result: boolean) => {
|
||||
if (props.personalId !== undefined) {
|
||||
id.value = props.personalId.toString();
|
||||
}
|
||||
if (result) {
|
||||
const dataAppoint = await {
|
||||
personalId: props.personalId,
|
||||
containDate: dataForm.containDate,
|
||||
// personalId: props.personalId,
|
||||
recruitDate: dataForm.containDate,
|
||||
posNoId: dataForm.posNoId,
|
||||
positionId: dataForm.positionId,
|
||||
positionLevelId: dataForm.positionLevelId,
|
||||
|
|
@ -175,7 +178,7 @@ const saveAppoint = async () => {
|
|||
console.log("save appoint===>", dataAppoint);
|
||||
showLoader();
|
||||
await http
|
||||
.post(config.API.placementPass(), dataAppoint)
|
||||
.put(config.API.receivePosition(id.value), dataAppoint)
|
||||
.then((res) => {
|
||||
console.log("respone=>", res);
|
||||
success($q, "บันทึกสำเร็จ");
|
||||
|
|
@ -374,6 +377,8 @@ const expanded = ref<string[]>([]);
|
|||
watch(props, () => {
|
||||
expanded.value = [];
|
||||
const dataPersonal = props.personal;
|
||||
console.log(props.personal);
|
||||
|
||||
if (dataPersonal) {
|
||||
dataPersonal.map((data: any) => {
|
||||
personal.value = data;
|
||||
|
|
@ -382,15 +387,15 @@ watch(props, () => {
|
|||
}
|
||||
// console.log("draft===>", personal.value.draft);
|
||||
|
||||
if (personal.value && personal.value.draft === false) {
|
||||
if (personal.value) {
|
||||
// const findData = dataRespone.value.find(findByPerson);
|
||||
let findData: any = null;
|
||||
dataRespone.value.map((x: any) => {
|
||||
findData = findByPerson(x);
|
||||
console.log(findData);
|
||||
// console.log(findData);
|
||||
|
||||
if (findData != null) {
|
||||
console.log("findData===>", findData);
|
||||
// console.log("findData===>", findData);
|
||||
selectedPosition(findData);
|
||||
for (let i = 3; i <= findData.keyId.length; i += 2) {
|
||||
expanded.value.push(findData.keyId.slice(0, i));
|
||||
|
|
|
|||
7
src/modules/05_placement/interface/request/Order.ts
Normal file
7
src/modules/05_placement/interface/request/Order.ts
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
interface RequestCopyOrder {
|
||||
personalId: string;
|
||||
emailChannel: boolean;
|
||||
inboxChannel: boolean;
|
||||
}
|
||||
|
||||
export type { RequestCopyOrder };
|
||||
43
src/modules/05_placement/interface/response/Order.ts
Normal file
43
src/modules/05_placement/interface/response/Order.ts
Normal file
|
|
@ -0,0 +1,43 @@
|
|||
interface ResponseData {
|
||||
education: string;
|
||||
idCard: string;
|
||||
name: string;
|
||||
personId: string;
|
||||
selectStatus: boolean;
|
||||
sequence: number;
|
||||
}
|
||||
|
||||
interface ResponseOrganiz {
|
||||
firstName: string;
|
||||
idCard: string;
|
||||
lastName: string;
|
||||
name: string;
|
||||
position: string;
|
||||
prefixId: string;
|
||||
profileId: string;
|
||||
unit: string;
|
||||
}
|
||||
|
||||
interface ResponseCopyOrder {
|
||||
emailChannel: boolean;
|
||||
idCard: string;
|
||||
inboxChannel: boolean;
|
||||
name: string;
|
||||
personalId: string;
|
||||
position: string;
|
||||
selectStatus: boolean;
|
||||
sequence: number;
|
||||
unit: string;
|
||||
}
|
||||
|
||||
interface DataCopyOrder {
|
||||
personalId: string;
|
||||
name: string;
|
||||
idCard: string;
|
||||
position: string;
|
||||
unit: string;
|
||||
send: string;
|
||||
mutiselect: number[];
|
||||
}
|
||||
|
||||
export type { ResponseData, ResponseOrganiz, ResponseCopyOrder, DataCopyOrder };
|
||||
|
|
@ -229,8 +229,6 @@ export const useOrderPlacementDataStore = defineStore("placementOrder", () => {
|
|||
) => {
|
||||
DataMainUpdateOrder.value = [];
|
||||
|
||||
|
||||
|
||||
if (filter_1 === "" && filter_2 === "" && filterYear === 0) {
|
||||
DataMainUpdateOrder.value = DataMainOrigOrder.value;
|
||||
} else if (filter_1 !== "" && filter_2 === "" && filterYear === 0) {
|
||||
|
|
@ -269,7 +267,11 @@ export const useOrderPlacementDataStore = defineStore("placementOrder", () => {
|
|||
item.OrderStatus === filter_2 &&
|
||||
item.fiscalYear === filterYear
|
||||
);
|
||||
} else if (filter_1 == "ทั้งหมด" && filter_2 == "ทั้งหมด" && filterYear !== null) {
|
||||
} else if (
|
||||
filter_1 == "ทั้งหมด" &&
|
||||
filter_2 == "ทั้งหมด" &&
|
||||
filterYear !== null
|
||||
) {
|
||||
DataMainUpdateOrder.value = DataMainOrigOrder.value;
|
||||
}
|
||||
};
|
||||
|
|
@ -294,8 +296,18 @@ export const useProbationDataStore = defineStore("probationDataStore", () => {
|
|||
"blue-9",
|
||||
"blue-10",
|
||||
]);
|
||||
const orderId = ref<string>("");
|
||||
|
||||
const stepOrder = ref<number>(2);
|
||||
|
||||
const setOrderId = (val: string) => (orderId.value = val);
|
||||
const setStepOrder = (val: number) => (stepOrder.value = val);
|
||||
|
||||
return {
|
||||
ratingColors,
|
||||
orderId,
|
||||
stepOrder,
|
||||
setOrderId,
|
||||
setStepOrder,
|
||||
};
|
||||
});
|
||||
|
|
|
|||
|
|
@ -16,6 +16,7 @@ const retireld_params = route.params.id;
|
|||
const props = defineProps({
|
||||
retireld: String,
|
||||
profileId: String,
|
||||
dataProfile: Object,
|
||||
UpdateListId: {
|
||||
type: Function,
|
||||
default: () => console.log("UpdateListId"),
|
||||
|
|
@ -112,8 +113,8 @@ const rows = ref<any>([
|
|||
watch(modal, () => {
|
||||
if (modal.value === true) {
|
||||
retireld.value = props.retireld;
|
||||
if (type_params === "officer") {
|
||||
type.value = type_params;
|
||||
if (props.dataProfile.type === "OFFICER") {
|
||||
type.value = "officer";
|
||||
} else type.value = "all";
|
||||
|
||||
fecthlistRetire();
|
||||
|
|
@ -125,8 +126,7 @@ const fecthlistRetire = async () => {
|
|||
await http
|
||||
.get(config.API.profileOrganizRoot)
|
||||
.then((res) => {
|
||||
// console.log(res);
|
||||
|
||||
console.log(res);
|
||||
const id = res.data.result[0].id;
|
||||
if (id !== "") {
|
||||
findlist(id);
|
||||
|
|
|
|||
|
|
@ -4,18 +4,18 @@ import AddList from "../ListRetirement/AddList.vue";
|
|||
import { useCounterMixin } from "@/stores/mixin";
|
||||
import { useQuasar } from "quasar";
|
||||
import { useRoute } from "vue-router";
|
||||
import { useRouter } from "vue-router";
|
||||
import http from "@/plugins/http";
|
||||
import config from "@/app.config";
|
||||
import { useRouter } from "vue-router";
|
||||
|
||||
const router = useRouter();
|
||||
const route = useRoute();
|
||||
const router = useRouter();
|
||||
const $q = useQuasar();
|
||||
const mixin = useCounterMixin();
|
||||
const { showLoader, hideLoader, messageError, success } = mixin;
|
||||
const type_params = route.params.type;
|
||||
const year_params = route.params.year;
|
||||
const retireld_params = route.params.id;
|
||||
// const type_params = route.params.type;
|
||||
// const year_params = route.params.year;
|
||||
const retireld_params = route.params.retirementId;
|
||||
|
||||
const modalNote = ref<boolean>(false);
|
||||
const note = ref<string>("");
|
||||
|
|
@ -159,22 +159,28 @@ const visibleColumns = ref<string[]>([
|
|||
"bureau",
|
||||
]);
|
||||
|
||||
const action = ref<string>("");
|
||||
|
||||
onMounted(() => {
|
||||
// console.log(route.params);
|
||||
if (retireld_params === undefined) {
|
||||
fecthlistprofile(type_params, year_params);
|
||||
} else {
|
||||
fecthlist(retireld_params);
|
||||
}
|
||||
retireld.value = retireld_params.toString();
|
||||
console.log(retireld_params);
|
||||
fecthlistprofile(retireld.value);
|
||||
});
|
||||
const round = ref<number>();
|
||||
const typeReport = ref<string>("");
|
||||
const statusReport = ref<boolean>();
|
||||
const dataProfile = ref<Object>([]);
|
||||
// fecthlist
|
||||
const fecthlistprofile = async (type: any, year: any) => {
|
||||
const fecthlistprofile = async (id: string) => {
|
||||
showLoader();
|
||||
await http
|
||||
.get(config.API.profile(type, year))
|
||||
.then((res: any) => {
|
||||
// console.log(res);
|
||||
retireld.value = res.data.result.id;
|
||||
.get(config.API.listRetire(id))
|
||||
.then((res) => {
|
||||
console.log(res);
|
||||
dataProfile.value = res.data.result;
|
||||
round.value = res.data.result.round;
|
||||
statusReport.value = res.data.result.json;
|
||||
typeReport.value = res.data.result.typeReport;
|
||||
rows.value = res.data.result.profile.map((e: any) => ({
|
||||
id: e.id,
|
||||
profileId: e.profileId,
|
||||
|
|
@ -187,37 +193,12 @@ const fecthlistprofile = async (type: any, year: any) => {
|
|||
positionNumber: e.posNoEmployee,
|
||||
positionLavel: e.positionEmployeeLevel,
|
||||
bureau: e.oc,
|
||||
reason: e.reason,
|
||||
remove: e.remove,
|
||||
}));
|
||||
console.log(statusReport.value);
|
||||
})
|
||||
.catch((e: any) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(() => {
|
||||
hideLoader();
|
||||
});
|
||||
};
|
||||
const fecthlist = async (retireld: any) => {
|
||||
showLoader();
|
||||
await http
|
||||
.get(config.API.listRetire(retireld))
|
||||
.then((res: any) => {
|
||||
// retireld.value = res.data.result.id;
|
||||
rows.value = res.data.result.map((e: any) => ({
|
||||
id: e.id,
|
||||
profileId: e.profileId,
|
||||
order: e.order,
|
||||
fixname: e.prefix,
|
||||
name: e.fullName,
|
||||
organizationOrganization: e.organizationOrganization,
|
||||
positionType: e.positionType,
|
||||
position: e.position,
|
||||
positionNumber: e.posNoEmployee,
|
||||
positionLavel: e.positionEmployeeLevel,
|
||||
bureau: e.oc,
|
||||
}));
|
||||
// console.log(rows.value);
|
||||
})
|
||||
.catch((e: any) => {
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(() => {
|
||||
|
|
@ -225,10 +206,7 @@ const fecthlist = async (retireld: any) => {
|
|||
});
|
||||
};
|
||||
// DelProfile
|
||||
const clickDelete = (prop: any) => {
|
||||
console.log(prop);
|
||||
|
||||
let retireProfileId = prop.profileId;
|
||||
const clickDelete = () => {
|
||||
$q.dialog({
|
||||
title: "ยืนยันการลบข้อมูล",
|
||||
message: "ต้องการลบข้อมูลนี้ใช่หรือไม่?",
|
||||
|
|
@ -240,7 +218,10 @@ const clickDelete = (prop: any) => {
|
|||
})
|
||||
.onOk(async () => {
|
||||
await http
|
||||
.delete(config.API.profileRetire(retireProfileId))
|
||||
.post(config.API.removeProfile(), {
|
||||
retireProfileId: retireProfileId.value,
|
||||
reason: note.value,
|
||||
})
|
||||
.then(() => {
|
||||
success($q, "ลบข้อมูลสำเร็จ");
|
||||
})
|
||||
|
|
@ -248,29 +229,30 @@ const clickDelete = (prop: any) => {
|
|||
messageError($q, e);
|
||||
})
|
||||
.finally(async () => {
|
||||
if (retireld_params === undefined) {
|
||||
await fecthlistprofile(type_params, year_params);
|
||||
} else await fecthlist(retireld_params);
|
||||
retireld.value = retireld_params.toString();
|
||||
await fecthlistprofile(retireld.value);
|
||||
modalNote.value = false;
|
||||
});
|
||||
})
|
||||
.onCancel(() => { })
|
||||
.onDismiss(() => { });
|
||||
.onCancel(() => {})
|
||||
.onDismiss(() => {});
|
||||
};
|
||||
// note
|
||||
const fetchReason = async (prop: string) => {
|
||||
await http
|
||||
.get(config.API.reasonId(prop))
|
||||
.then((res: any) => {
|
||||
console.log(res.data.result);
|
||||
note.value = res.data.result.reason;
|
||||
retireProfileId.value = res.data.result.id;
|
||||
})
|
||||
.catch((e: any) => {
|
||||
messageError($q, e);
|
||||
});
|
||||
};
|
||||
|
||||
// const fetchReason = async (prop: string) => {
|
||||
// await http
|
||||
// .get(config.API.reasonId(prop))
|
||||
// .then((res: any) => {
|
||||
// console.log(res.data.result);
|
||||
// note.value = res.data.result.reason;
|
||||
// retireProfileId.value = res.data.result.id;
|
||||
// })
|
||||
// .catch((e: any) => {
|
||||
// messageError($q, e);
|
||||
// });
|
||||
// };
|
||||
const saveNote = () => {
|
||||
console.log(retireProfileId.value, note.value);
|
||||
|
||||
$q.dialog({
|
||||
title: "ยืนยันการบันทึกข้อมูลข้อมูล",
|
||||
message: "ต้องการบันทึกข้อมูลนี้ใช่หรือไม่?",
|
||||
|
|
@ -281,7 +263,6 @@ const saveNote = () => {
|
|||
persistent: true,
|
||||
})
|
||||
.onOk(async () => {
|
||||
// console.log("บันทึกข้อมูล");
|
||||
await http
|
||||
.post(config.API.createnote(), {
|
||||
retireProfileId: retireProfileId.value,
|
||||
|
|
@ -294,17 +275,18 @@ const saveNote = () => {
|
|||
messageError($q, e);
|
||||
})
|
||||
.finally(async () => {
|
||||
await fecthlist(retireld_params);
|
||||
retireld.value = retireld_params.toString();
|
||||
fecthlistprofile(retireld.value);
|
||||
modalNote.value = false;
|
||||
});
|
||||
})
|
||||
.onCancel(() => { })
|
||||
.onDismiss(() => { });
|
||||
.onCancel(() => {})
|
||||
.onDismiss(() => {});
|
||||
};
|
||||
|
||||
const UpdateListId = (retireld: string, pId: string) => {
|
||||
profileId.value = pId;
|
||||
fecthlist(retireld);
|
||||
fecthlistprofile(retireld);
|
||||
console.log("profileId", profileId.value);
|
||||
};
|
||||
const backHistory = () => {
|
||||
|
|
@ -342,11 +324,11 @@ const visibleNote = computed(() => {
|
|||
// .onCancel(() => {})
|
||||
// .onDismiss(() => {});
|
||||
// };
|
||||
// const classrow = (prop: any) => {
|
||||
// if (profileId.value!=='' && prop.profileId === profileId.value) {
|
||||
// return "color: #26a69a;";
|
||||
// } else return "";
|
||||
// };
|
||||
const classrow = (prop: any) => {
|
||||
if (profileId.value !== "" && prop.profileId === profileId.value) {
|
||||
return "color: #26a69a;";
|
||||
} else return "";
|
||||
};
|
||||
const paging = ref<boolean>(true);
|
||||
const pagination = ref({
|
||||
sortBy: "order",
|
||||
|
|
@ -362,13 +344,32 @@ const paginationLabel = (start: number, end: number, total: number) => {
|
|||
|
||||
<template>
|
||||
<div class="toptitle text-dark col-12 row items-center">
|
||||
<q-btn icon="mdi-arrow-left" unelevated round dense flat color="primary" class="q-mr-sm" @click="backHistory" />
|
||||
<q-btn
|
||||
icon="mdi-arrow-left"
|
||||
unelevated
|
||||
round
|
||||
dense
|
||||
flat
|
||||
color="primary"
|
||||
class="q-mr-sm"
|
||||
@click="backHistory"
|
||||
/>
|
||||
รายชื่อผู้เกษียณอายุราชการ
|
||||
</div>
|
||||
<div>
|
||||
<q-card class="col-12 q-pa-md">
|
||||
<div class="row col-12 q-pb-sm">
|
||||
<AddList :retireld="retireld" :profile-id="profileId" :UpdateListId="UpdateListId" />
|
||||
<AddList
|
||||
:dataProfile="dataProfile"
|
||||
:retireld="retireld"
|
||||
:profile-id="profileId"
|
||||
:UpdateListId="UpdateListId"
|
||||
v-if="
|
||||
statusReport === false &&
|
||||
(typeReport == 'ADD' || typeReport == '' || typeReport == null)
|
||||
"
|
||||
/>
|
||||
|
||||
<!-- <q-btn flat round style="color: #016987;" icon="save" @click="saveList">
|
||||
<q-tooltip>บันทึกข้อมูล</q-tooltip>
|
||||
</q-btn> -->
|
||||
|
|
@ -397,15 +398,35 @@ const paginationLabel = (start: number, end: number, total: number) => {
|
|||
|
||||
<q-space />
|
||||
<q-tabs shrink>
|
||||
<q-input borderless outlined dense debounce="300" v-model="filter" placeholder="ค้นหา" style="max-width: 200px"
|
||||
class="q-ml-sm">
|
||||
<q-input
|
||||
borderless
|
||||
outlined
|
||||
dense
|
||||
debounce="300"
|
||||
v-model="filter"
|
||||
placeholder="ค้นหา"
|
||||
style="max-width: 200px"
|
||||
class="q-ml-sm"
|
||||
>
|
||||
<template v-slot:append>
|
||||
<q-icon name="search" />
|
||||
</template>
|
||||
</q-input>
|
||||
<q-select v-model="visibleColumns" multiple outlined dense options-dense :display-value="$q.lang.table.columns"
|
||||
emit-value map-options :options="columns" option-value="name" options-cover style="min-width: 150px"
|
||||
class="gt-xs q-ml-sm">
|
||||
<q-select
|
||||
v-model="visibleColumns"
|
||||
multiple
|
||||
outlined
|
||||
dense
|
||||
options-dense
|
||||
:display-value="$q.lang.table.columns"
|
||||
emit-value
|
||||
map-options
|
||||
:options="columns"
|
||||
option-value="name"
|
||||
options-cover
|
||||
style="min-width: 150px"
|
||||
class="gt-xs q-ml-sm"
|
||||
>
|
||||
<!-- <template v-slot:option="{ opt }">
|
||||
<div>{{ opt.label }}</div>
|
||||
<div class="sublabel">{{ opt.sublabel }}</div>
|
||||
|
|
@ -415,9 +436,20 @@ const paginationLabel = (start: number, end: number, total: number) => {
|
|||
</div>
|
||||
|
||||
<div>
|
||||
<q-table flat dense bordered :rows="rows" :columns="columns" row-key="order" class="custom-header-table"
|
||||
:filter="filter" :visible-columns="visibleColumns" no-data-label="ไม่มีข้อมูล"
|
||||
:pagination-label="paginationLabel" v-model:pagination="pagination">
|
||||
<q-table
|
||||
flat
|
||||
dense
|
||||
bordered
|
||||
:rows="rows"
|
||||
:columns="columns"
|
||||
row-key="order"
|
||||
class="custom-header-table"
|
||||
:filter="filter"
|
||||
:visible-columns="visibleColumns"
|
||||
no-data-label="ไม่มีข้อมูล"
|
||||
:pagination-label="paginationLabel"
|
||||
v-model:pagination="pagination"
|
||||
>
|
||||
<template v-slot:header="props">
|
||||
<q-tr :props="props">
|
||||
<q-th v-for="col in props.cols" :key="col.name" :props="props">
|
||||
|
|
@ -429,20 +461,44 @@ const paginationLabel = (start: number, end: number, total: number) => {
|
|||
</div>
|
||||
</q-th>
|
||||
<q-th auto-width />
|
||||
<q-th auto-width />
|
||||
<q-th
|
||||
auto-width
|
||||
v-if="
|
||||
(typeReport === 'EDIT' ||
|
||||
typeReport === null ||
|
||||
typeReport === '') &&
|
||||
statusReport === false
|
||||
"
|
||||
/>
|
||||
<q-th
|
||||
auto-width
|
||||
v-if="
|
||||
(typeReport === 'REMOVE' ||
|
||||
typeReport === null ||
|
||||
typeReport === '') &&
|
||||
statusReport === false
|
||||
"
|
||||
/>
|
||||
</q-tr>
|
||||
</template>
|
||||
<template v-slot:body="props">
|
||||
<q-tr :props="props" class="cursor-pointer" :style="props.row.profileId === profileId && 'color: #26a69a;'"
|
||||
@click="
|
||||
fetchReason(props.row.id), (modalNote = true), (note = '')
|
||||
">
|
||||
<q-tr
|
||||
:props="props"
|
||||
class="cursor-pointer"
|
||||
:style="props.row.profileId === profileId && 'color: #26a69a;'"
|
||||
@click.stop="router.push(`/registry/${props.row.profileId}`)"
|
||||
>
|
||||
<q-td key="order" :props="props">{{ props.row.order }} </q-td>
|
||||
<!-- <q-td key="fixname" :props="props">{{ props.row.fixname }}</q-td> -->
|
||||
<q-td key="name" :props="props">{{ props.row.fixname + props.row.name }}</q-td>
|
||||
<q-td class="table_ellipsis" key="organizationOrganization" :props="props">{{
|
||||
props.row.organizationOrganization
|
||||
<q-td key="name" :props="props">{{
|
||||
props.row.fixname + props.row.name
|
||||
}}</q-td>
|
||||
<q-td
|
||||
class="table_ellipsis"
|
||||
key="organizationOrganization"
|
||||
:props="props"
|
||||
>{{ props.row.organizationOrganization }}</q-td
|
||||
>
|
||||
<q-td key="positionType" :props="props">{{
|
||||
props.row.positionType
|
||||
}}</q-td>
|
||||
|
|
@ -461,7 +517,9 @@ const paginationLabel = (start: number, end: number, total: number) => {
|
|||
<q-td key="govOffice" :props="props">{{
|
||||
props.row.govOffice
|
||||
}}</q-td>
|
||||
<q-td class="table_ellipsis" key="bureau" :props="props">{{ props.row.bureau }}</q-td>
|
||||
<q-td class="table_ellipsis" key="bureau" :props="props">{{
|
||||
props.row.bureau
|
||||
}}</q-td>
|
||||
<q-td>
|
||||
<!-- <q-btn
|
||||
:props="props"
|
||||
|
|
@ -477,20 +535,79 @@ const paginationLabel = (start: number, end: number, total: number) => {
|
|||
>
|
||||
<q-tooltip>โน้ต</q-tooltip></q-btn
|
||||
> -->
|
||||
<q-btn flat round color="blue" dense icon="mdi-file-account"
|
||||
@click="router.push(`/registry/${props.row.profileId}`)">
|
||||
<!-- <q-btn
|
||||
flat
|
||||
round
|
||||
color="blue"
|
||||
dense
|
||||
icon="mdi-file-account"
|
||||
@click.stop="router.push(`/registry/${props.row.profileId}`)"
|
||||
>
|
||||
<q-tooltip>ดูข้อมูลทะเบียนประวัติ</q-tooltip>
|
||||
</q-btn> -->
|
||||
</q-td>
|
||||
|
||||
<q-td
|
||||
auto-width
|
||||
v-if="
|
||||
(typeReport === 'EDIT' ||
|
||||
typeReport === null ||
|
||||
typeReport === '') &&
|
||||
statusReport === false
|
||||
"
|
||||
>
|
||||
<q-btn
|
||||
flat
|
||||
round
|
||||
color="primary"
|
||||
icon="mdi-pencil"
|
||||
dense
|
||||
@click.stop="
|
||||
(modalNote = true),
|
||||
(note = props.row.reason),
|
||||
(action = 'edit'),
|
||||
(retireProfileId = props.row.id)
|
||||
"
|
||||
>
|
||||
<q-tooltip>กรอกเหตุผล</q-tooltip>
|
||||
</q-btn>
|
||||
</q-td>
|
||||
<q-td auto-width>
|
||||
<q-btn flat round class="text-red-14" icon="mdi-delete" dense
|
||||
@click="clickDelete(props.row)"><q-tooltip>ลบข้อมูล</q-tooltip></q-btn>
|
||||
<q-td
|
||||
auto-width
|
||||
v-if="
|
||||
(typeReport === 'REMOVE' ||
|
||||
typeReport === null ||
|
||||
typeReport === '') &&
|
||||
statusReport === false
|
||||
"
|
||||
>
|
||||
<q-btn
|
||||
flat
|
||||
round
|
||||
class="text-red-14"
|
||||
icon="mdi-delete"
|
||||
dense
|
||||
@click.stop="
|
||||
(modalNote = true),
|
||||
(action = 'delete'),
|
||||
(note = props.row.reason),
|
||||
(retireProfileId = props.row.id)
|
||||
"
|
||||
><q-tooltip>ลบข้อมูล</q-tooltip></q-btn
|
||||
>
|
||||
</q-td>
|
||||
</q-tr>
|
||||
</template>
|
||||
<template v-slot:pagination="scope">
|
||||
<q-pagination v-model="pagination.page" color="primary" :max="scope.pagesNumber" :max-pages="5" size="sm"
|
||||
boundary-links direction-links></q-pagination>
|
||||
<q-pagination
|
||||
v-model="pagination.page"
|
||||
color="primary"
|
||||
:max="scope.pagesNumber"
|
||||
:max-pages="5"
|
||||
size="sm"
|
||||
boundary-links
|
||||
direction-links
|
||||
></q-pagination>
|
||||
</template>
|
||||
</q-table>
|
||||
</div>
|
||||
|
|
@ -502,19 +619,46 @@ const paginationLabel = (start: number, end: number, total: number) => {
|
|||
<q-card style="width: 700px; max-width: 80vw">
|
||||
<q-card-section class="q-pt-none">
|
||||
<q-toolbar class="q-py-md">
|
||||
<q-toolbar-title class="header-text text-weight-bolder">กรอกเหตุผล
|
||||
<q-toolbar-title class="header-text text-weight-bolder"
|
||||
>กรอกเหตุผล
|
||||
</q-toolbar-title>
|
||||
<q-btn icon="close" unelevated round dense @click="modalNote = false"
|
||||
style="color: #ff8080; background-color: #ffdede" />
|
||||
<q-btn
|
||||
icon="close"
|
||||
unelevated
|
||||
round
|
||||
dense
|
||||
@click="modalNote = false"
|
||||
style="color: #ff8080; background-color: #ffdede"
|
||||
/>
|
||||
</q-toolbar>
|
||||
</q-card-section>
|
||||
<q-card-section class="q-pt-none">
|
||||
<q-input outlined dense lazy-rules v-model="note" :rules="[(val) => !!val || 'กรุณากรอกเหตุผล']"
|
||||
:label="`${'กรอกเหตุผล'}`" type="textarea" />
|
||||
<q-input
|
||||
outlined
|
||||
dense
|
||||
lazy-rules
|
||||
v-model="note"
|
||||
:rules="[(val) => !!val || 'กรุณากรอกเหตุผล']"
|
||||
:label="`${'กรอกเหตุผล'}`"
|
||||
type="textarea"
|
||||
/>
|
||||
</q-card-section>
|
||||
|
||||
<q-card-actions align="right">
|
||||
<q-btn label="บักทึก" color="secondary" @click="saveNote" :disable="visibleNote" />
|
||||
<q-btn
|
||||
v-if="action === 'delete'"
|
||||
label="บันทึก"
|
||||
color="secondary"
|
||||
:disable="visibleNote"
|
||||
@click="clickDelete"
|
||||
/>
|
||||
<q-btn
|
||||
v-else
|
||||
label="บักทึก"
|
||||
color="secondary"
|
||||
@click="saveNote"
|
||||
:disable="visibleNote"
|
||||
/>
|
||||
</q-card-actions>
|
||||
</q-card>
|
||||
</q-dialog>
|
||||
|
|
|
|||
|
|
@ -45,10 +45,10 @@
|
|||
</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-top">สถานะ</div>
|
||||
<div class="col-12 text-detail">
|
||||
<q-icon size="20px" v-if="status == 'อยู่ระหว่างการทดลองงาน'" name="mdi-timer-sand" color="deep-orange" />
|
||||
<q-icon size="20px" v-else-if="status == 'ไม่ผ่านการทดลอง'" name="mdi-close" color="red" />
|
||||
<q-icon size="20px" v-if="status == 'อยู่ระหว่างการพิจารณา'" name="mdi-timer-sand" color="deep-orange" />
|
||||
<q-icon size="20px" v-else-if="status == 'อนุมัติ'" name="mdi-close" color="red" />
|
||||
<q-icon size="20px" v-else name="mdi-check" color="teal" />
|
||||
{{ status }}
|
||||
</div>
|
||||
|
|
@ -175,7 +175,7 @@ const name = ref<string>('นายสมคิด ยอดใจ')
|
|||
const position = ref<string>('นักจัดการงานทั่วไป')
|
||||
const level = ref<string>('ชำนาญการพิเศษ')
|
||||
const institution = ref<string>('ฝ่ายบริหารงานทั่วไป')
|
||||
const status = ref<string>('อยู่ระหว่างการทดลองงาน')
|
||||
const status = ref<string>('อยู่ระหว่างการพิจารณา')
|
||||
const edit = ref<boolean>(true)
|
||||
const location = ref<string>('ที่ทำงาน')
|
||||
const filingDate = ref<string>('21 ก.ค. 2566')
|
||||
|
|
|
|||
|
|
@ -1,8 +1,9 @@
|
|||
interface resMain{
|
||||
id:string;
|
||||
createdAt:Date;
|
||||
year:string;
|
||||
round:number;
|
||||
total:number;
|
||||
interface resMain {
|
||||
id: string;
|
||||
createdAt: Date;
|
||||
year: string;
|
||||
round: number;
|
||||
total: number;
|
||||
typeReport: String;
|
||||
}
|
||||
export type {resMain};
|
||||
export type { resMain };
|
||||
|
|
|
|||
|
|
@ -22,8 +22,8 @@ export default [
|
|||
},
|
||||
},
|
||||
{
|
||||
path: "/retirement/list/:type/:year",
|
||||
name: "retirement/list/",
|
||||
path: "/retirement/:retirementId",
|
||||
name: "retirementid",
|
||||
component: Listretirement,
|
||||
meta: {
|
||||
Auth: true,
|
||||
|
|
|
|||
|
|
@ -125,7 +125,7 @@
|
|||
<q-th v-for="col in props.cols" :key="col.name" :props="props">
|
||||
<span class="text-weight-medium">{{ col.label }}</span>
|
||||
</q-th>
|
||||
<q-th auto-width />
|
||||
<!-- <q-th auto-width /> -->
|
||||
</q-tr>
|
||||
</template>
|
||||
<template v-slot:body="props">
|
||||
|
|
@ -143,6 +143,9 @@
|
|||
<q-td key="retireNumber" :props="props">
|
||||
{{ props.row.total }}
|
||||
</q-td>
|
||||
<q-td key="typeReport" :props="props">
|
||||
{{ props.row.typeReport }}
|
||||
</q-td>
|
||||
<!-- <q-td auto-width>
|
||||
<q-btn
|
||||
dense
|
||||
|
|
@ -175,6 +178,100 @@
|
|||
</div>
|
||||
</div>
|
||||
</q-card>
|
||||
|
||||
<q-dialog v-model="modal">
|
||||
<q-card style="width: 450px; max-width: 80vw">
|
||||
<q-card-section>
|
||||
<div class="text-h6">เพิ่มประกาศ</div>
|
||||
</q-card-section>
|
||||
|
||||
<q-card-section class="q-pt-none">
|
||||
เลือกประกาศที่ต้องการเพิ่มข้อมูล
|
||||
</q-card-section>
|
||||
<q-separator />
|
||||
<div class="q-pa-md">
|
||||
<q-list>
|
||||
<q-item class="q-item-custom">
|
||||
<q-item-section avatar class="q-item-custom">
|
||||
<q-radio
|
||||
v-model="radio"
|
||||
val="ADD"
|
||||
color="teal"
|
||||
@click="action = ''"
|
||||
/>
|
||||
</q-item-section>
|
||||
<q-item-section>
|
||||
<q-item-label>ประกาศเพิ่มผู้เกษียณ</q-item-label>
|
||||
</q-item-section>
|
||||
</q-item>
|
||||
|
||||
<q-item class="q-item-custom">
|
||||
<q-item-section avatar class="q-item-custom">
|
||||
<q-radio
|
||||
v-model="radio"
|
||||
val="EDIT"
|
||||
color="teal"
|
||||
@click="action = ''"
|
||||
/>
|
||||
</q-item-section>
|
||||
<q-item-section>
|
||||
<q-item-label>ประกาศแก้ไขข้อมูลผู้เกษียน</q-item-label>
|
||||
<q-item-label v-if="radio === 'EDIT'">
|
||||
<q-select
|
||||
dense
|
||||
v-model="action"
|
||||
:options="actionOption"
|
||||
label="เลือกรอบ"
|
||||
option-label="round"
|
||||
option-value="id"
|
||||
emit-value
|
||||
map-options
|
||||
:rules="[(val) => !!val || 'กรุณาเลือกรอบ']"
|
||||
/>
|
||||
</q-item-label>
|
||||
</q-item-section>
|
||||
</q-item>
|
||||
|
||||
<q-item class="q-item-custom">
|
||||
<q-item-section avatar class="q-item-custom">
|
||||
<q-radio
|
||||
v-model="radio"
|
||||
val="REMOVE"
|
||||
color="teal"
|
||||
@click="action = ''"
|
||||
/>
|
||||
</q-item-section>
|
||||
<q-item-section>
|
||||
<q-item-label>ประกาศยกเลิกผู้เกษียณ</q-item-label>
|
||||
<q-item-label v-if="radio === 'REMOVE'">
|
||||
<q-select
|
||||
dense
|
||||
v-model="action"
|
||||
:options="actionOption"
|
||||
label="เลือกรอบ"
|
||||
option-label="round"
|
||||
option-value="id"
|
||||
emit-value
|
||||
map-options
|
||||
:rules="[(val) => !!val || 'กรุณาเลือกรอบ']"
|
||||
/></q-item-label>
|
||||
</q-item-section>
|
||||
</q-item>
|
||||
</q-list>
|
||||
</div>
|
||||
<q-separator />
|
||||
|
||||
<q-card-actions align="right" class="bg-white text-teal">
|
||||
<q-btn flat label="ยกเลิก" color="red" v-close-popup />
|
||||
<q-btn
|
||||
flat
|
||||
label="ตกลง"
|
||||
@click="clickSelect(action)"
|
||||
:disable="radio === '' || (action === '' && radio !== 'ADD')"
|
||||
/>
|
||||
</q-card-actions>
|
||||
</q-card>
|
||||
</q-dialog>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
|
|
@ -190,13 +287,13 @@ import http from "@/plugins/http";
|
|||
import config from "@/app.config";
|
||||
import { useCounterMixin } from "@/stores/mixin";
|
||||
import type { resMain } from "@/modules/06_retirement/interface/response/Main";
|
||||
const yearOptions = reactive<any[]>([]);
|
||||
|
||||
const mixin = useCounterMixin();
|
||||
const { messageError, date2Thai, showLoader, hideLoader } = mixin;
|
||||
const router = useRouter();
|
||||
const $q = useQuasar(); //ใช้ noti quasar
|
||||
const modal = ref<boolean>(false);
|
||||
const radio = ref<string>("");
|
||||
const pagination = ref({
|
||||
sortBy: "desc",
|
||||
descending: false,
|
||||
|
|
@ -204,8 +301,16 @@ const pagination = ref({
|
|||
rowsPerPage: 10,
|
||||
});
|
||||
|
||||
const actionOption = ref<resMain[]>([]);
|
||||
const action = ref<string>("");
|
||||
|
||||
const type = ref<string>("officer");
|
||||
const visibleColumns = ref<string[]>(["no", "Date", "retireNumber"]); //ค้นหา คอลัมน์ คอลัมน์ที่แสดง
|
||||
const visibleColumns = ref<string[]>([
|
||||
"no",
|
||||
"Date",
|
||||
"retireNumber",
|
||||
"typeReport",
|
||||
]); //ค้นหา คอลัมน์ คอลัมน์ที่แสดง
|
||||
|
||||
// หัวตาราง
|
||||
const columns = ref<QTableProps["columns"]>([
|
||||
|
|
@ -213,7 +318,6 @@ const columns = ref<QTableProps["columns"]>([
|
|||
name: "no",
|
||||
align: "left",
|
||||
label: "ลำดับ",
|
||||
sortable: true,
|
||||
field: "no",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
|
|
@ -222,7 +326,6 @@ const columns = ref<QTableProps["columns"]>([
|
|||
name: "Date",
|
||||
align: "left",
|
||||
label: "วันที่สร้าง",
|
||||
sortable: true,
|
||||
field: "Date",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
|
|
@ -231,11 +334,18 @@ const columns = ref<QTableProps["columns"]>([
|
|||
name: "retireNumber",
|
||||
align: "left",
|
||||
label: "จำนวนผู้เกษียณ",
|
||||
sortable: true,
|
||||
field: "retireNumber",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
},
|
||||
{
|
||||
name: "typeReport",
|
||||
align: "left",
|
||||
label: "ประเภทประการ",
|
||||
field: "typeReport",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
},
|
||||
]);
|
||||
|
||||
// ข้อมูลตาราง (จำลอง)
|
||||
|
|
@ -243,36 +353,44 @@ const currentYear = new Date().getFullYear();
|
|||
const rows = ref<resMain[]>([]);
|
||||
const tab = ref<any>("officer");
|
||||
const visibleColumns2 = ref<string[]>(["no", "name", "retireNumber"]);
|
||||
const getYear = () => {
|
||||
yearOptions.length = 0;
|
||||
yearOptions.push(currentYear + 543);
|
||||
// console.log(yearOptions);
|
||||
get(type.value, currentYear);
|
||||
fiscalyear.value = currentYear + 543;
|
||||
const yearOptions = reactive<any[]>([]);
|
||||
const filteryear = () => {
|
||||
console.log(yearOptions);
|
||||
yearOptions.push({ id: currentYear, name: currentYear + 543 });
|
||||
console.log(yearOptions[0].id);
|
||||
fiscalyear.value = yearOptions[0].id;
|
||||
fetchRetirement(type.value, currentYear);
|
||||
};
|
||||
const get = async (type: string, year: any) => {
|
||||
const fetchRetirement = async (type: string, year: any) => {
|
||||
radio.value = "";
|
||||
showLoader();
|
||||
await http
|
||||
.get(config.API.retirement(type, year))
|
||||
.then((res) => {
|
||||
// console.log(res);
|
||||
|
||||
console.log(res);
|
||||
rows.value = [];
|
||||
let data = res.data.result;
|
||||
rows.value = data.map((items: resMain) => ({
|
||||
rows.value = data.map((items: any) => ({
|
||||
id: items.id,
|
||||
Date: date2Thai(items.createdAt),
|
||||
year: items.year,
|
||||
retireNumber: items.round,
|
||||
total: items.total,
|
||||
round: items.round,
|
||||
typeReport: typeReportChangeName(items.typeReport),
|
||||
}));
|
||||
actionOption.value = rows.value;
|
||||
rows.value.sort((a, b) => a.round - b.round);
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.catch((e) => {})
|
||||
.finally(() => {
|
||||
hideLoader();
|
||||
});
|
||||
};
|
||||
onMounted(() => {
|
||||
getYear();
|
||||
filteryear();
|
||||
});
|
||||
// หัวตาราง2
|
||||
const columns2 = ref<QTableProps["columns"]>([
|
||||
|
|
@ -360,34 +478,73 @@ const rows2 = ref<FormMainProbation2[]>([
|
|||
// };
|
||||
|
||||
const clickAdd = () => {
|
||||
// modal.value = true;
|
||||
$q.dialog({
|
||||
title: 'เพิ่มประกาศ',
|
||||
message: 'เลือกประกาศที่ต้องการเพิ่มข้อมูล',
|
||||
options: {
|
||||
type: 'radio',
|
||||
model: 'opt1',
|
||||
// inline: true
|
||||
items: [
|
||||
{ label: 'ประกาศเพิ่มผู้เกษียณ', value: 'ADD'},
|
||||
{ label: 'ประกาศแก้ไขข้อมูลผู้เกษียน', value: 'EDIT' },
|
||||
{ label: 'ประกาศยกเลิกผู้เกษียณ', value: 'REMOVE' }
|
||||
]
|
||||
},
|
||||
cancel: {
|
||||
flat: true,
|
||||
color: "negative",
|
||||
},
|
||||
persistent: true,
|
||||
}).onOk(data => {
|
||||
console.log("option===>", data)
|
||||
router.push(`/retirement/list/${type.value}/${currentYear}`);
|
||||
}).onCancel(() => {
|
||||
}).onDismiss(() => {
|
||||
// console.log(rows.value.length, type.value);
|
||||
if (rows.value.length == 0) {
|
||||
$q.dialog({
|
||||
title: "ยืนยันการเพิ่มข้อมูลประกาศเกษียณ",
|
||||
message: "ต้องการเพิ่มข้อมูลประกาศเกษียณใช่หรือไม่?",
|
||||
cancel: {
|
||||
flat: true,
|
||||
color: "negative",
|
||||
},
|
||||
persistent: true,
|
||||
})
|
||||
/* $q.dialog({
|
||||
title: "ยืนยันการเพิ่มข้อมูลประกาศเกษียณ",
|
||||
message: "ต้องการเพิ่มข้อมูลประกาศเกษียณใช่หรือไม่?",
|
||||
.onOk(async () => {
|
||||
let data = { type: type.value, year: currentYear };
|
||||
await cerateRetirement(data);
|
||||
})
|
||||
.onCancel(() => {})
|
||||
.onDismiss(() => {});
|
||||
} else {
|
||||
modal.value = true;
|
||||
action.value = "";
|
||||
radio.value = "";
|
||||
}
|
||||
|
||||
// $q.dialog({
|
||||
// title: "เพิ่มประกาศ",
|
||||
// message: "เลือกประกาศที่ต้องการเพิ่มข้อมูล",
|
||||
// options: {
|
||||
// type: "radio",
|
||||
// model: "opt1",
|
||||
// // inline: true
|
||||
// items: [
|
||||
// { label: "ประกาศเพิ่มผู้เกษียณ", value: "ADD" },
|
||||
// { label: "ประกาศแก้ไขข้อมูลผู้เกษียน", value: "EDIT" },
|
||||
// { label: "ประกาศยกเลิกผู้เกษียณ", value: "REMOVE" },
|
||||
// ],
|
||||
// },
|
||||
// cancel: {
|
||||
// flat: true,
|
||||
// color: "negative",
|
||||
// },
|
||||
// persistent: true,
|
||||
// })
|
||||
// .onOk((data) => {
|
||||
// console.log("option===>", data);
|
||||
// router.push(`/retirement/list/${type.value}/${currentYear}`);
|
||||
// })
|
||||
// .onCancel(() => {})
|
||||
// .onDismiss(() => {});
|
||||
};
|
||||
const cerateRetirement = async (data: object) => {
|
||||
await http
|
||||
.post(config.API.createProfile(), data)
|
||||
.then((res) => {
|
||||
let response = res.data.result;
|
||||
let retirementId = response.id;
|
||||
router.push(`/retirement/${retirementId}`);
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
});
|
||||
};
|
||||
const clickSelect = async (action: string) => {
|
||||
console.log(action);
|
||||
// console.log(radio.value);
|
||||
$q.dialog({
|
||||
title: "ยืนยันการแก้ไขข้อมูลประกาศเกษียณ",
|
||||
message: "ต้องการแก้ไขข้อมูลประกาศเกษียณใช่หรือไม่?",
|
||||
cancel: {
|
||||
flat: true,
|
||||
color: "negative",
|
||||
|
|
@ -395,20 +552,29 @@ const clickAdd = () => {
|
|||
persistent: true,
|
||||
})
|
||||
.onOk(async () => {
|
||||
router.push(`/retirement/list/${type.value}/${currentYear}`);
|
||||
let data = {
|
||||
type: type.value,
|
||||
year: currentYear,
|
||||
retireHistoryId: action,
|
||||
option: radio.value,
|
||||
};
|
||||
console.log(data);
|
||||
|
||||
await cerateRetirement(data);
|
||||
})
|
||||
.onCancel(() => {})
|
||||
.onDismiss(() => {}); */
|
||||
.onDismiss(() => {});
|
||||
};
|
||||
|
||||
const clickClose = async () => {
|
||||
modal.value = false;
|
||||
};
|
||||
const fiscalyear = ref<number>();
|
||||
const fiscalyearOP = ref<any>([
|
||||
{ id: 1, name: "ทั้งหมด" },
|
||||
{ id: 2, name: "2565" },
|
||||
{ id: 3, name: "2565" },
|
||||
]);
|
||||
// const fiscalyearOP = ref<any>([
|
||||
// { id: 1, name: "ทั้งหมด" },
|
||||
// { id: 2, name: "2565" },
|
||||
// { id: 3, name: "2565" },
|
||||
// ]);
|
||||
|
||||
// ค้นหาในตาราง
|
||||
const filterKeyword = ref<string>("");
|
||||
|
|
@ -435,18 +601,34 @@ const paginationLabel = (start: string, end: string, total: string) => {
|
|||
const nextPage = (prop: any) => {
|
||||
// console.log(prop.id);
|
||||
|
||||
router.push(`/retirement/listretire/${prop.id}/${type.value}`);
|
||||
router.push(`/retirement/${prop.id}`);
|
||||
};
|
||||
|
||||
watch(type, () => {
|
||||
get(type.value, currentYear);
|
||||
fetchRetirement(type.value, currentYear);
|
||||
});
|
||||
const typeReportChangeName = (val: string) => {
|
||||
console.log(val);
|
||||
switch (val) {
|
||||
case "EDIT":
|
||||
return "ประกาศแก้ไข้เกษียณ";
|
||||
case "ADD":
|
||||
return "ประกาศเพิ่มเกษียณ";
|
||||
case "REMOVE":
|
||||
return "ประกาศยกเลิกเกษียณ";
|
||||
default:
|
||||
return "ประกาศข้อมูลเกษียณ";
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss" scope>
|
||||
.filter-card {
|
||||
background-color: #f1f1f1b0;
|
||||
}
|
||||
.q-item-custom {
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.toggle-expired-account {
|
||||
font-size: 12px;
|
||||
|
|
|
|||
|
|
@ -7,6 +7,7 @@
|
|||
"baseUrl": ".",
|
||||
"paths": {
|
||||
"@/*": ["./src/*"]
|
||||
}
|
||||
},
|
||||
"lib": ["dom", "es2015", "es2018", "es2018.promise"]
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue